@schlessera/brain-ui-react 0.35.0 → 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 (755) hide show
  1. package/README.md +82 -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 +32 -32
  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 +13 -2
  136. package/dist/components/chat/tool-views.d.ts.map +1 -1
  137. package/dist/components/chat/tool-views.js +20 -22
  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 +27 -21
  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 +4 -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 +23 -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 +4 -3
  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 +39 -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 +6 -1
  312. package/dist/components/settings/devices-agents-tab.d.ts.map +1 -1
  313. package/dist/components/settings/devices-agents-tab.js +55 -20
  314. package/dist/components/settings/devices-agents-tab.js.map +1 -1
  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.js +1 -1
  324. package/dist/components/settings/one-time-agent-credential.js.map +1 -1
  325. package/dist/components/settings/passkey-list.d.ts +35 -0
  326. package/dist/components/settings/passkey-list.d.ts.map +1 -0
  327. package/dist/components/settings/passkey-list.js +34 -0
  328. package/dist/components/settings/passkey-list.js.map +1 -0
  329. package/dist/components/settings/passkey-tab.d.ts +3 -0
  330. package/dist/components/settings/passkey-tab.d.ts.map +1 -1
  331. package/dist/components/settings/passkey-tab.js +53 -45
  332. package/dist/components/settings/passkey-tab.js.map +1 -1
  333. package/dist/components/settings/pi-accounts-list.d.ts +27 -0
  334. package/dist/components/settings/pi-accounts-list.d.ts.map +1 -0
  335. package/dist/components/settings/pi-accounts-list.js +15 -0
  336. package/dist/components/settings/pi-accounts-list.js.map +1 -0
  337. package/dist/components/settings/pi-accounts.d.ts +3 -0
  338. package/dist/components/settings/pi-accounts.d.ts.map +1 -1
  339. package/dist/components/settings/pi-accounts.js +73 -55
  340. package/dist/components/settings/pi-accounts.js.map +1 -1
  341. package/dist/components/settings/principal-list.d.ts +37 -0
  342. package/dist/components/settings/principal-list.d.ts.map +1 -0
  343. package/dist/components/settings/principal-list.js +18 -0
  344. package/dist/components/settings/principal-list.js.map +1 -0
  345. package/dist/components/settings/settings-panel.d.ts +10 -3
  346. package/dist/components/settings/settings-panel.d.ts.map +1 -1
  347. package/dist/components/settings/settings-panel.js +69 -8
  348. package/dist/components/settings/settings-panel.js.map +1 -1
  349. package/dist/components/settings/skills-list.d.ts +53 -0
  350. package/dist/components/settings/skills-list.d.ts.map +1 -0
  351. package/dist/components/settings/skills-list.js +28 -0
  352. package/dist/components/settings/skills-list.js.map +1 -0
  353. package/dist/components/settings/skills-tab.d.ts.map +1 -1
  354. package/dist/components/settings/skills-tab.js +65 -38
  355. package/dist/components/settings/skills-tab.js.map +1 -1
  356. package/dist/components/settings/tool-permissions-list.d.ts +18 -0
  357. package/dist/components/settings/tool-permissions-list.d.ts.map +1 -0
  358. package/dist/components/settings/tool-permissions-list.js +6 -0
  359. package/dist/components/settings/tool-permissions-list.js.map +1 -0
  360. package/dist/components/settings/tool-permissions.d.ts +2 -1
  361. package/dist/components/settings/tool-permissions.d.ts.map +1 -1
  362. package/dist/components/settings/tool-permissions.js +33 -16
  363. package/dist/components/settings/tool-permissions.js.map +1 -1
  364. package/dist/components/settings/web-search-chain.d.ts +41 -0
  365. package/dist/components/settings/web-search-chain.d.ts.map +1 -0
  366. package/dist/components/settings/web-search-chain.js +47 -0
  367. package/dist/components/settings/web-search-chain.js.map +1 -0
  368. package/dist/components/settings/web-search-settings.d.ts +4 -7
  369. package/dist/components/settings/web-search-settings.d.ts.map +1 -1
  370. package/dist/components/settings/web-search-settings.js +54 -76
  371. package/dist/components/settings/web-search-settings.js.map +1 -1
  372. package/dist/components/share/share-menu.d.ts.map +1 -1
  373. package/dist/components/share/share-menu.js +24 -4
  374. package/dist/components/share/share-menu.js.map +1 -1
  375. package/dist/components/voice/dictation-sheet.js +3 -3
  376. package/dist/components/voice/dictation-sheet.js.map +1 -1
  377. package/dist/components/voice/mic-button.js +1 -1
  378. package/dist/components/voice/mic-button.js.map +1 -1
  379. package/dist/components/voice/review-card.js +1 -1
  380. package/dist/components/voice/review-card.js.map +1 -1
  381. package/dist/config.d.ts +5 -2
  382. package/dist/config.d.ts.map +1 -1
  383. package/dist/config.js +15 -5
  384. package/dist/config.js.map +1 -1
  385. package/dist/connection.d.ts +12 -0
  386. package/dist/connection.d.ts.map +1 -0
  387. package/dist/connection.js +421 -0
  388. package/dist/connection.js.map +1 -0
  389. package/dist/default-root.d.ts +3 -0
  390. package/dist/default-root.d.ts.map +1 -0
  391. package/dist/default-root.js +16 -0
  392. package/dist/default-root.js.map +1 -0
  393. package/dist/hooks/use-color-scheme.d.ts +14 -0
  394. package/dist/hooks/use-color-scheme.d.ts.map +1 -0
  395. package/dist/hooks/use-color-scheme.js +37 -0
  396. package/dist/hooks/use-color-scheme.js.map +1 -0
  397. package/dist/hooks/use-hash-routes.d.ts.map +1 -1
  398. package/dist/hooks/use-hash-routes.js +4 -2
  399. package/dist/hooks/use-hash-routes.js.map +1 -1
  400. package/dist/hooks/use-media-query.d.ts +7 -0
  401. package/dist/hooks/use-media-query.d.ts.map +1 -0
  402. package/dist/hooks/use-media-query.js +34 -0
  403. package/dist/hooks/use-media-query.js.map +1 -0
  404. package/dist/hooks/use-share-intake.d.ts.map +1 -1
  405. package/dist/hooks/use-share-intake.js +37 -12
  406. package/dist/hooks/use-share-intake.js.map +1 -1
  407. package/dist/hooks/use-vpn-status.d.ts.map +1 -1
  408. package/dist/hooks/use-vpn-status.js +17 -18
  409. package/dist/hooks/use-vpn-status.js.map +1 -1
  410. package/dist/hooks/use-websocket.d.ts +5 -24
  411. package/dist/hooks/use-websocket.d.ts.map +1 -1
  412. package/dist/hooks/use-websocket.js +11 -384
  413. package/dist/hooks/use-websocket.js.map +1 -1
  414. package/dist/hooks/websocket-handlers/activity.d.ts +2 -2
  415. package/dist/hooks/websocket-handlers/activity.d.ts.map +1 -1
  416. package/dist/hooks/websocket-handlers/activity.js +4 -5
  417. package/dist/hooks/websocket-handlers/activity.js.map +1 -1
  418. package/dist/hooks/websocket-handlers/chat.d.ts +1 -0
  419. package/dist/hooks/websocket-handlers/chat.d.ts.map +1 -1
  420. package/dist/hooks/websocket-handlers/chat.js +27 -5
  421. package/dist/hooks/websocket-handlers/chat.js.map +1 -1
  422. package/dist/hooks/websocket-handlers/connection.d.ts.map +1 -1
  423. package/dist/hooks/websocket-handlers/connection.js +4 -6
  424. package/dist/hooks/websocket-handlers/connection.js.map +1 -1
  425. package/dist/hooks/websocket-handlers/mask.d.ts +1 -1
  426. package/dist/hooks/websocket-handlers/mask.d.ts.map +1 -1
  427. package/dist/hooks/websocket-handlers/mask.js +2 -3
  428. package/dist/hooks/websocket-handlers/mask.js.map +1 -1
  429. package/dist/hooks/websocket-handlers/provider.d.ts.map +1 -1
  430. package/dist/hooks/websocket-handlers/provider.js +4 -6
  431. package/dist/hooks/websocket-handlers/provider.js.map +1 -1
  432. package/dist/hooks/websocket-handlers/types.d.ts +6 -2
  433. package/dist/hooks/websocket-handlers/types.d.ts.map +1 -1
  434. package/dist/index.d.ts +5 -3
  435. package/dist/index.d.ts.map +1 -1
  436. package/dist/index.js +6 -3
  437. package/dist/index.js.map +1 -1
  438. package/dist/lib/api-client.d.ts +289 -0
  439. package/dist/lib/api-client.d.ts.map +1 -1
  440. package/dist/lib/api-client.js +243 -224
  441. package/dist/lib/api-client.js.map +1 -1
  442. package/dist/lib/backend.d.ts +19 -2
  443. package/dist/lib/backend.d.ts.map +1 -1
  444. package/dist/lib/backend.js +15 -9
  445. package/dist/lib/backend.js.map +1 -1
  446. package/dist/lib/diff.d.ts +8 -10
  447. package/dist/lib/diff.d.ts.map +1 -1
  448. package/dist/lib/diff.js +26 -53
  449. package/dist/lib/diff.js.map +1 -1
  450. package/dist/lib/light-dark.d.ts +37 -0
  451. package/dist/lib/light-dark.d.ts.map +1 -0
  452. package/dist/lib/light-dark.js +83 -0
  453. package/dist/lib/light-dark.js.map +1 -0
  454. package/dist/lib/mermaid-theme.d.ts +7 -2
  455. package/dist/lib/mermaid-theme.d.ts.map +1 -1
  456. package/dist/lib/mermaid-theme.js +125 -203
  457. package/dist/lib/mermaid-theme.js.map +1 -1
  458. package/dist/lib/passkeys.d.ts +6 -3
  459. package/dist/lib/passkeys.d.ts.map +1 -1
  460. package/dist/lib/passkeys.js +10 -4
  461. package/dist/lib/passkeys.js.map +1 -1
  462. package/dist/lib/push-registration.d.ts +4 -1
  463. package/dist/lib/push-registration.d.ts.map +1 -1
  464. package/dist/lib/push-registration.js +20 -2
  465. package/dist/lib/push-registration.js.map +1 -1
  466. package/dist/lib/share-intake.d.ts +2 -1
  467. package/dist/lib/share-intake.d.ts.map +1 -1
  468. package/dist/lib/share-intake.js +3 -3
  469. package/dist/lib/share-intake.js.map +1 -1
  470. package/dist/lib/share.d.ts +4 -3
  471. package/dist/lib/share.d.ts.map +1 -1
  472. package/dist/lib/share.js +6 -7
  473. package/dist/lib/share.js.map +1 -1
  474. package/dist/lib/single-key.d.ts +30 -0
  475. package/dist/lib/single-key.d.ts.map +1 -0
  476. package/dist/lib/single-key.js +45 -0
  477. package/dist/lib/single-key.js.map +1 -0
  478. package/dist/lib/tool-names.d.ts +8 -6
  479. package/dist/lib/tool-names.d.ts.map +1 -1
  480. package/dist/lib/tool-names.js +17 -7
  481. package/dist/lib/tool-names.js.map +1 -1
  482. package/dist/root-context.d.ts +229 -0
  483. package/dist/root-context.d.ts.map +1 -0
  484. package/dist/root-context.js +33 -0
  485. package/dist/root-context.js.map +1 -0
  486. package/dist/root.d.ts +38 -0
  487. package/dist/root.d.ts.map +1 -0
  488. package/dist/root.js +47 -0
  489. package/dist/root.js.map +1 -0
  490. package/dist/stores/activity-state.d.ts +29 -0
  491. package/dist/stores/activity-state.d.ts.map +1 -0
  492. package/dist/stores/activity-state.js +282 -0
  493. package/dist/stores/activity-state.js.map +1 -0
  494. package/dist/stores/activity-store.d.ts +10 -41
  495. package/dist/stores/activity-store.d.ts.map +1 -1
  496. package/dist/stores/activity-store.js +9 -271
  497. package/dist/stores/activity-store.js.map +1 -1
  498. package/dist/stores/chat-state.d.ts +212 -0
  499. package/dist/stores/chat-state.d.ts.map +1 -0
  500. package/dist/stores/chat-state.js +466 -0
  501. package/dist/stores/chat-state.js.map +1 -0
  502. package/dist/stores/chat-store.d.ts +4 -162
  503. package/dist/stores/chat-store.d.ts.map +1 -1
  504. package/dist/stores/chat-store.js +7 -418
  505. package/dist/stores/chat-store.js.map +1 -1
  506. package/dist/stores/connection-state.d.ts +40 -0
  507. package/dist/stores/connection-state.d.ts.map +1 -0
  508. package/dist/stores/connection-state.js +30 -0
  509. package/dist/stores/connection-state.js.map +1 -0
  510. package/dist/stores/connection-store.d.ts +4 -40
  511. package/dist/stores/connection-store.d.ts.map +1 -1
  512. package/dist/stores/connection-store.js +7 -27
  513. package/dist/stores/connection-store.js.map +1 -1
  514. package/dist/stores/create-stores.d.ts +23 -0
  515. package/dist/stores/create-stores.d.ts.map +1 -0
  516. package/dist/stores/create-stores.js +28 -0
  517. package/dist/stores/create-stores.js.map +1 -0
  518. package/dist/stores/file-state.d.ts +53 -0
  519. package/dist/stores/file-state.d.ts.map +1 -0
  520. package/dist/stores/file-state.js +341 -0
  521. package/dist/stores/file-state.js.map +1 -0
  522. package/dist/stores/file-store.d.ts +4 -52
  523. package/dist/stores/file-store.d.ts.map +1 -1
  524. package/dist/stores/file-store.js +7 -336
  525. package/dist/stores/file-store.js.map +1 -1
  526. package/dist/stores/graph-state.d.ts +95 -0
  527. package/dist/stores/graph-state.d.ts.map +1 -0
  528. package/dist/stores/graph-state.js +252 -0
  529. package/dist/stores/graph-state.js.map +1 -0
  530. package/dist/stores/graph-store.d.ts +7 -83
  531. package/dist/stores/graph-store.d.ts.map +1 -1
  532. package/dist/stores/graph-store.js +8 -249
  533. package/dist/stores/graph-store.js.map +1 -1
  534. package/dist/stores/mask-state.d.ts +21 -0
  535. package/dist/stores/mask-state.d.ts.map +1 -0
  536. package/dist/stores/mask-state.js +9 -0
  537. package/dist/stores/mask-state.js.map +1 -0
  538. package/dist/stores/mask-store.d.ts +4 -21
  539. package/dist/stores/mask-store.d.ts.map +1 -1
  540. package/dist/stores/mask-store.js +7 -6
  541. package/dist/stores/mask-store.js.map +1 -1
  542. package/dist/stores/principal-state.d.ts +16 -0
  543. package/dist/stores/principal-state.d.ts.map +1 -0
  544. package/dist/stores/principal-state.js +31 -0
  545. package/dist/stores/principal-state.js.map +1 -0
  546. package/dist/stores/principal-store.d.ts +4 -15
  547. package/dist/stores/principal-store.d.ts.map +1 -1
  548. package/dist/stores/principal-store.js +7 -28
  549. package/dist/stores/principal-store.js.map +1 -1
  550. package/dist/stores/provider-state.d.ts +24 -0
  551. package/dist/stores/provider-state.d.ts.map +1 -0
  552. package/dist/stores/provider-state.js +68 -0
  553. package/dist/stores/provider-state.js.map +1 -0
  554. package/dist/stores/provider-store.d.ts +4 -23
  555. package/dist/stores/provider-store.d.ts.map +1 -1
  556. package/dist/stores/provider-store.js +7 -64
  557. package/dist/stores/provider-store.js.map +1 -1
  558. package/dist/stores/share-state.d.ts +29 -0
  559. package/dist/stores/share-state.d.ts.map +1 -0
  560. package/dist/stores/share-state.js +21 -0
  561. package/dist/stores/share-state.js.map +1 -0
  562. package/dist/stores/share-store.d.ts +4 -28
  563. package/dist/stores/share-store.d.ts.map +1 -1
  564. package/dist/stores/share-store.js +7 -18
  565. package/dist/stores/share-store.js.map +1 -1
  566. package/dist/stores/store-environment.d.ts +10 -0
  567. package/dist/stores/store-environment.d.ts.map +1 -0
  568. package/dist/stores/store-environment.js +2 -0
  569. package/dist/stores/store-environment.js.map +1 -0
  570. package/dist/stores/ui-state.d.ts +71 -0
  571. package/dist/stores/ui-state.d.ts.map +1 -0
  572. package/dist/stores/ui-state.js +58 -0
  573. package/dist/stores/ui-state.js.map +1 -0
  574. package/dist/stores/ui-store.d.ts +4 -45
  575. package/dist/stores/ui-store.d.ts.map +1 -1
  576. package/dist/stores/ui-store.js +7 -36
  577. package/dist/stores/ui-store.js.map +1 -1
  578. package/dist/styles.css +1 -1
  579. package/dist/theme.css +150 -97
  580. package/dist/voice/asr-clients.d.ts +2 -1
  581. package/dist/voice/asr-clients.d.ts.map +1 -1
  582. package/dist/voice/asr-clients.js +16 -17
  583. package/dist/voice/asr-clients.js.map +1 -1
  584. package/dist/voice/use-dictation.d.ts.map +1 -1
  585. package/dist/voice/use-dictation.js +12 -8
  586. package/dist/voice/use-dictation.js.map +1 -1
  587. package/dist/voice/voice-state.d.ts +25 -0
  588. package/dist/voice/voice-state.d.ts.map +1 -0
  589. package/dist/voice/voice-state.js +29 -0
  590. package/dist/voice/voice-state.js.map +1 -0
  591. package/dist/voice/voice-store.d.ts +4 -25
  592. package/dist/voice/voice-store.d.ts.map +1 -1
  593. package/dist/voice/voice-store.js +7 -26
  594. package/dist/voice/voice-store.js.map +1 -1
  595. package/package.json +3 -2
  596. package/src/components/activity/activity-page.tsx +334 -160
  597. package/src/components/activity/activity-run-detail.tsx +81 -47
  598. package/src/components/activity/activity-run-list.tsx +27 -59
  599. package/src/components/activity/activity-views.tsx +155 -0
  600. package/src/components/activity/approval-card.tsx +80 -0
  601. package/src/components/activity/digest-card.tsx +25 -61
  602. package/src/components/activity/digest-summary.tsx +52 -0
  603. package/src/components/activity/push-switch.tsx +62 -0
  604. package/src/components/activity/push-toggle.tsx +51 -81
  605. package/src/components/activity/span-bits.tsx +8 -7
  606. package/src/components/chat/ask-user-card.tsx +292 -356
  607. package/src/components/chat/ask-user-typed.ts +77 -0
  608. package/src/components/chat/brain-markdown-links.tsx +4 -4
  609. package/src/components/chat/brain-markdown.tsx +4 -2
  610. package/src/components/chat/chat-page.tsx +38 -9
  611. package/src/components/chat/composer-view.tsx +194 -0
  612. package/src/components/chat/composer.tsx +117 -296
  613. package/src/components/chat/markdown-content.tsx +53 -2
  614. package/src/components/chat/mermaid-block.tsx +13 -5
  615. package/src/components/chat/mermaid-share.ts +8 -7
  616. package/src/components/chat/mermaid-viewer.tsx +3 -1
  617. package/src/components/chat/message-bubble.tsx +78 -94
  618. package/src/components/chat/message-share.ts +7 -7
  619. package/src/components/chat/renderers/bind.tsx +94 -0
  620. package/src/components/chat/renderers/brain-ui-tools.tsx +56 -0
  621. package/src/components/chat/renderers/claude-tools.tsx +3 -2
  622. package/src/components/chat/renderers/index.ts +15 -10
  623. package/src/components/chat/session-drawer.tsx +41 -138
  624. package/src/components/chat/session-list.tsx +113 -0
  625. package/src/components/chat/share-block.tsx +16 -12
  626. package/src/components/chat/share-card.tsx +2 -2
  627. package/src/components/chat/subagent-view.tsx +4 -4
  628. package/src/components/chat/tool-call-timeline.tsx +59 -22
  629. package/src/components/chat/tool-cards/block-card.tsx +145 -0
  630. package/src/components/chat/tool-cards/image-mask-card.tsx +214 -0
  631. package/src/components/chat/tool-cards/location-card.tsx +159 -0
  632. package/src/components/chat/tool-views.tsx +21 -60
  633. package/src/components/chat/transcript-turn.tsx +108 -0
  634. package/src/components/chat/use-chat-commands.ts +14 -16
  635. package/src/components/chat/welcome-state.tsx +36 -91
  636. package/src/components/connectivity/connection-gate.tsx +32 -24
  637. package/src/components/connectivity/login-form.tsx +122 -0
  638. package/src/components/connectivity/login-screen.tsx +45 -100
  639. package/src/components/dev/share-harness.tsx +2 -2
  640. package/src/components/files/file-panel.tsx +168 -0
  641. package/src/components/files/file-tree-view.tsx +127 -0
  642. package/src/components/files/file-tree.tsx +55 -109
  643. package/src/components/files/file-viewer-binary.tsx +3 -2
  644. package/src/components/files/file-viewer-frame.tsx +113 -0
  645. package/src/components/files/file-viewer.tsx +40 -95
  646. package/src/components/files/frontmatter-chips.tsx +42 -0
  647. package/src/components/files/frontmatter-panel.tsx +6 -71
  648. package/src/components/files/staleness.ts +29 -0
  649. package/src/components/graph/graph-canvas.tsx +24 -1
  650. package/src/components/graph/graph-controls-column.tsx +92 -0
  651. package/src/components/graph/graph-controls.tsx +83 -127
  652. package/src/components/graph/graph-form.tsx +183 -0
  653. package/src/components/graph/graph-maintenance.tsx +9 -14
  654. package/src/components/graph/graph-node-rail.tsx +147 -0
  655. package/src/components/graph/graph-page.tsx +189 -49
  656. package/src/components/graph/graph-scene.tsx +200 -30
  657. package/src/components/graph/lib/graph-helpers.ts +65 -43
  658. package/src/components/graph/node-card.tsx +64 -0
  659. package/src/components/graph/node-popover.tsx +28 -117
  660. package/src/components/graph/use-graph-theme.ts +69 -32
  661. package/src/components/graph/use-node-actions.ts +56 -0
  662. package/src/components/images/image-share.ts +4 -2
  663. package/src/components/images/image-viewer.tsx +3 -1
  664. package/src/components/images/mask-editor.tsx +7 -4
  665. package/src/components/layout/app-shell.tsx +5 -1
  666. package/src/components/layout/desktop-palette.tsx +151 -0
  667. package/src/components/layout/key-cap.tsx +15 -0
  668. package/src/components/layout/mobile-tab-bar.tsx +80 -157
  669. package/src/components/layout/shortcut-switch.tsx +32 -0
  670. package/src/components/layout/side-rail.tsx +70 -150
  671. package/src/components/layout/slide-panel.tsx +29 -2
  672. package/src/components/layout/theme.tsx +67 -0
  673. package/src/components/quick-actions/add-form.tsx +188 -0
  674. package/src/components/quick-actions/add-modal.tsx +32 -153
  675. package/src/components/quick-actions/search-modal.tsx +5 -3
  676. package/src/components/quick-actions/streaming-modal.tsx +42 -71
  677. package/src/components/quick-actions/streaming-output.tsx +112 -0
  678. package/src/components/quick-actions/whatsup-modal.tsx +38 -60
  679. package/src/components/settings/devices-agents-tab.tsx +60 -152
  680. package/src/components/settings/models-list.tsx +299 -0
  681. package/src/components/settings/models-tab.tsx +63 -337
  682. package/src/components/settings/one-time-agent-credential.tsx +1 -1
  683. package/src/components/settings/passkey-list.tsx +201 -0
  684. package/src/components/settings/passkey-tab.tsx +53 -197
  685. package/src/components/settings/pi-accounts-list.tsx +128 -0
  686. package/src/components/settings/pi-accounts.tsx +71 -170
  687. package/src/components/settings/principal-list.tsx +172 -0
  688. package/src/components/settings/settings-panel.tsx +232 -21
  689. package/src/components/settings/skills-list.tsx +276 -0
  690. package/src/components/settings/skills-tab.tsx +82 -269
  691. package/src/components/settings/tool-permissions-list.tsx +54 -0
  692. package/src/components/settings/tool-permissions.tsx +27 -46
  693. package/src/components/settings/web-search-chain.tsx +300 -0
  694. package/src/components/settings/web-search-settings.tsx +58 -328
  695. package/src/components/share/share-menu.tsx +19 -4
  696. package/src/components/voice/dictation-sheet.tsx +5 -5
  697. package/src/components/voice/mic-button.tsx +1 -1
  698. package/src/components/voice/review-card.tsx +1 -1
  699. package/src/config.ts +21 -7
  700. package/src/connection.ts +443 -0
  701. package/src/default-root.ts +16 -0
  702. package/src/hooks/use-color-scheme.ts +36 -0
  703. package/src/hooks/use-hash-routes.ts +4 -2
  704. package/src/hooks/use-media-query.ts +32 -0
  705. package/src/hooks/use-share-intake.ts +32 -12
  706. package/src/hooks/use-vpn-status.ts +18 -17
  707. package/src/hooks/use-websocket.ts +12 -428
  708. package/src/hooks/websocket-handlers/activity.ts +4 -5
  709. package/src/hooks/websocket-handlers/chat.ts +26 -5
  710. package/src/hooks/websocket-handlers/connection.ts +4 -6
  711. package/src/hooks/websocket-handlers/mask.ts +2 -3
  712. package/src/hooks/websocket-handlers/provider.ts +4 -6
  713. package/src/hooks/websocket-handlers/types.ts +6 -2
  714. package/src/index.ts +7 -3
  715. package/src/lib/api-client.ts +426 -384
  716. package/src/lib/backend.ts +20 -10
  717. package/src/lib/diff.ts +28 -62
  718. package/src/lib/light-dark.ts +83 -0
  719. package/src/lib/mermaid-theme.ts +183 -214
  720. package/src/lib/passkeys.ts +12 -4
  721. package/src/lib/push-registration.ts +19 -2
  722. package/src/lib/share-intake.ts +6 -3
  723. package/src/lib/share.ts +7 -4
  724. package/src/lib/single-key.ts +47 -0
  725. package/src/lib/tool-names.ts +31 -8
  726. package/src/root-context.tsx +40 -0
  727. package/src/root.ts +83 -0
  728. package/src/stores/activity-state.ts +295 -0
  729. package/src/stores/activity-store.ts +11 -285
  730. package/src/stores/chat-state.ts +795 -0
  731. package/src/stores/chat-store.ts +11 -705
  732. package/src/stores/connection-state.ts +78 -0
  733. package/src/stores/connection-store.ts +11 -76
  734. package/src/stores/create-stores.ts +31 -0
  735. package/src/stores/file-state.ts +399 -0
  736. package/src/stores/file-store.ts +9 -390
  737. package/src/stores/graph-state.ts +368 -0
  738. package/src/stores/graph-store.ts +10 -355
  739. package/src/stores/mask-state.ts +30 -0
  740. package/src/stores/mask-store.ts +10 -27
  741. package/src/stores/principal-state.ts +42 -0
  742. package/src/stores/principal-store.ts +10 -37
  743. package/src/stores/provider-state.ts +103 -0
  744. package/src/stores/provider-store.ts +10 -95
  745. package/src/stores/share-state.ts +56 -0
  746. package/src/stores/share-store.ts +11 -54
  747. package/src/stores/store-environment.ts +10 -0
  748. package/src/stores/ui-state.ts +143 -0
  749. package/src/stores/ui-store.ts +11 -93
  750. package/src/styles.css +4 -1
  751. package/src/theme.css +150 -97
  752. package/src/voice/asr-clients.ts +17 -17
  753. package/src/voice/use-dictation.ts +11 -8
  754. package/src/voice/voice-state.ts +57 -0
  755. package/src/voice/voice-store.ts +11 -55
