@schlessera/brain-ui-react 0.35.0 → 0.37.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.
- package/README.md +82 -4
- package/dist/components/activity/activity-page.d.ts +17 -5
- package/dist/components/activity/activity-page.d.ts.map +1 -1
- package/dist/components/activity/activity-page.js +148 -50
- package/dist/components/activity/activity-page.js.map +1 -1
- package/dist/components/activity/activity-run-detail.d.ts +16 -1
- package/dist/components/activity/activity-run-detail.d.ts.map +1 -1
- package/dist/components/activity/activity-run-detail.js +47 -4
- package/dist/components/activity/activity-run-detail.js.map +1 -1
- package/dist/components/activity/activity-run-list.d.ts +7 -1
- package/dist/components/activity/activity-run-list.d.ts.map +1 -1
- package/dist/components/activity/activity-run-list.js +16 -8
- package/dist/components/activity/activity-run-list.js.map +1 -1
- package/dist/components/activity/activity-views.d.ts +63 -0
- package/dist/components/activity/activity-views.d.ts.map +1 -0
- package/dist/components/activity/activity-views.js +52 -0
- package/dist/components/activity/activity-views.js.map +1 -0
- package/dist/components/activity/approval-card.d.ts +29 -0
- package/dist/components/activity/approval-card.d.ts.map +1 -0
- package/dist/components/activity/approval-card.js +73 -0
- package/dist/components/activity/approval-card.js.map +1 -0
- package/dist/components/activity/digest-card.d.ts +3 -0
- package/dist/components/activity/digest-card.d.ts.map +1 -1
- package/dist/components/activity/digest-card.js +20 -16
- package/dist/components/activity/digest-card.js.map +1 -1
- package/dist/components/activity/digest-summary.d.ts +19 -0
- package/dist/components/activity/digest-summary.d.ts.map +1 -0
- package/dist/components/activity/digest-summary.js +20 -0
- package/dist/components/activity/digest-summary.js.map +1 -0
- package/dist/components/activity/push-switch.d.ts +25 -0
- package/dist/components/activity/push-switch.d.ts.map +1 -0
- package/dist/components/activity/push-switch.js +14 -0
- package/dist/components/activity/push-switch.js.map +1 -0
- package/dist/components/activity/push-toggle.d.ts +7 -0
- package/dist/components/activity/push-toggle.d.ts.map +1 -1
- package/dist/components/activity/push-toggle.js +72 -47
- package/dist/components/activity/push-toggle.js.map +1 -1
- package/dist/components/activity/span-bits.d.ts +11 -0
- package/dist/components/activity/span-bits.d.ts.map +1 -1
- package/dist/components/activity/span-bits.js +50 -7
- package/dist/components/activity/span-bits.js.map +1 -1
- package/dist/components/chat/ask-user-card.d.ts +76 -3
- package/dist/components/chat/ask-user-card.d.ts.map +1 -1
- package/dist/components/chat/ask-user-card.js +208 -149
- package/dist/components/chat/ask-user-card.js.map +1 -1
- package/dist/components/chat/ask-user-typed.d.ts +42 -0
- package/dist/components/chat/ask-user-typed.d.ts.map +1 -0
- package/dist/components/chat/ask-user-typed.js +60 -0
- package/dist/components/chat/ask-user-typed.js.map +1 -0
- package/dist/components/chat/brain-markdown-links.d.ts +2 -1
- package/dist/components/chat/brain-markdown-links.d.ts.map +1 -1
- package/dist/components/chat/brain-markdown-links.js +3 -4
- package/dist/components/chat/brain-markdown-links.js.map +1 -1
- package/dist/components/chat/brain-markdown.d.ts.map +1 -1
- package/dist/components/chat/brain-markdown.js +4 -2
- package/dist/components/chat/brain-markdown.js.map +1 -1
- package/dist/components/chat/chat-page.d.ts.map +1 -1
- package/dist/components/chat/chat-page.js +27 -11
- package/dist/components/chat/chat-page.js.map +1 -1
- package/dist/components/chat/composer-view.d.ts +75 -0
- package/dist/components/chat/composer-view.d.ts.map +1 -0
- package/dist/components/chat/composer-view.js +31 -0
- package/dist/components/chat/composer-view.js.map +1 -0
- package/dist/components/chat/composer.d.ts +4 -0
- package/dist/components/chat/composer.d.ts.map +1 -1
- package/dist/components/chat/composer.js +76 -59
- package/dist/components/chat/composer.js.map +1 -1
- package/dist/components/chat/markdown-content.d.ts +16 -1
- package/dist/components/chat/markdown-content.d.ts.map +1 -1
- package/dist/components/chat/markdown-content.js +47 -3
- package/dist/components/chat/markdown-content.js.map +1 -1
- package/dist/components/chat/mermaid-block.d.ts +4 -0
- package/dist/components/chat/mermaid-block.d.ts.map +1 -1
- package/dist/components/chat/mermaid-block.js +13 -5
- package/dist/components/chat/mermaid-block.js.map +1 -1
- package/dist/components/chat/mermaid-share.d.ts +2 -1
- package/dist/components/chat/mermaid-share.d.ts.map +1 -1
- package/dist/components/chat/mermaid-share.js +7 -8
- package/dist/components/chat/mermaid-share.js.map +1 -1
- package/dist/components/chat/mermaid-viewer.d.ts.map +1 -1
- package/dist/components/chat/mermaid-viewer.js +3 -1
- package/dist/components/chat/mermaid-viewer.js.map +1 -1
- package/dist/components/chat/message-bubble.d.ts +8 -1
- package/dist/components/chat/message-bubble.d.ts.map +1 -1
- package/dist/components/chat/message-bubble.js +53 -24
- package/dist/components/chat/message-bubble.js.map +1 -1
- package/dist/components/chat/message-share.d.ts +2 -1
- package/dist/components/chat/message-share.d.ts.map +1 -1
- package/dist/components/chat/message-share.js +6 -7
- package/dist/components/chat/message-share.js.map +1 -1
- package/dist/components/chat/renderers/bind.d.ts +39 -0
- package/dist/components/chat/renderers/bind.d.ts.map +1 -0
- package/dist/components/chat/renderers/bind.js +43 -0
- package/dist/components/chat/renderers/bind.js.map +1 -0
- package/dist/components/chat/renderers/brain-ui-tools.d.ts +3 -0
- package/dist/components/chat/renderers/brain-ui-tools.d.ts.map +1 -0
- package/dist/components/chat/renderers/brain-ui-tools.js +41 -0
- package/dist/components/chat/renderers/brain-ui-tools.js.map +1 -0
- package/dist/components/chat/renderers/claude-tools.d.ts.map +1 -1
- package/dist/components/chat/renderers/claude-tools.js +3 -2
- package/dist/components/chat/renderers/claude-tools.js.map +1 -1
- package/dist/components/chat/renderers/index.d.ts +10 -2
- package/dist/components/chat/renderers/index.d.ts.map +1 -1
- package/dist/components/chat/renderers/index.js +15 -10
- package/dist/components/chat/renderers/index.js.map +1 -1
- package/dist/components/chat/session-drawer.d.ts +4 -0
- package/dist/components/chat/session-drawer.d.ts.map +1 -1
- package/dist/components/chat/session-drawer.js +32 -32
- package/dist/components/chat/session-drawer.js.map +1 -1
- package/dist/components/chat/session-list.d.ts +41 -0
- package/dist/components/chat/session-list.d.ts.map +1 -0
- package/dist/components/chat/session-list.js +10 -0
- package/dist/components/chat/session-list.js.map +1 -0
- package/dist/components/chat/share-block.d.ts.map +1 -1
- package/dist/components/chat/share-block.js +12 -11
- package/dist/components/chat/share-block.js.map +1 -1
- package/dist/components/chat/share-card.js +2 -2
- package/dist/components/chat/share-card.js.map +1 -1
- package/dist/components/chat/subagent-view.js +1 -1
- package/dist/components/chat/subagent-view.js.map +1 -1
- package/dist/components/chat/tool-call-timeline.d.ts.map +1 -1
- package/dist/components/chat/tool-call-timeline.js +45 -14
- package/dist/components/chat/tool-call-timeline.js.map +1 -1
- package/dist/components/chat/tool-cards/block-card.d.ts +28 -0
- package/dist/components/chat/tool-cards/block-card.d.ts.map +1 -0
- package/dist/components/chat/tool-cards/block-card.js +103 -0
- package/dist/components/chat/tool-cards/block-card.js.map +1 -0
- package/dist/components/chat/tool-cards/image-mask-card.d.ts +70 -0
- package/dist/components/chat/tool-cards/image-mask-card.d.ts.map +1 -0
- package/dist/components/chat/tool-cards/image-mask-card.js +142 -0
- package/dist/components/chat/tool-cards/image-mask-card.js.map +1 -0
- package/dist/components/chat/tool-cards/location-card.d.ts +45 -0
- package/dist/components/chat/tool-cards/location-card.d.ts.map +1 -0
- package/dist/components/chat/tool-cards/location-card.js +128 -0
- package/dist/components/chat/tool-cards/location-card.js.map +1 -0
- package/dist/components/chat/tool-views.d.ts +19 -2
- package/dist/components/chat/tool-views.d.ts.map +1 -1
- package/dist/components/chat/tool-views.js +28 -22
- package/dist/components/chat/tool-views.js.map +1 -1
- package/dist/components/chat/transcript-turn.d.ts +45 -0
- package/dist/components/chat/transcript-turn.d.ts.map +1 -0
- package/dist/components/chat/transcript-turn.js +25 -0
- package/dist/components/chat/transcript-turn.js.map +1 -0
- package/dist/components/chat/use-chat-commands.d.ts.map +1 -1
- package/dist/components/chat/use-chat-commands.js +13 -16
- package/dist/components/chat/use-chat-commands.js.map +1 -1
- package/dist/components/chat/welcome-state.d.ts +7 -0
- package/dist/components/chat/welcome-state.d.ts.map +1 -1
- package/dist/components/chat/welcome-state.js +13 -5
- package/dist/components/chat/welcome-state.js.map +1 -1
- package/dist/components/connectivity/connection-gate.d.ts.map +1 -1
- package/dist/components/connectivity/connection-gate.js +27 -21
- package/dist/components/connectivity/connection-gate.js.map +1 -1
- package/dist/components/connectivity/login-form.d.ts +31 -0
- package/dist/components/connectivity/login-form.d.ts.map +1 -0
- package/dist/components/connectivity/login-form.js +19 -0
- package/dist/components/connectivity/login-form.js.map +1 -0
- package/dist/components/connectivity/login-screen.d.ts +5 -2
- package/dist/components/connectivity/login-screen.d.ts.map +1 -1
- package/dist/components/connectivity/login-screen.js +41 -31
- package/dist/components/connectivity/login-screen.js.map +1 -1
- package/dist/components/dev/share-harness.js +1 -1
- package/dist/components/dev/share-harness.js.map +1 -1
- package/dist/components/files/file-panel.d.ts +1 -1
- package/dist/components/files/file-panel.d.ts.map +1 -1
- package/dist/components/files/file-panel.js +74 -0
- package/dist/components/files/file-panel.js.map +1 -1
- package/dist/components/files/file-tree-view.d.ts +45 -0
- package/dist/components/files/file-tree-view.d.ts.map +1 -0
- package/dist/components/files/file-tree-view.js +51 -0
- package/dist/components/files/file-tree-view.js.map +1 -0
- package/dist/components/files/file-tree.d.ts +6 -0
- package/dist/components/files/file-tree.d.ts.map +1 -1
- package/dist/components/files/file-tree.js +39 -43
- package/dist/components/files/file-tree.js.map +1 -1
- package/dist/components/files/file-viewer-binary.d.ts.map +1 -1
- package/dist/components/files/file-viewer-binary.js +3 -2
- package/dist/components/files/file-viewer-binary.js.map +1 -1
- package/dist/components/files/file-viewer-frame.d.ts +36 -0
- package/dist/components/files/file-viewer-frame.d.ts.map +1 -0
- package/dist/components/files/file-viewer-frame.js +26 -0
- package/dist/components/files/file-viewer-frame.js.map +1 -0
- package/dist/components/files/file-viewer.d.ts +5 -0
- package/dist/components/files/file-viewer.d.ts.map +1 -1
- package/dist/components/files/file-viewer.js +26 -32
- package/dist/components/files/file-viewer.js.map +1 -1
- package/dist/components/files/frontmatter-chips.d.ts +18 -0
- package/dist/components/files/frontmatter-chips.d.ts.map +1 -0
- package/dist/components/files/frontmatter-chips.js +11 -0
- package/dist/components/files/frontmatter-chips.js.map +1 -0
- package/dist/components/files/frontmatter-panel.d.ts +5 -1
- package/dist/components/files/frontmatter-panel.d.ts.map +1 -1
- package/dist/components/files/frontmatter-panel.js +7 -6
- package/dist/components/files/frontmatter-panel.js.map +1 -1
- package/dist/components/files/staleness.d.ts +18 -0
- package/dist/components/files/staleness.d.ts.map +1 -0
- package/dist/components/files/staleness.js +27 -0
- package/dist/components/files/staleness.js.map +1 -0
- package/dist/components/graph/graph-canvas.d.ts.map +1 -1
- package/dist/components/graph/graph-canvas.js +24 -1
- package/dist/components/graph/graph-canvas.js.map +1 -1
- package/dist/components/graph/graph-controls-column.d.ts +14 -0
- package/dist/components/graph/graph-controls-column.d.ts.map +1 -0
- package/dist/components/graph/graph-controls-column.js +44 -0
- package/dist/components/graph/graph-controls-column.js.map +1 -0
- package/dist/components/graph/graph-controls.d.ts +20 -5
- package/dist/components/graph/graph-controls.d.ts.map +1 -1
- package/dist/components/graph/graph-controls.js +58 -37
- package/dist/components/graph/graph-controls.js.map +1 -1
- package/dist/components/graph/graph-form.d.ts +82 -0
- package/dist/components/graph/graph-form.d.ts.map +1 -0
- package/dist/components/graph/graph-form.js +69 -0
- package/dist/components/graph/graph-form.js.map +1 -0
- package/dist/components/graph/graph-maintenance.d.ts.map +1 -1
- package/dist/components/graph/graph-maintenance.js +6 -10
- package/dist/components/graph/graph-maintenance.js.map +1 -1
- package/dist/components/graph/graph-node-rail.d.ts +13 -0
- package/dist/components/graph/graph-node-rail.d.ts.map +1 -0
- package/dist/components/graph/graph-node-rail.js +92 -0
- package/dist/components/graph/graph-node-rail.js.map +1 -0
- package/dist/components/graph/graph-page.d.ts +7 -0
- package/dist/components/graph/graph-page.d.ts.map +1 -1
- package/dist/components/graph/graph-page.js +102 -12
- package/dist/components/graph/graph-page.js.map +1 -1
- package/dist/components/graph/graph-scene.d.ts.map +1 -1
- package/dist/components/graph/graph-scene.js +100 -24
- package/dist/components/graph/graph-scene.js.map +1 -1
- package/dist/components/graph/lib/graph-helpers.d.ts +42 -12
- package/dist/components/graph/lib/graph-helpers.d.ts.map +1 -1
- package/dist/components/graph/lib/graph-helpers.js +33 -41
- package/dist/components/graph/lib/graph-helpers.js.map +1 -1
- package/dist/components/graph/node-card.d.ts +28 -0
- package/dist/components/graph/node-card.d.ts.map +1 -0
- package/dist/components/graph/node-card.js +7 -0
- package/dist/components/graph/node-card.js.map +1 -0
- package/dist/components/graph/node-popover.d.ts +6 -2
- package/dist/components/graph/node-popover.d.ts.map +1 -1
- package/dist/components/graph/node-popover.js +13 -31
- package/dist/components/graph/node-popover.js.map +1 -1
- package/dist/components/graph/use-graph-theme.d.ts +32 -4
- package/dist/components/graph/use-graph-theme.d.ts.map +1 -1
- package/dist/components/graph/use-graph-theme.js +44 -32
- package/dist/components/graph/use-graph-theme.js.map +1 -1
- package/dist/components/graph/use-node-actions.d.ts +26 -0
- package/dist/components/graph/use-node-actions.d.ts.map +1 -0
- package/dist/components/graph/use-node-actions.js +54 -0
- package/dist/components/graph/use-node-actions.js.map +1 -0
- package/dist/components/images/image-share.d.ts +2 -1
- package/dist/components/images/image-share.d.ts.map +1 -1
- package/dist/components/images/image-share.js +3 -3
- package/dist/components/images/image-share.js.map +1 -1
- package/dist/components/images/image-viewer.d.ts.map +1 -1
- package/dist/components/images/image-viewer.js +3 -1
- package/dist/components/images/image-viewer.js.map +1 -1
- package/dist/components/images/mask-editor.d.ts.map +1 -1
- package/dist/components/images/mask-editor.js +7 -5
- package/dist/components/images/mask-editor.js.map +1 -1
- package/dist/components/layout/app-shell.d.ts.map +1 -1
- package/dist/components/layout/app-shell.js +4 -1
- package/dist/components/layout/app-shell.js.map +1 -1
- package/dist/components/layout/desktop-palette.d.ts +23 -0
- package/dist/components/layout/desktop-palette.d.ts.map +1 -0
- package/dist/components/layout/desktop-palette.js +132 -0
- package/dist/components/layout/desktop-palette.js.map +1 -0
- package/dist/components/layout/key-cap.d.ts +9 -0
- package/dist/components/layout/key-cap.d.ts.map +1 -0
- package/dist/components/layout/key-cap.js +10 -0
- package/dist/components/layout/key-cap.js.map +1 -0
- package/dist/components/layout/mobile-tab-bar.d.ts +13 -0
- package/dist/components/layout/mobile-tab-bar.d.ts.map +1 -1
- package/dist/components/layout/mobile-tab-bar.js +58 -47
- package/dist/components/layout/mobile-tab-bar.js.map +1 -1
- package/dist/components/layout/shortcut-switch.d.ts +13 -0
- package/dist/components/layout/shortcut-switch.d.ts.map +1 -0
- package/dist/components/layout/shortcut-switch.js +22 -0
- package/dist/components/layout/shortcut-switch.js.map +1 -0
- package/dist/components/layout/side-rail.d.ts +28 -0
- package/dist/components/layout/side-rail.d.ts.map +1 -1
- package/dist/components/layout/side-rail.js +72 -27
- package/dist/components/layout/side-rail.js.map +1 -1
- package/dist/components/layout/slide-panel.d.ts +25 -2
- package/dist/components/layout/slide-panel.d.ts.map +1 -1
- package/dist/components/layout/slide-panel.js +13 -4
- package/dist/components/layout/slide-panel.js.map +1 -1
- package/dist/components/layout/theme.d.ts +22 -0
- package/dist/components/layout/theme.d.ts.map +1 -0
- package/dist/components/layout/theme.js +44 -0
- package/dist/components/layout/theme.js.map +1 -0
- package/dist/components/quick-actions/add-form.d.ts +44 -0
- package/dist/components/quick-actions/add-form.d.ts.map +1 -0
- package/dist/components/quick-actions/add-form.js +32 -0
- package/dist/components/quick-actions/add-form.js.map +1 -0
- package/dist/components/quick-actions/add-modal.d.ts +7 -0
- package/dist/components/quick-actions/add-modal.d.ts.map +1 -1
- package/dist/components/quick-actions/add-modal.js +23 -20
- package/dist/components/quick-actions/add-modal.js.map +1 -1
- package/dist/components/quick-actions/search-modal.d.ts.map +1 -1
- package/dist/components/quick-actions/search-modal.js +8 -5
- package/dist/components/quick-actions/search-modal.js.map +1 -1
- package/dist/components/quick-actions/streaming-modal.d.ts +6 -0
- package/dist/components/quick-actions/streaming-modal.d.ts.map +1 -1
- package/dist/components/quick-actions/streaming-modal.js +53 -18
- package/dist/components/quick-actions/streaming-modal.js.map +1 -1
- package/dist/components/quick-actions/streaming-output.d.ts +38 -0
- package/dist/components/quick-actions/streaming-output.d.ts.map +1 -0
- package/dist/components/quick-actions/streaming-output.js +22 -0
- package/dist/components/quick-actions/streaming-output.js.map +1 -0
- package/dist/components/quick-actions/whatsup-modal.d.ts +5 -0
- package/dist/components/quick-actions/whatsup-modal.d.ts.map +1 -1
- package/dist/components/quick-actions/whatsup-modal.js +51 -10
- package/dist/components/quick-actions/whatsup-modal.js.map +1 -1
- package/dist/components/settings/devices-agents-tab.d.ts +6 -1
- package/dist/components/settings/devices-agents-tab.d.ts.map +1 -1
- package/dist/components/settings/devices-agents-tab.js +55 -20
- package/dist/components/settings/devices-agents-tab.js.map +1 -1
- package/dist/components/settings/models-list.d.ts +39 -0
- package/dist/components/settings/models-list.d.ts.map +1 -0
- package/dist/components/settings/models-list.js +72 -0
- package/dist/components/settings/models-list.js.map +1 -0
- package/dist/components/settings/models-tab.d.ts +4 -0
- package/dist/components/settings/models-tab.d.ts.map +1 -1
- package/dist/components/settings/models-tab.js +52 -102
- package/dist/components/settings/models-tab.js.map +1 -1
- package/dist/components/settings/one-time-agent-credential.js +1 -1
- package/dist/components/settings/one-time-agent-credential.js.map +1 -1
- package/dist/components/settings/passkey-list.d.ts +35 -0
- package/dist/components/settings/passkey-list.d.ts.map +1 -0
- package/dist/components/settings/passkey-list.js +34 -0
- package/dist/components/settings/passkey-list.js.map +1 -0
- package/dist/components/settings/passkey-tab.d.ts +3 -0
- package/dist/components/settings/passkey-tab.d.ts.map +1 -1
- package/dist/components/settings/passkey-tab.js +53 -45
- package/dist/components/settings/passkey-tab.js.map +1 -1
- package/dist/components/settings/pi-accounts-list.d.ts +27 -0
- package/dist/components/settings/pi-accounts-list.d.ts.map +1 -0
- package/dist/components/settings/pi-accounts-list.js +15 -0
- package/dist/components/settings/pi-accounts-list.js.map +1 -0
- package/dist/components/settings/pi-accounts.d.ts +3 -0
- package/dist/components/settings/pi-accounts.d.ts.map +1 -1
- package/dist/components/settings/pi-accounts.js +73 -55
- package/dist/components/settings/pi-accounts.js.map +1 -1
- package/dist/components/settings/principal-list.d.ts +37 -0
- package/dist/components/settings/principal-list.d.ts.map +1 -0
- package/dist/components/settings/principal-list.js +18 -0
- package/dist/components/settings/principal-list.js.map +1 -0
- package/dist/components/settings/settings-panel.d.ts +10 -3
- package/dist/components/settings/settings-panel.d.ts.map +1 -1
- package/dist/components/settings/settings-panel.js +71 -10
- package/dist/components/settings/settings-panel.js.map +1 -1
- package/dist/components/settings/skills-list.d.ts +53 -0
- package/dist/components/settings/skills-list.d.ts.map +1 -0
- package/dist/components/settings/skills-list.js +28 -0
- package/dist/components/settings/skills-list.js.map +1 -0
- package/dist/components/settings/skills-tab.d.ts.map +1 -1
- package/dist/components/settings/skills-tab.js +65 -38
- package/dist/components/settings/skills-tab.js.map +1 -1
- package/dist/components/settings/tool-permissions-list.d.ts +18 -0
- package/dist/components/settings/tool-permissions-list.d.ts.map +1 -0
- package/dist/components/settings/tool-permissions-list.js +6 -0
- package/dist/components/settings/tool-permissions-list.js.map +1 -0
- package/dist/components/settings/tool-permissions.d.ts +2 -1
- package/dist/components/settings/tool-permissions.d.ts.map +1 -1
- package/dist/components/settings/tool-permissions.js +33 -16
- package/dist/components/settings/tool-permissions.js.map +1 -1
- package/dist/components/settings/web-search-chain.d.ts +41 -0
- package/dist/components/settings/web-search-chain.d.ts.map +1 -0
- package/dist/components/settings/web-search-chain.js +47 -0
- package/dist/components/settings/web-search-chain.js.map +1 -0
- package/dist/components/settings/web-search-settings.d.ts +4 -7
- package/dist/components/settings/web-search-settings.d.ts.map +1 -1
- package/dist/components/settings/web-search-settings.js +54 -76
- package/dist/components/settings/web-search-settings.js.map +1 -1
- package/dist/components/share/share-menu.d.ts.map +1 -1
- package/dist/components/share/share-menu.js +24 -4
- package/dist/components/share/share-menu.js.map +1 -1
- package/dist/components/voice/dictation-sheet.js +3 -3
- package/dist/components/voice/dictation-sheet.js.map +1 -1
- package/dist/components/voice/mic-button.js +1 -1
- package/dist/components/voice/mic-button.js.map +1 -1
- package/dist/components/voice/review-card.js +1 -1
- package/dist/components/voice/review-card.js.map +1 -1
- package/dist/config.d.ts +5 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +15 -5
- package/dist/config.js.map +1 -1
- package/dist/connection.d.ts +12 -0
- package/dist/connection.d.ts.map +1 -0
- package/dist/connection.js +421 -0
- package/dist/connection.js.map +1 -0
- package/dist/default-root.d.ts +3 -0
- package/dist/default-root.d.ts.map +1 -0
- package/dist/default-root.js +16 -0
- package/dist/default-root.js.map +1 -0
- package/dist/hooks/use-color-scheme.d.ts +14 -0
- package/dist/hooks/use-color-scheme.d.ts.map +1 -0
- package/dist/hooks/use-color-scheme.js +37 -0
- package/dist/hooks/use-color-scheme.js.map +1 -0
- package/dist/hooks/use-fine-pointer.d.ts +12 -0
- package/dist/hooks/use-fine-pointer.d.ts.map +1 -0
- package/dist/hooks/use-fine-pointer.js +15 -0
- package/dist/hooks/use-fine-pointer.js.map +1 -0
- package/dist/hooks/use-hash-routes.d.ts.map +1 -1
- package/dist/hooks/use-hash-routes.js +4 -2
- package/dist/hooks/use-hash-routes.js.map +1 -1
- package/dist/hooks/use-media-query.d.ts +9 -0
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-media-query.js +38 -0
- package/dist/hooks/use-media-query.js.map +1 -0
- package/dist/hooks/use-share-intake.d.ts.map +1 -1
- package/dist/hooks/use-share-intake.js +37 -12
- package/dist/hooks/use-share-intake.js.map +1 -1
- package/dist/hooks/use-vpn-status.d.ts.map +1 -1
- package/dist/hooks/use-vpn-status.js +17 -18
- package/dist/hooks/use-vpn-status.js.map +1 -1
- package/dist/hooks/use-websocket.d.ts +5 -24
- package/dist/hooks/use-websocket.d.ts.map +1 -1
- package/dist/hooks/use-websocket.js +11 -384
- package/dist/hooks/use-websocket.js.map +1 -1
- package/dist/hooks/websocket-handlers/activity.d.ts +2 -2
- package/dist/hooks/websocket-handlers/activity.d.ts.map +1 -1
- package/dist/hooks/websocket-handlers/activity.js +4 -5
- package/dist/hooks/websocket-handlers/activity.js.map +1 -1
- package/dist/hooks/websocket-handlers/chat.d.ts +1 -0
- package/dist/hooks/websocket-handlers/chat.d.ts.map +1 -1
- package/dist/hooks/websocket-handlers/chat.js +28 -6
- package/dist/hooks/websocket-handlers/chat.js.map +1 -1
- package/dist/hooks/websocket-handlers/connection.d.ts.map +1 -1
- package/dist/hooks/websocket-handlers/connection.js +4 -6
- package/dist/hooks/websocket-handlers/connection.js.map +1 -1
- package/dist/hooks/websocket-handlers/mask.d.ts +1 -1
- package/dist/hooks/websocket-handlers/mask.d.ts.map +1 -1
- package/dist/hooks/websocket-handlers/mask.js +2 -3
- package/dist/hooks/websocket-handlers/mask.js.map +1 -1
- package/dist/hooks/websocket-handlers/provider.d.ts.map +1 -1
- package/dist/hooks/websocket-handlers/provider.js +4 -6
- package/dist/hooks/websocket-handlers/provider.js.map +1 -1
- package/dist/hooks/websocket-handlers/types.d.ts +6 -2
- package/dist/hooks/websocket-handlers/types.d.ts.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/api-client.d.ts +289 -0
- package/dist/lib/api-client.d.ts.map +1 -1
- package/dist/lib/api-client.js +243 -224
- package/dist/lib/api-client.js.map +1 -1
- package/dist/lib/backend.d.ts +19 -2
- package/dist/lib/backend.d.ts.map +1 -1
- package/dist/lib/backend.js +15 -9
- package/dist/lib/backend.js.map +1 -1
- package/dist/lib/diff.d.ts +8 -10
- package/dist/lib/diff.d.ts.map +1 -1
- package/dist/lib/diff.js +26 -53
- package/dist/lib/diff.js.map +1 -1
- package/dist/lib/light-dark.d.ts +37 -0
- package/dist/lib/light-dark.d.ts.map +1 -0
- package/dist/lib/light-dark.js +83 -0
- package/dist/lib/light-dark.js.map +1 -0
- package/dist/lib/mermaid-theme.d.ts +7 -2
- package/dist/lib/mermaid-theme.d.ts.map +1 -1
- package/dist/lib/mermaid-theme.js +125 -203
- package/dist/lib/mermaid-theme.js.map +1 -1
- package/dist/lib/passkeys.d.ts +6 -3
- package/dist/lib/passkeys.d.ts.map +1 -1
- package/dist/lib/passkeys.js +10 -4
- package/dist/lib/passkeys.js.map +1 -1
- package/dist/lib/push-registration.d.ts +4 -1
- package/dist/lib/push-registration.d.ts.map +1 -1
- package/dist/lib/push-registration.js +20 -2
- package/dist/lib/push-registration.js.map +1 -1
- package/dist/lib/share-intake.d.ts +2 -1
- package/dist/lib/share-intake.d.ts.map +1 -1
- package/dist/lib/share-intake.js +3 -3
- package/dist/lib/share-intake.js.map +1 -1
- package/dist/lib/share.d.ts +4 -3
- package/dist/lib/share.d.ts.map +1 -1
- package/dist/lib/share.js +6 -7
- package/dist/lib/share.js.map +1 -1
- package/dist/lib/single-key.d.ts +30 -0
- package/dist/lib/single-key.d.ts.map +1 -0
- package/dist/lib/single-key.js +45 -0
- package/dist/lib/single-key.js.map +1 -0
- package/dist/lib/tool-names.d.ts +8 -6
- package/dist/lib/tool-names.d.ts.map +1 -1
- package/dist/lib/tool-names.js +17 -7
- package/dist/lib/tool-names.js.map +1 -1
- package/dist/root-context.d.ts +229 -0
- package/dist/root-context.d.ts.map +1 -0
- package/dist/root-context.js +33 -0
- package/dist/root-context.js.map +1 -0
- package/dist/root.d.ts +38 -0
- package/dist/root.d.ts.map +1 -0
- package/dist/root.js +47 -0
- package/dist/root.js.map +1 -0
- package/dist/stores/activity-state.d.ts +29 -0
- package/dist/stores/activity-state.d.ts.map +1 -0
- package/dist/stores/activity-state.js +282 -0
- package/dist/stores/activity-state.js.map +1 -0
- package/dist/stores/activity-store.d.ts +10 -41
- package/dist/stores/activity-store.d.ts.map +1 -1
- package/dist/stores/activity-store.js +9 -271
- package/dist/stores/activity-store.js.map +1 -1
- package/dist/stores/chat-state.d.ts +233 -0
- package/dist/stores/chat-state.d.ts.map +1 -0
- package/dist/stores/chat-state.js +477 -0
- package/dist/stores/chat-state.js.map +1 -0
- package/dist/stores/chat-store.d.ts +4 -162
- package/dist/stores/chat-store.d.ts.map +1 -1
- package/dist/stores/chat-store.js +7 -418
- package/dist/stores/chat-store.js.map +1 -1
- package/dist/stores/connection-state.d.ts +40 -0
- package/dist/stores/connection-state.d.ts.map +1 -0
- package/dist/stores/connection-state.js +30 -0
- package/dist/stores/connection-state.js.map +1 -0
- package/dist/stores/connection-store.d.ts +4 -40
- package/dist/stores/connection-store.d.ts.map +1 -1
- package/dist/stores/connection-store.js +7 -27
- package/dist/stores/connection-store.js.map +1 -1
- package/dist/stores/create-stores.d.ts +23 -0
- package/dist/stores/create-stores.d.ts.map +1 -0
- package/dist/stores/create-stores.js +28 -0
- package/dist/stores/create-stores.js.map +1 -0
- package/dist/stores/file-state.d.ts +53 -0
- package/dist/stores/file-state.d.ts.map +1 -0
- package/dist/stores/file-state.js +341 -0
- package/dist/stores/file-state.js.map +1 -0
- package/dist/stores/file-store.d.ts +4 -52
- package/dist/stores/file-store.d.ts.map +1 -1
- package/dist/stores/file-store.js +7 -336
- package/dist/stores/file-store.js.map +1 -1
- package/dist/stores/graph-state.d.ts +95 -0
- package/dist/stores/graph-state.d.ts.map +1 -0
- package/dist/stores/graph-state.js +252 -0
- package/dist/stores/graph-state.js.map +1 -0
- package/dist/stores/graph-store.d.ts +7 -83
- package/dist/stores/graph-store.d.ts.map +1 -1
- package/dist/stores/graph-store.js +8 -249
- package/dist/stores/graph-store.js.map +1 -1
- package/dist/stores/mask-state.d.ts +21 -0
- package/dist/stores/mask-state.d.ts.map +1 -0
- package/dist/stores/mask-state.js +9 -0
- package/dist/stores/mask-state.js.map +1 -0
- package/dist/stores/mask-store.d.ts +4 -21
- package/dist/stores/mask-store.d.ts.map +1 -1
- package/dist/stores/mask-store.js +7 -6
- package/dist/stores/mask-store.js.map +1 -1
- package/dist/stores/principal-state.d.ts +16 -0
- package/dist/stores/principal-state.d.ts.map +1 -0
- package/dist/stores/principal-state.js +31 -0
- package/dist/stores/principal-state.js.map +1 -0
- package/dist/stores/principal-store.d.ts +4 -15
- package/dist/stores/principal-store.d.ts.map +1 -1
- package/dist/stores/principal-store.js +7 -28
- package/dist/stores/principal-store.js.map +1 -1
- package/dist/stores/provider-state.d.ts +24 -0
- package/dist/stores/provider-state.d.ts.map +1 -0
- package/dist/stores/provider-state.js +68 -0
- package/dist/stores/provider-state.js.map +1 -0
- package/dist/stores/provider-store.d.ts +4 -23
- package/dist/stores/provider-store.d.ts.map +1 -1
- package/dist/stores/provider-store.js +7 -64
- package/dist/stores/provider-store.js.map +1 -1
- package/dist/stores/share-state.d.ts +29 -0
- package/dist/stores/share-state.d.ts.map +1 -0
- package/dist/stores/share-state.js +21 -0
- package/dist/stores/share-state.js.map +1 -0
- package/dist/stores/share-store.d.ts +4 -28
- package/dist/stores/share-store.d.ts.map +1 -1
- package/dist/stores/share-store.js +7 -18
- package/dist/stores/share-store.js.map +1 -1
- package/dist/stores/store-environment.d.ts +10 -0
- package/dist/stores/store-environment.d.ts.map +1 -0
- package/dist/stores/store-environment.js +2 -0
- package/dist/stores/store-environment.js.map +1 -0
- package/dist/stores/ui-state.d.ts +71 -0
- package/dist/stores/ui-state.d.ts.map +1 -0
- package/dist/stores/ui-state.js +58 -0
- package/dist/stores/ui-state.js.map +1 -0
- package/dist/stores/ui-store.d.ts +4 -45
- package/dist/stores/ui-store.d.ts.map +1 -1
- package/dist/stores/ui-store.js +7 -36
- package/dist/stores/ui-store.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme.css +150 -97
- package/dist/voice/asr-clients.d.ts +2 -1
- package/dist/voice/asr-clients.d.ts.map +1 -1
- package/dist/voice/asr-clients.js +16 -17
- package/dist/voice/asr-clients.js.map +1 -1
- package/dist/voice/use-dictation.d.ts.map +1 -1
- package/dist/voice/use-dictation.js +12 -8
- package/dist/voice/use-dictation.js.map +1 -1
- package/dist/voice/voice-state.d.ts +25 -0
- package/dist/voice/voice-state.d.ts.map +1 -0
- package/dist/voice/voice-state.js +29 -0
- package/dist/voice/voice-state.js.map +1 -0
- package/dist/voice/voice-store.d.ts +4 -25
- package/dist/voice/voice-store.d.ts.map +1 -1
- package/dist/voice/voice-store.js +7 -26
- package/dist/voice/voice-store.js.map +1 -1
- package/package.json +3 -2
- package/src/components/activity/activity-page.tsx +341 -160
- package/src/components/activity/activity-run-detail.tsx +81 -47
- package/src/components/activity/activity-run-list.tsx +27 -59
- package/src/components/activity/activity-views.tsx +155 -0
- package/src/components/activity/approval-card.tsx +117 -0
- package/src/components/activity/digest-card.tsx +25 -61
- package/src/components/activity/digest-summary.tsx +52 -0
- package/src/components/activity/push-switch.tsx +62 -0
- package/src/components/activity/push-toggle.tsx +51 -81
- package/src/components/activity/span-bits.tsx +60 -7
- package/src/components/chat/ask-user-card.tsx +292 -356
- package/src/components/chat/ask-user-typed.ts +77 -0
- package/src/components/chat/brain-markdown-links.tsx +4 -4
- package/src/components/chat/brain-markdown.tsx +4 -2
- package/src/components/chat/chat-page.tsx +41 -11
- package/src/components/chat/composer-view.tsx +194 -0
- package/src/components/chat/composer.tsx +117 -296
- package/src/components/chat/markdown-content.tsx +53 -2
- package/src/components/chat/mermaid-block.tsx +13 -5
- package/src/components/chat/mermaid-share.ts +8 -7
- package/src/components/chat/mermaid-viewer.tsx +3 -1
- package/src/components/chat/message-bubble.tsx +78 -94
- package/src/components/chat/message-share.ts +7 -7
- package/src/components/chat/renderers/bind.tsx +94 -0
- package/src/components/chat/renderers/brain-ui-tools.tsx +56 -0
- package/src/components/chat/renderers/claude-tools.tsx +3 -2
- package/src/components/chat/renderers/index.ts +15 -10
- package/src/components/chat/session-drawer.tsx +41 -138
- package/src/components/chat/session-list.tsx +113 -0
- package/src/components/chat/share-block.tsx +16 -12
- package/src/components/chat/share-card.tsx +2 -2
- package/src/components/chat/subagent-view.tsx +4 -4
- package/src/components/chat/tool-call-timeline.tsx +75 -26
- package/src/components/chat/tool-cards/block-card.tsx +145 -0
- package/src/components/chat/tool-cards/image-mask-card.tsx +214 -0
- package/src/components/chat/tool-cards/location-card.tsx +159 -0
- package/src/components/chat/tool-views.tsx +30 -60
- package/src/components/chat/transcript-turn.tsx +108 -0
- package/src/components/chat/use-chat-commands.ts +14 -16
- package/src/components/chat/welcome-state.tsx +36 -91
- package/src/components/connectivity/connection-gate.tsx +32 -24
- package/src/components/connectivity/login-form.tsx +122 -0
- package/src/components/connectivity/login-screen.tsx +45 -100
- package/src/components/dev/share-harness.tsx +2 -2
- package/src/components/files/file-panel.tsx +168 -0
- package/src/components/files/file-tree-view.tsx +127 -0
- package/src/components/files/file-tree.tsx +55 -109
- package/src/components/files/file-viewer-binary.tsx +3 -2
- package/src/components/files/file-viewer-frame.tsx +113 -0
- package/src/components/files/file-viewer.tsx +40 -95
- package/src/components/files/frontmatter-chips.tsx +42 -0
- package/src/components/files/frontmatter-panel.tsx +6 -71
- package/src/components/files/staleness.ts +29 -0
- package/src/components/graph/graph-canvas.tsx +24 -1
- package/src/components/graph/graph-controls-column.tsx +92 -0
- package/src/components/graph/graph-controls.tsx +83 -127
- package/src/components/graph/graph-form.tsx +183 -0
- package/src/components/graph/graph-maintenance.tsx +9 -14
- package/src/components/graph/graph-node-rail.tsx +147 -0
- package/src/components/graph/graph-page.tsx +189 -49
- package/src/components/graph/graph-scene.tsx +200 -30
- package/src/components/graph/lib/graph-helpers.ts +65 -43
- package/src/components/graph/node-card.tsx +64 -0
- package/src/components/graph/node-popover.tsx +28 -117
- package/src/components/graph/use-graph-theme.ts +69 -32
- package/src/components/graph/use-node-actions.ts +56 -0
- package/src/components/images/image-share.ts +4 -2
- package/src/components/images/image-viewer.tsx +3 -1
- package/src/components/images/mask-editor.tsx +7 -4
- package/src/components/layout/app-shell.tsx +5 -1
- package/src/components/layout/desktop-palette.tsx +151 -0
- package/src/components/layout/key-cap.tsx +15 -0
- package/src/components/layout/mobile-tab-bar.tsx +80 -157
- package/src/components/layout/shortcut-switch.tsx +32 -0
- package/src/components/layout/side-rail.tsx +77 -150
- package/src/components/layout/slide-panel.tsx +49 -6
- package/src/components/layout/theme.tsx +67 -0
- package/src/components/quick-actions/add-form.tsx +196 -0
- package/src/components/quick-actions/add-modal.tsx +32 -153
- package/src/components/quick-actions/search-modal.tsx +15 -5
- package/src/components/quick-actions/streaming-modal.tsx +57 -72
- package/src/components/quick-actions/streaming-output.tsx +112 -0
- package/src/components/quick-actions/whatsup-modal.tsx +53 -59
- package/src/components/settings/devices-agents-tab.tsx +60 -152
- package/src/components/settings/models-list.tsx +299 -0
- package/src/components/settings/models-tab.tsx +63 -337
- package/src/components/settings/one-time-agent-credential.tsx +1 -1
- package/src/components/settings/passkey-list.tsx +201 -0
- package/src/components/settings/passkey-tab.tsx +53 -197
- package/src/components/settings/pi-accounts-list.tsx +128 -0
- package/src/components/settings/pi-accounts.tsx +71 -170
- package/src/components/settings/principal-list.tsx +172 -0
- package/src/components/settings/settings-panel.tsx +239 -25
- package/src/components/settings/skills-list.tsx +276 -0
- package/src/components/settings/skills-tab.tsx +82 -269
- package/src/components/settings/tool-permissions-list.tsx +54 -0
- package/src/components/settings/tool-permissions.tsx +27 -46
- package/src/components/settings/web-search-chain.tsx +300 -0
- package/src/components/settings/web-search-settings.tsx +58 -328
- package/src/components/share/share-menu.tsx +19 -4
- package/src/components/voice/dictation-sheet.tsx +5 -5
- package/src/components/voice/mic-button.tsx +1 -1
- package/src/components/voice/review-card.tsx +1 -1
- package/src/config.ts +21 -7
- package/src/connection.ts +443 -0
- package/src/default-root.ts +16 -0
- package/src/hooks/use-color-scheme.ts +36 -0
- package/src/hooks/use-fine-pointer.ts +15 -0
- package/src/hooks/use-hash-routes.ts +4 -2
- package/src/hooks/use-media-query.ts +35 -0
- package/src/hooks/use-share-intake.ts +32 -12
- package/src/hooks/use-vpn-status.ts +18 -17
- package/src/hooks/use-websocket.ts +12 -428
- package/src/hooks/websocket-handlers/activity.ts +4 -5
- package/src/hooks/websocket-handlers/chat.ts +28 -6
- package/src/hooks/websocket-handlers/connection.ts +4 -6
- package/src/hooks/websocket-handlers/mask.ts +2 -3
- package/src/hooks/websocket-handlers/provider.ts +4 -6
- package/src/hooks/websocket-handlers/types.ts +6 -2
- package/src/index.ts +7 -3
- package/src/lib/api-client.ts +426 -384
- package/src/lib/backend.ts +20 -10
- package/src/lib/diff.ts +28 -62
- package/src/lib/light-dark.ts +83 -0
- package/src/lib/mermaid-theme.ts +183 -214
- package/src/lib/passkeys.ts +12 -4
- package/src/lib/push-registration.ts +19 -2
- package/src/lib/share-intake.ts +6 -3
- package/src/lib/share.ts +7 -4
- package/src/lib/single-key.ts +47 -0
- package/src/lib/tool-names.ts +31 -8
- package/src/root-context.tsx +40 -0
- package/src/root.ts +83 -0
- package/src/stores/activity-state.ts +295 -0
- package/src/stores/activity-store.ts +11 -285
- package/src/stores/chat-state.ts +822 -0
- package/src/stores/chat-store.ts +11 -705
- package/src/stores/connection-state.ts +78 -0
- package/src/stores/connection-store.ts +11 -76
- package/src/stores/create-stores.ts +31 -0
- package/src/stores/file-state.ts +399 -0
- package/src/stores/file-store.ts +9 -390
- package/src/stores/graph-state.ts +368 -0
- package/src/stores/graph-store.ts +10 -355
- package/src/stores/mask-state.ts +30 -0
- package/src/stores/mask-store.ts +10 -27
- package/src/stores/principal-state.ts +42 -0
- package/src/stores/principal-store.ts +10 -37
- package/src/stores/provider-state.ts +103 -0
- package/src/stores/provider-store.ts +10 -95
- package/src/stores/share-state.ts +56 -0
- package/src/stores/share-store.ts +11 -54
- package/src/stores/store-environment.ts +10 -0
- package/src/stores/ui-state.ts +143 -0
- package/src/stores/ui-store.ts +11 -93
- package/src/styles.css +4 -1
- package/src/theme.css +150 -97
- package/src/voice/asr-clients.ts +17 -17
- package/src/voice/use-dictation.ts +11 -8
- package/src/voice/voice-state.ts +57 -0
- package/src/voice/voice-store.ts +11 -55
|
@@ -1,163 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
role: "user" | "assistant";
|
|
6
|
-
content: string;
|
|
7
|
-
thinking?: string;
|
|
8
|
-
toolCalls: ToolCall[];
|
|
9
|
-
/**
|
|
10
|
-
* Chronological thinking/text/tool segments, in arrival order. `content`,
|
|
11
|
-
* `thinking` and `toolCalls` remain the aggregated views (used for sharing
|
|
12
|
-
* and tool state); `parts` drives rendering order.
|
|
13
|
-
*/
|
|
14
|
-
parts: MessagePart[];
|
|
15
|
-
isStreaming: boolean;
|
|
16
|
-
timestamp: number;
|
|
17
|
-
source?: MessageSource;
|
|
18
|
-
/** AskUserQuestion exchanges raised during this assistant turn. */
|
|
19
|
-
askUserExchanges?: AskUserExchange[];
|
|
20
|
-
/**
|
|
21
|
-
* Image attachments on a user message. Live messages carry a local
|
|
22
|
-
* `previewUrl` (object URL, revoked on clear). History-loaded messages
|
|
23
|
-
* carry no data — only `attachmentCount` — since base64 is never replayed.
|
|
24
|
-
*/
|
|
25
|
-
attachments?: MessageAttachment[];
|
|
26
|
-
/** Attachment count for history-loaded messages without preview data. */
|
|
27
|
-
attachmentCount?: number;
|
|
28
|
-
}
|
|
29
|
-
export interface MessageAttachment {
|
|
30
|
-
previewUrl: string;
|
|
31
|
-
mediaType: string;
|
|
32
|
-
}
|
|
33
|
-
export interface ToolCall {
|
|
34
|
-
id: string;
|
|
35
|
-
name: string;
|
|
36
|
-
input: Record<string, unknown>;
|
|
37
|
-
inputJson: string;
|
|
38
|
-
output?: string;
|
|
39
|
-
isError?: boolean;
|
|
40
|
-
status: "streaming" | "pending_approval" | "approved" | "denied" | "complete";
|
|
41
|
-
/**
|
|
42
|
-
* What the pending approval is for: "tool" may be remembered via "Always
|
|
43
|
-
* allow"; "command" (a destructive-bash confirmation) is per-use only.
|
|
44
|
-
*/
|
|
45
|
-
approvalKind?: "tool" | "command";
|
|
46
|
-
/**
|
|
47
|
-
* Execution timing for the duration badge. `startedAt` is (re)stamped when
|
|
48
|
-
* the input finishes streaming or an approval is granted — so approval
|
|
49
|
-
* wait time doesn't inflate the reported duration. `endedAt` is stamped by
|
|
50
|
-
* the tool result. History-loaded messages carry no timing.
|
|
51
|
-
*/
|
|
52
|
-
startedAt?: number;
|
|
53
|
-
endedAt?: number;
|
|
54
|
-
}
|
|
55
|
-
export interface AskUserExchange {
|
|
56
|
-
requestId: string;
|
|
57
|
-
questions: AskUserQuestion[];
|
|
58
|
-
/** Filled in once the user submits. Keyed by question text. */
|
|
59
|
-
answers?: Record<string, string>;
|
|
60
|
-
annotations?: Record<string, AskUserAnnotation>;
|
|
61
|
-
cancelled?: boolean;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* One session's live transcript state. Every session the user has viewed (or
|
|
65
|
-
* that bound from the draft) keeps its own buffer, so frames from a background
|
|
66
|
-
* session accumulate in THAT session's transcript instead of being discarded —
|
|
67
|
-
* the multi-session contract the old single-active-buffer store violated.
|
|
68
|
-
*/
|
|
69
|
-
export interface SessionChat {
|
|
70
|
-
messages: ChatMessage[];
|
|
71
|
-
isStreaming: boolean;
|
|
72
|
-
/**
|
|
73
|
-
* The currently-pending ask-user exchange in this session (no answers yet).
|
|
74
|
-
* Mirrors the same exchange that lives on the streaming assistant message;
|
|
75
|
-
* held here for fast lookup by hooks/components.
|
|
76
|
-
*/
|
|
77
|
-
askUser: AskUserExchange | null;
|
|
78
|
-
/** LRU stamp for buffer eviction. */
|
|
79
|
-
lastTouched: number;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Buffer key: a server sessionId, or null for the DRAFT buffer — the new
|
|
83
|
-
* conversation that has no server identity yet. `session_info` re-keys the
|
|
84
|
-
* draft onto its real sessionId via bindDraftSession().
|
|
85
|
-
*/
|
|
86
|
-
export type ChatKey = string | null;
|
|
87
|
-
interface ChatState {
|
|
88
|
-
/** Per-session transcript buffers, keyed by server sessionId. */
|
|
89
|
-
buffers: Record<string, SessionChat>;
|
|
90
|
-
/** The unbound new-conversation buffer, if one is in progress. */
|
|
91
|
-
draft: SessionChat | null;
|
|
92
|
-
/**
|
|
93
|
-
* Correlation id for the conversation the draft is currently starting.
|
|
94
|
-
*
|
|
95
|
-
* A client starting a conversation has no session id, so it used to adopt
|
|
96
|
-
* the FIRST `session_info` for an unknown session — which could be an older
|
|
97
|
-
* background turn's, or another client's, silently binding the user's draft
|
|
98
|
-
* to someone else's transcript. The id is sent on `chat_message` and echoed
|
|
99
|
-
* on `session_info`; adoption now requires a match. Null when no draft turn
|
|
100
|
-
* is in flight.
|
|
101
|
-
*/
|
|
102
|
-
pendingDraftId: string | null;
|
|
103
|
-
/** The session in view; null = the draft / new-chat view. */
|
|
104
|
-
activeSessionId: string | null;
|
|
105
|
-
/**
|
|
106
|
-
* Live run-state per session id, for the session-list badges. Maintained for
|
|
107
|
-
* every session frame regardless of whether a buffer exists. "idle" is the
|
|
108
|
-
* absence of a running/queued turn.
|
|
109
|
-
*/
|
|
110
|
-
runStates: Record<string, "streaming" | "queued" | "idle">;
|
|
111
|
-
/**
|
|
112
|
-
* Backend that owns each session, from `session_info` (or the session list
|
|
113
|
-
* for history sessions). Scopes tool-call renderer resolution per backend;
|
|
114
|
-
* absence falls back to the deployment default.
|
|
115
|
-
*/
|
|
116
|
-
backendIds: Record<string, string>;
|
|
117
|
-
/**
|
|
118
|
-
* Per-session note attached to a `queued` status — the host sends one once a
|
|
119
|
-
* session's follow-up queue grows heavy. Cleared when the session leaves the
|
|
120
|
-
* queued state, so a stale warning cannot outlive the queue it described.
|
|
121
|
-
*/
|
|
122
|
-
queueNotes: Record<string, string>;
|
|
123
|
-
addUserMessage: (key: ChatKey, text: string, source?: MessageSource, attachments?: MessageAttachment[]) => void;
|
|
124
|
-
startAssistantMessage: (key: ChatKey) => void;
|
|
125
|
-
appendText: (key: ChatKey, text: string) => void;
|
|
126
|
-
appendThinking: (key: ChatKey, text: string) => void;
|
|
127
|
-
startToolCall: (key: ChatKey, toolUseId: string, toolName: string) => void;
|
|
128
|
-
appendToolInput: (key: ChatKey, partialJson: string) => void;
|
|
129
|
-
completeToolCall: (key: ChatKey, toolUseId: string, toolName: string, input: Record<string, unknown>) => void;
|
|
130
|
-
requestToolApproval: (key: ChatKey, toolUseId: string, toolName: string, input: Record<string, unknown>, description?: string, kind?: "tool" | "command") => void;
|
|
131
|
-
resolveToolApproval: (key: ChatKey, toolUseId: string, approved: boolean) => void;
|
|
132
|
-
setToolResult: (key: ChatKey, toolUseId: string, output: string, isError: boolean) => void;
|
|
133
|
-
setAskUserRequest: (key: ChatKey, requestId: string, questions: AskUserQuestion[]) => void;
|
|
134
|
-
submitAskUserAnswers: (key: ChatKey, requestId: string, answers: Record<string, string>, annotations?: Record<string, AskUserAnnotation>) => void;
|
|
135
|
-
cancelAskUser: (key: ChatKey, requestId: string) => void;
|
|
136
|
-
clearAskUser: (key: ChatKey) => void;
|
|
137
|
-
finishAssistantMessage: (key: ChatKey) => void;
|
|
138
|
-
setStreaming: (key: ChatKey, streaming: boolean) => void;
|
|
139
|
-
/** Replace a session's transcript (first replayed history chunk). Creates the buffer. */
|
|
140
|
-
setMessages: (key: ChatKey, messages: ChatMessage[]) => void;
|
|
141
|
-
/** Concatenate a continuation chunk of replayed history. Creates the buffer. */
|
|
142
|
-
appendMessages: (key: ChatKey, messages: ChatMessage[]) => void;
|
|
143
|
-
/**
|
|
144
|
-
* Adopt the draft buffer as `sessionId` (the server just named the session).
|
|
145
|
-
* If the draft view is active, the view follows. No-op draft = empty buffer.
|
|
146
|
-
*/
|
|
147
|
-
bindDraftSession: (sessionId: string) => void;
|
|
148
|
-
/** Mint and remember the correlation id for a draft turn about to be sent. */
|
|
149
|
-
startDraftTurn: () => string;
|
|
150
|
-
/** Switch the view to a session (creating an empty buffer if none), or to the draft (null). */
|
|
151
|
-
setActiveSession: (sessionId: string | null) => void;
|
|
152
|
-
/** New chat: drop the draft, unbind the view, unpin the provider. */
|
|
153
|
-
clearMessages: () => void;
|
|
154
|
-
setRunState: (sessionId: string, state: "streaming" | "queued" | "idle", note?: string) => void;
|
|
155
|
-
/** Record which backend owns a session (idempotent). */
|
|
156
|
-
setSessionBackend: (sessionId: string, backendId: string) => void;
|
|
157
|
-
}
|
|
158
|
-
/** The buffer currently in view (draft when no session is bound). */
|
|
159
|
-
export declare function activeChat(state: ChatState): SessionChat;
|
|
160
|
-
/** True when ANY buffer is streaming (service-worker busy check, etc.). */
|
|
161
|
-
export declare function anyStreaming(state: ChatState): boolean;
|
|
162
|
-
export declare const useChatStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ChatState>>;
|
|
1
|
+
import { defaultRoot } from "../default-root.js";
|
|
2
|
+
export * from "./chat-state.js";
|
|
3
|
+
/** Hook reads the current provider. Statics address the default app only. */
|
|
4
|
+
export declare const useChatStore: (<T>(selector: (state: ReturnType<typeof defaultRoot.stores.chat.getState>) => T) => T) & import("zustand").StoreApi<import("./chat-state.js").ChatState>;
|
|
163
5
|
//# sourceMappingURL=chat-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-store.d.ts","sourceRoot":"","sources":["../../src/stores/chat-store.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"chat-store.d.ts","sourceRoot":"","sources":["../../src/stores/chat-store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,cAAc,iBAAiB,CAAC;AAEhC,6EAA6E;AAC7E,eAAO,MAAM,YAAY,IACD,CAAC,YAAY,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAG,CAAC,mEAIzG,CAAC"}
|
|
@@ -1,419 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return `msg-${++messageCounter}-${Date.now()}`;
|
|
9
|
-
}
|
|
10
|
-
const SESSION_ID_KEY = "brain-sessionId";
|
|
11
|
-
/**
|
|
12
|
-
* Persist the active session id to localStorage when a DOM is present (the
|
|
13
|
-
* browser). A no-op in non-DOM environments (tests, SSR) so creating the store
|
|
14
|
-
* never throws on a missing `localStorage`.
|
|
15
|
-
*/
|
|
16
|
-
function persistSessionId(id) {
|
|
17
|
-
if (typeof localStorage === "undefined")
|
|
18
|
-
return;
|
|
19
|
-
if (id)
|
|
20
|
-
localStorage.setItem(SESSION_ID_KEY, id);
|
|
21
|
-
else
|
|
22
|
-
localStorage.removeItem(SESSION_ID_KEY);
|
|
23
|
-
}
|
|
24
|
-
function readPersistedSessionId() {
|
|
25
|
-
if (typeof localStorage === "undefined")
|
|
26
|
-
return null;
|
|
27
|
-
return localStorage.getItem(SESSION_ID_KEY);
|
|
28
|
-
}
|
|
29
|
-
function emptyChat() {
|
|
30
|
-
return { messages: [], isStreaming: false, askUser: null, lastTouched: Date.now() };
|
|
31
|
-
}
|
|
32
|
-
/** Frozen empty buffer for selectors when nothing is in view. */
|
|
33
|
-
const EMPTY_CHAT = Object.freeze({
|
|
34
|
-
messages: Object.freeze([]),
|
|
35
|
-
isStreaming: false,
|
|
36
|
-
askUser: null,
|
|
37
|
-
lastTouched: 0,
|
|
38
|
-
});
|
|
39
|
-
/** The buffer currently in view (draft when no session is bound). */
|
|
40
|
-
export function activeChat(state) {
|
|
41
|
-
if (state.activeSessionId)
|
|
42
|
-
return state.buffers[state.activeSessionId] ?? EMPTY_CHAT;
|
|
43
|
-
return state.draft ?? EMPTY_CHAT;
|
|
44
|
-
}
|
|
45
|
-
/** True when ANY buffer is streaming (service-worker busy check, etc.). */
|
|
46
|
-
export function anyStreaming(state) {
|
|
47
|
-
if (state.draft?.isStreaming)
|
|
48
|
-
return true;
|
|
49
|
-
return Object.values(state.buffers).some((b) => b.isStreaming);
|
|
50
|
-
}
|
|
51
|
-
/** Append text to the last part if it has the same kind, else start a new part. */
|
|
52
|
-
function appendPart(parts, kind, text) {
|
|
53
|
-
const last = parts[parts.length - 1];
|
|
54
|
-
if (last && last.kind === kind) {
|
|
55
|
-
return [...parts.slice(0, -1), { kind, text: last.text + text }];
|
|
56
|
-
}
|
|
57
|
-
return [...parts, { kind, text }];
|
|
58
|
-
}
|
|
59
|
-
/** Free object URLs held by live message previews before dropping them. */
|
|
60
|
-
function revokeAttachmentUrls(messages) {
|
|
61
|
-
for (const m of messages) {
|
|
62
|
-
for (const a of m.attachments ?? []) {
|
|
63
|
-
if (a.previewUrl.startsWith("blob:"))
|
|
64
|
-
URL.revokeObjectURL(a.previewUrl);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
/** Evict least-recently-touched non-active buffers beyond MAX_BUFFERS. */
|
|
69
|
-
function evictStale(buffers, activeSessionId) {
|
|
70
|
-
const ids = Object.keys(buffers);
|
|
71
|
-
if (ids.length <= MAX_BUFFERS)
|
|
72
|
-
return buffers;
|
|
73
|
-
const evictable = ids
|
|
74
|
-
.filter((id) => id !== activeSessionId && !buffers[id].isStreaming)
|
|
75
|
-
.sort((a, b) => buffers[a].lastTouched - buffers[b].lastTouched);
|
|
76
|
-
const next = { ...buffers };
|
|
77
|
-
for (const id of evictable.slice(0, ids.length - MAX_BUFFERS)) {
|
|
78
|
-
revokeAttachmentUrls(next[id].messages);
|
|
79
|
-
delete next[id];
|
|
80
|
-
}
|
|
81
|
-
return next;
|
|
82
|
-
}
|
|
83
|
-
export const useChatStore = create((set, get) => {
|
|
84
|
-
/**
|
|
85
|
-
* Immutably update one buffer. Draft mutations (key null) create the draft
|
|
86
|
-
* on demand; session mutations require an existing buffer — a frame for an
|
|
87
|
-
* evicted/never-opened session must not materialize a partial transcript
|
|
88
|
-
* (the view heals via session_resume instead).
|
|
89
|
-
*/
|
|
90
|
-
function mutateBuffer(key, fn, createIfMissing = false) {
|
|
91
|
-
set((state) => {
|
|
92
|
-
if (key === null) {
|
|
93
|
-
const draft = state.draft ?? emptyChat();
|
|
94
|
-
return { draft: { ...draft, ...fn(draft), lastTouched: Date.now() } };
|
|
95
|
-
}
|
|
96
|
-
const existing = state.buffers[key] ?? (createIfMissing ? emptyChat() : undefined);
|
|
97
|
-
if (!existing)
|
|
98
|
-
return state;
|
|
99
|
-
return {
|
|
100
|
-
buffers: {
|
|
101
|
-
...state.buffers,
|
|
102
|
-
[key]: { ...existing, ...fn(existing), lastTouched: Date.now() },
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
/** Update the last message of a buffer when it is an assistant message. */
|
|
108
|
-
function mutateLastAssistant(key, fn, extra) {
|
|
109
|
-
mutateBuffer(key, (chat) => {
|
|
110
|
-
const msgs = [...chat.messages];
|
|
111
|
-
// The last ASSISTANT message, not the last message.
|
|
112
|
-
//
|
|
113
|
-
// A follow-up sent mid-stream appends a user message to the end of the
|
|
114
|
-
// buffer while the assistant is still streaming into the message before
|
|
115
|
-
// it. Indexing the end therefore aimed every subsequent delta at the
|
|
116
|
-
// user's own message, where `role === "assistant"` failed and the write
|
|
117
|
-
// was silently discarded — the turn kept running and its output stopped
|
|
118
|
-
// appearing. Scanning backwards costs nothing at these lengths and
|
|
119
|
-
// leaves single-message behaviour identical.
|
|
120
|
-
let index = -1;
|
|
121
|
-
for (let i = msgs.length - 1; i >= 0; i--) {
|
|
122
|
-
if (msgs[i].role === "assistant") {
|
|
123
|
-
index = i;
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
let out = {};
|
|
128
|
-
if (index !== -1) {
|
|
129
|
-
msgs[index] = fn(msgs[index]);
|
|
130
|
-
out = { messages: msgs };
|
|
131
|
-
}
|
|
132
|
-
return extra ? { ...out, ...extra(chat) } : out;
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
return {
|
|
136
|
-
buffers: {},
|
|
137
|
-
draft: null,
|
|
138
|
-
pendingDraftId: null,
|
|
139
|
-
// localStorage (not sessionStorage) so the active session id survives the
|
|
140
|
-
// PWA process being killed on mobile — that durability is what lets a cold
|
|
141
|
-
// relaunch re-request the full transcript instead of showing nothing.
|
|
142
|
-
activeSessionId: readPersistedSessionId(),
|
|
143
|
-
runStates: {},
|
|
144
|
-
queueNotes: {},
|
|
145
|
-
backendIds: {},
|
|
146
|
-
// createIfMissing: a user-initiated send must never be dropped, even when
|
|
147
|
-
// the active session's buffer hasn't been materialized yet (cold start
|
|
148
|
-
// racing the history replay).
|
|
149
|
-
addUserMessage: (key, text, source, attachments) => mutateBuffer(key, (chat) => ({
|
|
150
|
-
messages: [
|
|
151
|
-
...chat.messages,
|
|
152
|
-
{
|
|
153
|
-
id: nextId(),
|
|
154
|
-
role: "user",
|
|
155
|
-
content: text,
|
|
156
|
-
toolCalls: [],
|
|
157
|
-
parts: [],
|
|
158
|
-
isStreaming: false,
|
|
159
|
-
timestamp: Date.now(),
|
|
160
|
-
source: source ?? "typed",
|
|
161
|
-
...(attachments && attachments.length > 0
|
|
162
|
-
? { attachments, attachmentCount: attachments.length }
|
|
163
|
-
: {}),
|
|
164
|
-
},
|
|
165
|
-
],
|
|
166
|
-
}), true),
|
|
167
|
-
startAssistantMessage: (key) => mutateBuffer(key, (chat) => ({
|
|
168
|
-
messages: [
|
|
169
|
-
...chat.messages,
|
|
170
|
-
{
|
|
171
|
-
id: nextId(),
|
|
172
|
-
role: "assistant",
|
|
173
|
-
content: "",
|
|
174
|
-
thinking: "",
|
|
175
|
-
toolCalls: [],
|
|
176
|
-
parts: [],
|
|
177
|
-
isStreaming: true,
|
|
178
|
-
timestamp: Date.now(),
|
|
179
|
-
},
|
|
180
|
-
],
|
|
181
|
-
isStreaming: true,
|
|
182
|
-
})),
|
|
183
|
-
appendText: (key, text) => mutateLastAssistant(key, (last) => ({
|
|
184
|
-
...last,
|
|
185
|
-
content: last.content + text,
|
|
186
|
-
parts: appendPart(last.parts, "text", text),
|
|
187
|
-
})),
|
|
188
|
-
appendThinking: (key, text) => mutateLastAssistant(key, (last) => ({
|
|
189
|
-
...last,
|
|
190
|
-
thinking: (last.thinking || "") + text,
|
|
191
|
-
parts: appendPart(last.parts, "thinking", text),
|
|
192
|
-
})),
|
|
193
|
-
startToolCall: (key, toolUseId, toolName) => mutateLastAssistant(key, (last) => ({
|
|
194
|
-
...last,
|
|
195
|
-
parts: [...last.parts, { kind: "tool", toolIndex: last.toolCalls.length }],
|
|
196
|
-
toolCalls: [
|
|
197
|
-
...last.toolCalls,
|
|
198
|
-
{
|
|
199
|
-
id: toolUseId,
|
|
200
|
-
name: toolName,
|
|
201
|
-
input: {},
|
|
202
|
-
inputJson: "",
|
|
203
|
-
status: "streaming",
|
|
204
|
-
startedAt: Date.now(),
|
|
205
|
-
},
|
|
206
|
-
],
|
|
207
|
-
})),
|
|
208
|
-
appendToolInput: (key, partialJson) => mutateLastAssistant(key, (last) => {
|
|
209
|
-
if (last.toolCalls.length === 0)
|
|
210
|
-
return last;
|
|
211
|
-
const tools = [...last.toolCalls];
|
|
212
|
-
const lastTool = tools[tools.length - 1];
|
|
213
|
-
tools[tools.length - 1] = {
|
|
214
|
-
...lastTool,
|
|
215
|
-
inputJson: lastTool.inputJson + partialJson,
|
|
216
|
-
};
|
|
217
|
-
return { ...last, toolCalls: tools };
|
|
218
|
-
}),
|
|
219
|
-
completeToolCall: (key, toolUseId, toolName, input) => mutateLastAssistant(key, (last) => ({
|
|
220
|
-
...last,
|
|
221
|
-
toolCalls: last.toolCalls.map((t) => t.id === toolUseId || (t.name === toolName && t.status === "streaming")
|
|
222
|
-
? {
|
|
223
|
-
...t,
|
|
224
|
-
id: toolUseId,
|
|
225
|
-
input,
|
|
226
|
-
status: "complete",
|
|
227
|
-
// Input finished streaming — execution starts about now
|
|
228
|
-
startedAt: Date.now(),
|
|
229
|
-
}
|
|
230
|
-
: t),
|
|
231
|
-
})),
|
|
232
|
-
requestToolApproval: (key, toolUseId, toolName, input, _description, kind) => mutateLastAssistant(key, (last) => {
|
|
233
|
-
// Check if tool call already exists (from streaming)
|
|
234
|
-
const existingIdx = last.toolCalls.findIndex((t) => t.id === toolUseId || (t.name === toolName && t.status === "streaming"));
|
|
235
|
-
const tools = [...last.toolCalls];
|
|
236
|
-
const toolCall = {
|
|
237
|
-
id: toolUseId,
|
|
238
|
-
name: toolName,
|
|
239
|
-
input,
|
|
240
|
-
inputJson: JSON.stringify(input, null, 2),
|
|
241
|
-
status: "pending_approval",
|
|
242
|
-
...(kind ? { approvalKind: kind } : {}),
|
|
243
|
-
};
|
|
244
|
-
let parts = last.parts;
|
|
245
|
-
if (existingIdx >= 0) {
|
|
246
|
-
tools[existingIdx] = toolCall;
|
|
247
|
-
}
|
|
248
|
-
else {
|
|
249
|
-
// Approval request for a tool that never streamed a start event —
|
|
250
|
-
// give it a chronological slot too.
|
|
251
|
-
parts = [...parts, { kind: "tool", toolIndex: tools.length }];
|
|
252
|
-
tools.push(toolCall);
|
|
253
|
-
}
|
|
254
|
-
return { ...last, toolCalls: tools, parts };
|
|
255
|
-
}),
|
|
256
|
-
resolveToolApproval: (key, toolUseId, approved) => mutateLastAssistant(key, (last) => ({
|
|
257
|
-
...last,
|
|
258
|
-
toolCalls: last.toolCalls.map((t) => t.id === toolUseId
|
|
259
|
-
? {
|
|
260
|
-
...t,
|
|
261
|
-
status: approved ? "approved" : "denied",
|
|
262
|
-
// Don't let approval wait time inflate the duration badge
|
|
263
|
-
...(approved ? { startedAt: Date.now() } : {}),
|
|
264
|
-
}
|
|
265
|
-
: t),
|
|
266
|
-
})),
|
|
267
|
-
setToolResult: (key, toolUseId, output, isError) => mutateLastAssistant(key, (last) => ({
|
|
268
|
-
...last,
|
|
269
|
-
toolCalls: last.toolCalls.map((t) => t.id === toolUseId
|
|
270
|
-
? {
|
|
271
|
-
...t,
|
|
272
|
-
output,
|
|
273
|
-
isError,
|
|
274
|
-
status: "complete",
|
|
275
|
-
endedAt: Date.now(),
|
|
276
|
-
}
|
|
277
|
-
: t),
|
|
278
|
-
})),
|
|
279
|
-
setAskUserRequest: (key, requestId, questions) => mutateBuffer(key, (chat) => {
|
|
280
|
-
const exchange = { requestId, questions };
|
|
281
|
-
const msgs = [...chat.messages];
|
|
282
|
-
const lastIdx = msgs.length - 1;
|
|
283
|
-
const last = msgs[lastIdx];
|
|
284
|
-
if (last?.role === "assistant") {
|
|
285
|
-
msgs[lastIdx] = {
|
|
286
|
-
...last,
|
|
287
|
-
askUserExchanges: [...(last.askUserExchanges ?? []), exchange],
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
return { messages: msgs, askUser: exchange };
|
|
291
|
-
}),
|
|
292
|
-
submitAskUserAnswers: (key, requestId, answers, annotations) => mutateBuffer(key, (chat) => {
|
|
293
|
-
const update = (e) => e.requestId === requestId ? { ...e, answers, annotations } : e;
|
|
294
|
-
const msgs = chat.messages.map((m) => m.askUserExchanges?.some((e) => e.requestId === requestId)
|
|
295
|
-
? { ...m, askUserExchanges: m.askUserExchanges.map(update) }
|
|
296
|
-
: m);
|
|
297
|
-
const askUser = chat.askUser?.requestId === requestId ? update(chat.askUser) : chat.askUser;
|
|
298
|
-
return { messages: msgs, askUser };
|
|
299
|
-
}),
|
|
300
|
-
cancelAskUser: (key, requestId) => mutateBuffer(key, (chat) => {
|
|
301
|
-
const update = (e) => e.requestId === requestId ? { ...e, cancelled: true } : e;
|
|
302
|
-
const msgs = chat.messages.map((m) => m.askUserExchanges?.some((e) => e.requestId === requestId)
|
|
303
|
-
? { ...m, askUserExchanges: m.askUserExchanges.map(update) }
|
|
304
|
-
: m);
|
|
305
|
-
const askUser = chat.askUser?.requestId === requestId ? update(chat.askUser) : chat.askUser;
|
|
306
|
-
return { messages: msgs, askUser };
|
|
307
|
-
}),
|
|
308
|
-
clearAskUser: (key) => mutateBuffer(key, () => ({ askUser: null })),
|
|
309
|
-
finishAssistantMessage: (key) => mutateLastAssistant(key, (last) => ({ ...last, isStreaming: false }), () => ({ isStreaming: false })),
|
|
310
|
-
setStreaming: (key, streaming) => mutateBuffer(key, () => ({ isStreaming: streaming })),
|
|
311
|
-
setMessages: (key, messages) => set((state) => {
|
|
312
|
-
if (key === null) {
|
|
313
|
-
if (state.draft)
|
|
314
|
-
revokeAttachmentUrls(state.draft.messages);
|
|
315
|
-
return {
|
|
316
|
-
draft: { ...emptyChat(), messages },
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
const existing = state.buffers[key];
|
|
320
|
-
if (existing)
|
|
321
|
-
revokeAttachmentUrls(existing.messages);
|
|
322
|
-
const buffers = {
|
|
323
|
-
...state.buffers,
|
|
324
|
-
[key]: { ...emptyChat(), messages },
|
|
325
|
-
};
|
|
326
|
-
return { buffers: evictStale(buffers, state.activeSessionId) };
|
|
327
|
-
}),
|
|
328
|
-
appendMessages: (key, messages) => set((state) => {
|
|
329
|
-
if (key === null) {
|
|
330
|
-
const draft = state.draft ?? emptyChat();
|
|
331
|
-
return { draft: { ...draft, messages: [...draft.messages, ...messages] } };
|
|
332
|
-
}
|
|
333
|
-
const existing = state.buffers[key] ?? emptyChat();
|
|
334
|
-
return {
|
|
335
|
-
buffers: {
|
|
336
|
-
...state.buffers,
|
|
337
|
-
[key]: {
|
|
338
|
-
...existing,
|
|
339
|
-
messages: [...existing.messages, ...messages],
|
|
340
|
-
lastTouched: Date.now(),
|
|
341
|
-
},
|
|
342
|
-
},
|
|
343
|
-
};
|
|
344
|
-
}),
|
|
345
|
-
startDraftTurn: () => {
|
|
346
|
-
const id = typeof crypto !== "undefined" && "randomUUID" in crypto
|
|
347
|
-
? crypto.randomUUID()
|
|
348
|
-
: `draft-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
349
|
-
set({ pendingDraftId: id });
|
|
350
|
-
return id;
|
|
351
|
-
},
|
|
352
|
-
bindDraftSession: (sessionId) => set((state) => {
|
|
353
|
-
const adopted = state.buffers[sessionId] ?? state.draft ?? emptyChat();
|
|
354
|
-
const buffers = evictStale({ ...state.buffers, [sessionId]: { ...adopted, lastTouched: Date.now() } }, sessionId);
|
|
355
|
-
const followView = state.activeSessionId === null;
|
|
356
|
-
if (followView)
|
|
357
|
-
persistSessionId(sessionId);
|
|
358
|
-
return {
|
|
359
|
-
buffers,
|
|
360
|
-
draft: null,
|
|
361
|
-
pendingDraftId: null,
|
|
362
|
-
...(followView ? { activeSessionId: sessionId } : {}),
|
|
363
|
-
};
|
|
364
|
-
}),
|
|
365
|
-
setActiveSession: (sessionId) => set((state) => {
|
|
366
|
-
persistSessionId(sessionId);
|
|
367
|
-
if (sessionId === null)
|
|
368
|
-
return { activeSessionId: null };
|
|
369
|
-
const existing = state.buffers[sessionId];
|
|
370
|
-
const buffers = existing
|
|
371
|
-
? state.buffers
|
|
372
|
-
: evictStale({ ...state.buffers, [sessionId]: emptyChat() }, sessionId);
|
|
373
|
-
return { activeSessionId: sessionId, buffers };
|
|
374
|
-
}),
|
|
375
|
-
setRunState: (sessionId, runState, note) => set((state) => {
|
|
376
|
-
const noteChanged = (state.queueNotes[sessionId] ?? undefined) !== note;
|
|
377
|
-
if (state.runStates[sessionId] === runState && !noteChanged)
|
|
378
|
-
return state;
|
|
379
|
-
const runStates = { ...state.runStates };
|
|
380
|
-
if (runState === "idle")
|
|
381
|
-
delete runStates[sessionId];
|
|
382
|
-
else
|
|
383
|
-
runStates[sessionId] = runState;
|
|
384
|
-
// The note belongs to the queued state; anything else ends it. A
|
|
385
|
-
// `queued` frame with no note also clears, so a queue that drained back
|
|
386
|
-
// under the warn mark stops claiming it is heavy.
|
|
387
|
-
const queueNotes = { ...state.queueNotes };
|
|
388
|
-
if (runState === "queued" && note)
|
|
389
|
-
queueNotes[sessionId] = note;
|
|
390
|
-
else
|
|
391
|
-
delete queueNotes[sessionId];
|
|
392
|
-
return { runStates, queueNotes };
|
|
393
|
-
}),
|
|
394
|
-
setSessionBackend: (sessionId, backendId) => set((state) => state.backendIds[sessionId] === backendId
|
|
395
|
-
? state
|
|
396
|
-
: { backendIds: { ...state.backendIds, [sessionId]: backendId } }),
|
|
397
|
-
clearMessages: () => {
|
|
398
|
-
const state = get();
|
|
399
|
-
if (state.draft)
|
|
400
|
-
revokeAttachmentUrls(state.draft.messages);
|
|
401
|
-
persistSessionId(null);
|
|
402
|
-
// Starting fresh: unpin the provider so the picker unlocks.
|
|
403
|
-
useProviderStore.getState().setPinned(null);
|
|
404
|
-
set({ draft: null, activeSessionId: null });
|
|
405
|
-
},
|
|
406
|
-
};
|
|
407
|
-
});
|
|
408
|
-
// Dev-only handle so browser automation / manual debugging can inject
|
|
409
|
-
// fixture messages without a live Claude session. Registered rather than
|
|
410
|
-
// installed: whether this is a development build is the shell's call
|
|
411
|
-
// (`configureBrainUi({ devTools: true })`), not something a component library
|
|
412
|
-
// infers from its bundler.
|
|
413
|
-
registerDevHandle(() => {
|
|
414
|
-
if (typeof window === "undefined")
|
|
415
|
-
return;
|
|
416
|
-
window.__chatStore =
|
|
417
|
-
useChatStore;
|
|
418
|
-
});
|
|
1
|
+
import { useRootStore } from "../root-context.js";
|
|
2
|
+
import { defaultRoot } from "../default-root.js";
|
|
3
|
+
export * from "./chat-state.js";
|
|
4
|
+
/** Hook reads the current provider. Statics address the default app only. */
|
|
5
|
+
export const useChatStore = Object.assign(function useChatStore(selector) {
|
|
6
|
+
return useRootStore("chat", selector);
|
|
7
|
+
}, defaultRoot.stores.chat);
|
|
419
8
|
//# sourceMappingURL=chat-store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-store.js","sourceRoot":"","sources":["../../src/stores/chat-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAOjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AA8FjD,uEAAuE;AACvE,MAAM,WAAW,GAAG,CAAC,CAAC;AAyGtB,IAAI,cAAc,GAAG,CAAC,CAAC;AACvB,SAAS,MAAM;IACb,OAAO,OAAO,EAAE,c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