@cueplusplus/ui 0.3.0 → 0.6.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 (541) hide show
  1. package/CHANGELOG.md +2263 -0
  2. package/dist/agent-runtime/_glyphs.js +43 -0
  3. package/dist/agent-runtime/branch-picker.d.ts +45 -0
  4. package/dist/agent-runtime/branch-picker.js +87 -0
  5. package/dist/agent-runtime/index.d.ts +4 -0
  6. package/dist/agent-runtime/index.js +4 -0
  7. package/dist/agent-runtime/tool-call-card.d.ts +69 -0
  8. package/dist/agent-runtime/tool-call-card.js +187 -0
  9. package/dist/agent-runtime/use-agent-thread.d.ts +164 -0
  10. package/dist/agent-runtime/use-agent-thread.js +251 -0
  11. package/dist/chat/index.d.ts +2 -2
  12. package/dist/chat/message-list.d.ts +6 -0
  13. package/dist/chat/message-list.js +35 -0
  14. package/dist/chrome/_drag.js +59 -0
  15. package/dist/chrome/_status-bar-item.js +85 -0
  16. package/dist/chrome/_status-bar.d.ts +15 -0
  17. package/dist/chrome/_status-bar.js +171 -0
  18. package/dist/chrome/app-shell.d.ts +120 -2
  19. package/dist/chrome/app-shell.js +107 -8
  20. package/dist/chrome/index.d.ts +4 -3
  21. package/dist/chrome/status-bar.d.ts +87 -4
  22. package/dist/chrome/status-bar.js +80 -16
  23. package/dist/chrome/title-bar.d.ts +11 -1
  24. package/dist/chrome/title-bar.js +1 -3
  25. package/dist/configurator/_export.js +3 -2
  26. package/dist/configurator/_overrides.d.ts +1 -1
  27. package/dist/configurator/token-editor.js +4 -1
  28. package/dist/date/_segments.js +52 -6
  29. package/dist/elements/activity-graph.d.ts +40 -0
  30. package/dist/elements/activity-graph.js +81 -0
  31. package/dist/elements/agent-card.d.ts +49 -0
  32. package/dist/elements/agent-card.js +91 -0
  33. package/dist/elements/agent-handoff.d.ts +24 -0
  34. package/dist/elements/agent-handoff.js +53 -0
  35. package/dist/elements/agent-mode-badge.d.ts +72 -0
  36. package/dist/elements/agent-mode-badge.js +110 -0
  37. package/dist/elements/agent-plan.d.ts +24 -0
  38. package/dist/elements/agent-plan.js +74 -0
  39. package/dist/elements/agent-status.d.ts +29 -0
  40. package/dist/elements/agent-status.js +46 -0
  41. package/dist/elements/agent-surface.d.ts +65 -0
  42. package/dist/elements/agent-surface.js +68 -0
  43. package/dist/elements/animated-number.d.ts +86 -0
  44. package/dist/elements/animated-number.js +118 -0
  45. package/dist/elements/approval-card.d.ts +40 -0
  46. package/dist/elements/approval-card.js +78 -0
  47. package/dist/elements/artifact-card.d.ts +30 -0
  48. package/dist/elements/artifact-card.js +58 -0
  49. package/dist/elements/background-inbox.d.ts +39 -0
  50. package/dist/elements/background-inbox.js +60 -0
  51. package/dist/elements/canvas-split.d.ts +77 -0
  52. package/dist/elements/canvas-split.js +138 -0
  53. package/dist/elements/chart.d.ts +41 -0
  54. package/dist/elements/chart.js +117 -0
  55. package/dist/elements/chat-panel.d.ts +46 -0
  56. package/dist/elements/chat-panel.js +104 -0
  57. package/dist/elements/checkpoint-history.d.ts +31 -0
  58. package/dist/elements/checkpoint-history.js +65 -0
  59. package/dist/elements/clamp.d.ts +90 -0
  60. package/dist/elements/clamp.js +109 -0
  61. package/dist/elements/code-diff.d.ts +42 -0
  62. package/dist/elements/code-diff.js +69 -0
  63. package/dist/elements/code-runner.d.ts +38 -0
  64. package/dist/elements/code-runner.js +84 -0
  65. package/dist/elements/command-palette.d.ts +48 -0
  66. package/dist/elements/command-palette.js +129 -0
  67. package/dist/elements/compaction-row.d.ts +63 -0
  68. package/dist/elements/compaction-row.js +110 -0
  69. package/dist/elements/comparison-card.d.ts +47 -0
  70. package/dist/elements/comparison-card.js +69 -0
  71. package/dist/elements/composer.d.ts +274 -0
  72. package/dist/elements/composer.js +505 -0
  73. package/dist/elements/computer-use.d.ts +40 -0
  74. package/dist/elements/computer-use.js +92 -0
  75. package/dist/elements/confidence-marker.d.ts +39 -0
  76. package/dist/elements/confidence-marker.js +64 -0
  77. package/dist/elements/connection-state.d.ts +29 -0
  78. package/dist/elements/connection-state.js +66 -0
  79. package/dist/elements/context-breakdown.d.ts +30 -0
  80. package/dist/elements/context-breakdown.js +86 -0
  81. package/dist/elements/context-usage.d.ts +99 -0
  82. package/dist/elements/context-usage.js +225 -0
  83. package/dist/elements/conversation-search.d.ts +48 -0
  84. package/dist/elements/conversation-search.js +88 -0
  85. package/dist/elements/cost-meter.d.ts +33 -0
  86. package/dist/elements/cost-meter.js +75 -0
  87. package/dist/elements/data-table.d.ts +31 -0
  88. package/dist/elements/data-table.js +67 -0
  89. package/dist/elements/day-separator.d.ts +34 -0
  90. package/dist/elements/day-separator.js +50 -0
  91. package/dist/elements/diagram.d.ts +34 -0
  92. package/dist/elements/diagram.js +75 -0
  93. package/dist/elements/document-reference.d.ts +37 -0
  94. package/dist/elements/document-reference.js +66 -0
  95. package/dist/elements/draft-restore.d.ts +27 -0
  96. package/dist/elements/draft-restore.js +54 -0
  97. package/dist/elements/edit-message.d.ts +36 -0
  98. package/dist/elements/edit-message.js +77 -0
  99. package/dist/elements/elements.css +459 -0
  100. package/dist/elements/elicitation-form.d.ts +48 -0
  101. package/dist/elements/elicitation-form.js +106 -0
  102. package/dist/elements/empty-state.d.ts +52 -0
  103. package/dist/elements/empty-state.js +98 -0
  104. package/dist/elements/end-of-turn-summary.d.ts +60 -0
  105. package/dist/elements/end-of-turn-summary.js +75 -0
  106. package/dist/elements/error-state.d.ts +29 -0
  107. package/dist/elements/error-state.js +55 -0
  108. package/dist/elements/feedback-dialog.d.ts +36 -0
  109. package/dist/elements/feedback-dialog.js +81 -0
  110. package/dist/elements/file-tree.d.ts +45 -0
  111. package/dist/elements/file-tree.js +84 -0
  112. package/dist/elements/flow-graph.d.ts +45 -0
  113. package/dist/elements/flow-graph.js +78 -0
  114. package/dist/elements/generative/chart.js +200 -0
  115. package/dist/elements/generative/faults.js +111 -0
  116. package/dist/elements/generative/icons.d.ts +41 -0
  117. package/dist/elements/generative/icons.js +190 -0
  118. package/dist/elements/generative/intrinsics.js +483 -0
  119. package/dist/elements/generative/spec.d.ts +110 -0
  120. package/dist/elements/generative/spec.js +366 -0
  121. package/dist/elements/generative.css +1145 -0
  122. package/dist/elements/generative.d.ts +144 -0
  123. package/dist/elements/generative.js +126 -0
  124. package/dist/elements/guardrail-notice.d.ts +29 -0
  125. package/dist/elements/guardrail-notice.js +63 -0
  126. package/dist/elements/image-generation.d.ts +18 -0
  127. package/dist/elements/image-generation.js +64 -0
  128. package/dist/elements/index.d.ts +116 -0
  129. package/dist/elements/index.js +115 -0
  130. package/dist/elements/inline-citation.d.ts +43 -0
  131. package/dist/elements/inline-citation.js +93 -0
  132. package/dist/elements/job-progress.d.ts +49 -0
  133. package/dist/elements/job-progress.js +74 -0
  134. package/dist/elements/launcher-bubble.d.ts +34 -0
  135. package/dist/elements/launcher-bubble.js +72 -0
  136. package/dist/elements/live-region-announcer.d.ts +130 -0
  137. package/dist/elements/live-region-announcer.js +230 -0
  138. package/dist/elements/loading-state.d.ts +27 -0
  139. package/dist/elements/loading-state.js +36 -0
  140. package/dist/elements/map-answer.d.ts +38 -0
  141. package/dist/elements/map-answer.js +93 -0
  142. package/dist/elements/markdown.d.ts +131 -0
  143. package/dist/elements/markdown.js +528 -0
  144. package/dist/elements/math-block.d.ts +51 -0
  145. package/dist/elements/math-block.js +70 -0
  146. package/dist/elements/mcp-server-panel.d.ts +41 -0
  147. package/dist/elements/mcp-server-panel.js +115 -0
  148. package/dist/elements/memory-chips.d.ts +30 -0
  149. package/dist/elements/memory-chips.js +43 -0
  150. package/dist/elements/message-actions.d.ts +38 -0
  151. package/dist/elements/message-actions.js +71 -0
  152. package/dist/elements/message-attachment.d.ts +48 -0
  153. package/dist/elements/message-attachment.js +63 -0
  154. package/dist/elements/message-branches.d.ts +25 -0
  155. package/dist/elements/message-branches.js +65 -0
  156. package/dist/elements/message-pair.d.ts +33 -0
  157. package/dist/elements/message-pair.js +65 -0
  158. package/dist/elements/message-queue.d.ts +31 -0
  159. package/dist/elements/message-queue.js +80 -0
  160. package/dist/elements/message-timing.d.ts +33 -0
  161. package/dist/elements/message-timing.js +37 -0
  162. package/dist/elements/mobile-composer.d.ts +44 -0
  163. package/dist/elements/mobile-composer.js +88 -0
  164. package/dist/elements/model-picker.d.ts +38 -0
  165. package/dist/elements/model-picker.js +69 -0
  166. package/dist/elements/number-ticker.d.ts +18 -0
  167. package/dist/elements/number-ticker.js +47 -0
  168. package/dist/elements/onboarding.d.ts +30 -0
  169. package/dist/elements/onboarding.js +75 -0
  170. package/dist/elements/permission-grant.d.ts +35 -0
  171. package/dist/elements/permission-grant.js +86 -0
  172. package/dist/elements/permission-scopes.d.ts +215 -0
  173. package/dist/elements/permission-scopes.js +249 -0
  174. package/dist/elements/prompt-library.d.ts +43 -0
  175. package/dist/elements/prompt-library.js +117 -0
  176. package/dist/elements/queue-dock.d.ts +101 -0
  177. package/dist/elements/queue-dock.js +132 -0
  178. package/dist/elements/quota-banner.d.ts +26 -0
  179. package/dist/elements/quota-banner.js +66 -0
  180. package/dist/elements/quote-reply.d.ts +44 -0
  181. package/dist/elements/quote-reply.js +79 -0
  182. package/dist/elements/range.d.ts +29 -0
  183. package/dist/elements/range.js +45 -0
  184. package/dist/elements/read-aloud.d.ts +45 -0
  185. package/dist/elements/read-aloud.js +75 -0
  186. package/dist/elements/reasoning-effort.d.ts +36 -0
  187. package/dist/elements/reasoning-effort.js +67 -0
  188. package/dist/elements/reasoning-panel.d.ts +46 -0
  189. package/dist/elements/reasoning-panel.js +75 -0
  190. package/dist/elements/recommendation-card.d.ts +45 -0
  191. package/dist/elements/recommendation-card.js +83 -0
  192. package/dist/elements/regenerate-menu.d.ts +45 -0
  193. package/dist/elements/regenerate-menu.js +51 -0
  194. package/dist/elements/replay.d.ts +217 -0
  195. package/dist/elements/replay.js +498 -0
  196. package/dist/elements/research-report.d.ts +38 -0
  197. package/dist/elements/research-report.js +69 -0
  198. package/dist/elements/retrieval-chunks.d.ts +43 -0
  199. package/dist/elements/retrieval-chunks.js +81 -0
  200. package/dist/elements/revert-dock.d.ts +159 -0
  201. package/dist/elements/revert-dock.js +327 -0
  202. package/dist/elements/reviewable-diff.d.ts +45 -0
  203. package/dist/elements/reviewable-diff.js +110 -0
  204. package/dist/elements/risk-badge.d.ts +52 -0
  205. package/dist/elements/risk-badge.js +91 -0
  206. package/dist/elements/schedule-card.d.ts +42 -0
  207. package/dist/elements/schedule-card.js +90 -0
  208. package/dist/elements/score-breakdown.d.ts +47 -0
  209. package/dist/elements/score-breakdown.js +82 -0
  210. package/dist/elements/scroll-anchor.d.ts +32 -0
  211. package/dist/elements/scroll-anchor.js +121 -0
  212. package/dist/elements/settings-panel.d.ts +52 -0
  213. package/dist/elements/settings-panel.js +107 -0
  214. package/dist/elements/shared-conversation.d.ts +39 -0
  215. package/dist/elements/shared-conversation.js +68 -0
  216. package/dist/elements/sources.d.ts +33 -0
  217. package/dist/elements/sources.js +61 -0
  218. package/dist/elements/speaker-identity.d.ts +32 -0
  219. package/dist/elements/speaker-identity.js +51 -0
  220. package/dist/elements/spec-sheet.d.ts +31 -0
  221. package/dist/elements/spec-sheet.js +45 -0
  222. package/dist/elements/stopped-run.d.ts +22 -0
  223. package/dist/elements/stopped-run.js +50 -0
  224. package/dist/elements/streaming-text.d.ts +31 -0
  225. package/dist/elements/streaming-text.js +45 -0
  226. package/dist/elements/subagent-list.d.ts +37 -0
  227. package/dist/elements/subagent-list.js +79 -0
  228. package/dist/elements/suggestions.d.ts +30 -0
  229. package/dist/elements/suggestions.js +36 -0
  230. package/dist/elements/surfaces.d.ts +85 -0
  231. package/dist/elements/surfaces.js +107 -0
  232. package/dist/elements/tail-status.d.ts +131 -0
  233. package/dist/elements/tail-status.js +94 -0
  234. package/dist/elements/terminal-block.d.ts +29 -0
  235. package/dist/elements/terminal-block.js +54 -0
  236. package/dist/elements/thinking-indicator.d.ts +18 -0
  237. package/dist/elements/thinking-indicator.js +36 -0
  238. package/dist/elements/thread-list.d.ts +35 -0
  239. package/dist/elements/thread-list.js +68 -0
  240. package/dist/elements/thread-search.d.ts +42 -0
  241. package/dist/elements/thread-search.js +99 -0
  242. package/dist/elements/timeline.d.ts +37 -0
  243. package/dist/elements/timeline.js +46 -0
  244. package/dist/elements/todo-list.d.ts +42 -0
  245. package/dist/elements/todo-list.js +59 -0
  246. package/dist/elements/tool-call.d.ts +41 -0
  247. package/dist/elements/tool-call.js +85 -0
  248. package/dist/elements/tool-error.d.ts +39 -0
  249. package/dist/elements/tool-error.js +76 -0
  250. package/dist/elements/tool-group.d.ts +45 -0
  251. package/dist/elements/tool-group.js +71 -0
  252. package/dist/elements/tool-timeline.d.ts +65 -0
  253. package/dist/elements/tool-timeline.js +88 -0
  254. package/dist/elements/trace-waterfall.d.ts +37 -0
  255. package/dist/elements/trace-waterfall.js +69 -0
  256. package/dist/elements/transcript-rules.d.ts +67 -0
  257. package/dist/elements/transcript-rules.js +95 -0
  258. package/dist/elements/turn-footer.d.ts +74 -0
  259. package/dist/elements/turn-footer.js +101 -0
  260. package/dist/elements/typing-indicator.d.ts +16 -0
  261. package/dist/elements/typing-indicator.js +51 -0
  262. package/dist/elements/verdict-row.d.ts +89 -0
  263. package/dist/elements/verdict-row.js +150 -0
  264. package/dist/elements/vocabulary.d.ts +612 -0
  265. package/dist/elements/vocabulary.js +611 -0
  266. package/dist/elements/voice-conversation.d.ts +49 -0
  267. package/dist/elements/voice-conversation.js +123 -0
  268. package/dist/elements/web-preview.d.ts +32 -0
  269. package/dist/elements/web-preview.js +66 -0
  270. package/dist/elements/web-search.d.ts +37 -0
  271. package/dist/elements/web-search.js +66 -0
  272. package/dist/elements/work-collapse.d.ts +103 -0
  273. package/dist/elements/work-collapse.js +131 -0
  274. package/dist/forms/_chassis.d.ts +104 -4
  275. package/dist/forms/_chassis.js +104 -4
  276. package/dist/forms/input-group.d.ts +8 -3
  277. package/dist/forms/input-group.js +8 -3
  278. package/dist/forms/number-field.d.ts +3 -2
  279. package/dist/forms/number-field.js +3 -2
  280. package/dist/icons/containers.d.ts +89 -0
  281. package/dist/icons/containers.js +295 -0
  282. package/dist/icons/index.d.ts +2 -0
  283. package/dist/index.d.ts +12 -6
  284. package/dist/index.js +5 -1
  285. package/dist/instruments/_data-row.js +118 -0
  286. package/dist/instruments/data-row.d.ts +94 -0
  287. package/dist/instruments/data-row.js +151 -0
  288. package/dist/instruments/data-tree.d.ts +126 -0
  289. package/dist/instruments/data-tree.js +303 -0
  290. package/dist/instruments/index.d.ts +5 -2
  291. package/dist/instruments/index.js +4 -1
  292. package/dist/instruments/ledger.d.ts +105 -0
  293. package/dist/instruments/ledger.js +114 -0
  294. package/dist/instruments/table.d.ts +70 -2
  295. package/dist/instruments/table.js +133 -39
  296. package/dist/instruments/two-step-button.js +25 -6
  297. package/dist/layout/sidebar.d.ts +19 -1
  298. package/dist/layout/sidebar.js +19 -1
  299. package/dist/primitives/button.js +11 -1
  300. package/dist/primitives/chip.d.ts +35 -9
  301. package/dist/primitives/chip.js +97 -11
  302. package/dist/system/agent-skin.d.ts +27 -0
  303. package/dist/system/agent-skin.js +20 -0
  304. package/dist/system/portal.d.ts +5 -3
  305. package/dist/system/portal.js +19 -5
  306. package/dist/system/theme-provider.js +54 -9
  307. package/dist/system/use-density.d.ts +9 -0
  308. package/dist/system/use-density.js +9 -0
  309. package/dist/system/use-isomorphic-layout-effect.js +19 -1
  310. package/dist/theming/_presets.d.ts +1 -1
  311. package/dist/theming/_presets.js +74 -11
  312. package/dist/theming/contrast.d.ts +16 -4
  313. package/dist/theming/contrast.js +33 -6
  314. package/dist/theming/create-theme.d.ts +6 -2
  315. package/dist/theming/create-theme.js +32 -5
  316. package/dist/theming/serialize.d.ts +10 -1
  317. package/dist/theming/serialize.js +62 -8
  318. package/manifest/components/activity-graph.json +88 -0
  319. package/manifest/components/agent-card.json +120 -0
  320. package/manifest/components/agent-handoff.json +87 -0
  321. package/manifest/components/agent-mode-badge.json +84 -0
  322. package/manifest/components/agent-plan.json +67 -0
  323. package/manifest/components/agent-status.json +73 -0
  324. package/manifest/components/agent-surface.json +78 -0
  325. package/manifest/components/alert-dialog.json +1 -1
  326. package/manifest/components/animated-number.json +67 -0
  327. package/manifest/components/app-shell.json +142 -9
  328. package/manifest/components/approval-card.json +106 -0
  329. package/manifest/components/artifact-card.json +81 -0
  330. package/manifest/components/audience-icon.json +52 -0
  331. package/manifest/components/autocomplete.json +2 -0
  332. package/manifest/components/background-inbox.json +71 -0
  333. package/manifest/components/branch-picker.json +124 -0
  334. package/manifest/components/button.json +1 -0
  335. package/manifest/components/canvas-split-body.json +62 -0
  336. package/manifest/components/canvas-split-document.json +54 -0
  337. package/manifest/components/canvas-split-header.json +83 -0
  338. package/manifest/components/canvas-split-line.json +62 -0
  339. package/manifest/components/canvas-split-message.json +62 -0
  340. package/manifest/components/canvas-split-thread.json +54 -0
  341. package/manifest/components/canvas-split.json +60 -0
  342. package/manifest/components/catalogue-icon.json +52 -0
  343. package/manifest/components/channel-beta-icon.json +52 -0
  344. package/manifest/components/channel-released-icon.json +52 -0
  345. package/manifest/components/chart.json +93 -0
  346. package/manifest/components/chat-empty-state.json +55 -0
  347. package/manifest/components/chat-panel-assistant-message.json +51 -0
  348. package/manifest/components/chat-panel-composer.json +66 -0
  349. package/manifest/components/chat-panel-messages.json +51 -0
  350. package/manifest/components/chat-panel-typing.json +51 -0
  351. package/manifest/components/chat-panel-user-message.json +51 -0
  352. package/manifest/components/chat-panel.json +57 -0
  353. package/manifest/components/checkpoint-history.json +80 -0
  354. package/manifest/components/chip.json +24 -12
  355. package/manifest/components/clamp.json +102 -0
  356. package/manifest/components/cli-tool-icon.json +52 -0
  357. package/manifest/components/code-diff.json +87 -0
  358. package/manifest/components/code-runner.json +97 -0
  359. package/manifest/components/color-field.json +2 -0
  360. package/manifest/components/color-picker.json +2 -0
  361. package/manifest/components/combobox.json +2 -0
  362. package/manifest/components/compaction-row.json +100 -0
  363. package/manifest/components/comparison-card.json +83 -0
  364. package/manifest/components/composer-actions.json +65 -0
  365. package/manifest/components/composer-attach-button.json +65 -0
  366. package/manifest/components/composer-attachment-chip.json +75 -0
  367. package/manifest/components/composer-attachments.json +60 -0
  368. package/manifest/components/composer-bar.json +73 -0
  369. package/manifest/components/composer-command-item.json +79 -0
  370. package/manifest/components/composer-context.json +67 -0
  371. package/manifest/components/composer-input.json +73 -0
  372. package/manifest/components/composer-menu-item.json +72 -0
  373. package/manifest/components/composer-menu.json +79 -0
  374. package/manifest/components/composer-model-item.json +75 -0
  375. package/manifest/components/composer-model-trigger.json +75 -0
  376. package/manifest/components/composer-person-item.json +79 -0
  377. package/manifest/components/composer-send.json +80 -0
  378. package/manifest/components/composer-toolbar.json +65 -0
  379. package/manifest/components/composer-voice-button.json +68 -0
  380. package/manifest/components/composer-voice.json +75 -0
  381. package/manifest/components/composer.json +2 -0
  382. package/manifest/components/computer-use.json +84 -0
  383. package/manifest/components/confidence-marker.json +74 -0
  384. package/manifest/components/connection-state.json +84 -0
  385. package/manifest/components/context-breakdown.json +65 -0
  386. package/manifest/components/context-usage.json +85 -0
  387. package/manifest/components/conversation-search.json +92 -0
  388. package/manifest/components/cost-meter.json +74 -0
  389. package/manifest/components/cue-portal-frame.json +1 -1
  390. package/manifest/components/data-row.json +203 -0
  391. package/manifest/components/data-tree.json +151 -0
  392. package/manifest/components/date-field.json +2 -0
  393. package/manifest/components/date-picker.json +2 -0
  394. package/manifest/components/date-range-picker.json +2 -0
  395. package/manifest/components/day-separator.json +58 -0
  396. package/manifest/components/delegation-card.json +1 -1
  397. package/manifest/components/density.json +1 -1
  398. package/manifest/components/diagram.json +100 -0
  399. package/manifest/components/document-reference.json +90 -0
  400. package/manifest/components/draft-restore.json +82 -0
  401. package/manifest/components/drawer.json +1 -1
  402. package/manifest/components/dropdown-menu.json +1 -1
  403. package/manifest/components/edit-message.json +105 -0
  404. package/manifest/components/elements-command-palette.json +100 -0
  405. package/manifest/components/elements-composer.json +71 -0
  406. package/manifest/components/elements-data-table.json +68 -0
  407. package/manifest/components/elements-timeline.json +69 -0
  408. package/manifest/components/elicitation-form.json +103 -0
  409. package/manifest/components/empty-state-composer.json +64 -0
  410. package/manifest/components/empty-state-greeting.json +49 -0
  411. package/manifest/components/empty-state-suggestion.json +57 -0
  412. package/manifest/components/empty-state-suggestions.json +49 -0
  413. package/manifest/components/end-of-turn-summary.json +77 -0
  414. package/manifest/components/env-var-input.json +2 -0
  415. package/manifest/components/error-state.json +80 -0
  416. package/manifest/components/feedback-dialog.json +107 -0
  417. package/manifest/components/file-tree.json +83 -0
  418. package/manifest/components/flow-graph.json +75 -0
  419. package/manifest/components/folder-icon.json +52 -0
  420. package/manifest/components/frac.json +59 -0
  421. package/manifest/components/generation-loader.json +64 -0
  422. package/manifest/components/generative-ui.json +93 -0
  423. package/manifest/components/guardrail-notice.json +91 -0
  424. package/manifest/components/hover-card.json +1 -1
  425. package/manifest/components/image-generation.json +67 -0
  426. package/manifest/components/info-tip.json +1 -1
  427. package/manifest/components/inline-citation.json +77 -0
  428. package/manifest/components/input-group.json +4 -2
  429. package/manifest/components/input.json +3 -1
  430. package/manifest/components/job-progress.json +96 -0
  431. package/manifest/components/launcher-bubble.json +105 -0
  432. package/manifest/components/ledger.json +187 -0
  433. package/manifest/components/live-region-announcer.json +79 -0
  434. package/manifest/components/map-answer.json +83 -0
  435. package/manifest/components/markdown-text.json +94 -0
  436. package/manifest/components/math-block.json +74 -0
  437. package/manifest/components/mcp-server-icon.json +52 -0
  438. package/manifest/components/mcp-server-panel.json +87 -0
  439. package/manifest/components/memory-chips.json +65 -0
  440. package/manifest/components/message-actions.json +99 -0
  441. package/manifest/components/message-attachments.json +63 -0
  442. package/manifest/components/message-branches.json +71 -0
  443. package/manifest/components/message-list.json +1 -1
  444. package/manifest/components/message-pair.json +86 -0
  445. package/manifest/components/message-queue.json +74 -0
  446. package/manifest/components/message-timing.json +62 -0
  447. package/manifest/components/mobile-composer.json +126 -0
  448. package/manifest/components/model-picker.json +76 -0
  449. package/manifest/components/multi-select.json +2 -0
  450. package/manifest/components/musical-time-input.json +2 -0
  451. package/manifest/components/node-card.json +1 -1
  452. package/manifest/components/node-handle.json +1 -1
  453. package/manifest/components/number-field.json +3 -1
  454. package/manifest/components/number-ticker.json +61 -0
  455. package/manifest/components/onboarding.json +84 -0
  456. package/manifest/components/otp-field.json +9 -7
  457. package/manifest/components/password-input.json +2 -0
  458. package/manifest/components/permission-grant.json +92 -0
  459. package/manifest/components/permission-scopes.json +139 -0
  460. package/manifest/components/popover.json +1 -1
  461. package/manifest/components/prompt-library.json +99 -0
  462. package/manifest/components/queue-dock.json +110 -0
  463. package/manifest/components/quota-banner.json +94 -0
  464. package/manifest/components/quote-reply.json +105 -0
  465. package/manifest/components/read-aloud.json +111 -0
  466. package/manifest/components/reasoning-effort.json +81 -0
  467. package/manifest/components/reasoning-panel.json +108 -0
  468. package/manifest/components/recommendation-card.json +107 -0
  469. package/manifest/components/regenerate-menu.json +89 -0
  470. package/manifest/components/replay-player.json +102 -0
  471. package/manifest/components/research-report.json +76 -0
  472. package/manifest/components/retrieval-chunks.json +84 -0
  473. package/manifest/components/revert-dock.json +150 -0
  474. package/manifest/components/reviewable-diff.json +93 -0
  475. package/manifest/components/risk-badge.json +74 -0
  476. package/manifest/components/schedule-card.json +101 -0
  477. package/manifest/components/score-breakdown.json +91 -0
  478. package/manifest/components/scroll-anchor.json +72 -0
  479. package/manifest/components/scroll-area.json +7 -7
  480. package/manifest/components/scrub-input.json +2 -0
  481. package/manifest/components/search-input.json +9 -7
  482. package/manifest/components/segmented-control.json +21 -21
  483. package/manifest/components/select.json +1 -0
  484. package/manifest/components/settings-panel.json +118 -0
  485. package/manifest/components/shared-conversation.json +89 -0
  486. package/manifest/components/shimmer-label.json +59 -0
  487. package/manifest/components/skill-icon.json +52 -0
  488. package/manifest/components/sources.json +83 -0
  489. package/manifest/components/speaker-identity.json +61 -0
  490. package/manifest/components/spec-sheet.json +80 -0
  491. package/manifest/components/stack-icon.json +52 -0
  492. package/manifest/components/stacks-matrix-icon.json +52 -0
  493. package/manifest/components/stat.json +1 -1
  494. package/manifest/components/status-bar.json +146 -12
  495. package/manifest/components/status-dot.json +1 -1
  496. package/manifest/components/stopped-run.json +81 -0
  497. package/manifest/components/streaming-text.json +71 -0
  498. package/manifest/components/sub.json +44 -0
  499. package/manifest/components/subagent-list.json +88 -0
  500. package/manifest/components/suggestions.json +84 -0
  501. package/manifest/components/sup.json +44 -0
  502. package/manifest/components/swap-label.json +71 -0
  503. package/manifest/components/table-scroll-region.json +6 -0
  504. package/manifest/components/table.json +88 -4
  505. package/manifest/components/tags-input.json +2 -0
  506. package/manifest/components/tail-status.json +109 -0
  507. package/manifest/components/terminal-block.json +91 -0
  508. package/manifest/components/textarea.json +3 -1
  509. package/manifest/components/theme-provider.json +2 -2
  510. package/manifest/components/thinking-indicator.json +63 -0
  511. package/manifest/components/thread-list.json +76 -0
  512. package/manifest/components/thread-search.json +90 -0
  513. package/manifest/components/threshold-rail.json +2 -2
  514. package/manifest/components/time-boundary.json +62 -0
  515. package/manifest/components/time-field.json +2 -0
  516. package/manifest/components/timeline.json +1 -1
  517. package/manifest/components/title-bar.json +1 -1
  518. package/manifest/components/todo-list.json +69 -0
  519. package/manifest/components/toggle-group.json +9 -7
  520. package/manifest/components/toggle.json +2 -0
  521. package/manifest/components/token-editor.json +1 -1
  522. package/manifest/components/tool-call-card.json +200 -0
  523. package/manifest/components/tool-call.json +119 -0
  524. package/manifest/components/tool-error.json +114 -0
  525. package/manifest/components/tool-group.json +83 -0
  526. package/manifest/components/tool-timeline.json +119 -0
  527. package/manifest/components/toolbar.json +7 -7
  528. package/manifest/components/tooltip.json +1 -1
  529. package/manifest/components/trace-waterfall.json +74 -0
  530. package/manifest/components/turn-footer.json +105 -0
  531. package/manifest/components/typing-indicator.json +53 -0
  532. package/manifest/components/unread-divider.json +55 -0
  533. package/manifest/components/usage-chart.json +1 -1
  534. package/manifest/components/verdict-row.json +91 -0
  535. package/manifest/components/voice-conversation.json +109 -0
  536. package/manifest/components/web-preview.json +87 -0
  537. package/manifest/components/web-search.json +92 -0
  538. package/manifest/components/work-collapse.json +102 -0
  539. package/manifest/manifest.json +2736 -60
  540. package/manifest/tokens.json +22 -1
  541. package/package.json +44 -2
