@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,74 @@
1
+ "use client";
2
+ import { cn } from "../lib/cn.js";
3
+ import { mono } from "./surfaces.js";
4
+ import { pct, progressOf } from "./range.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { CheckIcon, Loader2Icon } from "lucide-react";
7
+ //#region src/elements/agent-plan.tsx
8
+ /**
9
+ * A checklist the agent works through, with progress you can glance.
10
+ *
11
+ * @example
12
+ * import { AgentPlan } from "@cueplusplus/ui/elements";
13
+ *
14
+ * <AgentPlan
15
+ * steps={["Read the file", "Draft the fix", "Run tests"]}
16
+ * activeIndex={1}
17
+ * />
18
+ */
19
+ function AgentPlan({ steps, activeIndex, className, ...props }) {
20
+ const total = steps.length;
21
+ const completed = progressOf(activeIndex, total);
22
+ const allDone = completed >= total;
23
+ const progress = pct(completed, total);
24
+ return /* @__PURE__ */ jsxs("div", {
25
+ "data-slot": "agent-plan",
26
+ className: cn("flex w-full max-w-sm flex-col gap-3", className),
27
+ ...props,
28
+ children: [
29
+ /* @__PURE__ */ jsxs("div", {
30
+ className: "flex items-center justify-between",
31
+ children: [/* @__PURE__ */ jsx("span", {
32
+ className: "text-(length:--cue-text-body) font-medium",
33
+ children: "Plan"
34
+ }), /* @__PURE__ */ jsxs("span", {
35
+ className: cn(mono, "text-fg-subtle tabular-nums"),
36
+ children: [
37
+ completed,
38
+ " of ",
39
+ total
40
+ ]
41
+ })]
42
+ }),
43
+ /* @__PURE__ */ jsx("div", {
44
+ className: "bg-surface-2 h-[3px] w-full overflow-hidden rounded-full",
45
+ children: /* @__PURE__ */ jsx("span", {
46
+ className: "bg-accent block h-full rounded-full transition-[width] duration-500",
47
+ style: { width: `${progress}%` }
48
+ })
49
+ }),
50
+ /* @__PURE__ */ jsx("ul", {
51
+ className: "flex flex-col gap-2.5",
52
+ children: steps.map((step, i) => {
53
+ const done = allDone || i < completed;
54
+ const active = !allDone && i === completed;
55
+ return /* @__PURE__ */ jsxs("li", {
56
+ className: "flex items-center gap-2.5 text-(length:--cue-text-body)",
57
+ children: [/* @__PURE__ */ jsx("span", {
58
+ className: "flex size-4 shrink-0 items-center justify-center",
59
+ children: done ? /* @__PURE__ */ jsx(CheckIcon, { className: "text-fg-subtle size-3.5" }) : active ? /* @__PURE__ */ jsx(Loader2Icon, { className: "text-fg size-3.5 animate-spin motion-reduce:animate-none" }) : /* @__PURE__ */ jsx("span", {
60
+ "aria-hidden": true,
61
+ className: "bg-surface-3 size-1.5 rounded-full"
62
+ })
63
+ }), /* @__PURE__ */ jsx("span", {
64
+ className: cn(done && "text-fg-subtle", active && "text-fg", !done && !active && "text-fg-subtle"),
65
+ children: step
66
+ })]
67
+ }, step);
68
+ })
69
+ })
70
+ ]
71
+ });
72
+ }
73
+ //#endregion
74
+ export { AgentPlan };
@@ -0,0 +1,29 @@
1
+ import { ComponentProps } from "react";
2
+ //#region src/elements/agent-status.d.ts
3
+ /** What the agent is doing: `working`, `waiting` on the user, or `done`. */
4
+ type AgentState = "working" | "waiting" | "done";
5
+ /** One step of an agent's run, for a surface that lists them rather than showing the last. */
6
+ interface StatusStep {
7
+ /** The step's own state, drawn as its glyph. */
8
+ state: AgentState;
9
+ /** What the step says. */
10
+ label: string;
11
+ }
12
+ /**
13
+ * One pill that always answers: what is it doing, and for how long.
14
+ *
15
+ * @example
16
+ * import { AgentStatus } from "@cueplusplus/ui/elements";
17
+ *
18
+ * <AgentStatus state="working" label="Editing composer.tsx" elapsed="8s" />
19
+ */
20
+ declare function AgentStatus({ state, label, elapsed, className, ...props }: Omit<ComponentProps<"div">, "children" | "state" | "label" | "elapsed"> & {
21
+ /** Visual mode of the pill: working, waiting, or done with a check. */
22
+ state: AgentState;
23
+ /** Short status line describing what the agent is doing. */
24
+ label: string;
25
+ /** Elapsed time shown in mono when provided. */
26
+ elapsed?: string;
27
+ }): import("react").JSX.Element;
28
+ //#endregion
29
+ export { AgentState, AgentStatus, StatusStep };
@@ -0,0 +1,46 @@
1
+ "use client";
2
+ import { cn } from "../lib/cn.js";
3
+ import { ghostButton, paper } from "./surfaces.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { CheckIcon, PauseIcon, RotateCcwIcon } from "lucide-react";
6
+ //#region src/elements/agent-status.tsx
7
+ /**
8
+ * One pill that always answers: what is it doing, and for how long.
9
+ *
10
+ * @example
11
+ * import { AgentStatus } from "@cueplusplus/ui/elements";
12
+ *
13
+ * <AgentStatus state="working" label="Editing composer.tsx" elapsed="8s" />
14
+ */
15
+ function AgentStatus({ state, label, elapsed, className, ...props }) {
16
+ return /* @__PURE__ */ jsxs("div", {
17
+ "data-slot": "agent-status",
18
+ className: cn(paper, "flex items-center gap-2.5 rounded-full py-1.5 ps-3.5 pe-1.5", className),
19
+ ...props,
20
+ children: [
21
+ state === "done" ? /* @__PURE__ */ jsx(CheckIcon, {
22
+ "aria-hidden": true,
23
+ className: "size-3 shrink-0 text-ok"
24
+ }) : /* @__PURE__ */ jsx("span", {
25
+ "aria-hidden": true,
26
+ className: cn("size-1.5 shrink-0 rounded-full motion-reduce:animate-none", state === "working" ? "animate-pulse bg-stream" : "bg-surface-3 animate-pulse")
27
+ }),
28
+ /* @__PURE__ */ jsx("span", {
29
+ className: "cue-elements-fade-in cue-elements-blur-in-2 cue-elements-animate-in max-w-44 truncate text-(length:--cue-text-ui) duration-300 motion-reduce:animate-none",
30
+ children: label
31
+ }, label),
32
+ elapsed !== void 0 && state !== "done" && /* @__PURE__ */ jsx("span", {
33
+ className: cn("font-mono text-(length:--cue-text-label) tracking-tight", "text-fg-subtle tabular-nums"),
34
+ children: elapsed
35
+ }),
36
+ /* @__PURE__ */ jsx("button", {
37
+ type: "button",
38
+ "aria-label": state === "done" ? "Run again" : "Pause agent",
39
+ className: cn(ghostButton, "size-6"),
40
+ children: state === "done" ? /* @__PURE__ */ jsx(RotateCcwIcon, { className: "size-3" }) : /* @__PURE__ */ jsx(PauseIcon, { className: "size-3" })
41
+ })
42
+ ]
43
+ });
44
+ }
45
+ //#endregion
46
+ export { AgentStatus };
@@ -0,0 +1,65 @@
1
+ import { AgentFidelity, AgentSkin } from "../system/agent-skin.js";
2
+ import * as React from "react";
3
+ import { useRender } from "@base-ui/react/use-render";
4
+ //#region src/elements/agent-surface.d.ts
5
+ interface AgentSurfaceProps extends Omit<React.ComponentPropsWithoutRef<"div">, "children"> {
6
+ /**
7
+ * Which value-set paints the subtree: `cue` (the default) or `aui`, which
8
+ * installs assistant-ui's own inks, grounds and hues.
9
+ */
10
+ skin?: AgentSkin;
11
+ /**
12
+ * How much a supersede island re-points: `cue-metrics` (the default, colour
13
+ * only) or `upstream`, which also pins assistant-ui's radii, literal type
14
+ * sizes and spacing so the density ladder stops at the island edge.
15
+ */
16
+ fidelity?: AgentFidelity;
17
+ /**
18
+ * Replace the rendered element (Base UI render prop). Accepts an element —
19
+ * `render={<section />}` — or a function returning one.
20
+ */
21
+ render?: useRender.RenderProp;
22
+ /** The subtree that paints with this island's values. */
23
+ children?: React.ReactNode;
24
+ }
25
+ /**
26
+ * The supersede island: one subtree, painted by a different set of values.
27
+ *
28
+ * Renders a plain `<div data-slot="agent-surface" data-cue-skin="…"
29
+ * data-cue-fidelity="…">` and publishes the same pair on React context. The attributes do the work —
30
+ * `@cueplusplus/ui/elements.css` re-declares, under them, the `--cue-*` tokens
31
+ * the whole elements family reads, and custom properties inherit, so every
32
+ * element inside repaints with no prop threading and no branch in any
33
+ * component. The context exists for the one place that cannot see the DOM: an
34
+ * overlay portaled to `<body>` from inside the island, which
35
+ * {@link useCuePortalProps} stamps from the same values.
36
+ *
37
+ * Two things this is not. It is not a theme — `data-theme`, `data-mode` and
38
+ * `data-density` are untouched, and a light app keeps a light island. And it is
39
+ * not needed for cue mode: the elements were rewritten onto cue's tokens by the
40
+ * vendoring codemod, so `skin="cue"` is what they already do. Reach for this to
41
+ * show an element the way assistant-ui drew it, or to hand a chat panel back to
42
+ * upstream's design language inside a console that is otherwise cue's.
43
+ *
44
+ * What an `aui` island re-points is this family's own vocabulary rather than the
45
+ * whole token contract: `--cue-busy`, `--cue-info`, `--cue-selection`,
46
+ * `--cue-focus`, `--cue-scrim` and every derived `*-soft` / `*-border` stay on
47
+ * the console's theme. Nothing in the elements group reads them, so the island
48
+ * is complete for what it is for — but a *cue* component placed inside one (a
49
+ * `Chip tone="busy"`, a `Toast`) paints half in each palette, and the
50
+ * derivations cannot be made to follow at all: they are `color-mix()` values
51
+ * resolved on the theme block and inherited as answers. `elements.css` carries
52
+ * the full accounting beside the values themselves.
53
+ *
54
+ * `elements.css` is a consumer import: `@import "@cueplusplus/ui/elements.css";`
55
+ * after the main stylesheet. Without it a `skin="aui"` island simply stays in
56
+ * cue's palette.
57
+ *
58
+ * @example
59
+ * <AgentSurface skin="aui" fidelity="upstream">
60
+ * <ToolCall label="Searched" activeLabel="Searching" query="composer" … />
61
+ * </AgentSurface>
62
+ */
63
+ declare const AgentSurface: React.ForwardRefExoticComponent<AgentSurfaceProps & React.RefAttributes<HTMLDivElement>>;
64
+ //#endregion
65
+ export { AgentSurface, AgentSurfaceProps };
@@ -0,0 +1,68 @@
1
+ "use client";
2
+ import { AgentSkinContext } from "../system/agent-skin.js";
3
+ import * as React from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { useRender } from "@base-ui/react/use-render";
6
+ //#region src/elements/agent-surface.tsx
7
+ /**
8
+ * The supersede island: one subtree, painted by a different set of values.
9
+ *
10
+ * Renders a plain `<div data-slot="agent-surface" data-cue-skin="…"
11
+ * data-cue-fidelity="…">` and publishes the same pair on React context. The attributes do the work —
12
+ * `@cueplusplus/ui/elements.css` re-declares, under them, the `--cue-*` tokens
13
+ * the whole elements family reads, and custom properties inherit, so every
14
+ * element inside repaints with no prop threading and no branch in any
15
+ * component. The context exists for the one place that cannot see the DOM: an
16
+ * overlay portaled to `<body>` from inside the island, which
17
+ * {@link useCuePortalProps} stamps from the same values.
18
+ *
19
+ * Two things this is not. It is not a theme — `data-theme`, `data-mode` and
20
+ * `data-density` are untouched, and a light app keeps a light island. And it is
21
+ * not needed for cue mode: the elements were rewritten onto cue's tokens by the
22
+ * vendoring codemod, so `skin="cue"` is what they already do. Reach for this to
23
+ * show an element the way assistant-ui drew it, or to hand a chat panel back to
24
+ * upstream's design language inside a console that is otherwise cue's.
25
+ *
26
+ * What an `aui` island re-points is this family's own vocabulary rather than the
27
+ * whole token contract: `--cue-busy`, `--cue-info`, `--cue-selection`,
28
+ * `--cue-focus`, `--cue-scrim` and every derived `*-soft` / `*-border` stay on
29
+ * the console's theme. Nothing in the elements group reads them, so the island
30
+ * is complete for what it is for — but a *cue* component placed inside one (a
31
+ * `Chip tone="busy"`, a `Toast`) paints half in each palette, and the
32
+ * derivations cannot be made to follow at all: they are `color-mix()` values
33
+ * resolved on the theme block and inherited as answers. `elements.css` carries
34
+ * the full accounting beside the values themselves.
35
+ *
36
+ * `elements.css` is a consumer import: `@import "@cueplusplus/ui/elements.css";`
37
+ * after the main stylesheet. Without it a `skin="aui"` island simply stays in
38
+ * cue's palette.
39
+ *
40
+ * @example
41
+ * <AgentSurface skin="aui" fidelity="upstream">
42
+ * <ToolCall label="Searched" activeLabel="Searching" query="composer" … />
43
+ * </AgentSurface>
44
+ */
45
+ const AgentSurface = React.forwardRef(function AgentSurface({ skin = "cue", fidelity = "cue-metrics", render, children, ...elementProps }, ref) {
46
+ const island = React.useMemo(() => ({
47
+ skin,
48
+ fidelity
49
+ }), [skin, fidelity]);
50
+ const element = useRender({
51
+ render,
52
+ ref,
53
+ defaultTagName: "div",
54
+ props: {
55
+ ...elementProps,
56
+ "data-slot": "agent-surface",
57
+ "data-cue-skin": skin,
58
+ "data-cue-fidelity": fidelity,
59
+ children
60
+ }
61
+ });
62
+ return /* @__PURE__ */ jsx(AgentSkinContext.Provider, {
63
+ value: island,
64
+ children: element
65
+ });
66
+ });
67
+ //#endregion
68
+ export { AgentSurface };
@@ -0,0 +1,86 @@
1
+ import * as React from "react";
2
+ //#region src/elements/animated-number.d.ts
3
+ /**
4
+ * A count in the shape a status line writes it: `842`, `1.2k`, `3.4M`.
5
+ *
6
+ * The reference's own rule — `value < 1000 ? value : (value / 1000).toFixed(1)
7
+ * + "k"` — with two extensions it needs to survive real data: a million rung,
8
+ * because a context window is now measured in them, and a sign, because a
9
+ * delta is a number too. One decimal at every rung above the first, so the
10
+ * width of the string stops changing once it is short.
11
+ *
12
+ * Anything that is not a finite number is `0`: this formats a caller's
13
+ * arithmetic, and a division that has not happened yet is a real state.
14
+ *
15
+ * @param value The number to write.
16
+ * @returns The compact form, without a unit — `tokens` is the caller's word.
17
+ * @example
18
+ * formatCompactNumber(842); // "842"
19
+ * formatCompactNumber(1240); // "1.2k"
20
+ * formatCompactNumber(3_400_000); // "3.4M"
21
+ */
22
+ declare function formatCompactNumber(value: number): string;
23
+ interface AnimatedNumberProps extends Omit<React.ComponentPropsWithoutRef<"span">, "children"> {
24
+ /**
25
+ * The number to show. Every change eases from whatever is on screen to this,
26
+ * including a change that arrives mid-tween — which is the case a live
27
+ * counter is actually made of.
28
+ *
29
+ * A non-finite value paints `0` rather than the word `NaN`: these arrive from
30
+ * a caller's arithmetic over a stream that may not have started.
31
+ */
32
+ value: number;
33
+ /**
34
+ * How long one tween lasts, in milliseconds. Defaults to `400` — long enough
35
+ * to read as counting, short enough that a counter updated every second is
36
+ * never behind the run it is describing. `0` steps.
37
+ */
38
+ duration?: number;
39
+ /**
40
+ * How to write the number. Defaults to grouped digits in `en-US`
41
+ * (`1,240`), which is deterministic across a server render and a client one;
42
+ * {@link formatCompactNumber} is the other one this family uses (`1.2k`).
43
+ *
44
+ * Called on every frame, so keep it cheap.
45
+ */
46
+ format?: (value: number) => string;
47
+ }
48
+ /**
49
+ * A number that counts to its new value instead of jumping to it.
50
+ *
51
+ * The smallest element in the canon and the one that touches the most rows: a
52
+ * token count, a cost, a duration, a file tally. Two rules, both from the same
53
+ * teardown. Tween, because a value that steps reads as a new fact while a value
54
+ * that counts reads as the same fact moving — and a transcript's numbers are
55
+ * almost always the second thing. And `tabular-nums`, because a proportional
56
+ * `1` is narrower than a `0`, so a stepping counter nudges everything to its
57
+ * right on every update.
58
+ *
59
+ * It holds the only state in the canon, and it is a tween rather than a fact:
60
+ * `value` is still a prop, every tween ends exactly on it, and a replay that
61
+ * sets the prop paints the same number at every frame it rests on.
62
+ *
63
+ * **Reduced motion is answered by arriving, not by stopping.** A reader who has
64
+ * asked for stillness gets the value immediately and no frames are ever
65
+ * scheduled — the number is information, and the animation was only ever how it
66
+ * got there.
67
+ *
68
+ * While a tween is in flight the digits on screen are `aria-hidden` and the
69
+ * settled value is carried beside them for a screen reader, so an assistive
70
+ * technology reads the number the run actually reported rather than whichever
71
+ * frame it happened to land on. Once the tween ends there is one node again and
72
+ * nothing is duplicated.
73
+ *
74
+ * @example
75
+ * import { AnimatedNumber } from "@cueplusplus/ui/elements";
76
+ *
77
+ * <AnimatedNumber value={tokens} />
78
+ * @example
79
+ * // The reference's own readout: compact, inline, in the status line.
80
+ * <span className="text-fg-muted">
81
+ * · <AnimatedNumber value={tokens} format={formatCompactNumber} /> tokens
82
+ * </span>
83
+ */
84
+ declare const AnimatedNumber: React.ForwardRefExoticComponent<AnimatedNumberProps & React.RefAttributes<HTMLSpanElement>>;
85
+ //#endregion
86
+ export { AnimatedNumber, AnimatedNumberProps, formatCompactNumber };
@@ -0,0 +1,118 @@
1
+ "use client";
2
+ import { cn } from "../lib/cn.js";
3
+ import { usePrefersReducedMotion } from "../instruments/_motion.js";
4
+ import * as React from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/elements/animated-number.tsx
7
+ /**
8
+ * A count in the shape a status line writes it: `842`, `1.2k`, `3.4M`.
9
+ *
10
+ * The reference's own rule — `value < 1000 ? value : (value / 1000).toFixed(1)
11
+ * + "k"` — with two extensions it needs to survive real data: a million rung,
12
+ * because a context window is now measured in them, and a sign, because a
13
+ * delta is a number too. One decimal at every rung above the first, so the
14
+ * width of the string stops changing once it is short.
15
+ *
16
+ * Anything that is not a finite number is `0`: this formats a caller's
17
+ * arithmetic, and a division that has not happened yet is a real state.
18
+ *
19
+ * @param value The number to write.
20
+ * @returns The compact form, without a unit — `tokens` is the caller's word.
21
+ * @example
22
+ * formatCompactNumber(842); // "842"
23
+ * formatCompactNumber(1240); // "1.2k"
24
+ * formatCompactNumber(3_400_000); // "3.4M"
25
+ */
26
+ function formatCompactNumber(value) {
27
+ if (!Number.isFinite(value)) return "0";
28
+ const sign = value < 0 ? "-" : "";
29
+ const size = Math.abs(value);
30
+ if (size < 1e3) return `${sign}${Math.round(size)}`;
31
+ if (size < 1e6) return `${sign}${(size / 1e3).toFixed(1)}k`;
32
+ return `${sign}${(size / 1e6).toFixed(1)}M`;
33
+ }
34
+ /** Grouped digits, in a fixed locale so a server and a client agree. */
35
+ const GROUPED = (value) => value.toLocaleString("en-US");
36
+ /**
37
+ * A number that counts to its new value instead of jumping to it.
38
+ *
39
+ * The smallest element in the canon and the one that touches the most rows: a
40
+ * token count, a cost, a duration, a file tally. Two rules, both from the same
41
+ * teardown. Tween, because a value that steps reads as a new fact while a value
42
+ * that counts reads as the same fact moving — and a transcript's numbers are
43
+ * almost always the second thing. And `tabular-nums`, because a proportional
44
+ * `1` is narrower than a `0`, so a stepping counter nudges everything to its
45
+ * right on every update.
46
+ *
47
+ * It holds the only state in the canon, and it is a tween rather than a fact:
48
+ * `value` is still a prop, every tween ends exactly on it, and a replay that
49
+ * sets the prop paints the same number at every frame it rests on.
50
+ *
51
+ * **Reduced motion is answered by arriving, not by stopping.** A reader who has
52
+ * asked for stillness gets the value immediately and no frames are ever
53
+ * scheduled — the number is information, and the animation was only ever how it
54
+ * got there.
55
+ *
56
+ * While a tween is in flight the digits on screen are `aria-hidden` and the
57
+ * settled value is carried beside them for a screen reader, so an assistive
58
+ * technology reads the number the run actually reported rather than whichever
59
+ * frame it happened to land on. Once the tween ends there is one node again and
60
+ * nothing is duplicated.
61
+ *
62
+ * @example
63
+ * import { AnimatedNumber } from "@cueplusplus/ui/elements";
64
+ *
65
+ * <AnimatedNumber value={tokens} />
66
+ * @example
67
+ * // The reference's own readout: compact, inline, in the status line.
68
+ * <span className="text-fg-muted">
69
+ * · <AnimatedNumber value={tokens} format={formatCompactNumber} /> tokens
70
+ * </span>
71
+ */
72
+ const AnimatedNumber = React.forwardRef(function AnimatedNumber({ value, duration = 400, format = GROUPED, className, ...elementProps }, ref) {
73
+ const target = Number.isFinite(value) ? value : 0;
74
+ const reduced = usePrefersReducedMotion();
75
+ const [shown, setShown] = React.useState(target);
76
+ const painted = React.useRef(target);
77
+ React.useEffect(() => {
78
+ const from = painted.current;
79
+ if (from === target) return;
80
+ if (reduced || duration <= 0 || typeof requestAnimationFrame !== "function") {
81
+ painted.current = target;
82
+ setShown(target);
83
+ return;
84
+ }
85
+ let origin = -1;
86
+ let frameId = requestAnimationFrame(function tick(at) {
87
+ if (origin < 0) origin = at;
88
+ const through = Math.min(1, (at - origin) / duration);
89
+ const next = through >= 1 ? target : Math.floor(from + (target - from) * through);
90
+ painted.current = next;
91
+ setShown(next);
92
+ if (through >= 1) return;
93
+ frameId = requestAnimationFrame(tick);
94
+ });
95
+ return () => cancelAnimationFrame(frameId);
96
+ }, [
97
+ duration,
98
+ reduced,
99
+ target
100
+ ]);
101
+ const tweening = shown !== target;
102
+ return /* @__PURE__ */ jsxs("span", {
103
+ ref,
104
+ "data-slot": "animated-number",
105
+ "data-tweening": String(tweening),
106
+ className: cn("tabular-nums", className),
107
+ ...elementProps,
108
+ children: [/* @__PURE__ */ jsx("span", {
109
+ "aria-hidden": tweening || void 0,
110
+ children: format(shown)
111
+ }), tweening ? /* @__PURE__ */ jsx("span", {
112
+ className: "sr-only",
113
+ children: format(target)
114
+ }) : null]
115
+ });
116
+ });
117
+ //#endregion
118
+ export { AnimatedNumber, formatCompactNumber };
@@ -0,0 +1,40 @@
1
+ import { ComponentProps } from "react";
2
+ //#region src/elements/approval-card.d.ts
3
+ /**
4
+ * Where an approval has got to: `request` while it waits on the user, then `running`,
5
+ * `done` or `denied`.
6
+ */
7
+ type ApprovalState = "request" | "running" | "done" | "denied";
8
+ /**
9
+ * Human in the loop: the agent asks before it runs anything with side effects.
10
+ *
11
+ * @example
12
+ * import { ApprovalCard } from "@cueplusplus/ui/elements";
13
+ *
14
+ * <ApprovalCard
15
+ * state="request"
16
+ * command="pnpm db:migrate"
17
+ * title="Run migration"
18
+ * subtitle="Needs your approval"
19
+ * onAllowOnce={() => approve()}
20
+ * onDeny={() => deny()}
21
+ * />
22
+ */
23
+ declare function ApprovalCard({ state, command, title, subtitle, onAllowOnce, onAlwaysAllow, onDeny, className, ...props }: Omit<ComponentProps<"div">, "children" | "state" | "command" | "title" | "subtitle" | "onAllowOnce" | "onAlwaysAllow" | "onDeny"> & {
24
+ /** Lifecycle of the card: request with actions, running spinner, done check, or denied. */
25
+ state: ApprovalState;
26
+ /** Command shown in the mono field the agent wants to run. */
27
+ command: string;
28
+ /** Headline naming the action that needs approval. */
29
+ title: string;
30
+ /** Supporting line under the title explaining the request. */
31
+ subtitle: string;
32
+ /** Called when the user clicks Allow once. */
33
+ onAllowOnce?: () => void;
34
+ /** Called when the user clicks Always allow. */
35
+ onAlwaysAllow?: () => void;
36
+ /** Called when the user clicks Deny. */
37
+ onDeny?: () => void;
38
+ }): import("react").JSX.Element;
39
+ //#endregion
40
+ export { ApprovalCard, ApprovalState };
@@ -0,0 +1,78 @@
1
+ "use client";
2
+ import { cn } from "../lib/cn.js";
3
+ import { field, inkButton, paper } from "./surfaces.js";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ import { CheckIcon, Loader2Icon, TerminalIcon, XIcon } from "lucide-react";
6
+ //#region src/elements/approval-card.tsx
7
+ /**
8
+ * Human in the loop: the agent asks before it runs anything with side effects.
9
+ *
10
+ * @example
11
+ * import { ApprovalCard } from "@cueplusplus/ui/elements";
12
+ *
13
+ * <ApprovalCard
14
+ * state="request"
15
+ * command="pnpm db:migrate"
16
+ * title="Run migration"
17
+ * subtitle="Needs your approval"
18
+ * onAllowOnce={() => approve()}
19
+ * onDeny={() => deny()}
20
+ * />
21
+ */
22
+ function ApprovalCard({ state, command, title, subtitle, onAllowOnce, onAlwaysAllow, onDeny, className, ...props }) {
23
+ return /* @__PURE__ */ jsxs("div", {
24
+ "data-slot": "approval-card",
25
+ className: cn(paper, "flex w-full max-w-sm flex-col gap-3.5 rounded-(--radius-overlay) p-4", className),
26
+ ...props,
27
+ children: [
28
+ /* @__PURE__ */ jsxs("div", {
29
+ className: "flex items-center gap-3",
30
+ children: [/* @__PURE__ */ jsx("span", {
31
+ className: "bg-surface-1 text-fg-muted flex size-9 shrink-0 items-center justify-center rounded-(--radius-surface)",
32
+ children: /* @__PURE__ */ jsx(TerminalIcon, { className: "size-4" })
33
+ }), /* @__PURE__ */ jsxs("div", {
34
+ className: "flex flex-col",
35
+ children: [/* @__PURE__ */ jsx("p", {
36
+ className: "text-(length:--cue-text-body) font-medium",
37
+ children: title
38
+ }), /* @__PURE__ */ jsx("p", {
39
+ className: "text-fg-muted text-(length:--cue-text-ui)",
40
+ children: subtitle
41
+ })]
42
+ })]
43
+ }),
44
+ /* @__PURE__ */ jsx("div", {
45
+ className: cn(field, "text-fg-muted rounded-(--radius-surface) px-3.5 py-2.5 font-mono text-(length:--cue-text-ui)"),
46
+ children: command
47
+ }),
48
+ /* @__PURE__ */ jsx("div", {
49
+ className: "flex h-8 items-center justify-end gap-2",
50
+ children: state === "request" ? /* @__PURE__ */ jsxs(Fragment, { children: [
51
+ /* @__PURE__ */ jsx("button", {
52
+ type: "button",
53
+ onClick: onDeny,
54
+ className: "text-fg-muted hover:bg-surface-2 hover:text-fg h-8 rounded-full px-3.5 text-(length:--cue-text-ui) font-medium transition-[background-color,color,scale] duration-150 active:scale-[0.96]",
55
+ children: "Deny"
56
+ }),
57
+ /* @__PURE__ */ jsx("button", {
58
+ type: "button",
59
+ onClick: onAlwaysAllow,
60
+ className: "text-fg-muted hover:bg-surface-2 hover:text-fg h-8 rounded-full px-3.5 text-(length:--cue-text-ui) font-medium transition-[background-color,color,scale] duration-150 active:scale-[0.96]",
61
+ children: "Always allow"
62
+ }),
63
+ /* @__PURE__ */ jsx("button", {
64
+ type: "button",
65
+ onClick: onAllowOnce,
66
+ className: cn(inkButton, "flex h-8 items-center rounded-full px-3.5 text-(length:--cue-text-ui) font-medium"),
67
+ children: "Allow once"
68
+ })
69
+ ] }) : /* @__PURE__ */ jsx("div", {
70
+ className: "cue-elements-fade-in cue-elements-animate-in text-fg-muted flex items-center gap-2 text-(length:--cue-text-ui) duration-300",
71
+ children: state === "running" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Loader2Icon, { className: "text-fg-muted size-3.5 animate-spin" }), "Approved, running"] }) : state === "denied" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(XIcon, { className: "text-fg-muted size-3.5" }), "Denied"] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(CheckIcon, { className: "size-3.5 text-ok" }), "Finished with exit 0"] })
72
+ }, state)
73
+ })
74
+ ]
75
+ });
76
+ }
77
+ //#endregion
78
+ export { ApprovalCard };
@@ -0,0 +1,30 @@
1
+ import { ComponentProps } from "react";
2
+ //#region src/elements/artifact-card.d.ts
3
+ /**
4
+ * A generated document as a tangible object, written live and versioned.
5
+ *
6
+ * @example
7
+ * import { ArtifactCard } from "@cueplusplus/ui/elements";
8
+ *
9
+ * <ArtifactCard
10
+ * title="Draft persistence RFC"
11
+ * meta="Document · v3 · just now"
12
+ * generating={isWriting}
13
+ * words={wordCount}
14
+ * />
15
+ */
16
+ declare function ArtifactCard({ title, meta, generating, words, className, ...props }: Omit<ComponentProps<"div">, "children" | "title" | "meta" | "generating" | "words"> & {
17
+ /** Name of the generated artifact. */
18
+ title: string;
19
+ /**
20
+ * Resting meta line shown once generation finishes, for example kind, version, and
21
+ * recency.
22
+ */
23
+ meta: string;
24
+ /** While true the icon pulses and the meta line shows a live word count with a shimmer. */
25
+ generating?: boolean;
26
+ /** Live word count shown while generating. */
27
+ words?: number;
28
+ }): import("react").JSX.Element;
29
+ //#endregion
30
+ export { ArtifactCard };