@xopcai/xopc 0.0.487 → 0.0.489

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 (838) hide show
  1. package/README.md +9 -3
  2. package/README.zh-CN.md +9 -3
  3. package/dist/browser-ext/_locales/en/messages.json +1 -1
  4. package/dist/browser-ext/_locales/zh_CN/messages.json +1 -1
  5. package/dist/browser-ext/dist/assets/{auth-8EjgHa-n.js → page-context-DCkQH5LX.js} +237 -172
  6. package/dist/browser-ext/dist/background.js +650 -108
  7. package/dist/browser-ext/dist/sidepanel.html +1 -1
  8. package/dist/browser-ext/dist/sidepanel.js +22 -4
  9. package/dist/browser-ext/manifest.json +2 -1
  10. package/dist/extensions/dingtalk/src/index.js +54 -10
  11. package/dist/extensions/discord/src/index.js +39 -6
  12. package/dist/extensions/feishu/src/adapters/cli-login.js +1 -1
  13. package/dist/extensions/feishu/src/adapters/gateway-setup.js +1 -1
  14. package/dist/extensions/feishu/src/outbound/media-load.d.ts +1 -0
  15. package/dist/extensions/feishu/src/outbound/media-load.js +2 -2
  16. package/dist/extensions/feishu/src/outbound/outbound-adapter.js +2 -1
  17. package/dist/extensions/feishu/src/pairing/feishu-pairing-prompt.js +1 -1
  18. package/dist/extensions/feishu/src/plugin.js +1 -1
  19. package/dist/extensions/feishu/src/streaming/streaming-adapter.js +1 -1
  20. package/dist/extensions/feishu/src/transport/client/install-sdk.js +2 -2
  21. package/dist/extensions/feishu/src/transport/reliability/message-ingress.js +3 -3
  22. package/dist/extensions/feishu/src/transport/socket-mode/monitor.js +1 -1
  23. package/dist/extensions/slack/src/index.js +51 -1
  24. package/dist/extensions/slack/src/manifest.js +1 -0
  25. package/dist/extensions/telegram/src/adapters/outbound-adapter.js +6 -1
  26. package/dist/extensions/telegram/src/adapters/streaming-adapter.js +3 -3
  27. package/dist/extensions/telegram/src/doctor.js +2 -2
  28. package/dist/extensions/telegram/src/draft-stream.js +1 -1
  29. package/dist/extensions/telegram/src/exec-approval-handler.js +1 -1
  30. package/dist/extensions/telegram/src/focus-handler.js +1 -1
  31. package/dist/extensions/telegram/src/inbound-processor.js +6 -6
  32. package/dist/extensions/telegram/src/outbound-sender.js +7 -6
  33. package/dist/extensions/telegram/src/plugin.js +22 -22
  34. package/dist/extensions/telegram/src/polling-session.js +1 -1
  35. package/dist/extensions/telegram/xopc.extension.json +1 -1
  36. package/dist/extensions/wecom/src/index.js +82 -6
  37. package/dist/extensions/weixin/src/api/api.js +3 -3
  38. package/dist/extensions/weixin/src/auth/accounts.js +14 -14
  39. package/dist/extensions/weixin/src/auth/pairing.js +1 -1
  40. package/dist/extensions/weixin/src/cdn/upload.js +1 -1
  41. package/dist/extensions/weixin/src/cli/gateway-qr-login.js +1 -1
  42. package/dist/extensions/weixin/src/cli/qr-login.js +2 -2
  43. package/dist/extensions/weixin/src/media/data-url.d.ts +1 -0
  44. package/dist/extensions/weixin/src/media/data-url.js +5 -2
  45. package/dist/extensions/weixin/src/messaging/debug-mode.js +6 -6
  46. package/dist/extensions/weixin/src/messaging/inbound.js +13 -13
  47. package/dist/extensions/weixin/src/messaging/process-message.js +4 -4
  48. package/dist/extensions/weixin/src/messaging/quote-cache.js +1 -1
  49. package/dist/extensions/weixin/src/messaging/send.js +1 -1
  50. package/dist/extensions/weixin/src/monitor/monitor.js +2 -2
  51. package/dist/extensions/weixin/src/outbound-send.js +18 -6
  52. package/dist/extensions/weixin/src/plugin.js +3 -3
  53. package/dist/gateway/server/chunks.bin +1767 -1712
  54. package/dist/gateway/server/chunks.json +1 -1
  55. package/dist/gateway/static/root/assets/{activity-store-CWGtissf.js → activity-store-DyHjQrpP.js} +1 -1
  56. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-D4YSq8A9.js → agent-avatar-dicebear-gADhOk89.js} +1 -1
  57. package/dist/gateway/static/root/assets/{agent-avatar-display-DWv7biOS.js → agent-avatar-display-Dyyk4GdM.js} +2 -2
  58. package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-3xdD9dR1.js → agent-defaults-settings-panel-DD5mU7h6.js} +1 -1
  59. package/dist/gateway/static/root/assets/{agent-plugin-dialog-BNvw2z1Y.js → agent-plugin-dialog-RZpnW9HG.js} +1 -1
  60. package/dist/gateway/static/root/assets/{agents-DcENLHHW.js → agents-Ckt9wMj7.js} +3 -3
  61. package/dist/gateway/static/root/assets/{agents-admin-api-BzpxMKwk.js → agents-admin-api-BW3Mzst8.js} +1 -1
  62. package/dist/gateway/static/root/assets/{api-D70-LnNE.js → api-Cd5TqEwc.js} +1 -1
  63. package/dist/gateway/static/root/assets/{api-SIYalfjE.js → api-DVQaJzrB.js} +1 -1
  64. package/dist/gateway/static/root/assets/{app-management-settings-panel-CEveRIMe.js → app-management-settings-panel-Cim6ZmGT.js} +1 -1
  65. package/dist/gateway/static/root/assets/{appearance-settings-CT2NLLuY.js → appearance-settings-BVMDvmUO.js} +1 -1
  66. package/dist/gateway/static/root/assets/{apps-page-pEqr4fAK.js → apps-page-B7T55D7Y.js} +1 -1
  67. package/dist/gateway/static/root/assets/{archive-plugin-xnggGfUN.js → archive-plugin-DVoAuR_a.js} +1 -1
  68. package/dist/gateway/static/root/assets/{automation-api-CaBLskwk.js → automation-api-B6YcuEsE.js} +1 -1
  69. package/dist/gateway/static/root/assets/{automation-result-state-CeGtOXK0.js → automation-result-state-BycWqFXM.js} +1 -1
  70. package/dist/gateway/static/root/assets/{automation-run-list-DUpezxj4.js → automation-run-list-DDDHtKq0.js} +1 -1
  71. package/dist/gateway/static/root/assets/{automation-task-card-CLayJo0S.js → automation-task-card-BBEA23Zb.js} +1 -1
  72. package/dist/gateway/static/root/assets/{automations-page-BKfvaA41.js → automations-page-B3i5x1Lc.js} +1 -1
  73. package/dist/gateway/static/root/assets/{automations-workspace-BRcJzgLA.js → automations-workspace-D6-Kk33X.js} +2 -2
  74. package/dist/gateway/static/root/assets/{binary-plugins-DtD3acS4.js → binary-plugins-o-jwYyMd.js} +1 -1
  75. package/dist/gateway/static/root/assets/{block-editor-DXjBAN8L.js → block-editor-Bp6TLleA.js} +1 -1
  76. package/dist/gateway/static/root/assets/{browser-settings-page-Cgxtr2eR.js → browser-settings-page-CtPARtRA.js} +1 -1
  77. package/dist/gateway/static/root/assets/{capabilities-CpwoMqtm.js → capabilities-B5gHYD8r.js} +1 -1
  78. package/dist/gateway/static/root/assets/{capabilities-DcD15BrU.js → capabilities-G2ZaAAs2.js} +1 -1
  79. package/dist/gateway/static/root/assets/{capabilities-page-x_AS_XJ0.js → capabilities-page-C6KCaaHR.js} +2 -2
  80. package/dist/gateway/static/root/assets/{capabilities-settings-panel-DMgEXxkC.js → capabilities-settings-panel-CVwdxuL4.js} +1 -1
  81. package/dist/gateway/static/root/assets/{channels-565FQAGr.js → channels-Bh2bHLni.js} +1 -1
  82. package/dist/gateway/static/root/assets/{chat-agents-api-BfsNH-ht.js → chat-agents-api-DRKlkcuv.js} +1 -1
  83. package/dist/gateway/static/root/assets/{chat-chart-block-Dpolmx0-.js → chat-chart-block-DxTCx__V.js} +1 -1
  84. package/dist/gateway/static/root/assets/{chat-page-Bn44NcvF.js → chat-page-oy4EGdO1.js} +31 -31
  85. package/dist/gateway/static/root/assets/{chat-terminal-dock-D6fuI2tI.js → chat-terminal-dock-Ch74AWYF.js} +1 -1
  86. package/dist/gateway/static/root/assets/{command-palette-api-H3lCPfK8.js → command-palette-api-CAKoTF_-.js} +1 -1
  87. package/dist/gateway/static/root/assets/{composer-model-config-control-BcWrGT5D.js → composer-model-config-control-Bas1wFVW.js} +1 -1
  88. package/dist/gateway/static/root/assets/{composer-notifications-0fMBrXZD.js → composer-notifications-CpBgWAE4.js} +1 -1
  89. package/dist/gateway/static/root/assets/{composer-payload-handoff-DCGudJjU.js → composer-payload-handoff-uT_hvvap.js} +1 -1
  90. package/dist/gateway/static/root/assets/{computer-settings-page-kvYzJ_j2.js → computer-settings-page-x8YUBBuX.js} +1 -1
  91. package/dist/gateway/static/root/assets/{connected-providers-grid-CApjiM_x.js → connected-providers-grid-DS21-u3Q.js} +1 -1
  92. package/dist/gateway/static/root/assets/{connection-usage-guide-C2qOP6Nx.js → connection-usage-guide-DNNFESD9.js} +1 -1
  93. package/dist/gateway/static/root/assets/{connector-service-page-DKihi3WL.js → connector-service-page-BS7IJ6oc.js} +1 -1
  94. package/dist/gateway/static/root/assets/{connectors-api-Dj9RbG9p.js → connectors-api-B27sJ651.js} +1 -1
  95. package/dist/gateway/static/root/assets/{connectors-page-CR6a3Mne.js → connectors-page-DM6TppXV.js} +1 -1
  96. package/dist/gateway/static/root/assets/{date-picker-BX5tr0IG.js → date-picker-D3N2BGVY.js} +1 -1
  97. package/dist/gateway/static/root/assets/{date-time-picker-CdPsuK2A.js → date-time-picker-BNw099Is.js} +1 -1
  98. package/dist/gateway/static/root/assets/{desktop-pet-DRfOb9ZT.js → desktop-pet-BtY6aGrh.js} +1 -1
  99. package/dist/gateway/static/root/assets/{desktop-pet-settings-D6qCAFLe.js → desktop-pet-settings-DVXfAMaU.js} +1 -1
  100. package/dist/gateway/static/root/assets/{dev-view-store-DrRxtile.js → dev-view-store-D4EyUkRI.js} +1 -1
  101. package/dist/gateway/static/root/assets/{device-connections-panel-Drbw9eRH.js → device-connections-panel-DYK_DQzO.js} +1 -1
  102. package/dist/gateway/static/root/assets/{device-pairing-action-Dd2YtIhH.js → device-pairing-action-DXo8MWy2.js} +1 -1
  103. package/dist/gateway/static/root/assets/{device-pairing-wizard-wtsyHEO3.js → device-pairing-wizard-NddAztJ2.js} +1 -1
  104. package/dist/gateway/static/root/assets/{directory-picker-path-field-B3YBba3x.js → directory-picker-path-field-Bbq7ZyGn.js} +1 -1
  105. package/dist/gateway/static/root/assets/{extension-authoritative-grants-WXYRv5nA.js → extension-authoritative-grants-qpYvHriJ.js} +1 -1
  106. package/dist/gateway/static/root/assets/{extension-debug-page-CKeIq8S2.js → extension-debug-page-BOb-6rpq.js} +1 -1
  107. package/dist/gateway/static/root/assets/{extension-iframe-host-Cv4PCSVv.js → extension-iframe-host-DpgIPfJe.js} +1 -1
  108. package/dist/gateway/static/root/assets/{extension-marketplace-api-e0e9OxOT.js → extension-marketplace-api-BhGNQYHl.js} +1 -1
  109. package/dist/gateway/static/root/assets/{extension-message-router-GPlMiYyF.js → extension-message-router-QjbtEYyu.js} +1 -1
  110. package/dist/gateway/static/root/assets/{extension-page-DcP7IEMp.js → extension-page-BOp7wU9Y.js} +1 -1
  111. package/dist/gateway/static/root/assets/{extension-provider-DZ97b5uA.js → extension-provider-CFPicsnW.js} +1 -1
  112. package/dist/gateway/static/root/assets/{extension-settings-page-DIYoawnA.js → extension-settings-page-cXjBvPwg.js} +1 -1
  113. package/dist/gateway/static/root/assets/{gateway-config-swr-aAsaoOK1.js → gateway-config-swr-DxelrRtx.js} +1 -1
  114. package/dist/gateway/static/root/assets/gateway-realtime-D2B_nv2b.js +1 -0
  115. package/dist/gateway/static/root/assets/gateway-realtime-store-DrVbjYfI.js +1 -0
  116. package/dist/gateway/static/root/assets/{gateway-restart-BY6zJgTe.js → gateway-restart-Ce6rCCAr.js} +1 -1
  117. package/dist/gateway/static/root/assets/{gateway-settings-4TvJ0_i0.js → gateway-settings-BTr0Gwdo.js} +1 -1
  118. package/dist/gateway/static/root/assets/{gateway-startup-retry-D0dDJJQ4.js → gateway-startup-retry-Dm0dK8BT.js} +1 -1
  119. package/dist/gateway/static/root/assets/{global-defaults-api-9iooq81U.js → global-defaults-api-BZnu44eA.js} +1 -1
  120. package/dist/gateway/static/root/assets/{home-page-VMzHth7Q.js → home-page-BmoT_EN4.js} +3 -3
  121. package/dist/gateway/static/root/assets/{home-task-actions-iUYzLb18.js → home-task-actions-Ck0AhcYe.js} +1 -1
  122. package/dist/gateway/static/root/assets/{image-generation-api-Dv4fjHaE.js → image-generation-api-DrZPmWFt.js} +1 -1
  123. package/dist/gateway/static/root/assets/{imports-page-WENCxW7P.js → imports-page-D-x5kijk.js} +1 -1
  124. package/dist/gateway/static/root/assets/index-BiQP7-5r.js +11 -0
  125. package/dist/gateway/static/root/assets/index-CREeN6C_.css +1 -0
  126. package/dist/gateway/static/root/assets/{install-connector-dialog-DNY-rpBC.js → install-connector-dialog-st2O1bez.js} +1 -1
  127. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DHWEGna7.js → keyboard-shortcuts-settings-DnKkQoqR.js} +1 -1
  128. package/dist/gateway/static/root/assets/{local-app-workbench-page-Dnug0YtC.js → local-app-workbench-page-CKHJa4K8.js} +1 -1
  129. package/dist/gateway/static/root/assets/{local-apps-page-Bjr4rrgT.js → local-apps-page-D28d-sO0.js} +1 -1
  130. package/dist/gateway/static/root/assets/{local-session-drafts-Z3PoR-8i.js → local-session-drafts-KkAOxXk5.js} +2 -2
  131. package/dist/gateway/static/root/assets/{locale-store-DgbX5Azb.js → locale-store-Dy0B0XDJ.js} +1 -1
  132. package/dist/gateway/static/root/assets/{logs-page-BIZvtqSJ.js → logs-page-BPuHO-iA.js} +1 -1
  133. package/dist/gateway/static/root/assets/{management-api-CJb5Vclf.js → management-api-BtTRehT0.js} +1 -1
  134. package/dist/gateway/static/root/assets/{management-settings-BjtIRkgJ.js → management-settings-B2R43Itv.js} +1 -1
  135. package/dist/gateway/static/root/assets/{markdown-view-lnMk_L03.js → markdown-view-ByuzuGRb.js} +1 -1
  136. package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-kq0dZ2Nc.js → mcp-conversation-setup-page-D_6XeyXG.js} +1 -1
  137. package/dist/gateway/static/root/assets/{media-plugins-RU49QGcW.js → media-plugins-B9Q7WvNF.js} +1 -1
  138. package/dist/gateway/static/root/assets/messages-Bj6DCoic.js +3 -0
  139. package/dist/gateway/static/root/assets/{model-selector-BolKz5sx.js → model-selector-8FTrQQ2N.js} +1 -1
  140. package/dist/gateway/static/root/assets/{models-hub-cache-CjdnTF5z.js → models-hub-cache-DMBOw544.js} +1 -1
  141. package/dist/gateway/static/root/assets/{new-session-preferences-gb411vZP.js → new-session-preferences-CxCn2Jxk.js} +1 -1
  142. package/dist/gateway/static/root/assets/{note-detail-panel-Qm1Et_f8.js → note-detail-panel-CYNPJVVE.js} +3 -3
  143. package/dist/gateway/static/root/assets/note-image-lightbox-D20oZuOM.js +1 -0
  144. package/dist/gateway/static/root/assets/{notes-api-FjHO1h6b.js → notes-api-M1FuRZbW.js} +1 -1
  145. package/dist/gateway/static/root/assets/{notes-page-B_atfwwi.js → notes-page-Dpd98vQp.js} +1 -1
  146. package/dist/gateway/static/root/assets/{oauth-api-B1lbdI3v.js → oauth-api-Dza1tHcr.js} +1 -1
  147. package/dist/gateway/static/root/assets/{oauth-provider-connect-Cy1Yy8aX.js → oauth-provider-connect-BPNIEiMv.js} +1 -1
  148. package/dist/gateway/static/root/assets/{page-context-capture-button-Phh-SyES.js → page-context-capture-button-DpGnxSrD.js} +1 -1
  149. package/dist/gateway/static/root/assets/{page-context-draft-M04A73Ul.js → page-context-draft-CHAS3BY3.js} +1 -1
  150. package/dist/gateway/static/root/assets/{page-header-store-CYA4Isnf.js → page-header-store-BXED3zhV.js} +1 -1
  151. package/dist/gateway/static/root/assets/{personal-avatar-DF3Frmnt.js → personal-avatar-BCk4KoeZ.js} +1 -1
  152. package/dist/gateway/static/root/assets/{personal-page-DkDROUWV.js → personal-page-BfljqOp5.js} +1 -1
  153. package/dist/gateway/static/root/assets/{personal-profile-settings-LAAXGLKs.js → personal-profile-settings-C86FBPOH.js} +1 -1
  154. package/dist/gateway/static/root/assets/{personal-settings-panel-B6G-4av9.js → personal-settings-panel-BlPLE0Ip.js} +1 -1
  155. package/dist/gateway/static/root/assets/{phone-dependencies-card-DeBlKu7M.js → phone-dependencies-card-BCob98OY.js} +1 -1
  156. package/dist/gateway/static/root/assets/{phone-model-connection-TStZicIQ.js → phone-model-connection-D-CcYcch.js} +1 -1
  157. package/dist/gateway/static/root/assets/{phone-model-picker-C3xcbacO.js → phone-model-picker-eMe7fmZu.js} +1 -1
  158. package/dist/gateway/static/root/assets/{phone-settings-page-CllfdPFi.js → phone-settings-page-D7yXeGmR.js} +1 -1
  159. package/dist/gateway/static/root/assets/{phone-workspace-store-CeP3GXUk.js → phone-workspace-store-CcA_vo-t.js} +1 -1
  160. package/dist/gateway/static/root/assets/{plugin-details-dialog-Ck1dirgu.js → plugin-details-dialog-BAmodjSZ.js} +1 -1
  161. package/dist/gateway/static/root/assets/{preference-select-fields-DMClbggY.js → preference-select-fields-BBd5CWkM.js} +1 -1
  162. package/dist/gateway/static/root/assets/{preview-runtime-Cl-SoLXg.js → preview-runtime-DUJ7XhMP.js} +3 -3
  163. package/dist/gateway/static/root/assets/{product-automation-feedback-Bb_lbw1l.js → product-automation-feedback-BDFpFrSs.js} +1 -1
  164. package/dist/gateway/static/root/assets/{product-open-page-BWH54iuf.js → product-open-page-t3hsoYql.js} +1 -1
  165. package/dist/gateway/static/root/assets/{product-preview-content-NOZu0WO2.js → product-preview-content-BM0pjf0F.js} +1 -1
  166. package/dist/gateway/static/root/assets/{product-preview-modal-ZKiIeKof.js → product-preview-modal-CLQcCVjI.js} +2 -2
  167. package/dist/gateway/static/root/assets/project-detail-page-CcnOT_aq.js +7 -0
  168. package/dist/gateway/static/root/assets/{project-understanding-BWpcOkWw.js → project-understanding-CwtdVbMP.js} +1 -1
  169. package/dist/gateway/static/root/assets/{projects-page-Dnx2AcQX.js → projects-page-ESAmJ4I_.js} +1 -1
  170. package/dist/gateway/static/root/assets/{providers-api-BRAMBKCK.js → providers-api-CR7FJzt-.js} +1 -1
  171. package/dist/gateway/static/root/assets/{recording-upload-C0d2YjJV.js → recording-upload-DrgujKBt.js} +1 -1
  172. package/dist/gateway/static/root/assets/{registry-api-Dz4umdY3.js → registry-api-CaBz9f4g.js} +1 -1
  173. package/dist/gateway/static/root/assets/{remote-access-hub-BEIzBYdj.js → remote-access-hub-CB-Js5gd.js} +1 -1
  174. package/dist/gateway/static/root/assets/{resource-unavailable-82byHwG_.js → resource-unavailable-DiPPmZsR.js} +1 -1
  175. package/dist/gateway/static/root/assets/right-workspace-store-DsVm6C0V.js +1 -0
  176. package/dist/gateway/static/root/assets/{route-preload-DkUojqyb.js → route-preload-CsBdFJHO.js} +2 -2
  177. package/dist/gateway/static/root/assets/{routine-panel-wJxaH-1V.js → routine-panel-pVuJtctD.js} +2 -2
  178. package/dist/gateway/static/root/assets/{runtime-tools-api-CQ7fTX-H.js → runtime-tools-api-utBemmh4.js} +1 -1
  179. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DZD-cEXM.js → runtime-tools-settings-panel-ChXrIluB.js} +1 -1
  180. package/dist/gateway/static/root/assets/{service-recommendation-list-CFJ8WBzq.js → service-recommendation-list-Dm5GcMRy.js} +1 -1
  181. package/dist/gateway/static/root/assets/{session-api-Dxhtjzoa.js → session-api-vEn4BzjV.js} +1 -1
  182. package/dist/gateway/static/root/assets/{session-manager-DvIGR4Sw.js → session-manager-7nbjJYyy.js} +2 -2
  183. package/dist/gateway/static/root/assets/{sessions-page-BDPieIpD.js → sessions-page-B__ftjgG.js} +1 -1
  184. package/dist/gateway/static/root/assets/settings-advanced-gate-DV-_ZdXD.js +1 -0
  185. package/dist/gateway/static/root/assets/{settings-advanced-section-1R7xRVEG.js → settings-advanced-section-DhKzGl03.js} +1 -1
  186. package/dist/gateway/static/root/assets/{settings-mode-store-D4-i8uQI.js → settings-mode-store-CQofc337.js} +1 -1
  187. package/dist/gateway/static/root/assets/{settings-page-DXo8rZFt.js → settings-page-BRAijVXZ.js} +1 -1
  188. package/dist/gateway/static/root/assets/{settings-page-header-BooYRGUH.js → settings-page-header-CiS6x6sn.js} +1 -1
  189. package/dist/gateway/static/root/assets/{settings-page-layout-BeHnqGAN.js → settings-page-layout-B-rj_rso.js} +1 -1
  190. package/dist/gateway/static/root/assets/{setup-interaction-page-DqmPSRNo.js → setup-interaction-page-DTgwtj55.js} +1 -1
  191. package/dist/gateway/static/root/assets/{setup-status-panel-c4yDTYiK.js → setup-status-panel-BhKPMIds.js} +1 -1
  192. package/dist/gateway/static/root/assets/{share-link-dialog-Cvma1jxB.js → share-link-dialog-WR7Op1vL.js} +1 -1
  193. package/dist/gateway/static/root/assets/{share-preview-page-BL6FwL4u.js → share-preview-page-DonmTI11.js} +1 -1
  194. package/dist/gateway/static/root/assets/{shares-api-BqIBNEtd.js → shares-api-CoRLwDnw.js} +1 -1
  195. package/dist/gateway/static/root/assets/{shares-settings-BoBOd-eB.js → shares-settings-UA91fiMV.js} +1 -1
  196. package/dist/gateway/static/root/assets/{skill-api-oDg0Zlyb.js → skill-api-BE-iPtTQ.js} +1 -1
  197. package/dist/gateway/static/root/assets/{skill-list-api-BvfKctht.js → skill-list-api-Dsfjdtuu.js} +1 -1
  198. package/dist/gateway/static/root/assets/{skill-reload-api-CnchMEV8.js → skill-reload-api-BIZJWow-.js} +1 -1
  199. package/dist/gateway/static/root/assets/{skills-page-CFZk_0nE.js → skills-page-1wvItQag.js} +1 -1
  200. package/dist/gateway/static/root/assets/{space-api-C_GoZOc_.js → space-api-E8VbAaEl.js} +1 -1
  201. package/dist/gateway/static/root/assets/space-page-CUwakPrj.js +2 -0
  202. package/dist/gateway/static/root/assets/{space-workbook-B8JGuyIf.js → space-workbook-CwltZeHG.js} +1 -1
  203. package/dist/gateway/static/root/assets/{system-settings-panel-DzNDyMOH.js → system-settings-panel-03a25GEc.js} +1 -1
  204. package/dist/gateway/static/root/assets/{task-detail-page-BmWkL-KH.js → task-detail-page-Cvx-XtFO.js} +1 -1
  205. package/dist/gateway/static/root/assets/{task-header-title-CCaEJNV4.js → task-header-title-DHb7z-hq.js} +1 -1
  206. package/dist/gateway/static/root/assets/{task-result-presentation-DwEf7Xf7.js → task-result-presentation-_VWkiekf.js} +1 -1
  207. package/dist/gateway/static/root/assets/{task-run-issue-notice-COE7ppvl.js → task-run-issue-notice-CqjS8_gi.js} +1 -1
  208. package/dist/gateway/static/root/assets/{tasks-CvOAtEHv.js → tasks-D8bnpu0N.js} +1 -1
  209. package/dist/gateway/static/root/assets/{terminal-panel-store-CHQ2xJtk.js → terminal-panel-store-BOHv5O2x.js} +1 -1
  210. package/dist/gateway/static/root/assets/{theme-store-Bij94a-6.js → theme-store-XNsFzxSj.js} +1 -1
  211. package/dist/gateway/static/root/assets/{tracing-settings-page-CKH4dKSl.js → tracing-settings-page-Y9z2HoGj.js} +1 -1
  212. package/dist/gateway/static/root/assets/{tunnel-api-ChjCCCGL.js → tunnel-api-XHGjcUi9.js} +1 -1
  213. package/dist/gateway/static/root/assets/turn-outcome-Bf3N3Bmj.js +1 -0
  214. package/dist/gateway/static/root/assets/{understanding-activity-store-BD1OXjlI.js → understanding-activity-store-BDBAkksk.js} +1 -1
  215. package/dist/gateway/static/root/assets/{understanding-refresh-store-BSVLFuVh.js → understanding-refresh-store-D7gBfD26.js} +1 -1
  216. package/dist/gateway/static/root/assets/{usage-page-v5c3aC-p.js → usage-page-DxESTMwa.js} +1 -1
  217. package/dist/gateway/static/root/assets/{use-autosave-teDzNJW4.js → use-autosave-D7zZrcsj.js} +1 -1
  218. package/dist/gateway/static/root/assets/{use-composer-attachments-rUl5n4_a.js → use-composer-attachments-CQwCTKAp.js} +1 -1
  219. package/dist/gateway/static/root/assets/{use-file-preview-expanded-BRjXpRde.js → use-file-preview-expanded-CA9vFUTT.js} +1 -1
  220. package/dist/gateway/static/root/assets/{use-generated-media-Bx6BscUT.js → use-generated-media-DX4_ne7C.js} +1 -1
  221. package/dist/gateway/static/root/assets/{use-personal-profile-Dz3wWaGt.js → use-personal-profile-CaCORKeL.js} +1 -1
  222. package/dist/gateway/static/root/assets/{use-personal-work-D-Tgi4DZ.js → use-personal-work-fvvZDK_7.js} +1 -1
  223. package/dist/gateway/static/root/assets/{use-realtime-voice-Bp81D6PV.js → use-realtime-voice-D9k997EW.js} +1 -1
  224. package/dist/gateway/static/root/assets/{use-share-link-D5HNXEIt.js → use-share-link-CqV3o-VZ.js} +1 -1
  225. package/dist/gateway/static/root/assets/{use-workspace-tree-DXKhfc1T.js → use-workspace-tree-nnrez9-d.js} +1 -1
  226. package/dist/gateway/static/root/assets/{user-model-page-B0tEc4rh.js → user-model-page-CpVdbSxS.js} +1 -1
  227. package/dist/gateway/static/root/assets/{voice-api-key-field-odum3GZx.js → voice-api-key-field-CVi3dBKx.js} +1 -1
  228. package/dist/gateway/static/root/assets/{voice-config-api-CiA2cr3s.js → voice-config-api-DZbcg7qD.js} +1 -1
  229. package/dist/gateway/static/root/assets/{voice-input-shortcut-events-JsEfJGJz.js → voice-input-shortcut-events-CwKpIInD.js} +1 -1
  230. package/dist/gateway/static/root/assets/{voice-player-store-CUV5cpmX.js → voice-player-store-DT0f9GPa.js} +1 -1
  231. package/dist/gateway/static/root/assets/{voice-settings-FOeRWVH4.js → voice-settings-CJdWnHas.js} +1 -1
  232. package/dist/gateway/static/root/assets/{work-discovery-overlay-CJxXUdeq.js → work-discovery-overlay-qEN1Ikir.js} +1 -1
  233. package/dist/gateway/static/root/assets/{work-discovery-page-Dm0XTxsk.js → work-discovery-page-JjCyt1Kw.js} +1 -1
  234. package/dist/gateway/static/root/assets/{working-directory-picker-modal-DfyyBJpb.js → working-directory-picker-modal-DX6bRmkQ.js} +1 -1
  235. package/dist/gateway/static/root/assets/{workspace-api-B1JW3oZZ.js → workspace-api-CD_6YyPI.js} +2 -2
  236. package/dist/gateway/static/root/assets/workspace-editor-agent-store-BuYdf4CO.js +1 -0
  237. package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-kGa6o4bV.js → workspace-file-preview-dialog-DdVyIRKm.js} +1 -1
  238. package/dist/gateway/static/root/assets/{workspace-open-location-menu-Dl4QsZL3.js → workspace-open-location-menu-BdXn5F2i.js} +1 -1
  239. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-fiyk59YU.js → xopc-cloud-account-card-CLM7hfkN.js} +1 -1
  240. package/dist/gateway/static/root/index.html +96 -96
  241. package/dist/package.js +1 -1
  242. package/dist/packages/gateway-contract/src/session-input-command.js +2 -1
  243. package/dist/packages/gateway-contract/src/task-display.js +1 -1
  244. package/dist/packages/gateway-contract/src/task-research-result.js +5 -0
  245. package/dist/packages/realtime-client/src/index.js +6 -1
  246. package/dist/packages/realtime-protocol/src/browser-preview.js +111 -0
  247. package/dist/packages/realtime-protocol/src/index.js +5 -1
  248. package/dist/src/activity/emitter.js +1 -1
  249. package/dist/src/agent/agent-manager.d.ts +2 -2
  250. package/dist/src/agent/agent-manager.js +26 -23
  251. package/dist/src/agent/agent-scope.js +2 -2
  252. package/dist/src/agent/background-review/prompts.js +1 -1
  253. package/dist/src/agent/background-review/run-background-review.js +12 -12
  254. package/dist/src/agent/child-agent-factory.js +4 -4
  255. package/dist/src/agent/coding/repository-instructions.js +1 -1
  256. package/dist/src/agent/coding/workspace-revision.js +1 -1
  257. package/dist/src/agent/commands/command-isolation.js +1 -1
  258. package/dist/src/agent/commands/command-registry.js +1 -1
  259. package/dist/src/agent/context/coordinator.js +3 -3
  260. package/dist/src/agent/context/deep-recall.js +5 -5
  261. package/dist/src/agent/context/execution-context.js +1 -1
  262. package/dist/src/agent/context/project-context.js +4 -4
  263. package/dist/src/agent/context/workspace-seed.js +1 -1
  264. package/dist/src/agent/data-acquisition/git.js +1 -1
  265. package/dist/src/agent/data-acquisition/service.js +2 -2
  266. package/dist/src/agent/embedded/codemode-extension.js +1 -1
  267. package/dist/src/agent/embedded/codemode-output.js +2 -2
  268. package/dist/src/agent/embedded/execution-tool-policy.js +1 -1
  269. package/dist/src/agent/embedded/external-tool-discovery.js +1 -1
  270. package/dist/src/agent/embedded/index.js +1 -1
  271. package/dist/src/agent/embedded/model-runtime.js +1 -1
  272. package/dist/src/agent/embedded/run-for-session.js +14 -14
  273. package/dist/src/agent/embedded/run-turn.js +100 -35
  274. package/dist/src/agent/embedded/session-runner.js +7 -6
  275. package/dist/src/agent/embedded/types.d.ts +1 -1
  276. package/dist/src/agent/embedded/xopc-stream-bridge.js +3 -3
  277. package/dist/src/agent/embedded/xopc-tools-bridge.js +1 -1
  278. package/dist/src/agent/external-tools/cliProvider.js +5 -5
  279. package/dist/src/agent/external-tools/composio-provider.js +3 -3
  280. package/dist/src/agent/external-tools/endpoint-provider.js +9 -9
  281. package/dist/src/agent/external-tools/extension-provider.js +1 -1
  282. package/dist/src/agent/external-tools/gateway-tools.js +3 -3
  283. package/dist/src/agent/external-tools/index.js +1 -1
  284. package/dist/src/agent/external-tools/memory-provider.js +1 -1
  285. package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
  286. package/dist/src/agent/image/generation/providers/xopc-cloud.js +2 -2
  287. package/dist/src/agent/image/generation/runtime.js +1 -1
  288. package/dist/src/agent/image/index.js +1 -1
  289. package/dist/src/agent/image/load-image-media.js +2 -2
  290. package/dist/src/agent/image/tool-model-config.js +1 -1
  291. package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
  292. package/dist/src/agent/inbound/inbound-loop.js +9 -4
  293. package/dist/src/agent/independent-execution.js +3 -3
  294. package/dist/src/agent/index.js +1 -1
  295. package/dist/src/agent/mcp/connection-drafts.js +2 -2
  296. package/dist/src/agent/mcp/connection-setup.js +1 -1
  297. package/dist/src/agent/mcp/conversation-setup.js +1 -1
  298. package/dist/src/agent/mcp/discovery.js +2 -2
  299. package/dist/src/agent/mcp/managed-discovery.js +1 -1
  300. package/dist/src/agent/mcp/tool-catalog.js +1 -1
  301. package/dist/src/agent/mcp/weixin-setup-scope.js +2 -2
  302. package/dist/src/agent/memory/index.js +1 -1
  303. package/dist/src/agent/messaging/command-handler.js +1 -1
  304. package/dist/src/agent/messaging/outbound-coordinator.js +1 -1
  305. package/dist/src/agent/orchestration/agent-orchestrator.js +1 -1
  306. package/dist/src/agent/orchestration/child-run-resume.js +3 -3
  307. package/dist/src/agent/orchestration/llm-turn-retry.js +1 -1
  308. package/dist/src/agent/prompt/response-language.js +1 -1
  309. package/dist/src/agent/prompt/sections/tooling.d.ts +1 -0
  310. package/dist/src/agent/prompt/sections/tooling.js +7 -2
  311. package/dist/src/agent/prompt/service-prompt-builder.js +3 -3
  312. package/dist/src/agent/prompt/system-prompt.js +1 -0
  313. package/dist/src/agent/sandbox/exec-policy.js +2 -2
  314. package/dist/src/agent/sandbox/native-command.js +1 -1
  315. package/dist/src/agent/sandbox/path-policy.js +1 -1
  316. package/dist/src/agent/service/direct-turn-helpers.js +3 -3
  317. package/dist/src/agent/service/process-direct-streaming.js +7 -7
  318. package/dist/src/agent/service/webchat-tts.js +3 -3
  319. package/dist/src/agent/service.js +23 -21
  320. package/dist/src/agent/session/session-config-service.js +2 -2
  321. package/dist/src/agent/session/session-hydrator.js +1 -1
  322. package/dist/src/agent/session/session-inspector.js +1 -1
  323. package/dist/src/agent/skills/hub-hash.js +1 -1
  324. package/dist/src/agent/skills/hub-lock.js +1 -1
  325. package/dist/src/agent/skills/hub-pull.js +3 -3
  326. package/dist/src/agent/skills/index.js +1 -1
  327. package/dist/src/agent/skills/managed-store.js +1 -1
  328. package/dist/src/agent/skills/skill-manage-ops.js +1 -1
  329. package/dist/src/agent/skills/skill-manager.js +1 -1
  330. package/dist/src/agent/skills/skill-sources.js +2 -2
  331. package/dist/src/agent/tasks/task-judge-service.js +7 -7
  332. package/dist/src/agent/tools/browser/tool/browser-use-tool.js +71 -17
  333. package/dist/src/agent/tools/browser/tool/schemas.d.ts +3 -1
  334. package/dist/src/agent/tools/browser/tool/schemas.js +12 -1
  335. package/dist/src/agent/tools/communication.d.ts +1 -0
  336. package/dist/src/agent/tools/communication.js +10 -3
  337. package/dist/src/agent/tools/create-share-tool.js +1 -1
  338. package/dist/src/agent/tools/delegate-tool.js +4 -4
  339. package/dist/src/agent/tools/exec-command.js +1 -1
  340. package/dist/src/agent/tools/factory.js +38 -21
  341. package/dist/src/agent/tools/image-generate-tool.d.ts +7 -0
  342. package/dist/src/agent/tools/image-generate-tool.js +23 -3
  343. package/dist/src/agent/tools/index.js +4 -4
  344. package/dist/src/agent/tools/knowledge-memory-tool.js +1 -1
  345. package/dist/src/agent/tools/managed-job-tool.js +1 -1
  346. package/dist/src/agent/tools/personal-attention-tool.js +1 -1
  347. package/dist/src/agent/tools/personal-memory-tool.js +4 -4
  348. package/dist/src/agent/tools/personal-read-tool.js +1 -1
  349. package/dist/src/agent/tools/personal-request-result-tool.js +2 -2
  350. package/dist/src/agent/tools/personal-request-tool.js +2 -2
  351. package/dist/src/agent/tools/personal-result-tool.js +1 -1
  352. package/dist/src/agent/tools/personal-task-tool.js +84 -21
  353. package/dist/src/agent/tools/publish-artifacts.js +1 -1
  354. package/dist/src/agent/tools/read.js +1 -1
  355. package/dist/src/agent/tools/review-workspace.js +2 -2
  356. package/dist/src/agent/tools/scoped-workspace-tools.js +1 -1
  357. package/dist/src/agent/tools/send-media.d.ts +1 -0
  358. package/dist/src/agent/tools/send-media.js +7 -4
  359. package/dist/src/agent/tools/session-recall-tool.js +10 -2
  360. package/dist/src/agent/tools/session-search-tool.js +2 -2
  361. package/dist/src/agent/tools/task-collaboration-tool.js +2 -2
  362. package/dist/src/agent/tools/task-result-tool.js +10 -9
  363. package/dist/src/agent/tools/tool-media.d.ts +1 -0
  364. package/dist/src/agent/tools/tool-media.js +14 -1
  365. package/dist/src/agent/tools/tts-tool.js +1 -1
  366. package/dist/src/agent/tools/user-context-tool.js +1 -1
  367. package/dist/src/agent/tools/web-extract.js +1 -1
  368. package/dist/src/agent/tools/web.js +6 -4
  369. package/dist/src/agent/tools/workbook-tools.js +1 -1
  370. package/dist/src/agent/tools/write.js +1 -1
  371. package/dist/src/agent/tools/xopc-use-tool.js +11 -11
  372. package/dist/src/agent-catalog/capabilities.js +1 -1
  373. package/dist/src/agent-catalog/repository.js +1 -1
  374. package/dist/src/ai-assist/text-assist.js +1 -1
  375. package/dist/src/auth/credentials.js +1 -1
  376. package/dist/src/auth/oauth/openai.js +1 -1
  377. package/dist/src/auth/oauth/xopc-cloud.js +1 -1
  378. package/dist/src/auth/oauth-provider-lock.js +1 -1
  379. package/dist/src/auth/profiles/store.js +1 -1
  380. package/dist/src/auth/sync-provider-auth.js +1 -1
  381. package/dist/src/automations/capabilities/write.js +1 -1
  382. package/dist/src/automations/delivery/delivery-router.js +1 -1
  383. package/dist/src/automations/domain/index.js +1 -1
  384. package/dist/src/automations/draft/automation-draft-service.js +1 -1
  385. package/dist/src/automations/index.js +2 -2
  386. package/dist/src/automations/service/action-executor.js +1 -1
  387. package/dist/src/automations/service/automation-service.js +3 -3
  388. package/dist/src/backup/archive.js +4 -4
  389. package/dist/src/bootstrap/application-state.js +1 -1
  390. package/dist/src/browser/assistance.d.ts +34 -0
  391. package/dist/src/browser/assistance.js +243 -0
  392. package/dist/src/browser/cache-dir-policy.js +1 -1
  393. package/dist/src/browser/drivers/browser-driver.d.ts +45 -0
  394. package/dist/src/browser/drivers/extension-driver.d.ts +2 -0
  395. package/dist/src/browser/drivers/extension-driver.js +11 -1
  396. package/dist/src/browser/drivers/playwright-driver.d.ts +2 -1
  397. package/dist/src/browser/drivers/playwright-driver.js +161 -0
  398. package/dist/src/browser/managed-live-runtime.d.ts +79 -0
  399. package/dist/src/browser/managed-live-runtime.js +313 -0
  400. package/dist/src/browser/native-messaging-host.js +2 -2
  401. package/dist/src/browser/providers/browser-ext-install.js +4 -4
  402. package/dist/src/browser/runtime/browser-runtime.d.ts +24 -1
  403. package/dist/src/browser/runtime/browser-runtime.js +68 -5
  404. package/dist/src/capabilities/capability-catalog.js +3 -3
  405. package/dist/src/capabilities/readiness/from-config.js +2 -2
  406. package/dist/src/capabilities/runtime/dispatcher.js +1 -1
  407. package/dist/src/channels/channel-domain.d.ts +1 -0
  408. package/dist/src/channels/enterprise/media.d.ts +14 -0
  409. package/dist/src/channels/enterprise/media.js +208 -0
  410. package/dist/src/channels/enterprise/plugin.d.ts +4 -0
  411. package/dist/src/channels/enterprise/plugin.js +40 -12
  412. package/dist/src/channels/format.js +1 -1
  413. package/dist/src/channels/index.js +2 -2
  414. package/dist/src/channels/internal-outbound.d.ts +2 -0
  415. package/dist/src/channels/internal-outbound.js +17 -1
  416. package/dist/src/channels/lifecycle-supervisor.js +1 -1
  417. package/dist/src/channels/outbound-sender.js +1 -1
  418. package/dist/src/channels/pairing/allow-from-file.js +9 -9
  419. package/dist/src/channels/pairing/pairing-service.js +1 -1
  420. package/dist/src/channels/pairing/pairing-store.js +6 -6
  421. package/dist/src/chat-commands/agent-edit.js +1 -1
  422. package/dist/src/chat-commands/builtins/config.js +4 -4
  423. package/dist/src/chat-commands/builtins/review.js +1 -1
  424. package/dist/src/chat-commands/builtins/tts.js +1 -1
  425. package/dist/src/chat-commands/builtins/understanding.js +1 -1
  426. package/dist/src/chat-commands/context.js +2 -2
  427. package/dist/src/chat-commands/index.js +2 -2
  428. package/dist/src/cli/commands/agent.js +7 -7
  429. package/dist/src/cli/commands/browser-cli-helpers.js +1 -1
  430. package/dist/src/cli/commands/config.js +1 -1
  431. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  432. package/dist/src/cli/commands/doctor/checks/image-providers.js +1 -1
  433. package/dist/src/cli/commands/doctor/checks/provider-auth.js +2 -2
  434. package/dist/src/cli/commands/doctor/checks/tool-runtimes.js +1 -1
  435. package/dist/src/cli/commands/extension-agent-plugin.js +3 -3
  436. package/dist/src/cli/commands/extension-dev.js +1 -1
  437. package/dist/src/cli/commands/extension-marketplace.js +3 -3
  438. package/dist/src/cli/commands/extension-pack.js +1 -1
  439. package/dist/src/cli/commands/extension.js +2 -2
  440. package/dist/src/cli/commands/image.js +1 -1
  441. package/dist/src/cli/commands/init.js +1 -1
  442. package/dist/src/cli/commands/mcp.js +2 -2
  443. package/dist/src/cli/commands/models.js +5 -5
  444. package/dist/src/cli/commands/onboard/model.js +2 -2
  445. package/dist/src/cli/commands/onboard.js +1 -1
  446. package/dist/src/cli/commands/project.js +2 -2
  447. package/dist/src/cli/commands/runtime.js +1 -1
  448. package/dist/src/cli/commands/skills.js +2 -2
  449. package/dist/src/cli/commands/tunnel.js +3 -3
  450. package/dist/src/cli/extension-cli-register.js +5 -5
  451. package/dist/src/cli/utils/gateway-client.js +1 -1
  452. package/dist/src/cli/utils/init-workspace-core.js +3 -3
  453. package/dist/src/computer/broker.js +1 -1
  454. package/dist/src/computer/model-adapter.js +1 -1
  455. package/dist/src/computer/runtime.js +12 -12
  456. package/dist/src/config/config-file.js +1 -1
  457. package/dist/src/config/index.js +6 -6
  458. package/dist/src/config/loader.js +2 -2
  459. package/dist/src/config/models-json.js +1 -1
  460. package/dist/src/config/paths-state.js +1 -1
  461. package/dist/src/config/schema.js +2 -2
  462. package/dist/src/config/workspace-path.js +1 -1
  463. package/dist/src/connectors/cli/authorization.js +1 -1
  464. package/dist/src/connectors/cli/installer.js +1 -1
  465. package/dist/src/connectors/connected-source-ingestion.js +2 -2
  466. package/dist/src/connectors/connected-source-understanding.js +4 -4
  467. package/dist/src/connectors/connection-recovery-service.js +4 -4
  468. package/dist/src/connectors/content-enrichment.js +2 -2
  469. package/dist/src/connectors/health.js +1 -1
  470. package/dist/src/daemon/constants.js +1 -1
  471. package/dist/src/daemon/install-plan.js +1 -1
  472. package/dist/src/daemon/launchd.js +1 -1
  473. package/dist/src/daemon/schtasks.js +1 -1
  474. package/dist/src/daemon/systemd.js +1 -1
  475. package/dist/src/discussions/action-tasks.js +1 -1
  476. package/dist/src/discussions/live-worker.js +1 -1
  477. package/dist/src/discussions/recording.js +2 -2
  478. package/dist/src/discussions/repository.js +1 -1
  479. package/dist/src/discussions/sealer.js +2 -2
  480. package/dist/src/discussions/service.js +1 -1
  481. package/dist/src/endpoint-tools/delegation.js +1 -1
  482. package/dist/src/endpoint-tools/invocation-service.js +2 -2
  483. package/dist/src/endpoint-tools/target-resolver.js +1 -1
  484. package/dist/src/endpoint-tools/upload-service.js +1 -1
  485. package/dist/src/execution-environments/local-worktree-manager.js +1 -1
  486. package/dist/src/execution-environments/session-environment-service.js +1 -1
  487. package/dist/src/execution-environments/worktree-safety.js +1 -1
  488. package/dist/src/extensions/activation-context.js +4 -4
  489. package/dist/src/extensions/agent-plugins/auth.js +2 -2
  490. package/dist/src/extensions/agent-plugins/branding.js +1 -1
  491. package/dist/src/extensions/agent-plugins/cli-authorization.js +2 -2
  492. package/dist/src/extensions/agent-plugins/mcp-adapter.js +2 -2
  493. package/dist/src/extensions/agent-plugins/resources.js +1 -1
  494. package/dist/src/extensions/agent-plugins/setup.js +2 -2
  495. package/dist/src/extensions/agent-plugins/skill-catalog.js +2 -2
  496. package/dist/src/extensions/agent-plugins/source-catalog.js +2 -2
  497. package/dist/src/extensions/agent-plugins/sources.js +1 -1
  498. package/dist/src/extensions/agent-plugins/store.js +2 -2
  499. package/dist/src/extensions/agent-plugins/user-config.js +1 -1
  500. package/dist/src/extensions/agent-plugins/validation.js +2 -2
  501. package/dist/src/extensions/api.js +2 -2
  502. package/dist/src/extensions/bundled-extension-activation.js +1 -1
  503. package/dist/src/extensions/index.js +1 -1
  504. package/dist/src/extensions/loader.js +3 -3
  505. package/dist/src/extensions/lockfile.js +1 -1
  506. package/dist/src/extensions/sdk/index.js +1 -1
  507. package/dist/src/extensions/sdk/media.js +1 -1
  508. package/dist/src/extensions/update.js +2 -2
  509. package/dist/src/files/file-service.js +1 -1
  510. package/dist/src/files/workspace-file-spaces.js +1 -1
  511. package/dist/src/gateway/agent-reactions/reaction.js +2 -2
  512. package/dist/src/gateway/agents-admin.js +1 -1
  513. package/dist/src/gateway/device-routes.js +1 -1
  514. package/dist/src/gateway/file-path-classifier.js +2 -2
  515. package/dist/src/gateway/global-defaults-admin.js +1 -1
  516. package/dist/src/gateway/hono/app.js +2 -2
  517. package/dist/src/gateway/hono/lib/config-payload.js +5 -5
  518. package/dist/src/gateway/hono/lib/static-ui.js +1 -1
  519. package/dist/src/gateway/hono/oauth-async.js +1 -1
  520. package/dist/src/gateway/hono/routes/agent-plugins.js +2 -2
  521. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +7 -7
  522. package/dist/src/gateway/hono/routes/browser.js +297 -1
  523. package/dist/src/gateway/hono/routes/channels.js +1 -1
  524. package/dist/src/gateway/hono/routes/commands-skills.js +5 -5
  525. package/dist/src/gateway/hono/routes/config-patch/gateway.js +1 -1
  526. package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
  527. package/dist/src/gateway/hono/routes/connectors.js +1 -1
  528. package/dist/src/gateway/hono/routes/device-connections.js +3 -3
  529. package/dist/src/gateway/hono/routes/device-push.js +7 -2
  530. package/dist/src/gateway/hono/routes/device-targets.js +1 -1
  531. package/dist/src/gateway/hono/routes/endpoint-tools.js +1 -1
  532. package/dist/src/gateway/hono/routes/execution-environments.js +4 -0
  533. package/dist/src/gateway/hono/routes/files.js +1 -1
  534. package/dist/src/gateway/hono/routes/home.js +1 -1
  535. package/dist/src/gateway/hono/routes/host-fs.js +1 -1
  536. package/dist/src/gateway/hono/routes/local-app-capabilities.js +1 -1
  537. package/dist/src/gateway/hono/routes/local-apps.js +1 -1
  538. package/dist/src/gateway/hono/routes/location-sharing.js +1 -1
  539. package/dist/src/gateway/hono/routes/mcp.js +1 -1
  540. package/dist/src/gateway/hono/routes/memory-learning.js +2 -2
  541. package/dist/src/gateway/hono/routes/mobile-capability-actions.js +5 -5
  542. package/dist/src/gateway/hono/routes/mobile-capability-panels.js +13 -13
  543. package/dist/src/gateway/hono/routes/mobile-model-settings.js +16 -8
  544. package/dist/src/gateway/hono/routes/models.js +10 -10
  545. package/dist/src/gateway/hono/routes/music-generation.js +1 -1
  546. package/dist/src/gateway/hono/routes/notes.js +3 -3
  547. package/dist/src/gateway/hono/routes/notifications.js +11 -7
  548. package/dist/src/gateway/hono/routes/observability.js +1 -1
  549. package/dist/src/gateway/hono/routes/personal-agent.js +2 -2
  550. package/dist/src/gateway/hono/routes/phone-setup.js +4 -4
  551. package/dist/src/gateway/hono/routes/phone.js +2 -2
  552. package/dist/src/gateway/hono/routes/projects.js +7 -8
  553. package/dist/src/gateway/hono/routes/session-command-handler.js +3 -2
  554. package/dist/src/gateway/hono/routes/session-input-handler.d.ts +2 -0
  555. package/dist/src/gateway/hono/routes/session-input-handler.js +3 -3
  556. package/dist/src/gateway/hono/routes/sessions.js +3 -3
  557. package/dist/src/gateway/hono/routes/shares.js +3 -3
  558. package/dist/src/gateway/hono/routes/side-chats.js +1 -1
  559. package/dist/src/gateway/hono/routes/status.js +1 -1
  560. package/dist/src/gateway/hono/routes/tasks.js +1 -1
  561. package/dist/src/gateway/hono/routes/tui.js +1 -1
  562. package/dist/src/gateway/hono/routes/user-model.js +6 -6
  563. package/dist/src/gateway/hono/routes/video-generation.js +2 -2
  564. package/dist/src/gateway/hono/routes/voice.js +8 -8
  565. package/dist/src/gateway/image-generation-setup.js +2 -2
  566. package/dist/src/gateway/lock.js +11 -11
  567. package/dist/src/gateway/media-access.js +2 -2
  568. package/dist/src/gateway/mobile-privacy.js +2 -2
  569. package/dist/src/gateway/next-turn-suggestions/snapshot.js +1 -1
  570. package/dist/src/gateway/ports.js +7 -7
  571. package/dist/src/gateway/provider-model-setup.js +2 -2
  572. package/dist/src/gateway/security/device-request-proof.js +1 -1
  573. package/dist/src/gateway/security/gateway-scopes.js +4 -0
  574. package/dist/src/gateway/server.js +1 -1
  575. package/dist/src/gateway/service/agent-runner.js +3 -3
  576. package/dist/src/gateway/service/config-coordinator.js +4 -4
  577. package/dist/src/gateway/service/marketplace-service.js +2 -2
  578. package/dist/src/gateway/service/run-gateway-agent.js +9 -7
  579. package/dist/src/gateway/service/session-command-service.js +6 -4
  580. package/dist/src/gateway/service/session-input-coordinator.d.ts +1 -0
  581. package/dist/src/gateway/service/session-input-coordinator.js +14 -4
  582. package/dist/src/gateway/service/session-preparation-worker.js +6 -2
  583. package/dist/src/gateway/service/sessions-api.js +1 -1
  584. package/dist/src/gateway/service.d.ts +6 -0
  585. package/dist/src/gateway/service.js +86 -47
  586. package/dist/src/gateway/session-context-summary.js +1 -1
  587. package/dist/src/gateway/workspace-editor-path.js +2 -2
  588. package/dist/src/gateway/xopc-cloud-capability-setup.js +4 -4
  589. package/dist/src/home-intelligence/follow-ups.js +2 -2
  590. package/dist/src/home-intelligence/generator.js +2 -2
  591. package/dist/src/home-intelligence/host.js +1 -1
  592. package/dist/src/home-intelligence/observation.js +1 -1
  593. package/dist/src/home-intelligence/repository.js +1 -1
  594. package/dist/src/home-intelligence/routines.js +3 -3
  595. package/dist/src/imports/files.js +1 -1
  596. package/dist/src/imports/importService.js +1 -1
  597. package/dist/src/imports/inventory.js +3 -3
  598. package/dist/src/imports/planner.js +1 -1
  599. package/dist/src/imports/scanner.js +1 -1
  600. package/dist/src/imports/sources.js +1 -1
  601. package/dist/src/infra/brew.js +1 -1
  602. package/dist/src/infra/gateway-processes.js +2 -2
  603. package/dist/src/infra/package-runtime-check.js +1 -1
  604. package/dist/src/infra/path-env.js +4 -4
  605. package/dist/src/infra/ports.js +1 -1
  606. package/dist/src/infra/process-diagnostics.js +1 -1
  607. package/dist/src/infra/ssh-tunnel.js +1 -1
  608. package/dist/src/infra/update-global.js +9 -9
  609. package/dist/src/infra/update-startup.js +1 -1
  610. package/dist/src/infra/write-file-atomic.js +1 -1
  611. package/dist/src/knowledge/connected-knowledge-pipeline.js +1 -1
  612. package/dist/src/knowledge/index.js +1 -1
  613. package/dist/src/local-apps/artifact-files.js +1 -1
  614. package/dist/src/local-apps/capabilities/delegate.js +1 -1
  615. package/dist/src/local-apps/execution-authority.js +2 -2
  616. package/dist/src/local-apps/p1-services.js +3 -3
  617. package/dist/src/local-apps/preview-sessions.js +1 -1
  618. package/dist/src/local-apps/preview-worker.js +1 -1
  619. package/dist/src/local-apps/public-assets.js +1 -1
  620. package/dist/src/local-apps/service.js +4 -4
  621. package/dist/src/local-apps/store.js +1 -1
  622. package/dist/src/markdown/index.js +1 -1
  623. package/dist/src/mcp/connection-grants.js +1 -1
  624. package/dist/src/mcp/delegation.js +5 -5
  625. package/dist/src/mcp/run-callback-subscriptions.d.ts +13 -0
  626. package/dist/src/mcp/run-callback-subscriptions.js +17 -0
  627. package/dist/src/mcp/run-callbacks.d.ts +1 -4
  628. package/dist/src/mcp/run-callbacks.js +9 -22
  629. package/dist/src/media/session-references.js +1 -1
  630. package/dist/src/media-shared/http/provider-http.js +1 -1
  631. package/dist/src/media-understanding/openai-compatible-audio.js +1 -1
  632. package/dist/src/media-understanding/runner.js +1 -1
  633. package/dist/src/memory-learning/choice-observations.js +6 -6
  634. package/dist/src/memory-learning/source-learning.js +4 -4
  635. package/dist/src/memory-learning/task-receipts.js +1 -1
  636. package/dist/src/memory-learning/work-capture.js +1 -1
  637. package/dist/src/memory-learning/work-review.js +3 -3
  638. package/dist/src/music-generation/artifact.js +3 -3
  639. package/dist/src/music-generation/worker.js +1 -1
  640. package/dist/src/notes/agent-context.js +3 -3
  641. package/dist/src/notes/service.js +2 -2
  642. package/dist/src/notes/store.js +1 -1
  643. package/dist/src/notifications/device-store.js +1 -1
  644. package/dist/src/notifications/platform-push.d.ts +2 -1
  645. package/dist/src/notifications/platform-push.js +4 -3
  646. package/dist/src/notifications/service.js +4 -4
  647. package/dist/src/notifications/store.js +1 -1
  648. package/dist/src/observability/runtime.js +1 -1
  649. package/dist/src/personal-agent/capability-service.js +1 -1
  650. package/dist/src/personal-agent/proactivity/repository.js +1 -1
  651. package/dist/src/personal-agent/proactivity/service.js +6 -6
  652. package/dist/src/personal-agent/prompt-context.js +4 -4
  653. package/dist/src/personal-agent/prompts.js +1 -1
  654. package/dist/src/personal-agent/reply-composer.js +12 -12
  655. package/dist/src/personal-agent/reply-style.d.ts +2 -2
  656. package/dist/src/personal-agent/reply-style.js +8 -7
  657. package/dist/src/personal-agent/request-delivery.js +2 -2
  658. package/dist/src/personal-agent/request-service.js +5 -5
  659. package/dist/src/personal-agent/result-reader.d.ts +2 -0
  660. package/dist/src/personal-agent/result-reader.js +16 -5
  661. package/dist/src/personal-agent/service.js +3 -3
  662. package/dist/src/personal-agent/specialist-capabilities.js +3 -2
  663. package/dist/src/personal-agent/task-cancel.js +1 -1
  664. package/dist/src/personal-agent/unread.js +1 -1
  665. package/dist/src/phone/adb-driver.js +3 -3
  666. package/dist/src/phone/cloud-adb-connection.js +2 -2
  667. package/dist/src/phone/execution-trace.js +1 -1
  668. package/dist/src/phone/hdc-driver.js +2 -2
  669. package/dist/src/phone/hdc-video-tools.js +1 -1
  670. package/dist/src/phone/model-adapter.js +2 -2
  671. package/dist/src/phone/runtime.js +4 -4
  672. package/dist/src/phone/ui-session.js +1 -1
  673. package/dist/src/platform/index.js +1 -1
  674. package/dist/src/project-trust/trust-store.js +1 -1
  675. package/dist/src/projects/index.js +4 -4
  676. package/dist/src/projects/project-kind.d.ts +0 -7
  677. package/dist/src/projects/project-kind.js +1 -6
  678. package/dist/src/projects/project-service.js +3 -11
  679. package/dist/src/projects/workspace-project.js +1 -1
  680. package/dist/src/projects/workspace.js +1 -1
  681. package/dist/src/providers/extension-stream-bridge.js +2 -2
  682. package/dist/src/providers/index.js +4 -4
  683. package/dist/src/providers/model-call.js +3 -3
  684. package/dist/src/providers/model-catalog-persistence.js +1 -1
  685. package/dist/src/providers/model-reference-auditor.js +1 -1
  686. package/dist/src/providers/model-registry.js +3 -3
  687. package/dist/src/providers/provider-disconnect-core.js +1 -1
  688. package/dist/src/providers/register-runtime-providers.js +1 -1
  689. package/dist/src/providers/setup/voice.js +1 -1
  690. package/dist/src/providers/xopc-cloud-catalog-coordinator.js +1 -1
  691. package/dist/src/providers/xopc-cloud-credit-budget.js +1 -1
  692. package/dist/src/providers/xopc-cloud-model-source.js +1 -1
  693. package/dist/src/realtime/browser-preview-ice.d.ts +2 -0
  694. package/dist/src/realtime/browser-preview-ice.js +42 -0
  695. package/dist/src/realtime/browser-preview.d.ts +45 -0
  696. package/dist/src/realtime/browser-preview.js +191 -0
  697. package/dist/src/realtime/runtime.d.ts +4 -1
  698. package/dist/src/realtime/runtime.js +53 -2
  699. package/dist/src/remote-access/exposure-manager.js +1 -1
  700. package/dist/src/review/review-git.js +1 -1
  701. package/dist/src/runtime-tools/downloader.js +1 -1
  702. package/dist/src/runtime-tools/harmony-dependencies.js +1 -1
  703. package/dist/src/runtime-tools/manager.js +2 -2
  704. package/dist/src/runtime-tools/phone-dependencies.js +1 -1
  705. package/dist/src/session/history-recall-policy.js +1 -1
  706. package/dist/src/session/index.js +2 -2
  707. package/dist/src/session/init-session-turn.js +1 -1
  708. package/dist/src/session/resolve-session.js +1 -1
  709. package/dist/src/session/session-title.js +1 -1
  710. package/dist/src/session/store.js +8 -8
  711. package/dist/src/session/thinking-resolve.js +1 -1
  712. package/dist/src/share/hosted-note-publication.js +1 -1
  713. package/dist/src/share/hosted-session-share.js +1 -1
  714. package/dist/src/share/hosted-static-site-publication.js +1 -1
  715. package/dist/src/share/session-share-service.js +1 -1
  716. package/dist/src/share/share-auto.js +1 -1
  717. package/dist/src/share/share-thumbnail.js +1 -1
  718. package/dist/src/share/share-zip.js +1 -1
  719. package/dist/src/share/site-proxy.js +2 -2
  720. package/dist/src/space/budget-workbook.js +1 -1
  721. package/dist/src/space/ingest.js +1 -1
  722. package/dist/src/space/repository.js +3 -3
  723. package/dist/src/space/workbook-turn.js +1 -1
  724. package/dist/src/space/worker.js +1 -1
  725. package/dist/src/storage/sqlite/ai-usage-repository.js +1 -1
  726. package/dist/src/storage/sqlite/clarification-wait-repository.js +2 -2
  727. package/dist/src/storage/sqlite/connection.js +11 -11
  728. package/dist/src/storage/sqlite/conversation-repository.js +2 -2
  729. package/dist/src/storage/sqlite/desktop-execution-repository.js +1 -1
  730. package/dist/src/storage/sqlite/desktop-execution-stop-repository.js +1 -1
  731. package/dist/src/storage/sqlite/device-access-repository.js +1 -1
  732. package/dist/src/storage/sqlite/device-pairing-approval.js +1 -1
  733. package/dist/src/storage/sqlite/index.js +1 -1
  734. package/dist/src/storage/sqlite/schema-upgrade.js +3 -3
  735. package/dist/src/storage/sqlite/session-creation-repository.d.ts +2 -0
  736. package/dist/src/storage/sqlite/session-creation-repository.js +25 -6
  737. package/dist/src/storage/sqlite/session-input-control-repository.js +1 -1
  738. package/dist/src/storage/sqlite/session-input-repository.js +2 -1
  739. package/dist/src/storage/sqlite/session-repository.js +1 -1
  740. package/dist/src/support/collect-support-report.js +1 -1
  741. package/dist/src/tasks/capabilities/management.js +1 -1
  742. package/dist/src/tasks/capabilities/read.js +2 -2
  743. package/dist/src/tasks/capabilities/relations.js +2 -2
  744. package/dist/src/tasks/capabilities/runs.js +1 -1
  745. package/dist/src/tasks/capabilities/write.js +3 -3
  746. package/dist/src/tasks/delegated-run-result.js +1 -1
  747. package/dist/src/tasks/home-query-service.js +1 -1
  748. package/dist/src/tasks/index.js +4 -4
  749. package/dist/src/tasks/task-allocation-service.js +8 -8
  750. package/dist/src/tasks/task-application-service.d.ts +1 -0
  751. package/dist/src/tasks/task-application-service.js +18 -7
  752. package/dist/src/tasks/task-context-assembler.js +4 -3
  753. package/dist/src/tasks/task-contract-planner.js +3 -2
  754. package/dist/src/tasks/task-criterion-review-repository.js +1 -1
  755. package/dist/src/tasks/task-deliverables.js +1 -1
  756. package/dist/src/tasks/task-execution-capabilities.js +1 -1
  757. package/dist/src/tasks/task-handoff-service.js +2 -2
  758. package/dist/src/tasks/task-handoff.d.ts +4 -0
  759. package/dist/src/tasks/task-handoff.js +58 -17
  760. package/dist/src/tasks/task-json-acceptance.js +2 -2
  761. package/dist/src/tasks/task-main-update-decision-service.js +4 -3
  762. package/dist/src/tasks/task-main-update-delivery.js +5 -3
  763. package/dist/src/tasks/task-model-call.js +1 -1
  764. package/dist/src/tasks/task-origin-repository.d.ts +2 -0
  765. package/dist/src/tasks/task-origin-repository.js +17 -0
  766. package/dist/src/tasks/task-read-model-projector.js +1 -1
  767. package/dist/src/tasks/task-research-repair.js +4 -2
  768. package/dist/src/tasks/task-research-result.d.ts +7 -0
  769. package/dist/src/tasks/task-research-result.js +137 -35
  770. package/dist/src/tasks/task-result-delivery-repository.js +1 -1
  771. package/dist/src/tasks/task-result-delivery-service.js +4 -4
  772. package/dist/src/tasks/task-retry-service.js +1 -1
  773. package/dist/src/tasks/task-run-coordinator.js +7 -7
  774. package/dist/src/tasks/task-run-dispatcher.js +2 -2
  775. package/dist/src/tasks/task-run-repository.js +1 -1
  776. package/dist/src/tasks/task-signal-service.js +1 -1
  777. package/dist/src/tasks/task-workspace-verification.js +2 -2
  778. package/dist/src/tui/backend-services.js +1 -1
  779. package/dist/src/tui/backends/embedded-backend.js +16 -16
  780. package/dist/src/tui/backends/embedded-drafts.js +1 -1
  781. package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
  782. package/dist/src/tui/clipboard-image.js +2 -2
  783. package/dist/src/tui/extension-host/load-extensions.js +2 -2
  784. package/dist/src/tui/tui-capabilities.js +2 -2
  785. package/dist/src/tui/tui-commands.js +4 -4
  786. package/dist/src/tui/tui-management.js +8 -8
  787. package/dist/src/tui/tui-picker-overlay.js +1 -1
  788. package/dist/src/tui/tui-skills-autocomplete.js +2 -2
  789. package/dist/src/tui/tui-startup-resources.js +3 -3
  790. package/dist/src/tui/tui.js +9 -9
  791. package/dist/src/tunnel/frpc-binary.js +2 -2
  792. package/dist/src/tunnel/gateway-lifecycle.js +1 -1
  793. package/dist/src/usage/cloud-capability.js +1 -1
  794. package/dist/src/usage/recorder.js +2 -2
  795. package/dist/src/user-model/capture/executor.js +1 -1
  796. package/dist/src/user-model/index.js +2 -2
  797. package/dist/src/utils/index.js +1 -1
  798. package/dist/src/utils/logger/index.js +2 -2
  799. package/dist/src/utils/logger.js +1 -1
  800. package/dist/src/video-generation/artifact.js +3 -3
  801. package/dist/src/video-generation/repository.js +1 -1
  802. package/dist/src/video-generation/worker.js +1 -1
  803. package/dist/src/voice/audio/normalize.js +1 -1
  804. package/dist/src/voice/platform-settings.js +1 -1
  805. package/dist/src/voice/realtime/conversation-context.js +1 -1
  806. package/dist/src/voice/realtime/memory-context.js +3 -3
  807. package/dist/src/voice/realtime/omniRoute.js +1 -1
  808. package/dist/src/voice/realtime/runtime.js +5 -5
  809. package/dist/src/voice/stt/factory.js +1 -1
  810. package/dist/src/voice/stt/index.js +1 -1
  811. package/dist/src/voice/stt/preflight.js +1 -1
  812. package/dist/src/voice/stt/providers/alibaba-transcription.js +1 -1
  813. package/dist/src/voice/stt/providers/bailian-plan-transcription.js +3 -3
  814. package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +3 -3
  815. package/dist/src/voice/tts/factory.js +1 -1
  816. package/dist/src/voice/tts/index.js +3 -3
  817. package/dist/src/voice/tts/merge-config.js +1 -1
  818. package/dist/src/voice/tts/payload.js +1 -1
  819. package/dist/src/voice/tts/providers/bailian-plan-speech.js +3 -3
  820. package/dist/src/voice/tts/providers/edge-speech.js +1 -1
  821. package/dist/src/voice/tts/providers/xopc-cloud-speech.js +3 -3
  822. package/dist/src/voice/tts/speak-core.js +2 -2
  823. package/dist/src/work-discovery/candidate-discovery.js +2 -2
  824. package/dist/src/work-discovery/probe.js +2 -2
  825. package/dist/src/work-discovery/service.js +7 -7
  826. package/package.json +1 -1
  827. package/dist/gateway/static/root/assets/gateway-realtime-egUNyhxi.js +0 -1
  828. package/dist/gateway/static/root/assets/gateway-realtime-store-5YcWzAfG.js +0 -1
  829. package/dist/gateway/static/root/assets/index-CaUUC83j.css +0 -1
  830. package/dist/gateway/static/root/assets/index-DwdoCbAF.js +0 -11
  831. package/dist/gateway/static/root/assets/messages-Clfka2Sx.js +0 -3
  832. package/dist/gateway/static/root/assets/note-image-lightbox-BVcE6TAF.js +0 -1
  833. package/dist/gateway/static/root/assets/project-detail-page-BTgDajpj.js +0 -7
  834. package/dist/gateway/static/root/assets/right-workspace-store-B8ooYVOe.js +0 -1
  835. package/dist/gateway/static/root/assets/settings-advanced-gate-CaALReQD.js +0 -1
  836. package/dist/gateway/static/root/assets/space-page-CBSaZbyH.js +0 -2
  837. package/dist/gateway/static/root/assets/turn-outcome-Dtw6OgwL.js +0 -1
  838. package/dist/gateway/static/root/assets/workspace-editor-agent-store-BbfHBVhA.js +0 -1
