@xopcai/xopc 0.0.437 → 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-CXhhy7_9.js → activity-store-Fl327RND.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-_h4GxzUK.js → agent-avatar-dicebear-DL_MfWA8.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-B_QEDfMT.js → agent-avatar-display-BTDt883i.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-DWIluCZB.js → agent-defaults-settings-panel-CuiIuR1Q.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-lCWIS06R.js → agent-plugin-dialog-moOAOJPs.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-C-tIn72l.js → agents-B1yM1cWS.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-DIStX2e1.js → agents-admin-api-D6pZX7nW.js} +1 -1
- package/dist/gateway/static/root/assets/{api-C4xrqOKi.js → api-H3OfSCEz.js} +1 -1
- package/dist/gateway/static/root/assets/{api-bT-kA268.js → api-np_upIrk.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-Dk75Bmi2.js → app-management-settings-panel-IFKcvOK9.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-DTj1XI4v.js → appearance-settings-Cfb4s0Ik.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-7iAULaEl.js → apps-page-DMDwnwEi.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-BADrW4yR.js → archive-plugin-DBKvxHvn.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-CRz5EE_c.js → automation-api-iUvu64Gn.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-D0EHDk4V.js → automation-result-state-EFwxlLpI.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-run-list-CnaV2j9R.js → automation-run-list-C66yqC4g.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-DD4yjrI6.js → automation-task-card-DXNh_uKL.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-DDNx4Gn3.js → automations-page-iCsHbzY_.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-CtidgXTX.js → automations-workspace-DnLrs-fb.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-hpeH8g5V.js → binary-plugins-C5K0CWqt.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-P_RGb2rE.js → block-editor-3TVEcFpk.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-C3gQlgox.js → browser-automation-inputs-Wuph6STC.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-CsdyL6q5.js → browser-automations-page-THaENU71.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-control-api-Btwz8koK.js → browser-control-api-DeRUE9Io.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-B-ks3b8r.js → browser-settings-page-CeNb4Kyc.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-f0YyWX04.js → capabilities-B3cchabB.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-C4F2D1gH.js → capabilities-CFO_gAma.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-CJm5gNu8.js → capabilities-page-KM3X4Bj-.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-BMg8DBa0.js → capabilities-settings-panel-CX201jtA.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-DYgvP8sO.js → channels-DmF6s5BH.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-BrsUEl3u.js → chat-agents-api-ipkXPITj.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-Cq3aoRzV.js → chat-chart-block-KOdy3HcB.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-page-dh7ImvX8.js → chat-page-DZy7iw5A.js} +6 -6
- package/dist/gateway/static/root/assets/{chat-terminal-dock-2eGZ5qZ7.js → chat-terminal-dock-BouLAS3C.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-BEqdX7Q-.js → command-palette-api-CHEmmKmY.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-BBm3ypBb.js → composer-payload-handoff-DQVtV0L9.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-DUhsxs4l.js → computer-settings-page-DwEzbr0-.js} +1 -1
- package/dist/gateway/static/root/assets/{connected-providers-grid-BsCLGLnw.js → connected-providers-grid-CWdA7VtN.js} +1 -1
- package/dist/gateway/static/root/assets/{connection-usage-guide-BgvvHMc4.js → connection-usage-guide-5RmYdXoS.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-C3SmPK1c.js → connector-service-page-TeYvzScr.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-Now9xXuA.js → connectors-api-Byw6RD4z.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-CTMeC7Pt.js → connectors-page-B4PrSnT8.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-CBoc2ETg.js → date-picker-BpccZyjF.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DS2dJydK.js → desktop-pet-DfGMB4GN.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CzGc9byI.js → desktop-pet-settings-ky__zEoY.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-BXMp1Npf.js → dev-view-store-do-XMWDA.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard--SCayxiS.js → device-pairing-wizard-CQNlQGYH.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-P_-tLtwi.js → directory-picker-path-field-DjhHz-4p.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-D_NJLur2.js → discussion-annotation-sync-CvGsuUi9.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CE9KJpjL.js → extension-debug-page-BimrAkDl.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-ClbrQvGF.js → extension-iframe-host-7zoDddj6.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-BNNQYLeu.js → extension-marketplace-api-DA-nbL9C.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-C6qZ9pGs.js → extension-page-wjS2go2N.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-KmpUveDY.js → extension-provider-C2L-lGqA.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DWKB4ETv.js → extension-settings-page-CTHs7h7H.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-CEDfehx5.js → file-preview-surface-QUJiCKCs.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-CtEdaxOS.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-srJ9TMC5.js → gateway-restart-L34umMj8.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DWVxjM9y.js → gateway-settings-DjwPEBcq.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-xpHdw5uq.js → gateway-startup-retry-CgLo6P66.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-C-ogBDn1.js → global-defaults-api-Cv6QEJBa.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-2Uj--v_o.js → home-page-D9gDR4MB.js} +2 -2
- package/dist/gateway/static/root/assets/{image-generation-api-DFGE3Ait.js → image-generation-api-C_GDIILz.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-BkslHrr5.js → imports-page-CvY8wdNu.js} +1 -1
- package/dist/gateway/static/root/assets/{index-BxHzmTJV.js → index-BVyX4V3C.js} +5 -5
- package/dist/gateway/static/root/assets/{install-connector-dialog-Fctw32Lx.js → install-connector-dialog-Cnx5oOXv.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DFBpeaA_.js → keyboard-shortcuts-settings-AXisbvQn.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-hJzkUVoK.js → local-app-workbench-page-DxO9ZTU_.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-Bj-nywIv.js → local-apps-page-sas0hMvK.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-hodTdtvj.js → local-session-drafts-DzHbV0VQ.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-LhhHA2sK.js → locale-store-BRJAl_Kx.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-CcM2foZi.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-usF9EoMp.js → markdown-view-BRNPKsnn.js} +1 -1
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-CfHcS8aO.js → mcp-conversation-setup-page-C5gTNa2U.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Kpj3pQ3i.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-VVkCmNdS.js → model-selector-kWRDioTb.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-BfrcizHv.js → models-hub-cache-h2vf54qy.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-vvlPKLHz.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-DflS6I2c.js → notes-api-D29fdWyC.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-DKPHaszO.js → notes-page-CqnQ_UEf.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-CZiot_FY.js → oauth-api-C8McgC-r.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-BjLEJ4az.js → oauth-provider-connect-BDTdg0lv.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-C3okR3ap.js → page-context-capture-button-Bf0qvNmd.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-DRE6i2wO.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-TZzkeDZK.js → personal-avatar-CpEFjQ4Q.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-Cz-KnXHT.js → personal-page-BvjPpwdy.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-BilBWHZ1.js → personal-settings-panel-DixKsLRd.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-B_l_JCRy.js → phone-dependencies-card-BfpFV3SG.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-DmYRqxCF.js → phone-model-connection-Os87SvBE.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-wK2tRuj0.js → phone-model-picker-8pkA8k_N.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-DWUZuu3k.js → phone-settings-page-ByERmr61.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-CpH233TG.js → phone-workspace-store-DfhWmYic.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-DIQH12Ki.js → plugin-details-dialog-J4PKpTud.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-DPXt3YyQ.js → preference-select-fields-C-PLFUS9.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-BVkkAJkY.js → product-automation-feedback-DLsF8VBW.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-D-fwzOTB.js → product-open-page-BP-ssaP8.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-DLnOxTnn.js → product-preview-content-BMI7ZuKU.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-AeEtUDZQ.js → product-preview-modal-DZ0zi6ZF.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-B7L3Kvhc.js → project-detail-page-CS-NrYi5.js} +1 -1
- package/dist/gateway/static/root/assets/{project-understanding-tqZ0etEw.js → project-understanding-C9WWE-3t.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-D65pw44g.js → projects-page-DVa38OsG.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-DzeStdCu.js → providers-api-C1KpkGUT.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-Id3p5Vyv.js → recording-upload-T5ArHnPJ.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-B3YqZBhQ.js → registry-api-Cs-R00dn.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-DxAInmWy.js → remote-access-hub-C6NBt2s-.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-DH-GGLSM.js → resource-unavailable-BuySLm9q.js} +1 -1
- package/dist/gateway/static/root/assets/{route-preload-C22MIvup.js → route-preload-CDMyXjLQ.js} +2 -2
- package/dist/gateway/static/root/assets/{runtime-tools-api-8mXDTzc2.js → runtime-tools-api-CvTCMobW.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-S2HxRVlT.js → runtime-tools-settings-panel-DlW9tAnO.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-DFqBz8S6.js → service-recommendation-list-Biono7Ua.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-DZ2Ov33K.js → session-api-BNt6b3Xl.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-DSaoWM1F.js → session-manager-CQNN8D0M.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-BpUbNplq.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-TJ8MAroB.js → settings-advanced-section-D4uJuQwW.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-xhm6JIs-.js → settings-mode-store-CnG8uLvP.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-B_XKKvWr.js → settings-page-9BthXfuc.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-BEDxq_lT.js → settings-page-header-BXdbhzia.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-BftgkTYo.js → settings-page-layout-BQvK_gmr.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-BtihoIoz.js → setup-interaction-page-D1uhozUt.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-DehYof2V.js → setup-status-panel-C1o4-hF4.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-C-mhzvLF.js → share-link-dialog-QTEdYG4I.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-Cnxfv66F.js → share-preview-page-Ba77bFgS.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-D2HTaQZH.js → shares-api-DayDdoBR.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-BLcnCGon.js → shares-settings-67poMpxi.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-DOISy5q8.js → skill-api-DR3vdsrS.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-LoIlcCDf.js → skill-list-api-D6X3XyTd.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-qSwB_mAH.js → skill-reload-api-Wu0UkQ13.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-CJXLVK0U.js → skills-page-FmjOxilb.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BT6_yFco.js → system-settings-panel-BLeXSW3w.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-1AFyRTia.js → task-detail-page-B5uwlFwb.js} +1 -1
- package/dist/gateway/static/root/assets/{task-result-evidence-CkwEM0In.js → task-result-evidence-m78K4eAp.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-BP3dN3md.js → terminal-panel-store-CWpiIbPY.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-BZ8YC33M.js → theme-store-B9upxkW-.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-9YvEnES_.js → tracing-settings-page-CACPSXVV.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-CnPOg1pg.js → tunnel-api-CCC7XSFJ.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-3sOhoxX4.js → understanding-activity-store-D7WFQ-t7.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-BBXlbRLa.js → understanding-refresh-store-CvOFPfDi.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-6LW4yLy1.js → usage-page-P9-7xf1p.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-CDy9yziL.js → use-autosave-BNNxl23c.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-C4eSyX-C.js → use-composer-attachments-7uMSpyxm.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-SFqd8k7K.js → use-file-preview-expanded-C-NCuwM3.js} +2 -2
- package/dist/gateway/static/root/assets/{use-personal-profile-sQzaa6Dy.js → use-personal-profile-1lm_wDMe.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-DKPvcyw1.js → use-workspace-tree-HlkNpRDC.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-DYVp7nA6.js → user-model-page-B6XfYtEm.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-BKXWXCit.js → voice-api-key-field-CRZS6XEF.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-DNxzs-eF.js → voice-config-api-CrgRaCMk.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-3kcfHPrY.js → voice-input-shortcut-events-vjcw6SRC.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-transcribe-api-CVVa_x99.js → voice-transcribe-api-CtUoGgGT.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-B4F3MACu.js → work-discovery-overlay-C9tI_qQv.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-BuKTCGSR.js → work-discovery-page-C-8kE4mx.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-BiDK93J_.js → working-directory-picker-modal-B5fxn2wG.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-S2aJOX7w.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-B9f3GN7l.js → workspace-file-preview-dialog-Cp86E6-h.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-BNjipenH.js → workspace-open-location-menu-CWOgHMmR.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-Csye7zKU.js → xopc-cloud-account-card-CIaHnCGw.js} +1 -1
- package/dist/gateway/static/root/index.html +80 -80
- 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/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/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/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/cli/commands/platform.js +2 -2
- 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/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 +5 -4
- package/dist/src/gateway/session-context-summary.js +2 -1
- package/dist/src/home-intelligence/host.js +2 -2
- 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/gateway-realtime-SunJUMP3.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-BywiC4CK.js +0 -1
- package/dist/gateway/static/root/assets/management-settings-gwDIT7mY.js +0 -1
- package/dist/gateway/static/root/assets/messages-C3xqMM9W.js +0 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-BDZGHYaZ.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-BVj8nDdi.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CGgt1myW.js +0 -1
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-oZKoWMdV.js +0 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { EndpointInvocationService } from './invocation-service.js';
|
|
2
|
+
import { EndpointRegistry } from './registry.js';
|
|
3
|
+
/** Gateway session router. Root durability outlives the open response; transport ACKs never become execution outcomes. */
|
|
4
|
+
export declare class DesktopTerminalGatewayBroker {
|
|
5
|
+
private readonly registry;
|
|
6
|
+
private readonly invocations;
|
|
7
|
+
private readonly sessions;
|
|
8
|
+
private closed;
|
|
9
|
+
constructor(registry: EndpointRegistry, invocations: EndpointInvocationService);
|
|
10
|
+
private authority;
|
|
11
|
+
private fail;
|
|
12
|
+
open(input: {
|
|
13
|
+
endpointId: string;
|
|
14
|
+
args: Record<string, unknown>;
|
|
15
|
+
revision: string;
|
|
16
|
+
key: string;
|
|
17
|
+
toolCallId: string;
|
|
18
|
+
signal?: AbortSignal;
|
|
19
|
+
}): Promise<{
|
|
20
|
+
operationId: string;
|
|
21
|
+
state: string;
|
|
22
|
+
executionStopped: boolean;
|
|
23
|
+
sessionId: string;
|
|
24
|
+
generation: string;
|
|
25
|
+
connectionInstanceId: string;
|
|
26
|
+
}>;
|
|
27
|
+
private finished;
|
|
28
|
+
private event;
|
|
29
|
+
control(input: {
|
|
30
|
+
endpointId: string;
|
|
31
|
+
args: Record<string, unknown>;
|
|
32
|
+
key: string;
|
|
33
|
+
signal?: AbortSignal;
|
|
34
|
+
}): Promise<{
|
|
35
|
+
sessionId: string;
|
|
36
|
+
generation: string;
|
|
37
|
+
connectionInstanceId: string;
|
|
38
|
+
event: "opened";
|
|
39
|
+
operationId: string;
|
|
40
|
+
state: "running";
|
|
41
|
+
executionStopped: false;
|
|
42
|
+
} | {
|
|
43
|
+
sequence: number;
|
|
44
|
+
bytes: string;
|
|
45
|
+
sessionId: string;
|
|
46
|
+
generation: string;
|
|
47
|
+
connectionInstanceId: string;
|
|
48
|
+
event: "output";
|
|
49
|
+
} | {
|
|
50
|
+
sessionId: string;
|
|
51
|
+
generation: string;
|
|
52
|
+
connectionInstanceId: string;
|
|
53
|
+
event: "input-ack";
|
|
54
|
+
inputId: string;
|
|
55
|
+
sequence: number;
|
|
56
|
+
dispatch: "unknown" | "accepted" | "notStarted";
|
|
57
|
+
} | {
|
|
58
|
+
sessionId: string;
|
|
59
|
+
generation: string;
|
|
60
|
+
connectionInstanceId: string;
|
|
61
|
+
event: "resize-ack";
|
|
62
|
+
requestId: string;
|
|
63
|
+
columns: number;
|
|
64
|
+
rows: number;
|
|
65
|
+
} | {
|
|
66
|
+
sessionId: string;
|
|
67
|
+
generation: string;
|
|
68
|
+
connectionInstanceId: string;
|
|
69
|
+
event: "stream-ended";
|
|
70
|
+
reason: "unknown" | "eof" | "disconnected";
|
|
71
|
+
} | {
|
|
72
|
+
frames: {
|
|
73
|
+
sequence: number;
|
|
74
|
+
bytes: string;
|
|
75
|
+
sessionId: string;
|
|
76
|
+
generation: string;
|
|
77
|
+
connectionInstanceId: string;
|
|
78
|
+
}[];
|
|
79
|
+
text: string;
|
|
80
|
+
state: string;
|
|
81
|
+
executionStopped: boolean;
|
|
82
|
+
} | {
|
|
83
|
+
state: string;
|
|
84
|
+
executionStopped: boolean;
|
|
85
|
+
frames?: undefined;
|
|
86
|
+
text?: undefined;
|
|
87
|
+
}>;
|
|
88
|
+
close(): void;
|
|
89
|
+
whenStopped(): Promise<void>;
|
|
90
|
+
}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import { desktopTerminalBindingSchema } from "../../packages/endpoint-tools-protocol/src/terminal.js";
|
|
2
|
+
import { canonicalJson, init_src } from "../../packages/endpoint-tools-protocol/src/index.js";
|
|
3
|
+
import { ExternalEffectNotAppliedError, executeExternalOperation } from "../capabilities/runtime/external-operations.js";
|
|
4
|
+
import { getDesktopExecutionGrant } from "../storage/sqlite/desktop-execution-repository.js";
|
|
5
|
+
import { getDesktopOperationReceipt } from "../storage/sqlite/desktop-operation-repository.js";
|
|
6
|
+
import { EndpointToolExecutionError } from "./invocation-service.js";
|
|
7
|
+
import { createHash } from "node:crypto";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
//#region src/endpoint-tools/terminal-broker.ts
|
|
10
|
+
init_src();
|
|
11
|
+
const digest = (value) => createHash("sha256").update(canonicalJson(value)).digest("hex");
|
|
12
|
+
function deferred() {
|
|
13
|
+
let resolve, reject;
|
|
14
|
+
return {
|
|
15
|
+
promise: new Promise((yes, no) => {
|
|
16
|
+
resolve = yes;
|
|
17
|
+
reject = no;
|
|
18
|
+
}),
|
|
19
|
+
resolve,
|
|
20
|
+
reject
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const controlSchema = z.strictObject({
|
|
24
|
+
sessionId: z.uuid(),
|
|
25
|
+
generation: z.uuid(),
|
|
26
|
+
action: z.enum([
|
|
27
|
+
"input",
|
|
28
|
+
"read",
|
|
29
|
+
"resize",
|
|
30
|
+
"close"
|
|
31
|
+
]),
|
|
32
|
+
text: z.string().refine((value) => Buffer.byteLength(value) <= 4e3).optional(),
|
|
33
|
+
columns: z.number().int().min(20).max(500).optional(),
|
|
34
|
+
rows: z.number().int().min(2).max(500).optional()
|
|
35
|
+
});
|
|
36
|
+
/** Gateway session router. Root durability outlives the open response; transport ACKs never become execution outcomes. */
|
|
37
|
+
var DesktopTerminalGatewayBroker = class {
|
|
38
|
+
sessions = /* @__PURE__ */ new Map();
|
|
39
|
+
closed = false;
|
|
40
|
+
constructor(registry, invocations) {
|
|
41
|
+
this.registry = registry;
|
|
42
|
+
this.invocations = invocations;
|
|
43
|
+
}
|
|
44
|
+
authority(session, allowClosed = false) {
|
|
45
|
+
const endpoint = this.registry.get(session.endpoint.endpointId), original = session.endpoint.executionAuthority;
|
|
46
|
+
const grant = original && getDesktopExecutionGrant(original.deviceId);
|
|
47
|
+
if (this.closed || session.closed && !allowClosed || !endpoint || endpoint.terminalVersion !== 1 || endpoint.connectionId !== session.endpoint.connectionId || endpoint.availability !== "foreground" || !original || !grant?.active || grant.revision !== original.authorizationRevision || grant.grant?.grantId !== original.grantId || original.expiresAt <= Date.now()) throw new Error("DESKTOP_TERMINAL_AUTHORITY_INVALID");
|
|
48
|
+
return endpoint;
|
|
49
|
+
}
|
|
50
|
+
fail(session, reason) {
|
|
51
|
+
session.uncertain = true;
|
|
52
|
+
session.controller.abort();
|
|
53
|
+
session.pending?.result.reject(new Error(reason));
|
|
54
|
+
session.pending = void 0;
|
|
55
|
+
}
|
|
56
|
+
async open(input) {
|
|
57
|
+
input.signal?.throwIfAborted();
|
|
58
|
+
const endpoint = this.registry.get(input.endpointId), tool = this.registry.getTool(input.endpointId, "desktop.terminal.open");
|
|
59
|
+
if (!endpoint?.executionAuthority || endpoint.terminalVersion !== 1 || tool?.revision !== input.revision) throw new Error("DESKTOP_TERMINAL_NOT_NEGOTIATED");
|
|
60
|
+
const mapKey = digest({
|
|
61
|
+
endpointId: input.endpointId,
|
|
62
|
+
connectionId: endpoint.connectionId,
|
|
63
|
+
key: input.key
|
|
64
|
+
});
|
|
65
|
+
let session = this.sessions.get(mapKey);
|
|
66
|
+
if (session) {
|
|
67
|
+
this.authority(session);
|
|
68
|
+
if (session.argsHash !== digest(input.args)) throw new Error("DESKTOP_TERMINAL_INTENT_CONFLICT");
|
|
69
|
+
return {
|
|
70
|
+
...await session.opened.promise,
|
|
71
|
+
operationId: session.operationId,
|
|
72
|
+
state: "running",
|
|
73
|
+
executionStopped: false
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
if (this.sessions.size >= 64) throw new Error("DESKTOP_TERMINAL_SESSION_LIMIT");
|
|
77
|
+
if ([...this.sessions.values()].some((session) => session.endpoint.principalId === endpoint.principalId && !session.closed)) throw new Error("DESKTOP_TERMINAL_BUSY");
|
|
78
|
+
session = {
|
|
79
|
+
endpoint,
|
|
80
|
+
key: mapKey,
|
|
81
|
+
argsHash: digest(input.args),
|
|
82
|
+
controller: new AbortController(),
|
|
83
|
+
opened: deferred(),
|
|
84
|
+
closed: false,
|
|
85
|
+
uncertain: false,
|
|
86
|
+
closing: false,
|
|
87
|
+
frames: [],
|
|
88
|
+
outputSequence: 0,
|
|
89
|
+
inputSequence: 0,
|
|
90
|
+
busy: false,
|
|
91
|
+
decoder: new TextDecoder()
|
|
92
|
+
};
|
|
93
|
+
this.authority(session);
|
|
94
|
+
this.sessions.set(mapKey, session);
|
|
95
|
+
const current = session, abort = () => {
|
|
96
|
+
this.fail(current, "DESKTOP_TERMINAL_OPEN_CANCELLED");
|
|
97
|
+
};
|
|
98
|
+
input.signal?.addEventListener("abort", abort, { once: true });
|
|
99
|
+
current.opened.promise.catch(() => {});
|
|
100
|
+
current.root = executeExternalOperation({
|
|
101
|
+
principalId: endpoint.principalId,
|
|
102
|
+
capabilityId: "desktop-terminal-root:" + endpoint.endpointId,
|
|
103
|
+
idempotencyKey: input.key,
|
|
104
|
+
requestDigest: current.argsHash,
|
|
105
|
+
descriptorDigest: input.revision,
|
|
106
|
+
surface: "desktop-terminal",
|
|
107
|
+
recovery: "manual",
|
|
108
|
+
leaseMs: 12e4
|
|
109
|
+
}, async (operationId) => {
|
|
110
|
+
current.operationId = operationId;
|
|
111
|
+
try {
|
|
112
|
+
return await this.invocations.invoke({
|
|
113
|
+
endpointId: input.endpointId,
|
|
114
|
+
toolCallId: input.toolCallId,
|
|
115
|
+
toolName: "desktop.terminal.open",
|
|
116
|
+
arguments: input.args,
|
|
117
|
+
descriptorRevision: input.revision,
|
|
118
|
+
operationId,
|
|
119
|
+
signal: current.controller.signal,
|
|
120
|
+
onTerminal: (invocationId, event) => {
|
|
121
|
+
current.invocationId = invocationId;
|
|
122
|
+
this.event(current, event);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
} catch (error) {
|
|
126
|
+
const authority = endpoint.executionAuthority, receipt = getDesktopOperationReceipt(operationId, authority.deviceId, authority.gatewayId);
|
|
127
|
+
if (current.closing && !current.uncertain && error instanceof EndpointToolExecutionError && error.code === "TOOL_CANCELLED" && receipt?.state === "stopped" && receipt.executionStopped && receipt.invocationId === current.invocationId) return {
|
|
128
|
+
closed: true,
|
|
129
|
+
executionStopped: true,
|
|
130
|
+
outcome: "stopped"
|
|
131
|
+
};
|
|
132
|
+
if (error instanceof EndpointToolExecutionError && (error.confirmedNoEffect || error.code === "USER_DENIED")) throw new ExternalEffectNotAppliedError(error.message, { cause: error });
|
|
133
|
+
throw error;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
current.root.then(() => this.finished(current), (error) => this.finished(current, error));
|
|
137
|
+
try {
|
|
138
|
+
const binding = await current.opened.promise;
|
|
139
|
+
this.authority(current);
|
|
140
|
+
return {
|
|
141
|
+
...binding,
|
|
142
|
+
operationId: current.operationId,
|
|
143
|
+
state: "running",
|
|
144
|
+
executionStopped: false
|
|
145
|
+
};
|
|
146
|
+
} finally {
|
|
147
|
+
input.signal?.removeEventListener("abort", abort);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
finished(session, error) {
|
|
151
|
+
session.closed = true;
|
|
152
|
+
if (error) session.uncertain = true;
|
|
153
|
+
session.opened.reject(error ?? /* @__PURE__ */ new Error("DESKTOP_TERMINAL_CLOSED_BEFORE_READY"));
|
|
154
|
+
session.pending?.result.reject(/* @__PURE__ */ new Error("DESKTOP_TERMINAL_CLOSED"));
|
|
155
|
+
session.pending = void 0;
|
|
156
|
+
}
|
|
157
|
+
event(session, event) {
|
|
158
|
+
this.authority(session);
|
|
159
|
+
const binding = desktopTerminalBindingSchema.parse({
|
|
160
|
+
sessionId: event.sessionId,
|
|
161
|
+
generation: event.generation,
|
|
162
|
+
connectionInstanceId: event.connectionInstanceId
|
|
163
|
+
});
|
|
164
|
+
if (!session.binding) {
|
|
165
|
+
if (event.event !== "opened" || event.operationId !== session.operationId || event.sessionId !== session.operationId) throw new Error("DESKTOP_TERMINAL_BINDING_INVALID");
|
|
166
|
+
session.binding = binding;
|
|
167
|
+
session.opened.resolve(binding);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (canonicalJson(session.binding) !== canonicalJson(binding)) throw new Error("DESKTOP_TERMINAL_BINDING_INVALID");
|
|
171
|
+
if (event.event === "output") {
|
|
172
|
+
if (event.sequence !== session.outputSequence + 1 || session.frames.length >= 16 || Buffer.from(event.bytes, "base64").toString("base64") !== event.bytes) {
|
|
173
|
+
this.fail(session, "DESKTOP_TERMINAL_OUTPUT_UNKNOWN");
|
|
174
|
+
throw new Error("DESKTOP_TERMINAL_OUTPUT_UNKNOWN");
|
|
175
|
+
}
|
|
176
|
+
session.outputSequence = event.sequence;
|
|
177
|
+
session.frames.push({
|
|
178
|
+
...binding,
|
|
179
|
+
sequence: event.sequence,
|
|
180
|
+
bytes: event.bytes
|
|
181
|
+
});
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if (event.event === "stream-ended") return;
|
|
185
|
+
const pending = session.pending;
|
|
186
|
+
if (event.event === "input-ack" && pending?.id === event.inputId && pending.sequence === event.sequence || event.event === "resize-ack" && pending?.id === event.requestId) {
|
|
187
|
+
pending.result.resolve(event);
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
this.fail(session, "DESKTOP_TERMINAL_EVENT_INVALID");
|
|
191
|
+
throw new Error("DESKTOP_TERMINAL_EVENT_INVALID");
|
|
192
|
+
}
|
|
193
|
+
async control(input) {
|
|
194
|
+
const args = controlSchema.parse(input.args), session = [...this.sessions.values()].find((session) => session.endpoint.endpointId === input.endpointId && session.binding?.sessionId === args.sessionId && session.binding.generation === args.generation);
|
|
195
|
+
if (!session?.binding || !session.invocationId) throw new Error("DESKTOP_TERMINAL_UNAVAILABLE");
|
|
196
|
+
this.authority(session, args.action === "read");
|
|
197
|
+
input.signal?.throwIfAborted();
|
|
198
|
+
if (session.busy) throw new Error("DESKTOP_TERMINAL_BUSY");
|
|
199
|
+
const tool = this.registry.getTool(input.endpointId, "desktop.terminal.control");
|
|
200
|
+
if (!tool) throw new Error("DESKTOP_TERMINAL_NOT_NEGOTIATED");
|
|
201
|
+
session.busy = true;
|
|
202
|
+
try {
|
|
203
|
+
return await executeExternalOperation({
|
|
204
|
+
principalId: session.endpoint.principalId,
|
|
205
|
+
capabilityId: "desktop-terminal-control:" + args.sessionId,
|
|
206
|
+
idempotencyKey: input.key,
|
|
207
|
+
requestDigest: digest(args),
|
|
208
|
+
descriptorDigest: tool.revision,
|
|
209
|
+
surface: "desktop-terminal",
|
|
210
|
+
recovery: "manual",
|
|
211
|
+
leaseMs: 6e4
|
|
212
|
+
}, async (requestId) => {
|
|
213
|
+
this.authority(session, args.action === "read");
|
|
214
|
+
input.signal?.throwIfAborted();
|
|
215
|
+
if (args.action === "read") {
|
|
216
|
+
if (args.text !== void 0 || args.columns !== void 0 || args.rows !== void 0) throw new ExternalEffectNotAppliedError("Invalid terminal read arguments");
|
|
217
|
+
const frames = session.frames.splice(0, 1);
|
|
218
|
+
if (frames.length && !session.closed) this.registry.send(input.endpointId, "terminal.command", {
|
|
219
|
+
invocationId: session.invocationId,
|
|
220
|
+
command: {
|
|
221
|
+
...session.binding,
|
|
222
|
+
action: "ack",
|
|
223
|
+
throughSequence: frames.at(-1).sequence
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
const authority = session.endpoint.executionAuthority;
|
|
227
|
+
const receipt = session.closed && session.operationId ? getDesktopOperationReceipt(session.operationId, authority.deviceId, authority.gatewayId) : void 0;
|
|
228
|
+
return {
|
|
229
|
+
frames,
|
|
230
|
+
text: session.decoder.decode(Buffer.concat(frames.map((frame) => Buffer.from(frame.bytes, "base64"))), { stream: !session.closed || session.frames.length > 0 }),
|
|
231
|
+
state: session.closed ? session.uncertain ? "unknown" : "closed" : "running",
|
|
232
|
+
executionStopped: receipt?.executionStopped === true
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
if (args.action === "close") {
|
|
236
|
+
session.closing = true;
|
|
237
|
+
this.registry.send(input.endpointId, "terminal.command", {
|
|
238
|
+
invocationId: session.invocationId,
|
|
239
|
+
command: {
|
|
240
|
+
...session.binding,
|
|
241
|
+
action: "close"
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
await session.root;
|
|
245
|
+
return {
|
|
246
|
+
state: "closed",
|
|
247
|
+
executionStopped: true
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
const result = deferred();
|
|
251
|
+
result.promise.catch(() => {});
|
|
252
|
+
if (args.action === "input") {
|
|
253
|
+
if (typeof args.text !== "string" || !args.text || args.columns !== void 0 || args.rows !== void 0 || session.inputSequence >= 1e3) throw new ExternalEffectNotAppliedError("Invalid terminal input");
|
|
254
|
+
session.pending = {
|
|
255
|
+
id: requestId,
|
|
256
|
+
sequence: ++session.inputSequence,
|
|
257
|
+
result
|
|
258
|
+
};
|
|
259
|
+
this.registry.send(input.endpointId, "terminal.command", {
|
|
260
|
+
invocationId: session.invocationId,
|
|
261
|
+
command: {
|
|
262
|
+
...session.binding,
|
|
263
|
+
action: "input",
|
|
264
|
+
inputId: requestId,
|
|
265
|
+
sequence: session.inputSequence,
|
|
266
|
+
bytes: Buffer.from(args.text).toString("base64")
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
} else {
|
|
270
|
+
if (args.text !== void 0 || args.columns === void 0 || args.rows === void 0) throw new ExternalEffectNotAppliedError("Invalid terminal resize");
|
|
271
|
+
session.pending = {
|
|
272
|
+
id: requestId,
|
|
273
|
+
result
|
|
274
|
+
};
|
|
275
|
+
this.registry.send(input.endpointId, "terminal.command", {
|
|
276
|
+
invocationId: session.invocationId,
|
|
277
|
+
command: {
|
|
278
|
+
...session.binding,
|
|
279
|
+
action: "resize",
|
|
280
|
+
requestId,
|
|
281
|
+
columns: args.columns,
|
|
282
|
+
rows: args.rows
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
let timer;
|
|
287
|
+
const abort = () => {
|
|
288
|
+
this.fail(session, "DESKTOP_TERMINAL_CONTROL_UNKNOWN");
|
|
289
|
+
};
|
|
290
|
+
input.signal?.addEventListener("abort", abort, { once: true });
|
|
291
|
+
try {
|
|
292
|
+
const event = await Promise.race([result.promise, new Promise((_, reject) => {
|
|
293
|
+
timer = setTimeout(() => reject(/* @__PURE__ */ new Error("DESKTOP_TERMINAL_CONTROL_UNKNOWN")), Math.max(1, Math.min(6e4, session.endpoint.executionAuthority.expiresAt - Date.now())));
|
|
294
|
+
})]);
|
|
295
|
+
this.authority(session);
|
|
296
|
+
if (event.event === "input-ack" && event.dispatch === "unknown") throw new Error("DESKTOP_TERMINAL_CONTROL_UNKNOWN");
|
|
297
|
+
return event;
|
|
298
|
+
} catch (error) {
|
|
299
|
+
this.fail(session, "DESKTOP_TERMINAL_CONTROL_UNKNOWN");
|
|
300
|
+
throw error;
|
|
301
|
+
} finally {
|
|
302
|
+
clearTimeout(timer);
|
|
303
|
+
input.signal?.removeEventListener("abort", abort);
|
|
304
|
+
session.pending = void 0;
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
} finally {
|
|
308
|
+
session.busy = false;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
close() {
|
|
312
|
+
this.closed = true;
|
|
313
|
+
for (const session of this.sessions.values()) if (!session.closed) this.fail(session, "DESKTOP_TERMINAL_GATEWAY_CLOSED");
|
|
314
|
+
}
|
|
315
|
+
async whenStopped() {
|
|
316
|
+
await Promise.allSettled([...this.sessions.values()].map((session) => session.root));
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
//#endregion
|
|
320
|
+
export { DesktopTerminalGatewayBroker };
|
|
@@ -222,10 +222,13 @@ function createHonoApp(config) {
|
|
|
222
222
|
});
|
|
223
223
|
registerPublicGatewayRoutes(app, service);
|
|
224
224
|
registerPublicHtmlPreviewRoute(app);
|
|
225
|
-
registerDeviceAuthPublicRoutes(app, {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
225
|
+
registerDeviceAuthPublicRoutes(app, {
|
|
226
|
+
onDesktopExecutionStopped: (deviceId) => service.realtime.disconnectPrincipal(deviceId),
|
|
227
|
+
getTrustedProxyContext: () => ({
|
|
228
|
+
trustedProxies: service.currentConfig.gateway?.trustedProxies,
|
|
229
|
+
allowRealIpFallback: service.currentConfig.gateway?.allowRealIpFallback === true
|
|
230
|
+
})
|
|
231
|
+
});
|
|
229
232
|
registerPublicExtensionAssetRoutes(app, service);
|
|
230
233
|
registerPublicLocalAppPreviewRoutes(app, service);
|
|
231
234
|
const authenticated = new Hono();
|
|
@@ -7,6 +7,7 @@ import { isAuthRateLimitGloballyDisabled } from "../../rate-limit/env-flags.js";
|
|
|
7
7
|
import "../../rate-limit/index.js";
|
|
8
8
|
import { authenticateDeviceAccessToken, getDevice } from "../../../storage/sqlite/device-access-repository.js";
|
|
9
9
|
import { getOrCreateGatewayIdentity } from "../../../storage/sqlite/gateway-identity-repository.js";
|
|
10
|
+
import { getDesktopExecutionGrant } from "../../../storage/sqlite/desktop-execution-repository.js";
|
|
10
11
|
import { safeEqualSecret } from "../../security/secret-equal.js";
|
|
11
12
|
import { resolveClientIpFromRequest } from "../../client-ip.js";
|
|
12
13
|
import { PROOF_HEADER, acquireProofBodyBudget, consumeRequestNonce, parseRequestProof, proofDigest, requestProofMessage, verifyRequestProofSignature } from "../../security/device-request-proof.js";
|
|
@@ -268,7 +269,7 @@ function auth(config) {
|
|
|
268
269
|
error: "Unauthorized",
|
|
269
270
|
code: "REQUEST_PROOF_INVALID"
|
|
270
271
|
}, 401);
|
|
271
|
-
const release = /^(multipart\/form-data|application\/octet-stream)/i.test(c.req.header("content-type") ?? "") || Number(c.req.header("content-length") ?? 0) > 65536 ? acquireProofBodyBudget(device.id) : () => {};
|
|
272
|
+
const release = /^\/api\/endpoint-tools\/invocations\/[^/]+\/files$/.test(requestPath) || /^(multipart\/form-data|application\/octet-stream)/i.test(c.req.header("content-type") ?? "") || Number(c.req.header("content-length") ?? 0) > 65536 ? acquireProofBodyBudget(device.id) : () => {};
|
|
272
273
|
if (!release) {
|
|
273
274
|
c.header("Retry-After", "1");
|
|
274
275
|
return c.json({
|
|
@@ -286,6 +287,15 @@ function auth(config) {
|
|
|
286
287
|
code: "REQUEST_REPLAYED"
|
|
287
288
|
}, 401);
|
|
288
289
|
}
|
|
290
|
+
const desktopExecution = device?.platform === "desktop" && device.scopes.includes("desktop.execute") ? getDesktopExecutionGrant(device.id) : void 0;
|
|
291
|
+
if (device?.platform === "desktop" && !(c.req.method === "GET" && (requestPath === "/api/desktop-host/operations" || /^\/api\/desktop-host\/operations\/[0-9a-f-]{36}$/.test(requestPath)) || c.req.method === "POST" && /^\/api\/desktop-host\/operations\/[0-9a-f-]{36}\/review$/.test(requestPath) || [
|
|
292
|
+
"GET",
|
|
293
|
+
"POST",
|
|
294
|
+
"DELETE"
|
|
295
|
+
].includes(c.req.method) && requestPath === "/api/desktop-host/execution" || c.req.method === "GET" && ["/api/desktop-host/compatibility", "/api/devices/me"].includes(requestPath) || c.req.method === "DELETE" && requestPath === "/api/devices/me" || c.req.method === "DELETE" && ["/api/desktop-host/observation", "/api/desktop-host/screen"].includes(requestPath) || (device.scopes.includes("desktop.observe.screen") || device.scopes.includes("desktop.execute") && desktopExecution?.active && (desktopExecution.grant?.toolRevisions["desktop.computer.remote_control"] || desktopExecution.grant?.toolRevisions["desktop.browser.control"])) && c.req.method === "POST" && /^\/api\/endpoint-tools\/invocations\/[0-9a-f-]{36}\/files$/.test(requestPath) || (device.scopes.includes("desktop.observe.state") || device.scopes.includes("desktop.observe.screen") || desktopExecution?.active) && (c.req.method === "POST" && ["/api/endpoint-tools/principals", "/api/realtime/tickets"].includes(requestPath) || c.req.method === "GET" && ["/api/endpoint-tools/compatibility", "/api/desktop-host/status"].includes(requestPath)))) return c.json({
|
|
296
|
+
error: "Forbidden",
|
|
297
|
+
code: "DESKTOP_CREDENTIAL_SCOPE_DENIED"
|
|
298
|
+
}, 403);
|
|
289
299
|
recordSuccess(rl);
|
|
290
300
|
setGatewayPrincipal(c, {
|
|
291
301
|
kind: "device",
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { parseUserTurnDocument, userTurnDocumentRefIds } from "../../../../packages/gateway-contract/src/user-turn-document.js";
|
|
2
2
|
import { clarificationResponseCommandSchema } from "../../../../packages/gateway-contract/src/clarifications.js";
|
|
3
3
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
4
|
-
import { parseTurnContextRefs } from "../../../agent/source-context/types.js";
|
|
4
|
+
import { init_types, parseTurnContextRefs } from "../../../agent/source-context/types.js";
|
|
5
5
|
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
6
6
|
import { replaceLatestSessionTurn } from "./session-input-handler.js";
|
|
7
7
|
import { handleSessionCommand, handleSessionInputReceipt, handleSessionPreparationRetry } from "./session-command-handler.js";
|
|
8
8
|
//#region src/gateway/hono/routes/agent-stream.ts
|
|
9
9
|
init_src();
|
|
10
|
+
init_types();
|
|
10
11
|
function registerAgentStreamRoutes(authenticated, deps) {
|
|
11
12
|
const { service, chatRateLimitMiddleware } = deps;
|
|
12
13
|
authenticated.post("/api/agent/abort", chatRateLimitMiddleware, async (c) => {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DESKTOP_CHAT_MANIFEST } from "../../../../packages/gateway-contract/src/desktop-chat.js";
|
|
2
|
+
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
3
|
+
import { getOrCreateGatewayIdentity } from "../../../storage/sqlite/gateway-identity-repository.js";
|
|
4
|
+
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
5
|
+
//#region src/gateway/hono/routes/desktop-chat.ts
|
|
6
|
+
init_src();
|
|
7
|
+
function registerDesktopChatRoutes(authenticated, { service }) {
|
|
8
|
+
authenticated.get("/api/desktop-chat/bootstrap", (c) => {
|
|
9
|
+
c.header("Cache-Control", "no-store");
|
|
10
|
+
const principal = getGatewayPrincipal(c);
|
|
11
|
+
if (principal.kind !== "owner" || !principal.scopes.includes("gateway.admin") || service.getResolvedAuth().mode !== "token") return c.json({
|
|
12
|
+
ok: false,
|
|
13
|
+
error: { code: "OWNER_TOKEN_REQUIRED" }
|
|
14
|
+
}, 403);
|
|
15
|
+
const { id, publicKey } = getOrCreateGatewayIdentity();
|
|
16
|
+
return c.json({
|
|
17
|
+
ok: true,
|
|
18
|
+
payload: {
|
|
19
|
+
gatewayId: id,
|
|
20
|
+
publicKey,
|
|
21
|
+
manifest: c.req.query("chat") === "1" ? {
|
|
22
|
+
...DESKTOP_CHAT_MANIFEST,
|
|
23
|
+
chat: "text-receipt.v1"
|
|
24
|
+
} : DESKTOP_CHAT_MANIFEST
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { registerDesktopChatRoutes };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Hono } from 'hono';
|
|
2
|
+
import { type PairingPublicRouteOptions } from '../middleware/public-device-rate-limit.js';
|
|
3
|
+
/** Independently signature-authenticated, purpose-limited stop receipt. It cannot mint tokens, grant scopes or review outcomes. */
|
|
4
|
+
export declare function registerDesktopExecutionStopPublicRoutes(app: Hono, options?: PairingPublicRouteOptions & {
|
|
5
|
+
onStopped?(deviceId: string): void;
|
|
6
|
+
}): void;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { signedDesktopExecutionStopSchema } from "../../../../packages/gateway-contract/src/desktop-execution-stop.js";
|
|
2
|
+
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
3
|
+
import { getOrCreateGatewayIdentity, signGatewayPayload } from "../../../storage/sqlite/gateway-identity-repository.js";
|
|
4
|
+
import { recordDesktopExecutionStop } from "../../../storage/sqlite/desktop-execution-stop-repository.js";
|
|
5
|
+
import { publicDeviceRateLimit } from "../middleware/public-device-rate-limit.js";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { bodyLimit } from "hono/body-limit";
|
|
8
|
+
//#region src/gateway/hono/routes/desktop-execution-stop.ts
|
|
9
|
+
init_src();
|
|
10
|
+
/** Independently signature-authenticated, purpose-limited stop receipt. It cannot mint tokens, grant scopes or review outcomes. */
|
|
11
|
+
function registerDesktopExecutionStopPublicRoutes(app, options) {
|
|
12
|
+
const input = z.strictObject({
|
|
13
|
+
signed: signedDesktopExecutionStopSchema,
|
|
14
|
+
nonce: z.string().regex(/^[A-Za-z0-9_-]{32,64}$/)
|
|
15
|
+
});
|
|
16
|
+
app.post("/api/device-auth/execution-stops", publicDeviceRateLimit("execution-stop", options), bodyLimit({
|
|
17
|
+
maxSize: 2048,
|
|
18
|
+
onError: (c) => c.json({
|
|
19
|
+
ok: false,
|
|
20
|
+
error: { code: "BODY_LIMIT" }
|
|
21
|
+
}, 413)
|
|
22
|
+
}), async (c) => {
|
|
23
|
+
c.header("Cache-Control", "no-store");
|
|
24
|
+
const parsed = input.safeParse(await c.req.json().catch(() => null));
|
|
25
|
+
if (!parsed.success) return c.json({
|
|
26
|
+
ok: false,
|
|
27
|
+
error: { code: "BAD_REQUEST" }
|
|
28
|
+
}, 400);
|
|
29
|
+
try {
|
|
30
|
+
const { revokedCurrent, ...result } = recordDesktopExecutionStop(parsed.data.signed);
|
|
31
|
+
if (revokedCurrent) options?.onStopped?.(result.deviceId);
|
|
32
|
+
const signedPayload = Buffer.from(JSON.stringify({
|
|
33
|
+
purpose: "desktop-execution-stop-v1",
|
|
34
|
+
gatewayId: getOrCreateGatewayIdentity().id,
|
|
35
|
+
nonce: parsed.data.nonce,
|
|
36
|
+
issuedAt: Date.now(),
|
|
37
|
+
...result
|
|
38
|
+
})).toString("base64url");
|
|
39
|
+
return c.json({
|
|
40
|
+
signedPayload,
|
|
41
|
+
signature: signGatewayPayload(signedPayload)
|
|
42
|
+
});
|
|
43
|
+
} catch (error) {
|
|
44
|
+
return c.json({
|
|
45
|
+
ok: false,
|
|
46
|
+
error: { code: error instanceof Error && error.message === "DESKTOP_STOP_CONFLICT" ? "DESKTOP_STOP_CONFLICT" : "DESKTOP_STOP_INVALID" }
|
|
47
|
+
}, 403);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { registerDesktopExecutionStopPublicRoutes };
|