@penguinharness/sandbox-dsh · plugins/sandbox-dsh/src/index.ts:255

SandboxDsh

component

The plugin's one module: a provider on the sandbox slot, the code half of the contribution the decorator declares (its manifest is generated into ifaces.json from here). Created per App, so a hot swap gets a fresh provider.

API

@Component({
  contributes: {
    // How the Plugins page shows this backend (read from ifaces.json, never by booting it).
    "PluginLibraryModule.cards": [
      {
        id: "sandbox-dsh.card",
        title: "DSH Sandbox",
        titleZh: "DSH 沙箱",
        descriptionZh:
          "PenguinHarness 的 DeepSeek Harness 沙箱适配器:把 DSH 的本地后端链接入本框架自己的沙箱接口。",
        shortDescription: "Linux, macOS and Windows: confine file writes only.",
        shortDescriptionZh: "Linux、macOS 与 Windows:只限制文件写入。",
        category: "sandbox",
        icon: "icon.svg",
        preinstall: false,
      },
    ],
    "SandboxModule.providers": [
      {
        id: "sandbox-dsh.provider",
        name: "dsh-local",
        dimensions: ["fs-write"],
        // A default backend on Linux beside bubblewrap, which needs unprivileged user
        // namespaces that Ubuntu 23.10 and later grant only to AppArmor-profiled programs.
        // Landlock needs neither a namespace nor root, so a default Ubuntu is still confined.
        defaultFor: ["linux"],
      },
    ],
    // No options: the group gives this backend its page in Settings, where its status shows.
    "PluginConfigProvider.groups": [
      { id: "sandbox-dsh", title: "DSH Sandbox", titleZh: "DSH 沙箱", properties: {} },
    ],
  },
})
export class SandboxDsh {
  @Bind("sandbox-dsh.provider") provider!: SandboxProviderSource;
  setup();
}

Dependencies & Wiring

Extracted from class decorators
@Bindbinds (1)
provider → sandbox-dsh.provider: SandboxProviderSource

Contributes

{
  "PluginLibraryModule.cards": [
    {
      "id": "sandbox-dsh.card",
      "title": "DSH Sandbox",
      "titleZh": "DSH 沙箱",
      "descriptionZh": "PenguinHarness 的 DeepSeek Harness 沙箱适配器:把 DSH 的本地后端链接入本框架自己的沙箱接口。",
      "shortDescription": "Linux, macOS and Windows: confine file writes only.",
      "shortDescriptionZh": "Linux、macOS 与 Windows:只限制文件写入。",
      "category": "sandbox",
      "icon": "icon.svg",
      "preinstall": false
    }
  ],
  "SandboxModule.providers": [
    {
      "id": "sandbox-dsh.provider",
      "name": "dsh-local",
      "dimensions": [
        "fs-write"
      ],
      "defaultFor": [
        "linux"
      ]
    }
  ],
  "PluginConfigProvider.groups": [
    {
      "id": "sandbox-dsh",
      "title": "DSH Sandbox",
      "titleZh": "DSH 沙箱",
      "properties": {}
    }
  ]
}

Target slots: PluginLibraryModule.cards · SandboxModule.providers · PluginConfigProvider.groups

Methods (1)

setup

setup()