zidane-ui 9.2.3 → 9.4.0

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 (354) hide show
  1. package/dist/adapters/live.d.ts +8 -0
  2. package/dist/adapters/live.js +19 -8
  3. package/dist/adapters/server-composer-host.js +22 -9
  4. package/dist/adapters/server-git-host.js +5 -2
  5. package/dist/adapters/server-host.js +158 -27
  6. package/dist/adapters/server-machines-host.js +7 -0
  7. package/dist/adapters/server-media.d.ts +9 -1
  8. package/dist/adapters/server-media.js +14 -1
  9. package/dist/adapters/server-session-host.js +49 -0
  10. package/dist/adapters/server-settings-sections.js +4 -1
  11. package/dist/adapters/sse-host.js +3 -0
  12. package/dist/adapters/sse-protocol.d.ts +10 -0
  13. package/dist/appearance/ZoomIndicator.js +5 -8
  14. package/dist/chat/HostTranscript.d.ts +0 -12
  15. package/dist/chat/HostTranscript.js +20 -1
  16. package/dist/chat/SessionStreamsProvider.d.ts +9 -1
  17. package/dist/chat/SessionStreamsProvider.js +11 -2
  18. package/dist/chat/Transcript.d.ts +21 -11
  19. package/dist/chat/Transcript.js +346 -161
  20. package/dist/chat/composer/ModelOptionsPicker.js +6 -2
  21. package/dist/chat/composer/ModelPicker.d.ts +1 -1
  22. package/dist/chat/composer/PlacePicker.d.ts +3 -1
  23. package/dist/chat/composer/PlacePicker.js +5 -1
  24. package/dist/chat/composer/use-draft-target.js +15 -3
  25. package/dist/chat/headless/block-runs.js +26 -1
  26. package/dist/chat/headless/chip-views.js +1 -1
  27. package/dist/chat/headless/draft-target.d.ts +28 -1
  28. package/dist/chat/headless/draft-target.js +22 -1
  29. package/dist/chat/headless/host.d.ts +43 -7
  30. package/dist/chat/headless/hosts.d.ts +4 -0
  31. package/dist/chat/headless/index.d.ts +27 -26
  32. package/dist/chat/headless/index.js +15 -14
  33. package/dist/chat/headless/labels.d.ts +17 -0
  34. package/dist/chat/headless/labels.js +17 -0
  35. package/dist/chat/headless/markdown-chunks.d.ts +2 -1
  36. package/dist/chat/headless/markdown-chunks.js +12 -20
  37. package/dist/chat/headless/markdown-scan.d.ts +64 -0
  38. package/dist/chat/headless/markdown-scan.js +119 -0
  39. package/dist/chat/headless/markdown-stream.d.ts +64 -0
  40. package/dist/chat/headless/markdown-stream.js +143 -0
  41. package/dist/chat/headless/output-pager.d.ts +68 -0
  42. package/dist/chat/headless/output-pager.js +113 -0
  43. package/dist/chat/headless/prompt-origin.d.ts +2 -0
  44. package/dist/chat/headless/prompt-origin.js +6 -2
  45. package/dist/chat/headless/session-list.d.ts +10 -0
  46. package/dist/chat/headless/sidebar/activity.d.ts +14 -0
  47. package/dist/chat/headless/sidebar/activity.js +32 -0
  48. package/dist/chat/headless/sidebar/directory.d.ts +19 -2
  49. package/dist/chat/headless/sidebar/directory.js +19 -51
  50. package/dist/chat/headless/sidebar/environment.d.ts +15 -4
  51. package/dist/chat/headless/sidebar/environment.js +27 -9
  52. package/dist/chat/headless/sidebar/index.d.ts +2 -2
  53. package/dist/chat/headless/sidebar/index.js +2 -2
  54. package/dist/chat/headless/sidebar/labels.d.ts +19 -2
  55. package/dist/chat/headless/sidebar/labels.js +8 -1
  56. package/dist/chat/headless/sidebar/prewarm.d.ts +68 -0
  57. package/dist/chat/headless/sidebar/prewarm.js +114 -0
  58. package/dist/chat/headless/streams/actions.d.ts +4 -2
  59. package/dist/chat/headless/streams/actions.js +2 -1
  60. package/dist/chat/headless/streams/event-bytes.d.ts +17 -0
  61. package/dist/chat/headless/streams/event-bytes.js +46 -0
  62. package/dist/chat/headless/streams/live-events.d.ts +25 -1
  63. package/dist/chat/headless/streams/live-events.js +53 -2
  64. package/dist/chat/headless/streams/selectors.d.ts +3 -0
  65. package/dist/chat/headless/streams/selectors.js +8 -1
  66. package/dist/chat/headless/streams/session-streams.d.ts +15 -3
  67. package/dist/chat/headless/streams/session-streams.js +31 -3
  68. package/dist/chat/headless/streams/store.d.ts +45 -6
  69. package/dist/chat/headless/streams/store.js +85 -31
  70. package/dist/chat/headless/streams/transcript-map.d.ts +57 -0
  71. package/dist/chat/headless/streams/transcript-map.js +85 -0
  72. package/dist/chat/headless/streams/transcript.d.ts +4 -2
  73. package/dist/chat/headless/streams/transcript.js +19 -7
  74. package/dist/chat/headless/streams/types.d.ts +2 -1
  75. package/dist/chat/headless/transcript/batch.js +5 -1
  76. package/dist/chat/headless/transcript/blob-media.d.ts +15 -0
  77. package/dist/chat/headless/transcript/blob-media.js +23 -0
  78. package/dist/chat/headless/transcript/collapse.d.ts +10 -0
  79. package/dist/chat/headless/transcript/collapse.js +35 -6
  80. package/dist/chat/headless/transcript/derive.d.ts +98 -0
  81. package/dist/chat/headless/transcript/derive.js +89 -0
  82. package/dist/chat/headless/transcript/exchange-media.d.ts +3 -1
  83. package/dist/chat/headless/transcript/exchange-media.js +8 -5
  84. package/dist/chat/headless/transcript/fold-attachments.d.ts +2 -0
  85. package/dist/chat/headless/transcript/fold-attachments.js +3 -2
  86. package/dist/chat/headless/transcript/fold.d.ts +2 -1
  87. package/dist/chat/headless/transcript/fold.js +16 -6
  88. package/dist/chat/headless/transcript/incremental.d.ts +53 -0
  89. package/dist/chat/headless/transcript/incremental.js +181 -0
  90. package/dist/chat/headless/transcript/index.d.ts +2 -2
  91. package/dist/chat/headless/transcript/index.js +2 -2
  92. package/dist/chat/headless/transcript/nesting.js +2 -1
  93. package/dist/chat/headless/transcript/rail.d.ts +50 -1
  94. package/dist/chat/headless/transcript/rail.js +165 -23
  95. package/dist/chat/headless/transcript/rows.d.ts +5 -1
  96. package/dist/chat/headless/transcript/run-failures.js +2 -1
  97. package/dist/chat/headless/transcript/seams.d.ts +78 -0
  98. package/dist/chat/headless/transcript/seams.js +116 -0
  99. package/dist/chat/headless/transcript/tool-media.d.ts +6 -7
  100. package/dist/chat/headless/transcript/tool-media.js +27 -9
  101. package/dist/chat/index.d.ts +9 -8
  102. package/dist/chat/index.js +18 -17
  103. package/dist/chat/sidebar/ProjectIcon.js +1 -1
  104. package/dist/chat/sidebar/RowChips.js +2 -2
  105. package/dist/chat/sidebar/SessionSidebar.d.ts +6 -0
  106. package/dist/chat/sidebar/SessionSidebar.js +23 -16
  107. package/dist/chat/sidebar/SidebarFilterMenu.js +0 -1
  108. package/dist/chat/sidebar/SidebarFold.js +17 -16
  109. package/dist/chat/sidebar/SidebarFooter.d.ts +8 -5
  110. package/dist/chat/sidebar/SidebarFooter.js +6 -6
  111. package/dist/chat/sidebar/SidebarSessionRow.d.ts +7 -1
  112. package/dist/chat/sidebar/SidebarSessionRow.js +11 -8
  113. package/dist/chat/sidebar/session-menu.d.ts +4 -0
  114. package/dist/chat/sidebar/session-menu.js +14 -2
  115. package/dist/chat/sidebar/sidebar-live.js +28 -4
  116. package/dist/chat/sidebar/useInboxRows.js +6 -6
  117. package/dist/chat/sidebar/useInboxTriage.js +50 -47
  118. package/dist/chat/sidebar/useSessionSearch.js +19 -18
  119. package/dist/chat/testing/contract.d.ts +5 -3
  120. package/dist/chat/testing/contract.js +66 -1
  121. package/dist/chat/transcript/DiffLines.d.ts +6 -1
  122. package/dist/chat/transcript/DiffLines.js +35 -20
  123. package/dist/chat/transcript/EditDiffBlock.d.ts +5 -1
  124. package/dist/chat/transcript/EditDiffBlock.js +89 -30
  125. package/dist/chat/transcript/FileChip.js +28 -0
  126. package/dist/chat/transcript/LazyRow.d.ts +40 -40
  127. package/dist/chat/transcript/LazyRow.js +100 -149
  128. package/dist/chat/transcript/MermaidDiagram.js +2 -1
  129. package/dist/chat/transcript/PromptEcho.js +3 -11
  130. package/dist/chat/transcript/SessionChip.d.ts +11 -0
  131. package/dist/chat/transcript/SessionChip.js +34 -0
  132. package/dist/chat/transcript/SubagentBlock.js +3 -2
  133. package/dist/chat/transcript/TranscriptRail.d.ts +25 -2
  134. package/dist/chat/transcript/TranscriptRail.js +175 -17
  135. package/dist/chat/transcript/TranscriptRow.d.ts +4 -7
  136. package/dist/chat/transcript/TranscriptRow.js +4 -3
  137. package/dist/chat/transcript/actions.d.ts +37 -1
  138. package/dist/chat/transcript/actions.js +27 -1
  139. package/dist/chat/transcript/chip-details.d.ts +11 -0
  140. package/dist/chat/transcript/chip-details.js +17 -1
  141. package/dist/chat/transcript/clipped-output.d.ts +58 -0
  142. package/dist/chat/transcript/clipped-output.js +131 -0
  143. package/dist/chat/transcript/fold-attachments.js +10 -5
  144. package/dist/chat/transcript/fold-worker.js +5 -3
  145. package/dist/chat/transcript/fold.js +13 -4
  146. package/dist/chat/transcript/index.d.ts +11 -10
  147. package/dist/chat/transcript/index.js +10 -9
  148. package/dist/chat/transcript/markdown-cache.d.ts +17 -2
  149. package/dist/chat/transcript/markdown-cache.js +48 -4
  150. package/dist/chat/transcript/markdown.js +110 -55
  151. package/dist/chat/transcript/media-gallery.d.ts +3 -2
  152. package/dist/chat/transcript/media-gallery.js +19 -19
  153. package/dist/chat/transcript/messages.js +5 -4
  154. package/dist/chat/transcript/notices.js +2 -1
  155. package/dist/chat/transcript/prompt.d.ts +1 -1
  156. package/dist/chat/transcript/prompt.js +6 -4
  157. package/dist/chat/transcript/prose.js +2 -1
  158. package/dist/chat/transcript/root-items.d.ts +96 -0
  159. package/dist/chat/transcript/root-items.js +180 -0
  160. package/dist/chat/transcript/row-mount.d.ts +184 -0
  161. package/dist/chat/transcript/row-mount.js +532 -0
  162. package/dist/chat/transcript/row-parking.d.ts +152 -0
  163. package/dist/chat/transcript/row-parking.js +171 -0
  164. package/dist/chat/transcript/row-ui-state.d.ts +37 -0
  165. package/dist/chat/transcript/row-ui-state.js +53 -0
  166. package/dist/chat/transcript/run-rows.js +3 -2
  167. package/dist/chat/transcript/script-input.d.ts +1 -1
  168. package/dist/chat/transcript/tasks.js +3 -2
  169. package/dist/chat/transcript/tool-media.d.ts +4 -2
  170. package/dist/chat/transcript/tool-media.js +15 -7
  171. package/dist/chat/transcript/tool-parts.d.ts +27 -4
  172. package/dist/chat/transcript/tool-parts.js +31 -6
  173. package/dist/chat/transcript/tool-payload.js +26 -11
  174. package/dist/chat/transcript/tool-row.d.ts +2 -1
  175. package/dist/chat/transcript/tool-row.js +38 -19
  176. package/dist/chat/transcript/use-transcript-rows.d.ts +25 -8
  177. package/dist/chat/transcript/use-transcript-rows.js +28 -46
  178. package/dist/chat/transcript/useHistoryBackfill.d.ts +42 -0
  179. package/dist/chat/transcript/useHistoryBackfill.js +170 -0
  180. package/dist/chat/transcript/useStickToBottom.js +2 -3
  181. package/dist/chat/transcript/useTranscriptFind.js +2 -4
  182. package/dist/chat/transcript/useTranscriptScroll.d.ts +7 -4
  183. package/dist/chat/transcript/useTranscriptScroll.js +12 -1
  184. package/dist/chat/transcript/useTranscriptSearch.d.ts +2 -2
  185. package/dist/chat/transcript/useTranscriptSearch.js +35 -19
  186. package/dist/chat/transcript/useTranscriptSelectionCopy.d.ts +5 -5
  187. package/dist/chat/transcript/useTranscriptSelectionCopy.js +28 -7
  188. package/dist/chat/transcript/view-scope.d.ts +26 -6
  189. package/dist/chat/transcript/view-scope.js +106 -20
  190. package/dist/code/editor/FileTree.d.ts +2 -0
  191. package/dist/code/editor/FileTree.js +1 -1
  192. package/dist/code/editor/FileView.js +16 -25
  193. package/dist/code/editor/find/useFind.js +17 -17
  194. package/dist/code/editor/useCodeDocument.js +22 -19
  195. package/dist/code/editor/useDetachCleanup.js +4 -3
  196. package/dist/code/use-highlighted-html.js +12 -13
  197. package/dist/components/IconButton.d.ts +3 -1
  198. package/dist/components/IconButton.js +7 -2
  199. package/dist/components/IconButtonTip.d.ts +3 -1
  200. package/dist/components/IconButtonTip.js +2 -1
  201. package/dist/components/RowActionsMenu.js +7 -14
  202. package/dist/components/Tooltip.d.ts +4 -1
  203. package/dist/components/Tooltip.js +8 -6
  204. package/dist/components/assign-ref.d.ts +8 -0
  205. package/dist/components/assign-ref.js +12 -0
  206. package/dist/components/floating/FloatingSurface.js +2 -2
  207. package/dist/components/floating/HoverCard.js +32 -14
  208. package/dist/components/floating/Popover.js +4 -7
  209. package/dist/components/floating/useAnchoredPosition.d.ts +5 -3
  210. package/dist/components/floating/useAnchoredPosition.js +7 -7
  211. package/dist/components/object-key.d.ts +7 -0
  212. package/dist/components/object-key.js +18 -0
  213. package/dist/components/palette/PaletteList.js +2 -7
  214. package/dist/components/tooltip-arming.d.ts +3 -0
  215. package/dist/components/tooltip-arming.js +8 -1
  216. package/dist/core.css +3 -3
  217. package/dist/dist/{index-E1Z0aPmi.d.ts → index-BheVJOLc.d.ts} +3 -1
  218. package/dist/dist/index.d.ts +2 -2
  219. package/dist/files/FilesTab.js +0 -1
  220. package/dist/files/TreeColumn.d.ts +2 -4
  221. package/dist/files/TreeColumn.js +0 -5
  222. package/dist/files/headless/host.d.ts +3 -7
  223. package/dist/files/headless/labels.d.ts +0 -1
  224. package/dist/files/headless/labels.js +0 -1
  225. package/dist/files/headless/workspace-diff.js +1 -1
  226. package/dist/files/useCodeReview.js +1 -3
  227. package/dist/files/useFilesDiagnostics.d.ts +1 -1
  228. package/dist/files/useFilesDiagnostics.js +4 -11
  229. package/dist/files/useOpenFiles.js +9 -12
  230. package/dist/files/useWorkspace.d.ts +5 -7
  231. package/dist/files/useWorkspace.js +4 -15
  232. package/dist/git/GitBar.js +5 -3
  233. package/dist/git/MoveSessionDialog.d.ts +18 -8
  234. package/dist/git/MoveSessionDialog.js +32 -53
  235. package/dist/git/MoveToDialog.d.ts +61 -0
  236. package/dist/git/MoveToDialog.js +240 -0
  237. package/dist/git/SandboxManager.js +9 -4
  238. package/dist/git/SyncChip.js +11 -4
  239. package/dist/git/TeleportSessionDialog.d.ts +69 -0
  240. package/dist/git/TeleportSessionDialog.js +440 -0
  241. package/dist/git/headless/host.d.ts +14 -0
  242. package/dist/git/headless/index.d.ts +2 -1
  243. package/dist/git/headless/index.js +2 -1
  244. package/dist/git/headless/labels.d.ts +44 -1
  245. package/dist/git/headless/labels.js +50 -0
  246. package/dist/git/headless/sandboxes.d.ts +1 -1
  247. package/dist/git/headless/sandboxes.js +4 -3
  248. package/dist/git/headless/teleport.d.ts +76 -0
  249. package/dist/git/headless/teleport.js +19 -0
  250. package/dist/git/index.d.ts +4 -2
  251. package/dist/git/index.js +4 -2
  252. package/dist/git/useEnvironmentChoices.d.ts +5 -2
  253. package/dist/git/useEnvironmentChoices.js +12 -4
  254. package/dist/hooks/useLatest.d.ts +8 -0
  255. package/dist/hooks/useLatest.js +17 -0
  256. package/dist/hooks/useMinuteTick.d.ts +6 -2
  257. package/dist/hooks/useMinuteTick.js +12 -6
  258. package/dist/hooks/useNearViewport.js +11 -8
  259. package/dist/index.d.ts +3 -2
  260. package/dist/index.js +2 -1
  261. package/dist/keybindings/KeybindingsProvider.js +3 -4
  262. package/dist/keybindings/headless/catalog.d.ts +1 -1
  263. package/dist/keybindings/headless/catalog.js +18 -0
  264. package/dist/machines/AddServerForm.js +55 -3
  265. package/dist/machines/Banners.d.ts +2 -2
  266. package/dist/machines/Banners.js +3 -3
  267. package/dist/machines/DaemonMenu.js +1 -3
  268. package/dist/machines/HostsSection.js +5 -1
  269. package/dist/machines/OrganizationPanel.d.ts +25 -0
  270. package/dist/machines/OrganizationPanel.js +266 -0
  271. package/dist/machines/PersonalLayerPanel.d.ts +32 -0
  272. package/dist/machines/PersonalLayerPanel.js +360 -0
  273. package/dist/machines/headless/fixture-host.d.ts +10 -0
  274. package/dist/machines/headless/fixture-host.js +44 -0
  275. package/dist/machines/headless/host.d.ts +21 -1
  276. package/dist/machines/headless/index.d.ts +3 -1
  277. package/dist/machines/headless/index.js +3 -1
  278. package/dist/machines/headless/labels.d.ts +55 -0
  279. package/dist/machines/headless/labels.js +58 -1
  280. package/dist/machines/headless/layer.d.ts +64 -0
  281. package/dist/machines/headless/layer.js +56 -0
  282. package/dist/machines/headless/organization.d.ts +38 -0
  283. package/dist/machines/headless/organization.js +44 -0
  284. package/dist/machines/index.d.ts +3 -1
  285. package/dist/machines/index.js +3 -1
  286. package/dist/machines/testing/contract.d.ts +25 -1
  287. package/dist/machines/testing/contract.js +97 -1
  288. package/dist/motion/grow.js +12 -13
  289. package/dist/motion/swap.js +2 -5
  290. package/dist/motion/use-flip-list.d.ts +14 -0
  291. package/dist/motion/use-flip-list.js +17 -12
  292. package/dist/palette/headless/app-sources.js +37 -0
  293. package/dist/palette/headless/labels.js +3 -0
  294. package/dist/server/sse-handler.js +25 -2
  295. package/dist/session/DiffFileTree.js +1 -4
  296. package/dist/session/OpenSessionsDialog.d.ts +46 -0
  297. package/dist/session/OpenSessionsDialog.js +170 -0
  298. package/dist/session/PlanTracker.js +1 -2
  299. package/dist/session/ProjectHome.js +10 -9
  300. package/dist/session/RemindersPanel.js +10 -12
  301. package/dist/session/SecretsPanel.js +2 -1
  302. package/dist/session/SessionHeader.js +1 -0
  303. package/dist/session/SessionPeopleStack.d.ts +23 -0
  304. package/dist/session/SessionPeopleStack.js +65 -0
  305. package/dist/session/SessionPlaceMenu.js +5 -4
  306. package/dist/session/ShareSessionDialog.d.ts +32 -0
  307. package/dist/session/ShareSessionDialog.js +342 -0
  308. package/dist/session/TypingLine.d.ts +22 -0
  309. package/dist/session/TypingLine.js +31 -0
  310. package/dist/session/headless/host.d.ts +40 -1
  311. package/dist/session/headless/index.d.ts +4 -2
  312. package/dist/session/headless/index.js +3 -1
  313. package/dist/session/headless/labels.d.ts +49 -0
  314. package/dist/session/headless/labels.js +56 -0
  315. package/dist/session/headless/people.d.ts +29 -0
  316. package/dist/session/headless/people.js +53 -0
  317. package/dist/session/headless/place.d.ts +5 -0
  318. package/dist/session/headless/place.js +5 -1
  319. package/dist/session/headless/typing.d.ts +37 -0
  320. package/dist/session/headless/typing.js +60 -0
  321. package/dist/session/index.d.ts +5 -1
  322. package/dist/session/index.js +5 -1
  323. package/dist/settings/headless/fixture-performance.js +4 -2
  324. package/dist/settings/headless/performance.d.ts +4 -0
  325. package/dist/settings/headless/search.d.ts +1 -1
  326. package/dist/settings/headless/sections-host.d.ts +7 -2
  327. package/dist/settings/section.d.ts +15 -3
  328. package/dist/settings/section.js +15 -3
  329. package/dist/settings/sections/environments/EnvironmentsSection.js +30 -6
  330. package/dist/settings/sections/keybindings/labels.d.ts +3 -0
  331. package/dist/settings/sections/keybindings/labels.js +3 -0
  332. package/dist/settings/sections/keybindings/rows.js +12 -0
  333. package/dist/settings/sections/logs/LogsSection.js +5 -8
  334. package/dist/settings/sections/performance/PerformanceSection.js +8 -1
  335. package/dist/settings/sections/performance/labels.d.ts +2 -0
  336. package/dist/settings/sections/performance/labels.js +2 -0
  337. package/dist/styles.css +65 -9
  338. package/dist/terminal/HostTerminalSurface.js +28 -30
  339. package/dist/terminal/TerminalPanel.js +4 -12
  340. package/dist/terminal/TerminalProvider.d.ts +10 -2
  341. package/dist/terminal/TerminalProvider.js +10 -2
  342. package/dist/terminal/headless/labels.d.ts +0 -1
  343. package/dist/terminal/headless/labels.js +1 -2
  344. package/dist/terminal/headless/store.js +5 -1
  345. package/dist/views/headless/answers.d.ts +8 -2
  346. package/dist/views/headless/answers.js +58 -1
  347. package/dist/views/headless/placement.d.ts +78 -0
  348. package/dist/views/headless/placement.js +154 -44
  349. package/dist/workspace/LayoutBudget.js +1 -7
  350. package/package.json +2 -2
  351. package/src/styles/chat.css +3 -1
  352. package/src/styles/palette.css +3 -3
  353. package/src/styles/transcript.css +50 -5
  354. /package/dist/dist/{index-De9AbmxS.d.ts → index-ttmMvjgM.d.ts} +0 -0
