@cerbur/clutch-dsh-worktree 0.1.16 → 0.1.18

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 (429) hide show
  1. package/README.md +314 -43
  2. package/README.zh.md +263 -37
  3. package/assets/screenshots/screenshots-dashboard.png +0 -0
  4. package/assets/screenshots/screenshots-en.png +0 -0
  5. package/assets/screenshots/screenshots-git-reviewer.png +0 -0
  6. package/assets/screenshots/screenshots-import.png +0 -0
  7. package/assets/screenshots/screenshots-worktree-tool.png +0 -0
  8. package/assets/screenshots/screenshots-zh.png +0 -0
  9. package/cordis.patch.yml +6 -19
  10. package/lib/client/WorktreeSurface.d.ts.map +1 -1
  11. package/lib/client/WorktreeSurface.js +41 -13
  12. package/lib/client/WorktreeSurface.js.map +1 -1
  13. package/lib/client/branch/GitBranchSelector.d.ts +23 -0
  14. package/lib/client/branch/GitBranchSelector.d.ts.map +1 -0
  15. package/lib/client/branch/GitBranchSelector.js +142 -0
  16. package/lib/client/branch/GitBranchSelector.js.map +1 -0
  17. package/lib/client/command-activity.d.ts +11 -0
  18. package/lib/client/command-activity.d.ts.map +1 -0
  19. package/lib/client/command-activity.js +71 -0
  20. package/lib/client/command-activity.js.map +1 -0
  21. package/lib/client/context/worktree-context-store.d.ts.map +1 -1
  22. package/lib/client/context/worktree-context-store.js +1 -0
  23. package/lib/client/context/worktree-context-store.js.map +1 -1
  24. package/lib/client/context/worktree-context.d.ts +3 -2
  25. package/lib/client/context/worktree-context.d.ts.map +1 -1
  26. package/lib/client/context/worktree-context.js +5 -3
  27. package/lib/client/context/worktree-context.js.map +1 -1
  28. package/lib/client/dashboard/DashboardRequest.d.ts +2 -1
  29. package/lib/client/dashboard/DashboardRequest.d.ts.map +1 -1
  30. package/lib/client/dashboard/DashboardRequest.js +3 -3
  31. package/lib/client/dashboard/DashboardRequest.js.map +1 -1
  32. package/lib/client/dashboard/WorktreeDashboard.d.ts +6 -2
  33. package/lib/client/dashboard/WorktreeDashboard.d.ts.map +1 -1
  34. package/lib/client/dashboard/WorktreeDashboard.js +111 -89
  35. package/lib/client/dashboard/WorktreeDashboard.js.map +1 -1
  36. package/lib/client/dashboard/WorktreeInstructions.d.ts +2 -1
  37. package/lib/client/dashboard/WorktreeInstructions.d.ts.map +1 -1
  38. package/lib/client/dashboard/WorktreeInstructions.js +27 -8
  39. package/lib/client/dashboard/WorktreeInstructions.js.map +1 -1
  40. package/lib/client/dashboard/dashboard-overlay.d.ts.map +1 -1
  41. package/lib/client/dashboard/dashboard-overlay.js +38 -52
  42. package/lib/client/dashboard/dashboard-overlay.js.map +1 -1
  43. package/lib/client/dashboard/dashboard-selection.d.ts +4 -2
  44. package/lib/client/dashboard/dashboard-selection.d.ts.map +1 -1
  45. package/lib/client/dashboard/dashboard-selection.js +6 -4
  46. package/lib/client/dashboard/dashboard-selection.js.map +1 -1
  47. package/lib/client/dashboard/git/GitChangedFiles.d.ts +2 -1
  48. package/lib/client/dashboard/git/GitChangedFiles.d.ts.map +1 -1
  49. package/lib/client/dashboard/git/GitChangedFiles.js +8 -6
  50. package/lib/client/dashboard/git/GitChangedFiles.js.map +1 -1
  51. package/lib/client/dashboard/git/GitCommitList.d.ts +6 -1
  52. package/lib/client/dashboard/git/GitCommitList.d.ts.map +1 -1
  53. package/lib/client/dashboard/git/GitCommitList.js +34 -29
  54. package/lib/client/dashboard/git/GitCommitList.js.map +1 -1
  55. package/lib/client/dashboard/git/GitCommitStats.d.ts +8 -0
  56. package/lib/client/dashboard/git/GitCommitStats.d.ts.map +1 -0
  57. package/lib/client/dashboard/git/GitCommitStats.js +7 -0
  58. package/lib/client/dashboard/git/GitCommitStats.js.map +1 -0
  59. package/lib/client/dashboard/git/WorktreeGitOverview.d.ts.map +1 -1
  60. package/lib/client/dashboard/git/WorktreeGitOverview.js +2 -1
  61. package/lib/client/dashboard/git/WorktreeGitOverview.js.map +1 -1
  62. package/lib/client/dashboard/git/WorktreeGitPanel.d.ts +3 -2
  63. package/lib/client/dashboard/git/WorktreeGitPanel.d.ts.map +1 -1
  64. package/lib/client/dashboard/git/WorktreeGitPanel.js +79 -14
  65. package/lib/client/dashboard/git/WorktreeGitPanel.js.map +1 -1
  66. package/lib/client/dashboard/git/file-address.d.ts +5 -1
  67. package/lib/client/dashboard/git/file-address.d.ts.map +1 -1
  68. package/lib/client/dashboard/git/file-address.js +49 -11
  69. package/lib/client/dashboard/git/file-address.js.map +1 -1
  70. package/lib/client/dashboard/git/git-facts.js +1 -1
  71. package/lib/client/dashboard/git/git-facts.js.map +1 -1
  72. package/lib/client/dashboard/git/useWorktreeGitState.d.ts +7 -2
  73. package/lib/client/dashboard/git/useWorktreeGitState.d.ts.map +1 -1
  74. package/lib/client/dashboard/git/useWorktreeGitState.js +88 -22
  75. package/lib/client/dashboard/git/useWorktreeGitState.js.map +1 -1
  76. package/lib/client/dsh-icons.d.ts +4 -0
  77. package/lib/client/dsh-icons.d.ts.map +1 -1
  78. package/lib/client/dsh-icons.js +5 -1
  79. package/lib/client/dsh-icons.js.map +1 -1
  80. package/lib/client/dsh-slot-contract.d.ts +9 -1
  81. package/lib/client/dsh-slot-contract.d.ts.map +1 -1
  82. package/lib/client/entry.d.ts.map +1 -1
  83. package/lib/client/entry.js +39 -2
  84. package/lib/client/entry.js.map +1 -1
  85. package/lib/client/layout/app-frame.d.ts +12 -0
  86. package/lib/client/layout/app-frame.d.ts.map +1 -0
  87. package/lib/client/layout/app-frame.js +82 -0
  88. package/lib/client/layout/app-frame.js.map +1 -0
  89. package/lib/client/locales.d.ts +184 -2
  90. package/lib/client/locales.d.ts.map +1 -1
  91. package/lib/client/locales.js +250 -68
  92. package/lib/client/locales.js.map +1 -1
  93. package/lib/client/overlay/overlay-bounds.d.ts.map +1 -1
  94. package/lib/client/overlay/overlay-bounds.js +8 -3
  95. package/lib/client/overlay/overlay-bounds.js.map +1 -1
  96. package/lib/client/overlay/sidebar-overlay-geometry.d.ts +3 -1
  97. package/lib/client/overlay/sidebar-overlay-geometry.d.ts.map +1 -1
  98. package/lib/client/overlay/sidebar-overlay-geometry.js +94 -34
  99. package/lib/client/overlay/sidebar-overlay-geometry.js.map +1 -1
  100. package/lib/client/restart-notice.d.ts +10 -3
  101. package/lib/client/restart-notice.d.ts.map +1 -1
  102. package/lib/client/restart-notice.js +44 -11
  103. package/lib/client/restart-notice.js.map +1 -1
  104. package/lib/client/select/SearchableSingleSelect.d.ts +44 -0
  105. package/lib/client/select/SearchableSingleSelect.d.ts.map +1 -0
  106. package/lib/client/select/SearchableSingleSelect.js +180 -0
  107. package/lib/client/select/SearchableSingleSelect.js.map +1 -0
  108. package/lib/client/select/WorktreeSelector.d.ts +14 -0
  109. package/lib/client/select/WorktreeSelector.d.ts.map +1 -0
  110. package/lib/client/select/WorktreeSelector.js +11 -0
  111. package/lib/client/select/WorktreeSelector.js.map +1 -0
  112. package/lib/client/session/session-view.d.ts +16 -2
  113. package/lib/client/session/session-view.d.ts.map +1 -1
  114. package/lib/client/session/session-view.js +24 -10
  115. package/lib/client/session/session-view.js.map +1 -1
  116. package/lib/client/session/worktree-session.d.ts +1 -0
  117. package/lib/client/session/worktree-session.d.ts.map +1 -1
  118. package/lib/client/session/worktree-session.js +3 -1
  119. package/lib/client/session/worktree-session.js.map +1 -1
  120. package/lib/client/settings/ToolSettings.d.ts +9 -0
  121. package/lib/client/settings/ToolSettings.d.ts.map +1 -0
  122. package/lib/client/settings/ToolSettings.js +77 -0
  123. package/lib/client/settings/ToolSettings.js.map +1 -0
  124. package/lib/client/settings/WorktreeSettings.d.ts +8 -0
  125. package/lib/client/settings/WorktreeSettings.d.ts.map +1 -0
  126. package/lib/client/settings/WorktreeSettings.js +46 -0
  127. package/lib/client/settings/WorktreeSettings.js.map +1 -0
  128. package/lib/client/settings/WorktreeSettingsNavIcon.d.ts +6 -0
  129. package/lib/client/settings/WorktreeSettingsNavIcon.d.ts.map +1 -0
  130. package/lib/client/settings/WorktreeSettingsNavIcon.js +51 -0
  131. package/lib/client/settings/WorktreeSettingsNavIcon.js.map +1 -0
  132. package/lib/client/settings/diagnostics.d.ts +24 -0
  133. package/lib/client/settings/diagnostics.d.ts.map +1 -0
  134. package/lib/client/settings/diagnostics.js +63 -0
  135. package/lib/client/settings/diagnostics.js.map +1 -0
  136. package/lib/client/settings/settings-navigation.d.ts +7 -0
  137. package/lib/client/settings/settings-navigation.d.ts.map +1 -0
  138. package/lib/client/settings/settings-navigation.js +12 -0
  139. package/lib/client/settings/settings-navigation.js.map +1 -0
  140. package/lib/client/surface/actions/useLifecycleActions.d.ts +2 -1
  141. package/lib/client/surface/actions/useLifecycleActions.d.ts.map +1 -1
  142. package/lib/client/surface/actions/useLifecycleActions.js +15 -6
  143. package/lib/client/surface/actions/useLifecycleActions.js.map +1 -1
  144. package/lib/client/surface/actions/useSessionActions.d.ts.map +1 -1
  145. package/lib/client/surface/actions/useSessionActions.js +6 -6
  146. package/lib/client/surface/actions/useSessionActions.js.map +1 -1
  147. package/lib/client/surface/actions/useWorktreeRegistration.d.ts +1 -1
  148. package/lib/client/surface/actions/useWorktreeRegistration.d.ts.map +1 -1
  149. package/lib/client/surface/actions/useWorktreeRegistration.js +36 -13
  150. package/lib/client/surface/actions/useWorktreeRegistration.js.map +1 -1
  151. package/lib/client/surface/components/NotificationToasts.d.ts +19 -3
  152. package/lib/client/surface/components/NotificationToasts.d.ts.map +1 -1
  153. package/lib/client/surface/components/NotificationToasts.js +73 -7
  154. package/lib/client/surface/components/NotificationToasts.js.map +1 -1
  155. package/lib/client/surface/components/OverlayScrollbar.d.ts +6 -0
  156. package/lib/client/surface/components/OverlayScrollbar.d.ts.map +1 -0
  157. package/lib/client/surface/components/OverlayScrollbar.js +84 -0
  158. package/lib/client/surface/components/OverlayScrollbar.js.map +1 -0
  159. package/lib/client/surface/components/RegistrationDialog.d.ts +3 -3
  160. package/lib/client/surface/components/RegistrationDialog.d.ts.map +1 -1
  161. package/lib/client/surface/components/RegistrationDialog.js +70 -5
  162. package/lib/client/surface/components/RegistrationDialog.js.map +1 -1
  163. package/lib/client/surface/components/RestartToast.d.ts.map +1 -1
  164. package/lib/client/surface/components/RestartToast.js +4 -3
  165. package/lib/client/surface/components/RestartToast.js.map +1 -1
  166. package/lib/client/surface/components/SurfaceContent.d.ts.map +1 -1
  167. package/lib/client/surface/components/SurfaceContent.js +110 -39
  168. package/lib/client/surface/components/SurfaceContent.js.map +1 -1
  169. package/lib/client/surface/components/WorkspaceTree.d.ts.map +1 -1
  170. package/lib/client/surface/components/WorkspaceTree.js +13 -9
  171. package/lib/client/surface/components/WorkspaceTree.js.map +1 -1
  172. package/lib/client/surface/components/dialogs.d.ts +1 -1
  173. package/lib/client/surface/components/dialogs.d.ts.map +1 -1
  174. package/lib/client/surface/components/dialogs.js +34 -21
  175. package/lib/client/surface/components/dialogs.js.map +1 -1
  176. package/lib/client/surface/components/rows.d.ts +1 -1
  177. package/lib/client/surface/components/rows.d.ts.map +1 -1
  178. package/lib/client/surface/components/rows.js +15 -97
  179. package/lib/client/surface/components/rows.js.map +1 -1
  180. package/lib/client/surface/notification-queue.d.ts +15 -0
  181. package/lib/client/surface/notification-queue.d.ts.map +1 -1
  182. package/lib/client/surface/notification-queue.js +13 -2
  183. package/lib/client/surface/notification-queue.js.map +1 -1
  184. package/lib/client/surface/state/useRegistrationState.d.ts +6 -1
  185. package/lib/client/surface/state/useRegistrationState.d.ts.map +1 -1
  186. package/lib/client/surface/state/useRegistrationState.js +7 -0
  187. package/lib/client/surface/state/useRegistrationState.js.map +1 -1
  188. package/lib/client/surface/state/useSurfaceRefresh.d.ts +1 -1
  189. package/lib/client/surface/state/useSurfaceRefresh.d.ts.map +1 -1
  190. package/lib/client/surface/state/useSurfaceRefresh.js +13 -1
  191. package/lib/client/surface/state/useSurfaceRefresh.js.map +1 -1
  192. package/lib/client/surface/state/useSurfaceSources.d.ts +1 -1
  193. package/lib/client/surface/state/useSurfaceSources.d.ts.map +1 -1
  194. package/lib/client/surface/state/useSurfaceSources.js +4 -2
  195. package/lib/client/surface/state/useSurfaceSources.js.map +1 -1
  196. package/lib/client/surface/state/useTitleMarquee.d.ts +7 -0
  197. package/lib/client/surface/state/useTitleMarquee.d.ts.map +1 -0
  198. package/lib/client/surface/state/useTitleMarquee.js +60 -0
  199. package/lib/client/surface/state/useTitleMarquee.js.map +1 -0
  200. package/lib/client/surface/types.d.ts +12 -1
  201. package/lib/client/surface/types.d.ts.map +1 -1
  202. package/lib/client/view/worktree-error-copy.d.ts.map +1 -1
  203. package/lib/client/view/worktree-error-copy.js +73 -14
  204. package/lib/client/view/worktree-error-copy.js.map +1 -1
  205. package/lib/client/view/worktree-view-errors.d.ts.map +1 -1
  206. package/lib/client/view/worktree-view-errors.js +13 -5
  207. package/lib/client/view/worktree-view-errors.js.map +1 -1
  208. package/lib/client/view/worktree-view-read.d.ts +4 -2
  209. package/lib/client/view/worktree-view-read.d.ts.map +1 -1
  210. package/lib/client/view/worktree-view-read.js +34 -17
  211. package/lib/client/view/worktree-view-read.js.map +1 -1
  212. package/lib/client/worktree-connection.d.ts +9 -2
  213. package/lib/client/worktree-connection.d.ts.map +1 -1
  214. package/lib/client/worktree-connection.js +24 -1
  215. package/lib/client/worktree-connection.js.map +1 -1
  216. package/lib/client/worktree-tool-changes.d.ts +13 -0
  217. package/lib/client/worktree-tool-changes.d.ts.map +1 -0
  218. package/lib/client/worktree-tool-changes.js +64 -0
  219. package/lib/client/worktree-tool-changes.js.map +1 -0
  220. package/lib/client.js +3503 -1310
  221. package/lib/client.js.map +1 -1
  222. package/lib/contract/index.contract.js +15 -0
  223. package/lib/contract/index.contract.js.map +1 -1
  224. package/lib/contract/index.d.ts +79 -12
  225. package/lib/contract/index.d.ts.map +1 -1
  226. package/lib/contract/index.js +12 -0
  227. package/lib/contract/index.js.map +1 -1
  228. package/lib/contract/tool-settings.d.ts +28 -0
  229. package/lib/contract/tool-settings.d.ts.map +1 -0
  230. package/lib/contract/tool-settings.js +10 -0
  231. package/lib/contract/tool-settings.js.map +1 -0
  232. package/lib/contract/worktree-tool-changes.d.ts +10 -0
  233. package/lib/contract/worktree-tool-changes.d.ts.map +1 -0
  234. package/lib/contract/worktree-tool-changes.js +2 -0
  235. package/lib/contract/worktree-tool-changes.js.map +1 -0
  236. package/lib/host/permission-preset-append.d.ts +15 -0
  237. package/lib/host/permission-preset-append.d.ts.map +1 -0
  238. package/lib/host/permission-preset-append.js +63 -0
  239. package/lib/host/permission-preset-append.js.map +1 -0
  240. package/lib/host/remote.d.ts.map +1 -1
  241. package/lib/host/remote.js +7 -0
  242. package/lib/host/remote.js.map +1 -1
  243. package/lib/host/service.d.ts +30 -6
  244. package/lib/host/service.d.ts.map +1 -1
  245. package/lib/host/service.js +85 -11
  246. package/lib/host/service.js.map +1 -1
  247. package/lib/host/tool-settings.d.ts +14 -0
  248. package/lib/host/tool-settings.d.ts.map +1 -0
  249. package/lib/host/tool-settings.js +98 -0
  250. package/lib/host/tool-settings.js.map +1 -0
  251. package/lib/host/worktree-permission-manager.d.ts.map +1 -1
  252. package/lib/host/worktree-permission-manager.js +2 -4
  253. package/lib/host/worktree-permission-manager.js.map +1 -1
  254. package/lib/host/worktree-tool-changes.d.ts +12 -0
  255. package/lib/host/worktree-tool-changes.d.ts.map +1 -0
  256. package/lib/host/worktree-tool-changes.js +60 -0
  257. package/lib/host/worktree-tool-changes.js.map +1 -0
  258. package/lib/manage/manager-git-history.d.ts +5 -7
  259. package/lib/manage/manager-git-history.d.ts.map +1 -1
  260. package/lib/manage/manager-git-history.js +185 -91
  261. package/lib/manage/manager-git-history.js.map +1 -1
  262. package/lib/manage/manager-git-paths.d.ts +7 -0
  263. package/lib/manage/manager-git-paths.d.ts.map +1 -0
  264. package/lib/manage/manager-git-paths.js +62 -0
  265. package/lib/manage/manager-git-paths.js.map +1 -0
  266. package/lib/manage/manager-sessions.d.ts +5 -0
  267. package/lib/manage/manager-sessions.d.ts.map +1 -1
  268. package/lib/manage/manager-sessions.js +34 -11
  269. package/lib/manage/manager-sessions.js.map +1 -1
  270. package/lib/manage/manager-support.d.ts +3 -1
  271. package/lib/manage/manager-support.d.ts.map +1 -1
  272. package/lib/manage/manager-support.js +17 -0
  273. package/lib/manage/manager-support.js.map +1 -1
  274. package/lib/manage/manager-worktree-lifecycle.d.ts.map +1 -1
  275. package/lib/manage/manager-worktree-lifecycle.js +5 -4
  276. package/lib/manage/manager-worktree-lifecycle.js.map +1 -1
  277. package/lib/manage/manager-worktrees.d.ts +10 -1
  278. package/lib/manage/manager-worktrees.d.ts.map +1 -1
  279. package/lib/manage/manager-worktrees.js +141 -34
  280. package/lib/manage/manager-worktrees.js.map +1 -1
  281. package/lib/manage/manager.d.ts +22 -5
  282. package/lib/manage/manager.d.ts.map +1 -1
  283. package/lib/manage/manager.js +76 -4
  284. package/lib/manage/manager.js.map +1 -1
  285. package/lib/manage/types.d.ts +10 -1
  286. package/lib/manage/types.d.ts.map +1 -1
  287. package/lib/provider/generated-name.d.ts.map +1 -1
  288. package/lib/provider/generated-name.js +5 -4
  289. package/lib/provider/generated-name.js.map +1 -1
  290. package/lib/provider/git/adapter.d.ts +13 -12
  291. package/lib/provider/git/adapter.d.ts.map +1 -1
  292. package/lib/provider/git/adapter.js +157 -31
  293. package/lib/provider/git/adapter.js.map +1 -1
  294. package/lib/provider/git/branch-name.d.ts +5 -0
  295. package/lib/provider/git/branch-name.d.ts.map +1 -0
  296. package/lib/provider/git/branch-name.js +16 -0
  297. package/lib/provider/git/branch-name.js.map +1 -0
  298. package/lib/provider/git/branches.d.ts +11 -0
  299. package/lib/provider/git/branches.d.ts.map +1 -0
  300. package/lib/provider/git/branches.js +37 -0
  301. package/lib/provider/git/branches.js.map +1 -0
  302. package/lib/provider/mutation-token.d.ts +1 -1
  303. package/lib/provider/mutation-token.d.ts.map +1 -1
  304. package/lib/provider/mutation-token.js +1 -0
  305. package/lib/provider/mutation-token.js.map +1 -1
  306. package/lib/provider/sidecar/repository.d.ts.map +1 -1
  307. package/lib/provider/sidecar/repository.js +3 -1
  308. package/lib/provider/sidecar/repository.js.map +1 -1
  309. package/lib/provider/sidecar/sidecar-schema.d.ts.map +1 -1
  310. package/lib/provider/sidecar/sidecar-schema.js +26 -4
  311. package/lib/provider/sidecar/sidecar-schema.js.map +1 -1
  312. package/lib/provider/transaction/operations/adopt-branch.d.ts.map +1 -1
  313. package/lib/provider/transaction/operations/adopt-branch.js +6 -5
  314. package/lib/provider/transaction/operations/adopt-branch.js.map +1 -1
  315. package/lib/provider/transaction/operations/clean.d.ts.map +1 -1
  316. package/lib/provider/transaction/operations/clean.js +20 -19
  317. package/lib/provider/transaction/operations/clean.js.map +1 -1
  318. package/lib/provider/transaction/operations/create.d.ts +1 -1
  319. package/lib/provider/transaction/operations/create.d.ts.map +1 -1
  320. package/lib/provider/transaction/operations/create.js +39 -17
  321. package/lib/provider/transaction/operations/create.js.map +1 -1
  322. package/lib/provider/transaction/operations/import.d.ts.map +1 -1
  323. package/lib/provider/transaction/operations/import.js +7 -1
  324. package/lib/provider/transaction/operations/import.js.map +1 -1
  325. package/lib/provider/transaction/operations/remove.d.ts.map +1 -1
  326. package/lib/provider/transaction/operations/remove.js +20 -19
  327. package/lib/provider/transaction/operations/remove.js.map +1 -1
  328. package/lib/provider/transaction/recovery/failure-recovery.d.ts.map +1 -1
  329. package/lib/provider/transaction/recovery/failure-recovery.js +22 -20
  330. package/lib/provider/transaction/recovery/failure-recovery.js.map +1 -1
  331. package/lib/provider/transaction/recovery/recover.d.ts.map +1 -1
  332. package/lib/provider/transaction/recovery/recover.js +11 -4
  333. package/lib/provider/transaction/recovery/recover.js.map +1 -1
  334. package/lib/provider/transaction/support/inspection.d.ts.map +1 -1
  335. package/lib/provider/transaction/support/inspection.js +3 -2
  336. package/lib/provider/transaction/support/inspection.js.map +1 -1
  337. package/lib/provider/transaction/support/journal.d.ts.map +1 -1
  338. package/lib/provider/transaction/support/journal.js +9 -5
  339. package/lib/provider/transaction/support/journal.js.map +1 -1
  340. package/lib/provider/transaction/support/path-safety.d.ts.map +1 -1
  341. package/lib/provider/transaction/support/path-safety.js +4 -3
  342. package/lib/provider/transaction/support/path-safety.js.map +1 -1
  343. package/lib/provider/transaction/types.d.ts +2 -1
  344. package/lib/provider/transaction/types.d.ts.map +1 -1
  345. package/lib/provider/types.d.ts +27 -5
  346. package/lib/provider/types.d.ts.map +1 -1
  347. package/lib/provider/types.js +1 -1
  348. package/lib/provider/types.js.map +1 -1
  349. package/lib/provider/worktree-path.d.ts +10 -0
  350. package/lib/provider/worktree-path.d.ts.map +1 -0
  351. package/lib/provider/worktree-path.js +47 -0
  352. package/lib/provider/worktree-path.js.map +1 -0
  353. package/lib/tool/context.d.ts +14 -0
  354. package/lib/tool/context.d.ts.map +1 -0
  355. package/lib/tool/context.js +95 -0
  356. package/lib/tool/context.js.map +1 -0
  357. package/lib/tool/delegation.d.ts +41 -0
  358. package/lib/tool/delegation.d.ts.map +1 -0
  359. package/lib/tool/delegation.js +196 -0
  360. package/lib/tool/delegation.js.map +1 -0
  361. package/lib/tool/errors.d.ts +3 -0
  362. package/lib/tool/errors.d.ts.map +1 -0
  363. package/lib/tool/errors.js +63 -0
  364. package/lib/tool/errors.js.map +1 -0
  365. package/lib/tool/guidance.d.ts +5 -0
  366. package/lib/tool/guidance.d.ts.map +1 -0
  367. package/lib/tool/guidance.js +48 -0
  368. package/lib/tool/guidance.js.map +1 -0
  369. package/lib/tool/history.d.ts +27 -0
  370. package/lib/tool/history.d.ts.map +1 -0
  371. package/lib/tool/history.js +157 -0
  372. package/lib/tool/history.js.map +1 -0
  373. package/lib/tool/index.d.ts +8 -0
  374. package/lib/tool/index.d.ts.map +1 -0
  375. package/lib/tool/index.js +296 -0
  376. package/lib/tool/index.js.map +1 -0
  377. package/lib/tool/inputs.d.ts +12 -0
  378. package/lib/tool/inputs.d.ts.map +1 -0
  379. package/lib/tool/inputs.js +24 -0
  380. package/lib/tool/inputs.js.map +1 -0
  381. package/lib/tool/list-models.d.ts +3 -0
  382. package/lib/tool/list-models.d.ts.map +1 -0
  383. package/lib/tool/list-models.js +38 -0
  384. package/lib/tool/list-models.js.map +1 -0
  385. package/lib/tool/list-sessions.d.ts +3 -0
  386. package/lib/tool/list-sessions.d.ts.map +1 -0
  387. package/lib/tool/list-sessions.js +70 -0
  388. package/lib/tool/list-sessions.js.map +1 -0
  389. package/lib/tool/list-worktrees.d.ts +3 -0
  390. package/lib/tool/list-worktrees.d.ts.map +1 -0
  391. package/lib/tool/list-worktrees.js +46 -0
  392. package/lib/tool/list-worktrees.js.map +1 -0
  393. package/lib/tool/native-session.d.ts +74 -0
  394. package/lib/tool/native-session.d.ts.map +1 -0
  395. package/lib/tool/native-session.js +248 -0
  396. package/lib/tool/native-session.js.map +1 -0
  397. package/lib/tool/new-worktree.d.ts +3 -0
  398. package/lib/tool/new-worktree.d.ts.map +1 -0
  399. package/lib/tool/new-worktree.js +81 -0
  400. package/lib/tool/new-worktree.js.map +1 -0
  401. package/lib/tool/outputs.d.ts +50 -0
  402. package/lib/tool/outputs.d.ts.map +1 -0
  403. package/lib/tool/outputs.js +65 -0
  404. package/lib/tool/outputs.js.map +1 -0
  405. package/lib/tool/report-result.d.ts +3 -0
  406. package/lib/tool/report-result.d.ts.map +1 -0
  407. package/lib/tool/report-result.js +83 -0
  408. package/lib/tool/report-result.js.map +1 -0
  409. package/lib/tool/schema.d.ts +7 -0
  410. package/lib/tool/schema.d.ts.map +1 -0
  411. package/lib/tool/schema.js +92 -0
  412. package/lib/tool/schema.js.map +1 -0
  413. package/lib/tool/send-message.d.ts +3 -0
  414. package/lib/tool/send-message.d.ts.map +1 -0
  415. package/lib/tool/send-message.js +64 -0
  416. package/lib/tool/send-message.js.map +1 -0
  417. package/lib/tool/span-worktree.d.ts +3 -0
  418. package/lib/tool/span-worktree.d.ts.map +1 -0
  419. package/lib/tool/span-worktree.js +114 -0
  420. package/lib/tool/span-worktree.js.map +1 -0
  421. package/lib/tool/types.d.ts +54 -0
  422. package/lib/tool/types.d.ts.map +1 -0
  423. package/lib/tool/types.js +2 -0
  424. package/lib/tool/types.js.map +1 -0
  425. package/lib/typert.host.js +387 -46
  426. package/lib/typert.remote-client.d.ts +17 -5
  427. package/lib/typert.remote-client.d.ts.map +1 -1
  428. package/lib/typert.remote-client.js +387 -46
  429. package/package.json +17 -3