@@ -1,39 +1,77 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Activity, Brain, RefreshCw, Newspaper, History, SlidersHorizontal, SquarePen, FolderTree, Waypoints, } from "lucide-react";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { SideRail as KitSideRail } from "@schlessera/brain-ui-kit";
3
+ import { useEffect } from "react";
3
4
  import { useConnectionStore } from "../../stores/connection-store.js";
4
5
  import { useActivityStore } from "../../stores/activity-store.js";
6
+ import { useChatStore, pendingApprovals } from "../../stores/chat-store.js";
5
7
  import { useUIStore } from "../../stores/ui-store.js";
6
- import { useChatStore, activeChat } from "../../stores/chat-store.js";
7
- import { cn } from "../../lib/utils.js";
8
- import { CountBadge } from "../activity/span-bits.js";
8
+ import { useMediaQuery } from "../../hooks/use-media-query.js";
9
+ /**
10
+ * The desktop navigation, on the kit's `SideRail`. The kit owns the rail —
11
+ * the one roving tab stop, the amber destination, the badge, the collapsed
12
+ * and expanded widths; this file owns what the destinations DO, which of
13
+ * them is "here", and the ⌘1–⌘5 keys the design prints beside them (D36:
14
+ * anything global takes a modifier).
15
+ *
16
+ * The five destinations are the design's (D37): Chat · Actions · Files ·
17
+ * Graph · Settings, the same five and the same order as the phone bar.
18
+ * Activity is not among them — "what needs me" and "what has been happening"
19
+ * are two lenses on one queue, so the Actions pane carries a filter and the
20
+ * badge counts what needs you: pending approvals plus the inbox. The acts
21
+ * the old rail carried (New chat, Sessions, Sync, the briefing) live in the
22
+ * ⌘K palette and the Chat header.
23
+ *
24
+ * Widths follow D22's ladder: the phone bar to 479px, this rail collapsed
25
+ * to 60px from 480 (`tablet:`), expanded to 208px from 900 (`laptop:`). The
26
+ * rail appears at the breakpoint the phone bar disappears at, so the two
27
+ * never show together.
28
+ *
29
+ * The connection status takes the wordmark's line: teal while live, amber
30
+ * while reconnecting, red when the socket is gone. No spend meter — the app
31
+ * tracks no spend — and the ⌘K cap is real, because the palette is.
32
+ */
9
33
  export function SideRail() {
10
34
  const wsStatus = useConnectionStore((s) => s.wsStatus);
11
35
  const activeView = useUIStore((s) => s.activeView);
12
36
  const setActiveView = useUIStore((s) => s.setActiveView);
13
- const toggleSessionPanel = useUIStore((s) => s.toggleSessionPanel);
14
- const toggleSyncPanel = useUIStore((s) => s.toggleSyncPanel);
15
- const toggleWhatsupPanel = useUIStore((s) => s.toggleWhatsupPanel);
37
+ const filePanelOpen = useUIStore((s) => s.filePanelOpen);
38
+ const settingsPanelOpen = useUIStore((s) => s.settingsPanelOpen);
16
39
  const toggleFilePanel = useUIStore((s) => s.toggleFilePanel);
17
40
  const toggleSettingsPanel = useUIStore((s) => s.toggleSettingsPanel);
18
- const clearMessages = useChatStore((s) => s.clearMessages);
19
- const hasMessages = useChatStore((s) => activeChat(s).messages.length > 0);
20
- const isStreaming = useChatStore((s) => activeChat(s).isStreaming);
21
41
  const inboxCount = useActivityStore((s) => s.inbox.length);
22
- /** Chat-scoped panels live in the chat page — surface it before opening them. */
23
- function inChat(toggle) {
24
- return () => {
25
- if (activeView !== "chat")
26
- setActiveView("chat");
27
- toggle();
28
- };
29
- }
30
- return (_jsxs("nav", { className: "hidden md:flex w-16 shrink-0 flex-col items-center border-r border-border bg-surface py-4 gap-1", children: [_jsx("div", { className: "mb-4", children: _jsx(Brain, { className: "h-7 w-7 text-primary" }) }), hasMessages && (_jsx(RailButton, { icon: SquarePen, label: "New chat", onClick: clearMessages })), _jsx("div", { className: "my-2 h-px w-8 bg-border" }), _jsx(RailButton, { icon: RefreshCw, label: "Sync", onClick: inChat(toggleSyncPanel), disabled: isStreaming }), _jsx(RailButton, { icon: Newspaper, label: "Whatsup", onClick: inChat(toggleWhatsupPanel), disabled: isStreaming }), _jsx(RailButton, { icon: FolderTree, label: "Files", onClick: toggleFilePanel }), _jsx(RailButton, { icon: Waypoints, label: "Graph", active: activeView === "graph", onClick: () => setActiveView(activeView === "graph" ? "chat" : "graph") }), _jsx(RailButton, { icon: Activity, label: "Activity", active: activeView === "activity", badge: inboxCount, onClick: () => setActiveView(activeView === "activity" ? "chat" : "activity") }), _jsx("div", { className: "flex-1" }), _jsx(RailButton, { icon: History, label: "Sessions", onClick: inChat(toggleSessionPanel) }), _jsx(RailButton, { icon: SlidersHorizontal, label: "Settings", onClick: toggleSettingsPanel }), _jsxs("div", { className: "mt-2 flex flex-col items-center gap-1", children: [_jsx("span", { className: cn("inline-block h-2 w-2 rounded-full", wsStatus === "connected" && "bg-green-500", wsStatus === "connecting" && "bg-primary animate-pulse", wsStatus === "disconnected" && "bg-destructive") }), _jsx("span", { className: "text-[10px] text-muted-foreground", children: wsStatus === "connected"
31
- ? "Live"
32
- : wsStatus === "connecting"
33
- ? "..."
34
- : "Off" })] })] }));
35
- }
36
- function RailButton({ icon: Icon, label, onClick, disabled, active, badge, }) {
37
- return (_jsxs("button", { onClick: onClick, disabled: disabled, title: label, className: cn("group relative flex h-10 w-10 items-center justify-center rounded-lg transition-all duration-150 hover:bg-surface-raised hover:text-foreground hover:scale-110 disabled:opacity-40 disabled:hover:scale-100", active ? "bg-surface-raised text-primary" : "text-muted-foreground"), children: [_jsx(Icon, { className: "h-4.5 w-4.5" }), badge !== undefined && _jsx(CountBadge, { count: badge, className: "-right-0.5 -top-0.5" }), _jsx("span", { className: "pointer-events-none absolute left-full ml-2 whitespace-nowrap rounded-md bg-surface-overlay px-2.5 py-1 text-xs font-medium text-foreground opacity-0 shadow-lg transition-opacity group-hover:opacity-100 border border-border", children: label })] }));
42
+ const approvalCount = useChatStore((s) => pendingApprovals(s).length);
43
+ const needsYou = inboxCount + approvalCount;
44
+ const expanded = useMediaQuery("(min-width: 900px)");
45
+ const items = [
46
+ { icon: "brain", label: "Chat", shortcut: "⌘1", onClick: () => setActiveView("chat") },
47
+ {
48
+ icon: "resolved",
49
+ label: "Actions",
50
+ shortcut: "2",
51
+ badge: needsYou > 0 ? (needsYou > 9 ? "9+" : String(needsYou)) : undefined,
52
+ onClick: () => setActiveView("activity"),
53
+ },
54
+ { icon: "files", label: "Files", shortcut: "⌘3", onClick: toggleFilePanel },
55
+ { icon: "graph", label: "Graph", shortcut: "⌘4", onClick: () => setActiveView("graph") },
56
+ { icon: "settings", label: "Settings", shortcut: "⌘5", onClick: toggleSettingsPanel },
57
+ ];
58
+ // A panel over the view is "here" while it is open; otherwise the view is.
59
+ const active = filePanelOpen ? 2 : settingsPanelOpen ? 4 : activeView === "chat" ? 0 : activeView === "activity" ? 1 : 3;
60
+ useEffect(() => {
61
+ if (typeof window === "undefined")
62
+ return;
63
+ function onKey(e) {
64
+ if (!(e.metaKey || e.ctrlKey) || e.altKey || e.shiftKey)
65
+ return;
66
+ const n = Number(e.key);
67
+ if (!Number.isInteger(n) || n < 1 || n > items.length)
68
+ return;
69
+ e.preventDefault();
70
+ items[n - 1].onClick?.();
71
+ }
72
+ window.addEventListener("keydown", onKey);
73
+ return () => window.removeEventListener("keydown", onKey);
74
+ });
75
+ return (_jsx("nav", { "aria-label": "Primary", className: "hidden tablet:flex shrink-0", children: _jsx(KitSideRail, { items: items, active: active, expanded: expanded, status: wsStatus === "connected" ? "live" : wsStatus === "connecting" ? "reconnecting" : "offline", statusTone: wsStatus === "connected" ? "teal" : wsStatus === "connecting" ? "amber" : "red", spendPct: null, hint: "Command palette" }) }));
38
76
  }
