@deepseek-ai/dsh 0.0.1-rc.2 → 0.1.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,420 @@
1
+ ---
2
+ name: cordis-plugin-development
3
+ description: Create, modify, debug, or extend dynamic Cordis Plugins, including Host Services and Events, Client Slot and theme UI, Package-private Client-to-Host calls, dynamic Tools, version updates, approval failures, and runtime diagnostics. Use this Skill to route a user request to the correct platform and Inspect Provider, then define, run, repair, or roll back the Plugin.
4
+ ---
5
+
6
+ # Develop Dynamic Cordis Plugins
7
+
8
+ First determine whether a capability belongs on Host or Client, then query the real interface before writing code. Never infer a complete API from a Service name, Event payload, Slot props, theme token, or example.
9
+
10
+ ## Standard workflow
11
+
12
+ 1. Call `cordis_inspect_list` to obtain the Providers, methods, and schemas currently registered on Host and Client.
13
+ 2. Select the smallest set of `cordis_inspect_query` calls needed to read the exact Services, Events, Builtins, Slots, Theme tokens, or Tools that the implementation will use.
14
+ 3. For a new Plugin, design its first Package. To modify an existing Plugin, first use `cordis_inspect_self(pluginId, packageId)` to read the base source and diagnostics.
15
+ 4. Write plain JavaScript in `code.host`, `code.client`, or both, then call `cordis_define`.
16
+ 5. Call `cordis_run` with the final `pluginId` and `packageId` returned by define.
17
+ 6. Handle approval, waiting, Client loading, and render failures from the Run card, steering messages, or `cordis_inspect_self`.
18
+ 7. Use `cordis_stop` to disable the Plugin temporarily. Use `cordis_undefine` only when it is no longer needed.
19
+
20
+ Do not wait in the same turn for user approval or asynchronous browser results. After `cordis_run` returns `awaiting-approval` or `starting`, end the current Tool flow and wait for the system to report the final outcome through state updates and steering.
21
+
22
+ ## Tool usage guidance
23
+
24
+ | Tool | Use it when | Do not |
25
+ | --- | --- | --- |
26
+ | `cordis_inspect_list` | Discover current Host/Client Providers and method schemas in one call; refresh after the runtime capability directory changes | Hard-code Provider names and skip list; treat a manifest as business data |
27
+ | `cordis_inspect_query` | Confirm exact Service methods, Event modes, Builtins, Slots, tokens, or Tool schemas before writing code | Use it instead of calling a real Service from the Plugin; assume a Client query will finish without a responding page |
28
+ | `cordis_inspect_self` | List current Plugins, inspect version pointers, or read exact Package source and runtime diagnostics | Fetch all source just to build a list; use it to modify or start a Plugin |
29
+ | `cordis_define` | Create a Plugin's first version or append an immutable Package to an existing Plugin; let the user preview the code first | Expect define to execute `apply`, request approval, or update current |
30
+ | `cordis_run` | Activate an exact Package; use `run` for first activation, restart, or rollback, and `update` to switch versions | Use `run` to switch versions implicitly; treat pending or starting as success |
31
+ | `cordis_stop` | Pause current effects while preserving Packages, grants, and version pointers for later use | Use stop to mean permanent deletion |
32
+ | `cordis_undefine` | Permanently remove a Plugin and all of its Packages and clear historical business views | Call it while rollback, inspection, or restart is still needed |
33
+
34
+ ## Choose a platform
35
+
36
+ | Requirement | Preferred platform | Inspect first |
37
+ | --- | --- | --- |
38
+ | Files, commands, processes, or networking | Host | `fs`, `bash`, `subprocess`, `pty`, and `web` in `Service.listService` |
39
+ | Agents, durable Session data, or Host lifecycle | Host | The relevant Service and `Event.listEvents` |
40
+ | Register a dynamic Tool callable in the next model step | Host | `harness` in `Builtin.listBuiltins`, plus `Tool.listTools` |
41
+ | Page theme, layout, or current page state | Client | `Theme.listTokens` and Client `Service.listService` |
42
+ | Conversation Snapshot or session/workspace lists | Client | The target Slot's standard props and owner props |
43
+ | Settings pages, sidebars, input areas, overlays, or Tool cards | Client | `Slots.listSubTree` |
44
+ | Fetch on Host and display on Client | Both | Host Service + `harness.handle`; Client Slot + `host.call` |
45
+
46
+ Prefer the capability closest to the data owner. If Slot props already provide the Conversation Snapshot, do not fetch it again through Host. If only the Package's own styles need to change, do not override the global theme. If only a small entry point is needed, do not replace an entire product UI region.
47
+
48
+ ## Provider navigation
49
+
50
+ Select methods from the actual `cordis_inspect_list` result. Common initial methods include:
51
+
52
+ - `Service.listService`: without `service`, returns every callable Service with its purpose and exact method signatures. Query the selected `service` again for access rules, structured method descriptions/parameters/returns, and only its referenced types.
53
+ - `Event.listEvents`: without `event`, returns every Event with its purpose, dispatch mode, and exact listener signature. Query the selected `event` again for its structured listener contract and only its referenced types; a Waterfall listener must call `next()`.
54
+ - `Builtin.listBuiltins`: returns evaluator-provided symbols and signatures that cannot be obtained through `ctx.get()`.
55
+ - `Slots.listSubTree`: without `root`, returns compact live trees with each Slot's purpose, kind, scope, registration keys, replacement risk, and children. With an exact `root`, it also returns that selected Slot's full contract, props, and current occupants while keeping descendants compact.
56
+ - `Theme.listTokens`: returns theme tokens that may currently be queried and overridden; it does not modify the theme.
57
+ - `Tool.listTools`: returns Tool schemas actually visible to the current Agent, including dynamically registered Tools.
58
+
59
+ Provider names, methods, and inputs must come from the current list result. The Service/Event Catalog describes which interfaces this version permits; it does not guarantee that a Service is currently mounted. At runtime, use real Services and Events rather than caching or displaying Catalog query results.
60
+
61
+ ## Execution environment
62
+
63
+ Both `code.host` and `code.client` are plain JavaScript function bodies that return a Cordis Plugin. They are not compiled by TypeScript, JSX, or a bundler.
64
+
65
+ Do not use:
66
+
67
+ - `import`, `require`, TypeScript types, `as`, decorators, or JSX;
68
+ - globals not confirmed by `Builtin.listBuiltins`;
69
+ - guessed access to `window`, `document`, `process`, `Buffer`, `fetch`, or native timers.
70
+
71
+ Client React code must use `React.createElement(...)`.
72
+
73
+ Correct:
74
+
75
+ ```js
76
+ return {
77
+ apply(ctx) {
78
+ const slots = ctx.get('slots')
79
+ if (slots === undefined) return
80
+ slots.inject('tool.view.cordis', () => slots.register(
81
+ { name: 'tool.view.cordis', key: 'self' },
82
+ () => React.createElement('div', null, 'Hello'),
83
+ ))
84
+ },
85
+ }
86
+ ```
87
+
88
+ Incorrect:
89
+
90
+ ```jsx
91
+ return {
92
+ apply(ctx) {
93
+ return <div>Hello</div>
94
+ },
95
+ }
96
+ ```
97
+
98
+ JSX is not the only problem in this example. `apply()` registers lifecycle contributions and cannot return a React Element as the Plugin result. UI must be registered in a queried Slot.
99
+
100
+ ## Access Services
101
+
102
+ Read optional capabilities with `ctx.get(name)` by default and handle their absence:
103
+
104
+ ```js
105
+ return {
106
+ apply(ctx) {
107
+ const service = ctx.get('serviceName')
108
+ if (service === undefined) return
109
+ service.someMethod()
110
+ },
111
+ }
112
+ ```
113
+
114
+ Declare `inject` only when a Service is a hard dependency and the Plugin must enter waiting until Cordis reactivates it after the Service appears:
115
+
116
+ ```js
117
+ return {
118
+ inject: ['requiredService'],
119
+ apply(ctx) {
120
+ ctx.requiredService.someMethod()
121
+ },
122
+ }
123
+ ```
124
+
125
+ Do not overuse `inject` merely to avoid an `undefined` check. Do not access `ctx.requiredService` without declaring the injection; the Guard rejects undeclared dependencies.
126
+
127
+ ## Manage side effects
128
+
129
+ Every contribution must be removed after the Plugin is stopped, updated, or removed. Prefer Cordis lifecycle APIs:
130
+
131
+ - Use `ctx.on()` to register Event listeners.
132
+ - Use `ctx.effect()` to own an external subscription that returns a disposer.
133
+ - Retain disposers returned by Cordis Service, Tool, Slot, timer, and theme APIs.
134
+ - Do not create process-wide or page-wide side effects at module scope or outside `apply()`.
135
+
136
+ Recommended:
137
+
138
+ ```js
139
+ return {
140
+ apply(ctx) {
141
+ const service = ctx.get('serviceName')
142
+ if (service === undefined) return
143
+ ctx.effect(() => service.subscribe((value) => {
144
+ console.log(value)
145
+ }))
146
+ },
147
+ }
148
+ ```
149
+
150
+ If `subscribe()` does not return a disposer, first query whether the Service provides a supported cleanup mechanism. Do not assume unload automatically removes arbitrary third-party callbacks.
151
+
152
+ ## Host and Client timers
153
+
154
+ On both platforms, the timer is a Service named `timer` with the same interface; it is not a Builtin. Query `{ "service": "timer" }` through the corresponding platform's `Service.listService` before using it. Declare `inject: ['timer']` before using the timer mixin.
155
+
156
+ One-shot delay:
157
+
158
+ ```js
159
+ return {
160
+ inject: ['timer'],
161
+ apply(ctx) {
162
+ const onClick = () => {
163
+ ctx.timeout(() => console.log('done'), 300)
164
+ }
165
+ // Pass onClick to a queried Slot UI.
166
+ },
167
+ }
168
+ ```
169
+
170
+ Periodic work in a React component:
171
+
172
+ ```js
173
+ return {
174
+ inject: ['timer'],
175
+ apply(ctx) {
176
+ function Clock() {
177
+ React.useEffect(() => ctx.interval(() => console.log('tick'), 1000), [])
178
+ return React.createElement('div', null, 'Running')
179
+ }
180
+ // Register Clock in a queried Slot.
181
+ },
182
+ }
183
+ ```
184
+
185
+ Incorrect:
186
+
187
+ ```js
188
+ return {
189
+ apply(ctx) {
190
+ ctx.timeout(() => console.log('invalid'), 300)
191
+ },
192
+ }
193
+ ```
194
+
195
+ ```js
196
+ setTimeout(() => console.log('invalid'), 300)
197
+ ```
198
+
199
+ The first example does not declare the timer hard dependency. The second uses a global timer that does not exist.
200
+
201
+ ## Listen to Events
202
+
203
+ Query the Event Provider first to confirm the platform, parameter order, return value, and `mode`.
204
+
205
+ Ordinary emit Event:
206
+
207
+ ```js
208
+ return {
209
+ apply(ctx) {
210
+ ctx.on('some/event', (payload) => {
211
+ console.log(payload)
212
+ })
213
+ },
214
+ }
215
+ ```
216
+
217
+ The last parameter of a Waterfall Event is `next`. Unless the listener intentionally stops downstream processing, it must call and return it:
218
+
219
+ ```js
220
+ return {
221
+ apply(ctx) {
222
+ ctx.on('some/waterfall', (payload, next) => {
223
+ console.log(payload)
224
+ return next()
225
+ })
226
+ },
227
+ }
228
+ ```
229
+
230
+ ## Register Client UI
231
+
232
+ Query `Slots.listSubTree` without `root` to choose a target from the compact purpose and topology tree, then query the exact Slot with `root` before writing its registration. The exact result determines:
233
+
234
+ - the Slot's purpose in the layout;
235
+ - whether its registration protocol is `single`, `list`, `keyed`, or `chain`;
236
+ - registration options;
237
+ - scope standard props and business owner props;
238
+ - current occupants, replacement risks, and descendant Slots.
239
+
240
+ Use `ctx.get('slots')` and handle its absence. Then use `slots.inject` to wait for the Slot declaration and call `slots.register` inside the callback:
241
+
242
+ ```js
243
+ return {
244
+ apply(ctx) {
245
+ const slots = ctx.get('slots')
246
+ if (slots === undefined) return
247
+ slots.inject('target.slot', () => slots.register(
248
+ { name: 'target.slot', id: 'my-view' },
249
+ (props) => React.createElement('div', null, String(props.someValue)),
250
+ ))
251
+ },
252
+ }
253
+ ```
254
+
255
+ `ctx.get('slots')` does not require an injection. Do not rewrite it as `ctx.slots` unless `inject: ['slots']` is declared:
256
+
257
+ ```js
258
+ return {
259
+ apply(ctx) {
260
+ ctx.slots.register({ name: 'target.slot' }, () => null)
261
+ },
262
+ }
263
+ ```
264
+
265
+ Do not guess an `id`, `key`, selector, or props before querying the Slot protocol. Do not default to root-level `root`, `sidebar`, `conversation`, or `details` Slots; replacing an entire occupant also removes the descendant Slots it declares.
266
+
267
+ ### Settings pages
268
+
269
+ A full settings UI should usually register its own section through `settings.section` to obtain a complete content area. `settings.general.item` is only appropriate for one compact, general-purpose preference. Query the actual subtree, options, and props for both, then select the narrowest entry point that is still sufficient.
270
+
271
+ Dynamic Plugins are temporary and process-local, so their settings UI does not need persistent storage. Do not add durable settings or another persistence mechanism for it. Register the UI in the appropriate settings Slot and keep any transient interaction state in memory for the lifetime of the Plugin.
272
+
273
+ ### Session and page data
274
+
275
+ A session-scoped Slot may provide `useSession`, `useSessions`, `useWorkspaces`, `useProjection`, input state, or actions through standard props. Follow the query result and prefer owner or standard props directly; do not add a Host RPC for data already present there.
276
+
277
+ Select only the fields that the UI actually needs. Do not copy or render an entire Conversation Snapshot, Session, Tool call, or Slot props object.
278
+
279
+ ### Cordis Run-specific panel
280
+
281
+ To place interactive UI in the latest `cordis_run` card, register `tool.view.cordis` with `key: 'self'`:
282
+
283
+ When the feature needs user interaction tied to this Package's result, this region is often a good fit because it keeps the controls in the conversation flow beside the Run card. It is not the default target for every Client UI: settings, sidebars, message actions, and overlays should use their own queried Slots when those locations better match the feature.
284
+
285
+ ```js
286
+ return {
287
+ apply(ctx) {
288
+ const slots = ctx.get('slots')
289
+ if (slots === undefined) return
290
+ slots.inject('tool.view.cordis', () => slots.register(
291
+ { name: 'tool.view.cordis', key: 'self' },
292
+ (props) => React.createElement('div', null, `Package ${props.packageId}`),
293
+ ))
294
+ },
295
+ }
296
+ ```
297
+
298
+ At runtime, `self` binds to `pluginId + packageId`. Do not include `pluginRunId` in the key. When the same Package runs multiple times, the latest Run card hosts the UI and older cards automatically degrade.
299
+
300
+ ### Ordinary Tool cards
301
+
302
+ To customize the call card for an ordinary model Tool, query `tool.call.toolview`. Its key is the Tool name; registering an existing key may replace the product's default card. When customizing only a newly added Tool, first verify its schema with `Tool.listTools`, then query the complete `ToolCallOwnerProps`.
303
+
304
+ ### Overlays and local entry points
305
+
306
+ - For toasts, status notices, and frame-wide overlays, query `shell.overlay` first; observe its pointer-events and ordering rules.
307
+ - When the selected target is a global overlay Slot, decide whether the UI should be draggable, how the user shows and hides it, and which existing layers it must cover or remain below.
308
+ - For small sidebar actions, prefer additive inner Slots such as `sidebar.footer.action`; do not replace the entire sidebar.
309
+ - For supplementary content after a conversation turn, query `conversation.chat.turnTail` and register according to its returned chain selector and fallback rules.
310
+
311
+ ## Themes and styles
312
+
313
+ Determine the scope of the change first:
314
+
315
+ 1. Global theme: first query `Theme.listTokens`, then query `{ "service": "theme" }` through Client `Service.listService`. Supply light and dark values for each override as required by the query, and retain the returned disposer.
316
+ 2. The Package's own components: use `styles.insert(css)` and prefer theme CSS variables for colors.
317
+ 3. New visible content: choose a Slot first, then decide between local CSS and global tokens.
318
+
319
+ Do not manipulate `document.body`, `window`, or hard-coded product DOM selectors. The theme Service changes tokens but does not create UI. Slots create UI but do not replace the theme system.
320
+
321
+ ## Call Host from Client
322
+
323
+ Host registers a Package-private method with `harness.handle(method, handler)`, and Client invokes it with `host.call(method, args)`. This is Client→Host JSON RPC.
324
+
325
+ Host:
326
+
327
+ ```js
328
+ return {
329
+ apply(ctx) {
330
+ harness.handle('read-state', async (args) => {
331
+ return { value: args.key }
332
+ })
333
+ },
334
+ }
335
+ ```
336
+
337
+ Client:
338
+
339
+ ```js
340
+ return {
341
+ async apply(ctx) {
342
+ const result = await host.call('read-state', { key: 'demo' })
343
+ console.log(result.value)
344
+ },
345
+ }
346
+ ```
347
+
348
+ Arguments and return values must be lossless JSON. Do not pass functions, React elements, class instances, Contexts, Services, or other runtime objects; return `null` when there is no response data. Do not register a public Remote Service or use `ctx.remote` for Package-private communication.
349
+
350
+ ## Register a dynamic model Tool
351
+
352
+ Host can use `harness` to register a Tool callable in the next model step. First query the current `harness` signature with Host `Builtin.listBuiltins`, then inspect existing Tool names and schemas with `Tool.listTools` to avoid conflicts.
353
+
354
+ Tool arguments and return values must be JSON-compatible. `execute` owns the business result; render and presentation own only what the model and native UI see. Tool registration must belong to the current Plugin Fiber so it is automatically removed after stop or update.
355
+
356
+ ## Handle internal live data
357
+
358
+ Service instances, Event payloads, Slot props, Session and Conversation Snapshots, Tool state, and other DSH/Cordis objects are internal live data.
359
+
360
+ Do not:
361
+
362
+ - call `JSON.stringify` or `structuredClone` on these objects or their descendants;
363
+ - recursively enumerate, fully copy, or display them as a whole;
364
+ - place Host objects in the Package's long-lived state or RPC return values.
365
+
366
+ Read only the leaf fields required by the current feature. Extract the minimum strings, numbers, booleans, and other scalar values before constructing owned JSON.
367
+
368
+ ## Versions, approval, and repair
369
+
370
+ - A Plugin is the stable instance identified by `pluginId`.
371
+ - A Package is an immutable code version identified by `packageId`.
372
+ - Every activation attempt has its own `pluginRunId`.
373
+ - `currentPackageId` is the latest successful version; it does not imply that the Plugin is currently running.
374
+ - `nextPackageId` is the target awaiting approval, activating, awaiting Client activation, or most recently failed.
375
+
376
+ Choose the `cordis_run` mode as follows:
377
+
378
+ | Current state | Target | mode |
379
+ | --- | --- | --- |
380
+ | No current | Any Package under the Plugin | `run` |
381
+ | Has current | The same Package | `run` |
382
+ | Has current | A different Package | `update` |
383
+ | Update failed | `nextPackageId` | `update` to retry |
384
+ | Update failed | `currentPackageId` | `run` to roll back |
385
+
386
+ An unauthorized Client Package returns `awaiting-approval`. A single check mark authorizes only the current Package; double check marks authorize future versions of the same Plugin. A grant remains after a technical runtime failure. An authorized Package returns `starting` and completes asynchronously in the browser.
387
+
388
+ After a technical failure:
389
+
390
+ 1. Use `cordis_inspect_self(pluginId, packageId)` to read the failed version's source and exact diagnostics.
391
+ 2. If the error involves an unknown capability, list and query the corresponding Provider again.
392
+ 3. Define a new Package under the same Plugin; do not overwrite the failed Package.
393
+ 4. Run again with the new `packageId` and the correct mode.
394
+
395
+ Do not retry automatically after the user rejects approval. A failed update does not automatically restore the old physical Run; explicitly run current when recovery is required.
396
+
397
+ ## Modify @pluginId
398
+
399
+ When the user identifies a target with `@pluginId`, do not create another Plugin. The injected context contains only identity, version pointers, and the default base Package, not source code.
400
+
401
+ Modify it as follows:
402
+
403
+ 1. Read the base Package with `cordis_inspect_self(pluginId, packageId)`.
404
+ 2. Preserve the Host or Client half that does not need to change and modify only the target code.
405
+ 3. Call `cordis_define` with `plugin.kind: 'existing'` and the original `pluginId`.
406
+ 4. Use the returned `packageId`; when current exists, activate the new version with `update` in the usual case.
407
+
408
+ If the reference is unavailable, explain that the Plugin was removed, belongs to another Session, or was lost on process restart. Do not create a same-named replacement.
409
+
410
+ ## Common failure checks
411
+
412
+ | Failure | Check first |
413
+ | --- | --- |
414
+ | `service "x" is not declared` | Whether code uses `ctx.x` without declaring `inject: ['x']` on the Plugin object; switch to `ctx.get('x')` with an absence check or declare a true hard dependency |
415
+ | `cannot get property "timer" without inject` | Query the timer Service and declare `inject: ['timer']` |
416
+ | Client parse failure | Whether the code uses JSX, TypeScript, import, or an unavailable global |
417
+ | Slot registration failure | Whether the live subtree was queried, the Slot exists, and options, key, or selector satisfy the returned protocol |
418
+ | UI loads but the page reports an error | Inspect the `client-render` diagnostic and stack; the error belongs to an exact Run, so define a new Package to repair it |
419
+ | `host.call` failure | The Host handler name, current `pluginRunId`, JSON arguments, and real Service dependencies inside the handler |
420
+ | Update failure | Preserve current/next semantics; repair next and update, or run current to roll back |
@@ -25,13 +25,13 @@ Two planes, and the choice is not about how "agent-related" something feels —
25
25
 