@@ -1 +1 @@
1
- {"version":3,"file":"worktree-context.js","sourceRoot":"","sources":["../../../src/client/context/worktree-context.ts"],"names":[],"mappings":"AA2CA,MAAM,IAAI,GAAG,CAAC,MAAoC,EAA0B,EAAE,CAAC,CAAC;IAC9E,IAAI,EAAE,MAAM;IACZ,MAAM;CACP,CAAC,CAAC;AAEH,+EAA+E;AAC/E,MAAM,UAAU,6BAA6B,CAC3C,KAA2B;IAE3B,MAAM,SAAS,GAAG,KAAK,CAAC,gBAAgB,CAAC;IACzC,IAAI,SAAS,KAAK,SAAS,IAAI,KAAK,CAAC,kBAAkB,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC;IAEjG,MAAM,SAAS,GAAG,SAAS,KAAK,SAAS;QACvC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,WAAW,KAAK,KAAK,CAAC,kBAAkB,CAAC;QACtF,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9E,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC;IAEpD,MAAM,OAAO,GAAG,SAAS,KAAK,SAAS;QACrC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC;IAC1E,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,IA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a,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC;IACxE,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,EAAE,WAAW,CAAC;IAChD,MAAM,KAAK,GAAG,WAAW,EAAE,IAAI,IAAI,aAAa,EAAE,IAAI,CAAC;IACvD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC;IAExE,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,SAAS,CAAC,WAAW;QAClC,KAAK;QACL,MAAM,EAAE,WAAW,KAAK,SAAS,IAAI,WAAW,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,gBAAgB;KACvG,CAAC;AACJ,CAAC"}
@@ -1,10 +1,11 @@
1
1
  import type { WorktreeTranslate } from '../surface/types.js';
