zidane-ui 9.1.13 → 9.1.14

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 (309) 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 +5 -16
  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 +24 -25
  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 +3 -3
  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/appearance/AppearanceProvider.js +2 -2
  31. package/dist/appearance/headless/index.js +1 -1
  32. package/dist/approvals/headless/index.js +2 -2
  33. package/dist/chat/SessionFilterMenu.d.ts +1 -1
  34. package/dist/chat/SessionFilterMenu.js +2 -1
  35. package/dist/chat/Transcript.js +1 -1
  36. package/dist/chat/composer/Composer.js +9 -6
  37. package/dist/chat/composer/ComposerEditor.js +1 -1
  38. package/dist/chat/composer/ConversationBadges.js +1 -1
  39. package/dist/chat/composer/ModelChainList.js +17 -8
  40. package/dist/chat/composer/ModelChainTooltip.js +5 -2
  41. package/dist/chat/composer/use-composer-stores.js +1 -1
  42. package/dist/chat/composer/use-draft-target.d.ts +20 -1
  43. package/dist/chat/composer/use-draft-target.js +122 -6
  44. package/dist/chat/composer/use-new-session-defaults.d.ts +5 -1
  45. package/dist/chat/composer/use-new-session-defaults.js +17 -4
  46. package/dist/chat/composer/use-run-meter.js +1 -1
  47. package/dist/chat/composer/use-send-prompt.js +1 -1
  48. package/dist/chat/headless/chip-labels.d.ts +1 -0
  49. package/dist/chat/headless/chip-labels.js +1 -0
  50. package/dist/chat/headless/composer/index.js +2 -2
  51. package/dist/chat/headless/draft-target.d.ts +21 -1
  52. package/dist/chat/headless/fixture-host.js +17 -2
  53. package/dist/chat/headless/host.d.ts +3 -3
  54. package/dist/chat/headless/index.d.ts +9 -9
  55. package/dist/chat/headless/index.js +15 -15
  56. package/dist/chat/headless/labels.d.ts +13 -4
  57. package/dist/chat/headless/labels.js +8 -5
  58. package/dist/chat/headless/session-list.d.ts +20 -6
  59. package/dist/chat/headless/session-list.js +1 -0
  60. package/dist/chat/headless/sidebar/directory.d.ts +56 -14
  61. package/dist/chat/headless/sidebar/directory.js +149 -70
  62. package/dist/chat/headless/sidebar/index.d.ts +3 -3
  63. package/dist/chat/headless/sidebar/index.js +3 -3
  64. package/dist/chat/headless/sidebar/labels.d.ts +15 -6
  65. package/dist/chat/headless/sidebar/types.d.ts +3 -1
  66. package/dist/chat/headless/sidebar/view.d.ts +13 -5
  67. package/dist/chat/headless/sidebar/view.js +31 -11
  68. package/dist/chat/headless/streams/actions.d.ts +5 -3
  69. package/dist/chat/headless/streams/actions.js +3 -2
  70. package/dist/chat/headless/streams/index.d.ts +3 -3
  71. package/dist/chat/headless/streams/merge.d.ts +6 -10
  72. package/dist/chat/headless/streams/merge.js +7 -21
  73. package/dist/chat/headless/streams/session-streams.d.ts +29 -4
  74. package/dist/chat/headless/streams/session-streams.js +86 -0
  75. package/dist/chat/headless/streams/store.d.ts +162 -16
  76. package/dist/chat/headless/streams/store.js +334 -38
  77. package/dist/chat/headless/streams/types.d.ts +10 -7
  78. package/dist/chat/headless/transcript-labels.d.ts +1 -0
  79. package/dist/chat/interactions/PlanCard.js +10 -3
  80. package/dist/chat/interactions/QuestionForm.js +7 -3
  81. package/dist/chat/interactions/card-ui.d.ts +5 -3
  82. package/dist/chat/interactions/card-ui.js +9 -7
  83. package/dist/chat/sidebar/SessionSidebar.js +5 -5
  84. package/dist/chat/sidebar/SidebarFilterMenu.js +3 -1
  85. package/dist/chat/sidebar/SidebarFrame.d.ts +4 -0
  86. package/dist/chat/sidebar/SidebarFrame.js +27 -9
  87. package/dist/chat/sidebar/SidebarGroupHeader.js +1 -1
  88. package/dist/chat/sidebar/SidebarHostProvider.d.ts +8 -5
  89. package/dist/chat/sidebar/SidebarHostProvider.js +13 -9
  90. package/dist/chat/sidebar/SidebarToggleButton.js +7 -3
  91. package/dist/chat/sidebar/index.d.ts +2 -2
  92. package/dist/chat/sidebar/session-menu.js +4 -4
  93. package/dist/chat/sidebar/useSaveViewAsSpace.js +2 -2
  94. package/dist/chat/testing/contract.js +2 -2
  95. package/dist/chat/transcript/AuthFailureCard.js +11 -8
  96. package/dist/chat/transcript/BadgeMenu.js +13 -2
  97. package/dist/chat/transcript/MermaidDiagram.js +7 -3
  98. package/dist/chat/transcript/fold.d.ts +4 -0
  99. package/dist/chat/transcript/fold.js +53 -22
  100. package/dist/chat/transcript/script-input.d.ts +1 -1
  101. package/dist/chat/transcript/shell-block.js +8 -4
  102. package/dist/chat/transcript/useStickToBottom.js +12 -0
  103. package/dist/components/BrowserSignIn.js +23 -21
  104. package/dist/components/Form.d.ts +6 -4
  105. package/dist/components/Form.js +16 -8
  106. package/dist/components/LoadError.d.ts +4 -2
  107. package/dist/components/LoadError.js +13 -9
  108. package/dist/components/Notice.d.ts +29 -0
  109. package/dist/components/Notice.js +63 -0
  110. package/dist/components/PanelEmpty.d.ts +1 -1
  111. package/dist/components/PanelEmpty.js +4 -2
  112. package/dist/components/Restricted.d.ts +1 -1
  113. package/dist/components/palette/PaletteList.js +8 -1
  114. package/dist/components/palette/PalettePanel.js +14 -6
  115. package/dist/core.css +24 -5
  116. package/dist/dist/{index-Bq87OcGy.d.ts → index-C6rzc-tt.d.ts} +28 -3
  117. package/dist/dist/index.d.ts +2 -2
  118. package/dist/dist/{timeout-B5pO5I5a.d.ts → timeout-Cz9dRF8Q.d.ts} +1 -1
  119. package/dist/extensions/ExtensionSettingsPage.js +2 -5
  120. package/dist/extensions/ExtensionSettingsSection.js +5 -4
  121. package/dist/extensions/ExtensionSettingsSidebar.js +3 -7
  122. package/dist/extensions/SettingsWireForm.d.ts +1 -7
  123. package/dist/extensions/SettingsWireForm.js +7 -5
  124. package/dist/extensions/headless/fixture-host.d.ts +1 -5
  125. package/dist/extensions/headless/fixture-host.js +2 -5
  126. package/dist/extensions/headless/host.d.ts +1 -11
  127. package/dist/extensions/headless/index.d.ts +3 -3
  128. package/dist/extensions/headless/index.js +6 -6
  129. package/dist/extensions/headless/select.d.ts +1 -11
  130. package/dist/extensions/headless/select.js +1 -18
  131. package/dist/extensions/hooks.js +1 -1
  132. package/dist/files/EditorColumn.js +13 -2
  133. package/dist/files/MediaDiff.js +1 -1
  134. package/dist/files/TreeColumn.js +13 -20
  135. package/dist/files/useEntryActions.js +1 -1
  136. package/dist/files/useOpenFiles.js +3 -1
  137. package/dist/git/BranchMenu.js +6 -4
  138. package/dist/git/ImportRepoDialog.js +18 -9
  139. package/dist/git/MoveSessionDialog.js +16 -8
  140. package/dist/git/RemoteFolderPicker.js +35 -17
  141. package/dist/git/SyncChip.js +17 -17
  142. package/dist/git/WherePicker.d.ts +16 -1
  143. package/dist/git/WherePicker.js +81 -37
  144. package/dist/git/headless/environment.d.ts +33 -3
  145. package/dist/git/headless/environment.js +33 -5
  146. package/dist/git/headless/index.d.ts +2 -2
  147. package/dist/git/headless/index.js +2 -2
  148. package/dist/git/headless/labels.d.ts +15 -2
  149. package/dist/git/headless/labels.js +17 -4
  150. package/dist/git/useEnvironmentChoices.d.ts +3 -1
  151. package/dist/git/useEnvironmentChoices.js +7 -4
  152. package/dist/index.d.ts +2 -1
  153. package/dist/index.js +2 -1
  154. package/dist/keybindings/KeyCommands.js +1 -1
  155. package/dist/keybindings/KeybindingsProvider.js +1 -1
  156. package/dist/keybindings/headless/index.js +2 -2
  157. package/dist/keybindings/headless/overrides.js +1 -1
  158. package/dist/labels.d.ts +5 -0
  159. package/dist/labels.js +5 -0
  160. package/dist/machines/AddMachineDialog.d.ts +34 -0
  161. package/dist/machines/AddMachineDialog.js +464 -0
  162. package/dist/machines/Banners.d.ts +33 -4
  163. package/dist/machines/Banners.js +64 -3
  164. package/dist/machines/DaemonMenu.js +27 -4
  165. package/dist/machines/HostCapabilities.d.ts +1 -3
  166. package/dist/machines/HostCapabilities.js +24 -45
  167. package/dist/machines/HostSyncPanel.js +124 -130
  168. package/dist/machines/HostsSection.d.ts +4 -1
  169. package/dist/machines/HostsSection.js +30 -7
  170. package/dist/machines/MachinesExplainer.d.ts +17 -0
  171. package/dist/machines/MachinesExplainer.js +71 -0
  172. package/dist/machines/MachinesProvider.d.ts +14 -2
  173. package/dist/machines/MachinesProvider.js +35 -1
  174. package/dist/machines/ServerAddedCard.d.ts +31 -0
  175. package/dist/machines/ServerAddedCard.js +72 -0
  176. package/dist/machines/ServerCard.js +91 -215
  177. package/dist/machines/ServerMachinesPanel.d.ts +2 -2
  178. package/dist/machines/ServerMachinesPanel.js +184 -323
  179. package/dist/machines/ServerUpdatePanel.js +51 -40
  180. package/dist/machines/ShareThisComputerForm.d.ts +19 -0
  181. package/dist/machines/ShareThisComputerForm.js +133 -0
  182. package/dist/machines/SyncOutcomeBadge.js +1 -1
  183. package/dist/machines/TokensPanel.d.ts +5 -3
  184. package/dist/machines/TokensPanel.js +98 -78
  185. package/dist/machines/headless/fixture-host.d.ts +19 -3
  186. package/dist/machines/headless/fixture-host.js +43 -6
  187. package/dist/machines/headless/fixtures.js +4 -6
  188. package/dist/machines/headless/host.d.ts +40 -19
  189. package/dist/machines/headless/index.d.ts +3 -3
  190. package/dist/machines/headless/index.js +3 -3
  191. package/dist/machines/headless/labels.d.ts +63 -20
  192. package/dist/machines/headless/labels.js +88 -25
  193. package/dist/machines/headless/messages.js +8 -0
  194. package/dist/machines/headless/stores.d.ts +9 -2
  195. package/dist/machines/headless/stores.js +28 -1
  196. package/dist/machines/index.d.ts +7 -3
  197. package/dist/machines/index.js +8 -4
  198. package/dist/machines/testing/contract.d.ts +15 -3
  199. package/dist/machines/testing/contract.js +68 -14
  200. package/dist/motion/grow.d.ts +8 -1
  201. package/dist/motion/grow.js +10 -4
  202. package/dist/onboarding/headless/labels.d.ts +13 -0
  203. package/dist/onboarding/headless/labels.js +8 -0
  204. package/dist/onboarding/sources/SourceBrowser.js +11 -7
  205. package/dist/onboarding/steps/ImportStep.js +4 -1
  206. package/dist/onboarding/steps/ReadyStep.js +9 -2
  207. package/dist/onboarding/steps/connect/KeyForm.js +6 -2
  208. package/dist/onboarding/steps/connect/ProviderPanel.js +6 -2
  209. package/dist/onboarding/steps/connect/ProviderReady.js +25 -20
  210. package/dist/onboarding/steps/tasks.js +17 -14
  211. package/dist/palette/app-sources.js +1 -1
  212. package/dist/server/sse-handler.js +141 -19
  213. package/dist/session/ArtifactsPanel.js +40 -18
  214. package/dist/session/PlanTracker.js +13 -8
  215. package/dist/session/ProjectHome.js +13 -11
  216. package/dist/session/RemindersPanel.js +35 -17
  217. package/dist/session/RunningWorkDialog.js +6 -2
  218. package/dist/session/SecretsPanel.js +29 -10
  219. package/dist/session/SessionDetailsDialog.d.ts +1 -1
  220. package/dist/session/SessionDetailsDialog.js +18 -10
  221. package/dist/session/SideChat.js +10 -7
  222. package/dist/session/TurnDetailsDialog.js +19 -5
  223. package/dist/session/UsagePanel.js +10 -4
  224. package/dist/session/headless/host.d.ts +2 -0
  225. package/dist/session/headless/index.js +2 -2
  226. package/dist/session/headless/labels.d.ts +19 -1
  227. package/dist/session/headless/labels.js +15 -1
  228. package/dist/session/headless/queue.js +2 -1
  229. package/dist/session/headless/reminder-labels.d.ts +4 -0
  230. package/dist/session/headless/reminder-labels.js +4 -0
  231. package/dist/settings/SettingsRestricted.d.ts +1 -1
  232. package/dist/settings/SettingsRestricted.js +4 -4
  233. package/dist/settings/SettingsShell.d.ts +7 -0
  234. package/dist/settings/SettingsShell.js +6 -1
  235. package/dist/settings/headless/fixture-performance.d.ts +1 -1
  236. package/dist/settings/headless/host.d.ts +2 -2
  237. package/dist/settings/headless/index.js +1 -1
  238. package/dist/settings/headless/labels.d.ts +3 -3
  239. package/dist/settings/headless/labels.js +3 -3
  240. package/dist/settings/headless/performance.d.ts +3 -4
  241. package/dist/settings/headless/search.d.ts +1 -1
  242. package/dist/settings/index.d.ts +2 -1
  243. package/dist/settings/index.js +2 -1
  244. package/dist/settings/sections/appearance/AppearanceSection.js +2 -2
  245. package/dist/settings/sections/claude-import/ClaudeImportDialog.js +1 -1
  246. package/dist/settings/sections/editor/EditorSection.js +8 -5
  247. package/dist/settings/sections/editor/labels.d.ts +1 -0
  248. package/dist/settings/sections/editor/labels.js +1 -0
  249. package/dist/settings/sections/environments/EnvironmentsSection.js +21 -14
  250. package/dist/settings/sections/environments/labels.d.ts +1 -0
  251. package/dist/settings/sections/environments/labels.js +2 -1
  252. package/dist/settings/sections/extensions/ChangeOriginDialog.js +1 -1
  253. package/dist/settings/sections/extensions/CreateExtensionDialog.js +1 -1
  254. package/dist/settings/sections/extensions/ExtensionConfigRows.d.ts +1 -3
  255. package/dist/settings/sections/extensions/ExtensionConfigRows.js +20 -19
  256. package/dist/settings/sections/extensions/ExtensionOptionsSection.js +2 -1
  257. package/dist/settings/sections/extensions/ExtensionsSection.js +1 -1
  258. package/dist/settings/sections/extensions/options-labels.d.ts +2 -1
  259. package/dist/settings/sections/extensions/options-labels.js +2 -1
  260. package/dist/settings/sections/host-catalog/HostCatalogSection.js +1 -1
  261. package/dist/settings/sections/index.d.ts +2 -1
  262. package/dist/settings/sections/index.js +2 -1
  263. package/dist/settings/sections/instructions/InstructionsSection.js +1 -1
  264. package/dist/settings/sections/logs/LogsSection.d.ts +2 -2
  265. package/dist/settings/sections/logs/LogsSection.js +2 -2
  266. package/dist/settings/sections/mcp/McpSection.d.ts +1 -1
  267. package/dist/settings/sections/mcp/McpSection.js +13 -7
  268. package/dist/settings/sections/mcp/McpServerRow.js +21 -14
  269. package/dist/settings/sections/mcp/labels.d.ts +8 -2
  270. package/dist/settings/sections/mcp/labels.js +8 -2
  271. package/dist/settings/sections/models/ModelRows.js +1 -1
  272. package/dist/settings/sections/models/NewChatPlaceRow.d.ts +26 -0
  273. package/dist/settings/sections/models/NewChatPlaceRow.js +78 -0
  274. package/dist/settings/sections/models/SpacesDefaultsSection.js +15 -3
  275. package/dist/settings/sections/models/labels.d.ts +7 -0
  276. package/dist/settings/sections/models/labels.js +7 -0
  277. package/dist/settings/sections/models/model-test.js +7 -4
  278. package/dist/settings/sections/performance/PerformanceSection.js +16 -6
  279. package/dist/settings/sections/performance/labels.d.ts +1 -1
  280. package/dist/settings/sections/performance/labels.js +1 -1
  281. package/dist/settings/sections/providers/ProvidersSection.d.ts +1 -1
  282. package/dist/settings/sections/providers/ProvidersSection.js +15 -8
  283. package/dist/settings/sections/providers/ServerProvidersSection.d.ts +1 -1
  284. package/dist/settings/sections/providers/ServerProvidersSection.js +12 -6
  285. package/dist/settings/sections/providers/labels.d.ts +2 -2
  286. package/dist/settings/sections/providers/labels.js +2 -2
  287. package/dist/settings/sections/shared/catalog.js +1 -1
  288. package/dist/settings/sections/skills/SkillsSection.js +1 -1
  289. package/dist/settings/testing/performance.contract.js +8 -12
  290. package/dist/styles.css +32 -3
  291. package/dist/terminal/HostTerminalSurface.js +17 -7
  292. package/dist/terminal/TerminalPanel.js +30 -17
  293. package/dist/terminal/TerminalSurface.js +11 -4
  294. package/dist/terminal/headless/labels.d.ts +5 -0
  295. package/dist/terminal/headless/labels.js +5 -0
  296. package/dist/terminal/headless/store.d.ts +1 -1
  297. package/dist/terminal/headless/store.js +6 -3
  298. package/dist/workspace/LayoutBudget.d.ts +5 -1
  299. package/dist/workspace/LayoutBudget.js +14 -1
  300. package/dist/workspace/PanelContentView.d.ts +1 -1
  301. package/dist/workspace/PanelContentView.js +17 -6
  302. package/dist/workspace/WorkspaceProvider.js +4 -3
  303. package/dist/workspace/extension-tabs.js +1 -1
  304. package/dist/workspace/headless/index.js +1 -1
  305. package/dist/workspace/headless/labels.d.ts +1 -0
  306. package/dist/workspace/headless/labels.js +1 -0
  307. package/package.json +3 -3
  308. package/src/styles/motion.css +8 -0
  309. package/src/styles/primitives.css +7 -0