26
26
  A preset is a directory holding one `agent.cordis.yml`, optionally beside a `preset.yml` carrying display metadata — `name` and `description` (and, for shipped presets, a roster `order`). Write the metadata too: a preset without it shows up in every picker as its bare directory name.
27
27
 
28
- Locally authored presets live one directory per preset under `${DSH_HOME:-$HOME/.dsh}/.agent-presets/`, and the shipped set sits beside the deployment's own config. Use those when the user asks where to look. Both roots are configuration rather than fixed locations, though, and no call reports them — `authorable` says only whether a writable one exists — so take the path you actually read or edit from `list()` or `resolve()`, which is also where `copy()` reports what it just created.
28
+ Locally authored presets live one directory per preset under `${DSH_HOME:-$HOME/.dsh}/.agent-presets/`, and the shipped set sits beside the deployment's own config. Use those when the user asks where to look. A deployment can configure other roots, so the path you read or edit comes from `list()` or `resolve()` — which is also where `copy()` reports what it just created.
29
29
 
30
30
  ## The roster service
31
31
 
32
32
  `ctx.agentPresets` owns discovery, authoring, and mounting. You reach it by mounting a temporary plugin that injects it and registers a tool for yourself — `cordis_mount` returns only the mount acknowledgement, so a registered tool is how a service answer gets back to you, and it becomes callable on your next step.