2
2
  import type { WorktreeViewError } from '../view/worktree-view.js';
3
3
  /** Present a header request while its target read settles, without expanding navigation. */
4
- export declare function DashboardRequest({ t, error, onRetry, onClose, }: {
4
+ export declare function DashboardRequest({ t, error, onRetry, onClose, context, }: {
5
5
  readonly t: WorktreeTranslate;
6
6
  readonly error?: WorktreeViewError;
7
7
  readonly onRetry: () => void;
8
8
  readonly onClose: () => void;
9
+ readonly context?: string;
9
10
  }): import("react").JSX.Element;
10
11
  //# sourceMappingURL=DashboardRequest.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardRequest.d.ts","sourceRoot":"","sources":["../../../src/client/dashboard/DashboardRequest.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAKlE,4FAA4F;AAC5F,wBAAgB,gBAAgB,CAAC,EAC/B,CAAC,EACD,KAAK,EACL,OAAO,EACP,OAAO,GACR,EAAE;IACD,QAAQ,CAAC,CAAC,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B,+BAkEA"}
1
+ {"version":3,"file":"DashboardRequest.d.ts","sourceRoot":"","sources":["../../../src/client/dashboard/DashboardRequest.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAKlE,4FAA4F;AAC5F,wBAAgB,gBAAgB,CAAC,EAC/B,CAAC,EACD,KAAK,EACL,OAAO,EACP,OAAO,EACP,OAAO,GACR,EAAE;IACD,QAAQ,CAAC,CAAC,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B,+BA8DA"}
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useLayoutEffect, useRef, useState } from 'react';
3
- import { formatWorktreeViewError } from '../view/worktree-error-copy.js';
4
3
  import { mountDashboardOverlay } from './dashboard-overlay.js';
5
4
  import styles from './dashboard.css';
5
+ import { ErrorToast } from '../surface/components/NotificationToasts.js';
6
6
  /** Present a header request while its target read settles, without expanding navigation. */
7
- export function DashboardRequest({ t, error, onRetry, onClose, }) {
7
+ export function DashboardRequest({ t, error, onRetry, onClose, context, }) {
8
8
  const ref = useRef(null);
9
9
  const [placement, setPlacement] = useState();
10
10
  useLayoutEffect(() => {
@@ -33,6 +33,6 @@ export function DashboardRequest({ t, error, onRetry, onClose, }) {
33
33
  }
34
34
  }, children: [_jsxs("header", { className: styles.dashboardTopline, "data-dashboard-topbar": true, "data-window-drag": true, children: [_jsx("span", { style: {
35
35
  marginInlineStart: `max(0px, calc(var(--dsh-frame-leading-clearance, 0px) - ${placement?.left ?? 0}px - 20px))`,
36
- }, children: t('dashboard.title') }), _jsx("div", { className: styles.dashboardToplineActions, children: _jsx("button", { type: "button", className: styles.dashboardButton, onClick: onClose, children: t('dashboard.back') }) })] }), _jsxs("div", { className: styles.dashboardPage, children: [_jsx("p", { role: error ? 'alert' : 'status', children: error ? formatWorktreeViewError(error, t) : t('status.loading') }), error && (_jsx("button", { type: "button", className: styles.dashboardButton, onClick: onRetry, children: t('action.retry') }))] })] }));
36
+ }, children: t('dashboard.title') }), _jsx("div", { className: styles.dashboardToplineActions, children: _jsx("button", { type: "button", className: styles.dashboardButton, onClick: onClose, children: t('dashboard.back') }) })] }), _jsxs("div", { className: styles.dashboardPage, children: [error === undefined && _jsx("p", { role: "status", children: t('status.loading') }), _jsx(ErrorToast, { error: error, t: t, scope: "dashboard-request", context: context ?? t('dashboard.title'), actions: [{ label: t('action.retry'), onClick: onRetry }] })] })] }));
37
37
  }
