zidane-ui 9.4.0 → 9.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (527) hide show
  1. package/dist/adapters/index.d.ts +2 -1
  2. package/dist/adapters/index.js +2 -1
  3. package/dist/adapters/live.d.ts +7 -2
  4. package/dist/adapters/live.js +5 -2
  5. package/dist/adapters/server-approvals-host.js +3 -1
  6. package/dist/adapters/server-channels-host.d.ts +32 -0
  7. package/dist/adapters/server-channels-host.js +49 -0
  8. package/dist/adapters/server-composer-host.js +13 -0
  9. package/dist/adapters/server-files-host.js +12 -31
  10. package/dist/adapters/server-host.js +27 -3
  11. package/dist/adapters/server-machines-host.d.ts +5 -0
  12. package/dist/adapters/server-machines-host.js +13 -6
  13. package/dist/adapters/server-oauth-flow.d.ts +2 -1
  14. package/dist/adapters/server-projects.d.ts +15 -0
  15. package/dist/adapters/server-projects.js +225 -0
  16. package/dist/adapters/server-session-host.d.ts +2 -0
  17. package/dist/adapters/server-session-host.js +20 -1
  18. package/dist/app/AppHostProvider.d.ts +1 -1
  19. package/dist/app/AppHostProvider.js +7 -2
  20. package/dist/app/ModalProvider.d.ts +6 -2
  21. package/dist/app/ModalProvider.js +38 -10
  22. package/dist/app/headless/app-host.d.ts +3 -0
  23. package/dist/approvals/ApprovalsProvider.d.ts +2 -1
  24. package/dist/approvals/ApprovalsProvider.js +12 -4
  25. package/dist/approvals/headless/host.d.ts +13 -2
  26. package/dist/approvals/headless/index.d.ts +3 -3
  27. package/dist/approvals/headless/index.js +2 -2
  28. package/dist/approvals/headless/labels.d.ts +12 -2
  29. package/dist/approvals/headless/labels.js +19 -1
  30. package/dist/channels/BindingEditorDialog.d.ts +18 -0
  31. package/dist/channels/BindingEditorDialog.js +637 -0
  32. package/dist/channels/ChannelAlertsList.d.ts +25 -0
  33. package/dist/channels/ChannelAlertsList.js +107 -0
  34. package/dist/channels/ChannelDefaultsSection.d.ts +20 -0
  35. package/dist/channels/ChannelDefaultsSection.js +133 -0
  36. package/dist/channels/ChannelsProvider.d.ts +31 -0
  37. package/dist/channels/ChannelsProvider.js +29 -0
  38. package/dist/channels/ChannelsSettingsSection.d.ts +40 -0
  39. package/dist/channels/ChannelsSettingsSection.js +456 -0
  40. package/dist/channels/ConnectionSetupDialog.d.ts +16 -0
  41. package/dist/channels/ConnectionSetupDialog.js +470 -0
  42. package/dist/channels/HeldRepliesList.d.ts +27 -0
  43. package/dist/channels/HeldRepliesList.js +173 -0
  44. package/dist/channels/ProjectChannelsSection.d.ts +55 -0
  45. package/dist/channels/ProjectChannelsSection.js +433 -0
  46. package/dist/channels/ReadinessChecklist.d.ts +102 -0
  47. package/dist/channels/ReadinessChecklist.js +273 -0
  48. package/dist/channels/TestSessionBanner.d.ts +24 -0
  49. package/dist/channels/TestSessionBanner.js +44 -0
  50. package/dist/channels/channels-parts.d.ts +104 -0
  51. package/dist/channels/channels-parts.js +203 -0
  52. package/dist/channels/context.d.ts +9 -0
  53. package/dist/channels/context.js +14 -0
  54. package/dist/channels/headless/access.d.ts +127 -0
  55. package/dist/channels/headless/access.js +187 -0
  56. package/dist/channels/headless/fixture-host.d.ts +83 -0
  57. package/dist/channels/headless/fixture-host.js +557 -0
  58. package/dist/channels/headless/host.d.ts +245 -0
  59. package/dist/channels/headless/host.js +39 -0
  60. package/dist/channels/headless/index.d.ts +10 -0
  61. package/dist/channels/headless/index.js +5 -0
  62. package/dist/channels/headless/labels.d.ts +217 -0
  63. package/dist/channels/headless/labels.js +260 -0
  64. package/dist/channels/headless/state.d.ts +22 -0
  65. package/dist/channels/headless/state.js +303 -0
  66. package/dist/channels/index.d.ts +21 -0
  67. package/dist/channels/index.js +13 -0
  68. package/dist/channels/testing/contract.d.ts +31 -0
  69. package/dist/channels/testing/contract.js +378 -0
  70. package/dist/channels/testing/index.d.ts +7 -0
  71. package/dist/channels/testing/index.js +1 -0
  72. package/dist/chat/HostBadge.js +1 -0
  73. package/dist/chat/OrchestratorBadge.d.ts +23 -0
  74. package/dist/chat/OrchestratorBadge.js +22 -0
  75. package/dist/chat/SessionGroupHeader.d.ts +11 -1
  76. package/dist/chat/SessionGroupHeader.js +25 -14
  77. package/dist/chat/SessionRow.d.ts +141 -0
  78. package/dist/chat/SessionRow.js +215 -0
  79. package/dist/chat/StatusDot.d.ts +7 -2
  80. package/dist/chat/StatusDot.js +3 -2
  81. package/dist/chat/composer/ContextBreakdown.d.ts +27 -2
  82. package/dist/chat/composer/ContextBreakdown.js +123 -2
  83. package/dist/chat/composer/DraftPickers.js +2 -0
  84. package/dist/chat/composer/HostContextOrb.d.ts +2 -0
  85. package/dist/chat/composer/HostContextOrb.js +17 -2
  86. package/dist/chat/composer/ProjectMenu.d.ts +16 -3
  87. package/dist/chat/composer/ProjectMenu.js +102 -20
  88. package/dist/chat/composer/ScopeToggle.d.ts +3 -1
  89. package/dist/chat/composer/ScopeToggle.js +2 -1
  90. package/dist/chat/composer/ServerScopeToggle.d.ts +3 -1
  91. package/dist/chat/composer/ServerScopeToggle.js +2 -1
  92. package/dist/chat/composer/index.d.ts +2 -2
  93. package/dist/chat/composer/index.js +2 -2
  94. package/dist/chat/composer/use-draft-target.d.ts +5 -0
  95. package/dist/chat/composer/use-draft-target.js +3 -0
  96. package/dist/chat/composer/use-send-prompt.d.ts +2 -0
  97. package/dist/chat/composer/use-send-prompt.js +4 -1
  98. package/dist/chat/headless/answered-first.d.ts +28 -0
  99. package/dist/chat/headless/answered-first.js +14 -0
  100. package/dist/chat/headless/chip-labels.d.ts +2 -0
  101. package/dist/chat/headless/chip-labels.js +2 -0
  102. package/dist/chat/headless/composer/composer-sources.d.ts +5 -2
  103. package/dist/chat/headless/composer/composer-sources.js +6 -0
  104. package/dist/chat/headless/composer/host.d.ts +13 -0
  105. package/dist/chat/headless/composer/index.d.ts +2 -2
  106. package/dist/chat/headless/composer/labels-chrome.d.ts +3 -0
  107. package/dist/chat/headless/composer/labels-chrome.js +4 -1
  108. package/dist/chat/headless/composer/labels-editor.d.ts +2 -0
  109. package/dist/chat/headless/composer/labels-editor.js +2 -0
  110. package/dist/chat/headless/draft-target.d.ts +2 -0
  111. package/dist/chat/headless/folder-groups.d.ts +41 -0
  112. package/dist/chat/headless/folder-groups.js +76 -0
  113. package/dist/chat/headless/host.d.ts +16 -1
  114. package/dist/chat/headless/hosts.d.ts +1 -1
  115. package/dist/chat/headless/index.d.ts +10 -6
  116. package/dist/chat/headless/index.js +30 -26
  117. package/dist/chat/headless/labels.d.ts +34 -4
  118. package/dist/chat/headless/labels.js +28 -6
  119. package/dist/chat/headless/prompt-origin.d.ts +2 -2
  120. package/dist/chat/headless/prompt-origin.js +3 -3
  121. package/dist/chat/headless/send-flow.d.ts +2 -0
  122. package/dist/chat/headless/session-list.d.ts +28 -2
  123. package/dist/chat/headless/sidebar/directory.d.ts +5 -0
  124. package/dist/chat/headless/sidebar/directory.js +2 -0
  125. package/dist/chat/headless/sidebar/inbox.d.ts +13 -3
  126. package/dist/chat/headless/sidebar/inbox.js +40 -19
  127. package/dist/chat/headless/sidebar/index.d.ts +5 -3
  128. package/dist/chat/headless/sidebar/index.js +4 -2
  129. package/dist/chat/headless/sidebar/labels.d.ts +30 -7
  130. package/dist/chat/headless/sidebar/labels.js +0 -3
  131. package/dist/chat/headless/sidebar/project-main.d.ts +43 -0
  132. package/dist/chat/headless/sidebar/project-main.js +46 -0
  133. package/dist/chat/headless/sidebar/row-changes.d.ts +43 -0
  134. package/dist/chat/headless/sidebar/row-changes.js +43 -0
  135. package/dist/chat/headless/sidebar/rows.d.ts +2 -1
  136. package/dist/chat/headless/sidebar/rows.js +7 -3
  137. package/dist/chat/headless/sidebar/types.d.ts +12 -0
  138. package/dist/chat/headless/streams/live-events.d.ts +12 -0
  139. package/dist/chat/headless/streams/live-events.js +21 -2
  140. package/dist/chat/headless/streams/store.d.ts +17 -0
  141. package/dist/chat/headless/streams/store.js +38 -15
  142. package/dist/chat/headless/streams/types.d.ts +2 -1
  143. package/dist/chat/headless/transcript/collapse.js +3 -1
  144. package/dist/chat/headless/transcript/rail.d.ts +8 -1
  145. package/dist/chat/headless/transcript/rail.js +9 -2
  146. package/dist/chat/headless/transcript/rows.d.ts +5 -1
  147. package/dist/chat/headless/transcript-labels.d.ts +1 -0
  148. package/dist/chat/index.d.ts +5 -3
  149. package/dist/chat/index.js +7 -5
  150. package/dist/chat/interactions/HostInteractions.js +4 -2
  151. package/dist/chat/interactions/InboxPanel.js +6 -4
  152. package/dist/chat/interactions/use-answer-interaction.d.ts +11 -0
  153. package/dist/chat/interactions/use-answer-interaction.js +19 -0
  154. package/dist/chat/rich-composer/artifact-mentions.d.ts +29 -0
  155. package/dist/chat/rich-composer/artifact-mentions.js +40 -0
  156. package/dist/chat/rich-composer/composer-extensions.d.ts +3 -2
  157. package/dist/chat/rich-composer/composer-extensions.js +12 -9
  158. package/dist/chat/rich-composer/use-composer-sources.js +1 -0
  159. package/dist/chat/sidebar/InboxList.d.ts +13 -2
  160. package/dist/chat/sidebar/InboxList.js +44 -48
  161. package/dist/chat/sidebar/MainSessionRow.d.ts +2 -1
  162. package/dist/chat/sidebar/MainSessionRow.js +1 -1
  163. package/dist/chat/sidebar/ProjectIcon.d.ts +8 -4
  164. package/dist/chat/sidebar/ProjectIcon.js +15 -3
  165. package/dist/chat/sidebar/SessionSidebar.d.ts +41 -0
  166. package/dist/chat/sidebar/SessionSidebar.js +63 -13
  167. package/dist/chat/sidebar/SidebarFooter.d.ts +2 -23
  168. package/dist/chat/sidebar/SidebarFooter.js +2 -43
  169. package/dist/chat/sidebar/SidebarGroupHeader.d.ts +7 -3
  170. package/dist/chat/sidebar/SidebarGroupHeader.js +15 -10
  171. package/dist/chat/sidebar/SidebarLiveProvider.d.ts +22 -0
  172. package/dist/chat/sidebar/SidebarLiveProvider.js +20 -0
  173. package/dist/chat/sidebar/SidebarSessionRow.d.ts +6 -1
  174. package/dist/chat/sidebar/SidebarSessionRow.js +16 -7
  175. package/dist/chat/sidebar/inbox-triage.d.ts +18 -2
  176. package/dist/chat/sidebar/inbox-triage.js +39 -12
  177. package/dist/chat/sidebar/index.d.ts +5 -4
  178. package/dist/chat/sidebar/index.js +3 -2
  179. package/dist/chat/sidebar/sidebar-live.d.ts +29 -2
  180. package/dist/chat/sidebar/sidebar-live.js +36 -2
  181. package/dist/chat/sidebar/useInboxRows.js +2 -3
  182. package/dist/chat/sidebar/useInboxTriage.d.ts +5 -2
  183. package/dist/chat/sidebar/useInboxTriage.js +28 -20
  184. package/dist/chat/testing/fixture-composer-host.d.ts +3 -1
  185. package/dist/chat/testing/fixture-composer-host.js +1 -0
  186. package/dist/chat/transcript/PromptEcho.js +15 -2
  187. package/dist/chat/transcript/PromptOriginLabel.d.ts +1 -1
  188. package/dist/chat/transcript/TranscriptRail.d.ts +3 -1
  189. package/dist/chat/transcript/TranscriptRail.js +12 -2
  190. package/dist/chat/transcript/TranscriptRow.js +1 -0
  191. package/dist/chat/transcript/badges.d.ts +1 -0
  192. package/dist/chat/transcript/badges.js +1 -0
  193. package/dist/chat/transcript/fold.js +2 -1
  194. package/dist/chat/transcript/index.d.ts +2 -2
  195. package/dist/chat/transcript/index.js +2 -2
  196. package/dist/chat/transcript/inline-facts.d.ts +9 -0
  197. package/dist/chat/transcript/inline-facts.js +20 -0
  198. package/dist/chat/transcript/notices.d.ts +25 -3
  199. package/dist/chat/transcript/notices.js +136 -17
  200. package/dist/chat/transcript/prompt.js +8 -1
  201. package/dist/chat/transcript/script-input.d.ts +1 -1
  202. package/dist/chat/transcript/tasks.d.ts +1 -1
  203. package/dist/chat/transcript/tasks.js +1 -1
  204. package/dist/chat/transcript/tool-row.js +3 -2
  205. package/dist/code/editor/FileView.js +1 -3
  206. package/dist/components/Form.d.ts +28 -1
  207. package/dist/components/Form.js +43 -7
  208. package/dist/components/HelpTip.d.ts +22 -0
  209. package/dist/components/HelpTip.js +26 -0
  210. package/dist/components/Menu.js +1 -1
  211. package/dist/components/Notice.d.ts +6 -4
  212. package/dist/components/Notice.js +73 -27
  213. package/dist/components/Progress.js +10 -4
  214. package/dist/components/SearchField.d.ts +46 -0
  215. package/dist/components/SearchField.js +50 -0
  216. package/dist/components/ShowMore.d.ts +48 -0
  217. package/dist/components/ShowMore.js +57 -0
  218. package/dist/components/Tooltip.js +8 -5
  219. package/dist/components/charts/ScatterChart.js +13 -6
  220. package/dist/components/floating/FloatingSurface.js +2 -2
  221. package/dist/components/floating/useAnchoredPosition.d.ts +15 -1
  222. package/dist/components/floating/useAnchoredPosition.js +41 -7
  223. package/dist/components/palette/PaletteList.d.ts +5 -5
  224. package/dist/components/palette/PaletteList.js +2 -3
  225. package/dist/components/palette/PalettePanel.js +18 -12
  226. package/dist/components/palette/palette-layout.d.ts +5 -1
  227. package/dist/components/palette/palette-layout.js +13 -10
  228. package/dist/core.css +45 -20
  229. package/dist/dist/index-BmO8bRgK.d.ts +1 -0
  230. package/dist/dist/{index-BheVJOLc.d.ts → index-Bsp5Ku7r.d.ts} +264 -134
  231. package/dist/dist/index.d.ts +5 -5
  232. package/dist/dist/sandbox-Bzg_jJK2.d.ts +2 -0
  233. package/dist/dist/{timeout-CmTx6V9y.d.ts → timeout-NoG7ppkm.d.ts} +1 -1
  234. package/dist/files/FilesProvider.d.ts +2 -0
  235. package/dist/files/FilesProvider.js +5 -1
  236. package/dist/files/headless/host.d.ts +6 -2
  237. package/dist/files/index.d.ts +2 -2
  238. package/dist/files/index.js +2 -2
  239. package/dist/git/GitBar.js +8 -2
  240. package/dist/git/MoveSessionDialog.js +8 -5
  241. package/dist/git/MoveToDialog.d.ts +3 -1
  242. package/dist/git/MoveToDialog.js +43 -16
  243. package/dist/git/TeleportSessionDialog.d.ts +11 -4
  244. package/dist/git/TeleportSessionDialog.js +263 -107
  245. package/dist/git/WherePicker.js +4 -1
  246. package/dist/git/headless/labels.d.ts +8 -0
  247. package/dist/git/headless/labels.js +24 -16
  248. package/dist/git/index.d.ts +2 -2
  249. package/dist/git/index.js +2 -2
  250. package/dist/git/useEnvironmentChoices.d.ts +19 -0
  251. package/dist/git/useEnvironmentChoices.js +34 -10
  252. package/dist/hooks/useLastCount.d.ts +9 -0
  253. package/dist/hooks/useLastCount.js +29 -0
  254. package/dist/index.d.ts +6 -2
  255. package/dist/index.js +7 -3
  256. package/dist/keybindings/headless/overrides.d.ts +1 -1
  257. package/dist/keybindings/headless/overrides.js +14 -3
  258. package/dist/labels.d.ts +7 -0
  259. package/dist/labels.js +10 -3
  260. package/dist/machines/AddMachineDialog.js +1 -1
  261. package/dist/machines/AddServerForm.d.ts +14 -2
  262. package/dist/machines/AddServerForm.js +167 -51
  263. package/dist/machines/HostCapabilities.js +8 -4
  264. package/dist/machines/HostSignIn.d.ts +2 -1
  265. package/dist/machines/HostSignIn.js +1 -0
  266. package/dist/machines/HostSyncPanel.d.ts +4 -1
  267. package/dist/machines/HostSyncPanel.js +248 -132
  268. package/dist/machines/HostsSection.d.ts +2 -2
  269. package/dist/machines/HostsSection.js +91 -52
  270. package/dist/machines/LinkedAccountsPanel.d.ts +29 -0
  271. package/dist/machines/LinkedAccountsPanel.js +268 -0
  272. package/dist/machines/MachinesExplainer.d.ts +4 -4
  273. package/dist/machines/MachinesExplainer.js +27 -17
  274. package/dist/machines/OrganizationPanel.d.ts +12 -5
  275. package/dist/machines/OrganizationPanel.js +420 -133
  276. package/dist/machines/ProjectsSpendPanel.d.ts +22 -0
  277. package/dist/machines/ProjectsSpendPanel.js +160 -0
  278. package/dist/machines/ServerMachinesPanel.js +19 -4
  279. package/dist/machines/ServerUpdatePanel.js +3 -3
  280. package/dist/machines/SyncAccounts.d.ts +14 -7
  281. package/dist/machines/SyncAccounts.js +67 -81
  282. package/dist/machines/TokensPanel.js +54 -30
  283. package/dist/machines/headless/fixture-host.d.ts +15 -10
  284. package/dist/machines/headless/fixture-host.js +75 -44
  285. package/dist/machines/headless/fixtures.d.ts +12 -0
  286. package/dist/machines/headless/fixtures.js +71 -1
  287. package/dist/machines/headless/host.d.ts +13 -9
  288. package/dist/machines/headless/index.d.ts +3 -3
  289. package/dist/machines/headless/index.js +2 -2
  290. package/dist/machines/headless/labels.d.ts +81 -40
  291. package/dist/machines/headless/labels.js +103 -60
  292. package/dist/machines/headless/linked-accounts.d.ts +42 -0
  293. package/dist/machines/headless/linked-accounts.js +31 -0
  294. package/dist/machines/headless/organization.d.ts +9 -3
  295. package/dist/machines/headless/organization.js +12 -2
  296. package/dist/machines/headless/sync.d.ts +2 -0
  297. package/dist/machines/index.d.ts +3 -2
  298. package/dist/machines/index.js +3 -2
  299. package/dist/machines/sync-rows.d.ts +8 -0
  300. package/dist/machines/sync-rows.js +10 -0
  301. package/dist/machines/testing/contract.d.ts +1 -25
  302. package/dist/machines/testing/contract.js +1 -97
  303. package/dist/machines/testing/index.d.ts +3 -3
  304. package/dist/machines/testing/index.js +2 -2
  305. package/dist/onboarding/demos/extensions.d.ts +4 -0
  306. package/dist/onboarding/demos/extensions.js +27 -1
  307. package/dist/onboarding/demos/sidebar-layout.d.ts +4 -2
  308. package/dist/onboarding/demos/sidebar-layout.js +5 -2
  309. package/dist/onboarding/headless/labels.d.ts +9 -0
  310. package/dist/onboarding/headless/labels.js +2 -0
  311. package/dist/onboarding/steps/SidebarStep.js +4 -2
  312. package/dist/onboarding/steps/setting-cards.d.ts +4 -2
  313. package/dist/onboarding/steps/setting-cards.js +3 -2
  314. package/dist/palette/PaletteDialog.js +4 -4
  315. package/dist/palette/PaletteRows.js +34 -16
  316. package/dist/palette/headless/app-sources.js +3 -1
  317. package/dist/palette/headless/labels.js +2 -2
  318. package/dist/palette/usePaletteController.js +4 -8
  319. package/dist/session/ArtifactsPanel.js +11 -23
  320. package/dist/session/NewProjectDialog.d.ts +33 -0
  321. package/dist/session/NewProjectDialog.js +216 -0
  322. package/dist/session/OpenProjectsDialog.d.ts +56 -0
  323. package/dist/session/OpenProjectsDialog.js +324 -0
  324. package/dist/session/OpenSessionsDialog.js +186 -61
  325. package/dist/session/ProjectArtifactsHome.d.ts +42 -0
  326. package/dist/session/ProjectArtifactsHome.js +98 -0
  327. package/dist/session/ProjectArtifactsSection.d.ts +13 -0
  328. package/dist/session/ProjectArtifactsSection.js +367 -0
  329. package/dist/session/ProjectBudgetsSection.d.ts +7 -0
  330. package/dist/session/ProjectBudgetsSection.js +377 -0
  331. package/dist/session/ProjectContextSection.d.ts +20 -0
  332. package/dist/session/ProjectContextSection.js +139 -0
  333. package/dist/session/ProjectHome.d.ts +32 -5
  334. package/dist/session/ProjectHome.js +496 -249
  335. package/dist/session/ProjectInstructionsSection.d.ts +7 -0
  336. package/dist/session/ProjectInstructionsSection.js +179 -0
  337. package/dist/session/ProjectMainButton.d.ts +35 -0
  338. package/dist/session/ProjectMainButton.js +73 -0
  339. package/dist/session/ProjectName.d.ts +76 -0
  340. package/dist/session/ProjectName.js +140 -0
  341. package/dist/session/ProjectOrchestratorSection.d.ts +14 -0
  342. package/dist/session/ProjectOrchestratorSection.js +117 -0
  343. package/dist/session/ProjectPublishDialog.d.ts +30 -0
  344. package/dist/session/ProjectPublishDialog.js +420 -0
  345. package/dist/session/ProjectSessionAccessSection.d.ts +13 -0
  346. package/dist/session/ProjectSessionAccessSection.js +109 -0
  347. package/dist/session/ProjectSessionsList.d.ts +53 -0
  348. package/dist/session/ProjectSessionsList.js +316 -0
  349. package/dist/session/ProjectSettingsDialog.d.ts +30 -0
  350. package/dist/session/ProjectSettingsDialog.js +693 -0
  351. package/dist/session/ProjectShareDialog.d.ts +36 -0
  352. package/dist/session/ProjectShareDialog.js +190 -0
  353. package/dist/session/ProjectSkillsSection.d.ts +7 -0
  354. package/dist/session/ProjectSkillsSection.js +197 -0
  355. package/dist/session/ProjectToolsSection.d.ts +16 -0
  356. package/dist/session/ProjectToolsSection.js +347 -0
  357. package/dist/session/ProjectUsage.d.ts +61 -0
  358. package/dist/session/ProjectUsage.js +344 -0
  359. package/dist/session/ProviderUsageProvider.d.ts +2 -3
  360. package/dist/session/QueueTab.js +11 -1
  361. package/dist/session/SessionAccessNotice.d.ts +31 -0
  362. package/dist/session/SessionAccessNotice.js +69 -0
  363. package/dist/session/SessionDetailsDialog.d.ts +3 -1
  364. package/dist/session/SessionDetailsDialog.js +16 -1
  365. package/dist/session/SessionHeader.d.ts +10 -3
  366. package/dist/session/SessionHeader.js +19 -7
  367. package/dist/session/SessionPeopleStack.d.ts +3 -2
  368. package/dist/session/SessionPeopleStack.js +51 -17
  369. package/dist/session/SessionPlaceMenu.js +2 -2
  370. package/dist/session/SessionProvider.d.ts +13 -1
  371. package/dist/session/SessionProvider.js +21 -1
  372. package/dist/session/ShareSessionDialog.d.ts +4 -4
  373. package/dist/session/ShareSessionDialog.js +182 -283
  374. package/dist/session/TypingLine.d.ts +9 -4
  375. package/dist/session/TypingLine.js +16 -5
  376. package/dist/session/{UsagePanel.d.ts → UsageSection.d.ts} +9 -13
  377. package/dist/session/{UsagePanel.js → UsageSection.js} +40 -41
  378. package/dist/session/artifact-row-parts.d.ts +32 -0
  379. package/dist/session/artifact-row-parts.js +51 -0
  380. package/dist/session/headless/access.d.ts +33 -0
  381. package/dist/session/headless/access.js +48 -0
  382. package/dist/session/headless/fixture-host.d.ts +48 -9
  383. package/dist/session/headless/fixture-host.js +139 -1
  384. package/dist/session/headless/fixture-project-artifacts.d.ts +77 -0
  385. package/dist/session/headless/fixture-project-artifacts.js +168 -0
  386. package/dist/session/headless/fixture-project-content.d.ts +67 -0
  387. package/dist/session/headless/fixture-project-content.js +176 -0
  388. package/dist/session/headless/fixture-projects.d.ts +175 -0
  389. package/dist/session/headless/fixture-projects.js +498 -0
  390. package/dist/session/headless/home-layout.d.ts +18 -2
  391. package/dist/session/headless/home-layout.js +20 -7
  392. package/dist/session/headless/host.d.ts +263 -7
  393. package/dist/session/headless/index.d.ts +10 -5
  394. package/dist/session/headless/index.js +8 -3
  395. package/dist/session/headless/labels.d.ts +381 -6
  396. package/dist/session/headless/labels.js +72 -24
  397. package/dist/session/headless/orchestration-labels.d.ts +52 -0
  398. package/dist/session/headless/orchestration-labels.js +59 -0
  399. package/dist/session/headless/project-artifact-labels.d.ts +67 -0
  400. package/dist/session/headless/project-artifact-labels.js +96 -0
  401. package/dist/session/headless/project-artifacts.d.ts +124 -0
  402. package/dist/session/headless/project-artifacts.js +271 -0
  403. package/dist/session/headless/project-content-labels.d.ts +88 -0
  404. package/dist/session/headless/project-content-labels.js +152 -0
  405. package/dist/session/headless/project-labels.d.ts +123 -0
  406. package/dist/session/headless/project-labels.js +128 -0
  407. package/dist/session/headless/project-sessions.d.ts +37 -0
  408. package/dist/session/headless/project-sessions.js +57 -0
  409. package/dist/session/headless/project-usage-labels.d.ts +74 -0
  410. package/dist/session/headless/project-usage-labels.js +81 -0
  411. package/dist/session/headless/project-usage.d.ts +65 -0
  412. package/dist/session/headless/project-usage.js +92 -0
  413. package/dist/session/headless/projects.d.ts +158 -0
  414. package/dist/session/headless/projects.js +301 -0
  415. package/dist/session/headless/pushed-once.d.ts +22 -0
  416. package/dist/session/headless/pushed-once.js +28 -0
  417. package/dist/session/headless/queue.js +2 -1
  418. package/dist/session/headless/typing.d.ts +20 -1
  419. package/dist/session/headless/typing.js +58 -3
  420. package/dist/session/home-block-parts.d.ts +40 -0
  421. package/dist/session/home-block-parts.js +46 -0
  422. package/dist/session/index.d.ts +17 -4
  423. package/dist/session/index.js +16 -3
  424. package/dist/session/modal-shell.d.ts +1 -1
  425. package/dist/session/modal-shell.js +1 -1
  426. package/dist/session/project-artifact-parts.d.ts +59 -0
  427. package/dist/session/project-artifact-parts.js +222 -0
  428. package/dist/session/project-content-parts.d.ts +176 -0
  429. package/dist/session/project-content-parts.js +546 -0
  430. package/dist/session/project-files.d.ts +48 -0
  431. package/dist/session/project-files.js +54 -0
  432. package/dist/session/project-folder-actions.d.ts +11 -0
  433. package/dist/session/project-folder-actions.js +39 -0
  434. package/dist/session/project-mcp-add.d.ts +23 -0
  435. package/dist/session/project-mcp-add.js +107 -0
  436. package/dist/session/project-record-document.d.ts +48 -0
  437. package/dist/session/project-record-document.js +225 -0
  438. package/dist/session/project-settings-parts.d.ts +69 -0
  439. package/dist/session/project-settings-parts.js +90 -0
  440. package/dist/session/share-people.d.ts +222 -0
  441. package/dist/session/share-people.js +457 -0
  442. package/dist/session/testing/contract.d.ts +67 -8
  443. package/dist/session/testing/contract.js +343 -6
  444. package/dist/session/testing/index.d.ts +5 -2
  445. package/dist/session/testing/index.js +4 -1
  446. package/dist/session/testing/project-artifacts.contract.js +159 -0
  447. package/dist/session/testing/project-content.contract.d.ts +19 -0
  448. package/dist/session/testing/project-content.contract.js +221 -0
  449. package/dist/session/testing/project-sessions.contract.js +134 -0
  450. package/dist/session/use-folder-missing.d.ts +6 -0
  451. package/dist/session/use-folder-missing.js +31 -0
  452. package/dist/session/use-folder-project.d.ts +14 -0
  453. package/dist/session/use-folder-project.js +37 -0
  454. package/dist/session/use-home-projects.d.ts +48 -0
  455. package/dist/session/use-home-projects.js +118 -0
  456. package/dist/session/use-project-home-layout.d.ts +33 -0
  457. package/dist/session/use-project-home-layout.js +134 -0
  458. package/dist/session/use-project-home-on.d.ts +2 -0
  459. package/dist/session/use-project-home-on.js +14 -0
  460. package/dist/settings/SettingCard.d.ts +3 -1
  461. package/dist/settings/SettingCard.js +2 -1
  462. package/dist/settings/SettingDemo.d.ts +3 -1
  463. package/dist/settings/SettingDemo.js +4 -3
  464. package/dist/settings/SettingsShell.d.ts +2 -1
  465. package/dist/settings/SettingsShell.js +55 -43
  466. package/dist/settings/headless/index.d.ts +2 -1
  467. package/dist/settings/headless/index.js +2 -1
  468. package/dist/settings/headless/mcp-requirement.d.ts +93 -0
  469. package/dist/settings/headless/mcp-requirement.js +116 -0
  470. package/dist/settings/headless/search.d.ts +1 -1
  471. package/dist/settings/index.d.ts +3 -2
  472. package/dist/settings/index.js +5 -4
  473. package/dist/settings/section.d.ts +9 -0
  474. package/dist/settings/section.js +12 -1
  475. package/dist/settings/sections/editor/labels.js +1 -1
  476. package/dist/settings/sections/extensions/ExtensionConfigRows.d.ts +6 -2
  477. package/dist/settings/sections/extensions/ExtensionConfigRows.js +10 -1
  478. package/dist/settings/sections/extensions/ExtensionOptionsSection.js +1 -0
  479. package/dist/settings/sections/extensions/ExtensionsSection.d.ts +6 -3
  480. package/dist/settings/sections/extensions/ExtensionsSection.js +24 -3
  481. package/dist/settings/sections/extensions/McpRequirementRow.d.ts +45 -0
  482. package/dist/settings/sections/extensions/McpRequirementRow.js +298 -0
  483. package/dist/settings/sections/extensions/labels.d.ts +4 -0
  484. package/dist/settings/sections/extensions/labels.js +4 -0
  485. package/dist/settings/sections/extensions/options-labels.d.ts +39 -0
  486. package/dist/settings/sections/extensions/options-labels.js +48 -1
  487. package/dist/settings/sections/extensions/use-mcp-setup.d.ts +6 -0
  488. package/dist/settings/sections/extensions/use-mcp-setup.js +41 -0
  489. package/dist/settings/sections/host-catalog/HostCatalogSection.js +3 -0
  490. package/dist/settings/sections/index.d.ts +4 -3
  491. package/dist/settings/sections/index.js +4 -3
  492. package/dist/settings/sections/instructions/InstructionsSection.d.ts +69 -1
  493. package/dist/settings/sections/instructions/InstructionsSection.js +181 -109
  494. package/dist/settings/sections/mcp/McpAddForm.d.ts +9 -2
  495. package/dist/settings/sections/mcp/McpAddForm.js +15 -7
  496. package/dist/settings/sections/mcp/McpServerRow.js +7 -47
  497. package/dist/settings/sections/mcp/McpSignIn.d.ts +38 -0
  498. package/dist/settings/sections/mcp/McpSignIn.js +72 -0
  499. package/dist/settings/sections/mcp/labels.js +1 -1
  500. package/dist/settings/sections/models/AgentDefaults.d.ts +12 -4
  501. package/dist/settings/sections/models/AgentDefaults.js +102 -70
  502. package/dist/settings/sections/models/ModelPickField.d.ts +10 -1
  503. package/dist/settings/sections/models/ModelPickField.js +87 -39
  504. package/dist/settings/sections/models/labels.d.ts +8 -0
  505. package/dist/settings/sections/models/labels.js +8 -0
  506. package/dist/settings/sections/performance/labels.js +2 -2
  507. package/dist/settings/sections/providers/ServerSignIn.d.ts +6 -1
  508. package/dist/settings/sections/providers/ServerSignIn.js +66 -61
  509. package/dist/settings/sections/skills/SkillList.d.ts +45 -0
  510. package/dist/settings/sections/skills/SkillList.js +58 -40
  511. package/dist/settings/server-app.d.ts +2 -0
  512. package/dist/settings/server-app.js +16 -4
  513. package/dist/styles.css +127 -34
  514. package/dist/theme/runtime-icons.js +7 -3
  515. package/dist/workspace/PanelContentView.js +1 -1
  516. package/package.json +26 -2
  517. package/src/styles/app.css +6 -3
  518. package/src/styles/palette.css +15 -19
  519. package/src/styles/primitives.css +3 -1
  520. package/src/styles/transcript.css +22 -0
  521. package/dist/dist/index-ttmMvjgM.d.ts +0 -1
  522. package/dist/dist/sandbox-CSUihARm.d.ts +0 -2
  523. package/dist/machines/PersonalLayerPanel.d.ts +0 -32
  524. package/dist/machines/PersonalLayerPanel.js +0 -360
  525. package/dist/machines/headless/layer.d.ts +0 -64
  526. package/dist/machines/headless/layer.js +0 -56
  527. /package/dist/dist/{execution-failure-SREfl-EZ.d.ts → execution-failure-_L2r_Qd-.d.ts} +0 -0
