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
@@ -238,6 +238,12 @@ const SESSION_SURFACE_LABELS = {
238
238
  lost: "Gone",
239
239
  unreachable: "Not answering"
240
240
  },
241
+ /** Work on a ready environment, in place of `placeTones.busy` ("Setting up"). */
242
+ placeWorking: {
243
+ pausing: "Pausing…",
244
+ deleting: "Deleting the sandbox…",
245
+ action: (label) => label ? `${label}…` : "Working…"
246
+ },
241
247
  placeTip: (where, state) => `${where}: ${state}`,
242
248
  placeResumes: "resumes on your next prompt",
243
249
  /** After `placeTones.removed`: when the new sandbox comes. */
@@ -403,6 +409,56 @@ const STOP_REASON = {
403
409
  };
404
410
  /** The default English strings of the session panels. Override any of them through `SessionProvider`. */
405
411
  const DEFAULT_SESSION_LABELS = {
412
+ /** At the right of a shared session's header: who else has it open. */
413
+ peopleHere: (names) => names.length === 1 ? `${names[0]} is here` : names.length === 2 ? `${names[0]} and ${names[1]} are here` : `${names.slice(0, -1).join(", ")} and ${names.at(-1)} are here`,
414
+ peopleMore: (count) => `+${count}`,
415
+ /** Under the composer of a shared session: who else is typing. */
416
+ typingOne: (name) => `${name} is typing…`,
417
+ typingTwo: (first, second) => `${first} and ${second} are typing…`,
418
+ typingMany: (count) => `${count} people are typing…`,
419
+ shareTitle: "Share this session",
420
+ shareNotify: "Notify me",
421
+ shareNotifyLevels: {
422
+ all: "Everything",
423
+ attention: "Only what needs me"
424
+ },
425
+ shareOwner: "owner",
426
+ shareGrants: {
427
+ read: "Read-only",
428
+ prompt: "Can prompt",
429
+ trusted: "Trusted"
430
+ },
431
+ shareInvite: "Invite",
432
+ shareInvitePlaceholder: "Someone in the organization",
433
+ shareRemove: "Remove",
434
+ shareOpen: "Anyone in the organization can join",
435
+ shareOpenGrant: "People who join get",
436
+ shareLeave: "Leave",
437
+ shareFrozen: "The owner is disabled. This session is read-only until an admin enables the owner or transfers the session.",
438
+ shareActsAsOwner: "Everyone here acts as the owner, with the owner's keys, tools and accounts.",
439
+ shareLoading: "Loading who shares it…",
440
+ shareFailed: "Changing who shares the session failed.",
441
+ shareLoadFailed: "Reading who shares the session failed.",
442
+ shareUsersFailed: "Reading the people you can invite failed.",
443
+ /** The grant picker of one member, for screen readers. */
444
+ shareGrantFor: (name) => `What ${name} can do`,
445
+ /** The grant picker next to Invite, for screen readers. */
446
+ shareInviteGrant: "What they can do",
447
+ shareRemoveConfirm: (name) => `Remove ${name}? They lose the session at once.`,
448
+ shareTransferConfirm: (name) => `Give this session to ${name}? It becomes theirs, and you stay as a trusted member.`,
449
+ shareConfirmCancel: "Keep",
450
+ shareDone: "Done",
451
+ shareTransfer: "Transfer to…",
452
+ openSessionsTitle: "Open sessions",
453
+ openSessionsNone: "Nobody opened a session to the organization yet.",
454
+ openSessionsLoading: "Loading the open sessions…",
455
+ openSessionsLoadFailed: "Reading the open sessions failed.",
456
+ openSessionsJoinFailed: "Joining the session failed.",
457
+ openSessionsJoin: "Join",
458
+ openSessionsOpen: "Open",
459
+ /** The people in an open session, its owner included. */
460
+ openSessionsMembers: (count) => `${count} ${count === 1 ? "person" : "people"}`,
461
+ shareTransferSubmit: "Transfer",
406
462
  diffChangedFiles: "Changed files",
407
463
  diffFindings: (errors, warnings) => `${errors} error${errors === 1 ? "" : "s"}, ${warnings} warning${warnings === 1 ? "" : "s"} from project tools`,
408
464
  todoTally: {
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Who else has a session open (organization mode, docs/MULTIPLAYER.md), from the host's presence rows
3
+ * (`SessionPresence.people`). The server leaves each connection's own person out. Listens only while something
4
+ * watches.
5
+ */
6
+ import { PresencePerson } from "zidane/ipc";
7
+ /** A presence row as a host or an app gives it: the session, and who has it open. */
8
+ export interface PresenceRow {
9
+ /** The session. */
10
+ sessionId: string;
11
+ /** Who has it open. */
12
+ people?: readonly PresencePerson[];
13
+ }
14
+ /** Who else has each session open, kept current. */
15
+ export interface SessionPeople {
16
+ /** Calls `listener` with who has `sessionId` open now, then on every change. Returns the unsubscribe. */
17
+ watch: (sessionId: string, listener: (people: readonly PresencePerson[]) => void) => () => void;
18
+ }
19
+ /**
20
+ * A {@link SessionPeople} over a host's presence: its first list, then each full snapshot it sends.
21
+ *
22
+ * @param source - Reads the presence rows, and subscribes to each new snapshot (returns the unsubscribe).
23
+ * @param source.list - The current rows.
24
+ * @param source.onChanged - Each new snapshot.
25
+ */
26
+ export declare function createSessionPeople(source: {
27
+ list: () => Promise<readonly PresenceRow[]>;
28
+ onChanged: (listener: (rows: readonly PresenceRow[]) => void) => () => void;
29
+ }): SessionPeople;
@@ -0,0 +1,53 @@
1
+ // src/session/headless/people.ts
2
+ const NOBODY = [];
3
+ /** The same people, in the same order: no redraw. */
4
+ function samePeople(a, b) {
5
+ return a.length === b.length && a.every((person, i) => person.userId === b[i].userId && person.name === b[i].name && person.avatar === b[i].avatar);
6
+ }
7
+ /**
8
+ * A {@link SessionPeople} over a host's presence: its first list, then each full snapshot it sends.
9
+ *
10
+ * @param source - Reads the presence rows, and subscribes to each new snapshot (returns the unsubscribe).
11
+ * @param source.list - The current rows.
12
+ * @param source.onChanged - Each new snapshot.
13
+ */
14
+ function createSessionPeople(source) {
15
+ let rows = /* @__PURE__ */ new Map();
16
+ const listeners = /* @__PURE__ */ new Map();
17
+ let stop = null;
18
+ let snapshots = 0;
19
+ const apply = (next) => {
20
+ const before = rows;
21
+ rows = new Map(next.filter((row) => row.people?.length).map((row) => [row.sessionId, row.people]));
22
+ for (const [sessionId, set] of listeners) {
23
+ const now = rows.get(sessionId) ?? NOBODY;
24
+ if (samePeople(before.get(sessionId) ?? NOBODY, now)) continue;
25
+ for (const listener of set) listener(now);
26
+ }
27
+ };
28
+ return { watch(sessionId, listener) {
29
+ const set = listeners.get(sessionId) ?? /* @__PURE__ */ new Set();
30
+ listeners.set(sessionId, set);
31
+ set.add(listener);
32
+ if (!stop) {
33
+ stop = source.onChanged((next) => {
34
+ snapshots++;
35
+ apply(next);
36
+ });
37
+ const asked = snapshots;
38
+ source.list().then((next) => {
39
+ if (stop && snapshots === asked) apply(next);
40
+ }, () => {});
41
+ }
42
+ listener(rows.get(sessionId) ?? NOBODY);
43
+ return () => {
44
+ set.delete(listener);
45
+ if (set.size === 0) listeners.delete(sessionId);
46
+ if (listeners.size === 0 && stop) {
47
+ stop();
48
+ stop = null;
49
+ }
50
+ };
51
+ } };
52
+ }
53
+ export { createSessionPeople };
@@ -37,6 +37,11 @@ export declare function isExternalEnvironment(environment: SessionEnvironmentSum
37
37
  export declare function environmentStateLabel(labels: {
38
38
  placeTones: Record<SessionPlaceTone, string>;
39
39
  placeBroken: Record<'lost' | 'unreachable', string>;
40
+ placeWorking: {
41
+ pausing: string;
42
+ deleting: string;
43
+ action: (label?: string) => string;
44
+ };
40
45
  }, environment: SessionEnvironmentSummary | undefined, tone: SessionPlaceTone): string;
41
46
  /**
42
47
  * One tone for where a session runs: a failure wins (unless the host is reconnecting to it, or it is a sandbox
@@ -28,7 +28,10 @@ function isExternalEnvironment(environment) {
28
28
  * @param tone - Its tone (`sessionPlaceTone`).
29
29
  */
30
30
  function environmentStateLabel(labels, environment, tone) {
31
- return tone === "failed" && environment?.failure ? labels.placeBroken[environment.failure] : labels.placeTones[tone];
31
+ if (tone === "failed" && environment?.failure) return labels.placeBroken[environment.failure];
32
+ const busy = tone === "busy" && environment?.state === "ready" ? environment.busy : void 0;
33
+ if (busy) return busy.what === "action" ? labels.placeWorking.action(busy.label) : labels.placeWorking[busy.what];
34
+ return labels.placeTones[tone];
32
35
  }
33
36
  const SERVER_DOWN = /* @__PURE__ */ new Set([
34
37
  "offline",
@@ -50,6 +53,7 @@ function sessionPlaceTone(environment, server, now = Date.now()) {
50
53
  if (!serverDown && environment?.state === "failed" && environment.removed) return "removed";
51
54
  if (environment?.state === "failed" || server === null || server && SERVER_DOWN.has(server.status)) return "failed";
52
55
  if (environment?.state === "provisioning" || server?.status === "connecting" || server?.status === "reconnecting") return "busy";
56
+ if (environment?.busy) return "busy";
53
57
  if (environment?.resuming) return "resuming";
54
58
  if (environment?.suspended) return "paused";
55
59
  return "ready";
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Who else is typing in a session (organization mode, docs/MULTIPLAYER.md):
3
+ * kept from the server's `members:typing` signals. A name goes away when its
4
+ * person stops, or when nothing more is heard from them for
5
+ * {@link TYPING_EXPIRE_MS} (their window closed mid-word).
6
+ */
7
+ /** Someone typing in a session. */
8
+ export interface TypingPerson {
9
+ /** Their user id. */
10
+ userId: string;
11
+ /** Their display name. */
12
+ name: string;
13
+ }
14
+ /** A `members:typing` signal, with the session id as the host keys it. */
15
+ export interface TypingSignal {
16
+ /** The session, by its id on this host. */
17
+ sessionId: string;
18
+ /** Who types. */
19
+ userId: string;
20
+ /** Their display name. */
21
+ name: string;
22
+ /** True while they type; false when they stop. */
23
+ typing: boolean;
24
+ }
25
+ /** The others typing in a session, kept current. */
26
+ export interface SessionTyping {
27
+ /** Calls `listener` with who is typing in `sessionId` now, then on every change. Returns the unsubscribe. */
28
+ watch: (sessionId: string, listener: (people: readonly TypingPerson[]) => void) => () => void;
29
+ }
30
+ /** A name not heard again for this long is dropped: the server repeats "typing" every 2 s while it lasts. */
31
+ export declare const TYPING_EXPIRE_MS = 6000;
32
+ /**
33
+ * A {@link SessionTyping} over a host's signals. Listens only while something watches.
34
+ *
35
+ * @param onSignal - Subscribes to the host's `members:typing` signals; returns the unsubscribe.
36
+ */
37
+ export declare function createSessionTyping(onSignal: (listener: (signal: TypingSignal) => void) => () => void): SessionTyping;
@@ -0,0 +1,60 @@
1
+ // src/session/headless/typing.ts
2
+ /** A name not heard again for this long is dropped: the server repeats "typing" every 2 s while it lasts. */
3
+ const TYPING_EXPIRE_MS = 6e3;
4
+ /**
5
+ * A {@link SessionTyping} over a host's signals. Listens only while something watches.
6
+ *
7
+ * @param onSignal - Subscribes to the host's `members:typing` signals; returns the unsubscribe.
8
+ */
9
+ function createSessionTyping(onSignal) {
10
+ const typing = /* @__PURE__ */ new Map();
11
+ const listeners = /* @__PURE__ */ new Map();
12
+ let stop = null;
13
+ const people = (sessionId) => [...(typing.get(sessionId) ?? /* @__PURE__ */ new Map()).entries()].map(([userId, entry]) => ({
14
+ userId,
15
+ name: entry.name
16
+ }));
17
+ const tell = (sessionId) => {
18
+ const now = people(sessionId);
19
+ for (const listener of listeners.get(sessionId) ?? []) listener(now);
20
+ };
21
+ const drop = (sessionId, userId) => {
22
+ const inSession = typing.get(sessionId);
23
+ const entry = inSession?.get(userId);
24
+ if (!inSession || !entry) return;
25
+ clearTimeout(entry.timer);
26
+ inSession.delete(userId);
27
+ if (inSession.size === 0) typing.delete(sessionId);
28
+ tell(sessionId);
29
+ };
30
+ const heard = (signal) => {
31
+ if (!signal.typing) return drop(signal.sessionId, signal.userId);
32
+ const inSession = typing.get(signal.sessionId) ?? /* @__PURE__ */ new Map();
33
+ typing.set(signal.sessionId, inSession);
34
+ const had = inSession.get(signal.userId);
35
+ if (had) clearTimeout(had.timer);
36
+ inSession.set(signal.userId, {
37
+ name: signal.name,
38
+ timer: setTimeout(drop, TYPING_EXPIRE_MS, signal.sessionId, signal.userId)
39
+ });
40
+ if (!had || had.name !== signal.name) tell(signal.sessionId);
41
+ };
42
+ return { watch(sessionId, listener) {
43
+ const set = listeners.get(sessionId) ?? /* @__PURE__ */ new Set();
44
+ listeners.set(sessionId, set);
45
+ set.add(listener);
46
+ stop ??= onSignal(heard);
47
+ listener(people(sessionId));
48
+ return () => {
49
+ set.delete(listener);
50
+ if (set.size === 0) listeners.delete(sessionId);
51
+ if (listeners.size === 0 && stop) {
52
+ stop();
53
+ stop = null;
54
+ for (const inSession of typing.values()) for (const entry of inSession.values()) clearTimeout(entry.timer);
55
+ typing.clear();
56
+ }
57
+ };
58
+ } };
59
+ }
60
+ export { TYPING_EXPIRE_MS, createSessionTyping };
@@ -2,6 +2,7 @@ import { ArtifactRowChips, ArtifactRowChipsFields, ArtifactRowChipsProps, BADGE_
2
2
  import { ArtifactOpenEvent, ArtifactsPanel, ArtifactsPanelFocus, ArtifactsPanelProps, ArtifactsSavedViews } from "./ArtifactsPanel.js";
3
3
  import { DiffFileTree, DiffFileTreeProps, FindingCounts } from "./DiffFileTree.js";
4
4
  import { renderSessionModalShell, renderWideSessionModalShell } from "./modal-shell.js";
5
+ import { OpenSessionsButton, OpenSessionsButtonProps, OpenSessionsDialog, OpenSessionsDialogProps, useOpenSessions } from "./OpenSessionsDialog.js";
5
6
  import { AttentionActions, InboxAttention, InboxAttentionProps, PanelAttentionProps, QueueAttention, SecretsAttention, SecretsAttentionProps } from "./PanelAttention.js";
6
7
  import { PlanTracker, PlanTrackerProps, RecentPlans, RecentPlansProps, planStateTone, useInboxPlans } from "./PlanTracker.js";
7
8
  import { ProjectHome, ProjectHomeProject, ProjectHomeProps, ProjectHomeRepo, ProjectHomeStartResult, ProjectHomeSwitcher } from "./ProjectHome.js";
@@ -13,15 +14,18 @@ import { SecretsPanel, SecretsPanelProps } from "./SecretsPanel.js";
13
14
  import { SessionCacheFacts, SessionCacheFactsProps, useSessionCacheReport } from "./SessionCacheFacts.js";
14
15
  import { SessionDetailsDialog, SessionDetailsDialogProps, SessionDetailsFacts, SessionDetailsSpace, SessionDetailsStatus, SessionFolderLocation } from "./SessionDetailsDialog.js";
15
16
  import { SessionHeader, SessionHeaderOrigin, SessionHeaderProps, SessionHeaderServer } from "./SessionHeader.js";
17
+ import { SessionPeopleStack, SessionPeopleStackProps } from "./SessionPeopleStack.js";
16
18
  import { SessionPlaceMenu, SessionPlaceMenuProps } from "./SessionPlaceMenu.js";
17
19
  import { SessionProvider, SessionProviderProps, useAllSchedules, useSchedulesStatus, useSessionArtifacts, useSessionHost, useSessionPlans, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets } from "./SessionProvider.js";
18
20
  import { RenderSessionShell, SessionShell, SessionShellProps } from "./SessionShell.js";
21
+ import { ShareSessionDialog, ShareSessionDialogProps, useShareSession } from "./ShareSessionDialog.js";
19
22
  import { SideChat, SideChatProps } from "./SideChat.js";
20
23
  import { TODO_ROW_CLASS, TodoListItem, TodoListView, TodoListViewProps, TodoTally, TodoTallyProps, isDoneTodo, todoGlyphTone } from "./TodoList.js";
21
24
  import { TurnDetailsDialog, TurnDetailsDialogProps } from "./TurnDetailsDialog.js";
25
+ import { TypingLine, TypingLineProps } from "./TypingLine.js";
22
26
  import { UsagePanel, UsagePanelProps } from "./UsagePanel.js";
23
27
  import { useSessionActionError } from "./useSessionActionError.js";
24
28
  import { useSessionLabels } from "./useSessionLabels.js";
25
29
  import { UsageSummaryView, useUsageSummary } from "./useUsageSummary.js";
26
30
  import { WelcomeScreen, WelcomeScreenProps } from "./WelcomeScreen.js";
27
- export { ArtifactOpenEvent, ArtifactRowChips, ArtifactRowChipsFields, ArtifactRowChipsProps, ArtifactsPanel, ArtifactsPanelFocus, ArtifactsPanelProps, ArtifactsSavedViews, AttentionActions, BADGE_ICONS, DiffFacts, DiffFactsProps, DiffFileTree, DiffFileTreeProps, FindingCounts, InboxAttention, InboxAttentionProps, PanelAttentionProps, PlanTracker, PlanTrackerProps, ProjectHome, ProjectHomeProject, ProjectHomeProps, ProjectHomeRepo, ProjectHomeStartResult, ProjectHomeSwitcher, ProviderUsage, ProviderUsageProvider, ProviderUsageProviderProps, QueueAttachmentRowProps, QueueAttachmentsSlot, QueueAttention, QueueTab, QueueTabProps, RecentPlans, RecentPlansProps, RemindersPanel, RemindersPanelProps, RemindersScope, type RenderSessionShell, RunningWorkDialog, RunningWorkDialogProps, SecretsAttention, SecretsAttentionProps, SecretsPanel, SecretsPanelProps, SessionCacheFacts, SessionCacheFactsProps, SessionDetailsDialog, SessionDetailsDialogProps, SessionDetailsFacts, SessionDetailsSpace, SessionDetailsStatus, SessionFolderLocation, SessionHeader, SessionHeaderOrigin, SessionHeaderProps, SessionHeaderServer, SessionPlaceMenu, SessionPlaceMenuProps, SessionProvider, SessionProviderProps, SessionShell, type SessionShellProps, SideChat, SideChatProps, TODO_ROW_CLASS, TodoListItem, TodoListView, TodoListViewProps, TodoTally, TodoTallyProps, TurnDetailsDialog, TurnDetailsDialogProps, UsagePanel, UsagePanelProps, UsageSummaryView, WelcomeScreen, WelcomeScreenProps, badgeColorStyle, badgeToneClass, hasArtifactRowChips, isDoneTodo, planStateTone, renderSessionModalShell, renderWideSessionModalShell, todoGlyphTone, useAllSchedules, useInboxPlans, useProviderUsage, useSchedulesStatus, useSessionActionError, useSessionArtifacts, useSessionCacheReport, useSessionHost, useSessionLabels, useSessionPlans, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets, useUsageSummary };
31
+ export { ArtifactOpenEvent, ArtifactRowChips, ArtifactRowChipsFields, ArtifactRowChipsProps, ArtifactsPanel, ArtifactsPanelFocus, ArtifactsPanelProps, ArtifactsSavedViews, AttentionActions, BADGE_ICONS, DiffFacts, DiffFactsProps, DiffFileTree, DiffFileTreeProps, FindingCounts, InboxAttention, InboxAttentionProps, OpenSessionsButton, OpenSessionsButtonProps, OpenSessionsDialog, OpenSessionsDialogProps, PanelAttentionProps, PlanTracker, PlanTrackerProps, ProjectHome, ProjectHomeProject, ProjectHomeProps, ProjectHomeRepo, ProjectHomeStartResult, ProjectHomeSwitcher, ProviderUsage, ProviderUsageProvider, ProviderUsageProviderProps, QueueAttachmentRowProps, QueueAttachmentsSlot, QueueAttention, QueueTab, QueueTabProps, RecentPlans, RecentPlansProps, RemindersPanel, RemindersPanelProps, RemindersScope, type RenderSessionShell, RunningWorkDialog, RunningWorkDialogProps, SecretsAttention, SecretsAttentionProps, SecretsPanel, SecretsPanelProps, SessionCacheFacts, SessionCacheFactsProps, SessionDetailsDialog, SessionDetailsDialogProps, SessionDetailsFacts, SessionDetailsSpace, SessionDetailsStatus, SessionFolderLocation, SessionHeader, SessionHeaderOrigin, SessionHeaderProps, SessionHeaderServer, SessionPeopleStack, SessionPeopleStackProps, SessionPlaceMenu, SessionPlaceMenuProps, SessionProvider, SessionProviderProps, SessionShell, type SessionShellProps, ShareSessionDialog, ShareSessionDialogProps, SideChat, SideChatProps, TODO_ROW_CLASS, TodoListItem, TodoListView, TodoListViewProps, TodoTally, TodoTallyProps, TurnDetailsDialog, TurnDetailsDialogProps, TypingLine, TypingLineProps, UsagePanel, UsagePanelProps, UsageSummaryView, WelcomeScreen, WelcomeScreenProps, badgeColorStyle, badgeToneClass, hasArtifactRowChips, isDoneTodo, planStateTone, renderSessionModalShell, renderWideSessionModalShell, todoGlyphTone, useAllSchedules, useInboxPlans, useOpenSessions, useProviderUsage, useSchedulesStatus, useSessionActionError, useSessionArtifacts, useSessionCacheReport, useSessionHost, useSessionLabels, useSessionPlans, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets, useShareSession, useUsageSummary };
@@ -2,6 +2,7 @@ import { ArtifactRowChips, BADGE_ICONS, DiffFacts, badgeColorStyle, badgeToneCla
2
2
  import { ArtifactsPanel } from "./ArtifactsPanel.js";
3
3
  import { DiffFileTree } from "./DiffFileTree.js";
4
4
  import { renderSessionModalShell, renderWideSessionModalShell } from "./modal-shell.js";
5
+ import { OpenSessionsButton, OpenSessionsDialog, useOpenSessions } from "./OpenSessionsDialog.js";
5
6
  import { InboxAttention, QueueAttention, SecretsAttention } from "./PanelAttention.js";
6
7
  import { PlanTracker, RecentPlans, planStateTone, useInboxPlans } from "./PlanTracker.js";
7
8
  import { ProjectHome } from "./ProjectHome.js";
@@ -13,15 +14,18 @@ import { SecretsPanel } from "./SecretsPanel.js";
13
14
  import { SessionCacheFacts, useSessionCacheReport } from "./SessionCacheFacts.js";
14
15
  import { SessionDetailsDialog } from "./SessionDetailsDialog.js";
15
16
  import { SessionHeader } from "./SessionHeader.js";
17
+ import { SessionPeopleStack } from "./SessionPeopleStack.js";
16
18
  import { SessionPlaceMenu } from "./SessionPlaceMenu.js";
17
19
  import { SessionProvider, useAllSchedules, useSchedulesStatus, useSessionArtifacts, useSessionHost, useSessionPlans, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets } from "./SessionProvider.js";
18
20
  import { SessionShell } from "./SessionShell.js";
21
+ import { ShareSessionDialog, useShareSession } from "./ShareSessionDialog.js";
19
22
  import { SideChat } from "./SideChat.js";
20
23
  import { TODO_ROW_CLASS, TodoListView, TodoTally, isDoneTodo, todoGlyphTone } from "./TodoList.js";
21
24
  import { TurnDetailsDialog } from "./TurnDetailsDialog.js";
25
+ import { TypingLine } from "./TypingLine.js";
22
26
  import { UsagePanel } from "./UsagePanel.js";
23
27
  import { useSessionActionError } from "./useSessionActionError.js";
24
28
  import { useSessionLabels } from "./useSessionLabels.js";
25
29
  import { useUsageSummary } from "./useUsageSummary.js";
26
30
  import { WelcomeScreen } from "./WelcomeScreen.js";
27
- export { ArtifactRowChips, ArtifactsPanel, BADGE_ICONS, DiffFacts, DiffFileTree, InboxAttention, PlanTracker, ProjectHome, ProviderUsageProvider, QueueAttention, QueueTab, RecentPlans, RemindersPanel, RunningWorkDialog, SecretsAttention, SecretsPanel, SessionCacheFacts, SessionDetailsDialog, SessionHeader, SessionPlaceMenu, SessionProvider, SessionShell, SideChat, TODO_ROW_CLASS, TodoListView, TodoTally, TurnDetailsDialog, UsagePanel, WelcomeScreen, badgeColorStyle, badgeToneClass, hasArtifactRowChips, isDoneTodo, planStateTone, renderSessionModalShell, renderWideSessionModalShell, todoGlyphTone, useAllSchedules, useInboxPlans, useProviderUsage, useSchedulesStatus, useSessionActionError, useSessionArtifacts, useSessionCacheReport, useSessionHost, useSessionLabels, useSessionPlans, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets, useUsageSummary };
31
+ export { ArtifactRowChips, ArtifactsPanel, BADGE_ICONS, DiffFacts, DiffFileTree, InboxAttention, OpenSessionsButton, OpenSessionsDialog, PlanTracker, ProjectHome, ProviderUsageProvider, QueueAttention, QueueTab, RecentPlans, RemindersPanel, RunningWorkDialog, SecretsAttention, SecretsPanel, SessionCacheFacts, SessionDetailsDialog, SessionHeader, SessionPeopleStack, SessionPlaceMenu, SessionProvider, SessionShell, ShareSessionDialog, SideChat, TODO_ROW_CLASS, TodoListView, TodoTally, TurnDetailsDialog, TypingLine, UsagePanel, WelcomeScreen, badgeColorStyle, badgeToneClass, hasArtifactRowChips, isDoneTodo, planStateTone, renderSessionModalShell, renderWideSessionModalShell, todoGlyphTone, useAllSchedules, useInboxPlans, useOpenSessions, useProviderUsage, useSchedulesStatus, useSessionActionError, useSessionArtifacts, useSessionCacheReport, useSessionHost, useSessionLabels, useSessionPlans, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets, useShareSession, useUsageSummary };
@@ -204,12 +204,14 @@ function fixturePerfSample(n, at) {
204
204
  p95Ms: 90
205
205
  },
206
206
  {
207
- channel: "chat:stream",
207
+ channel: "chat:stream-port",
208
208
  direction: "push",
209
209
  count: 3e3 + n * 40,
210
210
  totalMs: 410 + n * 3,
211
211
  maxMs: 6,
212
- p95Ms: .4
212
+ p95Ms: .4,
213
+ bytes: 15e5,
214
+ bytesPerMessage: 500
213
215
  },
214
216
  {
215
217
  channel: "sessions:list",
@@ -94,6 +94,10 @@ export interface PerfChannel {
94
94
  maxMs: number;
95
95
  /** 95th percentile. */
96
96
  p95Ms: number;
97
+ /** Bytes carried, estimated from a sample of the messages counted while measured. Absent: not measured. */
98
+ bytes?: number;
99
+ /** The average size of a measured message, bytes. */
100
+ bytesPerMessage?: number;
97
101
  }
98
102
  /** Where long frames (over 50 ms) spent their time: one script and function, summed. */
99
103
  export interface PerfSlowFrame {
@@ -12,7 +12,7 @@
12
12
  * best first, once each, and `groupSettingsResults` groups them by page
13
13
  * and section.
14
14
  */
15
- import { bO as Settings } from "../../dist/index-E1Z0aPmi.js";
15
+ import { UO as Settings } from "../../dist/index-BheVJOLc.js";
16
16
  import { SettingsActionId, SettingsPage } from "./layout.js";
17
17
  import { SettingsSearchEntry, SettingsSection } from "./registry.js";
18
18
  import { SettingSurface } from "zidane/chat/pure";
@@ -270,8 +270,13 @@ export interface SettingsInstructionsHost {
270
270
  }
271
271
  /** Where new sessions run: the environment kinds and their settings. */
272
272
  export interface SettingsEnvironmentsHost {
273
- /** Every kind, described for a new session in `cwd` (`''`: none). */
274
- list: (cwd: string) => Promise<readonly EnvironmentDescriptor[]>;
273
+ /**
274
+ * Every kind, described for a new session in `cwd` (`''`: none). `machineOnly`:
275
+ * what the host can run whatever the folder (Manage reads which kinds it can list).
276
+ */
277
+ list: (cwd: string, options?: {
278
+ machineOnly?: boolean;
279
+ }) => Promise<readonly EnvironmentDescriptor[]>;
275
280
  /** Applies one edit (on, default, an option, a secret). Absent: read-only. */
276
281
  update?: (change: EnvironmentSettingsChange) => Promise<void>;
277
282
  /** Tests a kind's connection. Absent: no test button. */
@@ -15,11 +15,23 @@ export interface SettingsSectionState {
15
15
  /** Opens a section, optionally landing on (and highlighting) the row with `data-setting-focus={focus}`. */
16
16
  select: (id: string, focus?: string | null) => void;
17
17
  }
18
- /** @internal The shell's per-section value. */
18
+ /**
19
+ * The shell's per-section value.
20
+ *
21
+ * @internal
22
+ */
19
23
  export declare const SettingsSectionContext: import("react").Context<SettingsSectionState>;
20
- /** @internal The header slot a kept-mounted section portals its actions into. */
24
+ /**
25
+ * The header slot a kept-mounted section portals its actions into.
26
+ *
27
+ * @internal
28
+ */
21
29
  export declare const SettingsActionsSlotContext: import("react").Context<HTMLElement | null>;
22
- /** @internal The row a deep link or search pick landed on, and how to let go of it. */
30
+ /**
31
+ * The row a deep link or search pick landed on, and how to let go of it.
32
+ *
33
+ * @internal
34
+ */
23
35
  export declare const SettingFocusContext: import("react").Context<{
24
36
  focusKey: string | null;
25
37
  clear: () => void;
@@ -2,15 +2,27 @@ import { createContext, useContext } from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { createPortal } from "react-dom";
4
4
  // src/settings/section.tsx
5
- /** @internal The shell's per-section value. */
5
+ /**
6
+ * The shell's per-section value.
7
+ *
8
+ * @internal
9
+ */
6
10
  const SettingsSectionContext = createContext({
7
11
  id: "",
8
12
  visible: true,
9
13
  select: () => {}
10
14
  });
11
- /** @internal The header slot a kept-mounted section portals its actions into. */
15
+ /**
16
+ * The header slot a kept-mounted section portals its actions into.
17
+ *
18
+ * @internal
19
+ */
12
20
  const SettingsActionsSlotContext = createContext(null);
13
- /** @internal The row a deep link or search pick landed on, and how to let go of it. */
21
+ /**
22
+ * The row a deep link or search pick landed on, and how to let go of it.
23
+ *
24
+ * @internal
25
+ */
14
26
  const SettingFocusContext = createContext({
15
27
  focusKey: null,
16
28
  clear: () => {}
@@ -180,18 +180,42 @@ function ManageSandboxes({ kinds, onOpenSession }) {
180
180
  remove,
181
181
  shared
182
182
  ]);
183
- const shown = useMemo(() => kinds.map((d) => ({
184
- kind: d.kind,
185
- label: d.label,
186
- icon: environmentKindIcon(d.kind),
187
- ...!d.available && d.reason ? { unavailable: d.reason } : {}
188
- })), [kinds]);
183
+ const machine = useMachineAvailability(host?.list, kinds);
184
+ const shown = useMemo(() => kinds.map((d) => {
185
+ const reason = machine.get(d.kind);
186
+ return {
187
+ kind: d.kind,
188
+ label: d.label,
189
+ icon: environmentKindIcon(d.kind),
190
+ ...reason ? { unavailable: reason } : {}
191
+ };
192
+ }), [kinds, machine]);
189
193
  return /* @__PURE__ */ jsx(SandboxManager, {
190
194
  kinds: shown,
191
195
  source,
192
196
  ...onOpenSession ? { onOpenSession } : {}
193
197
  });
194
198
  }
199
+ /**
200
+ * Why each of `kinds` can't run on this machine at all, by kind (absent: it can), from `list` with
201
+ * `machineOnly`. Until that answers, and when it fails, nothing is withheld: listing a kind that can't run
202
+ * shows its provider's own error.
203
+ */
204
+ function useMachineAvailability(list, kinds) {
205
+ const [reasons, setReasons] = useState(() => /* @__PURE__ */ new Map());
206
+ const kindsKey = kinds.map((d) => d.kind).join("\0");
207
+ useEffect(() => {
208
+ if (!list) return void 0;
209
+ let live = true;
210
+ list("", { machineOnly: true }).then((descriptors) => {
211
+ if (live) setReasons(new Map(descriptors.filter((d) => !d.available && d.reason).map((d) => [d.kind, d.reason])));
212
+ }, () => {});
213
+ return () => {
214
+ live = false;
215
+ };
216
+ }, [list, kindsKey]);
217
+ return reasons;
218
+ }
195
219
  function EnvironmentCard({ descriptor, baseLabel, onUpdate }) {
196
220
  const l = useEnvironmentsSectionLabels();
197
221
  const shared = useCatalogSharedLabels();
@@ -36,6 +36,9 @@ export declare const DEFAULT_KEYBINDINGS_SECTION_LABELS: {
36
36
  keybindingsSectionExportJson: string;
37
37
  keybindingsSectionCopyId: string;
38
38
  keybindingsSectionFavorite: string;
39
+ keybindingsSectionMove: string;
40
+ keybindingsSectionShare: string;
41
+ keybindingsSectionOpenSessions: string;
39
42
  keybindingsSectionDelete: string;
40
43
  keybindingsSectionPanels: string;
41
44
  keybindingsSectionPanelNext: string;
@@ -37,6 +37,9 @@ const DEFAULT_KEYBINDINGS_SECTION_LABELS = {
37
37
  keybindingsSectionExportJson: "Export as JSON",
38
38
  keybindingsSectionCopyId: "Copy session id",
39
39
  keybindingsSectionFavorite: "Add to or remove from favorites",
40
+ keybindingsSectionMove: "Move to another host, machine or sandbox",
41
+ keybindingsSectionShare: "Share with people of your organization",
42
+ keybindingsSectionOpenSessions: "Open sessions to join",
40
43
  keybindingsSectionDelete: "Delete session",
41
44
  keybindingsSectionPanels: "Panels and tabs",
42
45
  keybindingsSectionPanelNext: "Next panel",
@@ -110,6 +110,18 @@ const KEYBINDING_SECTIONS = [
110
110
  action: "sessionFavorite",
111
111
  label: "keybindingsSectionFavorite"
112
112
  },
113
+ {
114
+ action: "sessionMove",
115
+ label: "keybindingsSectionMove"
116
+ },
117
+ {
118
+ action: "sessionShare",
119
+ label: "keybindingsSectionShare"
120
+ },
121
+ {
122
+ action: "openSessions",
123
+ label: "keybindingsSectionOpenSessions"
124
+ },
113
125
  {
114
126
  action: "sessionDelete",
115
127
  label: "keybindingsSectionDelete"
@@ -6,7 +6,7 @@ import { useSettingsHost, useSettingsLabels } from "../../SettingsProvider.js";
6
6
  import { SettingsRestricted, useSettingsRestricted } from "../../SettingsRestricted.js";
7
7
  import { useSectionLabels } from "../use-section-labels.js";
8
8
  import { DEFAULT_LOGS_SECTION_LABELS } from "./labels.js";
9
- import { useEffect, useMemo, useState } from "react";
9
+ import { useEffect, useMemo, useRef, useState } from "react";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
11
  import { LOG_LEVEL_CYCLE, filterLogRecords, formatLogLine } from "zidane/chat/pure";
12
12
  // src/settings/sections/logs/LogsSection.tsx
@@ -128,16 +128,13 @@ function LogsSection({ className, style }) {
128
128
  });
129
129
  }
130
130
  function LogList({ rows, follow }) {
131
- const [el, setEl] = useState(null);
131
+ const listRef = useRef(null);
132
132
  useEffect(() => {
133
+ const el = listRef.current;
133
134
  if (follow && el) el.scrollTop = el.scrollHeight;
134
- }, [
135
- rows,
136
- follow,
137
- el
138
- ]);
135
+ }, [rows, follow]);
139
136
  return /* @__PURE__ */ jsx("pre", {
140
- ref: setEl,
137
+ ref: listRef,
141
138
  className: "zg-code-panel m-0 flex-1 min-h-0 overflow-auto py-2.5 text-xs leading-6 font-mono whitespace-pre",
142
139
  children: rows.map((r, i) => /* @__PURE__ */ jsx("span", {
143
140
  className: `block w-max min-w-full px-3 hover:bg-[var(--zg-row-hover)] ${LEVEL_CLS[r.level]}`,
@@ -611,6 +611,7 @@ function Channels({ latest }) {
611
611
  const l = usePerformanceSectionLabels();
612
612
  const channels = latest.channels.slice(0, LIST_CAP);
613
613
  const total = latest.channels.reduce((sum, channel) => sum + channel.totalMs, 0);
614
+ const bytes = channels.some((channel) => channel.bytes !== void 0);
614
615
  return /* @__PURE__ */ jsx(Section, {
615
616
  title: l.perfChannels,
616
617
  badges: /* @__PURE__ */ jsxs(Fragment$1, { children: [
@@ -625,7 +626,8 @@ function Channels({ latest }) {
625
626
  l.perfColCalls,
626
627
  l.perfColTotal,
627
628
  l.perfColP95,
628
- l.perfColWorst
629
+ l.perfColWorst,
630
+ ...bytes ? [l.perfColBytes] : []
629
631
  ] }), channels.map((channel) => /* @__PURE__ */ jsxs("div", {
630
632
  className: ROW,
631
633
  children: [
@@ -649,6 +651,11 @@ function Channels({ latest }) {
649
651
  /* @__PURE__ */ jsx("span", {
650
652
  className: COL,
651
653
  children: formatDuration(channel.maxMs)
654
+ }),
655
+ bytes && /* @__PURE__ */ jsx("span", {
656
+ className: COL,
657
+ title: channel.bytesPerMessage !== void 0 ? l.perfBytesPerMessage(formatMemory(channel.bytesPerMessage)) : void 0,
658
+ children: channel.bytes !== void 0 ? formatMemory(channel.bytes) : "–"
652
659
  })
653
660
  ]
654
661
  }, `${channel.direction}\0${channel.channel}`))] })
@@ -58,6 +58,8 @@ export declare const DEFAULT_PERFORMANCE_SECTION_LABELS: {
58
58
  perfColTotal: string;
59
59
  perfColP95: string;
60
60
  perfColWorst: string;
61
+ perfColBytes: string;
62
+ perfBytesPerMessage: (size: string) => string;
61
63
  perfColShare: string;
62
64
  perfColSelf: string;
63
65
  perfReset: string;
@@ -80,6 +80,8 @@ const DEFAULT_PERFORMANCE_SECTION_LABELS = {
80
80
  perfColTotal: "total",
81
81
  perfColP95: "p95",
82
82
  perfColWorst: "worst",
83
+ perfColBytes: "bytes",
84
+ perfBytesPerMessage: (size) => `${size} per message, measured on a sample while this page is open`,
83
85
  perfColShare: "share",
84
86
  perfColSelf: "self",
85
87
  perfReset: "Reset counters",