@@ -1,9 +1,10 @@
1
1
  import { init_paths_state, resolveStateDir } from "../../config/paths-state.js";
2
2
  import { createLogger } from "../../utils/logger/index.js";
3
3
  import { init_logger } from "../../utils/logger.js";
4
+ import { getExecutionAuthority } from "../../infra/execution-authority.js";
4
5
  import { isXopcDatabaseOpen } from "../../storage/sqlite/connection.js";
5
- import { getBrowserTabBinding } from "../../storage/sqlite/browser-tab-binding-repository.js";
6
6
  import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
7
+ import { getBrowserTabBinding } from "../../storage/sqlite/browser-tab-binding-repository.js";
7
8
  import { init_request_repository, personalRequestForExecution } from "../../personal-agent/request-repository.js";
8
9
  import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
9
10
  import { patchSessionMetadata } from "../../storage/sqlite/session-repository.js";
@@ -11,39 +12,31 @@ import { getSessionTaskPlan, setSessionTaskPlan } from "../../storage/sqlite/ses
11
12
  import "../../storage/sqlite/index.js";
12
13
  import { getConversationRouting } from "../../storage/sqlite/conversation-repository.js";
13
14
  import { init_session_key } from "../../routing/session-key.js";
14
- import { buildRuntimeEnvironment } from "../../runtime-tools/environment.js";
15
- import { skillEnvironmentId } from "../skills/installer.js";
16
- import { resolveEffectiveAgentConfigForAgent } from "../../config/agent-profile.js";
17
- import { getExecutionEnvironmentForSession } from "../../execution-environments/subject.js";
15
+ import { getEmbeddedExecutionRunId, getEmbeddedExecutionSession } from "../embedded/execution-context.js";
18
16
  import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
