@opengeni/react 6.40.0 → 6.41.1-canary.45704649926001
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/dist/app/app-state.js +34 -34
- package/dist/app/components/Composer.js +45 -45
- package/dist/app/components/add-card-dialog.js +3 -3
- package/dist/app/components/add-card.js +2 -2
- package/dist/app/components/agent/agent-capability-picker.js +10 -10
- package/dist/app/components/agents/agent-can-use.js +51 -50
- package/dist/app/components/agents/agent-cost.js +2 -2
- package/dist/app/components/agents/agent-form-page.js +153 -152
- package/dist/app/components/agents/agent-form-page.js.map +1 -1
- package/dist/app/components/agents/agent-page.js +134 -133
- package/dist/app/components/agents/agent-setup-sections.js +81 -80
- package/dist/app/components/agents/agent-skills.js +15 -15
- package/dist/app/components/agents/agent-trigger-chat-field.js +6 -6
- package/dist/app/components/agents/agent-trigger-dialog.js +35 -35
- package/dist/app/components/agents/agent-trigger-picker.js +8 -8
- package/dist/app/components/agents/agent-trigger-repositories.js +16 -16
- package/dist/app/components/agents/agents-page.js +99 -98
- package/dist/app/components/agents/agents-page.js.map +1 -1
- package/dist/app/components/agents/composer-agent-chip.js +60 -59
- package/dist/app/components/agents/session-agent-chip.js +55 -54
- package/dist/app/components/artifacts/app-package.js +13 -13
- package/dist/app/components/artifacts/artifact-browse-controls.js +3 -3
- package/dist/app/components/artifacts/artifact-library.js +30 -30
- package/dist/app/components/artifacts/artifact-page-chrome.js +1 -1
- package/dist/app/components/artifacts/artifact-viewer.js +64 -63
- package/dist/app/components/artifacts/artifact-viewer.js.map +1 -1
- package/dist/app/components/artifacts/chat-interactive-block.js +30 -28
- package/dist/app/components/artifacts/chat-interactive-block.js.map +1 -1
- package/dist/app/components/artifacts/copy-artifact-link.js +3 -3
- package/dist/app/components/artifacts/file-reach-dialog.js +13 -13
- package/dist/app/components/artifacts/inline-chat-image.js +52 -51
- package/dist/app/components/artifacts/ready-made-apps.js +13 -13
- package/dist/app/components/artifacts/retained-file-preview.js +57 -56
- package/dist/app/components/artifacts/retained-text-preview.js +7 -7
- package/dist/app/components/artifacts/site-actions.js +11 -11
- package/dist/app/components/artifacts/site-audience.js +8 -8
- package/dist/app/components/artifacts/site-conversations.js +34 -34
- package/dist/app/components/artifacts/site-data.js +30 -30
- package/dist/app/components/artifacts/site-public-link.js +1 -1
- package/dist/app/components/artifacts/site-publishing-page.js +72 -72
- package/dist/app/components/artifacts/site-publishing.js +55 -55
- package/dist/app/components/artifacts/site-settings.js +71 -71
- package/dist/app/components/artifacts/site-version-menu.js +9 -9
- package/dist/app/components/billing-class-mark.js +7 -7
- package/dist/app/components/capabilities/capability-detail-sheet.js +18 -18
- package/dist/app/components/capabilities/capability-logo-source.js +31 -30
- package/dist/app/components/capabilities/capability-logo.js +1 -1
- package/dist/app/components/capabilities/connection-account-picker.js +2 -2
- package/dist/app/components/capabilities/connection-ownership-selector.js +4 -4
- package/dist/app/components/capabilities/connector-tool-permissions.js +7 -7
- package/dist/app/components/capabilities/detail-dialog.js +3 -3
- package/dist/app/components/capabilities/native-connect-setup.js +36 -35
- package/dist/app/components/capabilities/own-logins-shared-heads-up.js +7 -7
- package/dist/app/components/capabilities/perform-capability-action.js +3 -3
- package/dist/app/components/capabilities/prepared-mcp-setup-card.js +35 -34
- package/dist/app/components/capabilities/session-capability-card.js +142 -141
- package/dist/app/components/capabilities/session-capability-card.js.map +1 -1
- package/dist/app/components/capabilities/session-chrome-card.js +49 -49
- package/dist/app/components/capabilities/session-connect-inputs-card.js +38 -37
- package/dist/app/components/capabilities/session-custom-mcp-card.js +43 -42
- package/dist/app/components/capabilities/session-github-card.js +49 -48
- package/dist/app/components/capabilities/session-machine-card.js +50 -50
- package/dist/app/components/capabilities/session-personal-github-card.js +35 -34
- package/dist/app/components/capabilities/session-plugin-card.js +23 -22
- package/dist/app/components/capabilities/use-capabilities-catalog.js +4 -4
- package/dist/app/components/capabilities/use-connection-accounts.js +3 -3
- package/dist/app/components/command-menu/chat-status.js +25 -25
- package/dist/app/components/command-menu/chat-switcher.js +90 -89
- package/dist/app/components/command-menu/chat-switcher.js.map +1 -1
- package/dist/app/components/command-menu/command-menu.js +118 -117
- package/dist/app/components/command-menu/command-menu.js.map +1 -1
- package/dist/app/components/command-menu/shortcut-sheet.js +26 -26
- package/dist/app/components/composer-capabilities-menu-body.js +7 -7
- package/dist/app/components/composer-mobile-plus-panel.js +32 -32
- package/dist/app/components/composer-mobile-plus.js +5 -5
- package/dist/app/components/credit-amount-picker.js +2 -2
- package/dist/app/components/credit-required-gate.js +6 -6
- package/dist/app/components/credit-required-prompt.js +27 -27
- package/dist/app/components/credits/checkout-credits-celebration.js +4 -4
- package/dist/app/components/credits/checkout-return.js +4 -4
- package/dist/app/components/credits/coupon-redeem.js +1 -1
- package/dist/app/components/credits/credit-refusal-notice.js +8 -8
- package/dist/app/components/credits/own-subscription-plan-notice.js +3 -3
- package/dist/app/components/cross-slot-deep-link-recovery.js +2 -2
- package/dist/app/components/desktop/app-shots.js +10 -10
- package/dist/app/components/desktop/app-update.js +3 -3
- package/dist/app/components/desktop/computer-use.js +4 -4
- package/dist/app/components/desktop/this-computer.js +8 -8
- package/dist/app/components/feedback.js +11 -11
- package/dist/app/components/follow-up-repository-menu-body.js +12 -12
- package/dist/app/components/follow-up-repository-picker.js +1 -1
- package/dist/app/components/github-app-connect-launcher.js +2 -2
- package/dist/app/components/in-app-help-link.js +3 -3
- package/dist/app/components/knowledge/agent-learning-settings.js +5 -5
- package/dist/app/components/machines/connect-machine-dialog.js +25 -25
- package/dist/app/components/manual-repository-editor.js +1 -1
- package/dist/app/components/markdown.js +18 -17
- package/dist/app/components/model-identity.js +3 -3
- package/dist/app/components/models/models-ui.js +17 -17
- package/dist/app/components/models/provider-mark.js +3 -3
- package/dist/app/components/models/subscription-usage.js +5 -5
- package/dist/app/components/my-things.js +19 -19
- package/dist/app/components/own-where-it-works.js +12 -12
- package/dist/app/components/personal-resource-attachment-surface.js +4 -4
- package/dist/app/components/pickers.js +12 -12
- package/dist/app/components/rail/channel-create-dialog.js +6 -6
- package/dist/app/components/rail/project-glyph.js +54 -53
- package/dist/app/components/rail/project-profile.js +76 -75
- package/dist/app/components/rail/rail-context.js +2 -2
- package/dist/app/components/rail/rail-sections.js +155 -154
- package/dist/app/components/rail/session-header.js +125 -124
- package/dist/app/components/rail/session-list.js +153 -152
- package/dist/app/components/rail/session-row-content.js +6 -6
- package/dist/app/components/rail/session-row-hover-details.js +36 -36
- package/dist/app/components/rail/session-shell.js +194 -193
- package/dist/app/components/rail/site-session-group-heading.js +37 -37
- package/dist/app/components/repository-picker.js +12 -12
- package/dist/app/components/secrets/session-secrets-panel.js +3 -3
- package/dist/app/components/session/agent-configuration-panel.js +53 -53
- package/dist/app/components/session/artifact-session-page.js +8 -8
- package/dist/app/components/session/banners.js +22 -21
- package/dist/app/components/session/chat-avatar.js +54 -53
- package/dist/app/components/session/console-new-conversation.js +105 -104
- package/dist/app/components/session/descendant-requests.js +101 -100
- package/dist/app/components/session/descendant-requests.js.map +1 -1
- package/dist/app/components/session/editable-artifacts-workspace.js +62 -60
- package/dist/app/components/session/editable-artifacts-workspace.js.map +1 -1
- package/dist/app/components/session/failed-session-banner.js +28 -28
- package/dist/app/components/session/failure-recovery-boundary.js +3 -3
- package/dist/app/components/session/human-input-delegation-record.js +3 -3
- package/dist/app/components/session/human-input.js +88 -87
- package/dist/app/components/session/inspector.js +136 -135
- package/dist/app/components/session/inspector.js.map +1 -1
- package/dist/app/components/session/linked-panel.js +3 -3
- package/dist/app/components/session/message-actions.js +11 -11
- package/dist/app/components/session/model-recovery-notice.js +4 -4
- package/dist/app/components/session/new-session-settings-menu.js +32 -32
- package/dist/app/components/session/new-session-setup-strip.js +58 -57
- package/dist/app/components/session/own-account-wait-notice.js +8 -8
- package/dist/app/components/session/pinned-account-wait-notice.js +8 -8
- package/dist/app/components/session/pull-request-panel.js +26 -25
- package/dist/app/components/session/sandbox-recovery-actions.js +5 -5
- package/dist/app/components/session/sandbox-switcher.js +22 -22
- package/dist/app/components/session/sandbox-workspace.js +118 -117
- package/dist/app/components/session/search-markdown-highlight.js +19 -18
- package/dist/app/components/session/search-results-view.js +20 -19
- package/dist/app/components/session/session-admin-access.js +12 -12
- package/dist/app/components/session/session-admission-notice.js +11 -11
- package/dist/app/components/session/session-avatar-picker.js +61 -60
- package/dist/app/components/session/session-avatar.js +56 -55
- package/dist/app/components/session/session-machine-access-notice.js +11 -11
- package/dist/app/components/session/session-profile-dialog.js +72 -71
- package/dist/app/components/session/session-profile-editor.js +73 -72
- package/dist/app/components/session/session-retention.js +8 -8
- package/dist/app/components/session/session-search-dialog.js +26 -25
- package/dist/app/components/session/session-search-dialog.js.map +1 -1
- package/dist/app/components/session/session-skill-reviews.js +5 -5
- package/dist/app/components/session/session-tenancy-control.js +25 -25
- package/dist/app/components/session/session-unattended-setting.js +4 -4
- package/dist/app/components/session/session-usage-limit-section.js +13 -13
- package/dist/app/components/session/share-chat-dialog.js +12 -12
- package/dist/app/components/session/subagents.js +22 -22
- package/dist/app/components/session/subscription-account-indicator.js +25 -25
- package/dist/app/components/session/subscription-account-menu.js +7 -7
- package/dist/app/components/session-connectors-menu-body.js +11 -11
- package/dist/app/components/settings/row-select.js +6 -6
- package/dist/app/components/transcription-settings.js +10 -10
- package/dist/app/components/ui/destructive-confirm.js +11 -11
- package/dist/app/components/usage/usage-entry.js +8 -8
- package/dist/app/components/window-bar.js +25 -25
- package/dist/app/components/workspace-composer-plus.js +46 -45
- package/dist/app/components/workspace-reach.d.ts +2 -0
- package/dist/app/components/workspace-reach.js +6 -6
- package/dist/app/embed/session-app.js +406 -405
- package/dist/app/lib/actions/actions-provider.js +18 -18
- package/dist/app/lib/agent-capabilities.js +4 -4
- package/dist/app/lib/app-connect-card.js +16 -16
- package/dist/app/lib/app-shared-key-dialog.js +9 -9
- package/dist/app/lib/app-surfaces.js +1 -1
- package/dist/app/lib/app-sync-opt-in.js +7 -7
- package/dist/app/lib/codex-usage-query.js +3 -3
- package/dist/app/lib/composer-agent.js +2 -2
- package/dist/app/lib/composer-connectors.js +35 -34
- package/dist/app/lib/composer-send-blocking.js +2 -2
- package/dist/app/lib/console-site.js +9 -9
- package/dist/app/lib/console-text.js +2 -2
- package/dist/app/lib/events.js +32 -31
- package/dist/app/lib/failed-session-copy.js +5 -5
- package/dist/app/lib/feedback-capture.js +2 -2
- package/dist/app/lib/model-access-onboarding.js +4 -4
- package/dist/app/lib/move-chat-to-machine.js +5 -5
- package/dist/app/lib/personal-resource-attachments.js +1 -1
- package/dist/app/lib/session-branch-cache.js +18 -18
- package/dist/app/lib/session-create.js +5 -5
- package/dist/app/lib/session-group-pagination.js +18 -18
- package/dist/app/lib/session-hover-facts.js +25 -25
- package/dist/app/lib/session-list-dirty-scopes.js +19 -19
- package/dist/app/lib/session-model.js +2 -2
- package/dist/app/lib/session-rail.js +15 -15
- package/dist/app/lib/session-rename.js +3 -3
- package/dist/app/lib/sessions-group.js +23 -23
- package/dist/app/lib/site-tool-consent-dialog.js +24 -24
- package/dist/app/lib/site-tool-consent.js +1 -1
- package/dist/app/lib/turn-failure-analytics.js +6 -6
- package/dist/app/lib/use-artifact-catalog.js +2 -2
- package/dist/app/lib/use-duplicate-site.js +4 -4
- package/dist/app/lib/use-follow-up-repositories.js +9 -9
- package/dist/app/lib/use-personal-resource-attachment.js +2 -2
- package/dist/app/lib/use-workspace-integrations.js +2 -2
- package/dist/app/lib/use-workspace-machines.js +10 -10
- package/dist/app/lib/use-workspace-model-catalog.js +6 -6
- package/dist/app/lib/use-workspace-rigs.js +6 -6
- package/dist/app/lib/workspace-navigation-preference.js +5 -5
- package/dist/app/lib/workspace-scope-context.js +4 -4
- package/dist/app/routes/app-page-view.js +52 -50
- package/dist/app/routes/app-page-view.js.map +1 -1
- package/dist/app/routes/app-page.js +2 -2
- package/dist/app/routes/artifacts.js +170 -168
- package/dist/app/routes/artifacts.js.map +1 -1
- package/dist/app/routes/retained-artifact.js +110 -109
- package/dist/app/routes/retained-artifact.js.map +1 -1
- package/dist/app/routes/session-unavailable.js +6 -6
- package/dist/app/routes/session.js +249 -248
- package/dist/app/routes/sessions-index-hydration.js +6 -6
- package/dist/app/routes/sessions-index.js +204 -203
- package/dist/app/routes/site-view.js +210 -209
- package/dist/app/routes/site-view.js.map +1 -1
- package/dist/artifacts-document.js +4 -4
- package/dist/artifacts-presentation.js +9 -9
- package/dist/artifacts-spreadsheet.js +4 -4
- package/dist/artifacts.js +53 -51
- package/dist/automation-model.js +6 -6
- package/dist/automations.js +64 -64
- package/dist/browser-viewer-TRPZI6NT.js +23 -0
- package/dist/chat-interactive-block-Y4BS4JCM.js +24 -0
- package/dist/chunk-22E2YJHT.js +469 -0
- package/dist/chunk-2T6TN2YL.js +538 -0
- package/dist/chunk-2WNN26NW.js +175 -0
- package/dist/chunk-3432A6XB.js +88 -0
- package/dist/chunk-35U7NSOR.js +366 -0
- package/dist/chunk-3EPR76WS.js +773 -0
- package/dist/chunk-3FXXEU5D.js +144 -0
- package/dist/chunk-3MXOPOEU.js +650 -0
- package/dist/chunk-3PKDU4JI.js +340 -0
- package/dist/chunk-3PMO2BIV.js +12 -0
- package/dist/chunk-3XWHJNFY.js +48 -0
- package/dist/chunk-45WD2PKE.js +401 -0
- package/dist/chunk-4H2OWNRA.js +598 -0
- package/dist/chunk-4HVGOTMU.js +263 -0
- package/dist/chunk-4JER2ZMV.js +818 -0
- package/dist/chunk-4LVZ2VOQ.js +214 -0
- package/dist/chunk-4OGDD2EM.js +2434 -0
- package/dist/chunk-4PQC6WMF.js +54 -0
- package/dist/chunk-4UVSWAT3.js +794 -0
- package/dist/chunk-53A47RBX.js +214 -0
- package/dist/chunk-552KKENW.js +114 -0
- package/dist/chunk-55F7L6M3.js +177 -0
- package/dist/chunk-5AHIKB3O.js +449 -0
- package/dist/chunk-5KQD6MLJ.js +3996 -0
- package/dist/chunk-5KQD6MLJ.js.map +1 -0
- package/dist/chunk-5N4L5WTE.js +199 -0
- package/dist/chunk-5OUJCVZI.js +79 -0
- package/dist/chunk-5OYXQ7MH.js +65 -0
- package/dist/chunk-5RGF74K5.js +371 -0
- package/dist/chunk-5RGF74K5.js.map +1 -0
- package/dist/chunk-5TAVVMFX.js +225 -0
- package/dist/chunk-5Y3LYRNH.js +269 -0
- package/dist/chunk-5ZJKKE4T.js +386 -0
- package/dist/chunk-62DPSQRZ.js +57 -0
- package/dist/chunk-64KMWTJ6.js +608 -0
- package/dist/chunk-6F34IWSA.js +47 -0
- package/dist/chunk-6F34IWSA.js.map +1 -0
- package/dist/chunk-6MZBNUS7.js +73 -0
- package/dist/chunk-6YCE4ZC4.js +250 -0
- package/dist/chunk-6YROWWMX.js +175 -0
- package/dist/chunk-73RZ72VU.js +1236 -0
- package/dist/chunk-74KV436L.js +84 -0
- package/dist/chunk-7HKGLPV5.js +83 -0
- package/dist/chunk-7JSWODT6.js +466 -0
- package/dist/chunk-7K3PKWER.js +428 -0
- package/dist/chunk-7MPWC42V.js +1356 -0
- package/dist/chunk-7REO6FRN.js +141 -0
- package/dist/chunk-7V3OL7JC.js +850 -0
- package/dist/chunk-7V3OL7JC.js.map +1 -0
- package/dist/chunk-7YMWRNRQ.js +145 -0
- package/dist/chunk-A6H3KJ7G.js +131 -0
- package/dist/chunk-AGQIE6YU.js +1769 -0
- package/dist/chunk-AHQM4I5V.js +373 -0
- package/dist/chunk-AMTRO7XF.js +172 -0
- package/dist/chunk-AO4LTCG7.js +91 -0
- package/dist/chunk-APJ22OZV.js +2580 -0
- package/dist/chunk-APWL37KW.js +407 -0
- package/dist/chunk-AQEJOBQ2.js +15 -0
- package/dist/chunk-ARKNT6BX.js +234 -0
- package/dist/chunk-B2IHDMAR.js +211 -0
- package/dist/chunk-BCKIV26W.js +112 -0
- package/dist/chunk-BE26JUSD.js +259 -0
- package/dist/chunk-BOVCD6KD.js +171 -0
- package/dist/chunk-BQWV66A6.js +129 -0
- package/dist/chunk-BSQJXGGP.js +441 -0
- package/dist/chunk-BZY3MEVZ.js +3183 -0
- package/dist/chunk-C3D3OOEY.js +335 -0
- package/dist/chunk-CDHYO3DP.js +82 -0
- package/dist/chunk-CDV5JGVI.js +79 -0
- package/dist/chunk-CNW45M7G.js +207 -0
- package/dist/chunk-CUVQ37HB.js +150 -0
- package/dist/chunk-D32T3IIC.js +532 -0
- package/dist/chunk-D32VVOBJ.js +738 -0
- package/dist/chunk-D32VVOBJ.js.map +1 -0
- package/dist/chunk-D65BSM64.js +371 -0
- package/dist/chunk-D7435DWV.js +570 -0
- package/dist/chunk-DFH3M7B3.js +72 -0
- package/dist/chunk-DGWBQ76M.js +162 -0
- package/dist/chunk-DHJDTGSJ.js +372 -0
- package/dist/chunk-DKEFTNCD.js +400 -0
- package/dist/chunk-DNAF6MT4.js +107 -0
- package/dist/chunk-DSJ7K5IF.js +380 -0
- package/dist/chunk-DSJ7K5IF.js.map +1 -0
- package/dist/chunk-E35XY7DS.js +27 -0
- package/dist/chunk-E5T5WIIP.js +396 -0
- package/dist/chunk-EL6ECD34.js +166 -0
- package/dist/chunk-ELR6ITRC.js +467 -0
- package/dist/chunk-EPE3V2VE.js +851 -0
- package/dist/chunk-EYGQHHVW.js +584 -0
- package/dist/chunk-EYQEJHYP.js +307 -0
- package/dist/chunk-EZTH2XMH.js +276 -0
- package/dist/chunk-F3QVHVFS.js +287 -0
- package/dist/chunk-F5VWPREQ.js +1187 -0
- package/dist/chunk-FM7AQUBL.js +113 -0
- package/dist/chunk-FP6BUXJM.js +100 -0
- package/dist/chunk-FVU52L3I.js +249 -0
- package/dist/chunk-FZKNXNNO.js +218 -0
- package/dist/chunk-G3IXJWRY.js +236 -0
- package/dist/chunk-G6EI2O3N.js +333 -0
- package/dist/chunk-G7KHMA3E.js +256 -0
- package/dist/chunk-G7KHMA3E.js.map +1 -0
- package/dist/chunk-GB5T6YMZ.js +401 -0
- package/dist/chunk-GBLD6FOG.js +157 -0
- package/dist/chunk-GJBFFXCY.js +137 -0
- package/dist/chunk-GJDP2K2S.js +66 -0
- package/dist/chunk-GP26XTDX.js +187 -0
- package/dist/chunk-GTE6WP4N.js +606 -0
- package/dist/chunk-GWG3OAV7.js +108 -0
- package/dist/chunk-GXMHTMM6.js +931 -0
- package/dist/chunk-GYRN5O2E.js +107 -0
- package/dist/chunk-GZX7W2WW.js +65 -0
- package/dist/chunk-H3QI2G2B.js +403 -0
- package/dist/chunk-H7D4DVWY.js +849 -0
- package/dist/chunk-HCDGBBBJ.js +191 -0
- package/dist/chunk-HDSH6MIJ.js +3851 -0
- package/dist/chunk-HOEUPZ6O.js +89 -0
- package/dist/chunk-HPQRWTQB.js +772 -0
- package/dist/chunk-HUKGLWAY.js +174 -0
- package/dist/chunk-HUTQJY3F.js +23 -0
- package/dist/chunk-HWOYJOKK.js +266 -0
- package/dist/chunk-HZR3WGUP.js +96 -0
- package/dist/chunk-I7YUDPDR.js +138 -0
- package/dist/chunk-IDII52M4.js +27 -0
- package/dist/chunk-IDPWEUM7.js +103 -0
- package/dist/chunk-IEWQFGEC.js +192 -0
- package/dist/chunk-IKWGPFT5.js +300 -0
- package/dist/chunk-IKWGPFT5.js.map +1 -0
- package/dist/chunk-IMTACEXF.js +351 -0
- package/dist/chunk-IVWT6M6N.js +114 -0
- package/dist/chunk-JE2YXAVR.js +485 -0
- package/dist/chunk-JE2YXAVR.js.map +1 -0
- package/dist/chunk-JEUPIHIP.js +111 -0
- package/dist/chunk-JF4WX3GQ.js +168 -0
- package/dist/chunk-JJPYXUKC.js +2591 -0
- package/dist/chunk-JNHWTYDD.js +43 -0
- package/dist/chunk-JP7AOJWD.js +46 -0
- package/dist/chunk-JTWT2WQA.js +297 -0
- package/dist/chunk-JW3WIHWO.js +117 -0
- package/dist/chunk-JW7RJMEZ.js +134 -0
- package/dist/chunk-K76PXR3O.js +2317 -0
- package/dist/chunk-KCNIQN6V.js +107 -0
- package/dist/chunk-KH6KHYST.js +231 -0
- package/dist/chunk-KK4SEN7N.js +247 -0
- package/dist/chunk-KOKRGAAI.js +383 -0
- package/dist/chunk-KQFNTGAF.js +187 -0
- package/dist/chunk-KRLNC6TH.js +50 -0
- package/dist/chunk-KYDLVMKA.js +99 -0
- package/dist/chunk-KZQDP2JM.js +155 -0
- package/dist/chunk-L2EZ2HOX.js +132 -0
- package/dist/chunk-L2UAFR2D.js +33 -0
- package/dist/chunk-L4R7ORMD.js +4596 -0
- package/dist/chunk-LCLWN64E.js +227 -0
- package/dist/chunk-LFQI2C46.js +175 -0
- package/dist/chunk-LLYX4F5A.js +1628 -0
- package/dist/chunk-LQX5QCDS.js +215 -0
- package/dist/chunk-LRMHASG2.js +196 -0
- package/dist/chunk-LVUSG56I.js +5930 -0
- package/dist/chunk-LVUSG56I.js.map +1 -0
- package/dist/chunk-M5FX5KH5.js +629 -0
- package/dist/chunk-MLOTUQJJ.js +201 -0
- package/dist/chunk-MPUKGKXZ.js +209 -0
- package/dist/chunk-MS6LW4VU.js +283 -0
- package/dist/chunk-MWN7LDYV.js +4601 -0
- package/dist/chunk-MWN7LDYV.js.map +1 -0
- package/dist/chunk-MXPW4F74.js +278 -0
- package/dist/chunk-MZ7GJX5S.js +158 -0
- package/dist/chunk-N5OUIUYD.js +1260 -0
- package/dist/chunk-N6FNORC7.js +412 -0
- package/dist/chunk-NALVKY4U.js +113 -0
- package/dist/chunk-NJ77ZL5T.js +5222 -0
- package/dist/chunk-NM2DNJDJ.js +270 -0
- package/dist/chunk-NNKRRF7E.js +110 -0
- package/dist/chunk-NP5UFWU4.js +318 -0
- package/dist/chunk-NV3AEIFO.js +118 -0
- package/dist/chunk-O6JDF7KH.js +828 -0
- package/dist/chunk-OERZH3J4.js +251 -0
- package/dist/chunk-OKHWTWWU.js +1152 -0
- package/dist/chunk-OLAIUVGT.js +274 -0
- package/dist/chunk-OO36IUMS.js +270 -0
- package/dist/chunk-OVDK7K2Z.js +57 -0
- package/dist/chunk-OX5ZCHZQ.js +63 -0
- package/dist/chunk-P6LLCGPO.js +515 -0
- package/dist/chunk-PA2CUHTD.js +505 -0
- package/dist/chunk-PB4CQIRA.js +4979 -0
- package/dist/chunk-PBV2P632.js +566 -0
- package/dist/chunk-PCSRHFRF.js +75 -0
- package/dist/chunk-PEPWW5BC.js +436 -0
- package/dist/chunk-PMBZMVKE.js +33 -0
- package/dist/chunk-PP32RE26.js +34 -0
- package/dist/chunk-PTXAPI3Q.js +73 -0
- package/dist/chunk-PULNNF7G.js +56 -0
- package/dist/chunk-Q6KNROUT.js +158 -0
- package/dist/chunk-QEGP3HSW.js +184 -0
- package/dist/chunk-QEGP3HSW.js.map +1 -0
- package/dist/chunk-QGJIFIKN.js +1032 -0
- package/dist/chunk-QKKKORGL.js +41 -0
- package/dist/chunk-QKUMMG6P.js +85 -0
- package/dist/chunk-QNOWKKZ4.js +40 -0
- package/dist/chunk-QSWD3AHE.js +84 -0
- package/dist/chunk-QZ4U2VL5.js +391 -0
- package/dist/chunk-QZJNCLHV.js +271 -0
- package/dist/chunk-R6CFPY3F.js +278 -0
- package/dist/chunk-R6QRUYUH.js +406 -0
- package/dist/chunk-RE3GAQI5.js +2984 -0
- package/dist/chunk-RFHUVPFA.js +1184 -0
- package/dist/chunk-RH45HT5T.js +3690 -0
- package/dist/chunk-RJNQTZ5O.js +439 -0
- package/dist/chunk-RN24AP7Q.js +247 -0
- package/dist/chunk-RN24AP7Q.js.map +1 -0
- package/dist/chunk-S2BJTAAB.js +37 -0
- package/dist/chunk-S56PWXIX.js +138 -0
- package/dist/chunk-S6BDABIC.js +1390 -0
- package/dist/chunk-S6BDABIC.js.map +1 -0
- package/dist/chunk-S6FFDIHD.js +640 -0
- package/dist/chunk-S6MAMIK2.js +56 -0
- package/dist/chunk-SERTO6H6.js +311 -0
- package/dist/chunk-STOOH7EI.js +200 -0
- package/dist/chunk-SWSTEUXX.js +121 -0
- package/dist/chunk-SWZN7NNZ.js +1029 -0
- package/dist/chunk-SYDF57KS.js +178 -0
- package/dist/chunk-T275CUVD.js +29 -0
- package/dist/chunk-T4OT7QWP.js +378 -0
- package/dist/chunk-TCSRY2NP.js +2582 -0
- package/dist/chunk-TCX5OA2X.js +1177 -0
- package/dist/chunk-TDW5CSO5.js +3158 -0
- package/dist/chunk-TGG3ODCS.js +99 -0
- package/dist/chunk-TILSTYUC.js +505 -0
- package/dist/chunk-TJ5DYWXU.js +1333 -0
- package/dist/chunk-TNRI4ZE6.js +391 -0
- package/dist/chunk-TPIFVUMF.js +188 -0
- package/dist/chunk-TSW6OF22.js +162 -0
- package/dist/chunk-TTSTBHGR.js +1095 -0
- package/dist/chunk-U3JYAWMR.js +170 -0
- package/dist/chunk-U7ODSHA5.js +124 -0
- package/dist/chunk-UEGEPRNP.js +48 -0
- package/dist/chunk-UGIA2YEJ.js +83 -0
- package/dist/chunk-UHLKKDNF.js +432 -0
- package/dist/chunk-ULVXKIPX.js +26 -0
- package/dist/chunk-UN37ZY6R.js +10074 -0
- package/dist/chunk-UN37ZY6R.js.map +1 -0
- package/dist/chunk-USUDKZ5G.js +98 -0
- package/dist/chunk-UVO6I2F6.js +85 -0
- package/dist/chunk-V6NVG4K2.js +357 -0
- package/dist/chunk-VCMQFD3G.js +1185 -0
- package/dist/chunk-VKPBDNIO.js +246 -0
- package/dist/chunk-VLDKWGHD.js +61 -0
- package/dist/chunk-VM2NA2EL.js +905 -0
- package/dist/chunk-VMZTCVEL.js +114 -0
- package/dist/chunk-VQH5AXZY.js +269 -0
- package/dist/chunk-VTBTW6N4.js +114 -0
- package/dist/chunk-VV7PLDX4.js +230 -0
- package/dist/chunk-VYGGLH5H.js +50 -0
- package/dist/chunk-VYQHHTQ4.js +133 -0
- package/dist/chunk-VYSGRD2W.js +292 -0
- package/dist/chunk-W4W63LTP.js +1309 -0
- package/dist/chunk-WFC2JA6D.js +2335 -0
- package/dist/chunk-WFC2JA6D.js.map +1 -0
- package/dist/chunk-WHTRR66J.js +197 -0
- package/dist/chunk-WICIQFHJ.js +42 -0
- package/dist/chunk-WJYYMCCC.js +283 -0
- package/dist/chunk-WSJOWQJE.js +399 -0
- package/dist/chunk-WY333GHH.js +108 -0
- package/dist/chunk-WY333GHH.js.map +1 -0
- package/dist/chunk-WYDUXZ2R.js +353 -0
- package/dist/chunk-X62CN4YR.js +3321 -0
- package/dist/chunk-XFQHKMO6.js +1024 -0
- package/dist/chunk-XGJ7XZHS.js +527 -0
- package/dist/chunk-XJFJNOEV.js +723 -0
- package/dist/chunk-XKJLHMXZ.js +234 -0
- package/dist/chunk-XLFPJVQS.js +103 -0
- package/dist/chunk-XM4ZLZFW.js +129 -0
- package/dist/chunk-Y2GAWEJD.js +1021 -0
- package/dist/chunk-Y3A74SVK.js +296 -0
- package/dist/chunk-YANEVGI3.js +92 -0
- package/dist/chunk-YHHSO5QR.js +128 -0
- package/dist/chunk-YOSOCHCB.js +52 -0
- package/dist/chunk-YP4SNX4P.js +220 -0
- package/dist/chunk-YQH6AMIH.js +176 -0
- package/dist/chunk-YRWL2IAE.js +165 -0
- package/dist/chunk-YTWRQ3WK.js +251 -0
- package/dist/chunk-YV5GGSLK.js +20 -0
- package/dist/chunk-YXUDK37V.js +126 -0
- package/dist/chunk-YYM5TSCR.js +75 -0
- package/dist/chunk-ZG2CKFQF.js +202 -0
- package/dist/chunk-ZGJXO2HH.js +93 -0
- package/dist/chunk-ZGV76PZ4.js +3070 -0
- package/dist/chunk-ZOBUR2VC.js +229 -0
- package/dist/components/artifacts/artifact-chrome.d.ts +4 -0
- package/dist/components/artifacts/artifact-sandbox.d.ts +13 -0
- package/dist/components/artifacts/inline-html-document.d.ts +10 -1
- package/dist/components/artifacts/published-html-artifact-frame.d.ts +17 -0
- package/dist/components/preview-loading.d.ts +3 -1
- package/dist/composer.js +37 -37
- package/dist/computer-viewer-S6AL3XDT.js +21 -0
- package/dist/connect.js +38 -37
- package/dist/connection-step-up-XGPZKQEL.js +149 -0
- package/dist/connection-step-up-XGPZKQEL.js.map +1 -0
- package/dist/desktop-dictation.js +23 -23
- package/dist/desktop.js +2 -2
- package/dist/editor.js +2 -2
- package/dist/embedded-new-voice-T3BXRYJX.js +25 -0
- package/dist/embedded-voice-ZJXMF3RP.js +25 -0
- package/dist/fleet-decision-row-AUCMLBCV.js +361 -0
- package/dist/in-chat-connect-model.js +5 -5
- package/dist/index.js +296 -295
- package/dist/interaction.js +9 -9
- package/dist/latest-question-D5BKKEP6.js +1 -1
- package/dist/machine-request-model.js +1 -1
- package/dist/machines.js +8 -8
- package/dist/meetings/meeting-detail-page.d.ts +14 -0
- package/dist/meetings/meeting-notes.d.ts +6 -2
- package/dist/meetings/meeting-transcript.d.ts +3 -1
- package/dist/meetings-recorder.js +1 -1
- package/dist/meetings.js +367 -260
- package/dist/meetings.js.map +1 -1
- package/dist/messages/en.d.ts +6 -2
- package/dist/messages.js +1 -1
- package/dist/model-policy-picker-menu-TO57YUQ6.js +23 -0
- package/dist/native-previews.js +1 -1
- package/dist/payment-page-card-DFGDAMTG.js +227 -0
- package/dist/platform-activity-row-ZMBEJGXN.js +156 -0
- package/dist/queue-surface-implementation-KDK5CYH6.js +933 -0
- package/dist/realtime.js +17 -17
- package/dist/recorder-host-3HLYRL4H.js +80 -0
- package/dist/recordings.js +3 -3
- package/dist/sandbox-files-UOZ4OJZU.js +29 -0
- package/dist/session-app.js +406 -405
- package/dist/session-connect-cards-VZIYLH45.js +28 -0
- package/dist/session-list-model.js +2 -2
- package/dist/session-realtime-2ZGJWVZP.js +30 -0
- package/dist/session-realtime.js +2 -2
- package/dist/session-ui.js +98 -97
- package/dist/session.js +40 -40
- package/dist/sites.js +3 -3
- package/dist/skills.js +32 -32
- package/dist/terminal.js +2 -2
- package/dist/testing/meetings-fixture.d.ts +8 -0
- package/dist/testing/meetings-fixture.js +22 -1
- package/dist/testing/meetings-fixture.js.map +1 -1
- package/dist/this-computer.js +3 -3
- package/dist/timeline-annotation-markers-KBTFWLME.js +157 -0
- package/dist/timeline-annotation-selection-VI4YSDR5.js +208 -0
- package/dist/timeline-annotations-dialog-4PLWNLRB.js +283 -0
- package/dist/timeline-model.js +37 -37
- package/dist/ui/access-list.js +24 -24
- package/dist/ui/cadence-picker.js +7 -7
- package/dist/ui/capability-page.js +10 -10
- package/dist/ui/choice-cards.js +3 -3
- package/dist/ui/confirm-dialog.js +4 -4
- package/dist/ui/copy-field.js +3 -3
- package/dist/ui/detail-page.js +6 -6
- package/dist/ui/detail-sheet.js +6 -6
- package/dist/ui/dialog.js +2 -2
- package/dist/ui/diff-view.js +3 -3
- package/dist/ui/disclosure.js +7 -7
- package/dist/ui/email-chips-input.js +3 -3
- package/dist/ui/field.js +2 -2
- package/dist/ui/flush-form-page.js +8 -8
- package/dist/ui/form-dialog.js +7 -7
- package/dist/ui/list-row.js +7 -7
- package/dist/ui/load-failure.js +3 -3
- package/dist/ui/relative-time.js +3 -3
- package/dist/ui/revision-history.js +16 -16
- package/dist/ui/role-select.js +13 -13
- package/dist/ui/select-menu.js +5 -5
- package/dist/ui/settings-nav.js +6 -6
- package/dist/ui/sheet.js +2 -2
- package/dist/ui/usage-meter.js +4 -4
- package/dist/usage.js +3 -3
- package/dist/workbench.js +11 -11
- package/package.json +6 -5
- package/src/app/components/session/sandbox-recovery-actions.test.tsx +26 -0
- package/src/app/components/session/sandbox-recovery-actions.tsx +2 -1
- package/src/app/components/workspace-reach.tsx +2 -0
- package/src/components/artifacts/artifact-chrome.tsx +6 -0
- package/src/components/artifacts/artifact-sandbox.tsx +119 -20
- package/src/components/artifacts/chat-interactive-block.tsx +1 -0
- package/src/components/artifacts/inline-html-document.ts +13 -3
- package/src/components/artifacts/published-html-artifact-frame.tsx +60 -4
- package/src/components/preview-loading.tsx +2 -2
- package/src/meetings/meeting-detail-page.tsx +232 -112
- package/src/meetings/meeting-notes.tsx +48 -24
- package/src/meetings/meeting-transcript.tsx +75 -57
- package/src/meetings/meetings-pages.test.tsx +181 -2
- package/src/messages/en.ts +6 -2
- package/src/testing/meetings-fixture.ts +35 -1
- package/styles/compiled.css +8 -0
- package/styles/index.css +7 -0
- package/dist/browser-viewer-KFMM5S2B.js +0 -23
- package/dist/chat-interactive-block-5DJ72HU7.js +0 -22
- package/dist/chunk-2B3RQRNQ.js +0 -584
- package/dist/chunk-2DA7DTHO.js +0 -83
- package/dist/chunk-2GXAXCS2.js +0 -401
- package/dist/chunk-2JTZMHQK.js +0 -57
- package/dist/chunk-2LRJ32SO.js +0 -114
- package/dist/chunk-2VK7FJNR.js +0 -307
- package/dist/chunk-2YJS75C3.js +0 -269
- package/dist/chunk-2YNEUYWM.js +0 -231
- package/dist/chunk-2ZR75AUO.js +0 -225
- package/dist/chunk-32LD46VC.js +0 -72
- package/dist/chunk-3FVVZW7J.js +0 -84
- package/dist/chunk-4327UGUS.js +0 -79
- package/dist/chunk-45TILHFZ.js +0 -249
- package/dist/chunk-4AUSS7CX.js +0 -318
- package/dist/chunk-4ECOHGUL.js +0 -818
- package/dist/chunk-4FKE42TW.js +0 -1333
- package/dist/chunk-4K5UVYZQ.js +0 -113
- package/dist/chunk-4UZE7ZT4.js +0 -54
- package/dist/chunk-4XQH4XPP.js +0 -400
- package/dist/chunk-4Z7BPBS7.js +0 -34
- package/dist/chunk-56KVDNOS.js +0 -98
- package/dist/chunk-56NHT2TZ.js +0 -56
- package/dist/chunk-57QWSJLX.js +0 -114
- package/dist/chunk-5AGRFQSH.js +0 -432
- package/dist/chunk-5JMX5FRF.js +0 -1309
- package/dist/chunk-5UTHPGFF.js +0 -93
- package/dist/chunk-5VPQVMJI.js +0 -84
- package/dist/chunk-5WJCOFIU.js +0 -207
- package/dist/chunk-62T2ZPD5.js +0 -266
- package/dist/chunk-63AVTSUI.js +0 -383
- package/dist/chunk-6CDBX3XG.js +0 -33
- package/dist/chunk-6D3D2JWY.js +0 -278
- package/dist/chunk-6GUG7FXP.js +0 -380
- package/dist/chunk-6GUG7FXP.js.map +0 -1
- package/dist/chunk-6JGMBTXP.js +0 -114
- package/dist/chunk-6LYBRPUG.js +0 -931
- package/dist/chunk-6PHBW7SS.js +0 -287
- package/dist/chunk-6S2XVKNI.js +0 -91
- package/dist/chunk-6TWS6AXT.js +0 -1021
- package/dist/chunk-6VEIDSF4.js +0 -73
- package/dist/chunk-76NGRVCY.js +0 -340
- package/dist/chunk-7FFZLLCH.js +0 -391
- package/dist/chunk-7RRDXPNC.js +0 -111
- package/dist/chunk-7TLYFHMT.js +0 -851
- package/dist/chunk-7V2CQLTN.js +0 -20
- package/dist/chunk-7VDWXFTL.js +0 -772
- package/dist/chunk-A2OMNLDF.js +0 -150
- package/dist/chunk-A3QEJ2IZ.js +0 -229
- package/dist/chunk-A6Q6EUBR.js +0 -209
- package/dist/chunk-AJSRYRJS.js +0 -138
- package/dist/chunk-APNPWJCK.js +0 -66
- package/dist/chunk-ARNQH2XE.js +0 -178
- package/dist/chunk-B6AH43UQ.js +0 -2434
- package/dist/chunk-BIXGAYDJ.js +0 -276
- package/dist/chunk-BJ3WRO2K.js +0 -441
- package/dist/chunk-BO3D22BS.js +0 -12
- package/dist/chunk-BR62BHVY.js +0 -357
- package/dist/chunk-BTMSR4OA.js +0 -214
- package/dist/chunk-BVZYHORS.js +0 -40
- package/dist/chunk-BWBBS6HJ.js +0 -42
- package/dist/chunk-C22UPHA2.js +0 -274
- package/dist/chunk-C2EERTYX.js +0 -353
- package/dist/chunk-C2F6SKOS.js +0 -270
- package/dist/chunk-C625ODRG.js +0 -92
- package/dist/chunk-CAF3HFJH.js +0 -184
- package/dist/chunk-CAF3HFJH.js.map +0 -1
- package/dist/chunk-CC4JBFWY.js +0 -85
- package/dist/chunk-CDB66JAO.js +0 -283
- package/dist/chunk-CG2HT7TI.js +0 -269
- package/dist/chunk-CNNOPEAK.js +0 -570
- package/dist/chunk-CRBHMSAP.js +0 -469
- package/dist/chunk-CSK2WOOX.js +0 -83
- package/dist/chunk-CTBPPPLR.js +0 -2580
- package/dist/chunk-CTOLX2EW.js +0 -2317
- package/dist/chunk-CVDY7P3E.js +0 -246
- package/dist/chunk-CX3Z7W5Y.js +0 -107
- package/dist/chunk-D5K2BS5Q.js +0 -259
- package/dist/chunk-DA7XLT5F.js +0 -366
- package/dist/chunk-DAKKJ3XM.js +0 -298
- package/dist/chunk-DAKKJ3XM.js.map +0 -1
- package/dist/chunk-DC6KFW2R.js +0 -333
- package/dist/chunk-DIHPR5KJ.js +0 -15
- package/dist/chunk-DLMYANZX.js +0 -3851
- package/dist/chunk-DRAG2LZP.js +0 -171
- package/dist/chunk-E2SGFW2B.js +0 -3321
- package/dist/chunk-EAXZSBWV.js +0 -412
- package/dist/chunk-EFKWOXBP.js +0 -428
- package/dist/chunk-EGD5RPRX.js +0 -401
- package/dist/chunk-ELC2ZPHI.js +0 -1177
- package/dist/chunk-EZ5ZBOGQ.js +0 -1032
- package/dist/chunk-F2JKNL73.js +0 -187
- package/dist/chunk-F3LIUDXN.js +0 -738
- package/dist/chunk-F3LIUDXN.js.map +0 -1
- package/dist/chunk-FAB5SXNO.js +0 -640
- package/dist/chunk-FQ33JHJN.js +0 -63
- package/dist/chunk-FX343J2L.js +0 -132
- package/dist/chunk-FXFOKD7A.js +0 -449
- package/dist/chunk-FY42DW2R.js +0 -515
- package/dist/chunk-G4E5WKY7.js +0 -65
- package/dist/chunk-GFTV3RR6.js +0 -187
- package/dist/chunk-GGBMQNAB.js +0 -33
- package/dist/chunk-GGU7KV4G.js +0 -124
- package/dist/chunk-GIHE7U3Y.js +0 -174
- package/dist/chunk-GRGK3JJI.js +0 -10074
- package/dist/chunk-GRGK3JJI.js.map +0 -1
- package/dist/chunk-GT3FJVU6.js +0 -4596
- package/dist/chunk-GTGPKGWC.js +0 -65
- package/dist/chunk-GY6DSWBM.js +0 -82
- package/dist/chunk-H3EP6GNA.js +0 -538
- package/dist/chunk-HD2MCYQF.js +0 -234
- package/dist/chunk-HE4VN5D3.js +0 -4979
- package/dist/chunk-HFROJDFQ.js +0 -118
- package/dist/chunk-HHFFPE67.js +0 -220
- package/dist/chunk-HJ2CDFZX.js +0 -117
- package/dist/chunk-HJ2J2XQI.js +0 -88
- package/dist/chunk-HLLZPULI.js +0 -172
- package/dist/chunk-HPYQ5MES.js +0 -103
- package/dist/chunk-HRLJNDDC.js +0 -197
- package/dist/chunk-HVGM5IME.js +0 -170
- package/dist/chunk-HZE6V7GW.js +0 -214
- package/dist/chunk-I5DW76GB.js +0 -200
- package/dist/chunk-I7MZOZGC.js +0 -121
- package/dist/chunk-IB2EX6GX.js +0 -292
- package/dist/chunk-IEDDIJ6B.js +0 -4601
- package/dist/chunk-IEDDIJ6B.js.map +0 -1
- package/dist/chunk-IGFZFLI2.js +0 -1390
- package/dist/chunk-IGFZFLI2.js.map +0 -1
- package/dist/chunk-IIMRBCA4.js +0 -271
- package/dist/chunk-IIWNSYFA.js +0 -129
- package/dist/chunk-IN2ZJR2A.js +0 -96
- package/dist/chunk-IUPIJWFK.js +0 -905
- package/dist/chunk-IZA2KBYK.js +0 -57
- package/dist/chunk-IZZINUFM.js +0 -527
- package/dist/chunk-JFEAJRG6.js +0 -1029
- package/dist/chunk-JG7MEMJP.js +0 -1184
- package/dist/chunk-JIZWFW5A.js +0 -107
- package/dist/chunk-JJKUERR4.js +0 -131
- package/dist/chunk-JL4PMUDG.js +0 -192
- package/dist/chunk-JTWK3VE7.js +0 -202
- package/dist/chunk-JV2TJLUW.js +0 -144
- package/dist/chunk-KBDWMUYA.js +0 -175
- package/dist/chunk-KF65UG2L.js +0 -1628
- package/dist/chunk-KFYLTQGK.js +0 -133
- package/dist/chunk-KJI2DVSO.js +0 -26
- package/dist/chunk-KLYBSXHE.js +0 -3183
- package/dist/chunk-KPD6TBO4.js +0 -89
- package/dist/chunk-KTGKGHEA.js +0 -75
- package/dist/chunk-KUYQTNVT.js +0 -794
- package/dist/chunk-KZE7M52Y.js +0 -598
- package/dist/chunk-KZYZ3JHS.js +0 -112
- package/dist/chunk-L6WVCO6D.js +0 -61
- package/dist/chunk-L7T7M2P3.js +0 -5222
- package/dist/chunk-LKF6IPFC.js +0 -247
- package/dist/chunk-LLU7VKCZ.js +0 -188
- package/dist/chunk-LWEJGMVO.js +0 -50
- package/dist/chunk-LX5IEXDF.js +0 -505
- package/dist/chunk-LYEALWBN.js +0 -251
- package/dist/chunk-M722GGD3.js +0 -566
- package/dist/chunk-MCPKUVMQ.js +0 -99
- package/dist/chunk-MDGNCUAC.js +0 -145
- package/dist/chunk-MFLU3466.js +0 -99
- package/dist/chunk-MITT6IZG.js +0 -134
- package/dist/chunk-MN4LJYKQ.js +0 -608
- package/dist/chunk-MNCBL5AX.js +0 -449
- package/dist/chunk-MNCBL5AX.js.map +0 -1
- package/dist/chunk-MO3XJQN2.js +0 -629
- package/dist/chunk-MPP6BEAN.js +0 -158
- package/dist/chunk-MQRUZ2LW.js +0 -335
- package/dist/chunk-MRJFF5KY.js +0 -351
- package/dist/chunk-MUB44LD3.js +0 -75
- package/dist/chunk-MYDFABO6.js +0 -296
- package/dist/chunk-NJVHMK5R.js +0 -3158
- package/dist/chunk-NO6VQNWH.js +0 -396
- package/dist/chunk-NUF43R2F.js +0 -278
- package/dist/chunk-NUM3QV66.js +0 -107
- package/dist/chunk-NW4RPGET.js +0 -48
- package/dist/chunk-NZBZLY7H.js +0 -165
- package/dist/chunk-O664PL2U.js +0 -47
- package/dist/chunk-O664PL2U.js.map +0 -1
- package/dist/chunk-OCS3KIYC.js +0 -378
- package/dist/chunk-OKI45WHM.js +0 -311
- package/dist/chunk-ONF5M5GP.js +0 -283
- package/dist/chunk-OPCPBLHA.js +0 -79
- package/dist/chunk-OROXCA6L.js +0 -251
- package/dist/chunk-OTMJS3FV.js +0 -56
- package/dist/chunk-OXM267RC.js +0 -128
- package/dist/chunk-P5FLGDXW.js +0 -723
- package/dist/chunk-PC3FWPOP.js +0 -828
- package/dist/chunk-PPQJIVGM.js +0 -175
- package/dist/chunk-PQOVMZI2.js +0 -372
- package/dist/chunk-PVGD2RAV.js +0 -5926
- package/dist/chunk-PVGD2RAV.js.map +0 -1
- package/dist/chunk-PYU7CLEG.js +0 -215
- package/dist/chunk-Q2N5UR7Q.js +0 -505
- package/dist/chunk-Q4GB2QU3.js +0 -199
- package/dist/chunk-Q4RJKXQM.js +0 -606
- package/dist/chunk-Q4ZNRQKH.js +0 -196
- package/dist/chunk-Q7QXSQ46.js +0 -1185
- package/dist/chunk-QAVSUXLA.js +0 -773
- package/dist/chunk-QBJDMSFA.js +0 -27
- package/dist/chunk-QCB3WNCA.js +0 -176
- package/dist/chunk-QIOIJ7K5.js +0 -162
- package/dist/chunk-QR72J6WR.js +0 -650
- package/dist/chunk-QUTMVW4P.js +0 -141
- package/dist/chunk-QUXQYYZO.js +0 -73
- package/dist/chunk-RDHK2NYW.js +0 -129
- package/dist/chunk-RFBYAUZH.js +0 -311
- package/dist/chunk-RFBYAUZH.js.map +0 -1
- package/dist/chunk-RGCCRYTY.js +0 -46
- package/dist/chunk-RSTS3RWN.js +0 -211
- package/dist/chunk-RY7YRYVT.js +0 -126
- package/dist/chunk-S4LRL5BA.js +0 -439
- package/dist/chunk-S62CVC5C.js +0 -850
- package/dist/chunk-S62CVC5C.js.map +0 -1
- package/dist/chunk-SHVW3C3Y.js +0 -50
- package/dist/chunk-SL4CLUHR.js +0 -48
- package/dist/chunk-SOPKVWZJ.js +0 -1187
- package/dist/chunk-ST3H53IJ.js +0 -201
- package/dist/chunk-SYYFA7W7.js +0 -23
- package/dist/chunk-TBUWK3RP.js +0 -399
- package/dist/chunk-TC42NAIJ.js +0 -177
- package/dist/chunk-TJBTP6LH.js +0 -297
- package/dist/chunk-TQQALBLU.js +0 -391
- package/dist/chunk-TW56PZBB.js +0 -407
- package/dist/chunk-U6XRXK2T.js +0 -1356
- package/dist/chunk-U735UBHS.js +0 -2431
- package/dist/chunk-U735UBHS.js.map +0 -1
- package/dist/chunk-UAKG7GLE.js +0 -155
- package/dist/chunk-UB4GKFCI.js +0 -1095
- package/dist/chunk-UEAAF27Y.js +0 -108
- package/dist/chunk-UITWSZH3.js +0 -162
- package/dist/chunk-UQ67SEGH.js +0 -234
- package/dist/chunk-URSNCM57.js +0 -37
- package/dist/chunk-V77BSX2F.js +0 -1152
- package/dist/chunk-VATOL3OZ.js +0 -110
- package/dist/chunk-VEJG6GQQ.js +0 -103
- package/dist/chunk-VFQZPHZR.js +0 -436
- package/dist/chunk-VFZJV26C.js +0 -41
- package/dist/chunk-VJZPVP6C.js +0 -230
- package/dist/chunk-VQL7FHIF.js +0 -27
- package/dist/chunk-VSS6LRAK.js +0 -263
- package/dist/chunk-VSSXDLO3.js +0 -467
- package/dist/chunk-VVCKB62D.js +0 -1024
- package/dist/chunk-VVJDYTD4.js +0 -168
- package/dist/chunk-VVXOG3ZC.js +0 -52
- package/dist/chunk-W2EX346X.js +0 -85
- package/dist/chunk-W3R4C7Z2.js +0 -166
- package/dist/chunk-W43FINJV.js +0 -218
- package/dist/chunk-W6PJWSZ6.js +0 -1769
- package/dist/chunk-WCP32H3P.js +0 -2984
- package/dist/chunk-WKELNNIG.js +0 -3690
- package/dist/chunk-WRFXCMRW.js +0 -2591
- package/dist/chunk-WRLEHV4A.js +0 -386
- package/dist/chunk-WTNQHM6Q.js +0 -43
- package/dist/chunk-WTZ6OJUY.js +0 -3070
- package/dist/chunk-WVFMFQRZ.js +0 -256
- package/dist/chunk-WVFMFQRZ.js.map +0 -1
- package/dist/chunk-WYIC3CXE.js +0 -157
- package/dist/chunk-WZABXFUL.js +0 -246
- package/dist/chunk-WZABXFUL.js.map +0 -1
- package/dist/chunk-X3GBTLKD.js +0 -175
- package/dist/chunk-XBOLFS6I.js +0 -532
- package/dist/chunk-XF4UH54P.js +0 -250
- package/dist/chunk-XHPBQTJP.js +0 -1260
- package/dist/chunk-XQ4TJITR.js +0 -270
- package/dist/chunk-XRFMGLCE.js +0 -466
- package/dist/chunk-XV2F7PGS.js +0 -236
- package/dist/chunk-Y2EQTW5Q.js +0 -100
- package/dist/chunk-YAOXCAQD.js +0 -371
- package/dist/chunk-YCDB3HPS.js +0 -137
- package/dist/chunk-YCONEOZQ.js +0 -191
- package/dist/chunk-YG243U6J.js +0 -158
- package/dist/chunk-YGQANOSV.js +0 -113
- package/dist/chunk-YKRWKRNX.js +0 -138
- package/dist/chunk-YKT5NYYJ.js +0 -3996
- package/dist/chunk-YKT5NYYJ.js.map +0 -1
- package/dist/chunk-YLWABUFE.js +0 -406
- package/dist/chunk-YOKIE7NG.js +0 -227
- package/dist/chunk-YRCDL3GO.js +0 -2582
- package/dist/chunk-YVBAYE7Y.js +0 -1236
- package/dist/chunk-YYKPRX4P.js +0 -29
- package/dist/chunk-Z4MW635R.js +0 -849
- package/dist/chunk-Z7IPPKG6.js +0 -403
- package/dist/chunk-ZFGXQ54H.js +0 -114
- package/dist/chunk-ZGBXHHCL.js +0 -373
- package/dist/computer-viewer-AVH5J4TC.js +0 -21
- package/dist/connection-step-up-T2B25VP7.js +0 -148
- package/dist/connection-step-up-T2B25VP7.js.map +0 -1
- package/dist/embedded-new-voice-M6PBWMQZ.js +0 -25
- package/dist/embedded-voice-7USALJKI.js +0 -25
- package/dist/fleet-decision-row-XY6OZPHA.js +0 -361
- package/dist/model-policy-picker-menu-S5RTVLMQ.js +0 -23
- package/dist/payment-page-card-XSY5NO7D.js +0 -227
- package/dist/platform-activity-row-77WER5O3.js +0 -156
- package/dist/queue-surface-implementation-SDV7I32L.js +0 -933
- package/dist/recorder-host-7GNQG6BB.js +0 -80
- package/dist/sandbox-files-JOH2Q57T.js +0 -29
- package/dist/session-connect-cards-HZIR4ZWT.js +0 -28
- package/dist/session-realtime-OPCPTIAP.js +0 -30
- package/dist/timeline-annotation-markers-WXCRA4BY.js +0 -157
- package/dist/timeline-annotation-selection-YBZQNCNX.js +0 -208
- package/dist/timeline-annotations-dialog-4WVXTKFW.js +0 -283
- /package/dist/{browser-viewer-KFMM5S2B.js.map → browser-viewer-TRPZI6NT.js.map} +0 -0
- /package/dist/{chat-interactive-block-5DJ72HU7.js.map → chat-interactive-block-Y4BS4JCM.js.map} +0 -0
- /package/dist/{chunk-CRBHMSAP.js.map → chunk-22E2YJHT.js.map} +0 -0
- /package/dist/{chunk-H3EP6GNA.js.map → chunk-2T6TN2YL.js.map} +0 -0
- /package/dist/{chunk-KBDWMUYA.js.map → chunk-2WNN26NW.js.map} +0 -0
- /package/dist/{chunk-HJ2J2XQI.js.map → chunk-3432A6XB.js.map} +0 -0
- /package/dist/{chunk-DA7XLT5F.js.map → chunk-35U7NSOR.js.map} +0 -0
- /package/dist/{chunk-QAVSUXLA.js.map → chunk-3EPR76WS.js.map} +0 -0
- /package/dist/{chunk-JV2TJLUW.js.map → chunk-3FXXEU5D.js.map} +0 -0
- /package/dist/{chunk-QR72J6WR.js.map → chunk-3MXOPOEU.js.map} +0 -0
- /package/dist/{chunk-76NGRVCY.js.map → chunk-3PKDU4JI.js.map} +0 -0
- /package/dist/{chunk-BO3D22BS.js.map → chunk-3PMO2BIV.js.map} +0 -0
- /package/dist/{chunk-SL4CLUHR.js.map → chunk-3XWHJNFY.js.map} +0 -0
- /package/dist/{chunk-EGD5RPRX.js.map → chunk-45WD2PKE.js.map} +0 -0
- /package/dist/{chunk-KZE7M52Y.js.map → chunk-4H2OWNRA.js.map} +0 -0
- /package/dist/{chunk-VSS6LRAK.js.map → chunk-4HVGOTMU.js.map} +0 -0
- /package/dist/{chunk-4ECOHGUL.js.map → chunk-4JER2ZMV.js.map} +0 -0
- /package/dist/{chunk-HZE6V7GW.js.map → chunk-4LVZ2VOQ.js.map} +0 -0
- /package/dist/{chunk-B6AH43UQ.js.map → chunk-4OGDD2EM.js.map} +0 -0
- /package/dist/{chunk-4UZE7ZT4.js.map → chunk-4PQC6WMF.js.map} +0 -0
- /package/dist/{chunk-KUYQTNVT.js.map → chunk-4UVSWAT3.js.map} +0 -0
- /package/dist/{chunk-BTMSR4OA.js.map → chunk-53A47RBX.js.map} +0 -0
- /package/dist/{chunk-57QWSJLX.js.map → chunk-552KKENW.js.map} +0 -0
- /package/dist/{chunk-TC42NAIJ.js.map → chunk-55F7L6M3.js.map} +0 -0
- /package/dist/{chunk-FXFOKD7A.js.map → chunk-5AHIKB3O.js.map} +0 -0
- /package/dist/{chunk-Q4GB2QU3.js.map → chunk-5N4L5WTE.js.map} +0 -0
- /package/dist/{chunk-4327UGUS.js.map → chunk-5OUJCVZI.js.map} +0 -0
- /package/dist/{chunk-GTGPKGWC.js.map → chunk-5OYXQ7MH.js.map} +0 -0
- /package/dist/{chunk-2ZR75AUO.js.map → chunk-5TAVVMFX.js.map} +0 -0
- /package/dist/{chunk-2YJS75C3.js.map → chunk-5Y3LYRNH.js.map} +0 -0
- /package/dist/{chunk-WRLEHV4A.js.map → chunk-5ZJKKE4T.js.map} +0 -0
- /package/dist/{chunk-2JTZMHQK.js.map → chunk-62DPSQRZ.js.map} +0 -0
- /package/dist/{chunk-MN4LJYKQ.js.map → chunk-64KMWTJ6.js.map} +0 -0
- /package/dist/{chunk-QUXQYYZO.js.map → chunk-6MZBNUS7.js.map} +0 -0
- /package/dist/{chunk-XF4UH54P.js.map → chunk-6YCE4ZC4.js.map} +0 -0
- /package/dist/{chunk-X3GBTLKD.js.map → chunk-6YROWWMX.js.map} +0 -0
- /package/dist/{chunk-YVBAYE7Y.js.map → chunk-73RZ72VU.js.map} +0 -0
- /package/dist/{chunk-5VPQVMJI.js.map → chunk-74KV436L.js.map} +0 -0
- /package/dist/{chunk-CSK2WOOX.js.map → chunk-7HKGLPV5.js.map} +0 -0
- /package/dist/{chunk-XRFMGLCE.js.map → chunk-7JSWODT6.js.map} +0 -0
- /package/dist/{chunk-EFKWOXBP.js.map → chunk-7K3PKWER.js.map} +0 -0
- /package/dist/{chunk-U6XRXK2T.js.map → chunk-7MPWC42V.js.map} +0 -0
- /package/dist/{chunk-QUTMVW4P.js.map → chunk-7REO6FRN.js.map} +0 -0
- /package/dist/{chunk-MDGNCUAC.js.map → chunk-7YMWRNRQ.js.map} +0 -0
- /package/dist/{chunk-JJKUERR4.js.map → chunk-A6H3KJ7G.js.map} +0 -0
- /package/dist/{chunk-W6PJWSZ6.js.map → chunk-AGQIE6YU.js.map} +0 -0
- /package/dist/{chunk-ZGBXHHCL.js.map → chunk-AHQM4I5V.js.map} +0 -0
- /package/dist/{chunk-HLLZPULI.js.map → chunk-AMTRO7XF.js.map} +0 -0
- /package/dist/{chunk-6S2XVKNI.js.map → chunk-AO4LTCG7.js.map} +0 -0
- /package/dist/{chunk-CTBPPPLR.js.map → chunk-APJ22OZV.js.map} +0 -0
- /package/dist/{chunk-TW56PZBB.js.map → chunk-APWL37KW.js.map} +0 -0
- /package/dist/{chunk-DIHPR5KJ.js.map → chunk-AQEJOBQ2.js.map} +0 -0
- /package/dist/{chunk-HD2MCYQF.js.map → chunk-ARKNT6BX.js.map} +0 -0
- /package/dist/{chunk-RSTS3RWN.js.map → chunk-B2IHDMAR.js.map} +0 -0
- /package/dist/{chunk-KZYZ3JHS.js.map → chunk-BCKIV26W.js.map} +0 -0
- /package/dist/{chunk-D5K2BS5Q.js.map → chunk-BE26JUSD.js.map} +0 -0
- /package/dist/{chunk-DRAG2LZP.js.map → chunk-BOVCD6KD.js.map} +0 -0
- /package/dist/{chunk-IIWNSYFA.js.map → chunk-BQWV66A6.js.map} +0 -0
- /package/dist/{chunk-BJ3WRO2K.js.map → chunk-BSQJXGGP.js.map} +0 -0
- /package/dist/{chunk-KLYBSXHE.js.map → chunk-BZY3MEVZ.js.map} +0 -0
- /package/dist/{chunk-MQRUZ2LW.js.map → chunk-C3D3OOEY.js.map} +0 -0
- /package/dist/{chunk-GY6DSWBM.js.map → chunk-CDHYO3DP.js.map} +0 -0
- /package/dist/{chunk-OPCPBLHA.js.map → chunk-CDV5JGVI.js.map} +0 -0
- /package/dist/{chunk-5WJCOFIU.js.map → chunk-CNW45M7G.js.map} +0 -0
- /package/dist/{chunk-A2OMNLDF.js.map → chunk-CUVQ37HB.js.map} +0 -0
- /package/dist/{chunk-XBOLFS6I.js.map → chunk-D32T3IIC.js.map} +0 -0
- /package/dist/{chunk-YAOXCAQD.js.map → chunk-D65BSM64.js.map} +0 -0
- /package/dist/{chunk-CNNOPEAK.js.map → chunk-D7435DWV.js.map} +0 -0
- /package/dist/{chunk-32LD46VC.js.map → chunk-DFH3M7B3.js.map} +0 -0
- /package/dist/{chunk-QIOIJ7K5.js.map → chunk-DGWBQ76M.js.map} +0 -0
- /package/dist/{chunk-PQOVMZI2.js.map → chunk-DHJDTGSJ.js.map} +0 -0
- /package/dist/{chunk-4XQH4XPP.js.map → chunk-DKEFTNCD.js.map} +0 -0
- /package/dist/{chunk-JIZWFW5A.js.map → chunk-DNAF6MT4.js.map} +0 -0
- /package/dist/{chunk-QBJDMSFA.js.map → chunk-E35XY7DS.js.map} +0 -0
- /package/dist/{chunk-NO6VQNWH.js.map → chunk-E5T5WIIP.js.map} +0 -0
- /package/dist/{chunk-W3R4C7Z2.js.map → chunk-EL6ECD34.js.map} +0 -0
- /package/dist/{chunk-VSSXDLO3.js.map → chunk-ELR6ITRC.js.map} +0 -0
- /package/dist/{chunk-7TLYFHMT.js.map → chunk-EPE3V2VE.js.map} +0 -0
- /package/dist/{chunk-2B3RQRNQ.js.map → chunk-EYGQHHVW.js.map} +0 -0
- /package/dist/{chunk-2VK7FJNR.js.map → chunk-EYQEJHYP.js.map} +0 -0
- /package/dist/{chunk-BIXGAYDJ.js.map → chunk-EZTH2XMH.js.map} +0 -0
- /package/dist/{chunk-6PHBW7SS.js.map → chunk-F3QVHVFS.js.map} +0 -0
- /package/dist/{chunk-SOPKVWZJ.js.map → chunk-F5VWPREQ.js.map} +0 -0
- /package/dist/{chunk-YGQANOSV.js.map → chunk-FM7AQUBL.js.map} +0 -0
- /package/dist/{chunk-Y2EQTW5Q.js.map → chunk-FP6BUXJM.js.map} +0 -0
- /package/dist/{chunk-45TILHFZ.js.map → chunk-FVU52L3I.js.map} +0 -0
- /package/dist/{chunk-W43FINJV.js.map → chunk-FZKNXNNO.js.map} +0 -0
- /package/dist/{chunk-XV2F7PGS.js.map → chunk-G3IXJWRY.js.map} +0 -0
- /package/dist/{chunk-DC6KFW2R.js.map → chunk-G6EI2O3N.js.map} +0 -0
- /package/dist/{chunk-2GXAXCS2.js.map → chunk-GB5T6YMZ.js.map} +0 -0
- /package/dist/{chunk-WYIC3CXE.js.map → chunk-GBLD6FOG.js.map} +0 -0
- /package/dist/{chunk-YCDB3HPS.js.map → chunk-GJBFFXCY.js.map} +0 -0
- /package/dist/{chunk-APNPWJCK.js.map → chunk-GJDP2K2S.js.map} +0 -0
- /package/dist/{chunk-GFTV3RR6.js.map → chunk-GP26XTDX.js.map} +0 -0
- /package/dist/{chunk-Q4RJKXQM.js.map → chunk-GTE6WP4N.js.map} +0 -0
- /package/dist/{chunk-UEAAF27Y.js.map → chunk-GWG3OAV7.js.map} +0 -0
- /package/dist/{chunk-6LYBRPUG.js.map → chunk-GXMHTMM6.js.map} +0 -0
- /package/dist/{chunk-NUM3QV66.js.map → chunk-GYRN5O2E.js.map} +0 -0
- /package/dist/{chunk-G4E5WKY7.js.map → chunk-GZX7W2WW.js.map} +0 -0
- /package/dist/{chunk-Z7IPPKG6.js.map → chunk-H3QI2G2B.js.map} +0 -0
- /package/dist/{chunk-Z4MW635R.js.map → chunk-H7D4DVWY.js.map} +0 -0
- /package/dist/{chunk-YCONEOZQ.js.map → chunk-HCDGBBBJ.js.map} +0 -0
- /package/dist/{chunk-DLMYANZX.js.map → chunk-HDSH6MIJ.js.map} +0 -0
- /package/dist/{chunk-KPD6TBO4.js.map → chunk-HOEUPZ6O.js.map} +0 -0
- /package/dist/{chunk-7VDWXFTL.js.map → chunk-HPQRWTQB.js.map} +0 -0
- /package/dist/{chunk-GIHE7U3Y.js.map → chunk-HUKGLWAY.js.map} +0 -0
- /package/dist/{chunk-SYYFA7W7.js.map → chunk-HUTQJY3F.js.map} +0 -0
- /package/dist/{chunk-62T2ZPD5.js.map → chunk-HWOYJOKK.js.map} +0 -0
- /package/dist/{chunk-IN2ZJR2A.js.map → chunk-HZR3WGUP.js.map} +0 -0
- /package/dist/{chunk-YKRWKRNX.js.map → chunk-I7YUDPDR.js.map} +0 -0
- /package/dist/{chunk-VQL7FHIF.js.map → chunk-IDII52M4.js.map} +0 -0
- /package/dist/{chunk-HPYQ5MES.js.map → chunk-IDPWEUM7.js.map} +0 -0
- /package/dist/{chunk-JL4PMUDG.js.map → chunk-IEWQFGEC.js.map} +0 -0
- /package/dist/{chunk-MRJFF5KY.js.map → chunk-IMTACEXF.js.map} +0 -0
- /package/dist/{chunk-2LRJ32SO.js.map → chunk-IVWT6M6N.js.map} +0 -0
- /package/dist/{chunk-7RRDXPNC.js.map → chunk-JEUPIHIP.js.map} +0 -0
- /package/dist/{chunk-VVJDYTD4.js.map → chunk-JF4WX3GQ.js.map} +0 -0
- /package/dist/{chunk-WRFXCMRW.js.map → chunk-JJPYXUKC.js.map} +0 -0
- /package/dist/{chunk-WTNQHM6Q.js.map → chunk-JNHWTYDD.js.map} +0 -0
- /package/dist/{chunk-RGCCRYTY.js.map → chunk-JP7AOJWD.js.map} +0 -0
- /package/dist/{chunk-TJBTP6LH.js.map → chunk-JTWT2WQA.js.map} +0 -0
- /package/dist/{chunk-HJ2CDFZX.js.map → chunk-JW3WIHWO.js.map} +0 -0
- /package/dist/{chunk-MITT6IZG.js.map → chunk-JW7RJMEZ.js.map} +0 -0
- /package/dist/{chunk-CTOLX2EW.js.map → chunk-K76PXR3O.js.map} +0 -0
- /package/dist/{chunk-CX3Z7W5Y.js.map → chunk-KCNIQN6V.js.map} +0 -0
- /package/dist/{chunk-2YNEUYWM.js.map → chunk-KH6KHYST.js.map} +0 -0
- /package/dist/{chunk-LKF6IPFC.js.map → chunk-KK4SEN7N.js.map} +0 -0
- /package/dist/{chunk-63AVTSUI.js.map → chunk-KOKRGAAI.js.map} +0 -0
- /package/dist/{chunk-F2JKNL73.js.map → chunk-KQFNTGAF.js.map} +0 -0
- /package/dist/{chunk-SHVW3C3Y.js.map → chunk-KRLNC6TH.js.map} +0 -0
- /package/dist/{chunk-MFLU3466.js.map → chunk-KYDLVMKA.js.map} +0 -0
- /package/dist/{chunk-UAKG7GLE.js.map → chunk-KZQDP2JM.js.map} +0 -0
- /package/dist/{chunk-FX343J2L.js.map → chunk-L2EZ2HOX.js.map} +0 -0
- /package/dist/{chunk-GGBMQNAB.js.map → chunk-L2UAFR2D.js.map} +0 -0
- /package/dist/{chunk-GT3FJVU6.js.map → chunk-L4R7ORMD.js.map} +0 -0
- /package/dist/{chunk-YOKIE7NG.js.map → chunk-LCLWN64E.js.map} +0 -0
- /package/dist/{chunk-PPQJIVGM.js.map → chunk-LFQI2C46.js.map} +0 -0
- /package/dist/{chunk-KF65UG2L.js.map → chunk-LLYX4F5A.js.map} +0 -0
- /package/dist/{chunk-PYU7CLEG.js.map → chunk-LQX5QCDS.js.map} +0 -0
- /package/dist/{chunk-Q4ZNRQKH.js.map → chunk-LRMHASG2.js.map} +0 -0
- /package/dist/{chunk-MO3XJQN2.js.map → chunk-M5FX5KH5.js.map} +0 -0
- /package/dist/{chunk-ST3H53IJ.js.map → chunk-MLOTUQJJ.js.map} +0 -0
- /package/dist/{chunk-A6Q6EUBR.js.map → chunk-MPUKGKXZ.js.map} +0 -0
- /package/dist/{chunk-ONF5M5GP.js.map → chunk-MS6LW4VU.js.map} +0 -0
- /package/dist/{chunk-NUF43R2F.js.map → chunk-MXPW4F74.js.map} +0 -0
- /package/dist/{chunk-MPP6BEAN.js.map → chunk-MZ7GJX5S.js.map} +0 -0
- /package/dist/{chunk-XHPBQTJP.js.map → chunk-N5OUIUYD.js.map} +0 -0
- /package/dist/{chunk-EAXZSBWV.js.map → chunk-N6FNORC7.js.map} +0 -0
- /package/dist/{chunk-4K5UVYZQ.js.map → chunk-NALVKY4U.js.map} +0 -0
- /package/dist/{chunk-L7T7M2P3.js.map → chunk-NJ77ZL5T.js.map} +0 -0
- /package/dist/{chunk-XQ4TJITR.js.map → chunk-NM2DNJDJ.js.map} +0 -0
- /package/dist/{chunk-VATOL3OZ.js.map → chunk-NNKRRF7E.js.map} +0 -0
- /package/dist/{chunk-4AUSS7CX.js.map → chunk-NP5UFWU4.js.map} +0 -0
- /package/dist/{chunk-HFROJDFQ.js.map → chunk-NV3AEIFO.js.map} +0 -0
- /package/dist/{chunk-PC3FWPOP.js.map → chunk-O6JDF7KH.js.map} +0 -0
- /package/dist/{chunk-OROXCA6L.js.map → chunk-OERZH3J4.js.map} +0 -0
- /package/dist/{chunk-V77BSX2F.js.map → chunk-OKHWTWWU.js.map} +0 -0
- /package/dist/{chunk-C22UPHA2.js.map → chunk-OLAIUVGT.js.map} +0 -0
- /package/dist/{chunk-C2F6SKOS.js.map → chunk-OO36IUMS.js.map} +0 -0
- /package/dist/{chunk-IZA2KBYK.js.map → chunk-OVDK7K2Z.js.map} +0 -0
- /package/dist/{chunk-FQ33JHJN.js.map → chunk-OX5ZCHZQ.js.map} +0 -0
- /package/dist/{chunk-FY42DW2R.js.map → chunk-P6LLCGPO.js.map} +0 -0
- /package/dist/{chunk-LX5IEXDF.js.map → chunk-PA2CUHTD.js.map} +0 -0
- /package/dist/{chunk-HE4VN5D3.js.map → chunk-PB4CQIRA.js.map} +0 -0
- /package/dist/{chunk-M722GGD3.js.map → chunk-PBV2P632.js.map} +0 -0
- /package/dist/{chunk-KTGKGHEA.js.map → chunk-PCSRHFRF.js.map} +0 -0
- /package/dist/{chunk-VFQZPHZR.js.map → chunk-PEPWW5BC.js.map} +0 -0
- /package/dist/{chunk-6CDBX3XG.js.map → chunk-PMBZMVKE.js.map} +0 -0
- /package/dist/{chunk-4Z7BPBS7.js.map → chunk-PP32RE26.js.map} +0 -0
- /package/dist/{chunk-6VEIDSF4.js.map → chunk-PTXAPI3Q.js.map} +0 -0
- /package/dist/{chunk-OTMJS3FV.js.map → chunk-PULNNF7G.js.map} +0 -0
- /package/dist/{chunk-YG243U6J.js.map → chunk-Q6KNROUT.js.map} +0 -0
- /package/dist/{chunk-EZ5ZBOGQ.js.map → chunk-QGJIFIKN.js.map} +0 -0
- /package/dist/{chunk-VFZJV26C.js.map → chunk-QKKKORGL.js.map} +0 -0
- /package/dist/{chunk-W2EX346X.js.map → chunk-QKUMMG6P.js.map} +0 -0
- /package/dist/{chunk-BVZYHORS.js.map → chunk-QNOWKKZ4.js.map} +0 -0
- /package/dist/{chunk-3FVVZW7J.js.map → chunk-QSWD3AHE.js.map} +0 -0
- /package/dist/{chunk-7FFZLLCH.js.map → chunk-QZ4U2VL5.js.map} +0 -0
- /package/dist/{chunk-IIMRBCA4.js.map → chunk-QZJNCLHV.js.map} +0 -0
- /package/dist/{chunk-6D3D2JWY.js.map → chunk-R6CFPY3F.js.map} +0 -0
- /package/dist/{chunk-YLWABUFE.js.map → chunk-R6QRUYUH.js.map} +0 -0
- /package/dist/{chunk-WCP32H3P.js.map → chunk-RE3GAQI5.js.map} +0 -0
- /package/dist/{chunk-JG7MEMJP.js.map → chunk-RFHUVPFA.js.map} +0 -0
- /package/dist/{chunk-WKELNNIG.js.map → chunk-RH45HT5T.js.map} +0 -0
- /package/dist/{chunk-S4LRL5BA.js.map → chunk-RJNQTZ5O.js.map} +0 -0
- /package/dist/{chunk-URSNCM57.js.map → chunk-S2BJTAAB.js.map} +0 -0
- /package/dist/{chunk-AJSRYRJS.js.map → chunk-S56PWXIX.js.map} +0 -0
- /package/dist/{chunk-FAB5SXNO.js.map → chunk-S6FFDIHD.js.map} +0 -0
- /package/dist/{chunk-56NHT2TZ.js.map → chunk-S6MAMIK2.js.map} +0 -0
- /package/dist/{chunk-OKI45WHM.js.map → chunk-SERTO6H6.js.map} +0 -0
- /package/dist/{chunk-I5DW76GB.js.map → chunk-STOOH7EI.js.map} +0 -0
- /package/dist/{chunk-I7MZOZGC.js.map → chunk-SWSTEUXX.js.map} +0 -0
- /package/dist/{chunk-JFEAJRG6.js.map → chunk-SWZN7NNZ.js.map} +0 -0
- /package/dist/{chunk-ARNQH2XE.js.map → chunk-SYDF57KS.js.map} +0 -0
- /package/dist/{chunk-YYKPRX4P.js.map → chunk-T275CUVD.js.map} +0 -0
- /package/dist/{chunk-OCS3KIYC.js.map → chunk-T4OT7QWP.js.map} +0 -0
- /package/dist/{chunk-YRCDL3GO.js.map → chunk-TCSRY2NP.js.map} +0 -0
- /package/dist/{chunk-ELC2ZPHI.js.map → chunk-TCX5OA2X.js.map} +0 -0
- /package/dist/{chunk-NJVHMK5R.js.map → chunk-TDW5CSO5.js.map} +0 -0
- /package/dist/{chunk-MCPKUVMQ.js.map → chunk-TGG3ODCS.js.map} +0 -0
- /package/dist/{chunk-Q2N5UR7Q.js.map → chunk-TILSTYUC.js.map} +0 -0
- /package/dist/{chunk-4FKE42TW.js.map → chunk-TJ5DYWXU.js.map} +0 -0
- /package/dist/{chunk-TQQALBLU.js.map → chunk-TNRI4ZE6.js.map} +0 -0
- /package/dist/{chunk-LLU7VKCZ.js.map → chunk-TPIFVUMF.js.map} +0 -0
- /package/dist/{chunk-UITWSZH3.js.map → chunk-TSW6OF22.js.map} +0 -0
- /package/dist/{chunk-UB4GKFCI.js.map → chunk-TTSTBHGR.js.map} +0 -0
- /package/dist/{chunk-HVGM5IME.js.map → chunk-U3JYAWMR.js.map} +0 -0
- /package/dist/{chunk-GGU7KV4G.js.map → chunk-U7ODSHA5.js.map} +0 -0
- /package/dist/{chunk-NW4RPGET.js.map → chunk-UEGEPRNP.js.map} +0 -0
- /package/dist/{chunk-2DA7DTHO.js.map → chunk-UGIA2YEJ.js.map} +0 -0
- /package/dist/{chunk-5AGRFQSH.js.map → chunk-UHLKKDNF.js.map} +0 -0
- /package/dist/{chunk-KJI2DVSO.js.map → chunk-ULVXKIPX.js.map} +0 -0
- /package/dist/{chunk-56KVDNOS.js.map → chunk-USUDKZ5G.js.map} +0 -0
- /package/dist/{chunk-CC4JBFWY.js.map → chunk-UVO6I2F6.js.map} +0 -0
- /package/dist/{chunk-BR62BHVY.js.map → chunk-V6NVG4K2.js.map} +0 -0
- /package/dist/{chunk-Q7QXSQ46.js.map → chunk-VCMQFD3G.js.map} +0 -0
- /package/dist/{chunk-CVDY7P3E.js.map → chunk-VKPBDNIO.js.map} +0 -0
- /package/dist/{chunk-L6WVCO6D.js.map → chunk-VLDKWGHD.js.map} +0 -0
- /package/dist/{chunk-IUPIJWFK.js.map → chunk-VM2NA2EL.js.map} +0 -0
- /package/dist/{chunk-6JGMBTXP.js.map → chunk-VMZTCVEL.js.map} +0 -0
- /package/dist/{chunk-CG2HT7TI.js.map → chunk-VQH5AXZY.js.map} +0 -0
- /package/dist/{chunk-ZFGXQ54H.js.map → chunk-VTBTW6N4.js.map} +0 -0
- /package/dist/{chunk-VJZPVP6C.js.map → chunk-VV7PLDX4.js.map} +0 -0
- /package/dist/{chunk-LWEJGMVO.js.map → chunk-VYGGLH5H.js.map} +0 -0
- /package/dist/{chunk-KFYLTQGK.js.map → chunk-VYQHHTQ4.js.map} +0 -0
- /package/dist/{chunk-IB2EX6GX.js.map → chunk-VYSGRD2W.js.map} +0 -0
- /package/dist/{chunk-5JMX5FRF.js.map → chunk-W4W63LTP.js.map} +0 -0
- /package/dist/{chunk-HRLJNDDC.js.map → chunk-WHTRR66J.js.map} +0 -0
- /package/dist/{chunk-BWBBS6HJ.js.map → chunk-WICIQFHJ.js.map} +0 -0
- /package/dist/{chunk-CDB66JAO.js.map → chunk-WJYYMCCC.js.map} +0 -0
- /package/dist/{chunk-TBUWK3RP.js.map → chunk-WSJOWQJE.js.map} +0 -0
- /package/dist/{chunk-C2EERTYX.js.map → chunk-WYDUXZ2R.js.map} +0 -0
- /package/dist/{chunk-E2SGFW2B.js.map → chunk-X62CN4YR.js.map} +0 -0
- /package/dist/{chunk-VVCKB62D.js.map → chunk-XFQHKMO6.js.map} +0 -0
- /package/dist/{chunk-IZZINUFM.js.map → chunk-XGJ7XZHS.js.map} +0 -0
- /package/dist/{chunk-P5FLGDXW.js.map → chunk-XJFJNOEV.js.map} +0 -0
- /package/dist/{chunk-UQ67SEGH.js.map → chunk-XKJLHMXZ.js.map} +0 -0
- /package/dist/{chunk-VEJG6GQQ.js.map → chunk-XLFPJVQS.js.map} +0 -0
- /package/dist/{chunk-RDHK2NYW.js.map → chunk-XM4ZLZFW.js.map} +0 -0
- /package/dist/{chunk-6TWS6AXT.js.map → chunk-Y2GAWEJD.js.map} +0 -0
- /package/dist/{chunk-MYDFABO6.js.map → chunk-Y3A74SVK.js.map} +0 -0
- /package/dist/{chunk-C625ODRG.js.map → chunk-YANEVGI3.js.map} +0 -0
- /package/dist/{chunk-OXM267RC.js.map → chunk-YHHSO5QR.js.map} +0 -0
- /package/dist/{chunk-VVXOG3ZC.js.map → chunk-YOSOCHCB.js.map} +0 -0
- /package/dist/{chunk-HHFFPE67.js.map → chunk-YP4SNX4P.js.map} +0 -0
- /package/dist/{chunk-QCB3WNCA.js.map → chunk-YQH6AMIH.js.map} +0 -0
- /package/dist/{chunk-NZBZLY7H.js.map → chunk-YRWL2IAE.js.map} +0 -0
- /package/dist/{chunk-LYEALWBN.js.map → chunk-YTWRQ3WK.js.map} +0 -0
- /package/dist/{chunk-7V2CQLTN.js.map → chunk-YV5GGSLK.js.map} +0 -0
- /package/dist/{chunk-RY7YRYVT.js.map → chunk-YXUDK37V.js.map} +0 -0
- /package/dist/{chunk-MUB44LD3.js.map → chunk-YYM5TSCR.js.map} +0 -0
- /package/dist/{chunk-JTWK3VE7.js.map → chunk-ZG2CKFQF.js.map} +0 -0
- /package/dist/{chunk-5UTHPGFF.js.map → chunk-ZGJXO2HH.js.map} +0 -0
- /package/dist/{chunk-WTZ6OJUY.js.map → chunk-ZGV76PZ4.js.map} +0 -0
- /package/dist/{chunk-A3QEJ2IZ.js.map → chunk-ZOBUR2VC.js.map} +0 -0
- /package/dist/{computer-viewer-AVH5J4TC.js.map → computer-viewer-S6AL3XDT.js.map} +0 -0
- /package/dist/{embedded-new-voice-M6PBWMQZ.js.map → embedded-new-voice-T3BXRYJX.js.map} +0 -0
- /package/dist/{embedded-voice-7USALJKI.js.map → embedded-voice-ZJXMF3RP.js.map} +0 -0
- /package/dist/{fleet-decision-row-XY6OZPHA.js.map → fleet-decision-row-AUCMLBCV.js.map} +0 -0
- /package/dist/{model-policy-picker-menu-S5RTVLMQ.js.map → model-policy-picker-menu-TO57YUQ6.js.map} +0 -0
- /package/dist/{payment-page-card-XSY5NO7D.js.map → payment-page-card-DFGDAMTG.js.map} +0 -0
- /package/dist/{platform-activity-row-77WER5O3.js.map → platform-activity-row-ZMBEJGXN.js.map} +0 -0
- /package/dist/{queue-surface-implementation-SDV7I32L.js.map → queue-surface-implementation-KDK5CYH6.js.map} +0 -0
- /package/dist/{recorder-host-7GNQG6BB.js.map → recorder-host-3HLYRL4H.js.map} +0 -0
- /package/dist/{sandbox-files-JOH2Q57T.js.map → sandbox-files-UOZ4OJZU.js.map} +0 -0
- /package/dist/{session-connect-cards-HZIR4ZWT.js.map → session-connect-cards-VZIYLH45.js.map} +0 -0
- /package/dist/{session-realtime-OPCPTIAP.js.map → session-realtime-2ZGJWVZP.js.map} +0 -0
- /package/dist/{timeline-annotation-markers-WXCRA4BY.js.map → timeline-annotation-markers-KBTFWLME.js.map} +0 -0
- /package/dist/{timeline-annotation-selection-YBZQNCNX.js.map → timeline-annotation-selection-VI4YSDR5.js.map} +0 -0
- /package/dist/{timeline-annotations-dialog-4WVXTKFW.js.map → timeline-annotations-dialog-4PLWNLRB.js.map} +0 -0
|
@@ -0,0 +1,4596 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
OwnLoginsSharedHeadsUp,
|
|
4
|
+
ownLoginsInUse
|
|
5
|
+
} from "./chunk-VQH5AXZY.js";
|
|
6
|
+
import {
|
|
7
|
+
OPEN_PULL_REQUEST_MESSAGE,
|
|
8
|
+
SessionLinkedPanel,
|
|
9
|
+
openPullRequestFromLinks,
|
|
10
|
+
useSessionLinks
|
|
11
|
+
} from "./chunk-YTWRQ3WK.js";
|
|
12
|
+
import {
|
|
13
|
+
PinnedAccountWaitNotice
|
|
14
|
+
} from "./chunk-3432A6XB.js";
|
|
15
|
+
import {
|
|
16
|
+
ModelRecoveryNotice
|
|
17
|
+
} from "./chunk-AQEJOBQ2.js";
|
|
18
|
+
import {
|
|
19
|
+
HumanInputDelegationRecord
|
|
20
|
+
} from "./chunk-VTBTW6N4.js";
|
|
21
|
+
import {
|
|
22
|
+
ReadOnlySessionNotice,
|
|
23
|
+
sessionReadOnlyArchive
|
|
24
|
+
} from "./chunk-2WNN26NW.js";
|
|
25
|
+
import {
|
|
26
|
+
useMessageSenderRenderer
|
|
27
|
+
} from "./chunk-RDEPVRWS.js";
|
|
28
|
+
import {
|
|
29
|
+
SessionWorkspace
|
|
30
|
+
} from "./chunk-XM4ZLZFW.js";
|
|
31
|
+
import {
|
|
32
|
+
ArtifactLinkBoundary
|
|
33
|
+
} from "./chunk-EAMY5HXA.js";
|
|
34
|
+
import {
|
|
35
|
+
TerminalSessionArchive,
|
|
36
|
+
TerminalSessionBanner,
|
|
37
|
+
UserMessageBody
|
|
38
|
+
} from "./chunk-ZGJXO2HH.js";
|
|
39
|
+
import {
|
|
40
|
+
descendantsRunning,
|
|
41
|
+
hintTouchesTree,
|
|
42
|
+
isSubSessionResponseOutput,
|
|
43
|
+
lineageSessionIds,
|
|
44
|
+
subSessionResponseCallIds,
|
|
45
|
+
waitingDescendants
|
|
46
|
+
} from "./chunk-OAXVFBZT.js";
|
|
47
|
+
import {
|
|
48
|
+
UnavailableModelNotice
|
|
49
|
+
} from "./chunk-RDBSUNNS.js";
|
|
50
|
+
import {
|
|
51
|
+
OwnAccountWaitNotice,
|
|
52
|
+
othersWaitingTurn
|
|
53
|
+
} from "./chunk-IVWT6M6N.js";
|
|
54
|
+
import {
|
|
55
|
+
CONTEXT_CHECKPOINT_EVENT_TYPES,
|
|
56
|
+
codexUsageContinueAtResetAction,
|
|
57
|
+
codexUsageContinuesAtReset,
|
|
58
|
+
codexUsageNoticeApplies,
|
|
59
|
+
codexUsageResetText,
|
|
60
|
+
codexUsageResetsAt,
|
|
61
|
+
codexWaitIsUsageLimit,
|
|
62
|
+
latestCheckpointIsCompaction,
|
|
63
|
+
modelSwitchHeadsUpText,
|
|
64
|
+
needsModelSwitchHeadsUp
|
|
65
|
+
} from "./chunk-HZR3WGUP.js";
|
|
66
|
+
import {
|
|
67
|
+
CodexUsageNotice,
|
|
68
|
+
ModelSwitchHeadsUp
|
|
69
|
+
} from "./chunk-OMPVOMPP.js";
|
|
70
|
+
import {
|
|
71
|
+
SessionPullRequestPanel,
|
|
72
|
+
mergePullRequestMessage,
|
|
73
|
+
pullRequestLinkFromLinks,
|
|
74
|
+
pullRequestNumber
|
|
75
|
+
} from "./chunk-PA2CUHTD.js";
|
|
76
|
+
import {
|
|
77
|
+
SessionMachinePickerAction,
|
|
78
|
+
SessionRunsOnMenuBody,
|
|
79
|
+
useSessionRunsOn
|
|
80
|
+
} from "./chunk-BE26JUSD.js";
|
|
81
|
+
import {
|
|
82
|
+
PersonalResourceAttachmentSurface
|
|
83
|
+
} from "./chunk-JNHWTYDD.js";
|
|
84
|
+
import {
|
|
85
|
+
FailureRecoveryBoundary
|
|
86
|
+
} from "./chunk-IDII52M4.js";
|
|
87
|
+
import {
|
|
88
|
+
FollowUpRepositoryMenuBody
|
|
89
|
+
} from "./chunk-T275CUVD.js";
|
|
90
|
+
import {
|
|
91
|
+
ChatPaymentPages
|
|
92
|
+
} from "./chunk-46ZC5VNC.js";
|
|
93
|
+
import {
|
|
94
|
+
MarkdownText
|
|
95
|
+
} from "./chunk-UEGEPRNP.js";
|
|
96
|
+
import {
|
|
97
|
+
secretSaveTargets
|
|
98
|
+
} from "./chunk-P46SRX7L.js";
|
|
99
|
+
import {
|
|
100
|
+
chatLearningScope
|
|
101
|
+
} from "./chunk-SCN7CKBA.js";
|
|
102
|
+
import {
|
|
103
|
+
clearGitHubInstallRequest,
|
|
104
|
+
recordGitHubInstallRequest
|
|
105
|
+
} from "./chunk-PVNI2KHS.js";
|
|
106
|
+
import {
|
|
107
|
+
useFixedRigScope,
|
|
108
|
+
usePersonalResourceAttachment
|
|
109
|
+
} from "./chunk-JQD7MFME.js";
|
|
110
|
+
import {
|
|
111
|
+
connectableSubscriptions,
|
|
112
|
+
isDeploymentFreeModel
|
|
113
|
+
} from "./chunk-ZP3QCPYG.js";
|
|
114
|
+
import {
|
|
115
|
+
useWorkspaceAppLinkResolver
|
|
116
|
+
} from "./chunk-YTPE3KKV.js";
|
|
117
|
+
import {
|
|
118
|
+
useSessionOpening
|
|
119
|
+
} from "./chunk-QZKM4S2G.js";
|
|
120
|
+
import {
|
|
121
|
+
useStreamHealthTelemetry
|
|
122
|
+
} from "./chunk-PRUVBCX6.js";
|
|
123
|
+
import {
|
|
124
|
+
isCodexUsageLimitFailure,
|
|
125
|
+
latestTurnFailedOnUsageLimit,
|
|
126
|
+
sessionModelMissingFromCatalog,
|
|
127
|
+
unavailableModelName,
|
|
128
|
+
unavailableModelReplacement
|
|
129
|
+
} from "./chunk-BPHPAGYF.js";
|
|
130
|
+
import {
|
|
131
|
+
isTerminalSessionStatus,
|
|
132
|
+
projectSessionTimeline,
|
|
133
|
+
summarizeSessionFailure
|
|
134
|
+
} from "./chunk-EYQEJHYP.js";
|
|
135
|
+
import {
|
|
136
|
+
needsSandboxRecoveryCheck
|
|
137
|
+
} from "./chunk-IIFO2H3P.js";
|
|
138
|
+
import {
|
|
139
|
+
useBackgroundAttentionTitle
|
|
140
|
+
} from "./chunk-H2YTTK7Z.js";
|
|
141
|
+
import {
|
|
142
|
+
readSessionDockNavigation,
|
|
143
|
+
sessionDockLayoutStorageId,
|
|
144
|
+
updateSessionDockNavigation
|
|
145
|
+
} from "./chunk-ESYN5AUB.js";
|
|
146
|
+
import {
|
|
147
|
+
applySessionAttentionProjection,
|
|
148
|
+
notifySessionAttentionChanged,
|
|
149
|
+
sessionReadProjectionKey,
|
|
150
|
+
shouldAcknowledgeActiveSession,
|
|
151
|
+
shouldProjectActiveSessionRead,
|
|
152
|
+
updateLocalSessionDeliveryAttention
|
|
153
|
+
} from "./chunk-CCY2NBAC.js";
|
|
154
|
+
import {
|
|
155
|
+
noteTurnFailureAction
|
|
156
|
+
} from "./chunk-EJBK7SWK.js";
|
|
157
|
+
import {
|
|
158
|
+
MACHINE_ACCESS_REQUIRED_CODE,
|
|
159
|
+
chatComposerPlaceholder,
|
|
160
|
+
detailBeyondHeadline,
|
|
161
|
+
failedSessionCopy,
|
|
162
|
+
failureFallbackReason
|
|
163
|
+
} from "./chunk-OO36IUMS.js";
|
|
164
|
+
import {
|
|
165
|
+
moveChatToMachine
|
|
166
|
+
} from "./chunk-YV5GGSLK.js";
|
|
167
|
+
import {
|
|
168
|
+
sessionTimelineEmptyStateCopy
|
|
169
|
+
} from "./chunk-FBQXXJV3.js";
|
|
170
|
+
import {
|
|
171
|
+
createFailedSessionRetry
|
|
172
|
+
} from "./chunk-DW3URGMX.js";
|
|
173
|
+
import {
|
|
174
|
+
useCodexUsageModelSwitch
|
|
175
|
+
} from "./chunk-Z2C2LA2F.js";
|
|
176
|
+
import {
|
|
177
|
+
bannerFailureEventIds,
|
|
178
|
+
timelineShowsFailure
|
|
179
|
+
} from "./chunk-QPUNVMF6.js";
|
|
180
|
+
import {
|
|
181
|
+
currentModelRecovery
|
|
182
|
+
} from "./chunk-GMYWC2UP.js";
|
|
183
|
+
import {
|
|
184
|
+
useReadSessionInbox
|
|
185
|
+
} from "./chunk-ROC2ZGXP.js";
|
|
186
|
+
import {
|
|
187
|
+
useArtifactCatalogMutationInvalidation
|
|
188
|
+
} from "./chunk-JUJ6QCI2.js";
|
|
189
|
+
import {
|
|
190
|
+
ChatViewportFileDropTarget
|
|
191
|
+
} from "./chunk-CMH22OQY.js";
|
|
192
|
+
import {
|
|
193
|
+
FORK_CURRENT_CHAT_EVENT,
|
|
194
|
+
useRail
|
|
195
|
+
} from "./chunk-3PKDU4JI.js";
|
|
196
|
+
import {
|
|
197
|
+
canArchiveChat,
|
|
198
|
+
requestSessionArchive
|
|
199
|
+
} from "./chunk-OH6KP4JB.js";
|
|
200
|
+
import {
|
|
201
|
+
FOCUS_SESSION_COMPOSER_EVENT,
|
|
202
|
+
consumeSessionComposerFocusIntent,
|
|
203
|
+
focusSessionComposerWhenReady,
|
|
204
|
+
sessionComposerFocusIntentIsEligible
|
|
205
|
+
} from "./chunk-MMY23KS7.js";
|
|
206
|
+
import {
|
|
207
|
+
OPEN_CONVERSATION_FIND_EVENT
|
|
208
|
+
} from "./chunk-7ZEGSUR7.js";
|
|
209
|
+
import {
|
|
210
|
+
notifySessionListChanged
|
|
211
|
+
} from "./chunk-O5S57N6H.js";
|
|
212
|
+
import {
|
|
213
|
+
isEditableArtifactKind
|
|
214
|
+
} from "./chunk-V3VEPKOK.js";
|
|
215
|
+
import {
|
|
216
|
+
expireArtifactCatalog
|
|
217
|
+
} from "./chunk-7NLCCKNJ.js";
|
|
218
|
+
import {
|
|
219
|
+
useConnectionAccounts
|
|
220
|
+
} from "./chunk-37XUIX3A.js";
|
|
221
|
+
import {
|
|
222
|
+
SessionSecretsMenuBody,
|
|
223
|
+
sessionSecretsSummary
|
|
224
|
+
} from "./chunk-R6CFPY3F.js";
|
|
225
|
+
import {
|
|
226
|
+
WorkspaceComposerPlus
|
|
227
|
+
} from "./chunk-EZTH2XMH.js";
|
|
228
|
+
import {
|
|
229
|
+
useWorkspaceMachines
|
|
230
|
+
} from "./chunk-7HKGLPV5.js";
|
|
231
|
+
import {
|
|
232
|
+
OPEN_SESSION_USAGE_LIMIT_EVENT,
|
|
233
|
+
goalPausedAtUsageLimit,
|
|
234
|
+
lineageHasRunningSession,
|
|
235
|
+
sessionUsageLimitCapability,
|
|
236
|
+
usageLimitRefusalFromState,
|
|
237
|
+
useSessionUsageLimit
|
|
238
|
+
} from "./chunk-FREJ2WS3.js";
|
|
239
|
+
import {
|
|
240
|
+
connectorSelectionUpdate,
|
|
241
|
+
followWorkspaceConnectorPolicy,
|
|
242
|
+
sessionConnectorPolicyIsCustomized
|
|
243
|
+
} from "./chunk-L2EZ2HOX.js";
|
|
244
|
+
import {
|
|
245
|
+
ComposerSendBlockerNotice,
|
|
246
|
+
composerSendBlockerNotice,
|
|
247
|
+
getComposerSendBlocker,
|
|
248
|
+
pickerPolicyRunnable
|
|
249
|
+
} from "./chunk-LFQI2C46.js";
|
|
250
|
+
import {
|
|
251
|
+
coveredModelChoice,
|
|
252
|
+
creditRefusalGap,
|
|
253
|
+
freeCreditGap
|
|
254
|
+
} from "./chunk-U5D3K53R.js";
|
|
255
|
+
import {
|
|
256
|
+
githubAppConnectRequest
|
|
257
|
+
} from "./chunk-LCTGE6YK.js";
|
|
258
|
+
import {
|
|
259
|
+
catalogConnectionAccountSelection,
|
|
260
|
+
oauthConnectionOwnership,
|
|
261
|
+
oauthConnectionRef,
|
|
262
|
+
oauthResumeAction
|
|
263
|
+
} from "./chunk-3IZD3YKQ.js";
|
|
264
|
+
import {
|
|
265
|
+
EMPTY_COMPOSER_LAUNCH,
|
|
266
|
+
composerLaunchSearchAfterPolicyApply,
|
|
267
|
+
composerLaunchSearchKey
|
|
268
|
+
} from "./chunk-Y3YJJL7X.js";
|
|
269
|
+
import {
|
|
270
|
+
observeSessionTurnEvents
|
|
271
|
+
} from "./chunk-55S3W7RZ.js";
|
|
272
|
+
import {
|
|
273
|
+
startMcpOAuthWithTimeout
|
|
274
|
+
} from "./chunk-HUKUDAIP.js";
|
|
275
|
+
import {
|
|
276
|
+
useFollowUpRepositories
|
|
277
|
+
} from "./chunk-4UVSWAT3.js";
|
|
278
|
+
import {
|
|
279
|
+
useWorkspaceModelCatalog
|
|
280
|
+
} from "./chunk-DFH3M7B3.js";
|
|
281
|
+
import {
|
|
282
|
+
ConsoleComposer
|
|
283
|
+
} from "./chunk-XLFPJVQS.js";
|
|
284
|
+
import {
|
|
285
|
+
useSessionRouteMemory
|
|
286
|
+
} from "./chunk-BIFVQ3GP.js";
|
|
287
|
+
import {
|
|
288
|
+
CONSOLE_TIMELINE_ALLOWANCE_LABELS
|
|
289
|
+
} from "./chunk-OF22GYK5.js";
|
|
290
|
+
import {
|
|
291
|
+
useSessionUiFeature
|
|
292
|
+
} from "./chunk-FWXMQTVG.js";
|
|
293
|
+
import {
|
|
294
|
+
ModelPicker
|
|
295
|
+
} from "./chunk-SYDF57KS.js";
|
|
296
|
+
import {
|
|
297
|
+
isApiErrorStatus,
|
|
298
|
+
useAppApi
|
|
299
|
+
} from "./chunk-7CBEL7FY.js";
|
|
300
|
+
import {
|
|
301
|
+
LoadingPanel,
|
|
302
|
+
ProblemPanel
|
|
303
|
+
} from "./chunk-57SYHNG5.js";
|
|
304
|
+
import {
|
|
305
|
+
useBrowserAccountBridgeBlocker
|
|
306
|
+
} from "./chunk-7LP3W5H5.js";
|
|
307
|
+
import {
|
|
308
|
+
creationHandoffReconciled
|
|
309
|
+
} from "./chunk-UKZ3SGNF.js";
|
|
310
|
+
import {
|
|
311
|
+
markIntegrationConnectRedirect
|
|
312
|
+
} from "./chunk-ZEOWTFDQ.js";
|
|
313
|
+
import {
|
|
314
|
+
mergeSessionContextProjection,
|
|
315
|
+
mergeSessionDetailReadProjection
|
|
316
|
+
} from "./chunk-PL325D3F.js";
|
|
317
|
+
import {
|
|
318
|
+
creditRefusalRecord
|
|
319
|
+
} from "./chunk-OZNF2JEJ.js";
|
|
320
|
+
import {
|
|
321
|
+
useSimplifiedInterface
|
|
322
|
+
} from "./chunk-Z7PXQLGK.js";
|
|
323
|
+
import {
|
|
324
|
+
clientFirstPartyMcpToolPolicy,
|
|
325
|
+
firstPartySessionToolOptionsFor,
|
|
326
|
+
sessionPolicyPickerIds
|
|
327
|
+
} from "./chunk-AK2634UU.js";
|
|
328
|
+
import {
|
|
329
|
+
t
|
|
330
|
+
} from "./chunk-3PMO2BIV.js";
|
|
331
|
+
import {
|
|
332
|
+
canConnectWorkspaceMcpFromChat,
|
|
333
|
+
hasAccountPermission,
|
|
334
|
+
hasWorkspacePermission
|
|
335
|
+
} from "./chunk-EQSXKGTW.js";
|
|
336
|
+
import {
|
|
337
|
+
isPersonalWorkspace
|
|
338
|
+
} from "./chunk-LBSXJVHD.js";
|
|
339
|
+
import {
|
|
340
|
+
toast
|
|
341
|
+
} from "./chunk-O4EA4F3W.js";
|
|
342
|
+
import {
|
|
343
|
+
useNavigate,
|
|
344
|
+
usePage,
|
|
345
|
+
useRouterState
|
|
346
|
+
} from "./chunk-C52N45PY.js";
|
|
347
|
+
import {
|
|
348
|
+
createSessionEventFeedStore,
|
|
349
|
+
useAppContext
|
|
350
|
+
} from "./chunk-7GGVDTCZ.js";
|
|
351
|
+
import {
|
|
352
|
+
WORKBENCH_TAB_CHANGES,
|
|
353
|
+
initialWorkspaceTab,
|
|
354
|
+
sessionAuthRecommendation
|
|
355
|
+
} from "./chunk-ZGV76PZ4.js";
|
|
356
|
+
import {
|
|
357
|
+
useSessionSecrets
|
|
358
|
+
} from "./chunk-E66NENKJ.js";
|
|
359
|
+
import {
|
|
360
|
+
SessionAdmissionNotice,
|
|
361
|
+
SessionMachineAccessNotice
|
|
362
|
+
} from "./chunk-22E2YJHT.js";
|
|
363
|
+
import {
|
|
364
|
+
ApprovalSurface,
|
|
365
|
+
MessageTimeline,
|
|
366
|
+
SessionChrome,
|
|
367
|
+
useLiveSessionEvents
|
|
368
|
+
} from "./chunk-UN37ZY6R.js";
|
|
369
|
+
import {
|
|
370
|
+
AuthNeededRow
|
|
371
|
+
} from "./chunk-FVU52L3I.js";
|
|
372
|
+
import {
|
|
373
|
+
KnowledgeActivityProvider,
|
|
374
|
+
LearningRefusalActionsProvider,
|
|
375
|
+
ToolActionReviewDetails,
|
|
376
|
+
ToolReviewHistoryProvider,
|
|
377
|
+
createSessionRetainedScreenshotLoader,
|
|
378
|
+
createWorkspaceRetainedArtifactLoader,
|
|
379
|
+
createWorkspaceRetainedVideoLoader
|
|
380
|
+
} from "./chunk-5KQD6MLJ.js";
|
|
381
|
+
import {
|
|
382
|
+
isPersonalMachine,
|
|
383
|
+
machineUseMessage,
|
|
384
|
+
personalMachineUseIntent
|
|
385
|
+
} from "./chunk-CNQMJH2Q.js";
|
|
386
|
+
import {
|
|
387
|
+
useHostMessageContext,
|
|
388
|
+
useReportSessionState
|
|
389
|
+
} from "./chunk-BFBHLYNE.js";
|
|
390
|
+
import {
|
|
391
|
+
SessionUsageLimitNotice
|
|
392
|
+
} from "./chunk-F5VWPREQ.js";
|
|
393
|
+
import {
|
|
394
|
+
sessionAgentsSignal
|
|
395
|
+
} from "./chunk-5TJ5LLWK.js";
|
|
396
|
+
import {
|
|
397
|
+
loadSessionFeedback,
|
|
398
|
+
turnRatingsFromFeedback
|
|
399
|
+
} from "./chunk-EKBP5ERC.js";
|
|
400
|
+
import {
|
|
401
|
+
useSessionLineage
|
|
402
|
+
} from "./chunk-MYIBFGSQ.js";
|
|
403
|
+
import {
|
|
404
|
+
conversationTimeline,
|
|
405
|
+
useGoal,
|
|
406
|
+
useHumanInputRequests,
|
|
407
|
+
useSession,
|
|
408
|
+
useSessionEvents,
|
|
409
|
+
useSessionStartupTimeline,
|
|
410
|
+
useTurnQueue
|
|
411
|
+
} from "./chunk-MWN7LDYV.js";
|
|
412
|
+
import {
|
|
413
|
+
SessionStartupProvider
|
|
414
|
+
} from "./chunk-D6LH6JPE.js";
|
|
415
|
+
import {
|
|
416
|
+
uploadScopeForSession,
|
|
417
|
+
useFileAttachments
|
|
418
|
+
} from "./chunk-IE5MZEOM.js";
|
|
419
|
+
import {
|
|
420
|
+
approvalsDecidable,
|
|
421
|
+
projectPendingApprovals
|
|
422
|
+
} from "./chunk-IYSYSNAV.js";
|
|
423
|
+
import {
|
|
424
|
+
creditExhaustedFromEvents,
|
|
425
|
+
creditRefusalFromEvents,
|
|
426
|
+
timelineLivePause
|
|
427
|
+
} from "./chunk-ZYF64QOB.js";
|
|
428
|
+
import {
|
|
429
|
+
admissionControlNeedsRefresh,
|
|
430
|
+
admissionRecheckControl,
|
|
431
|
+
allowMachineForChat,
|
|
432
|
+
currentSessionMachineAccess,
|
|
433
|
+
recheckSessionAdmission,
|
|
434
|
+
sessionAdmissionNeedsDifferentMachine,
|
|
435
|
+
sessionAdmissionReason,
|
|
436
|
+
sessionAdmissionShowsMachineAccess
|
|
437
|
+
} from "./chunk-MRNAHGBL.js";
|
|
438
|
+
import {
|
|
439
|
+
sessionAttentionReadThroughSequence
|
|
440
|
+
} from "./chunk-IOBL5KYR.js";
|
|
441
|
+
import {
|
|
442
|
+
connectorLogo,
|
|
443
|
+
connectorLogoIndex
|
|
444
|
+
} from "./chunk-I5UOUBST.js";
|
|
445
|
+
import {
|
|
446
|
+
useUiEventTarget
|
|
447
|
+
} from "./chunk-WGPLDFEC.js";
|
|
448
|
+
import {
|
|
449
|
+
cn
|
|
450
|
+
} from "./chunk-A3MTTRCX.js";
|
|
451
|
+
import {
|
|
452
|
+
LazyPart,
|
|
453
|
+
retainedImageId
|
|
454
|
+
} from "./chunk-WFC2JA6D.js";
|
|
455
|
+
import {
|
|
456
|
+
EmptyState
|
|
457
|
+
} from "./chunk-2SXBLCWQ.js";
|
|
458
|
+
import {
|
|
459
|
+
apiErrorFacts,
|
|
460
|
+
userErrorText
|
|
461
|
+
} from "./chunk-UJQMDNZ5.js";
|
|
462
|
+
import {
|
|
463
|
+
OpenGeniLinkProvider
|
|
464
|
+
} from "./chunk-W4QUDV6Y.js";
|
|
465
|
+
import {
|
|
466
|
+
isCodexProductModel,
|
|
467
|
+
sessionDisplayTitle,
|
|
468
|
+
sessionHasPendingWake,
|
|
469
|
+
sessionInputWait,
|
|
470
|
+
withLineageAutomationFacts
|
|
471
|
+
} from "./chunk-UHLKKDNF.js";
|
|
472
|
+
import {
|
|
473
|
+
promptSendDestination,
|
|
474
|
+
sessionAdmissionBlocked,
|
|
475
|
+
sessionDisplayStatus,
|
|
476
|
+
sessionTurnKeepsRunControl
|
|
477
|
+
} from "./chunk-DG5DQFS4.js";
|
|
478
|
+
import {
|
|
479
|
+
InteractiveAnswerProvider,
|
|
480
|
+
browserInteractiveAnswerStore
|
|
481
|
+
} from "./chunk-OONTDHBV.js";
|
|
482
|
+
import {
|
|
483
|
+
authNeededPresentation
|
|
484
|
+
} from "./chunk-5R3Z7JFD.js";
|
|
485
|
+
import {
|
|
486
|
+
stopOwnLoginsHere,
|
|
487
|
+
turnOnOwnLoginsHere
|
|
488
|
+
} from "./chunk-SDFG5Q4G.js";
|
|
489
|
+
import {
|
|
490
|
+
attachSessionCapability,
|
|
491
|
+
completeSessionCapabilityOAuth,
|
|
492
|
+
continueAfterCapabilitySetup
|
|
493
|
+
} from "./chunk-ALLBOTP7.js";
|
|
494
|
+
import {
|
|
495
|
+
inertProps
|
|
496
|
+
} from "./chunk-USG4XNMA.js";
|
|
497
|
+
import {
|
|
498
|
+
MACHINES_SESSION_POLL_MS
|
|
499
|
+
} from "./chunk-QZ4U2VL5.js";
|
|
500
|
+
import {
|
|
501
|
+
machineDisplayName,
|
|
502
|
+
sessionComputeLabel
|
|
503
|
+
} from "./chunk-2TBRW7I6.js";
|
|
504
|
+
import {
|
|
505
|
+
useCalmServiceFailure,
|
|
506
|
+
useComposerWithStreamState
|
|
507
|
+
} from "./chunk-SVKPSCTH.js";
|
|
508
|
+
import {
|
|
509
|
+
useQueuedPromptRecall
|
|
510
|
+
} from "./chunk-2NPJEEJ5.js";
|
|
511
|
+
import {
|
|
512
|
+
useComposer
|
|
513
|
+
} from "./chunk-TDW5CSO5.js";
|
|
514
|
+
import {
|
|
515
|
+
LightboxProvider
|
|
516
|
+
} from "./chunk-VM2NA2EL.js";
|
|
517
|
+
import {
|
|
518
|
+
Button
|
|
519
|
+
} from "./chunk-7QQN3KNP.js";
|
|
520
|
+
import {
|
|
521
|
+
usePortalContainer
|
|
522
|
+
} from "./chunk-UD6AAZSC.js";
|
|
523
|
+
import {
|
|
524
|
+
isModelUnavailableSubmissionError,
|
|
525
|
+
isSessionUsageLimitSubmissionError
|
|
526
|
+
} from "./chunk-UIK52VL4.js";
|
|
527
|
+
import {
|
|
528
|
+
useDebouncedCallback,
|
|
529
|
+
useSessionEventTrigger
|
|
530
|
+
} from "./chunk-SW4S6I5E.js";
|
|
531
|
+
import {
|
|
532
|
+
useOpenGeni
|
|
533
|
+
} from "./chunk-BVUAHAQX.js";
|
|
534
|
+
import {
|
|
535
|
+
findPickerRow
|
|
536
|
+
} from "./chunk-4VEIBNC2.js";
|
|
537
|
+
|
|
538
|
+
// src/app/routes/session.tsx
|
|
539
|
+
import { Fragment } from "react";
|
|
540
|
+
|
|
541
|
+
// src/app/routes/session-capability-oauth-return.ts
|
|
542
|
+
async function finishMcpCapabilityOAuthReturn(input) {
|
|
543
|
+
const { client, workspaceId, sessionId, params } = input;
|
|
544
|
+
const item = input.catalog.find((candidate) => candidate.id === input.capabilityId);
|
|
545
|
+
const connectionId = params.get("connectionId");
|
|
546
|
+
const providerDomain = params.get("providerDomain");
|
|
547
|
+
const ownership = oauthConnectionOwnership(params.get("ownership"));
|
|
548
|
+
if (!item || item.kind !== "mcp" || !connectionId || !providerDomain || !ownership) {
|
|
549
|
+
throw new Error("The authorized capability could not be resolved from the live catalog.");
|
|
550
|
+
}
|
|
551
|
+
const current = params.get("capability") ? (await client.listCapabilities(workspaceId)).items.find(
|
|
552
|
+
(candidate) => candidate.id === item.id
|
|
553
|
+
) ?? item : item;
|
|
554
|
+
if (oauthResumeAction(current, connectionId) !== "reconnect") {
|
|
555
|
+
await client.enableCapability(workspaceId, item.id, {
|
|
556
|
+
connectionRef: oauthConnectionRef(
|
|
557
|
+
ownership,
|
|
558
|
+
connectionId,
|
|
559
|
+
providerDomain,
|
|
560
|
+
catalogConnectionAccountSelection(current)
|
|
561
|
+
)
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
await input.refreshCatalog(workspaceId);
|
|
565
|
+
const connected = (await client.listCapabilities(workspaceId)).items.find(
|
|
566
|
+
(candidate) => candidate.id === item.id
|
|
567
|
+
);
|
|
568
|
+
if (!connected?.enabled)
|
|
569
|
+
throw new Error("The connection was authorized, but enabling its tools could not be verified.");
|
|
570
|
+
if (connected.connectionRef?.subjectScope === "subject")
|
|
571
|
+
return { name: item.name, needsPersonalReview: true };
|
|
572
|
+
await attachSessionCapability(t, client, workspaceId, sessionId, connected);
|
|
573
|
+
continueAfterCapabilitySetup(client, workspaceId, sessionId, connected.id);
|
|
574
|
+
return { name: item.name, needsPersonalReview: false };
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
// src/app/lib/session-composer-readiness.ts
|
|
578
|
+
import { useCallback, useLayoutEffect, useMemo, useState } from "react";
|
|
579
|
+
function useSessionSendGate() {
|
|
580
|
+
const [committedPolicyValid, commitPolicyValid] = useState(false);
|
|
581
|
+
const blocker = useCallback(
|
|
582
|
+
(state) => getComposerSendBlocker({
|
|
583
|
+
uploadPending: state.uploadPending,
|
|
584
|
+
repositoryError: state.repositoryError,
|
|
585
|
+
policyValid: committedPolicyValid,
|
|
586
|
+
personalDecision: state.personalDecision,
|
|
587
|
+
machineAccessDenied: state.machineAccessDenied,
|
|
588
|
+
personalLoading: state.loading,
|
|
589
|
+
loadFailed: state.loadFailed
|
|
590
|
+
}),
|
|
591
|
+
[committedPolicyValid]
|
|
592
|
+
);
|
|
593
|
+
return { committedPolicyValid, commitPolicyValid, blocker };
|
|
594
|
+
}
|
|
595
|
+
function useSessionComposerDelivery(composer, gate, {
|
|
596
|
+
policyValid,
|
|
597
|
+
catalogLoading,
|
|
598
|
+
replacingModel,
|
|
599
|
+
send
|
|
600
|
+
}) {
|
|
601
|
+
const { commitPolicyValid, committedPolicyValid } = gate;
|
|
602
|
+
useLayoutEffect(() => {
|
|
603
|
+
commitPolicyValid(policyValid);
|
|
604
|
+
}, [commitPolicyValid, policyValid]);
|
|
605
|
+
const preparing = composer.preparing === true || policyValid !== committedPolicyValid || catalogLoading && !policyValid || replacingModel || send.loading;
|
|
606
|
+
return useMemo(
|
|
607
|
+
() => composer.preparing === true === preparing ? composer : { ...composer, preparing },
|
|
608
|
+
[composer, preparing]
|
|
609
|
+
);
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
// src/app/routes/session.tsx
|
|
613
|
+
import { reserveBrowserConnectNavigation } from "@opengeni/connect/browser-navigation";
|
|
614
|
+
|
|
615
|
+
// src/app/lib/use-descendant-requests-refresh.ts
|
|
616
|
+
import { useCallback as useCallback2, useEffect, useMemo as useMemo2, useRef, useState as useState2 } from "react";
|
|
617
|
+
var LINEAGE_POLL_MS = 3e4;
|
|
618
|
+
var LINEAGE_POLL_ACTIVE_WITHOUT_HINTS_MS = 15e3;
|
|
619
|
+
function treeNeedsWatching(nodes) {
|
|
620
|
+
return descendantsRunning(nodes) || waitingDescendants(nodes).length > 0;
|
|
621
|
+
}
|
|
622
|
+
function useLineagePollInterval(workspaceId) {
|
|
623
|
+
const { workspaceSessionListEvent } = useOpenGeni();
|
|
624
|
+
const [active, setActive] = useState2(false);
|
|
625
|
+
const observeTree = useCallback2(
|
|
626
|
+
(nodes) => setActive(treeNeedsWatching(nodes)),
|
|
627
|
+
[]
|
|
628
|
+
);
|
|
629
|
+
const live = workspaceSessionListEvent?.workspaceId === workspaceId && workspaceSessionListEvent.available === true;
|
|
630
|
+
return {
|
|
631
|
+
pollIntervalMs: !live && active ? LINEAGE_POLL_ACTIVE_WITHOUT_HINTS_MS : LINEAGE_POLL_MS,
|
|
632
|
+
observeTree
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
function useDescendantRequestsRefresh(options) {
|
|
636
|
+
const { client, workspaceId, sessionId, events, nodes, refreshLineage } = options;
|
|
637
|
+
const { workspaceSessionListEvent } = useOpenGeni();
|
|
638
|
+
const [signal, setSignal] = useState2(0);
|
|
639
|
+
const refreshLineageRef = useRef(refreshLineage);
|
|
640
|
+
useEffect(() => {
|
|
641
|
+
refreshLineageRef.current = refreshLineage;
|
|
642
|
+
}, [refreshLineage]);
|
|
643
|
+
const refreshTreeSoon = useDebouncedCallback(() => {
|
|
644
|
+
void refreshLineageRef.current();
|
|
645
|
+
}, 150);
|
|
646
|
+
const refreshAllSoon = useDebouncedCallback(() => {
|
|
647
|
+
void refreshLineageRef.current();
|
|
648
|
+
setSignal((value) => value + 1);
|
|
649
|
+
}, 150);
|
|
650
|
+
const tree = useMemo2(
|
|
651
|
+
() => ({ ids: lineageSessionIds(nodes), running: descendantsRunning(nodes) }),
|
|
652
|
+
[nodes]
|
|
653
|
+
);
|
|
654
|
+
const treeRef = useRef(tree);
|
|
655
|
+
useEffect(() => {
|
|
656
|
+
treeRef.current = tree;
|
|
657
|
+
}, [tree]);
|
|
658
|
+
useEffect(() => {
|
|
659
|
+
const hint = workspaceSessionListEvent;
|
|
660
|
+
if (!hint || hint.workspaceId !== workspaceId || !hint.available) return;
|
|
661
|
+
if (document.visibilityState === "hidden") return;
|
|
662
|
+
const current = treeRef.current;
|
|
663
|
+
const unseen = current.running && (hint.sessionIds ?? []).some((id) => id !== sessionId && !current.ids.has(id));
|
|
664
|
+
if (hintTouchesTree(hint, current.ids) || unseen) refreshTreeSoon();
|
|
665
|
+
}, [refreshTreeSoon, sessionId, workspaceId, workspaceSessionListEvent]);
|
|
666
|
+
const responseCallIds = useMemo2(() => subSessionResponseCallIds(events), [events]);
|
|
667
|
+
const matchResponse = useCallback2(
|
|
668
|
+
(event) => isSubSessionResponseOutput(event, responseCallIds),
|
|
669
|
+
[responseCallIds]
|
|
670
|
+
);
|
|
671
|
+
const [history, setHistory] = useState2(null);
|
|
672
|
+
const newest = events.at(-1);
|
|
673
|
+
if (newest && newest.sessionId === sessionId && history?.sessionId !== sessionId) {
|
|
674
|
+
setHistory({ sessionId, through: newest.sequence });
|
|
675
|
+
}
|
|
676
|
+
const readThrough = history?.sessionId === sessionId ? history.through : "reading";
|
|
677
|
+
const onResponse = useCallback2(() => refreshAllSoon(), [refreshAllSoon]);
|
|
678
|
+
useSessionEventTrigger(client, workspaceId, sessionId, matchResponse, onResponse, {
|
|
679
|
+
events,
|
|
680
|
+
readThrough
|
|
681
|
+
});
|
|
682
|
+
return signal;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
// src/app/routes/session.tsx
|
|
686
|
+
import { OpenGeniApiError, OpenGeniSessionUsageLimitReachedError } from "@opengeni/sdk/browser";
|
|
687
|
+
import { SESSION_USAGE_LIMIT_GOAL_PAUSED_REASON } from "@opengeni/sdk/session-usage-limits";
|
|
688
|
+
import {
|
|
689
|
+
BugIcon,
|
|
690
|
+
GitPullRequestIcon,
|
|
691
|
+
LinkIcon,
|
|
692
|
+
Loader2Icon,
|
|
693
|
+
MenuIcon,
|
|
694
|
+
MessagesSquareIcon,
|
|
695
|
+
PanelsTopLeftIcon,
|
|
696
|
+
SettingsIcon
|
|
697
|
+
} from "lucide-react";
|
|
698
|
+
import {
|
|
699
|
+
createElement,
|
|
700
|
+
lazy,
|
|
701
|
+
Suspense,
|
|
702
|
+
useCallback as useCallback3,
|
|
703
|
+
useEffect as useEffect4,
|
|
704
|
+
useLayoutEffect as useLayoutEffect2,
|
|
705
|
+
useMemo as useMemo3,
|
|
706
|
+
useRef as useRef2,
|
|
707
|
+
useState as useState3
|
|
708
|
+
} from "react";
|
|
709
|
+
|
|
710
|
+
// src/app/lib/session-failure-toasts.ts
|
|
711
|
+
import { useEffect as useEffect2 } from "react";
|
|
712
|
+
function useSessionFailureToasts(loadError, streamError) {
|
|
713
|
+
const streamCalm = useCalmServiceFailure(streamError);
|
|
714
|
+
const loadCalm = useCalmServiceFailure(loadError);
|
|
715
|
+
useEffect2(() => {
|
|
716
|
+
if (streamError && !streamCalm && !isApiErrorStatus(streamError, 404)) {
|
|
717
|
+
toast.error("Event stream disconnected", {
|
|
718
|
+
description: userErrorText(streamError)
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
}, [streamCalm, streamError]);
|
|
722
|
+
useEffect2(() => {
|
|
723
|
+
if (loadError && !loadCalm && !isApiErrorStatus(loadError, 404)) {
|
|
724
|
+
toast.error("Failed to load session", { description: userErrorText(loadError) });
|
|
725
|
+
}
|
|
726
|
+
}, [loadCalm, loadError]);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
// src/app/lib/session-route-placement.ts
|
|
730
|
+
function ignoreRoutedUpdate() {
|
|
731
|
+
}
|
|
732
|
+
function sessionRouteAppState(placement, context, panelEventFeed) {
|
|
733
|
+
if (placement === "page") {
|
|
734
|
+
return {
|
|
735
|
+
routed: true,
|
|
736
|
+
setSession: context.setSession,
|
|
737
|
+
setConnectionState: context.setConnectionState,
|
|
738
|
+
sessionEventFeedStore: context.sessionEventFeedStore
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
return {
|
|
742
|
+
routed: false,
|
|
743
|
+
setSession: ignoreRoutedUpdate,
|
|
744
|
+
setConnectionState: ignoreRoutedUpdate,
|
|
745
|
+
sessionEventFeedStore: panelEventFeed
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
function sessionRouteCreationHandoff(input) {
|
|
749
|
+
const { sessionId, given, app, appSession, routed } = input;
|
|
750
|
+
if (given?.session.id === sessionId) return given;
|
|
751
|
+
if (routed && app?.session.id === sessionId && appSession?.id === sessionId) return app;
|
|
752
|
+
return null;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
// src/app/lib/find-shortcut.ts
|
|
756
|
+
import { useEffect as useEffect3 } from "react";
|
|
757
|
+
function useFindShortcut(input, open) {
|
|
758
|
+
const { scope } = input;
|
|
759
|
+
useEffect3(() => {
|
|
760
|
+
if (!scope) return;
|
|
761
|
+
const onKeyDown = (event) => {
|
|
762
|
+
if (!(event.ctrlKey || event.metaKey) || event.altKey || event.shiftKey || event.key.toLowerCase() !== "f")
|
|
763
|
+
return;
|
|
764
|
+
const target2 = event.target;
|
|
765
|
+
if (target2 instanceof Element && target2.closest('[role="dialog"], .cm-editor, .xterm, [data-native-find]'))
|
|
766
|
+
return;
|
|
767
|
+
event.preventDefault();
|
|
768
|
+
open();
|
|
769
|
+
};
|
|
770
|
+
scope.addEventListener("keydown", onKeyDown);
|
|
771
|
+
return () => scope.removeEventListener("keydown", onKeyDown);
|
|
772
|
+
}, [open, scope]);
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
// src/app/lib/pinned-account-wait.ts
|
|
776
|
+
var PINNED_ACCOUNT_WAIT_REASONS = /* @__PURE__ */ new Set([
|
|
777
|
+
"pinned_account_unavailable",
|
|
778
|
+
"pinned_account_disabled",
|
|
779
|
+
"pinned_account_ineligible"
|
|
780
|
+
]);
|
|
781
|
+
var WAIT_EVENT_PROVIDERS = {
|
|
782
|
+
"claude-subscription": "claude",
|
|
783
|
+
"supergrok-subscription": "xai"
|
|
784
|
+
};
|
|
785
|
+
function pinnedAccountWait(session, events) {
|
|
786
|
+
if (session.status !== "waiting_capacity") return null;
|
|
787
|
+
let latest = null;
|
|
788
|
+
for (const event of events) {
|
|
789
|
+
if (event.type !== "codex.capacity.waiting" && event.type !== "turn.capacity_waiting") continue;
|
|
790
|
+
if (!latest || event.sequence > latest.sequence) latest = event;
|
|
791
|
+
}
|
|
792
|
+
if (!latest) return null;
|
|
793
|
+
if (session.activeTurnId && latest.turnId && latest.turnId !== session.activeTurnId) return null;
|
|
794
|
+
const payload = latest.payload ?? {};
|
|
795
|
+
const reason = payload.waitReason;
|
|
796
|
+
if (typeof reason !== "string" || !PINNED_ACCOUNT_WAIT_REASONS.has(reason)) return null;
|
|
797
|
+
const provider = latest.type === "codex.capacity.waiting" ? "codex" : WAIT_EVENT_PROVIDERS[String(payload.provider)];
|
|
798
|
+
if (!provider) return null;
|
|
799
|
+
const reset = payload.earliestResetAt ?? payload.resetsAt;
|
|
800
|
+
return {
|
|
801
|
+
provider,
|
|
802
|
+
reason,
|
|
803
|
+
resetsAt: typeof reset === "string" && !Number.isNaN(Date.parse(reset)) ? reset : null
|
|
804
|
+
};
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
// src/app/routes/session.tsx
|
|
808
|
+
import { resolveWorkspaceBusySend, stableJson } from "@opengeni/contracts";
|
|
809
|
+
import { connectProviderAcceptsRequestedScopes } from "@opengeni/contracts/connect";
|
|
810
|
+
|
|
811
|
+
// src/app/lib/connect-recovery-account.ts
|
|
812
|
+
async function findConnectRecoveryTarget(input) {
|
|
813
|
+
const here = input.find(await input.accounts(input.workspaceId), input.connectionId);
|
|
814
|
+
if (here) return target(here, input.workspaceId);
|
|
815
|
+
const own = (await input.ownAccounts().catch(() => [])).find(
|
|
816
|
+
(connection) => connection.id === input.connectionId && connection.subjectId !== null && connection.workspaceId !== input.workspaceId
|
|
817
|
+
);
|
|
818
|
+
if (!own) return null;
|
|
819
|
+
const elsewhere = input.find(
|
|
820
|
+
await input.accounts(own.workspaceId).catch(() => []),
|
|
821
|
+
input.connectionId
|
|
822
|
+
);
|
|
823
|
+
return elsewhere ? target(elsewhere, own.workspaceId) : null;
|
|
824
|
+
}
|
|
825
|
+
function target(account, workspaceId) {
|
|
826
|
+
return { account, workspaceId, via: account.backend ? "connector" : "native" };
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
// src/timeline/pending-connection-card.ts
|
|
830
|
+
function pendingConnectionCard(items, actionable) {
|
|
831
|
+
for (let index = items.length - 1; index >= 0; index -= 1) {
|
|
832
|
+
const item = items[index];
|
|
833
|
+
if (item.kind === "user-message") return null;
|
|
834
|
+
if (item.kind !== "auth-needed") continue;
|
|
835
|
+
if (item.setupFinished || item.askedAgainLater || !actionable(item)) return null;
|
|
836
|
+
return waitedOn(item) ? item : null;
|
|
837
|
+
}
|
|
838
|
+
return null;
|
|
839
|
+
}
|
|
840
|
+
function waitedOn(item) {
|
|
841
|
+
if (item.capability || item.setupRequest) return true;
|
|
842
|
+
return Boolean(item.toolName?.trim()) && item.providerDomain.trim().toLowerCase() !== "opengeni";
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
// src/app/routes/session.tsx
|
|
846
|
+
import { Fragment as Fragment2, jsx, jsxs } from "react/jsx-runtime";
|
|
847
|
+
var PULL_REQUEST_TAB = "pull-request";
|
|
848
|
+
var InlineChatArtifact = lazy(
|
|
849
|
+
() => import("./app/components/artifacts/retained-file-preview.js").then((module) => ({
|
|
850
|
+
default: module.InlineChatArtifact
|
|
851
|
+
}))
|
|
852
|
+
);
|
|
853
|
+
var ChatInteractiveBlock = lazy(
|
|
854
|
+
() => import("./app/components/artifacts/chat-interactive-block.js").then((module) => ({
|
|
855
|
+
default: module.ChatInteractiveBlock
|
|
856
|
+
}))
|
|
857
|
+
);
|
|
858
|
+
var HumanInputSurface = lazy(() => import("./app/components/session/human-input.js"));
|
|
859
|
+
var DescendantRequests = lazy(() => import("./app/components/session/descendant-requests.js"));
|
|
860
|
+
var SessionSkillReviews = lazy(
|
|
861
|
+
() => import("./app/components/session/session-skill-reviews.js").then((module) => ({
|
|
862
|
+
default: module.SessionSkillReviews
|
|
863
|
+
}))
|
|
864
|
+
);
|
|
865
|
+
var SessionCommands = lazy(
|
|
866
|
+
() => import("./session-ui.js").then((module) => ({ default: module.SessionCommands }))
|
|
867
|
+
);
|
|
868
|
+
var SessionCapabilityCard = lazy(async () => ({
|
|
869
|
+
default: (await import("./app/components/capabilities/session-capability-card.js")).SessionCapabilityCard
|
|
870
|
+
}));
|
|
871
|
+
var NativeConnectSetup = lazy(
|
|
872
|
+
() => import("./app/components/capabilities/native-connect-setup.js").then((module) => ({
|
|
873
|
+
default: module.NativeConnectSetup
|
|
874
|
+
}))
|
|
875
|
+
);
|
|
876
|
+
var MessageForkDialog = lazy(
|
|
877
|
+
() => import("./app/components/session/session-tenancy-control.js").then((module) => ({
|
|
878
|
+
default: module.SessionTenancyRouteControl
|
|
879
|
+
}))
|
|
880
|
+
);
|
|
881
|
+
var MessageActions = lazy(() => import("./app/components/session/message-actions.js"));
|
|
882
|
+
var ConversationFind = lazy(() => import("./app/components/session/conversation-find.js"));
|
|
883
|
+
var EMPTY_SEARCH_TARGET = {};
|
|
884
|
+
var SubagentTree = lazy(
|
|
885
|
+
() => import("./app/components/session/subagents.js").then((module) => ({ default: module.SubagentTree }))
|
|
886
|
+
);
|
|
887
|
+
var LazyFailedSessionBanner = lazy(
|
|
888
|
+
() => import("./app/components/session/failed-session-banner.js").then((module) => ({
|
|
889
|
+
default: module.FailedSessionBanner
|
|
890
|
+
}))
|
|
891
|
+
);
|
|
892
|
+
var LazyCreditRefusalNotice = lazy(
|
|
893
|
+
() => import("./app/components/credits/credit-refusal-notice.js").then((module) => ({
|
|
894
|
+
default: module.CreditRefusalNotice
|
|
895
|
+
}))
|
|
896
|
+
);
|
|
897
|
+
var LazyCreditTopupPrompt = lazy(
|
|
898
|
+
() => import("./app/components/credit-required-prompt.js").then((module) => ({
|
|
899
|
+
default: module.CreditRequiredPrompt
|
|
900
|
+
}))
|
|
901
|
+
);
|
|
902
|
+
var LazyAgentConfigurationPanel = lazy(
|
|
903
|
+
() => import("./app/components/session/agent-configuration-panel.js").then(({ AgentConfigurationPanel }) => ({
|
|
904
|
+
default: AgentConfigurationPanel
|
|
905
|
+
}))
|
|
906
|
+
);
|
|
907
|
+
var LazySessionInspector = lazy(
|
|
908
|
+
() => import("./app/components/session/inspector.js").then(({ SessionInspector }) => ({
|
|
909
|
+
default: SessionInspector
|
|
910
|
+
}))
|
|
911
|
+
);
|
|
912
|
+
var LazySessionEditableArtifactsWorkspace = lazy(
|
|
913
|
+
() => import("./app/components/session/editable-artifacts-workspace.js").then(
|
|
914
|
+
({ SessionEditableArtifactsWorkspace }) => ({
|
|
915
|
+
default: SessionEditableArtifactsWorkspace
|
|
916
|
+
})
|
|
917
|
+
)
|
|
918
|
+
);
|
|
919
|
+
var LazyCodexRealtimeControl = lazy(
|
|
920
|
+
() => import("./realtime.js").then(({ SessionRealtimeControl }) => ({
|
|
921
|
+
default: SessionRealtimeControl
|
|
922
|
+
}))
|
|
923
|
+
);
|
|
924
|
+
var LazySessionRouteAuxiliary = lazy(
|
|
925
|
+
() => import("./app/components/session/session-tenancy-control.js")
|
|
926
|
+
);
|
|
927
|
+
function SessionRoute({
|
|
928
|
+
workspaceId,
|
|
929
|
+
sessionId,
|
|
930
|
+
launch = EMPTY_COMPOSER_LAUNCH,
|
|
931
|
+
realtimeAutostartModel,
|
|
932
|
+
searchTarget = EMPTY_SEARCH_TARGET,
|
|
933
|
+
placement = "page",
|
|
934
|
+
onEvent,
|
|
935
|
+
messageContext,
|
|
936
|
+
creationHandoff: givenCreationHandoff,
|
|
937
|
+
initialDraft,
|
|
938
|
+
onNewSession,
|
|
939
|
+
onRealtimeAutostartConsumed
|
|
940
|
+
}) {
|
|
941
|
+
const uiEvents = useUiEventTarget("document");
|
|
942
|
+
const dockEnabled = useSessionUiFeature("dock");
|
|
943
|
+
useReadSessionInbox(sessionId);
|
|
944
|
+
const context = useAppContext();
|
|
945
|
+
const routed = placement === "page";
|
|
946
|
+
const rail = useRail();
|
|
947
|
+
const navigate = useNavigate();
|
|
948
|
+
const page = usePage();
|
|
949
|
+
const consumeRealtimeAutostart = useCallback3(() => {
|
|
950
|
+
if (onRealtimeAutostartConsumed) {
|
|
951
|
+
onRealtimeAutostartConsumed();
|
|
952
|
+
return;
|
|
953
|
+
}
|
|
954
|
+
void navigate({
|
|
955
|
+
to: "/workspaces/$workspaceId/sessions/$sessionId",
|
|
956
|
+
params: { workspaceId, sessionId },
|
|
957
|
+
search: {},
|
|
958
|
+
replace: true
|
|
959
|
+
});
|
|
960
|
+
}, [navigate, onRealtimeAutostartConsumed, sessionId, workspaceId]);
|
|
961
|
+
const hasSearchOrigin = searchTarget.searchOrigin === "session-search";
|
|
962
|
+
const consumeSearchOrigin = useCallback3(() => {
|
|
963
|
+
if (!hasSearchOrigin) return;
|
|
964
|
+
void navigate({
|
|
965
|
+
to: "/workspaces/$workspaceId/sessions/$sessionId",
|
|
966
|
+
params: { workspaceId, sessionId },
|
|
967
|
+
search: ({ searchOrigin: _searchOrigin, ...rest }) => rest,
|
|
968
|
+
replace: true
|
|
969
|
+
});
|
|
970
|
+
}, [hasSearchOrigin, navigate, sessionId, workspaceId]);
|
|
971
|
+
const {
|
|
972
|
+
events,
|
|
973
|
+
timeline: eventTimeline,
|
|
974
|
+
sessionStatus,
|
|
975
|
+
sessionStatusSequence,
|
|
976
|
+
connectionState,
|
|
977
|
+
initialLoading,
|
|
978
|
+
initialHistoryReady,
|
|
979
|
+
hasOlder,
|
|
980
|
+
loadingOlder,
|
|
981
|
+
loadOlder,
|
|
982
|
+
hasNewer,
|
|
983
|
+
loadingNewer,
|
|
984
|
+
loadNewer,
|
|
985
|
+
loadingOldest,
|
|
986
|
+
loadOldest,
|
|
987
|
+
jumpToLatest,
|
|
988
|
+
jumpToSequence,
|
|
989
|
+
error: streamError
|
|
990
|
+
} = useSessionEvents(sessionId);
|
|
991
|
+
useEffect4(() => observeSessionTurnEvents(sessionId, events), [events, sessionId]);
|
|
992
|
+
useLiveSessionEvents(sessionId, events, initialHistoryReady, onEvent);
|
|
993
|
+
useReportSessionState({ sessionId, status: sessionStatus, events, initialLoading }, routed);
|
|
994
|
+
const sessionDetailReadOwner = useRef2({});
|
|
995
|
+
const beginSessionDetailRead = useCallback3(
|
|
996
|
+
() => context.sessionChannelProjectionAuthority.beginDetailRead(sessionDetailReadOwner.current, {
|
|
997
|
+
id: sessionId,
|
|
998
|
+
workspaceId
|
|
999
|
+
}),
|
|
1000
|
+
[context.sessionChannelProjectionAuthority, sessionId, workspaceId]
|
|
1001
|
+
);
|
|
1002
|
+
const {
|
|
1003
|
+
session: fetchedSession,
|
|
1004
|
+
error: loadError,
|
|
1005
|
+
readRevision: sessionReadRevision,
|
|
1006
|
+
readGeneration: sessionReadGeneration,
|
|
1007
|
+
refresh: refreshSession
|
|
1008
|
+
} = useSession(sessionId, {
|
|
1009
|
+
events,
|
|
1010
|
+
beginRead: beginSessionDetailRead
|
|
1011
|
+
});
|
|
1012
|
+
const restoredSessionId = useRouterState({
|
|
1013
|
+
select: (state) => state.location.state.restoredSessionId
|
|
1014
|
+
});
|
|
1015
|
+
const leaveRestoredSession = useCallback3(() => {
|
|
1016
|
+
void navigate({
|
|
1017
|
+
to: "/workspaces/$workspaceId/sessions",
|
|
1018
|
+
params: { workspaceId },
|
|
1019
|
+
replace: true
|
|
1020
|
+
});
|
|
1021
|
+
}, [navigate, workspaceId]);
|
|
1022
|
+
const leavingRestoredSession = useSessionRouteMemory({
|
|
1023
|
+
subjectId: context.accessContext.subjectId,
|
|
1024
|
+
workspaceId,
|
|
1025
|
+
sessionId,
|
|
1026
|
+
openedSessionId: fetchedSession?.id ?? null,
|
|
1027
|
+
loadError,
|
|
1028
|
+
restoredSessionId,
|
|
1029
|
+
leave: leaveRestoredSession,
|
|
1030
|
+
enabled: routed
|
|
1031
|
+
});
|
|
1032
|
+
useEffect4(
|
|
1033
|
+
() => () => context.sessionChannelProjectionAuthority.finishDetailReads(sessionDetailReadOwner.current),
|
|
1034
|
+
[context.sessionChannelProjectionAuthority, sessionId, workspaceId]
|
|
1035
|
+
);
|
|
1036
|
+
useEffect4(() => {
|
|
1037
|
+
if (loadError) {
|
|
1038
|
+
context.sessionChannelProjectionAuthority.finishDetailReads(sessionDetailReadOwner.current);
|
|
1039
|
+
}
|
|
1040
|
+
}, [context.sessionChannelProjectionAuthority, loadError]);
|
|
1041
|
+
const creationHandoff = sessionRouteCreationHandoff({
|
|
1042
|
+
sessionId,
|
|
1043
|
+
given: givenCreationHandoff,
|
|
1044
|
+
app: context.sessionCreationHandoff,
|
|
1045
|
+
appSession: context.session,
|
|
1046
|
+
routed
|
|
1047
|
+
});
|
|
1048
|
+
const pendingCreationHandoff = creationHandoffReconciled(creationHandoff, events) ? null : creationHandoff;
|
|
1049
|
+
const queue = useTurnQueue(sessionId, { events });
|
|
1050
|
+
const goal = useGoal(sessionId, { events });
|
|
1051
|
+
const humanInput = useHumanInputRequests(sessionId, { events });
|
|
1052
|
+
const sessionSeed = fetchedSession ?? creationHandoff?.session ?? null;
|
|
1053
|
+
const session = useMemo3(
|
|
1054
|
+
() => sessionSeed ? {
|
|
1055
|
+
...sessionSeed,
|
|
1056
|
+
// Old idle events must not overwrite a fresh queued/claimed detail read.
|
|
1057
|
+
status: (sessionStatusSequence ?? 0) > sessionSeed.lastSequence ? sessionStatus ?? sessionSeed.status : sessionSeed.status,
|
|
1058
|
+
effectiveControl: queue.effectiveControl ?? sessionSeed.effectiveControl
|
|
1059
|
+
} : null,
|
|
1060
|
+
[queue.effectiveControl, sessionSeed, sessionStatus, sessionStatusSequence]
|
|
1061
|
+
);
|
|
1062
|
+
useBackgroundAttentionTitle(sessionId, session?.status ?? null);
|
|
1063
|
+
const waitingForDispatch = session?.status === "queued" && session.activeTurnId === null && session.effectiveControl.state === "active";
|
|
1064
|
+
useEffect4(() => {
|
|
1065
|
+
if (!waitingForDispatch) return;
|
|
1066
|
+
let stopped = false;
|
|
1067
|
+
let timer;
|
|
1068
|
+
const refresh = async () => {
|
|
1069
|
+
try {
|
|
1070
|
+
if (document.visibilityState === "visible") await refreshSession();
|
|
1071
|
+
} finally {
|
|
1072
|
+
if (!stopped) timer = setTimeout(() => void refresh(), 15e3);
|
|
1073
|
+
}
|
|
1074
|
+
};
|
|
1075
|
+
timer = setTimeout(() => void refresh(), 15e3);
|
|
1076
|
+
return () => {
|
|
1077
|
+
stopped = true;
|
|
1078
|
+
clearTimeout(timer);
|
|
1079
|
+
};
|
|
1080
|
+
}, [waitingForDispatch, sessionId, refreshSession]);
|
|
1081
|
+
const restoringArchive = session?.retention?.archive?.restoring === true;
|
|
1082
|
+
useEffect4(() => {
|
|
1083
|
+
if (!restoringArchive) return;
|
|
1084
|
+
const timer = setInterval(() => {
|
|
1085
|
+
if (document.visibilityState === "visible") void refreshSession();
|
|
1086
|
+
}, 3e3);
|
|
1087
|
+
return () => clearInterval(timer);
|
|
1088
|
+
}, [restoringArchive, sessionId, refreshSession]);
|
|
1089
|
+
const restoreArchived = useCallback3(async () => {
|
|
1090
|
+
if (!session) return false;
|
|
1091
|
+
try {
|
|
1092
|
+
const updated = await requestSessionArchive(
|
|
1093
|
+
context,
|
|
1094
|
+
session,
|
|
1095
|
+
false,
|
|
1096
|
+
sessionDisplayTitle(session)
|
|
1097
|
+
);
|
|
1098
|
+
if (!updated) return false;
|
|
1099
|
+
notifySessionListChanged({ workspaceId, sessionId: session.id, archived: updated.archived });
|
|
1100
|
+
await refreshSession();
|
|
1101
|
+
return true;
|
|
1102
|
+
} catch (error) {
|
|
1103
|
+
toast.error("Couldn't restore the chat.", { description: userErrorText(error) });
|
|
1104
|
+
return false;
|
|
1105
|
+
}
|
|
1106
|
+
}, [context, refreshSession, session, workspaceId]);
|
|
1107
|
+
const [viewClearedAfter, setViewClearedAfter] = useState3(null);
|
|
1108
|
+
useEffect4(() => {
|
|
1109
|
+
setViewClearedAfter(null);
|
|
1110
|
+
}, [sessionId]);
|
|
1111
|
+
const clearView = useCallback3(() => {
|
|
1112
|
+
const latestSequence = events.reduce((max, event) => Math.max(max, event.sequence), 0);
|
|
1113
|
+
setViewClearedAfter(latestSequence);
|
|
1114
|
+
}, [events]);
|
|
1115
|
+
const visibleEvents = useMemo3(
|
|
1116
|
+
() => viewClearedAfter !== null ? events.filter((event) => event.sequence > viewClearedAfter) : events,
|
|
1117
|
+
[events, viewClearedAfter]
|
|
1118
|
+
);
|
|
1119
|
+
const { opened, hasObservedHistory } = useSessionOpening(
|
|
1120
|
+
`${workspaceId}:${sessionId}`,
|
|
1121
|
+
Boolean(session && (initialHistoryReady || pendingCreationHandoff)),
|
|
1122
|
+
events.length > 0
|
|
1123
|
+
);
|
|
1124
|
+
const timeline = useMemo3(() => {
|
|
1125
|
+
if (!session) {
|
|
1126
|
+
return [];
|
|
1127
|
+
}
|
|
1128
|
+
if ((!opened || initialLoading || hasObservedHistory) && visibleEvents.length === 0 && !pendingCreationHandoff) {
|
|
1129
|
+
return [];
|
|
1130
|
+
}
|
|
1131
|
+
const projected = projectSessionTimeline(
|
|
1132
|
+
session,
|
|
1133
|
+
visibleEvents,
|
|
1134
|
+
pendingCreationHandoff?.clientEventId,
|
|
1135
|
+
viewClearedAfter === null ? eventTimeline : void 0
|
|
1136
|
+
);
|
|
1137
|
+
return viewClearedAfter !== null && visibleEvents.length === 0 ? [] : projected;
|
|
1138
|
+
}, [
|
|
1139
|
+
pendingCreationHandoff,
|
|
1140
|
+
session,
|
|
1141
|
+
visibleEvents,
|
|
1142
|
+
viewClearedAfter,
|
|
1143
|
+
opened,
|
|
1144
|
+
initialLoading,
|
|
1145
|
+
hasObservedHistory,
|
|
1146
|
+
eventTimeline
|
|
1147
|
+
]);
|
|
1148
|
+
const approvals = useMemo3(() => projectPendingApprovals(events), [events]);
|
|
1149
|
+
const creditExhausted = useMemo3(() => creditExhaustedFromEvents(events), [events]);
|
|
1150
|
+
const creditRefusal = useMemo3(() => creditRefusalFromEvents(events), [events]);
|
|
1151
|
+
const failure = useMemo3(
|
|
1152
|
+
() => session && (session.status === "failed" || creditExhausted) ? summarizeSessionFailure(
|
|
1153
|
+
events,
|
|
1154
|
+
session.status,
|
|
1155
|
+
session.failureDiagnostics,
|
|
1156
|
+
session.lastSequence
|
|
1157
|
+
) : null,
|
|
1158
|
+
[events, session, creditExhausted]
|
|
1159
|
+
);
|
|
1160
|
+
const [panelEventFeed] = useState3(createSessionEventFeedStore);
|
|
1161
|
+
const { client, captureWorkspaceInvocation, ownsWorkspaceInvocation } = context;
|
|
1162
|
+
const {
|
|
1163
|
+
setSession: setContextSession,
|
|
1164
|
+
setConnectionState: setContextConnectionState,
|
|
1165
|
+
sessionEventFeedStore
|
|
1166
|
+
} = sessionRouteAppState(placement, context, panelEventFeed);
|
|
1167
|
+
const acknowledgedProjectionRef = useRef2(null);
|
|
1168
|
+
const confirmedProjectionRef = useRef2(null);
|
|
1169
|
+
const retriedProjectionRef = useRef2(null);
|
|
1170
|
+
const [foreground, setForeground] = useState3(() => ({
|
|
1171
|
+
documentVisible: document.visibilityState === "visible",
|
|
1172
|
+
windowFocused: document.hasFocus()
|
|
1173
|
+
}));
|
|
1174
|
+
const [attentionRetryRevision, setAttentionRetryRevision] = useState3(0);
|
|
1175
|
+
const reconciledSessionRead = useRef2(null);
|
|
1176
|
+
useEffect4(() => {
|
|
1177
|
+
if (!fetchedSession || sessionReadRevision === 0) return;
|
|
1178
|
+
if (reconciledSessionRead.current?.sessionId === sessionId && reconciledSessionRead.current.revision === sessionReadRevision) {
|
|
1179
|
+
return;
|
|
1180
|
+
}
|
|
1181
|
+
reconciledSessionRead.current = {
|
|
1182
|
+
sessionId,
|
|
1183
|
+
revision: sessionReadRevision
|
|
1184
|
+
};
|
|
1185
|
+
const accepted = context.sessionChannelProjectionAuthority.recordRead(
|
|
1186
|
+
fetchedSession,
|
|
1187
|
+
sessionReadGeneration
|
|
1188
|
+
);
|
|
1189
|
+
setContextSession(
|
|
1190
|
+
(current) => mergeSessionDetailReadProjection(
|
|
1191
|
+
current,
|
|
1192
|
+
fetchedSession,
|
|
1193
|
+
context.sessionChannelProjectionAuthority,
|
|
1194
|
+
sessionReadGeneration,
|
|
1195
|
+
accepted
|
|
1196
|
+
)
|
|
1197
|
+
);
|
|
1198
|
+
}, [
|
|
1199
|
+
context.sessionChannelProjectionAuthority,
|
|
1200
|
+
fetchedSession,
|
|
1201
|
+
sessionId,
|
|
1202
|
+
sessionReadGeneration,
|
|
1203
|
+
sessionReadRevision,
|
|
1204
|
+
setContextSession
|
|
1205
|
+
]);
|
|
1206
|
+
useEffect4(() => {
|
|
1207
|
+
setContextSession(
|
|
1208
|
+
(current) => mergeSessionContextProjection(
|
|
1209
|
+
current,
|
|
1210
|
+
session,
|
|
1211
|
+
context.sessionChannelProjectionAuthority,
|
|
1212
|
+
"live"
|
|
1213
|
+
)
|
|
1214
|
+
);
|
|
1215
|
+
}, [context.sessionChannelProjectionAuthority, session, setContextSession]);
|
|
1216
|
+
useEffect4(() => {
|
|
1217
|
+
const reconcileForeground = () => {
|
|
1218
|
+
setForeground({
|
|
1219
|
+
documentVisible: document.visibilityState === "visible",
|
|
1220
|
+
windowFocused: document.hasFocus()
|
|
1221
|
+
});
|
|
1222
|
+
};
|
|
1223
|
+
window.addEventListener("focus", reconcileForeground);
|
|
1224
|
+
window.addEventListener("blur", reconcileForeground);
|
|
1225
|
+
document.addEventListener("visibilitychange", reconcileForeground);
|
|
1226
|
+
return () => {
|
|
1227
|
+
window.removeEventListener("focus", reconcileForeground);
|
|
1228
|
+
window.removeEventListener("blur", reconcileForeground);
|
|
1229
|
+
document.removeEventListener("visibilitychange", reconcileForeground);
|
|
1230
|
+
};
|
|
1231
|
+
}, []);
|
|
1232
|
+
const projectSessionAttention = useCallback3(
|
|
1233
|
+
(projection) => {
|
|
1234
|
+
notifySessionAttentionChanged(projection);
|
|
1235
|
+
setContextSession(
|
|
1236
|
+
(current) => current?.id === projection.id ? applySessionAttentionProjection(current, projection) : current
|
|
1237
|
+
);
|
|
1238
|
+
},
|
|
1239
|
+
[setContextSession]
|
|
1240
|
+
);
|
|
1241
|
+
const attentionThroughSequence = useMemo3(
|
|
1242
|
+
() => sessionAttentionReadThroughSequence(events),
|
|
1243
|
+
[events]
|
|
1244
|
+
);
|
|
1245
|
+
const readThroughSequence = Math.max(session?.lastSequence ?? 0, attentionThroughSequence);
|
|
1246
|
+
const activeReadProjectionKey = session ? sessionReadProjectionKey(session.id, readThroughSequence) : null;
|
|
1247
|
+
const routeUnreadProjection = useMemo3(
|
|
1248
|
+
() => session ? {
|
|
1249
|
+
...session,
|
|
1250
|
+
unread: session.unread || readThroughSequence > session.lastSequence
|
|
1251
|
+
} : null,
|
|
1252
|
+
[readThroughSequence, session]
|
|
1253
|
+
);
|
|
1254
|
+
useLayoutEffect2(() => {
|
|
1255
|
+
if (!session || !activeReadProjectionKey) return;
|
|
1256
|
+
if (confirmedProjectionRef.current === activeReadProjectionKey || !shouldProjectActiveSessionRead({
|
|
1257
|
+
activeSessionId: sessionId,
|
|
1258
|
+
workspaceId,
|
|
1259
|
+
session: routeUnreadProjection,
|
|
1260
|
+
...foreground
|
|
1261
|
+
})) {
|
|
1262
|
+
return;
|
|
1263
|
+
}
|
|
1264
|
+
const optimisticProjection = {
|
|
1265
|
+
id: session.id,
|
|
1266
|
+
workspaceId: session.workspaceId,
|
|
1267
|
+
unread: false,
|
|
1268
|
+
...session.attentionVersion !== void 0 ? { attentionVersion: session.attentionVersion } : {},
|
|
1269
|
+
lastSequence: readThroughSequence
|
|
1270
|
+
};
|
|
1271
|
+
projectSessionAttention(optimisticProjection);
|
|
1272
|
+
}, [
|
|
1273
|
+
activeReadProjectionKey,
|
|
1274
|
+
foreground,
|
|
1275
|
+
projectSessionAttention,
|
|
1276
|
+
readThroughSequence,
|
|
1277
|
+
routeUnreadProjection,
|
|
1278
|
+
session,
|
|
1279
|
+
sessionId,
|
|
1280
|
+
workspaceId
|
|
1281
|
+
]);
|
|
1282
|
+
const acknowledgementSessionId = session?.id ?? null;
|
|
1283
|
+
const acknowledgementEligible = shouldAcknowledgeActiveSession({
|
|
1284
|
+
activeSessionId: sessionId,
|
|
1285
|
+
workspaceId,
|
|
1286
|
+
session: routeUnreadProjection,
|
|
1287
|
+
...foreground
|
|
1288
|
+
});
|
|
1289
|
+
useEffect4(() => {
|
|
1290
|
+
const projectionKey = activeReadProjectionKey;
|
|
1291
|
+
if (!acknowledgementSessionId || !projectionKey || acknowledgedProjectionRef.current === projectionKey || !acknowledgementEligible) {
|
|
1292
|
+
return;
|
|
1293
|
+
}
|
|
1294
|
+
let active = true;
|
|
1295
|
+
const acceptedTransition = captureWorkspaceInvocation(workspaceId);
|
|
1296
|
+
if (!acceptedTransition) return;
|
|
1297
|
+
acknowledgedProjectionRef.current = projectionKey;
|
|
1298
|
+
void client.updateSessionAttention(workspaceId, acknowledgementSessionId, {
|
|
1299
|
+
unread: false,
|
|
1300
|
+
acknowledgedThroughSequence: readThroughSequence
|
|
1301
|
+
}).then((updated) => {
|
|
1302
|
+
if (!ownsWorkspaceInvocation(workspaceId, acceptedTransition)) return;
|
|
1303
|
+
confirmedProjectionRef.current = projectionKey;
|
|
1304
|
+
projectSessionAttention(updated);
|
|
1305
|
+
}).catch(() => {
|
|
1306
|
+
if (active && ownsWorkspaceInvocation(workspaceId, acceptedTransition) && acknowledgedProjectionRef.current === projectionKey && retriedProjectionRef.current !== projectionKey) {
|
|
1307
|
+
retriedProjectionRef.current = projectionKey;
|
|
1308
|
+
acknowledgedProjectionRef.current = null;
|
|
1309
|
+
setAttentionRetryRevision((revision) => revision + 1);
|
|
1310
|
+
return;
|
|
1311
|
+
}
|
|
1312
|
+
if (acknowledgedProjectionRef.current === projectionKey) {
|
|
1313
|
+
acknowledgedProjectionRef.current = null;
|
|
1314
|
+
}
|
|
1315
|
+
});
|
|
1316
|
+
return () => {
|
|
1317
|
+
active = false;
|
|
1318
|
+
};
|
|
1319
|
+
}, [
|
|
1320
|
+
acknowledgementEligible,
|
|
1321
|
+
acknowledgementSessionId,
|
|
1322
|
+
attentionRetryRevision,
|
|
1323
|
+
activeReadProjectionKey,
|
|
1324
|
+
captureWorkspaceInvocation,
|
|
1325
|
+
client,
|
|
1326
|
+
ownsWorkspaceInvocation,
|
|
1327
|
+
projectSessionAttention,
|
|
1328
|
+
readThroughSequence,
|
|
1329
|
+
workspaceId
|
|
1330
|
+
]);
|
|
1331
|
+
useEffect4(() => {
|
|
1332
|
+
setContextConnectionState(connectionState);
|
|
1333
|
+
}, [connectionState, setContextConnectionState]);
|
|
1334
|
+
useStreamHealthTelemetry("session", connectionState);
|
|
1335
|
+
useEffect4(() => {
|
|
1336
|
+
sessionEventFeedStore.set({ sessionId, events });
|
|
1337
|
+
}, [events, sessionId, sessionEventFeedStore]);
|
|
1338
|
+
useEffect4(
|
|
1339
|
+
() => () => {
|
|
1340
|
+
setContextSession(null);
|
|
1341
|
+
setContextConnectionState("idle");
|
|
1342
|
+
if (sessionEventFeedStore.getSnapshot()?.sessionId === sessionId) {
|
|
1343
|
+
sessionEventFeedStore.set(null);
|
|
1344
|
+
}
|
|
1345
|
+
},
|
|
1346
|
+
[sessionId, sessionEventFeedStore, setContextConnectionState, setContextSession]
|
|
1347
|
+
);
|
|
1348
|
+
useSessionFailureToasts(loadError, streamError);
|
|
1349
|
+
const oauthReturnHandled = useRef2(false);
|
|
1350
|
+
const capabilityClient = context.client;
|
|
1351
|
+
const capabilityCatalog = context.workspaceCapabilityCatalog;
|
|
1352
|
+
const capabilityCatalogReady = context.workspaceMcpCatalogReady;
|
|
1353
|
+
const refreshCapabilityCatalog = context.refreshWorkspaceMcpServers;
|
|
1354
|
+
useEffect4(() => {
|
|
1355
|
+
if (oauthReturnHandled.current || !capabilityCatalogReady) {
|
|
1356
|
+
return;
|
|
1357
|
+
}
|
|
1358
|
+
const params = page.readQuery();
|
|
1359
|
+
const outcome = params.get("integration_oauth");
|
|
1360
|
+
if (!outcome) {
|
|
1361
|
+
return;
|
|
1362
|
+
}
|
|
1363
|
+
oauthReturnHandled.current = true;
|
|
1364
|
+
page.replaceQuery(new URLSearchParams());
|
|
1365
|
+
const capabilityId = params.get("capability_auth");
|
|
1366
|
+
if (outcome !== "success") {
|
|
1367
|
+
void import("./app/lib/oauth-callback-messages.js").then(
|
|
1368
|
+
({ mcpOAuthCallbackFailureMessage }) => toast.error("Reconnect failed", {
|
|
1369
|
+
description: mcpOAuthCallbackFailureMessage(params.get("stage"), params.get("reason"))
|
|
1370
|
+
})
|
|
1371
|
+
);
|
|
1372
|
+
return;
|
|
1373
|
+
}
|
|
1374
|
+
if (!capabilityId) {
|
|
1375
|
+
toast.success("Connection restored", {
|
|
1376
|
+
description: "The earlier tool call wasn't replayed. Send a new message to try again."
|
|
1377
|
+
});
|
|
1378
|
+
return;
|
|
1379
|
+
}
|
|
1380
|
+
void (async () => {
|
|
1381
|
+
const finished = await finishMcpCapabilityOAuthReturn({
|
|
1382
|
+
client: capabilityClient,
|
|
1383
|
+
workspaceId,
|
|
1384
|
+
sessionId,
|
|
1385
|
+
capabilityId,
|
|
1386
|
+
params,
|
|
1387
|
+
catalog: capabilityCatalog,
|
|
1388
|
+
refreshCatalog: refreshCapabilityCatalog
|
|
1389
|
+
});
|
|
1390
|
+
toast.success(`${finished.name} connected`, {
|
|
1391
|
+
description: finished.needsPersonalReview ? "Review its connection card to allow your personal account in this conversation." : "It is available to new tool calls in this session."
|
|
1392
|
+
});
|
|
1393
|
+
})().catch((error) => {
|
|
1394
|
+
toast.error("Connection succeeded, but setup needs attention", {
|
|
1395
|
+
description: userErrorText(error)
|
|
1396
|
+
});
|
|
1397
|
+
});
|
|
1398
|
+
}, [
|
|
1399
|
+
page,
|
|
1400
|
+
capabilityCatalog,
|
|
1401
|
+
capabilityCatalogReady,
|
|
1402
|
+
capabilityClient,
|
|
1403
|
+
refreshCapabilityCatalog,
|
|
1404
|
+
workspaceId,
|
|
1405
|
+
sessionId
|
|
1406
|
+
]);
|
|
1407
|
+
const nativeReturnHandled = useRef2(false);
|
|
1408
|
+
useEffect4(() => {
|
|
1409
|
+
if (nativeReturnHandled.current || !capabilityCatalogReady) return;
|
|
1410
|
+
const params = page.readQuery();
|
|
1411
|
+
const social = params.get("social_oauth");
|
|
1412
|
+
const fiken = params.get("fiken");
|
|
1413
|
+
if (!social && !fiken) return;
|
|
1414
|
+
nativeReturnHandled.current = true;
|
|
1415
|
+
page.replaceQuery(new URLSearchParams());
|
|
1416
|
+
if (social === "success" || fiken === "connected") {
|
|
1417
|
+
const capabilityId = params.get("capability_auth");
|
|
1418
|
+
void (async () => {
|
|
1419
|
+
await refreshCapabilityCatalog(workspaceId);
|
|
1420
|
+
await completeSessionCapabilityOAuth(
|
|
1421
|
+
t,
|
|
1422
|
+
capabilityClient,
|
|
1423
|
+
workspaceId,
|
|
1424
|
+
sessionId,
|
|
1425
|
+
capabilityId
|
|
1426
|
+
);
|
|
1427
|
+
toast.success("Connection setup completed", {
|
|
1428
|
+
description: "It is available to new tool calls in this session."
|
|
1429
|
+
});
|
|
1430
|
+
})().catch(
|
|
1431
|
+
(error) => toast.error("Connection authorized, but setup needs attention", {
|
|
1432
|
+
description: userErrorText(error)
|
|
1433
|
+
})
|
|
1434
|
+
);
|
|
1435
|
+
} else {
|
|
1436
|
+
toast.error("Connection wasn't completed", {
|
|
1437
|
+
description: "You can retry from the connection card."
|
|
1438
|
+
});
|
|
1439
|
+
}
|
|
1440
|
+
}, [
|
|
1441
|
+
page,
|
|
1442
|
+
capabilityCatalogReady,
|
|
1443
|
+
capabilityClient,
|
|
1444
|
+
refreshCapabilityCatalog,
|
|
1445
|
+
workspaceId,
|
|
1446
|
+
sessionId
|
|
1447
|
+
]);
|
|
1448
|
+
const githubReturnHandled = useRef2(false);
|
|
1449
|
+
useEffect4(() => {
|
|
1450
|
+
if (githubReturnHandled.current) return;
|
|
1451
|
+
const params = page.readQuery();
|
|
1452
|
+
const outcome = params.get("github");
|
|
1453
|
+
if (outcome !== "connected" && outcome !== "requested") return;
|
|
1454
|
+
githubReturnHandled.current = true;
|
|
1455
|
+
page.replaceQuery(new URLSearchParams());
|
|
1456
|
+
if (outcome === "requested") {
|
|
1457
|
+
recordGitHubInstallRequest(workspaceId);
|
|
1458
|
+
toast.success("Request sent to your GitHub organization owners", {
|
|
1459
|
+
description: "After an owner approves, an owner of the organization connects it here. Your GitHub card updates on its own."
|
|
1460
|
+
});
|
|
1461
|
+
return;
|
|
1462
|
+
}
|
|
1463
|
+
clearGitHubInstallRequest(workspaceId);
|
|
1464
|
+
toast.success("GitHub connected", {
|
|
1465
|
+
description: "Repository access is now available to new tool calls in this session."
|
|
1466
|
+
});
|
|
1467
|
+
}, [page, workspaceId]);
|
|
1468
|
+
const reconnectTransport = useMemo3(() => context.client.connectTransport(), [context.client]);
|
|
1469
|
+
const [reconnectRequest, setReconnectRequest] = useState3(null);
|
|
1470
|
+
const reconnectCardConnections = useRef2(/* @__PURE__ */ new WeakMap());
|
|
1471
|
+
const connectGitHubApp = useCallback3(() => {
|
|
1472
|
+
setReconnectRequest(githubAppConnectRequest(workspaceId, reconnectTransport, page.href()));
|
|
1473
|
+
}, [page, reconnectTransport, workspaceId]);
|
|
1474
|
+
const connectPersonalGitHub = context.connectPersonalGitHub;
|
|
1475
|
+
const reconnectPersonalGitHub = context.reconnectPersonalGitHub;
|
|
1476
|
+
const personalGitHubConnection = context.personalGitHubStatus?.connection ?? null;
|
|
1477
|
+
const personalGitHubNeedsReconnect = personalGitHubConnection !== null && personalGitHubConnection.status !== "active" && personalGitHubConnection.status !== "revoked";
|
|
1478
|
+
const reconnectViaSetup = useCallback3(
|
|
1479
|
+
async (item) => {
|
|
1480
|
+
if (item.authoritySource === "host") {
|
|
1481
|
+
if (!item.authorizationUrl) {
|
|
1482
|
+
throw new Error(
|
|
1483
|
+
"This connection is managed by the embedding host and has no recovery link."
|
|
1484
|
+
);
|
|
1485
|
+
}
|
|
1486
|
+
page.assign(item.authorizationUrl);
|
|
1487
|
+
return;
|
|
1488
|
+
}
|
|
1489
|
+
if (item.connectionId) {
|
|
1490
|
+
const { findConnectRecoveryAccount } = await import("@opengeni/connect");
|
|
1491
|
+
const target2 = await findConnectRecoveryTarget({
|
|
1492
|
+
workspaceId,
|
|
1493
|
+
connectionId: item.connectionId,
|
|
1494
|
+
accounts: (id) => reconnectTransport.accounts(id),
|
|
1495
|
+
ownAccounts: () => context.client.listOwnConnectionAccounts(workspaceId, { includeInactive: true }),
|
|
1496
|
+
find: findConnectRecoveryAccount
|
|
1497
|
+
});
|
|
1498
|
+
if (target2?.via === "connector") {
|
|
1499
|
+
page.assign(
|
|
1500
|
+
`/workspaces/${encodeURIComponent(target2.workspaceId)}/capabilities?reconnect_domain=${encodeURIComponent(item.providerDomain)}`
|
|
1501
|
+
);
|
|
1502
|
+
return;
|
|
1503
|
+
}
|
|
1504
|
+
if (target2) {
|
|
1505
|
+
const { account } = target2;
|
|
1506
|
+
const request = {
|
|
1507
|
+
scope: { workspaceId: target2.workspaceId, transport: reconnectTransport },
|
|
1508
|
+
providerId: account.providerId,
|
|
1509
|
+
ownership: account.ownership,
|
|
1510
|
+
reconnectAccountId: account.id,
|
|
1511
|
+
// A tool needed more access than the account was connected with:
|
|
1512
|
+
// the reconnect asks the provider for exactly that (incremental consent).
|
|
1513
|
+
// Other providers keep their fixed permission set.
|
|
1514
|
+
...item.reason === "insufficient_scope" && item.scopes.length > 0 && connectProviderAcceptsRequestedScopes(account.providerId) ? { requestedScopes: [...item.scopes] } : {},
|
|
1515
|
+
displayName: account.label,
|
|
1516
|
+
returnUrl: page.href(),
|
|
1517
|
+
// Sign-in runs in a popup: it ends on a page that closes it,
|
|
1518
|
+
// never on a second copy of this chat.
|
|
1519
|
+
finishInPopup: true,
|
|
1520
|
+
idempotencyKey: crypto.randomUUID()
|
|
1521
|
+
};
|
|
1522
|
+
reconnectCardConnections.current.set(request, item.connectionId);
|
|
1523
|
+
setReconnectRequest(request);
|
|
1524
|
+
return;
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
if (item.capability) {
|
|
1528
|
+
const returnPath2 = `${new URL(page.href()).pathname}?capability_auth=${encodeURIComponent(item.capability.id)}`;
|
|
1529
|
+
if (item.capability.id === "api:github-app") {
|
|
1530
|
+
const status = await context.client.getGitHubApp(workspaceId, {
|
|
1531
|
+
returnPath: returnPath2
|
|
1532
|
+
});
|
|
1533
|
+
if (status.status === "bound") {
|
|
1534
|
+
toast.success("GitHub is already connected");
|
|
1535
|
+
return;
|
|
1536
|
+
}
|
|
1537
|
+
if (!status.linkUrl) {
|
|
1538
|
+
throw new Error(
|
|
1539
|
+
status.configured ? "Your account cannot manage this workspace's GitHub connection." : "GitHub is not configured on this deployment."
|
|
1540
|
+
);
|
|
1541
|
+
}
|
|
1542
|
+
await markIntegrationConnectRedirect("github", "app_install");
|
|
1543
|
+
page.assign(status.linkUrl);
|
|
1544
|
+
return;
|
|
1545
|
+
}
|
|
1546
|
+
if (item.capability.id === "api:github-personal") {
|
|
1547
|
+
await (personalGitHubNeedsReconnect ? reconnectPersonalGitHub : connectPersonalGitHub)(
|
|
1548
|
+
workspaceId
|
|
1549
|
+
);
|
|
1550
|
+
return;
|
|
1551
|
+
}
|
|
1552
|
+
if (item.capability.id === "mcp:codex_apps") {
|
|
1553
|
+
page.assign(`/workspaces/${encodeURIComponent(workspaceId)}/settings`);
|
|
1554
|
+
return;
|
|
1555
|
+
}
|
|
1556
|
+
const catalogItem = context.workspaceCapabilityCatalog.find(
|
|
1557
|
+
(candidate) => candidate.id === item.capability?.id
|
|
1558
|
+
);
|
|
1559
|
+
const canInstall = canConnectWorkspaceMcpFromChat(
|
|
1560
|
+
context.accessContext,
|
|
1561
|
+
workspaceId,
|
|
1562
|
+
catalogItem,
|
|
1563
|
+
context.workspaceMemberIntegrationSetup
|
|
1564
|
+
);
|
|
1565
|
+
const mcpUrl = catalogItem?.mcpUrl ?? catalogItem?.endpointUrl ?? null;
|
|
1566
|
+
if (canInstall && catalogItem?.kind === "mcp" && catalogItem.authKind === "oauth2" && mcpUrl) {
|
|
1567
|
+
const response2 = await startMcpOAuthWithTimeout(context.client, workspaceId, {
|
|
1568
|
+
mcpUrl,
|
|
1569
|
+
...catalogItem.providerDomain ? { providerDomain: catalogItem.providerDomain } : {},
|
|
1570
|
+
ownership: "workspace",
|
|
1571
|
+
returnPath: returnPath2
|
|
1572
|
+
});
|
|
1573
|
+
if (!response2.authorizationUrl) {
|
|
1574
|
+
throw new Error("The provider did not return an authorization link.");
|
|
1575
|
+
}
|
|
1576
|
+
await markIntegrationConnectRedirect({ domain: mcpUrl }, "oauth");
|
|
1577
|
+
page.assign(response2.authorizationUrl);
|
|
1578
|
+
return;
|
|
1579
|
+
}
|
|
1580
|
+
page.assign(
|
|
1581
|
+
`/workspaces/${encodeURIComponent(workspaceId)}/capabilities?suggested_capability=${encodeURIComponent(item.capability.id)}`
|
|
1582
|
+
);
|
|
1583
|
+
return;
|
|
1584
|
+
}
|
|
1585
|
+
if (item.serverId === "codex_apps") {
|
|
1586
|
+
page.assign(`/workspaces/${encodeURIComponent(workspaceId)}/settings`);
|
|
1587
|
+
return;
|
|
1588
|
+
}
|
|
1589
|
+
const connections = await context.client.listConnections(workspaceId).catch(() => []);
|
|
1590
|
+
const connection = item.connectionId ? connections.find((candidate) => candidate.id === item.connectionId) ?? null : null;
|
|
1591
|
+
if (connection?.kind === "api_key") {
|
|
1592
|
+
page.assign(
|
|
1593
|
+
`/workspaces/${encodeURIComponent(workspaceId)}/capabilities?reconnect_domain=${encodeURIComponent(item.providerDomain)}`
|
|
1594
|
+
);
|
|
1595
|
+
return;
|
|
1596
|
+
}
|
|
1597
|
+
const pageUrl = new URL(page.href());
|
|
1598
|
+
const returnPath = `${pageUrl.pathname}${pageUrl.search}`;
|
|
1599
|
+
const response = await context.client.startConnectionOAuth(workspaceId, {
|
|
1600
|
+
providerDomain: item.providerDomain,
|
|
1601
|
+
...item.connectionId ? { connectionId: item.connectionId } : {},
|
|
1602
|
+
...item.resource ? { resource: item.resource } : {},
|
|
1603
|
+
returnPath
|
|
1604
|
+
});
|
|
1605
|
+
if (!response.authorizationUrl) {
|
|
1606
|
+
throw new Error("The provider did not return an authorization link.");
|
|
1607
|
+
}
|
|
1608
|
+
await markIntegrationConnectRedirect({ domain: item.providerDomain }, "oauth");
|
|
1609
|
+
page.assign(response.authorizationUrl);
|
|
1610
|
+
},
|
|
1611
|
+
[
|
|
1612
|
+
page,
|
|
1613
|
+
context.accessContext,
|
|
1614
|
+
context.client,
|
|
1615
|
+
connectPersonalGitHub,
|
|
1616
|
+
reconnectPersonalGitHub,
|
|
1617
|
+
personalGitHubNeedsReconnect,
|
|
1618
|
+
context.workspaceCapabilityCatalog,
|
|
1619
|
+
context.workspaceMemberIntegrationSetup,
|
|
1620
|
+
workspaceId,
|
|
1621
|
+
reconnectTransport
|
|
1622
|
+
]
|
|
1623
|
+
);
|
|
1624
|
+
const stepUpConnection = useCallback3(
|
|
1625
|
+
(connectionId, scopes, options) => {
|
|
1626
|
+
let reserved;
|
|
1627
|
+
try {
|
|
1628
|
+
if (typeof window === "undefined") return null;
|
|
1629
|
+
reserved = reserveBrowserConnectNavigation(window);
|
|
1630
|
+
} catch {
|
|
1631
|
+
return null;
|
|
1632
|
+
}
|
|
1633
|
+
let closed = false;
|
|
1634
|
+
const close = () => {
|
|
1635
|
+
if (closed) return;
|
|
1636
|
+
closed = true;
|
|
1637
|
+
reserved.close();
|
|
1638
|
+
};
|
|
1639
|
+
return (async () => {
|
|
1640
|
+
try {
|
|
1641
|
+
const [{ findConnectRecoveryAccount }, { stepUpFromCard }] = await Promise.all([
|
|
1642
|
+
import("@opengeni/connect"),
|
|
1643
|
+
import("./connection-step-up-XGPZKQEL.js")
|
|
1644
|
+
]);
|
|
1645
|
+
return await stepUpFromCard({
|
|
1646
|
+
connectionId,
|
|
1647
|
+
scopes,
|
|
1648
|
+
window: { navigation: reserved.navigation, close },
|
|
1649
|
+
transport: reconnectTransport,
|
|
1650
|
+
findTarget: () => findConnectRecoveryTarget({
|
|
1651
|
+
workspaceId,
|
|
1652
|
+
connectionId,
|
|
1653
|
+
accounts: (id) => reconnectTransport.accounts(id),
|
|
1654
|
+
ownAccounts: () => context.client.listOwnConnectionAccounts(workspaceId, { includeInactive: true }),
|
|
1655
|
+
find: findConnectRecoveryAccount
|
|
1656
|
+
}),
|
|
1657
|
+
returnUrl: page.href(),
|
|
1658
|
+
...options.continueAfterSetup ? { continueAfterSetup: options.continueAfterSetup } : {},
|
|
1659
|
+
signal: options.signal
|
|
1660
|
+
});
|
|
1661
|
+
} finally {
|
|
1662
|
+
close();
|
|
1663
|
+
}
|
|
1664
|
+
})();
|
|
1665
|
+
},
|
|
1666
|
+
[context.client, page, reconnectTransport, workspaceId]
|
|
1667
|
+
);
|
|
1668
|
+
const onReconnect = useCallback3(
|
|
1669
|
+
async (item, options) => {
|
|
1670
|
+
const connectionId = item.connectionId;
|
|
1671
|
+
const running = item.authoritySource !== "host" && item.reason === "insufficient_scope" && connectionId && item.scopes.length > 0 && !item.capability && !item.setupRequest ? stepUpConnection(connectionId, item.scopes, {
|
|
1672
|
+
signal: options?.signal,
|
|
1673
|
+
continueAfterSetup: () => context.client.continueAfterCapabilitySetup(workspaceId, sessionId, {
|
|
1674
|
+
connectionId
|
|
1675
|
+
})
|
|
1676
|
+
}) : null;
|
|
1677
|
+
const outcome = running ? await running : null;
|
|
1678
|
+
if (outcome?.status === "allowed") return { outcome: "done" };
|
|
1679
|
+
if (outcome?.status === "resume_in_dialog" && connectionId) {
|
|
1680
|
+
reconnectCardConnections.current.set(outcome.request, connectionId);
|
|
1681
|
+
setReconnectRequest(outcome.request);
|
|
1682
|
+
return void 0;
|
|
1683
|
+
}
|
|
1684
|
+
await reconnectViaSetup(item);
|
|
1685
|
+
return void 0;
|
|
1686
|
+
},
|
|
1687
|
+
[context.client, reconnectViaSetup, sessionId, stepUpConnection, workspaceId]
|
|
1688
|
+
);
|
|
1689
|
+
const allowAccessForApproval = useCallback3(
|
|
1690
|
+
async (access, _approval, signal) => {
|
|
1691
|
+
const running = stepUpConnection(access.connectionId, access.scopes, { signal });
|
|
1692
|
+
if (!running) {
|
|
1693
|
+
toast.error(t("connectWindowHost.allowPopups"));
|
|
1694
|
+
return false;
|
|
1695
|
+
}
|
|
1696
|
+
const outcome = await running;
|
|
1697
|
+
if (outcome.status === "resume_in_dialog") {
|
|
1698
|
+
setReconnectRequest(outcome.request);
|
|
1699
|
+
return false;
|
|
1700
|
+
}
|
|
1701
|
+
if (outcome.status === "not_handled") {
|
|
1702
|
+
toast.error(t("connectSetup.setupCouldNotContinueTryAgain"));
|
|
1703
|
+
return false;
|
|
1704
|
+
}
|
|
1705
|
+
return true;
|
|
1706
|
+
},
|
|
1707
|
+
[stepUpConnection]
|
|
1708
|
+
);
|
|
1709
|
+
const providerLogos = useMemo3(
|
|
1710
|
+
() => connectorLogoIndex(
|
|
1711
|
+
context.workspaceCapabilityCatalog,
|
|
1712
|
+
(path) => context.client.catalogAssetUrl(path ?? null)
|
|
1713
|
+
),
|
|
1714
|
+
[context.client, context.workspaceCapabilityCatalog]
|
|
1715
|
+
);
|
|
1716
|
+
const resolveProviderLogo = useCallback3(
|
|
1717
|
+
(domain) => connectorLogo(providerLogos, domain),
|
|
1718
|
+
[providerLogos]
|
|
1719
|
+
);
|
|
1720
|
+
const lineagePoll = useLineagePollInterval(workspaceId);
|
|
1721
|
+
const lineage = useSessionLineage(sessionId, {
|
|
1722
|
+
events,
|
|
1723
|
+
pollIntervalMs: lineagePoll.pollIntervalMs
|
|
1724
|
+
});
|
|
1725
|
+
const agentNodes = useMemo3(() => lineage.lineage?.children ?? [], [lineage.lineage]);
|
|
1726
|
+
const observeLineageTree = lineagePoll.observeTree;
|
|
1727
|
+
useEffect4(() => observeLineageTree(agentNodes), [agentNodes, observeLineageTree]);
|
|
1728
|
+
const descendantRefreshSignal = useDescendantRequestsRefresh({
|
|
1729
|
+
client: context.client,
|
|
1730
|
+
workspaceId,
|
|
1731
|
+
sessionId,
|
|
1732
|
+
events,
|
|
1733
|
+
nodes: agentNodes,
|
|
1734
|
+
refreshLineage: lineage.refresh
|
|
1735
|
+
});
|
|
1736
|
+
const lineageTitles = useMemo3(() => {
|
|
1737
|
+
const titles = /* @__PURE__ */ new Map();
|
|
1738
|
+
for (const ancestor of lineage.lineage?.ancestors ?? []) {
|
|
1739
|
+
titles.set(ancestor.id, sessionDisplayTitle(ancestor));
|
|
1740
|
+
}
|
|
1741
|
+
const visit = (nodes) => {
|
|
1742
|
+
for (const node of nodes) {
|
|
1743
|
+
titles.set(node.session.id, sessionDisplayTitle(node.session));
|
|
1744
|
+
visit(node.children);
|
|
1745
|
+
}
|
|
1746
|
+
};
|
|
1747
|
+
visit(lineage.lineage?.children ?? []);
|
|
1748
|
+
return titles;
|
|
1749
|
+
}, [lineage.lineage]);
|
|
1750
|
+
const resolveSessionTitle = useCallback3(
|
|
1751
|
+
(agentSessionId) => lineageTitles.get(agentSessionId) ?? null,
|
|
1752
|
+
[lineageTitles]
|
|
1753
|
+
);
|
|
1754
|
+
const sandboxFileRequestSeq = useRef2(0);
|
|
1755
|
+
const [sandboxFileRequest, setSandboxFileRequest] = useState3(null);
|
|
1756
|
+
useEffect4(() => {
|
|
1757
|
+
setSandboxFileRequest(null);
|
|
1758
|
+
}, [sessionId]);
|
|
1759
|
+
const setInspectorOpen = context.setInspectorOpen;
|
|
1760
|
+
const agentSettingsRequestSeq = useRef2(0);
|
|
1761
|
+
const [agentSettingsRequest, setAgentSettingsRequest] = useState3(null);
|
|
1762
|
+
const openAgentSettings = useCallback3(() => {
|
|
1763
|
+
setAgentSettingsRequest({
|
|
1764
|
+
sessionId,
|
|
1765
|
+
requestId: ++agentSettingsRequestSeq.current,
|
|
1766
|
+
target: "learning"
|
|
1767
|
+
});
|
|
1768
|
+
setInspectorOpen(true);
|
|
1769
|
+
}, [sessionId, setInspectorOpen]);
|
|
1770
|
+
const openUsageLimit = useCallback3(() => {
|
|
1771
|
+
setAgentSettingsRequest({
|
|
1772
|
+
sessionId,
|
|
1773
|
+
requestId: ++agentSettingsRequestSeq.current,
|
|
1774
|
+
target: "usage-limit"
|
|
1775
|
+
});
|
|
1776
|
+
setInspectorOpen(true);
|
|
1777
|
+
}, [sessionId, setInspectorOpen]);
|
|
1778
|
+
useEffect4(() => {
|
|
1779
|
+
uiEvents.addEventListener(OPEN_SESSION_USAGE_LIMIT_EVENT, openUsageLimit);
|
|
1780
|
+
return () => uiEvents.removeEventListener(OPEN_SESSION_USAGE_LIMIT_EVENT, openUsageLimit);
|
|
1781
|
+
}, [openUsageLimit, uiEvents]);
|
|
1782
|
+
const openSandboxFile = useCallback3(
|
|
1783
|
+
(path, line) => {
|
|
1784
|
+
setSandboxFileRequest({
|
|
1785
|
+
path,
|
|
1786
|
+
line,
|
|
1787
|
+
requestId: ++sandboxFileRequestSeq.current
|
|
1788
|
+
});
|
|
1789
|
+
setInspectorOpen(true);
|
|
1790
|
+
},
|
|
1791
|
+
[setInspectorOpen]
|
|
1792
|
+
);
|
|
1793
|
+
if (!session || !opened) {
|
|
1794
|
+
if (leavingRestoredSession) return /* @__PURE__ */ jsx(LoadingPanel, {});
|
|
1795
|
+
if (!session && loadError) {
|
|
1796
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingPanel, {}), children: /* @__PURE__ */ jsx(
|
|
1797
|
+
LazySessionRouteAuxiliary,
|
|
1798
|
+
{
|
|
1799
|
+
workspaceId,
|
|
1800
|
+
sessionId,
|
|
1801
|
+
loadError,
|
|
1802
|
+
onRetry: () => void refreshSession()
|
|
1803
|
+
}
|
|
1804
|
+
) });
|
|
1805
|
+
}
|
|
1806
|
+
return /* @__PURE__ */ jsx("div", { className: "flex min-h-0 w-full min-w-0 flex-1 overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
1807
|
+
SessionDock,
|
|
1808
|
+
{
|
|
1809
|
+
workspaceId,
|
|
1810
|
+
sessionId,
|
|
1811
|
+
session: null,
|
|
1812
|
+
events,
|
|
1813
|
+
connectionState,
|
|
1814
|
+
primary: session && streamError && !initialLoading ? /* @__PURE__ */ jsx(
|
|
1815
|
+
ProblemPanel,
|
|
1816
|
+
{
|
|
1817
|
+
title: "Conversation couldn't be loaded",
|
|
1818
|
+
description: "Your saved messages are unchanged. Try loading them again.",
|
|
1819
|
+
action: /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: () => void jumpToLatest(), children: "Retry conversation" })
|
|
1820
|
+
}
|
|
1821
|
+
) : /* @__PURE__ */ jsx(LoadingPanel, {}),
|
|
1822
|
+
onReloadSession: refreshSession,
|
|
1823
|
+
dockCollapsed: !context.inspectorOpen,
|
|
1824
|
+
onDockCollapsedChange: (collapsed) => context.setInspectorOpen(!collapsed),
|
|
1825
|
+
openFileRequest: sandboxFileRequest,
|
|
1826
|
+
onOpenNavigation: () => {
|
|
1827
|
+
context.setInspectorOpen(false);
|
|
1828
|
+
rail.setDrawerOpen(true);
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
) });
|
|
1832
|
+
}
|
|
1833
|
+
const chatPane = /* @__PURE__ */ jsx(
|
|
1834
|
+
SessionChatPane,
|
|
1835
|
+
{
|
|
1836
|
+
session,
|
|
1837
|
+
admissionSessionControl: sessionSeed?.effectiveControl ?? session.effectiveControl,
|
|
1838
|
+
events,
|
|
1839
|
+
timeline,
|
|
1840
|
+
searchTarget,
|
|
1841
|
+
onJumpToSequence: jumpToSequence,
|
|
1842
|
+
initialLoading,
|
|
1843
|
+
historyReloadFailed: hasObservedHistory && events.length === 0 && !!streamError,
|
|
1844
|
+
launch,
|
|
1845
|
+
realtimeAutostartModel,
|
|
1846
|
+
onRealtimeAutostartConsumed: consumeRealtimeAutostart,
|
|
1847
|
+
onSearchOriginConsumed: consumeSearchOrigin,
|
|
1848
|
+
placement,
|
|
1849
|
+
messageContext,
|
|
1850
|
+
initialDraft,
|
|
1851
|
+
approvals,
|
|
1852
|
+
humanInput,
|
|
1853
|
+
failure,
|
|
1854
|
+
creditExhausted,
|
|
1855
|
+
creditRefusal,
|
|
1856
|
+
goal,
|
|
1857
|
+
queue,
|
|
1858
|
+
agentNodes,
|
|
1859
|
+
pendingWake: sessionHasPendingWake(withLineageAutomationFacts(session, lineage.lineage)),
|
|
1860
|
+
descendantRefreshSignal,
|
|
1861
|
+
onDescendantResolved: () => void lineage.refresh(),
|
|
1862
|
+
hasOlder,
|
|
1863
|
+
loadingOlder,
|
|
1864
|
+
onLoadOlder: loadOlder,
|
|
1865
|
+
hasNewer,
|
|
1866
|
+
loadingNewer,
|
|
1867
|
+
onLoadNewer: loadNewer,
|
|
1868
|
+
loadingOldest,
|
|
1869
|
+
onJumpToStart: loadOldest,
|
|
1870
|
+
onJumpToLatest: jumpToLatest,
|
|
1871
|
+
onClearView: clearView,
|
|
1872
|
+
resolveSessionTitle,
|
|
1873
|
+
onOpenSession: (nextSessionId) => void navigate({
|
|
1874
|
+
to: "/workspaces/$workspaceId/sessions/$sessionId",
|
|
1875
|
+
params: { workspaceId, sessionId: nextSessionId }
|
|
1876
|
+
}),
|
|
1877
|
+
onMemoryClick: (memoryId) => void navigate({
|
|
1878
|
+
to: "/workspaces/$workspaceId/memory",
|
|
1879
|
+
params: { workspaceId },
|
|
1880
|
+
search: { memory: memoryId }
|
|
1881
|
+
}),
|
|
1882
|
+
onLearningRefusalOpen: (place) => {
|
|
1883
|
+
switch (place.kind) {
|
|
1884
|
+
case "skill":
|
|
1885
|
+
void navigate({
|
|
1886
|
+
href: `/workspaces/${encodeURIComponent(workspaceId)}/plugins?section=skills&open=${encodeURIComponent(`skill:${place.skillId}`)}`
|
|
1887
|
+
});
|
|
1888
|
+
return;
|
|
1889
|
+
case "skills":
|
|
1890
|
+
void navigate({
|
|
1891
|
+
to: "/workspaces/$workspaceId/plugins",
|
|
1892
|
+
params: { workspaceId },
|
|
1893
|
+
search: { section: "skills" }
|
|
1894
|
+
});
|
|
1895
|
+
return;
|
|
1896
|
+
case "instructions":
|
|
1897
|
+
void navigate({
|
|
1898
|
+
to: "/workspaces/$workspaceId/state",
|
|
1899
|
+
params: { workspaceId },
|
|
1900
|
+
search: { view: "instructions" }
|
|
1901
|
+
});
|
|
1902
|
+
return;
|
|
1903
|
+
case "knowledge":
|
|
1904
|
+
void navigate({ to: "/workspaces/$workspaceId/state", params: { workspaceId } });
|
|
1905
|
+
return;
|
|
1906
|
+
case "learning-settings":
|
|
1907
|
+
void navigate({
|
|
1908
|
+
to: "/workspaces/$workspaceId/settings",
|
|
1909
|
+
params: { workspaceId },
|
|
1910
|
+
search: { section: "learning" }
|
|
1911
|
+
});
|
|
1912
|
+
}
|
|
1913
|
+
},
|
|
1914
|
+
onNewSession: onNewSession ?? (() => void navigate({
|
|
1915
|
+
to: "/workspaces/$workspaceId/sessions",
|
|
1916
|
+
params: { workspaceId }
|
|
1917
|
+
})),
|
|
1918
|
+
onContinueInNewSession: () => void navigate({
|
|
1919
|
+
to: "/workspaces/$workspaceId/sessions",
|
|
1920
|
+
params: { workspaceId },
|
|
1921
|
+
search: { continueSessionId: sessionId }
|
|
1922
|
+
}),
|
|
1923
|
+
onRestoreArchived: session && session.parentSessionId === null && canArchiveChat(context, workspaceId) ? restoreArchived : void 0,
|
|
1924
|
+
onApprove: (approvalId, answer) => approve(approvalId, "approve", answer),
|
|
1925
|
+
onReject: (approvalId) => approve(approvalId, "reject"),
|
|
1926
|
+
onReconnect,
|
|
1927
|
+
onAllowAccess: allowAccessForApproval,
|
|
1928
|
+
onConnectGitHubApp: connectGitHubApp,
|
|
1929
|
+
resolveProviderLogo,
|
|
1930
|
+
onReloadSession: refreshSession,
|
|
1931
|
+
onOpenSandboxFile: dockEnabled ? openSandboxFile : void 0,
|
|
1932
|
+
onOpenAgentSettings: dockEnabled ? openAgentSettings : void 0,
|
|
1933
|
+
onOpenUsageLimit: dockEnabled ? openUsageLimit : void 0,
|
|
1934
|
+
connectionState
|
|
1935
|
+
},
|
|
1936
|
+
session.id
|
|
1937
|
+
);
|
|
1938
|
+
const routeView = /* @__PURE__ */ jsxs("div", { className: "flex min-h-0 w-full min-w-0 flex-1 overflow-hidden", children: [
|
|
1939
|
+
reconnectRequest && /* @__PURE__ */ jsx(LazyPart, { fallback: /* @__PURE__ */ jsx(LoadingPanel, { label: "Opening connection setup" }), children: /* @__PURE__ */ jsx(
|
|
1940
|
+
NativeConnectSetup,
|
|
1941
|
+
{
|
|
1942
|
+
transport: reconnectTransport,
|
|
1943
|
+
workspaceId,
|
|
1944
|
+
request: reconnectRequest,
|
|
1945
|
+
onClose: () => setReconnectRequest(null),
|
|
1946
|
+
onComplete: () => {
|
|
1947
|
+
setReconnectRequest((current) => current === reconnectRequest ? null : current);
|
|
1948
|
+
if (reconnectRequest.providerId === "github-app") {
|
|
1949
|
+
toast.success("GitHub connected");
|
|
1950
|
+
void context.refreshGitHub(workspaceId, void 0, {
|
|
1951
|
+
sync: true,
|
|
1952
|
+
userInitiated: true
|
|
1953
|
+
});
|
|
1954
|
+
return;
|
|
1955
|
+
}
|
|
1956
|
+
const connectionId = reconnectCardConnections.current.get(reconnectRequest);
|
|
1957
|
+
if (connectionId)
|
|
1958
|
+
void Promise.resolve().then(
|
|
1959
|
+
() => context.client.continueAfterCapabilitySetup(workspaceId, sessionId, {
|
|
1960
|
+
connectionId
|
|
1961
|
+
})
|
|
1962
|
+
).catch(() => void 0);
|
|
1963
|
+
toast.success("Connection updated", {
|
|
1964
|
+
description: "New tool calls can use the updated connection."
|
|
1965
|
+
});
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
) }),
|
|
1969
|
+
/* @__PURE__ */ jsx(
|
|
1970
|
+
SessionDock,
|
|
1971
|
+
{
|
|
1972
|
+
workspaceId,
|
|
1973
|
+
sessionId,
|
|
1974
|
+
session,
|
|
1975
|
+
events,
|
|
1976
|
+
connectionState,
|
|
1977
|
+
primary: /* @__PURE__ */ jsx(
|
|
1978
|
+
ChatPaymentPages,
|
|
1979
|
+
{
|
|
1980
|
+
accountId: session?.accountId ?? context.workspaces.find((candidate) => candidate.id === workspaceId)?.accountId,
|
|
1981
|
+
children: chatPane
|
|
1982
|
+
}
|
|
1983
|
+
),
|
|
1984
|
+
onReloadSession: refreshSession,
|
|
1985
|
+
dockCollapsed: !context.inspectorOpen,
|
|
1986
|
+
onDockCollapsedChange: (collapsed) => context.setInspectorOpen(!collapsed),
|
|
1987
|
+
openFileRequest: sandboxFileRequest,
|
|
1988
|
+
openAgentSettingsRequest: agentSettingsRequest?.sessionId === sessionId ? agentSettingsRequest : null,
|
|
1989
|
+
onOpenNavigation: () => {
|
|
1990
|
+
context.setInspectorOpen(false);
|
|
1991
|
+
rail.setDrawerOpen(true);
|
|
1992
|
+
}
|
|
1993
|
+
}
|
|
1994
|
+
)
|
|
1995
|
+
] });
|
|
1996
|
+
return routed ? routeView : /* @__PURE__ */ jsx(SessionStartupProvider, { session, children: routeView });
|
|
1997
|
+
async function approve(approvalId, decision, answer) {
|
|
1998
|
+
try {
|
|
1999
|
+
await context.client.sendApprovalDecision(workspaceId, sessionId, {
|
|
2000
|
+
approvalId,
|
|
2001
|
+
decision,
|
|
2002
|
+
...answer
|
|
2003
|
+
});
|
|
2004
|
+
} catch (error) {
|
|
2005
|
+
if (!(error instanceof OpenGeniApiError && error.status === 409))
|
|
2006
|
+
toast.error("Couldn't submit the decision", {
|
|
2007
|
+
description: userErrorText(error)
|
|
2008
|
+
});
|
|
2009
|
+
throw error instanceof Error ? error : new Error(String(error));
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
function withHostMessageContext(...sources) {
|
|
2014
|
+
const value = sources.map((source) => source?.()).filter((part) => Boolean(part)).join("\n\n");
|
|
2015
|
+
return value ? { modelContext: value } : {};
|
|
2016
|
+
}
|
|
2017
|
+
function lastAgentChange(events) {
|
|
2018
|
+
for (let index = events.length - 1; index >= 0; index -= 1) {
|
|
2019
|
+
const event = events[index];
|
|
2020
|
+
if (event.type !== "session.agent.updated") continue;
|
|
2021
|
+
const pending = !events.slice(index + 1).some((later) => later.type === "turn.started");
|
|
2022
|
+
return { at: event.occurredAt, pending };
|
|
2023
|
+
}
|
|
2024
|
+
return null;
|
|
2025
|
+
}
|
|
2026
|
+
function SessionDock(props) {
|
|
2027
|
+
if (!useSessionUiFeature("dock")) {
|
|
2028
|
+
return /* @__PURE__ */ jsx("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden", children: props.primary });
|
|
2029
|
+
}
|
|
2030
|
+
return /* @__PURE__ */ jsx(SessionDockPanel, { ...props });
|
|
2031
|
+
}
|
|
2032
|
+
function SessionDockPanel(props) {
|
|
2033
|
+
const context = useAppContext();
|
|
2034
|
+
const tabRequestSeq = useRef2(0);
|
|
2035
|
+
const [tabRequest, setTabRequest] = useState3(null);
|
|
2036
|
+
const agentSettingsRequestId = props.openAgentSettingsRequest?.requestId ?? null;
|
|
2037
|
+
const agentSettingsTarget = props.openAgentSettingsRequest?.target ?? "learning";
|
|
2038
|
+
const [agentLearningFocus, setAgentLearningFocus] = useState3(0);
|
|
2039
|
+
const [usageLimitFocus, setUsageLimitFocus] = useState3(0);
|
|
2040
|
+
useEffect4(() => {
|
|
2041
|
+
if (agentSettingsRequestId === null) return;
|
|
2042
|
+
setTabRequest({
|
|
2043
|
+
sessionId: props.sessionId,
|
|
2044
|
+
tab: "agent",
|
|
2045
|
+
requestId: ++tabRequestSeq.current
|
|
2046
|
+
});
|
|
2047
|
+
if (agentSettingsTarget === "usage-limit") setUsageLimitFocus((value) => value + 1);
|
|
2048
|
+
else setAgentLearningFocus((value) => value + 1);
|
|
2049
|
+
}, [agentSettingsRequestId, props.sessionId]);
|
|
2050
|
+
const goalPausedAtLimit = useMemo3(() => goalPausedAtUsageLimit(props.events), [props.events]);
|
|
2051
|
+
const currentTabRequest = tabRequest?.sessionId === props.sessionId ? tabRequest : null;
|
|
2052
|
+
const dockLayoutStorageId = sessionDockLayoutStorageId(
|
|
2053
|
+
context.accessContext.subjectId,
|
|
2054
|
+
props.sessionId
|
|
2055
|
+
);
|
|
2056
|
+
const dockNavigation = useMemo3(
|
|
2057
|
+
() => readSessionDockNavigation(dockLayoutStorageId),
|
|
2058
|
+
[dockLayoutStorageId]
|
|
2059
|
+
);
|
|
2060
|
+
const rememberArtifact = useCallback3(
|
|
2061
|
+
(artifactId) => updateSessionDockNavigation(dockLayoutStorageId, { artifactId }),
|
|
2062
|
+
[dockLayoutStorageId]
|
|
2063
|
+
);
|
|
2064
|
+
const artifactRefreshSequence = useMemo3(() => {
|
|
2065
|
+
for (let index = props.events.length - 1; index >= 0; index -= 1) {
|
|
2066
|
+
const event = props.events[index];
|
|
2067
|
+
if (event && (event.type === "agent.toolCall.output" || event.type === "turn.completed" || event.type === "turn.failed" || event.type === "turn.cancelled")) {
|
|
2068
|
+
return event.sequence;
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
return 0;
|
|
2072
|
+
}, [props.events]);
|
|
2073
|
+
useEffect4(() => {
|
|
2074
|
+
if (artifactRefreshSequence) expireArtifactCatalog(context.client, props.workspaceId);
|
|
2075
|
+
}, [artifactRefreshSequence, context.client, props.workspaceId]);
|
|
2076
|
+
const artifactState = useSessionEditableArtifactSummaries({
|
|
2077
|
+
workspaceId: props.workspaceId,
|
|
2078
|
+
sessionId: props.sessionId,
|
|
2079
|
+
refreshSequence: artifactRefreshSequence
|
|
2080
|
+
});
|
|
2081
|
+
const expireAfterArtifactMutation = useArtifactCatalogMutationInvalidation(
|
|
2082
|
+
context.client,
|
|
2083
|
+
props.workspaceId,
|
|
2084
|
+
expireArtifactCatalog
|
|
2085
|
+
);
|
|
2086
|
+
const [artifactRequest, setArtifactRequest] = useState3(null);
|
|
2087
|
+
const currentArtifactRequest = artifactRequest?.sessionId === props.sessionId ? artifactRequest : null;
|
|
2088
|
+
const artifactTabRequestId = currentArtifactRequest?.requestId ?? null;
|
|
2089
|
+
useEffect4(() => {
|
|
2090
|
+
if (artifactTabRequestId === null) return;
|
|
2091
|
+
setTabRequest({
|
|
2092
|
+
sessionId: props.sessionId,
|
|
2093
|
+
tab: "artifacts",
|
|
2094
|
+
requestId: ++tabRequestSeq.current
|
|
2095
|
+
});
|
|
2096
|
+
}, [artifactTabRequestId, props.sessionId]);
|
|
2097
|
+
const artifactSummaries = [...artifactState.artifacts];
|
|
2098
|
+
if (currentArtifactRequest && !artifactSummaries.some(
|
|
2099
|
+
(item) => item.id === currentArtifactRequest.artifactId && (!currentArtifactRequest.artifactKind || item.modality === currentArtifactRequest.artifactKind || currentArtifactRequest.artifactKind === "file" && item.modality === "image")
|
|
2100
|
+
)) {
|
|
2101
|
+
artifactSummaries.push({
|
|
2102
|
+
id: currentArtifactRequest.artifactId,
|
|
2103
|
+
modality: currentArtifactRequest.artifactKind ?? "site",
|
|
2104
|
+
title: currentArtifactRequest.artifactKind === "image" ? "Image" : currentArtifactRequest.artifactKind === "file" ? "File" : "App"
|
|
2105
|
+
});
|
|
2106
|
+
}
|
|
2107
|
+
const linkState = useSessionLinks({
|
|
2108
|
+
workspaceId: props.workspaceId,
|
|
2109
|
+
sessionId: props.sessionId,
|
|
2110
|
+
events: props.events
|
|
2111
|
+
});
|
|
2112
|
+
const canControlSession = hasWorkspacePermission(
|
|
2113
|
+
context.accessContext,
|
|
2114
|
+
props.workspaceId,
|
|
2115
|
+
"sessions:control"
|
|
2116
|
+
);
|
|
2117
|
+
const linkedPullRequest = useMemo3(
|
|
2118
|
+
() => openPullRequestFromLinks(linkState.links),
|
|
2119
|
+
[linkState.links]
|
|
2120
|
+
);
|
|
2121
|
+
const openPullRequestPending = useRef2(false);
|
|
2122
|
+
const openPullRequest = useCallback3(() => {
|
|
2123
|
+
if (openPullRequestPending.current) return;
|
|
2124
|
+
openPullRequestPending.current = true;
|
|
2125
|
+
void context.client.sendMessage(props.workspaceId, props.sessionId, {
|
|
2126
|
+
text: OPEN_PULL_REQUEST_MESSAGE,
|
|
2127
|
+
clientEventId: crypto.randomUUID()
|
|
2128
|
+
}).catch((failure) => toast.error(userErrorText(failure, "Try again."))).finally(() => {
|
|
2129
|
+
openPullRequestPending.current = false;
|
|
2130
|
+
});
|
|
2131
|
+
}, [context.client, props.workspaceId, props.sessionId]);
|
|
2132
|
+
const sessionArchived = props.session ? sessionReadOnlyArchive(props.session) !== null : false;
|
|
2133
|
+
const canAskAgent = canControlSession && Boolean(props.session) && !sessionArchived;
|
|
2134
|
+
const pullRequestLink = useMemo3(
|
|
2135
|
+
() => pullRequestLinkFromLinks(linkState.links),
|
|
2136
|
+
[linkState.links]
|
|
2137
|
+
);
|
|
2138
|
+
const otherLinks = useMemo3(
|
|
2139
|
+
() => ({
|
|
2140
|
+
...linkState,
|
|
2141
|
+
links: linkState.links.filter((link) => link.id !== pullRequestLink?.id)
|
|
2142
|
+
}),
|
|
2143
|
+
[linkState, pullRequestLink]
|
|
2144
|
+
);
|
|
2145
|
+
const mergePullRequest = useCallback3(
|
|
2146
|
+
async (url) => {
|
|
2147
|
+
try {
|
|
2148
|
+
await context.client.sendMessage(props.workspaceId, props.sessionId, {
|
|
2149
|
+
text: mergePullRequestMessage(url),
|
|
2150
|
+
clientEventId: crypto.randomUUID()
|
|
2151
|
+
});
|
|
2152
|
+
} catch (failure) {
|
|
2153
|
+
toast.error(userErrorText(failure, "Try again."));
|
|
2154
|
+
throw failure;
|
|
2155
|
+
}
|
|
2156
|
+
},
|
|
2157
|
+
[context.client, props.workspaceId, props.sessionId]
|
|
2158
|
+
);
|
|
2159
|
+
const pullRequestTabOpened = useRef2(null);
|
|
2160
|
+
useEffect4(() => {
|
|
2161
|
+
if (!pullRequestLink || pullRequestTabOpened.current === props.sessionId) return;
|
|
2162
|
+
pullRequestTabOpened.current = props.sessionId;
|
|
2163
|
+
if (readSessionDockNavigation(dockLayoutStorageId).activeTab) return;
|
|
2164
|
+
setTabRequest({
|
|
2165
|
+
sessionId: props.sessionId,
|
|
2166
|
+
tab: PULL_REQUEST_TAB,
|
|
2167
|
+
requestId: ++tabRequestSeq.current,
|
|
2168
|
+
// Select it, but don't open a closed panel in the middle of reading.
|
|
2169
|
+
expand: false
|
|
2170
|
+
});
|
|
2171
|
+
}, [pullRequestLink, props.sessionId, dockLayoutStorageId]);
|
|
2172
|
+
const hasChanges = useMemo3(
|
|
2173
|
+
() => initialWorkspaceTab(props.events) === WORKBENCH_TAB_CHANGES,
|
|
2174
|
+
[props.events]
|
|
2175
|
+
);
|
|
2176
|
+
const contentBits = (hasChanges ? 1 : 0) | (pullRequestLink ? 2 : 0) | (artifactSummaries.length > 0 ? 4 : 0);
|
|
2177
|
+
const contentLoaded = linkState.status !== "loading" && artifactState.status !== "loading";
|
|
2178
|
+
const seenContent = useRef2(null);
|
|
2179
|
+
const setInspectorHint = context.setInspectorHint;
|
|
2180
|
+
useEffect4(() => {
|
|
2181
|
+
if (!setInspectorHint) return;
|
|
2182
|
+
const seen = seenContent.current;
|
|
2183
|
+
if (!seen || seen.sessionId !== props.sessionId || !props.dockCollapsed || !contentLoaded) {
|
|
2184
|
+
seenContent.current = { sessionId: props.sessionId, bits: contentBits };
|
|
2185
|
+
setInspectorHint(false);
|
|
2186
|
+
return;
|
|
2187
|
+
}
|
|
2188
|
+
if ((contentBits & ~seen.bits) !== 0) setInspectorHint(true);
|
|
2189
|
+
}, [contentBits, contentLoaded, props.dockCollapsed, props.sessionId, setInspectorHint]);
|
|
2190
|
+
useEffect4(() => () => setInspectorHint?.(false), [setInspectorHint]);
|
|
2191
|
+
const pullRequestNumberLabel = pullRequestLink ? pullRequestNumber(pullRequestLink) : null;
|
|
2192
|
+
const leadingTabs = pullRequestLink ? [
|
|
2193
|
+
{
|
|
2194
|
+
id: PULL_REQUEST_TAB,
|
|
2195
|
+
label: pullRequestNumberLabel ? `PR #${pullRequestNumberLabel}` : "PR",
|
|
2196
|
+
icon: /* @__PURE__ */ jsx(GitPullRequestIcon, {}),
|
|
2197
|
+
content: /* @__PURE__ */ jsx(
|
|
2198
|
+
SessionPullRequestPanel,
|
|
2199
|
+
{
|
|
2200
|
+
workspaceId: props.workspaceId,
|
|
2201
|
+
sessionId: props.sessionId,
|
|
2202
|
+
link: pullRequestLink,
|
|
2203
|
+
...canAskAgent ? { onMerge: () => mergePullRequest(pullRequestLink.url) } : {},
|
|
2204
|
+
...canControlSession && !sessionArchived ? { onRemove: () => void linkState.remove(pullRequestLink.id) } : {}
|
|
2205
|
+
},
|
|
2206
|
+
`${props.sessionId}:${pullRequestLink.id}`
|
|
2207
|
+
)
|
|
2208
|
+
}
|
|
2209
|
+
] : [];
|
|
2210
|
+
const trailingTabs = [];
|
|
2211
|
+
if (otherLinks.links.length > 0) {
|
|
2212
|
+
trailingTabs.push({
|
|
2213
|
+
id: "linked",
|
|
2214
|
+
label: "Linked",
|
|
2215
|
+
icon: /* @__PURE__ */ jsx(LinkIcon, {}),
|
|
2216
|
+
optional: true,
|
|
2217
|
+
content: /* @__PURE__ */ jsx(
|
|
2218
|
+
SessionLinkedPanel,
|
|
2219
|
+
{
|
|
2220
|
+
state: otherLinks,
|
|
2221
|
+
canEdit: canControlSession && !sessionArchived,
|
|
2222
|
+
connectHref: (connect) => connect.capabilityId ? `/workspaces/${encodeURIComponent(props.workspaceId)}/plugins?suggested_capability=${encodeURIComponent(connect.capabilityId)}` : `/workspaces/${encodeURIComponent(props.workspaceId)}/plugins`
|
|
2223
|
+
}
|
|
2224
|
+
)
|
|
2225
|
+
});
|
|
2226
|
+
}
|
|
2227
|
+
trailingTabs.push({
|
|
2228
|
+
id: "artifacts",
|
|
2229
|
+
label: "Artifacts",
|
|
2230
|
+
icon: /* @__PURE__ */ jsx(PanelsTopLeftIcon, {}),
|
|
2231
|
+
// On the strip once the chat has artifacts; until then, in the "+" menu.
|
|
2232
|
+
...artifactSummaries.length === 0 ? { optional: true, inMenu: true } : {},
|
|
2233
|
+
content: /* @__PURE__ */ jsx(LazyPart, { fallback: /* @__PURE__ */ jsx(LoadingPanel, { label: "Opening artifact" }), children: /* @__PURE__ */ jsx(
|
|
2234
|
+
LazySessionEditableArtifactsWorkspace,
|
|
2235
|
+
{
|
|
2236
|
+
workspaceId: props.workspaceId,
|
|
2237
|
+
sessionId: props.sessionId,
|
|
2238
|
+
artifacts: artifactSummaries,
|
|
2239
|
+
status: artifactState.status,
|
|
2240
|
+
onRetry: artifactState.retry,
|
|
2241
|
+
initialSelectedArtifactId: dockNavigation.artifactId,
|
|
2242
|
+
openArtifactRequest: currentArtifactRequest,
|
|
2243
|
+
onSelectedArtifactIdChange: rememberArtifact,
|
|
2244
|
+
onPin: hasWorkspacePermission(context.accessContext, props.workspaceId, "artifacts:publish") ? async (item, pinned) => {
|
|
2245
|
+
await context.client.updateArtifactPin(
|
|
2246
|
+
props.workspaceId,
|
|
2247
|
+
item.kind,
|
|
2248
|
+
item.id,
|
|
2249
|
+
pinned
|
|
2250
|
+
);
|
|
2251
|
+
artifactState.applyPin(item.kind, item.id, pinned);
|
|
2252
|
+
expireAfterArtifactMutation();
|
|
2253
|
+
artifactState.retry();
|
|
2254
|
+
} : void 0
|
|
2255
|
+
},
|
|
2256
|
+
props.sessionId
|
|
2257
|
+
) })
|
|
2258
|
+
});
|
|
2259
|
+
if (props.session) {
|
|
2260
|
+
trailingTabs.push({
|
|
2261
|
+
id: "agent",
|
|
2262
|
+
label: "Settings",
|
|
2263
|
+
icon: /* @__PURE__ */ jsx(SettingsIcon, {}),
|
|
2264
|
+
optional: true,
|
|
2265
|
+
// Rarely needed: kept in "+" even when the strip has room.
|
|
2266
|
+
inMenu: true,
|
|
2267
|
+
content: /* @__PURE__ */ jsx(LazyPart, { fallback: /* @__PURE__ */ jsx(LoadingPanel, { label: "Opening settings" }), children: /* @__PURE__ */ jsx(
|
|
2268
|
+
LazyAgentConfigurationPanel,
|
|
2269
|
+
{
|
|
2270
|
+
session: props.session,
|
|
2271
|
+
lastChange: lastAgentChange(props.events),
|
|
2272
|
+
onReloadSession: props.onReloadSession,
|
|
2273
|
+
learningFocusRequest: agentLearningFocus,
|
|
2274
|
+
usageLimitFocusRequest: usageLimitFocus,
|
|
2275
|
+
goalPausedAtUsageLimit: goalPausedAtLimit
|
|
2276
|
+
},
|
|
2277
|
+
props.session.id
|
|
2278
|
+
) })
|
|
2279
|
+
});
|
|
2280
|
+
}
|
|
2281
|
+
if (props.session) {
|
|
2282
|
+
trailingTabs.push({
|
|
2283
|
+
id: "debug",
|
|
2284
|
+
label: "Debug",
|
|
2285
|
+
icon: /* @__PURE__ */ jsx(BugIcon, {}),
|
|
2286
|
+
optional: true,
|
|
2287
|
+
inMenu: true,
|
|
2288
|
+
content: /* @__PURE__ */ jsx(LazyPart, { fallback: /* @__PURE__ */ jsx(LoadingPanel, { label: "Opening debug inspector" }), children: /* @__PURE__ */ jsx(
|
|
2289
|
+
LazySessionInspector,
|
|
2290
|
+
{
|
|
2291
|
+
session: props.session,
|
|
2292
|
+
events: props.events,
|
|
2293
|
+
connectionState: props.connectionState,
|
|
2294
|
+
onReloadSession: props.onReloadSession
|
|
2295
|
+
}
|
|
2296
|
+
) })
|
|
2297
|
+
});
|
|
2298
|
+
}
|
|
2299
|
+
return /* @__PURE__ */ jsx(
|
|
2300
|
+
SessionWorkspace,
|
|
2301
|
+
{
|
|
2302
|
+
workspaceId: props.workspaceId,
|
|
2303
|
+
sessionId: props.sessionId,
|
|
2304
|
+
preferenceOwnerId: context.accessContext.subjectId,
|
|
2305
|
+
events: props.events,
|
|
2306
|
+
primary: /* @__PURE__ */ jsx(
|
|
2307
|
+
ArtifactLinkBoundary,
|
|
2308
|
+
{
|
|
2309
|
+
workspaceId: props.workspaceId,
|
|
2310
|
+
onOpen: (target2) => {
|
|
2311
|
+
if (target2.editable && !artifactSummaries.some(
|
|
2312
|
+
(item) => item.id === target2.id && isEditableArtifactKind(item.modality)
|
|
2313
|
+
))
|
|
2314
|
+
return false;
|
|
2315
|
+
setArtifactRequest((previous) => ({
|
|
2316
|
+
sessionId: props.sessionId,
|
|
2317
|
+
artifactId: target2.id,
|
|
2318
|
+
artifactKind: target2.kind === "file" ? artifactSummaries.find(
|
|
2319
|
+
(item) => item.id === target2.id && (item.modality === "file" || item.modality === "image")
|
|
2320
|
+
)?.modality ?? "file" : target2.editable ? artifactSummaries.find(
|
|
2321
|
+
(item) => item.id === target2.id && isEditableArtifactKind(item.modality)
|
|
2322
|
+
)?.modality : "site",
|
|
2323
|
+
requestId: (previous?.requestId ?? 0) + 1,
|
|
2324
|
+
tab: "artifacts"
|
|
2325
|
+
}));
|
|
2326
|
+
return true;
|
|
2327
|
+
},
|
|
2328
|
+
children: props.primary
|
|
2329
|
+
}
|
|
2330
|
+
),
|
|
2331
|
+
openTabRequest: currentTabRequest,
|
|
2332
|
+
leadingTabs,
|
|
2333
|
+
trailingTabs,
|
|
2334
|
+
pullRequest: linkedPullRequest,
|
|
2335
|
+
...canAskAgent ? { onOpenPullRequest: openPullRequest } : {},
|
|
2336
|
+
collapsed: props.dockCollapsed,
|
|
2337
|
+
onCollapsedChange: props.onDockCollapsedChange,
|
|
2338
|
+
...props.openFileRequest ? { openFileRequest: props.openFileRequest } : {},
|
|
2339
|
+
mobileLeadingControl: /* @__PURE__ */ jsx(
|
|
2340
|
+
Button,
|
|
2341
|
+
{
|
|
2342
|
+
type: "button",
|
|
2343
|
+
variant: "ghost",
|
|
2344
|
+
size: "icon-sm",
|
|
2345
|
+
"aria-label": "Open navigation",
|
|
2346
|
+
onClick: props.onOpenNavigation,
|
|
2347
|
+
className: "size-11",
|
|
2348
|
+
children: /* @__PURE__ */ jsx(MenuIcon, { className: "size-4" })
|
|
2349
|
+
}
|
|
2350
|
+
)
|
|
2351
|
+
}
|
|
2352
|
+
);
|
|
2353
|
+
}
|
|
2354
|
+
function useSessionEditableArtifactSummaries(input) {
|
|
2355
|
+
const context = useAppContext();
|
|
2356
|
+
const authorityKey = `${input.workspaceId}:${input.sessionId}:${context.accessKeyVersion}`;
|
|
2357
|
+
const [retrySequence, setRetrySequence] = useState3(0);
|
|
2358
|
+
const discovery = useRef2(null);
|
|
2359
|
+
const [loaded, setLoaded] = useState3(null);
|
|
2360
|
+
useEffect4(
|
|
2361
|
+
() => () => {
|
|
2362
|
+
discovery.current = null;
|
|
2363
|
+
},
|
|
2364
|
+
[]
|
|
2365
|
+
);
|
|
2366
|
+
useEffect4(() => {
|
|
2367
|
+
if (discovery.current?.key !== authorityKey || discovery.current.client !== context.client || discovery.current.retrySequence !== retrySequence)
|
|
2368
|
+
discovery.current = {
|
|
2369
|
+
key: authorityKey,
|
|
2370
|
+
client: context.client,
|
|
2371
|
+
retrySequence,
|
|
2372
|
+
running: false,
|
|
2373
|
+
again: false
|
|
2374
|
+
};
|
|
2375
|
+
const run = discovery.current;
|
|
2376
|
+
setLoaded(
|
|
2377
|
+
(previous) => previous?.key === authorityKey && previous.client === context.client && previous.status === "ready" ? previous : {
|
|
2378
|
+
key: authorityKey,
|
|
2379
|
+
client: context.client,
|
|
2380
|
+
status: "loading",
|
|
2381
|
+
artifacts: previous?.key === authorityKey && previous.client === context.client ? previous.artifacts : []
|
|
2382
|
+
}
|
|
2383
|
+
);
|
|
2384
|
+
if (run.running) {
|
|
2385
|
+
run.again = true;
|
|
2386
|
+
return;
|
|
2387
|
+
}
|
|
2388
|
+
const workspaceId = input.workspaceId;
|
|
2389
|
+
const sessionId = input.sessionId;
|
|
2390
|
+
const client = context.client;
|
|
2391
|
+
const live = () => discovery.current === run;
|
|
2392
|
+
const previousArtifacts = (previous) => previous?.key === authorityKey && previous.client === client ? previous.artifacts : [];
|
|
2393
|
+
const start = () => {
|
|
2394
|
+
run.running = true;
|
|
2395
|
+
run.again = false;
|
|
2396
|
+
void import("./app/lib/session-artifact-discovery.js").then(async ({ discoverSessionArtifacts }) => {
|
|
2397
|
+
const reconcile = await discoverSessionArtifacts(workspaceId, sessionId, live, client);
|
|
2398
|
+
if (live())
|
|
2399
|
+
setLoaded((previous) => ({
|
|
2400
|
+
key: authorityKey,
|
|
2401
|
+
client,
|
|
2402
|
+
...reconcile(previousArtifacts(previous))
|
|
2403
|
+
}));
|
|
2404
|
+
}).catch(() => {
|
|
2405
|
+
if (!live()) return;
|
|
2406
|
+
setLoaded((previous) => ({
|
|
2407
|
+
key: authorityKey,
|
|
2408
|
+
client,
|
|
2409
|
+
status: "error",
|
|
2410
|
+
artifacts: previousArtifacts(previous)
|
|
2411
|
+
}));
|
|
2412
|
+
}).finally(() => {
|
|
2413
|
+
run.running = false;
|
|
2414
|
+
if (run.again && live()) start();
|
|
2415
|
+
});
|
|
2416
|
+
};
|
|
2417
|
+
start();
|
|
2418
|
+
}, [
|
|
2419
|
+
authorityKey,
|
|
2420
|
+
context.client,
|
|
2421
|
+
input.refreshSequence,
|
|
2422
|
+
input.sessionId,
|
|
2423
|
+
input.workspaceId,
|
|
2424
|
+
retrySequence
|
|
2425
|
+
]);
|
|
2426
|
+
const retry = useCallback3(() => setRetrySequence((value) => value + 1), []);
|
|
2427
|
+
const applyPin = useCallback3(
|
|
2428
|
+
(kind, id, pinned) => {
|
|
2429
|
+
setLoaded((previous) => {
|
|
2430
|
+
if (previous?.key !== authorityKey || previous.client !== context.client) return previous;
|
|
2431
|
+
return {
|
|
2432
|
+
...previous,
|
|
2433
|
+
artifacts: previous.artifacts.map(
|
|
2434
|
+
(artifact) => artifact.modality === kind && artifact.id === id && artifact.catalogItem ? { ...artifact, catalogItem: { ...artifact.catalogItem, pinned } } : artifact
|
|
2435
|
+
)
|
|
2436
|
+
};
|
|
2437
|
+
});
|
|
2438
|
+
},
|
|
2439
|
+
[authorityKey, context.client]
|
|
2440
|
+
);
|
|
2441
|
+
return loaded?.key === authorityKey && loaded.client === context.client ? { artifacts: loaded.artifacts, status: loaded.status, retry, applyPin } : { artifacts: [], status: "loading", retry, applyPin };
|
|
2442
|
+
}
|
|
2443
|
+
function approvalDecisionKey(approval) {
|
|
2444
|
+
return `${approval.id}\0${approval.elicitation?.round ?? ""}`;
|
|
2445
|
+
}
|
|
2446
|
+
function SessionChatPane(props) {
|
|
2447
|
+
const findEvents = useUiEventTarget("document");
|
|
2448
|
+
const portalContainer = usePortalContainer();
|
|
2449
|
+
const [panelRoot, setPanelRoot] = useState3(null);
|
|
2450
|
+
const context = useAppContext();
|
|
2451
|
+
const api = useAppApi();
|
|
2452
|
+
const page = usePage();
|
|
2453
|
+
const navigate = useNavigate();
|
|
2454
|
+
const openSession = useCallback3(
|
|
2455
|
+
(workspaceId, sessionId) => void navigate({
|
|
2456
|
+
to: "/workspaces/$workspaceId/sessions/$sessionId",
|
|
2457
|
+
params: { workspaceId, sessionId }
|
|
2458
|
+
}),
|
|
2459
|
+
[navigate]
|
|
2460
|
+
);
|
|
2461
|
+
const resolveLink = useWorkspaceAppLinkResolver(props.session.workspaceId, openSession);
|
|
2462
|
+
const hostMessageContext = useHostMessageContext();
|
|
2463
|
+
const gutter = props.placement === "panel" ? "px-3" : "px-4 sm:px-6";
|
|
2464
|
+
const realtimeClient = useMemo3(
|
|
2465
|
+
() => api.voiceRealtimeClient(context.client, () => page.href()),
|
|
2466
|
+
[api, context.client, page]
|
|
2467
|
+
);
|
|
2468
|
+
const momentSequence = props.searchTarget.find ? void 0 : props.searchTarget.at;
|
|
2469
|
+
const loadedMoment = useRef2(null);
|
|
2470
|
+
const { onJumpToSequence, initialLoading: historyLoading } = props;
|
|
2471
|
+
const firstLoadedSequence = props.events[0]?.sequence;
|
|
2472
|
+
useEffect4(() => {
|
|
2473
|
+
if (!momentSequence || historyLoading || loadedMoment.current === momentSequence) return;
|
|
2474
|
+
loadedMoment.current = momentSequence;
|
|
2475
|
+
if (firstLoadedSequence !== void 0 && firstLoadedSequence > momentSequence) {
|
|
2476
|
+
void onJumpToSequence(momentSequence);
|
|
2477
|
+
}
|
|
2478
|
+
}, [momentSequence, historyLoading, firstLoadedSequence, onJumpToSequence]);
|
|
2479
|
+
const [findOpen, setFindOpen] = useState3(!!props.searchTarget.find);
|
|
2480
|
+
const [findMounted, setFindMounted] = useState3(!!props.searchTarget.find);
|
|
2481
|
+
const [findFocusRevision, setFindFocusRevision] = useState3(0);
|
|
2482
|
+
const [activeSearchTarget, setActiveSearchTarget] = useState3(null);
|
|
2483
|
+
const findReturnFocus = useRef2(null);
|
|
2484
|
+
const openFind = useCallback3(() => {
|
|
2485
|
+
const active = document.activeElement;
|
|
2486
|
+
if (active instanceof HTMLElement && active !== document.body) findReturnFocus.current = active;
|
|
2487
|
+
setFindMounted(true);
|
|
2488
|
+
setFindOpen(true);
|
|
2489
|
+
setFindFocusRevision((value) => value + 1);
|
|
2490
|
+
}, []);
|
|
2491
|
+
const { onSearchOriginConsumed } = props;
|
|
2492
|
+
const closeFind = useCallback3(() => {
|
|
2493
|
+
setFindOpen(false);
|
|
2494
|
+
setActiveSearchTarget(null);
|
|
2495
|
+
onSearchOriginConsumed();
|
|
2496
|
+
requestAnimationFrame(() => {
|
|
2497
|
+
const opener = findReturnFocus.current;
|
|
2498
|
+
findReturnFocus.current = null;
|
|
2499
|
+
const trigger = document.querySelector("[data-conversation-find-trigger]");
|
|
2500
|
+
const target2 = opener?.isConnected ? opener : trigger && trigger.getClientRects().length > 0 ? trigger : null;
|
|
2501
|
+
target2?.focus({ preventScroll: true });
|
|
2502
|
+
});
|
|
2503
|
+
}, [onSearchOriginConsumed]);
|
|
2504
|
+
useEffect4(() => {
|
|
2505
|
+
findEvents.addEventListener(OPEN_CONVERSATION_FIND_EVENT, openFind);
|
|
2506
|
+
return () => findEvents.removeEventListener(OPEN_CONVERSATION_FIND_EVENT, openFind);
|
|
2507
|
+
}, [findEvents, openFind]);
|
|
2508
|
+
useEffect4(() => {
|
|
2509
|
+
if (props.searchTarget.find) openFind();
|
|
2510
|
+
}, [
|
|
2511
|
+
props.searchTarget.find,
|
|
2512
|
+
props.searchTarget.matchSequence,
|
|
2513
|
+
props.searchTarget.matchOffset,
|
|
2514
|
+
openFind
|
|
2515
|
+
]);
|
|
2516
|
+
useFindShortcut(
|
|
2517
|
+
props.placement === "panel" ? { scope: panelRoot } : { scope: portalContainer ?? window },
|
|
2518
|
+
openFind
|
|
2519
|
+
);
|
|
2520
|
+
const fundingRevision = useMemo3(() => {
|
|
2521
|
+
for (let index = props.events.length - 1; index >= 0; index -= 1) {
|
|
2522
|
+
const event = props.events[index];
|
|
2523
|
+
if (event.type === "agent.model.usage") return event.sequence;
|
|
2524
|
+
}
|
|
2525
|
+
return 0;
|
|
2526
|
+
}, [props.events]);
|
|
2527
|
+
const modelCatalog = useWorkspaceModelCatalog(
|
|
2528
|
+
props.session.workspaceId,
|
|
2529
|
+
`${props.session.id}:${props.session.status}:${fundingRevision}`
|
|
2530
|
+
);
|
|
2531
|
+
const fleet = useWorkspaceMachines({
|
|
2532
|
+
sessionId: props.session.id,
|
|
2533
|
+
pollIntervalMs: MACHINES_SESSION_POLL_MS
|
|
2534
|
+
});
|
|
2535
|
+
const computeLabel = sessionComputeLabel(t, fleet.machines);
|
|
2536
|
+
const loadRetainedScreenshot = useMemo3(
|
|
2537
|
+
() => createSessionRetainedScreenshotLoader(
|
|
2538
|
+
context.client,
|
|
2539
|
+
props.session.workspaceId,
|
|
2540
|
+
props.session.id
|
|
2541
|
+
),
|
|
2542
|
+
[context.client, props.session.id, props.session.workspaceId]
|
|
2543
|
+
);
|
|
2544
|
+
const loadRetainedArtifact = useMemo3(
|
|
2545
|
+
() => createWorkspaceRetainedArtifactLoader(context.client, props.session.workspaceId),
|
|
2546
|
+
[context.client, props.session.workspaceId]
|
|
2547
|
+
);
|
|
2548
|
+
const loadVideoArtifactPlayback = useMemo3(
|
|
2549
|
+
() => createWorkspaceRetainedVideoLoader(context.client, props.session.workspaceId),
|
|
2550
|
+
[context.client, props.session.workspaceId]
|
|
2551
|
+
);
|
|
2552
|
+
const readOnlyArchive = sessionReadOnlyArchive(props.session);
|
|
2553
|
+
const cancelled = readOnlyArchive === null && isTerminalSessionStatus(props.session.status);
|
|
2554
|
+
const terminal = cancelled || readOnlyArchive !== null;
|
|
2555
|
+
const answerStore = useMemo3(() => browserInteractiveAnswerStore(), []);
|
|
2556
|
+
const composerRegionRef = useRef2(null);
|
|
2557
|
+
const [composerFocusSignal, setComposerFocusSignal] = useState3(0);
|
|
2558
|
+
const focusEvents = useUiEventTarget("window");
|
|
2559
|
+
const [modelPickerSession, setModelPickerSession] = useState3(null);
|
|
2560
|
+
const { simplified: simplifiedInterface } = useSimplifiedInterface();
|
|
2561
|
+
const [refusedModel, setRefusedModel] = useState3(
|
|
2562
|
+
null
|
|
2563
|
+
);
|
|
2564
|
+
const [creditRefusal, setCreditRefusal] = useState3(null);
|
|
2565
|
+
useEffect4(() => {
|
|
2566
|
+
const onFocusRequest = (event) => {
|
|
2567
|
+
const detail = event.detail;
|
|
2568
|
+
if (detail?.workspaceId === props.session.workspaceId && detail.sessionId === props.session.id) {
|
|
2569
|
+
setComposerFocusSignal(detail.nonce);
|
|
2570
|
+
}
|
|
2571
|
+
};
|
|
2572
|
+
focusEvents.addEventListener(FOCUS_SESSION_COMPOSER_EVENT, onFocusRequest);
|
|
2573
|
+
return () => focusEvents.removeEventListener(FOCUS_SESSION_COMPOSER_EVENT, onFocusRequest);
|
|
2574
|
+
}, [focusEvents, props.session.id, props.session.workspaceId]);
|
|
2575
|
+
const loadFocusSessionRef = useRef2(null);
|
|
2576
|
+
const composerFocusWaitRef = useRef2(null);
|
|
2577
|
+
useEffect4(
|
|
2578
|
+
() => () => {
|
|
2579
|
+
composerFocusWaitRef.current?.cancel();
|
|
2580
|
+
composerFocusWaitRef.current = null;
|
|
2581
|
+
},
|
|
2582
|
+
[]
|
|
2583
|
+
);
|
|
2584
|
+
useEffect4(() => {
|
|
2585
|
+
if (composerFocusWaitRef.current && composerFocusWaitRef.current.sessionId !== props.session.id) {
|
|
2586
|
+
composerFocusWaitRef.current.cancel();
|
|
2587
|
+
composerFocusWaitRef.current = null;
|
|
2588
|
+
}
|
|
2589
|
+
const intent = consumeSessionComposerFocusIntent(
|
|
2590
|
+
focusEvents,
|
|
2591
|
+
props.session.workspaceId,
|
|
2592
|
+
props.session.id
|
|
2593
|
+
);
|
|
2594
|
+
const firstRunForChat = loadFocusSessionRef.current !== props.session.id;
|
|
2595
|
+
loadFocusSessionRef.current = props.session.id;
|
|
2596
|
+
const source = intent?.source ?? (firstRunForChat ? "load" : null);
|
|
2597
|
+
if (!source) return;
|
|
2598
|
+
if (!sessionComposerFocusIntentIsEligible({
|
|
2599
|
+
viewportWidth: globalThis.innerWidth,
|
|
2600
|
+
coarsePointer: globalThis.matchMedia?.("(pointer: coarse)").matches ?? false,
|
|
2601
|
+
terminal,
|
|
2602
|
+
requiresAction: props.session.status === "requires_action",
|
|
2603
|
+
pendingHumanInput: props.humanInput.requests.length > 0,
|
|
2604
|
+
pendingApproval: props.approvals.length > 0
|
|
2605
|
+
})) {
|
|
2606
|
+
return;
|
|
2607
|
+
}
|
|
2608
|
+
composerFocusWaitRef.current?.cancel();
|
|
2609
|
+
composerFocusWaitRef.current = {
|
|
2610
|
+
sessionId: props.session.id,
|
|
2611
|
+
cancel: focusSessionComposerWhenReady({
|
|
2612
|
+
textarea: () => composerRegionRef.current?.querySelector("textarea"),
|
|
2613
|
+
sessionId: props.session.id,
|
|
2614
|
+
source
|
|
2615
|
+
})
|
|
2616
|
+
};
|
|
2617
|
+
}, [
|
|
2618
|
+
composerFocusSignal,
|
|
2619
|
+
focusEvents,
|
|
2620
|
+
props.approvals.length,
|
|
2621
|
+
props.humanInput.requests.length,
|
|
2622
|
+
props.session.id,
|
|
2623
|
+
props.session.status,
|
|
2624
|
+
props.session.workspaceId,
|
|
2625
|
+
terminal
|
|
2626
|
+
]);
|
|
2627
|
+
const agentsSignal = useMemo3(() => sessionAgentsSignal(t, props.agentNodes), [props.agentNodes]);
|
|
2628
|
+
const [resumingSubSessions, setResumingSubSessions] = useState3(
|
|
2629
|
+
() => /* @__PURE__ */ new Set()
|
|
2630
|
+
);
|
|
2631
|
+
const onSubSessionResumingChange = useCallback3((sessionId, resuming) => {
|
|
2632
|
+
setResumingSubSessions((current) => {
|
|
2633
|
+
if (current.has(sessionId) === resuming) return current;
|
|
2634
|
+
const next = new Set(current);
|
|
2635
|
+
if (resuming) next.add(sessionId);
|
|
2636
|
+
else next.delete(sessionId);
|
|
2637
|
+
return next;
|
|
2638
|
+
});
|
|
2639
|
+
}, []);
|
|
2640
|
+
const waitingSubSessions = useMemo3(
|
|
2641
|
+
() => waitingDescendants(props.agentNodes, resumingSubSessions),
|
|
2642
|
+
[props.agentNodes, resumingSubSessions]
|
|
2643
|
+
);
|
|
2644
|
+
useEffect4(() => {
|
|
2645
|
+
if (resumingSubSessions.size === 0) return;
|
|
2646
|
+
const live = new Set(waitingSubSessions.map((session) => session.id));
|
|
2647
|
+
for (const id of resumingSubSessions) {
|
|
2648
|
+
if (!live.has(id)) onSubSessionResumingChange(id, false);
|
|
2649
|
+
}
|
|
2650
|
+
}, [onSubSessionResumingChange, resumingSubSessions, waitingSubSessions]);
|
|
2651
|
+
const codexConnected = modelCatalog.models.some(
|
|
2652
|
+
(candidate) => candidate.provider === "codex-subscription" && candidate.credentialReadiness.status === "ready"
|
|
2653
|
+
);
|
|
2654
|
+
const [voiceActive, setVoiceActive] = useState3(false);
|
|
2655
|
+
const onVoiceActiveChange = useCallback3((active) => {
|
|
2656
|
+
setVoiceActive(active);
|
|
2657
|
+
}, []);
|
|
2658
|
+
const [selectedApprovalId, setSelectedApprovalId] = useState3(null);
|
|
2659
|
+
const [reviewDetails, setReviewDetails] = useState3(null);
|
|
2660
|
+
const loadToolReview = useCallback3(
|
|
2661
|
+
(approval) => context.client.getToolActionReview(props.session.workspaceId, props.session.id, approval.id),
|
|
2662
|
+
[context.client, props.session.workspaceId, props.session.id]
|
|
2663
|
+
);
|
|
2664
|
+
const loadRecordedToolReview = useCallback3(
|
|
2665
|
+
(id) => context.client.getToolActionReview(props.session.workspaceId, props.session.id, id),
|
|
2666
|
+
[context.client, props.session.workspaceId, props.session.id]
|
|
2667
|
+
);
|
|
2668
|
+
const viewToolReviewDetails = useCallback3(
|
|
2669
|
+
(review, path) => setReviewDetails({
|
|
2670
|
+
review,
|
|
2671
|
+
path,
|
|
2672
|
+
origin: document.activeElement?.closest("[data-review-origin]")?.getAttribute("data-review-origin") ?? void 0
|
|
2673
|
+
}),
|
|
2674
|
+
[]
|
|
2675
|
+
);
|
|
2676
|
+
const loadToolReviewDetails = useCallback3(
|
|
2677
|
+
(review, path, offset) => context.client.getToolReviewDetails(props.session.workspaceId, props.session.id, review.id, {
|
|
2678
|
+
actionDigest: review.actionDigest,
|
|
2679
|
+
path,
|
|
2680
|
+
offset
|
|
2681
|
+
}),
|
|
2682
|
+
[context.client, props.session.workspaceId, props.session.id]
|
|
2683
|
+
);
|
|
2684
|
+
const [approvalPending, setApprovalPending] = useState3({});
|
|
2685
|
+
const [approvalSettled, setApprovalSettled] = useState3({});
|
|
2686
|
+
useEffect4(() => {
|
|
2687
|
+
if (!approvalsDecidable(props.session.status)) {
|
|
2688
|
+
setApprovalPending((current) => Object.keys(current).length ? {} : current);
|
|
2689
|
+
setApprovalSettled((current) => Object.keys(current).length ? {} : current);
|
|
2690
|
+
}
|
|
2691
|
+
}, [props.session.status]);
|
|
2692
|
+
useEffect4(() => {
|
|
2693
|
+
const waiting = new Set(props.approvals.map(approvalDecisionKey));
|
|
2694
|
+
setApprovalSettled((current) => {
|
|
2695
|
+
const kept = Object.entries(current).filter(([key]) => waiting.has(key));
|
|
2696
|
+
return kept.length === Object.keys(current).length ? current : Object.fromEntries(kept);
|
|
2697
|
+
});
|
|
2698
|
+
}, [props.approvals]);
|
|
2699
|
+
const approvalInFlightRef = useRef2(/* @__PURE__ */ new Set());
|
|
2700
|
+
const decideApproval = useCallback3(
|
|
2701
|
+
async (approvalId, decision, answer) => {
|
|
2702
|
+
const approval = props.approvals.find((candidate) => candidate.id === approvalId);
|
|
2703
|
+
const key = approval ? approvalDecisionKey(approval) : approvalId;
|
|
2704
|
+
if (approvalInFlightRef.current.has(key) || approvalPending[key] || approvalSettled[key]) {
|
|
2705
|
+
return;
|
|
2706
|
+
}
|
|
2707
|
+
approvalInFlightRef.current.add(key);
|
|
2708
|
+
setApprovalPending((current) => ({ ...current, [key]: decision }));
|
|
2709
|
+
try {
|
|
2710
|
+
await (decision === "approve" ? props.onApprove(approvalId, answer) : props.onReject(approvalId));
|
|
2711
|
+
setApprovalSettled((current) => ({
|
|
2712
|
+
...current,
|
|
2713
|
+
[key]: decision
|
|
2714
|
+
}));
|
|
2715
|
+
} finally {
|
|
2716
|
+
approvalInFlightRef.current.delete(key);
|
|
2717
|
+
setApprovalPending((current) => {
|
|
2718
|
+
const next = { ...current };
|
|
2719
|
+
delete next[key];
|
|
2720
|
+
return next;
|
|
2721
|
+
});
|
|
2722
|
+
}
|
|
2723
|
+
},
|
|
2724
|
+
[approvalPending, approvalSettled, props]
|
|
2725
|
+
);
|
|
2726
|
+
const attachments = useFileAttachments({ scope: uploadScopeForSession(props.session) });
|
|
2727
|
+
const repositories = useFollowUpRepositories(props.session, props.onConnectGitHubApp);
|
|
2728
|
+
const firstPartyToolOptions = firstPartySessionToolOptionsFor(
|
|
2729
|
+
clientFirstPartyMcpToolPolicy(context.clientConfig).allowed
|
|
2730
|
+
);
|
|
2731
|
+
const selectableSessionMcpServers = context.toolMcpServers;
|
|
2732
|
+
const selectableToolIds = useMemo3(
|
|
2733
|
+
() => selectableSessionMcpServers.map((server) => server.id),
|
|
2734
|
+
[selectableSessionMcpServers]
|
|
2735
|
+
);
|
|
2736
|
+
const policyToolIds = useMemo3(
|
|
2737
|
+
() => sessionPolicyPickerIds(props.session, selectableToolIds, context.workspaceDefaultToolIds),
|
|
2738
|
+
[context.workspaceDefaultToolIds, props.session, selectableToolIds]
|
|
2739
|
+
);
|
|
2740
|
+
const [durableToolSelection, setDurableToolSelection] = useState3(() => ({
|
|
2741
|
+
mcpServerIds: new Set(policyToolIds),
|
|
2742
|
+
firstPartyToolIds: new Set(props.session.firstPartyMcpTools)
|
|
2743
|
+
}));
|
|
2744
|
+
const [durableToolsSnapshot, setDurableToolsSnapshot] = useState3(props.session);
|
|
2745
|
+
const durableToolsSaveInFlight = useRef2(false);
|
|
2746
|
+
const [durableToolsHydrated, setDurableToolsHydrated] = useState3(false);
|
|
2747
|
+
const durableToolsSessionId = useRef2(props.session.id);
|
|
2748
|
+
const [durableToolsSaving, setDurableToolsSaving] = useState3(false);
|
|
2749
|
+
const [durableToolsError, setDurableToolsError] = useState3(null);
|
|
2750
|
+
const [connectorCustomizingOverride, setConnectorCustomizingOverride] = useState3(
|
|
2751
|
+
null
|
|
2752
|
+
);
|
|
2753
|
+
const runsOn = useSessionRunsOn(props.session.id, props.session.sandboxBackend);
|
|
2754
|
+
const machineAccess = currentSessionMachineAccess(
|
|
2755
|
+
runsOn.fleet.sessionMachineAccess,
|
|
2756
|
+
props.session.activeSandboxId
|
|
2757
|
+
);
|
|
2758
|
+
const sharedChat = props.session.tenancy?.visibility === "workspace" && !isPersonalWorkspace(
|
|
2759
|
+
context.workspaces.find((candidate) => candidate.id === props.session.workspaceId) ?? null,
|
|
2760
|
+
context.managedSelfContext
|
|
2761
|
+
);
|
|
2762
|
+
const ownerAskedToAllow = machineAccess?.isOwner === true && sessionAdmissionShowsMachineAccess(sessionAdmissionReason(props.session), machineAccess);
|
|
2763
|
+
const showMachineAccess = machineAccess !== null && (!machineAccess.isOwner || sharedChat && !ownerAskedToAllow);
|
|
2764
|
+
const connectionAccounts = useConnectionAccounts(
|
|
2765
|
+
context.client,
|
|
2766
|
+
{
|
|
2767
|
+
id: props.session.id,
|
|
2768
|
+
workspaceId: props.session.workspaceId,
|
|
2769
|
+
selectedIds: [...durableToolSelection.mcpServerIds]
|
|
2770
|
+
},
|
|
2771
|
+
context.workspaceCapabilityCatalog,
|
|
2772
|
+
context.accessContext === null ? null : hasWorkspacePermission(
|
|
2773
|
+
context.accessContext,
|
|
2774
|
+
props.session.workspaceId,
|
|
2775
|
+
"connections:read"
|
|
2776
|
+
)
|
|
2777
|
+
);
|
|
2778
|
+
const chatSendContext = useRef2({
|
|
2779
|
+
blocked: null,
|
|
2780
|
+
awaitingHuman: false,
|
|
2781
|
+
extras: {}
|
|
2782
|
+
});
|
|
2783
|
+
const readChatSendContext = useCallback3(() => chatSendContext.current, []);
|
|
2784
|
+
const runsOnAttach = runsOn.fleet.attach;
|
|
2785
|
+
const runsOnPreviousSandboxId = runsOn.fleet.activeSandboxId;
|
|
2786
|
+
const runsOnActiveMachineConsent = runsOn.activeMachine && isPersonalMachine(runsOn.activeMachine) && runsOn.activeMachine.sandboxId === props.session.activeSandboxId ? personalMachineUseIntent(props.session.tenancy) : void 0;
|
|
2787
|
+
const runsOnCanMessage = context.accessContext === null || context.accessContext === void 0 || hasWorkspacePermission(context.accessContext, props.session.workspaceId, "sessions:control");
|
|
2788
|
+
const reloadSessionAfterMachineChange = props.onReloadSession;
|
|
2789
|
+
const moveSavedMessage = runsOnAttach;
|
|
2790
|
+
const moveRunsOn = useCallback3(
|
|
2791
|
+
async (machine) => {
|
|
2792
|
+
if (!isPersonalMachine(machine)) {
|
|
2793
|
+
if (!await runsOnAttach(machine.sandboxId))
|
|
2794
|
+
return "The machine change could not be confirmed. Try refreshing the machine list.";
|
|
2795
|
+
await reloadSessionAfterMachineChange();
|
|
2796
|
+
return null;
|
|
2797
|
+
}
|
|
2798
|
+
const result = await moveChatToMachine({
|
|
2799
|
+
machine,
|
|
2800
|
+
chat: readChatSendContext(),
|
|
2801
|
+
canMessage: runsOnCanMessage,
|
|
2802
|
+
previousSandboxId: runsOnPreviousSandboxId,
|
|
2803
|
+
attach: runsOnAttach,
|
|
2804
|
+
sendMessage: (message) => context.client.sendMessage(props.session.workspaceId, props.session.id, message)
|
|
2805
|
+
});
|
|
2806
|
+
if (result.moved) await reloadSessionAfterMachineChange();
|
|
2807
|
+
return result.moved ? null : result.reason ?? "The machine change could not be confirmed. Refresh the machine list and try again.";
|
|
2808
|
+
},
|
|
2809
|
+
[
|
|
2810
|
+
context.client,
|
|
2811
|
+
props.session.id,
|
|
2812
|
+
props.session.workspaceId,
|
|
2813
|
+
reloadSessionAfterMachineChange,
|
|
2814
|
+
readChatSendContext,
|
|
2815
|
+
runsOnAttach,
|
|
2816
|
+
runsOnCanMessage,
|
|
2817
|
+
runsOnPreviousSandboxId
|
|
2818
|
+
]
|
|
2819
|
+
);
|
|
2820
|
+
const sessionResourcesKey = stableJson(props.session.resources);
|
|
2821
|
+
const stableSessionResources = useMemo3(() => props.session.resources, [sessionResourcesKey]);
|
|
2822
|
+
const reloadSessionAfterSetup = props.onReloadSession;
|
|
2823
|
+
const refreshConnectionAccounts = connectionAccounts.refresh;
|
|
2824
|
+
const afterConnectionSetup = useCallback3(async () => {
|
|
2825
|
+
await reloadSessionAfterSetup();
|
|
2826
|
+
await refreshConnectionAccounts();
|
|
2827
|
+
}, [reloadSessionAfterSetup, refreshConnectionAccounts]);
|
|
2828
|
+
const renderAuthNeeded = useCallback3(
|
|
2829
|
+
(item) => {
|
|
2830
|
+
const recommendation = item.setupRequest ? item : sessionAuthRecommendation(t, item, context.workspaceCapabilityCatalog);
|
|
2831
|
+
return recommendation ? /* @__PURE__ */ jsx(
|
|
2832
|
+
Suspense,
|
|
2833
|
+
{
|
|
2834
|
+
fallback: /* @__PURE__ */ jsx("p", { role: "status", className: "text-sm text-fg-muted", children: "Loading connection card\u2026" }),
|
|
2835
|
+
children: /* @__PURE__ */ jsx(
|
|
2836
|
+
SessionCapabilityCard,
|
|
2837
|
+
{
|
|
2838
|
+
item: recommendation,
|
|
2839
|
+
workspaceId: props.session.workspaceId,
|
|
2840
|
+
sessionId: props.session.id,
|
|
2841
|
+
visibility: props.session.tenancy?.visibility ?? "workspace",
|
|
2842
|
+
resources: stableSessionResources,
|
|
2843
|
+
sendContext: readChatSendContext,
|
|
2844
|
+
onConfigured: afterConnectionSetup
|
|
2845
|
+
},
|
|
2846
|
+
`${props.session.id}:${props.session.tenancy?.authorityEpoch}:${item.id}`
|
|
2847
|
+
)
|
|
2848
|
+
}
|
|
2849
|
+
) : void 0;
|
|
2850
|
+
},
|
|
2851
|
+
[
|
|
2852
|
+
context.workspaceCapabilityCatalog,
|
|
2853
|
+
props.session.id,
|
|
2854
|
+
props.session.workspaceId,
|
|
2855
|
+
props.session.tenancy?.visibility,
|
|
2856
|
+
props.session.tenancy?.authorityEpoch,
|
|
2857
|
+
stableSessionResources,
|
|
2858
|
+
readChatSendContext,
|
|
2859
|
+
afterConnectionSetup
|
|
2860
|
+
]
|
|
2861
|
+
);
|
|
2862
|
+
const launch = props.launch ?? EMPTY_COMPOSER_LAUNCH;
|
|
2863
|
+
const launchModel = launch.model;
|
|
2864
|
+
const launchEffort = launch.effort;
|
|
2865
|
+
const launchLatency = launch.latency;
|
|
2866
|
+
const launchRealtime = launch.realtime;
|
|
2867
|
+
const launchKey = composerLaunchSearchKey(launch);
|
|
2868
|
+
const appliedLaunchKeyRef = useRef2(null);
|
|
2869
|
+
useEffect4(() => {
|
|
2870
|
+
if (durableToolsSessionId.current !== props.session.id) {
|
|
2871
|
+
durableToolsSessionId.current = props.session.id;
|
|
2872
|
+
setDurableToolsSnapshot(props.session);
|
|
2873
|
+
setDurableToolsHydrated(false);
|
|
2874
|
+
setConnectorCustomizingOverride(null);
|
|
2875
|
+
return;
|
|
2876
|
+
}
|
|
2877
|
+
if (!context.workspaceMcpCatalogReady) {
|
|
2878
|
+
setDurableToolsHydrated(false);
|
|
2879
|
+
return;
|
|
2880
|
+
}
|
|
2881
|
+
if (durableToolsSaving) return;
|
|
2882
|
+
const snapshot = props.session.toolPolicyVersion > durableToolsSnapshot.toolPolicyVersion ? props.session : durableToolsSnapshot;
|
|
2883
|
+
if (snapshot !== durableToolsSnapshot) setDurableToolsSnapshot(snapshot);
|
|
2884
|
+
const nextMcpIds = sessionPolicyPickerIds(
|
|
2885
|
+
snapshot,
|
|
2886
|
+
selectableToolIds,
|
|
2887
|
+
context.workspaceDefaultToolIds
|
|
2888
|
+
);
|
|
2889
|
+
const nextFirstPartyIds = new Set(snapshot.firstPartyMcpTools);
|
|
2890
|
+
setDurableToolSelection(
|
|
2891
|
+
(current) => current.mcpServerIds.size === nextMcpIds.size && [...nextMcpIds].every((id) => current.mcpServerIds.has(id)) && current.firstPartyToolIds.size === nextFirstPartyIds.size && [...nextFirstPartyIds].every((id) => current.firstPartyToolIds.has(id)) ? current : { mcpServerIds: nextMcpIds, firstPartyToolIds: nextFirstPartyIds }
|
|
2892
|
+
);
|
|
2893
|
+
setDurableToolsHydrated(true);
|
|
2894
|
+
}, [
|
|
2895
|
+
context.workspaceMcpCatalogReady,
|
|
2896
|
+
context.workspaceDefaultToolIds,
|
|
2897
|
+
selectableToolIds,
|
|
2898
|
+
durableToolsSaving,
|
|
2899
|
+
durableToolsSnapshot,
|
|
2900
|
+
props.session
|
|
2901
|
+
]);
|
|
2902
|
+
const connectorCustomizing = connectorCustomizingOverride ?? sessionConnectorPolicyIsCustomized(durableToolsSnapshot);
|
|
2903
|
+
const applyDurableToolPolicy = useCallback3(
|
|
2904
|
+
async (request, optimistic) => {
|
|
2905
|
+
if (durableToolsSaveInFlight.current) return;
|
|
2906
|
+
durableToolsSaveInFlight.current = true;
|
|
2907
|
+
const targetSessionId = props.session.id;
|
|
2908
|
+
if (optimistic) setDurableToolSelection(optimistic);
|
|
2909
|
+
setDurableToolsSaving(true);
|
|
2910
|
+
setDurableToolsError(null);
|
|
2911
|
+
try {
|
|
2912
|
+
const updated = await context.client.updateSessionToolPolicy(
|
|
2913
|
+
props.session.workspaceId,
|
|
2914
|
+
targetSessionId,
|
|
2915
|
+
request
|
|
2916
|
+
);
|
|
2917
|
+
if (durableToolsSessionId.current !== targetSessionId) return;
|
|
2918
|
+
setDurableToolSelection({
|
|
2919
|
+
mcpServerIds: sessionPolicyPickerIds(
|
|
2920
|
+
updated,
|
|
2921
|
+
selectableToolIds,
|
|
2922
|
+
context.workspaceDefaultToolIds
|
|
2923
|
+
),
|
|
2924
|
+
firstPartyToolIds: new Set(updated.firstPartyMcpTools)
|
|
2925
|
+
});
|
|
2926
|
+
setDurableToolsSnapshot(updated);
|
|
2927
|
+
setConnectorCustomizingOverride((current) => current === true ? true : null);
|
|
2928
|
+
} catch (error) {
|
|
2929
|
+
const message = userErrorText(error);
|
|
2930
|
+
setDurableToolsError(message);
|
|
2931
|
+
toast.error("Couldn't save session tools", { description: message });
|
|
2932
|
+
try {
|
|
2933
|
+
const refreshed = await context.client.getSession(
|
|
2934
|
+
props.session.workspaceId,
|
|
2935
|
+
props.session.id
|
|
2936
|
+
);
|
|
2937
|
+
if (durableToolsSessionId.current !== targetSessionId) return;
|
|
2938
|
+
setDurableToolSelection({
|
|
2939
|
+
mcpServerIds: sessionPolicyPickerIds(
|
|
2940
|
+
refreshed,
|
|
2941
|
+
selectableToolIds,
|
|
2942
|
+
context.workspaceDefaultToolIds
|
|
2943
|
+
),
|
|
2944
|
+
firstPartyToolIds: new Set(refreshed.firstPartyMcpTools)
|
|
2945
|
+
});
|
|
2946
|
+
setDurableToolsSnapshot(refreshed);
|
|
2947
|
+
setConnectorCustomizingOverride((current) => current === true ? true : null);
|
|
2948
|
+
} catch {
|
|
2949
|
+
if (durableToolsSessionId.current === targetSessionId) {
|
|
2950
|
+
setDurableToolSelection({
|
|
2951
|
+
mcpServerIds: sessionPolicyPickerIds(
|
|
2952
|
+
durableToolsSnapshot,
|
|
2953
|
+
selectableToolIds,
|
|
2954
|
+
context.workspaceDefaultToolIds
|
|
2955
|
+
),
|
|
2956
|
+
firstPartyToolIds: new Set(durableToolsSnapshot.firstPartyMcpTools)
|
|
2957
|
+
});
|
|
2958
|
+
}
|
|
2959
|
+
}
|
|
2960
|
+
} finally {
|
|
2961
|
+
durableToolsSaveInFlight.current = false;
|
|
2962
|
+
setDurableToolsSaving(false);
|
|
2963
|
+
}
|
|
2964
|
+
},
|
|
2965
|
+
[
|
|
2966
|
+
context.client,
|
|
2967
|
+
context.workspaceDefaultToolIds,
|
|
2968
|
+
durableToolsSnapshot,
|
|
2969
|
+
props.session.id,
|
|
2970
|
+
props.session.workspaceId,
|
|
2971
|
+
selectableToolIds
|
|
2972
|
+
]
|
|
2973
|
+
);
|
|
2974
|
+
const saveDurableToolPolicy = useCallback3(
|
|
2975
|
+
async (next) => {
|
|
2976
|
+
await applyDurableToolPolicy(
|
|
2977
|
+
connectorSelectionUpdate(
|
|
2978
|
+
durableToolsSnapshot,
|
|
2979
|
+
durableToolSelection.mcpServerIds,
|
|
2980
|
+
next.mcpServerIds,
|
|
2981
|
+
context.workspaceDefaultToolIds
|
|
2982
|
+
),
|
|
2983
|
+
{
|
|
2984
|
+
mcpServerIds: new Set(next.mcpServerIds),
|
|
2985
|
+
firstPartyToolIds: new Set(next.firstPartyToolIds)
|
|
2986
|
+
}
|
|
2987
|
+
);
|
|
2988
|
+
},
|
|
2989
|
+
[
|
|
2990
|
+
applyDurableToolPolicy,
|
|
2991
|
+
context.workspaceDefaultToolIds,
|
|
2992
|
+
durableToolsSnapshot,
|
|
2993
|
+
durableToolSelection
|
|
2994
|
+
]
|
|
2995
|
+
);
|
|
2996
|
+
const sendGate = useSessionSendGate();
|
|
2997
|
+
const workspace = context.workspaces.find((candidate) => candidate.id === props.session.workspaceId) ?? null;
|
|
2998
|
+
const loadSkillReview = useCallback3(
|
|
2999
|
+
(reference) => context.client.readWorkspaceSkill(
|
|
3000
|
+
props.session.workspaceId,
|
|
3001
|
+
reference.skillId,
|
|
3002
|
+
reference.revisionId
|
|
3003
|
+
),
|
|
3004
|
+
// A browser-account switch must discard the previous actor's loaded preview
|
|
3005
|
+
// even when the SDK client instance and workspace remain unchanged.
|
|
3006
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3007
|
+
[context.client, props.session.workspaceId, context.accessContext.subjectId]
|
|
3008
|
+
);
|
|
3009
|
+
const fixedResourceCatalogEnabled = props.session.sandboxBackend !== "selfhosted";
|
|
3010
|
+
const fixedRigScope = useFixedRigScope(
|
|
3011
|
+
context.client,
|
|
3012
|
+
workspace?.id ?? null,
|
|
3013
|
+
props.session.rigId,
|
|
3014
|
+
fixedResourceCatalogEnabled && hasWorkspacePermission(context.accessContext, props.session.workspaceId, "rigs:use")
|
|
3015
|
+
);
|
|
3016
|
+
const personalAttachment = usePersonalResourceAttachment({
|
|
3017
|
+
client: context.client,
|
|
3018
|
+
authMode: context.clientConfig.auth.mode,
|
|
3019
|
+
authSession: context.authSession,
|
|
3020
|
+
accessSubjectId: context.accessContext.subjectId,
|
|
3021
|
+
accessContext: context.accessContext,
|
|
3022
|
+
managedSelfContext: context.managedSelfContext,
|
|
3023
|
+
workspace,
|
|
3024
|
+
session: props.session,
|
|
3025
|
+
enabled: props.session.sandboxBackend !== "selfhosted",
|
|
3026
|
+
fixed: {
|
|
3027
|
+
rigId: props.session.rigId,
|
|
3028
|
+
rigScope: fixedRigScope,
|
|
3029
|
+
connectedMachine: null
|
|
3030
|
+
},
|
|
3031
|
+
personalWorkspaceTarget: isPersonalWorkspace(workspace, context.managedSelfContext),
|
|
3032
|
+
onReloadSession: props.onReloadSession
|
|
3033
|
+
});
|
|
3034
|
+
const sendState = {
|
|
3035
|
+
uploadPending: attachments.hasUnresolved,
|
|
3036
|
+
repositoryError: repositories.error,
|
|
3037
|
+
personalDecision: personalAttachment.requiresDecision || connectionAccounts.requiresAccountChoice,
|
|
3038
|
+
machineAccessDenied: machineAccess !== null && !machineAccess.isOwner,
|
|
3039
|
+
loading: durableToolsSaving || durableToolsSaveInFlight.current || !durableToolsHydrated || personalAttachment.loading || personalAttachment.refreshing || connectionAccounts.loading,
|
|
3040
|
+
loadFailed: connectionAccounts.error === null ? false : connectionAccounts.accessDenied ? "denied" : connectionAccounts.unavailable ? "updating" : "failed"
|
|
3041
|
+
};
|
|
3042
|
+
const composerSendBlocker = () => sendGate.blocker(sendState);
|
|
3043
|
+
const workspaceAccountId = context.workspaces.find(
|
|
3044
|
+
(candidate) => candidate.id === props.session.workspaceId
|
|
3045
|
+
)?.accountId;
|
|
3046
|
+
const canBuyCredits = context.clientConfig.billingMode === "stripe" && Boolean(workspaceAccountId) && hasAccountPermission(context.accessContext, workspaceAccountId ?? "", "billing:manage");
|
|
3047
|
+
const composer = useComposer(props.session.id, {
|
|
3048
|
+
canBuyCredits,
|
|
3049
|
+
events: props.events,
|
|
3050
|
+
sendExtras: () => ({
|
|
3051
|
+
...withHostMessageContext(hostMessageContext, props.messageContext),
|
|
3052
|
+
resources: [...attachments.readyResources, ...repositories.pendingResources],
|
|
3053
|
+
connectionAccounts: [
|
|
3054
|
+
...connectionAccounts.selections,
|
|
3055
|
+
...repositories.pendingResources.some(
|
|
3056
|
+
(resource) => resource.kind === "repository" && resource.connectionType === "github_personal"
|
|
3057
|
+
) && context.personalGitHubAuthority ? [context.personalGitHubAuthority] : []
|
|
3058
|
+
],
|
|
3059
|
+
...personalAttachment.intent ? { personalResourceAttachment: personalAttachment.intent } : runsOnActiveMachineConsent ? { personalResourceAttachment: runsOnActiveMachineConsent } : {}
|
|
3060
|
+
}),
|
|
3061
|
+
sendBlocked: () => composerSendBlocker() !== null,
|
|
3062
|
+
effectiveControl: props.queue.effectiveControl ?? props.session.effectiveControl,
|
|
3063
|
+
sendDestination: () => promptSendDestination({
|
|
3064
|
+
status: props.session.status,
|
|
3065
|
+
activeTurnId: props.session.activeTurnId,
|
|
3066
|
+
queuedPrompts: props.queue.queue.length,
|
|
3067
|
+
admissionBlock: props.session.admissionBlock
|
|
3068
|
+
}),
|
|
3069
|
+
busySend: resolveWorkspaceBusySend(workspace?.settings),
|
|
3070
|
+
...props.initialDraft ? { initialDraft: props.initialDraft } : {},
|
|
3071
|
+
// The console always offers the other choice beside Send.
|
|
3072
|
+
offerQueue: true,
|
|
3073
|
+
// Send and Steer are acknowledged locally: the message leaves the box
|
|
3074
|
+
// when it is shown. Clear only resources captured in that immutable
|
|
3075
|
+
// operation; later additions belong to the next draft, while retry keeps
|
|
3076
|
+
// the original resource refs in the failed bubble.
|
|
3077
|
+
onSubmitted: (_text, input) => {
|
|
3078
|
+
noteTurnFailureAction("send_message");
|
|
3079
|
+
attachments.removeReadyFiles(
|
|
3080
|
+
(input.resources ?? []).flatMap(
|
|
3081
|
+
(resource) => resource.kind === "file" ? [resource.fileId] : []
|
|
3082
|
+
)
|
|
3083
|
+
);
|
|
3084
|
+
repositories.commitSent(input.resources ?? []);
|
|
3085
|
+
},
|
|
3086
|
+
// Recovered sends do not pass through onSubmitted. Keep the host-owned
|
|
3087
|
+
// upload/repository queue in sync once those inputs are accepted too;
|
|
3088
|
+
// the immutable input snapshot preserves later additions.
|
|
3089
|
+
onSent: (_text, input) => {
|
|
3090
|
+
setCreditRefusal(null);
|
|
3091
|
+
attachments.removeReadyFiles(
|
|
3092
|
+
(input.resources ?? []).flatMap(
|
|
3093
|
+
(resource) => resource.kind === "file" ? [resource.fileId] : []
|
|
3094
|
+
)
|
|
3095
|
+
);
|
|
3096
|
+
repositories.commitSent(input.resources ?? []);
|
|
3097
|
+
personalAttachment.onAccepted(input);
|
|
3098
|
+
},
|
|
3099
|
+
onDeliveryError: (error, input, delivery) => {
|
|
3100
|
+
personalAttachment.onDeliveryError(error, input, delivery);
|
|
3101
|
+
connectionAccounts.onSelectionError(error);
|
|
3102
|
+
if (isModelUnavailableSubmissionError(error)) {
|
|
3103
|
+
const refused = refusedModelId(error, input);
|
|
3104
|
+
if (refused) setRefusedModel({ sessionId: props.session.id, model: refused });
|
|
3105
|
+
void modelCatalog.refresh();
|
|
3106
|
+
setModelPickerSession(props.session.id);
|
|
3107
|
+
}
|
|
3108
|
+
const refusal = creditRefusalRecord(
|
|
3109
|
+
error,
|
|
3110
|
+
{ sessionId: props.session.id },
|
|
3111
|
+
refusedModelId(error, input) ?? props.session.model
|
|
3112
|
+
);
|
|
3113
|
+
if (refusal) {
|
|
3114
|
+
setCreditRefusal(refusal);
|
|
3115
|
+
void modelCatalog.refresh();
|
|
3116
|
+
}
|
|
3117
|
+
},
|
|
3118
|
+
// An account that stopped working since the chat loaded: send again once
|
|
3119
|
+
// without it, never with another account in its place.
|
|
3120
|
+
reviseRefusedAccounts: (error, input) => connectionAccounts.reviseRefusedAccounts(error, input.connectionAccounts)
|
|
3121
|
+
});
|
|
3122
|
+
const composerView = useComposerWithStreamState(
|
|
3123
|
+
composer,
|
|
3124
|
+
props.connectionState,
|
|
3125
|
+
props.initialLoading
|
|
3126
|
+
);
|
|
3127
|
+
const queuedRecall = useQueuedPromptRecall({
|
|
3128
|
+
queue: props.queue,
|
|
3129
|
+
composer,
|
|
3130
|
+
subjectId: context.accessContext.subjectId,
|
|
3131
|
+
enabled: !terminal
|
|
3132
|
+
});
|
|
3133
|
+
useBrowserAccountBridgeBlocker(`session-composer:${props.session.id}`, () => {
|
|
3134
|
+
if (attachments.hasUnresolved) {
|
|
3135
|
+
return {
|
|
3136
|
+
id: "ignored",
|
|
3137
|
+
label: "A file upload is not settled",
|
|
3138
|
+
detail: "Wait for the upload or remove it before changing accounts."
|
|
3139
|
+
};
|
|
3140
|
+
}
|
|
3141
|
+
if (composer.sending || composer.draftSaving || durableToolsSaving) {
|
|
3142
|
+
return {
|
|
3143
|
+
id: "ignored",
|
|
3144
|
+
label: "A session mutation is still running",
|
|
3145
|
+
detail: "Wait for the current save or send to finish."
|
|
3146
|
+
};
|
|
3147
|
+
}
|
|
3148
|
+
return composer.hasDraftContent() ? {
|
|
3149
|
+
id: "ignored",
|
|
3150
|
+
label: "This session has an unsent draft",
|
|
3151
|
+
detail: "Continuing clears the account-bound composer state."
|
|
3152
|
+
} : null;
|
|
3153
|
+
});
|
|
3154
|
+
chatSendContext.current = {
|
|
3155
|
+
blocked: sessionReadOnlyArchive(props.session) ? "This chat is archived. Continue in a new chat to use a repository." : isTerminalSessionStatus(props.session.status) ? "This chat has ended. Start a new chat to use a repository." : connectionAccounts.requiresAccountChoice ? "Choose an account for this chat's connected tools in the composer first." : personalAttachment.requiresDecision ? "Finish the personal access choice in the composer first." : null,
|
|
3156
|
+
awaitingHuman: props.session.status === "requires_action" && !sessionAdmissionBlocked(props.session),
|
|
3157
|
+
// Moving the chat onto the person's own machine turns it on in this workspace.
|
|
3158
|
+
personalMachineIntent: personalMachineUseIntent(props.session.tenancy, "always"),
|
|
3159
|
+
extras: {
|
|
3160
|
+
...composer.sendPolicy ?? {},
|
|
3161
|
+
...(props.queue.effectiveControl ?? props.session.effectiveControl)?.controlEtag ? {
|
|
3162
|
+
controlEtag: (props.queue.effectiveControl ?? props.session.effectiveControl).controlEtag
|
|
3163
|
+
} : {},
|
|
3164
|
+
...connectionAccounts.selections.length > 0 ? { connectionAccounts: connectionAccounts.selections } : {}
|
|
3165
|
+
}
|
|
3166
|
+
};
|
|
3167
|
+
const composerPolicy = composer.policy;
|
|
3168
|
+
const [retryOperation, setRetryOperation] = useState3(null);
|
|
3169
|
+
const pendingRetryInput = retryOperation?.failureEventId === props.failure?.failureEventId ? retryOperation : null;
|
|
3170
|
+
const failureTurnId = props.session.failureDiagnostics?.eventId === props.failure?.failureEventId ? props.session.failureDiagnostics?.turnId : props.events.find((event) => event.id === props.failure?.failureEventId)?.turnId;
|
|
3171
|
+
const retryHasRetainedTurn = Boolean(failureTurnId);
|
|
3172
|
+
const retryFailedSession = useMemo3(
|
|
3173
|
+
() => createFailedSessionRetry(
|
|
3174
|
+
(input) => context.client.retrySession(props.session.workspaceId, props.session.id, input),
|
|
3175
|
+
setRetryOperation
|
|
3176
|
+
),
|
|
3177
|
+
[context.client, props.session.workspaceId, props.session.id]
|
|
3178
|
+
);
|
|
3179
|
+
const composerDraftLoading = composer.draftLoading;
|
|
3180
|
+
const setComposerModel = composer.setModel;
|
|
3181
|
+
const setComposerReasoningEffort = composer.setReasoningEffort;
|
|
3182
|
+
const setComposerLatencyMode = composer.setLatencyMode;
|
|
3183
|
+
const hasComposerPolicy = composerPolicy !== null;
|
|
3184
|
+
const modelPickerDisabled = composer.sending || composer.draftLoading || !hasComposerPolicy || Boolean(pendingRetryInput);
|
|
3185
|
+
const canChooseRecoveryModel = !modelPickerDisabled;
|
|
3186
|
+
const stopRefusal = props.creditExhausted ? props.creditRefusal : null;
|
|
3187
|
+
const bannerFailureIds = useMemo3(
|
|
3188
|
+
() => props.failure ? bannerFailureEventIds(
|
|
3189
|
+
props.events,
|
|
3190
|
+
props.failure,
|
|
3191
|
+
// As the banner: a structural sandbox failure outranks a credit stop.
|
|
3192
|
+
props.creditExhausted && !props.failure.structuralSandboxFailure
|
|
3193
|
+
) : void 0,
|
|
3194
|
+
[props.events, props.failure, props.creditExhausted]
|
|
3195
|
+
);
|
|
3196
|
+
const creditGap = props.creditExhausted && !stopRefusal ? freeCreditGap(modelCatalog.rows, props.session.model, {
|
|
3197
|
+
selectedModel: composerPolicy?.model,
|
|
3198
|
+
preferredModel: modelCatalog.defaultSelection?.model
|
|
3199
|
+
}) : null;
|
|
3200
|
+
const fallbackCopy = props.failure ? failedSessionCopy(
|
|
3201
|
+
props.failure,
|
|
3202
|
+
props.creditExhausted && !props.failure.structuralSandboxFailure,
|
|
3203
|
+
Boolean(composerPolicy && composerPolicy.model !== props.session.model),
|
|
3204
|
+
canChooseRecoveryModel && !props.failure.structuralSandboxFailure,
|
|
3205
|
+
creditGap,
|
|
3206
|
+
stopRefusal
|
|
3207
|
+
) : null;
|
|
3208
|
+
const fallbackReason = fallbackCopy ? failureFallbackReason(fallbackCopy, canBuyCredits) : "";
|
|
3209
|
+
const fallbackDetail = detailBeyondHeadline(fallbackReason, fallbackCopy?.detail);
|
|
3210
|
+
const failureFallback = fallbackCopy ? /* @__PURE__ */ jsxs("div", { role: "alert", className: cn("mx-auto my-2 w-full max-w-3xl text-sm text-fg-muted", gutter), children: [
|
|
3211
|
+
fallbackReason,
|
|
3212
|
+
fallbackDetail ? /* @__PURE__ */ jsxs("details", { className: "mt-1 text-xs", children: [
|
|
3213
|
+
/* @__PURE__ */ jsx("summary", { className: "cursor-pointer select-none text-fg-subtle hover:text-fg-muted", children: "Details" }),
|
|
3214
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 max-h-40 overflow-auto whitespace-pre-wrap break-words font-mono text-2xs", children: fallbackDetail })
|
|
3215
|
+
] }) : null
|
|
3216
|
+
] }) : null;
|
|
3217
|
+
const model = composerPolicy?.model ?? props.session.model;
|
|
3218
|
+
const reasoningEffort = composerPolicy?.reasoningEffort ?? props.session.reasoningEffort;
|
|
3219
|
+
const latencyMode = composerPolicy?.latencyMode ?? props.session.latencyMode;
|
|
3220
|
+
const selectedPolicyRow = findPickerRow(modelCatalog.rows, model);
|
|
3221
|
+
const chooseCoveredModel = (id) => {
|
|
3222
|
+
const row = findPickerRow(modelCatalog.rows, id);
|
|
3223
|
+
const choice = row && !modelPickerDisabled ? coveredModelChoice(row, reasoningEffort, latencyMode) : null;
|
|
3224
|
+
if (!choice) return;
|
|
3225
|
+
setComposerModel(choice.model);
|
|
3226
|
+
setComposerReasoningEffort(choice.effort);
|
|
3227
|
+
if (choice.latencyMode !== null) setComposerLatencyMode(choice.latencyMode);
|
|
3228
|
+
};
|
|
3229
|
+
const matchesFrozenSessionPolicy = Boolean(
|
|
3230
|
+
composerPolicy && composerPolicy.model === props.session.model && composerPolicy.reasoningEffort === props.session.reasoningEffort && composerPolicy.latencyMode === props.session.latencyMode
|
|
3231
|
+
);
|
|
3232
|
+
const catalogComboValid = pickerPolicyRunnable(selectedPolicyRow, reasoningEffort, latencyMode);
|
|
3233
|
+
const refusedSessionModel = refusedModel?.sessionId === props.session.id ? refusedModel.model : null;
|
|
3234
|
+
const composerModelUnavailable = model === refusedSessionModel || sessionModelMissingFromCatalog({
|
|
3235
|
+
model,
|
|
3236
|
+
models: modelCatalog.models,
|
|
3237
|
+
error: modelCatalog.error
|
|
3238
|
+
});
|
|
3239
|
+
const sessionModelUnavailable = props.session.model === refusedSessionModel || sessionModelMissingFromCatalog({
|
|
3240
|
+
model: props.session.model,
|
|
3241
|
+
models: modelCatalog.models,
|
|
3242
|
+
error: modelCatalog.error
|
|
3243
|
+
});
|
|
3244
|
+
const canControlSession = Boolean(
|
|
3245
|
+
context.accessContext.workspaceGrants.find((grant) => grant.workspaceId === props.session.workspaceId)?.permissions.includes("sessions:control")
|
|
3246
|
+
);
|
|
3247
|
+
const composerPolicyValid = Boolean(
|
|
3248
|
+
composerPolicy && (catalogComboValid || matchesFrozenSessionPolicy && !composerModelUnavailable)
|
|
3249
|
+
);
|
|
3250
|
+
const noRunnableModel = !modelCatalog.loading && modelCatalog.rows.length > 0 && !modelCatalog.rows.some((row) => row.selectable);
|
|
3251
|
+
const composerPolicyError = composerPolicy && !modelCatalog.loading && !composerPolicyValid && !noRunnableModel ? composerModelUnavailable ? "This model is no longer available. Select a different model to continue." : "Choose a model, reasoning level, and speed supported by this session." : null;
|
|
3252
|
+
const unavailableReplacement = useMemo3(
|
|
3253
|
+
() => composerModelUnavailable || sessionModelUnavailable ? unavailableModelReplacement({
|
|
3254
|
+
rows: modelCatalog.rows,
|
|
3255
|
+
defaultSelection: modelCatalog.defaultSelection,
|
|
3256
|
+
latencyMode
|
|
3257
|
+
}) : null,
|
|
3258
|
+
[
|
|
3259
|
+
composerModelUnavailable,
|
|
3260
|
+
sessionModelUnavailable,
|
|
3261
|
+
modelCatalog.rows,
|
|
3262
|
+
modelCatalog.defaultSelection,
|
|
3263
|
+
latencyMode
|
|
3264
|
+
]
|
|
3265
|
+
);
|
|
3266
|
+
const replacesUnavailableModel = Boolean(
|
|
3267
|
+
composerModelUnavailable && unavailableReplacement && !composerDraftLoading && hasComposerPolicy && !modelPickerDisabled && !terminal && // A failed session keeps its model until the person chooses: the
|
|
3268
|
+
// failure banner's Retry re-runs that turn with the composer's model.
|
|
3269
|
+
canControlSession && !props.failure
|
|
3270
|
+
);
|
|
3271
|
+
useEffect4(() => {
|
|
3272
|
+
if (!replacesUnavailableModel || !unavailableReplacement) return;
|
|
3273
|
+
setComposerModel(unavailableReplacement.model);
|
|
3274
|
+
setComposerReasoningEffort(unavailableReplacement.reasoningEffort);
|
|
3275
|
+
if (unavailableReplacement.latencyMode) {
|
|
3276
|
+
setComposerLatencyMode(unavailableReplacement.latencyMode);
|
|
3277
|
+
}
|
|
3278
|
+
}, [
|
|
3279
|
+
replacesUnavailableModel,
|
|
3280
|
+
setComposerLatencyMode,
|
|
3281
|
+
setComposerModel,
|
|
3282
|
+
setComposerReasoningEffort,
|
|
3283
|
+
unavailableReplacement
|
|
3284
|
+
]);
|
|
3285
|
+
const composerDelivery = useSessionComposerDelivery(composerView, sendGate, {
|
|
3286
|
+
policyValid: composerPolicyValid,
|
|
3287
|
+
catalogLoading: modelCatalog.loading,
|
|
3288
|
+
replacingModel: replacesUnavailableModel,
|
|
3289
|
+
send: sendState
|
|
3290
|
+
});
|
|
3291
|
+
const unavailableModelNotice = (sessionModelUnavailable || composerModelUnavailable) && !terminal ? /* @__PURE__ */ jsx(
|
|
3292
|
+
UnavailableModelNotice,
|
|
3293
|
+
{
|
|
3294
|
+
modelName: unavailableModelName(sessionModelUnavailable ? props.session.model : model),
|
|
3295
|
+
replacementLabel: composerModelUnavailable ? null : selectedPolicyRow?.label ?? null
|
|
3296
|
+
}
|
|
3297
|
+
) : null;
|
|
3298
|
+
const sendBlocker = composerSendBlocker();
|
|
3299
|
+
const visibleSendBlocker = terminal || composerDelivery.preparing ? null : sendBlocker === "policy" && (unavailableModelNotice || noRunnableModel || !composerPolicy) ? null : sendBlocker === "policy" && selectedPolicyRow?.selectable !== true ? "model_unavailable" : sendBlocker;
|
|
3300
|
+
const sendBlockerNotice = composerSendBlockerNotice(visibleSendBlocker) ? /* @__PURE__ */ jsx(
|
|
3301
|
+
ComposerSendBlockerNotice,
|
|
3302
|
+
{
|
|
3303
|
+
blocker: visibleSendBlocker,
|
|
3304
|
+
className: "px-2 pt-2",
|
|
3305
|
+
onAction: modelPickerDisabled && visibleSendBlocker === "policy" ? void 0 : (action) => {
|
|
3306
|
+
if (action === "fix_model_settings") chooseCoveredModel(model);
|
|
3307
|
+
else if (visibleSendBlocker === "accounts") void connectionAccounts.refresh();
|
|
3308
|
+
}
|
|
3309
|
+
}
|
|
3310
|
+
) : null;
|
|
3311
|
+
useEffect4(() => {
|
|
3312
|
+
if (!launchKey || appliedLaunchKeyRef.current === launchKey || composerDraftLoading || !hasComposerPolicy) {
|
|
3313
|
+
return;
|
|
3314
|
+
}
|
|
3315
|
+
const hasPolicy = Boolean(launchModel || launchEffort || launchLatency);
|
|
3316
|
+
appliedLaunchKeyRef.current = launchKey;
|
|
3317
|
+
if (!hasPolicy) return;
|
|
3318
|
+
if (launchModel) setComposerModel(launchModel);
|
|
3319
|
+
if (launchEffort) setComposerReasoningEffort(launchEffort);
|
|
3320
|
+
if (launchLatency) setComposerLatencyMode(launchLatency);
|
|
3321
|
+
void navigate({
|
|
3322
|
+
to: "/workspaces/$workspaceId/sessions/$sessionId",
|
|
3323
|
+
params: {
|
|
3324
|
+
workspaceId: props.session.workspaceId,
|
|
3325
|
+
sessionId: props.session.id
|
|
3326
|
+
},
|
|
3327
|
+
search: composerLaunchSearchAfterPolicyApply({
|
|
3328
|
+
model: launchModel,
|
|
3329
|
+
effort: launchEffort,
|
|
3330
|
+
latency: launchLatency,
|
|
3331
|
+
realtime: launchRealtime
|
|
3332
|
+
}),
|
|
3333
|
+
replace: true
|
|
3334
|
+
});
|
|
3335
|
+
}, [
|
|
3336
|
+
composerDraftLoading,
|
|
3337
|
+
hasComposerPolicy,
|
|
3338
|
+
launchEffort,
|
|
3339
|
+
launchKey,
|
|
3340
|
+
launchLatency,
|
|
3341
|
+
launchModel,
|
|
3342
|
+
launchRealtime,
|
|
3343
|
+
navigate,
|
|
3344
|
+
props.session.id,
|
|
3345
|
+
props.session.workspaceId,
|
|
3346
|
+
setComposerLatencyMode,
|
|
3347
|
+
setComposerModel,
|
|
3348
|
+
setComposerReasoningEffort
|
|
3349
|
+
]);
|
|
3350
|
+
const acceptedClientEventIds = useMemo3(
|
|
3351
|
+
() => new Set(
|
|
3352
|
+
props.events.filter((event) => event.type === "user.message" && event.clientEventId).map((event) => event.clientEventId)
|
|
3353
|
+
),
|
|
3354
|
+
[props.events]
|
|
3355
|
+
);
|
|
3356
|
+
const {
|
|
3357
|
+
optimisticMessages,
|
|
3358
|
+
retryOptimisticMessage,
|
|
3359
|
+
restoreOptimisticMessage,
|
|
3360
|
+
removeOptimisticMessage
|
|
3361
|
+
} = composer;
|
|
3362
|
+
const failedOptimisticMessageCount = (optimisticMessages ?? []).filter(
|
|
3363
|
+
(message) => message.state === "failed" && !acceptedClientEventIds.has(message.clientEventId)
|
|
3364
|
+
).length;
|
|
3365
|
+
useEffect4(() => {
|
|
3366
|
+
updateLocalSessionDeliveryAttention({
|
|
3367
|
+
workspaceId: props.session.workspaceId,
|
|
3368
|
+
sessionId: props.session.id,
|
|
3369
|
+
failedMessageCount: failedOptimisticMessageCount
|
|
3370
|
+
});
|
|
3371
|
+
}, [failedOptimisticMessageCount, props.session.id, props.session.workspaceId]);
|
|
3372
|
+
const usageLimitCapability = sessionUsageLimitCapability(context.clientConfig);
|
|
3373
|
+
const usageLimitTreeActive = props.session.status === "running" || lineageHasRunningSession(props.agentNodes);
|
|
3374
|
+
const usageLimit = useSessionUsageLimit({
|
|
3375
|
+
client: context.client,
|
|
3376
|
+
workspaceId: props.session.workspaceId,
|
|
3377
|
+
sessionId: props.session.id,
|
|
3378
|
+
initial: props.session.usageLimit,
|
|
3379
|
+
enabled: usageLimitCapability !== "absent",
|
|
3380
|
+
live: {
|
|
3381
|
+
events: props.events,
|
|
3382
|
+
active: usageLimitTreeActive,
|
|
3383
|
+
watch: props.agentNodes.length > 0,
|
|
3384
|
+
connectionState: props.connectionState
|
|
3385
|
+
}
|
|
3386
|
+
});
|
|
3387
|
+
const refusedUsageLimitSendIds = (optimisticMessages ?? []).filter(
|
|
3388
|
+
(message) => message.state === "failed" && message.error !== void 0 && !acceptedClientEventIds.has(message.clientEventId) && isSessionUsageLimitSubmissionError(new Error(message.error))
|
|
3389
|
+
).map((message) => message.clientEventId).join(",");
|
|
3390
|
+
const composerUsageLimitError = composer.error instanceof OpenGeniSessionUsageLimitReachedError ? composer.error : null;
|
|
3391
|
+
const [usageLimitRefusalPending, setUsageLimitRefusalPending] = useState3(false);
|
|
3392
|
+
const refreshUsageLimit = usageLimit.refresh;
|
|
3393
|
+
useEffect4(() => {
|
|
3394
|
+
if (!refusedUsageLimitSendIds && !composerUsageLimitError) return;
|
|
3395
|
+
setUsageLimitRefusalPending(true);
|
|
3396
|
+
void refreshUsageLimit().finally(() => setUsageLimitRefusalPending(false));
|
|
3397
|
+
}, [composerUsageLimitError, refreshUsageLimit, refusedUsageLimitSendIds]);
|
|
3398
|
+
const usageLimitRefusal = usageLimitRefusalFromState({
|
|
3399
|
+
pending: usageLimitRefusalPending,
|
|
3400
|
+
error: composerUsageLimitError,
|
|
3401
|
+
usage: usageLimit.usage
|
|
3402
|
+
});
|
|
3403
|
+
const usageLimitChild = Boolean(props.session.parentSessionId) || usageLimit.usage?.inherited === true;
|
|
3404
|
+
const usageLimitRootId = usageLimit.usage?.rootSessionId ?? null;
|
|
3405
|
+
const usageLimitNotice = usageLimitCapability !== "absent" && !terminal ? /* @__PURE__ */ jsx(
|
|
3406
|
+
SessionUsageLimitNotice,
|
|
3407
|
+
{
|
|
3408
|
+
usage: usageLimit.usage,
|
|
3409
|
+
stale: usageLimit.error !== null && usageLimit.usage !== null,
|
|
3410
|
+
refusal: usageLimitRefusal,
|
|
3411
|
+
onChangeLimit: !usageLimitChild && canControlSession ? props.onOpenUsageLimit : void 0,
|
|
3412
|
+
mainTaskHref: usageLimitChild && usageLimitRootId ? `/workspaces/${props.session.workspaceId}/sessions/${usageLimitRootId}` : void 0,
|
|
3413
|
+
goalPaused: props.goal.goal?.pausedReason === SESSION_USAGE_LIMIT_GOAL_PAUSED_REASON,
|
|
3414
|
+
dismissStorageKey: `opengeni:${props.session.workspaceId}`
|
|
3415
|
+
}
|
|
3416
|
+
) : null;
|
|
3417
|
+
const timelineWithOptimisticSends = useMemo3(() => {
|
|
3418
|
+
return conversationTimeline(
|
|
3419
|
+
props.timeline,
|
|
3420
|
+
{
|
|
3421
|
+
queue: props.queue.queue,
|
|
3422
|
+
snapshot: props.queue.snapshot,
|
|
3423
|
+
acceptedSteers: props.queue.acceptedSteers
|
|
3424
|
+
},
|
|
3425
|
+
{
|
|
3426
|
+
optimisticMessages,
|
|
3427
|
+
retryOptimisticMessage,
|
|
3428
|
+
restoreOptimisticMessage,
|
|
3429
|
+
removeOptimisticMessage
|
|
3430
|
+
}
|
|
3431
|
+
);
|
|
3432
|
+
}, [
|
|
3433
|
+
optimisticMessages,
|
|
3434
|
+
removeOptimisticMessage,
|
|
3435
|
+
props.queue.acceptedSteers,
|
|
3436
|
+
props.queue.queue,
|
|
3437
|
+
props.queue.snapshot,
|
|
3438
|
+
props.timeline,
|
|
3439
|
+
retryOptimisticMessage,
|
|
3440
|
+
restoreOptimisticMessage
|
|
3441
|
+
]);
|
|
3442
|
+
const repositoryPickerProps = repositories.pickerProps(terminal || composer.sending);
|
|
3443
|
+
const admissionControl = admissionRecheckControl(
|
|
3444
|
+
props.admissionSessionControl,
|
|
3445
|
+
props.queue.effectiveControl,
|
|
3446
|
+
composer.effectiveControl
|
|
3447
|
+
);
|
|
3448
|
+
const admissionRefreshRequired = admissionControlNeedsRefresh(
|
|
3449
|
+
admissionControl,
|
|
3450
|
+
props.admissionSessionControl,
|
|
3451
|
+
props.queue.effectiveControl,
|
|
3452
|
+
composer.effectiveControl
|
|
3453
|
+
);
|
|
3454
|
+
const timelineWithStartup = useSessionStartupTimeline(timelineWithOptimisticSends, {
|
|
3455
|
+
session: { ...props.session, effectiveControl: admissionControl },
|
|
3456
|
+
events: props.events,
|
|
3457
|
+
optimisticMessages,
|
|
3458
|
+
hasNewer: props.hasNewer,
|
|
3459
|
+
queue: props.queue.snapshot
|
|
3460
|
+
});
|
|
3461
|
+
const pinnedConnectionCard = useMemo3(
|
|
3462
|
+
() => props.session.status === "idle" && !props.hasNewer ? pendingConnectionCard(
|
|
3463
|
+
timelineWithStartup,
|
|
3464
|
+
(item) => !authNeededPresentation(t, item).unavailable && (item.authoritySource !== "host" || Boolean(item.authorizationUrl))
|
|
3465
|
+
) : null,
|
|
3466
|
+
[props.hasNewer, props.session.status, timelineWithStartup]
|
|
3467
|
+
);
|
|
3468
|
+
const timelineItems = useMemo3(
|
|
3469
|
+
() => pinnedConnectionCard ? timelineWithStartup.filter((item) => item !== pinnedConnectionCard) : timelineWithStartup,
|
|
3470
|
+
[pinnedConnectionCard, timelineWithStartup]
|
|
3471
|
+
);
|
|
3472
|
+
const timelineEmptyStateCopy = sessionTimelineEmptyStateCopy(
|
|
3473
|
+
sessionDisplayStatus(props.session),
|
|
3474
|
+
readOnlyArchive === null && (props.queue.effectiveControl ?? props.session.effectiveControl).state === "paused"
|
|
3475
|
+
);
|
|
3476
|
+
const workspacePermissions = useMemo3(
|
|
3477
|
+
() => context.accessContext.workspaceGrants.find(
|
|
3478
|
+
(grant) => grant.workspaceId === props.session.workspaceId
|
|
3479
|
+
)?.permissions ?? [],
|
|
3480
|
+
[context.accessContext.workspaceGrants, props.session.workspaceId]
|
|
3481
|
+
);
|
|
3482
|
+
const codexUsageBlocked = isCodexProductModel(props.session.model) && (props.session.status === "waiting_capacity" || (props.session.status === "failed" ? isCodexUsageLimitFailure(props.failure?.failureCode) : props.session.status === "idle" && latestTurnFailedOnUsageLimit(props.events)));
|
|
3483
|
+
const codexUsageChoices = codexUsageBlocked && workspacePermissions.includes("sessions:control");
|
|
3484
|
+
const codexUsageResetsAtValue = useMemo3(
|
|
3485
|
+
() => codexUsageChoices ? codexUsageResetsAt(props.events) : null,
|
|
3486
|
+
[codexUsageChoices, props.events]
|
|
3487
|
+
);
|
|
3488
|
+
const [usageContinuationState, setUsageContinuation] = useState3(null);
|
|
3489
|
+
const usageContinuationInFlight = useRef2(false);
|
|
3490
|
+
const usageContinuation = usageContinuationState?.sessionId === props.session.id ? usageContinuationState : null;
|
|
3491
|
+
const remoteV2Chat = props.session.codexCompactionMode === "remote_v2";
|
|
3492
|
+
const loadedCheckpointIsCompaction = useMemo3(
|
|
3493
|
+
() => remoteV2Chat ? latestCheckpointIsCompaction(props.events) : null,
|
|
3494
|
+
[remoteV2Chat, props.events]
|
|
3495
|
+
);
|
|
3496
|
+
const [fetchedCodexCompaction, setFetchedCodexCompaction] = useState3(null);
|
|
3497
|
+
useEffect4(() => {
|
|
3498
|
+
if (!remoteV2Chat || loadedCheckpointIsCompaction !== null) return;
|
|
3499
|
+
let stale = false;
|
|
3500
|
+
const sessionId = props.session.id;
|
|
3501
|
+
context.client.listEvents(props.session.workspaceId, sessionId, {
|
|
3502
|
+
includeTypes: CONTEXT_CHECKPOINT_EVENT_TYPES,
|
|
3503
|
+
// Newest first: only the latest checkpoint matters.
|
|
3504
|
+
direction: "before",
|
|
3505
|
+
limit: 20,
|
|
3506
|
+
payloadMode: "none"
|
|
3507
|
+
}).then((events) => {
|
|
3508
|
+
if (!stale)
|
|
3509
|
+
setFetchedCodexCompaction({
|
|
3510
|
+
sessionId,
|
|
3511
|
+
compacted: latestCheckpointIsCompaction(events) === true
|
|
3512
|
+
});
|
|
3513
|
+
}).catch(() => void 0);
|
|
3514
|
+
return () => {
|
|
3515
|
+
stale = true;
|
|
3516
|
+
};
|
|
3517
|
+
}, [
|
|
3518
|
+
context.client,
|
|
3519
|
+
loadedCheckpointIsCompaction,
|
|
3520
|
+
props.session.id,
|
|
3521
|
+
props.session.workspaceId,
|
|
3522
|
+
remoteV2Chat
|
|
3523
|
+
]);
|
|
3524
|
+
const codexCompacted = loadedCheckpointIsCompaction ?? (fetchedCodexCompaction?.sessionId === props.session.id && fetchedCodexCompaction.compacted);
|
|
3525
|
+
const switchHeadsUp = (target2, label) => needsModelSwitchHeadsUp({
|
|
3526
|
+
codexCompactionMode: props.session.codexCompactionMode,
|
|
3527
|
+
codexCompacted,
|
|
3528
|
+
model: target2
|
|
3529
|
+
}) ? modelSwitchHeadsUpText(label) : null;
|
|
3530
|
+
const continueAfterUsageLimit = async (policy, options = {}) => {
|
|
3531
|
+
if (usageContinuationInFlight.current) return;
|
|
3532
|
+
usageContinuationInFlight.current = true;
|
|
3533
|
+
const sessionId = props.session.id;
|
|
3534
|
+
setUsageContinuation({ sessionId, pending: true, error: null });
|
|
3535
|
+
let error = null;
|
|
3536
|
+
try {
|
|
3537
|
+
if (options.resumeFirst)
|
|
3538
|
+
await context.client.resumeSession(props.session.workspaceId, sessionId, {
|
|
3539
|
+
clientEventId: crypto.randomUUID(),
|
|
3540
|
+
// Never undo a pause made after this page last read the control.
|
|
3541
|
+
expectedControlEtag: admissionControl.controlEtag
|
|
3542
|
+
});
|
|
3543
|
+
if (props.session.status === "failed" && props.failure?.failureEventId && retryHasRetainedTurn) {
|
|
3544
|
+
await retryFailedSession(props.failure.failureEventId, policy);
|
|
3545
|
+
} else {
|
|
3546
|
+
const chat = readChatSendContext();
|
|
3547
|
+
if (chat.blocked) error = chat.blocked;
|
|
3548
|
+
else {
|
|
3549
|
+
const message = {
|
|
3550
|
+
text: "Continue",
|
|
3551
|
+
...chat.extras,
|
|
3552
|
+
...policy,
|
|
3553
|
+
clientEventId: crypto.randomUUID()
|
|
3554
|
+
};
|
|
3555
|
+
if (props.session.status === "waiting_capacity" || options.steer)
|
|
3556
|
+
await context.client.steerMessage(props.session.workspaceId, sessionId, message);
|
|
3557
|
+
else await context.client.sendMessage(props.session.workspaceId, sessionId, message);
|
|
3558
|
+
}
|
|
3559
|
+
}
|
|
3560
|
+
} catch (failure) {
|
|
3561
|
+
error = userErrorText(failure, "Try again.");
|
|
3562
|
+
} finally {
|
|
3563
|
+
usageContinuationInFlight.current = false;
|
|
3564
|
+
setUsageContinuation({ sessionId, pending: false, error });
|
|
3565
|
+
await Promise.allSettled([props.onReloadSession(), props.queue.refresh()]);
|
|
3566
|
+
}
|
|
3567
|
+
};
|
|
3568
|
+
const usagePaused = admissionControl.state === "paused";
|
|
3569
|
+
const continueAtReset = codexUsageContinuesAtReset({
|
|
3570
|
+
status: props.session.status,
|
|
3571
|
+
paused: usagePaused
|
|
3572
|
+
});
|
|
3573
|
+
const setContinueAtReset = (next) => {
|
|
3574
|
+
const action = codexUsageContinueAtResetAction({
|
|
3575
|
+
status: props.session.status,
|
|
3576
|
+
paused: usagePaused,
|
|
3577
|
+
next
|
|
3578
|
+
});
|
|
3579
|
+
if (action === "pause") void composer.pause();
|
|
3580
|
+
else if (action === "resume") void composer.resume();
|
|
3581
|
+
else if (action === "run_on_codex" || action === "resume_and_run_on_codex")
|
|
3582
|
+
void continueAfterUsageLimit(
|
|
3583
|
+
{
|
|
3584
|
+
model: props.session.model,
|
|
3585
|
+
reasoningEffort: props.session.reasoningEffort,
|
|
3586
|
+
latencyMode: props.session.latencyMode
|
|
3587
|
+
},
|
|
3588
|
+
{ resumeFirst: action === "resume_and_run_on_codex" }
|
|
3589
|
+
);
|
|
3590
|
+
};
|
|
3591
|
+
const usageModelSwitch = useCodexUsageModelSwitch({
|
|
3592
|
+
sessionId: props.session.id,
|
|
3593
|
+
sessionModel: props.session.model,
|
|
3594
|
+
composerModel: model,
|
|
3595
|
+
enabled: codexUsageChoices,
|
|
3596
|
+
closePicker: () => setModelPickerSession(null),
|
|
3597
|
+
onContinue: (picked) => void continueAfterUsageLimit(
|
|
3598
|
+
{ model: picked, reasoningEffort, latencyMode },
|
|
3599
|
+
// A Steer resumes a paused waiting chat itself; resuming first would
|
|
3600
|
+
// wake its Codex wait for nothing.
|
|
3601
|
+
{ resumeFirst: usagePaused && props.session.status !== "waiting_capacity" }
|
|
3602
|
+
)
|
|
3603
|
+
});
|
|
3604
|
+
const codexUsageChoice = codexUsageChoices && codexUsageNoticeApplies({
|
|
3605
|
+
status: props.session.status,
|
|
3606
|
+
resetsAt: codexUsageResetsAtValue,
|
|
3607
|
+
usageWait: codexWaitIsUsageLimit(props.events)
|
|
3608
|
+
}) ? {
|
|
3609
|
+
resetText: codexUsageResetText(codexUsageResetsAtValue),
|
|
3610
|
+
continueAtReset,
|
|
3611
|
+
pending: usageContinuation?.pending || composer.pausing || composer.resuming,
|
|
3612
|
+
error: usageContinuation?.error,
|
|
3613
|
+
onContinueAtResetChange: setContinueAtReset
|
|
3614
|
+
} : void 0;
|
|
3615
|
+
const codexUsageNotice = codexUsageChoice && props.session.status !== "failed" && !terminal ? /* @__PURE__ */ jsx(CodexUsageNotice, { choice: codexUsageChoice }) : null;
|
|
3616
|
+
const pinnedWait = useMemo3(
|
|
3617
|
+
() => terminal ? null : pinnedAccountWait(props.session, props.events),
|
|
3618
|
+
[terminal, props.session, props.events]
|
|
3619
|
+
);
|
|
3620
|
+
const pinnedAccountWaitNotice = pinnedWait ? /* @__PURE__ */ jsx(
|
|
3621
|
+
PinnedAccountWaitNotice,
|
|
3622
|
+
{
|
|
3623
|
+
workspaceId: props.session.workspaceId,
|
|
3624
|
+
sessionId: props.session.id,
|
|
3625
|
+
wait: pinnedWait,
|
|
3626
|
+
events: props.events,
|
|
3627
|
+
canChoose: workspacePermissions.includes("sessions:control")
|
|
3628
|
+
}
|
|
3629
|
+
) : null;
|
|
3630
|
+
const othersWait = useMemo3(
|
|
3631
|
+
() => !terminal && isCodexProductModel(props.session.model) && workspacePermissions.includes("sessions:control") && isPersonalWorkspace(workspace, context.managedSelfContext) ? othersWaitingTurn(props.session, props.events, {
|
|
3632
|
+
viewerSubjectId: context.accessContext.subjectId,
|
|
3633
|
+
paused: usagePaused
|
|
3634
|
+
}) : null,
|
|
3635
|
+
[
|
|
3636
|
+
terminal,
|
|
3637
|
+
props.session,
|
|
3638
|
+
props.events,
|
|
3639
|
+
workspacePermissions,
|
|
3640
|
+
workspace,
|
|
3641
|
+
context.managedSelfContext,
|
|
3642
|
+
context.accessContext.subjectId,
|
|
3643
|
+
usagePaused
|
|
3644
|
+
]
|
|
3645
|
+
);
|
|
3646
|
+
const ownAccountWaitNotice = othersWait ? /* @__PURE__ */ jsx(
|
|
3647
|
+
OwnAccountWaitNotice,
|
|
3648
|
+
{
|
|
3649
|
+
workspaceId: props.session.workspaceId,
|
|
3650
|
+
sessionId: props.session.id,
|
|
3651
|
+
model: props.session.model,
|
|
3652
|
+
startedBy: othersWait.startedBy,
|
|
3653
|
+
events: props.events,
|
|
3654
|
+
pending: usageContinuation?.pending,
|
|
3655
|
+
error: usageContinuation?.error,
|
|
3656
|
+
onContinue: () => void continueAfterUsageLimit(
|
|
3657
|
+
{
|
|
3658
|
+
model: props.session.model,
|
|
3659
|
+
reasoningEffort: props.session.reasoningEffort,
|
|
3660
|
+
latencyMode: props.session.latencyMode
|
|
3661
|
+
},
|
|
3662
|
+
{ steer: true }
|
|
3663
|
+
)
|
|
3664
|
+
}
|
|
3665
|
+
) : null;
|
|
3666
|
+
const chosenModelHeadsUp = !terminal ? switchHeadsUp(model, selectedPolicyRow?.label ?? unavailableModelName(model)) : null;
|
|
3667
|
+
const modelSwitchHeadsUp = chosenModelHeadsUp ? /* @__PURE__ */ jsx(ModelSwitchHeadsUp, { text: chosenModelHeadsUp, className: "px-3.5 pt-2.5 md:px-4" }) : null;
|
|
3668
|
+
const ownLoginsApply = !terminal && props.session.tenancy?.visibility === "workspace" && !isPersonalWorkspace(workspace, context.managedSelfContext);
|
|
3669
|
+
const ownLoginsHeadsUp = ownLoginsApply ? /* @__PURE__ */ jsx(
|
|
3670
|
+
OwnLoginsSharedHeadsUp,
|
|
3671
|
+
{
|
|
3672
|
+
logins: connectionAccounts.loading || connectionAccounts.error ? null : ownLoginsInUse(
|
|
3673
|
+
// Only the connectors this chat uses.
|
|
3674
|
+
connectionAccounts.accountGroups,
|
|
3675
|
+
connectionAccounts.accountChoices,
|
|
3676
|
+
context.accessContext.subjectId
|
|
3677
|
+
),
|
|
3678
|
+
className: "px-3.5 pt-2.5 md:px-4",
|
|
3679
|
+
logoFor: (login) => props.resolveProviderLogo(login.accounts[0].providerDomain),
|
|
3680
|
+
onChange: async (login, on) => {
|
|
3681
|
+
try {
|
|
3682
|
+
if (on)
|
|
3683
|
+
await turnOnOwnLoginsHere(context.client, props.session.workspaceId, login.accounts);
|
|
3684
|
+
else await stopOwnLoginsHere(context.client, props.session.workspaceId, login.accounts);
|
|
3685
|
+
} finally {
|
|
3686
|
+
await connectionAccounts.refresh();
|
|
3687
|
+
}
|
|
3688
|
+
}
|
|
3689
|
+
},
|
|
3690
|
+
props.session.id
|
|
3691
|
+
) : null;
|
|
3692
|
+
const sessionSecrets = useSessionSecrets(props.session.id, {
|
|
3693
|
+
enabled: workspacePermissions.includes("secrets:list")
|
|
3694
|
+
});
|
|
3695
|
+
const secretsView = sessionSecrets.secrets;
|
|
3696
|
+
const renderMessageSender = useMessageSenderRenderer(
|
|
3697
|
+
context.client,
|
|
3698
|
+
props.session.workspaceId,
|
|
3699
|
+
context.accessContext.subjectId
|
|
3700
|
+
);
|
|
3701
|
+
const commandContext = useMemo3(
|
|
3702
|
+
() => ({
|
|
3703
|
+
client: context.client,
|
|
3704
|
+
workspaceId: props.session.workspaceId,
|
|
3705
|
+
sessionId: props.session.id,
|
|
3706
|
+
status: props.session.status,
|
|
3707
|
+
permissions: workspacePermissions
|
|
3708
|
+
}),
|
|
3709
|
+
[
|
|
3710
|
+
context.client,
|
|
3711
|
+
props.session.workspaceId,
|
|
3712
|
+
props.session.id,
|
|
3713
|
+
props.session.status,
|
|
3714
|
+
workspacePermissions
|
|
3715
|
+
]
|
|
3716
|
+
);
|
|
3717
|
+
const [forkEventId, setForkEventId] = useState3(null);
|
|
3718
|
+
const [turnRatings, setTurnRatings] = useState3({});
|
|
3719
|
+
const mayRate = hasWorkspacePermission(
|
|
3720
|
+
context.accessContext,
|
|
3721
|
+
props.session.workspaceId,
|
|
3722
|
+
"sessions:create"
|
|
3723
|
+
);
|
|
3724
|
+
useEffect4(() => {
|
|
3725
|
+
setTurnRatings({});
|
|
3726
|
+
setForkEventId(null);
|
|
3727
|
+
if (!mayRate) return;
|
|
3728
|
+
return loadSessionFeedback(
|
|
3729
|
+
context.client,
|
|
3730
|
+
props.session.workspaceId,
|
|
3731
|
+
props.session.id,
|
|
3732
|
+
({ feedback }) => {
|
|
3733
|
+
const ratings = turnRatingsFromFeedback(feedback);
|
|
3734
|
+
setTurnRatings((saved) => ({ ...ratings, ...saved }));
|
|
3735
|
+
}
|
|
3736
|
+
);
|
|
3737
|
+
}, [
|
|
3738
|
+
context.client,
|
|
3739
|
+
props.session.workspaceId,
|
|
3740
|
+
props.session.id,
|
|
3741
|
+
mayRate,
|
|
3742
|
+
context.accessContext.subjectId
|
|
3743
|
+
]);
|
|
3744
|
+
const mayForkMessage = context.clientConfig.auth.mode === "managedSession" && context.authSession !== null && Boolean(props.session.tenancy) && mayRate;
|
|
3745
|
+
const forkRequests = useUiEventTarget("document");
|
|
3746
|
+
const eventsRef = useRef2(props.events);
|
|
3747
|
+
eventsRef.current = props.events;
|
|
3748
|
+
useEffect4(() => {
|
|
3749
|
+
if (!mayForkMessage) return;
|
|
3750
|
+
const fork = () => {
|
|
3751
|
+
const events = eventsRef.current;
|
|
3752
|
+
for (let index = events.length - 1; index >= 0; index -= 1) {
|
|
3753
|
+
const event = events[index];
|
|
3754
|
+
if (event.type === "agent.message.completed" || event.type === "user.message") {
|
|
3755
|
+
setForkEventId(event.id);
|
|
3756
|
+
return;
|
|
3757
|
+
}
|
|
3758
|
+
}
|
|
3759
|
+
};
|
|
3760
|
+
forkRequests.addEventListener(FORK_CURRENT_CHAT_EVENT, fork);
|
|
3761
|
+
return () => forkRequests.removeEventListener(FORK_CURRENT_CHAT_EVENT, fork);
|
|
3762
|
+
}, [forkRequests, mayForkMessage]);
|
|
3763
|
+
const onMessageRated = useCallback3((turnId, sentiment) => {
|
|
3764
|
+
setTurnRatings((saved) => ({ ...saved, [turnId]: sentiment }));
|
|
3765
|
+
}, []);
|
|
3766
|
+
const renderMessageActions = useCallback3(
|
|
3767
|
+
(item) => /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
3768
|
+
MessageActions,
|
|
3769
|
+
{
|
|
3770
|
+
item,
|
|
3771
|
+
client: context.client,
|
|
3772
|
+
workspaceId: props.session.workspaceId,
|
|
3773
|
+
sessionId: props.session.id,
|
|
3774
|
+
mayRate,
|
|
3775
|
+
mayFork: mayForkMessage,
|
|
3776
|
+
savedSentiment: item.kind === "agent-message" && item.turnId ? turnRatings[item.turnId] ?? null : null,
|
|
3777
|
+
onRated: onMessageRated,
|
|
3778
|
+
onFork: setForkEventId
|
|
3779
|
+
}
|
|
3780
|
+
) }),
|
|
3781
|
+
[
|
|
3782
|
+
context.client,
|
|
3783
|
+
props.session.workspaceId,
|
|
3784
|
+
props.session.id,
|
|
3785
|
+
mayRate,
|
|
3786
|
+
mayForkMessage,
|
|
3787
|
+
turnRatings,
|
|
3788
|
+
onMessageRated
|
|
3789
|
+
]
|
|
3790
|
+
);
|
|
3791
|
+
const renderImage = useCallback3(
|
|
3792
|
+
(image) => {
|
|
3793
|
+
const artifactId = retainedImageId(image.src);
|
|
3794
|
+
return artifactId ? /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("span", { role: "status", children: "Loading image\u2026" }), children: /* @__PURE__ */ jsx(
|
|
3795
|
+
InlineChatArtifact,
|
|
3796
|
+
{
|
|
3797
|
+
workspaceId: props.session.workspaceId,
|
|
3798
|
+
artifactId,
|
|
3799
|
+
alt: image.alt
|
|
3800
|
+
},
|
|
3801
|
+
props.session.workspaceId + ":" + artifactId
|
|
3802
|
+
) }) : null;
|
|
3803
|
+
},
|
|
3804
|
+
[props.session.workspaceId]
|
|
3805
|
+
);
|
|
3806
|
+
const renderInteractiveBlock = useCallback3(
|
|
3807
|
+
(block) => /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("span", { role: "status", children: "Loading preview\u2026" }), children: /* @__PURE__ */ jsx(ChatInteractiveBlock, { workspaceId: props.session.workspaceId, ...block }) }),
|
|
3808
|
+
[props.session.workspaceId]
|
|
3809
|
+
);
|
|
3810
|
+
const artifactHref = useCallback3(
|
|
3811
|
+
(id) => `/workspaces/${props.session.workspaceId}/artifacts/files/${id}`,
|
|
3812
|
+
[props.session.workspaceId]
|
|
3813
|
+
);
|
|
3814
|
+
const renderMessageText = useCallback3(
|
|
3815
|
+
(text, item, renderContext) => {
|
|
3816
|
+
if (item.kind === "user-message") {
|
|
3817
|
+
if (item.humanInputDelegation) {
|
|
3818
|
+
return /* @__PURE__ */ jsx(
|
|
3819
|
+
HumanInputDelegationRecord,
|
|
3820
|
+
{
|
|
3821
|
+
client: context.client,
|
|
3822
|
+
workspaceId: props.session.workspaceId,
|
|
3823
|
+
item: { ...item, humanInputDelegation: item.humanInputDelegation },
|
|
3824
|
+
viewerSubjectId: context.accessContext.subjectId
|
|
3825
|
+
}
|
|
3826
|
+
);
|
|
3827
|
+
}
|
|
3828
|
+
return /* @__PURE__ */ jsx(UserMessageBody, { item, searchTarget: renderContext.searchTarget });
|
|
3829
|
+
}
|
|
3830
|
+
return /* @__PURE__ */ jsx("div", { "data-testid": "assistant-markdown", children: /* @__PURE__ */ jsx(
|
|
3831
|
+
MarkdownText,
|
|
3832
|
+
{
|
|
3833
|
+
artifactHref,
|
|
3834
|
+
text,
|
|
3835
|
+
searchTarget: renderContext.searchTarget,
|
|
3836
|
+
softLineBreaks: true,
|
|
3837
|
+
streaming: item.kind === "agent-message" && item.streaming,
|
|
3838
|
+
onSandboxFile: props.onOpenSandboxFile,
|
|
3839
|
+
renderInteractiveBlock,
|
|
3840
|
+
renderImage
|
|
3841
|
+
}
|
|
3842
|
+
) });
|
|
3843
|
+
},
|
|
3844
|
+
[
|
|
3845
|
+
artifactHref,
|
|
3846
|
+
context.accessContext.subjectId,
|
|
3847
|
+
context.client,
|
|
3848
|
+
props.onOpenSandboxFile,
|
|
3849
|
+
props.session.workspaceId,
|
|
3850
|
+
renderInteractiveBlock,
|
|
3851
|
+
renderImage
|
|
3852
|
+
]
|
|
3853
|
+
);
|
|
3854
|
+
const [creditTopupOpen, setCreditTopupOpen] = useState3(false);
|
|
3855
|
+
const openCreditTopup = canBuyCredits ? () => setCreditTopupOpen(true) : void 0;
|
|
3856
|
+
const topupRefusal = ((creditRefusal?.sessionId === props.session.id ? creditRefusal.code : null) ?? stopRefusal) === "byok_paid_credit_required" ? "byok_paid_credit_required" : null;
|
|
3857
|
+
const creditTopupPrompt = canBuyCredits && workspaceAccountId ? /* @__PURE__ */ jsx(Suspense, { fallback: null, children: creditTopupOpen ? /* @__PURE__ */ jsx(
|
|
3858
|
+
LazyCreditTopupPrompt,
|
|
3859
|
+
{
|
|
3860
|
+
purpose: "topup",
|
|
3861
|
+
refusalCode: topupRefusal,
|
|
3862
|
+
open: true,
|
|
3863
|
+
workspaceId: props.session.workspaceId,
|
|
3864
|
+
accountId: workspaceAccountId,
|
|
3865
|
+
canBuyCredits: true,
|
|
3866
|
+
onOpenChange: setCreditTopupOpen,
|
|
3867
|
+
beforeLeave: composer.flushDraft
|
|
3868
|
+
}
|
|
3869
|
+
) : null }) : null;
|
|
3870
|
+
const canConnectModel = hasWorkspacePermission(
|
|
3871
|
+
context.accessContext,
|
|
3872
|
+
props.session.workspaceId,
|
|
3873
|
+
"connections:write"
|
|
3874
|
+
);
|
|
3875
|
+
const allowFailedMachine = props.failure?.failureCode === MACHINE_ACCESS_REQUIRED_CODE && runsOnCanMessage && runsOnActiveMachineConsent && runsOn.activeMachine ? {
|
|
3876
|
+
consent: runsOnActiveMachineConsent,
|
|
3877
|
+
machineName: machineDisplayName(t, runsOn.activeMachine)
|
|
3878
|
+
} : null;
|
|
3879
|
+
const allowMachine = allowFailedMachine ? {
|
|
3880
|
+
machineName: allowFailedMachine.machineName,
|
|
3881
|
+
onAllow: async () => {
|
|
3882
|
+
const chat = readChatSendContext();
|
|
3883
|
+
if (chat.blocked) return chat.blocked;
|
|
3884
|
+
if (chat.awaitingHuman) return "Answer the question above first.";
|
|
3885
|
+
try {
|
|
3886
|
+
await context.client.sendMessage(props.session.workspaceId, props.session.id, {
|
|
3887
|
+
text: `${machineUseMessage(allowFailedMachine.machineName)} Continue where you left off.`,
|
|
3888
|
+
...chat.extras,
|
|
3889
|
+
personalResourceAttachment: allowFailedMachine.consent,
|
|
3890
|
+
clientEventId: crypto.randomUUID()
|
|
3891
|
+
});
|
|
3892
|
+
return null;
|
|
3893
|
+
} catch (failure) {
|
|
3894
|
+
return userErrorText(failure, "Try again.");
|
|
3895
|
+
} finally {
|
|
3896
|
+
await Promise.allSettled([props.onReloadSession(), props.queue.refresh()]);
|
|
3897
|
+
}
|
|
3898
|
+
}
|
|
3899
|
+
} : void 0;
|
|
3900
|
+
const failureRecovery = !props.hasNewer && !readOnlyArchive && props.failure && (props.session.status === "failed" || props.creditExhausted && props.session.status === "idle") ? /* @__PURE__ */ jsx(FailureRecoveryBoundary, { fallback: failureFallback, children: /* @__PURE__ */ jsx(Suspense, { fallback: failureFallback, children: /* @__PURE__ */ jsx(
|
|
3901
|
+
LazyFailedSessionBanner,
|
|
3902
|
+
{
|
|
3903
|
+
failure: props.failure,
|
|
3904
|
+
shownInTimeline: timelineShowsFailure(timelineWithStartup, {
|
|
3905
|
+
failureEventId: props.failure.failureEventId,
|
|
3906
|
+
turnId: failureTurnId
|
|
3907
|
+
}),
|
|
3908
|
+
analyticsKey: props.failure.failureEventId ?? `${props.session.id}:${props.failure.failedAt ?? "unknown"}`,
|
|
3909
|
+
canChooseModel: canChooseRecoveryModel,
|
|
3910
|
+
codexUsage: codexUsageChoice,
|
|
3911
|
+
allowMachine,
|
|
3912
|
+
hasModelPicker: hasComposerPolicy,
|
|
3913
|
+
freeModel: isDeploymentFreeModel(modelCatalog.rows, props.session.model),
|
|
3914
|
+
subscriptions: connectableSubscriptions(context.clientConfig.models),
|
|
3915
|
+
modelChanged: Boolean(composerPolicy && composerPolicy.model !== props.session.model),
|
|
3916
|
+
creditExhausted: props.creditExhausted,
|
|
3917
|
+
creditRefusal: stopRefusal,
|
|
3918
|
+
freeCreditGap: creditGap,
|
|
3919
|
+
onChooseModel: chooseCoveredModel,
|
|
3920
|
+
workspaceId: props.session.workspaceId,
|
|
3921
|
+
canBuyCredits,
|
|
3922
|
+
onAddCredits: openCreditTopup,
|
|
3923
|
+
canConnectModel,
|
|
3924
|
+
sandboxRecovery: needsSandboxRecoveryCheck(props.session, props.failure.structuralSandboxFailure) ? {
|
|
3925
|
+
client: context.client,
|
|
3926
|
+
workspaceId: props.session.workspaceId,
|
|
3927
|
+
sessionId: props.session.id,
|
|
3928
|
+
canControl: workspacePermissions.includes("sessions:control")
|
|
3929
|
+
} : void 0,
|
|
3930
|
+
actions: {
|
|
3931
|
+
failureId: props.failure.failureEventId,
|
|
3932
|
+
retryInput: pendingRetryInput,
|
|
3933
|
+
composerBlocker: composerSendBlocker(),
|
|
3934
|
+
onRetry: async () => {
|
|
3935
|
+
if (composer.hasDraftContent() || composerSendBlocker() || !props.failure?.failureEventId || !retryHasRetainedTurn || !composerPolicy || !workspacePermissions.includes("sessions:control") || admissionControl.state === "paused")
|
|
3936
|
+
return false;
|
|
3937
|
+
try {
|
|
3938
|
+
return await retryFailedSession(props.failure.failureEventId, composerPolicy);
|
|
3939
|
+
} finally {
|
|
3940
|
+
await Promise.allSettled([props.onReloadSession(), props.queue.refresh()]);
|
|
3941
|
+
}
|
|
3942
|
+
},
|
|
3943
|
+
retryBlocker: !workspacePermissions.includes("sessions:control") ? "permission" : admissionControl.state === "paused" ? "paused" : composer.hasDraftContent() ? "draft" : failedOptimisticMessageCount > 0 ? "unsent" : (optimisticMessages ?? []).some(
|
|
3944
|
+
(message) => !acceptedClientEventIds.has(message.clientEventId)
|
|
3945
|
+
) ? "delivery" : props.session.activeTurnId !== null || props.queue.queue.length > 0 ? "queued" : composer.sending || composer.draftLoading || !hasComposerPolicy || !retryHasRetainedTurn || !props.failure.failureEventId ? "loading" : null
|
|
3946
|
+
}
|
|
3947
|
+
},
|
|
3948
|
+
props.session.id
|
|
3949
|
+
) }) }, props.session.id) : null;
|
|
3950
|
+
const sessionCreditRefusal = creditRefusal?.sessionId === props.session.id && !terminal && !(failureRecovery && props.creditExhausted) ? creditRefusal : null;
|
|
3951
|
+
const creditRefusalFallback = sessionCreditRefusal ? /* @__PURE__ */ jsx("p", { role: "alert", className: "px-1.5 text-sm text-fg-muted", children: apiErrorFacts(sessionCreditRefusal.message).serverMessage ?? sessionCreditRefusal.message }) : null;
|
|
3952
|
+
const creditRefusalNotice = sessionCreditRefusal ? /* @__PURE__ */ jsx(FailureRecoveryBoundary, { fallback: creditRefusalFallback, children: /* @__PURE__ */ jsx(Suspense, { fallback: creditRefusalFallback, children: /* @__PURE__ */ jsx(
|
|
3953
|
+
LazyCreditRefusalNotice,
|
|
3954
|
+
{
|
|
3955
|
+
gap: creditRefusalGap(modelCatalog.rows, sessionCreditRefusal.model, {
|
|
3956
|
+
selectedModel: composerPolicy?.model,
|
|
3957
|
+
preferredModel: modelCatalog.defaultSelection?.model
|
|
3958
|
+
}),
|
|
3959
|
+
message: sessionCreditRefusal.message,
|
|
3960
|
+
refusalCode: sessionCreditRefusal.code,
|
|
3961
|
+
workspaceId: props.session.workspaceId,
|
|
3962
|
+
accountId: workspaceAccountId,
|
|
3963
|
+
canReadBilling: Boolean(workspaceAccountId) && hasAccountPermission(context.accessContext, workspaceAccountId ?? "", "billing:read"),
|
|
3964
|
+
canBuyCredits,
|
|
3965
|
+
canConnectModel,
|
|
3966
|
+
continuing: true,
|
|
3967
|
+
onChooseModel: modelPickerDisabled ? void 0 : chooseCoveredModel,
|
|
3968
|
+
onAddCredits: openCreditTopup,
|
|
3969
|
+
onDismiss: () => setCreditRefusal(null)
|
|
3970
|
+
}
|
|
3971
|
+
) }) }, props.session.id) : null;
|
|
3972
|
+
const modelRecovery = props.hasNewer ? null : currentModelRecovery({ ...props.session, effectiveControl: admissionControl }, props.events);
|
|
3973
|
+
const reviewDetailPane = reviewDetails ? /* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", "data-workspace-scroll-owner": "self-managed", children: /* @__PURE__ */ jsx(
|
|
3974
|
+
ToolActionReviewDetails,
|
|
3975
|
+
{
|
|
3976
|
+
review: reviewDetails.review,
|
|
3977
|
+
path: reviewDetails.path,
|
|
3978
|
+
load: loadToolReviewDetails,
|
|
3979
|
+
onBack: () => {
|
|
3980
|
+
const { review, path, origin } = reviewDetails;
|
|
3981
|
+
setReviewDetails(null);
|
|
3982
|
+
requestAnimationFrame(() => {
|
|
3983
|
+
const selector = `[data-approval-id="${CSS.escape(review.id)}"]${origin ? `[data-review-origin="${CSS.escape(origin)}"]` : ""} button[data-review-path="${CSS.escape(path)}"]`;
|
|
3984
|
+
document.querySelector(selector)?.focus();
|
|
3985
|
+
});
|
|
3986
|
+
}
|
|
3987
|
+
},
|
|
3988
|
+
reviewDetails.review.id + reviewDetails.path
|
|
3989
|
+
) }) : null;
|
|
3990
|
+
return createElement(
|
|
3991
|
+
Fragment,
|
|
3992
|
+
null,
|
|
3993
|
+
reviewDetailPane,
|
|
3994
|
+
creditTopupPrompt,
|
|
3995
|
+
createElement(
|
|
3996
|
+
"div",
|
|
3997
|
+
{
|
|
3998
|
+
className: reviewDetails ? "hidden" : "contents",
|
|
3999
|
+
...inertProps(Boolean(reviewDetails)),
|
|
4000
|
+
...props.placement === "panel" ? { ref: setPanelRoot } : {}
|
|
4001
|
+
},
|
|
4002
|
+
createElement(
|
|
4003
|
+
LightboxProvider,
|
|
4004
|
+
null,
|
|
4005
|
+
/* @__PURE__ */ jsxs(
|
|
4006
|
+
ChatViewportFileDropTarget,
|
|
4007
|
+
{
|
|
4008
|
+
"data-workspace-scroll-owner": "self-managed",
|
|
4009
|
+
enabled: !terminal && context.clientConfig.fileUploads.enabled === true,
|
|
4010
|
+
onFiles: attachments.addFiles,
|
|
4011
|
+
children: [
|
|
4012
|
+
findMounted ? /* @__PURE__ */ jsx(LazyPart, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
4013
|
+
ConversationFind,
|
|
4014
|
+
{
|
|
4015
|
+
workspaceId: props.session.workspaceId,
|
|
4016
|
+
sessionId: props.session.id,
|
|
4017
|
+
open: findOpen,
|
|
4018
|
+
focusRevision: findFocusRevision,
|
|
4019
|
+
initial: props.searchTarget,
|
|
4020
|
+
showBackToSessionSearch: props.searchTarget.searchOrigin === "session-search",
|
|
4021
|
+
onClose: closeFind,
|
|
4022
|
+
onTarget: setActiveSearchTarget,
|
|
4023
|
+
onJump: props.onJumpToSequence
|
|
4024
|
+
}
|
|
4025
|
+
) }) : null,
|
|
4026
|
+
cancelled ? /* @__PURE__ */ jsxs("div", { className: cn("mx-auto w-full max-w-3xl pt-6", gutter), children: [
|
|
4027
|
+
/* @__PURE__ */ jsx(TerminalSessionBanner, { session: props.session, onNewSession: props.onNewSession }),
|
|
4028
|
+
/* @__PURE__ */ jsx(TerminalSessionArchive, { session: props.session, eventCount: props.timeline.length })
|
|
4029
|
+
] }) : readOnlyArchive ? /* @__PURE__ */ jsx("div", { className: cn("mx-auto w-full max-w-3xl pt-6", gutter), children: /* @__PURE__ */ jsx(
|
|
4030
|
+
ReadOnlySessionNotice,
|
|
4031
|
+
{
|
|
4032
|
+
session: props.session,
|
|
4033
|
+
onContinue: props.onContinueInNewSession,
|
|
4034
|
+
onRestore: props.onRestoreArchived
|
|
4035
|
+
}
|
|
4036
|
+
) }) : null,
|
|
4037
|
+
/* @__PURE__ */ jsx(Fragment2, { children: /* @__PURE__ */ jsx("div", { "data-testid": "session-timeline", className: "min-h-0 min-w-0 flex-1", children: /* @__PURE__ */ jsx(LearningRefusalActionsProvider, { onOpen: props.onLearningRefusalOpen, children: /* @__PURE__ */ jsx(
|
|
4038
|
+
KnowledgeActivityProvider,
|
|
4039
|
+
{
|
|
4040
|
+
onInspect: props.onMemoryClick,
|
|
4041
|
+
onRetryFile: (fileId) => composer.send(
|
|
4042
|
+
`Retry searchable source preparation for attached file ${fileId}. Use knowledge_retain_file and report its result.`
|
|
4043
|
+
),
|
|
4044
|
+
retryDisabled: composer.hasDraftContent() || composer.sending || composer.draftLoading || !hasComposerPolicy,
|
|
4045
|
+
children: /* @__PURE__ */ jsx(
|
|
4046
|
+
ToolReviewHistoryProvider,
|
|
4047
|
+
{
|
|
4048
|
+
events: props.events,
|
|
4049
|
+
load: loadRecordedToolReview,
|
|
4050
|
+
onViewDetails: viewToolReviewDetails,
|
|
4051
|
+
children: /* @__PURE__ */ jsx(
|
|
4052
|
+
InteractiveAnswerProvider,
|
|
4053
|
+
{
|
|
4054
|
+
send: composer.send,
|
|
4055
|
+
scope: props.session.id,
|
|
4056
|
+
store: answerStore,
|
|
4057
|
+
readOnly: terminal,
|
|
4058
|
+
children: /* @__PURE__ */ jsx(
|
|
4059
|
+
MessageTimeline,
|
|
4060
|
+
{
|
|
4061
|
+
resolveLink,
|
|
4062
|
+
artifactScope: {
|
|
4063
|
+
client: context.client,
|
|
4064
|
+
workspaceId: props.session.workspaceId,
|
|
4065
|
+
sessionId: props.session.id
|
|
4066
|
+
},
|
|
4067
|
+
renderMessageSender,
|
|
4068
|
+
allowanceExhaustedLabels: CONSOLE_TIMELINE_ALLOWANCE_LABELS,
|
|
4069
|
+
presentedFailureEventIds: failureRecovery ? bannerFailureIds : void 0,
|
|
4070
|
+
trailingState: /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
4071
|
+
failureRecovery,
|
|
4072
|
+
pinnedConnectionCard ? /* @__PURE__ */ jsx("div", { className: "pb-1", "data-pinned-connection-card": "", children: renderAuthNeeded(pinnedConnectionCard) ?? /* @__PURE__ */ jsx(
|
|
4073
|
+
AuthNeededRow,
|
|
4074
|
+
{
|
|
4075
|
+
item: pinnedConnectionCard,
|
|
4076
|
+
onReconnect: props.onReconnect,
|
|
4077
|
+
resolveProviderLogo: props.resolveProviderLogo
|
|
4078
|
+
}
|
|
4079
|
+
) }) : null,
|
|
4080
|
+
props.approvals.length > 0 && approvalsDecidable(props.session.status) && /* @__PURE__ */ jsx(
|
|
4081
|
+
ApprovalSurface,
|
|
4082
|
+
{
|
|
4083
|
+
approvals: props.approvals,
|
|
4084
|
+
selectedApprovalId,
|
|
4085
|
+
onSelectedApprovalChange: setSelectedApprovalId,
|
|
4086
|
+
loadReview: loadToolReview,
|
|
4087
|
+
onViewDetails: viewToolReviewDetails,
|
|
4088
|
+
onAllowAccess: props.onAllowAccess,
|
|
4089
|
+
onApprove: (approval, answer) => decideApproval(approval.id, "approve", answer),
|
|
4090
|
+
onReject: (approval) => decideApproval(approval.id, "reject")
|
|
4091
|
+
}
|
|
4092
|
+
),
|
|
4093
|
+
/* @__PURE__ */ jsx(LazyPart, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
4094
|
+
SessionSkillReviews,
|
|
4095
|
+
{
|
|
4096
|
+
context,
|
|
4097
|
+
workspaceId: props.session.workspaceId,
|
|
4098
|
+
sessionId: props.session.id,
|
|
4099
|
+
events: props.events
|
|
4100
|
+
},
|
|
4101
|
+
`${context.accessContext.subjectId}:${props.session.workspaceId}:${props.session.id}`
|
|
4102
|
+
) }),
|
|
4103
|
+
props.humanInput.requests.length > 0 && props.session.status === "requires_action" ? /* @__PURE__ */ jsx("div", { className: "pb-1", "data-human-input-timeline-surface": "", children: /* @__PURE__ */ jsx(LazyPart, { fallback: /* @__PURE__ */ jsx(LoadingPanel, { label: "Loading questions\u2026" }), children: /* @__PURE__ */ jsx(
|
|
4104
|
+
HumanInputSurface,
|
|
4105
|
+
{
|
|
4106
|
+
loadSkillReview,
|
|
4107
|
+
allowedSaveTo: secretSaveTargets(
|
|
4108
|
+
context.accessContext,
|
|
4109
|
+
props.session.workspaceId
|
|
4110
|
+
),
|
|
4111
|
+
requests: props.humanInput.requests,
|
|
4112
|
+
respondingRequestId: props.humanInput.respondingRequestId,
|
|
4113
|
+
error: props.humanInput.mutationError?.message,
|
|
4114
|
+
onSubmit: async (requestId, response) => {
|
|
4115
|
+
if (!await props.humanInput.respond(requestId, response)) {
|
|
4116
|
+
throw new Error("Your answer wasn't sent. Try again.");
|
|
4117
|
+
}
|
|
4118
|
+
}
|
|
4119
|
+
}
|
|
4120
|
+
) }) }) : null
|
|
4121
|
+
] }),
|
|
4122
|
+
turnSummary: { rolling: true },
|
|
4123
|
+
className: "h-full",
|
|
4124
|
+
items: timelineItems,
|
|
4125
|
+
searchTarget: activeSearchTarget,
|
|
4126
|
+
focusSequence: momentSequence,
|
|
4127
|
+
events: props.events,
|
|
4128
|
+
status: props.session.status,
|
|
4129
|
+
pause: timelineLivePause(admissionControl),
|
|
4130
|
+
computeLabel,
|
|
4131
|
+
renderMessageText,
|
|
4132
|
+
renderMessageActions,
|
|
4133
|
+
onAnnotate: composer.addAnnotation,
|
|
4134
|
+
draftAnnotations: composer.annotations,
|
|
4135
|
+
onDraftAnnotationSelect: composer.requestAnnotationReview,
|
|
4136
|
+
onOpenSession: props.onOpenSession,
|
|
4137
|
+
resolveSessionTitle: props.resolveSessionTitle,
|
|
4138
|
+
onMemoryClick: props.onMemoryClick,
|
|
4139
|
+
onReconnect: props.onReconnect,
|
|
4140
|
+
renderAuthNeeded,
|
|
4141
|
+
resolveProviderLogo: props.resolveProviderLogo,
|
|
4142
|
+
loadRetainedScreenshot,
|
|
4143
|
+
loadRetainedArtifact,
|
|
4144
|
+
loadVideoArtifactPlayback,
|
|
4145
|
+
hasOlder: props.hasOlder,
|
|
4146
|
+
loadingOlder: props.loadingOlder,
|
|
4147
|
+
onLoadOlder: props.onLoadOlder,
|
|
4148
|
+
hasNewer: props.hasNewer,
|
|
4149
|
+
loadingNewer: props.loadingNewer,
|
|
4150
|
+
onLoadNewer: props.onLoadNewer,
|
|
4151
|
+
loadingOldest: props.loadingOldest,
|
|
4152
|
+
onJumpToStart: async () => {
|
|
4153
|
+
await props.onJumpToStart();
|
|
4154
|
+
},
|
|
4155
|
+
onJumpToLatest: props.onJumpToLatest,
|
|
4156
|
+
emptyState: (
|
|
4157
|
+
// Clear view hides history, not the retained failure or retry operation.
|
|
4158
|
+
failureRecovery ?? (props.queue.stoppingPreviousAttempt ? /* @__PURE__ */ jsx(
|
|
4159
|
+
EmptyState,
|
|
4160
|
+
{
|
|
4161
|
+
className: "min-h-[24rem]",
|
|
4162
|
+
icon: /* @__PURE__ */ jsx(Loader2Icon, { className: "size-4 animate-spin motion-reduce:animate-none" }),
|
|
4163
|
+
title: props.queue.effectiveControl?.state === "paused" ? "Stopping current work" : "Stopping previous work",
|
|
4164
|
+
description: props.queue.effectiveControl?.state === "paused" ? "Waiting for the current command to stop safely. Queued work stays saved." : "Your direction is saved. It starts after the previous command stops safely."
|
|
4165
|
+
}
|
|
4166
|
+
) : props.initialLoading ? /* @__PURE__ */ jsx("div", { className: "flex min-h-[24rem]", children: /* @__PURE__ */ jsx(LoadingPanel, {}) }) : props.historyReloadFailed ? /* @__PURE__ */ jsx(
|
|
4167
|
+
ProblemPanel,
|
|
4168
|
+
{
|
|
4169
|
+
title: "Conversation couldn't be loaded",
|
|
4170
|
+
description: "Your saved messages are unchanged. Try loading them again.",
|
|
4171
|
+
action: /* @__PURE__ */ jsx(
|
|
4172
|
+
Button,
|
|
4173
|
+
{
|
|
4174
|
+
variant: "outline",
|
|
4175
|
+
onClick: () => void props.onJumpToLatest(),
|
|
4176
|
+
children: "Retry conversation"
|
|
4177
|
+
}
|
|
4178
|
+
)
|
|
4179
|
+
}
|
|
4180
|
+
) : /* @__PURE__ */ jsx(
|
|
4181
|
+
EmptyState,
|
|
4182
|
+
{
|
|
4183
|
+
className: "min-h-[24rem]",
|
|
4184
|
+
icon: props.session.status === "running" || props.session.status === "recovering" ? /* @__PURE__ */ jsx(Loader2Icon, { className: "size-4 animate-spin motion-reduce:animate-none" }) : /* @__PURE__ */ jsx(MessagesSquareIcon, { className: "size-4" }),
|
|
4185
|
+
title: timelineEmptyStateCopy.title,
|
|
4186
|
+
description: timelineEmptyStateCopy.description
|
|
4187
|
+
}
|
|
4188
|
+
))
|
|
4189
|
+
)
|
|
4190
|
+
},
|
|
4191
|
+
props.session.id
|
|
4192
|
+
)
|
|
4193
|
+
}
|
|
4194
|
+
)
|
|
4195
|
+
}
|
|
4196
|
+
)
|
|
4197
|
+
}
|
|
4198
|
+
) }) }) }),
|
|
4199
|
+
forkEventId ? /* @__PURE__ */ jsx(LazyPart, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
4200
|
+
MessageForkDialog,
|
|
4201
|
+
{
|
|
4202
|
+
session: props.session,
|
|
4203
|
+
events: props.events,
|
|
4204
|
+
sourceEventId: forkEventId,
|
|
4205
|
+
onForkClose: () => setForkEventId(null)
|
|
4206
|
+
},
|
|
4207
|
+
forkEventId
|
|
4208
|
+
) }) : null,
|
|
4209
|
+
repositories.removalDialog,
|
|
4210
|
+
modelRecovery ? /* @__PURE__ */ jsx(ModelRecoveryNotice, { recovery: modelRecovery }) : null,
|
|
4211
|
+
/* @__PURE__ */ jsx("div", { className: cn("mb-1 w-full shrink-0 has-[>div:empty]:hidden", gutter), children: /* @__PURE__ */ jsxs("div", { className: "mx-auto w-full max-w-3xl", children: [
|
|
4212
|
+
/* @__PURE__ */ jsx(
|
|
4213
|
+
SessionAdmissionNotice,
|
|
4214
|
+
{
|
|
4215
|
+
session: props.session,
|
|
4216
|
+
machineAccess,
|
|
4217
|
+
sharedChat,
|
|
4218
|
+
machineAction: /* @__PURE__ */ jsx(
|
|
4219
|
+
SessionMachinePickerAction,
|
|
4220
|
+
{
|
|
4221
|
+
queuedWork: true,
|
|
4222
|
+
runsOn,
|
|
4223
|
+
workspaceId: props.session.workspaceId,
|
|
4224
|
+
rigId: props.session.rigId,
|
|
4225
|
+
move: moveRunsOn
|
|
4226
|
+
}
|
|
4227
|
+
),
|
|
4228
|
+
machines: runsOn.fleet.machines,
|
|
4229
|
+
onMoveToMachine: runsOn.fleet.canAttach ? moveSavedMessage : void 0,
|
|
4230
|
+
canControl: workspacePermissions.includes("sessions:control"),
|
|
4231
|
+
paused: admissionControl.state === "paused",
|
|
4232
|
+
refreshRequired: admissionRefreshRequired,
|
|
4233
|
+
busy: composer.resuming || composer.pausing || composer.sending || props.queue.mutating,
|
|
4234
|
+
onRecheck: () => recheckSessionAdmission({
|
|
4235
|
+
control: admissionControl,
|
|
4236
|
+
refreshOnly: admissionRefreshRequired,
|
|
4237
|
+
resume: (control) => context.client.resumeSession(props.session.workspaceId, props.session.id, {
|
|
4238
|
+
clientEventId: crypto.randomUUID(),
|
|
4239
|
+
expectedControlEtag: control.controlEtag
|
|
4240
|
+
}),
|
|
4241
|
+
refresh: [props.onReloadSession, props.queue.refresh]
|
|
4242
|
+
}),
|
|
4243
|
+
onRefresh: async () => {
|
|
4244
|
+
await Promise.all([props.onReloadSession(), props.queue.refresh()]);
|
|
4245
|
+
},
|
|
4246
|
+
onAllowMachine: machineAccess?.isOwner && runsOn.activeMachine?.enrollmentId && runsOn.activeMachine.sandboxId === props.session.activeSandboxId ? async () => {
|
|
4247
|
+
const enrollmentId = runsOn.activeMachine?.enrollmentId;
|
|
4248
|
+
const allowed = enrollmentId ? await allowMachineForChat({
|
|
4249
|
+
client: context.client,
|
|
4250
|
+
workspaceId: props.session.workspaceId,
|
|
4251
|
+
session: props.session,
|
|
4252
|
+
enrollmentId
|
|
4253
|
+
}) : false;
|
|
4254
|
+
await Promise.allSettled([
|
|
4255
|
+
props.onReloadSession(),
|
|
4256
|
+
props.queue.refresh(),
|
|
4257
|
+
runsOn.fleet.refresh()
|
|
4258
|
+
]);
|
|
4259
|
+
if (!allowed) throw new Error("machine could not be allowed");
|
|
4260
|
+
} : void 0,
|
|
4261
|
+
onContinueWaitingWork: async () => {
|
|
4262
|
+
await context.client.continueSessionWaitingWork(
|
|
4263
|
+
props.session.workspaceId,
|
|
4264
|
+
props.session.id
|
|
4265
|
+
);
|
|
4266
|
+
if (sessionAdmissionReason(props.session) !== null && admissionControl.state !== "paused")
|
|
4267
|
+
await recheckSessionAdmission({
|
|
4268
|
+
control: admissionControl,
|
|
4269
|
+
refreshOnly: admissionRefreshRequired,
|
|
4270
|
+
resume: (control) => context.client.resumeSession(props.session.workspaceId, props.session.id, {
|
|
4271
|
+
clientEventId: crypto.randomUUID(),
|
|
4272
|
+
expectedControlEtag: control.controlEtag
|
|
4273
|
+
}),
|
|
4274
|
+
refresh: [props.onReloadSession, props.queue.refresh]
|
|
4275
|
+
});
|
|
4276
|
+
else await props.onReloadSession();
|
|
4277
|
+
await runsOn.fleet.refresh();
|
|
4278
|
+
}
|
|
4279
|
+
},
|
|
4280
|
+
`${props.session.workspaceId}:${props.session.id}`
|
|
4281
|
+
),
|
|
4282
|
+
waitingSubSessions.length > 0 ? /* @__PURE__ */ jsx(LazyPart, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
4283
|
+
OpenGeniLinkProvider,
|
|
4284
|
+
{
|
|
4285
|
+
resolveLink,
|
|
4286
|
+
artifactScope: {
|
|
4287
|
+
client: context.client,
|
|
4288
|
+
workspaceId: props.session.workspaceId,
|
|
4289
|
+
sessionId: props.session.id
|
|
4290
|
+
},
|
|
4291
|
+
children: /* @__PURE__ */ jsx(
|
|
4292
|
+
DescendantRequests,
|
|
4293
|
+
{
|
|
4294
|
+
client: context.client,
|
|
4295
|
+
workspaceId: props.session.workspaceId,
|
|
4296
|
+
parentSessionId: props.session.id,
|
|
4297
|
+
events: props.events,
|
|
4298
|
+
waiting: waitingSubSessions,
|
|
4299
|
+
onResolved: props.onDescendantResolved,
|
|
4300
|
+
onResumingChange: onSubSessionResumingChange,
|
|
4301
|
+
refreshSignal: props.descendantRefreshSignal,
|
|
4302
|
+
onAllowAccess: props.onAllowAccess,
|
|
4303
|
+
loadSkillReview,
|
|
4304
|
+
allowedSaveTo: secretSaveTargets(
|
|
4305
|
+
context.accessContext,
|
|
4306
|
+
props.session.workspaceId
|
|
4307
|
+
)
|
|
4308
|
+
}
|
|
4309
|
+
)
|
|
4310
|
+
}
|
|
4311
|
+
) }) : null,
|
|
4312
|
+
/* @__PURE__ */ jsx(
|
|
4313
|
+
SessionChrome,
|
|
4314
|
+
{
|
|
4315
|
+
sessionStatus: props.session.status,
|
|
4316
|
+
wait: admissionControl.state === "active" ? sessionInputWait(props.session) : null,
|
|
4317
|
+
onOpenSession: props.onOpenSession,
|
|
4318
|
+
queue: props.queue,
|
|
4319
|
+
composer: terminal ? void 0 : composer,
|
|
4320
|
+
queuedRecall,
|
|
4321
|
+
goal: props.goal,
|
|
4322
|
+
readOnly: terminal,
|
|
4323
|
+
commandsCount: props.session.backgroundCommandActivity?.count ?? 0,
|
|
4324
|
+
commandsPanel: /* @__PURE__ */ jsx(LazyPart, { fallback: /* @__PURE__ */ jsx(LoadingPanel, { label: "Loading commands\u2026" }), children: /* @__PURE__ */ jsx(
|
|
4325
|
+
SessionCommands,
|
|
4326
|
+
{
|
|
4327
|
+
sessionId: props.session.id,
|
|
4328
|
+
readOnly: terminal
|
|
4329
|
+
},
|
|
4330
|
+
props.session.id
|
|
4331
|
+
) }),
|
|
4332
|
+
agentsSignal,
|
|
4333
|
+
agentsPanel: props.agentNodes.length > 0 ? /* @__PURE__ */ jsx(LazyPart, { fallback: /* @__PURE__ */ jsx(LoadingPanel, { label: "Loading agents\u2026" }), children: /* @__PURE__ */ jsx(
|
|
4334
|
+
SubagentTree,
|
|
4335
|
+
{
|
|
4336
|
+
workspaceId: props.session.workspaceId,
|
|
4337
|
+
nodes: props.agentNodes
|
|
4338
|
+
}
|
|
4339
|
+
) }) : null
|
|
4340
|
+
}
|
|
4341
|
+
)
|
|
4342
|
+
] }) }),
|
|
4343
|
+
/* @__PURE__ */ jsx(
|
|
4344
|
+
"div",
|
|
4345
|
+
{
|
|
4346
|
+
ref: composerRegionRef,
|
|
4347
|
+
"data-read-only-composer": readOnlyArchive ? "hidden" : void 0,
|
|
4348
|
+
className: cn(
|
|
4349
|
+
"shrink-0",
|
|
4350
|
+
props.placement === "panel" ? "pb-3" : "pb-4",
|
|
4351
|
+
gutter,
|
|
4352
|
+
readOnlyArchive && "hidden"
|
|
4353
|
+
),
|
|
4354
|
+
children: /* @__PURE__ */ jsxs("div", { className: "mx-auto w-full max-w-3xl", children: [
|
|
4355
|
+
/* @__PURE__ */ jsx(
|
|
4356
|
+
PersonalResourceAttachmentSurface,
|
|
4357
|
+
{
|
|
4358
|
+
controller: personalAttachment,
|
|
4359
|
+
disabled: terminal || composer.sending,
|
|
4360
|
+
compact: true
|
|
4361
|
+
}
|
|
4362
|
+
),
|
|
4363
|
+
/* @__PURE__ */ jsx(
|
|
4364
|
+
ConsoleComposer,
|
|
4365
|
+
{
|
|
4366
|
+
workspaceId: props.session.workspaceId,
|
|
4367
|
+
usageRefreshKey: props.session.status,
|
|
4368
|
+
composer: composerDelivery,
|
|
4369
|
+
attachments,
|
|
4370
|
+
effectiveControl: composer.effectiveControl,
|
|
4371
|
+
queuedAheadCount: props.queue.queue.length,
|
|
4372
|
+
queuedRecall,
|
|
4373
|
+
running: usageLimitTreeActive || sessionTurnKeepsRunControl(props.session.status) || props.pendingWake,
|
|
4374
|
+
canControlWorkspace: workspacePermissions.includes("workspace:admin"),
|
|
4375
|
+
controlLinks: {
|
|
4376
|
+
workspaceHref: `/workspaces/${props.session.workspaceId}`,
|
|
4377
|
+
sessionHref: (sessionId) => `/workspaces/${props.session.workspaceId}/sessions/${sessionId}`
|
|
4378
|
+
},
|
|
4379
|
+
disabled: terminal,
|
|
4380
|
+
header: ownLoginsHeadsUp || unavailableModelNotice || pinnedAccountWaitNotice || ownAccountWaitNotice || codexUsageNotice || modelSwitchHeadsUp || usageLimitNotice || creditRefusalNotice || sendBlockerNotice || showMachineAccess ? /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
4381
|
+
!sessionAdmissionNeedsDifferentMachine(
|
|
4382
|
+
sessionAdmissionReason(props.session),
|
|
4383
|
+
machineAccess
|
|
4384
|
+
) ? /* @__PURE__ */ jsx(
|
|
4385
|
+
SessionMachineAccessNotice,
|
|
4386
|
+
{
|
|
4387
|
+
access: machineAccess,
|
|
4388
|
+
shared: sharedChat,
|
|
4389
|
+
className: "px-3.5 pt-2.5 md:px-4",
|
|
4390
|
+
action: /* @__PURE__ */ jsx(
|
|
4391
|
+
SessionMachinePickerAction,
|
|
4392
|
+
{
|
|
4393
|
+
runsOn,
|
|
4394
|
+
workspaceId: props.session.workspaceId,
|
|
4395
|
+
rigId: props.session.rigId,
|
|
4396
|
+
move: moveRunsOn,
|
|
4397
|
+
compact: machineAccess?.isOwner === true
|
|
4398
|
+
}
|
|
4399
|
+
)
|
|
4400
|
+
}
|
|
4401
|
+
) : null,
|
|
4402
|
+
unavailableModelNotice,
|
|
4403
|
+
pinnedAccountWaitNotice,
|
|
4404
|
+
codexUsageNotice,
|
|
4405
|
+
ownAccountWaitNotice,
|
|
4406
|
+
modelSwitchHeadsUp,
|
|
4407
|
+
usageLimitNotice,
|
|
4408
|
+
creditRefusalNotice ? /* @__PURE__ */ jsx("div", { className: "px-2 pt-2", children: creditRefusalNotice }) : null,
|
|
4409
|
+
ownLoginsHeadsUp,
|
|
4410
|
+
sendBlockerNotice
|
|
4411
|
+
] }) : null,
|
|
4412
|
+
commandContext,
|
|
4413
|
+
onClearView: props.onClearView,
|
|
4414
|
+
fileUploadsEnabled: context.clientConfig.fileUploads.enabled === true,
|
|
4415
|
+
transcriptionSuppressed: voiceActive,
|
|
4416
|
+
controlsLeading: /* @__PURE__ */ jsx(Fragment2, { children: /* @__PURE__ */ jsx(
|
|
4417
|
+
WorkspaceComposerPlus,
|
|
4418
|
+
{
|
|
4419
|
+
connectorActions: {
|
|
4420
|
+
accountControls: {
|
|
4421
|
+
groups: connectionAccounts.availableAccountGroups,
|
|
4422
|
+
choices: connectionAccounts.accountChoices,
|
|
4423
|
+
onChoose: connectionAccounts.selectAccount,
|
|
4424
|
+
loading: connectionAccounts.loading,
|
|
4425
|
+
error: connectionAccounts.error,
|
|
4426
|
+
accessDenied: connectionAccounts.accessDenied,
|
|
4427
|
+
onRefresh: () => void connectionAccounts.refresh(),
|
|
4428
|
+
disabled: terminal || composer.sending || durableToolsSaving || !durableToolsHydrated
|
|
4429
|
+
}
|
|
4430
|
+
},
|
|
4431
|
+
chatSettings: props.onOpenAgentSettings ? {
|
|
4432
|
+
workspaceId: props.session.workspaceId,
|
|
4433
|
+
sessionId: props.session.id,
|
|
4434
|
+
scope: chatLearningScope(props.session),
|
|
4435
|
+
canEdit: workspacePermissions.includes("sessions:control"),
|
|
4436
|
+
onOpen: props.onOpenAgentSettings
|
|
4437
|
+
} : void 0,
|
|
4438
|
+
workspaceId: props.session.workspaceId,
|
|
4439
|
+
disabled: terminal || composer.sending,
|
|
4440
|
+
fileUploadsEnabled: context.clientConfig.fileUploads.enabled === true,
|
|
4441
|
+
servers: selectableSessionMcpServers,
|
|
4442
|
+
firstPartyTools: firstPartyToolOptions,
|
|
4443
|
+
selection: durableToolSelection,
|
|
4444
|
+
toolsSaving: durableToolsSaving,
|
|
4445
|
+
toolsDisabled: composer.sending || terminal || durableToolsSaving || !durableToolsHydrated,
|
|
4446
|
+
connectorCustomizing,
|
|
4447
|
+
onConnectorCustomizingChange: (next) => {
|
|
4448
|
+
setConnectorCustomizingOverride(next);
|
|
4449
|
+
if (next) return;
|
|
4450
|
+
connectionAccounts.resetEmptyChoices();
|
|
4451
|
+
void applyDurableToolPolicy(
|
|
4452
|
+
followWorkspaceConnectorPolicy(durableToolsSnapshot)
|
|
4453
|
+
);
|
|
4454
|
+
},
|
|
4455
|
+
onToolSelectionChange: (next) => void saveDurableToolPolicy(next),
|
|
4456
|
+
...secretsView?.capabilityEnabled ? {
|
|
4457
|
+
secrets: {
|
|
4458
|
+
summary: sessionSecretsSummary(
|
|
4459
|
+
secretsView.policy,
|
|
4460
|
+
secretsView.reachableVaults
|
|
4461
|
+
),
|
|
4462
|
+
panel: /* @__PURE__ */ jsx(
|
|
4463
|
+
SessionSecretsMenuBody,
|
|
4464
|
+
{
|
|
4465
|
+
vaults: secretsView.reachableVaults,
|
|
4466
|
+
policy: secretsView.policy,
|
|
4467
|
+
narrowedByParent: secretsView.narrowedBySessionId !== null,
|
|
4468
|
+
taskItems: secretsView.taskItems,
|
|
4469
|
+
canEdit: workspacePermissions.includes("sessions:control"),
|
|
4470
|
+
disabled: terminal,
|
|
4471
|
+
loading: sessionSecrets.loading,
|
|
4472
|
+
error: sessionSecrets.error,
|
|
4473
|
+
onRetry: () => void sessionSecrets.refresh(),
|
|
4474
|
+
onPolicyChange: async (policy) => {
|
|
4475
|
+
await sessionSecrets.api.setSessionVaultPolicy(
|
|
4476
|
+
props.session.id,
|
|
4477
|
+
policy
|
|
4478
|
+
);
|
|
4479
|
+
await sessionSecrets.refresh();
|
|
4480
|
+
},
|
|
4481
|
+
onSaveTo: async (item, target2) => {
|
|
4482
|
+
await sessionSecrets.api.moveItem(item.vaultId, item.id, {
|
|
4483
|
+
targetVaultId: target2.id,
|
|
4484
|
+
mode: "copy"
|
|
4485
|
+
});
|
|
4486
|
+
toast.success(`Saved ${item.name} to ${target2.name}`);
|
|
4487
|
+
},
|
|
4488
|
+
onManage: () => void navigate({
|
|
4489
|
+
to: "/workspaces/$workspaceId/secrets",
|
|
4490
|
+
params: { workspaceId: props.session.workspaceId }
|
|
4491
|
+
})
|
|
4492
|
+
}
|
|
4493
|
+
)
|
|
4494
|
+
}
|
|
4495
|
+
} : {},
|
|
4496
|
+
repositories: {
|
|
4497
|
+
selectedCount: repositories.selectionCount,
|
|
4498
|
+
disabled: terminal || composer.sending,
|
|
4499
|
+
panel: /* @__PURE__ */ jsx(FollowUpRepositoryMenuBody, { ...repositoryPickerProps })
|
|
4500
|
+
},
|
|
4501
|
+
...runsOn.hasChoices || props.session.rigId || runsOn.activeMachine && !runsOn.activeMachine.isSessionGroup ? {
|
|
4502
|
+
runsOn: {
|
|
4503
|
+
summary: runsOn.activeName,
|
|
4504
|
+
panel: /* @__PURE__ */ jsx(
|
|
4505
|
+
SessionRunsOnMenuBody,
|
|
4506
|
+
{
|
|
4507
|
+
runsOn,
|
|
4508
|
+
workspaceId: props.session.workspaceId,
|
|
4509
|
+
rigId: props.session.rigId ?? null,
|
|
4510
|
+
move: moveRunsOn
|
|
4511
|
+
}
|
|
4512
|
+
)
|
|
4513
|
+
}
|
|
4514
|
+
} : {}
|
|
4515
|
+
}
|
|
4516
|
+
) }),
|
|
4517
|
+
actions: !terminal ? /* @__PURE__ */ jsx(LazyPart, { onLoadFailure: "hide", fallback: null, children: /* @__PURE__ */ jsx(
|
|
4518
|
+
LazyCodexRealtimeControl,
|
|
4519
|
+
{
|
|
4520
|
+
client: realtimeClient,
|
|
4521
|
+
workspaceId: props.session.workspaceId,
|
|
4522
|
+
sessionId: props.session.id,
|
|
4523
|
+
sessionStatus: props.session.status,
|
|
4524
|
+
effectiveControl: props.queue.effectiveControl ?? props.session.effectiveControl,
|
|
4525
|
+
events: props.events,
|
|
4526
|
+
eventsReady: !props.initialLoading,
|
|
4527
|
+
codexConnected,
|
|
4528
|
+
realtimeAutostartModel: props.realtimeAutostartModel,
|
|
4529
|
+
onRealtimeAutostartConsumed: props.onRealtimeAutostartConsumed,
|
|
4530
|
+
onVoiceActiveChange
|
|
4531
|
+
}
|
|
4532
|
+
) }) : null,
|
|
4533
|
+
placeholder: chatComposerPlaceholder({
|
|
4534
|
+
archived: readOnlyArchive !== null,
|
|
4535
|
+
cancelled,
|
|
4536
|
+
creditStopped: Boolean(props.creditExhausted) && (props.session.status === "failed" || props.session.status === "idle"),
|
|
4537
|
+
stopRefusal,
|
|
4538
|
+
creditGap,
|
|
4539
|
+
canBuyCredits
|
|
4540
|
+
}),
|
|
4541
|
+
controls: /* @__PURE__ */ jsxs("div", { className: "@container/model-controls flex min-w-0 flex-1 items-center gap-1.5", children: [
|
|
4542
|
+
simplifiedInterface ? null : /* @__PURE__ */ jsx(
|
|
4543
|
+
ModelPicker,
|
|
4544
|
+
{
|
|
4545
|
+
hasImageAttachments: attachments.attachments.some(
|
|
4546
|
+
(file) => file.status !== "failed" && file.contentType.startsWith("image/")
|
|
4547
|
+
),
|
|
4548
|
+
open: modelPickerSession === props.session.id && !pendingRetryInput,
|
|
4549
|
+
onOpenChange: (open) => {
|
|
4550
|
+
setModelPickerSession(open ? props.session.id : null);
|
|
4551
|
+
if (open) void modelCatalog.refresh();
|
|
4552
|
+
},
|
|
4553
|
+
rows: modelCatalog.rows,
|
|
4554
|
+
model,
|
|
4555
|
+
effort: reasoningEffort,
|
|
4556
|
+
latencyMode,
|
|
4557
|
+
disabled: modelPickerDisabled,
|
|
4558
|
+
loading: modelCatalog.loading || composer.draftLoading,
|
|
4559
|
+
error: modelCatalog.error ?? composerPolicyError,
|
|
4560
|
+
sessionKey: props.session.id,
|
|
4561
|
+
menuSide: "top",
|
|
4562
|
+
connectModelsHref: `/workspaces/${encodeURIComponent(props.session.workspaceId)}/settings?section=models`,
|
|
4563
|
+
claudeSubscriptionAvailable: context.clientConfig.claudeSubscriptionEnabled === true,
|
|
4564
|
+
onModelChange: (modelId) => {
|
|
4565
|
+
composer.setModel(modelId);
|
|
4566
|
+
usageModelSwitch.modelPicked(modelId);
|
|
4567
|
+
},
|
|
4568
|
+
onEffortChange: composer.setReasoningEffort,
|
|
4569
|
+
onLatencyModeChange: composer.setLatencyMode
|
|
4570
|
+
}
|
|
4571
|
+
),
|
|
4572
|
+
durableToolsError ? /* @__PURE__ */ jsx("span", { className: "sr-only", role: "alert", children: durableToolsError }) : null
|
|
4573
|
+
] })
|
|
4574
|
+
}
|
|
4575
|
+
)
|
|
4576
|
+
] })
|
|
4577
|
+
}
|
|
4578
|
+
)
|
|
4579
|
+
]
|
|
4580
|
+
}
|
|
4581
|
+
)
|
|
4582
|
+
)
|
|
4583
|
+
)
|
|
4584
|
+
);
|
|
4585
|
+
}
|
|
4586
|
+
function refusedModelId(error, input) {
|
|
4587
|
+
const details = error.details;
|
|
4588
|
+
if (typeof details?.modelId === "string" && details.modelId) return details.modelId;
|
|
4589
|
+
const attempted = input?.model;
|
|
4590
|
+
return typeof attempted === "string" && attempted ? attempted : null;
|
|
4591
|
+
}
|
|
4592
|
+
|
|
4593
|
+
export {
|
|
4594
|
+
SessionRoute
|
|
4595
|
+
};
|
|
4596
|
+
//# sourceMappingURL=chunk-L4R7ORMD.js.map
|