@@ -0,0 +1,440 @@
1
+ import { useOptionalModal } from "../app/ModalProvider.js";
2
+ import { toast } from "../app/toast.js";
3
+ import { buttonClass } from "../components/button.js";
4
+ import { Checkbox, MetaChip } from "../components/Form.js";
5
+ import { MenuNote, MenuRow } from "../components/Menu.js";
6
+ import { Notice } from "../components/Notice.js";
7
+ import { errorMessage } from "../components/report-error.js";
8
+ import { useGitHost, useGitLabels } from "./GitProvider.js";
9
+ import { canTeleportTo, movingCount, shownRows, teleportStoppable, workTarget } from "./headless/teleport.js";
10
+ import { RemoteFolderBrowser } from "./RemoteFolderPicker.js";
11
+ import { useCallback, useEffect, useRef, useState } from "react";
12
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
13
+ // src/git/TeleportSessionDialog.tsx
14
+ const TITLE_ID = "teleport-session-title";
15
+ /** Why a target can't take the session, for a notice's details: its error, else its first blocking row. */
16
+ function whyNot(target) {
17
+ const detail = target?.error ?? shownRows(target?.rows ?? [])[0]?.message;
18
+ return detail ? { detail } : {};
19
+ }
20
+ /**
21
+ * The teleport dialog: which host, what changes and what comes along, then teleport.
22
+ *
23
+ * @param props - The {@link TeleportSessionDialogProps}.
24
+ */
25
+ function TeleportSessionDialog({ subject, onDone, onCancel, onBusy, onFailed, target, onBack, then, titleId = TITLE_ID, className, style }) {
26
+ const host = useGitHost();
27
+ const labels = useGitLabels();
28
+ const [targets, setTargets] = useState(null);
29
+ const [picked, setPicked] = useState(null);
30
+ const [preview, setPreview] = useState(null);
31
+ const [carry, setCarry] = useState(true);
32
+ const [checkout, setCheckout] = useState("");
33
+ const [folder, setFolder] = useState("");
34
+ const [ticked, setTicked] = useState(/* @__PURE__ */ new Set());
35
+ const [busy, setBusy] = useState(false);
36
+ const [error, setError] = useState(null);
37
+ const [notice, setNotice] = useState(null);
38
+ /** Browsing the target's folders (`GitHost.listFolders`) for the session's folder there. */
39
+ const [browsing, setBrowsing] = useState(false);
40
+ /** Where the teleport in flight is (`null`: not started yet), and its stop. */
41
+ const [progress, setProgress] = useState(null);
42
+ const stopRef = useRef(null);
43
+ const [stopped, setStopped] = useState(false);
44
+ const { sessionId } = subject;
45
+ const listTargets = host?.teleportTargets;
46
+ useEffect(() => {
47
+ if (!listTargets) return void 0;
48
+ let live = true;
49
+ listTargets(sessionId).then((found) => {
50
+ if (!live) return;
51
+ setTargets(found);
52
+ const chosen = target ? found.find((t) => t.hostId === target) : void 0;
53
+ if (chosen && canTeleportTo(chosen)) setPicked(chosen);
54
+ else if (target) setError({
55
+ message: labels.gitTeleportCannot(chosen?.name ?? target),
56
+ ...whyNot(chosen)
57
+ });
58
+ }).catch((err) => {
59
+ if (!live) return;
60
+ setTargets([]);
61
+ setError({
62
+ message: labels.gitTeleportListFailed,
63
+ detail: errorMessage(err)
64
+ });
65
+ });
66
+ return () => {
67
+ live = false;
68
+ };
69
+ }, [
70
+ listTargets,
71
+ sessionId,
72
+ labels
73
+ ]);
74
+ const readPreview = host?.teleportPreview;
75
+ useEffect(() => {
76
+ if (!picked || !readPreview) return void 0;
77
+ let live = true;
78
+ readPreview(sessionId).then((found) => live && setPreview(found)).catch(() => live && setPreview(null));
79
+ return () => {
80
+ live = false;
81
+ };
82
+ }, [
83
+ picked,
84
+ readPreview,
85
+ sessionId
86
+ ]);
87
+ const work = preview?.repo && movingCount(preview) > 0 ? preview : null;
88
+ const carrying = Boolean(work && carry);
89
+ const ready = picked !== null && (carrying ? checkout.trim() !== "" : folder.trim() !== "");
90
+ const pick = (target) => {
91
+ setPicked(target);
92
+ setPreview(null);
93
+ setTicked(/* @__PURE__ */ new Set());
94
+ setError(null);
95
+ };
96
+ const browse = picked && !picked.remote && host?.pickFolder ? () => void host.pickFolder?.().then((chosen) => chosen && setFolder(chosen), () => void 0) : picked && host?.listFolders ? () => setBrowsing(true) : void 0;
97
+ const back = () => {
98
+ if (browsing) return setBrowsing(false);
99
+ if (onBack && (target || !picked)) return onBack();
100
+ setPicked(null);
101
+ };
102
+ const toggle = (path) => setTicked((current) => {
103
+ const next = new Set(current);
104
+ if (next.has(path)) next.delete(path);
105
+ else next.add(path);
106
+ return next;
107
+ });
108
+ async function submit() {
109
+ if (!picked || !host?.teleportSession) return;
110
+ setBusy(true);
111
+ onBusy?.(true);
112
+ setError(null);
113
+ setStopped(false);
114
+ setProgress(null);
115
+ const stop = new AbortController();
116
+ stopRef.current = stop;
117
+ const place = carrying && work ? workTarget(checkout.trim(), work, sessionId) : void 0;
118
+ const outcome = await host.teleportSession(sessionId, {
119
+ hostId: picked.hostId,
120
+ ...place ? { work: place } : {},
121
+ ...carrying && ticked.size > 0 ? { carryIgnored: [...ticked] } : {},
122
+ ...!carrying && folder.trim() ? { cwd: folder.trim() } : {}
123
+ }, {
124
+ onProgress: setProgress,
125
+ signal: stop.signal
126
+ }).catch((err) => ({
127
+ ok: false,
128
+ message: errorMessage(err)
129
+ }));
130
+ stopRef.current = null;
131
+ setBusy(false);
132
+ setProgress(null);
133
+ onBusy?.(false);
134
+ if (!outcome.ok && stop.signal.aborted) {
135
+ setStopped(true);
136
+ onFailed?.(labels.gitTeleportStopped);
137
+ return;
138
+ }
139
+ if (!outcome.ok) {
140
+ const headline = "unknown" in outcome && outcome.unknown ? labels.gitTeleportUnknown : labels.gitTeleportFailed;
141
+ onFailed?.(headline, outcome.message);
142
+ return setError({
143
+ message: headline,
144
+ detail: outcome.message
145
+ });
146
+ }
147
+ const there = place?.path ?? folder.trim();
148
+ const done = {
149
+ sessionId: outcome.sessionId,
150
+ hostId: picked.hostId,
151
+ ...there ? { cwd: there } : {}
152
+ };
153
+ if (outcome.notice) return setNotice({
154
+ done,
155
+ text: outcome.notice
156
+ });
157
+ onDone(done);
158
+ }
159
+ const mark = (target) => target.error !== void 0 || target.readiness === "blocked" ? /* @__PURE__ */ jsx(MetaChip, {
160
+ tone: "warn",
161
+ children: labels.gitTeleportMarkBlocked
162
+ }) : target.readiness === "changes" ? /* @__PURE__ */ jsx(MetaChip, {
163
+ tone: "warn",
164
+ children: labels.gitTeleportMarkChanges
165
+ }) : target.readiness === "fixable" ? /* @__PURE__ */ jsx(MetaChip, { children: labels.gitTeleportMarkFixable }) : void 0;
166
+ return /* @__PURE__ */ jsxs("div", {
167
+ className: `zg-modal-panel zg-float w-[480px] max-w-[92vw] flex flex-col overflow-hidden${className ? ` ${className}` : ""}`,
168
+ style,
169
+ "data-testid": "teleport-session-dialog",
170
+ onMouseDown: (e) => e.stopPropagation(),
171
+ children: [/* @__PURE__ */ jsxs("div", {
172
+ className: "px-5 pt-4 pb-4 flex flex-col gap-3 min-h-0",
173
+ children: [
174
+ /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h2", {
175
+ id: titleId,
176
+ className: "m-0 text-sm font-semibold text-[var(--zg-text)] zg-balance",
177
+ children: labels.gitTeleportTitle
178
+ }), /* @__PURE__ */ jsxs("p", {
179
+ className: "m-0 mt-1 text-zg-ui text-[var(--zg-text-muted)]",
180
+ children: [picked ? labels.gitTeleportConfirm(picked.name) : labels.gitTeleportWhere, picked && then ? ` ${labels.gitTeleportThen(then)}` : ""]
181
+ })] }),
182
+ !picked && target && targets === null && /* @__PURE__ */ jsx(MenuNote, { children: labels.gitTeleportLoading }),
183
+ !picked && !target && /* @__PURE__ */ jsx("div", {
184
+ role: "menu",
185
+ "aria-label": labels.gitTeleportWhere,
186
+ className: "flex flex-col max-h-[min(360px,50vh)] overflow-y-auto",
187
+ children: targets === null ? /* @__PURE__ */ jsx(MenuNote, { children: labels.gitTeleportLoading }) : targets.length === 0 ? /* @__PURE__ */ jsx(MenuNote, { children: labels.gitTeleportNone }) : targets.map((target) => /* @__PURE__ */ jsx(MenuRow, {
188
+ "data-testid": `teleport-target-${target.hostId}`,
189
+ icon: /* @__PURE__ */ jsx("span", {
190
+ "aria-hidden": true,
191
+ className: target.remote ? "i-ph-hard-drives" : "i-ph-laptop"
192
+ }),
193
+ title: target.name,
194
+ description: target.error ?? shownRows(target.rows)[0]?.message,
195
+ size: "lg",
196
+ disabled: !canTeleportTo(target),
197
+ trailing: mark(target),
198
+ onClick: () => pick(target)
199
+ }, target.hostId))
200
+ }),
201
+ picked && !notice && /* @__PURE__ */ jsxs("div", {
202
+ className: "flex flex-col gap-2",
203
+ children: [
204
+ shownRows(picked.rows).length > 0 && /* @__PURE__ */ jsx("ul", {
205
+ className: "m-0 pl-4 flex flex-col gap-1 text-zg-label text-[var(--zg-text-muted)]",
206
+ "data-testid": "teleport-rows",
207
+ children: shownRows(picked.rows).map((row) => /* @__PURE__ */ jsx("li", { children: row.message }, `${row.subject.kind}:${row.subject.name}`))
208
+ }),
209
+ preview && !preview.repo && /* @__PURE__ */ jsx("p", {
210
+ className: "m-0 text-zg-label text-[var(--zg-text-muted)]",
211
+ children: labels.gitTeleportNotRepo
212
+ }),
213
+ preview?.repo && !work && /* @__PURE__ */ jsx("p", {
214
+ className: "m-0 text-zg-label text-[var(--zg-text-muted)]",
215
+ children: labels.gitTeleportNoWork
216
+ }),
217
+ work && /* @__PURE__ */ jsxs("button", {
218
+ type: "button",
219
+ role: "checkbox",
220
+ "aria-checked": carry,
221
+ "data-testid": "teleport-carry-work",
222
+ disabled: busy,
223
+ onClick: () => setCarry((on) => !on),
224
+ className: "flex items-start gap-2 bg-transparent border-0 p-0 text-left text-zg-label text-[var(--zg-text)] cursor-pointer disabled:cursor-default",
225
+ children: [/* @__PURE__ */ jsx(Checkbox, { checked: carry }), /* @__PURE__ */ jsx("span", { children: labels.gitTeleportCarryWork(movingCount(work)) })]
226
+ }),
227
+ carrying && /* @__PURE__ */ jsxs("label", {
228
+ className: "flex items-center gap-2 min-w-0",
229
+ children: [/* @__PURE__ */ jsx("span", {
230
+ className: "text-xs text-[var(--zg-text-muted)] shrink-0",
231
+ children: labels.gitTeleportCheckout(picked.name)
232
+ }), /* @__PURE__ */ jsx("input", {
233
+ value: checkout,
234
+ onChange: (e) => setCheckout(e.target.value),
235
+ placeholder: labels.gitTeleportCheckoutPlaceholder,
236
+ "data-testid": "teleport-checkout",
237
+ disabled: busy,
238
+ spellCheck: false,
239
+ className: "zg-well zg-meta flex-1 min-w-0 h-7 px-2.5 text-zg-label placeholder:text-[var(--zg-text-subtle)]"
240
+ })]
241
+ }),
242
+ !carrying && !browsing && /* @__PURE__ */ jsxs("div", {
243
+ className: "flex items-center gap-2 min-w-0",
244
+ children: [/* @__PURE__ */ jsxs("label", {
245
+ className: "flex items-center gap-2 min-w-0 flex-1",
246
+ children: [/* @__PURE__ */ jsx("span", {
247
+ className: "text-xs text-[var(--zg-text-muted)] shrink-0",
248
+ children: labels.gitTeleportFolder(picked.name)
249
+ }), /* @__PURE__ */ jsx("input", {
250
+ value: folder,
251
+ onChange: (e) => setFolder(e.target.value),
252
+ placeholder: labels.gitTeleportFolderPlaceholder,
253
+ "data-testid": "teleport-folder",
254
+ disabled: busy,
255
+ spellCheck: false,
256
+ className: "zg-well zg-meta flex-1 min-w-0 h-7 px-2.5 text-zg-label placeholder:text-[var(--zg-text-subtle)]"
257
+ })]
258
+ }), browse && /* @__PURE__ */ jsx("button", {
259
+ type: "button",
260
+ "data-testid": "teleport-browse",
261
+ disabled: busy,
262
+ onClick: browse,
263
+ className: buttonClass({
264
+ variant: "ghost",
265
+ size: "xs"
266
+ }),
267
+ children: labels.gitTeleportBrowse
268
+ })]
269
+ }),
270
+ !carrying && browsing && /* @__PURE__ */ jsx(RemoteFolderBrowser, {
271
+ ...picked.remote ? { hostId: picked.hostId } : {},
272
+ start: folder.trim() || null,
273
+ onUse: (path) => {
274
+ setFolder(path);
275
+ setBrowsing(false);
276
+ }
277
+ }),
278
+ carrying && work && work.ignored.length > 0 && /* @__PURE__ */ jsxs("div", {
279
+ className: "flex flex-col gap-1",
280
+ "data-testid": "teleport-ignored",
281
+ children: [/* @__PURE__ */ jsx("p", {
282
+ className: "m-0 text-zg-label text-[var(--zg-text-muted)]",
283
+ children: labels.gitTeleportIgnored
284
+ }), /* @__PURE__ */ jsx("div", {
285
+ className: "flex flex-col gap-1 max-h-[140px] overflow-y-auto",
286
+ children: work.ignored.filter((entry) => !entry.path.endsWith("/")).map((entry) => /* @__PURE__ */ jsxs("button", {
287
+ type: "button",
288
+ role: "checkbox",
289
+ "aria-checked": ticked.has(entry.path),
290
+ disabled: busy,
291
+ onClick: () => toggle(entry.path),
292
+ className: "flex items-center gap-2 bg-transparent border-0 p-0 text-left text-zg-label text-[var(--zg-text)] cursor-pointer disabled:cursor-default",
293
+ children: [
294
+ /* @__PURE__ */ jsx(Checkbox, { checked: ticked.has(entry.path) }),
295
+ /* @__PURE__ */ jsx("span", {
296
+ className: "zg-meta truncate",
297
+ children: entry.path
298
+ }),
299
+ entry.secret && /* @__PURE__ */ jsx(MetaChip, {
300
+ tone: "warn",
301
+ children: labels.gitTeleportSecret
302
+ })
303
+ ]
304
+ }, entry.path))
305
+ })]
306
+ }),
307
+ carrying && work?.lfs && /* @__PURE__ */ jsx("p", {
308
+ className: "m-0 text-zg-label text-[var(--zg-text-muted)]",
309
+ children: labels.gitTeleportLfs
310
+ }),
311
+ carrying && work && work.submodules.length > 0 && /* @__PURE__ */ jsx("p", {
312
+ className: "m-0 text-zg-label text-[var(--zg-text-muted)]",
313
+ children: labels.gitTeleportSubmodules(work.submodules.length)
314
+ }),
315
+ /* @__PURE__ */ jsx("p", {
316
+ className: "m-0 text-zg-label leading-relaxed text-[var(--zg-text-muted)]",
317
+ children: labels.gitTeleportDetail
318
+ })
319
+ ]
320
+ }),
321
+ busy && /* @__PURE__ */ jsxs("p", {
322
+ role: "status",
323
+ "aria-live": "polite",
324
+ "data-testid": "teleport-progress",
325
+ className: "m-0 flex items-center gap-2 text-zg-label text-[var(--zg-text-muted)]",
326
+ children: [/* @__PURE__ */ jsx("span", {
327
+ "aria-hidden": true,
328
+ className: "i-ph-circle-notch animate-spin text-zg-meta shrink-0"
329
+ }), /* @__PURE__ */ jsx("span", {
330
+ className: "tabular-nums",
331
+ children: progress ? labels.gitTeleportStage(progress.stage, progress.done, progress.total) : labels.gitTeleporting
332
+ })]
333
+ }),
334
+ stopped && /* @__PURE__ */ jsx(Notice, {
335
+ tone: "info",
336
+ children: labels.gitTeleportStopped
337
+ }),
338
+ notice && /* @__PURE__ */ jsx(Notice, {
339
+ tone: "warning",
340
+ detail: notice.text,
341
+ children: labels.gitTeleportSourceNotTold
342
+ }),
343
+ error && /* @__PURE__ */ jsx(Notice, {
344
+ tone: "error",
345
+ ...error.detail ? { detail: error.detail } : {},
346
+ children: error.message
347
+ })
348
+ ]
349
+ }), /* @__PURE__ */ jsx("footer", {
350
+ className: "flex items-center justify-end gap-2 px-5 py-3 bg-[var(--zg-tray)]",
351
+ children: notice ? /* @__PURE__ */ jsx("button", {
352
+ type: "button",
353
+ "data-testid": "teleport-done",
354
+ onClick: () => onDone(notice.done),
355
+ className: buttonClass({ variant: "solid" }),
356
+ children: labels.gitMoveDone
357
+ }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
358
+ (picked || onBack) && /* @__PURE__ */ jsx("button", {
359
+ type: "button",
360
+ onClick: back,
361
+ disabled: busy,
362
+ className: `${buttonClass({ variant: "ghost" })} mr-auto`,
363
+ children: labels.gitMoveBack
364
+ }),
365
+ busy ? /* @__PURE__ */ jsx("button", {
366
+ type: "button",
367
+ "data-testid": "teleport-stop",
368
+ onClick: () => stopRef.current?.abort(),
369
+ disabled: !teleportStoppable(progress),
370
+ className: buttonClass({ variant: "secondary" }),
371
+ children: labels.gitTeleportStop
372
+ }) : /* @__PURE__ */ jsx("button", {
373
+ type: "button",
374
+ onClick: onCancel,
375
+ className: buttonClass({ variant: "secondary" }),
376
+ children: labels.gitMoveCancel
377
+ }),
378
+ picked && /* @__PURE__ */ jsx("button", {
379
+ type: "button",
380
+ "data-testid": "teleport-submit",
381
+ onClick: () => void submit(),
382
+ disabled: !ready || busy,
383
+ className: buttonClass({ variant: "solid" }),
384
+ children: busy ? labels.gitTeleporting : labels.gitTeleportSubmit
385
+ })
386
+ ] })
387
+ })]
388
+ });
389
+ }
390
+ /**
391
+ * Opens the teleport dialog over the `GitHost` in context. `undefined` without
392
+ * what it needs (`GitHost.teleportTargets` and `teleportSession`, a modal
393
+ * layer): hide the control that calls it. Resolves where the session went, or
394
+ * `null` when closed.
395
+ */
396
+ function useTeleportSession() {
397
+ const host = useGitHost();
398
+ const modal = useOptionalModal();
399
+ const openLayer = modal?.openLayer;
400
+ const closeLayer = modal?.closeLayer;
401
+ const offered = Boolean(host?.teleportTargets && host.teleportSession && openLayer && closeLayer);
402
+ const open = useCallback((subject) => new Promise((resolve) => {
403
+ if (!openLayer || !closeLayer) return resolve(null);
404
+ const previousFocus = document.activeElement instanceof HTMLElement ? document.activeElement : null;
405
+ let running = false;
406
+ let dismissed = false;
407
+ const settle = (done) => {
408
+ resolve(done);
409
+ requestAnimationFrame(() => previousFocus?.focus());
410
+ };
411
+ openLayer(/* @__PURE__ */ jsx(TeleportSessionDialog, {
412
+ subject,
413
+ onBusy: (busy) => {
414
+ running = busy;
415
+ },
416
+ onFailed: (message, detail) => {
417
+ if (dismissed) {
418
+ toast.error(message, detail ? { description: detail } : void 0);
419
+ settle(null);
420
+ }
421
+ },
422
+ onDone: (done) => {
423
+ if (!dismissed) closeLayer();
424
+ settle(done);
425
+ },
426
+ onCancel: () => {
427
+ closeLayer();
428
+ settle(null);
429
+ }
430
+ }), {
431
+ onDismiss: () => {
432
+ if (running) dismissed = true;
433
+ else settle(null);
434
+ },
435
+ labelledBy: TITLE_ID
436
+ });
437
+ }), [openLayer, closeLayer]);
438
+ return offered ? open : void 0;
439
+ }
440
+ export { TeleportSessionDialog, useTeleportSession };
@@ -11,7 +11,9 @@
11
11
  * `zidane-ui/git/testing` in memory. All three run