@@ -0,0 +1,251 @@
1
+ "use client";
2
+ import * as React from "react";
3
+ //#region src/agent-runtime/use-agent-thread.ts
4
+ /**
5
+ * The runtime says `assistant`; this library has said `agent` since its first
6
+ * chat component, because a turn here can come from one of a dozen named
7
+ * workers rather than the assistant.
8
+ */
9
+ const ROLES = {
10
+ assistant: "agent",
11
+ system: "system",
12
+ user: "user"
13
+ };
14
+ /** Every text part of a turn, as one block of prose. */
15
+ function joinText(content) {
16
+ return content.flatMap((part) => part.type === "text" ? [part.text] : []).join("\n\n");
17
+ }
18
+ /** Every reasoning part, or nothing at all when the model showed none. */
19
+ function joinReasoning(content) {
20
+ const thoughts = content.flatMap((part) => part.type === "reasoning" ? [part.text] : []);
21
+ return thoughts.length === 0 ? void 0 : thoughts.join("\n\n");
22
+ }
23
+ /**
24
+ * While a call is still streaming, `args` is a partial parse — often `{}` for
25
+ * several frames — and `argsText` is what the model has actually said. Show the
26
+ * parse once there is one, the raw text until then, and nothing invented in
27
+ * either case.
28
+ */
29
+ function formatArgs(part) {
30
+ const args = part.args;
31
+ if (typeof args === "object" && args !== null && Object.keys(args).length > 0) return JSON.stringify(args, null, 2);
32
+ return part.argsText ?? "";
33
+ }
34
+ /** A result as text, whatever the tool returned. Never parsed, never rendered as markup. */
35
+ function formatResult(result) {
36
+ if (result === void 0) return void 0;
37
+ if (typeof result === "string") return result;
38
+ return JSON.stringify(result, null, 2) ?? String(result);
39
+ }
40
+ /**
41
+ * A call has no status of its own until it has an outcome, so until then it
42
+ * borrows the turn's: a call inside a running turn is working, one inside a
43
+ * turn parked on a human is waiting.
44
+ */
45
+ function toolStatus(part, message) {
46
+ if (part.isError === true) return "failed";
47
+ if (part.result !== void 0) return "done";
48
+ switch (message.status?.type) {
49
+ case "running": return "working";
50
+ case "requires-action": return "idle";
51
+ case "incomplete": return "failed";
52
+ default: return "done";
53
+ }
54
+ }
55
+ /** The turn's tool calls, in the order the model made them. */
56
+ function toolCalls(message) {
57
+ return message.content.flatMap((part) => part.type === "tool-call" ? [{
58
+ id: part.toolCallId,
59
+ tool: part.toolName,
60
+ args: formatArgs(part),
61
+ result: formatResult(part.result),
62
+ status: toolStatus(part, message)
63
+ }] : []);
64
+ }
65
+ /** The runtime's status vocabulary, in this library's words. */
66
+ function turnStatus(message) {
67
+ if (message.role !== "assistant") return "complete";
68
+ switch (message.status.type) {
69
+ case "running": return "streaming";
70
+ case "requires-action": return "requires-action";
71
+ case "incomplete": return message.status.reason === "cancelled" ? "cancelled" : "failed";
72
+ default: return "complete";
73
+ }
74
+ }
75
+ /** Where the turn sits among its regenerated siblings. */
76
+ function branchOf(runtime, id) {
77
+ try {
78
+ const state = runtime.thread.getMessageById(id).getState();
79
+ return {
80
+ index: state.branchNumber,
81
+ count: state.branchCount
82
+ };
83
+ } catch {
84
+ return {
85
+ index: 1,
86
+ count: 1
87
+ };
88
+ }
89
+ }
90
+ /** One runtime message, in the props the Chat group takes. */
91
+ function toTurn(runtime, message, agent) {
92
+ const role = ROLES[message.role];
93
+ const status = turnStatus(message);
94
+ return {
95
+ id: message.id,
96
+ role,
97
+ agent: role !== "agent" ? void 0 : typeof agent === "function" ? agent(message) : agent,
98
+ text: joinText(message.content),
99
+ reasoning: joinReasoning(message.content),
100
+ toolCalls: toolCalls(message),
101
+ status,
102
+ pending: status === "streaming",
103
+ createdAt: message.createdAt,
104
+ branch: branchOf(runtime, message.id),
105
+ message
106
+ };
107
+ }
108
+ /**
109
+ * An assistant-ui runtime, read as the props the Chat group already takes.
110
+ *
111
+ * `Message`, `MessageList` and `Composer` render turns that have finished
112
+ * arriving. The hard part of a turn that is *still* arriving — assembling
113
+ * tokens, tracking a run, cancelling one, keeping a regenerated answer beside
114
+ * its sibling — is a solved problem, so this library does not re-derive it. You
115
+ * build a runtime with one line of assistant-ui, typically
116
+ * `useExternalStoreRuntime(adapter)`, and hand the object over; every field
117
+ * that comes back is named for the prop it feeds.
118
+ *
119
+ * It is provider-free by construction: a `useSyncExternalStore` over the
120
+ * runtime's thread, and nothing else. No `AssistantRuntimeProvider`, no
121
+ * primitive, no context and no borrowed DOM — this library renders 100% of what
122
+ * the reader sees, and the peer is only a type in the shipped modules.
123
+ *
124
+ * `MessageList` follows a turn that is still growing on its own: the items
125
+ * container is watched for growth, so a streaming bubble keeps the bottom in
126
+ * view without the host adding anything, while a tool-call card the reader
127
+ * folds away leaves the view where it was.
128
+ *
129
+ * Four things are worth knowing before wiring an `ExternalStoreAdapter` to it:
130
+ *
131
+ * - **Pass `convertMessage`, and keep its identity.** Without it your messages
132
+ * must already be complete runtime messages, and a missing `metadata`
133
+ * throws; `convertMessage: (m) => m` lets the runtime fill the defaults in.
134
+ * Declare it outside the component (or memoise it): the runtime caches the
135
+ * conversion against that function, so a fresh arrow every render re-converts
136
+ * the whole thread, which re-renders, which converts it again — an inline
137
+ * arrow turns the next message change into "Maximum update depth exceeded".
138
+ * - **`onReload` takes two arguments** — `(parentId, config)`. Regenerating a
139
+ * turn re-runs its *parent*, which is what puts the new answer beside the old
140
+ * one rather than after it.
141
+ * - **A branch switch is host-owned.** Under an ExternalStore runtime
142
+ * `switchBranch` does not move the thread: it arrives at the adapter's
143
+ * `setMessages` with the newly visible list, and the host writes it back. A
144
+ * host that ignores `setMessages` gets a picker that does nothing.
145
+ * - **`onStop`, `regenerate` and `switchBranch` are `undefined`** until the
146
+ * matching callback exists on the adapter (`onCancel`, `onReload`,
147
+ * `setMessages`). That is deliberate: `Composer` keeps drawing Send while
148
+ * `onStop` is missing, so a control that cannot work is never drawn.
149
+ *
150
+ * @example
151
+ * // Outside the component: the runtime caches the conversion against this
152
+ * // function, and a new one every render is an update loop.
153
+ * const convertMessage = (m: ThreadMessageLike) => m;
154
+ *
155
+ * const runtime = useExternalStoreRuntime({
156
+ * messages,
157
+ * isRunning,
158
+ * convertMessage,
159
+ * onNew,
160
+ * onCancel,
161
+ * onReload,
162
+ * setMessages,
163
+ * });
164
+ * const thread = useAgentThread(runtime, { agent: "planner" });
165
+ *
166
+ * <MessageList aria-label="Thread">
167
+ * {thread.turns.map((t) => (
168
+ * <Message
169
+ * key={t.id}
170
+ * role={t.role}
171
+ * agent={t.agent}
172
+ * pending={t.pending}
173
+ * footer={
174
+ * t.branch.count > 1 && thread.switchBranch ? (
175
+ * <BranchPicker
176
+ * index={t.branch.index}
177
+ * count={t.branch.count}
178
+ * onNavigate={(d) => thread.switchBranch?.(t.id, d)}
179
+ * disabled={thread.busy}
180
+ * />
181
+ * ) : undefined
182
+ * }
183
+ * >
184
+ * {t.text}
185
+ * {t.toolCalls.map((c) => (
186
+ * <ToolCallCard key={c.id} tool={c.tool} args={c.args} result={c.result} status={c.status} />
187
+ * ))}
188
+ * </Message>
189
+ * ))}
190
+ * </MessageList>
191
+ * <Composer
192
+ * onSend={thread.onSend}
193
+ * busy={thread.busy}
194
+ * disabled={thread.disabled || thread.busy}
195
+ * onStop={thread.onStop}
196
+ * />
197
+ */
198
+ function useAgentThread(runtime, options) {
199
+ const agent = options?.agent;
200
+ const agentRef = React.useRef(agent);
201
+ agentRef.current = agent;
202
+ const agentKey = typeof agent === "function" ? "fn" : agent;
203
+ const subscribe = React.useCallback((onStoreChange) => runtime.thread.subscribe(onStoreChange), [runtime]);
204
+ const getState = React.useCallback(() => runtime.thread.getState(), [runtime]);
205
+ const { capabilities, isDisabled, isRunning, messages } = React.useSyncExternalStore(subscribe, getState, getState);
206
+ const turns = React.useMemo(() => messages.map((message) => toTurn(runtime, message, agentRef.current)), [
207
+ messages,
208
+ runtime,
209
+ agentKey
210
+ ]);
211
+ const onSend = React.useCallback((text) => {
212
+ runtime.thread.append({
213
+ role: "user",
214
+ content: [{
215
+ type: "text",
216
+ text
217
+ }]
218
+ });
219
+ }, [runtime]);
220
+ const cancel = React.useCallback(() => {
221
+ runtime.thread.cancelRun();
222
+ }, [runtime]);
223
+ const reload = React.useCallback((turnId) => {
224
+ runtime.thread.getMessageById(turnId).reload();
225
+ }, [runtime]);
226
+ const switchTo = React.useCallback((turnId, direction) => {
227
+ runtime.thread.getMessageById(turnId).switchToBranch({ position: direction });
228
+ }, [runtime]);
229
+ return React.useMemo(() => ({
230
+ turns,
231
+ busy: isRunning,
232
+ disabled: isDisabled,
233
+ onSend,
234
+ onStop: capabilities.cancel ? cancel : void 0,
235
+ regenerate: capabilities.reload ? reload : void 0,
236
+ switchBranch: capabilities.switchToBranch ? switchTo : void 0,
237
+ runtime
238
+ }), [
239
+ turns,
240
+ isRunning,
241
+ isDisabled,
242
+ capabilities,
243
+ onSend,
244
+ cancel,
245
+ reload,
246
+ switchTo,
247
+ runtime
248
+ ]);
249
+ }
250
+ //#endregion
251
+ export { useAgentThread };
@@ -1,8 +1,8 @@
1
+ import { AskAnswer, AskBox, AskBoxProps, AskDanger, AskKind, AskOption } from "./ask-box.js";
2
+ import { Message, MessageProps, MessageRole } from "./message.js";
1
3
  import { AGENT_COLOR_PROPERTY, AGENT_HUES, AGENT_ROOT_COLOR, AgentColorOptions, agentColor, agentColorStyle } from "./agent-color.js";
