@cerbur/clutch-dsh-worktree 0.1.10 → 0.1.12

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 (153) hide show
  1. package/README.md +164 -241
  2. package/README.zh.md +141 -238
  3. package/assets/screenshots/screenshots-dashboard.webp +0 -0
  4. package/assets/screenshots/screenshots-en.png +0 -0
  5. package/assets/screenshots/screenshots-import.png +0 -0
  6. package/assets/screenshots/screenshots-zh.png +0 -0
  7. package/lib/client/WorktreeSurface.d.ts +1 -1
  8. package/lib/client/WorktreeSurface.d.ts.map +1 -1
  9. package/lib/client/WorktreeSurface.js +145 -9
  10. package/lib/client/WorktreeSurface.js.map +1 -1
  11. package/lib/client/dashboard/DashboardHeaderAction.d.ts +20 -0
  12. package/lib/client/dashboard/DashboardHeaderAction.d.ts.map +1 -0
  13. package/lib/client/dashboard/DashboardHeaderAction.js +19 -0
  14. package/lib/client/dashboard/DashboardHeaderAction.js.map +1 -0
  15. package/lib/client/dashboard/OpenInAppButton.d.ts +9 -0
  16. package/lib/client/dashboard/OpenInAppButton.d.ts.map +1 -0
  17. package/lib/client/dashboard/OpenInAppButton.js +123 -0
  18. package/lib/client/dashboard/OpenInAppButton.js.map +1 -0
  19. package/lib/client/dashboard/WorktreeDashboard.d.ts +21 -0
  20. package/lib/client/dashboard/WorktreeDashboard.d.ts.map +1 -0
  21. package/lib/client/dashboard/WorktreeDashboard.js +211 -0
  22. package/lib/client/dashboard/WorktreeDashboard.js.map +1 -0
  23. package/lib/client/dashboard/WorktreeInstructions.d.ts +8 -0
  24. package/lib/client/dashboard/WorktreeInstructions.d.ts.map +1 -0
  25. package/lib/client/dashboard/WorktreeInstructions.js +53 -0
  26. package/lib/client/dashboard/WorktreeInstructions.js.map +1 -0
  27. package/lib/client/dashboard/dashboard-icon.d.ts +7 -0
  28. package/lib/client/dashboard/dashboard-icon.d.ts.map +1 -0
  29. package/lib/client/dashboard/dashboard-icon.js +6 -0
  30. package/lib/client/dashboard/dashboard-icon.js.map +1 -0
  31. package/lib/client/dashboard/dashboard-overlay.d.ts +11 -0
  32. package/lib/client/dashboard/dashboard-overlay.d.ts.map +1 -0
  33. package/lib/client/dashboard/dashboard-overlay.js +120 -0
  34. package/lib/client/dashboard/dashboard-overlay.js.map +1 -0
  35. package/lib/client/dashboard/dashboard-selection.d.ts +32 -0
  36. package/lib/client/dashboard/dashboard-selection.d.ts.map +1 -0
  37. package/lib/client/dashboard/dashboard-selection.js +31 -0
  38. package/lib/client/dashboard/dashboard-selection.js.map +1 -0
  39. package/lib/client/dashboard/dashboard-sessions.d.ts +6 -0
  40. package/lib/client/dashboard/dashboard-sessions.d.ts.map +1 -0
  41. package/lib/client/dashboard/dashboard-sessions.js +21 -0
  42. package/lib/client/dashboard/dashboard-sessions.js.map +1 -0
  43. package/lib/client/dashboard/open-in-app-controller.d.ts +30 -0
  44. package/lib/client/dashboard/open-in-app-controller.d.ts.map +1 -0
  45. package/lib/client/dashboard/open-in-app-controller.js +94 -0
  46. package/lib/client/dashboard/open-in-app-controller.js.map +1 -0
  47. package/lib/client/dashboard/vscode-url.d.ts +3 -0
  48. package/lib/client/dashboard/vscode-url.d.ts.map +1 -0
  49. package/lib/client/dashboard/vscode-url.js +9 -0
  50. package/lib/client/dashboard/vscode-url.js.map +1 -0
  51. package/lib/client/dashboard/worktree-acquisition-facts.d.ts +16 -0
  52. package/lib/client/dashboard/worktree-acquisition-facts.d.ts.map +1 -0
  53. package/lib/client/dashboard/worktree-acquisition-facts.js +14 -0
  54. package/lib/client/dashboard/worktree-acquisition-facts.js.map +1 -0
  55. package/lib/client/dsh-slot-contract.d.ts +5 -0
  56. package/lib/client/dsh-slot-contract.d.ts.map +1 -1
  57. package/lib/client/entry.d.ts.map +1 -1
  58. package/lib/client/entry.js +65 -0
  59. package/lib/client/entry.js.map +1 -1
  60. package/lib/client/locales.d.ts +138 -0
  61. package/lib/client/locales.d.ts.map +1 -1
  62. package/lib/client/locales.js +138 -0
  63. package/lib/client/locales.js.map +1 -1
  64. package/lib/client/session/session-labels.d.ts +9 -0
  65. package/lib/client/session/session-labels.d.ts.map +1 -0
  66. package/lib/client/session/session-labels.js +44 -0
  67. package/lib/client/session/session-labels.js.map +1 -0
  68. package/lib/client/surface/components/ActiveWorktree.d.ts +1 -1
  69. package/lib/client/surface/components/ActiveWorktree.d.ts.map +1 -1
  70. package/lib/client/surface/components/ActiveWorktree.js +2 -1
  71. package/lib/client/surface/components/ActiveWorktree.js.map +1 -1
  72. package/lib/client/surface/components/ArchivedWorktree.d.ts +1 -1
  73. package/lib/client/surface/components/ArchivedWorktree.d.ts.map +1 -1
  74. package/lib/client/surface/components/ArchivedWorktree.js +2 -1
  75. package/lib/client/surface/components/ArchivedWorktree.js.map +1 -1
  76. package/lib/client/surface/components/ArchivedWorktrees.d.ts +1 -1
  77. package/lib/client/surface/components/ArchivedWorktrees.d.ts.map +1 -1
  78. package/lib/client/surface/components/SurfaceContent.d.ts +1 -1
  79. package/lib/client/surface/components/SurfaceContent.d.ts.map +1 -1
  80. package/lib/client/surface/components/SurfaceContent.js.map +1 -1
  81. package/lib/client/surface/components/WorkspaceTree.d.ts +1 -1
  82. package/lib/client/surface/components/WorkspaceTree.d.ts.map +1 -1
  83. package/lib/client/surface/components/WorkspaceTree.js +5 -1
  84. package/lib/client/surface/components/WorkspaceTree.js.map +1 -1
  85. package/lib/client/surface/components/rows.d.ts +1 -1
  86. package/lib/client/surface/components/rows.d.ts.map +1 -1
  87. package/lib/client/surface/components/rows.js +102 -4
  88. package/lib/client/surface/components/rows.js.map +1 -1
  89. package/lib/client/surface/types.d.ts +8 -0
  90. package/lib/client/surface/types.d.ts.map +1 -1
  91. package/lib/client/view/WorktreeModeAction.d.ts.map +1 -1
  92. package/lib/client/view/WorktreeModeAction.js +8 -0
  93. package/lib/client/view/WorktreeModeAction.js.map +1 -1
  94. package/lib/client/view/view-mode-dispatch.d.ts +7 -0
  95. package/lib/client/view/view-mode-dispatch.d.ts.map +1 -0
  96. package/lib/client/view/view-mode-dispatch.js +11 -0
  97. package/lib/client/view/view-mode-dispatch.js.map +1 -0
  98. package/lib/client/worktree-connection.d.ts +1 -0
  99. package/lib/client/worktree-connection.d.ts.map +1 -1
  100. package/lib/client/worktree-connection.js +4 -0
  101. package/lib/client/worktree-connection.js.map +1 -1
  102. package/lib/client.js +1582 -22
  103. package/lib/client.js.map +1 -1
  104. package/lib/contract/index.contract.js +2 -0
  105. package/lib/contract/index.contract.js.map +1 -1
  106. package/lib/contract/index.d.ts +19 -1
  107. package/lib/contract/index.d.ts.map +1 -1
  108. package/lib/contract/index.js +1 -0
  109. package/lib/contract/index.js.map +1 -1
  110. package/lib/host/dsh-read-adapter.d.ts +3 -1
  111. package/lib/host/dsh-read-adapter.d.ts.map +1 -1
  112. package/lib/host/dsh-read-adapter.js +5 -2
  113. package/lib/host/dsh-read-adapter.js.map +1 -1
  114. package/lib/host/remote.d.ts.map +1 -1
  115. package/lib/host/remote.js +1 -0
  116. package/lib/host/remote.js.map +1 -1
  117. package/lib/host/service.d.ts +6 -0
  118. package/lib/host/service.d.ts.map +1 -1
  119. package/lib/host/service.js +8 -0
  120. package/lib/host/service.js.map +1 -1
  121. package/lib/host/worktree-instructions.d.ts +41 -0
  122. package/lib/host/worktree-instructions.d.ts.map +1 -0
  123. package/lib/host/worktree-instructions.js +65 -0
  124. package/lib/host/worktree-instructions.js.map +1 -0
  125. package/lib/manage/manager-worktrees.d.ts.map +1 -1
  126. package/lib/manage/manager-worktrees.js +3 -0
  127. package/lib/manage/manager-worktrees.js.map +1 -1
  128. package/lib/manage/manager.d.ts +7 -0
  129. package/lib/manage/manager.d.ts.map +1 -1
  130. package/lib/manage/manager.js +47 -0
  131. package/lib/manage/manager.js.map +1 -1
  132. package/lib/manage/types.d.ts +1 -0
  133. package/lib/manage/types.d.ts.map +1 -1
  134. package/lib/provider/sidecar/repository.d.ts.map +1 -1
  135. package/lib/provider/sidecar/repository.js +5 -1
  136. package/lib/provider/sidecar/repository.js.map +1 -1
  137. package/lib/provider/sidecar/sidecar-schema.d.ts.map +1 -1
  138. package/lib/provider/sidecar/sidecar-schema.js +13 -6
  139. package/lib/provider/sidecar/sidecar-schema.js.map +1 -1
  140. package/lib/provider/transaction/operations/import.d.ts.map +1 -1
  141. package/lib/provider/transaction/operations/import.js +1 -0
  142. package/lib/provider/transaction/operations/import.js.map +1 -1
  143. package/lib/provider/transaction/recovery/recover.d.ts.map +1 -1
  144. package/lib/provider/transaction/recovery/recover.js +2 -0
  145. package/lib/provider/transaction/recovery/recover.js.map +1 -1
  146. package/lib/provider/transaction/support/journal.d.ts.map +1 -1
  147. package/lib/provider/transaction/support/journal.js +2 -0
  148. package/lib/provider/transaction/support/journal.js.map +1 -1
  149. package/lib/typert.host.js +87 -32
  150. package/lib/typert.remote-client.d.ts +2 -0
  151. package/lib/typert.remote-client.d.ts.map +1 -1
  152. package/lib/typert.remote-client.js +87 -32
  153. package/package.json +21 -20
