@cerbur/clutch-dsh-worktree 0.1.3 → 0.1.5

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 (98) hide show
  1. package/README.md +261 -107
  2. package/README.zh.md +309 -0
  3. package/lib/client/WorktreeContext.d.ts.map +1 -1
  4. package/lib/client/WorktreeContext.js.map +1 -1
  5. package/lib/client/WorktreeHeroContext.d.ts.map +1 -1
  6. package/lib/client/WorktreeHeroContext.js +9 -4
  7. package/lib/client/WorktreeHeroContext.js.map +1 -1
  8. package/lib/client/WorktreeSurface.d.ts +2 -30
  9. package/lib/client/WorktreeSurface.d.ts.map +1 -1
  10. package/lib/client/WorktreeSurface.js +31 -320
  11. package/lib/client/WorktreeSurface.js.map +1 -1
  12. package/lib/client/locales.d.ts +4 -0
  13. package/lib/client/locales.d.ts.map +1 -1
  14. package/lib/client/locales.js +4 -0
  15. package/lib/client/locales.js.map +1 -1
  16. package/lib/client/worktree-context-store.d.ts.map +1 -1
  17. package/lib/client/worktree-context-store.js +51 -11
  18. package/lib/client/worktree-context-store.js.map +1 -1
  19. package/lib/client/worktree-error-copy.d.ts.map +1 -1
  20. package/lib/client/worktree-error-copy.js +2 -0
  21. package/lib/client/worktree-error-copy.js.map +1 -1
  22. package/lib/client/worktree-surface-dialogs.d.ts +7 -0
  23. package/lib/client/worktree-surface-dialogs.d.ts.map +1 -0
  24. package/lib/client/worktree-surface-dialogs.js +89 -0
  25. package/lib/client/worktree-surface-dialogs.js.map +1 -0
  26. package/lib/client/worktree-surface-rows.d.ts +9 -0
  27. package/lib/client/worktree-surface-rows.d.ts.map +1 -0
  28. package/lib/client/worktree-surface-rows.js +223 -0
  29. package/lib/client/worktree-surface-rows.js.map +1 -0
  30. package/lib/client/worktree-surface-selectors.d.ts +9 -0
  31. package/lib/client/worktree-surface-selectors.d.ts.map +1 -0
  32. package/lib/client/worktree-surface-selectors.js +28 -0
  33. package/lib/client/worktree-surface-selectors.js.map +1 -0
  34. package/lib/client/worktree-surface-types.d.ts +233 -0
  35. package/lib/client/worktree-surface-types.d.ts.map +1 -0
  36. package/lib/client/worktree-surface-types.js +2 -0
  37. package/lib/client/worktree-surface-types.js.map +1 -0
  38. package/lib/client/worktree-view-actions.d.ts +34 -0
  39. package/lib/client/worktree-view-actions.d.ts.map +1 -0
  40. package/lib/client/worktree-view-actions.js +69 -0
  41. package/lib/client/worktree-view-actions.js.map +1 -0
  42. package/lib/client/worktree-view-errors.d.ts +20 -0
  43. package/lib/client/worktree-view-errors.d.ts.map +1 -0
  44. package/lib/client/worktree-view-errors.js +65 -0
  45. package/lib/client/worktree-view-errors.js.map +1 -0
  46. package/lib/client/worktree-view-read.d.ts +51 -0
  47. package/lib/client/worktree-view-read.d.ts.map +1 -0
  48. package/lib/client/worktree-view-read.js +139 -0
  49. package/lib/client/worktree-view-read.js.map +1 -0
  50. package/lib/client/worktree-view.d.ts +4 -97
  51. package/lib/client/worktree-view.d.ts.map +1 -1
  52. package/lib/client/worktree-view.js +4 -263
  53. package/lib/client/worktree-view.js.map +1 -1
  54. package/lib/client.js +490 -361
  55. package/lib/client.js.map +1 -1
  56. package/lib/contract/index.d.ts +1 -1
  57. package/lib/contract/index.d.ts.map +1 -1
  58. package/lib/contract/index.js +1 -0
  59. package/lib/contract/index.js.map +1 -1
  60. package/lib/manage/manager-context.d.ts +11 -0
  61. package/lib/manage/manager-context.d.ts.map +1 -0
  62. package/lib/manage/manager-context.js +2 -0
  63. package/lib/manage/manager-context.js.map +1 -0
  64. package/lib/manage/manager-sessions.d.ts +18 -0
  65. package/lib/manage/manager-sessions.d.ts.map +1 -0
  66. package/lib/manage/manager-sessions.js +91 -0
  67. package/lib/manage/manager-sessions.js.map +1 -0
  68. package/lib/manage/manager-support.d.ts +18 -0
  69. package/lib/manage/manager-support.d.ts.map +1 -0
  70. package/lib/manage/manager-support.js +174 -0
  71. package/lib/manage/manager-support.js.map +1 -0
  72. package/lib/manage/manager-worktrees.d.ts +27 -0
  73. package/lib/manage/manager-worktrees.d.ts.map +1 -0
  74. package/lib/manage/manager-worktrees.js +259 -0
  75. package/lib/manage/manager-worktrees.js.map +1 -0
  76. package/lib/manage/manager.d.ts +23 -65
  77. package/lib/manage/manager.d.ts.map +1 -1
  78. package/lib/manage/manager.js +32 -565
  79. package/lib/manage/manager.js.map +1 -1
  80. package/lib/provider/git.d.ts +6 -0
  81. package/lib/provider/git.d.ts.map +1 -1
  82. package/lib/provider/git.js +34 -10
  83. package/lib/provider/git.js.map +1 -1
  84. package/lib/provider/sidecar-persistence.d.ts +18 -0
  85. package/lib/provider/sidecar-persistence.d.ts.map +1 -0
  86. package/lib/provider/sidecar-persistence.js +162 -0
  87. package/lib/provider/sidecar-persistence.js.map +1 -0
  88. package/lib/provider/sidecar-schema.d.ts +6 -0
  89. package/lib/provider/sidecar-schema.d.ts.map +1 -0
  90. package/lib/provider/sidecar-schema.js +123 -0
  91. package/lib/provider/sidecar-schema.js.map +1 -0
  92. package/lib/provider/sidecar.d.ts +10 -67
  93. package/lib/provider/sidecar.d.ts.map +1 -1
  94. package/lib/provider/sidecar.js +21 -346
  95. package/lib/provider/sidecar.js.map +1 -1
  96. package/lib/typert.host.js +7 -7
  97. package/lib/typert.remote-client.js +7 -7
  98. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -49,6 +49,7 @@ window.__ModuleLoader__.load({
49
49
  "worktree.baseBranch": "Worktree 基线分支",
50
50
  "worktree.noLocalBranch": "没有本地分支",
51
51
  "worktree.noBranches": "此工作区中没有找到本地分支。",
52
+ "worktree.setup.gitNotInstalled": "Git 未安装或不在 PATH 中。请先安装 Git,然后重启 DSH 再重试。",
52
53
  "worktree.setup.noRepository": "此 Workspace 不是 Git 仓库。请在 Workspace 目录执行以下命令:",
53
54
  "worktree.setup.noInitialCommit": "此 Git 仓库还没有首次 commit。请先执行以下命令:",
54
55
  "worktree.setup.noLocalBranch": "此 Git 仓库没有本地分支。请先创建一个本地分支:",
@@ -76,6 +77,7 @@ window.__ModuleLoader__.load({
76
77
  "action.openCreatedSession": "打开已创建的 Session",
77
78
  "status.loading": "正在加载工作区…",
78
79
  "error.worktreeDataUnavailable": "Worktree 数据不可用,请重试。",
80
+ "error.gitNotInstalled": "Git 未安装或不可用,请安装 Git 后重试。",
79
81
  "error.connectionDisposed": "Worktree 连接已释放,请重新加载插件后重试。",
80
82
  "error.connectionFailed": "Worktree endpoint {endpoint} 调用失败;连接错误,可重试:{reason}",
81
83
  "error.invalidResult": "Worktree endpoint {endpoint} 返回了无效结果,请重试请求。",
@@ -137,6 +139,7 @@ window.__ModuleLoader__.load({
137
139
  "worktree.baseBranch": "Worktree base branch",
138
140
  "worktree.noLocalBranch": "No local branch",
139
141
  "worktree.noBranches": "No local branches found in this Workspace.",
142
+ "worktree.setup.gitNotInstalled": "Git is not installed or is not available on PATH. Install Git, restart DSH, and retry.",
140
143
  "worktree.setup.noRepository": "This Workspace is not a Git repository. Run these commands in the Workspace directory:",
141
144
  "worktree.setup.noInitialCommit": "This Git repository has no initial commit. Run these commands first:",
142
145
  "worktree.setup.noLocalBranch": "This Git repository has no local branch. Create one first:",
@@ -164,6 +167,7 @@ window.__ModuleLoader__.load({
164
167
  "action.openCreatedSession": "Open Created Session",
165
168
  "status.loading": "Loading Workspaces…",
166
169
  "error.worktreeDataUnavailable": "Worktree data is unavailable. Retry the request.",
170
+ "error.gitNotInstalled": "Git is not installed or unavailable. Install Git and retry.",
167
171
  "error.connectionDisposed": "Worktree connection is disposed; reload the plugin and retry.",
168
172
  "error.connectionFailed": "Worktree endpoint {endpoint} failed; retryable connection error: {reason}",
169
173
  "error.invalidResult": "Worktree endpoint {endpoint} returned an invalid result; retry the request.",
@@ -320,8 +324,8 @@ window.__ModuleLoader__.load({
320
324
  };
321
325
  }
322
326
  //#endregion
323
- //#region \0clutch-dsh-worktree-css:/Users/yuancheng/Documents/Code/clutch-dsh/packages/clutch-dsh-worktree/src/client/worktree-context.css.mjs
324
- const css$1 = ".-cerbur-clutch-dsh-worktree-headerContext {\n display: inline-flex;\n min-width: 0;\n height: 22px;\n align-items: center;\n gap: 4px;\n max-width: 180px;\n overflow: hidden;\n border-radius: 6px;\n padding: 0 2px 0 0;\n background: var(--dsw-alias-fill-tsp-secondary);\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 22px;\n white-space: nowrap;\n}\n\n.-cerbur-clutch-dsh-worktree-contextIcon {\n flex: none;\n opacity: 0.7;\n}\n\n.-cerbur-clutch-dsh-worktree-contextLabel {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.-cerbur-clutch-dsh-worktree-heroContext {\n position: absolute;\n z-index: 1;\n display: inline-flex;\n box-sizing: border-box;\n max-width: 260px;\n min-height: 22px;\n align-items: center;\n overflow: hidden;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 999px;\n padding: 0 8px;\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 20px;\n pointer-events: none;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n";
327
+ //#region \0clutch-dsh-worktree-css:/private/tmp/clutch-dsh-wt-worktree-0.1.5-release/packages/clutch-dsh-worktree/src/client/worktree-context.css.mjs
328
+ const css$1 = ".-cerbur-clutch-dsh-worktree-headerContext {\n display: inline-flex;\n min-width: 0;\n height: 22px;\n align-items: center;\n gap: 4px;\n max-width: 180px;\n overflow: hidden;\n border-radius: 6px;\n padding: 0 2px 0 0;\n background: var(--dsw-alias-fill-tsp-secondary);\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 22px;\n white-space: nowrap;\n}\n\n.-cerbur-clutch-dsh-worktree-contextIcon {\n flex: none;\n opacity: 0.7;\n}\n\n.-cerbur-clutch-dsh-worktree-contextLabel {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.-cerbur-clutch-dsh-worktree-contextHoverTitle {\n max-width: 360px;\n color: var(--dsw-static-neutral-bluish-00);\n font-size: 14px;\n line-height: 20px;\n overflow-wrap: anywhere;\n white-space: normal;\n}\n\n.-cerbur-clutch-dsh-worktree-heroContextHost {\n position: absolute;\n z-index: 1;\n display: block;\n width: max-content;\n max-width: 260px;\n min-height: 22px;\n}\n\n.-cerbur-clutch-dsh-worktree-heroContext {\n display: inline-flex;\n box-sizing: border-box;\n max-width: 260px;\n min-height: 22px;\n align-items: center;\n overflow: hidden;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 999px;\n padding: 0 8px;\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 20px;\n pointer-events: auto;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n";
325
329
  const styleId$1 = "@cerbur/clutch-dsh-worktree/worktree-context.css";
326
330
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"@cerbur/clutch-dsh-worktree/worktree-context.css\"]") === null) {
327
331
  const tag = document.createElement("style");
@@ -334,6 +338,8 @@ window.__ModuleLoader__.load({
334
338
  "headerContext": "-cerbur-clutch-dsh-worktree-headerContext",
335
339
  "contextIcon": "-cerbur-clutch-dsh-worktree-contextIcon",
336
340
  "contextLabel": "-cerbur-clutch-dsh-worktree-contextLabel",
341
+ "contextHoverTitle": "-cerbur-clutch-dsh-worktree-contextHoverTitle",
342
+ "heroContextHost": "-cerbur-clutch-dsh-worktree-heroContextHost",
337
343
  "heroContext": "-cerbur-clutch-dsh-worktree-heroContext"
338
344
  };
339
345
  //#endregion
@@ -365,8 +371,8 @@ window.__ModuleLoader__.load({
365
371
  });
366
372
  }
367
373
  //#endregion
368
- //#region \0clutch-dsh-worktree-css:/Users/yuancheng/Documents/Code/clutch-dsh/packages/clutch-dsh-worktree/src/client/worktree.css.mjs
369
- const css = ".-cerbur-clutch-dsh-worktree-action {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: 8px;\n width: calc(100% + 4px);\n height: 42px;\n margin: 4px -2px;\n box-sizing: border-box;\n border: 0;\n border-radius: 12px;\n padding: 0 10px 0 8px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n cursor: pointer;\n font: inherit;\n font-size: 14px;\n line-height: 22px;\n text-align: left;\n overflow: hidden;\n}\n\n.-cerbur-clutch-dsh-worktree-action:hover,\n.-cerbur-clutch-dsh-worktree-action[data-active='true'] {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.-cerbur-clutch-dsh-worktree-action[data-collapsed='true'] {\n width: 36px;\n height: 36px;\n margin: 8px 0 10px;\n justify-content: center;\n gap: 0;\n padding: 0;\n border-radius: 50%;\n}\n\n.-cerbur-clutch-dsh-worktree-actionLabel {\n overflow: hidden;\n white-space: nowrap;\n}\n\n.-cerbur-clutch-dsh-worktree-surface {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n min-width: 56px;\n overflow: hidden;\n border-right: 1px solid var(--dsw-alias-border-l1);\n background: var(--dsw-specific-sidebar-fill);\n color: var(--dsw-alias-label-primary);\n pointer-events: auto;\n transition: width var(--ds-transition-duration-slow) var(--ds-ease-in-out);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .-cerbur-clutch-dsh-worktree-surface {\n transition: none;\n }\n}\n\n.-cerbur-clutch-dsh-worktree-wideContent {\n display: flex;\n min-width: 0;\n min-height: 0;\n flex: 1;\n flex-direction: column;\n}\n\n.-cerbur-clutch-dsh-worktree-surface[data-collapsed='true'] .-cerbur-clutch-dsh-worktree-wideContent {\n display: none;\n}\n\n.-cerbur-clutch-dsh-worktree-railContent {\n display: none;\n}\n\n.-cerbur-clutch-dsh-worktree-surface[data-collapsed='true'] .-cerbur-clutch-dsh-worktree-railContent {\n display: flex;\n flex: 1;\n align-items: flex-start;\n justify-content: center;\n padding-top: 12px;\n}\n\n.-cerbur-clutch-dsh-worktree-railButton,\n.-cerbur-clutch-dsh-worktree-closeButton {\n border: 0;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n cursor: pointer;\n font: inherit;\n}\n\n.-cerbur-clutch-dsh-worktree-railButton {\n width: 36px;\n height: 36px;\n color: var(--dsw-alias-label-secondary);\n font-size: 11px;\n font-weight: 600;\n}\n\n.-cerbur-clutch-dsh-worktree-railButton:hover,\n.-cerbur-clutch-dsh-worktree-closeButton:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.-cerbur-clutch-dsh-worktree-header {\n display: flex;\n align-items: center;\n gap: 8px;\n flex: none;\n min-height: 44px;\n padding: 6px 10px;\n box-sizing: border-box;\n border-bottom: 1px solid var(--dsw-alias-border-l1);\n}\n\n.-cerbur-clutch-dsh-worktree-title {\n min-width: 0;\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 14px;\n font-weight: 600;\n}\n\n.-cerbur-clutch-dsh-worktree-closeButton {\n flex: none;\n width: 28px;\n height: 28px;\n font-size: 18px;\n line-height: 1;\n}\n\n.-cerbur-clutch-dsh-worktree-modeButton[data-active='true'] {\n color: var(--dsw-alias-label-primary);\n}\n\n.-cerbur-clutch-dsh-worktree-workspacePicker {\n display: block;\n width: calc(100% - 20px);\n margin: 6px 10px 8px;\n padding: 6px 8px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 7px;\n background: var(--dsw-alias-button-elevated-fill);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 12px;\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceLabel {\n display: block;\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n}\n\n.-cerbur-clutch-dsh-worktree-content {\n min-height: 0;\n flex: 1;\n overflow: auto;\n padding: 0 10px 12px;\n}\n\n.-cerbur-clutch-dsh-worktree-content:focus-visible {\n outline: 2px solid var(--dsw-alias-border-l3);\n outline-offset: -2px;\n}\n\n.-cerbur-clutch-dsh-worktree-error {\n margin: 12px 0 0;\n padding: 8px;\n border: 1px solid var(--dsw-alias-state-error-primary);\n border-radius: 7px;\n}\n\n.-cerbur-clutch-dsh-worktree-retryButton,\n.-cerbur-clutch-dsh-worktree-actionButton {\n border: 0;\n border-radius: 6px;\n background: var(--dsw-alias-button-elevated-fill);\n color: var(--dsw-alias-label-primary);\n cursor: pointer;\n font: inherit;\n font-size: 11px;\n}\n\n.-cerbur-clutch-dsh-worktree-retryButton,\n.-cerbur-clutch-dsh-worktree-actionButton {\n width: 100%;\n padding: 6px 8px;\n}\n\n.-cerbur-clutch-dsh-worktree-recoveryActions {\n display: grid;\n gap: 6px;\n margin-top: 6px;\n}\n\n.-cerbur-clutch-dsh-worktree-retryButton:disabled,\n.-cerbur-clutch-dsh-worktree-actionButton:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n.-cerbur-clutch-dsh-worktree-actions {\n display: grid;\n gap: 6px;\n margin-top: 10px;\n padding: 8px;\n border: 1px solid var(--dsw-alias-border-l1);\n border-radius: 7px;\n}\n\n.-cerbur-clutch-dsh-worktree-actionLabel {\n display: grid;\n gap: 3px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n}\n\n.-cerbur-clutch-dsh-worktree-actionSelect {\n min-width: 0;\n padding: 5px 6px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 6px;\n background: var(--dsw-alias-button-elevated-fill);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 11px;\n}\n\n.-cerbur-clutch-dsh-worktree-section {\n margin: 12px 0 0;\n}\n\n.-cerbur-clutch-dsh-worktree-sectionTitle {\n margin: 0 2px 4px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0.02em;\n text-transform: uppercase;\n}\n\n.-cerbur-clutch-dsh-worktree-empty,\n.-cerbur-clutch-dsh-worktree-message {\n margin: 0;\n padding: 8px 4px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.-cerbur-clutch-dsh-worktree-gitReadiness {\n display: grid;\n gap: 4px;\n}\n\n.-cerbur-clutch-dsh-worktree-commandBlock {\n margin: 6px 0 0;\n padding: 8px;\n overflow-x: auto;\n border-radius: 6px;\n background: var(--dsw-alias-button-elevated-fill);\n color: var(--dsw-alias-label-secondary);\n font: 11px/16px ui-monospace, SFMono-Regular, Menlo, monospace;\n white-space: pre-wrap;\n}\n\n.-cerbur-clutch-dsh-worktree-message[data-error='true'] {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.-cerbur-clutch-dsh-worktree-worktree,\n.-cerbur-clutch-dsh-worktree-session {\n display: flex;\n align-items: center;\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n border: 0;\n border-radius: 7px;\n padding: 6px 8px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 12px;\n text-align: left;\n}\n\n.-cerbur-clutch-dsh-worktree-worktree {\n cursor: default;\n}\n\n.-cerbur-clutch-dsh-worktree-session {\n cursor: pointer;\n}\n\n.-cerbur-clutch-dsh-worktree-worktree:hover,\n.-cerbur-clutch-dsh-worktree-session:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeLabel,\n.-cerbur-clutch-dsh-worktree-sessionLabel {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.-cerbur-clutch-dsh-worktree-status {\n flex: none;\n margin-left: auto;\n padding-left: 8px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n}\n\n.-cerbur-clutch-dsh-worktree-searchRow {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 8px 10px 6px;\n}\n\n.-cerbur-clutch-dsh-worktree-searchIcon {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n color: var(--dsw-alias-label-secondary);\n}\n\n.-cerbur-clutch-dsh-worktree-searchInput {\n min-width: 0;\n box-sizing: border-box;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 7px;\n background: var(--dsw-alias-button-elevated-fill);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n outline: none;\n}\n\n.-cerbur-clutch-dsh-worktree-searchInput {\n width: 100%;\n padding: 6px 8px;\n font-size: 13px;\n line-height: 18px;\n}\n\n.-cerbur-clutch-dsh-worktree-searchInput:focus,\n.-cerbur-clutch-dsh-worktree-actionSelect:focus {\n border-color: #3b82f6;\n}\n\n.-cerbur-clutch-dsh-worktree-iconButton {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: 0;\n border-radius: 7px;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n font: inherit;\n font-size: 20px;\n line-height: 1;\n}\n\n.-cerbur-clutch-dsh-worktree-iconButton:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-primary);\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceList {\n min-width: 0;\n min-height: 0;\n display: grid;\n gap: 4px;\n overflow-x: hidden;\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceGroup {\n min-width: 0;\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceRow,\n.-cerbur-clutch-dsh-worktree-worktreeRow {\n position: relative;\n display: flex;\n align-items: center;\n min-width: 0;\n min-height: 36px;\n box-sizing: border-box;\n border-radius: 8px;\n padding: 3px 4px;\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceRow:hover,\n.-cerbur-clutch-dsh-worktree-worktreeRow:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceRow .-cerbur-clutch-dsh-worktree-workspaceDisclosure {\n display: none;\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceRow:hover .-cerbur-clutch-dsh-worktree-workspaceDisclosure,\n.-cerbur-clutch-dsh-worktree-workspaceRow[data-menu-open='true'] .-cerbur-clutch-dsh-worktree-workspaceDisclosure {\n display: inline-flex;\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceRow:hover .-cerbur-clutch-dsh-worktree-workspaceIcon,\n.-cerbur-clutch-dsh-worktree-workspaceRow[data-menu-open='true'] .-cerbur-clutch-dsh-worktree-workspaceIcon {\n display: none;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeRow .-cerbur-clutch-dsh-worktree-worktreeDisclosure {\n display: none;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeRow:hover .-cerbur-clutch-dsh-worktree-worktreeDisclosure,\n.-cerbur-clutch-dsh-worktree-worktreeRow[data-menu-open='true'] .-cerbur-clutch-dsh-worktree-worktreeDisclosure {\n display: inline-flex;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeRow:hover .-cerbur-clutch-dsh-worktree-worktreeIcon,\n.-cerbur-clutch-dsh-worktree-worktreeRow[data-menu-open='true'] .-cerbur-clutch-dsh-worktree-worktreeIcon {\n display: none;\n}\n\n.-cerbur-clutch-dsh-worktree-disclosureButton {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 28px;\n border: 0;\n border-radius: 6px;\n padding: 0;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n font: inherit;\n font-size: 17px;\n line-height: 1;\n}\n\n.-cerbur-clutch-dsh-worktree-disclosureButton > svg {\n display: block;\n}\n\n.-cerbur-clutch-dsh-worktree-disclosureButton:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceIcon,\n.-cerbur-clutch-dsh-worktree-worktreeIcon {\n flex: none;\n width: 24px;\n color: var(--dsw-alias-label-secondary);\n font-size: 20px;\n line-height: 1;\n text-align: center;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeState {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n width: 12px;\n margin-right: 0;\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceIcon {\n color: var(--dsw-alias-brand-primary);\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceTitle,\n.-cerbur-clutch-dsh-worktree-worktreeLabel {\n min-width: 0;\n overflow: hidden;\n flex: 1;\n padding: 0 6px;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeRow[data-main-group='true'] .-cerbur-clutch-dsh-worktree-worktreeLabel {\n font-weight: 600;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeHoverTitle {\n color: var(--dsw-static-neutral-bluish-00);\n font-size: 14px;\n line-height: 20px;\n overflow-wrap: anywhere;\n}\n\n.-cerbur-clutch-dsh-worktree-treeActionSlot,\n.-cerbur-clutch-dsh-worktree-workspaceActions {\n position: relative;\n display: inline-flex;\n flex: 0 0 64px;\n align-items: center;\n justify-content: flex-end;\n width: 64px;\n height: 28px;\n margin-left: auto;\n}\n\n.-cerbur-clutch-dsh-worktree-treeActionSlot > .-cerbur-clutch-dsh-worktree-menuAction {\n position: absolute;\n top: 0;\n right: 32px;\n}\n\n.-cerbur-clutch-dsh-worktree-treeActionSlot > .-cerbur-clutch-dsh-worktree-iconButton:last-child {\n position: absolute;\n top: 0;\n right: 0;\n}\n\n.-cerbur-clutch-dsh-worktree-menuAction {\n display: inline-flex;\n width: 28px;\n height: 28px;\n visibility: hidden;\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceRow:hover .-cerbur-clutch-dsh-worktree-menuAction,\n.-cerbur-clutch-dsh-worktree-workspaceRow[data-menu-open='true'] .-cerbur-clutch-dsh-worktree-menuAction,\n.-cerbur-clutch-dsh-worktree-worktreeRow:hover .-cerbur-clutch-dsh-worktree-menuAction,\n.-cerbur-clutch-dsh-worktree-worktreeRow[data-menu-open='true'] .-cerbur-clutch-dsh-worktree-menuAction {\n visibility: visible;\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceRow.-cerbur-clutch-dsh-worktree-dropBefore::before,\n.-cerbur-clutch-dsh-worktree-workspaceRow.-cerbur-clutch-dsh-worktree-dropAfter::after {\n position: absolute;\n right: 4px;\n left: 4px;\n height: 2px;\n border-radius: 2px;\n background: var(--dsw-alias-brand-primary);\n content: '';\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceRow.-cerbur-clutch-dsh-worktree-dropBefore::before {\n top: -1px;\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceRow.-cerbur-clutch-dsh-worktree-dropAfter::after {\n bottom: -1px;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeRow.-cerbur-clutch-dsh-worktree-dropBefore::before,\n.-cerbur-clutch-dsh-worktree-worktreeRow.-cerbur-clutch-dsh-worktree-dropAfter::after {\n position: absolute;\n right: 4px;\n left: 4px;\n height: 2px;\n border-radius: 2px;\n background: var(--dsw-alias-brand-primary);\n content: '';\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeRow.-cerbur-clutch-dsh-worktree-dropBefore::before {\n top: -1px;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeRow.-cerbur-clutch-dsh-worktree-dropAfter::after {\n bottom: -1px;\n}\n\n.-cerbur-clutch-dsh-worktree-treeChildren {\n margin-left: 24px;\n padding: 2px 0 5px 12px;\n border-left: 1px solid var(--dsw-alias-border-l1);\n}\n\n.-cerbur-clutch-dsh-worktree-groupLabel {\n padding: 6px 8px 3px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 10px;\n font-weight: 600;\n letter-spacing: 0.05em;\n text-transform: uppercase;\n}\n\n.-cerbur-clutch-dsh-worktree-groupHeader {\n display: flex;\n align-items: center;\n min-height: 34px;\n padding-right: 4px;\n}\n\n.-cerbur-clutch-dsh-worktree-groupHeader .-cerbur-clutch-dsh-worktree-groupLabel {\n flex: 1;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeGroup {\n margin-top: 2px;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeRow {\n min-height: 34px;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeRow .-cerbur-clutch-dsh-worktree-worktreeIcon,\n.-cerbur-clutch-dsh-worktree-worktreeRow .-cerbur-clutch-dsh-worktree-disclosureButton {\n width: 22px;\n}\n\n.-cerbur-clutch-dsh-worktree-treeSessionRow {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n min-width: 0;\n min-height: 31px;\n box-sizing: border-box;\n border-radius: 7px;\n}\n\n.-cerbur-clutch-dsh-worktree-treeSessionRow:hover,\n.-cerbur-clutch-dsh-worktree-treeSessionRow[data-menu-open='true'] {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.-cerbur-clutch-dsh-worktree-treeSessionRow.-cerbur-clutch-dsh-worktree-dropBefore::before,\n.-cerbur-clutch-dsh-worktree-treeSessionRow.-cerbur-clutch-dsh-worktree-dropAfter::after {\n position: absolute;\n right: 4px;\n left: 4px;\n height: 2px;\n border-radius: 2px;\n background: var(--dsw-alias-brand-primary);\n content: '';\n}\n\n.-cerbur-clutch-dsh-worktree-treeSessionRow.-cerbur-clutch-dsh-worktree-dropBefore::before {\n top: -1px;\n}\n\n.-cerbur-clutch-dsh-worktree-treeSessionRow.-cerbur-clutch-dsh-worktree-dropAfter::after {\n bottom: -1px;\n}\n\n.-cerbur-clutch-dsh-worktree-treeSessionContent {\n display: flex;\n align-items: center;\n flex: 1;\n width: 0;\n min-width: 0;\n min-height: 31px;\n box-sizing: border-box;\n border: 0;\n border-radius: 7px;\n padding: 4px 4px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n cursor: pointer;\n font: inherit;\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n text-align: left;\n}\n\n.-cerbur-clutch-dsh-worktree-treeSessionContent:hover {\n background: transparent;\n}\n\n.-cerbur-clutch-dsh-worktree-rowActions {\n display: none;\n flex: none;\n align-items: center;\n gap: 4px;\n}\n\n.-cerbur-clutch-dsh-worktree-sessionOverflowButton {\n display: block;\n width: calc(100% - 24px);\n margin: 2px 0 4px 24px;\n padding: 4px 8px;\n border: 0;\n border-radius: 6px;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n font: inherit;\n font-size: 12px;\n font-weight: 400;\n line-height: 20px;\n text-align: left;\n}\n\n.-cerbur-clutch-dsh-worktree-sessionOverflowButton:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-primary);\n}\n\n.-cerbur-clutch-dsh-worktree-treeSessionRow:hover .-cerbur-clutch-dsh-worktree-rowActions,\n.-cerbur-clutch-dsh-worktree-treeSessionRow[data-menu-open='true'] .-cerbur-clutch-dsh-worktree-rowActions {\n display: inline-flex;\n}\n\n.-cerbur-clutch-dsh-worktree-renameInput {\n width: 100%;\n}\n\n.-cerbur-clutch-dsh-worktree-renameError {\n margin: 8px 0 0;\n color: var(--dsw-alias-state-error-primary);\n font-size: 13px;\n line-height: 20px;\n}\n\n.-cerbur-clutch-dsh-worktree-treeGuide {\n flex: none;\n width: 20px;\n color: var(--dsw-alias-label-tertiary);\n text-align: center;\n}\n\n.-cerbur-clutch-dsh-worktree-emptyNested {\n margin: 0;\n padding: 4px 8px 5px 28px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n}\n\n.-cerbur-clutch-dsh-worktree-modalField {\n display: grid;\n gap: 5px;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n}\n";
374
+ //#region \0clutch-dsh-worktree-css:/private/tmp/clutch-dsh-wt-worktree-0.1.5-release/packages/clutch-dsh-worktree/src/client/worktree.css.mjs
375
+ const css = ".-cerbur-clutch-dsh-worktree-action {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: 8px;\n width: calc(100% + 4px);\n height: 42px;\n margin: 4px -2px;\n box-sizing: border-box;\n border: 0;\n border-radius: 12px;\n padding: 0 10px 0 8px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n cursor: pointer;\n font: inherit;\n font-size: 14px;\n line-height: 22px;\n text-align: left;\n overflow: hidden;\n}\n\n.-cerbur-clutch-dsh-worktree-action:hover,\n.-cerbur-clutch-dsh-worktree-action[data-active='true'] {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.-cerbur-clutch-dsh-worktree-action[data-collapsed='true'] {\n width: 36px;\n height: 36px;\n margin: 8px 0 10px;\n justify-content: center;\n gap: 0;\n padding: 0;\n border-radius: 50%;\n}\n\n.-cerbur-clutch-dsh-worktree-actionLabel {\n display: inline-flex;\n min-width: 0;\n align-items: center;\n height: 22px;\n overflow: hidden;\n font-weight: 400;\n line-height: 22px;\n white-space: nowrap;\n}\n\n.-cerbur-clutch-dsh-worktree-surface {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n min-width: 56px;\n overflow: hidden;\n border-right: 1px solid var(--dsw-alias-border-l1);\n background: var(--dsw-specific-sidebar-fill);\n color: var(--dsw-alias-label-primary);\n pointer-events: auto;\n transition: width var(--ds-transition-duration-slow) var(--ds-ease-in-out);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .-cerbur-clutch-dsh-worktree-surface {\n transition: none;\n }\n}\n\n.-cerbur-clutch-dsh-worktree-wideContent {\n display: flex;\n min-width: 0;\n min-height: 0;\n flex: 1;\n flex-direction: column;\n}\n\n.-cerbur-clutch-dsh-worktree-surface[data-collapsed='true'] .-cerbur-clutch-dsh-worktree-wideContent {\n display: none;\n}\n\n.-cerbur-clutch-dsh-worktree-closeButton {\n border: 0;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n cursor: pointer;\n font: inherit;\n}\n\n.-cerbur-clutch-dsh-worktree-closeButton:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.-cerbur-clutch-dsh-worktree-header {\n display: flex;\n align-items: center;\n gap: 8px;\n flex: none;\n min-height: 44px;\n padding: 6px 10px;\n box-sizing: border-box;\n border-bottom: 1px solid var(--dsw-alias-border-l1);\n}\n\n.-cerbur-clutch-dsh-worktree-title {\n min-width: 0;\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 14px;\n font-weight: 600;\n}\n\n.-cerbur-clutch-dsh-worktree-closeButton {\n flex: none;\n width: 28px;\n height: 28px;\n font-size: 18px;\n line-height: 1;\n}\n\n.-cerbur-clutch-dsh-worktree-modeButton[data-active='true'] {\n color: var(--dsw-alias-label-primary);\n}\n\n.-cerbur-clutch-dsh-worktree-workspacePicker {\n display: block;\n width: calc(100% - 20px);\n margin: 6px 10px 8px;\n padding: 6px 8px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 7px;\n background: var(--dsw-alias-button-elevated-fill);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 12px;\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceLabel {\n display: block;\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n}\n\n.-cerbur-clutch-dsh-worktree-content {\n min-height: 0;\n flex: 1;\n overflow: auto;\n padding: 0 10px 12px;\n}\n\n.-cerbur-clutch-dsh-worktree-content:focus-visible {\n outline: 2px solid var(--dsw-alias-border-l3);\n outline-offset: -2px;\n}\n\n.-cerbur-clutch-dsh-worktree-error {\n margin: 12px 0 0;\n padding: 8px;\n border: 1px solid var(--dsw-alias-state-error-primary);\n border-radius: 7px;\n}\n\n.-cerbur-clutch-dsh-worktree-retryButton,\n.-cerbur-clutch-dsh-worktree-actionButton {\n border: 0;\n border-radius: 6px;\n background: var(--dsw-alias-button-elevated-fill);\n color: var(--dsw-alias-label-primary);\n cursor: pointer;\n font: inherit;\n font-size: 11px;\n}\n\n.-cerbur-clutch-dsh-worktree-retryButton,\n.-cerbur-clutch-dsh-worktree-actionButton {\n width: 100%;\n padding: 6px 8px;\n}\n\n.-cerbur-clutch-dsh-worktree-recoveryActions {\n display: grid;\n gap: 6px;\n margin-top: 6px;\n}\n\n.-cerbur-clutch-dsh-worktree-retryButton:disabled,\n.-cerbur-clutch-dsh-worktree-actionButton:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n.-cerbur-clutch-dsh-worktree-actions {\n display: grid;\n gap: 6px;\n margin-top: 10px;\n padding: 8px;\n border: 1px solid var(--dsw-alias-border-l1);\n border-radius: 7px;\n}\n\n.-cerbur-clutch-dsh-worktree-actionSelect {\n min-width: 0;\n padding: 5px 6px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 6px;\n background: var(--dsw-alias-button-elevated-fill);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 11px;\n}\n\n.-cerbur-clutch-dsh-worktree-section {\n margin: 12px 0 0;\n}\n\n.-cerbur-clutch-dsh-worktree-sectionTitle {\n margin: 0 2px 4px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0.02em;\n text-transform: uppercase;\n}\n\n.-cerbur-clutch-dsh-worktree-empty,\n.-cerbur-clutch-dsh-worktree-message {\n margin: 0;\n padding: 8px 4px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.-cerbur-clutch-dsh-worktree-gitReadiness {\n display: grid;\n gap: 4px;\n}\n\n.-cerbur-clutch-dsh-worktree-commandBlock {\n margin: 6px 0 0;\n padding: 8px;\n overflow-x: auto;\n border-radius: 6px;\n background: var(--dsw-alias-button-elevated-fill);\n color: var(--dsw-alias-label-secondary);\n font: 11px/16px ui-monospace, SFMono-Regular, Menlo, monospace;\n white-space: pre-wrap;\n}\n\n.-cerbur-clutch-dsh-worktree-message[data-error='true'] {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.-cerbur-clutch-dsh-worktree-worktree,\n.-cerbur-clutch-dsh-worktree-session {\n display: flex;\n align-items: center;\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n border: 0;\n border-radius: 7px;\n padding: 6px 8px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 12px;\n text-align: left;\n}\n\n.-cerbur-clutch-dsh-worktree-worktree {\n cursor: default;\n}\n\n.-cerbur-clutch-dsh-worktree-session {\n cursor: pointer;\n}\n\n.-cerbur-clutch-dsh-worktree-worktree:hover,\n.-cerbur-clutch-dsh-worktree-session:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeLabel,\n.-cerbur-clutch-dsh-worktree-sessionLabel {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.-cerbur-clutch-dsh-worktree-status {\n flex: none;\n margin-left: auto;\n padding-left: 8px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n}\n\n.-cerbur-clutch-dsh-worktree-searchRow {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 8px 10px 6px;\n}\n\n.-cerbur-clutch-dsh-worktree-searchIcon {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n color: var(--dsw-alias-label-secondary);\n}\n\n.-cerbur-clutch-dsh-worktree-searchInput {\n min-width: 0;\n box-sizing: border-box;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 7px;\n background: var(--dsw-alias-button-elevated-fill);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n outline: none;\n}\n\n.-cerbur-clutch-dsh-worktree-searchInput {\n width: 100%;\n padding: 6px 8px;\n font-size: 13px;\n line-height: 18px;\n}\n\n.-cerbur-clutch-dsh-worktree-searchInput:focus,\n.-cerbur-clutch-dsh-worktree-actionSelect:focus {\n border-color: #3b82f6;\n}\n\n.-cerbur-clutch-dsh-worktree-iconButton {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: 0;\n border-radius: 7px;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n font: inherit;\n font-size: 20px;\n line-height: 1;\n}\n\n.-cerbur-clutch-dsh-worktree-iconButton:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-primary);\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceList {\n min-width: 0;\n min-height: 0;\n display: grid;\n gap: 4px;\n overflow-x: hidden;\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceGroup {\n min-width: 0;\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceRow,\n.-cerbur-clutch-dsh-worktree-worktreeRow {\n position: relative;\n display: flex;\n align-items: center;\n min-width: 0;\n min-height: 36px;\n box-sizing: border-box;\n border-radius: 8px;\n padding: 3px 4px;\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceRow:hover,\n.-cerbur-clutch-dsh-worktree-worktreeRow:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceRow .-cerbur-clutch-dsh-worktree-workspaceDisclosure {\n display: none;\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceRow:hover .-cerbur-clutch-dsh-worktree-workspaceDisclosure,\n.-cerbur-clutch-dsh-worktree-workspaceRow[data-menu-open='true'] .-cerbur-clutch-dsh-worktree-workspaceDisclosure {\n display: inline-flex;\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceRow:hover .-cerbur-clutch-dsh-worktree-workspaceIcon,\n.-cerbur-clutch-dsh-worktree-workspaceRow[data-menu-open='true'] .-cerbur-clutch-dsh-worktree-workspaceIcon {\n display: none;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeRow .-cerbur-clutch-dsh-worktree-worktreeDisclosure {\n display: none;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeRow:hover .-cerbur-clutch-dsh-worktree-worktreeDisclosure,\n.-cerbur-clutch-dsh-worktree-worktreeRow[data-menu-open='true'] .-cerbur-clutch-dsh-worktree-worktreeDisclosure {\n display: inline-flex;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeRow:hover .-cerbur-clutch-dsh-worktree-worktreeIcon,\n.-cerbur-clutch-dsh-worktree-worktreeRow[data-menu-open='true'] .-cerbur-clutch-dsh-worktree-worktreeIcon {\n display: none;\n}\n\n.-cerbur-clutch-dsh-worktree-disclosureButton {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 28px;\n border: 0;\n border-radius: 6px;\n padding: 0;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n font: inherit;\n font-size: 17px;\n line-height: 1;\n}\n\n.-cerbur-clutch-dsh-worktree-disclosureButton > svg {\n display: block;\n}\n\n.-cerbur-clutch-dsh-worktree-disclosureButton:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceIcon,\n.-cerbur-clutch-dsh-worktree-worktreeIcon {\n flex: none;\n width: 24px;\n color: var(--dsw-alias-label-secondary);\n font-size: 20px;\n line-height: 1;\n text-align: center;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeState {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n width: 12px;\n margin-right: 0;\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceIcon {\n color: var(--dsw-alias-brand-primary);\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceTitle,\n.-cerbur-clutch-dsh-worktree-worktreeLabel {\n min-width: 0;\n overflow: hidden;\n flex: 1;\n padding: 0 6px;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeRow[data-main-group='true'] .-cerbur-clutch-dsh-worktree-worktreeLabel {\n font-weight: 600;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeHoverTitle {\n color: var(--dsw-static-neutral-bluish-00);\n font-size: 14px;\n line-height: 20px;\n overflow-wrap: anywhere;\n}\n\n.-cerbur-clutch-dsh-worktree-treeActionSlot,\n.-cerbur-clutch-dsh-worktree-workspaceActions {\n position: relative;\n display: inline-flex;\n flex: 0 0 64px;\n align-items: center;\n justify-content: flex-end;\n width: 64px;\n height: 28px;\n margin-left: auto;\n}\n\n.-cerbur-clutch-dsh-worktree-treeActionSlot > .-cerbur-clutch-dsh-worktree-menuAction {\n position: absolute;\n top: 0;\n right: 32px;\n}\n\n.-cerbur-clutch-dsh-worktree-treeActionSlot > .-cerbur-clutch-dsh-worktree-iconButton:last-child {\n position: absolute;\n top: 0;\n right: 0;\n}\n\n.-cerbur-clutch-dsh-worktree-menuAction {\n display: inline-flex;\n width: 28px;\n height: 28px;\n visibility: hidden;\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceRow:hover .-cerbur-clutch-dsh-worktree-menuAction,\n.-cerbur-clutch-dsh-worktree-workspaceRow[data-menu-open='true'] .-cerbur-clutch-dsh-worktree-menuAction,\n.-cerbur-clutch-dsh-worktree-worktreeRow:hover .-cerbur-clutch-dsh-worktree-menuAction,\n.-cerbur-clutch-dsh-worktree-worktreeRow[data-menu-open='true'] .-cerbur-clutch-dsh-worktree-menuAction {\n visibility: visible;\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceRow.-cerbur-clutch-dsh-worktree-dropBefore::before,\n.-cerbur-clutch-dsh-worktree-workspaceRow.-cerbur-clutch-dsh-worktree-dropAfter::after {\n position: absolute;\n right: 4px;\n left: 4px;\n height: 2px;\n border-radius: 2px;\n background: var(--dsw-alias-brand-primary);\n content: '';\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceRow.-cerbur-clutch-dsh-worktree-dropBefore::before {\n top: -1px;\n}\n\n.-cerbur-clutch-dsh-worktree-workspaceRow.-cerbur-clutch-dsh-worktree-dropAfter::after {\n bottom: -1px;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeRow.-cerbur-clutch-dsh-worktree-dropBefore::before,\n.-cerbur-clutch-dsh-worktree-worktreeRow.-cerbur-clutch-dsh-worktree-dropAfter::after {\n position: absolute;\n right: 4px;\n left: 4px;\n height: 2px;\n border-radius: 2px;\n background: var(--dsw-alias-brand-primary);\n content: '';\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeRow.-cerbur-clutch-dsh-worktree-dropBefore::before {\n top: -1px;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeRow.-cerbur-clutch-dsh-worktree-dropAfter::after {\n bottom: -1px;\n}\n\n.-cerbur-clutch-dsh-worktree-treeChildren {\n margin-left: 24px;\n padding: 2px 0 5px 12px;\n border-left: 1px solid var(--dsw-alias-border-l1);\n}\n\n.-cerbur-clutch-dsh-worktree-groupLabel {\n padding: 6px 8px 3px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 10px;\n font-weight: 600;\n letter-spacing: 0.05em;\n text-transform: uppercase;\n}\n\n.-cerbur-clutch-dsh-worktree-groupHeader {\n display: flex;\n align-items: center;\n min-height: 34px;\n padding-right: 4px;\n}\n\n.-cerbur-clutch-dsh-worktree-groupHeader .-cerbur-clutch-dsh-worktree-groupLabel {\n flex: 1;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeGroup {\n margin-top: 2px;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeRow {\n min-height: 34px;\n}\n\n.-cerbur-clutch-dsh-worktree-worktreeRow .-cerbur-clutch-dsh-worktree-worktreeIcon,\n.-cerbur-clutch-dsh-worktree-worktreeRow .-cerbur-clutch-dsh-worktree-disclosureButton {\n width: 22px;\n}\n\n.-cerbur-clutch-dsh-worktree-treeSessionRow {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n min-width: 0;\n min-height: 31px;\n box-sizing: border-box;\n border-radius: 7px;\n}\n\n.-cerbur-clutch-dsh-worktree-treeSessionRow:hover,\n.-cerbur-clutch-dsh-worktree-treeSessionRow[data-menu-open='true'] {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.-cerbur-clutch-dsh-worktree-treeSessionRow.-cerbur-clutch-dsh-worktree-dropBefore::before,\n.-cerbur-clutch-dsh-worktree-treeSessionRow.-cerbur-clutch-dsh-worktree-dropAfter::after {\n position: absolute;\n right: 4px;\n left: 4px;\n height: 2px;\n border-radius: 2px;\n background: var(--dsw-alias-brand-primary);\n content: '';\n}\n\n.-cerbur-clutch-dsh-worktree-treeSessionRow.-cerbur-clutch-dsh-worktree-dropBefore::before {\n top: -1px;\n}\n\n.-cerbur-clutch-dsh-worktree-treeSessionRow.-cerbur-clutch-dsh-worktree-dropAfter::after {\n bottom: -1px;\n}\n\n.-cerbur-clutch-dsh-worktree-treeSessionContent {\n display: flex;\n align-items: center;\n flex: 1;\n width: 0;\n min-width: 0;\n min-height: 31px;\n box-sizing: border-box;\n border: 0;\n border-radius: 7px;\n padding: 4px 4px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n cursor: pointer;\n font: inherit;\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n text-align: left;\n}\n\n.-cerbur-clutch-dsh-worktree-treeSessionContent:hover {\n background: transparent;\n}\n\n.-cerbur-clutch-dsh-worktree-rowActions {\n display: none;\n flex: none;\n align-items: center;\n gap: 4px;\n}\n\n.-cerbur-clutch-dsh-worktree-sessionOverflowButton {\n display: block;\n width: calc(100% - 24px);\n margin: 2px 0 4px 24px;\n padding: 4px 8px;\n border: 0;\n border-radius: 6px;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n font: inherit;\n font-size: 12px;\n font-weight: 400;\n line-height: 20px;\n text-align: left;\n}\n\n.-cerbur-clutch-dsh-worktree-sessionOverflowButton:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-primary);\n}\n\n.-cerbur-clutch-dsh-worktree-treeSessionRow:hover .-cerbur-clutch-dsh-worktree-rowActions,\n.-cerbur-clutch-dsh-worktree-treeSessionRow[data-menu-open='true'] .-cerbur-clutch-dsh-worktree-rowActions {\n display: inline-flex;\n}\n\n.-cerbur-clutch-dsh-worktree-renameInput {\n width: 100%;\n}\n\n.-cerbur-clutch-dsh-worktree-renameError {\n margin: 8px 0 0;\n color: var(--dsw-alias-state-error-primary);\n font-size: 13px;\n line-height: 20px;\n}\n\n.-cerbur-clutch-dsh-worktree-treeGuide {\n flex: none;\n width: 20px;\n color: var(--dsw-alias-label-tertiary);\n text-align: center;\n}\n\n.-cerbur-clutch-dsh-worktree-emptyNested {\n margin: 0;\n padding: 4px 8px 5px 28px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n}\n\n.-cerbur-clutch-dsh-worktree-modalField {\n display: grid;\n gap: 5px;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n}\n";
370
376
  const styleId = "@cerbur/clutch-dsh-worktree/worktree.css";
371
377
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"@cerbur/clutch-dsh-worktree/worktree.css\"]") === null) {
372
378
  const tag = document.createElement("style");
@@ -380,8 +386,6 @@ window.__ModuleLoader__.load({
380
386
  "actionLabel": "-cerbur-clutch-dsh-worktree-actionLabel",
381
387
  "surface": "-cerbur-clutch-dsh-worktree-surface",
382
388
  "wideContent": "-cerbur-clutch-dsh-worktree-wideContent",
383
- "railContent": "-cerbur-clutch-dsh-worktree-railContent",
384
- "railButton": "-cerbur-clutch-dsh-worktree-railButton",
385
389
  "closeButton": "-cerbur-clutch-dsh-worktree-closeButton",
386
390
  "header": "-cerbur-clutch-dsh-worktree-header",
387
391
  "title": "-cerbur-clutch-dsh-worktree-title",
@@ -484,9 +488,12 @@ window.__ModuleLoader__.load({
484
488
  for (let ancestor = element.parentElement; ancestor !== null; ancestor = ancestor.parentElement) if (getComputedStyle(ancestor).position !== "static") return ancestor;
485
489
  return null;
486
490
  }
491
+ function overlayFor(element) {
492
+ return positionedAncestor(element.closest("[data-worktree-hero-host]") ?? element);
493
+ }
487
494
  function measurePlacement(element) {
488
495
  const hero = document.querySelector("[data-phase=\"hero\"]");
489
- const overlay = positionedAncestor(element);
496
+ const overlay = overlayFor(element);
490
497
  const headline = hero === null ? null : headlineElement(hero);
491
498
  if (hero === null || headline === null || overlay === null) return null;
492
499
  const anchor = headline.getBoundingClientRect();
@@ -538,7 +545,7 @@ window.__ModuleLoader__.load({
538
545
  attributeFilter: ["class", "data-phase"]
539
546
  });
540
547
  const resizeObserver = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(schedule);
541
- resizeObserver?.observe(positionedAncestor(element) ?? element);
548
+ resizeObserver?.observe(overlayFor(element) ?? element);
542
549
  window.addEventListener("resize", schedule);
543
550
  schedule();
544
551
  return () => {
@@ -551,16 +558,27 @@ window.__ModuleLoader__.load({
551
558
  const ariaLabel = contextAriaLabel(state, t);
552
559
  if (label === void 0) return null;
553
560
  return (0, react_jsx_runtime.jsx)("span", {
554
- ref: measure,
555
- className: worktree_context_css_default.heroContext,
556
- "data-worktree-hero-context": true,
557
- "aria-label": ariaLabel,
558
- title: label,
561
+ className: worktree_context_css_default.heroContextHost,
562
+ "data-worktree-hero-host": true,
559
563
  style: placement === null ? { visibility: "hidden" } : {
560
564
  left: `${placement.left}px`,
561
565
  top: `${placement.top}px`
562
566
  },
563
- children: label
567
+ children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.HoverCard, {
568
+ anchor: (0, react_jsx_runtime.jsx)("span", {
569
+ ref: measure,
570
+ className: worktree_context_css_default.heroContext,
571
+ "data-worktree-hero-context": true,
572
+ "aria-label": ariaLabel,
573
+ title: label,
574
+ children: label
575
+ }),
576
+ content: (0, react_jsx_runtime.jsx)("div", {
577
+ className: worktree_context_css_default.contextHoverTitle,
578
+ children: label
579
+ }),
580
+ openDelayMs: 500
581
+ })
564
582
  });
565
583
  }
566
584
  //#endregion
@@ -782,6 +800,7 @@ window.__ModuleLoader__.load({
782
800
  case "WORKTREE_SESSION_REPAIR_REQUIRED": return t("error.worktreeSessionRepairRequired");
783
801
  case "WORKTREE_SESSION_UNAVAILABLE": return t("error.worktreeSessionUnavailable");
784
802
  case "SESSION_ARCHIVED": return t("error.sessionArchived");
803
+ case "GIT_NOT_INSTALLED": return t("error.gitNotInstalled");
785
804
  default: return error.message.length > 0 ? error.message : t("error.worktreeDataUnavailable");
786
805
  }
787
806
  }
@@ -811,7 +830,7 @@ window.__ModuleLoader__.load({
811
830
  return (summary?.displayTitle ?? sessionId).toLocaleLowerCase().includes(normalizedQuery);
812
831
  }
813
832
  //#endregion
814
- //#region lib/client/worktree-view.js
833
+ //#region lib/client/worktree-view-errors.js
815
834
  /** A DSH Session exists even when the external Worktree binding needs repair. */
816
835
  var WorktreeSessionBindingError = class extends Error {
817
836
  code;
@@ -832,6 +851,98 @@ window.__ModuleLoader__.load({
832
851
  this.cause = cause;
833
852
  }
834
853
  };
854
+ function recordDetails(value) {
855
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return void 0;
856
+ const details = value.details;
857
+ if (typeof details !== "object" || details === null || Array.isArray(details)) return void 0;
858
+ return details;
859
+ }
860
+ /** Convert any adapter/Gateway failure into renderable, retry-aware UI data. */
861
+ function toWorktreeViewError(error) {
862
+ if (typeof error === "object" && error !== null) {
863
+ const candidate = error;
864
+ const details = error instanceof WorktreeSessionBindingError ? {
865
+ ...recordDetails(error) ?? {},
866
+ sessionId: error.sessionId
867
+ } : recordDetails(error);
868
+ return {
869
+ code: typeof candidate.code === "string" ? candidate.code : "WORKTREE_VIEW_FAILED",
870
+ message: typeof candidate.message === "string" ? candidate.message : "",
871
+ retryable: candidate.retryable !== false,
872
+ ...details === void 0 ? {} : { details }
873
+ };
874
+ }
875
+ return {
876
+ code: "WORKTREE_VIEW_FAILED",
877
+ message: "",
878
+ retryable: true
879
+ };
880
+ }
881
+ /** Keep ordering mutation/refresh failures reachable from the surface Retry control. */
882
+ function toRetryableWorktreeOrderError(error) {
883
+ return {
884
+ ...toWorktreeViewError(error),
885
+ retryable: true
886
+ };
887
+ }
888
+ //#endregion
889
+ //#region lib/client/worktree-view-actions.js
890
+ function browserRandomUuid() {
891
+ const randomUUID = globalThis.crypto?.randomUUID;
892
+ if (typeof randomUUID === "function") return randomUUID.call(globalThis.crypto);
893
+ return `${Date.now().toString(16)}-${Math.random().toString(16).slice(2)}`;
894
+ }
895
+ /** Generate a short, editable default branch name without colliding with known local names. */
896
+ function createDefaultWorktreeName(existingNames, randomUuid = browserRandomUuid) {
897
+ const usedNames = new Set([...existingNames].map((name) => name.trim()));
898
+ for (let attempt = 0; attempt < 100; attempt += 1) {
899
+ const suffix = randomUuid().replace(/[^a-z0-9]/gi, "").slice(0, 8).toLowerCase();
900
+ if (suffix.length < 8) continue;
901
+ const candidate = `dsh/${suffix}`;
902
+ if (!usedNames.has(candidate)) return candidate;
903
+ }
904
+ throw new Error("Unable to generate an available default Worktree name.");
905
+ }
906
+ /** Resolve a row-half drop target to native-style optional before-anchor semantics. */
907
+ function resolveWorktreeMove(worktreeIds, sourceWorktreeId, targetWorktreeId, half) {
908
+ const sourceIndex = worktreeIds.indexOf(sourceWorktreeId);
909
+ const targetIndex = worktreeIds.indexOf(targetWorktreeId);
910
+ if (sourceIndex === -1 || targetIndex === -1) return void 0;
911
+ const beforeWorktreeId = half === "before" ? targetWorktreeId : worktreeIds[targetIndex + 1];
912
+ if (beforeWorktreeId === sourceWorktreeId) return void 0;
913
+ const anchorIndex = beforeWorktreeId === void 0 ? worktreeIds.length : worktreeIds.indexOf(beforeWorktreeId);
914
+ if (anchorIndex === sourceIndex || anchorIndex === sourceIndex + 1) return void 0;
915
+ return beforeWorktreeId === void 0 ? {} : { beforeWorktreeId };
916
+ }
917
+ /** Keep mutation routing in the browser Consumer while leaving wire details to the adapter. */
918
+ async function executeWorktreeAction(manager, action) {
919
+ if (action.type === "createWorktree") return manager.createWorktree(action.input);
920
+ if (action.type === "removeWorktree") {
921
+ await manager.removeWorktree(action.input);
922
+ return;
923
+ }
924
+ }
925
+ /**
926
+ * Create a normal DSH Session at a Worktree cwd, then add the external binding.
927
+ * A binding failure deliberately leaves the DSH-created Session intact.
928
+ */
929
+ async function createSessionForWorktree(input) {
930
+ const sessionId = await input.createSession({ cwd: input.cwd });
931
+ try {
932
+ await input.manager.bindSession({
933
+ workspaceId: input.workspaceId,
934
+ worktreeId: input.worktreeId,
935
+ sessionId
936
+ });
937
+ } catch (error) {
938
+ throw new WorktreeSessionBindingError(sessionId, error);
939
+ }
940
+ input.beforeOpen?.(sessionId);
941
+ input.openSession(sessionId);
942
+ return sessionId;
943
+ }
944
+ //#endregion
945
+ //#region lib/client/worktree-view-read.js
835
946
  /** Reuse the previous ID snapshot when DSH republishes equivalent Workspace items. */
836
947
  function stableWorkspaceIds(previous, next) {
837
948
  if (previous.length !== next.length) return next;
@@ -880,6 +991,7 @@ window.__ModuleLoader__.load({
880
991
  /** Return copyable, read-only setup commands for a Git readiness state. */
881
992
  function worktreeSetupCommands(status) {
882
993
  switch (status) {
994
+ case "gitNotInstalled": return [];
883
995
  case "noRepository": return [
884
996
  "git init",
885
997
  "printf \"# README\\n\" > README.md",
@@ -895,28 +1007,12 @@ window.__ModuleLoader__.load({
895
1007
  case "ready": return [];
896
1008
  }
897
1009
  }
898
- function browserRandomUuid() {
899
- const randomUUID = globalThis.crypto?.randomUUID;
900
- if (typeof randomUUID === "function") return randomUUID.call(globalThis.crypto);
901
- return `${Date.now().toString(16)}-${Math.random().toString(16).slice(2)}`;
902
- }
903
- /** Generate a short, editable default branch name without colliding with known local names. */
904
- function createDefaultWorktreeName(existingNames, randomUuid = browserRandomUuid) {
905
- const usedNames = new Set([...existingNames].map((name) => name.trim()));
906
- for (let attempt = 0; attempt < 100; attempt += 1) {
907
- const suffix = randomUuid().replace(/[^a-z0-9]/gi, "").slice(0, 8).toLowerCase();
908
- if (suffix.length < 8) continue;
909
- const candidate = `dsh/${suffix}`;
910
- if (!usedNames.has(candidate)) return candidate;
911
- }
912
- throw new Error("Unable to generate an available default Worktree name.");
913
- }
914
- /** Hide DSH-archived Sessions from the browser-local Worktree projection. */
915
- function filterArchivedSessionIds(sessionIds, archivedSessionIds) {
916
- return sessionIds.filter((sessionId) => !archivedSessionIds.includes(sessionId));
917
- }
918
1010
  function readinessFromBranchError(error) {
919
1011
  const viewError = toWorktreeViewError(error);
1012
+ if (viewError.code === "GIT_NOT_INSTALLED") return {
1013
+ status: "gitNotInstalled",
1014
+ error: viewError
1015
+ };
920
1016
  if (viewError.code === "WORKSPACE_NOT_GIT_REPOSITORY") return {
921
1017
  status: "noRepository",
922
1018
  error: viewError
@@ -961,77 +1057,9 @@ window.__ModuleLoader__.load({
961
1057
  if (options.invalidateContext !== false) await options.invalidateWorktreeContext?.();
962
1058
  return views;
963
1059
  }
964
- /** Resolve a row-half drop target to native-style optional before-anchor semantics. */
965
- function resolveWorktreeMove(worktreeIds, sourceWorktreeId, targetWorktreeId, half) {
966
- const sourceIndex = worktreeIds.indexOf(sourceWorktreeId);
967
- const targetIndex = worktreeIds.indexOf(targetWorktreeId);
968
- if (sourceIndex === -1 || targetIndex === -1) return void 0;
969
- const beforeWorktreeId = half === "before" ? targetWorktreeId : worktreeIds[targetIndex + 1];
970
- if (beforeWorktreeId === sourceWorktreeId) return void 0;
971
- const anchorIndex = beforeWorktreeId === void 0 ? worktreeIds.length : worktreeIds.indexOf(beforeWorktreeId);
972
- if (anchorIndex === sourceIndex || anchorIndex === sourceIndex + 1) return void 0;
973
- return beforeWorktreeId === void 0 ? {} : { beforeWorktreeId };
974
- }
975
- /** Keep mutation routing in the browser Consumer while leaving wire details to the adapter. */
976
- async function executeWorktreeAction(manager, action) {
977
- if (action.type === "createWorktree") return manager.createWorktree(action.input);
978
- if (action.type === "removeWorktree") {
979
- await manager.removeWorktree(action.input);
980
- return;
981
- }
982
- }
983
- /**
984
- * Create a normal DSH Session at a Worktree cwd, then add the external binding.
985
- * A binding failure deliberately leaves the DSH-created Session intact.
986
- */
987
- async function createSessionForWorktree(input) {
988
- const sessionId = await input.createSession({ cwd: input.cwd });
989
- try {
990
- await input.manager.bindSession({
991
- workspaceId: input.workspaceId,
992
- worktreeId: input.worktreeId,
993
- sessionId
994
- });
995
- } catch (error) {
996
- throw new WorktreeSessionBindingError(sessionId, error);
997
- }
998
- input.beforeOpen?.(sessionId);
999
- input.openSession(sessionId);
1000
- return sessionId;
1001
- }
1002
- function recordDetails(value) {
1003
- if (typeof value !== "object" || value === null || Array.isArray(value)) return void 0;
1004
- const details = value.details;
1005
- if (typeof details !== "object" || details === null || Array.isArray(details)) return void 0;
1006
- return details;
1007
- }
1008
- /** Convert any adapter/Gateway failure into renderable, retry-aware UI data. */
1009
- function toWorktreeViewError(error) {
1010
- if (typeof error === "object" && error !== null) {
1011
- const candidate = error;
1012
- const details = error instanceof WorktreeSessionBindingError ? {
1013
- ...recordDetails(error) ?? {},
1014
- sessionId: error.sessionId
1015
- } : recordDetails(error);
1016
- return {
1017
- code: typeof candidate.code === "string" ? candidate.code : "WORKTREE_VIEW_FAILED",
1018
- message: typeof candidate.message === "string" ? candidate.message : "",
1019
- retryable: candidate.retryable !== false,
1020
- ...details === void 0 ? {} : { details }
1021
- };
1022
- }
1023
- return {
1024
- code: "WORKTREE_VIEW_FAILED",
1025
- message: "",
1026
- retryable: true
1027
- };
1028
- }
1029
- /** Keep ordering mutation/refresh failures reachable from the surface Retry control. */
1030
- function toRetryableWorktreeOrderError(error) {
1031
- return {
1032
- ...toWorktreeViewError(error),
1033
- retryable: true
1034
- };
1060
+ /** Hide DSH-archived Sessions from the browser-local Worktree projection. */
1061
+ function filterArchivedSessionIds(sessionIds, archivedSessionIds) {
1062
+ return sessionIds.filter((sessionId) => !archivedSessionIds.includes(sessionId));
1035
1063
  }
1036
1064
  //#endregion
1037
1065
  //#region lib/client/worktree-session.js
@@ -1186,40 +1214,242 @@ window.__ModuleLoader__.load({
1186
1214
  };
1187
1215
  }
1188
1216
  //#endregion
1189
- //#region lib/client/WorktreeSurface.js
1217
+ //#region lib/client/worktree-surface-dialogs.js
1190
1218
  function worktreeSetupMessage(status, t) {
1191
1219
  switch (status) {
1220
+ case "gitNotInstalled": return t("worktree.setup.gitNotInstalled");
1192
1221
  case "noRepository": return t("worktree.setup.noRepository");
1193
1222
  case "noInitialCommit": return t("worktree.setup.noInitialCommit");
1194
1223
  case "noLocalBranch": return t("worktree.setup.noLocalBranch");
1195
1224
  }
1196
1225
  }
1197
- function toNativeWorktreeViewError(error) {
1198
- const viewError = toWorktreeViewError(error);
1199
- if (typeof error === "object" && error !== null) return viewError;
1200
- return {
1201
- ...viewError,
1202
- message: String(error)
1203
- };
1226
+ function WorktreeSessionRenameDialog({ t, target, draft, pending, error, onClose, onDraftChange, onSubmit }) {
1227
+ return (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
1228
+ open: target !== void 0,
1229
+ onClose,
1230
+ closeLabel: t("dialog.close"),
1231
+ title: t("session.rename"),
1232
+ footer: (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1233
+ variant: "outline",
1234
+ disabled: pending,
1235
+ onClick: onClose,
1236
+ children: t("dialog.cancel")
1237
+ }), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1238
+ variant: "primary",
1239
+ disabled: pending || draft.trim().length === 0,
1240
+ onClick: () => {
1241
+ onSubmit();
1242
+ },
1243
+ children: t("dialog.rename")
1244
+ })] }),
1245
+ children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
1246
+ className: worktree_css_default.renameInput,
1247
+ value: draft,
1248
+ "aria-label": t("session.name"),
1249
+ autoFocus: true,
1250
+ disabled: pending,
1251
+ onFocus: (event) => {
1252
+ event.currentTarget.select();
1253
+ },
1254
+ onChange: (event) => {
1255
+ onDraftChange(event.currentTarget.value);
1256
+ },
1257
+ onKeyDown: (event) => {
1258
+ if (event.key === "Enter" && !event.nativeEvent.isComposing) {
1259
+ event.preventDefault();
1260
+ onSubmit();
1261
+ }
1262
+ }
1263
+ }), error !== void 0 && (0, react_jsx_runtime.jsx)("p", {
1264
+ className: worktree_css_default.renameError,
1265
+ role: "alert",
1266
+ children: formatWorktreeViewError(error, t)
1267
+ })]
1268
+ });
1204
1269
  }
1205
- const EMPTY_READ_STATE = {
1206
- status: "idle",
1207
- views: []
1208
- };
1209
- function useStableWorkspaceIds(workspaces) {
1210
- const next = workspaces.map((workspace) => workspace.workspaceId);
1211
- const previousRef = (0, react.useRef)([]);
1212
- const stable = stableWorkspaceIds(previousRef.current, next);
1213
- if (stable !== previousRef.current) previousRef.current = stable;
1214
- return previousRef.current;
1270
+ function WorktreeWorkspaceRenameDialog({ t, target, draft, pending, duplicate, error, onClose, onDraftChange, onSubmit }) {
1271
+ if (target === void 0) return null;
1272
+ return (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
1273
+ open: true,
1274
+ onClose,
1275
+ closeLabel: t("dialog.closeWorkspaceRename"),
1276
+ title: t("workspace.renameTitle"),
1277
+ footer: (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1278
+ variant: "outline",
1279
+ disabled: pending,
1280
+ onClick: onClose,
1281
+ children: t("dialog.cancel")
1282
+ }), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1283
+ variant: "primary",
1284
+ disabled: pending || draft.trim().length === 0 || draft.trim() === target.currentTitle || duplicate,
1285
+ onClick: () => {
1286
+ onSubmit();
1287
+ },
1288
+ children: t("dialog.rename")
1289
+ })] }),
1290
+ children: [
1291
+ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
1292
+ className: worktree_css_default.renameInput,
1293
+ value: draft,
1294
+ "aria-label": t("workspace.name"),
1295
+ autoFocus: true,
1296
+ disabled: pending,
1297
+ onFocus: (event) => {
1298
+ event.currentTarget.select();
1299
+ },
1300
+ onChange: (event) => {
1301
+ onDraftChange(event.currentTarget.value);
1302
+ },
1303
+ onKeyDown: (event) => {
1304
+ if (event.key === "Enter" && !event.nativeEvent.isComposing) {
1305
+ event.preventDefault();
1306
+ onSubmit();
1307
+ }
1308
+ }
1309
+ }),
1310
+ duplicate && (0, react_jsx_runtime.jsx)("p", {
1311
+ className: worktree_css_default.renameError,
1312
+ role: "alert",
1313
+ children: t("workspace.duplicate")
1314
+ }),
1315
+ error !== void 0 && (0, react_jsx_runtime.jsx)("p", {
1316
+ className: worktree_css_default.renameError,
1317
+ role: "alert",
1318
+ children: formatWorktreeViewError(error, t)
1319
+ })
1320
+ ]
1321
+ });
1322
+ }
1323
+ function WorktreeWorkspaceDeleteDialog({ t, target, pending, error, onClose, onSubmit }) {
1324
+ if (target === void 0) return null;
1325
+ return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
1326
+ open: true,
1327
+ onClose,
1328
+ closeLabel: t("dialog.closeWorkspaceDelete"),
1329
+ title: t("workspace.deleteTitle"),
1330
+ description: t("workspace.deleteDescription", { name: target.title }),
1331
+ footer: (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1332
+ variant: "outline",
1333
+ disabled: pending,
1334
+ onClick: onClose,
1335
+ children: t("dialog.cancel")
1336
+ }), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1337
+ variant: "outline",
1338
+ disabled: pending,
1339
+ onClick: () => {
1340
+ onSubmit();
1341
+ },
1342
+ children: t("dialog.delete")
1343
+ })] }),
1344
+ children: error !== void 0 && (0, react_jsx_runtime.jsx)("p", {
1345
+ className: worktree_css_default.renameError,
1346
+ role: "alert",
1347
+ children: formatWorktreeViewError(error, t)
1348
+ })
1349
+ });
1350
+ }
1351
+ function WorktreeCreateDialog({ t, workspace, view, setupStatus, canCreate, selectedBranch, newBranch, actionPending, onClose, onSelectedBranchChange, onNewBranchChange, onSubmit }) {
1352
+ if (workspace === void 0) return null;
1353
+ const setupCommands = setupStatus === void 0 ? [] : worktreeSetupCommands(setupStatus);
1354
+ return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
1355
+ open: true,
1356
+ onClose: () => {
1357
+ if (actionPending) return;
1358
+ onClose();
1359
+ },
1360
+ closeLabel: t("dialog.closeWorktreeCreate"),
1361
+ title: t("worktree.createTitle"),
1362
+ description: t("worktree.createDescription", { name: workspace.title }),
1363
+ footer: (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1364
+ variant: "outline",
1365
+ disabled: actionPending,
1366
+ onClick: onClose,
1367
+ children: t("dialog.cancel")
1368
+ }), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1369
+ variant: "primary",
1370
+ disabled: actionPending || selectedBranch.length === 0 || newBranch.trim().length === 0,
1371
+ onClick: () => {
1372
+ onSubmit();
1373
+ },
1374
+ children: t("worktree.create")
1375
+ })] }),
1376
+ children: canCreate ? (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsxs)("label", {
1377
+ className: worktree_css_default.modalField,
1378
+ children: [t("worktree.baseBranch"), (0, react_jsx_runtime.jsx)("select", {
1379
+ className: worktree_css_default.actionSelect,
1380
+ "aria-label": t("worktree.baseBranch"),
1381
+ value: selectedBranch,
1382
+ disabled: actionPending,
1383
+ onChange: (event) => {
1384
+ onSelectedBranchChange(event.currentTarget.value);
1385
+ },
1386
+ children: view?.branches.map((branch) => (0, react_jsx_runtime.jsxs)("option", {
1387
+ value: branch.name,
1388
+ children: [
1389
+ branch.name,
1390
+ branch.isCurrent ? t("branch.current") : "",
1391
+ branch.checkedOut ? t("branch.checkedOut") : ""
1392
+ ]
1393
+ }, branch.name))
1394
+ })]
1395
+ }), (0, react_jsx_runtime.jsxs)("label", {
1396
+ className: worktree_css_default.modalField,
1397
+ children: [t("worktree.name"), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
1398
+ className: worktree_css_default.renameInput,
1399
+ "aria-label": t("worktree.name"),
1400
+ value: newBranch,
1401
+ placeholder: "dsh/12345678",
1402
+ disabled: actionPending,
1403
+ onChange: (event) => {
1404
+ onNewBranchChange(event.currentTarget.value);
1405
+ }
1406
+ })]
1407
+ })] }) : (0, react_jsx_runtime.jsxs)("div", {
1408
+ className: worktree_css_default.gitReadiness,
1409
+ "data-worktree-readiness": setupStatus ?? "loading",
1410
+ role: "alert",
1411
+ children: [(0, react_jsx_runtime.jsx)("p", {
1412
+ className: worktree_css_default.message,
1413
+ children: setupStatus === void 0 ? t("status.loading") : worktreeSetupMessage(setupStatus, t)
1414
+ }), setupCommands.length > 0 && (0, react_jsx_runtime.jsx)("pre", {
1415
+ className: worktree_css_default.commandBlock,
1416
+ "aria-label": t("worktree.setup.commands"),
1417
+ children: setupCommands.join("\n")
1418
+ })]
1419
+ })
1420
+ });
1421
+ }
1422
+ function WorktreeRemovalDialog({ t, worktree, actionPending, onClose, onSubmit }) {
1423
+ if (worktree === void 0) return null;
1424
+ return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
1425
+ open: true,
1426
+ onClose: () => {
1427
+ if (actionPending) return;
1428
+ onClose();
1429
+ },
1430
+ closeLabel: t("dialog.closeWorktreeRemove"),
1431
+ title: t("worktree.remove"),
1432
+ description: t("worktree.removeDescription", { name: worktree.branch }),
1433
+ footer: (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1434
+ variant: "outline",
1435
+ disabled: actionPending,
1436
+ onClick: onClose,
1437
+ children: t("dialog.cancel")
1438
+ }), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1439
+ variant: "primary",
1440
+ disabled: actionPending,
1441
+ onClick: () => {
1442
+ onSubmit();
1443
+ },
1444
+ children: t("worktree.remove")
1445
+ })] })
1446
+ });
1215
1447
  }