33
33
 
34
- Read `cordis_inspect what:"api" name:"agentPresets"` for the current signatures before writing the code. The four calls this skill relies on:
34
+ Read `cordis_inspect what:"api" name:"agentPresets"` for the current signatures before writing the code. What this skill relies on:
35
35
 
36
36
  - `list()` — every preset with its `id`, `trust` (`system` for the shipped set, `user` for authored ones), and the absolute `path` of its composition file. This is how you locate any composition without knowing the install layout; the directory is that path's parent.
37
37
  - `read(id)` — one preset's composition text, without a file tool or a path.
@@ -88,8 +88,8 @@ When a preset genuinely owns a service, wrap the provider **and every consumer t
88
88
  isolate:
89
89
  workflows: true
90
90
  config:
91
- - id: workflow-workerthread
92
- name: '@deepseek-ai/dsh-workflow-workerthread'
91
+ - id: workflow-worker-thread
92
+ name: '@deepseek-ai/dsh-workflow-worker-thread'
93
93
  config:
94
94
  provider: spawn
95
95
  - id: tool-workflow
@@ -100,7 +100,7 @@ When a preset genuinely owns a service, wrap the provider **and every consumer t
100
100
 
101
101
  A consumer left outside the group resolves the host's registry, which the preset did not populate, and then contributes nothing. Mount-validation catches that as a row that never activated.
