@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,320 @@
1
+ import { desktopTerminalBindingSchema } from "../../packages/endpoint-tools-protocol/src/terminal.js";
2
+ import { canonicalJson, init_src } from "../../packages/endpoint-tools-protocol/src/index.js";
3
+ import { ExternalEffectNotAppliedError, executeExternalOperation } from "../capabilities/runtime/external-operations.js";
4
+ import { getDesktopExecutionGrant } from "../storage/sqlite/desktop-execution-repository.js";
5
+ import { getDesktopOperationReceipt } from "../storage/sqlite/desktop-operation-repository.js";
6
+ import { EndpointToolExecutionError } from "./invocation-service.js";
7
+ import { createHash } from "node:crypto";
8
+ import { z } from "zod";
9
+ //#region src/endpoint-tools/terminal-broker.ts
10
+ init_src();
11
+ const digest = (value) => createHash("sha256").update(canonicalJson(value)).digest("hex");
12
+ function deferred() {
13
+ let resolve, reject;
14
+ return {
15
+ promise: new Promise((yes, no) => {
16
+ resolve = yes;
17
+ reject = no;
18
+ }),
19
+ resolve,
20
+ reject
21
+ };
22
+ }
23
+ const controlSchema = z.strictObject({
24
+ sessionId: z.uuid(),
25
+ generation: z.uuid(),
26
+ action: z.enum([
27
+ "input",
28
+ "read",
29
+ "resize",
30
+ "close"
31
+ ]),
32
+ text: z.string().refine((value) => Buffer.byteLength(value) <= 4e3).optional(),
33
+ columns: z.number().int().min(20).max(500).optional(),
34
+ rows: z.number().int().min(2).max(500).optional()
35
+ });
36
+ /** Gateway session router. Root durability outlives the open response; transport ACKs never become execution outcomes. */
37
+ var DesktopTerminalGatewayBroker = class {
38
+ sessions = /* @__PURE__ */ new Map();
39
+ closed = false;
40
+ constructor(registry, invocations) {
41
+ this.registry = registry;
42
+ this.invocations = invocations;
43
+ }
44
+ authority(session, allowClosed = false) {
45
+ const endpoint = this.registry.get(session.endpoint.endpointId), original = session.endpoint.executionAuthority;
46
+ const grant = original && getDesktopExecutionGrant(original.deviceId);
47
+ if (this.closed || session.closed && !allowClosed || !endpoint || endpoint.terminalVersion !== 1 || endpoint.connectionId !== session.endpoint.connectionId || endpoint.availability !== "foreground" || !original || !grant?.active || grant.revision !== original.authorizationRevision || grant.grant?.grantId !== original.grantId || original.expiresAt <= Date.now()) throw new Error("DESKTOP_TERMINAL_AUTHORITY_INVALID");
48
+ return endpoint;
49
+ }
50
+ fail(session, reason) {
51
+ session.uncertain = true;
52
+ session.controller.abort();
53
+ session.pending?.result.reject(new Error(reason));
54
+ session.pending = void 0;
55
+ }
56
+ async open(input) {
57
+ input.signal?.throwIfAborted();
58
+ const endpoint = this.registry.get(input.endpointId), tool = this.registry.getTool(input.endpointId, "desktop.terminal.open");
59
+ if (!endpoint?.executionAuthority || endpoint.terminalVersion !== 1 || tool?.revision !== input.revision) throw new Error("DESKTOP_TERMINAL_NOT_NEGOTIATED");
60
+ const mapKey = digest({
61
+ endpointId: input.endpointId,
62
+ connectionId: endpoint.connectionId,
63
+ key: input.key
64
+ });
65
+ let session = this.sessions.get(mapKey);
66
+ if (session) {
67
+ this.authority(session);
68
+ if (session.argsHash !== digest(input.args)) throw new Error("DESKTOP_TERMINAL_INTENT_CONFLICT");
69
+ return {
70
+ ...await session.opened.promise,
71
+ operationId: session.operationId,
72
+ state: "running",
73
+ executionStopped: false
74
+ };
75
+ }
76
+ if (this.sessions.size >= 64) throw new Error("DESKTOP_TERMINAL_SESSION_LIMIT");
77
+ if ([...this.sessions.values()].some((session) => session.endpoint.principalId === endpoint.principalId && !session.closed)) throw new Error("DESKTOP_TERMINAL_BUSY");
78
+ session = {
79
+ endpoint,
80
+ key: mapKey,
81
+ argsHash: digest(input.args),
82
+ controller: new AbortController(),
83
+ opened: deferred(),
84
+ closed: false,
85
+ uncertain: false,
86
+ closing: false,
87
+ frames: [],
88
+ outputSequence: 0,
89
+ inputSequence: 0,
90
+ busy: false,
91
+ decoder: new TextDecoder()
92
+ };
93
+ this.authority(session);
94
+ this.sessions.set(mapKey, session);
95
+ const current = session, abort = () => {
96
+ this.fail(current, "DESKTOP_TERMINAL_OPEN_CANCELLED");
97
+ };
98
+ input.signal?.addEventListener("abort", abort, { once: true });
99
+ current.opened.promise.catch(() => {});
100
+ current.root = executeExternalOperation({
101
+ principalId: endpoint.principalId,
102
+ capabilityId: "desktop-terminal-root:" + endpoint.endpointId,
103
+ idempotencyKey: input.key,
104
+ requestDigest: current.argsHash,
105
+ descriptorDigest: input.revision,
106
+ surface: "desktop-terminal",
107
+ recovery: "manual",
108
+ leaseMs: 12e4
109
+ }, async (operationId) => {
110
+ current.operationId = operationId;
111
+ try {
112
+ return await this.invocations.invoke({
113
+ endpointId: input.endpointId,
114
+ toolCallId: input.toolCallId,
115
+ toolName: "desktop.terminal.open",
116
+ arguments: input.args,
117
+ descriptorRevision: input.revision,
118
+ operationId,
119
+ signal: current.controller.signal,
120
+ onTerminal: (invocationId, event) => {
121
+ current.invocationId = invocationId;
122
+ this.event(current, event);
123
+ }
124
+ });
125
+ } catch (error) {
126
+ const authority = endpoint.executionAuthority, receipt = getDesktopOperationReceipt(operationId, authority.deviceId, authority.gatewayId);
127
+ if (current.closing && !current.uncertain && error instanceof EndpointToolExecutionError && error.code === "TOOL_CANCELLED" && receipt?.state === "stopped" && receipt.executionStopped && receipt.invocationId === current.invocationId) return {
128
+ closed: true,
129
+ executionStopped: true,
130
+ outcome: "stopped"
131
+ };
132
+ if (error instanceof EndpointToolExecutionError && (error.confirmedNoEffect || error.code === "USER_DENIED")) throw new ExternalEffectNotAppliedError(error.message, { cause: error });
133
+ throw error;
134
+ }
135
+ });
136
+ current.root.then(() => this.finished(current), (error) => this.finished(current, error));
137
+ try {
138
+ const binding = await current.opened.promise;
139
+ this.authority(current);
140
+ return {
141
+ ...binding,
142
+ operationId: current.operationId,
143
+ state: "running",
144
+ executionStopped: false
145
+ };
146
+ } finally {
147
+ input.signal?.removeEventListener("abort", abort);
148
+ }
149
+ }
150
+ finished(session, error) {
151
+ session.closed = true;
152
+ if (error) session.uncertain = true;
153
+ session.opened.reject(error ?? /* @__PURE__ */ new Error("DESKTOP_TERMINAL_CLOSED_BEFORE_READY"));
154
+ session.pending?.result.reject(/* @__PURE__ */ new Error("DESKTOP_TERMINAL_CLOSED"));
155
+ session.pending = void 0;
156
+ }
157
+ event(session, event) {
158
+ this.authority(session);
159
+ const binding = desktopTerminalBindingSchema.parse({
160
+ sessionId: event.sessionId,
161
+ generation: event.generation,
162
+ connectionInstanceId: event.connectionInstanceId
163
+ });
164
+ if (!session.binding) {
165
+ if (event.event !== "opened" || event.operationId !== session.operationId || event.sessionId !== session.operationId) throw new Error("DESKTOP_TERMINAL_BINDING_INVALID");
166
+ session.binding = binding;
167
+ session.opened.resolve(binding);
168
+ return;
169
+ }
170
+ if (canonicalJson(session.binding) !== canonicalJson(binding)) throw new Error("DESKTOP_TERMINAL_BINDING_INVALID");
171
+ if (event.event === "output") {
172
+ if (event.sequence !== session.outputSequence + 1 || session.frames.length >= 16 || Buffer.from(event.bytes, "base64").toString("base64") !== event.bytes) {
173
+ this.fail(session, "DESKTOP_TERMINAL_OUTPUT_UNKNOWN");
174
+ throw new Error("DESKTOP_TERMINAL_OUTPUT_UNKNOWN");
175
+ }
176
+ session.outputSequence = event.sequence;
177
+ session.frames.push({
178
+ ...binding,
179
+ sequence: event.sequence,
180
+ bytes: event.bytes
181
+ });
182
+ return;
183
+ }
184
+ if (event.event === "stream-ended") return;
185
+ const pending = session.pending;
186
+ if (event.event === "input-ack" && pending?.id === event.inputId && pending.sequence === event.sequence || event.event === "resize-ack" && pending?.id === event.requestId) {
187
+ pending.result.resolve(event);
188
+ return;
189
+ }
190
+ this.fail(session, "DESKTOP_TERMINAL_EVENT_INVALID");
191
+ throw new Error("DESKTOP_TERMINAL_EVENT_INVALID");
192
+ }
193
+ async control(input) {
194
+ const args = controlSchema.parse(input.args), session = [...this.sessions.values()].find((session) => session.endpoint.endpointId === input.endpointId && session.binding?.sessionId === args.sessionId && session.binding.generation === args.generation);
195
+ if (!session?.binding || !session.invocationId) throw new Error("DESKTOP_TERMINAL_UNAVAILABLE");
196
+ this.authority(session, args.action === "read");
197
+ input.signal?.throwIfAborted();
198
+ if (session.busy) throw new Error("DESKTOP_TERMINAL_BUSY");
199
+ const tool = this.registry.getTool(input.endpointId, "desktop.terminal.control");
200
+ if (!tool) throw new Error("DESKTOP_TERMINAL_NOT_NEGOTIATED");
201
+ session.busy = true;
202
+ try {
203
+ return await executeExternalOperation({
204
+ principalId: session.endpoint.principalId,
205
+ capabilityId: "desktop-terminal-control:" + args.sessionId,
206
+ idempotencyKey: input.key,
207
+ requestDigest: digest(args),
208
+ descriptorDigest: tool.revision,
209
+ surface: "desktop-terminal",
210
+ recovery: "manual",
211
+ leaseMs: 6e4
212
+ }, async (requestId) => {
213
+ this.authority(session, args.action === "read");
214
+ input.signal?.throwIfAborted();
215
+ if (args.action === "read") {
216
+ if (args.text !== void 0 || args.columns !== void 0 || args.rows !== void 0) throw new ExternalEffectNotAppliedError("Invalid terminal read arguments");
217
+ const frames = session.frames.splice(0, 1);
218
+ if (frames.length && !session.closed) this.registry.send(input.endpointId, "terminal.command", {
219
+ invocationId: session.invocationId,
220
+ command: {
221
+ ...session.binding,
222
+ action: "ack",
223
+ throughSequence: frames.at(-1).sequence
224
+ }
225
+ });
226
+ const authority = session.endpoint.executionAuthority;
227
+ const receipt = session.closed && session.operationId ? getDesktopOperationReceipt(session.operationId, authority.deviceId, authority.gatewayId) : void 0;
228
+ return {
229
+ frames,
230
+ text: session.decoder.decode(Buffer.concat(frames.map((frame) => Buffer.from(frame.bytes, "base64"))), { stream: !session.closed || session.frames.length > 0 }),
231
+ state: session.closed ? session.uncertain ? "unknown" : "closed" : "running",
232
+ executionStopped: receipt?.executionStopped === true
233
+ };
234
+ }
235
+ if (args.action === "close") {
236
+ session.closing = true;
237
+ this.registry.send(input.endpointId, "terminal.command", {
238
+ invocationId: session.invocationId,
239
+ command: {
240
+ ...session.binding,
241
+ action: "close"
242
+ }
243
+ });
244
+ await session.root;
245
+ return {
246
+ state: "closed",
247
+ executionStopped: true
248
+ };
249
+ }
250
+ const result = deferred();
251
+ result.promise.catch(() => {});
252
+ if (args.action === "input") {
253
+ if (typeof args.text !== "string" || !args.text || args.columns !== void 0 || args.rows !== void 0 || session.inputSequence >= 1e3) throw new ExternalEffectNotAppliedError("Invalid terminal input");
254
+ session.pending = {
255
+ id: requestId,
256
+ sequence: ++session.inputSequence,
257
+ result
258
+ };
259
+ this.registry.send(input.endpointId, "terminal.command", {
260
+ invocationId: session.invocationId,
261
+ command: {
262
+ ...session.binding,
263
+ action: "input",
264
+ inputId: requestId,
265
+ sequence: session.inputSequence,
266
+ bytes: Buffer.from(args.text).toString("base64")
267
+ }
268
+ });
269
+ } else {
270
+ if (args.text !== void 0 || args.columns === void 0 || args.rows === void 0) throw new ExternalEffectNotAppliedError("Invalid terminal resize");
271
+ session.pending = {
272
+ id: requestId,
273
+ result
274
+ };
275
+ this.registry.send(input.endpointId, "terminal.command", {
276
+ invocationId: session.invocationId,
277
+ command: {
278
+ ...session.binding,
279
+ action: "resize",
280
+ requestId,
281
+ columns: args.columns,
282
+ rows: args.rows
283
+ }
284
+ });
285
+ }
286
+ let timer;
287
+ const abort = () => {
288
+ this.fail(session, "DESKTOP_TERMINAL_CONTROL_UNKNOWN");
289
+ };
290
+ input.signal?.addEventListener("abort", abort, { once: true });
291
+ try {
292
+ const event = await Promise.race([result.promise, new Promise((_, reject) => {
293
+ timer = setTimeout(() => reject(/* @__PURE__ */ new Error("DESKTOP_TERMINAL_CONTROL_UNKNOWN")), Math.max(1, Math.min(6e4, session.endpoint.executionAuthority.expiresAt - Date.now())));
294
+ })]);
295
+ this.authority(session);
296
+ if (event.event === "input-ack" && event.dispatch === "unknown") throw new Error("DESKTOP_TERMINAL_CONTROL_UNKNOWN");
297
+ return event;
298
+ } catch (error) {
299
+ this.fail(session, "DESKTOP_TERMINAL_CONTROL_UNKNOWN");
300
+ throw error;
301
+ } finally {
302
+ clearTimeout(timer);
303
+ input.signal?.removeEventListener("abort", abort);
304
+ session.pending = void 0;
305
+ }
306
+ });
307
+ } finally {
308
+ session.busy = false;
309
+ }
310
+ }
311
+ close() {
312
+ this.closed = true;
313
+ for (const session of this.sessions.values()) if (!session.closed) this.fail(session, "DESKTOP_TERMINAL_GATEWAY_CLOSED");
314
+ }
315
+ async whenStopped() {
316
+ await Promise.allSettled([...this.sessions.values()].map((session) => session.root));
317
+ }
318
+ };
319
+ //#endregion
320
+ export { DesktopTerminalGatewayBroker };
@@ -222,10 +222,13 @@ function createHonoApp(config) {
222
222
  });
