@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
package/dist/chunk-WTZ6OJUY.js
DELETED
|
@@ -1,3070 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useSandboxFiles
|
|
4
|
-
} from "./chunk-KLYBSXHE.js";
|
|
5
|
-
import {
|
|
6
|
-
WorkbenchChanges,
|
|
7
|
-
WorkbenchChangesViewMenu,
|
|
8
|
-
useMachineChip
|
|
9
|
-
} from "./chunk-XHPBQTJP.js";
|
|
10
|
-
import {
|
|
11
|
-
WorkspaceDock
|
|
12
|
-
} from "./chunk-JG7MEMJP.js";
|
|
13
|
-
import {
|
|
14
|
-
SessionStatus
|
|
15
|
-
} from "./chunk-AJSRYRJS.js";
|
|
16
|
-
import {
|
|
17
|
-
PierreDiff
|
|
18
|
-
} from "./chunk-W43FINJV.js";
|
|
19
|
-
import {
|
|
20
|
-
SandboxTerminal,
|
|
21
|
-
terminalCanAcquirePty,
|
|
22
|
-
xtermThemeFromTokens
|
|
23
|
-
} from "./chunk-Q7QXSQ46.js";
|
|
24
|
-
import {
|
|
25
|
-
sandboxAcceptsLiveIo
|
|
26
|
-
} from "./chunk-QV3DJVRZ.js";
|
|
27
|
-
import {
|
|
28
|
-
SessionMcpCapabilityCard
|
|
29
|
-
} from "./chunk-BJ3WRO2K.js";
|
|
30
|
-
import {
|
|
31
|
-
useTurnlessOutputGap
|
|
32
|
-
} from "./chunk-IEDDIJ6B.js";
|
|
33
|
-
import {
|
|
34
|
-
invalidateSharedQueries,
|
|
35
|
-
useSharedQuery
|
|
36
|
-
} from "./chunk-DSQNSLQW.js";
|
|
37
|
-
import {
|
|
38
|
-
sessionAdmissionBlocked,
|
|
39
|
-
sessionDisplayStatus
|
|
40
|
-
} from "./chunk-DG5DQFS4.js";
|
|
41
|
-
import {
|
|
42
|
-
MACHINES_SESSION_POLL_MS,
|
|
43
|
-
useMachines
|
|
44
|
-
} from "./chunk-7FFZLLCH.js";
|
|
45
|
-
import {
|
|
46
|
-
useMutationRunner,
|
|
47
|
-
usePageLiveActivity,
|
|
48
|
-
usePolledValue
|
|
49
|
-
} from "./chunk-SW4S6I5E.js";
|
|
50
|
-
import {
|
|
51
|
-
normalizeError
|
|
52
|
-
} from "./chunk-CM7LVUKC.js";
|
|
53
|
-
import {
|
|
54
|
-
cn
|
|
55
|
-
} from "./chunk-TXS65BB2.js";
|
|
56
|
-
import {
|
|
57
|
-
useOpenGeni,
|
|
58
|
-
useOpenGeniClient
|
|
59
|
-
} from "./chunk-BVUAHAQX.js";
|
|
60
|
-
import {
|
|
61
|
-
useOpenGeniText
|
|
62
|
-
} from "./chunk-PVGD2RAV.js";
|
|
63
|
-
import {
|
|
64
|
-
formatRelativeTime
|
|
65
|
-
} from "./chunk-UIK52VL4.js";
|
|
66
|
-
|
|
67
|
-
// src/session-auth-recommendation.ts
|
|
68
|
-
function sessionAuthRecommendation(t, item, catalog) {
|
|
69
|
-
if (item.authoritySource === "host" || item.reason === "unsupported_auth" || item.reason === "resource_scope_unavailable" || item.reason === "account_scope_fixed")
|
|
70
|
-
return void 0;
|
|
71
|
-
if (item.capability) return item;
|
|
72
|
-
if (item.reason === "insufficient_scope" && item.connectionId) return void 0;
|
|
73
|
-
const recoveryServerId = item.canonicalServerId ?? item.serverId;
|
|
74
|
-
const matches = catalog.filter(
|
|
75
|
-
(candidate) => recoveryServerId !== null && candidate.runtime.mcpServerId === recoveryServerId && recoveryServerId !== "opengeni" || item.connectionId !== null && candidate.connectionRef?.connectionId === item.connectionId
|
|
76
|
-
);
|
|
77
|
-
if (matches.length !== 1) return void 0;
|
|
78
|
-
const entry = matches[0];
|
|
79
|
-
const personalAccess = item.reason === "personal_authority_unavailable";
|
|
80
|
-
if (personalAccess && ((item.connectionSubjectScope ?? entry.connectionRef?.subjectScope) !== "subject" || entry.connectionRef?.authoritySource === "host"))
|
|
81
|
-
return void 0;
|
|
82
|
-
return {
|
|
83
|
-
...item,
|
|
84
|
-
capability: {
|
|
85
|
-
id: entry.id,
|
|
86
|
-
name: entry.name,
|
|
87
|
-
kind: entry.kind,
|
|
88
|
-
source: entry.source,
|
|
89
|
-
action: "connect",
|
|
90
|
-
rationale: personalAccess ? t("sessionAuthRecommendation.reviewPermissionToUseYour") : t("sessionAuthRecommendation.reconnectThisIntegrationToUse"),
|
|
91
|
-
requiredVariables: []
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// src/components/session-connection-request.tsx
|
|
97
|
-
import { useEffect, useRef, useState } from "react";
|
|
98
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
99
|
-
function SessionConnectionRequest(props) {
|
|
100
|
-
const [client, setClient] = useState(props.client);
|
|
101
|
-
const [generation, setGeneration] = useState(0);
|
|
102
|
-
if (client !== props.client) {
|
|
103
|
-
setClient(props.client);
|
|
104
|
-
setGeneration(generation + 1);
|
|
105
|
-
}
|
|
106
|
-
return /* @__PURE__ */ jsx(
|
|
107
|
-
ScopedRequest,
|
|
108
|
-
{
|
|
109
|
-
...props
|
|
110
|
-
},
|
|
111
|
-
`${generation}:${props.workspaceId}:${props.sessionId}:${props.request.id}`
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
function ScopedRequest({ request, ...props }) {
|
|
115
|
-
const t = useOpenGeniText();
|
|
116
|
-
const [resolved, setResolved] = useState(null);
|
|
117
|
-
const [error, setError] = useState(null);
|
|
118
|
-
const [retry, setRetry] = useState(0);
|
|
119
|
-
const requestRef = useRef(request);
|
|
120
|
-
requestRef.current = request;
|
|
121
|
-
useEffect(() => {
|
|
122
|
-
let current = true;
|
|
123
|
-
const event = requestRef.current;
|
|
124
|
-
setResolved(null);
|
|
125
|
-
setError(null);
|
|
126
|
-
void props.client.listCapabilities(props.workspaceId).then((catalog) => {
|
|
127
|
-
if (!current) return;
|
|
128
|
-
const recommendation = sessionAuthRecommendation(t, event, catalog.items);
|
|
129
|
-
const candidate = catalog.items.find(
|
|
130
|
-
(entry) => entry.id === recommendation?.capability?.id
|
|
131
|
-
);
|
|
132
|
-
if (!recommendation || candidate?.kind !== "mcp" || candidate.authKind !== "oauth2") {
|
|
133
|
-
setError(t("sessionConnectionRequest.thisRequestCouldNotBe"));
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
setResolved(recommendation);
|
|
137
|
-
}).catch(() => {
|
|
138
|
-
if (current) setError(t("sessionConnectionRequest.couldnTLoadConnectionDetails"));
|
|
139
|
-
});
|
|
140
|
-
return () => {
|
|
141
|
-
current = false;
|
|
142
|
-
};
|
|
143
|
-
}, [
|
|
144
|
-
props.client,
|
|
145
|
-
props.workspaceId,
|
|
146
|
-
request.id,
|
|
147
|
-
request.serverId,
|
|
148
|
-
request.connectionId,
|
|
149
|
-
request.authoritySource,
|
|
150
|
-
request.reason,
|
|
151
|
-
request.capability?.id,
|
|
152
|
-
retry,
|
|
153
|
-
t
|
|
154
|
-
]);
|
|
155
|
-
if (!resolved?.capability)
|
|
156
|
-
return /* @__PURE__ */ jsxs("div", { className: "og-session-capability-setup", children: [
|
|
157
|
-
/* @__PURE__ */ jsx("p", { role: error ? "alert" : "status", children: error ?? t("sessionConnectionRequest.loadingConnectionDetails") }),
|
|
158
|
-
error ? /* @__PURE__ */ jsx("button", { type: "button", onClick: () => setRetry((value) => value + 1), children: t("sessionConnectionRequest.retry") }) : null
|
|
159
|
-
] });
|
|
160
|
-
return /* @__PURE__ */ jsx(
|
|
161
|
-
SessionMcpCapabilityCard,
|
|
162
|
-
{
|
|
163
|
-
...props,
|
|
164
|
-
capabilityId: resolved.capability.id,
|
|
165
|
-
name: resolved.capability.name,
|
|
166
|
-
rationale: resolved.capability.rationale
|
|
167
|
-
}
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// src/hooks/use-video-artifact-playback.ts
|
|
172
|
-
import { useMemo } from "react";
|
|
173
|
-
function useVideoArtifactPlaybackLoader(options = {}) {
|
|
174
|
-
const { client, workspaceId } = useOpenGeni(options);
|
|
175
|
-
return useMemo(
|
|
176
|
-
() => async (artifactId, signal) => {
|
|
177
|
-
if (typeof client.createVideoArtifactPlaybackSource !== "function") {
|
|
178
|
-
throw new Error("This Opengeni host does not expose retained-video playback.");
|
|
179
|
-
}
|
|
180
|
-
return await client.createVideoArtifactPlaybackSource(
|
|
181
|
-
workspaceId,
|
|
182
|
-
artifactId,
|
|
183
|
-
signal ? { signal } : {}
|
|
184
|
-
);
|
|
185
|
-
},
|
|
186
|
-
[client, workspaceId]
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
// src/hooks/use-scheduled-tasks.ts
|
|
191
|
-
import { useCallback } from "react";
|
|
192
|
-
function useScheduledTasks(options = {}) {
|
|
193
|
-
const { client, workspaceId } = useOpenGeni(options);
|
|
194
|
-
const limit = options.limit;
|
|
195
|
-
const load = useCallback(
|
|
196
|
-
async () => await client.listScheduledTasks(workspaceId, limit !== void 0 ? { limit } : {}),
|
|
197
|
-
[client, workspaceId, limit]
|
|
198
|
-
);
|
|
199
|
-
const state = usePolledValue(load, {
|
|
200
|
-
pollIntervalMs: options.pollIntervalMs,
|
|
201
|
-
enabled: options.enabled
|
|
202
|
-
});
|
|
203
|
-
return {
|
|
204
|
-
tasks: state.data ?? [],
|
|
205
|
-
loading: state.loading,
|
|
206
|
-
error: state.error,
|
|
207
|
-
refresh: state.refresh
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
// src/hooks/use-workspace-background-commands.ts
|
|
212
|
-
import { useCallback as useCallback2, useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
|
|
213
|
-
function useWorkspaceBackgroundCommands(options = {}) {
|
|
214
|
-
const { client, workspaceId } = useOpenGeni(options);
|
|
215
|
-
const [pages, setPages] = useState2(1);
|
|
216
|
-
const enabled = options.enabled ?? true;
|
|
217
|
-
useEffect2(() => setPages(1), [client, workspaceId]);
|
|
218
|
-
const load = useCallback2(
|
|
219
|
-
async (signal) => {
|
|
220
|
-
if (!client.listWorkspaceBackgroundCommands)
|
|
221
|
-
throw new Error("The configured client does not support workspace commands");
|
|
222
|
-
const commands = /* @__PURE__ */ new Map();
|
|
223
|
-
let cursor;
|
|
224
|
-
for (let page = 0; page < pages; page += 1) {
|
|
225
|
-
signal?.throwIfAborted();
|
|
226
|
-
const result = await client.listWorkspaceBackgroundCommands(workspaceId, {
|
|
227
|
-
...cursor ? { cursor } : {},
|
|
228
|
-
...signal ? { signal } : {}
|
|
229
|
-
});
|
|
230
|
-
for (const command of result.commands) commands.set(command.id, command);
|
|
231
|
-
cursor = result.nextCursor ?? void 0;
|
|
232
|
-
if (!cursor) break;
|
|
233
|
-
}
|
|
234
|
-
return { commands: [...commands.values()], hasMore: Boolean(cursor) };
|
|
235
|
-
},
|
|
236
|
-
[client, workspaceId, pages]
|
|
237
|
-
);
|
|
238
|
-
const state = usePolledValue(load, { enabled, pollIntervalMs: options.pollIntervalMs ?? 5e3 });
|
|
239
|
-
const { data, refresh } = state;
|
|
240
|
-
const generation = useRef2(0);
|
|
241
|
-
useEffect2(() => {
|
|
242
|
-
generation.current += 1;
|
|
243
|
-
return () => {
|
|
244
|
-
generation.current += 1;
|
|
245
|
-
};
|
|
246
|
-
}, [client, workspaceId, enabled]);
|
|
247
|
-
const cancel = useCallback2(
|
|
248
|
-
async (commandId) => {
|
|
249
|
-
const command = data?.commands.find((item) => item.id === commandId);
|
|
250
|
-
if (!command || !enabled) return;
|
|
251
|
-
if (!client.cancelSessionBackgroundCommand)
|
|
252
|
-
throw new Error("The configured client does not support stopping commands");
|
|
253
|
-
const ticket = generation.current;
|
|
254
|
-
await client.cancelSessionBackgroundCommand(workspaceId, command.sessionId, commandId);
|
|
255
|
-
if (ticket === generation.current) await refresh();
|
|
256
|
-
},
|
|
257
|
-
[client, workspaceId, enabled, data, refresh]
|
|
258
|
-
);
|
|
259
|
-
return {
|
|
260
|
-
commands: enabled && !state.error ? state.data?.commands ?? [] : [],
|
|
261
|
-
loading: enabled && state.loading,
|
|
262
|
-
error: enabled ? state.error : null,
|
|
263
|
-
refresh: state.refresh,
|
|
264
|
-
cancel,
|
|
265
|
-
hasMore: enabled && !state.error && (state.data?.hasMore ?? false),
|
|
266
|
-
loadMore: () => setPages((value) => value + 1)
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
// src/index.ts
|
|
271
|
-
import { asVaultClient, vaultsApi, vaultErrorCode, vaultErrorDetail } from "@opengeni/sdk";
|
|
272
|
-
|
|
273
|
-
// src/hooks/use-workspaces.ts
|
|
274
|
-
import { useCallback as useCallback3 } from "react";
|
|
275
|
-
function useWorkspaces(options = {}) {
|
|
276
|
-
const client = useOpenGeniClient(options);
|
|
277
|
-
const load = useCallback3(async () => await client.listWorkspaces(), [client]);
|
|
278
|
-
const { data, loading, error, refresh } = usePolledValue(load, {
|
|
279
|
-
pollIntervalMs: options.pollIntervalMs,
|
|
280
|
-
enabled: options.enabled
|
|
281
|
-
});
|
|
282
|
-
const { run, mutating, mutationError, clearMutationError } = useMutationRunner();
|
|
283
|
-
const create = useCallback3(
|
|
284
|
-
async (request) => {
|
|
285
|
-
const result = await run(() => client.createWorkspace(request));
|
|
286
|
-
if (result) {
|
|
287
|
-
await refresh();
|
|
288
|
-
}
|
|
289
|
-
return result;
|
|
290
|
-
},
|
|
291
|
-
[client, run, refresh]
|
|
292
|
-
);
|
|
293
|
-
const update = useCallback3(
|
|
294
|
-
async (workspaceId, request) => {
|
|
295
|
-
const result = await run(() => client.updateWorkspace(workspaceId, request));
|
|
296
|
-
if (result) {
|
|
297
|
-
await refresh();
|
|
298
|
-
}
|
|
299
|
-
return result;
|
|
300
|
-
},
|
|
301
|
-
[client, run, refresh]
|
|
302
|
-
);
|
|
303
|
-
return {
|
|
304
|
-
workspaces: data ?? [],
|
|
305
|
-
loading,
|
|
306
|
-
error,
|
|
307
|
-
refresh,
|
|
308
|
-
create,
|
|
309
|
-
update,
|
|
310
|
-
mutating,
|
|
311
|
-
mutationError,
|
|
312
|
-
clearMutationError
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
// src/hooks/use-billing-usage.ts
|
|
317
|
-
import { useCallback as useCallback4 } from "react";
|
|
318
|
-
function useBillingUsage(options = {}) {
|
|
319
|
-
const client = useOpenGeniClient(options);
|
|
320
|
-
const accountId = options.accountId;
|
|
321
|
-
const workspaceId = options.workspaceId;
|
|
322
|
-
const load = useCallback4(
|
|
323
|
-
async () => await client.getBillingUsage({
|
|
324
|
-
...accountId !== void 0 ? { accountId } : {},
|
|
325
|
-
...workspaceId !== void 0 ? { workspaceId } : {}
|
|
326
|
-
}),
|
|
327
|
-
[client, accountId, workspaceId]
|
|
328
|
-
);
|
|
329
|
-
const state = usePolledValue(load, {
|
|
330
|
-
pollIntervalMs: options.pollIntervalMs,
|
|
331
|
-
enabled: options.enabled
|
|
332
|
-
});
|
|
333
|
-
return {
|
|
334
|
-
balance: state.data?.balance ?? null,
|
|
335
|
-
usage: state.data?.usage ?? [],
|
|
336
|
-
loading: state.loading,
|
|
337
|
-
error: state.error,
|
|
338
|
-
refresh: state.refresh
|
|
339
|
-
};
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
// src/hooks/use-session-capabilities.ts
|
|
343
|
-
import {
|
|
344
|
-
OpenGeniApiError,
|
|
345
|
-
applyUrlRotation
|
|
346
|
-
} from "@opengeni/sdk";
|
|
347
|
-
import { useCallback as useCallback5, useEffect as useEffect3, useRef as useRef3, useState as useState3 } from "react";
|
|
348
|
-
function desktopAttachable(cell) {
|
|
349
|
-
if (cell.transport !== null) return true;
|
|
350
|
-
return cell.reason === "lease_cold" || cell.reason === "not_provisioned" || cell.reason === null;
|
|
351
|
-
}
|
|
352
|
-
var VIEWER_INTERACTION_EVENTS = [
|
|
353
|
-
"pointerdown",
|
|
354
|
-
"pointermove",
|
|
355
|
-
"keydown",
|
|
356
|
-
"wheel",
|
|
357
|
-
"touchstart"
|
|
358
|
-
];
|
|
359
|
-
function useViewerInteractionClock(onInteraction) {
|
|
360
|
-
const lastInteractionRef = useRef3(Date.now());
|
|
361
|
-
const onInteractionRef = useRef3(onInteraction);
|
|
362
|
-
onInteractionRef.current = onInteraction;
|
|
363
|
-
useEffect3(() => {
|
|
364
|
-
if (typeof window === "undefined") return;
|
|
365
|
-
const record = () => {
|
|
366
|
-
lastInteractionRef.current = Date.now();
|
|
367
|
-
onInteractionRef.current();
|
|
368
|
-
};
|
|
369
|
-
const onVisibility = () => {
|
|
370
|
-
if (typeof document !== "undefined" && document.visibilityState === "visible") record();
|
|
371
|
-
};
|
|
372
|
-
const listenerOptions = { capture: true, passive: true };
|
|
373
|
-
for (const type of VIEWER_INTERACTION_EVENTS) {
|
|
374
|
-
window.addEventListener(type, record, listenerOptions);
|
|
375
|
-
}
|
|
376
|
-
window.addEventListener("focus", record, listenerOptions);
|
|
377
|
-
if (typeof document !== "undefined") {
|
|
378
|
-
document.addEventListener("visibilitychange", onVisibility);
|
|
379
|
-
}
|
|
380
|
-
return () => {
|
|
381
|
-
for (const type of VIEWER_INTERACTION_EVENTS) {
|
|
382
|
-
window.removeEventListener(type, record, listenerOptions);
|
|
383
|
-
}
|
|
384
|
-
window.removeEventListener("focus", record, listenerOptions);
|
|
385
|
-
if (typeof document !== "undefined") {
|
|
386
|
-
document.removeEventListener("visibilitychange", onVisibility);
|
|
387
|
-
}
|
|
388
|
-
};
|
|
389
|
-
}, []);
|
|
390
|
-
return lastInteractionRef;
|
|
391
|
-
}
|
|
392
|
-
function rotationsFrom(events) {
|
|
393
|
-
const out = [];
|
|
394
|
-
for (const event of events) {
|
|
395
|
-
if (event.type === "stream.url.rotated" && event.payload && typeof event.payload === "object") {
|
|
396
|
-
out.push(event.payload);
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
return out;
|
|
400
|
-
}
|
|
401
|
-
function useSessionCapabilities(sessionId, options = {}) {
|
|
402
|
-
const { client, workspaceId } = useOpenGeni(options);
|
|
403
|
-
const enabled = (options.enabled ?? true) && Boolean(sessionId);
|
|
404
|
-
const pageLive = usePageLiveActivity();
|
|
405
|
-
const lifecycleEnabled = enabled && pageLive;
|
|
406
|
-
const attachDesktop = options.attachDesktop ?? false;
|
|
407
|
-
const attachTerminal = options.attachTerminal ?? false;
|
|
408
|
-
const attachFiles = options.attachFiles ?? false;
|
|
409
|
-
const warmingPollMs = options.warmingPollMs ?? 1500;
|
|
410
|
-
const warmingDeadlineMs = options.warmingDeadlineMs ?? 3e4;
|
|
411
|
-
const identityKey = `${workspaceId}\0${sessionId ?? ""}\0${enabled}`;
|
|
412
|
-
const [capabilities, setCapabilities] = useState3(null);
|
|
413
|
-
const [state, setState] = useState3("idle");
|
|
414
|
-
const [error, setError] = useState3(null);
|
|
415
|
-
const [acknowledgmentRequired, setAcknowledgmentRequired] = useState3(null);
|
|
416
|
-
const [viewerCapReached, setViewerCapReached] = useState3(false);
|
|
417
|
-
const [viewerCapReason, setViewerCapReason] = useState3(null);
|
|
418
|
-
const [viewerId, setViewerId] = useState3(null);
|
|
419
|
-
const [stateIdentity, setStateIdentity] = useState3(identityKey);
|
|
420
|
-
const [nonce, setNonce] = useState3(0);
|
|
421
|
-
const epochRef = useRef3(0);
|
|
422
|
-
const viewerIdRef = useRef3(null);
|
|
423
|
-
const previousIdentityRef = useRef3(identityKey);
|
|
424
|
-
const renegotiate = useCallback5(() => {
|
|
425
|
-
setNonce((n) => n + 1);
|
|
426
|
-
}, []);
|
|
427
|
-
const cardRefusedRef = useRef3(false);
|
|
428
|
-
useEffect3(() => {
|
|
429
|
-
if (typeof window === "undefined") return;
|
|
430
|
-
const onCardVerified = () => {
|
|
431
|
-
if (!cardRefusedRef.current) return;
|
|
432
|
-
cardRefusedRef.current = false;
|
|
433
|
-
setViewerCapReached(false);
|
|
434
|
-
setViewerCapReason(null);
|
|
435
|
-
setNonce((n) => n + 1);
|
|
436
|
-
};
|
|
437
|
-
window.addEventListener("opengeni:card-verified", onCardVerified);
|
|
438
|
-
return () => window.removeEventListener("opengeni:card-verified", onCardVerified);
|
|
439
|
-
}, []);
|
|
440
|
-
const resumeOnInteractionRef = useRef3(false);
|
|
441
|
-
const lastInteractionRef = useViewerInteractionClock(() => {
|
|
442
|
-
if (!resumeOnInteractionRef.current) return;
|
|
443
|
-
resumeOnInteractionRef.current = false;
|
|
444
|
-
setNonce((n) => n + 1);
|
|
445
|
-
});
|
|
446
|
-
useEffect3(() => {
|
|
447
|
-
const identityChanged = previousIdentityRef.current !== identityKey;
|
|
448
|
-
previousIdentityRef.current = identityKey;
|
|
449
|
-
if (identityChanged) {
|
|
450
|
-
setStateIdentity(identityKey);
|
|
451
|
-
setCapabilities(null);
|
|
452
|
-
setState("idle");
|
|
453
|
-
setError(null);
|
|
454
|
-
setAcknowledgmentRequired(null);
|
|
455
|
-
setViewerCapReached(false);
|
|
456
|
-
setViewerCapReason(null);
|
|
457
|
-
setViewerId(null);
|
|
458
|
-
epochRef.current = 0;
|
|
459
|
-
viewerIdRef.current = null;
|
|
460
|
-
resumeOnInteractionRef.current = false;
|
|
461
|
-
}
|
|
462
|
-
if (!lifecycleEnabled || !sessionId) {
|
|
463
|
-
setState("idle");
|
|
464
|
-
setCapabilities(null);
|
|
465
|
-
viewerIdRef.current = null;
|
|
466
|
-
setViewerId(null);
|
|
467
|
-
return;
|
|
468
|
-
}
|
|
469
|
-
viewerIdRef.current = null;
|
|
470
|
-
setViewerId(null);
|
|
471
|
-
const awaitingInteraction = resumeOnInteractionRef.current;
|
|
472
|
-
let cancelled = false;
|
|
473
|
-
let idleDrainMs = null;
|
|
474
|
-
let pollTimer = null;
|
|
475
|
-
let heartbeatTimer = null;
|
|
476
|
-
let localViewerId = null;
|
|
477
|
-
const requestAbort = new AbortController();
|
|
478
|
-
const startedAt = Date.now();
|
|
479
|
-
const clearTimers = () => {
|
|
480
|
-
if (pollTimer !== null) clearTimeout(pollTimer);
|
|
481
|
-
if (heartbeatTimer !== null) clearTimeout(heartbeatTimer);
|
|
482
|
-
pollTimer = null;
|
|
483
|
-
heartbeatTimer = null;
|
|
484
|
-
};
|
|
485
|
-
const settle = (caps) => {
|
|
486
|
-
if (cancelled) return;
|
|
487
|
-
epochRef.current = caps.leaseEpoch;
|
|
488
|
-
setCapabilities(caps);
|
|
489
|
-
setError(null);
|
|
490
|
-
};
|
|
491
|
-
const reacquire = () => {
|
|
492
|
-
if (cancelled) return;
|
|
493
|
-
if (idleDrainMs !== null && Date.now() - lastInteractionRef.current >= idleDrainMs) {
|
|
494
|
-
localViewerId = null;
|
|
495
|
-
viewerIdRef.current = null;
|
|
496
|
-
setViewerId(null);
|
|
497
|
-
setState("on-demand");
|
|
498
|
-
resumeOnInteractionRef.current = true;
|
|
499
|
-
return;
|
|
500
|
-
}
|
|
501
|
-
renegotiate();
|
|
502
|
-
};
|
|
503
|
-
const startHeartbeat = (caps) => {
|
|
504
|
-
if (!localViewerId || heartbeatTimer !== null) return;
|
|
505
|
-
const intervalMs = caps.viewerHeartbeatIntervalMs > 0 ? caps.viewerHeartbeatIntervalMs : 3e4;
|
|
506
|
-
const schedule = () => {
|
|
507
|
-
if (cancelled || !localViewerId) return;
|
|
508
|
-
heartbeatTimer = setTimeout(() => {
|
|
509
|
-
heartbeatTimer = null;
|
|
510
|
-
if (cancelled || !localViewerId) return;
|
|
511
|
-
void client.heartbeatViewer(workspaceId, sessionId, localViewerId, {
|
|
512
|
-
leaseEpoch: epochRef.current,
|
|
513
|
-
lastInteractionAgeMs: Math.max(0, Date.now() - lastInteractionRef.current)
|
|
514
|
-
}).then((res) => {
|
|
515
|
-
if (!res.alive && !cancelled) {
|
|
516
|
-
reacquire();
|
|
517
|
-
}
|
|
518
|
-
}).catch((cause) => {
|
|
519
|
-
if (cancelled) return;
|
|
520
|
-
if (cause instanceof OpenGeniApiError && (cause.status === 409 || cause.status === 410)) {
|
|
521
|
-
reacquire();
|
|
522
|
-
}
|
|
523
|
-
}).finally(schedule);
|
|
524
|
-
}, intervalMs);
|
|
525
|
-
};
|
|
526
|
-
schedule();
|
|
527
|
-
};
|
|
528
|
-
const pollUntilWarm = () => {
|
|
529
|
-
pollTimer = setTimeout(() => {
|
|
530
|
-
if (cancelled) return;
|
|
531
|
-
void client.getStreamCapabilities(workspaceId, sessionId, { signal: requestAbort.signal }).then((caps) => {
|
|
532
|
-
if (cancelled) return;
|
|
533
|
-
settle(caps);
|
|
534
|
-
if (sandboxAcceptsLiveIo(caps.liveness)) {
|
|
535
|
-
setState("ready");
|
|
536
|
-
return;
|
|
537
|
-
}
|
|
538
|
-
if (warmingDeadlineMs > 0 && Date.now() - startedAt > warmingDeadlineMs) {
|
|
539
|
-
setState("error");
|
|
540
|
-
setError(new Error("sandbox did not warm in time \u2014 retry to re-negotiate"));
|
|
541
|
-
return;
|
|
542
|
-
}
|
|
543
|
-
pollUntilWarm();
|
|
544
|
-
}).catch((cause) => {
|
|
545
|
-
if (!cancelled) {
|
|
546
|
-
if (isSandboxOwnershipDisabledError(cause)) {
|
|
547
|
-
setState("on-demand");
|
|
548
|
-
setError(null);
|
|
549
|
-
return;
|
|
550
|
-
}
|
|
551
|
-
setState("error");
|
|
552
|
-
setError(normalizeError(cause));
|
|
553
|
-
}
|
|
554
|
-
});
|
|
555
|
-
}, warmingPollMs);
|
|
556
|
-
};
|
|
557
|
-
void (async () => {
|
|
558
|
-
setState("negotiating");
|
|
559
|
-
setAcknowledgmentRequired(null);
|
|
560
|
-
setViewerCapReached(false);
|
|
561
|
-
setViewerCapReason(null);
|
|
562
|
-
try {
|
|
563
|
-
const caps = await client.getStreamCapabilities(workspaceId, sessionId, {
|
|
564
|
-
signal: requestAbort.signal
|
|
565
|
-
});
|
|
566
|
-
if (cancelled) return;
|
|
567
|
-
settle(caps);
|
|
568
|
-
const wantDesktopAttach = attachDesktop && desktopAttachable(caps.DesktopStream);
|
|
569
|
-
const wantTerminalAttach = attachTerminal && terminalCanAcquirePty(caps.Terminal);
|
|
570
|
-
const wantFilesAttach = attachFiles && caps.FileSystem.available;
|
|
571
|
-
let attachRefused = false;
|
|
572
|
-
if (!awaitingInteraction && (wantDesktopAttach || wantTerminalAttach || wantFilesAttach)) {
|
|
573
|
-
try {
|
|
574
|
-
const holder = await client.attachViewer(workspaceId, sessionId, {
|
|
575
|
-
desktop: wantDesktopAttach,
|
|
576
|
-
terminal: wantTerminalAttach,
|
|
577
|
-
files: wantFilesAttach,
|
|
578
|
-
lastInteractionAgeMs: Math.max(0, Date.now() - lastInteractionRef.current)
|
|
579
|
-
});
|
|
580
|
-
if (cancelled) {
|
|
581
|
-
void client.detachViewer(workspaceId, sessionId, holder.viewerId).catch(() => {
|
|
582
|
-
});
|
|
583
|
-
return;
|
|
584
|
-
}
|
|
585
|
-
if (wantDesktopAttach && (!holder.dataPlaneUrl || !holder.transport || !holder.client) || wantTerminalAttach && (!holder.terminalUrl || !holder.terminalTransport)) {
|
|
586
|
-
await client.detachViewer(workspaceId, sessionId, holder.viewerId).catch(() => {
|
|
587
|
-
});
|
|
588
|
-
throw new Error("live plane unavailable");
|
|
589
|
-
}
|
|
590
|
-
localViewerId = holder.viewerId;
|
|
591
|
-
viewerIdRef.current = holder.viewerId;
|
|
592
|
-
idleDrainMs = typeof holder.viewerIdleDrainMs === "number" && holder.viewerIdleDrainMs > 0 ? holder.viewerIdleDrainMs : null;
|
|
593
|
-
setViewerId(holder.viewerId);
|
|
594
|
-
epochRef.current = holder.leaseEpoch;
|
|
595
|
-
setCapabilities(
|
|
596
|
-
(prev) => prev ? {
|
|
597
|
-
...prev,
|
|
598
|
-
liveness: holder.liveness,
|
|
599
|
-
leaseEpoch: holder.leaseEpoch,
|
|
600
|
-
viewerHeartbeatIntervalMs: holder.viewerHeartbeatIntervalMs,
|
|
601
|
-
DesktopStream: wantDesktopAttach ? {
|
|
602
|
-
...prev.DesktopStream,
|
|
603
|
-
transport: holder.transport ?? prev.DesktopStream.transport,
|
|
604
|
-
client: holder.client ?? prev.DesktopStream.client,
|
|
605
|
-
url: holder.dataPlaneUrl,
|
|
606
|
-
token: holder.streamToken,
|
|
607
|
-
expiresAt: holder.streamExpiresAt,
|
|
608
|
-
resolution: holder.resolution ?? prev.DesktopStream.resolution
|
|
609
|
-
} : prev.DesktopStream,
|
|
610
|
-
Terminal: wantTerminalAttach ? {
|
|
611
|
-
...prev.Terminal,
|
|
612
|
-
transport: holder.terminalTransport ?? prev.Terminal.transport,
|
|
613
|
-
url: holder.terminalUrl,
|
|
614
|
-
token: holder.terminalToken,
|
|
615
|
-
expiresAt: holder.terminalExpiresAt,
|
|
616
|
-
// A live pty-ws means the box is pty-capable for real.
|
|
617
|
-
ptyCapable: holder.terminalTransport ? true : prev.Terminal.ptyCapable,
|
|
618
|
-
reason: holder.terminalTransport ? null : prev.Terminal.reason
|
|
619
|
-
} : prev.Terminal
|
|
620
|
-
} : prev
|
|
621
|
-
);
|
|
622
|
-
} catch (cause) {
|
|
623
|
-
if (cancelled) return;
|
|
624
|
-
if (cause instanceof OpenGeniApiError) {
|
|
625
|
-
if (cause.status === 409) {
|
|
626
|
-
if (wantDesktopAttach) {
|
|
627
|
-
setAcknowledgmentRequired(
|
|
628
|
-
cause.message.includes("shared_acknowledgment") ? "shared" : "unredacted"
|
|
629
|
-
);
|
|
630
|
-
}
|
|
631
|
-
} else if (cause.status === 429) {
|
|
632
|
-
const refusal = typeof cause.details?.viewerRefusal === "string" ? cause.details.viewerRefusal : cause.message.includes("went unused") ? "viewer_idle" : cause.message.includes("computers") ? "computer_limit" : null;
|
|
633
|
-
const cardRequired = cause.details?.code === "sandbox_card_required";
|
|
634
|
-
if (cardRequired && typeof window !== "undefined") {
|
|
635
|
-
window.dispatchEvent(
|
|
636
|
-
new CustomEvent("opengeni:card-required", {
|
|
637
|
-
detail: { workspaceId, accountId: null }
|
|
638
|
-
})
|
|
639
|
-
);
|
|
640
|
-
}
|
|
641
|
-
if (cardRequired) {
|
|
642
|
-
cardRefusedRef.current = true;
|
|
643
|
-
attachRefused = true;
|
|
644
|
-
setViewerCapReached(true);
|
|
645
|
-
setViewerCapReason("computers");
|
|
646
|
-
} else if (refusal === "viewer_idle") {
|
|
647
|
-
attachRefused = true;
|
|
648
|
-
resumeOnInteractionRef.current = true;
|
|
649
|
-
} else {
|
|
650
|
-
setViewerCapReached(true);
|
|
651
|
-
const computers = refusal === "computer_limit";
|
|
652
|
-
setViewerCapReason(computers ? "computers" : "viewers");
|
|
653
|
-
if (computers) attachRefused = true;
|
|
654
|
-
}
|
|
655
|
-
} else if (cause.status === 403) {
|
|
656
|
-
setState("error");
|
|
657
|
-
setError(cause);
|
|
658
|
-
return;
|
|
659
|
-
} else {
|
|
660
|
-
throw cause;
|
|
661
|
-
}
|
|
662
|
-
} else {
|
|
663
|
-
throw cause;
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
const warmUpRequested = !awaitingInteraction && !attachRefused && (wantDesktopAttach || wantTerminalAttach || wantFilesAttach);
|
|
668
|
-
if (sandboxAcceptsLiveIo(caps.liveness) || localViewerId) {
|
|
669
|
-
setState("ready");
|
|
670
|
-
startHeartbeat(caps);
|
|
671
|
-
} else if (warmUpRequested) {
|
|
672
|
-
setState("cold");
|
|
673
|
-
pollUntilWarm();
|
|
674
|
-
} else {
|
|
675
|
-
setState("on-demand");
|
|
676
|
-
}
|
|
677
|
-
} catch (cause) {
|
|
678
|
-
if (cancelled) return;
|
|
679
|
-
if (isSandboxOwnershipDisabledError(cause)) {
|
|
680
|
-
setState("on-demand");
|
|
681
|
-
setError(null);
|
|
682
|
-
return;
|
|
683
|
-
}
|
|
684
|
-
if (cause instanceof OpenGeniApiError && cause.status === 403) {
|
|
685
|
-
setState("error");
|
|
686
|
-
setError(new Error("not permitted to view this session's sandbox"));
|
|
687
|
-
return;
|
|
688
|
-
}
|
|
689
|
-
setState("error");
|
|
690
|
-
setError(normalizeError(cause));
|
|
691
|
-
}
|
|
692
|
-
})();
|
|
693
|
-
return () => {
|
|
694
|
-
cancelled = true;
|
|
695
|
-
requestAbort.abort();
|
|
696
|
-
clearTimers();
|
|
697
|
-
const releaseId = localViewerId ?? viewerIdRef.current;
|
|
698
|
-
if (releaseId) {
|
|
699
|
-
void client.detachViewer(workspaceId, sessionId, releaseId).catch(() => {
|
|
700
|
-
});
|
|
701
|
-
}
|
|
702
|
-
};
|
|
703
|
-
}, [
|
|
704
|
-
client,
|
|
705
|
-
workspaceId,
|
|
706
|
-
sessionId,
|
|
707
|
-
lifecycleEnabled,
|
|
708
|
-
attachDesktop,
|
|
709
|
-
attachTerminal,
|
|
710
|
-
attachFiles,
|
|
711
|
-
warmingPollMs,
|
|
712
|
-
warmingDeadlineMs,
|
|
713
|
-
nonce,
|
|
714
|
-
identityKey
|
|
715
|
-
]);
|
|
716
|
-
const events = options.events;
|
|
717
|
-
useEffect3(() => {
|
|
718
|
-
if (!events || events.length === 0) return;
|
|
719
|
-
setCapabilities((prev) => {
|
|
720
|
-
if (!prev || !prev.DesktopStream.url) return prev;
|
|
721
|
-
let next = prev.DesktopStream;
|
|
722
|
-
let changed = false;
|
|
723
|
-
for (const rotation of rotationsFrom(events)) {
|
|
724
|
-
if (rotation.viewerId && viewerIdRef.current && rotation.viewerId !== viewerIdRef.current) {
|
|
725
|
-
continue;
|
|
726
|
-
}
|
|
727
|
-
const applied = applyUrlRotation(next, rotation, epochRef.current);
|
|
728
|
-
if (applied) {
|
|
729
|
-
next = { ...next, url: applied.url, token: applied.token, expiresAt: applied.expiresAt };
|
|
730
|
-
epochRef.current = Math.max(epochRef.current, rotation.leaseEpoch);
|
|
731
|
-
changed = true;
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
return changed ? { ...prev, DesktopStream: next, leaseEpoch: epochRef.current } : prev;
|
|
735
|
-
});
|
|
736
|
-
}, [events]);
|
|
737
|
-
const identityMatches = enabled && stateIdentity === identityKey;
|
|
738
|
-
return {
|
|
739
|
-
capabilities: identityMatches ? capabilities : null,
|
|
740
|
-
state: identityMatches ? state : "idle",
|
|
741
|
-
error: identityMatches ? error : null,
|
|
742
|
-
acknowledgmentRequired: identityMatches ? acknowledgmentRequired : null,
|
|
743
|
-
viewerCapReached: identityMatches && viewerCapReached,
|
|
744
|
-
viewerCapReason: identityMatches && viewerCapReached ? viewerCapReason : null,
|
|
745
|
-
viewerId: identityMatches ? viewerId : null,
|
|
746
|
-
renegotiate
|
|
747
|
-
};
|
|
748
|
-
}
|
|
749
|
-
function isSandboxOwnershipDisabledError(error) {
|
|
750
|
-
return error instanceof OpenGeniApiError && error.status === 404 && error.message.includes("sandbox ownership is not enabled");
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
// src/hooks/use-sandbox-terminal.ts
|
|
754
|
-
import { OpenGeniApiError as OpenGeniApiError2 } from "@opengeni/sdk";
|
|
755
|
-
import { useCallback as useCallback6, useEffect as useEffect4, useMemo as useMemo2, useRef as useRef4, useState as useState4 } from "react";
|
|
756
|
-
var SANDBOX_TERMINAL_HISTORY_ROWS = 1e3;
|
|
757
|
-
var SANDBOX_TERMINAL_MAX_ROWS = 4e3;
|
|
758
|
-
function useSandboxTerminal(sessionId, options) {
|
|
759
|
-
const { client, workspaceId } = useOpenGeni(options);
|
|
760
|
-
const includeAgentFirehose = options.includeAgentFirehose ?? true;
|
|
761
|
-
const interactive = options.interactive ?? false;
|
|
762
|
-
const ptyFilter = options.ptyId;
|
|
763
|
-
const liveness = options.liveness;
|
|
764
|
-
const identityKey = `${workspaceId}\0${sessionId ?? ""}\0${interactive}\0${ptyFilter ?? ""}`;
|
|
765
|
-
const [openedPtyId, setOpenedPtyId] = useState4(null);
|
|
766
|
-
const [openError, setOpenError] = useState4(null);
|
|
767
|
-
const [stateIdentity, setStateIdentity] = useState4(identityKey);
|
|
768
|
-
const [reopenNonce, setReopenNonce] = useState4(0);
|
|
769
|
-
const currentIdentityRef = useRef4(identityKey);
|
|
770
|
-
currentIdentityRef.current = identityKey;
|
|
771
|
-
useEffect4(() => {
|
|
772
|
-
setStateIdentity(identityKey);
|
|
773
|
-
setOpenedPtyId(null);
|
|
774
|
-
setOpenError(null);
|
|
775
|
-
}, [identityKey]);
|
|
776
|
-
const openInFlight = useRef4(false);
|
|
777
|
-
const boxWarm = liveness === void 0 || sandboxAcceptsLiveIo(liveness);
|
|
778
|
-
useEffect4(() => {
|
|
779
|
-
if (!interactive || !sessionId || ptyFilter || !boxWarm) {
|
|
780
|
-
setOpenError(null);
|
|
781
|
-
return;
|
|
782
|
-
}
|
|
783
|
-
let cancelled = false;
|
|
784
|
-
setOpenError(null);
|
|
785
|
-
openInFlight.current = true;
|
|
786
|
-
let openedId = null;
|
|
787
|
-
void client.terminalPtyOpen(workspaceId, sessionId, {}).then((res) => {
|
|
788
|
-
if (cancelled) {
|
|
789
|
-
void client.terminalPtyClose(workspaceId, sessionId, { ptyId: res.ptyId }).catch(() => {
|
|
790
|
-
});
|
|
791
|
-
return;
|
|
792
|
-
}
|
|
793
|
-
openedId = res.ptyId;
|
|
794
|
-
setOpenedPtyId(res.ptyId);
|
|
795
|
-
}).catch((cause) => {
|
|
796
|
-
if (!cancelled) setOpenError(cause instanceof Error ? cause : new Error(String(cause)));
|
|
797
|
-
}).finally(() => {
|
|
798
|
-
openInFlight.current = false;
|
|
799
|
-
});
|
|
800
|
-
return () => {
|
|
801
|
-
cancelled = true;
|
|
802
|
-
setOpenedPtyId(null);
|
|
803
|
-
const id = openedId;
|
|
804
|
-
if (id) void client.terminalPtyClose(workspaceId, sessionId, { ptyId: id }).catch(() => {
|
|
805
|
-
});
|
|
806
|
-
};
|
|
807
|
-
}, [interactive, client, workspaceId, sessionId, ptyFilter, boxWarm, reopenNonce]);
|
|
808
|
-
const outputTypes = useMemo2(
|
|
809
|
-
() => includeAgentFirehose && !ptyFilter ? ["terminal.pty.output.delta", "sandbox.command.output.delta"] : ["terminal.pty.output.delta"],
|
|
810
|
-
[includeAgentFirehose, ptyFilter]
|
|
811
|
-
);
|
|
812
|
-
const historyKey = `${workspaceId}\0${sessionId ?? ""}\0${outputTypes.join(",")}`;
|
|
813
|
-
const historyEnabled = (options.history ?? true) && Boolean(sessionId);
|
|
814
|
-
const gapGeneration = useTurnlessOutputGap(workspaceId, sessionId);
|
|
815
|
-
const [history, setHistory] = useState4(null);
|
|
816
|
-
const [historyTick, setHistoryTick] = useState4(0);
|
|
817
|
-
const readRef = useRef4(historyReadState(historyKey));
|
|
818
|
-
const mountedRef = useRef4(false);
|
|
819
|
-
useEffect4(() => {
|
|
820
|
-
mountedRef.current = true;
|
|
821
|
-
return () => {
|
|
822
|
-
mountedRef.current = false;
|
|
823
|
-
const state = readRef.current;
|
|
824
|
-
if (state.timer) clearTimeout(state.timer);
|
|
825
|
-
state.timer = null;
|
|
826
|
-
};
|
|
827
|
-
}, []);
|
|
828
|
-
useEffect4(() => {
|
|
829
|
-
let state = readRef.current;
|
|
830
|
-
if (state.key !== historyKey) {
|
|
831
|
-
if (state.timer) clearTimeout(state.timer);
|
|
832
|
-
state = historyReadState(historyKey);
|
|
833
|
-
readRef.current = state;
|
|
834
|
-
setHistory(null);
|
|
835
|
-
}
|
|
836
|
-
if (!historyEnabled || !sessionId || state.inFlight || state.timer) return;
|
|
837
|
-
if (!state.failed && state.generation === gapGeneration) return;
|
|
838
|
-
const now = Date.now();
|
|
839
|
-
const wait = state.failed ? terminalHistoryRetryDelay(state.failures) - (now - state.startedAt) : state.generation === null ? 0 : SANDBOX_TERMINAL_REREAD_MIN_MS - (now - state.startedAt);
|
|
840
|
-
if (wait > 0) {
|
|
841
|
-
state.timer = setTimeout(() => {
|
|
842
|
-
state.timer = null;
|
|
843
|
-
if (mountedRef.current) setHistoryTick((tick) => tick + 1);
|
|
844
|
-
}, wait);
|
|
845
|
-
return;
|
|
846
|
-
}
|
|
847
|
-
const generation = gapGeneration;
|
|
848
|
-
state.inFlight = true;
|
|
849
|
-
state.startedAt = now;
|
|
850
|
-
const current = () => mountedRef.current && readRef.current === state;
|
|
851
|
-
void readTerminalHistory(client, workspaceId, sessionId, outputTypes).then(
|
|
852
|
-
(page) => {
|
|
853
|
-
state.inFlight = false;
|
|
854
|
-
if (!current()) return;
|
|
855
|
-
state.failed = false;
|
|
856
|
-
state.failures = 0;
|
|
857
|
-
state.generation = generation;
|
|
858
|
-
setHistory({ key: state.key, events: page.events, complete: page.complete });
|
|
859
|
-
setHistoryTick((tick) => tick + 1);
|
|
860
|
-
},
|
|
861
|
-
(cause) => {
|
|
862
|
-
state.inFlight = false;
|
|
863
|
-
if (!current()) return;
|
|
864
|
-
if (cause instanceof OpenGeniApiError2 && cause.status >= 400 && cause.status < 500 && cause.status !== 408 && cause.status !== 429) {
|
|
865
|
-
state.failed = false;
|
|
866
|
-
state.failures = 0;
|
|
867
|
-
state.generation = generation;
|
|
868
|
-
return;
|
|
869
|
-
}
|
|
870
|
-
state.failed = true;
|
|
871
|
-
state.failures += 1;
|
|
872
|
-
setHistoryTick((tick) => tick + 1);
|
|
873
|
-
}
|
|
874
|
-
);
|
|
875
|
-
}, [
|
|
876
|
-
historyEnabled,
|
|
877
|
-
historyKey,
|
|
878
|
-
gapGeneration,
|
|
879
|
-
historyTick,
|
|
880
|
-
outputTypes,
|
|
881
|
-
client,
|
|
882
|
-
workspaceId,
|
|
883
|
-
sessionId
|
|
884
|
-
]);
|
|
885
|
-
const liveRef = useRef4({ key: historyKey, rows: /* @__PURE__ */ new Map(), below: 0 });
|
|
886
|
-
const { chunks, openPty, supportsInput } = useMemo2(() => {
|
|
887
|
-
const open = /* @__PURE__ */ new Map();
|
|
888
|
-
let lastOpened = null;
|
|
889
|
-
let lastSupportsInput = false;
|
|
890
|
-
if (liveRef.current.key !== historyKey) {
|
|
891
|
-
liveRef.current = { key: historyKey, rows: /* @__PURE__ */ new Map(), below: 0 };
|
|
892
|
-
}
|
|
893
|
-
const liveRows = liveRef.current;
|
|
894
|
-
const live = liveRows.rows;
|
|
895
|
-
const types = new Set(outputTypes);
|
|
896
|
-
for (const event of options.events) {
|
|
897
|
-
if (event.workspaceId !== workspaceId || event.sessionId !== sessionId) continue;
|
|
898
|
-
if (event.type === "terminal.pty.started") {
|
|
899
|
-
const payload = event.payload;
|
|
900
|
-
if (payload?.ptyId) {
|
|
901
|
-
open.set(payload.ptyId, { supportsInput: true });
|
|
902
|
-
lastOpened = payload.ptyId;
|
|
903
|
-
}
|
|
904
|
-
continue;
|
|
905
|
-
}
|
|
906
|
-
if (event.type === "terminal.pty.exited") {
|
|
907
|
-
const payload = event.payload;
|
|
908
|
-
if (payload?.ptyId) {
|
|
909
|
-
open.delete(payload.ptyId);
|
|
910
|
-
if (lastOpened === payload.ptyId) lastOpened = null;
|
|
911
|
-
}
|
|
912
|
-
continue;
|
|
913
|
-
}
|
|
914
|
-
if (types.has(event.type) && event.sequence >= liveRows.below && !live.has(event.id)) {
|
|
915
|
-
live.set(event.id, event);
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
trimLiveRows(liveRows);
|
|
919
|
-
const loaded = history?.key === historyKey ? history : null;
|
|
920
|
-
const floor = loaded && !loaded.complete ? loaded.events[0]?.sequence ?? 0 : 0;
|
|
921
|
-
const seen = /* @__PURE__ */ new Set();
|
|
922
|
-
const out = [];
|
|
923
|
-
const add = (event) => {
|
|
924
|
-
if (seen.has(event.id) || event.sequence < floor) return;
|
|
925
|
-
seen.add(event.id);
|
|
926
|
-
const chunk = terminalChunk(event, ptyFilter);
|
|
927
|
-
if (chunk) out.push(chunk);
|
|
928
|
-
};
|
|
929
|
-
loaded?.events.forEach(add);
|
|
930
|
-
live.forEach(add);
|
|
931
|
-
out.sort((a, b) => a.seq - b.seq);
|
|
932
|
-
const activePty = ptyFilter && open.has(ptyFilter) ? ptyFilter : lastOpened;
|
|
933
|
-
lastSupportsInput = activePty ? open.get(activePty)?.supportsInput ?? false : false;
|
|
934
|
-
return {
|
|
935
|
-
chunks: out.length > SANDBOX_TERMINAL_MAX_ROWS ? out.slice(-SANDBOX_TERMINAL_MAX_ROWS) : out,
|
|
936
|
-
openPty: activePty,
|
|
937
|
-
supportsInput: lastSupportsInput
|
|
938
|
-
};
|
|
939
|
-
}, [options.events, history, historyKey, outputTypes, ptyFilter, workspaceId, sessionId]);
|
|
940
|
-
const identityMatches = stateIdentity === identityKey;
|
|
941
|
-
const activePtyId = identityMatches ? openedPtyId ?? openPty : null;
|
|
942
|
-
const canWrite = openedPtyId !== null || supportsInput;
|
|
943
|
-
const write = useMemo2(() => {
|
|
944
|
-
if (!activePtyId || !canWrite || !sessionId) return null;
|
|
945
|
-
const writeIdentity = identityKey;
|
|
946
|
-
return (data) => {
|
|
947
|
-
void client.terminalPtyWrite(workspaceId, sessionId, { ptyId: activePtyId, data }).catch((cause) => {
|
|
948
|
-
if (cause instanceof OpenGeniApiError2 && (cause.status === 409 || cause.status === 404) && activePtyId === openedPtyId && currentIdentityRef.current === writeIdentity) {
|
|
949
|
-
setOpenedPtyId(null);
|
|
950
|
-
setReopenNonce((n) => n + 1);
|
|
951
|
-
}
|
|
952
|
-
});
|
|
953
|
-
};
|
|
954
|
-
}, [client, workspaceId, sessionId, activePtyId, canWrite, openedPtyId, identityKey]);
|
|
955
|
-
const close = useCallback6(() => {
|
|
956
|
-
if (!activePtyId || !sessionId) return;
|
|
957
|
-
void client.terminalPtyClose(workspaceId, sessionId, { ptyId: activePtyId }).catch(() => {
|
|
958
|
-
});
|
|
959
|
-
}, [client, workspaceId, sessionId, activePtyId]);
|
|
960
|
-
const error = identityMatches ? openError : null;
|
|
961
|
-
return useMemo2(
|
|
962
|
-
() => ({ chunks, running: activePtyId !== null, write, activePtyId, close, error }),
|
|
963
|
-
[chunks, activePtyId, write, close, error]
|
|
964
|
-
);
|
|
965
|
-
}
|
|
966
|
-
function trimLiveRows(live) {
|
|
967
|
-
const { rows } = live;
|
|
968
|
-
if (rows.size <= SANDBOX_TERMINAL_MAX_ROWS + SANDBOX_TERMINAL_MAX_ROWS / 4) return;
|
|
969
|
-
const sorted = [...rows.values()].sort((left, right) => left.sequence - right.sequence);
|
|
970
|
-
const drop = sorted.length - SANDBOX_TERMINAL_MAX_ROWS;
|
|
971
|
-
for (const event of sorted.slice(0, drop)) rows.delete(event.id);
|
|
972
|
-
live.below = Math.max(live.below, sorted[drop].sequence);
|
|
973
|
-
}
|
|
974
|
-
function historyReadState(key) {
|
|
975
|
-
return {
|
|
976
|
-
key,
|
|
977
|
-
generation: null,
|
|
978
|
-
inFlight: false,
|
|
979
|
-
failed: false,
|
|
980
|
-
failures: 0,
|
|
981
|
-
startedAt: 0,
|
|
982
|
-
timer: null
|
|
983
|
-
};
|
|
984
|
-
}
|
|
985
|
-
var SANDBOX_TERMINAL_REREAD_MIN_MS = 1e3;
|
|
986
|
-
function terminalHistoryRetryDelay(failures) {
|
|
987
|
-
return Math.min(3e4, 1e3 * 2 ** Math.max(0, failures - 1));
|
|
988
|
-
}
|
|
989
|
-
function terminalChunk(event, ptyFilter) {
|
|
990
|
-
if (event.type === "terminal.pty.output.delta") {
|
|
991
|
-
const payload = event.payload;
|
|
992
|
-
if (!payload || typeof payload.chunk !== "string") return null;
|
|
993
|
-
if (ptyFilter && payload.ptyId !== ptyFilter) return null;
|
|
994
|
-
return {
|
|
995
|
-
id: event.id,
|
|
996
|
-
text: payload.chunk,
|
|
997
|
-
stream: payload.stream === "stderr" ? "stderr" : "stdout",
|
|
998
|
-
seq: event.sequence
|
|
999
|
-
};
|
|
1000
|
-
}
|
|
1001
|
-
if (event.type === "sandbox.command.output.delta" && !ptyFilter) {
|
|
1002
|
-
const payload = event.payload;
|
|
1003
|
-
if (!payload?.chunk) return null;
|
|
1004
|
-
return {
|
|
1005
|
-
id: event.id,
|
|
1006
|
-
text: payload.chunk,
|
|
1007
|
-
stream: payload.stream === "stderr" ? "stderr" : "stdout",
|
|
1008
|
-
seq: event.sequence
|
|
1009
|
-
};
|
|
1010
|
-
}
|
|
1011
|
-
return null;
|
|
1012
|
-
}
|
|
1013
|
-
async function readTerminalHistory(client, workspaceId, sessionId, includeTypes) {
|
|
1014
|
-
const options = {
|
|
1015
|
-
includeTypes,
|
|
1016
|
-
direction: "before",
|
|
1017
|
-
// Explicit: a cursorless read otherwise defaults to the monitoring tail,
|
|
1018
|
-
// which drops raw output deltas.
|
|
1019
|
-
mode: "forensic",
|
|
1020
|
-
payloadMode: "full",
|
|
1021
|
-
limit: SANDBOX_TERMINAL_HISTORY_ROWS
|
|
1022
|
-
};
|
|
1023
|
-
const pageClient = client;
|
|
1024
|
-
const page = typeof pageClient.listEventPage === "function" ? await pageClient.listEventPage(workspaceId, sessionId, options) : null;
|
|
1025
|
-
const events = page ? page.events : await client.listEvents(workspaceId, sessionId, options);
|
|
1026
|
-
const sorted = [...events].sort((left, right) => left.sequence - right.sequence);
|
|
1027
|
-
return {
|
|
1028
|
-
events: sorted,
|
|
1029
|
-
// Without a continuation fact, only an empty read is known complete: the
|
|
1030
|
-
// server's byte bound can cut a page short of the row limit.
|
|
1031
|
-
complete: page ? !page.hasMore : sorted.length === 0
|
|
1032
|
-
};
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
// src/hooks/use-sandbox-git.ts
|
|
1036
|
-
import { useCallback as useCallback7, useEffect as useEffect5, useMemo as useMemo3, useRef as useRef5, useState as useState5 } from "react";
|
|
1037
|
-
function normalizeRoot(root) {
|
|
1038
|
-
const normalized = root.replaceAll("\\", "/").replace(/^\.\/+/, "").replace(/\/+$/, "");
|
|
1039
|
-
return normalized === "." ? "" : normalized;
|
|
1040
|
-
}
|
|
1041
|
-
function qualifyPath(repoRoot, path) {
|
|
1042
|
-
const root = normalizeRoot(repoRoot);
|
|
1043
|
-
return root ? `${root}/${path}` : path;
|
|
1044
|
-
}
|
|
1045
|
-
function qualifyDiff(repoRoot, file) {
|
|
1046
|
-
const root = normalizeRoot(repoRoot);
|
|
1047
|
-
return {
|
|
1048
|
-
...file,
|
|
1049
|
-
path: qualifyPath(root, file.path),
|
|
1050
|
-
oldPath: file.oldPath === null ? null : qualifyPath(root, file.oldPath),
|
|
1051
|
-
repoRoot: root
|
|
1052
|
-
};
|
|
1053
|
-
}
|
|
1054
|
-
function uniqueRoots(roots) {
|
|
1055
|
-
return [...new Set(roots.map(normalizeRoot))].sort((a, b) => a.localeCompare(b));
|
|
1056
|
-
}
|
|
1057
|
-
var GIT_READ_BATCH_REQUEST_LIMIT = 32;
|
|
1058
|
-
function repoForPath(manifest, repoPath) {
|
|
1059
|
-
const want = normalizeRoot(repoPath);
|
|
1060
|
-
const exact = manifest.repos.find((r) => normalizeRoot(r.root) === want);
|
|
1061
|
-
if (exact) return exact;
|
|
1062
|
-
if (want === "" && manifest.repos.length === 1) return manifest.repos[0] ?? null;
|
|
1063
|
-
return null;
|
|
1064
|
-
}
|
|
1065
|
-
function sameFileDiff(a, b) {
|
|
1066
|
-
if (a.path !== b.path || a.oldPath !== b.oldPath || a.repoRoot !== b.repoRoot || a.status !== b.status || a.isBinary !== b.isBinary || a.isImage !== b.isImage || a.additions !== b.additions || a.deletions !== b.deletions || a.truncated !== b.truncated || a.hunks.length !== b.hunks.length)
|
|
1067
|
-
return false;
|
|
1068
|
-
return a.hunks.every((hunk, hunkIndex) => {
|
|
1069
|
-
const other = b.hunks[hunkIndex];
|
|
1070
|
-
if (!other || hunk.oldStart !== other.oldStart || hunk.oldLines !== other.oldLines || hunk.newStart !== other.newStart || hunk.newLines !== other.newLines || hunk.header !== other.header || hunk.lines.length !== other.lines.length)
|
|
1071
|
-
return false;
|
|
1072
|
-
return hunk.lines.every((line, lineIndex) => {
|
|
1073
|
-
const otherLine = other.lines[lineIndex];
|
|
1074
|
-
return otherLine !== void 0 && line.type === otherLine.type && line.oldNo === otherLine.oldNo && line.newNo === otherLine.newNo && line.text === otherLine.text;
|
|
1075
|
-
});
|
|
1076
|
-
});
|
|
1077
|
-
}
|
|
1078
|
-
function mergeDiffs(current, next) {
|
|
1079
|
-
if (current.length === 0) return next;
|
|
1080
|
-
const byPath = new Map(current.map((d) => [d.path, d]));
|
|
1081
|
-
let changed = current.length !== next.length;
|
|
1082
|
-
const merged = next.map((file, index) => {
|
|
1083
|
-
const existing = byPath.get(file.path);
|
|
1084
|
-
if (existing && sameFileDiff(existing, file)) {
|
|
1085
|
-
if (current[index] !== existing) changed = true;
|
|
1086
|
-
return existing;
|
|
1087
|
-
}
|
|
1088
|
-
changed = true;
|
|
1089
|
-
return file;
|
|
1090
|
-
});
|
|
1091
|
-
return changed ? merged : current;
|
|
1092
|
-
}
|
|
1093
|
-
function useSandboxGit(sessionId, options = {}) {
|
|
1094
|
-
const { client, workspaceId } = useOpenGeni(options);
|
|
1095
|
-
const enabled = (options.enabled ?? true) && Boolean(sessionId);
|
|
1096
|
-
const active = options.active ?? true;
|
|
1097
|
-
const repoPath = options.repoPath ?? "";
|
|
1098
|
-
const workspaceWide = options.repoPaths !== void 0;
|
|
1099
|
-
const repoPathsKey = uniqueRoots(
|
|
1100
|
-
options.repoPaths && options.repoPaths.length > 0 ? options.repoPaths : [repoPath]
|
|
1101
|
-
).join("\0");
|
|
1102
|
-
const repoPaths = useMemo3(() => repoPathsKey.split("\0"), [repoPathsKey]);
|
|
1103
|
-
const comparison = options.comparison ?? (options.staged ? "staged" : "working");
|
|
1104
|
-
const hasAdvertisedRepoPaths = (options.repoPaths?.length ?? 0) > 0;
|
|
1105
|
-
const capture = comparison === "staged" ? null : options.capture ?? null;
|
|
1106
|
-
const isLive2 = sandboxAcceptsLiveIo(options.liveness);
|
|
1107
|
-
const acceptsEventReads = options.liveness === void 0 || isLive2;
|
|
1108
|
-
const acceptsEventReadsRef = useRef5(acceptsEventReads);
|
|
1109
|
-
acceptsEventReadsRef.current = acceptsEventReads;
|
|
1110
|
-
const hasLiveIoFence = options.liveness !== void 0;
|
|
1111
|
-
const identityKey = `${workspaceId}\0${sessionId ?? ""}\0${repoPathsKey}\0${workspaceWide}\0${comparison}`;
|
|
1112
|
-
const [diff, setDiff] = useState5([]);
|
|
1113
|
-
const [branch, setBranch] = useState5(null);
|
|
1114
|
-
const [isRepo, setIsRepo] = useState5(false);
|
|
1115
|
-
const [ahead, setAhead] = useState5(0);
|
|
1116
|
-
const [behind, setBehind] = useState5(0);
|
|
1117
|
-
const [repoRoots, setRepoRoots] = useState5([]);
|
|
1118
|
-
const [source, setSource] = useState5(null);
|
|
1119
|
-
const sourceRef = useRef5(null);
|
|
1120
|
-
const [loading, setLoading] = useState5(false);
|
|
1121
|
-
const [error, setError] = useState5(null);
|
|
1122
|
-
const [stateIdentity, setStateIdentity] = useState5(identityKey);
|
|
1123
|
-
const refreshGenerationRef = useRef5(0);
|
|
1124
|
-
const refreshAbortRef = useRef5(null);
|
|
1125
|
-
const refreshInFlightRef = useRef5(null);
|
|
1126
|
-
const refreshPendingRef = useRef5(false);
|
|
1127
|
-
const refreshWorkerEpochRef = useRef5(0);
|
|
1128
|
-
const lastChangeRef = useRef5(0);
|
|
1129
|
-
const eventRefreshTimerRef = useRef5(null);
|
|
1130
|
-
const performRefresh = useCallback7(async () => {
|
|
1131
|
-
if (!sessionId) return;
|
|
1132
|
-
const refreshAbort = new AbortController();
|
|
1133
|
-
refreshAbortRef.current = refreshAbort;
|
|
1134
|
-
const generation = refreshGenerationRef.current += 1;
|
|
1135
|
-
setLoading(true);
|
|
1136
|
-
setError(null);
|
|
1137
|
-
try {
|
|
1138
|
-
const diffRequest = (root) => client.gitDiff(
|
|
1139
|
-
workspaceId,
|
|
1140
|
-
sessionId,
|
|
1141
|
-
{
|
|
1142
|
-
path: root,
|
|
1143
|
-
...comparison === "branch" ? { fromRef: "origin/HEAD", mergeBase: true, includeUntracked: true } : comparison === "working" ? { fromRef: "HEAD", includeUntracked: true } : { staged: true, includeUntracked: false }
|
|
1144
|
-
},
|
|
1145
|
-
{ signal: refreshAbort.signal }
|
|
1146
|
-
);
|
|
1147
|
-
const prefetched = hasAdvertisedRepoPaths ? await (async () => {
|
|
1148
|
-
const prefetchedRepos = [];
|
|
1149
|
-
for (let offset = 0; offset < repoPaths.length; offset += GIT_READ_BATCH_REQUEST_LIMIT) {
|
|
1150
|
-
const roots2 = repoPaths.slice(offset, offset + GIT_READ_BATCH_REQUEST_LIMIT);
|
|
1151
|
-
const batch = await client.gitReadBatch(
|
|
1152
|
-
workspaceId,
|
|
1153
|
-
sessionId,
|
|
1154
|
-
{
|
|
1155
|
-
requests: roots2.map((root) => ({
|
|
1156
|
-
status: { path: root },
|
|
1157
|
-
diff: {
|
|
1158
|
-
path: root,
|
|
1159
|
-
...comparison === "branch" ? { fromRef: "origin/HEAD", mergeBase: true, includeUntracked: true } : comparison === "working" ? { fromRef: "HEAD", includeUntracked: true } : { staged: true, includeUntracked: false }
|
|
1160
|
-
}
|
|
1161
|
-
}))
|
|
1162
|
-
},
|
|
1163
|
-
{ signal: refreshAbort.signal }
|
|
1164
|
-
);
|
|
1165
|
-
if (batch.results.length !== roots2.length) {
|
|
1166
|
-
throw new Error(
|
|
1167
|
-
`Workspace Git batch returned ${batch.results.length} results for ${roots2.length} repositories.`
|
|
1168
|
-
);
|
|
1169
|
-
}
|
|
1170
|
-
batch.results.forEach((item, index) => {
|
|
1171
|
-
prefetchedRepos.push({
|
|
1172
|
-
root: roots2[index],
|
|
1173
|
-
status: item.status,
|
|
1174
|
-
result: item.diff ?? {
|
|
1175
|
-
files: [],
|
|
1176
|
-
revision: item.status.revision
|
|
1177
|
-
}
|
|
1178
|
-
});
|
|
1179
|
-
});
|
|
1180
|
-
}
|
|
1181
|
-
return prefetchedRepos;
|
|
1182
|
-
})() : null;
|
|
1183
|
-
const statuses = prefetched ?? await Promise.all(
|
|
1184
|
-
repoPaths.map(async (root) => ({
|
|
1185
|
-
root,
|
|
1186
|
-
status: await client.gitStatus(
|
|
1187
|
-
workspaceId,
|
|
1188
|
-
sessionId,
|
|
1189
|
-
{ path: root },
|
|
1190
|
-
{ signal: refreshAbort.signal }
|
|
1191
|
-
)
|
|
1192
|
-
}))
|
|
1193
|
-
);
|
|
1194
|
-
if (refreshGenerationRef.current !== generation) return;
|
|
1195
|
-
const repositories = statuses.filter(({ status }) => status.isRepo);
|
|
1196
|
-
const roots = repositories.map(({ root }) => root);
|
|
1197
|
-
setRepoRoots((previous) => sameStrings(previous, roots) ? previous : roots);
|
|
1198
|
-
setIsRepo(repositories.length > 0);
|
|
1199
|
-
setBranch(repositories.length === 1 ? repositories[0]?.status.head ?? null : null);
|
|
1200
|
-
setAhead(repositories.reduce((sum, { status }) => sum + status.ahead, 0));
|
|
1201
|
-
setBehind(repositories.reduce((sum, { status }) => sum + status.behind, 0));
|
|
1202
|
-
if (repositories.length === 0) {
|
|
1203
|
-
setDiff([]);
|
|
1204
|
-
sourceRef.current = "live";
|
|
1205
|
-
setSource("live");
|
|
1206
|
-
return;
|
|
1207
|
-
}
|
|
1208
|
-
const prefetchedByRoot = new Map(prefetched?.map(({ root, result }) => [root, result]));
|
|
1209
|
-
const results = await Promise.all(
|
|
1210
|
-
repositories.map(async ({ root }) => ({
|
|
1211
|
-
root,
|
|
1212
|
-
result: prefetchedByRoot.get(root) ?? await diffRequest(root)
|
|
1213
|
-
}))
|
|
1214
|
-
);
|
|
1215
|
-
if (refreshGenerationRef.current !== generation) return;
|
|
1216
|
-
setDiff(
|
|
1217
|
-
(prev) => mergeDiffs(
|
|
1218
|
-
prev,
|
|
1219
|
-
results.flatMap(
|
|
1220
|
-
({ root, result }) => workspaceWide ? result.files.map((file) => qualifyDiff(root, file)) : result.files
|
|
1221
|
-
)
|
|
1222
|
-
)
|
|
1223
|
-
);
|
|
1224
|
-
sourceRef.current = "live";
|
|
1225
|
-
setSource("live");
|
|
1226
|
-
} catch (cause) {
|
|
1227
|
-
if (refreshGenerationRef.current !== generation) return;
|
|
1228
|
-
setError(cause instanceof Error ? cause : new Error(String(cause)));
|
|
1229
|
-
} finally {
|
|
1230
|
-
if (refreshGenerationRef.current === generation) setLoading(false);
|
|
1231
|
-
if (refreshAbortRef.current === refreshAbort) refreshAbortRef.current = null;
|
|
1232
|
-
}
|
|
1233
|
-
}, [
|
|
1234
|
-
client,
|
|
1235
|
-
workspaceId,
|
|
1236
|
-
sessionId,
|
|
1237
|
-
repoPaths,
|
|
1238
|
-
hasAdvertisedRepoPaths,
|
|
1239
|
-
workspaceWide,
|
|
1240
|
-
comparison
|
|
1241
|
-
]);
|
|
1242
|
-
const performRefreshRef = useRef5(performRefresh);
|
|
1243
|
-
performRefreshRef.current = performRefresh;
|
|
1244
|
-
const refresh = useCallback7(async () => {
|
|
1245
|
-
refreshPendingRef.current = true;
|
|
1246
|
-
const existing = refreshInFlightRef.current;
|
|
1247
|
-
if (existing) return await existing;
|
|
1248
|
-
const workerEpoch = refreshWorkerEpochRef.current;
|
|
1249
|
-
const run = (async () => {
|
|
1250
|
-
while (refreshPendingRef.current && refreshWorkerEpochRef.current === workerEpoch) {
|
|
1251
|
-
refreshPendingRef.current = false;
|
|
1252
|
-
await performRefreshRef.current();
|
|
1253
|
-
}
|
|
1254
|
-
})();
|
|
1255
|
-
refreshInFlightRef.current = run;
|
|
1256
|
-
try {
|
|
1257
|
-
await run;
|
|
1258
|
-
} finally {
|
|
1259
|
-
if (refreshInFlightRef.current === run) refreshInFlightRef.current = null;
|
|
1260
|
-
}
|
|
1261
|
-
}, []);
|
|
1262
|
-
const seedFromCapture = useCallback7(
|
|
1263
|
-
(manifest) => {
|
|
1264
|
-
const repositories = workspaceWide ? manifest.repos : [repoForPath(manifest, repoPath)].filter(Boolean);
|
|
1265
|
-
if (comparison === "branch" && repositories.some((repo) => repo.branchDiff === void 0)) {
|
|
1266
|
-
return;
|
|
1267
|
-
}
|
|
1268
|
-
if (repositories.length === 0) {
|
|
1269
|
-
setIsRepo(false);
|
|
1270
|
-
setBranch(null);
|
|
1271
|
-
setAhead(0);
|
|
1272
|
-
setBehind(0);
|
|
1273
|
-
setRepoRoots([]);
|
|
1274
|
-
setDiff((prev) => prev.length === 0 ? prev : []);
|
|
1275
|
-
sourceRef.current = "capture";
|
|
1276
|
-
setSource("capture");
|
|
1277
|
-
return;
|
|
1278
|
-
}
|
|
1279
|
-
setIsRepo(true);
|
|
1280
|
-
setBranch(repositories.length === 1 ? repositories[0]?.head ?? null : null);
|
|
1281
|
-
setAhead(repositories.reduce((sum, repo) => sum + repo.ahead, 0));
|
|
1282
|
-
setBehind(repositories.reduce((sum, repo) => sum + repo.behind, 0));
|
|
1283
|
-
const capturedRoots = repositories.map((repo) => normalizeRoot(repo.root));
|
|
1284
|
-
setRepoRoots((previous) => sameStrings(previous, capturedRoots) ? previous : capturedRoots);
|
|
1285
|
-
setDiff(
|
|
1286
|
-
(prev) => mergeDiffs(
|
|
1287
|
-
prev,
|
|
1288
|
-
repositories.flatMap((repo) => {
|
|
1289
|
-
const capturedDiff = comparison === "branch" ? repo.branchDiff ?? [] : repo.diff;
|
|
1290
|
-
return workspaceWide ? capturedDiff.map((file) => qualifyDiff(repo.root, file)) : capturedDiff;
|
|
1291
|
-
})
|
|
1292
|
-
)
|
|
1293
|
-
);
|
|
1294
|
-
sourceRef.current = "capture";
|
|
1295
|
-
setSource("capture");
|
|
1296
|
-
setError(null);
|
|
1297
|
-
},
|
|
1298
|
-
[comparison, repoPath, workspaceWide]
|
|
1299
|
-
);
|
|
1300
|
-
const captureRef = useRef5(capture);
|
|
1301
|
-
captureRef.current = capture;
|
|
1302
|
-
const captureRevision = capture?.revision ?? null;
|
|
1303
|
-
const previousIdentityRef = useRef5(identityKey);
|
|
1304
|
-
useEffect5(() => {
|
|
1305
|
-
refreshAbortRef.current?.abort();
|
|
1306
|
-
refreshAbortRef.current = null;
|
|
1307
|
-
refreshPendingRef.current = false;
|
|
1308
|
-
refreshGenerationRef.current += 1;
|
|
1309
|
-
const identityChanged = previousIdentityRef.current !== identityKey;
|
|
1310
|
-
previousIdentityRef.current = identityKey;
|
|
1311
|
-
if (identityChanged) {
|
|
1312
|
-
refreshWorkerEpochRef.current += 1;
|
|
1313
|
-
refreshInFlightRef.current = null;
|
|
1314
|
-
}
|
|
1315
|
-
if (identityChanged || !enabled) {
|
|
1316
|
-
lastChangeRef.current = 0;
|
|
1317
|
-
setDiff([]);
|
|
1318
|
-
setStateIdentity(identityKey);
|
|
1319
|
-
setIsRepo(false);
|
|
1320
|
-
setBranch(null);
|
|
1321
|
-
setAhead(0);
|
|
1322
|
-
setBehind(0);
|
|
1323
|
-
setRepoRoots([]);
|
|
1324
|
-
sourceRef.current = null;
|
|
1325
|
-
setSource(null);
|
|
1326
|
-
setLoading(false);
|
|
1327
|
-
setError(null);
|
|
1328
|
-
}
|
|
1329
|
-
if (!enabled) {
|
|
1330
|
-
return;
|
|
1331
|
-
}
|
|
1332
|
-
const currentCapture = captureRevision !== null ? captureRef.current : null;
|
|
1333
|
-
if (currentCapture && (identityChanged || !isLive2 || sourceRef.current !== "live")) {
|
|
1334
|
-
seedFromCapture(currentCapture);
|
|
1335
|
-
}
|
|
1336
|
-
if (!active) {
|
|
1337
|
-
if (!active) setLoading(false);
|
|
1338
|
-
return;
|
|
1339
|
-
}
|
|
1340
|
-
if (isLive2 || !hasLiveIoFence && !currentCapture) {
|
|
1341
|
-
void refresh();
|
|
1342
|
-
}
|
|
1343
|
-
return () => {
|
|
1344
|
-
refreshAbortRef.current?.abort();
|
|
1345
|
-
refreshAbortRef.current = null;
|
|
1346
|
-
refreshPendingRef.current = false;
|
|
1347
|
-
refreshGenerationRef.current += 1;
|
|
1348
|
-
};
|
|
1349
|
-
}, [
|
|
1350
|
-
enabled,
|
|
1351
|
-
active,
|
|
1352
|
-
isLive2,
|
|
1353
|
-
hasLiveIoFence,
|
|
1354
|
-
captureRevision,
|
|
1355
|
-
identityKey,
|
|
1356
|
-
refresh,
|
|
1357
|
-
seedFromCapture
|
|
1358
|
-
]);
|
|
1359
|
-
const events = options.events;
|
|
1360
|
-
useEffect5(() => {
|
|
1361
|
-
if (!enabled || !events) {
|
|
1362
|
-
if (eventRefreshTimerRef.current) {
|
|
1363
|
-
clearTimeout(eventRefreshTimerRef.current);
|
|
1364
|
-
eventRefreshTimerRef.current = null;
|
|
1365
|
-
}
|
|
1366
|
-
return;
|
|
1367
|
-
}
|
|
1368
|
-
if (!active || !acceptsEventReads) {
|
|
1369
|
-
for (const event of events) {
|
|
1370
|
-
if (event.sequence > lastChangeRef.current) lastChangeRef.current = event.sequence;
|
|
1371
|
-
}
|
|
1372
|
-
if (eventRefreshTimerRef.current) {
|
|
1373
|
-
clearTimeout(eventRefreshTimerRef.current);
|
|
1374
|
-
eventRefreshTimerRef.current = null;
|
|
1375
|
-
}
|
|
1376
|
-
return;
|
|
1377
|
-
}
|
|
1378
|
-
let latest = lastChangeRef.current;
|
|
1379
|
-
let changed = false;
|
|
1380
|
-
for (const event of events) {
|
|
1381
|
-
if (event.sequence <= latest) continue;
|
|
1382
|
-
if (event.type === "git.changed") {
|
|
1383
|
-
latest = event.sequence;
|
|
1384
|
-
changed = true;
|
|
1385
|
-
}
|
|
1386
|
-
}
|
|
1387
|
-
if (latest > lastChangeRef.current) {
|
|
1388
|
-
lastChangeRef.current = latest;
|
|
1389
|
-
if (!changed) return;
|
|
1390
|
-
if (eventRefreshTimerRef.current) clearTimeout(eventRefreshTimerRef.current);
|
|
1391
|
-
eventRefreshTimerRef.current = setTimeout(() => {
|
|
1392
|
-
eventRefreshTimerRef.current = null;
|
|
1393
|
-
if (acceptsEventReadsRef.current) void refresh();
|
|
1394
|
-
}, 150);
|
|
1395
|
-
}
|
|
1396
|
-
}, [enabled, active, acceptsEventReads, events, refresh]);
|
|
1397
|
-
useEffect5(
|
|
1398
|
-
() => () => {
|
|
1399
|
-
if (eventRefreshTimerRef.current) clearTimeout(eventRefreshTimerRef.current);
|
|
1400
|
-
},
|
|
1401
|
-
[]
|
|
1402
|
-
);
|
|
1403
|
-
const identityMatches = enabled && stateIdentity === identityKey;
|
|
1404
|
-
const capturedAt = identityMatches && source === "capture" ? capture?.capturedAt ?? null : null;
|
|
1405
|
-
return useMemo3(() => {
|
|
1406
|
-
const visibleRepoRoots = identityMatches ? repoRoots : NO_ROOTS;
|
|
1407
|
-
return {
|
|
1408
|
-
diff: identityMatches ? diff : NO_DIFF,
|
|
1409
|
-
branch: identityMatches ? branch : null,
|
|
1410
|
-
isRepo: identityMatches && isRepo,
|
|
1411
|
-
ahead: identityMatches ? ahead : 0,
|
|
1412
|
-
behind: identityMatches ? behind : 0,
|
|
1413
|
-
repoCount: visibleRepoRoots.length,
|
|
1414
|
-
repoRoots: visibleRepoRoots,
|
|
1415
|
-
refresh,
|
|
1416
|
-
source: identityMatches ? source : null,
|
|
1417
|
-
capturedAt,
|
|
1418
|
-
loading: identityMatches && loading,
|
|
1419
|
-
error: identityMatches ? error : null
|
|
1420
|
-
};
|
|
1421
|
-
}, [
|
|
1422
|
-
identityMatches,
|
|
1423
|
-
repoRoots,
|
|
1424
|
-
diff,
|
|
1425
|
-
branch,
|
|
1426
|
-
isRepo,
|
|
1427
|
-
ahead,
|
|
1428
|
-
behind,
|
|
1429
|
-
refresh,
|
|
1430
|
-
source,
|
|
1431
|
-
capturedAt,
|
|
1432
|
-
loading,
|
|
1433
|
-
error
|
|
1434
|
-
]);
|
|
1435
|
-
}
|
|
1436
|
-
var NO_DIFF = Object.freeze([]);
|
|
1437
|
-
function sameStrings(a, b) {
|
|
1438
|
-
return a.length === b.length && a.every((value, index) => value === b[index]);
|
|
1439
|
-
}
|
|
1440
|
-
var NO_ROOTS = Object.freeze([]);
|
|
1441
|
-
|
|
1442
|
-
// src/hooks/use-workspace-capture.ts
|
|
1443
|
-
import { useCallback as useCallback8, useEffect as useEffect6, useRef as useRef6, useState as useState6 } from "react";
|
|
1444
|
-
import { isRecord } from "@opengeni/contracts/values";
|
|
1445
|
-
var REVISION_CAPTURED = "workspace.revision.captured";
|
|
1446
|
-
var REVISION_DEGRADED = "workspace.revision.degraded";
|
|
1447
|
-
var MANIFEST_FETCH_TIMEOUT_MS = 15e3;
|
|
1448
|
-
var CAPTURE_STATS_NUMBER_FIELDS = [
|
|
1449
|
-
"repoCount",
|
|
1450
|
-
"fileCount",
|
|
1451
|
-
"additions",
|
|
1452
|
-
"deletions",
|
|
1453
|
-
"totalBytes",
|
|
1454
|
-
"tooLargeCount",
|
|
1455
|
-
"binaryCount",
|
|
1456
|
-
"treeEntryCount",
|
|
1457
|
-
"durationMs"
|
|
1458
|
-
];
|
|
1459
|
-
function captureManifestForResponse(value, response) {
|
|
1460
|
-
if (!isRecord(value) || value.version !== 1 || !Number.isSafeInteger(value.revision) || typeof value.capturedAt !== "string" || !(value.turnId === null || typeof value.turnId === "string") || !Number.isSafeInteger(value.leaseEpoch) || !isRecord(value.treeIndex) || typeof value.treeTruncated !== "boolean" || !Array.isArray(value.repos) || !Array.isArray(value.files) || !isRecord(value.stats)) {
|
|
1461
|
-
throw new Error("Workspace capture manifest failed validation.");
|
|
1462
|
-
}
|
|
1463
|
-
if (value.revision !== response.revision || value.capturedAt !== response.capturedAt || value.turnId !== response.turnId || value.leaseEpoch !== response.leaseEpoch) {
|
|
1464
|
-
throw new Error("Workspace capture manifest identity did not match its response.");
|
|
1465
|
-
}
|
|
1466
|
-
for (const field of CAPTURE_STATS_NUMBER_FIELDS) {
|
|
1467
|
-
if (!Number.isSafeInteger(value.stats[field]) || value.stats[field] !== response.stats[field]) {
|
|
1468
|
-
throw new Error("Workspace capture manifest statistics did not match its response.");
|
|
1469
|
-
}
|
|
1470
|
-
}
|
|
1471
|
-
if (typeof value.stats.treeTruncated !== "boolean" || value.stats.treeTruncated !== response.stats.treeTruncated || (value.stats.fingerprint ?? null) !== (response.stats.fingerprint ?? null) || value.repos.length !== response.stats.repoCount || value.files.length !== response.stats.fileCount || value.treeTruncated !== response.stats.treeTruncated) {
|
|
1472
|
-
throw new Error("Workspace capture manifest statistics did not match its response.");
|
|
1473
|
-
}
|
|
1474
|
-
return value;
|
|
1475
|
-
}
|
|
1476
|
-
function useWorkspaceCapture(sessionId, options = {}) {
|
|
1477
|
-
const { client, workspaceId } = useOpenGeni(options);
|
|
1478
|
-
const enabled = (options.enabled ?? true) && Boolean(sessionId);
|
|
1479
|
-
const identityKey = `${workspaceId}\0${sessionId ?? ""}`;
|
|
1480
|
-
const [capture, setCapture] = useState6(null);
|
|
1481
|
-
const [available, setAvailable] = useState6(false);
|
|
1482
|
-
const [degradedReason, setDegradedReason] = useState6(null);
|
|
1483
|
-
const [fileCount, setFileCount] = useState6(null);
|
|
1484
|
-
const [loading, setLoading] = useState6(false);
|
|
1485
|
-
const [error, setError] = useState6(null);
|
|
1486
|
-
const [announcedRevision, setAnnouncedRevision] = useState6(null);
|
|
1487
|
-
const [stateIdentity, setStateIdentity] = useState6(identityKey);
|
|
1488
|
-
const generationRef = useRef6(0);
|
|
1489
|
-
const requestAbortRef = useRef6(null);
|
|
1490
|
-
const lastSeqRef = useRef6(0);
|
|
1491
|
-
const refresh = useCallback8(async () => {
|
|
1492
|
-
if (!sessionId) return;
|
|
1493
|
-
requestAbortRef.current?.abort();
|
|
1494
|
-
const requestAbort = new AbortController();
|
|
1495
|
-
requestAbortRef.current = requestAbort;
|
|
1496
|
-
const generation = generationRef.current += 1;
|
|
1497
|
-
setStateIdentity(identityKey);
|
|
1498
|
-
setLoading(true);
|
|
1499
|
-
setError(null);
|
|
1500
|
-
try {
|
|
1501
|
-
for (let attempt = 0; attempt < 2; attempt += 1) {
|
|
1502
|
-
const res = await client.getWorkspaceCapture(
|
|
1503
|
-
workspaceId,
|
|
1504
|
-
sessionId,
|
|
1505
|
-
{ signal: requestAbort.signal }
|
|
1506
|
-
);
|
|
1507
|
-
if (generationRef.current !== generation) return;
|
|
1508
|
-
if (!res.available) {
|
|
1509
|
-
setCapture(null);
|
|
1510
|
-
setAvailable(false);
|
|
1511
|
-
setFileCount(0);
|
|
1512
|
-
setDegradedReason(res.degradedReason ?? null);
|
|
1513
|
-
return;
|
|
1514
|
-
}
|
|
1515
|
-
setDegradedReason(null);
|
|
1516
|
-
setFileCount(res.stats.fileCount);
|
|
1517
|
-
let manifestValue = res.manifest;
|
|
1518
|
-
if (!manifestValue && res.manifestUrl) {
|
|
1519
|
-
const response = await fetch(res.manifestUrl.url, {
|
|
1520
|
-
signal: AbortSignal.any([
|
|
1521
|
-
requestAbort.signal,
|
|
1522
|
-
AbortSignal.timeout(MANIFEST_FETCH_TIMEOUT_MS)
|
|
1523
|
-
]),
|
|
1524
|
-
credentials: "omit",
|
|
1525
|
-
cache: "no-store",
|
|
1526
|
-
referrerPolicy: "no-referrer"
|
|
1527
|
-
}).catch(() => null);
|
|
1528
|
-
if (generationRef.current !== generation) return;
|
|
1529
|
-
if (!response?.ok) {
|
|
1530
|
-
if (attempt === 0 && (response === null || response.status === 401 || response.status === 403)) {
|
|
1531
|
-
continue;
|
|
1532
|
-
}
|
|
1533
|
-
throw new Error(
|
|
1534
|
-
`Workspace capture manifest download failed${response ? ` (${response.status})` : ""}.`
|
|
1535
|
-
);
|
|
1536
|
-
}
|
|
1537
|
-
try {
|
|
1538
|
-
manifestValue = await response.json();
|
|
1539
|
-
} catch {
|
|
1540
|
-
throw new Error("Workspace capture manifest was not valid JSON.");
|
|
1541
|
-
}
|
|
1542
|
-
if (generationRef.current !== generation) return;
|
|
1543
|
-
}
|
|
1544
|
-
if (!manifestValue) {
|
|
1545
|
-
throw new Error("Workspace capture response did not include a manifest.");
|
|
1546
|
-
}
|
|
1547
|
-
const manifest = captureManifestForResponse(manifestValue, res);
|
|
1548
|
-
setCapture(manifest);
|
|
1549
|
-
setAvailable(true);
|
|
1550
|
-
setAnnouncedRevision(
|
|
1551
|
-
(prev) => prev === null || manifest.revision > prev ? manifest.revision : prev
|
|
1552
|
-
);
|
|
1553
|
-
return;
|
|
1554
|
-
}
|
|
1555
|
-
throw new Error("Workspace capture manifest download failed after refreshing its URL.");
|
|
1556
|
-
} catch (cause) {
|
|
1557
|
-
if (generationRef.current !== generation) return;
|
|
1558
|
-
setError(cause instanceof Error ? cause : new Error(String(cause)));
|
|
1559
|
-
} finally {
|
|
1560
|
-
if (generationRef.current === generation) setLoading(false);
|
|
1561
|
-
if (requestAbortRef.current === requestAbort) requestAbortRef.current = null;
|
|
1562
|
-
}
|
|
1563
|
-
}, [client, workspaceId, sessionId, identityKey]);
|
|
1564
|
-
useEffect6(() => {
|
|
1565
|
-
requestAbortRef.current?.abort();
|
|
1566
|
-
requestAbortRef.current = null;
|
|
1567
|
-
generationRef.current += 1;
|
|
1568
|
-
lastSeqRef.current = 0;
|
|
1569
|
-
setCapture(null);
|
|
1570
|
-
setAvailable(false);
|
|
1571
|
-
setDegradedReason(null);
|
|
1572
|
-
setFileCount(null);
|
|
1573
|
-
setAnnouncedRevision(null);
|
|
1574
|
-
setError(null);
|
|
1575
|
-
if (!enabled) {
|
|
1576
|
-
setLoading(false);
|
|
1577
|
-
return;
|
|
1578
|
-
}
|
|
1579
|
-
void refresh();
|
|
1580
|
-
return () => {
|
|
1581
|
-
requestAbortRef.current?.abort();
|
|
1582
|
-
requestAbortRef.current = null;
|
|
1583
|
-
generationRef.current += 1;
|
|
1584
|
-
};
|
|
1585
|
-
}, [enabled, refresh]);
|
|
1586
|
-
const events = options.events;
|
|
1587
|
-
useEffect6(() => {
|
|
1588
|
-
if (!enabled || !events) return;
|
|
1589
|
-
let newest = null;
|
|
1590
|
-
for (const event of events) {
|
|
1591
|
-
if (event.sequence <= lastSeqRef.current) continue;
|
|
1592
|
-
if (event.type === REVISION_CAPTURED) {
|
|
1593
|
-
const payload = event.payload;
|
|
1594
|
-
if (payload && typeof payload === "object" && typeof payload.revision === "number") {
|
|
1595
|
-
newest = newest === null ? payload.revision : Math.max(newest, payload.revision);
|
|
1596
|
-
}
|
|
1597
|
-
} else if (event.type === REVISION_DEGRADED) {
|
|
1598
|
-
const payload = event.payload;
|
|
1599
|
-
if (payload && typeof payload === "object" && typeof payload.revision === "number") {
|
|
1600
|
-
newest = newest === null ? payload.revision : Math.max(newest, payload.revision);
|
|
1601
|
-
}
|
|
1602
|
-
}
|
|
1603
|
-
}
|
|
1604
|
-
for (const event of events)
|
|
1605
|
-
if (event.sequence > lastSeqRef.current) lastSeqRef.current = event.sequence;
|
|
1606
|
-
if (newest === null) return;
|
|
1607
|
-
setAnnouncedRevision((prev) => prev === null || newest > prev ? newest : prev);
|
|
1608
|
-
}, [enabled, events]);
|
|
1609
|
-
const identityMatches = enabled && stateIdentity === identityKey;
|
|
1610
|
-
const visibleCapture = identityMatches ? capture : null;
|
|
1611
|
-
const visibleAnnouncedRevision = identityMatches ? announcedRevision : null;
|
|
1612
|
-
const loadedRevision = visibleCapture?.revision ?? null;
|
|
1613
|
-
useEffect6(() => {
|
|
1614
|
-
if (!enabled) return;
|
|
1615
|
-
if (visibleAnnouncedRevision === null) return;
|
|
1616
|
-
if (loadedRevision !== null && visibleAnnouncedRevision <= loadedRevision) return;
|
|
1617
|
-
if (requestAbortRef.current) return;
|
|
1618
|
-
void refresh();
|
|
1619
|
-
}, [enabled, visibleAnnouncedRevision, loadedRevision, refresh]);
|
|
1620
|
-
const isStale = loadedRevision !== null && visibleAnnouncedRevision !== null && visibleAnnouncedRevision > loadedRevision;
|
|
1621
|
-
return {
|
|
1622
|
-
capture: visibleCapture,
|
|
1623
|
-
revision: loadedRevision,
|
|
1624
|
-
capturedAt: visibleCapture?.capturedAt ?? null,
|
|
1625
|
-
available: identityMatches && available,
|
|
1626
|
-
degradedReason: identityMatches ? degradedReason : null,
|
|
1627
|
-
fileCount: identityMatches ? fileCount : null,
|
|
1628
|
-
isStale,
|
|
1629
|
-
loading: identityMatches && loading,
|
|
1630
|
-
error: identityMatches ? error : null,
|
|
1631
|
-
refresh
|
|
1632
|
-
};
|
|
1633
|
-
}
|
|
1634
|
-
|
|
1635
|
-
// src/hooks/use-workspace-edit.ts
|
|
1636
|
-
import { useCallback as useCallback9, useEffect as useEffect7, useMemo as useMemo4, useRef as useRef7, useState as useState7 } from "react";
|
|
1637
|
-
function isLive(liveness) {
|
|
1638
|
-
return sandboxAcceptsLiveIo(liveness);
|
|
1639
|
-
}
|
|
1640
|
-
function useWorkspaceEdit(sessionId, options = {}) {
|
|
1641
|
-
const { client, workspaceId } = useOpenGeni(options);
|
|
1642
|
-
const path = options.path ?? null;
|
|
1643
|
-
const baseContent = options.baseContent ?? null;
|
|
1644
|
-
const routeEpoch = options.route?.epoch;
|
|
1645
|
-
const routeRoot = options.route?.root;
|
|
1646
|
-
const route = useMemo4(
|
|
1647
|
-
() => routeEpoch !== void 0 && routeRoot !== void 0 ? { epoch: routeEpoch, root: routeRoot } : void 0,
|
|
1648
|
-
[routeEpoch, routeRoot]
|
|
1649
|
-
);
|
|
1650
|
-
const live = isLive(options.liveness);
|
|
1651
|
-
const offline = options.offline === true;
|
|
1652
|
-
const identityKey = `${workspaceId}\0${sessionId ?? ""}\0${path ?? ""}\0${routeEpoch ?? ""}\0${routeRoot ?? ""}`;
|
|
1653
|
-
const [buffer, setBuffer] = useState7(null);
|
|
1654
|
-
const [wantsWarm, setWantsWarm] = useState7(false);
|
|
1655
|
-
const [flush, setFlush] = useState7("idle");
|
|
1656
|
-
const [conflict, setConflict] = useState7(null);
|
|
1657
|
-
const [error, setError] = useState7(null);
|
|
1658
|
-
const [stateIdentity, setStateIdentity] = useState7(identityKey);
|
|
1659
|
-
const onWarmRequested = options.onWarmRequested;
|
|
1660
|
-
const bufferRef = useRef7(null);
|
|
1661
|
-
bufferRef.current = buffer;
|
|
1662
|
-
const flushingRef = useRef7(false);
|
|
1663
|
-
const identityGenerationRef = useRef7(0);
|
|
1664
|
-
const flushAttemptRef = useRef7(0);
|
|
1665
|
-
const readAbortRef = useRef7(null);
|
|
1666
|
-
useEffect7(() => {
|
|
1667
|
-
identityGenerationRef.current += 1;
|
|
1668
|
-
flushAttemptRef.current += 1;
|
|
1669
|
-
readAbortRef.current?.abort();
|
|
1670
|
-
readAbortRef.current = null;
|
|
1671
|
-
setStateIdentity(identityKey);
|
|
1672
|
-
setBuffer(null);
|
|
1673
|
-
setWantsWarm(false);
|
|
1674
|
-
setFlush("idle");
|
|
1675
|
-
setConflict(null);
|
|
1676
|
-
setError(null);
|
|
1677
|
-
flushingRef.current = false;
|
|
1678
|
-
return () => {
|
|
1679
|
-
identityGenerationRef.current += 1;
|
|
1680
|
-
flushAttemptRef.current += 1;
|
|
1681
|
-
readAbortRef.current?.abort();
|
|
1682
|
-
readAbortRef.current = null;
|
|
1683
|
-
};
|
|
1684
|
-
}, [identityKey]);
|
|
1685
|
-
const edit = useCallback9(
|
|
1686
|
-
(content) => {
|
|
1687
|
-
if (stateIdentity !== identityKey) return;
|
|
1688
|
-
if (offline) return;
|
|
1689
|
-
setBuffer((prev) => prev === content ? prev : content);
|
|
1690
|
-
setFlush((prev) => prev === "flushing" ? prev : "idle");
|
|
1691
|
-
setConflict(null);
|
|
1692
|
-
if (!live) {
|
|
1693
|
-
setWantsWarm((prev) => {
|
|
1694
|
-
if (!prev) onWarmRequested?.();
|
|
1695
|
-
return true;
|
|
1696
|
-
});
|
|
1697
|
-
}
|
|
1698
|
-
},
|
|
1699
|
-
[offline, live, onWarmRequested, stateIdentity, identityKey]
|
|
1700
|
-
);
|
|
1701
|
-
const doFlush = useCallback9(
|
|
1702
|
-
async (force) => {
|
|
1703
|
-
if (stateIdentity !== identityKey) return;
|
|
1704
|
-
if (!sessionId || !path) return;
|
|
1705
|
-
const content = bufferRef.current;
|
|
1706
|
-
if (content === null) return;
|
|
1707
|
-
if (flushingRef.current) return;
|
|
1708
|
-
const identityGeneration = identityGenerationRef.current;
|
|
1709
|
-
const flushAttempt = flushAttemptRef.current += 1;
|
|
1710
|
-
flushingRef.current = true;
|
|
1711
|
-
setFlush("flushing");
|
|
1712
|
-
setError(null);
|
|
1713
|
-
try {
|
|
1714
|
-
if (!force) {
|
|
1715
|
-
const readAbort = new AbortController();
|
|
1716
|
-
readAbortRef.current?.abort();
|
|
1717
|
-
readAbortRef.current = readAbort;
|
|
1718
|
-
const liveRead = await client.fsRead(
|
|
1719
|
-
workspaceId,
|
|
1720
|
-
sessionId,
|
|
1721
|
-
{ path, ...route ? { route } : {} },
|
|
1722
|
-
{ signal: readAbort.signal }
|
|
1723
|
-
);
|
|
1724
|
-
if (readAbortRef.current === readAbort) readAbortRef.current = null;
|
|
1725
|
-
if (identityGenerationRef.current !== identityGeneration) return;
|
|
1726
|
-
const liveContent = liveRead.content;
|
|
1727
|
-
if (baseContent !== null && liveContent !== baseContent) {
|
|
1728
|
-
setConflict({ path, base: baseContent, live: liveContent });
|
|
1729
|
-
setFlush("conflict");
|
|
1730
|
-
return;
|
|
1731
|
-
}
|
|
1732
|
-
}
|
|
1733
|
-
await client.fsWrite(workspaceId, sessionId, {
|
|
1734
|
-
path,
|
|
1735
|
-
content,
|
|
1736
|
-
overwrite: true,
|
|
1737
|
-
...route ? { route } : {}
|
|
1738
|
-
});
|
|
1739
|
-
if (identityGenerationRef.current !== identityGeneration) return;
|
|
1740
|
-
setConflict(null);
|
|
1741
|
-
setFlush("flushed");
|
|
1742
|
-
setWantsWarm(false);
|
|
1743
|
-
} catch (cause) {
|
|
1744
|
-
if (identityGenerationRef.current !== identityGeneration) return;
|
|
1745
|
-
setError(cause instanceof Error ? cause : new Error(String(cause)));
|
|
1746
|
-
setFlush("idle");
|
|
1747
|
-
} finally {
|
|
1748
|
-
if (flushAttemptRef.current === flushAttempt) {
|
|
1749
|
-
flushingRef.current = false;
|
|
1750
|
-
readAbortRef.current = null;
|
|
1751
|
-
}
|
|
1752
|
-
}
|
|
1753
|
-
},
|
|
1754
|
-
[client, workspaceId, sessionId, path, baseContent, route, stateIdentity, identityKey]
|
|
1755
|
-
);
|
|
1756
|
-
useEffect7(() => {
|
|
1757
|
-
if (offline) return;
|
|
1758
|
-
if (!live) return;
|
|
1759
|
-
if (buffer === null) return;
|
|
1760
|
-
if (flush === "flushed" || flush === "conflict" || flush === "flushing") return;
|
|
1761
|
-
void doFlush(false);
|
|
1762
|
-
}, [offline, live, buffer, flush, doFlush]);
|
|
1763
|
-
const overwrite = useCallback9(async () => {
|
|
1764
|
-
await doFlush(true);
|
|
1765
|
-
}, [doFlush]);
|
|
1766
|
-
const discard = useCallback9(() => {
|
|
1767
|
-
setBuffer(null);
|
|
1768
|
-
setWantsWarm(false);
|
|
1769
|
-
setFlush("idle");
|
|
1770
|
-
setConflict(null);
|
|
1771
|
-
setError(null);
|
|
1772
|
-
}, []);
|
|
1773
|
-
let state;
|
|
1774
|
-
if (offline) {
|
|
1775
|
-
state = "readonly-offline";
|
|
1776
|
-
} else if (flush === "flushing") {
|
|
1777
|
-
state = "flushing";
|
|
1778
|
-
} else if (flush === "flushed") {
|
|
1779
|
-
state = "flushed";
|
|
1780
|
-
} else if (flush === "conflict") {
|
|
1781
|
-
state = "conflict";
|
|
1782
|
-
} else if (buffer === null) {
|
|
1783
|
-
state = "viewing-cold";
|
|
1784
|
-
} else if (live) {
|
|
1785
|
-
state = "flushing";
|
|
1786
|
-
} else if (options.warming === true) {
|
|
1787
|
-
state = "warming";
|
|
1788
|
-
} else {
|
|
1789
|
-
state = "buffering";
|
|
1790
|
-
}
|
|
1791
|
-
const identityMatches = stateIdentity === identityKey;
|
|
1792
|
-
return {
|
|
1793
|
-
state: identityMatches ? state : offline ? "readonly-offline" : "viewing-cold",
|
|
1794
|
-
readOnly: offline,
|
|
1795
|
-
buffer: identityMatches ? buffer : null,
|
|
1796
|
-
wantsWarm: identityMatches && wantsWarm,
|
|
1797
|
-
edit,
|
|
1798
|
-
conflict: identityMatches ? conflict : null,
|
|
1799
|
-
overwrite,
|
|
1800
|
-
discard,
|
|
1801
|
-
error: identityMatches ? error : null
|
|
1802
|
-
};
|
|
1803
|
-
}
|
|
1804
|
-
|
|
1805
|
-
// src/index.ts
|
|
1806
|
-
import {
|
|
1807
|
-
humanizeModelSlug,
|
|
1808
|
-
isRawModelLabel,
|
|
1809
|
-
modelDisplayName as modelDisplayName2,
|
|
1810
|
-
modelSlug,
|
|
1811
|
-
modelVendor
|
|
1812
|
-
} from "@opengeni/sdk/model-display";
|
|
1813
|
-
import { parseOpenGeniLink } from "@opengeni/sdk";
|
|
1814
|
-
|
|
1815
|
-
// src/components/fleet-tile.tsx
|
|
1816
|
-
import { deriveSessionDisplayTitle } from "@opengeni/sdk";
|
|
1817
|
-
import { modelDisplayName } from "@opengeni/sdk/model-display";
|
|
1818
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1819
|
-
var SESSION_METADATA_TITLE_KEYS = ["title", "name"];
|
|
1820
|
-
function sessionDisplayTitle(session) {
|
|
1821
|
-
return deriveSessionDisplayTitle(session, { metadataKeys: SESSION_METADATA_TITLE_KEYS });
|
|
1822
|
-
}
|
|
1823
|
-
function FleetTile({ session, title, subtitle, onOpen, className }) {
|
|
1824
|
-
const msg = useOpenGeniText();
|
|
1825
|
-
const running = session.status === "running" || session.status === "queued";
|
|
1826
|
-
const needsYou = session.status === "requires_action" && !sessionAdmissionBlocked(session);
|
|
1827
|
-
return /* @__PURE__ */ jsxs2(
|
|
1828
|
-
"button",
|
|
1829
|
-
{
|
|
1830
|
-
type: "button",
|
|
1831
|
-
"data-status": session.status,
|
|
1832
|
-
onClick: onOpen ? () => onOpen(session) : void 0,
|
|
1833
|
-
disabled: !onOpen,
|
|
1834
|
-
className: cn(
|
|
1835
|
-
"og-root group relative flex w-full flex-col gap-2.5 overflow-hidden rounded-og-lg border border-og-border",
|
|
1836
|
-
"bg-og-surface-1 p-4 text-left shadow-og-sm",
|
|
1837
|
-
"transition-[border-color,background-color,box-shadow,transform] duration-200 ease-og-out",
|
|
1838
|
-
onOpen && "hover:-translate-y-px hover:border-og-border-strong hover:bg-og-surface-2 hover:shadow-og-md",
|
|
1839
|
-
"disabled:cursor-default",
|
|
1840
|
-
className
|
|
1841
|
-
),
|
|
1842
|
-
children: [
|
|
1843
|
-
/* @__PURE__ */ jsx2(
|
|
1844
|
-
"span",
|
|
1845
|
-
{
|
|
1846
|
-
"aria-hidden": true,
|
|
1847
|
-
className: cn(
|
|
1848
|
-
"absolute inset-y-0 left-0 w-0.5 transition-opacity duration-300",
|
|
1849
|
-
running ? "bg-og-accent opacity-100" : needsYou ? "bg-og-status-waiting opacity-100" : "opacity-0"
|
|
1850
|
-
)
|
|
1851
|
-
}
|
|
1852
|
-
),
|
|
1853
|
-
/* @__PURE__ */ jsxs2("span", { className: "flex w-full items-start justify-between gap-3", children: [
|
|
1854
|
-
/* @__PURE__ */ jsx2("span", { className: "line-clamp-2 min-w-0 text-og-base font-medium leading-snug text-og-fg", children: title ?? sessionDisplayTitle(session) }),
|
|
1855
|
-
/* @__PURE__ */ jsx2(SessionStatus, { status: sessionDisplayStatus(session), size: "sm", className: "mt-px" })
|
|
1856
|
-
] }),
|
|
1857
|
-
subtitle ? /* @__PURE__ */ jsx2("span", { className: "line-clamp-1 text-og-sm text-og-fg-muted", children: subtitle }) : null,
|
|
1858
|
-
/* @__PURE__ */ jsxs2("span", { className: "mt-auto flex w-full items-center gap-2 text-og-xs text-og-fg-subtle", children: [
|
|
1859
|
-
/* @__PURE__ */ jsx2("span", { className: "font-og-mono", children: session.id.slice(0, 8) }),
|
|
1860
|
-
/* @__PURE__ */ jsx2("span", { "aria-hidden": true, children: "\xB7" }),
|
|
1861
|
-
/* @__PURE__ */ jsx2("span", { className: "truncate", children: modelDisplayName(session.model) }),
|
|
1862
|
-
/* @__PURE__ */ jsx2("span", { className: "ml-auto shrink-0", title: session.updatedAt, children: formatRelativeTime(msg, session.updatedAt) })
|
|
1863
|
-
] })
|
|
1864
|
-
]
|
|
1865
|
-
}
|
|
1866
|
-
);
|
|
1867
|
-
}
|
|
1868
|
-
|
|
1869
|
-
// src/components/diff-view.tsx
|
|
1870
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
1871
|
-
function DiffView({
|
|
1872
|
-
diff,
|
|
1873
|
-
fallback,
|
|
1874
|
-
layout = "unified",
|
|
1875
|
-
themeType,
|
|
1876
|
-
isRepo = true,
|
|
1877
|
-
emptyState,
|
|
1878
|
-
className
|
|
1879
|
-
}) {
|
|
1880
|
-
const t = useOpenGeniText();
|
|
1881
|
-
if (diff.length === 0) {
|
|
1882
|
-
return /* @__PURE__ */ jsx3("div", { className: cn("p-3 text-og-sm text-og-fg-subtle", className), children: emptyState ?? (isRepo ? t("diffView.noChanges") : t("diffView.noRepositoryMounted")) });
|
|
1883
|
-
}
|
|
1884
|
-
return /* @__PURE__ */ jsx3(
|
|
1885
|
-
PierreDiff,
|
|
1886
|
-
{
|
|
1887
|
-
diff,
|
|
1888
|
-
layout,
|
|
1889
|
-
themeType,
|
|
1890
|
-
...fallback !== void 0 ? { fallback } : {},
|
|
1891
|
-
className
|
|
1892
|
-
}
|
|
1893
|
-
);
|
|
1894
|
-
}
|
|
1895
|
-
|
|
1896
|
-
// src/components/sandbox-workspace.tsx
|
|
1897
|
-
import {
|
|
1898
|
-
lazy,
|
|
1899
|
-
memo,
|
|
1900
|
-
Suspense,
|
|
1901
|
-
useCallback as useCallback10,
|
|
1902
|
-
useEffect as useEffect8,
|
|
1903
|
-
useMemo as useMemo5,
|
|
1904
|
-
useRef as useRef8,
|
|
1905
|
-
useState as useState8
|
|
1906
|
-
} from "react";
|
|
1907
|
-
import {
|
|
1908
|
-
CircleCheckIcon,
|
|
1909
|
-
CpuIcon,
|
|
1910
|
-
FileCode2Icon,
|
|
1911
|
-
GitCompareArrowsIcon,
|
|
1912
|
-
Globe2Icon,
|
|
1913
|
-
LoaderCircleIcon,
|
|
1914
|
-
MonitorIcon,
|
|
1915
|
-
RefreshCwIcon,
|
|
1916
|
-
SquareTerminalIcon,
|
|
1917
|
-
TriangleAlertIcon
|
|
1918
|
-
} from "lucide-react";
|
|
1919
|
-
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1920
|
-
var LazySandboxFiles = lazy(
|
|
1921
|
-
() => import("./sandbox-files-JOH2Q57T.js").then(({ SandboxFiles: SandboxFiles2 }) => ({ default: SandboxFiles2 })).catch(() => ({ default: FilesLoadFailed }))
|
|
1922
|
-
);
|
|
1923
|
-
function FilesLoadFailed() {
|
|
1924
|
-
const t = useOpenGeniText();
|
|
1925
|
-
return /* @__PURE__ */ jsxs3(CenteredState, { tone: "danger", icon: /* @__PURE__ */ jsx4(TriangleAlertIcon, { className: "size-5", "aria-hidden": true }), children: [
|
|
1926
|
-
/* @__PURE__ */ jsx4("p", { className: "text-og-sm font-medium text-og-fg", children: t("sandboxWorkspace.filesCouldNotBeLoaded") }),
|
|
1927
|
-
/* @__PURE__ */ jsxs3(DockActionButton, { onClick: () => window.location.reload(), children: [
|
|
1928
|
-
/* @__PURE__ */ jsx4(RefreshCwIcon, { className: "size-3", "aria-hidden": true }),
|
|
1929
|
-
t("sandboxWorkspace.reload")
|
|
1930
|
-
] })
|
|
1931
|
-
] });
|
|
1932
|
-
}
|
|
1933
|
-
function FilesTabBody(props) {
|
|
1934
|
-
return /* @__PURE__ */ jsx4(Suspense, { fallback: /* @__PURE__ */ jsx4(WorkbenchSurfaceLoading, { name: "Files" }), children: /* @__PURE__ */ jsx4(LazySandboxFiles, { ...props }) });
|
|
1935
|
-
}
|
|
1936
|
-
var LazyBrowserViewer = lazy(async () => {
|
|
1937
|
-
const { BrowserViewer } = await import("./browser-viewer-KFMM5S2B.js");
|
|
1938
|
-
return { default: BrowserViewer };
|
|
1939
|
-
});
|
|
1940
|
-
var LazyComputerViewer = lazy(async () => {
|
|
1941
|
-
const { ComputerViewer } = await import("./computer-viewer-AVH5J4TC.js");
|
|
1942
|
-
return { default: ComputerViewer };
|
|
1943
|
-
});
|
|
1944
|
-
var WORKBENCH_TAB_CHANGES = "changes";
|
|
1945
|
-
var WORKBENCH_TAB_FILES = "files";
|
|
1946
|
-
var WORKBENCH_TAB_TERMINAL = "terminal";
|
|
1947
|
-
var WORKBENCH_TAB_BROWSER = "browser";
|
|
1948
|
-
var WORKBENCH_TAB_DESKTOP = "desktop";
|
|
1949
|
-
var WORKBENCH_SURFACES = [
|
|
1950
|
-
WORKBENCH_TAB_CHANGES,
|
|
1951
|
-
WORKBENCH_TAB_FILES,
|
|
1952
|
-
WORKBENCH_TAB_TERMINAL,
|
|
1953
|
-
WORKBENCH_TAB_BROWSER,
|
|
1954
|
-
WORKBENCH_TAB_DESKTOP
|
|
1955
|
-
];
|
|
1956
|
-
function isWorkbenchSurface(value) {
|
|
1957
|
-
return WORKBENCH_SURFACES.includes(value);
|
|
1958
|
-
}
|
|
1959
|
-
function isCanonicalAbsoluteSandboxPath(value) {
|
|
1960
|
-
if (!value) return false;
|
|
1961
|
-
const portable = value.replaceAll("\\", "/");
|
|
1962
|
-
return portable.startsWith("/") || /^[A-Za-z]:\//u.test(portable);
|
|
1963
|
-
}
|
|
1964
|
-
function sourceDrivenDefaultTab(hasChanges, changesEnabled, filesEnabled) {
|
|
1965
|
-
if (hasChanges && changesEnabled) return WORKBENCH_TAB_CHANGES;
|
|
1966
|
-
if (filesEnabled) return WORKBENCH_TAB_FILES;
|
|
1967
|
-
if (changesEnabled) return WORKBENCH_TAB_CHANGES;
|
|
1968
|
-
return null;
|
|
1969
|
-
}
|
|
1970
|
-
function WorkbenchSurfaceLoading({ name }) {
|
|
1971
|
-
const t = useOpenGeniText();
|
|
1972
|
-
return /* @__PURE__ */ jsx4(
|
|
1973
|
-
CenteredState,
|
|
1974
|
-
{
|
|
1975
|
-
icon: /* @__PURE__ */ jsx4(LoaderCircleIcon, { className: "size-5 animate-spin motion-reduce:animate-none", "aria-hidden": true }),
|
|
1976
|
-
children: /* @__PURE__ */ jsx4("p", { className: "text-og-sm font-medium text-og-fg", children: t("sandboxWorkspace.openingName", { name }) })
|
|
1977
|
-
}
|
|
1978
|
-
);
|
|
1979
|
-
}
|
|
1980
|
-
function initialWorkspaceTab(events, override) {
|
|
1981
|
-
if (override) return override;
|
|
1982
|
-
let bestSeq = -1;
|
|
1983
|
-
let bestFileCount = 0;
|
|
1984
|
-
for (const event of events ?? []) {
|
|
1985
|
-
if (event.type !== "workspace.revision.captured") continue;
|
|
1986
|
-
if (event.sequence <= bestSeq) continue;
|
|
1987
|
-
const stats = event.payload?.stats;
|
|
1988
|
-
bestSeq = event.sequence;
|
|
1989
|
-
bestFileCount = typeof stats?.fileCount === "number" ? stats.fileCount : 0;
|
|
1990
|
-
}
|
|
1991
|
-
if (bestFileCount > 0) return WORKBENCH_TAB_CHANGES;
|
|
1992
|
-
let latestGitSeq = -1;
|
|
1993
|
-
let committedOnly = false;
|
|
1994
|
-
for (const event of events ?? []) {
|
|
1995
|
-
if (event.type !== "git.changed" || event.sequence > bestSeq) continue;
|
|
1996
|
-
if (event.sequence <= latestGitSeq) continue;
|
|
1997
|
-
const payload = event.payload;
|
|
1998
|
-
latestGitSeq = event.sequence;
|
|
1999
|
-
committedOnly = typeof payload?.ahead === "number" && payload.ahead > 0 || payload?.reason === "commit";
|
|
2000
|
-
}
|
|
2001
|
-
return committedOnly ? WORKBENCH_TAB_CHANGES : WORKBENCH_TAB_FILES;
|
|
2002
|
-
}
|
|
2003
|
-
function sandboxProvisionInFlight(events) {
|
|
2004
|
-
let inFlight = false;
|
|
2005
|
-
for (const event of events) {
|
|
2006
|
-
if (event.type !== "sandbox.operation.started" && event.type !== "sandbox.operation.completed" && event.type !== "sandbox.operation.failed") {
|
|
2007
|
-
continue;
|
|
2008
|
-
}
|
|
2009
|
-
const payload = event.payload;
|
|
2010
|
-
const name = payload && typeof payload === "object" && !Array.isArray(payload) ? payload.name : null;
|
|
2011
|
-
if (name !== "sandbox.provision") continue;
|
|
2012
|
-
if (event.type === "sandbox.operation.started") {
|
|
2013
|
-
inFlight = true;
|
|
2014
|
-
} else {
|
|
2015
|
-
inFlight = false;
|
|
2016
|
-
}
|
|
2017
|
-
}
|
|
2018
|
-
return inFlight;
|
|
2019
|
-
}
|
|
2020
|
-
function workspaceTurnInFlight(events) {
|
|
2021
|
-
const activeTurnIds = /* @__PURE__ */ new Set();
|
|
2022
|
-
let anonymousTurnInFlight = false;
|
|
2023
|
-
let sessionOwnsWorkspace = false;
|
|
2024
|
-
for (const event of events) {
|
|
2025
|
-
if (event.type === "session.status.changed") {
|
|
2026
|
-
const status = event.payload && typeof event.payload === "object" && !Array.isArray(event.payload) ? event.payload.status : null;
|
|
2027
|
-
sessionOwnsWorkspace = status === "running" || status === "recovering";
|
|
2028
|
-
continue;
|
|
2029
|
-
}
|
|
2030
|
-
if (event.type === "turn.started") {
|
|
2031
|
-
if (event.turnId) activeTurnIds.add(event.turnId);
|
|
2032
|
-
else anonymousTurnInFlight = true;
|
|
2033
|
-
continue;
|
|
2034
|
-
}
|
|
2035
|
-
if (event.type !== "turn.completed" && event.type !== "turn.failed" && event.type !== "turn.cancelled" && event.type !== "turn.superseded") {
|
|
2036
|
-
continue;
|
|
2037
|
-
}
|
|
2038
|
-
if (event.turnId) activeTurnIds.delete(event.turnId);
|
|
2039
|
-
else anonymousTurnInFlight = false;
|
|
2040
|
-
}
|
|
2041
|
-
return sessionOwnsWorkspace || anonymousTurnInFlight || activeTurnIds.size > 0;
|
|
2042
|
-
}
|
|
2043
|
-
function emptyWarmIntents(sessionId) {
|
|
2044
|
-
return {
|
|
2045
|
-
sessionId,
|
|
2046
|
-
warmTerminal: false,
|
|
2047
|
-
warmFiles: false
|
|
2048
|
-
};
|
|
2049
|
-
}
|
|
2050
|
-
function useSandboxWorkspaceTabs(options) {
|
|
2051
|
-
const t = useOpenGeniText();
|
|
2052
|
-
const { client, workspaceId, workspaceInteractionEvent } = useOpenGeni(options);
|
|
2053
|
-
const {
|
|
2054
|
-
sessionId,
|
|
2055
|
-
events,
|
|
2056
|
-
onNotify,
|
|
2057
|
-
browserWebSocketFactory,
|
|
2058
|
-
computerWebSocketFactory,
|
|
2059
|
-
browserExtensionSetupUrl,
|
|
2060
|
-
requestedFilePath,
|
|
2061
|
-
requestedFileRequestId,
|
|
2062
|
-
requestedFileLine,
|
|
2063
|
-
onOpenFile,
|
|
2064
|
-
pullRequest,
|
|
2065
|
-
onOpenPullRequest,
|
|
2066
|
-
initialFilePath,
|
|
2067
|
-
onFilePathChange,
|
|
2068
|
-
isFileNodeVisible,
|
|
2069
|
-
hideToolFolders,
|
|
2070
|
-
initialBrowserSessionId,
|
|
2071
|
-
onBrowserSessionIdChange,
|
|
2072
|
-
initialComputerSessionId,
|
|
2073
|
-
onComputerSessionIdChange,
|
|
2074
|
-
onOpenComputerSession,
|
|
2075
|
-
requestedComputerSessionId,
|
|
2076
|
-
requestedComputerRequestId
|
|
2077
|
-
} = options;
|
|
2078
|
-
const initialTab = options.initialTab ?? null;
|
|
2079
|
-
const relevantOnly = options.tabVisibility === "relevant";
|
|
2080
|
-
const activeTab = options.activeTab ?? initialTab;
|
|
2081
|
-
const workspaceVisible = options.workspaceVisible ?? true;
|
|
2082
|
-
const machinesEnabled = options.machinesEnabled ?? true;
|
|
2083
|
-
const requestedSurfaces = options.surfaces ?? WORKBENCH_SURFACES;
|
|
2084
|
-
const surfaceSet = new Set(requestedSurfaces);
|
|
2085
|
-
const changesEnabled = surfaceSet.has(WORKBENCH_TAB_CHANGES);
|
|
2086
|
-
const filesEnabled = surfaceSet.has(WORKBENCH_TAB_FILES);
|
|
2087
|
-
const terminalEnabled = surfaceSet.has(WORKBENCH_TAB_TERMINAL);
|
|
2088
|
-
const browserEnabled = surfaceSet.has(WORKBENCH_TAB_BROWSER);
|
|
2089
|
-
const desktopEnabled = surfaceSet.has(WORKBENCH_TAB_DESKTOP);
|
|
2090
|
-
const createLinkedComputer = useCallback10(
|
|
2091
|
-
async (name, placement) => {
|
|
2092
|
-
const response = await client.createComputerSession(workspaceId, {
|
|
2093
|
-
operationId: crypto.randomUUID(),
|
|
2094
|
-
sessionId,
|
|
2095
|
-
name,
|
|
2096
|
-
...placement ? { placement } : {}
|
|
2097
|
-
});
|
|
2098
|
-
if (response.operation.state !== "completed" || response.session.lifecycle !== "active") {
|
|
2099
|
-
throw new Error(
|
|
2100
|
-
response.operation.error?.message ?? t("sandboxWorkspace.theDesktopCouldNotBe")
|
|
2101
|
-
);
|
|
2102
|
-
}
|
|
2103
|
-
return {
|
|
2104
|
-
id: response.session.id,
|
|
2105
|
-
placement: response.session.placement
|
|
2106
|
-
};
|
|
2107
|
-
},
|
|
2108
|
-
[client, sessionId, workspaceId, t]
|
|
2109
|
-
);
|
|
2110
|
-
const workspaceDataEnabled = changesEnabled || filesEnabled;
|
|
2111
|
-
const machineSurfaceEnabled = workspaceDataEnabled || terminalEnabled || desktopEnabled;
|
|
2112
|
-
const resolvedActiveTab = activeTab ?? initialTab;
|
|
2113
|
-
const changesActive = resolvedActiveTab === WORKBENCH_TAB_CHANGES;
|
|
2114
|
-
const filesActive = resolvedActiveTab === WORKBENCH_TAB_FILES;
|
|
2115
|
-
const browserActive = resolvedActiveTab === WORKBENCH_TAB_BROWSER;
|
|
2116
|
-
const turnInFlight = workspaceTurnInFlight(events);
|
|
2117
|
-
const surfaceIdentity = WORKBENCH_SURFACES.filter((surface) => surfaceSet.has(surface)).join(",");
|
|
2118
|
-
const [storedWarmIntents, setStoredWarmIntents] = useState8(
|
|
2119
|
-
() => emptyWarmIntents(sessionId)
|
|
2120
|
-
);
|
|
2121
|
-
const warmIntents = storedWarmIntents.sessionId === sessionId ? storedWarmIntents : emptyWarmIntents(sessionId);
|
|
2122
|
-
const { warmTerminal, warmFiles } = warmIntents;
|
|
2123
|
-
const filesWarmRequested = warmFiles || Boolean(requestedFilePath);
|
|
2124
|
-
const requestWarmIntent = useCallback10(
|
|
2125
|
-
(intent) => {
|
|
2126
|
-
setStoredWarmIntents((previous) => {
|
|
2127
|
-
const current = previous.sessionId === sessionId ? previous : emptyWarmIntents(sessionId);
|
|
2128
|
-
return current[intent] ? current : { ...current, [intent]: true };
|
|
2129
|
-
});
|
|
2130
|
-
},
|
|
2131
|
-
[sessionId]
|
|
2132
|
-
);
|
|
2133
|
-
const machines = useMachines({
|
|
2134
|
-
workspaceId,
|
|
2135
|
-
sessionId,
|
|
2136
|
-
pollIntervalMs: MACHINES_SESSION_POLL_MS,
|
|
2137
|
-
enabled: machineSurfaceEnabled && machinesEnabled
|
|
2138
|
-
});
|
|
2139
|
-
const activeMachine = machines.machines.find((m) => m.sandboxId === machines.activeSandboxId) ?? machines.machines.find((m) => m.active) ?? null;
|
|
2140
|
-
const caps = useSessionCapabilities(sessionId, {
|
|
2141
|
-
events,
|
|
2142
|
-
enabled: machineSurfaceEnabled,
|
|
2143
|
-
attachDesktop: false,
|
|
2144
|
-
attachTerminal: terminalEnabled && warmTerminal,
|
|
2145
|
-
// Explicit live-file intent only — NOT "the Files tab is open". A cold edit
|
|
2146
|
-
// or guarded-file open wakes the box; a glance at the tree/diff does not.
|
|
2147
|
-
attachFiles: workspaceDataEnabled && filesWarmRequested
|
|
2148
|
-
});
|
|
2149
|
-
const capabilities = caps.capabilities;
|
|
2150
|
-
const liveness = capabilities?.liveness;
|
|
2151
|
-
const liveIoLiveness = liveness ?? null;
|
|
2152
|
-
const fileSystemOn = capabilities?.FileSystem.available ?? false;
|
|
2153
|
-
const fileSystemRoute = capabilities ? { epoch: capabilities.leaseEpoch, root: capabilities.FileSystem.root } : void 0;
|
|
2154
|
-
const fsReadOnly = capabilities?.FileSystem.readOnly ?? false;
|
|
2155
|
-
const filesEditable = fileSystemOn && !fsReadOnly && sandboxAcceptsLiveIo(liveness);
|
|
2156
|
-
const gitOn = capabilities?.Git.available ?? false;
|
|
2157
|
-
const terminalOn = terminalEnabled && (capabilities?.Terminal.transport ?? null) !== null;
|
|
2158
|
-
const ptyCapable = warmTerminal && (capabilities?.Terminal.ptyCapable ?? false) && capabilities?.Terminal.transport === "sse-events" && capabilities?.Terminal.reason === null;
|
|
2159
|
-
const terminalShown = terminalOn && workspaceVisible && resolvedActiveTab === WORKBENCH_TAB_TERMINAL;
|
|
2160
|
-
const [terminalOpenedSession, setTerminalOpenedSession] = useState8(null);
|
|
2161
|
-
useEffect8(() => {
|
|
2162
|
-
if (terminalShown) setTerminalOpenedSession(sessionId);
|
|
2163
|
-
}, [terminalShown, sessionId]);
|
|
2164
|
-
const terminal = useSandboxTerminal(sessionId, {
|
|
2165
|
-
events: terminalEnabled ? events : [],
|
|
2166
|
-
interactive: terminalEnabled && ptyCapable,
|
|
2167
|
-
liveness,
|
|
2168
|
-
history: terminalShown || terminalOpenedSession === sessionId
|
|
2169
|
-
});
|
|
2170
|
-
const provisioning = sandboxProvisionInFlight(events);
|
|
2171
|
-
const renegotiate = caps.renegotiate;
|
|
2172
|
-
const provisioningRef = useRef8({ sessionId, provisioning });
|
|
2173
|
-
useEffect8(() => {
|
|
2174
|
-
const previous = provisioningRef.current;
|
|
2175
|
-
if (previous.sessionId === sessionId && previous.provisioning && !provisioning) {
|
|
2176
|
-
renegotiate();
|
|
2177
|
-
}
|
|
2178
|
-
provisioningRef.current = { sessionId, provisioning };
|
|
2179
|
-
}, [sessionId, provisioning, renegotiate]);
|
|
2180
|
-
useEffect8(() => {
|
|
2181
|
-
if (workspaceInteractionEvent?.workspaceId !== workspaceId) return;
|
|
2182
|
-
renegotiate();
|
|
2183
|
-
}, [workspaceId, workspaceInteractionEvent, renegotiate]);
|
|
2184
|
-
const captureState = useWorkspaceCapture(sessionId, {
|
|
2185
|
-
events,
|
|
2186
|
-
enabled: workspaceDataEnabled
|
|
2187
|
-
});
|
|
2188
|
-
const captureAvailable = captureState.available;
|
|
2189
|
-
const liveWorkspaceExpected = sandboxAcceptsLiveIo(liveness);
|
|
2190
|
-
const capturePending = !liveWorkspaceExpected && (captureState.fileCount === null || captureState.loading);
|
|
2191
|
-
const repoPaths = useMemo5(() => {
|
|
2192
|
-
const advertised = capabilities?.Git.repos ?? [];
|
|
2193
|
-
if (advertised.length > 0) return advertised;
|
|
2194
|
-
return captureState.capture?.repos.map((repo) => repo.root) ?? [];
|
|
2195
|
-
}, [capabilities?.Git.repos, captureState.capture]);
|
|
2196
|
-
const files = useSandboxFiles(sessionId, {
|
|
2197
|
-
events,
|
|
2198
|
-
// No passive Channel-A reads while cold, even after a conclusive capture
|
|
2199
|
-
// miss. A missing capture gets an explicit "Open live workspace" gate.
|
|
2200
|
-
enabled: filesEnabled && (captureAvailable || fileSystemOn && liveWorkspaceExpected),
|
|
2201
|
-
// A cold sandbox can become warm while the first agent command still owns
|
|
2202
|
-
// startup. Do not race that command with an automatic Files read. Keeping
|
|
2203
|
-
// this fence at turn scope also avoids unsafe millisecond gaps between
|
|
2204
|
-
// sequential tool calls; rendered state and explicit user actions remain.
|
|
2205
|
-
active: filesActive && !turnInFlight,
|
|
2206
|
-
// A deliberate canonical absolute-path open browses in the selected target's
|
|
2207
|
-
// advertised namespace, so the authoritative tree and link share exact paths.
|
|
2208
|
-
...isCanonicalAbsoluteSandboxPath(requestedFilePath) && capabilities?.FileSystem.root ? { rootPath: capabilities.FileSystem.root } : {},
|
|
2209
|
-
...fileSystemRoute ? { route: fileSystemRoute } : {},
|
|
2210
|
-
repoPaths,
|
|
2211
|
-
liveness: liveIoLiveness,
|
|
2212
|
-
capture: captureState.capture,
|
|
2213
|
-
// A reverted optimistic mutation (e.g. a 409 rename collision) surfaces as a
|
|
2214
|
-
// host notification — the tree silently rolls back, the user sees why.
|
|
2215
|
-
onMutationError: (error, op) => onNotify?.({
|
|
2216
|
-
kind: "error",
|
|
2217
|
-
message: t("sandboxWorkspace.couldNotOpMessage", { op, message: error.message })
|
|
2218
|
-
})
|
|
2219
|
-
});
|
|
2220
|
-
const [storedChangesComparison, setStoredChangesComparison] = useState8(null);
|
|
2221
|
-
const captureSupportsBranch = captureState.capture !== null && captureState.capture.repos.length > 0 && captureState.capture.repos.every((repo) => repo.branchDiff !== void 0);
|
|
2222
|
-
const changesComparison = storedChangesComparison?.sessionId === sessionId ? storedChangesComparison.value : liveWorkspaceExpected || captureSupportsBranch ? "branch" : "working";
|
|
2223
|
-
const setChangesComparison = useCallback10(
|
|
2224
|
-
(value) => setStoredChangesComparison({ sessionId, value, picked: true }),
|
|
2225
|
-
[sessionId]
|
|
2226
|
-
);
|
|
2227
|
-
const git = useSandboxGit(sessionId, {
|
|
2228
|
-
events,
|
|
2229
|
-
enabled: changesComparison === "working" ? workspaceDataEnabled && (captureAvailable || gitOn && liveWorkspaceExpected) : changesComparison === "branch" ? workspaceDataEnabled && (captureSupportsBranch || gitOn && liveWorkspaceExpected) : workspaceDataEnabled && gitOn && liveWorkspaceExpected,
|
|
2230
|
-
// Live Git belongs to the visible Changes surface. In particular, do not
|
|
2231
|
-
// turn an unresolved/default tab into a hidden provider read: that races the
|
|
2232
|
-
// agent's own sandbox commands and used to refresh after every tool output
|
|
2233
|
-
// even while Files was visibly selected.
|
|
2234
|
-
active: changesActive && !turnInFlight,
|
|
2235
|
-
repoPaths,
|
|
2236
|
-
liveness: liveIoLiveness,
|
|
2237
|
-
comparison: changesComparison,
|
|
2238
|
-
capture: changesComparison === "staged" ? null : captureState.capture
|
|
2239
|
-
});
|
|
2240
|
-
useEffect8(() => {
|
|
2241
|
-
if (changesComparison === "branch" && git.error && storedChangesComparison?.sessionId !== sessionId) {
|
|
2242
|
-
setStoredChangesComparison({ sessionId, value: "working", picked: false });
|
|
2243
|
-
}
|
|
2244
|
-
}, [changesComparison, git.error, sessionId, storedChangesComparison?.sessionId]);
|
|
2245
|
-
const [xtermTheme, setXtermTheme] = useState8(void 0);
|
|
2246
|
-
useEffect8(() => {
|
|
2247
|
-
if (!terminalEnabled || typeof document === "undefined") return;
|
|
2248
|
-
const derive = () => setXtermTheme(xtermThemeFromTokens());
|
|
2249
|
-
derive();
|
|
2250
|
-
const observer = new MutationObserver(derive);
|
|
2251
|
-
observer.observe(document.documentElement, {
|
|
2252
|
-
attributes: true,
|
|
2253
|
-
attributeFilter: ["data-og-theme", "class"]
|
|
2254
|
-
});
|
|
2255
|
-
return () => observer.disconnect();
|
|
2256
|
-
}, [terminalEnabled]);
|
|
2257
|
-
const dirtyCount = git.diff.length;
|
|
2258
|
-
const eventsShowChanges = useMemo5(
|
|
2259
|
-
() => relevantOnly && initialWorkspaceTab(events) === WORKBENCH_TAB_CHANGES,
|
|
2260
|
-
[events, relevantOnly]
|
|
2261
|
-
);
|
|
2262
|
-
const chip = useMachineChip({
|
|
2263
|
-
liveness,
|
|
2264
|
-
capabilitiesState: caps.state,
|
|
2265
|
-
activeMachineState: activeMachine?.state ?? null,
|
|
2266
|
-
activeIsSelfhosted: activeMachine?.kind === "selfhosted",
|
|
2267
|
-
wantsWarm: terminalEnabled && warmTerminal || workspaceDataEnabled && filesWarmRequested,
|
|
2268
|
-
capturedAt: captureState.capturedAt
|
|
2269
|
-
});
|
|
2270
|
-
const workspaceWaking = chip.state === "waking";
|
|
2271
|
-
const defaultIdentity = `${sessionId}\0${surfaceIdentity}`;
|
|
2272
|
-
const defaultTabRef = useRef8({
|
|
2273
|
-
identity: defaultIdentity,
|
|
2274
|
-
value: null
|
|
2275
|
-
});
|
|
2276
|
-
if (defaultTabRef.current.identity !== defaultIdentity) {
|
|
2277
|
-
defaultTabRef.current = { identity: defaultIdentity, value: null };
|
|
2278
|
-
}
|
|
2279
|
-
const captureHasChanges = (captureState.fileCount ?? 0) > 0 || (captureState.capture?.repos.some((repo) => (repo.branchDiff?.length ?? 0) > 0) ?? false);
|
|
2280
|
-
const captureUnavailable = !captureState.loading && (captureState.fileCount === 0 && !captureHasChanges || captureState.error !== null);
|
|
2281
|
-
if (defaultTabRef.current.value === null) {
|
|
2282
|
-
if (initialTab && (!isWorkbenchSurface(initialTab) || surfaceSet.has(initialTab))) {
|
|
2283
|
-
defaultTabRef.current.value = initialTab;
|
|
2284
|
-
} else if (captureState.fileCount !== null && captureState.available) {
|
|
2285
|
-
defaultTabRef.current.value = sourceDrivenDefaultTab(
|
|
2286
|
-
captureHasChanges,
|
|
2287
|
-
changesEnabled,
|
|
2288
|
-
filesEnabled
|
|
2289
|
-
);
|
|
2290
|
-
} else if (captureUnavailable && initialWorkspaceTab(events) === WORKBENCH_TAB_CHANGES) {
|
|
2291
|
-
defaultTabRef.current.value = sourceDrivenDefaultTab(true, changesEnabled, filesEnabled);
|
|
2292
|
-
} else if (!captureState.loading && (captureState.fileCount !== null || captureState.error !== null)) {
|
|
2293
|
-
defaultTabRef.current.value = sourceDrivenDefaultTab(false, changesEnabled, filesEnabled);
|
|
2294
|
-
}
|
|
2295
|
-
}
|
|
2296
|
-
const defaultTab = defaultTabRef.current.value;
|
|
2297
|
-
const pullRequestUrl = pullRequest?.url;
|
|
2298
|
-
const pullRequestNumber = pullRequest?.number;
|
|
2299
|
-
const stablePullRequest = useMemo5(
|
|
2300
|
-
() => pullRequestUrl ? {
|
|
2301
|
-
url: pullRequestUrl,
|
|
2302
|
-
...pullRequestNumber !== void 0 ? { number: pullRequestNumber } : {}
|
|
2303
|
-
} : null,
|
|
2304
|
-
[pullRequestUrl, pullRequestNumber]
|
|
2305
|
-
);
|
|
2306
|
-
const wakeFiles = useCallback10(() => requestWarmIntent("warmFiles"), [requestWarmIntent]);
|
|
2307
|
-
const openGuardedFile = useCallback10(
|
|
2308
|
-
(path) => {
|
|
2309
|
-
requestWarmIntent("warmFiles");
|
|
2310
|
-
onOpenFile?.(path);
|
|
2311
|
-
},
|
|
2312
|
-
[requestWarmIntent, onOpenFile]
|
|
2313
|
-
);
|
|
2314
|
-
const tabs = useMemo5(() => {
|
|
2315
|
-
const list = [];
|
|
2316
|
-
if (changesEnabled)
|
|
2317
|
-
list.push({
|
|
2318
|
-
id: WORKBENCH_TAB_CHANGES,
|
|
2319
|
-
label: t("sandboxWorkspace.changes"),
|
|
2320
|
-
icon: /* @__PURE__ */ jsx4(GitCompareArrowsIcon, {}),
|
|
2321
|
-
badge: dirtyCount > 0 && !relevantOnly ? /* @__PURE__ */ jsx4(DirtyBadge, { count: dirtyCount }) : void 0,
|
|
2322
|
-
// A comparison the person picked keeps Changes on the strip, even
|
|
2323
|
-
// when that comparison happens to be empty.
|
|
2324
|
-
...relevantOnly && dirtyCount === 0 && !captureHasChanges && !eventsShowChanges && !(storedChangesComparison?.sessionId === sessionId && storedChangesComparison.picked) ? { optional: true, inMenu: true } : {},
|
|
2325
|
-
content: /* @__PURE__ */ jsx4(
|
|
2326
|
-
ChangesTabBody,
|
|
2327
|
-
{
|
|
2328
|
-
git,
|
|
2329
|
-
comparison: changesComparison,
|
|
2330
|
-
onComparisonChange: setChangesComparison,
|
|
2331
|
-
captureAvailable,
|
|
2332
|
-
captureDegraded: captureState.degradedReason !== null,
|
|
2333
|
-
captureRevision: captureState.revision,
|
|
2334
|
-
capturePending,
|
|
2335
|
-
liveWorkspaceExpected,
|
|
2336
|
-
workspaceWaking,
|
|
2337
|
-
capabilitiesState: caps.state,
|
|
2338
|
-
capabilitiesError: caps.error,
|
|
2339
|
-
onRetry: caps.renegotiate,
|
|
2340
|
-
onWake: wakeFiles,
|
|
2341
|
-
...filesEnabled && onOpenFile ? { onOpenFile: openGuardedFile } : {},
|
|
2342
|
-
pullRequest: stablePullRequest,
|
|
2343
|
-
...onOpenPullRequest ? { onOpenPullRequest } : {},
|
|
2344
|
-
navigation: relevantOnly ? "tree" : "rail"
|
|
2345
|
-
}
|
|
2346
|
-
)
|
|
2347
|
-
});
|
|
2348
|
-
if (filesEnabled)
|
|
2349
|
-
list.push({
|
|
2350
|
-
id: WORKBENCH_TAB_FILES,
|
|
2351
|
-
label: t("sandboxWorkspace.files"),
|
|
2352
|
-
icon: /* @__PURE__ */ jsx4(FileCode2Icon, {}),
|
|
2353
|
-
...relevantOnly ? { optional: true } : {},
|
|
2354
|
-
content: /* @__PURE__ */ jsx4(
|
|
2355
|
-
FilesTabBody,
|
|
2356
|
-
{
|
|
2357
|
-
files,
|
|
2358
|
-
git,
|
|
2359
|
-
isNodeVisible: isFileNodeVisible,
|
|
2360
|
-
hideToolFolders,
|
|
2361
|
-
fileSystemAvailable: fileSystemOn || captureAvailable,
|
|
2362
|
-
editable: filesEditable && files.source === "live" && files.error === null && !files.loading,
|
|
2363
|
-
workspaceResting: !liveWorkspaceExpected && liveness !== void 0 && !capturePending && !captureAvailable && !workspaceWaking,
|
|
2364
|
-
workspaceWaking: !liveWorkspaceExpected && !captureAvailable && workspaceWaking,
|
|
2365
|
-
liveWorkspaceReady: liveWorkspaceExpected,
|
|
2366
|
-
workspaceError: caps.error ?? (caps.viewerCapReached ? new Error(
|
|
2367
|
-
caps.viewerCapReason === "computers" ? t("sandboxWorkspace.tooManyComputersRunningWithoutTask") : t("sandboxWorkspace.theLiveWorkspaceViewerLimit")
|
|
2368
|
-
) : filesWarmRequested && caps.state === "on-demand" && !fileSystemOn ? new Error(t("sandboxWorkspace.thisMachineDoesNotCurrently")) : null),
|
|
2369
|
-
onWakeWorkspace: () => {
|
|
2370
|
-
if (filesWarmRequested) caps.renegotiate();
|
|
2371
|
-
else requestWarmIntent("warmFiles");
|
|
2372
|
-
},
|
|
2373
|
-
...requestedFilePath ? {
|
|
2374
|
-
requestedPath: requestedFilePath,
|
|
2375
|
-
...requestedFileRequestId !== null && requestedFileRequestId !== void 0 ? { requestedPathRequestId: requestedFileRequestId } : {},
|
|
2376
|
-
requestedPathReady: sandboxAcceptsLiveIo(liveness),
|
|
2377
|
-
...requestedFileLine != null && requestedFileLine > 0 ? { requestedLine: requestedFileLine } : {}
|
|
2378
|
-
} : {},
|
|
2379
|
-
onEditIntent: () => requestWarmIntent("warmFiles"),
|
|
2380
|
-
initialSelectedPath: initialFilePath,
|
|
2381
|
-
onSelectedPathChange: onFilePathChange,
|
|
2382
|
-
className: "h-full"
|
|
2383
|
-
},
|
|
2384
|
-
sessionId
|
|
2385
|
-
)
|
|
2386
|
-
});
|
|
2387
|
-
if (terminalOn) {
|
|
2388
|
-
list.push({
|
|
2389
|
-
id: WORKBENCH_TAB_TERMINAL,
|
|
2390
|
-
label: t("sandboxWorkspace.terminal"),
|
|
2391
|
-
icon: /* @__PURE__ */ jsx4(SquareTerminalIcon, {}),
|
|
2392
|
-
...relevantOnly ? { optional: true } : {},
|
|
2393
|
-
content: /* @__PURE__ */ jsx4("div", { className: "h-full bg-og-bg p-1", children: /* @__PURE__ */ jsx4(
|
|
2394
|
-
SandboxTerminal,
|
|
2395
|
-
{
|
|
2396
|
-
result: terminal,
|
|
2397
|
-
terminalCapability: capabilities?.Terminal ?? null,
|
|
2398
|
-
onActivate: () => requestWarmIntent("warmTerminal"),
|
|
2399
|
-
onReconnectNeeded: caps.renegotiate,
|
|
2400
|
-
showHeader: true,
|
|
2401
|
-
shell: capabilities?.Terminal.shell ?? void 0,
|
|
2402
|
-
liveness,
|
|
2403
|
-
...xtermTheme ? { theme: xtermTheme } : {}
|
|
2404
|
-
},
|
|
2405
|
-
sessionId
|
|
2406
|
-
) })
|
|
2407
|
-
});
|
|
2408
|
-
}
|
|
2409
|
-
if (browserEnabled) {
|
|
2410
|
-
list.push({
|
|
2411
|
-
id: WORKBENCH_TAB_BROWSER,
|
|
2412
|
-
label: t("sandboxWorkspace.browser"),
|
|
2413
|
-
icon: /* @__PURE__ */ jsx4(Globe2Icon, {}),
|
|
2414
|
-
...relevantOnly ? { optional: true } : {},
|
|
2415
|
-
content: /* @__PURE__ */ jsx4(Suspense, { fallback: /* @__PURE__ */ jsx4(WorkbenchSurfaceLoading, { name: "Browser" }), children: /* @__PURE__ */ jsx4(
|
|
2416
|
-
LazyBrowserViewer,
|
|
2417
|
-
{
|
|
2418
|
-
client,
|
|
2419
|
-
workspaceId,
|
|
2420
|
-
sessionId,
|
|
2421
|
-
enabled: workspaceVisible,
|
|
2422
|
-
active: browserActive,
|
|
2423
|
-
onNotify,
|
|
2424
|
-
initialBrowserSessionId,
|
|
2425
|
-
onBrowserSessionIdChange,
|
|
2426
|
-
...desktopEnabled ? { createLinkedComputer } : {},
|
|
2427
|
-
...onOpenComputerSession ? { onOpenComputer: onOpenComputerSession } : {},
|
|
2428
|
-
...browserWebSocketFactory ? { webSocketFactory: browserWebSocketFactory } : {},
|
|
2429
|
-
...browserExtensionSetupUrl ? { browserExtensionSetupUrl } : {},
|
|
2430
|
-
className: "h-full"
|
|
2431
|
-
},
|
|
2432
|
-
sessionId
|
|
2433
|
-
) })
|
|
2434
|
-
});
|
|
2435
|
-
}
|
|
2436
|
-
if (desktopEnabled) {
|
|
2437
|
-
list.push({
|
|
2438
|
-
id: WORKBENCH_TAB_DESKTOP,
|
|
2439
|
-
label: t("sandboxWorkspace.desktop"),
|
|
2440
|
-
icon: /* @__PURE__ */ jsx4(MonitorIcon, {}),
|
|
2441
|
-
...relevantOnly ? { optional: true } : {},
|
|
2442
|
-
content: /* @__PURE__ */ jsx4(Suspense, { fallback: /* @__PURE__ */ jsx4(WorkbenchSurfaceLoading, { name: "Desktop" }), children: /* @__PURE__ */ jsx4(
|
|
2443
|
-
LazyComputerViewer,
|
|
2444
|
-
{
|
|
2445
|
-
client,
|
|
2446
|
-
workspaceId,
|
|
2447
|
-
sessionId,
|
|
2448
|
-
enabled: workspaceVisible,
|
|
2449
|
-
onNotify,
|
|
2450
|
-
initialComputerSessionId,
|
|
2451
|
-
onComputerSessionIdChange,
|
|
2452
|
-
requestedComputerSessionId,
|
|
2453
|
-
requestedComputerRequestId,
|
|
2454
|
-
...computerWebSocketFactory ? { webSocketFactory: computerWebSocketFactory } : {},
|
|
2455
|
-
className: "h-full"
|
|
2456
|
-
},
|
|
2457
|
-
sessionId
|
|
2458
|
-
) })
|
|
2459
|
-
});
|
|
2460
|
-
}
|
|
2461
|
-
return list;
|
|
2462
|
-
}, [
|
|
2463
|
-
fileSystemOn,
|
|
2464
|
-
changesEnabled,
|
|
2465
|
-
filesEnabled,
|
|
2466
|
-
terminalOn,
|
|
2467
|
-
browserEnabled,
|
|
2468
|
-
desktopEnabled,
|
|
2469
|
-
captureAvailable,
|
|
2470
|
-
captureState.degradedReason,
|
|
2471
|
-
dirtyCount,
|
|
2472
|
-
captureHasChanges,
|
|
2473
|
-
eventsShowChanges,
|
|
2474
|
-
storedChangesComparison,
|
|
2475
|
-
relevantOnly,
|
|
2476
|
-
warmTerminal,
|
|
2477
|
-
requestedFilePath,
|
|
2478
|
-
requestedFileRequestId,
|
|
2479
|
-
requestedFileLine,
|
|
2480
|
-
onOpenFile,
|
|
2481
|
-
stablePullRequest,
|
|
2482
|
-
onOpenPullRequest,
|
|
2483
|
-
initialFilePath,
|
|
2484
|
-
onFilePathChange,
|
|
2485
|
-
isFileNodeVisible,
|
|
2486
|
-
hideToolFolders,
|
|
2487
|
-
initialBrowserSessionId,
|
|
2488
|
-
onBrowserSessionIdChange,
|
|
2489
|
-
initialComputerSessionId,
|
|
2490
|
-
onComputerSessionIdChange,
|
|
2491
|
-
onOpenComputerSession,
|
|
2492
|
-
requestedComputerSessionId,
|
|
2493
|
-
requestedComputerRequestId,
|
|
2494
|
-
onNotify,
|
|
2495
|
-
browserWebSocketFactory,
|
|
2496
|
-
computerWebSocketFactory,
|
|
2497
|
-
workspaceVisible,
|
|
2498
|
-
// Only Browser reads which tab is active: switching between the other
|
|
2499
|
-
// tabs must not rebuild (and re-render) every panel.
|
|
2500
|
-
browserActive,
|
|
2501
|
-
client,
|
|
2502
|
-
workspaceId,
|
|
2503
|
-
liveness,
|
|
2504
|
-
sessionId,
|
|
2505
|
-
files,
|
|
2506
|
-
git,
|
|
2507
|
-
changesComparison,
|
|
2508
|
-
terminal,
|
|
2509
|
-
xtermTheme,
|
|
2510
|
-
capabilities,
|
|
2511
|
-
workspaceWaking,
|
|
2512
|
-
caps.state,
|
|
2513
|
-
caps.error,
|
|
2514
|
-
caps.viewerCapReached,
|
|
2515
|
-
caps.viewerCapReason,
|
|
2516
|
-
caps.renegotiate,
|
|
2517
|
-
filesWarmRequested,
|
|
2518
|
-
requestWarmIntent,
|
|
2519
|
-
wakeFiles,
|
|
2520
|
-
openGuardedFile,
|
|
2521
|
-
createLinkedComputer,
|
|
2522
|
-
t
|
|
2523
|
-
]);
|
|
2524
|
-
return {
|
|
2525
|
-
tabs,
|
|
2526
|
-
defaultTab,
|
|
2527
|
-
machine: {
|
|
2528
|
-
enabled: machineSurfaceEnabled,
|
|
2529
|
-
chip,
|
|
2530
|
-
activeMachine,
|
|
2531
|
-
loading: machines.loading,
|
|
2532
|
-
error: machines.error,
|
|
2533
|
-
refresh: machines.refresh
|
|
2534
|
-
}
|
|
2535
|
-
};
|
|
2536
|
-
}
|
|
2537
|
-
function SandboxWorkspace(props) {
|
|
2538
|
-
const {
|
|
2539
|
-
sessionId,
|
|
2540
|
-
events,
|
|
2541
|
-
primary,
|
|
2542
|
-
surfaces,
|
|
2543
|
-
machinesEnabled,
|
|
2544
|
-
leadingTabs,
|
|
2545
|
-
trailingTabs,
|
|
2546
|
-
initialTab,
|
|
2547
|
-
tabVisibility,
|
|
2548
|
-
onActiveTabChange,
|
|
2549
|
-
onStripEmptied,
|
|
2550
|
-
openTabRequest,
|
|
2551
|
-
initialFilePath,
|
|
2552
|
-
onFilePathChange,
|
|
2553
|
-
isFileNodeVisible,
|
|
2554
|
-
hideToolFolders,
|
|
2555
|
-
openFileRequest,
|
|
2556
|
-
initialBrowserSessionId,
|
|
2557
|
-
onBrowserSessionIdChange,
|
|
2558
|
-
initialComputerSessionId,
|
|
2559
|
-
onComputerSessionIdChange,
|
|
2560
|
-
onNotify,
|
|
2561
|
-
browserWebSocketFactory,
|
|
2562
|
-
computerWebSocketFactory,
|
|
2563
|
-
browserExtensionSetupUrl,
|
|
2564
|
-
pullRequest,
|
|
2565
|
-
onOpenPullRequest,
|
|
2566
|
-
collapsed,
|
|
2567
|
-
onCollapsedChange,
|
|
2568
|
-
showCollapseControl,
|
|
2569
|
-
mobileLeadingControl,
|
|
2570
|
-
autoSaveId,
|
|
2571
|
-
defaultSize,
|
|
2572
|
-
minSize,
|
|
2573
|
-
maxSize,
|
|
2574
|
-
className
|
|
2575
|
-
} = props;
|
|
2576
|
-
const [storedSelection, setStoredSelection] = useState8(null);
|
|
2577
|
-
const [requestedFile, setRequestedFile] = useState8(null);
|
|
2578
|
-
const [requestedComputer, setRequestedComputer] = useState8(null);
|
|
2579
|
-
const nextFileRequestId = useRef8(0);
|
|
2580
|
-
const nextComputerRequestId = useRef8(0);
|
|
2581
|
-
const selectedTab = storedSelection?.sessionId === sessionId ? storedSelection.tab : null;
|
|
2582
|
-
const [shownTab, setShownTab] = useState8(null);
|
|
2583
|
-
const handledTabRequest = useRef8(null);
|
|
2584
|
-
useEffect8(() => {
|
|
2585
|
-
if (!openTabRequest || handledTabRequest.current?.sessionId === sessionId && handledTabRequest.current.requestId === openTabRequest.requestId)
|
|
2586
|
-
return;
|
|
2587
|
-
const available = [...leadingTabs ?? [], ...trailingTabs ?? []].some(
|
|
2588
|
-
(tab) => tab.id === openTabRequest.tab
|
|
2589
|
-
) || (surfaces ?? WORKBENCH_SURFACES).some((tab) => tab === openTabRequest.tab);
|
|
2590
|
-
if (!available) return;
|
|
2591
|
-
handledTabRequest.current = { sessionId, requestId: openTabRequest.requestId };
|
|
2592
|
-
setStoredSelection({ sessionId, tab: openTabRequest.tab, picked: true });
|
|
2593
|
-
onActiveTabChange?.(openTabRequest.tab);
|
|
2594
|
-
if (openTabRequest.expand !== false) onCollapsedChange?.(false);
|
|
2595
|
-
}, [
|
|
2596
|
-
openTabRequest,
|
|
2597
|
-
sessionId,
|
|
2598
|
-
leadingTabs,
|
|
2599
|
-
trailingTabs,
|
|
2600
|
-
surfaces,
|
|
2601
|
-
onActiveTabChange,
|
|
2602
|
-
onCollapsedChange
|
|
2603
|
-
]);
|
|
2604
|
-
const activeTabHint = selectedTab ?? initialTab ?? leadingTabs?.[0]?.id ?? null;
|
|
2605
|
-
const openFile = useCallback10(
|
|
2606
|
-
(path, line) => {
|
|
2607
|
-
setRequestedFile({
|
|
2608
|
-
sessionId,
|
|
2609
|
-
path,
|
|
2610
|
-
line: line != null && line > 0 ? line : null,
|
|
2611
|
-
requestId: ++nextFileRequestId.current
|
|
2612
|
-
});
|
|
2613
|
-
setStoredSelection({ sessionId, tab: WORKBENCH_TAB_FILES, picked: true });
|
|
2614
|
-
onActiveTabChange?.(WORKBENCH_TAB_FILES);
|
|
2615
|
-
onFilePathChange?.(path);
|
|
2616
|
-
onCollapsedChange?.(false);
|
|
2617
|
-
},
|
|
2618
|
-
[onActiveTabChange, onCollapsedChange, onFilePathChange, sessionId]
|
|
2619
|
-
);
|
|
2620
|
-
const handledOpenFileRequestId = useRef8(null);
|
|
2621
|
-
useEffect8(() => {
|
|
2622
|
-
if (!openFileRequest) return;
|
|
2623
|
-
if (handledOpenFileRequestId.current === openFileRequest.requestId) return;
|
|
2624
|
-
handledOpenFileRequestId.current = openFileRequest.requestId;
|
|
2625
|
-
openFile(openFileRequest.path, openFileRequest.line);
|
|
2626
|
-
}, [openFile, openFileRequest]);
|
|
2627
|
-
const openComputer = useCallback10(
|
|
2628
|
-
(computerSessionId) => {
|
|
2629
|
-
nextComputerRequestId.current += 1;
|
|
2630
|
-
setRequestedComputer({
|
|
2631
|
-
sessionId,
|
|
2632
|
-
computerSessionId,
|
|
2633
|
-
requestId: nextComputerRequestId.current
|
|
2634
|
-
});
|
|
2635
|
-
setStoredSelection({ sessionId, tab: WORKBENCH_TAB_DESKTOP, picked: true });
|
|
2636
|
-
onActiveTabChange?.(WORKBENCH_TAB_DESKTOP);
|
|
2637
|
-
onComputerSessionIdChange?.(computerSessionId);
|
|
2638
|
-
},
|
|
2639
|
-
[onActiveTabChange, onComputerSessionIdChange, sessionId]
|
|
2640
|
-
);
|
|
2641
|
-
const {
|
|
2642
|
-
tabs: workbenchTabs,
|
|
2643
|
-
machine,
|
|
2644
|
-
defaultTab
|
|
2645
|
-
} = useSandboxWorkspaceTabs({
|
|
2646
|
-
...props.client ? { client: props.client } : {},
|
|
2647
|
-
...props.workspaceId ? { workspaceId: props.workspaceId } : {},
|
|
2648
|
-
sessionId,
|
|
2649
|
-
events,
|
|
2650
|
-
...surfaces ? { surfaces } : {},
|
|
2651
|
-
...machinesEnabled !== void 0 ? { machinesEnabled } : {},
|
|
2652
|
-
...initialTab ? { initialTab } : {},
|
|
2653
|
-
...tabVisibility ? { tabVisibility } : {},
|
|
2654
|
-
activeTab: shownTab?.sessionId === sessionId ? shownTab.tab : activeTabHint,
|
|
2655
|
-
workspaceVisible: collapsed !== true,
|
|
2656
|
-
...onNotify ? { onNotify } : {},
|
|
2657
|
-
...browserWebSocketFactory ? { browserWebSocketFactory } : {},
|
|
2658
|
-
...computerWebSocketFactory ? { computerWebSocketFactory } : {},
|
|
2659
|
-
...browserExtensionSetupUrl ? { browserExtensionSetupUrl } : {},
|
|
2660
|
-
...pullRequest ? { pullRequest } : {},
|
|
2661
|
-
...onOpenPullRequest ? { onOpenPullRequest } : {},
|
|
2662
|
-
initialFilePath,
|
|
2663
|
-
onFilePathChange,
|
|
2664
|
-
isFileNodeVisible,
|
|
2665
|
-
hideToolFolders,
|
|
2666
|
-
initialBrowserSessionId,
|
|
2667
|
-
onBrowserSessionIdChange,
|
|
2668
|
-
initialComputerSessionId,
|
|
2669
|
-
onComputerSessionIdChange,
|
|
2670
|
-
requestedFilePath: requestedFile?.sessionId === sessionId ? requestedFile.path : null,
|
|
2671
|
-
requestedFileRequestId: requestedFile?.sessionId === sessionId ? requestedFile.requestId : null,
|
|
2672
|
-
requestedFileLine: requestedFile?.sessionId === sessionId ? requestedFile.line : null,
|
|
2673
|
-
onOpenFile: openFile,
|
|
2674
|
-
onOpenComputerSession: openComputer,
|
|
2675
|
-
requestedComputerSessionId: requestedComputer?.sessionId === sessionId ? requestedComputer.computerSessionId : null,
|
|
2676
|
-
requestedComputerRequestId: requestedComputer?.sessionId === sessionId ? requestedComputer.requestId : null
|
|
2677
|
-
});
|
|
2678
|
-
const tabs = [...leadingTabs ?? [], ...workbenchTabs, ...trailingTabs ?? []];
|
|
2679
|
-
const preferredTab = selectedTab ?? defaultTab;
|
|
2680
|
-
const preferredOptional = tabVisibility === "relevant" && !(storedSelection?.sessionId === sessionId && storedSelection.picked === true) && tabs.some((tab) => tab.id === preferredTab && tab.optional);
|
|
2681
|
-
const firstWithContent = preferredOptional ? tabs.find((tab) => !tab.optional) : void 0;
|
|
2682
|
-
const activeTab = firstWithContent ? firstWithContent.id : preferredTab && tabs.some((tab) => tab.id === preferredTab) ? preferredTab : tabs[0]?.id;
|
|
2683
|
-
const selectTab = useCallback10(
|
|
2684
|
-
(tab) => {
|
|
2685
|
-
setStoredSelection({ sessionId, tab, picked: true });
|
|
2686
|
-
onActiveTabChange?.(tab);
|
|
2687
|
-
},
|
|
2688
|
-
[onActiveTabChange, sessionId]
|
|
2689
|
-
);
|
|
2690
|
-
useEffect8(() => {
|
|
2691
|
-
if (selectedTab !== null || defaultTab === null) return;
|
|
2692
|
-
setStoredSelection({ sessionId, tab: defaultTab, picked: Boolean(initialTab) });
|
|
2693
|
-
}, [defaultTab, initialTab, selectedTab, sessionId]);
|
|
2694
|
-
const picked = storedSelection?.sessionId === sessionId && storedSelection.picked === true;
|
|
2695
|
-
const landingShown = tabVisibility === "relevant" && !picked && tabs.length > 0 && tabs.every((tab) => tab.optional);
|
|
2696
|
-
const shownNow = landingShown ? "" : activeTab ?? null;
|
|
2697
|
-
useEffect8(() => {
|
|
2698
|
-
if (shownNow === null) return;
|
|
2699
|
-
setShownTab(
|
|
2700
|
-
(previous) => previous?.sessionId === sessionId && previous.tab === shownNow ? previous : { sessionId, tab: shownNow }
|
|
2701
|
-
);
|
|
2702
|
-
}, [sessionId, shownNow]);
|
|
2703
|
-
const backToLanding = useCallback10(() => {
|
|
2704
|
-
setStoredSelection(
|
|
2705
|
-
(previous) => previous?.sessionId === sessionId ? { ...previous, picked: false } : previous
|
|
2706
|
-
);
|
|
2707
|
-
onStripEmptied?.();
|
|
2708
|
-
}, [onStripEmptied, sessionId]);
|
|
2709
|
-
return /* @__PURE__ */ jsx4(
|
|
2710
|
-
WorkspaceDock,
|
|
2711
|
-
{
|
|
2712
|
-
primary,
|
|
2713
|
-
tabs,
|
|
2714
|
-
...activeTab !== void 0 ? { activeTab } : {},
|
|
2715
|
-
onActiveTabChange: selectTab,
|
|
2716
|
-
essentials: tabVisibility === "relevant",
|
|
2717
|
-
...tabVisibility === "relevant" ? { landing: !picked, onStripEmptied: backToLanding } : {},
|
|
2718
|
-
...sessionId ? { tabScope: sessionId } : {},
|
|
2719
|
-
...machine.enabled && activeTab !== WORKBENCH_TAB_BROWSER && activeTab !== WORKBENCH_TAB_DESKTOP ? {
|
|
2720
|
-
headerAccessory: /* @__PURE__ */ jsx4(MachineStateChip, { chip: machine.chip }),
|
|
2721
|
-
// Waking or an unreachable machine is worth seeing without opening
|
|
2722
|
-
// the menu; a sleeping box is ordinary.
|
|
2723
|
-
headerAccessoryPinned: machine.chip.state === "waking" || machine.chip.unreachable === true
|
|
2724
|
-
} : {},
|
|
2725
|
-
...mobileLeadingControl !== void 0 ? { mobileLeadingControl } : {},
|
|
2726
|
-
...collapsed !== void 0 ? { collapsed } : {},
|
|
2727
|
-
...onCollapsedChange ? { onCollapsedChange } : {},
|
|
2728
|
-
...showCollapseControl !== void 0 ? { showCollapseControl } : {},
|
|
2729
|
-
...autoSaveId !== void 0 ? { autoSaveId } : {},
|
|
2730
|
-
...defaultSize !== void 0 ? { defaultSize } : {},
|
|
2731
|
-
...minSize !== void 0 ? { minSize } : {},
|
|
2732
|
-
...maxSize !== void 0 ? { maxSize } : {},
|
|
2733
|
-
...className !== void 0 ? { className } : {}
|
|
2734
|
-
}
|
|
2735
|
-
);
|
|
2736
|
-
}
|
|
2737
|
-
function DirtyBadge({ count }) {
|
|
2738
|
-
return /* @__PURE__ */ jsx4("span", { className: "rounded-og-xs bg-og-accent-soft px-1 text-og-xs text-og-fg-muted", children: count });
|
|
2739
|
-
}
|
|
2740
|
-
function chipDotClass(state) {
|
|
2741
|
-
if (state === "live") return "bg-og-status-running";
|
|
2742
|
-
if (state === "waking") return "bg-og-status-idle animate-pulse motion-reduce:animate-none";
|
|
2743
|
-
return "bg-og-fg-subtle";
|
|
2744
|
-
}
|
|
2745
|
-
function MachineStateChip({ chip }) {
|
|
2746
|
-
const t = useOpenGeniText();
|
|
2747
|
-
return /* @__PURE__ */ jsxs3(
|
|
2748
|
-
"div",
|
|
2749
|
-
{
|
|
2750
|
-
role: "status",
|
|
2751
|
-
"aria-label": t("sandboxWorkspace.machineLabel", { label: chip.label }),
|
|
2752
|
-
title: chip.label,
|
|
2753
|
-
className: "inline-flex min-h-7 min-w-0 max-w-full items-center gap-1.5 px-2 py-1 text-og-xs font-medium text-og-fg-muted max-[1023px]:min-h-11 pointer-coarse:min-h-11",
|
|
2754
|
-
children: [
|
|
2755
|
-
/* @__PURE__ */ jsx4(
|
|
2756
|
-
"span",
|
|
2757
|
-
{
|
|
2758
|
-
className: cn("size-1.5 shrink-0 rounded-full", chipDotClass(chip.state)),
|
|
2759
|
-
"aria-hidden": true
|
|
2760
|
-
}
|
|
2761
|
-
),
|
|
2762
|
-
/* @__PURE__ */ jsx4("span", { "data-contrast-audited": true, className: "min-w-0 max-w-[11rem] truncate", children: chip.label })
|
|
2763
|
-
]
|
|
2764
|
-
}
|
|
2765
|
-
);
|
|
2766
|
-
}
|
|
2767
|
-
function DockActionButton({ onClick, children }) {
|
|
2768
|
-
return /* @__PURE__ */ jsx4(
|
|
2769
|
-
"button",
|
|
2770
|
-
{
|
|
2771
|
-
type: "button",
|
|
2772
|
-
onClick,
|
|
2773
|
-
className: "inline-flex items-center gap-1.5 rounded-og-sm border border-og-border px-2 py-1 text-og-xs font-medium text-og-fg-muted transition-colors hover:border-og-border-strong hover:text-og-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent max-[1023px]:min-h-11 pointer-coarse:min-h-11",
|
|
2774
|
-
children
|
|
2775
|
-
}
|
|
2776
|
-
);
|
|
2777
|
-
}
|
|
2778
|
-
var ChangesTabBody = memo(function ChangesTabBody2({
|
|
2779
|
-
comparison,
|
|
2780
|
-
onComparisonChange,
|
|
2781
|
-
...props
|
|
2782
|
-
}) {
|
|
2783
|
-
const t = useOpenGeniText();
|
|
2784
|
-
const picker = useMemo5(
|
|
2785
|
-
() => ({
|
|
2786
|
-
value: comparison,
|
|
2787
|
-
options: [
|
|
2788
|
-
{ value: "branch", label: t("sandboxWorkspace.branch") },
|
|
2789
|
-
{ value: "working", label: t("sandboxWorkspace.uncommitted") },
|
|
2790
|
-
{ value: "staged", label: t("sandboxWorkspace.staged") }
|
|
2791
|
-
],
|
|
2792
|
-
onChange: (value) => onComparisonChange(value)
|
|
2793
|
-
}),
|
|
2794
|
-
[comparison, onComparisonChange, t]
|
|
2795
|
-
);
|
|
2796
|
-
if (props.git.diff.length > 0) {
|
|
2797
|
-
return /* @__PURE__ */ jsx4("div", { className: "h-full min-h-0", children: /* @__PURE__ */ jsx4(ChangesTabContent, { comparison, picker, ...props }) });
|
|
2798
|
-
}
|
|
2799
|
-
return /* @__PURE__ */ jsxs3("div", { className: "flex h-full min-h-0 flex-col", children: [
|
|
2800
|
-
/* @__PURE__ */ jsx4("div", { className: "flex min-h-9 shrink-0 items-center border-b border-og-border px-2 py-1", children: /* @__PURE__ */ jsx4(WorkbenchChangesViewMenu, { comparison: picker }) }),
|
|
2801
|
-
/* @__PURE__ */ jsx4("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsx4(ChangesTabContent, { comparison, picker, ...props }) })
|
|
2802
|
-
] });
|
|
2803
|
-
});
|
|
2804
|
-
function ChangesTabContent({
|
|
2805
|
-
git,
|
|
2806
|
-
comparison,
|
|
2807
|
-
picker,
|
|
2808
|
-
captureAvailable,
|
|
2809
|
-
captureDegraded,
|
|
2810
|
-
captureRevision,
|
|
2811
|
-
capturePending,
|
|
2812
|
-
liveWorkspaceExpected,
|
|
2813
|
-
workspaceWaking,
|
|
2814
|
-
capabilitiesState,
|
|
2815
|
-
capabilitiesError,
|
|
2816
|
-
onRetry,
|
|
2817
|
-
onWake,
|
|
2818
|
-
onOpenFile,
|
|
2819
|
-
pullRequest,
|
|
2820
|
-
onOpenPullRequest,
|
|
2821
|
-
navigation
|
|
2822
|
-
}) {
|
|
2823
|
-
const t = useOpenGeniText();
|
|
2824
|
-
const diff = git.diff;
|
|
2825
|
-
if (diff.length > 0) {
|
|
2826
|
-
return /* @__PURE__ */ jsxs3("div", { className: "flex h-full min-h-0 flex-col", children: [
|
|
2827
|
-
git.error ? /* @__PURE__ */ jsxs3(
|
|
2828
|
-
"div",
|
|
2829
|
-
{
|
|
2830
|
-
role: "status",
|
|
2831
|
-
"aria-live": "polite",
|
|
2832
|
-
"data-opengeni-changes-degraded": true,
|
|
2833
|
-
className: "flex shrink-0 items-center gap-2 border-b border-og-status-running/30 bg-og-status-running/10 px-2 py-1.5 text-og-xs text-og-fg-muted",
|
|
2834
|
-
children: [
|
|
2835
|
-
/* @__PURE__ */ jsx4(TriangleAlertIcon, { className: "size-3.5 shrink-0 text-og-status-running", "aria-hidden": true }),
|
|
2836
|
-
/* @__PURE__ */ jsx4("span", { className: "min-w-0 flex-1", children: git.source === "capture" ? t("sandboxWorkspace.liveChangesAreTemporarilyUnavailable") : t("sandboxWorkspace.liveRefreshFailedShowingThe") }),
|
|
2837
|
-
/* @__PURE__ */ jsxs3(
|
|
2838
|
-
"button",
|
|
2839
|
-
{
|
|
2840
|
-
type: "button",
|
|
2841
|
-
onClick: () => void git.refresh(),
|
|
2842
|
-
disabled: git.loading,
|
|
2843
|
-
className: "inline-flex min-h-7 shrink-0 items-center gap-1 rounded-og-sm border border-og-border bg-og-surface-1 px-2 font-medium text-og-fg transition-colors hover:border-og-border-strong focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:min-h-11",
|
|
2844
|
-
children: [
|
|
2845
|
-
/* @__PURE__ */ jsx4(
|
|
2846
|
-
RefreshCwIcon,
|
|
2847
|
-
{
|
|
2848
|
-
className: cn("size-3", git.loading && "animate-spin motion-reduce:animate-none"),
|
|
2849
|
-
"aria-hidden": true
|
|
2850
|
-
}
|
|
2851
|
-
),
|
|
2852
|
-
t("sandboxWorkspace.retry")
|
|
2853
|
-
]
|
|
2854
|
-
}
|
|
2855
|
-
)
|
|
2856
|
-
]
|
|
2857
|
-
}
|
|
2858
|
-
) : null,
|
|
2859
|
-
/* @__PURE__ */ jsx4("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsx4(
|
|
2860
|
-
WorkbenchChanges,
|
|
2861
|
-
{
|
|
2862
|
-
diff,
|
|
2863
|
-
source: git.source,
|
|
2864
|
-
capturedAt: git.capturedAt,
|
|
2865
|
-
captureRevision,
|
|
2866
|
-
...onOpenFile ? { onOpenFile } : {},
|
|
2867
|
-
pullRequest: pullRequest ?? null,
|
|
2868
|
-
...onOpenPullRequest ? { onOpenPullRequest } : {},
|
|
2869
|
-
comparison: picker,
|
|
2870
|
-
...navigation ? { navigation } : {}
|
|
2871
|
-
}
|
|
2872
|
-
) })
|
|
2873
|
-
] });
|
|
2874
|
-
}
|
|
2875
|
-
if (capabilitiesError && !captureAvailable) {
|
|
2876
|
-
return /* @__PURE__ */ jsxs3(CenteredState, { icon: /* @__PURE__ */ jsx4(TriangleAlertIcon, { className: "size-5", "aria-hidden": true }), tone: "danger", children: [
|
|
2877
|
-
/* @__PURE__ */ jsx4("p", { className: "text-og-sm font-medium text-og-fg", children: t("sandboxWorkspace.sandboxUnavailable") }),
|
|
2878
|
-
/* @__PURE__ */ jsx4("p", { "data-contrast-audited": true, className: "text-og-sm leading-5 text-og-fg-muted", children: capabilitiesError.message || t("sandboxWorkspace.couldnTReachTheSandbox") }),
|
|
2879
|
-
/* @__PURE__ */ jsxs3(DockActionButton, { onClick: onRetry, children: [
|
|
2880
|
-
/* @__PURE__ */ jsx4(RefreshCwIcon, { className: "size-3" }),
|
|
2881
|
-
t("sandboxWorkspace.retry")
|
|
2882
|
-
] })
|
|
2883
|
-
] });
|
|
2884
|
-
}
|
|
2885
|
-
if ((capturePending || capabilitiesState === "negotiating") && !captureAvailable && !workspaceWaking) {
|
|
2886
|
-
return /* @__PURE__ */ jsxs3(
|
|
2887
|
-
CenteredState,
|
|
2888
|
-
{
|
|
2889
|
-
icon: /* @__PURE__ */ jsx4(
|
|
2890
|
-
LoaderCircleIcon,
|
|
2891
|
-
{
|
|
2892
|
-
className: "size-5 animate-spin motion-reduce:animate-none",
|
|
2893
|
-
"aria-hidden": true
|
|
2894
|
-
}
|
|
2895
|
-
),
|
|
2896
|
-
children: [
|
|
2897
|
-
/* @__PURE__ */ jsx4("p", { className: "text-og-sm font-medium text-og-fg", children: t("sandboxWorkspace.connectingWorkspace") }),
|
|
2898
|
-
/* @__PURE__ */ jsx4("p", { className: "text-og-sm leading-5 text-og-fg-subtle", children: t("sandboxWorkspace.lookingForTheLatestFiles") })
|
|
2899
|
-
]
|
|
2900
|
-
}
|
|
2901
|
-
);
|
|
2902
|
-
}
|
|
2903
|
-
if (!liveWorkspaceExpected && (comparison !== "working" || !captureAvailable)) {
|
|
2904
|
-
const previewUnavailable = captureDegraded && !captureAvailable && comparison !== "staged";
|
|
2905
|
-
return /* @__PURE__ */ jsxs3(
|
|
2906
|
-
CenteredState,
|
|
2907
|
-
{
|
|
2908
|
-
icon: workspaceWaking ? /* @__PURE__ */ jsx4(
|
|
2909
|
-
LoaderCircleIcon,
|
|
2910
|
-
{
|
|
2911
|
-
className: "size-5 animate-spin motion-reduce:animate-none",
|
|
2912
|
-
"aria-hidden": true
|
|
2913
|
-
}
|
|
2914
|
-
) : previewUnavailable ? /* @__PURE__ */ jsx4(TriangleAlertIcon, { className: "size-5", "aria-hidden": true }) : /* @__PURE__ */ jsx4(CpuIcon, { className: "size-5", "aria-hidden": true }),
|
|
2915
|
-
children: [
|
|
2916
|
-
/* @__PURE__ */ jsx4("p", { className: "text-og-sm font-medium text-og-fg", children: workspaceWaking ? t("sandboxWorkspace.wakingWorkspace") : previewUnavailable ? t("sandboxWorkspace.savedChangesPreviewIsUnavailable") : t("sandboxWorkspace.workspaceIsResting") }),
|
|
2917
|
-
/* @__PURE__ */ jsx4("p", { className: "text-og-sm leading-5 text-og-fg-subtle", children: workspaceWaking ? t("sandboxWorkspace.connectingToTheLiveWorking") : previewUnavailable ? t("sandboxWorkspace.openTheLiveWorkspaceTo") : comparison === "branch" ? t("sandboxWorkspace.wakeTheSandboxToCompare") : comparison === "staged" ? t("sandboxWorkspace.wakeTheSandboxToInspect") : t("sandboxWorkspace.noCapturedRevisionIsAvailable") }),
|
|
2918
|
-
!workspaceWaking ? /* @__PURE__ */ jsxs3(DockActionButton, { onClick: onWake, children: [
|
|
2919
|
-
/* @__PURE__ */ jsx4(CpuIcon, { className: "size-3" }),
|
|
2920
|
-
t("sandboxWorkspace.openLiveWorkspace")
|
|
2921
|
-
] }) : null
|
|
2922
|
-
]
|
|
2923
|
-
}
|
|
2924
|
-
);
|
|
2925
|
-
}
|
|
2926
|
-
if (git.loading && git.source === null) {
|
|
2927
|
-
return /* @__PURE__ */ jsxs3(
|
|
2928
|
-
CenteredState,
|
|
2929
|
-
{
|
|
2930
|
-
icon: /* @__PURE__ */ jsx4(
|
|
2931
|
-
LoaderCircleIcon,
|
|
2932
|
-
{
|
|
2933
|
-
className: "size-5 animate-spin motion-reduce:animate-none",
|
|
2934
|
-
"aria-hidden": true
|
|
2935
|
-
}
|
|
2936
|
-
),
|
|
2937
|
-
children: [
|
|
2938
|
-
/* @__PURE__ */ jsx4("p", { className: "text-og-sm font-medium text-og-fg", children: t("sandboxWorkspace.loadingWorkspace") }),
|
|
2939
|
-
/* @__PURE__ */ jsx4("p", { className: "text-og-sm leading-5 text-og-fg-subtle", children: t("sandboxWorkspace.readingTheCurrentWorkingTree") })
|
|
2940
|
-
]
|
|
2941
|
-
}
|
|
2942
|
-
);
|
|
2943
|
-
}
|
|
2944
|
-
return /* @__PURE__ */ jsxs3(CenteredState, { icon: /* @__PURE__ */ jsx4(CircleCheckIcon, { className: "size-5", "aria-hidden": true }), tone: "success", children: [
|
|
2945
|
-
/* @__PURE__ */ jsx4("p", { className: "text-og-sm font-medium text-og-fg", children: comparison === "branch" ? t("sandboxWorkspace.noBranchChanges") : comparison === "staged" ? t("sandboxWorkspace.noStagedChanges") : t("sandboxWorkspace.noUncommittedChanges") }),
|
|
2946
|
-
/* @__PURE__ */ jsx4("p", { className: "text-og-sm leading-5 text-og-fg-subtle", children: comparison === "branch" ? t("sandboxWorkspace.thisBranchMatchesTheRemote") : comparison === "staged" ? t("sandboxWorkspace.stageFilesToReviewThe") : t("sandboxWorkspace.localEditsNotYetCommitted") })
|
|
2947
|
-
] });
|
|
2948
|
-
}
|
|
2949
|
-
function CenteredState({
|
|
2950
|
-
children,
|
|
2951
|
-
icon,
|
|
2952
|
-
tone = "neutral"
|
|
2953
|
-
}) {
|
|
2954
|
-
return /* @__PURE__ */ jsx4(
|
|
2955
|
-
"div",
|
|
2956
|
-
{
|
|
2957
|
-
role: tone === "danger" ? "alert" : "status",
|
|
2958
|
-
"aria-atomic": "true",
|
|
2959
|
-
"aria-live": tone === "danger" ? "assertive" : "polite",
|
|
2960
|
-
className: "grid h-full place-items-center p-6 text-center",
|
|
2961
|
-
children: /* @__PURE__ */ jsxs3("div", { className: "flex max-w-sm flex-col items-center gap-2.5", children: [
|
|
2962
|
-
icon ? /* @__PURE__ */ jsx4(
|
|
2963
|
-
"span",
|
|
2964
|
-
{
|
|
2965
|
-
className: cn(
|
|
2966
|
-
"grid size-10 place-items-center rounded-og-lg border bg-og-surface-1 shadow-sm",
|
|
2967
|
-
tone === "success" && "border-og-status-idle/30 text-og-status-idle",
|
|
2968
|
-
tone === "danger" && "border-og-status-failed/30 text-og-status-failed",
|
|
2969
|
-
tone === "neutral" && "border-og-border text-og-fg-muted"
|
|
2970
|
-
),
|
|
2971
|
-
children: icon
|
|
2972
|
-
}
|
|
2973
|
-
) : null,
|
|
2974
|
-
children
|
|
2975
|
-
] })
|
|
2976
|
-
}
|
|
2977
|
-
);
|
|
2978
|
-
}
|
|
2979
|
-
|
|
2980
|
-
// src/hooks/use-supergrok-accounts.ts
|
|
2981
|
-
import { useCallback as useCallback11 } from "react";
|
|
2982
|
-
var superGrokAccountsQueryKey = (workspaceId) => ["supergrok-accounts", workspaceId];
|
|
2983
|
-
var EMPTY = {
|
|
2984
|
-
accounts: [],
|
|
2985
|
-
activeAccountId: null,
|
|
2986
|
-
settings: {
|
|
2987
|
-
rotationEnabled: false,
|
|
2988
|
-
rotationStrategy: "sharded",
|
|
2989
|
-
activeCredentialId: null
|
|
2990
|
-
}
|
|
2991
|
-
};
|
|
2992
|
-
function useSuperGrokAccounts(options = {}) {
|
|
2993
|
-
const { client, workspaceId } = useOpenGeni(options);
|
|
2994
|
-
const supergrokClient = options.supergrokClient ?? client;
|
|
2995
|
-
const load = useCallback11(
|
|
2996
|
-
async () => await supergrokClient.listSuperGrokAccounts(workspaceId),
|
|
2997
|
-
[supergrokClient, workspaceId]
|
|
2998
|
-
);
|
|
2999
|
-
const { data, loading, refresh } = useSharedQuery(
|
|
3000
|
-
supergrokClient,
|
|
3001
|
-
superGrokAccountsQueryKey(workspaceId),
|
|
3002
|
-
load,
|
|
3003
|
-
{ enabled: options.enabled, pollIntervalMs: options.pollIntervalMs }
|
|
3004
|
-
);
|
|
3005
|
-
const { run, mutating: activating, mutationError } = useMutationRunner();
|
|
3006
|
-
const activate = useCallback11(
|
|
3007
|
-
async (accountId) => {
|
|
3008
|
-
if (!supergrokClient.activateSuperGrokAccount) return false;
|
|
3009
|
-
const invalidated = { current: null };
|
|
3010
|
-
const result = await run(async () => {
|
|
3011
|
-
await supergrokClient.activateSuperGrokAccount(workspaceId, accountId);
|
|
3012
|
-
invalidated.current = invalidateSharedQueries(supergrokClient, ["supergrok-accounts"]);
|
|
3013
|
-
return true;
|
|
3014
|
-
});
|
|
3015
|
-
if (result) await invalidated.current;
|
|
3016
|
-
return result === true;
|
|
3017
|
-
},
|
|
3018
|
-
[run, supergrokClient, workspaceId]
|
|
3019
|
-
);
|
|
3020
|
-
const state = data ?? EMPTY;
|
|
3021
|
-
return {
|
|
3022
|
-
accounts: state.accounts,
|
|
3023
|
-
activeAccountId: state.activeAccountId,
|
|
3024
|
-
settings: state.settings,
|
|
3025
|
-
loading,
|
|
3026
|
-
refresh,
|
|
3027
|
-
activate,
|
|
3028
|
-
activating,
|
|
3029
|
-
mutationError
|
|
3030
|
-
};
|
|
3031
|
-
}
|
|
3032
|
-
|
|
3033
|
-
export {
|
|
3034
|
-
sessionAuthRecommendation,
|
|
3035
|
-
SessionConnectionRequest,
|
|
3036
|
-
useVideoArtifactPlaybackLoader,
|
|
3037
|
-
useScheduledTasks,
|
|
3038
|
-
useWorkspaceBackgroundCommands,
|
|
3039
|
-
useWorkspaces,
|
|
3040
|
-
useBillingUsage,
|
|
3041
|
-
useSessionCapabilities,
|
|
3042
|
-
useSandboxTerminal,
|
|
3043
|
-
useSandboxGit,
|
|
3044
|
-
useWorkspaceCapture,
|
|
3045
|
-
useWorkspaceEdit,
|
|
3046
|
-
sessionDisplayTitle,
|
|
3047
|
-
FleetTile,
|
|
3048
|
-
DiffView,
|
|
3049
|
-
WORKBENCH_TAB_CHANGES,
|
|
3050
|
-
WORKBENCH_TAB_FILES,
|
|
3051
|
-
WORKBENCH_TAB_TERMINAL,
|
|
3052
|
-
WORKBENCH_TAB_BROWSER,
|
|
3053
|
-
WORKBENCH_TAB_DESKTOP,
|
|
3054
|
-
WORKBENCH_SURFACES,
|
|
3055
|
-
initialWorkspaceTab,
|
|
3056
|
-
useSandboxWorkspaceTabs,
|
|
3057
|
-
SandboxWorkspace,
|
|
3058
|
-
useSuperGrokAccounts,
|
|
3059
|
-
asVaultClient,
|
|
3060
|
-
vaultsApi,
|
|
3061
|
-
vaultErrorCode,
|
|
3062
|
-
vaultErrorDetail,
|
|
3063
|
-
humanizeModelSlug,
|
|
3064
|
-
isRawModelLabel,
|
|
3065
|
-
modelDisplayName2 as modelDisplayName,
|
|
3066
|
-
modelSlug,
|
|
3067
|
-
modelVendor,
|
|
3068
|
-
parseOpenGeniLink
|
|
3069
|
-
};
|
|
3070
|
-
//# sourceMappingURL=chunk-WTZ6OJUY.js.map
|