102
102
 
103
- Realms are for services a preset owns, not for every group. A host capability the preset only consumes must stay outside a realm, or the row cannot resolve it: `tool-bash`, `tool-tasks`, and `tool-goal` publish nothing and sit loose in `standard`, which explains in comments which host instance each one resolves and why a realm would break it. Wrapping a consumer row in a realm of its own is the same error as leaving one outside its provider's realm.
103
+ Realms are for services a preset owns, not for every group. A host capability the preset only consumes must stay outside a realm, or the row cannot resolve it: `tool-bash`, `tool-jobs`, and `tool-goal` publish nothing and sit loose in `standard`, which explains in comments which host instance each one resolves and why a realm would break it. Wrapping a consumer row in a realm of its own is the same error as leaving one outside its provider's realm.
104
104
 
105
105
  ## Verifying a change
106
106
 
@@ -1,15 +1,16 @@
1
1
  # The `minimal` agent preset: a fixed-prompt, two-tool coding-agent composition.
2
2
  #
3
3
  # The persona is the complete system prompt, so global identity, Web orientation,
4
- # tool guidance, and later assembly listeners cannot add prompt text. The model
5
- # composes only the persistent `bash` and `str_replace_editor` tools. Context
6
- # compaction is deliberately absent.
4
+ # tool guidance, and later assembly listeners cannot add prompt text. Runtime
5
+ # context snapshots are suppressed for this preset, and the model composes only
6
+ # persistent `bash` and `str_replace_editor`. Context compaction is absent.
7
7
 
