@linxin666/dsh-liangshen 0.4.14 → 0.4.16

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.
package/lib/index.js CHANGED
@@ -400,11 +400,9 @@ function readPresetDefinition(id, dir) {
400
400
  /**
401
401
  * The overlay table: settings field to composition row and config key.
402
402
  *
403
- * `presentation` writes the `tool-catalog` row alone, because that row's
404
- * declaration IS the wire: the plugin hands the value to
405
- * `agent.ctx.tools.presentAs` and re-assembles, so the catalog text and the
406
- * declared presentation always travel together. The composition carries no
407
- * executor row to mount or unmount.
403
+ * `presentation` also selects the executor: the catalog declares the wire and
404
+ * the official PTC executor row carries it. Native mode disables that row so
405
+ * the assembled native roster remains the only surface.
408
406
  */
409
407
  function overrideTargets(overrides) {
410
408
  return [["tool-catalog", { ...overrides.presentation === void 0 ? {} : { presentation: overrides.presentation } }], ["minimal-prompt", { ...overrides.dispatcher === void 0 ? {} : { dispatcher: overrides.dispatcher } }]];
@@ -424,7 +422,12 @@ function overrideTargets(overrides) {
424
422
  function applyPresetOverrides(rows, overrides) {
425
423
  const table = overrideTargets(overrides);
426
424
  return rows.map((row) => {
427
- const target = table.find(([id]) => id === row.id);
425
+ const id = row.id;
426
+ if (id === "tool-executor-ptc" && overrides.presentation !== void 0) return {
427
+ ...row,
428
+ disabled: overrides.presentation !== "ptc"
429
+ };
430
+ const target = table.find(([targetId]) => targetId === id);
428
431
  if (target === void 0) return row;
429
432
  const [, patch] = target;
430
433
  if (Object.keys(patch).length === 0) return row;
@@ -56,7 +56,7 @@ export interface PluginCardContext {
56
56
  /** Service lookup; absent on a context double that only models the slots. */
57
57
  get?(name: string): unknown;
58
58
  /** Event subscription seat; absent on an event-less test double. */
59
- on?(event: string, listener: (...args: never[]) => void): unknown;
59
+ on?(event: never, listener: never): unknown;
60
60
  }
61
61
  /** Owner share of a family list-seat card (that seat supplies nothing). */
62
62
  export interface SettingsPluginItemOwnerProps {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@linxin666/dsh-liangshen",
3
3
  "description": "LiangShen (梁神) agent preset plus its composer lever for the dsh web GUI. The host half declares the bundled preset to the harness's agent-preset registry at activation (declare = enabled), so the preset is selectable for new sessions without writing anything into the harness home; the preset keeps a minimal persona with standing working discipline while the harness's own user-role agent-instructions injection delivers the workspace instructions (the optional `instructionSource: system-prompt` mode lifts them into the prompt instead), and declares one tool presentation for the session's whole lifetime: `ptc` by default (the wire collapses to `run_code` and every other tool is reached through the generated SDK), with `native` as the explicit assembled-roster option. High-fan-out tool families (default `mcp__*`) stay paged out of the wire until the preset's own `tool_activate` tool loads their namespace (LRU cap three, state replayed from the durable session event stream), and the tool catalog — exactly the reachable tools plus paged-out namespace summaries — and a one-line working-context projection travel as durable user messages republished only on change. The browser half adds a slot-machine lever left of the model selector on the new-session screen to toggle the mode. Hot-pluggable via cordis.patch.yml + profile symlink, no dsh source changes.",
4
- "version": "0.4.14",
4
+ "version": "0.4.16",
5
5
  "icon": "icon.svg",
6
6
  "type": "module",
7
7
  "engines": {
8
- "node": "^22.19.0 || >=24.0.0"
8
+ "node": ">=24.9.0"
9
9
  },
10
10
  "main": "lib/index.js",
11
11
  "types": "lib/types/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "dsh": {
27
27
  "engines": {
28
- "dsh": ">=0.2.1-rc.3"
28
+ "dsh": ">=0.2.2-rc.1"
29
29
  },
30
30
  "bundle": {
31
31
  "patch": "./cordis.patch.yml"
@@ -42,25 +42,25 @@
42
42
  }
43
43
  },
44
44
  "peerDependencies": {
45
- "@deepseek-ai/dsh": ">=0.2.1-rc.3"
45
+ "@deepseek-ai/dsh": ">=0.2.2-rc.1"
46
46
  },
47
47
  "dependencies": {
48
- "@deepseek-ai/schemastery": "^3.18.5"
48
+ "@deepseek-ai/schemastery": "^3.19.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@deepseek-ai/cordis": "^4.0.5",
52
- "@deepseek-ai/dsh-agent-preset-registry": "^0.2.1-rc.3",
53
- "@deepseek-ai/dsh-api-remotes": "^0.2.1-rc.3",
54
- "@deepseek-ai/dsh-api-session-controller": "^0.2.1-rc.3",
55
- "@deepseek-ai/dsh-client-connection": "^0.2.1-rc.3",
56
- "@deepseek-ai/dsh-client-locale": "^0.2.1-rc.3",
57
- "@deepseek-ai/dsh-client-store": "^0.2.1-rc.3",
58
- "@deepseek-ai/dsh-client-ui-conversation": "^0.2.1-rc.3",
59
- "@deepseek-ai/dsh-client-ui-renderer": "^0.2.1-rc.3",
60
- "@deepseek-ai/dsh-client-ui-settings": "^0.2.1-rc.3",
61
- "@deepseek-ai/dsh-client-ui-slots": "^0.2.1-rc.3",
62
- "@deepseek-ai/dsh-settings": "^0.2.1-rc.3",
63
- "@deepseek-ai/dsh-system-prompt": "^0.2.1-rc.3",
51
+ "@deepseek-ai/cordis": "^4.1.0",
52
+ "@deepseek-ai/dsh-agent-preset-registry": "^0.2.2-rc.1",
53
+ "@deepseek-ai/dsh-api-remotes": "^0.2.2-rc.1",
54
+ "@deepseek-ai/dsh-api-session-controller": "^0.2.2-rc.1",
55
+ "@deepseek-ai/dsh-client-connection": "^0.2.2-rc.1",
56
+ "@deepseek-ai/dsh-client-locale": "^0.2.2-rc.1",
57
+ "@deepseek-ai/dsh-client-store": "^0.2.2-rc.1",
58
+ "@deepseek-ai/dsh-client-ui-conversation": "^0.2.2-rc.1",
59
+ "@deepseek-ai/dsh-client-ui-renderer": "^0.2.2-rc.1",
60
+ "@deepseek-ai/dsh-client-ui-settings": "^0.2.2-rc.1",
61
+ "@deepseek-ai/dsh-client-ui-slots": "^0.2.2-rc.1",
62
+ "@deepseek-ai/dsh-settings": "^0.2.2-rc.1",
63
+ "@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.1",
64
64
  "@testing-library/react": "^16.1.0",
65
65
  "@types/node": "^22.20.0",
66
66
  "@types/react": "~18.3.1",
@@ -5,17 +5,17 @@
5
5
  # presentation declared for the session's whole lifetime instead of a staged
6
6
  # turn boundary.
7
7
  #
8
- # The presentation is the SDK's ToolPresentationMode, picked by the
8
+ # The presentation is the SDK's tool presentation mode, picked by the
9
9
  # tool-catalog row's `presentation` key (default `'ptc'`): `'native'` keeps
10
- # the assembled roster on the wire, and `'ptc'` collapses the wire to the
11
- # single `run_code` transport with every other tool reached from inside the
12
- # program through the generated SDK. The declaration lands once per agent
13
- # scope through agent.ctx.tools.presentAs as early as the scope exists, and
14
- # degrades to the native surface with a one-time warning when the deployment
15
- # has no code runtime or the host declines. The retired anchor-turn staging is
16
- # gone: the legacy `anchorTools` and boolean `ptcPresentation` keys are still
17
- # accepted (the latter mapping true -> 'ptc' and false -> 'native') but only
18
- # warn once.
10
+ # the roster on the wire, and `'ptc'` collapses the wire to the single
11
+ # `run_code` transport with every other tool reached from inside the program
12
+ # through the generated SDK. The settings overlay turns that key into the
13
+ # `tool-executor-ptc` row below, which is what actually decides the wire:
14
+ # 0.2.2 retired `agent.ctx.tools.presentAs`, so no plugin declares it per
15
+ # scope any more, and a deployment with no code runtime keeps the native
16
+ # surface. The retired anchor-turn staging is gone: the legacy `anchorTools`
17
+ # and boolean `ptcPresentation` keys are still accepted (the latter mapping
18
+ # true -> 'ptc' and false -> 'native') but only warn once.
19
19
  #
20
20
  # Gentle tool paging keeps high-fan-out families out of reach until needed:
21
21
  # tools matching `pagedToolPatterns` (default `mcp__*`) stay paged out, the
@@ -187,18 +187,18 @@
187
187
 
188
188
  # ── the wire ────────────────────────────────────────────────────────────────
189
189
  #
190
- # `presentation` on the `tool-catalog` row above IS the wire. The plugin
191
- # declares it on each agent scope through `agent.ctx.tools.presentAs` as soon
192
- # as the scope exists, then re-assembles so the declaration reaches the
193
- # request the model actually receives; `native` keeps the assembled roster,
194
- # `ptc` collapses it to the single `run_code` transport. A deployment with no
195
- # PTC runtime, a host that declines the declaration, or a wire that offers no
196
- # schema projection keeps the native surface and warns once.
190
+ # `presentation` on the `tool-catalog` row above IS the wire, because the
191
+ # settings overlay turns it into the `tool-executor-ptc` row below: a mounted
192
+ # ptc executor collapses the wire to the single `run_code` transport, and the
193
+ # `native` value disables that row so the roster is what the request carries.
194
+ # The catalog reads the same fact back (a `ptc` setting plus a mounted
195
+ # runtime) because no reader can observe the collapse itself: the ptc
196
+ # executor keeps `run_code` outside the registry, so a schema read returns the
197
+ # same list under both modes.
197
198
  #
198
- # The composition carries NO executor row. The 0.2.1-rc.3 SDK ships the
199
- # presentation as a tool property selected through `presentAs`; it publishes no
200
- # `@deepseek-ai/dsh-tool-executor-ptc`, so a row naming it never starts and the
201
- # preset's load audit reports it alongside the rows that did mount (2026-10-26).
199
+ # This cohort splits execution into an agent-scoped executor row. The row below
200
+ # selects the same official PTC executor as the builtin ptc preset; the settings
201
+ # overlay disables it for native presentation so the two modes stay distinct.
202
202
  #
203
203
  # The row ships `presentation: 'ptc'` because that is the shipped default, and
204
204
  # the settings overlay rewrites the SAME key, so the settings switch and the
@@ -235,6 +235,25 @@
235
235
  - id: subagent-routes
236
236
  name: ./subagent-routes.mjs
237
237
 
238
+ # The dispatch execution guard. A preset row composes ONE tool registry, and an
239
+ # in-process child agent inherits that composition, so two things break quietly:
240
+ # a child calls a coordinator-only tool (ask_user_question, the plan-mode
241
+ # transitions, create_goal / update_goal, present) and splits one decision into
242
+ # two - the child asks, the user answers, and the dispatcher never learns what
243
+ # was asked; or a caller sleeps to wait for a child that the built-in completion
244
+ # notification will wake it for. This row refuses both at call execution time: a
245
+ # delegated caller is told to hand the open question back to the dispatcher, and
246
+ # a pure sleep statement (a wait beside nothing but no-ops) is refused while one
247
+ # of its children is still running. It uses ONLY `ctx.tools.guard()`, so the
248
+ # declared tool surface does not move by a byte and a prefix-caching provider
249
+ # never rebuilds because of this row. Every fact it cannot read fails open (no
250
+ # agents service, no roots, a throwing probe), so a host that cannot answer keeps
251
+ # the harness's own behaviour instead of failing the preset's load. It
252
+ # deliberately has no settings-card field: the row's own `enabled` key is the off
253
+ # switch, exactly as for `subagent-routes` above.
254
+ - id: dispatch-guard
255
+ name: ./dispatch-guard.mjs
256
+
238
257
  # The harness's workspace-instruction loader. Under the default
239
258
  # `instructionSource: host` this row owns the channel: its baseline and dynamic
240
259
  # user-role messages reach the model untouched. Under
@@ -425,18 +444,6 @@
425
444
  # selection fails with `child model selection is disabled for this tool
426
445
  # instance` and the settings page's subagent toggle reads as dead.
427
446
  #
428
- # `modelSelectionSettings: true` is the PRE-SPLIT spelling of the same
429
- # opt-in: one boolean that published the route fields AND registered
430
- # discovery. The SDK pinned in this package's devDependencies
431
- # (0.2.1-rc.3) still ships only that key, while the harness checkout this
432
- # repository runs against has replaced it with the pair above. That
433
- # loader's schema does not declare the retired name, so nothing reads it:
434
- # Schemastery keeps the undeclared field but fills `modelSelection` and
435
- # `modelDiscovery` with `false`, leaving the opt-in inert with no error
436
- # to notice. Both spellings therefore ship together: each generation
437
- # reads the key it knows and ignores the other, and neither host loses
438
- # the opt-in. Delete `modelSelectionSettings` once no supported cohort
439
- # predates the split.
440
447
  #
441
448
  # EXACTLY ONE delegation row per composition scope may enable
442
449
  # `modelDiscovery`: it registers the discovery tool under the FIXED name
@@ -455,7 +462,6 @@
455
462
  config:
456
463
  provider: spawn
457
464
  toolName: subagent
458
- modelSelectionSettings: true
459
465
  modelSelection: true
460
466
  modelDiscovery: true
461
467
  backgroundMode: continuable
@@ -524,3 +530,9 @@
524
530
  config:
525
531
  fetch: false
526
532
  searchTimeoutMs: 60000
533
+
534
+ # PTC execution is an agent-scoped plugin in this cohort, and this row IS the
535
+ # presentation: the settings overlay disables it for the native presentation.
536
+ # Without that executor the wire has no `run_code` to carry a program.
537
+ - id: tool-executor-ptc
538
+ name: '@deepseek-ai/dsh-tool-executor-ptc'