@schlessera/brain-ui-react 0.34.1 → 0.36.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 (763) hide show
  1. package/README.md +89 -4
  2. package/dist/components/activity/activity-page.d.ts +17 -5
  3. package/dist/components/activity/activity-page.d.ts.map +1 -1
  4. package/dist/components/activity/activity-page.js +144 -50
  5. package/dist/components/activity/activity-page.js.map +1 -1
  6. package/dist/components/activity/activity-run-detail.d.ts +16 -1
  7. package/dist/components/activity/activity-run-detail.d.ts.map +1 -1
  8. package/dist/components/activity/activity-run-detail.js +47 -4
  9. package/dist/components/activity/activity-run-detail.js.map +1 -1
  10. package/dist/components/activity/activity-run-list.d.ts +7 -1
  11. package/dist/components/activity/activity-run-list.d.ts.map +1 -1
  12. package/dist/components/activity/activity-run-list.js +16 -8
  13. package/dist/components/activity/activity-run-list.js.map +1 -1
  14. package/dist/components/activity/activity-views.d.ts +63 -0
  15. package/dist/components/activity/activity-views.d.ts.map +1 -0
  16. package/dist/components/activity/activity-views.js +52 -0
  17. package/dist/components/activity/activity-views.js.map +1 -0
  18. package/dist/components/activity/approval-card.d.ts +11 -0
  19. package/dist/components/activity/approval-card.d.ts.map +1 -0
  20. package/dist/components/activity/approval-card.js +46 -0
  21. package/dist/components/activity/approval-card.js.map +1 -0
  22. package/dist/components/activity/digest-card.d.ts +3 -0
  23. package/dist/components/activity/digest-card.d.ts.map +1 -1
  24. package/dist/components/activity/digest-card.js +20 -16
  25. package/dist/components/activity/digest-card.js.map +1 -1
  26. package/dist/components/activity/digest-summary.d.ts +19 -0
  27. package/dist/components/activity/digest-summary.d.ts.map +1 -0
  28. package/dist/components/activity/digest-summary.js +20 -0
  29. package/dist/components/activity/digest-summary.js.map +1 -0
  30. package/dist/components/activity/push-switch.d.ts +25 -0
  31. package/dist/components/activity/push-switch.d.ts.map +1 -0
  32. package/dist/components/activity/push-switch.js +14 -0
  33. package/dist/components/activity/push-switch.js.map +1 -0
  34. package/dist/components/activity/push-toggle.d.ts +7 -0
  35. package/dist/components/activity/push-toggle.d.ts.map +1 -1
  36. package/dist/components/activity/push-toggle.js +72 -47
  37. package/dist/components/activity/push-toggle.js.map +1 -1
  38. package/dist/components/activity/span-bits.d.ts.map +1 -1
  39. package/dist/components/activity/span-bits.js +9 -7
  40. package/dist/components/activity/span-bits.js.map +1 -1
  41. package/dist/components/chat/ask-user-card.d.ts +76 -3
  42. package/dist/components/chat/ask-user-card.d.ts.map +1 -1
  43. package/dist/components/chat/ask-user-card.js +208 -149
  44. package/dist/components/chat/ask-user-card.js.map +1 -1
  45. package/dist/components/chat/ask-user-typed.d.ts +42 -0
  46. package/dist/components/chat/ask-user-typed.d.ts.map +1 -0
  47. package/dist/components/chat/ask-user-typed.js +60 -0
  48. package/dist/components/chat/ask-user-typed.js.map +1 -0
  49. package/dist/components/chat/brain-markdown-links.d.ts +2 -1
  50. package/dist/components/chat/brain-markdown-links.d.ts.map +1 -1
  51. package/dist/components/chat/brain-markdown-links.js +3 -4
  52. package/dist/components/chat/brain-markdown-links.js.map +1 -1
  53. package/dist/components/chat/brain-markdown.d.ts.map +1 -1
  54. package/dist/components/chat/brain-markdown.js +4 -2
  55. package/dist/components/chat/brain-markdown.js.map +1 -1
  56. package/dist/components/chat/chat-page.d.ts.map +1 -1
  57. package/dist/components/chat/chat-page.js +24 -9
  58. package/dist/components/chat/chat-page.js.map +1 -1
  59. package/dist/components/chat/composer-view.d.ts +75 -0
  60. package/dist/components/chat/composer-view.d.ts.map +1 -0
  61. package/dist/components/chat/composer-view.js +31 -0
  62. package/dist/components/chat/composer-view.js.map +1 -0
  63. package/dist/components/chat/composer.d.ts +4 -0
  64. package/dist/components/chat/composer.d.ts.map +1 -1
  65. package/dist/components/chat/composer.js +76 -59
  66. package/dist/components/chat/composer.js.map +1 -1
  67. package/dist/components/chat/markdown-content.d.ts +16 -1
  68. package/dist/components/chat/markdown-content.d.ts.map +1 -1
  69. package/dist/components/chat/markdown-content.js +47 -3
  70. package/dist/components/chat/markdown-content.js.map +1 -1
  71. package/dist/components/chat/mermaid-block.d.ts +4 -0
  72. package/dist/components/chat/mermaid-block.d.ts.map +1 -1
  73. package/dist/components/chat/mermaid-block.js +13 -5
  74. package/dist/components/chat/mermaid-block.js.map +1 -1
  75. package/dist/components/chat/mermaid-share.d.ts +2 -1
  76. package/dist/components/chat/mermaid-share.d.ts.map +1 -1
  77. package/dist/components/chat/mermaid-share.js +7 -8
  78. package/dist/components/chat/mermaid-share.js.map +1 -1
  79. package/dist/components/chat/mermaid-viewer.d.ts.map +1 -1
  80. package/dist/components/chat/mermaid-viewer.js +3 -1
  81. package/dist/components/chat/mermaid-viewer.js.map +1 -1
  82. package/dist/components/chat/message-bubble.d.ts +8 -1
  83. package/dist/components/chat/message-bubble.d.ts.map +1 -1
  84. package/dist/components/chat/message-bubble.js +53 -24
  85. package/dist/components/chat/message-bubble.js.map +1 -1
  86. package/dist/components/chat/message-share.d.ts +2 -1
  87. package/dist/components/chat/message-share.d.ts.map +1 -1
  88. package/dist/components/chat/message-share.js +6 -7
  89. package/dist/components/chat/message-share.js.map +1 -1
  90. package/dist/components/chat/renderers/bind.d.ts +39 -0
  91. package/dist/components/chat/renderers/bind.d.ts.map +1 -0
  92. package/dist/components/chat/renderers/bind.js +43 -0
  93. package/dist/components/chat/renderers/bind.js.map +1 -0
  94. package/dist/components/chat/renderers/brain-ui-tools.d.ts +3 -0
  95. package/dist/components/chat/renderers/brain-ui-tools.d.ts.map +1 -0
  96. package/dist/components/chat/renderers/brain-ui-tools.js +41 -0
  97. package/dist/components/chat/renderers/brain-ui-tools.js.map +1 -0
  98. package/dist/components/chat/renderers/claude-tools.d.ts.map +1 -1
  99. package/dist/components/chat/renderers/claude-tools.js +3 -2
  100. package/dist/components/chat/renderers/claude-tools.js.map +1 -1
  101. package/dist/components/chat/renderers/index.d.ts +10 -2
  102. package/dist/components/chat/renderers/index.d.ts.map +1 -1
  103. package/dist/components/chat/renderers/index.js +15 -10
  104. package/dist/components/chat/renderers/index.js.map +1 -1
  105. package/dist/components/chat/session-drawer.d.ts +4 -0
  106. package/dist/components/chat/session-drawer.d.ts.map +1 -1
  107. package/dist/components/chat/session-drawer.js +55 -40
  108. package/dist/components/chat/session-drawer.js.map +1 -1
  109. package/dist/components/chat/session-list.d.ts +41 -0
  110. package/dist/components/chat/session-list.d.ts.map +1 -0
  111. package/dist/components/chat/session-list.js +10 -0
  112. package/dist/components/chat/session-list.js.map +1 -0
  113. package/dist/components/chat/share-block.d.ts.map +1 -1
  114. package/dist/components/chat/share-block.js +12 -11
  115. package/dist/components/chat/share-block.js.map +1 -1
  116. package/dist/components/chat/share-card.js +2 -2
  117. package/dist/components/chat/share-card.js.map +1 -1
  118. package/dist/components/chat/subagent-view.js +1 -1
  119. package/dist/components/chat/subagent-view.js.map +1 -1
  120. package/dist/components/chat/tool-call-timeline.d.ts.map +1 -1
  121. package/dist/components/chat/tool-call-timeline.js +37 -12
  122. package/dist/components/chat/tool-call-timeline.js.map +1 -1
  123. package/dist/components/chat/tool-cards/block-card.d.ts +28 -0
  124. package/dist/components/chat/tool-cards/block-card.d.ts.map +1 -0
  125. package/dist/components/chat/tool-cards/block-card.js +103 -0
  126. package/dist/components/chat/tool-cards/block-card.js.map +1 -0
  127. package/dist/components/chat/tool-cards/image-mask-card.d.ts +70 -0
  128. package/dist/components/chat/tool-cards/image-mask-card.d.ts.map +1 -0
  129. package/dist/components/chat/tool-cards/image-mask-card.js +142 -0
  130. package/dist/components/chat/tool-cards/image-mask-card.js.map +1 -0
  131. package/dist/components/chat/tool-cards/location-card.d.ts +45 -0
  132. package/dist/components/chat/tool-cards/location-card.d.ts.map +1 -0
  133. package/dist/components/chat/tool-cards/location-card.js +128 -0
  134. package/dist/components/chat/tool-cards/location-card.js.map +1 -0
  135. package/dist/components/chat/tool-views.d.ts +15 -4
  136. package/dist/components/chat/tool-views.d.ts.map +1 -1
  137. package/dist/components/chat/tool-views.js +22 -38
  138. package/dist/components/chat/tool-views.js.map +1 -1
  139. package/dist/components/chat/transcript-turn.d.ts +45 -0
  140. package/dist/components/chat/transcript-turn.d.ts.map +1 -0
  141. package/dist/components/chat/transcript-turn.js +25 -0
  142. package/dist/components/chat/transcript-turn.js.map +1 -0
  143. package/dist/components/chat/use-chat-commands.d.ts.map +1 -1
  144. package/dist/components/chat/use-chat-commands.js +13 -16
  145. package/dist/components/chat/use-chat-commands.js.map +1 -1
  146. package/dist/components/chat/welcome-state.d.ts +7 -0
  147. package/dist/components/chat/welcome-state.d.ts.map +1 -1
  148. package/dist/components/chat/welcome-state.js +13 -5
  149. package/dist/components/chat/welcome-state.js.map +1 -1
  150. package/dist/components/connectivity/connection-gate.d.ts.map +1 -1
  151. package/dist/components/connectivity/connection-gate.js +64 -6
  152. package/dist/components/connectivity/connection-gate.js.map +1 -1
  153. package/dist/components/connectivity/login-form.d.ts +31 -0
  154. package/dist/components/connectivity/login-form.d.ts.map +1 -0
  155. package/dist/components/connectivity/login-form.js +19 -0
  156. package/dist/components/connectivity/login-form.js.map +1 -0
  157. package/dist/components/connectivity/login-screen.d.ts +5 -2
  158. package/dist/components/connectivity/login-screen.d.ts.map +1 -1
  159. package/dist/components/connectivity/login-screen.js +41 -31
  160. package/dist/components/connectivity/login-screen.js.map +1 -1
  161. package/dist/components/dev/share-harness.js +1 -1
  162. package/dist/components/dev/share-harness.js.map +1 -1
  163. package/dist/components/files/file-panel.d.ts +1 -1
  164. package/dist/components/files/file-panel.d.ts.map +1 -1
  165. package/dist/components/files/file-panel.js +74 -0
  166. package/dist/components/files/file-panel.js.map +1 -1
  167. package/dist/components/files/file-tree-view.d.ts +45 -0
  168. package/dist/components/files/file-tree-view.d.ts.map +1 -0
  169. package/dist/components/files/file-tree-view.js +51 -0
  170. package/dist/components/files/file-tree-view.js.map +1 -0
  171. package/dist/components/files/file-tree.d.ts +6 -0
  172. package/dist/components/files/file-tree.d.ts.map +1 -1
  173. package/dist/components/files/file-tree.js +39 -43
  174. package/dist/components/files/file-tree.js.map +1 -1
  175. package/dist/components/files/file-viewer-binary.d.ts.map +1 -1
  176. package/dist/components/files/file-viewer-binary.js +3 -2
  177. package/dist/components/files/file-viewer-binary.js.map +1 -1
  178. package/dist/components/files/file-viewer-frame.d.ts +36 -0
  179. package/dist/components/files/file-viewer-frame.d.ts.map +1 -0
  180. package/dist/components/files/file-viewer-frame.js +26 -0
  181. package/dist/components/files/file-viewer-frame.js.map +1 -0
  182. package/dist/components/files/file-viewer.d.ts +5 -0
  183. package/dist/components/files/file-viewer.d.ts.map +1 -1
  184. package/dist/components/files/file-viewer.js +26 -32
  185. package/dist/components/files/file-viewer.js.map +1 -1
  186. package/dist/components/files/frontmatter-chips.d.ts +18 -0
  187. package/dist/components/files/frontmatter-chips.d.ts.map +1 -0
  188. package/dist/components/files/frontmatter-chips.js +11 -0
  189. package/dist/components/files/frontmatter-chips.js.map +1 -0
  190. package/dist/components/files/frontmatter-panel.d.ts +5 -1
  191. package/dist/components/files/frontmatter-panel.d.ts.map +1 -1
  192. package/dist/components/files/frontmatter-panel.js +7 -6
  193. package/dist/components/files/frontmatter-panel.js.map +1 -1
  194. package/dist/components/files/staleness.d.ts +18 -0
  195. package/dist/components/files/staleness.d.ts.map +1 -0
  196. package/dist/components/files/staleness.js +27 -0
  197. package/dist/components/files/staleness.js.map +1 -0
  198. package/dist/components/graph/graph-canvas.d.ts.map +1 -1
  199. package/dist/components/graph/graph-canvas.js +24 -1
  200. package/dist/components/graph/graph-canvas.js.map +1 -1
  201. package/dist/components/graph/graph-controls-column.d.ts +14 -0
  202. package/dist/components/graph/graph-controls-column.d.ts.map +1 -0
  203. package/dist/components/graph/graph-controls-column.js +44 -0
  204. package/dist/components/graph/graph-controls-column.js.map +1 -0
  205. package/dist/components/graph/graph-controls.d.ts +20 -5
  206. package/dist/components/graph/graph-controls.d.ts.map +1 -1
  207. package/dist/components/graph/graph-controls.js +58 -37
  208. package/dist/components/graph/graph-controls.js.map +1 -1
  209. package/dist/components/graph/graph-form.d.ts +82 -0
  210. package/dist/components/graph/graph-form.d.ts.map +1 -0
  211. package/dist/components/graph/graph-form.js +69 -0
  212. package/dist/components/graph/graph-form.js.map +1 -0
  213. package/dist/components/graph/graph-maintenance.d.ts.map +1 -1
  214. package/dist/components/graph/graph-maintenance.js +6 -10
  215. package/dist/components/graph/graph-maintenance.js.map +1 -1
  216. package/dist/components/graph/graph-node-rail.d.ts +13 -0
  217. package/dist/components/graph/graph-node-rail.d.ts.map +1 -0
  218. package/dist/components/graph/graph-node-rail.js +92 -0
  219. package/dist/components/graph/graph-node-rail.js.map +1 -0
  220. package/dist/components/graph/graph-page.d.ts +7 -0
  221. package/dist/components/graph/graph-page.d.ts.map +1 -1
  222. package/dist/components/graph/graph-page.js +102 -12
  223. package/dist/components/graph/graph-page.js.map +1 -1
  224. package/dist/components/graph/graph-scene.d.ts.map +1 -1
  225. package/dist/components/graph/graph-scene.js +100 -24
  226. package/dist/components/graph/graph-scene.js.map +1 -1
  227. package/dist/components/graph/lib/graph-helpers.d.ts +42 -12
  228. package/dist/components/graph/lib/graph-helpers.d.ts.map +1 -1
  229. package/dist/components/graph/lib/graph-helpers.js +33 -41
  230. package/dist/components/graph/lib/graph-helpers.js.map +1 -1
  231. package/dist/components/graph/node-card.d.ts +28 -0
  232. package/dist/components/graph/node-card.d.ts.map +1 -0
  233. package/dist/components/graph/node-card.js +7 -0
  234. package/dist/components/graph/node-card.js.map +1 -0
  235. package/dist/components/graph/node-popover.d.ts +6 -2
  236. package/dist/components/graph/node-popover.d.ts.map +1 -1
  237. package/dist/components/graph/node-popover.js +13 -31
  238. package/dist/components/graph/node-popover.js.map +1 -1
  239. package/dist/components/graph/use-graph-theme.d.ts +32 -4
  240. package/dist/components/graph/use-graph-theme.d.ts.map +1 -1
  241. package/dist/components/graph/use-graph-theme.js +44 -32
  242. package/dist/components/graph/use-graph-theme.js.map +1 -1
  243. package/dist/components/graph/use-node-actions.d.ts +26 -0
  244. package/dist/components/graph/use-node-actions.d.ts.map +1 -0
  245. package/dist/components/graph/use-node-actions.js +54 -0
  246. package/dist/components/graph/use-node-actions.js.map +1 -0
  247. package/dist/components/images/image-share.d.ts +2 -1
  248. package/dist/components/images/image-share.d.ts.map +1 -1
  249. package/dist/components/images/image-share.js +3 -3
  250. package/dist/components/images/image-share.js.map +1 -1
  251. package/dist/components/images/image-viewer.d.ts.map +1 -1
  252. package/dist/components/images/image-viewer.js +3 -1
  253. package/dist/components/images/image-viewer.js.map +1 -1
  254. package/dist/components/images/mask-editor.d.ts.map +1 -1
  255. package/dist/components/images/mask-editor.js +7 -5
  256. package/dist/components/images/mask-editor.js.map +1 -1
  257. package/dist/components/layout/app-shell.d.ts.map +1 -1
  258. package/dist/components/layout/app-shell.js +5 -1
  259. package/dist/components/layout/app-shell.js.map +1 -1
  260. package/dist/components/layout/desktop-palette.d.ts +23 -0
  261. package/dist/components/layout/desktop-palette.d.ts.map +1 -0
  262. package/dist/components/layout/desktop-palette.js +132 -0
  263. package/dist/components/layout/desktop-palette.js.map +1 -0
  264. package/dist/components/layout/key-cap.d.ts +9 -0
  265. package/dist/components/layout/key-cap.d.ts.map +1 -0
  266. package/dist/components/layout/key-cap.js +10 -0
  267. package/dist/components/layout/key-cap.js.map +1 -0
  268. package/dist/components/layout/mobile-tab-bar.d.ts +13 -0
  269. package/dist/components/layout/mobile-tab-bar.d.ts.map +1 -1
  270. package/dist/components/layout/mobile-tab-bar.js +58 -47
  271. package/dist/components/layout/mobile-tab-bar.js.map +1 -1
  272. package/dist/components/layout/shortcut-switch.d.ts +13 -0
  273. package/dist/components/layout/shortcut-switch.d.ts.map +1 -0
  274. package/dist/components/layout/shortcut-switch.js +22 -0
  275. package/dist/components/layout/shortcut-switch.js.map +1 -0
  276. package/dist/components/layout/side-rail.d.ts +24 -0
  277. package/dist/components/layout/side-rail.d.ts.map +1 -1
  278. package/dist/components/layout/side-rail.js +65 -27
  279. package/dist/components/layout/side-rail.js.map +1 -1
  280. package/dist/components/layout/slide-panel.d.ts +12 -2
  281. package/dist/components/layout/slide-panel.d.ts.map +1 -1
  282. package/dist/components/layout/slide-panel.js +11 -2
  283. package/dist/components/layout/slide-panel.js.map +1 -1
  284. package/dist/components/layout/theme.d.ts +22 -0
  285. package/dist/components/layout/theme.d.ts.map +1 -0
  286. package/dist/components/layout/theme.js +44 -0
  287. package/dist/components/layout/theme.js.map +1 -0
  288. package/dist/components/quick-actions/add-form.d.ts +44 -0
  289. package/dist/components/quick-actions/add-form.d.ts.map +1 -0
  290. package/dist/components/quick-actions/add-form.js +30 -0
  291. package/dist/components/quick-actions/add-form.js.map +1 -0
  292. package/dist/components/quick-actions/add-modal.d.ts +7 -0
  293. package/dist/components/quick-actions/add-modal.d.ts.map +1 -1
  294. package/dist/components/quick-actions/add-modal.js +66 -20
  295. package/dist/components/quick-actions/add-modal.js.map +1 -1
  296. package/dist/components/quick-actions/search-modal.d.ts.map +1 -1
  297. package/dist/components/quick-actions/search-modal.js +48 -19
  298. package/dist/components/quick-actions/search-modal.js.map +1 -1
  299. package/dist/components/quick-actions/streaming-modal.d.ts +6 -0
  300. package/dist/components/quick-actions/streaming-modal.d.ts.map +1 -1
  301. package/dist/components/quick-actions/streaming-modal.js +42 -17
  302. package/dist/components/quick-actions/streaming-modal.js.map +1 -1
  303. package/dist/components/quick-actions/streaming-output.d.ts +38 -0
  304. package/dist/components/quick-actions/streaming-output.d.ts.map +1 -0
  305. package/dist/components/quick-actions/streaming-output.js +22 -0
  306. package/dist/components/quick-actions/streaming-output.js.map +1 -0
  307. package/dist/components/quick-actions/whatsup-modal.d.ts +5 -0
  308. package/dist/components/quick-actions/whatsup-modal.d.ts.map +1 -1
  309. package/dist/components/quick-actions/whatsup-modal.js +36 -10
  310. package/dist/components/quick-actions/whatsup-modal.js.map +1 -1
  311. package/dist/components/settings/devices-agents-tab.d.ts +10 -0
  312. package/dist/components/settings/devices-agents-tab.d.ts.map +1 -0
  313. package/dist/components/settings/devices-agents-tab.js +131 -0
  314. package/dist/components/settings/devices-agents-tab.js.map +1 -0
  315. package/dist/components/settings/models-list.d.ts +39 -0
  316. package/dist/components/settings/models-list.d.ts.map +1 -0
  317. package/dist/components/settings/models-list.js +72 -0
  318. package/dist/components/settings/models-list.js.map +1 -0
  319. package/dist/components/settings/models-tab.d.ts +4 -0
  320. package/dist/components/settings/models-tab.d.ts.map +1 -1
  321. package/dist/components/settings/models-tab.js +52 -102
  322. package/dist/components/settings/models-tab.js.map +1 -1
  323. package/dist/components/settings/one-time-agent-credential.d.ts +3 -0
  324. package/dist/components/settings/one-time-agent-credential.d.ts.map +1 -0
  325. package/dist/components/settings/one-time-agent-credential.js +55 -0
  326. package/dist/components/settings/one-time-agent-credential.js.map +1 -0
  327. package/dist/components/settings/passkey-list.d.ts +35 -0
  328. package/dist/components/settings/passkey-list.d.ts.map +1 -0
  329. package/dist/components/settings/passkey-list.js +34 -0
  330. package/dist/components/settings/passkey-list.js.map +1 -0
  331. package/dist/components/settings/passkey-tab.d.ts +3 -0
  332. package/dist/components/settings/passkey-tab.d.ts.map +1 -1
  333. package/dist/components/settings/passkey-tab.js +53 -45
  334. package/dist/components/settings/passkey-tab.js.map +1 -1
  335. package/dist/components/settings/pi-accounts-list.d.ts +27 -0
  336. package/dist/components/settings/pi-accounts-list.d.ts.map +1 -0
  337. package/dist/components/settings/pi-accounts-list.js +15 -0
  338. package/dist/components/settings/pi-accounts-list.js.map +1 -0
  339. package/dist/components/settings/pi-accounts.d.ts +3 -0
  340. package/dist/components/settings/pi-accounts.d.ts.map +1 -1
  341. package/dist/components/settings/pi-accounts.js +73 -55
  342. package/dist/components/settings/pi-accounts.js.map +1 -1
  343. package/dist/components/settings/principal-list.d.ts +37 -0
  344. package/dist/components/settings/principal-list.d.ts.map +1 -0
  345. package/dist/components/settings/principal-list.js +18 -0
  346. package/dist/components/settings/principal-list.js.map +1 -0
  347. package/dist/components/settings/settings-panel.d.ts +10 -3
  348. package/dist/components/settings/settings-panel.d.ts.map +1 -1
  349. package/dist/components/settings/settings-panel.js +80 -6
  350. package/dist/components/settings/settings-panel.js.map +1 -1
  351. package/dist/components/settings/skills-list.d.ts +53 -0
  352. package/dist/components/settings/skills-list.d.ts.map +1 -0
  353. package/dist/components/settings/skills-list.js +28 -0
  354. package/dist/components/settings/skills-list.js.map +1 -0
  355. package/dist/components/settings/skills-tab.d.ts.map +1 -1
  356. package/dist/components/settings/skills-tab.js +65 -38
  357. package/dist/components/settings/skills-tab.js.map +1 -1
  358. package/dist/components/settings/tool-permissions-list.d.ts +18 -0
  359. package/dist/components/settings/tool-permissions-list.d.ts.map +1 -0
  360. package/dist/components/settings/tool-permissions-list.js +6 -0
  361. package/dist/components/settings/tool-permissions-list.js.map +1 -0
  362. package/dist/components/settings/tool-permissions.d.ts +2 -1
  363. package/dist/components/settings/tool-permissions.d.ts.map +1 -1
  364. package/dist/components/settings/tool-permissions.js +33 -16
  365. package/dist/components/settings/tool-permissions.js.map +1 -1
  366. package/dist/components/settings/web-search-chain.d.ts +41 -0
  367. package/dist/components/settings/web-search-chain.d.ts.map +1 -0
  368. package/dist/components/settings/web-search-chain.js +47 -0
  369. package/dist/components/settings/web-search-chain.js.map +1 -0
  370. package/dist/components/settings/web-search-settings.d.ts +4 -7
  371. package/dist/components/settings/web-search-settings.d.ts.map +1 -1
  372. package/dist/components/settings/web-search-settings.js +54 -76
  373. package/dist/components/settings/web-search-settings.js.map +1 -1
  374. package/dist/components/share/share-menu.d.ts.map +1 -1
  375. package/dist/components/share/share-menu.js +24 -4
  376. package/dist/components/share/share-menu.js.map +1 -1
  377. package/dist/components/voice/dictation-sheet.js +3 -3
  378. package/dist/components/voice/dictation-sheet.js.map +1 -1
  379. package/dist/components/voice/mic-button.js +1 -1
  380. package/dist/components/voice/mic-button.js.map +1 -1
  381. package/dist/components/voice/review-card.js +1 -1
  382. package/dist/components/voice/review-card.js.map +1 -1
  383. package/dist/config.d.ts +5 -2
  384. package/dist/config.d.ts.map +1 -1
  385. package/dist/config.js +15 -5
  386. package/dist/config.js.map +1 -1
  387. package/dist/connection.d.ts +12 -0
  388. package/dist/connection.d.ts.map +1 -0
  389. package/dist/connection.js +421 -0
  390. package/dist/connection.js.map +1 -0
  391. package/dist/default-root.d.ts +3 -0
  392. package/dist/default-root.d.ts.map +1 -0
  393. package/dist/default-root.js +16 -0
  394. package/dist/default-root.js.map +1 -0
  395. package/dist/hooks/use-color-scheme.d.ts +14 -0
  396. package/dist/hooks/use-color-scheme.d.ts.map +1 -0
  397. package/dist/hooks/use-color-scheme.js +37 -0
  398. package/dist/hooks/use-color-scheme.js.map +1 -0
  399. package/dist/hooks/use-hash-routes.d.ts.map +1 -1
  400. package/dist/hooks/use-hash-routes.js +4 -2
  401. package/dist/hooks/use-hash-routes.js.map +1 -1
  402. package/dist/hooks/use-media-query.d.ts +7 -0
  403. package/dist/hooks/use-media-query.d.ts.map +1 -0
  404. package/dist/hooks/use-media-query.js +34 -0
  405. package/dist/hooks/use-media-query.js.map +1 -0
  406. package/dist/hooks/use-share-intake.d.ts.map +1 -1
  407. package/dist/hooks/use-share-intake.js +37 -12
  408. package/dist/hooks/use-share-intake.js.map +1 -1
  409. package/dist/hooks/use-vpn-status.d.ts +1 -1
  410. package/dist/hooks/use-vpn-status.d.ts.map +1 -1
  411. package/dist/hooks/use-vpn-status.js +20 -16
  412. package/dist/hooks/use-vpn-status.js.map +1 -1
  413. package/dist/hooks/use-websocket.d.ts +5 -24
  414. package/dist/hooks/use-websocket.d.ts.map +1 -1
  415. package/dist/hooks/use-websocket.js +11 -382
  416. package/dist/hooks/use-websocket.js.map +1 -1
  417. package/dist/hooks/websocket-handlers/activity.d.ts +2 -2
  418. package/dist/hooks/websocket-handlers/activity.d.ts.map +1 -1
  419. package/dist/hooks/websocket-handlers/activity.js +4 -5
  420. package/dist/hooks/websocket-handlers/activity.js.map +1 -1
  421. package/dist/hooks/websocket-handlers/chat.d.ts +1 -0
  422. package/dist/hooks/websocket-handlers/chat.d.ts.map +1 -1
  423. package/dist/hooks/websocket-handlers/chat.js +27 -5
  424. package/dist/hooks/websocket-handlers/chat.js.map +1 -1
  425. package/dist/hooks/websocket-handlers/connection.d.ts.map +1 -1
  426. package/dist/hooks/websocket-handlers/connection.js +4 -6
  427. package/dist/hooks/websocket-handlers/connection.js.map +1 -1
  428. package/dist/hooks/websocket-handlers/mask.d.ts +1 -1
  429. package/dist/hooks/websocket-handlers/mask.d.ts.map +1 -1
  430. package/dist/hooks/websocket-handlers/mask.js +2 -3
  431. package/dist/hooks/websocket-handlers/mask.js.map +1 -1
  432. package/dist/hooks/websocket-handlers/provider.d.ts.map +1 -1
  433. package/dist/hooks/websocket-handlers/provider.js +4 -6
  434. package/dist/hooks/websocket-handlers/provider.js.map +1 -1
  435. package/dist/hooks/websocket-handlers/types.d.ts +6 -2
  436. package/dist/hooks/websocket-handlers/types.d.ts.map +1 -1
  437. package/dist/index.d.ts +5 -3
  438. package/dist/index.d.ts.map +1 -1
  439. package/dist/index.js +6 -3
  440. package/dist/index.js.map +1 -1
  441. package/dist/lib/api-client.d.ts +321 -0
  442. package/dist/lib/api-client.d.ts.map +1 -1
  443. package/dist/lib/api-client.js +243 -213
  444. package/dist/lib/api-client.js.map +1 -1
  445. package/dist/lib/backend.d.ts +19 -2
  446. package/dist/lib/backend.d.ts.map +1 -1
  447. package/dist/lib/backend.js +15 -9
  448. package/dist/lib/backend.js.map +1 -1
  449. package/dist/lib/diff.d.ts +8 -10
  450. package/dist/lib/diff.d.ts.map +1 -1
  451. package/dist/lib/diff.js +26 -53
  452. package/dist/lib/diff.js.map +1 -1
  453. package/dist/lib/format-time.d.ts +3 -0
  454. package/dist/lib/format-time.d.ts.map +1 -0
  455. package/dist/lib/format-time.js +25 -0
  456. package/dist/lib/format-time.js.map +1 -0
  457. package/dist/lib/light-dark.d.ts +37 -0
  458. package/dist/lib/light-dark.d.ts.map +1 -0
  459. package/dist/lib/light-dark.js +83 -0
  460. package/dist/lib/light-dark.js.map +1 -0
  461. package/dist/lib/mermaid-theme.d.ts +7 -2
  462. package/dist/lib/mermaid-theme.d.ts.map +1 -1
  463. package/dist/lib/mermaid-theme.js +125 -203
  464. package/dist/lib/mermaid-theme.js.map +1 -1
  465. package/dist/lib/passkeys.d.ts +6 -3
  466. package/dist/lib/passkeys.d.ts.map +1 -1
  467. package/dist/lib/passkeys.js +10 -4
  468. package/dist/lib/passkeys.js.map +1 -1
  469. package/dist/lib/push-registration.d.ts +10 -0
  470. package/dist/lib/push-registration.d.ts.map +1 -0
  471. package/dist/lib/push-registration.js +44 -0
  472. package/dist/lib/push-registration.js.map +1 -0
  473. package/dist/lib/share-intake.d.ts +2 -1
  474. package/dist/lib/share-intake.d.ts.map +1 -1
  475. package/dist/lib/share-intake.js +3 -3
  476. package/dist/lib/share-intake.js.map +1 -1
  477. package/dist/lib/share.d.ts +4 -3
  478. package/dist/lib/share.d.ts.map +1 -1
  479. package/dist/lib/share.js +6 -7
  480. package/dist/lib/share.js.map +1 -1
  481. package/dist/lib/single-key.d.ts +30 -0
  482. package/dist/lib/single-key.d.ts.map +1 -0
  483. package/dist/lib/single-key.js +45 -0
  484. package/dist/lib/single-key.js.map +1 -0
  485. package/dist/lib/tool-names.d.ts +8 -6
  486. package/dist/lib/tool-names.d.ts.map +1 -1
  487. package/dist/lib/tool-names.js +17 -7
  488. package/dist/lib/tool-names.js.map +1 -1
  489. package/dist/root-context.d.ts +229 -0
  490. package/dist/root-context.d.ts.map +1 -0
  491. package/dist/root-context.js +33 -0
  492. package/dist/root-context.js.map +1 -0
  493. package/dist/root.d.ts +38 -0
  494. package/dist/root.d.ts.map +1 -0
  495. package/dist/root.js +47 -0
  496. package/dist/root.js.map +1 -0
  497. package/dist/stores/activity-state.d.ts +29 -0
  498. package/dist/stores/activity-state.d.ts.map +1 -0
  499. package/dist/stores/activity-state.js +282 -0
  500. package/dist/stores/activity-state.js.map +1 -0
  501. package/dist/stores/activity-store.d.ts +10 -41
  502. package/dist/stores/activity-store.d.ts.map +1 -1
  503. package/dist/stores/activity-store.js +9 -271
  504. package/dist/stores/activity-store.js.map +1 -1
  505. package/dist/stores/chat-state.d.ts +212 -0
  506. package/dist/stores/chat-state.d.ts.map +1 -0
  507. package/dist/stores/chat-state.js +466 -0
  508. package/dist/stores/chat-state.js.map +1 -0
  509. package/dist/stores/chat-store.d.ts +4 -162
  510. package/dist/stores/chat-store.d.ts.map +1 -1
  511. package/dist/stores/chat-store.js +7 -418
  512. package/dist/stores/chat-store.js.map +1 -1
  513. package/dist/stores/connection-state.d.ts +40 -0
  514. package/dist/stores/connection-state.d.ts.map +1 -0
  515. package/dist/stores/connection-state.js +30 -0
  516. package/dist/stores/connection-state.js.map +1 -0
  517. package/dist/stores/connection-store.d.ts +4 -40
  518. package/dist/stores/connection-store.d.ts.map +1 -1
  519. package/dist/stores/connection-store.js +7 -27
  520. package/dist/stores/connection-store.js.map +1 -1
  521. package/dist/stores/create-stores.d.ts +23 -0
  522. package/dist/stores/create-stores.d.ts.map +1 -0
  523. package/dist/stores/create-stores.js +28 -0
  524. package/dist/stores/create-stores.js.map +1 -0
  525. package/dist/stores/file-state.d.ts +53 -0
  526. package/dist/stores/file-state.d.ts.map +1 -0
  527. package/dist/stores/file-state.js +341 -0
  528. package/dist/stores/file-state.js.map +1 -0
  529. package/dist/stores/file-store.d.ts +4 -52
  530. package/dist/stores/file-store.d.ts.map +1 -1
  531. package/dist/stores/file-store.js +7 -300
  532. package/dist/stores/file-store.js.map +1 -1
  533. package/dist/stores/graph-state.d.ts +95 -0
  534. package/dist/stores/graph-state.d.ts.map +1 -0
  535. package/dist/stores/graph-state.js +252 -0
  536. package/dist/stores/graph-state.js.map +1 -0
  537. package/dist/stores/graph-store.d.ts +7 -83
  538. package/dist/stores/graph-store.d.ts.map +1 -1
  539. package/dist/stores/graph-store.js +8 -249
  540. package/dist/stores/graph-store.js.map +1 -1
  541. package/dist/stores/mask-state.d.ts +21 -0
  542. package/dist/stores/mask-state.d.ts.map +1 -0
  543. package/dist/stores/mask-state.js +9 -0
  544. package/dist/stores/mask-state.js.map +1 -0
  545. package/dist/stores/mask-store.d.ts +4 -21
  546. package/dist/stores/mask-store.d.ts.map +1 -1
  547. package/dist/stores/mask-store.js +7 -6
  548. package/dist/stores/mask-store.js.map +1 -1
  549. package/dist/stores/principal-state.d.ts +16 -0
  550. package/dist/stores/principal-state.d.ts.map +1 -0
  551. package/dist/stores/principal-state.js +31 -0
  552. package/dist/stores/principal-state.js.map +1 -0
  553. package/dist/stores/principal-store.d.ts +5 -0
  554. package/dist/stores/principal-store.d.ts.map +1 -0
  555. package/dist/stores/principal-store.js +8 -0
  556. package/dist/stores/principal-store.js.map +1 -0
  557. package/dist/stores/provider-state.d.ts +24 -0
  558. package/dist/stores/provider-state.d.ts.map +1 -0
  559. package/dist/stores/provider-state.js +68 -0
  560. package/dist/stores/provider-state.js.map +1 -0
  561. package/dist/stores/provider-store.d.ts +4 -23
  562. package/dist/stores/provider-store.d.ts.map +1 -1
  563. package/dist/stores/provider-store.js +7 -64
  564. package/dist/stores/provider-store.js.map +1 -1
  565. package/dist/stores/share-state.d.ts +29 -0
  566. package/dist/stores/share-state.d.ts.map +1 -0
  567. package/dist/stores/share-state.js +21 -0
  568. package/dist/stores/share-state.js.map +1 -0
  569. package/dist/stores/share-store.d.ts +4 -28
  570. package/dist/stores/share-store.d.ts.map +1 -1
  571. package/dist/stores/share-store.js +7 -18
  572. package/dist/stores/share-store.js.map +1 -1
  573. package/dist/stores/store-environment.d.ts +10 -0
  574. package/dist/stores/store-environment.d.ts.map +1 -0
  575. package/dist/stores/store-environment.js +2 -0
  576. package/dist/stores/store-environment.js.map +1 -0
  577. package/dist/stores/ui-state.d.ts +71 -0
  578. package/dist/stores/ui-state.d.ts.map +1 -0
  579. package/dist/stores/ui-state.js +58 -0
  580. package/dist/stores/ui-state.js.map +1 -0
  581. package/dist/stores/ui-store.d.ts +4 -45
  582. package/dist/stores/ui-store.d.ts.map +1 -1
  583. package/dist/stores/ui-store.js +7 -36
  584. package/dist/stores/ui-store.js.map +1 -1
  585. package/dist/styles.css +1 -1
  586. package/dist/theme.css +150 -97
  587. package/dist/voice/asr-clients.d.ts +2 -1
  588. package/dist/voice/asr-clients.d.ts.map +1 -1
  589. package/dist/voice/asr-clients.js +16 -17
  590. package/dist/voice/asr-clients.js.map +1 -1
  591. package/dist/voice/use-dictation.d.ts.map +1 -1
  592. package/dist/voice/use-dictation.js +12 -8
  593. package/dist/voice/use-dictation.js.map +1 -1
  594. package/dist/voice/voice-state.d.ts +25 -0
  595. package/dist/voice/voice-state.d.ts.map +1 -0
  596. package/dist/voice/voice-state.js +29 -0
  597. package/dist/voice/voice-state.js.map +1 -0
  598. package/dist/voice/voice-store.d.ts +4 -25
  599. package/dist/voice/voice-store.d.ts.map +1 -1
  600. package/dist/voice/voice-store.js +7 -26
  601. package/dist/voice/voice-store.js.map +1 -1
  602. package/package.json +3 -2
  603. package/src/components/activity/activity-page.tsx +334 -160
  604. package/src/components/activity/activity-run-detail.tsx +81 -47
  605. package/src/components/activity/activity-run-list.tsx +27 -59
  606. package/src/components/activity/activity-views.tsx +155 -0
  607. package/src/components/activity/approval-card.tsx +80 -0
  608. package/src/components/activity/digest-card.tsx +25 -61
  609. package/src/components/activity/digest-summary.tsx +52 -0
  610. package/src/components/activity/push-switch.tsx +62 -0
  611. package/src/components/activity/push-toggle.tsx +51 -81
  612. package/src/components/activity/span-bits.tsx +8 -7
  613. package/src/components/chat/ask-user-card.tsx +292 -356
  614. package/src/components/chat/ask-user-typed.ts +77 -0
  615. package/src/components/chat/brain-markdown-links.tsx +4 -4
  616. package/src/components/chat/brain-markdown.tsx +4 -2
  617. package/src/components/chat/chat-page.tsx +38 -9
  618. package/src/components/chat/composer-view.tsx +194 -0
  619. package/src/components/chat/composer.tsx +117 -296
  620. package/src/components/chat/markdown-content.tsx +53 -2
  621. package/src/components/chat/mermaid-block.tsx +13 -5
  622. package/src/components/chat/mermaid-share.ts +8 -7
  623. package/src/components/chat/mermaid-viewer.tsx +3 -1
  624. package/src/components/chat/message-bubble.tsx +78 -94
  625. package/src/components/chat/message-share.ts +7 -7
  626. package/src/components/chat/renderers/bind.tsx +94 -0
  627. package/src/components/chat/renderers/brain-ui-tools.tsx +56 -0
  628. package/src/components/chat/renderers/claude-tools.tsx +3 -2
  629. package/src/components/chat/renderers/index.ts +15 -10
  630. package/src/components/chat/session-drawer.tsx +60 -138
  631. package/src/components/chat/session-list.tsx +113 -0
  632. package/src/components/chat/share-block.tsx +16 -12
  633. package/src/components/chat/share-card.tsx +2 -2
  634. package/src/components/chat/subagent-view.tsx +4 -4
  635. package/src/components/chat/tool-call-timeline.tsx +59 -22
  636. package/src/components/chat/tool-cards/block-card.tsx +145 -0
  637. package/src/components/chat/tool-cards/image-mask-card.tsx +214 -0
  638. package/src/components/chat/tool-cards/location-card.tsx +159 -0
  639. package/src/components/chat/tool-views.tsx +23 -73
  640. package/src/components/chat/transcript-turn.tsx +108 -0
  641. package/src/components/chat/use-chat-commands.ts +14 -16
  642. package/src/components/chat/welcome-state.tsx +36 -91
  643. package/src/components/connectivity/connection-gate.tsx +80 -9
  644. package/src/components/connectivity/login-form.tsx +122 -0
  645. package/src/components/connectivity/login-screen.tsx +45 -100
  646. package/src/components/dev/share-harness.tsx +2 -2
  647. package/src/components/files/file-panel.tsx +168 -0
  648. package/src/components/files/file-tree-view.tsx +127 -0
  649. package/src/components/files/file-tree.tsx +55 -109
  650. package/src/components/files/file-viewer-binary.tsx +3 -2
  651. package/src/components/files/file-viewer-frame.tsx +113 -0
  652. package/src/components/files/file-viewer.tsx +40 -95
  653. package/src/components/files/frontmatter-chips.tsx +42 -0
  654. package/src/components/files/frontmatter-panel.tsx +6 -71
  655. package/src/components/files/staleness.ts +29 -0
  656. package/src/components/graph/graph-canvas.tsx +24 -1
  657. package/src/components/graph/graph-controls-column.tsx +92 -0
  658. package/src/components/graph/graph-controls.tsx +83 -127
  659. package/src/components/graph/graph-form.tsx +183 -0
  660. package/src/components/graph/graph-maintenance.tsx +9 -14
  661. package/src/components/graph/graph-node-rail.tsx +147 -0
  662. package/src/components/graph/graph-page.tsx +189 -49
  663. package/src/components/graph/graph-scene.tsx +200 -30
  664. package/src/components/graph/lib/graph-helpers.ts +65 -43
  665. package/src/components/graph/node-card.tsx +64 -0
  666. package/src/components/graph/node-popover.tsx +28 -117
  667. package/src/components/graph/use-graph-theme.ts +69 -32
  668. package/src/components/graph/use-node-actions.ts +56 -0
  669. package/src/components/images/image-share.ts +4 -2
  670. package/src/components/images/image-viewer.tsx +3 -1
  671. package/src/components/images/mask-editor.tsx +7 -4
  672. package/src/components/layout/app-shell.tsx +7 -1
  673. package/src/components/layout/desktop-palette.tsx +151 -0
  674. package/src/components/layout/key-cap.tsx +15 -0
  675. package/src/components/layout/mobile-tab-bar.tsx +80 -157
  676. package/src/components/layout/shortcut-switch.tsx +32 -0
  677. package/src/components/layout/side-rail.tsx +70 -150
  678. package/src/components/layout/slide-panel.tsx +29 -2
  679. package/src/components/layout/theme.tsx +67 -0
  680. package/src/components/quick-actions/add-form.tsx +188 -0
  681. package/src/components/quick-actions/add-modal.tsx +68 -144
  682. package/src/components/quick-actions/search-modal.tsx +49 -19
  683. package/src/components/quick-actions/streaming-modal.tsx +44 -71
  684. package/src/components/quick-actions/streaming-output.tsx +112 -0
  685. package/src/components/quick-actions/whatsup-modal.tsx +38 -60
  686. package/src/components/settings/devices-agents-tab.tsx +139 -0
  687. package/src/components/settings/models-list.tsx +299 -0
  688. package/src/components/settings/models-tab.tsx +63 -337
  689. package/src/components/settings/one-time-agent-credential.tsx +131 -0
  690. package/src/components/settings/passkey-list.tsx +201 -0
  691. package/src/components/settings/passkey-tab.tsx +53 -197
  692. package/src/components/settings/pi-accounts-list.tsx +128 -0
  693. package/src/components/settings/pi-accounts.tsx +71 -170
  694. package/src/components/settings/principal-list.tsx +172 -0
  695. package/src/components/settings/settings-panel.tsx +245 -19
  696. package/src/components/settings/skills-list.tsx +276 -0
  697. package/src/components/settings/skills-tab.tsx +82 -269
  698. package/src/components/settings/tool-permissions-list.tsx +54 -0
  699. package/src/components/settings/tool-permissions.tsx +27 -46
  700. package/src/components/settings/web-search-chain.tsx +300 -0
  701. package/src/components/settings/web-search-settings.tsx +58 -328
  702. package/src/components/share/share-menu.tsx +19 -4
  703. package/src/components/voice/dictation-sheet.tsx +5 -5
  704. package/src/components/voice/mic-button.tsx +1 -1
  705. package/src/components/voice/review-card.tsx +1 -1
  706. package/src/config.ts +21 -7
  707. package/src/connection.ts +443 -0
  708. package/src/default-root.ts +16 -0
  709. package/src/hooks/use-color-scheme.ts +36 -0
  710. package/src/hooks/use-hash-routes.ts +4 -2
  711. package/src/hooks/use-media-query.ts +32 -0
  712. package/src/hooks/use-share-intake.ts +32 -12
  713. package/src/hooks/use-vpn-status.ts +23 -15
  714. package/src/hooks/use-websocket.ts +12 -426
  715. package/src/hooks/websocket-handlers/activity.ts +4 -5
  716. package/src/hooks/websocket-handlers/chat.ts +26 -5
  717. package/src/hooks/websocket-handlers/connection.ts +4 -6
  718. package/src/hooks/websocket-handlers/mask.ts +2 -3
  719. package/src/hooks/websocket-handlers/provider.ts +4 -6
  720. package/src/hooks/websocket-handlers/types.ts +6 -2
  721. package/src/index.ts +7 -3
  722. package/src/lib/api-client.ts +446 -365
  723. package/src/lib/backend.ts +20 -10
  724. package/src/lib/diff.ts +28 -62
  725. package/src/lib/format-time.ts +20 -0
  726. package/src/lib/light-dark.ts +83 -0
  727. package/src/lib/mermaid-theme.ts +183 -214
  728. package/src/lib/passkeys.ts +12 -4
  729. package/src/lib/push-registration.ts +46 -0
  730. package/src/lib/share-intake.ts +6 -3
  731. package/src/lib/share.ts +7 -4
  732. package/src/lib/single-key.ts +47 -0
  733. package/src/lib/tool-names.ts +31 -8
  734. package/src/root-context.tsx +40 -0
  735. package/src/root.ts +83 -0
  736. package/src/stores/activity-state.ts +295 -0
  737. package/src/stores/activity-store.ts +11 -285
  738. package/src/stores/chat-state.ts +795 -0
  739. package/src/stores/chat-store.ts +11 -705
  740. package/src/stores/connection-state.ts +78 -0
  741. package/src/stores/connection-store.ts +11 -76
  742. package/src/stores/create-stores.ts +31 -0
  743. package/src/stores/file-state.ts +399 -0
  744. package/src/stores/file-store.ts +9 -360
  745. package/src/stores/graph-state.ts +368 -0
  746. package/src/stores/graph-store.ts +10 -355
  747. package/src/stores/mask-state.ts +30 -0
  748. package/src/stores/mask-store.ts +10 -27
  749. package/src/stores/principal-state.ts +42 -0
  750. package/src/stores/principal-store.ts +11 -0
  751. package/src/stores/provider-state.ts +103 -0
  752. package/src/stores/provider-store.ts +10 -95
  753. package/src/stores/share-state.ts +56 -0
  754. package/src/stores/share-store.ts +11 -54
  755. package/src/stores/store-environment.ts +10 -0
  756. package/src/stores/ui-state.ts +143 -0
  757. package/src/stores/ui-store.ts +11 -93
  758. package/src/styles.css +4 -1
  759. package/src/theme.css +150 -97
  760. package/src/voice/asr-clients.ts +17 -17
  761. package/src/voice/use-dictation.ts +11 -8
  762. package/src/voice/voice-state.ts +57 -0
  763. package/src/voice/voice-store.ts +11 -55