17
+ import { resolveEffectiveAgentConfigForAgent } from "../../config/agent-profile.js";
19
18
  import { canRecallConversation, canRecallHistoryEntry } from "../../session/history-recall-policy.js";
19
+ import { getExecutionEnvironmentForSession } from "../../execution-environments/subject.js";
20
+ import { buildRuntimeEnvironment } from "../../runtime-tools/environment.js";
21
+ import { skillEnvironmentId } from "../skills/installer.js";
20
22
  import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
21
- import { getExecutionAuthority } from "../../infra/execution-authority.js";
22
- import { BrowserRuntime } from "../../browser/runtime/browser-runtime.js";
23
- import "../../../packages/browser-control-contract/src/index.js";
24
- import { createBrowserDriver } from "../../browser/drivers/create-driver.js";
25
- import { checkBrowserReadiness } from "../../browser/readiness.js";
26
- import "../../browser/index.js";
27
- import { getEmbeddedExecutionRunId, getEmbeddedExecutionSession } from "../embedded/execution-context.js";
28
- import { mergeTtsConfigFromAppConfig } from "../../voice/tts/merge-config.js";
29
- import { ComputerRuntime } from "../../computer/runtime.js";
30
23
  import { getActiveTranscriptUserText, getPendingTranscriptUserText } from "../inbound/attachment-pipeline.js";
