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
@@ -12,6 +12,8 @@ import { CapabilitiesView, CapabilityTags, useHostCapabilities } from "./HostCap
12
12
  import { HostIcon } from "./HostIcon.js";
13
13
  import { HostSyncPanel, useHostSync } from "./HostSyncPanel.js";
14
14
  import { useMachinesConfirm, useMachinesHost, useMachinesLabels } from "./MachinesProvider.js";
15
+ import { OrganizationPanel } from "./OrganizationPanel.js";
16
+ import { PersonalLayerPanel } from "./PersonalLayerPanel.js";
15
17
  import { ServerAddedCard } from "./ServerAddedCard.js";
16
18
  import { ServerCard } from "./ServerCard.js";
17
19
  import { ServerMachinesPanel } from "./ServerMachinesPanel.js";
@@ -305,7 +307,9 @@ function ServerDetail({ host, saved, onChanged, confirm, now, className = "", st
305
307
  host,
306
308
  confirm: ask,
307
309
  ...timed
308
- })
310
+ }),
311
+ machinesHost.organization && /* @__PURE__ */ jsx(OrganizationPanel, { host }),
312
+ machinesHost.layer && /* @__PURE__ */ jsx(PersonalLayerPanel, { host })
309
313
  ]
310
314
  });
311
315
  }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * A server's People section (docs/IDENTITY.md): what organization mode is when the server does not sign its users in,
