@schlessera/brain-ui-react 0.34.1 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -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 +55 -40
- 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 +15 -4
- package/dist/components/chat/tool-views.d.ts.map +1 -1
- package/dist/components/chat/tool-views.js +22 -38
- 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 +64 -6
- 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 +5 -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 +66 -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 +48 -19
- 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 +42 -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 +10 -0
- package/dist/components/settings/devices-agents-tab.d.ts.map +1 -0
- package/dist/components/settings/devices-agents-tab.js +131 -0
- package/dist/components/settings/devices-agents-tab.js.map +1 -0
- 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.d.ts +3 -0
- package/dist/components/settings/one-time-agent-credential.d.ts.map +1 -0
- package/dist/components/settings/one-time-agent-credential.js +55 -0
- package/dist/components/settings/one-time-agent-credential.js.map +1 -0
- 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 +80 -6
- 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 +1 -1
- package/dist/hooks/use-vpn-status.d.ts.map +1 -1
- package/dist/hooks/use-vpn-status.js +20 -16
- 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 -382
- 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 +321 -0
- package/dist/lib/api-client.d.ts.map +1 -1
- package/dist/lib/api-client.js +243 -213
- 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/format-time.d.ts +3 -0
- package/dist/lib/format-time.d.ts.map +1 -0
- package/dist/lib/format-time.js +25 -0
- package/dist/lib/format-time.js.map +1 -0
- 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 +10 -0
- package/dist/lib/push-registration.d.ts.map +1 -0
- package/dist/lib/push-registration.js +44 -0
- package/dist/lib/push-registration.js.map +1 -0
- 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 -300
- 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 +5 -0
- package/dist/stores/principal-store.d.ts.map +1 -0
- package/dist/stores/principal-store.js +8 -0
- package/dist/stores/principal-store.js.map +1 -0
- 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 +60 -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 +23 -73
- 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 +80 -9
- 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 +7 -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 +68 -144
- package/src/components/quick-actions/search-modal.tsx +49 -19
- package/src/components/quick-actions/streaming-modal.tsx +44 -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 +139 -0
- 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 +131 -0
- 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 +245 -19
- 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 +23 -15
- package/src/hooks/use-websocket.ts +12 -426
- 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 +446 -365
- package/src/lib/backend.ts +20 -10
- package/src/lib/diff.ts +28 -62
- package/src/lib/format-time.ts +20 -0
- 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 +46 -0
- 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 -360
- 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 +11 -0
- 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,272 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* delta stream. The server computes; this store only holds and indexes what
|
|
11
|
-
* arrived — no aggregation, no derived rollups (those come from the REST
|
|
12
|
-
* activity API).
|
|
13
|
-
*
|
|
14
|
-
* Ordering contract (AE6): a snapshot sets the per-run high-water seq; a
|
|
15
|
-
* delta at or below it is DISCARDED (its content is already in the
|
|
16
|
-
* snapshot). Applying a delta is idempotent — span deltas upsert by spanId,
|
|
17
|
-
* event deltas insert-if-absent by (spanId, eventIndex) — so a duplicate
|
|
18
|
-
* delivery can never corrupt state. The guard is symmetric: a snapshot
|
|
19
|
-
* whose per-run high-water is STRICTLY LOWER than what is held (a stale
|
|
20
|
-
* frame racing a reconnect) is skipped for that run; an equal value still
|
|
21
|
-
* applies, so chunked append frames keep working.
|
|
22
|
-
*
|
|
23
|
-
* Bounded mirror: at most MAX_TERMINAL_RUNS finished runs are held — once a
|
|
24
|
-
* run past the cap, the oldest terminal runs (by root start time) are
|
|
25
|
-
* evicted wholesale (spans, events, high-water, reverse index). Live runs
|
|
26
|
-
* are never evicted; evicted history remains fetchable over REST.
|
|
27
|
-
*/
|
|
28
|
-
export const useActivityStore = create((set, get) => ({
|
|
29
|
-
supported: false,
|
|
30
|
-
subscribed: {},
|
|
31
|
-
connectionEpoch: 0,
|
|
32
|
-
spans: {},
|
|
33
|
-
events: {},
|
|
34
|
-
highWater: {},
|
|
35
|
-
deltaSeq: {},
|
|
36
|
-
spanRun: {},
|
|
37
|
-
inbox: [],
|
|
38
|
-
loadInbox: async () => {
|
|
39
|
-
try {
|
|
40
|
-
const { intents } = await api.activityInbox();
|
|
41
|
-
set({ inbox: intents });
|
|
42
|
-
}
|
|
43
|
-
catch {
|
|
44
|
-
// Badge absence over a crash — the inbox is reachable from Activity.
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
acknowledgeIntent: async (id) => {
|
|
48
|
-
set((s) => ({ inbox: s.inbox.filter((i) => i.id !== id) }));
|
|
49
|
-
try {
|
|
50
|
-
await api.activityInboxAck(id);
|
|
51
|
-
}
|
|
52
|
-
catch {
|
|
53
|
-
// Optimistic removal stands; the next load re-syncs.
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
acknowledgeAllIntents: async () => {
|
|
57
|
-
set({ inbox: [] });
|
|
58
|
-
try {
|
|
59
|
-
await api.activityInboxAckAll();
|
|
60
|
-
}
|
|
61
|
-
catch {
|
|
62
|
-
// Same optimistic policy.
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
setSupported: (supported) => {
|
|
66
|
-
set({ supported });
|
|
67
|
-
if (supported)
|
|
68
|
-
startInboxPolling();
|
|
69
|
-
},
|
|
70
|
-
resetSubscriptions: () => set({ subscribed: {} }),
|
|
71
|
-
bumpConnectionEpoch: () => set((s) => ({ connectionEpoch: s.connectionEpoch + 1 })),
|
|
72
|
-
markSubscribed: (sessionId) => set((s) => ({ subscribed: { ...s.subscribed, [sessionId]: true } })),
|
|
73
|
-
applySnapshot: (msg) => {
|
|
74
|
-
set((s) => {
|
|
75
|
-
const maps = {
|
|
76
|
-
spans: { ...s.spans },
|
|
77
|
-
events: { ...s.events },
|
|
78
|
-
highWater: { ...s.highWater },
|
|
79
|
-
deltaSeq: { ...s.deltaSeq },
|
|
80
|
-
spanRun: { ...s.spanRun },
|
|
81
|
-
};
|
|
82
|
-
// Staleness guard: a run whose incoming high-water is strictly below
|
|
83
|
-
// what is held (snapshot floor or an applied delta) carries older
|
|
84
|
-
// state than what already applied — skip its spans/events. Equal
|
|
85
|
-
// still applies (chunked append frames).
|
|
86
|
-
const stale = new Set();
|
|
87
|
-
for (const [runId, seq] of Object.entries(msg.highWaterSeq)) {
|
|
88
|
-
const held = Math.max(maps.highWater[runId] ?? 0, maps.deltaSeq[runId] ?? 0);
|
|
89
|
-
if (seq < held)
|
|
90
|
-
stale.add(runId);
|
|
91
|
-
else
|
|
92
|
-
maps.highWater[runId] = seq;
|
|
93
|
-
}
|
|
94
|
-
for (const span of msg.spans) {
|
|
95
|
-
if (stale.has(span.runId))
|
|
96
|
-
continue;
|
|
97
|
-
maps.spans[span.runId] = { ...(maps.spans[span.runId] ?? {}), [span.spanId]: span };
|
|
98
|
-
maps.spanRun[span.spanId] = span.runId;
|
|
99
|
-
}
|
|
100
|
-
for (const event of msg.events) {
|
|
101
|
-
const runId = maps.spanRun[event.spanId];
|
|
102
|
-
if (runId !== undefined && stale.has(runId))
|
|
103
|
-
continue;
|
|
104
|
-
maps.events[event.spanId] = insertEvent(maps.events[event.spanId], event);
|
|
105
|
-
}
|
|
106
|
-
// Scope eviction: a fresh session/index snapshot is authoritative for
|
|
107
|
-
// its scope. A held run that still looks live but is absent from the
|
|
108
|
-
// frame's high-water map is a ghost — the server says it is not
|
|
109
|
-
// running any more (its REST history remains fetchable).
|
|
110
|
-
if (!msg.append && (msg.view === "session" || msg.view === "index")) {
|
|
111
|
-
for (const [runId, byId] of Object.entries(maps.spans)) {
|
|
112
|
-
if (runId in msg.highWaterSeq)
|
|
113
|
-
continue;
|
|
114
|
-
const root = rootSpanOf(byId);
|
|
115
|
-
if (!root || root.outcome !== undefined)
|
|
116
|
-
continue;
|
|
117
|
-
const inScope = msg.view === "index" || root.sessionId === msg.sessionId;
|
|
118
|
-
if (inScope)
|
|
119
|
-
evictRun(maps, runId);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
pruneTerminalRuns(maps);
|
|
123
|
-
return maps;
|
|
124
|
-
});
|
|
125
|
-
},
|
|
126
|
-
applyDelta: (msg) => {
|
|
127
|
-
const s = get();
|
|
128
|
-
if (msg.seq <= (s.highWater[msg.runId] ?? 0))
|
|
129
|
-
return;
|
|
130
|
-
if (msg.span) {
|
|
131
|
-
const span = msg.span;
|
|
132
|
-
set((prev) => ({
|
|
133
|
-
spans: {
|
|
134
|
-
...prev.spans,
|
|
135
|
-
[msg.runId]: { ...(prev.spans[msg.runId] ?? {}), [span.spanId]: span },
|
|
136
|
-
},
|
|
137
|
-
// Recording the applied seq keeps the snapshot staleness guard
|
|
138
|
-
// honest: a snapshot frame older than this delta must not roll it back.
|
|
139
|
-
deltaSeq: {
|
|
140
|
-
...prev.deltaSeq,
|
|
141
|
-
[msg.runId]: Math.max(prev.deltaSeq[msg.runId] ?? 0, msg.seq),
|
|
142
|
-
},
|
|
143
|
-
// The mapping is almost always already present — re-spreading it on
|
|
144
|
-
// every delta would churn a large object for nothing.
|
|
145
|
-
...(prev.spanRun[span.spanId] === msg.runId
|
|
146
|
-
? {}
|
|
147
|
-
: { spanRun: { ...prev.spanRun, [span.spanId]: msg.runId } }),
|
|
148
|
-
}));
|
|
149
|
-
// A root span closing may push the mirror past the terminal-run cap.
|
|
150
|
-
if (span.parentSpanId === undefined && span.outcome !== undefined) {
|
|
151
|
-
const prev = get();
|
|
152
|
-
const maps = {
|
|
153
|
-
spans: { ...prev.spans },
|
|
154
|
-
events: { ...prev.events },
|
|
155
|
-
highWater: { ...prev.highWater },
|
|
156
|
-
deltaSeq: { ...prev.deltaSeq },
|
|
157
|
-
spanRun: { ...prev.spanRun },
|
|
158
|
-
};
|
|
159
|
-
if (pruneTerminalRuns(maps))
|
|
160
|
-
set(maps);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
else if (msg.event) {
|
|
164
|
-
const event = msg.event;
|
|
165
|
-
set((prev) => ({
|
|
166
|
-
events: { ...prev.events, [event.spanId]: insertEvent(prev.events[event.spanId], event) },
|
|
167
|
-
deltaSeq: {
|
|
168
|
-
...prev.deltaSeq,
|
|
169
|
-
[msg.runId]: Math.max(prev.deltaSeq[msg.runId] ?? 0, msg.seq),
|
|
170
|
-
},
|
|
171
|
-
...(prev.spanRun[event.spanId] !== undefined
|
|
172
|
-
? {}
|
|
173
|
-
: { spanRun: { ...prev.spanRun, [event.spanId]: msg.runId } }),
|
|
174
|
-
}));
|
|
175
|
-
}
|
|
176
|
-
},
|
|
177
|
-
clear: () => set({ spans: {}, events: {}, highWater: {}, deltaSeq: {}, spanRun: {} }),
|
|
178
|
-
}));
|
|
179
|
-
/** One badge poller per page lifetime — the inbox is cheap and the badge
|
|
180
|
-
* must be honest even when the Activity surface never opens. */
|
|
181
|
-
let inboxPoller = null;
|
|
182
|
-
function startInboxPolling() {
|
|
183
|
-
if (inboxPoller)
|
|
184
|
-
return;
|
|
185
|
-
void useActivityStore.getState().loadInbox();
|
|
186
|
-
inboxPoller = setInterval(() => {
|
|
187
|
-
void useActivityStore.getState().loadInbox();
|
|
188
|
-
}, 60_000);
|
|
189
|
-
}
|
|
190
|
-
/** Runs whose history has been fetched already (per page lifetime). */
|
|
191
|
-
const loadedHistorySessions = new Set();
|
|
192
|
-
/**
|
|
193
|
-
* Pull a session's recent FINISHED runs from the REST activity API into the
|
|
194
|
-
* store. The live subscription's snapshot carries open runs only; this is
|
|
195
|
-
* what makes duration badges on history-loaded messages real (AE2) — span
|
|
196
|
-
* ids are tool-use ids, so the timeline's timing lookup starts hitting.
|
|
197
|
-
* Fire-and-forget; a failure just leaves badges absent, as before.
|
|
198
|
-
*/
|
|
199
|
-
export async function loadSessionActivityHistory(sessionId) {
|
|
200
|
-
if (loadedHistorySessions.has(sessionId))
|
|
201
|
-
return;
|
|
202
|
-
loadedHistorySessions.add(sessionId);
|
|
203
|
-
try {
|
|
204
|
-
const { history } = await api.activityRuns({ session: sessionId, limit: HISTORY_RUN_LIMIT });
|
|
205
|
-
const store = useActivityStore.getState();
|
|
206
|
-
const details = await Promise.all(history
|
|
207
|
-
.slice(0, HISTORY_RUN_LIMIT)
|
|
208
|
-
.filter((run) => !run.detailPruned)
|
|
209
|
-
.map((run) => api.activityRun(run.runId)));
|
|
210
|
-
for (const detail of details) {
|
|
211
|
-
if (detail.detailPruned || !detail.spans)
|
|
212
|
-
continue;
|
|
213
|
-
store.applySnapshot({
|
|
214
|
-
type: "activity_snapshot",
|
|
215
|
-
view: "run",
|
|
216
|
-
runId: detail.runId,
|
|
217
|
-
spans: detail.spans,
|
|
218
|
-
events: detail.events ?? [],
|
|
219
|
-
highWaterSeq: { [detail.runId]: detail.highWaterSeq ?? 0 },
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
catch {
|
|
224
|
-
// History timing is an enhancement; the transcript renders without it.
|
|
225
|
-
loadedHistorySessions.delete(sessionId);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
/** Runs whose payload events have been backfilled over REST (per page lifetime). */
|
|
229
|
-
const payloadLoadedRuns = new Set();
|
|
230
|
-
/**
|
|
231
|
-
* Backfill one finished run's tool payload events into the mirror. The
|
|
232
|
-
* history fetch above and the run-list default deliberately skip payload
|
|
233
|
-
* bodies — they exist for duration badges, not drill-ins — so the first
|
|
234
|
-
* expanded payload view of a history span pulls the full detail
|
|
235
|
-
* (`include=payloads`) and merges it. Live runs never need this: their
|
|
236
|
-
* payload events ride the delta stream. The merge is safe because a snapshot
|
|
237
|
-
* at the same high-water still applies and events insert-if-absent.
|
|
238
|
-
*/
|
|
239
|
-
export async function loadSpanPayloads(spanId) {
|
|
240
|
-
const state = useActivityStore.getState();
|
|
241
|
-
const runId = state.spanRun[spanId];
|
|
242
|
-
if (!runId || payloadLoadedRuns.has(runId))
|
|
243
|
-
return;
|
|
244
|
-
const root = rootSpanOf(state.spans[runId] ?? {});
|
|
245
|
-
if (!root || root.outcome === undefined)
|
|
246
|
-
return;
|
|
247
|
-
payloadLoadedRuns.add(runId);
|
|
248
|
-
try {
|
|
249
|
-
const detail = await api.activityRun(runId, { includePayloads: true });
|
|
250
|
-
if (detail.detailPruned || !detail.spans)
|
|
251
|
-
return;
|
|
252
|
-
useActivityStore.getState().applySnapshot({
|
|
253
|
-
type: "activity_snapshot",
|
|
254
|
-
view: "run",
|
|
255
|
-
runId,
|
|
256
|
-
spans: detail.spans,
|
|
257
|
-
events: detail.events ?? [],
|
|
258
|
-
highWaterSeq: { [runId]: detail.highWaterSeq ?? 0 },
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
catch {
|
|
262
|
-
// Payloads are an enhancement; the row keeps its no-payload notice.
|
|
263
|
-
payloadLoadedRuns.delete(runId);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
registerDevHandle(() => {
|
|
267
|
-
if (typeof window === "undefined")
|
|
268
|
-
return;
|
|
269
|
-
window.__activityStore =
|
|
270
|
-
useActivityStore;
|
|
271
|
-
});
|
|
1
|
+
import { useRootStore } from "../root-context.js";
|
|
2
|
+
import { defaultRoot } from "../default-root.js";
|
|
3
|
+
export * from "./activity-state.js";
|
|
4
|
+
/** Hook reads the current provider. Statics address the default app only. */
|
|
5
|
+
export const useActivityStore = Object.assign(function useActivityStore(selector) {
|
|
6
|
+
return useRootStore("activity", selector);
|
|
7
|
+
}, defaultRoot.stores.activity);
|
|
8
|
+
export const loadSessionActivityHistory = defaultRoot.stores.activity.loadSessionActivityHistory;
|
|
9
|
+
export const loadSpanPayloads = defaultRoot.stores.activity.loadSpanPayloads;
|
|
272
10
|
//# sourceMappingURL=activity-store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-store.js","sourceRoot":"","sources":["../../src/stores/activity-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"activity-store.js","sourceRoot":"","sources":["../../src/stores/activity-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,cAAc,qBAAqB,CAAC;AAEpC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAC3C,SAAS,gBAAgB,CAAI,QAA+E;IAC1G,OAAO,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAC5C,CAAC,EACD,WAAW,CAAC,MAAM,CAAC,QAAQ,CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,0BAA0B,CAAC;AACjG,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import type { MessageBlock, MessageSource, MessagePart, AskUserQuestion, AskUserAnnotation } from "@schlessera/brain-ui-sdk/protocol";
|
|
2
|
+
import type { StoreApi } from "zustand/vanilla";
|
|
3
|
+
import type { ProviderState } from "./provider-state.js";
|
|
4
|
+
import type { StoreEnvironment } from "./store-environment.js";
|
|
5
|
+
export type { MessagePart };
|
|
6
|
+
export interface ChatMessage {
|
|
7
|
+
id: string;
|
|
8
|
+
role: "user" | "assistant";
|
|
9
|
+
content: string;
|
|
10
|
+
thinking?: string;
|
|
11
|
+
toolCalls: ToolCall[];
|
|
12
|
+
/**
|
|
13
|
+
* Chronological thinking/text/tool segments, in arrival order. `content`,
|
|
14
|
+
* `thinking` and `toolCalls` remain the aggregated views (used for sharing
|
|
15
|
+
* and tool state); `parts` drives rendering order.
|
|
16
|
+
*/
|
|
17
|
+
parts: MessagePart[];
|
|
18
|
+
isStreaming: boolean;
|
|
19
|
+
timestamp: number;
|
|
20
|
+
source?: MessageSource;
|
|
21
|
+
/** AskUserQuestion exchanges raised during this assistant turn. */
|
|
22
|
+
askUserExchanges?: AskUserExchange[];
|
|
23
|
+
/**
|
|
24
|
+
* Image attachments on a user message. Live messages carry a local
|
|
25
|
+
* `previewUrl` (object URL, revoked on clear). History-loaded messages
|
|
26
|
+
* carry no data — only `attachmentCount` — since base64 is never replayed.
|
|
27
|
+
*/
|
|
28
|
+
attachments?: MessageAttachment[];
|
|
29
|
+
/** Attachment count for history-loaded messages without preview data. */
|
|
30
|
+
attachmentCount?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Blocks the surface classified out of this message's text (D42), each
|
|
33
|
+
* anchored to a text part and a span in it. Arrive after the turn's
|
|
34
|
+
* result, or with the replayed history; absent means plain markdown.
|
|
35
|
+
*/
|
|
36
|
+
blocks?: MessageBlock[];
|
|
37
|
+
/** The host-minted turn that produced this assistant message, when known. */
|
|
38
|
+
turnId?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface MessageAttachment {
|
|
41
|
+
previewUrl: string;
|
|
42
|
+
mediaType: string;
|
|
43
|
+
}
|
|
44
|
+
export interface ToolCall {
|
|
45
|
+
id: string;
|
|
46
|
+
name: string;
|
|
47
|
+
input: Record<string, unknown>;
|
|
48
|
+
inputJson: string;
|
|
49
|
+
output?: string;
|
|
50
|
+
isError?: boolean;
|
|
51
|
+
status: "streaming" | "pending_approval" | "approved" | "denied" | "complete";
|
|
52
|
+
/**
|
|
53
|
+
* What the pending approval is for: "tool" may be remembered via "Always
|
|
54
|
+
* allow"; "command" (a destructive-bash confirmation) is per-use only.
|
|
55
|
+
*/
|
|
56
|
+
approvalKind?: "tool" | "command";
|
|
57
|
+
/**
|
|
58
|
+
* Execution timing for the duration badge. `startedAt` is (re)stamped when
|
|
59
|
+
* the input finishes streaming or an approval is granted — so approval
|
|
60
|
+
* wait time doesn't inflate the reported duration. `endedAt` is stamped by
|
|
61
|
+
* the tool result. History-loaded messages carry no timing.
|
|
62
|
+
*/
|
|
63
|
+
startedAt?: number;
|
|
64
|
+
endedAt?: number;
|
|
65
|
+
}
|
|
66
|
+
export interface AskUserExchange {
|
|
67
|
+
requestId: string;
|
|
68
|
+
questions: AskUserQuestion[];
|
|
69
|
+
/** Filled in once the user submits. Keyed by question text. */
|
|
70
|
+
answers?: Record<string, string>;
|
|
71
|
+
annotations?: Record<string, AskUserAnnotation>;
|
|
72
|
+
cancelled?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* The user answered in the composer instead of choosing an option, and the
|
|
75
|
+
* composer text was bound to the question (D38 §1: the card then quotes what
|
|
76
|
+
* it took, with a neutral border). Live-only: the `ask_user` tool output the
|
|
77
|
+
* server persists is `{answers, annotations}` and carries no such flag, so a
|
|
78
|
+
* resumed transcript rebuilds a typed exchange as a plain `answered` one.
|
|
79
|
+
*/
|
|
80
|
+
typed?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* When the answer was submitted, from this client's clock. Absent on
|
|
83
|
+
* history-loaded exchanges — the persisted tool output carries no time, and
|
|
84
|
+
* the card shows none rather than one it made up.
|
|
85
|
+
*/
|
|
86
|
+
answeredAt?: number;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* One session's live transcript state. Every session the user has viewed (or
|
|
90
|
+
* that bound from the draft) keeps its own buffer, so frames from a background
|
|
91
|
+
* session accumulate in THAT session's transcript instead of being discarded —
|
|
92
|
+
* the multi-session contract the old single-active-buffer store violated.
|
|
93
|
+
*/
|
|
94
|
+
export interface SessionChat {
|
|
95
|
+
messages: ChatMessage[];
|
|
96
|
+
isStreaming: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* The currently-pending ask-user exchange in this session (no answers yet).
|
|
99
|
+
* Mirrors the same exchange that lives on the streaming assistant message;
|
|
100
|
+
* held here for fast lookup by hooks/components.
|
|
101
|
+
*/
|
|
102
|
+
askUser: AskUserExchange | null;
|
|
103
|
+
/** LRU stamp for buffer eviction. */
|
|
104
|
+
lastTouched: number;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Buffer key: a server sessionId, or null for the DRAFT buffer — the new
|
|
108
|
+
* conversation that has no server identity yet. `session_info` re-keys the
|
|
109
|
+
* draft onto its real sessionId via bindDraftSession().
|
|
110
|
+
*/
|
|
111
|
+
export type ChatKey = string | null;
|
|
112
|
+
export interface ChatState {
|
|
113
|
+
/** Per-session transcript buffers, keyed by server sessionId. */
|
|
114
|
+
buffers: Record<string, SessionChat>;
|
|
115
|
+
/** The unbound new-conversation buffer, if one is in progress. */
|
|
116
|
+
draft: SessionChat | null;
|
|
117
|
+
/**
|
|
118
|
+
* Correlation id for the conversation the draft is currently starting.
|
|
119
|
+
*
|
|
120
|
+
* A client starting a conversation has no session id, so it used to adopt
|
|
121
|
+
* the FIRST `session_info` for an unknown session — which could be an older
|
|
122
|
+
* background turn's, or another client's, silently binding the user's draft
|
|
123
|
+
* to someone else's transcript. The id is sent on `chat_message` and echoed
|
|
124
|
+
* on `session_info`; adoption now requires a match. Null when no draft turn
|
|
125
|
+
* is in flight.
|
|
126
|
+
*/
|
|
127
|
+
pendingDraftId: string | null;
|
|
128
|
+
/** The session in view; null = the draft / new-chat view. */
|
|
129
|
+
activeSessionId: string | null;
|
|
130
|
+
/**
|
|
131
|
+
* Live run-state per session id, for the session-list badges. Maintained for
|
|
132
|
+
* every session frame regardless of whether a buffer exists. "idle" is the
|
|
133
|
+
* absence of a running/queued turn.
|
|
134
|
+
*/
|
|
135
|
+
runStates: Record<string, "streaming" | "queued" | "idle">;
|
|
136
|
+
/**
|
|
137
|
+
* Backend that owns each session, from `session_info` (or the session list
|
|
138
|
+
* for history sessions). Scopes tool-call renderer resolution per backend;
|
|
139
|
+
* absence falls back to the deployment default.
|
|
140
|
+
*/
|
|
141
|
+
backendIds: Record<string, string>;
|
|
142
|
+
/**
|
|
143
|
+
* Per-session note attached to a `queued` status — the host sends one once a
|
|
144
|
+
* session's follow-up queue grows heavy. Cleared when the session leaves the
|
|
145
|
+
* queued state, so a stale warning cannot outlive the queue it described.
|
|
146
|
+
*/
|
|
147
|
+
queueNotes: Record<string, string>;
|
|
148
|
+
addUserMessage: (key: ChatKey, text: string, source?: MessageSource, attachments?: MessageAttachment[]) => void;
|
|
149
|
+
startAssistantMessage: (key: ChatKey, turnId?: string) => void;
|
|
150
|
+
appendText: (key: ChatKey, text: string) => void;
|
|
151
|
+
appendThinking: (key: ChatKey, text: string) => void;
|
|
152
|
+
startToolCall: (key: ChatKey, toolUseId: string, toolName: string) => void;
|
|
153
|
+
appendToolInput: (key: ChatKey, partialJson: string) => void;
|
|
154
|
+
completeToolCall: (key: ChatKey, toolUseId: string, toolName: string, input: Record<string, unknown>) => void;
|
|
155
|
+
requestToolApproval: (key: ChatKey, toolUseId: string, toolName: string, input: Record<string, unknown>, description?: string, kind?: "tool" | "command") => void;
|
|
156
|
+
resolveToolApproval: (key: ChatKey, toolUseId: string, approved: boolean) => void;
|
|
157
|
+
setToolResult: (key: ChatKey, toolUseId: string, output: string, isError: boolean) => void;
|
|
158
|
+
setAskUserRequest: (key: ChatKey, requestId: string, questions: AskUserQuestion[]) => void;
|
|
159
|
+
submitAskUserAnswers: (key: ChatKey, requestId: string, answers: Record<string, string>, annotations?: Record<string, AskUserAnnotation>,
|
|
160
|
+
/** `true` when the answer was taken from the composer, not an option. */
|
|
161
|
+
typed?: boolean) => void;
|
|
162
|
+
cancelAskUser: (key: ChatKey, requestId: string) => void;
|
|
163
|
+
clearAskUser: (key: ChatKey) => void;
|
|
164
|
+
finishAssistantMessage: (key: ChatKey) => void;
|
|
165
|
+
/**
|
|
166
|
+
* Attach classified blocks (D42) to the assistant message of `turnId`, or,
|
|
167
|
+
* when the turn is unknown, to the last assistant message only if it has
|
|
168
|
+
* finished — never to a newer message still streaming.
|
|
169
|
+
*/
|
|
170
|
+
setMessageBlocks: (key: ChatKey, blocks: MessageBlock[], turnId?: string) => void;
|
|
171
|
+
/**
|
|
172
|
+
* Record the host-minted turn on the streaming assistant message, from
|
|
173
|
+
* the first scoped frame. The composer opens the message optimistically
|
|
174
|
+
* before any turn exists, so the id arrives with the deltas.
|
|
175
|
+
*/
|
|
176
|
+
stampTurn: (key: ChatKey, turnId: string) => void;
|
|
177
|
+
setStreaming: (key: ChatKey, streaming: boolean) => void;
|
|
178
|
+
/** Replace a session's transcript (first replayed history chunk). Creates the buffer. */
|
|
179
|
+
setMessages: (key: ChatKey, messages: ChatMessage[]) => void;
|
|
180
|
+
/** Concatenate a continuation chunk of replayed history. Creates the buffer. */
|
|
181
|
+
appendMessages: (key: ChatKey, messages: ChatMessage[]) => void;
|
|
182
|
+
/**
|
|
183
|
+
* Adopt the draft buffer as `sessionId` (the server just named the session).
|
|
184
|
+
* If the draft view is active, the view follows. No-op draft = empty buffer.
|
|
185
|
+
*/
|
|
186
|
+
bindDraftSession: (sessionId: string) => void;
|
|
187
|
+
/** Mint and remember the correlation id for a draft turn about to be sent. */
|
|
188
|
+
startDraftTurn: () => string;
|
|
189
|
+
/** Switch the view to a session (creating an empty buffer if none), or to the draft (null). */
|
|
190
|
+
setActiveSession: (sessionId: string | null) => void;
|
|
191
|
+
/** New chat: drop the draft, unbind the view, unpin the provider. */
|
|
192
|
+
clearMessages: () => void;
|
|
193
|
+
setRunState: (sessionId: string, state: "streaming" | "queued" | "idle", note?: string) => void;
|
|
194
|
+
/** Record which backend owns a session (idempotent). */
|
|
195
|
+
setSessionBackend: (sessionId: string, backendId: string) => void;
|
|
196
|
+
}
|
|
197
|
+
/** The buffer currently in view (draft when no session is bound). */
|
|
198
|
+
export declare function activeChat(state: ChatState): SessionChat;
|
|
199
|
+
/** True when ANY buffer is streaming (service-worker busy check, etc.). */
|
|
200
|
+
export declare function anyStreaming(state: ChatState): boolean;
|
|
201
|
+
/**
|
|
202
|
+
* Every tool call waiting on the user, across every buffer (D37: an approval
|
|
203
|
+
* that arrived while you were reading something else cannot only exist as a
|
|
204
|
+
* scroll position — the Actions pane lists it beside the inbox). The key is
|
|
205
|
+
* the buffer's, so the decision can be resolved on the right transcript.
|
|
206
|
+
*/
|
|
207
|
+
export declare function pendingApprovals(state: Pick<ChatState, "buffers" | "draft">): Array<{
|
|
208
|
+
key: ChatKey;
|
|
209
|
+
tool: ToolCall;
|
|
210
|
+
}>;
|
|
211
|
+
export declare function createChatStore(env: StoreEnvironment, provider: StoreApi<ProviderState>): StoreApi<ChatState>;
|
|
212
|
+
//# sourceMappingURL=chat-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-state.d.ts","sourceRoot":"","sources":["../../src/stores/chat-state.ts"],"names":[],"mappings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