2
4
  import { AgentPile, AgentPileEntry, AgentPileProps, AgentPileSize } from "./agent-pile.js";
3
- import { AskAnswer, AskBox, AskBoxProps, AskDanger, AskKind, AskOption } from "./ask-box.js";
4
5
  import { Composer, ComposerProps, ComposerSubmitKey } from "./composer.js";
5
6
  import { DelegationCard, DelegationCardProps, DelegationDirection, DelegationStatus } from "./delegation-card.js";
6
- import { Message, MessageProps, MessageRole } from "./message.js";
7
7
  import { MessageList, MessageListProps } from "./message-list.js";
8
8
  export { AGENT_COLOR_PROPERTY, AGENT_HUES, AGENT_ROOT_COLOR, type AgentColorOptions, AgentPile, type AgentPileEntry, type AgentPileProps, type AgentPileSize, type AskAnswer, AskBox, type AskBoxProps, type AskDanger, type AskKind, type AskOption, Composer, type ComposerProps, type ComposerSubmitKey, DelegationCard, type DelegationCardProps, type DelegationDirection, type DelegationStatus, Message, MessageList, type MessageListProps, type MessageProps, type MessageRole, agentColor, agentColorStyle };
@@ -24,6 +24,12 @@ interface MessageListProps extends Omit<React.ComponentPropsWithoutRef<"div">, "
24
24
  * mid-sentence is the single most common reason people stop reading a chat
