dsh-git-worktree 0.10.0 → 0.11.0

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.
Files changed (50) hide show
  1. package/CHANGELOG.md +41 -1
  2. package/README.en.md +7 -4
  3. package/README.md +7 -4
  4. package/lib/adapters/registry.js +4 -32
  5. package/lib/adapters/registry.js.map +1 -1
  6. package/lib/client/actions.d.ts +2 -0
  7. package/lib/client/pre-session/controller.js +5 -0
  8. package/lib/client/pre-session/controller.js.map +1 -1
  9. package/lib/client/review-console/PreflightStatus.js +5 -2
  10. package/lib/client/review-console/PreflightStatus.js.map +1 -1
  11. package/lib/client/review-console/ReviewActions.js +47 -46
  12. package/lib/client/review-console/ReviewActions.js.map +1 -1
  13. package/lib/client/review-console/ReviewDetailsModal.js +13 -3
  14. package/lib/client/review-console/ReviewDetailsModal.js.map +1 -1
  15. package/lib/client/review-console/review-console.styles.js +22 -11
  16. package/lib/client/review-console/review-console.styles.js.map +1 -1
  17. package/lib/client/target-console/WorktreeReviewStatus.js +7 -7
  18. package/lib/client/target-console/WorktreeReviewStatus.js.map +1 -1
  19. package/lib/client/workspace-sidebar/index.js +6 -3
  20. package/lib/client/workspace-sidebar/index.js.map +1 -1
  21. package/lib/client.js +1461 -467
  22. package/lib/commit-message.d.ts +2 -0
  23. package/lib/commit-message.js +5 -0
  24. package/lib/commit-message.js.map +1 -0
  25. package/lib/console-host/control-plane.js +6 -5
  26. package/lib/console-host/control-plane.js.map +1 -1
  27. package/lib/console-remote/schemas.d.ts +1 -1
  28. package/lib/console-remote/schemas.js +2 -1
  29. package/lib/console-remote/schemas.js.map +1 -1
  30. package/lib/host-compat.js +2 -1
  31. package/lib/host-compat.js.map +1 -1
  32. package/lib/i18n/client-messages.d.ts +8 -4
  33. package/lib/i18n/client-messages.js +2 -4
  34. package/lib/i18n/client-messages.js.map +1 -1
  35. package/lib/i18n/host-messages.d.ts +3 -7
  36. package/lib/i18n/host-messages.js +3 -7
  37. package/lib/i18n/host-messages.js.map +1 -1
  38. package/lib/index.d.ts +9 -9
  39. package/lib/ports.d.ts +1 -1
  40. package/lib/session-checkout-apply.js +6 -5
  41. package/lib/session-checkout-apply.js.map +1 -1
  42. package/lib/session-checkout-module.js +10 -7
  43. package/lib/session-checkout-module.js.map +1 -1
  44. package/lib/workspace-provider-lifecycle.js +31 -6
  45. package/lib/workspace-provider-lifecycle.js.map +1 -1
  46. package/package.json +43 -41
  47. package/scripts/check-publish.mjs +2 -0
  48. package/scripts/workspace-sidebar-upstream-alpha.mjs +16 -14
  49. package/scripts/workspace-sidebar-upstream-next.mjs +12 -16
  50. package/scripts/workspace-sidebar-upstream.mjs +18 -4
@@ -48,7 +48,12 @@ export function mountWorkspaceProviderLifecycle(ctx, flavor = hostWorkspaceClien
48
48
  const label = kind === 'disable' ? 'official Workspace disable' : 'official Workspace restore';
49
49
  let operation;
50
50
  try {
51
- operation = kind === 'disable' ? entry.update({}, false, true) : entry.refresh();
51
+ const fiber = entry.fiber;
52
+ operation = kind === 'disable'
53
+ ? entry.update({}, false, true).then(() => fiber?.await())
54
+ // Loader 1.0.6 retains disposed fibers; refresh() treats any reference
55
+ // as running, whereas init() replaces the dead generation.
56
+ : fiber?.uid === null ? entry.init() : entry.refresh();
52
57
  }
53
58
  catch (error) {
54
59
  ctx.logger.warn(`dsh-git-worktree: ${label} threw during Loader reconciliation`, error);
@@ -97,20 +102,40 @@ export function mountWorkspaceProviderLifecycle(ctx, flavor = hostWorkspaceClien
97
102
  });
98
103
  return pending;
99
104
  };