38
38
  //# sourceMappingURL=DashboardRequest.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardRequest.js","sourceRoot":"","sources":["../../../src/client/dashboard/DashboardRequest.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAA2B,MAAM,wBAAwB,CAAC;AACxF,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,4FAA4F;AAC5F,MAAM,UAAU,gBAAgB,CAAC,EAC/B,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AAK,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAC,mBAAmB,EACvD,OAAO,EAAE,OAAO,IAAI,CAAC,CAAC,iBAAiB,CAAC,EACxC,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,GAAI,IAC3D,IACE,CACX,CAAC;AACJ,CAAC"}
@@ -2,11 +2,15 @@ import type { DashboardRecord } from './dashboard-selection.js';
2
2
  import type { WorktreeTranslate } from '../surface/types.js';
3
3
  import type { SessionListLike, SessionPresentation } from '../session/session-view.js';
4
4
  import type { BranchRecord, WorktreeManager } from '../../contract/index.js';
5
+ import type { WorktreeToolSettingsManager } from '../../contract/tool-settings.js';
5
6
  export interface WorktreeDashboardProps {
6
- readonly manager?: WorktreeManager;
7
+ readonly manager?: WorktreeManager & Partial<WorktreeToolSettingsManager>;
7
8
  readonly onSaveInstructions?: (text: string, expected: string) => Promise<string>;
8
9
  readonly onSaveBaseline?: (baseBranch: string, expectedBaseBranch?: string) => Promise<string>;
10
+ readonly onFetchBranches?: () => Promise<readonly BranchRecord[]>;
11
+ readonly onLoadBranches?: () => Promise<readonly BranchRecord[]>;
9
12
  readonly branches?: readonly BranchRecord[];
13
+ readonly branchesLoading?: boolean;
10
14
  readonly record: DashboardRecord;
11
15
  readonly workspaceTitle: string;
12
16
  readonly t: WorktreeTranslate;
@@ -24,5 +28,5 @@ export interface WorktreeDashboardProps {
24
28
  readonly onOpenFile?: (path: string) => void;
25
29
  }
26
30
  /** A managed Worktree or browser Main projection with explicit unavailable states for inapplicable facts. */
27
- export declare function WorktreeDashboard({ manager, record, workspaceTitle, t, onClose, onOpenSidebar, isRightSidebarExpanded, sessions, sessionPresentations, sessionIds, actionPending, onOpenSession, onCreateSession, onCreateWorktree, onArchiveWorktree, onOpenFile, onSaveInstructions, onSaveBaseline, branches, }: WorktreeDashboardProps): import("react").JSX.Element;
31
+ export declare function WorktreeDashboard({ manager, record, workspaceTitle, t, onClose, onOpenSidebar, isRightSidebarExpanded, sessions, sessionPresentations, sessionIds, actionPending, onOpenSession, onCreateSession, onCreateWorktree, onArchiveWorktree, onOpenFile, onSaveInstructions, onSaveBaseline, onFetchBranches, onLoadBranches, branches, branchesLoading, }: WorktreeDashboardProps): import("react").JSX.Element;
28
32
  //# sourceMappingURL=WorktreeDashboard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WorktreeDashboard.d.ts","sourceRoot":"","sources":["../../../src/client/dashboard/WorktreeDashboard.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAG7D,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAWvF,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAK7E,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC;IACnC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAClF,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/F,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,CAAC,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,CAAC,aAAa,CAAC,EAAE,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AC,CAAC,CAAC;IACzF,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IACtC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IACvC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IACxC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AA8SD,6GAA6G;AAC7G,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,MAAM,EACN,cAAc,EACd,CAAC,EACD,OAAO,EACP,aAAa,EACb,sBAAsB,EACtB,QAAQ,EACR,oBAAoB,EACpB,UAAU,EACV,aAAa,EACb,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,cAAc,EACd,QAAa,EACb,eAAuB,GACxB,EAAE,sBAAsB,+BAqlBxB"}
@@ -1,7 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useEffect, useId, useLayoutEffect, useRef, useState } from 'react';
3
- import { Button, Input, Modal, StateDot, Tooltip, writeClipboard, } from '@deepseek-ai/dsh-client-ui-primitives';
4
- import { IconBranchOutline16, IconCheckOutline16, IconCopyOutline16, IconEditOutline16, IconPanelLeftOutline16, IconSearchOutline16, } from '../dsh-icons.js';
2
+ import { NotificationToasts } from '../surface/components/NotificationToasts.js';
3
+ import { toWorktreeViewError } from '../view/worktree-view.js';
4
+ import { formatWorktreeViewError } from '../view/worktree-error-copy.js';
5
+ import { useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from 'react';
6
+ import { Button, Modal, StateDot, Tooltip, writeClipboard, } from '@deepseek-ai/dsh-client-ui-primitives';
7
+ import { IconBranchOutline16, IconCopyOutline16, IconEditOutline16, IconPanelLeftOutline16, } from '../dsh-icons.js';
5
8
  import { isBlankSession, relativeTime, sessionDisplayLabel } from '../session/session-view.js';
6
9
  import { currentSessionIdFromList } from '../session/session-selection.js';
7
10
  import { sessionStatusLabel, sessionTimeLabel } from '../session/session-labels.js';
@@ -13,6 +16,8 @@ import styles from './dashboard.css';
13
16
  import { WorktreeInstructions } from './WorktreeInstructions.js';
14
17
  import { WorktreeGitPanel } from './git/WorktreeGitPanel.js';
15
18
  import { useWorktreeGitOverview, WorktreeGitOverviewValue } from './git/WorktreeGitOverview.js';
19
+ import { GitBranchPicker } from '../branch/GitBranchSelector.js';
20
+ import { ToolSettings } from '../settings/ToolSettings.js';
16
21
  const TABS = ['overview', 'git', 'sessions', 'children', 'settings'];
17
22
  function DashboardIcon({ kind }) {
18
23
  const paths = {
@@ -35,24 +40,34 @@ function DashboardFactRow({ label, children, action, baseline = false, }) {
35
40
  function PlaceholderButton({ children, t }) {
36
41
  return (_jsx("button", { type: "button", className: styles.dashboardButton, disabled: true, title: t('dashboard.soon'), children: children }));
37
42
  }
38
- function WorktreeBaselineEditor({ value, branches, currentBranch, onSave, t, disabled, }) {
43
+ function WorktreeBaselineEditor({ value, branches, loading, currentBranch, onSave, onFetch, onLoad, t, disabled, context, }) {
39
44
  const [saved, setSaved] = useState(value);
40
45
  const [draft, setDraft] = useState();
41
- const [search, setSearch] = useState('');
42
46
  const [pending, setPending] = useState(false);
43
- const [error, setError] = useState(false);
47
+ const [error, setError] = useState();
44
48
  const busy = useRef(false);
45
49
  const alive = useRef(true);
46
- const optionRefs = useRef([]);
47
50
  const trigger = useRef(null);
48
51
  const wasOpen = useRef(false);
49
52
  const expected = useRef(value);
50
- const pickerId = useId();
51
- const options = branches.filter((branch) => branch.name !== currentBranch);
53
+ // Workspace projections omit the branch catalog; this editor owns on-demand results.
54
+ const [fetched, setFetched] = useState();
55
+ const [reading, setReading] = useState(false);
56
+ const editorOpen = useRef(false);
57
+ const editorGeneration = useRef(0);
58
+ const requestGeneration = useRef(0);
59
+ const roster = fetched ?? branches;
60
+ const options = useMemo(() => roster.filter((branch) => branch.kind === 'remote' || branch.name !== currentBranch), [roster, currentBranch]);
61
+ const draftMatches = options.filter((branch) => (branch.ref ?? branch.name) === draft ||
62
+ (!draft?.startsWith('refs/') && (branch.name === draft ||
63
+ (branch.kind === 'remote' && 'remotes/' + branch.name === draft))));
64
+ const validDraft = draftMatches.length === 1;
52
65
  useEffect(() => {
53
66
  alive.current = true;
54
67
  return () => {
55
68
  alive.current = false;
69
+ editorGeneration.current++;
70
+ requestGeneration.current++;
56
71
  };
57
72
  }, []);
58
73
  useEffect(() => {
@@ -67,74 +82,66 @@ function WorktreeBaselineEditor({ value, branches, currentBranch, onSave, t, dis
67
82
  const closeEditor = () => {
68
83
  if (pending)
69
84
  return;
85
+ editorOpen.current = false;
86
+ editorGeneration.current++;
87
+ requestGeneration.current++;
88
+ setReading(false);
70
89
  setDraft(undefined);
71
- setSearch('');
72
- setError(false);
90
+ setError(undefined);
73
91
  };
74
92
  const openEditor = () => {
93
+ editorOpen.current = true;
94
+ editorGeneration.current++;
95
+ requestGeneration.current++;
96
+ setReading(false);
75
97
  expected.current = saved;
76
98
  setDraft(saved ?? '');
77
- setSearch('');
78
- setError(false);
99
+ setError(undefined);
79
100
  };
80
- const query = search.trim().toLowerCase();
81
- const filteredOptions = query.length === 0
82
- ? options
83
- : options.filter((branch) => branch.name.toLowerCase().includes(query));
84
- const activeIndex = filteredOptions.findIndex((branch) => branch.name === draft);
85
- // The list is a permanent, fixed-height region: filtering swaps its rows but
86
- // never changes its height, so the modal frame stays put.
87
- const listOpen = filteredOptions.length > 0;
88
- const selectOption = (index) => {
89
- if (pending)
90
- return;
91
- const branch = filteredOptions[index];
92
- if (branch === undefined)
93
- return;
94
- setDraft(branch.name);
95
- };
96
- const moveOption = (offset) => {
97
- if (filteredOptions.length === 0)
98
- return;
99
- const nextIndex = activeIndex < 0
100
- ? offset > 0
101
- ? 0
102
- : filteredOptions.length - 1
103
- : (activeIndex + offset + filteredOptions.length) % filteredOptions.length;
104
- selectOption(nextIndex);
105
- optionRefs.current[nextIndex]?.scrollIntoView({ block: 'nearest' });
106
- };
107
- const onSearchKeyDown = (event) => {
108
- if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
109
- event.preventDefault();
110
- moveOption(event.key === 'ArrowDown' ? 1 : -1);
101
+ const lifetime = editorGeneration.current;
102
+ const readBranches = async (read) => {
103
+ if (!alive.current || !editorOpen.current || editorGeneration.current !== lifetime)
104
+ return options;
105
+ const request = ++requestGeneration.current;
106
+ const isCurrent = () => alive.current && editorOpen.current &&
107
+ editorGeneration.current === lifetime && requestGeneration.current === request;
108
+ setReading(true);
109
+ try {
110
+ const next = await read();
111
+ if (isCurrent())
112
+ setFetched(next);
113
+ return next.filter((branch) => branch.kind === 'remote' || branch.name !== currentBranch);
111
114
  }
112
- else if (event.key === 'Enter' && filteredOptions.length > 0) {
113
- event.preventDefault();
114
- selectOption(activeIndex < 0 ? 0 : activeIndex);
115
+ finally {
116
+ if (isCurrent())
117
+ setReading(false);
115
118
  }
116
119
  };
117
120
  const save = async () => {
118
121
  if (busy.current ||
119
122
  draft === undefined ||
120
123
  onSave === undefined ||
121
- !options.some((branch) => branch.name === draft))
124
+ loading ||
125
+ reading ||
126
+ !validDraft)
122
127
  return;
123
128
  busy.current = true;
124
129
  setPending(true);
125
- setError(false);
130
+ setError(undefined);
126
131
  try {
127
132
  const result = await onSave(draft, expected.current);
128
133
  if (alive.current) {
129
134
  setSaved(result);
130
135
  expected.current = result;
136
+ editorOpen.current = false;
137
+ editorGeneration.current++;
138
+ requestGeneration.current++;
131
139
  setDraft(undefined);
132
- setSearch('');
133
140
  }
134
141
  }
135
- catch {
142
+ catch (cause) {
136
143
  if (alive.current)
137
- setError(true);
144
+ setError(toWorktreeViewError(cause));
138
145
  }
139
146
  finally {
140
147
  busy.current = false;
@@ -142,12 +149,26 @@ function WorktreeBaselineEditor({ value, branches, currentBranch, onSave, t, dis
142
149
  setPending(false);
143
150
  }
144
151
  };
145
- return (_jsxs(_Fragment, { children: [_jsx(DashboardFactRow, { label: t('dashboard.base'), baseline: true, action: onSave !== undefined ? (_jsx(Tooltip, { label: t('dashboard.editBase'), side: "bottom", delayMs: 500, disabled: disabled || options.length === 0, children: _jsx("button", { type: "button", ref: trigger, className: styles.dashboardIconButton, "data-dashboard-baseline-edit": true, "aria-label": t('dashboard.editBase'), title: t('dashboard.editBase'), "aria-haspopup": "dialog", "aria-expanded": draft !== undefined, disabled: disabled || options.length === 0, onClick: openEditor, children: _jsx(IconEditOutline16, {}) }) })) : undefined, children: saved === undefined ? (_jsx("span", { className: styles.dashboardHistorical, children: t('dashboard.historicalUnavailable') })) : (_jsx("span", { "data-dashboard-baseline-value": true, children: saved })) }), _jsx(Modal, { open: draft !== undefined, onClose: closeEditor, closeLabel: t('dialog.closeBaseline'), title: t('dashboard.editBase'), description: t('dashboard.editBaseDescription'), className: styles.dashboardBaselineModal, contentClassName: styles.dashboardBaselineModalContent, footer: _jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", disabled: pending, onClick: closeEditor, children: t('dashboard.cancelBase') }), _jsx(Button, { variant: "primary", "data-dashboard-baseline-save": true, disabled: pending || disabled || !options.some((branch) => branch.name === draft), onClick: () => void save(), children: t(pending ? 'dashboard.savingBase' : 'dashboard.saveBase') })] }), children: _jsxs("div", { className: styles.dashboardBaselinePicker, "data-dashboard-baseline-modal": true, children: [_jsx(Input, { icon: _jsx(IconSearchOutline16, {}), className: styles.dashboardBaselineSearch, "aria-label": t('dashboard.searchBranches'), role: "combobox", "aria-autocomplete": "list", "aria-controls": listOpen ? `${pickerId}-options` : undefined, "aria-expanded": listOpen, "aria-haspopup": "listbox", "aria-activedescendant": listOpen && activeIndex >= 0 ? `${pickerId}-option-${activeIndex}` : undefined, "data-dashboard-baseline-search": true, disabled: pending || disabled, placeholder: t('dashboard.searchBranches'), value: search, onKeyDown: onSearchKeyDown, onChange: (event) => setSearch(event.currentTarget.value) }), _jsx("div", { className: styles.dashboardBaselineOptions, "data-dashboard-baseline-options": true, children: listOpen ? (_jsx("div", { id: `${pickerId}-options`, className: styles.dashboardBaselineList, role: "listbox", "aria-label": t('dashboard.searchBranches'), children: filteredOptions.map((branch, index) => (_jsxs("button", { type: "button", ref: (element) => {
146
- optionRefs.current[index] = element;
147
- }, id: `${pickerId}-option-${index}`, className: styles.dashboardBaselineOption, "data-dashboard-baseline-option": branch.name, "data-highlighted": activeIndex === index ? true : undefined, role: "option", "aria-selected": branch.name === draft, onClick: () => selectOption(index), children: [_jsx(IconBranchOutline16, {}), _jsx("span", { className: styles.dashboardBaselineOptionLabel, children: branch.name }), branch.name === draft && _jsx(IconCheckOutline16, {})] }, branch.name))) })) : (_jsx("div", { className: styles.dashboardBaselineEmpty, "data-dashboard-baseline-empty": true, role: "status", "aria-live": "polite", children: t('dashboard.noMatchingBranches') })) }), _jsx("div", { className: styles.dashboardBaselineStatus, "data-dashboard-baseline-status": true, children: error && (_jsx("span", { className: styles.dashboardBaselineError, "data-dashboard-baseline-error": true, role: "alert", children: t('dashboard.baseSaveFailed') })) })] }) })] }));
152
+ return (_jsxs(_Fragment, { children: [_jsx(DashboardFactRow, { label: t('dashboard.base'), baseline: true, action: onSave !== undefined ? (_jsx(Tooltip, { label: t('dashboard.editBase'), side: "bottom", delayMs: 500, disabled: disabled || (options.length === 0 && onLoad === undefined), children: _jsx("button", { type: "button", ref: trigger, className: styles.dashboardIconButton, "data-dashboard-baseline-edit": true, "aria-label": t('dashboard.editBase'), title: t('dashboard.editBase'), "aria-haspopup": "dialog", "aria-expanded": draft !== undefined, disabled: disabled || (options.length === 0 && onLoad === undefined), onClick: openEditor, children: _jsx(IconEditOutline16, {}) }) })) : undefined, children: saved === undefined ? (_jsx("span", { className: styles.dashboardHistorical, children: t('dashboard.historicalUnavailable') })) : (_jsx("span", { "data-dashboard-baseline-value": true, title: saved, children: saved.replace(/^refs\/(heads|remotes)\//u, '') })) }), _jsx(Modal, { open: draft !== undefined, onClose: closeEditor, closeLabel: t('dialog.closeBaseline'), title: t('dashboard.editBase'), description: t('dashboard.editBaseDescription'), className: styles.dashboardBaselineModal, contentClassName: styles.dashboardBaselineModalContent, footer: _jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", disabled: pending, onClick: closeEditor, children: t('dashboard.cancelBase') }), _jsx(Button, { variant: "primary", "data-dashboard-baseline-save": true, disabled: pending || disabled || loading || reading || !validDraft, onClick: () => void save(), children: t(pending ? 'dashboard.savingBase' : 'dashboard.saveBase') })] }), children: _jsxs("div", { className: styles.dashboardBaselinePicker, "data-dashboard-baseline-modal": true, children: [draft !== undefined && _jsx(GitBranchPicker, { branches: options, value: draft, onChange: setDraft, t: t, disabled: pending || disabled, loading: loading, onClose: closeEditor, onLoad: onLoad === undefined ? undefined : () => readBranches(onLoad), onFetch: onFetch === undefined ? undefined : () => readBranches(onFetch) }, lifetime), _jsx(NotificationToasts, { notices: error === undefined
153
+ ? []
154
+ : [
155
+ {
156
+ key: JSON.stringify(['baseline', context, error.code, error.details]),
157
+ context, error,
158
+ actions: [{ label: t('action.retry'), disabled: pending || disabled,
159
+ onClick: () => { void save(); } }],
160
+ describe: (translate) => translate('dashboard.base') + ' · ' + (context ?? ''),
161
+ message: (translate) => translate('dashboard.baseSaveFailed') +
162
+ (error.code === 'WORKTREE_VIEW_FAILED' ? '' : ' ' + formatWorktreeViewError(error, translate)),
163
+ text: t('dashboard.baseSaveFailed') +
164
+ (error.code === 'WORKTREE_VIEW_FAILED'
165
+ ? ''
166
+ : ' ' + formatWorktreeViewError(error, t)),
167
+ },
168
+ ] })] }) })] }));
148
169
  }
