@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":"graph-helpers.js","sourceRoot":"","sources":["../../../../src/components/graph/lib/graph-helpers.ts"],"names":[],"mappings":"AAUA,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,UAAU,UAAU,CACxB,MAAoE;IAEpE,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE;YAAE,SAAS;QACpE,KAAK,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,GAAG,CAAC,IAAI,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;IAChF,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC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G,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACjC,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YAAE,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACrG,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * The selected node's card, rendered from props (S7). `NodePopover` is the
3
+ * container: it reads the graph, file and UI stores and decides which
4
+ * actions apply; this draws a kit `Surface` with the node's kind and topic
5
+ * as chips, its path as a `PathRef`, its degrees as machine meta, and the
6
+ * actions as kit `Button`s — "Open note" primary, the rest ghost.
7
+ */
8
+ export interface NodeCardProps {
9
+ kind: string;
10
+ title: string;
11
+ path: string;
12
+ topic?: string | null;
13
+ /** The topic cluster's swatch colour, from the canvas's own palette. */
14
+ topicColor?: string;
15
+ inDegree: number;
16
+ outDegree: number;
17
+ /** Hops from the centre; 0 or undefined draws nothing. */
18
+ distance?: number;
19
+ canOpen: boolean;
20
+ canFocus: boolean;
21
+ canExpand: boolean;
22
+ onOpen: () => void;
23
+ onFocus: () => void;
24
+ onExpand: () => void;
25
+ onClose: () => void;
26
+ }
27
+ export declare function NodeCard(p: NodeCardProps): import("react").JSX.Element;
28
+ //# sourceMappingURL=node-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-card.d.ts","sourceRoot":"","sources":["../../../src/components/graph/node-card.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,aAAa,+BAkCxC"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, Chip, PathRef, Surface } from "@schlessera/brain-ui-kit";
3
+ export function NodeCard(p) {
4
+ const hops = p.distance !== undefined && p.distance > 0 ? `${p.distance} hop${p.distance === 1 ? "" : "s"}` : null;
5
+ return (_jsx("div", { className: "pointer-events-auto absolute inset-x-2 bottom-2 z-10 shadow-2xl md:inset-x-auto md:bottom-4 md:left-4 md:w-80", children: _jsxs(Surface, { emphasis: "strong", pad: 12, children: [_jsxs("div", { className: "flex items-start justify-between gap-2", children: [_jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: [_jsx(Chip, { label: p.kind, variant: "kv", tone: "neutral", caps: true }), p.topic && (_jsxs("span", { title: "Topic cluster inferred from this note's links", className: "flex min-w-0 items-center gap-1.5", children: [p.topicColor && _jsx("span", { "aria-hidden": "true", className: "h-1.5 w-1.5 shrink-0 rounded-full", style: { backgroundColor: p.topicColor } }), _jsx(Chip, { label: `topic: ${p.topic}`, variant: "kv", tone: "purple" })] }))] }), _jsx(Button, { label: "Close", icon: "dismiss", tone: "quiet", size: "sm", block: false, onClick: p.onClose })] }), _jsx("h3", { className: "mt-2 truncate text-sm font-medium text-foreground", children: p.title }), _jsx("div", { className: "mt-1 flex min-w-0", children: _jsx(PathRef, { text: p.path, variant: "inline", tone: "teal", icon: "file" }) }), _jsxs("div", { className: "mt-2 flex gap-4 font-[family-name:var(--font-mono)] text-[11px] text-muted-foreground", children: [_jsxs("span", { children: [p.inDegree, " in"] }), _jsxs("span", { children: [p.outDegree, " out"] }), hops && _jsx("span", { children: hops })] }), _jsxs("div", { className: "mt-3 flex flex-wrap gap-2", children: [p.canOpen && _jsx(Button, { label: "Open note", icon: "file", tone: "primary", size: "sm", block: false, onClick: p.onOpen }), p.canFocus && _jsx(Button, { label: "Focus here", icon: "graph", tone: "ghost", size: "sm", block: false, onClick: p.onFocus }), p.canExpand && _jsx(Button, { label: "Expand", icon: "expand", tone: "ghost", size: "sm", block: false, onClick: p.onExpand })] })] }) }));
6
+ }
7
+ //# sourceMappingURL=node-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-card.js","sourceRoot":"","sources":["../../../src/components/graph/node-card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AA6B1E,MAAM,UAAU,QAAQ,CAAC,CAAgB;IACvC,MAAM,IAAI,GAAG,CAAC,CAAC,QAAQ,KAAK,SAAS,IAAI,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,OAAO,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,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AY,EAC7B,IAAI,IAAI,yBAAO,IAAI,GAAQ,IACxB,EACN,eAAK,SAAS,EAAC,2BAA2B,aACvC,CAAC,CAAC,OAAO,IAAI,KAAC,MAAM,IAAC,KAAK,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,SAAS,EAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,GAAI,EAC/G,CAAC,CAAC,QAAQ,IAAI,KAAC,MAAM,IAAC,KAAK,EAAC,YAAY,EAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,GAAI,EACjH,CAAC,CAAC,SAAS,IAAI,KAAC,MAAM,IAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,QAAQ,GAAI,IAC7G,IACE,GACN,CACP,CAAC;AACJ,CAAC"}
@@ -1,8 +1,12 @@
1
1
  import type { GraphNodePayload } from "@schlessera/brain-ui-sdk/protocol";