105
+ const releaseMarker = ctx.provide('worktreeWorkspaceProvider', true);
100
106
  ctx.effect(() => async () => {
101
107
  released = true;
108
+ // Cordis 4.0.5 unloads effects concurrently, not in LIFO order. Explicitly
109
+ // withdraw the marker before evaluating the official disabled expression.
110
+ await releaseMarker();
111
+ // Loader retains failed/disposed fibers and the Web registry only checks
112
+ // the entry reference, not fiber state. Withdraw this generation alone and
113
+ // publish the same owning-fiber event the registry consumes on disposal.
114
+ // A later activation must never be cleared by this generation's cleanup.
115
+ const withdraw = () => {
116
+ const replacement = ctx.fiber.entry;
117
+ if (replacement?.fiber !== ctx.fiber)
118
+ return;
119
+ replacement.fiber = undefined;
120
+ ctx.emit('internal/plugin', ctx.fiber);
121
+ };
122
+ if (ctx.fiber.uid === null)
123
+ withdraw();
124
+ // A restart also unloads effects, but reuses its live fiber. Only withdraw
125
+ // that reference if activation actually failed, after unload settles.
126
+ // Do not await our own cleanup from inside this disposer.
127
+ else
128
+ void ctx.fiber.await().catch(withdraw);
102
129
  // Root/Include teardown owns these entries; do not resurrect that tree.
103
130
  if (ctx.root.fiber.uid === null || ctx.root.fiber.state === UNLOADING)
104
131
  return;
105
132
  await pending.catch(() => { });
106
133
  for (const entry of owned()) {
107
- if (entry.parent.ctx.fiber.uid !== null && entry.parent.ctx.fiber.state !== UNLOADING && !entry.disabled)
108
- await entry.refresh();
134
+ if (entry.parent.ctx.fiber.uid !== null && entry.parent.ctx.fiber.state !== UNLOADING && !entry.disabled
135
+ && !inFlight.has(entry.id))
136
+ await operate(entry, 'restore');
109
137
  }
110
138
  });
111
- // Registered after the fallback so LIFO teardown releases the selection
112
- // before restoring Workspace, including when the replacement apply fails.
113
- ctx.provide('worktreeWorkspaceProvider', true);
114
139
  // Includes may add the official row after the replacement has activated.
115
140
  ctx.on('internal/status', fiber => {
116
141
  if (fiber === ctx.fiber && !released) {
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-provider-lifecycle.js","sourceRoot":"","sources":["../src/workspace-provider-lifecycle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAA8B,MAAM,kBAAkB,CAAA;AAExF,MAAM,CAAC,MAAM,4BAA4B,GAAG,0IAA0I,CAAA;AAOtL,MAAM,kBAAkB,GAAG,sCAAsC,CAAA;AACjE,+EAA+E;AAC/E,MAAM,SAAS,GAAe,CAAC,CAAA;AAC/B,2EAA2E;AAC3E,wEAAwE;AACxE,4EAA4E;AAC5E,iE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AI,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,QAAQ;mBACnG,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;gBAAE,MAAM,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;QAC/D,CAAC;IACH,CAAC,CAAC,CAAA;IACF,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,4EAA4E;IAC5E,6EAA6E;IAC7E,KAAK,SAAS,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;AACzD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-git-worktree",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
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",
@@ -50,7 +50,8 @@
50
50
  "@deepseek-ai/dsh-client-locale",
51
51
  "@deepseek-ai/dsh-client-ui-conversation",
52
52
  "@deepseek-ai/dsh-client-ui-tool",
53
- "@deepseek-ai/dsh-api-gateway"
53
+ "@deepseek-ai/dsh-api-gateway",
54
+ "@deepseek-ai/dsh-api-remote-access"
54
55
  ],
55
56
  "platform": "web"
56
57
  }
@@ -81,54 +82,55 @@
81
82
  "prepublishOnly": "pnpm run check:sidebar-version && pnpm run build && pnpm run check:publish:release && pnpm run test"
82
83
  },
83
84
  "dependencies": {
84
- "@deepseek-ai/schemastery": "3.18.2",
85
+ "@deepseek-ai/schemastery": "3.18.5",
85
86
  "lucide-react": "1.43.0",
86
87
  "zod": "4.4.3"
87
88
  },
88
89
  "peerDependencies": {
89
- "@deepseek-ai/cordis": "^4.0.4",
90
- "@deepseek-ai/cordis-plugin-loader": "^1.0.3",
91
- "@deepseek-ai/dsh-agent": "0.2.0-rc.2",
92
- "@deepseek-ai/dsh-client-locale": "0.2.0-rc.2",
93
- "@deepseek-ai/dsh-commands": "0.2.0-rc.2",
94
- "@deepseek-ai/dsh-fs": "0.2.0-rc.2",
95
- "@deepseek-ai/dsh-session": "0.2.0-rc.2",
96
- "@deepseek-ai/dsh-skill": "0.2.0-rc.2",
97
- "@deepseek-ai/dsh-skill-filesystem": "0.2.0-rc.2",
98
- "@deepseek-ai/dsh-subprocess": "0.2.0-rc.2",
99
- "@deepseek-ai/dsh-system-prompt": "0.2.0-rc.2",
100
- "@deepseek-ai/dsh-tools": "0.2.0-rc.2",
101
- "@deepseek-ai/dsh-typert-protocol": "0.2.0-rc.2",
102
- "@deepseek-ai/dsh-typert-registry": "0.2.0-rc.2",
90
+ "@deepseek-ai/cordis": "~4.0.5",
91
+ "@deepseek-ai/cordis-plugin-loader": "~1.0.6",
92
+ "@deepseek-ai/dsh-agent": "0.2.1-rc.2",
93
+ "@deepseek-ai/dsh-client-locale": "0.2.1-rc.2",
94
+ "@deepseek-ai/dsh-commands": "0.2.1-rc.2",
95
+ "@deepseek-ai/dsh-fs": "0.2.1-rc.2",
96
+ "@deepseek-ai/dsh-session": "0.2.1-rc.2",
97
+ "@deepseek-ai/dsh-skill": "0.2.1-rc.2",
98
+ "@deepseek-ai/dsh-skill-filesystem": "0.2.1-rc.2",
99
+ "@deepseek-ai/dsh-subprocess": "0.2.1-rc.2",
100
+ "@deepseek-ai/dsh-system-prompt": "0.2.1-rc.2",
101
+ "@deepseek-ai/dsh-tools": "0.2.1-rc.2",
102
+ "@deepseek-ai/dsh-typert-protocol": "0.2.1-rc.2",
103
+ "@deepseek-ai/dsh-typert-registry": "0.2.1-rc.2",
103
104
  "react": "^18.2.0"
104
105
  },