3
+ * with the command that turns it on; once it does, who you are there and whether people can share sessions. An admin
4
+ * also manages the people: Add person, then per person Make admin or Make user, Disable or Enable, and Remove (their
5
+ * sessions come to the admin, their tokens stop at once). Disable and Remove ask first.
6
+ *
7
+ * Needs the host's `organization`; nothing while the server is not connected.
8
+ */
9
+ import { HostSummary } from "./headless/host.js";
10
+ import { CSSProperties } from "react";
11
+ /** Props for {@link OrganizationPanel}. */
12
+ export interface OrganizationPanelProps {
13
+ /** The server. */
14
+ host: HostSummary;
15
+ /** Extra classes on the root. */
16
+ className?: string;
17
+ /** Inline styles on the root. */
18
+ style?: CSSProperties;
19
+ }
20
+ /**
21
+ * Renders the server's People section, or nothing without the host's `organization` or a connection.
22
+ *
23
+ * @param props - The {@link OrganizationPanelProps}.
24
+ */
25
+ export declare function OrganizationPanel(props: OrganizationPanelProps): import("react").JSX.Element | null;
@@ -0,0 +1,266 @@
1
+ import { BTN_PRIMARY, BTN_SECONDARY, buttonClass } from "../components/button.js";
2
+ import { CopyValue } from "../components/CopyValue.js";
3
+ import { Checkbox, ErrorNote, FormSection, INPUT_CLASS, MetaChip, RowText } from "../components/Form.js";
4
+ import { RowMenuButton } from "../components/RowMenuButton.js";
5
+ import { machinesError } from "./headless/host.js";
6
+ import { HostIcon } from "./HostIcon.js";
7
+ import { useMachinesConfirm, useMachinesHost, useMachinesLabels } from "./MachinesProvider.js";
8
+ import { useCallback, useEffect, useState } from "react";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+ // src/machines/OrganizationPanel.tsx
11
+ /** The command that starts a server in organization mode. */
12
+ const TURN_ON = "zidane server --organization";
13
+ /**
14
+ * Renders the server's People section, or nothing without the host's `organization` or a connection.
15
+ *
16
+ * @param props - The {@link OrganizationPanelProps}.
17
+ */
18
+ function OrganizationPanel(props) {
19
+ const organization = useMachinesHost().organization;
20
+ if (!organization || props.host.status !== "connected") return null;
21
+ return /* @__PURE__ */ jsx(PeopleBody, {
22
+ ...props,
23
+ organization
24
+ });
25
+ }
26
+ function PeopleBody({ host, organization, className = "", style }) {
27
+ const labels = useMachinesLabels();
28
+ const ask = useMachinesConfirm();
29
+ const [status, setStatus] = useState(null);
30
+ const [people, setPeople] = useState([]);
31
+ const [error, setError] = useState(null);
32
+ const [note, setNote] = useState(null);
33
+ const [adding, setAdding] = useState(false);
34
+ const [busy, setBusy] = useState(false);
35
+ const read = useCallback(async () => {
36
+ try {
37
+ const next = await organization.status(host.id);
38
+ setStatus(next);
39
+ setPeople(next.mode === "on" && next.role === "admin" ? await organization.users(host.id) : []);
40
+ } catch (err) {
41
+ setError(labels.machinesError(machinesError("people", err)));
42
+ }
43
+ }, [
44
+ organization,
45
+ host.id,
46
+ labels
47
+ ]);
48
+ useEffect(() => {
49
+ read();
50
+ }, [read]);
51
+ const act = async (action) => {
52
+ setBusy(true);
53
+ setError(null);
54
+ setNote(null);
55
+ try {
56
+ const said = await action();
57
+ if (said) setNote(said);
58
+ } catch (err) {
59
+ setError(labels.machinesError(machinesError("people", err)));
60
+ } finally {
61
+ setBusy(false);
62
+ read();
63
+ }
64
+ };
65
+ if (!status) return error ? /* @__PURE__ */ jsx(ErrorNote, {
66
+ className,
67
+ style,
68
+ children: error
69
+ }) : null;
70
+ if (status.mode === "off") return /* @__PURE__ */ jsx(FormSection, {
71
+ title: labels.machinesPeopleTitle,
72
+ className,
73
+ style,
74
+ "data-testid": `people-${host.id}`,
75
+ children: /* @__PURE__ */ jsxs("div", {
76
+ className: "px-3 py-2 space-y-2",
77
+ children: [/* @__PURE__ */ jsx("p", {
78
+ className: "m-0 text-xs text-[var(--zg-text-muted)]",
79
+ children: labels.machinesPeopleOff
80
+ }), /* @__PURE__ */ jsxs("div", {
81
+ className: "flex items-center gap-2 text-xs text-[var(--zg-text-muted)]",
82
+ children: [/* @__PURE__ */ jsx("span", { children: labels.machinesPeopleTurnOn }), /* @__PURE__ */ jsx(CopyValue, {
83
+ text: TURN_ON,
84
+ label: TURN_ON,
85
+ copiedLabel: labels.machinesCopiedText(TURN_ON)
86
+ })]
87
+ })]
88
+ })
89
+ });
90
+ const admin = status.role === "admin";
91
+ const items = (person) => [
92
+ person.role === "admin" ? {
93
+ id: "user",
94
+ label: labels.machinesPeopleMakeUser,
95
+ icon: "i-ph-user",
96
+ onSelect: () => void act(() => organization.setRole(host.id, person.userId, "user"))
97
+ } : {
98
+ id: "admin",
99
+ label: labels.machinesPeopleMakeAdmin,
100
+ icon: "i-ph-shield-check",
101
+ onSelect: () => void act(() => organization.setRole(host.id, person.userId, "admin"))
102
+ },
103
+ person.disabled ? {
104
+ id: "enable",
105
+ label: labels.machinesPeopleEnable,
106
+ icon: "i-ph-play",
107
+ onSelect: () => void act(() => organization.setDisabled(host.id, person.userId, false))
108
+ } : {
109
+ id: "disable",
110
+ label: labels.machinesPeopleDisable,
111
+ icon: "i-ph-prohibit",
112
+ onSelect: () => void ask({
113
+ title: labels.machinesPeopleDisableTitle(person.email),
114
+ message: labels.machinesPeopleDisableMessage,
115
+ confirmLabel: labels.machinesPeopleDisable,
116
+ destructive: true
117
+ }).then((ok) => {
118
+ if (ok) act(() => organization.setDisabled(host.id, person.userId, true));
119
+ })
120
+ },
121
+ {
122
+ id: "remove",
123
+ label: labels.machinesRemove,
124
+ icon: "i-ph-trash",
125
+ destructive: true,
126
+ onSelect: () => void ask({
127
+ title: labels.machinesPeopleRemoveTitle(person.email),
128
+ message: labels.machinesPeopleRemoveMessage,
129
+ confirmLabel: labels.machinesRemove,
130
+ destructive: true
131
+ }).then((ok) => {
132
+ if (ok) act(async () => labels.machinesPeopleRemoved(await organization.removeUser(host.id, person.userId)));
133
+ })
134
+ }
135
+ ];
136
+ return /* @__PURE__ */ jsxs(FormSection, {
137
+ title: labels.machinesPeopleTitle,
138
+ className,
139
+ style,
140
+ "data-testid": `people-${host.id}`,
141
+ ...admin && !adding ? { trailing: /* @__PURE__ */ jsx("button", {
142
+ type: "button",
143
+ className: BTN_SECONDARY,
144
+ onClick: () => setAdding(true),
145
+ children: labels.machinesPeopleAdd
146
+ }) } : {},
147
+ children: [
148
+ /* @__PURE__ */ jsxs("div", {
149
+ className: "px-3 py-2 space-y-0.5 text-xs text-[var(--zg-text-muted)]",
150
+ children: [/* @__PURE__ */ jsx("p", {
151
+ className: "m-0",
152
+ children: labels.machinesPeopleYou(status.email, status.role)
153
+ }), /* @__PURE__ */ jsx("p", {
154
+ className: "m-0",
155
+ "data-testid": "people-sharing",
156
+ children: status.sharing ? labels.machinesPeopleSharingOn : labels.machinesPeopleSharingOff
157
+ })]
158
+ }),
159
+ adding && /* @__PURE__ */ jsx(AddPerson, {
160
+ busy,
161
+ onCancel: () => setAdding(false),
162
+ onAdd: (input) => void act(async () => {
163
+ await organization.addUser(host.id, input);
164
+ setAdding(false);
165
+ })
166
+ }),
167
+ admin && /* @__PURE__ */ jsx("div", {
168
+ role: "list",
169
+ "aria-label": labels.machinesPeopleTitle,
170
+ className: "contents",
171
+ children: people.map((person) => /* @__PURE__ */ jsxs("div", {
172
+ role: "listitem",
173
+ className: "flex items-center gap-3 px-3 py-2",
174
+ "data-testid": `person-${person.email}`,
175
+ children: [
176
+ /* @__PURE__ */ jsx(HostIcon, { icon: person.role === "admin" ? "i-ph-shield-check" : "i-ph-user" }),
177
+ /* @__PURE__ */ jsx(RowText, { label: person.name ? `${person.name} (${person.email})` : person.email }),
178
+ /* @__PURE__ */ jsxs("span", {
179
+ className: "flex items-center gap-1 shrink-0",
180
+ children: [
181
+ person.role === "admin" && /* @__PURE__ */ jsx(MetaChip, { children: labels.machinesPeopleAdmin }),
182
+ person.disabled && /* @__PURE__ */ jsx(MetaChip, {
183
+ tone: "warn",
184
+ children: labels.machinesPeopleDisabled
185
+ }),
186
+ person.email === status.email && /* @__PURE__ */ jsx(MetaChip, { children: labels.machinesPeopleYouChip })
187
+ ]
188
+ }),
189
+ person.email !== status.email && /* @__PURE__ */ jsx(RowMenuButton, {
190
+ label: labels.machinesPeopleRowActions(person.email),
191
+ items: items(person)
192
+ })
193
+ ]
194
+ }, person.userId))
195
+ }),
196
+ note && /* @__PURE__ */ jsx("p", {
197
+ role: "status",
198
+ className: "m-0 px-3 pb-2 text-xs text-[var(--zg-text-muted)]",
199
+ children: note
200
+ }),
201
+ error && /* @__PURE__ */ jsx(ErrorNote, {
202
+ className: "mx-3",
203
+ children: error
204
+ })
205
+ ]
206
+ });
207
+ }
208
+ /** Add person: an email, and whether they are an admin. */
209
+ function AddPerson({ busy, onAdd, onCancel }) {
210
+ const labels = useMachinesLabels();
211
+ const [email, setEmail] = useState("");
212
+ const [admin, setAdmin] = useState(false);
213
+ return /* @__PURE__ */ jsxs("form", {
214
+ className: "px-3 py-2 space-y-2",
215
+ onSubmit: (event) => {
216
+ event.preventDefault();
217
+ if (email.trim()) onAdd({
218
+ email: email.trim(),
219
+ role: admin ? "admin" : "user"
220
+ });
221
+ },
222
+ children: [/* @__PURE__ */ jsx("input", {
223
+ "aria-label": labels.machinesPeopleEmail,
224
+ placeholder: labels.machinesPeopleEmail,
225
+ type: "email",
226
+ autoComplete: "off",
227
+ autoFocus: true,
228
+ className: `${INPUT_CLASS} w-full`,
229
+ value: email,
230
+ onChange: (event) => setEmail(event.target.value),
231
+ onKeyDown: (event) => {
232
+ if (event.key === "Escape") {
233
+ event.stopPropagation();
234
+ onCancel();
235
+ }
236
+ }
237
+ }), /* @__PURE__ */ jsxs("div", {
238
+ className: "flex items-center justify-between gap-2",
239
+ children: [/* @__PURE__ */ jsxs("button", {
240
+ type: "button",
241
+ role: "checkbox",
242
+ "aria-checked": admin,
243
+ onClick: () => setAdmin((on) => !on),
244
+ className: "flex items-center gap-2 bg-transparent border-0 p-0 text-xs text-[var(--zg-text)] cursor-pointer",
245
+ children: [/* @__PURE__ */ jsx(Checkbox, { checked: admin }), /* @__PURE__ */ jsx("span", { children: labels.machinesPeopleAdmin })]
246
+ }), /* @__PURE__ */ jsxs("span", {
247
+ className: "flex gap-2",
248
+ children: [/* @__PURE__ */ jsx("button", {
249
+ type: "button",
250
+ className: buttonClass({
251
+ variant: "ghost",
252
+ size: "sm"
253
+ }),
254
+ onClick: onCancel,
255
+ children: labels.machinesCancel
256
+ }), /* @__PURE__ */ jsx("button", {
257
+ type: "submit",
258
+ className: BTN_PRIMARY,
259
+ disabled: busy || !email.trim(),
260
+ children: labels.machinesPeopleAdd
261
+ })]
262
+ })]
263
+ })]
264
+ });
265
+ }
266
+ export { OrganizationPanel };
@@ -0,0 +1,32 @@
1
+ /**
2
+ * "Yours on this server": what the signed-in user keeps for themselves on a
3
+ * server in organization mode (docs/IDENTITY.md, Per-user layers). Sessions
4
+ * they own there use it on top of the server's.
5
+ *
6
+ * - **API keys**: the providers they hold a key for (never the key), Add key,
7
+ * Remove in the ⋯ menu.
8
+ * - **MCP servers**: their servers reached over HTTP, Add server, Sign in
9
+ * (theirs alone, through the host's `signIn`), Sign out, Remove.
10
+ * - **Skills**: their skills, Add skill, Edit and Remove.
11
+ * - **SYSTEM.md**: theirs instead of the server's, Save and Remove.
12
+ *
13
+ * Needs the host's `layer`; nothing when the server does not sign its users in.
14
+ */
15
+ import { HostSummary } from "./headless/host.js";
16
+ import { CSSProperties } from "react";
17
+ /** Props for {@link PersonalLayerPanel}. */
18
+ export interface PersonalLayerPanelProps {
19
+ /** The server whose layer to show. */
20
+ host: HostSummary;
21
+ /** Extra classes on the root. */
22
+ className?: string;
23
+ /** Inline styles on the root. */
24
+ style?: CSSProperties;
25
+ }
26
+ /**
27
+ * Renders the signed-in user's keys, MCP servers, skills and SYSTEM.md on a server. Nothing without the host's
28
+ * `layer`, or when the server does not sign its users in.
29
+ *
30
+ * @param props - The server, `className` and `style`.
31
+ */
32
+ export declare function PersonalLayerPanel(props: PersonalLayerPanelProps): import("react").JSX.Element | null;