8
8
  - id: persona
9
9
  name: '@deepseek-ai/dsh-persona'
10
10
  config:
11
11
  text: You are a helpful software engineer assistant.
12
12
  complete: true
13
+ includeRuntimeContext: false
13
14
 
14
15
  # The PTY registry is an agent-owned service, so it lives in an entry-local
15
16
  # realm. The backend still consumes the host sandbox policy and subprocess
@@ -18,13 +19,13 @@
18
19
  name: cordis:group
19
20
  group: true
20
21
  isolate:
21
- pty: true
22
+ terminals: true
22
23
  config:
23
24
  - id: pty
24
- name: '@deepseek-ai/dsh-pty'
25
+ name: '@deepseek-ai/dsh-terminal'
25
26
 
26
- - id: pty-local
27
- name: '@deepseek-ai/dsh-pty-local'
27
+ - id: terminal-bash
28
+ name: '@deepseek-ai/dsh-terminal-bash'
28
29
  config:
29
30
  timeoutMs: 300000
30
31
 
@@ -27,22 +27,27 @@
27
27
  text: >-
28
28
  You are a coding agent powered by the {{model}} model. Your working directory is {{cwd}}.
29
29
 
30
- - id: workspace-context
31
- name: '@deepseek-ai/dsh-workspace-context'
30
+ - id: agent-instructions
31
+ name: '@deepseek-ai/dsh-agent-instructions'
32
32
  config:
