dsh-git-worktree 0.7.4 → 0.7.5

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
@@ -4,6 +4,16 @@
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.7.5] - 2026-09-06
8
+
9
+ `0.7.5` 修复插件启停时官方 Workspace provider 与 Managed 聚合 provider 的生命周期协调:禁用插件后可靠恢复官方 `uiWorkspace`,启用时继续保留 Managed 会话聚合,不再因静态 bundle patch 残留导致 Web 会话阻塞。
10
+
11
+ ### Fixed
12
+
13
+ - 修复 #4:插件条目禁用但 bundle patch 仍保留时,恢复官方 `uiWorkspace`,不再因双方均停用阻塞 Web 会话;启用时继续保留 Managed 会话聚合和侧边栏标记。
14
+ - Workspace 替换改为 Host 生命周期控制的条件选择;同步 Loader 与 Web 模块清单,覆盖延迟 Include、市场禁用状态回放和初始化失败恢复,不持久化官方禁用标志。
15
+ - 新增锁定 DSH `0.1.2-rc.1` 的真实 Loader / Include / ClientModuleRegistry 回归;切换后仍应完整重启 DSH 并重新加载页面。
16
+
7
17
  ## [0.7.4] - 2026-09-04
8
18
 
9
19
  `0.7.4` 修复 `0.7.3` 在 DeepSeek Harness `0.1.2-rc.1` Web Client 中的启动循环依赖。插件现在先恢复被受控派生替换的官方 `uiWorkspace` 服务,再延迟加载依赖 Conversation 的 Worktree 界面。
@@ -275,6 +285,7 @@
275
285
 
276
286
  - 发布初版生产级 Worktree 管理、基础 apply/finish/discard 生命周期和安全清理。
277
287
 
288
+ [0.7.5]: https://github.com/wloops/dsh-git-worktree/compare/v0.7.4...v0.7.5
278
289
  [0.7.4]: https://github.com/wloops/dsh-git-worktree/compare/v0.7.3...v0.7.4
279
290
  [0.7.3]: https://github.com/wloops/dsh-git-worktree/compare/v0.7.2...v0.7.3
280
291
  [0.7.2]: https://github.com/wloops/dsh-git-worktree/compare/v0.7.1...v0.7.2
package/README.en.md CHANGED
@@ -75,10 +75,10 @@ See the [full usage guide](docs/USAGE.en.md) for detailed actions, recovery scen
75
75
 
76
76
  Before upgrading an existing Harness installation, handle Host data migration: `0.1.2-rc.1` removes the optional SQLite Session backend, so use an older Harness version to export that data first. Code Mode is now named PTC mode, while existing conversation records remain readable. Launch applications and install this plugin through a `dsh` Profile.
77
77
 
78
- After upgrading Harness from an earlier release, if the web UI shows **Failed to load plugins**, install version `0.7.4` or later and restart Harness. Releases through `0.7.2` depend on the discontinued `dsh-client-runtime`; `0.7.3` can also form a `conversation` / `uiWorkspace` activation cycle in the rc.1 Web Client.
78
+ After upgrading Harness from an earlier release, if the web UI shows **Failed to load plugins**, install version `0.7.5` or later and restart Harness. Releases through `0.7.2` depend on the discontinued `dsh-client-runtime`; `0.7.3` can also form a `conversation` / `uiWorkspace` activation cycle in the rc.1 Web Client.
79
79
 
80
80
  ```bash
81
- dsh plugin --profile web add dsh-git-worktree@0.7.4
81
+ dsh plugin --profile web add dsh-git-worktree@0.7.5
82
82
  ```
83
83
 
84
84
  ### Install
@@ -90,7 +90,7 @@ dsh plugin --profile web add dsh-git-worktree
90
90
  Or install a specific version:
91
91
 
92
92
  ```bash
93
- dsh plugin --profile web add github:wloops/dsh-git-worktree#v0.7.4
93
+ dsh plugin --profile web add github:wloops/dsh-git-worktree#v0.7.5
94
94
  ```
95
95
 