12
12
  * `zidane-ui/git/testing/contract`.
13
13
  */
14
+ import { TeleportCallView, TeleportOutcome, TeleportRequestView, TeleportTargetView } from "./teleport.js";
14
15
  import { EnvironmentDescriptor } from "zidane/chat";
16
+ import { WorkPreview } from "zidane/ipc";
15
17
  /** A local branch: when it last moved, and how it stands against the default branch. */
16
18
  export interface GitBranch {
17
19
  /** The branch name. */
@@ -265,6 +267,12 @@ export interface GitEnvironmentQuery {
265
267
  cwd?: string;
266
268
  /** The saved server the session would run on (absent: this host). */
267
269
  hostId?: string;
270
+ /**
271
+ * What the host can run, whatever the folder: a kind is unavailable only for a
272
+ * reason of the machine (no API key, the tool not installed). For a default that
273
+ * applies to many folders. Default: what `cwd` can run.
274
+ */
275
+ machineOnly?: boolean;
268
276
  }
269
277
  /** Where {@link GitHost.listFolders} lists. */
270
278
  export interface GitFolderQuery {
@@ -366,6 +374,12 @@ export interface GitHost {
366
374
  * machine's kinds). Nothing is copied; the session's terminals and background tasks stop. Absent: no "Move to…".
367
375
  */
368
376
  moveSession?: (sessionId: string, target: GitMoveTarget) => Promise<GitMoveResult>;
377
+ /** Every other host the session could teleport to, compared with it (docs/TELEPORT.md). Absent: no "Teleport to…". */
378
+ teleportTargets?: (sessionId: string) => Promise<readonly TeleportTargetView[]>;
379
+ /** What would move from the session's folder through git, and what would not. Absent: work is never carried. */
380
+ teleportPreview?: (sessionId: string) => Promise<WorkPreview>;
381
+ /** Teleports the session; resolves its id on the target, or why it failed (nothing changed then). */
382
+ teleportSession?: (sessionId: string, request: TeleportRequestView, options?: TeleportCallView) => Promise<TeleportOutcome>;
369
383
  /** The environment kinds a new session can run in. Absent: the app supplies them itself. */
370
384
  environments?: (query: GitEnvironmentQuery) => Promise<readonly EnvironmentDescriptor[]>;
371
385
  /**
@@ -6,4 +6,5 @@ import { DraftRemoteClone, resolveRemoteClone } from "./remote-clone.js";
6
6
  import { SandboxFilter, SandboxesSource, sandboxCounts, sandboxMatches, sandboxSpecs, sortSandboxes } from "./sandboxes.js";
7
7
  import { SWITCHER_SECTIONS, SwitcherCache, SwitcherEntry, SwitcherSection, SwitcherSectionId, ageIsDuration, clockTime, compactCount, countInLabel, createSwitcherCache, prMatches, readPullRequests, switcherCacheOf, switcherCreates, switcherKey, switcherSections } from "./switcher.js";
8
8
  import { GitSyncAction, syncAction, syncSummary, syncTooltip } from "./sync.js";
9
- export { DEFAULT_GIT_LABELS, DraftEnvironment, DraftRemoteClone, EnvironmentMachine, GitActionResult, GitBranch, GitBranchPullRequest, GitCheckoutResult, GitCheckoutTarget, GitClone, GitCloneProgress, GitCloneResult, GitCreateFolderQuery, GitCreateFolderResult, GitEnvironmentQuery, GitFolderAllows, GitFolderEntry, GitFolderListing, GitFolderQuery, GitFolderResult, GitFolderSearchQuery, GitFolderSearchResult, GitHost, GitHostError, GitLabels, GitMoveResult, GitMoveTarget, GitPullRequest, GitPullRequestList, GitPullRequestQuery, GitRepoInfo, GitRepoSpec, GitStatus, GitSyncAction, GitSyncResult, MoveChoice, MoveSessionSubject, SWITCHER_SECTIONS, SandboxFilter, SandboxesSource, SwitcherCache, SwitcherEntry, SwitcherSection, SwitcherSectionId, WithMachinesOptions, ageIsDuration, clockTime, compactCount, countInLabel, createSwitcherCache, environmentBaseKind, environmentKindIcon, environmentMachineName, folderName, gitErrorText, leavesWorktree, machineEnvironmentKind, machinesOf, moveChoices, moveListingCwd, moveSubject, newChatPlaceKind, prMatches, readPullRequests, resolveDraftDescriptor, resolveDraftEnvironment, resolveRemoteClone, sandboxCounts, sandboxMatches, sandboxSpecs, sortSandboxes, switcherCacheOf, switcherCreates, switcherKey, switcherSections, syncAction, syncSummary, syncTooltip, withMachines };
9
+ import { TeleportCallView, TeleportOutcome, TeleportProgressView, TeleportRequestView, TeleportTargetView, canTeleportTo, movingCount, shownRows, teleportStoppable, workTarget } from "./teleport.js";
10
+ export { DEFAULT_GIT_LABELS, DraftEnvironment, DraftRemoteClone, EnvironmentMachine, GitActionResult, GitBranch, GitBranchPullRequest, GitCheckoutResult, GitCheckoutTarget, GitClone, GitCloneProgress, GitCloneResult, GitCreateFolderQuery, GitCreateFolderResult, GitEnvironmentQuery, GitFolderAllows, GitFolderEntry, GitFolderListing, GitFolderQuery, GitFolderResult, GitFolderSearchQuery, GitFolderSearchResult, GitHost, GitHostError, GitLabels, GitMoveResult, GitMoveTarget, GitPullRequest, GitPullRequestList, GitPullRequestQuery, GitRepoInfo, GitRepoSpec, GitStatus, GitSyncAction, GitSyncResult, MoveChoice, MoveSessionSubject, SWITCHER_SECTIONS, SandboxFilter, SandboxesSource, SwitcherCache, SwitcherEntry, SwitcherSection, SwitcherSectionId, TeleportCallView, TeleportOutcome, TeleportProgressView, TeleportRequestView, TeleportTargetView, WithMachinesOptions, ageIsDuration, canTeleportTo, clockTime, compactCount, countInLabel, createSwitcherCache, environmentBaseKind, environmentKindIcon, environmentMachineName, folderName, gitErrorText, leavesWorktree, machineEnvironmentKind, machinesOf, moveChoices, moveListingCwd, moveSubject, movingCount, newChatPlaceKind, prMatches, readPullRequests, resolveDraftDescriptor, resolveDraftEnvironment, resolveRemoteClone, sandboxCounts, sandboxMatches, sandboxSpecs, shownRows, sortSandboxes, switcherCacheOf, switcherCreates, switcherKey, switcherSections, syncAction, syncSummary, syncTooltip, teleportStoppable, withMachines, workTarget };
@@ -5,4 +5,5 @@ import { resolveRemoteClone } from "./remote-clone.js";
5
5
  import { sandboxCounts, sandboxMatches, sandboxSpecs, sortSandboxes } from "./sandboxes.js";
6
6
  import { SWITCHER_SECTIONS, ageIsDuration, clockTime, compactCount, countInLabel, createSwitcherCache, prMatches, readPullRequests, switcherCacheOf, switcherCreates, switcherKey, switcherSections } from "./switcher.js";
7
7
  import { syncAction, syncSummary, syncTooltip } from "./sync.js";
8
- export { DEFAULT_GIT_LABELS, SWITCHER_SECTIONS, ageIsDuration, clockTime, compactCount, countInLabel, createSwitcherCache, environmentBaseKind, environmentKindIcon, environmentMachineName, folderName, gitErrorText, leavesWorktree, machineEnvironmentKind, machinesOf, moveChoices, moveListingCwd, moveSubject, newChatPlaceKind, prMatches, readPullRequests, resolveDraftDescriptor, resolveDraftEnvironment, resolveRemoteClone, sandboxCounts, sandboxMatches, sandboxSpecs, sortSandboxes, switcherCacheOf, switcherCreates, switcherKey, switcherSections, syncAction, syncSummary, syncTooltip, withMachines };
8
+ import { canTeleportTo, movingCount, shownRows, teleportStoppable, workTarget } from "./teleport.js";
9
+ export { DEFAULT_GIT_LABELS, SWITCHER_SECTIONS, ageIsDuration, canTeleportTo, clockTime, compactCount, countInLabel, createSwitcherCache, environmentBaseKind, environmentKindIcon, environmentMachineName, folderName, gitErrorText, leavesWorktree, machineEnvironmentKind, machinesOf, moveChoices, moveListingCwd, moveSubject, movingCount, newChatPlaceKind, prMatches, readPullRequests, resolveDraftDescriptor, resolveDraftEnvironment, resolveRemoteClone, sandboxCounts, sandboxMatches, sandboxSpecs, shownRows, sortSandboxes, switcherCacheOf, switcherCreates, switcherKey, switcherSections, syncAction, syncSummary, syncTooltip, teleportStoppable, withMachines, workTarget };
@@ -142,6 +142,49 @@ export declare const DEFAULT_GIT_LABELS: {
142
142
  gitMoveDone: string;
143
143
  gitMoveListFailed: string;
144
144
  gitMoveFailed: string;
145
+ gitTeleportTitle: string;
146
+ gitTeleportWhere: string;
147
+ gitTeleportLoading: string;
148
+ gitTeleportNone: string;
149
+ gitTeleportMarkFixable: string;
150
+ gitTeleportMarkChanges: string;
151
+ gitTeleportMarkBlocked: string;
152
+ gitTeleportConfirm: (name: string) => string;
153
+ gitTeleportCarryWork: (count: number) => string;
154
+ gitTeleportNoWork: string;
155
+ gitTeleportNotRepo: string;
156
+ gitTeleportCheckout: (name: string) => string;
157
+ gitTeleportCheckoutPlaceholder: string;
158
+ gitTeleportFolder: (name: string) => string;
159
+ gitTeleportFolderPlaceholder: string;
160
+ gitTeleportBrowse: string;
161
+ gitTeleportIgnored: string;
162
+ gitTeleportSecret: string;
163
+ gitTeleportLfs: string;
164
+ gitTeleportSubmodules: (count: number) => string;
165
+ gitTeleportDetail: string;
166
+ gitTeleportSubmit: string;
167
+ gitTeleporting: string;
168
+ /** Where a teleport is, under the dialog's content while it runs. */
169
+ gitTeleportStage: (stage: "export" | "transfer" | "prepare" | "commit" | "complete", done?: number, total?: number) => string;
170
+ gitTeleportStop: string;
171
+ gitTeleportStopped: string;
172
+ gitTeleportFailed: string;
173
+ /** The target stopped answering during the switch: the session may be on it already. */
174
+ gitTeleportUnknown: string;
175
+ /** The session moved, but its old host could not be told yet (the host's words under Details). */
176
+ gitTeleportSourceNotTold: string;
177
+ gitTeleportListFailed: string;
178
+ /** The host picked in Move to… can't take the session: why, from its comparison. */
179
+ gitTeleportCannot: (name: string) => string;
180
+ /** In the teleport step of Move to…, when an isolation was picked on the target too. */
181
+ gitTeleportThen: (isolation: string) => string;
182
+ gitMoveContinue: string;
183
+ gitMoveHere: string;
184
+ gitMoveUnavailable: string;
185
+ /** After a teleport, before its isolation is set up on the new host. */
186
+ gitMoveThen: (host: string, isolation: string) => string;
187
+ gitMoveKeepThere: string;
145
188
  gitWhereLabel: string;
146
189
  gitWhereTitle: (place: string, isolation: string | undefined, branch: string | undefined) => string;
147
190
  gitRunsOn: string;
@@ -216,7 +259,7 @@ export declare const DEFAULT_GIT_LABELS: {
216
259
  sandboxReplaced: string;
217
260
  sandboxReplacedHint: (title: string) => string;
218
261
  sandboxOpenSession: (title: string) => string;
219
- sandboxStates: Record<"running" | "paused" | "other", string>;
262
+ sandboxStates: Record<"running" | "paused" | "failed" | "other", string>;
220
263
  sandboxCpu: (count: number) => string;
221
264
  sandboxMemory: (mib: number) => string;
222
265
  sandboxCopyId: string;
@@ -138,6 +138,55 @@ const DEFAULT_GIT_LABELS = {
138
138
  gitMoveDone: "Done",
139
139
  gitMoveListFailed: "Couldn't list where it can run.",
140
140
  gitMoveFailed: "Couldn't move the session.",
141
+ gitTeleportTitle: "Teleport this session",
142
+ gitTeleportWhere: "Pick the host to move it to.",
143
+ gitTeleportLoading: "Comparing the hosts…",
144
+ gitTeleportNone: "No other host is connected.",
145
+ gitTeleportMarkFixable: "to set up",
146
+ gitTeleportMarkChanges: "changes",
147
+ gitTeleportMarkBlocked: "can't run it",
148
+ gitTeleportConfirm: (name) => `Teleport to ${name}?`,
149
+ gitTeleportCarryWork: (count) => `Bring the work in progress (${count} ${count === 1 ? "file" : "files"})`,
150
+ gitTeleportNoWork: "No uncommitted work to bring.",
151
+ gitTeleportNotRepo: "The folder is not a git repository. Only the conversation moves.",
152
+ gitTeleportCheckout: (name) => `Checkout on ${name}`,
153
+ gitTeleportCheckoutPlaceholder: "path to the same project",
154
+ gitTeleportFolder: (name) => `Folder on ${name}`,
155
+ gitTeleportFolderPlaceholder: "path on that host",
156
+ gitTeleportBrowse: "Browse…",
157
+ gitTeleportIgnored: "Files git ignores stay here. Tick the ones to bring:",
158
+ gitTeleportSecret: "secret?",
159
+ gitTeleportLfs: "Git LFS files move only if that host can fetch them.",
160
+ gitTeleportSubmodules: (count) => `${count} submodule${count === 1 ? "" : "s"} will not move.`,
161
+ gitTeleportDetail: "The conversation moves with its history. The folder here stays as it is.",
162
+ gitTeleportSubmit: "Teleport",
163
+ gitTeleporting: "Teleporting…",
164
+ /** Where a teleport is, under the dialog's content while it runs. */
165
+ gitTeleportStage: (stage, done, total) => ({
166
+ export: "Packing the session…",
167
+ transfer: total !== void 0 && total > 1 ? `Sending it… ${Math.min(done ?? 0, total)} of ${total}` : "Sending it…",
168
+ prepare: "Preparing it there…",
169
+ commit: "Starting it there…",
170
+ complete: "Finishing…"
171
+ })[stage],
172
+ gitTeleportStop: "Stop",
173
+ gitTeleportStopped: "Stopped. Nothing changed.",
174
+ gitTeleportFailed: "The teleport failed. Nothing changed.",
175
+ /** The target stopped answering during the switch: the session may be on it already. */
176
+ gitTeleportUnknown: "The other host stopped answering, and the session can already be there. Look for it there before you try again.",
177
+ /** The session moved, but its old host could not be told yet (the host's words under Details). */
178
+ gitTeleportSourceNotTold: "The session moved. Its old host still keeps a copy for now.",
179
+ gitTeleportListFailed: "Comparing the hosts failed.",
180
+ /** The host picked in Move to… can't take the session: why, from its comparison. */
181
+ gitTeleportCannot: (name) => `${name} cannot run this session.`,
182
+ /** In the teleport step of Move to…, when an isolation was picked on the target too. */
183
+ gitTeleportThen: (isolation) => `Then it sets up ${isolation} there.`,
184
+ gitMoveContinue: "Continue",
185
+ gitMoveHere: "It runs here now. Pick another place.",
186
+ gitMoveUnavailable: "It cannot run there now.",
187
+ /** After a teleport, before its isolation is set up on the new host. */
188
+ gitMoveThen: (host, isolation) => `It is on ${host} now, in its folder. Set up ${isolation} there:`,
189
+ gitMoveKeepThere: "Keep it in its folder",
141
190
  gitWhereLabel: "Choose where the session runs",
142
191
  gitWhereTitle: (place, isolation, branch) => `Runs on ${place}${isolation ? `, ${isolation.toLowerCase()}` : ""}${branch ? ` (${branch})` : ""}`,
143
192
  gitRunsOn: "Runs on",
@@ -215,6 +264,7 @@ const DEFAULT_GIT_LABELS = {
215
264
  sandboxStates: {
216
265
  running: "Running",
217
266
  paused: "Paused",
267
+ failed: "Failed",
218
268
  other: "Unknown"
219
269
  },
220
270
  sandboxCpu: (count) => `${count} CPU`,
@@ -29,7 +29,7 @@ export declare function sandboxMatches(sandbox: EnvironmentSandboxSummary, filte
29
29
  */
30
30
  export declare function sandboxCounts(sandboxes: readonly EnvironmentSandboxSummary[]): Record<SandboxFilter, number>;
31
31
  /**
32
- * Running first (they cost), then paused, then the rest; a session's before a stray one; newest first.
32
+ * Running first (they cost), then failed (they need a look), then paused, then the rest; a session's before a stray one; newest first.
33
33
  *
34
34
  * @param sandboxes - The sandboxes.
35
35
  */
@@ -24,11 +24,12 @@ function sandboxCounts(sandboxes) {
24
24
  }
25
25
  const STATE_ORDER = {
26
26
  running: 0,
27
- paused: 1,
28
- other: 2
27
+ failed: 1,
28
+ paused: 2,
29
+ other: 3
29
30
  };
30
31
  /**
31
- * Running first (they cost), then paused, then the rest; a session's before a stray one; newest first.
32
+ * Running first (they cost), then failed (they need a look), then paused, then the rest; a session's before a stray one; newest first.
32
33
  *
33
34
  * @param sandboxes - The sandboxes.
34
35
  */