149
170
  /** A managed Worktree or browser Main projection with explicit unavailable states for inapplicable facts. */
150
- export function WorktreeDashboard({ manager, record, workspaceTitle, t, onClose, onOpenSidebar, isRightSidebarExpanded, sessions, sessionPresentations, sessionIds, actionPending, onOpenSession, onCreateSession, onCreateWorktree, onArchiveWorktree, onOpenFile, onSaveInstructions, onSaveBaseline, branches = [], }) {
171
+ export function WorktreeDashboard({ manager, record, workspaceTitle, t, onClose, onOpenSidebar, isRightSidebarExpanded, sessions, sessionPresentations, sessionIds, actionPending, onOpenSession, onCreateSession, onCreateWorktree, onArchiveWorktree, onOpenFile, onSaveInstructions, onSaveBaseline, onFetchBranches, onLoadBranches, branches = [], branchesLoading = false, }) {
151
172
  const surface = useRef(null);
152
173
  const heading = useRef(null);
153
174
  const [placement, setPlacement] = useState();
@@ -202,7 +223,7 @@ export function WorktreeDashboard({ manager, record, workspaceTitle, t, onClose,
202
223
  return () => {
203
224
  branchCopyGeneration.current += 1;
204
225
  };
205
- }, [record.branch]);
226
+ }, [record.branch, record.currentBranch, record.currentHead?.name]);
206
227
  const copyPath = async () => {
207
228
  if (copyPending.current)
208
229
  return;
@@ -223,8 +244,10 @@ export function WorktreeDashboard({ manager, record, workspaceTitle, t, onClose,
223
244
  copyPending.current = false;
224
245
  }
225
246
  };
226
- const branchAvailable = record.branch.length > 0;
227
- const displayBranch = branchAvailable ? record.branch : t('dashboard.branchUnavailable');
247
+ const isMain = isMainWorktreeId(record.worktreeId);
248
+ const refName = record.currentHead?.name ?? record.currentBranch ?? record.branch;
249
+ const branchAvailable = refName.length > 0;
250
+ const displayBranch = branchAvailable ? refName : t('dashboard.branchUnavailable');
228
251
  const copyBranch = async () => {
229
252
  if (!branchAvailable || branchCopyPending.current)
230
253
  return;
@@ -232,7 +255,7 @@ export function WorktreeDashboard({ manager, record, workspaceTitle, t, onClose,
232
255
  const generation = branchCopyGeneration.current;
233
256
  setBranchCopyState('pending');
234
257
  try {
235
- const copied = await writeClipboard(record.branch);
258
+ const copied = await writeClipboard(refName);
236
259
  if (generation === branchCopyGeneration.current)
237
260
  setBranchCopyState(copied ? 'copied' : 'failed');
238
261
  }
@@ -245,7 +268,7 @@ export function WorktreeDashboard({ manager, record, workspaceTitle, t, onClose,
245
268
  branchCopyPending.current = false;
246
269
  }
247
270
  };
248
- const healthKey = record.health === 'ready'
271
+ const healthKey = isMain ? 'dashboard.mainReady' : record.health === 'ready'
249
272
  ? 'worktree.ready'
250
273
  : record.health === 'repair'
251
274
  ? 'worktree.repair'
@@ -256,10 +279,10 @@ export function WorktreeDashboard({ manager, record, workspaceTitle, t, onClose,
256
279
  : record.health === 'cleaned'
257
280
  ? 'dashboard.cleaned'
258
281
  : 'dashboard.unknown';
259
- const liveBranch = record.currentBranch === null
282
+ const liveBranch = record.currentHead?.name ?? (record.currentBranch === null
260
283
  ? t('dashboard.detached')
261
284
  : (record.currentBranch ??
262
- (branchAvailable ? record.branch : t('dashboard.branchUnavailable')));
285
+ (branchAvailable ? record.branch : t('dashboard.branchUnavailable'))));
263
286
  const baselineCurrentBranch = record.currentBranch === undefined ? record.branch : (record.currentBranch ?? undefined);
264
287
  const persistBaseline = onSaveBaseline === undefined
265
288
  ? undefined
@@ -287,7 +310,7 @@ export function WorktreeDashboard({ manager, record, workspaceTitle, t, onClose,
287
310
  document.getElementById(`${id}-${next}`)?.focus();
288
311
  };
289
312
  const tabLink = (next, label) => (_jsxs("button", { type: "button", className: styles.dashboardLink, onClick: () => selectTab(next, true), children: [label, _jsx("span", { "aria-hidden": "true", children: "\u2192" })] }));
290
- const sessionList = (ids) => ids.length === 0 ? (_jsx("div", { className: styles.dashboardEmpty, children: _jsx("p", { children: t('dashboard.noSessions') }) })) : (_jsx("ul", { className: styles.dashboardSessions, children: ids.map((sessionId) => {
313
+ const sessionList = (ids) => ids.length === 0 ? (_jsxs("div", { className: styles.dashboardEmpty, children: [_jsx("p", { children: t('dashboard.noSessions') }), onCreateSession !== undefined && _jsx("button", { type: "button", className: styles.dashboardButton, disabled: actionPending, onClick: onCreateSession, children: t('dashboard.newSession') })] })) : (_jsx("ul", { className: styles.dashboardSessions, children: ids.map((sessionId) => {
291
314
  const presentation = sessionPresentations[sessionId];
292
315
  const blank = isBlankSession(sessionId, sessions);
293
316
  const statusLabel = presentation === undefined ? undefined : sessionStatusLabel(t, presentation.status);
@@ -307,6 +330,8 @@ export function WorktreeDashboard({ manager, record, workspaceTitle, t, onClose,
307
330
  if (event.defaultPrevented)
308
331
  return;
309
332
  if (event.key === 'Escape') {
333
+ if (event.target?.closest?.('[data-single-select-picker]'))
334
+ return;
310
335
  // Other dashboard menus own Escape even when focus remains elsewhere in the surface.
311
336
  if (event.currentTarget.querySelector('[role="menu"]'))
312
337
  return;
@@ -323,29 +348,24 @@ export function WorktreeDashboard({ manager, record, workspaceTitle, t, onClose,
323
348
  }, children: topActionIsCreateSession ? t('dashboard.newSession') : _jsxs(_Fragment, { children: ["\u2190 ", t('dashboard.back')] }) }), !rightSidebarOpen && onOpenSidebar !== undefined && (_jsx(Tooltip, { label: t('dashboard.openSidebar'), side: "bottom", delayMs: 500, children: _jsx("button", { type: "button", className: styles.dashboardSidebarButton, "aria-label": t('dashboard.openSidebar'), title: t('dashboard.openSidebar'), "data-sidebar-right-expand": true, onClick: () => {
324
349
  onOpenSidebar();
325
350
  setRightSidebarOpen(true);
326
- }, children: _jsx(IconPanelLeftOutline16, {}) }) }))] })] }), _jsxs("div", { className: styles.dashboardPage, children: [_jsxs("header", { className: styles.dashboardHeader, children: [_jsxs("div", { className: styles.dashboardIdentity, children: [_jsxs("div", { className: styles.dashboardTitleRow, "data-dashboard-copy": "branch", role: branchAvailable ? 'button' : undefined, tabIndex: branchAvailable ? 0 : undefined, "aria-label": branchAvailable ? t('dashboard.copyBranch') : undefined, title: branchAvailable ? t('dashboard.copyBranch') : undefined, "aria-busy": branchAvailable && branchCopyState === 'pending' ? true : undefined, onClick: branchAvailable ? () => void copyBranch() : undefined, onKeyDown: branchAvailable
327
- ? (event) => {
328
- if (event.key === 'Enter' || event.key === ' ') {
329
- event.preventDefault();
330
- void copyBranch();
331
- }
332
- }
333
- : undefined, children: [_jsx(IconBranchOutline16, {}), _jsx("h1", { id: `${id}-title`, ref: heading, tabIndex: -1, children: displayBranch }), _jsxs("span", { className: styles.dashboardHealth, "data-health": record.health ?? 'unknown', children: [_jsx("span", { "aria-hidden": "true", children: "\u25CF" }), t(healthKey)] }), record.status === 'removed' && (_jsx("span", { className: styles.dashboardSoon, children: t('dashboard.archived') }))] }), _jsxs("div", { className: styles.dashboardPath, children: [_jsx("span", { className: styles.dashboardFieldLabel, children: "cwd" }), _jsx("code", { children: record.absolutePath }), _jsx("button", { type: "button", className: styles.dashboardIconButton, "aria-label": t('worktree.copyPath'), title: t('worktree.copyPath'), disabled: copyState === 'pending', onClick: () => {
351
+ }, children: _jsx(IconPanelLeftOutline16, {}) }) }))] })] }), _jsxs("div", { className: styles.dashboardPage, children: [_jsxs("header", { className: styles.dashboardHeader, children: [_jsxs("div", { className: styles.dashboardIdentity, children: [_jsxs("div", { className: styles.dashboardTitleRow, children: [_jsx(IconBranchOutline16, {}), _jsx("h1", { id: `${id}-title`, ref: heading, tabIndex: -1, children: _jsx("button", { type: "button", className: styles.dashboardRefButton, "data-dashboard-copy": "branch", disabled: !branchAvailable, "aria-label": branchAvailable ? t('dashboard.copyBranch') : undefined, title: branchAvailable ? t('dashboard.copyBranch') : undefined, "aria-busy": branchAvailable && branchCopyState === 'pending' ? true : undefined, onClick: branchAvailable ? () => void copyBranch() : undefined, children: displayBranch }) }), record.currentHead?.kind !== undefined && record.currentHead.kind !== 'branch' && _jsx("span", { className: styles.dashboardSoon, children: t(record.currentHead.kind === 'tag' ? 'dashboard.refKind.tag' : 'dashboard.refKind.commit') }), _jsxs("span", { className: styles.dashboardHealth, "data-health": isMain ? 'local' : record.health ?? 'unknown', children: [_jsx("span", { "aria-hidden": "true", children: "\u25CF" }), t(healthKey)] }), record.status === 'removed' && (_jsx("span", { className: styles.dashboardSoon, children: t('dashboard.archived') }))] }), _jsxs("div", { className: styles.dashboardPath, children: [_jsx("span", { className: styles.dashboardFieldLabel, children: "cwd" }), _jsx("code", { children: record.absolutePath }), _jsx("button", { type: "button", className: styles.dashboardIconButton, "aria-label": t('worktree.copyPath'), title: t('worktree.copyPath'), disabled: copyState === 'pending', onClick: () => {
334
352
  void copyPath();
335
- }, children: _jsx(IconCopyOutline16, {}) })] }), _jsx("p", { className: styles.dashboardCopyStatus, role: branchCopyState === 'failed' ||
336
- (branchCopyState === 'idle' && copyState === 'failed')
337
- ? 'alert'
338
- : 'status', children: branchCopyState === 'pending'
339
- ? '\u00a0'
340
- : branchCopyState === 'copied'
341
- ? t('dashboard.branchCopied')
342
- : branchCopyState === 'failed'
343
- ? t('dashboard.branchCopyFailed')
344
- : copyState === 'copied'
345
- ? t('dashboard.copied')
346
- : copyState === 'failed'
347
- ? t('dashboard.copyFailed')
348
- : '\u00a0' })] }), _jsx("div", { className: styles.dashboardHeaderAside, children: _jsxs("dl", { className: styles.dashboardFacts, children: [_jsx(DashboardFactRow, { label: t(acquisitionLabel), children: acquisitionFacts.timestamp ? (_jsx("time", { dateTime: acquisitionFacts.timestamp, children: new Date(acquisitionFacts.timestamp).toLocaleString() })) : (_jsx("span", { className: styles.dashboardHistorical, children: t('dashboard.historicalUnavailable') })) }), !isMainWorktreeId(record.worktreeId) && persistBaseline !== undefined ? (_jsx(WorktreeBaselineEditor, { value: baselineBranch, branches: branches, currentBranch: baselineCurrentBranch, onSave: persistBaseline, t: t, disabled: record.status !== 'active' || record.health === 'recovery-needed' })) : (_jsx(DashboardFactRow, { label: t('dashboard.base'), baseline: true, children: displayedBaseline ?? (_jsx("span", { className: styles.dashboardHistorical, children: t('dashboard.historicalUnavailable') })) })), _jsx(DashboardFactRow, { label: t('dashboard.source'), children: isMainWorktreeId(record.worktreeId)
353
+ }, children: _jsx(IconCopyOutline16, {}) })] }), _jsx(NotificationToasts, { notices: [
354
+ ...(branchCopyState === 'failed'
355
+ ? [{ key: 'copy-branch:' + record.absolutePath, text: t('dashboard.branchCopyFailed'),
356
+ context: workspaceTitle + ' · ' + record.branch + ' · ' + record.absolutePath,
357
+ message: (translate) => translate('dashboard.branchCopyFailed') }]
358
+ : []),
359
+ ...(copyState === 'failed'
360
+ ? [{ key: 'copy-path:' + record.absolutePath, text: t('dashboard.copyFailed'),
361
+ context: workspaceTitle + ' · ' + record.absolutePath,
362
+ message: (translate) => translate('dashboard.copyFailed') }]
363
+ : []),
364
+ ] }), _jsx("p", { className: styles.dashboardCopyStatus, role: "status", children: branchCopyState === 'copied'
365
+ ? t('dashboard.branchCopied')
366
+ : copyState === 'copied'
367
+ ? t('dashboard.copied')
368
+ : '\u00a0' })] }), _jsx("div", { className: styles.dashboardHeaderAside, children: _jsxs("dl", { className: styles.dashboardFacts, children: [!isMain && _jsx(DashboardFactRow, { label: t(acquisitionLabel), children: acquisitionFacts.timestamp ? (_jsx("time", { dateTime: acquisitionFacts.timestamp, children: new Date(acquisitionFacts.timestamp).toLocaleString() })) : (_jsx("span", { className: styles.dashboardHistorical, children: t('dashboard.historicalUnavailable') })) }), !isMain && (persistBaseline !== undefined ? (_jsx(WorktreeBaselineEditor, { context: workspaceTitle + ' · ' + record.branch + ' · ' + record.absolutePath, value: baselineBranch, branches: branches, loading: branchesLoading, currentBranch: baselineCurrentBranch, onSave: persistBaseline, onFetch: onFetchBranches, onLoad: onLoadBranches, t: t, disabled: record.status !== 'active' || record.health === 'recovery-needed' })) : (_jsx(DashboardFactRow, { label: t('dashboard.base'), baseline: true, children: displayedBaseline?.replace(/^refs\/(heads|remotes)\//u, '') ?? (_jsx("span", { className: styles.dashboardHistorical, children: t('dashboard.historicalUnavailable') })) }))), _jsx(DashboardFactRow, { label: t('dashboard.source'), children: isMainWorktreeId(record.worktreeId)
349
369
  ? t('worktree.main')
350
370
  : t(record.source === 'external' ? 'dashboard.external' : 'dashboard.plugin') })] }) })] }), _jsx("div", { className: styles.dashboardTabs, role: "tablist", "aria-label": t('dashboard.title'), children: TABS.map((value) => (_jsxs("button", { type: "button", id: `${id}-${value}`, role: "tab", "aria-selected": tab === value, "aria-controls": `${id}-panel`, tabIndex: tab === value ? 0 : -1, onClick: () => selectTab(value), onKeyDown: (event) => {
351
371
  const index = TABS.indexOf(value);
@@ -362,9 +382,11 @@ export function WorktreeDashboard({ manager, record, workspaceTitle, t, onClose,
362
382
  event.preventDefault();
363
383
  selectTab(next, true);
364
384
  }
365
- }, children: [_jsx(DashboardIcon, { kind: value }), tabLabel(value)] }, value))) }), _jsx("div", { id: `${id}-panel`, role: "tabpanel", "aria-labelledby": `${id}-${tab}`, tabIndex: 0, className: styles.dashboardPanel, children: tab === 'overview' ? (_jsxs("div", { className: styles.dashboardGrid, children: [_jsxs("div", { className: styles.dashboardColumn, children: [_jsxs("section", { className: styles.dashboardStart, children: [_jsxs("h2", { children: [_jsx(IconBranchOutline16, {}), t('dashboard.start')] }), _jsx("p", { children: t('dashboard.startDescription') }), _jsxs("div", { className: styles.dashboardStartActions, children: [_jsxs("button", { type: "button", disabled: actionPending || !onCreateWorktree, onClick: onCreateWorktree, "data-dashboard-action": "create-worktree", children: [_jsx(DashboardIcon, { kind: "git" }), _jsxs("span", { children: [_jsx("strong", { children: t('dashboard.newWorktree') }), _jsx("small", { children: t('dashboard.newWorktreeDescription') })] })] }), _jsxs("button", { type: "button", disabled: actionPending || !onCreateSession, onClick: onCreateSession, "data-dashboard-action": "create-session", children: [_jsx(DashboardIcon, { kind: "sessions" }), _jsxs("span", { children: [_jsx("strong", { children: t('dashboard.newSession') }), _jsx("small", { children: t('dashboard.newSessionDescription') })] })] })] })] }), _jsxs(Card, { title: t('dashboard.instructions'), icon: _jsx(DashboardIcon, { kind: "instructions" }), children: [_jsx("p", { children: t('dashboard.instructionsDescription') }), _jsx(WorktreeInstructions, { value: record.instructions ?? '', onSave: onSaveInstructions, t: t, disabled: actionPending || record.health === 'recovery-needed' })] }), _jsxs(Card, { title: tabLabel('sessions'), icon: _jsx(DashboardIcon, { kind: "sessions" }), action: _jsx("span", { children: sessionIds.length }), children: [sessionList(sessionIds.slice(0, 5)), tabLink('sessions', t('dashboard.viewSessions'))] })] }), _jsxs("div", { className: styles.dashboardColumn, children: [_jsxs(Card, { title: t('dashboard.status'), icon: _jsx(DashboardIcon, { kind: "git" }), children: [_jsx("p", { children: t('dashboard.statusHint') }), _jsxs("dl", { className: styles.dashboardFacts, children: [_jsx(DashboardFactRow, { label: t('dashboard.health'), children: t(healthKey) }), _jsx(DashboardFactRow, { label: t('dashboard.branch'), children: liveBranch }), _jsx(DashboardFactRow, { label: t('dashboard.base'), children: displayedBaseline ?? (_jsx("span", { className: styles.dashboardHistorical, children: t('dashboard.historicalUnavailable') })) }), _jsx(DashboardFactRow, { label: t('dashboard.aheadBehind'), children: _jsx(WorktreeGitOverviewValue, { state: gitOverview, metric: "aheadBehind", t: t }) }), _jsx(DashboardFactRow, { label: t('dashboard.committedChanges'), children: _jsx(WorktreeGitOverviewValue, { state: gitOverview, metric: "committed", t: t }) }), _jsx(DashboardFactRow, { label: t('dashboard.workingTree'), children: _jsx(WorktreeGitOverviewValue, { state: gitOverview, metric: "workingTree", t: t }) })] }), tabLink('git', t('dashboard.viewDetails'))] }), _jsxs(Card, { title: t('dashboard.derived'), icon: _jsx(DashboardIcon, { kind: "children" }), action: placeholder, children: [_jsx("div", { className: styles.dashboardEmpty, children: _jsx("p", { children: t('dashboard.childrenHint') }) }), tabLink('children', t('dashboard.viewChildren'))] }), _jsx(Card, { title: t('dashboard.quickActions'), icon: _jsx(DashboardIcon, { kind: "actions" }), children: _jsxs("div", { className: styles.dashboardQuickActions, children: [['terminal', 'diff', 'pullRequest', 'tests', 'sync'].map((action) => (_jsx(PlaceholderButton, { t: t, children: t(`dashboard.action.${action}`) }, action))), _jsx("button", { type: "button", className: styles.dashboardButton, disabled: actionPending || !onArchiveWorktree, onClick: onArchiveWorktree, "data-dashboard-action": "archive-worktree", children: t('dashboard.action.archive') })] }) })] })] })) : tab === 'git' ? (_jsx(WorktreeGitPanel, { manager: manager, workspaceId: record.workspaceId, worktreeId: record.worktreeId, defaultBaselineBranch: displayedBaseline, currentBranch: baselineCurrentBranch, capturedBaseline: record.baseCommit !== undefined, onOpenFile: (filePath) => {
385
+ }, children: [_jsx(DashboardIcon, { kind: value }), tabLabel(value)] }, value))) }), _jsx("div", { id: `${id}-panel`, role: "tabpanel", "aria-labelledby": `${id}-${tab}`, tabIndex: 0, className: styles.dashboardPanel, children: tab === 'overview' ? (_jsxs("div", { className: styles.dashboardGrid, children: [_jsxs("div", { className: styles.dashboardColumn, children: [_jsxs("section", { className: styles.dashboardStart, children: [_jsxs("h2", { children: [_jsx(IconBranchOutline16, {}), t('dashboard.start')] }), _jsx("p", { children: t('dashboard.startDescription') }), _jsxs("div", { className: styles.dashboardStartActions, children: [_jsxs("button", { type: "button", disabled: actionPending || !onCreateWorktree, onClick: onCreateWorktree, "data-dashboard-action": "create-worktree", children: [_jsx(DashboardIcon, { kind: "git" }), _jsxs("span", { children: [_jsx("strong", { children: t('dashboard.newWorktree') }), _jsx("small", { children: t('dashboard.newWorktreeDescription') })] })] }), _jsxs("button", { type: "button", disabled: actionPending || !onCreateSession, onClick: onCreateSession, "data-dashboard-action": "create-session", children: [_jsx(DashboardIcon, { kind: "sessions" }), _jsxs("span", { children: [_jsx("strong", { children: t('dashboard.newSession') }), _jsx("small", { children: t('dashboard.newSessionDescription') })] })] })] })] }), _jsxs(Card, { title: t('dashboard.instructions'), icon: _jsx(DashboardIcon, { kind: "instructions" }), children: [_jsx("p", { children: t('dashboard.instructionsDescription') }), _jsx(WorktreeInstructions, { context: workspaceTitle + ' · ' + record.branch + ' · ' + record.absolutePath, value: record.instructions ?? '', onSave: onSaveInstructions, t: t, disabled: actionPending || record.health === 'recovery-needed' })] }), _jsxs(Card, { title: tabLabel('sessions'), icon: _jsx(DashboardIcon, { kind: "sessions" }), action: _jsx("span", { children: sessionIds.length }), children: [sessionList(sessionIds.slice(0, 5)), tabLink('sessions', t('dashboard.viewSessions'))] })] }), _jsxs("div", { className: styles.dashboardColumn, children: [_jsxs(Card, { title: t('dashboard.status'), icon: _jsx(DashboardIcon, { kind: "git" }), children: [_jsx("p", { children: t('dashboard.statusHint') }), _jsxs("dl", { className: styles.dashboardFacts, children: [_jsx(DashboardFactRow, { label: t('dashboard.health'), children: t(healthKey) }), _jsx(DashboardFactRow, { label: t('dashboard.branch'), children: liveBranch }), !isMain && _jsx(DashboardFactRow, { label: t('dashboard.base'), children: displayedBaseline?.replace(/^refs\/(heads|remotes)\//u, '') ?? (_jsx("span", { className: styles.dashboardHistorical, children: t('dashboard.historicalUnavailable') })) }), _jsx(DashboardFactRow, { label: t('dashboard.aheadBehind'), children: _jsx(WorktreeGitOverviewValue, { state: gitOverview, metric: "aheadBehind", t: t }) }), _jsx(DashboardFactRow, { label: t('dashboard.committedChanges'), children: _jsx(WorktreeGitOverviewValue, { state: gitOverview, metric: "committed", t: t }) }), _jsx(DashboardFactRow, { label: t('dashboard.workingTree'), children: _jsx(WorktreeGitOverviewValue, { state: gitOverview, metric: "workingTree", t: t }) })] }), tabLink('git', t('dashboard.viewDetails'))] }), _jsxs(Card, { title: t('dashboard.derived'), icon: _jsx(DashboardIcon, { kind: "children" }), action: placeholder, children: [_jsx("div", { className: styles.dashboardEmpty, children: _jsx("p", { children: t('dashboard.childrenHint') }) }), tabLink('children', t('dashboard.viewChildren'))] }), _jsx(Card, { title: t('dashboard.quickActions'), icon: _jsx(DashboardIcon, { kind: "actions" }), children: _jsxs("div", { className: styles.dashboardQuickActions, children: [['terminal', 'diff', 'pullRequest', 'tests', 'sync'].map((action) => (_jsx(PlaceholderButton, { t: t, children: t(`dashboard.action.${action}`) }, action))), _jsx("button", { type: "button", className: styles.dashboardButton, disabled: actionPending || !onArchiveWorktree, onClick: onArchiveWorktree, "data-dashboard-action": "archive-worktree", children: t('dashboard.action.archive') })] }) })] })] })) : tab === 'git' ? (_jsx(WorktreeGitPanel, { context: workspaceTitle + ' · ' + record.branch + ' · ' + record.absolutePath, manager: manager, workspaceId: record.workspaceId, worktreeId: record.worktreeId, defaultBaselineBranch: displayedBaseline, currentBranch: baselineCurrentBranch, capturedBaseline: record.baseCommit !== undefined, onOpenFile: onOpenFile === undefined ? undefined : (filePath) => {
366
386
  onOpenFile?.(filePath);
367
- setRightSidebarOpen(true);
368
- }, t: t })) : tab === 'sessions' ? (_jsx(Card, { title: tabLabel('sessions'), icon: _jsx(DashboardIcon, { kind: "sessions" }), action: _jsx("button", { type: "button", className: styles.dashboardButton, disabled: actionPending || !onCreateSession, onClick: onCreateSession, children: t('dashboard.newSession') }), children: sessionList(sessionIds) })) : (_jsxs("section", { className: styles.dashboardTabPlaceholder, children: [_jsx(DashboardIcon, { kind: tab }), _jsx("h2", { children: tabLabel(tab) }), _jsx("p", { children: t(`dashboard.hint.${tab}`) }), placeholder] })) }), _jsx("p", { className: styles.dashboardFooter, children: t('dashboard.mvpHint') })] })] }));
387
+ setRightSidebarOpen(isRightSidebarExpanded?.() ?? false);
388
+ }, t: t })) : tab === 'sessions' ? (_jsx(Card, { title: tabLabel('sessions'), icon: _jsx(DashboardIcon, { kind: "sessions" }), action: _jsx("button", { type: "button", className: styles.dashboardButton, disabled: actionPending || !onCreateSession, onClick: onCreateSession, children: t('dashboard.newSession') }), children: sessionList(sessionIds) })) : tab === 'settings' ? (_jsx(Card, { title: tabLabel('settings'), icon: _jsx(DashboardIcon, { kind: "settings" }), children: _jsx(ToolSettings, { manager: manager, scope: isMainWorktreeId(record.worktreeId)
389
+ ? { kind: 'local', workspaceId: record.workspaceId }
390
+ : { kind: 'worktree', workspaceId: record.workspaceId, worktreeId: record.worktreeId }, t: t }, JSON.stringify([record.workspaceId, record.worktreeId])) })) : (_jsxs("section", { className: styles.dashboardTabPlaceholder, children: [_jsx(DashboardIcon, { kind: tab }), _jsx("h2", { children: tabLabel(tab) }), _jsx("p", { children: t(`dashboard.hint.${tab}`) }), placeholder] })) }), _jsx("p", { className: styles.dashboardFooter, children: t('dashboard.mvpHint') })] })] }));
369
391
  }
370
392
  //# sourceMappingURL=WorktreeDashboard.js.map