@cerbur/clutch-dsh-worktree 0.1.3 → 0.1.4
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 +247 -107
- package/README.zh.md +297 -0
- package/lib/client/WorktreeSurface.d.ts +2 -30
- package/lib/client/WorktreeSurface.d.ts.map +1 -1
- package/lib/client/WorktreeSurface.js +31 -318
- package/lib/client/WorktreeSurface.js.map +1 -1
- package/lib/client/worktree-surface-dialogs.d.ts +7 -0
- package/lib/client/worktree-surface-dialogs.d.ts.map +1 -0
- package/lib/client/worktree-surface-dialogs.js +86 -0
- package/lib/client/worktree-surface-dialogs.js.map +1 -0
- package/lib/client/worktree-surface-rows.d.ts +9 -0
- package/lib/client/worktree-surface-rows.d.ts.map +1 -0
- package/lib/client/worktree-surface-rows.js +223 -0
- package/lib/client/worktree-surface-rows.js.map +1 -0
- package/lib/client/worktree-surface-selectors.d.ts +9 -0
- package/lib/client/worktree-surface-selectors.d.ts.map +1 -0
- package/lib/client/worktree-surface-selectors.js +28 -0
- package/lib/client/worktree-surface-selectors.js.map +1 -0
- package/lib/client/worktree-surface-types.d.ts +233 -0
- package/lib/client/worktree-surface-types.d.ts.map +1 -0
- package/lib/client/worktree-surface-types.js +2 -0
- package/lib/client/worktree-surface-types.js.map +1 -0
- package/lib/client/worktree-view-actions.d.ts +34 -0
- package/lib/client/worktree-view-actions.d.ts.map +1 -0
- package/lib/client/worktree-view-actions.js +69 -0
- package/lib/client/worktree-view-actions.js.map +1 -0
- package/lib/client/worktree-view-errors.d.ts +20 -0
- package/lib/client/worktree-view-errors.d.ts.map +1 -0
- package/lib/client/worktree-view-errors.js +65 -0
- package/lib/client/worktree-view-errors.js.map +1 -0
- package/lib/client/worktree-view-read.d.ts +48 -0
- package/lib/client/worktree-view-read.d.ts.map +1 -0
- package/lib/client/worktree-view-read.js +134 -0
- package/lib/client/worktree-view-read.js.map +1 -0
- package/lib/client/worktree-view.d.ts +4 -97
- package/lib/client/worktree-view.d.ts.map +1 -1
- package/lib/client/worktree-view.js +4 -263
- package/lib/client/worktree-view.js.map +1 -1
- package/lib/client.js +404 -324
- package/lib/client.js.map +1 -1
- package/lib/manage/manager-context.d.ts +11 -0
- package/lib/manage/manager-context.d.ts.map +1 -0
- package/lib/manage/manager-context.js +2 -0
- package/lib/manage/manager-context.js.map +1 -0
- package/lib/manage/manager-sessions.d.ts +18 -0
- package/lib/manage/manager-sessions.d.ts.map +1 -0
- package/lib/manage/manager-sessions.js +91 -0
- package/lib/manage/manager-sessions.js.map +1 -0
- package/lib/manage/manager-support.d.ts +18 -0
- package/lib/manage/manager-support.d.ts.map +1 -0
- package/lib/manage/manager-support.js +174 -0
- package/lib/manage/manager-support.js.map +1 -0
- package/lib/manage/manager-worktrees.d.ts +27 -0
- package/lib/manage/manager-worktrees.d.ts.map +1 -0
- package/lib/manage/manager-worktrees.js +259 -0
- package/lib/manage/manager-worktrees.js.map +1 -0
- package/lib/manage/manager.d.ts +23 -65
- package/lib/manage/manager.d.ts.map +1 -1
- package/lib/manage/manager.js +32 -565
- package/lib/manage/manager.js.map +1 -1
- package/lib/provider/sidecar-persistence.d.ts +18 -0
- package/lib/provider/sidecar-persistence.d.ts.map +1 -0
- package/lib/provider/sidecar-persistence.js +162 -0
- package/lib/provider/sidecar-persistence.js.map +1 -0
- package/lib/provider/sidecar-schema.d.ts +6 -0
- package/lib/provider/sidecar-schema.d.ts.map +1 -0
- package/lib/provider/sidecar-schema.js +123 -0
- package/lib/provider/sidecar-schema.js.map +1 -0
- package/lib/provider/sidecar.d.ts +10 -67
- package/lib/provider/sidecar.d.ts.map +1 -1
- package/lib/provider/sidecar.js +21 -346
- package/lib/provider/sidecar.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,51 +1,87 @@
|
|
|
1
1
|
# @cerbur/clutch-dsh-worktree
|
|
2
2
|
|
|
3
|
-
`@cerbur/clutch-dsh-worktree`
|
|
3
|
+
`@cerbur/clutch-dsh-worktree` adds a Git Worktree view to the DSH Web UI. It groups
|
|
4
|
+
Sessions as Workspace → Worktree → Session while keeping DSH as the source of truth for
|
|
5
|
+
Project/Workspace identity, Session metadata, native lists, and conversation history.
|
|
6
|
+
The plugin stores only external Worktree/Session relationship metadata.
|
|
7
|
+
|
|
8
|
+
## Screenshots
|
|
9
|
+
|
|
10
|
+

