@schlessera/brain-ui-react 0.35.0 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -4
- package/dist/components/activity/activity-page.d.ts +17 -5
- package/dist/components/activity/activity-page.d.ts.map +1 -1
- package/dist/components/activity/activity-page.js +144 -50
- package/dist/components/activity/activity-page.js.map +1 -1
- package/dist/components/activity/activity-run-detail.d.ts +16 -1
- package/dist/components/activity/activity-run-detail.d.ts.map +1 -1
- package/dist/components/activity/activity-run-detail.js +47 -4
- package/dist/components/activity/activity-run-detail.js.map +1 -1
- package/dist/components/activity/activity-run-list.d.ts +7 -1
- package/dist/components/activity/activity-run-list.d.ts.map +1 -1
- package/dist/components/activity/activity-run-list.js +16 -8
- package/dist/components/activity/activity-run-list.js.map +1 -1
- package/dist/components/activity/activity-views.d.ts +63 -0
- package/dist/components/activity/activity-views.d.ts.map +1 -0
- package/dist/components/activity/activity-views.js +52 -0
- package/dist/components/activity/activity-views.js.map +1 -0
- package/dist/components/activity/approval-card.d.ts +11 -0
- package/dist/components/activity/approval-card.d.ts.map +1 -0
- package/dist/components/activity/approval-card.js +46 -0
- package/dist/components/activity/approval-card.js.map +1 -0
- package/dist/components/activity/digest-card.d.ts +3 -0
- package/dist/components/activity/digest-card.d.ts.map +1 -1
- package/dist/components/activity/digest-card.js +20 -16
- package/dist/components/activity/digest-card.js.map +1 -1
- package/dist/components/activity/digest-summary.d.ts +19 -0
- package/dist/components/activity/digest-summary.d.ts.map +1 -0
- package/dist/components/activity/digest-summary.js +20 -0
- package/dist/components/activity/digest-summary.js.map +1 -0
- package/dist/components/activity/push-switch.d.ts +25 -0
- package/dist/components/activity/push-switch.d.ts.map +1 -0
- package/dist/components/activity/push-switch.js +14 -0
- package/dist/components/activity/push-switch.js.map +1 -0
- package/dist/components/activity/push-toggle.d.ts +7 -0
- package/dist/components/activity/push-toggle.d.ts.map +1 -1
- package/dist/components/activity/push-toggle.js +72 -47
- package/dist/components/activity/push-toggle.js.map +1 -1
- package/dist/components/activity/span-bits.d.ts.map +1 -1
- package/dist/components/activity/span-bits.js +9 -7
- package/dist/components/activity/span-bits.js.map +1 -1
- package/dist/components/chat/ask-user-card.d.ts +76 -3
- package/dist/components/chat/ask-user-card.d.ts.map +1 -1
- package/dist/components/chat/ask-user-card.js +208 -149
- package/dist/components/chat/ask-user-card.js.map +1 -1
- package/dist/components/chat/ask-user-typed.d.ts +42 -0
- package/dist/components/chat/ask-user-typed.d.ts.map +1 -0
- package/dist/components/chat/ask-user-typed.js +60 -0
- package/dist/components/chat/ask-user-typed.js.map +1 -0
- package/dist/components/chat/brain-markdown-links.d.ts +2 -1
- package/dist/components/chat/brain-markdown-links.d.ts.map +1 -1
- package/dist/components/chat/brain-markdown-links.js +3 -4
- package/dist/components/chat/brain-markdown-links.js.map +1 -1
- package/dist/components/chat/brain-markdown.d.ts.map +1 -1
- package/dist/components/chat/brain-markdown.js +4 -2
- package/dist/components/chat/brain-markdown.js.map +1 -1
- package/dist/components/chat/chat-page.d.ts.map +1 -1
- package/dist/components/chat/chat-page.js +24 -9
- package/dist/components/chat/chat-page.js.map +1 -1
- package/dist/components/chat/composer-view.d.ts +75 -0
- package/dist/components/chat/composer-view.d.ts.map +1 -0
- package/dist/components/chat/composer-view.js +31 -0
- package/dist/components/chat/composer-view.js.map +1 -0
- package/dist/components/chat/composer.d.ts +4 -0
- package/dist/components/chat/composer.d.ts.map +1 -1
- package/dist/components/chat/composer.js +76 -59
- package/dist/components/chat/composer.js.map +1 -1
- package/dist/components/chat/markdown-content.d.ts +16 -1
- package/dist/components/chat/markdown-content.d.ts.map +1 -1
- package/dist/components/chat/markdown-content.js +47 -3
- package/dist/components/chat/markdown-content.js.map +1 -1
- package/dist/components/chat/mermaid-block.d.ts +4 -0
- package/dist/components/chat/mermaid-block.d.ts.map +1 -1
- package/dist/components/chat/mermaid-block.js +13 -5
- package/dist/components/chat/mermaid-block.js.map +1 -1
- package/dist/components/chat/mermaid-share.d.ts +2 -1
- package/dist/components/chat/mermaid-share.d.ts.map +1 -1
- package/dist/components/chat/mermaid-share.js +7 -8
- package/dist/components/chat/mermaid-share.js.map +1 -1
- package/dist/components/chat/mermaid-viewer.d.ts.map +1 -1
- package/dist/components/chat/mermaid-viewer.js +3 -1
- package/dist/components/chat/mermaid-viewer.js.map +1 -1
- package/dist/components/chat/message-bubble.d.ts +8 -1
- package/dist/components/chat/message-bubble.d.ts.map +1 -1
- package/dist/components/chat/message-bubble.js +53 -24
- package/dist/components/chat/message-bubble.js.map +1 -1
- package/dist/components/chat/message-share.d.ts +2 -1
- package/dist/components/chat/message-share.d.ts.map +1 -1
- package/dist/components/chat/message-share.js +6 -7
- package/dist/components/chat/message-share.js.map +1 -1
- package/dist/components/chat/renderers/bind.d.ts +39 -0
- package/dist/components/chat/renderers/bind.d.ts.map +1 -0
- package/dist/components/chat/renderers/bind.js +43 -0
- package/dist/components/chat/renderers/bind.js.map +1 -0
- package/dist/components/chat/renderers/brain-ui-tools.d.ts +3 -0
- package/dist/components/chat/renderers/brain-ui-tools.d.ts.map +1 -0
- package/dist/components/chat/renderers/brain-ui-tools.js +41 -0
- package/dist/components/chat/renderers/brain-ui-tools.js.map +1 -0
- package/dist/components/chat/renderers/claude-tools.d.ts.map +1 -1
- package/dist/components/chat/renderers/claude-tools.js +3 -2
- package/dist/components/chat/renderers/claude-tools.js.map +1 -1
- package/dist/components/chat/renderers/index.d.ts +10 -2
- package/dist/components/chat/renderers/index.d.ts.map +1 -1
- package/dist/components/chat/renderers/index.js +15 -10
- package/dist/components/chat/renderers/index.js.map +1 -1
- package/dist/components/chat/session-drawer.d.ts +4 -0
- package/dist/components/chat/session-drawer.d.ts.map +1 -1
- package/dist/components/chat/session-drawer.js +32 -32
- package/dist/components/chat/session-drawer.js.map +1 -1
- package/dist/components/chat/session-list.d.ts +41 -0
- package/dist/components/chat/session-list.d.ts.map +1 -0
- package/dist/components/chat/session-list.js +10 -0
- package/dist/components/chat/session-list.js.map +1 -0
- package/dist/components/chat/share-block.d.ts.map +1 -1
- package/dist/components/chat/share-block.js +12 -11
- package/dist/components/chat/share-block.js.map +1 -1
- package/dist/components/chat/share-card.js +2 -2
- package/dist/components/chat/share-card.js.map +1 -1
- package/dist/components/chat/subagent-view.js +1 -1
- package/dist/components/chat/subagent-view.js.map +1 -1
- package/dist/components/chat/tool-call-timeline.d.ts.map +1 -1
- package/dist/components/chat/tool-call-timeline.js +37 -12
- package/dist/components/chat/tool-call-timeline.js.map +1 -1
- package/dist/components/chat/tool-cards/block-card.d.ts +28 -0
- package/dist/components/chat/tool-cards/block-card.d.ts.map +1 -0
- package/dist/components/chat/tool-cards/block-card.js +103 -0
- package/dist/components/chat/tool-cards/block-card.js.map +1 -0
- package/dist/components/chat/tool-cards/image-mask-card.d.ts +70 -0
- package/dist/components/chat/tool-cards/image-mask-card.d.ts.map +1 -0
- package/dist/components/chat/tool-cards/image-mask-card.js +142 -0
- package/dist/components/chat/tool-cards/image-mask-card.js.map +1 -0
- package/dist/components/chat/tool-cards/location-card.d.ts +45 -0
- package/dist/components/chat/tool-cards/location-card.d.ts.map +1 -0
- package/dist/components/chat/tool-cards/location-card.js +128 -0
- package/dist/components/chat/tool-cards/location-card.js.map +1 -0
- package/dist/components/chat/tool-views.d.ts +13 -2
- package/dist/components/chat/tool-views.d.ts.map +1 -1
- package/dist/components/chat/tool-views.js +20 -22
- package/dist/components/chat/tool-views.js.map +1 -1
- package/dist/components/chat/transcript-turn.d.ts +45 -0
- package/dist/components/chat/transcript-turn.d.ts.map +1 -0
- package/dist/components/chat/transcript-turn.js +25 -0
- package/dist/components/chat/transcript-turn.js.map +1 -0
- package/dist/components/chat/use-chat-commands.d.ts.map +1 -1
- package/dist/components/chat/use-chat-commands.js +13 -16
- package/dist/components/chat/use-chat-commands.js.map +1 -1
- package/dist/components/chat/welcome-state.d.ts +7 -0
- package/dist/components/chat/welcome-state.d.ts.map +1 -1
- package/dist/components/chat/welcome-state.js +13 -5
- package/dist/components/chat/welcome-state.js.map +1 -1
- package/dist/components/connectivity/connection-gate.d.ts.map +1 -1
- package/dist/components/connectivity/connection-gate.js +27 -21
- package/dist/components/connectivity/connection-gate.js.map +1 -1
- package/dist/components/connectivity/login-form.d.ts +31 -0
- package/dist/components/connectivity/login-form.d.ts.map +1 -0
- package/dist/components/connectivity/login-form.js +19 -0
- package/dist/components/connectivity/login-form.js.map +1 -0
- package/dist/components/connectivity/login-screen.d.ts +5 -2
- package/dist/components/connectivity/login-screen.d.ts.map +1 -1
- package/dist/components/connectivity/login-screen.js +41 -31
- package/dist/components/connectivity/login-screen.js.map +1 -1
- package/dist/components/dev/share-harness.js +1 -1
- package/dist/components/dev/share-harness.js.map +1 -1
- package/dist/components/files/file-panel.d.ts +1 -1
- package/dist/components/files/file-panel.d.ts.map +1 -1
- package/dist/components/files/file-panel.js +74 -0
- package/dist/components/files/file-panel.js.map +1 -1
- package/dist/components/files/file-tree-view.d.ts +45 -0
- package/dist/components/files/file-tree-view.d.ts.map +1 -0
- package/dist/components/files/file-tree-view.js +51 -0
- package/dist/components/files/file-tree-view.js.map +1 -0
- package/dist/components/files/file-tree.d.ts +6 -0
- package/dist/components/files/file-tree.d.ts.map +1 -1
- package/dist/components/files/file-tree.js +39 -43
- package/dist/components/files/file-tree.js.map +1 -1
- package/dist/components/files/file-viewer-binary.d.ts.map +1 -1
- package/dist/components/files/file-viewer-binary.js +3 -2
- package/dist/components/files/file-viewer-binary.js.map +1 -1
- package/dist/components/files/file-viewer-frame.d.ts +36 -0
- package/dist/components/files/file-viewer-frame.d.ts.map +1 -0
- package/dist/components/files/file-viewer-frame.js +26 -0
- package/dist/components/files/file-viewer-frame.js.map +1 -0
- package/dist/components/files/file-viewer.d.ts +5 -0
- package/dist/components/files/file-viewer.d.ts.map +1 -1
- package/dist/components/files/file-viewer.js +26 -32
- package/dist/components/files/file-viewer.js.map +1 -1
- package/dist/components/files/frontmatter-chips.d.ts +18 -0
- package/dist/components/files/frontmatter-chips.d.ts.map +1 -0
- package/dist/components/files/frontmatter-chips.js +11 -0
- package/dist/components/files/frontmatter-chips.js.map +1 -0
- package/dist/components/files/frontmatter-panel.d.ts +5 -1
- package/dist/components/files/frontmatter-panel.d.ts.map +1 -1
- package/dist/components/files/frontmatter-panel.js +7 -6
- package/dist/components/files/frontmatter-panel.js.map +1 -1
- package/dist/components/files/staleness.d.ts +18 -0
- package/dist/components/files/staleness.d.ts.map +1 -0
- package/dist/components/files/staleness.js +27 -0
- package/dist/components/files/staleness.js.map +1 -0
- package/dist/components/graph/graph-canvas.d.ts.map +1 -1
- package/dist/components/graph/graph-canvas.js +24 -1
- package/dist/components/graph/graph-canvas.js.map +1 -1
- package/dist/components/graph/graph-controls-column.d.ts +14 -0
- package/dist/components/graph/graph-controls-column.d.ts.map +1 -0
- package/dist/components/graph/graph-controls-column.js +44 -0
- package/dist/components/graph/graph-controls-column.js.map +1 -0
- package/dist/components/graph/graph-controls.d.ts +20 -5
- package/dist/components/graph/graph-controls.d.ts.map +1 -1
- package/dist/components/graph/graph-controls.js +58 -37
- package/dist/components/graph/graph-controls.js.map +1 -1
- package/dist/components/graph/graph-form.d.ts +82 -0
- package/dist/components/graph/graph-form.d.ts.map +1 -0
- package/dist/components/graph/graph-form.js +69 -0
- package/dist/components/graph/graph-form.js.map +1 -0
- package/dist/components/graph/graph-maintenance.d.ts.map +1 -1
- package/dist/components/graph/graph-maintenance.js +6 -10
- package/dist/components/graph/graph-maintenance.js.map +1 -1
- package/dist/components/graph/graph-node-rail.d.ts +13 -0
- package/dist/components/graph/graph-node-rail.d.ts.map +1 -0
- package/dist/components/graph/graph-node-rail.js +92 -0
- package/dist/components/graph/graph-node-rail.js.map +1 -0
- package/dist/components/graph/graph-page.d.ts +7 -0
- package/dist/components/graph/graph-page.d.ts.map +1 -1
- package/dist/components/graph/graph-page.js +102 -12
- package/dist/components/graph/graph-page.js.map +1 -1
- package/dist/components/graph/graph-scene.d.ts.map +1 -1
- package/dist/components/graph/graph-scene.js +100 -24
- package/dist/components/graph/graph-scene.js.map +1 -1
- package/dist/components/graph/lib/graph-helpers.d.ts +42 -12
- package/dist/components/graph/lib/graph-helpers.d.ts.map +1 -1
- package/dist/components/graph/lib/graph-helpers.js +33 -41
- package/dist/components/graph/lib/graph-helpers.js.map +1 -1
- package/dist/components/graph/node-card.d.ts +28 -0
- package/dist/components/graph/node-card.d.ts.map +1 -0
- package/dist/components/graph/node-card.js +7 -0
- package/dist/components/graph/node-card.js.map +1 -0
- package/dist/components/graph/node-popover.d.ts +6 -2
- package/dist/components/graph/node-popover.d.ts.map +1 -1
- package/dist/components/graph/node-popover.js +13 -31
- package/dist/components/graph/node-popover.js.map +1 -1
- package/dist/components/graph/use-graph-theme.d.ts +32 -4
- package/dist/components/graph/use-graph-theme.d.ts.map +1 -1
- package/dist/components/graph/use-graph-theme.js +44 -32
- package/dist/components/graph/use-graph-theme.js.map +1 -1
- package/dist/components/graph/use-node-actions.d.ts +26 -0
- package/dist/components/graph/use-node-actions.d.ts.map +1 -0
- package/dist/components/graph/use-node-actions.js +54 -0
- package/dist/components/graph/use-node-actions.js.map +1 -0
- package/dist/components/images/image-share.d.ts +2 -1
- package/dist/components/images/image-share.d.ts.map +1 -1
- package/dist/components/images/image-share.js +3 -3
- package/dist/components/images/image-share.js.map +1 -1
- package/dist/components/images/image-viewer.d.ts.map +1 -1
- package/dist/components/images/image-viewer.js +3 -1
- package/dist/components/images/image-viewer.js.map +1 -1
- package/dist/components/images/mask-editor.d.ts.map +1 -1
- package/dist/components/images/mask-editor.js +7 -5
- package/dist/components/images/mask-editor.js.map +1 -1
- package/dist/components/layout/app-shell.d.ts.map +1 -1
- package/dist/components/layout/app-shell.js +4 -1
- package/dist/components/layout/app-shell.js.map +1 -1
- package/dist/components/layout/desktop-palette.d.ts +23 -0
- package/dist/components/layout/desktop-palette.d.ts.map +1 -0
- package/dist/components/layout/desktop-palette.js +132 -0
- package/dist/components/layout/desktop-palette.js.map +1 -0
- package/dist/components/layout/key-cap.d.ts +9 -0
- package/dist/components/layout/key-cap.d.ts.map +1 -0
- package/dist/components/layout/key-cap.js +10 -0
- package/dist/components/layout/key-cap.js.map +1 -0
- package/dist/components/layout/mobile-tab-bar.d.ts +13 -0
- package/dist/components/layout/mobile-tab-bar.d.ts.map +1 -1
- package/dist/components/layout/mobile-tab-bar.js +58 -47
- package/dist/components/layout/mobile-tab-bar.js.map +1 -1
- package/dist/components/layout/shortcut-switch.d.ts +13 -0
- package/dist/components/layout/shortcut-switch.d.ts.map +1 -0
- package/dist/components/layout/shortcut-switch.js +22 -0
- package/dist/components/layout/shortcut-switch.js.map +1 -0
- package/dist/components/layout/side-rail.d.ts +24 -0
- package/dist/components/layout/side-rail.d.ts.map +1 -1
- package/dist/components/layout/side-rail.js +65 -27
- package/dist/components/layout/side-rail.js.map +1 -1
- package/dist/components/layout/slide-panel.d.ts +12 -2
- package/dist/components/layout/slide-panel.d.ts.map +1 -1
- package/dist/components/layout/slide-panel.js +11 -2
- package/dist/components/layout/slide-panel.js.map +1 -1
- package/dist/components/layout/theme.d.ts +22 -0
- package/dist/components/layout/theme.d.ts.map +1 -0
- package/dist/components/layout/theme.js +44 -0
- package/dist/components/layout/theme.js.map +1 -0
- package/dist/components/quick-actions/add-form.d.ts +44 -0
- package/dist/components/quick-actions/add-form.d.ts.map +1 -0
- package/dist/components/quick-actions/add-form.js +30 -0
- package/dist/components/quick-actions/add-form.js.map +1 -0
- package/dist/components/quick-actions/add-modal.d.ts +7 -0
- package/dist/components/quick-actions/add-modal.d.ts.map +1 -1
- package/dist/components/quick-actions/add-modal.js +23 -20
- package/dist/components/quick-actions/add-modal.js.map +1 -1
- package/dist/components/quick-actions/search-modal.d.ts.map +1 -1
- package/dist/components/quick-actions/search-modal.js +4 -3
- package/dist/components/quick-actions/search-modal.js.map +1 -1
- package/dist/components/quick-actions/streaming-modal.d.ts +6 -0
- package/dist/components/quick-actions/streaming-modal.d.ts.map +1 -1
- package/dist/components/quick-actions/streaming-modal.js +39 -17
- package/dist/components/quick-actions/streaming-modal.js.map +1 -1
- package/dist/components/quick-actions/streaming-output.d.ts +38 -0
- package/dist/components/quick-actions/streaming-output.d.ts.map +1 -0
- package/dist/components/quick-actions/streaming-output.js +22 -0
- package/dist/components/quick-actions/streaming-output.js.map +1 -0
- package/dist/components/quick-actions/whatsup-modal.d.ts +5 -0
- package/dist/components/quick-actions/whatsup-modal.d.ts.map +1 -1
- package/dist/components/quick-actions/whatsup-modal.js +36 -10
- package/dist/components/quick-actions/whatsup-modal.js.map +1 -1
- package/dist/components/settings/devices-agents-tab.d.ts +6 -1
- package/dist/components/settings/devices-agents-tab.d.ts.map +1 -1
- package/dist/components/settings/devices-agents-tab.js +55 -20
- package/dist/components/settings/devices-agents-tab.js.map +1 -1
- package/dist/components/settings/models-list.d.ts +39 -0
- package/dist/components/settings/models-list.d.ts.map +1 -0
- package/dist/components/settings/models-list.js +72 -0
- package/dist/components/settings/models-list.js.map +1 -0
- package/dist/components/settings/models-tab.d.ts +4 -0
- package/dist/components/settings/models-tab.d.ts.map +1 -1
- package/dist/components/settings/models-tab.js +52 -102
- package/dist/components/settings/models-tab.js.map +1 -1
- package/dist/components/settings/one-time-agent-credential.js +1 -1
- package/dist/components/settings/one-time-agent-credential.js.map +1 -1
- package/dist/components/settings/passkey-list.d.ts +35 -0
- package/dist/components/settings/passkey-list.d.ts.map +1 -0
- package/dist/components/settings/passkey-list.js +34 -0
- package/dist/components/settings/passkey-list.js.map +1 -0
- package/dist/components/settings/passkey-tab.d.ts +3 -0
- package/dist/components/settings/passkey-tab.d.ts.map +1 -1
- package/dist/components/settings/passkey-tab.js +53 -45
- package/dist/components/settings/passkey-tab.js.map +1 -1
- package/dist/components/settings/pi-accounts-list.d.ts +27 -0
- package/dist/components/settings/pi-accounts-list.d.ts.map +1 -0
- package/dist/components/settings/pi-accounts-list.js +15 -0
- package/dist/components/settings/pi-accounts-list.js.map +1 -0
- package/dist/components/settings/pi-accounts.d.ts +3 -0
- package/dist/components/settings/pi-accounts.d.ts.map +1 -1
- package/dist/components/settings/pi-accounts.js +73 -55
- package/dist/components/settings/pi-accounts.js.map +1 -1
- package/dist/components/settings/principal-list.d.ts +37 -0
- package/dist/components/settings/principal-list.d.ts.map +1 -0
- package/dist/components/settings/principal-list.js +18 -0
- package/dist/components/settings/principal-list.js.map +1 -0
- package/dist/components/settings/settings-panel.d.ts +10 -3
- package/dist/components/settings/settings-panel.d.ts.map +1 -1
- package/dist/components/settings/settings-panel.js +69 -8
- package/dist/components/settings/settings-panel.js.map +1 -1
- package/dist/components/settings/skills-list.d.ts +53 -0
- package/dist/components/settings/skills-list.d.ts.map +1 -0
- package/dist/components/settings/skills-list.js +28 -0
- package/dist/components/settings/skills-list.js.map +1 -0
- package/dist/components/settings/skills-tab.d.ts.map +1 -1
- package/dist/components/settings/skills-tab.js +65 -38
- package/dist/components/settings/skills-tab.js.map +1 -1
- package/dist/components/settings/tool-permissions-list.d.ts +18 -0
- package/dist/components/settings/tool-permissions-list.d.ts.map +1 -0
- package/dist/components/settings/tool-permissions-list.js +6 -0
- package/dist/components/settings/tool-permissions-list.js.map +1 -0
- package/dist/components/settings/tool-permissions.d.ts +2 -1
- package/dist/components/settings/tool-permissions.d.ts.map +1 -1
- package/dist/components/settings/tool-permissions.js +33 -16
- package/dist/components/settings/tool-permissions.js.map +1 -1
- package/dist/components/settings/web-search-chain.d.ts +41 -0
- package/dist/components/settings/web-search-chain.d.ts.map +1 -0
- package/dist/components/settings/web-search-chain.js +47 -0
- package/dist/components/settings/web-search-chain.js.map +1 -0
- package/dist/components/settings/web-search-settings.d.ts +4 -7
- package/dist/components/settings/web-search-settings.d.ts.map +1 -1
- package/dist/components/settings/web-search-settings.js +54 -76
- package/dist/components/settings/web-search-settings.js.map +1 -1
- package/dist/components/share/share-menu.d.ts.map +1 -1
- package/dist/components/share/share-menu.js +24 -4
- package/dist/components/share/share-menu.js.map +1 -1
- package/dist/components/voice/dictation-sheet.js +3 -3
- package/dist/components/voice/dictation-sheet.js.map +1 -1
- package/dist/components/voice/mic-button.js +1 -1
- package/dist/components/voice/mic-button.js.map +1 -1
- package/dist/components/voice/review-card.js +1 -1
- package/dist/components/voice/review-card.js.map +1 -1
- package/dist/config.d.ts +5 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +15 -5
- package/dist/config.js.map +1 -1
- package/dist/connection.d.ts +12 -0
- package/dist/connection.d.ts.map +1 -0
- package/dist/connection.js +421 -0
- package/dist/connection.js.map +1 -0
- package/dist/default-root.d.ts +3 -0
- package/dist/default-root.d.ts.map +1 -0
- package/dist/default-root.js +16 -0
- package/dist/default-root.js.map +1 -0
- package/dist/hooks/use-color-scheme.d.ts +14 -0
- package/dist/hooks/use-color-scheme.d.ts.map +1 -0
- package/dist/hooks/use-color-scheme.js +37 -0
- package/dist/hooks/use-color-scheme.js.map +1 -0
- package/dist/hooks/use-hash-routes.d.ts.map +1 -1
- package/dist/hooks/use-hash-routes.js +4 -2
- package/dist/hooks/use-hash-routes.js.map +1 -1
- package/dist/hooks/use-media-query.d.ts +7 -0
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-media-query.js +34 -0
- package/dist/hooks/use-media-query.js.map +1 -0
- package/dist/hooks/use-share-intake.d.ts.map +1 -1
- package/dist/hooks/use-share-intake.js +37 -12
- package/dist/hooks/use-share-intake.js.map +1 -1
- package/dist/hooks/use-vpn-status.d.ts.map +1 -1
- package/dist/hooks/use-vpn-status.js +17 -18
- package/dist/hooks/use-vpn-status.js.map +1 -1
- package/dist/hooks/use-websocket.d.ts +5 -24
- package/dist/hooks/use-websocket.d.ts.map +1 -1
- package/dist/hooks/use-websocket.js +11 -384
- package/dist/hooks/use-websocket.js.map +1 -1
- package/dist/hooks/websocket-handlers/activity.d.ts +2 -2
- package/dist/hooks/websocket-handlers/activity.d.ts.map +1 -1
- package/dist/hooks/websocket-handlers/activity.js +4 -5
- package/dist/hooks/websocket-handlers/activity.js.map +1 -1
- package/dist/hooks/websocket-handlers/chat.d.ts +1 -0
- package/dist/hooks/websocket-handlers/chat.d.ts.map +1 -1
- package/dist/hooks/websocket-handlers/chat.js +27 -5
- package/dist/hooks/websocket-handlers/chat.js.map +1 -1
- package/dist/hooks/websocket-handlers/connection.d.ts.map +1 -1
- package/dist/hooks/websocket-handlers/connection.js +4 -6
- package/dist/hooks/websocket-handlers/connection.js.map +1 -1
- package/dist/hooks/websocket-handlers/mask.d.ts +1 -1
- package/dist/hooks/websocket-handlers/mask.d.ts.map +1 -1
- package/dist/hooks/websocket-handlers/mask.js +2 -3
- package/dist/hooks/websocket-handlers/mask.js.map +1 -1
- package/dist/hooks/websocket-handlers/provider.d.ts.map +1 -1
- package/dist/hooks/websocket-handlers/provider.js +4 -6
- package/dist/hooks/websocket-handlers/provider.js.map +1 -1
- package/dist/hooks/websocket-handlers/types.d.ts +6 -2
- package/dist/hooks/websocket-handlers/types.d.ts.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/api-client.d.ts +289 -0
- package/dist/lib/api-client.d.ts.map +1 -1
- package/dist/lib/api-client.js +243 -224
- package/dist/lib/api-client.js.map +1 -1
- package/dist/lib/backend.d.ts +19 -2
- package/dist/lib/backend.d.ts.map +1 -1
- package/dist/lib/backend.js +15 -9
- package/dist/lib/backend.js.map +1 -1
- package/dist/lib/diff.d.ts +8 -10
- package/dist/lib/diff.d.ts.map +1 -1
- package/dist/lib/diff.js +26 -53
- package/dist/lib/diff.js.map +1 -1
- package/dist/lib/light-dark.d.ts +37 -0
- package/dist/lib/light-dark.d.ts.map +1 -0
- package/dist/lib/light-dark.js +83 -0
- package/dist/lib/light-dark.js.map +1 -0
- package/dist/lib/mermaid-theme.d.ts +7 -2
- package/dist/lib/mermaid-theme.d.ts.map +1 -1
- package/dist/lib/mermaid-theme.js +125 -203
- package/dist/lib/mermaid-theme.js.map +1 -1
- package/dist/lib/passkeys.d.ts +6 -3
- package/dist/lib/passkeys.d.ts.map +1 -1
- package/dist/lib/passkeys.js +10 -4
- package/dist/lib/passkeys.js.map +1 -1
- package/dist/lib/push-registration.d.ts +4 -1
- package/dist/lib/push-registration.d.ts.map +1 -1
- package/dist/lib/push-registration.js +20 -2
- package/dist/lib/push-registration.js.map +1 -1
- package/dist/lib/share-intake.d.ts +2 -1
- package/dist/lib/share-intake.d.ts.map +1 -1
- package/dist/lib/share-intake.js +3 -3
- package/dist/lib/share-intake.js.map +1 -1
- package/dist/lib/share.d.ts +4 -3
- package/dist/lib/share.d.ts.map +1 -1
- package/dist/lib/share.js +6 -7
- package/dist/lib/share.js.map +1 -1
- package/dist/lib/single-key.d.ts +30 -0
- package/dist/lib/single-key.d.ts.map +1 -0
- package/dist/lib/single-key.js +45 -0
- package/dist/lib/single-key.js.map +1 -0
- package/dist/lib/tool-names.d.ts +8 -6
- package/dist/lib/tool-names.d.ts.map +1 -1
- package/dist/lib/tool-names.js +17 -7
- package/dist/lib/tool-names.js.map +1 -1
- package/dist/root-context.d.ts +229 -0
- package/dist/root-context.d.ts.map +1 -0
- package/dist/root-context.js +33 -0
- package/dist/root-context.js.map +1 -0
- package/dist/root.d.ts +38 -0
- package/dist/root.d.ts.map +1 -0
- package/dist/root.js +47 -0
- package/dist/root.js.map +1 -0
- package/dist/stores/activity-state.d.ts +29 -0
- package/dist/stores/activity-state.d.ts.map +1 -0
- package/dist/stores/activity-state.js +282 -0
- package/dist/stores/activity-state.js.map +1 -0
- package/dist/stores/activity-store.d.ts +10 -41
- package/dist/stores/activity-store.d.ts.map +1 -1
- package/dist/stores/activity-store.js +9 -271
- package/dist/stores/activity-store.js.map +1 -1
- package/dist/stores/chat-state.d.ts +212 -0
- package/dist/stores/chat-state.d.ts.map +1 -0
- package/dist/stores/chat-state.js +466 -0
- package/dist/stores/chat-state.js.map +1 -0
- package/dist/stores/chat-store.d.ts +4 -162
- package/dist/stores/chat-store.d.ts.map +1 -1
- package/dist/stores/chat-store.js +7 -418
- package/dist/stores/chat-store.js.map +1 -1
- package/dist/stores/connection-state.d.ts +40 -0
- package/dist/stores/connection-state.d.ts.map +1 -0
- package/dist/stores/connection-state.js +30 -0
- package/dist/stores/connection-state.js.map +1 -0
- package/dist/stores/connection-store.d.ts +4 -40
- package/dist/stores/connection-store.d.ts.map +1 -1
- package/dist/stores/connection-store.js +7 -27
- package/dist/stores/connection-store.js.map +1 -1
- package/dist/stores/create-stores.d.ts +23 -0
- package/dist/stores/create-stores.d.ts.map +1 -0
- package/dist/stores/create-stores.js +28 -0
- package/dist/stores/create-stores.js.map +1 -0
- package/dist/stores/file-state.d.ts +53 -0
- package/dist/stores/file-state.d.ts.map +1 -0
- package/dist/stores/file-state.js +341 -0
- package/dist/stores/file-state.js.map +1 -0
- package/dist/stores/file-store.d.ts +4 -52
- package/dist/stores/file-store.d.ts.map +1 -1
- package/dist/stores/file-store.js +7 -336
- package/dist/stores/file-store.js.map +1 -1
- package/dist/stores/graph-state.d.ts +95 -0
- package/dist/stores/graph-state.d.ts.map +1 -0
- package/dist/stores/graph-state.js +252 -0
- package/dist/stores/graph-state.js.map +1 -0
- package/dist/stores/graph-store.d.ts +7 -83
- package/dist/stores/graph-store.d.ts.map +1 -1
- package/dist/stores/graph-store.js +8 -249
- package/dist/stores/graph-store.js.map +1 -1
- package/dist/stores/mask-state.d.ts +21 -0
- package/dist/stores/mask-state.d.ts.map +1 -0
- package/dist/stores/mask-state.js +9 -0
- package/dist/stores/mask-state.js.map +1 -0
- package/dist/stores/mask-store.d.ts +4 -21
- package/dist/stores/mask-store.d.ts.map +1 -1
- package/dist/stores/mask-store.js +7 -6
- package/dist/stores/mask-store.js.map +1 -1
- package/dist/stores/principal-state.d.ts +16 -0
- package/dist/stores/principal-state.d.ts.map +1 -0
- package/dist/stores/principal-state.js +31 -0
- package/dist/stores/principal-state.js.map +1 -0
- package/dist/stores/principal-store.d.ts +4 -15
- package/dist/stores/principal-store.d.ts.map +1 -1
- package/dist/stores/principal-store.js +7 -28
- package/dist/stores/principal-store.js.map +1 -1
- package/dist/stores/provider-state.d.ts +24 -0
- package/dist/stores/provider-state.d.ts.map +1 -0
- package/dist/stores/provider-state.js +68 -0
- package/dist/stores/provider-state.js.map +1 -0
- package/dist/stores/provider-store.d.ts +4 -23
- package/dist/stores/provider-store.d.ts.map +1 -1
- package/dist/stores/provider-store.js +7 -64
- package/dist/stores/provider-store.js.map +1 -1
- package/dist/stores/share-state.d.ts +29 -0
- package/dist/stores/share-state.d.ts.map +1 -0
- package/dist/stores/share-state.js +21 -0
- package/dist/stores/share-state.js.map +1 -0
- package/dist/stores/share-store.d.ts +4 -28
- package/dist/stores/share-store.d.ts.map +1 -1
- package/dist/stores/share-store.js +7 -18
- package/dist/stores/share-store.js.map +1 -1
- package/dist/stores/store-environment.d.ts +10 -0
- package/dist/stores/store-environment.d.ts.map +1 -0
- package/dist/stores/store-environment.js +2 -0
- package/dist/stores/store-environment.js.map +1 -0
- package/dist/stores/ui-state.d.ts +71 -0
- package/dist/stores/ui-state.d.ts.map +1 -0
- package/dist/stores/ui-state.js +58 -0
- package/dist/stores/ui-state.js.map +1 -0
- package/dist/stores/ui-store.d.ts +4 -45
- package/dist/stores/ui-store.d.ts.map +1 -1
- package/dist/stores/ui-store.js +7 -36
- package/dist/stores/ui-store.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme.css +150 -97
- package/dist/voice/asr-clients.d.ts +2 -1
- package/dist/voice/asr-clients.d.ts.map +1 -1
- package/dist/voice/asr-clients.js +16 -17
- package/dist/voice/asr-clients.js.map +1 -1
- package/dist/voice/use-dictation.d.ts.map +1 -1
- package/dist/voice/use-dictation.js +12 -8
- package/dist/voice/use-dictation.js.map +1 -1
- package/dist/voice/voice-state.d.ts +25 -0
- package/dist/voice/voice-state.d.ts.map +1 -0
- package/dist/voice/voice-state.js +29 -0
- package/dist/voice/voice-state.js.map +1 -0
- package/dist/voice/voice-store.d.ts +4 -25
- package/dist/voice/voice-store.d.ts.map +1 -1
- package/dist/voice/voice-store.js +7 -26
- package/dist/voice/voice-store.js.map +1 -1
- package/package.json +3 -2
- package/src/components/activity/activity-page.tsx +334 -160
- package/src/components/activity/activity-run-detail.tsx +81 -47
- package/src/components/activity/activity-run-list.tsx +27 -59
- package/src/components/activity/activity-views.tsx +155 -0
- package/src/components/activity/approval-card.tsx +80 -0
- package/src/components/activity/digest-card.tsx +25 -61
- package/src/components/activity/digest-summary.tsx +52 -0
- package/src/components/activity/push-switch.tsx +62 -0
- package/src/components/activity/push-toggle.tsx +51 -81
- package/src/components/activity/span-bits.tsx +8 -7
- package/src/components/chat/ask-user-card.tsx +292 -356
- package/src/components/chat/ask-user-typed.ts +77 -0
- package/src/components/chat/brain-markdown-links.tsx +4 -4
- package/src/components/chat/brain-markdown.tsx +4 -2
- package/src/components/chat/chat-page.tsx +38 -9
- package/src/components/chat/composer-view.tsx +194 -0
- package/src/components/chat/composer.tsx +117 -296
- package/src/components/chat/markdown-content.tsx +53 -2
- package/src/components/chat/mermaid-block.tsx +13 -5
- package/src/components/chat/mermaid-share.ts +8 -7
- package/src/components/chat/mermaid-viewer.tsx +3 -1
- package/src/components/chat/message-bubble.tsx +78 -94
- package/src/components/chat/message-share.ts +7 -7
- package/src/components/chat/renderers/bind.tsx +94 -0
- package/src/components/chat/renderers/brain-ui-tools.tsx +56 -0
- package/src/components/chat/renderers/claude-tools.tsx +3 -2
- package/src/components/chat/renderers/index.ts +15 -10
- package/src/components/chat/session-drawer.tsx +41 -138
- package/src/components/chat/session-list.tsx +113 -0
- package/src/components/chat/share-block.tsx +16 -12
- package/src/components/chat/share-card.tsx +2 -2
- package/src/components/chat/subagent-view.tsx +4 -4
- package/src/components/chat/tool-call-timeline.tsx +59 -22
- package/src/components/chat/tool-cards/block-card.tsx +145 -0
- package/src/components/chat/tool-cards/image-mask-card.tsx +214 -0
- package/src/components/chat/tool-cards/location-card.tsx +159 -0
- package/src/components/chat/tool-views.tsx +21 -60
- package/src/components/chat/transcript-turn.tsx +108 -0
- package/src/components/chat/use-chat-commands.ts +14 -16
- package/src/components/chat/welcome-state.tsx +36 -91
- package/src/components/connectivity/connection-gate.tsx +32 -24
- package/src/components/connectivity/login-form.tsx +122 -0
- package/src/components/connectivity/login-screen.tsx +45 -100
- package/src/components/dev/share-harness.tsx +2 -2
- package/src/components/files/file-panel.tsx +168 -0
- package/src/components/files/file-tree-view.tsx +127 -0
- package/src/components/files/file-tree.tsx +55 -109
- package/src/components/files/file-viewer-binary.tsx +3 -2
- package/src/components/files/file-viewer-frame.tsx +113 -0
- package/src/components/files/file-viewer.tsx +40 -95
- package/src/components/files/frontmatter-chips.tsx +42 -0
- package/src/components/files/frontmatter-panel.tsx +6 -71
- package/src/components/files/staleness.ts +29 -0
- package/src/components/graph/graph-canvas.tsx +24 -1
- package/src/components/graph/graph-controls-column.tsx +92 -0
- package/src/components/graph/graph-controls.tsx +83 -127
- package/src/components/graph/graph-form.tsx +183 -0
- package/src/components/graph/graph-maintenance.tsx +9 -14
- package/src/components/graph/graph-node-rail.tsx +147 -0
- package/src/components/graph/graph-page.tsx +189 -49
- package/src/components/graph/graph-scene.tsx +200 -30
- package/src/components/graph/lib/graph-helpers.ts +65 -43
- package/src/components/graph/node-card.tsx +64 -0
- package/src/components/graph/node-popover.tsx +28 -117
- package/src/components/graph/use-graph-theme.ts +69 -32
- package/src/components/graph/use-node-actions.ts +56 -0
- package/src/components/images/image-share.ts +4 -2
- package/src/components/images/image-viewer.tsx +3 -1
- package/src/components/images/mask-editor.tsx +7 -4
- package/src/components/layout/app-shell.tsx +5 -1
- package/src/components/layout/desktop-palette.tsx +151 -0
- package/src/components/layout/key-cap.tsx +15 -0
- package/src/components/layout/mobile-tab-bar.tsx +80 -157
- package/src/components/layout/shortcut-switch.tsx +32 -0
- package/src/components/layout/side-rail.tsx +70 -150
- package/src/components/layout/slide-panel.tsx +29 -2
- package/src/components/layout/theme.tsx +67 -0
- package/src/components/quick-actions/add-form.tsx +188 -0
- package/src/components/quick-actions/add-modal.tsx +32 -153
- package/src/components/quick-actions/search-modal.tsx +5 -3
- package/src/components/quick-actions/streaming-modal.tsx +42 -71
- package/src/components/quick-actions/streaming-output.tsx +112 -0
- package/src/components/quick-actions/whatsup-modal.tsx +38 -60
- package/src/components/settings/devices-agents-tab.tsx +60 -152
- package/src/components/settings/models-list.tsx +299 -0
- package/src/components/settings/models-tab.tsx +63 -337
- package/src/components/settings/one-time-agent-credential.tsx +1 -1
- package/src/components/settings/passkey-list.tsx +201 -0
- package/src/components/settings/passkey-tab.tsx +53 -197
- package/src/components/settings/pi-accounts-list.tsx +128 -0
- package/src/components/settings/pi-accounts.tsx +71 -170
- package/src/components/settings/principal-list.tsx +172 -0
- package/src/components/settings/settings-panel.tsx +232 -21
- package/src/components/settings/skills-list.tsx +276 -0
- package/src/components/settings/skills-tab.tsx +82 -269
- package/src/components/settings/tool-permissions-list.tsx +54 -0
- package/src/components/settings/tool-permissions.tsx +27 -46
- package/src/components/settings/web-search-chain.tsx +300 -0
- package/src/components/settings/web-search-settings.tsx +58 -328
- package/src/components/share/share-menu.tsx +19 -4
- package/src/components/voice/dictation-sheet.tsx +5 -5
- package/src/components/voice/mic-button.tsx +1 -1
- package/src/components/voice/review-card.tsx +1 -1
- package/src/config.ts +21 -7
- package/src/connection.ts +443 -0
- package/src/default-root.ts +16 -0
- package/src/hooks/use-color-scheme.ts +36 -0
- package/src/hooks/use-hash-routes.ts +4 -2
- package/src/hooks/use-media-query.ts +32 -0
- package/src/hooks/use-share-intake.ts +32 -12
- package/src/hooks/use-vpn-status.ts +18 -17
- package/src/hooks/use-websocket.ts +12 -428
- package/src/hooks/websocket-handlers/activity.ts +4 -5
- package/src/hooks/websocket-handlers/chat.ts +26 -5
- package/src/hooks/websocket-handlers/connection.ts +4 -6
- package/src/hooks/websocket-handlers/mask.ts +2 -3
- package/src/hooks/websocket-handlers/provider.ts +4 -6
- package/src/hooks/websocket-handlers/types.ts +6 -2
- package/src/index.ts +7 -3
- package/src/lib/api-client.ts +426 -384
- package/src/lib/backend.ts +20 -10
- package/src/lib/diff.ts +28 -62
- package/src/lib/light-dark.ts +83 -0
- package/src/lib/mermaid-theme.ts +183 -214
- package/src/lib/passkeys.ts +12 -4
- package/src/lib/push-registration.ts +19 -2
- package/src/lib/share-intake.ts +6 -3
- package/src/lib/share.ts +7 -4
- package/src/lib/single-key.ts +47 -0
- package/src/lib/tool-names.ts +31 -8
- package/src/root-context.tsx +40 -0
- package/src/root.ts +83 -0
- package/src/stores/activity-state.ts +295 -0
- package/src/stores/activity-store.ts +11 -285
- package/src/stores/chat-state.ts +795 -0
- package/src/stores/chat-store.ts +11 -705
- package/src/stores/connection-state.ts +78 -0
- package/src/stores/connection-store.ts +11 -76
- package/src/stores/create-stores.ts +31 -0
- package/src/stores/file-state.ts +399 -0
- package/src/stores/file-store.ts +9 -390
- package/src/stores/graph-state.ts +368 -0
- package/src/stores/graph-store.ts +10 -355
- package/src/stores/mask-state.ts +30 -0
- package/src/stores/mask-store.ts +10 -27
- package/src/stores/principal-state.ts +42 -0
- package/src/stores/principal-store.ts +10 -37
- package/src/stores/provider-state.ts +103 -0
- package/src/stores/provider-store.ts +10 -95
- package/src/stores/share-state.ts +56 -0
- package/src/stores/share-store.ts +11 -54
- package/src/stores/store-environment.ts +10 -0
- package/src/stores/ui-state.ts +143 -0
- package/src/stores/ui-store.ts +11 -93
- package/src/styles.css +4 -1
- package/src/theme.css +150 -97
- package/src/voice/asr-clients.ts +17 -17
- package/src/voice/use-dictation.ts +11 -8
- package/src/voice/voice-state.ts +57 -0
- package/src/voice/voice-store.ts +11 -55
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-modal.js","sourceRoot":"","sources":["../../../src/components/quick-actions/search-modal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,EA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C,EAAE,EAAE,CACxC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CACR,eAAc,SAAS,EAAC,iBAAiB,YACtC,GAAG,CAAC,IAAI,IADA,CAAC,CAEL,CACR,CAAC,CAAC,CAAC,CACF,yBAAe,GAAG,CAAC,IAAI,IAAZ,CAAC,CAAmB,CAChC,CACF,GACC,CACL,EACD,eAAM,SAAS,EAAC,yDAAyD,YACtE,GAAG,CAAC,IAAI,GACJ,IACA,CACV,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,EAAE,QAAQ,EAAiC;IAC9D,OAAO,CACL,cAAK,SAAS,EAAC,sFAAsF,YAClG,QAAQ,GACL,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The container (S6) for a streamed backend job: the request, the SSE reader
|
|
3
|
+
* loop, the abort controller and the "still my stream" checks live here;
|
|
4
|
+
* `StreamingOutput` draws from props.
|
|
5
|
+
*/
|
|
1
6
|
export declare function StreamingPanel({ open, onClose, title, endpoint, method, }: {
|
|
2
7
|
open: boolean;
|
|
3
8
|
onClose: () => void;
|
|
4
9
|
title: string;
|
|
10
|
+
/** Backend-relative path, resolved against the current root. */
|
|
5
11
|
endpoint: string;
|
|
6
12
|
method?: string;
|
|
7
13
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming-modal.d.ts","sourceRoot":"","sources":["../../../src/components/quick-actions/streaming-modal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"streaming-modal.d.ts","sourceRoot":"","sources":["../../../src/components/quick-actions/streaming-modal.tsx"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,OAAO,EACP,KAAK,EACL,QAAQ,EACR,MAAe,GAChB,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,+BAoHA"}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useBrainUiRoot } from "../../root-context.js";
|
|
2
3
|
import { useState, useEffect, useRef } from "react";
|
|
3
|
-
import { Loader2, CheckCircle2, XCircle } from "lucide-react";
|
|
4
4
|
import { SlidePanel } from "../layout/slide-panel.js";
|
|
5
5
|
import { linkifyPaths } from "../chat/brain-markdown.js";
|
|
6
|
+
import { StreamingOutput } from "./streaming-output.js";
|
|
7
|
+
/**
|
|
8
|
+
* The container (S6) for a streamed backend job: the request, the SSE reader
|
|
9
|
+
* loop, the abort controller and the "still my stream" checks live here;
|
|
10
|
+
* `StreamingOutput` draws from props.
|
|
11
|
+
*/
|
|
6
12
|
export function StreamingPanel({ open, onClose, title, endpoint, method = "POST", }) {
|
|
13
|
+
const root = useBrainUiRoot();
|
|
7
14
|
const [state, setState] = useState("idle");
|
|
8
15
|
const [lines, setLines] = useState([]);
|
|
9
16
|
const scrollRef = useRef(null);
|
|
@@ -13,27 +20,39 @@ export function StreamingPanel({ open, onClose, title, endpoint, method = "POST"
|
|
|
13
20
|
return;
|
|
14
21
|
setState("running");
|
|
15
22
|
setLines([]);
|
|
23
|
+
let disposed = false;
|
|
24
|
+
let reader;
|
|
16
25
|
const controller = new AbortController();
|
|
26
|
+
const cancelReader = () => { void reader?.cancel().catch(() => { }); };
|
|
27
|
+
controller.signal.addEventListener("abort", cancelReader);
|
|
17
28
|
controllerRef.current = controller;
|
|
18
29
|
(async () => {
|
|
19
30
|
try {
|
|
20
|
-
const res = await
|
|
31
|
+
const res = await root.request(root.backendUrl(endpoint), {
|
|
21
32
|
method,
|
|
22
33
|
signal: controller.signal,
|
|
23
34
|
});
|
|
35
|
+
if (disposed || controller.signal.aborted) {
|
|
36
|
+
await res.body?.cancel();
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
24
39
|
if (!res.ok || !res.body) {
|
|
25
|
-
setState("error");
|
|
26
40
|
const body = await res.json().catch(() => null);
|
|
41
|
+
if (disposed || controller.signal.aborted)
|
|
42
|
+
return;
|
|
43
|
+
setState("error");
|
|
27
44
|
const message = typeof body?.error === "string" ? body.error : `HTTP ${res.status}: ${res.statusText}`;
|
|
28
45
|
if (!controller.signal.aborted)
|
|
29
46
|
setLines((l) => [...l, message]);
|
|
30
47
|
return;
|
|
31
48
|
}
|
|
32
|
-
|
|
49
|
+
reader = res.body.getReader();
|
|
33
50
|
const decoder = new TextDecoder();
|
|
34
51
|
let buffer = "";
|
|
35
52
|
while (true) {
|
|
36
53
|
const { done, value } = await reader.read();
|
|
54
|
+
if (disposed || controller.signal.aborted)
|
|
55
|
+
return;
|
|
37
56
|
if (done)
|
|
38
57
|
break;
|
|
39
58
|
buffer += decoder.decode(value, { stream: true });
|
|
@@ -59,6 +78,8 @@ export function StreamingPanel({ open, onClose, title, endpoint, method = "POST"
|
|
|
59
78
|
}
|
|
60
79
|
}
|
|
61
80
|
catch (err) {
|
|
81
|
+
if (disposed || controller.signal.aborted)
|
|
82
|
+
return;
|
|
62
83
|
if (err.name === "AbortError") {
|
|
63
84
|
setLines((l) => [...l, "Cancelled."]);
|
|
64
85
|
setState("cancelled");
|
|
@@ -69,27 +90,28 @@ export function StreamingPanel({ open, onClose, title, endpoint, method = "POST"
|
|
|
69
90
|
}
|
|
70
91
|
}
|
|
71
92
|
finally {
|
|
72
|
-
|
|
93
|
+
controller.signal.removeEventListener("abort", cancelReader);
|
|
94
|
+
reader?.releaseLock();
|
|
95
|
+
if (controllerRef.current === controller)
|
|
96
|
+
controllerRef.current = null;
|
|
73
97
|
}
|
|
74
98
|
})();
|
|
75
99
|
return () => {
|
|
100
|
+
disposed = true;
|
|
76
101
|
controller.abort();
|
|
77
|
-
controllerRef.current
|
|
102
|
+
if (controllerRef.current === controller)
|
|
103
|
+
controllerRef.current = null;
|
|
78
104
|
};
|
|
79
|
-
}, [open, endpoint, method]);
|
|
105
|
+
}, [open, endpoint, method, root]);
|
|
80
106
|
// Auto-scroll
|
|
81
107
|
useEffect(() => {
|
|
82
108
|
scrollRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
83
109
|
}, [lines]);
|
|
84
110
|
const isRunning = state === "running";
|
|
85
|
-
return (_jsx(SlidePanel, { open: open, onClose: isRunning ? () => { } : onClose, title: title, children:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
? "Failed"
|
|
91
|
-
: state === "cancelled"
|
|
92
|
-
? "Cancelled"
|
|
93
|
-
: "Ready" })] }), _jsxs("div", { className: "flex-1 overflow-y-auto p-4 font-[family-name:var(--font-mono)] text-xs leading-relaxed text-muted-foreground", children: [lines.map((line, i) => (_jsx("div", { className: "whitespace-pre-wrap", children: linkifyPaths(line) }, i))), isRunning && lines.length === 0 && (_jsx("div", { className: "text-muted-foreground/50", children: "Starting..." })), _jsx("div", { ref: scrollRef })] }), _jsx("div", { className: "border-t border-border px-5 py-3 flex justify-end", children: isRunning ? (_jsx("button", { onClick: () => controllerRef.current?.abort(), className: "rounded-lg border border-destructive/30 px-4 py-1.5 text-xs font-medium text-destructive transition-colors hover:bg-destructive/10", children: "Cancel" })) : (_jsx("button", { onClick: onClose, className: "rounded-lg bg-surface-raised px-4 py-1.5 text-xs font-medium text-foreground transition-colors hover:bg-surface-overlay", children: "Close" })) })] }) }));
|
|
111
|
+
return (_jsx(SlidePanel, { open: open, onClose: isRunning ? () => { } : onClose, title: title, children: _jsx(StreamingOutput, { state: state, lines: lines.map((line) => linkifyPaths(line)), anchor: _jsx("div", { ref: scrollRef }), onCancel: () => {
|
|
112
|
+
controllerRef.current?.abort();
|
|
113
|
+
setState("cancelled");
|
|
114
|
+
setLines((lines) => [...lines, "Cancelled."]);
|
|
115
|
+
}, onClose: onClose }) }));
|
|
94
116
|
}
|
|
95
117
|
//# sourceMappingURL=streaming-modal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming-modal.js","sourceRoot":"","sources":["../../../src/components/quick-actions/streaming-modal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"streaming-modal.js","sourceRoot":"","sources":["../../../src/components/quick-actions/streaming-modal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAoB,MAAM,uBAAuB,CAAC;AAE1E;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,EAC7B,IAAI,EACJ,OAAO,EACP,KAAK,EACL,QAAQ,EACR,MAAM,GAAG,MAAM,GAQhB;IACC,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;IAC9B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAc,MAAM,CAAC,CAAC;IACxD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAW,EAAE,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC/C,MAAM,aAAa,GAAG,MAAM,CAAyB,IAAI,CAAC,CAAC;IAE3D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,IAAI;YAAE,OAAO;QAElB,QAAQ,CAAC,SAAS,CAAC,CAAC;QACpB,QAAQ,CAAC,EAAE,CAAC,CAAC;QAEb,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,IAAI,MAA2D,CAAC;QAChE,MAAM,UAAU,GA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AE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;IAEnC,cAAc;IACd,SAAS,CAAC,GAAG,EAAE;QACb,SAAS,CAAC,OAAO,EAAE,cAAc,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC5D,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,MAAM,SAAS,GAAG,KAAK,KAAK,SAAS,CAAC;IAEtC,OAAO,CACL,KAAC,UAAU,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,YAC3E,KAAC,eAAe,IACd,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,EAC9C,MAAM,EAAE,cAAK,GAAG,EAAE,SAAS,GAAI,EAC/B,QAAQ,EAAE,GAAG,EAAE;gBACb,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;gBAC/B,QAAQ,CAAC,WAAW,CAAC,CAAC;gBACtB,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC;YAChD,CAAC,EACD,OAAO,EAAE,OAAO,GAChB,GACS,CACd,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* What a streamed backend job looks like while it runs and once it has
|
|
4
|
+
* finished — rendered from props (S6). `StreamingPanel` and `WhatsupPanel`
|
|
5
|
+
* are the containers: they own the request, the reader loop, the abort
|
|
6
|
+
* controller and the "is this still my stream" checks; the two views here
|
|
7
|
+
* own the status row, the output area and the one button in the footer.
|
|
8
|
+
*
|
|
9
|
+
* `state` is the job's, in the container's vocabulary: `running` is the only
|
|
10
|
+
* state with a Cancel; every other state offers Close. The status dot is the
|
|
11
|
+
* kit's — amber breathing while running, teal when it completed, red for a
|
|
12
|
+
* failure or a cancellation — and the row is a polite live region so a
|
|
13
|
+
* screen reader hears "Complete" once, not every line.
|
|
14
|
+
*/
|
|
15
|
+
export type StreamState = "idle" | "running" | "success" | "error" | "cancelled";
|
|
16
|
+
export interface StreamingOutputProps {
|
|
17
|
+
state: StreamState;
|
|
18
|
+
/** The job's lines so far, already turned into nodes by the container (paths linkified). */
|
|
19
|
+
lines: ReactNode[];
|
|
20
|
+
onCancel: () => void;
|
|
21
|
+
onClose: () => void;
|
|
22
|
+
/** Wire to the scroll anchor the container keeps in view. */
|
|
23
|
+
anchor?: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare function StreamingOutput(p: StreamingOutputProps): import("react").JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* The briefing: one document rather than a log, so it loads behind a skeleton
|
|
28
|
+
* and renders as prose once it has all arrived. `content` is the container's
|
|
29
|
+
* rendered markdown node; the view does not know what it is made of.
|
|
30
|
+
*/
|
|
31
|
+
export interface BriefingOutputProps {
|
|
32
|
+
state: "loading" | "done" | "error" | "cancelled";
|
|
33
|
+
content: ReactNode;
|
|
34
|
+
onCancel: () => void;
|
|
35
|
+
onClose: () => void;
|
|
36
|
+
}
|
|
37
|
+
export declare function BriefingOutput(p: BriefingOutputProps): import("react").JSX.Element;
|
|
38
|
+
//# sourceMappingURL=streaming-output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streaming-output.d.ts","sourceRoot":"","sources":["../../../src/components/quick-actions/streaming-output.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,CAAC;AAUjF,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,WAAW,CAAC;IACnB,4FAA4F;IAC5F,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,oBAAoB,+BAuBtD;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,WAAW,CAAC;IAClD,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,mBAAmB,+BAyBpD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Placeholder, StatusDot } from "@schlessera/brain-ui-kit";
|
|
3
|
+
const STATUS = {
|
|
4
|
+
idle: { tone: "neutral", pulse: false, text: "Ready" },
|
|
5
|
+
running: { tone: "amber", pulse: true, text: "Running..." },
|
|
6
|
+
success: { tone: "teal", pulse: false, text: "Complete" },
|
|
7
|
+
error: { tone: "red", pulse: false, text: "Failed" },
|
|
8
|
+
cancelled: { tone: "red", pulse: false, text: "Cancelled" },
|
|
9
|
+
};
|
|
10
|
+
export function StreamingOutput(p) {
|
|
11
|
+
const running = p.state === "running";
|
|
12
|
+
const s = STATUS[p.state];
|
|
13
|
+
return (_jsxs("div", { className: "flex h-full flex-col", children: [_jsxs("div", { className: "flex items-center gap-2 border-b border-border px-5 py-2", "aria-live": "polite", children: [_jsx(StatusDot, { tone: s.tone, pulse: s.pulse, size: 7 }), _jsx("span", { className: "text-xs text-muted-foreground", children: s.text })] }), _jsxs("div", { className: "flex-1 overflow-y-auto p-4 font-[family-name:var(--font-mono)] text-xs leading-relaxed text-muted-foreground", children: [p.lines.map((line, i) => (_jsx("div", { className: "whitespace-pre-wrap", children: line }, i))), running && p.lines.length === 0 && _jsx("div", { className: "text-muted-foreground/50", children: "Starting..." }), p.anchor] }), _jsx(StreamFooter, { running: running, onCancel: p.onCancel, onClose: p.onClose })] }));
|
|
14
|
+
}
|
|
15
|
+
export function BriefingOutput(p) {
|
|
16
|
+
const loading = p.state === "loading";
|
|
17
|
+
return (_jsxs("div", { className: "flex h-full flex-col", children: [(p.state === "error" || p.state === "cancelled") && (_jsxs("div", { className: "flex items-center gap-2 border-b border-border px-5 py-2", "aria-live": "polite", children: [_jsx(StatusDot, { tone: "red", pulse: false, size: 7 }), _jsx("span", { className: "text-xs text-muted-foreground", children: "Failed" })] })), _jsx("div", { className: "flex-1 overflow-y-auto p-5", children: loading ? (_jsxs("div", { className: "flex flex-col gap-3", children: [_jsx(Placeholder, { variant: "loading", lines: 4, bordered: false, pad: 0 }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Generating briefing..." })] })) : (p.content) }), _jsx(StreamFooter, { running: loading, onCancel: p.onCancel, onClose: p.onClose })] }));
|
|
18
|
+
}
|
|
19
|
+
function StreamFooter({ running, onCancel, onClose }) {
|
|
20
|
+
return (_jsx("div", { className: "flex justify-end border-t border-border px-5 py-3", children: running ? (_jsx(Button, { label: "Cancel", icon: "cancel", tone: "danger", size: "sm", block: false, onClick: onCancel })) : (_jsx(Button, { label: "Close", tone: "quiet", size: "sm", block: false, onClick: onClose })) }));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=streaming-output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streaming-output.js","sourceRoot":"","sources":["../../../src/components/quick-actions/streaming-output.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAmB1E,M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AAC,CACT,KAAC,MAAM,IAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,GAAI,CACjG,CAAC,CAAC,CAAC,CACF,KAAC,MAAM,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAI,CAChF,GACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The container (S6) for the briefing: the request, the SSE reader loop, the
|
|
3
|
+
* abort controller and the "still my stream" checks live here;
|
|
4
|
+
* `BriefingOutput` draws from props.
|
|
5
|
+
*/
|
|
1
6
|
export declare function WhatsupPanel({ open, onClose, }: {
|
|
2
7
|
open: boolean;
|
|
3
8
|
onClose: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whatsup-modal.d.ts","sourceRoot":"","sources":["../../../src/components/quick-actions/whatsup-modal.tsx"],"names":[],"mappings":"AAQA,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,OAAO,GACR,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,+
|
|
1
|
+
{"version":3,"file":"whatsup-modal.d.ts","sourceRoot":"","sources":["../../../src/components/quick-actions/whatsup-modal.tsx"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,OAAO,GACR,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,+BA2GA"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useBrainUiRoot } from "../../root-context.js";
|
|
2
3
|
import { useState, useEffect, useRef } from "react";
|
|
3
|
-
import { Loader2, XCircle } from "lucide-react";
|
|
4
4
|
import { SlidePanel } from "../layout/slide-panel.js";
|
|
5
5
|
import { BrainMarkdown } from "../chat/brain-markdown.js";
|
|
6
|
-
import {
|
|
6
|
+
import { BriefingOutput } from "./streaming-output.js";
|
|
7
|
+
/**
|
|
8
|
+
* The container (S6) for the briefing: the request, the SSE reader loop, the
|
|
9
|
+
* abort controller and the "still my stream" checks live here;
|
|
10
|
+
* `BriefingOutput` draws from props.
|
|
11
|
+
*/
|
|
7
12
|
export function WhatsupPanel({ open, onClose, }) {
|
|
13
|
+
const root = useBrainUiRoot();
|
|
8
14
|
const [state, setState] = useState("loading");
|
|
9
15
|
const [content, setContent] = useState("");
|
|
10
16
|
const controllerRef = useRef(null);
|
|
@@ -13,25 +19,35 @@ export function WhatsupPanel({ open, onClose, }) {
|
|
|
13
19
|
return;
|
|
14
20
|
setState("loading");
|
|
15
21
|
setContent("");
|
|
22
|
+
let disposed = false;
|
|
23
|
+
let reader;
|
|
16
24
|
const controller = new AbortController();
|
|
25
|
+
const cancelReader = () => { void reader?.cancel().catch(() => { }); };
|
|
26
|
+
controller.signal.addEventListener("abort", cancelReader);
|
|
17
27
|
controllerRef.current = controller;
|
|
18
28
|
(async () => {
|
|
19
29
|
try {
|
|
20
|
-
const res = await
|
|
30
|
+
const res = await root.request(root.backendUrl("/api/brain/whatsup"), {
|
|
21
31
|
method: "POST",
|
|
22
32
|
signal: controller.signal,
|
|
23
33
|
});
|
|
34
|
+
if (disposed || controller.signal.aborted) {
|
|
35
|
+
await res.body?.cancel();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
24
38
|
if (!res.ok || !res.body) {
|
|
25
39
|
setState("error");
|
|
26
40
|
setContent(`HTTP ${res.status}: ${res.statusText}`);
|
|
27
41
|
return;
|
|
28
42
|
}
|
|
29
|
-
|
|
43
|
+
reader = res.body.getReader();
|
|
30
44
|
const decoder = new TextDecoder();
|
|
31
45
|
let buffer = "";
|
|
32
46
|
const lines = [];
|
|
33
47
|
while (true) {
|
|
34
48
|
const { done, value } = await reader.read();
|
|
49
|
+
if (disposed || controller.signal.aborted)
|
|
50
|
+
return;
|
|
35
51
|
if (done)
|
|
36
52
|
break;
|
|
37
53
|
buffer += decoder.decode(value, { stream: true });
|
|
@@ -58,6 +74,8 @@ export function WhatsupPanel({ open, onClose, }) {
|
|
|
58
74
|
setContent(lines.join("\n"));
|
|
59
75
|
}
|
|
60
76
|
catch (err) {
|
|
77
|
+
if (disposed || controller.signal.aborted)
|
|
78
|
+
return;
|
|
61
79
|
if (err.name === "AbortError") {
|
|
62
80
|
setState("cancelled");
|
|
63
81
|
setContent("Cancelled.");
|
|
@@ -68,15 +86,23 @@ export function WhatsupPanel({ open, onClose, }) {
|
|
|
68
86
|
}
|
|
69
87
|
}
|
|
70
88
|
finally {
|
|
71
|
-
|
|
89
|
+
controller.signal.removeEventListener("abort", cancelReader);
|
|
90
|
+
reader?.releaseLock();
|
|
91
|
+
if (controllerRef.current === controller)
|
|
92
|
+
controllerRef.current = null;
|
|
72
93
|
}
|
|
73
94
|
})();
|
|
74
95
|
return () => {
|
|
96
|
+
disposed = true;
|
|
75
97
|
controller.abort();
|
|
76
|
-
controllerRef.current
|
|
98
|
+
if (controllerRef.current === controller)
|
|
99
|
+
controllerRef.current = null;
|
|
77
100
|
};
|
|
78
|
-
}, [open]);
|
|
79
|
-
|
|
80
|
-
|
|
101
|
+
}, [open, root]);
|
|
102
|
+
return (_jsx(SlidePanel, { open: open, onClose: onClose, title: "Whatsup", wide: true, children: _jsx(BriefingOutput, { state: state, content: _jsx(BrainMarkdown, { content: content, className: "whatsup-briefing brain-prose", entityTags: true, fileLinks: true }), onCancel: () => {
|
|
103
|
+
controllerRef.current?.abort();
|
|
104
|
+
setState("cancelled");
|
|
105
|
+
setContent("Cancelled.");
|
|
106
|
+
}, onClose: onClose }) }));
|
|
81
107
|
}
|
|
82
108
|
//# sourceMappingURL=whatsup-modal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whatsup-modal.js","sourceRoot":"","sources":["../../../src/components/quick-actions/whatsup-modal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"whatsup-modal.js","sourceRoot":"","sources":["../../../src/components/quick-actions/whatsup-modal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,IAAI,EACJ,OAAO,GAIR;IACC,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;IAC9B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAQ,SAAS,CAAC,CAAC;IACrD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC3C,MAAM,aAAa,GAAG,MAAM,CAAyB,IAAI,CAAC,CAAC;IAE3D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,IAAI;YAAE,OAAO;QAElB,QAAQ,CAAC,SAAS,CAAC,CAAC;QACpB,UAAU,CAAC,EAAE,CAAC,CAAC;QAEf,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,IAAI,MAA2D,CAAC;QAChE,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;QACzC,MAAM,YAAY,GAAG,GAAG,EAAE,GAAG,KAAK,MAAM,EAAE,MAAM,EA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 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Active devices and delegated agents, with owner-only mint and revoke
|
|
3
|
+
* controls. This is the container (S7): the principals request, the mint
|
|
4
|
+
* through the principal store and the revoke with its confirm live here;
|
|
5
|
+
* `PrincipalList` draws the list and the form on the kit.
|
|
6
|
+
*/
|
|
2
7
|
export declare function DevicesAgentsTab({ active }: {
|
|
3
8
|
active: boolean;
|
|
4
9
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devices-agents-tab.d.ts","sourceRoot":"","sources":["../../../src/components/settings/devices-agents-tab.tsx"],"names":[],"mappings":"AAcA
|
|
1
|
+
{"version":3,"file":"devices-agents-tab.d.ts","sourceRoot":"","sources":["../../../src/components/settings/devices-agents-tab.tsx"],"names":[],"mappings":"AAcA;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,+BAsH/D"}
|
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { api } from "../../lib/api-client.js";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
+
import { useBrainApi } from "../../root-context.js";
|
|
5
4
|
import { formatRelativeTime } from "../../lib/format-time.js";
|
|
6
|
-
import { cn } from "../../lib/utils.js";
|
|
7
5
|
import { usePrincipalStore } from "../../stores/principal-store.js";
|
|
6
|
+
import { PrincipalList } from "./principal-list.js";
|
|
8
7
|
const MAX_LABEL_LENGTH = 64;
|
|
9
8
|
const NOT_ENABLED = "Principal management is not enabled";
|
|
10
9
|
function displayLabel(label) {
|
|
11
10
|
return Array.from(label).slice(0, MAX_LABEL_LENGTH).join("");
|
|
12
11
|
}
|
|
13
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Active devices and delegated agents, with owner-only mint and revoke
|
|
14
|
+
* controls. This is the container (S7): the principals request, the mint
|
|
15
|
+
* through the principal store and the revoke with its confirm live here;
|
|
16
|
+
* `PrincipalList` draws the list and the form on the kit.
|
|
17
|
+
*/
|
|
14
18
|
export function DevicesAgentsTab({ active }) {
|
|
19
|
+
const api = useBrainApi();
|
|
20
|
+
const lifetime = useRef(0);
|
|
21
|
+
const request = useRef(0);
|
|
15
22
|
const [principals, setPrincipals] = useState([]);
|
|
16
23
|
const [loading, setLoading] = useState(false);
|
|
17
24
|
const [enabled, setEnabled] = useState(true);
|
|
@@ -23,16 +30,23 @@ export function DevicesAgentsTab({ active }) {
|
|
|
23
30
|
const mintError = usePrincipalStore((state) => state.mintError);
|
|
24
31
|
const oneTimeCredential = usePrincipalStore((state) => state.oneTimeCredential);
|
|
25
32
|
const mintAgent = usePrincipalStore((state) => state.mintAgent);
|
|
26
|
-
|
|
33
|
+
const refresh = useCallback(async () => {
|
|
34
|
+
const generation = lifetime.current;
|
|
35
|
+
const token = ++request.current;
|
|
36
|
+
const current = () => generation === lifetime.current && token === request.current;
|
|
27
37
|
setLoading(true);
|
|
28
38
|
setLoadFailed(false);
|
|
29
39
|
setError(null);
|
|
30
40
|
try {
|
|
31
41
|
const data = await api.principals();
|
|
42
|
+
if (!current())
|
|
43
|
+
return;
|
|
32
44
|
setPrincipals(data.principals);
|
|
33
45
|
setEnabled(true);
|
|
34
46
|
}
|
|
35
47
|
catch (err) {
|
|
48
|
+
if (!current())
|
|
49
|
+
return;
|
|
36
50
|
setPrincipals([]);
|
|
37
51
|
if (err instanceof Error && err.message === NOT_ENABLED) {
|
|
38
52
|
setEnabled(false);
|
|
@@ -44,22 +58,32 @@ export function DevicesAgentsTab({ active }) {
|
|
|
44
58
|
}
|
|
45
59
|
}
|
|
46
60
|
finally {
|
|
47
|
-
|
|
61
|
+
if (current())
|
|
62
|
+
setLoading(false);
|
|
48
63
|
}
|
|
49
|
-
}
|
|
64
|
+
}, [api]);
|
|
50
65
|
useEffect(() => {
|
|
66
|
+
lifetime.current++;
|
|
67
|
+
setPrincipals([]);
|
|
68
|
+
setLoading(false);
|
|
69
|
+
setEnabled(true);
|
|
70
|
+
setLoadFailed(false);
|
|
71
|
+
setError(null);
|
|
72
|
+
setLabel("");
|
|
73
|
+
setTtlDays(7);
|
|
51
74
|
if (active)
|
|
52
75
|
void refresh();
|
|
53
|
-
|
|
76
|
+
const invalidate = () => { lifetime.current++; };
|
|
77
|
+
return invalidate;
|
|
78
|
+
}, [active, refresh]);
|
|
54
79
|
useEffect(() => {
|
|
55
80
|
if (!oneTimeCredential)
|
|
56
81
|
return;
|
|
57
82
|
setLabel("");
|
|
58
83
|
if (active)
|
|
59
84
|
void refresh();
|
|
60
|
-
}, [active, oneTimeCredential]);
|
|
61
|
-
function onMint(
|
|
62
|
-
event.preventDefault();
|
|
85
|
+
}, [active, oneTimeCredential, refresh]);
|
|
86
|
+
function onMint() {
|
|
63
87
|
const trimmed = label.trim();
|
|
64
88
|
if (!trimmed || busy)
|
|
65
89
|
return;
|
|
@@ -74,23 +98,34 @@ export function DevicesAgentsTab({ active }) {
|
|
|
74
98
|
: "That device will be signed out immediately.";
|
|
75
99
|
if (!window.confirm(`${consequence} You can't undo this.`))
|
|
76
100
|
return;
|
|
101
|
+
const generation = lifetime.current;
|
|
77
102
|
setError(null);
|
|
78
103
|
try {
|
|
79
104
|
await api.principalRevoke(principal.id);
|
|
105
|
+
if (generation !== lifetime.current)
|
|
106
|
+
return;
|
|
80
107
|
setPrincipals((rows) => rows.filter((row) => row.id !== principal.id));
|
|
81
108
|
if (principal.is_own)
|
|
82
109
|
window.location.reload();
|
|
83
110
|
}
|
|
84
111
|
catch (err) {
|
|
112
|
+
if (generation !== lifetime.current)
|
|
113
|
+
return;
|
|
85
114
|
setError(err instanceof Error ? err.message : "Could not revoke access");
|
|
86
115
|
}
|
|
87
116
|
}
|
|
88
|
-
return (
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
117
|
+
return (_jsx(PrincipalList, { state: loading ? "loading" : !enabled ? "unavailable" : loadFailed ? "error" : "ready", principals: principals.map((principal) => ({
|
|
118
|
+
id: principal.id,
|
|
119
|
+
label: displayLabel(principal.label),
|
|
120
|
+
kind: principal.kind,
|
|
121
|
+
isOwn: principal.is_own,
|
|
122
|
+
created: formatRelativeTime(principal.created_at),
|
|
123
|
+
lastSeen: principal.last_seen_at ? formatRelativeTime(principal.last_seen_at) : "Never",
|
|
124
|
+
expires: formatRelativeTime(principal.expires_at),
|
|
125
|
+
})), error: error ?? mintError, label: label, ttlDays: ttlDays, minting: busy, onLabel: setLabel, onTtlDays: setTtlDays, onMint: onMint, onRevoke: (id) => {
|
|
126
|
+
const principal = principals.find((row) => row.id === id);
|
|
127
|
+
if (principal)
|
|
128
|
+
void onRevoke(principal);
|
|
129
|
+
} }));
|
|
95
130
|
}
|
|
96
131
|
//# sourceMappingURL=devices-agents-tab.js.map
|