96
96
  Open a Git Workspace and enable **Worktree** when creating a Session. An existing Local Session can also let the model call `worktree_create`.
package/README.md CHANGED
@@ -75,10 +75,10 @@ flowchart LR
75
75
 
76
76
  从旧 Harness 升级时请先处理 Host 数据迁移:`0.1.2-rc.1` 已移除可选 SQLite Session 后端,旧数据需使用旧版 Harness 导出;Code Mode 已更名为 PTC mode,但现有会话记录仍可读取。应用和本插件统一通过 `dsh` Profile 启动与安装。
77
77
 
78
- 从旧版 Harness 升级后,如果 Web 界面提示 **Failed to load plugins**,请安装 `0.7.4` 或更高版本并重启 Harness。`0.7.2` 及更早版本依赖已停止发布的 `dsh-client-runtime`;`0.7.3` 在 rc.1 Web Client 中还可能形成 `conversation` / `uiWorkspace` 循环等待。
78
+ 从旧版 Harness 升级后,如果 Web 界面提示 **Failed to load plugins**,请安装 `0.7.5` 或更高版本并重启 Harness。`0.7.2` 及更早版本依赖已停止发布的 `dsh-client-runtime`;`0.7.3` 在 rc.1 Web Client 中还可能形成 `conversation` / `uiWorkspace` 循环等待。
79
79
 
80
80
  ```bash
81
- dsh plugin --profile web add dsh-git-worktree@0.7.4
81
+ dsh plugin --profile web add dsh-git-worktree@0.7.5
82
82
  ```
83
83
 
84
84
  ### 安装
@@ -90,7 +90,7 @@ dsh plugin --profile web add dsh-git-worktree
90
90
  也可以安装指定版本:
91
91
 
92
92
  ```bash
93
- dsh plugin --profile web add github:wloops/dsh-git-worktree#v0.7.4
93
+ dsh plugin --profile web add github:wloops/dsh-git-worktree#v0.7.5
94
94
  ```
95
95
 
96
96
  安装后打开 Git Workspace,在新建 Session 时启用 **Worktree**;已有 Local Session 也可以让模型调用 `worktree_create` 创建隔离 Session。
package/cordis.patch.yml CHANGED
@@ -1,10 +1,10 @@
1
- # Replace the official ui-workspace loader row while this plugin is enabled.
2
- # The Client bundle derives that exact version's official Browser, Picker,
3
- # locale, stores, and directory-flow declarations, wrapping only the Browser.
1
+ # Keep the official Workspace available when this bundle remains installed but
2
+ # its replacement entry (or an owning group) is disabled. Provider selection is
3
+ # evaluated by the Loader; restart DSH after changing the plugin's enabled state.
4
4
 
5
5
  - id: ui-workspace
6
6
  name: '@deepseek-ai/dsh-client-ui-workspace'
7
- disabled: true
7
+ disabled: !!js "!!get('worktreeWorkspaceProvider') && [...loader.entries()].some(entry => entry.options?.name === 'dsh-git-worktree' && !entry.disabled)"
8
8
 
9
9
  - insert:
10
10
  - id: dsh-git-worktree