@@ -1,6 +1,6 @@
1
- import { d as AuthFailureKind, u as AuthFailure } from "./timeout-B5pO5I5a.js";
1
+ import { d as AuthFailureKind, u as AuthFailure } from "./timeout-Cz9dRF8Q.js";
2
2
  import "./types-2HrgolQz.js";
3
3
  import "./oauth-callback-page-DMxIgurj.js";
4
- import { Eb as SessionQueryNot, Ob as SessionSort, Sb as SessionQueryAny, WR as ThinkingLevel, _b as SessionGroupBy, bb as SessionQuery, db as QueryBound, fb as QueryValue, hb as SessionFieldPath, mb as SessionFieldName, pb as SessionCondition, ub as FacetPath, vb as SessionGroupOrder, xb as SessionQueryAll } from "./index-Bq87OcGy.js";
4
+ import { Ab as SessionQueryAll, Cb as SessionFieldName, Db as SessionGroupOrder, Eb as SessionGroupBy, Fb as SessionQueryNot, Lb as SessionSort, Sb as SessionCondition, bb as QueryBound, jb as SessionQueryAny, kb as SessionQuery, rz as ThinkingLevel, wb as SessionFieldPath, xb as QueryValue, yb as FacetPath } from "./index-C6rzc-tt.js";
5
5
  import "./index-f-XWIoYo.js";