@@ -18,6 +18,8 @@ import { InstructionsSectionLabels } from "./labels.js";
18
18
  import { CSSProperties, ReactNode } from "react";
19
19
  /** The Instructions section's strings, overridable through `LabelsProvider`. */
20
20
  export declare function useInstructionsSectionLabels(): InstructionsSectionLabels;
21
+ /** The hue of an instructions file (an AGENTS.md, a project's instructions), the composer's context breakdown's. */
22
+ export declare const INSTRUCTIONS_FILE_COLOR = "#22d3ee";
21
23
  /** Props for {@link InstructionsSection}. */
22
24
  export interface InstructionsSectionProps {
23
25
  /** The session whose prompt shows (`null`: none open). */
@@ -36,4 +38,70 @@ export interface InstructionsSectionProps {
36
38
  *
37
39
  * @param props - The session, whether its files are local, the markdown renderer, `className` and `style`.
38
40
  */
39
- export declare function InstructionsSection({ sessionId, localFiles, renderMarkdown, className, style }: InstructionsSectionProps): import("react").JSX.Element;
41
+ export declare function InstructionsSection({ sessionId, localFiles, renderMarkdown, className, style }: InstructionsSectionProps): import("react").JSX.Element;
42
+ /** Props for {@link InstructionCard}. */
43
+ export interface InstructionCardProps {
44
+ /** What it is: a file's or a record's name. */
45
+ name: ReactNode;
46
+ /** Its hue: the dot by its name and the edge of its open text. */
47
+ color: string;
48
+ /** After its name: where it comes from, what it weighs. */
49
+ badges?: ReactNode;
50
+ /** Line 2: which file or source. */
51
+ second?: string;
52
+ /** The whole of line 2, in its tooltip (a path whose home shows as `~`). */
53
+ secondHint?: string | undefined;
54
+ /** It shows its text. */
55
+ expanded: boolean;
56
+ /** Opens and closes its text. Absent: it has none to show, and does not expand. */
57
+ onToggle?: () => void;
58
+ /** Its controls, on the right. */
59
+ actions?: ReactNode;
60
+ /** Its text, shown while expanded, under a hairline edged in its hue. */
61
+ panel?: ReactNode;
62
+ /** Classes of the panel's frame (its height, its padding). */
63
+ panelClassName?: string;
64
+ /** What opens under its head besides its text (a history). The card lifts as an expanded one does. */
65
+ children?: ReactNode;
66
+ /** It is off: its head reads muted. */
67
+ dim?: boolean;
68
+ /** Test id on the card. */
69
+ testId?: string;
70
+ }
71
+ /**
72
+ * One piece of the prompt, laid out like a skill: line 1 names it with its badges (where it comes from, what it weighs),
73
+ * line 2 says which file or source, its controls on the right; expanded, its text inside. Settings › Instructions and a
74
+ * project's Instructions draw it.
75
+ *
76
+ * @param props - The {@link InstructionCardProps}.
77
+ */
78
+ export declare function InstructionCard({ name, color, badges, second, secondHint, expanded, onToggle, actions, panel, panelClassName, children, dim, testId }: InstructionCardProps): import("react").JSX.Element;
79
+ /**
80
+ * What a piece of the prompt weighs, estimated: `~1.2k`, the count in its tooltip.
81
+ *
82
+ * @param props - The tokens.
83
+ * @param props.tokens - Its estimated tokens.
84
+ */
85
+ export declare function ContextTokensChip({ tokens }: {
86
+ tokens: number;
87
+ }): import("react").JSX.Element;
88
+ /** One slice of {@link ContextShareBar}. */
89
+ export interface ContextShareSlice {
90
+ /** Its key. */
91
+ id: string;
92
+ /** What it is, in its slice's tooltip. */
93
+ label: string;
94
+ /** What it weighs. */
95
+ tokens: number;
96
+ /** Its hue. */
97
+ color: string;
98
+ }
99
+ /**
100
+ * Where the context goes: one bar, a slice per piece, the total on the right. Nothing when it weighs nothing.
101
+ *
102
+ * @param props - The slices.
103
+ * @param props.slices - The pieces, in order.
104
+ */
105
+ export declare function ContextShareBar({ slices }: {
106
+ slices: readonly ContextShareSlice[];
107
+ }): import("react").JSX.Element | null;
@@ -3,6 +3,7 @@ import { buttonClass } from "../../../components/button.js";
3
3
  import { ErrorNote, MetaChip } from "../../../components/Form.js";
4
4
  import { numberFormats } from "../../../components/numbers.js";
5
5
  import { EmptyState } from "../../../components/Surface.js";
6
+ import { useTooltip } from "../../../components/Tooltip.js";
6
7
  import { useDisplayPath } from "../../../hooks/useDisplayPath.js";
7
8
  import { useLabels } from "../../../labels.js";
8
9
  import { formatTokens } from "../../../session/headless/usage-format.js";
@@ -22,13 +23,15 @@ import { instructionOriginBadge, instructionPreviewLines } from "zidane/chat/pur
22
23
  function useInstructionsSectionLabels() {
23
24
  return useSectionLabels(DEFAULT_INSTRUCTIONS_SECTION_LABELS);
24
25
  }
26
+ /** The hue of an instructions file (an AGENTS.md, a project's instructions), the composer's context breakdown's. */
27
+ const INSTRUCTIONS_FILE_COLOR = "#22d3ee";
25
28
  /** One hue per kind of instruction, the ones the composer's context breakdown uses. */
26
29
  function segmentColor(segment) {
27
30
  if (segment.id === "system") return "#4f9dff";
28
31
  if (segment.id === "skills") return "#a855f7";
29
32
  if (segment.id === "subagent-defs") return "#ec4899";
30
33
  if (segment.origin === "mcp" || segment.id === "mcp-instructions") return "#eab308";
31
- if (segment.origin === "file") return "#22d3ee";
34
+ if (segment.origin === "file") return INSTRUCTIONS_FILE_COLOR;
32
35
  return "var(--zg-text-muted)";
33
36
  }
34
37
  const renderDocument = (text) => /* @__PURE__ */ jsx(Markdown, {
@@ -138,7 +141,12 @@ function InstructionsSection({ sessionId, localFiles = true, renderMarkdown = re
138
141
  state.kind === "error" && /* @__PURE__ */ jsx(ErrorNote, { children: shared.catalogError(state.error) }),
139
142
  state.kind === "ready" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
140
143
  actionError && /* @__PURE__ */ jsx(ErrorNote, { children: shared.catalogError(actionError) }),
141
- state.report.segments.length === 0 ? /* @__PURE__ */ jsx(EmptyState, { title: l.instructionsSectionNoContext }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ShareBar, { segments: state.report.segments }), /* @__PURE__ */ jsx("ul", {
144
+ state.report.segments.length === 0 ? /* @__PURE__ */ jsx(EmptyState, { title: l.instructionsSectionNoContext }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ContextShareBar, { slices: state.report.segments.map((s) => ({
145
+ id: s.id,
146
+ label: s.label,
147
+ tokens: s.tokens,
148
+ color: segmentColor(s)
149
+ })) }), /* @__PURE__ */ jsx("ul", {
142
150
  className: "flex flex-col gap-2 m-0 p-0 list-none",
143
151
  "data-testid": "instruction-list",
144
152
  children: state.report.segments.map((segment) => /* @__PURE__ */ jsx(ContextSegmentRow, {
@@ -185,126 +193,190 @@ function overrideState(report, l, canCreate) {
185
193
  */
186
194
  function ContextSegmentRow({ segment, expanded, total, onToggle, onOpen, canReveal = false, renderMarkdown, override, busy = false, onCreateOverride }) {
187
195
  const l = useInstructionsSectionLabels();
188
- const nf = numberFormats(useLabels().numberLocale);
189
196
  const preview = expanded ? instructionPreviewLines(segment.text) : null;
190
197
  const color = segmentColor(segment);
191
198
  const share = total > 0 ? Math.round(segment.tokens / total * 100) : 0;
192
199
  const display = useDisplayPath();
193
200
  const second = segment.path ? display.path(segment.path) : segment.detail;
194
- const secondTitle = segment.path ?? segment.detail;
201
+ return /* @__PURE__ */ jsx(InstructionCard, {
202
+ testId: `instruction-${segment.id}`,
203
+ name: segment.label,
204
+ color,
205
+ badges: /* @__PURE__ */ jsxs(Fragment$1, { children: [
206
+ /* @__PURE__ */ jsx(MetaChip, { children: instructionOriginBadge(segment) }),
207
+ /* @__PURE__ */ jsx(ContextTokensChip, { tokens: segment.tokens }),
208
+ /* @__PURE__ */ jsx(MetaChip, {
209
+ className: "tabular-nums",
210
+ title: l.instructionsSectionShareTitle,
211
+ children: l.instructionsSectionShare(share)
212
+ }),
213
+ override?.unloaded && /* @__PURE__ */ jsxs(MetaChip, {
214
+ tone: "warn",
215
+ title: override.unloaded,
216
+ children: [/* @__PURE__ */ jsx("span", {
217
+ "aria-hidden": true,
218
+ className: "i-ph-warning text-zg-meta"
219
+ }), l.instructionsSectionNotLoaded]
220
+ })
221
+ ] }),
222
+ ...second ? {
223
+ second,
224
+ secondHint: segment.path ?? segment.detail
225
+ } : {},
226
+ expanded,
227
+ onToggle,
228
+ actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [
229
+ override?.canCreate && onCreateOverride && /* @__PURE__ */ jsx(SettingsRestricted, {
230
+ inline: true,
231
+ children: /* @__PURE__ */ jsx("button", {
232
+ type: "button",
233
+ className: "zg-press inline-flex items-center justify-center gap-1.5 shrink-0 whitespace-nowrap rounded-zg-md cursor-pointer transition-colors disabled:opacity-zg-disabled disabled:cursor-default zg-focus-ring h-7 px-2.5 text-zg-label zg-raised border text-[var(--zg-text-muted)] hover:text-[var(--zg-text)]",
234
+ disabled: busy,
235
+ onClick: onCreateOverride,
236
+ title: l.instructionsSectionCreateOverrideTitle,
237
+ children: busy ? l.instructionsSectionCreating : l.instructionsSectionCreate
238
+ })
239
+ }),
240
+ onOpen && segment.path && /* @__PURE__ */ jsx(OpenFileButton, {
241
+ path: segment.path,
242
+ name: segment.label,
243
+ onOpen
244
+ }),
245
+ onOpen && canReveal && segment.path && /* @__PURE__ */ jsx(RevealPathButton, {
246
+ path: segment.path,
247
+ name: segment.label
248
+ })
249
+ ] }),
250
+ panelClassName: "max-h-[480px] overflow-y-auto px-4 py-3 text-zg-ui",
251
+ panel: preview && /* @__PURE__ */ jsxs(Fragment$1, { children: [renderMarkdown(preview.lines.join("\n")), preview.hidden > 0 && /* @__PURE__ */ jsx("p", {
252
+ className: "m-0 mt-2 text-xs text-[var(--zg-text-muted)]",
253
+ children: l.instructionsSectionMoreLines(preview.hidden, Boolean(segment.path))
254
+ })] })
255
+ });
256
+ }
257
+ /**
258
+ * One piece of the prompt, laid out like a skill: line 1 names it with its badges (where it comes from, what it weighs),
259
+ * line 2 says which file or source, its controls on the right; expanded, its text inside. Settings › Instructions and a
260
+ * project's Instructions draw it.
261
+ *
262
+ * @param props - The {@link InstructionCardProps}.
263
+ */
264
+ function InstructionCard({ name, color, badges, second, secondHint, expanded, onToggle, actions, panel, panelClassName = "", children, dim = false, testId }) {
265
+ const hint = useTooltip(secondHint !== void 0 && secondHint !== second ? secondHint : void 0, {
266
+ portal: true,
267
+ maxWidth: 420
268
+ });
269
+ const head = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("span", {
270
+ className: "flex items-center gap-2 min-w-0",
271
+ children: [
272
+ onToggle && /* @__PURE__ */ jsx("span", {
273
+ "aria-hidden": true,
274
+ className: `i-ph-caret-right text-zg-meta text-[var(--zg-text-muted)] shrink-0 transition-transform duration-snap ease-snap ${expanded ? "rotate-90" : ""}`
275
+ }),
276
+ /* @__PURE__ */ jsx("span", {
277
+ "aria-hidden": true,
278
+ className: "w-2 h-2 rounded-full shrink-0",
279
+ style: { background: color }
280
+ }),
281
+ /* @__PURE__ */ jsx("span", {
282
+ className: "text-sm font-medium text-[var(--zg-text)] min-w-0 truncate",
283
+ children: name
284
+ }),
285
+ badges
286
+ ]
287
+ }), second && /* @__PURE__ */ jsx("span", {
288
+ ...hint.anchorProps,
289
+ className: `${onToggle ? "pl-[35px]" : "pl-4"} text-zg-label leading-zg-label text-[var(--zg-text-muted)] truncate`,
290
+ children: second
291
+ })] });
292
+ const headClass = `flex-1 min-w-0 flex flex-col gap-1 text-left transition-opacity ${dim ? "opacity-60" : ""}`;
293
+ const open = expanded && panel;
195
294
  return /* @__PURE__ */ jsxs("li", {
196
295
  className: "zg-list-item overflow-hidden",
197
- "data-open": expanded ? "" : void 0,
198
- "data-testid": `instruction-${segment.id}`,
199
- children: [/* @__PURE__ */ jsxs("div", {
200
- className: "flex items-start gap-2.5 px-3 py-2.5",
201
- children: [/* @__PURE__ */ jsxs("button", {
202
- type: "button",
203
- "aria-expanded": expanded,
204
- onClick: onToggle,
205
- className: "flex-1 min-w-0 flex flex-col gap-1 text-left bg-transparent border-0 p-0 cursor-pointer",
206
- children: [/* @__PURE__ */ jsxs("span", {
207
- className: "flex items-center gap-2 min-w-0",
208
- children: [
209
- /* @__PURE__ */ jsx("span", {
210
- "aria-hidden": true,
211
- className: `i-ph-caret-right text-zg-meta text-[var(--zg-text-muted)] shrink-0 transition-transform duration-snap ease-snap ${expanded ? "rotate-90" : ""}`
212
- }),
213
- /* @__PURE__ */ jsx("span", {
214
- "aria-hidden": true,
215
- className: "w-2 h-2 rounded-full shrink-0",
216
- style: { background: color }
217
- }),
218
- /* @__PURE__ */ jsx("span", {
219
- className: "text-sm font-medium text-[var(--zg-text)] min-w-0 truncate",
220
- children: segment.label
221
- }),
222
- /* @__PURE__ */ jsx(MetaChip, { children: instructionOriginBadge(segment) }),
223
- /* @__PURE__ */ jsxs(MetaChip, {
224
- className: "tabular-nums",
225
- title: l.instructionsSectionTokensTitle(nf.number(segment.tokens, 0)),
226
- children: [/* @__PURE__ */ jsx("span", {
227
- "aria-hidden": true,
228
- className: "i-ph-text-align-left text-zg-meta"
229
- }), l.instructionsSectionTokens(formatTokens(segment.tokens))]
230
- }),
231
- /* @__PURE__ */ jsx(MetaChip, {
232
- className: "tabular-nums",
233
- title: l.instructionsSectionShareTitle,
234
- children: l.instructionsSectionShare(share)
235
- }),
236
- override?.unloaded && /* @__PURE__ */ jsxs(MetaChip, {
237
- tone: "warn",
238
- title: override.unloaded,
239
- children: [/* @__PURE__ */ jsx("span", {
240
- "aria-hidden": true,
241
- className: "i-ph-warning text-zg-meta"
242
- }), l.instructionsSectionNotLoaded]
243
- })
244
- ]
245
- }), second && /* @__PURE__ */ jsx("span", {
246
- className: "pl-[35px] text-zg-label leading-zg-label text-[var(--zg-text-muted)] truncate",
247
- title: secondTitle,
248
- children: second
296
+ "data-open": open || children ? "" : void 0,
297
+ "data-testid": testId,
298
+ children: [
299
+ /* @__PURE__ */ jsxs("div", {
300
+ className: "flex items-start gap-2.5 px-3 py-2.5",
301
+ children: [onToggle ? /* @__PURE__ */ jsx("button", {
302
+ type: "button",
303
+ "aria-expanded": expanded,
304
+ onClick: onToggle,
305
+ className: `${headClass} bg-transparent border-0 p-0 cursor-pointer`,
306
+ children: head
307
+ }) : /* @__PURE__ */ jsx("div", {
308
+ className: headClass,
309
+ children: head
310
+ }), actions && /* @__PURE__ */ jsx("div", {
311
+ className: "shrink-0 flex items-center gap-0.5 -my-0.5",
312
+ children: actions
249
313
  })]
250
- }), /* @__PURE__ */ jsxs("div", {
251
- className: "shrink-0 flex items-center gap-0.5 -my-0.5",
252
- children: [
253
- override?.canCreate && onCreateOverride && /* @__PURE__ */ jsx(SettingsRestricted, {
254
- inline: true,
255
- children: /* @__PURE__ */ jsx("button", {
256
- type: "button",
257
- className: "zg-press inline-flex items-center justify-center gap-1.5 shrink-0 whitespace-nowrap rounded-zg-md cursor-pointer transition-colors disabled:opacity-zg-disabled disabled:cursor-default zg-focus-ring h-7 px-2.5 text-zg-label zg-raised border text-[var(--zg-text-muted)] hover:text-[var(--zg-text)]",
258
- disabled: busy,
259
- onClick: onCreateOverride,
260
- title: l.instructionsSectionCreateOverrideTitle,
261
- children: busy ? l.instructionsSectionCreating : l.instructionsSectionCreate
262
- })
263
- }),
264
- onOpen && segment.path && /* @__PURE__ */ jsx(OpenFileButton, {
265
- path: segment.path,
266
- name: segment.label,
267
- onOpen
268
- }),
269
- onOpen && canReveal && segment.path && /* @__PURE__ */ jsx(RevealPathButton, {
270
- path: segment.path,
271
- name: segment.label
272
- })
273
- ]
274
- })]
275
- }), preview && /* @__PURE__ */ jsxs("div", {
276
- className: "border-t border-[var(--zg-hairline)] max-h-[480px] overflow-y-auto px-4 py-3 text-zg-ui",
277
- style: { boxShadow: `inset 2px 0 0 ${color}` },
278
- children: [renderMarkdown(preview.lines.join("\n")), preview.hidden > 0 && /* @__PURE__ */ jsx("p", {
279
- className: "m-0 mt-2 text-xs text-[var(--zg-text-muted)]",
280
- children: l.instructionsSectionMoreLines(preview.hidden, Boolean(segment.path))
281
- })]
282
- })]
314
+ }),
315
+ hint.tip,
316
+ children,
317
+ open && /* @__PURE__ */ jsx("div", {
318
+ className: `border-t border-[var(--zg-hairline)] ${panelClassName}`,
319
+ style: { boxShadow: `inset 2px 0 0 ${color}` },
320
+ children: panel
321
+ })
322
+ ]
283
323
  });
284
324
  }
285
- /** Where the default context goes: one bar, a slice per section, the total on the right. */
286
- function ShareBar({ segments }) {
325
+ /**
326
+ * What a piece of the prompt weighs, estimated: `~1.2k`, the count in its tooltip.
327
+ *
328
+ * @param props - The tokens.
329
+ * @param props.tokens - Its estimated tokens.
330
+ */
331
+ function ContextTokensChip({ tokens }) {
332
+ const l = useInstructionsSectionLabels();
333
+ const nf = numberFormats(useLabels().numberLocale);
334
+ const tip = useTooltip(l.instructionsSectionTokensTitle(nf.number(tokens, 0)), { portal: true });
335
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
336
+ ...tip.anchorProps,
337
+ className: "inline-flex",
338
+ children: /* @__PURE__ */ jsxs(MetaChip, {
339
+ className: "tabular-nums",
340
+ children: [/* @__PURE__ */ jsx("span", {
341
+ "aria-hidden": true,
342
+ className: "i-ph-text-align-left text-zg-meta"
343
+ }), l.instructionsSectionTokens(formatTokens(tokens))]
344
+ })
345
+ }), tip.tip] });
346
+ }
347
+ /**
348
+ * Where the context goes: one bar, a slice per piece, the total on the right. Nothing when it weighs nothing.
349
+ *
350
+ * @param props - The slices.
351
+ * @param props.slices - The pieces, in order.
352
+ */
353
+ function ContextShareBar({ slices }) {
287
354
  const l = useInstructionsSectionLabels();
288
- const total = segments.reduce((sum, s) => sum + s.tokens, 0);
355
+ const total = slices.reduce((sum, s) => sum + s.tokens, 0);
356
+ const estimate = useTooltip(l.instructionsSectionEstimateTitle, { portal: true });
289
357
  if (total <= 0) return null;
290
358
  return /* @__PURE__ */ jsxs("div", {
291
359
  className: "flex items-center gap-3 px-1",
292
- children: [/* @__PURE__ */ jsx("div", {
293
- className: "zg-track-chip flex-1 flex h-1.5 overflow-hidden",
294
- "aria-hidden": true,
295
- children: segments.map((segment) => /* @__PURE__ */ jsx("span", {
296
- title: l.instructionsSectionSlice(segment.label, formatTokens(segment.tokens)),
297
- className: "h-full",
298
- style: {
299
- width: `${segment.tokens / total * 100}%`,
300
- background: segmentColor(segment)
301
- }
302
- }, segment.id))
303
- }), /* @__PURE__ */ jsx("span", {
304
- className: "zg-meta shrink-0",
305
- title: l.instructionsSectionEstimateTitle,
306
- children: l.instructionsSectionTotal(formatTokens(total))
307
- })]
360
+ children: [
361
+ /* @__PURE__ */ jsx("div", {
362
+ className: "zg-track-chip flex-1 flex h-1.5 overflow-hidden",
363
+ "aria-hidden": true,
364
+ children: slices.map((slice) => /* @__PURE__ */ jsx("span", {
365
+ title: l.instructionsSectionSlice(slice.label, formatTokens(slice.tokens)),
366
+ className: "h-full",
367
+ style: {
368
+ width: `${slice.tokens / total * 100}%`,
369
+ background: slice.color
370
+ }
371
+ }, slice.id))
372
+ }),
373
+ /* @__PURE__ */ jsx("span", {
374
+ ...estimate.anchorProps,
375
+ className: "zg-meta shrink-0",
376
+ children: l.instructionsSectionTotal(formatTokens(total))
377
+ }),
378
+ estimate.tip
379
+ ]
308
380
  });
309
381
  }
310
- export { InstructionsSection, useInstructionsSectionLabels };
382
+ export { ContextShareBar, ContextTokensChip, INSTRUCTIONS_FILE_COLOR, InstructionCard, InstructionsSection, useInstructionsSectionLabels };
@@ -7,7 +7,7 @@
7
7
  * replaced (an add is the edit).
8
8
  */
9
9
  import { McpSectionLabels } from "./labels.js";
10
- import { CSSProperties } from "react";
10
+ import { CSSProperties, ReactNode } from "react";
11
11
  import { McpFormValues } from "zidane/chat/pure";
12
12
  /** Props for {@link McpAddForm}. */
13
13
  export interface McpAddFormProps {
@@ -17,6 +17,13 @@ export interface McpAddFormProps {
17
17
  projectScope?: boolean;
18
18
  /** Called with what was typed (validate it with `validateMcpForm`). */
19
19
  onSubmit: (values: McpFormValues) => void;
20
+ /**
21
+ * Where the server goes, said in place of the scope picker (a project's settings: the project). With it, the scope
22
+ * stays `user` in what is submitted.
23
+ */
24
+ destination?: ReactNode;
25
+ /** Shows Cancel beside the submit button (a form opened inside a list, with no header button to close it). */
26
+ onCancel?: () => void;
20
27
  /** The labels. */
21
28
  labels: McpSectionLabels;
22
29
  /** Extra classes on the form. */
@@ -29,4 +36,4 @@ export interface McpAddFormProps {
29
36
  *
30
37
  * @param props - `folderless`, `projectScope`, `onSubmit`, the labels, `className` and `style`.
31
38
  */
32
- export declare function McpAddForm({ folderless, projectScope, onSubmit, labels: l, className, style }: McpAddFormProps): import("react").JSX.Element;
39
+ export declare function McpAddForm({ folderless, projectScope, onSubmit, destination, onCancel, labels: l, className, style }: McpAddFormProps): import("react").JSX.Element;
@@ -11,7 +11,7 @@ import { MCP_TRANSPORTS } from "zidane/chat/pure";
11
11
  *
12
12
  * @param props - `folderless`, `projectScope`, `onSubmit`, the labels, `className` and `style`.
13
13
  */
14
- function McpAddForm({ folderless, projectScope = true, onSubmit, labels: l, className, style }) {
14
+ function McpAddForm({ folderless, projectScope = true, onSubmit, destination, onCancel, labels: l, className, style }) {
15
15
  const [name, setName] = useState("");
16
16
  const [transport, setTransport] = useState("stdio");
17
17
  const [commandLine, setCommandLine] = useState("");
@@ -20,7 +20,7 @@ function McpAddForm({ folderless, projectScope = true, onSubmit, labels: l, clas
20
20
  const [headers, setHeaders] = useState("");
21
21
  const [toolTimeoutSeconds, setToolTimeoutSeconds] = useState("");
22
22
  const [scope, setScope] = useState("user");
23
- const pickScope = !folderless && projectScope;
23
+ const pickScope = !folderless && projectScope && destination === void 0;
24
24
  const [oauthOpen, setOauthOpen] = useState(false);
25
25
  const [oauthClientId, setOauthClientId] = useState("");
26
26
  const [oauthClientSecret, setOauthClientSecret] = useState("");
@@ -233,11 +233,19 @@ function McpAddForm({ folderless, projectScope = true, onSubmit, labels: l, clas
233
233
  userHint: l.mcpSectionUserHint
234
234
  }) : /* @__PURE__ */ jsx("span", {
235
235
  className: "text-zg-meta text-[var(--zg-text-muted)]",
236
- children: l.mcpSectionSavedToUser
237
- }), /* @__PURE__ */ jsx("button", {
238
- type: "submit",
239
- className: BTN_LG_PRIMARY,
240
- children: l.mcpSectionSubmit
236
+ children: destination ?? l.mcpSectionSavedToUser
237
+ }), /* @__PURE__ */ jsxs("span", {
238
+ className: "flex items-center gap-2",
239
+ children: [onCancel && /* @__PURE__ */ jsx("button", {
240
+ type: "button",
241
+ className: "zg-press inline-flex items-center justify-center gap-1.5 shrink-0 whitespace-nowrap rounded-zg-md cursor-pointer transition-colors disabled:opacity-zg-disabled disabled:cursor-default zg-focus-ring h-8 px-3 text-zg-ui zg-raised border text-[var(--zg-text-muted)] hover:text-[var(--zg-text)]",
242
+ onClick: onCancel,
243
+ children: l.mcpSectionAddCancel
244
+ }), /* @__PURE__ */ jsx("button", {
245
+ type: "submit",
246
+ className: BTN_LG_PRIMARY,
247
+ children: l.mcpSectionSubmit
248
+ })]
241
249
  })]
242
250
  }),
243
251
  /* @__PURE__ */ jsx("p", {
@@ -4,9 +4,9 @@ import { HostRow, INPUT_CLASS, MetaChip, ToggleSwitch } from "../../../component
4
4
  import { IconButton } from "../../../components/IconButton.js";
5
5
  import { Notice } from "../../../components/Notice.js";
6
6
  import { Tray } from "../../../components/Surface.js";
7
- import { RoutedLink } from "../../../extensions/links.js";
8
7
  import { useSignIn } from "../../../onboarding/useSignIn.js";
9
8
  import { mcpBadge } from "../../headless/mcp.js";
9
+ import { McpAuthBadge, McpSignInStrip } from "./McpSignIn.js";
10
10
  import { useState } from "react";
11
11
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
12
  import { CONNECTORS, ageString, connectorInstalled } from "zidane/chat/pure";
@@ -70,7 +70,7 @@ function McpServerRow({ server: mcp, enabled, expanded, probing, enabledTools, r
70
70
  title: l.mcpSectionTransportTitle(mcp.transport),
71
71
  children: mcp.transport
72
72
  }),
73
- /* @__PURE__ */ jsx(AuthBadge, {
73
+ /* @__PURE__ */ jsx(McpAuthBadge, {
74
74
  badge: mcpBadge(flow ? "authorizing" : mcp.authState, mcp.test, flow !== null),
75
75
  labels: l
76
76
  }),
@@ -183,44 +183,11 @@ function McpServerRow({ server: mcp, enabled, expanded, probing, enabledTools, r
183
183
  ]
184
184
  })
185
185
  ]
186
- }), flow && /* @__PURE__ */ jsx("div", {
187
- className: "zg-tray mt-3 px-3 py-2.5 rounded-zg-md text-xs",
188
- children: flow.kind === "error" ? /* @__PURE__ */ jsx(Notice, {
189
- tone: "error",
190
- compact: true,
191
- detail: flow.message,
192
- action: /* @__PURE__ */ jsx("button", {
193
- type: "button",
194
- onClick: signIn.cancel,
195
- className: "zg-press inline-flex items-center justify-center gap-1.5 shrink-0 whitespace-nowrap rounded-zg-md cursor-pointer transition-colors disabled:opacity-zg-disabled disabled:cursor-default zg-focus-ring h-7 px-2.5 text-zg-label zg-raised border text-[var(--zg-text-muted)] hover:text-[var(--zg-text)]",
196
- children: l.mcpSectionDismiss
197
- }),
198
- children: l.mcpSectionSignInFailed
199
- }) : /* @__PURE__ */ jsxs("div", {
200
- className: "flex items-center gap-2",
201
- children: [/* @__PURE__ */ jsx("span", {
202
- className: "flex-1 min-w-0",
203
- children: flow.kind === "url" ? /* @__PURE__ */ jsxs("span", { children: [
204
- l.mcpSectionOpening,
205
- " ",
206
- /* @__PURE__ */ jsx(RoutedLink, {
207
- href: flow.url,
208
- source: "auth",
209
- rel: "noopener noreferrer",
210
- className: "text-[var(--zg-accent-hover)] underline break-all",
211
- children: l.mcpSectionOpenPage
212
- })
213
- ] }) : /* @__PURE__ */ jsx("span", {
214
- className: "text-[var(--zg-text-muted)]",
215
- children: l.mcpSectionStarting
216
- })
217
- }), /* @__PURE__ */ jsx("button", {
218
- type: "button",
219
- onClick: signIn.cancel,
220
- className: "zg-press inline-flex items-center justify-center gap-1.5 shrink-0 whitespace-nowrap rounded-zg-md cursor-pointer transition-colors disabled:opacity-zg-disabled disabled:cursor-default zg-focus-ring h-7 px-2.5 text-zg-label zg-raised border text-[var(--zg-text-muted)] hover:text-[var(--zg-text)]",
221
- children: l.mcpSectionCancel
222
- })]
223
- })
186
+ }), flow && /* @__PURE__ */ jsx(McpSignInStrip, {
187
+ flow,
188
+ labels: l,
189
+ onCancel: signIn.cancel,
190
+ className: "mt-3"
224
191
  })]
225
192
  }), expanded && /* @__PURE__ */ jsxs("div", {
226
193
  className: "border-t border-[var(--zg-hairline)] p-1.5 flex flex-col gap-1.5",
@@ -375,13 +342,6 @@ function McpToolRow({ tool, enabled, serverEnabled, onToggle, labels: l }) {
375
342
  })]
376
343
  }) });
377
344
  }
378
- function AuthBadge({ badge, labels: l }) {
379
- if (badge === "idle") return null;
380
- return /* @__PURE__ */ jsx(MetaChip, {
381
- tone: badge === "authed" ? "success" : badge === "authorizing" ? "muted" : badge === "needs-auth" ? "warn" : "danger",
382
- children: l.mcpSectionBadge(badge)
383
- });
384
- }
385
345
  /** How the last test went, in one line under the server's address. */
386
346
  function TestLine({ test, probing, labels: l }) {
387
347
  if (probing) return /* @__PURE__ */ jsx("div", {
@@ -0,0 +1,38 @@
1
+ /**
2
+ * What every MCP server sign-in shows, in Settings › MCP servers and in a
3
+ * project's shared sign-ins (`ProjectSettingsDialog`): the badge of its state,
4
+ * and the strip under its row while the browser sign-in runs (the page to
5
+ * open and Cancel, or what failed and Dismiss).
6
+ */
7
+ import { SettingsMcpBadge } from "../../headless/mcp.js";
8
+ import { McpSectionLabels } from "./labels.js";
9
+ import { OnboardingSignInState } from "zidane/chat/pure";
10
+ /**
11
+ * The sign-in state of a server as a chip: nothing while idle.
12
+ *
13
+ * @param props - The state, and the labels.
14
+ * @param props.badge - The state.
15
+ * @param props.labels - The MCP section's labels.
16
+ */
17
+ export declare function McpAuthBadge({ badge, labels: l }: {
18
+ badge: SettingsMcpBadge;
19
+ labels: McpSectionLabels;
20
+ }): import("react").JSX.Element | null;
21
+ /**
22
+ * A running browser sign-in, under its server's row: the page to open (never through an extension's link handler) and
23
+ * Cancel, Starting… before the page is known, or the failure with Dismiss.
24
+ *
25
+ * @param props - The sign-in, the labels, and what Cancel or Dismiss does.
26
+ * @param props.flow - Where the sign-in is: any state but done.
27
+ * @param props.labels - The MCP section's labels.
28
+ * @param props.onCancel - Stops the sign-in (Cancel), or forgets its failure (Dismiss).
29
+ * @param props.className - Extra classes on the strip.
30
+ */
31
+ export declare function McpSignInStrip({ flow, labels: l, onCancel, className }: {
32
+ flow: Exclude<OnboardingSignInState, {
33
+ kind: 'done';
34
+ }>;
35
+ labels: McpSectionLabels;
36
+ onCancel: () => void;
37
+ className?: string;
38
+ }): import("react").JSX.Element;