package/README.md CHANGED
@@ -3,7 +3,13 @@
3
3
  `@cerbur/clutch-dsh-worktree` adds a Git Worktree view to the DSH Web UI. It groups
4
4
  Sessions as Workspace → Worktree → Session while keeping DSH as the source of truth for
5
5
  Project/Workspace identity, Session metadata, native lists, and conversation history.
6
- The plugin stores only external Worktree/Session relationship metadata.
6
+ The plugin stores external Worktree/Session relationships, acquisition facts, and user-authored
7
+ Worktree instructions in its own sidecar.
8
+
9
+ > **Preview:** Worktree Dashboard is an early, plugin-only MVP preview. The overview, Session
10
+ > navigation, Worktree instructions, Worktree creation/archive, and the open-in-app action are
11
+ > connected; Git details, derived Worktrees, Settings, and other actions marked **Coming soon** remain
12
+ > placeholders.
7
13
 
8
14
  ## Screenshots
9
15
 
@@ -17,15 +23,23 @@ Worktree rows, and the read-only blank-session Hero context.
17
23
  The Import screenshot shows the existing Workspace `+` dialog with Create selected by default,
18
24
  the adjacent Import tab, and a standard dropdown containing safe example branch/path values.
19
25
 
26
+ ![Worktree Dashboard preview (Chinese UI)](assets/screenshots/screenshots-dashboard.webp)
27
+
28
+ The Dashboard screenshot records the current preview UI: Worktree identity, acquisition facts,
29
+ connected Session and Worktree actions, and clearly marked placeholder cards.
30
+
20
31
  ## Capabilities