105
106
  "devDependencies": {
106
- "@deepseek-ai/cordis": "4.0.4",
107
- "@deepseek-ai/cordis-plugin-include": "1.0.7",
108
- "@deepseek-ai/cordis-plugin-loader": "1.0.3",
109
- "@deepseek-ai/dsh-agent": "0.2.0-rc.2",
110
- "@deepseek-ai/dsh-api-gateway": "0.2.0-rc.2",
111
- "@deepseek-ai/dsh-api-session-controller": "0.2.0-rc.2",
112
- "@deepseek-ai/dsh-api-workspace-controller": "0.2.0-rc.2",
113
- "@deepseek-ai/dsh-client-connection": "0.2.0-rc.2",
114
- "@deepseek-ai/dsh-client-locale": "0.2.0-rc.2",
115
- "@deepseek-ai/dsh-client-modules": "0.2.0-rc.2",
116
- "@deepseek-ai/dsh-client-store": "0.2.0-rc.2",
117
- "@deepseek-ai/dsh-client-ui-primitives": "0.2.0-rc.2",
118
- "@deepseek-ai/dsh-client-ui-workspace": "0.2.0-rc.2",
107
+ "@deepseek-ai/cordis": "4.0.5",
108
+ "@deepseek-ai/cordis-plugin-include": "1.0.10",
109
+ "@deepseek-ai/cordis-plugin-loader": "1.0.6",
110
+ "@deepseek-ai/dsh-agent": "0.2.1-rc.2",
111
+ "@deepseek-ai/dsh-api-gateway": "0.2.1-rc.2",
112
+ "@deepseek-ai/dsh-api-remote-access": "0.2.1-rc.2",
113
+ "@deepseek-ai/dsh-api-session-controller": "0.2.1-rc.2",
114
+ "@deepseek-ai/dsh-api-workspace-controller": "0.2.1-rc.2",
115
+ "@deepseek-ai/dsh-client-connection": "0.2.1-rc.2",
116
+ "@deepseek-ai/dsh-client-locale": "0.2.1-rc.2",
117
+ "@deepseek-ai/dsh-client-modules": "0.2.1-rc.2",
118
+ "@deepseek-ai/dsh-client-store": "0.2.1-rc.2",
119
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.2",
120
+ "@deepseek-ai/dsh-client-ui-workspace": "0.2.1-rc.2",
119
121
  "@deepseek-ai/dsh-client-ui-workspace-alpha": "npm:@deepseek-ai/dsh-client-ui-workspace@0.1.6-alpha.2",
120
122
  "@deepseek-ai/dsh-client-ui-workspace-next": "npm:@deepseek-ai/dsh-client-ui-workspace@0.1.7-rc.2",
121
- "@deepseek-ai/dsh-commands": "0.2.0-rc.2",
122
- "@deepseek-ai/dsh-fs": "0.2.0-rc.2",
123
- "@deepseek-ai/dsh-session": "0.2.0-rc.2",
124
- "@deepseek-ai/dsh-skill": "0.2.0-rc.2",
125
- "@deepseek-ai/dsh-skill-filesystem": "0.2.0-rc.2",
126
- "@deepseek-ai/dsh-subprocess": "0.2.0-rc.2",
127
- "@deepseek-ai/dsh-system-prompt": "0.2.0-rc.2",
128
- "@deepseek-ai/dsh-tools": "0.2.0-rc.2",
129
- "@deepseek-ai/dsh-typert-loader": "0.2.0-rc.2",
130
- "@deepseek-ai/dsh-typert-protocol": "0.2.0-rc.2",
131
- "@deepseek-ai/dsh-typert-registry": "0.2.0-rc.2",
123
+ "@deepseek-ai/dsh-commands": "0.2.1-rc.2",
124
+ "@deepseek-ai/dsh-fs": "0.2.1-rc.2",
125
+ "@deepseek-ai/dsh-session": "0.2.1-rc.2",
126
+ "@deepseek-ai/dsh-skill": "0.2.1-rc.2",
127
+ "@deepseek-ai/dsh-skill-filesystem": "0.2.1-rc.2",
128
+ "@deepseek-ai/dsh-subprocess": "0.2.1-rc.2",
129
+ "@deepseek-ai/dsh-system-prompt": "0.2.1-rc.2",
130
+ "@deepseek-ai/dsh-tools": "0.2.1-rc.2",
131
+ "@deepseek-ai/dsh-typert-loader": "0.2.1-rc.2",
132
+ "@deepseek-ai/dsh-typert-protocol": "0.2.1-rc.2",
133
+ "@deepseek-ai/dsh-typert-registry": "0.2.1-rc.2",
132
134
  "@testing-library/react": "^16.3.2",
133
135
  "@types/node": "^22.0.0",
134
136
  "@types/react": "~18.3.31",
@@ -161,6 +161,7 @@ if (!client || client.platform !== 'web' || !Array.isArray(client.inject) || cli
161
161
  fail('package.json must declare dsh.client { platform: "web", inject: [...] }')
162
162
  }
163
163
  const requiredClientPackages = [
164
+ '@deepseek-ai/dsh-api-remote-access',
164
165
  '@deepseek-ai/dsh-api-session-controller',
165
166
  '@deepseek-ai/dsh-api-workspace-controller',
166
167
  '@deepseek-ai/dsh-client-ui-conversation',
@@ -216,6 +217,7 @@ try {
216
217
  if (!clientExports || typeof clientExports.apply !== 'function' || !Array.isArray(clientExports.inject)) {
217
218
  fail('client bundle factory did not return apply + inject')
218
219
  }
220
+ if (!clientExports.inject.includes('remoteAccess')) fail('client bundle must inject the official remoteAccess service')
219
221
  if (!clientExports.inject.includes('remote')) fail('client bundle must inject the official Remote service before $mount')
220
222
  if (clientExports.inject.includes('remote.directoryPicker')) fail('client bundle entry must not wait for the directory-picker Remote: its provider entry waits for uiWorkspace, so requiring it here deadlocks the 0.2.x web boot')
221
223
  if (!clientSource.includes("'remote.directoryPicker'") && !clientSource.includes('"remote.directoryPicker"')) fail('client bundle must resolve the directory-picker lazily at call time through the managed context (deferred facade)')
@@ -43,26 +43,23 @@ export function decorateAlphaWorkspaceClient(source) {
43
43
  '\t\t\t\t\tlabel: g.label,\n\t\t\t\t\t...g.__dshGitWorktreeProtected === true ? { __dshGitWorktreeProtected: true } : {},\n\t\t\t\t\tsessionCount: g.sessions.length,',
44
44
  'protected workspace row',
45
45
  )
46
+ // Cordis Service derives its own Context; capture the instance-local guard
47
+ // from the constructor argument rather than looking it up on this.ctx later.
46
48
  replace(
47
- '\t\t\tasync forkSession(sessionId) {\n\t\t\t\tconst navigation = AbortSignal.any([this.ctx.layout.beginNavigation(), this.lifetime.signal]);',
48
- '\t\t\tasync forkSession(sessionId) {\n\t\t\t\tif (this.ctx.get("__dshGitWorktreeManagedGuard").blockSession(sessionId)) throw new Error("managed Session must be changed through its Worktree owner");\n\t\t\t\tconst navigation = AbortSignal.any([this.ctx.layout.beginNavigation(), this.lifetime.signal]);',
49
- 'managed Session fork',
49
+ '\t\t\t\tsuper(ctx, "uiWorkspace");\n\t\t\t\tthis.directoryPicker = directoryPicker;',
50
+ '\t\t\t\tsuper(ctx, "uiWorkspace");\n\t\t\t\tthis.managedWorktreeGuard = ctx.get("__dshGitWorktreeManagedGuard");\n\t\t\t\tthis.directoryPicker = directoryPicker;',
51
+ 'instance-local managed guard',
50
52
  )
51
53
  replace(
52
- '\t\t\tasync archiveSession(sessionId) {\n\t\t\t\tawait this.workspaces.archiveSession(sessionId);',
53
- '\t\t\tasync archiveSession(sessionId) {\n\t\t\t\tif (this.ctx.get("__dshGitWorktreeManagedGuard").blockSession(sessionId)) throw new Error("managed Session must be changed through its Worktree owner");\n\t\t\t\tawait this.workspaces.archiveSession(sessionId);',
54
- 'managed Session archive',
54
+ '\t\t\tasync forkSession(sessionId) {\n\t\t\t\tconst navigation = AbortSignal.any([this.ctx.layout.beginNavigation(), this.lifetime.signal]);',
55
+ '\t\t\tasync forkSession(sessionId) {\n\t\t\t\tif (this.managedWorktreeGuard.blockSession(sessionId)) throw new Error("managed Session must be changed through its Worktree owner");\n\t\t\t\tconst navigation = AbortSignal.any([this.ctx.layout.beginNavigation(), this.lifetime.signal]);',
56
+ 'managed Session fork',
55
57
  )
56
58
  replace(
57
59
  '\t\t\t\tconst target = workspaceId ?? currentWorkspaceId ?? recent;\n\t\t\t\tif (target === void 0) {',
58
- '\t\t\t\tconst target = workspaceId ?? currentWorkspaceId ?? recent;\n\t\t\t\tif (target !== void 0 && this.ctx.get("__dshGitWorktreeManagedGuard").blockWorkspace(target)) return;\n\t\t\t\tif (target === void 0) {',
60
+ '\t\t\t\tconst target = workspaceId ?? currentWorkspaceId ?? recent;\n\t\t\t\tif (target !== void 0 && this.managedWorktreeGuard.blockWorkspace(target)) return;\n\t\t\t\tif (target === void 0) {',
59
61
  'managed Workspace new Session shortcut',
60
62
  )
61
- replace(
62
- '\t\t\t\trenameSession: async (sessionId, title) => {\n\t\t\t\t\tconst result = await sessions.using(',
63
- '\t\t\t\trenameSession: async (sessionId, title) => {\n\t\t\t\t\tif (ctx.get("__dshGitWorktreeManagedGuard").blockSession(sessionId)) throw new Error("managed Session must be changed through its Worktree owner");\n\t\t\t\t\tconst result = await sessions.using(',
64
- 'managed Session rename',
65
- )
66
63
  replace(
67
64
  '\t\t\t\tupdatedAt: s.updatedAt,\n\t\t\t\t...pendingInteraction === void 0 ? {} : { pendingInteraction }',
68
65
  '\t\t\t\tupdatedAt: s.updatedAt,\n\t\t\t\t__dshGitWorktree: s.__dshGitWorktree,\n\t\t\t\t...pendingInteraction === void 0 ? {} : { pendingInteraction }',
@@ -83,7 +80,12 @@ export function decorateAlphaWorkspaceClient(source) {
83
80
  'managed Session row guard',
84
81
  )
85
82
  replace('\t\t\tconst draggable = drag !== void 0 && !row.blank;', '\t\t\tconst draggable = drag !== void 0 && !row.blank && !protectedManagedSession;', 'managed Session drag')
86
- replace('\t\t\t\t\t\t!row.blank && (0, react_jsx_runtime.jsx)("span", {\n\t\t\t\t\t\t\tclassName: Rows_module_css_default.rowActions,', '\t\t\t\t\t\t!row.blank && !protectedManagedSession && (0, react_jsx_runtime.jsx)("span", {\n\t\t\t\t\t\t\tclassName: Rows_module_css_default.rowActions,', 'managed Session actions')
83
+ replace(
84
+ '\t\t\t];\n\t\t\treturn (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.HoverCard, {',
85
+ '\t\t\t];\n\t\t\tconst visibleSessionMenuItems = protectedManagedSession ? sessionMenuItems.filter((item) => item.id !== "fork") : sessionMenuItems;\n\t\t\treturn (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.HoverCard, {',
86
+ 'managed Session safe menu items',
87
+ )
88
+ replace('\t\t\t\t\t\t\t\titems: sessionMenuItems,', '\t\t\t\t\t\t\t\titems: visibleSessionMenuItems,', 'managed Session menu')
87
89
  replace(
88
90
  '\t\t\t\t\t\t(0, react_jsx_runtime.jsx)("span", {\n\t\t\t\t\t\t\tref: titleRef,\n\t\t\t\t\t\t\tclassName: Rows_module_css_default.title,',
89
91
  '\t\t\t\t\t\tprotectedManagedSession && (0, react_jsx_runtime.jsx)("span", { title: node.__dshGitWorktree.label, "aria-label": node.__dshGitWorktree.label, style: { flexShrink: 0, display: "inline-flex" }, children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconBranchOutline16, {}) }),\n\t\t\t\t\t\t(0, react_jsx_runtime.jsx)("span", {\n\t\t\t\t\t\t\tref: titleRef,\n\t\t\t\t\t\t\tclassName: Rows_module_css_default.title,',
@@ -91,7 +93,7 @@ export function decorateAlphaWorkspaceClient(source) {
91
93
  )
92
94
  replace(
93
95
  '\t\t\t\t\t\t\tchildren: title\n\t\t\t\t\t\t}),\n\t\t\t\t\t\trow.hasActiveSchedule && (0, react_jsx_runtime.jsx)(ActiveScheduleIndicator, { t }),',
94
- '\t\t\t\t\t\t\tchildren: title\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tprotectedManagedSession && (0, react_jsx_runtime.jsx)("span", { className: "dsh-git-worktree-sidebar-badge", "data-worktree-state": node.__dshGitWorktree.state, children: node.__dshGitWorktree.label }),\n\t\t\t\t\t\trow.hasActiveSchedule && (0, react_jsx_runtime.jsx)(ActiveScheduleIndicator, { t }),',
96
+ '\t\t\t\t\t\t\tchildren: title\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tprotectedManagedSession && node.__dshGitWorktree.state !== "working" && (0, react_jsx_runtime.jsx)("span", { className: "dsh-git-worktree-sidebar-badge", "data-worktree-state": node.__dshGitWorktree.state, children: node.__dshGitWorktree.label }),\n\t\t\t\t\t\trow.hasActiveSchedule && (0, react_jsx_runtime.jsx)(ActiveScheduleIndicator, { t }),',
95
97
  'managed Session status badge',
96
98
  )
97
99
  return derived
@@ -42,26 +42,23 @@ export function decorateNextWorkspaceClient(source) {
42
42
  '\t\t\t\t\tlabel: g.label,\n\t\t\t\t\t...g.__dshGitWorktreeProtected === true ? { __dshGitWorktreeProtected: true } : {},\n\t\t\t\t\tsessionCount: g.sessions.length,',
43
43
  'protected workspace row',
44
44
  )
45
+ // Cordis Service derives its own Context; capture the instance-local guard
46
+ // from the constructor argument rather than looking it up on this.ctx later.
45
47
  replace(
46
- '\t\t\tasync forkSession(sessionId) {\n\t\t\t\tawait this.sessions.fork({',
47
- '\t\t\tasync forkSession(sessionId) {\n\t\t\t\tif (this.ctx.get("__dshGitWorktreeManagedGuard").blockSession(sessionId)) throw new Error("managed Session must be changed through its Worktree owner");\n\t\t\t\tawait this.sessions.fork({',
48
- 'managed Session fork from official menu and shortcuts',
48
+ '\t\t\t\tsuper(ctx, "uiWorkspace");\n\t\t\t\tthis.directoryPicker = directoryPicker;',
49
+ '\t\t\t\tsuper(ctx, "uiWorkspace");\n\t\t\t\tthis.managedWorktreeGuard = ctx.get("__dshGitWorktreeManagedGuard");\n\t\t\t\tthis.directoryPicker = directoryPicker;',
50
+ 'instance-local managed guard',
49
51
  )
50
52
  replace(
51
- '\t\t\tasync archiveSession(sessionId, options = {}) {\n\t\t\t\tawait this.workspaces.archiveSession(sessionId, options);',
52
- '\t\t\tasync archiveSession(sessionId, options = {}) {\n\t\t\t\tif (this.ctx.get("__dshGitWorktreeManagedGuard").blockSession(sessionId)) throw new Error("managed Session must be changed through its Worktree owner");\n\t\t\t\tawait this.workspaces.archiveSession(sessionId, options);',
53
- 'managed Session archive from official menu and shortcuts',
53
+ '\t\t\tasync forkSession(sessionId) {\n\t\t\t\tawait this.sessions.fork({',
54
+ '\t\t\tasync forkSession(sessionId) {\n\t\t\t\tif (this.managedWorktreeGuard.blockSession(sessionId)) throw new Error("managed Session must be changed through its Worktree owner");\n\t\t\t\tawait this.sessions.fork({',
55
+ 'managed Session fork from official menu and shortcuts',
54
56
  )
55
57
  replace(
56
58
  '\t\t\t\tconst target = workspaceId ?? currentWorkspaceId ?? recent;\n\t\t\t\tif (target === void 0) {',
57
- '\t\t\t\tconst target = workspaceId ?? currentWorkspaceId ?? recent;\n\t\t\t\tif (target !== void 0 && this.ctx.get("__dshGitWorktreeManagedGuard").blockWorkspace(target)) return;\n\t\t\t\tif (target === void 0) {',
59
+ '\t\t\t\tconst target = workspaceId ?? currentWorkspaceId ?? recent;\n\t\t\t\tif (target !== void 0 && this.managedWorktreeGuard.blockWorkspace(target)) return;\n\t\t\t\tif (target === void 0) {',
58
60
  'managed Workspace new Session shortcut',
59
61
  )
60
- replace(
61
- '\t\t\tconst renameSession = async (sessionId, title) => {\n\t\t\t\tconst result = await sessions.using(',
62
- '\t\t\tconst renameSession = async (sessionId, title) => {\n\t\t\t\tif (ctx.get("__dshGitWorktreeManagedGuard").blockSession(sessionId)) throw new Error("managed Session must be changed through its Worktree owner");\n\t\t\t\tconst result = await sessions.using(',
63
- 'managed Session rename dialog',
64
- )
65
62
  replace(
66
63
  '\t\t\t\tupdatedAt: s.updatedAt,\n\t\t\t\t...pendingInteraction === void 0 ? {} : { pendingInteraction }',
67
64
  '\t\t\t\tupdatedAt: s.updatedAt,\n\t\t\t\t__dshGitWorktree: s.__dshGitWorktree,\n\t\t\t\t...pendingInteraction === void 0 ? {} : { pendingInteraction }',
@@ -82,9 +79,8 @@ export function decorateNextWorkspaceClient(source) {
82
79
  'managed Session row guard',
83
80
  )
84
81
  replace('\t\t\tconst draggable = drag !== void 0 && !row.blank && !row.archived;', '\t\t\tconst draggable = drag !== void 0 && !row.blank && !row.archived && !protectedManagedSession;', 'managed Session drag')
85
- replace('\t\t\t\t\t\t\tonDoubleClick: row.blank ? void 0 : (e) => {', '\t\t\t\t\t\t\tonDoubleClick: row.blank || protectedManagedSession ? void 0 : (e) => {', 'managed Session rename')
86
- // Keep the official hover container: the guarded Slot seats render only pin
87
- // for managed Sessions, while ordinary Sessions retain every official action.
82
+ // Keep the official hover container. The Slot proxy preserves pin, rename
83
+ // and archive on managed owners while filtering ownership-changing actions.
88
84
  replace(
89
85
  '\t\t\t\t\t\t(0, react_jsx_runtime.jsx)("span", {\n\t\t\t\t\t\t\tref: titleRef,\n\t\t\t\t\t\t\tclassName: Rows_module_css_default.title,',
90
86
  '\t\t\t\t\t\tprotectedManagedSession && (0, react_jsx_runtime.jsx)("span", { title: node.__dshGitWorktree.label, "aria-label": node.__dshGitWorktree.label, style: { flexShrink: 0, display: "inline-flex" }, children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconBranchOutlineRegular, { size: 16 }) }),\n\t\t\t\t\t\t(0, react_jsx_runtime.jsx)("span", {\n\t\t\t\t\t\t\tref: titleRef,\n\t\t\t\t\t\t\tclassName: Rows_module_css_default.title,',
@@ -92,7 +88,7 @@ export function decorateNextWorkspaceClient(source) {
92
88
  )
93
89
  replace(
94
90
  '\t\t\t\t\t\t\tchildren: title\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t!row.blank && (0, react_jsx_runtime.jsx)("span", {\n\t\t\t\t\t\t\tclassName: Rows_module_css_default.time,',
95
- '\t\t\t\t\t\t\tchildren: title\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tprotectedManagedSession && (0, react_jsx_runtime.jsx)("span", { className: "dsh-git-worktree-sidebar-badge", "data-worktree-state": node.__dshGitWorktree.state, children: node.__dshGitWorktree.label }),\n\t\t\t\t\t\t!row.blank && (0, react_jsx_runtime.jsx)("span", {\n\t\t\t\t\t\t\tclassName: Rows_module_css_default.time,',
91
+ '\t\t\t\t\t\t\tchildren: title\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tprotectedManagedSession && node.__dshGitWorktree.state !== "working" && (0, react_jsx_runtime.jsx)("span", { className: "dsh-git-worktree-sidebar-badge", "data-worktree-state": node.__dshGitWorktree.state, children: node.__dshGitWorktree.label }),\n\t\t\t\t\t\t!row.blank && (0, react_jsx_runtime.jsx)("span", {\n\t\t\t\t\t\t\tclassName: Rows_module_css_default.time,',
96
92
  'managed Session status badge',
97
93
  )
98
94
  return derived
@@ -2,9 +2,9 @@ import { createHash } from 'node:crypto'
2
2
  import { readFileSync } from 'node:fs'
3
3
  import { createRequire } from 'node:module'
4
4
 
5
- export const WORKSPACE_UI_VERSION = '0.2.0-rc.2'
6
- export const WORKSPACE_LOCALE_VERSION = '0.2.0-rc.2'
7
- export const WORKSPACE_CLIENT_SHA256 = 'e784543780fb8ac7c38c853afd26b9b1713c6907eec2b07eff37461e07bd3be9'
5
+ export const WORKSPACE_UI_VERSION = '0.2.1-rc.2'
6
+ export const WORKSPACE_LOCALE_VERSION = '0.2.1-rc.2'
7
+ export const WORKSPACE_CLIENT_SHA256 = '52765aacb6c7f96327da5d8709d8cbb30dd2957d4744a42da04c18e07fe264e5'
8
8
  export const OFFICIAL_WORKSPACE_VIRTUAL_ID = 'virtual:dsh-official-workspace-client'
9
9
  export const RESOLVED_OFFICIAL_WORKSPACE_VIRTUAL_ID = `\0${OFFICIAL_WORKSPACE_VIRTUAL_ID}`
10
10
 
@@ -48,6 +48,20 @@ function replaceIfPresent(source, needle, replacement, label) {
48
48
  */
49
49
  export function decorateOfficialWorkspaceClient(source) {
50
50
  let derived = source
51
+ // Service derives its own Cordis Context, so retain the proxy's per-instance
52
+ // guard at construction. Menus and shortcuts share these service boundaries.
53
+ derived = replaceExactlyOnce(derived,
54
+ '\t\t\t\tsuper(ctx, "uiWorkspace");\n\t\t\t\tthis.directoryPicker = directoryPicker;',
55
+ '\t\t\t\tsuper(ctx, "uiWorkspace");\n\t\t\t\tthis.managedWorktreeGuard = ctx.get("__dshGitWorktreeManagedGuard");\n\t\t\t\tthis.directoryPicker = directoryPicker;',
56
+ 'instance-local managed guard')
57
+ derived = replaceExactlyOnce(derived,
58
+ '\t\t\tasync forkSession(sessionId, onCreated, options) {\n\t\t\t\treturn this.sessions.fork({',
59
+ '\t\t\tasync forkSession(sessionId, onCreated, options) {\n\t\t\t\tif (this.managedWorktreeGuard.blockSession(sessionId)) throw new Error("managed Session must be changed through its Worktree owner");\n\t\t\t\treturn this.sessions.fork({',
60
+ 'Managed Session fork from menus and shortcuts')
61
+ derived = replaceExactlyOnce(derived,
62
+ '\t\t\t\tconst target = workspaceId ?? currentWorkspaceId ?? recent;\n\t\t\t\tif (target === void 0) {',
63
+ '\t\t\t\tconst target = workspaceId ?? currentWorkspaceId ?? recent;\n\t\t\t\tif (target !== void 0 && this.managedWorktreeGuard.blockWorkspace(target)) return;\n\t\t\t\tif (target === void 0) {',
64
+ 'Managed Workspace new Session shortcut')
51
65
  derived = replaceExactlyOnce(derived,
52
66
  '\t\tconst zh = {',
53
67
  `\t\tconst zh = {\n\t\t\t"dshGitWorktree.managed": "托管 Worktree",\n\t\t\t"dshGitWorktree.state.working": "进行中",\n\t\t\t"dshGitWorktree.state.ready_for_review": "待验收",\n\t\t\t"dshGitWorktree.state.preview_active": "预览中",\n\t\t\t"dshGitWorktree.state.preview_detached": "待恢复",\n\t\t\t"dshGitWorktree.state.recovery_required": "需要恢复",\n\t\t\t"dshGitWorktree.state.finalized": "已完成",\n\t\t\t"dshGitWorktree.state.discarded": "已放弃",`,
@@ -86,7 +100,7 @@ export function decorateOfficialWorkspaceClient(source) {
86
100
  'modern session row decoration')
87
101
  derived = replaceIfPresent(derived,
88
102
  '\t\tfunction SessionHoverContent',
89
- `\t\tfunction managedWorktreeDecoration(node, t) {\n\t\t\tconst value = node.__dshGitWorktree;\n\t\t\tif (value?.kind !== "managed-worktree" || typeof value.state !== "string") return void 0;\n\t\t\tconst label = t(\`dshGitWorktree.state.\${value.state}\`);\n\t\t\treturn {\n\t\t\t\tstate: value.state,\n\t\t\t\tlabel,\n\t\t\t\tariaLabel: \`\${t("dshGitWorktree.managed")}, \${label}, \${displayTitle(node, t)}\`\n\t\t\t};\n\t\t}\n\t\tfunction ManagedWorktreeIdentity({ decoration }) {\n\t\t\treturn (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)("span", {\n\t\t\t\tclassName: "dsh-git-worktree-sidebar-icon",\n\t\t\t\t"data-worktree-state": decoration.state,\n\t\t\t\t"aria-hidden": "true",\n\t\t\t\tchildren: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconBranchOutlineRegular, {})\n\t\t\t}), (0, react_jsx_runtime.jsx)("span", {\n\t\t\t\tclassName: "dsh-git-worktree-sidebar-badge",\n\t\t\t\t"data-worktree-state": decoration.state,\n\t\t\t\t"aria-hidden": "true",\n\t\t\t\tchildren: decoration.label\n\t\t\t})] });\n\t\t}\n\t\t/** Hover-card body: full title, relative time, and every relevant live status. */\n\t\tfunction SessionHoverContent`,
103
+ `\t\tfunction managedWorktreeDecoration(node, t) {\n\t\t\tconst value = node.__dshGitWorktree;\n\t\t\tif (value?.kind !== "managed-worktree" || typeof value.state !== "string") return void 0;\n\t\t\tconst label = t(\`dshGitWorktree.state.\${value.state}\`);\n\t\t\treturn {\n\t\t\t\tstate: value.state,\n\t\t\t\tlabel,\n\t\t\t\tariaLabel: \`\${t("dshGitWorktree.managed")}, \${label}, \${displayTitle(node, t)}\`\n\t\t\t};\n\t\t}\n\t\tfunction ManagedWorktreeIdentity({ decoration }) {\n\t\t\treturn (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)("span", {\n\t\t\t\tclassName: "dsh-git-worktree-sidebar-icon",\n\t\t\t\t"data-worktree-state": decoration.state,\n\t\t\t\t"aria-hidden": "true",\n\t\t\t\tchildren: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconBranchOutlineRegular, {})\n\t\t\t}), decoration.state !== "working" && (0, react_jsx_runtime.jsx)("span", {\n\t\t\t\tclassName: "dsh-git-worktree-sidebar-badge",\n\t\t\t\t"data-worktree-state": decoration.state,\n\t\t\t\t"aria-hidden": "true",\n\t\t\t\tchildren: decoration.label\n\t\t\t})] });\n\t\t}\n\t\t/** Hover-card body: full title, relative time, and every relevant live status. */\n\t\tfunction SessionHoverContent`,
90
104
  'Managed row helper')
91
105
  derived = replaceExactlyOnce(derived,
92
106
  '\t\t\tconst statuses = sessionStatuses(node, t).filter((status) => !(node.archived && (status.state === "done" || status.state === "idle")));\n\t\t\treturn (0, react_jsx_runtime.jsxs)("div", {\n\t\t\t\tclassName: Rows_module_css_default.hoverContent,',