39
77
  //# sourceMappingURL=side-rail.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"side-rail.js","sourceRoot":"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I,CAAC,GAAG,KAAK,CAAC,MAAM;gBAAE,OAAO;YAC9D,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,KAAK,CAAC,CAAC,GAAG,CAAC,CAAE,CAAC,OAAO,EAAE,EAAE,CAAC;QAC5B,CAAC;QACD,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAC1C,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,OAAO,CACL,4BAAgB,SAAS,EAAC,SAAS,EAAC,6BAA6B,YAC/D,KAAC,WAAW,IACV,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,EAClG,UAAU,EAAE,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAC3F,QAAQ,EAAE,IAAI,EACd,IAAI,EAAC,iBAAiB,GACtB,GACE,CACP,CAAC;AACJ,CAAC"}
@@ -1,9 +1,19 @@
1
1
  import { type ReactNode } from "react";
2
- export declare function SlidePanel({ open, onClose, title, wide, children, }: {
2
+ /**
3
+ * `drawer` slides in from the right over a backdrop and draws its own header.
4
+ * `pane` (D5, from `laptop:` up) is the design's settings PANE: a fixed layer
5
+ * over the content area, offset by the rail's width, with no backdrop and no
6
+ * header of its own — the children draw the header row, because a pane's
7
+ * chrome is a `ScreenHeader`, not a drawer's title bar. It renders nothing
8
+ * while closed: there is no slide to outlive.
9
+ */
10
+ export type SlidePanelMode = "drawer" | "pane";
11
+ export declare function SlidePanel({ open, onClose, title, wide, mode, children, }: {
3
12
  open: boolean;
4
13
  onClose: () => void;
5
14
  title: string;
6
15
  wide?: boolean;
16
+ mode?: SlidePanelMode;
7
17
  children: ReactNode;
8
- }): import("react").JSX.Element;
18
+ }): import("react").JSX.Element | null;
9
19
  //# sourceMappingURL=slide-panel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"slide-panel.d.ts","sourceRoot":"","sources":["../../../src/components/layout/slide-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAQlD,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,OAAO,EACP,KAAK,EACL,IAAI,EACJ,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAuDA"}
