@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.
Files changed (326) hide show
  1. package/dist/browser-ext/dist/assets/{page-context-b-rB5vJC.js → page-context-DngcqfGf.js} +130 -9
  2. package/dist/browser-ext/dist/background.js +9 -1
  3. package/dist/browser-ext/dist/sidepanel.html +1 -1
  4. package/dist/browser-ext/dist/sidepanel.js +1 -1
  5. package/dist/browser-ext/manifest.json +1 -1
  6. package/dist/extensions/telegram/xopc.extension.json +1 -1
  7. package/dist/gateway/static/root/assets/{activity-store-Cwn_CNwl.js → activity-store-Fl327RND.js} +1 -1
  8. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Cd23LnJJ.js → agent-avatar-dicebear-DL_MfWA8.js} +1 -1
  9. package/dist/gateway/static/root/assets/{agent-avatar-display-ByzM7u9S.js → agent-avatar-display-BTDt883i.js} +2 -2
  10. package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-B0i37diS.js → agent-defaults-settings-panel-CuiIuR1Q.js} +1 -1
  11. package/dist/gateway/static/root/assets/{agent-plugin-dialog-XN-tZ-Ox.js → agent-plugin-dialog-moOAOJPs.js} +1 -1
  12. package/dist/gateway/static/root/assets/{agents-ZDA1OaLv.js → agents-B1yM1cWS.js} +3 -3
  13. package/dist/gateway/static/root/assets/{agents-admin-api-B5lKH_ps.js → agents-admin-api-D6pZX7nW.js} +1 -1
  14. package/dist/gateway/static/root/assets/{api-B9fZL-V8.js → api-H3OfSCEz.js} +1 -1
  15. package/dist/gateway/static/root/assets/{api-Djju8qIR.js → api-np_upIrk.js} +1 -1
  16. package/dist/gateway/static/root/assets/{app-management-settings-panel-IlyzDPJu.js → app-management-settings-panel-IFKcvOK9.js} +1 -1
  17. package/dist/gateway/static/root/assets/{appearance-settings-BxdFGob3.js → appearance-settings-Cfb4s0Ik.js} +1 -1
  18. package/dist/gateway/static/root/assets/{apps-page-CxEKiOTA.js → apps-page-DMDwnwEi.js} +1 -1
  19. package/dist/gateway/static/root/assets/{archive-plugin-4gEvotPr.js → archive-plugin-DBKvxHvn.js} +1 -1
  20. package/dist/gateway/static/root/assets/{automation-api-4fVKv9PJ.js → automation-api-iUvu64Gn.js} +1 -1
  21. package/dist/gateway/static/root/assets/{automation-result-state-m7PeK2kl.js → automation-result-state-EFwxlLpI.js} +1 -1
  22. package/dist/gateway/static/root/assets/{automation-run-list-CJOdy_R2.js → automation-run-list-C66yqC4g.js} +1 -1
  23. package/dist/gateway/static/root/assets/automation-task-card-DXNh_uKL.js +3 -0
  24. package/dist/gateway/static/root/assets/{automations-page-BjbM15eY.js → automations-page-iCsHbzY_.js} +1 -1
  25. package/dist/gateway/static/root/assets/{automations-workspace-CqurzLYX.js → automations-workspace-DnLrs-fb.js} +2 -2
  26. package/dist/gateway/static/root/assets/{binary-plugins-69WyJLNW.js → binary-plugins-C5K0CWqt.js} +1 -1
  27. package/dist/gateway/static/root/assets/{block-editor-DUONDIZR.js → block-editor-3TVEcFpk.js} +1 -1
  28. package/dist/gateway/static/root/assets/{browser-automation-inputs-DL4YPCuN.js → browser-automation-inputs-Wuph6STC.js} +1 -1
  29. package/dist/gateway/static/root/assets/{browser-automations-page-1Aq6XmRs.js → browser-automations-page-THaENU71.js} +1 -1
  30. package/dist/gateway/static/root/assets/{browser-control-api-yjru8E7R.js → browser-control-api-DeRUE9Io.js} +1 -1
  31. package/dist/gateway/static/root/assets/{browser-settings-page-CvwpT8Um.js → browser-settings-page-CeNb4Kyc.js} +1 -1
  32. package/dist/gateway/static/root/assets/{capabilities-DaeQXJT4.js → capabilities-B3cchabB.js} +1 -1
  33. package/dist/gateway/static/root/assets/{capabilities-C7lnwKKm.js → capabilities-CFO_gAma.js} +1 -1
  34. package/dist/gateway/static/root/assets/{capabilities-page-B5avAOUM.js → capabilities-page-KM3X4Bj-.js} +2 -2
  35. package/dist/gateway/static/root/assets/{capabilities-settings-panel-_9yCS78i.js → capabilities-settings-panel-CX201jtA.js} +1 -1
  36. package/dist/gateway/static/root/assets/{channels-CoQb4HOF.js → channels-DmF6s5BH.js} +1 -1
  37. package/dist/gateway/static/root/assets/{chat-agents-api-BUi_7GRo.js → chat-agents-api-ipkXPITj.js} +1 -1
  38. package/dist/gateway/static/root/assets/{chat-chart-block-CcVcKsDZ.js → chat-chart-block-KOdy3HcB.js} +1 -1
  39. package/dist/gateway/static/root/assets/{chat-page--wcFhTjW.js → chat-page-DZy7iw5A.js} +10 -10
  40. package/dist/gateway/static/root/assets/{chat-terminal-dock-BMXJpPuH.js → chat-terminal-dock-BouLAS3C.js} +1 -1
  41. package/dist/gateway/static/root/assets/{command-palette-api-luUjQPsh.js → command-palette-api-CHEmmKmY.js} +1 -1
  42. package/dist/gateway/static/root/assets/{composer-payload-handoff-B5XNxNCb.js → composer-payload-handoff-DQVtV0L9.js} +1 -1
  43. package/dist/gateway/static/root/assets/{computer-settings-page-CWtdyEJH.js → computer-settings-page-DwEzbr0-.js} +1 -1
  44. package/dist/gateway/static/root/assets/{connected-providers-grid-2idMtk65.js → connected-providers-grid-CWdA7VtN.js} +1 -1
  45. package/dist/gateway/static/root/assets/{connection-usage-guide-Ddh0bfkj.js → connection-usage-guide-5RmYdXoS.js} +1 -1
  46. package/dist/gateway/static/root/assets/{connector-service-page-C3msXaBk.js → connector-service-page-TeYvzScr.js} +1 -1
  47. package/dist/gateway/static/root/assets/{connectors-api-NcWECWKg.js → connectors-api-Byw6RD4z.js} +1 -1
  48. package/dist/gateway/static/root/assets/{connectors-page-Crb6DILX.js → connectors-page-B4PrSnT8.js} +1 -1
  49. package/dist/gateway/static/root/assets/{date-picker-Cfjq1hD_.js → date-picker-BpccZyjF.js} +1 -1
  50. package/dist/gateway/static/root/assets/{desktop-pet-ChFn9v-3.js → desktop-pet-DfGMB4GN.js} +1 -1
  51. package/dist/gateway/static/root/assets/{desktop-pet-settings-DvnVIv25.js → desktop-pet-settings-ky__zEoY.js} +1 -1
  52. package/dist/gateway/static/root/assets/{dev-view-store-DQJ61P5L.js → dev-view-store-do-XMWDA.js} +1 -1
  53. package/dist/gateway/static/root/assets/{device-pairing-wizard-KxaIL-OX.js → device-pairing-wizard-CQNlQGYH.js} +1 -1
  54. package/dist/gateway/static/root/assets/{directory-picker-path-field-Drv864uE.js → directory-picker-path-field-DjhHz-4p.js} +1 -1
  55. package/dist/gateway/static/root/assets/{discussion-annotation-sync-DfBRkWtw.js → discussion-annotation-sync-CvGsuUi9.js} +1 -1
  56. package/dist/gateway/static/root/assets/{extension-debug-page-DAlBIt_R.js → extension-debug-page-BimrAkDl.js} +1 -1
  57. package/dist/gateway/static/root/assets/{extension-iframe-host-Bds-5kY_.js → extension-iframe-host-7zoDddj6.js} +1 -1
  58. package/dist/gateway/static/root/assets/{extension-marketplace-api-CZg8nBwW.js → extension-marketplace-api-DA-nbL9C.js} +1 -1
  59. package/dist/gateway/static/root/assets/{extension-page-ZTw-oucT.js → extension-page-wjS2go2N.js} +1 -1
  60. package/dist/gateway/static/root/assets/{extension-provider-NKWfjpdP.js → extension-provider-C2L-lGqA.js} +1 -1
  61. package/dist/gateway/static/root/assets/{extension-settings-page-CT7PPt_q.js → extension-settings-page-CTHs7h7H.js} +1 -1
  62. package/dist/gateway/static/root/assets/{file-preview-surface-BcLeaSNe.js → file-preview-surface-QUJiCKCs.js} +1 -1
  63. package/dist/gateway/static/root/assets/{gateway-config-swr-Cq-ByXL4.js → gateway-config-swr-RHiDzhCY.js} +1 -1
  64. package/dist/gateway/static/root/assets/gateway-realtime-DUlVfng6.js +1 -0
  65. package/dist/gateway/static/root/assets/gateway-realtime-store-C_CDU3to.js +1 -0
  66. package/dist/gateway/static/root/assets/{gateway-restart-DdiVzbkL.js → gateway-restart-L34umMj8.js} +1 -1
  67. package/dist/gateway/static/root/assets/{gateway-settings-1QUdNwrZ.js → gateway-settings-DjwPEBcq.js} +1 -1
  68. package/dist/gateway/static/root/assets/{gateway-startup-retry-PMJi5mX4.js → gateway-startup-retry-CgLo6P66.js} +1 -1
  69. package/dist/gateway/static/root/assets/{global-defaults-api-DgzZh3wX.js → global-defaults-api-Cv6QEJBa.js} +1 -1
  70. package/dist/gateway/static/root/assets/{home-page-Chn7YTiD.js → home-page-D9gDR4MB.js} +2 -2
  71. package/dist/gateway/static/root/assets/{image-generation-api-CjVpsckq.js → image-generation-api-C_GDIILz.js} +1 -1
  72. package/dist/gateway/static/root/assets/{imports-page-CJCvZFaQ.js → imports-page-CvY8wdNu.js} +1 -1
  73. package/dist/gateway/static/root/assets/{index-C4moZbZv.js → index-BVyX4V3C.js} +5 -5
  74. package/dist/gateway/static/root/assets/index-CIYNPxDl.css +1 -0
  75. package/dist/gateway/static/root/assets/{install-connector-dialog-Bo06Ry3H.js → install-connector-dialog-Cnx5oOXv.js} +1 -1
  76. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BylFJeGu.js → keyboard-shortcuts-settings-AXisbvQn.js} +1 -1
  77. package/dist/gateway/static/root/assets/{local-app-workbench-page-B3MSSFsr.js → local-app-workbench-page-DxO9ZTU_.js} +1 -1
  78. package/dist/gateway/static/root/assets/{local-apps-page-BeV86rMJ.js → local-apps-page-sas0hMvK.js} +1 -1
  79. package/dist/gateway/static/root/assets/{local-session-drafts-jgw8UGsO.js → local-session-drafts-DzHbV0VQ.js} +1 -1
  80. package/dist/gateway/static/root/assets/{locale-store-CAZaC05J.js → locale-store-BRJAl_Kx.js} +1 -1
  81. package/dist/gateway/static/root/assets/{logs-page-BMmSsUP5.js → logs-page-BkuLDfZ4.js} +1 -1
  82. package/dist/gateway/static/root/assets/management-settings-CPPZfnc7.js +1 -0
  83. package/dist/gateway/static/root/assets/{markdown-view-BatP4qeK.js → markdown-view-BRNPKsnn.js} +1 -1
  84. package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-rROtr0UN.js → mcp-conversation-setup-page-C5gTNa2U.js} +1 -1
  85. package/dist/gateway/static/root/assets/{media-plugins-88OV72YE.js → media-plugins-BMvgnbE7.js} +1 -1
  86. package/dist/gateway/static/root/assets/messages-Ct1hODNU.js +3 -0
  87. package/dist/gateway/static/root/assets/{model-selector-raBRBkN_.js → model-selector-kWRDioTb.js} +1 -1
  88. package/dist/gateway/static/root/assets/{models-hub-cache-CzC9y3D0.js → models-hub-cache-h2vf54qy.js} +1 -1
  89. package/dist/gateway/static/root/assets/{note-detail-panel-BvA8Vkbm.js → note-detail-panel-DcTiI934.js} +3 -3
  90. package/dist/gateway/static/root/assets/note-image-lightbox-Bjefof6e.js +1 -0
  91. package/dist/gateway/static/root/assets/{notes-api-zXpV6UXu.js → notes-api-D29fdWyC.js} +1 -1
  92. package/dist/gateway/static/root/assets/{notes-page-CjYH9Kle.js → notes-page-CqnQ_UEf.js} +1 -1
  93. package/dist/gateway/static/root/assets/{oauth-api-DmxSaxM1.js → oauth-api-C8McgC-r.js} +1 -1
  94. package/dist/gateway/static/root/assets/{oauth-provider-connect-D4Gfs-Ba.js → oauth-provider-connect-BDTdg0lv.js} +1 -1
  95. package/dist/gateway/static/root/assets/{page-context-capture-button-Mig3d0UX.js → page-context-capture-button-Bf0qvNmd.js} +1 -1
  96. package/dist/gateway/static/root/assets/{page-context-draft-C4IIZaKd.js → page-context-draft-Dx0F3tHK.js} +1 -1
  97. package/dist/gateway/static/root/assets/page-header-store-lsAlAXWQ.js +1 -0
  98. package/dist/gateway/static/root/assets/{personal-avatar-DLa-CpaK.js → personal-avatar-CpEFjQ4Q.js} +1 -1
  99. package/dist/gateway/static/root/assets/{personal-page-BhuT79Wd.js → personal-page-BvjPpwdy.js} +1 -1
  100. package/dist/gateway/static/root/assets/{personal-settings-panel-XSUkgcr2.js → personal-settings-panel-DixKsLRd.js} +1 -1
  101. package/dist/gateway/static/root/assets/{phone-dependencies-card-DYwnuVh3.js → phone-dependencies-card-BfpFV3SG.js} +1 -1
  102. package/dist/gateway/static/root/assets/{phone-model-connection-2F32QTHA.js → phone-model-connection-Os87SvBE.js} +1 -1
  103. package/dist/gateway/static/root/assets/{phone-model-picker-DCVzIr0s.js → phone-model-picker-8pkA8k_N.js} +1 -1
  104. package/dist/gateway/static/root/assets/{phone-settings-page-DJttE4id.js → phone-settings-page-ByERmr61.js} +1 -1
  105. package/dist/gateway/static/root/assets/{phone-workspace-store-Dxp-KhFP.js → phone-workspace-store-DfhWmYic.js} +1 -1
  106. package/dist/gateway/static/root/assets/{plugin-details-dialog-tyjAjFjA.js → plugin-details-dialog-J4PKpTud.js} +1 -1
  107. package/dist/gateway/static/root/assets/{preference-select-fields-BVP3MhGK.js → preference-select-fields-C-PLFUS9.js} +1 -1
  108. package/dist/gateway/static/root/assets/{product-automation-feedback-DbJvv92z.js → product-automation-feedback-DLsF8VBW.js} +1 -1
  109. package/dist/gateway/static/root/assets/{product-open-page-RImqlhCD.js → product-open-page-BP-ssaP8.js} +1 -1
  110. package/dist/gateway/static/root/assets/{product-preview-content-DxSqrKsg.js → product-preview-content-BMI7ZuKU.js} +1 -1
  111. package/dist/gateway/static/root/assets/{product-preview-modal-Cw8Q8Uom.js → product-preview-modal-DZ0zi6ZF.js} +2 -2
  112. package/dist/gateway/static/root/assets/{project-detail-page-CuugOYfe.js → project-detail-page-CS-NrYi5.js} +1 -1
  113. package/dist/gateway/static/root/assets/{project-understanding-BMKcoUW5.js → project-understanding-C9WWE-3t.js} +1 -1
  114. package/dist/gateway/static/root/assets/{projects-page-CFsABLvs.js → projects-page-DVa38OsG.js} +1 -1
  115. package/dist/gateway/static/root/assets/{providers-api-CAeXbJNF.js → providers-api-C1KpkGUT.js} +1 -1
  116. package/dist/gateway/static/root/assets/{recording-upload-CfpllTe5.js → recording-upload-T5ArHnPJ.js} +1 -1
  117. package/dist/gateway/static/root/assets/{registry-api-fLOqFyrz.js → registry-api-Cs-R00dn.js} +1 -1
  118. package/dist/gateway/static/root/assets/{remote-access-hub-BvKOxy0L.js → remote-access-hub-C6NBt2s-.js} +1 -1
  119. package/dist/gateway/static/root/assets/{resource-unavailable-D15jzjV_.js → resource-unavailable-BuySLm9q.js} +1 -1
  120. package/dist/gateway/static/root/assets/{route-preload-BQapekpy.js → route-preload-CDMyXjLQ.js} +2 -2
  121. package/dist/gateway/static/root/assets/{runtime-tools-api-D0Nrvuqv.js → runtime-tools-api-CvTCMobW.js} +1 -1
  122. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CA27XgL2.js → runtime-tools-settings-panel-DlW9tAnO.js} +1 -1
  123. package/dist/gateway/static/root/assets/{service-recommendation-list-B0RoYLVT.js → service-recommendation-list-Biono7Ua.js} +1 -1
  124. package/dist/gateway/static/root/assets/{session-api-CHRP5Lwf.js → session-api-BNt6b3Xl.js} +1 -1
  125. package/dist/gateway/static/root/assets/{session-manager-DRRWwKE4.js → session-manager-CQNN8D0M.js} +1 -1
  126. package/dist/gateway/static/root/assets/{sessions-page-uJHS3-6F.js → sessions-page-3LErqoR9.js} +1 -1
  127. package/dist/gateway/static/root/assets/settings-advanced-gate-SSCcDrIV.js +1 -0
  128. package/dist/gateway/static/root/assets/{settings-advanced-section-D-llwfSj.js → settings-advanced-section-D4uJuQwW.js} +1 -1
  129. package/dist/gateway/static/root/assets/{settings-mode-store-BspMKc9N.js → settings-mode-store-CnG8uLvP.js} +1 -1
  130. package/dist/gateway/static/root/assets/{settings-page-CedwaHM0.js → settings-page-9BthXfuc.js} +1 -1
  131. package/dist/gateway/static/root/assets/{settings-page-header-LuOJvqNa.js → settings-page-header-BXdbhzia.js} +1 -1
  132. package/dist/gateway/static/root/assets/{settings-page-layout-CduQ8w4a.js → settings-page-layout-BQvK_gmr.js} +1 -1
  133. package/dist/gateway/static/root/assets/{setup-interaction-page-ujpPGl84.js → setup-interaction-page-D1uhozUt.js} +1 -1
  134. package/dist/gateway/static/root/assets/{setup-status-panel-BN2aCJUN.js → setup-status-panel-C1o4-hF4.js} +1 -1
  135. package/dist/gateway/static/root/assets/{share-link-dialog-CTATUaa4.js → share-link-dialog-QTEdYG4I.js} +1 -1
  136. package/dist/gateway/static/root/assets/{share-preview-page-Dq0J3VgS.js → share-preview-page-Ba77bFgS.js} +1 -1
  137. package/dist/gateway/static/root/assets/{shares-api-zegE8pSE.js → shares-api-DayDdoBR.js} +1 -1
  138. package/dist/gateway/static/root/assets/{shares-settings-DXpvsRXq.js → shares-settings-67poMpxi.js} +1 -1
  139. package/dist/gateway/static/root/assets/{skill-api-DCL1EN7f.js → skill-api-DR3vdsrS.js} +1 -1
  140. package/dist/gateway/static/root/assets/{skill-list-api-Bv0mmHbu.js → skill-list-api-D6X3XyTd.js} +1 -1
  141. package/dist/gateway/static/root/assets/{skill-reload-api-DPZbadiO.js → skill-reload-api-Wu0UkQ13.js} +1 -1
  142. package/dist/gateway/static/root/assets/{skills-page-DMC7Gaku.js → skills-page-FmjOxilb.js} +1 -1
  143. package/dist/gateway/static/root/assets/{system-settings-panel-BYFUhlqG.js → system-settings-panel-BLeXSW3w.js} +1 -1
  144. package/dist/gateway/static/root/assets/{task-detail-page-_Og3plZL.js → task-detail-page-B5uwlFwb.js} +1 -1
  145. package/dist/gateway/static/root/assets/{task-result-evidence-Bxm8-H0B.js → task-result-evidence-m78K4eAp.js} +1 -1
  146. package/dist/gateway/static/root/assets/{terminal-panel-store-Djf9l2qZ.js → terminal-panel-store-CWpiIbPY.js} +1 -1
  147. package/dist/gateway/static/root/assets/{theme-store-8GFVtotZ.js → theme-store-B9upxkW-.js} +1 -1
  148. package/dist/gateway/static/root/assets/{tracing-settings-page-oWW3SBZ4.js → tracing-settings-page-CACPSXVV.js} +1 -1
  149. package/dist/gateway/static/root/assets/{tunnel-api-D-mEsSGF.js → tunnel-api-CCC7XSFJ.js} +1 -1
  150. package/dist/gateway/static/root/assets/{understanding-activity-store-CvDjsd0I.js → understanding-activity-store-D7WFQ-t7.js} +1 -1
  151. package/dist/gateway/static/root/assets/{understanding-refresh-store-DzOZJm7A.js → understanding-refresh-store-CvOFPfDi.js} +1 -1
  152. package/dist/gateway/static/root/assets/{usage-page-z-o6Uuev.js → usage-page-P9-7xf1p.js} +1 -1
  153. package/dist/gateway/static/root/assets/{use-autosave-BVYS8UoK.js → use-autosave-BNNxl23c.js} +1 -1
  154. package/dist/gateway/static/root/assets/{use-composer-attachments-lecOV2q5.js → use-composer-attachments-7uMSpyxm.js} +1 -1
  155. package/dist/gateway/static/root/assets/{use-file-preview-expanded-nd_CuFsd.js → use-file-preview-expanded-C-NCuwM3.js} +2 -2
  156. package/dist/gateway/static/root/assets/{use-personal-profile-CQi2ZCxV.js → use-personal-profile-1lm_wDMe.js} +1 -1
  157. package/dist/gateway/static/root/assets/{use-workspace-tree-BiaddkzX.js → use-workspace-tree-HlkNpRDC.js} +1 -1
  158. package/dist/gateway/static/root/assets/{user-model-page-Bks1n0Nj.js → user-model-page-B6XfYtEm.js} +1 -1
  159. package/dist/gateway/static/root/assets/{voice-api-key-field-BbW8NFeZ.js → voice-api-key-field-CRZS6XEF.js} +1 -1
  160. package/dist/gateway/static/root/assets/{voice-config-api-jSMzZWWy.js → voice-config-api-CrgRaCMk.js} +1 -1
  161. package/dist/gateway/static/root/assets/{voice-input-shortcut-events-_SgYmx7X.js → voice-input-shortcut-events-vjcw6SRC.js} +1 -1
  162. package/dist/gateway/static/root/assets/{voice-transcribe-api-BJCfiRFU.js → voice-transcribe-api-CtUoGgGT.js} +1 -1
  163. package/dist/gateway/static/root/assets/{work-discovery-overlay-DSTSNyU7.js → work-discovery-overlay-C9tI_qQv.js} +1 -1
  164. package/dist/gateway/static/root/assets/{work-discovery-page-Dd_QJJvb.js → work-discovery-page-C-8kE4mx.js} +1 -1
  165. package/dist/gateway/static/root/assets/{working-directory-picker-modal-q39BUcJ6.js → working-directory-picker-modal-B5fxn2wG.js} +1 -1
  166. package/dist/gateway/static/root/assets/{workspace-api-Di2OmCvz.js → workspace-api-DP2ozrRe.js} +2 -2
  167. package/dist/gateway/static/root/assets/workspace-editor-agent-store-Dw3xS3sE.js +1 -0
  168. package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-BUGNT765.js → workspace-file-preview-dialog-Cp86E6-h.js} +1 -1
  169. package/dist/gateway/static/root/assets/{workspace-open-location-menu-bMSvmQW7.js → workspace-open-location-menu-CWOgHMmR.js} +1 -1
  170. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-Bbe19Del.js → xopc-cloud-account-card-CIaHnCGw.js} +1 -1
  171. package/dist/gateway/static/root/index.html +81 -81
  172. package/dist/package.js +1 -1
  173. package/dist/packages/browser-control-contract/src/remote.js +237 -0
  174. package/dist/packages/computer-control-contract/src/index.js +12 -2
  175. package/dist/packages/endpoint-tools-client/src/index.js +8 -0
  176. package/dist/packages/endpoint-tools-protocol/src/command.js +83 -0
  177. package/dist/packages/endpoint-tools-protocol/src/execution.js +102 -0
  178. package/dist/packages/endpoint-tools-protocol/src/index.js +61 -7
  179. package/dist/packages/endpoint-tools-protocol/src/operation-status.js +76 -0
  180. package/dist/packages/endpoint-tools-protocol/src/screen.js +28 -0
  181. package/dist/packages/endpoint-tools-protocol/src/terminal.js +173 -0
  182. package/dist/packages/endpoint-tools-protocol/src/workspace.js +143 -0
  183. package/dist/packages/gateway-contract/src/desktop-chat.js +29 -0
  184. package/dist/packages/gateway-contract/src/desktop-execution-stop.js +36 -0
  185. package/dist/packages/gateway-contract/src/desktop-host.js +87 -0
  186. package/dist/packages/gateway-contract/src/device-pairing.js +17 -4
  187. package/dist/packages/gateway-contract/src/gateway-scopes.js +6 -2
  188. package/dist/packages/gateway-contract/src/index.js +6 -0
  189. package/dist/packages/realtime-protocol/src/index.js +15 -2
  190. package/dist/src/agent/client-error-format.d.ts +1 -1
  191. package/dist/src/agent/client-error-format.js +3 -2
  192. package/dist/src/agent/context/project-context.d.ts +1 -0
  193. package/dist/src/agent/context/project-context.js +9 -2
  194. package/dist/src/agent/embedded/run-turn.js +5 -2
  195. package/dist/src/agent/external-tools/endpoint-provider.js +76 -4
  196. package/dist/src/agent/memory/context-recovery.d.ts +3 -3
  197. package/dist/src/agent/memory/context-recovery.js +10 -3
  198. package/dist/src/agent/memory/repeated-read-projection.d.ts +9 -0
  199. package/dist/src/agent/memory/repeated-read-projection.js +78 -0
  200. package/dist/src/agent/orchestration/llm-turn-retry.js +8 -1
  201. package/dist/src/agent/sandbox/exec-policy.js +2 -0
  202. package/dist/src/agent/sandbox/types.d.ts +1 -0
  203. package/dist/src/agent/service/direct-turn-helpers.js +2 -1
  204. package/dist/src/agent/service/process-direct-streaming.js +4 -2
  205. package/dist/src/agent/source-context/browser-tab.js +1 -0
  206. package/dist/src/agent/source-context/device-environment.js +9 -3
  207. package/dist/src/agent/source-context/index.js +7 -3
  208. package/dist/src/agent/source-context/injector.d.ts +4 -0
  209. package/dist/src/agent/source-context/injector.js +23 -8
  210. package/dist/src/agent/source-context/source-context-projection.d.ts +8 -0
  211. package/dist/src/agent/source-context/source-context-projection.js +127 -0
  212. package/dist/src/agent/source-context/types.js +4 -1
  213. package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
  214. package/dist/src/agent/tool-manuals/computer.js +1 -1
  215. package/dist/src/agent/tools/exec-command.js +3 -2
  216. package/dist/src/agent/tools/factory.d.ts +7 -1
  217. package/dist/src/agent/tools/factory.js +103 -14
  218. package/dist/src/automations/api/dispatcher.d.ts +6 -0
  219. package/dist/src/automations/api/dispatcher.js +17 -0
  220. package/dist/src/automations/api/routes.js +2 -6
  221. package/dist/src/browser/drivers/browser-driver.d.ts +1 -1
  222. package/dist/src/browser/remote/device-driver.d.ts +26 -0
  223. package/dist/src/browser/remote/device-driver.js +247 -0
  224. package/dist/src/browser/remote/device-runtime.d.ts +9 -0
  225. package/dist/src/browser/remote/device-runtime.js +27 -0
  226. package/dist/src/browser/remote/device-target.d.ts +4 -0
  227. package/dist/src/browser/remote/device-target.js +20 -0
  228. package/dist/src/browser/remote/endpoint-transport.d.ts +4 -0
  229. package/dist/src/browser/remote/endpoint-transport.js +48 -0
  230. package/dist/src/browser/runtime/browser-runtime.d.ts +1 -0
  231. package/dist/src/browser/runtime/browser-runtime.js +1 -0
  232. package/dist/src/browser/url-policy.js +19 -6
  233. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  234. package/dist/src/computer/broker.d.ts +2 -1
  235. package/dist/src/computer/broker.js +15 -0
  236. package/dist/src/computer/diagnostics.d.ts +3 -3
  237. package/dist/src/computer/endpoint-transport.d.ts +4 -0
  238. package/dist/src/computer/endpoint-transport.js +54 -0
  239. package/dist/src/computer/errors.js +1 -1
  240. package/dist/src/computer/evaluation.d.ts +2 -2
  241. package/dist/src/computer/program-runtime.js +14 -2
  242. package/dist/src/computer/runtime.d.ts +1 -0
  243. package/dist/src/computer/runtime.js +31 -11
  244. package/dist/src/computer/task-state.js +3 -1
  245. package/dist/src/endpoint-tools/capability-catalog.js +1 -1
  246. package/dist/src/endpoint-tools/desktop-authority-response.d.ts +19 -0
  247. package/dist/src/endpoint-tools/desktop-authority-response.js +38 -0
  248. package/dist/src/endpoint-tools/desktop-device-frame.d.ts +18 -0
  249. package/dist/src/endpoint-tools/desktop-device-frame.js +94 -0
  250. package/dist/src/endpoint-tools/desktop-execution.d.ts +14 -0
  251. package/dist/src/endpoint-tools/desktop-execution.js +28 -0
  252. package/dist/src/endpoint-tools/desktop-frame.d.ts +12 -0
  253. package/dist/src/endpoint-tools/desktop-frame.js +35 -0
  254. package/dist/src/endpoint-tools/desktop-observation.d.ts +4 -0
  255. package/dist/src/endpoint-tools/desktop-observation.js +20 -0
  256. package/dist/src/endpoint-tools/invocation-service.d.ts +35 -2
  257. package/dist/src/endpoint-tools/invocation-service.js +138 -14
  258. package/dist/src/endpoint-tools/policy.js +27 -2
  259. package/dist/src/endpoint-tools/registry.d.ts +5 -3
  260. package/dist/src/endpoint-tools/registry.js +10 -3
  261. package/dist/src/endpoint-tools/runtime.d.ts +4 -2
  262. package/dist/src/endpoint-tools/runtime.js +9 -3
  263. package/dist/src/endpoint-tools/terminal-broker.d.ts +90 -0
  264. package/dist/src/endpoint-tools/terminal-broker.js +320 -0
  265. package/dist/src/gateway/hono/app.js +7 -4
  266. package/dist/src/gateway/hono/middleware/auth.js +11 -1
  267. package/dist/src/gateway/hono/routes/agent-stream.js +2 -1
  268. package/dist/src/gateway/hono/routes/desktop-chat.d.ts +3 -0
  269. package/dist/src/gateway/hono/routes/desktop-chat.js +30 -0
  270. package/dist/src/gateway/hono/routes/desktop-execution-stop.d.ts +6 -0
  271. package/dist/src/gateway/hono/routes/desktop-execution-stop.js +52 -0
  272. package/dist/src/gateway/hono/routes/desktop-host.d.ts +3 -0
  273. package/dist/src/gateway/hono/routes/desktop-host.js +485 -0
  274. package/dist/src/gateway/hono/routes/devices.d.ts +3 -1
  275. package/dist/src/gateway/hono/routes/devices.js +7 -2
  276. package/dist/src/gateway/hono/routes/endpoint-tools.js +16 -4
  277. package/dist/src/gateway/hono/routes/lazy-bundles.js +21 -0
  278. package/dist/src/gateway/hono/routes/models.js +5 -2
  279. package/dist/src/gateway/hono/routes/session-input-handler.js +2 -1
  280. package/dist/src/gateway/security/gateway-scopes.js +10 -0
  281. package/dist/src/gateway/security/phone-access.js +4 -1
  282. package/dist/src/gateway/service/session-input-coordinator.js +5 -3
  283. package/dist/src/gateway/service.js +1 -0
  284. package/dist/src/gateway/session-context-summary.js +2 -1
  285. package/dist/src/providers/model-response.js +1 -0
  286. package/dist/src/providers/presentation.js +1 -1
  287. package/dist/src/realtime/runtime.js +86 -7
  288. package/dist/src/session/session-context-for-llm.js +3 -1
  289. package/dist/src/storage/sqlite/desktop-execution-repository.d.ts +44 -0
  290. package/dist/src/storage/sqlite/desktop-execution-repository.js +76 -0
  291. package/dist/src/storage/sqlite/desktop-execution-state.d.ts +13 -0
  292. package/dist/src/storage/sqlite/desktop-execution-state.js +22 -0
  293. package/dist/src/storage/sqlite/desktop-execution-stop-repository.d.ts +19 -0
  294. package/dist/src/storage/sqlite/desktop-execution-stop-repository.js +66 -0
  295. package/dist/src/storage/sqlite/desktop-operation-repository.d.ts +79 -0
  296. package/dist/src/storage/sqlite/desktop-operation-repository.js +143 -0
  297. package/dist/src/storage/sqlite/device-access-repository.d.ts +12 -0
  298. package/dist/src/storage/sqlite/device-access-repository.js +54 -3
  299. package/dist/src/storage/sqlite/device-pairing-approval.js +4 -4
  300. package/dist/src/storage/sqlite/device-pairing-repository.d.ts +1 -1
  301. package/dist/src/storage/sqlite/endpoint-principal-repository.d.ts +2 -0
  302. package/dist/src/storage/sqlite/endpoint-principal-repository.js +5 -1
  303. package/dist/src/storage/sqlite/endpoint-tool-invocation-repository.d.ts +2 -0
  304. package/dist/src/storage/sqlite/endpoint-tool-invocation-repository.js +8 -3
  305. package/dist/src/storage/sqlite/schema.d.ts +2 -2
  306. package/dist/src/storage/sqlite/schema.js +7 -7
  307. package/dist/src/storage/sqlite/schema.sql +48 -3
  308. package/dist/src/storage/sqlite/upgrades/263_desktop_device_credentials.sql +39 -0
  309. package/dist/src/storage/sqlite/upgrades/264_desktop_observation_grants.sql +5 -0
  310. package/dist/src/storage/sqlite/upgrades/265_desktop_screen_scope.sql +3 -0
  311. package/dist/src/storage/sqlite/upgrades/266_endpoint_operation_audit.sql +3 -0
  312. package/dist/src/storage/sqlite/upgrades/267_desktop_reliable_execution.sql +15 -0
  313. package/dist/src/storage/sqlite/upgrades/268_desktop_operation_reviews.sql +9 -0
  314. package/dist/src/storage/sqlite/upgrades/269_desktop_execution_stops.sql +10 -0
  315. package/dist/src/tasks/task-handoff.js +2 -1
  316. package/package.json +6 -2
  317. package/dist/gateway/static/root/assets/automation-task-card-DZWhCWJa.js +0 -3
  318. package/dist/gateway/static/root/assets/gateway-realtime-DwMd2PCt.js +0 -1
  319. package/dist/gateway/static/root/assets/gateway-realtime-store-CHrf6-nR.js +0 -1
  320. package/dist/gateway/static/root/assets/index-iukJWzxG.css +0 -1
  321. package/dist/gateway/static/root/assets/management-settings-Bu7T8ewk.js +0 -1
  322. package/dist/gateway/static/root/assets/messages-C7fckbyG.js +0 -3
  323. package/dist/gateway/static/root/assets/note-image-lightbox-D6kUDDd5.js +0 -1
  324. package/dist/gateway/static/root/assets/page-header-store-D7G5utVi.js +0 -1
  325. package/dist/gateway/static/root/assets/settings-advanced-gate-CZ4J3Kuy.js +0 -1
  326. package/dist/gateway/static/root/assets/workspace-editor-agent-store-B2r9wlix.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 === "chrome") return void 0;
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 === "mobile" && device.platform !== "chrome")) fail("PAIRING_DEVICE_MISMATCH");
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 = 262;
4
- export declare const XOPC_DB_BASELINE_SCHEMA_VERSION = 262;
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 > 262) throw new DatabaseSchemaTooNewError(version, 262);
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 < 262) {
20
- upgradeXopcDatabase(db, version, 262);
19
+ if (version >= 202 && version < 269) {
20
+ upgradeXopcDatabase(db, version, 269);
21
21
  return;
22
22
  }
23
- if (version === 262) return;
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, 262);
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 = 262;
44
- XOPC_DB_BASELINE_SCHEMA_VERSION = 262;
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);
@@ -0,0 +1,5 @@
1
+ CREATE TABLE desktop_observation_grants (
2
+ device_id TEXT PRIMARY KEY REFERENCES devices(device_id) ON DELETE CASCADE,
3
+ revision INTEGER NOT NULL CHECK (revision > 0),
4
+ updated_at INTEGER NOT NULL
5
+ );
@@ -0,0 +1,3 @@
1
+ -- The application data schema now admits desktop.observe.screen in scopes_json.
2
+ -- Keep older binaries from parsing an authority they do not understand.
3
+ SELECT 1;
@@ -0,0 +1,3 @@
1
+ ALTER TABLE endpoint_tool_invocations ADD COLUMN operation_id TEXT;
2
+ CREATE INDEX idx_endpoint_tool_invocations_operation
3
+ ON endpoint_tool_invocations(operation_id) WHERE operation_id IS NOT NULL;