@schlessera/brain-ui-react 0.35.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -4
- package/dist/components/activity/activity-page.d.ts +17 -5
- package/dist/components/activity/activity-page.d.ts.map +1 -1
- package/dist/components/activity/activity-page.js +148 -50
- package/dist/components/activity/activity-page.js.map +1 -1
- package/dist/components/activity/activity-run-detail.d.ts +16 -1
- package/dist/components/activity/activity-run-detail.d.ts.map +1 -1
- package/dist/components/activity/activity-run-detail.js +47 -4
- package/dist/components/activity/activity-run-detail.js.map +1 -1
- package/dist/components/activity/activity-run-list.d.ts +7 -1
- package/dist/components/activity/activity-run-list.d.ts.map +1 -1
- package/dist/components/activity/activity-run-list.js +16 -8
- package/dist/components/activity/activity-run-list.js.map +1 -1
- package/dist/components/activity/activity-views.d.ts +63 -0
- package/dist/components/activity/activity-views.d.ts.map +1 -0
- package/dist/components/activity/activity-views.js +52 -0
- package/dist/components/activity/activity-views.js.map +1 -0
- package/dist/components/activity/approval-card.d.ts +29 -0
- package/dist/components/activity/approval-card.d.ts.map +1 -0
- package/dist/components/activity/approval-card.js +73 -0
- package/dist/components/activity/approval-card.js.map +1 -0
- package/dist/components/activity/digest-card.d.ts +3 -0
- package/dist/components/activity/digest-card.d.ts.map +1 -1
- package/dist/components/activity/digest-card.js +20 -16
- package/dist/components/activity/digest-card.js.map +1 -1
- package/dist/components/activity/digest-summary.d.ts +19 -0
- package/dist/components/activity/digest-summary.d.ts.map +1 -0
- package/dist/components/activity/digest-summary.js +20 -0
- package/dist/components/activity/digest-summary.js.map +1 -0
- package/dist/components/activity/push-switch.d.ts +25 -0
- package/dist/components/activity/push-switch.d.ts.map +1 -0
- package/dist/components/activity/push-switch.js +14 -0
- package/dist/components/activity/push-switch.js.map +1 -0
- package/dist/components/activity/push-toggle.d.ts +7 -0
- package/dist/components/activity/push-toggle.d.ts.map +1 -1
- package/dist/components/activity/push-toggle.js +72 -47
- package/dist/components/activity/push-toggle.js.map +1 -1
- package/dist/components/activity/span-bits.d.ts +11 -0
- package/dist/components/activity/span-bits.d.ts.map +1 -1
- package/dist/components/activity/span-bits.js +50 -7
- package/dist/components/activity/span-bits.js.map +1 -1
- package/dist/components/chat/ask-user-card.d.ts +76 -3
- package/dist/components/chat/ask-user-card.d.ts.map +1 -1
- package/dist/components/chat/ask-user-card.js +208 -149
- package/dist/components/chat/ask-user-card.js.map +1 -1
- package/dist/components/chat/ask-user-typed.d.ts +42 -0
- package/dist/components/chat/ask-user-typed.d.ts.map +1 -0
- package/dist/components/chat/ask-user-typed.js +60 -0
- package/dist/components/chat/ask-user-typed.js.map +1 -0
- package/dist/components/chat/brain-markdown-links.d.ts +2 -1
- package/dist/components/chat/brain-markdown-links.d.ts.map +1 -1
- package/dist/components/chat/brain-markdown-links.js +3 -4
- package/dist/components/chat/brain-markdown-links.js.map +1 -1
- package/dist/components/chat/brain-markdown.d.ts.map +1 -1
- package/dist/components/chat/brain-markdown.js +4 -2
- package/dist/components/chat/brain-markdown.js.map +1 -1
- package/dist/components/chat/chat-page.d.ts.map +1 -1
- package/dist/components/chat/chat-page.js +27 -11
- package/dist/components/chat/chat-page.js.map +1 -1
- package/dist/components/chat/composer-view.d.ts +75 -0
- package/dist/components/chat/composer-view.d.ts.map +1 -0
- package/dist/components/chat/composer-view.js +31 -0
- package/dist/components/chat/composer-view.js.map +1 -0
- package/dist/components/chat/composer.d.ts +4 -0
- package/dist/components/chat/composer.d.ts.map +1 -1
- package/dist/components/chat/composer.js +76 -59
- package/dist/components/chat/composer.js.map +1 -1
- package/dist/components/chat/markdown-content.d.ts +16 -1
- package/dist/components/chat/markdown-content.d.ts.map +1 -1
- package/dist/components/chat/markdown-content.js +47 -3
- package/dist/components/chat/markdown-content.js.map +1 -1
- package/dist/components/chat/mermaid-block.d.ts +4 -0
- package/dist/components/chat/mermaid-block.d.ts.map +1 -1
- package/dist/components/chat/mermaid-block.js +13 -5
- package/dist/components/chat/mermaid-block.js.map +1 -1
- package/dist/components/chat/mermaid-share.d.ts +2 -1
- package/dist/components/chat/mermaid-share.d.ts.map +1 -1
- package/dist/components/chat/mermaid-share.js +7 -8
- package/dist/components/chat/mermaid-share.js.map +1 -1
- package/dist/components/chat/mermaid-viewer.d.ts.map +1 -1
- package/dist/components/chat/mermaid-viewer.js +3 -1
- package/dist/components/chat/mermaid-viewer.js.map +1 -1
- package/dist/components/chat/message-bubble.d.ts +8 -1
- package/dist/components/chat/message-bubble.d.ts.map +1 -1
- package/dist/components/chat/message-bubble.js +53 -24
- package/dist/components/chat/message-bubble.js.map +1 -1
- package/dist/components/chat/message-share.d.ts +2 -1
- package/dist/components/chat/message-share.d.ts.map +1 -1
- package/dist/components/chat/message-share.js +6 -7
- package/dist/components/chat/message-share.js.map +1 -1
- package/dist/components/chat/renderers/bind.d.ts +39 -0
- package/dist/components/chat/renderers/bind.d.ts.map +1 -0
- package/dist/components/chat/renderers/bind.js +43 -0
- package/dist/components/chat/renderers/bind.js.map +1 -0
- package/dist/components/chat/renderers/brain-ui-tools.d.ts +3 -0
- package/dist/components/chat/renderers/brain-ui-tools.d.ts.map +1 -0
- package/dist/components/chat/renderers/brain-ui-tools.js +41 -0
- package/dist/components/chat/renderers/brain-ui-tools.js.map +1 -0
- package/dist/components/chat/renderers/claude-tools.d.ts.map +1 -1
- package/dist/components/chat/renderers/claude-tools.js +3 -2
- package/dist/components/chat/renderers/claude-tools.js.map +1 -1
- package/dist/components/chat/renderers/index.d.ts +10 -2
- package/dist/components/chat/renderers/index.d.ts.map +1 -1
- package/dist/components/chat/renderers/index.js +15 -10
- package/dist/components/chat/renderers/index.js.map +1 -1
- package/dist/components/chat/session-drawer.d.ts +4 -0
- package/dist/components/chat/session-drawer.d.ts.map +1 -1
- package/dist/components/chat/session-drawer.js +32 -32
- package/dist/components/chat/session-drawer.js.map +1 -1
- package/dist/components/chat/session-list.d.ts +41 -0
- package/dist/components/chat/session-list.d.ts.map +1 -0
- package/dist/components/chat/session-list.js +10 -0
- package/dist/components/chat/session-list.js.map +1 -0
- package/dist/components/chat/share-block.d.ts.map +1 -1
- package/dist/components/chat/share-block.js +12 -11
- package/dist/components/chat/share-block.js.map +1 -1
- package/dist/components/chat/share-card.js +2 -2
- package/dist/components/chat/share-card.js.map +1 -1
- package/dist/components/chat/subagent-view.js +1 -1
- package/dist/components/chat/subagent-view.js.map +1 -1
- package/dist/components/chat/tool-call-timeline.d.ts.map +1 -1
- package/dist/components/chat/tool-call-timeline.js +45 -14
- package/dist/components/chat/tool-call-timeline.js.map +1 -1
- package/dist/components/chat/tool-cards/block-card.d.ts +28 -0
- package/dist/components/chat/tool-cards/block-card.d.ts.map +1 -0
- package/dist/components/chat/tool-cards/block-card.js +103 -0
- package/dist/components/chat/tool-cards/block-card.js.map +1 -0
- package/dist/components/chat/tool-cards/image-mask-card.d.ts +70 -0
- package/dist/components/chat/tool-cards/image-mask-card.d.ts.map +1 -0
- package/dist/components/chat/tool-cards/image-mask-card.js +142 -0
- package/dist/components/chat/tool-cards/image-mask-card.js.map +1 -0
- package/dist/components/chat/tool-cards/location-card.d.ts +45 -0
- package/dist/components/chat/tool-cards/location-card.d.ts.map +1 -0
- package/dist/components/chat/tool-cards/location-card.js +128 -0
- package/dist/components/chat/tool-cards/location-card.js.map +1 -0
- package/dist/components/chat/tool-views.d.ts +19 -2
- package/dist/components/chat/tool-views.d.ts.map +1 -1
- package/dist/components/chat/tool-views.js +28 -22
- package/dist/components/chat/tool-views.js.map +1 -1
- package/dist/components/chat/transcript-turn.d.ts +45 -0
- package/dist/components/chat/transcript-turn.d.ts.map +1 -0
- package/dist/components/chat/transcript-turn.js +25 -0
- package/dist/components/chat/transcript-turn.js.map +1 -0
- package/dist/components/chat/use-chat-commands.d.ts.map +1 -1
- package/dist/components/chat/use-chat-commands.js +13 -16
- package/dist/components/chat/use-chat-commands.js.map +1 -1
- package/dist/components/chat/welcome-state.d.ts +7 -0
- package/dist/components/chat/welcome-state.d.ts.map +1 -1
- package/dist/components/chat/welcome-state.js +13 -5
- package/dist/components/chat/welcome-state.js.map +1 -1
- package/dist/components/connectivity/connection-gate.d.ts.map +1 -1
- package/dist/components/connectivity/connection-gate.js +27 -21
- package/dist/components/connectivity/connection-gate.js.map +1 -1
- package/dist/components/connectivity/login-form.d.ts +31 -0
- package/dist/components/connectivity/login-form.d.ts.map +1 -0
- package/dist/components/connectivity/login-form.js +19 -0
- package/dist/components/connectivity/login-form.js.map +1 -0
- package/dist/components/connectivity/login-screen.d.ts +5 -2
- package/dist/components/connectivity/login-screen.d.ts.map +1 -1
- package/dist/components/connectivity/login-screen.js +41 -31
- package/dist/components/connectivity/login-screen.js.map +1 -1
- package/dist/components/dev/share-harness.js +1 -1
- package/dist/components/dev/share-harness.js.map +1 -1
- package/dist/components/files/file-panel.d.ts +1 -1
- package/dist/components/files/file-panel.d.ts.map +1 -1
- package/dist/components/files/file-panel.js +74 -0
- package/dist/components/files/file-panel.js.map +1 -1
- package/dist/components/files/file-tree-view.d.ts +45 -0
- package/dist/components/files/file-tree-view.d.ts.map +1 -0
- package/dist/components/files/file-tree-view.js +51 -0
- package/dist/components/files/file-tree-view.js.map +1 -0
- package/dist/components/files/file-tree.d.ts +6 -0
- package/dist/components/files/file-tree.d.ts.map +1 -1
- package/dist/components/files/file-tree.js +39 -43
- package/dist/components/files/file-tree.js.map +1 -1
- package/dist/components/files/file-viewer-binary.d.ts.map +1 -1
- package/dist/components/files/file-viewer-binary.js +3 -2
- package/dist/components/files/file-viewer-binary.js.map +1 -1
- package/dist/components/files/file-viewer-frame.d.ts +36 -0
- package/dist/components/files/file-viewer-frame.d.ts.map +1 -0
- package/dist/components/files/file-viewer-frame.js +26 -0
- package/dist/components/files/file-viewer-frame.js.map +1 -0
- package/dist/components/files/file-viewer.d.ts +5 -0
- package/dist/components/files/file-viewer.d.ts.map +1 -1
- package/dist/components/files/file-viewer.js +26 -32
- package/dist/components/files/file-viewer.js.map +1 -1
- package/dist/components/files/frontmatter-chips.d.ts +18 -0
- package/dist/components/files/frontmatter-chips.d.ts.map +1 -0
- package/dist/components/files/frontmatter-chips.js +11 -0
- package/dist/components/files/frontmatter-chips.js.map +1 -0
- package/dist/components/files/frontmatter-panel.d.ts +5 -1
- package/dist/components/files/frontmatter-panel.d.ts.map +1 -1
- package/dist/components/files/frontmatter-panel.js +7 -6
- package/dist/components/files/frontmatter-panel.js.map +1 -1
- package/dist/components/files/staleness.d.ts +18 -0
- package/dist/components/files/staleness.d.ts.map +1 -0
- package/dist/components/files/staleness.js +27 -0
- package/dist/components/files/staleness.js.map +1 -0
- package/dist/components/graph/graph-canvas.d.ts.map +1 -1
- package/dist/components/graph/graph-canvas.js +24 -1
- package/dist/components/graph/graph-canvas.js.map +1 -1
- package/dist/components/graph/graph-controls-column.d.ts +14 -0
- package/dist/components/graph/graph-controls-column.d.ts.map +1 -0
- package/dist/components/graph/graph-controls-column.js +44 -0
- package/dist/components/graph/graph-controls-column.js.map +1 -0
- package/dist/components/graph/graph-controls.d.ts +20 -5
- package/dist/components/graph/graph-controls.d.ts.map +1 -1
- package/dist/components/graph/graph-controls.js +58 -37
- package/dist/components/graph/graph-controls.js.map +1 -1
- package/dist/components/graph/graph-form.d.ts +82 -0
- package/dist/components/graph/graph-form.d.ts.map +1 -0
- package/dist/components/graph/graph-form.js +69 -0
- package/dist/components/graph/graph-form.js.map +1 -0
- package/dist/components/graph/graph-maintenance.d.ts.map +1 -1
- package/dist/components/graph/graph-maintenance.js +6 -10
- package/dist/components/graph/graph-maintenance.js.map +1 -1
- package/dist/components/graph/graph-node-rail.d.ts +13 -0
- package/dist/components/graph/graph-node-rail.d.ts.map +1 -0
- package/dist/components/graph/graph-node-rail.js +92 -0
- package/dist/components/graph/graph-node-rail.js.map +1 -0
- package/dist/components/graph/graph-page.d.ts +7 -0
- package/dist/components/graph/graph-page.d.ts.map +1 -1
- package/dist/components/graph/graph-page.js +102 -12
- package/dist/components/graph/graph-page.js.map +1 -1
- package/dist/components/graph/graph-scene.d.ts.map +1 -1
- package/dist/components/graph/graph-scene.js +100 -24
- package/dist/components/graph/graph-scene.js.map +1 -1
- package/dist/components/graph/lib/graph-helpers.d.ts +42 -12
- package/dist/components/graph/lib/graph-helpers.d.ts.map +1 -1
- package/dist/components/graph/lib/graph-helpers.js +33 -41
- package/dist/components/graph/lib/graph-helpers.js.map +1 -1
- package/dist/components/graph/node-card.d.ts +28 -0
- package/dist/components/graph/node-card.d.ts.map +1 -0
- package/dist/components/graph/node-card.js +7 -0
- package/dist/components/graph/node-card.js.map +1 -0
- package/dist/components/graph/node-popover.d.ts +6 -2
- package/dist/components/graph/node-popover.d.ts.map +1 -1
- package/dist/components/graph/node-popover.js +13 -31
- package/dist/components/graph/node-popover.js.map +1 -1
- package/dist/components/graph/use-graph-theme.d.ts +32 -4
- package/dist/components/graph/use-graph-theme.d.ts.map +1 -1
- package/dist/components/graph/use-graph-theme.js +44 -32
- package/dist/components/graph/use-graph-theme.js.map +1 -1
- package/dist/components/graph/use-node-actions.d.ts +26 -0
- package/dist/components/graph/use-node-actions.d.ts.map +1 -0
- package/dist/components/graph/use-node-actions.js +54 -0
- package/dist/components/graph/use-node-actions.js.map +1 -0
- package/dist/components/images/image-share.d.ts +2 -1
- package/dist/components/images/image-share.d.ts.map +1 -1
- package/dist/components/images/image-share.js +3 -3
- package/dist/components/images/image-share.js.map +1 -1
- package/dist/components/images/image-viewer.d.ts.map +1 -1
- package/dist/components/images/image-viewer.js +3 -1
- package/dist/components/images/image-viewer.js.map +1 -1
- package/dist/components/images/mask-editor.d.ts.map +1 -1
- package/dist/components/images/mask-editor.js +7 -5
- package/dist/components/images/mask-editor.js.map +1 -1
- package/dist/components/layout/app-shell.d.ts.map +1 -1
- package/dist/components/layout/app-shell.js +4 -1
- package/dist/components/layout/app-shell.js.map +1 -1
- package/dist/components/layout/desktop-palette.d.ts +23 -0
- package/dist/components/layout/desktop-palette.d.ts.map +1 -0
- package/dist/components/layout/desktop-palette.js +132 -0
- package/dist/components/layout/desktop-palette.js.map +1 -0
- package/dist/components/layout/key-cap.d.ts +9 -0
- package/dist/components/layout/key-cap.d.ts.map +1 -0
- package/dist/components/layout/key-cap.js +10 -0
- package/dist/components/layout/key-cap.js.map +1 -0
- package/dist/components/layout/mobile-tab-bar.d.ts +13 -0
- package/dist/components/layout/mobile-tab-bar.d.ts.map +1 -1
- package/dist/components/layout/mobile-tab-bar.js +58 -47
- package/dist/components/layout/mobile-tab-bar.js.map +1 -1
- package/dist/components/layout/shortcut-switch.d.ts +13 -0
- package/dist/components/layout/shortcut-switch.d.ts.map +1 -0
- package/dist/components/layout/shortcut-switch.js +22 -0
- package/dist/components/layout/shortcut-switch.js.map +1 -0
- package/dist/components/layout/side-rail.d.ts +28 -0
- package/dist/components/layout/side-rail.d.ts.map +1 -1
- package/dist/components/layout/side-rail.js +72 -27
- package/dist/components/layout/side-rail.js.map +1 -1
- package/dist/components/layout/slide-panel.d.ts +25 -2
- package/dist/components/layout/slide-panel.d.ts.map +1 -1
- package/dist/components/layout/slide-panel.js +13 -4
- package/dist/components/layout/slide-panel.js.map +1 -1
- package/dist/components/layout/theme.d.ts +22 -0
- package/dist/components/layout/theme.d.ts.map +1 -0
- package/dist/components/layout/theme.js +44 -0
- package/dist/components/layout/theme.js.map +1 -0
- package/dist/components/quick-actions/add-form.d.ts +44 -0
- package/dist/components/quick-actions/add-form.d.ts.map +1 -0
- package/dist/components/quick-actions/add-form.js +32 -0
- package/dist/components/quick-actions/add-form.js.map +1 -0
- package/dist/components/quick-actions/add-modal.d.ts +7 -0
- package/dist/components/quick-actions/add-modal.d.ts.map +1 -1
- package/dist/components/quick-actions/add-modal.js +23 -20
- package/dist/components/quick-actions/add-modal.js.map +1 -1
- package/dist/components/quick-actions/search-modal.d.ts.map +1 -1
- package/dist/components/quick-actions/search-modal.js +8 -5
- package/dist/components/quick-actions/search-modal.js.map +1 -1
- package/dist/components/quick-actions/streaming-modal.d.ts +6 -0
- package/dist/components/quick-actions/streaming-modal.d.ts.map +1 -1
- package/dist/components/quick-actions/streaming-modal.js +53 -18
- package/dist/components/quick-actions/streaming-modal.js.map +1 -1
- package/dist/components/quick-actions/streaming-output.d.ts +38 -0
- package/dist/components/quick-actions/streaming-output.d.ts.map +1 -0
- package/dist/components/quick-actions/streaming-output.js +22 -0
- package/dist/components/quick-actions/streaming-output.js.map +1 -0
- package/dist/components/quick-actions/whatsup-modal.d.ts +5 -0
- package/dist/components/quick-actions/whatsup-modal.d.ts.map +1 -1
- package/dist/components/quick-actions/whatsup-modal.js +51 -10
- package/dist/components/quick-actions/whatsup-modal.js.map +1 -1
- package/dist/components/settings/devices-agents-tab.d.ts +6 -1
- package/dist/components/settings/devices-agents-tab.d.ts.map +1 -1
- package/dist/components/settings/devices-agents-tab.js +55 -20
- package/dist/components/settings/devices-agents-tab.js.map +1 -1
- package/dist/components/settings/models-list.d.ts +39 -0
- package/dist/components/settings/models-list.d.ts.map +1 -0
- package/dist/components/settings/models-list.js +72 -0
- package/dist/components/settings/models-list.js.map +1 -0
- package/dist/components/settings/models-tab.d.ts +4 -0
- package/dist/components/settings/models-tab.d.ts.map +1 -1
- package/dist/components/settings/models-tab.js +52 -102
- package/dist/components/settings/models-tab.js.map +1 -1
- package/dist/components/settings/one-time-agent-credential.js +1 -1
- package/dist/components/settings/one-time-agent-credential.js.map +1 -1
- package/dist/components/settings/passkey-list.d.ts +35 -0
- package/dist/components/settings/passkey-list.d.ts.map +1 -0
- package/dist/components/settings/passkey-list.js +34 -0
- package/dist/components/settings/passkey-list.js.map +1 -0
- package/dist/components/settings/passkey-tab.d.ts +3 -0
- package/dist/components/settings/passkey-tab.d.ts.map +1 -1
- package/dist/components/settings/passkey-tab.js +53 -45
- package/dist/components/settings/passkey-tab.js.map +1 -1
- package/dist/components/settings/pi-accounts-list.d.ts +27 -0
- package/dist/components/settings/pi-accounts-list.d.ts.map +1 -0
- package/dist/components/settings/pi-accounts-list.js +15 -0
- package/dist/components/settings/pi-accounts-list.js.map +1 -0
- package/dist/components/settings/pi-accounts.d.ts +3 -0
- package/dist/components/settings/pi-accounts.d.ts.map +1 -1
- package/dist/components/settings/pi-accounts.js +73 -55
- package/dist/components/settings/pi-accounts.js.map +1 -1
- package/dist/components/settings/principal-list.d.ts +37 -0
- package/dist/components/settings/principal-list.d.ts.map +1 -0
- package/dist/components/settings/principal-list.js +18 -0
- package/dist/components/settings/principal-list.js.map +1 -0
- package/dist/components/settings/settings-panel.d.ts +10 -3
- package/dist/components/settings/settings-panel.d.ts.map +1 -1
- package/dist/components/settings/settings-panel.js +71 -10
- package/dist/components/settings/settings-panel.js.map +1 -1
- package/dist/components/settings/skills-list.d.ts +53 -0
- package/dist/components/settings/skills-list.d.ts.map +1 -0
- package/dist/components/settings/skills-list.js +28 -0
- package/dist/components/settings/skills-list.js.map +1 -0
- package/dist/components/settings/skills-tab.d.ts.map +1 -1
- package/dist/components/settings/skills-tab.js +65 -38
- package/dist/components/settings/skills-tab.js.map +1 -1
- package/dist/components/settings/tool-permissions-list.d.ts +18 -0
- package/dist/components/settings/tool-permissions-list.d.ts.map +1 -0
- package/dist/components/settings/tool-permissions-list.js +6 -0
- package/dist/components/settings/tool-permissions-list.js.map +1 -0
- package/dist/components/settings/tool-permissions.d.ts +2 -1
- package/dist/components/settings/tool-permissions.d.ts.map +1 -1
- package/dist/components/settings/tool-permissions.js +33 -16
- package/dist/components/settings/tool-permissions.js.map +1 -1
- package/dist/components/settings/web-search-chain.d.ts +41 -0
- package/dist/components/settings/web-search-chain.d.ts.map +1 -0
- package/dist/components/settings/web-search-chain.js +47 -0
- package/dist/components/settings/web-search-chain.js.map +1 -0
- package/dist/components/settings/web-search-settings.d.ts +4 -7
- package/dist/components/settings/web-search-settings.d.ts.map +1 -1
- package/dist/components/settings/web-search-settings.js +54 -76
- package/dist/components/settings/web-search-settings.js.map +1 -1
- package/dist/components/share/share-menu.d.ts.map +1 -1
- package/dist/components/share/share-menu.js +24 -4
- package/dist/components/share/share-menu.js.map +1 -1
- package/dist/components/voice/dictation-sheet.js +3 -3
- package/dist/components/voice/dictation-sheet.js.map +1 -1
- package/dist/components/voice/mic-button.js +1 -1
- package/dist/components/voice/mic-button.js.map +1 -1
- package/dist/components/voice/review-card.js +1 -1
- package/dist/components/voice/review-card.js.map +1 -1
- package/dist/config.d.ts +5 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +15 -5
- package/dist/config.js.map +1 -1
- package/dist/connection.d.ts +12 -0
- package/dist/connection.d.ts.map +1 -0
- package/dist/connection.js +421 -0
- package/dist/connection.js.map +1 -0
- package/dist/default-root.d.ts +3 -0
- package/dist/default-root.d.ts.map +1 -0
- package/dist/default-root.js +16 -0
- package/dist/default-root.js.map +1 -0
- package/dist/hooks/use-color-scheme.d.ts +14 -0
- package/dist/hooks/use-color-scheme.d.ts.map +1 -0
- package/dist/hooks/use-color-scheme.js +37 -0
- package/dist/hooks/use-color-scheme.js.map +1 -0
- package/dist/hooks/use-fine-pointer.d.ts +12 -0
- package/dist/hooks/use-fine-pointer.d.ts.map +1 -0
- package/dist/hooks/use-fine-pointer.js +15 -0
- package/dist/hooks/use-fine-pointer.js.map +1 -0
- package/dist/hooks/use-hash-routes.d.ts.map +1 -1
- package/dist/hooks/use-hash-routes.js +4 -2
- package/dist/hooks/use-hash-routes.js.map +1 -1
- package/dist/hooks/use-media-query.d.ts +9 -0
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-media-query.js +38 -0
- package/dist/hooks/use-media-query.js.map +1 -0
- package/dist/hooks/use-share-intake.d.ts.map +1 -1
- package/dist/hooks/use-share-intake.js +37 -12
- package/dist/hooks/use-share-intake.js.map +1 -1
- package/dist/hooks/use-vpn-status.d.ts.map +1 -1
- package/dist/hooks/use-vpn-status.js +17 -18
- package/dist/hooks/use-vpn-status.js.map +1 -1
- package/dist/hooks/use-websocket.d.ts +5 -24
- package/dist/hooks/use-websocket.d.ts.map +1 -1
- package/dist/hooks/use-websocket.js +11 -384
- package/dist/hooks/use-websocket.js.map +1 -1
- package/dist/hooks/websocket-handlers/activity.d.ts +2 -2
- package/dist/hooks/websocket-handlers/activity.d.ts.map +1 -1
- package/dist/hooks/websocket-handlers/activity.js +4 -5
- package/dist/hooks/websocket-handlers/activity.js.map +1 -1
- package/dist/hooks/websocket-handlers/chat.d.ts +1 -0
- package/dist/hooks/websocket-handlers/chat.d.ts.map +1 -1
- package/dist/hooks/websocket-handlers/chat.js +28 -6
- package/dist/hooks/websocket-handlers/chat.js.map +1 -1
- package/dist/hooks/websocket-handlers/connection.d.ts.map +1 -1
- package/dist/hooks/websocket-handlers/connection.js +4 -6
- package/dist/hooks/websocket-handlers/connection.js.map +1 -1
- package/dist/hooks/websocket-handlers/mask.d.ts +1 -1
- package/dist/hooks/websocket-handlers/mask.d.ts.map +1 -1
- package/dist/hooks/websocket-handlers/mask.js +2 -3
- package/dist/hooks/websocket-handlers/mask.js.map +1 -1
- package/dist/hooks/websocket-handlers/provider.d.ts.map +1 -1
- package/dist/hooks/websocket-handlers/provider.js +4 -6
- package/dist/hooks/websocket-handlers/provider.js.map +1 -1
- package/dist/hooks/websocket-handlers/types.d.ts +6 -2
- package/dist/hooks/websocket-handlers/types.d.ts.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/api-client.d.ts +289 -0
- package/dist/lib/api-client.d.ts.map +1 -1
- package/dist/lib/api-client.js +243 -224
- package/dist/lib/api-client.js.map +1 -1
- package/dist/lib/backend.d.ts +19 -2
- package/dist/lib/backend.d.ts.map +1 -1
- package/dist/lib/backend.js +15 -9
- package/dist/lib/backend.js.map +1 -1
- package/dist/lib/diff.d.ts +8 -10
- package/dist/lib/diff.d.ts.map +1 -1
- package/dist/lib/diff.js +26 -53
- package/dist/lib/diff.js.map +1 -1
- package/dist/lib/light-dark.d.ts +37 -0
- package/dist/lib/light-dark.d.ts.map +1 -0
- package/dist/lib/light-dark.js +83 -0
- package/dist/lib/light-dark.js.map +1 -0
- package/dist/lib/mermaid-theme.d.ts +7 -2
- package/dist/lib/mermaid-theme.d.ts.map +1 -1
- package/dist/lib/mermaid-theme.js +125 -203
- package/dist/lib/mermaid-theme.js.map +1 -1
- package/dist/lib/passkeys.d.ts +6 -3
- package/dist/lib/passkeys.d.ts.map +1 -1
- package/dist/lib/passkeys.js +10 -4
- package/dist/lib/passkeys.js.map +1 -1
- package/dist/lib/push-registration.d.ts +4 -1
- package/dist/lib/push-registration.d.ts.map +1 -1
- package/dist/lib/push-registration.js +20 -2
- package/dist/lib/push-registration.js.map +1 -1
- package/dist/lib/share-intake.d.ts +2 -1
- package/dist/lib/share-intake.d.ts.map +1 -1
- package/dist/lib/share-intake.js +3 -3
- package/dist/lib/share-intake.js.map +1 -1
- package/dist/lib/share.d.ts +4 -3
- package/dist/lib/share.d.ts.map +1 -1
- package/dist/lib/share.js +6 -7
- package/dist/lib/share.js.map +1 -1
- package/dist/lib/single-key.d.ts +30 -0
- package/dist/lib/single-key.d.ts.map +1 -0
- package/dist/lib/single-key.js +45 -0
- package/dist/lib/single-key.js.map +1 -0
- package/dist/lib/tool-names.d.ts +8 -6
- package/dist/lib/tool-names.d.ts.map +1 -1
- package/dist/lib/tool-names.js +17 -7
- package/dist/lib/tool-names.js.map +1 -1
- package/dist/root-context.d.ts +229 -0
- package/dist/root-context.d.ts.map +1 -0
- package/dist/root-context.js +33 -0
- package/dist/root-context.js.map +1 -0
- package/dist/root.d.ts +38 -0
- package/dist/root.d.ts.map +1 -0
- package/dist/root.js +47 -0
- package/dist/root.js.map +1 -0
- package/dist/stores/activity-state.d.ts +29 -0
- package/dist/stores/activity-state.d.ts.map +1 -0
- package/dist/stores/activity-state.js +282 -0
- package/dist/stores/activity-state.js.map +1 -0
- package/dist/stores/activity-store.d.ts +10 -41
- package/dist/stores/activity-store.d.ts.map +1 -1
- package/dist/stores/activity-store.js +9 -271
- package/dist/stores/activity-store.js.map +1 -1
- package/dist/stores/chat-state.d.ts +233 -0
- package/dist/stores/chat-state.d.ts.map +1 -0
- package/dist/stores/chat-state.js +477 -0
- package/dist/stores/chat-state.js.map +1 -0
- package/dist/stores/chat-store.d.ts +4 -162
- package/dist/stores/chat-store.d.ts.map +1 -1
- package/dist/stores/chat-store.js +7 -418
- package/dist/stores/chat-store.js.map +1 -1
- package/dist/stores/connection-state.d.ts +40 -0
- package/dist/stores/connection-state.d.ts.map +1 -0
- package/dist/stores/connection-state.js +30 -0
- package/dist/stores/connection-state.js.map +1 -0
- package/dist/stores/connection-store.d.ts +4 -40
- package/dist/stores/connection-store.d.ts.map +1 -1
- package/dist/stores/connection-store.js +7 -27
- package/dist/stores/connection-store.js.map +1 -1
- package/dist/stores/create-stores.d.ts +23 -0
- package/dist/stores/create-stores.d.ts.map +1 -0
- package/dist/stores/create-stores.js +28 -0
- package/dist/stores/create-stores.js.map +1 -0
- package/dist/stores/file-state.d.ts +53 -0
- package/dist/stores/file-state.d.ts.map +1 -0
- package/dist/stores/file-state.js +341 -0
- package/dist/stores/file-state.js.map +1 -0
- package/dist/stores/file-store.d.ts +4 -52
- package/dist/stores/file-store.d.ts.map +1 -1
- package/dist/stores/file-store.js +7 -336
- package/dist/stores/file-store.js.map +1 -1
- package/dist/stores/graph-state.d.ts +95 -0
- package/dist/stores/graph-state.d.ts.map +1 -0
- package/dist/stores/graph-state.js +252 -0
- package/dist/stores/graph-state.js.map +1 -0
- package/dist/stores/graph-store.d.ts +7 -83
- package/dist/stores/graph-store.d.ts.map +1 -1
- package/dist/stores/graph-store.js +8 -249
- package/dist/stores/graph-store.js.map +1 -1
- package/dist/stores/mask-state.d.ts +21 -0
- package/dist/stores/mask-state.d.ts.map +1 -0
- package/dist/stores/mask-state.js +9 -0
- package/dist/stores/mask-state.js.map +1 -0
- package/dist/stores/mask-store.d.ts +4 -21
- package/dist/stores/mask-store.d.ts.map +1 -1
- package/dist/stores/mask-store.js +7 -6
- package/dist/stores/mask-store.js.map +1 -1
- package/dist/stores/principal-state.d.ts +16 -0
- package/dist/stores/principal-state.d.ts.map +1 -0
- package/dist/stores/principal-state.js +31 -0
- package/dist/stores/principal-state.js.map +1 -0
- package/dist/stores/principal-store.d.ts +4 -15
- package/dist/stores/principal-store.d.ts.map +1 -1
- package/dist/stores/principal-store.js +7 -28
- package/dist/stores/principal-store.js.map +1 -1
- package/dist/stores/provider-state.d.ts +24 -0
- package/dist/stores/provider-state.d.ts.map +1 -0
- package/dist/stores/provider-state.js +68 -0
- package/dist/stores/provider-state.js.map +1 -0
- package/dist/stores/provider-store.d.ts +4 -23
- package/dist/stores/provider-store.d.ts.map +1 -1
- package/dist/stores/provider-store.js +7 -64
- package/dist/stores/provider-store.js.map +1 -1
- package/dist/stores/share-state.d.ts +29 -0
- package/dist/stores/share-state.d.ts.map +1 -0
- package/dist/stores/share-state.js +21 -0
- package/dist/stores/share-state.js.map +1 -0
- package/dist/stores/share-store.d.ts +4 -28
- package/dist/stores/share-store.d.ts.map +1 -1
- package/dist/stores/share-store.js +7 -18
- package/dist/stores/share-store.js.map +1 -1
- package/dist/stores/store-environment.d.ts +10 -0
- package/dist/stores/store-environment.d.ts.map +1 -0
- package/dist/stores/store-environment.js +2 -0
- package/dist/stores/store-environment.js.map +1 -0
- package/dist/stores/ui-state.d.ts +71 -0
- package/dist/stores/ui-state.d.ts.map +1 -0
- package/dist/stores/ui-state.js +58 -0
- package/dist/stores/ui-state.js.map +1 -0
- package/dist/stores/ui-store.d.ts +4 -45
- package/dist/stores/ui-store.d.ts.map +1 -1
- package/dist/stores/ui-store.js +7 -36
- package/dist/stores/ui-store.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme.css +150 -97
- package/dist/voice/asr-clients.d.ts +2 -1
- package/dist/voice/asr-clients.d.ts.map +1 -1
- package/dist/voice/asr-clients.js +16 -17
- package/dist/voice/asr-clients.js.map +1 -1
- package/dist/voice/use-dictation.d.ts.map +1 -1
- package/dist/voice/use-dictation.js +12 -8
- package/dist/voice/use-dictation.js.map +1 -1
- package/dist/voice/voice-state.d.ts +25 -0
- package/dist/voice/voice-state.d.ts.map +1 -0
- package/dist/voice/voice-state.js +29 -0
- package/dist/voice/voice-state.js.map +1 -0
- package/dist/voice/voice-store.d.ts +4 -25
- package/dist/voice/voice-store.d.ts.map +1 -1
- package/dist/voice/voice-store.js +7 -26
- package/dist/voice/voice-store.js.map +1 -1
- package/package.json +3 -2
- package/src/components/activity/activity-page.tsx +341 -160
- package/src/components/activity/activity-run-detail.tsx +81 -47
- package/src/components/activity/activity-run-list.tsx +27 -59
- package/src/components/activity/activity-views.tsx +155 -0
- package/src/components/activity/approval-card.tsx +117 -0
- package/src/components/activity/digest-card.tsx +25 -61
- package/src/components/activity/digest-summary.tsx +52 -0
- package/src/components/activity/push-switch.tsx +62 -0
- package/src/components/activity/push-toggle.tsx +51 -81
- package/src/components/activity/span-bits.tsx +60 -7
- package/src/components/chat/ask-user-card.tsx +292 -356
- package/src/components/chat/ask-user-typed.ts +77 -0
- package/src/components/chat/brain-markdown-links.tsx +4 -4
- package/src/components/chat/brain-markdown.tsx +4 -2
- package/src/components/chat/chat-page.tsx +41 -11
- package/src/components/chat/composer-view.tsx +194 -0
- package/src/components/chat/composer.tsx +117 -296
- package/src/components/chat/markdown-content.tsx +53 -2
- package/src/components/chat/mermaid-block.tsx +13 -5
- package/src/components/chat/mermaid-share.ts +8 -7
- package/src/components/chat/mermaid-viewer.tsx +3 -1
- package/src/components/chat/message-bubble.tsx +78 -94
- package/src/components/chat/message-share.ts +7 -7
- package/src/components/chat/renderers/bind.tsx +94 -0
- package/src/components/chat/renderers/brain-ui-tools.tsx +56 -0
- package/src/components/chat/renderers/claude-tools.tsx +3 -2
- package/src/components/chat/renderers/index.ts +15 -10
- package/src/components/chat/session-drawer.tsx +41 -138
- package/src/components/chat/session-list.tsx +113 -0
- package/src/components/chat/share-block.tsx +16 -12
- package/src/components/chat/share-card.tsx +2 -2
- package/src/components/chat/subagent-view.tsx +4 -4
- package/src/components/chat/tool-call-timeline.tsx +75 -26
- package/src/components/chat/tool-cards/block-card.tsx +145 -0
- package/src/components/chat/tool-cards/image-mask-card.tsx +214 -0
- package/src/components/chat/tool-cards/location-card.tsx +159 -0
- package/src/components/chat/tool-views.tsx +30 -60
- package/src/components/chat/transcript-turn.tsx +108 -0
- package/src/components/chat/use-chat-commands.ts +14 -16
- package/src/components/chat/welcome-state.tsx +36 -91
- package/src/components/connectivity/connection-gate.tsx +32 -24
- package/src/components/connectivity/login-form.tsx +122 -0
- package/src/components/connectivity/login-screen.tsx +45 -100
- package/src/components/dev/share-harness.tsx +2 -2
- package/src/components/files/file-panel.tsx +168 -0
- package/src/components/files/file-tree-view.tsx +127 -0
- package/src/components/files/file-tree.tsx +55 -109
- package/src/components/files/file-viewer-binary.tsx +3 -2
- package/src/components/files/file-viewer-frame.tsx +113 -0
- package/src/components/files/file-viewer.tsx +40 -95
- package/src/components/files/frontmatter-chips.tsx +42 -0
- package/src/components/files/frontmatter-panel.tsx +6 -71
- package/src/components/files/staleness.ts +29 -0
- package/src/components/graph/graph-canvas.tsx +24 -1
- package/src/components/graph/graph-controls-column.tsx +92 -0
- package/src/components/graph/graph-controls.tsx +83 -127
- package/src/components/graph/graph-form.tsx +183 -0
- package/src/components/graph/graph-maintenance.tsx +9 -14
- package/src/components/graph/graph-node-rail.tsx +147 -0
- package/src/components/graph/graph-page.tsx +189 -49
- package/src/components/graph/graph-scene.tsx +200 -30
- package/src/components/graph/lib/graph-helpers.ts +65 -43
- package/src/components/graph/node-card.tsx +64 -0
- package/src/components/graph/node-popover.tsx +28 -117
- package/src/components/graph/use-graph-theme.ts +69 -32
- package/src/components/graph/use-node-actions.ts +56 -0
- package/src/components/images/image-share.ts +4 -2
- package/src/components/images/image-viewer.tsx +3 -1
- package/src/components/images/mask-editor.tsx +7 -4
- package/src/components/layout/app-shell.tsx +5 -1
- package/src/components/layout/desktop-palette.tsx +151 -0
- package/src/components/layout/key-cap.tsx +15 -0
- package/src/components/layout/mobile-tab-bar.tsx +80 -157
- package/src/components/layout/shortcut-switch.tsx +32 -0
- package/src/components/layout/side-rail.tsx +77 -150
- package/src/components/layout/slide-panel.tsx +49 -6
- package/src/components/layout/theme.tsx +67 -0
- package/src/components/quick-actions/add-form.tsx +196 -0
- package/src/components/quick-actions/add-modal.tsx +32 -153
- package/src/components/quick-actions/search-modal.tsx +15 -5
- package/src/components/quick-actions/streaming-modal.tsx +57 -72
- package/src/components/quick-actions/streaming-output.tsx +112 -0
- package/src/components/quick-actions/whatsup-modal.tsx +53 -59
- package/src/components/settings/devices-agents-tab.tsx +60 -152
- package/src/components/settings/models-list.tsx +299 -0
- package/src/components/settings/models-tab.tsx +63 -337
- package/src/components/settings/one-time-agent-credential.tsx +1 -1
- package/src/components/settings/passkey-list.tsx +201 -0
- package/src/components/settings/passkey-tab.tsx +53 -197
- package/src/components/settings/pi-accounts-list.tsx +128 -0
- package/src/components/settings/pi-accounts.tsx +71 -170
- package/src/components/settings/principal-list.tsx +172 -0
- package/src/components/settings/settings-panel.tsx +239 -25
- package/src/components/settings/skills-list.tsx +276 -0
- package/src/components/settings/skills-tab.tsx +82 -269
- package/src/components/settings/tool-permissions-list.tsx +54 -0
- package/src/components/settings/tool-permissions.tsx +27 -46
- package/src/components/settings/web-search-chain.tsx +300 -0
- package/src/components/settings/web-search-settings.tsx +58 -328
- package/src/components/share/share-menu.tsx +19 -4
- package/src/components/voice/dictation-sheet.tsx +5 -5
- package/src/components/voice/mic-button.tsx +1 -1
- package/src/components/voice/review-card.tsx +1 -1
- package/src/config.ts +21 -7
- package/src/connection.ts +443 -0
- package/src/default-root.ts +16 -0
- package/src/hooks/use-color-scheme.ts +36 -0
- package/src/hooks/use-fine-pointer.ts +15 -0
- package/src/hooks/use-hash-routes.ts +4 -2
- package/src/hooks/use-media-query.ts +35 -0
- package/src/hooks/use-share-intake.ts +32 -12
- package/src/hooks/use-vpn-status.ts +18 -17
- package/src/hooks/use-websocket.ts +12 -428
- package/src/hooks/websocket-handlers/activity.ts +4 -5
- package/src/hooks/websocket-handlers/chat.ts +28 -6
- package/src/hooks/websocket-handlers/connection.ts +4 -6
- package/src/hooks/websocket-handlers/mask.ts +2 -3
- package/src/hooks/websocket-handlers/provider.ts +4 -6
- package/src/hooks/websocket-handlers/types.ts +6 -2
- package/src/index.ts +7 -3
- package/src/lib/api-client.ts +426 -384
- package/src/lib/backend.ts +20 -10
- package/src/lib/diff.ts +28 -62
- package/src/lib/light-dark.ts +83 -0
- package/src/lib/mermaid-theme.ts +183 -214
- package/src/lib/passkeys.ts +12 -4
- package/src/lib/push-registration.ts +19 -2
- package/src/lib/share-intake.ts +6 -3
- package/src/lib/share.ts +7 -4
- package/src/lib/single-key.ts +47 -0
- package/src/lib/tool-names.ts +31 -8
- package/src/root-context.tsx +40 -0
- package/src/root.ts +83 -0
- package/src/stores/activity-state.ts +295 -0
- package/src/stores/activity-store.ts +11 -285
- package/src/stores/chat-state.ts +822 -0
- package/src/stores/chat-store.ts +11 -705
- package/src/stores/connection-state.ts +78 -0
- package/src/stores/connection-store.ts +11 -76
- package/src/stores/create-stores.ts +31 -0
- package/src/stores/file-state.ts +399 -0
- package/src/stores/file-store.ts +9 -390
- package/src/stores/graph-state.ts +368 -0
- package/src/stores/graph-store.ts +10 -355
- package/src/stores/mask-state.ts +30 -0
- package/src/stores/mask-store.ts +10 -27
- package/src/stores/principal-state.ts +42 -0
- package/src/stores/principal-store.ts +10 -37
- package/src/stores/provider-state.ts +103 -0
- package/src/stores/provider-store.ts +10 -95
- package/src/stores/share-state.ts +56 -0
- package/src/stores/share-store.ts +11 -54
- package/src/stores/store-environment.ts +10 -0
- package/src/stores/ui-state.ts +143 -0
- package/src/stores/ui-store.ts +11 -93
- package/src/styles.css +4 -1
- package/src/theme.css +150 -97
- package/src/voice/asr-clients.ts +17 -17
- package/src/voice/use-dictation.ts +11 -8
- package/src/voice/voice-state.ts +57 -0
- package/src/voice/voice-store.ts +11 -55
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The push enable/disable CONTAINER, living on the Activity surface (where
|
|
3
|
+
* the alerts it governs land). It owns the browser permission, the service
|
|
4
|
+
* worker subscription, the server binding, and the lifetime guards that keep
|
|
5
|
+
* a late response from a superseded root or an unmounted panel from acting;
|
|
6
|
+
* `PushSwitch` owns what it looks like (S6). Nothing here renders markup.
|
|
7
|
+
*/
|
|
1
8
|
export declare function PushToggle(): import("react").JSX.Element;
|
|
2
9
|
//# sourceMappingURL=push-toggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push-toggle.d.ts","sourceRoot":"","sources":["../../../src/components/activity/push-toggle.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"push-toggle.d.ts","sourceRoot":"","sources":["../../../src/components/activity/push-toggle.tsx"],"names":[],"mappings":"AAMA;;;;;;GAMG;AAEH,wBAAgB,UAAU,gCAgHzB"}
|
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { useBrainUiRoot } from "../../root-context.js";
|
|
4
|
+
import { subscriptionMatchesKey } from "../../lib/push-registration.js";
|
|
5
|
+
import { PushSwitch } from "./push-switch.js";
|
|
6
6
|
/**
|
|
7
|
-
* The push enable/disable
|
|
8
|
-
* alerts it governs land).
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* nothing. Where the platform has no push at all (iOS Safari in-browser,
|
|
13
|
-
* pre-16.4), the control renders disabled-with-explanation, not hidden.
|
|
7
|
+
* The push enable/disable CONTAINER, living on the Activity surface (where
|
|
8
|
+
* the alerts it governs land). It owns the browser permission, the service
|
|
9
|
+
* worker subscription, the server binding, and the lifetime guards that keep
|
|
10
|
+
* a late response from a superseded root or an unmounted panel from acting;
|
|
11
|
+
* `PushSwitch` owns what it looks like (S6). Nothing here renders markup.
|
|
14
12
|
*/
|
|
15
|
-
/** The subscription's bound applicationServerKey, in the base64url form the
|
|
16
|
-
* server hands out — comparable against `pushPublicKey()` directly. */
|
|
17
|
-
function keyToBase64Url(key) {
|
|
18
|
-
let bin = "";
|
|
19
|
-
for (const b of new Uint8Array(key))
|
|
20
|
-
bin += String.fromCharCode(b);
|
|
21
|
-
return btoa(bin).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
22
|
-
}
|
|
23
13
|
export function PushToggle() {
|
|
14
|
+
const root = useBrainUiRoot();
|
|
15
|
+
const api = root.api;
|
|
16
|
+
const lifetime = useRef(new AbortController());
|
|
24
17
|
const [state, setState] = useState("unsupported");
|
|
25
18
|
const [busy, setBusy] = useState(false);
|
|
26
19
|
useEffect(() => {
|
|
20
|
+
const controller = new AbortController();
|
|
21
|
+
const signal = controller.signal;
|
|
22
|
+
lifetime.current = controller;
|
|
23
|
+
setState("unsupported");
|
|
24
|
+
setBusy(false);
|
|
27
25
|
void (async () => {
|
|
28
26
|
if (!("Notification" in window) || !("serviceWorker" in navigator) || !("PushManager" in window)) {
|
|
29
27
|
setState("unsupported");
|
|
@@ -38,20 +36,19 @@ export function PushToggle() {
|
|
|
38
36
|
return;
|
|
39
37
|
}
|
|
40
38
|
const registration = await navigator.serviceWorker.ready;
|
|
39
|
+
if (signal.aborted)
|
|
40
|
+
return;
|
|
41
41
|
const subscription = await registration.pushManager.getSubscription();
|
|
42
|
+
if (signal.aborted)
|
|
43
|
+
return;
|
|
42
44
|
if (subscription) {
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
// row (a dead-endpoint send, a DB restore) — healed by re-asserting,
|
|
46
|
-
// an idempotent upsert; or the server's VAPID keypair changed, which
|
|
47
|
-
// makes this subscription permanently unsendable — its
|
|
48
|
-
// applicationServerKey no longer matches, so drop it and surface the
|
|
49
|
-
// re-enable button. Offline, trust the browser's own state.
|
|
45
|
+
// Heal a lost server-side binding, but do not delete a browser
|
|
46
|
+
// subscription merely because this UI displays a different server.
|
|
50
47
|
try {
|
|
51
48
|
const { publicKey } = await api.pushPublicKey();
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
if (signal.aborted)
|
|
50
|
+
return;
|
|
51
|
+
if (!subscriptionMatchesKey(subscription, publicKey)) {
|
|
55
52
|
setState("unsubscribed");
|
|
56
53
|
return;
|
|
57
54
|
}
|
|
@@ -61,13 +58,19 @@ export function PushToggle() {
|
|
|
61
58
|
// Server unreachable — keep the browser's answer.
|
|
62
59
|
}
|
|
63
60
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
if (!signal.aborted)
|
|
62
|
+
setState(subscription ? "subscribed" : "unsubscribed");
|
|
63
|
+
})().catch(() => { if (!signal.aborted)
|
|
64
|
+
setState("unsubscribed"); });
|
|
65
|
+
return () => controller.abort();
|
|
66
|
+
}, [root, api]);
|
|
67
67
|
async function enable() {
|
|
68
|
+
const signal = lifetime.current.signal;
|
|
68
69
|
setBusy(true);
|
|
69
70
|
try {
|
|
70
71
|
const permission = await Notification.requestPermission();
|
|
72
|
+
if (signal.aborted)
|
|
73
|
+
return;
|
|
71
74
|
if (permission === "denied") {
|
|
72
75
|
setState("blocked");
|
|
73
76
|
return;
|
|
@@ -77,45 +80,67 @@ export function PushToggle() {
|
|
|
77
80
|
return;
|
|
78
81
|
}
|
|
79
82
|
const { publicKey } = await api.pushPublicKey();
|
|
83
|
+
if (signal.aborted)
|
|
84
|
+
return;
|
|
80
85
|
const registration = await navigator.serviceWorker.ready;
|
|
86
|
+
if (signal.aborted)
|
|
87
|
+
return;
|
|
88
|
+
const existing = await registration.pushManager.getSubscription();
|
|
89
|
+
if (signal.aborted)
|
|
90
|
+
return;
|
|
91
|
+
// Key rotation (or switching servers) is an explicit user action.
|
|
92
|
+
if (existing && !subscriptionMatchesKey(existing, publicKey)) {
|
|
93
|
+
await existing.unsubscribe();
|
|
94
|
+
if (signal.aborted)
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
81
97
|
const subscription = await registration.pushManager.subscribe({
|
|
82
98
|
userVisibleOnly: true,
|
|
83
99
|
applicationServerKey: publicKey,
|
|
84
100
|
});
|
|
101
|
+
if (signal.aborted)
|
|
102
|
+
return;
|
|
85
103
|
await api.pushSubscribe(subscription.toJSON(), navigator.userAgent.slice(0, 100));
|
|
86
|
-
|
|
104
|
+
if (!signal.aborted)
|
|
105
|
+
setState("subscribed");
|
|
87
106
|
}
|
|
88
107
|
catch {
|
|
89
|
-
|
|
108
|
+
if (!signal.aborted)
|
|
109
|
+
setState("unsubscribed");
|
|
90
110
|
}
|
|
91
111
|
finally {
|
|
92
|
-
|
|
112
|
+
if (!signal.aborted)
|
|
113
|
+
setBusy(false);
|
|
93
114
|
}
|
|
94
115
|
}
|
|
95
116
|
async function disable() {
|
|
117
|
+
const signal = lifetime.current.signal;
|
|
96
118
|
setBusy(true);
|
|
97
119
|
try {
|
|
98
120
|
const registration = await navigator.serviceWorker.ready;
|
|
121
|
+
if (signal.aborted)
|
|
122
|
+
return;
|
|
99
123
|
const subscription = await registration.pushManager.getSubscription();
|
|
124
|
+
if (signal.aborted)
|
|
125
|
+
return;
|
|
100
126
|
if (subscription) {
|
|
101
127
|
await api.pushUnsubscribe(subscription.endpoint).catch(() => { });
|
|
128
|
+
if (signal.aborted)
|
|
129
|
+
return;
|
|
102
130
|
await subscription.unsubscribe();
|
|
103
131
|
}
|
|
104
|
-
|
|
132
|
+
if (!signal.aborted)
|
|
133
|
+
setState("unsubscribed");
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
// Preserve the current state when the browser rejects an unsubscribe.
|
|
105
137
|
}
|
|
106
138
|
finally {
|
|
107
|
-
|
|
139
|
+
if (!signal.aborted)
|
|
140
|
+
setBusy(false);
|
|
108
141
|
}
|
|
109
142
|
}
|
|
110
|
-
if (state === "unsupported") {
|
|
111
|
-
return (_jsxs("div", { className: "flex items-center gap-1.5 text-[11px] text-muted-foreground/60", title: "This browser has no web push. On iOS, install the app to the home screen (iOS 16.4+).", children: [_jsx(BellOff, { className: "h-3.5 w-3.5" }), "No push here"] }));
|
|
112
|
-
}
|
|
113
|
-
if (state === "blocked") {
|
|
114
|
-
return (_jsxs("div", { className: "flex items-center gap-1.5 text-[11px] text-muted-foreground", title: "Notifications are blocked at the browser level. Allow them in this site's browser settings, then reload.", children: [_jsx(BellOff, { className: "h-3.5 w-3.5 text-destructive" }), "Blocked in browser settings"] }));
|
|
115
|
-
}
|
|
116
143
|
const on = state === "subscribed";
|
|
117
|
-
return (
|
|
118
|
-
? "text-primary hover:bg-surface-raised"
|
|
119
|
-
: "text-muted-foreground hover:bg-surface-raised hover:text-foreground"), title: on ? "Push notifications are on for this device" : "Get a push notification when background work fails", children: [on ? _jsx(Bell, { className: "h-3.5 w-3.5" }) : _jsx(BellOff, { className: "h-3.5 w-3.5" }), on ? "Push on" : "Enable push"] }));
|
|
144
|
+
return _jsx(PushSwitch, { state: state, busy: busy, onToggle: () => void (on ? disable() : enable()) });
|
|
120
145
|
}
|
|
121
146
|
//# sourceMappingURL=push-toggle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push-toggle.js","sourceRoot":"","sources":["../../../src/components/activity/push-toggle.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"push-toggle.js","sourceRoot":"","sources":["../../../src/components/activity/push-toggle.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,UAAU,EAAkB,MAA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AO,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAI,CAAC;AACpG,CAAC"}
|
|
@@ -37,6 +37,17 @@ export declare function SpanPayload({ spanId }: {
|
|
|
37
37
|
* than being mislabelled as output.
|
|
38
38
|
*/
|
|
39
39
|
export declare function eventTypeLabel(eventType: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* An `approval_decision` event as a sentence: what was decided and, when the
|
|
42
|
+
* client said, the channel it was decided on (#113) — "who said yes and how"
|
|
43
|
+
* is the question the record exists to answer. A decision recorded without a
|
|
44
|
+
* channel reads as the decision alone rather than guessing one. Anything
|
|
45
|
+
* this does not recognise returns null and falls back to the raw block.
|
|
46
|
+
*/
|
|
47
|
+
export declare function readApprovalDecision(payload: unknown): {
|
|
48
|
+
text: string;
|
|
49
|
+
facts: string | null;
|
|
50
|
+
} | null;
|
|
40
51
|
/**
|
|
41
52
|
* ONE labelled block per recorded event — the shared renderer behind the tool
|
|
42
53
|
* payload expander and the run detail's narrative stream, so every event type
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"span-bits.d.ts","sourceRoot":"","sources":["../../../src/components/activity/span-bits.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"span-bits.d.ts","sourceRoot":"","sources":["../../../src/components/activity/span-bits.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACZ,MAAM,mCAAmC,CAAC;AAS3C;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,OAAO,EACP,OAAO,EACP,SAAS,GACV,EAAE;IACD,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM,GAAG,IAAI,CAAC;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,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BAAgB,CAAC,MAAM,EAAE;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,MAAM,GAAG,IAAI,CAYhB;AAED,oFAAoF;AACpF,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,sCAYrF"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useBrainUiRoot } from "../../root-context.js";
|
|
2
3
|
import { useEffect } from "react";
|
|
3
4
|
import { useShallow } from "zustand/react/shallow";
|
|
4
5
|
import { isFailureOutcome, SPAN_TOOL_NAME_PREFIX } from "@schlessera/brain-ui-sdk/protocol";
|
|
5
|
-
import { useActivityStore, payloadEventsFor,
|
|
6
|
+
import { useActivityStore, payloadEventsFor, } from "../../stores/activity-store.js";
|
|
6
7
|
import { cn } from "../../lib/utils.js";
|
|
7
8
|
import { getToolLabel, formatTokenCount } from "../chat/tool-views.js";
|
|
8
9
|
/**
|
|
@@ -15,11 +16,11 @@ export function SpanStatusDot({ span, outcome, running, className, }) {
|
|
|
15
16
|
const resolved = span ? span.outcome : outcome;
|
|
16
17
|
const isRunning = running ?? (span !== undefined && span.outcome === undefined);
|
|
17
18
|
return (_jsx("span", { className: cn("h-1.5 w-1.5 shrink-0 rounded-full", isRunning
|
|
18
|
-
? "animate-pulse bg-primary"
|
|
19
|
+
? "animate-pulse bg-primary-mark"
|
|
19
20
|
: resolved === "success"
|
|
20
|
-
? "bg-accent"
|
|
21
|
+
? "bg-accent-mark"
|
|
21
22
|
: isFailureOutcome(resolved) || resolved === "denied"
|
|
22
|
-
? "bg-destructive"
|
|
23
|
+
? "bg-destructive-mark"
|
|
23
24
|
: "bg-muted-foreground", className) }));
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
@@ -48,14 +49,15 @@ export function spanToolLabel(span) {
|
|
|
48
49
|
* the wire `truncated` flag, rendered as a hint line under the block.
|
|
49
50
|
*/
|
|
50
51
|
export function SpanPayload({ spanId }) {
|
|
52
|
+
const root = useBrainUiRoot();
|
|
51
53
|
const events = useActivityStore(useShallow((s) => payloadEventsFor(s, spanId)));
|
|
52
54
|
// History fetches skip payload bodies (they exist for duration badges);
|
|
53
55
|
// the first expand of a finished run backfills them over REST. A no-op for
|
|
54
56
|
// live runs (payloads ride the WS deltas) and once per run thereafter.
|
|
55
57
|
useEffect(() => {
|
|
56
58
|
if (events.length === 0)
|
|
57
|
-
void loadSpanPayloads(spanId);
|
|
58
|
-
}, [spanId, events.length]);
|
|
59
|
+
void root.stores.activity.loadSpanPayloads(spanId);
|
|
60
|
+
}, [spanId, events.length, root]);
|
|
59
61
|
if (events.length === 0) {
|
|
60
62
|
return (_jsx("p", { className: "px-2 py-1 text-[11px] text-muted-foreground/60", children: "No payload recorded for this run." }));
|
|
61
63
|
}
|
|
@@ -77,12 +79,53 @@ export function eventTypeLabel(eventType) {
|
|
|
77
79
|
return "Job output";
|
|
78
80
|
return eventType.replace(/_/g, " ");
|
|
79
81
|
}
|
|
82
|
+
// Maps, not object literals: a stored payload is untrusted, and indexing a
|
|
83
|
+
// literal with "toString" or "__proto__" finds Object.prototype, not a miss.
|
|
84
|
+
const DECISION_TEXT = new Map([
|
|
85
|
+
["allow", "Allowed"],
|
|
86
|
+
["always_allow", "Always allowed"],
|
|
87
|
+
["deny", "Denied"],
|
|
88
|
+
]);
|
|
89
|
+
const CHANNEL_TEXT = new Map([
|
|
90
|
+
["card", "on the card"],
|
|
91
|
+
["voice", "by voice"],
|
|
92
|
+
]);
|
|
93
|
+
/**
|
|
94
|
+
* An `approval_decision` event as a sentence: what was decided and, when the
|
|
95
|
+
* client said, the channel it was decided on (#113) — "who said yes and how"
|
|
96
|
+
* is the question the record exists to answer. A decision recorded without a
|
|
97
|
+
* channel reads as the decision alone rather than guessing one. Anything
|
|
98
|
+
* this does not recognise returns null and falls back to the raw block.
|
|
99
|
+
*/
|
|
100
|
+
export function readApprovalDecision(payload) {
|
|
101
|
+
if (!payload || typeof payload !== "object")
|
|
102
|
+
return null;
|
|
103
|
+
const p = payload;
|
|
104
|
+
const decision = typeof p.decision === "string" ? DECISION_TEXT.get(p.decision) : undefined;
|
|
105
|
+
if (!decision)
|
|
106
|
+
return null;
|
|
107
|
+
const channel = typeof p.channel === "string" ? CHANNEL_TEXT.get(p.channel) : undefined;
|
|
108
|
+
if (p.channel !== undefined && !channel)
|
|
109
|
+
return null;
|
|
110
|
+
const facts = [
|
|
111
|
+
typeof p.principalId === "string" ? `principal ${p.principalId}` : null,
|
|
112
|
+
p.requestKind === "command" ? "command confirmation" : null,
|
|
113
|
+
].filter(Boolean);
|
|
114
|
+
return {
|
|
115
|
+
text: channel ? `${decision} ${channel}` : decision,
|
|
116
|
+
facts: facts.length > 0 ? facts.join(" · ") : null,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
80
119
|
/**
|
|
81
120
|
* ONE labelled block per recorded event — the shared renderer behind the tool
|
|
82
121
|
* payload expander and the run detail's narrative stream, so every event type
|
|
83
122
|
* lands somewhere visible instead of only the two the expander knows.
|
|
84
123
|
*/
|
|
85
124
|
export function SpanEventBlock({ event }) {
|
|
125
|
+
const approval = event.eventType === "approval_decision" ? readApprovalDecision(event.payload) : null;
|
|
126
|
+
if (approval) {
|
|
127
|
+
return (_jsxs("div", { children: [_jsx("div", { className: "mb-0.5 text-[10px] uppercase text-muted-foreground/60", children: "Approval" }), _jsx("p", { "data-testid": "approval-decision", className: "text-[11px] text-foreground", children: approval.text }), approval.facts && (_jsx("p", { className: "text-[10px] text-muted-foreground/60", children: approval.facts }))] }));
|
|
128
|
+
}
|
|
86
129
|
const text = typeof event.payload === "string" ? event.payload : JSON.stringify(event.payload, null, 2);
|
|
87
130
|
return (_jsxs("div", { children: [_jsx("div", { className: "mb-0.5 text-[10px] uppercase text-muted-foreground/60", children: eventTypeLabel(event.eventType) }), _jsx("pre", { className: "max-h-56 overflow-auto whitespace-pre-wrap break-words rounded-md bg-background/60 p-2 font-[family-name:var(--font-mono)] text-[11px] leading-relaxed text-muted-foreground", children: text }), event.truncated && (_jsx("p", { className: "mt-0.5 text-[10px] italic text-muted-foreground/60", children: "\u2026 truncated" }))] }));
|
|
88
131
|
}
|
|
@@ -175,6 +218,6 @@ export function digestCostClause(digest) {
|
|
|
175
218
|
export function CountBadge({ count, className }) {
|
|
176
219
|
if (count <= 0)
|
|
177
220
|
return null;
|
|
178
|
-
return (_jsx("span", { className: cn("absolute flex h-4 min-w-4 items-center justify-center rounded-full bg-destructive px-1 text-[9px] font-semibold text-
|
|
221
|
+
return (_jsx("span", { className: cn("absolute flex h-4 min-w-4 items-center justify-center rounded-full bg-destructive-fill px-1 text-[9px] font-semibold text-primary-foreground", className), children: count > 9 ? "9+" : count }));
|
|
179
222
|
}
|
|
180
223
|
//# sourceMappingURL=span-bits.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"span-bits.js","sourceRoot":"","sources":["../../../src/components/activity/span-bits.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAQ5F,OAAO,EACL,gBAAgB,EAChB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"span-bits.js","sourceRoot":"","sources":["../../../src/components/activity/span-bits.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,g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AM,UAAU,gBAAgB,CAAC,MAIhC;IACC,IAAI,MAAM,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;QAC1C,OAAO,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3E,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,CAAC,YAAY,IAAI,CAAC,CAAC;IAC1C,MAAM,SAAS,GAAG,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,QAAQ,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IAChE,IAAI,MAAM,CAAC,gBAAgB,GAAG,CAAC,EAAE,CAAC;QAChC,OAAO,GAAG,mBAAmB,CAAC,MAAM,CAAC,gBAAgB,EAAE,QAAQ,CAAC,SAAS,SAAS,EAAE,CAAC;IACvF,CAAC;IACD,yEAAyE;IACzE,IAAI,QAAQ,GAAG,CAAC;QAAE,OAAO,GAAG,QAAQ,WAAW,CAAC;IAChD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,SAAS,EAAyC;IACpF,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5B,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,8IAA8I,EAC9I,SAAS,CACV,YAEA,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GACpB,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -1,12 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `ask_user` exchange, one kit `AskUserCard` per question (D38 §1).
|
|
3
|
+
*
|
|
4
|
+
* An exchange is not a tool card. It has four states and all four stay in
|
|
5
|
+
* the transcript at full contrast — nothing rolls up or fades, because a
|
|
6
|
+
* question the agent asked is part of the record whichever way it was
|
|
7
|
+
* answered:
|
|
8
|
+
*
|
|
9
|
+
* `pending` — the options, one focus stop, Submit / Dismiss. "Other"
|
|
10
|
+
* opens the kit's free-text field in place of the Submit row:
|
|
11
|
+
* a typed alternative is the same exchange, not a new one.
|
|
12
|
+
* `answered` — the chosen answer in mono teal, with when. The alternatives
|
|
13
|
+
* are GONE, not dimmed: they were never the record. A
|
|
14
|
+
* multi-select lists every choice as its own row.
|
|
15
|
+
* `typed` — the user answered in the composer instead. The card quotes
|
|
16
|
+
* what it took, under a neutral border.
|
|
17
|
+
* `dismissed` — the question the turn outlived, in gold (seventh drop,
|
|
18
|
+
* ruling 7): no options, a lapsed row stating the fact, and
|
|
19
|
+
* "Ask again". The server-side request is already resolved,
|
|
20
|
+
* so asking again reopens the card LOCALLY to pending, and a
|
|
21
|
+
* submit from a reopened card goes out as a normal composer
|
|
22
|
+
* message quoting the question and the chosen answer(s)
|
|
23
|
+
* (`onReask`) rather than as an `ask_user_response` nobody is
|
|
24
|
+
* waiting for. No `onReask`, no button (D20).
|
|
25
|
+
*
|
|
26
|
+
* Multi-select questions ride the same kit card with `multi` (ruling 6): the
|
|
27
|
+
* options are `ChoiceOption multiple` — checkbox role, square mark — inside a
|
|
28
|
+
* `role="group"`, and "Other" toggles like any other row. The exchange's
|
|
29
|
+
* answers are keyed by question text and submitted together, so the action
|
|
30
|
+
* row sits on the LAST question's card and gathers every question's
|
|
31
|
+
* selection.
|
|
32
|
+
*/
|
|
1
33
|
import type { AskUserQuestion, AskUserAnnotation } from "@schlessera/brain-ui-sdk/protocol";
|
|
2
|
-
|
|
34
|
+
interface PerQuestionState {
|
|
35
|
+
/** Picked option labels (single-select keeps only the latest). */
|
|
36
|
+
selected: string[];
|
|
37
|
+
/** The kit's free-text field is open in place of the Submit row. */
|
|
38
|
+
otherOpen: boolean;
|
|
39
|
+
/** A free-text answer already taken from the field (held until Submit). */
|
|
40
|
+
otherText: string;
|
|
41
|
+
/** The option holding focus — the contract's `preview` follows focus, so
|
|
42
|
+
* ↑↓ over the options shows each one's preview before anything is picked. */
|
|
43
|
+
focused: string | null;
|
|
44
|
+
}
|
|
45
|
+
/** The preview to show for a question: the focused option's, else the single
|
|
46
|
+
* chosen one's. `preview` is "content rendered when an option is focused"
|
|
47
|
+
* in the ask_user contract; selection is the fallback once focus has moved on. */
|
|
48
|
+
export declare function previewFor(question: AskUserQuestion, state: Pick<PerQuestionState, "focused" | "selected">): string | undefined;
|
|
49
|
+
/** The answer the exchange recorded for one question, as the card shows it. */
|
|
50
|
+
export declare function recordedAnswer(question: AskUserQuestion, answers: Record<string, string> | undefined): string;
|
|
51
|
+
/**
|
|
52
|
+
* The recorded answer as the rows the card lists: one for a single-select,
|
|
53
|
+
* one per pick for a multi-select. The picks were joined by this module, so
|
|
54
|
+
* splitting on the same seam is the inverse of its own encoding — a label
|
|
55
|
+
* that itself contains ", " is the one case it cannot tell apart.
|
|
56
|
+
*/
|
|
57
|
+
export declare function recordedAnswers(question: AskUserQuestion, answers: Record<string, string> | undefined): string[];
|
|
58
|
+
/** "you chose this · 3m ago", "you chose 2 · 3m ago", or without the time
|
|
59
|
+
* when none is known. */
|
|
60
|
+
export declare function answeredMeta(answeredAt: number | undefined, count?: number): string;
|
|
61
|
+
export declare const TYPED_META = "taken from your next message";
|
|
62
|
+
/** The typed answer is the user's own words, so the card quotes them. */
|
|
63
|
+
export declare function quoted(text: string): string;
|
|
64
|
+
/** The lapsed row on a dismissed card: what happened, in the app's terms. */
|
|
65
|
+
export declare const DISMISSED_NOTE = "dismissed \u00B7 the agent got no answer";
|
|
66
|
+
export declare function AskUserCard({ requestId, questions, answered, cancelled, typed, answeredAt, onSubmit, onCancel, onReask, }: {
|
|
3
67
|
requestId: string;
|
|
4
68
|
questions: AskUserQuestion[];
|
|
5
69
|
answered?: Record<string, string>;
|
|
6
70
|
cancelled?: boolean;
|
|
7
|
-
/**
|
|
8
|
-
|
|
71
|
+
/** The answer was typed into the composer rather than chosen. */
|
|
72
|
+
typed?: boolean;
|
|
73
|
+
/** When the answer was given; absent on resumed history. */
|
|
74
|
+
answeredAt?: number;
|
|
9
75
|
onSubmit: (requestId: string, answers: Record<string, string>, annotations?: Record<string, AskUserAnnotation>) => void;
|
|
10
76
|
onCancel: (requestId: string) => void;
|
|
77
|
+
/**
|
|
78
|
+
* A dismissed question asked again: the answer goes out as a normal
|
|
79
|
+
* composer message, because the server already resolved the request.
|
|
80
|
+
* Absent, the dismissed card offers no "Ask again".
|
|
81
|
+
*/
|
|
82
|
+
onReask?: (text: string) => void;
|
|
11
83
|
}): import("react").JSX.Element;
|
|
84
|
+
export {};
|
|
12
85
|
//# sourceMappingURL=ask-user-card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-user-card.d.ts","sourceRoot":"","sources":["../../../src/components/chat/ask-user-card.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ask-user-card.d.ts","sourceRoot":"","sources":["../../../src/components/chat/ask-user-card.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AASH,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EAClB,MAAM,mCAAmC,CAAC;AAU3C,UAAU,gBAAgB;IACxB,kEAAkE;IAClE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,oEAAoE;IACpE,SAAS,EAAE,OAAO,CAAC;IACnB,2EAA2E;IAC3E,SAAS,EAAE,MAAM,CAAC;IAClB;iFAC6E;IAC7E,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAMD;;kFAEkF;AAClF,wBAAgB,UAAU,CACxB,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,UAAU,CAAC,GACpD,MAAM,GAAG,SAAS,CAOpB;AAED,+EAA+E;AAC/E,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,MAAM,CAAC,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