1448
+ //#endregion
1449
+ //#region lib/client/worktree-surface-selectors.js
1216
1450
  function sessionLabel(sessionId, sessions, t) {
1217
1451
  return sessionDisplayLabel(sessionId, sessions, t("session.new"));
1218
1452
  }
1219
- function rowHalf(event) {
1220
- const rect = event.currentTarget.getBoundingClientRect();
1221
- return event.clientY < rect.top + rect.height / 2 ? "before" : "after";
1222
- }
1223
1453
  function bindingIdsFor(bindings, worktreeId) {
1224
1454
  return bindings.filter((binding) => binding.worktreeId === worktreeId).map((binding) => binding.sessionId);
1225
1455
  }
@@ -1234,6 +1464,12 @@ window.__ModuleLoader__.load({
1234
1464
  if (view.worktrees.some((record) => includesText(record.branch, query) || includesText(record.absolutePath, query))) return true;
1235
1465
  return view.bindings.some((binding) => sessionMatchesQuery(binding.sessionId, sessions, query));
1236
1466
  }
1467
+ //#endregion
1468
+ //#region lib/client/worktree-surface-rows.js
1469
+ function rowHalf(event) {
1470
+ const rect = event.currentTarget.getBoundingClientRect();
1471
+ return event.clientY < rect.top + rect.height / 2 ? "before" : "after";
1472
+ }
1237
1473
  /** Workspace row using the native DSH menu, fixed action column, and drag contract. */
1238
1474
  function WorktreeWorkspaceRow({ t, workspace, expanded, actionPending, menuOpen, drag, onToggle, onCreateWorktree, onRename, onDelete, onMenuOpenChange }) {
1239
1475
  const workspaceMenuItems = [{
@@ -1596,6 +1832,27 @@ window.__ModuleLoader__.load({
1596
1832
  children: expanded ? t("session.collapse") : t("session.expandMore", { count: sessionIds.length - 5 })
1597
1833
  })] });
1598
1834
  }
