zidane-ui 9.2.2 → 9.3.1

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 (320) hide show
  1. package/dist/adapters/browser-keybindings-host.js +3 -1
  2. package/dist/adapters/live.d.ts +6 -0
  3. package/dist/adapters/live.js +16 -8
  4. package/dist/adapters/server-composer-host.js +22 -9
  5. package/dist/adapters/server-host.js +143 -18
  6. package/dist/adapters/server-media.d.ts +9 -1
  7. package/dist/adapters/server-media.js +14 -1
  8. package/dist/adapters/server-settings-host.js +30 -3
  9. package/dist/adapters/server-settings-sections.js +23 -1
  10. package/dist/adapters/server-sidebar-host.d.ts +3 -1
  11. package/dist/adapters/server-sidebar-host.js +10 -1
  12. package/dist/app/ModalProvider.js +1 -1
  13. package/dist/approvals/ApprovalShell.js +1 -1
  14. package/dist/chat/DaemonOrb.d.ts +29 -1
  15. package/dist/chat/DaemonOrb.js +25 -12
  16. package/dist/chat/HostTranscript.d.ts +0 -12
  17. package/dist/chat/HostTranscript.js +6 -1
  18. package/dist/chat/SessionStreamsProvider.d.ts +8 -0
  19. package/dist/chat/SessionStreamsProvider.js +11 -2
  20. package/dist/chat/StatusDot.js +8 -2
  21. package/dist/chat/Transcript.d.ts +20 -11
  22. package/dist/chat/Transcript.js +335 -162
  23. package/dist/chat/composer/ComposerEditor.js +1 -1
  24. package/dist/chat/headless/host.d.ts +43 -7
  25. package/dist/chat/headless/index.d.ts +8 -6
  26. package/dist/chat/headless/index.js +11 -9
  27. package/dist/chat/headless/labels.d.ts +30 -0
  28. package/dist/chat/headless/labels.js +29 -0
  29. package/dist/chat/headless/markdown-chunks.d.ts +2 -1
  30. package/dist/chat/headless/markdown-chunks.js +12 -20
  31. package/dist/chat/headless/markdown-scan.d.ts +66 -0
  32. package/dist/chat/headless/markdown-scan.js +124 -0
  33. package/dist/chat/headless/markdown-stream.d.ts +64 -0
  34. package/dist/chat/headless/markdown-stream.js +143 -0
  35. package/dist/chat/headless/output-pager.d.ts +68 -0
  36. package/dist/chat/headless/output-pager.js +113 -0
  37. package/dist/chat/headless/session-list.d.ts +20 -0
  38. package/dist/chat/headless/sidebar/activity.d.ts +14 -0
  39. package/dist/chat/headless/sidebar/activity.js +32 -0
  40. package/dist/chat/headless/sidebar/directory.d.ts +17 -2
  41. package/dist/chat/headless/sidebar/directory.js +50 -54
  42. package/dist/chat/headless/sidebar/environment.d.ts +5 -2
  43. package/dist/chat/headless/sidebar/environment.js +11 -2
  44. package/dist/chat/headless/sidebar/host.d.ts +15 -0
  45. package/dist/chat/headless/sidebar/inbox.d.ts +12 -3
  46. package/dist/chat/headless/sidebar/inbox.js +18 -9
  47. package/dist/chat/headless/sidebar/index.d.ts +2 -2
  48. package/dist/chat/headless/sidebar/index.js +2 -2
  49. package/dist/chat/headless/sidebar/labels.d.ts +38 -2
  50. package/dist/chat/headless/sidebar/labels.js +16 -0
  51. package/dist/chat/headless/sidebar/prewarm.d.ts +68 -0
  52. package/dist/chat/headless/sidebar/prewarm.js +114 -0
  53. package/dist/chat/headless/streams/actions.d.ts +2 -0
  54. package/dist/chat/headless/streams/actions.js +1 -0
  55. package/dist/chat/headless/streams/event-bytes.d.ts +6 -0
  56. package/dist/chat/headless/streams/event-bytes.js +34 -0
  57. package/dist/chat/headless/streams/live-events.d.ts +25 -1
  58. package/dist/chat/headless/streams/live-events.js +53 -2
  59. package/dist/chat/headless/streams/selectors.d.ts +3 -0
  60. package/dist/chat/headless/streams/selectors.js +8 -1
  61. package/dist/chat/headless/streams/session-streams.d.ts +15 -3
  62. package/dist/chat/headless/streams/session-streams.js +31 -3
  63. package/dist/chat/headless/streams/store.d.ts +24 -1
  64. package/dist/chat/headless/streams/store.js +51 -26
  65. package/dist/chat/headless/streams/transcript-map.d.ts +57 -0
  66. package/dist/chat/headless/streams/transcript-map.js +88 -0
  67. package/dist/chat/headless/streams/transcript.d.ts +4 -2
  68. package/dist/chat/headless/streams/transcript.js +19 -7
  69. package/dist/chat/headless/transcript/batch.js +5 -1
  70. package/dist/chat/headless/transcript/blob-media.d.ts +15 -0
  71. package/dist/chat/headless/transcript/blob-media.js +23 -0
  72. package/dist/chat/headless/transcript/collapse.d.ts +10 -0
  73. package/dist/chat/headless/transcript/collapse.js +32 -6
  74. package/dist/chat/headless/transcript/derive.d.ts +98 -0
  75. package/dist/chat/headless/transcript/derive.js +89 -0
  76. package/dist/chat/headless/transcript/exchange-media.d.ts +3 -1
  77. package/dist/chat/headless/transcript/exchange-media.js +8 -5
  78. package/dist/chat/headless/transcript/fold-actions.d.ts +8 -3
  79. package/dist/chat/headless/transcript/fold-actions.js +16 -0
  80. package/dist/chat/headless/transcript/fold-attachments.d.ts +2 -0
  81. package/dist/chat/headless/transcript/fold-attachments.js +3 -2
  82. package/dist/chat/headless/transcript/fold.d.ts +4 -2
  83. package/dist/chat/headless/transcript/fold.js +37 -7
  84. package/dist/chat/headless/transcript/incremental.d.ts +53 -0
  85. package/dist/chat/headless/transcript/incremental.js +181 -0
  86. package/dist/chat/headless/transcript/index.d.ts +2 -1
  87. package/dist/chat/headless/transcript/index.js +2 -1
  88. package/dist/chat/headless/transcript/nesting.js +2 -1
  89. package/dist/chat/headless/transcript/rail.d.ts +142 -0
  90. package/dist/chat/headless/transcript/rail.js +290 -0
  91. package/dist/chat/headless/transcript/rows.d.ts +11 -1
  92. package/dist/chat/headless/transcript/run-failures.d.ts +4 -0
  93. package/dist/chat/headless/transcript/run-failures.js +31 -2
  94. package/dist/chat/headless/transcript/seams.d.ts +78 -0
  95. package/dist/chat/headless/transcript/seams.js +116 -0
  96. package/dist/chat/headless/transcript/tool-media.d.ts +6 -7
  97. package/dist/chat/headless/transcript/tool-media.js +27 -9
  98. package/dist/chat/headless/transcript-labels.d.ts +1 -0
  99. package/dist/chat/headless/turn-labels.d.ts +1 -0
  100. package/dist/chat/headless/turn-labels.js +2 -1
  101. package/dist/chat/index.d.ts +10 -8
  102. package/dist/chat/index.js +9 -7
  103. package/dist/chat/interactions/ElicitationCard.js +1 -1
  104. package/dist/chat/interactions/InteractionCard.js +1 -1
  105. package/dist/chat/interactions/PlanCard.js +3 -3
  106. package/dist/chat/interactions/QuestionField.js +4 -4
  107. package/dist/chat/interactions/QuestionForm.js +3 -3
  108. package/dist/chat/interactions/SecretInput.js +1 -1
  109. package/dist/chat/sidebar/ProjectIcon.d.ts +1 -1
  110. package/dist/chat/sidebar/ProjectIcon.js +1 -1
  111. package/dist/chat/sidebar/RowChips.d.ts +3 -2
  112. package/dist/chat/sidebar/RowChips.js +6 -3
  113. package/dist/chat/sidebar/SessionSidebar.js +13 -14
  114. package/dist/chat/sidebar/SidebarFooter.d.ts +8 -5
  115. package/dist/chat/sidebar/SidebarFooter.js +6 -6
  116. package/dist/chat/sidebar/SidebarFrame.d.ts +2 -0
  117. package/dist/chat/sidebar/SidebarFrame.js +5 -2
  118. package/dist/chat/sidebar/SidebarSessionRow.d.ts +3 -1
  119. package/dist/chat/sidebar/SidebarSessionRow.js +3 -1
  120. package/dist/chat/sidebar/SpacesSection.d.ts +20 -1
  121. package/dist/chat/sidebar/SpacesSection.js +34 -13
  122. package/dist/chat/sidebar/index.d.ts +2 -2
  123. package/dist/chat/sidebar/session-menu.d.ts +11 -2
  124. package/dist/chat/sidebar/session-menu.js +50 -5
  125. package/dist/chat/sidebar/sidebar-live.js +1 -1
  126. package/dist/chat/sidebar/useInboxRows.js +43 -2
  127. package/dist/chat/sidebar/useInboxTriage.js +19 -14
  128. package/dist/chat/testing/contract.d.ts +5 -3
  129. package/dist/chat/testing/contract.js +66 -1
  130. package/dist/chat/testing/fixture-sidebar-host.d.ts +7 -1
  131. package/dist/chat/testing/fixture-sidebar-host.js +12 -0
  132. package/dist/chat/testing/sidebar.contract.d.ts +6 -0
  133. package/dist/chat/testing/sidebar.contract.js +24 -0
  134. package/dist/chat/transcript/DiffLines.d.ts +6 -1
  135. package/dist/chat/transcript/DiffLines.js +35 -20
  136. package/dist/chat/transcript/EditDiffBlock.d.ts +5 -1
  137. package/dist/chat/transcript/EditDiffBlock.js +89 -30
  138. package/dist/chat/transcript/InteractionToolBody.js +1 -1
  139. package/dist/chat/transcript/LazyRow.d.ts +40 -40
  140. package/dist/chat/transcript/LazyRow.js +101 -149
  141. package/dist/chat/transcript/MermaidDiagram.js +2 -1
  142. package/dist/chat/transcript/SelectCursor.d.ts +11 -1
  143. package/dist/chat/transcript/SelectCursor.js +10 -5
  144. package/dist/chat/transcript/SubagentBlock.js +3 -2
  145. package/dist/chat/transcript/TranscriptRail.d.ts +109 -0
  146. package/dist/chat/transcript/TranscriptRail.js +579 -0
  147. package/dist/chat/transcript/TranscriptRow.d.ts +4 -7
  148. package/dist/chat/transcript/TranscriptRow.js +9 -5
  149. package/dist/chat/transcript/actions.d.ts +43 -3
  150. package/dist/chat/transcript/actions.js +27 -1
  151. package/dist/chat/transcript/clipped-output.d.ts +58 -0
  152. package/dist/chat/transcript/clipped-output.js +131 -0
  153. package/dist/chat/transcript/fold-attachments.js +10 -5
  154. package/dist/chat/transcript/fold-worker.js +3 -2
  155. package/dist/chat/transcript/fold.js +21 -2
  156. package/dist/chat/transcript/index.d.ts +11 -9
  157. package/dist/chat/transcript/index.js +10 -8
  158. package/dist/chat/transcript/markdown-cache.d.ts +7 -1
  159. package/dist/chat/transcript/markdown-cache.js +12 -1
  160. package/dist/chat/transcript/markdown.js +116 -54
  161. package/dist/chat/transcript/media-gallery.d.ts +3 -2
  162. package/dist/chat/transcript/media-gallery.js +10 -7
  163. package/dist/chat/transcript/notices.d.ts +23 -1
  164. package/dist/chat/transcript/notices.js +110 -28
  165. package/dist/chat/transcript/prompt.js +6 -4
  166. package/dist/chat/transcript/prose.js +3 -1
  167. package/dist/chat/transcript/receipt-parts.d.ts +22 -0
  168. package/dist/chat/transcript/receipt-parts.js +87 -0
  169. package/dist/chat/transcript/root-items.d.ts +96 -0
  170. package/dist/chat/transcript/root-items.js +180 -0
  171. package/dist/chat/transcript/row-mount.d.ts +165 -0
  172. package/dist/chat/transcript/row-mount.js +498 -0
  173. package/dist/chat/transcript/row-parking.d.ts +125 -0
  174. package/dist/chat/transcript/row-parking.js +135 -0
  175. package/dist/chat/transcript/row-ui-state.d.ts +37 -0
  176. package/dist/chat/transcript/row-ui-state.js +53 -0
  177. package/dist/chat/transcript/run-rows.js +6 -78
  178. package/dist/chat/transcript/script-input.d.ts +1 -1
  179. package/dist/chat/transcript/scroll-clamp.js +1 -1
  180. package/dist/chat/transcript/tasks.js +3 -2
  181. package/dist/chat/transcript/tool-media.d.ts +4 -2
  182. package/dist/chat/transcript/tool-media.js +15 -7
  183. package/dist/chat/transcript/tool-parts.d.ts +27 -4
  184. package/dist/chat/transcript/tool-parts.js +31 -5
  185. package/dist/chat/transcript/tool-payload.js +26 -11
  186. package/dist/chat/transcript/tool-row.d.ts +2 -1
  187. package/dist/chat/transcript/tool-row.js +38 -19
  188. package/dist/chat/transcript/use-transcript-rows.d.ts +24 -7
  189. package/dist/chat/transcript/use-transcript-rows.js +28 -46
  190. package/dist/chat/transcript/useSettledReveal.js +15 -3
  191. package/dist/chat/transcript/useStickToBottom.js +4 -4
  192. package/dist/chat/transcript/useTranscriptSearch.js +30 -14
  193. package/dist/chat/transcript/view-scope.d.ts +26 -6
  194. package/dist/chat/transcript/view-scope.js +106 -20
  195. package/dist/components/ChoiceCards.js +1 -1
  196. package/dist/components/ConfirmDialog.js +1 -1
  197. package/dist/components/CopyValue.d.ts +33 -0
  198. package/dist/components/CopyValue.js +54 -0
  199. package/dist/components/Form.js +1 -1
  200. package/dist/components/HowItWorks.js +1 -1
  201. package/dist/components/Menu.js +1 -1
  202. package/dist/components/StepFrame.js +2 -2
  203. package/dist/components/SwatchPicker.js +1 -1
  204. package/dist/components/ToggleCard.js +1 -1
  205. package/dist/components/floating/HoverCard.js +2 -3
  206. package/dist/components/floating/hover-delay.d.ts +4 -0
  207. package/dist/components/floating/hover-delay.js +6 -0
  208. package/dist/core.css +14 -12
  209. package/dist/dist/{index-Betz0OWq.d.ts → index-C6-t1SS9.d.ts} +21 -2
  210. package/dist/dist/index-De9AbmxS.d.ts +1 -0
  211. package/dist/dist/index.d.ts +5 -5
  212. package/dist/dist/sandbox-CSUihARm.d.ts +2 -0
  213. package/dist/dist/{timeout-CyU7HLyz.d.ts → timeout-CmTx6V9y.d.ts} +1 -0
  214. package/dist/extensions/ExtensionDialogHost.js +1 -1
  215. package/dist/files/TreeColumn.js +3 -1
  216. package/dist/files/headless/host.d.ts +2 -2
  217. package/dist/git/ImportRepoDialog.js +1 -1
  218. package/dist/git/MoveSessionDialog.js +2 -2
  219. package/dist/git/SandboxManager.d.ts +42 -0
  220. package/dist/git/SandboxManager.js +297 -0
  221. package/dist/git/SyncChip.js +1 -1
  222. package/dist/git/headless/index.d.ts +2 -1
  223. package/dist/git/headless/index.js +2 -1
  224. package/dist/git/headless/labels.d.ts +29 -0
  225. package/dist/git/headless/labels.js +34 -1
  226. package/dist/git/headless/sandboxes.d.ts +43 -0
  227. package/dist/git/headless/sandboxes.js +52 -0
  228. package/dist/git/index.d.ts +2 -1
  229. package/dist/git/index.js +2 -1
  230. package/dist/index.d.ts +2 -1
  231. package/dist/index.js +2 -1
  232. package/dist/keybindings/headless/catalog.d.ts +1 -1
  233. package/dist/keybindings/headless/catalog.js +12 -0
  234. package/dist/machines/HostsSection.d.ts +1 -1
  235. package/dist/machines/headless/labels.js +2 -2
  236. package/dist/motion/flip-list.js +3 -10
  237. package/dist/motion/presence.d.ts +10 -0
  238. package/dist/motion/presence.js +20 -1
  239. package/dist/motion/swap.d.ts +8 -2
  240. package/dist/motion/swap.js +5 -2
  241. package/dist/onboarding/conversation.js +27 -15
  242. package/dist/onboarding/demos/how-it-works.js +1 -1
  243. package/dist/onboarding/skills/parts.js +4 -4
  244. package/dist/onboarding/sources/SourceBrowser.js +1 -1
  245. package/dist/onboarding/steps/ReadyStep.js +1 -1
  246. package/dist/onboarding/steps/connect/KeyForm.js +1 -1
  247. package/dist/palette/headless/app-sources.js +20 -0
  248. package/dist/palette/headless/labels.js +2 -0
  249. package/dist/session/PlanTracker.js +3 -3
  250. package/dist/session/SecretsPanel.js +1 -1
  251. package/dist/session/SessionHeader.d.ts +18 -6
  252. package/dist/session/SessionHeader.js +68 -12
  253. package/dist/session/SessionPlaceMenu.d.ts +35 -0
  254. package/dist/session/SessionPlaceMenu.js +299 -0
  255. package/dist/session/SessionShell.js +1 -1
  256. package/dist/session/TurnDetailsDialog.js +1 -1
  257. package/dist/session/headless/index.d.ts +2 -1
  258. package/dist/session/headless/index.js +2 -1
  259. package/dist/session/headless/labels.d.ts +73 -0
  260. package/dist/session/headless/labels.js +73 -0
  261. package/dist/session/headless/place.d.ts +49 -0
  262. package/dist/session/headless/place.js +57 -0
  263. package/dist/session/index.d.ts +2 -1
  264. package/dist/session/index.js +2 -1
  265. package/dist/settings/ConversationPresetsCard.js +1 -1
  266. package/dist/settings/SettingCard.js +2 -2
  267. package/dist/settings/SettingsRowsPage.js +1 -1
  268. package/dist/settings/headless/fixture-performance.js +4 -2
  269. package/dist/settings/headless/fixture-sections.js +7 -0
  270. package/dist/settings/headless/labels.d.ts +1 -1
  271. package/dist/settings/headless/labels.js +1 -1
  272. package/dist/settings/headless/layout.d.ts +4 -4
  273. package/dist/settings/headless/layout.js +1 -1
  274. package/dist/settings/headless/performance.d.ts +4 -0
  275. package/dist/settings/headless/search.d.ts +2 -2
  276. package/dist/settings/headless/sections-host.d.ts +20 -2
  277. package/dist/settings/sections/claude-import/ClaudeImportDialog.js +1 -1
  278. package/dist/settings/sections/enabled-list/EnabledListSection.js +2 -2
  279. package/dist/settings/sections/environments/EnvironmentsSection.d.ts +9 -3
  280. package/dist/settings/sections/environments/EnvironmentsSection.js +292 -52
  281. package/dist/settings/sections/environments/labels.d.ts +15 -0
  282. package/dist/settings/sections/environments/labels.js +18 -3
  283. package/dist/settings/sections/extensions/ChangeOriginDialog.js +1 -1
  284. package/dist/settings/sections/extensions/ExtensionSourceBrowser.js +1 -1
  285. package/dist/settings/sections/extensions/ExtensionsSection.d.ts +3 -2
  286. package/dist/settings/sections/extensions/ExtensionsSection.js +9 -3
  287. package/dist/settings/sections/host-catalog/HostCatalogSection.js +15 -5
  288. package/dist/settings/sections/keybindings/labels.d.ts +2 -0
  289. package/dist/settings/sections/keybindings/labels.js +2 -0
  290. package/dist/settings/sections/keybindings/rows.js +8 -0
  291. package/dist/settings/sections/models/SpacesDefaultsSection.d.ts +7 -3
  292. package/dist/settings/sections/models/SpacesDefaultsSection.js +11 -5
  293. package/dist/settings/sections/performance/PerformanceSection.js +8 -1
  294. package/dist/settings/sections/performance/labels.d.ts +2 -0
  295. package/dist/settings/sections/performance/labels.js +2 -0
  296. package/dist/settings/sections/skills/SkillGroups.js +1 -1
  297. package/dist/settings/server-app.d.ts +4 -2
  298. package/dist/settings/server-app.js +7 -3
  299. package/dist/settings/testing/sections.contract.d.ts +7 -1
  300. package/dist/settings/testing/sections.contract.js +37 -0
  301. package/dist/styles.css +243 -19
  302. package/dist/terminal/TerminalDrawer.js +3 -1
  303. package/dist/views/headless/answers.d.ts +8 -2
  304. package/dist/views/headless/answers.js +58 -1
  305. package/dist/views/headless/placement.d.ts +78 -0
  306. package/dist/views/headless/placement.js +154 -44
  307. package/dist/workspace/SidePanel.js +3 -1
  308. package/package.json +2 -2
  309. package/src/styles/base.css +13 -0
  310. package/src/styles/chat.css +30 -0
  311. package/src/styles/components.css +0 -10
  312. package/src/styles/files.css +5 -0
  313. package/src/styles/sidebar.css +29 -7
  314. package/src/styles/terminal.css +6 -0
  315. package/src/styles/tokens.css +5 -0
  316. package/src/styles/transcript.css +138 -0
  317. package/src/styles/workspace.css +6 -0
  318. package/dist/dist/index-QcFzZlao.d.ts +0 -1
  319. package/dist/dist/sandbox-D0zsW8I1.d.ts +0 -2
  320. /package/dist/dist/{types-_Dtoq_No.d.ts → execution-failure-SREfl-EZ.d.ts} +0 -0