31
24
  import { getSessionInteractionPolicy } from "../session/interaction-policy-state.js";
32
- import { wrapToolsWithProtection } from "./executor.js";
33
- import { createDefaultExternalToolGatewayTools } from "../external-tools/index.js";
34
- import { getPhoneRuntime, phoneExecutionContext } from "../../phone/runtime.js";
35
- import { createWebFetchTool, createWebSearchTool } from "./web.js";
36
- import { createDataBatchTool } from "./dataBatch.js";
37
- import { markCodemodeCoreRead } from "./codemode-permissions.js";
38
25
  import "../session/interaction-policy.js";
39
26
  import { PERSONAL_TOOL_DESCRIPTIONS } from "../../personal-agent/policy.js";
40
27
  import { PERSONAL_REQUEST_TOOL_IDS, TASK_EXECUTION_TOOL_IDS, filterExecutionTools, resolveExecutionToolPolicy } from "../embedded/execution-tool-policy.js";
28
+ import { getPhoneRuntime, phoneExecutionContext } from "../../phone/runtime.js";
41
29
  import { createPhoneUseTool } from "./phone-use-tool.js";
42
30
  import { createWorkbookEditTool, createWorkbookReadTool } from "./workbook-tools.js";
43
31
  import { LOCAL_READ_MAX_CHARS } from "./local-read-budget.js";
