@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,485 @@
|
|
|
1
|
+
import { DESKTOP_HOST_CAPABILITIES, DESKTOP_HOST_MANIFEST, desktopExecutionGrantSchema, desktopPairingInvitationSchema, desktopSshOriginSchema } from "../../../../packages/gateway-contract/src/desktop-host.js";
|
|
2
|
+
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
3
|
+
import { getDesktopScreenObservation, getDesktopStateObservation, getDevice, setDesktopScreenObservation, setDesktopStateObservation } from "../../../storage/sqlite/device-access-repository.js";
|
|
4
|
+
import { getGatewayIdentityPublicKeyRaw, getOrCreateGatewayIdentity, signGatewayPayload } from "../../../storage/sqlite/gateway-identity-repository.js";
|
|
5
|
+
import { createDevicePairingSetup } from "../../../storage/sqlite/device-pairing-repository.js";
|
|
6
|
+
import { desktopOperationReviewSchema } from "../../../../packages/endpoint-tools-protocol/src/execution.js";
|
|
7
|
+
import { init_src as init_src$1 } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
8
|
+
import { getDesktopExecutionGrant, revokeDesktopExecutionGrant, setDesktopExecutionGrant } from "../../../storage/sqlite/desktop-execution-repository.js";
|
|
9
|
+
import { getDesktopOperationForReview, listDesktopOperationsForReview, reviewDesktopOperation } from "../../../storage/sqlite/desktop-operation-repository.js";
|
|
10
|
+
import { signDesktopAuthorityResponse } from "../../../endpoint-tools/desktop-authority-response.js";
|
|
11
|
+
import { resolveSecureDeviceRoutes } from "../../device-routes.js";
|
|
12
|
+
import { PROOF_HEADER, parseRequestProof } from "../../security/device-request-proof.js";
|
|
13
|
+
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
14
|
+
import { z } from "zod";
|
|
15
|
+
//#region src/gateway/hono/routes/desktop-host.ts
|
|
16
|
+
init_src$1();
|
|
17
|
+
init_src();
|
|
18
|
+
function registerDesktopHostRoutes(app, { service }) {
|
|
19
|
+
const ownExecutionDevice = (actor) => {
|
|
20
|
+
const device = actor.kind === "device" && actor.deviceId ? getDevice(actor.deviceId) : void 0;
|
|
21
|
+
return device?.platform === "desktop" && device.revokedAt === void 0 ? device.id : void 0;
|
|
22
|
+
};
|
|
23
|
+
const revision = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
24
|
+
const executionReply = (c, deviceId, payload) => {
|
|
25
|
+
const proof = parseRequestProof(c.req.header(PROOF_HEADER));
|
|
26
|
+
if (!proof) throw new Error("DESKTOP_AUTHORITY_REQUEST_PROOF_REQUIRED");
|
|
27
|
+
const url = new URL(c.req.url);
|
|
28
|
+
return c.json(signDesktopAuthorityResponse({
|
|
29
|
+
ok: true,
|
|
30
|
+
payload
|
|
31
|
+
}, {
|
|
32
|
+
gatewayId: getOrCreateGatewayIdentity().id,
|
|
33
|
+
deviceId,
|
|
34
|
+
nonce: proof.nonce,
|
|
35
|
+
method: c.req.method,
|
|
36
|
+
target: url.pathname + url.search
|
|
37
|
+
}, 200, signGatewayPayload));
|
|
38
|
+
};
|
|
39
|
+
const executionError = (error) => {
|
|
40
|
+
const code = error instanceof Error ? error.message : "";
|
|
41
|
+
if ([
|
|
42
|
+
"DESKTOP_EXECUTION_REVISION_CHANGED",
|
|
43
|
+
"DESKTOP_EXECUTION_APPROVAL_ALREADY_USED",
|
|
44
|
+
"DESKTOP_EXECUTION_GRANT_LIMIT"
|
|
45
|
+
].includes(code)) return {
|
|
46
|
+
code,
|
|
47
|
+
status: 409
|
|
48
|
+
};
|
|
49
|
+
if (code === "DESKTOP_EXECUTION_GRANT_EXPIRED") return {
|
|
50
|
+
code,
|
|
51
|
+
status: 400
|
|
52
|
+
};
|
|
53
|
+
if (code === "DESKTOP_EXECUTION_DEVICE_INVALID") return {
|
|
54
|
+
code,
|
|
55
|
+
status: 404
|
|
56
|
+
};
|
|
57
|
+
throw error;
|
|
58
|
+
};
|
|
59
|
+
app.get("/api/desktop-host/execution", (c) => {
|
|
60
|
+
c.header("Cache-Control", "no-store");
|
|
61
|
+
const id = ownExecutionDevice(getGatewayPrincipal(c));
|
|
62
|
+
if (!id) return c.json({
|
|
63
|
+
ok: false,
|
|
64
|
+
error: { code: "DESKTOP_DEVICE_REQUIRED" }
|
|
65
|
+
}, 403);
|
|
66
|
+
return executionReply(c, id, getDesktopExecutionGrant(id));
|
|
67
|
+
});
|
|
68
|
+
app.post("/api/desktop-host/execution", async (c) => {
|
|
69
|
+
c.header("Cache-Control", "no-store");
|
|
70
|
+
const id = ownExecutionDevice(getGatewayPrincipal(c));
|
|
71
|
+
if (!id) return c.json({
|
|
72
|
+
ok: false,
|
|
73
|
+
error: { code: "DESKTOP_DEVICE_REQUIRED" }
|
|
74
|
+
}, 403);
|
|
75
|
+
const input = z.strictObject({
|
|
76
|
+
expectedRevision: revision,
|
|
77
|
+
grant: desktopExecutionGrantSchema
|
|
78
|
+
}).safeParse(await c.req.json().catch(() => null));
|
|
79
|
+
if (!input.success) return c.json({
|
|
80
|
+
ok: false,
|
|
81
|
+
error: { code: "BAD_REQUEST" }
|
|
82
|
+
}, 400);
|
|
83
|
+
try {
|
|
84
|
+
const previousRevision = getDesktopExecutionGrant(id)?.revision;
|
|
85
|
+
const payload = setDesktopExecutionGrant(id, input.data.expectedRevision, input.data.grant);
|
|
86
|
+
if (payload.revision !== previousRevision) service.realtime.disconnectPrincipal(id);
|
|
87
|
+
return executionReply(c, id, payload);
|
|
88
|
+
} catch (error) {
|
|
89
|
+
const failure = executionError(error);
|
|
90
|
+
return c.json({
|
|
91
|
+
ok: false,
|
|
92
|
+
error: { code: failure.code }
|
|
93
|
+
}, failure.status);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
const revokeInput = z.strictObject({
|
|
97
|
+
grantId: z.uuid(),
|
|
98
|
+
expectedRevision: revision
|
|
99
|
+
});
|
|
100
|
+
app.delete("/api/desktop-host/execution", async (c) => {
|
|
101
|
+
c.header("Cache-Control", "no-store");
|
|
102
|
+
const id = ownExecutionDevice(getGatewayPrincipal(c));
|
|
103
|
+
if (!id) return c.json({
|
|
104
|
+
ok: false,
|
|
105
|
+
error: { code: "DESKTOP_DEVICE_REQUIRED" }
|
|
106
|
+
}, 403);
|
|
107
|
+
const input = revokeInput.safeParse(await c.req.json().catch(() => null));
|
|
108
|
+
if (!input.success) return c.json({
|
|
109
|
+
ok: false,
|
|
110
|
+
error: { code: "BAD_REQUEST" }
|
|
111
|
+
}, 400);
|
|
112
|
+
try {
|
|
113
|
+
const previousRevision = getDesktopExecutionGrant(id)?.revision;
|
|
114
|
+
const payload = revokeDesktopExecutionGrant(id, input.data.grantId, input.data.expectedRevision);
|
|
115
|
+
if (payload.revision !== previousRevision) service.realtime.disconnectPrincipal(id);
|
|
116
|
+
return executionReply(c, id, payload);
|
|
117
|
+
} catch (error) {
|
|
118
|
+
const failure = executionError(error);
|
|
119
|
+
return c.json({
|
|
120
|
+
ok: false,
|
|
121
|
+
error: { code: failure.code }
|
|
122
|
+
}, failure.status);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
app.get("/api/desktop-host/devices/:deviceId/execution", (c) => {
|
|
126
|
+
c.header("Cache-Control", "no-store");
|
|
127
|
+
if (getGatewayPrincipal(c).kind !== "owner" || service.getResolvedAuth().mode !== "token") return c.json({
|
|
128
|
+
ok: false,
|
|
129
|
+
error: { code: "OWNER_REQUIRED" }
|
|
130
|
+
}, 403);
|
|
131
|
+
const id = z.uuid().safeParse(c.req.param("deviceId"));
|
|
132
|
+
if (!id.success) return c.json({
|
|
133
|
+
ok: false,
|
|
134
|
+
error: { code: "BAD_REQUEST" }
|
|
135
|
+
}, 400);
|
|
136
|
+
const payload = getDesktopExecutionGrant(id.data);
|
|
137
|
+
return payload ? c.json({
|
|
138
|
+
ok: true,
|
|
139
|
+
payload
|
|
140
|
+
}) : c.json({
|
|
141
|
+
ok: false,
|
|
142
|
+
error: { code: "NOT_FOUND" }
|
|
143
|
+
}, 404);
|
|
144
|
+
});
|
|
145
|
+
app.delete("/api/desktop-host/devices/:deviceId/execution", async (c) => {
|
|
146
|
+
c.header("Cache-Control", "no-store");
|
|
147
|
+
if (getGatewayPrincipal(c).kind !== "owner" || service.getResolvedAuth().mode !== "token") return c.json({
|
|
148
|
+
ok: false,
|
|
149
|
+
error: { code: "OWNER_REQUIRED" }
|
|
150
|
+
}, 403);
|
|
151
|
+
const id = z.uuid().safeParse(c.req.param("deviceId")), input = revokeInput.safeParse(await c.req.json().catch(() => null));
|
|
152
|
+
if (!id.success || !input.success) return c.json({
|
|
153
|
+
ok: false,
|
|
154
|
+
error: { code: "BAD_REQUEST" }
|
|
155
|
+
}, 400);
|
|
156
|
+
try {
|
|
157
|
+
const previousRevision = getDesktopExecutionGrant(id.data)?.revision;
|
|
158
|
+
const payload = revokeDesktopExecutionGrant(id.data, input.data.grantId, input.data.expectedRevision);
|
|
159
|
+
if (payload.revision !== previousRevision) service.realtime.disconnectPrincipal(id.data);
|
|
160
|
+
return c.json({
|
|
161
|
+
ok: true,
|
|
162
|
+
payload
|
|
163
|
+
});
|
|
164
|
+
} catch (error) {
|
|
165
|
+
const failure = executionError(error);
|
|
166
|
+
return c.json({
|
|
167
|
+
ok: false,
|
|
168
|
+
error: { code: failure.code }
|
|
169
|
+
}, failure.status);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
app.get("/api/desktop-host/operations", (c) => {
|
|
173
|
+
c.header("Cache-Control", "no-store");
|
|
174
|
+
const id = ownExecutionDevice(getGatewayPrincipal(c));
|
|
175
|
+
if (!id) return c.json({
|
|
176
|
+
ok: false,
|
|
177
|
+
error: { code: "DESKTOP_DEVICE_REQUIRED" }
|
|
178
|
+
}, 403);
|
|
179
|
+
return executionReply(c, id, { items: listDesktopOperationsForReview(id, getOrCreateGatewayIdentity().id) });
|
|
180
|
+
});
|
|
181
|
+
app.get("/api/desktop-host/operations/:operationId", (c) => {
|
|
182
|
+
c.header("Cache-Control", "no-store");
|
|
183
|
+
const id = ownExecutionDevice(getGatewayPrincipal(c)), operationId = z.uuid().safeParse(c.req.param("operationId"));
|
|
184
|
+
if (!id) return c.json({
|
|
185
|
+
ok: false,
|
|
186
|
+
error: { code: "DESKTOP_DEVICE_REQUIRED" }
|
|
187
|
+
}, 403);
|
|
188
|
+
if (!operationId.success) return c.json({
|
|
189
|
+
ok: false,
|
|
190
|
+
error: { code: "BAD_REQUEST" }
|
|
191
|
+
}, 400);
|
|
192
|
+
const payload = getDesktopOperationForReview(operationId.data, id, getOrCreateGatewayIdentity().id);
|
|
193
|
+
return payload ? executionReply(c, id, payload) : c.json({
|
|
194
|
+
ok: false,
|
|
195
|
+
error: { code: "NOT_FOUND" }
|
|
196
|
+
}, 404);
|
|
197
|
+
});
|
|
198
|
+
app.post("/api/desktop-host/operations/:operationId/review", async (c) => {
|
|
199
|
+
c.header("Cache-Control", "no-store");
|
|
200
|
+
const id = ownExecutionDevice(getGatewayPrincipal(c));
|
|
201
|
+
if (!id) return c.json({
|
|
202
|
+
ok: false,
|
|
203
|
+
error: { code: "DESKTOP_DEVICE_REQUIRED" }
|
|
204
|
+
}, 403);
|
|
205
|
+
const operationId = z.uuid().safeParse(c.req.param("operationId")), input = desktopOperationReviewSchema.safeParse(await c.req.json().catch(() => null));
|
|
206
|
+
if (!operationId.success || !input.success) return c.json({
|
|
207
|
+
ok: false,
|
|
208
|
+
error: { code: "BAD_REQUEST" }
|
|
209
|
+
}, 400);
|
|
210
|
+
try {
|
|
211
|
+
return executionReply(c, id, reviewDesktopOperation(operationId.data, id, getOrCreateGatewayIdentity().id, input.data));
|
|
212
|
+
} catch (error) {
|
|
213
|
+
if (error instanceof Error && error.message === "DESKTOP_OPERATION_REVIEW_CONFLICT") return c.json({
|
|
214
|
+
ok: false,
|
|
215
|
+
error: { code: error.message }
|
|
216
|
+
}, 409);
|
|
217
|
+
throw error;
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
app.get("/api/desktop-host/status", (c) => {
|
|
221
|
+
c.header("Cache-Control", "no-store");
|
|
222
|
+
const actor = getGatewayPrincipal(c);
|
|
223
|
+
if (actor.kind !== "device" || !actor.deviceId) return c.json({
|
|
224
|
+
ok: false,
|
|
225
|
+
error: { code: "DEVICE_REQUIRED" }
|
|
226
|
+
}, 403);
|
|
227
|
+
return c.json({
|
|
228
|
+
ok: true,
|
|
229
|
+
payload: {
|
|
230
|
+
deviceId: actor.deviceId,
|
|
231
|
+
endpoints: service.endpointTools.registry.list().filter((endpoint) => endpoint.principalId === actor.deviceId).map((endpoint) => ({
|
|
232
|
+
endpointId: endpoint.endpointId,
|
|
233
|
+
availability: endpoint.availability
|
|
234
|
+
}))
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
const observation = (deviceId, enabled, expectedRevision) => {
|
|
239
|
+
const grant = setDesktopStateObservation(deviceId, enabled, expectedRevision);
|
|
240
|
+
if (!grant) return void 0;
|
|
241
|
+
service.realtime.disconnectPrincipal(deviceId);
|
|
242
|
+
return grant;
|
|
243
|
+
};
|
|
244
|
+
app.get("/api/desktop-host/compatibility", (c) => {
|
|
245
|
+
c.header("Cache-Control", "no-store");
|
|
246
|
+
if (service.getResolvedAuth().mode !== "token") return c.json({
|
|
247
|
+
ok: false,
|
|
248
|
+
error: { code: "OWNER_TOKEN_REQUIRED" }
|
|
249
|
+
}, 403);
|
|
250
|
+
const identity = getOrCreateGatewayIdentity();
|
|
251
|
+
return c.json({
|
|
252
|
+
ok: true,
|
|
253
|
+
payload: {
|
|
254
|
+
gatewayId: identity.id,
|
|
255
|
+
publicKey: identity.publicKey,
|
|
256
|
+
manifest: DESKTOP_HOST_MANIFEST,
|
|
257
|
+
capabilities: DESKTOP_HOST_CAPABILITIES
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
app.post("/api/desktop-host/pairing-setups", async (c) => {
|
|
262
|
+
c.header("Cache-Control", "no-store");
|
|
263
|
+
if (getGatewayPrincipal(c).kind !== "owner" || service.getResolvedAuth().mode !== "token") return c.json({
|
|
264
|
+
ok: false,
|
|
265
|
+
error: { code: "OWNER_REQUIRED" }
|
|
266
|
+
}, 403);
|
|
267
|
+
const input = z.strictObject({ sshOrigin: desktopSshOriginSchema.optional() }).safeParse(await c.req.json().catch(() => null));
|
|
268
|
+
if (!input.success) return c.json({
|
|
269
|
+
ok: false,
|
|
270
|
+
error: { code: "BAD_REQUEST" }
|
|
271
|
+
}, 400);
|
|
272
|
+
const routes = input.data.sshOrigin ? [{
|
|
273
|
+
id: "desktop-ssh",
|
|
274
|
+
kind: "ssh-loopback",
|
|
275
|
+
url: input.data.sshOrigin
|
|
276
|
+
}] : resolveSecureDeviceRoutes(service.currentConfig);
|
|
277
|
+
if (!routes.length) return c.json({
|
|
278
|
+
ok: false,
|
|
279
|
+
error: { code: "NO_SECURE_ROUTE" }
|
|
280
|
+
}, 409);
|
|
281
|
+
const setup = createDevicePairingSetup(routes, Date.now(), { targetKind: "desktop" });
|
|
282
|
+
const identity = getOrCreateGatewayIdentity();
|
|
283
|
+
const invitation = desktopPairingInvitationSchema.parse({
|
|
284
|
+
version: 1,
|
|
285
|
+
targetKind: "desktop",
|
|
286
|
+
pairingToken: setup.token,
|
|
287
|
+
gatewayId: identity.id,
|
|
288
|
+
gatewayPublicKey: getGatewayIdentityPublicKeyRaw(identity),
|
|
289
|
+
routes,
|
|
290
|
+
expiresAt: setup.expiresAt
|
|
291
|
+
});
|
|
292
|
+
return c.json({
|
|
293
|
+
ok: true,
|
|
294
|
+
payload: {
|
|
295
|
+
setupId: setup.id,
|
|
296
|
+
invitation
|
|
297
|
+
}
|
|
298
|
+
}, 201);
|
|
299
|
+
});
|
|
300
|
+
app.get("/api/desktop-host/devices/:id/observation", (c) => {
|
|
301
|
+
c.header("Cache-Control", "no-store");
|
|
302
|
+
if (getGatewayPrincipal(c).kind !== "owner" || service.getResolvedAuth().mode !== "token") return c.json({
|
|
303
|
+
ok: false,
|
|
304
|
+
error: { code: "OWNER_REQUIRED" }
|
|
305
|
+
}, 403);
|
|
306
|
+
const id = z.uuid().safeParse(c.req.param("id"));
|
|
307
|
+
if (!id.success) return c.json({
|
|
308
|
+
ok: false,
|
|
309
|
+
error: { code: "BAD_REQUEST" }
|
|
310
|
+
}, 400);
|
|
311
|
+
const payload = getDesktopStateObservation(id.data);
|
|
312
|
+
return payload ? c.json({
|
|
313
|
+
ok: true,
|
|
314
|
+
payload
|
|
315
|
+
}) : c.json({
|
|
316
|
+
ok: false,
|
|
317
|
+
error: { code: "DESKTOP_NOT_FOUND" }
|
|
318
|
+
}, 404);
|
|
319
|
+
});
|
|
320
|
+
app.post("/api/desktop-host/devices/:id/observation", async (c) => {
|
|
321
|
+
c.header("Cache-Control", "no-store");
|
|
322
|
+
if (getGatewayPrincipal(c).kind !== "owner" || service.getResolvedAuth().mode !== "token") return c.json({
|
|
323
|
+
ok: false,
|
|
324
|
+
error: { code: "OWNER_REQUIRED" }
|
|
325
|
+
}, 403);
|
|
326
|
+
const id = z.uuid().safeParse(c.req.param("id"));
|
|
327
|
+
const input = z.strictObject({
|
|
328
|
+
state: z.boolean(),
|
|
329
|
+
expectedRevision: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER)
|
|
330
|
+
}).safeParse(await c.req.json().catch(() => null));
|
|
331
|
+
if (!id.success || !input.success) return c.json({
|
|
332
|
+
ok: false,
|
|
333
|
+
error: { code: "BAD_REQUEST" }
|
|
334
|
+
}, 400);
|
|
335
|
+
try {
|
|
336
|
+
const payload = observation(id.data, input.data.state, input.data.expectedRevision);
|
|
337
|
+
return payload ? c.json({
|
|
338
|
+
ok: true,
|
|
339
|
+
payload
|
|
340
|
+
}) : c.json({
|
|
341
|
+
ok: false,
|
|
342
|
+
error: { code: "DESKTOP_NOT_FOUND" }
|
|
343
|
+
}, 404);
|
|
344
|
+
} catch (error) {
|
|
345
|
+
if (error instanceof Error && error.message === "DESKTOP_OBSERVATION_REVISION_CHANGED") return c.json({
|
|
346
|
+
ok: false,
|
|
347
|
+
error: { code: error.message }
|
|
348
|
+
}, 409);
|
|
349
|
+
throw error;
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
const cleanupInput = async (request) => {
|
|
353
|
+
const schema = z.strictObject({ expectedRevision: revision.optional() });
|
|
354
|
+
try {
|
|
355
|
+
const text = await request.text();
|
|
356
|
+
return schema.safeParse(text ? JSON.parse(text) : {});
|
|
357
|
+
} catch {
|
|
358
|
+
return schema.safeParse(null);
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
app.delete("/api/desktop-host/observation", async (c) => {
|
|
362
|
+
c.header("Cache-Control", "no-store");
|
|
363
|
+
const actor = getGatewayPrincipal(c);
|
|
364
|
+
if (actor.kind !== "device" || !actor.deviceId) return c.json({
|
|
365
|
+
ok: false,
|
|
366
|
+
error: { code: "DEVICE_REQUIRED" }
|
|
367
|
+
}, 403);
|
|
368
|
+
const input = await cleanupInput(c.req);
|
|
369
|
+
if (!input.success) return c.json({
|
|
370
|
+
ok: false,
|
|
371
|
+
error: { code: "BAD_REQUEST" }
|
|
372
|
+
}, 400);
|
|
373
|
+
const previous = getDesktopStateObservation(actor.deviceId);
|
|
374
|
+
if (previous?.stateEnabled === false && getDesktopExecutionGrant(actor.deviceId)?.enabled) return c.json({
|
|
375
|
+
ok: true,
|
|
376
|
+
payload: previous
|
|
377
|
+
});
|
|
378
|
+
try {
|
|
379
|
+
const payload = observation(actor.deviceId, false, input.data.expectedRevision);
|
|
380
|
+
return payload ? c.json({
|
|
381
|
+
ok: true,
|
|
382
|
+
payload
|
|
383
|
+
}) : c.json({
|
|
384
|
+
ok: false,
|
|
385
|
+
error: { code: "DESKTOP_NOT_FOUND" }
|
|
386
|
+
}, 404);
|
|
387
|
+
} catch (error) {
|
|
388
|
+
if (error instanceof Error && error.message === "DESKTOP_OBSERVATION_REVISION_CHANGED") return c.json({
|
|
389
|
+
ok: false,
|
|
390
|
+
error: { code: error.message }
|
|
391
|
+
}, 409);
|
|
392
|
+
throw error;
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
app.get("/api/desktop-host/devices/:id/screen", (c) => {
|
|
396
|
+
c.header("Cache-Control", "no-store");
|
|
397
|
+
if (getGatewayPrincipal(c).kind !== "owner" || service.getResolvedAuth().mode !== "token") return c.json({
|
|
398
|
+
ok: false,
|
|
399
|
+
error: { code: "OWNER_REQUIRED" }
|
|
400
|
+
}, 403);
|
|
401
|
+
const id = z.uuid().safeParse(c.req.param("id"));
|
|
402
|
+
if (!id.success) return c.json({
|
|
403
|
+
ok: false,
|
|
404
|
+
error: { code: "BAD_REQUEST" }
|
|
405
|
+
}, 400);
|
|
406
|
+
const payload = getDesktopScreenObservation(id.data);
|
|
407
|
+
return payload ? c.json({
|
|
408
|
+
ok: true,
|
|
409
|
+
payload
|
|
410
|
+
}) : c.json({
|
|
411
|
+
ok: false,
|
|
412
|
+
error: { code: "DESKTOP_NOT_FOUND" }
|
|
413
|
+
}, 404);
|
|
414
|
+
});
|
|
415
|
+
app.post("/api/desktop-host/devices/:id/screen", async (c) => {
|
|
416
|
+
c.header("Cache-Control", "no-store");
|
|
417
|
+
if (getGatewayPrincipal(c).kind !== "owner" || service.getResolvedAuth().mode !== "token") return c.json({
|
|
418
|
+
ok: false,
|
|
419
|
+
error: { code: "OWNER_REQUIRED" }
|
|
420
|
+
}, 403);
|
|
421
|
+
const id = z.uuid().safeParse(c.req.param("id"));
|
|
422
|
+
const input = z.strictObject({
|
|
423
|
+
screen: z.boolean(),
|
|
424
|
+
expectedRevision: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER)
|
|
425
|
+
}).safeParse(await c.req.json().catch(() => null));
|
|
426
|
+
if (!id.success || !input.success) return c.json({
|
|
427
|
+
ok: false,
|
|
428
|
+
error: { code: "BAD_REQUEST" }
|
|
429
|
+
}, 400);
|
|
430
|
+
try {
|
|
431
|
+
const payload = setDesktopScreenObservation(id.data, input.data.screen, input.data.expectedRevision);
|
|
432
|
+
if (payload) service.realtime.disconnectPrincipal(id.data);
|
|
433
|
+
return payload ? c.json({
|
|
434
|
+
ok: true,
|
|
435
|
+
payload
|
|
436
|
+
}) : c.json({
|
|
437
|
+
ok: false,
|
|
438
|
+
error: { code: "DESKTOP_NOT_FOUND" }
|
|
439
|
+
}, 404);
|
|
440
|
+
} catch (error) {
|
|
441
|
+
if (error instanceof Error && error.message === "DESKTOP_OBSERVATION_REVISION_CHANGED") return c.json({
|
|
442
|
+
ok: false,
|
|
443
|
+
error: { code: error.message }
|
|
444
|
+
}, 409);
|
|
445
|
+
throw error;
|
|
446
|
+
}
|
|
447
|
+
});
|
|
448
|
+
app.delete("/api/desktop-host/screen", async (c) => {
|
|
449
|
+
c.header("Cache-Control", "no-store");
|
|
450
|
+
const actor = getGatewayPrincipal(c);
|
|
451
|
+
if (actor.kind !== "device" || !actor.deviceId) return c.json({
|
|
452
|
+
ok: false,
|
|
453
|
+
error: { code: "DEVICE_REQUIRED" }
|
|
454
|
+
}, 403);
|
|
455
|
+
const input = await cleanupInput(c.req);
|
|
456
|
+
if (!input.success) return c.json({
|
|
457
|
+
ok: false,
|
|
458
|
+
error: { code: "BAD_REQUEST" }
|
|
459
|
+
}, 400);
|
|
460
|
+
const previous = getDesktopScreenObservation(actor.deviceId);
|
|
461
|
+
if (previous?.screenEnabled === false && getDesktopExecutionGrant(actor.deviceId)?.enabled) return c.json({
|
|
462
|
+
ok: true,
|
|
463
|
+
payload: previous
|
|
464
|
+
});
|
|
465
|
+
try {
|
|
466
|
+
const payload = setDesktopScreenObservation(actor.deviceId, false, input.data.expectedRevision);
|
|
467
|
+
if (payload) service.realtime.disconnectPrincipal(actor.deviceId);
|
|
468
|
+
return payload ? c.json({
|
|
469
|
+
ok: true,
|
|
470
|
+
payload
|
|
471
|
+
}) : c.json({
|
|
472
|
+
ok: false,
|
|
473
|
+
error: { code: "DESKTOP_NOT_FOUND" }
|
|
474
|
+
}, 404);
|
|
475
|
+
} catch (error) {
|
|
476
|
+
if (error instanceof Error && error.message === "DESKTOP_OBSERVATION_REVISION_CHANGED") return c.json({
|
|
477
|
+
ok: false,
|
|
478
|
+
error: { code: error.message }
|
|
479
|
+
}, 409);
|
|
480
|
+
throw error;
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
//#endregion
|
|
485
|
+
export { registerDesktopHostRoutes };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Hono } from 'hono';
|
|
2
2
|
import type { AuthenticatedRouteDeps } from './deps.js';
|
|
3
3
|
import { type PairingPublicRouteOptions } from './device-pairing-approval.js';
|
|
4
|
-
export declare function registerDeviceAuthPublicRoutes(app: Hono, options?: PairingPublicRouteOptions
|
|
4
|
+
export declare function registerDeviceAuthPublicRoutes(app: Hono, options?: PairingPublicRouteOptions & {
|
|
5
|
+
onDesktopExecutionStopped?(deviceId: string): void;
|
|
6
|
+
}): void;
|
|
5
7
|
export declare function registerDeviceRoutes(authenticated: Hono, deps: AuthenticatedRouteDeps): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { browserPairingInvitationPayloadSchema,
|
|
1
|
+
import { browserPairingInvitationPayloadSchema, formatBrowserPairingInvitation, formatMobilePairingInvitation } from "../../../../packages/gateway-contract/src/device-pairing.js";
|
|
2
2
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
3
3
|
import { buckets } from "../../rate-limit/buckets.js";
|
|
4
4
|
import "../../rate-limit/index.js";
|
|
@@ -8,6 +8,7 @@ import { createDevicePairingSetup, isDevicePairingSetupActive } from "../../../s
|
|
|
8
8
|
import { resolveSecureDeviceRoutes } from "../../device-routes.js";
|
|
9
9
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
10
10
|
import { pairingClientKey, publicDeviceRateLimit } from "../middleware/public-device-rate-limit.js";
|
|
11
|
+
import { registerDesktopExecutionStopPublicRoutes } from "./desktop-execution-stop.js";
|
|
11
12
|
import { registerPairingApprovalAdminRoutes, registerPairingApprovalPublicRoutes } from "./device-pairing-approval.js";
|
|
12
13
|
import os from "node:os";
|
|
13
14
|
import { z } from "zod";
|
|
@@ -24,8 +25,12 @@ const refreshRequestSchema = z.strictObject({
|
|
|
24
25
|
requestProofVersion: z.literal(1)
|
|
25
26
|
});
|
|
26
27
|
const pairingProbeSchema = z.strictObject({ pairingId: z.string().uuid() });
|
|
27
|
-
const pairingSetupSchema = z.strictObject({ targetKind:
|
|
28
|
+
const pairingSetupSchema = z.strictObject({ targetKind: z.enum(["mobile", "browser"]) });
|
|
28
29
|
function registerDeviceAuthPublicRoutes(app, options) {
|
|
30
|
+
registerDesktopExecutionStopPublicRoutes(app, {
|
|
31
|
+
...options,
|
|
32
|
+
onStopped: options?.onDesktopExecutionStopped
|
|
33
|
+
});
|
|
29
34
|
app.post("/api/gateway-identity/challenge", publicDeviceRateLimit("challenge", options), bodyLimit({ maxSize: 512 }), async (c) => {
|
|
30
35
|
const budget = buckets.identityChallenge().consume("gateway");
|
|
31
36
|
if (!budget.allowed) {
|
|
@@ -6,7 +6,9 @@ import { createEndpointPrincipal, getEndpointPrincipal, listEndpointPrincipals,
|
|
|
6
6
|
import { listEndpointToolInvocationAuditPage } from "../../../storage/sqlite/endpoint-tool-invocation-repository.js";
|
|
7
7
|
import "../../../storage/sqlite/index.js";
|
|
8
8
|
import { getEndpointDeviceSettings, renameEndpointDevice } from "../../../storage/sqlite/endpoint-device-settings-repository.js";
|
|
9
|
+
import { getDesktopExecutionGrant } from "../../../storage/sqlite/desktop-execution-repository.js";
|
|
9
10
|
import { parseEndpointPublicKey } from "../../../endpoint-tools/auth.js";
|
|
11
|
+
import { desktopDeviceEndpointKey } from "../../../endpoint-tools/desktop-observation.js";
|
|
10
12
|
import { ENDPOINT_UPLOAD_MAX_BYTES, EndpointUploadError } from "../../../endpoint-tools/upload-service.js";
|
|
11
13
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
12
14
|
import { z } from "zod";
|
|
@@ -64,7 +66,7 @@ function registerEndpointToolRoutes(authenticated, deps) {
|
|
|
64
66
|
id,
|
|
65
67
|
displayName: settings?.nickname ?? principal?.displayName ?? access?.displayName ?? id,
|
|
66
68
|
settingsRevision: settings?.revision ?? 0,
|
|
67
|
-
kind: principal?.kind ?? (access?.platform === "chrome" ? "browser" : "mobile"),
|
|
69
|
+
kind: principal?.kind ?? (access?.platform === "chrome" ? "browser" : access?.platform === "desktop" ? "desktop" : "mobile"),
|
|
68
70
|
platform: principal?.platform ?? access?.platform ?? "unknown",
|
|
69
71
|
createdAt: Math.min(access?.createdAt ?? Number.POSITIVE_INFINITY, principal?.createdAt ?? Number.POSITIVE_INFINITY),
|
|
70
72
|
...lastSeenAt ? { lastSeenAt } : {},
|
|
@@ -135,7 +137,7 @@ function registerEndpointToolRoutes(authenticated, deps) {
|
|
|
135
137
|
if (gatewayPrincipal.kind === "device") {
|
|
136
138
|
const device = gatewayPrincipal.deviceId ? getDevice(gatewayPrincipal.deviceId) : void 0;
|
|
137
139
|
const ownsPrincipal = parsed.data.principalId === gatewayPrincipal.deviceId;
|
|
138
|
-
const compatibleKind = device?.platform === "chrome" ? parsed.data.kind === "browser" && parsed.data.platform === "chrome" : parsed.data.kind === "mobile";
|
|
140
|
+
const compatibleKind = device?.platform === "chrome" ? parsed.data.kind === "browser" && parsed.data.platform === "chrome" : device?.platform === "desktop" ? parsed.data.kind === "desktop" && parsed.data.platform === "desktop" && (device.scopes.includes("desktop.observe.state") || device.scopes.includes("desktop.observe.screen") || device.scopes.includes("desktop.execute") && getDesktopExecutionGrant(device.id)?.active) && parsed.data.publicKey === desktopDeviceEndpointKey(device) : parsed.data.kind === "mobile";
|
|
139
141
|
if (!ownsPrincipal || !compatibleKind) return c.json({
|
|
140
142
|
ok: false,
|
|
141
143
|
error: {
|
|
@@ -193,6 +195,15 @@ function registerEndpointToolRoutes(authenticated, deps) {
|
|
|
193
195
|
const pageSize = Number(c.req.query("pageSize") ?? 20);
|
|
194
196
|
const status = c.req.query("status");
|
|
195
197
|
const effect = c.req.query("effect");
|
|
198
|
+
const operationId = c.req.query("operationId");
|
|
199
|
+
const actor = getGatewayPrincipal(c), requestedPrincipalId = c.req.query("principalId");
|
|
200
|
+
if (actor.kind === "device" && (!actor.deviceId || requestedPrincipalId !== void 0 && requestedPrincipalId !== actor.deviceId)) return c.json({
|
|
201
|
+
ok: false,
|
|
202
|
+
error: {
|
|
203
|
+
code: "FORBIDDEN",
|
|
204
|
+
message: "Device audit belongs to another principal"
|
|
205
|
+
}
|
|
206
|
+
}, 403);
|
|
196
207
|
if (!Number.isInteger(page) || page < 1 || !Number.isInteger(pageSize) || pageSize < 1 || pageSize > 100 || status && ![
|
|
197
208
|
"running",
|
|
198
209
|
"succeeded",
|
|
@@ -201,7 +212,7 @@ function registerEndpointToolRoutes(authenticated, deps) {
|
|
|
201
212
|
"read",
|
|
202
213
|
"write",
|
|
203
214
|
"destructive"
|
|
204
|
-
].includes(effect)) return c.json({
|
|
215
|
+
].includes(effect) || operationId !== void 0 && !z.uuid().safeParse(operationId).success) return c.json({
|
|
205
216
|
ok: false,
|
|
206
217
|
error: {
|
|
207
218
|
code: "BAD_REQUEST",
|
|
@@ -214,7 +225,8 @@ function registerEndpointToolRoutes(authenticated, deps) {
|
|
|
214
225
|
page,
|
|
215
226
|
pageSize,
|
|
216
227
|
query: c.req.query("query"),
|
|
217
|
-
principalId:
|
|
228
|
+
principalId: actor.kind === "device" ? actor.deviceId : requestedPrincipalId,
|
|
229
|
+
operationId,
|
|
218
230
|
status,
|
|
219
231
|
effect
|
|
220
232
|
})
|
|
@@ -3,6 +3,14 @@ function startsWithAny(path, prefixes) {
|
|
|
3
3
|
return prefixes.some((prefix) => path === prefix || path.startsWith(`${prefix}/`));
|
|
4
4
|
}
|
|
5
5
|
const AUTHENTICATED_LAZY_ROUTE_BUNDLES = [
|
|
6
|
+
{
|
|
7
|
+
id: "desktop-chat",
|
|
8
|
+
match: (path) => path === "/api/desktop-chat/bootstrap",
|
|
9
|
+
load: async () => {
|
|
10
|
+
const { registerDesktopChatRoutes } = await import("./desktop-chat.js");
|
|
11
|
+
return { register: registerDesktopChatRoutes };
|
|
12
|
+
}
|
|
13
|
+
},
|
|
6
14
|
{
|
|
7
15
|
id: "location-sharing",
|
|
8
16
|
match: (path) => /^\/api\/user-context\/environment\/location-shares(?:\/[^/]+(?:\/samples)?)?$/.test(path),
|
|
@@ -75,6 +83,19 @@ const AUTHENTICATED_LAZY_ROUTE_BUNDLES = [
|
|
|
75
83
|
return { register: registerCapabilityOperationRoutes };
|
|
76
84
|
}
|
|
77
85
|
},
|
|
86
|
+
{
|
|
87
|
+
id: "desktop-host",
|
|
88
|
+
match: (path) => path === "/api/desktop-host/compatibility" || path === "/api/desktop-host/pairing-setups" || path === "/api/desktop-host/status" || [
|
|
89
|
+
"/api/desktop-host/observation",
|
|
90
|
+
"/api/desktop-host/screen",
|
|
91
|
+
"/api/desktop-host/execution",
|
|
92
|
+
"/api/desktop-host/operations"
|
|
93
|
+
].includes(path) || /^\/api\/desktop-host\/operations\/[^/]+(?:\/review)?$/.test(path) || /^\/api\/desktop-host\/devices\/[^/]+\/(?:observation|screen|execution)$/.test(path),
|
|
94
|
+
load: async () => {
|
|
95
|
+
const { registerDesktopHostRoutes } = await import("./desktop-host.js");
|
|
96
|
+
return { register: registerDesktopHostRoutes };
|
|
97
|
+
}
|
|
98
|
+
},
|
|
78
99
|
{
|
|
79
100
|
id: "device-authorizations",
|
|
80
101
|
match: (path) => /^\/api\/endpoint-tools\/target-authorizations(?:\/[^/]+)?$/.test(path),
|
|
@@ -754,13 +754,16 @@ function registerModelsRoutes(authenticated, deps) {
|
|
|
754
754
|
authenticated.get("/api/providers/meta", async (c) => {
|
|
755
755
|
const providers = sortProvidersForPicker([...new Set([...getAllProviders(), ...getDomesticProviderPresetIds()])]);
|
|
756
756
|
const pluginRegistry = getProviderRegistry();
|
|
757
|
+
const modelCounts = /* @__PURE__ */ new Map();
|
|
758
|
+
for (const model of getAllModels()) modelCounts.set(model.provider, (modelCounts.get(model.provider) ?? 0) + 1);
|
|
759
|
+
const featuredProviders = new Set(getOnboardingFeaturedProviders());
|
|
757
760
|
const meta = await Promise.all(providers.map(async (provider) => {
|
|
758
761
|
const plugin = pluginRegistry.get(provider);
|
|
759
762
|
const domesticPreset = getDomesticProviderPreset(provider);
|
|
760
763
|
const extensionId = plugin ? resolveExtensionIdForProvider(service, provider) : void 0;
|
|
761
764
|
const authState = await getProviderAuthState(provider);
|
|
762
765
|
const configured = authState.authMode !== "none" || await isProviderConfigured(provider);
|
|
763
|
-
const registryModelCount =
|
|
766
|
+
const registryModelCount = modelCounts.get(provider) ?? 0;
|
|
764
767
|
return {
|
|
765
768
|
id: provider,
|
|
766
769
|
setupProfile: getProviderSetupProfile(provider, PROVIDER_META[provider]?.name ?? domesticPreset?.displayName ?? provider, PROVIDER_META[provider]?.supportsOAuth, resolveProviderApiBaseUrl(provider)),
|
|
@@ -769,7 +772,7 @@ function registerModelsRoutes(authenticated, deps) {
|
|
|
769
772
|
supportsOAuth: plugin ? false : PROVIDER_META[provider]?.supportsOAuth ?? false,
|
|
770
773
|
supportsApiKey: plugin ? false : PROVIDER_META[provider]?.supportsApiKey ?? true,
|
|
771
774
|
configured,
|
|
772
|
-
onboardingFeatured:
|
|
775
|
+
onboardingFeatured: featuredProviders.has(provider),
|
|
773
776
|
recommendedModels: getRecommendedModelsForProvider(provider),
|
|
774
777
|
modelCount: registryModelCount || domesticPreset?.models.length || 0,
|
|
775
778
|
...getProviderHint(provider) ? { hint: getProviderHint(provider) } : {},
|
|
@@ -6,10 +6,10 @@ import { parseUserTurnDocument, userTurnDocumentRefIds } from "../../../../packa
|
|
|
6
6
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
7
7
|
import { SessionInputControlConflict, init_session_input_control_repository } from "../../../storage/sqlite/session-input-control-repository.js";
|
|
8
8
|
import { endpointTurnClaimSchema, init_src as init_src$1 } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
9
|
+
import { init_types, parseTurnContextRefs } from "../../../agent/source-context/types.js";
|
|
9
10
|
import { init_providers, resolveModel } from "../../../providers/index.js";
|
|
10
11
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
11
12
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
12
|
-
import { parseTurnContextRefs } from "../../../agent/source-context/types.js";
|
|
13
13
|
import { getModelThinking } from "../../../providers/model-thinking.js";
|
|
14
14
|
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
15
15
|
import { isTaskDestructiveCommand } from "../../../session/reset-triggers.js";
|
|
@@ -26,6 +26,7 @@ init_session_input_control_repository();
|
|
|
26
26
|
init_src();
|
|
27
27
|
init_src$1();
|
|
28
28
|
init_providers();
|
|
29
|
+
init_types();
|
|
29
30
|
init_logger();
|
|
30
31
|
const MAX_TURN_CONTEXTS = 5;
|
|
31
32
|
const log = createLogger("Gateway:SessionInput");
|