1835
+ //#endregion
1836
+ //#region lib/client/WorktreeSurface.js
1837
+ function toNativeWorktreeViewError(error) {
1838
+ const viewError = toWorktreeViewError(error);
1839
+ if (typeof error === "object" && error !== null) return viewError;
1840
+ return {
1841
+ ...viewError,
1842
+ message: String(error)
1843
+ };
1844
+ }
1845
+ const EMPTY_READ_STATE = {
1846
+ status: "idle",
1847
+ views: []
1848
+ };
1849
+ function useStableWorkspaceIds(workspaces) {
1850
+ const next = workspaces.map((workspace) => workspace.workspaceId);
1851
+ const previousRef = (0, react.useRef)([]);
1852
+ const stable = stableWorkspaceIds(previousRef.current, next);
1853
+ if (stable !== previousRef.current) previousRef.current = stable;
1854
+ return previousRef.current;
1855
+ }
1599
1856
  /**
1600
1857
  * Peer Worktree navigation surface. It keeps the original DSH Workspace mode
1601
1858
  * intact and renders a browser-local Workspace → Worktree → Session projection.
@@ -2445,242 +2702,79 @@ window.__ModuleLoader__.load({
2445
2702
  })
2446
2703
  ]
2447
2704
  }),
2448
- (0, react_jsx_runtime.jsx)("div", {
2449
- className: worktree_css_default.railContent,
2450
- children: (0, react_jsx_runtime.jsx)("button", {
2451
- type: "button",
2452
- className: worktree_css_default.railButton,
2453
- "aria-label": t("mode.exit"),
2454
- onClick: () => {
2455
- actions.setViewMode("workspace-session");
2456
- },
2457
- children: "WT"
2458
- })
2459
- }),
2460
- (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
2461
- open: sessionRenameTarget !== void 0,
2705
+ (0, react_jsx_runtime.jsx)(WorktreeSessionRenameDialog, {
2706
+ t,
2707
+ target: sessionRenameTarget,
2708
+ draft: sessionRenameDraft,
2709
+ pending: sessionRenamePending,
2710
+ error: sessionRenameError,
2462
2711
  onClose: closeSessionRename,
2463
- closeLabel: t("dialog.close"),
2464
- title: t("session.rename"),
2465
- footer: (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
2466
- variant: "outline",
2467
- disabled: sessionRenamePending,
2468
- onClick: closeSessionRename,
2469
- children: t("dialog.cancel")
2470
- }), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
2471
- variant: "primary",
2472
- disabled: sessionRenamePending || sessionRenameDraft.trim().length === 0,
2473
- onClick: () => {
2474
- confirmSessionRename();
2475
- },
2476
- children: t("dialog.rename")
2477
- })] }),
2478
- children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
2479
- className: worktree_css_default.renameInput,
2480
- value: sessionRenameDraft,
2481
- "aria-label": t("session.name"),
2482
- autoFocus: true,
2483
- disabled: sessionRenamePending,
2484
- onFocus: (event) => {
2485
- event.currentTarget.select();
2486
- },
2487
- onChange: (event) => {
2488
- setSessionRenameDraft(event.currentTarget.value);
2489
- setSessionRenameError(void 0);
2490
- },
2491
- onKeyDown: (event) => {
2492
- if (event.key === "Enter" && !event.nativeEvent.isComposing) {
2493
- event.preventDefault();
2494
- confirmSessionRename();
2495
- }
2496
- }
2497
- }), sessionRenameError !== void 0 && (0, react_jsx_runtime.jsx)("p", {
2498
- className: worktree_css_default.renameError,
2499
- role: "alert",
2500
- children: formatWorktreeViewError(sessionRenameError, t)
2501
- })]
2712
+ onDraftChange: (draft) => {
2713
+ setSessionRenameDraft(draft);
2714
+ setSessionRenameError(void 0);
2715
+ },
2716
+ onSubmit: confirmSessionRename
2502
2717
  }),
2503
- workspaceRenameTarget !== void 0 && (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
2504
- open: workspaceRenameTarget !== void 0,
2718
+ (0, react_jsx_runtime.jsx)(WorktreeWorkspaceRenameDialog, {
2719
+ t,
2720
+ target: workspaceRenameTarget,
2721
+ draft: workspaceRenameDraft,
2722
+ pending: workspaceRenamePending,
2723
+ duplicate: workspaceRenameDuplicate,
2724
+ error: workspaceRenameError,
2505
2725
  onClose: closeWorkspaceRename,
2506
- closeLabel: t("dialog.closeWorkspaceRename"),
2507
- title: t("workspace.renameTitle"),
2508
- footer: (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
2509
- variant: "outline",
2510
- disabled: workspaceRenamePending,
2511
- onClick: closeWorkspaceRename,
2512
- children: t("dialog.cancel")
2513
- }), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
2514
- variant: "primary",
2515
- disabled: workspaceRenameBlocked,
2516
- onClick: () => {
2517
- confirmWorkspaceRename();
2518
- },
2519
- children: t("dialog.rename")
2520
- })] }),
2521
- children: [
2522
- (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
2523
- className: worktree_css_default.renameInput,
2524
- value: workspaceRenameDraft,
2525
- "aria-label": t("workspace.name"),
2526
- autoFocus: true,
2527
- disabled: workspaceRenamePending,
2528
- onFocus: (event) => {
2529
- event.currentTarget.select();
2530
- },
2531
- onChange: (event) => {
2532
- setWorkspaceRenameDraft(event.currentTarget.value);
2533
- setWorkspaceRenameError(void 0);
2534
- },
2535
- onKeyDown: (event) => {
2536
- if (event.key === "Enter" && !event.nativeEvent.isComposing) {
2537
- event.preventDefault();
2538
- confirmWorkspaceRename();
2539
- }
2540
- }
2541
- }),
2542
- workspaceRenameDuplicate && (0, react_jsx_runtime.jsx)("p", {
2543
- className: worktree_css_default.renameError,
2544
- role: "alert",
2545
- children: t("workspace.duplicate")
2546
- }),
2547
- workspaceRenameError !== void 0 && (0, react_jsx_runtime.jsx)("p", {
2548
- className: worktree_css_default.renameError,
2549
- role: "alert",
2550
- children: formatWorktreeViewError(workspaceRenameError, t)
2551
- })
2552
- ]
2726
+ onDraftChange: (draft) => {
2727
+ setWorkspaceRenameDraft(draft);
2728
+ setWorkspaceRenameError(void 0);
2729
+ },
2730
+ onSubmit: confirmWorkspaceRename
2553
2731
  }),
2554
- workspaceDeleteTarget !== void 0 && (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
2555
- open: workspaceDeleteTarget !== void 0,
2732
+ (0, react_jsx_runtime.jsx)(WorktreeWorkspaceDeleteDialog, {
2733
+ t,
2734
+ target: workspaceDeleteTarget,
2735
+ pending: workspaceDeletePending,
2736
+ error: workspaceDeleteError,
2556
2737
  onClose: closeWorkspaceDelete,
2557
- closeLabel: t("dialog.closeWorkspaceDelete"),
2558
- title: t("workspace.deleteTitle"),
2559
- description: t("workspace.deleteDescription", { name: workspaceDeleteTarget.title }),
2560
- footer: (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
2561
- variant: "outline",
2562
- disabled: workspaceDeletePending,
2563
- onClick: closeWorkspaceDelete,
2564
- children: t("dialog.cancel")
2565
- }), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
2566
- variant: "outline",
2567
- disabled: workspaceDeletePending,
2568
- onClick: () => {
2569
- confirmWorkspaceDelete();
2570
- },
2571
- children: t("dialog.delete")
2572
- })] }),
2573
- children: workspaceDeleteError !== void 0 && (0, react_jsx_runtime.jsx)("p", {
2574
- className: worktree_css_default.renameError,
2575
- role: "alert",
2576
- children: formatWorktreeViewError(workspaceDeleteError, t)
2577
- })
2738
+ onSubmit: confirmWorkspaceDelete
2578
2739
  }),
2579
- worktreeModalWorkspaceId !== void 0 && modalWorkspace !== void 0 && (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
2580
- open: worktreeModalWorkspaceId !== void 0,
2740
+ (0, react_jsx_runtime.jsx)(WorktreeCreateDialog, {
2741
+ t,
2742
+ workspace: modalWorkspace,
2743
+ view: modalView,
2744
+ setupStatus: modalSetupStatus,
2745
+ canCreate: modalCanCreate,
2746
+ selectedBranch,
2747
+ newBranch,
2748
+ actionPending,
2581
2749
  onClose: () => {
2582
- if (actionPending) return;
2583
2750
  setWorktreeModalWorkspaceId(void 0);
2584
2751
  },
2585
- closeLabel: t("dialog.closeWorktreeCreate"),
2586
- title: t("worktree.createTitle"),
2587
- description: t("worktree.createDescription", { name: modalWorkspace.title }),
2588
- footer: (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
2589
- variant: "outline",
2590
- disabled: actionPending,
2591
- onClick: () => {
2592
- setWorktreeModalWorkspaceId(void 0);
2593
- },
2594
- children: t("dialog.cancel")
2595
- }), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
2596
- variant: "primary",
2597
- disabled: actionPending || selectedBranch.length === 0 || newBranch.trim().length === 0,
2598
- onClick: () => {
2599
- submitWorktree();
2600
- },
2601
- children: t("worktree.create")
2602
- })] }),
2603
- children: modalCanCreate ? (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsxs)("label", {
2604
- className: worktree_css_default.modalField,
2605
- children: [t("worktree.baseBranch"), (0, react_jsx_runtime.jsx)("select", {
2606
- className: worktree_css_default.actionSelect,
2607
- "aria-label": t("worktree.baseBranch"),
2608
- value: selectedBranch,
2609
- disabled: actionPending,
2610
- onChange: (event) => {
2611
- setSelectedBranch(event.currentTarget.value);
2612
- },
2613
- children: modalView?.branches.map((branch) => (0, react_jsx_runtime.jsxs)("option", {
2614
- value: branch.name,
2615
- children: [
2616
- branch.name,
2617
- branch.isCurrent ? t("branch.current") : "",
2618
- branch.checkedOut ? t("branch.checkedOut") : ""
2619
- ]
2620
- }, branch.name))
2621
- })]
2622
- }), (0, react_jsx_runtime.jsxs)("label", {
2623
- className: worktree_css_default.modalField,
2624
- children: [t("worktree.name"), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
2625
- className: worktree_css_default.renameInput,
2626
- "aria-label": t("worktree.name"),
2627
- value: newBranch,
2628
- placeholder: "dsh/12345678",
2629
- disabled: actionPending,
2630
- onChange: (event) => {
2631
- setNewBranch(event.currentTarget.value);
2632
- }
2633
- })]
2634
- })] }) : (0, react_jsx_runtime.jsxs)("div", {
2635
- className: worktree_css_default.gitReadiness,
2636
- "data-worktree-readiness": modalSetupStatus ?? "loading",
2637
- role: "alert",
2638
- children: [(0, react_jsx_runtime.jsx)("p", {
2639
- className: worktree_css_default.message,
2640
- children: modalSetupStatus === void 0 ? t("status.loading") : worktreeSetupMessage(modalSetupStatus, t)
2641
- }), modalSetupStatus !== void 0 && (0, react_jsx_runtime.jsx)("pre", {
2642
- className: worktree_css_default.commandBlock,
2643
- "aria-label": t("worktree.setup.commands"),
2644
- children: worktreeSetupCommands(modalSetupStatus).join("\n")
2645
- })]
2646
- })
2752
+ onSelectedBranchChange: setSelectedBranch,
2753
+ onNewBranchChange: setNewBranch,
2754
+ onSubmit: submitWorktree
2647
2755
  }),
2648
- worktreeRemoval !== void 0 && (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
2649
- open: worktreeRemoval !== void 0,
2756
+ (0, react_jsx_runtime.jsx)(WorktreeRemovalDialog, {
2757
+ t,
2758
+ worktree: worktreeRemoval,
2759
+ actionPending,
2650
2760
  onClose: () => {
2651
- if (actionPending) return;
2652
2761
  setWorktreeRemoval(void 0);
2653
2762
  },
2654
- closeLabel: t("dialog.closeWorktreeRemove"),
2655
- title: t("worktree.remove"),
2656
- description: t("worktree.removeDescription", { name: worktreeRemoval.branch }),
2657
- footer: (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
2658
- variant: "outline",
2659
- disabled: actionPending,
2660
- onClick: () => {
2661
- setWorktreeRemoval(void 0);
2662
- },
2663
- children: t("dialog.cancel")
2664
- }), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
2665
- variant: "primary",
2666
- disabled: actionPending,
2667
- onClick: () => {
2668
- if (manager === void 0) return;
2669
- const target = worktreeRemoval;
2670
- runMutation(async () => {
2671
- await executeWorktreeAction(manager, {
2672
- type: "removeWorktree",
2673
- input: {
2674
- workspaceId: target.workspaceId,
2675
- worktreeId: target.worktreeId
2676
- }
2677
- });
2678
- await invalidateWorktreeContext?.(target.workspaceId);
2679
- setWorktreeRemoval(void 0);
2763
+ onSubmit: () => {
2764
+ if (manager === void 0 || worktreeRemoval === void 0) return;
2765
+ const target = worktreeRemoval;
2766
+ runMutation(async () => {
2767
+ await executeWorktreeAction(manager, {
2768
+ type: "removeWorktree",
2769
+ input: {
2770
+ workspaceId: target.workspaceId,
2771
+ worktreeId: target.worktreeId
2772
+ }
2680
2773
  });
2681
- },
2682
- children: t("worktree.remove")
2683
- })] })
2774
+ await invalidateWorktreeContext?.(target.workspaceId);
2775
+ setWorktreeRemoval(void 0);
2776
+ });
2777
+ }
2684
2778
  })
2685
2779
  ]
2686
2780
  });
@@ -2768,6 +2862,28 @@ window.__ModuleLoader__.load({
2768
2862
  let scheduleTicket = 0;
2769
2863
  let scheduledCompletion;
2770
2864
  let latestRefresh = Promise.resolve();
2865
+ const viewCache = /* @__PURE__ */ new Map();
2866
+ let lastObservedIdentity;
2867
+ const sameIdentity = (left, right) => left?.sessionId === right.sessionId && left?.workspaceId === right.workspaceId;
2868
+ const workspaceTitleFor = (workspaceId) => input.workspaces.getSnapshot().items.find((candidate) => candidate.workspaceId === workspaceId)?.title;
2869
+ const valueFrom = (identity, data) => resolveWorktreeSessionContext({
2870
+ currentSessionId: identity.sessionId,
2871
+ currentWorkspaceId: identity.workspaceId,
2872
+ workspaces: input.workspaces.getSnapshot().items,
2873
+ branches: data.branches,
2874
+ worktrees: data.worktrees,
2875
+ bindings: data.bindings
2876
+ });
2877
+ const syncWorkspaceTitle = (identity) => {
2878
+ const current = store.getSnapshot();
2879
+ if (current.sessionId !== identity.sessionId || current.workspaceId !== identity.workspaceId || identity.workspaceId === void 0) return;
2880
+ const workspaceTitle = workspaceTitleFor(identity.workspaceId);
2881
+ if (current.workspaceTitle === workspaceTitle) return;
2882
+ store.set({
2883
+ ...current,
2884
+ workspaceTitle
2885
+ });
2886
+ };
2771
2887
  const setPending = (identity) => {
2772
2888
  if (identity.workspaceId === void 0) {
2773
2889
  store.set({
@@ -2783,12 +2899,22 @@ window.__ModuleLoader__.load({
2783
2899
  });
2784
2900
  return;
2785
2901
  }
2786
- const workspace = input.workspaces.getSnapshot().items.find((candidate) => candidate.workspaceId === identity.workspaceId);
2902
+ const cachedView = viewCache.get(identity.workspaceId);
2903
+ if (cachedView !== void 0) {
2904
+ store.set({
2905
+ status: "ready",
2906
+ ...identity.sessionId === void 0 ? {} : { sessionId: identity.sessionId },
2907
+ workspaceId: identity.workspaceId,
2908
+ workspaceTitle: workspaceTitleFor(identity.workspaceId),
2909
+ value: valueFrom(identity, cachedView)
2910
+ });
2911
+ return;
2912
+ }
2787
2913
  store.set({
2788
2914
  status: "loading",
2789
2915
  ...identity.sessionId === void 0 ? {} : { sessionId: identity.sessionId },
2790
2916
  workspaceId: identity.workspaceId,
2791
- workspaceTitle: workspace?.title,
2917
+ workspaceTitle: workspaceTitleFor(identity.workspaceId),
2792
2918
  value: notReady()
2793
2919
  });
2794
2920
  };
@@ -2801,6 +2927,7 @@ window.__ModuleLoader__.load({
2801
2927
  if (disposed) return;
2802
2928
  const requestGeneration = ++generation;
2803
2929
  const identity = identityFrom(input.sessions, input.workspaces);
2930
+ lastObservedIdentity = identity;
2804
2931
  setPending(identity);
2805
2932
  if (identity.workspaceId === void 0) return;
2806
2933
  const request = {
@@ -2822,19 +2949,13 @@ window.__ModuleLoader__.load({
2822
2949
  });
2823
2950
  return;
2824
2951
  }
2952
+ if (data.readiness.status === "ready") viewCache.set(request.workspaceId, data);
2825
2953
  store.set({
2826
2954
  status: "ready",
2827
2955
  ...request.sessionId === void 0 ? {} : { sessionId: request.sessionId },
2828
2956
  workspaceId: request.workspaceId,
2829
2957
  workspaceTitle: workspace?.title,
2830
- value: resolveWorktreeSessionContext({
2831
- currentSessionId: request.sessionId,
2832
- currentWorkspaceId: request.workspaceId,
2833
- workspaces: input.workspaces.getSnapshot().items,
2834
- branches: data.branches,
2835
- worktrees: data.worktrees,
2836
- bindings: data.bindings
2837
- })
2958
+ value: valueFrom(request, data)
2838
2959
  });
2839
2960
  } catch (error) {
2840
2961
  if (!matchesCurrent(request, requestGeneration)) return;
@@ -2857,15 +2978,22 @@ window.__ModuleLoader__.load({
2857
2978
  };
2858
2979
  const refresh = () => {
2859
2980
  cancelScheduledRefresh();
2981
+ lastObservedIdentity = identityFrom(input.sessions, input.workspaces);
2860
2982
  const completion = runRefresh();
2861
2983
  latestRefresh = completion;
2862
2984
  return completion;
2863
2985
  };
2864
2986
  const scheduleRefresh = () => {
2865
2987
  if (disposed) return;
2988
+ const identity = identityFrom(input.sessions, input.workspaces);
2989
+ if (sameIdentity(lastObservedIdentity, identity)) {
2990
+ syncWorkspaceTitle(identity);
2991
+ return;
2992
+ }
2993
+ lastObservedIdentity = identity;
2866
2994
  generation += 1;
2995
+ setPending(identity);
2867
2996
  if (scheduled) return;
2868
- setPending(identityFrom(input.sessions, input.workspaces));
2869
2997
  scheduled = true;
2870
2998
  const ticket = ++scheduleTicket;
2871
2999
  const completion = scheduledRefresh();
@@ -2912,6 +3040,7 @@ window.__ModuleLoader__.load({
2912
3040
  cancelScheduledRefresh();
2913
3041
  unsubscribeSessions();
2914
3042
  unsubscribeWorkspaces();
3043
+ viewCache.clear();
2915
3044
  store.set({
2916
3045
  status: "idle",
2917
3046
  value: notReady()