21
32
 
22
33
  - Enter Worktree mode from the DSH Sidebar footer and browse Workspace → Worktree → Session.
34
+ - Open Dashboard from the Local/Main or active/archived Worktree menu or its hover-only row action, or use
35
+ the quick Dashboard icon to the left of the native Session-header More actions button. View the
36
+ real name and cwd, copy the full path, and switch between Dashboard, Git & Changes, Sessions,
37
+ Children, and Settings. Unconnected MVP cards and actions are explicitly marked Coming soon.
23
38
  - Search Workspaces and create a Git Worktree and branch from an existing local branch.
24
39
  - 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
- - Archive Worktrees non-destructively (`status: removed`), preserving disk files, active bindings, and runtime cwd. Disk cleanup (`git worktree remove`) requires secondary confirmation: users must confirm all Sessions, subagents, and other tasks using the directory have stopped. Worktrees can also be forgotten from plugin management while retaining disk files and Sessions.
27
- - Create a normal Session from Main or a Session whose runtime cwd is an active Worktree, then
28
- open it directly.
40
+ - Register an existing Worktree in place without moving, copying, or editing its directory; the imported record follows the same Session, binding, health, ordering, cwd, projection, refresh, and recovery flow as a plugin-created record.
41
+ - Archive Worktrees non-destructively, preserving disk files, active bindings, and runtime cwd. Disk cleanup (`git worktree remove`) requires secondary confirmation: users must confirm all Sessions, subagents, and other tasks using the directory have stopped. Worktrees can also be forgotten from plugin management while retaining disk files and Sessions.
42
+ - Create a normal Session from Main or a Session whose runtime cwd is an active Worktree, then open it directly.
29
43
  - For active Worktree Sessions, request the named `worktree-full-access` preset after an
30
44
  explicit confirmation. It combines DSH `danger-full-access` with `ask`: it removes filesystem
31
45
  confinement for linked Git metadata while keeping approval prompts enabled; network and
@@ -38,23 +52,30 @@ the adjacent Import tab, and a standard dropdown containing safe example branch/
38
52
  and completed states occupy the trailing slot; idle Sessions show native relative time for the
39
53
  last human-authored message there. Hover or an open menu gives the trailing slot back to the
40
54
  existing actions menu.
55
+ - Dashboard Session cards use the same status-or-relative-time metadata in both the overview
56
+ preview and the full Sessions tab, keeping status semantics consistent with the Worktree list.
41
57
  - Show the native DSH Session hover detail card with the complete title, relative time, and current
42
58
  status; the card yields to the Session actions menu and row dragging.
43
59
  - Cover native waiting-for-approval, plan-review, question, completed, idle, and running-subagent
44
60
  states without copying the animation implementation into the plugin.
45
61
  - Show one native running indicator on a collapsed Workspace, Main, or Worktree when any of its
46
- non-archived Sessions is active; expanded groups keep their normal action rail instead.
62
+ non-archived Sessions is active. A collapsed active group reserves the indicator's 28px box plus
63
+ a 4px label gap, and its long Worktree label scrolls while activity remains active; expanded groups
64
+ keep their normal action rail instead.
47
65
  - Promote a Session to the head of its Main or Worktree visual group after a newer user message.
48
66
  This ordering is browser-local and does not mutate DSH Workspace order or the Worktree sidecar.
49
67
  - Fork a Session from the native DSH Workspace tab, the Worktree view, or the Conversation fork
50
- action. When the parent has an active Worktree binding, the child is bound to the same Worktree,
51
- then added to the browser-local Workspace membership projection after the binding refresh; the
52
- child remains a normal DSH Session. The refresh ordering keeps it from briefly appearing in
53
- Main/Local. A sidecar failure keeps the child available and exposes retryable binding recovery.
68
+ action. When the parent has an active Worktree binding, the child is bound to the same Worktree
69
+ and opens directly in the Worktree view. The child remains a normal DSH Session.
54
70
  - See ready, repair, active, and detached Worktree states, including retryable operation errors.
55
71
  - Use the shared Main and Worktree row options menu to copy the selected row's absolute path.
56
- Main and detached rows show only `Copy path`; active Worktree rows also show `Archive Worktree`
57
- with confirmation.
72
+ Local/Main and managed Worktree rows expose Dashboard through the existing menu and a hover-only row action.
73
+ The Worktree group rail is zero-width at rest unless a group is collapsed with active Session activity;
74
+ that state reserves the 28px running indicator and a 4px text gap. Hover, focus, or an open menu
75
+ reveals the available Dashboard, menu, and Session `+` controls at intrinsic width. Long Worktree labels
76
+ automatically scroll while hovered or while collapsed activity remains active, using one shared scroll
77
+ loop and resetting when neither trigger applies.
78
+ Active rows offer Archive Worktree with confirmation.
58
79
  - Create a new Worktree from the Local or an active Worktree's options menu. The Create dialog
59
80
  uses the selected row's current branch as its base and suggests the next available numbered
60
81
  name, such as `feature-2` or `feature-3`; detached Worktrees do not expose this action.
@@ -74,27 +95,22 @@ the adjacent Import tab, and a standard dropdown containing safe example branch/
74
95
  `WT` button when the Sidebar is collapsed.
75
96
  - Keep Worktree Sessions in the original DSH Project/Workspace view; the plugin does not copy
76
97
  Session content or modify messages, prompts, transcripts, or history.
77
- - Worktree fork membership is not written to DSH's durable `Workspace.sessionIds`. While this
78
- plugin is loaded, the browser can show the child through its local projection; without the
79
- plugin, the child remains in DSH's global Session management but is not durably attached to the
80
- native Workspace root membership.
81
98
 
82
99
  ### Compatibility and prerequisites
83
100
 