@@ -19,8 +19,8 @@ export async function apply(ctx) {
19
19
  throw new Error('Worktree Console Remote namespace 挂载失败');
20
20
  const adapter = createWorktreeConsoleRemoteAdapter(remote);
21
21
  ctx.provide('worktreeConsole', adapter);
22
- // The official ui-workspace row is disabled by cordis.patch.yml. Restore its
23
- // service and Slot declarations before uiConversation becomes available.
22
+ // Host lifecycle selects this replacement only while the plugin is active.
23
+ // Provide Workspace before uiConversation to avoid a Client boot cycle.
24
24
  registerManagedWorkspaceSidebar(ctx, adapter);
25
25
  // The remaining Worktree views consume conversation/connection. Keeping
26
26
  // them in a child fiber prevents those services from blocking uiWorkspace.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/console-remote/index.ts"],"names":[],"mappings":"AAGA,OAAO,YAAwC,MAAM,gCAAgC,CAAA;AACrF,OAAO,EAAE,KAAK,IAAI,cAAc,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,aAAa,CAAA;AAC/E,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAA;AAC/E,OAAO,EAAE,MAAM,IAAI,uBAAuB,EAAE,MAAM,uCAAuC,CAAA;AACzF,OAAO,EAAE,kCAAkC,EAAE,MAAM,cAAc,CAAA;AAEjE,OAAO,EAAE,kCAAkC,EAAE,MAAM,cAAc,CAAA;AAEjE;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,GAAG,uBAAuB,CAAC,CAAA;AAYlD,+EAA+E;AAC/E,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,GAAyB;IACnD,MAAM,aAAa,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;IAC3D,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,CAAA;IAC/B,MAAM,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,oBAAoB,CAAkC,CAAA;IAC7E,IAAI,MAAM,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAA;IACnF,MAAM,OAAO,GAAG,kCAAkC,CAAC,MAAM,CAAC,CAAA;IAC1D,GAAG,CAAC,OAAO,CAAC,iBAAiB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C,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAA;IAEvC,2EAA2E;IAC3E,wEAAwE;IACxE,+BAA+B,CAC7B,GAAuE,EACvE,OAAO,CACR,CAAA;IAED,wEAAwE;IACxE,2EAA2E;IAC3E,GAAG,CAAC,MAAM,CAAC,cAAc,EAAE,KAAK,CAAC,EAAE;QACjC,cAAc,CAAC,KAAwD,EAAE,OAAO,CAAC,CAAA;IACnF,CAAC,CAAC,CAAA;AACJ,CAAC"}
package/lib/index.d.ts CHANGED
@@ -95,7 +95,14 @@ export interface SessionCheckoutModule {
95
95
  reconcile(): Promise<SessionCheckoutReconcileSummary>;
96
96
  }
97
97
  export * from './console-contract.js';
98
- export declare const inject: string[];
98
+ export declare const inject: {
99
+ tools: {};
100
+ commands: {};
101
+ subprocess: {};
102
+ loader: {
103
+ await: boolean;
104
+ };
105
+ };
99
106
  /**
100
107
  * Mount the plugin: DSH adapters, the session-checkout module, safe worktree
101
108
  * tools, human acceptance command, dynamic target context, startup recovery,
@@ -103,4 +110,4 @@ export declare const inject: string[];
103
110
  */
104
111
  export declare function apply(ctx: Context, config?: {
105
112
  stateDir?: string;
106
- }): void;
113
+ }): Promise<void>;
package/lib/index.js CHANGED
@@ -27,6 +27,7 @@ import z from '@deepseek-ai/schemastery';
27
27
  import { createDshGitPort } from './adapters/git.js';
28
28
  import { createNodeFilesPort } from './adapters/files.js';
29
29
  import { AtomicJsonCheckoutRegistry } from './adapters/registry.js';
30
+ import { mountWorkspaceProviderLifecycle } from './workspace-provider-lifecycle.js';
30
31
  import { createDshLookupPort } from './adapters/lookup.js';
31
32
  import { createSessionCheckoutApplyEngine } from './session-checkout-apply.js';
32
33
  import { createSessionCheckoutModule } from './session-checkout-module.js';
@@ -41,7 +42,7 @@ const name = 'git-worktree';
41
42
  // Named export: the loader reads inject/apply named exports as plugin
42
43
  // metadata. A bare function export mounts with no injection list, and the
43
44
  // first ctx.tools access then fails with "cannot get property without inject".