1
+ {"version":3,"file":"slide-panel.d.ts","sourceRoot":"","sources":["../../../src/components/layout/slide-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAQlD;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE/C,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,OAAO,EACP,KAAK,EACL,IAAI,EACJ,IAAe,EACf,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,QAAQ,EAAE,SAAS,CAAC;CACrB,sCAsEA"}
@@ -5,7 +5,7 @@ import { useDeferredUnmount } from "../../hooks/use-deferred-unmount.js";
5
5
  import { cn } from "../../lib/utils.js";
6
6
  /** Matches the `duration-300` slide-out below. */
7
7
  const SLIDE_OUT_MS = 300;
8
- export function SlidePanel({ open, onClose, title, wide, children, }) {
8
+ export function SlidePanel({ open, onClose, title, wide, mode = "drawer", children, }) {
9
9
  useEffect(() => {
10
10
  if (!open)
11
11
  return;
@@ -23,6 +23,15 @@ export function SlidePanel({ open, onClose, title, wide, children, }) {
23
23
  * preserved anything worth keeping.
24
24
  */
25
25
  const showContent = useDeferredUnmount(open, SLIDE_OUT_MS);
26
- return (_jsxs(_Fragment, { children: [open && (_jsx("div", { className: "fixed inset-0 z-40 bg-black/40 transition-opacity md:bg-black/20", onClick: onClose })), _jsxs("div", { className: cn("fixed right-0 top-0 z-50 flex h-full flex-col border-l border-border bg-surface shadow-[0_16px_48px_rgba(0,0,0,0.5)]", "transform transition-transform duration-300 ease-out", open ? "translate-x-0" : "translate-x-full", wide ? "w-full md:w-[480px]" : "w-full md:w-80"), children: [_jsxs("div", { className: "flex items-center justify-between border-b border-border px-5 py-4", children: [_jsx("h2", { className: "font-[family-name:var(--font-display)] text-lg text-foreground", children: title }), _jsx("button", { onClick: onClose, className: "rounded-lg p-2.5 md:p-1.5 text-muted-foreground transition-colors hover:bg-surface-raised hover:text-foreground", children: _jsx(X, { className: "h-5 w-5 md:h-4 md:w-4" }) })] }), _jsx("div", { className: "flex-1 overflow-y-auto", children: showContent ? children : null })] })] }));
26
+ if (mode === "pane") {
27
+ if (!open)
28
+ return null;
29
+ return (_jsx("section", { "aria-label": title, className: "fixed top-0 bottom-0 right-0 tablet:left-[60px] laptop:left-[208px] z-40 flex flex-col overflow-hidden bg-surface", children: children }));
30
+ }
31
+ return (_jsxs(_Fragment, { children: [open && (_jsx("div", { className: "fixed inset-0 z-40 bg-black/40 transition-opacity md:bg-black/20", onClick: onClose })), _jsxs("div", { className: cn("fixed right-0 top-0 z-50 flex h-full flex-col border-l border-border bg-surface shadow-[0_16px_48px_rgba(0,0,0,0.5)]", "transform transition-[transform,box-shadow] duration-300 ease-out",
32
+ // A closed drawer sits just past the right edge, and its 48px shadow
33
+ // would still bleed into the viewport: the shadow fades with the
34
+ // slide, and a closed drawer takes no clicks.
35
+ open ? "translate-x-0" : "translate-x-full shadow-none pointer-events-none", wide ? "w-full md:w-[480px]" : "w-full md:w-80"), children: [_jsxs("div", { className: "flex items-center justify-between border-b border-border px-5 py-4", children: [_jsx("h2", { className: "font-[family-name:var(--font-display)] text-lg text-foreground", children: title }), _jsx("button", { onClick: onClose, className: "rounded-lg p-2.5 md:p-1.5 text-muted-foreground transition-colors hover:bg-surface-raised hover:text-foreground", children: _jsx(X, { className: "h-5 w-5 md:h-4 md:w-4" }) })] }), _jsx("div", { className: "flex-1 overflow-y-auto", children: showContent ? children : null })] })] }));
27
36
  }
28
37
  //# sourceMappingURL=slide-panel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"slide-panel.js","sourceRoot":"","sources":["../../../src/components/layout/slide-panel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC,kDAAkD;AAClD,MAAM,YAAY,GAAG,GAAG,CAAC;AAEzB,MAAM,UAAU,UAAU,CAAC,EACzB,IAAI,EACJ,OAAO,EACP,KAAK,EACL,IAAI,EACJ,QAAQ,GAOT;IACC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,IAAI;YAAE,OAAO;QAClB,MAAM,OAAO,GAAG,CAAC,CAAgB,EAAE,EAAE;YACnC,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ;gBAAE,OAAO,EAAE,CAAC;QACpC,CAAC,CAAC;QACF,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC9C,OAAO,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iHAAiH,YAE3H,KAAC,CAAC,IAAC,SAAS,EAAC,uBAAuB,GAAG,GAChC,IACL,EAGN,cAAK,SAAS,EAAC,wBAAwB,YAAE,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAO,IACzE,IACL,CACJ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Writes the stored theme preference to `<html data-theme>`. That attribute
3
+ * is the whole switch: the kit's `tokens.css` maps it onto `color-scheme`,
4
+ * every `--bk-*` token is `light-dark()`, and the browser picks the half — so
5
+ * nothing else in the app has to know. `system` lets `prefers-color-scheme`
6
+ * decide.
7
+ *
8
+ * Runs in an effect, so the first paint of a stored non-default preference
9
+ * can still flash the default. A host that cares puts a one-line inline
10
+ * script in its HTML before the stylesheet:
11
+ * `document.documentElement.dataset.theme = localStorage.getItem("brain-theme") || "dark"`
12
+ * (with the root's storage prefix, if it sets one). The kit's README says the
13
+ * same; the app cannot do it for the host because the host owns the HTML.
14
+ */
15
+ export declare function useApplyTheme(): void;
16
+ /**
17
+ * The design's three-way toggle, kept in Settings ("respect the system, offer
18
+ * the override"). One radiogroup, three options, no icon: the label is the
19
+ * meaning.
20
+ */
21
+ export declare function ThemeToggle(): import("react").JSX.Element;
22
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/components/layout/theme.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAMpC;AAQD;;;;GAIG;AACH,wBAAgB,WAAW,gCA6B1B"}
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect } from "react";
3
+ import { useUIStore } from "../../stores/ui-store.js";
4
+ import { cn } from "../../lib/utils.js";
5
+ /**
6
+ * Writes the stored theme preference to `<html data-theme>`. That attribute
7
+ * is the whole switch: the kit's `tokens.css` maps it onto `color-scheme`,
8
+ * every `--bk-*` token is `light-dark()`, and the browser picks the half — so
9
+ * nothing else in the app has to know. `system` lets `prefers-color-scheme`
10
+ * decide.
11
+ *
12
+ * Runs in an effect, so the first paint of a stored non-default preference
13
+ * can still flash the default. A host that cares puts a one-line inline
14
+ * script in its HTML before the stylesheet:
15
+ * `document.documentElement.dataset.theme = localStorage.getItem("brain-theme") || "dark"`
16
+ * (with the root's storage prefix, if it sets one). The kit's README says the
17
+ * same; the app cannot do it for the host because the host owns the HTML.
18
+ */
19
+ export function useApplyTheme() {
20
+ const theme = useUIStore((s) => s.theme);
21
+ useEffect(() => {
22
+ if (typeof document === "undefined")
23
+ return;
24
+ document.documentElement.dataset.theme = theme;
25
+ }, [theme]);
26
+ }
27
+ const OPTIONS = [
28
+ { id: "system", label: "System", hint: "Follow the device" },
29
+ { id: "light", label: "Paper", hint: "Light, for daylight" },
30
+ { id: "dark", label: "Dark", hint: "The default" },
31
+ ];
32
+ /**
33
+ * The design's three-way toggle, kept in Settings ("respect the system, offer
34
+ * the override"). One radiogroup, three options, no icon: the label is the
35
+ * meaning.
36
+ */
37
+ export function ThemeToggle() {
38
+ const theme = useUIStore((s) => s.theme);
39
+ const setTheme = useUIStore((s) => s.setTheme);
40
+ return (_jsx("div", { role: "radiogroup", "aria-label": "Theme", className: "flex items-center gap-1 rounded-lg border border-border bg-surface p-0.5", children: OPTIONS.map((o) => (_jsx("button", { type: "button", role: "radio", "aria-checked": theme === o.id, title: o.hint, onClick: () => setTheme(o.id), className: cn("rounded-md px-2.5 py-1 text-xs font-medium transition-colors", theme === o.id
41
+ ? "bg-surface-raised text-foreground"
42
+ : "text-muted-foreground hover:text-foreground"), children: o.label }, o.id))) }));
43
+ }
44
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","sourceRoot":"","sources":["../../../src/components/layout/theme.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,C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,KAAK,EAAE,CAAC,CAAC,IAAI,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAC7B,SAAS,EAAE,EAAE,CACX,8DAA8D,EAC9D,KAAK,KAAK,CAAC,CAAC,EAAE;gBACZ,CAAC,CAAC,mCAAmC;gBACrC,CAAC,CAAC,6CAA6C,CAClD,YAEA,CAAC,CAAC,KAAK,IAbH,CAAC,CAAC,EAAE,CAcF,CACV,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,44 @@
1
+ import type { RefObject } from "react";
2
+ /**
3
+ * The "Add to brain" form, rendered from props (S6). `AddPanel` is the
4
+ * container: it owns the draft, the `brain add` / `brain index` requests and
5
+ * the `operation.epoch` guard that keeps a stale save from landing in a
6
+ * fresh form; this owns the two screens — the form, and the receipt after a
7
+ * save — and nothing else.
8
+ *
9
+ * `state` is the container's machine: `editing` and `error` show the form
10
+ * (with the error under it), `saving` is the form with the Add button inert,
11
+ * `saved` is the receipt. On the receipt, `indexed` is three-valued because
12
+ * an older server does not report it: `false` offers a retry, `true` says
13
+ * so, `undefined` says the server did not say.
14
+ *
15
+ * Fields stay native (the kit has no text input); the buttons are the kit's.
16
+ * The content field's ref is the container's, because focus after open and
17
+ * after "Add another" is timed against the panel's slide, which the
18
+ * container owns.
19
+ */
20
+ export type AddState = "editing" | "saving" | "saved" | "error";
21
+ export interface AddDraft {
22
+ content: string;
23
+ title: string;
24
+ type: string;
25
+ tags: string;
26
+ }
27
+ export interface AddFormProps {
28
+ state: AddState;
29
+ draft: AddDraft;
30
+ /** Types already in the brain, offered as completions — a hint list, not a closed set. */
31
+ knownTypes: string[];
32
+ error: string;
33
+ savedPath: string;
34
+ indexed: boolean | undefined;
35
+ indexing: boolean;
36
+ contentRef: RefObject<HTMLTextAreaElement | null>;
37
+ onDraft: (patch: Partial<AddDraft>) => void;
38
+ onSave: () => void;
39
+ onRetryIndex: () => void;
40
+ onAddAnother: () => void;
41
+ onClose: () => void;
42
+ }
43
+ export declare function AddForm(p: AddFormProps): import("react").JSX.Element;
44
+ //# sourceMappingURL=add-form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-form.d.ts","sourceRoot":"","sources":["../../../src/components/quick-actions/add-form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAa,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AAEhE,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,QAAQ,CAAC;IAChB,0FAA0F;IAC1F,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IAClD,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;IAC5C,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,YAAY,+BA6HtC"}
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, Callout } from "@schlessera/brain-ui-kit";
3
+ import { CheckCircle2 } from "lucide-react";
4
+ import { useId } from "react";
5
+ import { Kbd } from "../layout/kbd.js";
6
+ export function AddForm(p) {
7
+ const typesId = useId();
8
+ const saving = p.state === "saving";
9
+ const canSave = p.draft.content.trim().length > 0 && !saving;
10
+ function onKeyDown(e) {
11
+ // Cmd/Ctrl+Enter saves from anywhere in the form. The container refuses
12
+ // a save that is not from `editing` or `error`, so the receipt is safe.
13
+ if ((e.metaKey || e.ctrlKey) && e.key === "Enter") {
14
+ e.preventDefault();
15
+ p.onSave();
16
+ }
17
+ }
18
+ if (p.state === "saved") {
19
+ return (_jsx("div", { className: "flex h-full flex-col", onKeyDown: onKeyDown, children: _jsxs("div", { className: "flex flex-1 flex-col items-center justify-center gap-4 px-8 text-center", children: [_jsx(CheckCircle2, { className: "h-8 w-8 text-primary" }), _jsx("p", { className: "text-sm text-foreground", children: "Added to your brain." }), _jsx("p", { className: "text-xs text-muted-foreground", children: p.indexed === false
20
+ ? "Saved, but not indexed. Your content is safe; search may not find it yet."
21
+ : p.indexed === true
22
+ ? "Saved and indexed. Run a sync when you want to push it."
23
+ : "Saved. This server did not report whether indexing completed." }), p.savedPath && _jsx("p", { className: "break-all text-xs text-muted-foreground", children: p.savedPath }), p.indexed === false && (_jsxs("div", { className: "flex flex-col items-center gap-2", role: "status", children: [p.error && _jsx("p", { className: "text-xs text-destructive", children: p.error }), _jsx(Button, { label: p.indexing ? "Indexing…" : "Retry indexing", icon: "retry", tone: "primary", size: "sm", block: false, disabled: p.indexing, onClick: p.onRetryIndex })] })), _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { label: "Add another", icon: "add", tone: "ghost", size: "sm", block: false, onClick: p.onAddAnother }), _jsx(Button, { label: "Done", icon: "confirm", tone: "primary", size: "sm", block: false, onClick: p.onClose })] })] }) }));
24
+ }
25
+ return (_jsxs("div", { className: "flex h-full flex-col", onKeyDown: onKeyDown, children: [_jsxs("div", { className: "flex-1 space-y-4 overflow-y-auto p-5", children: [_jsx(Field, { label: "Note", children: _jsx("textarea", { ref: p.contentRef, value: p.draft.content, onChange: (e) => p.onDraft({ content: e.target.value }), rows: 8, placeholder: "What do you want to remember?", className: "w-full resize-y rounded-lg border border-border bg-surface-raised px-3 py-2 text-sm text-foreground outline-none transition-colors placeholder:text-muted-foreground focus:border-primary/40" }) }), _jsx(Field, { label: "Title", hint: "optional, derived from the note if empty", children: _jsx("input", { value: p.draft.title, onChange: (e) => p.onDraft({ title: e.target.value }), className: "w-full rounded-lg border border-border bg-surface-raised px-3 py-2 text-sm text-foreground outline-none transition-colors focus:border-primary/40" }) }), _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [_jsxs(Field, { label: "Type", hint: "optional", children: [_jsx("input", { value: p.draft.type, onChange: (e) => p.onDraft({ type: e.target.value }), list: typesId, placeholder: "note", className: "w-full rounded-lg border border-border bg-surface-raised px-3 py-2 text-sm text-foreground outline-none transition-colors placeholder:text-muted-foreground focus:border-primary/40" }), _jsx("datalist", { id: typesId, children: p.knownTypes.map((t) => (_jsx("option", { value: t }, t))) })] }), _jsx(Field, { label: "Tags", hint: "comma-separated", children: _jsx("input", { value: p.draft.tags, onChange: (e) => p.onDraft({ tags: e.target.value }), placeholder: "idea, reading", className: "w-full rounded-lg border border-border bg-surface-raised px-3 py-2 text-sm text-foreground outline-none transition-colors placeholder:text-muted-foreground focus:border-primary/40" }) })] }), p.state === "error" && (_jsx("div", { role: "alert", children: _jsx(Callout, { tone: "red", variant: "banner", icon: "failed", mono: true, text: p.error }) }))] }), _jsxs("div", { className: "flex items-center justify-between border-t border-border px-5 py-3", children: [_jsxs("span", { className: "text-[11px] text-muted-foreground", children: [_jsx(Kbd, { children: "Ctrl" }), "/", _jsx(Kbd, { children: "Cmd" }), " + ", _jsx(Kbd, { children: "\u21B5" }), " to save"] }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { label: "Cancel", tone: "quiet", size: "sm", block: false, onClick: p.onClose }), _jsx(Button, { label: saving ? "Saving…" : "Add", icon: "add", tone: "primary", size: "sm", block: false, disabled: !canSave, onClick: p.onSave })] })] })] }));
26
+ }
27
+ function Field({ label, hint, children }) {
28
+ return (_jsxs("label", { className: "block space-y-1.5", children: [_jsxs("span", { className: "text-xs font-medium text-foreground", children: [label, hint && _jsxs("span", { className: "font-normal text-muted-foreground", children: [" \u2014 ", hint] })] }), children] }));
29
+ }
30
+ //# sourceMappingURL=add-form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-form.js","sourceRoot":"","sources":["../../../src/components/quick-actions/add-form.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AA8CvC,MAAM,UAAU,OAAO,CAAC,CAAe;IACrC,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;IACxB,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC;IACpC,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;IAE7D,SAAS,SAAS,CAAC,CAAsB;QACvC,wEAAwE;QACxE,wEAAwE;QACxE,IAAI,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC;YAClD,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,CAAC,CAAC,MAAM,EAAE,CAAC;QACb,CAAC;IACH,CAAC;IAED,IAAI,CAAC,CAAC,KAAK,KAAK,OAAO,EAAE,CAAC;QACxB,OAAO,CACL,cAAK,SAAS,EAAC,sBAAsB,EAAC,SAAS,EAAE,SAAS,YACxD,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,EAAE,CAAC,OAAO,EAClB,OAAO,EAAE,CAAC,CAAC,MAAM,GACjB,IACE,IACF,IACF,CACP,CAAC;AACJ,CAAC;AAED,SAAS,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAyD;IAC7F,OAAO,CACL,iBAAO,SAAS,EAAC,mBAAmB,aAClC,gBAAM,SAAS,EAAC,qCAAqC,aAClD,KAAK,EACL,IAAI,IAAI,gBAAM,SAAS,EAAC,mCAAmC,yBAAK,IAAI,IAAQ,IACxE,EACN,QAAQ,IACH,CACT,CAAC;AACJ,CAAC"}
@@ -1,3 +1,10 @@
1
+ /**
2
+ * The container (S6): the draft, `brain add`, `brain index` and the
3
+ * `operation.epoch` guard live here; `AddForm` draws from props. The epoch
4
+ * is bumped on open, on close, on "Add another" and on every request, so a
5
+ * response from a form the user has already left cannot land in the one
6
+ * they are looking at.
7
+ */
1
8
  export declare function AddPanel({ open, onClose, }: {
2
9
  open: boolean;
3
10
  onClose: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"add-modal.d.ts","sourceRoot":"","sources":["../../../src/components/quick-actions/add-modal.tsx"],"names":[],"mappings":"AAgBA,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,OAAO,GACR,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,+BAuOA"}
1
+ {"version":3,"file":"add-modal.d.ts","sourceRoot":"","sources":["../../../src/components/quick-actions/add-modal.tsx"],"names":[],"mappings":"AAaA;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,OAAO,GACR,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,+BAgIA"}
@@ -1,9 +1,8 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useState, useEffect, useRef } from "react";
3
- import { Loader2, CheckCircle2, XCircle } from "lucide-react";
4
3
  import { SlidePanel } from "../layout/slide-panel.js";