@@ -1,185 +1,244 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { uiConfig } from "../../config.js";
3
- import { useState, useEffect, useRef, useMemo } from "react";
4
- import { Check, X, MessageCircleQuestion, ChevronRight, ChevronUp, } from "lucide-react";
2
+ /**
3
+ * The `ask_user` exchange, one kit `AskUserCard` per question (D38 §1).
4
+ *
5
+ * An exchange is not a tool card. It has four states and all four stay in
6
+ * the transcript at full contrast — nothing rolls up or fades, because a
7
+ * question the agent asked is part of the record whichever way it was
8
+ * answered:
9
+ *
10
+ * `pending` — the options, one focus stop, Submit / Dismiss. "Other"
11
+ * opens the kit's free-text field in place of the Submit row:
12
+ * a typed alternative is the same exchange, not a new one.
13
+ * `answered` — the chosen answer in mono teal, with when. The alternatives
14
+ * are GONE, not dimmed: they were never the record. A
15
+ * multi-select lists every choice as its own row.
16
+ * `typed` — the user answered in the composer instead. The card quotes
17
+ * what it took, under a neutral border.
18
+ * `dismissed` — the question the turn outlived, in gold (seventh drop,
19
+ * ruling 7): no options, a lapsed row stating the fact, and
20
+ * "Ask again". The server-side request is already resolved,
21
+ * so asking again reopens the card LOCALLY to pending, and a
22
+ * submit from a reopened card goes out as a normal composer
23
+ * message quoting the question and the chosen answer(s)
24
+ * (`onReask`) rather than as an `ask_user_response` nobody is
25
+ * waiting for. No `onReask`, no button (D20).
26
+ *
27
+ * Multi-select questions ride the same kit card with `multi` (ruling 6): the
28
+ * options are `ChoiceOption multiple` — checkbox role, square mark — inside a
29
+ * `role="group"`, and "Other" toggles like any other row. The exchange's
30
+ * answers are keyed by question text and submitted together, so the action
31
+ * row sits on the LAST question's card and gathers every question's
32
+ * selection.
33
+ */
34
+ import { useBrainUiRoot } from "../../root-context.js";
35
+ import { useEffect, useRef, useState } from "react";
36
+ import { AskUserCard as KitAskUserCard, Surface, } from "@schlessera/brain-ui-kit";
5
37
  import { BrainMarkdown } from "./brain-markdown.js";