44
- export const inject = ['tools', 'commands', 'subprocess'];
45
+ export const inject = { tools: {}, commands: {}, subprocess: {}, loader: { await: false } };
45
46
  const Config = z.object({
46
47
  /**
47
48
  * Plugin state directory (registry, disabled-hooks root). Defaults to
@@ -63,7 +64,8 @@ const RETENTION_MAINTENANCE_INTERVAL_MS = 15 * 60 * 1000;
63
64
  * tools, human acceptance command, dynamic target context, startup recovery,
64
65
  * and the retention-expiry timer.
65
66
  */
66
- export function apply(ctx, config = {}) {
67
+ export async function apply(ctx, config = {}) {
68
+ await mountWorkspaceProviderLifecycle(ctx);
67
69
  const stateDir = resolveStateDir(config);
68
70
  mkdirSync(stateDir, { recursive: true });
69
71
  const hooksPath = join(stateDir, 'disabled-git-hooks');
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA0BH,2FAA2F;AAC3F,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IACpC,IAAI,CAA0B;IAEvC;;;OAGG;IACH,YAAY,IAA8B,EAAE,OAAe;QACzD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAA;QAClC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;CACF;AA6GD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,CAAC,MAAM,0BAA0B,CAAA;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA;AACnE,OAAO,EAAE,mBA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,CAAA;IAEH,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;IAC1B,uBAAuB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;IACpC,4BAA4B,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;IAEzC,wEAAwE;IACxE,yEAAyE;IACzE,qCAAqC;IACrC,MAAM,gBAAgB,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;QACnD,KAAK,MAAM,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACtC,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAA;QAC7D,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IACF,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;QACtC,KAAK,MAAM,CAAC,sBAAsB,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACnD,OAAO,CAAC,IAAI,CAAC,0DAA0D,EAAE,KAAK,CAAC,CAAA;QACjF,CAAC,CAAC,CAAA;IACJ,CAAC,EAAE,iCAAiC,CAAC,CAAA;IACrC,cAAc,CAAC,KAAK,EAAE,EAAE,CAAA;IACxB,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE;QACpB,gBAAgB,EAAE,CAAA;QAClB,aAAa,CAAC,cAAc,CAAC,CAAA;IAC/B,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ export declare const WORKSPACE_PROVIDER_CONDITION = "!!get('worktreeWorkspaceProvider') && [...loader.entries()].some(entry => entry.options?.name === 'dsh-git-worktree' && !entry.disabled)";
3
+ declare module '@deepseek-ai/cordis' {
4
+ interface Context {
5
+ worktreeWorkspaceProvider: boolean;
6
+ }
7
+ }
8
+ /**
9
+ * Reconcile the conditional patch with the public Loader lifecycle. A disabled
10
+ * expression is evaluated dynamically, but the Web module registry caches rows
11
+ * by plugin name; a change to the replacement alone does not re-elect Workspace.
12
+ * Restarting the official entry through Loader operations publishes real module
13
+ * events without saving any disabled flag or changing the user's profile.
14
+ */
15
+ export declare function mountWorkspaceProviderLifecycle(ctx: Context): Promise<void>;
@@ -0,0 +1,65 @@
1
+ export const WORKSPACE_PROVIDER_CONDITION = "!!get('worktreeWorkspaceProvider') && [...loader.entries()].some(entry => entry.options?.name === 'dsh-git-worktree' && !entry.disabled)";
2
+ const OFFICIAL_WORKSPACE = '@deepseek-ai/dsh-client-ui-workspace';
3
+ // Cordis exposes FiberState as a declaration-only const enum, not a JS export.
4
+ const UNLOADING = 5;
5
+ /**
6
+ * Reconcile the conditional patch with the public Loader lifecycle. A disabled
7
+ * expression is evaluated dynamically, but the Web module registry caches rows
8
+ * by plugin name; a change to the replacement alone does not re-elect Workspace.
9
+ * Restarting the official entry through Loader operations publishes real module
10
+ * events without saving any disabled flag or changing the user's profile.
11
+ */
12
+ export async function mountWorkspaceProviderLifecycle(ctx) {
13
+ const loader = ctx.loader;
14
+ const owned = () => [...loader.entries()].filter(entry => {
15
+ const disabled = entry.options.disabled;
16
+ return entry.options.name === OFFICIAL_WORKSPACE
17
+ && typeof disabled === 'object' && disabled !== null
18
+ && '__jsExpr' in disabled && disabled.__jsExpr === WORKSPACE_PROVIDER_CONDITION;
19
+ });
20
+ let released = false;
21
+ let pending = Promise.resolve();
22
+ const reconcile = () => {
23
+ pending = pending.then(async () => {
24
+ if (released)
25
+ return;
26
+ for (const entry of owned()) {
27
+ if (entry.disabled) {
28
+ if (!released)
29
+ await entry.update({}, false, true);
30
+ }
31
+ else {
32
+ await entry.refresh();
33
+ }
34
+ }
35
+ });
36
+ return pending;
37
+ };
38
+ ctx.effect(() => async () => {
39
+ released = true;
40
+ // Root/Include teardown owns these entries; do not resurrect that tree.
41
+ if (ctx.root.fiber.uid === null || ctx.root.fiber.state === UNLOADING)
42
+ return;
43
+ await pending.catch(() => { });
44
+ for (const entry of owned()) {
45
+ if (entry.parent.ctx.fiber.uid !== null && entry.parent.ctx.fiber.state !== UNLOADING && !entry.disabled)
46
+ await entry.refresh();
47
+ }
48
+ });
49
+ // Registered after the fallback so LIFO teardown releases the selection
50
+ // before restoring Workspace, including when the replacement apply fails.
51
+ ctx.provide('worktreeWorkspaceProvider', true);
52
+ // Includes may add the official row after the replacement has activated.
53
+ ctx.on('internal/status', fiber => {
54
+ if (fiber === ctx.fiber && !released) {
55
+ void reconcile().catch(error => ctx.logger.warn(error));
56
+ }
57
+ });
58
+ ctx.on('internal/plugin', fiber => {
59
+ if (fiber.uid && fiber.entry?.options.name === OFFICIAL_WORKSPACE) {
60
+ void reconcile().catch(error => ctx.logger.warn(error));
61
+ }
62
+ });
63
+ await reconcile();
64
+ }
65
+ //# sourceMappingURL=workspace-provider-lifecycle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-provider-lifecycle.js","sourceRoot":"","sources":["../src/workspace-provider-lifecycle.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,4BAA4B,GAAG,0IAA0I,CAAA;AAOtL,MAAM,kBAAkB,GAAG,sCAAsC,CAAA;AACjE,+EAA+E;AAC/E,MAAM,SAAS,GAAe,CAAC,CAAA;AAE/B;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,+BAA+B,CAAC,GAAY;IAChE,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAA;IACzB,MAAM,KAAK,GAAG,GAAY,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;QAChE,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,QAAmB,CAAA;QAClD,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,kBAAkB;eAC3C,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI;eACjD,UAAU,IAAI,QAAQ,IA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CAAC,OAAO,EAAE,CAAA;QACjI,CAAC;IACH,CAAC,CAAC,CAAA;IACF,wEAAwE;IACxE,0EAA0E;IAC1E,GAAG,CAAC,OAAO,CAAC,2BAA2B,EAAE,IAAI,CAAC,CAAA;IAC9C,yEAAyE;IACzE,GAAG,CAAC,EAAE,CAAC,iBAAiB,EAAE,KAAK,CAAC,EAAE;QAChC,IAAI,KAAK,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;YACrC,KAAK,SAAS,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;QACzD,CAAC;IACH,CAAC,CAAC,CAAA;IACF,GAAG,CAAC,EAAE,CAAC,iBAAiB,EAAE,KAAK,CAAC,EAAE;QAChC,IAAI,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;YAClE,KAAK,SAAS,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;QACzD,CAAC;IACH,CAAC,CAAC,CAAA;IACF,MAAM,SAAS,EAAE,CAAA;AACnB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-git-worktree",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
4
4
  "description": "Experimental Git worktree Session Targets for DeepSeek Harness with isolated sessions, review checkpoints, human-confirmed delivery, and safe recovery.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -85,6 +85,7 @@
85
85
  },
86
86
  "peerDependencies": {
87
87
  "@deepseek-ai/cordis": "^4.0.2",
88
+ "@deepseek-ai/cordis-plugin-loader": "^1.0.3",
88
89
  "@deepseek-ai/dsh-agent": "^0.1.2-rc.1",
89
90
  "@deepseek-ai/dsh-client-locale": "0.1.2-rc.1",
90
91
  "@deepseek-ai/dsh-commands": "^0.1.2-rc.1",
@@ -98,12 +99,15 @@
98
99
  },
99
100
  "devDependencies": {
100
101
  "@deepseek-ai/cordis": "4.0.2",
102
+ "@deepseek-ai/cordis-plugin-include": "1.0.7",
103
+ "@deepseek-ai/cordis-plugin-loader": "1.0.3",
101
104
  "@deepseek-ai/dsh-agent": "0.1.2-rc.1",
102
105
  "@deepseek-ai/dsh-api-gateway": "0.1.2-rc.1",
103
106
  "@deepseek-ai/dsh-api-session-controller": "0.1.2-rc.1",
104
107
  "@deepseek-ai/dsh-api-workspace-controller": "0.1.2-rc.1",
105
108
  "@deepseek-ai/dsh-client-connection": "0.1.2-rc.1",
106
109
  "@deepseek-ai/dsh-client-locale": "0.1.2-rc.1",
110
+ "@deepseek-ai/dsh-client-modules": "0.1.2-rc.1",
107
111
  "@deepseek-ai/dsh-client-store": "0.1.2-rc.1",
108
112
  "@deepseek-ai/dsh-client-ui-primitives": "0.1.2-rc.1",
109
113
  "@deepseek-ai/dsh-client-ui-workspace": "0.1.2-rc.1",
@@ -38,6 +38,7 @@ function includedByFiles(target) {
38
38
  // 1. Host singleton packages must resolve from DSH instead of a plugin-private dependency tree.
39
39
  const hostSingletonPackages = [
40
40
  '@deepseek-ai/cordis',
41
+ '@deepseek-ai/cordis-plugin-loader',
41
42
  '@deepseek-ai/dsh-agent',
42
43
  '@deepseek-ai/dsh-commands',
43
44
  '@deepseek-ai/dsh-session',
@@ -72,8 +73,10 @@ const patch = readFileSync(patchPath, 'utf8')
72
73
  if (!patch.includes('- insert:') || !patch.includes(`name: ${manifest.name}`)) {
73
74
  fail(`${patchRel} must insert one plugin row named ${manifest.name}`)
74
75
  }
75
- if (!/- id: ui-workspace\s+name: ['"]?@deepseek-ai\/dsh-client-ui-workspace['"]?\s+disabled: true/u.test(patch)) {
76
- fail(`${patchRel} must disable the original ui-workspace row while the gated derivative owns its Slot tree`)
76
+ const { WORKSPACE_PROVIDER_CONDITION } = await import(pathToFileURL(resolve(root, 'lib/workspace-provider-lifecycle.js')).href)
77
+ if (!/- id: ui-workspace\s+name: ['"]?@deepseek-ai\/dsh-client-ui-workspace['"]?\s+disabled: !!js /u.test(patch)
78
+ || !patch.includes(`disabled: !!js ${JSON.stringify(WORKSPACE_PROVIDER_CONDITION)}`)) {
79
+ fail(`${patchRel} must share the conditional Workspace selection used by the Host lifecycle`)
77
80
  }
78
81
  if (manifest.dsh?.client?.inject?.includes('@deepseek-ai/dsh-client-ui-workspace')) {
79
82
  fail('dsh.client.inject must not request the disabled official ui-workspace Client module')
@@ -145,7 +148,7 @@ ok(`manual strict ./typert + ./remote contribution (${expectedRemoteMethods.leng
145
148
  const entryRel = exportsMap['.']?.default ?? manifest.main
146
149
  if (typeof entryRel !== 'string') fail('exports["."].default is not a path')
147
150
  const entry = readFileSync(resolve(root, entryRel), 'utf8')
148
- if (!/export\s+function\s+apply\b/.test(entry)) fail(`${entryRel} does not export function apply`)
151
+ if (!/export\s+(?:async\s+)?function\s+apply\b/.test(entry)) fail(`${entryRel} does not export function apply`)
149
152
  if (!/export\s+const\s+inject\b/.test(entry)) fail(`${entryRel} does not export const inject`)
150
153
  ok(`${entryRel} exports Host apply + inject`)
151
154