@opengeni/react 3.3.2 → 3.4.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 +769 -22
- package/dist/accounts.js +2 -0
- package/dist/accounts.js.map +1 -1
- package/dist/approvals.d.ts +2 -1
- package/dist/artifacts-document.js +5 -3
- package/dist/artifacts-presentation.js +5 -3
- package/dist/artifacts-spreadsheet.d.ts +1 -1
- package/dist/artifacts-spreadsheet.js +5 -3
- package/dist/artifacts.d.ts +5 -1
- package/dist/artifacts.js +536 -42
- package/dist/artifacts.js.map +1 -1
- package/dist/browser-viewer-ZWR6MWJ7.js +19 -0
- package/dist/capability-catalog-row.d.ts +20 -0
- package/dist/capability-logo-fallback.d.ts +3 -0
- package/dist/chat-interactive-block-4EUKJXUO.js +14 -0
- package/dist/chunk-2DDJ6YH6.js +41 -0
- package/dist/chunk-2DDJ6YH6.js.map +1 -0
- package/dist/chunk-2HVLQ26H.js +183 -0
- package/dist/chunk-2HVLQ26H.js.map +1 -0
- package/dist/{chunk-XYRDDSXF.js → chunk-2I6R3GCZ.js} +4285 -3980
- package/dist/chunk-2I6R3GCZ.js.map +1 -0
- package/dist/{chunk-JAQ5K7W6.js → chunk-2SFFYIH3.js} +1178 -166
- package/dist/chunk-2SFFYIH3.js.map +1 -0
- package/dist/chunk-3PVDYTTB.js +24 -0
- package/dist/chunk-3PVDYTTB.js.map +1 -0
- package/dist/chunk-3RJKUVCA.js +14068 -0
- package/dist/chunk-3RJKUVCA.js.map +1 -0
- package/dist/chunk-3UZCWK46.js +298 -0
- package/dist/chunk-3UZCWK46.js.map +1 -0
- package/dist/chunk-47CKUXTW.js +293 -0
- package/dist/chunk-47CKUXTW.js.map +1 -0
- package/dist/chunk-4QYP6QUI.js +109 -0
- package/dist/chunk-4QYP6QUI.js.map +1 -0
- package/dist/chunk-5EY26VZ7.js +1053 -0
- package/dist/chunk-5EY26VZ7.js.map +1 -0
- package/dist/chunk-5I4VRWBB.js +56 -0
- package/dist/chunk-5I4VRWBB.js.map +1 -0
- package/dist/chunk-5WOR7UCL.js +191 -0
- package/dist/chunk-5WOR7UCL.js.map +1 -0
- package/dist/chunk-5YJLGOM5.js +51 -0
- package/dist/chunk-5YJLGOM5.js.map +1 -0
- package/dist/chunk-6JFN3OWG.js +386 -0
- package/dist/chunk-6JFN3OWG.js.map +1 -0
- package/dist/chunk-7QJT5O4S.js +35 -0
- package/dist/chunk-7QJT5O4S.js.map +1 -0
- package/dist/chunk-A55KV72M.js +402 -0
- package/dist/chunk-A55KV72M.js.map +1 -0
- package/dist/chunk-ADWCLI4G.js +2028 -0
- package/dist/chunk-ADWCLI4G.js.map +1 -0
- package/dist/chunk-B27E3V37.js +29 -0
- package/dist/chunk-B27E3V37.js.map +1 -0
- package/dist/chunk-B7TC2A33.js +83 -0
- package/dist/chunk-B7TC2A33.js.map +1 -0
- package/dist/chunk-BLL56F7R.js +385 -0
- package/dist/chunk-BLL56F7R.js.map +1 -0
- package/dist/chunk-BOFEQC6K.js +162 -0
- package/dist/chunk-BOFEQC6K.js.map +1 -0
- package/dist/chunk-CM7LVUKC.js +35 -0
- package/dist/chunk-CM7LVUKC.js.map +1 -0
- package/dist/chunk-CORUP6JB.js +122 -0
- package/dist/chunk-CORUP6JB.js.map +1 -0
- package/dist/chunk-CSX5FFKZ.js +35 -0
- package/dist/chunk-CSX5FFKZ.js.map +1 -0
- package/dist/chunk-EGVHJKGJ.js +3125 -0
- package/dist/chunk-EGVHJKGJ.js.map +1 -0
- package/dist/{chunk-NEXLLTP4.js → chunk-G76LSA76.js} +6 -5
- package/dist/chunk-G76LSA76.js.map +1 -0
- package/dist/{chunk-PEI6RANI.js → chunk-GQMRL52F.js} +311 -75
- package/dist/chunk-GQMRL52F.js.map +1 -0
- package/dist/{chunk-ELIYWBZR.js → chunk-GUUXOISA.js} +1113 -457
- package/dist/chunk-GUUXOISA.js.map +1 -0
- package/dist/{chunk-HUIKIDM5.js → chunk-I7X2P4FU.js} +225 -116
- package/dist/chunk-I7X2P4FU.js.map +1 -0
- package/dist/chunk-IGFZFLI2.js +1390 -0
- package/dist/chunk-IGFZFLI2.js.map +1 -0
- package/dist/{chunk-4MDLEHXL.js → chunk-IMSUVYQB.js} +26 -13
- package/dist/chunk-IMSUVYQB.js.map +1 -0
- package/dist/chunk-IOYHDEP3.js +38 -0
- package/dist/chunk-IOYHDEP3.js.map +1 -0
- package/dist/chunk-IZV5FTJC.js +55 -0
- package/dist/chunk-IZV5FTJC.js.map +1 -0
- package/dist/chunk-KF33GTWN.js +343 -0
- package/dist/chunk-KF33GTWN.js.map +1 -0
- package/dist/chunk-KSGQ5ODA.js +457 -0
- package/dist/chunk-KSGQ5ODA.js.map +1 -0
- package/dist/{chunk-ZPBTI3TE.js → chunk-KZC6QRNR.js} +1513 -697
- package/dist/chunk-KZC6QRNR.js.map +1 -0
- package/dist/chunk-LJUMYUBO.js +218 -0
- package/dist/chunk-LJUMYUBO.js.map +1 -0
- package/dist/chunk-LSW2OJVV.js +380 -0
- package/dist/chunk-LSW2OJVV.js.map +1 -0
- package/dist/chunk-M357MHH3.js +2 -0
- package/dist/chunk-M357MHH3.js.map +1 -0
- package/dist/chunk-MK2TQO4Y.js +24 -0
- package/dist/chunk-MK2TQO4Y.js.map +1 -0
- package/dist/chunk-N7S72EXK.js +25 -0
- package/dist/chunk-N7S72EXK.js.map +1 -0
- package/dist/{chunk-YVCHAQZY.js → chunk-NKMYZFHA.js} +616 -621
- package/dist/chunk-NKMYZFHA.js.map +1 -0
- package/dist/chunk-NX4ADH73.js +14 -0
- package/dist/chunk-NX4ADH73.js.map +1 -0
- package/dist/chunk-O7F6UJO4.js +71 -0
- package/dist/chunk-O7F6UJO4.js.map +1 -0
- package/dist/chunk-OYQQJL3J.js +16 -0
- package/dist/chunk-OYQQJL3J.js.map +1 -0
- package/dist/{chunk-H5YGYNXS.js → chunk-P4BNUO57.js} +60 -17
- package/dist/chunk-P4BNUO57.js.map +1 -0
- package/dist/{chunk-JVYQRRC4.js → chunk-PEHTX3V7.js} +21 -1
- package/dist/chunk-PEHTX3V7.js.map +1 -0
- package/dist/chunk-PMV53IMM.js +26 -0
- package/dist/chunk-PMV53IMM.js.map +1 -0
- package/dist/{chunk-KCGXPP5V.js → chunk-PYEOPA4M.js} +13 -7
- package/dist/chunk-PYEOPA4M.js.map +1 -0
- package/dist/{chunk-KZ73RL76.js → chunk-QHUE7E4N.js} +8 -3
- package/dist/chunk-QHUE7E4N.js.map +1 -0
- package/dist/chunk-QV3DJVRZ.js +11 -0
- package/dist/chunk-QV3DJVRZ.js.map +1 -0
- package/dist/chunk-R5SBNG7S.js +810 -0
- package/dist/chunk-R5SBNG7S.js.map +1 -0
- package/dist/chunk-RI42H5IU.js +326 -0
- package/dist/chunk-RI42H5IU.js.map +1 -0
- package/dist/chunk-S2QH6EZ5.js +211 -0
- package/dist/chunk-S2QH6EZ5.js.map +1 -0
- package/dist/chunk-SHLZMAJN.js +304 -0
- package/dist/chunk-SHLZMAJN.js.map +1 -0
- package/dist/chunk-TGXK4BAZ.js +293 -0
- package/dist/chunk-TGXK4BAZ.js.map +1 -0
- package/dist/{chunk-5YK2ZDIG.js → chunk-TNEZNMSN.js} +4 -10
- package/dist/chunk-TNEZNMSN.js.map +1 -0
- package/dist/{chunk-22KP6LR5.js → chunk-TXS65BB2.js} +3 -1
- package/dist/{chunk-22KP6LR5.js.map → chunk-TXS65BB2.js.map} +1 -1
- package/dist/chunk-UNJPZGNK.js +63 -0
- package/dist/chunk-UNJPZGNK.js.map +1 -0
- package/dist/{chunk-IOLVN74D.js → chunk-V5ZUJT2T.js} +175 -42
- package/dist/chunk-V5ZUJT2T.js.map +1 -0
- package/dist/chunk-WBJY57A3.js +402 -0
- package/dist/chunk-WBJY57A3.js.map +1 -0
- package/dist/chunk-WIUKB3LD.js +1911 -0
- package/dist/chunk-WIUKB3LD.js.map +1 -0
- package/dist/{chunk-ICA6R6TW.js → chunk-WNN7NO2N.js} +1451 -355
- package/dist/chunk-WNN7NO2N.js.map +1 -0
- package/dist/{chunk-3AGBGTRT.js → chunk-X5UVUIMF.js} +1712 -1174
- package/dist/chunk-X5UVUIMF.js.map +1 -0
- package/dist/chunk-XDA5QJE7.js +402 -0
- package/dist/chunk-XDA5QJE7.js.map +1 -0
- package/dist/{chunk-VZTQ73XT.js → chunk-XEA5BCMA.js} +3 -1
- package/dist/{chunk-VZTQ73XT.js.map → chunk-XEA5BCMA.js.map} +1 -1
- package/dist/chunk-XHF7OYAN.js +1150 -0
- package/dist/chunk-XHF7OYAN.js.map +1 -0
- package/dist/chunk-YSRBFJMQ.js +43 -0
- package/dist/chunk-YSRBFJMQ.js.map +1 -0
- package/dist/chunk-ZOZAPAUO.js +174 -0
- package/dist/chunk-ZOZAPAUO.js.map +1 -0
- package/dist/chunk-ZQV5W7YC.js +809 -0
- package/dist/chunk-ZQV5W7YC.js.map +1 -0
- package/dist/chunk-ZUWF4NF7.js +13 -0
- package/dist/chunk-ZUWF4NF7.js.map +1 -0
- package/dist/client.d.ts +16 -7
- package/dist/clipboard.js +3 -1
- package/dist/commands/types.d.ts +2 -0
- package/dist/components/anthropic-mark.d.ts +3 -0
- package/dist/components/approval-surface.d.ts +19 -6
- package/dist/components/artifacts/artifact-chrome.d.ts +120 -0
- package/dist/components/artifacts/artifact-sandbox.d.ts +30 -0
- package/dist/components/artifacts/artifact-surface.d.ts +4 -2
- package/dist/components/artifacts/chat-interactive-block.d.ts +29 -0
- package/dist/components/artifacts/deferred-chat-media.d.ts +15 -0
- package/dist/components/artifacts/document-editor.d.ts +4 -2
- package/dist/components/artifacts/editable-artifact-ui.d.ts +2 -1
- package/dist/components/artifacts/editable-artifact-view.d.ts +48 -0
- package/dist/components/artifacts/editable-document.d.ts +1 -1
- package/dist/components/artifacts/editable-presentation.d.ts +2 -2
- package/dist/components/artifacts/editable-spreadsheet.d.ts +8 -3
- package/dist/components/artifacts/index.d.ts +9 -2
- package/dist/components/artifacts/inline-html-document.d.ts +2 -0
- package/dist/components/artifacts/latest-task-runner.d.ts +15 -0
- package/dist/components/artifacts/presentation-editor.d.ts +6 -2
- package/dist/components/artifacts/published-html-artifact-frame.d.ts +23 -3
- package/dist/components/artifacts/session-artifact-viewer.d.ts +39 -0
- package/dist/components/artifacts/site-view.d.ts +26 -0
- package/dist/components/artifacts/spreadsheet-command-queue.d.ts +20 -0
- package/dist/components/artifacts/spreadsheet-download.d.ts +7 -0
- package/dist/components/artifacts/spreadsheet-general-display.d.ts +24 -0
- package/dist/components/artifacts/spreadsheet-grid.d.ts +10 -3
- package/dist/components/artifacts/spreadsheet-resize.d.ts +50 -0
- package/dist/components/artifacts/spreadsheet-submissions.d.ts +9 -0
- package/dist/components/artifacts/visualization-assets.gen.d.ts +2 -0
- package/dist/components/browser-select-control.d.ts +16 -0
- package/dist/components/browser-viewer.d.ts +11 -2
- package/dist/components/chat-composer.d.ts +21 -3
- package/dist/components/child-session-link.d.ts +9 -0
- package/dist/components/claude-mark.d.ts +3 -0
- package/dist/components/code-editor.d.ts +1 -4
- package/dist/components/composer-transcription-control.d.ts +7 -0
- package/dist/components/composer.d.ts +34 -67
- package/dist/components/computer-viewer.d.ts +1 -1
- package/dist/components/copy-button.d.ts +3 -1
- package/dist/components/desktop-viewer.d.ts +1 -1
- package/dist/components/grok-mark.d.ts +26 -0
- package/dist/components/human-input-form.d.ts +28 -32
- package/dist/components/human-input-surface.d.ts +7 -2
- package/dist/components/linkified-text.d.ts +18 -0
- package/dist/components/machine-input-display.d.ts +22 -1
- package/dist/components/machines/agent-status-icon.d.ts +6 -0
- package/dist/components/machines/machine-detail.d.ts +7 -1
- package/dist/components/machines/machine-status.d.ts +48 -0
- package/dist/components/markdown-table-layout.d.ts +18 -0
- package/dist/components/markdown.d.ts +37 -4
- package/dist/components/message-timeline.d.ts +86 -7
- package/dist/components/model-mark.d.ts +29 -0
- package/dist/components/model-policy-picker-menu.d.ts +9 -0
- package/dist/components/model-policy-picker.d.ts +35 -28
- package/dist/components/new-conversation.d.ts +32 -0
- package/dist/components/open-geni-chat.d.ts +73 -0
- package/dist/components/open-geni-links.d.ts +68 -0
- package/dist/components/openrouter-mark.d.ts +6 -0
- package/dist/components/opper-mark.d.ts +7 -0
- package/dist/components/preview-loading.d.ts +2 -0
- package/dist/components/provider-recovery-notice.d.ts +16 -0
- package/dist/components/queue-item-content.d.ts +9 -0
- package/dist/components/rehype-secret-refs.d.ts +23 -0
- package/dist/components/remark-soft-line-breaks.d.ts +38 -0
- package/dist/components/sandbox-files.d.ts +3 -1
- package/dist/components/sandbox-workspace.d.ts +18 -0
- package/dist/components/secret-question-field.d.ts +31 -0
- package/dist/components/secret-ref-chip.d.ts +35 -0
- package/dist/components/session-capability-frame.d.ts +37 -0
- package/dist/components/session-chrome.d.ts +57 -8
- package/dist/components/session-commands-panel.d.ts +6 -0
- package/dist/components/session-commands.d.ts +6 -0
- package/dist/components/session-connection-request.d.ts +8 -0
- package/dist/components/session-conversation.d.ts +157 -0
- package/dist/components/session-list.d.ts +39 -0
- package/dist/components/session-mcp-capability-card.d.ts +41 -0
- package/dist/components/session-proxy-scope.d.ts +35 -0
- package/dist/components/session-status.d.ts +4 -1
- package/dist/components/session-usage-limit-notice.d.ts +39 -0
- package/dist/components/timeline-anchor.d.ts +24 -0
- package/dist/components/timeline-annotation-chrome.d.ts +25 -0
- package/dist/components/timeline-annotation-layout.d.ts +42 -0
- package/dist/components/timeline-annotation-markers.d.ts +8 -0
- package/dist/components/timeline-annotation-reveal-context.d.ts +4 -0
- package/dist/components/timeline-annotation-shared.d.ts +31 -0
- package/dist/components/timeline-annotations-dialog.d.ts +3 -2
- package/dist/components/timeline-annotations.d.ts +13 -3
- package/dist/components/timeline-reading-progress.d.ts +11 -0
- package/dist/components/timeline-search.d.ts +34 -0
- package/dist/components/timeline-settlement.d.ts +16 -0
- package/dist/components/tool-action-review.d.ts +47 -0
- package/dist/components/tool-review-history.d.ts +25 -0
- package/dist/components/usage-limit-notice.d.ts +49 -0
- package/dist/components/usage-member-list.d.ts +91 -0
- package/dist/components/usage-meter.d.ts +73 -0
- package/dist/components/use-viewer-menu-dismiss.d.ts +2 -0
- package/dist/components/user-message-body.d.ts +10 -1
- package/dist/composer-messages.d.ts +74 -0
- package/dist/composer-messages.js +9 -0
- package/dist/composer-messages.js.map +1 -0
- package/dist/composer-voice-events.d.ts +8 -0
- package/dist/composer.d.ts +5 -4
- package/dist/composer.js +26 -13
- package/dist/computer-viewer-GMLDXPON.js +20 -0
- package/dist/computer-viewer-GMLDXPON.js.map +1 -0
- package/dist/connect-account-identity.d.ts +8 -0
- package/dist/connect-accounts.d.ts +15 -0
- package/dist/connect-chooser.d.ts +18 -0
- package/dist/connect-panel.d.ts +18 -0
- package/dist/connect-setup.d.ts +18 -0
- package/dist/connect.d.ts +21 -0
- package/dist/connect.js +2149 -0
- package/dist/connect.js.map +1 -0
- package/dist/connection-catalog.d.ts +38 -0
- package/dist/connection-discovery.d.ts +12 -0
- package/dist/connection-installed.d.ts +17 -0
- package/dist/connection-logo.d.ts +9 -0
- package/dist/connection-service-logo.d.ts +8 -0
- package/dist/connection-service-presentation.d.ts +13 -0
- package/dist/connection-skeleton.d.ts +5 -0
- package/dist/connection-type-picker.d.ts +6 -0
- package/dist/conversation-timeline.d.ts +5 -0
- package/dist/desktop.d.ts +7 -0
- package/dist/desktop.js +27 -0
- package/dist/desktop.js.map +1 -0
- package/dist/device-authorization.d.ts +23 -0
- package/dist/diffs.d.ts +8 -0
- package/dist/diffs.js +15 -0
- package/dist/diffs.js.map +1 -0
- package/dist/discovery-cache.d.ts +5 -0
- package/dist/editor.d.ts +7 -0
- package/dist/editor.js +22 -0
- package/dist/editor.js.map +1 -0
- package/dist/embedded-new-voice-OCRNT6U5.js +18 -0
- package/dist/embedded-new-voice-OCRNT6U5.js.map +1 -0
- package/dist/embedded-voice-RPHPYVBT.js +18 -0
- package/dist/embedded-voice-RPHPYVBT.js.map +1 -0
- package/dist/{fleet-decision-row-GGCAT4E4.js → fleet-decision-row-SI63O5V4.js} +4 -1
- package/dist/fleet-decision-row-SI63O5V4.js.map +1 -0
- package/dist/hooks/latest-question.d.ts +25 -0
- package/dist/hooks/shared-machines-list.d.ts +4 -0
- package/dist/hooks/shared-query.d.ts +113 -0
- package/dist/hooks/use-attached-browsers.d.ts +1 -1
- package/dist/hooks/use-auth-runs.d.ts +1 -4
- package/dist/hooks/use-available-models.d.ts +1 -1
- package/dist/hooks/use-browser-frame-stream.d.ts +1 -1
- package/dist/hooks/use-browser-session.d.ts +12 -1
- package/dist/hooks/use-client-config-flags.d.ts +49 -0
- package/dist/hooks/use-codex-accounts.d.ts +59 -10
- package/dist/hooks/use-composer.d.ts +24 -2
- package/dist/hooks/use-computer-frame-stream.d.ts +1 -1
- package/dist/hooks/use-computer-input-posture.d.ts +13 -0
- package/dist/hooks/use-computer-session.d.ts +4 -0
- package/dist/hooks/use-connect.d.ts +23 -0
- package/dist/hooks/use-desktop-stream.d.ts +1 -1
- package/dist/hooks/use-file-attachments.d.ts +12 -0
- package/dist/hooks/use-goal.d.ts +2 -1
- package/dist/hooks/use-last-started-turn-policy.d.ts +5 -1
- package/dist/hooks/use-new-conversation.d.ts +56 -0
- package/dist/hooks/use-new-session-draft.d.ts +74 -0
- package/dist/hooks/use-realtime-voice-models.d.ts +7 -0
- package/dist/hooks/use-sandbox-files.d.ts +4 -1
- package/dist/hooks/use-session-conversation.d.ts +49 -0
- package/dist/hooks/use-session-events.d.ts +26 -5
- package/dist/hooks/use-session-mcp-approval-policy.d.ts +2 -2
- package/dist/hooks/use-session-model-account.d.ts +48 -0
- package/dist/hooks/use-supergrok-accounts.d.ts +7 -1
- package/dist/hooks/use-terminal-stream.d.ts +11 -5
- package/dist/hooks/use-usage.d.ts +40 -0
- package/dist/hooks/use-vaults.d.ts +53 -0
- package/dist/hooks/use-voice-input.d.ts +8 -1
- package/dist/hooks/use-workspace-edit.d.ts +4 -0
- package/dist/hooks/use-workspace-sessions.d.ts +24 -5
- package/dist/human-input-model.d.ts +122 -0
- package/dist/identity-link-accounts.d.ts +11 -0
- package/dist/identity-link-consent.d.ts +18 -0
- package/dist/index.d.ts +82 -20
- package/dist/index.js +2340 -6603
- package/dist/index.js.map +1 -1
- package/dist/interaction.d.ts +1 -1
- package/dist/interaction.js +14 -24
- package/dist/interaction.js.map +1 -1
- package/dist/latest-question-R77KWSUP.js +118 -0
- package/dist/latest-question-R77KWSUP.js.map +1 -0
- package/dist/lib/clipboard.d.ts +7 -0
- package/dist/lib/error-message.d.ts +7 -0
- package/dist/lib/format.d.ts +58 -4
- package/dist/lib/host-theme.d.ts +77 -0
- package/dist/lib/interaction-errors.d.ts +3 -0
- package/dist/lib/menu-styles.d.ts +22 -0
- package/dist/lib/notify-observer.d.ts +2 -0
- package/dist/lib/pierre-diffs-loader.d.ts +20 -0
- package/dist/lib/provider-recovery.d.ts +55 -0
- package/dist/lib/scrollbars.d.ts +11 -0
- package/dist/lib/terminal-input-readiness.d.ts +11 -0
- package/dist/lib/transient-retry.d.ts +25 -0
- package/dist/lib/workbench-peers.d.ts +36 -0
- package/dist/lib/xterm-theme.d.ts +7 -5
- package/dist/machines.js +9 -5
- package/dist/markdown-table-layout-3PV2UAAH.js +113 -0
- package/dist/markdown-table-layout-3PV2UAAH.js.map +1 -0
- package/dist/mcp-connection-status.d.ts +14 -0
- package/dist/model-mark-paths.d.ts +34 -0
- package/dist/model-mark-paths.js +16 -0
- package/dist/model-mark-paths.js.map +1 -0
- package/dist/model-picker-model.d.ts +111 -0
- package/dist/model-picker-model.js +25 -0
- package/dist/model-picker-model.js.map +1 -0
- package/dist/model-policy-picker-menu-7GJ5URPR.js +17 -0
- package/dist/model-policy-picker-menu-7GJ5URPR.js.map +1 -0
- package/dist/model-policy.d.ts +30 -3
- package/dist/model-policy.js +14 -1
- package/dist/native-previews.d.ts +28 -0
- package/dist/native-previews.js +82 -0
- package/dist/native-previews.js.map +1 -0
- package/dist/new-session-draft.d.ts +7 -0
- package/dist/new-session-draft.js +639 -0
- package/dist/new-session-draft.js.map +1 -0
- package/dist/notification-text.d.ts +27 -0
- package/dist/{noto-sans-arabic-loader-IA2T4X2A.js → noto-sans-arabic-loader-XSH2KYWJ.js} +3 -1
- package/dist/{noto-sans-arabic-loader-IA2T4X2A.js.map → noto-sans-arabic-loader-XSH2KYWJ.js.map} +1 -1
- package/dist/{noto-sans-jp-loader.generated-HFGLYBR3.js → noto-sans-jp-loader.generated-MR5L6V7K.js} +3 -1
- package/dist/{noto-sans-jp-loader.generated-HFGLYBR3.js.map → noto-sans-jp-loader.generated-MR5L6V7K.js.map} +1 -1
- package/dist/older-history.d.ts +3 -2
- package/dist/organization-model.d.ts +32 -0
- package/dist/organization-model.js +65 -0
- package/dist/organization-model.js.map +1 -0
- package/dist/{platform-activity-row-BJHUHXAT.js → platform-activity-row-5OCKOQWZ.js} +16 -78
- package/dist/platform-activity-row-5OCKOQWZ.js.map +1 -0
- package/dist/plugin-details.d.ts +14 -0
- package/dist/plugin-discovery.d.ts +25 -0
- package/dist/preview-loading-paint.d.ts +20 -0
- package/dist/provider.d.ts +25 -2
- package/dist/queue-presentation-model.d.ts +72 -0
- package/dist/queue-presentation-model.js +38 -0
- package/dist/queue-presentation-model.js.map +1 -0
- package/dist/{queue-surface-implementation-BSKUWHRI.js → queue-surface-implementation-GJBH7NKO.js} +65 -265
- package/dist/queue-surface-implementation-GJBH7NKO.js.map +1 -0
- package/dist/realtime/embedded-new-voice.d.ts +1 -0
- package/dist/realtime/embedded-voice.d.ts +1 -0
- package/dist/realtime/realtime-control.d.ts +4 -65
- package/dist/realtime/session-realtime.d.ts +78 -0
- package/dist/realtime.js +25 -1333
- package/dist/realtime.js.map +1 -1
- package/dist/sandbox-files-O27IPOZW.js +21 -0
- package/dist/sandbox-files-O27IPOZW.js.map +1 -0
- package/dist/sandbox-label-model.d.ts +30 -0
- package/dist/sandbox-label-model.js +20 -0
- package/dist/sandbox-label-model.js.map +1 -0
- package/dist/scrollbars.d.ts +1 -0
- package/dist/scrollbars.js +10 -0
- package/dist/scrollbars.js.map +1 -0
- package/dist/secret-reference-label.d.ts +14 -0
- package/dist/secrets-ui.d.ts +57 -0
- package/dist/session-agents-model.d.ts +10 -0
- package/dist/session-agents-model.js +25 -0
- package/dist/session-agents-model.js.map +1 -0
- package/dist/session-attention-model.d.ts +8 -0
- package/dist/session-attention-model.js +47 -0
- package/dist/session-attention-model.js.map +1 -0
- package/dist/session-auth-recommendation.d.ts +5 -0
- package/dist/session-capability-policy.d.ts +31 -0
- package/dist/session-feedback-model.d.ts +20 -0
- package/dist/session-feedback-model.js +56 -0
- package/dist/session-feedback-model.js.map +1 -0
- package/dist/session-list-model.d.ts +138 -0
- package/dist/session-list-model.js +274 -0
- package/dist/session-list-model.js.map +1 -0
- package/dist/session-realtime-7DJOIHQW.js +21 -0
- package/dist/session-realtime-7DJOIHQW.js.map +1 -0
- package/dist/session-realtime.d.ts +7 -0
- package/dist/session-realtime.js +19 -0
- package/dist/session-realtime.js.map +1 -0
- package/dist/session-status-model.d.ts +36 -0
- package/dist/session-ui.d.ts +39 -1
- package/dist/session-ui.js +126 -12
- package/dist/session-ui.js.map +1 -1
- package/dist/session.d.ts +8 -2
- package/dist/session.js +35 -20
- package/dist/site-snapshot.d.ts +14 -0
- package/dist/sites-ui.d.ts +24 -0
- package/dist/sites.d.ts +3 -0
- package/dist/sites.js +14 -0
- package/dist/sites.js.map +1 -0
- package/dist/skill-discovery.d.ts +47 -0
- package/dist/terminal.d.ts +8 -0
- package/dist/terminal.js +32 -0
- package/dist/terminal.js.map +1 -0
- package/dist/testing/session-scenarios.d.ts +10 -0
- package/dist/testing/session-scenarios.js +367 -0
- package/dist/testing/session-scenarios.js.map +1 -0
- package/dist/timeline/activity-rail.d.ts +11 -2
- package/dist/timeline/agent-identity.d.ts +30 -0
- package/dist/timeline/agent-row.d.ts +31 -0
- package/dist/timeline/allowance-exhausted-row.d.ts +24 -0
- package/dist/timeline/compaction-copy.d.ts +46 -0
- package/dist/timeline/focus-sequence.d.ts +9 -0
- package/dist/timeline/genie-copy.d.ts +3 -0
- package/dist/timeline/genie-loading.d.ts +47 -0
- package/dist/timeline/index.d.ts +10 -5
- package/dist/timeline/knowledge-receipt.d.ts +17 -0
- package/dist/timeline/message-sender.d.ts +19 -0
- package/dist/timeline/notice-presentation.d.ts +13 -0
- package/dist/timeline/parsers.d.ts +11 -0
- package/dist/timeline/patch-apply-command.d.ts +18 -0
- package/dist/timeline/platform-activity-presentation.d.ts +21 -0
- package/dist/timeline/platform-activity-row.d.ts +1 -2
- package/dist/timeline/presented-image.d.ts +11 -0
- package/dist/timeline/projection.d.ts +31 -2
- package/dist/timeline/provider-logo.d.ts +15 -0
- package/dist/timeline/question-nav-model.d.ts +23 -0
- package/dist/timeline/registry.d.ts +12 -1
- package/dist/timeline/retained-image.d.ts +18 -0
- package/dist/timeline/retained-loaders.d.ts +27 -0
- package/dist/timeline/rolling-activity.d.ts +11 -0
- package/dist/timeline/screenshot-lightbox.d.ts +23 -1
- package/dist/timeline/session-usage-limit-row.d.ts +11 -0
- package/dist/timeline/shared.d.ts +4 -1
- package/dist/timeline/startup-dispatch-details.d.ts +5 -0
- package/dist/timeline/startup-preference.d.ts +3 -0
- package/dist/timeline/startup-timings.d.ts +4 -0
- package/dist/timeline/tool-display-name.d.ts +5 -2
- package/dist/timeline/tool-presentation.d.ts +172 -0
- package/dist/timeline/turn-summary-model.d.ts +95 -0
- package/dist/timeline/turn-summary.d.ts +20 -54
- package/dist/timeline/types.d.ts +179 -7
- package/dist/timeline/work-presentation.d.ts +60 -0
- package/dist/timeline-annotation-markers-U3G66KUD.js +166 -0
- package/dist/timeline-annotation-markers-U3G66KUD.js.map +1 -0
- package/dist/timeline-annotation-selection-BI7QTPTZ.js +242 -0
- package/dist/timeline-annotation-selection-BI7QTPTZ.js.map +1 -0
- package/dist/timeline-annotations-dialog-FOMHSDTE.js +274 -0
- package/dist/timeline-annotations-dialog-FOMHSDTE.js.map +1 -0
- package/dist/timeline-model.d.ts +29 -0
- package/dist/timeline-model.js +254 -0
- package/dist/timeline-model.js.map +1 -0
- package/dist/usage/allowance-copy.d.ts +25 -0
- package/dist/usage/session-usage-limit.d.ts +88 -0
- package/dist/usage/summary.d.ts +35 -0
- package/dist/usage.d.ts +17 -0
- package/dist/usage.js +1187 -0
- package/dist/usage.js.map +1 -0
- package/dist/voice-recording-owner.d.ts +7 -0
- package/package.json +106 -7
- package/src/approvals.ts +8 -1
- package/src/artifacts-spreadsheet.ts +1 -0
- package/src/artifacts.ts +44 -0
- package/src/assets/README.md +8 -0
- package/src/assets/gmail.ico +0 -0
- package/src/assets/outlook.ico +0 -0
- package/src/capability-catalog-row.tsx +94 -0
- package/src/capability-logo-fallback.ts +22 -0
- package/src/client.ts +20 -31
- package/src/commands/registry.ts +18 -15
- package/src/commands/types.ts +2 -0
- package/src/components/anthropic-mark.tsx +10 -0
- package/src/components/approval-surface.tsx +401 -138
- package/src/components/artifacts/artifact-chrome.tsx +413 -0
- package/src/components/artifacts/artifact-sandbox.tsx +193 -0
- package/src/components/artifacts/artifact-surface.tsx +40 -20
- package/src/components/artifacts/chat-interactive-block.tsx +260 -0
- package/src/components/artifacts/deferred-chat-media.tsx +67 -0
- package/src/components/artifacts/document-editor.tsx +141 -16
- package/src/components/artifacts/editable-artifact-ui.tsx +4 -2
- package/src/components/artifacts/editable-artifact-view.tsx +197 -0
- package/src/components/artifacts/editable-artifact-workbench.tsx +5 -2
- package/src/components/artifacts/editable-document.tsx +37 -36
- package/src/components/artifacts/editable-presentation.tsx +36 -18
- package/src/components/artifacts/editable-spreadsheet.tsx +543 -103
- package/src/components/artifacts/index.ts +45 -0
- package/src/components/artifacts/inline-html-document.ts +24 -0
- package/src/components/artifacts/latest-task-runner.ts +49 -0
- package/src/components/artifacts/presentation-editor.tsx +323 -67
- package/src/components/artifacts/published-html-artifact-frame.tsx +122 -5
- package/src/components/artifacts/session-artifact-viewer.tsx +378 -0
- package/src/components/artifacts/site-view.tsx +121 -0
- package/src/components/artifacts/spreadsheet-canvas.ts +5 -10
- package/src/components/artifacts/spreadsheet-command-queue.ts +184 -0
- package/src/components/artifacts/spreadsheet-download.tsx +109 -0
- package/src/components/artifacts/spreadsheet-general-display.ts +43 -0
- package/src/components/artifacts/spreadsheet-grid.tsx +344 -144
- package/src/components/artifacts/spreadsheet-resize.tsx +421 -0
- package/src/components/artifacts/spreadsheet-submissions.tsx +46 -0
- package/src/components/artifacts/visualization-assets/base.css +1015 -0
- package/src/components/artifacts/visualization-assets/helpers.html +349 -0
- package/src/components/artifacts/visualization-assets.gen.ts +3 -0
- package/src/components/browser-select-control.tsx +312 -0
- package/src/components/browser-viewer.tsx +778 -318
- package/src/components/chat-composer.tsx +47 -5
- package/src/components/child-session-link.tsx +36 -0
- package/src/components/claude-mark.tsx +11 -0
- package/src/components/code-editor.tsx +13 -16
- package/src/components/composer-transcription-control.tsx +128 -30
- package/src/components/composer.tsx +404 -195
- package/src/components/computer-viewer.tsx +880 -253
- package/src/components/copy-button.tsx +13 -5
- package/src/components/desktop-viewer.tsx +1 -1
- package/src/components/enrollment-consent.tsx +1 -1
- package/src/components/enrollment-device-flow.tsx +1 -1
- package/src/components/file-browser.tsx +10 -14
- package/src/components/fleet-tile.tsx +5 -3
- package/src/components/generated-video-player.tsx +4 -2
- package/src/components/grok-mark.tsx +34 -0
- package/src/components/human-input-form.tsx +590 -283
- package/src/components/human-input-surface.tsx +11 -0
- package/src/components/interaction-intervention-banner.tsx +2 -2
- package/src/components/linkified-text.tsx +79 -0
- package/src/components/machine-card.tsx +35 -78
- package/src/components/machine-dock-bar.tsx +1 -1
- package/src/components/machine-input-display.ts +197 -3
- package/src/components/machines/agent-status-icon.tsx +31 -0
- package/src/components/machines/machine-detail.tsx +200 -31
- package/src/components/machines/machine-operation-policy.tsx +1 -1
- package/src/components/machines/machine-status.ts +241 -0
- package/src/components/machines-dashboard.tsx +2 -17
- package/src/components/markdown-table-layout.ts +143 -0
- package/src/components/markdown.tsx +466 -129
- package/src/components/message-timeline.tsx +2370 -667
- package/src/components/model-mark.tsx +102 -0
- package/src/components/model-picker.tsx +15 -4
- package/src/components/model-policy-picker-menu.tsx +371 -0
- package/src/components/model-policy-picker.tsx +252 -429
- package/src/components/new-conversation.tsx +221 -0
- package/src/components/open-geni-chat.tsx +309 -0
- package/src/components/open-geni-links.tsx +179 -0
- package/src/components/openrouter-mark.tsx +13 -0
- package/src/components/opper-mark.tsx +18 -0
- package/src/components/pierre-diff.tsx +41 -16
- package/src/components/pierre-file.tsx +35 -10
- package/src/components/preview-loading.tsx +109 -0
- package/src/components/provider-recovery-notice.tsx +49 -0
- package/src/components/queue-item-content.ts +14 -0
- package/src/components/queue-surface-implementation.tsx +51 -356
- package/src/components/queue-surface-state.tsx +3 -1
- package/src/components/rehype-secret-refs.ts +98 -0
- package/src/components/remark-soft-line-breaks.ts +166 -0
- package/src/components/sandbox-files.tsx +91 -15
- package/src/components/sandbox-terminal.tsx +84 -13
- package/src/components/sandbox-workspace.tsx +147 -51
- package/src/components/secret-question-field.tsx +324 -0
- package/src/components/secret-ref-chip.tsx +185 -0
- package/src/components/session-capability-frame.tsx +197 -0
- package/src/components/session-chrome.tsx +842 -251
- package/src/components/session-commands-panel.tsx +126 -0
- package/src/components/session-commands.tsx +18 -0
- package/src/components/session-connection-request.tsx +97 -0
- package/src/components/session-conversation.tsx +876 -0
- package/src/components/session-list.tsx +257 -0
- package/src/components/session-mcp-capability-card.tsx +680 -0
- package/src/components/session-proxy-scope.tsx +153 -0
- package/src/components/session-status.tsx +26 -17
- package/src/components/session-usage-limit-notice.tsx +174 -0
- package/src/components/timeline-anchor.tsx +119 -0
- package/src/components/timeline-annotation-chrome.tsx +196 -0
- package/src/components/timeline-annotation-layout.ts +268 -0
- package/src/components/timeline-annotation-markers.tsx +185 -0
- package/src/components/timeline-annotation-reveal-context.ts +9 -0
- package/src/components/timeline-annotation-selection.tsx +106 -54
- package/src/components/timeline-annotation-shared.ts +245 -0
- package/src/components/timeline-annotations-dialog.tsx +185 -128
- package/src/components/timeline-annotations.tsx +189 -45
- package/src/components/timeline-reading-progress.ts +80 -0
- package/src/components/timeline-search.tsx +168 -0
- package/src/components/timeline-settlement.ts +60 -0
- package/src/components/tool-action-review.tsx +650 -0
- package/src/components/tool-review-history.tsx +88 -0
- package/src/components/usage-limit-notice.tsx +179 -0
- package/src/components/usage-member-list.tsx +792 -0
- package/src/components/usage-meter.tsx +382 -0
- package/src/components/use-viewer-menu-dismiss.ts +33 -0
- package/src/components/user-message-body.tsx +27 -2
- package/src/components/workspace-dock.tsx +18 -1
- package/src/composer-messages.ts +150 -0
- package/src/composer-voice-events.ts +12 -0
- package/src/composer.ts +6 -1
- package/src/connect-account-identity.tsx +34 -0
- package/src/connect-accounts.tsx +233 -0
- package/src/connect-chooser.tsx +336 -0
- package/src/connect-panel.tsx +99 -0
- package/src/connect-setup.tsx +355 -0
- package/src/connect.ts +60 -0
- package/src/connection-assets.d.ts +4 -0
- package/src/connection-catalog.tsx +162 -0
- package/src/connection-discovery.tsx +238 -0
- package/src/connection-installed.tsx +51 -0
- package/src/connection-logo.tsx +37 -0
- package/src/connection-service-logo.tsx +55 -0
- package/src/connection-service-presentation.ts +46 -0
- package/src/connection-skeleton.tsx +16 -0
- package/src/connection-type-picker.tsx +36 -0
- package/src/conversation-timeline.ts +92 -0
- package/src/desktop.ts +24 -0
- package/src/device-authorization.tsx +98 -0
- package/src/diffs.ts +16 -0
- package/src/discovery-cache.ts +42 -0
- package/src/editor.ts +13 -0
- package/src/hooks/internal.ts +3 -2
- package/src/hooks/latest-question.ts +164 -0
- package/src/hooks/shared-machines-list.ts +34 -1
- package/src/hooks/shared-query.ts +721 -0
- package/src/hooks/use-attached-browsers.ts +1 -1
- package/src/hooks/use-auth-runs.ts +0 -27
- package/src/hooks/use-available-models.ts +2 -2
- package/src/hooks/use-browser-frame-stream.ts +19 -2
- package/src/hooks/use-browser-session.ts +680 -205
- package/src/hooks/use-browser-sessions.ts +32 -1
- package/src/hooks/use-client-config-flags.ts +118 -0
- package/src/hooks/use-codex-accounts.ts +247 -47
- package/src/hooks/use-composer.ts +227 -44
- package/src/hooks/use-computer-frame-stream.ts +25 -7
- package/src/hooks/use-computer-input-posture.ts +94 -0
- package/src/hooks/use-computer-session.ts +409 -95
- package/src/hooks/use-connect.ts +23 -0
- package/src/hooks/use-desktop-stream.ts +19 -28
- package/src/hooks/use-file-attachments.ts +80 -4
- package/src/hooks/use-goal.ts +79 -9
- package/src/hooks/use-last-started-turn-policy.ts +37 -11
- package/src/hooks/use-machines.ts +4 -0
- package/src/hooks/use-new-conversation.ts +374 -0
- package/src/hooks/use-new-session-draft.ts +813 -0
- package/src/hooks/use-realtime-voice-models.ts +46 -0
- package/src/hooks/use-sandbox-files.ts +68 -20
- package/src/hooks/use-session-background-commands.ts +22 -11
- package/src/hooks/use-session-capabilities.ts +3 -2
- package/src/hooks/use-session-conversation.ts +150 -0
- package/src/hooks/use-session-events.ts +531 -335
- package/src/hooks/use-session-mcp-approval-policy.ts +13 -5
- package/src/hooks/use-session-model-account.ts +174 -0
- package/src/hooks/use-session.ts +30 -2
- package/src/hooks/use-slash-commands.ts +6 -11
- package/src/hooks/use-supergrok-accounts.ts +22 -8
- package/src/hooks/use-terminal-stream.ts +153 -27
- package/src/hooks/use-transcription.ts +6 -0
- package/src/hooks/use-turn-queue.ts +2 -1
- package/src/hooks/use-usage.ts +100 -0
- package/src/hooks/use-vaults.ts +153 -0
- package/src/hooks/use-video-artifact-playback.ts +1 -1
- package/src/hooks/use-voice-input.ts +127 -19
- package/src/hooks/use-workspace-capture.ts +3 -2
- package/src/hooks/use-workspace-edit.ts +23 -5
- package/src/hooks/use-workspace-sessions.ts +74 -7
- package/src/human-input-model.ts +359 -0
- package/src/identity-link-accounts.tsx +148 -0
- package/src/identity-link-consent.tsx +192 -0
- package/src/index.ts +262 -16
- package/src/interaction.ts +1 -0
- package/src/lib/clipboard.ts +29 -0
- package/src/lib/error-message.ts +37 -0
- package/src/lib/format.ts +205 -10
- package/src/lib/host-theme.ts +529 -0
- package/src/lib/interaction-errors.ts +15 -0
- package/src/lib/menu-styles.ts +44 -0
- package/src/lib/notify-observer.ts +15 -0
- package/src/lib/pierre-diffs-loader.ts +53 -0
- package/src/lib/provider-recovery.ts +243 -0
- package/src/lib/scrollbars.ts +30 -0
- package/src/lib/terminal-input-readiness.ts +51 -0
- package/src/lib/transient-retry.ts +99 -0
- package/src/lib/workbench-peers.ts +62 -0
- package/src/lib/xterm-theme.ts +23 -21
- package/src/mcp-connection-status.ts +35 -0
- package/src/model-mark-paths.ts +53 -0
- package/src/model-picker-model.ts +330 -0
- package/src/model-policy.ts +299 -74
- package/src/native-previews.ts +100 -0
- package/src/new-session-draft.ts +22 -0
- package/src/notification-text.ts +81 -0
- package/src/older-history.ts +22 -4
- package/src/organization-model.ts +118 -0
- package/src/plugin-details.tsx +185 -0
- package/src/plugin-discovery.tsx +196 -0
- package/src/preview-loading-paint.ts +68 -0
- package/src/provider.tsx +74 -15
- package/src/queue-presentation-model.ts +464 -0
- package/src/realtime/dropdown-menu.tsx +19 -12
- package/src/realtime/embedded-new-voice.tsx +1 -0
- package/src/realtime/embedded-voice.tsx +3 -0
- package/src/realtime/realtime-control.tsx +138 -550
- package/src/realtime/session-realtime.ts +566 -0
- package/src/sandbox-label-model.ts +53 -0
- package/src/scrollbars.ts +3 -0
- package/src/secret-reference-label.ts +43 -0
- package/src/secrets-ui.tsx +59 -0
- package/src/session-agents-model.ts +33 -0
- package/src/session-attention-model.ts +62 -0
- package/src/session-auth-recommendation.ts +48 -0
- package/src/session-capability-policy.ts +196 -0
- package/src/session-context.ts +3 -4
- package/src/session-feedback-model.ts +95 -0
- package/src/session-list-model.ts +434 -0
- package/src/session-realtime.ts +18 -0
- package/src/session-status-model.ts +99 -0
- package/src/session-ui.ts +98 -1
- package/src/session.ts +17 -1
- package/src/site-snapshot.ts +74 -0
- package/src/sites-ui.tsx +348 -0
- package/src/sites.ts +3 -0
- package/src/skill-discovery.tsx +208 -0
- package/src/terminal.ts +26 -0
- package/src/testing/session-scenarios.ts +404 -0
- package/src/timeline/activity-rail.tsx +242 -101
- package/src/timeline/agent-identity.tsx +84 -0
- package/src/timeline/agent-row.tsx +231 -0
- package/src/timeline/allowance-exhausted-row.tsx +86 -0
- package/src/timeline/compaction-copy.ts +115 -0
- package/src/timeline/fleet-decision-projection.ts +2 -1
- package/src/timeline/fleet-decision-row.tsx +1 -0
- package/src/timeline/focus-sequence.ts +44 -0
- package/src/timeline/genie-copy.ts +19 -0
- package/src/timeline/genie-loading.tsx +143 -0
- package/src/timeline/index.ts +30 -2
- package/src/timeline/knowledge-receipt.tsx +100 -0
- package/src/timeline/message-sender.tsx +71 -0
- package/src/timeline/notice-presentation.ts +48 -0
- package/src/timeline/parsers.ts +42 -2
- package/src/timeline/patch-apply-command.tsx +135 -0
- package/src/timeline/platform-activity-presentation.ts +166 -0
- package/src/timeline/platform-activity-row.tsx +15 -90
- package/src/timeline/presented-image.ts +63 -0
- package/src/timeline/projection.ts +1742 -76
- package/src/timeline/provider-logo.tsx +53 -0
- package/src/timeline/question-nav-model.ts +28 -0
- package/src/timeline/registry.ts +26 -4
- package/src/timeline/retained-image.ts +97 -0
- package/src/timeline/retained-loaders.ts +91 -0
- package/src/timeline/rolling-activity.tsx +80 -0
- package/src/timeline/screenshot-lightbox.tsx +228 -5
- package/src/timeline/session-usage-limit-row.tsx +42 -0
- package/src/timeline/shared.tsx +42 -15
- package/src/timeline/startup-dispatch-details.tsx +36 -0
- package/src/timeline/startup-preference.ts +33 -0
- package/src/timeline/startup-timings.tsx +145 -0
- package/src/timeline/tool-display-name.ts +19 -7
- package/src/timeline/tool-presentation.ts +1316 -0
- package/src/timeline/tool-renderers.tsx +835 -1138
- package/src/timeline/turn-summary-model.ts +343 -0
- package/src/timeline/turn-summary.tsx +272 -365
- package/src/timeline/types.ts +189 -6
- package/src/timeline/work-presentation.ts +189 -0
- package/src/timeline-model.ts +143 -0
- package/src/usage/allowance-copy.ts +64 -0
- package/src/usage/session-usage-limit.ts +266 -0
- package/src/usage/summary.ts +93 -0
- package/src/usage.ts +70 -0
- package/src/voice-recording-owner.ts +22 -0
- package/styles/compiled.css +2319 -748
- package/styles/connect.css +290 -0
- package/styles/connect.d.ts +1 -0
- package/styles/effective-tokens.css +1 -0
- package/styles/index.css +309 -9
- package/styles/responsive.css +99 -7
- package/styles/session-capability.css +44 -0
- package/styles/tokens.css +134 -66
- package/dist/browser-viewer-MKKFRRRV.js +0 -14
- package/dist/chunk-2DZVYHVO.js +0 -470
- package/dist/chunk-2DZVYHVO.js.map +0 -1
- package/dist/chunk-3AGBGTRT.js.map +0 -1
- package/dist/chunk-4MDLEHXL.js.map +0 -1
- package/dist/chunk-5YK2ZDIG.js.map +0 -1
- package/dist/chunk-7EAFGICR.js +0 -302
- package/dist/chunk-7EAFGICR.js.map +0 -1
- package/dist/chunk-ELIYWBZR.js.map +0 -1
- package/dist/chunk-H5YGYNXS.js.map +0 -1
- package/dist/chunk-HUIKIDM5.js.map +0 -1
- package/dist/chunk-ICA6R6TW.js.map +0 -1
- package/dist/chunk-IOLVN74D.js.map +0 -1
- package/dist/chunk-JAQ5K7W6.js.map +0 -1
- package/dist/chunk-JVYQRRC4.js.map +0 -1
- package/dist/chunk-KCGXPP5V.js.map +0 -1
- package/dist/chunk-KZ73RL76.js.map +0 -1
- package/dist/chunk-NEXLLTP4.js.map +0 -1
- package/dist/chunk-PEI6RANI.js.map +0 -1
- package/dist/chunk-VTOREEXF.js +0 -142
- package/dist/chunk-VTOREEXF.js.map +0 -1
- package/dist/chunk-WSK7G5LE.js +0 -170
- package/dist/chunk-WSK7G5LE.js.map +0 -1
- package/dist/chunk-X4A66EWZ.js +0 -223
- package/dist/chunk-X4A66EWZ.js.map +0 -1
- package/dist/chunk-XYRDDSXF.js.map +0 -1
- package/dist/chunk-YG4QEQF5.js +0 -9557
- package/dist/chunk-YG4QEQF5.js.map +0 -1
- package/dist/chunk-YVCHAQZY.js.map +0 -1
- package/dist/chunk-ZPBTI3TE.js.map +0 -1
- package/dist/computer-viewer-FWEZISW4.js +0 -16
- package/dist/fleet-decision-row-GGCAT4E4.js.map +0 -1
- package/dist/hooks/use-environments.d.ts +0 -41
- package/dist/hooks/use-packs.d.ts +0 -32
- package/dist/platform-activity-row-BJHUHXAT.js.map +0 -1
- package/dist/queue-surface-implementation-BSKUWHRI.js.map +0 -1
- package/dist/timeline-annotation-selection-3L7LHGG2.js +0 -187
- package/dist/timeline-annotation-selection-3L7LHGG2.js.map +0 -1
- package/dist/timeline-annotations-dialog-U7EVLR75.js +0 -196
- package/dist/timeline-annotations-dialog-U7EVLR75.js.map +0 -1
- package/src/hooks/use-environments.ts +0 -182
- package/src/hooks/use-packs.ts +0 -157
- /package/dist/{browser-viewer-MKKFRRRV.js.map → browser-viewer-ZWR6MWJ7.js.map} +0 -0
- /package/dist/{computer-viewer-FWEZISW4.js.map → chat-interactive-block-4EUKJXUO.js.map} +0 -0
|
@@ -0,0 +1,876 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveWorkspaceVoiceInputEnabled,
|
|
3
|
+
SESSION_SCOPE_HEADER,
|
|
4
|
+
type ClientVoiceInputConfig,
|
|
5
|
+
type OpenGeniClient,
|
|
6
|
+
} from "@opengeni/sdk";
|
|
7
|
+
import {
|
|
8
|
+
lazy,
|
|
9
|
+
Suspense,
|
|
10
|
+
useCallback,
|
|
11
|
+
useEffect,
|
|
12
|
+
useMemo,
|
|
13
|
+
useRef,
|
|
14
|
+
useState,
|
|
15
|
+
type ComponentProps,
|
|
16
|
+
type CSSProperties,
|
|
17
|
+
} from "react";
|
|
18
|
+
import type { SiteSnapshotClient } from "./artifacts/chat-interactive-block";
|
|
19
|
+
import type { ClientOverride } from "../session-context";
|
|
20
|
+
import { ModelPolicyPicker, type ModelPolicyPickerProps } from "./model-policy-picker";
|
|
21
|
+
import {
|
|
22
|
+
useSessionConversation,
|
|
23
|
+
type SessionConversationController,
|
|
24
|
+
type UseSessionConversationOptions,
|
|
25
|
+
} from "../hooks/use-session-conversation";
|
|
26
|
+
import { useGoal, type UseGoalOptions } from "../hooks/use-goal";
|
|
27
|
+
import {
|
|
28
|
+
createSessionRetainedScreenshotLoader,
|
|
29
|
+
createWorkspaceRetainedArtifactLoader,
|
|
30
|
+
createWorkspaceRetainedVideoLoader,
|
|
31
|
+
} from "../timeline/retained-loaders";
|
|
32
|
+
import { useRealtimeVoiceModels } from "../hooks/use-realtime-voice-models";
|
|
33
|
+
import type { SessionRealtimeControl } from "../realtime/realtime-control";
|
|
34
|
+
import { EMBEDDED_GENIE_LOADING, type GenieLoadingOptions } from "../timeline/genie-loading";
|
|
35
|
+
import { ApprovalSurface } from "./approval-surface";
|
|
36
|
+
import { ChatComposer, type ChatComposerProps } from "./chat-composer";
|
|
37
|
+
import type { ComposerTranscriptionControlProps } from "./composer-transcription-control";
|
|
38
|
+
import { SessionChrome, type SessionChromeProps } from "./session-chrome";
|
|
39
|
+
import { HumanInputSurface, type HumanInputSurfaceProps } from "./human-input-surface";
|
|
40
|
+
import { MessageTimeline, type MessageTimelineProps } from "./message-timeline";
|
|
41
|
+
import { ProviderRecoveryNotice } from "./provider-recovery-notice";
|
|
42
|
+
import { currentProviderRecovery } from "../lib/provider-recovery";
|
|
43
|
+
import {
|
|
44
|
+
chainLinkResolvers,
|
|
45
|
+
sessionLinkResolver,
|
|
46
|
+
useOpenGeniLinkResolver,
|
|
47
|
+
viewerLinkResolver,
|
|
48
|
+
type OpenGeniLinkResolver,
|
|
49
|
+
type OpenGeniViewerTarget,
|
|
50
|
+
} from "./open-geni-links";
|
|
51
|
+
import type { UserMessageDisclosureLabels } from "./user-message-body";
|
|
52
|
+
import { cn } from "../lib/cn";
|
|
53
|
+
import { SessionProxyScope, type SessionProxyBaseUrl } from "./session-proxy-scope";
|
|
54
|
+
import { useErrorMessage } from "../lib/error-message";
|
|
55
|
+
import {
|
|
56
|
+
useHostTheme,
|
|
57
|
+
type HostSurfacePreference,
|
|
58
|
+
type HostThemePreference,
|
|
59
|
+
} from "../lib/host-theme";
|
|
60
|
+
|
|
61
|
+
export type SessionConversationLabels = {
|
|
62
|
+
/** Banner action after a refresh failure; the conversation stays mounted. */
|
|
63
|
+
retry: string;
|
|
64
|
+
/** Action when the conversation could not load at all. */
|
|
65
|
+
tryAgain: string;
|
|
66
|
+
/** Shown in place of a Site preview when the session proxy does not serve Sites. */
|
|
67
|
+
sitePreviewUnavailable: string;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const DEFAULT_CONVERSATION_LABELS: SessionConversationLabels = {
|
|
71
|
+
retry: "Retry",
|
|
72
|
+
tryAgain: "Try again",
|
|
73
|
+
sitePreviewUnavailable: "Site preview unavailable",
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export type SessionConversationProps = ClientOverride &
|
|
77
|
+
SessionProxyBaseUrl & {
|
|
78
|
+
sessionId: string;
|
|
79
|
+
/** Host-owned artifact links, previews and other message presentation. */
|
|
80
|
+
renderMessageText?: MessageTimelineProps["renderMessageText"];
|
|
81
|
+
/**
|
|
82
|
+
* Open Opengeni object links in agent replies (`artifact:`, `sandbox:`,
|
|
83
|
+
* editable artifacts, Sites). Asked first; by default retained files and
|
|
84
|
+
* sandbox files download only when the proxy explicitly enables them, while
|
|
85
|
+
* editable artifacts and Sites stay unavailable until the host resolves them.
|
|
86
|
+
*/
|
|
87
|
+
resolveLink?: OpenGeniLinkResolver | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* Open agent links to editable artifacts and Sites in a host viewer, for
|
|
90
|
+
* example `SessionArtifactViewer` mounted beside the conversation. Asked
|
|
91
|
+
* after `resolveLink`.
|
|
92
|
+
*/
|
|
93
|
+
onOpenArtifact?: ((target: OpenGeniViewerTarget) => void) | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Open another session the conversation points at: a sub-agent's chat from
|
|
96
|
+
* its worker card or a child update. `OpenGeniChat` opens it in place;
|
|
97
|
+
* without it those entries are not links.
|
|
98
|
+
*/
|
|
99
|
+
onOpenSession?: ((sessionId: string) => void) | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Current title for a session id, used to name the agents this
|
|
102
|
+
* conversation spawns, messages, and hears from. Without it, agents keep
|
|
103
|
+
* the title they were spawned with, or generic labels.
|
|
104
|
+
*/
|
|
105
|
+
resolveSessionTitle?: ((sessionId: string) => string | null | undefined) | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Inline previews for assistant `opengeni-site` / `opengeni-html` fences.
|
|
108
|
+
* Defaults to the Opengeni preview. Behind a session proxy without its
|
|
109
|
+
* `artifacts` option, Sites show as unavailable without a request; `false`
|
|
110
|
+
* shows the fence as code.
|
|
111
|
+
*/
|
|
112
|
+
renderInteractiveBlock?: MessageTimelineProps["renderInteractiveBlock"] | false;
|
|
113
|
+
/** Product-specific tool-call renderers; defaults to the built-in registry. */
|
|
114
|
+
toolRegistry?: MessageTimelineProps["toolRegistry"];
|
|
115
|
+
/** Host presentation without replacing native history, navigation or annotations. */
|
|
116
|
+
timelineProps?:
|
|
117
|
+
| Pick<
|
|
118
|
+
MessageTimelineProps,
|
|
119
|
+
"turnSummary" | "renderAuthNeeded" | "emptyState" | "renderMessageSender"
|
|
120
|
+
>
|
|
121
|
+
| undefined;
|
|
122
|
+
/**
|
|
123
|
+
* Replace the "usage limit reached" row for an `allowance_exhausted`
|
|
124
|
+
* refusal, for example to link your own plan or admin page.
|
|
125
|
+
*/
|
|
126
|
+
renderAllowanceExhausted?: MessageTimelineProps["renderAllowanceExhausted"];
|
|
127
|
+
/** Replace the words of the default "usage limit reached" row. */
|
|
128
|
+
allowanceExhaustedLabels?: MessageTimelineProps["allowanceExhaustedLabels"];
|
|
129
|
+
/**
|
|
130
|
+
* File attachments in the composer. Defaults to true; the attach control
|
|
131
|
+
* appears only when the deployment's client config enables file uploads.
|
|
132
|
+
* A session proxy reports them off when `files` is false and for anonymous
|
|
133
|
+
* visitors (`visitor: true` from `resolve`) unless it sets `visitorUploads`.
|
|
134
|
+
*/
|
|
135
|
+
attachments?: boolean | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* Composer microphone (dictation into the draft). Defaults to true; it
|
|
138
|
+
* appears only when the client config reports voice input available
|
|
139
|
+
* (`createSessionProxyHandler({ voiceInput: false })` turns it off).
|
|
140
|
+
*/
|
|
141
|
+
voiceInput?: boolean | undefined;
|
|
142
|
+
/**
|
|
143
|
+
* Live speech-to-speech voice in the composer. Opt-in: a call spends the
|
|
144
|
+
* workspace's credits and asks for the microphone, so it is off unless this
|
|
145
|
+
* is `true` or the client config reports `realtimeVoice: true`
|
|
146
|
+
* (`createSessionProxyHandler({ realtimeVoice: true })`). The button then
|
|
147
|
+
* appears only when the workspace offers an available voice model and the
|
|
148
|
+
* proxy has not turned voice off (`realtimeVoice: false`).
|
|
149
|
+
*/
|
|
150
|
+
realtimeVoice?: boolean | undefined;
|
|
151
|
+
/** Optional connection/voice handoff; the stock control owns call lifecycle and admission. */
|
|
152
|
+
realtimeVoiceProps?:
|
|
153
|
+
| Partial<
|
|
154
|
+
Pick<
|
|
155
|
+
ComponentProps<typeof SessionRealtimeControl>,
|
|
156
|
+
| "codexConnected"
|
|
157
|
+
| "realtimeAutostartModel"
|
|
158
|
+
| "onRealtimeAutostartConsumed"
|
|
159
|
+
| "onVoiceActiveChange"
|
|
160
|
+
| "modelMenu"
|
|
161
|
+
>
|
|
162
|
+
>
|
|
163
|
+
| undefined;
|
|
164
|
+
/**
|
|
165
|
+
* Copy and visual for the "working" indicator before the first reply.
|
|
166
|
+
* Defaults to neutral copy ("Thinking…"); omitted fields keep those
|
|
167
|
+
* defaults. See `MessageTimeline`'s `genieLoading`.
|
|
168
|
+
*/
|
|
169
|
+
genieLoading?: GenieLoadingOptions | undefined;
|
|
170
|
+
/**
|
|
171
|
+
* Show the model/reasoning picker. End users of an embedded product rarely
|
|
172
|
+
* choose models, so it is hidden unless this is `true` or the client config
|
|
173
|
+
* reports `modelSelection: true` (`createSessionProxyHandler({ modelSelection: true })`).
|
|
174
|
+
*/
|
|
175
|
+
modelPicker?: boolean | undefined;
|
|
176
|
+
/** Model-picker appearance only; visibility, policy and delivery remain owned here. */
|
|
177
|
+
modelPickerProps?: Pick<ModelPolicyPickerProps, "groupPresentation" | "messages"> | undefined;
|
|
178
|
+
/** Localized actions for already-sent user-message disclosure. */
|
|
179
|
+
userMessageDisclosureLabels?: UserMessageDisclosureLabels | undefined;
|
|
180
|
+
loadSkillReview?: HumanInputSurfaceProps["loadSkillReview"];
|
|
181
|
+
className?: string;
|
|
182
|
+
/** Defaults to filling the host. The host owns available height. */
|
|
183
|
+
height?: CSSProperties["height"];
|
|
184
|
+
/**
|
|
185
|
+
* Light or dark. Defaults to `auto`: follow the host page (an enclosing
|
|
186
|
+
* `data-og-theme`, `class="dark"`/`data-theme` on <html> or <body>, the
|
|
187
|
+
* host's `color-scheme`, then its background), not the OS setting alone.
|
|
188
|
+
*/
|
|
189
|
+
theme?: HostThemePreference | undefined;
|
|
190
|
+
/**
|
|
191
|
+
* `host` (default) derives backgrounds and cards from the host background so
|
|
192
|
+
* the conversation blends in; `theme` uses the `--og-color-*` surface tokens
|
|
193
|
+
* as they are. Customized surface tokens are always kept.
|
|
194
|
+
*/
|
|
195
|
+
surface?: HostSurfacePreference | undefined;
|
|
196
|
+
/** Conversation-owned copy (error actions). */
|
|
197
|
+
labels?: Partial<SessionConversationLabels> | undefined;
|
|
198
|
+
/** Presentation/custom controls only; queue and delivery wiring stay owned here. */
|
|
199
|
+
composerProps?: Omit<
|
|
200
|
+
ChatComposerProps,
|
|
201
|
+
"composer" | "effectiveControl" | "queuedAheadCount" | "attachments"
|
|
202
|
+
>;
|
|
203
|
+
/** Optional host context and notifications; stock delivery remains authoritative. */
|
|
204
|
+
composerOptions?: UseSessionConversationOptions["composerOptions"];
|
|
205
|
+
/** Extra status panels without replacing stock queue/goal behavior. */
|
|
206
|
+
chromeProps?: Omit<
|
|
207
|
+
SessionChromeProps,
|
|
208
|
+
"queue" | "composer" | "goal" | "sessionStatus" | "readOnly" | "onComposerFocus"
|
|
209
|
+
>;
|
|
210
|
+
/** Localized questions and presentation; responses remain stock. */
|
|
211
|
+
humanInputProps?: Pick<
|
|
212
|
+
HumanInputSurfaceProps,
|
|
213
|
+
"messages" | "autoFocus" | "decisionButtons" | "allowedSaveTo" | "className"
|
|
214
|
+
>;
|
|
215
|
+
/** Product approval presentation; permission decisions remain stock. */
|
|
216
|
+
approvalProps?: Omit<
|
|
217
|
+
ComponentProps<typeof ApprovalSurface>,
|
|
218
|
+
"approvals" | "onApprove" | "onReject" | "responding" | "error"
|
|
219
|
+
>;
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
export type SessionConversationViewProps = Omit<
|
|
223
|
+
SessionConversationProps,
|
|
224
|
+
| "sessionId"
|
|
225
|
+
| "client"
|
|
226
|
+
| "workspaceId"
|
|
227
|
+
| "baseUrl"
|
|
228
|
+
| "headers"
|
|
229
|
+
| "fetch"
|
|
230
|
+
| "attachments"
|
|
231
|
+
| "modelPicker"
|
|
232
|
+
| "composerOptions"
|
|
233
|
+
> & {
|
|
234
|
+
conversation: SessionConversationController;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
/** Complete existing-session conversation. Uses the provider's normal SDK client
|
|
238
|
+
* (including Site clients), one shared event feed, and authoritative queue state.
|
|
239
|
+
* `<SessionConversation baseUrl="/api/opengeni" sessionId={id} />` needs no
|
|
240
|
+
* provider: it talks to your session proxy and its resolved workspace. */
|
|
241
|
+
export function SessionConversation({
|
|
242
|
+
baseUrl,
|
|
243
|
+
headers,
|
|
244
|
+
fetch,
|
|
245
|
+
...props
|
|
246
|
+
}: SessionConversationProps) {
|
|
247
|
+
if (baseUrl === undefined) return <RetryingConversation {...props} />;
|
|
248
|
+
const { client, workspaceId, ...rest } = props;
|
|
249
|
+
return (
|
|
250
|
+
<SessionProxyScope
|
|
251
|
+
baseUrl={baseUrl}
|
|
252
|
+
workspaceId={workspaceId}
|
|
253
|
+
client={client}
|
|
254
|
+
headers={headers}
|
|
255
|
+
fetch={fetch}
|
|
256
|
+
>
|
|
257
|
+
<RetryingConversation {...rest} />
|
|
258
|
+
</SessionProxyScope>
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function RetryingConversation(props: Omit<SessionConversationProps, "baseUrl">) {
|
|
263
|
+
// A failed initial load retries by remounting the whole conversation.
|
|
264
|
+
const [attempt, setAttempt] = useState(0);
|
|
265
|
+
return (
|
|
266
|
+
<Conversation
|
|
267
|
+
key={`${props.workspaceId ?? ""}:${props.sessionId}:${attempt}`}
|
|
268
|
+
{...props}
|
|
269
|
+
onRetry={() => setAttempt((value) => value + 1)}
|
|
270
|
+
/>
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function Conversation(props: SessionConversationProps & { onRetry: () => void }) {
|
|
275
|
+
const conversation = useSessionConversation(props.sessionId, props);
|
|
276
|
+
return <ConversationView {...props} conversation={conversation} />;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/** Stock view for a controller mounted in a stable host. No second event feed or draft. */
|
|
280
|
+
export function SessionConversationView(props: SessionConversationViewProps) {
|
|
281
|
+
return (
|
|
282
|
+
<ConversationView
|
|
283
|
+
key={`${props.conversation.workspaceId}:${props.conversation.sessionId}`}
|
|
284
|
+
{...props}
|
|
285
|
+
onRetry={() => void props.conversation.retry()}
|
|
286
|
+
/>
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function ConversationView({
|
|
291
|
+
conversation,
|
|
292
|
+
renderMessageText,
|
|
293
|
+
resolveLink,
|
|
294
|
+
onOpenArtifact,
|
|
295
|
+
onOpenSession,
|
|
296
|
+
resolveSessionTitle,
|
|
297
|
+
renderInteractiveBlock,
|
|
298
|
+
toolRegistry,
|
|
299
|
+
timelineProps,
|
|
300
|
+
renderAllowanceExhausted,
|
|
301
|
+
allowanceExhaustedLabels,
|
|
302
|
+
voiceInput: voiceInputRequested = true,
|
|
303
|
+
realtimeVoice: realtimeVoiceProp,
|
|
304
|
+
realtimeVoiceProps,
|
|
305
|
+
genieLoading,
|
|
306
|
+
modelPickerProps,
|
|
307
|
+
userMessageDisclosureLabels,
|
|
308
|
+
loadSkillReview,
|
|
309
|
+
className,
|
|
310
|
+
height = "100%",
|
|
311
|
+
theme,
|
|
312
|
+
surface,
|
|
313
|
+
labels: labelOverrides,
|
|
314
|
+
composerProps,
|
|
315
|
+
chromeProps,
|
|
316
|
+
humanInputProps,
|
|
317
|
+
approvalProps,
|
|
318
|
+
onRetry,
|
|
319
|
+
}: SessionConversationViewProps & { onRetry: () => void }) {
|
|
320
|
+
const {
|
|
321
|
+
sessionId,
|
|
322
|
+
config,
|
|
323
|
+
showModelPicker,
|
|
324
|
+
catalog,
|
|
325
|
+
feed,
|
|
326
|
+
detail,
|
|
327
|
+
queue,
|
|
328
|
+
human,
|
|
329
|
+
control,
|
|
330
|
+
approvals,
|
|
331
|
+
files,
|
|
332
|
+
uploadsEnabled,
|
|
333
|
+
status,
|
|
334
|
+
terminal,
|
|
335
|
+
importedArchive,
|
|
336
|
+
composer,
|
|
337
|
+
running,
|
|
338
|
+
error,
|
|
339
|
+
loadFailed,
|
|
340
|
+
} = conversation;
|
|
341
|
+
const context = conversation;
|
|
342
|
+
const formatError = useErrorMessage();
|
|
343
|
+
const region = useRef<HTMLDivElement>(null);
|
|
344
|
+
const hostTheme = useHostTheme(region, { theme, surface });
|
|
345
|
+
const defaultInteractiveBlock = useDefaultInteractiveBlock(
|
|
346
|
+
context.client,
|
|
347
|
+
context.workspaceId,
|
|
348
|
+
sessionId,
|
|
349
|
+
config.artifacts,
|
|
350
|
+
labelOverrides?.sitePreviewUnavailable ?? DEFAULT_CONVERSATION_LABELS.sitePreviewUnavailable,
|
|
351
|
+
);
|
|
352
|
+
const retainedLoaders = useRetainedLoaders(context.client, context.workspaceId, sessionId);
|
|
353
|
+
const transcription = useComposerTranscription(
|
|
354
|
+
context.client,
|
|
355
|
+
context.workspaceId,
|
|
356
|
+
voiceInputRequested && !importedArchive ? config.voiceInput : null,
|
|
357
|
+
);
|
|
358
|
+
const inheritedLinks = useOpenGeniLinkResolver();
|
|
359
|
+
const defaultLinks = useMemo(
|
|
360
|
+
() =>
|
|
361
|
+
sessionLinkResolver({
|
|
362
|
+
client: context.client,
|
|
363
|
+
workspaceId: context.workspaceId,
|
|
364
|
+
sessionId,
|
|
365
|
+
sandboxFiles: config.sandboxFiles,
|
|
366
|
+
}),
|
|
367
|
+
[context.client, context.workspaceId, sessionId, config.sandboxFiles],
|
|
368
|
+
);
|
|
369
|
+
const onOpenArtifactRef = useRef(onOpenArtifact);
|
|
370
|
+
onOpenArtifactRef.current = onOpenArtifact;
|
|
371
|
+
const opensArtifacts = onOpenArtifact !== undefined;
|
|
372
|
+
const viewerLinks = useMemo(
|
|
373
|
+
() =>
|
|
374
|
+
opensArtifacts
|
|
375
|
+
? viewerLinkResolver({
|
|
376
|
+
workspaceId: context.workspaceId,
|
|
377
|
+
open: (target) => onOpenArtifactRef.current?.(target),
|
|
378
|
+
})
|
|
379
|
+
: null,
|
|
380
|
+
[context.workspaceId, opensArtifacts],
|
|
381
|
+
);
|
|
382
|
+
const links = useMemo(
|
|
383
|
+
() => chainLinkResolvers(resolveLink, viewerLinks, inheritedLinks, defaultLinks) ?? undefined,
|
|
384
|
+
[resolveLink, viewerLinks, inheritedLinks, defaultLinks],
|
|
385
|
+
);
|
|
386
|
+
const labels = { ...DEFAULT_CONVERSATION_LABELS, ...labelOverrides };
|
|
387
|
+
const retryInPlace = () => void conversation.retry();
|
|
388
|
+
const realtimeVoiceRequested = realtimeVoiceProp ?? config.realtimeVoiceOffered;
|
|
389
|
+
const loadingOptions = useMemo(() => embeddedGenieLoading(genieLoading), [genieLoading]);
|
|
390
|
+
const providerRecovery = useMemo(
|
|
391
|
+
() =>
|
|
392
|
+
detail.session
|
|
393
|
+
? currentProviderRecovery(
|
|
394
|
+
{
|
|
395
|
+
id: detail.session.id,
|
|
396
|
+
status,
|
|
397
|
+
activeTurnId: detail.session.activeTurnId,
|
|
398
|
+
effectiveControl:
|
|
399
|
+
queue.effectiveControl ?? detail.session.effectiveControl ?? undefined,
|
|
400
|
+
},
|
|
401
|
+
feed.events,
|
|
402
|
+
)
|
|
403
|
+
: null,
|
|
404
|
+
[detail.session, status, queue.effectiveControl, feed.events],
|
|
405
|
+
);
|
|
406
|
+
const voiceModels = useRealtimeVoiceModels(
|
|
407
|
+
context.client,
|
|
408
|
+
context.workspaceId,
|
|
409
|
+
realtimeVoiceRequested && config.realtimeVoice && !importedArchive,
|
|
410
|
+
);
|
|
411
|
+
const [voiceActive, setVoiceActive] = useState(false);
|
|
412
|
+
const notifyVoiceActive = realtimeVoiceProps?.onVoiceActiveChange;
|
|
413
|
+
const onVoiceActiveChange = useCallback(
|
|
414
|
+
(active: boolean) => {
|
|
415
|
+
setVoiceActive(active);
|
|
416
|
+
notifyVoiceActive?.(active);
|
|
417
|
+
},
|
|
418
|
+
[notifyVoiceActive],
|
|
419
|
+
);
|
|
420
|
+
const voiceControl =
|
|
421
|
+
composer.effectiveControl ?? queue.effectiveControl ?? detail.session?.effectiveControl;
|
|
422
|
+
const voice =
|
|
423
|
+
voiceModels.length > 0 && status && !terminal && voiceControl ? (
|
|
424
|
+
<Suspense fallback={null}>
|
|
425
|
+
<LazyEmbeddedRealtimeVoice
|
|
426
|
+
{...realtimeVoiceProps}
|
|
427
|
+
client={
|
|
428
|
+
context.client as unknown as ComponentProps<typeof SessionRealtimeControl>["client"]
|
|
429
|
+
}
|
|
430
|
+
workspaceId={context.workspaceId}
|
|
431
|
+
codexConnected={realtimeVoiceProps?.codexConnected ?? false}
|
|
432
|
+
sessionId={sessionId}
|
|
433
|
+
sessionStatus={status}
|
|
434
|
+
effectiveControl={voiceControl}
|
|
435
|
+
events={feed.events}
|
|
436
|
+
eventsReady={!feed.initialLoading}
|
|
437
|
+
getModelContext={conversation.getModelContext}
|
|
438
|
+
onVoiceActiveChange={onVoiceActiveChange}
|
|
439
|
+
/>
|
|
440
|
+
</Suspense>
|
|
441
|
+
) : null;
|
|
442
|
+
return (
|
|
443
|
+
<div
|
|
444
|
+
className={cn(
|
|
445
|
+
"og-root flex min-h-0 min-w-0 flex-col gap-2 overflow-hidden bg-og-bg text-og-base text-og-fg",
|
|
446
|
+
className,
|
|
447
|
+
)}
|
|
448
|
+
ref={region}
|
|
449
|
+
style={{ ...hostTheme.style, height }}
|
|
450
|
+
data-og-theme={hostTheme.attribute}
|
|
451
|
+
data-og-host-theme=""
|
|
452
|
+
data-og-conversation=""
|
|
453
|
+
>
|
|
454
|
+
{error && !loadFailed ? (
|
|
455
|
+
<div
|
|
456
|
+
role="alert"
|
|
457
|
+
className="mx-auto flex w-full max-w-3xl shrink-0 items-center gap-3 rounded-og-md border border-og-status-failed/30 bg-og-status-failed/10 px-3 py-2 text-og-sm text-og-fg"
|
|
458
|
+
data-og-conversation-error=""
|
|
459
|
+
>
|
|
460
|
+
<span className="min-w-0 flex-1">{formatError(error)}</span>
|
|
461
|
+
<button
|
|
462
|
+
type="button"
|
|
463
|
+
onClick={retryInPlace}
|
|
464
|
+
className="shrink-0 rounded-og-sm px-2 py-1 font-medium text-og-fg hover:bg-og-hover"
|
|
465
|
+
>
|
|
466
|
+
{labels.retry}
|
|
467
|
+
</button>
|
|
468
|
+
</div>
|
|
469
|
+
) : null}
|
|
470
|
+
{loadFailed ? (
|
|
471
|
+
<div
|
|
472
|
+
role="alert"
|
|
473
|
+
className="flex min-h-0 flex-1 flex-col items-center justify-center gap-3 px-6 text-center"
|
|
474
|
+
data-og-conversation-error=""
|
|
475
|
+
>
|
|
476
|
+
<p className="max-w-sm text-og-base text-og-fg-muted">{formatError(feed.error)}</p>
|
|
477
|
+
<button
|
|
478
|
+
type="button"
|
|
479
|
+
onClick={onRetry}
|
|
480
|
+
className="inline-flex min-h-9 items-center rounded-og-md border border-og-border bg-og-surface-1 px-3 py-1.5 text-og-sm font-medium text-og-fg hover:bg-og-surface-2"
|
|
481
|
+
>
|
|
482
|
+
{labels.tryAgain}
|
|
483
|
+
</button>
|
|
484
|
+
</div>
|
|
485
|
+
) : (
|
|
486
|
+
<MessageTimeline
|
|
487
|
+
renderMessageText={renderMessageText}
|
|
488
|
+
resolveLink={links}
|
|
489
|
+
renderInteractiveBlock={
|
|
490
|
+
renderInteractiveBlock === false
|
|
491
|
+
? undefined
|
|
492
|
+
: (renderInteractiveBlock ?? defaultInteractiveBlock)
|
|
493
|
+
}
|
|
494
|
+
userMessageDisclosureLabels={userMessageDisclosureLabels}
|
|
495
|
+
genieLoading={loadingOptions}
|
|
496
|
+
renderAllowanceExhausted={renderAllowanceExhausted}
|
|
497
|
+
allowanceExhaustedLabels={allowanceExhaustedLabels}
|
|
498
|
+
// Isolated and clipped: floating navigation stays inside the timeline.
|
|
499
|
+
className="isolate min-h-0 flex-1 overflow-hidden"
|
|
500
|
+
{...(toolRegistry ? { toolRegistry } : {})}
|
|
501
|
+
{...retainedLoaders}
|
|
502
|
+
{...(onOpenSession ? { onOpenSession } : {})}
|
|
503
|
+
{...(resolveSessionTitle ? { resolveSessionTitle } : {})}
|
|
504
|
+
events={feed.events}
|
|
505
|
+
items={conversation.timeline}
|
|
506
|
+
turnSummary={timelineProps?.turnSummary ?? { rolling: true }}
|
|
507
|
+
renderAuthNeeded={timelineProps?.renderAuthNeeded}
|
|
508
|
+
emptyState={timelineProps?.emptyState}
|
|
509
|
+
renderMessageSender={timelineProps?.renderMessageSender}
|
|
510
|
+
status={status}
|
|
511
|
+
hasOlder={feed.hasOlder}
|
|
512
|
+
loadingOlder={feed.loadingOlder}
|
|
513
|
+
onLoadOlder={feed.loadOlder}
|
|
514
|
+
hasNewer={feed.hasNewer}
|
|
515
|
+
loadingNewer={feed.loadingNewer}
|
|
516
|
+
onLoadNewer={feed.loadNewer}
|
|
517
|
+
onJumpToStart={async () => {
|
|
518
|
+
await feed.loadOldest();
|
|
519
|
+
}}
|
|
520
|
+
loadingOldest={feed.loadingOldest}
|
|
521
|
+
onJumpToLatest={feed.jumpToLatest}
|
|
522
|
+
onAnnotate={importedArchive ? undefined : composer.addAnnotation}
|
|
523
|
+
// A narrow embed above a decision card has no room for the pill.
|
|
524
|
+
questionNavMinViewportHeight={320}
|
|
525
|
+
/>
|
|
526
|
+
)}
|
|
527
|
+
{importedArchive ? (
|
|
528
|
+
<p className="shrink-0 px-4 py-2 text-center text-sm text-og-muted" role="status">
|
|
529
|
+
Archived conversation · Read only
|
|
530
|
+
</p>
|
|
531
|
+
) : (
|
|
532
|
+
<>
|
|
533
|
+
<div
|
|
534
|
+
// Above the timeline's floating navigation, which may never paint
|
|
535
|
+
// over a decision card.
|
|
536
|
+
className="relative z-20 min-h-0 max-h-[40%] shrink-0 overflow-y-auto empty:hidden"
|
|
537
|
+
data-og-conversation-inputs=""
|
|
538
|
+
>
|
|
539
|
+
{approvals.length > 0 && !terminal ? (
|
|
540
|
+
<ApprovalSurface
|
|
541
|
+
className="mx-auto max-w-3xl"
|
|
542
|
+
{...approvalProps}
|
|
543
|
+
approvals={approvals}
|
|
544
|
+
onApprove={async (approval) => {
|
|
545
|
+
await control.approve(approval.id);
|
|
546
|
+
}}
|
|
547
|
+
onReject={async (approval) => {
|
|
548
|
+
await control.reject(approval.id);
|
|
549
|
+
}}
|
|
550
|
+
responding={control.responding}
|
|
551
|
+
error={control.error}
|
|
552
|
+
/>
|
|
553
|
+
) : null}
|
|
554
|
+
<ProviderRecoveryNotice
|
|
555
|
+
className="mx-auto max-w-3xl px-1"
|
|
556
|
+
recovery={providerRecovery}
|
|
557
|
+
/>
|
|
558
|
+
<HumanInputSurface
|
|
559
|
+
className="mx-auto max-w-3xl"
|
|
560
|
+
autoFocus={false}
|
|
561
|
+
decisionButtons
|
|
562
|
+
{...humanInputProps}
|
|
563
|
+
loadSkillReview={loadSkillReview}
|
|
564
|
+
requests={human.requests}
|
|
565
|
+
onSubmit={async (id, response) => {
|
|
566
|
+
// `respond` reports a failed send as null. Reject so the card
|
|
567
|
+
// keeps what was typed (including a secret) for a retry.
|
|
568
|
+
if (!(await human.respond(id, response))) {
|
|
569
|
+
throw new Error("Your answer wasn't sent. Try again.");
|
|
570
|
+
}
|
|
571
|
+
}}
|
|
572
|
+
respondingRequestId={human.respondingRequestId}
|
|
573
|
+
error={human.mutationError ? formatError(human.mutationError) : null}
|
|
574
|
+
/>
|
|
575
|
+
<ConversationChrome
|
|
576
|
+
sessionId={sessionId}
|
|
577
|
+
client={context.client}
|
|
578
|
+
workspaceId={context.workspaceId}
|
|
579
|
+
events={feed.events}
|
|
580
|
+
chrome={
|
|
581
|
+
terminal
|
|
582
|
+
? { ...chromeProps, queue, sessionStatus: status, readOnly: true, onOpenSession }
|
|
583
|
+
: {
|
|
584
|
+
...chromeProps,
|
|
585
|
+
queue,
|
|
586
|
+
composer,
|
|
587
|
+
sessionStatus: status,
|
|
588
|
+
onOpenSession,
|
|
589
|
+
onComposerFocus: () =>
|
|
590
|
+
region.current?.querySelector<HTMLTextAreaElement>("textarea")?.focus(),
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
/>
|
|
594
|
+
</div>
|
|
595
|
+
<div
|
|
596
|
+
className="relative z-20 mx-auto w-full max-w-3xl shrink-0"
|
|
597
|
+
data-og-conversation-composer=""
|
|
598
|
+
>
|
|
599
|
+
<ChatComposer
|
|
600
|
+
runControl="stop"
|
|
601
|
+
running={running}
|
|
602
|
+
{...composerProps}
|
|
603
|
+
{...(transcription && composerProps?.transcription === undefined
|
|
604
|
+
? { transcription }
|
|
605
|
+
: {})}
|
|
606
|
+
actionsStart={
|
|
607
|
+
voice ? (
|
|
608
|
+
<>
|
|
609
|
+
{composerProps?.actionsStart}
|
|
610
|
+
{voice}
|
|
611
|
+
</>
|
|
612
|
+
) : (
|
|
613
|
+
composerProps?.actionsStart
|
|
614
|
+
)
|
|
615
|
+
}
|
|
616
|
+
transcriptionSuppressed={composerProps?.transcriptionSuppressed ?? voiceActive}
|
|
617
|
+
composer={composer}
|
|
618
|
+
attachments={uploadsEnabled ? files : undefined}
|
|
619
|
+
disabled={terminal || composerProps?.disabled}
|
|
620
|
+
controlsStart={
|
|
621
|
+
composerProps?.controlsStart ??
|
|
622
|
+
(showModelPicker && composer.policy && (
|
|
623
|
+
<ModelPolicyPicker
|
|
624
|
+
groupPresentation={modelPickerProps?.groupPresentation}
|
|
625
|
+
messages={modelPickerProps?.messages}
|
|
626
|
+
rows={catalog.rows}
|
|
627
|
+
model={composer.policy.model}
|
|
628
|
+
effort={composer.policy.reasoningEffort}
|
|
629
|
+
latencyMode={composer.policy.latencyMode}
|
|
630
|
+
loading={catalog.loading}
|
|
631
|
+
error={catalog.error?.message}
|
|
632
|
+
disabled={terminal}
|
|
633
|
+
// A session frozen on Codex remote compaction refuses
|
|
634
|
+
// other providers' models; offer them only as disabled.
|
|
635
|
+
codexOnly={detail.session?.codexCompactionMode === "remote_v2"}
|
|
636
|
+
sessionKey={sessionId}
|
|
637
|
+
onOpenChange={(open) => {
|
|
638
|
+
if (open) void catalog.refresh();
|
|
639
|
+
}}
|
|
640
|
+
onModelChange={(model) => composer.setModel?.(model)}
|
|
641
|
+
onEffortChange={(effort) => composer.setReasoningEffort?.(effort)}
|
|
642
|
+
onLatencyModeChange={(mode) => composer.setLatencyMode?.(mode)}
|
|
643
|
+
/>
|
|
644
|
+
))
|
|
645
|
+
}
|
|
646
|
+
responsiveBasis={composerProps?.responsiveBasis ?? "container"}
|
|
647
|
+
effectiveControl={
|
|
648
|
+
composer.effectiveControl ??
|
|
649
|
+
queue.effectiveControl ??
|
|
650
|
+
detail.session?.effectiveControl
|
|
651
|
+
}
|
|
652
|
+
queuedAheadCount={queue.queue.length}
|
|
653
|
+
/>
|
|
654
|
+
</div>
|
|
655
|
+
</>
|
|
656
|
+
)}
|
|
657
|
+
</div>
|
|
658
|
+
);
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
/** Neutral embedded defaults under the host's overrides; an empty phrase list keeps them. */
|
|
662
|
+
function embeddedGenieLoading(options: GenieLoadingOptions | undefined): GenieLoadingOptions {
|
|
663
|
+
if (!options) return EMBEDDED_GENIE_LOADING;
|
|
664
|
+
return {
|
|
665
|
+
...EMBEDDED_GENIE_LOADING,
|
|
666
|
+
...options,
|
|
667
|
+
phrases: options.phrases?.length ? options.phrases : EMBEDDED_GENIE_LOADING.phrases,
|
|
668
|
+
messages: { ...EMBEDDED_GENIE_LOADING.messages, ...options.messages },
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
type ConversationChromeProps = {
|
|
673
|
+
sessionId: string;
|
|
674
|
+
client: unknown;
|
|
675
|
+
workspaceId: string;
|
|
676
|
+
events: UseGoalOptions["events"];
|
|
677
|
+
chrome: Omit<ComponentProps<typeof SessionChrome>, "goal">;
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
/** Session chrome with the goal pill and its Pause/Resume/Clear when the client can reach goals. */
|
|
681
|
+
function ConversationChrome(props: ConversationChromeProps) {
|
|
682
|
+
const goals = props.client as Partial<Record<"getGoal" | "updateGoal" | "deleteGoal", unknown>>;
|
|
683
|
+
const canReachGoals =
|
|
684
|
+
typeof goals.getGoal === "function" &&
|
|
685
|
+
typeof goals.updateGoal === "function" &&
|
|
686
|
+
typeof goals.deleteGoal === "function";
|
|
687
|
+
return canReachGoals ? <GoalChrome {...props} /> : <SessionChrome {...props.chrome} />;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
function GoalChrome({ sessionId, client, workspaceId, events, chrome }: ConversationChromeProps) {
|
|
691
|
+
const goal = useGoal(sessionId, {
|
|
692
|
+
client: client as UseGoalOptions["client"],
|
|
693
|
+
workspaceId,
|
|
694
|
+
events,
|
|
695
|
+
});
|
|
696
|
+
return <SessionChrome {...chrome} goal={goal} />;
|
|
697
|
+
}
|
|
698
|
+
const LazyEmbeddedRealtimeVoice = lazy(() => import("../realtime/embedded-voice"));
|
|
699
|
+
|
|
700
|
+
const LazyChatInteractiveBlock = lazy(() =>
|
|
701
|
+
import("./artifacts/chat-interactive-block").then((module) => ({
|
|
702
|
+
default: module.ChatInteractiveBlock,
|
|
703
|
+
})),
|
|
704
|
+
);
|
|
705
|
+
|
|
706
|
+
/** This client with the conversation's session scope header, when it can add headers. */
|
|
707
|
+
function sessionScoped<T>(client: T, sessionId: string): T {
|
|
708
|
+
const candidate = client as { withHeaders?: (headers: Readonly<Record<string, string>>) => T };
|
|
709
|
+
return typeof candidate.withHeaders === "function"
|
|
710
|
+
? candidate.withHeaders({ [SESSION_SCOPE_HEADER]: sessionId })
|
|
711
|
+
: client;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
/** Inline Site/HTML preview reading through this conversation's session scope. */
|
|
715
|
+
function useDefaultInteractiveBlock(
|
|
716
|
+
client: unknown,
|
|
717
|
+
workspaceId: string,
|
|
718
|
+
sessionId: string,
|
|
719
|
+
sitesAvailable: boolean,
|
|
720
|
+
sitePreviewUnavailable: string,
|
|
721
|
+
): NonNullable<MessageTimelineProps["renderInteractiveBlock"]> {
|
|
722
|
+
// Scope lazily: only a rendered preview reads, and some clients (a Site's
|
|
723
|
+
// own client) cannot add headers.
|
|
724
|
+
const scoped = useMemo((): SiteSnapshotClient => {
|
|
725
|
+
let resolved: SiteSnapshotClient | null = null;
|
|
726
|
+
const get = () => (resolved ??= sessionScoped(client as SiteSnapshotClient, sessionId));
|
|
727
|
+
return {
|
|
728
|
+
getWorkspaceArtifact: (...args) => get().getWorkspaceArtifact(...args),
|
|
729
|
+
getWorkspaceArtifactHtml: (...args) => get().getWorkspaceArtifactHtml(...args),
|
|
730
|
+
getWorkspaceArtifactContent: (...args) => {
|
|
731
|
+
const target = get();
|
|
732
|
+
if (!target.getWorkspaceArtifactContent) throw new Error("Site version unavailable");
|
|
733
|
+
return target.getWorkspaceArtifactContent(...args);
|
|
734
|
+
},
|
|
735
|
+
};
|
|
736
|
+
}, [client, sessionId]);
|
|
737
|
+
return useCallback(
|
|
738
|
+
(block) =>
|
|
739
|
+
block.kind === "site" && !sitesAvailable ? (
|
|
740
|
+
// The proxy does not serve Sites: say so instead of offering a load
|
|
741
|
+
// that can only fail.
|
|
742
|
+
<div
|
|
743
|
+
className="rounded-og-md border border-og-border bg-og-surface-1 px-3 py-2 text-og-sm text-og-fg-muted"
|
|
744
|
+
data-og-site-preview-unavailable=""
|
|
745
|
+
>
|
|
746
|
+
{sitePreviewUnavailable}
|
|
747
|
+
</div>
|
|
748
|
+
) : (
|
|
749
|
+
<Suspense fallback={<span role="status">Loading preview…</span>}>
|
|
750
|
+
<LazyChatInteractiveBlock workspaceId={workspaceId} client={scoped} {...block} />
|
|
751
|
+
</Suspense>
|
|
752
|
+
),
|
|
753
|
+
[scoped, workspaceId, sitesAvailable, sitePreviewUnavailable],
|
|
754
|
+
);
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
type RetainedLoaderClient = Partial<
|
|
758
|
+
Pick<
|
|
759
|
+
OpenGeniClient,
|
|
760
|
+
| "createRetainedArtifactDownloadUrl"
|
|
761
|
+
| "downloadRetainedArtifact"
|
|
762
|
+
| "downloadRetainedScreenshot"
|
|
763
|
+
| "createVideoArtifactPlaybackSource"
|
|
764
|
+
>
|
|
765
|
+
>;
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Generated images, published files, screenshots and generated video, read
|
|
769
|
+
* through this conversation's session scope (a session proxy only serves
|
|
770
|
+
* media that session produced). Clients without the SDK reads get none.
|
|
771
|
+
*/
|
|
772
|
+
function useRetainedLoaders(
|
|
773
|
+
client: unknown,
|
|
774
|
+
workspaceId: string,
|
|
775
|
+
sessionId: string,
|
|
776
|
+
): Pick<
|
|
777
|
+
MessageTimelineProps,
|
|
778
|
+
"loadRetainedArtifact" | "loadRetainedScreenshot" | "loadVideoArtifactPlayback"
|
|
779
|
+
> {
|
|
780
|
+
return useMemo(() => {
|
|
781
|
+
const base = client as RetainedLoaderClient;
|
|
782
|
+
// Scope lazily: only a rendered receipt reads.
|
|
783
|
+
let scoped: RetainedLoaderClient | null = null;
|
|
784
|
+
const get = () => (scoped ??= sessionScoped(base, sessionId));
|
|
785
|
+
return {
|
|
786
|
+
...(typeof base.downloadRetainedArtifact === "function" &&
|
|
787
|
+
typeof base.createRetainedArtifactDownloadUrl === "function"
|
|
788
|
+
? {
|
|
789
|
+
loadRetainedArtifact: (artifact, signal, options) =>
|
|
790
|
+
createWorkspaceRetainedArtifactLoader(
|
|
791
|
+
get() as Required<RetainedLoaderClient>,
|
|
792
|
+
workspaceId,
|
|
793
|
+
)(artifact, signal, options),
|
|
794
|
+
}
|
|
795
|
+
: {}),
|
|
796
|
+
...(typeof base.downloadRetainedScreenshot === "function"
|
|
797
|
+
? {
|
|
798
|
+
loadRetainedScreenshot: (artifact, signal) =>
|
|
799
|
+
createSessionRetainedScreenshotLoader(
|
|
800
|
+
get() as Required<RetainedLoaderClient>,
|
|
801
|
+
workspaceId,
|
|
802
|
+
sessionId,
|
|
803
|
+
)(artifact, signal),
|
|
804
|
+
}
|
|
805
|
+
: {}),
|
|
806
|
+
...(typeof base.createVideoArtifactPlaybackSource === "function"
|
|
807
|
+
? {
|
|
808
|
+
loadVideoArtifactPlayback: (artifactId, signal) =>
|
|
809
|
+
createWorkspaceRetainedVideoLoader(
|
|
810
|
+
get() as Required<RetainedLoaderClient>,
|
|
811
|
+
workspaceId,
|
|
812
|
+
)(artifactId, signal),
|
|
813
|
+
}
|
|
814
|
+
: {}),
|
|
815
|
+
} satisfies Pick<
|
|
816
|
+
MessageTimelineProps,
|
|
817
|
+
"loadRetainedArtifact" | "loadRetainedScreenshot" | "loadVideoArtifactPlayback"
|
|
818
|
+
>;
|
|
819
|
+
}, [client, workspaceId, sessionId]);
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
/**
|
|
823
|
+
* The composer microphone: shown when the deployment can transcribe, enabled
|
|
824
|
+
* once the workspace's voice-input setting allows it.
|
|
825
|
+
*/
|
|
826
|
+
export function useComposerTranscription(
|
|
827
|
+
client: unknown,
|
|
828
|
+
workspaceId: string,
|
|
829
|
+
capability: ClientVoiceInputConfig | null,
|
|
830
|
+
): ComposerTranscriptionControlProps | null {
|
|
831
|
+
const [workspaceEnabled, setWorkspaceEnabled] = useState<{
|
|
832
|
+
key: string;
|
|
833
|
+
enabled: boolean;
|
|
834
|
+
} | null>(null);
|
|
835
|
+
const reader = client as Partial<Pick<OpenGeniClient, "getWorkspace" | "transcribeAudio">>;
|
|
836
|
+
const supported = capability !== null && typeof reader.transcribeAudio === "function";
|
|
837
|
+
useEffect(() => {
|
|
838
|
+
if (!supported) return;
|
|
839
|
+
let live = true;
|
|
840
|
+
const key = workspaceId;
|
|
841
|
+
if (typeof reader.getWorkspace !== "function") {
|
|
842
|
+
setWorkspaceEnabled({ key, enabled: true });
|
|
843
|
+
return;
|
|
844
|
+
}
|
|
845
|
+
reader.getWorkspace(workspaceId).then(
|
|
846
|
+
(workspace) => {
|
|
847
|
+
if (live) {
|
|
848
|
+
setWorkspaceEnabled({
|
|
849
|
+
key,
|
|
850
|
+
enabled: resolveWorkspaceVoiceInputEnabled(workspace.settings) ?? true,
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
},
|
|
854
|
+
// The transcription request still enforces the setting.
|
|
855
|
+
() => live && setWorkspaceEnabled({ key, enabled: true }),
|
|
856
|
+
);
|
|
857
|
+
return () => {
|
|
858
|
+
live = false;
|
|
859
|
+
};
|
|
860
|
+
}, [reader, workspaceId, supported]);
|
|
861
|
+
return useMemo(
|
|
862
|
+
() =>
|
|
863
|
+
supported
|
|
864
|
+
? {
|
|
865
|
+
client: reader as Pick<OpenGeniClient, "transcribeAudio">,
|
|
866
|
+
workspaceId,
|
|
867
|
+
capability,
|
|
868
|
+
workspaceEnabled:
|
|
869
|
+
workspaceEnabled?.key === workspaceId ? workspaceEnabled.enabled : false,
|
|
870
|
+
}
|
|
871
|
+
: null,
|
|
872
|
+
[supported, reader, workspaceId, capability, workspaceEnabled],
|
|
873
|
+
);
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
export { useClientConfigFlags } from "../hooks/use-client-config-flags";
|