@cerbur/clutch-dsh-worktree 0.1.8 → 0.1.10

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 (508) hide show
  1. package/README.md +117 -46
  2. package/README.zh.md +92 -40
  3. package/lib/client/WorktreeSurface.d.ts +4 -7
  4. package/lib/client/WorktreeSurface.d.ts.map +1 -1
  5. package/lib/client/WorktreeSurface.js +44 -1243
  6. package/lib/client/WorktreeSurface.js.map +1 -1
  7. package/lib/client/{WorktreeContext.d.ts → context/WorktreeContext.d.ts} +2 -2
  8. package/lib/client/context/WorktreeContext.d.ts.map +1 -0
  9. package/lib/client/{WorktreeContext.js → context/WorktreeContext.js} +1 -1
  10. package/lib/client/context/WorktreeContext.js.map +1 -0
  11. package/lib/client/{WorktreeHeroContext.d.ts → context/WorktreeHeroContext.d.ts} +1 -1
  12. package/lib/client/context/WorktreeHeroContext.d.ts.map +1 -0
  13. package/lib/client/{WorktreeHeroContext.js → context/WorktreeHeroContext.js} +1 -1
  14. package/lib/client/context/WorktreeHeroContext.js.map +1 -0
  15. package/lib/client/{worktree-context-store.d.ts → context/worktree-context-store.d.ts} +7 -15
  16. package/lib/client/context/worktree-context-store.d.ts.map +1 -0
  17. package/lib/client/{worktree-context-store.js → context/worktree-context-store.js} +20 -13
  18. package/lib/client/context/worktree-context-store.js.map +1 -0
  19. package/lib/client/{worktree-context.d.ts → context/worktree-context.d.ts} +1 -1
  20. package/lib/client/context/worktree-context.d.ts.map +1 -0
  21. package/lib/client/{worktree-context.js → context/worktree-context.js} +5 -3
  22. package/lib/client/context/worktree-context.js.map +1 -0
  23. package/lib/client/dsh-slot-contract.d.ts +43 -0
  24. package/lib/client/dsh-slot-contract.d.ts.map +1 -0
  25. package/lib/client/dsh-slot-contract.js +2 -0
  26. package/lib/client/dsh-slot-contract.js.map +1 -0
  27. package/lib/client/entry.d.ts +3 -3
  28. package/lib/client/entry.d.ts.map +1 -1
  29. package/lib/client/entry.js +168 -38
  30. package/lib/client/entry.js.map +1 -1
  31. package/lib/client/index.d.ts +3 -3
  32. package/lib/client/index.d.ts.map +1 -1
  33. package/lib/client/index.js +2 -2
  34. package/lib/client/index.js.map +1 -1
  35. package/lib/client/locales.d.ts +66 -0
  36. package/lib/client/locales.d.ts.map +1 -1
  37. package/lib/client/locales.js +76 -10
  38. package/lib/client/locales.js.map +1 -1
  39. package/lib/client/{WorktreeOverlay.d.ts → overlay/WorktreeOverlay.d.ts} +2 -2
  40. package/lib/client/overlay/WorktreeOverlay.d.ts.map +1 -0
  41. package/lib/client/{WorktreeOverlay.js → overlay/WorktreeOverlay.js} +2 -2
  42. package/lib/client/overlay/WorktreeOverlay.js.map +1 -0
  43. package/lib/client/overlay/overlay-bounds.d.ts.map +1 -0
  44. package/lib/client/overlay/overlay-bounds.js.map +1 -0
  45. package/lib/client/overlay/sidebar-overlay-geometry.d.ts.map +1 -0
  46. package/lib/client/overlay/sidebar-overlay-geometry.js.map +1 -0
  47. package/lib/client/permission/worktree-permission-icon.d.ts.map +1 -0
  48. package/lib/client/permission/worktree-permission-icon.js.map +1 -0
  49. package/lib/client/permission/worktree-permission.d.ts.map +1 -0
  50. package/lib/client/permission/worktree-permission.js.map +1 -0
  51. package/lib/client/session/session-view.d.ts.map +1 -0
  52. package/lib/client/session/session-view.js.map +1 -0
  53. package/lib/client/session/virtual-workspace-membership.d.ts +29 -0
  54. package/lib/client/session/virtual-workspace-membership.d.ts.map +1 -0
  55. package/lib/client/session/virtual-workspace-membership.js +131 -0
  56. package/lib/client/session/virtual-workspace-membership.js.map +1 -0
  57. package/lib/client/{worktree-session-fork.d.ts → session/worktree-session-fork.d.ts} +25 -4
  58. package/lib/client/session/worktree-session-fork.d.ts.map +1 -0
  59. package/lib/client/session/worktree-session-fork.js +309 -0
  60. package/lib/client/session/worktree-session-fork.js.map +1 -0
  61. package/lib/client/{worktree-session-order.d.ts → session/worktree-session-order.d.ts} +2 -2
  62. package/lib/client/session/worktree-session-order.d.ts.map +1 -0
  63. package/lib/client/session/worktree-session-order.js.map +1 -0
  64. package/lib/client/session/worktree-session-position.d.ts.map +1 -0
  65. package/lib/client/session/worktree-session-position.js.map +1 -0
  66. package/lib/client/{worktree-session.d.ts → session/worktree-session.d.ts} +3 -3
  67. package/lib/client/session/worktree-session.d.ts.map +1 -0
  68. package/lib/client/{worktree-session.js → session/worktree-session.js} +3 -3
  69. package/lib/client/session/worktree-session.js.map +1 -0
  70. package/lib/client/surface/actions/lifecycle-commands.d.ts +9 -0
  71. package/lib/client/surface/actions/lifecycle-commands.d.ts.map +1 -0
  72. package/lib/client/surface/actions/lifecycle-commands.js +243 -0
  73. package/lib/client/surface/actions/lifecycle-commands.js.map +1 -0
  74. package/lib/client/surface/actions/useDragActions.d.ts +26 -0
  75. package/lib/client/surface/actions/useDragActions.d.ts.map +1 -0
  76. package/lib/client/surface/actions/useDragActions.js +125 -0
  77. package/lib/client/surface/actions/useDragActions.js.map +1 -0
  78. package/lib/client/surface/actions/useLifecycleActions.d.ts +30 -0
  79. package/lib/client/surface/actions/useLifecycleActions.d.ts.map +1 -0
  80. package/lib/client/surface/actions/useLifecycleActions.js +140 -0
  81. package/lib/client/surface/actions/useLifecycleActions.js.map +1 -0
  82. package/lib/client/surface/actions/useNativeActions.d.ts +48 -0
  83. package/lib/client/surface/actions/useNativeActions.d.ts.map +1 -0
  84. package/lib/client/surface/actions/useNativeActions.js +182 -0
  85. package/lib/client/surface/actions/useNativeActions.js.map +1 -0
  86. package/lib/client/surface/actions/useSessionActions.d.ts +24 -0
  87. package/lib/client/surface/actions/useSessionActions.d.ts.map +1 -0
  88. package/lib/client/surface/actions/useSessionActions.js +116 -0
  89. package/lib/client/surface/actions/useSessionActions.js.map +1 -0
  90. package/lib/client/surface/actions/useSurfaceMutation.d.ts +15 -0
  91. package/lib/client/surface/actions/useSurfaceMutation.d.ts.map +1 -0
  92. package/lib/client/surface/actions/useSurfaceMutation.js +24 -0
  93. package/lib/client/surface/actions/useSurfaceMutation.js.map +1 -0
  94. package/lib/client/surface/actions/useWorktreeRegistration.d.ts +31 -0
  95. package/lib/client/surface/actions/useWorktreeRegistration.d.ts.map +1 -0
  96. package/lib/client/surface/actions/useWorktreeRegistration.js +203 -0
  97. package/lib/client/surface/actions/useWorktreeRegistration.js.map +1 -0
  98. package/lib/client/surface/actions/worktree-cleanup-flow.d.ts +10 -0
  99. package/lib/client/surface/actions/worktree-cleanup-flow.d.ts.map +1 -0
  100. package/lib/client/surface/actions/worktree-cleanup-flow.js +19 -0
  101. package/lib/client/surface/actions/worktree-cleanup-flow.js.map +1 -0
  102. package/lib/client/surface/components/AccessConfirmation.d.ts +9 -0
  103. package/lib/client/surface/components/AccessConfirmation.d.ts.map +1 -0
  104. package/lib/client/surface/components/AccessConfirmation.js +18 -0
  105. package/lib/client/surface/components/AccessConfirmation.js.map +1 -0
  106. package/lib/client/surface/components/ActiveWorktree.d.ts +28 -0
  107. package/lib/client/surface/components/ActiveWorktree.d.ts.map +1 -0
  108. package/lib/client/surface/components/ActiveWorktree.js +154 -0
  109. package/lib/client/surface/components/ActiveWorktree.js.map +1 -0
  110. package/lib/client/surface/components/ArchivedWorktree.d.ts +24 -0
  111. package/lib/client/surface/components/ArchivedWorktree.d.ts.map +1 -0
  112. package/lib/client/surface/components/ArchivedWorktree.js +145 -0
  113. package/lib/client/surface/components/ArchivedWorktree.js.map +1 -0
  114. package/lib/client/surface/components/ArchivedWorktrees.d.ts +25 -0
  115. package/lib/client/surface/components/ArchivedWorktrees.d.ts.map +1 -0
  116. package/lib/client/surface/components/ArchivedWorktrees.js +20 -0
  117. package/lib/client/surface/components/ArchivedWorktrees.js.map +1 -0
  118. package/lib/client/surface/components/LifecycleDialogs.d.ts +20 -0
  119. package/lib/client/surface/components/LifecycleDialogs.d.ts.map +1 -0
  120. package/lib/client/surface/components/LifecycleDialogs.js +31 -0
  121. package/lib/client/surface/components/LifecycleDialogs.js.map +1 -0
  122. package/lib/client/surface/components/NativeDialogs.d.ts +9 -0
  123. package/lib/client/surface/components/NativeDialogs.d.ts.map +1 -0
  124. package/lib/client/surface/components/NativeDialogs.js +14 -0
  125. package/lib/client/surface/components/NativeDialogs.js.map +1 -0
  126. package/lib/client/surface/components/NotificationToasts.d.ts +7 -0
  127. package/lib/client/surface/components/NotificationToasts.d.ts.map +1 -0
  128. package/lib/client/surface/components/NotificationToasts.js +24 -0
  129. package/lib/client/surface/components/NotificationToasts.js.map +1 -0
  130. package/lib/client/surface/components/RegistrationDialog.d.ts +15 -0
  131. package/lib/client/surface/components/RegistrationDialog.d.ts.map +1 -0
  132. package/lib/client/surface/components/RegistrationDialog.js +22 -0
  133. package/lib/client/surface/components/RegistrationDialog.js.map +1 -0
  134. package/lib/client/surface/components/SurfaceContent.d.ts +31 -0
  135. package/lib/client/surface/components/SurfaceContent.d.ts.map +1 -0
  136. package/lib/client/surface/components/SurfaceContent.js +65 -0
  137. package/lib/client/surface/components/SurfaceContent.js.map +1 -0
  138. package/lib/client/surface/components/SurfaceHeader.d.ts +15 -0
  139. package/lib/client/surface/components/SurfaceHeader.d.ts.map +1 -0
  140. package/lib/client/surface/components/SurfaceHeader.js +42 -0
  141. package/lib/client/surface/components/SurfaceHeader.js.map +1 -0
  142. package/lib/client/surface/components/WorkspaceTree.d.ts +32 -0
  143. package/lib/client/surface/components/WorkspaceTree.d.ts.map +1 -0
  144. package/lib/client/surface/components/WorkspaceTree.js +145 -0
  145. package/lib/client/surface/components/WorkspaceTree.js.map +1 -0
  146. package/lib/client/{worktree-surface-dialogs.d.ts → surface/components/dialogs.d.ts} +5 -2
  147. package/lib/client/surface/components/dialogs.d.ts.map +1 -0
  148. package/lib/client/{worktree-surface-dialogs.js → surface/components/dialogs.js} +67 -24
  149. package/lib/client/surface/components/dialogs.js.map +1 -0
  150. package/lib/client/{worktree-surface-rows.d.ts → surface/components/rows.d.ts} +3 -3
  151. package/lib/client/surface/components/rows.d.ts.map +1 -0
  152. package/lib/client/{worktree-surface-rows.js → surface/components/rows.js} +79 -17
  153. package/lib/client/surface/components/rows.js.map +1 -0
  154. package/lib/client/surface/notification-queue.d.ts +11 -0
  155. package/lib/client/surface/notification-queue.d.ts.map +1 -0
  156. package/lib/client/surface/notification-queue.js +19 -0
  157. package/lib/client/surface/notification-queue.js.map +1 -0
  158. package/lib/client/{worktree-surface-selectors.d.ts → surface/selectors.d.ts} +10 -5
  159. package/lib/client/surface/selectors.d.ts.map +1 -0
  160. package/lib/client/{worktree-surface-selectors.js → surface/selectors.js} +23 -6
  161. package/lib/client/surface/selectors.js.map +1 -0
  162. package/lib/client/surface/shared.d.ts +40 -0
  163. package/lib/client/surface/shared.d.ts.map +1 -0
  164. package/lib/client/surface/shared.js +53 -0
  165. package/lib/client/surface/shared.js.map +1 -0
  166. package/lib/client/surface/state/useLifecycleState.d.ts +34 -0
  167. package/lib/client/surface/state/useLifecycleState.d.ts.map +1 -0
  168. package/lib/client/surface/state/useLifecycleState.js +39 -0
  169. package/lib/client/surface/state/useLifecycleState.js.map +1 -0
  170. package/lib/client/surface/state/useRegistrationState.d.ts +34 -0
  171. package/lib/client/surface/state/useRegistrationState.d.ts.map +1 -0
  172. package/lib/client/surface/state/useRegistrationState.js +44 -0
  173. package/lib/client/surface/state/useRegistrationState.js.map +1 -0
  174. package/lib/client/surface/state/useSessionExpansion.d.ts +39 -0
  175. package/lib/client/surface/state/useSessionExpansion.d.ts.map +1 -0
  176. package/lib/client/surface/state/useSessionExpansion.js +230 -0
  177. package/lib/client/surface/state/useSessionExpansion.js.map +1 -0
  178. package/lib/client/surface/state/useSessionOrdering.d.ts +15 -0
  179. package/lib/client/surface/state/useSessionOrdering.d.ts.map +1 -0
  180. package/lib/client/surface/state/useSessionOrdering.js +68 -0
  181. package/lib/client/surface/state/useSessionOrdering.js.map +1 -0
  182. package/lib/client/surface/state/useSurfaceMenus.d.ts +9 -0
  183. package/lib/client/surface/state/useSurfaceMenus.d.ts.map +1 -0
  184. package/lib/client/surface/state/useSurfaceMenus.js +15 -0
  185. package/lib/client/surface/state/useSurfaceMenus.js.map +1 -0
  186. package/lib/client/surface/state/useSurfaceRefresh.d.ts +39 -0
  187. package/lib/client/surface/state/useSurfaceRefresh.d.ts.map +1 -0
  188. package/lib/client/surface/state/useSurfaceRefresh.js +274 -0
  189. package/lib/client/surface/state/useSurfaceRefresh.js.map +1 -0
  190. package/lib/client/surface/state/useSurfaceSources.d.ts +31 -0
  191. package/lib/client/surface/state/useSurfaceSources.d.ts.map +1 -0
  192. package/lib/client/surface/state/useSurfaceSources.js +63 -0
  193. package/lib/client/surface/state/useSurfaceSources.js.map +1 -0
  194. package/lib/client/{worktree-surface-types.d.ts → surface/types.d.ts} +68 -13
  195. package/lib/client/surface/types.d.ts.map +1 -0
  196. package/lib/client/surface/types.js +2 -0
  197. package/lib/client/surface/types.js.map +1 -0
  198. package/lib/client/{WorktreeModeAction.d.ts → view/WorktreeModeAction.d.ts} +1 -1
  199. package/lib/client/view/WorktreeModeAction.d.ts.map +1 -0
  200. package/lib/client/{WorktreeModeAction.js → view/WorktreeModeAction.js} +1 -1
  201. package/lib/client/view/WorktreeModeAction.js.map +1 -0
  202. package/lib/client/view/navigation.d.ts.map +1 -0
  203. package/lib/client/view/navigation.js.map +1 -0
  204. package/lib/client/{view-mode-store.d.ts → view/view-mode-store.d.ts} +1 -1
  205. package/lib/client/view/view-mode-store.d.ts.map +1 -0
  206. package/lib/client/{view-mode-store.js → view/view-mode-store.js} +1 -1
  207. package/lib/client/view/view-mode-store.js.map +1 -0
  208. package/lib/client/{view-mode.d.ts → view/view-mode.d.ts} +20 -6
  209. package/lib/client/view/view-mode.d.ts.map +1 -0
  210. package/lib/client/{view-mode.js → view/view-mode.js} +35 -10
  211. package/lib/client/view/view-mode.js.map +1 -0
  212. package/lib/client/{worktree-error-copy.d.ts → view/worktree-error-copy.d.ts} +2 -2
  213. package/lib/client/view/worktree-error-copy.d.ts.map +1 -0
  214. package/lib/client/view/worktree-error-copy.js.map +1 -0
  215. package/lib/client/{worktree-expand-state.d.ts → view/worktree-expand-state.d.ts} +6 -4
  216. package/lib/client/view/worktree-expand-state.d.ts.map +1 -0
  217. package/lib/client/{worktree-expand-state.js → view/worktree-expand-state.js} +11 -0
  218. package/lib/client/view/worktree-expand-state.js.map +1 -0
  219. package/lib/client/{worktree-view-actions.d.ts → view/worktree-view-actions.d.ts} +11 -5
  220. package/lib/client/view/worktree-view-actions.d.ts.map +1 -0
  221. package/lib/client/{worktree-view-actions.js → view/worktree-view-actions.js} +13 -11
  222. package/lib/client/view/worktree-view-actions.js.map +1 -0
  223. package/lib/client/view/worktree-view-errors.d.ts.map +1 -0
  224. package/lib/client/view/worktree-view-errors.js.map +1 -0
  225. package/lib/client/{worktree-view-read.d.ts → view/worktree-view-read.d.ts} +21 -9
  226. package/lib/client/view/worktree-view-read.d.ts.map +1 -0
  227. package/lib/client/{worktree-view-read.js → view/worktree-view-read.js} +78 -10
  228. package/lib/client/view/worktree-view-read.js.map +1 -0
  229. package/lib/client/view/worktree-view.d.ts.map +1 -0
  230. package/lib/client/view/worktree-view.js.map +1 -0
  231. package/lib/client/worktree-connection.d.ts +5 -0
  232. package/lib/client/worktree-connection.d.ts.map +1 -1
  233. package/lib/client/worktree-connection.js +16 -0
  234. package/lib/client/worktree-connection.js.map +1 -1
  235. package/lib/client.js +5990 -3139
  236. package/lib/client.js.map +1 -1
  237. package/lib/contract/index.contract.js +10 -0
  238. package/lib/contract/index.contract.js.map +1 -1
  239. package/lib/contract/index.d.ts +46 -3
  240. package/lib/contract/index.d.ts.map +1 -1
  241. package/lib/contract/index.js +7 -0
  242. package/lib/contract/index.js.map +1 -1
  243. package/lib/host/dsh-read-adapter.d.ts +10 -1
  244. package/lib/host/dsh-read-adapter.d.ts.map +1 -1
  245. package/lib/host/dsh-read-adapter.js +18 -1
  246. package/lib/host/dsh-read-adapter.js.map +1 -1
  247. package/lib/host/remote.d.ts.map +1 -1
  248. package/lib/host/remote.js +14 -0
  249. package/lib/host/remote.js.map +1 -1
  250. package/lib/host/service.d.ts +24 -0
  251. package/lib/host/service.d.ts.map +1 -1
  252. package/lib/host/service.js +39 -1
  253. package/lib/host/service.js.map +1 -1
  254. package/lib/host/worktree-activity.d.ts +13 -0
  255. package/lib/host/worktree-activity.d.ts.map +1 -0
  256. package/lib/host/worktree-activity.js +23 -0
  257. package/lib/host/worktree-activity.js.map +1 -0
  258. package/lib/host/worktree-permission-manager.js +2 -2
  259. package/lib/host/worktree-permission-manager.js.map +1 -1
  260. package/lib/host/worktree-permission.d.ts +3 -2
  261. package/lib/host/worktree-permission.d.ts.map +1 -1
  262. package/lib/host/worktree-permission.js +29 -5
  263. package/lib/host/worktree-permission.js.map +1 -1
  264. package/lib/index.d.ts +3 -3
  265. package/lib/index.d.ts.map +1 -1
  266. package/lib/index.js +2 -2
  267. package/lib/index.js.map +1 -1
  268. package/lib/manage/manager-context.d.ts +2 -1
  269. package/lib/manage/manager-context.d.ts.map +1 -1
  270. package/lib/manage/manager-sessions.js +4 -4
  271. package/lib/manage/manager-sessions.js.map +1 -1
  272. package/lib/manage/manager-worktree-lifecycle.d.ts +23 -0
  273. package/lib/manage/manager-worktree-lifecycle.d.ts.map +1 -0
  274. package/lib/manage/manager-worktree-lifecycle.js +165 -0
  275. package/lib/manage/manager-worktree-lifecycle.js.map +1 -0
  276. package/lib/manage/manager-worktrees.d.ts +1 -6
  277. package/lib/manage/manager-worktrees.d.ts.map +1 -1
  278. package/lib/manage/manager-worktrees.js +83 -114
  279. package/lib/manage/manager-worktrees.js.map +1 -1
  280. package/lib/manage/manager.d.ts +17 -1
  281. package/lib/manage/manager.d.ts.map +1 -1
  282. package/lib/manage/manager.js +25 -6
  283. package/lib/manage/manager.js.map +1 -1
  284. package/lib/provider/generated-name.d.ts +8 -0
  285. package/lib/provider/generated-name.d.ts.map +1 -0
  286. package/lib/provider/generated-name.js +29 -0
  287. package/lib/provider/generated-name.js.map +1 -0
  288. package/lib/provider/{git.d.ts → git/adapter.d.ts} +2 -2
  289. package/lib/provider/git/adapter.d.ts.map +1 -0
  290. package/lib/provider/{git.js → git/adapter.js} +15 -2
  291. package/lib/provider/git/adapter.js.map +1 -0
  292. package/lib/provider/{repository-fingerprint.d.ts → git/repository-fingerprint.d.ts} +1 -1
  293. package/lib/provider/git/repository-fingerprint.d.ts.map +1 -0
  294. package/lib/provider/git/repository-fingerprint.js.map +1 -0
  295. package/lib/provider/{subprocess.d.ts → git/subprocess.d.ts} +1 -1
  296. package/lib/provider/git/subprocess.d.ts.map +1 -0
  297. package/lib/provider/{subprocess.js → git/subprocess.js} +8 -0
  298. package/lib/provider/git/subprocess.js.map +1 -0
  299. package/lib/provider/git/worktree-status.d.ts +5 -0
  300. package/lib/provider/git/worktree-status.d.ts.map +1 -0
  301. package/lib/provider/git/worktree-status.js +23 -0
  302. package/lib/provider/git/worktree-status.js.map +1 -0
  303. package/lib/provider/index.d.ts +5 -5
  304. package/lib/provider/index.d.ts.map +1 -1
  305. package/lib/provider/index.js +5 -5
  306. package/lib/provider/index.js.map +1 -1
  307. package/lib/provider/mutation-token.d.ts +1 -1
  308. package/lib/provider/mutation-token.d.ts.map +1 -1
  309. package/lib/provider/mutation-token.js +1 -0
  310. package/lib/provider/mutation-token.js.map +1 -1
  311. package/lib/provider/sidecar/mutation-lock.d.ts.map +1 -0
  312. package/lib/provider/{mutation-lock.js → sidecar/mutation-lock.js} +1 -1
  313. package/lib/provider/sidecar/mutation-lock.js.map +1 -0
  314. package/lib/provider/{sidecar.d.ts → sidecar/repository.d.ts} +3 -3
  315. package/lib/provider/sidecar/repository.d.ts.map +1 -0
  316. package/lib/provider/{sidecar.js → sidecar/repository.js} +13 -6
  317. package/lib/provider/sidecar/repository.js.map +1 -0
  318. package/lib/provider/{sidecar-persistence.d.ts → sidecar/sidecar-persistence.d.ts} +1 -1
  319. package/lib/provider/sidecar/sidecar-persistence.d.ts.map +1 -0
  320. package/lib/provider/{sidecar-persistence.js → sidecar/sidecar-persistence.js} +29 -2
  321. package/lib/provider/sidecar/sidecar-persistence.js.map +1 -0
  322. package/lib/provider/{sidecar-schema.d.ts → sidecar/sidecar-schema.d.ts} +1 -1
  323. package/lib/provider/sidecar/sidecar-schema.d.ts.map +1 -0
  324. package/lib/provider/{sidecar-schema.js → sidecar/sidecar-schema.js} +52 -16
  325. package/lib/provider/sidecar/sidecar-schema.js.map +1 -0
  326. package/lib/provider/transaction/dependencies.d.ts +10 -0
  327. package/lib/provider/transaction/dependencies.d.ts.map +1 -0
  328. package/lib/provider/transaction/dependencies.js +2 -0
  329. package/lib/provider/transaction/dependencies.js.map +1 -0
  330. package/lib/provider/transaction/index.d.ts +17 -0
  331. package/lib/provider/transaction/index.d.ts.map +1 -0
  332. package/lib/provider/transaction/index.js +44 -0
  333. package/lib/provider/transaction/index.js.map +1 -0
  334. package/lib/provider/transaction/operations/adopt-branch.d.ts +6 -0
  335. package/lib/provider/transaction/operations/adopt-branch.d.ts.map +1 -0
  336. package/lib/provider/transaction/operations/adopt-branch.js +59 -0
  337. package/lib/provider/transaction/operations/adopt-branch.js.map +1 -0
  338. package/lib/provider/transaction/operations/clean.d.ts +4 -0
  339. package/lib/provider/transaction/operations/clean.d.ts.map +1 -0
  340. package/lib/provider/transaction/operations/clean.js +168 -0
  341. package/lib/provider/transaction/operations/clean.js.map +1 -0
  342. package/lib/provider/transaction/operations/create.d.ts +5 -0
  343. package/lib/provider/transaction/operations/create.d.ts.map +1 -0
  344. package/lib/provider/transaction/operations/create.js +136 -0
  345. package/lib/provider/transaction/operations/create.js.map +1 -0
  346. package/lib/provider/transaction/operations/import.d.ts +5 -0
  347. package/lib/provider/transaction/operations/import.d.ts.map +1 -0
  348. package/lib/provider/transaction/operations/import.js +92 -0
  349. package/lib/provider/transaction/operations/import.js.map +1 -0
  350. package/lib/provider/transaction/operations/remove.d.ts +4 -0
  351. package/lib/provider/transaction/operations/remove.d.ts.map +1 -0
  352. package/lib/provider/transaction/operations/remove.js +164 -0
  353. package/lib/provider/transaction/operations/remove.js.map +1 -0
  354. package/lib/provider/transaction/recovery/failure-recovery.d.ts +32 -0
  355. package/lib/provider/transaction/recovery/failure-recovery.d.ts.map +1 -0
  356. package/lib/provider/transaction/recovery/failure-recovery.js +147 -0
  357. package/lib/provider/transaction/recovery/failure-recovery.js.map +1 -0
  358. package/lib/provider/transaction/recovery/recover.d.ts +4 -0
  359. package/lib/provider/transaction/recovery/recover.d.ts.map +1 -0
  360. package/lib/provider/transaction/recovery/recover.js +162 -0
  361. package/lib/provider/transaction/recovery/recover.js.map +1 -0
  362. package/lib/provider/transaction/support/admission.d.ts +7 -0
  363. package/lib/provider/transaction/support/admission.d.ts.map +1 -0
  364. package/lib/provider/transaction/support/admission.js +90 -0
  365. package/lib/provider/transaction/support/admission.js.map +1 -0
  366. package/lib/provider/transaction/support/inspection.d.ts +11 -0
  367. package/lib/provider/transaction/support/inspection.d.ts.map +1 -0
  368. package/lib/provider/transaction/support/inspection.js +51 -0
  369. package/lib/provider/transaction/support/inspection.js.map +1 -0
  370. package/lib/provider/transaction/support/journal.d.ts +12 -0
  371. package/lib/provider/transaction/support/journal.d.ts.map +1 -0
  372. package/lib/provider/transaction/support/journal.js +72 -0
  373. package/lib/provider/transaction/support/journal.js.map +1 -0
  374. package/lib/provider/transaction/support/locking.d.ts +4 -0
  375. package/lib/provider/transaction/support/locking.d.ts.map +1 -0
  376. package/lib/provider/transaction/support/locking.js +11 -0
  377. package/lib/provider/transaction/support/locking.js.map +1 -0
  378. package/lib/provider/transaction/support/path-safety.d.ts +11 -0
  379. package/lib/provider/transaction/support/path-safety.d.ts.map +1 -0
  380. package/lib/provider/transaction/support/path-safety.js +82 -0
  381. package/lib/provider/transaction/support/path-safety.js.map +1 -0
  382. package/lib/provider/transaction/support/paths.d.ts +10 -0
  383. package/lib/provider/transaction/support/paths.d.ts.map +1 -0
  384. package/lib/provider/transaction/support/paths.js +68 -0
  385. package/lib/provider/transaction/support/paths.js.map +1 -0
  386. package/lib/provider/transaction/support/publication.d.ts +9 -0
  387. package/lib/provider/transaction/support/publication.d.ts.map +1 -0
  388. package/lib/provider/transaction/support/publication.js +92 -0
  389. package/lib/provider/transaction/support/publication.js.map +1 -0
  390. package/lib/provider/transaction/types.d.ts +38 -0
  391. package/lib/provider/transaction/types.d.ts.map +1 -0
  392. package/lib/provider/transaction/types.js +2 -0
  393. package/lib/provider/transaction/types.js.map +1 -0
  394. package/lib/provider/types.d.ts +22 -3
  395. package/lib/provider/types.d.ts.map +1 -1
  396. package/lib/provider/types.js +1 -1
  397. package/lib/provider/types.js.map +1 -1
  398. package/lib/provider/worktree-lifecycle.d.ts +19 -0
  399. package/lib/provider/worktree-lifecycle.d.ts.map +1 -0
  400. package/lib/provider/worktree-lifecycle.js +44 -0
  401. package/lib/provider/worktree-lifecycle.js.map +1 -0
  402. package/lib/typert.host.js +269 -30
  403. package/lib/typert.remote-client.d.ts +10 -0
  404. package/lib/typert.remote-client.d.ts.map +1 -1
  405. package/lib/typert.remote-client.js +269 -30
  406. package/package.json +48 -34
  407. package/lib/client/WorktreeContext.d.ts.map +0 -1
  408. package/lib/client/WorktreeContext.js.map +0 -1
  409. package/lib/client/WorktreeHeroContext.d.ts.map +0 -1
  410. package/lib/client/WorktreeHeroContext.js.map +0 -1
  411. package/lib/client/WorktreeModeAction.d.ts.map +0 -1
  412. package/lib/client/WorktreeModeAction.js.map +0 -1
  413. package/lib/client/WorktreeOverlay.d.ts.map +0 -1
  414. package/lib/client/WorktreeOverlay.js.map +0 -1
  415. package/lib/client/navigation.d.ts.map +0 -1
  416. package/lib/client/navigation.js.map +0 -1
  417. package/lib/client/overlay-bounds.d.ts.map +0 -1
  418. package/lib/client/overlay-bounds.js.map +0 -1
  419. package/lib/client/session-view.d.ts.map +0 -1
  420. package/lib/client/session-view.js.map +0 -1
  421. package/lib/client/sidebar-overlay-geometry.d.ts.map +0 -1
  422. package/lib/client/sidebar-overlay-geometry.js.map +0 -1
  423. package/lib/client/view-mode-store.d.ts.map +0 -1
  424. package/lib/client/view-mode-store.js.map +0 -1
  425. package/lib/client/view-mode.d.ts.map +0 -1
  426. package/lib/client/view-mode.js.map +0 -1
  427. package/lib/client/virtual-workspace-membership.d.ts +0 -27
  428. package/lib/client/virtual-workspace-membership.d.ts.map +0 -1
  429. package/lib/client/virtual-workspace-membership.js +0 -106
  430. package/lib/client/virtual-workspace-membership.js.map +0 -1
  431. package/lib/client/worktree-context-store.d.ts.map +0 -1
  432. package/lib/client/worktree-context-store.js.map +0 -1
  433. package/lib/client/worktree-context.d.ts.map +0 -1
  434. package/lib/client/worktree-context.js.map +0 -1
  435. package/lib/client/worktree-error-copy.d.ts.map +0 -1
  436. package/lib/client/worktree-error-copy.js.map +0 -1
  437. package/lib/client/worktree-expand-state.d.ts.map +0 -1
  438. package/lib/client/worktree-expand-state.js.map +0 -1
  439. package/lib/client/worktree-permission-icon.d.ts.map +0 -1
  440. package/lib/client/worktree-permission-icon.js.map +0 -1
  441. package/lib/client/worktree-permission.d.ts.map +0 -1
  442. package/lib/client/worktree-permission.js.map +0 -1
  443. package/lib/client/worktree-session-fork.d.ts.map +0 -1
  444. package/lib/client/worktree-session-fork.js +0 -174
  445. package/lib/client/worktree-session-fork.js.map +0 -1
  446. package/lib/client/worktree-session-order.d.ts.map +0 -1
  447. package/lib/client/worktree-session-order.js.map +0 -1
  448. package/lib/client/worktree-session-position.d.ts.map +0 -1
  449. package/lib/client/worktree-session-position.js.map +0 -1
  450. package/lib/client/worktree-session.d.ts.map +0 -1
  451. package/lib/client/worktree-session.js.map +0 -1
  452. package/lib/client/worktree-surface-dialogs.d.ts.map +0 -1
  453. package/lib/client/worktree-surface-dialogs.js.map +0 -1
  454. package/lib/client/worktree-surface-rows.d.ts.map +0 -1
  455. package/lib/client/worktree-surface-rows.js.map +0 -1
  456. package/lib/client/worktree-surface-selectors.d.ts.map +0 -1
  457. package/lib/client/worktree-surface-selectors.js.map +0 -1
  458. package/lib/client/worktree-surface-types.d.ts.map +0 -1
  459. package/lib/client/worktree-surface-types.js +0 -2
  460. package/lib/client/worktree-surface-types.js.map +0 -1
  461. package/lib/client/worktree-view-actions.d.ts.map +0 -1
  462. package/lib/client/worktree-view-actions.js.map +0 -1
  463. package/lib/client/worktree-view-errors.d.ts.map +0 -1
  464. package/lib/client/worktree-view-errors.js.map +0 -1
  465. package/lib/client/worktree-view-read.d.ts.map +0 -1
  466. package/lib/client/worktree-view-read.js.map +0 -1
  467. package/lib/client/worktree-view.d.ts.map +0 -1
  468. package/lib/client/worktree-view.js.map +0 -1
  469. package/lib/provider/git.d.ts.map +0 -1
  470. package/lib/provider/git.js.map +0 -1
  471. package/lib/provider/mutation-lock.d.ts.map +0 -1
  472. package/lib/provider/mutation-lock.js.map +0 -1
  473. package/lib/provider/repository-fingerprint.d.ts.map +0 -1
  474. package/lib/provider/repository-fingerprint.js.map +0 -1
  475. package/lib/provider/sidecar-persistence.d.ts.map +0 -1
  476. package/lib/provider/sidecar-persistence.js.map +0 -1
  477. package/lib/provider/sidecar-schema.d.ts.map +0 -1
  478. package/lib/provider/sidecar-schema.js.map +0 -1
  479. package/lib/provider/sidecar.d.ts.map +0 -1
  480. package/lib/provider/sidecar.js.map +0 -1
  481. package/lib/provider/subprocess.d.ts.map +0 -1
  482. package/lib/provider/subprocess.js.map +0 -1
  483. package/lib/provider/transaction.d.ts +0 -65
  484. package/lib/provider/transaction.d.ts.map +0 -1
  485. package/lib/provider/transaction.js +0 -1011
  486. package/lib/provider/transaction.js.map +0 -1
  487. /package/lib/client/{overlay-bounds.d.ts → overlay/overlay-bounds.d.ts} +0 -0
  488. /package/lib/client/{overlay-bounds.js → overlay/overlay-bounds.js} +0 -0
  489. /package/lib/client/{sidebar-overlay-geometry.d.ts → overlay/sidebar-overlay-geometry.d.ts} +0 -0
  490. /package/lib/client/{sidebar-overlay-geometry.js → overlay/sidebar-overlay-geometry.js} +0 -0
  491. /package/lib/client/{worktree-permission-icon.d.ts → permission/worktree-permission-icon.d.ts} +0 -0
  492. /package/lib/client/{worktree-permission-icon.js → permission/worktree-permission-icon.js} +0 -0
  493. /package/lib/client/{worktree-permission.d.ts → permission/worktree-permission.d.ts} +0 -0
  494. /package/lib/client/{worktree-permission.js → permission/worktree-permission.js} +0 -0
  495. /package/lib/client/{session-view.d.ts → session/session-view.d.ts} +0 -0
  496. /package/lib/client/{session-view.js → session/session-view.js} +0 -0
  497. /package/lib/client/{worktree-session-order.js → session/worktree-session-order.js} +0 -0
  498. /package/lib/client/{worktree-session-position.d.ts → session/worktree-session-position.d.ts} +0 -0
  499. /package/lib/client/{worktree-session-position.js → session/worktree-session-position.js} +0 -0
  500. /package/lib/client/{navigation.d.ts → view/navigation.d.ts} +0 -0
  501. /package/lib/client/{navigation.js → view/navigation.js} +0 -0
  502. /package/lib/client/{worktree-error-copy.js → view/worktree-error-copy.js} +0 -0
  503. /package/lib/client/{worktree-view-errors.d.ts → view/worktree-view-errors.d.ts} +0 -0
  504. /package/lib/client/{worktree-view-errors.js → view/worktree-view-errors.js} +0 -0
  505. /package/lib/client/{worktree-view.d.ts → view/worktree-view.d.ts} +0 -0
  506. /package/lib/client/{worktree-view.js → view/worktree-view.js} +0 -0
  507. /package/lib/provider/{repository-fingerprint.js → git/repository-fingerprint.js} +0 -0
  508. /package/lib/provider/{mutation-lock.d.ts → sidecar/mutation-lock.d.ts} +0 -0