84
- The supported compatibility facts are:
101
+ Session reload is compatible with DSH rc.1 persisted headers and newer DSH header snapshots.
102
+ The Worktree Dashboard preview records acquisition facts for new Worktrees and injects saved instructions for active sessions.
85
103
 
86
- | Component | Min Version | Notes |
87
- | --- | --- | --- |
88
- | DSH Client | `>=0.1.2-rc.1` | Requires the Session/Workspace Controllers and Client Store |
89
- | DSH Host | `>=0.1.2-rc.1` | Requires the Typert Gateway `/api` protocol and subprocess capability |
90
- | Git | `>=2.20.0` | Requires worktree core commands and branch discovery |
91
- | Node.js | `>=20.0.0` | LTS is recommended |
104
+ The supported compatibility requirements are:
92
105
 
93
- ## Installation
106
+ | Component | Min Version | Notes |
107
+ | ---------- | -------------- | --------------------------------------------------------------------- |
108
+ | DSH Client | `>=0.1.5-rc.1` | Requires the Session/Workspace Controllers and Client Store |
109
+ | DSH Host | `>=0.1.5-rc.1` | Requires the Typert Gateway `/api` protocol and subprocess capability |
110
+ | Git | `>=2.20.0` | Requires worktree core commands and branch discovery |
111
+ | Node.js | `>=20.0.0` | LTS is recommended |
94
112
 
95
- Use the npm package for the normal user installation. Use a repository checkout to develop or
96
- validate local source, or use the GitHub source path when installing the source package through a
97
- marketplace entry.
113
+ ## Installation
98
114
 
99
115
  ### Install from npm (recommended)
100
116
 
@@ -120,58 +136,6 @@ To inspect the currently published version on the official registry:
120
136
  npm view @cerbur/clutch-dsh-worktree version --registry=https://registry.npmjs.org/
121
137
  ```
122
138
 
123
- ### Prepare the current upstream DSH checkout
124
-
125
- For source-based development or validation, prepare the upstream checkout first. The current
126
- upstream default branch is `master`; follow the repository's default branch if it changes later.
127
- For the minimum rc.1 compatibility validation path, check out `dsh-v0.1.2-rc.1`:
128
-
129
- ```bash
130
- git clone https://github.com/deepseek-ai/deepseek-harness.git
131
- cd deepseek-harness
132
- git fetch origin
133
- git checkout dsh-v0.1.2-rc.1
134
- pnpm install
135
- pnpm run build
136
- ```
137
-
138
- ### Install from a repository checkout
139
-
140
- Build the package from the `clutch-dsh` checkout, then install its absolute path into the DSH
141
- profile:
142
-
143
- ```bash
144
- cd /path/to/clutch-dsh
145
- pnpm install
146
- pnpm --filter @cerbur/clutch-dsh-worktree build
147
-
148
- cd /path/to/deepseek-harness
149
- pnpm install
150
- pnpm run build
151
- pnpm dsh plugin --profile web add /path/to/clutch-dsh/packages/clutch-dsh-worktree
152
- pnpm dsh web --dump-config
153
- pnpm dsh web
154
- ```
155
-
156
- The `--dump-config` output should include the plugin bundle layer. If the profile still contains
157
- an old unscoped installation, remove it first:
158
-
159
- ```bash
160
- pnpm dsh plugin --profile web remove clutch-dsh-worktree
161
- ```
162
-
163
- To update a local checkout, rebuild the package and restart DSH:
164
-
165
- ```bash
166
- cd /path/to/clutch-dsh
167
- pnpm --filter @cerbur/clutch-dsh-worktree build
168
- cd /path/to/deepseek-harness
169
- pnpm dsh web
170
- ```
171
-
172
- After changing `package.json`, `cordis.patch.yml`, or the profile bundle members, run the plugin
173
- add command again.
174
-
175
139
  ### Install from GitHub source
176
140
 
177
141
  The source path generated by `awesome-dsh-plugin` is:
@@ -180,28 +144,8 @@ The source path generated by `awesome-dsh-plugin` is:
180
144
  dsh plugin --profile web add "github:Cerbur/clutch-dsh#path:/packages/clutch-dsh-worktree"
181
145
  ```
182
146
 
183
- This is a source Git dependency, not a prebuilt npm package. Its `prepare` lifecycle generates
184
- `lib/`. The current DSH profile uses pnpm 11 `allowBuilds`: on the first Git installation, pnpm
185
- intentionally rejects the build and prints a complete key containing the package name, Git URL,
186
- resolved commit, and subdirectory path. Copy that complete key into the profile's
187
- `pnpm-workspace.yaml`, for example:
188
-
189
- ```yaml
190
- allowBuilds:
191
- '@cerbur/clutch-dsh-worktree@git+https://github.com/Cerbur/clutch-dsh#<resolved-commit>&path:/packages/clutch-dsh-worktree': true
192
- ```
193
-
194
- Use the exact package key printed by pnpm: `<resolved-commit>`, the Git URL, and the path must
195
- match the error output. A package-name-only entry is not enough for a direct Git dependency, and
196
- `onlyBuiltDependencies` is not the configuration used by the current pnpm 11 Git prepare flow.
197
- After saving the allowlist, rerun the original install command. A new commit requires a new key.
198
- The allowlist belongs to the profile owner who trusts that Git commit; do not add it to this
199
- plugin package.
200
-
201
- After authorization, Git prepare runs `pnpm install` in the checked-out monorepo and then
202
- `pnpm run build`, so the profile must be able to reach its configured registry. Registry DNS,
203
- mirror, or lockfile errors after authorization are installation-environment errors, not
204
- `allowBuilds` rejections. Use the npm installation above to avoid source-build authorization.
147
+ This is a source Git dependency that builds during installation. For pnpm 11 `allowBuilds`
148
+ authorization, local development, and contributor workflows, see [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md).
205
149
 
206
150
  ### Uninstall
207
151
 
@@ -224,6 +168,70 @@ pnpm dsh plugin --profile web remove @cerbur/clutch-dsh-worktree
224
168
  The screenshot above illustrates the Sidebar entry point and the visual context shown in the
225
169
  blank-session Hero. The displayed language follows DSH's current language setting.
226
170
 
