dsh-git-worktree 0.7.3 → 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 +22 -0
- package/README.en.md +7 -1
- package/README.md +7 -1
- package/cordis.patch.yml +4 -4
- package/lib/client/console-remote/index.d.ts +5 -0
- package/lib/client/console-remote/index.js +16 -2
- package/lib/client/console-remote/index.js.map +1 -1
- package/lib/client/index.d.ts +1 -1
- package/lib/client/index.js +0 -2
- package/lib/client/index.js.map +1 -1
- package/lib/client.js +65 -58
- package/lib/index.d.ts +9 -2
- package/lib/index.js +4 -2
- package/lib/index.js.map +1 -1
- package/lib/workspace-provider-lifecycle.d.ts +15 -0
- package/lib/workspace-provider-lifecycle.js +65 -0
- package/lib/workspace-provider-lifecycle.js.map +1 -0
- package/package.json +5 -1
- package/scripts/check-publish.mjs +10 -5
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,26 @@
|
|
|
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
|
+
|
|
17
|
+
## [0.7.4] - 2026-09-04
|
|
18
|
+
|
|
19
|
+
`0.7.4` 修复 `0.7.3` 在 DeepSeek Harness `0.1.2-rc.1` Web Client 中的启动循环依赖。插件现在先恢复被受控派生替换的官方 `uiWorkspace` 服务,再延迟加载依赖 Conversation 的 Worktree 界面。
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- 将官方 Workspace Client 与 Worktree ToolView/Pre-session/Target/Review UI 拆分为两个 Cordis 激活阶段,消除 `dsh-git-worktree → conversation → uiWorkspace → dsh-git-worktree` 循环等待。
|
|
24
|
+
- 顶层 Client fiber 只等待官方 Workspace 的公开 prerequisites;`conversation` 与 `connection` 留在子 fiber,服务后续出现时再注册其余 Worktree UI。
|
|
25
|
+
- 增加无 Conversation 启动图回归和发布门禁,确保插件先提供 `uiWorkspace`,且官方 Workspace Slot declaration tree 仍只注册一次。
|
|
26
|
+
|
|
7
27
|
## [0.7.3] - 2026-09-03
|
|
8
28
|
|
|
9
29
|
`0.7.3` 将插件完整适配到 DeepSeek Harness `0.1.2-rc.1` 的 Host、Client、Remote Gateway 与 Workspace 模块边界,并重写中英文项目首页,让安装要求、Worktree 工作方式与安全限制更容易理解。
|
|
@@ -265,6 +285,8 @@
|
|
|
265
285
|
|
|
266
286
|
- 发布初版生产级 Worktree 管理、基础 apply/finish/discard 生命周期和安全清理。
|
|
267
287
|
|
|
288
|
+
[0.7.5]: https://github.com/wloops/dsh-git-worktree/compare/v0.7.4...v0.7.5
|
|
289
|
+
[0.7.4]: https://github.com/wloops/dsh-git-worktree/compare/v0.7.3...v0.7.4
|
|
268
290
|
[0.7.3]: https://github.com/wloops/dsh-git-worktree/compare/v0.7.2...v0.7.3
|
|
269
291
|
[0.7.2]: https://github.com/wloops/dsh-git-worktree/compare/v0.7.1...v0.7.2
|
|
270
292
|
[0.7.1]: https://github.com/wloops/dsh-git-worktree/compare/v0.7.0...v0.7.1
|
package/README.en.md
CHANGED
|
@@ -75,6 +75,12 @@ 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.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
|
+
|
|
80
|
+
```bash
|
|
81
|
+
dsh plugin --profile web add dsh-git-worktree@0.7.5
|
|
82
|
+
```
|
|
83
|
+
|
|
78
84
|
### Install
|
|
79
85
|
|
|
80
86
|
```bash
|
|
@@ -84,7 +90,7 @@ dsh plugin --profile web add dsh-git-worktree
|
|
|
84
90
|
Or install a specific version:
|
|
85
91
|
|
|
86
92
|
```bash
|
|
87
|
-
dsh plugin --profile web add github:wloops/dsh-git-worktree#v0.7.
|
|
93
|
+
dsh plugin --profile web add github:wloops/dsh-git-worktree#v0.7.5
|
|
88
94
|
```
|
|
89
95
|
|
|
90
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,6 +75,12 @@ 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.5` 或更高版本并重启 Harness。`0.7.2` 及更早版本依赖已停止发布的 `dsh-client-runtime`;`0.7.3` 在 rc.1 Web Client 中还可能形成 `conversation` / `uiWorkspace` 循环等待。
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
dsh plugin --profile web add dsh-git-worktree@0.7.5
|
|
82
|
+
```
|
|
83
|
+
|
|
78
84
|
### 安装
|
|
79
85
|
|
|
80
86
|
```bash
|
|
@@ -84,7 +90,7 @@ dsh plugin --profile web add dsh-git-worktree
|
|
|
84
90
|
也可以安装指定版本:
|
|
85
91
|
|
|
86
92
|
```bash
|
|
87
|
-
dsh plugin --profile web add github:wloops/dsh-git-worktree#v0.7.
|
|
93
|
+
dsh plugin --profile web add github:wloops/dsh-git-worktree#v0.7.5
|
|
88
94
|
```
|
|
89
95
|
|
|
90
96
|
安装后打开 Git Workspace,在新建 Session 时启用 **Worktree**;已有 Local Session 也可以让模型调用 `worktree_create` 创建隔离 Session。
|
package/cordis.patch.yml
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
#
|
|
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:
|
|
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
|
|
@@ -3,6 +3,11 @@ import type { ClientRemote } from '@deepseek-ai/dsh-api-gateway/client';
|
|
|
3
3
|
import type { WorktreeConsoleAdapter } from '../../console-contract.js';
|
|
4
4
|
import { type GitWorktreeRemote } from '../../console-remote/remote.js';
|
|
5
5
|
export { createWorktreeConsoleRemoteAdapter } from './adapter.js';
|
|
6
|
+
/**
|
|
7
|
+
* Activate on the same prerequisites as the official Workspace Client. The
|
|
8
|
+
* conversation-dependent Worktree surfaces run in a child fiber below so the
|
|
9
|
+
* Workspace service can break the uiConversation -> uiWorkspace boot edge.
|
|
10
|
+
*/
|
|
6
11
|
export declare const inject: string[];
|
|
7
12
|
interface ConsoleClientContext extends Context {
|
|
8
13
|
remote: ClientRemote & {
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import contribution from '../../console-remote/remote.js';
|
|
2
2
|
import { apply as applyToolViews, inject as toolViewInject } from '../index.js';
|
|
3
|
+
import { registerManagedWorkspaceSidebar } from '../workspace-sidebar/index.js';
|
|
4
|
+
import { inject as officialWorkspaceInject } from 'virtual:dsh-official-workspace-client';
|
|
3
5
|
import { createWorktreeConsoleRemoteAdapter } from './adapter.js';
|
|
4
6
|
export { createWorktreeConsoleRemoteAdapter } from './adapter.js';
|
|
5
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Activate on the same prerequisites as the official Workspace Client. The
|
|
9
|
+
* conversation-dependent Worktree surfaces run in a child fiber below so the
|
|
10
|
+
* Workspace service can break the uiConversation -> uiWorkspace boot edge.
|
|
11
|
+
*/
|
|
12
|
+
export const inject = [...officialWorkspaceInject];
|
|
6
13
|
/** Mount the package-owned strict Remote contribution in this Client fiber. */
|
|
7
14
|
export async function apply(ctx) {
|
|
8
15
|
const disposeRemote = await ctx.remote.$mount(contribution);
|
|
@@ -12,6 +19,13 @@ export async function apply(ctx) {
|
|
|
12
19
|
throw new Error('Worktree Console Remote namespace 挂载失败');
|
|
13
20
|
const adapter = createWorktreeConsoleRemoteAdapter(remote);
|
|
14
21
|
ctx.provide('worktreeConsole', adapter);
|
|
15
|
-
|
|
22
|
+
// Host lifecycle selects this replacement only while the plugin is active.
|
|
23
|
+
// Provide Workspace before uiConversation to avoid a Client boot cycle.
|
|
24
|
+
registerManagedWorkspaceSidebar(ctx, adapter);
|
|
25
|
+
// The remaining Worktree views consume conversation/connection. Keeping
|
|
26
|
+
// them in a child fiber prevents those services from blocking uiWorkspace.
|
|
27
|
+
ctx.inject(toolViewInject, child => {
|
|
28
|
+
applyToolViews(child, adapter);
|
|
29
|
+
});
|
|
16
30
|
}
|
|
17
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -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,kCAAkC,EAAE,MAAM,cAAc,CAAA;AAEjE,OAAO,EAAE,kCAAkC,EAAE,MAAM,cAAc,CAAA;AAEjE,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,GAAG,
|
|
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,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/client/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ interface ClientContextLike {
|
|
|
7
7
|
get(name: string): unknown;
|
|
8
8
|
effect(setup: () => void | (() => void), label?: string): void;
|
|
9
9
|
slots: {
|
|
10
|
-
inject(name: 'tool.call.toolview' | 'conversation.session.header.actions' | 'conversation.input.dock' | 'conversation.input.left'
|
|
10
|
+
inject(name: 'tool.call.toolview' | 'conversation.session.header.actions' | 'conversation.input.dock' | 'conversation.input.left', callback: () => unknown): void;
|
|
11
11
|
register(descriptor: Record<string, unknown>, component: ComponentType<any>): unknown;
|
|
12
12
|
};
|
|
13
13
|
}
|
package/lib/client/index.js
CHANGED
|
@@ -5,7 +5,6 @@ import { WORKTREE_STYLES } from './styles.js';
|
|
|
5
5
|
import { registerPreSessionWorktree } from './pre-session/index.js';
|
|
6
6
|
import { registerTargetConsole } from './target-console/index.js';
|
|
7
7
|
import { TARGET_CONSOLE_STYLES } from './target-console/target-console.styles.js';
|
|
8
|
-
import { registerManagedWorkspaceSidebar } from './workspace-sidebar/index.js';
|
|
9
8
|
export { registerTargetConsole } from './target-console/index.js';
|
|
10
9
|
export const WORKTREE_CONSOLE_ADAPTER_SERVICE = 'worktreeConsole';
|
|
11
10
|
/** Required client services. */
|
|
@@ -40,7 +39,6 @@ export function apply(ctx, adapterOverride) {
|
|
|
40
39
|
if (adapter !== undefined) {
|
|
41
40
|
registerTargetConsole({ slots: ctx.slots }, adapter, services);
|
|
42
41
|
registerPreSessionWorktree({ slots: ctx.slots }, adapter, services);
|
|
43
|
-
registerManagedWorkspaceSidebar(ctx, adapter);
|
|
44
42
|
}
|
|
45
43
|
}
|
|
46
44
|
//# sourceMappingURL=index.js.map
|
package/lib/client/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,0BAA0B,EAAkC,MAAM,wBAAwB,CAAA;AACnG,OAAO,EAAE,qBAAqB,EAAiC,MAAM,2BAA2B,CAAA;AAChG,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,0BAA0B,EAAkC,MAAM,wBAAwB,CAAA;AACnG,OAAO,EAAE,qBAAqB,EAAiC,MAAM,2BAA2B,CAAA;AAChG,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAA;AAEjF,OAAO,EAAE,qBAAqB,EAAE,MA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,MAAM,SAAS,GAAG,CAAC,KAA4B,EAAE,EAAE,CAAC,KAAC,iBAAiB,OAAK,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAI,CAAA;IAC1H,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,oBAAoB,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAC7D,EAAE,IAAI,EAAE,oBAAoB,EAAE,GAAG,EAAE,iBAAiB,EAAE,EACtD,SAAS,CACV,CAAC,CAAA;IACF,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,oBAAoB,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAC7D,EAAE,IAAI,EAAE,oBAAoB,EAAE,GAAG,EAAE,2BAA2B,EAAE,EAChE,SAAS,CACV,CAAC,CAAA;IAEF,yEAAyE;IACzE,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,qBAAqB,CACnB,EAAE,KAAK,EAAE,GAAG,CAAC,KAA0C,EAAE,EACzD,OAAO,EACP,QAAQ,CACT,CAAA;QACD,0BAA0B,CACxB,EAAE,KAAK,EAAE,GAAG,CAAC,KAA2C,EAAE,EAC1D,OAAO,EACP,QAAQ,CACT,CAAA;IACH,CAAC;AACH,CAAC"}
|
package/lib/client.js
CHANGED
|
@@ -9671,6 +9671,61 @@ const TARGET_CONSOLE_STYLES = String.raw`
|
|
|
9671
9671
|
}
|
|
9672
9672
|
`;
|
|
9673
9673
|
|
|
9674
|
+
//#endregion
|
|
9675
|
+
//#region src/client/index.tsx
|
|
9676
|
+
const WORKTREE_CONSOLE_ADAPTER_SERVICE = "worktreeConsole";
|
|
9677
|
+
/** Required client services. */
|
|
9678
|
+
const inject$1 = [
|
|
9679
|
+
"slots",
|
|
9680
|
+
"workspaces",
|
|
9681
|
+
"sessions",
|
|
9682
|
+
"conversation",
|
|
9683
|
+
"connection",
|
|
9684
|
+
"locale"
|
|
9685
|
+
];
|
|
9686
|
+
function servicesOf(ctx) {
|
|
9687
|
+
return {
|
|
9688
|
+
workspaces: ctx.get("workspaces"),
|
|
9689
|
+
sessions: ctx.get("sessions"),
|
|
9690
|
+
conversation: ctx.get("conversation")
|
|
9691
|
+
};
|
|
9692
|
+
}
|
|
9693
|
+
/** Register replay-stable keyed rows and one scoped stylesheet. */
|
|
9694
|
+
function apply$1(ctx, adapterOverride) {
|
|
9695
|
+
const services = servicesOf(ctx);
|
|
9696
|
+
const adapter = adapterOverride ?? ctx.get(WORKTREE_CONSOLE_ADAPTER_SERVICE);
|
|
9697
|
+
ctx.effect(() => {
|
|
9698
|
+
const style = document.createElement("style");
|
|
9699
|
+
style.dataset.dshGitWorktree = "true";
|
|
9700
|
+
style.textContent = `${WORKTREE_STYLES}\n${TARGET_CONSOLE_STYLES}`;
|
|
9701
|
+
document.head.append(style);
|
|
9702
|
+
return () => {
|
|
9703
|
+
style.remove();
|
|
9704
|
+
};
|
|
9705
|
+
}, "dsh-git-worktree: styles");
|
|
9706
|
+
const CreateRow = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WorktreeCreateRow, {
|
|
9707
|
+
...props,
|
|
9708
|
+
services
|
|
9709
|
+
});
|
|
9710
|
+
const ReviewRow = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WorktreeReviewRow, {
|
|
9711
|
+
...props,
|
|
9712
|
+
services,
|
|
9713
|
+
adapter
|
|
9714
|
+
});
|
|
9715
|
+
ctx.slots.inject("tool.call.toolview", () => ctx.slots.register({
|
|
9716
|
+
name: "tool.call.toolview",
|
|
9717
|
+
key: "worktree_create"
|
|
9718
|
+
}, CreateRow));
|
|
9719
|
+
ctx.slots.inject("tool.call.toolview", () => ctx.slots.register({
|
|
9720
|
+
name: "tool.call.toolview",
|
|
9721
|
+
key: "worktree_ready_for_review"
|
|
9722
|
+
}, ReviewRow));
|
|
9723
|
+
if (adapter !== void 0) {
|
|
9724
|
+
registerTargetConsole({ slots: ctx.slots }, adapter, services);
|
|
9725
|
+
registerPreSessionWorktree({ slots: ctx.slots }, adapter, services);
|
|
9726
|
+
}
|
|
9727
|
+
}
|
|
9728
|
+
|
|
9674
9729
|
//#endregion
|
|
9675
9730
|
//#region \0virtual:dsh-official-workspace-client
|
|
9676
9731
|
const modules = {
|
|
@@ -12667,62 +12722,6 @@ function registerManagedWorkspaceSidebar(ctx, adapter) {
|
|
|
12667
12722
|
apply$2(officialContextProxy(ctx, adapter));
|
|
12668
12723
|
}
|
|
12669
12724
|
|
|
12670
|
-
//#endregion
|
|
12671
|
-
//#region src/client/index.tsx
|
|
12672
|
-
const WORKTREE_CONSOLE_ADAPTER_SERVICE = "worktreeConsole";
|
|
12673
|
-
/** Required client services. */
|
|
12674
|
-
const inject$1 = [
|
|
12675
|
-
"slots",
|
|
12676
|
-
"workspaces",
|
|
12677
|
-
"sessions",
|
|
12678
|
-
"conversation",
|
|
12679
|
-
"connection",
|
|
12680
|
-
"locale"
|
|
12681
|
-
];
|
|
12682
|
-
function servicesOf(ctx) {
|
|
12683
|
-
return {
|
|
12684
|
-
workspaces: ctx.get("workspaces"),
|
|
12685
|
-
sessions: ctx.get("sessions"),
|
|
12686
|
-
conversation: ctx.get("conversation")
|
|
12687
|
-
};
|
|
12688
|
-
}
|
|
12689
|
-
/** Register replay-stable keyed rows and one scoped stylesheet. */
|
|
12690
|
-
function apply$1(ctx, adapterOverride) {
|
|
12691
|
-
const services = servicesOf(ctx);
|
|
12692
|
-
const adapter = adapterOverride ?? ctx.get(WORKTREE_CONSOLE_ADAPTER_SERVICE);
|
|
12693
|
-
ctx.effect(() => {
|
|
12694
|
-
const style = document.createElement("style");
|
|
12695
|
-
style.dataset.dshGitWorktree = "true";
|
|
12696
|
-
style.textContent = `${WORKTREE_STYLES}\n${TARGET_CONSOLE_STYLES}`;
|
|
12697
|
-
document.head.append(style);
|
|
12698
|
-
return () => {
|
|
12699
|
-
style.remove();
|
|
12700
|
-
};
|
|
12701
|
-
}, "dsh-git-worktree: styles");
|
|
12702
|
-
const CreateRow = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WorktreeCreateRow, {
|
|
12703
|
-
...props,
|
|
12704
|
-
services
|
|
12705
|
-
});
|
|
12706
|
-
const ReviewRow = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WorktreeReviewRow, {
|
|
12707
|
-
...props,
|
|
12708
|
-
services,
|
|
12709
|
-
adapter
|
|
12710
|
-
});
|
|
12711
|
-
ctx.slots.inject("tool.call.toolview", () => ctx.slots.register({
|
|
12712
|
-
name: "tool.call.toolview",
|
|
12713
|
-
key: "worktree_create"
|
|
12714
|
-
}, CreateRow));
|
|
12715
|
-
ctx.slots.inject("tool.call.toolview", () => ctx.slots.register({
|
|
12716
|
-
name: "tool.call.toolview",
|
|
12717
|
-
key: "worktree_ready_for_review"
|
|
12718
|
-
}, ReviewRow));
|
|
12719
|
-
if (adapter !== void 0) {
|
|
12720
|
-
registerTargetConsole({ slots: ctx.slots }, adapter, services);
|
|
12721
|
-
registerPreSessionWorktree({ slots: ctx.slots }, adapter, services);
|
|
12722
|
-
registerManagedWorkspaceSidebar(ctx, adapter);
|
|
12723
|
-
}
|
|
12724
|
-
}
|
|
12725
|
-
|
|
12726
12725
|
//#endregion
|
|
12727
12726
|
//#region src/client/console-remote/adapter.ts
|
|
12728
12727
|
function transport(message) {
|
|
@@ -12798,7 +12797,12 @@ function createWorktreeConsoleRemoteAdapter(remote) {
|
|
|
12798
12797
|
|
|
12799
12798
|
//#endregion
|
|
12800
12799
|
//#region src/client/console-remote/index.ts
|
|
12801
|
-
|
|
12800
|
+
/**
|
|
12801
|
+
* Activate on the same prerequisites as the official Workspace Client. The
|
|
12802
|
+
* conversation-dependent Worktree surfaces run in a child fiber below so the
|
|
12803
|
+
* Workspace service can break the uiConversation -> uiWorkspace boot edge.
|
|
12804
|
+
*/
|
|
12805
|
+
const inject = [...inject$2];
|
|
12802
12806
|
/** Mount the package-owned strict Remote contribution in this Client fiber. */
|
|
12803
12807
|
async function apply(ctx) {
|
|
12804
12808
|
const disposeRemote = await ctx.remote.$mount(remote_default);
|
|
@@ -12807,7 +12811,10 @@ async function apply(ctx) {
|
|
|
12807
12811
|
if (remote === void 0) throw new Error("Worktree Console Remote namespace 挂载失败");
|
|
12808
12812
|
const adapter = createWorktreeConsoleRemoteAdapter(remote);
|
|
12809
12813
|
ctx.provide("worktreeConsole", adapter);
|
|
12810
|
-
|
|
12814
|
+
registerManagedWorkspaceSidebar(ctx, adapter);
|
|
12815
|
+
ctx.inject(inject$1, (child) => {
|
|
12816
|
+
apply$1(child, adapter);
|
|
12817
|
+
});
|
|
12811
12818
|
}
|
|
12812
12819
|
|
|
12813
12820
|
//#endregion
|
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:
|
|
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 =
|
|
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,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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,IAAI,QAAQ,CAAC,QAAQ,KAAK,4BAA4B,CAAA;IACnF,CAAC,CAAC,CAAA;IACF,IAAI,QAAQ,GAAG,KAAK,CAAA;IACpB,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,EAA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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.
|
|
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
|
-
|
|
76
|
-
|
|
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
|
|
|
@@ -211,8 +214,10 @@ if (!clientExports || typeof clientExports.apply !== 'function' || !Array.isArra
|
|
|
211
214
|
fail('client bundle factory did not return apply + inject')
|
|
212
215
|
}
|
|
213
216
|
if (!clientExports.inject.includes('remote')) fail('client bundle must inject the official Remote service before $mount')
|
|
214
|
-
if (!clientExports.inject.includes('
|
|
215
|
-
|
|
217
|
+
if (!clientExports.inject.includes('remote.directoryPicker')) fail('client bundle must wait for the official directory-picker Remote before restoring uiWorkspace')
|
|
218
|
+
if (clientExports.inject.includes('conversation')) fail('client bundle root must not wait for conversation: uiConversation depends on the uiWorkspace restored by this plugin')
|
|
219
|
+
if (clientExports.inject.includes('connection')) fail('client bundle root must keep connection-dependent Worktree views in the deferred child fiber')
|
|
220
|
+
ok(`${clientRel} registers ${manifest.name} through the browser ModuleLoader contract without a uiWorkspace/uiConversation boot cycle`)
|
|
216
221
|
|
|
217
222
|
// 7. Release CI and npm's prepublish lifecycle require committed source identity;
|
|
218
223
|
// local review builds intentionally run against a dirty managed Worktree.
|