@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-drawer.d.ts","sourceRoot":"","sources":["../../../src/components/chat/session-drawer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"session-drawer.d.ts","sourceRoot":"","sources":["../../../src/components/chat/session-drawer.tsx"],"names":[],"mappings":"AAoBA;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,OAAO,EACP,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,+BA2EA"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { api } from "../../lib/api-client.js";
|
|
3
|
+
import { useBrainUiRoot } from "../../root-context.js";
|
|
5
4
|
import { useChatStore } from "../../stores/chat-store.js";
|
|
6
5
|
import { SlidePanel } from "../layout/slide-panel.js";
|
|
7
|
-
import {
|
|
6
|
+
import { SessionList } from "./session-list.js";
|
|
8
7
|
import { formatRelativeTime } from "./tool-views.js";
|
|
8
|
+
/**
|
|
9
|
+
* The container (S7): the sessions request, the retry counter and the
|
|
10
|
+
* chat-store reads live here; `SessionList` draws the rows.
|
|
11
|
+
*/
|
|
9
12
|
export function SessionDrawer({ open, onClose, onResume, }) {
|
|
13
|
+
const root = useBrainUiRoot();
|
|
14
|
+
const api = root.api;
|
|
10
15
|
const [sessions, setSessions] = useState([]);
|
|
11
16
|
const [loading, setLoading] = useState(false);
|
|
12
17
|
const [warning, setWarning] = useState(null);
|
|
@@ -20,6 +25,7 @@ export function SessionDrawer({ open, onClose, onResume, }) {
|
|
|
20
25
|
// rather than the deprecated status.activeSessionId, which multi-session
|
|
21
26
|
// servers no longer send.
|
|
22
27
|
const backgroundSessionId = Object.keys(runStates).find((id) => id !== currentSessionId) ?? null;
|
|
28
|
+
useEffect(() => { setSessions([]); setWarning(null); }, [root]);
|
|
23
29
|
useEffect(() => {
|
|
24
30
|
if (!open)
|
|
25
31
|
return;
|
|
@@ -42,34 +48,28 @@ export function SessionDrawer({ open, onClose, onResume, }) {
|
|
|
42
48
|
.finally(() => { if (active)
|
|
43
49
|
setLoading(false); });
|
|
44
50
|
return () => { active = false; };
|
|
45
|
-
}, [open, retry]);
|
|
46
|
-
const groups = groupSessionsByDate(sessions)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const heavy = !running && Boolean(note);
|
|
68
|
-
return (_jsx("span", { title: note, className: cn("shrink-0 rounded-full px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-wide", running
|
|
69
|
-
? "bg-primary/15 text-primary"
|
|
70
|
-
: heavy
|
|
71
|
-
? "bg-destructive/15 text-destructive"
|
|
72
|
-
: "bg-amber-500/15 text-amber-500"), children: running ? "Running" : "Queued" }));
|
|
51
|
+
}, [open, retry, root, api]);
|
|
52
|
+
const groups = groupSessionsByDate(sessions).map((group) => ({
|
|
53
|
+
label: group.label,
|
|
54
|
+
sessions: group.sessions.map((session) => {
|
|
55
|
+
const state = runStates[session.id];
|
|
56
|
+
return {
|
|
57
|
+
id: session.id,
|
|
58
|
+
title: session.title,
|
|
59
|
+
when: formatRelativeTime(session.lastActiveAt),
|
|
60
|
+
cost: session.totalCostUsd != null && session.totalCostUsd > 0 ? `$${session.totalCostUsd.toFixed(2)}` : null,
|
|
61
|
+
run: state === "streaming" || state === "queued" ? state : null,
|
|
62
|
+
note: queueNotes[session.id],
|
|
63
|
+
};
|
|
64
|
+
}),
|
|
65
|
+
}));
|
|
66
|
+
return (_jsx(SlidePanel, { open: open, onClose: onClose, title: "Sessions", wide: true, children: _jsx(SessionList, { groups: groups, loading: loading, warning: warning, currentSessionId: currentSessionId, backgroundSessionId: backgroundSessionId, onNew: () => {
|
|
67
|
+
clearMessages();
|
|
68
|
+
onClose();
|
|
69
|
+
}, onResume: (id) => {
|
|
70
|
+
onResume(id);
|
|
71
|
+
onClose();
|
|
72
|
+
}, onRetry: () => setRetry((value) => value + 1) }) }));
|
|
73
73
|
}
|
|
74
74
|
function groupSessionsByDate(sessions) {
|
|
75
75
|
const dayMs = 86400000;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-drawer.js","sourceRoot":"","sources":["../../../src/components/chat/session-drawer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"session-drawer.js","sourceRoot":"","sources":["../../../src/components/chat/session-drawer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAerD;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,IAAI,EACJ,OAAO,EACP,QAAQ,GAKT;IACC,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;IAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;IACrB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ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AM,GAAkC;QAC5C,KAAK,EAAE,EAAE;QACT,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,EAAE;QACf,OAAO,EAAE,EAAE;KACZ,CAAC;IAEF,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,IAAI,CAAC,CAAC,YAAY,IAAI,OAAO,EAAE,CAAC;YAC9B,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACvB,CAAC;aAAM,IAAI,CAAC,CAAC,YAAY,IAAI,WAAW,EAAE,CAAC;YACzC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;aAAM,IAAI,CAAC,CAAC,YAAY,IAAI,SAAS,EAAE,CAAC;YACvC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC9B,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;SAC1B,MAAM,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;SAC7C,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The session drawer's body, rendered from props (S7, the `chat` directory).
|
|
3
|
+
* `SessionDrawer` is the container: it owns the sessions request, the retry
|
|
4
|
+
* counter, the chat-store reads (which session is in view, which are
|
|
5
|
+
* running or queued) and the drawer chrome; this owns the rows.
|
|
6
|
+
*
|
|
7
|
+
* A session is the kit's card `ListRow`: title, when it was last active and
|
|
8
|
+
* what it cost as the subtitle, the live run state as the trailing value
|
|
9
|
+
* (amber "running", amber "queued", red once the host's queue note says the
|
|
10
|
+
* queue is heavy), and `selected` for the one in view — teal, "the choice
|
|
11
|
+
* belongs to the user". A background session still running is the first
|
|
12
|
+
* row, breathing, and taps to reattach.
|
|
13
|
+
*/
|
|
14
|
+
export interface SessionRowData {
|
|
15
|
+
id: string;
|
|
16
|
+
title: string | null;
|
|
17
|
+
/** Already formatted: "2h ago". */
|
|
18
|
+
when: string;
|
|
19
|
+
/** Already formatted: "$0.12", or null when nothing to say. */
|
|
20
|
+
cost: string | null;
|
|
21
|
+
run: "streaming" | "queued" | null;
|
|
22
|
+
/** The host's queue-pressure note; present only once the queue is heavy. */
|
|
23
|
+
note?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface SessionGroupData {
|
|
26
|
+
label: string;
|
|
27
|
+
sessions: SessionRowData[];
|
|
28
|
+
}
|
|
29
|
+
export interface SessionListProps {
|
|
30
|
+
groups: SessionGroupData[];
|
|
31
|
+
loading: boolean;
|
|
32
|
+
warning: string | null;
|
|
33
|
+
currentSessionId: string | null;
|
|
34
|
+
/** A running session other than the one in view, reattachable. */
|
|
35
|
+
backgroundSessionId: string | null;
|
|
36
|
+
onNew: () => void;
|
|
37
|
+
onResume: (sessionId: string) => void;
|
|
38
|
+
onRetry: () => void;
|
|
39
|
+
}
|
|
40
|
+
export declare function SessionList(p: SessionListProps): import("react").JSX.Element;
|
|
41
|
+
//# sourceMappingURL=session-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-list.d.ts","sourceRoot":"","sources":["../../../src/components/chat/session-list.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,GAAG,EAAE,WAAW,GAAG,QAAQ,GAAG,IAAI,CAAC;IACnC,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,kEAAkE;IAClE,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,gBAAgB,+BAmE9C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Callout, Label, ListRow, Placeholder } from "@schlessera/brain-ui-kit";
|
|
3
|
+
export function SessionList(p) {
|
|
4
|
+
const empty = p.groups.length === 0 && !p.backgroundSessionId;
|
|
5
|
+
return (_jsxs("div", { className: "flex h-full flex-col", children: [_jsx("div", { className: "p-4", children: _jsx(Button, { label: "New conversation", icon: "compose", tone: "suggest", size: "md", center: true, onClick: p.onNew }) }), _jsxs("div", { className: "flex flex-1 flex-col gap-2 overflow-y-auto px-3 pb-4", children: [p.backgroundSessionId && (_jsx(ListRow, { variant: "card", icon: "run", iconTone: "amber", title: "Session running\u2026", subtitle: "Tap to reattach", value: "live", valueTone: "amber", selected: true, onClick: () => p.onResume(p.backgroundSessionId) })), p.warning && (_jsxs("div", { role: "status", className: "flex flex-col gap-2", children: [_jsx(Callout, { tone: "gold", variant: "boxed", icon: "unverified", text: p.warning }), _jsx("div", { className: "flex justify-end", children: _jsx(Button, { label: "Retry", icon: "retry", tone: "ghost", size: "sm", block: false, onClick: p.onRetry }) })] })), p.loading ? (_jsx(Placeholder, { variant: "loading", lines: 3, bordered: false, pad: 4 })) : empty ? (_jsx(Placeholder, { variant: "empty", message: p.warning ? "No sessions available" : "No sessions yet", icon: "chat" })) : (p.groups.map((group) => (_jsxs("section", { className: "flex flex-col gap-1.5", children: [_jsx("div", { className: "px-1 pt-2", children: _jsx(Label, { text: group.label }) }), group.sessions.map((session) => {
|
|
6
|
+
const tone = session.run === "streaming" ? "amber" : session.run === "queued" ? (session.note ? "red" : "amber") : undefined;
|
|
7
|
+
return (_jsx("span", { title: session.note, className: "flex", children: _jsx(ListRow, { variant: "card", icon: "chat", iconTone: session.id === p.currentSessionId ? "teal" : "neutral", title: session.title || "Untitled", subtitle: session.cost ? `${session.when} · ${session.cost}` : session.when, value: session.run === "streaming" ? "running" : session.run === "queued" ? "queued" : undefined, valueTone: tone, selected: session.id === p.currentSessionId, onClick: () => p.onResume(session.id) }) }, session.id));
|
|
8
|
+
})] }, group.label))))] })] }));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=session-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-list.js","sourceRoot":"","sources":["../../../src/components/chat/session-list.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AA6CxF,MAAM,UAAU,WAAW,CAAC,CAAmB;IAC7C,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC;IAC9D,OAAO,CACL,eAAK,SAAS,EAAC,sBAAsB,aACnC,cAAK,SAAS,EAAC,K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AO,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAChG,SAAS,EAAE,IAAI,EACf,QAAQ,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC,gBAAgB,EAC3C,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,GACrC,IAXO,OAAO,CAAC,EAAE,CAYd,CACR,CAAC;4BACJ,CAAC,CAAC,KAtBU,KAAK,CAAC,KAAK,CAuBf,CACX,CAAC,CACH,IACG,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"share-block.d.ts","sourceRoot":"","sources":["../../../src/components/chat/share-block.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"share-block.d.ts","sourceRoot":"","sources":["../../../src/components/chat/share-block.tsx"],"names":[],"mappings":"AAUA,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;AAYlF,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,MAAgB,EAAE,KAAK,EAAE,EAAE,eAAe,+BAqC5E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useBrainUiRoot } from "../../root-context.js";
|
|
3
3
|
import { useRef } from "react";
|
|
4
4
|
import { BrainMarkdown } from "./brain-markdown.js";
|
|
5
5
|
import { ShareMenu } from "../share/share-menu.js";
|
|
@@ -16,38 +16,39 @@ const FORMAT_LABELS = {
|
|
|
16
16
|
};
|
|
17
17
|
const ORDER = ["image", "pdf", "text", "markdown", "richtext"];
|
|
18
18
|
export function ShareBlock({ body, format = "image", title }) {
|
|
19
|
+
const root = useBrainUiRoot();
|
|
19
20
|
const bodyRef = useRef(null);
|
|
20
21
|
const filename = sanitizeFilename(title ?? "share");
|
|
21
|
-
const primary = makeAction(format, body, filename, title, bodyRef);
|
|
22
|
-
const secondary = ORDER.filter((f) => f !== format).map((f) => makeAction(f, body, filename, title, bodyRef));
|
|
23
|
-
return (_jsxs("div", { className: "my-4 overflow-hidden rounded-lg border border-primary/30 bg-primary/[0.04]", children: [_jsxs("div", { className: "flex items-center justify-between gap-3 border-b border-primary/20 bg-primary/[0.06] px-3 py-2", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2 text-xs", children: [_jsx(Share2, { className: "h-3.5 w-3.5 shrink-0 text-primary/80" }), _jsx("span", { className: "truncate font-medium text-primary/90", children: title ?? "Share" }), _jsx("span", { className: "rounded-full bg-primary/15 px-2 py-0.5 text-[10px] uppercase tracking-wide text-primary
|
|
22
|
+
const primary = makeAction(root, format, body, filename, title, bodyRef);
|
|
23
|
+
const secondary = ORDER.filter((f) => f !== format).map((f) => makeAction(root, f, body, filename, title, bodyRef));
|
|
24
|
+
return (_jsxs("div", { className: "my-4 overflow-hidden rounded-lg border border-primary/30 bg-primary-fill/[0.04]", children: [_jsxs("div", { className: "flex items-center justify-between gap-3 border-b border-primary/20 bg-primary-fill/[0.06] px-3 py-2", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2 text-xs", children: [_jsx(Share2, { className: "h-3.5 w-3.5 shrink-0 text-primary/80" }), _jsx("span", { className: "truncate font-medium text-primary/90", children: title ?? "Share" }), _jsx("span", { className: "rounded-full bg-primary-fill/15 px-2 py-0.5 text-[10px] uppercase tracking-wide text-primary", children: format })] }), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx("button", { onClick: () => void primary.run(), className: "rounded-md bg-primary-fill px-2.5 py-1 text-[11px] font-medium text-primary-foreground transition-opacity hover:opacity-90", children: primary.label }), _jsx(ShareMenu, { options: secondary, title: "Other formats" })] })] }), _jsx("div", { ref: bodyRef, className: "px-4 py-3", children: _jsx(BrainMarkdown, { content: body, className: "brain-prose", fileLinks: true }) })] }));
|
|
24
25
|
}
|
|
25
|
-
function makeAction(fmt, body, filename, title, bodyRef) {
|
|
26
|
+
function makeAction(root, fmt, body, filename, title, bodyRef) {
|
|
26
27
|
return {
|
|
27
28
|
id: fmt,
|
|
28
29
|
label: FORMAT_LABELS[fmt],
|
|
29
|
-
run: () => runFormat(fmt, body, filename, title, bodyRef),
|
|
30
|
+
run: () => runFormat(root, fmt, body, filename, title, bodyRef),
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
|
-
async function runFormat(fmt, body, filename, title, bodyRef) {
|
|
33
|
+
async function runFormat(root, fmt, body, filename, title, bodyRef) {
|
|
33
34
|
switch (fmt) {
|
|
34
35
|
case "image":
|
|
35
|
-
return renderAndShare({
|
|
36
|
+
return renderAndShare(root, {
|
|
36
37
|
// The render page runs without JavaScript — mermaid fences are
|
|
37
38
|
// pre-rendered to inline SVG on the client.
|
|
38
39
|
content: await inlineMermaidDiagrams(body),
|
|
39
40
|
contentType: "markdown",
|
|
40
41
|
format: "png",
|
|
41
42
|
filename,
|
|
42
|
-
title: title ??
|
|
43
|
+
title: title ?? root.config.shareTitle,
|
|
43
44
|
});
|
|
44
45
|
case "pdf":
|
|
45
|
-
return renderAndShare({
|
|
46
|
+
return renderAndShare(root, {
|
|
46
47
|
content: await inlineMermaidDiagrams(body),
|
|
47
48
|
contentType: "markdown",
|
|
48
49
|
format: "pdf",
|
|
49
50
|
filename,
|
|
50
|
-
title: title ??
|
|
51
|
+
title: title ?? root.config.shareTitle,
|
|
51
52
|
});
|
|
52
53
|
case "text":
|
|
53
54
|
return shareText({ text: stripMarkdown(body), title });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"share-block.js","sourceRoot":"","sources":["../../../src/components/chat/share-block.tsx"],"names":[],"mappings":";
|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AO,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC;AAClE,CAAC;AAED,SAAS,UAAU,CAAC,CAAS;IAC3B,OAAO,CAAC;SACL,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -34,7 +34,7 @@ function useThumbnails(files) {
|
|
|
34
34
|
function ShareCard({ record, busy, onConfirm, onDismiss, }) {
|
|
35
35
|
const thumbs = useThumbnails(record.files);
|
|
36
36
|
const otherFiles = record.files.filter((file) => !file.type.startsWith("image/"));
|
|
37
|
-
return (_jsxs("div", { className: "mb-2 rounded-lg border border-border bg-surface p-3", children: [_jsxs("div", { className: "mb-2 flex items-center gap-2 text-xs text-muted-foreground", children: [_jsx(Share2, { className: "h-3.5 w-3.5" }), _jsx("span", { className: "flex-1", children: "Shared to your brain" }), _jsx("button", { type: "button", onClick: onDismiss, title: "Dismiss", className: "rounded p-0.5 transition-colors hover:text-foreground", children: _jsx(X, { className: "h-3.5 w-3.5" }) })] }), _jsxs("div", { className: "flex gap-3", children: [thumbs.length > 0 && (_jsx("div", { className: "flex shrink-0 flex-wrap gap-1", children: thumbs.map((thumb) => (_jsx("img", { src: thumb.url, alt: thumb.name, className: "h-14 w-14 rounded-md border border-border object-cover" }, thumb.url))) })), _jsxs("div", { className: "min-w-0 flex-1 space-y-1 text-sm", children: [record.title && (_jsx("div", { className: "truncate font-medium text-foreground", children: record.title })), record.url && (_jsx("div", { className: "truncate text-xs text-muted-foreground", children: record.url })), record.text && (_jsx("div", { className: "line-clamp-3 text-xs text-muted-foreground", children: record.text })), otherFiles.map((file) => (_jsx("div", { className: "truncate text-xs text-muted-foreground", children: file.name }, file.name)))] })] }), _jsxs("div", { className: "mt-3 flex items-center gap-2", children: [_jsxs("button", { type: "button", onClick: onConfirm, disabled: busy, className: "flex items-center gap-2 rounded-lg bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground disabled:opacity-60", children: [busy && _jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin" }), "Add to brain"] }), _jsx("button", { type: "button", onClick: onDismiss, disabled: busy, className: "rounded-lg border border-border px-3 py-1.5 text-sm text-muted-foreground disabled:opacity-60", children: "Dismiss" })] })] }));
|
|
37
|
+
return (_jsxs("div", { className: "mb-2 rounded-lg border border-border bg-surface p-3", children: [_jsxs("div", { className: "mb-2 flex items-center gap-2 text-xs text-muted-foreground", children: [_jsx(Share2, { className: "h-3.5 w-3.5" }), _jsx("span", { className: "flex-1", children: "Shared to your brain" }), _jsx("button", { type: "button", onClick: onDismiss, title: "Dismiss", className: "rounded p-0.5 transition-colors hover:text-foreground", children: _jsx(X, { className: "h-3.5 w-3.5" }) })] }), _jsxs("div", { className: "flex gap-3", children: [thumbs.length > 0 && (_jsx("div", { className: "flex shrink-0 flex-wrap gap-1", children: thumbs.map((thumb) => (_jsx("img", { src: thumb.url, alt: thumb.name, className: "h-14 w-14 rounded-md border border-border object-cover" }, thumb.url))) })), _jsxs("div", { className: "min-w-0 flex-1 space-y-1 text-sm", children: [record.title && (_jsx("div", { className: "truncate font-medium text-foreground", children: record.title })), record.url && (_jsx("div", { className: "truncate text-xs text-muted-foreground", children: record.url })), record.text && (_jsx("div", { className: "line-clamp-3 text-xs text-muted-foreground", children: record.text })), otherFiles.map((file) => (_jsx("div", { className: "truncate text-xs text-muted-foreground", children: file.name }, file.name)))] })] }), _jsxs("div", { className: "mt-3 flex items-center gap-2", children: [_jsxs("button", { type: "button", onClick: onConfirm, disabled: busy, className: "flex items-center gap-2 rounded-lg bg-primary-fill px-3 py-1.5 text-sm font-medium text-primary-foreground disabled:opacity-60", children: [busy && _jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin" }), "Add to brain"] }), _jsx("button", { type: "button", onClick: onDismiss, disabled: busy, className: "rounded-lg border border-border px-3 py-1.5 text-sm text-muted-foreground disabled:opacity-60", children: "Dismiss" })] })] }));
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* Drives the intake and renders the head of the queue.
|
|
@@ -53,6 +53,6 @@ export function ShareIntake() {
|
|
|
53
53
|
const head = queue[0];
|
|
54
54
|
if (!head && !error)
|
|
55
55
|
return null;
|
|
56
|
-
return (_jsxs(_Fragment, { children: [error && (_jsxs("div", { className: "mb-2 flex items-start gap-2 rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2 text-[11px] text-destructive", children: [_jsx("div", { className: "flex-1", children: error }), _jsx("button", { type: "button", onClick: () => setError(null), title: "Dismiss", className: "shrink-0 rounded p-0.5 transition-colors hover:text-foreground", children: _jsx(X, { className: "h-3.5 w-3.5" }) })] })), notes.length > 0 && (_jsx("div", { className: "mb-2 space-y-0.5 rounded-lg border border-border bg-surface px-3 py-2 text-[11px] text-muted-foreground", children: notes.map((note, i) => (_jsx("div", { children: note }, i))) })), head && (_jsx(ShareCard, { record: head, busy: busy, onConfirm: () => void confirm(head), onDismiss: () => dismiss(head) })), queue.length > 1 && (_jsxs("div", { className: "mb-2 text-[11px] text-muted-foreground", children: [queue.length - 1, " more share(s) waiting."] }))] }));
|
|
56
|
+
return (_jsxs(_Fragment, { children: [error && (_jsxs("div", { className: "mb-2 flex items-start gap-2 rounded-lg border border-destructive/30 bg-destructive-fill/5 px-3 py-2 text-[11px] text-destructive", children: [_jsx("div", { className: "flex-1", children: error }), _jsx("button", { type: "button", onClick: () => setError(null), title: "Dismiss", className: "shrink-0 rounded p-0.5 transition-colors hover:text-foreground", children: _jsx(X, { className: "h-3.5 w-3.5" }) })] })), notes.length > 0 && (_jsx("div", { className: "mb-2 space-y-0.5 rounded-lg border border-border bg-surface px-3 py-2 text-[11px] text-muted-foreground", children: notes.map((note, i) => (_jsx("div", { children: note }, i))) })), head && (_jsx(ShareCard, { record: head, busy: busy, onConfirm: () => void confirm(head), onDismiss: () => dismiss(head) })), queue.length > 1 && (_jsxs("div", { className: "mb-2 text-[11px] text-muted-foreground", children: [queue.length - 1, " more share(s) waiting."] }))] }));
|
|
57
57
|
}
|
|
58
58
|
//# sourceMappingURL=share-card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"share-card.js","sourceRoot":"","sources":["../../../src/components/chat/share-card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D;;;;;;;;GAQG;AAEH,SAAS,aAAa,CAAC,KAAa;IAClC,MAAM,MAAM,GAAG,OAAO,CACpB,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EACxE,CAAC,KAAK,CAAC,CACR,CAAC;IACF,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAkC,EAAE,CAAC,CAAC;IAE1E,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACpC,GAAG,EAAE,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC;YAC9B,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC,CAAC,CAAC;QACJ,SAAS,CAAC,OAAO,CAAC,CAA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IAAI,CACP,KAAC,SAAS,IACR,MAAM,EAAE,IAAI,EACZ,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,EACnC,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAC9B,CACH,EAEA,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CACnB,eAAK,SAAS,EAAC,wCAAwC,aACpD,KAAK,CAAC,MAAM,GAAG,CAAC,+BACb,CACP,IACA,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -45,7 +45,7 @@ export function SubagentView({ spanId, onApproval, }) {
|
|
|
45
45
|
const duration = span.endedAt !== undefined ? formatDuration(span.endedAt - span.startedAt) : null;
|
|
46
46
|
const hasTranscript = events.some((e) => e.eventType.startsWith("transcript_"));
|
|
47
47
|
const approvalsHere = pendingApprovals.filter((t) => children.some((c) => c.spanId === t.id));
|
|
48
|
-
return (_jsxs("div", { className: "flex h-full flex-col", children: [_jsxs("div", { className: "flex items-center gap-2 border-b border-border-subtle px-4 py-3", children: [_jsx(BackButton, { onClick: popSubagentView }), _jsx(Bot, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "truncate text-sm font-medium", children: description ?? "Subagent" }), _jsxs("div", { className: "truncate text-[11px] text-muted-foreground", children: [subagentType ?? "agent", running ? " · running" : span.outcome ? ` · ${span.outcome}` : "", duration ? ` · ${duration}` : ""] })] }), running && (_jsx("span", { className: "inline-block h-2 w-2 animate-pulse rounded-full bg-primary" }))] }), _jsxs("div", { className: "flex-1 space-y-1.5 overflow-y-auto p-4", children: [approvalsHere.map((tool) => (_jsxs("div", { className: "rounded-lg border-2 border-primary/40 bg-primary/5 p-3 text-xs", children: [_jsxs("div", { className: "mb-2 font-medium", children: ["Approval needed: ", getToolLabel(tool.name)] }), onApproval && (_jsxs("div", { className: "flex gap-2", children: [_jsxs("button", { onClick: () => onApproval(tool.id, true), className: "flex items-center gap-1.5 rounded-lg bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground hover:brightness-110", children: [_jsx(Check, { className: "h-3 w-3" }), " Allow"] }), _jsxs("button", { onClick: () => onApproval(tool.id, false), className: "flex items-center gap-1.5 rounded-lg border border-destructive/30 px-4 py-1.5 text-xs font-medium text-destructive hover:bg-destructive/10", children: [_jsx(X, { className: "h-3 w-3" }), " Deny"] })] }))] }, tool.id))), timelineItems.length === 0 && (_jsx("p", { className: "text-xs text-muted-foreground", children: running ? "Waiting for the first step…" : "No recorded steps." })), timelineItems.map((item) => item.kind === "span" ? (_jsx(SpanRow, { span: item.span, onOpen: item.span.kind === "subagent"
|
|
48
|
+
return (_jsxs("div", { className: "flex h-full flex-col", children: [_jsxs("div", { className: "flex items-center gap-2 border-b border-border-subtle px-4 py-3", children: [_jsx(BackButton, { onClick: popSubagentView }), _jsx(Bot, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "truncate text-sm font-medium", children: description ?? "Subagent" }), _jsxs("div", { className: "truncate text-[11px] text-muted-foreground", children: [subagentType ?? "agent", running ? " · running" : span.outcome ? ` · ${span.outcome}` : "", duration ? ` · ${duration}` : ""] })] }), running && (_jsx("span", { className: "inline-block h-2 w-2 animate-pulse rounded-full bg-primary-mark" }))] }), _jsxs("div", { className: "flex-1 space-y-1.5 overflow-y-auto p-4", children: [approvalsHere.map((tool) => (_jsxs("div", { className: "rounded-lg border-2 border-primary/40 bg-primary-fill/5 p-3 text-xs", children: [_jsxs("div", { className: "mb-2 font-medium", children: ["Approval needed: ", getToolLabel(tool.name)] }), onApproval && (_jsxs("div", { className: "flex gap-2", children: [_jsxs("button", { onClick: () => onApproval(tool.id, true), className: "flex items-center gap-1.5 rounded-lg bg-primary-fill px-4 py-1.5 text-xs font-medium text-primary-foreground hover:brightness-110", children: [_jsx(Check, { className: "h-3 w-3" }), " Allow"] }), _jsxs("button", { onClick: () => onApproval(tool.id, false), className: "flex items-center gap-1.5 rounded-lg border border-destructive/30 px-4 py-1.5 text-xs font-medium text-destructive hover:bg-destructive-fill/10", children: [_jsx(X, { className: "h-3 w-3" }), " Deny"] })] }))] }, tool.id))), timelineItems.length === 0 && (_jsx("p", { className: "text-xs text-muted-foreground", children: running ? "Waiting for the first step…" : "No recorded steps." })), timelineItems.map((item) => item.kind === "span" ? (_jsx(SpanRow, { span: item.span, onOpen: item.span.kind === "subagent"
|
|
49
49
|
? () => pushSubagentView(item.span.spanId)
|
|
50
50
|
: undefined }, item.span.spanId)) : (_jsx(TranscriptRow, { event: item.event }, `${item.event.spanId}:${item.event.eventIndex}`))), !hasTranscript && children.length > 0 && (_jsx("p", { className: "pt-2 text-[11px] text-muted-foreground/60", children: "Activity only \u2014 this subagent's transcript was not captured." })), summary && !running && (_jsx("div", { className: "mt-2 rounded-lg border border-border-subtle bg-surface p-3 text-xs", children: summary }))] })] }));
|
|
51
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent-view.js","sourceRoot":"","sources":["../../../src/components/chat/subagent-view.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGrE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AACtG,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,4B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AAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-call-timeline.d.ts","sourceRoot":"","sources":["../../../src/components/chat/tool-call-timeline.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tool-call-timeline.d.ts","sourceRoot":"","sources":["../../../src/components/chat/tool-call-timeline.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAmC,KAAK,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AA4B5F,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,UAAU,EACV,IAAY,GACb,EAAE;IACD,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7E,+EAA+E;IAC/E,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,sCAsDA"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useBrainUiRoot } from "../../root-context.js";
|
|
2
3
|
import { useState, useEffect, useRef } from "react";
|
|
3
4
|
import { Check, X, Copy, Layers, ChevronDown, ChevronRight, AlertTriangle, FileText, } from "lucide-react";
|
|
4
|
-
import {
|
|
5
|
-
import { useChatStore } from "../../stores/chat-store.js";
|
|
5
|
+
import { offersAlwaysAllow, useChatStore } from "../../stores/chat-store.js";
|
|
6
6
|
import { cn } from "../../lib/utils.js";
|
|
7
7
|
import { motion, AnimatePresence } from "framer-motion";
|
|
8
|
-
import { getToolLabel, getTouchedFile, formatDuration, formatTokenCount } from "./tool-views.js";
|
|
8
|
+
import { effectOf, getToolLabel, getTouchedFile, formatDuration, formatTokenCount } from "./tool-views.js";
|
|
9
9
|
import { registerBuiltinRenderers, GENERIC_RENDERER } from "./renderers/index.js";
|
|
10
10
|
import { riskHints } from "./risk-hints.js";
|
|
11
11
|
import { useShallow } from "zustand/react/shallow";
|
|
12
|
+
import { focusAfterDecision, singleKey } from "../../lib/single-key.js";
|
|
13
|
+
import { KeyCap } from "../layout/key-cap.js";
|
|
12
14
|
import { useActivityStore, spanForTool, childSpans } from "../../stores/activity-store.js";
|
|
13
15
|
import { useUIStore } from "../../stores/ui-store.js";
|
|
14
16
|
import { useNow } from "../../hooks/use-now.js";
|
|
17
|
+
import { useFinePointer } from "../../hooks/use-fine-pointer.js";
|
|
15
18
|
import { SpanStatusDot } from "../activity/span-bits.js";
|
|
16
19
|
// Sessions that predate backend stamping (old servers, cleared stores) scope
|
|
17
20
|
// to the shipped default backend.
|
|
@@ -23,7 +26,8 @@ function useBackendId() {
|
|
|
23
26
|
}
|
|
24
27
|
export function ToolCallTimeline({ toolCalls, onApproval, live = false, }) {
|
|
25
28
|
// Resolution happens below during this render, before effects can run.
|
|
26
|
-
|
|
29
|
+
const root = useBrainUiRoot();
|
|
30
|
+
registerBuiltinRenderers(root.renderers);
|
|
27
31
|
// Collapse the whole run to a summary row once the turn is over. History
|
|
28
32
|
// messages mount collapsed; a live timeline collapses when streaming ends.
|
|
29
33
|
const [collapsed, setCollapsed] = useState(!live);
|
|
@@ -44,9 +48,10 @@ export function ToolCallTimeline({ toolCalls, onApproval, live = false, }) {
|
|
|
44
48
|
return (_jsxs("div", { children: [!live && !hasPending && (_jsxs("button", { type: "button", onClick: () => setCollapsed(true), className: "mb-1 flex items-center gap-1.5 text-[11px] text-muted-foreground/50 transition-colors hover:text-muted-foreground", children: [_jsx(ChevronDown, { className: "h-3 w-3" }), "Hide steps"] })), _jsx("div", { className: "relative ml-1 border-l-2 border-border/40 pl-4 space-y-1.5", children: toolCalls.map((tool) => (_jsx(ToolCallEntry, { toolCall: tool, backendId: backendId, onApproval: onApproval }, tool.id))) })] }));
|
|
45
49
|
}
|
|
46
50
|
function TimelineSummaryRow({ toolCalls, backendId, onExpand, }) {
|
|
51
|
+
const root = useBrainUiRoot();
|
|
47
52
|
const steps = toolCalls.length;
|
|
48
53
|
const files = new Set(toolCalls
|
|
49
|
-
.map((t) =>
|
|
54
|
+
.map((t) => root.renderers.resolve(t, backendId)?.touchedFile?.(t) ?? getTouchedFile(t))
|
|
50
55
|
.filter(Boolean)).size;
|
|
51
56
|
const errors = toolCalls.filter((t) => t.isError).length;
|
|
52
57
|
const started = Math.min(...toolCalls.map((t) => t.startedAt ?? Infinity));
|
|
@@ -57,6 +62,7 @@ function TimelineSummaryRow({ toolCalls, backendId, onExpand, }) {
|
|
|
57
62
|
return (_jsxs("button", { type: "button", onClick: onExpand, className: "flex items-center gap-2 rounded-md px-2 py-1.5 text-xs text-muted-foreground/70 transition-colors hover:text-foreground", children: [_jsx(Layers, { className: "h-3.5 w-3.5 shrink-0" }), _jsxs("span", { className: "font-[family-name:var(--font-mono)]", children: [steps, " step", steps === 1 ? "" : "s", files > 0 && ` · ${files} file${files === 1 ? "" : "s"} touched`, duration && ` · ${duration}`] }), errors > 0 && (_jsxs("span", { className: "font-[family-name:var(--font-mono)] text-destructive", children: ["\u00B7 ", errors, " failed"] })), _jsx(ChevronRight, { className: "h-3 w-3 shrink-0" })] }));
|
|
58
63
|
}
|
|
59
64
|
function ToolCallEntry({ toolCall, backendId, onApproval, }) {
|
|
65
|
+
const root = useBrainUiRoot();
|
|
60
66
|
const [expanded, setExpanded] = useState(toolCall.status === "pending_approval");
|
|
61
67
|
const prevStatus = useRef(toolCall.status);
|
|
62
68
|
// One clock for live and reloaded views: when the activity stream carries
|
|
@@ -74,12 +80,37 @@ function ToolCallEntry({ toolCall, backendId, onApproval, }) {
|
|
|
74
80
|
: toolCall;
|
|
75
81
|
// Resolve the renderer for this tool (backend-scoped exact -> global exact ->
|
|
76
82
|
// shape-sniffing predicate). Falls back to the generic renderer.
|
|
77
|
-
const renderer =
|
|
83
|
+
const renderer = root.renderers.resolve(toolCall, backendId) ?? GENERIC_RENDERER;
|
|
78
84
|
const Icon = renderer.icon ?? FileText;
|
|
79
85
|
const label = typeof renderer.label === "function"
|
|
80
86
|
? renderer.label(toolCall)
|
|
81
87
|
: renderer.label ?? getToolLabel(toolCall.name);
|
|
82
88
|
const isPending = toolCall.status === "pending_approval";
|
|
89
|
+
const keys = useUIStore((s) => s.singleKeyShortcuts);
|
|
90
|
+
// The caps are printed only while a fine pointer is present (#86); the letters
|
|
91
|
+
// themselves follow the Settings switch alone, so a paired keyboard works
|
|
92
|
+
// even if the pointer query stays coarse.
|
|
93
|
+
const finePointer = useFinePointer();
|
|
94
|
+
const printKeys = keys && finePointer;
|
|
95
|
+
/**
|
|
96
|
+
* A decision hands focus on before the card goes (D36): the next pending
|
|
97
|
+
* approval in the transcript, else the composer — the thing the reader
|
|
98
|
+
* continues with, since a chat has no empty-state heading to land on.
|
|
99
|
+
*/
|
|
100
|
+
function decide(card, approved, always) {
|
|
101
|
+
if (card)
|
|
102
|
+
focusAfterDecision(card, "[data-approval-card]", "textarea[data-composer]");
|
|
103
|
+
onApproval(toolCall.id, approved, always);
|
|
104
|
+
}
|
|
105
|
+
function onCardKeyDown(event) {
|
|
106
|
+
if (!keys)
|
|
107
|
+
return;
|
|
108
|
+
const key = singleKey(event);
|
|
109
|
+
if (key !== "a" && key !== "d")
|
|
110
|
+
return;
|
|
111
|
+
event.preventDefault();
|
|
112
|
+
decide(event.currentTarget, key === "a");
|
|
113
|
+
}
|
|
83
114
|
const summary = renderer.summary?.(timed) ?? null;
|
|
84
115
|
const meta = renderer.meta?.(timed) ?? null;
|
|
85
116
|
const Input = renderer.Input;
|
|
@@ -95,15 +126,15 @@ function ToolCallEntry({ toolCall, backendId, onApproval, }) {
|
|
|
95
126
|
}
|
|
96
127
|
prevStatus.current = toolCall.status;
|
|
97
128
|
}, [toolCall.status]);
|
|
98
|
-
return (_jsxs("div", { className: "relative", children: [_jsx("div", { className: cn("absolute -left-[21px] top-2 h-2.5 w-2.5 rounded-full border-2 border-background", toolCall.status === "streaming" && "bg-primary animate-pulse", toolCall.status === "pending_approval" &&
|
|
99
|
-
"bg-primary", toolCall.status === "approved" && "bg-accent", toolCall.status === "denied" && "bg-destructive", toolCall.status === "complete" &&
|
|
100
|
-
(toolCall.isError ? "bg-destructive" : "bg-accent"), !["streaming", "pending_approval", "approved", "denied", "complete"].includes(toolCall.status) && "bg-muted-foreground"), style: toolCall.status === "pending_approval"
|
|
129
|
+
return (_jsxs("div", { className: "relative", children: [_jsx("div", { className: cn("absolute -left-[21px] top-2 h-2.5 w-2.5 rounded-full border-2 border-background", toolCall.status === "streaming" && "bg-primary-mark animate-pulse", toolCall.status === "pending_approval" &&
|
|
130
|
+
"bg-primary-mark", toolCall.status === "approved" && "bg-accent-mark", toolCall.status === "denied" && "bg-destructive-mark", toolCall.status === "complete" &&
|
|
131
|
+
(toolCall.isError ? "bg-destructive-mark" : "bg-accent-mark"), !["streaming", "pending_approval", "approved", "denied", "complete"].includes(toolCall.status) && "bg-muted-foreground"), style: toolCall.status === "pending_approval"
|
|
101
132
|
? { animation: "breathe 2s ease-in-out infinite" }
|
|
102
133
|
: undefined }), _jsxs("button", { onClick: () => setExpanded(!expanded), className: cn("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-xs transition-colors", toolCall.isError
|
|
103
134
|
? "text-destructive/80 hover:text-destructive"
|
|
104
135
|
: "text-muted-foreground hover:text-foreground"), children: [_jsx(Icon, { className: "h-3.5 w-3.5 shrink-0" }), _jsx("span", { className: "font-[family-name:var(--font-mono)] font-medium", children: label }), summary && (_jsx("span", { className: cn("truncate", toolCall.isError ? "text-destructive/60" : "text-muted-foreground/70"), children: summary })), _jsxs("span", { className: "ml-auto flex shrink-0 items-center gap-2", children: [meta && (_jsx("span", { className: "font-[family-name:var(--font-mono)] text-[10px] text-muted-foreground/50", children: meta })), _jsx(StatusIndicator, { status: toolCall.status, isError: toolCall.isError })] })] }), renderer.subagentRows && _jsx(SubagentEntryRows, { agentToolUseId: toolCall.id }), _jsx(AnimatePresence, { children: expanded && (_jsx(motion.div, { initial: { height: 0, opacity: 0 }, animate: { height: "auto", opacity: 1 }, exit: { height: 0, opacity: 0 }, transition: { duration: 0.2, ease: "easeOut" }, className: "overflow-hidden", children: _jsxs("div", { className: cn("mt-1 rounded-lg p-3 space-y-2", isPending
|
|
105
|
-
? "border-2 border-primary/40 bg-primary/5"
|
|
106
|
-
: "border border-border-subtle bg-surface"), children: [Input && _jsx(Input, { tool: toolCall }), isPending && (_jsx(RiskHints, { toolCall: toolCall, semantics: renderer.semantics })), isPending && (_jsxs("div", { className: "flex flex-wrap gap-2", children: [_jsxs("button", { onClick: () =>
|
|
136
|
+
? "border-2 border-primary/40 bg-primary-fill/5"
|
|
137
|
+
: "border border-border-subtle bg-surface"), children: [Input && _jsx(Input, { tool: toolCall }), isPending && effectOf(toolCall) && (_jsx("p", { className: "text-[11px] text-muted-foreground", children: effectOf(toolCall) })), isPending && (_jsx(RiskHints, { toolCall: toolCall, semantics: renderer.semantics })), isPending && (_jsxs("div", { "data-approval-card": "", role: "group", "aria-label": `Approval: ${label}`, tabIndex: 0, onKeyDown: onCardKeyDown, className: "flex flex-wrap gap-2 rounded-md outline-none focus-visible:ring-2 focus-visible:ring-primary/50", children: [_jsxs("button", { onClick: (e) => decide(e.currentTarget.closest("[data-approval-card]"), true), className: "flex items-center gap-1.5 rounded-lg bg-primary-fill px-4 py-1.5 text-xs font-medium text-primary-foreground transition-colors hover:brightness-110", children: [_jsx(Check, { className: "h-3 w-3" }), "Allow", printKeys && _jsx(KeyCap, { children: "a" })] }), offersAlwaysAllow(toolCall) && (_jsxs("button", { onClick: (e) => decide(e.currentTarget.closest("[data-approval-card]"), true, true), title: `Allow ${toolCall.name} without asking from now on (revocable in Settings → Models)`, className: "flex items-center gap-1.5 rounded-lg border border-primary/40 px-4 py-1.5 text-xs font-medium text-primary transition-colors hover:bg-primary-fill/10", children: [_jsx(Check, { className: "h-3 w-3" }), "Always allow"] })), _jsxs("button", { onClick: (e) => decide(e.currentTarget.closest("[data-approval-card]"), false), className: "flex items-center gap-1.5 rounded-lg border border-destructive/30 px-4 py-1.5 text-xs font-medium text-destructive transition-colors hover:bg-destructive-fill/10", children: [_jsx(X, { className: "h-3 w-3" }), "Deny", printKeys && _jsx(KeyCap, { children: "d" })] })] })), toolCall.output && Output && (_jsxs("div", { className: "relative", children: [_jsx("button", { onClick: () => navigator.clipboard.writeText(toolCall.output), className: "absolute right-1 top-1 z-10 rounded p-1 text-muted-foreground transition-colors hover:bg-surface-raised hover:text-foreground", title: "Copy output", children: _jsx(Copy, { className: "h-3 w-3" }) }), _jsx(Output, { tool: toolCall })] }))] }) })) })] }));
|
|
107
138
|
}
|
|
108
139
|
/**
|
|
109
140
|
* Compact live status of one Agent fan-out: what the subagent is, its state,
|
|
@@ -127,14 +158,14 @@ function RiskHints({ toolCall, semantics, }) {
|
|
|
127
158
|
const hints = riskHints(toolCall, semantics);
|
|
128
159
|
if (hints.length === 0)
|
|
129
160
|
return null;
|
|
130
|
-
return (_jsx("div", { className: "space-y-0.5 text-[11px] text-
|
|
161
|
+
return (_jsx("div", { className: "space-y-0.5 text-[11px] text-primary", children: hints.map((hint) => (_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(AlertTriangle, { className: "h-3 w-3 shrink-0" }), _jsx("span", { children: hint })] }, hint))) }));
|
|
131
162
|
}
|
|
132
163
|
function StatusIndicator({ status, isError, }) {
|
|
133
164
|
switch (status) {
|
|
134
165
|
case "streaming":
|
|
135
|
-
return (_jsx("span", { className: "inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-primary" }));
|
|
166
|
+
return (_jsx("span", { className: "inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-primary-mark" }));
|
|
136
167
|
case "pending_approval":
|
|
137
|
-
return (_jsx("span", { className: "rounded bg-primary/20 px-1.5 py-0.5 text-[10px] font-medium text-primary", children: "Approval needed" }));
|
|
168
|
+
return (_jsx("span", { className: "rounded bg-primary-fill/20 px-1.5 py-0.5 text-[10px] font-medium text-primary", children: "Approval needed" }));
|
|
138
169
|
case "approved":
|
|
139
170
|
return _jsx(Check, { className: "h-3 w-3 text-accent" });
|
|
140
171
|
case "denied":
|