zidane-ui 9.1.13 → 9.1.16

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 (290) hide show
  1. package/dist/adapters/index.d.ts +2 -2
  2. package/dist/adapters/index.js +2 -2
  3. package/dist/adapters/live.d.ts +29 -3
  4. package/dist/adapters/live.js +9 -1
  5. package/dist/adapters/server-composer-host.js +17 -2
  6. package/dist/adapters/server-extensions-host.d.ts +0 -1
  7. package/dist/adapters/server-extensions-host.js +4 -15
  8. package/dist/adapters/server-git-host.js +7 -16
  9. package/dist/adapters/server-host.js +181 -43
  10. package/dist/adapters/server-machines-host.d.ts +2 -0
  11. package/dist/adapters/server-machines-host.js +22 -23
  12. package/dist/adapters/server-onboarding-host.d.ts +1 -1
  13. package/dist/adapters/server-onboarding-host.js +3 -4
  14. package/dist/adapters/server-session-host.js +22 -3
  15. package/dist/adapters/server-settings-accounts.js +2 -2
  16. package/dist/adapters/server-settings-host.js +2 -2
  17. package/dist/adapters/server-settings-performance.js +7 -9
  18. package/dist/adapters/server-settings-sections.js +13 -14
  19. package/dist/adapters/server-sidebar-host.js +2 -2
  20. package/dist/adapters/sse-host.js +68 -3
  21. package/dist/adapters/sse-protocol.d.ts +12 -2
  22. package/dist/adapters/sse-protocol.js +4 -2
  23. package/dist/app/AppHostProvider.js +4 -3
  24. package/dist/app/ModalProvider.d.ts +13 -3
  25. package/dist/app/ModalProvider.js +103 -24
  26. package/dist/app/NoticeStack.d.ts +33 -0
  27. package/dist/app/NoticeStack.js +90 -0
  28. package/dist/app/index.d.ts +3 -2
  29. package/dist/app/index.js +3 -2
  30. package/dist/chat/SessionFilterMenu.d.ts +1 -1
  31. package/dist/chat/SessionFilterMenu.js +2 -1
  32. package/dist/chat/composer/Composer.js +10 -8
  33. package/dist/chat/composer/ModelChainList.js +17 -8
  34. package/dist/chat/composer/ModelChainTooltip.js +5 -2
  35. package/dist/chat/composer/use-draft-target.d.ts +20 -1
  36. package/dist/chat/composer/use-draft-target.js +121 -5
  37. package/dist/chat/composer/use-new-session-defaults.d.ts +5 -1
  38. package/dist/chat/composer/use-new-session-defaults.js +17 -4
  39. package/dist/chat/headless/chip-labels.d.ts +1 -0
  40. package/dist/chat/headless/chip-labels.js +1 -0
  41. package/dist/chat/headless/composer/labels-editor.d.ts +0 -2
  42. package/dist/chat/headless/composer/labels-editor.js +0 -2
  43. package/dist/chat/headless/draft-target.d.ts +21 -1
  44. package/dist/chat/headless/fixture-host.js +17 -2
  45. package/dist/chat/headless/host.d.ts +3 -3
  46. package/dist/chat/headless/index.d.ts +9 -9
  47. package/dist/chat/headless/index.js +2 -2
  48. package/dist/chat/headless/labels.d.ts +13 -6
  49. package/dist/chat/headless/labels.js +10 -9
  50. package/dist/chat/headless/session-list.d.ts +20 -8
  51. package/dist/chat/headless/session-list.js +1 -0
  52. package/dist/chat/headless/sidebar/directory.d.ts +56 -14
  53. package/dist/chat/headless/sidebar/directory.js +149 -70
  54. package/dist/chat/headless/sidebar/index.d.ts +3 -3
  55. package/dist/chat/headless/sidebar/index.js +2 -2
  56. package/dist/chat/headless/sidebar/labels.d.ts +15 -8
  57. package/dist/chat/headless/sidebar/types.d.ts +3 -1
  58. package/dist/chat/headless/sidebar/view.d.ts +13 -5
  59. package/dist/chat/headless/sidebar/view.js +31 -11
  60. package/dist/chat/headless/streams/actions.d.ts +5 -3
  61. package/dist/chat/headless/streams/actions.js +3 -2
  62. package/dist/chat/headless/streams/index.d.ts +3 -3
  63. package/dist/chat/headless/streams/merge.d.ts +6 -10
  64. package/dist/chat/headless/streams/merge.js +7 -21
  65. package/dist/chat/headless/streams/session-streams.d.ts +29 -4
  66. package/dist/chat/headless/streams/session-streams.js +86 -0
  67. package/dist/chat/headless/streams/store.d.ts +162 -16
  68. package/dist/chat/headless/streams/store.js +334 -38
  69. package/dist/chat/headless/streams/types.d.ts +10 -7
  70. package/dist/chat/headless/transcript-labels.d.ts +1 -0
  71. package/dist/chat/interactions/PlanCard.js +10 -3
  72. package/dist/chat/interactions/QuestionForm.js +7 -3
  73. package/dist/chat/interactions/card-ui.d.ts +5 -3
  74. package/dist/chat/interactions/card-ui.js +9 -7
  75. package/dist/chat/rich-composer/RichComposer.js +1 -7
  76. package/dist/chat/rich-composer/composer-extensions.d.ts +0 -2
  77. package/dist/chat/rich-composer/composer-extensions.js +2 -2
  78. package/dist/chat/rich-composer/use-composer-editor.d.ts +0 -2
  79. package/dist/chat/rich-composer/use-composer-editor.js +1 -2
  80. package/dist/chat/sidebar/SessionSidebar.js +5 -5
  81. package/dist/chat/sidebar/SidebarFilterMenu.js +3 -1
  82. package/dist/chat/sidebar/SidebarFrame.d.ts +4 -0
  83. package/dist/chat/sidebar/SidebarFrame.js +27 -9
  84. package/dist/chat/sidebar/SidebarGroupHeader.js +1 -1
  85. package/dist/chat/sidebar/SidebarHostProvider.d.ts +8 -5
  86. package/dist/chat/sidebar/SidebarHostProvider.js +13 -9
  87. package/dist/chat/sidebar/SidebarToggleButton.js +7 -3
  88. package/dist/chat/sidebar/index.d.ts +2 -2
  89. package/dist/chat/sidebar/session-menu.js +4 -4
  90. package/dist/chat/sidebar/useSaveViewAsSpace.js +2 -2
  91. package/dist/chat/testing/contract.js +2 -2
  92. package/dist/chat/transcript/AuthFailureCard.js +11 -8
  93. package/dist/chat/transcript/BadgeMenu.js +13 -2
  94. package/dist/chat/transcript/MermaidDiagram.js +7 -3
  95. package/dist/chat/transcript/fold.d.ts +4 -0
  96. package/dist/chat/transcript/fold.js +53 -22
  97. package/dist/chat/transcript/script-input.d.ts +1 -1
  98. package/dist/chat/transcript/shell-block.js +7 -3
  99. package/dist/chat/transcript/useStickToBottom.js +12 -0
  100. package/dist/components/BrowserSignIn.js +23 -21
  101. package/dist/components/Form.d.ts +6 -4
  102. package/dist/components/Form.js +16 -8
  103. package/dist/components/LoadError.d.ts +4 -2
  104. package/dist/components/LoadError.js +13 -9
  105. package/dist/components/Notice.d.ts +29 -0
  106. package/dist/components/Notice.js +63 -0
  107. package/dist/components/PanelEmpty.d.ts +1 -1
  108. package/dist/components/PanelEmpty.js +4 -2
  109. package/dist/components/Restricted.d.ts +1 -1
  110. package/dist/components/palette/PaletteList.js +8 -1
  111. package/dist/components/palette/PalettePanel.js +14 -6
  112. package/dist/core.css +24 -5
  113. package/dist/dist/{index-Bq87OcGy.d.ts → index-BZM8tu4L.d.ts} +28 -3
  114. package/dist/dist/index.d.ts +2 -2
  115. package/dist/dist/{timeout-B5pO5I5a.d.ts → timeout-Cyx3VGPz.d.ts} +1 -1
  116. package/dist/extensions/ExtensionSettingsPage.js +1 -4
  117. package/dist/extensions/ExtensionSettingsSection.js +4 -3
  118. package/dist/extensions/ExtensionSettingsSidebar.js +2 -6
  119. package/dist/extensions/SettingsWireForm.d.ts +1 -7
  120. package/dist/extensions/SettingsWireForm.js +7 -5
  121. package/dist/extensions/headless/fixture-host.d.ts +1 -5
  122. package/dist/extensions/headless/fixture-host.js +1 -4
  123. package/dist/extensions/headless/host.d.ts +1 -11
  124. package/dist/extensions/headless/index.d.ts +3 -3
  125. package/dist/extensions/headless/index.js +2 -2
  126. package/dist/extensions/headless/select.d.ts +1 -11
  127. package/dist/extensions/headless/select.js +1 -18
  128. package/dist/files/EditorColumn.js +12 -1
  129. package/dist/files/TreeColumn.js +13 -20
  130. package/dist/files/useOpenFiles.js +2 -0
  131. package/dist/git/BranchMenu.js +5 -3
  132. package/dist/git/ImportRepoDialog.js +18 -9
  133. package/dist/git/MoveSessionDialog.js +15 -7
  134. package/dist/git/RemoteFolderPicker.js +34 -16
  135. package/dist/git/SyncChip.js +17 -17
  136. package/dist/git/WherePicker.d.ts +16 -1
  137. package/dist/git/WherePicker.js +80 -36
  138. package/dist/git/headless/environment.d.ts +33 -3
  139. package/dist/git/headless/environment.js +33 -5
  140. package/dist/git/headless/index.d.ts +2 -2
  141. package/dist/git/headless/index.js +2 -2
  142. package/dist/git/headless/labels.d.ts +15 -2
  143. package/dist/git/headless/labels.js +17 -4
  144. package/dist/git/useEnvironmentChoices.d.ts +3 -1
  145. package/dist/git/useEnvironmentChoices.js +6 -3
  146. package/dist/index.d.ts +2 -1
  147. package/dist/index.js +2 -1
  148. package/dist/labels.d.ts +5 -0
  149. package/dist/labels.js +5 -0
  150. package/dist/machines/AddMachineDialog.d.ts +34 -0
  151. package/dist/machines/AddMachineDialog.js +464 -0
  152. package/dist/machines/Banners.d.ts +33 -4
  153. package/dist/machines/Banners.js +64 -3
  154. package/dist/machines/DaemonMenu.js +27 -4
  155. package/dist/machines/HostCapabilities.d.ts +1 -3
  156. package/dist/machines/HostCapabilities.js +24 -45
  157. package/dist/machines/HostSyncPanel.js +123 -129
  158. package/dist/machines/HostsSection.d.ts +4 -1
  159. package/dist/machines/HostsSection.js +30 -7
  160. package/dist/machines/MachinesExplainer.d.ts +17 -0
  161. package/dist/machines/MachinesExplainer.js +71 -0
  162. package/dist/machines/MachinesProvider.d.ts +14 -2
  163. package/dist/machines/MachinesProvider.js +35 -1
  164. package/dist/machines/ServerAddedCard.d.ts +31 -0
  165. package/dist/machines/ServerAddedCard.js +72 -0
  166. package/dist/machines/ServerCard.js +91 -215
  167. package/dist/machines/ServerMachinesPanel.d.ts +2 -2
  168. package/dist/machines/ServerMachinesPanel.js +184 -323
  169. package/dist/machines/ServerUpdatePanel.js +51 -40
  170. package/dist/machines/ShareThisComputerForm.d.ts +19 -0
  171. package/dist/machines/ShareThisComputerForm.js +133 -0
  172. package/dist/machines/TokensPanel.d.ts +5 -3
  173. package/dist/machines/TokensPanel.js +98 -78
  174. package/dist/machines/headless/fixture-host.d.ts +19 -3
  175. package/dist/machines/headless/fixture-host.js +42 -5
  176. package/dist/machines/headless/fixtures.js +4 -6
  177. package/dist/machines/headless/host.d.ts +40 -19
  178. package/dist/machines/headless/index.d.ts +3 -3
  179. package/dist/machines/headless/index.js +2 -2
  180. package/dist/machines/headless/labels.d.ts +63 -20
  181. package/dist/machines/headless/labels.js +88 -25
  182. package/dist/machines/headless/messages.js +8 -0
  183. package/dist/machines/headless/stores.d.ts +9 -2
  184. package/dist/machines/headless/stores.js +28 -1
  185. package/dist/machines/index.d.ts +7 -3
  186. package/dist/machines/index.js +8 -4
  187. package/dist/machines/testing/contract.d.ts +15 -3
  188. package/dist/machines/testing/contract.js +68 -14
  189. package/dist/motion/grow.d.ts +8 -1
  190. package/dist/motion/grow.js +10 -4
  191. package/dist/onboarding/demos/index.js +1 -1
  192. package/dist/onboarding/headless/labels.d.ts +13 -0
  193. package/dist/onboarding/headless/labels.js +8 -0
  194. package/dist/onboarding/index.js +3 -3
  195. package/dist/onboarding/sources/SourceBrowser.js +11 -7
  196. package/dist/onboarding/steps/ConnectorsStep.js +1 -1
  197. package/dist/onboarding/steps/ImportStep.js +4 -1
  198. package/dist/onboarding/steps/ReadyStep.js +9 -2
  199. package/dist/onboarding/steps/SkillsStep.js +1 -1
  200. package/dist/onboarding/steps/connect/KeyForm.js +6 -2
  201. package/dist/onboarding/steps/connect/ProviderPanel.js +6 -2
  202. package/dist/onboarding/steps/connect/ProviderReady.js +25 -20
  203. package/dist/onboarding/steps/tasks.js +17 -14
  204. package/dist/server/sse-handler.js +141 -19
  205. package/dist/session/ArtifactsPanel.js +39 -17
  206. package/dist/session/PlanTracker.js +12 -7
  207. package/dist/session/ProjectHome.js +13 -11
  208. package/dist/session/RemindersPanel.js +34 -16
  209. package/dist/session/RunningWorkDialog.js +6 -2
  210. package/dist/session/SecretsPanel.js +29 -10
  211. package/dist/session/SessionDetailsDialog.d.ts +1 -1
  212. package/dist/session/SessionDetailsDialog.js +18 -10
  213. package/dist/session/SideChat.js +10 -7
  214. package/dist/session/TurnDetailsDialog.js +19 -5
  215. package/dist/session/UsagePanel.js +10 -4
  216. package/dist/session/headless/host.d.ts +2 -0
  217. package/dist/session/headless/labels.d.ts +19 -1
  218. package/dist/session/headless/labels.js +15 -1
  219. package/dist/session/headless/queue.js +2 -1
  220. package/dist/session/headless/reminder-labels.d.ts +4 -0
  221. package/dist/session/headless/reminder-labels.js +4 -0
  222. package/dist/settings/SettingsRestricted.d.ts +1 -1
  223. package/dist/settings/SettingsRestricted.js +4 -4
  224. package/dist/settings/SettingsShell.d.ts +7 -0
  225. package/dist/settings/SettingsShell.js +6 -1
  226. package/dist/settings/headless/fixture-performance.d.ts +1 -1
  227. package/dist/settings/headless/host.d.ts +2 -2
  228. package/dist/settings/headless/labels.d.ts +3 -3
  229. package/dist/settings/headless/labels.js +3 -3
  230. package/dist/settings/headless/performance.d.ts +3 -4
  231. package/dist/settings/headless/search.d.ts +1 -1
  232. package/dist/settings/index.d.ts +2 -1
  233. package/dist/settings/index.js +2 -1
  234. package/dist/settings/sections/editor/EditorSection.js +7 -4
  235. package/dist/settings/sections/editor/labels.d.ts +1 -0
  236. package/dist/settings/sections/editor/labels.js +1 -0
  237. package/dist/settings/sections/environments/EnvironmentsSection.js +19 -12
  238. package/dist/settings/sections/environments/labels.d.ts +1 -0
  239. package/dist/settings/sections/environments/labels.js +2 -1
  240. package/dist/settings/sections/extensions/ExtensionConfigRows.d.ts +1 -3
  241. package/dist/settings/sections/extensions/ExtensionConfigRows.js +20 -19
  242. package/dist/settings/sections/extensions/ExtensionOptionsSection.js +2 -1
  243. package/dist/settings/sections/extensions/options-labels.d.ts +2 -1
  244. package/dist/settings/sections/extensions/options-labels.js +2 -1
  245. package/dist/settings/sections/index.d.ts +2 -1
  246. package/dist/settings/sections/index.js +2 -1
  247. package/dist/settings/sections/logs/LogsSection.d.ts +2 -2
  248. package/dist/settings/sections/logs/LogsSection.js +2 -2
  249. package/dist/settings/sections/mcp/McpSection.d.ts +1 -1
  250. package/dist/settings/sections/mcp/McpSection.js +12 -6
  251. package/dist/settings/sections/mcp/McpServerRow.js +20 -13
  252. package/dist/settings/sections/mcp/labels.d.ts +8 -2
  253. package/dist/settings/sections/mcp/labels.js +8 -2
  254. package/dist/settings/sections/models/ModelRows.js +1 -1
  255. package/dist/settings/sections/models/NewChatPlaceRow.d.ts +26 -0
  256. package/dist/settings/sections/models/NewChatPlaceRow.js +78 -0
  257. package/dist/settings/sections/models/SpacesDefaultsSection.js +15 -3
  258. package/dist/settings/sections/models/labels.d.ts +7 -0
  259. package/dist/settings/sections/models/labels.js +7 -0
  260. package/dist/settings/sections/models/model-test.js +7 -4
  261. package/dist/settings/sections/performance/PerformanceSection.js +16 -6
  262. package/dist/settings/sections/performance/labels.d.ts +1 -1
  263. package/dist/settings/sections/performance/labels.js +1 -1
  264. package/dist/settings/sections/providers/ProvidersSection.d.ts +1 -1
  265. package/dist/settings/sections/providers/ProvidersSection.js +14 -7
  266. package/dist/settings/sections/providers/ServerProvidersSection.d.ts +1 -1
  267. package/dist/settings/sections/providers/ServerProvidersSection.js +11 -5
  268. package/dist/settings/sections/providers/labels.d.ts +2 -2
  269. package/dist/settings/sections/providers/labels.js +2 -2
  270. package/dist/settings/sections/skills/SkillList.js +1 -1
  271. package/dist/settings/sections/skills/SkillsSection.js +1 -1
  272. package/dist/settings/testing/performance.contract.js +8 -12
  273. package/dist/styles.css +32 -3
  274. package/dist/terminal/HostTerminalSurface.js +15 -5
  275. package/dist/terminal/TerminalPanel.js +30 -17
  276. package/dist/terminal/TerminalSurface.js +11 -4
  277. package/dist/terminal/headless/labels.d.ts +5 -0
  278. package/dist/terminal/headless/labels.js +5 -0
  279. package/dist/terminal/headless/store.d.ts +1 -1
  280. package/dist/terminal/headless/store.js +6 -3
  281. package/dist/workspace/LayoutBudget.d.ts +5 -1
  282. package/dist/workspace/LayoutBudget.js +14 -1
  283. package/dist/workspace/PanelContentView.d.ts +1 -1
  284. package/dist/workspace/PanelContentView.js +17 -6
  285. package/dist/workspace/WorkspaceProvider.js +3 -2
  286. package/dist/workspace/headless/labels.d.ts +1 -0
  287. package/dist/workspace/headless/labels.js +1 -0
  288. package/package.json +3 -3
  289. package/src/styles/motion.css +8 -0
  290. package/src/styles/primitives.css +7 -0