171
+ ### Open a Worktree dashboard
172
+
173
+ The Dashboard is a plugin-only preview MVP; it does not replace DSH's native Session page or
174
+ write DSH-owned Workspace/Session data.
175
+
176
+ In Worktree mode, hover a managed Worktree row and click its Dashboard icon, or open the row's
177
+ options menu and choose **Dashboard**. For a current Session with a ready Main or Worktree
178
+ context, click the Dashboard icon to the left of the native **More actions** button in the
179
+ Session header. The dashboard temporarily replaces the area beside the Sidebar, including the
180
+ Session page.
181
+ The native conversation remains mounted. Use **Back to session**, press **Escape**, open
182
+ a Session from the Sidebar, or exit Worktree mode to restore the native page. No Session
183
+ is created or changed by opening the dashboard. Local/Main and managed Worktree rows can use the
184
+ inline Dashboard icon; the current Session can also use the Session-header shortcut. The Dashboard keeps the
185
+ Sidebar resize handle available while it is open.
186
+
187
+ ![Worktree Dashboard preview](assets/screenshots/screenshots-dashboard.webp)
188
+
189
+ The screenshot above shows the preview Dashboard beside the native Worktree Sidebar. Its connected
190
+ controls are intentionally limited to the MVP surface; unfinished cards remain visibly marked.
191
+
192
+ The title uses the same accepted branch name as the Worktree row. Click the title to copy the
193
+ branch name directly. The cwd is the record's full absolute path; its copy button reports success
194
+ or failure. If DSH cannot provide Main's current branch, the Dashboard labels it unavailable and
195
+ does not offer branch copying. Current branch, availability, and source use the existing Worktree projection. Ready means the Worktree is available;
196
+ it does **not** assert that Git files are clean. An archived or cleaned record still shows
197
+ its recorded path, which need not exist on disk.
198
+
199
+ The five tabs support Left/Right, Home, and End keys. Overview shows up to five current
200
+ Worktree Sessions; Sessions shows the full list. Both consume the existing in-memory Sessions
201
+ and bindings with Sidebar ordering and visibility rules, independent of Sidebar search.
202
+ Click a Session to return to its native page. New Session uses the existing create/bind/open
203
+ flow, including blank-Session reuse and failure recovery, and leaves the dashboard.
204
+ New Worktree opens the existing Create dialog with the current branch and numbered-name
205
+ defaults. Archive Worktree opens the existing non-destructive confirmation. These actions
206
+ follow the Sidebar's health, archive, and pending-operation gates.
207
+ Open in VS Code uses an encoded `vscode://file/...` link for the recorded cwd. VS Code must be
208
+ installed on the browser's machine and able to access that path; the browser may request
209
+ permission to open the app. This link does not verify directory existence or launch success.
210
+ Git details, derived Worktrees, settings, and other marked quick actions
211
+ remain placeholders. The layout follows DSH's theme and stacks cards on narrow screens.
212
+ Dashboard selection is transient and is not restored after a reload.
213
+
214
+ Use **Edit** on the Worktree instructions card to edit, save, or clear shared guidance
215
+ (up to 32,000 UTF-16 code units). Saved text enters bound Sessions' next model request as
216
+ `<system-reminder>` through DSH `agent/pre-step`, as a separate context entry in the
217
+ Session trajectory. DSH records the message; existing history is not rewritten.
218
+ Instruction text is inserted literally, including any `{{...}}` examples.
219
+ Archiving preserves active bindings and instructions; detached bindings, disk cleanup, and
220
+ removal from management stop the guidance. Clearing or losing the binding appends a
221
+ reminder invalidating earlier Worktree instructions on the next step. Unchanged guidance
222
+ is not repeated while its message remains visible, including after restart; compacted
223
+ guidance is republished when needed.
224
+ Failed saves retain the draft. Concurrent edits are rejected; cancel and reopen to load the
225
+ latest saved text before retrying. Instructions remain in the plugin sidecar, never AGENTS.md.
226
+
227
+ New plugin-created Worktrees show their recorded creation time and selected base branch.
228
+ Imported Worktrees show their registration time and do not infer an original creation time or
229
+ base. When these historical facts are unavailable, the Dashboard shows **Unavailable for
230
+ historical Worktrees** instead of Unknown. The base is the acquisition
231
+ branch name, not a live merge-base or ahead/behind calculation, and does not change on checkout.
232
+ The open-editor split button follows DSH's native styling and offers detected host applications;
233
+ if unavailable, it falls back to the VS Code protocol link described above.
234
+
227
235
  ### Create a Worktree
228
236
 
229
237
  New directories use `$dshHome/clutch-dsh-worktree/worktree/wt_<12-hex-characters>`
@@ -259,24 +267,18 @@ other Git failures retain their normal error handling.
259
267
  3. Choose an option and select `Import Worktree`. Registration writes only the plugin sidecar;
260
268
  the existing Worktree directory and Git working state remain in place. Import then creates or
261
269
  reuses a Session at that Worktree cwd and runs the same bind → open → binding refresh flow as
262
- Create. Newly created Sessions are not projected into native Workspace membership before the
263
- binding refresh.
270
+ Create.
264
271
  4. An active external import for the same Workspace and physical path is idempotent. A path already
265
- managed by the plugin returns `WORKTREE_ALREADY_MANAGED`; invalid or stale candidates return
266
- `WORKTREE_IMPORT_INVALID` and can be retried after the repository state is fixed.
272
+ managed by the plugin returns an error; invalid or stale candidates can be retried after the repository state is fixed.
267
273
 
268
274
  ### Create Main and Worktree Sessions
269
275
 
270
276
  - Use Main's `+` to create a normal DSH Session in the Project-root view.
271
- - Use a Worktree's `+` to create or reuse a Session with that Worktree as its runtime cwd. The
272
- plugin calls the DSH Session Controller with `ctx.sessions.create({ cwd: worktreePath })`, then
273
- saves the external binding and opens the Session. The browser-local `{ workspaceId, sessionId }`
274
- membership projection is refreshed afterward, so the newly created Session does not briefly
275
- appear in Main.
277
+ - Use a Worktree's `+` to create or reuse a Session with that Worktree as its runtime cwd. The Session
278
+ opens directly in the Worktree view without briefly appearing in Main.
276
279
  - The connector reuses an unarchived blank Session with the exact target cwd when possible. An
