返回 CodeWhale
DSH_PLUGIN_COMPAT.md
根目录 / docs / DSH_PLUGIN_COMPAT.md
1 # DeepSeek Harness Plugin Compatibility
2
3 Codewhale runs reviewed DeepSeek Harness (DSH) plugins in its experimental
4 Native plugin host ([EXTENSIONS.md](EXTENSIONS.md)). The pinned target is DSH
5 **0.2.2-rc.1** (accepting Cordis 4.1.0-compatible **0.2.1-rc.5** and **0.2.2-rc.1..rc.5**
6 bundles) with Cordis **4.1.0**, pinned in `crates/engine/extension-host/src/dsh/compatibility.json`.
7 The Rust Engine keeps turns, sessions, approvals, credentials and receipts; a
8 DSH service is offered only where it maps onto one of those existing owners.
9 Everything else is refused by name when the plugin activates, never faked.
10
11 This page is the equivalence checklist. "Verified" names the check that was
12 run against the commit that landed the behavior. It is not a release
13 qualification, and hosted CI, Linux and Windows runs are listed separately.
14
15 For the separate launcher that runs your own installed `dsh`, see
16 [DeepSeek Harness integration](INTEGRATIONS_DSH.md). Which published DSH
17 packages activate unmodified, and what each of the others is missing, is in
18 [DSH compatibility](DSH_COMPATIBILITY.md): most published packages do not
19 activate in this version.
20
21 ## Packages, review and trust
22
23 | DSH behavior | In Codewhale | Status |
24 | --- | --- | --- |
25 | Install a bundle package (`dsh.bundle.patch`, Cordis patch YAML) | `/plugin import dsh`, `POST /v1/apps/plugins/import/dsh/preview`, then install with the previewed content hash | Verified on macOS over the Runtime API |
26 | A new plugin does nothing until reviewed | installed disabled and untrusted; trust needs the review token; enable is separate | Verified on macOS over the Runtime API |
27 | Trust covers the bytes and the compatibility table | changing either invalidates earlier trust | Verified by focused Engine tests |
28 | Bytes changed after review | install refused with a 409 conflict, nothing installed | Verified by focused Engine tests (`17ebeb5f61`) |
29 | Update and rollback walkthrough | existing update/revoke/remove paths | Not verified |
30 | Desktop app preview → install → trust → enable | App plugin settings | Built and verified for bundled Agent Teams |
31
32 ## What a plugin may inject, and what it may never provide
33
34 Compatibility table version 3 separates injectable services by their source
35 and keeps the authority refusal list separate:
36
37 - `provided_services` groups what a plugin may **inject** under `dsh`,
38 `cordis` and `codewhale`. `HostRoot` in
39 `crates/engine/extension-host/src/root.ts` admits the union of those groups
40 and fails activation for any other injected name.
41 - `refused_services` is what a plugin may **not provide** — the Codewhale core
42 owns that authority. The root reflection wrapper refuses a plugin that
43 calls `provide` for one of those names. The single exception is the host's own
44 shim of that name, provided once by the root itself.
45
46 So `tools` is injectable and unprovidable: a plugin uses the Engine's tool
47 registry through the host shim and can never install a second one. `events`,
48 `logger`, `reflect` and `registry` are Cordis framework built-ins supplied by
49 the host root rather than Codewhale shims. `loader` maps to the reviewed loader
50 and is injectable inside reviewed compositions without being advertised as
51 a root service. `prompt`, `avatars`, `mcp` and `shellHooks` are Codewhale
52 compatibility services, not services declared by DSH. This reclassification
53 keeps the same injectable names. Its changed table digest requires fresh
54 Native review and trust for previously reviewed plugins.
55
56 The rc.1 update reuses loader 1.1.0, include 1.1.0 and group 1.1.0 while
57 keeping reviewed module imports and non-writing composition: tree mutations
58 now report through `commit(change)`, which a reviewed composition ignores, and
59 bare specifiers keep the native import fallback instead of upstream's
60 writable `.cordis/resolve.mjs` helper. The `dsh-tools` definition excerpt is
61 taken from rc.1's split build with unchanged definition semantics. In
62 `compatibility.json` v3, grant-gated brokered host services add `remote` and
63 `workspace` under `codewhale` and `llm`, `credentials`, `settings`,
64 `pluginManager`, `deepseekAccount`, and `terminal` under `dsh`; `row_bridges`
65 include the 9 `"host-spine"` bridges (`@deepseek-ai/dsh-storage`,
66 `@deepseek-ai/dsh-storage-json`, `@deepseek-ai/dsh-storage-domain`,
67 `@deepseek-ai/dsh-workspace`, `@deepseek-ai/dsh-code-runtime-worker-thread`,
68 `@deepseek-ai/dsh-tool-subagent/model-selection-settings`,
69 `@deepseek-ai/dsh-agent-preset-registry`, `@deepseek-ai/dsh-cordis-host-runner`,
70 and `@deepseek-ai/dsh-host-webserver`). DSH package conversion uses a
71 `16,384`-file / `256 MiB` bundle budget, normalizes package metadata for
72 validation, treats `@deepseek-ai/dsh-agent-presets` rows as inert alongside
73 executable composition rows, and stages reviewed `registry.npmjs.org`
74 transitive server dependencies when network policy allows (`registry.npmjs.org`
75 in `allow` under `[network]` in `config.toml`, or `/network allow
76 registry.npmjs.org` in the terminal UI); the review lists every package it
77 fetched. The changed table
78 digest requires fresh Native review and trust. The legacy preset adapter remains
79 explicitly pinned to `0d1f5000`; its replacement upstream runtime packages
80 are not adopted. Node support remains `^22.19.0 || >=24.0.0`, and Bun remains
81 `>=1.4.0`. rc.1 is a prerelease. Earlier rc.5 receipts are not evidence for
82 this target, and local checks of this upgrade do not repeat the live
83 walkthroughs below.
84
85 ## Headless services
86
87 | DSH service | In Codewhale | Status |
88 | --- | --- | --- |
89 | `tools.register` | Engine tool registry; input and output checked against the declared schema; every call goes through an approval card | Verified on macOS over the Runtime API |
90 | Plugin tools on the **first** turn | the first tool build waits up to 10 s for the plugin host to finish loading | Verified on macOS over the Runtime API (`25225ef051`); before the fix, `tool_search` could not find the tool on turn one |
91 | `commands.register` | thread-scoped Runtime commands with replay-safe operation keys; a command may submit one text prompt with plugin attribution. A collision with a built-in receives a plugin-specific name and does not replace the built-in. | Existing command path verified; namespaced collision fallback requires the focused current-source check |
92 | `sessions.flush(exec.agent.session)` | Engine captures the conversation so far and waits for the Runtime, terminal or `exec` store to confirm the save | Verified on macOS over the Runtime API, including reload after an Engine restart (`17ebeb5f61`); other `sessions` methods refused |
93 | `userQuestions.ask` | the Engine's own question flow; answers are typed (choice, your own text, or skipped) | Verified on macOS over the Runtime API (`fff5a476f9`); `wait` and timed asks refused |
94 | `storage`, `skills` | DSH-shaped adapters to Engine-owned services | Supported subset; full API inventory not qualified |
95 | `prompt`, `avatars`, `mcp`, `shellHooks` | Codewhale compatibility services | Not upstream DSH service declarations |
96 | `logger`, `events`, `reflect`, `registry` | Cordis framework built-ins | Supplied by the shared root |
97 | Tool definition `deferLoading` | boolean presentation hint accepted without changing Engine loading policy | `when` and execution/authority fields remain refused |
98 | `subagents.getProvider('spawn')`, `subagents.startActivation`, caller delivery, `result`, `dispose` | the existing sub-agent manager, through the same approval planning as the model's `agent` tool | Verified on Linux over the Runtime API: the child start raised its own approval card, the child's request carried the persona and lacked the denied tools, and the result came back to the plugin; see the mapping below |
99 | `subagents.start` (older DSH form) | refused | Not implemented |
100 | `tools.get(name, agent)` | read-only lookup in the calling tool's catalog | Verified with the child-agent probe |
101 | `tools.restrict` outside a child's `agent/created` handler | absent: the root `tools` service has no `restrict` method, so a call fails as not a function | Not implemented |
102 | `tools.guard` | deny-only tool guard on `tools/pre-execute`; accepts a non-empty string or `{ kind?: 'deny', reason }`, never auto-approves; `agent.ctx.tools.guard` remains refused | Verified by focused plugin-host tests (`dsh-compat-022.test.mjs`) |
103 | Other upstream `ToolsService` methods (`view`, `executable`, `resolve`, `definitions`, `schemas`, `setExecutor`, `selectExecutor`, `execute`, `checkGuards`) | absent, so plugins that test for them can carry on without them; a plugin that calls one fails activation as not a function | Not implemented |
104 | `subagents.getProvider('fork')` | supported (`inheritsParentContext: true`, `capabilities.depthLimit: true`); command `invocation.agent.session` remains not provided | Verified by focused plugin-host tests (`dsh-compat-022.test.mjs`) |
105 | `@deepseek-ai/dsh-error` | module singleton exporting the unified `HarnessError` shared with `@deepseek-ai/dsh-llm`, `@deepseek-ai/dsh-tools`, and `AttachmentError` | Verified by focused plugin-host tests (`dsh-compat-022.test.mjs`) |
106 | `agents`, `systemPrompt` | injectable so plugins that name them activate; `agents` offers nothing and `systemPrompt` methods refuse outside a child's `agent/created` context | Verified with the child-agent probe |
107 | `llm`, `credentials` | grant-gated brokered host services in `compatibility.json` v3 | Grant-gated brokered |
108 | `sessionPersistence`, `storageDomain`, `invariants`, `permissionPresets` | read-only / owner-scoped `0.10.5` P1/P2 host services (bounded JSON-serializable `storageDomain` values at 64 KiB, 64-entry per-owner `invariants` cap, fail-closed on mutating/escalation paths; all 4 in `refused_services` so plugins cannot override them) | Verified by focused plugin-host tests (`e42ec6f09f0`, `e5571935a95`) |
109 | `@deepseek-ai/dsh-agent`, `@deepseek-ai/dsh-app-boot` | `0.10.5` P1/P2 module singletons (`assembleContextFor`, `installModelSelection`, `getDshRuntimeVersion`; fail-closed `loadProfileDirectory`, `resolveBundleDir`, `createRuntimeResolution`) | Verified by focused plugin-host tests (`e42ec6f09f0`) |
110 | `agentPresets`, `agentDefaultModel`, `sessionProjections`, `workspaceRegistry`, `typertGateway`, `web` | `0.10.5` read-only/scoped adapters plus pure-API module exports (`ReasoningEffortId`, `deriveEventMessage`, `KNOWN_SESSION_EVENT_TYPES`, `credentialRef`, `settingsNamespace`, `resolveDshHome`, `writeFileAtomic`, `Remote`, `TypertRemoteService`) | Verified by focused plugin-host tests and `0.10.5` 36-tarball cold-activate survey (15/36 pass) |
111 | `approval`, `fs`, `subprocess` | refused by design until each maps to Engine authority | Not implemented |
112 | Rich or media tool output | dropped | Not implemented |
113 | Git review scopes | Bounded `execFile` metadata requests use the Engine Git tool and its approval path; the Native host still cannot read the repository directly | Current-source qualification pending |
114
115 ## Surfaces walked through live
116
117 The same DSH-format probe plugin (a tool that saves the session and asks one
118 question, plus two commands), run against a local fake model provider on
119 macOS with no account or spend, plus the `0.10.5` loopback `codewhale web`
120 dist check (`6f093967ae3`):
121
122 | Surface | What was seen | Status |
123 | --- | --- | --- |
124 | Runtime API | preview → exact-hash install → review → trust → enable; first-turn tool; approval; question answered through `POST /v1/user-input`; command result; plus `0.10.5` pinned 33-row lifecycle (`13` full local lifecycle pass, `3` pinned `BLOCKED`, `17` npm-approval gated) | Verified |
125 | `codewhale web` (`CODEWHALE_WEB_DIST`) | `GET /` HTTP 200 (byte-for-byte match with `codewhale-app/apps/web/dist/index.html`) and `GET /v1/apps/plugins` HTTP 200 on loopback (`6f093967ae3`) | Verified |
126 | `codewhale exec --auto` | first-turn tool runs and saves the session; the plugin's question is refused with `NO_PROVIDER` because no person is present to answer | Verified |
127 | Desktop app | the tool's approval card; the plugin's question rendered as a native card (option descriptions, your own answer, Skip, Send answers); the answer reaches the plugin; `/probe-count` in the command palette with plugin attribution | Verified (plugin installed through the Runtime API, not the app's own settings flow) |
128 | Terminal UI (interactive) | — | Not walked through; its question and approval code is covered by focused tests only |
129
130 ## Child agents: mapping
131
132 DSH child agents are not a second agent system. Each DSH call below is a thin
133 adapter onto Codewhale's existing sub-agent manager and the one turn loop,
134 inside the parent's permission and budget envelope. The host `subagents` shim
135 calls three Engine methods (`subagent/start`, `subagent/result`,
136 `subagent/dispose`), each bound to the live tool invocation's ticket. The
137 start goes through the turn loop's nested-call gate as a typed `agent` start,
138 so it gets the same planning, hooks and approval as the model's own `agent`
139 call.
140
141 | DSH call | Codewhale owner | Boundary |
142 | --- | --- | --- |
143 | `subagents.getProvider('spawn')` | fixed descriptor for the manager's fresh-context spawn | reports `inheritsParentContext: false`; no other providers |
144 | `subagents.startActivation({ provider: 'spawn', childId, request: { parent, prompt, agentOptions }, signal, delivery })` | the sub-agent manager's prepare step, then commit, with the existing origin, depth, write-scope and route admission | `parent` must be the exact live invocation agent; a requested model must be a route the parent may already use |
145 | `subagents.start('spawn', { persona, toolFilter, prompt })` (older DSH) | not provided | refused |
146 | `ctx.on('agent/created')` | a view of the prepared child, raised between prepare and commit | not a source of truth; anything a handler does there only adds to the commit configuration |
147 | `agent.ctx.systemPrompt.section({ name: PERSONA_PREFIX_SECTION, … })` | the child's frozen activation persona, inserted once into its own system prompt and recorded in the child's launch manifest | added to the child's prompt, never replacing core policy or another agent's prompt; other section names refused; at most 32 KiB |
148 | `agent.ctx.tools.restrict({ deny })`, `toolFilter.deny` | denied tools merged into the child's inherited tool limit | can only narrow |
149 | `ctx.tools.get(name, parent)` | lookup in the parent's effective tool catalog | read-only |
150 | `activation.result` | the manager's settled result and the child's full transcript output, checked against its recorded hash | fails when the output cannot be captured; never reads a truncated checkpoint as complete |
151 | `activation.dispose()`, `signal` | the manager's exact-run disposal and cancellation, including the run's own descendants | waits for the child to stop; reports uncertainty instead of success |
152 | `delivery: 'caller'` | caller delivery: the result goes to the plugin, not into the parent model's inbox | completion events and usage are still recorded |
153
154 Known limits: only the `spawn` provider exists; the child always starts with a
155 fresh context; a requested model must be one the parent may already use; only
156 text output blocks reach the plugin (others are counted in a diagnostic); and
157 the `agent/created` hook fires only for children the same plugin starts.
158
159 ## Plugin UI (`dsh.client`)
160
161 An imported DSH plugin's client UI is served, on the seats the Engine admits.
162 The importer retains the reviewed client closure; at serve time the Engine
163 re-verifies it byte for byte against the reviewed hashes, maps each declared
164 slot key to a seat, and loads one Engine-generated bootstrap built from those
165 bytes. A native client is admitted only on `customize.plugins.detail`. In `0.10.5`,
166 `DSH_FRAME_MODULES` admits `@deepseek-ai/dsh-settings`,
167 `@deepseek-ai/dsh-tools`, and `@deepseek-ai/dsh-credentials`, and
168 `DSH_SEAT_TABLE` is synced to 41 entries matching desktop `DSH_SLOT_ALIASES`
169 (`5cdf092bc77`). A slot key with no seat answers `plugin_ui_seat_unsupported`; several keys on one seat
170 need the caller to name one (`plugin_ui_dsh_slot_required`). A closure that needs
171 a host module the frame does not provide, uses ES module syntax or is not valid
172 JSON answers `plugin_ui_unsupported`. Code Review 1.0.8's client decorates
173 global command candidates through DSH services that the current detail-slot
174 renderer does not provide, so it is not qualified.
175 The route that forwards a client's requests to a plugin web server is served
176 by the Engine (`plugin_route_bridge` in
177 `crates/app-server/src/runtime_api/plugins.rs`, dispatching through
178 `dispatch_plugin_route`). It answers `plugin_route_not_found` when the plugin
179 registered no handler for the path. Bundled Agent Teams (`0.1.29`) serves its
180 panel routes and state endpoint (`200`) once activated.
181
182 The selected Electron host's reviewed asset transport and isolated frame do
183 not establish compatibility with those services. Its real network containment
184 and revocation still need qualification. An earlier macOS WebKit probe found
185 WebRTC traffic despite content rules, CSP, an opaque sandboxed frame and a
186 restrictive Permissions-Policy; that historical result does not qualify the
187 current Electron/Chromium host.
188
189 ## Host services and grants
190
191 DSH services that need the core to act for a plugin (`llm`, `credentials`,
192 `settings`, `terminal`, `remote`, the plugin catalog, workspace files) are
193 brokered: the Rust core serves them, and only for a plugin whose review granted
194 them. See [Host services](EXTENSIONS.md#host-services).
195
196 | Behavior | Status |
197 | --- | --- |
198 | A service is granted only by a review that showed it, recorded with who approved | Verified by focused plugin and Engine tests on Linux |
199 | A review recorded before grants existed, or an altered or unreadable record | Grants nothing; verified by focused tests |
200 | Plugins share one process: a service is given only while every loaded plugin holds the same grant | Verified by focused Engine tests |
201 | Turned off, revoked or reviewed again | Grant withdrawn at once, including a call in flight; verified by focused Engine tests |
202 | Services offered by this build | Grant-gated host services (`workspace`, `llm`, `credentials`, `settings`, `pluginManager`, `deepseekAccount`, `terminal`, `remote`) and reviewed compatibility adapters |
203 | Reasoning-translation bridge (`cot-translation`, anonymous Bing/Google over network broker) | Bridge built and verified with mocked broker responses; not offered in this build (paid DeepSeek routes unavailable) |
204 | `attachments` (`validate`, `save`, `read`, `read_request`, `imageLimits`, single-image tool-result projection) | Built and verified by focused Engine, adapter, and consumer-shaped real-host fixture tests on Linux; listed in `provided_services` of `crates/plugins/assets/dsh-compatibility.json` |
205 | `settings.describe()` | outside a live tool call holding a settings grant it returns the read-only host `locale` descriptor (as a thenable array); inside one it returns a Promise of the plugin's own namespace alongside the read-only `locale` descriptor | Verified by focused plugin-host tests |
206 | A real plugin using a granted service end to end | Not verified |
207
208 ## Containment
209
210 | Behavior | Status |
211 | --- | --- |
212 | Native tier runs only under an OS sandbox (Seatbelt, bubblewrap, LPAC) | Verified on macOS with the compiled host (`17ebeb5f61`) |
213 | Plugins in the Native tier are isolated from each other | No: they share one trusted host process |
214 | Detached descendants on macOS | Can outlive the host; they keep the sandbox |
215 | Windows, current source | Not verified |
216
217 ## Published plugins
218
219 `@michengai/dsh-code-review` 1.0.3 injects `commands`, `subagents`, `agents`,
220 `tools`, `systemPrompt`, `sessions` and `userQuestions`. Its `review` command
221 collides with Codewhale's built-in command; the plugin command is registered
222 under a plugin-specific name shown in the command catalog. Base-branch and commit selection use a bounded `execFile('git', ...)` adapter.
223 It translates known metadata queries to `Git` action `review_scope` through a
224 live `core/call` ticket and the existing approval path. The Engine selects the
225 workspace, disables hooks, filters, paging and lazy fetch, caps output, and
226 contains the process under a deadline and cancellation. Other Git commands and
227 subprocess APIs retain the Native sandbox restrictions. Native v8 requires
228 re-review before this additional compatibility path is admitted. The
229 published plugin's end-to-end review flow is not yet qualified with a real
230 model. Version 1.0.9 activates unmodified in the terminal, and in one terminal
231 turn against a scripted local model its `dsh_code_review` tool started its
232 reviewer sub-agent and returned the report ([DSH compatibility](DSH_COMPATIBILITY.md)).
233
234 ## Reviewed client module map
235
236 The CommonJS client bootstrap consumes the import edges recorded by the existing
237 conversion resolver in `CONVERSION.json`. That report and the source files remain
238 bound to the staged bundle hash; activation policy v9 invalidates prior native
239 review receipts. Missing maps require reconversion and review. Each edge names a
240 file in the reviewed closure or an exact declared host module. Runtime does not
241 probe paths, read arbitrary disk, or resolve npm dependencies. The existing
242 revision, file-hash and authority checks still guard bootstrap delivery.
243
244 The admitted subset includes root and nested client entries, relative path
245 normalization and extension/index probes, JSON, CommonJS cycles, and contained
246 package targets selected by the existing export-condition order. Client exports
247 select `import`, `default`, then `.`; dependency exports select `import`, `browser`,
248 `require`, then `default`. These are resolver priorities, not general Node export
249 semantics. The existing resolver's `main`/subpath fallback is unchanged.
250
251 Known limitations: ESM execution and dynamic `import()` are unsupported. Computed
252 module requests are rejected by the conservative source scan; any request absent
253 from the admitted map fails at runtime. The scan is not a general JavaScript
254 parser. Host module declarations do not grant broker/tool/UI permissions. Linked
255 dependency directories and ordinary symlinks are rejected; contained dependency
256 file links are skipped and are not loadable aliases. This is not general symlink
257 or arbitrary npm compatibility. Revocation prevents subsequent asset/host calls;
258 it does not erase JavaScript already delivered to a frame.
259
260 ### Pending installed qualification
261
262 This Engine-only change does not establish installed compatibility.
263
264 - **Engine receipt:** record exact installed Engine SHA and activation policy; install a
265 fixture, review and enable it, invoke its actual command/tool, then revoke and
266 capture denied subsequent calls. Include root/nested imports, cycles, JSON,
267 contained export conditions, boundary refusals, changed bundle digest and
268 unsupported dynamic requests. Record each result and any skipped case.
269 - **App receipt:** additionally record exact installed App SHA; mount and use the
270 fixture panel through the App, verify its imports and declared host modules,
271 then capture post-revocation UI asset and bridge denials. A Node bootstrap test
272 or a visible panel entry alone does not prove this journey.
273
274 No installed Engine/App run, provider inference, upload or publication is part of
275 this local fixture qualification.
276
276 lines MARKDOWN