@opengeni/react 4.0.2 → 4.0.5-canary.39118806767001
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +787 -26
- package/dist/accounts.js +2 -0
- package/dist/accounts.js.map +1 -1
- package/dist/approvals.d.ts +2 -1
- package/dist/artifacts-document.js +6 -3
- package/dist/artifacts-presentation.js +6 -3
- package/dist/artifacts-spreadsheet.d.ts +1 -1
- package/dist/artifacts-spreadsheet.js +6 -3
- package/dist/artifacts.d.ts +5 -1
- package/dist/artifacts.js +542 -278
- package/dist/artifacts.js.map +1 -1
- package/dist/browser-viewer-GEHX3KYE.js +20 -0
- package/dist/capability-catalog-row.d.ts +20 -0
- package/dist/capability-logo-fallback.d.ts +3 -0
- package/dist/chat-interactive-block-5V3BGLXT.js +15 -0
- package/dist/chunk-2DDJ6YH6.js +41 -0
- package/dist/chunk-2DDJ6YH6.js.map +1 -0
- package/dist/chunk-2EGXXUG4.js +1161 -0
- package/dist/chunk-2EGXXUG4.js.map +1 -0
- package/dist/chunk-2XKRY4GF.js +302 -0
- package/dist/chunk-2XKRY4GF.js.map +1 -0
- package/dist/chunk-2ZUUIMBY.js +343 -0
- package/dist/chunk-2ZUUIMBY.js.map +1 -0
- package/dist/chunk-4F4FGCH2.js +34 -0
- package/dist/chunk-4F4FGCH2.js.map +1 -0
- package/dist/{chunk-Z7WBDB4E.js → chunk-4M2MJLY3.js} +848 -867
- package/dist/chunk-4M2MJLY3.js.map +1 -0
- package/dist/chunk-4U7SHFQ2.js +193 -0
- package/dist/chunk-4U7SHFQ2.js.map +1 -0
- package/dist/chunk-5I4VRWBB.js +56 -0
- package/dist/chunk-5I4VRWBB.js.map +1 -0
- package/dist/{chunk-24M4YBCL.js → chunk-62XZ3IX3.js} +1751 -845
- package/dist/chunk-62XZ3IX3.js.map +1 -0
- package/dist/chunk-77THWHSU.js +308 -0
- package/dist/chunk-77THWHSU.js.map +1 -0
- package/dist/chunk-7CZLTFXF.js +466 -0
- package/dist/chunk-7CZLTFXF.js.map +1 -0
- package/dist/chunk-7N5AD2TC.js +327 -0
- package/dist/chunk-7N5AD2TC.js.map +1 -0
- package/dist/chunk-7SZ7MMCY.js +325 -0
- package/dist/chunk-7SZ7MMCY.js.map +1 -0
- package/dist/chunk-7TG6KTR2.js +3153 -0
- package/dist/chunk-7TG6KTR2.js.map +1 -0
- package/dist/chunk-AIX25FIQ.js +409 -0
- package/dist/chunk-AIX25FIQ.js.map +1 -0
- package/dist/chunk-AT2HD6RQ.js +1936 -0
- package/dist/chunk-AT2HD6RQ.js.map +1 -0
- package/dist/chunk-B27E3V37.js +29 -0
- package/dist/chunk-B27E3V37.js.map +1 -0
- package/dist/{chunk-5M6VTFJ5.js → chunk-B4EDAXMC.js} +37 -13
- package/dist/chunk-B4EDAXMC.js.map +1 -0
- package/dist/chunk-BOG2FED3.js +35 -0
- package/dist/chunk-BOG2FED3.js.map +1 -0
- package/dist/chunk-BQYQU5QW.js +109 -0
- package/dist/chunk-BQYQU5QW.js.map +1 -0
- package/dist/{chunk-PAJU5KKL.js → chunk-BRIOXCLH.js} +68 -25
- package/dist/chunk-BRIOXCLH.js.map +1 -0
- package/dist/chunk-CM7LVUKC.js +35 -0
- package/dist/chunk-CM7LVUKC.js.map +1 -0
- package/dist/{chunk-KCGXPP5V.js → chunk-CXIGFHVL.js} +35 -23
- package/dist/chunk-CXIGFHVL.js.map +1 -0
- package/dist/chunk-DHXKEJBH.js +71 -0
- package/dist/chunk-DHXKEJBH.js.map +1 -0
- package/dist/{chunk-NOSYBS2D.js → chunk-DN3TKURW.js} +12 -9
- package/dist/chunk-DN3TKURW.js.map +1 -0
- package/dist/chunk-DNJ23AWQ.js +35 -0
- package/dist/chunk-DNJ23AWQ.js.map +1 -0
- package/dist/chunk-ESAMXNBZ.js +3237 -0
- package/dist/chunk-ESAMXNBZ.js.map +1 -0
- package/dist/{chunk-4MDLEHXL.js → chunk-EWATYP5L.js} +64 -44
- package/dist/chunk-EWATYP5L.js.map +1 -0
- package/dist/{chunk-YBM6CQRU.js → chunk-FQ5CXNUG.js} +65 -42
- package/dist/chunk-FQ5CXNUG.js.map +1 -0
- package/dist/chunk-HEVQKE27.js +150 -0
- package/dist/chunk-HEVQKE27.js.map +1 -0
- package/dist/chunk-HZ47S3DP.js +1086 -0
- package/dist/chunk-HZ47S3DP.js.map +1 -0
- package/dist/chunk-I5BJ7ENY.js +174 -0
- package/dist/chunk-I5BJ7ENY.js.map +1 -0
- package/dist/chunk-IGFZFLI2.js +1390 -0
- package/dist/chunk-IGFZFLI2.js.map +1 -0
- package/dist/chunk-IGVL3ELX.js +46 -0
- package/dist/chunk-IGVL3ELX.js.map +1 -0
- package/dist/chunk-IOD24LGR.js +384 -0
- package/dist/chunk-IOD24LGR.js.map +1 -0
- package/dist/chunk-IOYHDEP3.js +38 -0
- package/dist/chunk-IOYHDEP3.js.map +1 -0
- package/dist/chunk-IQL77TMM.js +803 -0
- package/dist/chunk-IQL77TMM.js.map +1 -0
- package/dist/chunk-IZV5FTJC.js +55 -0
- package/dist/chunk-IZV5FTJC.js.map +1 -0
- package/dist/{chunk-H5YGYNXS.js → chunk-JAYYFOOB.js} +75 -28
- package/dist/chunk-JAYYFOOB.js.map +1 -0
- package/dist/chunk-KN2MYSCC.js +409 -0
- package/dist/chunk-KN2MYSCC.js.map +1 -0
- package/dist/{chunk-PEI6RANI.js → chunk-KYVJMTXL.js} +434 -145
- package/dist/chunk-KYVJMTXL.js.map +1 -0
- package/dist/{chunk-ZYRGEKWS.js → chunk-LJUMYUBO.js} +3 -1
- package/dist/{chunk-ZYRGEKWS.js.map → chunk-LJUMYUBO.js.map} +1 -1
- package/dist/{chunk-ICA6R6TW.js → chunk-LNUD3JNI.js} +1532 -395
- package/dist/chunk-LNUD3JNI.js.map +1 -0
- package/dist/chunk-M357MHH3.js +2 -0
- package/dist/{chunk-BV5A4OTE.js → chunk-MEL6PH2I.js} +1218 -537
- package/dist/chunk-MEL6PH2I.js.map +1 -0
- package/dist/chunk-MF6WS2XF.js +386 -0
- package/dist/chunk-MF6WS2XF.js.map +1 -0
- package/dist/chunk-MK2TQO4Y.js +24 -0
- package/dist/chunk-MK2TQO4Y.js.map +1 -0
- package/dist/chunk-N7S72EXK.js +25 -0
- package/dist/chunk-N7S72EXK.js.map +1 -0
- package/dist/{chunk-KZ73RL76.js → chunk-NAWXARTY.js} +58 -9
- package/dist/chunk-NAWXARTY.js.map +1 -0
- package/dist/chunk-NX4ADH73.js +14 -0
- package/dist/chunk-NX4ADH73.js.map +1 -0
- package/dist/chunk-OYQQJL3J.js +16 -0
- package/dist/chunk-OYQQJL3J.js.map +1 -0
- package/dist/chunk-P4MKPCTC.js +51 -0
- package/dist/chunk-P4MKPCTC.js.map +1 -0
- package/dist/{chunk-JVYQRRC4.js → chunk-PEHTX3V7.js} +21 -1
- package/dist/chunk-PEHTX3V7.js.map +1 -0
- package/dist/chunk-PMV53IMM.js +26 -0
- package/dist/chunk-PMV53IMM.js.map +1 -0
- package/dist/chunk-PYSEGV5X.js +14396 -0
- package/dist/chunk-PYSEGV5X.js.map +1 -0
- package/dist/{chunk-HUIKIDM5.js → chunk-QOEWDOFW.js} +295 -156
- package/dist/chunk-QOEWDOFW.js.map +1 -0
- package/dist/chunk-QV3DJVRZ.js +11 -0
- package/dist/chunk-QV3DJVRZ.js.map +1 -0
- package/dist/{chunk-HUMIRRYI.js → chunk-QYUYVSNG.js} +1103 -1699
- package/dist/chunk-QYUYVSNG.js.map +1 -0
- package/dist/{chunk-6J56T3MG.js → chunk-RRAQ5FV5.js} +186 -60
- package/dist/chunk-RRAQ5FV5.js.map +1 -0
- package/dist/{chunk-5YK2ZDIG.js → chunk-TNEZNMSN.js} +4 -10
- package/dist/chunk-TNEZNMSN.js.map +1 -0
- package/dist/{chunk-22KP6LR5.js → chunk-TXS65BB2.js} +3 -1
- package/dist/{chunk-22KP6LR5.js.map → chunk-TXS65BB2.js.map} +1 -1
- package/dist/chunk-UIWIOB4U.js +2215 -0
- package/dist/chunk-UIWIOB4U.js.map +1 -0
- package/dist/chunk-UNJPZGNK.js +63 -0
- package/dist/chunk-UNJPZGNK.js.map +1 -0
- package/dist/chunk-V7UGCQHQ.js +86 -0
- package/dist/chunk-V7UGCQHQ.js.map +1 -0
- package/dist/chunk-VU4QUISJ.js +3405 -0
- package/dist/chunk-VU4QUISJ.js.map +1 -0
- package/dist/chunk-WEY5J52U.js +467 -0
- package/dist/chunk-WEY5J52U.js.map +1 -0
- package/dist/chunk-WH2CBESG.js +409 -0
- package/dist/chunk-WH2CBESG.js.map +1 -0
- package/dist/{chunk-VZTQ73XT.js → chunk-XEA5BCMA.js} +3 -1
- package/dist/{chunk-VZTQ73XT.js.map → chunk-XEA5BCMA.js.map} +1 -1
- package/dist/{chunk-NLTS7JHI.js → chunk-XEIHS3RN.js} +834 -403
- package/dist/chunk-XEIHS3RN.js.map +1 -0
- package/dist/chunk-YNXZRE3F.js +408 -0
- package/dist/chunk-YNXZRE3F.js.map +1 -0
- package/dist/chunk-YSRBFJMQ.js +43 -0
- package/dist/chunk-YSRBFJMQ.js.map +1 -0
- package/dist/{chunk-NEXLLTP4.js → chunk-ZGFU4LVW.js} +6 -5
- package/dist/chunk-ZGFU4LVW.js.map +1 -0
- package/dist/chunk-ZO35BAMO.js +172 -0
- package/dist/chunk-ZO35BAMO.js.map +1 -0
- package/dist/chunk-ZUWF4NF7.js +13 -0
- package/dist/chunk-ZUWF4NF7.js.map +1 -0
- package/dist/client.d.ts +15 -6
- package/dist/clipboard.js +3 -1
- package/dist/commands/registry.d.ts +2 -1
- package/dist/commands/types.d.ts +2 -0
- package/dist/components/anthropic-mark.d.ts +3 -0
- package/dist/components/approval-surface.d.ts +21 -7
- package/dist/components/artifacts/artifact-chrome.d.ts +121 -0
- package/dist/components/artifacts/artifact-sandbox.d.ts +30 -0
- package/dist/components/artifacts/artifact-surface.d.ts +4 -2
- package/dist/components/artifacts/chat-interactive-block.d.ts +29 -0
- package/dist/components/artifacts/deferred-chat-media.d.ts +15 -0
- package/dist/components/artifacts/document-editor.d.ts +4 -2
- package/dist/components/artifacts/editable-artifact-ui.d.ts +4 -2
- package/dist/components/artifacts/editable-artifact-view.d.ts +48 -0
- package/dist/components/artifacts/editable-document.d.ts +3 -2
- package/dist/components/artifacts/editable-presentation.d.ts +4 -3
- package/dist/components/artifacts/editable-spreadsheet.d.ts +8 -3
- package/dist/components/artifacts/index.d.ts +8 -1
- package/dist/components/artifacts/inline-html-document.d.ts +2 -0
- package/dist/components/artifacts/latest-task-runner.d.ts +15 -0
- package/dist/components/artifacts/presentation-editor.d.ts +6 -2
- package/dist/components/artifacts/published-html-artifact-frame.d.ts +17 -40
- package/dist/components/artifacts/session-artifact-viewer.d.ts +39 -0
- package/dist/components/artifacts/site-view.d.ts +26 -0
- package/dist/components/artifacts/spreadsheet-command-queue.d.ts +20 -0
- package/dist/components/artifacts/spreadsheet-download.d.ts +7 -0
- package/dist/components/artifacts/spreadsheet-general-display.d.ts +24 -0
- package/dist/components/artifacts/spreadsheet-grid.d.ts +11 -4
- package/dist/components/artifacts/spreadsheet-resize.d.ts +50 -0
- package/dist/components/artifacts/spreadsheet-submissions.d.ts +9 -0
- package/dist/components/artifacts/visualization-assets.gen.d.ts +2 -0
- package/dist/components/browser-select-control.d.ts +16 -0
- package/dist/components/browser-viewer.d.ts +11 -2
- package/dist/components/chat-composer.d.ts +21 -3
- package/dist/components/child-session-link.d.ts +5 -1
- package/dist/components/claude-mark.d.ts +3 -0
- package/dist/components/code-editor.d.ts +1 -4
- package/dist/components/command-palette.d.ts +1 -1
- package/dist/components/composer-transcription-control.d.ts +7 -0
- package/dist/components/composer.d.ts +30 -67
- package/dist/components/computer-viewer.d.ts +1 -1
- package/dist/components/copy-button.d.ts +3 -1
- package/dist/components/desktop-viewer.d.ts +1 -1
- package/dist/components/generated-video-player.d.ts +1 -1
- package/dist/components/grok-mark.d.ts +26 -0
- package/dist/components/human-input-form.d.ts +26 -32
- package/dist/components/human-input-surface.d.ts +5 -1
- package/dist/components/linkified-text.d.ts +18 -0
- package/dist/components/machine-input-display.d.ts +25 -3
- package/dist/components/machine-status-pill.d.ts +3 -2
- package/dist/components/machines/agent-status-icon.d.ts +6 -0
- package/dist/components/machines/health.d.ts +2 -1
- package/dist/components/machines/machine-detail.d.ts +7 -1
- package/dist/components/machines/machine-status.d.ts +49 -0
- package/dist/components/machines/metric-history-chart.d.ts +1 -1
- package/dist/components/machines/series.d.ts +3 -2
- package/dist/components/markdown-table-layout.d.ts +11 -2
- package/dist/components/markdown.d.ts +37 -4
- package/dist/components/message-timeline.d.ts +79 -7
- package/dist/components/model-mark.d.ts +29 -0
- package/dist/components/model-picker.d.ts +1 -1
- package/dist/components/model-policy-picker.d.ts +31 -22
- package/dist/components/new-conversation.d.ts +32 -0
- package/dist/components/open-geni-chat.d.ts +73 -0
- package/dist/components/open-geni-links.d.ts +69 -0
- package/dist/components/openrouter-mark.d.ts +6 -0
- package/dist/components/opper-mark.d.ts +7 -0
- package/dist/components/preview-loading.d.ts +2 -0
- package/dist/components/provider-recovery-notice.d.ts +17 -0
- package/dist/components/queue-item-content.d.ts +10 -0
- package/dist/components/rehype-secret-refs.d.ts +23 -0
- package/dist/components/remark-soft-line-breaks.d.ts +38 -0
- package/dist/components/sandbox-workspace.d.ts +18 -0
- package/dist/components/secret-question-field.d.ts +31 -0
- package/dist/components/secret-ref-chip.d.ts +35 -0
- package/dist/components/session-capability-frame.d.ts +37 -0
- package/dist/components/session-chrome.d.ts +20 -7
- package/dist/components/session-commands.d.ts +6 -0
- package/dist/components/session-connection-request.d.ts +8 -0
- package/dist/components/session-conversation.d.ts +147 -6
- package/dist/components/session-list.d.ts +39 -0
- package/dist/components/session-mcp-capability-card.d.ts +41 -0
- package/dist/components/session-proxy-scope.d.ts +35 -0
- package/dist/components/session-status.d.ts +6 -2
- package/dist/components/session-usage-limit-notice.d.ts +39 -0
- package/dist/components/this-computer/illustrations.d.ts +38 -0
- package/dist/components/this-computer/labels.d.ts +111 -0
- package/dist/components/this-computer/this-computer-card.d.ts +40 -0
- package/dist/components/this-computer/this-computer-setup.d.ts +35 -0
- package/dist/components/this-computer/this-computer-status.d.ts +42 -0
- package/dist/components/this-computer/use-this-computer.d.ts +29 -0
- package/dist/components/timeline-anchor.d.ts +3 -0
- package/dist/components/timeline-annotation-shared.d.ts +3 -2
- package/dist/components/timeline-annotations-dialog.d.ts +2 -1
- package/dist/components/timeline-annotations.d.ts +5 -1
- package/dist/components/timeline-reading-progress.d.ts +11 -0
- package/dist/components/timeline-search.d.ts +34 -0
- package/dist/components/timeline-settlement.d.ts +16 -0
- package/dist/components/tool-action-review.d.ts +48 -0
- package/dist/components/tool-review-history.d.ts +25 -0
- package/dist/components/usage-limit-notice.d.ts +50 -0
- package/dist/components/usage-member-list.d.ts +92 -0
- package/dist/components/usage-meter.d.ts +74 -0
- package/dist/components/use-viewer-menu-dismiss.d.ts +2 -0
- package/dist/components/user-message-body.d.ts +10 -1
- package/dist/components/workbench-changes.d.ts +2 -1
- package/dist/composer-messages.d.ts +75 -0
- package/dist/composer-messages.js +9 -0
- package/dist/composer-messages.js.map +1 -0
- package/dist/composer-voice-events.d.ts +8 -0
- package/dist/composer.d.ts +3 -3
- package/dist/composer.js +25 -12
- package/dist/computer-viewer-VOIOZGVZ.js +21 -0
- package/dist/computer-viewer-VOIOZGVZ.js.map +1 -0
- package/dist/connect-account-identity.d.ts +8 -0
- package/dist/connect-accounts.d.ts +15 -0
- package/dist/connect-chooser.d.ts +18 -0
- package/dist/connect-panel.d.ts +18 -0
- package/dist/connect-setup.d.ts +18 -0
- package/dist/connect.d.ts +21 -0
- package/dist/connect.js +2216 -0
- package/dist/connect.js.map +1 -0
- package/dist/connection-catalog.d.ts +38 -0
- package/dist/connection-discovery.d.ts +12 -0
- package/dist/connection-installed.d.ts +17 -0
- package/dist/connection-logo.d.ts +9 -0
- package/dist/connection-service-logo.d.ts +8 -0
- package/dist/connection-service-presentation.d.ts +13 -0
- package/dist/connection-skeleton.d.ts +5 -0
- package/dist/connection-type-picker.d.ts +6 -0
- package/dist/conversation-timeline.d.ts +1 -1
- package/dist/desktop.d.ts +7 -0
- package/dist/desktop.js +28 -0
- package/dist/desktop.js.map +1 -0
- package/dist/device-authorization.d.ts +23 -0
- package/dist/diffs.d.ts +8 -0
- package/dist/diffs.js +15 -0
- package/dist/diffs.js.map +1 -0
- package/dist/discovery-cache.d.ts +5 -0
- package/dist/editor.d.ts +7 -0
- package/dist/editor.js +23 -0
- package/dist/editor.js.map +1 -0
- package/dist/embedded-new-voice-KPLC5UJZ.js +19 -0
- package/dist/embedded-new-voice-KPLC5UJZ.js.map +1 -0
- package/dist/embedded-voice-V2RFSLIU.js +19 -0
- package/dist/embedded-voice-V2RFSLIU.js.map +1 -0
- package/dist/fleet-decision-row-FE73NSQ6.js +361 -0
- package/dist/fleet-decision-row-FE73NSQ6.js.map +1 -0
- package/dist/hooks/internal.d.ts +27 -2
- package/dist/hooks/latest-question.d.ts +26 -0
- package/dist/hooks/session-view-cache.d.ts +38 -0
- package/dist/hooks/shared-machines-list.d.ts +4 -0
- package/dist/hooks/shared-query.d.ts +123 -0
- package/dist/hooks/use-attached-browsers.d.ts +1 -1
- package/dist/hooks/use-auth-runs.d.ts +1 -4
- package/dist/hooks/use-available-models.d.ts +8 -3
- package/dist/hooks/use-browser-frame-stream.d.ts +1 -1
- package/dist/hooks/use-browser-session.d.ts +12 -1
- package/dist/hooks/use-client-config-flags.d.ts +49 -0
- package/dist/hooks/use-codex-accounts.d.ts +48 -9
- package/dist/hooks/use-composer.d.ts +24 -3
- package/dist/hooks/use-computer-frame-stream.d.ts +1 -1
- package/dist/hooks/use-computer-input-posture.d.ts +13 -0
- package/dist/hooks/use-computer-session.d.ts +5 -0
- package/dist/hooks/use-connect.d.ts +23 -0
- package/dist/hooks/use-desktop-stream.d.ts +1 -1
- package/dist/hooks/use-file-attachments.d.ts +4 -0
- package/dist/hooks/use-goal.d.ts +2 -1
- package/dist/hooks/use-last-started-turn-policy.d.ts +5 -1
- package/dist/hooks/use-machine-chip.d.ts +3 -2
- package/dist/hooks/use-new-conversation.d.ts +56 -0
- package/dist/hooks/use-new-session-draft.d.ts +74 -0
- package/dist/hooks/use-realtime-voice-models.d.ts +7 -0
- package/dist/hooks/use-sandbox-files.d.ts +3 -2
- package/dist/hooks/use-session-conversation.d.ts +49 -0
- package/dist/hooks/use-session-events.d.ts +21 -2
- package/dist/hooks/use-session-mcp-approval-policy.d.ts +2 -2
- package/dist/hooks/use-session-model-account.d.ts +48 -0
- package/dist/hooks/use-supergrok-accounts.d.ts +7 -1
- package/dist/hooks/use-terminal-stream.d.ts +11 -5
- package/dist/hooks/use-transcription.d.ts +2 -1
- package/dist/hooks/use-usage.d.ts +40 -0
- package/dist/hooks/use-vaults.d.ts +53 -0
- package/dist/hooks/use-voice-input.d.ts +8 -1
- package/dist/hooks/use-workspace-sessions.d.ts +24 -5
- package/dist/human-input-model.d.ts +123 -0
- package/dist/identity-link-accounts.d.ts +11 -0
- package/dist/identity-link-consent.d.ts +18 -0
- package/dist/index.d.ts +83 -18
- package/dist/index.js +2317 -6453
- package/dist/index.js.map +1 -1
- package/dist/interaction.d.ts +1 -1
- package/dist/interaction.js +20 -29
- package/dist/interaction.js.map +1 -1
- package/dist/latest-question-SXBXROBT.js +118 -0
- package/dist/latest-question-SXBXROBT.js.map +1 -0
- package/dist/lib/client-config-read.d.ts +31 -0
- package/dist/lib/clipboard.d.ts +7 -0
- package/dist/lib/error-message.d.ts +7 -0
- package/dist/lib/format.d.ts +59 -9
- package/dist/lib/host-theme.d.ts +77 -0
- package/dist/lib/interaction-errors.d.ts +3 -0
- package/dist/lib/menu-styles.d.ts +22 -0
- package/dist/lib/notify-observer.d.ts +2 -0
- package/dist/lib/pierre-diffs-loader.d.ts +20 -0
- package/dist/lib/provider-recovery.d.ts +56 -0
- package/dist/lib/scrollbars.d.ts +11 -0
- package/dist/lib/terminal-input-readiness.d.ts +11 -0
- package/dist/lib/transient-retry.d.ts +26 -0
- package/dist/lib/workbench-peers.d.ts +36 -0
- package/dist/lib/xterm-theme.d.ts +7 -5
- package/dist/machines.js +12 -6
- package/dist/{markdown-table-layout-3Z3AWBY7.js → markdown-table-layout-3PV2UAAH.js} +51 -9
- package/dist/markdown-table-layout-3PV2UAAH.js.map +1 -0
- package/dist/mcp-connection-status.d.ts +15 -0
- package/dist/messages/en.d.ts +3328 -0
- package/dist/messages/runtime.d.ts +69 -0
- package/dist/messages.d.ts +3 -0
- package/dist/messages.js +16 -0
- package/dist/messages.js.map +1 -0
- package/dist/model-mark-paths.d.ts +34 -0
- package/dist/model-mark-paths.js +16 -0
- package/dist/model-mark-paths.js.map +1 -0
- package/dist/model-picker-model.d.ts +112 -0
- package/dist/model-picker-model.js +25 -0
- package/dist/model-picker-model.js.map +1 -0
- package/dist/model-policy-picker-menu-NWIETWSR.js +18 -0
- package/dist/model-policy-picker-menu-NWIETWSR.js.map +1 -0
- package/dist/model-policy.d.ts +35 -10
- package/dist/model-policy.js +12 -1
- package/dist/native-previews.d.ts +29 -0
- package/dist/native-previews.js +82 -0
- package/dist/native-previews.js.map +1 -0
- package/dist/new-session-draft.d.ts +7 -0
- package/dist/new-session-draft.js +639 -0
- package/dist/new-session-draft.js.map +1 -0
- package/dist/notification-text.d.ts +27 -0
- package/dist/{noto-sans-arabic-loader-IA2T4X2A.js → noto-sans-arabic-loader-XSH2KYWJ.js} +3 -1
- package/dist/{noto-sans-arabic-loader-IA2T4X2A.js.map → noto-sans-arabic-loader-XSH2KYWJ.js.map} +1 -1
- package/dist/{noto-sans-jp-loader.generated-HFGLYBR3.js → noto-sans-jp-loader.generated-MR5L6V7K.js} +3 -1
- package/dist/{noto-sans-jp-loader.generated-HFGLYBR3.js.map → noto-sans-jp-loader.generated-MR5L6V7K.js.map} +1 -1
- package/dist/organization-model.d.ts +33 -0
- package/dist/organization-model.js +65 -0
- package/dist/organization-model.js.map +1 -0
- package/dist/platform-activity-row-VSQ2FZ5T.js +119 -0
- package/dist/platform-activity-row-VSQ2FZ5T.js.map +1 -0
- package/dist/plugin-details.d.ts +14 -0
- package/dist/plugin-discovery.d.ts +25 -0
- package/dist/preview-loading-paint.d.ts +20 -0
- package/dist/provider.d.ts +37 -2
- package/dist/queue-presentation-model.d.ts +73 -0
- package/dist/queue-presentation-model.js +38 -0
- package/dist/queue-presentation-model.js.map +1 -0
- package/dist/{queue-surface-implementation-LK3S4BIW.js → queue-surface-implementation-MEKXXWGR.js} +189 -343
- package/dist/queue-surface-implementation-MEKXXWGR.js.map +1 -0
- package/dist/realtime/embedded-new-voice.d.ts +1 -0
- package/dist/realtime/embedded-voice.d.ts +1 -0
- package/dist/realtime/realtime-control.d.ts +4 -65
- package/dist/realtime/session-realtime.d.ts +79 -0
- package/dist/realtime.js +26 -1333
- package/dist/realtime.js.map +1 -1
- package/dist/sandbox-files-5NRC2QUT.js +24 -0
- package/dist/sandbox-files-5NRC2QUT.js.map +1 -0
- package/dist/sandbox-label-model.d.ts +31 -0
- package/dist/sandbox-label-model.js +20 -0
- package/dist/sandbox-label-model.js.map +1 -0
- package/dist/scrollbars.d.ts +1 -0
- package/dist/scrollbars.js +10 -0
- package/dist/scrollbars.js.map +1 -0
- package/dist/secret-reference-label.d.ts +15 -0
- package/dist/secrets-ui.d.ts +57 -0
- package/dist/session-agents-model.d.ts +11 -0
- package/dist/session-agents-model.js +25 -0
- package/dist/session-agents-model.js.map +1 -0
- package/dist/session-attention-model.d.ts +8 -0
- package/dist/session-attention-model.js +47 -0
- package/dist/session-attention-model.js.map +1 -0
- package/dist/session-auth-recommendation.d.ts +6 -0
- package/dist/session-capability-policy.d.ts +32 -0
- package/dist/session-context.d.ts +9 -1
- package/dist/session-feedback-model.d.ts +21 -0
- package/dist/session-feedback-model.js +56 -0
- package/dist/session-feedback-model.js.map +1 -0
- package/dist/session-list-model.d.ts +139 -0
- package/dist/session-list-model.js +274 -0
- package/dist/session-list-model.js.map +1 -0
- package/dist/session-realtime-OZCE6IKP.js +22 -0
- package/dist/session-realtime-OZCE6IKP.js.map +1 -0
- package/dist/session-realtime.d.ts +7 -0
- package/dist/session-realtime.js +20 -0
- package/dist/session-realtime.js.map +1 -0
- package/dist/session-status-model.d.ts +37 -0
- package/dist/session-ui.d.ts +40 -3
- package/dist/session-ui.js +127 -21
- package/dist/session-ui.js.map +1 -1
- package/dist/session.d.ts +10 -2
- package/dist/session.js +44 -20
- package/dist/site-snapshot.d.ts +14 -0
- package/dist/sites-ui.d.ts +24 -0
- package/dist/sites.d.ts +3 -0
- package/dist/sites.js +15 -0
- package/dist/sites.js.map +1 -0
- package/dist/skill-discovery.d.ts +47 -0
- package/dist/terminal.d.ts +8 -0
- package/dist/terminal.js +33 -0
- package/dist/terminal.js.map +1 -0
- package/dist/testing/session-scenarios.d.ts +10 -0
- package/dist/testing/session-scenarios.js +367 -0
- package/dist/testing/session-scenarios.js.map +1 -0
- package/dist/this-computer.d.ts +8 -0
- package/dist/this-computer.js +1042 -0
- package/dist/this-computer.js.map +1 -0
- package/dist/timeline/activity-rail.d.ts +12 -2
- package/dist/timeline/agent-identity.d.ts +30 -0
- package/dist/timeline/agent-row.d.ts +31 -0
- package/dist/timeline/allowance-exhausted-row.d.ts +24 -0
- package/dist/timeline/compaction-copy.d.ts +47 -0
- package/dist/timeline/focus-sequence.d.ts +9 -0
- package/dist/timeline/genie-copy.d.ts +4 -0
- package/dist/timeline/genie-loading.d.ts +48 -0
- package/dist/timeline/index.d.ts +12 -5
- package/dist/timeline/invoked-tool.d.ts +6 -0
- package/dist/timeline/knowledge-receipt.d.ts +17 -0
- package/dist/timeline/learning-refusal-copy.d.ts +23 -0
- package/dist/timeline/learning-refusal-row.d.ts +19 -0
- package/dist/timeline/message-sender.d.ts +19 -0
- package/dist/timeline/notice-presentation.d.ts +14 -0
- package/dist/timeline/parsers.d.ts +11 -0
- package/dist/timeline/patch-apply-command.d.ts +19 -0
- package/dist/timeline/platform-activity-presentation.d.ts +26 -0
- package/dist/timeline/platform-activity-row.d.ts +1 -2
- package/dist/timeline/presented-image.d.ts +11 -0
- package/dist/timeline/projection.d.ts +32 -2
- package/dist/timeline/provider-logo.d.ts +15 -0
- package/dist/timeline/question-nav-model.d.ts +23 -0
- package/dist/timeline/registry.d.ts +10 -1
- package/dist/timeline/retained-image.d.ts +18 -0
- package/dist/timeline/retained-loaders.d.ts +27 -0
- package/dist/timeline/rolling-activity.d.ts +11 -0
- package/dist/timeline/screenshot-lightbox.d.ts +23 -1
- package/dist/timeline/session-usage-limit-row.d.ts +11 -0
- package/dist/timeline/shared.d.ts +8 -3
- package/dist/timeline/startup-dispatch-details.d.ts +5 -0
- package/dist/timeline/startup-preference.d.ts +3 -0
- package/dist/timeline/startup-timings.d.ts +4 -0
- package/dist/timeline/tool-display-name.d.ts +6 -2
- package/dist/timeline/tool-presentation.d.ts +185 -0
- package/dist/timeline/turn-summary-model.d.ts +102 -0
- package/dist/timeline/turn-summary.d.ts +20 -54
- package/dist/timeline/types.d.ts +184 -7
- package/dist/timeline/work-presentation.d.ts +61 -0
- package/dist/{timeline-annotation-markers-DRSTLEM6.js → timeline-annotation-markers-HYLRTT6S.js} +11 -6
- package/dist/timeline-annotation-markers-HYLRTT6S.js.map +1 -0
- package/dist/{timeline-annotation-selection-IHLUGVND.js → timeline-annotation-selection-LBKW5GHA.js} +15 -5
- package/dist/timeline-annotation-selection-LBKW5GHA.js.map +1 -0
- package/dist/{timeline-annotations-dialog-6Q53N5FG.js → timeline-annotations-dialog-JKVINC42.js} +34 -19
- package/dist/timeline-annotations-dialog-JKVINC42.js.map +1 -0
- package/dist/timeline-model.d.ts +29 -0
- package/dist/timeline-model.js +254 -0
- package/dist/timeline-model.js.map +1 -0
- package/dist/usage/allowance-copy.d.ts +26 -0
- package/dist/usage/session-usage-limit.d.ts +89 -0
- package/dist/usage/summary.d.ts +35 -0
- package/dist/usage.d.ts +17 -0
- package/dist/usage.js +1201 -0
- package/dist/usage.js.map +1 -0
- package/dist/voice-recording-owner.d.ts +7 -0
- package/package.json +119 -7
- package/src/approvals.ts +8 -1
- package/src/artifacts-spreadsheet.ts +1 -0
- package/src/artifacts.ts +41 -0
- package/src/assets/README.md +8 -0
- package/src/assets/gmail.ico +0 -0
- package/src/assets/outlook.ico +0 -0
- package/src/capability-catalog-row.tsx +96 -0
- package/src/capability-logo-fallback.ts +22 -0
- package/src/client.ts +18 -30
- package/src/commands/registry.ts +46 -36
- package/src/commands/types.ts +2 -0
- package/src/components/anthropic-mark.tsx +10 -0
- package/src/components/approval-surface.tsx +407 -142
- package/src/components/artifacts/artifact-chrome.tsx +425 -0
- package/src/components/artifacts/artifact-sandbox.tsx +193 -0
- package/src/components/artifacts/artifact-surface.tsx +48 -26
- package/src/components/artifacts/chat-interactive-block.tsx +260 -0
- package/src/components/artifacts/deferred-chat-media.tsx +72 -0
- package/src/components/artifacts/document-editor.tsx +193 -45
- package/src/components/artifacts/editable-artifact-ui.tsx +23 -11
- package/src/components/artifacts/editable-artifact-view.tsx +199 -0
- package/src/components/artifacts/editable-artifact-workbench.tsx +8 -3
- package/src/components/artifacts/editable-document.tsx +76 -54
- package/src/components/artifacts/editable-presentation.tsx +86 -40
- package/src/components/artifacts/editable-spreadsheet.tsx +581 -121
- package/src/components/artifacts/index.ts +42 -0
- package/src/components/artifacts/inline-html-document.ts +24 -0
- package/src/components/artifacts/latest-task-runner.ts +49 -0
- package/src/components/artifacts/presentation-editor.tsx +422 -122
- package/src/components/artifacts/published-html-artifact-frame.tsx +79 -265
- package/src/components/artifacts/session-artifact-viewer.tsx +381 -0
- package/src/components/artifacts/site-view.tsx +129 -0
- package/src/components/artifacts/spreadsheet-canvas.ts +5 -10
- package/src/components/artifacts/spreadsheet-command-queue.ts +190 -0
- package/src/components/artifacts/spreadsheet-download.tsx +117 -0
- package/src/components/artifacts/spreadsheet-general-display.ts +43 -0
- package/src/components/artifacts/spreadsheet-grid.tsx +390 -172
- package/src/components/artifacts/spreadsheet-resize.tsx +432 -0
- package/src/components/artifacts/spreadsheet-submissions.tsx +46 -0
- package/src/components/artifacts/visualization-assets/base.css +1015 -0
- package/src/components/artifacts/visualization-assets/helpers.html +349 -0
- package/src/components/artifacts/visualization-assets.gen.ts +3 -0
- package/src/components/browser-select-control.tsx +320 -0
- package/src/components/browser-viewer.tsx +1102 -505
- package/src/components/chat-composer.tsx +42 -3
- package/src/components/child-session-link.tsx +16 -5
- package/src/components/claude-mark.tsx +11 -0
- package/src/components/code-editor.tsx +38 -27
- package/src/components/command-palette.tsx +4 -1
- package/src/components/composer-transcription-control.tsx +151 -50
- package/src/components/composer.tsx +281 -176
- package/src/components/computer-viewer.tsx +1013 -341
- package/src/components/copy-button.tsx +17 -7
- package/src/components/desktop-viewer.tsx +42 -33
- package/src/components/diff-view.tsx +3 -1
- package/src/components/enrollment-consent.tsx +39 -34
- package/src/components/enrollment-device-flow.tsx +31 -19
- package/src/components/file-browser.tsx +47 -35
- package/src/components/fleet-tile.tsx +8 -4
- package/src/components/generated-video-player.tsx +10 -5
- package/src/components/grok-mark.tsx +34 -0
- package/src/components/human-input-form.tsx +438 -251
- package/src/components/human-input-surface.tsx +8 -0
- package/src/components/interaction-intervention-banner.tsx +15 -13
- package/src/components/linkified-text.tsx +79 -0
- package/src/components/machine-card.tsx +56 -89
- package/src/components/machine-dock-bar.tsx +10 -4
- package/src/components/machine-health-pill.tsx +4 -2
- package/src/components/machine-input-display.ts +309 -34
- package/src/components/machine-metrics.tsx +10 -7
- package/src/components/machine-status-pill.tsx +23 -15
- package/src/components/machines/agent-status-icon.tsx +31 -0
- package/src/components/machines/health.ts +53 -10
- package/src/components/machines/machine-detail.tsx +230 -42
- package/src/components/machines/machine-operation-policy.tsx +36 -29
- package/src/components/machines/machine-status.ts +264 -0
- package/src/components/machines/metric-history-chart.tsx +8 -2
- package/src/components/machines/series.ts +12 -11
- package/src/components/machines-dashboard.tsx +16 -9
- package/src/components/markdown-table-layout.ts +67 -9
- package/src/components/markdown.tsx +470 -133
- package/src/components/message-timeline.tsx +2290 -752
- package/src/components/model-mark.tsx +102 -0
- package/src/components/model-picker.tsx +27 -9
- package/src/components/model-policy-picker-menu.tsx +204 -100
- package/src/components/model-policy-picker.tsx +215 -152
- package/src/components/new-conversation.tsx +223 -0
- package/src/components/open-geni-chat.tsx +311 -0
- package/src/components/open-geni-links.tsx +183 -0
- package/src/components/openrouter-mark.tsx +13 -0
- package/src/components/opper-mark.tsx +18 -0
- package/src/components/pierre-diff.tsx +47 -19
- package/src/components/pierre-file.tsx +38 -11
- package/src/components/preview-loading.tsx +111 -0
- package/src/components/provider-recovery-notice.tsx +51 -0
- package/src/components/queue-item-content.ts +16 -0
- package/src/components/queue-surface-implementation.tsx +185 -420
- package/src/components/queue-surface-state.tsx +13 -8
- package/src/components/queue-surface.tsx +3 -1
- package/src/components/rehype-secret-refs.ts +98 -0
- package/src/components/remark-soft-line-breaks.ts +166 -0
- package/src/components/sandbox-files.tsx +75 -44
- package/src/components/sandbox-terminal.tsx +103 -22
- package/src/components/sandbox-workspace.tsx +168 -78
- package/src/components/secret-question-field.tsx +326 -0
- package/src/components/secret-ref-chip.tsx +187 -0
- package/src/components/session-capability-frame.tsx +203 -0
- package/src/components/session-chrome.tsx +559 -328
- package/src/components/session-commands-panel.tsx +34 -17
- package/src/components/session-commands.tsx +18 -0
- package/src/components/session-connection-request.tsx +99 -0
- package/src/components/session-conversation.tsx +853 -118
- package/src/components/session-list.tsx +259 -0
- package/src/components/session-mcp-capability-card.tsx +681 -0
- package/src/components/session-proxy-scope.tsx +160 -0
- package/src/components/session-status.tsx +35 -21
- package/src/components/session-usage-limit-notice.tsx +176 -0
- package/src/components/this-computer/illustrations.tsx +164 -0
- package/src/components/this-computer/labels.ts +234 -0
- package/src/components/this-computer/this-computer-card.tsx +203 -0
- package/src/components/this-computer/this-computer-setup.tsx +433 -0
- package/src/components/this-computer/this-computer-status.tsx +329 -0
- package/src/components/this-computer/use-this-computer.ts +183 -0
- package/src/components/timeline-anchor.tsx +43 -15
- package/src/components/timeline-annotation-chrome.tsx +33 -9
- package/src/components/timeline-annotation-markers.tsx +4 -2
- package/src/components/timeline-annotation-selection.tsx +11 -2
- package/src/components/timeline-annotation-shared.ts +9 -8
- package/src/components/timeline-annotations-dialog.tsx +30 -9
- package/src/components/timeline-annotations.tsx +24 -7
- package/src/components/timeline-reading-progress.ts +80 -0
- package/src/components/timeline-search.tsx +168 -0
- package/src/components/timeline-settlement.ts +60 -0
- package/src/components/tool-action-review.tsx +670 -0
- package/src/components/tool-review-history.tsx +88 -0
- package/src/components/usage-limit-notice.tsx +183 -0
- package/src/components/usage-member-list.tsx +797 -0
- package/src/components/usage-meter.tsx +386 -0
- package/src/components/use-viewer-menu-dismiss.ts +33 -0
- package/src/components/user-message-body.tsx +33 -2
- package/src/components/workbench-changes.tsx +28 -16
- package/src/components/workspace-dock.tsx +45 -13
- package/src/composer-messages.ts +153 -0
- package/src/composer-voice-events.ts +12 -0
- package/src/composer.ts +4 -0
- package/src/connect-account-identity.tsx +38 -0
- package/src/connect-accounts.tsx +233 -0
- package/src/connect-chooser.tsx +339 -0
- package/src/connect-panel.tsx +104 -0
- package/src/connect-setup.tsx +354 -0
- package/src/connect.ts +60 -0
- package/src/connection-assets.d.ts +4 -0
- package/src/connection-catalog.tsx +175 -0
- package/src/connection-discovery.tsx +251 -0
- package/src/connection-installed.tsx +56 -0
- package/src/connection-logo.tsx +37 -0
- package/src/connection-service-logo.tsx +55 -0
- package/src/connection-service-presentation.ts +46 -0
- package/src/connection-skeleton.tsx +16 -0
- package/src/connection-type-picker.tsx +38 -0
- package/src/conversation-timeline.ts +11 -2
- package/src/desktop.ts +24 -0
- package/src/device-authorization.tsx +111 -0
- package/src/diffs.ts +16 -0
- package/src/discovery-cache.ts +42 -0
- package/src/editor.ts +13 -0
- package/src/hooks/internal.ts +93 -10
- package/src/hooks/latest-question.ts +168 -0
- package/src/hooks/session-view-cache.ts +167 -0
- package/src/hooks/shared-machines-list.ts +34 -1
- package/src/hooks/shared-query.ts +744 -0
- package/src/hooks/use-attached-browsers.ts +1 -1
- package/src/hooks/use-auth-runs.ts +0 -27
- package/src/hooks/use-available-models.ts +20 -10
- package/src/hooks/use-browser-frame-stream.ts +23 -4
- package/src/hooks/use-browser-session.ts +684 -206
- package/src/hooks/use-browser-sessions.ts +32 -1
- package/src/hooks/use-client-config-flags.ts +102 -0
- package/src/hooks/use-codex-accounts.ts +216 -43
- package/src/hooks/use-composer.ts +240 -59
- package/src/hooks/use-computer-frame-stream.ts +29 -9
- package/src/hooks/use-computer-input-posture.ts +96 -0
- package/src/hooks/use-computer-session.ts +419 -100
- package/src/hooks/use-connect.ts +23 -0
- package/src/hooks/use-desktop-stream.ts +19 -28
- package/src/hooks/use-file-attachments.ts +19 -3
- package/src/hooks/use-goal.ts +172 -21
- package/src/hooks/use-human-input.ts +16 -2
- package/src/hooks/use-last-started-turn-policy.ts +37 -11
- package/src/hooks/use-machine-chip.ts +13 -8
- package/src/hooks/use-machines.ts +24 -10
- package/src/hooks/use-new-conversation.ts +377 -0
- package/src/hooks/use-new-session-draft.ts +813 -0
- package/src/hooks/use-realtime-voice-models.ts +46 -0
- package/src/hooks/use-sandbox-files.ts +22 -16
- package/src/hooks/use-session-background-commands.ts +2 -2
- package/src/hooks/use-session-capabilities.ts +3 -2
- package/src/hooks/use-session-conversation.ts +150 -0
- package/src/hooks/use-session-events.ts +403 -64
- package/src/hooks/use-session-lineage.ts +47 -9
- package/src/hooks/use-session-mcp-approval-policy.ts +13 -5
- package/src/hooks/use-session-model-account.ts +174 -0
- package/src/hooks/use-session.ts +19 -3
- package/src/hooks/use-slash-commands.ts +6 -11
- package/src/hooks/use-supergrok-accounts.ts +22 -8
- package/src/hooks/use-terminal-stream.ts +153 -27
- package/src/hooks/use-transcription.ts +45 -19
- package/src/hooks/use-turn-queue.ts +25 -5
- package/src/hooks/use-usage.ts +100 -0
- package/src/hooks/use-vaults.ts +153 -0
- package/src/hooks/use-video-artifact-playback.ts +1 -1
- package/src/hooks/use-voice-input.ts +127 -19
- package/src/hooks/use-workspace-capture.ts +3 -2
- package/src/hooks/use-workspace-sessions.ts +74 -7
- package/src/human-input-model.ts +374 -0
- package/src/identity-link-accounts.tsx +149 -0
- package/src/identity-link-consent.tsx +193 -0
- package/src/index.ts +282 -16
- package/src/interaction.ts +1 -0
- package/src/lib/client-config-read.ts +76 -0
- package/src/lib/clipboard.ts +29 -0
- package/src/lib/error-message.ts +37 -0
- package/src/lib/format.ts +231 -36
- package/src/lib/host-theme.ts +529 -0
- package/src/lib/interaction-errors.ts +15 -0
- package/src/lib/menu-styles.ts +44 -0
- package/src/lib/notify-observer.ts +15 -0
- package/src/lib/pierre-diffs-loader.ts +53 -0
- package/src/lib/provider-recovery.ts +255 -0
- package/src/lib/scrollbars.ts +30 -0
- package/src/lib/terminal-input-readiness.ts +51 -0
- package/src/lib/transient-retry.ts +101 -0
- package/src/lib/workbench-peers.ts +62 -0
- package/src/lib/xterm-theme.ts +23 -21
- package/src/mcp-connection-status.ts +39 -0
- package/src/messages/en.ts +3810 -0
- package/src/messages/runtime.tsx +175 -0
- package/src/messages.ts +19 -0
- package/src/model-mark-paths.ts +53 -0
- package/src/model-picker-model.ts +343 -0
- package/src/model-policy.ts +301 -79
- package/src/native-previews.ts +104 -0
- package/src/new-session-draft.ts +22 -0
- package/src/notification-text.ts +81 -0
- package/src/organization-model.ts +123 -0
- package/src/plugin-details.tsx +192 -0
- package/src/plugin-discovery.tsx +209 -0
- package/src/preview-loading-paint.ts +68 -0
- package/src/provider.tsx +105 -21
- package/src/queue-presentation-model.ts +475 -0
- package/src/realtime/dropdown-menu.tsx +19 -12
- package/src/realtime/embedded-new-voice.tsx +1 -0
- package/src/realtime/embedded-voice.tsx +3 -0
- package/src/realtime/realtime-control.tsx +240 -609
- package/src/realtime/session-realtime.ts +582 -0
- package/src/sandbox-label-model.ts +56 -0
- package/src/scrollbars.ts +3 -0
- package/src/secret-reference-label.ts +47 -0
- package/src/secrets-ui.tsx +59 -0
- package/src/session-agents-model.ts +40 -0
- package/src/session-attention-model.ts +62 -0
- package/src/session-auth-recommendation.ts +50 -0
- package/src/session-capability-policy.ts +200 -0
- package/src/session-context.ts +13 -5
- package/src/session-feedback-model.ts +101 -0
- package/src/session-list-model.ts +437 -0
- package/src/session-realtime.ts +18 -0
- package/src/session-status-model.ts +99 -0
- package/src/session-ui.ts +102 -3
- package/src/session.ts +19 -1
- package/src/site-snapshot.ts +74 -0
- package/src/sites-ui.tsx +350 -0
- package/src/sites.ts +3 -0
- package/src/skill-discovery.tsx +221 -0
- package/src/terminal.ts +26 -0
- package/src/testing/session-scenarios.ts +404 -0
- package/src/this-computer.ts +62 -0
- package/src/timeline/activity-rail.tsx +289 -119
- package/src/timeline/agent-identity.tsx +84 -0
- package/src/timeline/agent-row.tsx +235 -0
- package/src/timeline/allowance-exhausted-row.tsx +90 -0
- package/src/timeline/compaction-copy.ts +125 -0
- package/src/timeline/fleet-decision-row.tsx +120 -101
- package/src/timeline/focus-sequence.ts +44 -0
- package/src/timeline/genie-copy.ts +22 -0
- package/src/timeline/genie-loading.tsx +158 -0
- package/src/timeline/index.ts +37 -2
- package/src/timeline/invoked-tool.ts +15 -0
- package/src/timeline/knowledge-receipt.tsx +104 -0
- package/src/timeline/learning-refusal-copy.ts +67 -0
- package/src/timeline/learning-refusal-row.tsx +70 -0
- package/src/timeline/message-sender.tsx +71 -0
- package/src/timeline/notice-presentation.ts +67 -0
- package/src/timeline/parsers.ts +42 -2
- package/src/timeline/patch-apply-command.tsx +139 -0
- package/src/timeline/platform-activity-presentation.ts +219 -0
- package/src/timeline/platform-activity-row.tsx +34 -98
- package/src/timeline/presented-image.ts +63 -0
- package/src/timeline/projection.ts +1556 -71
- package/src/timeline/provider-logo.tsx +53 -0
- package/src/timeline/question-nav-model.ts +28 -0
- package/src/timeline/registry.ts +11 -1
- package/src/timeline/retained-image.ts +102 -0
- package/src/timeline/retained-loaders.ts +91 -0
- package/src/timeline/rolling-activity.tsx +84 -0
- package/src/timeline/screenshot-lightbox.tsx +250 -10
- package/src/timeline/session-usage-limit-row.tsx +44 -0
- package/src/timeline/shared.tsx +76 -29
- package/src/timeline/startup-dispatch-details.tsx +43 -0
- package/src/timeline/startup-preference.ts +33 -0
- package/src/timeline/startup-timings.tsx +164 -0
- package/src/timeline/tool-diff.tsx +3 -1
- package/src/timeline/tool-display-name.ts +38 -6
- package/src/timeline/tool-presentation.ts +1552 -0
- package/src/timeline/tool-renderers.tsx +1023 -1265
- package/src/timeline/turn-summary-model.ts +363 -0
- package/src/timeline/turn-summary.tsx +288 -367
- package/src/timeline/types.ts +191 -7
- package/src/timeline/work-presentation.ts +196 -0
- package/src/timeline-model.ts +143 -0
- package/src/usage/allowance-copy.ts +70 -0
- package/src/usage/session-usage-limit.ts +270 -0
- package/src/usage/summary.ts +93 -0
- package/src/usage.ts +70 -0
- package/src/voice-recording-owner.ts +22 -0
- package/styles/compiled.css +2010 -651
- package/styles/connect.css +290 -0
- package/styles/connect.d.ts +1 -0
- package/styles/effective-tokens.css +1 -0
- package/styles/index.css +286 -9
- package/styles/responsive.css +98 -6
- package/styles/session-capability.css +44 -0
- package/styles/this-computer.css +1042 -0
- package/styles/this-computer.d.ts +1 -0
- package/styles/tokens.css +132 -64
- package/dist/browser-viewer-NTD6UIPR.js +0 -14
- package/dist/chunk-24M4YBCL.js.map +0 -1
- package/dist/chunk-4MDLEHXL.js.map +0 -1
- package/dist/chunk-5M6VTFJ5.js.map +0 -1
- package/dist/chunk-5PQJOCX5.js +0 -902
- package/dist/chunk-5PQJOCX5.js.map +0 -1
- package/dist/chunk-5YK2ZDIG.js.map +0 -1
- package/dist/chunk-6J56T3MG.js.map +0 -1
- package/dist/chunk-BV5A4OTE.js.map +0 -1
- package/dist/chunk-CQG7YUJB.js +0 -10883
- package/dist/chunk-CQG7YUJB.js.map +0 -1
- package/dist/chunk-H5YGYNXS.js.map +0 -1
- package/dist/chunk-HUIKIDM5.js.map +0 -1
- package/dist/chunk-HUMIRRYI.js.map +0 -1
- package/dist/chunk-ICA6R6TW.js.map +0 -1
- package/dist/chunk-JVYQRRC4.js.map +0 -1
- package/dist/chunk-KCGXPP5V.js.map +0 -1
- package/dist/chunk-KZ73RL76.js.map +0 -1
- package/dist/chunk-NEXLLTP4.js.map +0 -1
- package/dist/chunk-NLTS7JHI.js.map +0 -1
- package/dist/chunk-NOSYBS2D.js.map +0 -1
- package/dist/chunk-PAJU5KKL.js.map +0 -1
- package/dist/chunk-PEI6RANI.js.map +0 -1
- package/dist/chunk-PLYRL5ER.js +0 -164
- package/dist/chunk-PLYRL5ER.js.map +0 -1
- package/dist/chunk-R4KRSFGA.js +0 -290
- package/dist/chunk-R4KRSFGA.js.map +0 -1
- package/dist/chunk-UMECRJRV.js +0 -223
- package/dist/chunk-UMECRJRV.js.map +0 -1
- package/dist/chunk-VRBL3F5E.js +0 -241
- package/dist/chunk-VRBL3F5E.js.map +0 -1
- package/dist/chunk-YBM6CQRU.js.map +0 -1
- package/dist/chunk-Z7WBDB4E.js.map +0 -1
- package/dist/computer-viewer-7TEZC6Y2.js +0 -16
- package/dist/fleet-decision-row-YZ3ZKWMM.js +0 -352
- package/dist/fleet-decision-row-YZ3ZKWMM.js.map +0 -1
- package/dist/hooks/use-environments.d.ts +0 -41
- package/dist/hooks/use-packs.d.ts +0 -32
- package/dist/markdown-table-layout-3Z3AWBY7.js.map +0 -1
- package/dist/model-policy-picker-menu-3R336DP2.js +0 -13
- package/dist/platform-activity-row-27LKAWZD.js +0 -169
- package/dist/platform-activity-row-27LKAWZD.js.map +0 -1
- package/dist/queue-surface-implementation-LK3S4BIW.js.map +0 -1
- package/dist/timeline-annotation-markers-DRSTLEM6.js.map +0 -1
- package/dist/timeline-annotation-selection-IHLUGVND.js.map +0 -1
- package/dist/timeline-annotations-dialog-6Q53N5FG.js.map +0 -1
- package/src/hooks/use-environments.ts +0 -182
- package/src/hooks/use-packs.ts +0 -157
- /package/dist/{browser-viewer-NTD6UIPR.js.map → browser-viewer-GEHX3KYE.js.map} +0 -0
- /package/dist/{computer-viewer-7TEZC6Y2.js.map → chat-interactive-block-5V3BGLXT.js.map} +0 -0
- /package/dist/{model-policy-picker-menu-3R336DP2.js.map → chunk-M357MHH3.js.map} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
ComputerAction,
|
|
3
|
+
ComputerActionReceipt,
|
|
3
4
|
ComputerClipboard,
|
|
4
5
|
ComputerFrame,
|
|
5
6
|
ComputerObservation,
|
|
@@ -25,6 +26,7 @@ import {
|
|
|
25
26
|
} from "lucide-react";
|
|
26
27
|
import {
|
|
27
28
|
type ClipboardEvent,
|
|
29
|
+
type CompositionEvent,
|
|
28
30
|
type KeyboardEvent,
|
|
29
31
|
type MouseEvent,
|
|
30
32
|
type PointerEvent,
|
|
@@ -32,6 +34,7 @@ import {
|
|
|
32
34
|
type WheelEvent,
|
|
33
35
|
useCallback,
|
|
34
36
|
useEffect,
|
|
37
|
+
useLayoutEffect,
|
|
35
38
|
useMemo,
|
|
36
39
|
useRef,
|
|
37
40
|
useState,
|
|
@@ -40,7 +43,12 @@ import {
|
|
|
40
43
|
type ComputerFrameWebSocketFactory,
|
|
41
44
|
useComputerFrameStream,
|
|
42
45
|
} from "../hooks/use-computer-frame-stream";
|
|
43
|
-
import {
|
|
46
|
+
import {
|
|
47
|
+
computerActionReceiptError,
|
|
48
|
+
isStaleComputerActionResult,
|
|
49
|
+
useComputerSession,
|
|
50
|
+
} from "../hooks/use-computer-session";
|
|
51
|
+
import { useComputerInputPosture } from "../hooks/use-computer-input-posture";
|
|
44
52
|
import { useComputerSessions } from "../hooks/use-computer-sessions";
|
|
45
53
|
import { useInteractionInterventions } from "../hooks/use-interaction-interventions";
|
|
46
54
|
import { cn } from "../lib/cn";
|
|
@@ -49,11 +57,13 @@ import { isSourcePlacementChangedError } from "../lib/interaction-errors";
|
|
|
49
57
|
import type { EmbeddedComputerInteractionClientOverride } from "../session-context";
|
|
50
58
|
import { InteractionInterventionBanner } from "./interaction-intervention-banner";
|
|
51
59
|
import { DesktopViewer } from "./desktop-viewer";
|
|
60
|
+
import { useViewerMenuDismiss } from "./use-viewer-menu-dismiss";
|
|
61
|
+
import { useOpenGeniText, type OpenGeniText } from "../messages/runtime";
|
|
52
62
|
|
|
53
63
|
export type ComputerViewerNotification = { kind: "error" | "info"; message: string };
|
|
54
64
|
|
|
55
65
|
export type ComputerViewerProps = EmbeddedComputerInteractionClientOverride & {
|
|
56
|
-
/** Selected
|
|
66
|
+
/** Selected Opengeni agent/session. Peer ComputerSessions remain visible. */
|
|
57
67
|
sessionId: string;
|
|
58
68
|
enabled?: boolean | undefined;
|
|
59
69
|
className?: string | undefined;
|
|
@@ -87,6 +97,7 @@ export function ComputerViewer({
|
|
|
87
97
|
onComputerSessionIdChange,
|
|
88
98
|
...override
|
|
89
99
|
}: ComputerViewerProps) {
|
|
100
|
+
const t = useOpenGeniText();
|
|
90
101
|
const registry = useComputerSessions({ ...override, sessionId, enabled });
|
|
91
102
|
const createSession = registry.create;
|
|
92
103
|
const refreshRegistry = registry.refresh;
|
|
@@ -170,6 +181,7 @@ export function ComputerViewer({
|
|
|
170
181
|
|
|
171
182
|
const notifyError = useCallback(
|
|
172
183
|
(cause: unknown, fallback: string) => {
|
|
184
|
+
if (isStaleComputerActionResult(cause)) return;
|
|
173
185
|
onNotify?.({
|
|
174
186
|
kind: "error",
|
|
175
187
|
message: cause instanceof Error ? cause.message : fallback,
|
|
@@ -253,6 +265,9 @@ export function ComputerViewer({
|
|
|
253
265
|
computerSessionId: selection?.sessionId ?? null,
|
|
254
266
|
enabled: enabled && selection !== null && controllerReady,
|
|
255
267
|
});
|
|
268
|
+
useEffect(() => {
|
|
269
|
+
setShowControls(computer.selectedTarget?.kind === "app");
|
|
270
|
+
}, [sessionId, selection?.sessionId, computer.selectedTarget?.id, computer.selectedTarget?.kind]);
|
|
256
271
|
useEffect(() => {
|
|
257
272
|
if (!isSourcePlacementChangedError(computer.error, "computer_session")) return;
|
|
258
273
|
void refreshRegistry();
|
|
@@ -282,18 +297,69 @@ export function ComputerViewer({
|
|
|
282
297
|
const displayedFrame =
|
|
283
298
|
frames.frame &&
|
|
284
299
|
frames.frame.computerSessionId === selection?.sessionId &&
|
|
285
|
-
frames.frame.targetId === computer.selectedTarget?.id
|
|
300
|
+
frames.frame.targetId === computer.selectedTarget?.id &&
|
|
301
|
+
frames.frame.targetGeneration === computer.selectedTarget?.targetGeneration
|
|
286
302
|
? frames.frame
|
|
287
303
|
: null;
|
|
288
304
|
const rfbStream =
|
|
289
305
|
frames.attachment?.stream.kind === "direct_rfb" ? frames.attachment.stream : null;
|
|
306
|
+
const appTarget = computer.selectedTarget?.kind === "app";
|
|
307
|
+
const appInputPosture = useComputerInputPosture({
|
|
308
|
+
...override,
|
|
309
|
+
computerSessionId: selection?.sessionId ?? null,
|
|
310
|
+
controllerGeneration: computer.session?.controller?.controllerGeneration ?? null,
|
|
311
|
+
enabled: enabled && controllerReady && appTarget,
|
|
312
|
+
});
|
|
313
|
+
const inputPostureRef = useRef({
|
|
314
|
+
sessionId: selection?.sessionId ?? null,
|
|
315
|
+
controllerGeneration: computer.session?.controller?.controllerGeneration ?? null,
|
|
316
|
+
denied: false,
|
|
317
|
+
});
|
|
318
|
+
const postureSessionId = selection?.sessionId ?? null;
|
|
319
|
+
const postureController = computer.session?.controller?.controllerGeneration ?? null;
|
|
320
|
+
if (
|
|
321
|
+
inputPostureRef.current.sessionId !== postureSessionId ||
|
|
322
|
+
inputPostureRef.current.controllerGeneration !== postureController
|
|
323
|
+
) {
|
|
324
|
+
inputPostureRef.current = {
|
|
325
|
+
sessionId: postureSessionId,
|
|
326
|
+
controllerGeneration: postureController,
|
|
327
|
+
denied: false,
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
if (
|
|
331
|
+
frames.attachment?.computerSessionId === postureSessionId &&
|
|
332
|
+
frames.attachment.controllerGeneration === postureController
|
|
333
|
+
) {
|
|
334
|
+
inputPostureRef.current.denied = frames.attachment.inputAllowed === false;
|
|
335
|
+
}
|
|
336
|
+
// Keep a known denial while a fresh attachment is pending or a semantic-only
|
|
337
|
+
// target has no stream. Only a fresh posture for this controller clears it.
|
|
338
|
+
const inputDenied = appTarget
|
|
339
|
+
? appInputPosture.inputAllowed !== true
|
|
340
|
+
: inputPostureRef.current.denied;
|
|
341
|
+
const attachmentInputAllowed = frames.attachment !== null && !inputDenied;
|
|
342
|
+
const inputPosturePending = appTarget
|
|
343
|
+
? appInputPosture.pending
|
|
344
|
+
: inputDenied && (frames.state === "attaching" || frames.state === "reconnecting");
|
|
345
|
+
const machineLocked = selectedRegistrySession?.failureCode === "machine_locked";
|
|
346
|
+
const controlUnavailable = computer.controlError !== null;
|
|
347
|
+
const connectionState = controlUnavailable ? "error" : frames.state;
|
|
348
|
+
// RFB has one combined input switch; partial native input stays view-only.
|
|
349
|
+
const rfbInputEnabled =
|
|
350
|
+
rfbStream?.inputAllowed === true &&
|
|
351
|
+
attachmentInputAllowed &&
|
|
352
|
+
!machineLocked &&
|
|
353
|
+
!controlUnavailable &&
|
|
354
|
+
computer.session?.capabilities?.pointerInput === true &&
|
|
355
|
+
computer.session?.capabilities?.keyboardInput === true;
|
|
290
356
|
const rfbCapability = useMemo<DesktopStreamCapability | null>(() => {
|
|
291
357
|
if (!rfbStream || !frames.attachment) return null;
|
|
292
358
|
const bounds = computer.selectedTarget?.bounds;
|
|
293
359
|
return {
|
|
294
360
|
transport: "vnc-ws",
|
|
295
361
|
client: "novnc",
|
|
296
|
-
mode: "interactive",
|
|
362
|
+
mode: rfbInputEnabled ? "interactive" : "read-only",
|
|
297
363
|
url: rfbStream.url,
|
|
298
364
|
token: null,
|
|
299
365
|
expiresAt: frames.attachment.expiresAt,
|
|
@@ -305,8 +371,7 @@ export function ComputerViewer({
|
|
|
305
371
|
sharedSessionIds: [],
|
|
306
372
|
reason: null,
|
|
307
373
|
};
|
|
308
|
-
}, [computer.selectedTarget?.bounds, frames.attachment, rfbStream]);
|
|
309
|
-
const machineLocked = selectedRegistrySession?.failureCode === "machine_locked";
|
|
374
|
+
}, [computer.selectedTarget?.bounds, frames.attachment, rfbInputEnabled, rfbStream]);
|
|
310
375
|
const currentIds = useMemo(() => new Set(relevant.map((session) => session.id)), [relevant]);
|
|
311
376
|
|
|
312
377
|
useEffect(() => {
|
|
@@ -315,10 +380,10 @@ export function ComputerViewer({
|
|
|
315
380
|
seenInterventionIdsRef.current.add(intervention.id);
|
|
316
381
|
onNotify?.({
|
|
317
382
|
kind: "info",
|
|
318
|
-
message: `${interventionTitle(intervention)}: ${intervention.reason}`,
|
|
383
|
+
message: `${interventionTitle(t, intervention)}: ${intervention.reason}`,
|
|
319
384
|
});
|
|
320
385
|
}
|
|
321
|
-
}, [interventions.interventions, onNotify]);
|
|
386
|
+
}, [interventions.interventions, onNotify, t]);
|
|
322
387
|
|
|
323
388
|
const resolveIntervention = useCallback(
|
|
324
389
|
(intervention: InteractionIntervention, outcome: "completed" | "dismissed") => {
|
|
@@ -331,12 +396,14 @@ export function ComputerViewer({
|
|
|
331
396
|
onNotify?.({
|
|
332
397
|
kind: "info",
|
|
333
398
|
message:
|
|
334
|
-
outcome === "completed"
|
|
399
|
+
outcome === "completed"
|
|
400
|
+
? t("computerViewer.agentNotifiedContinuingWork")
|
|
401
|
+
: t("computerViewer.requestCancelled"),
|
|
335
402
|
});
|
|
336
403
|
})
|
|
337
|
-
.catch((cause) => notifyError(cause, "
|
|
404
|
+
.catch((cause) => notifyError(cause, t("computerViewer.couldNotUpdateTheDesktop")));
|
|
338
405
|
},
|
|
339
|
-
[interventions, notifyError, onNotify],
|
|
406
|
+
[interventions, notifyError, onNotify, t],
|
|
340
407
|
);
|
|
341
408
|
|
|
342
409
|
const createComputer = useCallback(() => {
|
|
@@ -349,15 +416,16 @@ export function ComputerViewer({
|
|
|
349
416
|
selectComputerSession({ sessionId: response.session.id, pinned: false });
|
|
350
417
|
})
|
|
351
418
|
.catch((cause) => {
|
|
352
|
-
const error =
|
|
419
|
+
const error =
|
|
420
|
+
cause instanceof Error ? cause : new Error(t("computerViewer.couldNotOpenADesktop"));
|
|
353
421
|
setCreateError(error);
|
|
354
|
-
notifyError(error, "
|
|
422
|
+
notifyError(error, t("computerViewer.couldNotOpenADesktop"));
|
|
355
423
|
})
|
|
356
424
|
.finally(() => {
|
|
357
425
|
createInFlightRef.current = false;
|
|
358
426
|
setCreating(false);
|
|
359
427
|
});
|
|
360
|
-
}, [createSession, notifyError, selectComputerSession, sessionId]);
|
|
428
|
+
}, [createSession, notifyError, selectComputerSession, sessionId, t]);
|
|
361
429
|
|
|
362
430
|
useEffect(() => {
|
|
363
431
|
if (
|
|
@@ -433,37 +501,57 @@ export function ComputerViewer({
|
|
|
433
501
|
]);
|
|
434
502
|
|
|
435
503
|
const perform = useCallback(
|
|
436
|
-
async (
|
|
504
|
+
async (
|
|
505
|
+
action: ComputerAction,
|
|
506
|
+
frame: ComputerFrame | null,
|
|
507
|
+
operationId?: string,
|
|
508
|
+
): Promise<ComputerActionReceipt> => {
|
|
509
|
+
if (computer.controlError) throw computer.controlError;
|
|
510
|
+
if (inputDenied) throw new Error(t("computerViewer.desktopIsViewOnlyRefresh"));
|
|
511
|
+
let receipt;
|
|
437
512
|
if (action.type === "pointer") {
|
|
438
|
-
if (!frame) throw new Error("
|
|
439
|
-
await actFromFrame(action, frame);
|
|
513
|
+
if (!frame) throw new Error(t("computerViewer.desktopViewIsNotReady"));
|
|
514
|
+
receipt = await actFromFrame(action, frame, operationId);
|
|
440
515
|
} else {
|
|
441
|
-
await act(action);
|
|
516
|
+
receipt = await act(action, operationId);
|
|
517
|
+
}
|
|
518
|
+
if (!isStaleComputerActionResult(receipt) && receipt.state !== "completed") {
|
|
519
|
+
throw computerActionReceiptError(t, receipt);
|
|
442
520
|
}
|
|
521
|
+
return receipt;
|
|
443
522
|
},
|
|
444
|
-
[act, actFromFrame],
|
|
523
|
+
[act, actFromFrame, computer.controlError, inputDenied, t],
|
|
445
524
|
);
|
|
446
525
|
|
|
526
|
+
const reconnect = () => {
|
|
527
|
+
void refreshComputer();
|
|
528
|
+
if (appTarget) appInputPosture.refresh();
|
|
529
|
+
else frames.reconnect();
|
|
530
|
+
};
|
|
531
|
+
|
|
447
532
|
const copyFromRfb = useCallback(
|
|
448
533
|
(event: ClipboardEvent<HTMLDivElement>) => {
|
|
449
|
-
if (!rfbStream || computer.session?.capabilities?.clipboard !== true)
|
|
534
|
+
if (!rfbInputEnabled || !rfbStream || computer.session?.capabilities?.clipboard !== true)
|
|
535
|
+
return;
|
|
450
536
|
event.preventDefault();
|
|
451
537
|
event.stopPropagation();
|
|
452
|
-
void
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
538
|
+
void (async () => {
|
|
539
|
+
const receipt = await perform({ type: "clipboard", operation: "copy" }, null);
|
|
540
|
+
if (isStaleComputerActionResult(receipt)) return;
|
|
541
|
+
const clipboard = await computer.readClipboard();
|
|
542
|
+
if (isStaleComputerActionResult(receipt) || isStaleComputerActionResult(clipboard)) return;
|
|
543
|
+
if (clipboard.text && !(await copyTextToClipboard(clipboard.text))) {
|
|
544
|
+
throw new Error(t("computerViewer.desktopTextCouldNotBe"));
|
|
545
|
+
}
|
|
546
|
+
})().catch((cause) => notifyError(cause, t("computerViewer.couldNotCopyFromThe")));
|
|
460
547
|
},
|
|
461
|
-
[computer, notifyError, perform, rfbStream],
|
|
548
|
+
[computer, notifyError, perform, rfbInputEnabled, rfbStream, t],
|
|
462
549
|
);
|
|
463
550
|
|
|
464
551
|
const pasteIntoRfb = useCallback(
|
|
465
552
|
(text: string): boolean => {
|
|
466
|
-
if (!rfbStream || computer.session?.capabilities?.clipboard !== true)
|
|
553
|
+
if (!rfbInputEnabled || !rfbStream || computer.session?.capabilities?.clipboard !== true)
|
|
554
|
+
return false;
|
|
467
555
|
// Keep paste on the canonical ComputerSession action path. RFB
|
|
468
556
|
// ClientCutText synchronization varies by server and can acknowledge a
|
|
469
557
|
// local paste without ever updating the remote graphical seat. These two
|
|
@@ -472,13 +560,16 @@ export function ComputerViewer({
|
|
|
472
560
|
// ownership is asynchronous, so a successful write response alone does
|
|
473
561
|
// not prove that the graphical seat can already serve the selection.
|
|
474
562
|
void (async () => {
|
|
475
|
-
await perform({ type: "clipboard", operation: "write", text }, null);
|
|
476
|
-
|
|
563
|
+
const receipt = await perform({ type: "clipboard", operation: "write", text }, null);
|
|
564
|
+
if (isStaleComputerActionResult(receipt)) return;
|
|
565
|
+
const clipboard = await computer.readClipboard();
|
|
566
|
+
if (isStaleComputerActionResult(receipt) || isStaleComputerActionResult(clipboard)) return;
|
|
567
|
+
assertExactComputerClipboard(t, clipboard, text);
|
|
477
568
|
await perform({ type: "clipboard", operation: "paste" }, null);
|
|
478
|
-
})().catch((cause) => notifyError(cause, "
|
|
569
|
+
})().catch((cause) => notifyError(cause, t("computerViewer.couldNotPasteIntoThe")));
|
|
479
570
|
return true;
|
|
480
571
|
},
|
|
481
|
-
[computer, notifyError, perform, rfbStream],
|
|
572
|
+
[computer, notifyError, perform, rfbInputEnabled, rfbStream, t],
|
|
482
573
|
);
|
|
483
574
|
|
|
484
575
|
const hideGenericCreate = suppressGenericCreate && liveRelevant.length === 0;
|
|
@@ -491,7 +582,7 @@ export function ComputerViewer({
|
|
|
491
582
|
return (
|
|
492
583
|
<ComputerNotice
|
|
493
584
|
icon={<LoaderCircleIcon className="size-4 animate-spin" />}
|
|
494
|
-
text="
|
|
585
|
+
text={t("computerViewer.findingWorkspaceDesktops")}
|
|
495
586
|
{...(className ? { className } : {})}
|
|
496
587
|
/>
|
|
497
588
|
);
|
|
@@ -501,13 +592,12 @@ export function ComputerViewer({
|
|
|
501
592
|
return (
|
|
502
593
|
<div className={cn("grid h-full place-items-center bg-og-bg p-6", className)}>
|
|
503
594
|
<div className="max-w-sm text-center">
|
|
504
|
-
<CircleAlertIcon className="mx-auto size-5 text-og-
|
|
595
|
+
<CircleAlertIcon className="mx-auto size-5 text-og-danger" />
|
|
505
596
|
<p className="mt-3 text-og-menu font-medium text-og-fg">
|
|
506
|
-
|
|
597
|
+
{t("computerViewer.chromeReconnectedOpenAFresh")}
|
|
507
598
|
</p>
|
|
508
|
-
<p className="mt-1 text-og-control leading-5 text-og-muted">
|
|
509
|
-
|
|
510
|
-
connection. Use Browser → New browser → Connected Chrome.
|
|
599
|
+
<p className="mt-1 text-og-control leading-5 text-og-fg-muted">
|
|
600
|
+
{t("computerViewer.thisChromeProfileIsLive")}
|
|
511
601
|
</p>
|
|
512
602
|
</div>
|
|
513
603
|
</div>
|
|
@@ -518,32 +608,32 @@ export function ComputerViewer({
|
|
|
518
608
|
return (
|
|
519
609
|
<div className={cn("grid h-full place-items-center bg-og-bg p-6", className)}>
|
|
520
610
|
<div className="max-w-sm text-center">
|
|
521
|
-
<span className="mx-auto grid size-10 place-items-center rounded-og-lg border border-og-border bg-og-surface-1 text-og-muted">
|
|
611
|
+
<span className="mx-auto grid size-10 place-items-center rounded-og-lg border border-og-border bg-og-surface-1 text-og-fg-muted">
|
|
522
612
|
{error ? (
|
|
523
|
-
<CircleAlertIcon className="size-5 text-og-
|
|
613
|
+
<CircleAlertIcon className="size-5 text-og-danger" />
|
|
524
614
|
) : (
|
|
525
615
|
<LoaderCircleIcon className="size-5 animate-spin" />
|
|
526
616
|
)}
|
|
527
617
|
</span>
|
|
528
618
|
<p className="mt-3 text-og-menu font-medium text-og-fg">
|
|
529
|
-
{error ?
|
|
619
|
+
{error ? t("computerViewer.desktopDidnTOpen") : t("computerViewer.openingDesktop")}
|
|
530
620
|
</p>
|
|
531
|
-
<p className="mt-1 text-og-control leading-5 text-og-muted">
|
|
532
|
-
{error?.message ?? "
|
|
621
|
+
<p className="mt-1 text-og-control leading-5 text-og-fg-muted">
|
|
622
|
+
{error?.message ?? t("computerViewer.preparingThisAgentSDesktop")}
|
|
533
623
|
</p>
|
|
534
624
|
{error ? (
|
|
535
625
|
<button
|
|
536
626
|
type="button"
|
|
537
627
|
onClick={createError ? createComputer : () => void refreshRegistry()}
|
|
538
628
|
disabled={creating || registry.refreshing}
|
|
539
|
-
className="mt-4 inline-flex h-8 items-center gap-1.5 rounded-og-sm bg-og-
|
|
629
|
+
className="mt-4 inline-flex h-8 items-center gap-1.5 rounded-og-sm border border-og-primary-border bg-og-primary text-og-primary-fg px-3 text-og-control font-medium transition hover:bg-og-primary-hover disabled:opacity-50"
|
|
540
630
|
>
|
|
541
631
|
{creating || registry.refreshing ? (
|
|
542
632
|
<LoaderCircleIcon className="size-3.5 animate-spin" />
|
|
543
633
|
) : (
|
|
544
634
|
<RotateCcwIcon className="size-3.5" />
|
|
545
635
|
)}
|
|
546
|
-
|
|
636
|
+
{t("computerViewer.tryAgain")}
|
|
547
637
|
</button>
|
|
548
638
|
) : null}
|
|
549
639
|
</div>
|
|
@@ -552,14 +642,27 @@ export function ComputerViewer({
|
|
|
552
642
|
}
|
|
553
643
|
|
|
554
644
|
return (
|
|
555
|
-
<div
|
|
645
|
+
<div
|
|
646
|
+
className={cn(
|
|
647
|
+
"@container/computer-viewer relative flex h-full min-h-0 min-w-0 flex-col overflow-hidden bg-og-bg",
|
|
648
|
+
className,
|
|
649
|
+
)}
|
|
650
|
+
>
|
|
556
651
|
<ComputerToolbar
|
|
557
652
|
sessions={liveSessions}
|
|
558
653
|
relevantSessionIds={currentIds}
|
|
559
654
|
selectedSessionId={selection?.sessionId ?? null}
|
|
560
655
|
creating={creating}
|
|
561
|
-
refreshing={registry.refreshing}
|
|
656
|
+
refreshing={registry.refreshing || inputPosturePending}
|
|
562
657
|
interventionCounts={interventionCounts}
|
|
658
|
+
targets={controllerReady ? computer.targets : []}
|
|
659
|
+
selectedTargetId={computer.selectedTarget?.id ?? null}
|
|
660
|
+
targetsLoading={controllerReady && computer.loading}
|
|
661
|
+
onSelectTarget={(targetId) => {
|
|
662
|
+
void computer
|
|
663
|
+
.selectTarget(targetId)
|
|
664
|
+
.catch((cause) => notifyError(cause, t("computerViewer.couldNotSwitchDesktopViews")));
|
|
665
|
+
}}
|
|
563
666
|
onSelect={(computerSessionId) =>
|
|
564
667
|
selectComputerSession({ sessionId: computerSessionId, pinned: true })
|
|
565
668
|
}
|
|
@@ -567,7 +670,18 @@ export function ComputerViewer({
|
|
|
567
670
|
if (relevant[0]) selectComputerSession({ sessionId: relevant[0].id, pinned: false });
|
|
568
671
|
}}
|
|
569
672
|
onCreate={hideGenericCreate ? undefined : createComputer}
|
|
570
|
-
onRefresh={() =>
|
|
673
|
+
onRefresh={() => {
|
|
674
|
+
if (appTarget) {
|
|
675
|
+
appInputPosture.refresh();
|
|
676
|
+
} else if (
|
|
677
|
+
(connectionState === "error" || inputDenied) &&
|
|
678
|
+
!generationLossSelected &&
|
|
679
|
+
!generationLossFrames
|
|
680
|
+
) {
|
|
681
|
+
frames.reconnect();
|
|
682
|
+
}
|
|
683
|
+
void Promise.all([refreshRegistry(), refreshComputer()]);
|
|
684
|
+
}}
|
|
571
685
|
/>
|
|
572
686
|
<InteractionInterventionBanner
|
|
573
687
|
interventions={selectedInterventions}
|
|
@@ -576,7 +690,7 @@ export function ComputerViewer({
|
|
|
576
690
|
onOpen={(intervention) =>
|
|
577
691
|
void computer
|
|
578
692
|
.selectTarget(intervention.targetId)
|
|
579
|
-
.catch((cause) => notifyError(cause, "
|
|
693
|
+
.catch((cause) => notifyError(cause, t("computerViewer.couldNotOpenTheRequested")))
|
|
580
694
|
}
|
|
581
695
|
onResolve={resolveIntervention}
|
|
582
696
|
/>
|
|
@@ -597,57 +711,94 @@ export function ComputerViewer({
|
|
|
597
711
|
/>
|
|
598
712
|
) : (
|
|
599
713
|
<>
|
|
600
|
-
<
|
|
601
|
-
targets={computer.targets}
|
|
602
|
-
selectedTargetId={computer.selectedTarget?.id ?? null}
|
|
603
|
-
loading={computer.loading}
|
|
604
|
-
onSelect={(targetId) =>
|
|
605
|
-
void computer
|
|
606
|
-
.selectTarget(targetId)
|
|
607
|
-
.catch((cause) => notifyError(cause, "Could not switch desktop views."))
|
|
608
|
-
}
|
|
609
|
-
/>
|
|
610
|
-
<div className="flex min-h-0 flex-1">
|
|
714
|
+
<div className="flex min-h-0 flex-1 flex-col @xl/computer-viewer:flex-row">
|
|
611
715
|
{rfbStream ? (
|
|
612
716
|
<div className="relative min-h-0 flex-1 bg-black" onCopyCapture={copyFromRfb}>
|
|
613
717
|
<DesktopViewer
|
|
614
718
|
capability={rfbCapability}
|
|
615
|
-
interactive
|
|
719
|
+
interactive={rfbInputEnabled}
|
|
616
720
|
showControlToggle={false}
|
|
617
721
|
webSocketProtocols={rfbStream.protocols}
|
|
618
722
|
onPasteText={pasteIntoRfb}
|
|
619
723
|
targetPlatform={computer.session?.platform ?? null}
|
|
620
724
|
className="h-full"
|
|
621
725
|
/>
|
|
726
|
+
{!rfbInputEnabled ? (
|
|
727
|
+
<div className="pointer-events-none absolute bottom-3 left-1/2 -translate-x-1/2 rounded-full border border-white/10 bg-black/70 px-3 py-1 text-[11px] text-white/80 backdrop-blur">
|
|
728
|
+
{controlUnavailable ? (
|
|
729
|
+
<>
|
|
730
|
+
{t("computerViewer.desktopControlsUnavailable")}{" "}
|
|
731
|
+
<button
|
|
732
|
+
type="button"
|
|
733
|
+
onClick={reconnect}
|
|
734
|
+
className="pointer-events-auto ml-2 font-medium underline"
|
|
735
|
+
>
|
|
736
|
+
{t("computerViewer.reconnect")}
|
|
737
|
+
</button>
|
|
738
|
+
</>
|
|
739
|
+
) : (
|
|
740
|
+
t("computerViewer.viewOnlyDirectInputUnavailable")
|
|
741
|
+
)}
|
|
742
|
+
</div>
|
|
743
|
+
) : null}
|
|
622
744
|
</div>
|
|
623
745
|
) : (
|
|
624
746
|
<ComputerViewport
|
|
747
|
+
key={JSON.stringify([
|
|
748
|
+
selection?.sessionId,
|
|
749
|
+
computer.selectedTarget?.id,
|
|
750
|
+
computer.selectedTarget?.targetGeneration,
|
|
751
|
+
frames.attachment?.controllerGeneration,
|
|
752
|
+
])}
|
|
625
753
|
frame={machineLocked ? null : displayedFrame}
|
|
626
754
|
observation={computer.observation}
|
|
627
755
|
target={computer.selectedTarget}
|
|
628
756
|
machineLocked={machineLocked}
|
|
629
|
-
|
|
630
|
-
|
|
757
|
+
controlUnavailable={controlUnavailable}
|
|
758
|
+
inputAllowed={!inputDenied}
|
|
759
|
+
connectionState={connectionState}
|
|
760
|
+
connectionError={
|
|
761
|
+
computer.controlError ?? appInputPosture.error ?? frames.error ?? computer.error
|
|
762
|
+
}
|
|
631
763
|
mutating={computer.mutating}
|
|
632
764
|
backgroundActions={computer.session?.capabilities?.backgroundActions === true}
|
|
633
|
-
|
|
765
|
+
backgroundInput={computer.session?.capabilities?.backgroundInput === true}
|
|
766
|
+
allowForegroundInputWithinOwnedSeat={
|
|
767
|
+
computer.session?.platform === "linux" &&
|
|
768
|
+
computer.session.adapter === "opengeni.cua.linux.v1" &&
|
|
769
|
+
computer.session.seatId === `linux-virtual:${computer.session.id}` &&
|
|
770
|
+
Boolean(computer.session.displayId)
|
|
771
|
+
}
|
|
772
|
+
clipboardEnabled={
|
|
773
|
+
attachmentInputAllowed && computer.session?.capabilities?.clipboard === true
|
|
774
|
+
}
|
|
775
|
+
pointerInput={
|
|
776
|
+
attachmentInputAllowed && computer.session?.capabilities?.pointerInput === true
|
|
777
|
+
}
|
|
778
|
+
pointerClickContinuation={
|
|
779
|
+
attachmentInputAllowed &&
|
|
780
|
+
computer.session?.capabilities?.pointerClickContinuation === true
|
|
781
|
+
}
|
|
782
|
+
keyboardInput={
|
|
783
|
+
attachmentInputAllowed && computer.session?.capabilities?.keyboardInput === true
|
|
784
|
+
}
|
|
634
785
|
onAction={perform}
|
|
635
786
|
onReadClipboard={computer.readClipboard}
|
|
636
787
|
onReconnect={
|
|
637
|
-
generationLossSelected || generationLossFrames
|
|
638
|
-
? () => undefined
|
|
639
|
-
: frames.reconnect
|
|
788
|
+
generationLossSelected || generationLossFrames ? () => undefined : reconnect
|
|
640
789
|
}
|
|
641
|
-
onError={(cause) => notifyError(cause, "
|
|
790
|
+
onError={(cause) => notifyError(cause, t("computerViewer.desktopInputFailed"))}
|
|
642
791
|
/>
|
|
643
792
|
)}
|
|
644
793
|
{showControls ? (
|
|
645
794
|
<ComputerSemanticPanel
|
|
646
795
|
observation={computer.observation}
|
|
647
|
-
mutating={computer.mutating}
|
|
796
|
+
mutating={computer.mutating || controlUnavailable || inputDenied}
|
|
797
|
+
controlUnavailable={controlUnavailable}
|
|
798
|
+
inputAllowed={!inputDenied}
|
|
648
799
|
onAction={(action) =>
|
|
649
800
|
void perform(action, null).catch((cause) =>
|
|
650
|
-
notifyError(cause, "
|
|
801
|
+
notifyError(cause, t("computerViewer.desktopActionFailed")),
|
|
651
802
|
)
|
|
652
803
|
}
|
|
653
804
|
/>
|
|
@@ -656,10 +807,12 @@ export function ComputerViewer({
|
|
|
656
807
|
<ComputerStatusBar
|
|
657
808
|
session={computer.session}
|
|
658
809
|
target={computer.selectedTarget}
|
|
659
|
-
connectionState={
|
|
810
|
+
connectionState={connectionState}
|
|
811
|
+
controlUnavailable={controlUnavailable}
|
|
812
|
+
inputAllowed={!inputDenied}
|
|
660
813
|
refreshing={registry.refreshing}
|
|
661
814
|
showControls={showControls}
|
|
662
|
-
controlCount={
|
|
815
|
+
controlCount={semanticControls(t, computer.observation).length}
|
|
663
816
|
onToggleControls={() => setShowControls((current) => !current)}
|
|
664
817
|
/>
|
|
665
818
|
</>
|
|
@@ -675,30 +828,31 @@ function ComputerUnselectedPanel(props: {
|
|
|
675
828
|
generationLoss: boolean;
|
|
676
829
|
onCreate: () => void;
|
|
677
830
|
}) {
|
|
831
|
+
const t = useOpenGeniText();
|
|
678
832
|
return (
|
|
679
833
|
<div className="grid min-h-0 flex-1 place-items-center bg-og-bg p-6 text-center">
|
|
680
834
|
<div className="max-w-sm">
|
|
681
|
-
<span className="mx-auto grid size-10 place-items-center rounded-og-md border border-og-border bg-og-surface-1 text-og-muted">
|
|
835
|
+
<span className="mx-auto grid size-10 place-items-center rounded-og-md border border-og-border bg-og-surface-1 text-og-fg-muted">
|
|
682
836
|
{props.error || props.generationLoss ? (
|
|
683
|
-
<CircleAlertIcon className="size-4.5 text-og-
|
|
837
|
+
<CircleAlertIcon className="size-4.5 text-og-danger" />
|
|
684
838
|
) : (
|
|
685
839
|
<LoaderCircleIcon className="size-4.5 animate-spin" />
|
|
686
840
|
)}
|
|
687
841
|
</span>
|
|
688
842
|
<p className="mt-3 text-og-menu font-medium text-og-fg">
|
|
689
843
|
{props.generationLoss
|
|
690
|
-
? "
|
|
844
|
+
? t("computerViewer.chromeReconnectedOpenAFresh")
|
|
691
845
|
: props.error
|
|
692
|
-
?
|
|
693
|
-
: "
|
|
846
|
+
? t("computerViewer.desktopDidnTOpen")
|
|
847
|
+
: t("computerViewer.openingDesktop")}
|
|
694
848
|
</p>
|
|
695
|
-
<p className="mt-1 text-og-control leading-5 text-og-muted">
|
|
849
|
+
<p className="mt-1 text-og-control leading-5 text-og-fg-muted">
|
|
696
850
|
{props.generationLoss
|
|
697
|
-
? "
|
|
851
|
+
? t("computerViewer.thisChromeProfileIsLive")
|
|
698
852
|
: (props.error?.message ??
|
|
699
853
|
(props.peerCount === 1
|
|
700
|
-
? "
|
|
701
|
-
:
|
|
854
|
+
? t("computerViewer.preparingThisAgentSDesktop2")
|
|
855
|
+
: t("computerViewer.preparingThisAgentSDesktop3", { peerCount: props.peerCount })))}
|
|
702
856
|
</p>
|
|
703
857
|
{props.error && !props.generationLoss ? (
|
|
704
858
|
<button
|
|
@@ -712,7 +866,7 @@ function ComputerUnselectedPanel(props: {
|
|
|
712
866
|
) : (
|
|
713
867
|
<RotateCcwIcon className="size-3.5" />
|
|
714
868
|
)}
|
|
715
|
-
|
|
869
|
+
{t("computerViewer.tryAgain")}
|
|
716
870
|
</button>
|
|
717
871
|
) : null}
|
|
718
872
|
</div>
|
|
@@ -727,67 +881,101 @@ function ComputerToolbar(props: {
|
|
|
727
881
|
creating: boolean;
|
|
728
882
|
refreshing: boolean;
|
|
729
883
|
interventionCounts: Map<string, number>;
|
|
884
|
+
targets: ComputerTarget[];
|
|
885
|
+
selectedTargetId: string | null;
|
|
886
|
+
targetsLoading: boolean;
|
|
887
|
+
onSelectTarget: (id: string) => void;
|
|
730
888
|
onSelect: (id: string) => void;
|
|
731
889
|
onFollow: () => void;
|
|
732
890
|
onCreate?: (() => void) | undefined;
|
|
733
891
|
onRefresh: () => void;
|
|
734
892
|
}) {
|
|
735
|
-
const
|
|
893
|
+
const t = useOpenGeniText();
|
|
894
|
+
const detailsRef = useViewerMenuDismiss();
|
|
736
895
|
const selected = props.sessions.find((session) => session.id === props.selectedSessionId);
|
|
737
896
|
const current = props.sessions.filter((session) => props.relevantSessionIds.has(session.id));
|
|
738
897
|
const others = props.sessions.filter((session) => !props.relevantSessionIds.has(session.id));
|
|
739
|
-
const
|
|
740
|
-
props.onSelect(id);
|
|
898
|
+
const closeMenu = (restoreFocus: boolean) => {
|
|
741
899
|
detailsRef.current?.removeAttribute("open");
|
|
900
|
+
if (restoreFocus) detailsRef.current?.querySelector("summary")?.focus();
|
|
901
|
+
};
|
|
902
|
+
const choose = (id: string, restoreFocus: boolean) => {
|
|
903
|
+
props.onSelect(id);
|
|
904
|
+
closeMenu(restoreFocus);
|
|
742
905
|
};
|
|
743
906
|
return (
|
|
744
|
-
<div className="flex h-10 shrink-0 items-center gap-1.5 border-b border-og-border bg-og-surface-
|
|
745
|
-
<details ref={detailsRef} className="
|
|
746
|
-
<summary className="flex h-7 max-w-
|
|
747
|
-
<MonitorIcon className="size-3.5 shrink-0 text-og-muted" />
|
|
907
|
+
<div className="flex h-10 shrink-0 items-center gap-1.5 border-b border-og-border bg-og-surface-1 px-2">
|
|
908
|
+
<details ref={detailsRef} className="min-w-0">
|
|
909
|
+
<summary className="flex h-7 max-w-32 cursor-pointer list-none items-center gap-2 rounded-og-sm px-2 text-og-control text-og-fg transition hover:bg-og-surface-2 @sm/computer-viewer:max-w-52 [&::-webkit-details-marker]:hidden">
|
|
910
|
+
<MonitorIcon className="size-3.5 shrink-0 text-og-fg-muted" />
|
|
748
911
|
<span className="truncate font-medium">
|
|
749
|
-
{selected?.name === "Computer"
|
|
912
|
+
{selected?.name === "Computer"
|
|
913
|
+
? t("computerViewer.desktop")
|
|
914
|
+
: (selected?.name ?? t("computerViewer.desktop"))}
|
|
750
915
|
</span>
|
|
751
916
|
{(props.interventionCounts.get(selected?.id ?? "") ?? 0) > 0 ? (
|
|
752
917
|
<span className="size-1.5 shrink-0 rounded-full bg-og-status-waiting" />
|
|
753
918
|
) : null}
|
|
754
|
-
<ChevronDownIcon className="size-3 shrink-0 text-og-subtle" />
|
|
919
|
+
<ChevronDownIcon className="size-3 shrink-0 text-og-fg-subtle" />
|
|
755
920
|
</summary>
|
|
756
|
-
<div className="absolute left-
|
|
757
|
-
<
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
921
|
+
<div className="absolute left-2 top-10 z-30 flex max-h-[calc(100%-3rem)] w-72 max-w-[calc(100%-1rem)] flex-col overflow-hidden rounded-og-md border border-og-border bg-og-surface-1 p-1 shadow-xl">
|
|
922
|
+
<div className="min-h-0 max-h-96 overflow-y-auto overscroll-contain">
|
|
923
|
+
<ComputerSessionGroup
|
|
924
|
+
label={t("computerViewer.currentAgent")}
|
|
925
|
+
sessions={current}
|
|
926
|
+
selectedId={props.selectedSessionId}
|
|
927
|
+
interventionCounts={props.interventionCounts}
|
|
928
|
+
onSelect={choose}
|
|
929
|
+
/>
|
|
930
|
+
<ComputerSessionGroup
|
|
931
|
+
label={t("computerViewer.otherAgents")}
|
|
932
|
+
sessions={others}
|
|
933
|
+
selectedId={props.selectedSessionId}
|
|
934
|
+
interventionCounts={props.interventionCounts}
|
|
935
|
+
onSelect={choose}
|
|
936
|
+
/>
|
|
937
|
+
</div>
|
|
938
|
+
<div className="mt-1 flex shrink-0 gap-1 border-t border-og-border pt-1">
|
|
772
939
|
{current.length > 0 ? (
|
|
773
|
-
<MenuButton
|
|
940
|
+
<MenuButton
|
|
941
|
+
onClick={(event) => {
|
|
942
|
+
props.onFollow();
|
|
943
|
+
closeMenu(event.detail === 0);
|
|
944
|
+
}}
|
|
945
|
+
>
|
|
946
|
+
{t("computerViewer.followAgent")}
|
|
947
|
+
</MenuButton>
|
|
774
948
|
) : null}
|
|
775
949
|
{props.onCreate ? (
|
|
776
|
-
<MenuButton
|
|
777
|
-
|
|
950
|
+
<MenuButton
|
|
951
|
+
onClick={(event) => {
|
|
952
|
+
props.onCreate?.();
|
|
953
|
+
closeMenu(event.detail === 0);
|
|
954
|
+
}}
|
|
955
|
+
disabled={props.creating}
|
|
956
|
+
>
|
|
957
|
+
<PlusIcon className="size-3.5" /> {t("computerViewer.newDesktop")}
|
|
778
958
|
</MenuButton>
|
|
779
959
|
) : null}
|
|
780
960
|
</div>
|
|
781
961
|
</div>
|
|
782
962
|
</details>
|
|
783
|
-
<span className="min-w-0 flex-1 truncate text-og-xs text-og-subtle">
|
|
784
|
-
{selected ? `${platformLabel(selected)} · ${placementLabel(selected)}` : ""}
|
|
963
|
+
<span className="min-w-0 flex-1 truncate text-og-xs text-og-fg-subtle">
|
|
964
|
+
{selected ? `${platformLabel(t, selected)} · ${placementLabel(t, selected)}` : ""}
|
|
785
965
|
</span>
|
|
966
|
+
<ComputerTargetPicker
|
|
967
|
+
targets={props.targets}
|
|
968
|
+
selectedTargetId={props.selectedTargetId}
|
|
969
|
+
loading={props.targetsLoading}
|
|
970
|
+
onSelect={props.onSelectTarget}
|
|
971
|
+
/>
|
|
786
972
|
<button
|
|
787
973
|
type="button"
|
|
788
974
|
onClick={props.onRefresh}
|
|
789
|
-
|
|
790
|
-
aria-
|
|
975
|
+
disabled={props.refreshing}
|
|
976
|
+
aria-busy={props.refreshing}
|
|
977
|
+
className="grid size-7 place-items-center rounded-og-sm text-og-fg-muted transition hover:bg-og-surface-2 hover:text-og-fg"
|
|
978
|
+
aria-label={t("computerViewer.refreshDesktops")}
|
|
791
979
|
>
|
|
792
980
|
<RefreshCwIcon className={cn("size-3.5", props.refreshing && "animate-spin")} />
|
|
793
981
|
</button>
|
|
@@ -796,8 +984,8 @@ function ComputerToolbar(props: {
|
|
|
796
984
|
type="button"
|
|
797
985
|
onClick={props.onCreate}
|
|
798
986
|
disabled={props.creating}
|
|
799
|
-
className="
|
|
800
|
-
aria-label="
|
|
987
|
+
className="hidden size-7 place-items-center rounded-og-sm text-og-fg-muted transition hover:bg-og-surface-2 hover:text-og-fg disabled:opacity-40 @sm/computer-viewer:grid"
|
|
988
|
+
aria-label={t("computerViewer.openANewDesktop")}
|
|
801
989
|
>
|
|
802
990
|
{props.creating ? (
|
|
803
991
|
<LoaderCircleIcon className="size-3.5 animate-spin" />
|
|
@@ -815,12 +1003,13 @@ function ComputerSessionGroup(props: {
|
|
|
815
1003
|
sessions: ComputerSession[];
|
|
816
1004
|
selectedId: string | null;
|
|
817
1005
|
interventionCounts: Map<string, number>;
|
|
818
|
-
onSelect: (id: string) => void;
|
|
1006
|
+
onSelect: (id: string, restoreFocus: boolean) => void;
|
|
819
1007
|
}) {
|
|
1008
|
+
const t = useOpenGeniText();
|
|
820
1009
|
if (props.sessions.length === 0) return null;
|
|
821
1010
|
return (
|
|
822
1011
|
<div className="py-1">
|
|
823
|
-
<p className="px-2 pb-1 text-[10px] font-medium uppercase tracking-[0.12em] text-og-subtle">
|
|
1012
|
+
<p className="px-2 pb-1 text-[10px] font-medium uppercase tracking-[0.12em] text-og-fg-subtle">
|
|
824
1013
|
{props.label}
|
|
825
1014
|
</p>
|
|
826
1015
|
{props.sessions.map((session) => {
|
|
@@ -829,7 +1018,8 @@ function ComputerSessionGroup(props: {
|
|
|
829
1018
|
<button
|
|
830
1019
|
key={session.id}
|
|
831
1020
|
type="button"
|
|
832
|
-
onClick={() => props.onSelect(session.id)}
|
|
1021
|
+
onClick={(event) => props.onSelect(session.id, event.detail === 0)}
|
|
1022
|
+
aria-pressed={session.id === props.selectedId}
|
|
833
1023
|
className={cn(
|
|
834
1024
|
"flex w-full items-center gap-2 rounded-og-sm px-2 py-1.5 text-left transition hover:bg-og-surface-2",
|
|
835
1025
|
session.id === props.selectedId && "bg-og-surface-2",
|
|
@@ -843,8 +1033,8 @@ function ComputerSessionGroup(props: {
|
|
|
843
1033
|
/>
|
|
844
1034
|
<span className="min-w-0 flex-1">
|
|
845
1035
|
<span className="block truncate text-og-control text-og-fg">{session.name}</span>
|
|
846
|
-
<span className="block truncate text-og-xs text-og-subtle">
|
|
847
|
-
{platformLabel(session)} · {placementLabel(session)}
|
|
1036
|
+
<span className="block truncate text-og-xs text-og-fg-subtle">
|
|
1037
|
+
{platformLabel(t, session)} · {placementLabel(t, session)}
|
|
848
1038
|
</span>
|
|
849
1039
|
</span>
|
|
850
1040
|
{interventionCount > 0 ? (
|
|
@@ -859,65 +1049,126 @@ function ComputerSessionGroup(props: {
|
|
|
859
1049
|
);
|
|
860
1050
|
}
|
|
861
1051
|
|
|
862
|
-
function MenuButton(props: {
|
|
1052
|
+
function MenuButton(props: {
|
|
1053
|
+
children: ReactNode;
|
|
1054
|
+
onClick: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
1055
|
+
disabled?: boolean;
|
|
1056
|
+
}) {
|
|
863
1057
|
return (
|
|
864
1058
|
<button
|
|
865
1059
|
type="button"
|
|
866
1060
|
onClick={props.onClick}
|
|
867
1061
|
disabled={props.disabled}
|
|
868
|
-
className="flex h-7 flex-1 items-center justify-center gap-1 rounded-og-sm px-2 text-og-control text-og-muted transition hover:bg-og-surface-2 hover:text-og-fg disabled:opacity-50"
|
|
1062
|
+
className="flex h-7 flex-1 items-center justify-center gap-1 rounded-og-sm px-2 text-og-control text-og-fg-muted transition hover:bg-og-surface-2 hover:text-og-fg disabled:opacity-50"
|
|
869
1063
|
>
|
|
870
1064
|
{props.children}
|
|
871
1065
|
</button>
|
|
872
1066
|
);
|
|
873
1067
|
}
|
|
874
1068
|
|
|
875
|
-
function
|
|
1069
|
+
function ComputerTargetPicker(props: {
|
|
876
1070
|
targets: ComputerTarget[];
|
|
877
1071
|
selectedTargetId: string | null;
|
|
878
1072
|
loading: boolean;
|
|
879
1073
|
onSelect: (id: string) => void;
|
|
880
1074
|
}) {
|
|
881
|
-
const
|
|
1075
|
+
const t = useOpenGeniText();
|
|
1076
|
+
const screens = props.targets.filter((target) => target.kind === "screen");
|
|
1077
|
+
const advancedTargets = props.targets.filter(
|
|
1078
|
+
(target) =>
|
|
1079
|
+
target.kind === "app" || (target.kind === "window" && isRenderableComputerView(target)),
|
|
1080
|
+
);
|
|
1081
|
+
const advancedRef = useViewerMenuDismiss(advancedTargets.length > 0);
|
|
1082
|
+
const selected = props.targets.find((target) => target.id === props.selectedTargetId);
|
|
1083
|
+
const choose = (id: string, restoreFocus = false) => {
|
|
1084
|
+
props.onSelect(id);
|
|
1085
|
+
if (advancedRef.current?.open) {
|
|
1086
|
+
advancedRef.current.removeAttribute("open");
|
|
1087
|
+
if (restoreFocus) advancedRef.current.querySelector("summary")?.focus();
|
|
1088
|
+
}
|
|
1089
|
+
};
|
|
882
1090
|
return (
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
1091
|
+
<>
|
|
1092
|
+
{screens.length > 1 ? (
|
|
1093
|
+
<select
|
|
1094
|
+
aria-label={t("computerViewer.screen")}
|
|
1095
|
+
value={selected?.kind === "screen" ? selected.id : ""}
|
|
1096
|
+
onChange={(event) => choose(event.currentTarget.value)}
|
|
1097
|
+
className="h-7 min-w-0 max-w-28 rounded-og-sm border border-og-border bg-og-surface-1 px-1.5 text-og-control text-og-fg outline-hidden focus:border-og-accent @sm/computer-viewer:max-w-40"
|
|
1098
|
+
>
|
|
1099
|
+
<option value="" disabled hidden>
|
|
1100
|
+
{t("computerViewer.screen")}
|
|
1101
|
+
</option>
|
|
1102
|
+
{screens.map((screen, index) => (
|
|
1103
|
+
<option key={screen.id} value={screen.id}>
|
|
1104
|
+
{screen.title || t("computerViewer.screenIndex", { index: index + 1 })}
|
|
1105
|
+
</option>
|
|
1106
|
+
))}
|
|
1107
|
+
</select>
|
|
1108
|
+
) : screens[0] && selected?.kind !== "screen" ? (
|
|
888
1109
|
<button
|
|
889
|
-
key={target.id}
|
|
890
1110
|
type="button"
|
|
891
|
-
onClick={() =>
|
|
892
|
-
className=
|
|
893
|
-
"flex h-7 max-w-56 shrink-0 items-center gap-1.5 rounded-og-sm border px-2 text-og-control transition",
|
|
894
|
-
target.id === props.selectedTargetId
|
|
895
|
-
? "border-og-border-strong bg-og-surface-2 text-og-fg"
|
|
896
|
-
: "border-transparent text-og-muted hover:bg-og-surface-1 hover:text-og-fg",
|
|
897
|
-
)}
|
|
898
|
-
aria-pressed={target.id === props.selectedTargetId}
|
|
1111
|
+
onClick={() => choose(screens[0]!.id)}
|
|
1112
|
+
className="flex h-7 shrink-0 items-center gap-1.5 rounded-og-sm px-2 text-og-control text-og-fg-muted transition hover:bg-og-surface-2 hover:text-og-fg"
|
|
899
1113
|
>
|
|
900
|
-
|
|
901
|
-
<MonitorIcon className="size-3.5 shrink-0" />
|
|
902
|
-
) : (
|
|
903
|
-
<PanelsTopLeftIcon className="size-3.5 shrink-0" />
|
|
904
|
-
)}
|
|
905
|
-
<span className="truncate">{target.title || target.applicationId || target.kind}</span>
|
|
906
|
-
{target.focused ? (
|
|
907
|
-
<span
|
|
908
|
-
className="size-1.5 shrink-0 rounded-full bg-og-status-running"
|
|
909
|
-
aria-label="Focused"
|
|
910
|
-
/>
|
|
911
|
-
) : null}
|
|
1114
|
+
<MonitorIcon className="size-3.5" /> {t("computerViewer.fullDesktop")}
|
|
912
1115
|
</button>
|
|
913
|
-
))}
|
|
914
|
-
{props.loading ? (
|
|
915
|
-
<LoaderCircleIcon className="ml-1 size-3.5 animate-spin text-og-muted" />
|
|
916
1116
|
) : null}
|
|
917
|
-
{
|
|
918
|
-
<
|
|
1117
|
+
{advancedTargets.length > 0 ? (
|
|
1118
|
+
<details ref={advancedRef} className="shrink-0">
|
|
1119
|
+
<summary
|
|
1120
|
+
aria-label={t("computerViewer.advancedDesktopViews")}
|
|
1121
|
+
title={t("computerViewer.advancedDesktopViews")}
|
|
1122
|
+
className="flex h-7 cursor-pointer list-none items-center gap-1.5 rounded-og-sm px-2 text-og-control text-og-fg-muted transition hover:bg-og-surface-2 hover:text-og-fg [&::-webkit-details-marker]:hidden"
|
|
1123
|
+
>
|
|
1124
|
+
<PanelsTopLeftIcon className="size-3.5" />
|
|
1125
|
+
<span className="hidden @sm/computer-viewer:inline">
|
|
1126
|
+
{t("computerViewer.advanced")}
|
|
1127
|
+
</span>
|
|
1128
|
+
<ChevronDownIcon className="size-3" />
|
|
1129
|
+
</summary>
|
|
1130
|
+
<div className="absolute right-2 top-10 z-30 flex max-h-[calc(100%-3rem)] w-64 max-w-[calc(100%-1rem)] flex-col overflow-hidden rounded-og-md border border-og-border bg-og-surface-1 p-1 shadow-xl">
|
|
1131
|
+
<p className="shrink-0 px-2 py-1 text-og-xs text-og-fg-subtle">
|
|
1132
|
+
{t("computerViewer.appsAndWindows")}
|
|
1133
|
+
</p>
|
|
1134
|
+
<div className="min-h-0 max-h-80 overflow-y-auto overscroll-contain">
|
|
1135
|
+
{advancedTargets.map((target) => (
|
|
1136
|
+
<button
|
|
1137
|
+
key={target.id}
|
|
1138
|
+
type="button"
|
|
1139
|
+
onClick={(event) => choose(target.id, event.detail === 0)}
|
|
1140
|
+
aria-pressed={target.id === props.selectedTargetId}
|
|
1141
|
+
className={cn(
|
|
1142
|
+
"flex w-full min-w-0 items-center gap-2 rounded-og-sm px-2 py-1.5 text-left transition hover:bg-og-surface-2",
|
|
1143
|
+
target.id === props.selectedTargetId && "bg-og-surface-2",
|
|
1144
|
+
)}
|
|
1145
|
+
>
|
|
1146
|
+
<span className="min-w-0 flex-1">
|
|
1147
|
+
<span className="block truncate text-og-control text-og-fg">
|
|
1148
|
+
{target.title || target.applicationId || target.kind}
|
|
1149
|
+
</span>
|
|
1150
|
+
<span className="block text-og-xs text-og-fg-subtle">
|
|
1151
|
+
{target.kind === "app"
|
|
1152
|
+
? t("computerViewer.appControls")
|
|
1153
|
+
: t("computerViewer.windowView")}
|
|
1154
|
+
</span>
|
|
1155
|
+
</span>
|
|
1156
|
+
{target.focused ? (
|
|
1157
|
+
<span
|
|
1158
|
+
className="size-1.5 shrink-0 rounded-full bg-og-status-running"
|
|
1159
|
+
aria-label={t("computerViewer.focused")}
|
|
1160
|
+
/>
|
|
1161
|
+
) : null}
|
|
1162
|
+
</button>
|
|
1163
|
+
))}
|
|
1164
|
+
</div>
|
|
1165
|
+
</div>
|
|
1166
|
+
</details>
|
|
919
1167
|
) : null}
|
|
920
|
-
|
|
1168
|
+
{props.loading ? (
|
|
1169
|
+
<LoaderCircleIcon className="size-3.5 shrink-0 animate-spin text-og-fg-muted" />
|
|
1170
|
+
) : null}
|
|
1171
|
+
</>
|
|
921
1172
|
);
|
|
922
1173
|
}
|
|
923
1174
|
|
|
@@ -940,6 +1191,7 @@ function ComputerLifecyclePanel(props: {
|
|
|
940
1191
|
onRefresh: () => Promise<void>;
|
|
941
1192
|
onRetry: () => void;
|
|
942
1193
|
}) {
|
|
1194
|
+
const t = useOpenGeniText();
|
|
943
1195
|
const generationLoss = isAttachedChromeGenerationLoss(props.session);
|
|
944
1196
|
const failed = ["failed", "lost", "repair_required"].includes(props.session.lifecycle);
|
|
945
1197
|
const retryCreatesSession = ["failed", "lost"].includes(props.session.lifecycle);
|
|
@@ -947,22 +1199,22 @@ function ComputerLifecyclePanel(props: {
|
|
|
947
1199
|
<div className="grid min-h-0 flex-1 place-items-center bg-og-bg p-6">
|
|
948
1200
|
<div className="max-w-sm text-center">
|
|
949
1201
|
{failed ? (
|
|
950
|
-
<CircleAlertIcon className="mx-auto size-5 text-og-
|
|
1202
|
+
<CircleAlertIcon className="mx-auto size-5 text-og-danger" />
|
|
951
1203
|
) : (
|
|
952
|
-
<LoaderCircleIcon className="mx-auto size-5 animate-spin text-og-muted" />
|
|
1204
|
+
<LoaderCircleIcon className="mx-auto size-5 animate-spin text-og-fg-muted" />
|
|
953
1205
|
)}
|
|
954
1206
|
<p className="mt-3 text-og-menu font-medium text-og-fg">
|
|
955
1207
|
{generationLoss
|
|
956
|
-
? "
|
|
1208
|
+
? t("computerViewer.chromeReconnectedOpenAFresh")
|
|
957
1209
|
: failed
|
|
958
|
-
? "
|
|
959
|
-
: lifecycleLabel(props.session.lifecycle)}
|
|
1210
|
+
? t("computerViewer.desktopNeedsAttention")
|
|
1211
|
+
: lifecycleLabel(t, props.session.lifecycle)}
|
|
960
1212
|
</p>
|
|
961
|
-
<p className="mt-1 text-og-control leading-5 text-og-muted">
|
|
1213
|
+
<p className="mt-1 text-og-control leading-5 text-og-fg-muted">
|
|
962
1214
|
{generationLoss
|
|
963
|
-
? "
|
|
964
|
-
: (computerFailureMessage(props.session) ??
|
|
965
|
-
"
|
|
1215
|
+
? t("computerViewer.thisChromeProfileIsLive")
|
|
1216
|
+
: (computerFailureMessage(t, props.session) ??
|
|
1217
|
+
t("computerViewer.theDesktopIsBeingPrepared"))}
|
|
966
1218
|
</p>
|
|
967
1219
|
{failed && !generationLoss ? (
|
|
968
1220
|
<button
|
|
@@ -976,7 +1228,7 @@ function ComputerLifecyclePanel(props: {
|
|
|
976
1228
|
) : (
|
|
977
1229
|
<RotateCcwIcon className="size-3.5" />
|
|
978
1230
|
)}
|
|
979
|
-
{retryCreatesSession ? "
|
|
1231
|
+
{retryCreatesSession ? t("computerViewer.tryAgain") : t("computerViewer.checkAgain")}
|
|
980
1232
|
</button>
|
|
981
1233
|
) : null}
|
|
982
1234
|
</div>
|
|
@@ -984,23 +1236,42 @@ function ComputerLifecyclePanel(props: {
|
|
|
984
1236
|
);
|
|
985
1237
|
}
|
|
986
1238
|
|
|
1239
|
+
type ComputerQueuedAction = {
|
|
1240
|
+
operationId: string;
|
|
1241
|
+
started: Promise<boolean>;
|
|
1242
|
+
completion: Promise<void>;
|
|
1243
|
+
};
|
|
1244
|
+
|
|
987
1245
|
function ComputerViewport(props: {
|
|
988
1246
|
frame: ComputerFrame | null;
|
|
989
1247
|
observation: ComputerObservation | null;
|
|
990
1248
|
target: ComputerTarget | null;
|
|
991
1249
|
machineLocked: boolean;
|
|
1250
|
+
controlUnavailable: boolean;
|
|
1251
|
+
inputAllowed: boolean;
|
|
992
1252
|
connectionState: string;
|
|
993
1253
|
connectionError: Error | null;
|
|
994
1254
|
mutating: boolean;
|
|
995
1255
|
backgroundActions: boolean;
|
|
1256
|
+
backgroundInput: boolean;
|
|
1257
|
+
allowForegroundInputWithinOwnedSeat: boolean;
|
|
996
1258
|
clipboardEnabled: boolean;
|
|
997
|
-
|
|
1259
|
+
pointerInput: boolean;
|
|
1260
|
+
pointerClickContinuation: boolean;
|
|
1261
|
+
keyboardInput: boolean;
|
|
1262
|
+
onAction: (
|
|
1263
|
+
action: ComputerAction,
|
|
1264
|
+
frame: ComputerFrame | null,
|
|
1265
|
+
operationId?: string,
|
|
1266
|
+
) => Promise<ComputerActionReceipt>;
|
|
998
1267
|
onReadClipboard: () => Promise<ComputerClipboard>;
|
|
999
1268
|
onReconnect: () => void;
|
|
1000
1269
|
onError: (cause: unknown) => void;
|
|
1001
1270
|
}) {
|
|
1271
|
+
const t = useOpenGeniText();
|
|
1002
1272
|
const canvasRef = useRef<HTMLCanvasElement | null>(null);
|
|
1003
1273
|
const inputRef = useRef<HTMLTextAreaElement | null>(null);
|
|
1274
|
+
const composingRef = useRef(false);
|
|
1004
1275
|
const pointerStartRef = useRef<PointerStart | null>(null);
|
|
1005
1276
|
const clickTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
1006
1277
|
const lastClickRef = useRef<{
|
|
@@ -1008,6 +1279,11 @@ function ComputerViewport(props: {
|
|
|
1008
1279
|
x: number;
|
|
1009
1280
|
y: number;
|
|
1010
1281
|
frame: ComputerFrame;
|
|
1282
|
+
clientX: number;
|
|
1283
|
+
clientY: number;
|
|
1284
|
+
canvasRect: Pick<DOMRect, "left" | "top" | "width" | "height">;
|
|
1285
|
+
pending: boolean;
|
|
1286
|
+
delivery: ComputerQueuedAction | null;
|
|
1011
1287
|
} | null>(null);
|
|
1012
1288
|
const wheelRef = useRef<{
|
|
1013
1289
|
x: number;
|
|
@@ -1022,17 +1298,72 @@ function ComputerViewport(props: {
|
|
|
1022
1298
|
timer: ReturnType<typeof setTimeout>;
|
|
1023
1299
|
} | null>(null);
|
|
1024
1300
|
const actionRef = useRef(props.onAction);
|
|
1301
|
+
const targetRef = useRef(props.target);
|
|
1025
1302
|
const readClipboardRef = useRef(props.onReadClipboard);
|
|
1026
1303
|
const errorRef = useRef(props.onError);
|
|
1027
1304
|
const actionTailRef = useRef<Promise<void>>(Promise.resolve());
|
|
1305
|
+
const actionQueueEpochRef = useRef(0);
|
|
1306
|
+
const queuedTextRef = useRef<{
|
|
1307
|
+
action: Extract<ComputerAction, { type: "keyboard" }>;
|
|
1308
|
+
epoch: number;
|
|
1309
|
+
delivery: ComputerQueuedAction;
|
|
1310
|
+
} | null>(null);
|
|
1028
1311
|
const queuedFrameRef = useRef<ComputerFrame | null>(null);
|
|
1312
|
+
const currentFrameRef = useRef<ComputerFrame | null>(props.frame);
|
|
1313
|
+
const paintedFrameRef = useRef<ComputerFrame | null>(null);
|
|
1314
|
+
const [paintedFrame, setPaintedFrame] = useState<ComputerFrame | null>(null);
|
|
1029
1315
|
const decodingFrameRef = useRef(false);
|
|
1030
1316
|
const mountedRef = useRef(true);
|
|
1031
1317
|
actionRef.current = props.onAction;
|
|
1318
|
+
targetRef.current = props.target;
|
|
1032
1319
|
readClipboardRef.current = props.onReadClipboard;
|
|
1033
1320
|
errorRef.current = props.onError;
|
|
1321
|
+
const streamFailed = props.connectionState === "error";
|
|
1034
1322
|
const rawInputEnabled =
|
|
1035
|
-
|
|
1323
|
+
props.target?.kind !== "app" &&
|
|
1324
|
+
!streamFailed &&
|
|
1325
|
+
!props.controlUnavailable &&
|
|
1326
|
+
!props.machineLocked &&
|
|
1327
|
+
(props.backgroundInput ||
|
|
1328
|
+
// CUA may activate within its allocated Linux desktop. This does not
|
|
1329
|
+
// grant foreground input to an attached physical desktop.
|
|
1330
|
+
props.allowForegroundInputWithinOwnedSeat ||
|
|
1331
|
+
!props.backgroundActions ||
|
|
1332
|
+
props.target?.kind === "screen" ||
|
|
1333
|
+
props.target?.focused === true);
|
|
1334
|
+
|
|
1335
|
+
const clearBufferedInput = useCallback(() => {
|
|
1336
|
+
if (clickTimerRef.current) clearTimeout(clickTimerRef.current);
|
|
1337
|
+
if (wheelRef.current?.timer) clearTimeout(wheelRef.current.timer);
|
|
1338
|
+
if (pendingTextRef.current?.timer) clearTimeout(pendingTextRef.current.timer);
|
|
1339
|
+
clickTimerRef.current = null;
|
|
1340
|
+
wheelRef.current = null;
|
|
1341
|
+
pendingTextRef.current = null;
|
|
1342
|
+
queuedTextRef.current = null;
|
|
1343
|
+
pointerStartRef.current = null;
|
|
1344
|
+
lastClickRef.current = null;
|
|
1345
|
+
composingRef.current = false;
|
|
1346
|
+
if (inputRef.current) inputRef.current.value = "";
|
|
1347
|
+
}, []);
|
|
1348
|
+
|
|
1349
|
+
const pointerInputEnabled = rawInputEnabled && props.pointerInput;
|
|
1350
|
+
const keyboardInputEnabled = rawInputEnabled && props.keyboardInput;
|
|
1351
|
+
|
|
1352
|
+
useLayoutEffect(() => {
|
|
1353
|
+
const canvas = canvasRef.current;
|
|
1354
|
+
const viewport = canvas?.parentElement;
|
|
1355
|
+
if (!canvas || !viewport) return;
|
|
1356
|
+
const fit = () => fitComputerCanvas(canvas);
|
|
1357
|
+
fit();
|
|
1358
|
+
if (typeof ResizeObserver === "undefined") {
|
|
1359
|
+
window.addEventListener("resize", fit);
|
|
1360
|
+
return () => window.removeEventListener("resize", fit);
|
|
1361
|
+
}
|
|
1362
|
+
// The canvas is absolute, so fitting it cannot resize the observed dock.
|
|
1363
|
+
const observer = new ResizeObserver(fit);
|
|
1364
|
+
observer.observe(viewport);
|
|
1365
|
+
return () => observer.disconnect();
|
|
1366
|
+
}, []);
|
|
1036
1367
|
|
|
1037
1368
|
const paintQueuedFrames = useCallback(() => {
|
|
1038
1369
|
if (decodingFrameRef.current) return;
|
|
@@ -1050,8 +1381,15 @@ function ComputerViewport(props: {
|
|
|
1050
1381
|
const bitmap = await createImageBitmap(blob);
|
|
1051
1382
|
try {
|
|
1052
1383
|
const canvas = canvasRef.current;
|
|
1053
|
-
if (
|
|
1384
|
+
if (
|
|
1385
|
+
mountedRef.current &&
|
|
1386
|
+
canvas &&
|
|
1387
|
+
currentFrameRef.current &&
|
|
1388
|
+
sameComputerTarget(frame, currentFrameRef.current)
|
|
1389
|
+
) {
|
|
1054
1390
|
paintCanvas(canvas, bitmap, frame.width, frame.height);
|
|
1391
|
+
paintedFrameRef.current = frame;
|
|
1392
|
+
setPaintedFrame(frame);
|
|
1055
1393
|
}
|
|
1056
1394
|
} finally {
|
|
1057
1395
|
bitmap.close();
|
|
@@ -1061,11 +1399,23 @@ function ComputerViewport(props: {
|
|
|
1061
1399
|
objectUrl = URL.createObjectURL(blob);
|
|
1062
1400
|
const image = await loadImage(objectUrl);
|
|
1063
1401
|
const canvas = canvasRef.current;
|
|
1064
|
-
if (
|
|
1402
|
+
if (
|
|
1403
|
+
mountedRef.current &&
|
|
1404
|
+
canvas &&
|
|
1405
|
+
currentFrameRef.current &&
|
|
1406
|
+
sameComputerTarget(frame, currentFrameRef.current)
|
|
1407
|
+
) {
|
|
1065
1408
|
paintCanvas(canvas, image, frame.width, frame.height);
|
|
1409
|
+
paintedFrameRef.current = frame;
|
|
1410
|
+
setPaintedFrame(frame);
|
|
1066
1411
|
}
|
|
1067
1412
|
} catch (cause) {
|
|
1068
|
-
if (
|
|
1413
|
+
if (
|
|
1414
|
+
mountedRef.current &&
|
|
1415
|
+
currentFrameRef.current &&
|
|
1416
|
+
sameComputerTarget(frame, currentFrameRef.current)
|
|
1417
|
+
)
|
|
1418
|
+
errorRef.current(cause);
|
|
1069
1419
|
} finally {
|
|
1070
1420
|
if (objectUrl) URL.revokeObjectURL(objectUrl);
|
|
1071
1421
|
}
|
|
@@ -1077,40 +1427,127 @@ function ComputerViewport(props: {
|
|
|
1077
1427
|
})();
|
|
1078
1428
|
}, []);
|
|
1079
1429
|
|
|
1080
|
-
|
|
1430
|
+
useLayoutEffect(() => {
|
|
1081
1431
|
mountedRef.current = true;
|
|
1082
1432
|
return () => {
|
|
1083
1433
|
mountedRef.current = false;
|
|
1434
|
+
actionQueueEpochRef.current += 1;
|
|
1084
1435
|
queuedFrameRef.current = null;
|
|
1436
|
+
clearBufferedInput();
|
|
1085
1437
|
};
|
|
1086
|
-
}, []);
|
|
1438
|
+
}, [clearBufferedInput]);
|
|
1087
1439
|
|
|
1088
|
-
|
|
1089
|
-
if (!props.frame)
|
|
1440
|
+
useLayoutEffect(() => {
|
|
1441
|
+
if (currentFrameRef.current && !props.frame) {
|
|
1442
|
+
actionQueueEpochRef.current += 1;
|
|
1443
|
+
clearBufferedInput();
|
|
1444
|
+
}
|
|
1445
|
+
currentFrameRef.current = props.frame;
|
|
1446
|
+
if (!props.frame) {
|
|
1447
|
+
queuedFrameRef.current = null;
|
|
1448
|
+
paintedFrameRef.current = null;
|
|
1449
|
+
setPaintedFrame(null);
|
|
1450
|
+
return;
|
|
1451
|
+
}
|
|
1090
1452
|
queuedFrameRef.current = props.frame;
|
|
1091
1453
|
paintQueuedFrames();
|
|
1092
|
-
}, [paintQueuedFrames, props.frame]);
|
|
1454
|
+
}, [clearBufferedInput, paintQueuedFrames, props.frame]);
|
|
1093
1455
|
|
|
1094
|
-
|
|
1095
|
-
(
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
[],
|
|
1101
|
-
);
|
|
1456
|
+
useLayoutEffect(() => {
|
|
1457
|
+
if (!rawInputEnabled || !props.pointerInput || !props.keyboardInput) {
|
|
1458
|
+
actionQueueEpochRef.current += 1;
|
|
1459
|
+
clearBufferedInput();
|
|
1460
|
+
}
|
|
1461
|
+
}, [clearBufferedInput, props.keyboardInput, props.pointerInput, rawInputEnabled]);
|
|
1102
1462
|
|
|
1103
1463
|
const enqueue = useCallback(
|
|
1104
|
-
(
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1464
|
+
(
|
|
1465
|
+
action: ComputerAction,
|
|
1466
|
+
frame: ComputerFrame | null,
|
|
1467
|
+
after?: (isCurrent: () => boolean) => Promise<void>,
|
|
1468
|
+
continuation?: ComputerQueuedAction,
|
|
1469
|
+
) => {
|
|
1470
|
+
const epoch = actionQueueEpochRef.current;
|
|
1471
|
+
const plainText = action.type === "keyboard" && action.action === "type";
|
|
1472
|
+
const queuedText = queuedTextRef.current;
|
|
1473
|
+
if (
|
|
1474
|
+
plainText &&
|
|
1475
|
+
!frame &&
|
|
1476
|
+
!after &&
|
|
1477
|
+
!continuation &&
|
|
1478
|
+
queuedText?.epoch === epoch &&
|
|
1479
|
+
queuedText.delivery.completion === actionTailRef.current &&
|
|
1480
|
+
queuedText.action.value.length + action.value.length <= 1_000_000
|
|
1481
|
+
) {
|
|
1482
|
+
// Only combine adjacent text that has not crossed the dispatch boundary.
|
|
1483
|
+
queuedText.action.value += action.value;
|
|
1484
|
+
return queuedText.delivery;
|
|
1485
|
+
}
|
|
1486
|
+
queuedTextRef.current = null;
|
|
1487
|
+
const dispatch = actionRef.current;
|
|
1488
|
+
const admittedTarget = targetRef.current;
|
|
1489
|
+
const isCurrent = () => mountedRef.current && epoch === actionQueueEpochRef.current;
|
|
1490
|
+
const operationId = crypto.randomUUID();
|
|
1491
|
+
let markStarted!: (value: boolean) => void;
|
|
1492
|
+
const started = new Promise<boolean>((resolve) => {
|
|
1493
|
+
markStarted = resolve;
|
|
1494
|
+
});
|
|
1495
|
+
const previous = actionTailRef.current;
|
|
1496
|
+
// Only the real second click may start before its first HTTP receipt.
|
|
1497
|
+
// The controller queue and native causal proof still serialize delivery.
|
|
1498
|
+
const ready =
|
|
1499
|
+
continuation && previous === continuation.completion
|
|
1500
|
+
? continuation.started
|
|
1501
|
+
: previous.then(() => true);
|
|
1502
|
+
const delivery = ready
|
|
1503
|
+
.then(async (firstStarted) => {
|
|
1504
|
+
if (queuedTextRef.current?.action === action) queuedTextRef.current = null;
|
|
1505
|
+
if (!firstStarted || !isCurrent()) {
|
|
1506
|
+
markStarted(false);
|
|
1507
|
+
return;
|
|
1508
|
+
}
|
|
1509
|
+
const pending = dispatch(action, frame, operationId);
|
|
1510
|
+
markStarted(true);
|
|
1511
|
+
const receipt = await pending;
|
|
1512
|
+
const isCurrentResult = () => isCurrent() && !isStaleComputerActionResult(receipt);
|
|
1513
|
+
if (!isCurrentResult()) return;
|
|
1514
|
+
const observedTarget = receipt.observation?.target;
|
|
1515
|
+
if (
|
|
1516
|
+
!admittedTarget ||
|
|
1517
|
+
receipt.computerSessionId !== admittedTarget.computerSessionId ||
|
|
1518
|
+
receipt.controllerGeneration !== admittedTarget.controllerGeneration ||
|
|
1519
|
+
receipt.targetId !== admittedTarget.id ||
|
|
1520
|
+
(observedTarget &&
|
|
1521
|
+
(observedTarget.computerSessionId !== admittedTarget.computerSessionId ||
|
|
1522
|
+
observedTarget.controllerGeneration !== admittedTarget.controllerGeneration ||
|
|
1523
|
+
observedTarget.id !== admittedTarget.id ||
|
|
1524
|
+
observedTarget.targetGeneration !== admittedTarget.targetGeneration))
|
|
1525
|
+
) {
|
|
1526
|
+
// Receipt projection can replace the target before React remounts us.
|
|
1527
|
+
actionQueueEpochRef.current += 1;
|
|
1528
|
+
clearBufferedInput();
|
|
1529
|
+
return;
|
|
1530
|
+
}
|
|
1531
|
+
await after?.(isCurrentResult);
|
|
1110
1532
|
})
|
|
1111
|
-
.catch((cause) =>
|
|
1533
|
+
.catch((cause) => {
|
|
1534
|
+
markStarted(false);
|
|
1535
|
+
if (!isCurrent() || isStaleComputerActionResult(cause)) return;
|
|
1536
|
+
actionQueueEpochRef.current += 1;
|
|
1537
|
+
clearBufferedInput();
|
|
1538
|
+
errorRef.current(cause);
|
|
1539
|
+
});
|
|
1540
|
+
const completion = continuation
|
|
1541
|
+
? Promise.all([previous, delivery]).then(() => undefined)
|
|
1542
|
+
: delivery;
|
|
1543
|
+
actionTailRef.current = completion;
|
|
1544
|
+
const queued = { operationId, started, completion };
|
|
1545
|
+
if (plainText && !frame && !after && !continuation) {
|
|
1546
|
+
queuedTextRef.current = { action, epoch, delivery: queued };
|
|
1547
|
+
}
|
|
1548
|
+
return queued;
|
|
1112
1549
|
},
|
|
1113
|
-
[],
|
|
1550
|
+
[clearBufferedInput],
|
|
1114
1551
|
);
|
|
1115
1552
|
|
|
1116
1553
|
const point = useCallback(
|
|
@@ -1133,6 +1570,7 @@ function ComputerViewport(props: {
|
|
|
1133
1570
|
if (clickTimerRef.current) clearTimeout(clickTimerRef.current);
|
|
1134
1571
|
clickTimerRef.current = null;
|
|
1135
1572
|
lastClickRef.current = null;
|
|
1573
|
+
if (!pending.pending) return;
|
|
1136
1574
|
enqueue(
|
|
1137
1575
|
{
|
|
1138
1576
|
type: "pointer",
|
|
@@ -1145,24 +1583,55 @@ function ComputerViewport(props: {
|
|
|
1145
1583
|
);
|
|
1146
1584
|
}, [enqueue]);
|
|
1147
1585
|
|
|
1586
|
+
const flushPendingWheel = useCallback(() => {
|
|
1587
|
+
const batch = wheelRef.current;
|
|
1588
|
+
if (!batch) return;
|
|
1589
|
+
if (batch.timer) clearTimeout(batch.timer);
|
|
1590
|
+
wheelRef.current = null;
|
|
1591
|
+
enqueue(
|
|
1592
|
+
{
|
|
1593
|
+
type: "pointer",
|
|
1594
|
+
frameId: batch.frame.frameId,
|
|
1595
|
+
action: "scroll",
|
|
1596
|
+
x: batch.x,
|
|
1597
|
+
y: batch.y,
|
|
1598
|
+
deltaX: batch.deltaX,
|
|
1599
|
+
deltaY: batch.deltaY,
|
|
1600
|
+
},
|
|
1601
|
+
batch.frame,
|
|
1602
|
+
);
|
|
1603
|
+
}, [enqueue]);
|
|
1604
|
+
|
|
1148
1605
|
const pointerDown = (event: PointerEvent<HTMLCanvasElement>) => {
|
|
1149
|
-
|
|
1606
|
+
const frame = paintedFrameRef.current;
|
|
1607
|
+
if (
|
|
1608
|
+
!frame ||
|
|
1609
|
+
(!props.pointerClickContinuation && props.mutating) ||
|
|
1610
|
+
!rawInputEnabled ||
|
|
1611
|
+
event.button !== 0
|
|
1612
|
+
)
|
|
1613
|
+
return;
|
|
1614
|
+
// Preserve the keyboard sink's focus through the canvas pointer default action.
|
|
1615
|
+
event.preventDefault();
|
|
1616
|
+
if (keyboardInputEnabled) inputRef.current?.focus({ preventScroll: true });
|
|
1617
|
+
if (!pointerInputEnabled) return;
|
|
1618
|
+
flushPendingWheel();
|
|
1150
1619
|
flushPendingText();
|
|
1151
1620
|
pointerStartRef.current = {
|
|
1152
1621
|
x: event.clientX,
|
|
1153
1622
|
y: event.clientY,
|
|
1154
1623
|
pointerId: event.pointerId,
|
|
1155
|
-
frame
|
|
1624
|
+
frame,
|
|
1156
1625
|
};
|
|
1157
1626
|
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
1158
|
-
inputRef.current?.focus({ preventScroll: true });
|
|
1159
1627
|
};
|
|
1160
1628
|
|
|
1161
1629
|
const pointerUp = (event: PointerEvent<HTMLCanvasElement>) => {
|
|
1162
|
-
if (!
|
|
1630
|
+
if (!pointerInputEnabled) return;
|
|
1163
1631
|
const start = pointerStartRef.current;
|
|
1164
1632
|
pointerStartRef.current = null;
|
|
1165
1633
|
if (!start || start.pointerId !== event.pointerId) return;
|
|
1634
|
+
const canvasRect = event.currentTarget.getBoundingClientRect();
|
|
1166
1635
|
const from = point(start.frame, start.x, start.y);
|
|
1167
1636
|
const to = point(start.frame, event.clientX, event.clientY);
|
|
1168
1637
|
if (!from || !to) return;
|
|
@@ -1187,8 +1656,18 @@ function ComputerViewport(props: {
|
|
|
1187
1656
|
if (
|
|
1188
1657
|
previous &&
|
|
1189
1658
|
now - previous.at < 280 &&
|
|
1190
|
-
|
|
1191
|
-
|
|
1659
|
+
previous.pending === !props.pointerClickContinuation &&
|
|
1660
|
+
(props.pointerClickContinuation
|
|
1661
|
+
? Math.hypot(previous.clientX - event.clientX, previous.clientY - event.clientY) < 6 &&
|
|
1662
|
+
previous.canvasRect.left === canvasRect.left &&
|
|
1663
|
+
previous.canvasRect.top === canvasRect.top &&
|
|
1664
|
+
previous.canvasRect.width === canvasRect.width &&
|
|
1665
|
+
previous.canvasRect.height === canvasRect.height &&
|
|
1666
|
+
sameComputerTarget(previous.frame, start.frame) &&
|
|
1667
|
+
previous.frame.width === start.frame.width &&
|
|
1668
|
+
previous.frame.height === start.frame.height
|
|
1669
|
+
: Math.hypot(previous.x - to.x, previous.y - to.y) < 6 &&
|
|
1670
|
+
sameFrameFence(previous.frame, start.frame))
|
|
1192
1671
|
) {
|
|
1193
1672
|
if (clickTimerRef.current) clearTimeout(clickTimerRef.current);
|
|
1194
1673
|
clickTimerRef.current = null;
|
|
@@ -1197,15 +1676,47 @@ function ComputerViewport(props: {
|
|
|
1197
1676
|
{
|
|
1198
1677
|
type: "pointer",
|
|
1199
1678
|
frameId: start.frame.frameId,
|
|
1200
|
-
action: "double_click",
|
|
1679
|
+
action: props.pointerClickContinuation ? "click" : "double_click",
|
|
1680
|
+
...(props.pointerClickContinuation ? { clickCount: 2 as const } : {}),
|
|
1681
|
+
...(previous.delivery
|
|
1682
|
+
? { continuationOfOperationId: previous.delivery.operationId }
|
|
1683
|
+
: {}),
|
|
1684
|
+
x: to.x,
|
|
1685
|
+
y: to.y,
|
|
1686
|
+
},
|
|
1687
|
+
start.frame,
|
|
1688
|
+
undefined,
|
|
1689
|
+
previous.delivery ?? undefined,
|
|
1690
|
+
);
|
|
1691
|
+
return;
|
|
1692
|
+
}
|
|
1693
|
+
flushPendingClick();
|
|
1694
|
+
lastClickRef.current = {
|
|
1695
|
+
at: now,
|
|
1696
|
+
x: to.x,
|
|
1697
|
+
y: to.y,
|
|
1698
|
+
frame: start.frame,
|
|
1699
|
+
clientX: event.clientX,
|
|
1700
|
+
clientY: event.clientY,
|
|
1701
|
+
canvasRect,
|
|
1702
|
+
pending: !props.pointerClickContinuation,
|
|
1703
|
+
delivery: null,
|
|
1704
|
+
};
|
|
1705
|
+
if (props.pointerClickContinuation) {
|
|
1706
|
+
const delivery = enqueue(
|
|
1707
|
+
{
|
|
1708
|
+
type: "pointer",
|
|
1709
|
+
frameId: start.frame.frameId,
|
|
1710
|
+
action: "click",
|
|
1711
|
+
clickCount: 1,
|
|
1201
1712
|
x: to.x,
|
|
1202
1713
|
y: to.y,
|
|
1203
1714
|
},
|
|
1204
1715
|
start.frame,
|
|
1205
1716
|
);
|
|
1717
|
+
if (lastClickRef.current) lastClickRef.current.delivery = delivery;
|
|
1206
1718
|
return;
|
|
1207
1719
|
}
|
|
1208
|
-
lastClickRef.current = { at: now, x: to.x, y: to.y, frame: start.frame };
|
|
1209
1720
|
clickTimerRef.current = setTimeout(() => {
|
|
1210
1721
|
clickTimerRef.current = null;
|
|
1211
1722
|
lastClickRef.current = null;
|
|
@@ -1224,9 +1735,10 @@ function ComputerViewport(props: {
|
|
|
1224
1735
|
|
|
1225
1736
|
const contextMenu = (event: MouseEvent<HTMLCanvasElement>) => {
|
|
1226
1737
|
event.preventDefault();
|
|
1227
|
-
if (!
|
|
1228
|
-
const frame =
|
|
1738
|
+
if (!pointerInputEnabled) return;
|
|
1739
|
+
const frame = paintedFrameRef.current;
|
|
1229
1740
|
if (!frame) return;
|
|
1741
|
+
flushPendingWheel();
|
|
1230
1742
|
flushPendingText();
|
|
1231
1743
|
flushPendingClick();
|
|
1232
1744
|
const at = point(frame, event.clientX, event.clientY);
|
|
@@ -1246,45 +1758,43 @@ function ComputerViewport(props: {
|
|
|
1246
1758
|
};
|
|
1247
1759
|
|
|
1248
1760
|
const wheel = (event: WheelEvent<HTMLCanvasElement>) => {
|
|
1249
|
-
if (!
|
|
1250
|
-
const frame =
|
|
1761
|
+
if (!pointerInputEnabled) return;
|
|
1762
|
+
const frame = paintedFrameRef.current;
|
|
1251
1763
|
if (!frame) return;
|
|
1252
1764
|
const at = point(frame, event.clientX, event.clientY);
|
|
1253
1765
|
if (!at) return;
|
|
1254
1766
|
flushPendingText();
|
|
1255
1767
|
flushPendingClick();
|
|
1256
1768
|
event.preventDefault();
|
|
1257
|
-
|
|
1258
|
-
if (
|
|
1769
|
+
let pending = wheelRef.current;
|
|
1770
|
+
if (
|
|
1771
|
+
pending &&
|
|
1772
|
+
(!sameComputerTarget(pending.frame, frame) ||
|
|
1773
|
+
Math.hypot(pending.x - at.x, pending.y - at.y) > 6)
|
|
1774
|
+
) {
|
|
1775
|
+
flushPendingWheel();
|
|
1776
|
+
pending = null;
|
|
1777
|
+
}
|
|
1259
1778
|
wheelRef.current = {
|
|
1260
1779
|
x: at.x,
|
|
1261
1780
|
y: at.y,
|
|
1262
|
-
deltaX: (pending
|
|
1263
|
-
deltaY: (pending
|
|
1781
|
+
deltaX: (pending?.deltaX ?? 0) + event.deltaX,
|
|
1782
|
+
deltaY: (pending?.deltaY ?? 0) + event.deltaY,
|
|
1264
1783
|
frame,
|
|
1265
|
-
timer: setTimeout(
|
|
1266
|
-
const batch = wheelRef.current;
|
|
1267
|
-
wheelRef.current = null;
|
|
1268
|
-
if (batch) {
|
|
1269
|
-
enqueue(
|
|
1270
|
-
{
|
|
1271
|
-
type: "pointer",
|
|
1272
|
-
frameId: batch.frame.frameId,
|
|
1273
|
-
action: "scroll",
|
|
1274
|
-
x: batch.x,
|
|
1275
|
-
y: batch.y,
|
|
1276
|
-
deltaX: batch.deltaX,
|
|
1277
|
-
deltaY: batch.deltaY,
|
|
1278
|
-
},
|
|
1279
|
-
batch.frame,
|
|
1280
|
-
);
|
|
1281
|
-
}
|
|
1282
|
-
}, 45),
|
|
1784
|
+
timer: pending?.timer ?? setTimeout(flushPendingWheel, 45),
|
|
1283
1785
|
};
|
|
1284
1786
|
};
|
|
1285
1787
|
|
|
1286
1788
|
const keyDown = (event: KeyboardEvent<HTMLTextAreaElement>) => {
|
|
1287
|
-
if (!
|
|
1789
|
+
if (!keyboardInputEnabled) return;
|
|
1790
|
+
if (
|
|
1791
|
+
composingRef.current ||
|
|
1792
|
+
event.nativeEvent.isComposing ||
|
|
1793
|
+
event.nativeEvent.keyCode === 229
|
|
1794
|
+
) {
|
|
1795
|
+
return;
|
|
1796
|
+
}
|
|
1797
|
+
flushPendingWheel();
|
|
1288
1798
|
const command = event.metaKey || event.ctrlKey;
|
|
1289
1799
|
if (
|
|
1290
1800
|
props.clipboardEnabled &&
|
|
@@ -1304,33 +1814,43 @@ function ComputerViewport(props: {
|
|
|
1304
1814
|
};
|
|
1305
1815
|
|
|
1306
1816
|
const copy = (event: ClipboardEvent<HTMLTextAreaElement>) => {
|
|
1307
|
-
if (!props.clipboardEnabled || !
|
|
1817
|
+
if (!props.clipboardEnabled || !keyboardInputEnabled) return;
|
|
1308
1818
|
event.preventDefault();
|
|
1819
|
+
flushPendingWheel();
|
|
1309
1820
|
flushPendingText();
|
|
1310
1821
|
flushPendingClick();
|
|
1311
|
-
|
|
1312
|
-
|
|
1822
|
+
const readClipboard = readClipboardRef.current;
|
|
1823
|
+
enqueue({ type: "clipboard", operation: "copy" }, null, async (isCurrent) => {
|
|
1824
|
+
const clipboard = await readClipboard();
|
|
1825
|
+
if (!isCurrent()) return;
|
|
1313
1826
|
if (!clipboard.text) return;
|
|
1314
1827
|
if (!(await copyTextToClipboard(clipboard.text))) {
|
|
1315
|
-
throw new Error("
|
|
1828
|
+
throw new Error(t("computerViewer.desktopTextCouldNotBe"));
|
|
1316
1829
|
}
|
|
1317
1830
|
});
|
|
1318
1831
|
};
|
|
1319
1832
|
|
|
1320
1833
|
const paste = (event: ClipboardEvent<HTMLTextAreaElement>) => {
|
|
1321
|
-
if (!props.clipboardEnabled || !
|
|
1834
|
+
if (!props.clipboardEnabled || !keyboardInputEnabled) return;
|
|
1322
1835
|
event.preventDefault();
|
|
1836
|
+
flushPendingWheel();
|
|
1323
1837
|
flushPendingText();
|
|
1324
1838
|
flushPendingClick();
|
|
1325
1839
|
const text = event.clipboardData.getData("text/plain");
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1840
|
+
const readClipboard = readClipboardRef.current;
|
|
1841
|
+
const dispatch = actionRef.current;
|
|
1842
|
+
enqueue({ type: "clipboard", operation: "write", text }, null, async (isCurrent) => {
|
|
1843
|
+
const clipboard = await readClipboard();
|
|
1844
|
+
if (!isCurrent()) return;
|
|
1845
|
+
assertExactComputerClipboard(t, clipboard, text);
|
|
1846
|
+
await dispatch({ type: "clipboard", operation: "paste" }, null);
|
|
1329
1847
|
});
|
|
1330
1848
|
};
|
|
1331
1849
|
|
|
1332
|
-
const input = (value: string) => {
|
|
1333
|
-
if (
|
|
1850
|
+
const input = (value: string, nativeComposing = false) => {
|
|
1851
|
+
if (composingRef.current || nativeComposing) return;
|
|
1852
|
+
if (!value || !keyboardInputEnabled) return;
|
|
1853
|
+
flushPendingWheel();
|
|
1334
1854
|
flushPendingClick();
|
|
1335
1855
|
const pending = pendingTextRef.current;
|
|
1336
1856
|
if (pending) {
|
|
@@ -1346,7 +1866,17 @@ function ComputerViewport(props: {
|
|
|
1346
1866
|
if (inputRef.current) inputRef.current.value = "";
|
|
1347
1867
|
};
|
|
1348
1868
|
|
|
1349
|
-
const
|
|
1869
|
+
const compositionEnd = (event: CompositionEvent<HTMLTextAreaElement>) => {
|
|
1870
|
+
composingRef.current = false;
|
|
1871
|
+
input(event.currentTarget.value || event.data);
|
|
1872
|
+
};
|
|
1873
|
+
|
|
1874
|
+
const showCanvas =
|
|
1875
|
+
props.frame !== null &&
|
|
1876
|
+
paintedFrame !== null &&
|
|
1877
|
+
sameComputerTarget(props.frame, paintedFrame) &&
|
|
1878
|
+
!props.machineLocked &&
|
|
1879
|
+
!streamFailed;
|
|
1350
1880
|
return (
|
|
1351
1881
|
<div className="relative min-h-0 flex-1 overflow-hidden bg-black">
|
|
1352
1882
|
<canvas
|
|
@@ -1354,7 +1884,7 @@ function ComputerViewport(props: {
|
|
|
1354
1884
|
className={cn(
|
|
1355
1885
|
"absolute inset-0 m-auto max-h-full max-w-full touch-none focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-og-accent",
|
|
1356
1886
|
!showCanvas && "invisible",
|
|
1357
|
-
!
|
|
1887
|
+
!pointerInputEnabled && "cursor-default",
|
|
1358
1888
|
)}
|
|
1359
1889
|
onPointerDown={pointerDown}
|
|
1360
1890
|
onPointerUp={pointerUp}
|
|
@@ -1363,26 +1893,42 @@ function ComputerViewport(props: {
|
|
|
1363
1893
|
}}
|
|
1364
1894
|
onContextMenu={contextMenu}
|
|
1365
1895
|
onWheel={wheel}
|
|
1366
|
-
aria-label={
|
|
1896
|
+
aria-label={t(
|
|
1897
|
+
props.target?.kind === "app"
|
|
1898
|
+
? "computerViewer.interactiveAppView"
|
|
1899
|
+
: props.target?.kind === "window"
|
|
1900
|
+
? "computerViewer.interactiveWindowView"
|
|
1901
|
+
: props.target?.kind === "screen"
|
|
1902
|
+
? "computerViewer.interactiveScreenView"
|
|
1903
|
+
: "computerViewer.interactiveDesktopView",
|
|
1904
|
+
)}
|
|
1367
1905
|
/>
|
|
1368
1906
|
<textarea
|
|
1369
1907
|
ref={inputRef}
|
|
1370
1908
|
defaultValue=""
|
|
1371
|
-
onInput={(event) =>
|
|
1909
|
+
onInput={(event) =>
|
|
1910
|
+
input(event.currentTarget.value, (event.nativeEvent as InputEvent).isComposing)
|
|
1911
|
+
}
|
|
1912
|
+
onCompositionStart={() => {
|
|
1913
|
+
composingRef.current = true;
|
|
1914
|
+
}}
|
|
1915
|
+
onCompositionEnd={compositionEnd}
|
|
1372
1916
|
onKeyDown={keyDown}
|
|
1373
1917
|
onCopy={copy}
|
|
1374
1918
|
onPaste={paste}
|
|
1375
1919
|
className="pointer-events-none absolute left-1/2 top-1/2 size-px resize-none overflow-hidden opacity-0"
|
|
1376
|
-
aria-label="
|
|
1920
|
+
aria-label={t("computerViewer.desktopKeyboardInput")}
|
|
1377
1921
|
autoCapitalize="off"
|
|
1378
1922
|
autoCorrect="off"
|
|
1379
1923
|
spellCheck={false}
|
|
1380
|
-
disabled={!
|
|
1924
|
+
disabled={!keyboardInputEnabled}
|
|
1381
1925
|
/>
|
|
1382
1926
|
{!showCanvas ? (
|
|
1383
1927
|
<ComputerViewportFallback
|
|
1384
1928
|
observation={props.observation}
|
|
1385
1929
|
machineLocked={props.machineLocked}
|
|
1930
|
+
controlUnavailable={props.controlUnavailable}
|
|
1931
|
+
inputAllowed={props.inputAllowed}
|
|
1386
1932
|
connectionState={props.connectionState}
|
|
1387
1933
|
error={props.connectionError}
|
|
1388
1934
|
onAction={(action) => enqueue(action, null)}
|
|
@@ -1391,20 +1937,28 @@ function ComputerViewport(props: {
|
|
|
1391
1937
|
) : null}
|
|
1392
1938
|
{props.mutating ? (
|
|
1393
1939
|
<div className="pointer-events-none absolute right-3 top-3 flex items-center gap-1.5 rounded-full border border-white/10 bg-black/65 px-2.5 py-1 text-[11px] text-white/80 backdrop-blur">
|
|
1394
|
-
<LoaderCircleIcon className="size-3 animate-spin" />
|
|
1940
|
+
<LoaderCircleIcon className="size-3 animate-spin" /> {t("computerViewer.acting")}
|
|
1395
1941
|
</div>
|
|
1396
1942
|
) : null}
|
|
1397
|
-
{showCanvas && !rawInputEnabled ? (
|
|
1398
|
-
<div className="absolute bottom-3 left-1/2 flex -translate-x-1/2 items-center gap-2 rounded-full border border-white/10 bg-black/70 py-1 pl-3 pr-1 text-[11px] text-white/80 backdrop-blur">
|
|
1399
|
-
<span>
|
|
1400
|
-
|
|
1943
|
+
{showCanvas && (!rawInputEnabled || !props.pointerInput || !props.keyboardInput) ? (
|
|
1944
|
+
<div className="absolute bottom-3 left-1/2 flex w-max max-w-[calc(100%-1.5rem)] -translate-x-1/2 items-center gap-2 rounded-full border border-white/10 bg-black/70 py-1 pl-3 pr-1 text-[11px] text-white/80 backdrop-blur">
|
|
1945
|
+
<span>
|
|
1946
|
+
{!rawInputEnabled && (props.pointerInput || props.keyboardInput)
|
|
1947
|
+
? t("computerViewer.backgroundViewUseAppControls")
|
|
1948
|
+
: !props.pointerInput && !props.keyboardInput
|
|
1949
|
+
? t("computerViewer.viewOnlyMouseAndKeyboard")
|
|
1950
|
+
: props.keyboardInput
|
|
1951
|
+
? t("computerViewer.keyboardOnlyMouseUnavailable")
|
|
1952
|
+
: t("computerViewer.mouseOnlyKeyboardUnavailable")}
|
|
1953
|
+
</span>
|
|
1954
|
+
{!rawInputEnabled && props.target && (props.pointerInput || props.keyboardInput) ? (
|
|
1401
1955
|
<button
|
|
1402
1956
|
type="button"
|
|
1403
1957
|
disabled={props.mutating}
|
|
1404
1958
|
onClick={() => enqueue({ type: "focus", targetId: props.target!.id }, null)}
|
|
1405
|
-
className="rounded-full bg-white/10 px-2 py-0.5 font-medium text-white transition hover:bg-white/20 disabled:opacity-50"
|
|
1959
|
+
className="shrink-0 whitespace-nowrap rounded-full bg-white/10 px-2 py-0.5 font-medium text-white transition hover:bg-white/20 disabled:opacity-50"
|
|
1406
1960
|
>
|
|
1407
|
-
|
|
1961
|
+
{t("computerViewer.bringToFront")}
|
|
1408
1962
|
</button>
|
|
1409
1963
|
) : null}
|
|
1410
1964
|
</div>
|
|
@@ -1413,64 +1967,89 @@ function ComputerViewport(props: {
|
|
|
1413
1967
|
);
|
|
1414
1968
|
}
|
|
1415
1969
|
|
|
1416
|
-
function assertExactComputerClipboard(
|
|
1970
|
+
function assertExactComputerClipboard(
|
|
1971
|
+
t: OpenGeniText,
|
|
1972
|
+
clipboard: ComputerClipboard,
|
|
1973
|
+
expected: string,
|
|
1974
|
+
): void {
|
|
1417
1975
|
if (clipboard.truncated || clipboard.text !== expected) {
|
|
1418
|
-
throw new Error("
|
|
1976
|
+
throw new Error(t("computerViewer.desktopClipboardDidNotAccept"));
|
|
1419
1977
|
}
|
|
1420
1978
|
}
|
|
1421
1979
|
|
|
1422
1980
|
function ComputerViewportFallback(props: {
|
|
1423
1981
|
observation: ComputerObservation | null;
|
|
1424
1982
|
machineLocked: boolean;
|
|
1983
|
+
controlUnavailable: boolean;
|
|
1984
|
+
inputAllowed: boolean;
|
|
1425
1985
|
connectionState: string;
|
|
1426
1986
|
error: Error | null;
|
|
1427
1987
|
onAction: (action: ComputerAction) => void;
|
|
1428
1988
|
onReconnect: () => void;
|
|
1429
1989
|
}) {
|
|
1990
|
+
const t = useOpenGeniText();
|
|
1430
1991
|
if (props.machineLocked) {
|
|
1431
1992
|
return (
|
|
1432
1993
|
<div className="absolute inset-0 grid place-items-center bg-og-bg p-6">
|
|
1433
1994
|
<div className="max-w-sm text-center">
|
|
1434
|
-
<LockKeyholeIcon className="mx-auto size-6 text-og-muted" />
|
|
1435
|
-
<p className="mt-3 text-og-menu font-medium text-og-fg">
|
|
1436
|
-
|
|
1437
|
-
|
|
1995
|
+
<LockKeyholeIcon className="mx-auto size-6 text-og-fg-muted" />
|
|
1996
|
+
<p className="mt-3 text-og-menu font-medium text-og-fg">
|
|
1997
|
+
{t("computerViewer.machineLocked")}
|
|
1998
|
+
</p>
|
|
1999
|
+
<p className="mt-1 text-og-control leading-5 text-og-fg-muted">
|
|
2000
|
+
{t("computerViewer.liveFramesAndInputStay")}
|
|
1438
2001
|
</p>
|
|
1439
2002
|
</div>
|
|
1440
2003
|
</div>
|
|
1441
2004
|
);
|
|
1442
2005
|
}
|
|
2006
|
+
const appControls = props.observation?.target.kind === "app";
|
|
1443
2007
|
const controlFailure = interactionControlFailureFromError(props.error);
|
|
1444
|
-
const interactive =
|
|
2008
|
+
const interactive = semanticControls(t, props.observation)
|
|
1445
2009
|
.filter((node) => semanticAction(node) !== null)
|
|
1446
2010
|
.slice(0, 10);
|
|
1447
2011
|
return (
|
|
1448
2012
|
<div className="absolute inset-0 grid place-items-center bg-og-bg p-6">
|
|
1449
|
-
<div className="w-full max-w-md rounded-og-lg border border-og-border bg-og-surface-
|
|
2013
|
+
<div className="w-full max-w-md rounded-og-lg border border-og-border bg-og-surface-1 p-4 shadow-lg">
|
|
1450
2014
|
<div className="flex items-center gap-2">
|
|
1451
2015
|
{props.error ? (
|
|
1452
|
-
<CircleAlertIcon className="size-4 text-og-
|
|
2016
|
+
<CircleAlertIcon className="size-4 text-og-danger" />
|
|
2017
|
+
) : appControls ? (
|
|
2018
|
+
<PanelsTopLeftIcon className="size-4 text-og-fg-muted" />
|
|
1453
2019
|
) : (
|
|
1454
|
-
<LoaderCircleIcon className="size-4 animate-spin text-og-muted" />
|
|
2020
|
+
<LoaderCircleIcon className="size-4 animate-spin text-og-fg-muted" />
|
|
1455
2021
|
)}
|
|
1456
2022
|
<p className="text-og-menu font-medium text-og-fg">
|
|
1457
2023
|
{isAttachedChromeGenerationLossError(props.error)
|
|
1458
|
-
? "
|
|
1459
|
-
: props.
|
|
1460
|
-
? "
|
|
1461
|
-
:
|
|
2024
|
+
? t("computerViewer.chromeReconnectedOpenAFresh")
|
|
2025
|
+
: !props.inputAllowed
|
|
2026
|
+
? t("computerViewer.viewOnly")
|
|
2027
|
+
: props.controlUnavailable
|
|
2028
|
+
? t("computerViewer.desktopControlsUnavailable")
|
|
2029
|
+
: props.error
|
|
2030
|
+
? t("computerViewer.liveViewDisconnected")
|
|
2031
|
+
: appControls
|
|
2032
|
+
? t("computerViewer.appControls")
|
|
2033
|
+
: computerConnectionLabel(t, props.connectionState)}
|
|
1462
2034
|
</p>
|
|
1463
2035
|
</div>
|
|
1464
2036
|
{props.error ? (
|
|
1465
|
-
<p className="mt-2 text-og-control leading-5 text-og-muted">
|
|
2037
|
+
<p className="mt-2 text-og-control leading-5 text-og-fg-muted">
|
|
1466
2038
|
{isAttachedChromeGenerationLossError(props.error)
|
|
1467
|
-
? "
|
|
2039
|
+
? t("computerViewer.chromeReconnectedOpenAFresh2")
|
|
1468
2040
|
: (controlFailure?.message ?? props.error.message)}
|
|
1469
2041
|
</p>
|
|
1470
2042
|
) : null}
|
|
1471
|
-
{
|
|
2043
|
+
{!props.inputAllowed ? (
|
|
2044
|
+
<p className="mt-2 text-og-control leading-5 text-og-fg-muted">
|
|
2045
|
+
{t("computerViewer.refreshToCheckDesktopControls")}
|
|
2046
|
+
</p>
|
|
2047
|
+
) : null}
|
|
2048
|
+
{interactive.length > 0 && !props.controlUnavailable && props.inputAllowed ? (
|
|
1472
2049
|
<div className="mt-3 border-t border-og-border pt-3">
|
|
1473
|
-
<p className="mb-2 text-og-xs text-og-subtle">
|
|
2050
|
+
<p className="mb-2 text-og-xs text-og-fg-subtle">
|
|
2051
|
+
{t("computerViewer.appControlsRemainAvailable")}
|
|
2052
|
+
</p>
|
|
1474
2053
|
<div className="flex flex-wrap gap-1.5">
|
|
1475
2054
|
{interactive.map((node) => (
|
|
1476
2055
|
<button
|
|
@@ -1492,9 +2071,11 @@ function ComputerViewportFallback(props: {
|
|
|
1492
2071
|
<button
|
|
1493
2072
|
type="button"
|
|
1494
2073
|
onClick={props.onReconnect}
|
|
1495
|
-
className="mt-3 text-og-control font-medium
|
|
2074
|
+
className="mt-3 text-og-control font-medium og-link"
|
|
1496
2075
|
>
|
|
1497
|
-
{controlFailure?.retryable === false
|
|
2076
|
+
{controlFailure?.retryable === false
|
|
2077
|
+
? t("computerViewer.tryAgain")
|
|
2078
|
+
: t("computerViewer.reconnect")}
|
|
1498
2079
|
</button>
|
|
1499
2080
|
) : null}
|
|
1500
2081
|
</div>
|
|
@@ -1505,18 +2086,32 @@ function ComputerViewportFallback(props: {
|
|
|
1505
2086
|
function ComputerSemanticPanel(props: {
|
|
1506
2087
|
observation: ComputerObservation | null;
|
|
1507
2088
|
mutating: boolean;
|
|
2089
|
+
controlUnavailable: boolean;
|
|
2090
|
+
inputAllowed: boolean;
|
|
1508
2091
|
onAction: (action: ComputerAction) => void;
|
|
1509
2092
|
}) {
|
|
1510
|
-
const
|
|
2093
|
+
const t = useOpenGeniText();
|
|
2094
|
+
const nodes = semanticControls(t, props.observation).slice(0, 100);
|
|
1511
2095
|
return (
|
|
1512
|
-
<aside className="w-
|
|
1513
|
-
<div className="mb-2 flex items-center gap-1.5 px-1 text-og-xs font-medium uppercase tracking-[0.1em] text-og-subtle">
|
|
1514
|
-
<KeyboardIcon className="size-3" />
|
|
2096
|
+
<aside className="box-border max-h-[40%] w-full shrink-0 overflow-y-auto border-t border-og-border bg-og-surface-1 p-2 @xl/computer-viewer:max-h-none @xl/computer-viewer:w-64 @xl/computer-viewer:border-t-0 @xl/computer-viewer:border-l">
|
|
2097
|
+
<div className="mb-2 flex items-center gap-1.5 px-1 text-og-xs font-medium uppercase tracking-[0.1em] text-og-fg-subtle">
|
|
2098
|
+
<KeyboardIcon className="size-3" /> {t("computerViewer.appControls")}
|
|
1515
2099
|
</div>
|
|
1516
|
-
{
|
|
1517
|
-
<p className="px-1 py-2 text-og-control leading-5 text-og-muted">
|
|
1518
|
-
|
|
2100
|
+
{!props.inputAllowed ? (
|
|
2101
|
+
<p className="px-1 py-2 text-og-control leading-5 text-og-fg-muted">
|
|
2102
|
+
{t("computerViewer.viewOnlyRefreshToCheck")}
|
|
2103
|
+
</p>
|
|
2104
|
+
) : props.controlUnavailable ? (
|
|
2105
|
+
<p className="px-1 py-2 text-og-control leading-5 text-og-fg-muted">
|
|
2106
|
+
{t("computerViewer.reconnectToUseAppControls")}
|
|
1519
2107
|
</p>
|
|
2108
|
+
) : null}
|
|
2109
|
+
{nodes.length === 0 ? (
|
|
2110
|
+
props.controlUnavailable ? null : (
|
|
2111
|
+
<p className="px-1 py-2 text-og-control leading-5 text-og-fg-muted">
|
|
2112
|
+
{t("computerViewer.thisViewHasNoAccessibility")}
|
|
2113
|
+
</p>
|
|
2114
|
+
)
|
|
1520
2115
|
) : (
|
|
1521
2116
|
<div className="space-y-0.5">
|
|
1522
2117
|
{nodes.map((node) => (
|
|
@@ -1538,6 +2133,7 @@ function ComputerSemanticControl(props: {
|
|
|
1538
2133
|
mutating: boolean;
|
|
1539
2134
|
onAction: (action: ComputerAction) => void;
|
|
1540
2135
|
}) {
|
|
2136
|
+
const t = useOpenGeniText();
|
|
1541
2137
|
const { node } = props;
|
|
1542
2138
|
const editable = node.actions.includes("set_value");
|
|
1543
2139
|
const action = semanticAction(node);
|
|
@@ -1554,6 +2150,7 @@ function ComputerSemanticControl(props: {
|
|
|
1554
2150
|
className="rounded-og-sm px-2 py-1.5 hover:bg-og-surface-2"
|
|
1555
2151
|
onSubmit={(event) => {
|
|
1556
2152
|
event.preventDefault();
|
|
2153
|
+
if (props.mutating) return;
|
|
1557
2154
|
props.onAction({
|
|
1558
2155
|
type: "semantic",
|
|
1559
2156
|
locator: { kind: "ref", ref: node.ref },
|
|
@@ -1562,7 +2159,7 @@ function ComputerSemanticControl(props: {
|
|
|
1562
2159
|
});
|
|
1563
2160
|
}}
|
|
1564
2161
|
>
|
|
1565
|
-
<label className="block truncate text-[10px] uppercase text-og-subtle">
|
|
2162
|
+
<label className="block truncate text-[10px] uppercase text-og-fg-subtle">
|
|
1566
2163
|
{node.name || node.identifier || node.role}
|
|
1567
2164
|
</label>
|
|
1568
2165
|
<div className="mt-1 flex gap-1">
|
|
@@ -1571,14 +2168,16 @@ function ComputerSemanticControl(props: {
|
|
|
1571
2168
|
disabled={props.mutating}
|
|
1572
2169
|
onChange={(event) => setValue(event.currentTarget.value)}
|
|
1573
2170
|
className="min-w-0 flex-1 rounded-og-sm border border-og-border bg-og-surface-1 px-1.5 py-1 text-og-control text-og-fg outline-hidden focus:border-og-accent"
|
|
1574
|
-
aria-label={
|
|
2171
|
+
aria-label={t("computerViewer.setName", {
|
|
2172
|
+
name: node.name || node.identifier || node.role,
|
|
2173
|
+
})}
|
|
1575
2174
|
/>
|
|
1576
2175
|
<button
|
|
1577
2176
|
type="submit"
|
|
1578
2177
|
disabled={props.mutating}
|
|
1579
2178
|
className="rounded-og-sm border border-og-border bg-og-surface-1 px-2 text-og-control font-medium text-og-fg transition hover:bg-og-surface-2 disabled:opacity-50"
|
|
1580
2179
|
>
|
|
1581
|
-
|
|
2180
|
+
{t("computerViewer.set")}
|
|
1582
2181
|
</button>
|
|
1583
2182
|
</div>
|
|
1584
2183
|
</form>
|
|
@@ -1594,9 +2193,9 @@ function ComputerSemanticControl(props: {
|
|
|
1594
2193
|
}}
|
|
1595
2194
|
className="flex w-full items-start gap-2 rounded-og-sm px-2 py-1.5 text-left transition hover:bg-og-surface-2 disabled:cursor-default disabled:hover:bg-transparent"
|
|
1596
2195
|
>
|
|
1597
|
-
<span className="mt-0.5 text-[10px] uppercase text-og-subtle">{node.role}</span>
|
|
2196
|
+
<span className="mt-0.5 text-[10px] uppercase text-og-fg-subtle">{node.role}</span>
|
|
1598
2197
|
<span className="min-w-0 flex-1 truncate text-og-control text-og-fg">
|
|
1599
|
-
{node.name || semanticValue(node) || node.identifier || "
|
|
2198
|
+
{node.name || semanticValue(node) || node.identifier || t("computerViewer.unnamedControl")}
|
|
1600
2199
|
</span>
|
|
1601
2200
|
</button>
|
|
1602
2201
|
);
|
|
@@ -1606,14 +2205,17 @@ function ComputerStatusBar(props: {
|
|
|
1606
2205
|
session: ComputerSession | null;
|
|
1607
2206
|
target: ComputerTarget | null;
|
|
1608
2207
|
connectionState: string;
|
|
2208
|
+
controlUnavailable: boolean;
|
|
2209
|
+
inputAllowed: boolean;
|
|
1609
2210
|
refreshing: boolean;
|
|
1610
2211
|
showControls: boolean;
|
|
1611
2212
|
controlCount: number;
|
|
1612
2213
|
onToggleControls: () => void;
|
|
1613
2214
|
}) {
|
|
2215
|
+
const t = useOpenGeniText();
|
|
1614
2216
|
const screen = props.target?.kind === "screen";
|
|
1615
2217
|
return (
|
|
1616
|
-
<div className="flex h-8 shrink-0 items-center gap-2 border-t border-og-border bg-og-surface-
|
|
2218
|
+
<div className="flex h-8 shrink-0 items-center gap-2 border-t border-og-border bg-og-surface-1 px-2 text-og-xs text-og-fg-subtle">
|
|
1617
2219
|
<span
|
|
1618
2220
|
className={cn(
|
|
1619
2221
|
"size-1.5 rounded-full",
|
|
@@ -1621,28 +2223,48 @@ function ComputerStatusBar(props: {
|
|
|
1621
2223
|
)}
|
|
1622
2224
|
/>
|
|
1623
2225
|
<span>
|
|
1624
|
-
{props.
|
|
2226
|
+
{!props.inputAllowed
|
|
2227
|
+
? t("computerViewer.viewOnly")
|
|
2228
|
+
: props.controlUnavailable
|
|
2229
|
+
? t("computerViewer.controlsUnavailable")
|
|
2230
|
+
: props.target?.kind === "app"
|
|
2231
|
+
? t("computerViewer.appControls")
|
|
2232
|
+
: props.connectionState === "live"
|
|
2233
|
+
? t("computerViewer.live")
|
|
2234
|
+
: computerConnectionLabel(t, props.connectionState)}
|
|
1625
2235
|
</span>
|
|
1626
2236
|
<span className="min-w-0 flex-1 truncate">
|
|
1627
|
-
{
|
|
1628
|
-
? "
|
|
1629
|
-
: props.
|
|
1630
|
-
? "
|
|
1631
|
-
:
|
|
2237
|
+
{!props.inputAllowed
|
|
2238
|
+
? t("computerViewer.refreshToCheckDesktopControls2")
|
|
2239
|
+
: props.controlUnavailable
|
|
2240
|
+
? t("computerViewer.reconnectToUseDesktopInput")
|
|
2241
|
+
: screen
|
|
2242
|
+
? t("computerViewer.fullScreenInputMayMove")
|
|
2243
|
+
: props.target?.kind === "app"
|
|
2244
|
+
? props.session?.capabilities?.backgroundActions
|
|
2245
|
+
? t("computerViewer.appControlsWorkInThe")
|
|
2246
|
+
: t("computerViewer.appControls")
|
|
2247
|
+
: props.session?.capabilities?.backgroundInput
|
|
2248
|
+
? t("computerViewer.windowClicksAndTypingStay")
|
|
2249
|
+
: props.session?.capabilities?.backgroundActions
|
|
2250
|
+
? t("computerViewer.windowAppControlsWorkIn")
|
|
2251
|
+
: (props.target?.kind ?? t("computerViewer.desktop"))}
|
|
1632
2252
|
</span>
|
|
1633
2253
|
{screen ? <MousePointer2Icon className="size-3" aria-hidden /> : null}
|
|
1634
2254
|
{props.refreshing ? <LoaderCircleIcon className="size-3 animate-spin" /> : null}
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
2255
|
+
{props.controlCount > 0 || props.showControls ? (
|
|
2256
|
+
<button
|
|
2257
|
+
type="button"
|
|
2258
|
+
onClick={props.onToggleControls}
|
|
2259
|
+
aria-pressed={props.showControls}
|
|
2260
|
+
className={cn(
|
|
2261
|
+
"rounded px-1.5 py-0.5 transition hover:bg-og-surface-2 hover:text-og-fg",
|
|
2262
|
+
props.showControls && "bg-og-surface-2 text-og-fg",
|
|
2263
|
+
)}
|
|
2264
|
+
>
|
|
2265
|
+
{t("computerViewer.controlsControlcount", { controlCount: props.controlCount })}
|
|
2266
|
+
</button>
|
|
2267
|
+
) : null}
|
|
1646
2268
|
</div>
|
|
1647
2269
|
);
|
|
1648
2270
|
}
|
|
@@ -1651,7 +2273,7 @@ function ComputerNotice(props: { icon: ReactNode; text: string; className?: stri
|
|
|
1651
2273
|
return (
|
|
1652
2274
|
<div
|
|
1653
2275
|
className={cn(
|
|
1654
|
-
"grid h-full place-items-center bg-og-bg text-og-control text-og-muted",
|
|
2276
|
+
"grid h-full place-items-center bg-og-bg text-og-control text-og-fg-muted",
|
|
1655
2277
|
props.className,
|
|
1656
2278
|
)}
|
|
1657
2279
|
>
|
|
@@ -1663,11 +2285,40 @@ function ComputerNotice(props: { icon: ReactNode; text: string; className?: stri
|
|
|
1663
2285
|
);
|
|
1664
2286
|
}
|
|
1665
2287
|
|
|
1666
|
-
|
|
2288
|
+
const structuralRoles = new Set([
|
|
2289
|
+
"frame",
|
|
2290
|
+
"panel",
|
|
2291
|
+
"section",
|
|
2292
|
+
"document",
|
|
2293
|
+
"document web",
|
|
2294
|
+
"static",
|
|
2295
|
+
"static text",
|
|
2296
|
+
"heading",
|
|
2297
|
+
"paragraph",
|
|
2298
|
+
"notification",
|
|
2299
|
+
"separator",
|
|
2300
|
+
"tool bar",
|
|
2301
|
+
"page tab list",
|
|
2302
|
+
]);
|
|
2303
|
+
|
|
2304
|
+
function semanticControls(
|
|
2305
|
+
t: OpenGeniText,
|
|
2306
|
+
observation: ComputerObservation | null,
|
|
2307
|
+
): InteractionSemanticNode[] {
|
|
1667
2308
|
if (observation?.semantic?.kind !== "snapshot") return [];
|
|
1668
2309
|
const result: InteractionSemanticNode[] = [];
|
|
1669
2310
|
const visit = (node: InteractionSemanticNode) => {
|
|
1670
|
-
|
|
2311
|
+
const role = node.role.trim().toLowerCase();
|
|
2312
|
+
const label = node.name?.trim() || node.identifier?.trim();
|
|
2313
|
+
if (
|
|
2314
|
+
node.actions.includes("set_value") ||
|
|
2315
|
+
(label &&
|
|
2316
|
+
label.toLowerCase() !== role &&
|
|
2317
|
+
!structuralRoles.has(role) &&
|
|
2318
|
+
semanticAction(node) !== null)
|
|
2319
|
+
) {
|
|
2320
|
+
result.push(node);
|
|
2321
|
+
}
|
|
1671
2322
|
node.children?.forEach(visit);
|
|
1672
2323
|
};
|
|
1673
2324
|
observation.semantic.roots.forEach(visit);
|
|
@@ -1699,11 +2350,26 @@ function paintCanvas(
|
|
|
1699
2350
|
width: number,
|
|
1700
2351
|
height: number,
|
|
1701
2352
|
): void {
|
|
2353
|
+
const dimensionsChanged = canvas.width !== width || canvas.height !== height;
|
|
1702
2354
|
canvas.width = width;
|
|
1703
2355
|
canvas.height = height;
|
|
1704
2356
|
const context = canvas.getContext("2d", { alpha: false });
|
|
1705
2357
|
if (!context) throw new Error("Desktop canvas is unavailable.");
|
|
1706
2358
|
context.drawImage(image, 0, 0, width, height);
|
|
2359
|
+
if (dimensionsChanged) fitComputerCanvas(canvas);
|
|
2360
|
+
}
|
|
2361
|
+
|
|
2362
|
+
function fitComputerCanvas(canvas: HTMLCanvasElement): void {
|
|
2363
|
+
const viewport = canvas.parentElement;
|
|
2364
|
+
if (!viewport || canvas.width <= 0 || canvas.height <= 0) return;
|
|
2365
|
+
const scale = Math.min(
|
|
2366
|
+
viewport.clientWidth / canvas.width,
|
|
2367
|
+
viewport.clientHeight / canvas.height,
|
|
2368
|
+
);
|
|
2369
|
+
// Hidden docks retain their previous fit until their content box is visible.
|
|
2370
|
+
if (!Number.isFinite(scale) || scale <= 0) return;
|
|
2371
|
+
canvas.style.width = `${canvas.width * scale}px`;
|
|
2372
|
+
canvas.style.height = `${canvas.height * scale}px`;
|
|
1707
2373
|
}
|
|
1708
2374
|
|
|
1709
2375
|
function loadImage(url: string): Promise<HTMLImageElement> {
|
|
@@ -1764,9 +2430,13 @@ export function computerKey(
|
|
|
1764
2430
|
}
|
|
1765
2431
|
|
|
1766
2432
|
function sameFrameFence(left: ComputerFrame, right: ComputerFrame): boolean {
|
|
2433
|
+
return left.frameId === right.frameId && sameComputerTarget(left, right);
|
|
2434
|
+
}
|
|
2435
|
+
|
|
2436
|
+
function sameComputerTarget(left: ComputerFrame, right: ComputerFrame): boolean {
|
|
1767
2437
|
return (
|
|
1768
|
-
left.frameId === right.frameId &&
|
|
1769
2438
|
left.computerSessionId === right.computerSessionId &&
|
|
2439
|
+
left.controllerGeneration === right.controllerGeneration &&
|
|
1770
2440
|
left.targetId === right.targetId &&
|
|
1771
2441
|
left.targetGeneration === right.targetGeneration
|
|
1772
2442
|
);
|
|
@@ -1776,20 +2446,22 @@ function isLiveComputer(session: ComputerSession): boolean {
|
|
|
1776
2446
|
return !["ending", "ended", "failed", "lost"].includes(session.lifecycle);
|
|
1777
2447
|
}
|
|
1778
2448
|
|
|
1779
|
-
function computerFailureMessage(session: ComputerSession): string | null {
|
|
2449
|
+
function computerFailureMessage(t: OpenGeniText, session: ComputerSession): string | null {
|
|
1780
2450
|
switch (session.failureCode) {
|
|
1781
2451
|
case "machine_locked":
|
|
1782
|
-
return "
|
|
2452
|
+
return t("computerViewer.unlockTheConnectedMacThen");
|
|
1783
2453
|
case "controller_heartbeat_expired":
|
|
1784
|
-
return "
|
|
2454
|
+
return t("computerViewer.theDesktopConnectionWasLost");
|
|
1785
2455
|
case "controller_transition_expired":
|
|
1786
2456
|
return session.placement.kind === "attached_device"
|
|
1787
|
-
? "
|
|
1788
|
-
: "
|
|
2457
|
+
? t("computerViewer.chromeReconnectedOpenAFresh2")
|
|
2458
|
+
: t("computerViewer.theDesktopConnectionExpiredOpen");
|
|
2459
|
+
case "idle_released":
|
|
2460
|
+
return t("computerViewer.theDesktopStoppedAfterIt");
|
|
1789
2461
|
case null:
|
|
1790
2462
|
return null;
|
|
1791
2463
|
default:
|
|
1792
|
-
return "
|
|
2464
|
+
return t("computerViewer.theDesktopCouldNotBe");
|
|
1793
2465
|
}
|
|
1794
2466
|
}
|
|
1795
2467
|
|
|
@@ -1816,74 +2488,74 @@ function countInterventions(
|
|
|
1816
2488
|
return counts;
|
|
1817
2489
|
}
|
|
1818
2490
|
|
|
1819
|
-
function interventionTitle(intervention: InteractionIntervention): string {
|
|
2491
|
+
function interventionTitle(t: OpenGeniText, intervention: InteractionIntervention): string {
|
|
1820
2492
|
switch (intervention.kind) {
|
|
1821
2493
|
case "manual_login":
|
|
1822
|
-
return "
|
|
2494
|
+
return t("computerViewer.signInNeeded");
|
|
1823
2495
|
case "mfa":
|
|
1824
|
-
return "
|
|
2496
|
+
return t("computerViewer.verificationNeeded");
|
|
1825
2497
|
case "external_action":
|
|
1826
2498
|
case "confirmation":
|
|
1827
|
-
return "
|
|
2499
|
+
return t("computerViewer.actionNeeded");
|
|
1828
2500
|
case "other":
|
|
1829
|
-
return "
|
|
2501
|
+
return t("computerViewer.desktopNeedsYourHelp");
|
|
1830
2502
|
}
|
|
1831
2503
|
}
|
|
1832
2504
|
|
|
1833
|
-
function platformLabel(session: ComputerSession): string {
|
|
2505
|
+
function platformLabel(t: OpenGeniText, session: ComputerSession): string {
|
|
1834
2506
|
switch (session.platform) {
|
|
1835
2507
|
case "macos":
|
|
1836
|
-
return "
|
|
2508
|
+
return t("computerViewer.mac");
|
|
1837
2509
|
case "linux":
|
|
1838
|
-
return "
|
|
2510
|
+
return t("computerViewer.linux");
|
|
1839
2511
|
case "windows":
|
|
1840
|
-
return "
|
|
2512
|
+
return t("computerViewer.windows");
|
|
1841
2513
|
default:
|
|
1842
|
-
return "
|
|
2514
|
+
return t("computerViewer.desktop");
|
|
1843
2515
|
}
|
|
1844
2516
|
}
|
|
1845
2517
|
|
|
1846
|
-
function placementLabel(session: ComputerSession): string {
|
|
2518
|
+
function placementLabel(t: OpenGeniText, session: ComputerSession): string {
|
|
1847
2519
|
switch (session.placement.kind) {
|
|
1848
2520
|
case "sandbox_group":
|
|
1849
|
-
return "
|
|
2521
|
+
return t("computerViewer.agentSandbox");
|
|
1850
2522
|
case "connected_machine":
|
|
1851
|
-
return "
|
|
2523
|
+
return t("computerViewer.connectedMachine");
|
|
1852
2524
|
case "attached_device":
|
|
1853
|
-
return "
|
|
2525
|
+
return t("computerViewer.yourMachine");
|
|
1854
2526
|
case "external_provider":
|
|
1855
|
-
return "
|
|
2527
|
+
return t("computerViewer.cloudDesktop");
|
|
1856
2528
|
}
|
|
1857
2529
|
}
|
|
1858
2530
|
|
|
1859
|
-
function lifecycleLabel(lifecycle: ComputerSession["lifecycle"]): string {
|
|
2531
|
+
function lifecycleLabel(t: OpenGeniText, lifecycle: ComputerSession["lifecycle"]): string {
|
|
1860
2532
|
switch (lifecycle) {
|
|
1861
2533
|
case "starting":
|
|
1862
|
-
return "
|
|
2534
|
+
return t("computerViewer.openingDesktop");
|
|
1863
2535
|
case "suspending":
|
|
1864
|
-
return "
|
|
2536
|
+
return t("computerViewer.pausingDesktop");
|
|
1865
2537
|
case "suspended":
|
|
1866
|
-
return "
|
|
2538
|
+
return t("computerViewer.desktopPaused");
|
|
1867
2539
|
case "restoring":
|
|
1868
|
-
return "
|
|
2540
|
+
return t("computerViewer.restoringDesktop");
|
|
1869
2541
|
case "ending":
|
|
1870
|
-
return "
|
|
2542
|
+
return t("computerViewer.closingDesktop");
|
|
1871
2543
|
default:
|
|
1872
|
-
return "
|
|
2544
|
+
return t("computerViewer.connectingToDesktop");
|
|
1873
2545
|
}
|
|
1874
2546
|
}
|
|
1875
2547
|
|
|
1876
|
-
function computerConnectionLabel(state: string): string {
|
|
2548
|
+
function computerConnectionLabel(t: OpenGeniText, state: string): string {
|
|
1877
2549
|
switch (state) {
|
|
1878
2550
|
case "attaching":
|
|
1879
|
-
return "
|
|
2551
|
+
return t("computerViewer.openingDesktopView");
|
|
1880
2552
|
case "connecting":
|
|
1881
|
-
return "
|
|
2553
|
+
return t("computerViewer.connecting");
|
|
1882
2554
|
case "reconnecting":
|
|
1883
|
-
return "
|
|
2555
|
+
return t("computerViewer.reconnecting");
|
|
1884
2556
|
case "error":
|
|
1885
|
-
return "
|
|
2557
|
+
return t("computerViewer.disconnected");
|
|
1886
2558
|
default:
|
|
1887
|
-
return "
|
|
2559
|
+
return t("computerViewer.waitingForDesktop");
|
|
1888
2560
|
}
|
|
1889
2561
|
}
|