223
223
  registerPublicGatewayRoutes(app, service);
224
224
  registerPublicHtmlPreviewRoute(app);
225
- registerDeviceAuthPublicRoutes(app, { getTrustedProxyContext: () => ({
226
- trustedProxies: service.currentConfig.gateway?.trustedProxies,
227
- allowRealIpFallback: service.currentConfig.gateway?.allowRealIpFallback === true
228
- }) });
225
+ registerDeviceAuthPublicRoutes(app, {
226
+ onDesktopExecutionStopped: (deviceId) => service.realtime.disconnectPrincipal(deviceId),
227
+ getTrustedProxyContext: () => ({
228
+ trustedProxies: service.currentConfig.gateway?.trustedProxies,
229
+ allowRealIpFallback: service.currentConfig.gateway?.allowRealIpFallback === true
230
+ })
231
+ });
229
232
  registerPublicExtensionAssetRoutes(app, service);
230
233
  registerPublicLocalAppPreviewRoutes(app, service);
231
234
  const authenticated = new Hono();
@@ -7,6 +7,7 @@ import { isAuthRateLimitGloballyDisabled } from "../../rate-limit/env-flags.js";
7
7
  import "../../rate-limit/index.js";
8
8
  import { authenticateDeviceAccessToken, getDevice } from "../../../storage/sqlite/device-access-repository.js";