@@ -50,6 +50,14 @@ function daemonStatusText(status, now = Date.now(), labels = DEFAULT_MACHINES_LA
50
50
  title: labels.machinesDaemonNewer,
51
51
  detail: labels.machinesDaemonNewerDetail(versions)
52
52
  };
53
+ if (status.refused?.direction === "daemon-older" && status.refused.startsOlder) return {
54
+ title: labels.machinesDaemonCliOlder,
55
+ detail: labels.machinesDaemonCliOlderDetail(versions)
56
+ };
57
+ if (status.refused?.direction === "daemon-older" && status.refused.busy) return {
58
+ title: labels.machinesDaemonOlderBusy,
59
+ detail: labels.machinesDaemonOlderBusyDetail(versions)
60
+ };
53
61
  if (status.refused?.direction === "daemon-older") return {
54
62
  title: labels.machinesDaemonOlder,
55
63
  detail: labels.machinesDaemonOlderDetail(versions)
@@ -1,5 +1,5 @@
1
1
  import { Readable } from "../../chat/headless/store.js";
2
- import { MachineList } from "./host.js";
2
+ import { MachineList, MachineListState } from "./host.js";
3
3
  import { MachineInfo } from "zidane/chat/pure";
4
4
  //#region src/machines/headless/stores.d.ts
5
5
  /** A store and how to set it, for {@link lazyReadable}'s `start`. */
@@ -32,6 +32,13 @@ declare function lazyReadable<T>(initial: T, start: (sink: LazySink<T>) => () =>
32
32
  * @param listen - Calls back with the server id whenever one of its machines changed status; returns how to stop.
33
33
  */
34
34
  declare function createMachineLists(load: (hostId: string) => Promise<readonly MachineInfo[]>, listen: (onChange: (hostId: string) => void) => () => void): (hostId: string) => MachineList;
35
+ /**
36
+ * Several servers' machine lists as one store: each server's machines by its id, the same map until one list
37
+ * changes. A list that is still loading or failed counts as no machines.
38
+ *
39
+ * @param lists - Each server's id and its list state ({@link createMachineLists}' `state`).
40
+ */
41
+ declare function machinesByHost(lists: readonly (readonly [string, Readable<MachineListState>])[]): Readable<ReadonlyMap<string, readonly MachineInfo[]>>;
35
42
  /**
36
43
  * The names of the machines last heard online, from status pushes. It keeps listening once read, so a
37
44
  * machine that comes back while nothing shows the list still counts.
@@ -43,4 +50,4 @@ declare function createOnlineMachines(listen: (onChange: (change: {
43
50
  status: 'online' | 'offline';
44
51
  }) => void) => () => void): Readable<ReadonlySet<string>>;
45
52
  //#endregion
46
- export { LazyReadableOptions, LazySink, createMachineLists, createOnlineMachines, lazyReadable };
53
+ export { LazyReadableOptions, LazySink, createMachineLists, createOnlineMachines, lazyReadable, machinesByHost };
@@ -96,6 +96,33 @@ function createMachineLists(load, listen) {
96
96
  return list;
97
97
  };
98
98
  }
99
+ const NO_MACHINES = /* @__PURE__ */ new Map();
100
+ /**
101
+ * Several servers' machine lists as one store: each server's machines by its id, the same map until one list
102
+ * changes. A list that is still loading or failed counts as no machines.
103
+ *
104
+ * @param lists - Each server's id and its list state ({@link createMachineLists}' `state`).
105
+ */
106
+ function machinesByHost(lists) {
107
+ let parts = null;
108
+ let map = NO_MACHINES;
109
+ return {
110
+ get() {
111
+ const next = lists.map(([, state]) => state.get());
112
+ if (parts === null || next.some((part, i) => part !== parts[i])) {
113
+ parts = next;
114
+ map = new Map(lists.map(([hostId], i) => [hostId, next[i].machines]));
115
+ }
116
+ return map;
117
+ },
118
+ subscribe(onChange) {
119
+ const offs = lists.map(([, state]) => state.subscribe(onChange));
120
+ return () => {
121
+ for (const off of offs) off();
122
+ };
123
+ }
124
+ };
125
+ }
99
126
  /**
100
127
  * The names of the machines last heard online, from status pushes. It keeps listening once read, so a
101
128
  * machine that comes back while nothing shows the list still counts.
@@ -111,4 +138,4 @@ function createOnlineMachines(listen) {
111
138
  }), { keepAlive: true });
112
139
  }
113
140
  //#endregion
114
- export { createMachineLists, createOnlineMachines, lazyReadable };
141
+ export { createMachineLists, createOnlineMachines, lazyReadable, machinesByHost };
@@ -1,17 +1,21 @@
1
+ import { AddMachineDialog, AddMachineDialogProps, AddMachineTab, OpenAddMachine, useAddMachine } from "./AddMachineDialog.js";
1
2
  import { AddServerForm, AddServerFormProps } from "./AddServerForm.js";
2
- import { ComposerNotice, ComposerNoticeProps, HostRemovedBanner, HostRemovedBannerProps, MachineWaitingBanner, MachineWaitingBannerProps, ServerOfflineBanner, ServerOfflineBannerProps } from "./Banners.js";
3
- import { MachinesConfirm, MachinesProvider, MachinesProviderProps, useLentServers, useMachinesConfirm, useMachinesHost, useMachinesLabels, useOnlineMachines, usePermitted, usePresenceMap, useSessionPresence } from "./MachinesProvider.js";
3
+ import { ComposerNotice, ComposerNoticeProps, DraftPlaceNotice, DraftPlaceNoticeProps, HostRemovedBanner, HostRemovedBannerProps, MachineWaitingBanner, MachineWaitingBannerProps, ServerOfflineBanner, ServerOfflineBannerProps } from "./Banners.js";
4
+ import { MachinesConfirm, MachinesProvider, MachinesProviderProps, useLentServers, useMachinesBridge, useMachinesConfirm, useMachinesHost, useMachinesLabels, useOnlineMachines, usePermitted, usePresenceMap, useServerMachines, useSessionPresence } from "./MachinesProvider.js";
4
5
  import { DaemonMenu, DaemonMenuProps } from "./DaemonMenu.js";
5
6
  import { CapabilitiesView, CapabilitiesViewProps, CapabilityTags, CapabilityTagsProps, HostCapabilitiesState, useHostCapabilities } from "./HostCapabilities.js";
6
7
  import { HostSignIn, HostSignInProps } from "./HostSignIn.js";
7
8
  import { HostSyncPanel, HostSyncPanelProps, useHostSync } from "./HostSyncPanel.js";
9
+ import { NewChatsServer, ServerAddedCard, ServerAddedCardProps } from "./ServerAddedCard.js";
8
10
  import { HostsSection, HostsSectionProps } from "./HostsSection.js";
11
+ import { MachinesExplainer, MachinesExplainerProps } from "./MachinesExplainer.js";
9
12
  import { CopyText, CopyTextProps, HOST_CARD_ICON_CLASS, HOST_NAME_MAX, HOST_TOKEN_MAX, HOST_URL_MAX, ServerCard, ServerCardProps, escapeCancels } from "./ServerCard.js";
10
13
  import { ServerMachinesPanel, ServerMachinesPanelProps } from "./ServerMachinesPanel.js";
11
14
  import { ServerUpdatePanel, ServerUpdatePanelProps } from "./ServerUpdatePanel.js";
15
+ import { ShareThisComputerForm, ShareThisComputerFormProps } from "./ShareThisComputerForm.js";
12
16
  import { SyncAccounts, SyncAccountsProps } from "./SyncAccounts.js";
13
17
  import { SyncMarker, SyncMarkerProps, useServerSyncStatus } from "./SyncMarker.js";
14
18
  import { SyncOutcomeBadge, SyncOutcomeBadgeProps } from "./SyncOutcomeBadge.js";
15
19
  import { TokensPanel, TokensPanelProps } from "./TokensPanel.js";
16
20
  import { hostsSettingsSection } from "./settings-section.js";
17
- export { AddServerForm, AddServerFormProps, CapabilitiesView, CapabilitiesViewProps, CapabilityTags, CapabilityTagsProps, ComposerNotice, ComposerNoticeProps, CopyText, CopyTextProps, DaemonMenu, DaemonMenuProps, HOST_CARD_ICON_CLASS, HOST_NAME_MAX, HOST_TOKEN_MAX, HOST_URL_MAX, HostCapabilitiesState, HostRemovedBanner, HostRemovedBannerProps, HostSignIn, HostSignInProps, HostSyncPanel, HostSyncPanelProps, HostsSection, HostsSectionProps, MachineWaitingBanner, MachineWaitingBannerProps, MachinesConfirm, MachinesProvider, MachinesProviderProps, ServerCard, ServerCardProps, ServerMachinesPanel, ServerMachinesPanelProps, ServerOfflineBanner, ServerOfflineBannerProps, ServerUpdatePanel, ServerUpdatePanelProps, SyncAccounts, SyncAccountsProps, SyncMarker, SyncMarkerProps, SyncOutcomeBadge, SyncOutcomeBadgeProps, TokensPanel, TokensPanelProps, escapeCancels, hostsSettingsSection, useHostCapabilities, useHostSync, useLentServers, useMachinesConfirm, useMachinesHost, useMachinesLabels, useOnlineMachines, usePermitted, usePresenceMap, useServerSyncStatus, useSessionPresence };
21
+ export { AddMachineDialog, AddMachineDialogProps, AddMachineTab, AddServerForm, AddServerFormProps, CapabilitiesView, CapabilitiesViewProps, CapabilityTags, CapabilityTagsProps, ComposerNotice, ComposerNoticeProps, CopyText, CopyTextProps, DaemonMenu, DaemonMenuProps, DraftPlaceNotice, DraftPlaceNoticeProps, HOST_CARD_ICON_CLASS, HOST_NAME_MAX, HOST_TOKEN_MAX, HOST_URL_MAX, HostCapabilitiesState, HostRemovedBanner, HostRemovedBannerProps, HostSignIn, HostSignInProps, HostSyncPanel, HostSyncPanelProps, HostsSection, HostsSectionProps, MachineWaitingBanner, MachineWaitingBannerProps, MachinesConfirm, MachinesExplainer, MachinesExplainerProps, MachinesProvider, MachinesProviderProps, NewChatsServer, OpenAddMachine, ServerAddedCard, ServerAddedCardProps, ServerCard, ServerCardProps, ServerMachinesPanel, ServerMachinesPanelProps, ServerOfflineBanner, ServerOfflineBannerProps, ServerUpdatePanel, ServerUpdatePanelProps, ShareThisComputerForm, ShareThisComputerFormProps, SyncAccounts, SyncAccountsProps, SyncMarker, SyncMarkerProps, SyncOutcomeBadge, SyncOutcomeBadgeProps, TokensPanel, TokensPanelProps, escapeCancels, hostsSettingsSection, useAddMachine, useHostCapabilities, useHostSync, useLentServers, useMachinesBridge, useMachinesConfirm, useMachinesHost, useMachinesLabels, useOnlineMachines, usePermitted, usePresenceMap, useServerMachines, useServerSyncStatus, useSessionPresence };
@@ -1,17 +1,21 @@
1
- import { MachinesProvider, useLentServers, useMachinesConfirm, useMachinesHost, useMachinesLabels, useOnlineMachines, usePermitted, usePresenceMap, useSessionPresence } from "./MachinesProvider.js";
1
+ import { MachinesProvider, useLentServers, useMachinesBridge, useMachinesConfirm, useMachinesHost, useMachinesLabels, useOnlineMachines, usePermitted, usePresenceMap, useServerMachines, useSessionPresence } from "./MachinesProvider.js";
2
+ import { ShareThisComputerForm } from "./ShareThisComputerForm.js";
3
+ import { AddMachineDialog, useAddMachine } from "./AddMachineDialog.js";
2
4
  import { CopyText, HOST_CARD_ICON_CLASS, HOST_NAME_MAX, HOST_TOKEN_MAX, HOST_URL_MAX, ServerCard, escapeCancels } from "./ServerCard.js";
3
5
  import { AddServerForm } from "./AddServerForm.js";
4
- import { ComposerNotice, HostRemovedBanner, MachineWaitingBanner, ServerOfflineBanner } from "./Banners.js";
6
+ import { ComposerNotice, DraftPlaceNotice, HostRemovedBanner, MachineWaitingBanner, ServerOfflineBanner } from "./Banners.js";
5
7
  import { DaemonMenu } from "./DaemonMenu.js";
6
8
  import { CapabilitiesView, CapabilityTags, useHostCapabilities } from "./HostCapabilities.js";
7
9
  import { HostSignIn } from "./HostSignIn.js";
8
10
  import { SyncAccounts } from "./SyncAccounts.js";
9
11
  import { SyncOutcomeBadge } from "./SyncOutcomeBadge.js";
10
12
  import { HostSyncPanel, useHostSync } from "./HostSyncPanel.js";
13
+ import { MachinesExplainer } from "./MachinesExplainer.js";
14
+ import { ServerAddedCard } from "./ServerAddedCard.js";
11
15
  import { ServerMachinesPanel } from "./ServerMachinesPanel.js";
12
16
  import { ServerUpdatePanel } from "./ServerUpdatePanel.js";
17
+ import { TokensPanel } from "./TokensPanel.js";
13
18
  import { HostsSection } from "./HostsSection.js";
14
19
  import { SyncMarker, useServerSyncStatus } from "./SyncMarker.js";
15
- import { TokensPanel } from "./TokensPanel.js";
16
20
  import { hostsSettingsSection } from "./settings-section.js";
17
- export { AddServerForm, CapabilitiesView, CapabilityTags, ComposerNotice, CopyText, DaemonMenu, HOST_CARD_ICON_CLASS, HOST_NAME_MAX, HOST_TOKEN_MAX, HOST_URL_MAX, HostRemovedBanner, HostSignIn, HostSyncPanel, HostsSection, MachineWaitingBanner, MachinesProvider, ServerCard, ServerMachinesPanel, ServerOfflineBanner, ServerUpdatePanel, SyncAccounts, SyncMarker, SyncOutcomeBadge, TokensPanel, escapeCancels, hostsSettingsSection, useHostCapabilities, useHostSync, useLentServers, useMachinesConfirm, useMachinesHost, useMachinesLabels, useOnlineMachines, usePermitted, usePresenceMap, useServerSyncStatus, useSessionPresence };
21
+ export { AddMachineDialog, AddServerForm, CapabilitiesView, CapabilityTags, ComposerNotice, CopyText, DaemonMenu, DraftPlaceNotice, HOST_CARD_ICON_CLASS, HOST_NAME_MAX, HOST_TOKEN_MAX, HOST_URL_MAX, HostRemovedBanner, HostSignIn, HostSyncPanel, HostsSection, MachineWaitingBanner, MachinesExplainer, MachinesProvider, ServerAddedCard, ServerCard, ServerMachinesPanel, ServerOfflineBanner, ServerUpdatePanel, ShareThisComputerForm, SyncAccounts, SyncMarker, SyncOutcomeBadge, TokensPanel, escapeCancels, hostsSettingsSection, useAddMachine, useHostCapabilities, useHostSync, useLentServers, useMachinesBridge, useMachinesConfirm, useMachinesHost, useMachinesLabels, useOnlineMachines, usePermitted, usePresenceMap, useServerMachines, useServerSyncStatus, useSessionPresence };
@@ -1,10 +1,10 @@
1
1
  import { SessionPresence } from "../headless/presence.js";
2
- import { DaemonStatus, HostCheckResult, MachineInfo as MachineInfo$1, MachineLinksStatus as MachineLinksStatus$1, MachinesHost, ServerToken, ServerTokenScope, ServerUpdateStatus as ServerUpdateStatus$1 } from "../headless/host.js";
2
+ import { DaemonStatus, HostCheckResult, MachineInfo as MachineInfo$1, MachineJoinEvent as MachineJoinEvent$1, MachineLinksStatus as MachineLinksStatus$1, MachinesHost, ServerToken, ServerUpdateStatus as ServerUpdateStatus$1 } from "../headless/host.js";
3
3
  import { MachinesSyncCapability, MachinesSyncContractBackend, MachinesSyncHarness, MachinesSyncHarnessFactory, describeMachinesSyncContract } from "./sync.contract.js";
4
4
  import { HostCapabilities } from "zidane/chat/pure";
5
5
  //#region src/machines/testing/contract.d.ts
6
6
  /** An optional `MachinesHost` member, by its path. */
7
- type MachinesHostCapability = 'hosts' | 'refreshHosts' | 'retry' | 'testHost' | 'addHost' | 'renameHost' | 'setHostUrl' | 'removeHost' | 'savedHosts' | 'machines' | 'machines.forget' | 'machines.invite' | 'links' | 'links.shareStart' | 'links.shareStop' | 'links.useServer' | 'pickFolder' | 'updates' | 'updates.check' | 'updates.install' | 'updates.configure' | 'tokens' | 'tokens.create' | 'tokens.revoke' | 'tokens.onChanged' | 'daemon' | 'daemon.reconnect' | 'daemon.restart' | 'daemon.stopRun' | 'daemon.relaunchApp' | 'presence' | 'capabilities' | 'installTool' | 'permitted';
7
+ type MachinesHostCapability = 'hosts' | 'refreshHosts' | 'retry' | 'testHost' | 'addHost' | 'renameHost' | 'setHostUrl' | 'removeHost' | 'savedHosts' | 'machines' | 'machines.forget' | 'machines.invite' | 'machines.onJoin' | 'links' | 'links.shareStart' | 'links.shareStop' | 'links.useServer' | 'pickFolder' | 'newChat' | 'updates' | 'updates.check' | 'updates.install' | 'updates.configure' | 'tokens' | 'tokens.create' | 'tokens.revoke' | 'tokens.pair' | 'tokens.onChanged' | 'daemon' | 'daemon.reconnect' | 'daemon.restart' | 'daemon.stopRun' | 'daemon.relaunchApp' | 'presence' | 'capabilities' | 'installTool' | 'permitted';
8
8
  /** What the backend behind the host holds, and what it records. */
9
9
  interface MachinesHostContractBackend {
10
10
  /**
@@ -73,15 +73,25 @@ interface MachinesHostContractBackend {
73
73
  /** The backend calls this when an update action reaches it: {@link update} changes. */
74
74
  updated(action: 'check' | 'install' | 'configure', enabled?: boolean): void;
75
75
  /** The backend calls this when a token is created, and answers with what it returns. */
76
- created(name: string, scope: ServerTokenScope): ServerToken & {
76
+ created(name: string): ServerToken & {
77
77
  token: string;
78
78
  };
79
+ /** The backend calls this when a browser pairing code is asked for, and answers with what it returns. */
80
+ paired(params: {
81
+ name?: string;
82
+ ttlMs?: number;
83
+ }): {
84
+ code: string;
85
+ expiresAt: number;
86
+ };
79
87
  /** The backend calls this when a revoke reaches it. */
80
88
  revoked(id: string): void;
81
89
  /** The backend calls this when a link action reaches it: {@link links} changes. */
82
90
  linked(action: 'shareStart' | 'shareStop' | 'useServer', detail?: unknown): void;
83
91
  /** The backend calls this when a daemon action reaches it. */
84
92
  daemonCalled(action: 'reconnect' | 'restart' | 'stopRun' | 'relaunchApp', detail?: unknown): void;
93
+ /** The app calls this when New chat reaches it: the server, and the machine's name when on one. */
94
+ chatOpened(hostId: string, machine?: string): void;
85
95
  }
86
96
  /** A host built over a contract backend, and the pushes its backend can make. */
87
97
  interface MachinesHostHarness {
@@ -89,6 +99,8 @@ interface MachinesHostHarness {
89
99
  host: MachinesHost;
90
100
  /** Sets a machine's status in the backend and pushes the change, as the backend does. */
91
101
  pushMachineStatus(machineId: string, status: 'online' | 'offline'): void;
102
+ /** Pushes what became of a join code, as the backend does (needed for `machines.onJoin`). */
103
+ pushJoin?(event: MachineJoinEvent$1): void;
92
104
  /** Sets the backend's presence and pushes the snapshot, as the backend does (needed for `presence`). */
93
105
  pushPresence?(sessions: SessionPresence[]): void;
94
106
  /** Adds a token elsewhere (another page, the CLI) and says so, as the backend does (needed for `tokens.onChanged`). */
@@ -31,11 +31,13 @@ const CAPABILITIES = [
31
31
  "machines",
32
32
  "machines.forget",
33
33
  "machines.invite",
34
+ "machines.onJoin",
34
35
  "links",
35
36
  "links.shareStart",
36
37
  "links.shareStop",
37
38
  "links.useServer",
38
39
  "pickFolder",
40
+ "newChat",
39
41
  "updates",
40
42
  "updates.check",
41
43
  "updates.install",
@@ -43,6 +45,7 @@ const CAPABILITIES = [
43
45
  "tokens",
44
46
  "tokens.create",
45
47
  "tokens.revoke",
48
+ "tokens.pair",
46
49
  "tokens.onChanged",
47
50
  "daemon",
48
51
  "daemon.reconnect",
@@ -98,7 +101,7 @@ function contractBackend() {
98
101
  tokens: [{
99
102
  id: "tok_1",
100
103
  name: "phone",
101
- scope: "chat",
104
+ scope: "client",
102
105
  createdAt: 17e11
103
106
  }],
104
107
  links: {
@@ -144,9 +147,7 @@ function contractBackend() {
144
147
  allows: {
145
148
  remoteInstalls: true,
146
149
  asMachine: false,
147
- sync: true,
148
- clone: true,
149
- createFolders: true
150
+ sync: true
150
151
  },
151
152
  workspace: {
152
153
  roots: ["/data"],
@@ -234,15 +235,12 @@ function contractBackend() {
234
235
  state: "installing"
235
236
  };
236
237
  },
237
- created(name, scope) {
238
- record("token.create", {
239
- name,
240
- scope
241
- });
238
+ created(name) {
239
+ record("token.create", { name });
242
240
  const token = {
243
241
  id: `tok_${backend.tokens.length + 1}`,
244
242
  name,
245
- scope,
243
+ scope: "client",
246
244
  createdAt: 17e11
247
245
  };
248
246
  backend.tokens = [...backend.tokens, token];
@@ -251,6 +249,13 @@ function contractBackend() {
251
249
  token: "zds_secret"
252
250
  };
253
251
  },
252
+ paired(params) {
253
+ record("token.pair", params);
254
+ return {
255
+ code: "P4IR-C0DE",
256
+ expiresAt: 17000006e5
257
+ };
258
+ },
254
259
  revoked(id) {
255
260
  record("token.revoke", id);
256
261
  backend.tokens = backend.tokens.map((t) => t.id === id ? {
@@ -285,7 +290,11 @@ function contractBackend() {
285
290
  }] : []
286
291
  };
287
292
  },
288
- daemonCalled: (action, detail) => record(`daemon.${action}`, detail)
293
+ daemonCalled: (action, detail) => record(`daemon.${action}`, detail),
294
+ chatOpened: (hostId, machine) => record("newChat", {
295
+ hostId,
296
+ machine
297
+ })
289
298
  };
290
299
  return {
291
300
  backend,
@@ -481,6 +490,43 @@ function describeMachinesHostContract(name, makeHarness, capabilities) {
481
490
  }]));
482
491
  }
483
492
  });
493
+ it.skipIf(!has("machines.onJoin"))("tells what became of a join code, until unsubscribed", async () => {
494
+ const harness = await setup();
495
+ const heard = [];
496
+ const off = harness.host.machines.onJoin(harness.id, (event) => void heard.push(event));
497
+ harness.pushJoin({
498
+ pairingId: "K7Q2",
499
+ outcome: "refused",
500
+ reason: "name-taken",
501
+ name: "desk"
502
+ });
503
+ await waitFor(() => expect(heard).toEqual([{
504
+ pairingId: "K7Q2",
505
+ outcome: "refused",
506
+ reason: "name-taken",
507
+ name: "desk"
508
+ }]));
509
+ off();
510
+ harness.pushJoin({
511
+ pairingId: "K7Q2",
512
+ outcome: "joined",
513
+ name: "desk"
514
+ });
515
+ await new Promise((resolve) => setTimeout(resolve, 20));
516
+ expect(heard).toHaveLength(1);
517
+ });
518
+ it.skipIf(!has("newChat"))("opens a new chat on the server, or on one of its machines", async () => {
519
+ const { host, id, calls: recorded } = await setup();
520
+ host.newChat(id);
521
+ host.newChat(id, "laptop");
522
+ await waitFor(() => expect(calls(recorded, "newChat").map((c) => c.detail)).toEqual([{
523
+ hostId: id,
524
+ machine: void 0
525
+ }, {
526
+ hostId: id,
527
+ machine: "laptop"
528
+ }]));
529
+ });
484
530
  it.skipIf(!has("pickFolder"))("picks a folder", async () => {
485
531
  const { host, backend } = await setup();
486
532
  expect(await host.pickFolder()).toBe(backend.folder);
@@ -529,13 +575,13 @@ function describeMachinesHostContract(name, makeHarness, capabilities) {
529
575
  ])).toEqual([[
530
576
  "tok_1",
531
577
  "phone",
532
- "chat"
578
+ "client"
533
579
  ]]);
534
580
  if (tokens.create) {
535
- const created = await tokens.create(id, "laptop", "admin");
581
+ const created = await tokens.create(id, "laptop");
536
582
  expect(created).toMatchObject({
537
583
  name: "laptop",
538
- scope: "admin"
584
+ scope: "client"
539
585
  });
540
586
  expect(typeof created.token).toBe("string");
541
587
  expect((await tokens.list(id)).map((t) => t.name)).toContain("laptop");
@@ -545,6 +591,14 @@ function describeMachinesHostContract(name, makeHarness, capabilities) {
545
591
  expect((await tokens.list(id)).find((t) => t.id === "tok_1")?.revokedAt).toBeTypeOf("number");
546
592
  }
547
593
  });
594
+ it.skipIf(!has("tokens.pair"))("makes a one-time code a browser logs in with", async () => {
595
+ const { host, id, calls: recorded } = await setup();
596
+ expect(await host.tokens.pair(id)).toMatchObject({
597
+ code: "P4IR-C0DE",
598
+ expiresAt: expect.any(Number)
599
+ });
600
+ expect(calls(recorded, "token.pair")).toHaveLength(1);
601
+ });
548
602
  it.skipIf(!has("tokens.onChanged"))("hears when the tokens change elsewhere", async () => {
549
603
  const { host, backend, id, pushTokenCreated } = await setup();
550
604
  const heard = vi.fn();
@@ -17,6 +17,13 @@ interface GrowProps {
17
17
  axis?: 'x' | 'y';
18
18
  /** Grow in when mounted. When `false`, the block starts open, for rows rendered with their list. */
19
19
  appear: boolean;
20
+ /**
21
+ * Shrink out on the same motion it grows in on (`settle`), not the quicker `exit`. For a list
22
+ * that swaps rows (one leaves as another arrives, the live fold's stack): the two curves mirror
23
+ * each other, so the list keeps its height through the swap instead of dipping and recovering.
24
+ * @default false
25
+ */
26
+ symmetric?: boolean;
20
27
  /** Extra classes on the element. */
21
28
  className?: string;
22
29
  /** Inline styles on the element. */
@@ -39,6 +46,6 @@ interface GrowProps {
39
46
  *
40
47
  * @param props - Component props.
41
48
  */
42
- declare function Grow({ as: Tag, axis, appear, className, style, children, ...rest }: GrowProps): import("react").JSX.Element;
49
+ declare function Grow({ as: Tag, axis, appear, symmetric, className, style, children, ...rest }: GrowProps): import("react").JSX.Element;
43
50
  //#endregion
44
51
  export { Grow, GrowPresence, GrowProps };
@@ -1,4 +1,4 @@
1
- import { readExitMs } from "./presence.js";
1
+ import { readExitMs, readMotionMs } from "./presence.js";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { useLayoutEffect, useRef, useState } from "react";
4
4
  import { AnimatePresence as GrowPresence, usePresence } from "motion/react";
@@ -21,7 +21,7 @@ import { AnimatePresence as GrowPresence, usePresence } from "motion/react";
21
21
  *
22
22
  * @param props - Component props.
23
23
  */
24
- function Grow({ as: Tag = "div", axis = "y", appear, className = "", style, children, ...rest }) {
24
+ function Grow({ as: Tag = "div", axis = "y", appear, symmetric = false, className = "", style, children, ...rest }) {
25
25
  const [isPresent, safeToRemove] = usePresence();
26
26
  const ref = useRef(null);
27
27
  const [entered, setEntered] = useState(!appear);
@@ -32,14 +32,20 @@ function Grow({ as: Tag = "div", axis = "y", appear, className = "", style, chil
32
32
  }, [entered]);
33
33
  useLayoutEffect(() => {
34
34
  if (isPresent) return void 0;
35
- const id = setTimeout(() => safeToRemove?.(), readExitMs());
35
+ const ms = symmetric ? Math.max(readMotionMs("settle"), readExitMs()) : readExitMs();
36
+ const id = setTimeout(() => safeToRemove?.(), ms);
36
37
  return () => clearTimeout(id);
37
- }, [isPresent, safeToRemove]);
38
+ }, [
39
+ isPresent,
40
+ safeToRemove,
41
+ symmetric
42
+ ]);
38
43
  return /* @__PURE__ */ jsx(Tag, {
39
44
  ref,
40
45
  className: `zg-grow ${className}`,
41
46
  "data-shown": entered && isPresent ? "" : void 0,
42
47
  "data-axis": axis === "x" ? "x" : void 0,
48
+ "data-symmetric": symmetric ? "" : void 0,
43
49
  style,
44
50
  ...rest,
45
51
  children: /* @__PURE__ */ jsx("div", {
@@ -1,6 +1,6 @@
1
1
  import { DemoStage } from "./parts.js";
2
- import { TUTORIAL_SCENES } from "./how-it-works.js";
3
2
  import { ApprovalDemo, SandboxDemo } from "./autonomy.js";
3
+ import { TUTORIAL_SCENES } from "./how-it-works.js";
4
4
  import { DeliveryDemo } from "./delivery.js";
5
5
  import { ExtensionDemo } from "./extensions.js";
6
6
  import { FeatureDemo, hasFeatureDemo } from "./features.js";
@@ -11,6 +11,10 @@ declare const DEFAULT_ONBOARDING_LABELS: {
11
11
  done: string;
12
12
  notNow: string;
13
13
  saveFailed: (message: string) => string;
14
+ /** A source that did not load in the source browser; what went wrong folds under Details. */
15
+ sourceLoadFailed: string;
16
+ /** The Claude Code setup that could not be read in Bring your setup. */
17
+ importPreviewFailed: string;
14
18
  recommended: string;
15
19
  usedIn: (step: string) => string;
16
20
  fullSetupDetail: string;
@@ -36,6 +40,8 @@ declare const DEFAULT_ONBOARDING_LABELS: {
36
40
  testOk: (model: string, seconds: string) => string;
37
41
  testFailed: string;
38
42
  testAgain: string;
43
+ keySaveFailed: string;
44
+ installFailed: string;
39
45
  connectFirst: string;
40
46
  importFrom: (agent: string) => string;
41
47
  importNothing: string;
@@ -232,6 +238,8 @@ declare const DEFAULT_ONBOARDING_LABELS: {
232
238
  taskDone: string;
233
239
  taskFailed: string;
234
240
  taskNeedsSignIn: string;
241
+ /** A failed background task's line; its error folds under Details. */
242
+ taskFailedNote: string;
235
243
  signIn: string;
236
244
  recapLookSystem: (dark: string, light: string) => string;
237
245
  recapAccent: (accent: string) => string;
@@ -308,6 +316,9 @@ declare const DEFAULT_ONBOARDING_LABELS: {
308
316
  working: string;
309
317
  loading: string;
310
318
  retry: string;
319
+ noticeDetails: string;
320
+ noticeStack: string;
321
+ noticeDismiss: string;
311
322
  filePath: (path: string) => string;
312
323
  rename: string;
313
324
  current: string;
@@ -325,6 +336,7 @@ declare const DEFAULT_ONBOARDING_LABELS: {
325
336
  modalBack: string;
326
337
  screenBack: (screen: string) => string;
327
338
  screenBackKey: string;
339
+ screenNavBack: (screen: string) => string;
328
340
  paletteLabel: string;
329
341
  paletteFilter: string;
330
342
  paletteBack: string;
@@ -389,6 +401,7 @@ declare const DEFAULT_ONBOARDING_LABELS: {
389
401
  openInNewTab: string;
390
402
  terminal: string;
391
403
  terminalLoadFailed: (message: string) => string;
404
+ terminalStartFailed: string;
392
405
  terminalExited: (code: number) => string;
393
406
  };
394
407
  /** The setup wizard's strings: {@link DEFAULT_ONBOARDING_LABELS}' keys. */
@@ -37,6 +37,10 @@ const DEFAULT_ONBOARDING_LABELS = {
37
37
  done: "Done",
38
38
  notNow: "Not now",
39
39
  saveFailed: (message) => `The setup was not saved. ${message}`,
40
+ /** A source that did not load in the source browser; what went wrong folds under Details. */
41
+ sourceLoadFailed: "The source did not load.",
42
+ /** The Claude Code setup that could not be read in Bring your setup. */
43
+ importPreviewFailed: "Couldn't read this setup.",
40
44
  recommended: "recommended",
41
45
  usedIn: (step) => `Used in ${step}`,
42
46
  fullSetupDetail: "Choose your provider, tools, look and how zidane works.",
@@ -62,6 +66,8 @@ const DEFAULT_ONBOARDING_LABELS = {
62
66
  testOk: (model, seconds) => `${model} answered in ${seconds} s`,
63
67
  testFailed: "The model did not answer",
64
68
  testAgain: "Test again",
69
+ keySaveFailed: "Couldn't save the key.",
70
+ installFailed: "Couldn't install it.",
65
71
  connectFirst: "Connect a provider to continue",
66
72
  importFrom: (agent) => `From ${agent}`,
67
73
  importNothing: "Nothing new to copy",
@@ -304,6 +310,8 @@ const DEFAULT_ONBOARDING_LABELS = {
304
310
  taskDone: "Done",
305
311
  taskFailed: "Failed",
306
312
  taskNeedsSignIn: "Needs sign-in",
313
+ /** A failed background task's line; its error folds under Details. */
314
+ taskFailedNote: "It didn't finish.",
307
315
  signIn: "Sign in",
308
316
  recapLookSystem: (dark, light) => `${dark} and ${light}, as the system picks`,
309
317
  recapAccent: (accent) => `${accent} accent`,
@@ -1,13 +1,13 @@
1
1
  import { OnboardingHostProvider, OnboardingProvider, useOnboarding, useOnboardingHost, useOnboardingLabels, useOnboardingStep } from "./OnboardingProvider.js";
2
2
  import { useSignIn } from "./useSignIn.js";
3
3
  import { ExtensionMark, NATIVE_EXTENSION_ICONS, ProviderMark, extensionMarkOf } from "./marks.js";
4
- import { DemoStage } from "./demos/parts.js";
5
- import { TUTORIAL_SCENES } from "./demos/how-it-works.js";
6
- import { Tutorial } from "./tutorials.js";
7
4
  import { ConnectProviderCard } from "./ConnectProviderCard.js";
5
+ import { DemoStage } from "./demos/parts.js";
8
6
  import { ApprovalDemo, SandboxDemo } from "./demos/autonomy.js";
9
7
  import { OnboardingStepFrame } from "./OnboardingStepFrame.js";
10
8
  import { AutonomyStep } from "./steps/AutonomyStep.js";
9
+ import { TUTORIAL_SCENES } from "./demos/how-it-works.js";
10
+ import { Tutorial } from "./tutorials.js";
11
11
  import { ConnectorsStep } from "./steps/ConnectorsStep.js";
12
12
  import { ConnectStep } from "./steps/ConnectStep.js";
13
13
  import { ConversationPresetPreview, ConversationPreview, transcriptPreviewOptions } from "./conversation.js";
@@ -1,6 +1,8 @@
1
1
  import { buttonClass } from "../../components/button.js";
2
+ import { Notice } from "../../components/Notice.js";
2
3
  import { EmptyState } from "../../components/Surface.js";
3
4
  import { ErrorNote, INPUT_CLASS } from "../../components/Form.js";
5
+ import { errorMessage } from "../../components/report-error.js";
4
6
  import { useOnboardingLabels } from "../OnboardingProvider.js";
5
7
  import { SkeletonListing, SourceChips, SourceHeader, SourceRows } from "../skills/parts.js";
6
8
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -25,9 +27,6 @@ import { Fragment as Fragment$1, useCallback, useEffect, useId, useMemo, useRef,
25
27
  */
26
28
  /** Above this many rows, a filter field shows over the list. */
27
29
  const FILTER_FROM = 12;
28
- function messageOf(error) {
29
- return error instanceof Error ? error.message : String(error);
30
- }
31
30
  /**
32
31
  * Renders a source browser: a field, the recommended sources, and the rows of the open source.
33
32
  *
@@ -78,7 +77,7 @@ function SourceBrowser({ browse, itemsOf, cardOf, pickOf, selectable: canPick, r
78
77
  if (seq.current === n) setOpened({
79
78
  input: text,
80
79
  kind: "error",
81
- message: messageOf(error)
80
+ message: errorMessage(error)
82
81
  });
83
82
  });
84
83
  }, [browse]);
@@ -214,7 +213,10 @@ function SourceBrowser({ browse, itemsOf, cardOf, pickOf, selectable: canPick, r
214
213
  }),
215
214
  opened.kind === "error" && /* @__PURE__ */ jsxs("div", {
216
215
  className: "flex flex-col gap-3 p-3",
217
- children: [/* @__PURE__ */ jsx(ErrorNote, { children: labels.browseFailed(opened.message) }), /* @__PURE__ */ jsx("button", {
216
+ children: [/* @__PURE__ */ jsx(ErrorNote, {
217
+ detail: opened.message,
218
+ children: labels.sourceLoadFailed
219
+ }), /* @__PURE__ */ jsx("button", {
218
220
  type: "button",
219
221
  onClick: () => open(opened.input),
220
222
  className: `${buttonClass({
@@ -239,8 +241,10 @@ function SourceBrowser({ browse, itemsOf, cardOf, pickOf, selectable: canPick, r
239
241
  className: "m-0 px-3 pb-2 text-zg-label text-[var(--zg-text-muted)] text-pretty",
240
242
  children: note
241
243
  }),
242
- truncatedOf?.(listing) && /* @__PURE__ */ jsx("p", {
243
- className: "m-0 px-3 pb-2 text-zg-meta text-zg-warn",
244
+ truncatedOf?.(listing) && /* @__PURE__ */ jsx(Notice, {
245
+ tone: "warning",
246
+ compact: true,
247
+ className: "mx-3 mb-2",
244
248
  children: labels.listingTruncated
245
249
  }),
246
250
  items.length > FILTER_FROM && /* @__PURE__ */ jsxs("div", {
@@ -6,8 +6,8 @@ import { constant, useReadable } from "../../chat/headless/store.js";
6
6
  import { connectorsFromImport } from "../headless/controller.js";
7
7
  import { useOnboarding, useOnboardingLabels } from "../OnboardingProvider.js";
8
8
  import { RoutedLink } from "../../extensions/links.js";
9
- import { Tutorial } from "../tutorials.js";
10
9
  import { OnboardingStepFrame } from "../OnboardingStepFrame.js";
10
+ import { Tutorial } from "../tutorials.js";
11
11
  import { StepSection, StepTray } from "./StepSection.js";
12
12
  import { TaskChip, TaskFailure } from "./tasks.js";
13
13
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -65,7 +65,10 @@ function ImportStep({ className }) {
65
65
  loaded.kind !== "none" && /* @__PURE__ */ jsxs(StepSection, {
66
66
  title: labels.importFrom(labels.agentName("claude-code")),
67
67
  visual: mark("claude-code", "sm"),
68
- children: [loaded.kind === "failed" && /* @__PURE__ */ jsx(ErrorNote, { children: loaded.message }), preview && selection && /* @__PURE__ */ jsxs("div", {
68
+ children: [loaded.kind === "failed" && /* @__PURE__ */ jsx(ErrorNote, {
69
+ detail: loaded.message,
70
+ children: labels.importPreviewFailed
71
+ }), preview && selection && /* @__PURE__ */ jsxs("div", {
69
72
  className: "zg-tray rounded-zg-xl p-2 flex flex-col",
70
73
  children: [/* @__PURE__ */ jsx(ToggleCard, {
71
74
  title: labels.importSessions,
@@ -1,5 +1,6 @@
1
1
  import { BrandMark } from "../../components/BrandMark.js";
2
2
  import { buttonClass } from "../../components/button.js";
3
+ import { Notice } from "../../components/Notice.js";
3
4
  import { BrowserSignIn } from "../../components/BrowserSignIn.js";
4
5
  import { presetFor } from "../../theme/accents.js";
5
6
  import { constant, useReadable } from "../../chat/headless/store.js";
@@ -214,8 +215,14 @@ function TaskRow({ task }) {
214
215
  children: task.label
215
216
  }),
216
217
  /* @__PURE__ */ jsx(TaskChip, { task }),
217
- task.message && /* @__PURE__ */ jsx("span", {
218
- className: `flex-1 min-w-0 break-words text-zg-label ${task.status === "failed" ? "text-zg-danger" : "text-[var(--zg-text-muted)]"}`,
218
+ task.status === "failed" ? /* @__PURE__ */ jsx(Notice, {
219
+ tone: "error",
220
+ compact: true,
221
+ className: "flex-1 min-w-0",
222
+ ...task.message ? { detail: task.message } : {},
223
+ children: labels.taskFailedNote
224
+ }) : task.message && /* @__PURE__ */ jsx("span", {
225
+ className: "flex-1 min-w-0 break-words text-zg-label text-[var(--zg-text-muted)]",
219
226
  children: task.message
220
227
  }),
221
228
  /* @__PURE__ */ jsxs("span", {
@@ -1,7 +1,7 @@
1
1
  import { constant, useReadable } from "../../chat/headless/store.js";
2
2
  import { useOnboarding, useOnboardingLabels } from "../OnboardingProvider.js";
3
- import { Tutorial } from "../tutorials.js";
4
3
  import { OnboardingStepFrame } from "../OnboardingStepFrame.js";
4
+ import { Tutorial } from "../tutorials.js";
5
5
  import { SkillSourceBrowser } from "../skills/SkillSourceBrowser.js";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  //#region src/onboarding/steps/SkillsStep.tsx