@cerbur/clutch-dsh-worktree 0.1.5 → 0.1.6
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/README.md +66 -15
- package/README.zh.md +59 -13
- package/lib/client/WorktreeHeroContext.d.ts +1 -1
- package/lib/client/WorktreeHeroContext.js +1 -1
- package/lib/client/WorktreeSurface.d.ts +1 -1
- package/lib/client/WorktreeSurface.d.ts.map +1 -1
- package/lib/client/WorktreeSurface.js +348 -85
- package/lib/client/WorktreeSurface.js.map +1 -1
- package/lib/client/entry.d.ts.map +1 -1
- package/lib/client/entry.js +3 -0
- package/lib/client/entry.js.map +1 -1
- package/lib/client/locales.d.ts +24 -0
- package/lib/client/locales.d.ts.map +1 -1
- package/lib/client/locales.js +26 -2
- package/lib/client/locales.js.map +1 -1
- package/lib/client/virtual-workspace-membership.js +1 -1
- package/lib/client/virtual-workspace-membership.js.map +1 -1
- package/lib/client/worktree-connection.d.ts +2 -0
- package/lib/client/worktree-connection.d.ts.map +1 -1
- package/lib/client/worktree-connection.js +4 -0
- package/lib/client/worktree-connection.js.map +1 -1
- package/lib/client/worktree-error-copy.d.ts.map +1 -1
- package/lib/client/worktree-error-copy.js +6 -0
- package/lib/client/worktree-error-copy.js.map +1 -1
- package/lib/client/worktree-expand-state.d.ts +33 -0
- package/lib/client/worktree-expand-state.d.ts.map +1 -0
- package/lib/client/worktree-expand-state.js +83 -0
- package/lib/client/worktree-expand-state.js.map +1 -0
- package/lib/client/worktree-session-position.d.ts +2 -0
- package/lib/client/worktree-session-position.d.ts.map +1 -0
- package/lib/client/worktree-session-position.js +11 -0
- package/lib/client/worktree-session-position.js.map +1 -0
- package/lib/client/worktree-surface-dialogs.d.ts +1 -1
- package/lib/client/worktree-surface-dialogs.d.ts.map +1 -1
- package/lib/client/worktree-surface-dialogs.js +30 -13
- package/lib/client/worktree-surface-dialogs.js.map +1 -1
- package/lib/client/worktree-surface-rows.d.ts +2 -2
- package/lib/client/worktree-surface-rows.d.ts.map +1 -1
- package/lib/client/worktree-surface-rows.js +5 -5
- package/lib/client/worktree-surface-rows.js.map +1 -1
- package/lib/client/worktree-surface-selectors.d.ts +16 -0
- package/lib/client/worktree-surface-selectors.d.ts.map +1 -1
- package/lib/client/worktree-surface-selectors.js +54 -0
- package/lib/client/worktree-surface-selectors.js.map +1 -1
- package/lib/client/worktree-surface-types.d.ts +28 -1
- package/lib/client/worktree-surface-types.d.ts.map +1 -1
- package/lib/client/worktree-view-actions.d.ts +3 -0
- package/lib/client/worktree-view-actions.d.ts.map +1 -1
- package/lib/client/worktree-view-actions.js +3 -0
- package/lib/client/worktree-view-actions.js.map +1 -1
- package/lib/client/worktree-view-read.d.ts +8 -0
- package/lib/client/worktree-view-read.d.ts.map +1 -1
- package/lib/client/worktree-view-read.js +19 -0
- package/lib/client/worktree-view-read.js.map +1 -1
- package/lib/client.js +612 -101
- package/lib/client.js.map +1 -1
- package/lib/contract/index.contract.js +14 -0
- package/lib/contract/index.contract.js.map +1 -1
- package/lib/contract/index.d.ts +22 -2
- package/lib/contract/index.d.ts.map +1 -1
- package/lib/contract/index.js +4 -0
- package/lib/contract/index.js.map +1 -1
- package/lib/host/remote.d.ts.map +1 -1
- package/lib/host/remote.js +2 -0
- package/lib/host/remote.js.map +1 -1
- package/lib/host/service.d.ts +8 -1
- package/lib/host/service.d.ts.map +1 -1
- package/lib/host/service.js +12 -0
- package/lib/host/service.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/manage/manager-support.d.ts +2 -0
- package/lib/manage/manager-support.d.ts.map +1 -1
- package/lib/manage/manager-support.js +9 -0
- package/lib/manage/manager-support.js.map +1 -1
- package/lib/manage/manager-worktrees.d.ts +10 -1
- package/lib/manage/manager-worktrees.d.ts.map +1 -1
- package/lib/manage/manager-worktrees.js +121 -5
- package/lib/manage/manager-worktrees.js.map +1 -1
- package/lib/manage/manager.d.ts +8 -1
- package/lib/manage/manager.d.ts.map +1 -1
- package/lib/manage/manager.js +7 -1
- package/lib/manage/manager.js.map +1 -1
- package/lib/provider/git.d.ts +2 -0
- package/lib/provider/git.d.ts.map +1 -1
- package/lib/provider/git.js +23 -1
- package/lib/provider/git.js.map +1 -1
- package/lib/provider/index.d.ts +1 -1
- package/lib/provider/index.d.ts.map +1 -1
- package/lib/provider/index.js +1 -1
- package/lib/provider/index.js.map +1 -1
- package/lib/provider/sidecar-schema.d.ts +1 -1
- package/lib/provider/sidecar-schema.d.ts.map +1 -1
- package/lib/provider/sidecar-schema.js +33 -37
- package/lib/provider/sidecar-schema.js.map +1 -1
- package/lib/provider/sidecar.d.ts.map +1 -1
- package/lib/provider/sidecar.js +3 -1
- package/lib/provider/sidecar.js.map +1 -1
- package/lib/provider/types.d.ts +9 -1
- package/lib/provider/types.d.ts.map +1 -1
- package/lib/provider/types.js +2 -1
- package/lib/provider/types.js.map +1 -1
- package/lib/typert.host.js +115 -21
- package/lib/typert.remote-client.d.ts +5 -1
- package/lib/typert.remote-client.d.ts.map +1 -1
- package/lib/typert.remote-client.js +115 -21
- package/package.json +30 -30
package/README.md
CHANGED
|
@@ -12,10 +12,18 @@ The plugin stores only external Worktree/Session relationship metadata.
|
|
|
12
12
|
The English screenshot shows Worktree mode in the Sidebar, a Workspace tree with Main and
|
|
13
13
|
Worktree rows, and the read-only blank-session Hero context.
|
|
14
14
|
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
The Import screenshot shows the existing Workspace `+` dialog with Create selected by default,
|
|
18
|
+
the adjacent Import tab, and a standard dropdown containing safe example branch/path values.
|
|
19
|
+
|
|
15
20
|
## Capabilities
|
|
16
21
|
|
|
17
22
|
- Enter Worktree mode from the DSH Sidebar footer and browse Workspace → Worktree → Session.
|
|
18
23
|
- Search Workspaces and create a Git Worktree and branch from an existing local branch.
|
|
24
|
+
- Choose Import in the same dialog to discover unmanaged, branch-attached Git Worktrees linked to the Workspace repository. The first version omits the repository root and detached HEAD entries.
|
|
25
|
+
- Register an existing Worktree in place without moving, copying, or editing its directory; the imported record uses `source: external` and then follows the same Session, binding, health, ordering, cwd, projection, refresh, and recovery flow as a plugin-created record.
|
|
26
|
+
- Remove plugin-created and imported Worktrees through real `git worktree remove`; removing an imported Worktree can delete its linked directory and is called out in the confirmation dialog.
|
|
19
27
|
- Create a normal Session from Main or a Session whose runtime cwd is an active Worktree, then
|
|
20
28
|
open it directly.
|
|
21
29
|
- See ready, repair, active, and detached Worktree states, including retryable operation errors.
|
|
@@ -24,6 +32,8 @@ Worktree rows, and the read-only blank-session Hero context.
|
|
|
24
32
|
- Continue using DSH-native Workspace rename/delete/reorder and Session menus. Worktree rows can
|
|
25
33
|
be reordered within their owning Workspace; order is stored in the plugin sidecar and Main is
|
|
26
34
|
fixed first.
|
|
35
|
+
- Persist Workspace, Main, and Worktree expansion choices in browser-local storage; the five-row Session overflow state remains transient and resets after refresh or parent collapse.
|
|
36
|
+
- Highlight the DSH current Session in Worktree view; entering Worktree mode or switching the current Session temporarily reveals its Workspace/Main/Worktree path, expands Session overflow, clears a hiding search, and scrolls the row into view; this browser-local behavior does not change persisted expansion choices.
|
|
27
37
|
- Keep the current local branch or Worktree branch visible as read-only context in the existing
|
|
28
38
|
Conversation title row and in the blank-session Hero.
|
|
29
39
|
- Keep Conversation and Hero context stable across same-Session snapshot updates and Session
|
|
@@ -36,7 +46,11 @@ Worktree rows, and the read-only blank-session Hero context.
|
|
|
36
46
|
|
|
37
47
|
### Compatibility and prerequisites
|
|
38
48
|
|
|
39
|
-
-
|
|
49
|
+
- For development and source validation, use a clean checkout of the official [DeepSeek Harness
|
|
50
|
+
repository](https://github.com/deepseek-ai/deepseek-harness) on its current default branch. The
|
|
51
|
+
repository currently uses `master` rather than `main`; it is developer-preview software, so its
|
|
52
|
+
package and API contracts may change. Run the upstream install/build steps before installing
|
|
53
|
+
this plugin into that profile.
|
|
40
54
|
- The target profile, such as `web` or `demo`, must already start successfully, and the plugin
|
|
41
55
|
must be installed into the same profile that launches the Web UI.
|
|
42
56
|
- DSH Client must provide the native `@deepseek-ai/dsh-client-ui-conversation` package and its
|
|
@@ -79,6 +93,20 @@ To inspect the currently published version on the official registry:
|
|
|
79
93
|
npm view @cerbur/clutch-dsh-worktree version --registry=https://registry.npmjs.org/
|
|
80
94
|
```
|
|
81
95
|
|
|
96
|
+
### Prepare the current upstream DSH checkout
|
|
97
|
+
|
|
98
|
+
For source-based development or validation, prepare the upstream checkout first. The current
|
|
99
|
+
upstream default branch is `master`; follow the repository's default branch if it changes later.
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
git clone https://github.com/deepseek-ai/deepseek-harness.git
|
|
103
|
+
cd deepseek-harness
|
|
104
|
+
git fetch origin
|
|
105
|
+
git pull --ff-only origin master
|
|
106
|
+
pnpm install
|
|
107
|
+
pnpm run build
|
|
108
|
+
```
|
|
109
|
+
|
|
82
110
|
### Install from a repository checkout
|
|
83
111
|
|
|
84
112
|
Build the package from the `clutch-dsh` checkout, then install its absolute path into the DSH
|
|
@@ -176,14 +204,30 @@ blank-session Hero. The displayed language follows DSH's current language settin
|
|
|
176
204
|
Project root. Relative paths, a different Project, or the Project root are rejected.
|
|
177
205
|
3. Git must be installed and available on `PATH`. A missing Git executable shows install guidance
|
|
178
206
|
and no command block; install Git, restart DSH, and retry. If the repository, initial commit,
|
|
179
|
-
|
|
180
|
-
|
|
207
|
+
or local branch is missing, follow the copyable setup commands in the dialog. The plugin only
|
|
208
|
+
renders this guidance; it does not run setup or installation commands or edit business files.
|
|
209
|
+
|
|
210
|
+
### Import an existing Worktree
|
|
211
|
+
|
|
212
|
+
1. Select a Workspace, press its `+`, and choose the `Import` tab. The dialog loads Git-linked
|
|
213
|
+
Worktrees for that repository through the existing DSH `/api` Connection.
|
|
214
|
+
2. The first version lists only branch-attached, non-root Worktrees that are not already present
|
|
215
|
+
in the plugin sidecar. Detached HEAD entries are intentionally omitted. Candidates are presented
|
|
216
|
+
in a standard dropdown; each option shows its branch first and absolute path as secondary
|
|
217
|
+
diagnostic text.
|
|
218
|
+
3. Choose an option and select `Import Worktree`. Registration writes only the plugin sidecar;
|
|
219
|
+
the existing Worktree directory and Git working state remain in place. Import then creates or
|
|
220
|
+
reuses a Session at that Worktree cwd and runs the same bind → membership projection → open →
|
|
221
|
+
refresh flow as Create.
|
|
222
|
+
4. An active external import for the same Workspace and physical path is idempotent. A path already
|
|
223
|
+
managed by the plugin returns `WORKTREE_ALREADY_MANAGED`; invalid or stale candidates return
|
|
224
|
+
`WORKTREE_IMPORT_INVALID` and can be retried after the repository state is fixed.
|
|
181
225
|
|
|
182
226
|
### Create Main and Worktree Sessions
|
|
183
227
|
|
|
184
228
|
- Use Main's `+` to create a normal DSH Session in the Project-root view.
|
|
185
|
-
- Use a Worktree's `+` to create or reuse a Session with that Worktree as its runtime cwd.
|
|
186
|
-
|
|
229
|
+
- Use a Worktree's `+` to create or reuse a Session with that Worktree as its runtime cwd. The
|
|
230
|
+
plugin calls the upstream runtime with `session.create({ cwd: worktreePath })`, then saves the
|
|
187
231
|
external binding, applies a browser-local `{ workspaceId, sessionId }` membership projection,
|
|
188
232
|
and opens the Session.
|
|
189
233
|
- The connector reuses an unarchived blank Session with the exact target cwd when possible. An
|
|
@@ -203,14 +247,19 @@ blank-session Hero. The displayed language follows DSH's current language settin
|
|
|
203
247
|
the plugin sidecar; Main is a fixed first row and Worktrees cannot move across Workspaces.
|
|
204
248
|
- Use the active Worktree options menu and confirmation dialog to remove a Worktree. Main and
|
|
205
249
|
detached Worktrees do not show this menu.
|
|
250
|
+
- Imported Worktrees expose the same active options menu as plugin-created Worktrees. Removing
|
|
251
|
+
either source runs real `git worktree remove`; for an imported Worktree, the confirmation warns
|
|
252
|
+
that the linked Worktree directory may be deleted. Sessions are retained as detached bindings.
|
|
206
253
|
- Removing a Worktree does not delete its Sessions. The relationship remains detached until it
|
|
207
254
|
is explicitly unbound. Deleting a Workspace removes only DSH's Workspace registration; its
|
|
208
255
|
directory, Sessions, Git Worktrees, and plugin sidecar remain.
|
|
209
256
|
- DSH-native Workspace rename/delete/reorder and Session menus remain available. Session drag
|
|
210
257
|
ordering is limited to the current visual Main or Worktree group.
|
|
211
258
|
- The Main group shows the current local branch as `Local (branch)` and falls back to `Local` if
|
|
212
|
-
DSH reports no current branch.
|
|
213
|
-
|
|
259
|
+
DSH reports no current branch. When a Workspace is imported from a Git subdirectory, the Git
|
|
260
|
+
root is resolved first and the same branch/worktree information is used as for the root.
|
|
261
|
+
Branch names, paths, Workspace names, Session titles, and raw DSH/Git errors keep their
|
|
262
|
+
original values.
|
|
214
263
|
- Existing Sessions show read-only context in the form `Session title` → `Agent mode` →
|
|
215
264
|
`current branch / Worktree branch`. Long values remain ellipsized in the compact chip and show
|
|
216
265
|
their complete value in a hover card. The blank Hero shows `Workspace (branch)` after the native
|
|
@@ -254,6 +303,7 @@ an independent sidecar store and may contain only relationship facts such as:
|
|
|
254
303
|
|
|
255
304
|
- `projectId`, `worktreeId`, and `sessionId`;
|
|
256
305
|
- an absolute Worktree path, branch, and lifecycle state;
|
|
306
|
+
- the Worktree source (`plugin` or `external`);
|
|
257
307
|
- binding status and schema version.
|
|
258
308
|
|
|
259
309
|
The index is not written into a Project working tree or DSH's raw data directory. It does not
|
|
@@ -273,15 +323,16 @@ does not change the sidecar state, so the relationship remains retryable. Sessio
|
|
|
273
323
|
the native DSH API before binding; a binding failure never deletes or modifies the already-created
|
|
274
324
|
Session.
|
|
275
325
|
|
|
276
|
-
The
|
|
277
|
-
|
|
278
|
-
attach
|
|
279
|
-
projection is replayed after native list refreshes and removed when the binding
|
|
280
|
-
Client is disposed.
|
|
326
|
+
The Worktree session flow sends the independent Worktree cwd through the upstream DSH runtime and
|
|
327
|
+
keeps `{ workspaceId, sessionId }` as a browser-local membership projection rather than a
|
|
328
|
+
persistent DSH attach. It does not modify DSH source, Session metadata, or native Workspace
|
|
329
|
+
storage. The projection is replayed after native list refreshes and removed when the binding
|
|
330
|
+
disappears or the Client is disposed.
|
|
281
331
|
|
|
282
|
-
The blank Hero context is visual only. Because
|
|
283
|
-
placement depends on the native `[data-phase="hero"]` and title
|
|
284
|
-
anchors are unavailable and should move to a formal DSH slot
|
|
332
|
+
The blank Hero context is visual only. Because the current upstream DSH source checkout has no
|
|
333
|
+
additive Hero headline slot, its placement depends on the native `[data-phase="hero"]` and title
|
|
334
|
+
anchors; it disappears when those anchors are unavailable and should move to a formal DSH slot
|
|
335
|
+
when one exists.
|
|
285
336
|
|
|
286
337
|
## Development and verification
|
|
287
338
|
|
package/README.zh.md
CHANGED
|
@@ -12,15 +12,25 @@ Session 元数据、原生列表和会话历史的唯一事实来源。插件只
|
|
|
12
12
|
中文截图展示了侧边栏中的 Worktree 模式、包含 Main 和 Worktree 行的 Workspace 树,以及
|
|
13
13
|
新会话空白 Hero 中的只读上下文。
|
|
14
14
|
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
导入截图展示了现有 Workspace `+` 弹窗:默认选中创建,旁边是导入 Tab,并在普通下拉框中
|
|
18
|
+
使用安全的示例 branch 和路径值。
|
|
19
|
+
|
|
15
20
|
## 能力
|
|
16
21
|
|
|
17
22
|
- 从 DSH Sidebar footer 进入 Worktree 模式,按 Workspace → Worktree → Session 浏览会话。
|
|
18
23
|
- 搜索 Workspace,并从已有 local branch 创建 Git Worktree 和 branch。
|
|
24
|
+
- 在同一个弹窗中选择导入,发现与当前 Workspace repository 关联、尚未由 sidecar 管理且绑定 branch 的 Git Worktree。第一版不展示 repository root 和 detached HEAD 条目。
|
|
25
|
+
- 导入只登记已有 Worktree,不移动、复制或编辑其目录;记录使用 `source: external`,之后与 plugin 创建的记录共享 Session、binding、health、排序、cwd、projection、刷新和恢复流程。
|
|
26
|
+
- plugin 创建和导入的 Worktree 都通过真实的 `git worktree remove` 移除;移除导入的 Worktree 可能删除其关联目录,确认弹窗会明确提示。
|
|
19
27
|
- 在 Main 或 active Worktree 下创建普通 Session 或 Worktree Session,并直接打开新会话。
|
|
20
28
|
- 查看 ready、repair、active 和 detached Worktree 状态,包括可重试的操作错误。
|
|
21
29
|
- 通过 active Worktree 的选项菜单和确认弹窗移除 Worktree;Main 和 detached 行不显示该菜单。
|
|
22
30
|
- 继续使用 DSH 原生的 Workspace rename/delete/reorder 和 Session 菜单。Worktree 可以在所属
|
|
23
31
|
Workspace 内排序;顺序保存在插件 sidecar 中,Main 固定在第一位。
|
|
32
|
+
- 将 Workspace、Main 和 Worktree 的展开选择保存到浏览器本地存储;Session 五行溢出展开保持临时状态,并在刷新或父级折叠后重置。
|
|
33
|
+
- 在 Worktree view 高亮 DSH 当前 Session;进入 Worktree 模式或切换当前会话时,临时展开其 Workspace/Main/Worktree 路径和 Session 五行溢出,清空隐藏它的搜索并滚动定位;这一浏览器本地行为不改变已保存的展开选择。
|
|
24
34
|
- 在已有 Conversation 的标题行以及新会话空白 Hero 中,以只读方式显示当前 local branch 或
|
|
25
35
|
Worktree branch 上下文。
|
|
26
36
|
- 在同一个 Session 的 snapshot 更新以及 Session 切换期间保持 Conversation 和 Hero 上下文
|
|
@@ -32,7 +42,10 @@ Session 元数据、原生列表和会话历史的唯一事实来源。插件只
|
|
|
32
42
|
|
|
33
43
|
### 兼容性与前置条件
|
|
34
44
|
|
|
35
|
-
-
|
|
45
|
+
- 开发和源码验证应使用官方 [DeepSeek Harness 仓库](https://github.com/deepseek-ai/deepseek-harness)
|
|
46
|
+
的干净 checkout,并跟随仓库当前默认分支。该仓库当前使用 `master` 而不是 `main`,且仍是
|
|
47
|
+
developer preview,package 和 API contract 可能变化;在向 profile 安装本 plugin 前,先完成
|
|
48
|
+
upstream 的安装和构建步骤。
|
|
36
49
|
- 目标 profile(例如 `web` 或 `demo`)必须已经可以正常启动,且 plugin 必须安装到实际
|
|
37
50
|
启动 Web UI 的同一个 profile。
|
|
38
51
|
- DSH Client 必须提供原生 `@deepseek-ai/dsh-client-ui-conversation` package 及其
|
|
@@ -73,6 +86,20 @@ pnpm dsh web
|
|
|
73
86
|
npm view @cerbur/clutch-dsh-worktree version --registry=https://registry.npmjs.org/
|
|
74
87
|
```
|
|
75
88
|
|
|
89
|
+
### 准备当前 upstream DSH checkout
|
|
90
|
+
|
|
91
|
+
进行源码开发或验证时,先准备 upstream checkout。当前 upstream 默认分支是 `master`;如果仓库
|
|
92
|
+
未来切换默认分支,应跟随仓库的当前默认分支。
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
git clone https://github.com/deepseek-ai/deepseek-harness.git
|
|
96
|
+
cd deepseek-harness
|
|
97
|
+
git fetch origin
|
|
98
|
+
git pull --ff-only origin master
|
|
99
|
+
pnpm install
|
|
100
|
+
pnpm run build
|
|
101
|
+
```
|
|
102
|
+
|
|
76
103
|
### 从仓库 checkout 安装
|
|
77
104
|
|
|
78
105
|
先从 `clutch-dsh` checkout 构建 package,再把绝对路径安装到 DSH profile:
|
|
@@ -170,12 +197,26 @@ pnpm dsh plugin --profile web remove @cerbur/clutch-dsh-worktree
|
|
|
170
197
|
的可复制 setup 命令修复后重试。插件只展示这些提示,不会执行 setup 或安装命令或编辑
|
|
171
198
|
业务文件。
|
|
172
199
|
|
|
200
|
+
### 导入已有 Worktree
|
|
201
|
+
|
|
202
|
+
1. 选择 Workspace,点击旁边的 `+`,再选择 `导入` Tab。弹窗通过现有 DSH `/api` Connection
|
|
203
|
+
加载该 repository 的 Git Worktree 候选项。
|
|
204
|
+
2. 第一版只列出绑定 branch、不是 repository root、且未出现在 plugin sidecar 中的 Worktree。
|
|
205
|
+
detached HEAD 会被省略;候选项通过普通下拉框选择,每个选项先显示 branch,再显示绝对路径
|
|
206
|
+
作为诊断信息。
|
|
207
|
+
3. 在下拉框中选择一个选项并点击 `导入 Worktree`。登记只写入 plugin sidecar,已有 Worktree 目录和 Git
|
|
208
|
+
工作状态保持不变。随后会在该 Worktree cwd 创建或复用 Session,并执行与创建相同的
|
|
209
|
+
`bind → membership projection → open → refresh` 流程。
|
|
210
|
+
4. 同一 Workspace、同一物理路径的 active external 导入是幂等的。已经由 plugin 管理的路径
|
|
211
|
+
返回 `WORKTREE_ALREADY_MANAGED`;无效或过期候选项返回 `WORKTREE_IMPORT_INVALID`,修复
|
|
212
|
+
repository 状态后可以重试。
|
|
213
|
+
|
|
173
214
|
### 创建 Main 和 Worktree Session
|
|
174
215
|
|
|
175
216
|
- 使用 Main 的 `+`,在 Project 根目录视角中创建普通 DSH Session。
|
|
176
|
-
- 使用 Worktree 的 `+`,创建或复用 runtime cwd 指向该 Worktree 的 Session
|
|
177
|
-
|
|
178
|
-
|
|
217
|
+
- 使用 Worktree 的 `+`,创建或复用 runtime cwd 指向该 Worktree 的 Session。插件通过 upstream
|
|
218
|
+
runtime 调用 `session.create({ cwd: worktreePath })`,随后保存外部 binding,在当前浏览器内
|
|
219
|
+
应用 `{ workspaceId, sessionId }` membership projection,并打开该 Session。
|
|
179
220
|
- 如果存在目标 cwd 完全匹配的未归档 blank Session,连接器会优先复用它。已绑定的 Session
|
|
180
221
|
会直接打开;未绑定的候选会先 binding,再 projection 和打开。否则执行
|
|
181
222
|
`create → bind → project → open`,同一个 Worktree 的并发点击会合并。
|
|
@@ -191,14 +232,18 @@ pnpm dsh plugin --profile web remove @cerbur/clutch-dsh-worktree
|
|
|
191
232
|
Main 是固定的第一行,Worktree 不能跨 Workspace 移动。
|
|
192
233
|
- 使用 active Worktree 的选项菜单和确认弹窗移除 Worktree。Main 和 detached Worktree 不显示
|
|
193
234
|
该菜单。
|
|
235
|
+
- 导入的 Worktree 与 plugin 创建的 Worktree 显示相同的 active 选项菜单。两种来源都执行真实
|
|
236
|
+
`git worktree remove`;导入项的确认文案会警告关联 Worktree 目录可能被删除。Session 会
|
|
237
|
+
保留为 detached binding。
|
|
194
238
|
- 移除 Worktree 不会删除其 Session。关系会保留为 detached,直到显式解绑。删除 Workspace
|
|
195
239
|
只会删除 DSH 的 Workspace registration;其目录、Session、Git Worktree 和 plugin
|
|
196
240
|
sidecar 会保留。
|
|
197
241
|
- DSH 原生的 Workspace rename/delete/reorder 和 Session 菜单继续可用。Session 拖动排序
|
|
198
242
|
限定在当前视觉 Main 或 Worktree 分组中。
|
|
199
243
|
- Main 分组显示当前 local branch:有分支时为 `本地(branch)`,DSH 没有返回当前分支时
|
|
200
|
-
回退为
|
|
201
|
-
|
|
244
|
+
回退为 `本地`。如果导入的 Workspace 是 Git 仓库中的子目录,会先解析 Git 根目录,再
|
|
245
|
+
复用与 Git 根目录相同的 branch/worktree 信息。branch 名称、路径、Workspace 名称、Session
|
|
246
|
+
标题以及原始 DSH/Git 错误信息保持原值。
|
|
202
247
|
- 已有 Session 会在标题行显示只读上下文,格式为 `Session title` → `Agent mode` →
|
|
203
248
|
`current branch / Worktree branch`。过长值在紧凑 chip 中折叠,并通过 hover card 显示完整
|
|
204
249
|
内容。原生标题存在且有锚点时,新会话空白 Hero 会在标题后显示 `Workspace (branch)`,并
|
|
@@ -237,6 +282,7 @@ DSH 管理原始 Project/Workspace 身份和根目录、Session 身份和元数
|
|
|
237
282
|
|
|
238
283
|
- `projectId`、`worktreeId` 和 `sessionId`;
|
|
239
284
|
- 绝对 Worktree 路径、branch 和生命周期状态;
|
|
285
|
+
- Worktree 来源(`plugin` 或 `external`);
|
|
240
286
|
- binding 状态和 schema version。
|
|
241
287
|
|
|
242
288
|
索引不会写入 Project 工作树或 DSH 原始数据目录,也不会保存 `projectRoot` 副本或任何
|
|
@@ -252,14 +298,14 @@ Worktree binding 使用对应的 Worktree 路径。cwd 在每次执行时派生
|
|
|
252
298
|
创建的 Git Worktree。删除 Worktree 失败时不会改变 sidecar 状态,因此关系仍可重试。创建
|
|
253
299
|
Session 时先调用 DSH 原生 API,再写入 binding;binding 失败不会删除或修改已创建的 Session。
|
|
254
300
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
Session metadata 或原生 Workspace 存储。native list
|
|
258
|
-
|
|
301
|
+
Worktree Session 流程将独立的 Worktree cwd 交给 upstream DSH runtime,并将
|
|
302
|
+
`{ workspaceId, sessionId }` 保持为浏览器本地 membership projection,而不是持久化的 DSH
|
|
303
|
+
attach。它不会修改 DSH 源码、Session metadata 或原生 Workspace 存储。native list 刷新后会
|
|
304
|
+
重放 projection;binding 消失或 Client dispose 时会移除 projection。
|
|
259
305
|
|
|
260
|
-
空白 Hero
|
|
261
|
-
`[data-phase="hero"]`
|
|
262
|
-
|
|
306
|
+
空白 Hero 上下文只用于展示。由于当前 upstream DSH source checkout 没有 additive Hero
|
|
307
|
+
headline slot,它的位置依赖原生 `[data-phase="hero"]` 和标题锚点;锚点不可用时浮层会消失,
|
|
308
|
+
未来有正式 DSH slot 时应迁移到该 slot。
|
|
263
309
|
|
|
264
310
|
## 开发与验证
|
|
265
311
|
|
|
@@ -4,7 +4,7 @@ import { WORKTREE_NS } from './locales.js';
|
|
|
4
4
|
export type WorktreeHeroContextProps = PropsRuntime<'shell.overlay'> & PropsLocale<typeof WORKTREE_NS> & InjectFace<WorktreeContextInjected>;
|
|
5
5
|
/**
|
|
6
6
|
* Browser-local Hero suffix. It intentionally uses the frame overlay because
|
|
7
|
-
*
|
|
7
|
+
* The current upstream DSH exposes no additive slot beside the native Hero headline.
|
|
8
8
|
*/
|
|
9
9
|
export declare function WorktreeHeroContext({ useWorktreeContext, t, }: WorktreeHeroContextProps): import("react").JSX.Element | null;
|
|
10
10
|
//# sourceMappingURL=WorktreeHeroContext.d.ts.map
|
|
@@ -71,7 +71,7 @@ function contextAriaLabel(state, t) {
|
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* Browser-local Hero suffix. It intentionally uses the frame overlay because
|
|
74
|
-
*
|
|
74
|
+
* The current upstream DSH exposes no additive slot beside the native Hero headline.
|
|
75
75
|
*/
|
|
76
76
|
export function WorktreeHeroContext({ useWorktreeContext, t, }) {
|
|
77
77
|
const state = useWorktreeContext((snapshot) => snapshot);
|
|
@@ -4,5 +4,5 @@ export type { WorktreeSurfaceInjected, WorktreeSurfaceProps, } from './worktree-
|
|
|
4
4
|
* Peer Worktree navigation surface. It keeps the original DSH Workspace mode
|
|
5
5
|
* intact and renders a browser-local Workspace → Worktree → Session projection.
|
|
6
6
|
*/
|
|
7
|
-
export declare function WorktreeSurface({ useStore, actions, useSessions, useWorkspaces, t, available, manager, invalidateWorktreeContext, createWorkspace, createSessionForWorktree: createSessionCallback, createMainSession, renameWorkspace, deleteWorkspace, insertWorkspaceBefore, insertSessionBefore, insertWorktreeBefore, renameSession, forkSession, archiveSession, ensureSessionWorkspace, syncSessionWorkspaces, openSession, }: WorktreeSurfaceProps): import("react").JSX.Element | null;
|
|
7
|
+
export declare function WorktreeSurface({ useStore, actions, useSessions, useWorkspaces, t, available, expandState, manager, invalidateWorktreeContext, createWorkspace, createSessionForWorktree: createSessionCallback, createMainSession, renameWorkspace, deleteWorkspace, insertWorkspaceBefore, insertSessionBefore, insertWorktreeBefore, renameSession, forkSession, archiveSession, ensureSessionWorkspace, syncSessionWorkspaces, openSession, }: WorktreeSurfaceProps): import("react").JSX.Element | null;
|
|
8
8
|
//# sourceMappingURL=WorktreeSurface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorktreeSurface.d.ts","sourceRoot":"","sources":["../../src/client/WorktreeSurface.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WorktreeSurface.d.ts","sourceRoot":"","sources":["../../src/client/WorktreeSurface.tsx"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAQV,oBAAoB,EAQrB,MAAM,6BAA6B,CAAC;AAsBrC,YAAY,EACV,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AAwBrC;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,OAAO,EACP,WAAW,EACX,aAAa,EACb,CAAC,EACD,SAAS,EACT,WAAW,EACX,OAAO,EACP,yBAAyB,EACzB,eAAe,EACf,wBAAwB,EAAE,qBAAqB,EAC/C,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,WAAW,EACX,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,WAAW,GACZ,EAAE,oBAAoB,sCAu5CtB"}
|