6
6
  import "./sandbox-B4OW6oNx.js";
@@ -1,4 +1,4 @@
1
- //#region ../dist/timeout-B5pO5I5a.d.ts
1
+ //#region ../dist/timeout-Cz9dRF8Q.d.ts
2
2
  /**
3
3
  * Why a sign-in stopped working:
4
4
  * - `expired`: the refresh failed for a reason that signing in again fixes.
@@ -1,8 +1,8 @@
1
1
  import { constant, useReadable } from "../chat/headless/store.js";
2
- import { extensionsErrorOf } from "./headless/host.js";
3
2
  import { useExtensionsLabels } from "./useExtensionsLabels.js";
4
3
  import { ExtensionComponent } from "./ExtensionComponent.js";
5
4
  import { useExtensionItems, useExtensionsHost } from "./ExtensionsProvider.js";
5
+ import { extensionsErrorOf } from "./headless/host.js";
6
6
  import { settingsValues } from "./headless/select.js";
7
7
  import { SettingsWireForm } from "./SettingsWireForm.js";
8
8
  import { jsx } from "react/jsx-runtime";
@@ -17,7 +17,6 @@ import { useCallback, useMemo, useState } from "react";
17
17
  * `invoke('setting.action')`. Without `settings.set` the rows are read-only.
18
18
  */
19
19
  const NO_SETTINGS = constant(null);
20
- const NOT_LIMITED = constant(null);
21
20
  /**
22
21
  * Draws one extension settings page. Draws nothing when no extension offers `id`.
23
22
  *
@@ -28,7 +27,6 @@ function ExtensionSettingsPage({ id, className, style }) {
28
27
  const labels = useExtensionsLabels();
29
28
  const entry = useExtensionItems("settings-page").find((e) => e.item.id === id);
30
29
  const live = useReadable(host?.settings?.wire ?? NO_SETTINGS);
31
- const scope = useReadable(host?.scope ?? NOT_LIMITED);
32
30
  const [errors, setErrors] = useState({});
33
31
  const [actions, setActions] = useState({});
34
32
  const schema = entry?.item.schema;
@@ -98,8 +96,7 @@ function ExtensionSettingsPage({ id, className, style }) {
98
96
  onChange,
99
97
  onRunAction: invoke ? onRunAction : void 0,
100
98
  actionStates: actions,
101
- errors,
102
- scope
99
+ errors
103
100
  }) : null;
104
101
  return /* @__PURE__ */ jsx("div", {
105
102
  className,
@@ -1,7 +1,8 @@
1
+ import { Notice } from "../components/Notice.js";
1
2
  import { useReadable } from "../chat/headless/store.js";
2
- import { extensionsErrorOf } from "./headless/host.js";
3
3
  import { useExtensionsLabels } from "./useExtensionsLabels.js";
4
4
  import { useExtensionsHost } from "./ExtensionsProvider.js";
5
+ import { extensionsErrorOf } from "./headless/host.js";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
6
7
  import { useState } from "react";
7
8
  //#region src/extensions/ExtensionSettingsSection.tsx
@@ -133,9 +134,9 @@ function IntegrationRow({ integration }) {
133
134
  onClick: () => run(() => host?.integrations?.connect(integration.id, { methodId: method.id })),
134
135
  children: connected ? l.extensionIntegrationAddAccountWith(method.label) : method.label
135
136
  }, method.id)),
