@schlessera/brain-ui-react 0.35.0 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +144 -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 +11 -0
- package/dist/components/activity/approval-card.d.ts.map +1 -0
- package/dist/components/activity/approval-card.js +46 -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.map +1 -1
- package/dist/components/activity/span-bits.js +9 -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 +24 -9
- 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 +37 -12
- 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 +13 -2
- package/dist/components/chat/tool-views.d.ts.map +1 -1
- package/dist/components/chat/tool-views.js +20 -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 +24 -0
- package/dist/components/layout/side-rail.d.ts.map +1 -1
- package/dist/components/layout/side-rail.js +65 -27
- package/dist/components/layout/side-rail.js.map +1 -1
- package/dist/components/layout/slide-panel.d.ts +12 -2
- package/dist/components/layout/slide-panel.d.ts.map +1 -1
- package/dist/components/layout/slide-panel.js +11 -2
- 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 +30 -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 +4 -3
- 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 +39 -17
- 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 +36 -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 +69 -8
- 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-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 +7 -0
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-media-query.js +34 -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 +27 -5
- 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 +212 -0
- package/dist/stores/chat-state.d.ts.map +1 -0
- package/dist/stores/chat-state.js +466 -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 +334 -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 +80 -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 +8 -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 +38 -9
- 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 +59 -22
- 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 +21 -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 +70 -150
- package/src/components/layout/slide-panel.tsx +29 -2
- package/src/components/layout/theme.tsx +67 -0
- package/src/components/quick-actions/add-form.tsx +188 -0
- package/src/components/quick-actions/add-modal.tsx +32 -153
- package/src/components/quick-actions/search-modal.tsx +5 -3
- package/src/components/quick-actions/streaming-modal.tsx +42 -71
- package/src/components/quick-actions/streaming-output.tsx +112 -0
- package/src/components/quick-actions/whatsup-modal.tsx +38 -60
- 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 +232 -21
- 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-hash-routes.ts +4 -2
- package/src/hooks/use-media-query.ts +32 -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 +26 -5
- 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 +795 -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,389 +1,16 @@
|
|
|
1
|
-
import { useEffect,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useChatStore, activeChat } from "../stores/chat-store.js";
|
|
5
|
-
import { useActivityStore, loadSessionActivityHistory } from "../stores/activity-store.js";
|
|
6
|
-
import { getWsUrl } from "../lib/backend.js";
|
|
7
|
-
import { dispatchServerMessage } from "./websocket-handlers/index.js";
|
|
8
|
-
import { runStateForFrame } from "./websocket-handlers/chat.js";
|
|
9
|
-
import { recheckVpnStatus } from "./use-vpn-status.js";
|
|
10
|
-
import { REFUSAL_ATTEMPTS } from "../components/connectivity/connection-state.js";
|
|
1
|
+
import { useEffect, useCallback } from "react";
|
|
2
|
+
import { defaultRoot } from "../default-root.js";
|
|
3
|
+
import { useBrainUiRoot } from "../root-context.js";
|
|
11
4
|
export { runStateForFrame } from "./websocket-handlers/chat.js";
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* adopted whichever arrived first — an older background turn finishing, or
|
|
18
|
-
* another client's new session, would capture the user's draft and bind it to
|
|
19
|
-
* a transcript they never wrote. `draftId` is minted per draft turn and echoed
|
|
20
|
-
* on `session_info`, so a match is proof.
|
|
21
|
-
*
|
|
22
|
-
* A server too old to echo it sends no `draftId`, and the pre-existing
|
|
23
|
-
* behaviour applies rather than the draft never binding at all: correctness
|
|
24
|
-
* where the information exists, compatibility where it does not.
|
|
25
|
-
*/
|
|
26
|
-
function isOurDraftAnnouncement(state, msg) {
|
|
27
|
-
// A terminal result has no draft correlation. Another client's turn may
|
|
28
|
-
// finish before our session_info arrives, so it can never claim our draft.
|
|
29
|
-
if (msg.type !== "session_info")
|
|
30
|
-
return false;
|
|
31
|
-
const pending = state.pendingDraftId;
|
|
32
|
-
if (msg.draftId)
|
|
33
|
-
return msg.draftId === pending;
|
|
34
|
-
// No echo to compare against.
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Lazily open a session-scoped activity subscription (live subagent rows,
|
|
39
|
-
* server-stamped tool timing). Idempotent per connection; the subscribed set
|
|
40
|
-
* resets when a new socket's server_hello arrives.
|
|
41
|
-
*/
|
|
42
|
-
function ensureActivitySubscription(sessionId) {
|
|
43
|
-
if (!sessionId)
|
|
44
|
-
return;
|
|
45
|
-
const activity = useActivityStore.getState();
|
|
46
|
-
if (!activity.supported || activity.subscribed[sessionId])
|
|
47
|
-
return;
|
|
48
|
-
activity.markSubscribed(sessionId);
|
|
49
|
-
wsClient?.send({ type: "activity_subscribe", view: "session", sessionId });
|
|
50
|
-
// The subscription snapshot carries OPEN runs; finished runs (history
|
|
51
|
-
// timing, past fan-outs) come from the REST side.
|
|
52
|
-
void loadSessionActivityHistory(sessionId);
|
|
53
|
-
}
|
|
54
|
-
const pendingDeltas = new Map();
|
|
55
|
-
let flushScheduled = false;
|
|
56
|
-
/**
|
|
57
|
-
* Apply every buffered delta, in arrival order, and clear the buffer.
|
|
58
|
-
*
|
|
59
|
-
* Exported so tests can force the frame rather than wait for one; production
|
|
60
|
-
* code never needs to call it, because every path that reads the transcript
|
|
61
|
-
* flushes first.
|
|
62
|
-
*/
|
|
63
|
-
export function flushChatDeltas() {
|
|
64
|
-
flushDeltas();
|
|
65
|
-
}
|
|
66
|
-
function flushDeltas() {
|
|
67
|
-
flushScheduled = false;
|
|
68
|
-
if (pendingDeltas.size === 0)
|
|
69
|
-
return;
|
|
70
|
-
const batches = [...pendingDeltas.entries()];
|
|
71
|
-
pendingDeltas.clear();
|
|
72
|
-
const state = useChatStore.getState();
|
|
73
|
-
for (const [key, chunks] of batches) {
|
|
74
|
-
for (const chunk of chunks) {
|
|
75
|
-
if (chunk.kind === "text")
|
|
76
|
-
state.appendText(key, chunk.text);
|
|
77
|
-
else
|
|
78
|
-
state.appendThinking(key, chunk.text);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
function enqueueDelta(key, kind, text) {
|
|
83
|
-
const chunks = pendingDeltas.get(key);
|
|
84
|
-
if (!chunks) {
|
|
85
|
-
pendingDeltas.set(key, [{ kind, text }]);
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
const last = chunks[chunks.length - 1];
|
|
89
|
-
if (last.kind === kind)
|
|
90
|
-
last.text += text;
|
|
91
|
-
else
|
|
92
|
-
chunks.push({ kind, text });
|
|
93
|
-
}
|
|
94
|
-
// Outside a browser (unit tests, SSR) there is no frame to wait for, so apply
|
|
95
|
-
// straight away and keep the handler's behaviour synchronous.
|
|
96
|
-
if (typeof requestAnimationFrame !== "function") {
|
|
97
|
-
flushDeltas();
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
if (!flushScheduled) {
|
|
101
|
-
flushScheduled = true;
|
|
102
|
-
requestAnimationFrame(flushDeltas);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
export function handleServerMessage(msg) {
|
|
106
|
-
// Every frame that is not itself a delta must see the transcript fully
|
|
107
|
-
// applied: the demux below reads buffer state, and the store records parts in
|
|
108
|
-
// arrival order, so a tool call landing ahead of buffered text would reorder
|
|
109
|
-
// the message.
|
|
110
|
-
if (msg.type !== "text_delta" && msg.type !== "thinking_delta")
|
|
111
|
-
flushDeltas();
|
|
112
|
-
const state = useChatStore.getState();
|
|
113
|
-
// Activity stream frames feed their own store and never touch chat state.
|
|
114
|
-
if (msg.type === "server_hello" ||
|
|
115
|
-
msg.type === "activity_snapshot" ||
|
|
116
|
-
msg.type === "activity_delta") {
|
|
117
|
-
const key = state.activeSessionId;
|
|
118
|
-
dispatchServerMessage(msg, {
|
|
119
|
-
state,
|
|
120
|
-
frameSessionId: undefined,
|
|
121
|
-
key,
|
|
122
|
-
buffer: () => (key === null ? state.draft : state.buffers[key]),
|
|
123
|
-
enqueueDelta,
|
|
124
|
-
ensureActivitySubscription,
|
|
125
|
-
requestBrowserLocation,
|
|
126
|
-
resyncIfNeeded,
|
|
127
|
-
coldResumeIfNeeded,
|
|
128
|
-
markHistoryReplaced,
|
|
129
|
-
});
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
// Parallel-session demux (per-session buffers). Every frame is scoped by
|
|
133
|
-
// sessionId; a scoped frame lands in ITS session's buffer, so a background
|
|
134
|
-
// session's transcript keeps accumulating while another one is in view.
|
|
135
|
-
// Frames without a sessionId (legacy single-session servers, or a new
|
|
136
|
-
// session's pre-binding frames) apply to the buffer in view.
|
|
137
|
-
const frameSessionId = msg.sessionId;
|
|
138
|
-
if (frameSessionId) {
|
|
139
|
-
// `detail` on a queued status is the host's queue-pressure note; it rides
|
|
140
|
-
// along so the session's badge can show WHY it is queued deep.
|
|
141
|
-
const queueNote = msg.type === "status" && msg.status === "queued" ? msg.detail : undefined;
|
|
142
|
-
state.setRunState(frameSessionId, runStateForFrame(msg), queueNote);
|
|
143
|
-
}
|
|
144
|
-
// Resolve the target buffer key for this frame.
|
|
145
|
-
let key;
|
|
146
|
-
if (!frameSessionId) {
|
|
147
|
-
key = state.activeSessionId; // null = the draft view
|
|
148
|
-
}
|
|
149
|
-
else if (state.buffers[frameSessionId]) {
|
|
150
|
-
key = frameSessionId;
|
|
151
|
-
}
|
|
152
|
-
else if (state.draft && isOurDraftAnnouncement(state, msg)) {
|
|
153
|
-
// A draft run just got its server identity: adopt the draft buffer.
|
|
154
|
-
state.bindDraftSession(frameSessionId);
|
|
155
|
-
key = frameSessionId;
|
|
156
|
-
}
|
|
157
|
-
else if (msg.type === "session_info" && frameSessionId === state.activeSessionId) {
|
|
158
|
-
// The ACTIVE session announced itself but has no buffer yet — the cold
|
|
159
|
-
// reattach case (PWA relaunch mid-turn; the server may skip the history
|
|
160
|
-
// frame when a first turn has no history yet). Materialize the buffer so
|
|
161
|
-
// this session_info and every following delta land instead of vanishing.
|
|
162
|
-
state.setActiveSession(frameSessionId);
|
|
163
|
-
key = frameSessionId;
|
|
164
|
-
}
|
|
165
|
-
else if (msg.type === "session_history") {
|
|
166
|
-
// History replay may create a buffer (cold resume / reattach).
|
|
167
|
-
key = frameSessionId;
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
// Scoped frame for a session with no buffer (never opened, or evicted):
|
|
171
|
-
// the badge above is all we track. The transcript heals via
|
|
172
|
-
// session_resume when the user opens it.
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
const buffer = () => {
|
|
176
|
-
const s = useChatStore.getState();
|
|
177
|
-
return key === null ? s.draft : s.buffers[key];
|
|
178
|
-
};
|
|
179
|
-
dispatchServerMessage(msg, {
|
|
180
|
-
state,
|
|
181
|
-
frameSessionId,
|
|
182
|
-
key,
|
|
183
|
-
buffer,
|
|
184
|
-
enqueueDelta,
|
|
185
|
-
ensureActivitySubscription,
|
|
186
|
-
requestBrowserLocation,
|
|
187
|
-
resyncIfNeeded,
|
|
188
|
-
coldResumeIfNeeded,
|
|
189
|
-
markHistoryReplaced,
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* The server asked the browser for its location (the agent called
|
|
194
|
-
* `get_current_location`). Read `navigator.geolocation` and reply over the same
|
|
195
|
-
* requestId. The browser shows its own permission prompt on first use; a denial,
|
|
196
|
-
* timeout, or unavailable position comes back as a `location_error` that the
|
|
197
|
-
* server turns into a tool error for the agent.
|
|
198
|
-
*/
|
|
199
|
-
function requestBrowserLocation(msg) {
|
|
200
|
-
const { requestId } = msg;
|
|
201
|
-
if (typeof navigator === "undefined" || !navigator.geolocation) {
|
|
202
|
-
wsClient?.send({
|
|
203
|
-
type: "location_error",
|
|
204
|
-
requestId,
|
|
205
|
-
code: 0,
|
|
206
|
-
message: "Geolocation is not available in this browser.",
|
|
207
|
-
});
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
const opts = msg.options ?? {};
|
|
211
|
-
navigator.geolocation.getCurrentPosition((pos) => {
|
|
212
|
-
wsClient?.send({
|
|
213
|
-
type: "location_response",
|
|
214
|
-
requestId,
|
|
215
|
-
coords: {
|
|
216
|
-
latitude: pos.coords.latitude,
|
|
217
|
-
longitude: pos.coords.longitude,
|
|
218
|
-
accuracy: pos.coords.accuracy,
|
|
219
|
-
altitude: pos.coords.altitude,
|
|
220
|
-
altitudeAccuracy: pos.coords.altitudeAccuracy,
|
|
221
|
-
heading: pos.coords.heading,
|
|
222
|
-
speed: pos.coords.speed,
|
|
223
|
-
},
|
|
224
|
-
timestamp: pos.timestamp,
|
|
225
|
-
});
|
|
226
|
-
}, (err) => {
|
|
227
|
-
wsClient?.send({
|
|
228
|
-
type: "location_error",
|
|
229
|
-
requestId,
|
|
230
|
-
code: err.code,
|
|
231
|
-
message: err.message || "Failed to retrieve location.",
|
|
232
|
-
});
|
|
233
|
-
}, {
|
|
234
|
-
enableHighAccuracy: opts.enableHighAccuracy ?? false,
|
|
235
|
-
timeout: opts.timeoutMs ?? 15000,
|
|
236
|
-
maximumAge: opts.maximumAgeMs ?? 60000,
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
// Reconnection bookkeeping: after a WS drop, the rendered transcript may have
|
|
240
|
-
// gaps (deltas streamed while offline are lost). We heal by replaying the
|
|
241
|
-
// authoritative session history — immediately if nothing is streaming, or
|
|
242
|
-
// once the in-flight turn settles (result / idle status). The pending resync
|
|
243
|
-
// is keyed to the session that needs healing (the one that was active at the
|
|
244
|
-
// reconnect), so a background session settling first cannot consume it.
|
|
245
|
-
let wasDisconnected = false;
|
|
246
|
-
let resyncSessionId = null;
|
|
247
|
-
function handleSocketClose(close) {
|
|
248
|
-
const connection = useConnectionStore.getState();
|
|
249
|
-
connection.recordWsClose(close.opened, close.code);
|
|
250
|
-
if (!close.opened &&
|
|
251
|
-
useConnectionStore.getState().handshakeFailures >= REFUSAL_ATTEMPTS) {
|
|
252
|
-
recheckVpnStatus();
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
function resyncIfNeeded(sessionId) {
|
|
256
|
-
if (!resyncSessionId || !sessionId || sessionId !== resyncSessionId)
|
|
257
|
-
return;
|
|
258
|
-
resyncSessionId = null;
|
|
259
|
-
wsClient?.send({ type: "session_resume", sessionId });
|
|
260
|
-
}
|
|
261
|
-
// A cold page / PWA relaunch restores only the stored session id, not the
|
|
262
|
-
// transcript. The server pushes a snapshot on connect only while a session is
|
|
263
|
-
// actively running; when it's idle (the common "agent finished while the phone
|
|
264
|
-
// slept" case) nothing arrives, so the client must fetch the finished
|
|
265
|
-
// session's history itself. Guarded to fire at most once per session id per
|
|
266
|
-
// connection — an empty session would otherwise re-trigger on every idle
|
|
267
|
-
// status and loop.
|
|
268
|
-
let coldResumedSessionId = null;
|
|
269
|
-
function markHistoryReplaced(key) {
|
|
270
|
-
if (key !== null && key === resyncSessionId)
|
|
271
|
-
resyncSessionId = null;
|
|
272
|
-
coldResumedSessionId = key;
|
|
273
|
-
}
|
|
274
|
-
function coldResumeIfNeeded(sessionId, messageCount) {
|
|
275
|
-
if (!sessionId || messageCount > 0)
|
|
276
|
-
return;
|
|
277
|
-
if (coldResumedSessionId === sessionId)
|
|
278
|
-
return;
|
|
279
|
-
coldResumedSessionId = sessionId;
|
|
280
|
-
wsClient?.send({ type: "session_resume", sessionId });
|
|
281
|
-
}
|
|
282
|
-
function handleStatusChange(status) {
|
|
283
|
-
useConnectionStore.getState().setWsStatus(status);
|
|
284
|
-
if (status === "connected") {
|
|
285
|
-
useConnectionStore.getState().noteSocketOpen();
|
|
286
|
-
}
|
|
287
|
-
// A status change can be followed by a history replay that rewrites the
|
|
288
|
-
// buffer, so land whatever is still buffered before anything reads it. In a
|
|
289
|
-
// hidden tab requestAnimationFrame does not run at all, which is exactly the
|
|
290
|
-
// case where deltas could otherwise sit unapplied across a reconnect.
|
|
291
|
-
flushDeltas();
|
|
292
|
-
if (status === "disconnected") {
|
|
293
|
-
wasDisconnected = true;
|
|
294
|
-
// Allow a fresh cold-resume attempt after we reconnect.
|
|
295
|
-
coldResumedSessionId = null;
|
|
296
|
-
}
|
|
297
|
-
else if (status === "connected" && wasDisconnected) {
|
|
298
|
-
wasDisconnected = false;
|
|
299
|
-
const chat = useChatStore.getState();
|
|
300
|
-
const active = activeChat(chat);
|
|
301
|
-
if (chat.activeSessionId && active.messages.length > 0) {
|
|
302
|
-
resyncSessionId = chat.activeSessionId;
|
|
303
|
-
// Not mid-stream: replay right away. Mid-stream: the flag holds until
|
|
304
|
-
// the running turn finishes (result or idle status).
|
|
305
|
-
if (!active.isStreaming) {
|
|
306
|
-
resyncIfNeeded(chat.activeSessionId);
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
// Singleton client - survives React re-renders
|
|
312
|
-
let wsClient = null;
|
|
313
|
-
/**
|
|
314
|
-
* Send on the live socket from outside a component.
|
|
315
|
-
*
|
|
316
|
-
* `useWebSocket()` OWNS the socket — its construction guard is a per-instance
|
|
317
|
-
* ref, so a second caller would build a second client, overwrite this
|
|
318
|
-
* singleton, and orphan the first; unmounting either one would then close the
|
|
319
|
-
* socket for both. Anything that needs to send but not to own (the share
|
|
320
|
-
* intake) goes through here instead of calling the hook again.
|
|
321
|
-
*
|
|
322
|
-
* Returns false when there is no open socket: `send` drops silently in that
|
|
323
|
-
* case and a caller that just staged an upload needs to know.
|
|
324
|
-
*/
|
|
325
|
-
export function sendClientMessage(msg) {
|
|
326
|
-
if (!wsClient)
|
|
327
|
-
return false;
|
|
328
|
-
if (useConnectionStore.getState().wsStatus !== "connected")
|
|
329
|
-
return false;
|
|
330
|
-
wsClient.send(msg);
|
|
331
|
-
return true;
|
|
332
|
-
}
|
|
333
|
-
/** Retry the singleton socket immediately, skipping any remaining backoff. */
|
|
334
|
-
export function reconnectWebSocketNow() {
|
|
335
|
-
wsClient?.reconnectNow();
|
|
336
|
-
}
|
|
5
|
+
/** Default-app entry points for callers outside React. */
|
|
6
|
+
export function handleServerMessage(message) { defaultRoot.connection.handleServerMessage(message); }
|
|
7
|
+
export function flushChatDeltas() { defaultRoot.connection.flushChatDeltas(); }
|
|
8
|
+
export function sendClientMessage(message) { return defaultRoot.connection.send(message); }
|
|
9
|
+
export function reconnectWebSocketNow() { defaultRoot.connection.reconnectNow(); }
|
|
337
10
|
export function useWebSocket() {
|
|
338
|
-
const
|
|
339
|
-
useEffect(() =>
|
|
340
|
-
|
|
341
|
-
return;
|
|
342
|
-
initialized.current = true;
|
|
343
|
-
let disposed = false;
|
|
344
|
-
useConnectionStore.getState().noteSocketOpen();
|
|
345
|
-
wsClient = new BrainUiClient({
|
|
346
|
-
url: getWsUrl(),
|
|
347
|
-
// One handler with a shared preamble, rather than sixteen copies of the
|
|
348
|
-
// session-buffer demux — see handleServerMessage.
|
|
349
|
-
handlers: { onAny: handleServerMessage },
|
|
350
|
-
onStatusChange: handleStatusChange,
|
|
351
|
-
onClose: (close) => {
|
|
352
|
-
if (!disposed)
|
|
353
|
-
handleSocketClose(close);
|
|
354
|
-
},
|
|
355
|
-
// A frame the SDK refused. Surfaced rather than logged into a console
|
|
356
|
-
// nobody is attached to; the server-side counterpart is the
|
|
357
|
-
// ws.frames.dropped counter.
|
|
358
|
-
onProtocolError: (err) => {
|
|
359
|
-
useConnectionStore
|
|
360
|
-
.getState()
|
|
361
|
-
.reportError("PROTOCOL_ERROR", err.frameType
|
|
362
|
-
? `Dropped a ${err.frameType} frame: ${err.detail}`
|
|
363
|
-
: `Dropped an unreadable frame: ${err.detail}`);
|
|
364
|
-
},
|
|
365
|
-
});
|
|
366
|
-
wsClient.connect();
|
|
367
|
-
// Skip the exponential backoff when the network demonstrably returns.
|
|
368
|
-
const reconnectNow = () => wsClient?.reconnectNow();
|
|
369
|
-
const onVisible = () => {
|
|
370
|
-
if (document.visibilityState === "visible")
|
|
371
|
-
wsClient?.reconnectNow();
|
|
372
|
-
};
|
|
373
|
-
window.addEventListener("online", reconnectNow);
|
|
374
|
-
document.addEventListener("visibilitychange", onVisible);
|
|
375
|
-
return () => {
|
|
376
|
-
disposed = true;
|
|
377
|
-
window.removeEventListener("online", reconnectNow);
|
|
378
|
-
document.removeEventListener("visibilitychange", onVisible);
|
|
379
|
-
wsClient?.close();
|
|
380
|
-
wsClient = null;
|
|
381
|
-
initialized.current = false;
|
|
382
|
-
};
|
|
383
|
-
}, []);
|
|
384
|
-
const send = useCallback((msg) => {
|
|
385
|
-
wsClient?.send(msg);
|
|
386
|
-
}, []);
|
|
11
|
+
const root = useBrainUiRoot();
|
|
12
|
+
useEffect(() => root.connection.connect(), [root]);
|
|
13
|
+
const send = useCallback((message) => root.connection.send(message), [root]);
|
|
387
14
|
return { send };
|
|
388
15
|
}
|
|
389
16
|
//# sourceMappingURL=use-websocket.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-websocket.js","sourceRoot":"","sources":["../../src/hooks/use-websocket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"use-websocket.js","sourceRoot":"","sources":["../../src/hooks/use-websocket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,0DAA0D;AAC1D,MAAM,UAAU,mBAAmB,CAAC,OAAsB,IAAI,WAAW,CAAC,UAAU,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACpH,MAAM,UAAU,eAAe,KAAK,WAAW,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC;AAC/E,MAAM,UAAU,iBAAiB,CAAC,OAAsB,IAAI,OAAO,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC1G,MAAM,UAAU,qBAAqB,KAAK,WAAW,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;AAElF,MAAM,UAAU,YAAY;IAC1B,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;IAC9B,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC,OAAsB,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5F,OAAO,EAAE,IAAI,EAAE,CAAC;AAClB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const activityFrameHandlers: {
|
|
2
|
-
activity_snapshot: (msg: import("@schlessera/brain-ui-sdk/protocol").ServerActivitySnapshot) => void;
|
|
3
|
-
activity_delta: (msg: import("@schlessera/brain-ui-sdk/protocol").ServerActivityDelta) => void;
|
|
2
|
+
activity_snapshot: (msg: import("@schlessera/brain-ui-sdk/protocol").ServerActivitySnapshot, context: import("./types.js").DispatchContext) => void;
|
|
3
|
+
activity_delta: (msg: import("@schlessera/brain-ui-sdk/protocol").ServerActivityDelta, context: import("./types.js").DispatchContext) => void;
|
|
4
4
|
};
|
|
5
5
|
//# sourceMappingURL=activity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../../src/hooks/websocket-handlers/activity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../../src/hooks/websocket-handlers/activity.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB;;;CAOgB,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { useActivityStore } from "../../stores/activity-store.js";
|
|
2
1
|
export const activityFrameHandlers = {
|
|
3
|
-
activity_snapshot: (msg) => {
|
|
4
|
-
|
|
2
|
+
activity_snapshot: (msg, context) => {
|
|
3
|
+
context.stores.activity.getState().applySnapshot(msg);
|
|
5
4
|
},
|
|
6
|
-
activity_delta: (msg) => {
|
|
7
|
-
|
|
5
|
+
activity_delta: (msg, context) => {
|
|
6
|
+
context.stores.activity.getState().applyDelta(msg);
|
|
8
7
|
},
|
|
9
8
|
};
|
|
10
9
|
//# sourceMappingURL=activity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity.js","sourceRoot":"","sources":["../../../src/hooks/websocket-handlers/activity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"activity.js","sourceRoot":"","sources":["../../../src/hooks/websocket-handlers/activity.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,iBAAiB,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE;QAClC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACxD,CAAC;IACD,cAAc,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE;QAC/B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACrD,CAAC;CAC+C,CAAC"}
|
|
@@ -11,6 +11,7 @@ export declare const chatFrameHandlers: {
|
|
|
11
11
|
tool_result: (msg: import("@schlessera/brain-ui-sdk/protocol").ServerToolResult, context: import("./types.js").DispatchContext) => void;
|
|
12
12
|
ask_user_request: (msg: import("@schlessera/brain-ui-sdk/protocol").ServerAskUserRequest, context: import("./types.js").DispatchContext) => void;
|
|
13
13
|
result: (msg: import("@schlessera/brain-ui-sdk/protocol").ServerResultMessage, context: import("./types.js").DispatchContext) => void;
|
|
14
|
+
message_blocks: (msg: import("@schlessera/brain-ui-sdk/protocol").ServerMessageBlocks, context: import("./types.js").DispatchContext) => void;
|
|
14
15
|
session_history: (msg: import("@schlessera/brain-ui-sdk/protocol").ServerSessionHistory, context: import("./types.js").DispatchContext) => void;
|
|
15
16
|
status: (msg: import("@schlessera/brain-ui-sdk/protocol").ServerStatus, context: import("./types.js").DispatchContext) => void;
|
|
16
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../src/hooks/websocket-handlers/chat.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,aAAa,EAEd,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../src/hooks/websocket-handlers/chat.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,aAAa,EAEd,MAAM,mCAAmC,CAAC;AA6G3C,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,CAOpF;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;CAyGgB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { activeChat
|
|
1
|
+
import { activeChat } from "../../stores/chat-state.js";
|
|
2
2
|
import { isAskUserTool } from "../../lib/tool-names.js";
|
|
3
3
|
let historyMessageCounter = 0;
|
|
4
4
|
function historyId() {
|
|
@@ -33,9 +33,19 @@ function convertHistoryMessage(msg) {
|
|
|
33
33
|
timestamp: Date.now(),
|
|
34
34
|
...(askUserExchanges ? { askUserExchanges } : {}),
|
|
35
35
|
...(msg.attachmentCount ? { attachmentCount: msg.attachmentCount } : {}),
|
|
36
|
+
...(msg.blocks && msg.blocks.length > 0 ? { blocks: msg.blocks } : {}),
|
|
36
37
|
};
|
|
37
38
|
}
|
|
38
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* Rebuild ask_user exchanges from a resumed message's tool calls.
|
|
41
|
+
*
|
|
42
|
+
* The persisted tool output is `{answers, annotations}` (Claude) or the bare
|
|
43
|
+
* answers map (pi). Neither carries whether the answer was chosen from the
|
|
44
|
+
* options or typed into the composer (`AskUserExchange.typed`), nor when it
|
|
45
|
+
* was given, so a resumed exchange comes back as a plain `answered` one with
|
|
46
|
+
* no time. Carrying `typed` would mean widening the `ask_user` response —
|
|
47
|
+
* a `CONTRACT:` change — not guessing here.
|
|
48
|
+
*/
|
|
39
49
|
function isBareAnswersMap(v) {
|
|
40
50
|
return (!!v &&
|
|
41
51
|
typeof v === "object" &&
|
|
@@ -90,14 +100,18 @@ export const chatFrameHandlers = {
|
|
|
90
100
|
// Opening the bubble stays immediate — the first token should show a
|
|
91
101
|
// message starting, and every later delta needs isStreaming to be true.
|
|
92
102
|
if (!context.buffer()?.isStreaming) {
|
|
93
|
-
context.state.startAssistantMessage(context.key);
|
|
103
|
+
context.state.startAssistantMessage(context.key, context.frameTurnId);
|
|
94
104
|
}
|
|
105
|
+
if (context.frameTurnId)
|
|
106
|
+
context.state.stampTurn(context.key, context.frameTurnId);
|
|
95
107
|
context.enqueueDelta(context.key, "text", msg.text);
|
|
96
108
|
},
|
|
97
109
|
thinking_delta: (msg, context) => {
|
|
98
110
|
if (!context.buffer()?.isStreaming) {
|
|
99
|
-
context.state.startAssistantMessage(context.key);
|
|
111
|
+
context.state.startAssistantMessage(context.key, context.frameTurnId);
|
|
100
112
|
}
|
|
113
|
+
if (context.frameTurnId)
|
|
114
|
+
context.state.stampTurn(context.key, context.frameTurnId);
|
|
101
115
|
context.enqueueDelta(context.key, "thinking", msg.text);
|
|
102
116
|
},
|
|
103
117
|
tool_use_start: (msg, context) => {
|
|
@@ -137,6 +151,14 @@ export const chatFrameHandlers = {
|
|
|
137
151
|
context.state.finishAssistantMessage(context.key);
|
|
138
152
|
context.resyncIfNeeded(msg.sessionId);
|
|
139
153
|
},
|
|
154
|
+
message_blocks: (msg, context) => {
|
|
155
|
+
// Arrives after `result`, for the turn's own assistant message. An
|
|
156
|
+
// answer never waits on it: the markdown is already on screen, and this
|
|
157
|
+
// only says which spans to draw as blocks (D42). Targeted by the turn
|
|
158
|
+
// the frame belongs to: a queued follow-up may already have opened a
|
|
159
|
+
// newer assistant message by the time the pass returns.
|
|
160
|
+
context.state.setMessageBlocks(context.key, msg.blocks, context.frameTurnId);
|
|
161
|
+
},
|
|
140
162
|
session_history: (msg, context) => {
|
|
141
163
|
const converted = msg.messages.map(convertHistoryMessage);
|
|
142
164
|
if (msg.append) {
|
|
@@ -161,7 +183,7 @@ export const chatFrameHandlers = {
|
|
|
161
183
|
// THIS frame's session: a background session settling must not consume
|
|
162
184
|
// (or trigger) the active session's pending resync.
|
|
163
185
|
if (msg.status === "idle" || msg.status === "cancelled") {
|
|
164
|
-
const current =
|
|
186
|
+
const current = context.stores.chat.getState();
|
|
165
187
|
context.resyncIfNeeded(context.frameSessionId ?? current.activeSessionId);
|
|
166
188
|
// Cold load: we hold a stored session id but an empty transcript and
|
|
167
189
|
// the server is idle (so it sent no snapshot). Fetch the history.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../../src/hooks/websocket-handlers/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../../src/hooks/websocket-handlers/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAOxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAiBxD,IAAI,qBAAqB,GAAG,CAAC,CAAC;AAC9B,SAAS,SAAS;IAChB,OAAO,QAAQ,EAAE,qBAAqB,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;AACzD,CAAC;AAED,SAAS,qBAAqB,CAAC,GAA0B;IACvD,0EAA0E;IAC1E,yCAAyC;IACzC,MAAM,KAAK,GACT,GAAG,CAAC,KAAK;QACT;YACE,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,CAAC,QAAQ,EAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5E,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,EAAE,CAAU,CAAC;YACzE,GAAG,C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AC,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;YAC1E,qEAAqE;YACrE,kEAAkE;YAClE,qEAAqE;YACrE,IAAI,CAAC,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,cAAc,KAAK,OAAO,CAAC,eAAe,EAAE,CAAC;gBAClF,OAAO,CAAC,kBAAkB,CACxB,OAAO,CAAC,eAAe,EACvB,UAAU,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,MAAM,CACpC,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CAC2C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/hooks/websocket-handlers/connection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/hooks/websocket-handlers/connection.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,uBAAuB;;;;CAuBgB,CAAC"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { useActivityStore } from "../../stores/activity-store.js";
|
|
2
|
-
import { useConnectionStore } from "../../stores/connection-store.js";
|
|
3
1
|
export const connectionFrameHandlers = {
|
|
4
2
|
server_hello: (msg, context) => {
|
|
5
|
-
|
|
3
|
+
context.stores.activity.getState().setSupported(msg.capabilities?.activity === true);
|
|
6
4
|
// A new hello means a new connection: server-side subscriptions are gone.
|
|
7
|
-
|
|
5
|
+
context.stores.activity.getState().resetSubscriptions();
|
|
8
6
|
// …and view-owned subscriptions (the Activity index) must re-send too.
|
|
9
|
-
|
|
7
|
+
context.stores.activity.getState().bumpConnectionEpoch();
|
|
10
8
|
context.ensureActivitySubscription(context.state.activeSessionId);
|
|
11
9
|
},
|
|
12
10
|
location_request: (msg, context) => {
|
|
@@ -17,7 +15,7 @@ export const connectionFrameHandlers = {
|
|
|
17
15
|
// message is streaming, and this used to be the whole handler — so an
|
|
18
16
|
// error arriving between turns (a rejected frame, a failed resume) was
|
|
19
17
|
// dropped as silently on the client as it was on the server.
|
|
20
|
-
|
|
18
|
+
context.stores.connection.getState().reportError(msg.code, msg.message);
|
|
21
19
|
if (context.buffer()?.isStreaming) {
|
|
22
20
|
context.state.appendText(context.key, `\n\n**Error:** ${msg.message}`);
|
|
23
21
|
context.state.finishAssistantMessage(context.key);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/hooks/websocket-handlers/connection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/hooks/websocket-handlers/connection.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,YAAY,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE;QAC7B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,YAAY,EAAE,QAAQ,KAAK,IAAI,CAAC,CAAC;QACrF,0EAA0E;QAC1E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,kBAAkB,EAAE,CAAC;QACxD,uEAAuE;QACvE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,mBAAmB,EAAE,CAAC;QACzD,OAAO,CAAC,0BAA0B,CAAC,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IACpE,CAAC;IACD,gBAAgB,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE;QACjC,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC;IACD,KAAK,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE;QACtB,kEAAkE;QAClE,sEAAsE;QACtE,uEAAuE;QACvE,6DAA6D;QAC7D,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;QACxE,IAAI,OAAO,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,CAAC;YAClC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,kBAAkB,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;YACvE,OAAO,CAAC,KAAK,CAAC,sBAAsB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;CACiD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const maskFrameHandlers: {
|
|
2
|
-
mask_request: (msg: import("@schlessera/brain-ui-sdk/protocol").ServerMaskRequest) => void;
|
|
2
|
+
mask_request: (msg: import("@schlessera/brain-ui-sdk/protocol").ServerMaskRequest, context: import("./types.js").DispatchContext) => void;
|
|
3
3
|
};
|
|
4
4
|
//# sourceMappingURL=mask.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mask.d.ts","sourceRoot":"","sources":["../../../src/hooks/websocket-handlers/mask.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mask.d.ts","sourceRoot":"","sources":["../../../src/hooks/websocket-handlers/mask.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB;;CAWgB,CAAC"}
|