33
33
  maxBytes: 65536
34
34
 
35
35
  # ── shell ───────────────────────────────────────────────────────────────────
36
36
 
37
- # `bash-env` stays in the HOST composition: `apps/cli/src/web.ts` injects it to
37
+ # `shell-env` stays in the HOST composition: `apps/cli/src/web.ts` injects it to
38
38
  # publish `DSH_WEB_URL`/`DSH_WEB_MODE`, and a host row that injects a service is
39
39
  # the criterion for host-plane ownership — injection resolves before any session
40
40
  # exists, so there is no agent to key by. Behind a preset realm those variables
41
- # never reached the model's shell at all. `tool-bash` consumes the host registry
42
- # from here; the executor behind it (`bash-sandbox`) is host-plane too, where the
43
- # sandbox policy owns it.
41
+ # never reached the model's shell at all. Both shell tools consume the host
42
+ # registry from here; their executors (`bash-sandbox`/`pwsh-sandbox`) are
43
+ # host-plane too.
44
44
  - id: tool-bash
45
45
  name: '@deepseek-ai/dsh-tool-bash'
46
+ disabled: !!js process.platform === 'win32'
47
+
48
+ - id: tool-pwsh
49
+ name: '@deepseek-ai/dsh-tool-pwsh'
50
+ disabled: !!js process.platform !== 'win32'
46
51
 