44
32
  import { createPersonalAttentionTool } from "./personal-attention-tool.js";
45
33
  import { createPersonalMemoryTool } from "./personal-memory-tool.js";
46
34
  import { withCoreToolExposure } from "./toolExposure.js";
35
+ import { markCodemodeCoreRead } from "./codemode-permissions.js";
36
+ import "../../../packages/browser-control-contract/src/index.js";
37
+ import { wrapToolsWithProtection } from "./executor.js";
38
+ import { createDefaultExternalToolGatewayTools } from "../external-tools/index.js";
39
+ import { createDataBatchTool } from "./dataBatch.js";
47
40
  import { createXopcUseTool } from "./xopc-use-tool.js";
48
41
  import { createMcpSetupTool } from "./mcp-setup-tool.js";
49
42
  import { createReadFileTool } from "./read.js";
@@ -58,6 +51,7 @@ import { createSessionSearchTool } from "./session-search-tool.js";
58
51
  import { createSessionRecallTool } from "./session-recall-tool.js";
59
52
  import { createGrepTool } from "./grep.js";
60
53
  import { createFindTool } from "./find.js";
54
+ import { createWebFetchTool, createWebSearchTool } from "./web.js";
61
55
  import { createWebExtractTool } from "./web-extract.js";
62
56
  import { createMessageTool } from "./communication.js";