25
25
  * pane. Coming back to the bottom re-arms it.
26
26
  *
27
+ * It follows a turn that is still growing, too — the items container is watched
28
+ * for growth, so a streaming bubble keeps the bottom in view without the host
29
+ * adding anything, while something merely collapsing leaves the view alone. And
30
+ * when you have scrolled up, a turn that grows offers the pill instead of
31
+ * pulling you down.
32
+ *
27
33
  * Deliberately **not** virtualised. A virtualiser needs a measurable row height
28
34
  * and chat turns are variable-height by nature; the cost of getting that wrong
29
35
  * (jumping scrollbars) is worse than the cost of a few hundred DOM nodes. When
@@ -19,6 +19,12 @@ const ROOT_PX = 16;
19
19
  * mid-sentence is the single most common reason people stop reading a chat
20
20
  * pane. Coming back to the bottom re-arms it.
21
21
  *
22
+ * It follows a turn that is still growing, too — the items container is watched
23
+ * for growth, so a streaming bubble keeps the bottom in view without the host
24
+ * adding anything, while something merely collapsing leaves the view alone. And
25
+ * when you have scrolled up, a turn that grows offers the pill instead of
26
+ * pulling you down.
27
+ *
22
28
  * Deliberately **not** virtualised. A virtualiser needs a measurable row height