5
- import { Kbd } from "../layout/kbd.js";
6
- import { api } from "../../lib/api-client.js";
4
+ import { useBrainApi } from "../../root-context.js";
5
+ import { AddForm } from "./add-form.js";
7
6
  /** Split the tags field on commas; empties dropped so "a,,b," is clean. */
8
7
  function parseTags(raw) {
9
8
  return raw
@@ -11,7 +10,15 @@ function parseTags(raw) {
11
10
  .map((t) => t.trim())
12
11
  .filter(Boolean);
13
12
  }
13
+ /**
14
+ * The container (S6): the draft, `brain add`, `brain index` and the
15
+ * `operation.epoch` guard live here; `AddForm` draws from props. The epoch
16
+ * is bumped on open, on close, on "Add another" and on every request, so a
17
+ * response from a form the user has already left cannot land in the one
18
+ * they are looking at.
19
+ */
14
20
  export function AddPanel({ open, onClose, }) {
21
+ const api = useBrainApi();
15
22
  const [content, setContent] = useState("");
16
23
  const [title, setTitle] = useState("");
17
24
  const [type, setType] = useState("");
@@ -30,6 +37,7 @@ export function AddPanel({ open, onClose, }) {
30
37
  if (!open)
31
38
  return;
32
39
  operation.epoch++;
40
+ setKnownTypes([]);
33
41
  setSavedPath("");
34
42
  setIndexed(undefined);
35
43
  setIndexing(false);
@@ -55,7 +63,7 @@ export function AddPanel({ open, onClose, }) {
55
63
  cancelled = true;
56
64
  clearTimeout(t);
57
65
  };
58
- }, [open, operation]);
66
+ }, [open, operation, api]);
59
67
  async function handleSave() {
60
68
  const body = content.trim();
61
69
  if (!body || (state !== "editing" && state !== "error"))
@@ -115,20 +123,15 @@ export function AddPanel({ open, onClose, }) {
115
123
  setState("editing");
116
124
  setTimeout(() => contentRef.current?.focus(), 0);
117
125
  }
118
- function handleKeyDown(e) {
119
- // Cmd/Ctrl+Enter saves from anywhere in the form.
120
- if ((e.metaKey || e.ctrlKey) && e.key === "Enter") {
121
- e.preventDefault();
122
- void handleSave();
123
- }
124
- }
125
- const saving = state === "saving";
126
- const canSave = content.trim().length > 0 && !saving;
127
- return (_jsx(SlidePanel, { open: open, onClose: onClose, title: "Add to brain", wide: true, children: _jsx("div", { className: "flex h-full flex-col", onKeyDown: handleKeyDown, children: state === "saved" ? (_jsxs("div", { className: "flex flex-1 flex-col items-center justify-center gap-4 px-8 text-center", children: [_jsx(CheckCircle2, { className: "h-8 w-8 text-primary" }), _jsx("p", { className: "text-sm text-foreground", children: "Added to your brain." }), _jsx("p", { className: "text-xs text-muted-foreground", children: indexed === false ? "Saved, but not indexed. Your content is safe; search may not find it yet."
128
- : indexed === true ? "Saved and indexed. Run a sync when you want to push it."
129
- : "Saved. This server did not report whether indexing completed." }), savedPath && _jsx("p", { className: "break-all text-xs text-muted-foreground", children: savedPath }), indexed === false && (_jsxs("div", { className: "space-y-2", role: "status", children: [error && _jsx("p", { className: "text-xs text-destructive", children: error }), _jsx("button", { onClick: retryIndex, disabled: indexing, className: "rounded-lg bg-primary px-4 py-1.5 text-xs text-primary-foreground disabled:opacity-40", children: indexing ? "Indexing..." : "Retry indexing" })] })), _jsxs("div", { className: "flex gap-2", children: [_jsx("button", { onClick: handleAddAnother, className: "rounded-lg bg-surface-raised px-4 py-1.5 text-xs font-medium text-foreground transition-colors hover:bg-surface-overlay", children: "Add another" }), _jsx("button", { onClick: onClose, className: "rounded-lg bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground transition-opacity hover:opacity-90", children: "Done" })] })] })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex-1 space-y-4 overflow-y-auto p-5", children: [_jsx(Field, { label: "Note", children: _jsx("textarea", { ref: contentRef, value: content, onChange: (e) => setContent(e.target.value), rows: 8, placeholder: "What do you want to remember?", className: "w-full resize-y rounded-lg border border-border bg-surface-raised px-3 py-2 text-sm text-foreground outline-none transition-colors placeholder:text-muted-foreground focus:border-primary/40" }) }), _jsx(Field, { label: "Title", hint: "optional, derived from the note if empty", children: _jsx("input", { value: title, onChange: (e) => setTitle(e.target.value), className: "w-full rounded-lg border border-border bg-surface-raised px-3 py-2 text-sm text-foreground outline-none transition-colors focus:border-primary/40" }) }), _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [_jsxs(Field, { label: "Type", hint: "optional", children: [_jsx("input", { value: type, onChange: (e) => setType(e.target.value), list: "brain-add-types", placeholder: "note", className: "w-full rounded-lg border border-border bg-surface-raised px-3 py-2 text-sm text-foreground outline-none transition-colors placeholder:text-muted-foreground focus:border-primary/40" }), _jsx("datalist", { id: "brain-add-types", children: knownTypes.map((t) => (_jsx("option", { value: t }, t))) })] }), _jsx(Field, { label: "Tags", hint: "comma-separated", children: _jsx("input", { value: tags, onChange: (e) => setTags(e.target.value), placeholder: "idea, reading", className: "w-full rounded-lg border border-border bg-surface-raised px-3 py-2 text-sm text-foreground outline-none transition-colors placeholder:text-muted-foreground focus:border-primary/40" }) })] }), state === "error" && (_jsxs("div", { className: "flex items-start gap-2 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2", children: [_jsx(XCircle, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-destructive" }), _jsx("span", { className: "text-xs text-destructive", children: error })] }))] }), _jsxs("div", { className: "flex items-center justify-between border-t border-border px-5 py-3", children: [_jsxs("span", { className: "text-[11px] text-muted-foreground", children: [_jsx(Kbd, { children: "Ctrl" }), "/", _jsx(Kbd, { children: "Cmd" }), " + ", _jsx(Kbd, { children: "\u21B5" }), " to save"] }), _jsxs("div", { className: "flex gap-2", children: [_jsx("button", { onClick: onClose, className: "rounded-lg bg-surface-raised px-4 py-1.5 text-xs font-medium text-foreground transition-colors hover:bg-surface-overlay", children: "Cancel" }), _jsxs("button", { onClick: handleSave, disabled: !canSave, className: "flex items-center gap-1.5 rounded-lg bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground transition-opacity hover:opacity-90 disabled:opacity-40", children: [saving && _jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin" }), saving ? "Saving..." : "Add"] })] })] })] })) }) }));
130
- }
131
- function Field({ label, hint, children, }) {
132
- return (_jsxs("label", { className: "block space-y-1.5", children: [_jsxs("span", { className: "text-xs font-medium text-foreground", children: [label, hint && (_jsxs("span", { className: "font-normal text-muted-foreground", children: [" \u2014 ", hint] }))] }), children] }));
126
+ return (_jsx(SlidePanel, { open: open, onClose: onClose, title: "Add to brain", wide: true, children: _jsx(AddForm, { state: state, draft: { content, title, type, tags }, knownTypes: knownTypes, error: error, savedPath: savedPath, indexed: indexed, indexing: indexing, contentRef: contentRef, onDraft: (patch) => {
127
+ if (patch.content !== undefined)
128
+ setContent(patch.content);
129
+ if (patch.title !== undefined)
130
+ setTitle(patch.title);
131
+ if (patch.type !== undefined)
132
+ setType(patch.type);
133
+ if (patch.tags !== undefined)
134
+ setTags(patch.tags);
135
+ }, onSave: () => void handleSave(), onRetryIndex: () => void retryIndex(), onAddAnother: handleAddAnother, onClose: onClose }) }));
133
136
  }
134
137
  //# sourceMappingURL=add-modal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-modal.js","sourceRoot":"","sources":["../../../src/components/quick-actions/add-modal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAI9C,2EAA2E;AAC3E,SAAS,SAAS,CAAC,GAAW;IAC5B,OAAO,GAAG;SACP,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,OAAO,CAAC,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,EACvB,IAAI,EACJ,O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,GAAG,sBAAU,SAAG,KAAC,GAAG,yBAAQ,gBACxC,EACP,eAAK,SAAS,EAAC,YAAY,aACzB,iBACE,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,yHAAyH,uBAG5H,EACT,kBACE,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,CAAC,OAAO,EAClB,SAAS,EAAC,iKAAiK,aAE1K,MAAM,IAAI,KAAC,OAAO,IAAC,SAAS,EAAC,0BAA0B,GAAG,EAC1D,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,IACtB,IACL,IACF,IACL,CACJ,GACG,GACK,CACd,CAAC;AACJ,CAAC;AAED,SAAS,KAAK,CAAC,EACb,KAAK,EACL,IAAI,EACJ,QAAQ,GAKT;IACC,OAAO,CACL,iBAAO,SAAS,EAAC,mBAAmB,aAClC,gBAAM,SAAS,EAAC,qCAAqC,aAClD,KAAK,EACL,IAAI,IAAI,CACP,gBAAM,SAAS,EAAC,mCAAmC,yBAAK,IAAI,IAAQ,CACrE,IACI,EACN,QAAQ,IACH,CACT,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"add-modal.js","sourceRoot":"","sources":["../../../src/components/quick-actions/add-modal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,OAAO,EAA0B,MAAM,eAAe,CAAC;AAEhE,2EAA2E;AAC3E,SAAS,SAAS,CAAC,GAAW;IAC5B,OAAO,GAAG;SACP,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,OAAO,CAAC,CAAC;AACrB,CAAC;AAED;;;;;;GAMG;A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S;oBAAE,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC3D,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;oBAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACrD,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;oBAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAClD,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;oBAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACpD,CAAC,EACD,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,UAAU,EAAE,EAC/B,YAAY,EAAE,GAAG,EAAE,CAAC,KAAK,UAAU,EAAE,EACrC,YAAY,EAAE,gBAAgB,EAC9B,OAAO,EAAE,OAAO,GAChB,GACS,CACd,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"search-modal.d.ts","sourceRoot":"","sources":["../../../src/components/quick-actions/search-modal.tsx"],"names":[],"mappings":"AAiBA,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,OAAO,GACR,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,+BAqOA"}
1
+ {"version":3,"file":"search-modal.d.ts","sourceRoot":"","sources":["../../../src/components/quick-actions/search-modal.tsx"],"names":[],"mappings":"AAkBA,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,OAAO,GACR,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,+BAsOA"}
@@ -5,7 +5,7 @@ import { SlidePanel } from "../layout/slide-panel.js";
5
5
  import { Kbd } from "../layout/kbd.js";
6
6
  import { useFileStore } from "../../stores/file-store.js";
7
7
  import { useUIStore } from "../../stores/ui-store.js";
8
- import { api } from "../../lib/api-client.js";
8
+ import { useBrainApi } from "../../root-context.js";
9
9
  import { parseSnippet } from "../../lib/search-snippet.js";
10
10
  import { cn } from "../../lib/utils.js";
11
11
  /** Wait this long after the last keystroke before hitting the CLI. */
@@ -13,6 +13,7 @@ const DEBOUNCE_MS = 250;
13
13
  const MIN_QUERY = 2;
14
14
  const LIMIT = 25;
15
15
  export function SearchPanel({ open, onClose, }) {
16
+ const api = useBrainApi();
16
17
  const [query, setQuery] = useState("");
17
18
  const [state, setState] = useState("idle");
18
19
  const [resultQuery, setResultQuery] = useState("");
@@ -80,7 +81,7 @@ export function SearchPanel({ open, onClose, }) {
80
81
  if (controllerRef.current === controller)
81
82
  controllerRef.current = null;
82
83
  }
83
- }, [cancelSearch]);
84
+ }, [cancelSearch, api]);
84
85
  // Fresh panel every time it opens: stale results from a previous query would
85
86
  // otherwise flash before the first search lands.
86
87
  useEffect(() => {
@@ -99,7 +100,7 @@ export function SearchPanel({ open, onClose, }) {
99
100
  // mobile keyboard on some browsers.
100
101
  const t = setTimeout(() => inputRef.current?.focus(), 120);
101
102
  return () => { clearTimeout(t); cancelSearch(); };
102
- }, [open, cancelSearch]);
103
+ }, [open, cancelSearch, api]);
103
104
  // Debounced search on typing.
104
105
  useEffect(() => {
105
106
  if (!open)