63
57
  import { createSendMediaTool } from "./send-media.js";
@@ -69,6 +63,10 @@ import { createUpdatePlanTool } from "./update-plan-tool.js";
69
63
  import { createSessionStatusTool } from "./session-status-tool.js";
70
64
  import { createMemoryMaintenanceTool } from "./memory-maintenance-tool.js";
71
65
  import { createClarifyTool } from "./clarify-tool.js";
66
+ import { BrowserRuntime } from "../../browser/runtime/browser-runtime.js";
67
+ import { createBrowserDriver } from "../../browser/drivers/create-driver.js";
68
+ import { checkBrowserReadiness } from "../../browser/readiness.js";
69
+ import "../../browser/index.js";
72
70
  import { createDelegateTool } from "./delegate-tool.js";
73
71
  import { createAutomationTool } from "./automation-tool.js";
74
72
  import { createSkillViewTool, createSkillsListTool } from "./skills-tools.js";
@@ -96,11 +94,13 @@ import { RemoteDeviceBrowserDriver } from "../../browser/remote/device-driver.js
96
94
  import { RemoteDeviceBrowserRuntime } from "../../browser/remote/device-runtime.js";
97
95
  import { remoteBrowserEndpoint } from "../../browser/remote/device-target.js";
98
96
  import { createBrowserUseTool } from "./browser/tool/browser-use-tool.js";
97
+ import { ComputerRuntime } from "../../computer/runtime.js";
99
98
  import { createComputerUseTool } from "./computer-use-tool.js";
100
99
  import { createDeviceUseTool } from "./device-use-tool.js";
101
100
  import { createReviewWorkspaceTool } from "./review-workspace.js";
102
101
  import { createLanguageDiagnosticsTool } from "./language-diagnostics.js";
103
102
  import { createNoninteractiveToolPolicy } from "./noninteractive-tool-policy.js";
103
+ import { mergeTtsConfigFromAppConfig } from "../../voice/tts/merge-config.js";
104
104
  import { createTextToSpeechTool } from "./tts-tool.js";
105
105
  import { getAgentCapabilityToolNames } from "../capabilities/registry.js";
106
106
  import "../capabilities/index.js";
