@khorsheed/dsh-local-agent-dsh 0.1.0-rc.9 → 0.2.0-rc.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # 变更记录
2
2
 
3
+ ## 0.2.0-rc.1(2026-09-30)
4
+
5
+ - **家族折叠:`subagent_dsh` 改挂家族核的 `./tool-factory`**。开关 ON 时的动态挂载从已退役的 `@khorsheed/dsh-local-agent-tool-subagent` 包改为 `@khorsheed/dsh-local-agent/tool-factory` 的 `mountSubagentDelegationTool`(内联插件对象,owner 传本包包名),行为与生命周期不变(设置开关独占挂载/卸载)。依赖同步移除。
6
+
3
7
  ## 0.1.0-rc.9(2026-09-30)
4
8
 
5
9
  - **修复同款跨实例 home 回退**:`defaultPresetRoot()` 的兜底从硬编码 `~/.dsh-official` 改为非空白 `$DSH_HOME` → `~/.dsh`(官方 `resolveDshHome` 优先级),桌面 app 上不再误读其他实例的 preset 根
package/lib/client.js CHANGED
@@ -255,30 +255,30 @@ window.__ModuleLoader__.load({
255
255
  document.head.appendChild(tag);
256
256
  }
257
257
  var ProviderAuthBlock_module_css_default = {
258
- "rowPending": "On5p7W_rowPending",
259
- "status": "On5p7W_status",
260
258
  "rowHead": "On5p7W_rowHead",
259
+ "rows": "On5p7W_rows",
261
260
  "rowTag": "On5p7W_rowTag",
262
- "credentialDot": "On5p7W_credentialDot",
261
+ "status": "On5p7W_status",
262
+ "intro": "On5p7W_intro",
263
+ "section": "On5p7W_section",
264
+ "rowCard": "On5p7W_rowCard",
265
+ "title": "On5p7W_title",
263
266
  "dotPending": "On5p7W_dotPending",
267
+ "rosterError": "On5p7W_rosterError",
268
+ "retryButton": "On5p7W_retryButton",
264
269
  "loginPrompt": "On5p7W_loginPrompt",
265
- "rows": "On5p7W_rows",
266
- "rowCard": "On5p7W_rowCard",
267
- "dotOff": "On5p7W_dotOff",
270
+ "codeInput": "On5p7W_codeInput",
271
+ "logoutButton": "On5p7W_logoutButton",
268
272
  "loginButton": "On5p7W_loginButton",
269
273
  "rowActions": "On5p7W_rowActions",
270
- "title": "On5p7W_title",
271
274
  "promptText": "On5p7W_promptText",
272
- "codeInput": "On5p7W_codeInput",
273
- "rowIdentity": "On5p7W_rowIdentity",
274
- "rosterError": "On5p7W_rosterError",
275
- "dotOn": "On5p7W_dotOn",
276
- "retryButton": "On5p7W_retryButton",
275
+ "rowPending": "On5p7W_rowPending",
277
276
  "openPage": "On5p7W_openPage",
278
- "intro": "On5p7W_intro",
279
- "logoutButton": "On5p7W_logoutButton",
280
- "section": "On5p7W_section",
281
- "rowName": "On5p7W_rowName"
277
+ "dotOff": "On5p7W_dotOff",
278
+ "dotOn": "On5p7W_dotOn",
279
+ "credentialDot": "On5p7W_credentialDot",
280
+ "rowName": "On5p7W_rowName",
281
+ "rowIdentity": "On5p7W_rowIdentity"
282
282
  };
283
283
  //#endregion
284
284
  //#region ../local-agent/src/client/ProviderAuthBlock.tsx
@@ -551,10 +551,10 @@ window.__ModuleLoader__.load({
551
551
  document.head.appendChild(tag);
552
552
  }
553
553
  var AuthStatusDot_module_css_default = {
554
- "dotOff": "OFjNUG_dotOff",
555
- "dotPending": "OFjNUG_dotPending",
556
554
  "dotOn": "OFjNUG_dotOn",
557
- "credentialDot": "OFjNUG_credentialDot"
555
+ "credentialDot": "OFjNUG_credentialDot",
556
+ "dotOff": "OFjNUG_dotOff",
557
+ "dotPending": "OFjNUG_dotPending"
558
558
  };
559
559
  //#endregion
560
560
  //#region ../local-agent/src/client/AuthStatusDot.tsx
@@ -580,40 +580,40 @@ window.__ModuleLoader__.load({
580
580
  document.head.appendChild(tag);
581
581
  }
582
582
  var SettingsCard_module_css_default = {
583
- "modelItemCurrent": "_3LBPpW_modelItemCurrent",
584
- "info": "_3LBPpW_info",
585
- "chevronOpen": "_3LBPpW_chevronOpen",
586
- "headText": "_3LBPpW_headText",
587
- "saved": "_3LBPpW_saved",
588
- "modelItemDefault": "_3LBPpW_modelItemDefault",
583
+ "modelMenuButton": "_3LBPpW_modelMenuButton",
584
+ "modelMenuUp": "_3LBPpW_modelMenuUp",
585
+ "modelField": "_3LBPpW_modelField",
589
586
  "modelItemLabel": "_3LBPpW_modelItemLabel",
590
- "modelItemCheck": "_3LBPpW_modelItemCheck",
591
587
  "modelSave": "_3LBPpW_modelSave",
592
- "hint": "_3LBPpW_hint",
593
- "blockTitle": "_3LBPpW_blockTitle",
588
+ "chevron": "_3LBPpW_chevron",
589
+ "modelItemCurrent": "_3LBPpW_modelItemCurrent",
590
+ "switch": "_3LBPpW_switch",
591
+ "name": "_3LBPpW_name",
592
+ "modelMenuChevron": "_3LBPpW_modelMenuChevron",
593
+ "row": "_3LBPpW_row",
594
594
  "cardOpen": "_3LBPpW_cardOpen",
595
- "errorText": "_3LBPpW_errorText",
596
- "card": "_3LBPpW_card",
597
- "description": "_3LBPpW_description",
598
595
  "block": "_3LBPpW_block",
599
- "switchOn": "_3LBPpW_switchOn",
600
- "modelMenuChevronOpen": "_3LBPpW_modelMenuChevronOpen",
596
+ "saved": "_3LBPpW_saved",
597
+ "card": "_3LBPpW_card",
601
598
  "rowLabel": "_3LBPpW_rowLabel",
602
- "switch": "_3LBPpW_switch",
599
+ "headText": "_3LBPpW_headText",
600
+ "modelInput": "_3LBPpW_modelInput",
601
+ "modelItemDefault": "_3LBPpW_modelItemDefault",
603
602
  "body": "_3LBPpW_body",
604
- "modelMenuChevron": "_3LBPpW_modelMenuChevron",
603
+ "chevronOpen": "_3LBPpW_chevronOpen",
604
+ "blockTitle": "_3LBPpW_blockTitle",
605
+ "errorText": "_3LBPpW_errorText",
605
606
  "nameRow": "_3LBPpW_nameRow",
606
- "modelField": "_3LBPpW_modelField",
607
- "modelMenuButton": "_3LBPpW_modelMenuButton",
608
- "modelMenuUp": "_3LBPpW_modelMenuUp",
609
- "modelItem": "_3LBPpW_modelItem",
610
- "chevron": "_3LBPpW_chevron",
607
+ "modelMenuChevronOpen": "_3LBPpW_modelMenuChevronOpen",
611
608
  "modelMenu": "_3LBPpW_modelMenu",
612
- "name": "_3LBPpW_name",
613
- "row": "_3LBPpW_row",
614
- "modelInput": "_3LBPpW_modelInput",
609
+ "modelItem": "_3LBPpW_modelItem",
610
+ "modelItemCheck": "_3LBPpW_modelItemCheck",
615
611
  "header": "_3LBPpW_header",
616
- "knob": "_3LBPpW_knob"
612
+ "info": "_3LBPpW_info",
613
+ "knob": "_3LBPpW_knob",
614
+ "description": "_3LBPpW_description",
615
+ "switchOn": "_3LBPpW_switchOn",
616
+ "hint": "_3LBPpW_hint"
617
617
  };
618
618
  //#endregion
619
619
  //#region src/client/SettingsCard.tsx
package/lib/index.js CHANGED
@@ -5,7 +5,7 @@ import { join } from "node:path";
5
5
  import z from "@deepseek-ai/schemastery";
6
6
  import { credentialRef } from "@deepseek-ai/dsh-credentials";
7
7
  import { ModelDirectoryCache, extendModelDirectory, settingsFace, vol } from "@khorsheed/dsh-local-agent";
8
- import * as toolModule from "@khorsheed/dsh-local-agent-tool-subagent";
8
+ import { mountSubagentDelegationTool } from "@khorsheed/dsh-local-agent/tool-factory";
9
9
  //#region lib/types/live-switch.js
10
10
  /**
11
11
  * The settings-driven live-driver switch: owns the active driver generation
@@ -445,6 +445,32 @@ const DSH_SETTINGS_NAMESPACE = "local-agent-dsh";
445
445
  const DSH_SETTINGS_SCHEMA = z.object(SETTINGS_FIELDS);
446
446
  /** The delegation tool the toggle mounts while ON. */
447
447
  const DSH_TOOL_NAME = "subagent_dsh";
448
+ /**
449
+ * This package's own name, passed to the family tool factory as the
450
+ * tool-origin owner (AGENTS.md § Tool origin tagging — a shared factory never
451
+ * hardcodes an owner). Duplicated from src/invariant.ts, the same pattern the
452
+ * worktrees/room `./tool` entries use.
453
+ */
454
+ const PACKAGE_NAME = "@khorsheed/dsh-local-agent-dsh";
455
+ /**
456
+ * The `subagent_dsh` mount, as a plugin object over the family factory: the
457
+ * toggle owns its lifecycle, so it mounts dynamically through `ctx.plugin`
458
+ * instead of shipping a `./tool` composition row like the CLI providers.
459
+ */
460
+ const dshSubagentTool = {
461
+ name: "local-agent-dsh-tool",
462
+ inject: [
463
+ "tools",
464
+ "subagents",
465
+ "localAgent"
466
+ ],
467
+ apply: (toolCtx) => {
468
+ mountSubagentDelegationTool(toolCtx, {
469
+ provider: "dsh-cli",
470
+ toolName: DSH_TOOL_NAME
471
+ }, PACKAGE_NAME);
472
+ }
473
+ };
448
474
  /** Resolve the sub-dsh credential or report unconfigured. */
449
475
  async function resolveApiKey(ctx, config) {
450
476
  return ctx.credentials.resolve(credentialRef(config.apiKeyRef ?? "DEEPSEEK_API_KEY"));
@@ -593,10 +619,7 @@ function apply(ctx, config) {
593
619
  if (currentLiveSwitch === liveSwitch) currentLiveSwitch = void 0;
594
620
  liveSwitch.dispose();
595
621
  });
596
- ctx.plugin(toolModule, {
597
- provider: "dsh-cli",
598
- toolName: DSH_TOOL_NAME
599
- }).then((fiber) => {
622
+ ctx.plugin(dshSubagentTool).then((fiber) => {
600
623
  if (gen !== generation) {
601
624
  fiber.dispose();
602
625
  return;
@@ -26,7 +26,7 @@ import { join } from 'node:path';
26
26
  import z from '@deepseek-ai/schemastery';
27
27
  import { credentialRef } from '@deepseek-ai/dsh-credentials';
28
28
  import { settingsFace, vol } from '@khorsheed/dsh-local-agent';
29
- import * as toolModule from '@khorsheed/dsh-local-agent-tool-subagent';
29
+ import { mountSubagentDelegationTool } from '@khorsheed/dsh-local-agent/tool-factory';
30
30
  import { CONTAINER_NODE_OPTIONS, DshCliProvider, dshCliVersion } from './dsh-cli-provider.js';
31
31
  import { DEFAULT_LIVE_IDLE_MS } from './live-driver.js';
32
32
  import { LiveDriverSwitch } from './live-switch.js';
@@ -97,6 +97,25 @@ export const DSH_SETTINGS_NAMESPACE = 'local-agent-dsh';
97
97
  const DSH_SETTINGS_SCHEMA = z.object(SETTINGS_FIELDS);
98
98
  /** The delegation tool the toggle mounts while ON. */
99
99
  const DSH_TOOL_NAME = 'subagent_dsh';
100
+ /**
101
+ * This package's own name, passed to the family tool factory as the
102
+ * tool-origin owner (AGENTS.md § Tool origin tagging — a shared factory never
103
+ * hardcodes an owner). Duplicated from src/invariant.ts, the same pattern the
104
+ * worktrees/room `./tool` entries use.
105
+ */
106
+ const PACKAGE_NAME = '@khorsheed/dsh-local-agent-dsh';
107
+ /**
108
+ * The `subagent_dsh` mount, as a plugin object over the family factory: the
109
+ * toggle owns its lifecycle, so it mounts dynamically through `ctx.plugin`
110
+ * instead of shipping a `./tool` composition row like the CLI providers.
111
+ */
112
+ const dshSubagentTool = {
113
+ name: 'local-agent-dsh-tool',
114
+ inject: ['tools', 'subagents', 'localAgent'],
115
+ apply: (toolCtx) => {
116
+ mountSubagentDelegationTool(toolCtx, { provider: 'dsh-cli', toolName: DSH_TOOL_NAME }, PACKAGE_NAME);
117
+ },
118
+ };
100
119
  /** Resolve the sub-dsh credential or report unconfigured. */
101
120
  async function resolveApiKey(ctx, config) {
102
121
  return ctx.credentials.resolve(credentialRef(config.apiKeyRef ?? 'DEEPSEEK_API_KEY'));
@@ -322,7 +341,7 @@ export function apply(ctx, config) {
322
341
  });
323
342
  // The family delegation tool is mounted dynamically so the toggle owns
324
343
  // its lifecycle — while OFF the model never sees `subagent_dsh`.
325
- void ctx.plugin(toolModule, { provider: 'dsh-cli', toolName: DSH_TOOL_NAME }).then((fiber) => {
344
+ void ctx.plugin(dshSubagentTool).then((fiber) => {
326
345
  if (gen !== generation) {
327
346
  void fiber.dispose();
328
347
  return;
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "local-agent",
9
9
  "subagent"
10
10
  ],
11
- "version": "0.1.0-rc.9",
11
+ "version": "0.2.0-rc.1",
12
12
  "type": "module",
13
13
  "main": "lib/index.js",
14
14
  "types": "lib/types/index.d.ts",
@@ -73,9 +73,8 @@
73
73
  ],
74
74
  "license": "MIT",
75
75
  "dependencies": {
76
- "@khorsheed/dsh-local-agent": "^0.1.0-rc.8",
77
- "@khorsheed/dsh-local-agent-dsh-headless": "^0.1.0-rc.8",
78
- "@khorsheed/dsh-local-agent-tool-subagent": "^0.1.0-rc.8"
76
+ "@khorsheed/dsh-local-agent": "^0.2.0-rc.1",
77
+ "@khorsheed/dsh-local-agent-dsh-headless": "^0.2.0-rc.1"
79
78
  },
80
79
  "peerDependencies": {
81
80
  "@deepseek-ai/cordis": "^4.0.1",