136
- error && /* @__PURE__ */ jsx("p", {
137
- role: "alert",
138
- className: "text-zg-label text-[var(--zg-danger)]",
137
+ error && /* @__PURE__ */ jsx(Notice, {
138
+ tone: "error",
139
+ compact: true,
139
140
  children: error
140
141
  })
141
142
  ]
@@ -1,9 +1,9 @@
1
1
  import { Tray } from "../components/Surface.js";
2
2
  import { ROW_BUTTON_CLASS, RowText } from "../components/Form.js";
3
3
  import { constant, useReadable } from "../chat/headless/store.js";
4
- import { extensionsErrorOf } from "./headless/host.js";
5
4
  import { useExtensionsLabels } from "./useExtensionsLabels.js";
6
5
  import { useExtensionsHost } from "./ExtensionsProvider.js";
6
+ import { extensionsErrorOf } from "./headless/host.js";
7
7
  import { settingsValues } from "./headless/select.js";
8
8
  import { SettingsPanel, SettingsPanelBody, useSettingsSection } from "../settings/section.js";
9
9
  import { SettingsWireForm } from "./SettingsWireForm.js";
@@ -41,11 +41,9 @@ import { extensionMark, settingsSearchIndex, settingsSidebar } from "zidane/chat
41
41
  * <SettingsShell sections={[...builtins, ...ext.entries, ...ext.categories]} extraSearch={ext.search} />
42
42
  *
43
43
  * Rows write through the host's `settings.set` and actions run through
44
- * `invoke('setting.action')`; an action above the token's scope
45
- * (`ExtensionsHost.scope`) shows disabled, with why.
44
+ * `invoke('setting.action')`.
46
45
  */
47
46
  const EMPTY = constant(null);
48
- const NOT_LIMITED = constant(null);
49
47
  /** A section's glyph: the first icon given, else a letter badge of `monogram`. */
50
48
  function glyph(monogram, ...icons) {
51
49
  const icon = icons.find((candidate) => candidate?.trim());
@@ -230,7 +228,6 @@ function SchemaPage({ page, className, style }) {
230
228
  const host = useExtensionsHost();
231
229
  const labels = useExtensionsLabels();
232
230
  const wire = useReadable(host?.settings?.wire ?? EMPTY);
233
- const scope = useReadable(host?.scope ?? NOT_LIMITED);
234
231
  const [errors, setErrors] = useState({});
235
232
  const [actions, setActions] = useState({});
236
233
  const parts = useMemo(() => wire ? pageWires(wire, page) : null, [wire, page]);
@@ -277,8 +274,7 @@ function SchemaPage({ page, className, style }) {
277
274
  onChange,
278
275
  onRunAction: invoke ? onRunAction : void 0,
279
276
  actionStates: actions,
280
- errors,
281
- scope
277
+ errors
282
278
  }, key);
283
279
  return /* @__PURE__ */ jsx("div", {
284
280
  className: ["space-y-5", className].filter(Boolean).join(" "),
@@ -1,5 +1,4 @@
1
1
  import { WireSettings } from "./headless/wire.js";
2
- import { ExtensionAccessScope } from "./headless/host.js";
3
2
  import { SettingValue } from "./headless/select.js";
4
3
  import { CSSProperties } from "react";
5
4
  //#region src/extensions/SettingsWireForm.d.ts
@@ -24,11 +23,6 @@ interface SettingsWireFormProps {
24
23
  actionStates?: Readonly<Record<string, SettingsWireActionState>>;
25
24
  /** A message per row (a refused write), by `extension:key`. */
26
25
  errors?: Readonly<Record<string, string>>;
27
- /**
28
- * The scope this client's token grants (`ExtensionsHost.scope`): an action needing more shows its
29
- * button disabled, with why. `null` or absent: never limited (a local or in-process host).
30
- */
31
- scope?: ExtensionAccessScope | null;
32
26
  /** Extra classes on the root. */
33
27
  className?: string;
34
28
  /** Inline styles on the root. */
@@ -39,6 +33,6 @@ interface SettingsWireFormProps {
39
33
  *
40
34
  * @param props - The rows, their values, the change and action handlers, `className` and `style`.
41
35
  */
42
- declare function SettingsWireForm({ settings, values, onChange, onRunAction, actionStates, errors, scope, className, style }: SettingsWireFormProps): import("react").JSX.Element;
36
+ declare function SettingsWireForm({ settings, values, onChange, onRunAction, actionStates, errors, className, style }: SettingsWireFormProps): import("react").JSX.Element;
43
37
  //#endregion
44
38
  export { SettingsWireActionState, SettingsWireForm, SettingsWireFormProps };
@@ -1,6 +1,7 @@
1
+ import { Notice } from "../components/Notice.js";
1
2
  import { FormSection, MetaChip } from "../components/Form.js";
2
3
  import { useExtensionsLabels } from "./useExtensionsLabels.js";
3
- import { isSettingLocked, missingScope } from "./headless/select.js";
4
+ import { isSettingLocked } from "./headless/select.js";
4
5
  import { SettingFocus } from "../settings/section.js";
5
6
  import { ExtensionActionRow, ExtensionConfigRow } from "../settings/sections/extensions/ExtensionConfigRows.js";
6
7
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -30,7 +31,7 @@ function categories(settings) {
30
31
  *
31
32
  * @param props - The rows, their values, the change and action handlers, `className` and `style`.
32
33
  */
33
- function SettingsWireForm({ settings, values, onChange, onRunAction, actionStates, errors, scope, className, style }) {
34
+ function SettingsWireForm({ settings, values, onChange, onRunAction, actionStates, errors, className, style }) {
34
35
  const labels = useExtensionsLabels();
35
36
  const cats = categories(settings);
36
37
  if (cats.length === 0) return /* @__PURE__ */ jsx("p", {
@@ -53,8 +54,10 @@ function SettingsWireForm({ settings, values, onChange, onRunAction, actionState
53
54
  value,
54
55
  locked: isSettingLocked(settings, item.extension, item.key),
55
56
  onChange
56
- }), errors?.[id] && /* @__PURE__ */ jsx("div", {
57
- className: "px-3 pb-1.5 text-xs text-zg-danger",
57
+ }), errors?.[id] && /* @__PURE__ */ jsx(Notice, {
58
+ tone: "error",
59
+ compact: true,
60
+ className: "mx-3 mb-1.5",
58
61
  children: errors[id]
59
62
  })]
60
63
  }, id);
@@ -71,7 +74,6 @@ function SettingsWireForm({ settings, values, onChange, onRunAction, actionState
71
74
  error: run.state === "error"
72
75
  } } : {},
73
76
  busy: run?.state === "busy",
74
- needsScope: missingScope(scope, action.scope),
75
77
  onRun: () => onRunAction(action.extension, action.key)
76
78
  })
77
79
  }, id);
@@ -1,5 +1,5 @@
1
1
  import { DialogRequestWire, ExtensionItem, ExtensionTokenName, ExtensionWireMap } from "./wire.js";
2
- import { ExtensionAccessScope, ExtensionCallbackId, ExtensionCallbacks, ExtensionCommandWire, ExtensionIntegrationWire, ExtensionLinkRequest, ExtensionPanelChange, ExtensionSettingsWire, ExtensionStoreRef, ExtensionUiEffect, ExtensionsHost } from "./host.js";
2
+ import { ExtensionCallbackId, ExtensionCallbacks, ExtensionCommandWire, ExtensionIntegrationWire, ExtensionLinkRequest, ExtensionPanelChange, ExtensionSettingsWire, ExtensionStoreRef, ExtensionUiEffect, ExtensionsHost } from "./host.js";
3
3
  import { DialogQueueShowContext } from "./dialog-queue.js";
4
4
  import { ExtensionUiEffectResult } from "./effect-channel.js";
5
5
  //#region src/extensions/headless/fixture-host.d.ts
@@ -44,8 +44,6 @@ interface FixtureExtensionsOptions {
44
44
  capabilities?: readonly FixtureExtensionsCapability[];
45
45
  /** The link handlers: whether one opens a link. Absent: no `openLink` (links open the app's way). */
46
46
  openLink?: (request: ExtensionLinkRequest) => boolean | Promise<boolean>;
47
- /** The scope the client's token grants. Absent: no `scope` (never limited). */
48
- scope?: ExtensionAccessScope | null;
49
47
  }
50
48
  /** Drives a fixture host from outside, as the extensions behind it would. */
51
49
  interface FixtureExtensionsControl {
@@ -78,8 +76,6 @@ interface FixtureExtensionsControl {
78
76
  panelChanged(change: ExtensionPanelChange): void;
79
77
  /** The links offered to the link handlers so far. */
80
78
  links(): readonly ExtensionLinkRequest[];
81
- /** Changes the token's scope (with `scope` given). */
82
- setScope(next: ExtensionAccessScope | null): void;
83
79
  }
84
80
  /** An in-memory {@link ExtensionsHost} and its control. */
85
81
  type FixtureExtensionsHost = ExtensionsHost & {
@@ -1,7 +1,7 @@
1
1
  import { writable } from "../../chat/headless/store.js";
2
+ import { ExtensionsHostError } from "./host.js";
2
3
  import { createDialogQueue } from "./dialog-queue.js";
3
4
  import { createUiEffectChannel } from "./effect-channel.js";
4
- import { ExtensionsHostError } from "./host.js";
5
5
  import { EXTENSION_TOKENS } from "./wire.js";
6
6
  //#region src/extensions/headless/fixture-host.ts
7
7
  /**
@@ -74,14 +74,12 @@ function createFixtureExtensionsHost(options = {}) {
74
74
  const goodKey = options.goodKey ?? "good-key";
75
75
  const panelListeners = /* @__PURE__ */ new Set();
76
76
  const links = [];
77
- const scope = writable(options.scope ?? null);
78
77
  const host = { items: lists };
79
78
  const openLink = options.openLink;
80
79
  if (openLink) host.openLink = async (request) => {
81
80
  links.push(request);
82
81
  return openLink(request);
83
82
  };
84
- if (options.scope !== void 0) host.scope = scope;
85
83
  if (has("invoke")) host.invoke = async (id, args) => {
86
84
  invoked.push({
87
85
  id,
@@ -233,8 +231,7 @@ function createFixtureExtensionsHost(options = {}) {
233
231
  panelChanged: (change) => {
234
232
  for (const listener of [...panelListeners]) listener(change);
235
233
  },
236
- links: () => links,
237
- setScope: (next) => scope.set(next)
234
+ links: () => links
238
235
  }
239
236
  };
240
237
  }
@@ -377,11 +377,6 @@ interface ExtensionLinkRequest {
377
377
  /** The session it was clicked in. */
378
378
  sessionId?: string;
379
379
  }
380
- /**
381
- * The least client token scope that may run something (`chat` ⊂ `approve` ⊂ `admin`): zidane's
382
- * `AccessScope`, the scope of an action setting.
383
- */
384
- type ExtensionAccessScope = 'chat' | 'admin';
385
380
  /** Options of {@link ExtensionsHost.rpc}. */
386
381
  interface ExtensionRpcOptions {
387
382
  /** The extension whose UI calls: its own contracts count as local (internal methods allowed). */
@@ -423,11 +418,6 @@ interface ExtensionsHost {
423
418
  * skips it while Alt is held (`routeLink`). Absent: links open the app's way.
424
419
  */
425
420
  openLink?(request: ExtensionLinkRequest): Promise<boolean>;
426
- /**
427
- * The scope this client's token grants (`null`: not limited, as a local or in-process host). Action
428
- * settings above it show disabled with why. Absent: never limited.
429
- */
430
- scope?: Readable<ExtensionAccessScope | null>;
431
421
  }
432
422
  //#endregion
433
- export { ExtensionAccessScope, ExtensionCallbackId, ExtensionCallbacks, ExtensionCommandWire, ExtensionCommands, ExtensionComposerFile, ExtensionDialog, ExtensionDialogs, ExtensionIntegrationConnectionWire, ExtensionIntegrationWire, ExtensionIntegrations, ExtensionItemStores, ExtensionLinkRequest, ExtensionLinkSource, ExtensionNavigateTarget, ExtensionPanelChange, ExtensionProvenanceWire, ExtensionRpcOptions, ExtensionSettings, ExtensionSettingsWire, ExtensionStorage, ExtensionStoreRef, ExtensionUiEffect, ExtensionUiEffectRequest, ExtensionUiEffects, ExtensionWebviews, ExtensionsError, ExtensionsHost, ExtensionsHostError, extensionsErrorOf };
423
+ export { ExtensionCallbackId, ExtensionCallbacks, ExtensionCommandWire, ExtensionCommands, ExtensionComposerFile, ExtensionDialog, ExtensionDialogs, ExtensionIntegrationConnectionWire, ExtensionIntegrationWire, ExtensionIntegrations, ExtensionItemStores, ExtensionLinkRequest, ExtensionLinkSource, ExtensionNavigateTarget, ExtensionPanelChange, ExtensionProvenanceWire, ExtensionRpcOptions, ExtensionSettings, ExtensionSettingsWire, ExtensionStorage, ExtensionStoreRef, ExtensionUiEffect, ExtensionUiEffectRequest, ExtensionUiEffects, ExtensionWebviews, ExtensionsError, ExtensionsHost, ExtensionsHostError, extensionsErrorOf };
@@ -1,10 +1,10 @@
1
1
  import { BadgeActionWire, ComponentWire, ContextSectionWire, DialogKind, DialogRequestWire, EXTENSION_TOKENS, ExtensionItem, ExtensionTokenName, ExtensionWireMap, LinkHandlerWire, PanelWire, RendererTarget, RendererWire, SLOT_NAMES, ScreenWire, SelectOptionWire, SettingsPageWire, SidebarDecorationWire, SidebarFilterWire, SidebarGroupWire, SidebarRowActionWire, SidebarRowWire, SidebarSortWire, SlotName, SlotWire, SpaceWire, WebviewWire, WireSettings, WireSettingsPage } from "./wire.js";
2
- import { ExtensionAccessScope, ExtensionCallbackId, ExtensionCallbacks, ExtensionCommandWire, ExtensionCommands, ExtensionComposerFile, ExtensionDialog, ExtensionDialogs, ExtensionIntegrationConnectionWire, ExtensionIntegrationWire, ExtensionIntegrations, ExtensionItemStores, ExtensionLinkRequest, ExtensionLinkSource, ExtensionNavigateTarget, ExtensionPanelChange, ExtensionProvenanceWire, ExtensionRpcOptions, ExtensionSettings, ExtensionSettingsWire, ExtensionStorage, ExtensionStoreRef, ExtensionUiEffect, ExtensionUiEffectRequest, ExtensionUiEffects, ExtensionWebviews, ExtensionsError, ExtensionsHost, ExtensionsHostError, extensionsErrorOf } from "./host.js";
2
+ import { ExtensionCallbackId, ExtensionCallbacks, ExtensionCommandWire, ExtensionCommands, ExtensionComposerFile, ExtensionDialog, ExtensionDialogs, ExtensionIntegrationConnectionWire, ExtensionIntegrationWire, ExtensionIntegrations, ExtensionItemStores, ExtensionLinkRequest, ExtensionLinkSource, ExtensionNavigateTarget, ExtensionPanelChange, ExtensionProvenanceWire, ExtensionRpcOptions, ExtensionSettings, ExtensionSettingsWire, ExtensionStorage, ExtensionStoreRef, ExtensionUiEffect, ExtensionUiEffectRequest, ExtensionUiEffects, ExtensionWebviews, ExtensionsError, ExtensionsHost, ExtensionsHostError, extensionsErrorOf } from "./host.js";
3
3
  import { ExtensionEffectApply, ExtensionEffectOutcome, ExtensionEffectRoute, ExtensionEffectRouter, createEffectRouter } from "./effect-router.js";
4
4
  import { DEFAULT_EXTENSIONS_LABELS, ExtensionsLabels } from "./labels.js";
5
- import { SettingValue, TITLEBAR_ITEMS_PER_EXTENSION, clampSettingNumber, filterSelectOptions, groupSelectOptions, isSettingLocked, missingScope, qualifyPanelId, rendererMatches, renderersFor, settingValue, settingsValues, slotIsActionable, slotItems, titlebarItems } from "./select.js";
5
+ import { SettingValue, TITLEBAR_ITEMS_PER_EXTENSION, clampSettingNumber, filterSelectOptions, groupSelectOptions, isSettingLocked, qualifyPanelId, rendererMatches, renderersFor, settingValue, settingsValues, slotIsActionable, slotItems, titlebarItems } from "./select.js";
6
6
  import { DialogQueue, DialogQueueShowContext, createDialogQueue } from "./dialog-queue.js";
7
7
  import { ExtensionUiEffectResult, UiEffectChannel, createUiEffectChannel } from "./effect-channel.js";
8
8
  import { LinkRouteOptions, openInNewTab, routeLink } from "./links.js";
9
9
  import { WEBVIEW_RPC_NOT_ALLOWED, WEBVIEW_RPC_REQUEST, WEBVIEW_RPC_RESULT, WEBVIEW_RPC_UNAVAILABLE, WebviewRpcBridge, WebviewRpcBridgeOptions, WebviewRpcRequest, WebviewRpcResult, createWebviewRpcBridge, isWebviewRpcRequest } from "./webview-bridge.js";
10
- export { BadgeActionWire, ComponentWire, ContextSectionWire, DEFAULT_EXTENSIONS_LABELS, DialogKind, DialogQueue, DialogQueueShowContext, DialogRequestWire, EXTENSION_TOKENS, ExtensionAccessScope, ExtensionCallbackId, ExtensionCallbacks, ExtensionCommandWire, ExtensionCommands, ExtensionComposerFile, ExtensionDialog, ExtensionDialogs, ExtensionEffectApply, ExtensionEffectOutcome, ExtensionEffectRoute, ExtensionEffectRouter, ExtensionIntegrationConnectionWire, ExtensionIntegrationWire, ExtensionIntegrations, ExtensionItem, ExtensionItemStores, ExtensionLinkRequest, ExtensionLinkSource, ExtensionNavigateTarget, ExtensionPanelChange, ExtensionProvenanceWire, ExtensionRpcOptions, ExtensionSettings, ExtensionSettingsWire, ExtensionStorage, ExtensionStoreRef, ExtensionTokenName, ExtensionUiEffect, ExtensionUiEffectRequest, ExtensionUiEffectResult, ExtensionUiEffects, ExtensionWebviews, ExtensionWireMap, ExtensionsError, ExtensionsHost, ExtensionsHostError, ExtensionsLabels, LinkHandlerWire, LinkRouteOptions, PanelWire, RendererTarget, RendererWire, SLOT_NAMES, ScreenWire, SelectOptionWire, SettingValue, SettingsPageWire, SidebarDecorationWire, SidebarFilterWire, SidebarGroupWire, SidebarRowActionWire, SidebarRowWire, SidebarSortWire, SlotName, SlotWire, SpaceWire, TITLEBAR_ITEMS_PER_EXTENSION, UiEffectChannel, WEBVIEW_RPC_NOT_ALLOWED, WEBVIEW_RPC_REQUEST, WEBVIEW_RPC_RESULT, WEBVIEW_RPC_UNAVAILABLE, WebviewRpcBridge, WebviewRpcBridgeOptions, WebviewRpcRequest, WebviewRpcResult, WebviewWire, WireSettings, WireSettingsPage, clampSettingNumber, createDialogQueue, createEffectRouter, createUiEffectChannel, createWebviewRpcBridge, extensionsErrorOf, filterSelectOptions, groupSelectOptions, isSettingLocked, isWebviewRpcRequest, missingScope, openInNewTab, qualifyPanelId, rendererMatches, renderersFor, routeLink, settingValue, settingsValues, slotIsActionable, slotItems, titlebarItems };
10
+ export { BadgeActionWire, ComponentWire, ContextSectionWire, DEFAULT_EXTENSIONS_LABELS, DialogKind, DialogQueue, DialogQueueShowContext, DialogRequestWire, EXTENSION_TOKENS, ExtensionCallbackId, ExtensionCallbacks, ExtensionCommandWire, ExtensionCommands, ExtensionComposerFile, ExtensionDialog, ExtensionDialogs, ExtensionEffectApply, ExtensionEffectOutcome, ExtensionEffectRoute, ExtensionEffectRouter, ExtensionIntegrationConnectionWire, ExtensionIntegrationWire, ExtensionIntegrations, ExtensionItem, ExtensionItemStores, ExtensionLinkRequest, ExtensionLinkSource, ExtensionNavigateTarget, ExtensionPanelChange, ExtensionProvenanceWire, ExtensionRpcOptions, ExtensionSettings, ExtensionSettingsWire, ExtensionStorage, ExtensionStoreRef, ExtensionTokenName, ExtensionUiEffect, ExtensionUiEffectRequest, ExtensionUiEffectResult, ExtensionUiEffects, ExtensionWebviews, ExtensionWireMap, ExtensionsError, ExtensionsHost, ExtensionsHostError, ExtensionsLabels, LinkHandlerWire, LinkRouteOptions, PanelWire, RendererTarget, RendererWire, SLOT_NAMES, ScreenWire, SelectOptionWire, SettingValue, SettingsPageWire, SidebarDecorationWire, SidebarFilterWire, SidebarGroupWire, SidebarRowActionWire, SidebarRowWire, SidebarSortWire, SlotName, SlotWire, SpaceWire, TITLEBAR_ITEMS_PER_EXTENSION, UiEffectChannel, WEBVIEW_RPC_NOT_ALLOWED, WEBVIEW_RPC_REQUEST, WEBVIEW_RPC_RESULT, WEBVIEW_RPC_UNAVAILABLE, WebviewRpcBridge, WebviewRpcBridgeOptions, WebviewRpcRequest, WebviewRpcResult, WebviewWire, WireSettings, WireSettingsPage, clampSettingNumber, createDialogQueue, createEffectRouter, createUiEffectChannel, createWebviewRpcBridge, extensionsErrorOf, filterSelectOptions, groupSelectOptions, isSettingLocked, isWebviewRpcRequest, openInNewTab, qualifyPanelId, rendererMatches, renderersFor, routeLink, settingValue, settingsValues, slotIsActionable, slotItems, titlebarItems };
@@ -1,10 +1,10 @@
1
- import { createDialogQueue } from "./dialog-queue.js";
2
- import { createUiEffectChannel } from "./effect-channel.js";
3
- import { ExtensionsHostError, extensionsErrorOf } from "./host.js";
4
- import { EXTENSION_TOKENS, SLOT_NAMES } from "./wire.js";
5
1
  import { createEffectRouter } from "./effect-router.js";
6
2
  import { DEFAULT_EXTENSIONS_LABELS } from "./labels.js";
3
+ import { ExtensionsHostError, extensionsErrorOf } from "./host.js";
7
4
  import { WEBVIEW_RPC_NOT_ALLOWED, WEBVIEW_RPC_REQUEST, WEBVIEW_RPC_RESULT, WEBVIEW_RPC_UNAVAILABLE, createWebviewRpcBridge, isWebviewRpcRequest } from "./webview-bridge.js";
8
5
  import { openInNewTab, routeLink } from "./links.js";
9
- import { TITLEBAR_ITEMS_PER_EXTENSION, clampSettingNumber, filterSelectOptions, groupSelectOptions, isSettingLocked, missingScope, qualifyPanelId, rendererMatches, renderersFor, settingValue, settingsValues, slotIsActionable, slotItems, titlebarItems } from "./select.js";
10
- export { DEFAULT_EXTENSIONS_LABELS, EXTENSION_TOKENS, ExtensionsHostError, SLOT_NAMES, TITLEBAR_ITEMS_PER_EXTENSION, WEBVIEW_RPC_NOT_ALLOWED, WEBVIEW_RPC_REQUEST, WEBVIEW_RPC_RESULT, WEBVIEW_RPC_UNAVAILABLE, clampSettingNumber, createDialogQueue, createEffectRouter, createUiEffectChannel, createWebviewRpcBridge, extensionsErrorOf, filterSelectOptions, groupSelectOptions, isSettingLocked, isWebviewRpcRequest, missingScope, openInNewTab, qualifyPanelId, rendererMatches, renderersFor, routeLink, settingValue, settingsValues, slotIsActionable, slotItems, titlebarItems };
6
+ import { TITLEBAR_ITEMS_PER_EXTENSION, clampSettingNumber, filterSelectOptions, groupSelectOptions, isSettingLocked, qualifyPanelId, rendererMatches, renderersFor, settingValue, settingsValues, slotIsActionable, slotItems, titlebarItems } from "./select.js";
7
+ import { createDialogQueue } from "./dialog-queue.js";
8
+ import { createUiEffectChannel } from "./effect-channel.js";
9
+ import { EXTENSION_TOKENS, SLOT_NAMES } from "./wire.js";
10
+ export { DEFAULT_EXTENSIONS_LABELS, EXTENSION_TOKENS, ExtensionsHostError, SLOT_NAMES, TITLEBAR_ITEMS_PER_EXTENSION, WEBVIEW_RPC_NOT_ALLOWED, WEBVIEW_RPC_REQUEST, WEBVIEW_RPC_RESULT, WEBVIEW_RPC_UNAVAILABLE, clampSettingNumber, createDialogQueue, createEffectRouter, createUiEffectChannel, createWebviewRpcBridge, extensionsErrorOf, filterSelectOptions, groupSelectOptions, isSettingLocked, isWebviewRpcRequest, openInNewTab, qualifyPanelId, rendererMatches, renderersFor, routeLink, settingValue, settingsValues, slotIsActionable, slotItems, titlebarItems };
@@ -1,5 +1,4 @@
1
1
  import { ExtensionItem, RendererTarget, RendererWire, SelectOptionWire, SlotName, SlotWire, WireSettings } from "./wire.js";
2
- import { ExtensionAccessScope } from "./host.js";
3
2
  import { ExtensionConfigValue, WireExtensionConfigItem } from "zidane";
4
3
  //#region src/extensions/headless/select.d.ts
5
4
  /**
@@ -14,15 +13,6 @@ import { ExtensionConfigValue, WireExtensionConfigItem } from "zidane";
14
13
  * @param turnId - `transcript.turn-end`: the turn the place follows. Absent: the end of the transcript.
15
14
  */
16
15
  declare function slotItems(items: readonly ExtensionItem<'slot'>[], at: SlotName, sessionId?: string, turnId?: string): readonly ExtensionItem<'slot'>[];
17
- /**
18
- * The scope an action needs that this client's token lacks, or `null` when it may run it: the token
19
- * grants `granted` (`null` or absent: not limited, as a local or in-process host), the action needs
20
- * `required` (default `admin`, as zidane's).
21
- *
22
- * @param granted - The token's scope (`ExtensionsHost.scope`).
23
- * @param required - The action's `scope`.
24
- */
25
- declare function missingScope(granted: ExtensionAccessScope | null | undefined, required: ExtensionAccessScope | undefined): ExtensionAccessScope | null;
26
16
  /** How many `app.titlebar` items one extension shows: as many as its composer badges. */
27
17
  declare const TITLEBAR_ITEMS_PER_EXTENSION = 8;
28
18
  /**
@@ -117,4 +107,4 @@ declare function clampSettingNumber(item: Extract<WireExtensionConfigItem, {
117
107
  */
118
108
  declare function slotIsActionable(item: SlotWire): boolean;
119
109
  //#endregion
120
- export { SettingValue, TITLEBAR_ITEMS_PER_EXTENSION, clampSettingNumber, filterSelectOptions, groupSelectOptions, isSettingLocked, missingScope, qualifyPanelId, rendererMatches, renderersFor, settingValue, settingsValues, slotIsActionable, slotItems, titlebarItems };
110
+ export { SettingValue, TITLEBAR_ITEMS_PER_EXTENSION, clampSettingNumber, filterSelectOptions, groupSelectOptions, isSettingLocked, qualifyPanelId, rendererMatches, renderersFor, settingValue, settingsValues, slotIsActionable, slotItems, titlebarItems };
@@ -16,23 +16,6 @@ function slotItems(items, at, sessionId, turnId) {
16
16
  index
17
17
  })).sort((a, b) => a.e.item.order - b.e.item.order || a.index - b.index).map((x) => x.e);
18
18
  }
19
- const SCOPE_RANK = {
20
- chat: 0,
21
- admin: 1
22
- };
23
- /**
24
- * The scope an action needs that this client's token lacks, or `null` when it may run it: the token
25
- * grants `granted` (`null` or absent: not limited, as a local or in-process host), the action needs
26
- * `required` (default `admin`, as zidane's).
27
- *
28
- * @param granted - The token's scope (`ExtensionsHost.scope`).
29
- * @param required - The action's `scope`.
30
- */
31
- function missingScope(granted, required) {
32
- if (!granted) return null;
33
- const need = required ?? "admin";
34
- return SCOPE_RANK[granted] >= SCOPE_RANK[need] ? null : need;
35
- }
36
19
  /** How many `app.titlebar` items one extension shows: as many as its composer badges. */
37
20
  const TITLEBAR_ITEMS_PER_EXTENSION = 8;
38
21
  /**
@@ -187,4 +170,4 @@ function slotIsActionable(item) {
187
170
  return item.panel !== void 0 || item.command !== void 0;
188
171
  }
189
172
  //#endregion
190
- export { TITLEBAR_ITEMS_PER_EXTENSION, clampSettingNumber, filterSelectOptions, groupSelectOptions, isSettingLocked, missingScope, qualifyPanelId, rendererMatches, renderersFor, settingValue, settingsValues, slotIsActionable, slotItems, titlebarItems };
173
+ export { TITLEBAR_ITEMS_PER_EXTENSION, clampSettingNumber, filterSelectOptions, groupSelectOptions, isSettingLocked, qualifyPanelId, rendererMatches, renderersFor, settingValue, settingsValues, slotIsActionable, slotItems, titlebarItems };
@@ -1,7 +1,7 @@
1
1
  import { constant, useReadable } from "../chat/headless/store.js";
2
- import { ExtensionsHostError } from "./headless/host.js";
3
2
  import { useExtensionScope } from "./ExtensionComponent.js";
4
3
  import { useExtensionEffectRouter, useExtensionsHost } from "./ExtensionsProvider.js";
4
+ import { ExtensionsHostError } from "./headless/host.js";
5
5
  import { isSettingLocked, settingValue } from "./headless/select.js";
6
6
  import { useCallback, useEffect, useMemo, useRef } from "react";
7
7
  //#region src/extensions/hooks.ts
@@ -1,8 +1,8 @@
1
1
  import { Breadcrumb } from "../components/Breadcrumb.js";
2
2
  import { IconToggle } from "../components/IconToggle.js";
3
3
  import { PanelEmpty, PanelLoading } from "../components/PanelEmpty.js";
4
- import { mediaSiblings, mediaTypeOfPath } from "./headless/media.js";
5
4
  import { useFilesHost } from "./FilesProvider.js";
5
+ import { mediaSiblings, mediaTypeOfPath } from "./headless/media.js";
6
6
  import { absolutePath } from "./file-actions.js";
7
7
  import { useFilesLabels } from "./useFilesLabels.js";
8
8
  import { useLsp } from "./useLsp.js";
@@ -85,6 +85,17 @@ const EditorColumn = memo(function EditorColumn({ cwd, files, treeSide, treeOpen
85
85
  }, [revealAt, navigate]);
86
86
  const changed = active && host.workingTreeDiff && !(active.file && active.file !== "missing" && active.file.media) ? hasChanges(active.path) : false;
87
87
  const dirty = useIsDirty(files.drafts, active?.path ?? null);
88
+ if (active && dirty && diffOverride[active.path] !== false) setDiffOverride((o) => ({
89
+ ...o,
90
+ [active.path]: false
91
+ }));
92
+ const adoptSaved = useCallback((path, file, reset) => {
93
+ if (!reset) setDiffOverride((o) => o[path] === false ? o : {
94
+ ...o,
95
+ [path]: false
96
+ });
97
+ adoptFile(path, file, reset);
98
+ }, [adoptFile]);
88
99
  const activeFile = active && active.file !== null && active.file !== "missing" ? active.file : null;
89
100
  const isNew = active !== null && isNewFile(active.path);
90
101
  const smallEnough = useMemo(() => diffFits(activeFile), [activeFile]);
@@ -317,7 +328,7 @@ const EditorColumn = memo(function EditorColumn({ cwd, files, treeSide, treeOpen
317
328
  visible: isActive,
318
329
  findAsk,
319
330
  onDraft: setDraft,
320
- onAdopt: adoptFile
331
+ onAdopt: adoptSaved
321
332
  })
322
333
  }, f.path);
323
334
  })
@@ -1,5 +1,5 @@
1
- import { mediaTypeOfPath } from "./headless/media.js";
2
1
  import { useFilesHost } from "./FilesProvider.js";
2
+ import { mediaTypeOfPath } from "./headless/media.js";
3
3
  import { useFilesLabels } from "./useFilesLabels.js";
4
4
  import { MediaView } from "./MediaView.js";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,4 +1,5 @@
1
1
  import { IconButton } from "../components/IconButton.js";
2
+ import { Notice } from "../components/Notice.js";
2
3
  import { readPanelMs, usePresence } from "../motion/presence.js";
3
4
  import { IconToggle } from "../components/IconToggle.js";
4
5
  import { PanelEmpty, PanelLoading } from "../components/PanelEmpty.js";
@@ -159,26 +160,18 @@ const TreeColumn = memo(function TreeColumn(p) {
159
160
  title: labels.filesTruncated(p.truncated.shown, p.truncated.total, !!p.truncated.atLeast),
160
161
  children: labels.filesTruncated(p.truncated.shown, p.truncated.total, !!p.truncated.atLeast)
161
162
  }),
162
- p.notice && !p.search && /* @__PURE__ */ jsxs("div", {
163
- role: "alert",
164
- className: "zg-well shrink-0 flex items-center gap-1.5 h-7 mx-2 mb-1 pl-2 pr-1 text-xs",
165
- children: [
166
- /* @__PURE__ */ jsx("span", {
167
- className: "i-ph-warning-circle text-zg-label text-[var(--zg-text-muted)] shrink-0",
168
- "aria-hidden": true
169
- }),
170
- /* @__PURE__ */ jsx("span", {
171
- className: "flex-1 min-w-0 truncate text-[var(--zg-text)]",
172
- title: p.notice,
173
- children: p.notice
174
- }),
175
- /* @__PURE__ */ jsx(IconButton, {
176
- size: "xs",
177
- icon: "i-ph-x",
178
- label: labels.filesDismiss,
179
- onClick: () => p.onDismissNotice?.()
180
- })
181
- ]
163
+ p.notice && !p.search && /* @__PURE__ */ jsx(Notice, {
164
+ tone: "error",
165
+ compact: true,
166
+ className: "shrink-0 mx-2 mb-1",
167
+ action: /* @__PURE__ */ jsx(IconButton, {
168
+ size: "xs",
169
+ icon: "i-ph-x",
170
+ label: labels.filesDismiss,
171
+ onClick: () => p.onDismissNotice?.(),
172
+ className: "ml-auto"
173
+ }),
174
+ children: p.notice
182
175
  }),
183
176
  p.entries === null ? !p.search && /* @__PURE__ */ jsx(PanelLoading, {}) : p.entries.length === 0 && !(p.editing && !p.changedOnly) ? !p.search && /* @__PURE__ */ jsx(PanelEmpty, {
184
177
  icon: "i-ph-tree-structure",
@@ -1,5 +1,5 @@
1
- import { droppedItems, entryRefusalText, inFolder, nameOf, parentOf, topLevelPaths } from "./headless/entries.js";
2
1
  import { useOptionalConfirm } from "../app/useConfirm.js";
2
+ import { droppedItems, entryRefusalText, inFolder, nameOf, parentOf, topLevelPaths } from "./headless/entries.js";
3
3
  import { useCallback, useMemo, useRef, useState } from "react";
4
4
  //#region src/files/useEntryActions.ts
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { isUnder, movedPath } from "./headless/entries.js";
2
1
  import { useFilesHost } from "./FilesProvider.js";
2
+ import { isUnder, movedPath } from "./headless/entries.js";
3
3
  import { filesRootOf } from "./headless/view.js";
4
4
  import { folderBuffers } from "./drafts-store.js";
5
5
  import { editedPath, sameFile, statusDelta } from "./headless/workspace-diff.js";
@@ -78,6 +78,8 @@ function useOpenFiles(scope, layout, layoutStore, prefs, source) {
78
78
  }, [buffers, slots]);
79
79
  const [savedAt, setSavedAt] = useState(/* @__PURE__ */ new Map());
80
80
  const adoptFile = useCallback((path, file, resetEditor = false) => {
81
+ const inFlight = reads.current.get(path);
82
+ if (inFlight !== void 0) reads.current.set(path, inFlight + 1);
81
83
  if (resetEditor) resetEditSession(path);
82
84
  else setSavedAt((m) => new Map(m).set(path, Date.now()));
83
85
  setOpen((current) => current.map((f) => f.path === path && f.file !== file ? {
@@ -1,13 +1,14 @@
1
1
  import { IconButton } from "../components/IconButton.js";
2
2
  import { CopyButton } from "../components/CopyButton.js";
3
+ import { Notice } from "../components/Notice.js";
3
4
  import { Tooltip } from "../components/Tooltip.js";
4
5
  import { MenuNote } from "../components/Menu.js";
5
6
  import { FloatingSurface } from "../components/floating/FloatingSurface.js";
6
- import { environmentKindIcon } from "./headless/environment.js";
7
7
  import { gitErrorText } from "./headless/labels.js";
8
8
  import { useGitHost, useGitLabels } from "./GitProvider.js";
9
9
  import { useLinkRouter } from "../extensions/links.js";
10
10
  import { relativeTime } from "../chat/headless/session-list.js";
11
+ import { environmentKindIcon } from "./headless/environment.js";
11
12
  import { ageIsDuration, clockTime, compactCount, readPullRequests, switcherCacheOf, switcherCreates, switcherKey, switcherSections } from "./headless/switcher.js";
12
13
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
14
  import { memo, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
@@ -358,9 +359,10 @@ function BranchMenu({ open, anchorRef, cwd, sessionId, current, onClose, onSwitc
358
359
  className: "zg-well w-full h-7 px-2.5 text-zg-label placeholder:text-[var(--zg-text-subtle)]"
359
360
  })
360
361
  }),
361
- error && /* @__PURE__ */ jsx(MenuNote, {
362
- icon: "i-ph-warning",
363
- className: "text-[var(--zg-danger)]",
362
+ error && /* @__PURE__ */ jsx(Notice, {
363
+ tone: "error",
364
+ compact: true,
365
+ className: "mx-1 mb-1",
364
366
  children: error
365
367
  }),
366
368
  /* @__PURE__ */ jsxs("div", {
@@ -1,5 +1,7 @@
1
1
  import { buttonClass } from "../components/button.js";
2
+ import { Notice } from "../components/Notice.js";
2
3
  import { MetaChip } from "../components/Form.js";
4
+ import { errorMessage } from "../components/report-error.js";
3
5
  import { compactPath } from "../path.js";
4
6
  import { useDisplayPath } from "../hooks/useDisplayPath.js";
5
7
  import { gitErrorText } from "./headless/labels.js";
@@ -71,9 +73,12 @@ function ImportRepoDialog({ clone, initialParent, pickFolder, hostId, onDone, on
71
73
  try {
72
74
  const result = await clone.clone(input, parent);
73
75
  if (result.ok) onDone(result.path);
74
- else if (!("cancelled" in result)) setError(gitErrorText(result.error, labels));
76
+ else if (!("cancelled" in result)) setError({ message: gitErrorText(result.error, labels) });
75
77
  } catch (err) {
76
- setError(err instanceof Error ? err.message : String(err));
78
+ setError({
79
+ message: labels.gitImportFailed,
80
+ detail: errorMessage(err)
81
+ });
77
82
  } finally {
78
83
  setCloning(false);
79
84
  }
@@ -133,10 +138,14 @@ function ImportRepoDialog({ clone, initialParent, pickFolder, hostId, onDone, on
133
138
  "aria-invalid": invalid || void 0,
134
139
  className: "zg-well w-full h-8 px-2.5 font-mono text-zg-label placeholder:text-[var(--zg-text-subtle)] disabled:opacity-zg-disabled"
135
140
  }),
136
- /* @__PURE__ */ jsx("span", {
137
- className: `zg-meta min-h-4 truncate ${invalid ? "!text-zg-danger" : ""}`,
141
+ invalid ? /* @__PURE__ */ jsx(Notice, {
142
+ tone: "error",
143
+ compact: true,
144
+ children: labels.gitImportInvalid
145
+ }) : /* @__PURE__ */ jsx("span", {
146
+ className: "zg-meta min-h-4 truncate",
138
147
  "aria-live": "polite",
139
- children: invalid ? labels.gitImportInvalid : spec ? labels.gitImportPreview(spec.label, spec.branch, compactPath(display.path(joinPath(parent, spec.name), hostId), 44)) : ""
148
+ children: spec ? labels.gitImportPreview(spec.label, spec.branch, compactPath(display.path(joinPath(parent, spec.name), hostId), 44)) : ""
140
149
  })
141
150
  ]
142
151
  }),
@@ -182,10 +191,10 @@ function ImportRepoDialog({ clone, initialParent, pickFolder, hostId, onDone, on
182
191
  children: progress ? labels.gitImportProgress(progress.phase, progress.percent) : labels.gitImportConnecting
183
192
  })]
184
193
  }),
185
- error && /* @__PURE__ */ jsx("div", {
186
- role: "alert",
187
- className: "text-zg-label leading-relaxed text-zg-danger zg-pretty",
188
- children: error
194
+ error && /* @__PURE__ */ jsx(Notice, {
195
+ tone: "error",
196
+ ...error.detail ? { detail: error.detail } : {},
197
+ children: error.message
189
198
  }),
190
199
  /* @__PURE__ */ jsx("button", {
191
200
  type: "submit",