@@ -216,6 +216,21 @@ var AgentToolsFactory = class AgentToolsFactory {
216
216
  canRestoreSetupSession: (taskKey, sessionId) => this.deps.getBrowserSetupService?.()?.canRestoreSession(taskKey, sessionId) === true,
217
217
  isTrustedSetupUrl: (taskKey, url) => this.deps.getBrowserSetupService?.()?.allowsVerificationUrl(taskKey, url) === true,
218
218
  emit: this.deps.emitBrowserEvent,
219
+ publishPreview: (conversationId, source) => {
220
+ const runId = getEmbeddedExecutionRunId();
221
+ if (runId && getEmbeddedExecutionSession() === conversationId) this.deps.emitBrowserEvent?.("browser.preview.target", {
222
+ conversationId,
223
+ runId,
224
+ source
225
+ });
226
+ },
227
+ publishManagedLive: (conversationId, source) => {
228
+ this.deps.emitBrowserEvent?.("browser.managed.live", {
229
+ conversationId,
230
+ source,
231
+ runtime: this.browserRuntime
232
+ });
233
+ },
219
234
  resolveTarget: (conversationId) => {
220
235
  const binding = getBrowserTabBinding(conversationId);
221
236
  if (binding) return {
@@ -379,7 +394,9 @@ var AgentToolsFactory = class AgentToolsFactory {
379
394
  const imageGenerateTool = createImageGenerateTool({
380
395
  config: cfg,
381
396
  workspace,
382
- agentId: options?.agentId ?? (cfg ? resolveDefaultAgentId() : "main")
397
+ agentId: options?.agentId ?? (cfg ? resolveDefaultAgentId() : "main"),
398
+ bus,
399
+ getContext: () => executionToolPolicy.taskExecution || currentConversationId() && getSessionMetadata(currentConversationId())?.sessionType === "heartbeat" ? null : this.deps.getCurrentContext()
383
400
  });
384
401
  const agentId = options?.agentId;
385
402
  const resolvedAgentId = agentId ?? (executionConversationId ? getSessionMetadata(executionConversationId)?.agentId : void 0) ?? (cfg ? resolveDefaultAgentId() : "main");
@@ -2,6 +2,7 @@ import type { AgentTool } from '@earendil-works/pi-agent-core';
2
2
  import type { Config } from '../../config/schema.js';
3
3
  import { parseImageDataUrl } from '../image/generation/image-assets.js';
4
4
  import type { ToolModelConfig } from '../image/tool-model-config.js';
5
+ import type { MessageBus } from '../../infra/bus/index.js';
5
6
  export { parseImageDataUrl };
6
7
  export declare function resolveImageGenerationModelConfigForTool(params: {
7
8
  cfg?: Config;
@@ -11,4 +12,10 @@ export declare function createImageGenerateTool(options: {
11
12
  config?: Config;
12
13
  workspace: string;
13
14
  agentId: string;
15
+ bus?: MessageBus;
16
+ getContext?: () => {
17
+ channel: string;
18
+ chatId: string;
19
+ metadata?: Record<string, unknown>;
20
+ } | null;
14
21
  }): AgentTool<any, Record<string, unknown>> | null;
@@ -2,11 +2,12 @@ import { getAgentDefaultImageGenerationModelConfig, init_schema } from "../../co
2
2
  import { buildCapabilityPlansForConfig } from "../../capabilities/readiness/from-config.js";
3
3
  import "../../capabilities/readiness/index.js";
4
4
  import { applyImageGenerationModelConfigDefaults } from "../image/image-helpers.js";
5
- import { imageAssetFromDataUrl, imageFileExtensionForMimeType, mimeTypeFromFileName, parseImageDataUrl, sniffImageMimeType } from "../image/generation/image-assets.js";
6
- import { getImageGenerationProvider } from "../image/generation/provider-registry.js";
7
5
  import { readWorkspaceFile, writeWorkspaceFile } from "../sandbox/fileAccess.js";
8
- import { persistToolMedia } from "./tool-media.js";
6
+ import { imageAssetFromDataUrl, imageFileExtensionForMimeType, mimeTypeFromFileName, parseImageDataUrl, sniffImageMimeType } from "../image/generation/image-assets.js";
7
+ import { buildOutboundMediaMetadata, persistToolMedia } from "./tool-media.js";
8
+ import { isExternalMessagingChannel } from "../../channels/internal-outbound.js";
9
9
  import { isFailoverError } from "../failover-error.js";
10
+ import { getImageGenerationProvider } from "../image/generation/provider-registry.js";
10
11
  import { generateImage, listImageGenerationProvidersSummary } from "../image/generation/runtime.js";
11
12
  import path from "node:path";
12
13
  import { randomBytes } from "node:crypto";
@@ -288,11 +289,30 @@ function createImageGenerateTool(options) {
288
289
  filePath: paths[index],
289
290
  mediaType: "photo"
290
291
  })));
292
+ const deliveryCtx = options.getContext?.();
293
+ let deliveredToChannel;
294
+ if (options.bus && deliveryCtx && isExternalMessagingChannel(deliveryCtx.channel)) {
295
+ for (let index = 0; index < result.images.length; index += 1) {
296
+ const image = result.images[index];
297
+ const item = media[index];
298
+ const outboundMetadata = buildOutboundMediaMetadata(deliveryCtx.metadata, item.name);
299
+ await options.bus.publishOutbound({
300
+ channel: deliveryCtx.channel,
301
+ chat_id: deliveryCtx.chatId,
302
+ content: "",
303
+ mediaUrl: `data:${item.mimeType};base64,${image.buffer.toString("base64")}`,
304
+ mediaType: "photo",
305
+ ...outboundMetadata ? { metadata: outboundMetadata } : {}
306
+ });
307
+ }
308
+ deliveredToChannel = deliveryCtx.channel;
309
+ }
291
310
  return {
292
311
  content: [{
293
312
  type: "text",
294
313
  text: [
295
314
  `Generated and published ${paths.length} image(s) with ${result.provider}/${result.model}.`,
315
+ ...deliveredToChannel ? [`Delivered ${paths.length} image(s) directly to ${deliveredToChannel}.`] : [],
296
316
  "In a Task, select the returned artifact IDs in publish_task_result.finalArtifactIds for final delivery. Publication alone does not confirm delivery to the originating chat.",
297
317
  ...paths.map((p) => `Saved: ${p}`)
298
318
  ].join("\n")
@@ -1,10 +1,6 @@
1
- import { assertBrowserUrlAllowed } from "../../browser/url-policy.js";
2
- import { BrowserRuntime } from "../../browser/runtime/browser-runtime.js";
3
- import "../../browser/index.js";
4
1
  import { resolveImageModelConfigForTool } from "../image/tool-model-config.js";
5
2
  import { DEFAULT_TOOL_METADATA, getToolMetadata } from "./metadata.js";
6
3
  import { ToolConcurrencyController, resolveToolLockMode } from "./concurrency.js";
7
- import { createWebFetchTool, createWebSearchTool } from "./web.js";
8
4
  import { createDataBatchTool } from "./dataBatch.js";
9
5
  import { createXopcUseTool } from "./xopc-use-tool.js";
10
6
  import { createMcpSetupTool } from "./mcp-setup-tool.js";
@@ -22,6 +18,7 @@ import { createSessionSearchTool } from "./session-search-tool.js";
22
18
  import { createSessionRecallTool } from "./session-recall-tool.js";
23
19
  import { createGrepTool, grepTool } from "./grep.js";
24
20
  import { createFindTool, findTool } from "./find.js";
21
+ import { createWebFetchTool, createWebSearchTool } from "./web.js";
25
22
  import { DEFAULT_WEB_EXTRACT_MAX_LENGTH, MAX_RAW_HTML_CHARS_FOR_WEB_EXTRACT, createWebExtractTool, stripHtmlBoilerplate } from "./web-extract.js";
26
23
  import { createMessageTool } from "./communication.js";
27
24
  import { createSendMediaTool } from "./send-media.js";
@@ -33,6 +30,9 @@ import { createUpdatePlanTool } from "./update-plan-tool.js";
33
30
  import { createSessionStatusTool } from "./session-status-tool.js";
34
31
  import { createMemoryMaintenanceTool } from "./memory-maintenance-tool.js";
35
32
  import { createClarifyTool } from "./clarify-tool.js";
33
+ import { assertBrowserUrlAllowed } from "../../browser/url-policy.js";
34
+ import { BrowserRuntime } from "../../browser/runtime/browser-runtime.js";
35
+ import "../../browser/index.js";
36
36
  import { DEFAULT_DELEGATE_TOOLS, DELEGATE_BLOCKED_TOOLS, createDelegateTool } from "./delegate-tool.js";
37
37
  import { createAutomationTool } from "./automation-tool.js";
38
38
  import { createSkillViewTool, createSkillsListTool } from "./skills-tools.js";
@@ -1,8 +1,8 @@
1
- import { projectForgottenEvidence } from "../../memory-learning/forgotten-history.js";
2
1
  import { inferMemorySensitivity } from "../memory/sensitivity.js";
3
2
  import { canUseKnowledge } from "../../knowledge-memory/usage-policy.js";
4
3
  import { getKnowledgeItem, searchKnowledgeItems, writeKnowledgeItem } from "../../knowledge-memory/repository.js";
5
4
  import "../../knowledge-memory/index.js";
5
+ import { projectForgottenEvidence } from "../../memory-learning/forgotten-history.js";
6
6
  import "./local-read-budget.js";
7
7
  import { memoryVersion } from "../../user-context/memory-version.js";
8
8
  import { Type } from "@sinclair/typebox";
@@ -1,7 +1,7 @@
1
+ import { evaluateExecPolicy } from "../sandbox/exec-policy.js";
1
2
  import { getEmbeddedCommandYieldSignal } from "../embedded/runs.js";
2
3
  import { getSessionInteractionPolicy } from "../session/interaction-policy-state.js";
3
4
  import { commandRegistry, commandTimeout } from "../commands/command-registry.js";
4
- import { evaluateExecPolicy } from "../sandbox/exec-policy.js";
5
5
  import "../session/interaction-policy.js";
6
6
  import { resolve } from "node:path";
7
7
  import { Type } from "@sinclair/typebox";
@@ -2,9 +2,9 @@ import { getSqliteDatabase, init_transaction } from "../../storage/sqlite/transa
2
2
  import { init_session_instance_repository, readCurrentTranscriptId } from "../../storage/sqlite/session-instance-repository.js";
3
3
  import { getPersonalAgentByConversation } from "../../personal-agent/repository.js";
4
4
  import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
5
+ import { boundedPersonalResult } from "./personal-result-budget.js";
5
6
  import { parseLocalCheckTime } from "../../personal-agent/proactivity/follow-up-request.js";
6
7
  import { applyThreadFeedback, getAttention, getProactivitySettings, listAttention, listInterestCandidates, patchAttention, patchProactivitySettings, rollbackStrategy, saveAttention, strategyState, userText } from "../../personal-agent/proactivity/repository.js";
7
- import { boundedPersonalResult } from "./personal-result-budget.js";
8
8
  import { Type } from "@sinclair/typebox";
9
9
  //#region src/agent/tools/personal-attention-tool.ts
10
10
  init_transaction();
@@ -6,18 +6,18 @@ import { init_changes, notifyUserContextChange } from "../../user-context/change
6
6
  import { deleteUserAssertion, getAssertionSlot, getUserAssertion, reconcileAssertion, setAssertionStatus, setUserAssertionScope } from "../../user-model/repository.js";
7
7
  import { canUseAssertion } from "../../user-model/usage-policy.js";
8
8
  import { getPersonalAgentByConversation } from "../../personal-agent/repository.js";
9
- import "../../user-model/index.js";
10
9
  import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
11
10
  import { learningRoleSql, learningTranscriptMessage } from "../../memory-learning/transcript-source.js";
12
11
  import { inferMemorySensitivity } from "../memory/sensitivity.js";
13
12
  import { canUseKnowledge, knowledgeContentSources } from "../../knowledge-memory/usage-policy.js";
14
13
  import { deleteKnowledgeItem, getKnowledgeItem, reviewKnowledgeItem, setKnowledgeScope, writeKnowledgeItem } from "../../knowledge-memory/repository.js";
15
14
  import "../../knowledge-memory/index.js";
16
- import { executeAtomicOperation } from "../../capabilities/runtime/atomic-operations.js";
17
- import { getSessionInteractionPolicy } from "../session/interaction-policy-state.js";
18
- import "../session/interaction-policy.js";
19
15
  import { ownerExcludesGlobalScope, ownerMemoryScope, standingToolScope } from "../../user-model/capture/evidence-policy.js";
20
16
  import { isUnquotedOwnerEvidence } from "../../memory-learning/owner-directive.js";
17
+ import "../../user-model/index.js";
18
+ import { getSessionInteractionPolicy } from "../session/interaction-policy-state.js";
19
+ import "../session/interaction-policy.js";
20
+ import { executeAtomicOperation } from "../../capabilities/runtime/atomic-operations.js";
21
21
  import { memoryVersion } from "../../user-context/memory-version.js";
22
22
  import { extractAgentUserPlainText } from "../memory/user-message-text.js";
23
23
  import { createHash } from "node:crypto";
@@ -1,7 +1,7 @@
1
1
  import { isPersonalConversation } from "../../personal-agent/repository.js";
2
2
  import { getEmbeddedExecutionSession } from "../embedded/execution-context.js";
3
- import { CapabilityDispatcher } from "../../capabilities/runtime/dispatcher.js";
4
3
  import { LOCAL_READ_MAX_CHARS } from "./local-read-budget.js";
4
+ import { CapabilityDispatcher } from "../../capabilities/runtime/dispatcher.js";
5
5
  import { registerNoteReadCapabilities } from "../../notes/capabilities/read.js";
6
6
  import { registerAutomationReadCapabilities } from "../../automations/capabilities/read.js";
7
7
  import { registerProjectReadCapabilities } from "../../projects/capabilities/read.js";
@@ -2,9 +2,9 @@ import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "
2
2
  import { TaskRunRepository, init_task_run_repository } from "../../tasks/task-run-repository.js";
3
3
  import { init_request_repository, personalRequestForExecution } from "../../personal-agent/request-repository.js";
4
4
  import { TaskCollaborationRepository } from "../../tasks/task-collaboration-repository.js";
5
- import { selectionRequestHash } from "../../agent-matching/selection-repository.js";
6
- import { PersonalRequestResultSchema } from "../../personal-agent/request-result.js";
7
5
  import { assertPersonalRequestAccountAccess } from "../../personal-agent/request-access.js";
6
+ import { PersonalRequestResultSchema } from "../../personal-agent/request-result.js";
7
+ import { selectionRequestHash } from "../../agent-matching/selection-repository.js";
8
8
  import { Type } from "@sinclair/typebox";
9
9
  //#region src/agent/tools/personal-request-result-tool.ts
10
10
  init_transaction();
@@ -3,12 +3,12 @@ import { init_session_instance_repository, readCurrentTranscriptId } from "../..
3
3
  import { getSessionInputState, init_session_input_repository } from "../../storage/sqlite/session-input-repository.js";
4
4
  import { getPersonalRequest, init_request_repository, listPersonalRequestsWithoutTask, updatePersonalRequest } from "../../personal-agent/request-repository.js";
5
5
  import { getActiveConnectionWait, init_connection_wait_repository, reviseCurrentConnectionObjective, updateConnectionWait } from "../../storage/sqlite/connection-wait-repository.js";
6
+ import { isPersonalConversation } from "../../personal-agent/repository.js";
6
7
  import { TaskAllocationRepository } from "../../tasks/task-allocation-repository.js";
7
8
  import { resolveExactConnectionCandidate } from "../../connectors/connection-candidates.js";
8
- import { isPersonalConversation } from "../../personal-agent/repository.js";
9
9
  import { personalCapabilities } from "../../personal-agent/capability-service.js";
10
- import { selectionRequestHash } from "../../agent-matching/selection-repository.js";
11
10
  import { TASK_NOTIFICATION_PREFERENCES, getTaskNotificationPreference, isTaskNotificationPreference, setTaskNotificationPreference } from "../../tasks/task-notification-preference.js";
11
+ import { selectionRequestHash } from "../../agent-matching/selection-repository.js";
12
12
  import { assertPersonalRequestTimeRange, cancelPersonalRequest, personalRequestSnapshot, publishPersonalRequest, stopPersonalRequestExecution, submitPersonalRequest } from "../../personal-agent/request-service.js";
13
13
  import { Type } from "@sinclair/typebox";
14
14
  //#region src/agent/tools/personal-request-tool.ts
@@ -1,7 +1,7 @@
1
1
  import { isPersonalConversation } from "../../personal-agent/repository.js";
2
2
  import { readPersonalResult, retryPersonalResultDelivery } from "../../personal-agent/result-reader.js";
3
- import { waitForPersonalResult } from "../../personal-agent/result-read-continuations.js";
4
3
  import "./local-read-budget.js";
4
+ import { waitForPersonalResult } from "../../personal-agent/result-read-continuations.js";
5
5
  import { Type } from "@sinclair/typebox";
6
6
  //#region src/agent/tools/personal-result-tool.ts
7
7
  const schema = Type.Object({
@@ -6,23 +6,23 @@ import { TaskRepository, init_task_repository } from "../../tasks/task-repositor
6
6
  import { getPersonalRequest, init_request_repository, personalRequestForTask } from "../../personal-agent/request-repository.js";
7
7
  import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
8
8
  import "../../storage/sqlite/index.js";
9
+ import { isPersonalConversation } from "../../personal-agent/repository.js";
9
10
  import { TaskAllocationRepository } from "../../tasks/task-allocation-repository.js";
10
11
  import { getAvailablePersonalAgentTools, personalAgentModelAvailability } from "../../personal-agent/specialist-capabilities.js";
11
12
  import { assessSpecialist, matchSpecialists } from "../../agent-matching/service.js";
12
- import { isPersonalConversation } from "../../personal-agent/repository.js";
13
- import { parseTaskHandoffReferences } from "../../tasks/task-handoff.js";
13
+ import { parseTaskHandoffReferences, pinTaskHandoffReference } from "../../tasks/task-handoff.js";
14
14
  import { TaskReadModelProjector } from "../../tasks/task-read-model-projector.js";
15
15
  import { TaskCollaborationRepository } from "../../tasks/task-collaboration-repository.js";
16
16
  import { TaskResultDeliveryRepository } from "../../tasks/task-result-delivery-repository.js";
17
17
  import { TaskOriginRepository } from "../../tasks/task-origin-repository.js";
18
+ import { boundedPersonalResult } from "./personal-result-budget.js";
18
19
  import { TaskApplicationService } from "../../tasks/task-application-service.js";
19
- import { AgentSelectionRepository, selectionRequestHash } from "../../agent-matching/selection-repository.js";
20
- import { assertSpecialistEligible, createSelectedTask } from "../../agent-matching/delegation-service.js";
21
20
  import { TASK_NOTIFICATION_PREFERENCES, isTaskNotificationPreference, setTaskNotificationPreference } from "../../tasks/task-notification-preference.js";
22
- import { taskConversationSummary } from "../../tasks/task-conversation-summary.js";
23
- import { boundedPersonalResult } from "./personal-result-budget.js";
24
21
  import { createXopcUseTool } from "./xopc-use-tool.js";
22
+ import { AgentSelectionRepository, selectionRequestHash } from "../../agent-matching/selection-repository.js";
23
+ import { assertSpecialistEligible, createSelectedTask } from "../../agent-matching/delegation-service.js";
25
24
  import { cancelPersonalTask } from "../../personal-agent/task-cancel.js";
25
+ import { taskConversationSummary } from "../../tasks/task-conversation-summary.js";
26
26
  import { PersonalRequestTimeRangeSchema, coordinatePersonalRequest, listUnallocatedPersonalRequests } from "./personal-request-tool.js";
27
27
  import { randomUUID } from "node:crypto";
28
28
  import { Type } from "@sinclair/typebox";
@@ -315,7 +315,7 @@ function createPersonalTaskTool(deps) {
315
315
  return {
316
316
  name: "personal_task",
317
317
  label: "Personal Task",
318
- description: "Coordinate ordinary Tasks and connected-app requests. For get, retry, instruct, cancel, answer, collaboration, entry or notifications, use the known taskId or requestId. Connected-app requests awaiting authorization have only a requestId. Use timeRange on instruct for a changed absolute query range. Always include command. When the user asks to retry after reauthorization or failure, locate the original request or Task (list by a distinctive title phrase, using the original date if needed), then call retry with its exact ID. Ask which one only if multiple plausible targets remain. Report the returned status; queued means accepted for execution, waiting_connection means the original request is preserved and may still need action in the connection panel. Do not submit a duplicate. New ordinary goal: submit objective plus useOriginalRequest=true for a self-contained active user message; the host preserves the complete original text. Otherwise supply a concise complete description. Include sourceRefs for required inputs without pre-reading files or planning the execution. Use requirements.requestedAgentId only for an explicitly named executor; preserve explicitly requested requiredSkills. The background Router chooses the executor. After successful persistence, give one short confirmation and finish; updates arrive automatically.\nRUNNING work: send instruct with the known ID and instruction for new direction, or answer with the known ID, questionId and instruction for an exact worker question. Reuse the SAME Task, without a baseline lookup. Never revise running work.\nCOMPLETED ordinary work only: get(section=\"revision\"), then revise with instruction and exact returned revisionBaseline.resultId, baselineVersion and expectedVersion. If revisionBaseline is absent, use instruct/answer; never invent placeholders. This saves a revision and queues background allocation atomically. Reuse idempotencyKey for uncertain retries. supersedesEntryIds names only earlier instruction/answer entries to replace; all other requirements remain. Independent goals use submit with pinned old-result sources; connected-app side effects require a newly authorized Request.\nsourceRefs: workspace input {kind:\"file\",sourceId:\"path\"}; prior result {kind:\"result\",resultId:\"exact result ID\",sourceId:\"exact artifact ID or unique file title\"}, omitting sourceId only for retained body; other prior inputs use stable sourceId and optional expectedVersion. The host authorizes and pins exact versions; workspace inputs are not executor cwd. Do not invent composite IDs.\nUse notifications with the known ID and notificationPreference to change an existing Task only when the user asks. Use get(section=\"status\") for a brief current status; list locates a Task or a request awaiting authorization and get(section,limit,offset) reads details. collaboration(afterSequence) returns previews; entry(entryId,bodyOffset) reads full bodies through nextBodyOffset. Read complete questions before answering. cancel only on explicit user instruction; report executionStopConfirmed accurately. retry_allocation retries selection, not arbitrary execution. Saved, delivered, executor-confirmed and verified completion are distinct; report only confirmed states.",
318
+ description: "Coordinate ordinary Tasks and connected-app requests. For get, retry, instruct, cancel, answer, collaboration, entry or notifications, use the known taskId or requestId. Connected-app requests awaiting authorization have only a requestId. Use timeRange on instruct for a changed absolute query range. Always include command. When the user asks to retry after reauthorization or failure, locate the original request or Task (list by a distinctive title phrase, using the original date if needed), then call retry with its exact ID. Ask which one only if multiple plausible targets remain. Report the returned status; queued means accepted for execution, waiting_connection means the original request is preserved and may still need action in the connection panel. Do not submit a duplicate. New ordinary goal: submit objective plus useOriginalRequest=true for a self-contained active user message; the host preserves the complete original text. Otherwise supply a concise complete description. Include sourceRefs for required inputs without pre-reading files or planning the execution. Use requirements.requestedAgentId only for an explicitly named executor; preserve explicitly requested requiredSkills. The background Router chooses the executor. After successful persistence, give one short confirmation and finish; updates arrive automatically.\nRUNNING work: send instruct with the known ID and instruction for new direction, or answer with the known ID, questionId and instruction for an exact worker question. Reuse the SAME Task, without a baseline lookup. Never revise running work.\nCOMPLETED ordinary work only: get(section=\"revision\"), then revise with instruction and exact returned revisionBaseline.resultId, baselineVersion and expectedVersion. If revisionBaseline is absent, use instruct/answer; never invent placeholders. This saves a revision and queues background allocation atomically. Reuse idempotencyKey for uncertain retries. supersedesEntryIds names only earlier instruction/answer entries to replace; all other requirements remain. Independent goals use submit with pinned old-result sources; connected-app side effects require a newly authorized Request.\nFor a follow-up depending on a delivered result, use personal_result list/get to identify the exact result and pass it as a pinned source. Saying that the original is in chat does not give the worker access. If a required input is missing, resolve it before submitting.\nsourceRefs: workspace input {kind:\"file\",sourceId:\"path\"}; prior result {kind:\"result\",resultId:\"exact result ID\",sourceId:\"exact artifact ID or unique file title\"}, omitting sourceId only for retained body; other prior inputs use stable sourceId and optional expectedVersion. The host authorizes and pins exact versions; workspace inputs are not executor cwd. Do not invent composite IDs.\nUse notifications with the known ID and notificationPreference to change an existing Task only when the user asks. Use get(section=\"status\") for a brief current status; list locates a Task or a request awaiting authorization and get(section,limit,offset) reads details. collaboration(afterSequence) returns previews; entry(entryId,bodyOffset) reads full bodies through nextBodyOffset. Read complete questions before answering. cancel only on explicit user instruction; report executionStopConfirmed accurately. retry_allocation retries selection. For source_reference_unavailable on an unstarted task, supply complete replacement sourceRefs for its unresolved inputs. Reuse the existing task. Do not retry unchanged inputs from a background task update. Saved, delivered, executor-confirmed and verified completion are distinct; report only confirmed states.",
319
319
  parameters: PersonalTaskModelSchema,
320
320
  mutatesWorkspace: true,
321
321
  mutationScope: "external",
@@ -328,7 +328,11 @@ function createPersonalTaskTool(deps) {
328
328
  if (input.notificationPreference !== void 0 && (!isTaskNotificationPreference(input.notificationPreference) || !["submit", "notifications"].includes(input.command))) throw new Error("Invalid Task notification preference");
329
329
  if (input.dueAt !== void 0 && input.command !== "submit") throw new Error("dueAt is supported only by submit");
330
330
  if (input.taskReference !== void 0 && input.command !== "instruct") throw new Error("taskReference is supported only by instruct");
331
- if (modelInput.sourceRefs?.length && !["submit", "revise"].includes(input.command)) throw new Error("sourceRefs is supported only by submit/revise; it cannot be silently ignored by a coordination command");
331
+ if (modelInput.sourceRefs?.length && ![
332
+ "submit",
333
+ "revise",
334
+ "retry_allocation"
335
+ ].includes(input.command)) throw new Error("sourceRefs requires submit, revise, or recovery of a blocked allocation");
332
336
  const conversationId = deps.getCurrentConversationId?.();
333
337
  const ownAgentId = deps.getCurrentAgentId?.();
334
338
  if (!conversationId || !ownAgentId || !isPersonalConversation(conversationId)) throw new Error("Personal conversation context is unavailable");
@@ -461,6 +465,9 @@ function createPersonalTaskTool(deps) {
461
465
  details: {}
462
466
  };
463
467
  }
468
+ const refs = parseTaskHandoffReferences(modelInput.sourceRefs);
469
+ if (!refs) throw new Error("Invalid Task sourceRefs");
470
+ const sourceRefs = modelInput.sourceRefs && refs.map((ref) => pinTaskHandoffReference(conversationId, ref));
464
471
  let selectedProductTool = productTool;
465
472
  let pendingSelection;
466
473
  let command = input.command;
@@ -468,7 +475,9 @@ function createPersonalTaskTool(deps) {
468
475
  if (command === "submit") {
469
476
  const objective = input.objective?.trim();
470
477
  const inputId = getSessionInputState(conversationId).activeInputId;
471
- const original = input.useOriginalRequest && inputId ? getSessionInputById(conversationId, inputId) : void 0;
478
+ const activeInput = inputId ? getSessionInputById(conversationId, inputId) : void 0;
479
+ if (activeInput?.origin.type === "system" && activeInput.origin.source === "task_update") throw new Error("A Task update cannot authorize a new Task. Handle the existing Task or leave it waiting for the user.");
480
+ const original = input.useOriginalRequest ? activeInput : void 0;
472
481
  if (input.useOriginalRequest && (!original || original.kind !== "message" || !original.content.trim())) throw new Error("The active original user request is unavailable; submit a complete description instead");
473
482
  const description = [original?.content, input.description?.trim()].filter(Boolean).join("\n\n");
474
483
  if (!objective || !description) throw new Error("objective and a complete description or active original request are required");
@@ -482,7 +491,7 @@ function createPersonalTaskTool(deps) {
482
491
  sourceInput: inputId ?? toolCallId,
483
492
  brief,
484
493
  requirements,
485
- sourceRefs: modelInput.sourceRefs,
494
+ sourceRefs,
486
495
  conversationExcerpts: modelInput.conversationExcerpts,
487
496
  expectedOutputs: input.expectedOutputs,
488
497
  acceptanceCriteria: input.acceptanceCriteria,
@@ -499,7 +508,7 @@ function createPersonalTaskTool(deps) {
499
508
  requirements,
500
509
  dueAt: input.dueAt,
501
510
  notificationPreference: input.notificationPreference,
502
- sourceRefs: modelInput.sourceRefs,
511
+ sourceRefs,
503
512
  conversationExcerpts: modelInput.conversationExcerpts,
504
513
  includeConversationContext: false,
505
514
  expectedOutputs: input.expectedOutputs,
@@ -605,15 +614,16 @@ function createPersonalTaskTool(deps) {
605
614
  if (activeInput?.kind === "message" && !workerUpdate) {
606
615
  const directory = new TaskOriginRepository();
607
616
  const reference = input.taskReference?.trim();
617
+ const anchored = directory.recentResultTask(conversationId, activeInput.id, activeInput.createdAtMs) === taskId;
608
618
  if (!reference) {
609
- if (directory.list(conversationId, 1, { excludeClosed: true }).total > 1) throw new Error("Several tasks are still open. Provide taskReference quoted from the latest user message, or ask which task they mean.");
619
+ if (!anchored && directory.list(conversationId, 1, { excludeClosed: true }).total > 1) throw new Error("Several tasks are still open. Provide taskReference quoted from the latest user message, or ask which task they mean.");
610
620
  } else {
611
621
  if (!activeInput.content.toLowerCase().includes(reference.toLowerCase())) throw new Error("Provide taskReference quoted from the latest user message, or omit it for an implicit follow-up to the only open task.");
612
622
  let matches = directory.list(conversationId, 1, { query: reference });
613
623
  const shortReference = reference.replace(/(?:[这那][份个项条](?:任务)?|(?:的)?任务|\s+task)$/iu, "").trimEnd();
614
624
  if (!matches.total && shortReference && shortReference !== reference) matches = directory.list(conversationId, 1, { query: shortReference });
615
625
  if (matches.total > 1) throw new Error("The taskReference does not identify this task uniquely. Ask which task the user means without retrying this reference.");
616
- if (matches.items[0]?.id !== taskId) throw new Error("The taskReference does not identify the selected task. Use a distinctive quote from the user’s message that matches its title or objective, or ask which task they mean.");
626
+ if (matches.items[0]?.id !== taskId && !(anchored && matches.total === 0)) throw new Error("The taskReference does not identify the selected task. Use a distinctive quote from the user’s message that matches its title or objective, or ask which task they mean.");
617
627
  }
618
628
  }
619
629
  }
@@ -645,9 +655,23 @@ function createPersonalTaskTool(deps) {
645
655
  details: {}
646
656
  };
647
657
  }
648
- if (command === "get" && input.section === "revision") {
658
+ if (command === "get" && input.section === "revision" || command === "instruct") {
649
659
  const model = new TaskReadModelProjector().get(taskId);
650
- return {
660
+ if (command === "instruct" && model.revisionBaseline && model.allowedCommands.includes("revise")) return {
661
+ content: [{
662
+ type: "text",
663
+ text: JSON.stringify({
664
+ ok: false,
665
+ reason: "revision_required",
666
+ taskId,
667
+ revisionBaseline: model.revisionBaseline,
668
+ expectedVersion: model.task.version,
669
+ recovery: "Call revise on this same Task with the instruction and the returned baseline and expectedVersion."
670
+ })
671
+ }],
672
+ details: {}
673
+ };
674
+ if (command === "get") return {
651
675
  content: [{
652
676
  type: "text",
653
677
  text: JSON.stringify({
@@ -666,8 +690,6 @@ function createPersonalTaskTool(deps) {
666
690
  }
667
691
  if (command === "revise") {
668
692
  if (!input.instruction || !input.baselineResultId || !input.baselineVersion || !input.expectedVersion) throw new Error("Revision requires instruction, baseline result/version, and expected task version");
669
- const refs = parseTaskHandoffReferences(modelInput.sourceRefs);
670
- if (!refs) throw new Error("Invalid revision sourceRefs");
671
693
  const result = new TaskApplicationService().reviseCompleted({
672
694
  taskId,
673
695
  conversationId,
@@ -675,7 +697,7 @@ function createPersonalTaskTool(deps) {
675
697
  baselineResultId: input.baselineResultId,
676
698
  baselineVersion: input.baselineVersion,
677
699
  expectedVersion: input.expectedVersion,
678
- sourceRefs: refs,
700
+ sourceRefs,
679
701
  supersedesEntryIds: input.supersedesEntryIds,
680
702
  idempotencyKey: input.idempotencyKey ?? `personal-revise:${conversationId}:${toolCallId}`
681
703
  });
@@ -762,11 +784,51 @@ function createPersonalTaskTool(deps) {
762
784
  };
763
785
  }
764
786
  if (command === "retry_allocation") {
787
+ const activeInputId = getSessionInputState(conversationId).activeInputId;
788
+ const activeInput = activeInputId ? getSessionInputById(conversationId, activeInputId) : void 0;
789
+ if (!sourceRefs?.length && activeInput?.origin.type === "system" && activeInput.origin.source === "task_update") throw new Error("An unchanged allocation cannot be retried from a background Task update");
790
+ const expectedVersion = new TaskRepository().require(taskId).version;
791
+ if (sourceRefs?.length) {
792
+ const mutation = {
793
+ taskId,
794
+ type: "retry_allocation",
795
+ expectedVersion,
796
+ sourceRefs
797
+ };
798
+ if (deps.authorizeCapability && !await deps.authorizeCapability("xopc.tasks.command", mutation)) throw new Error("Task access denied");
799
+ const result = new TaskApplicationService().execute({
800
+ taskId,
801
+ expectedVersion,
802
+ idempotencyKey: input.idempotencyKey ?? `allocation-sources:${taskId}:${toolCallId}`,
803
+ command: { type: "retry_allocation" },
804
+ allocationSources: sourceRefs,
805
+ actor: {
806
+ kind: "agent",
807
+ id: ownAgentId
808
+ }
809
+ });
810
+ if (result.ok) deps.dispatchTaskRuns?.();
811
+ const response = result.ok === false ? {
812
+ ok: false,
813
+ reason: result.reason
814
+ } : {
815
+ ok: true,
816
+ taskId,
817
+ allocation: result.model.allocation
818
+ };
819
+ return {
820
+ content: [{
821
+ type: "text",
822
+ text: JSON.stringify(response)
823
+ }],
824
+ details: {}
825
+ };
826
+ }
765
827
  command = "command";
766
828
  args = {
767
829
  taskId,
768
830
  type: "retry_allocation",
769
- expectedVersion: new TaskRepository().require(taskId).version
831
+ expectedVersion
770
832
  };
771
833
  } else if (command === "instruct" || command === "answer") {
772
834
  const body = input.instruction?.trim();
@@ -794,9 +856,10 @@ function createPersonalTaskTool(deps) {
794
856
  command,
795
857
  args
796
858
  }, signal, void 0);
797
- if ((input.command === "answer" || input.command === "instruct") && input.taskId && result.details.result && result.details.result.ok !== false) {
859
+ if (input.command === "answer" && input.taskId && result.details.result && result.details.result.ok !== false) {
798
860
  const allocation = new TaskAllocationRepository().get(input.taskId);
799
- if (allocation && ["blocked", "failed"].includes(allocation.status)) {
861
+ const question = input.questionId ? new TaskCollaborationRepository().get(input.questionId) : void 0;
862
+ if (allocation?.status === "blocked" && allocation.reason_code === "needs_input" && question?.taskId === input.taskId && question.authorKind === "system" && question.authorId === "task-router" && question.createdAt >= allocation.updated_at) {
800
863
  new TaskApplicationService().execute({
801
864
  taskId: input.taskId,
802
865
  expectedVersion: new TaskRepository().require(input.taskId).version,
@@ -1,8 +1,8 @@
1
+ import { evaluateFilePolicy } from "../sandbox/exec-policy.js";
1
2
  import { turnOutcomeKindFromFileName, turnOutcomeMimeTypeFromFileName } from "../../../packages/gateway-contract/src/turn-outcome.js";
2
3
  import { init_src } from "../../../packages/gateway-contract/src/index.js";
3
4
  import { fileResourceId, fileSpaceId } from "../../files/file-service.js";
4
5
  import { resolvePathUnderWorkspace } from "./tool-paths.js";
5
- import { evaluateFilePolicy } from "../sandbox/exec-policy.js";
6
6
  import { readWorkspaceFile } from "../sandbox/fileAccess.js";
7
7
  import { persistToolMedia } from "./tool-media.js";
8
8
  import { basename, isAbsolute, relative, sep } from "node:path";
@@ -1,6 +1,6 @@
1
+ import { checkFileSafety } from "../prompt/safety.js";
1
2
  import { isBareProfileMarkdownFileName, resolvePathUnderWorkspace, resolveProfileMarkdownPathIfBareName } from "./tool-paths.js";
2
3
  import { checkedFilePath, readWorkspaceFileAsync } from "../sandbox/fileAccess.js";
3
- import { checkFileSafety } from "../prompt/safety.js";
4
4
  import { dataScheduler } from "../data-acquisition/scheduler.js";
5
5
  import { formatSize, truncateHead } from "./truncate.js";
6
6
  import { stat } from "fs/promises";
@@ -1,10 +1,10 @@
1
1
  import { prepareSafeToolEnv } from "../sandbox/sanitize-env-vars.js";
2
- import { readWorkspaceRevision } from "../coding/workspace-revision.js";
3
2
  import { evaluateFilePolicy } from "../sandbox/exec-policy.js";
3
+ import { readWorkspaceRevision } from "../coding/workspace-revision.js";
4
4
  import { checkedFilePath, readWorkspaceFile } from "../sandbox/fileAccess.js";
5
5
  import { resolve } from "node:path";
6
- import { execFile } from "node:child_process";
7
6
  import { promisify } from "node:util";
7
+ import { execFile } from "node:child_process";
8
8
  import { lstat, readlink, realpath } from "node:fs/promises";
9
9
  import { Type } from "@sinclair/typebox";
10
10
  //#region src/agent/tools/review-workspace.ts
@@ -1,7 +1,7 @@
1
1
  import { checkedFilePath, readWorkspaceFile, writeWorkspaceFile } from "../sandbox/fileAccess.js";
2
2
  import { resolve } from "node:path";
3
- import { existsSync, readdirSync } from "node:fs";
4
3
  import { createHash } from "node:crypto";
4
+ import { existsSync, readdirSync } from "node:fs";
5
5
  import { Type } from "@sinclair/typebox";
6
6
  //#region src/agent/tools/scoped-workspace-tools.ts
7
7
  /** Bounded file capability shared by background task executors; no command authority. */
@@ -3,6 +3,7 @@ import type { MessageBus } from '../../infra/bus/index.js';
3
3
  interface MessageContext {
4
4
  channel: string;
5
5
  chatId: string;
6
+ metadata?: Record<string, unknown>;
6
7
  }
7
8
  export declare function createSendMediaTool(workspace: string, bus: MessageBus, getContext: () => MessageContext | null): AgentTool;
8
9
  export {};