@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 +1 @@
1
- {"version":3,"file":"tool-call-timeline.js","sourceRoot":"","sources":["../../../src/components/chat/tool-call-timeline.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EACL,KAAK,EACL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,WAAW,EACX,YAAY,EACZ,aAAa,EACb,QAAQ,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAsB,MAAM,iCAAiC,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAiB,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAA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
+ * The `show_block` result: one of the kit's answer blocks, drawn inline (D41).
3
+ *
4
+ * A switch typed by the contract's payload, handing each variant to its kit
5
+ * component. That typing is the drift check the contract promised: a schema
6
+ * field the kit does not accept fails here, and the kit's own tone unions are
7
+ * asserted equal to the schema's lists in `tests/block-contract.test-d.ts`.
8
+ *
9
+ * Icons come from the model as strings; the kit's `Icon` renders an empty
10
+ * box for a key it does not know, so unknown keys are dropped before the
11
+ * prop is handed on. Optional TEXT props are the other translation: the kit
12
+ * ports the design's demo defaults, so a `QuoteCard` with no `source` names
13
+ * a forecast from the Odysseus fixture world and a `ContactCard` with no
14
+ * `label` is Penelope, and omitted `facts` or `ticks` draw a demo list. Each
15
+ * of those components honours an empty string or an empty array as
16
+ * "cleared", so an omitted field is handed on as `""` or `[]` rather than
17
+ * `undefined`. Everything else is passed through untouched: the schema
18
+ * already rejected what the kit cannot draw.
19
+ */
20
+ import { type IconName } from "@schlessera/brain-ui-kit";
21
+ import type { ShowBlockPayload } from "@schlessera/brain-ui-sdk/client";
22
+ /** A kit icon key, or nothing when the model named one the kit lacks. */
23
+ export declare function kitIcon(name: string | undefined): IconName | undefined;
24
+ /** The collapsed one-liner for the trace: `comparison · 3 columns · 4 rows`. */
25
+ export declare function blockSummary({ block }: ShowBlockPayload): string;
26
+ /** Bound to `SHOW_BLOCK_CONTRACT`; receives the parsed payload as props. */
27
+ export declare function BlockCard({ block }: ShowBlockPayload): import("react").JSX.Element;
28
+ //# sourceMappingURL=block-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block-card.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/tool-cards/block-card.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAaL,KAAK,QAAQ,EACd,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAS,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAE/E,yEAAyE;AACzE,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAKtE;AAKD,gFAAgF;AAChF,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,EAAE,gBAAgB,GAAG,MAAM,CA0BhE;AA8DD,4EAA4E;AAC5E,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE,gBAAgB,+BAMpD"}
@@ -0,0 +1,103 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * The `show_block` result: one of the kit's answer blocks, drawn inline (D41).
4
+ *
5
+ * A switch typed by the contract's payload, handing each variant to its kit
6
+ * component. That typing is the drift check the contract promised: a schema
7
+ * field the kit does not accept fails here, and the kit's own tone unions are
8
+ * asserted equal to the schema's lists in `tests/block-contract.test-d.ts`.
9
+ *
10
+ * Icons come from the model as strings; the kit's `Icon` renders an empty
11
+ * box for a key it does not know, so unknown keys are dropped before the
12
+ * prop is handed on. Optional TEXT props are the other translation: the kit
13
+ * ports the design's demo defaults, so a `QuoteCard` with no `source` names
14
+ * a forecast from the Odysseus fixture world and a `ContactCard` with no
15
+ * `label` is Penelope, and omitted `facts` or `ticks` draw a demo list. Each
16
+ * of those components honours an empty string or an empty array as
17
+ * "cleared", so an omitted field is handed on as `""` or `[]` rather than
18
+ * `undefined`. Everything else is passed through untouched: the schema
19
+ * already rejected what the kit cannot draw.
20
+ */
21
+ import { BarList, ComparisonTable, ContactCard, DataTable, ICONS, QuoteCard, Receipt, ScheduleList, StatTiles, StepList, TimelineList, TrendChart, } from "@schlessera/brain-ui-kit";
22
+ /** A kit icon key, or nothing when the model named one the kit lacks. */
23
+ export function kitIcon(name) {
24
+ // An own-property check: `"constructor" in ICONS` is true through the
25
+ // prototype, and the kit would then try to render a function that is not
26
+ // a component.
27
+ return name !== undefined && Object.hasOwn(ICONS, name) ? name : undefined;
28
+ }
29
+ /** An omitted optional text prop, cleared rather than left to the kit's demo default. */
30
+ const text = (value) => value ?? "";
31
+ /** The collapsed one-liner for the trace: `comparison · 3 columns · 4 rows`. */
32
+ export function blockSummary({ block }) {
33
+ const count = (n, noun) => `${n} ${noun}${n === 1 ? "" : "s"}`;
34
+ switch (block.kind) {
35
+ case "comparison":
36
+ return `comparison · ${count(block.columns.length, "column")} · ${count(block.rows.length, "row")}`;
37
+ case "stats":
38
+ return `stats · ${count(block.tiles.length, "tile")}`;
39
+ case "trend":
40
+ return `trend · ${block.label ?? block.value ?? count(block.values.length, "point")}`;
41
+ case "table":
42
+ return `table · ${count(block.columns.length, "column")} · ${count(block.rows.length, "row")}`;
43
+ case "bars":
44
+ return `bars · ${count(block.rows.length, "row")}`;
45
+ case "receipt":
46
+ return `receipt · ${block.title ?? count(block.rows.length, "row")}`;
47
+ case "steps":
48
+ return `steps · ${count(block.steps.length, "step")}`;
49
+ case "timeline":
50
+ return `timeline · ${count(block.items.length, "event")}`;
51
+ case "schedule":
52
+ return `schedule · ${count(block.groups.length, "day")}`;
53
+ case "quote":
54
+ return `quote · ${block.source ?? "unattributed"}`;
55
+ case "contact":
56
+ return `contact · ${block.label}`;
57
+ }
58
+ }
59
+ function BlockView({ block }) {
60
+ switch (block.kind) {
61
+ case "comparison": {
62
+ const { kind: _kind, footnote, ...props } = block;
63
+ return _jsx(ComparisonTable, { ...props, footnote: text(footnote) });
64
+ }
65
+ case "stats":
66
+ return (_jsx(StatTiles, { tiles: block.tiles.map((tile) => ({ ...tile, icon: kitIcon(tile.icon) })) }));
67
+ case "trend": {
68
+ const { kind: _kind, label, value, ticks, ...props } = block;
69
+ return _jsx(TrendChart, { ...props, label: text(label), value: text(value), ticks: ticks ?? [] });
70
+ }
71
+ case "table": {
72
+ const { kind: _kind, ...props } = block;
73
+ return _jsx(DataTable, { ...props });
74
+ }
75
+ case "bars":
76
+ return _jsx(BarList, { rows: block.rows });
77
+ case "receipt": {
78
+ const { kind: _kind, title, titleIcon, footnote, ...props } = block;
79
+ return (_jsx(Receipt, { ...props, title: text(title), titleIcon: kitIcon(titleIcon), footnote: text(footnote) }));
80
+ }
81
+ case "steps": {
82
+ const { kind: _kind, ...props } = block;
83
+ return _jsx(StepList, { ...props });
84
+ }
85
+ case "timeline":
86
+ return _jsx(TimelineList, { items: block.items });
87
+ case "schedule":
88
+ return _jsx(ScheduleList, { groups: block.groups });
89
+ case "quote": {
90
+ const { kind: _kind, icon, source, locator, note, ...props } = block;
91
+ return (_jsx(QuoteCard, { ...props, source: text(source), locator: text(locator), note: text(note), icon: kitIcon(icon) }));
92
+ }
93
+ case "contact": {
94
+ const { kind: _kind, contactKind, role, facts, ...props } = block;
95
+ return _jsx(ContactCard, { ...props, kind: contactKind, role: text(role), facts: facts ?? [] });
96
+ }
97
+ }
98
+ }
99
+ /** Bound to `SHOW_BLOCK_CONTRACT`; receives the parsed payload as props. */
100
+ export function BlockCard({ block }) {
101
+ return (_jsx("div", { "data-block": block.kind, children: _jsx(BlockView, { block: block }) }));
102
+ }
103
+ //# sourceMappingURL=block-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block-card.js","sourceRoot":"","sources":["../../../../src/components/chat/tool-cards/block-card.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EACL,OAAO,EACP,eAAe,EACf,WAAW,EACX,SAAS,EACT,KAAK,EACL,SAAS,EACT,OAAO,EACP,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,UAAU,GAEX,MAAM,0BAA0B,CAAC;AAGlC,yEAAyE;AACzE,MAAM,UAAU,OAAO,CAAC,IAAwB;IAC9C,sEAAsE;IACtE,yEAAyE;IACzE,eAAe;IACf,OAAO,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAE,IAAiB,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3F,CAAC;AAED,yFAAyF;AACzF,MAAM,IAAI,GAAG,CAAC,KAAyB,EAAU,EAAE,CAAC,KAAK,IAAI,EAAE,CA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AE,IAAI,CAAC,MAAM,CAAC,EACpB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,EACtB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,EAChB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,GACnB,CACH,CAAC;QACJ,CAAC;QACD,KAAK,SAAS,CAAC,CAAC,CAAC;YACf,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC;YAClE,OAAO,KAAC,WAAW,OAAK,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,GAAI,CAAC;QAC7F,CAAC;IACH,CAAC;AACH,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,SAAS,CAAC,EAAE,KAAK,EAAoB;IACnD,OAAO,CACL,4BAAiB,KAAK,CAAC,IAAI,YACzB,KAAC,SAAS,IAAC,KAAK,EAAE,KAAK,GAAI,GACvB,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * The `request_image_mask` result: a receipt, not a path (D38 §2).
3
+ *
4
+ * The source thumb — hatched, as everywhere: no remote image loads inline for
5
+ * the source — stacked ABOVE a kit `Receipt` (the truncation rule: a receipt
6
+ * value column under ~160px means change the layout, not the break rule).
7
+ *
8
+ * Typed `ImageMaskPayload`, so the rows are the fields the handler actually
9
+ * sends: `imagePath`, `maskPath`, `bytes`. The design also draws a region and
10
+ * a coverage row; the payload carries neither. The seventh drop's ruling 8
11
+ * settles what happens then: **state the absence**. The receipt's `region`
12
+ * row reads "region not recorded", in gold, rather than disappearing — a
13
+ * load-bearing fact that vanishes cannot be told apart from a whole-image
14
+ * mask, and a later answer citing that receipt would be citing a gap. A
15
+ * caller that does supply a region (the view test) gets the figures.
16
+ *
17
+ * And the mask itself is DRAWN over the thumb whenever its bytes exist: the
18
+ * PNG the handler wrote is fetched from the files API and laid over the
19
+ * hatch, with the teal region fill beneath it so the transparent (editable)
20
+ * pixels show as the user's answer. When the bytes do not exist the thumb
21
+ * shows the source alone with a mono line saying the mask was not rendered.
22
+ *
23
+ * Failure is a fact about the evidence, not a dialog: a declined or failed
24
+ * mask comes back as a tool error with a message, and `ImageMaskFallback`
25
+ * states it in a red boxed mono `Callout` from the result's own words.
26
+ */
27
+ import { type ReceiptRow } from "@schlessera/brain-ui-kit";
28
+ import type { ImageMaskPayload, ToolCallView } from "@schlessera/brain-ui-sdk/client";
29
+ /** A normalised rectangle over the source image: every value in 0..1. */
30
+ export interface MaskRegion {
31
+ x: number;
32
+ y: number;
33
+ w: number;
34
+ h: number;
35
+ }
36
+ export declare const REGION_NOT_RECORDED = "region not recorded";
37
+ export declare const MASK_NOT_RENDERED = "mask not rendered";
38
+ /** The mask file exists with content: the handler reports the PNG's byte length. */
39
+ export declare function hasMaskBytes(payload: Pick<ImageMaskPayload, "bytes">): boolean;
40
+ /**
41
+ * The thumb: the hatched source, the drawn region when a caller has one, and
42
+ * the mask image over both when `maskUrl` is given. Exported for the view
43
+ * test; the bound card computes `maskUrl` from the payload.
44
+ */
45
+ export declare function MaskThumb({ region, label, maskUrl, maskShown, onMaskLoad, onMaskError, }: {
46
+ region?: MaskRegion;
47
+ label: string;
48
+ maskUrl?: string;
49
+ /** The teal fill sits under the mask only once the PNG has loaded: until
50
+ * then, or after a failure, a full teal frame would read as a whole-image
51
+ * mask that was never drawn. */
52
+ maskShown?: boolean;
53
+ onMaskLoad?: () => void;
54
+ onMaskError?: () => void;
55
+ }): import("react").JSX.Element;
56
+ /** The rows the receipt prints. The region row is always there: figures when
57
+ * a caller has them, the stated absence when the payload carries none. */
58
+ export declare function maskReceiptRows(payload: ImageMaskPayload, region?: MaskRegion): ReceiptRow[];
59
+ export declare function ImageMaskResultCard(payload: ImageMaskPayload & {
60
+ region?: MaskRegion;
61
+ }): import("react").JSX.Element;
62
+ /**
63
+ * No payload: the user declined, the editor failed, or an older server
64
+ * answered with a sentence. An error is stated as a fact in red; anything
65
+ * else is shown as the text it is.
66
+ */
67
+ export declare function ImageMaskFallback({ tool }: {
68
+ tool: ToolCallView;
69
+ }): import("react").JSX.Element | null;
70
+ //# sourceMappingURL=image-mask-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-mask-card.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/tool-cards/image-mask-card.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAA0C,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACnG,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAItF,yEAAyE;AACzE,MAAM,WAAW,UAAU;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAKD,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AACzD,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAWrD,oFAAoF;AACpF,wBAAgB,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,GAAG,OAAO,CAE9E;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EACxB,MAAM,EACN,KAAK,EACL,OAAO,EACP,SAAS,EACT,UAAU,EACV,WAAW,GACZ,EAAE;IACD,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;oCAEgC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B,+BAqDA;AAED;0EAC0E;AAC1E,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU,EAAE,CAe5F;AAMD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,gBAAgB,GAAG;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,+BAiCtF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,sCAYjE"}
@@ -0,0 +1,142 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * The `request_image_mask` result: a receipt, not a path (D38 §2).
4
+ *
5
+ * The source thumb — hatched, as everywhere: no remote image loads inline for
6
+ * the source — stacked ABOVE a kit `Receipt` (the truncation rule: a receipt
7
+ * value column under ~160px means change the layout, not the break rule).
8
+ *
9
+ * Typed `ImageMaskPayload`, so the rows are the fields the handler actually
10
+ * sends: `imagePath`, `maskPath`, `bytes`. The design also draws a region and
11
+ * a coverage row; the payload carries neither. The seventh drop's ruling 8
12
+ * settles what happens then: **state the absence**. The receipt's `region`
13
+ * row reads "region not recorded", in gold, rather than disappearing — a
14
+ * load-bearing fact that vanishes cannot be told apart from a whole-image
15
+ * mask, and a later answer citing that receipt would be citing a gap. A
16
+ * caller that does supply a region (the view test) gets the figures.
17
+ *
18
+ * And the mask itself is DRAWN over the thumb whenever its bytes exist: the
19
+ * PNG the handler wrote is fetched from the files API and laid over the
20
+ * hatch, with the teal region fill beneath it so the transparent (editable)
21
+ * pixels show as the user's answer. When the bytes do not exist the thumb
22
+ * shows the source alone with a mono line saying the mask was not rendered.
23
+ *
24
+ * Failure is a fact about the evidence, not a dialog: a declined or failed
25
+ * mask comes back as a tool error with a message, and `ImageMaskFallback`
26
+ * states it in a red boxed mono `Callout` from the result's own words.
27
+ */
28
+ import { useState } from "react";
29
+ import { Callout, Receipt, Surface, color, font } from "@schlessera/brain-ui-kit";
30
+ import { useBrainUiRoot } from "../../../root-context.js";
31
+ import { ClampedPre } from "../tool-views.js";
32
+ const THUMB_W = 160;
33
+ const THUMB_H = 100;
34
+ export const REGION_NOT_RECORDED = "region not recorded";
35
+ export const MASK_NOT_RENDERED = "mask not rendered";
36
+ /** The kit's image placeholder: raised stripes on the surface, no pixels. */
37
+ const HATCH = `repeating-linear-gradient(135deg,${color.raised} 0 6px,var(--bk-hatch-stripe) 6px 12px)`;
38
+ function bytesLabel(bytes) {
39
+ if (bytes >= 1024 * 1024)
40
+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
41
+ if (bytes >= 1024)
42
+ return `${Math.round(bytes / 1024)} KB`;
43
+ return `${bytes} B`;
44
+ }
45
+ /** The mask file exists with content: the handler reports the PNG's byte length. */
46
+ export function hasMaskBytes(payload) {
47
+ return typeof payload.bytes === "number" && payload.bytes > 0;
48
+ }
49
+ /**
50
+ * The thumb: the hatched source, the drawn region when a caller has one, and
51
+ * the mask image over both when `maskUrl` is given. Exported for the view
52
+ * test; the bound card computes `maskUrl` from the payload.
53
+ */
54
+ export function MaskThumb({ region, label, maskUrl, maskShown, onMaskLoad, onMaskError, }) {
55
+ const frame = {
56
+ position: "relative",
57
+ width: "100%",
58
+ maxWidth: THUMB_W * 2,
59
+ aspectRatio: `${THUMB_W} / ${THUMB_H}`,
60
+ borderRadius: 9,
61
+ border: `1px solid ${color.edge}`,
62
+ background: HATCH,
63
+ overflow: "hidden",
64
+ };
65
+ const drawn = region
66
+ ? {
67
+ position: "absolute",
68
+ left: `${region.x * 100}%`,
69
+ top: `${region.y * 100}%`,
70
+ width: `${region.w * 100}%`,
71
+ height: `${region.h * 100}%`,
72
+ border: "1.5px dashed var(--bk-teal-ink)",
73
+ background: "var(--bk-mask-region-fill)",
74
+ borderRadius: 3,
75
+ boxSizing: "border-box",
76
+ }
77
+ : undefined;
78
+ // The teal fill sits under the mask: where the PNG is transparent — the
79
+ // editable region, the user's own answer — the teal shows through.
80
+ const fill = { position: "absolute", inset: 0, background: "var(--bk-mask-region-fill)" };
81
+ const overlay = {
82
+ position: "absolute",
83
+ inset: 0,
84
+ width: "100%",
85
+ height: "100%",
86
+ objectFit: "contain",
87
+ };
88
+ return (_jsxs("div", { role: "img", "aria-label": label, style: frame, "data-mask-thumb": true, children: [drawn ? _jsx("div", { style: drawn, "data-mask-region": true }) : null, maskUrl ? (_jsxs(_Fragment, { children: [maskShown ? _jsx("div", { style: fill, "aria-hidden": "true" }) : null, _jsx("img", { src: maskUrl, alt: "", style: { ...overlay, visibility: maskShown ? "visible" : "hidden" }, "data-mask-overlay": true, "data-mask-shown": maskShown ? "" : undefined, onLoad: onMaskLoad, onError: onMaskError })] })) : null] }));
89
+ }
90
+ /** The rows the receipt prints. The region row is always there: figures when
91
+ * a caller has them, the stated absence when the payload carries none. */
92
+ export function maskReceiptRows(payload, region) {
93
+ const rows = [];
94
+ if (region) {
95
+ rows.push({
96
+ k: "region",
97
+ v: `${pct(region.x)},${pct(region.y)} → ${pct(region.x + region.w)},${pct(region.y + region.h)}`,
98
+ tone: "teal",
99
+ });
100
+ rows.push({ k: "covers", v: `${pct(region.w * region.h)} of the image`, tone: "teal" });
101
+ }
102
+ else {
103
+ rows.push({ k: "region", v: REGION_NOT_RECORDED, tone: "gold" });
104
+ }
105
+ rows.push({ k: "source", v: payload.imagePath });
106
+ rows.push({ k: "mask", v: `${payload.maskPath} · ${bytesLabel(payload.bytes)}` });
107
+ return rows;
108
+ }
109
+ function pct(fraction) {
110
+ return `${Math.round(fraction * 100)}%`;
111
+ }
112
+ export function ImageMaskResultCard(payload) {
113
+ const root = useBrainUiRoot();
114
+ const region = payload.region;
115
+ const hasBytes = hasMaskBytes(payload);
116
+ const maskUrl = hasBytes
117
+ ? `${root.apiBase()}/files/content?path=${encodeURIComponent(payload.maskPath)}&raw=1`
118
+ : undefined;
119
+ // The bytes say a mask was written; only the browser can say it loaded.
120
+ // A file gone since, or a path the raw route refuses, must not leave a
121
+ // full teal frame standing in for a mask nobody can see.
122
+ const [maskState, setMaskState] = useState("loading");
123
+ const rendered = hasBytes && maskState === "shown";
124
+ const note = { font: `400 10.5px/1.5 ${font.mono}`, color: color.inkMute };
125
+ return (_jsx(Surface, { tone: "teal", label: "Mask drawn", labelIcon: "confirm", meta: "by you", pad: 12, children: _jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [_jsx(MaskThumb, { region: region, maskUrl: maskUrl, maskShown: rendered, onMaskLoad: () => setMaskState("shown"), onMaskError: () => setMaskState("failed"), label: rendered
126
+ ? `Mask ${payload.maskPath} over the source ${payload.imagePath}`
127
+ : `Source ${payload.imagePath}; the mask is in ${payload.maskPath}` }), !hasBytes || maskState === "failed" ? _jsx("div", { style: note, children: MASK_NOT_RENDERED }) : null, _jsx(Receipt, { keyWidth: 58, rows: maskReceiptRows(payload, region) })] }) }));
128
+ }
129
+ /**
130
+ * No payload: the user declined, the editor failed, or an older server
131
+ * answered with a sentence. An error is stated as a fact in red; anything
132
+ * else is shown as the text it is.
133
+ */
134
+ export function ImageMaskFallback({ tool }) {
135
+ if (!tool.output)
136
+ return null;
137
+ if (!tool.isError)
138
+ return _jsx(ClampedPre, { text: tool.output });
139
+ const source = typeof tool.input.imagePath === "string" ? tool.input.imagePath : null;
140
+ return (_jsx(Callout, { tone: "red", variant: "boxed", mono: true, text: `no mask drawn${source ? ` on ${source}` : ""} · ${tool.output.trim()}` }));
141
+ }
142
+ //# sourceMappingURL=image-mask-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-mask-card.js","sourceRoot":"","sources":["../../../../src/components/chat/tool-cards/image-mask-card.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,QAAQ,EAAsB,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAmB,MAAM,0BAA0B,CAAC;AAEnG,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 /**
2
+ * The `get_current_location` result, drawn on the kit's `MapView` (S9: the
3
+ * first in-chat component rendered end to end from its contract; D37 moved
4
+ * the span rule, the uncertainty ring, the note and the width cap into the
5
+ * kit, so the card is now the fetch and the caption).
6
+ *
7
+ * Typed `LocationPayload` — the contract's payload type — so the fields it
8
+ * reads are the fields the handler is contracted to send. The pin, the
9
+ * span and the caption are pure functions of that payload. What is not pure
10
+ * is the shoreline: `MapView` fetches nothing (kit D13), so this card is the
11
+ * container that asks the server's `/geo/coastline` for the geometry around
12
+ * the fix and hands it down as `paths` and `land`. The request is cancelled
13
+ * on unmount, and any failure — no server, an older server without the
14
+ * route, an Overpass outage — leaves a map with a correct pin, a graticule
15
+ * and a true scale bar, which is a good locator on its own.
16
+ *
17
+ * The bounding box asked for is the envelope of every box `MapView` can draw
18
+ * for the pin — 1.5 spans across, 1.0 down, the same rule the kit's fixture
19
+ * generator uses (`viewBox` says why those numbers). The server clips to the
20
+ * box it is given and quantises its cache key to ~110 m, so the request has
21
+ * to cover the drawn frame itself; and because the envelope is a function of
22
+ * the pin and the span alone, the same fix at any card width is one cache
23
+ * entry rather than a fresh request to a shared service.
24
+ */
25
+ import { type MapPath } from "@schlessera/brain-ui-kit";
26
+ import type { LocationPayload } from "@schlessera/brain-ui-sdk/client";
27
+ import type { CoastlineGeometry } from "../../../lib/api-client.js";
28
+ /**
29
+ * The view's span across its width, in kilometres — the kit's own rule
30
+ * (`max(1.6 km, 6 × accuracy)`, D37), repeated here only so the coastline
31
+ * request covers the box the kit will draw. The kit computes it again from
32
+ * `accuracyM`; the two must agree, and `tests/location-card.test.ts` pins
33
+ * this one.
34
+ */
35
+ export declare function spanFor(accuracyMeters: number): number;
36
+ /**
37
+ * The box to fetch for one pin, as `[west, south, east, north]`: the span at
38
+ * the pin's latitude, grown to the envelope above and centred on the pin.
39
+ * Clamped to the server's 5° limit and to the poles.
40
+ */
41
+ export declare function viewBox(lat: number, lon: number, spanKm: number): [number, number, number, number];
42
+ /** The server's tiers as `MapView` paths, at the kit fixtures' weights. */
43
+ export declare function geometryPaths(geo: CoastlineGeometry): MapPath[];
44
+ export declare function LocationResultCard({ latitude, longitude, accuracyMeters, place, address, note, retrievedAt, }: LocationPayload): import("react").JSX.Element;
45
+ //# sourceMappingURL=location-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"location-card.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/tool-cards/location-card.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAyB,KAAK,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AA6BpE;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CASlG;AAED,2EAA2E;AAC3E,wBAAgB,aAAa,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,EAAE,CAM/D;AAED,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,SAAS,EACT,cAAc,EACd,KAAK,EACL,OAAO,EACP,IAAI,EACJ,WAAW,GACZ,EAAE,eAAe,+BAwDjB"}
@@ -0,0 +1,128 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * The `get_current_location` result, drawn on the kit's `MapView` (S9: the
4
+ * first in-chat component rendered end to end from its contract; D37 moved
5
+ * the span rule, the uncertainty ring, the note and the width cap into the
6
+ * kit, so the card is now the fetch and the caption).
7
+ *
8
+ * Typed `LocationPayload` — the contract's payload type — so the fields it
9
+ * reads are the fields the handler is contracted to send. The pin, the
10
+ * span and the caption are pure functions of that payload. What is not pure
11
+ * is the shoreline: `MapView` fetches nothing (kit D13), so this card is the
12
+ * container that asks the server's `/geo/coastline` for the geometry around
13
+ * the fix and hands it down as `paths` and `land`. The request is cancelled
14
+ * on unmount, and any failure — no server, an older server without the
15
+ * route, an Overpass outage — leaves a map with a correct pin, a graticule
16
+ * and a true scale bar, which is a good locator on its own.
17
+ *
18
+ * The bounding box asked for is the envelope of every box `MapView` can draw
19
+ * for the pin — 1.5 spans across, 1.0 down, the same rule the kit's fixture
20
+ * generator uses (`viewBox` says why those numbers). The server clips to the
21
+ * box it is given and quantises its cache key to ~110 m, so the request has
22
+ * to cover the drawn frame itself; and because the envelope is a function of
23
+ * the pin and the span alone, the same fix at any card width is one cache
24
+ * entry rather than a fresh request to a shared service.
25
+ */
26
+ import { MapView } from "@schlessera/brain-ui-kit";
27
+ import { useEffect, useState } from "react";
28
+ import { useBrainApi } from "../../../root-context.js";
29
+ /** 4 decimal places is ~11 m — finer than any browser fix is honest about. */
30
+ function coord(value) {
31
+ return value.toFixed(4);
32
+ }
33
+ function accuracy(meters) {
34
+ return meters >= 1000
35
+ ? `±${(meters / 1000).toFixed(meters >= 10_000 ? 0 : 1)} km`
36
+ : `±${Math.round(meters)} m`;
37
+ }
38
+ /** `MapView`'s own default projection width. */
39
+ const WIDTH = 330;
40
+ /**
41
+ * How far past the span to fetch, per axis, as a multiple of `spanKm`. The
42
+ * kit's ruling (README, sixth pass, §10) bounds a card at 420px wide with a
43
+ * viewport of 110-260px, and `MapView` draws a single pin as 1.24 spans across
44
+ * (12% margins each side) at any width and 1.24 × H/W spans down: 0.32 for
45
+ * 420×110, 0.77 for 420×260, and this card leaves the height at its 170
46
+ * default, so 1.0 down covers it at any width from 211px up. The square
47
+ * 2.4-span bleed this replaced fetched geometry of which only 23% could ever
48
+ * be drawn (measured on the kit's Messina fixture).
49
+ */
50
+ const BLEED_ACROSS = 1.5;
51
+ const BLEED_DOWN = 1.0;
52
+ /**
53
+ * The view's span across its width, in kilometres — the kit's own rule
54
+ * (`max(1.6 km, 6 × accuracy)`, D37), repeated here only so the coastline
55
+ * request covers the box the kit will draw. The kit computes it again from
56
+ * `accuracyM`; the two must agree, and `tests/location-card.test.ts` pins
57
+ * this one.
58
+ */
59
+ export function spanFor(accuracyMeters) {
60
+ return Math.max(1.6, (accuracyMeters * 6) / 1000);
61
+ }
62
+ /**
63
+ * The box to fetch for one pin, as `[west, south, east, north]`: the span at
64
+ * the pin's latitude, grown to the envelope above and centred on the pin.
65
+ * Clamped to the server's 5° limit and to the poles.
66
+ */
67
+ export function viewBox(lat, lon, spanKm) {
68
+ const cos = Math.max(0.2, Math.cos((lat * Math.PI) / 180));
69
+ const degLon = Math.min(4.5, (spanKm / 111 / cos) * BLEED_ACROSS);
70
+ const degLat = Math.min(4.5, (spanKm / 111) * BLEED_DOWN);
71
+ const west = Math.max(-180, lon - degLon / 2);
72
+ const east = Math.min(180, lon + degLon / 2);
73
+ const south = Math.max(-89, lat - degLat / 2);
74
+ const north = Math.min(89, lat + degLat / 2);
75
+ return [west, south, east, north];
76
+ }
77
+ /** The server's tiers as `MapView` paths, at the kit fixtures' weights. */
78
+ export function geometryPaths(geo) {
79
+ return [
80
+ ...geo.coastline.map((coords) => ({ coords, tone: "neutral", width: 1 })),
81
+ ...geo.roads.map((coords) => ({ coords, tone: "neutral", width: 0.6 })),
82
+ ...geo.streets.map((coords) => ({ coords, tone: "neutral", width: 0.35 })),
83
+ ];
84
+ }
85
+ export function LocationResultCard({ latitude, longitude, accuracyMeters, place, address, note, retrievedAt, }) {
86
+ const api = useBrainApi();
87
+ const spanKm = spanFor(accuracyMeters);
88
+ const [geo, setGeo] = useState(null);
89
+ useEffect(() => {
90
+ const controller = new AbortController();
91
+ setGeo(null);
92
+ // The box is BLEED_ACROSS times the drawn span, so the width sent with it
93
+ // is BLEED_ACROSS times the drawn width: the server takes its tolerance
94
+ // and its detail tier from the box's width over that many pixels, and the
95
+ // bare 330 would ask for a view half again coarser than the one drawn —
96
+ // a 2 km span asking for streets and getting roads. The server buckets
97
+ // 495 up to 660, which errs on the fine side, never towards an empty map.
98
+ api
99
+ .geoCoastline(viewBox(latitude, longitude, spanKm), {
100
+ width: WIDTH * BLEED_ACROSS,
101
+ signal: controller.signal,
102
+ })
103
+ .then((result) => {
104
+ if (!controller.signal.aborted)
105
+ setGeo(result);
106
+ })
107
+ .catch(() => {
108
+ // A plainer map, on purpose. The pin is the answer; the shore is
109
+ // context, and context that cannot be had is not an error to show.
110
+ });
111
+ return () => controller.abort();
112
+ }, [api, latitude, longitude, spanKm]);
113
+ const when = new Date(retrievedAt);
114
+ const stamp = Number.isNaN(when.getTime())
115
+ ? retrievedAt
116
+ : when.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
117
+ const paths = geo ? geometryPaths(geo) : [];
118
+ const land = geo && geo.land.length ? { rings: geo.land } : undefined;
119
+ const drawn = paths.length > 0 || land !== undefined;
120
+ return (_jsx(MapView, { pins: [{ lat: latitude, lon: longitude, label: place ?? "Here", meta: accuracy(accuracyMeters), tone: "amber" }], accuracyM: accuracyMeters, paths: paths, land: land,
121
+ // The place name is the answer; coordinates are the evidence for it,
122
+ // so they stay visible but quiet rather than leading.
123
+ title: place ?? "Coordinates only", subtitle: address && address !== place ? address : undefined, meta: `${coord(latitude)}, ${coord(longitude)} · ${accuracy(accuracyMeters)} · ${stamp}`, note: note,
124
+ // The credit is the licence's, not the design's: it appears exactly
125
+ // when OpenStreetMap geometry is on the map.
126
+ attribution: drawn ? geo?.attribution : undefined }));
127
+ }
128
+ //# sourceMappingURL=location-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"location-card.js","sourceRoot":"","sources":["../../../../src/components/chat/tool-cards/location-card.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,OAAO,EAA8B,MAAM,0BAA0B,CAAC;AAE/E,OAAO,EAA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