@@ -1,10 +1,11 @@
1
1
  /**
2
- * Settings › General › Spaces: `SpacesSection` (`zidane-ui/chat/sidebar`,
2
+ * Settings › Workspace › Spaces: `SpacesSection` (`zidane-ui/chat/sidebar`,
3
3
  * over the settings host) with each space's defaults for new sessions under
4
4
  * it (agent, model, effort and options, where new chats start), each falling
5
5
  * back to Settings › Agent › Defaults while unset.
6
6
  */
7
7
  import { PlacePickerHosts } from "../../../chat/composer/PlacePicker.js";
8
+ import { SpacesHomeChoice } from "../../../chat/sidebar/SpacesSection.js";
8
9
  import { AgentDefaultsValue } from "./AgentDefaults.js";
9
10
  import { CSSProperties } from "react";
10
11
  import { Space } from "zidane/chat/pure";
@@ -14,6 +15,8 @@ export interface SpacesDefaultsSectionProps {
14
15
  cwd: string | null;
15
16
  /** What each space's place picker lists (the hosts, their machines). Absent: no place row. */
16
17
  places?: PlacePickerHosts;
18
+ /** Where the spaces come from (`SpacesSection`'s `home`). Absent: no row. */
19
+ home?: SpacesHomeChoice;
17
20
  /** Extra classes on each space's rows. */
18
21
  className?: string;
19
22
  /** Inline styles on each space's rows. */
@@ -24,7 +27,7 @@ export interface SpacesDefaultsSectionProps {
24
27
  *
25
28
  * @param props - Component props.
26
29
  */
27
- export declare function SpacesDefaultsSection({ cwd, places, className, style }: SpacesDefaultsSectionProps): import("react").JSX.Element;
30
+ export declare function SpacesDefaultsSection({ cwd, places, home, className, style }: SpacesDefaultsSectionProps): import("react").JSX.Element;
28
31
  /**
29
32
  * A space's defaults for new sessions, as the rows edit them.
30
33
  *
@@ -37,5 +40,6 @@ export declare function spaceDefaults(space: Space): AgentDefaultsValue;
37
40
  *
38
41
  * @param space - The space.
39
42
  * @param next - Its new defaults.
43
+ * @param accountLabel - The label of `next.model.account`, when known: kept beside the id (`Space.accountLabel`).
40
44
  */
41
- export declare function withSpaceDefaults(space: Space, next: AgentDefaultsValue): Space;
45
+ export declare function withSpaceDefaults(space: Space, next: AgentDefaultsValue, accountLabel?: string): Space;
@@ -1,3 +1,4 @@
1
+ import { useModelCatalog } from "../../../chat/composer/use-composer-stores.js";
1
2
  import { SpacesSection } from "../../../chat/sidebar/SpacesSection.js";
2
3
  import { SettingDemo } from "../../SettingDemo.js";
3
4
  import { useSettings } from "../../SettingsProvider.js";
@@ -11,17 +12,20 @@ import { readNewChatPlace } from "zidane/chat/pure";
11
12
  *
12
13
  * @param props - Component props.
13
14
  */
14
- function SpacesDefaultsSection({ cwd, places, className, style }) {
15
+ function SpacesDefaultsSection({ cwd, places, home, className, style }) {
15
16
  const { settings } = useSettings();
16
17
  const inherited = agentDefaultsOf(settings);
18
+ const { catalog } = useModelCatalog(null, cwd ?? void 0);
19
+ const labelOf = (model) => model?.account ? catalog?.find((e) => e.providerKey === model.providerKey && e.account?.id === model.account)?.account?.label : void 0;
17
20
  return /* @__PURE__ */ jsx(SpacesSection, {
21
+ ...home ? { home } : {},
18
22
  media: /* @__PURE__ */ jsx(SettingDemo, {
19
23
  demo: "spaces",
20
24
  on: settings.spaces === true
21
25
  }),
22
26
  renderDefaults: (space, update) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(AgentDefaultsRows, {
23
27
  value: spaceDefaults(space),
24
- onChange: (next) => update((s) => withSpaceDefaults(s, next)),
28
+ onChange: (next) => update((s) => withSpaceDefaults(s, next, labelOf(next.model))),
25
29
  cwd,
26
30
  inherited,
27
31
  className,
@@ -66,9 +70,10 @@ function spaceDefaults(space) {
66
70
  *
67
71
  * @param space - The space.
68
72
  * @param next - Its new defaults.
73
+ * @param accountLabel - The label of `next.model.account`, when known: kept beside the id (`Space.accountLabel`).
69
74
  */
70
- function withSpaceDefaults(space, next) {
71
- const { providerKey: _p, modelId: _m, account: _a, fallbacks, effort: _e, modelOptions: _o, agentId: _g, ...rest } = space;
75
+ function withSpaceDefaults(space, next, accountLabel) {
76
+ const { providerKey: _p, modelId: _m, account: _a, accountLabel: _l, fallbacks, effort: _e, modelOptions: _o, agentId: _g, ...rest } = space;
72
77
  const model = next.model;
73
78
  const chain = model ? fallbacks?.filter((f) => f.providerKey !== model.providerKey || f.modelId !== model.modelId) : void 0;
74
79
  return {
@@ -76,7 +81,8 @@ function withSpaceDefaults(space, next) {
76
81
  ...model ? {
77
82
  providerKey: model.providerKey,
78
83
  modelId: model.modelId,
79
- ...model.account ? { account: model.account } : {}
84
+ ...model.account ? { account: model.account } : {},
85
+ ...model.account && accountLabel ? { accountLabel } : {}
80
86
  } : {},
81
87
  ...chain && chain.length > 0 ? { fallbacks: chain } : {},
82
88
  ...next.effort ? { effort: next.effort } : {},
@@ -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",
@@ -128,7 +128,7 @@ function SkillGroupsArea({ cwd, groups, error, loaded, onRetry, skills, editing,
128
128
  });
129
129
  else if (!loaded) body = null;
130
130
  else if (groups.length === 0) body = /* @__PURE__ */ jsx("p", {
131
- className: "m-0 px-1 text-xs text-[var(--zg-text-muted)] zg-pretty",
131
+ className: "m-0 px-1 text-xs text-[var(--zg-text-muted)]",
132
132
  children: l.skillGroupsEmpty
133
133
  });
134
134
  else body = /* @__PURE__ */ jsx("ul", {
@@ -4,7 +4,7 @@
4
4
  * desktop, with the server's own sections for the panels. Its pages of rows
5
5
  * draw what the desktop's do: the cards, the model pickers, the agent
6
6
  * defaults and the conversation presets, over the server's catalogs. The server is the
7
- * app's only host: Accounts › Hosts draws its page (the `hosts` section), and the pages the
7
+ * app's only host: Advanced › Hosts draws its page (the `hosts` section), and the pages the
8
8
  * desktop keeps for this computer (Instructions, Environments, Keybindings)
9
9
  * are the server's or this browser's. A page the host leaves out hides:
10
10
  * Logs, Performance, and Files & editor without a files host.
@@ -24,7 +24,7 @@ export interface ServerAppSettingsOptions {
24
24
  cwd: string | null;
25
25
  /** The open session (`null`: none): Instructions shows its prompt. */
26
26
  sessionId: string | null;
27
- /** Accounts › Hosts: the server's own section (`ServerDetail`, `zidane-ui/machines`). */
27
+ /** Advanced › Hosts: the server's own section (`ServerDetail`, `zidane-ui/machines`). */
28
28
  hosts: () => ReactNode;
29
29
  /** The app's actions (`{ action }` rows). */
30
30
  actions?: readonly SettingsAction[];
@@ -36,6 +36,8 @@ export interface ServerAppSettingsOptions {
36
36
  files?: boolean;
37
37
  /** What Files & editor takes besides the folder. */
38
38
  editor?: Omit<EditorSectionProps, 'cwd'>;
39
+ /** Opens one of the server's sessions (the app closes Settings): Environments › Manage links to it. */
40
+ onOpenSession?: (sessionId: string) => void;
39
41
  }
40
42
  /** The sections and the nav's counts. */
41
43
  export interface ServerAppSettings {
@@ -29,7 +29,7 @@ const NO_ACTIONS = [];
29
29
  * @param options - The server's name, the folder and session, the server page and the app's extras.
30
30
  */
31
31
  function useServerAppSettingsSections(options) {
32
- const { hostName, cwd, sessionId, hosts, actions = NO_ACTIONS, spaces, extensions, files = false, editor } = options;
32
+ const { hostName, cwd, sessionId, hosts, actions = NO_ACTIONS, spaces, extensions, files = false, editor, onOpenSession } = options;
33
33
  const host = useSettingsHost();
34
34
  const labels = useSettingsLabels();
35
35
  const hasLogs = Boolean(host.logs);
@@ -60,7 +60,10 @@ function useServerAppSettingsSections(options) {
60
60
  sessionId,
61
61
  localFiles: false
62
62
  });
63
- case "environments": return /* @__PURE__ */ jsx(EnvironmentsSection, { cwd });
63
+ case "environments": return /* @__PURE__ */ jsx(EnvironmentsSection, {
64
+ cwd,
65
+ ...onOpenSession ? { onOpenSession } : {}
66
+ });
64
67
  case "logs": return /* @__PURE__ */ jsx(LogsSection, {});
65
68
  case "performance": return /* @__PURE__ */ jsx(PerformanceSection, {});
66
69
  case "appearance": return /* @__PURE__ */ jsx(AppearanceSection, {});
@@ -108,7 +111,8 @@ function useServerAppSettingsSections(options) {
108
111
  spaces,
109
112
  extensions,
110
113
  editor,
111
- labels
114
+ labels,
115
+ onOpenSession
112
116
  ]),
113
117
  counts: useServerAppPageCounts(pages, cwd)
114
118
  };
@@ -18,7 +18,7 @@ import { SettingsHost } from "../headless/host.js";
18
18
  import { SettingsCatalogKind, SettingsExtension, SettingsPlugin } from "../headless/sections-host.js";
19
19
  import { LogRecord } from "zidane/chat/pure";
20
20
  import { SkillConfig } from "zidane";
21
- import { ContextSegmentsReport, EnvironmentDescriptor, EnvironmentSettingsChange } from "zidane/chat";
21
+ import { ContextSegmentsReport, EnvironmentDescriptor, EnvironmentFieldChoice, EnvironmentSandboxSummary, EnvironmentSettingsChange } from "zidane/chat";
22
22
  /** A catalog or diagnostics group of `SettingsHost`. */
23
23
  export type SettingsSectionsCapability = 'skills' | 'extensions' | 'plugins' | 'instructions' | 'environments' | 'logs' | 'hostCatalog' | 'paths';
24
24
  /** What the backend behind the host holds. */
@@ -33,6 +33,10 @@ export interface SettingsSectionsBackend {
33
33
  instructions: Record<string, ContextSegmentsReport>;
34
34
  /** The environment kinds. */
35
35
  environments: EnvironmentDescriptor[];
36
+ /** Each kind's sandboxes at its provider (Manage). Absent: the contract's own. */
37
+ sandboxes?: Record<string, EnvironmentSandboxSummary[]>;
38
+ /** Each listed option's values, by `kind:key`. Absent: the contract's own. */
39
+ fieldChoices?: Record<string, EnvironmentFieldChoice[]>;
36
40
  /** The log records held. */
37
41
  logs: LogRecord[];
38
42
  /** `null`: the host can't list its catalogs (an older server). */
@@ -46,6 +50,8 @@ export interface SettingsSectionsControl {
46
50
  extensionNames: () => string[];
47
51
  /** Environment edits the backend took, in order. */
48
52
  environmentChanges: () => readonly EnvironmentSettingsChange[];
53
+ /** What was done to the sandboxes (`pause:e2b:sb-1`), in order. Given exactly when the host offers `environments.sandboxes`. */
54
+ sandboxActions?: () => readonly string[];
49
55
  /** The backend logs a record. */
50
56
  log: (record: LogRecord) => void;
51
57
  /** One of the host's catalogs changed there (another client installed something). */
@@ -76,6 +76,25 @@ const ENVIRONMENTS = [{
76
76
  canVerify: false,
77
77
  fields: []
78
78
  }];
79
+ const SANDBOXES = { e2b: [{
80
+ id: "sb-1",
81
+ state: "running",
82
+ session: {
83
+ id: "s1",
84
+ title: "Fix the parser",
85
+ current: true
86
+ }
87
+ }, {
88
+ id: "sb-2",
89
+ state: "paused",
90
+ template: "base"
91
+ }] };
92
+ const FIELD_CHOICES = { "e2b:template": [{
93
+ value: "base",
94
+ label: "base",
95
+ facts: ["2 CPU"],
96
+ origin: "platform"
97
+ }] };
79
98
  const LOG = {
80
99
  level: "warn",
81
100
  message: "setup() slow",
@@ -115,6 +134,8 @@ function backendOf(over = {}) {
115
134
  plugins: structuredClone(PLUGINS),
116
135
  instructions: { s1: structuredClone(REPORT) },
117
136
  environments: structuredClone(ENVIRONMENTS),
137
+ sandboxes: structuredClone(SANDBOXES),
138
+ fieldChoices: structuredClone(FIELD_CHOICES),
118
139
  logs: [structuredClone(LOG)],
119
140
  hostCatalog: structuredClone(CATALOGS),
120
141
  ...over
@@ -202,6 +223,22 @@ function describeSettingsSectionsContract(name, makeHarness, capabilities) {
202
223
  enabled: true
203
224
  }]);
204
225
  });
226
+ it.skipIf(!has("environments"))("environments: lists a kind's sandboxes and pauses or deletes one, when it offers that", async () => {
227
+ const { host, control } = await setup();
228
+ const environments = host.environments;
229
+ expect(environments.sandboxes === void 0).toBe(control.sandboxActions === void 0);
230
+ if (!environments.sandboxes) return;
231
+ expect(await environments.sandboxes("e2b")).toEqual(SANDBOXES.e2b);
232
+ await environments.pauseSandbox?.("e2b", "sb-1");
233
+ await environments.deleteSandbox?.("e2b", "sb-2");
234
+ expect(control.sandboxActions?.()).toEqual([...environments.pauseSandbox ? ["pause:e2b:sb-1"] : [], ...environments.deleteSandbox ? ["delete:e2b:sb-2"] : []]);
235
+ });
236
+ it.skipIf(!has("environments"))("environments: lists a listed option's values, when it offers that", async () => {
237
+ const { host } = await setup();
238
+ const fieldChoices = host.environments.fieldChoices;
239
+ if (!fieldChoices) return;
240
+ expect(await fieldChoices("e2b", "template")).toEqual(FIELD_CHOICES["e2b:template"]);
241
+ });
205
242
  it.skipIf(!has("logs"))("logs: lists the held records and follows new ones", async () => {
206
243
  const { host, control } = await setup();
207
244
  expect((await host.logs.list()).map((r) => r.message)).toEqual(["setup() slow"]);