277
- already-bound Session opens directly; an unbound candidate is bound before projection and
278
- opening. Otherwise the new-Session flow is `create bind open refresh`, and concurrent
279
- clicks for the same Worktree are coalesced.
280
+ already-bound Session opens directly; an unbound candidate is bound before opening. Otherwise, a
281
+ new Session is created and bound, and concurrent clicks for the same Worktree are coalesced.
280
282
  - If binding fails after DSH has created the Session, the Session ID remains available for Retry
281
283
  or Open recovery. The plugin does not delete or mutate that DSH Session.
282
284
  - Before opening an active Worktree Session, the plugin explains in a DSH-styled in-page dialog why
@@ -304,7 +306,8 @@ other Git failures retain their normal error handling.
304
306
  being dragged.
305
307
  - A collapsed Workspace, Main group, or Worktree group shows the same running dot when any
306
308
  non-archived member is ongoing, including activity hidden by search. Expanding the group hides
307
- the aggregate dot; hover, focus, or an open menu reveals the existing action controls.
309
+ the aggregate dot; hover, focus, or an open menu reveals the existing action controls and only then
310
+ reserves their width.
308
311
  - A newer user message promotes its Session to the head of the current Main or Worktree visual
309
312
  group. The promotion, observed timestamps, and per-group order live only in browser-local state;
310
313
  successful manual drag still uses the native DSH ordering API before updating that local order.
@@ -312,59 +315,46 @@ other Git failures retain their normal error handling.
312
315
  ### Fork Worktree Sessions
313
316
 
314
317
  - Use any native DSH fork entry point: a Session-list tab, a Worktree Session menu, or the
315
- Conversation fork action. The plugin wraps the shared DSH `sessions.fork` service, so the
316
- original fork cut, title increment, and child lineage stay native.
317
- - After DSH creates the child, the plugin looks up the parent's active sidecar binding, writes the
318
- child binding through the existing `/api` Manager. The Worktree view refreshes the binding before
319
- replaying the browser-local Workspace membership projection, so the child does not briefly appear
320
- in Main/Local; ready content is retained during that refresh.
321
- - If the child is created but sidecar lookup or binding fails, DSH keeps the child and the plugin
322
- shows Retry Binding/Open Created Session recovery. A later plugin initialization also retries
323
- recoverable fork children from native Session lineage summaries; it never binds unrelated
324
- subagents automatically.
325
- - This flow does not persist the child into DSH `Workspace.sessionIds`. The native DSH Workspace
326
- view can only see the temporary browser projection while the plugin is loaded; the durable native
327
- Workspace data is unchanged.
318
+ Conversation fork action. Lineage, title increments, and conversation fork history remain native DSH behavior.
319
+ - When the parent Session has an active Worktree binding, the forked child Session is automatically
320
+ bound to the same Worktree and opens directly in that Worktree view. Ready content is retained during the binding refresh.
321
+ - If the child is created but binding fails, DSH keeps the child Session, and the Worktree view provides
322
+ Retry Binding and Open recovery actions. Later plugin initializations also retry recoverable fork children
323
+ from native Session lineage; unrelated subagents are never bound automatically.
324
+ - Fork binding is maintained by the plugin's external index without mutating DSH's durable Workspace storage.
328
325
 
329
326
  ### Reorder and manage Worktrees
330
327
 
331
- - Drag Worktrees within their owning Workspace. The ordered `worktrees` array is persisted in
332
- the plugin sidecar; Main is a fixed first row and Worktrees cannot move across Workspaces.
333
- - Newly created or imported Worktrees are inserted at the head of their Workspace's Worktree list; existing Worktree order is preserved and Main remains fixed first.
328
+ - Drag Worktrees within their owning Workspace to reorder them. The custom order is preserved by the plugin;
329
+ Main is always fixed as the first row, and Worktrees cannot be dragged across Workspaces.
330
+ - Newly created or imported Worktrees are inserted at the head of their Workspace's Worktree list; existing Worktree order is preserved.
334
331
  - Open the shared Main and Worktree options menu to copy the selected row's absolute path. Active
335
332
  Worktrees show `Copy path` and `Archive Worktree`. Archiving an active Worktree is an internal
336
- archive operation: it sets `status: removed`, preserves disk files, active bindings, and runtime cwd,
337
- and moves the Worktree into the default-collapsed `Archived` group at the bottom of the Workspace.
333
+ archive operation: it preserves disk files, active bindings, and runtime cwd, and moves the Worktree into
334
+ the default-collapsed `Archived` group at the bottom of the Workspace.
338
335
  - The `Archived` group is rendered at the bottom of the Workspace when archived Worktrees exist and is
339
336
  collapsed by default. Its label includes the total archived Worktree count, even when collapsed.
340
337
  Each Workspace tracks its own collapsed state independently.
341
- - Active Worktrees with `health: repair` also offer `Archive Worktree` to archive the record without
342
- touching disk files or bindings. `recovery-needed` still blocks removal pending recovery.
338
+ - Active Worktrees requiring repair also offer `Archive Worktree` to archive the record without
339
+ touching disk files or bindings. Worktrees in recovery-needed state block removal until recovery completes.
343
340
  - For archived Worktrees whose disk has not been cleaned, the options menu provides:
344
341
  1. `Unarchive Worktree`: Restores a metadata-archived Worktree whose disk directory is intact back to active status, without secondary confirmation.
345
342
  2. `Clean Up Disk`: Prompts for secondary confirmation detailing the path and irreversible deletion,
346
343
  tells you that the plugin does not check Session or subagent activity and requires you to confirm
347
344
  that all tasks using the directory have stopped (otherwise deletion may cause task failures or data loss),