package/README.md CHANGED
@@ -23,7 +23,7 @@ the adjacent Import tab, and a standard dropdown containing safe example branch/
23
23
  - Search Workspaces and create a Git Worktree and branch from an existing local branch.
24
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
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.
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
27
  - Create a normal Session from Main or a Session whose runtime cwd is an active Worktree, then
28
28
  open it directly.
29
29
  - For active Worktree Sessions, request the named `worktree-full-access` preset after an
@@ -53,7 +53,7 @@ the adjacent Import tab, and a standard dropdown containing safe example branch/
53
53
  Main/Local. A sidecar failure keeps the child available and exposes retryable binding recovery.
54
54
  - See ready, repair, active, and detached Worktree states, including retryable operation errors.
55
55
  - 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 `Remove Worktree`
56
+ Main and detached rows show only `Copy path`; active Worktree rows also show `Archive Worktree`
57
57
  with confirmation.
58
58
  - Create a new Worktree from the Local or an active Worktree's options menu. The Create dialog
59
59
  uses the selected row's current branch as its base and suggests the next available numbered
@@ -62,6 +62,7 @@ the adjacent Import tab, and a standard dropdown containing safe example branch/
62
62
  be reordered within their owning Workspace; order is stored in the plugin sidecar and Main is
63
63
  fixed first.