47
52
  # ── filesystem ──────────────────────────────────────────────────────────────
48
53
 
@@ -56,27 +61,27 @@
56
61
  config:
57
62
  sampleOverCapGlobResults: false
58
63
 
59
- # ── background tasks ────────────────────────────────────────────────────────
64
+ # ── background jobs ────────────────────────────────────────────────────────
60
65
 
61
66
  # Only the model-facing controls. The task REGISTRY stays on the host plane:
62
67
  # its producers sit outside any realm this file could put it in — `tool-bash`
63
68
  # above resolves it with `ctx.get`, and an entry-local realm here is invisible
64
- # to every sibling row, so `run_in_background` would answer "background tasks
69
+ # to every sibling row, so `run_in_background` would answer "background jobs
65
70
  # unavailable" while these controls sat in the catalog. The registry is keyed by
66
71
  # owning agent anyway, so one host instance serves every session. What a preset
67
72
  # chooses is whether its agent can collect and stop background work at all.
68
- - id: tool-tasks
69
- name: '@deepseek-ai/dsh-tool-tasks'
73
+ - id: tool-jobs
74
+ name: '@deepseek-ai/dsh-tool-jobs'
70
75
 
71
76
  # ── skills ──────────────────────────────────────────────────────────────────
72
77
 
73
78
  # The skill REGISTRY lives in the host composition and is layered per scope:
74
79
  # these rows register into THIS preset's layer of it, so they need no realm.
75
- # `skill-local` contributes local-root discovery for agents on this preset, and
80
+ # `skill-filesystem` contributes local-root discovery for agents on this preset, and
76
81
  # `tool-skill` gives them the catalog and loader; the merged catalog also
77
82
  # carries whatever the deployment registered globally (repository plugins).
78
- - id: skill-local
79
- name: '@deepseek-ai/dsh-skill-local'
83
+ - id: skill-filesystem
84
+ name: '@deepseek-ai/dsh-skill-filesystem'
80
85
 
81
86
  - id: tool-skill
82
87
  name: '@deepseek-ai/dsh-tool-skill'
@@ -120,7 +125,7 @@
120
125
 
121
126
  # ── compaction ──────────────────────────────────────────────────────────────
122
127
 
123
- # `compact-basic` reads `toolResultPrune` through `ctx.get`, so the pruner must
128
+ # `compaction-basic` reads `toolResultPrune` through `ctx.get`, so the pruner must
124
129
  # share this realm rather than sit outside it.
125
130
  #