348
- runs real non-forced `git worktree remove`, and upon success records
349
- `diskCleanup: completed`, projects health as `cleaned`, transitions bindings to detached, and
350
- normalizes Full Access permissions to `workspace-write + ask`. Disk removal commitment is decoupled
351
- from permission normalization: once disk removal commits, the dialog closes and the record updates to
352
- `cleaned`; any follow-up permission or refresh failure provides independent retry without re-executing disk removal.
353
- Use `Retry` in the permission notice to retry only permission normalization for the cleaned Worktree.
354
- If the Worktree directory or its `.git` entry was already deleted externally, confirming cleanup only marks
355
- the plugin record as completed and detaches its bindings. It does not run Git removal or prune
356
- stale Git registration. Any remaining directory and files are preserved. The completed status
357
- reads `Worktree removed`, which does not imply residual files were deleted. Ordinary refreshes still show
358
- missing directories as `repair` until cleanup is explicitly confirmed.
345
+ runs real non-forced `git worktree remove`, and upon success records the record as cleaned, transitions
346
+ bindings to detached, and normalizes Full Access permissions to `workspace-write + ask`. Disk removal
347
+ commitment is decoupled from permission normalization: once disk removal commits, the dialog closes and the
348
+ record updates to cleaned; any follow-up permission or refresh failure provides independent retry without
349
+ re-executing disk removal. If the Worktree directory or its `.git` entry was already deleted externally,
350
+ confirming cleanup marks the plugin record as completed and detaches its bindings without running Git removal.
359
351
  3. `Remove from Management`: Prompts for confirmation and removes the Worktree sidecar record and all
360
352
  its bindings, while preserving disk files and native DSH Sessions. It retires in-flight fork operations,
361
353
  recovery state, and permission notices for that Worktree. No Session activity check is required.
362
- - For archived Worktrees whose disk has already been cleaned (`health: cleaned`), the menu provides
363
- `Remove from Management` to prune the sidecar record completely.
364
- - Session activity is informational and does not block cleanup or removal from management.
365
- The default Host may report `unknown`. Before confirming disk cleanup, stop all tasks using
366
- the directory yourself; the plugin does not verify that they have stopped. Native activity
367
- changes and reopening the archived menu refresh its owning Workspace while retaining ready content.
354
+ - For archived Worktrees whose disk has already been cleaned, the menu provides `Remove from Management`
355
+ to prune the sidecar record completely.
356
+ - Session activity is informational and does not block cleanup or removal from management. Stop all tasks
357
+ using the directory yourself before confirming disk cleanup; the plugin does not verify that they have stopped.
368
358
  - Deleting a Workspace removes only DSH's Workspace registration; its directory, Sessions, Git Worktrees,
369
359
  and plugin sidecar remain.
370
360
  - DSH-native Workspace rename/delete/reorder and Session menus remain available. Session drag
@@ -404,8 +394,7 @@ adoption; detached HEAD does not offer this action.
404
394
  For `recovery-needed`, the Worktree menu offers `Retry recovery` for its Workspace.
405
395
  This retries safe journal recovery; it does not adopt branches, delete unknown paths, or
406
396
  clear unresolved identity issues. Successful adoption and recovery refresh only the owning
407
- Workspace while preserving existing ready content. Legacy non-transactional branch observations
408
- are retired automatically; there is no need to edit sidecar JSON for ordinary checkout drift.
397
+ Workspace while preserving existing ready content.
409
398
 
410
399
  ### Understand status and recovery messages
411
400
 
@@ -418,7 +407,6 @@ are retired automatically; there is no need to edit sidecar JSON for ordinary ch
418
407
  menu or dragging suppresses the hover card. Archive confirmation explicitly preserves the
419
408
  directory, Session bindings, and cwd for both plugin-created and external Worktrees;
420
409
  Clean Disk remains a separate action.
421
-
422
410
  - `ready` means the Worktree is available. `cleaned` indicates disk cleanup completed while the
423
411
  sidecar archive entry is retained. `repair` identifies a missing or invalid Worktree, Session, binding,
424
412
  or cwd. `recovery-needed` means a Git/sidecar operation or identity check is unresolved and
@@ -426,9 +414,7 @@ are retired automatically; there is no need to edit sidecar JSON for ordinary ch
426
414
  was retained. An active binding pointing to a missing Worktree produces
427
415
  an explicit repair warning or error; it never silently falls back to another Worktree.
428
416
  - Without a pending Git transaction, missing active or archived Worktrees remain `repair` and
429
- can be archived without blocking healthy Worktree Session bindings. Legacy non-transactional
430
- `WORKTREE_RECOVERY_REQUIRED` observations for existing, uncleaned records are retired under
431
- the sidecar lock; pending transactions, unknown records, and identity-change issues still block.
417
+ can be archived without blocking healthy Worktree Session bindings.
432
418
  - Worktree health is a runtime Git projection and is not written to the sidecar. Git readiness
433
419
  failures are shown per Workspace: a missing Git executable shows installation guidance without
434
420
  commands, while repository, initial commit, or local branch failures show copyable setup
@@ -458,9 +444,9 @@ when no current branch is reported.
458
444
  DSH owns the original Project/Workspace identity and root, Session identity and metadata, native
459
445
  Project/Session lists, messages, prompts, transcripts, and history. The plugin does not copy or
460
446
  rewrite any of those values. Its external index lives in the DSH host's plugin data directory or
461
- an independent sidecar store and may contain only relationship facts such as:
447
+ an independent sidecar store and contains only relationship facts such as:
462
448
 
463
- - `projectId`, `worktreeId`, and `sessionId`;
449
+ - `projectId`, `worktreeId`, and `sessionId` mappings;
464
450
  - an absolute Worktree path, branch, and lifecycle state;
465
451
  - the Worktree source (`plugin` or `external`);
466
452
  - binding status and schema version.
@@ -470,98 +456,35 @@ store a copy of `projectRoot` or any Session content. If the sidecar is unavaila
470
456
  the native Project/Session view remains readable and the plugin becomes degraded/read-only; an
471
457
  empty index must never overwrite the native DSH lists.
472
458
 
473
- The sidecar accepts v1, v2, and v3 snapshots for backwards-compatible reads. Legacy records are
474
- normalized in memory, and the first successful mutation atomically upgrades the shard to v4.
475
- Legacy removed records become `diskCleanup: completed`; v3 revisions are preserved.
476
- New v4 snapshots use a revision, an opaque repository fingerprint, and durable pending-operation
477
- metadata for Git create/remove. A transitional v3 snapshot containing an older raw repository
478
- field is read and cleaned on its next stable write. Invalid JSON, unknown schema versions, and
479
- invariant violations are reported as corruption rather than reset to an empty index.
480
-
481
459
  Each Session has at most one active Worktree binding, while a Worktree may have multiple bound
