dsh-git-worktree 0.9.2 → 0.10.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.
- package/CHANGELOG.md +418 -386
- package/LICENSE +21 -21
- package/NOTICE +16 -14
- package/README.en.md +169 -169
- package/README.md +169 -169
- package/cordis.patch.yml +11 -11
- package/docs/i18n.md +63 -63
- package/lib/adapters/initial-commit.js +3 -3
- package/lib/adapters/project-skill-provider.js +14 -4
- package/lib/adapters/project-skill-provider.js.map +1 -1
- package/lib/client/actions.d.ts +19 -3
- package/lib/client/actions.js +23 -3
- package/lib/client/actions.js.map +1 -1
- package/lib/client/console-remote/adapter.js +1 -1
- package/lib/client/console-remote/adapter.js.map +1 -1
- package/lib/client/console-remote/index.d.ts +10 -3
- package/lib/client/console-remote/index.js +56 -13
- package/lib/client/console-remote/index.js.map +1 -1
- package/lib/client/index.js +1 -0
- package/lib/client/index.js.map +1 -1
- package/lib/client/pre-session/controller.d.ts +1 -1
- package/lib/client/pre-session/controller.js +33 -18
- package/lib/client/pre-session/controller.js.map +1 -1
- package/lib/client/review-console/recovery-continuation.d.ts +1 -1
- package/lib/client/review-console/recovery-continuation.js +9 -4
- package/lib/client/review-console/recovery-continuation.js.map +1 -1
- package/lib/client/review-console/review-console.styles.js +190 -190
- package/lib/client/styles.js +146 -140
- package/lib/client/styles.js.map +1 -1
- package/lib/client/target-console/target-console.styles.js +155 -155
- package/lib/client/workspace-sidebar/index.d.ts +11 -2
- package/lib/client/workspace-sidebar/index.js +89 -9
- package/lib/client/workspace-sidebar/index.js.map +1 -1
- package/lib/client.js +10501 -1345
- package/lib/console-contract.d.ts +2 -0
- package/lib/console-contract.js.map +1 -1
- package/lib/console-host/service.js +4 -2
- package/lib/console-host/service.js.map +1 -1
- package/lib/console-remote/descriptors.js +10 -3
- package/lib/console-remote/descriptors.js.map +1 -1
- package/lib/console-remote/schemas.js +1 -0
- package/lib/console-remote/schemas.js.map +1 -1
- package/lib/host-compat.d.ts +4 -0
- package/lib/host-compat.js +25 -0
- package/lib/host-compat.js.map +1 -0
- package/lib/i18n/client-messages.d.ts +4 -0
- package/lib/i18n/client-messages.js +4 -0
- package/lib/i18n/client-messages.js.map +1 -1
- package/lib/index.d.ts +4 -1
- package/lib/index.js +9 -2
- package/lib/index.js.map +1 -1
- package/lib/workspace-provider-lifecycle.d.ts +16 -1
- package/lib/workspace-provider-lifecycle.js +69 -5
- package/lib/workspace-provider-lifecycle.js.map +1 -1
- package/package.json +153 -149
- package/scripts/check-publish.mjs +239 -238
- package/scripts/check-workspace-sidebar-version.mjs +18 -14
- package/scripts/clean-lib.mjs +7 -7
- package/scripts/dev-dsh-lib.mjs +547 -509
- package/scripts/dev-dsh.mjs +98 -95
- package/scripts/dsh-source-runner.mjs +20 -14
- package/scripts/workspace-sidebar-upstream-alpha.mjs +102 -0
- package/scripts/workspace-sidebar-upstream-next.mjs +134 -0
- package/scripts/workspace-sidebar-upstream.d.mts +8 -8
- package/scripts/workspace-sidebar-upstream.mjs +182 -162
|
@@ -1,162 +1,182 @@
|
|
|
1
|
-
import { createHash } from 'node:crypto'
|
|
2
|
-
import { readFileSync } from 'node:fs'
|
|
3
|
-
import { createRequire } from 'node:module'
|
|
4
|
-
|
|
5
|
-
export const WORKSPACE_UI_VERSION = '0.
|
|
6
|
-
export const WORKSPACE_LOCALE_VERSION = '0.
|
|
7
|
-
export const WORKSPACE_CLIENT_SHA256 = '
|
|
8
|
-
export const OFFICIAL_WORKSPACE_VIRTUAL_ID = 'virtual:dsh-official-workspace-client'
|
|
9
|
-
export const RESOLVED_OFFICIAL_WORKSPACE_VIRTUAL_ID = `\0${OFFICIAL_WORKSPACE_VIRTUAL_ID}`
|
|
10
|
-
|
|
11
|
-
export function readOfficialWorkspaceClient() {
|
|
12
|
-
const require = createRequire(import.meta.url)
|
|
13
|
-
const packagePath = require.resolve('@deepseek-ai/dsh-client-ui-workspace/package.json')
|
|
14
|
-
const packageJson = JSON.parse(readFileSync(packagePath, 'utf8'))
|
|
15
|
-
if (packageJson.version !== WORKSPACE_UI_VERSION) {
|
|
16
|
-
throw new Error(`Unsupported @deepseek-ai/dsh-client-ui-workspace ${packageJson.version}; expected ${WORKSPACE_UI_VERSION}`)
|
|
17
|
-
}
|
|
18
|
-
const clientPath = require.resolve('@deepseek-ai/dsh-client-ui-workspace/client')
|
|
19
|
-
const source = readFileSync(clientPath, 'utf8')
|
|
20
|
-
const digest = createHash('sha256').update(source).digest('hex')
|
|
21
|
-
if (digest !== WORKSPACE_CLIENT_SHA256) {
|
|
22
|
-
throw new Error(`Official Workspace Client hash drifted: ${digest}; expected ${WORKSPACE_CLIENT_SHA256}`)
|
|
23
|
-
}
|
|
24
|
-
return { source, clientPath }
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function replaceExactlyOnce(source, needle, replacement, label) {
|
|
28
|
-
const first = source.indexOf(needle)
|
|
29
|
-
const last = source.lastIndexOf(needle)
|
|
30
|
-
if (first < 0 || first !== last) {
|
|
31
|
-
throw new Error(`Unable to derive official Workspace Client ${label}: expected one stable source seam`)
|
|
32
|
-
}
|
|
33
|
-
return source.slice(0, first) + replacement + source.slice(first + needle.length)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
derived = replaceExactlyOnce(derived,
|
|
52
|
-
'\t\
|
|
53
|
-
|
|
54
|
-
'
|
|
55
|
-
derived = replaceExactlyOnce(derived,
|
|
56
|
-
'\t\
|
|
57
|
-
|
|
58
|
-
'
|
|
59
|
-
derived = replaceExactlyOnce(derived,
|
|
60
|
-
'\t\t\t\
|
|
61
|
-
'\t\t\t\
|
|
62
|
-
'
|
|
63
|
-
derived = replaceExactlyOnce(derived,
|
|
64
|
-
'\t\t\t\
|
|
65
|
-
'\t\t\t\
|
|
66
|
-
'
|
|
67
|
-
derived = replaceExactlyOnce(derived,
|
|
68
|
-
'\t\t
|
|
69
|
-
|
|
70
|
-
'
|
|
71
|
-
derived = replaceExactlyOnce(derived,
|
|
72
|
-
'\t\t\
|
|
73
|
-
'\t\t\
|
|
74
|
-
'
|
|
75
|
-
derived =
|
|
76
|
-
'\t\t\
|
|
77
|
-
'\t\t\
|
|
78
|
-
'
|
|
79
|
-
derived =
|
|
80
|
-
'\t\t\
|
|
81
|
-
'\t\t\
|
|
82
|
-
'
|
|
83
|
-
derived =
|
|
84
|
-
'\t\t\t\t\t\t\tchildren:
|
|
85
|
-
'\t\t\t\t\t\t\tchildren:
|
|
86
|
-
'
|
|
87
|
-
derived =
|
|
88
|
-
'\t\
|
|
89
|
-
|
|
90
|
-
'Managed
|
|
91
|
-
derived = replaceExactlyOnce(derived,
|
|
92
|
-
'\t\t\t
|
|
93
|
-
'\t\t\
|
|
94
|
-
'
|
|
95
|
-
derived = replaceExactlyOnce(derived,
|
|
96
|
-
'\t\t\t\t\t\tchildren:
|
|
97
|
-
'\t\t\t\t\t\tchildren:
|
|
98
|
-
'
|
|
99
|
-
derived =
|
|
100
|
-
'\t\t\
|
|
101
|
-
'\t\t\
|
|
102
|
-
'
|
|
103
|
-
derived =
|
|
104
|
-
'\t\t\
|
|
105
|
-
'\t\t\
|
|
106
|
-
'
|
|
107
|
-
derived =
|
|
108
|
-
'\t\t\t
|
|
109
|
-
'\t\t\
|
|
110
|
-
'Managed
|
|
111
|
-
derived =
|
|
112
|
-
'\t\t\t\
|
|
113
|
-
'\t\t\t\
|
|
114
|
-
'
|
|
115
|
-
derived =
|
|
116
|
-
'\t\t\t\t\t
|
|
117
|
-
'\t\t\t\t\t
|
|
118
|
-
'Managed
|
|
119
|
-
|
|
120
|
-
'\t\t\t\t\t\t
|
|
121
|
-
'\t\t\t\t\t\
|
|
122
|
-
'
|
|
123
|
-
derived =
|
|
124
|
-
'\t\t\
|
|
125
|
-
'\t\t\t\t\t\t\t\
|
|
126
|
-
'
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
const
|
|
156
|
-
if (
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
1
|
+
import { createHash } from 'node:crypto'
|
|
2
|
+
import { readFileSync } from 'node:fs'
|
|
3
|
+
import { createRequire } from 'node:module'
|
|
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'
|
|
8
|
+
export const OFFICIAL_WORKSPACE_VIRTUAL_ID = 'virtual:dsh-official-workspace-client'
|
|
9
|
+
export const RESOLVED_OFFICIAL_WORKSPACE_VIRTUAL_ID = `\0${OFFICIAL_WORKSPACE_VIRTUAL_ID}`
|
|
10
|
+
|
|
11
|
+
export function readOfficialWorkspaceClient() {
|
|
12
|
+
const require = createRequire(import.meta.url)
|
|
13
|
+
const packagePath = require.resolve('@deepseek-ai/dsh-client-ui-workspace/package.json')
|
|
14
|
+
const packageJson = JSON.parse(readFileSync(packagePath, 'utf8'))
|
|
15
|
+
if (packageJson.version !== WORKSPACE_UI_VERSION) {
|
|
16
|
+
throw new Error(`Unsupported @deepseek-ai/dsh-client-ui-workspace ${packageJson.version}; expected ${WORKSPACE_UI_VERSION}`)
|
|
17
|
+
}
|
|
18
|
+
const clientPath = require.resolve('@deepseek-ai/dsh-client-ui-workspace/client')
|
|
19
|
+
const source = readFileSync(clientPath, 'utf8')
|
|
20
|
+
const digest = createHash('sha256').update(source).digest('hex')
|
|
21
|
+
if (digest !== WORKSPACE_CLIENT_SHA256) {
|
|
22
|
+
throw new Error(`Official Workspace Client hash drifted: ${digest}; expected ${WORKSPACE_CLIENT_SHA256}`)
|
|
23
|
+
}
|
|
24
|
+
return { source, clientPath }
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function replaceExactlyOnce(source, needle, replacement, label) {
|
|
28
|
+
const first = source.indexOf(needle)
|
|
29
|
+
const last = source.lastIndexOf(needle)
|
|
30
|
+
if (first < 0 || first !== last) {
|
|
31
|
+
throw new Error(`Unable to derive official Workspace Client ${label}: expected one stable source seam`)
|
|
32
|
+
}
|
|
33
|
+
return source.slice(0, first) + replacement + source.slice(first + needle.length)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// DSH 0.2 removed the legacy search/menu seams; those optional decorations are
|
|
37
|
+
// handled by the modern Workspace row/slot path below when the seam exists.
|
|
38
|
+
function replaceIfPresent(source, needle, replacement, label) {
|
|
39
|
+
const hit = source.includes(needle)
|
|
40
|
+
if (process.env.WT_DEBUG_SEAMS) console.log(`[seam] ${hit ? 'HIT ' : 'SKIP '} (optional) ${label}`)
|
|
41
|
+
return hit ? replaceExactlyOnce(source, needle, replacement, label) : source
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Add one package-owned row decoration to the already version/hash-gated
|
|
46
|
+
* official Browser. Every replacement is exact and therefore fails closed if
|
|
47
|
+
* the upstream generated structure changes.
|
|
48
|
+
*/
|
|
49
|
+
export function decorateOfficialWorkspaceClient(source) {
|
|
50
|
+
let derived = source
|
|
51
|
+
derived = replaceExactlyOnce(derived,
|
|
52
|
+
'\t\tconst zh = {',
|
|
53
|
+
`\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": "已放弃",`,
|
|
54
|
+
'Chinese Worktree locale')
|
|
55
|
+
derived = replaceExactlyOnce(derived,
|
|
56
|
+
'\t\tconst en = {',
|
|
57
|
+
`\t\tconst en = {\n\t\t\t"dshGitWorktree.managed": "Managed Worktree",\n\t\t\t"dshGitWorktree.state.working": "In progress",\n\t\t\t"dshGitWorktree.state.ready_for_review": "Ready for review",\n\t\t\t"dshGitWorktree.state.preview_active": "Preview",\n\t\t\t"dshGitWorktree.state.preview_detached": "Resume preview",\n\t\t\t"dshGitWorktree.state.recovery_required": "Recovery required",\n\t\t\t"dshGitWorktree.state.finalized": "Done",\n\t\t\t"dshGitWorktree.state.discarded": "Discarded",`,
|
|
58
|
+
'English Worktree locale')
|
|
59
|
+
derived = replaceExactlyOnce(derived,
|
|
60
|
+
'\t\t\t\tgroups.push(buildGroup(workspace.workspaceId, workspace.workspaceId, workspace.path, Date.parse(workspace.createdAt), workspace.title, members));',
|
|
61
|
+
'\t\t\t\tconst group = buildGroup(workspace.workspaceId, workspace.workspaceId, workspace.path, Date.parse(workspace.createdAt), workspace.title, members);\n\t\t\t\tif (workspace.__dshGitWorktreeProtected === true) group.__dshGitWorktreeProtected = true;\n\t\t\t\tgroups.push(group);',
|
|
62
|
+
'Managed workspace metadata')
|
|
63
|
+
derived = replaceExactlyOnce(derived,
|
|
64
|
+
'\t\t\t\tupdatedAt: s.updatedAt,\n\t\t\t\t...pendingInteraction === void 0 ? {} : { pendingInteraction }',
|
|
65
|
+
'\t\t\t\tupdatedAt: s.updatedAt,\n\t\t\t\t...s.__dshGitWorktree === void 0 ? {} : { __dshGitWorktree: s.__dshGitWorktree },\n\t\t\t\t...pendingInteraction === void 0 ? {} : { pendingInteraction }',
|
|
66
|
+
'session node metadata')
|
|
67
|
+
derived = replaceExactlyOnce(derived,
|
|
68
|
+
'\t\t\t\t\t\tworkspace: labelOf(summary),\n\t\t\t\t\t\trunning: status?.running ?? summary.running,',
|
|
69
|
+
'\t\t\t\t\t\tworkspace: labelOf(summary),\n\t\t\t\t\t\t...summary.__dshGitWorktree === void 0 ? {} : { __dshGitWorktree: summary.__dshGitWorktree },\n\t\t\t\t\t\trunning: status?.running ?? summary.running,',
|
|
70
|
+
'search result metadata')
|
|
71
|
+
derived = replaceExactlyOnce(derived,
|
|
72
|
+
'\t\t\t\t\tlabel: g.label,\n\t\t\t\t\tsessionCount: g.sessions.length,',
|
|
73
|
+
'\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,',
|
|
74
|
+
'Managed workspace group metadata')
|
|
75
|
+
derived = replaceIfPresent(derived,
|
|
76
|
+
'\t\t\tconst draggable = drag !== void 0 && !row.blank && !row.archived;\n\t\t\tconst [menuOpen, setMenuOpen]',
|
|
77
|
+
'\t\t\tconst draggable = drag !== void 0 && !row.blank && !row.archived;\n\t\t\tconst worktreeDecoration = managedWorktreeDecoration(node, t);\n\t\t\tconst [menuOpen, setMenuOpen]',
|
|
78
|
+
'modern session decoration setup')
|
|
79
|
+
derived = replaceIfPresent(derived,
|
|
80
|
+
'\t\t\t\t\tclassName: clsx(Rows_module_css_default.sessionRow, selected && Rows_module_css_default.selected, menuOpen && Rows_module_css_default.menuOpen, row.archived && Rows_module_css_default.archived, drag?.marker === "before" && Rows_module_css_default.dropBefore, drag?.marker === "after" && Rows_module_css_default.dropAfter),\n\t\t\t\t\trole: "treeitem",',
|
|
81
|
+
'\t\t\t\t\tclassName: clsx(Rows_module_css_default.sessionRow, selected && Rows_module_css_default.selected, menuOpen && Rows_module_css_default.menuOpen, row.archived && Rows_module_css_default.archived, drag?.marker === "before" && Rows_module_css_default.dropBefore, drag?.marker === "after" && Rows_module_css_default.dropAfter),\n\t\t\t\t\t...worktreeDecoration === void 0 ? {} : { "aria-label": worktreeDecoration.ariaLabel, "data-managed-worktree": "true" },\n\t\t\t\t\trole: "treeitem",',
|
|
82
|
+
'modern session row identity')
|
|
83
|
+
derived = replaceIfPresent(derived,
|
|
84
|
+
'\t\t\t\t\t\t\tchildren: !row.archived && !row.blank && (showStatus ? (0, react_jsx_runtime.jsx)(SessionStatusDots, { statuses }) : renderSlot("sidebar.session.row.leading", { sessionId: node.id }))\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t(0, react_jsx_runtime.jsx)("span", {',
|
|
85
|
+
'\t\t\t\t\t\t\tchildren: !row.archived && !row.blank && (showStatus ? (0, react_jsx_runtime.jsx)(SessionStatusDots, { statuses }) : renderSlot("sidebar.session.row.leading", { sessionId: node.id }))\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tworktreeDecoration !== void 0 && (0, react_jsx_runtime.jsx)(ManagedWorktreeIdentity, { decoration: worktreeDecoration }),\n\t\t\t\t\t\t(0, react_jsx_runtime.jsx)("span", {',
|
|
86
|
+
'modern session row decoration')
|
|
87
|
+
derived = replaceIfPresent(derived,
|
|
88
|
+
'\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`,
|
|
90
|
+
'Managed row helper')
|
|
91
|
+
derived = replaceExactlyOnce(derived,
|
|
92
|
+
'\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,',
|
|
93
|
+
'\t\t\tconst statuses = sessionStatuses(node, t);\n\t\t\tconst worktreeDecoration = managedWorktreeDecoration(node, t);\n\t\t\treturn (0, react_jsx_runtime.jsxs)("div", {\n\t\t\t\tclassName: Rows_module_css_default.hoverContent,',
|
|
94
|
+
'hover metadata')
|
|
95
|
+
derived = replaceExactlyOnce(derived,
|
|
96
|
+
'\t\t\t\t\t\tchildren: displayTitle(node, t)\n\t\t\t\t\t}),\n\t\t\t\t\t!node.blank',
|
|
97
|
+
'\t\t\t\t\t\tchildren: displayTitle(node, t)\n\t\t\t\t\t}),\n\t\t\t\t\tworktreeDecoration !== void 0 && (0, react_jsx_runtime.jsxs)("div", {\n\t\t\t\t\t\tclassName: Rows_module_css_default.hoverStatus,\n\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconBranchOutlineRegular, {}), (0, react_jsx_runtime.jsx)("span", { children: worktreeDecoration.ariaLabel })]\n\t\t\t\t\t}),\n\t\t\t\t\t!node.blank',
|
|
98
|
+
'hover Worktree identity')
|
|
99
|
+
derived = replaceIfPresent(derived,
|
|
100
|
+
'\t\t\tconst primaryStatus = statuses[0];\n\t\t\treturn (0, react_jsx_runtime.jsxs)("button", {\n\t\t\t\ttype: "button",\n\t\t\t\tclassName: clsx(Rows_module_css_default.searchResultRow, selected && Rows_module_css_default.selected),',
|
|
101
|
+
'\t\t\tconst primaryStatus = statuses[0];\n\t\t\tconst worktreeDecoration = managedWorktreeDecoration(result, t);\n\t\t\treturn (0, react_jsx_runtime.jsxs)("button", {\n\t\t\t\ttype: "button",\n\t\t\t\tclassName: clsx(Rows_module_css_default.searchResultRow, selected && Rows_module_css_default.selected),\n\t\t\t\t...worktreeDecoration === void 0 ? {} : { "aria-label": worktreeDecoration.ariaLabel, "data-managed-worktree": "true" },',
|
|
102
|
+
'search Worktree identity')
|
|
103
|
+
derived = replaceIfPresent(derived,
|
|
104
|
+
'\t\t\t\t\t\t\tchildren: (primaryStatus.state !== "done" || result.completed) && (0, react_jsx_runtime.jsx)(SessionStatusDots, { statuses })\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t(0, react_jsx_runtime.jsx)("span", {\n\t\t\t\t\t\t\tclassName: Rows_module_css_default.searchResultTitle,',
|
|
105
|
+
'\t\t\t\t\t\t\tchildren: (primaryStatus.state !== "done" || result.completed) && (0, react_jsx_runtime.jsx)(SessionStatusDots, { statuses })\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tworktreeDecoration !== void 0 && (0, react_jsx_runtime.jsx)(ManagedWorktreeIdentity, { decoration: worktreeDecoration }),\n\t\t\t\t\t\t(0, react_jsx_runtime.jsx)("span", {\n\t\t\t\t\t\t\tclassName: Rows_module_css_default.searchResultTitle,',
|
|
106
|
+
'search Worktree decoration')
|
|
107
|
+
derived = replaceIfPresent(derived,
|
|
108
|
+
'\t\t\tconst label = row.workspaceId === void 0 ? t("group.ungrouped") : row.label;\n\t\t\tconst active = containsCurrentDescendant || group.expanded && group.containsCurrent;',
|
|
109
|
+
'\t\t\tconst label = row.workspaceId === void 0 ? t("group.ungrouped") : row.label;\n\t\t\tconst protectedManagedWorkspace = row.__dshGitWorktreeProtected === true;\n\t\t\tconst active = containsCurrentDescendant || group.expanded && group.containsCurrent;',
|
|
110
|
+
'Managed workspace row metadata')
|
|
111
|
+
derived = replaceIfPresent(derived,
|
|
112
|
+
'\t\t\t\tclassName: clsx(Rows_module_css_default.projectRow, menuOpen && Rows_module_css_default.menuOpen),\n\t\t\t\t"data-row-key": `workspace:${group.key}`,\n\t\t\t\trole: "treeitem",\n\t\t\t\t"aria-expanded": row.expanded,\n\t\t\t\tonClick: onToggle,\n\t\t\t\tdraggable: drag !== void 0,',
|
|
113
|
+
'\t\t\t\tclassName: clsx(Rows_module_css_default.projectRow, menuOpen && Rows_module_css_default.menuOpen),\n\t\t\t\t"data-row-key": `workspace:${group.key}`,\n\t\t\t\trole: "treeitem",\n\t\t\t\t"aria-expanded": row.expanded,\n\t\t\t\tonClick: onToggle,\n\t\t\t\tdraggable: !protectedManagedWorkspace && drag !== void 0,',
|
|
114
|
+
'Managed workspace drag')
|
|
115
|
+
derived = replaceIfPresent(derived,
|
|
116
|
+
'\t\t\t\t\t\tchildren: [actions !== void 0 && (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Menu, {',
|
|
117
|
+
'\t\t\t\t\t\tchildren: [!protectedManagedWorkspace && actions !== void 0 && (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Menu, {',
|
|
118
|
+
'Managed workspace menu')
|
|
119
|
+
derived = replaceIfPresent(derived,
|
|
120
|
+
'\t\t\t\t\t\t\tchildren: (0, react_jsx_runtime.jsx)("button", {\n\t\t\t\t\t\t\t\ttype: "button",\n\t\t\t\t\t\t\t\tclassName: Rows_module_css_default.iconButton,\n\t\t\t\t\t\t\t\t"aria-keyshortcuts": newShortcut?.aria,\n\t\t\t\t\t\t\t\t"aria-label": t("actions.newSession.aria", { name: label }),',
|
|
121
|
+
'\t\t\t\t\t\t\tchildren: !protectedManagedWorkspace && (0, react_jsx_runtime.jsx)("button", {\n\t\t\t\t\t\t\t\ttype: "button",\n\t\t\t\t\t\t\t\tclassName: Rows_module_css_default.iconButton,\n\t\t\t\t\t\t\t\t"aria-keyshortcuts": newShortcut?.aria,\n\t\t\t\t\t\t\t\t"aria-label": t("actions.newSession.aria", { name: label }),',
|
|
122
|
+
'Managed workspace new Session')
|
|
123
|
+
derived = replaceIfPresent(derived,
|
|
124
|
+
'\t\t\tconst showStatus = statuses[0].state !== "done" || row.completed;\n\t\t\tconst [menuOpen, setMenuOpen]',
|
|
125
|
+
'\t\t\tconst showStatus = statuses[0].state !== "done" || row.completed;\n\t\t\tconst worktreeDecoration = managedWorktreeDecoration(row, t);\n\t\t\tconst [menuOpen, setMenuOpen]',
|
|
126
|
+
'session Worktree metadata')
|
|
127
|
+
derived = replaceIfPresent(derived,
|
|
128
|
+
'\t\t\t];\n\t\t\treturn (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.HoverCard, {',
|
|
129
|
+
'\t\t\t];\n\t\t\tconst visibleSessionMenuItems = worktreeDecoration === void 0 ? sessionMenuItems : sessionMenuItems.filter((item) => item.id !== "fork");\n\t\t\treturn (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.HoverCard, {',
|
|
130
|
+
'Managed session menu')
|
|
131
|
+
derived = replaceIfPresent(derived,
|
|
132
|
+
'\t\t\t\t\tclassName: clsx(Rows_module_css_default.sessionRow, selected && Rows_module_css_default.selected, menuOpen && Rows_module_css_default.menuOpen, flat && !showStatus && Rows_module_css_default.flatSessionRowWithoutStatus, drag?.marker === "before" && Rows_module_css_default.dropBefore, drag?.marker === "after" && Rows_module_css_default.dropAfter),\n\t\t\t\t\trole: "treeitem",',
|
|
133
|
+
'\t\t\t\t\tclassName: clsx(Rows_module_css_default.sessionRow, selected && Rows_module_css_default.selected, menuOpen && Rows_module_css_default.menuOpen, flat && !showStatus && Rows_module_css_default.flatSessionRowWithoutStatus, drag?.marker === "before" && Rows_module_css_default.dropBefore, drag?.marker === "after" && Rows_module_css_default.dropAfter),\n\t\t\t\t\trole: "treeitem",\n\t\t\t\t\t...worktreeDecoration === void 0 ? {} : { "aria-label": worktreeDecoration.ariaLabel, "data-managed-worktree": "true" },',
|
|
134
|
+
'session Worktree aria')
|
|
135
|
+
derived = replaceIfPresent(derived,
|
|
136
|
+
'\t\t\t\t\t"aria-selected": selected,\n\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\tonOpen(node.id);\n\t\t\t\t\t},\n\t\t\t\t\tdraggable: drag !== void 0,',
|
|
137
|
+
'\t\t\t\t\t"aria-selected": selected,\n\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\tonOpen(node.id);\n\t\t\t\t\t},\n\t\t\t\t\tdraggable: worktreeDecoration === void 0 && drag !== void 0,',
|
|
138
|
+
'Managed session drag')
|
|
139
|
+
derived = replaceIfPresent(derived,
|
|
140
|
+
'\t\t\t\t\t\t(!flat || showStatus) && (0, react_jsx_runtime.jsx)("span", {\n\t\t\t\t\t\t\tclassName: Rows_module_css_default.slot,\n\t\t\t\t\t\t\tchildren: showStatus && (0, react_jsx_runtime.jsx)(SessionStatusDots, { statuses })\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t(0, react_jsx_runtime.jsx)("span", {',
|
|
141
|
+
'\t\t\t\t\t\tworktreeDecoration === void 0 && (!flat || showStatus) && (0, react_jsx_runtime.jsx)("span", {\n\t\t\t\t\t\t\tclassName: Rows_module_css_default.slot,\n\t\t\t\t\t\t\tchildren: showStatus && (0, react_jsx_runtime.jsx)(SessionStatusDots, { statuses })\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tworktreeDecoration !== void 0 && (0, react_jsx_runtime.jsx)(ManagedWorktreeIdentity, { decoration: worktreeDecoration }),\n\t\t\t\t\t\t(0, react_jsx_runtime.jsx)("span", {',
|
|
142
|
+
'session Worktree decoration')
|
|
143
|
+
derived = replaceIfPresent(derived,
|
|
144
|
+
'\t\t\t\t\t\t\t\titems: sessionMenuItems,',
|
|
145
|
+
'\t\t\t\t\t\t\t\titems: visibleSessionMenuItems,',
|
|
146
|
+
'Managed session visible menu')
|
|
147
|
+
return derived
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export function materializeOfficialWorkspaceClientModule() {
|
|
151
|
+
const official = readOfficialWorkspaceClient()
|
|
152
|
+
const source = decorateOfficialWorkspaceClient(official.source)
|
|
153
|
+
const factoryToken = 'factory: (require) => {'
|
|
154
|
+
const start = source.indexOf(factoryToken)
|
|
155
|
+
const end = source.lastIndexOf('\n\t}\n});')
|
|
156
|
+
if (start < 0 || end < 0 || end <= start) {
|
|
157
|
+
throw new Error('Unable to extract the official Workspace Client ModuleLoader factory')
|
|
158
|
+
}
|
|
159
|
+
const body = source.slice(start + factoryToken.length, end)
|
|
160
|
+
return `
|
|
161
|
+
import * as cordis from '@deepseek-ai/cordis'
|
|
162
|
+
import * as store from '@deepseek-ai/dsh-client-store'
|
|
163
|
+
import * as jsxRuntime from 'react/jsx-runtime'
|
|
164
|
+
import * as react from 'react'
|
|
165
|
+
import * as primitives from '@deepseek-ai/dsh-client-ui-primitives'
|
|
166
|
+
const modules = {
|
|
167
|
+
'@deepseek-ai/cordis': cordis,
|
|
168
|
+
'@deepseek-ai/dsh-client-store': store,
|
|
169
|
+
'react/jsx-runtime': jsxRuntime,
|
|
170
|
+
'react': react,
|
|
171
|
+
'@deepseek-ai/dsh-client-ui-primitives': primitives,
|
|
172
|
+
}
|
|
173
|
+
const official = ((require) => {${body}
|
|
174
|
+
})(specifier => {
|
|
175
|
+
const value = modules[specifier]
|
|
176
|
+
if (value === undefined) throw new Error('Unsupported official Workspace Client require: ' + specifier)
|
|
177
|
+
return value
|
|
178
|
+
})
|
|
179
|
+
export const apply = official.apply
|
|
180
|
+
export const inject = official.inject
|
|
181
|
+
`
|
|
182
|
+
}
|