6
- import { cn } from "../../lib/utils.js";
38
+ import { formatRelativeTime } from "../../lib/format-time.js";
39
+ import { reaskMessage } from "./ask-user-typed.js";
7
40
  const OTHER_LABEL = "Other";
41
+ /** A multi-select's picks travel as one string; this is the seam. */
42
+ const MULTI_JOIN = ", ";
8
43
  function defaultState() {
9
- return { selected: [], otherText: "", focusedIndex: null };
44
+ return { selected: [], otherOpen: false, otherText: "", focused: null };
10
45
  }
11
- export function AskUserCard({ requestId, questions, answered, cancelled, live = false, onSubmit, onCancel, }) {
12
- // Independent per-question state
46
+ /** The preview to show for a question: the focused option's, else the single
47
+ * chosen one's. `preview` is "content rendered when an option is focused"
48
+ * in the ask_user contract; selection is the fallback once focus has moved on. */
49
+ export function previewFor(question, state) {
50
+ const focused = state.focused ? question.options.find((o) => o.label === state.focused) : undefined;
51
+ if (focused?.preview)
52
+ return focused.preview;
53
+ if (state.selected.length === 1 && state.selected[0] !== OTHER_LABEL) {
54
+ return question.options.find((o) => o.label === state.selected[0])?.preview;
55
+ }
56
+ return undefined;
57
+ }
58
+ /** The answer the exchange recorded for one question, as the card shows it. */
59
+ export function recordedAnswer(question, answers) {
60
+ return answers?.[question.question] ?? "";
61
+ }
62
+ /**
63
+ * The recorded answer as the rows the card lists: one for a single-select,
64
+ * one per pick for a multi-select. The picks were joined by this module, so
65
+ * splitting on the same seam is the inverse of its own encoding — a label
66
+ * that itself contains ", " is the one case it cannot tell apart.
67
+ */
68
+ export function recordedAnswers(question, answers) {
69
+ const answer = recordedAnswer(question, answers);
70
+ if (!question.multiSelect)
71
+ return [answer];
72
+ return answer.split(MULTI_JOIN).filter((a) => a.length > 0);
73
+ }
74
+ /** "you chose this · 3m ago", "you chose 2 · 3m ago", or without the time
75
+ * when none is known. */
76
+ export function answeredMeta(answeredAt, count = 1) {
77
+ const chose = count > 1 ? `you chose ${count}` : "you chose this";
78
+ return answeredAt === undefined ? chose : `${chose} · ${formatRelativeTime(answeredAt)}`;
79
+ }
80
+ export const TYPED_META = "taken from your next message";
81
+ /** The typed answer is the user's own words, so the card quotes them. */
82
+ export function quoted(text) {
83
+ return text ? `\u201C${text}\u201D` : "";
84
+ }
85
+ /** The lapsed row on a dismissed card: what happened, in the app's terms. */
86
+ export const DISMISSED_NOTE = "dismissed · the agent got no answer";
87
+ export function AskUserCard({ requestId, questions, answered, cancelled, typed, answeredAt, onSubmit, onCancel, onReask, }) {
88
+ const root = useBrainUiRoot();
89
+ const prompt = `${root.config.assistantName} needs your input`;
13
90
  const [state, setState] = useState(() => questions.map(() => defaultState()));
14
- // Once answered/dismissed, the card rolls up to a one-line summary that
15
- // scrolls away with the rest of the turn. It stays open while unanswered
16
- // (it's an active prompt) and re-collapses when the streaming turn ends.
17
- const [collapsed, setCollapsed] = useState(true);
18
- const prevLive = useRef(live);
19
- useEffect(() => {
20
- if (prevLive.current && !live)
21
- setCollapsed(true);
22
- prevLive.current = live;
23
- }, [live]);
24
- // Re-initialise if the question set changes (new requestId arriving)
91
+ // "Ask again" on a dismissed card: pending again, locally.
92
+ const [reopened, setReopened] = useState(false);
93
+ // Re-initialise if the question set changes (new requestId arriving).
25
94
  const lastRequestId = useRef(requestId);
26
95
  useEffect(() => {
27
96
  if (lastRequestId.current !== requestId) {
28
97
  lastRequestId.current = requestId;
29
98
  setState(questions.map(() => defaultState()));
99
+ setReopened(false);
30
100
  }
31
101
  }, [requestId, questions]);
32
- // If we already have answers (from prior submit), force-fill state for display
33
- const lockedAnswers = answered ?? null;
34
- const isLocked = !!lockedAnswers || !!cancelled;
35
- const filledState = useMemo(() => {
36
- if (!lockedAnswers)
37
- return state;
38
- return questions.map((q) => {
39
- const raw = lockedAnswers[q.question] ?? "";
40
- const labels = q.multiSelect
41
- ? raw
42
- .split(",")
43
- .map((s) => s.trim())
44
- .filter(Boolean)
45
- : raw
46
- ? [raw]
47
- : [];
48
- // If the saved label isn't a known option, treat as "Other"
49
- const knownLabels = new Set(q.options.map((o) => o.label));
50
- const selected = labels.filter((l) => knownLabels.has(l));
51
- const otherLabels = labels.filter((l) => !knownLabels.has(l));
52
- const finalSelected = otherLabels.length
53
- ? [...selected, OTHER_LABEL]
54
- : selected;
55
- return {
56
- selected: finalSelected,
57
- otherText: otherLabels.join(", "),
58
- focusedIndex: null,
59
- };
60
- });
61
- }, [lockedAnswers, questions, state]);
62
- // Collapsed once locked: a compact, expandable summary that behaves like a
63
- // finished tool-timeline row instead of a full card pinned in place.
64
- if (isLocked && collapsed) {
65
- return (_jsx(AskUserSummaryRow, { questions: questions, answers: lockedAnswers, cancelled: !!cancelled, onExpand: () => setCollapsed(false) }));
66
- }
67
- function toggleOption(qi, label) {
102
+ const dismissed = !!cancelled && !answered && !reopened;
103
+ const isLocked = !!answered || dismissed;
104
+ function pick(qi, label) {
68
105
  if (isLocked)
69
106
  return;
70
- setState((prev) => {
71
- const next = prev.map((s, i) => {
72
- if (i !== qi)
73
- return s;
74
- const q = questions[qi];
107
+ setState((prev) => prev.map((s, i) => {
108
+ if (i !== qi)
109
+ return s;
110
+ const q = questions[qi];
111
+ if (label === OTHER_LABEL) {
112
+ // Multi-select: Other toggles like any other row, and opens the
113
+ // field while it is on; single-select: it is the pick.
75
114
  if (q.multiSelect) {
76
- const has = s.selected.includes(label);
77
- return {
78
- ...s,
79
- selected: has
80
- ? s.selected.filter((l) => l !== label)
81
- : [...s.selected, label],
82
- };
115
+ const on = !s.selected.includes(OTHER_LABEL);
116
+ return { ...s, selected: toggled(s.selected, OTHER_LABEL), otherOpen: on };
83
117
  }
84
- return {
85
- ...s,
86
- selected: s.selected[0] === label ? [] : [label],
87
- };
88
- });
89
- return next;
90
- });
118
+ return { ...s, otherOpen: true, selected: [OTHER_LABEL] };
119
+ }
120
+ // Multi-select: Other stays open while it is on — picking another
121
+ // row beside it must not close the field and strand an empty custom
122
+ // answer. Single-select: any other pick replaces Other.
123
+ return {
124
+ ...s,
125
+ otherOpen: q.multiSelect ? s.selected.includes(OTHER_LABEL) : false,
126
+ selected: q.multiSelect
127
+ ? toggled(s.selected, label)
128
+ : s.selected[0] === label
129
+ ? []
130
+ : [label],
131
+ };
132
+ }));
91
133
  }
92
- function setFocus(qi, idx) {
93
- if (isLocked)
94
- return;
95
- setState((prev) => prev.map((s, i) => (i === qi ? { ...s, focusedIndex: idx } : s)));
134
+ function focus(qi, label) {
135
+ setState((prev) => prev.map((s, i) => (i === qi ? { ...s, focused: label } : s)));
96
136
  }
97
- function setOtherText(qi, text) {
98
- if (isLocked)
99
- return;
100
- setState((prev) => prev.map((s, i) => (i === qi ? { ...s, otherText: text } : s)));
137
+ function answerFor(s) {
138
+ return s.selected.flatMap((label) => label === OTHER_LABEL ? (s.otherText.trim() ? [s.otherText.trim()] : []) : [label]);
101
139
  }
102
- const canSubmit = !isLocked && questions.every((_q, i) => {
103
- const s = state[i];
104
- if (s.selected.length === 0)
105
- return false;
106
- if (s.selected.includes(OTHER_LABEL) && !s.otherText.trim())
107
- return false;
108
- return true;
109
- });
110
- function handleSubmit() {
111
- if (!canSubmit)
112
- return;
140
+ const complete = questions.every((_q, i) => answerFor(state[i]).length > 0);
141
+ function submit(override) {
113
142
  const answers = {};
114
143
  const annotations = {};
115
144
  for (let i = 0; i < questions.length; i++) {
116
145
  const q = questions[i];
117
- const s = state[i];
118
- const labels = [];
119
- let usedOther = false;
120
- for (const sel of s.selected) {
121
- if (sel === OTHER_LABEL) {
122
- if (s.otherText.trim())
123
- labels.push(s.otherText.trim());
124
- usedOther = true;
146
+ const s = override && override.qi === i
147
+ ? {
148
+ ...state[i],
149
+ // A multi-select keeps its other picks beside the typed one.
150
+ selected: q.multiSelect
151
+ ? state[i].selected.includes(OTHER_LABEL)
152
+ ? state[i].selected
153
+ : [...state[i].selected, OTHER_LABEL]
154
+ : [OTHER_LABEL],
155
+ otherText: override.text,
125
156
  }
126
- else {
127
- labels.push(sel);
128
- }
129
- }
130
- answers[q.question] = q.multiSelect ? labels.join(", ") : (labels[0] ?? "");
131
- // Capture preview from a single non-other selection for annotations
132
- if (!usedOther && !q.multiSelect && s.selected.length === 1) {
157
+ : state[i];
158
+ const labels = answerFor(s);
159
+ if (labels.length === 0)
160
+ return;
161
+ answers[q.question] = q.multiSelect ? labels.join(MULTI_JOIN) : labels[0];
162
+ // A single chosen option with a preview travels as an annotation, so
163
+ // the agent sees what the user saw.
164
+ if (!q.multiSelect && s.selected.length === 1 && s.selected[0] !== OTHER_LABEL) {
133
165
  const picked = q.options.find((o) => o.label === s.selected[0]);
134
- if (picked?.preview) {
166
+ if (picked?.preview)
135
167
  annotations[q.question] = { preview: picked.preview };
136
- }
137
168
  }
138
169
  }
170
+ if (reopened) {
171
+ // The request is gone server-side; the answer is a message now — and
172
+ // the card closes again, or Submit would send it twice.
173
+ onReask?.(reaskMessage(questions, answers));
174
+ setReopened(false);
175
+ return;
176
+ }
139
177
  onSubmit(requestId, answers, Object.keys(annotations).length ? annotations : undefined);
140
178
  }
141
- function handleCancel() {
142
- onCancel(requestId);
179
+ /**
180
+ * The kit's Other field submitted. With one question that IS the answer;
181
+ * with several, the text is held for that question and the last card's
182
+ * Submit sends everything together.
183
+ */
184
+ function takeOther(qi, text) {
185
+ const trimmed = text.trim();
186
+ if (!trimmed || isLocked)
187
+ return;
188
+ if (questions.length === 1) {
189
+ submit({ qi, text: trimmed });
190
+ return;
191
+ }
192
+ setState((prev) => prev.map((s, i) => (i === qi ? { ...s, otherOpen: false, otherText: trimmed } : s)));
143
193
  }
144
- return (_jsxs("div", { className: "rounded-xl border border-accent/30 bg-surface px-4 py-4 shadow-[0_0_0_1px_rgba(91,181,162,0.08)]", children: [_jsxs("div", { className: "mb-3 flex items-center gap-2 text-xs uppercase tracking-wider text-accent/80", children: [_jsx(MessageCircleQuestion, { className: "h-3.5 w-3.5" }), _jsx("span", { className: "font-[family-name:var(--font-mono)]", children: isLocked
145
- ? cancelled
146
- ? "Dismissed"
147
- : "You answered"
148
- : `${uiConfig.assistantName} needs your input` }), isLocked && (_jsxs("button", { type: "button", onClick: () => setCollapsed(true), className: "ml-auto flex items-center gap-1 text-[11px] normal-case tracking-normal text-muted-foreground/50 transition-colors hover:text-muted-foreground", children: [_jsx(ChevronUp, { className: "h-3 w-3" }), "Collapse"] }))] }), _jsx("div", { className: "space-y-5", children: questions.map((q, qi) => (_jsx(QuestionBlock, { question: q, state: filledState[qi], locked: isLocked, onToggleOption: (label) => toggleOption(qi, label), onFocus: (idx) => setFocus(qi, idx), onOtherChange: (t) => setOtherText(qi, t) }, qi))) }), !isLocked && (_jsxs("div", { className: "mt-4 flex items-center justify-end gap-2", children: [_jsxs("button", { type: "button", onClick: handleCancel, className: "flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-surface-raised hover:text-foreground", children: [_jsx(X, { className: "h-3.5 w-3.5" }), "Dismiss"] }), _jsxs("button", { type: "button", onClick: handleSubmit, disabled: !canSubmit, className: cn("flex items-center gap-1.5 rounded-lg px-4 py-1.5 text-xs font-medium transition-all", canSubmit
149
- ? "bg-accent text-accent-foreground hover:brightness-110"
150
- : "bg-surface-raised text-muted-foreground/40 cursor-not-allowed"), children: [_jsx(Check, { className: "h-3.5 w-3.5" }), "Submit"] })] }))] }));
194
+ return (_jsx("div", { className: "space-y-3", children: questions.map((q, qi) => {
195
+ const isLast = qi === questions.length - 1;
196
+ const id = `${requestId}-${qi}`;
197
+ if (answered) {
198
+ const answers = recordedAnswers(q, answered);
199
+ return (_jsx(KitAskUserCard, { id: id, state: typed ? "typed" : "answered", multi: q.multiSelect, tag: q.header, question: q.question, options: [], showActions: false,
200
+ // The kit prints the answers as given; a typed one is a quote.
201
+ answers: typed ? [quoted(recordedAnswer(q, answered))] : answers, answerMeta: typed ? TYPED_META : answeredMeta(answeredAt, answers.length) }, id));
202
+ }
203
+ if (dismissed) {
204
+ return (_jsx(KitAskUserCard, { id: id, state: "dismissed", multi: q.multiSelect, tag: q.header, question: q.question, options: [], showActions: false, lapsedNote: DISMISSED_NOTE,
205
+ // One "Ask again" per exchange, on the last card, like Submit.
206
+ onAskAgain: onReask && isLast ? () => setReopened(true) : undefined }, id));
207
+ }
208
+ const s = state[qi];
209
+ const preview = previewFor(q, s);
210
+ const options = [
211
+ ...q.options.map((o) => ({
212
+ title: o.label,
213
+ subtitle: o.description,
214
+ selected: s.selected.includes(o.label),
215
+ onClick: () => pick(qi, o.label),
216
+ onFocus: () => focus(qi, o.label),
217
+ })),
218
+ {
219
+ title: OTHER_LABEL,
220
+ subtitle: s.otherText || "Provide a custom answer.",
221
+ italic: !s.otherText,
222
+ dim: !s.otherText,
223
+ selected: s.selected.includes(OTHER_LABEL),
224
+ onClick: () => pick(qi, OTHER_LABEL),
225
+ onFocus: () => focus(qi, null),
226
+ },
227
+ ];
228
+ return (_jsxs("div", { className: "space-y-2", children: [_jsx(KitAskUserCard, { id: id, state: "pending", multi: q.multiSelect, prompt: prompt, tag: q.header, question: q.question, options: options, otherOpen: s.otherOpen, otherPlaceholder: "Type your answer\u2026", onOtherSubmit: (text) => takeOther(qi, text), showActions: isLast,
229
+ // The kit's action row cannot be disabled from here; an
230
+ // incomplete Submit is a no-op rather than a partial answer.
231
+ onPrimary: () => (complete ? submit() : undefined),
232
+ // A reopened card's Dismiss closes it again locally: there is
233
+ // no server-side request left to cancel.
234
+ onSecondary: () => (reopened ? setReopened(false) : onCancel(requestId)) }), preview ? _jsx(PreviewPane, { content: preview }) : null] }, id));
235
+ }) }));
151
236
  }
152
- /** One-line, expandable stand-in for an answered/dismissed question. */
153
- function AskUserSummaryRow({ questions, answers, cancelled, onExpand, }) {
154
- const detail = cancelled
155
- ? "Dismissed"
156
- : questions
157
- .map((q) => {
158
- const a = answers?.[q.question];
159
- return a ? `${q.header}: ${a}` : q.header;
160
- })
161
- .join(" · ");
162
- return (_jsxs("button", { type: "button", onClick: onExpand, className: "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-xs text-muted-foreground/70 transition-colors hover:text-foreground", children: [_jsx(MessageCircleQuestion, { className: "h-3.5 w-3.5 shrink-0 text-accent/70" }), _jsxs("span", { className: "min-w-0 truncate font-[family-name:var(--font-mono)]", children: [!cancelled && _jsx("span", { className: "text-accent/70", children: "Answered \u00B7 " }), detail] }), _jsx(ChevronRight, { className: "h-3 w-3 shrink-0" })] }));
237
+ function toggled(list, label) {
238
+ return list.includes(label) ? list.filter((l) => l !== label) : [...list, label];
163
239
  }
164
- function QuestionBlock({ question, state, locked, onToggleOption, onFocus, onOtherChange, }) {
165
- const optionsWithOther = [
166
- ...question.options,
167
- { label: OTHER_LABEL, description: "Provide a custom answer.", isOther: true },
168
- ];
169
- const focusedOption = state.focusedIndex !== null ? optionsWithOther[state.focusedIndex] : null;
170
- const previewToShow = focusedOption?.preview ??
171
- (state.selected.length === 1 && !state.selected.includes(OTHER_LABEL)
172
- ? question.options.find((o) => o.label === state.selected[0])?.preview
173
- : undefined);
174
- return (_jsxs("div", { children: [_jsxs("div", { className: "mb-2 flex items-center gap-2", children: [_jsx("span", { className: "rounded-md border border-accent/30 bg-accent/10 px-2 py-0.5 font-[family-name:var(--font-mono)] text-[10px] uppercase tracking-wider text-accent", children: question.header }), question.multiSelect && (_jsx("span", { className: "text-[10px] uppercase tracking-wider text-muted-foreground/60", children: "multi-select" }))] }), _jsx("div", { className: "mb-3 text-sm leading-relaxed text-foreground", children: question.question }), _jsxs("div", { className: "grid gap-2 md:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]", children: [_jsx("ul", { className: "space-y-1.5", children: optionsWithOther.map((opt, idx) => {
175
- const selected = state.selected.includes(opt.label);
176
- return (_jsxs("li", { children: [_jsxs("button", { type: "button", onClick: () => onToggleOption(opt.label), onMouseEnter: () => onFocus(idx), onFocus: () => onFocus(idx), disabled: locked, className: cn("group flex w-full items-start gap-2 rounded-lg border px-3 py-2 text-left transition-colors", selected
177
- ? "border-accent/60 bg-accent/10"
178
- : "border-border bg-background hover:bg-surface-raised", locked && "cursor-default opacity-90"), children: [_jsx("span", { className: cn("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded border", question.multiSelect ? "rounded-sm" : "rounded-full", selected
179
- ? "border-accent bg-accent text-accent-foreground"
180
- : "border-border bg-background"), children: selected && _jsx(Check, { className: "h-3 w-3" }) }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: cn("block text-sm font-medium", opt.isOther
181
- ? "italic text-muted-foreground group-hover:text-foreground"
182
- : "text-foreground"), children: opt.label }), opt.description && (_jsx("span", { className: "block text-xs leading-snug text-muted-foreground", children: opt.description }))] })] }), opt.isOther && state.selected.includes(OTHER_LABEL) && (_jsx("textarea", { value: state.otherText, onChange: (e) => onOtherChange(e.target.value), disabled: locked, placeholder: "Type your answer...", rows: 2, className: "mt-1.5 w-full resize-none rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/40 focus:border-accent/60 focus:outline-none" }))] }, opt.label));
183
- }) }), previewToShow && (_jsx("div", { className: "hidden min-w-0 md:block", children: _jsxs("div", { className: "rounded-lg border border-border bg-background p-3", children: [_jsx("div", { className: "mb-1 text-[10px] uppercase tracking-wider text-muted-foreground/60 font-[family-name:var(--font-mono)]", children: "Preview" }), _jsx(BrainMarkdown, { content: previewToShow, className: "brain-prose text-xs" })] }) }))] }), previewToShow && (_jsx("div", { className: "mt-2 md:hidden", children: _jsxs("details", { className: "rounded-lg border border-border bg-background", children: [_jsx("summary", { className: "cursor-pointer px-3 py-2 text-[11px] uppercase tracking-wider text-muted-foreground", children: "Preview" }), _jsx("div", { className: "border-t border-border px-3 py-2", children: _jsx(BrainMarkdown, { content: previewToShow, className: "brain-prose text-xs" }) })] }) }))] }));
240
+ /** The focused (else chosen) option's preview, under the question it belongs to. */
241
+ function PreviewPane({ content }) {
242
+ return (_jsx(Surface, { label: "Preview", labelIcon: "file", pad: 10, children: _jsx(BrainMarkdown, { content: content, className: "brain-prose text-xs" }) }));
184
243
  }
185
244
  //# sourceMappingURL=ask-user-card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ask-user-card.js","sourceRoot":"","sources":["../../../src/components/chat/ask-user-card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EACL,KAAK,EACL,CAAC,EACD,qBAAqB,EACrB,YAAY,EACZ,SAAS,GACV,MAAM,cAAc,CAAC;AAMtB,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC,MAAM,WAAW,GAAG,OAAO,CAAC;AAW5B,SAAS,YAAY;IACnB,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EAC1B,SAAS,EACT,SAAS,EACT,QAAQ,EACR,SAAS,EACT,IAAI,GAAG,KAAK,EACZ,QAAQ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AAC,KAAK,CAAC,EAC9C,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAC,qBAAqB,EACjC,IAAI,EAAE,CAAC,EACP,SAAS,EAAC,0LAA0L,GACpM,CACH,KArDM,GAAG,CAAC,KAAK,CAsDb,CACN,CAAC;wBACJ,CAAC,CAAC,GACC,EAEJ,aAAa,IAAI,CAChB,cAAK,SAAS,EAAC,yBAAyB,YACtC,eAAK,SAAS,EAAC,mDAAmD,aAChE,cAAK,SAAS,EAAC,wGAAwG,wBAEjH,EACN,KAAC,aAAa,IACZ,OAAO,EAAE,aAAa,EACtB,SAAS,EAAC,qBAAqB,GAC/B,IACE,GACF,CACP,IACG,EAGL,aAAa,IAAI,CAChB,cAAK,SAAS,EAAC,gBAAgB,YAC7B,mBAAS,SAAS,EAAC,+CAA+C,aAChE,kBAAS,SAAS,EAAC,qFAAqF,wBAE9F,EACV,cAAK,SAAS,EAAC,kCAAkC,YAC/C,KAAC,aAAa,IACZ,OAAO,EAAE,aAAa,EACtB,SAAS,EAAC,qBAAqB,GAC/B,GACE,IACE,GACN,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"ask-user-card.js","sourceRoot":"","sources":["../../../src/components/chat/ask-user-card.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EACL,WAAW,IAAI,cAAc,EAC7B,OAAO,GAER,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,WAAW,GAAG,OAAO,CAAC;AAE5B,q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C,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC;AACnF,CAAC;AAED,oFAAoF;AACpF,SAAS,WAAW,CAAC,EAAE,OAAO,EAAuB;IACnD,OAAO,CACL,KAAC,OAAO,IAAC,KAAK,EAAC,SAAS,EAAC,SAAS,EAAC,MAAM,EAAC,GAAG,EAAE,EAAE,YAC/C,KAAC,aAAa,IAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAC,qBAAqB,GAAG,GAC3D,CACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The typed answer (D38 §1): a composer send while an `ask_user` question is
3
+ * pending is the answer to that question, not a new message.
4
+ *
5
+ * The exchange is submitted through the same path the card's Submit uses —
6
+ * the store records the answers and the socket carries `ask_user_response` —
7
+ * with one difference: the exchange is marked `typed`, so the card quotes the
8
+ * text it took instead of showing a chosen option. Dropping the card would
9
+ * leave the transcript claiming the question was never answered; leaving it
10
+ * pending would ask twice.
11
+ */
12
+ import type { AskUserQuestion, ClientMessage } from "@schlessera/brain-ui-sdk/protocol";
13
+ import type { AskUserExchange, ChatKey, ChatState } from "../../stores/chat-state.js";
14
+ /** A request the user has neither answered nor dismissed. */
15
+ export declare function isPendingExchange(exchange: AskUserExchange | null | undefined): exchange is AskUserExchange;
16
+ /**
17
+ * The question the composer text answers — only when the exchange has exactly
18
+ * one. Answers are submitted for the whole exchange at once and the server
19
+ * resolves the request on the first response, so binding a typed reply to
20
+ * question one of several would leave the others blank and unanswerable. A
21
+ * multi-question prompt keeps the cards' own Submit; the composer text is an
22
+ * ordinary message.
23
+ */
24
+ export declare function questionForTypedAnswer(exchange: AskUserExchange): AskUserQuestion | null;
25
+ /**
26
+ * Binds `text` to the buffer's pending question, if there is one. Returns
27
+ * `true` when the text was consumed as an answer — the caller must then NOT
28
+ * send it as a chat message — and `false` when nothing was pending.
29
+ */
30
+ export declare function takeComposerTextAsAnswer(chat: Pick<ChatState, "submitAskUserAnswers"> & {
31
+ buffers: ChatState["buffers"];
32
+ draft: ChatState["draft"];
33
+ }, key: ChatKey, text: string, send: (message: ClientMessage) => void): boolean;
34
+ /**
35
+ * The composer message a reopened (dismissed, then "Ask again") card sends
36
+ * in place of an `ask_user_response`: the server resolved the request when
37
+ * the turn ended, so the answer has to travel as a normal message that
38
+ * quotes the question it answers. One block per question, the picks as
39
+ * they were recorded.
40
+ */
41
+ export declare function reaskMessage(questions: readonly Pick<AskUserQuestion, "question">[], answers: Record<string, string>): string;
42
+ //# sourceMappingURL=ask-user-typed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ask-user-typed.d.ts","sourceRoot":"","sources":["../../../src/components/chat/ask-user-typed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACxF,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEtF,6DAA6D;AAC7D,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,GAC3C,QAAQ,IAAI,eAAe,CAE7B;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,eAAe,GAAG,eAAe,GAAG,IAAI,CAExF;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,sBAAsB,CAAC,GAAG;IAC9C,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC9B,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;CAC3B,EACD,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,GACrC,OAAO,CAaT;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,SAAS,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,EAAE,EACvD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B,MAAM,CAIR"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * The typed answer (D38 §1): a composer send while an `ask_user` question is
3
+ * pending is the answer to that question, not a new message.
4
+ *
5
+ * The exchange is submitted through the same path the card's Submit uses —
6
+ * the store records the answers and the socket carries `ask_user_response` —
7
+ * with one difference: the exchange is marked `typed`, so the card quotes the
8
+ * text it took instead of showing a chosen option. Dropping the card would
9
+ * leave the transcript claiming the question was never answered; leaving it
10
+ * pending would ask twice.
11
+ */
12
+ /** A request the user has neither answered nor dismissed. */
13
+ export function isPendingExchange(exchange) {
14
+ return !!exchange && !exchange.answers && !exchange.cancelled;
15
+ }
16
+ /**
17
+ * The question the composer text answers — only when the exchange has exactly
18
+ * one. Answers are submitted for the whole exchange at once and the server
19
+ * resolves the request on the first response, so binding a typed reply to
20
+ * question one of several would leave the others blank and unanswerable. A
21
+ * multi-question prompt keeps the cards' own Submit; the composer text is an
22
+ * ordinary message.
23
+ */
24
+ export function questionForTypedAnswer(exchange) {
25
+ return exchange.questions.length === 1 ? exchange.questions[0] : null;
26
+ }
27
+ /**
28
+ * Binds `text` to the buffer's pending question, if there is one. Returns
29
+ * `true` when the text was consumed as an answer — the caller must then NOT
30
+ * send it as a chat message — and `false` when nothing was pending.
31
+ */
32
+ export function takeComposerTextAsAnswer(chat, key, text, send) {
33
+ const buffer = key === null ? chat.draft : chat.buffers[key];
34
+ const exchange = buffer?.askUser;
35
+ if (!isPendingExchange(exchange))
36
+ return false;
37
+ const question = questionForTypedAnswer(exchange);
38
+ if (!question)
39
+ return false;
40
+ const answer = text.trim();
41
+ if (!answer)
42
+ return false;
43
+ const answers = { [question.question]: answer };
44
+ chat.submitAskUserAnswers(key, exchange.requestId, answers, undefined, true);
45
+ send({ type: "ask_user_response", requestId: exchange.requestId, answers });
46
+ return true;
47
+ }
48
+ /**
49
+ * The composer message a reopened (dismissed, then "Ask again") card sends
50
+ * in place of an `ask_user_response`: the server resolved the request when
51
+ * the turn ended, so the answer has to travel as a normal message that
52
+ * quotes the question it answers. One block per question, the picks as
53
+ * they were recorded.
54
+ */
55
+ export function reaskMessage(questions, answers) {
56
+ return questions
57
+ .map((q) => `Answering \u201C${q.question}\u201D: ${answers[q.question] ?? ""}`)
58
+ .join("\n\n");
59
+ }
60
+ //# sourceMappingURL=ask-user-typed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ask-user-typed.js","sourceRoot":"","sources":["../../../src/components/chat/ask-user-typed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,6DAA6D;AAC7D,MAAM,UAAU,iBAAiB,CAC/B,QAA4C;IAE5C,OAAO,CAAC,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;AAChE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAyB;IAC9D,OAAO,QAAQ,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACzE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CACtC,IAGC,EACD,GAAY,EACZ,IAAY,EACZ,IAAsC;IAEtC,MAAM,MAAM,GAAG,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7D,MAAM,QAAQ,GAAG,MAAM,EAAE,OAAO,CAAC;IACjC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC;QAAE,OAAO,KAAK,CAAC;IAC/C,MAAM,QAAQ,GAAG,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IAClD,IAAI,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC3B,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAE1B,MAAM,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAChD,IAAI,CAAC,oBAAoB,CAAC,GAAG,EAAE,QAAQ,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IAC7E,IAAI,CAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,SAAS,EAAE,QAAQ,CAAC,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;IAC5E,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAC1B,SAAuD,EACvD,OAA+B;IAE/B,OAAO,SAAS;SACb,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,mBAAmB,CAAC,CAAC,QAAQ,WAAW,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;SAC/E,IAAI,CAAC,MAAM,CAAC,CAAC;AAClB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import type { BrainUiRoot } from "../../root.js";
2
3
  /**
3
4
  * Turn a markdown image source into something the browser can actually load.
4
5
  *
@@ -6,7 +7,7 @@ import React from "react";
6
7
  * already an API route — passes through. A repo-relative path is rewritten to
7
8
  * the files endpoint, which is where brain content is served from.
8
9
  */
9
- export declare function repoImageSrc(src: string): string;
10
+ export declare function repoImageSrc(src: string, root: BrainUiRoot): string;
10
11
  /** Click target for a repo-relative file reference. Opens the file panel + viewer. */
11
12
  export declare function FileLink({ path, children }: {
12
13
  path: string;
@@ -1 +1 @@
1
- {"version":3,"file":"brain-markdown-links.d.ts","sourceRoot":"","sources":["../../../src/components/chat/brain-markdown-links.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAOhD;AACD,sFAAsF;AACtF,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,qBAiBxF;AAsBD,sDAAsD;AACtD,wBAAgB,QAAQ,CAAC,EACvB,MAAM,EACN,KAAK,GACN,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,qBAkCA;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,qBAmBvF;AAyED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,EAAE,CA6BrE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAK1D"}
1
+ {"version":3,"file":"brain-markdown-links.d.ts","sourceRoot":"","sources":["../../../src/components/chat/brain-markdown-links.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAQjD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,MAAM,CAOnE;AACD,sFAAsF;AACtF,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,qBAiBxF;AAsBD,sDAAsD;AACtD,wBAAgB,QAAQ,CAAC,EACvB,MAAM,EACN,KAAK,GACN,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,qBAkCA;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,qBAmBvF;AAyED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,EAAE,CA6BrE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAK1D"}
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { apiBase } from "../../lib/backend.js";
3
2
  import { isInternalRepoDir, isInternalRepoPath, useFileStore, } from "../../stores/file-store.js";
4
3
  import { useUIStore } from "../../stores/ui-store.js";
5
4
  /**
@@ -9,16 +8,16 @@ import { useUIStore } from "../../stores/ui-store.js";
9
8
  * already an API route — passes through. A repo-relative path is rewritten to
10
9
  * the files endpoint, which is where brain content is served from.
11
10
  */
12
- export function repoImageSrc(src) {
11
+ export function repoImageSrc(src, root) {
13
12
  const trimmed = src.trim();
14
13
  if (!trimmed)
15
14
  return src;
16
15
  if (/^(data:|blob:|https?:\/\/)/i.test(trimmed))
17
16
  return trimmed;
18
17
  if (trimmed.startsWith("/api/"))
19
- return trimmed;
18
+ return root.backendUrl(trimmed);
20
19
  const rel = trimmed.replace(/^\.\//, "").replace(/^\/+/, "");
21
- return `${apiBase()}/files/content?path=${encodeURIComponent(rel)}&raw=1`;
20
+ return `${root.apiBase()}/files/content?path=${encodeURIComponent(rel)}&raw=1`;
22
21
  }
23
22
  /** Click target for a repo-relative file reference. Opens the file panel + viewer. */
24
23
  export function FileLink({ path, children }) {