@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,79 @@
|
|
|
1
|
+
import { REMOTE_COMPUTER_CONTROL_TOOL } from '@xopcai/computer-control-contract';
|
|
2
|
+
import { REMOTE_BROWSER_CONTROL_TOOL } from '@xopcai/browser-control-contract/remote';
|
|
3
|
+
import { type DesktopOperationReview, type DesktopOperationIntent, type DesktopOperationReceipt } from '@xopcai/endpoint-tools-protocol';
|
|
4
|
+
export interface ReviewedDesktopExecutionScope {
|
|
5
|
+
gatewayId: string;
|
|
6
|
+
deviceId: string;
|
|
7
|
+
authorizationRevision: number;
|
|
8
|
+
tool: typeof REMOTE_COMPUTER_CONTROL_TOOL | typeof REMOTE_BROWSER_CONTROL_TOOL;
|
|
9
|
+
toolRevision: string;
|
|
10
|
+
}
|
|
11
|
+
/** Clear stale admission metadata only after native manual stop verification, never merely after reconnect/revocation. */
|
|
12
|
+
export declare function hasReviewedDesktopExecutionStop(scope: ReviewedDesktopExecutionScope): boolean;
|
|
13
|
+
/** Persist the immutable intent before sending any command that may change the device. */
|
|
14
|
+
export declare function recordDesktopOperationIntent(input: DesktopOperationIntent, grantId: string, now?: number): DesktopOperationIntent;
|
|
15
|
+
/** Accept only terminal evidence for the already-recorded intent; this never authorizes a retry. */
|
|
16
|
+
export declare function recordDesktopOperationReceipt(intent: DesktopOperationIntent, input: DesktopOperationReceipt): void;
|
|
17
|
+
/** Metadata lookup is scoped to the authenticated device and its pinned Gateway identity. */
|
|
18
|
+
export declare function getDesktopOperationIntent(operationId: string, deviceId: string, gatewayId: string): DesktopOperationIntent | undefined;
|
|
19
|
+
export declare function getDesktopOperationReceipt(operationId: string, deviceId: string, gatewayId: string): DesktopOperationReceipt | undefined;
|
|
20
|
+
export declare function listDesktopOperationsForReview(deviceId: string, gatewayId: string): {
|
|
21
|
+
receipt?: {
|
|
22
|
+
operationId: string;
|
|
23
|
+
state: "unknown" | "failed" | "succeeded" | "running" | "recorded" | "cancel-requested" | "stopped";
|
|
24
|
+
updatedAt: number;
|
|
25
|
+
executionStopped: boolean;
|
|
26
|
+
resultHash?: string;
|
|
27
|
+
invocationId?: string;
|
|
28
|
+
connectionInstanceId?: string;
|
|
29
|
+
};
|
|
30
|
+
intent: {
|
|
31
|
+
operationId: string;
|
|
32
|
+
gatewayId: string;
|
|
33
|
+
deviceId: string;
|
|
34
|
+
tool: string;
|
|
35
|
+
argumentHash: string;
|
|
36
|
+
toolRevision: string;
|
|
37
|
+
authorizationRevision: number;
|
|
38
|
+
expiresAt: number;
|
|
39
|
+
workspaceId?: string;
|
|
40
|
+
};
|
|
41
|
+
generation: number;
|
|
42
|
+
}[];
|
|
43
|
+
export declare function reviewDesktopOperation(operationId: string, deviceId: string, gatewayId: string, input: DesktopOperationReview, now?: number): {
|
|
44
|
+
operationId: string;
|
|
45
|
+
reviewed: true;
|
|
46
|
+
outcome: "unknown";
|
|
47
|
+
reviewId: string;
|
|
48
|
+
};
|
|
49
|
+
export declare function getDesktopOperationForReview(operationId: string, deviceId: string, gatewayId: string): {
|
|
50
|
+
review?: {
|
|
51
|
+
reviewId: string;
|
|
52
|
+
expectedGeneration: number;
|
|
53
|
+
intentFingerprint: string;
|
|
54
|
+
executorStopped: true;
|
|
55
|
+
localStatus: "recorded" | "not-found";
|
|
56
|
+
receipt?: {
|
|
57
|
+
operationId: string;
|
|
58
|
+
state: "unknown" | "failed" | "succeeded" | "running" | "recorded" | "cancel-requested" | "stopped";
|
|
59
|
+
updatedAt: number;
|
|
60
|
+
executionStopped: boolean;
|
|
61
|
+
resultHash?: string;
|
|
62
|
+
invocationId?: string;
|
|
63
|
+
connectionInstanceId?: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
intent: {
|
|
67
|
+
operationId: string;
|
|
68
|
+
gatewayId: string;
|
|
69
|
+
deviceId: string;
|
|
70
|
+
tool: string;
|
|
71
|
+
argumentHash: string;
|
|
72
|
+
toolRevision: string;
|
|
73
|
+
authorizationRevision: number;
|
|
74
|
+
expiresAt: number;
|
|
75
|
+
workspaceId?: string;
|
|
76
|
+
};
|
|
77
|
+
state: string;
|
|
78
|
+
generation: number;
|
|
79
|
+
};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "./transaction.js";
|
|
2
|
+
import { getDevice } from "./device-access-repository.js";
|
|
3
|
+
import { desktopOperationIntentSchema, desktopOperationReceiptSchema, desktopOperationReviewSchema } from "../../../packages/endpoint-tools-protocol/src/execution.js";
|
|
4
|
+
import { canonicalJson, init_src } from "../../../packages/endpoint-tools-protocol/src/index.js";
|
|
5
|
+
import { REMOTE_COMPUTER_DESCRIPTOR, init_src as init_src$1 } from "../../../packages/computer-control-contract/src/index.js";
|
|
6
|
+
import { REMOTE_BROWSER_DESCRIPTOR } from "../../../packages/browser-control-contract/src/remote.js";
|
|
7
|
+
import { getDesktopExecutionGrant } from "./desktop-execution-repository.js";
|
|
8
|
+
import { createHash } from "node:crypto";
|
|
9
|
+
//#region src/storage/sqlite/desktop-operation-repository.ts
|
|
10
|
+
init_src$1();
|
|
11
|
+
init_src();
|
|
12
|
+
init_transaction();
|
|
13
|
+
/** Clear stale admission metadata only after native manual stop verification, never merely after reconnect/revocation. */
|
|
14
|
+
function hasReviewedDesktopExecutionStop(scope) {
|
|
15
|
+
if (!["desktop.computer.remote_control", "desktop.browser.control"].includes(scope.tool)) return false;
|
|
16
|
+
const current = getDesktopExecutionGrant(scope.deviceId);
|
|
17
|
+
if (current?.active && current.revision === scope.authorizationRevision) return false;
|
|
18
|
+
const rows = getSqliteDatabase().prepare(`SELECT o.operation_id,o.generation,o.state,o.desktop_intent_json,r.observation_json
|
|
19
|
+
FROM capability_operations o LEFT JOIN desktop_operation_reviews r ON r.operation_id=o.operation_id
|
|
20
|
+
WHERE o.principal_id=? AND o.desktop_intent_json IS NOT NULL AND o.state IN ('running','unknown')
|
|
21
|
+
AND json_extract(o.desktop_intent_json,'$.gatewayId')=? AND json_extract(o.desktop_intent_json,'$.authorizationRevision')=?
|
|
22
|
+
AND json_extract(o.desktop_intent_json,'$.tool')=? AND json_extract(o.desktop_intent_json,'$.toolRevision')=? LIMIT 257`).all(scope.deviceId, scope.gatewayId, scope.authorizationRevision, scope.tool, scope.toolRevision);
|
|
23
|
+
if (rows.length > 256) return false;
|
|
24
|
+
let verified = false;
|
|
25
|
+
for (const row of rows) {
|
|
26
|
+
const intent = desktopOperationIntentSchema.parse(JSON.parse(row.desktop_intent_json));
|
|
27
|
+
if (intent.deviceId !== scope.deviceId || intent.gatewayId !== scope.gatewayId || intent.authorizationRevision !== scope.authorizationRevision || intent.tool !== scope.tool || intent.toolRevision !== scope.toolRevision) continue;
|
|
28
|
+
if (intent.operationId !== row.operation_id || row.state === "running") return false;
|
|
29
|
+
if (row.state !== "unknown") continue;
|
|
30
|
+
if (!row.observation_json) return false;
|
|
31
|
+
const review = desktopOperationReviewSchema.parse(JSON.parse(row.observation_json));
|
|
32
|
+
if (!review.executorStopped || review.expectedGeneration !== row.generation || review.intentFingerprint !== createHash("sha256").update(JSON.stringify(intent)).digest("hex")) return false;
|
|
33
|
+
verified = true;
|
|
34
|
+
}
|
|
35
|
+
return verified;
|
|
36
|
+
}
|
|
37
|
+
/** Persist the immutable intent before sending any command that may change the device. */
|
|
38
|
+
function recordDesktopOperationIntent(input, grantId, now = Date.now()) {
|
|
39
|
+
const intent = desktopOperationIntentSchema.parse(input), json = canonicalJson(intent);
|
|
40
|
+
return runSqliteWriteTransaction((db) => {
|
|
41
|
+
const grant = getDesktopExecutionGrant(intent.deviceId, now);
|
|
42
|
+
const row = db.prepare(`SELECT principal_id, request_digest, descriptor_digest, state, recovery_mode, generation, lease_expires_at, desktop_intent_json
|
|
43
|
+
FROM capability_operations WHERE operation_id=?`).get(intent.operationId);
|
|
44
|
+
if (!grant?.active || grant.grant?.grantId !== grantId || grant.revision !== intent.authorizationRevision || grant.grant.expiresAt < intent.expiresAt || intent.expiresAt <= now || grant.grant.workspaceId !== intent.workspaceId || !row || row.principal_id !== intent.deviceId || row.request_digest !== intent.argumentHash || row.descriptor_digest !== intent.toolRevision || row.generation !== 1 || row.recovery_mode !== "manual" || row.state !== "running" || (row.lease_expires_at ?? 0) <= now || (row.lease_expires_at ?? 0) < intent.expiresAt || row.desktop_intent_json !== null && row.desktop_intent_json !== json) throw new Error("DESKTOP_OPERATION_INTENT_INVALID");
|
|
45
|
+
if (db.prepare(`SELECT 1 FROM capability_operations WHERE principal_id=? AND operation_id<>?
|
|
46
|
+
AND desktop_intent_json IS NOT NULL AND (state='running' OR state='unknown' AND NOT EXISTS
|
|
47
|
+
(SELECT 1 FROM desktop_operation_reviews r WHERE r.operation_id=capability_operations.operation_id)) LIMIT 1`).get(intent.deviceId, intent.operationId)) throw new Error("DESKTOP_OPERATION_RECONCILIATION_REQUIRED");
|
|
48
|
+
db.prepare("UPDATE capability_operations SET desktop_intent_json=? WHERE operation_id=?").run(json, intent.operationId);
|
|
49
|
+
return intent;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/** Accept only terminal evidence for the already-recorded intent; this never authorizes a retry. */
|
|
53
|
+
function recordDesktopOperationReceipt(intent, input) {
|
|
54
|
+
const receipt = desktopOperationReceiptSchema.parse(input);
|
|
55
|
+
if (receipt.operationId !== intent.operationId || ![
|
|
56
|
+
"succeeded",
|
|
57
|
+
"failed",
|
|
58
|
+
"stopped",
|
|
59
|
+
"unknown"
|
|
60
|
+
].includes(receipt.state)) throw new Error("DESKTOP_OPERATION_RECEIPT_INVALID");
|
|
61
|
+
runSqliteWriteTransaction((db) => {
|
|
62
|
+
const row = db.prepare("SELECT desktop_intent_json, desktop_receipt_json FROM capability_operations WHERE operation_id=?").get(intent.operationId);
|
|
63
|
+
const json = canonicalJson(receipt);
|
|
64
|
+
if (row?.desktop_intent_json !== canonicalJson(intent) || row.desktop_receipt_json !== null && row.desktop_receipt_json !== json) throw new Error("DESKTOP_OPERATION_RECEIPT_INVALID");
|
|
65
|
+
db.prepare("UPDATE capability_operations SET desktop_receipt_json=? WHERE operation_id=?").run(json, intent.operationId);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/** Metadata lookup is scoped to the authenticated device and its pinned Gateway identity. */
|
|
69
|
+
function getDesktopOperationIntent(operationId, deviceId, gatewayId) {
|
|
70
|
+
const row = getSqliteDatabase().prepare("SELECT desktop_intent_json FROM capability_operations WHERE operation_id=? AND principal_id=?").get(operationId, deviceId);
|
|
71
|
+
if (!row?.desktop_intent_json) return;
|
|
72
|
+
const intent = desktopOperationIntentSchema.parse(JSON.parse(row.desktop_intent_json));
|
|
73
|
+
return intent.gatewayId === gatewayId && intent.deviceId === deviceId && intent.operationId === operationId ? intent : void 0;
|
|
74
|
+
}
|
|
75
|
+
function getDesktopOperationReceipt(operationId, deviceId, gatewayId) {
|
|
76
|
+
if (!getDesktopOperationIntent(operationId, deviceId, gatewayId)) return;
|
|
77
|
+
const row = getSqliteDatabase().prepare("SELECT desktop_receipt_json FROM capability_operations WHERE operation_id=? AND principal_id=?").get(operationId, deviceId);
|
|
78
|
+
if (!row?.desktop_receipt_json) return;
|
|
79
|
+
const receipt = desktopOperationReceiptSchema.parse(JSON.parse(row.desktop_receipt_json));
|
|
80
|
+
if (receipt.operationId !== operationId) throw new Error("DESKTOP_OPERATION_RECEIPT_INVALID");
|
|
81
|
+
return receipt;
|
|
82
|
+
}
|
|
83
|
+
function listDesktopOperationsForReview(deviceId, gatewayId) {
|
|
84
|
+
return getSqliteDatabase().prepare(`SELECT o.operation_id, o.generation, o.desktop_intent_json, o.desktop_receipt_json
|
|
85
|
+
FROM capability_operations o LEFT JOIN desktop_operation_reviews r ON r.operation_id=o.operation_id
|
|
86
|
+
WHERE o.principal_id=? AND o.state='unknown' AND o.desktop_intent_json IS NOT NULL AND r.operation_id IS NULL
|
|
87
|
+
ORDER BY o.created_at,o.operation_id LIMIT 8`).all(deviceId).map((row) => {
|
|
88
|
+
const intent = desktopOperationIntentSchema.parse(JSON.parse(row.desktop_intent_json));
|
|
89
|
+
if (intent.deviceId !== deviceId || intent.gatewayId !== gatewayId || intent.operationId !== row.operation_id) throw new Error("DESKTOP_OPERATION_IDENTITY_MISMATCH");
|
|
90
|
+
return {
|
|
91
|
+
intent,
|
|
92
|
+
generation: row.generation,
|
|
93
|
+
...row.desktop_receipt_json ? { receipt: desktopOperationReceiptSchema.parse(JSON.parse(row.desktop_receipt_json)) } : {}
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function reviewDesktopOperation(operationId, deviceId, gatewayId, input, now = Date.now()) {
|
|
98
|
+
const review = desktopOperationReviewSchema.parse(input);
|
|
99
|
+
return runSqliteWriteTransaction((db) => {
|
|
100
|
+
const device = getDevice(deviceId);
|
|
101
|
+
if (!device || device.platform !== "desktop" || device.revokedAt !== void 0 || !device.scopes.includes("device.self")) throw new Error("DESKTOP_OPERATION_REVIEW_CONFLICT");
|
|
102
|
+
const intent = getDesktopOperationIntent(operationId, deviceId, gatewayId);
|
|
103
|
+
const row = db.prepare("SELECT state,generation FROM capability_operations WHERE operation_id=? AND principal_id=?").get(operationId, deviceId);
|
|
104
|
+
if (!intent || !row || row.state !== "unknown" || row.generation !== review.expectedGeneration || review.intentFingerprint !== createHash("sha256").update(JSON.stringify(intent)).digest("hex") || review.receipt && review.receipt.operationId !== operationId || review.localStatus === "not-found" && !(intent.tool === "desktop.clipboard.write" || intent.tool === "desktop.computer.remote_control" && !intent.workspaceId && intent.toolRevision === createHash("sha256").update(canonicalJson(REMOTE_COMPUTER_DESCRIPTOR)).digest("hex") || intent.tool === "desktop.browser.control" && !intent.workspaceId && intent.toolRevision === createHash("sha256").update(canonicalJson(REMOTE_BROWSER_DESCRIPTOR)).digest("hex") || [
|
|
105
|
+
"desktop.workspace.write",
|
|
106
|
+
"desktop.command.run",
|
|
107
|
+
"desktop.terminal.open"
|
|
108
|
+
].includes(intent.tool) && intent.workspaceId)) throw new Error("DESKTOP_OPERATION_REVIEW_CONFLICT");
|
|
109
|
+
const json = canonicalJson(review), previous = db.prepare("SELECT review_id,observation_json FROM desktop_operation_reviews WHERE operation_id=?").get(operationId);
|
|
110
|
+
if (previous) {
|
|
111
|
+
if (previous.review_id !== review.reviewId || previous.observation_json !== json) throw new Error("DESKTOP_OPERATION_REVIEW_CONFLICT");
|
|
112
|
+
return {
|
|
113
|
+
operationId,
|
|
114
|
+
reviewed: true,
|
|
115
|
+
outcome: "unknown",
|
|
116
|
+
reviewId: review.reviewId
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
if (db.prepare("SELECT 1 FROM desktop_operation_reviews WHERE review_id=?").get(review.reviewId)) throw new Error("DESKTOP_OPERATION_REVIEW_CONFLICT");
|
|
120
|
+
db.prepare(`INSERT INTO desktop_operation_reviews(operation_id,device_id,review_id,generation,intent_fingerprint,observation_json,created_at)
|
|
121
|
+
VALUES(?,?,?,?,?,?,?)`).run(operationId, deviceId, review.reviewId, row.generation, review.intentFingerprint, json, now);
|
|
122
|
+
return {
|
|
123
|
+
operationId,
|
|
124
|
+
reviewed: true,
|
|
125
|
+
outcome: "unknown",
|
|
126
|
+
reviewId: review.reviewId
|
|
127
|
+
};
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function getDesktopOperationForReview(operationId, deviceId, gatewayId) {
|
|
131
|
+
const intent = getDesktopOperationIntent(operationId, deviceId, gatewayId);
|
|
132
|
+
if (!intent) return;
|
|
133
|
+
const row = getSqliteDatabase().prepare("SELECT state,generation FROM capability_operations WHERE operation_id=?").get(operationId);
|
|
134
|
+
const reviewed = getSqliteDatabase().prepare("SELECT observation_json FROM desktop_operation_reviews WHERE operation_id=? AND device_id=?").get(operationId, deviceId);
|
|
135
|
+
return {
|
|
136
|
+
intent,
|
|
137
|
+
state: row.state,
|
|
138
|
+
generation: row.generation,
|
|
139
|
+
...reviewed ? { review: desktopOperationReviewSchema.parse(JSON.parse(reviewed.observation_json)) } : {}
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
//#endregion
|
|
143
|
+
export { getDesktopOperationForReview, getDesktopOperationIntent, getDesktopOperationReceipt, hasReviewedDesktopExecutionStop, listDesktopOperationsForReview, recordDesktopOperationIntent, recordDesktopOperationReceipt, reviewDesktopOperation };
|
|
@@ -67,3 +67,15 @@ export declare function revokeDevice(deviceId: string, now?: number): boolean;
|
|
|
67
67
|
export declare function isDeviceAccessSessionActive(deviceId: string, sessionId: string, now?: number): boolean;
|
|
68
68
|
/** Changes only phone permissions, preserving all other grants. */
|
|
69
69
|
export declare function setDevicePhoneAccess(deviceId: string, access: 'none' | 'view' | 'control'): DeviceRecord | undefined;
|
|
70
|
+
export declare function getDesktopStateObservation(deviceId: string): {
|
|
71
|
+
deviceId: string;
|
|
72
|
+
stateEnabled: boolean;
|
|
73
|
+
revision: number;
|
|
74
|
+
} | undefined;
|
|
75
|
+
export declare function getDesktopScreenObservation(deviceId: string): {
|
|
76
|
+
deviceId: string;
|
|
77
|
+
screenEnabled: boolean;
|
|
78
|
+
revision: number;
|
|
79
|
+
} | undefined;
|
|
80
|
+
export declare function setDesktopStateObservation(deviceId: string, enabled: boolean, expectedRevision?: number): ReturnType<typeof getDesktopStateObservation>;
|
|
81
|
+
export declare function setDesktopScreenObservation(deviceId: string, enabled: boolean, expectedRevision?: number): ReturnType<typeof getDesktopScreenObservation>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "./transaction.js";
|
|
2
|
-
import { initialDeviceRefreshTokenSchema } from "../../../packages/gateway-contract/src/device-pairing.js";
|
|
2
|
+
import { initialDeviceRefreshTokenSchema, isMobileDevicePlatform } from "../../../packages/gateway-contract/src/device-pairing.js";
|
|
3
3
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
4
4
|
import { buckets } from "../../gateway/rate-limit/buckets.js";
|
|
5
5
|
import "../../gateway/rate-limit/index.js";
|
|
6
6
|
import { parseGatewayScopes } from "../../gateway/security/gateway-scopes.js";
|
|
7
|
+
import { revokeDesktopExecutionRow } from "./desktop-execution-state.js";
|
|
7
8
|
import crypto from "node:crypto";
|
|
8
9
|
//#region src/storage/sqlite/device-access-repository.ts
|
|
9
10
|
init_src();
|
|
@@ -226,7 +227,7 @@ function isDeviceAccessSessionActive(deviceId, sessionId, now = Date.now()) {
|
|
|
226
227
|
function setDevicePhoneAccess(deviceId, access) {
|
|
227
228
|
return runSqliteWriteTransaction((db) => {
|
|
228
229
|
const device = getDevice(deviceId);
|
|
229
|
-
if (!device || device.revokedAt !== void 0 || device.platform
|
|
230
|
+
if (!device || device.revokedAt !== void 0 || !isMobileDevicePlatform(device.platform)) return void 0;
|
|
230
231
|
const scopes = device.scopes.filter((scope) => scope !== "phone.view" && scope !== "phone.control");
|
|
231
232
|
if (access !== "none") scopes.push("phone.view");
|
|
232
233
|
if (access === "control") scopes.push("phone.control");
|
|
@@ -234,5 +235,55 @@ function setDevicePhoneAccess(deviceId, access) {
|
|
|
234
235
|
return getDevice(deviceId);
|
|
235
236
|
});
|
|
236
237
|
}
|
|
238
|
+
function getDesktopStateObservation(deviceId) {
|
|
239
|
+
const device = getDevice(deviceId);
|
|
240
|
+
if (!device || device.revokedAt !== void 0 || device.platform !== "desktop") return;
|
|
241
|
+
const row = getSqliteDatabase().prepare("SELECT revision FROM desktop_observation_grants WHERE device_id = ?").get(deviceId);
|
|
242
|
+
return {
|
|
243
|
+
deviceId,
|
|
244
|
+
stateEnabled: device.scopes.includes("desktop.observe.state"),
|
|
245
|
+
revision: row?.revision ?? 0
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
function getDesktopScreenObservation(deviceId) {
|
|
249
|
+
const base = getDesktopStateObservation(deviceId), device = getDevice(deviceId);
|
|
250
|
+
return base && device ? {
|
|
251
|
+
deviceId,
|
|
252
|
+
screenEnabled: device.scopes.includes("desktop.observe.screen"),
|
|
253
|
+
revision: base.revision
|
|
254
|
+
} : void 0;
|
|
255
|
+
}
|
|
256
|
+
/** Revocation advances the shared version even before an earlier capability grant arrives. */
|
|
257
|
+
function setDesktopObservationScope(deviceId, scope, enabled, expectedRevision) {
|
|
258
|
+
return runSqliteWriteTransaction((db) => {
|
|
259
|
+
const device = getDevice(deviceId), current = getDesktopStateObservation(deviceId);
|
|
260
|
+
if (!device || !current) return void 0;
|
|
261
|
+
if (expectedRevision !== void 0 && current.revision !== expectedRevision) throw new Error("DESKTOP_OBSERVATION_REVISION_CHANGED");
|
|
262
|
+
if (!Number.isSafeInteger(current.revision + 1)) throw new Error("DESKTOP_OBSERVATION_REVISION_LIMIT");
|
|
263
|
+
const scopes = device.scopes.filter((value) => value !== scope && (!enabled || value !== "desktop.execute"));
|
|
264
|
+
if (enabled) revokeDesktopExecutionRow(db, deviceId);
|
|
265
|
+
if (enabled) scopes.push(scope);
|
|
266
|
+
db.prepare("UPDATE devices SET scopes_json = ? WHERE device_id = ?").run(JSON.stringify(scopes), deviceId);
|
|
267
|
+
db.prepare(`INSERT INTO desktop_observation_grants(device_id, revision, updated_at) VALUES (?, ?, ?)
|
|
268
|
+
ON CONFLICT(device_id) DO UPDATE SET revision = excluded.revision, updated_at = excluded.updated_at`).run(deviceId, current.revision + 1, Date.now());
|
|
269
|
+
return current.revision + 1;
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
function setDesktopStateObservation(deviceId, enabled, expectedRevision) {
|
|
273
|
+
const revision = setDesktopObservationScope(deviceId, "desktop.observe.state", enabled, expectedRevision);
|
|
274
|
+
return revision === void 0 ? void 0 : {
|
|
275
|
+
deviceId,
|
|
276
|
+
stateEnabled: enabled,
|
|
277
|
+
revision
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
function setDesktopScreenObservation(deviceId, enabled, expectedRevision) {
|
|
281
|
+
const revision = setDesktopObservationScope(deviceId, "desktop.observe.screen", enabled, expectedRevision);
|
|
282
|
+
return revision === void 0 ? void 0 : {
|
|
283
|
+
deviceId,
|
|
284
|
+
screenEnabled: enabled,
|
|
285
|
+
revision
|
|
286
|
+
};
|
|
287
|
+
}
|
|
237
288
|
//#endregion
|
|
238
|
-
export { DeviceRefreshRateLimitError, authenticateDeviceAccessToken, buildRefreshProofMessage, createDevice, getDevice, isDeviceAccessSessionActive, issueDeviceTokenPair, listDevices, registerInitialDeviceRefreshToken, revokeDevice, rotateDeviceRefreshToken, setDevicePhoneAccess };
|
|
289
|
+
export { DeviceRefreshRateLimitError, authenticateDeviceAccessToken, buildRefreshProofMessage, createDevice, getDesktopScreenObservation, getDesktopStateObservation, getDevice, isDeviceAccessSessionActive, issueDeviceTokenPair, listDevices, registerInitialDeviceRefreshToken, revokeDevice, rotateDeviceRefreshToken, setDesktopScreenObservation, setDesktopStateObservation, setDevicePhoneAccess };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "./transaction.js";
|
|
2
|
-
import { buildDevicePairingProof, devicePairingCompleteSchema, devicePairingDeviceSchema } from "../../../packages/gateway-contract/src/device-pairing.js";
|
|
3
|
-
import { DEFAULT_BROWSER_EXTENSION_SCOPES, DEFAULT_MOBILE_SCOPES } from "../../../packages/gateway-contract/src/gateway-scopes.js";
|
|
2
|
+
import { buildDevicePairingProof, devicePairingCompleteSchema, devicePairingDeviceSchema, isMobileDevicePlatform } from "../../../packages/gateway-contract/src/device-pairing.js";
|
|
3
|
+
import { DEFAULT_BROWSER_EXTENSION_SCOPES, DEFAULT_DESKTOP_SCOPES, DEFAULT_MOBILE_SCOPES } from "../../../packages/gateway-contract/src/gateway-scopes.js";
|
|
4
4
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
5
5
|
import { createDevice, getDevice, registerInitialDeviceRefreshToken, revokeDevice } from "./device-access-repository.js";
|
|
6
6
|
import { getOrCreateGatewayIdentity } from "./gateway-identity-repository.js";
|
|
@@ -23,7 +23,7 @@ const hash = (value) => crypto.createHash("sha256").update(value).digest("hex");
|
|
|
23
23
|
const fail = (code, status) => {
|
|
24
24
|
throw new DevicePairingError(code, status);
|
|
25
25
|
};
|
|
26
|
-
const scopesForPlatform = (platform) => platform === "chrome" ? DEFAULT_BROWSER_EXTENSION_SCOPES : DEFAULT_MOBILE_SCOPES;
|
|
26
|
+
const scopesForPlatform = (platform) => platform === "desktop" ? DEFAULT_DESKTOP_SCOPES : platform === "chrome" ? DEFAULT_BROWSER_EXTENSION_SCOPES : DEFAULT_MOBILE_SCOPES;
|
|
27
27
|
function isTrustedLocalBrowserSetup(setup, deviceJson) {
|
|
28
28
|
const device = devicePairingDeviceSchema.parse(JSON.parse(deviceJson));
|
|
29
29
|
if (device.platform !== "chrome" || device.extensionId !== "gopbfhaojnnhiheiikblejnpgmfmkmgd" || setup.enrollment_issuer !== "browser-native-host" || setup.enrollment_extension_id !== device.extensionId || !setup.enrollment_public_key_thumbprint || browserEnrollmentPublicKeyThumbprint(device.publicKeyJwk) !== setup.enrollment_public_key_thumbprint || !setup.enrollment_nonce) return false;
|
|
@@ -97,7 +97,7 @@ function verifyProof(action, body, deviceJson, now) {
|
|
|
97
97
|
function submitDevicePairingRequest(body, now = Date.now()) {
|
|
98
98
|
const setup = verifiedSetup(String(body.pairingToken), now);
|
|
99
99
|
const device = devicePairingDeviceSchema.parse(body.device);
|
|
100
|
-
if (!(setup.target_kind === "browser" ? device.platform === "chrome" : setup.target_kind === "
|
|
100
|
+
if (!(setup.target_kind === "browser" ? device.platform === "chrome" : setup.target_kind === "desktop" ? device.platform === "desktop" : setup.target_kind === "mobile" && isMobileDevicePlatform(device.platform))) fail("PAIRING_DEVICE_MISMATCH");
|
|
101
101
|
const deviceJson = JSON.stringify(device);
|
|
102
102
|
const autoApprove = isTrustedLocalBrowserSetup(setup, deviceJson);
|
|
103
103
|
verifyProof("request", body, deviceJson, now);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DevicePairingTargetKind } from '@xopcai/gateway-contract';
|
|
2
2
|
export type DeviceRoute = {
|
|
3
3
|
id: string;
|
|
4
|
-
kind: 'xopc-secure-link' | 'tailscale' | 'custom-https' | 'local-browser';
|
|
4
|
+
kind: 'xopc-secure-link' | 'tailscale' | 'custom-https' | 'local-browser' | 'ssh-loopback';
|
|
5
5
|
url: string;
|
|
6
6
|
};
|
|
7
7
|
export type DevicePairingSetup = {
|
|
@@ -11,6 +11,8 @@ export interface EndpointPrincipal {
|
|
|
11
11
|
}
|
|
12
12
|
export declare function createEndpointPrincipal(principal: Omit<EndpointPrincipal, 'createdAt' | 'lastSeenAt' | 'revokedAt'>): EndpointPrincipal;
|
|
13
13
|
export declare function getEndpointPrincipal(id: string): EndpointPrincipal | undefined;
|
|
14
|
+
/** Retains device identity after a connection disappears; an offline device must not become a server-tool fallback. */
|
|
15
|
+
export declare function getBoundEndpointPrincipalId(endpointId: string): string | undefined;
|
|
14
16
|
export declare function listEndpointPrincipals(): EndpointPrincipal[];
|
|
15
17
|
export declare function touchEndpointPrincipal(id: string, seenAt?: number): void;
|
|
16
18
|
export declare function bindEndpointPrincipal(endpointId: string, principalId: string, boundAt?: number): boolean;
|
|
@@ -31,6 +31,10 @@ function getEndpointPrincipal(id) {
|
|
|
31
31
|
const row = getSqliteDatabase().prepare("SELECT * FROM endpoint_principals WHERE id = ?").get(id);
|
|
32
32
|
return row ? fromRow(row) : void 0;
|
|
33
33
|
}
|
|
34
|
+
/** Retains device identity after a connection disappears; an offline device must not become a server-tool fallback. */
|
|
35
|
+
function getBoundEndpointPrincipalId(endpointId) {
|
|
36
|
+
return getSqliteDatabase().prepare("SELECT principal_id FROM endpoint_instance_bindings WHERE endpoint_id = ?").get(endpointId)?.principal_id;
|
|
37
|
+
}
|
|
34
38
|
function listEndpointPrincipals() {
|
|
35
39
|
return getSqliteDatabase().prepare("SELECT * FROM endpoint_principals ORDER BY created_at DESC").all().map(fromRow);
|
|
36
40
|
}
|
|
@@ -52,4 +56,4 @@ function revokeEndpointPrincipal(id, revokedAt = Date.now()) {
|
|
|
52
56
|
return getSqliteDatabase().prepare("UPDATE endpoint_principals SET revoked_at = ? WHERE id = ? AND revoked_at IS NULL").run(revokedAt, id).changes > 0;
|
|
53
57
|
}
|
|
54
58
|
//#endregion
|
|
55
|
-
export { bindEndpointPrincipal, createEndpointPrincipal, getEndpointPrincipal, listEndpointPrincipals, revokeEndpointPrincipal, touchEndpointPrincipal };
|
|
59
|
+
export { bindEndpointPrincipal, createEndpointPrincipal, getBoundEndpointPrincipalId, getEndpointPrincipal, listEndpointPrincipals, revokeEndpointPrincipal, touchEndpointPrincipal };
|
|
@@ -8,6 +8,7 @@ export interface EndpointToolInvocationAudit {
|
|
|
8
8
|
effect: EndpointEffect;
|
|
9
9
|
confirmationRequired: boolean;
|
|
10
10
|
argumentsSha256: string;
|
|
11
|
+
operationId?: string;
|
|
11
12
|
status: 'running' | 'succeeded' | 'failed';
|
|
12
13
|
errorCode?: EndpointToolErrorCode;
|
|
13
14
|
errorMessage?: string;
|
|
@@ -34,6 +35,7 @@ export declare function listEndpointToolInvocationAuditPage(options?: {
|
|
|
34
35
|
pageSize?: number;
|
|
35
36
|
query?: string;
|
|
36
37
|
principalId?: string;
|
|
38
|
+
operationId?: string;
|
|
37
39
|
status?: EndpointToolInvocationAudit['status'];
|
|
38
40
|
effect?: EndpointEffect;
|
|
39
41
|
}): EndpointToolInvocationAuditPage;
|
|
@@ -11,6 +11,7 @@ function fromRow(row) {
|
|
|
11
11
|
effect: row.effect,
|
|
12
12
|
confirmationRequired: row.confirmation_required === 1,
|
|
13
13
|
argumentsSha256: row.arguments_sha256,
|
|
14
|
+
...row.operation_id === null ? {} : { operationId: row.operation_id },
|
|
14
15
|
status: row.status,
|
|
15
16
|
...row.error_code === null ? {} : { errorCode: row.error_code },
|
|
16
17
|
...row.error_message === null ? {} : { errorMessage: row.error_message },
|
|
@@ -22,9 +23,9 @@ function startEndpointToolInvocationAudit(audit) {
|
|
|
22
23
|
getSqliteDatabase().prepare(`
|
|
23
24
|
INSERT INTO endpoint_tool_invocations (
|
|
24
25
|
id, principal_id, endpoint_id, tool_call_id, tool_name, effect,
|
|
25
|
-
confirmation_required, arguments_sha256, status, started_at
|
|
26
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, 'running', ?)
|
|
27
|
-
`).run(audit.id, audit.principalId, audit.endpointId, audit.toolCallId, audit.toolName, audit.effect, audit.confirmationRequired ? 1 : 0, audit.argumentsSha256, audit.startedAt);
|
|
26
|
+
confirmation_required, arguments_sha256, status, started_at, operation_id
|
|
27
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, 'running', ?, ?)
|
|
28
|
+
`).run(audit.id, audit.principalId, audit.endpointId, audit.toolCallId, audit.toolName, audit.effect, audit.confirmationRequired ? 1 : 0, audit.argumentsSha256, audit.startedAt, audit.operationId ?? null);
|
|
28
29
|
}
|
|
29
30
|
function finishEndpointToolInvocationAudit(params) {
|
|
30
31
|
getSqliteDatabase().prepare(`
|
|
@@ -48,6 +49,10 @@ function listEndpointToolInvocationAuditPage(options = {}) {
|
|
|
48
49
|
clauses.push("principal_id = ?");
|
|
49
50
|
values.push(options.principalId);
|
|
50
51
|
}
|
|
52
|
+
if (options.operationId) {
|
|
53
|
+
clauses.push("operation_id = ?");
|
|
54
|
+
values.push(options.operationId);
|
|
55
|
+
}
|
|
51
56
|
if (options.status) {
|
|
52
57
|
clauses.push("status = ?");
|
|
53
58
|
values.push(options.status);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DatabaseSync } from 'node:sqlite';
|
|
2
2
|
export { SCHEMA_META_SCHEMA_VERSION_KEY, readSchemaVersionForTest, readSchemaVersion, setSchemaVersion, ensureSchemaMetaTable } from './schema-version.js';
|
|
3
|
-
export declare const XOPC_DB_SCHEMA_VERSION =
|
|
4
|
-
export declare const XOPC_DB_BASELINE_SCHEMA_VERSION =
|
|
3
|
+
export declare const XOPC_DB_SCHEMA_VERSION = 269;
|
|
4
|
+
export declare const XOPC_DB_BASELINE_SCHEMA_VERSION = 269;
|
|
5
5
|
export { XOPC_DB_MINIMUM_SCHEMA_VERSION } from './schema-upgrade.js';
|
|
6
6
|
/** Initialize fresh databases directly; upgrade supported installed databases transactionally. */
|
|
7
7
|
export declare function ensureXopcDatabaseSchema(db: DatabaseSync): void;
|
|
@@ -14,18 +14,18 @@ function ensureXopcDatabaseSchema(db) {
|
|
|
14
14
|
const hasMetadata = tables.some((row) => row.name === "schema_meta");
|
|
15
15
|
if (!hasMetadata && tables.length) throw new Error("An unversioned database cannot be initialized");
|
|
16
16
|
const version = hasMetadata ? readSchemaVersion(db) : 0;
|
|
17
|
-
if (version >
|
|
17
|
+
if (version > 269) throw new DatabaseSchemaTooNewError(version, 269);
|
|
18
18
|
if (version > 0 && version < 202) throw new DatabaseSchemaTooOldError(version, 202);
|
|
19
|
-
if (version >= 202 && version <
|
|
20
|
-
upgradeXopcDatabase(db, version,
|
|
19
|
+
if (version >= 202 && version < 269) {
|
|
20
|
+
upgradeXopcDatabase(db, version, 269);
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
if (version ===
|
|
23
|
+
if (version === 269) return;
|
|
24
24
|
if (db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name != 'schema_meta' AND name NOT LIKE 'sqlite_%' LIMIT 1").get()) throw new Error("An unversioned database cannot be initialized");
|
|
25
25
|
db.exec("BEGIN IMMEDIATE");
|
|
26
26
|
try {
|
|
27
27
|
db.exec(readSqliteAsset("schema.sql"));
|
|
28
|
-
setSchemaVersion(db,
|
|
28
|
+
setSchemaVersion(db, 269);
|
|
29
29
|
db.exec("COMMIT");
|
|
30
30
|
} catch (error) {
|
|
31
31
|
db.exec("ROLLBACK");
|
|
@@ -40,8 +40,8 @@ var init_schema = __esmMin((() => {
|
|
|
40
40
|
init_schema_version();
|
|
41
41
|
init_schema_errors();
|
|
42
42
|
init_schema_upgrade();
|
|
43
|
-
XOPC_DB_SCHEMA_VERSION =
|
|
44
|
-
XOPC_DB_BASELINE_SCHEMA_VERSION =
|
|
43
|
+
XOPC_DB_SCHEMA_VERSION = 269;
|
|
44
|
+
XOPC_DB_BASELINE_SCHEMA_VERSION = 269;
|
|
45
45
|
}));
|
|
46
46
|
//#endregion
|
|
47
47
|
init_schema();
|
|
@@ -814,7 +814,8 @@ CREATE TABLE endpoint_tool_invocations (
|
|
|
814
814
|
error_code TEXT,
|
|
815
815
|
error_message TEXT,
|
|
816
816
|
started_at INTEGER NOT NULL,
|
|
817
|
-
completed_at INTEGER
|
|
817
|
+
completed_at INTEGER,
|
|
818
|
+
operation_id TEXT
|
|
818
819
|
);
|
|
819
820
|
|
|
820
821
|
CREATE TABLE collaboration_rule_revisions (
|
|
@@ -825,6 +826,31 @@ CREATE TABLE collaboration_rule_revisions (
|
|
|
825
826
|
created_at INTEGER NOT NULL
|
|
826
827
|
);
|
|
827
828
|
|
|
829
|
+
CREATE TABLE desktop_execution_grants (
|
|
830
|
+
device_id TEXT PRIMARY KEY REFERENCES devices(device_id) ON DELETE CASCADE,
|
|
831
|
+
revision INTEGER NOT NULL CHECK (revision > 0),
|
|
832
|
+
grant_id TEXT NOT NULL, approval_id TEXT NOT NULL, grant_json TEXT NOT NULL CHECK (json_valid(grant_json)),
|
|
833
|
+
active INTEGER NOT NULL CHECK (active IN (0, 1)), updated_at INTEGER NOT NULL
|
|
834
|
+
);
|
|
835
|
+
CREATE TABLE desktop_execution_grant_events (
|
|
836
|
+
event_id TEXT PRIMARY KEY, device_id TEXT NOT NULL REFERENCES devices(device_id) ON DELETE CASCADE,
|
|
837
|
+
revision INTEGER NOT NULL, grant_id TEXT NOT NULL, approval_id TEXT NOT NULL,
|
|
838
|
+
action TEXT NOT NULL CHECK (action IN ('granted', 'revoked')), grant_json TEXT NOT NULL CHECK (json_valid(grant_json)), created_at INTEGER NOT NULL
|
|
839
|
+
);
|
|
840
|
+
CREATE UNIQUE INDEX idx_desktop_execution_approval ON desktop_execution_grant_events(device_id, approval_id) WHERE action = 'granted';
|
|
841
|
+
CREATE UNIQUE INDEX idx_desktop_execution_grant ON desktop_execution_grant_events(device_id, grant_id) WHERE action = 'granted';
|
|
842
|
+
|
|
843
|
+
CREATE TABLE desktop_execution_stops (
|
|
844
|
+
device_id TEXT NOT NULL REFERENCES devices(device_id) ON DELETE CASCADE,
|
|
845
|
+
grant_id TEXT NOT NULL,
|
|
846
|
+
authorization_revision INTEGER NOT NULL CHECK (authorization_revision > 0),
|
|
847
|
+
stop_id TEXT NOT NULL UNIQUE,
|
|
848
|
+
receipt_json TEXT NOT NULL CHECK (json_valid(receipt_json)),
|
|
849
|
+
grant_digest TEXT NOT NULL,
|
|
850
|
+
created_at INTEGER NOT NULL,
|
|
851
|
+
PRIMARY KEY (device_id, grant_id, authorization_revision)
|
|
852
|
+
);
|
|
853
|
+
|
|
828
854
|
CREATE TABLE context_evidence (
|
|
829
855
|
evidence_id TEXT PRIMARY KEY,
|
|
830
856
|
principal_id TEXT NOT NULL,
|
|
@@ -1430,7 +1456,7 @@ CREATE TABLE device_pairing_sessions (
|
|
|
1430
1456
|
enrollment_extension_id TEXT,
|
|
1431
1457
|
enrollment_public_key_thumbprint TEXT,
|
|
1432
1458
|
enrollment_nonce TEXT,
|
|
1433
|
-
target_kind TEXT NOT NULL CHECK (target_kind IN ('mobile', 'browser'))
|
|
1459
|
+
target_kind TEXT NOT NULL CHECK (target_kind IN ('mobile', 'browser', 'desktop'))
|
|
1434
1460
|
);
|
|
1435
1461
|
|
|
1436
1462
|
CREATE TABLE device_pairing_requests (
|
|
@@ -1526,7 +1552,7 @@ CREATE VIRTUAL TABLE "transcript_fts" USING fts5(
|
|
|
1526
1552
|
CREATE TABLE "devices" (
|
|
1527
1553
|
device_id TEXT PRIMARY KEY,
|
|
1528
1554
|
display_name TEXT NOT NULL,
|
|
1529
|
-
platform TEXT NOT NULL CHECK (platform IN ('ios', 'android', 'harmonyos', 'chrome')),
|
|
1555
|
+
platform TEXT NOT NULL CHECK (platform IN ('ios', 'android', 'harmonyos', 'chrome', 'desktop')),
|
|
1530
1556
|
extension_id TEXT CHECK (extension_id IS NULL OR length(extension_id) = 32),
|
|
1531
1557
|
public_key_jwk TEXT NOT NULL,
|
|
1532
1558
|
scopes_json TEXT NOT NULL,
|
|
@@ -1551,6 +1577,12 @@ CREATE TABLE "device_push_endpoints" (
|
|
|
1551
1577
|
updated_at INTEGER NOT NULL
|
|
1552
1578
|
);
|
|
1553
1579
|
|
|
1580
|
+
CREATE TABLE desktop_observation_grants (
|
|
1581
|
+
device_id TEXT PRIMARY KEY REFERENCES devices(device_id) ON DELETE CASCADE,
|
|
1582
|
+
revision INTEGER NOT NULL CHECK (revision > 0),
|
|
1583
|
+
updated_at INTEGER NOT NULL
|
|
1584
|
+
);
|
|
1585
|
+
|
|
1554
1586
|
CREATE TABLE connector_objective_accounts (
|
|
1555
1587
|
conversation_id TEXT NOT NULL,
|
|
1556
1588
|
transcript_id TEXT NOT NULL,
|
|
@@ -1642,6 +1674,8 @@ CREATE TABLE capability_operations (
|
|
|
1642
1674
|
created_at INTEGER NOT NULL, state TEXT NOT NULL DEFAULT 'succeeded'
|
|
1643
1675
|
CHECK (state IN ('running', 'succeeded', 'failed', 'unknown')), generation INTEGER NOT NULL DEFAULT 1, recovery_mode TEXT NOT NULL DEFAULT 'atomic'
|
|
1644
1676
|
CHECK (recovery_mode IN ('atomic', 'manual', 'provider-idempotent')), lease_expires_at INTEGER, evidence_json TEXT CHECK (evidence_json IS NULL OR json_valid(evidence_json)),
|
|
1677
|
+
desktop_intent_json TEXT CHECK (desktop_intent_json IS NULL OR json_valid(desktop_intent_json)),
|
|
1678
|
+
desktop_receipt_json TEXT CHECK (desktop_receipt_json IS NULL OR json_valid(desktop_receipt_json)),
|
|
1645
1679
|
UNIQUE(principal_id, capability_id, idempotency_key)
|
|
1646
1680
|
);
|
|
1647
1681
|
|
|
@@ -3100,6 +3134,8 @@ CREATE INDEX idx_connector_learning_jobs_account
|
|
|
3100
3134
|
|
|
3101
3135
|
CREATE INDEX idx_endpoint_tool_invocations_endpoint_started
|
|
3102
3136
|
ON endpoint_tool_invocations(endpoint_id, started_at DESC);
|
|
3137
|
+
CREATE INDEX idx_endpoint_tool_invocations_operation
|
|
3138
|
+
ON endpoint_tool_invocations(operation_id) WHERE operation_id IS NOT NULL;
|
|
3103
3139
|
|
|
3104
3140
|
CREATE UNIQUE INDEX idx_context_evidence_source
|
|
3105
3141
|
ON context_evidence(principal_id, source_type, COALESCE(source_instance_id, ''), source_ref);
|
|
@@ -3658,3 +3694,12 @@ CREATE TABLE session_input_control_operations (
|
|
|
3658
3694
|
run_id TEXT,
|
|
3659
3695
|
PRIMARY KEY (conversation_id, operation_id)
|
|
3660
3696
|
);
|
|
3697
|
+
CREATE TABLE desktop_operation_reviews (
|
|
3698
|
+
operation_id TEXT PRIMARY KEY REFERENCES capability_operations(operation_id) ON DELETE CASCADE,
|
|
3699
|
+
device_id TEXT NOT NULL REFERENCES devices(device_id) ON DELETE CASCADE,
|
|
3700
|
+
review_id TEXT NOT NULL UNIQUE,
|
|
3701
|
+
generation INTEGER NOT NULL CHECK (generation > 0),
|
|
3702
|
+
intent_fingerprint TEXT NOT NULL,
|
|
3703
|
+
observation_json TEXT NOT NULL CHECK (json_valid(observation_json)),
|
|
3704
|
+
created_at INTEGER NOT NULL
|
|
3705
|
+
);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
-- The upgrade runner disables foreign keys before the enclosing transaction,
|
|
2
|
+
-- preserves all dependent rows and validates foreign keys before committing.
|
|
3
|
+
CREATE TABLE devices_desktop_upgrade (
|
|
4
|
+
device_id TEXT PRIMARY KEY,
|
|
5
|
+
display_name TEXT NOT NULL,
|
|
6
|
+
platform TEXT NOT NULL CHECK (platform IN ('ios', 'android', 'harmonyos', 'chrome', 'desktop')),
|
|
7
|
+
extension_id TEXT CHECK (extension_id IS NULL OR length(extension_id) = 32),
|
|
8
|
+
public_key_jwk TEXT NOT NULL,
|
|
9
|
+
scopes_json TEXT NOT NULL,
|
|
10
|
+
created_at INTEGER NOT NULL,
|
|
11
|
+
last_seen_at INTEGER,
|
|
12
|
+
revoked_at INTEGER,
|
|
13
|
+
request_proof_version INTEGER NOT NULL DEFAULT 1,
|
|
14
|
+
CHECK ((platform = 'chrome') = (extension_id IS NOT NULL))
|
|
15
|
+
);
|
|
16
|
+
INSERT INTO devices_desktop_upgrade
|
|
17
|
+
SELECT device_id, display_name, platform, extension_id, public_key_jwk,
|
|
18
|
+
scopes_json, created_at, last_seen_at, revoked_at, request_proof_version FROM devices;
|
|
19
|
+
DROP TABLE devices;
|
|
20
|
+
ALTER TABLE devices_desktop_upgrade RENAME TO devices;
|
|
21
|
+
|
|
22
|
+
CREATE TABLE device_pairing_sessions_desktop_upgrade (
|
|
23
|
+
pairing_id TEXT PRIMARY KEY,
|
|
24
|
+
secret_hash TEXT NOT NULL,
|
|
25
|
+
routes_json TEXT NOT NULL,
|
|
26
|
+
expires_at INTEGER NOT NULL,
|
|
27
|
+
attempts_remaining INTEGER NOT NULL CHECK (attempts_remaining >= 0),
|
|
28
|
+
created_at INTEGER NOT NULL,
|
|
29
|
+
consumed_at INTEGER,
|
|
30
|
+
enrollment_issuer TEXT,
|
|
31
|
+
enrollment_extension_id TEXT,
|
|
32
|
+
enrollment_public_key_thumbprint TEXT,
|
|
33
|
+
enrollment_nonce TEXT,
|
|
34
|
+
target_kind TEXT NOT NULL CHECK (target_kind IN ('mobile', 'browser', 'desktop'))
|
|
35
|
+
);
|
|
36
|
+
INSERT INTO device_pairing_sessions_desktop_upgrade SELECT * FROM device_pairing_sessions;
|
|
37
|
+
DROP TABLE device_pairing_sessions;
|
|
38
|
+
ALTER TABLE device_pairing_sessions_desktop_upgrade RENAME TO device_pairing_sessions;
|
|
39
|
+
CREATE INDEX idx_device_pairing_sessions_expiry ON device_pairing_sessions(expires_at);
|