23
29
  * and chat turns are variable-height by nature; the cost of getting that wrong
24
30
  * (jumping scrollbars) is worse than the cost of a few hundred DOM nodes. When
@@ -31,8 +37,10 @@ const ROOT_PX = 16;
31
37
  */
32
38
  const MessageList = React.forwardRef(function MessageList({ className, children, follow = true, height, jumpLabel = "Jump to latest", emptyLabel = "No messages yet", "aria-label": ariaLabel, style, ...elementProps }, ref) {
33
39
  const scrollerRef = React.useRef(null);
40
+ const itemsRef = React.useRef(null);
34
41
  const [pinned, setPinned] = React.useState(true);
35
42
  const [behind, setBehind] = React.useState(false);
43
+ const lastHeightRef = React.useRef(0);
36
44
  const count = React.Children.count(children);
37
45
  const previousCountRef = React.useRef(count);
38
46
  const jumpToLatest = React.useCallback(() => {
@@ -58,6 +66,32 @@ const MessageList = React.forwardRef(function MessageList({ className, children,
58
66
  follow,
59
67
  pinned
60
68
  ]);
69
+ React.useEffect(() => {
70
+ const element = scrollerRef.current;
71
+ const items = itemsRef.current;
72
+ if (items === null) lastHeightRef.current = 0;
73
+ if (element === null || items === null || typeof ResizeObserver === "undefined") return;
74
+ const observer = new ResizeObserver((entries) => {
75
+ const entry = entries[0];
76
+ if (entry === void 0) return;
77
+ const height = entry.contentRect?.height ?? entry.target.getBoundingClientRect().height;
78
+ const grew = height > lastHeightRef.current;
79
+ lastHeightRef.current = height;
80
+ if (!grew) return;
81
+ if (follow && pinned) {
82
+ element.scrollTop = element.scrollHeight;
83
+ setBehind(false);
84
+ return;
85
+ }
86
+ setBehind(true);
87
+ });
88
+ observer.observe(items);
89
+ return () => observer.disconnect();
90
+ }, [
91
+ follow,
92
+ pinned,
93
+ count === 0
94
+ ]);
61
95
  const onScroll = React.useCallback(() => {
62
96
  const element = scrollerRef.current;
63
97
  if (element === null) return;
@@ -88,6 +122,7 @@ const MessageList = React.forwardRef(function MessageList({ className, children,
88
122
  className: "flex h-full items-center justify-center p-(--cue-space-6) font-mono text-(length:--cue-text-ui) text-fg-subtle",
89
123
  children: emptyLabel
90
124
  }) : /* @__PURE__ */ jsx("div", {
125
+ ref: itemsRef,
91
126
  "data-slot": "message-list-items",
92
127
  className: "flex min-w-0 flex-col items-stretch gap-(--cue-space-4) p-(--cue-space-4)",
93
128
  children
@@ -0,0 +1,59 @@
1
+ //#region src/chrome/_drag.ts
2
+ /**
3
+ * The desktop drag contract, in one place because two bars now emit it.
4
+ *
5
+ * A window has exactly one way to be dragged by its chrome, and this library
6
+ * ships into two shells that disagree about what that way is:
7
+ *
8
+ * - **Tauri** listens for `mousedown` and walks the event's `composedPath()`,
9
+ * looking for `data-tauri-drag-region`. The bare form of the attribute means
10
+ * *this element and only this element* — the innermost element under the
11
+ * cursor has to be the attributed one — so a container carrying it does not
12
+ * hand the behaviour to its children. It also excludes anything that reads as
13
+ * a control (`a`, `button`, `input`, `select`, `textarea`, `label`,
14
+ * `summary`, `[contenteditable]`, `[tabindex]`, and the button/link/menuitem
15
+ * ARIA roles) for free, without being asked.
16
+ * - **Electron and Chromium** read the `app-region` CSS property and build a
17
+ * *geometric* hit-test mask from it, below the DOM's pointer-event model
18
+ * entirely: every painted pixel of a `drag` box drags, minus the pixels a
19
+ * `no-drag` box covers. It knows nothing about ancestry and excludes nothing
20
+ * on its own — every interactive descendant has to opt out by name.
21
+ *
22
+ * The two mechanisms fail in opposite directions, so the contract a shared
23
+ * component can honour is the union of both: **attribute every structural
24
+ * surface, carve every interactive cluster.** A bar that only attributes its
25
+ * root is undraggable in Tauri wherever a cell covers the root; a bar that only
26
+ * drags and never carves is a bar whose buttons move the window in Electron.
27
+ *
28
+ * Both spellings of the CSS property are emitted. `app-region` is the current
29
+ * canonical name in Electron's own documentation; `-webkit-app-region` is the
30
+ * legacy alias older Chromium builds still want, and neither shell minds
31
+ * reading a property it already understands twice.
32
+ *
33
+ * These are class strings rather than a `<div>` of their own on purpose: the
34
+ * surfaces that have to carry them — {@link TitleBar}'s root,
35
+ * `AppShell.Bar`'s root, its brand cell, its rest cell — already exist for
36
+ * layout reasons, and wrapping each one in a drag element would put a box in
37
+ * the flex arithmetic that is there for nothing but a CSS property.
38
+ */
39
+ /**
40
+ * Make a painted surface a window drag handle.
41
+ *
42
+ * Pair it with a bare `data-tauri-drag-region` attribute on the same element —
43
+ * the CSS half is Electron's and the attribute half is Tauri's, and an element
44
+ * with only one of them is draggable in only one shell.
45
+ */
46
+ const DRAG_CLASSES = "[app-region:drag] [-webkit-app-region:drag]";
47
+ /**
48
+ * Carve an interactive cluster back out of the surrounding drag region.
49
+ *
50
+ * Required for Electron, where a button that merely overlaps a drag box stops
51
+ * receiving clicks at all; harmless in Tauri, which had already excluded a
52
+ * real `<button>` on its own. Anything custom enough that Tauri's tag/role
53
+ * heuristic would miss it — an icon "button" built from a `<div>`, a bespoke
54
+ * menu trigger — additionally wants `data-tauri-drag-region="false"`, which is
55
+ * the caller's to add on the control itself.
56
+ */
57
+ const NO_DRAG_CLASSES = "[app-region:no-drag] [-webkit-app-region:no-drag]";
58
+ //#endregion
59
+ export { DRAG_CLASSES, NO_DRAG_CLASSES };
@@ -0,0 +1,85 @@
1
+ "use client";
2
+ import { cn } from "../lib/cn.js";
3
+ import { statusBarItemClasses } from "./_status-bar.js";
4
+ import * as React from "react";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ import { useRender } from "@base-ui/react/use-render";
7
+ //#region src/chrome/_status-bar-item.tsx
8
+ /**
9
+ * The elements for which `disabled` is a real HTML attribute.
10
+ *
11
+ * Everything else — an anchor above all — has to be told it is inert some other
12
+ * way. Setting `disabled` on an `<a>` produces a stray attribute the parser
13
+ * keeps and nothing reads: not a validity error, but not a disabled link
14
+ * either, because there is no such thing.
15
+ */
16
+ const DISABLEABLE_TAGS = /* @__PURE__ */ new Set([
17
+ "button",
18
+ "input",
19
+ "select",
20
+ "textarea",
21
+ "fieldset",
22
+ "optgroup"
23
+ ]);
24
+ /**
25
+ * Whether `disabled` can be handed to whatever this renders as.
26
+ *
27
+ * A `render` that is a component rather than an intrinsic tag decides for
28
+ * itself — Base UI's own triggers take a `disabled` prop, and refusing to pass
29
+ * it would break the composition this prop exists for — so only a string tag
30
+ * outside the set above is refused.
31
+ */
32
+ function takesDisabledAttribute(render) {
33
+ if (render === void 0) return true;
34
+ if (!React.isValidElement(render)) return true;
35
+ return typeof render.type !== "string" || DISABLEABLE_TAGS.has(render.type);
36
+ }
37
+ /**
38
+ * A status-bar item that is a real control: a `<button>`, or whatever `render`
39
+ * replaces it with.
40
+ *
41
+ * `type="button"` is supplied only when this renders its own `<button>`. A
42
+ * `render={<a href="…" />}` must not be handed a `type`, which on an anchor is
43
+ * a MIME hint and not a submit-behaviour switch — the same rule
44
+ * {@link IconButton} follows, and for the same reason.
45
+ *
46
+ * `disabled` is honoured on every interactive shape, by two routes. The
47
+ * attribute itself goes only where it means something ({@link DISABLEABLE_TAGS},
48
+ * plus any component `render`, which takes its own `disabled` prop); the state
49
+ * is stated everywhere with `aria-disabled` and `data-disabled`, which is what
50
+ * an anchor gets instead. `data-disabled` is not decoration — it is what greys
51
+ * the item out and lifts it out of the pointer's reach in `_status-bar.ts`,
52
+ * since `:disabled` never matches an `<a>`. The gap this closes was a
53
+ * `render={<button/>} disabled` that shipped enabled, clickable and undimmed.
54
+ */
55
+ const StatusBarInteractiveItem = React.forwardRef(function StatusBarInteractiveItem({ tone, prominence, className, push, icon: Icon, render, disabled, children, elementProps }, ref) {
56
+ const tagProps = {
57
+ ...render === void 0 ? { type: "button" } : {},
58
+ ...disabled === true && takesDisabledAttribute(render) ? { disabled: true } : {},
59
+ ...disabled === true ? {
60
+ "aria-disabled": true,
61
+ "data-disabled": ""
62
+ } : {}
63
+ };
64
+ return useRender({
65
+ render,
66
+ ref,
67
+ defaultTagName: "button",
68
+ props: {
69
+ "data-slot": "status-bar-item",
70
+ ...tagProps,
71
+ ...elementProps,
72
+ className: cn(statusBarItemClasses({
73
+ tone,
74
+ interactive: true,
75
+ prominence
76
+ }), push ? "ml-auto" : void 0, className),
77
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [Icon === void 0 ? null : /* @__PURE__ */ jsx(Icon, {
78
+ "aria-hidden": "true",
79
+ className: "size-icon-sm shrink-0"
80
+ }), children] })
81
+ }
82
+ });
83
+ });
84
+ //#endregion
85
+ export { StatusBarInteractiveItem };
@@ -0,0 +1,15 @@
1
+ import "./status-bar.js";
2
+ //#region src/chrome/_status-bar.d.ts
3
+ /**
4
+ * How loudly a status-bar item states itself.
5
+ *
6
+ * `quiet` is a reading — tone-coloured ink on the bar's own ground, which is
7
+ * what a status bar is for. `filled` is a chip: a full-height tone wash behind
8
+ * tone ink, for the handful of states VS Code reserves its coloured categories
9
+ * for (a warning, an error, the remote you are attached to). It is loud on
10
+ * purpose and it is meant to be rare; a bar of five filled items is a bar
11
+ * nobody reads.
12
+ */
13
+ type StatusBarProminence = "quiet" | "filled";
14
+ //#endregion
15
+ export { StatusBarProminence };
@@ -0,0 +1,171 @@
1
+ import { cn } from "../lib/cn.js";
2
+ //#region src/chrome/_status-bar.ts
3
+ /**
4
+ * The class half of `StatusBar` (see `./status-bar.tsx`).
5
+ *
6
+ * It lives on its own for the same reason `forms/_chassis.ts` does — the item's
7
+ * appearance is a pure function of three enumerated inputs and nothing else —
8
+ * and for one reason `_chassis.ts` does not have: a status bar is two kinds of
9
+ * thing wearing one skin. A static reading is markup, and markup is the whole
10
+ * point of `StatusBar` being renderable from a server component with no
11
+ * JavaScript at all. An *interactive* item is a control, and a control needs
12
+ * the render prop, which needs a hook, which needs `"use client"`. Putting the
13
+ * shared class strings here lets the static half stay static and the
14
+ * interactive half cross the boundary alone (`./_status-bar-item.tsx`), instead
15
+ * of the whole bar crossing it because one of its items might be a button.
16
+ *
17
+ * Everything below is token-backed and enumerated per tone. Nothing is derived
18
+ * at runtime from a tone name, because a class string assembled from a template
19
+ * literal is a class string Tailwind's scanner never sees.
20
+ */
21
+ /** Ink for each tone; `neutral` inherits the bar's own subtle grey. */
22
+ const ITEM_TONES = {
23
+ neutral: "",
24
+ accent: "text-accent",
25
+ ok: "text-ok",
26
+ busy: "text-busy",
27
+ warn: "text-warn",
28
+ danger: "text-danger",
29
+ info: "text-info"
30
+ };
31
+ /**
32
+ * Every item, static or not: one line, never wrapping, never growing the bar.
33
+ *
34
+ * This exact string is what a plain `<StatusBar.Item>` rendered before any of
35
+ * the interactive vocabulary existed, and it still is — the appearance function
36
+ * adds to it and never rewrites it, so a console that upgrades sees the same
37
+ * readouts it had.
38
+ */
39
+ const ITEM_BASE = "inline-flex min-w-0 shrink-0 items-center gap-(--cue-space-2) whitespace-nowrap";
40
+ /**
41
+ * What an item gains when it becomes a real control.
42
+ *
43
+ * The reset first: a `<button>` arrives with a border, a ground, a gutter and a
44
+ * font of the user agent's choosing, and none of them belong in a 24px strip.
45
+ * `text-(length:--cue-text-label)` and `font-mono` are re-declared rather than
46
+ * inherited for the same reason — form controls do not inherit type.
47
+ *
48
+ * `h-full` is the VS Code reading of a status item and the one that makes hover
49
+ * legible: the fill is the height of the bar, not the height of the words, so a
50
+ * pointer anywhere in the strip is over the target rather than beside it.
51
+ *
52
+ * The focus ring is inset (`-outline-offset-1`). An outset ring on a bar this
53
+ * low paints across the item's neighbours and the hairline above them, which
54
+ * reads as the whole bar being focused rather than one reading in it.
55
+ *
56
+ * The disabled treatment is declared twice, once for `:disabled` and once for
57
+ * `[data-disabled]`. An item that a `render` prop turned into an anchor can
58
+ * never match `:disabled` — the pseudo-class is defined on form controls — so
59
+ * without the data twin a disabled link would read as perfectly live.
60
+ */
61
+ const INTERACTIVE_CHASSIS = "h-full cursor-pointer border-0 bg-transparent py-0 font-mono text-(length:--cue-text-label) outline-none transition-colors duration-150 focus-visible:outline-2 focus-visible:outline-solid focus-visible:-outline-offset-1 focus-visible:outline-accent disabled:pointer-events-none disabled:opacity-40 data-[disabled]:pointer-events-none data-[disabled]:opacity-40 motion-reduce:transition-none";
62
+ /**
63
+ * A quiet control's gutter, and the negative margin that pays for it.
64
+ *
65
+ * The bar sets `gap-(--cue-space-4)` between items. Padding an item to give its
66
+ * hover fill somewhere to live would push its text `--cue-space-2` further from
67
+ * its neighbour, so the same length is taken straight back off the margin: the
68
+ * words stay exactly where a static reading's words would be, and the fill
69
+ * bleeds halfway into the gap either side. VS Code does the identical trick
70
+ * with a 5px label padding inside a 3px item margin.
71
+ */
72
+ const QUIET_GEOMETRY = "px-(--cue-space-2) -mx-(--cue-space-2)";
73
+ /**
74
+ * A filled item's gutter. Wider, and with no negative margin at all.
75
+ *
76
+ * A filled item is a chip rather than a reading, and a chip whose ground bleeds
77
+ * into the gap on both sides has no gap left to be a chip in. VS Code makes the
78
+ * same split — its coloured items take the wider 8px padding while a plain one
79
+ * keeps 5px — so this is the next space token up and the margin stays put.
80
+ */
81
+ const FILLED_GEOMETRY = "h-full px-(--cue-space-3)";
82
+ /**
83
+ * The ground a `quiet` control paints, hovered, pressed, and as a member of a
84
+ * hovered {@link STATUS_BAR_GROUP_CLASSES cluster}.
85
+ *
86
+ * Three rungs of one ladder: the bar sits on `surface-1`, a hovered item lifts
87
+ * to `surface-2`, a pressed one to `surface-3`. The cluster rule is the VS Code
88
+ * pairing exactly — hovering any segment grounds every segment at the ordinary
89
+ * hover rung, and the segment actually under the cursor goes one rung further,
90
+ * so a two-item group reads as one control without hiding which half is live.
91
+ * The compound `group-hover/status-group:hover:` outranks the plain `hover:` on
92
+ * specificity rather than on source order, so which of them wins is decided by
93
+ * the cascade and not by how Tailwind happened to sort that day.
94
+ */
95
+ const QUIET_GROUNDS = "hover:bg-surface-2 active:bg-surface-3 group-hover/status-group:bg-surface-2 group-hover/status-group:hover:bg-surface-3";
96
+ /**
97
+ * The fill a `filled` item paints, per tone.
98
+ *
99
+ * `bg-<tone>/10` is the tinted-`Chip` recipe, deliberately: "warn" has to be
100
+ * the same wash in the status bar that it is on the chip that raised it. The
101
+ * derived `--cue-<tone>-soft` properties are not used here because only
102
+ * `accent-soft` is bridged into Tailwind's colour namespace — `bg-warn-soft`
103
+ * compiles to nothing at all — while the alpha modifier reaches every tone and
104
+ * lands on the same 10–12% wash the token was derived at.
105
+ */
106
+ const FILLED_TONES = {
107
+ neutral: "bg-surface-2 text-fg",
108
+ accent: "bg-accent/10",
109
+ ok: "bg-ok/10",
110
+ busy: "bg-busy/10",
111
+ warn: "bg-warn/10",
112
+ danger: "bg-danger/10",
113
+ info: "bg-info/10"
114
+ };
115
+ /**
116
+ * Where a filled control's fill steps to under the pointer, per tone.
117
+ *
118
+ * The tint deepens rather than being swapped for a grey: a warning that turns
119
+ * neutral on hover has stopped warning at the exact moment somebody reached for
120
+ * it. `/20` is `Chip`'s own interactive step, and `/30` is one further for the
121
+ * press. Neutral has only the surface ladder to climb and its top rung is
122
+ * `surface-3`, so hover and press share it.
123
+ */
124
+ const FILLED_GROUNDS = {
125
+ neutral: "hover:bg-surface-3 active:bg-surface-3",
126
+ accent: "hover:bg-accent/20 active:bg-accent/30",
127
+ ok: "hover:bg-ok/20 active:bg-ok/30",
128
+ busy: "hover:bg-busy/20 active:bg-busy/30",
129
+ warn: "hover:bg-warn/20 active:bg-warn/30",
130
+ danger: "hover:bg-danger/20 active:bg-danger/30",
131
+ info: "hover:bg-info/20 active:bg-info/30"
132
+ };
133
+ /**
134
+ * The compact-adjacency cluster: children one pixel apart, whatever the bar's
135
+ * own gap is.
136
+ *
137
+ * `gap-px` is the seam. `*:mx-0` is what makes the seam survive an interactive
138
+ * member, whose `-mx-(--cue-space-2)` would otherwise pull its neighbours a
139
+ * whole space token *over* it — the negative margin exists to bleed a lone
140
+ * item's fill into the bar's gap, and inside a cluster there is no gap to bleed
141
+ * into. It lands on the group because that is where the decision is: these are
142
+ * segments of one control, not readings that happen to be adjacent.
143
+ *
144
+ * `group/status-group` is the handle the members' cluster-hover rules read, and
145
+ * it is left on the element whether or not any member is interactive so a
146
+ * consumer can hang `group-hover/status-group:` rules of their own on it.
147
+ */
148
+ const STATUS_BAR_GROUP_CLASSES = "group/status-group flex h-full min-w-0 shrink-0 items-center gap-px *:mx-0";
149
+ /**
150
+ * Every class a status-bar item wears, from the three things that vary.
151
+ *
152
+ * One function rather than a class per shape, because the shapes multiply:
153
+ * seven tones times two prominences times interactive-or-not is 28 items, and
154
+ * 28 hand-written strings drift. Ordering is load-bearing — the merge is
155
+ * last-one-wins, so the reset comes before the gutter that overrides it and the
156
+ * tone comes after the `text-inherit` that would otherwise flatten it.
157
+ *
158
+ * @param appearance - Tone, interactivity and prominence; every field optional.
159
+ * @returns The merged class string, with no duplicate or cancelled utilities.
160
+ * @example
161
+ * statusBarItemClasses({}) // exactly the static item's own chassis
162
+ * @example
163
+ * statusBarItemClasses({ tone: "danger", interactive: true, prominence: "filled" })
164
+ */
165
+ function statusBarItemClasses(appearance) {
166
+ const { tone = "neutral", interactive = false, prominence = "quiet" } = appearance;
167
+ const filled = prominence === "filled";
168
+ return cn(ITEM_BASE, interactive ? INTERACTIVE_CHASSIS : void 0, interactive && tone === "neutral" ? "text-inherit" : void 0, interactive && !filled ? QUIET_GEOMETRY : void 0, filled ? FILLED_GEOMETRY : void 0, ITEM_TONES[tone], filled ? FILLED_TONES[tone] : void 0, interactive && !filled ? QUIET_GROUNDS : void 0, interactive && filled ? FILLED_GROUNDS[tone] : void 0);
169
+ }
170
+ //#endregion
171
+ export { ITEM_BASE, STATUS_BAR_GROUP_CLASSES, statusBarItemClasses };