64
64
  - 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.
65
+ - Provide a Collapse All button in the Worktree Header to collapse all Workspaces and Worktrees at once.
65
66
  - 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 only when the row is outside the first five, clears a hiding search, and scrolls the row into view; this browser-local behavior does not change persisted expansion choices.
66
67
  - Keep the current local branch or Worktree branch visible as read-only context in the existing
67
68
  Conversation title row and in the blank-session Hero.
@@ -80,22 +81,14 @@ the adjacent Import tab, and a standard dropdown containing safe example branch/
80
81
 
81
82
  ### Compatibility and prerequisites
82
83
 
83
- - For development and source validation, use a clean checkout of the official [DeepSeek Harness
84
- repository](https://github.com/deepseek-ai/deepseek-harness) on its current default branch. The
85
- repository currently uses `master` rather than `main`; it is developer-preview software, so its
86
- package and API contracts may change. Run the upstream install/build steps before installing
87
- this plugin into that profile.
88
- - The target profile, such as `web` or `demo`, must already start successfully, and the plugin
89
- must be installed into the same profile that launches the Web UI.
90
- - DSH Client must provide the native `@deepseek-ai/dsh-client-ui-conversation` package and its
91
- `conversation.session.header.actions` seat.
92
- - Git must be installed and available on `PATH` for Worktree operations. A Workspace must be
93
- inside a Git repository with an initial commit and at least one local branch. A missing Git
94
- executable shows install guidance and no command block; a missing repository, initial commit,
95
- or local branch shows copyable setup commands. The plugin does not run setup or installation
96
- commands or modify Workspace files.
97
- - The package declares an installable `dsh.bundle` and provides `cordis.patch.yml`; its browser
98
- UI is declared through the `dsh.client` metadata.
84
+ The supported compatibility facts are:
85
+
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 |
99
92
 
100
93
  ## Installation
101
94
 
@@ -131,12 +124,13 @@ npm view @cerbur/clutch-dsh-worktree version --registry=https://registry.npmjs.o
131
124
 
132
125
  For source-based development or validation, prepare the upstream checkout first. The current
133
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`:
134
128
 
135
129
  ```bash
136
130
  git clone https://github.com/deepseek-ai/deepseek-harness.git
137
131
  cd deepseek-harness
138
132
  git fetch origin
139
- git pull --ff-only origin master
133
+ git checkout dsh-v0.1.2-rc.1
140
134
  pnpm install
141
135
  pnpm run build
142
136
  ```
@@ -232,6 +226,13 @@ blank-session Hero. The displayed language follows DSH's current language settin
232
226
 
233
227
  ### Create a Worktree
234
228
 
229
+ New directories use `$dshHome/clutch-dsh-worktree/worktree/wt_<12-hex-characters>`
230
+ (15 characters in the folder name, with 48 bits of cryptographic randomness).
231
+ Occupied directory names, Git registrations, and sidecar identities are automatically retried.
232
+ After eight random candidates collide, numeric suffixes such as `_1` and `_2` are tried until
233
+ available or cancelled. Existing Worktree paths and IDs stay unchanged; branch conflicts and
234
+ other Git failures retain their normal error handling.
235
+
235
236
  1. Select a Workspace, press its `+`, choose a baseline local branch, and enter a Worktree name.
236
237
  The default branch name is `dsh/<8-character-random-string>`.
237
238
  2. To create a sibling from an existing Worktree, open that active Worktree's options menu and
@@ -239,8 +240,8 @@ blank-session Hero. The displayed language follows DSH's current language settin
239
240
  chooses the next available numeric suffix for the name; existing names are skipped.
240
241
  3. The target Worktree path must be absolute, belong to the same Project, and differ from the
241
242
  Project root. Relative paths, a different Project, or the Project root are rejected.
242
- 4. Git must be installed and available on `PATH`. A missing Git executable shows install guidance
243
- and no command block; install Git, restart DSH, and retry. If the repository, initial commit,
243
+ 4. Git must be installed and available on `PATH`. A missing Git executable shows install guidance and no command block;
244
+ install Git, restart DSH, and retry. If the repository, initial commit,
244
245
  or local branch is missing, follow the copyable setup commands in the dialog. The plugin only
245
246
  renders this guidance; it does not run setup or installation commands or edit business files.
246
247
 
@@ -249,7 +250,10 @@ blank-session Hero. The displayed language follows DSH's current language settin
249
250
  1. Select a Workspace, press its `+`, and choose the `Import` tab. The dialog loads Git-linked
250
251
  Worktrees for that repository through the existing DSH `/api` Connection.
251
252
  2. The first version lists only branch-attached, non-root Worktrees that are not already present
252
- in the plugin sidecar. Detached HEAD entries are intentionally omitted. Candidates are presented
253
+ in the plugin sidecar. Detached HEAD, bare, prunable, missing-directory and missing-`.git`
254
+ entries are omitted. Managed health and import eligibility share one runtime status mapping;
255
+ importing rechecks that status. Locked Worktrees remain eligible when otherwise ready.
256
+ Candidates are presented
253
257
  in a standard dropdown; each option shows its branch first and absolute path as secondary
254
258
  diagnostic text.
255
259
  3. Choose an option and select `Import Worktree`. Registration writes only the plugin sidecar;
@@ -265,9 +269,10 @@ blank-session Hero. The displayed language follows DSH's current language settin
265
269
 
266
270
  - Use Main's `+` to create a normal DSH Session in the Project-root view.
267
271
  - Use a Worktree's `+` to create or reuse a Session with that Worktree as its runtime cwd. The
268
- plugin calls the upstream runtime with `session.create({ cwd: worktreePath })`, then saves the
269
- external binding and opens the Session. The browser-local `{ workspaceId, sessionId }` membership
270
- projection is refreshed afterward, so the newly created Session does not briefly appear in Main.
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.
271
276
  - The connector reuses an unarchived blank Session with the exact target cwd when possible. An
272
277
  already-bound Session opens directly; an unbound candidate is bound before projection and
273
278
  opening. Otherwise the new-Session flow is `create → bind → open → refresh`, and concurrent
@@ -325,19 +330,43 @@ blank-session Hero. The displayed language follows DSH's current language settin
325
330
 
326
331
  - Drag Worktrees within their owning Workspace. The ordered `worktrees` array is persisted in
327
332
  the plugin sidecar; Main is a fixed first row and Worktrees cannot move across Workspaces.
328
- - Open the shared Main and Worktree options menu to copy the selected row's absolute path. Main
329
- and detached/removed Worktrees show only `Copy path`; active Worktrees also show `Remove
330
- Worktree` with a confirmation dialog.
331
- - Imported Worktrees expose the same active options menu as plugin-created Worktrees. Removing
332
- either source runs real `git worktree remove`; for an imported Worktree, the confirmation warns
333
- that the linked Worktree directory may be deleted. Sessions are retained as detached bindings.
334
- - Removing a Worktree does not delete its Sessions. The relationship remains detached until it
335
- is explicitly unbound. Deleting a Workspace removes only DSH's Workspace registration; its
336
- directory, Sessions, Git Worktrees, and plugin sidecar remain.
337
- - After a successful removal, detached Sessions that still have Full Access are normalized to
338
- `workspace-write + ask` when the public DSH permission service is available. An unavailable
339
- service is reported as an unverified, retryable warning; it never grants Full Access to a
340
- detached Session.
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.
334
+ - Open the shared Main and Worktree options menu to copy the selected row's absolute path. Active
335
+ 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.
338
+ - The `Archived` group is rendered at the bottom of the Workspace when archived Worktrees exist and is
339
+ collapsed by default. Its label includes the total archived Worktree count, even when collapsed.
340
+ 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.
343
+ - For archived Worktrees whose disk has not been cleaned, the options menu provides:
344
+ 1. `Unarchive Worktree`: Restores a metadata-archived Worktree whose disk directory is intact back to active status, without secondary confirmation.
345
+ 2. `Clean Up Disk`: Prompts for secondary confirmation detailing the path and irreversible deletion,
346
+ tells you that the plugin does not check Session or subagent activity and requires you to confirm
347
+ 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.
359
+ 3. `Remove from Management`: Prompts for confirmation and removes the Worktree sidecar record and all
360
+ its bindings, while preserving disk files and native DSH Sessions. It retires in-flight fork operations,
361
+ 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.
368
+ - Deleting a Workspace removes only DSH's Workspace registration; its directory, Sessions, Git Worktrees,
369
+ and plugin sidecar remain.
341
370
  - DSH-native Workspace rename/delete/reorder and Session menus remain available. Session drag
342
371
  ordering is limited to the current visual Main or Worktree group.
343
372
  - The Main group shows the current local branch as `Local (branch)` and falls back to `Local` if
@@ -352,13 +381,54 @@ blank-session Hero. The displayed language follows DSH's current language settin
352
381
  - When the Sidebar is collapsed, the footer keeps its icon-only native action geometry; the plugin
353
382
  does not render a separate `WT` rail control.
354
383
 
384
+ ### Reconcile a branch changed in Git
385
+
386
+ After an external `git checkout`, the next Worktree read shows `old branch → current branch`
387
+ and a branch-change warning. Reads occur on refresh and when opening a Worktree menu; the
388
+ plugin does not watch Git continuously. Detached HEAD is shown explicitly. Session bindings
389
+ and runtime cwd remain unchanged, and normal branch changes do not lock the Workspace.
390
+
391
+ Choose `Adopt current branch` from the active or archived Worktree menu and confirm the
392
+ displayed transition. This updates only the plugin's recorded branch. A changed branch or
393
+ stale snapshot during confirmation is rejected; refresh and confirm again. Detached HEAD
394
+ must first be switched to a branch in Git. Disk cleanup requires adopting the current branch
395
+ first. Creating a Worktree on the old branch is allowed when Git proves the existing record
396
+ has switched away; genuinely checked-out branches remain unavailable.
397
+
398
+ Confirmation failures appear inside the dialog. Choose `Retry` to reload the observed branch
399
+ and snapshot token, then confirm the updated transition; the old confirmation stays disabled
400
+ until refresh succeeds. If the Worktree is no longer branch-drifted or has entered detached HEAD,
401
+ the dialog closes. Creating a sibling Worktree uses the observed current branch, even before
402
+ adoption; detached HEAD does not offer this action.
403
+
404
+ For `recovery-needed`, the Worktree menu offers `Retry recovery` for its Workspace.
405
+ This retries safe journal recovery; it does not adopt branches, delete unknown paths, or
406
+ 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.
409
+
355
410
  ### Understand status and recovery messages
356
411
 
357
- - `ready` means the Worktree is available. `repair` identifies a missing or invalid Worktree,
358
- Session, binding, or cwd. `recovery-needed` means a Git/sidecar operation or identity check is
359
- unresolved and destructive actions are blocked. `detached` means the Git Worktree was removed
360
- while the relationship was retained. An active binding pointing to a missing Worktree produces
412
+ - Operation, permission, binding, and refresh failures use DSH's native toast, one at a time.
413
+ Unchanged errors are not repeated on every render. Full messages and existing Retry/Open
414
+ actions remain in the expandable Notification details and recovery entry after the toast fades.
415
+ Form validation and Workspace Git setup guidance remain next to their inputs.
416
+ - Hover or focus an active Worktree row to see its status, path, and repair guidance for missing
417
+ directories/Git registration, branch drift/detached HEAD, or incomplete recovery. Opening its
418
+ menu or dragging suppresses the hover card. Archive confirmation explicitly preserves the
419
+ directory, Session bindings, and cwd for both plugin-created and external Worktrees;
420
+ Clean Disk remains a separate action.
421
+
422
+ - `ready` means the Worktree is available. `cleaned` indicates disk cleanup completed while the
423
+ sidecar archive entry is retained. `repair` identifies a missing or invalid Worktree, Session, binding,
424
+ or cwd. `recovery-needed` means a Git/sidecar operation or identity check is unresolved and
425
+ destructive actions are blocked. `detached` means the Git Worktree was removed while the relationship
426
+ was retained. An active binding pointing to a missing Worktree produces
361
427
  an explicit repair warning or error; it never silently falls back to another Worktree.
428
+ - 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.
362
432
  - Worktree health is a runtime Git projection and is not written to the sidecar. Git readiness
363
433
  failures are shown per Workspace: a missing Git executable shows installation guidance without
364
434
  commands, while repository, initial commit, or local branch failures show copyable setup
@@ -400,9 +470,10 @@ store a copy of `projectRoot` or any Session content. If the sidecar is unavaila
400
470
  the native Project/Session view remains readable and the plugin becomes degraded/read-only; an
401
471
  empty index must never overwrite the native DSH lists.
402
472
 
403
- The sidecar accepts v1 and v2 snapshots for backwards-compatible reads. Legacy records are
404
- normalized in memory, and the first successful mutation atomically upgrades the shard to v3.
405
- New v3 snapshots use a revision, an opaque repository fingerprint, and durable pending-operation
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
406
477
  metadata for Git create/remove. A transitional v3 snapshot containing an older raw repository
407
478
  field is read and cleaned on its next stable write. Invalid JSON, unknown schema versions, and
408
479
  invariant violations are reported as corruption rather than reset to an empty index.
@@ -430,7 +501,7 @@ it retains the marker and surfaces `WORKTREE_RECOVERY_REQUIRED` or
430
501
  also carry an opaque mutation token from the latest Worktree projection so a stale UI cannot act
431
502
  on a changed record.
432
503
 
433
- The Worktree session flow sends the independent Worktree cwd through the upstream DSH runtime and
504
+ The Worktree session flow sends the independent Worktree cwd through the DSH Session Controller and
434
505
  keeps `{ workspaceId, sessionId }` as a browser-local membership projection rather than a
435
506
  persistent DSH attach. It does not modify DSH source, Session metadata, or native Workspace
436
507
  storage. The projection is replayed after native list refreshes and removed when the binding
package/README.zh.md CHANGED
@@ -23,7 +23,7 @@ Session 元数据、原生列表和会话历史的唯一事实来源。插件只
23
23
  - 搜索 Workspace,并从已有 local branch 创建 Git Worktree 和 branch。
24
24
  - 在同一个弹窗中选择导入,发现与当前 Workspace repository 关联、尚未由 sidecar 管理且绑定 branch 的 Git Worktree。第一版不展示 repository root 和 detached HEAD 条目。
25
25
  - 导入只登记已有 Worktree,不移动、复制或编辑其目录;记录使用 `source: external`,之后与 plugin 创建的记录共享 Session、binding、health、排序、cwd、projection、刷新和恢复流程。
26
- - plugin 创建和导入的 Worktree 都通过真实的 `git worktree remove` 移除;移除导入的 Worktree 可能删除其关联目录,确认弹窗会明确提示。
26
+ - 非破坏性归档 Worktree(`status: removed`),保留磁盘文件、活动 binding 与运行时 cwd。磁盘清理(`git worktree remove`)需经二次确认,由用户自行确认使用该目录的 Session/子代理与其他任务已停止;亦支持移出插件管理并保留磁盘文件与 Session。
27
27
  - 在 Main 或 active Worktree 下创建普通 Session 或 Worktree Session,并直接打开新会话。
28
28
  - 对 active Worktree Session,先经明确确认,再请求命名的 `worktree-full-access` 预设。它将
29
29
  DSH 的 `danger-full-access` 与 `ask` 组合:关闭关联 Git 元数据的文件系统限制,但保留
@@ -48,13 +48,14 @@ Session 元数据、原生列表和会话历史的唯一事实来源。插件只
48
48
  binding 恢复操作。
49
49
  - 查看 ready、repair、active 和 detached Worktree 状态,包括可重试的操作错误。
50
50
  - 通过 Main 和 Worktree 共用的选项菜单复制所选行的绝对路径;Main 和 detached 行只显示“复制路径”,
51
- active Worktree 额外显示“移除 Worktree”并要求确认。
51
+ active Worktree 额外显示“归档 Worktree”并要求确认。
52
52
  - 通过 Local 或 active Worktree 的选项菜单创建新的 Worktree。创建弹窗会以所选行的当前 branch
53
53
  为基线,并预填下一个可用的递增名称,例如 `feature-2` 或 `feature-3`;detached Worktree
54
54
  不显示该动作。
55
55
  - 继续使用 DSH 原生的 Workspace rename/delete/reorder 和 Session 菜单。Worktree 可以在所属
56
56
  Workspace 内排序;顺序保存在插件 sidecar 中,Main 固定在第一位。
57
57
  - 将 Workspace、Main 和 Worktree 的展开选择保存到浏览器本地存储;Session 五行溢出展开保持临时状态,并在刷新或父级折叠后重置。
58
+ - 在 Worktree Header 提供「全部折叠」按钮,支持一键折叠所有 Workspace 与 Worktree。
58
59
  - 在 Worktree view 高亮 DSH 当前 Session;进入 Worktree 模式或切换当前会话时,临时展开其 Workspace/Main/Worktree 路径;只有当前行不在前五行时才展开 Session 五行溢出,随后清空隐藏它的搜索并滚动定位;这一浏览器本地行为不改变已保存的展开选择。
59
60
  - 在已有 Conversation 的标题行以及新会话空白 Hero 中,以只读方式显示当前 local branch 或
60
61
  Worktree branch 上下文。
@@ -71,20 +72,14 @@ Session 元数据、原生列表和会话历史的唯一事实来源。插件只
71
72
 
72
73
  ### 兼容性与前置条件
73
74
 
74
- - 开发和源码验证应使用官方 [DeepSeek Harness 仓库](https://github.com/deepseek-ai/deepseek-harness)
75
- 的干净 checkout,并跟随仓库当前默认分支。该仓库当前使用 `master` 而不是 `main`,且仍是
76
- developer preview,package API contract 可能变化;在向 profile 安装本 plugin 前,先完成
77
- upstream 的安装和构建步骤。
78
- - 目标 profile(例如 `web` `demo`)必须已经可以正常启动,且 plugin 必须安装到实际
79
- 启动 Web UI 的同一个 profile。
80
- - DSH Client 必须提供原生 `@deepseek-ai/dsh-client-ui-conversation` package 及其
81
- `conversation.session.header.actions` seat。
82
- - Worktree 操作要求 Git 已安装且可在 PATH 中使用。Workspace 必须位于 Git repository 中,
83
- 且至少有一个初始 commit 和本地 branch。Git 可执行文件缺失时显示安装提示且不显示命令块;
84
- 缺少 repository、初始 commit 或本地 branch 时显示可复制的 setup 命令。插件不会执行 setup
85
- 或安装命令,也不会修改 Workspace 文件。
86
- - package 声明了可安装的 `dsh.bundle` 并提供 `cordis.patch.yml`;浏览器 UI 通过
87
- `dsh.client` metadata 声明。
75
+ 兼容性事实表如下:
76
+
77
+ | 组件 / Component | 最低版本 / Min Version | 说明 / Notes |
78
+ | --- | --- | --- |
79
+ | DSH Client | `>=0.1.2-rc.1` | 依赖 Session/Workspace Controller 及 Client Store |
80
+ | DSH Host | `>=0.1.2-rc.1` | 依赖 Typert Gateway `/api` 协议与 subprocess capability |
81
+ | Git | `>=2.20.0` | 要求支持 worktree 核心命令与 branch 发现 |
82
+ | Node.js | `>=20.0.0` | 推荐使用 LTS 版本 |
88
83
 
89
84
  ## 安装
90
85
 
@@ -118,13 +113,14 @@ npm view @cerbur/clutch-dsh-worktree version --registry=https://registry.npmjs.o
118
113
  ### 准备当前 upstream DSH checkout
119
114
 
120
115
  进行源码开发或验证时,先准备 upstream checkout。当前 upstream 默认分支是 `master`;如果仓库
121
- 未来切换默认分支,应跟随仓库的当前默认分支。
116
+ 未来切换默认分支,应跟随仓库的当前默认分支。最小 rc.1 兼容性验证路径切换到
117
+ `dsh-v0.1.2-rc.1`:
122
118
 
123
119
  ```bash
124
120
  git clone https://github.com/deepseek-ai/deepseek-harness.git
125
121
  cd deepseek-harness
126
122
  git fetch origin
127
- git pull --ff-only origin master
123
+ git checkout dsh-v0.1.2-rc.1
128
124
  pnpm install
129
125
  pnpm run build
130
126
  ```
@@ -217,6 +213,12 @@ pnpm dsh plugin --profile web remove @cerbur/clutch-dsh-worktree
217
213
 
218
214
  ### 创建 Worktree
219
215
 
216
+ 新目录使用 `$dshHome/clutch-dsh-worktree/worktree/wt_<12-hex-characters>`
217
+ (文件夹名为 15 个字符,包含 48 位加密随机数)。
218
+ 目录名、Git 登记或 sidecar 身份已被占用时自动换名重试;八个随机候选均冲突后,
219
+ 依次尝试 `_1`、`_2` 等数字后缀,直到找到可用名称或取消。
220
+ 已有 Worktree 的路径和 ID 保持不变;分支冲突与其他 Git 失败沿用原有错误处理。
221
+
220
222
  1. 选择 Workspace,点击它旁边的 `+`,选择基线 local branch,并填写 Worktree name。默认
221
223
  branch 名称为 `dsh/<8-character-random-string>`。
222
224
  2. 如果要从已有 Worktree 创建同级 Worktree,打开该 active Worktree 的选项菜单并选择
@@ -234,7 +236,10 @@ pnpm dsh plugin --profile web remove @cerbur/clutch-dsh-worktree
234
236
  1. 选择 Workspace,点击旁边的 `+`,再选择 `导入` Tab。弹窗通过现有 DSH `/api` Connection
235
237
  加载该 repository 的 Git Worktree 候选项。
236
238
  2. 第一版只列出绑定 branch、不是 repository root、且未出现在 plugin sidecar 中的 Worktree。
237
- detached HEAD 会被省略;候选项通过普通下拉框选择,每个选项先显示 branch,再显示绝对路径
239
+ detached HEAD、bare、prunable、目录缺失和 `.git` 缺失的条目会被省略。
240
+ 已管理 Worktree 的 health 与导入资格共用运行时状态映射,提交导入时重新校验;
241
+ locked Worktree 在其他条件满足时仍可导入。
242
+ 候选项通过普通下拉框选择,每个选项先显示 branch,再显示绝对路径
238
243
  作为诊断信息。
239
244
  3. 在下拉框中选择一个选项并点击 `导入 Worktree`。登记只写入 plugin sidecar,已有 Worktree 目录和 Git
240
245
  工作状态保持不变。随后会在该 Worktree cwd 创建或复用 Session,并执行与创建相同的
@@ -247,10 +252,10 @@ pnpm dsh plugin --profile web remove @cerbur/clutch-dsh-worktree
247
252
  ### 创建 Main 和 Worktree Session
248
253
 
249
254
  - 使用 Main 的 `+`,在 Project 根目录视角中创建普通 DSH Session。
250
- - 使用 Worktree 的 `+`,创建或复用 runtime cwd 指向该 Worktree 的 Session。插件通过 upstream
251
- runtime 调用 `session.create({ cwd: worktreePath })`,随后保存外部 binding 并打开该 Session。
252
- 当前浏览器内的 `{ workspaceId, sessionId }` membership projection 会在之后刷新,因此新建
253
- Session 不会短暂出现在 Main 中。
255
+ - 使用 Worktree 的 `+`,创建或复用 runtime cwd 指向该 Worktree 的 Session。插件通过 DSH
256
+ Session Controller 调用 `ctx.sessions.create({ cwd: worktreePath })`,随后保存外部 binding
257
+ 并打开该 Session。当前浏览器内的 `{ workspaceId, sessionId }` membership projection 会在
258
+ 之后刷新,因此新建 Session 不会短暂出现在 Main 中。
254
259
  - 如果存在目标 cwd 完全匹配的未归档 blank Session,连接器会优先复用它。已绑定的 Session
255
260
  会直接打开;未绑定的候选会先 binding,再 projection 和打开。否则执行
256
261
  新建路径执行 `create → bind → open → refresh`,同一个 Worktree 的并发点击会合并。
@@ -298,17 +303,27 @@ pnpm dsh plugin --profile web remove @cerbur/clutch-dsh-worktree
298
303
 
299
304
  - 在所属 Workspace 内拖动 Worktree。排序持久化在 plugin sidecar 的有序 `worktrees` 数组中;
300
305
  Main 是固定的第一行,Worktree 不能跨 Workspace 移动。
301
- - 打开 Main Worktree 共用的选项菜单复制所选行的绝对路径。Main detached/removed Worktree
302
- 只显示“复制路径”;active Worktree 还显示“移除 Worktree”并要求确认。
303
- - 导入的 Worktree plugin 创建的 Worktree 显示相同的 active 选项菜单。两种来源都执行真实
304
- `git worktree remove`;导入项的确认文案会警告关联 Worktree 目录可能被删除。Session 会
305
- 保留为 detached binding。
306
- - 移除 Worktree 不会删除其 Session。关系会保留为 detached,直到显式解绑。删除 Workspace
307
- 只会删除 DSH 的 Workspace registration;其目录、Session、Git Worktree 和 plugin
308
- sidecar 会保留。
309
- - Worktree 成功移除后,如果公共 DSH 权限服务可用,仍处于完全访问的 detached Session
310
- 归一化为 `workspace-write + ask`。权限服务不可用时显示未验证且可重试的警告;不会向
311
- detached Session 自动授予完全访问。
306
+ - 新创建或新导入的 Worktree 会插入所属 Workspace 的 Worktree 列表队头;已有 Worktree 顺序保持不变,Main 固定在第一位。
307
+ - 打开 Main 和 Worktree 共用的选项菜单复制所选行的绝对路径。active Worktree 提供“复制路径”与
308
+ “归档 Worktree”。归档 active Worktree 属于内部归档操作:将其标记为 `status: removed`,完整保留
309
+ 磁盘目录、关联 binding 与运行时 cwd,并将该 Worktree 沉底移动到工作区底部的“已归档”(Archived)分组中。
310
+ - 工作区底部在存在已归档 Worktree 时渲染“已归档”分组,默认处于折叠状态;标题显示已归档 Worktree 总数,收起时仍然显示。每个 Workspace 维护独立的折叠状态。
311
+ - `health: repair` 的 active Worktree 也提供“归档 Worktree”,仅归档记录,保留磁盘文件和 binding。`recovery-needed` 状态仍须先处理恢复问题,不能归档。
312
+ - 对于未清理磁盘的已归档 Worktree,选项菜单提供:
313
+ 1. “取消归档”(Unarchive Worktree):对于仅元数据标记归档且磁盘未清理的 Worktree,可直接在菜单中点击取消归档,无需二次确认弹窗,立即恢复为活跃状态。
314
+ 2. “清理磁盘”(Clean Up Disk):弹出二次确认弹窗(明确提示工作树路径与破坏性删除不可逆),告知插件不核验 Session/子代理活动,
315
+ 请用户自行确认使用该目录的任务均已停止,否则删除可能导致任务失败或数据丢失;执行真正的非强制 `git worktree remove`,
316
+ 成功后记录 `diskCleanup: completed`,运行时健康状态投影为 `cleaned`,关联 binding 转为 detached,并将完全访问权限
317
+ 归一化为 `workspace-write + ask`。磁盘清理提交与权限后续解耦:清理成功即确认提交、关闭对话框并将状态转为 `cleaned`;
318
+ 权限归一化失败或刷新异常提供独立恢复,不重复执行磁盘删除。
319
+ 点击权限提示中的“重试”(Retry),仅重试该已清理 Worktree 的权限归一化。
320
+ 如果 Worktree 目录或其 `.git` 入口已在外部删除,确认清理只将插件记录标记为完成并将 binding 转为 detached,
321
+ 不再执行 Git 删除,也不清理残留 Git registration。剩余目录和文件完整保留,完成状态显示
322
+ “Worktree 已移除”,不代表剩余文件已被删除。普通刷新仍显示 `repair`,直到用户显式确认清理。
323
+ 3. “移出管理”(Remove from Management):弹出确认弹窗,删除该 Worktree 的 sidecar 记录与全部关联 binding,完整保留
324
+ 磁盘文件与 DSH 原生 Session;同时定向淘汰该 Worktree 的未决 fork 恢复、投影与权限提示。不需要校验 Session 活动。
325
+ - 对于已清理磁盘的 Worktree(`health: cleaned`),选项菜单提供“移出管理”以从 sidecar 中彻底移除该记录。
326
+ - 删除 Workspace 只会删除 DSH 的 Workspace registration;其目录、Session、Git Worktree 和 plugin sidecar 会保留。
312
327
  - DSH 原生的 Workspace rename/delete/reorder 和 Session 菜单继续可用。Session 拖动排序
313
328
  限定在当前视觉 Main 或 Worktree 分组中。
314
329
  - Main 分组显示当前 local branch:有分支时为 `本地(branch)`,DSH 没有返回当前分支时
@@ -322,11 +337,43 @@ pnpm dsh plugin --profile web remove @cerbur/clutch-dsh-worktree
322
337
  - Sidebar 折叠后,footer 保留原生的 icon-only action 尺寸和排版;插件不会再绘制独立的
323
338
  `WT` rail control。
324
339
 
340
+ ### 同步在 Git 中切换的分支
341
+
342
+ 外部执行 `git checkout` 后,下次 Worktree 读取显示“旧分支 → 当前分支”与分支变化提示。
343
+ 刷新或打开 Worktree 菜单时会读取,插件不持续监听 Git。分离 HEAD 会明确标注。
344
+ Session binding 和运行时 cwd 保持不变,普通分支切换不会锁住整个 Workspace。
345
+
346
+ 在活动或归档 Worktree 菜单中选择“采用当前分支”(`Adopt current branch`)并确认,
347
+ 只更新插件记录的分支。确认期间 Git 分支或快照已变化时会拒绝操作,请刷新后重新确认。
348
+ 分离 HEAD 必须先在 Git 中切换到分支;清理磁盘前必须先采用当前分支。
349
+ Git 明确证明原记录已切走时,允许用空闲的旧分支创建 Worktree;真正被 checkout 的分支仍不可用。
350
+
351
+ 确认失败会在弹窗内显示错误。点击“重试”(`Retry`)重新读取当前分支和快照 token,
352
+ 再确认更新后的分支变化;刷新成功前不能再次提交旧确认。如果 Worktree 已不再处于
353
+ 分支漂移状态或进入分离 HEAD,弹窗会关闭。从该行创建新 Worktree 使用读到的当前分支,
354
+ 无需先采用分支;分离 HEAD 不提供此操作。
355
+
356
+ `recovery-needed` 行的菜单提供“重试恢复”(`Retry recovery`),作用于所属 Workspace。
357
+ 该操作只重试安全 journal 恢复,不自动采用分支、不删除未知路径、不清除未解决的身份问题。
358
+ 采用分支和恢复成功后只刷新所属 Workspace,并保留现有 ready 内容。
359
+ 旧版非事务分支观察标记会自动淘汰,普通 checkout 漂移不需要手工编辑 sidecar JSON。
360
+
325
361
  ### 理解状态与恢复提示
326
362
 
327
- - `ready` 表示 Worktree 可用。`repair` 表示 Worktree、Session、binding 或 cwd 缺失/无效。
328
- `recovery-needed` 表示 Git/sidecar 操作或身份校验尚未解决,破坏性操作会被阻止。
329
- `detached` 表示 Git Worktree 已被移除,但关系仍然保留。active binding 指向缺失
363
+ - 操作、权限、绑定和刷新失败统一使用 DSH 原生 toast,逐条显示;相同错误不会随每次渲染重复提示。
364
+ toast 消失后,完整信息及原有重试/打开操作仍保留在可展开的“提示详情与恢复操作”入口。
365
+ 表单校验和 Workspace Git 初始化指引保留在对应输入附近。
366
+ - 悬停或聚焦 active Worktree 行可查看状态、路径以及目录/Git 登记缺失、分支漂移/分离 HEAD、
367
+ 恢复未完成的处理指引。打开菜单或拖动时不显示 hover 卡片。归档确认明确说明插件创建及外部
368
+ Worktree 都保留目录、Session 绑定和 cwd;“清理磁盘”仍是独立操作。
369
+
370
+ - 没有未完成 Git 事务时,目录缺失的 active 或 archived Worktree 保持 `repair`,可归档,
371
+ 不会阻断健康 Worktree 的 Session 绑定。指向现有且未清理记录的旧版无事务
372
+ `WORKTREE_RECOVERY_REQUIRED` 观察标记在 sidecar 锁内淘汰;未完成事务、未知记录和身份变化问题仍然阻断操作。
373
+
374
+ - `ready` 表示 Worktree 可用。`cleaned` 表示磁盘清理已完成且保留 sidecar 归档条目。
375
+ `repair` 表示 Worktree、Session、binding 或 cwd 缺失/无效。`recovery-needed` 表示 Git/sidecar
376
+ 操作或身份校验尚未解决,破坏性操作会被阻止。`detached` 表示 Git Worktree 已被移除,但关系仍然保留。active binding 指向缺失
330
377
  Worktree 时会显示明确的 repair 警告或错误,不会静默切换到其他 Worktree。
331
378
  - Worktree health 是 Git 的运行时 projection,不写入 sidecar。Git 前置条件失败按
332
379
  Workspace 显示提示:Git 可执行文件缺失时显示安装提示且不显示命令块,缺少 repository、
@@ -363,8 +410,13 @@ DSH 管理原始 Project/Workspace 身份和根目录、Session 身份和元数
363
410
  Session 内容。如果 sidecar 不可用或损坏,原生 Project/Session 视角仍然可读,插件进入
364
411
  degraded/read-only 状态;不能用空索引覆盖 DSH 原生列表。
365
412
 
366
- sidecar 兼容读取 v1 v2 snapshot。旧记录会先在内存中归一化,第一次成功 mutation 会
367
- 以原子方式将 shard 升级为 v3。新的 v3 snapshot 使用 revision、不可逆向还原的 repository
413
+ Session 活动仅用于信息展示,不阻断磁盘清理或移出管理;默认 Host 仍可能显示 `unknown`。
414
+ 确认磁盘清理前,请自行停止所有使用该目录的任务,插件不会核验任务是否已停止。
415
+ 原生活动变化或重新打开归档菜单会刷新所属 Workspace 并保留 ready 内容。
416
+
417
+ sidecar 兼容读取 v1、v2 和 v3 snapshot。旧记录会先在内存中归一化,第一次成功 mutation 会
418
+ 以原子方式将 shard 升级为 v4。旧 removed 记录归一化为 `diskCleanup: completed`,保留 v3 revision。
419
+ 新的 v4 snapshot 使用 revision、不可逆向还原的 repository
368
420
  fingerprint,以及为 Git create/remove 保存的 durable pending-operation metadata。早期 v3
369
421
  实现可能写入的 raw repository 字段也可以读取,并会在下一次稳定写入时清理。无效 JSON、
370
422
  未知 schema version 和关系不变量错误都会报告为 corruption,不会静默重置为空索引。
@@ -388,7 +440,7 @@ Host 启动时,插件会针对已知 DSH Workspace 执行一次尽力而为的
388
440
  状态。破坏性操作还可以携带最新 Worktree projection 生成的 opaque mutation token,避免
389
441
  过期 UI 对已变化的记录执行操作。
390
442
 
391
- Worktree Session 流程将独立的 Worktree cwd 交给 upstream DSH runtime,并将
443
+ Worktree Session 流程将独立的 Worktree cwd 交给 DSH Session Controller,并将
392
444
  `{ workspaceId, sessionId }` 保持为浏览器本地 membership projection,而不是持久化的 DSH
393
445
  attach。它不会修改 DSH 源码、Session metadata 或原生 Workspace 存储。native list 刷新后会
394
446
  重放 projection;binding 消失或 Client dispose 时会移除 projection。
@@ -1,8 +1,5 @@
1
- import type { WorktreeSurfaceProps } from './worktree-surface-types.js';
2
- export type { WorktreeSurfaceInjected, WorktreeSurfaceProps } from './worktree-surface-types.js';
3
- /**
4
- * Peer Worktree navigation surface. It keeps the original DSH Workspace mode
5
- * intact and renders a browser-local Workspace → Worktree → Session projection.
6
- */
7
- export declare function WorktreeSurface({ useStore, actions, useSessions, useWorkspaces, t, available, expandState, sessionOrder, manager, permission, confirmFullAccess, fullAccessConfirmation, onPermissionResult, onPermissionNotice, permissionNotice, invalidateWorktreeContext, createWorkspace, createSessionForWorktree: createSessionCallback, createMainSession, renameWorkspace, deleteWorkspace, insertWorkspaceBefore, insertSessionBefore, insertWorktreeBefore, renameSession, forkSession, archiveSession, forkRecovery, retryForkSession, ensureSessionWorkspace, syncSessionWorkspaces, openSession, }: WorktreeSurfaceProps): import("react").JSX.Element | null;
1
+ import type { WorktreeSurfaceProps } from './surface/types.js';
2
+ export type { WorktreeSurfaceInjected, WorktreeSurfaceProps } from './surface/types.js';
3
+ /** Composes independent surface state/action domains into the sidebar overlay. */
4
+ export declare function WorktreeSurface(props: WorktreeSurfaceProps): import("react").JSX.Element | null;
8
5
  //# sourceMappingURL=WorktreeSurface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WorktreeSurface.d.ts","sourceRoot":"","sources":["../../src/client/WorktreeSurface.tsx"],"names":[],"mappings":"AAiEA,OAAO,KAAK,EAQV,oBAAoB,EASrB,MAAM,6BAA6B,CAAC;AA6BrC,YAAY,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAoEjG;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,OAAO,EACP,WAAW,EACX,aAAa,EACb,CAAC,EACD,SAAS,EACT,WAAW,EACX,YAAY,EACZ,OAAO,EACP,UAAU,EACV,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,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,YAAY,EACZ,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,WAAW,GACZ,EAAE,oBAAoB,sCA4uDtB"}
1
+ {"version":3,"file":"WorktreeSurface.d.ts","sourceRoot":"","sources":["../../src/client/WorktreeSurface.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,YAAY,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACxF,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,sCAuF1D"}