9
9
  import { getOrCreateGatewayIdentity } from "../../../storage/sqlite/gateway-identity-repository.js";
10
+ import { getDesktopExecutionGrant } from "../../../storage/sqlite/desktop-execution-repository.js";
10
11
  import { safeEqualSecret } from "../../security/secret-equal.js";
11
12
  import { resolveClientIpFromRequest } from "../../client-ip.js";
12
13
  import { PROOF_HEADER, acquireProofBodyBudget, consumeRequestNonce, parseRequestProof, proofDigest, requestProofMessage, verifyRequestProofSignature } from "../../security/device-request-proof.js";
@@ -268,7 +269,7 @@ function auth(config) {
268
269
  error: "Unauthorized",
269
270
  code: "REQUEST_PROOF_INVALID"
270
271
  }, 401);
271
- const release = /^(multipart\/form-data|application\/octet-stream)/i.test(c.req.header("content-type") ?? "") || Number(c.req.header("content-length") ?? 0) > 65536 ? acquireProofBodyBudget(device.id) : () => {};
272
+ const release = /^\/api\/endpoint-tools\/invocations\/[^/]+\/files$/.test(requestPath) || /^(multipart\/form-data|application\/octet-stream)/i.test(c.req.header("content-type") ?? "") || Number(c.req.header("content-length") ?? 0) > 65536 ? acquireProofBodyBudget(device.id) : () => {};
272
273
  if (!release) {
273
274
  c.header("Retry-After", "1");
274
275
  return c.json({
@@ -286,6 +287,15 @@ function auth(config) {
286
287
  code: "REQUEST_REPLAYED"
287
288
  }, 401);
288
289
  }
290
+ const desktopExecution = device?.platform === "desktop" && device.scopes.includes("desktop.execute") ? getDesktopExecutionGrant(device.id) : void 0;
291
+ if (device?.platform === "desktop" && !(c.req.method === "GET" && (requestPath === "/api/desktop-host/operations" || /^\/api\/desktop-host\/operations\/[0-9a-f-]{36}$/.test(requestPath)) || c.req.method === "POST" && /^\/api\/desktop-host\/operations\/[0-9a-f-]{36}\/review$/.test(requestPath) || [
292
+ "GET",
293
+ "POST",
294
+ "DELETE"
295
+ ].includes(c.req.method) && requestPath === "/api/desktop-host/execution" || c.req.method === "GET" && ["/api/desktop-host/compatibility", "/api/devices/me"].includes(requestPath) || c.req.method === "DELETE" && requestPath === "/api/devices/me" || c.req.method === "DELETE" && ["/api/desktop-host/observation", "/api/desktop-host/screen"].includes(requestPath) || (device.scopes.includes("desktop.observe.screen") || device.scopes.includes("desktop.execute") && desktopExecution?.active && (desktopExecution.grant?.toolRevisions["desktop.computer.remote_control"] || desktopExecution.grant?.toolRevisions["desktop.browser.control"])) && c.req.method === "POST" && /^\/api\/endpoint-tools\/invocations\/[0-9a-f-]{36}\/files$/.test(requestPath) || (device.scopes.includes("desktop.observe.state") || device.scopes.includes("desktop.observe.screen") || desktopExecution?.active) && (c.req.method === "POST" && ["/api/endpoint-tools/principals", "/api/realtime/tickets"].includes(requestPath) || c.req.method === "GET" && ["/api/endpoint-tools/compatibility", "/api/desktop-host/status"].includes(requestPath)))) return c.json({
296
+ error: "Forbidden",
297
+ code: "DESKTOP_CREDENTIAL_SCOPE_DENIED"
298
+ }, 403);
289
299
  recordSuccess(rl);
290
300
  setGatewayPrincipal(c, {
291
301
  kind: "device",
@@ -1,12 +1,13 @@
1
1
  import { parseUserTurnDocument, userTurnDocumentRefIds } from "../../../../packages/gateway-contract/src/user-turn-document.js";
2
2
  import { clarificationResponseCommandSchema } from "../../../../packages/gateway-contract/src/clarifications.js";
3
3
  import { init_src } from "../../../../packages/gateway-contract/src/index.js";
4
- import { parseTurnContextRefs } from "../../../agent/source-context/types.js";
4
+ import { init_types, parseTurnContextRefs } from "../../../agent/source-context/types.js";
5
5
  import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
6
6
  import { replaceLatestSessionTurn } from "./session-input-handler.js";
7
7
  import { handleSessionCommand, handleSessionInputReceipt, handleSessionPreparationRetry } from "./session-command-handler.js";
8
8
  //#region src/gateway/hono/routes/agent-stream.ts
9
9
  init_src();
10
+ init_types();
10
11
  function registerAgentStreamRoutes(authenticated, deps) {
11
12
  const { service, chatRateLimitMiddleware } = deps;
12
13
  authenticated.post("/api/agent/abort", chatRateLimitMiddleware, async (c) => {
@@ -0,0 +1,3 @@
1
+ import type { Hono } from 'hono';
2
+ import type { AuthenticatedRouteDeps } from './deps.js';
3
+ export declare function registerDesktopChatRoutes(authenticated: Hono, { service }: AuthenticatedRouteDeps): void;
@@ -0,0 +1,30 @@
1
+ import { DESKTOP_CHAT_MANIFEST } from "../../../../packages/gateway-contract/src/desktop-chat.js";
2
+ import { init_src } from "../../../../packages/gateway-contract/src/index.js";
3
+ import { getOrCreateGatewayIdentity } from "../../../storage/sqlite/gateway-identity-repository.js";
4
+ import { getGatewayPrincipal } from "../../security/gateway-principal.js";
5
+ //#region src/gateway/hono/routes/desktop-chat.ts
6
+ init_src();
7
+ function registerDesktopChatRoutes(authenticated, { service }) {
8
+ authenticated.get("/api/desktop-chat/bootstrap", (c) => {
9
+ c.header("Cache-Control", "no-store");
10
+ const principal = getGatewayPrincipal(c);
11
+ if (principal.kind !== "owner" || !principal.scopes.includes("gateway.admin") || service.getResolvedAuth().mode !== "token") return c.json({
12
+ ok: false,
13
+ error: { code: "OWNER_TOKEN_REQUIRED" }
14
+ }, 403);
15
+ const { id, publicKey } = getOrCreateGatewayIdentity();
16
+ return c.json({
17
+ ok: true,
18
+ payload: {
19
+ gatewayId: id,
20
+ publicKey,
21
+ manifest: c.req.query("chat") === "1" ? {
22
+ ...DESKTOP_CHAT_MANIFEST,
23
+ chat: "text-receipt.v1"
24
+ } : DESKTOP_CHAT_MANIFEST
25
+ }
26
+ });
27
+ });
28
+ }
29
+ //#endregion
30
+ export { registerDesktopChatRoutes };
@@ -0,0 +1,6 @@
1
+ import type { Hono } from 'hono';
2
+ import { type PairingPublicRouteOptions } from '../middleware/public-device-rate-limit.js';
3
+ /** Independently signature-authenticated, purpose-limited stop receipt. It cannot mint tokens, grant scopes or review outcomes. */
4
+ export declare function registerDesktopExecutionStopPublicRoutes(app: Hono, options?: PairingPublicRouteOptions & {
5
+ onStopped?(deviceId: string): void;
6
+ }): void;
@@ -0,0 +1,52 @@
1
+ import { signedDesktopExecutionStopSchema } from "../../../../packages/gateway-contract/src/desktop-execution-stop.js";
2
+ import { init_src } from "../../../../packages/gateway-contract/src/index.js";
3
+ import { getOrCreateGatewayIdentity, signGatewayPayload } from "../../../storage/sqlite/gateway-identity-repository.js";
4
+ import { recordDesktopExecutionStop } from "../../../storage/sqlite/desktop-execution-stop-repository.js";
5
+ import { publicDeviceRateLimit } from "../middleware/public-device-rate-limit.js";
6
+ import { z } from "zod";
7
+ import { bodyLimit } from "hono/body-limit";
8
+ //#region src/gateway/hono/routes/desktop-execution-stop.ts
9
+ init_src();
10
+ /** Independently signature-authenticated, purpose-limited stop receipt. It cannot mint tokens, grant scopes or review outcomes. */
11
+ function registerDesktopExecutionStopPublicRoutes(app, options) {
12
+ const input = z.strictObject({
13
+ signed: signedDesktopExecutionStopSchema,
14
+ nonce: z.string().regex(/^[A-Za-z0-9_-]{32,64}$/)
15
+ });
16
+ app.post("/api/device-auth/execution-stops", publicDeviceRateLimit("execution-stop", options), bodyLimit({
17
+ maxSize: 2048,
18
+ onError: (c) => c.json({
19
+ ok: false,
20
+ error: { code: "BODY_LIMIT" }
21
+ }, 413)
22
+ }), async (c) => {
23
+ c.header("Cache-Control", "no-store");
24
+ const parsed = input.safeParse(await c.req.json().catch(() => null));
25
+ if (!parsed.success) return c.json({
26
+ ok: false,
27
+ error: { code: "BAD_REQUEST" }
28
+ }, 400);
29
+ try {
30
+ const { revokedCurrent, ...result } = recordDesktopExecutionStop(parsed.data.signed);
31
+ if (revokedCurrent) options?.onStopped?.(result.deviceId);
32
+ const signedPayload = Buffer.from(JSON.stringify({
33
+ purpose: "desktop-execution-stop-v1",
34
+ gatewayId: getOrCreateGatewayIdentity().id,
35
+ nonce: parsed.data.nonce,
36
+ issuedAt: Date.now(),
37
+ ...result
38
+ })).toString("base64url");
39
+ return c.json({
40
+ signedPayload,
41
+ signature: signGatewayPayload(signedPayload)
42
+ });
43
+ } catch (error) {
44
+ return c.json({
45
+ ok: false,
46
+ error: { code: error instanceof Error && error.message === "DESKTOP_STOP_CONFLICT" ? "DESKTOP_STOP_CONFLICT" : "DESKTOP_STOP_INVALID" }
47
+ }, 403);
48
+ }
49
+ });
50
+ }
51
+ //#endregion
52
+ export { registerDesktopExecutionStopPublicRoutes };
@@ -0,0 +1,3 @@
1
+ import type { Hono } from 'hono';
2
+ import type { AuthenticatedRouteDeps } from './deps.js';
3
+ export declare function registerDesktopHostRoutes(app: Hono, { service }: AuthenticatedRouteDeps): void;