@opengeni/react 3.1.0 → 3.1.3-canary.38890816741001
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 +89 -11
- 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-BO2IWXVK.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-RGALCTWO.js → chunk-2I6R3GCZ.js} +4285 -3980
- package/dist/chunk-2I6R3GCZ.js.map +1 -0
- package/dist/{chunk-D3UIAJKY.js → chunk-2SFFYIH3.js} +1179 -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-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-OAM4WAAM.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-XXWH2JLC.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-OVB5WIG5.js +14064 -0
- package/dist/chunk-OVB5WIG5.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-MZ2G2XBA.js → chunk-V5ZUJT2T.js} +205 -45
- package/dist/chunk-V5ZUJT2T.js.map +1 -0
- package/dist/chunk-VIUEOHXY.js +394 -0
- package/dist/chunk-VIUEOHXY.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-YJFGAFBD.js → chunk-X5UVUIMF.js} +1892 -1223
- 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/fleet-tile.d.ts +2 -2
- 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 +41 -25
- 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/tip-follow.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 +28 -7
- 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 +22 -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 +2350 -6605
- 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 -1294
- 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/entrance.d.ts +13 -1
- 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 +107 -7
- package/src/accounts.tsx +116 -14
- 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 +189 -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 +9 -18
- 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 +2567 -728
- 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 +256 -412
- 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/tip-follow.ts +52 -0
- package/src/components/tool-action-review.tsx +650 -0
- package/src/components/tool-review-history.tsx +88 -0
- package/src/components/tooltip.tsx +38 -5
- 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 +21 -15
- 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 +276 -47
- 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 +107 -13
- package/src/hooks/use-last-started-turn-policy.ts +46 -14
- 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 +703 -382
- package/src/hooks/use-session-lineage.ts +20 -16
- 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 +53 -21
- 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 +97 -32
- 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 +213 -16
- 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 -501
- 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/entrance.tsx +28 -3
- 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 +1746 -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-AEFHUYZK.js +0 -14
- package/dist/chunk-4MDLEHXL.js.map +0 -1
- package/dist/chunk-5YK2ZDIG.js.map +0 -1
- package/dist/chunk-D3UIAJKY.js.map +0 -1
- package/dist/chunk-ELIYWBZR.js.map +0 -1
- package/dist/chunk-H5YGYNXS.js.map +0 -1
- package/dist/chunk-HQVCKCLG.js +0 -9458
- package/dist/chunk-HQVCKCLG.js.map +0 -1
- package/dist/chunk-HUIKIDM5.js.map +0 -1
- package/dist/chunk-ICA6R6TW.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-LAKLF4PA.js +0 -141
- package/dist/chunk-LAKLF4PA.js.map +0 -1
- package/dist/chunk-MZ2G2XBA.js.map +0 -1
- package/dist/chunk-NEXLLTP4.js.map +0 -1
- package/dist/chunk-OAM4WAAM.js.map +0 -1
- package/dist/chunk-PEI6RANI.js.map +0 -1
- package/dist/chunk-RGALCTWO.js.map +0 -1
- package/dist/chunk-W6NFJXSA.js +0 -454
- package/dist/chunk-W6NFJXSA.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-XXWH2JLC.js.map +0 -1
- package/dist/chunk-YFKJ7VZH.js +0 -268
- package/dist/chunk-YFKJ7VZH.js.map +0 -1
- package/dist/chunk-YJFGAFBD.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-AEFHUYZK.js.map → browser-viewer-ZWR6MWJ7.js.map} +0 -0
- /package/dist/{computer-viewer-FWEZISW4.js.map → chat-interactive-block-BO2IWXVK.js.map} +0 -0
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/lib/provider-recovery.ts
|
|
4
|
+
var MODEL_CODES = /* @__PURE__ */ new Set([
|
|
5
|
+
"provider_unavailable",
|
|
6
|
+
"provider_rate_limited",
|
|
7
|
+
"provider_unknown_finish_reason",
|
|
8
|
+
"post_compaction_continuation_empty"
|
|
9
|
+
]);
|
|
10
|
+
var SANDBOX_WAIT_CODES = /* @__PURE__ */ new Set([
|
|
11
|
+
"sandbox_deadline_rotation",
|
|
12
|
+
"sandbox_lifecycle_transition",
|
|
13
|
+
"sandbox_lease_superseded"
|
|
14
|
+
]);
|
|
15
|
+
var RECOVERY_CODES = /* @__PURE__ */ new Set([
|
|
16
|
+
...MODEL_CODES,
|
|
17
|
+
...SANDBOX_WAIT_CODES,
|
|
18
|
+
"upstream_connectivity_unavailable",
|
|
19
|
+
"mcp_transport_timeout",
|
|
20
|
+
"mcp_transport_unavailable",
|
|
21
|
+
"sandbox_command_start_unavailable",
|
|
22
|
+
"retained_attachment_unavailable",
|
|
23
|
+
"turn_execution_policy_definition_mismatch"
|
|
24
|
+
]);
|
|
25
|
+
var DEFAULT_MAX_ATTEMPTS = 5;
|
|
26
|
+
function text(value, max = 120) {
|
|
27
|
+
if (typeof value !== "string") return null;
|
|
28
|
+
const normalized = value.replace(/\s+/g, " ").trim();
|
|
29
|
+
return normalized ? normalized.slice(0, max) : null;
|
|
30
|
+
}
|
|
31
|
+
function count(value) {
|
|
32
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : null;
|
|
33
|
+
}
|
|
34
|
+
function condition(payload, code) {
|
|
35
|
+
const recorded = payload.providerCondition;
|
|
36
|
+
if (recorded === "overloaded" || recorded === "unavailable" || recorded === "unresponsive" || recorded === "rate_limited")
|
|
37
|
+
return recorded;
|
|
38
|
+
if (code === "provider_rate_limited") return "rate_limited";
|
|
39
|
+
if (code !== "provider_unavailable") return null;
|
|
40
|
+
return [payload.lastRetryableError, payload.detail, payload.error].some(
|
|
41
|
+
(value) => typeof value === "string" && /\boverload(?:ed)?(?:_error)?\b/i.test(value)
|
|
42
|
+
) ? "overloaded" : null;
|
|
43
|
+
}
|
|
44
|
+
function parseProviderRecovery(payload) {
|
|
45
|
+
if (!payload || typeof payload !== "object" || Array.isArray(payload)) return null;
|
|
46
|
+
const record = payload;
|
|
47
|
+
const code = text(record.code) ?? text(record.reason);
|
|
48
|
+
if (!code || !RECOVERY_CODES.has(code)) return null;
|
|
49
|
+
const rotation = text(record.rotationReason);
|
|
50
|
+
const transition = text(record.transitionReason);
|
|
51
|
+
if (code === "sandbox_lease_superseded" && !rotation && !transition) return null;
|
|
52
|
+
if (record.recoveryExhausted !== true && record.retryable === false) return null;
|
|
53
|
+
const attempt = count(record.providerRecoveryCount);
|
|
54
|
+
return {
|
|
55
|
+
code,
|
|
56
|
+
condition: condition(record, code),
|
|
57
|
+
modelLabel: text(record.modelLabel),
|
|
58
|
+
providerLabel: text(record.providerLabel),
|
|
59
|
+
attempt,
|
|
60
|
+
maxAttempts: count(record.maxProviderRecoveryCount) ?? DEFAULT_MAX_ATTEMPTS,
|
|
61
|
+
modelRoute: MODEL_CODES.has(code),
|
|
62
|
+
...SANDBOX_WAIT_CODES.has(code) ? {
|
|
63
|
+
sandboxWait: true,
|
|
64
|
+
sandboxTransition: transition ?? (rotation ? "rotation_in_progress" : null)
|
|
65
|
+
} : {}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function providerRecoverySubject(facts) {
|
|
69
|
+
const model = facts.modelLabel ?? "The model";
|
|
70
|
+
const at = facts.providerLabel ? ` at the provider (${facts.providerLabel})` : " at the provider";
|
|
71
|
+
switch (facts.code) {
|
|
72
|
+
case "provider_rate_limited":
|
|
73
|
+
return `${model} is rate limited${at}`;
|
|
74
|
+
case "provider_unavailable":
|
|
75
|
+
return facts.condition === "overloaded" ? `${model} is overloaded${at}` : facts.condition === "unresponsive" ? `${model} stopped responding${at}` : `${model} is temporarily unavailable${at}`;
|
|
76
|
+
case "provider_unknown_finish_reason":
|
|
77
|
+
return `${model} ended its response unexpectedly`;
|
|
78
|
+
case "post_compaction_continuation_empty":
|
|
79
|
+
return `${model} stopped right after compacting the conversation`;
|
|
80
|
+
case "upstream_connectivity_unavailable":
|
|
81
|
+
return "Opengeni can't reach an upstream service";
|
|
82
|
+
case "mcp_transport_timeout":
|
|
83
|
+
return "A required MCP server isn't responding";
|
|
84
|
+
case "mcp_transport_unavailable":
|
|
85
|
+
return "A required MCP server is unreachable";
|
|
86
|
+
case "sandbox_command_start_unavailable":
|
|
87
|
+
return "The sandbox isn't ready yet";
|
|
88
|
+
case "retained_attachment_unavailable":
|
|
89
|
+
return "An image from earlier in this conversation can't be read from storage";
|
|
90
|
+
case "turn_execution_policy_definition_mismatch":
|
|
91
|
+
return "Opengeni is applying a configuration update";
|
|
92
|
+
case "sandbox_deadline_rotation":
|
|
93
|
+
return "The sandbox reached its maximum lifetime, so Opengeni is moving the workspace to a fresh sandbox";
|
|
94
|
+
case "sandbox_lifecycle_transition":
|
|
95
|
+
case "sandbox_lease_superseded":
|
|
96
|
+
return facts.sandboxTransition === "capture_in_progress" ? "Opengeni is saving the sandbox workspace" : facts.sandboxTransition === "provider_recovery_in_progress" ? "Opengeni is recovering the sandbox" : facts.sandboxTransition === "rotation_in_progress" ? "Opengeni is moving the workspace to a fresh sandbox" : "Opengeni is preparing the sandbox";
|
|
97
|
+
default:
|
|
98
|
+
return "A service this turn depends on is temporarily unavailable";
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function providerRecoveryRetryingText(facts) {
|
|
102
|
+
if (facts.sandboxWait) return `${providerRecoverySubject(facts)}\u2026`;
|
|
103
|
+
const progress = facts.attempt !== null && facts.maxAttempts !== null ? ` (attempt ${Math.min(facts.attempt, facts.maxAttempts)} of ${facts.maxAttempts})` : " automatically";
|
|
104
|
+
return `${providerRecoverySubject(facts)} \u2014 retrying${progress}\u2026`;
|
|
105
|
+
}
|
|
106
|
+
function providerRecoveryExhaustedText(facts) {
|
|
107
|
+
const spent = facts.attempt ?? facts.maxAttempts ?? DEFAULT_MAX_ATTEMPTS;
|
|
108
|
+
const retried = `Opengeni retried ${spent} ${spent === 1 ? "time" : "times"} without success.`;
|
|
109
|
+
const remedy = facts.modelRoute ? "Try again in a few minutes, or switch to another model." : "Try again in a few minutes.";
|
|
110
|
+
return `${providerRecoverySubject(facts)}. ${retried} ${remedy}`;
|
|
111
|
+
}
|
|
112
|
+
var BOUNDARY_TYPES = /* @__PURE__ */ new Set([
|
|
113
|
+
"turn.recovery.requested",
|
|
114
|
+
"turn.started",
|
|
115
|
+
"turn.completed",
|
|
116
|
+
"turn.failed",
|
|
117
|
+
"turn.cancelled",
|
|
118
|
+
"turn.superseded"
|
|
119
|
+
]);
|
|
120
|
+
function currentProviderRecovery(session, events) {
|
|
121
|
+
if (session.status !== "recovering" || session.effectiveControl && session.effectiveControl.state !== "active" || !session.activeTurnId)
|
|
122
|
+
return null;
|
|
123
|
+
let latest;
|
|
124
|
+
for (const event of events) {
|
|
125
|
+
if (event.sessionId !== session.id || event.turnId !== session.activeTurnId || event.duplicateOfEventId || event.turnAssociation && event.turnAssociation !== "current" || !BOUNDARY_TYPES.has(event.type))
|
|
126
|
+
continue;
|
|
127
|
+
if (!latest || event.sequence > latest.sequence) latest = event;
|
|
128
|
+
}
|
|
129
|
+
if (latest?.type !== "turn.recovery.requested") return null;
|
|
130
|
+
const payload = latest.payload;
|
|
131
|
+
return payload?.recoveryExhausted === true ? null : parseProviderRecovery(payload);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// src/lib/format.ts
|
|
135
|
+
import { formatErrorMessage, OpenGeniApiError } from "@opengeni/sdk";
|
|
136
|
+
var clockTimeFormatter = new Intl.DateTimeFormat(void 0, {
|
|
137
|
+
month: "short",
|
|
138
|
+
day: "numeric",
|
|
139
|
+
hour: "numeric",
|
|
140
|
+
minute: "2-digit"
|
|
141
|
+
});
|
|
142
|
+
function formatClockTime(iso) {
|
|
143
|
+
const then = new Date(iso);
|
|
144
|
+
if (Number.isNaN(then.getTime())) {
|
|
145
|
+
return "";
|
|
146
|
+
}
|
|
147
|
+
return clockTimeFormatter.format(then);
|
|
148
|
+
}
|
|
149
|
+
function formatRelativeTime(iso, now = /* @__PURE__ */ new Date()) {
|
|
150
|
+
const then = new Date(iso).getTime();
|
|
151
|
+
if (Number.isNaN(then)) {
|
|
152
|
+
return "";
|
|
153
|
+
}
|
|
154
|
+
const seconds = Math.max(0, Math.floor((now.getTime() - then) / 1e3));
|
|
155
|
+
if (seconds < 10) {
|
|
156
|
+
return "now";
|
|
157
|
+
}
|
|
158
|
+
if (seconds < 60) {
|
|
159
|
+
return `${seconds}s`;
|
|
160
|
+
}
|
|
161
|
+
const minutes = Math.floor(seconds / 60);
|
|
162
|
+
if (minutes < 60) {
|
|
163
|
+
return `${minutes}m`;
|
|
164
|
+
}
|
|
165
|
+
const hours = Math.floor(minutes / 60);
|
|
166
|
+
if (hours < 24) {
|
|
167
|
+
return `${hours}h`;
|
|
168
|
+
}
|
|
169
|
+
const days = Math.floor(hours / 24);
|
|
170
|
+
if (days < 14) {
|
|
171
|
+
return `${days}d`;
|
|
172
|
+
}
|
|
173
|
+
return new Date(iso).toLocaleDateString();
|
|
174
|
+
}
|
|
175
|
+
function formatBytes(bytes) {
|
|
176
|
+
if (bytes < 1024) {
|
|
177
|
+
return `${bytes} B`;
|
|
178
|
+
}
|
|
179
|
+
const units = ["KB", "MB", "GB"];
|
|
180
|
+
let value = bytes / 1024;
|
|
181
|
+
for (const unit of units) {
|
|
182
|
+
if (value < 1024 || unit === "GB") {
|
|
183
|
+
return `${value.toFixed(value < 10 ? 1 : 0)} ${unit}`;
|
|
184
|
+
}
|
|
185
|
+
value /= 1024;
|
|
186
|
+
}
|
|
187
|
+
return `${bytes} B`;
|
|
188
|
+
}
|
|
189
|
+
function truncate(text2, maxLength) {
|
|
190
|
+
const collapsed = text2.replace(/\s+/g, " ").trim();
|
|
191
|
+
if (collapsed.length <= maxLength) {
|
|
192
|
+
return collapsed;
|
|
193
|
+
}
|
|
194
|
+
return `${collapsed.slice(0, Math.max(0, maxLength - 1)).trimEnd()}\u2026`;
|
|
195
|
+
}
|
|
196
|
+
function stringifyPayload(value) {
|
|
197
|
+
if (value === null || value === void 0) {
|
|
198
|
+
return "";
|
|
199
|
+
}
|
|
200
|
+
if (typeof value === "string") {
|
|
201
|
+
const parsed = tryParseJson(value);
|
|
202
|
+
if (parsed !== void 0 && typeof parsed === "object") {
|
|
203
|
+
return stringifyPayload(parsed);
|
|
204
|
+
}
|
|
205
|
+
return value;
|
|
206
|
+
}
|
|
207
|
+
try {
|
|
208
|
+
return JSON.stringify(value, null, 2) ?? String(value);
|
|
209
|
+
} catch {
|
|
210
|
+
return String(value);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
function tryParseJson(text2) {
|
|
214
|
+
const trimmed = text2.trim();
|
|
215
|
+
if (!trimmed.startsWith("{") && !trimmed.startsWith("[") && !trimmed.startsWith('"')) {
|
|
216
|
+
return void 0;
|
|
217
|
+
}
|
|
218
|
+
try {
|
|
219
|
+
return JSON.parse(trimmed);
|
|
220
|
+
} catch {
|
|
221
|
+
return void 0;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
var CREDIT_EXHAUSTION_MESSAGE = "Out of credits \u2014 this workspace's balance is empty. Add credits to continue; the conversation is preserved.";
|
|
225
|
+
var COMPOSER_MEMBER_ALLOWANCE_MESSAGE = "Usage limit reached. A workspace admin can raise this limit. Your draft is preserved.";
|
|
226
|
+
var COMPOSER_WORKSPACE_ALLOWANCE_MESSAGE = "Workspace usage limit reached. An organization admin can raise the workspace budget. Your draft is preserved.";
|
|
227
|
+
var COMPOSER_PAYMENT_REQUIRED_MESSAGE = "Your organization doesn't have enough credits to send this message. Add credits or choose a model with another payment source. Your message and attachments are saved.";
|
|
228
|
+
var ComposerStateError = class extends Error {
|
|
229
|
+
};
|
|
230
|
+
var ComposerReconciliationRequiredError = class extends ComposerStateError {
|
|
231
|
+
constructor() {
|
|
232
|
+
super(
|
|
233
|
+
"Opengeni cannot safely retry this uncertain request after remount; reconcile the session before sending again."
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
var ComposerWorkspaceControlUnavailableError = class extends Error {
|
|
238
|
+
constructor() {
|
|
239
|
+
super("@opengeni/react: workspace-scoped resume requires setWorkspaceInferenceState.");
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
var COMPOSER_MODEL_UNAVAILABLE_MESSAGE = "This chat's model is no longer available. Choose another model to continue. Your message is saved.";
|
|
243
|
+
var MODEL_UNAVAILABLE_DETAIL_CODE = "model_unavailable";
|
|
244
|
+
var COMPOSER_SESSION_USAGE_LIMIT_MESSAGE = "This task's usage limit is reached. Your message is saved.";
|
|
245
|
+
var LEGACY_COMPOSER_SESSION_USAGE_LIMIT_MESSAGE = "This task's usage limit is reached. Raise or remove the limit to continue. Your message is saved.";
|
|
246
|
+
function isSessionUsageLimitSubmissionError(error) {
|
|
247
|
+
return error instanceof OpenGeniApiError && error.code === "session_usage_limit_reached" || error.message === COMPOSER_SESSION_USAGE_LIMIT_MESSAGE || error.message === LEGACY_COMPOSER_SESSION_USAGE_LIMIT_MESSAGE;
|
|
248
|
+
}
|
|
249
|
+
function isModelUnavailableSubmissionError(error) {
|
|
250
|
+
if (error instanceof OpenGeniApiError && error.details?.code === MODEL_UNAVAILABLE_DETAIL_CODE) {
|
|
251
|
+
return true;
|
|
252
|
+
}
|
|
253
|
+
return error.message === COMPOSER_MODEL_UNAVAILABLE_MESSAGE || /^(?:Opengeni|OpenGeni) API 422: model is not available: /.test(error.message);
|
|
254
|
+
}
|
|
255
|
+
var COMPOSER_SITE_REFUSAL_MESSAGES = Object.freeze({
|
|
256
|
+
not_available_for_viewer: "This Site's assistant can't do that for you. Your message is saved.",
|
|
257
|
+
site_budget_exhausted: "This Site's assistant has reached its usage limit for now. Your message is saved.",
|
|
258
|
+
site_budget_busy: "This Site's assistant is busy. Try again in a moment. Your message is saved.",
|
|
259
|
+
site_platform_brake_engaged: "This Site's assistant is paused for visitors right now. Your message is saved."
|
|
260
|
+
});
|
|
261
|
+
function siteRefusalCode(error) {
|
|
262
|
+
if (!(error instanceof OpenGeniApiError)) return null;
|
|
263
|
+
const code = error.details?.code;
|
|
264
|
+
return typeof code === "string" && code in COMPOSER_SITE_REFUSAL_MESSAGES ? code : null;
|
|
265
|
+
}
|
|
266
|
+
function composerSubmissionErrorMessage(error) {
|
|
267
|
+
if (error instanceof ComposerReconciliationRequiredError) {
|
|
268
|
+
return "This client cannot safely retry this uncertain request after remount; reconcile the session before sending again.";
|
|
269
|
+
}
|
|
270
|
+
if (error instanceof ComposerWorkspaceControlUnavailableError) {
|
|
271
|
+
return "This client cannot resume the workspace. Ask your administrator for a control-capable client.";
|
|
272
|
+
}
|
|
273
|
+
if (error instanceof ComposerStateError) return error.message;
|
|
274
|
+
if (error instanceof OpenGeniApiError && error.outcomeUnknown) return formatErrorMessage(error);
|
|
275
|
+
if (isModelUnavailableSubmissionError(error)) return COMPOSER_MODEL_UNAVAILABLE_MESSAGE;
|
|
276
|
+
if (isSessionUsageLimitSubmissionError(error)) return COMPOSER_SESSION_USAGE_LIMIT_MESSAGE;
|
|
277
|
+
const siteRefusal = siteRefusalCode(error);
|
|
278
|
+
if (siteRefusal) return COMPOSER_SITE_REFUSAL_MESSAGES[siteRefusal];
|
|
279
|
+
if (error instanceof OpenGeniApiError && error.code === "allowance_exhausted") {
|
|
280
|
+
const message = error.scope === "workspace" ? COMPOSER_WORKSPACE_ALLOWANCE_MESSAGE : COMPOSER_MEMBER_ALLOWANCE_MESSAGE;
|
|
281
|
+
return composerErrorReference(error, message);
|
|
282
|
+
}
|
|
283
|
+
return isComposerCreditRefusal(error) ? composerErrorReference(error, COMPOSER_PAYMENT_REQUIRED_MESSAGE) : formatErrorMessage(error);
|
|
284
|
+
}
|
|
285
|
+
function composerErrorReference(error, message) {
|
|
286
|
+
return error instanceof OpenGeniApiError && error.correlationId ? `${message} Reference: ${error.correlationId}.` : message;
|
|
287
|
+
}
|
|
288
|
+
function composerSubmissionCanRetry(error) {
|
|
289
|
+
return !(isComposerCreditRefusal(error) || isModelUnavailableSubmissionError(error) || isSessionUsageLimitSubmissionError(error) || error instanceof OpenGeniApiError && error.code === "allowance_exhausted" || // Only a busy Site assistant is worth an unchanged retry.
|
|
290
|
+
siteRefusalCode(error) !== null && siteRefusalCode(error) !== "site_budget_busy");
|
|
291
|
+
}
|
|
292
|
+
function isComposerCreditRefusal(error) {
|
|
293
|
+
if (isSessionUsageLimitSubmissionError(error)) return false;
|
|
294
|
+
return error instanceof OpenGeniApiError && error.status === 402 && (error.code === "payment_required" || error.code === "insufficient_credits") || isCreditExhaustion(error.message);
|
|
295
|
+
}
|
|
296
|
+
function isCreditExhaustion(input) {
|
|
297
|
+
if (typeof input === "string") {
|
|
298
|
+
return input.toLowerCase().includes("insufficient opengeni credits");
|
|
299
|
+
}
|
|
300
|
+
if (input.segmentLimit === "budget_exhausted") {
|
|
301
|
+
return true;
|
|
302
|
+
}
|
|
303
|
+
for (const text2 of [input.error, input.detail]) {
|
|
304
|
+
if (typeof text2 === "string" && text2.toLowerCase().includes("insufficient opengeni credits")) {
|
|
305
|
+
return true;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
return false;
|
|
309
|
+
}
|
|
310
|
+
function humanizeFailureReason(reason) {
|
|
311
|
+
if (!reason) {
|
|
312
|
+
return reason;
|
|
313
|
+
}
|
|
314
|
+
if (isCreditExhaustion(reason)) {
|
|
315
|
+
return CREDIT_EXHAUSTION_MESSAGE;
|
|
316
|
+
}
|
|
317
|
+
const normalized = reason.toLowerCase();
|
|
318
|
+
const authFailure = normalized.includes("incorrect api key") || normalized.includes("invalid api key") || normalized.includes("invalid_api_key") || normalized.includes("platform.openai.com/account/api-keys") || normalized.includes("401") && (normalized.includes("api key") || normalized.includes("unauthorized"));
|
|
319
|
+
if (authFailure) {
|
|
320
|
+
return "The model provider rejected this deployment's engine credentials. Sending messages won't help until the deployment's engine configuration is fixed.";
|
|
321
|
+
}
|
|
322
|
+
const quotaFailure = normalized.includes("insufficient_quota") || normalized.includes("exceeded your current quota");
|
|
323
|
+
if (quotaFailure) {
|
|
324
|
+
return "The model provider refused the request: this deployment's provider quota is exhausted.";
|
|
325
|
+
}
|
|
326
|
+
return reason;
|
|
327
|
+
}
|
|
328
|
+
function presentFailure(payload) {
|
|
329
|
+
const databaseFailure = payload.code === "db_deadlock" || payload.code === "db_serialization_failure" || payload.code === "db_failure" || typeof payload.sqlState === "string" && /^[0-9A-Z]{5}$/.test(payload.sqlState) && payload.database !== null && typeof payload.database === "object" && !Array.isArray(payload.database);
|
|
330
|
+
if (databaseFailure) {
|
|
331
|
+
return { reason: "The service encountered a database error.", safetyRefusal: false };
|
|
332
|
+
}
|
|
333
|
+
const text2 = (key) => {
|
|
334
|
+
const value = payload[key];
|
|
335
|
+
return typeof value === "string" && value.trim() ? value : null;
|
|
336
|
+
};
|
|
337
|
+
const message = text2("error") ?? text2("message");
|
|
338
|
+
const detail = text2("lastRetryableError") ?? text2("detail");
|
|
339
|
+
const safetyRefusal = payload.code === "provider_safety_refusal" || [message, detail].some(
|
|
340
|
+
(value) => value !== null && /\bthis request was blocked by our safety systems\b/i.test(value)
|
|
341
|
+
);
|
|
342
|
+
if (safetyRefusal) {
|
|
343
|
+
return {
|
|
344
|
+
reason: `The model provider blocked this request.${detail || message ? ` ${detail ?? message}` : ""}`,
|
|
345
|
+
safetyRefusal: true
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
const recovery = parseProviderRecovery(payload);
|
|
349
|
+
if (recovery && payload.recoveryExhausted === true) {
|
|
350
|
+
return { reason: providerRecoveryExhaustedText(recovery), safetyRefusal: false };
|
|
351
|
+
}
|
|
352
|
+
return {
|
|
353
|
+
reason: detail && detail !== message ? [humanizeFailureReason(message), humanizeFailureReason(detail)].filter(Boolean).join(" ") : humanizeFailureReason(message),
|
|
354
|
+
safetyRefusal: false
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
export {
|
|
359
|
+
parseProviderRecovery,
|
|
360
|
+
providerRecoverySubject,
|
|
361
|
+
providerRecoveryRetryingText,
|
|
362
|
+
providerRecoveryExhaustedText,
|
|
363
|
+
currentProviderRecovery,
|
|
364
|
+
formatClockTime,
|
|
365
|
+
formatRelativeTime,
|
|
366
|
+
formatBytes,
|
|
367
|
+
truncate,
|
|
368
|
+
stringifyPayload,
|
|
369
|
+
tryParseJson,
|
|
370
|
+
CREDIT_EXHAUSTION_MESSAGE,
|
|
371
|
+
COMPOSER_PAYMENT_REQUIRED_MESSAGE,
|
|
372
|
+
ComposerStateError,
|
|
373
|
+
ComposerReconciliationRequiredError,
|
|
374
|
+
ComposerWorkspaceControlUnavailableError,
|
|
375
|
+
COMPOSER_MODEL_UNAVAILABLE_MESSAGE,
|
|
376
|
+
COMPOSER_SESSION_USAGE_LIMIT_MESSAGE,
|
|
377
|
+
isSessionUsageLimitSubmissionError,
|
|
378
|
+
isModelUnavailableSubmissionError,
|
|
379
|
+
composerSubmissionErrorMessage,
|
|
380
|
+
composerSubmissionCanRetry,
|
|
381
|
+
isCreditExhaustion,
|
|
382
|
+
humanizeFailureReason,
|
|
383
|
+
presentFailure
|
|
384
|
+
};
|
|
385
|
+
//# sourceMappingURL=chunk-BLL56F7R.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/provider-recovery.ts","../src/lib/format.ts"],"sourcesContent":["import type { SessionEvent, SessionStatus } from \"@opengeni/sdk\";\n\n/**\n * Finite same-turn provider recovery, projected for people. Presentation only:\n * the worker owns retry authority, pacing and the recovery budget. The worker\n * (`apps/worker/src/activities/agent-turn/provider-recovery-copy.ts`) writes\n * the same exhausted sentence into `turn.failed.error`; keep the two in step.\n */\nexport type ProviderRecoveryCondition =\n | \"overloaded\"\n | \"unavailable\"\n | \"unresponsive\"\n | \"rate_limited\";\n\nexport type ProviderRecoveryFacts = {\n /** Recorded worker failure code (`provider_unavailable`, `mcp_transport_timeout`, ...). */\n code: string;\n condition: ProviderRecoveryCondition | null;\n /** Display label of the affected model, when the route was recorded. */\n modelLabel: string | null;\n /** Display label of the serving provider, when the route was recorded. */\n providerLabel: string | null;\n /** Automatic retries scheduled (live) or spent (exhausted). */\n attempt: number | null;\n /** Finite automatic retry budget. */\n maxAttempts: number | null;\n /** True when the model route itself is affected, so another model may help. */\n modelRoute: boolean;\n /** True while the turn waits for its sandbox to be saved and replaced. It\n * has no retry budget: it resumes as soon as the successor box is ready. */\n sandboxWait?: boolean;\n /** Recorded lifecycle fence of a sandbox wait (`capture_in_progress`,\n * `rotation_in_progress`, `provider_recovery_in_progress`), when known. */\n sandboxTransition?: string | null;\n};\n\nconst MODEL_CODES: ReadonlySet<string> = new Set([\n \"provider_unavailable\",\n \"provider_rate_limited\",\n \"provider_unknown_finish_reason\",\n \"post_compaction_continuation_empty\",\n]);\n\n/** A recovering turn parked behind a sandbox lifecycle transition (worker\n * `failure-settlement.ts`). Before, this showed only \"Recovering\" with no\n * reason. A superseded lease\n * counts only when the worker recorded the pending transition it waits for. */\nconst SANDBOX_WAIT_CODES: ReadonlySet<string> = new Set([\n \"sandbox_deadline_rotation\",\n \"sandbox_lifecycle_transition\",\n \"sandbox_lease_superseded\",\n]);\n\nconst RECOVERY_CODES: ReadonlySet<string> = new Set([\n ...MODEL_CODES,\n ...SANDBOX_WAIT_CODES,\n \"upstream_connectivity_unavailable\",\n \"mcp_transport_timeout\",\n \"mcp_transport_unavailable\",\n \"sandbox_command_start_unavailable\",\n \"retained_attachment_unavailable\",\n \"turn_execution_policy_definition_mismatch\",\n]);\n\n/** Matches the worker's default budget for legacy events that omit it. */\nconst DEFAULT_MAX_ATTEMPTS = 5;\n\nfunction text(value: unknown, max = 120): string | null {\n if (typeof value !== \"string\") return null;\n const normalized = value.replace(/\\s+/g, \" \").trim();\n return normalized ? normalized.slice(0, max) : null;\n}\n\nfunction count(value: unknown): number | null {\n return typeof value === \"number\" && Number.isSafeInteger(value) && value > 0 ? value : null;\n}\n\nfunction condition(\n payload: Record<string, unknown>,\n code: string,\n): ProviderRecoveryCondition | null {\n const recorded = payload.providerCondition;\n if (\n recorded === \"overloaded\" ||\n recorded === \"unavailable\" ||\n recorded === \"unresponsive\" ||\n recorded === \"rate_limited\"\n )\n return recorded;\n if (code === \"provider_rate_limited\") return \"rate_limited\";\n if (code !== \"provider_unavailable\") return null;\n // Older events predate the typed condition; their provider text still says so.\n return [payload.lastRetryableError, payload.detail, payload.error].some(\n (value) => typeof value === \"string\" && /\\boverload(?:ed)?(?:_error)?\\b/i.test(value),\n )\n ? \"overloaded\"\n : null;\n}\n\n/**\n * Read a retryable `turn.recovery.requested` payload or an exhausted\n * `turn.failed` payload. Returns null for every other recovery reason (human\n * Retry, worker shutdown, credential rotation, capacity waits, ...).\n */\nexport function parseProviderRecovery(payload: unknown): ProviderRecoveryFacts | null {\n if (!payload || typeof payload !== \"object\" || Array.isArray(payload)) return null;\n const record = payload as Record<string, unknown>;\n const code = text(record.code) ?? text(record.reason);\n if (!code || !RECOVERY_CODES.has(code)) return null;\n const rotation = text(record.rotationReason);\n const transition = text(record.transitionReason);\n if (code === \"sandbox_lease_superseded\" && !rotation && !transition) return null;\n // A live recovery request is retryable; a spent budget is explicitly marked.\n if (record.recoveryExhausted !== true && record.retryable === false) return null;\n const attempt = count(record.providerRecoveryCount);\n return {\n code,\n condition: condition(record, code),\n modelLabel: text(record.modelLabel),\n providerLabel: text(record.providerLabel),\n attempt,\n maxAttempts: count(record.maxProviderRecoveryCount) ?? DEFAULT_MAX_ATTEMPTS,\n modelRoute: MODEL_CODES.has(code),\n ...(SANDBOX_WAIT_CODES.has(code)\n ? {\n sandboxWait: true,\n sandboxTransition: transition ?? (rotation ? \"rotation_in_progress\" : null),\n }\n : {}),\n };\n}\n\n/** One present-tense clause naming what is unavailable, without a trailing period. */\nexport function providerRecoverySubject(facts: ProviderRecoveryFacts): string {\n const model = facts.modelLabel ?? \"The model\";\n const at = facts.providerLabel ? ` at the provider (${facts.providerLabel})` : \" at the provider\";\n switch (facts.code) {\n case \"provider_rate_limited\":\n return `${model} is rate limited${at}`;\n case \"provider_unavailable\":\n return facts.condition === \"overloaded\"\n ? `${model} is overloaded${at}`\n : facts.condition === \"unresponsive\"\n ? `${model} stopped responding${at}`\n : `${model} is temporarily unavailable${at}`;\n case \"provider_unknown_finish_reason\":\n return `${model} ended its response unexpectedly`;\n case \"post_compaction_continuation_empty\":\n return `${model} stopped right after compacting the conversation`;\n case \"upstream_connectivity_unavailable\":\n return \"Opengeni can't reach an upstream service\";\n case \"mcp_transport_timeout\":\n return \"A required MCP server isn't responding\";\n case \"mcp_transport_unavailable\":\n return \"A required MCP server is unreachable\";\n case \"sandbox_command_start_unavailable\":\n return \"The sandbox isn't ready yet\";\n case \"retained_attachment_unavailable\":\n return \"An image from earlier in this conversation can't be read from storage\";\n case \"turn_execution_policy_definition_mismatch\":\n return \"Opengeni is applying a configuration update\";\n case \"sandbox_deadline_rotation\":\n return \"The sandbox reached its maximum lifetime, so Opengeni is moving the workspace to a fresh sandbox\";\n case \"sandbox_lifecycle_transition\":\n case \"sandbox_lease_superseded\":\n return facts.sandboxTransition === \"capture_in_progress\"\n ? \"Opengeni is saving the sandbox workspace\"\n : facts.sandboxTransition === \"provider_recovery_in_progress\"\n ? \"Opengeni is recovering the sandbox\"\n : facts.sandboxTransition === \"rotation_in_progress\"\n ? \"Opengeni is moving the workspace to a fresh sandbox\"\n : \"Opengeni is preparing the sandbox\";\n default:\n return \"A service this turn depends on is temporarily unavailable\";\n }\n}\n\n/** Live status while the same turn waits for its next automatic retry. */\nexport function providerRecoveryRetryingText(facts: ProviderRecoveryFacts): string {\n if (facts.sandboxWait) return `${providerRecoverySubject(facts)}…`;\n const progress =\n facts.attempt !== null && facts.maxAttempts !== null\n ? ` (attempt ${Math.min(facts.attempt, facts.maxAttempts)} of ${facts.maxAttempts})`\n : \" automatically\";\n return `${providerRecoverySubject(facts)} — retrying${progress}…`;\n}\n\n/** Terminal sentence once the automatic budget is spent. */\nexport function providerRecoveryExhaustedText(facts: ProviderRecoveryFacts): string {\n const spent = facts.attempt ?? facts.maxAttempts ?? DEFAULT_MAX_ATTEMPTS;\n const retried = `Opengeni retried ${spent} ${spent === 1 ? \"time\" : \"times\"} without success.`;\n const remedy = facts.modelRoute\n ? \"Try again in a few minutes, or switch to another model.\"\n : \"Try again in a few minutes.\";\n return `${providerRecoverySubject(facts)}. ${retried} ${remedy}`;\n}\n\nconst BOUNDARY_TYPES: ReadonlySet<string> = new Set([\n \"turn.recovery.requested\",\n \"turn.started\",\n \"turn.completed\",\n \"turn.failed\",\n \"turn.cancelled\",\n \"turn.superseded\",\n]);\n\n/**\n * The active turn's current automatic provider retry, or null. Only a\n * `recovering`, unpaused session qualifies, and only the newest boundary of its\n * exact active turn counts, so merged or replayed pages never borrow another\n * turn's diagnosis.\n */\nexport function currentProviderRecovery(\n session: {\n id: string;\n status: SessionStatus | null | undefined;\n activeTurnId: string | null | undefined;\n effectiveControl?: { state: string } | null | undefined;\n },\n events: readonly SessionEvent[],\n): ProviderRecoveryFacts | null {\n if (\n session.status !== \"recovering\" ||\n (session.effectiveControl && session.effectiveControl.state !== \"active\") ||\n !session.activeTurnId\n )\n return null;\n let latest: SessionEvent | undefined;\n for (const event of events) {\n if (\n event.sessionId !== session.id ||\n event.turnId !== session.activeTurnId ||\n event.duplicateOfEventId ||\n (event.turnAssociation && event.turnAssociation !== \"current\") ||\n !BOUNDARY_TYPES.has(event.type)\n )\n continue;\n if (!latest || event.sequence > latest.sequence) latest = event;\n }\n if (latest?.type !== \"turn.recovery.requested\") return null;\n const payload = latest.payload as Record<string, unknown> | null | undefined;\n return payload?.recoveryExhausted === true ? null : parseProviderRecovery(payload);\n}\n","import { formatErrorMessage, OpenGeniApiError } from \"@opengeni/sdk\";\nimport { parseProviderRecovery, providerRecoveryExhaustedText } from \"./provider-recovery\";\n\nconst clockTimeFormatter = new Intl.DateTimeFormat(undefined, {\n month: \"short\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"2-digit\",\n});\n\n/** Local finished-at stamp for message footers: \"Aug 2, 3:42 PM\" / locale-equivalent. */\nexport function formatClockTime(iso: string): string {\n const then = new Date(iso);\n if (Number.isNaN(then.getTime())) {\n return \"\";\n }\n return clockTimeFormatter.format(then);\n}\n\n/** Compact relative time: \"now\", \"42s\", \"7m\", \"3h\", \"2d\", then a date. */\nexport function formatRelativeTime(iso: string, now: Date = new Date()): string {\n const then = new Date(iso).getTime();\n if (Number.isNaN(then)) {\n return \"\";\n }\n const seconds = Math.max(0, Math.floor((now.getTime() - then) / 1000));\n if (seconds < 10) {\n return \"now\";\n }\n if (seconds < 60) {\n return `${seconds}s`;\n }\n const minutes = Math.floor(seconds / 60);\n if (minutes < 60) {\n return `${minutes}m`;\n }\n const hours = Math.floor(minutes / 60);\n if (hours < 24) {\n return `${hours}h`;\n }\n const days = Math.floor(hours / 24);\n if (days < 14) {\n return `${days}d`;\n }\n return new Date(iso).toLocaleDateString();\n}\n\n/** Human-readable byte size: \"512 B\", \"8.0 KB\", \"1.4 MB\", \"3 GB\". */\nexport function formatBytes(bytes: number): string {\n if (bytes < 1024) {\n return `${bytes} B`;\n }\n const units = [\"KB\", \"MB\", \"GB\"] as const;\n let value = bytes / 1024;\n for (const unit of units) {\n if (value < 1024 || unit === \"GB\") {\n return `${value.toFixed(value < 10 ? 1 : 0)} ${unit}`;\n }\n value /= 1024;\n }\n return `${bytes} B`;\n}\n\n/** Single-line preview of arbitrary text, for tiles and collapsed rows. */\nexport function truncate(text: string, maxLength: number): string {\n const collapsed = text.replace(/\\s+/g, \" \").trim();\n if (collapsed.length <= maxLength) {\n return collapsed;\n }\n return `${collapsed.slice(0, Math.max(0, maxLength - 1)).trimEnd()}…`;\n}\n\n/** Render an unknown payload as readable text (pretty JSON when possible). */\nexport function stringifyPayload(value: unknown): string {\n if (value === null || value === undefined) {\n return \"\";\n }\n if (typeof value === \"string\") {\n const parsed = tryParseJson(value);\n if (parsed !== undefined && typeof parsed === \"object\") {\n return stringifyPayload(parsed);\n }\n return value;\n }\n try {\n return JSON.stringify(value, null, 2) ?? String(value);\n } catch {\n return String(value);\n }\n}\n\n/** JSON.parse that returns `undefined` instead of throwing. */\nexport function tryParseJson(text: string): unknown {\n const trimmed = text.trim();\n if (!trimmed.startsWith(\"{\") && !trimmed.startsWith(\"[\") && !trimmed.startsWith('\"')) {\n return undefined;\n }\n try {\n return JSON.parse(trimmed) as unknown;\n } catch {\n return undefined;\n }\n}\n\n/**\n * The canonical credit-death sentence. Credit exhaustion is the one failure a\n * user can fix themselves — the copy must say what happened (empty balance),\n * what to do (add credits), and what is safe (nothing was lost). Crucially it\n * must NOT say \"send a message to revive\": a revive turn burns credits the\n * workspace no longer has.\n */\nexport const CREDIT_EXHAUSTION_MESSAGE =\n \"Out of credits — this workspace's balance is empty. Add credits to continue; the conversation is preserved.\";\n\n/** A usage ceiling refused the send; the default allowance wording, plus what is safe. */\nexport const COMPOSER_MEMBER_ALLOWANCE_MESSAGE =\n \"Usage limit reached. A workspace admin can raise this limit. Your draft is preserved.\";\nexport const COMPOSER_WORKSPACE_ALLOWANCE_MESSAGE =\n \"Workspace usage limit reached. An organization admin can raise the workspace budget. Your draft is preserved.\";\n\n/**\n * Actionable composer copy for an edge rejection before a turn is accepted.\n * Unlike an in-flight credit exhaustion, this path has not consumed the\n * actor-private draft or any finalized attachment.\n */\nexport const COMPOSER_PAYMENT_REQUIRED_MESSAGE =\n \"Your organization doesn't have enough credits to send this message. Add credits or choose a model with another payment source. Your message and attachments are saved.\";\n\n/** Trusted, composer-owned guidance; unlike remote diagnostic prose, this is UI copy. */\nexport class ComposerStateError extends Error {}\n\n/** A restored request has omitted credentials and must be reconciled, not replayed. */\nexport class ComposerReconciliationRequiredError extends ComposerStateError {\n constructor() {\n super(\n \"Opengeni cannot safely retry this uncertain request after remount; reconcile the session before sending again.\",\n );\n }\n}\n\nexport class ComposerWorkspaceControlUnavailableError extends Error {\n constructor() {\n super(\"@opengeni/react: workspace-scoped resume requires setWorkspaceInferenceState.\");\n }\n}\n\n/**\n * The send named a model that is no longer in the live catalog (retired or\n * removed). Retrying the same send cannot succeed; the person must choose\n * another model, and the typed message stays recoverable via Edit message.\n */\nexport const COMPOSER_MODEL_UNAVAILABLE_MESSAGE =\n \"This chat's model is no longer available. Choose another model to continue. Your message is saved.\";\n\n/** `details.code` the API sets on a 422 for a model missing from the live catalog. */\nexport const MODEL_UNAVAILABLE_DETAIL_CODE = \"model_unavailable\";\n\n/**\n * A fresh Send or Steer refused because the task's own usage limit is reached.\n * The draft is kept and an unchanged retry is never offered. The one current\n * recovery action (raise or remove the limit, resume a goal) belongs to the\n * composer's `SessionUsageLimitNotice`, so this line only says what happened.\n */\nexport const COMPOSER_SESSION_USAGE_LIMIT_MESSAGE =\n \"This task's usage limit is reached. Your message is saved.\";\n\n/** The earlier wording, still recognized in refusals restored from storage. */\nconst LEGACY_COMPOSER_SESSION_USAGE_LIMIT_MESSAGE =\n \"This task's usage limit is reached. Raise or remove the limit to continue. Your message is saved.\";\n\n/**\n * Is this send refusal the task's usage limit? Reads the typed SDK error code\n * (`OpenGeniSessionUsageLimitReachedError`), and also the composer's own\n * sentence so a refusal restored from storage after a reload is recognized.\n */\nexport function isSessionUsageLimitSubmissionError(error: Error): boolean {\n return (\n (error instanceof OpenGeniApiError && error.code === \"session_usage_limit_reached\") ||\n error.message === COMPOSER_SESSION_USAGE_LIMIT_MESSAGE ||\n error.message === LEGACY_COMPOSER_SESSION_USAGE_LIMIT_MESSAGE\n );\n}\n\n/**\n * Is this send refusal \"the model is no longer available\"? Reads the typed\n * `details.code`, and also the historical message so a refusal persisted\n * before a reload (only its text survives) or from an older API is recognized.\n */\nexport function isModelUnavailableSubmissionError(error: Error): boolean {\n if (error instanceof OpenGeniApiError && error.details?.code === MODEL_UNAVAILABLE_DETAIL_CODE) {\n return true;\n }\n return (\n error.message === COMPOSER_MODEL_UNAVAILABLE_MESSAGE ||\n /^(?:Opengeni|OpenGeni) API 422: model is not available: /.test(error.message)\n );\n}\n\n/**\n * What a published Site's assistant tells a viewer it refused, by the\n * refusal's `details.code`. The draft is kept in every case.\n */\nexport const COMPOSER_SITE_REFUSAL_MESSAGES: Readonly<Record<string, string>> = Object.freeze({\n not_available_for_viewer: \"This Site's assistant can't do that for you. Your message is saved.\",\n site_budget_exhausted:\n \"This Site's assistant has reached its usage limit for now. Your message is saved.\",\n site_budget_busy: \"This Site's assistant is busy. Try again in a moment. Your message is saved.\",\n site_platform_brake_engaged:\n \"This Site's assistant is paused for visitors right now. Your message is saved.\",\n});\n\n/** The Site refusal code of a send refusal, if it is one. */\nexport function siteRefusalCode(error: Error): string | null {\n if (!(error instanceof OpenGeniApiError)) return null;\n const code = error.details?.code;\n return typeof code === \"string\" && code in COMPOSER_SITE_REFUSAL_MESSAGES ? code : null;\n}\n\nexport function composerSubmissionErrorMessage(error: Error): string {\n if (error instanceof ComposerReconciliationRequiredError) {\n return \"This client cannot safely retry this uncertain request after remount; reconcile the session before sending again.\";\n }\n if (error instanceof ComposerWorkspaceControlUnavailableError) {\n return \"This client cannot resume the workspace. Ask your administrator for a control-capable client.\";\n }\n if (error instanceof ComposerStateError) return error.message;\n if (error instanceof OpenGeniApiError && error.outcomeUnknown) return formatErrorMessage(error);\n if (isModelUnavailableSubmissionError(error)) return COMPOSER_MODEL_UNAVAILABLE_MESSAGE;\n if (isSessionUsageLimitSubmissionError(error)) return COMPOSER_SESSION_USAGE_LIMIT_MESSAGE;\n const siteRefusal = siteRefusalCode(error);\n if (siteRefusal) return COMPOSER_SITE_REFUSAL_MESSAGES[siteRefusal]!;\n if (error instanceof OpenGeniApiError && error.code === \"allowance_exhausted\") {\n // OpenGeniAllowanceExhaustedError carries the scope; read it structurally\n // so this startup-path helper adds no SDK or wording imports.\n const message =\n (error as { scope?: unknown }).scope === \"workspace\"\n ? COMPOSER_WORKSPACE_ALLOWANCE_MESSAGE\n : COMPOSER_MEMBER_ALLOWANCE_MESSAGE;\n return composerErrorReference(error, message);\n }\n return isComposerCreditRefusal(error)\n ? composerErrorReference(error, COMPOSER_PAYMENT_REQUIRED_MESSAGE)\n : formatErrorMessage(error);\n}\n\nfunction composerErrorReference(error: Error, message: string): string {\n return error instanceof OpenGeniApiError && error.correlationId\n ? `${message} Reference: ${error.correlationId}.`\n : message;\n}\n\n/** These definitive refusals need a payment, allowance or model change, not an unchanged retry. */\nexport function composerSubmissionCanRetry(error: Error): boolean {\n return !(\n isComposerCreditRefusal(error) ||\n isModelUnavailableSubmissionError(error) ||\n isSessionUsageLimitSubmissionError(error) ||\n (error instanceof OpenGeniApiError && error.code === \"allowance_exhausted\") ||\n // Only a busy Site assistant is worth an unchanged retry.\n (siteRefusalCode(error) !== null && siteRefusalCode(error) !== \"site_budget_busy\")\n );\n}\n\nfunction isComposerCreditRefusal(error: Error): boolean {\n // A 402 for the task's own usage limit is not a credit or payment problem.\n if (isSessionUsageLimitSubmissionError(error)) return false;\n return (\n (error instanceof OpenGeniApiError &&\n error.status === 402 &&\n (error.code === \"payment_required\" || error.code === \"insufficient_credits\")) ||\n isCreditExhaustion(error.message)\n );\n}\n\n/**\n * Does this failure/completion payload (or raw error string) mean the\n * workspace ran out of Opengeni credits? Matches the engine's\n * \"insufficient Opengeni credits\" text (case-insensitive, substring — it\n * arrives both bare and wrapped in \"Activity task failed: …\") and the\n * budget-exhausted segment limit the engine stamps on a turn it ended early.\n */\nexport function isCreditExhaustion(\n input: { error?: string | null; detail?: string | null; segmentLimit?: string | null } | string,\n): boolean {\n if (typeof input === \"string\") {\n return input.toLowerCase().includes(\"insufficient opengeni credits\");\n }\n if (input.segmentLimit === \"budget_exhausted\") {\n return true;\n }\n for (const text of [input.error, input.detail]) {\n if (typeof text === \"string\" && text.toLowerCase().includes(\"insufficient opengeni credits\")) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Humanize engine/provider failure text before it reaches the timeline or a\n * failure banner. Raw provider errors leak the wrong audience's instructions —\n * \"Incorrect API key … find your API key at platform.openai.com\" tells a\n * managed-deployment USER to fix credentials only an OPERATOR controls (and is\n * flatly wrong for Azure or subscription-backed engines). Auth, quota, and\n * credit-exhaustion failures collapse to one neutral, honest sentence; every\n * other reason passes through untouched. Raw payloads stay available in the\n * debug surfaces.\n */\nexport function humanizeFailureReason(reason: string | null): string | null {\n if (!reason) {\n return reason;\n }\n if (isCreditExhaustion(reason)) {\n return CREDIT_EXHAUSTION_MESSAGE;\n }\n const normalized = reason.toLowerCase();\n const authFailure =\n normalized.includes(\"incorrect api key\") ||\n normalized.includes(\"invalid api key\") ||\n normalized.includes(\"invalid_api_key\") ||\n normalized.includes(\"platform.openai.com/account/api-keys\") ||\n (normalized.includes(\"401\") &&\n (normalized.includes(\"api key\") || normalized.includes(\"unauthorized\")));\n if (authFailure) {\n return \"The model provider rejected this deployment's engine credentials. Sending messages won't help until the deployment's engine configuration is fixed.\";\n }\n const quotaFailure =\n normalized.includes(\"insufficient_quota\") || normalized.includes(\"exceeded your current quota\");\n if (quotaFailure) {\n return \"The model provider refused the request: this deployment's provider quota is exhausted.\";\n }\n return reason;\n}\n\n/** Project failure diagnostics without changing the stored event, including legacy retry wrappers. */\nexport function presentFailure(payload: Record<string, unknown>): {\n reason: string | null;\n safetyRefusal: boolean;\n} {\n const databaseFailure =\n payload.code === \"db_deadlock\" ||\n payload.code === \"db_serialization_failure\" ||\n payload.code === \"db_failure\" ||\n (typeof payload.sqlState === \"string\" &&\n /^[0-9A-Z]{5}$/.test(payload.sqlState) &&\n payload.database !== null &&\n typeof payload.database === \"object\" &&\n !Array.isArray(payload.database));\n if (databaseFailure) {\n return { reason: \"The service encountered a database error.\", safetyRefusal: false };\n }\n const text = (key: string): string | null => {\n const value = payload[key];\n return typeof value === \"string\" && value.trim() ? value : null;\n };\n const message = text(\"error\") ?? text(\"message\");\n const detail = text(\"lastRetryableError\") ?? text(\"detail\");\n const safetyRefusal =\n payload.code === \"provider_safety_refusal\" ||\n [message, detail].some(\n (value) =>\n value !== null && /\\bthis request was blocked by our safety systems\\b/i.test(value),\n );\n if (safetyRefusal) {\n return {\n reason: `The model provider blocked this request.${detail || message ? ` ${detail ?? message}` : \"\"}`,\n safetyRefusal: true,\n };\n }\n // Spent automatic retries: name the model and the remedy instead of the\n // recorded wrapper plus raw provider text (still in the stored event).\n const recovery = parseProviderRecovery(payload);\n if (recovery && payload.recoveryExhausted === true) {\n return { reason: providerRecoveryExhaustedText(recovery), safetyRefusal: false };\n }\n return {\n reason:\n detail && detail !== message\n ? [humanizeFailureReason(message), humanizeFailureReason(detail)].filter(Boolean).join(\" \")\n : humanizeFailureReason(message),\n safetyRefusal: false,\n };\n}\n"],"mappings":";;;AAoCA,IAAM,cAAmC,oBAAI,IAAI;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAMD,IAAM,qBAA0C,oBAAI,IAAI;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,IAAM,iBAAsC,oBAAI,IAAI;AAAA,EAClD,GAAG;AAAA,EACH,GAAG;AAAA,EACH;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGD,IAAM,uBAAuB;AAE7B,SAAS,KAAK,OAAgB,MAAM,KAAoB;AACtD,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,QAAM,aAAa,MAAM,QAAQ,QAAQ,GAAG,EAAE,KAAK;AACnD,SAAO,aAAa,WAAW,MAAM,GAAG,GAAG,IAAI;AACjD;AAEA,SAAS,MAAM,OAA+B;AAC5C,SAAO,OAAO,UAAU,YAAY,OAAO,cAAc,KAAK,KAAK,QAAQ,IAAI,QAAQ;AACzF;AAEA,SAAS,UACP,SACA,MACkC;AAClC,QAAM,WAAW,QAAQ;AACzB,MACE,aAAa,gBACb,aAAa,iBACb,aAAa,kBACb,aAAa;AAEb,WAAO;AACT,MAAI,SAAS,wBAAyB,QAAO;AAC7C,MAAI,SAAS,uBAAwB,QAAO;AAE5C,SAAO,CAAC,QAAQ,oBAAoB,QAAQ,QAAQ,QAAQ,KAAK,EAAE;AAAA,IACjE,CAAC,UAAU,OAAO,UAAU,YAAY,kCAAkC,KAAK,KAAK;AAAA,EACtF,IACI,eACA;AACN;AAOO,SAAS,sBAAsB,SAAgD;AACpF,MAAI,CAAC,WAAW,OAAO,YAAY,YAAY,MAAM,QAAQ,OAAO,EAAG,QAAO;AAC9E,QAAM,SAAS;AACf,QAAM,OAAO,KAAK,OAAO,IAAI,KAAK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EACF;AAGA,QAAM,WAAW,sBAAsB,OAAO;AAC9C,MAAI,YAAY,QAAQ,sBAAsB,MAAM;AAClD,WAAO,EAAE,QAAQ,8BAA8B,QAAQ,GAAG,eAAe,MAAM;AAAA,EACjF;AACA,SAAO;AAAA,IACL,QACE,UAAU,WAAW,UACjB,CAAC,sBAAsB,OAAO,GAAG,sBAAsB,MAAM,CAAC,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,IACxF,sBAAsB,OAAO;AAAA,IACnC,eAAe;AAAA,EACjB;AACF;","names":["text"]}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
copyPendingTextToClipboard
|
|
4
|
+
} from "./chunk-PEHTX3V7.js";
|
|
5
|
+
|
|
6
|
+
// src/timeline/retained-image.ts
|
|
7
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
8
|
+
function useRetainedImageObjectUrl(artifact, load) {
|
|
9
|
+
const [state, setState] = useState({ kind: "loading" });
|
|
10
|
+
const [retrievalAttempt, setRetrievalAttempt] = useState(0);
|
|
11
|
+
const retry = useCallback(() => setRetrievalAttempt((attempt) => attempt + 1), []);
|
|
12
|
+
const artifactValue = retainedArtifactValue(artifact);
|
|
13
|
+
const stableArtifactRef = useRef({ value: artifactValue, artifact });
|
|
14
|
+
if (stableArtifactRef.current.value !== artifactValue) {
|
|
15
|
+
stableArtifactRef.current = { value: artifactValue, artifact };
|
|
16
|
+
}
|
|
17
|
+
const stableArtifact = stableArtifactRef.current.artifact;
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (!load) {
|
|
20
|
+
setState({ kind: "unavailable", label: "retrieval is not configured" });
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const controller = new AbortController();
|
|
24
|
+
let objectUrl = null;
|
|
25
|
+
setState({ kind: "loading" });
|
|
26
|
+
void load(stableArtifact, controller.signal).then((source) => {
|
|
27
|
+
if (controller.signal.aborted) return;
|
|
28
|
+
if (!source) {
|
|
29
|
+
setState({ kind: "unavailable", label: "bytes are unavailable" });
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (!(source instanceof Uint8Array)) {
|
|
33
|
+
if (!source.url.trim()) {
|
|
34
|
+
setState({ kind: "unavailable", label: "URL is unavailable" });
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
setState({ kind: "ready", url: source.url });
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
objectUrl = URL.createObjectURL(
|
|
41
|
+
new Blob([source], { type: stableArtifact.contentType })
|
|
42
|
+
);
|
|
43
|
+
setState({ kind: "ready", url: objectUrl });
|
|
44
|
+
}).catch((error) => {
|
|
45
|
+
if (controller.signal.aborted) return;
|
|
46
|
+
const status = error && typeof error === "object" && "status" in error ? Number(error.status) : null;
|
|
47
|
+
setState(
|
|
48
|
+
status === 404 ? { kind: "unavailable", label: "deleted" } : status === 410 ? { kind: "unavailable", label: "expired or unavailable" } : { kind: "error", message: "retrieval failed" }
|
|
49
|
+
);
|
|
50
|
+
});
|
|
51
|
+
return () => {
|
|
52
|
+
controller.abort();
|
|
53
|
+
if (objectUrl) URL.revokeObjectURL(objectUrl);
|
|
54
|
+
};
|
|
55
|
+
}, [stableArtifact, load, retrievalAttempt]);
|
|
56
|
+
return { ...state, retry };
|
|
57
|
+
}
|
|
58
|
+
function retainedArtifactValue(artifact) {
|
|
59
|
+
return [
|
|
60
|
+
artifact.artifactId,
|
|
61
|
+
artifact.kind,
|
|
62
|
+
artifact.contentType,
|
|
63
|
+
artifact.originalBytes,
|
|
64
|
+
artifact.sha256,
|
|
65
|
+
artifact.retainedAt,
|
|
66
|
+
artifact.dimensions?.width ?? "",
|
|
67
|
+
artifact.dimensions?.height ?? "",
|
|
68
|
+
artifact.retention.policy,
|
|
69
|
+
artifact.retention.expiresAt ?? "",
|
|
70
|
+
artifact.retrieval.method,
|
|
71
|
+
artifact.retrieval.path,
|
|
72
|
+
artifact.retrieval.acceptRanges,
|
|
73
|
+
artifact.retrieval.maxRangeBytes
|
|
74
|
+
].join("\0");
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// src/timeline/patch-apply-command.tsx
|
|
78
|
+
import { CheckIcon, TerminalIcon } from "lucide-react";
|
|
79
|
+
import { useState as useState2 } from "react";
|
|
80
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
81
|
+
function shellQuote(value) {
|
|
82
|
+
return `'${value.replaceAll("'", `'\\''`)}'`;
|
|
83
|
+
}
|
|
84
|
+
function patchApplyCommand(url) {
|
|
85
|
+
return `curl -fsSL ${shellQuote(url)} | git apply`;
|
|
86
|
+
}
|
|
87
|
+
function applyCommandLifetime(expiresAt, now = Date.now()) {
|
|
88
|
+
const expires = expiresAt ? Date.parse(expiresAt) : Number.NaN;
|
|
89
|
+
const minutes = Number.isFinite(expires) ? Math.round((expires - now) / 6e4) : 5;
|
|
90
|
+
if (minutes <= 1) return "1 minute";
|
|
91
|
+
return `${minutes} minutes`;
|
|
92
|
+
}
|
|
93
|
+
var BUTTON_CLASS = "inline-flex items-center gap-1.5 rounded-og-sm border border-og-border px-2.5 py-1.5 text-og-sm font-medium text-og-fg transition-colors hover:border-og-border-strong hover:bg-og-surface-2 disabled:cursor-wait disabled:opacity-60";
|
|
94
|
+
function PatchApplyCommand({
|
|
95
|
+
artifact,
|
|
96
|
+
filename,
|
|
97
|
+
load
|
|
98
|
+
}) {
|
|
99
|
+
const [state, setState] = useState2({ kind: "idle" });
|
|
100
|
+
const copy = async () => {
|
|
101
|
+
if (!load) {
|
|
102
|
+
setState({ kind: "unavailable" });
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
setState({ kind: "loading" });
|
|
106
|
+
let lifetime = "5 minutes";
|
|
107
|
+
const command = load(artifact, new AbortController().signal, { prefer: "url" }).then(
|
|
108
|
+
(source) => {
|
|
109
|
+
if (!source || source instanceof Uint8Array) throw new UnavailableError();
|
|
110
|
+
lifetime = applyCommandLifetime(source.expiresAt);
|
|
111
|
+
return patchApplyCommand(source.url);
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
const copied = copyPendingTextToClipboard(command);
|
|
115
|
+
try {
|
|
116
|
+
const text = await command;
|
|
117
|
+
if (await copied) setState({ kind: "copied", lifetime });
|
|
118
|
+
else setState({ kind: "manual", command: text, lifetime });
|
|
119
|
+
} catch (failure) {
|
|
120
|
+
setState({ kind: failure instanceof UnavailableError ? "unavailable" : "error" });
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
const label = state.kind === "loading" ? "Preparing\u2026" : state.kind === "copied" ? "Copied" : state.kind === "error" ? "Try again" : "Copy command to apply these changes";
|
|
124
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-1.5", children: [
|
|
125
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
|
|
126
|
+
"button",
|
|
127
|
+
{
|
|
128
|
+
type: "button",
|
|
129
|
+
onClick: () => void copy(),
|
|
130
|
+
disabled: state.kind === "loading",
|
|
131
|
+
className: BUTTON_CLASS,
|
|
132
|
+
children: [
|
|
133
|
+
state.kind === "copied" ? /* @__PURE__ */ jsx(CheckIcon, { className: "size-3.5", "aria-hidden": true }) : /* @__PURE__ */ jsx(TerminalIcon, { className: "size-3.5", "aria-hidden": true }),
|
|
134
|
+
label
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
) }),
|
|
138
|
+
/* @__PURE__ */ jsx("p", { className: "m-0 text-og-xs leading-relaxed text-og-fg-muted", role: "status", children: state.kind === "copied" ? `Copied. Paste it in a terminal in your project folder and press Enter. The link in it expires in ${state.lifetime}.` : state.kind === "manual" ? `Copy this command, then run it in your project folder. The link in it expires in ${state.lifetime}.` : state.kind === "unavailable" ? `Download ${filename}, then run git apply ${filename} in your project folder.` : state.kind === "error" ? "Couldn't prepare the command. Try again, or download the file and run git apply." : "Runs git apply in your project folder. Works on macOS, Linux and Git Bash." }),
|
|
139
|
+
state.kind === "manual" ? /* @__PURE__ */ jsx(
|
|
140
|
+
"input",
|
|
141
|
+
{
|
|
142
|
+
readOnly: true,
|
|
143
|
+
value: state.command,
|
|
144
|
+
"aria-label": "Command to apply these changes",
|
|
145
|
+
onFocus: (event) => event.currentTarget.select(),
|
|
146
|
+
className: "w-full min-w-0 rounded-og-sm border border-og-border bg-og-surface-2 px-2 py-1.5 font-mono text-og-xs text-og-fg"
|
|
147
|
+
}
|
|
148
|
+
) : null
|
|
149
|
+
] });
|
|
150
|
+
}
|
|
151
|
+
var UnavailableError = class extends Error {
|
|
152
|
+
constructor() {
|
|
153
|
+
super("A download URL is unavailable here");
|
|
154
|
+
this.name = "UnavailableError";
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export {
|
|
159
|
+
useRetainedImageObjectUrl,
|
|
160
|
+
PatchApplyCommand
|
|
161
|
+
};
|
|
162
|
+
//# sourceMappingURL=chunk-BOFEQC6K.js.map
|