@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
package/dist/lib/api-client.js
CHANGED
|
@@ -1,228 +1,247 @@
|
|
|
1
1
|
import { apiBase } from "./backend.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
/**
|
|
3
|
+
* A concrete REST client owned by one UI root. The getter is evaluated for
|
|
4
|
+
* EVERY request: a root can be constructed before the shell supplies its
|
|
5
|
+
* configuration without freezing the default URL. Multipart uploads use the
|
|
6
|
+
* same getter and transport as JSON requests.
|
|
7
|
+
*/
|
|
8
|
+
export function createBrainApi(getBase, request = (url, init) => fetch(url, init)) {
|
|
9
|
+
async function fetchJson(path, init) {
|
|
10
|
+
const res = await request(`${getBase()}${path}`, {
|
|
11
|
+
...init,
|
|
12
|
+
headers: {
|
|
13
|
+
"Content-Type": "application/json",
|
|
14
|
+
...init?.headers,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
if (!res.ok) {
|
|
18
|
+
const body = await res.json().catch(() => ({ error: res.statusText }));
|
|
19
|
+
throw new Error(body.error || `HTTP ${res.status}`);
|
|
20
|
+
}
|
|
21
|
+
return res.json();
|
|
13
22
|
}
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
method: "POST", body: "{}",
|
|
40
|
-
}),
|
|
41
|
-
sessions: () => fetchJson("/sessions"),
|
|
42
|
-
/** Mint a dictation session for the active speech provider. */
|
|
43
|
-
voiceSession: (signal) => fetchJson("/voice/session", { method: "POST", signal }),
|
|
44
|
-
/** @deprecated use voiceSession(); kept during client transition. */
|
|
45
|
-
voiceToken: () => fetchJson("/voice/token", { method: "POST" }),
|
|
46
|
-
voiceKeyterms: () => fetchJson("/voice/keyterms"),
|
|
47
|
-
voiceOverrides: (signal) => fetchJson("/voice/overrides", {
|
|
48
|
-
signal,
|
|
49
|
-
}),
|
|
50
|
-
providers: () => fetchJson("/providers"),
|
|
51
|
-
/** Full model catalog for the settings screen — hidden entries included. */
|
|
52
|
-
models: () => fetchJson("/models"),
|
|
53
|
-
/** Replace the hidden set (full list, not a delta); returns the new catalog. */
|
|
54
|
-
setHiddenModels: (hidden) => fetchJson("/models/hidden", {
|
|
55
|
-
method: "PUT",
|
|
56
|
-
body: JSON.stringify({ hidden }),
|
|
57
|
-
}),
|
|
58
|
-
/** Replace the billing-override record (full record, not a delta); returns the new catalog. */
|
|
59
|
-
setBillingOverrides: (billing) => fetchJson("/models/billing", {
|
|
60
|
-
method: "PUT",
|
|
61
|
-
body: JSON.stringify({ billing }),
|
|
62
|
-
}),
|
|
63
|
-
/** Pricing-table freshness for the Activity staleness indicator (see `PricingState`). */
|
|
64
|
-
pricingState: () => fetchJson("/models/pricing"),
|
|
65
|
-
/** Auth status of configured pi providers; empty when pi is not in play. */
|
|
66
|
-
piAuthProviders: () => fetchJson("/pi-auth/providers"),
|
|
67
|
-
/** Start an OAuth device-code login; resolves once the user code exists. */
|
|
68
|
-
piAuthStart: (providerId) => fetchJson("/pi-auth/login", {
|
|
69
|
-
method: "POST",
|
|
70
|
-
body: JSON.stringify({ providerId }),
|
|
71
|
-
}),
|
|
72
|
-
/** Poll one login flow. */
|
|
73
|
-
piAuthFlow: (id) => fetchJson(`/pi-auth/login/${encodeURIComponent(id)}`),
|
|
74
|
-
/** Abort a pending login flow. */
|
|
75
|
-
piAuthCancel: (id) => fetchJson(`/pi-auth/login/${encodeURIComponent(id)}`, {
|
|
76
|
-
method: "DELETE",
|
|
77
|
-
}),
|
|
78
|
-
/** Remove the stored credential for a pi provider. */
|
|
79
|
-
piAuthLogout: (providerId) => fetchJson("/pi-auth/logout", {
|
|
80
|
-
method: "POST",
|
|
81
|
-
body: JSON.stringify({ providerId }),
|
|
82
|
-
}),
|
|
83
|
-
/** Custom + built-in skills, as managed from Settings → Skills. */
|
|
84
|
-
skillsList: () => fetchJson("/skills"),
|
|
85
|
-
/** One skill's SKILL.md and file list (builtins read-only). */
|
|
86
|
-
skillGet: (name) => fetchJson(`/skills/${encodeURIComponent(name)}`),
|
|
87
|
-
/** Create a custom skill; runs `brain skills sync` server-side. */
|
|
88
|
-
skillCreate: (name, content) => fetchJson("/skills", {
|
|
89
|
-
method: "POST",
|
|
90
|
-
body: JSON.stringify({ name, content }),
|
|
91
|
-
}),
|
|
92
|
-
/** Replace a custom skill's SKILL.md. */
|
|
93
|
-
skillUpdate: (name, content) => fetchJson(`/skills/${encodeURIComponent(name)}`, {
|
|
94
|
-
method: "PUT",
|
|
95
|
-
body: JSON.stringify({ content }),
|
|
96
|
-
}),
|
|
97
|
-
/** Enable/disable a custom skill (applies to every backend at once). */
|
|
98
|
-
skillSetEnabled: (name, enabled) => fetchJson(`/skills/${encodeURIComponent(name)}/enabled`, { method: "POST", body: JSON.stringify({ enabled }) }),
|
|
99
|
-
/** Delete a custom skill permanently. */
|
|
100
|
-
skillRemove: (name) => fetchJson(`/skills/${encodeURIComponent(name)}`, {
|
|
101
|
-
method: "DELETE",
|
|
102
|
-
}),
|
|
103
|
-
/** Install skill(s) from an uploaded ZIP archive. */
|
|
104
|
-
skillInstallZip: async (file, overwrite) => {
|
|
105
|
-
const form = new FormData();
|
|
106
|
-
form.append("file", file);
|
|
107
|
-
form.append("overwrite", overwrite ? "true" : "false");
|
|
108
|
-
// Raw fetch: the browser must set the multipart boundary itself.
|
|
109
|
-
const res = await fetch(`${apiBase()}/skills/install/zip`, {
|
|
23
|
+
return {
|
|
24
|
+
health: () => fetchJson("/health"),
|
|
25
|
+
vpnCheck: () => fetchJson("/vpn-check"),
|
|
26
|
+
status: () => fetchJson("/status"),
|
|
27
|
+
brainSearch: (q, opts) =>
|
|
28
|
+
// Built with encodeURIComponent rather than URLSearchParams: the latter
|
|
29
|
+
// form-encodes spaces as "+", which not every query parser turns back into
|
|
30
|
+
// a space. %20 is unambiguous.
|
|
31
|
+
fetchJson(`/brain/search?q=${encodeURIComponent(q)}` +
|
|
32
|
+
(opts?.type ? `&type=${encodeURIComponent(opts.type)}` : "") +
|
|
33
|
+
(opts?.tag ? `&tag=${encodeURIComponent(opts.tag)}` : "") +
|
|
34
|
+
(opts?.limit ? `&limit=${opts.limit}` : "") +
|
|
35
|
+
(opts?.mode ? `&mode=${opts.mode}` : ""), { signal: opts?.signal }),
|
|
36
|
+
brainBriefing: () => fetchJson("/brain/briefing"),
|
|
37
|
+
/**
|
|
38
|
+
* Map geometry for a view, `[west, south, east, north]` in degrees. The
|
|
39
|
+
* server fetches once per place and caches forever; it answers 200 with
|
|
40
|
+
* empty geometry on any failure, so a caller never has to draw an error
|
|
41
|
+
* where a map should be. `attribution` is non-optional in the answer
|
|
42
|
+
* because the geometry is OpenStreetMap's (ODbL).
|
|
43
|
+
*/
|
|
44
|
+
geoCoastline: (bbox, opts) => fetchJson(`/geo/coastline?bbox=${bbox.map((n) => n.toFixed(5)).join(",")}` +
|
|
45
|
+
(opts?.width ? `&width=${Math.round(opts.width)}` : ""), { signal: opts?.signal }),
|
|
46
|
+
brainStats: () => fetchJson("/brain/stats"),
|
|
47
|
+
brainSync: () => fetchJson("/brain/sync", {
|
|
110
48
|
method: "POST",
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
49
|
+
}),
|
|
50
|
+
brainAdd: (content, opts) => fetchJson("/brain/add", {
|
|
51
|
+
method: "POST",
|
|
52
|
+
body: JSON.stringify({ content, ...opts }),
|
|
53
|
+
}),
|
|
54
|
+
brainIndex: () => fetchJson("/brain/index", {
|
|
55
|
+
method: "POST", body: "{}",
|
|
56
|
+
}),
|
|
57
|
+
sessions: () => fetchJson("/sessions"),
|
|
58
|
+
/** Mint a dictation session for the active speech provider. */
|
|
59
|
+
voiceSession: (signal) => fetchJson("/voice/session", { method: "POST", signal }),
|
|
60
|
+
/** @deprecated use voiceSession(); kept during client transition. */
|
|
61
|
+
voiceToken: () => fetchJson("/voice/token", { method: "POST" }),
|
|
62
|
+
voiceKeyterms: () => fetchJson("/voice/keyterms"),
|
|
63
|
+
voiceOverrides: (signal) => fetchJson("/voice/overrides", {
|
|
64
|
+
signal,
|
|
65
|
+
}),
|
|
66
|
+
providers: () => fetchJson("/providers"),
|
|
67
|
+
/** Full model catalog for the settings screen — hidden entries included. */
|
|
68
|
+
models: () => fetchJson("/models"),
|
|
69
|
+
/** Replace the hidden set (full list, not a delta); returns the new catalog. */
|
|
70
|
+
setHiddenModels: (hidden) => fetchJson("/models/hidden", {
|
|
71
|
+
method: "PUT",
|
|
72
|
+
body: JSON.stringify({ hidden }),
|
|
73
|
+
}),
|
|
74
|
+
/** Replace the billing-override record (full record, not a delta); returns the new catalog. */
|
|
75
|
+
setBillingOverrides: (billing) => fetchJson("/models/billing", {
|
|
76
|
+
method: "PUT",
|
|
77
|
+
body: JSON.stringify({ billing }),
|
|
78
|
+
}),
|
|
79
|
+
/** Pricing-table freshness for the Activity staleness indicator (see `PricingState`). */
|
|
80
|
+
pricingState: () => fetchJson("/models/pricing"),
|
|
81
|
+
/** Auth status of configured pi providers; empty when pi is not in play. */
|
|
82
|
+
piAuthProviders: () => fetchJson("/pi-auth/providers"),
|
|
83
|
+
/** Start an OAuth device-code login; resolves once the user code exists. */
|
|
84
|
+
piAuthStart: (providerId) => fetchJson("/pi-auth/login", {
|
|
85
|
+
method: "POST",
|
|
86
|
+
body: JSON.stringify({ providerId }),
|
|
87
|
+
}),
|
|
88
|
+
/** Poll one login flow. */
|
|
89
|
+
piAuthFlow: (id) => fetchJson(`/pi-auth/login/${encodeURIComponent(id)}`),
|
|
90
|
+
/** Abort a pending login flow. */
|
|
91
|
+
piAuthCancel: (id) => fetchJson(`/pi-auth/login/${encodeURIComponent(id)}`, {
|
|
92
|
+
method: "DELETE",
|
|
93
|
+
}),
|
|
94
|
+
/** Remove the stored credential for a pi provider. */
|
|
95
|
+
piAuthLogout: (providerId) => fetchJson("/pi-auth/logout", {
|
|
96
|
+
method: "POST",
|
|
97
|
+
body: JSON.stringify({ providerId }),
|
|
98
|
+
}),
|
|
99
|
+
/** Custom + built-in skills, as managed from Settings → Skills. */
|
|
100
|
+
skillsList: () => fetchJson("/skills"),
|
|
101
|
+
/** One skill's SKILL.md and file list (builtins read-only). */
|
|
102
|
+
skillGet: (name) => fetchJson(`/skills/${encodeURIComponent(name)}`),
|
|
103
|
+
/** Create a custom skill; runs `brain skills sync` server-side. */
|
|
104
|
+
skillCreate: (name, content) => fetchJson("/skills", {
|
|
105
|
+
method: "POST",
|
|
106
|
+
body: JSON.stringify({ name, content }),
|
|
107
|
+
}),
|
|
108
|
+
/** Replace a custom skill's SKILL.md. */
|
|
109
|
+
skillUpdate: (name, content) => fetchJson(`/skills/${encodeURIComponent(name)}`, {
|
|
110
|
+
method: "PUT",
|
|
111
|
+
body: JSON.stringify({ content }),
|
|
112
|
+
}),
|
|
113
|
+
/** Enable/disable a custom skill (applies to every backend at once). */
|
|
114
|
+
skillSetEnabled: (name, enabled) => fetchJson(`/skills/${encodeURIComponent(name)}/enabled`, { method: "POST", body: JSON.stringify({ enabled }) }),
|
|
115
|
+
/** Delete a custom skill permanently. */
|
|
116
|
+
skillRemove: (name) => fetchJson(`/skills/${encodeURIComponent(name)}`, {
|
|
117
|
+
method: "DELETE",
|
|
118
|
+
}),
|
|
119
|
+
/** Install skill(s) from an uploaded ZIP archive. */
|
|
120
|
+
skillInstallZip: async (file, overwrite) => {
|
|
121
|
+
const form = new FormData();
|
|
122
|
+
form.append("file", file);
|
|
123
|
+
form.append("overwrite", overwrite ? "true" : "false");
|
|
124
|
+
// Raw fetch: the browser must set the multipart boundary itself.
|
|
125
|
+
const res = await request(`${getBase()}/skills/install/zip`, {
|
|
126
|
+
method: "POST",
|
|
127
|
+
body: form,
|
|
128
|
+
});
|
|
129
|
+
const body = (await res.json().catch(() => null));
|
|
130
|
+
if (!res.ok)
|
|
131
|
+
throw new Error(body?.error ?? `HTTP ${res.status}`);
|
|
132
|
+
return body;
|
|
133
|
+
},
|
|
134
|
+
/** Install skill(s) from a GitHub repository (owner/repo or URL). */
|
|
135
|
+
skillInstallGitHub: (source, overwrite, ref) => fetchJson("/skills/install/github", {
|
|
136
|
+
method: "POST",
|
|
137
|
+
body: JSON.stringify({ source, overwrite, ...(ref ? { ref } : {}) }),
|
|
138
|
+
}),
|
|
139
|
+
/** Tools remembered as "always allow" (auto-approved without a card). */
|
|
140
|
+
toolPermissions: () => fetchJson("/tool-permissions"),
|
|
141
|
+
/** Revoke one remembered tool grant; returns the updated list. */
|
|
142
|
+
toolPermissionRevoke: (tool) => fetchJson(`/tool-permissions/${encodeURIComponent(tool)}`, {
|
|
143
|
+
method: "DELETE",
|
|
144
|
+
}),
|
|
145
|
+
/** Web-search provider config; `configured: false` when pi is not in play. */
|
|
146
|
+
webSearchConfig: () => fetchJson("/web-search"),
|
|
147
|
+
/**
|
|
148
|
+
* Toggle providers and/or store API keys (null/"" clears a key), or clear a
|
|
149
|
+
* single-provider override. Returns the updated config.
|
|
150
|
+
*/
|
|
151
|
+
webSearchUpdate: (update) => fetchJson("/web-search", {
|
|
152
|
+
method: "PUT",
|
|
153
|
+
body: JSON.stringify(update),
|
|
154
|
+
}),
|
|
155
|
+
/** Replace the reasoning-effort override record (full record, not a delta). */
|
|
156
|
+
setThinkingOverrides: (thinking) => fetchJson("/models/thinking", {
|
|
157
|
+
method: "PUT",
|
|
158
|
+
body: JSON.stringify({ thinking }),
|
|
159
|
+
}),
|
|
160
|
+
/** Set the default model (a profile id, or null for auto); returns the new catalog. */
|
|
161
|
+
setDefaultModel: (defaultId) => fetchJson("/models/default", {
|
|
162
|
+
method: "PUT",
|
|
163
|
+
body: JSON.stringify({ defaultId }),
|
|
164
|
+
}),
|
|
165
|
+
/** Replace the custom OpenRouter model list (full list, not a delta). */
|
|
166
|
+
setCustomModels: (models) => fetchJson("/models/custom", {
|
|
167
|
+
method: "PUT",
|
|
168
|
+
body: JSON.stringify({ models }),
|
|
169
|
+
}),
|
|
170
|
+
/** Force a discovery refresh, bypassing the TTL. */
|
|
171
|
+
refreshModels: () => fetchJson("/models/refresh", { method: "POST" }),
|
|
172
|
+
/** Password-mode login. Resolves on success; throws the server error otherwise. */
|
|
173
|
+
login: (password) => fetchJson("/auth/login", {
|
|
174
|
+
method: "POST",
|
|
175
|
+
body: JSON.stringify({ password }),
|
|
176
|
+
}),
|
|
177
|
+
logout: () => fetchJson("/auth/logout", { method: "POST" }),
|
|
178
|
+
principals: () => fetchJson("/auth/principals"),
|
|
179
|
+
principalMint: (label, ttlDays) => fetchJson("/auth/principals", {
|
|
180
|
+
method: "POST",
|
|
181
|
+
body: JSON.stringify({ label, ttlDays }),
|
|
182
|
+
}),
|
|
183
|
+
principalRevoke: (id) => fetchJson(`/auth/principals/${encodeURIComponent(id)}`, {
|
|
184
|
+
method: "DELETE",
|
|
185
|
+
}),
|
|
186
|
+
/** Which login methods the server offers (public; drives the login screen). */
|
|
187
|
+
authMethods: () => fetchJson("/auth/methods"),
|
|
188
|
+
passkeyLoginOptions: () => fetchJson("/auth/passkey/login-options", {
|
|
189
|
+
method: "POST",
|
|
190
|
+
body: "{}",
|
|
191
|
+
}),
|
|
192
|
+
passkeyLoginVerify: (response) => fetchJson("/auth/passkey/login-verify", {
|
|
193
|
+
method: "POST",
|
|
194
|
+
body: JSON.stringify(response),
|
|
195
|
+
}),
|
|
196
|
+
passkeyRegisterOptions: () => fetchJson("/auth/passkey/register-options", {
|
|
197
|
+
method: "POST",
|
|
198
|
+
body: "{}",
|
|
199
|
+
}),
|
|
200
|
+
passkeyRegisterVerify: (response, label) => fetchJson("/auth/passkey/register-verify", { method: "POST", body: JSON.stringify({ response, label }) }),
|
|
201
|
+
passkeyList: () => fetchJson("/auth/passkey/list"),
|
|
202
|
+
passkeyRename: (id, label) => fetchJson(`/auth/passkey/${encodeURIComponent(id)}`, {
|
|
203
|
+
method: "PUT",
|
|
204
|
+
body: JSON.stringify({ label }),
|
|
205
|
+
}),
|
|
206
|
+
passkeyDelete: (id) => fetchJson(`/auth/passkey/${encodeURIComponent(id)}`, {
|
|
207
|
+
method: "DELETE",
|
|
208
|
+
}),
|
|
209
|
+
// --- Activity record (read side; live updates ride the WebSocket) ---
|
|
210
|
+
activityRuns: (opts) => fetchJson("/activity/runs?" +
|
|
211
|
+
[
|
|
212
|
+
opts?.origin && `origin=${opts.origin}`,
|
|
213
|
+
opts?.job && `job=${encodeURIComponent(opts.job)}`,
|
|
214
|
+
opts?.session && `session=${encodeURIComponent(opts.session)}`,
|
|
215
|
+
opts?.status && `status=${encodeURIComponent(opts.status)}`,
|
|
216
|
+
opts?.limit && `limit=${opts.limit}`,
|
|
217
|
+
opts?.before && `before=${opts.before}`,
|
|
218
|
+
]
|
|
219
|
+
.filter(Boolean)
|
|
220
|
+
.join("&")),
|
|
221
|
+
/**
|
|
222
|
+
* One run's detail. Payload bodies (tool_input/tool_output events) are
|
|
223
|
+
* excluded by default — the session-history fetch only needs span timings —
|
|
224
|
+
* and opted into by the drill-in views via `includePayloads`.
|
|
225
|
+
*/
|
|
226
|
+
activityRun: (runId, opts) => fetchJson(`/activity/runs/${encodeURIComponent(runId)}` +
|
|
227
|
+
(opts?.includePayloads ? "?include=payloads" : "")),
|
|
228
|
+
activityRollups: (days) => fetchJson(`/activity/rollups${days ? `?days=${days}` : ""}`),
|
|
229
|
+
activityInbox: () => fetchJson("/activity/inbox"),
|
|
230
|
+
activityInboxAck: (id) => fetchJson(`/activity/inbox/${id}/ack`, { method: "POST" }),
|
|
231
|
+
activityInboxAckAll: () => fetchJson("/activity/inbox/ack-all", { method: "POST" }),
|
|
232
|
+
activityDigest: () => fetchJson("/activity/digest"),
|
|
233
|
+
activityDigestDismiss: () => fetchJson("/activity/digest/dismiss", { method: "POST" }),
|
|
234
|
+
pushPublicKey: () => fetchJson("/push/public-key"),
|
|
235
|
+
pushSubscribe: (subscription, label) => fetchJson("/push/subscribe", {
|
|
236
|
+
method: "POST",
|
|
237
|
+
body: JSON.stringify({ subscription, label }),
|
|
238
|
+
}),
|
|
239
|
+
pushUnsubscribe: (endpoint) => fetchJson("/push/unsubscribe", {
|
|
240
|
+
method: "POST",
|
|
241
|
+
body: JSON.stringify({ endpoint }),
|
|
242
|
+
}),
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
/** Default application client; configuration remains late-bound. */
|
|
246
|
+
export const api = createBrainApi(apiBase);
|
|
228
247
|
//# sourceMappingURL=api-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../../src/lib/api-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../../src/lib/api-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA2MvC;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAqB,EACrB,UAAkE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC;IAEjG,KAAK,UAAU,SAAS,CAAI,IAAY,EAAE,IAAkB;QAC1D,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,GAAG,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE;YAC/C,GAAG,IAAI;YACP,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,GAAG,IAAI,EAAE,OAAO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EAAE,CAAC;SACnC,CAAC;KACL,CAAC;AACJ,CAAC;AAID,oEAAoE;AACpE,MAAM,CAAC,MAAM,GAAG,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC"}
|
package/dist/lib/backend.d.ts
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the API and WebSocket live.
|
|
3
|
+
*
|
|
4
|
+
* Default topology is SAME-ORIGIN: the server serves the built client and the
|
|
5
|
+
* API/WS from one origin, so API calls go to "/api" and the WebSocket derives
|
|
6
|
+
* its host from window.location. Nothing needs configuring.
|
|
7
|
+
*
|
|
8
|
+
* A SPLIT topology (client and backend on different origins) sets
|
|
9
|
+
* `backendUrl` through `configureBrainUi()`. These are functions rather than
|
|
10
|
+
* module constants on purpose: a constant would freeze the value at import
|
|
11
|
+
* time, and ES imports are hoisted, so it would always capture the default
|
|
12
|
+
* instead of what the shell configured.
|
|
13
|
+
*/
|
|
14
|
+
import { type BrainUiConfig } from "../config.js";
|
|
1
15
|
/** Base URL for API calls. Empty backendUrl = same-origin "/api". */
|
|
2
|
-
export declare function
|
|
16
|
+
export declare function apiBaseFor(config: BrainUiConfig): string;
|
|
3
17
|
/** WebSocket URL. Derives wss/ws + host from backendUrl, else same-origin. */
|
|
4
|
-
export declare function
|
|
18
|
+
export declare function getWsUrlFor(config: BrainUiConfig, location?: Pick<Location, "protocol" | "host">): string;
|
|
5
19
|
/** Base URL for direct fetch calls (streaming endpoints). */
|
|
20
|
+
export declare function getBackendUrlFor(config: BrainUiConfig, path: string): string;
|
|
21
|
+
export declare function apiBase(): string;
|
|
22
|
+
export declare function getWsUrl(): string;
|
|
6
23
|
export declare function getBackendUrl(path: string): string;
|
|
7
24
|
//# sourceMappingURL=backend.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../src/lib/backend.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../src/lib/backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAE5D,qEAAqE;AACrE,wBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAExD;AAED,8EAA8E;AAC9E,wBAAgB,WAAW,CACzB,MAAM,EAAE,aAAa,EACrB,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM,CAAC,GAC7C,MAAM,CAUR;AAED,6DAA6D;AAC7D,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5E;AAID,wBAAgB,OAAO,IAAI,MAAM,CAAiC;AAClE,wBAAgB,QAAQ,IAAI,MAAM,CAAkC;AACpE,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAA6C"}
|
package/dist/lib/backend.js
CHANGED
|
@@ -13,22 +13,28 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { uiConfig } from "../config.js";
|
|
15
15
|
/** Base URL for API calls. Empty backendUrl = same-origin "/api". */
|
|
16
|
-
export function
|
|
17
|
-
return `${
|
|
16
|
+
export function apiBaseFor(config) {
|
|
17
|
+
return `${config.backendUrl}/api`;
|
|
18
18
|
}
|
|
19
19
|
/** WebSocket URL. Derives wss/ws + host from backendUrl, else same-origin. */
|
|
20
|
-
export function
|
|
21
|
-
if (
|
|
22
|
-
const url = new URL("/ws",
|
|
20
|
+
export function getWsUrlFor(config, location) {
|
|
21
|
+
if (config.backendUrl) {
|
|
22
|
+
const url = new URL("/ws", config.backendUrl);
|
|
23
23
|
url.protocol = url.protocol === "https:" ? "wss:" : "ws:";
|
|
24
24
|
return url.toString();
|
|
25
25
|
}
|
|
26
26
|
// Same-origin (default).
|
|
27
|
-
const
|
|
28
|
-
|
|
27
|
+
const origin = location ?? window.location;
|
|
28
|
+
const protocol = origin.protocol === "https:" ? "wss:" : "ws:";
|
|
29
|
+
return `${protocol}//${origin.host}/ws`;
|
|
29
30
|
}
|
|
30
31
|
/** Base URL for direct fetch calls (streaming endpoints). */
|
|
31
|
-
export function
|
|
32
|
-
return `${
|
|
32
|
+
export function getBackendUrlFor(config, path) {
|
|
33
|
+
return `${config.backendUrl}${path}`;
|
|
33
34
|
}
|
|
35
|
+
// Existing consumers still address the default configuration. Root-owned
|
|
36
|
+
// clients use the explicit helpers above, and keep their config in a closure.
|
|
37
|
+
export function apiBase() { return apiBaseFor(uiConfig); }
|
|
38
|
+
export function getWsUrl() { return getWsUrlFor(uiConfig); }
|
|
39
|
+
export function getBackendUrl(path) { return getBackendUrlFor(uiConfig, path); }
|
|
34
40
|
//# sourceMappingURL=backend.js.map
|
package/dist/lib/backend.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../../src/lib/backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../../src/lib/backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,QAAQ,EAAsB,MAAM,cAAc,CAAC;AAE5D,qEAAqE;AACrE,MAAM,UAAU,UAAU,CAAC,MAAqB;IAC9C,OAAO,GAAG,MAAM,CAAC,UAAU,MAAM,CAAC;AACpC,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,WAAW,CACzB,MAAqB,EACrB,QAA8C;IAE9C,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QACtB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;QAC9C,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CA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