126
131
  # `tokenMeter` is deliberately NOT in this realm: the meter stays on the HOST
@@ -128,22 +133,22 @@
128
133
  # keys every fold by Session, and owns the context-meter projection units the
129
134
  # browser reads for every session — behind a realm those units would come and go
130
135
  # with whichever presets happen to be mounted. What a preset chooses is whether
131
- # its agent compacts at all, which is `compact-basic` below.
136
+ # its agent compacts at all, which is `compaction-basic` below.
132
137
  - id: compaction
133
138
  name: cordis:group
134
139
  group: true
135
140
  isolate:
136
- compact: true
137
- toolResultPrune: true
141
+ compaction: true
142
+ toolResultPruner: true
138
143
  config:
139
- - id: compact-basic
140
- name: '@deepseek-ai/dsh-compact-basic'
144
+ - id: compaction-basic
145
+ name: '@deepseek-ai/dsh-compaction-basic'
141
146
 
142
147
  - id: command-compact
143
148
  name: '@deepseek-ai/dsh-command-compact'
144
149
 
145
- - id: tool-result-prune
146
- name: '@deepseek-ai/dsh-compact-tool-result-prune'
150
+ - id: tool-result-pruner
151
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
147
152
  config:
148
153
  thresholdChars: 8192
149
154
  headChars: 4096
@@ -170,7 +175,7 @@
170
175
  name: cordis:group
171
176
  group: true
172
177
  isolate:
173
- workflows: true
178
+ workflowEngine: true
174
179
  config:
175
180
  - id: tool-subagent-control
176
181
  name: '@deepseek-ai/dsh-tool-subagent-control'
@@ -213,8 +218,8 @@
213
218
  enableRunInBackground: false
214
219
  maxDepth: provider-managed
215
220
 
216
- - id: workflow-workerthread
217
- name: '@deepseek-ai/dsh-workflow-workerthread'
221
+ - id: workflow-worker-thread
222
+ name: '@deepseek-ai/dsh-workflow-worker-thread'
218
223
  config:
219
224
  provider: spawn
220
225
 
package/lib/bin.js CHANGED
@@ -129,7 +129,7 @@ function readVersion() {
129
129
  const invocation = parseDshArgs(process.argv.slice(2), readVersion());
130
130
  switch (invocation.mode) {
131
131
  case "profile": {
132
- const { runProfile } = await import("./profile-boot-CuKpzL79.js");
132
+ const { runProfile } = await import("./profile-boot-BnJoK_kl.js");
133
133
  await runProfile({
134
134
  environment: loadLayeredEnv("dsh"),
135
135
  profile: invocation.profile,
@@ -139,12 +139,12 @@ switch (invocation.mode) {
139
139
  break;
140
140
  }
141
141
  case "plugin": {
142
- const { runPlugin } = await import("./plugin-D9IP9d5I.js");
142
+ const { runPlugin } = await import("./plugin-9h8shc4d.js");
143
143
  process.exit(runPlugin(invocation.profile, invocation.args));
144
144
  break;
145
145
  }
146
146
  case "dump-config": {
147
- const { runDumpConfig } = await import("./dump-config-CBIM2Y1u.js");
147
+ const { runDumpConfig } = await import("./dump-config-D-jtgwY3.js");
148
148
  runDumpConfig(invocation.profile, invocation.defaultOnly, invocation.patches);
149
149
  break;
150
150
  }
@@ -1,4 +1,4 @@
1
- import { i as prepareProfile, n as PROFILE_ROOT_FILENAME, r as homePatchPath, s as resolveWindowsShellLayer } from "./profile-boot-D95nr1z0.js";
1
+ import { i as prepareProfile, n as PROFILE_ROOT_FILENAME, r as homePatchPath } from "./profile-boot-DG5t9aNs.js";
2
2
  import { existsSync } from "node:fs";
3
3
  import { loadOptionalPatches, loadOverlayPatches, renderConfigDump } from "@deepseek-ai/dsh-app-boot";
4
4
  import { join, resolve } from "node:path";
@@ -26,11 +26,6 @@ function runDumpConfig(profile, defaultOnly, patches) {
26
26
  label: layer.packageName,
27
27
  patches: layer.patches
28
28
  }));
29
- const windowsShellLayer = resolveWindowsShellLayer(process.platform, loaded.layers, NAME);
30
- if (windowsShellLayer !== void 0) layers.push({
31
- label: windowsShellLayer.label,
32
- patches: windowsShellLayer.patches
33
- });
34
29
  if (!defaultOnly) {
35
30
  if (existsSync(loaded.patchPath)) layers.push({
36
31
  label: loaded.patchPath,