@khorsheed/dsh-local-agent-dsh 0.1.0-rc.8 → 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 +8 -0
- package/lib/client.js +43 -43
- package/lib/index.js +28 -5
- package/lib/provision.js +7 -3
- package/lib/types/index.js +21 -2
- package/lib/types/provision.d.ts +4 -2
- package/lib/types/provision.js +7 -3
- package/package.json +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
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
|
+
|
|
7
|
+
## 0.1.0-rc.9(2026-09-30)
|
|
8
|
+
|
|
9
|
+
- **修复同款跨实例 home 回退**:`defaultPresetRoot()` 的兜底从硬编码 `~/.dsh-official` 改为非空白 `$DSH_HOME` → `~/.dsh`(官方 `resolveDshHome` 优先级),桌面 app 上不再误读其他实例的 preset 根
|
|
10
|
+
|
|
3
11
|
## 0.1.0-rc.8(2026-09-30)
|
|
4
12
|
|
|
5
13
|
家族同版联动:加宽 `@deepseek-ai/dsh-*` peer 区间以覆盖宿主 0.2.0(0.2.0 的兼容闸会禁用 peer 区间不覆盖宿主版本的已装插件)。无功能变更。
|
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
|
+
"rowHead": "On5p7W_rowHead",
|
|
259
|
+
"rows": "On5p7W_rows",
|
|
260
|
+
"rowTag": "On5p7W_rowTag",
|
|
261
|
+
"status": "On5p7W_status",
|
|
258
262
|
"intro": "On5p7W_intro",
|
|
259
263
|
"section": "On5p7W_section",
|
|
260
|
-
"
|
|
261
|
-
"dotOn": "On5p7W_dotOn",
|
|
262
|
-
"rosterError": "On5p7W_rosterError",
|
|
263
|
-
"loginButton": "On5p7W_loginButton",
|
|
264
|
+
"rowCard": "On5p7W_rowCard",
|
|
264
265
|
"title": "On5p7W_title",
|
|
265
266
|
"dotPending": "On5p7W_dotPending",
|
|
266
|
-
"
|
|
267
|
-
"
|
|
268
|
-
"rowCard": "On5p7W_rowCard",
|
|
269
|
-
"rowPending": "On5p7W_rowPending",
|
|
270
|
-
"rowIdentity": "On5p7W_rowIdentity",
|
|
271
|
-
"status": "On5p7W_status",
|
|
272
|
-
"rowActions": "On5p7W_rowActions",
|
|
273
|
-
"credentialDot": "On5p7W_credentialDot",
|
|
267
|
+
"rosterError": "On5p7W_rosterError",
|
|
268
|
+
"retryButton": "On5p7W_retryButton",
|
|
274
269
|
"loginPrompt": "On5p7W_loginPrompt",
|
|
275
270
|
"codeInput": "On5p7W_codeInput",
|
|
271
|
+
"logoutButton": "On5p7W_logoutButton",
|
|
272
|
+
"loginButton": "On5p7W_loginButton",
|
|
273
|
+
"rowActions": "On5p7W_rowActions",
|
|
276
274
|
"promptText": "On5p7W_promptText",
|
|
277
|
-
"
|
|
275
|
+
"rowPending": "On5p7W_rowPending",
|
|
278
276
|
"openPage": "On5p7W_openPage",
|
|
279
|
-
"
|
|
280
|
-
"
|
|
281
|
-
"
|
|
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
|
|
@@ -553,8 +553,8 @@ window.__ModuleLoader__.load({
|
|
|
553
553
|
var AuthStatusDot_module_css_default = {
|
|
554
554
|
"dotOn": "OFjNUG_dotOn",
|
|
555
555
|
"credentialDot": "OFjNUG_credentialDot",
|
|
556
|
-
"
|
|
557
|
-
"
|
|
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
|
-
"
|
|
584
|
-
"
|
|
585
|
-
"modelMenuChevronOpen": "_3LBPpW_modelMenuChevronOpen",
|
|
586
|
-
"chevron": "_3LBPpW_chevron",
|
|
587
|
-
"hint": "_3LBPpW_hint",
|
|
583
|
+
"modelMenuButton": "_3LBPpW_modelMenuButton",
|
|
584
|
+
"modelMenuUp": "_3LBPpW_modelMenuUp",
|
|
588
585
|
"modelField": "_3LBPpW_modelField",
|
|
589
|
-
"
|
|
586
|
+
"modelItemLabel": "_3LBPpW_modelItemLabel",
|
|
587
|
+
"modelSave": "_3LBPpW_modelSave",
|
|
588
|
+
"chevron": "_3LBPpW_chevron",
|
|
589
|
+
"modelItemCurrent": "_3LBPpW_modelItemCurrent",
|
|
590
590
|
"switch": "_3LBPpW_switch",
|
|
591
|
-
"
|
|
592
|
-
"rowLabel": "_3LBPpW_rowLabel",
|
|
591
|
+
"name": "_3LBPpW_name",
|
|
593
592
|
"modelMenuChevron": "_3LBPpW_modelMenuChevron",
|
|
594
|
-
"
|
|
595
|
-
"description": "_3LBPpW_description",
|
|
596
|
-
"card": "_3LBPpW_card",
|
|
593
|
+
"row": "_3LBPpW_row",
|
|
597
594
|
"cardOpen": "_3LBPpW_cardOpen",
|
|
595
|
+
"block": "_3LBPpW_block",
|
|
598
596
|
"saved": "_3LBPpW_saved",
|
|
599
|
-
"
|
|
600
|
-
"
|
|
601
|
-
"
|
|
597
|
+
"card": "_3LBPpW_card",
|
|
598
|
+
"rowLabel": "_3LBPpW_rowLabel",
|
|
599
|
+
"headText": "_3LBPpW_headText",
|
|
600
|
+
"modelInput": "_3LBPpW_modelInput",
|
|
602
601
|
"modelItemDefault": "_3LBPpW_modelItemDefault",
|
|
603
|
-
"
|
|
602
|
+
"body": "_3LBPpW_body",
|
|
604
603
|
"chevronOpen": "_3LBPpW_chevronOpen",
|
|
605
|
-
"modelItemCheck": "_3LBPpW_modelItemCheck",
|
|
606
|
-
"switchOn": "_3LBPpW_switchOn",
|
|
607
|
-
"block": "_3LBPpW_block",
|
|
608
|
-
"modelInput": "_3LBPpW_modelInput",
|
|
609
|
-
"name": "_3LBPpW_name",
|
|
610
|
-
"modelMenuUp": "_3LBPpW_modelMenuUp",
|
|
611
|
-
"knob": "_3LBPpW_knob",
|
|
612
|
-
"errorText": "_3LBPpW_errorText",
|
|
613
604
|
"blockTitle": "_3LBPpW_blockTitle",
|
|
605
|
+
"errorText": "_3LBPpW_errorText",
|
|
606
|
+
"nameRow": "_3LBPpW_nameRow",
|
|
607
|
+
"modelMenuChevronOpen": "_3LBPpW_modelMenuChevronOpen",
|
|
614
608
|
"modelMenu": "_3LBPpW_modelMenu",
|
|
615
|
-
"
|
|
616
|
-
"
|
|
609
|
+
"modelItem": "_3LBPpW_modelItem",
|
|
610
|
+
"modelItemCheck": "_3LBPpW_modelItemCheck",
|
|
611
|
+
"header": "_3LBPpW_header",
|
|
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
|
|
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(
|
|
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;
|
package/lib/provision.js
CHANGED
|
@@ -558,11 +558,15 @@ function snapshotScopePreset(homeDir, presetRoot, id, options = {}) {
|
|
|
558
558
|
*
|
|
559
559
|
* The roster's own derivation, repeated here because the provisioning paths
|
|
560
560
|
* that heal a scope (a host round, a live runtime) have no settings service
|
|
561
|
-
* in reach:
|
|
562
|
-
*
|
|
561
|
+
* in reach: a non-blank `$DSH_HOME`, else the `~/.dsh` installation default
|
|
562
|
+
* (the precedence of `resolveDshHome` in `@deepseek-ai/dsh-home-paths` —
|
|
563
|
+
* the default was once hardcoded to `.dsh-official`, pointing a desktop
|
|
564
|
+
* instance at another instance's home; 2026-09-30).
|
|
563
565
|
*/
|
|
564
566
|
function defaultPresetRoot() {
|
|
565
|
-
|
|
567
|
+
const fromEnv = process.env["DSH_HOME"];
|
|
568
|
+
const home = fromEnv !== void 0 && fromEnv.trim().length > 0 ? fromEnv : join(homedir(), ".dsh");
|
|
569
|
+
return join(home, USER_PRESET_DIR);
|
|
566
570
|
}
|
|
567
571
|
/**
|
|
568
572
|
* Provision one scope: its own preset copy, its declaration, and the
|
package/lib/types/index.js
CHANGED
|
@@ -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
|
|
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(
|
|
344
|
+
void ctx.plugin(dshSubagentTool).then((fiber) => {
|
|
326
345
|
if (gen !== generation) {
|
|
327
346
|
void fiber.dispose();
|
|
328
347
|
return;
|
package/lib/types/provision.d.ts
CHANGED
|
@@ -334,8 +334,10 @@ export declare function snapshotScopePreset(homeDir: string, presetRoot: string,
|
|
|
334
334
|
*
|
|
335
335
|
* The roster's own derivation, repeated here because the provisioning paths
|
|
336
336
|
* that heal a scope (a host round, a live runtime) have no settings service
|
|
337
|
-
* in reach:
|
|
338
|
-
*
|
|
337
|
+
* in reach: a non-blank `$DSH_HOME`, else the `~/.dsh` installation default
|
|
338
|
+
* (the precedence of `resolveDshHome` in `@deepseek-ai/dsh-home-paths` —
|
|
339
|
+
* the default was once hardcoded to `.dsh-official`, pointing a desktop
|
|
340
|
+
* instance at another instance's home; 2026-09-30).
|
|
339
341
|
*/
|
|
340
342
|
export declare function defaultPresetRoot(): string;
|
|
341
343
|
/** Per-scope inputs {@link provisionDshScope} takes. */
|
package/lib/types/provision.js
CHANGED
|
@@ -613,11 +613,15 @@ export function snapshotScopePreset(homeDir, presetRoot, id, options = {}) {
|
|
|
613
613
|
*
|
|
614
614
|
* The roster's own derivation, repeated here because the provisioning paths
|
|
615
615
|
* that heal a scope (a host round, a live runtime) have no settings service
|
|
616
|
-
* in reach:
|
|
617
|
-
*
|
|
616
|
+
* in reach: a non-blank `$DSH_HOME`, else the `~/.dsh` installation default
|
|
617
|
+
* (the precedence of `resolveDshHome` in `@deepseek-ai/dsh-home-paths` —
|
|
618
|
+
* the default was once hardcoded to `.dsh-official`, pointing a desktop
|
|
619
|
+
* instance at another instance's home; 2026-09-30).
|
|
618
620
|
*/
|
|
619
621
|
export function defaultPresetRoot() {
|
|
620
|
-
|
|
622
|
+
const fromEnv = process.env['DSH_HOME'];
|
|
623
|
+
const home = fromEnv !== undefined && fromEnv.trim().length > 0 ? fromEnv : join(homedir(), '.dsh');
|
|
624
|
+
return join(home, USER_PRESET_DIR);
|
|
621
625
|
}
|
|
622
626
|
/**
|
|
623
627
|
* Provision one scope: its own preset copy, its declaration, and the
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"local-agent",
|
|
9
9
|
"subagent"
|
|
10
10
|
],
|
|
11
|
-
"version": "0.
|
|
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.
|
|
77
|
-
"@khorsheed/dsh-local-agent-dsh-headless": "^0.
|
|
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",
|