2
2
  /**
3
3
  * Detail card for the selected node, docked to the bottom-left of the canvas
4
- * (bottom sheet width on phones). "Open note" hands over to the file viewer
5
- * panel the same hand-off the search modal uses.
4
+ * (bottom sheet width on phones). From `wide:` the D6 right rail draws the
5
+ * node instead and `SceneBody` does not mount this.
6
+ *
7
+ * This is the container (S7): the store reads and the "which actions
8
+ * apply" rules (`useNodeActions`) live here; `NodeCard` draws the card on
9
+ * the kit.
6
10
  */
7
11
  export declare function NodePopover({ node, communityLabel, }: {
8
12
  node: GraphNodePayload;
@@ -1 +1 @@
1
- {"version":3,"file":"node-popover.d.ts","sourceRoot":"","sources":["../../../src/components/graph/node-popover.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAM1E;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,cAAc,GACf,EAAE;IACD,IAAI,EAAE,gBAAgB,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,+BA0FA"}
1
+ {"version":3,"file":"node-popover.d.ts","sourceRoot":"","sources":["../../../src/components/graph/node-popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAM1E;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,cAAc,GACf,EAAE;IACD,IAAI,EAAE,gBAAgB,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,+BAwBA"}
@@ -1,39 +1,21 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { X, FileText, Crosshair, Expand } from "lucide-react";
3
- import { useFileStore } from "../../stores/file-store.js";
4
- import { useUIStore } from "../../stores/ui-store.js";
5
- import { useGraphStore } from "../../stores/graph-store.js";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
6
2
  import { communityColor } from "./lib/graph-helpers.js";
3
+ import { NodeCard } from "./node-card.js";
4
+ import { useGraphTheme } from "./use-graph-theme.js";
5
+ import { useNodeActions } from "./use-node-actions.js";
7
6
  /**
8
7
  * Detail card for the selected node, docked to the bottom-left of the canvas
9
- * (bottom sheet width on phones). "Open note" hands over to the file viewer
10
- * panel the same hand-off the search modal uses.
8
+ * (bottom sheet width on phones). From `wide:` the D6 right rail draws the
9
+ * node instead and `SceneBody` does not mount this.
10
+ *
11
+ * This is the container (S7): the store reads and the "which actions
12
+ * apply" rules (`useNodeActions`) live here; `NodeCard` draws the card on
13
+ * the kit.
11
14
  */
12
15
  export function NodePopover({ node, communityLabel, }) {
13
- const openFile = useFileStore((s) => s.openFile);
14
- const setFilePanelOpen = useUIStore((s) => s.setFilePanelOpen);
15
- const mode = useGraphStore((s) => s.mode);
16
- const select = useGraphStore((s) => s.select);
17
- const setMode = useGraphStore((s) => s.setMode);
18
- const setLocalParams = useGraphStore((s) => s.setLocalParams);
19
- const expandNode = useGraphStore((s) => s.expandNode);
16
+ const actions = useNodeActions(node);
17
+ const theme = useGraphTheme();
20
18
  const isVirtual = node.virtual === true;
21
- function handleOpen() {
22
- setFilePanelOpen(true);
23
- void openFile(node.path);
24
- }
25
- function handleFocus() {
26
- // Re-center the local view on this node (switching mode when needed).
27
- if (mode !== "local")
28
- setMode("local");
29
- setLocalParams({ center: node.path });
30
- select(null);
31
- }
32
- return (_jsxs("div", { className: "pointer-events-auto absolute inset-x-2 bottom-2 z-10 rounded-xl border border-border bg-surface-overlay/95 p-4 shadow-2xl backdrop-blur md:inset-x-auto md:left-4 md:bottom-4 md:w-80", children: [_jsxs("div", { className: "flex items-start justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "shrink-0 rounded bg-surface-raised px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-muted-foreground", children: isVirtual ? "root" : node.type }), communityLabel && (_jsxs("span", { title: "Topic cluster inferred from this note's links", className: "flex min-w-0 items-center gap-1 rounded bg-surface-raised px-1.5 py-0.5 text-[10px] text-muted-foreground", children: [node.community !== undefined && (_jsx("span", { "aria-hidden": "true", className: "h-1.5 w-1.5 shrink-0 rounded-full", style: { backgroundColor: communityColor(node.community) } })), _jsxs("span", { className: "truncate", children: ["Topic: ", communityLabel] })] }))] }), _jsx("h3", { className: "mt-1 truncate text-sm font-medium text-foreground", children: node.title || node.path }), _jsx("p", { className: "truncate font-mono text-[10px] text-muted-foreground/60", children: node.path })] }), _jsx("button", { onClick: () => select(null), className: "shrink-0 rounded p-1 text-muted-foreground transition-colors hover:text-foreground", title: "Close", children: _jsx(X, { className: "h-3.5 w-3.5" }) })] }), _jsxs("div", { className: "mt-2 flex gap-4 text-[11px] text-muted-foreground", children: [_jsxs("span", { children: [node.inDegree, " in"] }), _jsxs("span", { children: [node.outDegree, " out"] }), node.distance !== undefined && node.distance > 0 && (_jsxs("span", { children: [node.distance, " hop", node.distance === 1 ? "" : "s"] }))] }), _jsxs("div", { className: "mt-3 flex flex-wrap gap-2", children: [!isVirtual && (_jsx(ActionButton, { icon: FileText, label: "Open note", onClick: handleOpen, primary: true })), !isVirtual && (mode !== "local" || node.distance !== 0) && (_jsx(ActionButton, { icon: Crosshair, label: "Focus here", onClick: handleFocus })), mode === "local" && !isVirtual && node.distance !== 0 && (_jsx(ActionButton, { icon: Expand, label: "Expand", onClick: () => void expandNode(node.path) }))] })] }));
33
- }
34
- function ActionButton({ icon: Icon, label, onClick, primary, }) {
35
- return (_jsxs("button", { onClick: onClick, className: primary
36
- ? "flex min-h-9 items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90"
37
- : "flex min-h-9 items-center gap-1.5 rounded-lg bg-surface-raised px-3 py-1.5 text-xs font-medium text-foreground transition-colors hover:bg-surface-overlay", children: [_jsx(Icon, { className: "h-3.5 w-3.5" }), label] }));
19
+ return (_jsx(NodeCard, { kind: isVirtual ? "root" : node.type, title: node.title || node.path, path: node.path, topic: communityLabel, topicColor: node.community !== undefined ? communityColor(node.community, theme.palette) : undefined, inDegree: node.inDegree, outDegree: node.outDegree, distance: node.distance, canOpen: actions.canOpen, canFocus: actions.canFocus, canExpand: actions.canExpand, onOpen: actions.open, onFocus: actions.focus, onExpand: actions.expand, onClose: actions.close }));
38
20
  }
39
21
  //# sourceMappingURL=node-popover.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"node-popover.js","sourceRoot":"","sources":["../../../src/components/graph/node-popover.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,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graph-helpers.js";
1
3
  export interface GraphTheme {
2
4
  background: string;
3
5
  /** Raised surface used for the hover-label plate (sigma's default is #FFF,
4
- * unreadable under our near-white label text). */
6
+ * unreadable under the dark theme's near-white label text). */
5
7
  surfaceOverlay: string;
6
8
  node: string;
7
9
  nodeSelected: string;
8
10
  edge: string;
9
11
  edgeHighlight: string;
12
+ /** Every label is drawn in the ink — never in its node's colour, which is
13
+ * a value tuned for a 7px mark, not for the one thing you must read. */
10
14
  label: string;
11
15
  labelMuted: string;
16
+ /**
17
+ * The kit's entity colours (its `GraphView`, `PathRef` and inline
18
+ * mentions): teal a person, blue a company, purple a project, amber the
19
+ * focus node, and the neutral for any other document type. The three kinds
20
+ * take the MARK weight, which is the fill in the dark and a darkened step
21
+ * on paper, where a fill sits under 3:1 against the canvas.
22
+ */
23
+ entity: EntityColors;
24
+ /** The categorical slots, the distance ramp and the fixed roles, resolved
25
+ * for the scheme in force. See `CanvasPalette`. */
26
+ palette: CanvasPalette;
27
+ }
28
+ export interface EntityColors {
29
+ person: string;
30
+ company: string;
31
+ project: string;
32
+ focus: string;
33
+ other: string;
12
34
  }
13
35
  /**
14
- * Resolve the Tailwind theme tokens into concrete colors for the canvas —
15
- * WebGL cannot read CSS custom properties itself. Read once per mount; the
16
- * app is dark-only, so tokens do not change at runtime.
36
+ * Resolve the kit's tokens into concrete colours for the canvas — WebGL and
37
+ * `fillStyle` cannot read a CSS custom property, and since the kit's light
38
+ * theme every token is a `light-dark()` pair that `getComputedStyle` returns
39
+ * verbatim, so each is split on the scheme the page is drawing in.
40
+ *
41
+ * Re-resolves when the theme preference or, under `system`, the OS scheme
42
+ * changes; the canvas re-applies it in place (`graph-canvas.tsx`).
17
43
  */
18
44
  export declare function useGraphTheme(): GraphTheme;
45
+ /** The theme for one scheme, from the tokens. Exported for tests. */
46
+ export declare function graphTheme(scheme: ColorScheme): GraphTheme;
19
47
  //# sourceMappingURL=use-graph-theme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-graph-theme.d.ts","sourceRoot":"","sources":["../../../src/components/graph/use-graph-theme.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB;sDACkD;IAClD,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAaD;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,UAAU,CAmB1C"}
1
+ {"version":3,"file":"use-graph-theme.d.ts","sourceRoot":"","sources":["../../../src/components/graph/use-graph-theme.ts"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB;mEAC+D;IAC/D,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB;4EACwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,EAAE,YAAY,CAAC;IACrB;uDACmD;IACnD,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,IAAI,UAAU,CAG1C;AAED,qEAAqE;AACrE,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,UAAU,CA+B1D"}
@@ -1,38 +1,50 @@
1
1
  import { useMemo } from "react";
2
- const FALLBACK = {
3
- background: "#0c0e12",
4
- surfaceOverlay: "#1e2128",
5
- node: "#8a8691",
6
- nodeSelected: "#e09f3e",
7
- edge: "#2a2d35",
8
- edgeHighlight: "#5bb5a2",
9
- label: "#e8e4df",
10
- labelMuted: "#8a8691",
11
- };
2
+ import { useColorScheme } from "../../hooks/use-color-scheme.js";
3
+ import { readToken } from "../../lib/light-dark.js";
12
4
  /**
13
- * Resolve the Tailwind theme tokens into concrete colors for the canvas —
14
- * WebGL cannot read CSS custom properties itself. Read once per mount; the
15
- * app is dark-only, so tokens do not change at runtime.
5
+ * Resolve the kit's tokens into concrete colours for the canvas — WebGL and
6
+ * `fillStyle` cannot read a CSS custom property, and since the kit's light
7
+ * theme every token is a `light-dark()` pair that `getComputedStyle` returns
8
+ * verbatim, so each is split on the scheme the page is drawing in.
9
+ *
10
+ * Re-resolves when the theme preference or, under `system`, the OS scheme
11
+ * changes; the canvas re-applies it in place (`graph-canvas.tsx`).
16
12
  */
17
13
  export function useGraphTheme() {
18
- return useMemo(() => {
19
- if (typeof window === "undefined")
20
- return FALLBACK;
21
- const style = getComputedStyle(document.documentElement);
22
- const token = (name, fallback) => {
23
- const value = style.getPropertyValue(name).trim();
24
- return value || fallback;
25
- };
26
- return {
27
- background: token("--color-background", FALLBACK.background),
28
- surfaceOverlay: token("--color-surface-overlay", FALLBACK.surfaceOverlay),
29
- node: token("--color-muted-foreground", FALLBACK.node),
30
- nodeSelected: token("--color-primary", FALLBACK.nodeSelected),
31
- edge: token("--color-border", FALLBACK.edge),
32
- edgeHighlight: token("--color-accent", FALLBACK.edgeHighlight),
33
- label: token("--color-foreground", FALLBACK.label),
34
- labelMuted: token("--color-muted-foreground", FALLBACK.labelMuted),
35
- };
36
- }, []);
14
+ const scheme = useColorScheme();
15
+ return useMemo(() => graphTheme(scheme), [scheme]);
16
+ }
17
+ /** The theme for one scheme, from the tokens. Exported for tests. */
18
+ export function graphTheme(scheme) {
19
+ const token = (name) => readToken(name, scheme);
20
+ return {
21
+ background: token("color-canvas"),
22
+ surfaceOverlay: token("color-raised"),
23
+ node: token("color-ink-mute"),
24
+ nodeSelected: token("canvas-root"),
25
+ edge: token("color-edge"),
26
+ edgeHighlight: token("color-teal"),
27
+ label: token("color-ink"),
28
+ labelMuted: token("color-ink-mute"),
29
+ entity: {
30
+ person: token("teal-mark"),
31
+ company: token("blue-mark"),
32
+ project: token("purple-mark"),
33
+ focus: token("canvas-root"),
34
+ other: token("canvas-other"),
35
+ },
36
+ palette: {
37
+ slots: [1, 2, 3, 4, 5, 6, 7, 8].map((n) => token(`canvas-slot-${n}`)),
38
+ ramp: [1, 2, 3, 4, 5].map((n) => token(`canvas-ramp-${n}`)),
39
+ root: token("canvas-root"),
40
+ other: token("canvas-other"),
41
+ lens: {
42
+ orphan: token("canvas-lens-orphan"),
43
+ unreachable: token("canvas-lens-unreachable"),
44
+ broken: token("canvas-lens-broken"),
45
+ stale: token("canvas-lens-stale"),
46
+ },
47
+ },
48
+ };
37
49
  }
38
50
  //# sourceMappingURL=use-graph-theme.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-graph-theme.js","sourceRoot":"","sources":["../../../src/components/graph/use-graph-theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAehC,MAAM,QAAQ,GAAe;IAC3B,UAAU,EAAE,SAAS;IACrB,cAAc,EAAE,SAAS;IACzB,IAAI,EAAE,SAAS;IACf,YAAY,EAAE,SAAS;IACvB,IAAI,EAAE,SAAS;IACf,aAAa,EAAE,SAAS;IACxB,KAAK,EAAE,SAAS;IAChB,UAAU,EAAE,SAAS;CACtB,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,OAAO,CAAC,GAAG,EAAE;QACl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,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,EAAe,CAAC,CAAC;YACxE,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC;YAC1B,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC;YAC5B,IAAI,EAAE;gBACJ,MAAM,EAAE,KAAK,CAAC,oBAAoB,CAAC;gBACnC,WAAW,EAAE,KAAK,CAAC,yBAAyB,CAAC;gBAC7C,MAAM,EAAE,KAAK,CAAC,oBAAoB,CAAC;gBACnC,KAAK,EAAE,KAAK,CAAC,mBAAmB,CAAC;aAClC;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { GraphNodePayload } from "@schlessera/brain-ui-sdk/protocol";
2
+ /**
3
+ * The "which actions apply to the selected node" rules, shared by the
4
+ * floating `NodePopover` (below `laptop:`) and the D6 right rail (from
5
+ * `wide:`). Both draw the same node; only the surface differs, so the rules
6
+ * live once.
7
+ *
8
+ * - Open note hands over to the file viewer panel — the same hand-off the
9
+ * search modal uses. Never for a virtual root (no file behind it).
10
+ * - Focus here re-centres the Local view on the node, switching mode when
11
+ * needed; pointless on the node that already is the centre.
12
+ * - Expand pulls the node's depth-1 ego into the scene — Local only, and
13
+ * not for the centre (its ego is the scene).
14
+ */
15
+ export declare function useNodeActions(node: GraphNodePayload): {
16
+ canOpen: boolean;
17
+ canFocus: boolean;
18
+ canExpand: boolean;
19
+ open(): void;
20
+ focus(): void;
21
+ expand(): void;
22
+ close(): void;
23
+ };
24
+ /** `${n} hop`/`${n} hops`, or null at the centre (0) and where unknown. */
25
+ export declare function hopsLabel(distance: number | undefined): string | null;
26
+ //# sourceMappingURL=use-node-actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-node-actions.d.ts","sourceRoot":"","sources":["../../../src/components/graph/use-node-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAK1E;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,gBAAgB;;;;;;;;EA+BpD;AAED,2EAA2E;AAC3E,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAGrE"}
@@ -0,0 +1,54 @@
1
+ import { useFileStore } from "../../stores/file-store.js";
2
+ import { useUIStore } from "../../stores/ui-store.js";
3
+ import { useGraphStore } from "../../stores/graph-store.js";
4
+ /**
5
+ * The "which actions apply to the selected node" rules, shared by the
6
+ * floating `NodePopover` (below `laptop:`) and the D6 right rail (from
7
+ * `wide:`). Both draw the same node; only the surface differs, so the rules
8
+ * live once.
9
+ *
10
+ * - Open note hands over to the file viewer panel — the same hand-off the
11
+ * search modal uses. Never for a virtual root (no file behind it).
12
+ * - Focus here re-centres the Local view on the node, switching mode when
13
+ * needed; pointless on the node that already is the centre.
14
+ * - Expand pulls the node's depth-1 ego into the scene — Local only, and
15
+ * not for the centre (its ego is the scene).
16
+ */
17
+ export function useNodeActions(node) {
18
+ const openFile = useFileStore((s) => s.openFile);
19
+ const setFilePanelOpen = useUIStore((s) => s.setFilePanelOpen);
20
+ const mode = useGraphStore((s) => s.mode);
21
+ const select = useGraphStore((s) => s.select);
22
+ const setMode = useGraphStore((s) => s.setMode);
23
+ const setLocalParams = useGraphStore((s) => s.setLocalParams);
24
+ const expandNode = useGraphStore((s) => s.expandNode);
25
+ const isVirtual = node.virtual === true;
26
+ return {
27
+ canOpen: !isVirtual,
28
+ canFocus: !isVirtual && (mode !== "local" || node.distance !== 0),
29
+ canExpand: mode === "local" && !isVirtual && node.distance !== 0,
30
+ open() {
31
+ setFilePanelOpen(true);
32
+ void openFile(node.path);
33
+ },
34
+ focus() {
35
+ if (mode !== "local")
36
+ setMode("local");
37
+ setLocalParams({ center: node.path });
38
+ select(null);
39
+ },
40
+ expand() {
41
+ void expandNode(node.path);
42
+ },
43
+ close() {
44
+ select(null);
45
+ },
46
+ };
47
+ }
48
+ /** `${n} hop`/`${n} hops`, or null at the centre (0) and where unknown. */
49
+ export function hopsLabel(distance) {
50
+ if (distance === undefined || distance <= 0)
51
+ return null;
52
+ return `${distance} hop${distance === 1 ? "" : "s"}`;
53
+ }
54
+ //# sourceMappingURL=use-node-actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-node-actions.js","sourceRoot":"","sources":["../../../src/components/graph/use-node-actions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,cAAc,CAAC,IAAsB;IACnD,MAAM,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACjD,MAAM,gBAAgB,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;IAC/D,MAAM,IAAI,GAAG,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAChD,MAAM,cAAc,GAAG,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;IAC9D,MAAM,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAEtD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC;IAExC,OAAO;QACL,OAAO,EAAE,CAAC,SAAS;QACnB,QAAQ,EAAE,CAAC,SAAS,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,QAAQ,KAAK,CAAC,CAAC;QACjE,SAAS,EAAE,IAAI,KAAK,OAAO,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,CAAC;QAChE,IAAI;YACF,gBAAgB,CAAC,IAAI,CAAC,CAAC;YACvB,KAAK,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,CAAC;QACD,KAAK;YACH,IAAI,IAAI,KAAK,OAAO;gBAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YACvC,cAAc,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YACtC,MAAM,CAAC,IAAI,CAAC,CAAC;QACf,CAAC;QACD,MAAM;YACJ,KAAK,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;QACD,KAAK;YACH,MAAM,CAAC,IAAI,CAAC,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,SAAS,CAAC,QAA4B;IACpD,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACzD,OAAO,GAAG,QAAQ,OAAO,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;AACvD,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { BrainUiRoot } from "../../root.js";
1
2
  import type { ShareOption } from "../share/share-menu.js";
2
3
  /**
3
4
  * Share options for one image, used by both the file viewer's header menu and
@@ -11,7 +12,7 @@ import type { ShareOption } from "../share/share-menu.js";
11
12
  * when that actually changes something — an image already inside the target
12
13
  * falls back to the original rather than being recompressed for show.
13
14
  */
14
- export declare function buildImageShareOptions(url: string, filename: string, opts?: {
15
+ export declare function buildImageShareOptions(root: BrainUiRoot, url: string, filename: string, opts?: {
15
16
  mime?: string;
16
17
  bytes?: number;
17
18
  }): ShareOption[];
@@ -1 +1 @@
1
- {"version":3,"file":"image-share.d.ts","sourceRoot":"","sources":["../../../src/components/images/image-share.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,GAC3C,WAAW,EAAE,CA+Bf"}
1
+ {"version":3,"file":"image-share.d.ts","sourceRoot":"","sources":["../../../src/components/images/image-share.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAQjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,GAC3C,WAAW,EAAE,CA+Bf"}
@@ -12,9 +12,9 @@ import { SHARE_OPTIMIZED, formatBytes, optimizeImage, optimizedFilename, } from
12
12
  * when that actually changes something — an image already inside the target
13
13
  * falls back to the original rather than being recompressed for show.
14
14
  */
15
- export function buildImageShareOptions(url, filename, opts = {}) {
15
+ export function buildImageShareOptions(root, url, filename, opts = {}) {
16
16
  const shareOriginal = async () => {
17
- const file = await fetchAsFile(url, filename, opts.mime);
17
+ const file = await fetchAsFile(root, url, filename, opts.mime);
18
18
  return shareFile(file, { title: filename });
19
19
  };
20
20
  return [
@@ -29,7 +29,7 @@ export function buildImageShareOptions(url, filename, opts = {}) {
29
29
  label: "Share optimized",
30
30
  hint: `JPEG, up to ${SHARE_OPTIMIZED.maxEdge}px · under ${formatBytes(SHARE_OPTIMIZED.maxBytes)}`,
31
31
  run: async () => {
32
- const original = await fetchAsFile(url, filename, opts.mime);
32
+ const original = await fetchAsFile(root, url, filename, opts.mime);
33
33
  const result = await optimizeImage(original, SHARE_OPTIMIZED);
34
34
  // null means "nothing to gain" (already small enough) or "could not be
35
35
  // decoded". Either way the original is the right thing to send, and
@@ -1 +1 @@
1
- {"version":3,"file":"image-share.js","sourceRoot":"","sources":["../../../src/components/images/image-share.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EACL,eAAe,EACf,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,MAAM,6BAA6B,CAAC;AAGrC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,sBAAsB,CACpC,GAAW,EACX,QAAgB,EAChB,OAA0C,EAAE;IAE5C,MAAM,aAAa,GAAG,KAAK,IAAsB,EAAE;QACjD,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACzD,OAAO,SAAS,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC9C,CAAC,CAAC;IAEF,OAAO;QACL;YACE,EAAE,EAAE,gBAAgB;YACpB,KAAK,EAAE,gBAAgB;YACvB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,kBAAkB,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc;YAC/E,GAAG,EAAE,aAAa;SACnB;QACD;YACE,EAAE,EAAE,iBAAiB;YACrB,KAAK,EAAE,iBAAiB;Y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AOG;AACH,wBAAgB,WAAW,CAAC,EAC1B,GAAG,EACH,GAAG,EACH,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,OAAO,GACR,EAAE;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,+BAsBA"}
1
+ {"version":3,"file":"image-viewer.d.ts","sourceRoot":"","sources":["../../../src/components/images/image-viewer.tsx"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,EAC1B,GAAG,EACH,GAAG,EACH,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,OAAO,GACR,EAAE;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,+BAuBA"}
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useBrainUiRoot } from "../../root-context.js";
2
3
  import { useState } from "react";
3
4
  import { ShareMenu } from "../share/share-menu.js";
4
5
  import { ZoomViewer } from "../viewer/zoom-viewer.js";
@@ -12,9 +13,10 @@ import { buildImageShareOptions } from "./image-share.js";
12
13
  * available, it just is not where the viewer starts.
13
14
  */
14
15
  export function ImageViewer({ src, alt, filename, mime, bytes, onClose, }) {
16
+ const root = useBrainUiRoot();
15
17
  // The natural size is unknown until the decode finishes, and `fit()` measures
16
18
  // the DOM — so the load event is what tells the viewer to fit.
17
19
  const [loaded, setLoaded] = useState(false);
18
- return (_jsx(ZoomViewer, { onClose: onClose, refitKey: loaded ? src : null, maxFitScale: 1, label: `Image viewer: ${filename}`, actions: _jsx(ShareMenu, { options: buildImageShareOptions(src, filename, { mime, bytes }), title: "Share image" }), children: _jsx("img", { src: src, alt: alt ?? filename, onLoad: () => setLoaded(true), draggable: false }) }));
20
+ return (_jsx(ZoomViewer, { onClose: onClose, refitKey: loaded ? src : null, maxFitScale: 1, label: `Image viewer: ${filename}`, actions: _jsx(ShareMenu, { options: buildImageShareOptions(root, src, filename, { mime, bytes }), title: "Share image" }), children: _jsx("img", { src: src, alt: alt ?? filename, onLoad: () => setLoaded(true), draggable: false }) }));
19
21
  }
20
22
  //# sourceMappingURL=image-viewer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"image-viewer.js","sourceRoot":"","sources":["../../../src/components/images/image-viewer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,GAAG,EACH,GAAG,EACH,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,OAAO,GAQR;IACC,8EAA8E;IAC9E,+DAA+D;IAC/D,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5C,OAAO,CACL,KAAC,UAAU,IACT,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAC7B,WAAW,EAAE,CAAC,EACd,KAAK,EAAE,iBAAiB,QAAQ,EAAE,EAClC,OAAO,EACL,KAAC,SAAS,IACR,OAAO,EAAE,sBAAsB,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CA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G,EAAE,GAAG,IAAI,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,GAAI,GAC7E,CACd,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"mask-editor.d.ts","sourceRoot":"","sources":["../../../src/components/images/mask-editor.tsx"],"names":[],"mappings":"AA0BA,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACxD,sCA4NA"}
1
+ {"version":3,"file":"mask-editor.d.ts","sourceRoot":"","sources":["../../../src/components/images/mask-editor.tsx"],"names":[],"mappings":"AA0BA,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACxD,sCA+NA"}
@@ -1,9 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useRef, useState } from "react";
3
3
  import { Eraser, RotateCcw, X } from "lucide-react";
4
- import { apiBase } from "../../lib/backend.js";
4
+ import { useBrainUiRoot } from "../../root-context.js";
5
5
  import { useMaskStore } from "../../stores/mask-store.js";
6
6
  export function MaskEditor({ onSubmit, onCancel, }) {
7
+ const root = useBrainUiRoot();
7
8
  const request = useMaskStore((s) => s.request);
8
9
  const close = useMaskStore((s) => s.close);
9
10
  const canvasRef = useRef(null);
@@ -14,15 +15,16 @@ export function MaskEditor({ onSubmit, onCancel, }) {
14
15
  const [loaded, setLoaded] = useState(false);
15
16
  const [error, setError] = useState(null);
16
17
  const rawUrl = request
17
- ? `${apiBase()}/files/content?path=${encodeURIComponent(request.imagePath)}&raw=1`
18
+ ? `${root.apiBase()}/files/content?path=${encodeURIComponent(request.imagePath)}&raw=1`
18
19
  : null;
19
20
  // Reset per request: a second mask on a different image must not inherit the
20
21
  // first one's strokes.
21
22
  useEffect(() => {
22
23
  setStrokes([]);
24
+ setDrawing(false);
23
25
  setLoaded(false);
24
26
  setError(null);
25
- }, [request?.requestId]);
27
+ }, [root, request?.requestId, rawUrl]);
26
28
  const redraw = useCallback(() => {
27
29
  const canvas = canvasRef.current;
28
30
  const img = imageRef.current;
@@ -115,7 +117,7 @@ export function MaskEditor({ onSubmit, onCancel, }) {
115
117
  canvas.height = Math.round(img.naturalHeight * scale);
116
118
  }
117
119
  setLoaded(true);
118
- }, onError: () => setError(`Could not load ${request.imagePath}`) })), _jsx("canvas", { ref: canvasRef, className: "max-h-full max-w-full touch-none rounded shadow-lg", onPointerDown: (e) => {
120
+ }, onError: () => setError(`Could not load ${request.imagePath}`) }, rawUrl)), _jsx("canvas", { ref: canvasRef, className: "max-h-full max-w-full touch-none rounded shadow-lg", onPointerDown: (e) => {
119
121
  e.currentTarget.setPointerCapture(e.pointerId);
120
122
  setDrawing(true);
121
123
  setStrokes((prev) => [...prev, { points: [pointFrom(e)], width: brush }]);
@@ -130,6 +132,6 @@ export function MaskEditor({ onSubmit, onCancel, }) {
130
132
  next[next.length - 1] = { ...last, points: [...last.points, p] };
131
133
  return next;
132
134
  });
133
- }, onPointerUp: () => setDrawing(false), onPointerCancel: () => setDrawing(false) })] }), error && _jsx("div", { className: "px-3 pb-1 text-center text-sm text-red-300", children: error }), _jsxs("div", { className: "flex items-center gap-3 p-3", children: [_jsxs("label", { className: "flex flex-1 items-center gap-2 text-xs text-white/80", children: ["Brush", _jsx("input", { type: "range", min: 8, max: 160, value: brush, onChange: (e) => setBrush(Number(e.target.value)), className: "flex-1" })] }), _jsx("button", { type: "button", onClick: () => setStrokes((prev) => prev.slice(0, -1)), disabled: strokes.length === 0, className: "rounded p-2 text-white hover:bg-white/10 disabled:opacity-40", "aria-label": "Undo", children: _jsx(RotateCcw, { className: "h-5 w-5" }) }), _jsx("button", { type: "button", onClick: () => setStrokes([]), disabled: strokes.length === 0, className: "rounded p-2 text-white hover:bg-white/10 disabled:opacity-40", "aria-label": "Clear", children: _jsx(Eraser, { className: "h-5 w-5" }) }), _jsx("button", { type: "button", onClick: submit, disabled: !loaded, className: "rounded bg-white px-4 py-2 text-sm font-medium text-black disabled:opacity-50", children: "Use this area" })] })] }));
135
+ }, onPointerUp: () => setDrawing(false), onPointerCancel: () => setDrawing(false) })] }), error && _jsx("div", { className: "px-3 pb-1 text-center text-sm text-destructive-fill", children: error }), _jsxs("div", { className: "flex items-center gap-3 p-3", children: [_jsxs("label", { className: "flex flex-1 items-center gap-2 text-xs text-white/80", children: ["Brush", _jsx("input", { type: "range", min: 8, max: 160, value: brush, onChange: (e) => setBrush(Number(e.target.value)), className: "flex-1" })] }), _jsx("button", { type: "button", onClick: () => setStrokes((prev) => prev.slice(0, -1)), disabled: strokes.length === 0, className: "rounded p-2 text-white hover:bg-white/10 disabled:opacity-40", "aria-label": "Undo", children: _jsx(RotateCcw, { className: "h-5 w-5" }) }), _jsx("button", { type: "button", onClick: () => setStrokes([]), disabled: strokes.length === 0, className: "rounded p-2 text-white hover:bg-white/10 disabled:opacity-40", "aria-label": "Clear", children: _jsx(Eraser, { className: "h-5 w-5" }) }), _jsx("button", { type: "button", onClick: submit, disabled: !loaded, className: "rounded bg-white px-4 py-2 text-sm font-medium text-black disabled:opacity-50", children: "Use this area" })] })] }));
134
136
  }
135
137
  //# sourceMappingURL=mask-editor.js.map