@xopcai/xopc 0.0.436 → 0.0.438
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/dist/assets/{page-context-b-rB5vJC.js → page-context-DngcqfGf.js} +130 -9
- package/dist/browser-ext/dist/background.js +9 -1
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +1 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-Cwn_CNwl.js → activity-store-Fl327RND.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Cd23LnJJ.js → agent-avatar-dicebear-DL_MfWA8.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-ByzM7u9S.js → agent-avatar-display-BTDt883i.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-B0i37diS.js → agent-defaults-settings-panel-CuiIuR1Q.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-XN-tZ-Ox.js → agent-plugin-dialog-moOAOJPs.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-ZDA1OaLv.js → agents-B1yM1cWS.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-B5lKH_ps.js → agents-admin-api-D6pZX7nW.js} +1 -1
- package/dist/gateway/static/root/assets/{api-B9fZL-V8.js → api-H3OfSCEz.js} +1 -1
- package/dist/gateway/static/root/assets/{api-Djju8qIR.js → api-np_upIrk.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-IlyzDPJu.js → app-management-settings-panel-IFKcvOK9.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BxdFGob3.js → appearance-settings-Cfb4s0Ik.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-CxEKiOTA.js → apps-page-DMDwnwEi.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-4gEvotPr.js → archive-plugin-DBKvxHvn.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-4fVKv9PJ.js → automation-api-iUvu64Gn.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-m7PeK2kl.js → automation-result-state-EFwxlLpI.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-run-list-CJOdy_R2.js → automation-run-list-C66yqC4g.js} +1 -1
- package/dist/gateway/static/root/assets/automation-task-card-DXNh_uKL.js +3 -0
- package/dist/gateway/static/root/assets/{automations-page-BjbM15eY.js → automations-page-iCsHbzY_.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-CqurzLYX.js → automations-workspace-DnLrs-fb.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-69WyJLNW.js → binary-plugins-C5K0CWqt.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DUONDIZR.js → block-editor-3TVEcFpk.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-DL4YPCuN.js → browser-automation-inputs-Wuph6STC.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-1Aq6XmRs.js → browser-automations-page-THaENU71.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-control-api-yjru8E7R.js → browser-control-api-DeRUE9Io.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-CvwpT8Um.js → browser-settings-page-CeNb4Kyc.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-DaeQXJT4.js → capabilities-B3cchabB.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-C7lnwKKm.js → capabilities-CFO_gAma.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-B5avAOUM.js → capabilities-page-KM3X4Bj-.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-_9yCS78i.js → capabilities-settings-panel-CX201jtA.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-CoQb4HOF.js → channels-DmF6s5BH.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-BUi_7GRo.js → chat-agents-api-ipkXPITj.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-CcVcKsDZ.js → chat-chart-block-KOdy3HcB.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-page--wcFhTjW.js → chat-page-DZy7iw5A.js} +10 -10
- package/dist/gateway/static/root/assets/{chat-terminal-dock-BMXJpPuH.js → chat-terminal-dock-BouLAS3C.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-luUjQPsh.js → command-palette-api-CHEmmKmY.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-B5XNxNCb.js → composer-payload-handoff-DQVtV0L9.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-CWtdyEJH.js → computer-settings-page-DwEzbr0-.js} +1 -1
- package/dist/gateway/static/root/assets/{connected-providers-grid-2idMtk65.js → connected-providers-grid-CWdA7VtN.js} +1 -1
- package/dist/gateway/static/root/assets/{connection-usage-guide-Ddh0bfkj.js → connection-usage-guide-5RmYdXoS.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-C3msXaBk.js → connector-service-page-TeYvzScr.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-NcWECWKg.js → connectors-api-Byw6RD4z.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-Crb6DILX.js → connectors-page-B4PrSnT8.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-Cfjq1hD_.js → date-picker-BpccZyjF.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-ChFn9v-3.js → desktop-pet-DfGMB4GN.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DvnVIv25.js → desktop-pet-settings-ky__zEoY.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-DQJ61P5L.js → dev-view-store-do-XMWDA.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-KxaIL-OX.js → device-pairing-wizard-CQNlQGYH.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-Drv864uE.js → directory-picker-path-field-DjhHz-4p.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-DfBRkWtw.js → discussion-annotation-sync-CvGsuUi9.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DAlBIt_R.js → extension-debug-page-BimrAkDl.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-Bds-5kY_.js → extension-iframe-host-7zoDddj6.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-CZg8nBwW.js → extension-marketplace-api-DA-nbL9C.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-ZTw-oucT.js → extension-page-wjS2go2N.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-NKWfjpdP.js → extension-provider-C2L-lGqA.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CT7PPt_q.js → extension-settings-page-CTHs7h7H.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-BcLeaSNe.js → file-preview-surface-QUJiCKCs.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-Cq-ByXL4.js → gateway-config-swr-RHiDzhCY.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-DUlVfng6.js +1 -0
- package/dist/gateway/static/root/assets/gateway-realtime-store-C_CDU3to.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-DdiVzbkL.js → gateway-restart-L34umMj8.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-1QUdNwrZ.js → gateway-settings-DjwPEBcq.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-PMJi5mX4.js → gateway-startup-retry-CgLo6P66.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-DgzZh3wX.js → global-defaults-api-Cv6QEJBa.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-Chn7YTiD.js → home-page-D9gDR4MB.js} +2 -2
- package/dist/gateway/static/root/assets/{image-generation-api-CjVpsckq.js → image-generation-api-C_GDIILz.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-CJCvZFaQ.js → imports-page-CvY8wdNu.js} +1 -1
- package/dist/gateway/static/root/assets/{index-C4moZbZv.js → index-BVyX4V3C.js} +5 -5
- package/dist/gateway/static/root/assets/index-CIYNPxDl.css +1 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-Bo06Ry3H.js → install-connector-dialog-Cnx5oOXv.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BylFJeGu.js → keyboard-shortcuts-settings-AXisbvQn.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-B3MSSFsr.js → local-app-workbench-page-DxO9ZTU_.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-BeV86rMJ.js → local-apps-page-sas0hMvK.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-jgw8UGsO.js → local-session-drafts-DzHbV0VQ.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-CAZaC05J.js → locale-store-BRJAl_Kx.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-BMmSsUP5.js → logs-page-BkuLDfZ4.js} +1 -1
- package/dist/gateway/static/root/assets/management-settings-CPPZfnc7.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-BatP4qeK.js → markdown-view-BRNPKsnn.js} +1 -1
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-rROtr0UN.js → mcp-conversation-setup-page-C5gTNa2U.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-88OV72YE.js → media-plugins-BMvgnbE7.js} +1 -1
- package/dist/gateway/static/root/assets/messages-Ct1hODNU.js +3 -0
- package/dist/gateway/static/root/assets/{model-selector-raBRBkN_.js → model-selector-kWRDioTb.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-CzC9y3D0.js → models-hub-cache-h2vf54qy.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-BvA8Vkbm.js → note-detail-panel-DcTiI934.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-Bjefof6e.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-zXpV6UXu.js → notes-api-D29fdWyC.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-CjYH9Kle.js → notes-page-CqnQ_UEf.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-DmxSaxM1.js → oauth-api-C8McgC-r.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-D4Gfs-Ba.js → oauth-provider-connect-BDTdg0lv.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-Mig3d0UX.js → page-context-capture-button-Bf0qvNmd.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-C4IIZaKd.js → page-context-draft-Dx0F3tHK.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-lsAlAXWQ.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-DLa-CpaK.js → personal-avatar-CpEFjQ4Q.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-BhuT79Wd.js → personal-page-BvjPpwdy.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-XSUkgcr2.js → personal-settings-panel-DixKsLRd.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-DYwnuVh3.js → phone-dependencies-card-BfpFV3SG.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-2F32QTHA.js → phone-model-connection-Os87SvBE.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-DCVzIr0s.js → phone-model-picker-8pkA8k_N.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-DJttE4id.js → phone-settings-page-ByERmr61.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-Dxp-KhFP.js → phone-workspace-store-DfhWmYic.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-tyjAjFjA.js → plugin-details-dialog-J4PKpTud.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-BVP3MhGK.js → preference-select-fields-C-PLFUS9.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-DbJvv92z.js → product-automation-feedback-DLsF8VBW.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-RImqlhCD.js → product-open-page-BP-ssaP8.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-DxSqrKsg.js → product-preview-content-BMI7ZuKU.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-Cw8Q8Uom.js → product-preview-modal-DZ0zi6ZF.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-CuugOYfe.js → project-detail-page-CS-NrYi5.js} +1 -1
- package/dist/gateway/static/root/assets/{project-understanding-BMKcoUW5.js → project-understanding-C9WWE-3t.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-CFsABLvs.js → projects-page-DVa38OsG.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-CAeXbJNF.js → providers-api-C1KpkGUT.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-CfpllTe5.js → recording-upload-T5ArHnPJ.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-fLOqFyrz.js → registry-api-Cs-R00dn.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-BvKOxy0L.js → remote-access-hub-C6NBt2s-.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-D15jzjV_.js → resource-unavailable-BuySLm9q.js} +1 -1
- package/dist/gateway/static/root/assets/{route-preload-BQapekpy.js → route-preload-CDMyXjLQ.js} +2 -2
- package/dist/gateway/static/root/assets/{runtime-tools-api-D0Nrvuqv.js → runtime-tools-api-CvTCMobW.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CA27XgL2.js → runtime-tools-settings-panel-DlW9tAnO.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-B0RoYLVT.js → service-recommendation-list-Biono7Ua.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-CHRP5Lwf.js → session-api-BNt6b3Xl.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-DRRWwKE4.js → session-manager-CQNN8D0M.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-uJHS3-6F.js → sessions-page-3LErqoR9.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-SSCcDrIV.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-D-llwfSj.js → settings-advanced-section-D4uJuQwW.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-BspMKc9N.js → settings-mode-store-CnG8uLvP.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-CedwaHM0.js → settings-page-9BthXfuc.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-LuOJvqNa.js → settings-page-header-BXdbhzia.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-CduQ8w4a.js → settings-page-layout-BQvK_gmr.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-ujpPGl84.js → setup-interaction-page-D1uhozUt.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-BN2aCJUN.js → setup-status-panel-C1o4-hF4.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-CTATUaa4.js → share-link-dialog-QTEdYG4I.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-Dq0J3VgS.js → share-preview-page-Ba77bFgS.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-zegE8pSE.js → shares-api-DayDdoBR.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-DXpvsRXq.js → shares-settings-67poMpxi.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-DCL1EN7f.js → skill-api-DR3vdsrS.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-Bv0mmHbu.js → skill-list-api-D6X3XyTd.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-DPZbadiO.js → skill-reload-api-Wu0UkQ13.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-DMC7Gaku.js → skills-page-FmjOxilb.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BYFUhlqG.js → system-settings-panel-BLeXSW3w.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-_Og3plZL.js → task-detail-page-B5uwlFwb.js} +1 -1
- package/dist/gateway/static/root/assets/{task-result-evidence-Bxm8-H0B.js → task-result-evidence-m78K4eAp.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-Djf9l2qZ.js → terminal-panel-store-CWpiIbPY.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-8GFVtotZ.js → theme-store-B9upxkW-.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-oWW3SBZ4.js → tracing-settings-page-CACPSXVV.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-D-mEsSGF.js → tunnel-api-CCC7XSFJ.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-CvDjsd0I.js → understanding-activity-store-D7WFQ-t7.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-DzOZJm7A.js → understanding-refresh-store-CvOFPfDi.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-z-o6Uuev.js → usage-page-P9-7xf1p.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-BVYS8UoK.js → use-autosave-BNNxl23c.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-lecOV2q5.js → use-composer-attachments-7uMSpyxm.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-nd_CuFsd.js → use-file-preview-expanded-C-NCuwM3.js} +2 -2
- package/dist/gateway/static/root/assets/{use-personal-profile-CQi2ZCxV.js → use-personal-profile-1lm_wDMe.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-BiaddkzX.js → use-workspace-tree-HlkNpRDC.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-Bks1n0Nj.js → user-model-page-B6XfYtEm.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-BbW8NFeZ.js → voice-api-key-field-CRZS6XEF.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-jSMzZWWy.js → voice-config-api-CrgRaCMk.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-_SgYmx7X.js → voice-input-shortcut-events-vjcw6SRC.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-transcribe-api-BJCfiRFU.js → voice-transcribe-api-CtUoGgGT.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DSTSNyU7.js → work-discovery-overlay-C9tI_qQv.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-Dd_QJJvb.js → work-discovery-page-C-8kE4mx.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-q39BUcJ6.js → working-directory-picker-modal-B5fxn2wG.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-Di2OmCvz.js → workspace-api-DP2ozrRe.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-Dw3xS3sE.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-BUGNT765.js → workspace-file-preview-dialog-Cp86E6-h.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-bMSvmQW7.js → workspace-open-location-menu-CWOgHMmR.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-Bbe19Del.js → xopc-cloud-account-card-CIaHnCGw.js} +1 -1
- package/dist/gateway/static/root/index.html +81 -81
- package/dist/package.js +1 -1
- package/dist/packages/browser-control-contract/src/remote.js +237 -0
- package/dist/packages/computer-control-contract/src/index.js +12 -2
- package/dist/packages/endpoint-tools-client/src/index.js +8 -0
- package/dist/packages/endpoint-tools-protocol/src/command.js +83 -0
- package/dist/packages/endpoint-tools-protocol/src/execution.js +102 -0
- package/dist/packages/endpoint-tools-protocol/src/index.js +61 -7
- package/dist/packages/endpoint-tools-protocol/src/operation-status.js +76 -0
- package/dist/packages/endpoint-tools-protocol/src/screen.js +28 -0
- package/dist/packages/endpoint-tools-protocol/src/terminal.js +173 -0
- package/dist/packages/endpoint-tools-protocol/src/workspace.js +143 -0
- package/dist/packages/gateway-contract/src/desktop-chat.js +29 -0
- package/dist/packages/gateway-contract/src/desktop-execution-stop.js +36 -0
- package/dist/packages/gateway-contract/src/desktop-host.js +87 -0
- package/dist/packages/gateway-contract/src/device-pairing.js +17 -4
- package/dist/packages/gateway-contract/src/gateway-scopes.js +6 -2
- package/dist/packages/gateway-contract/src/index.js +6 -0
- package/dist/packages/realtime-protocol/src/index.js +15 -2
- package/dist/src/agent/client-error-format.d.ts +1 -1
- package/dist/src/agent/client-error-format.js +3 -2
- package/dist/src/agent/context/project-context.d.ts +1 -0
- package/dist/src/agent/context/project-context.js +9 -2
- package/dist/src/agent/embedded/run-turn.js +5 -2
- package/dist/src/agent/external-tools/endpoint-provider.js +76 -4
- package/dist/src/agent/memory/context-recovery.d.ts +3 -3
- package/dist/src/agent/memory/context-recovery.js +10 -3
- package/dist/src/agent/memory/repeated-read-projection.d.ts +9 -0
- package/dist/src/agent/memory/repeated-read-projection.js +78 -0
- package/dist/src/agent/orchestration/llm-turn-retry.js +8 -1
- package/dist/src/agent/sandbox/exec-policy.js +2 -0
- package/dist/src/agent/sandbox/types.d.ts +1 -0
- package/dist/src/agent/service/direct-turn-helpers.js +2 -1
- package/dist/src/agent/service/process-direct-streaming.js +4 -2
- package/dist/src/agent/source-context/browser-tab.js +1 -0
- package/dist/src/agent/source-context/device-environment.js +9 -3
- package/dist/src/agent/source-context/index.js +7 -3
- package/dist/src/agent/source-context/injector.d.ts +4 -0
- package/dist/src/agent/source-context/injector.js +23 -8
- package/dist/src/agent/source-context/source-context-projection.d.ts +8 -0
- package/dist/src/agent/source-context/source-context-projection.js +127 -0
- package/dist/src/agent/source-context/types.js +4 -1
- package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
- package/dist/src/agent/tool-manuals/computer.js +1 -1
- package/dist/src/agent/tools/exec-command.js +3 -2
- package/dist/src/agent/tools/factory.d.ts +7 -1
- package/dist/src/agent/tools/factory.js +103 -14
- package/dist/src/automations/api/dispatcher.d.ts +6 -0
- package/dist/src/automations/api/dispatcher.js +17 -0
- package/dist/src/automations/api/routes.js +2 -6
- package/dist/src/browser/drivers/browser-driver.d.ts +1 -1
- package/dist/src/browser/remote/device-driver.d.ts +26 -0
- package/dist/src/browser/remote/device-driver.js +247 -0
- package/dist/src/browser/remote/device-runtime.d.ts +9 -0
- package/dist/src/browser/remote/device-runtime.js +27 -0
- package/dist/src/browser/remote/device-target.d.ts +4 -0
- package/dist/src/browser/remote/device-target.js +20 -0
- package/dist/src/browser/remote/endpoint-transport.d.ts +4 -0
- package/dist/src/browser/remote/endpoint-transport.js +48 -0
- package/dist/src/browser/runtime/browser-runtime.d.ts +1 -0
- package/dist/src/browser/runtime/browser-runtime.js +1 -0
- package/dist/src/browser/url-policy.js +19 -6
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/computer/broker.d.ts +2 -1
- package/dist/src/computer/broker.js +15 -0
- package/dist/src/computer/diagnostics.d.ts +3 -3
- package/dist/src/computer/endpoint-transport.d.ts +4 -0
- package/dist/src/computer/endpoint-transport.js +54 -0
- package/dist/src/computer/errors.js +1 -1
- package/dist/src/computer/evaluation.d.ts +2 -2
- package/dist/src/computer/program-runtime.js +14 -2
- package/dist/src/computer/runtime.d.ts +1 -0
- package/dist/src/computer/runtime.js +31 -11
- package/dist/src/computer/task-state.js +3 -1
- package/dist/src/endpoint-tools/capability-catalog.js +1 -1
- package/dist/src/endpoint-tools/desktop-authority-response.d.ts +19 -0
- package/dist/src/endpoint-tools/desktop-authority-response.js +38 -0
- package/dist/src/endpoint-tools/desktop-device-frame.d.ts +18 -0
- package/dist/src/endpoint-tools/desktop-device-frame.js +94 -0
- package/dist/src/endpoint-tools/desktop-execution.d.ts +14 -0
- package/dist/src/endpoint-tools/desktop-execution.js +28 -0
- package/dist/src/endpoint-tools/desktop-frame.d.ts +12 -0
- package/dist/src/endpoint-tools/desktop-frame.js +35 -0
- package/dist/src/endpoint-tools/desktop-observation.d.ts +4 -0
- package/dist/src/endpoint-tools/desktop-observation.js +20 -0
- package/dist/src/endpoint-tools/invocation-service.d.ts +35 -2
- package/dist/src/endpoint-tools/invocation-service.js +138 -14
- package/dist/src/endpoint-tools/policy.js +27 -2
- package/dist/src/endpoint-tools/registry.d.ts +5 -3
- package/dist/src/endpoint-tools/registry.js +10 -3
- package/dist/src/endpoint-tools/runtime.d.ts +4 -2
- package/dist/src/endpoint-tools/runtime.js +9 -3
- package/dist/src/endpoint-tools/terminal-broker.d.ts +90 -0
- package/dist/src/endpoint-tools/terminal-broker.js +320 -0
- package/dist/src/gateway/hono/app.js +7 -4
- package/dist/src/gateway/hono/middleware/auth.js +11 -1
- package/dist/src/gateway/hono/routes/agent-stream.js +2 -1
- package/dist/src/gateway/hono/routes/desktop-chat.d.ts +3 -0
- package/dist/src/gateway/hono/routes/desktop-chat.js +30 -0
- package/dist/src/gateway/hono/routes/desktop-execution-stop.d.ts +6 -0
- package/dist/src/gateway/hono/routes/desktop-execution-stop.js +52 -0
- package/dist/src/gateway/hono/routes/desktop-host.d.ts +3 -0
- package/dist/src/gateway/hono/routes/desktop-host.js +485 -0
- package/dist/src/gateway/hono/routes/devices.d.ts +3 -1
- package/dist/src/gateway/hono/routes/devices.js +7 -2
- package/dist/src/gateway/hono/routes/endpoint-tools.js +16 -4
- package/dist/src/gateway/hono/routes/lazy-bundles.js +21 -0
- package/dist/src/gateway/hono/routes/models.js +5 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +2 -1
- package/dist/src/gateway/security/gateway-scopes.js +10 -0
- package/dist/src/gateway/security/phone-access.js +4 -1
- package/dist/src/gateway/service/session-input-coordinator.js +5 -3
- package/dist/src/gateway/service.js +1 -0
- package/dist/src/gateway/session-context-summary.js +2 -1
- package/dist/src/providers/model-response.js +1 -0
- package/dist/src/providers/presentation.js +1 -1
- package/dist/src/realtime/runtime.js +86 -7
- package/dist/src/session/session-context-for-llm.js +3 -1
- package/dist/src/storage/sqlite/desktop-execution-repository.d.ts +44 -0
- package/dist/src/storage/sqlite/desktop-execution-repository.js +76 -0
- package/dist/src/storage/sqlite/desktop-execution-state.d.ts +13 -0
- package/dist/src/storage/sqlite/desktop-execution-state.js +22 -0
- package/dist/src/storage/sqlite/desktop-execution-stop-repository.d.ts +19 -0
- package/dist/src/storage/sqlite/desktop-execution-stop-repository.js +66 -0
- package/dist/src/storage/sqlite/desktop-operation-repository.d.ts +79 -0
- package/dist/src/storage/sqlite/desktop-operation-repository.js +143 -0
- package/dist/src/storage/sqlite/device-access-repository.d.ts +12 -0
- package/dist/src/storage/sqlite/device-access-repository.js +54 -3
- package/dist/src/storage/sqlite/device-pairing-approval.js +4 -4
- package/dist/src/storage/sqlite/device-pairing-repository.d.ts +1 -1
- package/dist/src/storage/sqlite/endpoint-principal-repository.d.ts +2 -0
- package/dist/src/storage/sqlite/endpoint-principal-repository.js +5 -1
- package/dist/src/storage/sqlite/endpoint-tool-invocation-repository.d.ts +2 -0
- package/dist/src/storage/sqlite/endpoint-tool-invocation-repository.js +8 -3
- package/dist/src/storage/sqlite/schema.d.ts +2 -2
- package/dist/src/storage/sqlite/schema.js +7 -7
- package/dist/src/storage/sqlite/schema.sql +48 -3
- package/dist/src/storage/sqlite/upgrades/263_desktop_device_credentials.sql +39 -0
- package/dist/src/storage/sqlite/upgrades/264_desktop_observation_grants.sql +5 -0
- package/dist/src/storage/sqlite/upgrades/265_desktop_screen_scope.sql +3 -0
- package/dist/src/storage/sqlite/upgrades/266_endpoint_operation_audit.sql +3 -0
- package/dist/src/storage/sqlite/upgrades/267_desktop_reliable_execution.sql +15 -0
- package/dist/src/storage/sqlite/upgrades/268_desktop_operation_reviews.sql +9 -0
- package/dist/src/storage/sqlite/upgrades/269_desktop_execution_stops.sql +10 -0
- package/dist/src/tasks/task-handoff.js +2 -1
- package/package.json +6 -2
- package/dist/gateway/static/root/assets/automation-task-card-DZWhCWJa.js +0 -3
- package/dist/gateway/static/root/assets/gateway-realtime-DwMd2PCt.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-CHrf6-nR.js +0 -1
- package/dist/gateway/static/root/assets/index-iukJWzxG.css +0 -1
- package/dist/gateway/static/root/assets/management-settings-Bu7T8ewk.js +0 -1
- package/dist/gateway/static/root/assets/messages-C7fckbyG.js +0 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-D6kUDDd5.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-D7G5utVi.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CZ4J3Kuy.js +0 -1
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-B2r9wlix.js +0 -1
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { REMOTE_BROWSER_CONTROL_TOOL } from "../../../packages/browser-control-contract/src/remote.js";
|
|
2
|
+
import { hasReviewedDesktopExecutionStop } from "../../storage/sqlite/desktop-operation-repository.js";
|
|
3
|
+
import { hasVerifiedDesktopExecutionStop } from "../../storage/sqlite/desktop-execution-stop-repository.js";
|
|
4
|
+
import { invokeRemoteBrowserCommand } from "./endpoint-transport.js";
|
|
5
|
+
import { randomUUID } from "node:crypto";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
//#region src/browser/remote/device-driver.ts
|
|
8
|
+
const id = z.string().min(1).max(200);
|
|
9
|
+
const node = z.object({
|
|
10
|
+
ref: id,
|
|
11
|
+
role: z.string().max(100),
|
|
12
|
+
name: z.string().max(12e3),
|
|
13
|
+
value: z.string().max(12e3).optional(),
|
|
14
|
+
description: z.string().max(12e3).optional(),
|
|
15
|
+
href: z.string().max(4096).optional(),
|
|
16
|
+
states: z.array(z.string().max(100)).max(32),
|
|
17
|
+
parent: id.optional(),
|
|
18
|
+
bounds: z.object({
|
|
19
|
+
x: z.number().finite(),
|
|
20
|
+
y: z.number().finite(),
|
|
21
|
+
width: z.number().nonnegative().finite(),
|
|
22
|
+
height: z.number().nonnegative().finite()
|
|
23
|
+
}).strict().optional()
|
|
24
|
+
}).strict();
|
|
25
|
+
const observation = z.object({
|
|
26
|
+
sessionId: id,
|
|
27
|
+
tabId: id,
|
|
28
|
+
revision: z.number().int().positive(),
|
|
29
|
+
documentId: id,
|
|
30
|
+
url: z.string().max(4096),
|
|
31
|
+
title: z.string().max(4096),
|
|
32
|
+
focused: id.optional(),
|
|
33
|
+
nodes: z.array(node).max(500),
|
|
34
|
+
changes: z.object({
|
|
35
|
+
added: z.array(node).max(500),
|
|
36
|
+
changed: z.array(node).max(500),
|
|
37
|
+
removed: z.array(id).max(500)
|
|
38
|
+
}).strict(),
|
|
39
|
+
truncation: z.object({
|
|
40
|
+
omittedNodeCount: z.number().int().nonnegative(),
|
|
41
|
+
visualOmitted: z.boolean(),
|
|
42
|
+
changesOmitted: z.boolean()
|
|
43
|
+
}).strict().optional()
|
|
44
|
+
}).strict();
|
|
45
|
+
const resultSchema = z.discriminatedUnion("ok", [z.object({
|
|
46
|
+
ok: z.literal(true),
|
|
47
|
+
receipt: z.object({
|
|
48
|
+
action: z.enum([
|
|
49
|
+
"observe",
|
|
50
|
+
"navigate",
|
|
51
|
+
"resolve",
|
|
52
|
+
"click",
|
|
53
|
+
"fill",
|
|
54
|
+
"select",
|
|
55
|
+
"check",
|
|
56
|
+
"press",
|
|
57
|
+
"scroll",
|
|
58
|
+
"wait",
|
|
59
|
+
"tabs",
|
|
60
|
+
"close"
|
|
61
|
+
]),
|
|
62
|
+
risk: z.enum([
|
|
63
|
+
"read",
|
|
64
|
+
"draft",
|
|
65
|
+
"external_effect",
|
|
66
|
+
"destructive",
|
|
67
|
+
"sensitive"
|
|
68
|
+
]),
|
|
69
|
+
durationMs: z.number().finite().nonnegative(),
|
|
70
|
+
verified: z.boolean(),
|
|
71
|
+
businessOutcome: z.enum([
|
|
72
|
+
"completed",
|
|
73
|
+
"verified",
|
|
74
|
+
"unknown"
|
|
75
|
+
]).optional(),
|
|
76
|
+
outputs: z.record(z.string().max(100), z.string().max(4096)).optional(),
|
|
77
|
+
observation: observation.optional(),
|
|
78
|
+
tabs: z.array(z.object({
|
|
79
|
+
id,
|
|
80
|
+
url: z.string().max(4096),
|
|
81
|
+
title: z.string().max(4096),
|
|
82
|
+
active: z.boolean()
|
|
83
|
+
}).strict()).max(4).optional()
|
|
84
|
+
}).strict()
|
|
85
|
+
}).strict(), z.object({
|
|
86
|
+
ok: z.literal(false),
|
|
87
|
+
error: z.object({
|
|
88
|
+
code: z.enum([
|
|
89
|
+
"ABORTED",
|
|
90
|
+
"BLOCKED_URL",
|
|
91
|
+
"DRIVER_UNAVAILABLE",
|
|
92
|
+
"EXPECTATION_FAILED",
|
|
93
|
+
"INVALID_INPUT",
|
|
94
|
+
"SESSION_NOT_FOUND",
|
|
95
|
+
"STALE_OBSERVATION",
|
|
96
|
+
"TARGET_NOT_FOUND",
|
|
97
|
+
"TIMEOUT",
|
|
98
|
+
"UNSUPPORTED_PAGE"
|
|
99
|
+
]),
|
|
100
|
+
message: z.string().max(4e3),
|
|
101
|
+
observation: observation.optional()
|
|
102
|
+
}).strict()
|
|
103
|
+
}).strict()]);
|
|
104
|
+
const replySchema = z.object({
|
|
105
|
+
version: z.literal(1),
|
|
106
|
+
dispatch: z.enum(["completed", "notStarted"]),
|
|
107
|
+
result: resultSchema
|
|
108
|
+
}).strict();
|
|
109
|
+
/** One conversation and exact device connection. Default/server Browser drivers are never instantiated by this adapter. */
|
|
110
|
+
var RemoteDeviceBrowserDriver = class {
|
|
111
|
+
kind = "desktop";
|
|
112
|
+
session;
|
|
113
|
+
used = false;
|
|
114
|
+
bound;
|
|
115
|
+
constructor(endpoints, endpointId, owner) {
|
|
116
|
+
this.endpoints = endpoints;
|
|
117
|
+
this.endpointId = endpointId;
|
|
118
|
+
this.owner = owner;
|
|
119
|
+
}
|
|
120
|
+
async connect() {
|
|
121
|
+
this.current();
|
|
122
|
+
}
|
|
123
|
+
current() {
|
|
124
|
+
const endpoint = this.endpoints.registry.get(this.endpointId), authority = endpoint?.executionAuthority;
|
|
125
|
+
const tool = this.endpoints.registry.getTool(this.endpointId, REMOTE_BROWSER_CONTROL_TOOL);
|
|
126
|
+
if (!endpoint || endpoint.kind !== "desktop" || !authority || !tool || endpoint.availability !== "foreground" || endpoint.principalId !== authority.deviceId || authority.expiresAt <= Date.now()) throw new Error("BROWSER_REMOTE_AUTHORITY_INVALID");
|
|
127
|
+
const next = {
|
|
128
|
+
connectionId: endpoint.connectionId,
|
|
129
|
+
deviceId: authority.deviceId,
|
|
130
|
+
gatewayId: authority.gatewayId,
|
|
131
|
+
grantId: authority.grantId,
|
|
132
|
+
revision: authority.authorizationRevision,
|
|
133
|
+
instanceId: authority.connectionInstanceId,
|
|
134
|
+
toolRevision: tool.revision
|
|
135
|
+
};
|
|
136
|
+
if (this.bound && JSON.stringify(this.bound) !== JSON.stringify(next)) throw new Error("BROWSER_REMOTE_CONNECTION_CHANGED");
|
|
137
|
+
this.bound ??= next;
|
|
138
|
+
}
|
|
139
|
+
async createSession(sessionId) {
|
|
140
|
+
this.current();
|
|
141
|
+
id.parse(sessionId);
|
|
142
|
+
if (this.session && this.session !== sessionId) throw new Error("BROWSER_REMOTE_SESSION_MISMATCH");
|
|
143
|
+
this.session = sessionId;
|
|
144
|
+
}
|
|
145
|
+
async disconnect() {
|
|
146
|
+
if (this.session) await this.closeSession(this.session);
|
|
147
|
+
}
|
|
148
|
+
verifiedStopped() {
|
|
149
|
+
const bound = this.bound;
|
|
150
|
+
if (!bound) return false;
|
|
151
|
+
const scope = {
|
|
152
|
+
gatewayId: bound.gatewayId,
|
|
153
|
+
deviceId: bound.deviceId,
|
|
154
|
+
authorizationRevision: bound.revision,
|
|
155
|
+
tool: REMOTE_BROWSER_CONTROL_TOOL,
|
|
156
|
+
toolRevision: bound.toolRevision
|
|
157
|
+
};
|
|
158
|
+
try {
|
|
159
|
+
return hasVerifiedDesktopExecutionStop(scope) || hasReviewedDesktopExecutionStop(scope);
|
|
160
|
+
} catch {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
async closeSession(sessionId, target) {
|
|
165
|
+
if (this.session !== sessionId) throw new Error("BROWSER_REMOTE_SESSION_MISMATCH");
|
|
166
|
+
this.target(target);
|
|
167
|
+
if (this.used && !this.verifiedStopped()) try {
|
|
168
|
+
const result = await this.send(sessionId, { action: "close" }, target);
|
|
169
|
+
if ("error" in result || !result.receipt.verified) throw new Error("BROWSER_REMOTE_RELEASE_UNCONFIRMED");
|
|
170
|
+
} catch (error) {
|
|
171
|
+
if (!this.verifiedStopped()) throw error;
|
|
172
|
+
}
|
|
173
|
+
this.session = void 0;
|
|
174
|
+
this.used = false;
|
|
175
|
+
}
|
|
176
|
+
navigate(sessionId, input, signal) {
|
|
177
|
+
const { target, sessionId: _session, ...value } = input;
|
|
178
|
+
return this.send(sessionId, value, target, signal);
|
|
179
|
+
}
|
|
180
|
+
async observe(sessionId, input, signal) {
|
|
181
|
+
const { target, sessionId: _session, ...value } = input, result = await this.send(sessionId, value, target, signal);
|
|
182
|
+
if ("error" in result) throw new Error(result.error.message);
|
|
183
|
+
if (!result.receipt.observation) throw new Error("BROWSER_REMOTE_OBSERVATION_MISSING");
|
|
184
|
+
return result.receipt.observation;
|
|
185
|
+
}
|
|
186
|
+
perform(sessionId, input, signal) {
|
|
187
|
+
if (input.action === "upload") return Promise.resolve({
|
|
188
|
+
ok: false,
|
|
189
|
+
error: {
|
|
190
|
+
code: "INVALID_INPUT",
|
|
191
|
+
message: "Remote Browser does not accept server paths. Use an explicitly authorized file transfer."
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
const { target, sessionId: _session, ...value } = input;
|
|
195
|
+
return this.send(sessionId, value, target, signal);
|
|
196
|
+
}
|
|
197
|
+
tabs(sessionId, input, signal) {
|
|
198
|
+
const { target, sessionId: _session, ...value } = input;
|
|
199
|
+
return this.send(sessionId, value, target, signal);
|
|
200
|
+
}
|
|
201
|
+
target(target) {
|
|
202
|
+
if (target && (target.kind !== "endpoint" || target.endpointId !== this.endpointId)) throw new Error("BROWSER_REMOTE_TARGET_MISMATCH");
|
|
203
|
+
}
|
|
204
|
+
async send(sessionId, input, target, signal) {
|
|
205
|
+
this.current();
|
|
206
|
+
this.target(target);
|
|
207
|
+
if (this.session !== sessionId) throw new Error("BROWSER_REMOTE_SESSION_MISMATCH");
|
|
208
|
+
const command = {
|
|
209
|
+
version: 1,
|
|
210
|
+
owner: this.owner,
|
|
211
|
+
sessionId,
|
|
212
|
+
actionId: randomUUID(),
|
|
213
|
+
input
|
|
214
|
+
};
|
|
215
|
+
this.used = true;
|
|
216
|
+
const reply = await invokeRemoteBrowserCommand(this.endpoints, this.endpointId, command, signal);
|
|
217
|
+
const json = reply.content.filter((item) => item.type === "json"), files = reply.content.filter((item) => item.type === "file");
|
|
218
|
+
let bytes;
|
|
219
|
+
try {
|
|
220
|
+
if (files.length === 1 && reply.invocationId) bytes = this.endpoints.uploads.takeComputerFrame(files[0].fileId, reply.invocationId);
|
|
221
|
+
if (json.length !== 1 || files.length > 1) throw new Error("BROWSER_REMOTE_RESULT_INVALID");
|
|
222
|
+
const result = replySchema.parse(json[0].value).result;
|
|
223
|
+
const state = "error" in result ? result.error.observation : result.receipt.observation;
|
|
224
|
+
this.current();
|
|
225
|
+
signal?.throwIfAborted();
|
|
226
|
+
if (state && state.sessionId !== sessionId || !("error" in result) && result.receipt.action !== input.action) throw new Error("BROWSER_REMOTE_RESULT_MISMATCH");
|
|
227
|
+
if (files.length && (!bytes || !state || !["image/png", "image/jpeg"].includes(files[0].mimeType))) throw new Error("BROWSER_REMOTE_FRAME_MISSING");
|
|
228
|
+
if (input.action === "observe" && input.visual === "always" && !("error" in result) && !bytes) throw new Error("BROWSER_REMOTE_FRAME_MISSING");
|
|
229
|
+
if (bytes && state) {
|
|
230
|
+
const copy = Buffer.from(bytes);
|
|
231
|
+
try {
|
|
232
|
+
state.visual = {
|
|
233
|
+
mimeType: files[0].mimeType,
|
|
234
|
+
data: copy.toString("base64")
|
|
235
|
+
};
|
|
236
|
+
} finally {
|
|
237
|
+
copy.fill(0);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return result;
|
|
241
|
+
} finally {
|
|
242
|
+
bytes?.fill(0);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
//#endregion
|
|
247
|
+
export { RemoteDeviceBrowserDriver };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BrowserRuntime } from '../runtime/browser-runtime.js';
|
|
2
|
+
/** An idle callback must never collect a runtime while a first browser call is still being admitted. */
|
|
3
|
+
export declare class RemoteDeviceBrowserRuntime extends BrowserRuntime {
|
|
4
|
+
private readonly idle;
|
|
5
|
+
private calls;
|
|
6
|
+
hasPendingCalls(): boolean;
|
|
7
|
+
constructor(options: ConstructorParameters<typeof BrowserRuntime>[0], idle: () => void);
|
|
8
|
+
execute(...args: Parameters<BrowserRuntime['execute']>): ReturnType<BrowserRuntime['execute']>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { BrowserRuntime } from "../runtime/browser-runtime.js";
|
|
2
|
+
//#region src/browser/remote/device-runtime.ts
|
|
3
|
+
/** An idle callback must never collect a runtime while a first browser call is still being admitted. */
|
|
4
|
+
var RemoteDeviceBrowserRuntime = class extends BrowserRuntime {
|
|
5
|
+
calls = 0;
|
|
6
|
+
hasPendingCalls() {
|
|
7
|
+
return this.calls > 0;
|
|
8
|
+
}
|
|
9
|
+
constructor(options, idle) {
|
|
10
|
+
super({
|
|
11
|
+
...options,
|
|
12
|
+
retainSessionsUntilStopped: true
|
|
13
|
+
});
|
|
14
|
+
this.idle = idle;
|
|
15
|
+
}
|
|
16
|
+
async execute(...args) {
|
|
17
|
+
this.calls += 1;
|
|
18
|
+
try {
|
|
19
|
+
return await super.execute(...args);
|
|
20
|
+
} finally {
|
|
21
|
+
this.calls -= 1;
|
|
22
|
+
if (!this.calls && !this.hasSessions()) this.idle();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { RemoteDeviceBrowserRuntime };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TurnOrigin } from '@xopcai/endpoint-tools-protocol';
|
|
2
|
+
import type { EndpointToolRuntime } from '../../endpoint-tools/runtime.js';
|
|
3
|
+
/** Fresh explicit device input wins over historical bindings. Revoked/offline desktop devices remain a device path and fail closed. */
|
|
4
|
+
export declare function remoteBrowserEndpoint(runtime: EndpointToolRuntime, owner: string, origin: TurnOrigin): string | undefined;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getDevice } from "../../storage/sqlite/device-access-repository.js";
|
|
2
|
+
import { getBoundEndpointPrincipalId } from "../../storage/sqlite/endpoint-principal-repository.js";
|
|
3
|
+
//#region src/browser/remote/device-target.ts
|
|
4
|
+
/** Fresh explicit device input wins over historical bindings. Revoked/offline desktop devices remain a device path and fail closed. */
|
|
5
|
+
function remoteBrowserEndpoint(runtime, owner, origin) {
|
|
6
|
+
const desktop = (id) => {
|
|
7
|
+
const endpoint = runtime.registry.get(id);
|
|
8
|
+
if (endpoint?.executionAuthority) return endpoint.kind === "desktop";
|
|
9
|
+
if (endpoint && endpoint.kind !== "desktop") return false;
|
|
10
|
+
const principalId = endpoint?.principalId ?? getBoundEndpointPrincipalId(id);
|
|
11
|
+
return Boolean(principalId && getDevice(principalId)?.platform === "desktop");
|
|
12
|
+
};
|
|
13
|
+
if (origin.type === "endpoint" && desktop(origin.endpointId)) return origin.endpointId;
|
|
14
|
+
const binding = runtime.bindings.get(owner);
|
|
15
|
+
if (!binding) return void 0;
|
|
16
|
+
const endpointId = runtime.bindings.resolve(owner)?.endpointId ?? binding.endpointId;
|
|
17
|
+
return desktop(endpointId) ? endpointId : void 0;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { remoteBrowserEndpoint };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type RemoteBrowserCommand } from '@xopcai/browser-control-contract/remote';
|
|
2
|
+
import type { EndpointToolRuntime } from '../../endpoint-tools/runtime.js';
|
|
3
|
+
/** Dedicated device path only. Missing or replaced devices never fall back to a server or legacy browser endpoint. */
|
|
4
|
+
export declare function invokeRemoteBrowserCommand(endpoints: EndpointToolRuntime, endpointId: string, command: RemoteBrowserCommand, signal?: AbortSignal): Promise<import("../../endpoint-tools/invocation-service.js").EndpointInvocationResult>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { canonicalJson, init_src } from "../../../packages/endpoint-tools-protocol/src/index.js";
|
|
2
|
+
import { ExternalEffectNotAppliedError, executeExternalOperation } from "../../capabilities/runtime/external-operations.js";
|
|
3
|
+
import { REMOTE_BROWSER_CONTROL_TOOL } from "../../../packages/browser-control-contract/src/remote.js";
|
|
4
|
+
import { EndpointToolExecutionError } from "../../endpoint-tools/invocation-service.js";
|
|
5
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
6
|
+
//#region src/browser/remote/endpoint-transport.ts
|
|
7
|
+
init_src();
|
|
8
|
+
const hash = (value) => createHash("sha256").update(canonicalJson(value)).digest("hex");
|
|
9
|
+
/** Dedicated device path only. Missing or replaced devices never fall back to a server or legacy browser endpoint. */
|
|
10
|
+
async function invokeRemoteBrowserCommand(endpoints, endpointId, command, signal) {
|
|
11
|
+
signal?.throwIfAborted();
|
|
12
|
+
const request = structuredClone(command);
|
|
13
|
+
const endpoint = endpoints.registry.get(endpointId), authority = endpoint?.executionAuthority;
|
|
14
|
+
const tool = endpoints.registry.getTool(endpointId, REMOTE_BROWSER_CONTROL_TOOL);
|
|
15
|
+
if (!endpoint || endpoint.kind !== "desktop" || !authority || !tool || endpoint.availability !== "foreground" || authority.deviceId !== endpoint.principalId || authority.expiresAt <= Date.now()) throw new Error("BROWSER_REMOTE_AUTHORITY_INVALID");
|
|
16
|
+
return executeExternalOperation({
|
|
17
|
+
principalId: authority.deviceId,
|
|
18
|
+
capabilityId: `desktop-browser:${authority.deviceId}`,
|
|
19
|
+
idempotencyKey: hash([
|
|
20
|
+
request.owner,
|
|
21
|
+
request.sessionId,
|
|
22
|
+
request.actionId
|
|
23
|
+
]),
|
|
24
|
+
requestDigest: hash(request),
|
|
25
|
+
descriptorDigest: tool.revision,
|
|
26
|
+
surface: "desktop-browser",
|
|
27
|
+
recovery: "manual"
|
|
28
|
+
}, async (operationId) => {
|
|
29
|
+
const current = endpoints.registry.get(endpointId), live = current?.executionAuthority;
|
|
30
|
+
if (signal?.aborted || !current || !live || current.connectionId !== endpoint.connectionId || current.availability !== "foreground" || current.principalId !== endpoint.principalId || live.deviceId !== authority.deviceId || live.gatewayId !== authority.gatewayId || live.grantId !== authority.grantId || live.authorizationRevision !== authority.authorizationRevision || live.connectionInstanceId !== authority.connectionInstanceId || live.expiresAt <= Date.now() || endpoints.registry.getTool(endpointId, "desktop.browser.control")?.revision !== tool.revision) throw new ExternalEffectNotAppliedError("Browser authority changed before dispatch");
|
|
31
|
+
try {
|
|
32
|
+
return await endpoints.invocations.invoke({
|
|
33
|
+
endpointId,
|
|
34
|
+
toolName: REMOTE_BROWSER_CONTROL_TOOL,
|
|
35
|
+
descriptorRevision: tool.revision,
|
|
36
|
+
toolCallId: randomUUID(),
|
|
37
|
+
operationId,
|
|
38
|
+
arguments: request,
|
|
39
|
+
signal
|
|
40
|
+
});
|
|
41
|
+
} catch (error) {
|
|
42
|
+
if (error instanceof EndpointToolExecutionError && (error.confirmedNoEffect || error.code === "USER_DENIED")) throw new ExternalEffectNotAppliedError(error.message, { cause: error });
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { invokeRemoteBrowserCommand };
|
|
@@ -9,6 +9,7 @@ export interface BrowserRuntimeOptions {
|
|
|
9
9
|
isTrustedSetupUrl?: (taskKey: string, url: string) => boolean;
|
|
10
10
|
emit?: (type: string, payload: unknown) => void;
|
|
11
11
|
resolveTarget?: (taskKey: string) => BrowserTarget | undefined;
|
|
12
|
+
retainSessionsUntilStopped?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export declare class BrowserRuntime {
|
|
14
15
|
private readonly options;
|
|
@@ -294,6 +294,7 @@ var BrowserRuntime = class {
|
|
|
294
294
|
};
|
|
295
295
|
}
|
|
296
296
|
evictExpiredSessions() {
|
|
297
|
+
if (this.options.retainSessionsUntilStopped) return;
|
|
297
298
|
const expiresBefore = Date.now() - this.options.getConfig().limits.sessionTimeoutMs;
|
|
298
299
|
for (const [taskKey, session] of this.sessionsByTask) {
|
|
299
300
|
if (session.lastUsedAt >= expiresBefore) continue;
|
|
@@ -50,7 +50,7 @@ function assertBrowserUrlAllowed(raw, options) {
|
|
|
50
50
|
*/
|
|
51
51
|
function isAlwaysBlockedUrl(raw) {
|
|
52
52
|
try {
|
|
53
|
-
const host = new URL(raw.trim()).hostname
|
|
53
|
+
const host = normalizeHostname(new URL(raw.trim()).hostname);
|
|
54
54
|
if (ALWAYS_BLOCKED_HOSTNAMES.has(host)) return true;
|
|
55
55
|
if (ALWAYS_BLOCKED_IPV4.has(host)) return true;
|
|
56
56
|
if (isIPv4(host) && isLinkLocal(host)) return true;
|
|
@@ -81,7 +81,7 @@ function checkPostRedirectUrl(finalUrl, options) {
|
|
|
81
81
|
if (isAlwaysBlockedUrl(finalUrl)) return "Blocked: redirect landed on a cloud metadata endpoint";
|
|
82
82
|
if (options?.privateHostAllowed) return void 0;
|
|
83
83
|
try {
|
|
84
|
-
const host = new URL(finalUrl.trim()).hostname
|
|
84
|
+
const host = normalizeHostname(new URL(finalUrl.trim()).hostname);
|
|
85
85
|
if (host === "localhost" || host.endsWith(".localhost")) return "Blocked: redirect landed on localhost";
|
|
86
86
|
if (isIPv4(host) && isBlockedIPv4(host)) return "Blocked: redirect landed on a private/internal address";
|
|
87
87
|
if (isIPv6(host) && isBlockedIPv6(host)) return "Blocked: redirect landed on a private/loopback IPv6 address";
|
|
@@ -103,14 +103,27 @@ function parseAndValidateUrl(raw) {
|
|
|
103
103
|
function assertNotApiKeyExfiltration(raw) {
|
|
104
104
|
if (containsApiKeyPattern(raw)) throw new Error("Blocked: URL contains what appears to be an API key or token. Secrets must not be sent in URLs.");
|
|
105
105
|
}
|
|
106
|
+
/** URL.hostname retains IPv6 brackets and canonicalizes mapped IPv4 into two hex groups. */
|
|
107
|
+
function normalizeHostname(hostname) {
|
|
108
|
+
const host = hostname.toLowerCase().replace(/^\[|\]$/g, "");
|
|
109
|
+
const mapped = /^::ffff:([a-f0-9]{1,4}):([a-f0-9]{1,4})$/.exec(host);
|
|
110
|
+
if (!mapped) return host;
|
|
111
|
+
const high = Number.parseInt(mapped[1], 16), low = Number.parseInt(mapped[2], 16);
|
|
112
|
+
return [
|
|
113
|
+
high >>> 8,
|
|
114
|
+
high & 255,
|
|
115
|
+
low >>> 8,
|
|
116
|
+
low & 255
|
|
117
|
+
].join(".");
|
|
118
|
+
}
|
|
106
119
|
function assertNotAlwaysBlocked(hostname) {
|
|
107
|
-
const host = hostname
|
|
120
|
+
const host = normalizeHostname(hostname);
|
|
108
121
|
if (ALWAYS_BLOCKED_HOSTNAMES.has(host)) throw new Error("Blocked: cloud metadata endpoint");
|
|
109
122
|
if (ALWAYS_BLOCKED_IPV4.has(host)) throw new Error("Blocked: cloud metadata address");
|
|
110
123
|
if (isIPv4(host) && isLinkLocal(host)) throw new Error("Blocked: link-local address (cloud metadata range)");
|
|
111
124
|
}
|
|
112
125
|
function assertNotPrivate(hostname, allowPrivate) {
|
|
113
|
-
const host = hostname
|
|
126
|
+
const host = normalizeHostname(hostname);
|
|
114
127
|
if (allowPrivate) return;
|
|
115
128
|
if (host === "localhost" || host.endsWith(".localhost")) throw new Error("Blocked: localhost");
|
|
116
129
|
if (isIPv4(host)) {
|
|
@@ -143,8 +156,8 @@ function isBlockedIPv4(host) {
|
|
|
143
156
|
}
|
|
144
157
|
function isBlockedIPv6(host) {
|
|
145
158
|
const h = host.toLowerCase().replace(/^\[|\]$/g, "");
|
|
146
|
-
if (h === "::1") return true;
|
|
147
|
-
if (h
|
|
159
|
+
if (h === "::" || h === "::1") return true;
|
|
160
|
+
if (/^fe[89ab][0-9a-f]:/.test(h)) return true;
|
|
148
161
|
if (h.startsWith("fc") || h.startsWith("fd")) return true;
|
|
149
162
|
return false;
|
|
150
163
|
}
|
|
@@ -31,7 +31,7 @@ async function checkDatabaseSchema(ctx) {
|
|
|
31
31
|
id: "database-schema",
|
|
32
32
|
label: "Database schema",
|
|
33
33
|
status: "pass",
|
|
34
|
-
message: `SQLite schema v${readSchemaVersion(getSqliteDatabase())} (current release
|
|
34
|
+
message: `SQLite schema v${readSchemaVersion(getSqliteDatabase())} (current release v269).`,
|
|
35
35
|
hints: []
|
|
36
36
|
};
|
|
37
37
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
|
-
import { type ComputerAction, type ComputerCommand, type ComputerModelBinding, type ComputerObservation, type ComputerReceipt, type ComputerTarget, type ComputerApp, type ComputerWindow, type ComputerInputTiming } from '@xopcai/computer-control-contract';
|
|
2
|
+
import { type ComputerPreviewActivity, type ComputerAction, type ComputerCommand, type ComputerModelBinding, type ComputerObservation, type ComputerReceipt, type ComputerTarget, type ComputerApp, type ComputerWindow, type ComputerInputTiming } from '@xopcai/computer-control-contract';
|
|
3
3
|
import { type ComputerConfig } from './config.js';
|
|
4
4
|
import type { ComputerNativeTiming } from './diagnostics.js';
|
|
5
5
|
import { type ComputerDiagnosticSchema } from './errors.js';
|
|
@@ -85,6 +85,7 @@ export interface ComputerPreviewAuthority {
|
|
|
85
85
|
brokerEpoch: string;
|
|
86
86
|
appName: string;
|
|
87
87
|
status: string;
|
|
88
|
+
activity?: ComputerPreviewActivity;
|
|
88
89
|
target?: ComputerTarget;
|
|
89
90
|
signal: AbortSignal;
|
|
90
91
|
}
|
|
@@ -223,6 +223,11 @@ var ComputerBroker = class {
|
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
225
|
async observe(s, afterAction) {
|
|
226
|
+
s.activity = {
|
|
227
|
+
phase: "observing",
|
|
228
|
+
...afterAction ? { action: afterAction } : {}
|
|
229
|
+
};
|
|
230
|
+
this.host.onStateChange?.();
|
|
226
231
|
let frame;
|
|
227
232
|
try {
|
|
228
233
|
frame = await this.driver.observe(s.target, s.controller.signal);
|
|
@@ -274,6 +279,10 @@ var ComputerBroker = class {
|
|
|
274
279
|
stateDigest: frame.stateDigest
|
|
275
280
|
};
|
|
276
281
|
s.touchedAt = this.now();
|
|
282
|
+
s.activity = {
|
|
283
|
+
phase: "ready",
|
|
284
|
+
...afterAction ? { action: afterAction } : {}
|
|
285
|
+
};
|
|
277
286
|
return {
|
|
278
287
|
...this.result(s),
|
|
279
288
|
observation: s.observation,
|
|
@@ -411,6 +420,11 @@ var ComputerBroker = class {
|
|
|
411
420
|
s.actions += computerActionInputCount(e.action);
|
|
412
421
|
s.pending = void 0;
|
|
413
422
|
s.status = "running";
|
|
423
|
+
s.activity = {
|
|
424
|
+
phase: "acting",
|
|
425
|
+
action: e.action.kind
|
|
426
|
+
};
|
|
427
|
+
this.host.onStateChange?.();
|
|
414
428
|
try {
|
|
415
429
|
const inputStarted = this.durationNow();
|
|
416
430
|
try {
|
|
@@ -504,6 +518,7 @@ var ComputerBroker = class {
|
|
|
504
518
|
brokerEpoch: this.epoch,
|
|
505
519
|
appName: this.apps.get(s.appRef)?.name ?? s.appId,
|
|
506
520
|
status: s.status,
|
|
521
|
+
activity: s.activity ? { ...s.activity } : void 0,
|
|
507
522
|
target: s.target ? { ...s.target } : void 0,
|
|
508
523
|
signal: s.controller.signal
|
|
509
524
|
};
|
|
@@ -19,8 +19,8 @@ export declare const ComputerFailureCategorySchema: z.ZodEnum<{
|
|
|
19
19
|
cancelled: "cancelled";
|
|
20
20
|
model: "model";
|
|
21
21
|
observation: "observation";
|
|
22
|
-
budget: "budget";
|
|
23
22
|
transport: "transport";
|
|
23
|
+
budget: "budget";
|
|
24
24
|
native: "native";
|
|
25
25
|
no_progress: "no_progress";
|
|
26
26
|
harness: "harness";
|
|
@@ -33,8 +33,8 @@ export declare const ComputerFailureSchema: z.ZodObject<{
|
|
|
33
33
|
cancelled: "cancelled";
|
|
34
34
|
model: "model";
|
|
35
35
|
observation: "observation";
|
|
36
|
-
budget: "budget";
|
|
37
36
|
transport: "transport";
|
|
37
|
+
budget: "budget";
|
|
38
38
|
native: "native";
|
|
39
39
|
no_progress: "no_progress";
|
|
40
40
|
harness: "harness";
|
|
@@ -312,8 +312,8 @@ export declare const ComputerSessionReportSchema: z.ZodObject<{
|
|
|
312
312
|
cancelled: "cancelled";
|
|
313
313
|
model: "model";
|
|
314
314
|
observation: "observation";
|
|
315
|
-
budget: "budget";
|
|
316
315
|
transport: "transport";
|
|
316
|
+
budget: "budget";
|
|
317
317
|
native: "native";
|
|
318
318
|
no_progress: "no_progress";
|
|
319
319
|
harness: "harness";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ComputerCommand } from '@xopcai/computer-control-contract';
|
|
2
|
+
import type { EndpointToolRuntime } from '../endpoint-tools/runtime.js';
|
|
3
|
+
/** Keep local transport unchanged; independently authorized remote Computer commands always carry durable intent. */
|
|
4
|
+
export declare function invokeComputerCommand(endpoints: EndpointToolRuntime, endpointId: string, command: ComputerCommand, signal?: AbortSignal): Promise<import("../endpoint-tools/invocation-service.js").EndpointInvocationResult>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { canonicalJson, init_src } from "../../packages/endpoint-tools-protocol/src/index.js";
|
|
2
|
+
import { COMPUTER_CONTROL_TOOL, REMOTE_COMPUTER_CONTROL_TOOL, init_src as init_src$1 } from "../../packages/computer-control-contract/src/index.js";
|
|
3
|
+
import { ExternalEffectNotAppliedError, executeExternalOperation } from "../capabilities/runtime/external-operations.js";
|
|
4
|
+
import { EndpointToolExecutionError } from "../endpoint-tools/invocation-service.js";
|
|
5
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
6
|
+
//#region src/computer/endpoint-transport.ts
|
|
7
|
+
init_src$1();
|
|
8
|
+
init_src();
|
|
9
|
+
const hash = (input) => createHash("sha256").update(canonicalJson(input)).digest("hex");
|
|
10
|
+
/** Keep local transport unchanged; independently authorized remote Computer commands always carry durable intent. */
|
|
11
|
+
async function invokeComputerCommand(endpoints, endpointId, command, signal) {
|
|
12
|
+
signal?.throwIfAborted();
|
|
13
|
+
const endpoint = endpoints.registry.get(endpointId), authority = endpoint?.executionAuthority;
|
|
14
|
+
const toolName = authority ? REMOTE_COMPUTER_CONTROL_TOOL : COMPUTER_CONTROL_TOOL;
|
|
15
|
+
const tool = endpoints.registry.getTool(endpointId, toolName);
|
|
16
|
+
if (!tool) throw new Error("COMPUTER_DESKTOP_UPGRADE_REQUIRED");
|
|
17
|
+
const invoke = (operationId) => endpoints.invocations.invoke({
|
|
18
|
+
endpointId,
|
|
19
|
+
toolCallId: randomUUID(),
|
|
20
|
+
toolName,
|
|
21
|
+
arguments: command,
|
|
22
|
+
descriptorRevision: tool.revision,
|
|
23
|
+
...operationId ? { operationId } : {},
|
|
24
|
+
signal
|
|
25
|
+
});
|
|
26
|
+
if (!authority) return invoke();
|
|
27
|
+
if (!endpoint || endpoint.availability !== "foreground" || authority.deviceId !== endpoint.principalId || authority.expiresAt <= Date.now() || tool.descriptor.name !== "desktop.computer.remote_control") throw new Error("COMPUTER_REMOTE_AUTHORITY_INVALID");
|
|
28
|
+
const identity = command.op === "act" ? command.envelope.actionId : command.op === "open" ? "open" : randomUUID();
|
|
29
|
+
return executeExternalOperation({
|
|
30
|
+
principalId: authority.deviceId,
|
|
31
|
+
capabilityId: `desktop-computer:${authority.deviceId}`,
|
|
32
|
+
idempotencyKey: hash([
|
|
33
|
+
command.owner,
|
|
34
|
+
command.sessionId,
|
|
35
|
+
command.op,
|
|
36
|
+
identity
|
|
37
|
+
]),
|
|
38
|
+
requestDigest: hash(command),
|
|
39
|
+
descriptorDigest: tool.revision,
|
|
40
|
+
surface: "desktop-computer",
|
|
41
|
+
recovery: "manual"
|
|
42
|
+
}, async (operationId) => {
|
|
43
|
+
const current = endpoints.registry.get(endpointId);
|
|
44
|
+
if (signal?.aborted || !current || current.connectionId !== endpoint.connectionId || current.availability !== "foreground" || current.executionAuthority?.connectionInstanceId !== authority.connectionInstanceId || current.principalId !== endpoint.principalId || current.executionAuthority.deviceId !== authority.deviceId || current.executionAuthority.gatewayId !== authority.gatewayId || current.executionAuthority.grantId !== authority.grantId || current.executionAuthority.authorizationRevision !== authority.authorizationRevision || current.executionAuthority.expiresAt <= Date.now() || endpoints.registry.getTool(endpointId, toolName)?.revision !== tool.revision) throw new ExternalEffectNotAppliedError("Computer authority changed before dispatch");
|
|
45
|
+
try {
|
|
46
|
+
return await invoke(operationId);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
if (error instanceof EndpointToolExecutionError && (error.confirmedNoEffect || error.code === "USER_DENIED")) throw new ExternalEffectNotAppliedError(error.message, { cause: error });
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { invokeComputerCommand };
|
|
@@ -269,7 +269,7 @@ function computerRecovery(code) {
|
|
|
269
269
|
case "COMPUTER_APP_NOT_FOUND": return "Discover again. If absent, ask the user to install the app; do not guess an identifier.";
|
|
270
270
|
case "COMPUTER_APP_NOT_AUTHORIZED": return "This application has not been authorized in the local Computer Use settings. Tell the user where to configure access. Do not request a chat approval or try another control route.";
|
|
271
271
|
case "COMPUTER_APP_NOT_RUNNING": return "Open with prepare=true only if the user requested launching the app; otherwise ask them to open it.";
|
|
272
|
-
case "COMPUTER_WINDOW_OTHER_SPACE": return "The target window is on another macOS desktop/Space
|
|
272
|
+
case "COMPUTER_WINDOW_OTHER_SPACE": return "The target window is on another macOS desktop/Space and automatic exact-window recovery is unavailable or did not succeed. Current desktop hosts temporarily let chat follow Spaces and reveal the existing authorized window without replaying input. Check host support and the returned failure before asking for a manual workspace change; do not retry unchanged or bypass visibility checks.";
|
|
273
273
|
case "COMPUTER_WINDOW_REQUIRED": return "No visible target window. If the task permits bringing the app forward, open with prepare=true; otherwise ask the user to show the window. If preparation already failed, require a local state change before retrying.";
|
|
274
274
|
case "COMPUTER_DRIVER_BRING_TO_FRONT_REFUSED": return "The native driver refused to activate the app window. Ask the user to bring the intended window to the foreground locally, then discover and open it with prepare=false. Do not repeat prepare=true or use another control route.";
|
|
275
275
|
case "COMPUTER_WINDOW_AMBIGUOUS": return "Choose a returned windowRef only when its title matches the task. Otherwise ask the user using window titles, not IDs.";
|
|
@@ -54,8 +54,8 @@ export declare const ComputerEvaluationRunSchema: z.ZodObject<{
|
|
|
54
54
|
cancelled: "cancelled";
|
|
55
55
|
model: "model";
|
|
56
56
|
observation: "observation";
|
|
57
|
-
budget: "budget";
|
|
58
57
|
transport: "transport";
|
|
58
|
+
budget: "budget";
|
|
59
59
|
native: "native";
|
|
60
60
|
no_progress: "no_progress";
|
|
61
61
|
harness: "harness";
|
|
@@ -276,7 +276,7 @@ export declare function isAutonomousComputerSuccess(run: ComputerEvaluationRun):
|
|
|
276
276
|
/** Export measured runtime values only; an executor must supply independent safety and oracle evidence. */
|
|
277
277
|
export declare function computerReportMeasurements(report: ComputerSessionReport): {
|
|
278
278
|
failure?: {
|
|
279
|
-
category: "permission" | "target" | "unknown" | "cancelled" | "model" | "observation" | "
|
|
279
|
+
category: "permission" | "target" | "unknown" | "cancelled" | "model" | "observation" | "transport" | "budget" | "native" | "no_progress" | "harness";
|
|
280
280
|
phase: "open" | "executor" | "model" | "dispatch" | "observe" | "release" | "frame_upload" | "oracle";
|
|
281
281
|
errorCode: string;
|
|
282
282
|
dispatch: "unknown" | "completed" | "started" | "notStarted";
|