482
460
  Sessions. Rebinding the same Session to the same Worktree is idempotent; binding it to two active
483
461
  Worktrees is a conflict. A Session with no binding, a Main binding, or a detached binding runs
484
462
  with the Project root as cwd. An active Worktree binding runs with that Worktree path. The cwd is
485
463
  derived for each execution and is never persisted back into DSH Session metadata.
486
464
 
487
- Worktree creation creates the Git Worktree before recording its external relationship. Git
488
- create/remove mutations are serialized across Host processes per Workspace and repository,
489
- record a durable pending operation, and verify the actual Git result before publishing stable
490
- sidecar state. If a create cannot be reconciled or a path/repository identity changes, the
491
- operation remains explicitly recoverable; the plugin never uses force removal or deletes an
492
- unknown directory. If a sidecar write fails, the new Git Worktree is cleaned up when possible. A
493
- failed Worktree deletion does not silently change the relation, so it remains retryable or is
494
- marked `recovery-needed`. Session creation uses the native DSH API before binding; a binding
495
- failure never deletes or modifies the already-created Session.
496
-
497
- On Host startup, the plugin performs a best-effort safe recovery for known DSH Workspaces. It may
498
- finalize a pending create/remove only when Git path and repository identity are certain; otherwise
499
- it retains the marker and surfaces `WORKTREE_RECOVERY_REQUIRED` or
500
- `WORKTREE_IDENTITY_CHANGED`. It never guesses at destructive cleanup. A destructive action may
501
- also carry an opaque mutation token from the latest Worktree projection so a stale UI cannot act
502
- on a changed record.
503
-
504
- The Worktree session flow sends the independent Worktree cwd through the DSH Session Controller and
505
- keeps `{ workspaceId, sessionId }` as a browser-local membership projection rather than a
506
- persistent DSH attach. It does not modify DSH source, Session metadata, or native Workspace
507
- storage. The projection is replayed after native list refreshes and removed when the binding
508
- disappears or the Client is disposed.
509
-
510
- Permission changes use only the public DSH per-Session permission service and its
511
- `permission/preset`, `sandbox/mode`, and `approval/policy` records. The plugin does not write
512
- messages, prompts, transcripts, Workspace data, or Session metadata, and cannot enlarge a
513
- filesystem sandbox imposed by the host running DSH.
514
-
515
- The blank Hero context is visual only. Because the current upstream DSH source checkout has no
516
- additive Hero headline slot, its placement depends on the native `[data-phase="hero"]` and title
517
- anchors; it disappears when those anchors are unavailable and should move to a formal DSH slot
518
- when one exists.
519
-
520
- ## Development and verification
465
+ Worktree creation creates the Git Worktree before recording its external relationship; if a sidecar
466
+ write fails, the newly created Git Worktree is cleaned up when possible. Session creation uses the
467
+ native DSH API before binding; a binding failure never deletes or modifies the already-created Session.
521
468
 
522
- From the workspace root:
469
+ The Worktree session flow presents Sessions in their bound Worktree context using browser-side
470
+ view projections without mutating DSH native Workspace storage.
523
471
 
524
- ```bash
525
- cd /path/to/clutch-dsh
526
- pnpm install
527
- pnpm run check:workspace
528
- pnpm run check:patches
529
- pnpm --filter @cerbur/clutch-dsh-worktree typecheck
530
- pnpm --filter @cerbur/clutch-dsh-worktree build
531
- pnpm --filter @cerbur/clutch-dsh-worktree test
532
- ```
533
-
534
- For the bilingual README contract and formatting:
535
-
536
- ```bash
537
- cd /path/to/clutch-dsh/packages/clutch-dsh-worktree
538
- node --test test/readme-parity.test.mjs
539
- pnpm exec prettier --check README.md README.zh.md test/readme-parity.test.mjs
540
- ```
541
-
542
- The full workspace check is:
543
-
544
- ```bash
545
- cd /path/to/clutch-dsh
546
- pnpm run check
547
- ```
472
+ Permission changes use only the public DSH per-Session permission service. The plugin does not
473
+ write messages, prompts, transcripts, Workspace data, or Session metadata, and cannot enlarge a
474
+ filesystem sandbox imposed by the host running DSH.
548
475
 
549
- Do not commit generated `lib/`, coverage, sidecar data, or local credentials. See [AGENTS.md](AGENTS.md)
550
- for package data boundaries and lifecycle rules, [docs/RELEASING.md](docs/RELEASING.md) for
551
- version and installation-source details, and [src/client/README.md](src/client/README.md) for
552
- the browser Consumer boundary.
476
+ The blank Hero context is visual only. Because the current upstream DSH source checkout has no
477
+ additive Hero headline slot, its placement depends on native DOM anchors; it disappears when those
478
+ anchors are unavailable and should move to a formal DSH slot when one exists.
553
479
 
554
- ## Marketplace description
480
+ For detailed architectural models, lifecycle transitions, recovery guarantees, and developer documentation, see:
555
481
 
556
- When submitting to `awesome-dsh-plugin`, use the `git` category and keep the description aligned
557
- with the package:
482
+ - [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) Canonical architecture, lifecycle, and recovery invariants
483
+ - [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) — Local development, testing, and contribution guide
484
+ - [docs/RELEASING.md](docs/RELEASING.md) — Release parameters and versioning policy
485
+ - [AGENTS.md](AGENTS.md) — Coding agent working instructions
486
+ - [src/client/README.md](src/client/README.md) — Browser client integration and surface boundaries
558
487
 
559
- ```yaml
560
- category: git
561
- description:
562
- en: Adds a Worktree view to DSH Web UI that groups Sessions by Git worktree while keeping DSH as the source of truth.
563
- zh: 为 DSH Web UI 增加按 Git Worktree 组织 Session 的视角,同时继续由 DSH 管理原始 Project/Workspace 和 Session 数据。
564
- ```
488
+ ## Friendly Links
565
489
 
566
- Marketplace submission also requires external checks such as the `dsh-plugin` topic, repository
567
- age, and commit count. A package README cannot set those external properties.
490
+ - [LINUX DO](https://linux.do/) A new ideal community