|
|
11
|
+
|
|
12
|
+
The English screenshot shows Worktree mode in the Sidebar, a Workspace tree with Main and
|
|
13
|
+
Worktree rows, and the read-only blank-session Hero context.
|
|
14
|
+
|
|
15
|
+
## Capabilities
|
|
16
|
+
|
|
17
|
+
- Enter Worktree mode from the DSH Sidebar footer and browse Workspace → Worktree → Session.
|
|
18
|
+
- Search Workspaces and create a Git Worktree and branch from an existing local branch.
|
|
19
|
+
- Create a normal Session from Main or a Session whose runtime cwd is an active Worktree, then
|
|
20
|
+
open it directly.
|
|
21
|
+
- See ready, repair, active, and detached Worktree states, including retryable operation errors.
|
|
22
|
+
- Remove an active Worktree from its options menu with confirmation. Main and detached rows do
|
|
23
|
+
not expose that menu.
|
|
24
|
+
- Continue using DSH-native Workspace rename/delete/reorder and Session menus. Worktree rows can
|
|
25
|
+
be reordered within their owning Workspace; order is stored in the plugin sidecar and Main is
|
|
26
|
+
fixed first.
|
|
27
|
+
- Keep the current local branch or Worktree branch visible as read-only context in the existing
|
|
28
|
+
Conversation title row and in the blank-session Hero.
|
|
29
|
+
- Keep Worktree Sessions in the original DSH Project/Workspace view; the plugin does not copy
|
|
30
|
+
Session content or modify messages, prompts, transcripts, or history.
|
|
31
|
+
|
|
32
|
+
### Compatibility and prerequisites
|
|
33
|
+
|
|
34
|
+
- The DSH CLI and the target Web profile must use `dsh-v0.1.0-rc.8`.
|
|
35
|
+
- The target profile, such as `web` or `demo`, must already start successfully, and the plugin
|
|
36
|
+
must be installed into the same profile that launches the Web UI.
|
|
37
|
+
- DSH Client must provide the native `@deepseek-ai/dsh-client-ui-conversation` package and its
|
|
38
|
+
`conversation.session.header.actions` seat.
|
|
39
|
+
- A Workspace must be inside a Git repository with an initial commit and at least one local
|
|
40
|
+
branch. If a prerequisite is missing, the create dialog shows copyable setup commands; the
|
|
41
|
+
plugin does not run them or modify Workspace files.
|
|
42
|
+
- The package declares an installable `dsh.bundle` and provides `cordis.patch.yml`; its browser
|
|
43
|
+
UI is declared through the `dsh.client` metadata.
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
47
|
+
Use the npm package for the normal user installation. Use a repository checkout to develop or
|
|
48
|
+
validate local source, or use the GitHub source path when installing the source package through a
|
|
49
|
+
marketplace entry.
|
|
50
|
+
|
|
51
|
+
### Install from npm (recommended)
|
|
52
|
+
|
|
53
|
+
With an installed DSH CLI:
|
|
4
54
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## 功能
|
|
10
|
-
|
|
11
|
-
从 DSH Sidebar footer 打开 Worktree mode 后,可以:
|
|
12
|
-
|
|
13
|
-
- 按 Workspace → Worktree → Session 查看会话;
|
|
14
|
-
- 搜索 Workspace,并从已有 local branch 创建新的 Git Worktree 和 branch;
|
|
15
|
-
- 在 Main 或指定 Worktree 下创建 Session,并直接打开新 Session;
|
|
16
|
-
- 查看 active、detached 和 repair 状态;
|
|
17
|
-
- 通过 active Worktree 的选项菜单移除 Worktree,并在确认弹窗中完成操作;
|
|
18
|
-
- 继续使用 DSH 原生的 Workspace rename/delete/reorder 和 Session 菜单、排序能力;Worktree 可在所属 Workspace 内拖动排序,顺序持久化在 plugin sidecar,Main 固定在第一位。
|
|
19
|
-
- 在已有 Session 的 Conversation 标题行显示只读上下文:`Session title → Agent mode → current branch / Worktree branch`。
|
|
20
|
-
- 在新建会话的 Hero 标题后以只读浮层显示 `Workspace (current branch / Worktree branch)`;重新选择 Workspace 后随当前分支上下文更新。
|
|
21
|
-
|
|
22
|
-
Worktree Session 仍属于原始 DSH Project/Workspace,因此切回原生 Project/Session 视角时仍可由 DSH 展示。插件不复制 Session 内容,也不修改消息、prompt、transcript 或历史记录。
|
|
55
|
+
```bash
|
|
56
|
+
dsh plugin --profile web add @cerbur/clutch-dsh-worktree
|
|
57
|
+
dsh web
|
|
58
|
+
```
|
|
23
59
|
|
|
24
|
-
|
|
60
|
+
When using a `deepseek-harness` source checkout without a standalone `dsh` command, use the
|
|
61
|
+
equivalent forwarding form:
|
|
25
62
|
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
63
|
+
```bash
|
|
64
|
+
cd /path/to/deepseek-harness
|
|
65
|
+
pnpm dsh plugin --profile web add @cerbur/clutch-dsh-worktree
|
|
66
|
+
pnpm dsh web
|
|
67
|
+
```
|
|
31
68
|
|
|
32
|
-
|
|
69
|
+
To inspect the currently published version on the official registry:
|
|
33
70
|
|
|
34
|
-
|
|
71
|
+
```bash
|
|
72
|
+
npm view @cerbur/clutch-dsh-worktree version --registry=https://registry.npmjs.org/
|
|
73
|
+
```
|
|
35
74
|
|
|
36
|
-
###
|
|
75
|
+
### Install from a repository checkout
|
|
37
76
|
|
|
38
|
-
|
|
77
|
+
Build the package from the `clutch-dsh` checkout, then install its absolute path into the DSH
|
|
78
|
+
profile:
|
|
39
79
|
|
|
40
80
|
```bash
|
|
41
81
|
cd /path/to/clutch-dsh
|
|
42
82
|
pnpm install
|
|
43
83
|
pnpm --filter @cerbur/clutch-dsh-worktree build
|
|
44
|
-
```
|
|
45
84
|
|
|
46
|
-
再在本地 `deepseek-harness` 根目录构建 DSH,并把 package 安装到目标 profile:
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
85
|
cd /path/to/deepseek-harness
|
|
50
86
|
pnpm install
|
|
51
87
|
pnpm run build
|
|
@@ -54,101 +90,191 @@ pnpm dsh web --dump-config
|
|
|
54
90
|
pnpm dsh web
|
|
55
91
|
```
|
|
56
92
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
如果 profile 之前安装过旧的 unscoped package,先移除旧条目:
|
|
93
|
+
The `--dump-config` output should include the plugin bundle layer. If the profile still contains
|
|
94
|
+
an old unscoped installation, remove it first:
|
|
60
95
|
|
|
61
96
|
```bash
|
|
62
97
|
pnpm dsh plugin --profile web remove clutch-dsh-worktree
|
|
63
98
|
```
|
|
64
99
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
已发布的 package 可以直接通过 DSH CLI 安装:
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
dsh plugin --profile web add @cerbur/clutch-dsh-worktree
|
|
71
|
-
dsh web
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
如果使用的是 `deepseek-harness` 源码 checkout、系统没有独立的 `dsh` 命令,使用等价的转发形式:
|
|
100
|
+
To update a local checkout, rebuild the package and restart DSH:
|
|
75
101
|
|
|
76
102
|
```bash
|
|
103
|
+
cd /path/to/clutch-dsh
|
|
104
|
+
pnpm --filter @cerbur/clutch-dsh-worktree build
|
|
77
105
|
cd /path/to/deepseek-harness
|
|
78
|
-
pnpm dsh plugin --profile web add @cerbur/clutch-dsh-worktree
|
|
79
106
|
pnpm dsh web
|
|
80
107
|
```
|
|
81
108
|
|
|
82
|
-
|
|
109
|
+
After changing `package.json`, `cordis.patch.yml`, or the profile bundle members, run the plugin
|
|
110
|
+
add command again.
|
|
111
|
+
|
|
112
|
+
### Install from GitHub source
|
|
113
|
+
|
|
114
|
+
The source path generated by `awesome-dsh-plugin` is:
|
|
83
115
|
|
|
84
116
|
```bash
|
|
85
|
-
|
|
117
|
+
dsh plugin --profile web add "github:Cerbur/clutch-dsh#path:/packages/clutch-dsh-worktree"
|
|
86
118
|
```
|
|
87
119
|
|
|
88
|
-
|
|
120
|
+
This is a source Git dependency, not a prebuilt npm package. Its `prepare` lifecycle generates
|
|
121
|
+
`lib/`. The current DSH profile uses pnpm 11 `allowBuilds`: on the first Git installation, pnpm
|
|
122
|
+
intentionally rejects the build and prints a complete key containing the package name, Git URL,
|
|
123
|
+
resolved commit, and subdirectory path. Copy that complete key into the profile's
|
|
124
|
+
`pnpm-workspace.yaml`, for example:
|
|
89
125
|
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
cd /path/to/deepseek-harness
|
|
94
|
-
pnpm dsh web
|
|
126
|
+
```yaml
|
|
127
|
+
allowBuilds:
|
|
128
|
+
'@cerbur/clutch-dsh-worktree@git+https://github.com/Cerbur/clutch-dsh#<resolved-commit>&path:/packages/clutch-dsh-worktree': true
|
|
95
129
|
```
|
|
96
130
|
|
|
97
|
-
|
|
131
|
+
Use the exact package key printed by pnpm: `<resolved-commit>`, the Git URL, and the path must
|
|
132
|
+
match the error output. A package-name-only entry is not enough for a direct Git dependency, and
|
|
133
|
+
`onlyBuiltDependencies` is not the configuration used by the current pnpm 11 Git prepare flow.
|
|
134
|
+
After saving the allowlist, rerun the original install command. A new commit requires a new key.
|
|
135
|
+
The allowlist belongs to the profile owner who trusts that Git commit; do not add it to this
|
|
136
|
+
plugin package.
|
|
98
137
|
|
|
99
|
-
|
|
138
|
+
After authorization, Git prepare runs `pnpm install` in the checked-out monorepo and then
|
|
139
|
+
`pnpm run build`, so the profile must be able to reach its configured registry. Registry DNS,
|
|
140
|
+
mirror, or lockfile errors after authorization are installation-environment errors, not
|
|
141
|
+
`allowBuilds` rejections. Use the npm installation above to avoid source-build authorization.
|
|
142
|
+
|
|
143
|
+
### Uninstall
|
|
100
144
|
|
|
101
145
|
```bash
|
|
102
146
|
cd /path/to/deepseek-harness
|
|
103
147
|
pnpm dsh plugin --profile web remove @cerbur/clutch-dsh-worktree
|
|
104
148
|
```
|
|
105
149
|
|
|
106
|
-
##
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
Workspace
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
+
## Usage
|
|
151
|
+
|
|
152
|
+
### Open Worktree mode
|
|
153
|
+
|
|
154
|
+
1. Start the DSH Web UI and select Worktree from the Sidebar footer. Worktree mode is an
|
|
155
|
+
additive surface; it does not add a separate Workspace/Worktree tab.
|
|
156
|
+
2. Use the Workspace tree to search, expand, and select the Main or Worktree view. Each group
|
|
157
|
+
initially shows five rows; use Expand more/Collapse for additional rows.
|
|
158
|
+
|
|
159
|
+

|
|
160
|
+
|
|
161
|
+
The screenshot above illustrates the Sidebar entry point and the visual context shown in the
|
|
162
|
+
blank-session Hero. The displayed language follows DSH's current language setting.
|
|
163
|
+
|
|
164
|
+
### Create a Worktree
|
|
165
|
+
|
|
166
|
+
1. Select a Workspace, press its `+`, choose a baseline local branch, and enter a Worktree name.
|
|
167
|
+
The default branch name is `dsh/<8-character-random-string>`.
|
|
168
|
+
2. The target Worktree path must be absolute, belong to the same Project, and differ from the
|
|
169
|
+
Project root. Relative paths, a different Project, or the Project root are rejected.
|
|
170
|
+
3. If Git, an initial commit, or a local branch is missing, follow the copyable commands in the
|
|
171
|
+
dialog and retry. The plugin only renders those commands; it does not run them or edit
|
|
172
|
+
business files.
|
|
173
|
+
|
|
174
|
+
### Create Main and Worktree Sessions
|
|
175
|
+
|
|
176
|
+
- Use Main's `+` to create a normal DSH Session in the Project-root view.
|
|
177
|
+
- Use a Worktree's `+` to create or reuse a Session with that Worktree as its runtime cwd. On
|
|
178
|
+
rc.8, the native call is `session.create({ cwd: worktreePath })`; the plugin then saves the
|
|
179
|
+
external binding, applies a browser-local `{ workspaceId, sessionId }` membership projection,
|
|
180
|
+
and opens the Session.
|
|
181
|
+
- The connector reuses an unarchived blank Session with the exact target cwd when possible. An
|
|
182
|
+
already-bound Session opens directly; an unbound candidate is bound before projection and
|
|
183
|
+
opening. Otherwise the flow is `create → bind → project → open`, and concurrent clicks for the
|
|
184
|
+
same Worktree are coalesced.
|
|
185
|
+
- If binding fails after DSH has created the Session, the Session ID remains available for Retry
|
|
186
|
+
or Open recovery. The plugin does not delete or mutate that DSH Session.
|
|
187
|
+
- A provisional blank Session follows DSH's native display rules: it is shown only in the
|
|
188
|
+
selected view, uses the localized `New Session` label, hides its generated ID, and has no
|
|
189
|
+
Rename, Fork, or Archive menu. After the first prompt is accepted, it becomes an ordinary
|
|
190
|
+
Session row; hiding the blank row does not delete the Session or its Worktree binding.
|
|
191
|
+
|
|
192
|
+
### Reorder and manage Worktrees
|
|
193
|
+
|
|
194
|
+
- Drag Worktrees within their owning Workspace. The ordered `worktrees` array is persisted in
|
|
195
|
+
the plugin sidecar; Main is a fixed first row and Worktrees cannot move across Workspaces.
|
|
196
|
+
- Use the active Worktree options menu and confirmation dialog to remove a Worktree. Main and
|
|
197
|
+
detached Worktrees do not show this menu.
|
|
198
|
+
- Removing a Worktree does not delete its Sessions. The relationship remains detached until it
|
|
199
|
+
is explicitly unbound. Deleting a Workspace removes only DSH's Workspace registration; its
|
|
200
|
+
directory, Sessions, Git Worktrees, and plugin sidecar remain.
|
|
201
|
+
- DSH-native Workspace rename/delete/reorder and Session menus remain available. Session drag
|
|
202
|
+
ordering is limited to the current visual Main or Worktree group.
|
|
203
|
+
- The Main group shows the current local branch as `Local (branch)` and falls back to `Local` if
|
|
204
|
+
DSH reports no current branch. Branch names, paths, Workspace names, Session titles, and raw
|
|
205
|
+
DSH/Git errors keep their original values.
|
|
206
|
+
- Existing Sessions show read-only context in the form `Session title` → `Agent mode` →
|
|
207
|
+
`current branch / Worktree branch`. The blank Hero shows `Workspace (branch)` after the native
|
|
208
|
+
title when its anchors are available.
|
|
209
|
+
|
|
210
|
+
### Understand status and recovery messages
|
|
211
|
+
|
|
212
|
+
- `ready` means the Worktree is available. `repair` identifies a missing or invalid Worktree,
|
|
213
|
+
Session, binding, or cwd. `detached` means the Git Worktree was removed while the relationship
|
|
214
|
+
was retained. An active binding pointing to a missing Worktree produces an explicit repair
|
|
215
|
+
warning or error; it never silently falls back to another Worktree.
|
|
216
|
+
- Worktree health is a runtime Git projection and is not written to the sidecar. Git readiness
|
|
217
|
+
failures are shown per Workspace with setup instructions; Connection, Gateway, and unexpected
|
|
218
|
+
Worktree-domain failures remain visible as retryable errors rather than empty lists.
|
|
219
|
+
- Refreshing an already-ready view preserves its current projection until replacement data is
|
|
220
|
+
available. Initial entry and explicit Retry may show a loading state.
|
|
221
|
+
|
|
222
|
+
## Language behavior
|
|
223
|
+
|
|
224
|
+
Worktree mode follows DSH's current interface language. DSH owns the language preference; the
|
|
225
|
+
plugin does not add an independent language setting. The Worktree entry point, Workspace →
|
|
226
|
+
Worktree → Session tree, menus, dialogs, statuses, and retry messages are localized in English
|
|
227
|
+
and Chinese.
|
|
228
|
+
|
|
229
|
+
Workspace names, Session titles, branch names, paths, and raw DSH/Host error messages remain
|
|
230
|
+
unchanged for diagnosis and continued use of native DSH data. The Main group is localized as
|
|
231
|
+
`Local (branch)` in English and `本地(branch)` in Chinese, with `Local`/`本地` as the fallback
|
|
232
|
+
when no current branch is reported.
|
|
233
|
+
|
|
234
|
+
## Data boundaries and current limitations
|
|
235
|
+
|
|
236
|
+
DSH owns the original Project/Workspace identity and root, Session identity and metadata, native
|
|
237
|
+
Project/Session lists, messages, prompts, transcripts, and history. The plugin does not copy or
|
|
238
|
+
rewrite any of those values. Its external index lives in the DSH host's plugin data directory or
|
|
239
|
+
an independent sidecar store and may contain only relationship facts such as:
|
|
240
|
+
|
|
241
|
+
- `projectId`, `worktreeId`, and `sessionId`;
|
|
242
|
+
- an absolute Worktree path, branch, and lifecycle state;
|
|
243
|
+
- binding status and schema version.
|
|
244
|
+
|
|
245
|
+
The index is not written into a Project working tree or DSH's raw data directory. It does not
|
|
246
|
+
store a copy of `projectRoot` or any Session content. If the sidecar is unavailable or corrupt,
|
|
247
|
+
the native Project/Session view remains readable and the plugin becomes degraded/read-only; an
|
|
248
|
+
empty index must never overwrite the native DSH lists.
|
|
249
|
+
|
|
250
|
+
Each Session has at most one active Worktree binding, while a Worktree may have multiple bound
|
|
251
|
+
Sessions. Rebinding the same Session to the same Worktree is idempotent; binding it to two active
|
|
252
|
+
Worktrees is a conflict. A Session with no binding, a Main binding, or a detached binding runs
|
|
253
|
+
with the Project root as cwd. An active Worktree binding runs with that Worktree path. The cwd is
|
|
254
|
+
derived for each execution and is never persisted back into DSH Session metadata.
|
|
255
|
+
|
|
256
|
+
Worktree creation creates the Git Worktree before recording its external relationship. If the
|
|
257
|
+
sidecar write fails, the new Git Worktree is cleaned up when possible. A failed Worktree deletion
|
|
258
|
+
does not change the sidecar state, so the relationship remains retryable. Session creation uses
|
|
259
|
+
the native DSH API before binding; a binding failure never deletes or modifies the already-created
|
|
260
|
+
Session.
|
|
261
|
+
|
|
262
|
+
The rc.8 `session.create` API cannot receive `workspaceId` and an independent cwd together. The
|
|
263
|
+
Worktree flow therefore uses a browser-local membership projection rather than a persistent DSH
|
|
264
|
+
attach, and it does not modify DSH source, Session metadata, or native Workspace storage. The
|
|
265
|
+
projection is replayed after native list refreshes and removed when the binding disappears or the
|
|
266
|
+
Client is disposed.
|
|
267
|
+
|
|
268
|
+
The blank Hero context is visual only. Because rc.8 has no additive Hero headline slot, its
|
|
269
|
+
placement depends on the native `[data-phase="hero"]` and title anchors; it disappears when those
|
|
270
|
+
anchors are unavailable and should move to a formal DSH slot when one exists.
|
|
271
|
+
|
|
272
|
+
## Development and verification
|
|
273
|
+
|
|
274
|
+
From the workspace root:
|
|
150
275
|
|
|
151
276
|
```bash
|
|
277
|
+
cd /path/to/clutch-dsh
|
|
152
278
|
pnpm install
|
|
153
279
|
pnpm run check:workspace
|
|
154
280
|
pnpm run check:patches
|
|
@@ -157,23 +283,37 @@ pnpm --filter @cerbur/clutch-dsh-worktree build
|
|
|
157
283
|
pnpm --filter @cerbur/clutch-dsh-worktree test
|
|
158
284
|
```
|
|
159
285
|
|
|
160
|
-
|
|
286
|
+
For the bilingual README contract and formatting:
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
cd /path/to/clutch-dsh/packages/clutch-dsh-worktree
|
|
290
|
+
node --test test/readme-parity.test.mjs
|
|
291
|
+
pnpm exec prettier --check README.md README.zh.md test/readme-parity.test.mjs
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
The full workspace check is:
|
|
161
295
|
|
|
162
296
|
```bash
|
|
297
|
+
cd /path/to/clutch-dsh
|
|
163
298
|
pnpm run check
|
|
164
299
|
```
|
|
165
300
|
|
|
166
|
-
|
|
301
|
+
Do not commit generated `lib/`, coverage, sidecar data, or local credentials. See [AGENTS.md](AGENTS.md)
|
|
302
|
+
for package data boundaries and lifecycle rules, [docs/RELEASING.md](docs/RELEASING.md) for
|
|
303
|
+
version and installation-source details, and [src/client/README.md](src/client/README.md) for
|
|
304
|
+
the browser Consumer boundary.
|
|
167
305
|
|
|
168
|
-
##
|
|
306
|
+
## Marketplace description
|
|
169
307
|
|
|
170
|
-
|
|
308
|
+
When submitting to `awesome-dsh-plugin`, use the `git` category and keep the description aligned
|
|
309
|
+
with the package:
|
|
171
310
|
|
|
172
311
|
```yaml
|
|
173
312
|
category: git
|
|
174
313
|
description:
|
|
175
314
|
en: Adds a Worktree view to DSH Web UI that groups Sessions by Git worktree while keeping DSH as the source of truth.
|
|
176
|
-
zh: 为 DSH Web UI 增加按 Git Worktree 组织 Session 的视角,同时继续由 DSH 管理原始 Project 和 Session 数据。
|
|
315
|
+
zh: 为 DSH Web UI 增加按 Git Worktree 组织 Session 的视角,同时继续由 DSH 管理原始 Project/Workspace 和 Session 数据。
|
|
177
316
|
```
|
|
178
317
|
|
|
179
|
-
|
|
318
|
+
Marketplace submission also requires external checks such as the `dsh-plugin` topic, repository
|
|
319
|
+
age, and commit count. A package README cannot set those external properties.
|