@xopcai/xopc 0.0.425 → 0.0.427

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 (448) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/telegram/src/adapters/security-adapter.js +1 -1
  3. package/dist/extensions/telegram/src/pairing-config-resolver.js +1 -1
  4. package/dist/extensions/telegram/src/plugin.js +2 -2
  5. package/dist/extensions/telegram/xopc.extension.json +1 -1
  6. package/dist/extensions/weixin/src/api/api.js +1 -1
  7. package/dist/extensions/weixin/src/auth/accounts.js +2 -2
  8. package/dist/extensions/weixin/src/auth/pairing.js +1 -1
  9. package/dist/extensions/weixin/src/cdn/upload.js +1 -1
  10. package/dist/extensions/weixin/src/cli/gateway-qr-login.js +1 -1
  11. package/dist/extensions/weixin/src/cli/qr-login.js +1 -1
  12. package/dist/extensions/weixin/src/messaging/debug-mode.js +1 -1
  13. package/dist/extensions/weixin/src/messaging/inbound.js +2 -2
  14. package/dist/extensions/weixin/src/messaging/process-message.js +3 -3
  15. package/dist/extensions/weixin/src/messaging/send.js +12 -3
  16. package/dist/extensions/weixin/src/monitor/monitor.js +1 -1
  17. package/dist/extensions/weixin/src/outbound-send.js +12 -3
  18. package/dist/extensions/weixin/src/pairing-config-resolver.js +1 -1
  19. package/dist/extensions/weixin/src/plugin.js +1 -1
  20. package/dist/gateway/static/root/assets/{activity-store-CMw8qBuC.js → activity-store-D_DXNHba.js} +1 -1
  21. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-JI0YWOIm.js → agent-avatar-dicebear-CjaQxFQt.js} +1 -1
  22. package/dist/gateway/static/root/assets/{agent-avatar-display-YqmwzOSa.js → agent-avatar-display-6Z4m31Fz.js} +2 -2
  23. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-D4ClP_DJ.js +1 -0
  24. package/dist/gateway/static/root/assets/agent-plugin-dialog-m1A8wF9p.js +1 -0
  25. package/dist/gateway/static/root/assets/agents-B9slUA_1.js +77 -0
  26. package/dist/gateway/static/root/assets/{agents-admin-api-DLnmdC1h.js → agents-admin-api-u5c3GREg.js} +1 -1
  27. package/dist/gateway/static/root/assets/{api-Boc-CVh7.js → api-C3Tp9MkF.js} +1 -1
  28. package/dist/gateway/static/root/assets/{api-bL7sxjAF.js → api-CRT9ZyH0.js} +1 -1
  29. package/dist/gateway/static/root/assets/app-link-DRy3-k7j.js +1 -0
  30. package/dist/gateway/static/root/assets/{app-management-settings-panel-jIG5i7KE.js → app-management-settings-panel-XqoIBF2H.js} +1 -1
  31. package/dist/gateway/static/root/assets/{appearance-settings-BnaQW9Xd.js → appearance-settings-9ZtqCASo.js} +1 -1
  32. package/dist/gateway/static/root/assets/apps-page-DUeu_7iC.js +1 -0
  33. package/dist/gateway/static/root/assets/{archive-plugin-DjboG3kA.js → archive-plugin-BCQnOkV8.js} +1 -1
  34. package/dist/gateway/static/root/assets/attachment-load-DrVGNxJm.js +1 -0
  35. package/dist/gateway/static/root/assets/{automation-api-CZqL9l_d.js → automation-api-hRsGx-qe.js} +1 -1
  36. package/dist/gateway/static/root/assets/{automation-result-state-DRd-X_Ai.js → automation-result-state-CMfVTv_i.js} +1 -1
  37. package/dist/gateway/static/root/assets/automation-task-card-Bur78p68.js +3 -0
  38. package/dist/gateway/static/root/assets/{automations-page-HyBQIfmn.js → automations-page-DMIyWsP0.js} +1 -1
  39. package/dist/gateway/static/root/assets/automations-workspace-DEkDjxeU.js +9 -0
  40. package/dist/gateway/static/root/assets/{binary-plugins-Bg8ARZUH.js → binary-plugins-CIB5cbvQ.js} +1 -1
  41. package/dist/gateway/static/root/assets/{block-editor-DKohqFAW.js → block-editor-CXdlNAmZ.js} +2 -2
  42. package/dist/gateway/static/root/assets/{browser-automation-inputs-YeibTzw4.js → browser-automation-inputs-Fxo7HbK6.js} +1 -1
  43. package/dist/gateway/static/root/assets/{browser-automations-page-BWNcbuz2.js → browser-automations-page-Dn3LN5wo.js} +2 -2
  44. package/dist/gateway/static/root/assets/{browser-control-api-CDeuxy2x.js → browser-control-api-CbbPvhHR.js} +1 -1
  45. package/dist/gateway/static/root/assets/browser-settings-page-Cpm9fEPV.js +3 -0
  46. package/dist/gateway/static/root/assets/{button-CnRSIP6m.js → button-Cc4hUNTt.js} +1 -1
  47. package/dist/gateway/static/root/assets/{capabilities-BcQa8c9n.js → capabilities-BEvywfF9.js} +1 -1
  48. package/dist/gateway/static/root/assets/capabilities-Bo2qEJhH.js +1 -0
  49. package/dist/gateway/static/root/assets/capabilities-page-BCzsIzvC.js +2 -0
  50. package/dist/gateway/static/root/assets/capabilities-settings-panel-Cr67ziwX.js +8 -0
  51. package/dist/gateway/static/root/assets/{capability-header-actions-CTUCuBlW.js → capability-header-actions-BxMYfQ8y.js} +1 -1
  52. package/dist/gateway/static/root/assets/channels-CA5z5dGY.js +1 -0
  53. package/dist/gateway/static/root/assets/{chat-agents-api-B8JO6Tcj.js → chat-agents-api-D8YS5amE.js} +1 -1
  54. package/dist/gateway/static/root/assets/{chat-chart-block-DRtuFfF1.js → chat-chart-block-B39npsXj.js} +1 -1
  55. package/dist/gateway/static/root/assets/chat-page-D92AWJbh.js +72 -0
  56. package/dist/gateway/static/root/assets/{chat-terminal-dock-Dkqq5FSL.js → chat-terminal-dock-DjFnElAM.js} +2 -2
  57. package/dist/gateway/static/root/assets/{command-palette-api-qujvNqkK.js → command-palette-api-Dijix7V6.js} +1 -1
  58. package/dist/gateway/static/root/assets/composer-payload-handoff-BQXlFKf4.js +1 -0
  59. package/dist/gateway/static/root/assets/{computer-settings-page-8q4hRmoo.js → computer-settings-page-MkqyKyf3.js} +1 -1
  60. package/dist/gateway/static/root/assets/confirm-dialog-D7dQJytv.js +1 -0
  61. package/dist/gateway/static/root/assets/connected-providers-grid-BSvKP2u-.js +1 -0
  62. package/dist/gateway/static/root/assets/{connector-service-page-DQaTI21R.js → connector-service-page-DlIl9bLx.js} +1 -1
  63. package/dist/gateway/static/root/assets/{connectors-api-BjypBp2g.js → connectors-api-DEJU8mgn.js} +1 -1
  64. package/dist/gateway/static/root/assets/connectors-page-Vx8-MY0Y.js +1 -0
  65. package/dist/gateway/static/root/assets/{copy-text-row-CYIv7RfP.js → copy-text-row-CpiRzq4G.js} +1 -1
  66. package/dist/gateway/static/root/assets/{date-picker-D_PSHGpe.js → date-picker-BIfjfOTM.js} +1 -1
  67. package/dist/gateway/static/root/assets/dependency-picker-XjPB8FJS.js +1 -0
  68. package/dist/gateway/static/root/assets/{desktop-pet-1Et9VqkM.js → desktop-pet-DFNehTtd.js} +1 -1
  69. package/dist/gateway/static/root/assets/{desktop-pet-narrative-rADKU0FX.js → desktop-pet-narrative-ChwjpnsG.js} +1 -1
  70. package/dist/gateway/static/root/assets/{desktop-pet-settings-0fCGgaG7.js → desktop-pet-settings-BDjsFown.js} +1 -1
  71. package/dist/gateway/static/root/assets/{dev-view-store-TTj_djD8.js → dev-view-store-CeZZLOc6.js} +1 -1
  72. package/dist/gateway/static/root/assets/device-pairing-wizard-DH_uJ698.js +1 -0
  73. package/dist/gateway/static/root/assets/{directory-picker-path-field-C07a7wYX.js → directory-picker-path-field-DiZXY7jF.js} +1 -1
  74. package/dist/gateway/static/root/assets/{discussion-annotation-sync-BFqKm9ky.js → discussion-annotation-sync-BXqNuZnx.js} +1 -1
  75. package/dist/gateway/static/root/assets/dist-BGTk37IG.js +1 -0
  76. package/dist/gateway/static/root/assets/dist-BuHnPloF.js +1 -0
  77. package/dist/gateway/static/root/assets/dist-GJ8-1PAx.js +1 -0
  78. package/dist/gateway/static/root/assets/dist-ZrL34Ps4.js +1 -0
  79. package/dist/gateway/static/root/assets/{extension-debug-page-DFaVlqas.js → extension-debug-page-myQqsol2.js} +1 -1
  80. package/dist/gateway/static/root/assets/{extension-iframe-host-BfzPfXBq.js → extension-iframe-host-DaL-OcTw.js} +1 -1
  81. package/dist/gateway/static/root/assets/{extension-marketplace-api-ow0K1Y4_.js → extension-marketplace-api-DRBszrCR.js} +1 -1
  82. package/dist/gateway/static/root/assets/{extension-page-CrDADV5W.js → extension-page-DvlGhZLa.js} +1 -1
  83. package/dist/gateway/static/root/assets/{extension-provider-mnRoa63o.js → extension-provider-fOi6V6Cr.js} +1 -1
  84. package/dist/gateway/static/root/assets/{extension-settings-page-BLl02GFY.js → extension-settings-page-DOGlQpkx.js} +1 -1
  85. package/dist/gateway/static/root/assets/{file-preview-surface-TGdKqhCf.js → file-preview-surface-DfkXvFnc.js} +1 -1
  86. package/dist/gateway/static/root/assets/{gateway-config-swr-DfPQIHOL.js → gateway-config-swr-BOCt_zOo.js} +1 -1
  87. package/dist/gateway/static/root/assets/{gateway-realtime-67vWg_M2.js → gateway-realtime-BL_Cf0OQ.js} +1 -1
  88. package/dist/gateway/static/root/assets/gateway-realtime-store-BHBOPF_q.js +1 -0
  89. package/dist/gateway/static/root/assets/{gateway-restart-CLtR2wkL.js → gateway-restart-CHf8qY7H.js} +1 -1
  90. package/dist/gateway/static/root/assets/{gateway-settings-COvC3r-l.js → gateway-settings-Di41peSM.js} +1 -1
  91. package/dist/gateway/static/root/assets/{gateway-startup-retry-9YQllbw2.js → gateway-startup-retry-CvkJYurV.js} +1 -1
  92. package/dist/gateway/static/root/assets/{global-defaults-api-DYMRjGvd.js → global-defaults-api-BWMbKu72.js} +1 -1
  93. package/dist/gateway/static/root/assets/home-page-B3sgqrl3.js +2 -0
  94. package/dist/gateway/static/root/assets/{image-generation-api-Dzydfvy8.js → image-generation-api-Ce-IY7Ug.js} +1 -1
  95. package/dist/gateway/static/root/assets/{imports-page-Csd_YZXZ.js → imports-page-W7_cDbxy.js} +1 -1
  96. package/dist/gateway/static/root/assets/index-D4B6O8B3.js +11 -0
  97. package/dist/gateway/static/root/assets/index-DGWBJDAM.css +1 -0
  98. package/dist/gateway/static/root/assets/install-connector-dialog-DWVl9ekV.js +1 -0
  99. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-B201bMIa.js → keyboard-shortcuts-settings-Doyu0Q9e.js} +1 -1
  100. package/dist/gateway/static/root/assets/link-2-D_ZKYUW7.js +1 -0
  101. package/dist/gateway/static/root/assets/local-app-workbench-page-B3h3P6aI.js +1 -0
  102. package/dist/gateway/static/root/assets/{local-apps-page-BOwqNH0L.js → local-apps-page-D6D2bZGW.js} +1 -1
  103. package/dist/gateway/static/root/assets/{local-session-drafts-DjmK-SM9.js → local-session-drafts-BJ1B1dQ7.js} +1 -1
  104. package/dist/gateway/static/root/assets/{locale-store-Bg_XR36n.js → locale-store-Br7IfbXK.js} +1 -1
  105. package/dist/gateway/static/root/assets/{logs-page-gw3E9CMQ.js → logs-page-qiXos_12.js} +2 -2
  106. package/dist/gateway/static/root/assets/management-settings-C0WcSdK7.js +1 -0
  107. package/dist/gateway/static/root/assets/{markdown-view-BUpXJUPv.js → markdown-view-Ck5s16p9.js} +2 -2
  108. package/dist/gateway/static/root/assets/mcp-conversation-setup-page-CENs3hGU.js +1 -0
  109. package/dist/gateway/static/root/assets/{media-plugins-_shnaEMY.js → media-plugins-Ba6vUE4J.js} +1 -1
  110. package/dist/gateway/static/root/assets/messages-ByFlEbsu.js +3 -0
  111. package/dist/gateway/static/root/assets/model-selector-DCBmsHzj.js +1 -0
  112. package/dist/gateway/static/root/assets/{models-hub-cache-KOJC3z6Q.js → models-hub-cache-Bd-fYUrV.js} +1 -1
  113. package/dist/gateway/static/root/assets/note-detail-panel-CnuxqWMd.js +5 -0
  114. package/dist/gateway/static/root/assets/note-image-lightbox-BFKZ7qJr.js +1 -0
  115. package/dist/gateway/static/root/assets/{notes-api-BSmikUKI.js → notes-api-8kp0X1x6.js} +1 -1
  116. package/dist/gateway/static/root/assets/{notes-page-CA0NRL8O.js → notes-page-XMdy-H3H.js} +1 -1
  117. package/dist/gateway/static/root/assets/{oauth-api-D2t9HXoC.js → oauth-api-DMMdeaNd.js} +1 -1
  118. package/dist/gateway/static/root/assets/{oauth-provider-connect-DGGGGtcB.js → oauth-provider-connect-CfOK8mPM.js} +1 -1
  119. package/dist/gateway/static/root/assets/{page-context-capture-button-BH54VO0V.js → page-context-capture-button-CKlKWSJ7.js} +1 -1
  120. package/dist/gateway/static/root/assets/{page-context-draft-BS5y8Cx9.js → page-context-draft-LF33STHC.js} +1 -1
  121. package/dist/gateway/static/root/assets/page-header-store-Du44NIEJ.js +1 -0
  122. package/dist/gateway/static/root/assets/{personal-avatar-D8DtpDTa.js → personal-avatar-D6CzIIfo.js} +1 -1
  123. package/dist/gateway/static/root/assets/personal-page-CIMMSI25.js +1 -0
  124. package/dist/gateway/static/root/assets/{personal-settings-panel-9uDaNJy5.js → personal-settings-panel-wKdlrfPq.js} +1 -1
  125. package/dist/gateway/static/root/assets/{phone-dependencies-card-DLYrI0C4.js → phone-dependencies-card-CDhk5277.js} +1 -1
  126. package/dist/gateway/static/root/assets/phone-model-connection-DZ-ZunPz.js +1 -0
  127. package/dist/gateway/static/root/assets/{phone-model-picker-BbA2iI-3.js → phone-model-picker-DuZc5jYO.js} +1 -1
  128. package/dist/gateway/static/root/assets/phone-settings-page-0u0GQl_R.js +1 -0
  129. package/dist/gateway/static/root/assets/{phone-workspace-store-CVDk80Bf.js → phone-workspace-store-SN7hfddU.js} +1 -1
  130. package/dist/gateway/static/root/assets/plugin-details-dialog-Bfc-Wmrd.js +1 -0
  131. package/dist/gateway/static/root/assets/{popover-select-DD8fmrxH.js → popover-select-CEMWIrtY.js} +1 -1
  132. package/dist/gateway/static/root/assets/{preference-select-fields-BVoN-lAv.js → preference-select-fields-BKeHZLXZ.js} +1 -1
  133. package/dist/gateway/static/root/assets/{product-automation-feedback-DCo90zGh.js → product-automation-feedback-BPur0vyo.js} +2 -2
  134. package/dist/gateway/static/root/assets/{product-open-page-OWl8IAoY.js → product-open-page-Bfd7R483.js} +1 -1
  135. package/dist/gateway/static/root/assets/{product-preview-content-Cjas7UNe.js → product-preview-content-Bnq68oVw.js} +1 -1
  136. package/dist/gateway/static/root/assets/{product-preview-modal-CPWRvBI9.js → product-preview-modal-BPmTeweh.js} +2 -2
  137. package/dist/gateway/static/root/assets/project-detail-page-D9nnyvrI.js +7 -0
  138. package/dist/gateway/static/root/assets/{project-understanding-Ba02SFzB.js → project-understanding-DLvxAoTT.js} +1 -1
  139. package/dist/gateway/static/root/assets/projects-page-BGy1pw9a.js +1 -0
  140. package/dist/gateway/static/root/assets/{providers-api-rwQ4LWzr.js → providers-api-DOnNfkwQ.js} +1 -1
  141. package/dist/gateway/static/root/assets/{recording-upload-BSmvRrZQ.js → recording-upload-CHFJbqW1.js} +1 -1
  142. package/dist/gateway/static/root/assets/{refresh-button-bU_0NarN.js → refresh-button-DiWdGAaX.js} +1 -1
  143. package/dist/gateway/static/root/assets/{registry-api-Vy7LfH6E.js → registry-api-DFDvOTg4.js} +1 -1
  144. package/dist/gateway/static/root/assets/{remote-access-hub-UXrnpGev.js → remote-access-hub-BVqwnOqO.js} +1 -1
  145. package/dist/gateway/static/root/assets/{resource-unavailable-f9OzSi4W.js → resource-unavailable-TQcRCpAg.js} +1 -1
  146. package/dist/gateway/static/root/assets/route-preload-DI43HQV_.js +2 -0
  147. package/dist/gateway/static/root/assets/{runtime-tools-api-Bt8t37z5.js → runtime-tools-api-9o3Wfji1.js} +1 -1
  148. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DU4UXnBm.js → runtime-tools-settings-panel-ccVBG-bZ.js} +1 -1
  149. package/dist/gateway/static/root/assets/{schema-form-BKeP5G7b.js → schema-form-C-jw6Hid.js} +1 -1
  150. package/dist/gateway/static/root/assets/{secret-input-BQvFXqzz.js → secret-input-Dryrns2s.js} +1 -1
  151. package/dist/gateway/static/root/assets/{service-recommendation-list-CuYsRcBB.js → service-recommendation-list-CNghOavt.js} +1 -1
  152. package/dist/gateway/static/root/assets/{session-api-DJI9eSgw.js → session-api-Bs3r_d2_.js} +1 -1
  153. package/dist/gateway/static/root/assets/session-manager-Bnq3qpqy.js +23 -0
  154. package/dist/gateway/static/root/assets/sessions-page-CyBj1Xw2.js +1 -0
  155. package/dist/gateway/static/root/assets/settings-advanced-gate-BI4DMz4_.js +1 -0
  156. package/dist/gateway/static/root/assets/{settings-advanced-section-BxUuF_yi.js → settings-advanced-section-DwpPPxT0.js} +1 -1
  157. package/dist/gateway/static/root/assets/{settings-mode-store-CaoRh2gt.js → settings-mode-store-CiRpsdTJ.js} +1 -1
  158. package/dist/gateway/static/root/assets/{settings-page-qQ8-6dJ_.js → settings-page-Cd8Ermnn.js} +1 -1
  159. package/dist/gateway/static/root/assets/{settings-page-header-CyUHrn7c.js → settings-page-header-BZl4AMiN.js} +1 -1
  160. package/dist/gateway/static/root/assets/{settings-page-layout-DGVqXrlp.js → settings-page-layout-onhEgq-K.js} +1 -1
  161. package/dist/gateway/static/root/assets/setup-interaction-page-Cvvj6JyV.js +1 -0
  162. package/dist/gateway/static/root/assets/setup-status-panel-D4qgE7QM.js +1 -0
  163. package/dist/gateway/static/root/assets/share-link-dialog-DA0QuFOD.js +1 -0
  164. package/dist/gateway/static/root/assets/{share-preview-page-Cem96FbB.js → share-preview-page-YDpIY4dC.js} +1 -1
  165. package/dist/gateway/static/root/assets/{shares-api-Dowes16l.js → shares-api-D8Q-m46d.js} +1 -1
  166. package/dist/gateway/static/root/assets/shares-settings-DUvjOMmA.js +1 -0
  167. package/dist/gateway/static/root/assets/{skill-api-D8ZwFEVe.js → skill-api-uKU4sRiv.js} +1 -1
  168. package/dist/gateway/static/root/assets/{skill-list-api-B4gp00-f.js → skill-list-api-BzKzG-xG.js} +1 -1
  169. package/dist/gateway/static/root/assets/{skill-reload-api-ClmaaDXo.js → skill-reload-api-DkUXekcd.js} +1 -1
  170. package/dist/gateway/static/root/assets/skills-page-ClyNSh-7.js +2 -0
  171. package/dist/gateway/static/root/assets/{system-settings-panel-D095uacX.js → system-settings-panel-BN6sUX0H.js} +1 -1
  172. package/dist/gateway/static/root/assets/task-detail-page-CS9m7Ipo.js +2 -0
  173. package/dist/gateway/static/root/assets/{task-result-evidence-LUrJlUhb.js → task-result-evidence-DKygspo2.js} +1 -1
  174. package/dist/gateway/static/root/assets/{terminal-panel-store-BqEDB1Vl.js → terminal-panel-store-DJVC7HqA.js} +1 -1
  175. package/dist/gateway/static/root/assets/{theme-store-gAcojLgP.js → theme-store-Dlnmgryi.js} +1 -1
  176. package/dist/gateway/static/root/assets/tool-friendly-title-DcCc6g7o.js +1 -0
  177. package/dist/gateway/static/root/assets/tracing-settings-page-Bs76WeoF.js +1 -0
  178. package/dist/gateway/static/root/assets/{tunnel-api-C9u9E3UQ.js → tunnel-api-B7nx0NQJ.js} +1 -1
  179. package/dist/gateway/static/root/assets/{understanding-activity-store-BTrzsR6_.js → understanding-activity-store-C4bblRnQ.js} +1 -1
  180. package/dist/gateway/static/root/assets/{understanding-refresh-store-5Qava3jh.js → understanding-refresh-store-BvCj9-Ue.js} +1 -1
  181. package/dist/gateway/static/root/assets/{usage-page-DFMLYKAc.js → usage-page-anU5gslJ.js} +1 -1
  182. package/dist/gateway/static/root/assets/{use-autosave-3O-X7x15.js → use-autosave-YHxQ-UZg.js} +1 -1
  183. package/dist/gateway/static/root/assets/use-composer-attachments-DYY3Yz4a.js +2 -0
  184. package/dist/gateway/static/root/assets/use-file-preview-expanded-CYgWzDnv.js +2 -0
  185. package/dist/gateway/static/root/assets/{use-personal-profile-MusPgljM.js → use-personal-profile-D2Un8G1L.js} +1 -1
  186. package/dist/gateway/static/root/assets/{use-workspace-tree-Ck_U2yTw.js → use-workspace-tree-Dkg9tUr4.js} +1 -1
  187. package/dist/gateway/static/root/assets/user-model-page-DIgPL3tN.js +2 -0
  188. package/dist/gateway/static/root/assets/{voice-api-key-field-C5zJApoa.js → voice-api-key-field-BUes-Jlp.js} +1 -1
  189. package/dist/gateway/static/root/assets/{voice-config-api-DC1bYDt1.js → voice-config-api-CrULrSKC.js} +1 -1
  190. package/dist/gateway/static/root/assets/{voice-input-shortcut-events-0SZjJdVV.js → voice-input-shortcut-events-DFMNIyy4.js} +1 -1
  191. package/dist/gateway/static/root/assets/voice-transcribe-api-Dy4hfftb.js +1 -0
  192. package/dist/gateway/static/root/assets/{work-discovery-overlay-DAQ8McVe.js → work-discovery-overlay-CFF4cRFl.js} +1 -1
  193. package/dist/gateway/static/root/assets/{work-discovery-page-DUQysEyb.js → work-discovery-page-BnYaVH3V.js} +1 -1
  194. package/dist/gateway/static/root/assets/working-directory-picker-modal-GFwVefVA.js +1 -0
  195. package/dist/gateway/static/root/assets/{workspace-api-ZrN6yUER.js → workspace-api-BdB4NEOh.js} +2 -2
  196. package/dist/gateway/static/root/assets/workspace-editor-agent-store-4cZ26iaD.js +1 -0
  197. package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-Yj_kBWSb.js → workspace-file-preview-dialog-NRL3YRjg.js} +1 -1
  198. package/dist/gateway/static/root/assets/{workspace-open-location-menu-yxT7wajO.js → workspace-open-location-menu-Dcij7wvJ.js} +1 -1
  199. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-IcH9KDzx.js → xopc-cloud-account-card-DC9aG7Pl.js} +1 -1
  200. package/dist/gateway/static/root/index.html +100 -98
  201. package/dist/package.js +1 -1
  202. package/dist/packages/gateway-contract/src/automations.js +7 -0
  203. package/dist/packages/gateway-contract/src/capabilities.js +1 -1
  204. package/dist/src/agent/agent-manager.d.ts +1 -0
  205. package/dist/src/agent/agent-manager.js +1 -0
  206. package/dist/src/agent/child-agent-factory.js +1 -1
  207. package/dist/src/agent/data-acquisition/service.js +1 -1
  208. package/dist/src/agent/embedded/configuration-capability-correction.d.ts +3 -0
  209. package/dist/src/agent/embedded/configuration-capability-correction.js +14 -0
  210. package/dist/src/agent/embedded/run-for-session.js +20 -5
  211. package/dist/src/agent/embedded/run-turn.js +13 -1
  212. package/dist/src/agent/embedded/session-runner.js +6 -3
  213. package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
  214. package/dist/src/agent/image/load-image-media.js +1 -1
  215. package/dist/src/agent/inbound/inbound-loop.js +4 -1
  216. package/dist/src/agent/independent-execution.js +1 -1
  217. package/dist/src/agent/mcp/config.js +1 -1
  218. package/dist/src/agent/mcp/connection-drafts.d.ts +3 -1
  219. package/dist/src/agent/mcp/connection-drafts.js +3 -2
  220. package/dist/src/agent/mcp/connection-setup.js +34 -2
  221. package/dist/src/agent/mcp/conversation-setup.d.ts +163 -0
  222. package/dist/src/agent/mcp/conversation-setup.js +621 -0
  223. package/dist/src/agent/mcp/native-mcp.d.ts +1 -0
  224. package/dist/src/agent/mcp/tool-catalog.d.ts +5 -0
  225. package/dist/src/agent/mcp/tool-catalog.js +19 -2
  226. package/dist/src/agent/mcp/weixin-setup-scope.d.ts +12 -0
  227. package/dist/src/agent/mcp/weixin-setup-scope.js +43 -0
  228. package/dist/src/agent/prompt/conversational-configuration-guide.js +2 -1
  229. package/dist/src/agent/prompt/sections/tooling.js +3 -2
  230. package/dist/src/agent/prompt/service-prompt-builder.js +1 -1
  231. package/dist/src/agent/service/direct-turn-helpers.js +1 -1
  232. package/dist/src/agent/service/process-direct-streaming.js +2 -2
  233. package/dist/src/agent/service.d.ts +2 -0
  234. package/dist/src/agent/service.js +11 -1
  235. package/dist/src/agent/service.types.d.ts +1 -0
  236. package/dist/src/agent/tasks/task-judge-service.js +2 -2
  237. package/dist/src/agent/tool-manuals/xopc-configuration.d.ts +6 -4
  238. package/dist/src/agent/tool-manuals/xopc-configuration.js +92 -8
  239. package/dist/src/agent/tools/automation-tool.d.ts +9 -1
  240. package/dist/src/agent/tools/automation-tool.js +34 -5
  241. package/dist/src/agent/tools/create-share-tool.js +1 -1
  242. package/dist/src/agent/tools/factory.d.ts +3 -0
  243. package/dist/src/agent/tools/factory.js +34 -23
  244. package/dist/src/agent/tools/image-generate-tool.js +3 -3
  245. package/dist/src/agent/tools/index.d.ts +1 -0
  246. package/dist/src/agent/tools/index.js +5 -4
  247. package/dist/src/agent/tools/mcp-setup-tool.d.ts +9 -0
  248. package/dist/src/agent/tools/mcp-setup-tool.js +32 -0
  249. package/dist/src/agent/tools/personal-task-tool.js +2 -2
  250. package/dist/src/agent/tools/publish-artifacts.js +1 -1
  251. package/dist/src/agent/tools/read.js +1 -1
  252. package/dist/src/agent/tools/skill-install-tool.js +56 -1
  253. package/dist/src/agent/tools/skill-manage-tool.d.ts +4 -0
  254. package/dist/src/agent/tools/skill-manage-tool.js +74 -2
  255. package/dist/src/agent/tools/skills-tools.js +1 -1
  256. package/dist/src/agent/tools/task-collaboration-tool.js +1 -1
  257. package/dist/src/agent/tools/tool-manual-tool.d.ts +1 -1
  258. package/dist/src/agent/tools/tool-manual-tool.js +3 -1
  259. package/dist/src/agent/tools/toolExposure.js +2 -0
  260. package/dist/src/agent/tools/write.js +1 -1
  261. package/dist/src/agent/tools/xopc-use-tool.d.ts +4 -2
  262. package/dist/src/agent/tools/xopc-use-tool.js +60 -10
  263. package/dist/src/agent-catalog/service.d.ts +1 -1
  264. package/dist/src/agent-catalog/service.js +2 -1
  265. package/dist/src/automations/capabilities/drafts.js +5 -2
  266. package/dist/src/automations/capabilities/read.js +18 -7
  267. package/dist/src/automations/capabilities/write.d.ts +111 -52
  268. package/dist/src/automations/capabilities/write.js +44 -10
  269. package/dist/src/automations/delivery/delivery-router.d.ts +1 -0
  270. package/dist/src/automations/delivery/delivery-router.js +7 -1
  271. package/dist/src/automations/domain/types.d.ts +8 -0
  272. package/dist/src/automations/domain/validation.d.ts +24 -0
  273. package/dist/src/automations/domain/validation.js +7 -0
  274. package/dist/src/automations/draft/automation-draft-validator.d.ts +6 -0
  275. package/dist/src/automations/index.js +2 -2
  276. package/dist/src/automations/mcp-source.d.ts +60 -0
  277. package/dist/src/automations/mcp-source.js +173 -0
  278. package/dist/src/automations/service/action-executor.js +15 -1
  279. package/dist/src/automations/service/automation-service.d.ts +5 -0
  280. package/dist/src/automations/service/automation-service.js +52 -2
  281. package/dist/src/automations/service/index.js +2 -2
  282. package/dist/src/browser/setup/repository.d.ts +1 -0
  283. package/dist/src/browser/setup/repository.js +7 -1
  284. package/dist/src/browser/setup/service.d.ts +3 -0
  285. package/dist/src/browser/setup/service.js +41 -18
  286. package/dist/src/browser/setup/types.d.ts +1 -0
  287. package/dist/src/channels/attachments/voice-stt-webchat.js +1 -1
  288. package/dist/src/channels/index.js +1 -1
  289. package/dist/src/channels/manager.d.ts +1 -0
  290. package/dist/src/channels/outbound-sender.d.ts +1 -0
  291. package/dist/src/channels/outbound-sender.js +3 -0
  292. package/dist/src/channels/pairing/pairing-service.js +1 -1
  293. package/dist/src/channels/weixin/account-identity.d.ts +2 -0
  294. package/dist/src/channels/weixin/account-identity.js +15 -0
  295. package/dist/src/chat-commands/builtins/config.js +1 -1
  296. package/dist/src/cli/commands/backup.js +1 -1
  297. package/dist/src/cli/commands/channels.js +2 -2
  298. package/dist/src/cli/commands/doctor/checks/channel-pairing-pending.js +1 -1
  299. package/dist/src/cli/commands/mcp.js +1 -1
  300. package/dist/src/config/models-json.d.ts +12 -0
  301. package/dist/src/extensions/agent-plugins/credentials.js +1 -1
  302. package/dist/src/extensions/agent-plugins/setup.d.ts +1 -1
  303. package/dist/src/extensions/agent-plugins/setup.js +3 -3
  304. package/dist/src/extensions/api.js +1 -1
  305. package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
  306. package/dist/src/gateway/agents-admin.js +1 -1
  307. package/dist/src/gateway/device-routes.js +1 -1
  308. package/dist/src/gateway/global-defaults-admin.js +1 -1
  309. package/dist/src/gateway/hono/app.js +1 -1
  310. package/dist/src/gateway/hono/lib/config-payload.js +1 -1
  311. package/dist/src/gateway/hono/oauth-async.js +1 -1
  312. package/dist/src/gateway/hono/routes/channels.js +1 -1
  313. package/dist/src/gateway/hono/routes/config.js +1 -1
  314. package/dist/src/gateway/hono/routes/lazy-bundles.js +1 -1
  315. package/dist/src/gateway/hono/routes/mcp.js +39 -2
  316. package/dist/src/gateway/hono/routes/notes.js +2 -2
  317. package/dist/src/gateway/hono/routes/phone-setup.js +45 -16
  318. package/dist/src/gateway/hono/routes/phone.js +2 -4
  319. package/dist/src/gateway/hono/routes/projects.js +1 -1
  320. package/dist/src/gateway/hono/routes/provider-setup.js +1 -1
  321. package/dist/src/gateway/hono/routes/public-gateway.js +22 -0
  322. package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
  323. package/dist/src/gateway/hono/routes/shares.js +1 -1
  324. package/dist/src/gateway/hono/routes/site-shares.js +1 -1
  325. package/dist/src/gateway/hono/routes/tasks.js +1 -1
  326. package/dist/src/gateway/media-access.js +1 -1
  327. package/dist/src/gateway/service/agent-runner.d.ts +1 -0
  328. package/dist/src/gateway/service/agent-runner.js +3 -1
  329. package/dist/src/gateway/service/config-coordinator.d.ts +1 -1
  330. package/dist/src/gateway/service/config-coordinator.js +2 -1
  331. package/dist/src/gateway/service/run-gateway-agent.js +1 -1
  332. package/dist/src/gateway/service/sessions-api.js +2 -1
  333. package/dist/src/gateway/service.d.ts +5 -1
  334. package/dist/src/gateway/service.js +86 -12
  335. package/dist/src/gateway/session-context-summary.js +1 -1
  336. package/dist/src/gateway/session-reset-service.d.ts +1 -0
  337. package/dist/src/gateway/session-reset-service.js +15 -2
  338. package/dist/src/gateway/xopc-cloud-capability-setup.js +9 -1
  339. package/dist/src/notes/service.js +1 -1
  340. package/dist/src/personal-agent/prompts.js +1 -1
  341. package/dist/src/personal-agent/reply-composer.js +2 -2
  342. package/dist/src/personal-agent/request-service.js +3 -3
  343. package/dist/src/personal-agent/service.js +1 -1
  344. package/dist/src/personal-agent/task-cancel.js +1 -1
  345. package/dist/src/phone/cloud-adb-connection.js +8 -5
  346. package/dist/src/phone/contracts.d.ts +4 -0
  347. package/dist/src/phone/contracts.js +6 -1
  348. package/dist/src/phone/gui-protocol.d.ts +7 -0
  349. package/dist/src/phone/gui-protocol.js +302 -0
  350. package/dist/src/phone/model-adapter.d.ts +1 -1
  351. package/dist/src/phone/model-adapter.js +7 -4
  352. package/dist/src/phone/runtime.js +8 -2
  353. package/dist/src/phone/setup/service.d.ts +14 -4
  354. package/dist/src/phone/setup/service.js +106 -28
  355. package/dist/src/phone/ui-dump-binary.d.ts +1 -1
  356. package/dist/src/phone/ui-dump-binary.js +1 -1
  357. package/dist/src/phone/ui-session.d.ts +2 -0
  358. package/dist/src/phone/ui-session.js +23 -4
  359. package/dist/src/projects/index.js +1 -1
  360. package/dist/src/projects/project-service.js +1 -1
  361. package/dist/src/providers/env-keys.js +2 -0
  362. package/dist/src/providers/index.js +11 -0
  363. package/dist/src/providers/model-catalog-types.d.ts +1 -1
  364. package/dist/src/providers/model-supplements.d.ts +1 -1
  365. package/dist/src/providers/model-supplements.js +6 -3
  366. package/dist/src/providers/phone-models.d.ts +3 -0
  367. package/dist/src/providers/phone-models.js +33 -0
  368. package/dist/src/providers/presentation.js +0 -1
  369. package/dist/src/runtime-tools/phone-dependencies.d.ts +2 -0
  370. package/dist/src/runtime-tools/phone-dependencies.js +10 -0
  371. package/dist/src/share/note-share-service.js +1 -1
  372. package/dist/src/share/site-proxy.js +1 -1
  373. package/dist/src/tasks/capabilities/write.js +1 -1
  374. package/dist/src/tasks/index.js +1 -1
  375. package/dist/src/tasks/task-allocation-service.js +3 -3
  376. package/dist/src/tasks/task-application-service.js +2 -2
  377. package/dist/src/tasks/task-context-assembler.js +1 -1
  378. package/dist/src/tasks/task-contract-planner.js +1 -1
  379. package/dist/src/tasks/task-handoff.js +1 -1
  380. package/dist/src/tasks/task-research-result.js +1 -1
  381. package/dist/src/tasks/task-run-coordinator.js +2 -2
  382. package/dist/src/tui/backends/embedded-backend.js +1 -1
  383. package/dist/src/tui/tui.js +1 -1
  384. package/dist/src/voice/platform-catalog.d.ts +1 -1
  385. package/package.json +3 -1
  386. package/skills/tools/configure-xopc/SKILL.md +10 -3
  387. package/skills/tools/configure-xopc/references/browser/chrome-extension.md +4 -1
  388. package/skills/tools/configure-xopc/references/browser/overview.md +2 -2
  389. package/skills/tools/configure-xopc/references/phone/aliyun.md +3 -2
  390. package/skills/tools/configure-xopc/references/phone/overview.md +2 -2
  391. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DlvjxWg6.js +0 -1
  392. package/dist/gateway/static/root/assets/agent-plugin-dialog-OBueuQSc.js +0 -1
  393. package/dist/gateway/static/root/assets/agents-Cp6_5OOQ.js +0 -77
  394. package/dist/gateway/static/root/assets/app-link-1j40sJ-z.js +0 -1
  395. package/dist/gateway/static/root/assets/apps-page-C2WKUwtN.js +0 -1
  396. package/dist/gateway/static/root/assets/attachment-load-qjPpQzYY.js +0 -1
  397. package/dist/gateway/static/root/assets/automation-task-card-wbnR5i6N.js +0 -3
  398. package/dist/gateway/static/root/assets/automations-workspace-D6cTOKr7.js +0 -9
  399. package/dist/gateway/static/root/assets/browser-settings-page-L0nBjfhG.js +0 -3
  400. package/dist/gateway/static/root/assets/capabilities-aT-QjNTl.js +0 -1
  401. package/dist/gateway/static/root/assets/capabilities-page-DlpuHdHi.js +0 -2
  402. package/dist/gateway/static/root/assets/capabilities-settings-panel-pvqkN2-2.js +0 -8
  403. package/dist/gateway/static/root/assets/channels-BUPtawh6.js +0 -1
  404. package/dist/gateway/static/root/assets/chat-page-BP0huA-W.js +0 -72
  405. package/dist/gateway/static/root/assets/composer-payload-handoff-CYIhcczq.js +0 -1
  406. package/dist/gateway/static/root/assets/confirm-dialog-XGclfBqe.js +0 -1
  407. package/dist/gateway/static/root/assets/connected-providers-grid-CKZfhHSD.js +0 -1
  408. package/dist/gateway/static/root/assets/connectors-page-Lf1ZzaVn.js +0 -1
  409. package/dist/gateway/static/root/assets/dependency-picker-UqKVJ9dv.js +0 -1
  410. package/dist/gateway/static/root/assets/device-pairing-wizard-ByEL5lvM.js +0 -1
  411. package/dist/gateway/static/root/assets/dist-CaUuvp8-.js +0 -1
  412. package/dist/gateway/static/root/assets/dist-D3lWNSe7.js +0 -1
  413. package/dist/gateway/static/root/assets/dist-DfWfZ9iu.js +0 -1
  414. package/dist/gateway/static/root/assets/dist-DusecO_p.js +0 -1
  415. package/dist/gateway/static/root/assets/gateway-realtime-store-Bkt1z-xo.js +0 -1
  416. package/dist/gateway/static/root/assets/home-page-k9LFXcVa.js +0 -2
  417. package/dist/gateway/static/root/assets/index-CpwPxKQ8.css +0 -1
  418. package/dist/gateway/static/root/assets/index-DKW7BeT_.js +0 -11
  419. package/dist/gateway/static/root/assets/install-connector-dialog-CTQAKTPv.js +0 -1
  420. package/dist/gateway/static/root/assets/local-app-workbench-page-CD_8_gd_.js +0 -1
  421. package/dist/gateway/static/root/assets/management-settings-t_Z2mCyw.js +0 -1
  422. package/dist/gateway/static/root/assets/messages-DG4HLOER.js +0 -3
  423. package/dist/gateway/static/root/assets/model-selector-a7PIT1Lk.js +0 -1
  424. package/dist/gateway/static/root/assets/note-detail-panel-BsHYUFgk.js +0 -5
  425. package/dist/gateway/static/root/assets/note-image-lightbox-B-bEtjhj.js +0 -1
  426. package/dist/gateway/static/root/assets/page-header-store-BdZnUh-D.js +0 -1
  427. package/dist/gateway/static/root/assets/personal-page-KJezmTKP.js +0 -1
  428. package/dist/gateway/static/root/assets/phone-settings-page-Cg_BPss4.js +0 -1
  429. package/dist/gateway/static/root/assets/plugin-details-dialog-DgibLkc3.js +0 -1
  430. package/dist/gateway/static/root/assets/project-detail-page-B_HlZux_.js +0 -7
  431. package/dist/gateway/static/root/assets/projects-page-CdfKjp95.js +0 -1
  432. package/dist/gateway/static/root/assets/route-preload-BtObM-co.js +0 -2
  433. package/dist/gateway/static/root/assets/session-manager-CtKgACGl.js +0 -23
  434. package/dist/gateway/static/root/assets/sessions-page-BAsKzRHt.js +0 -1
  435. package/dist/gateway/static/root/assets/settings-advanced-gate-CjAFqg2U.js +0 -1
  436. package/dist/gateway/static/root/assets/setup-status-panel-BpaPb625.js +0 -1
  437. package/dist/gateway/static/root/assets/share-link-dialog-CQJ6Ykm2.js +0 -1
  438. package/dist/gateway/static/root/assets/shares-settings-DZEkZDR0.js +0 -1
  439. package/dist/gateway/static/root/assets/skills-page-CV0X9rvG.js +0 -2
  440. package/dist/gateway/static/root/assets/task-detail-page-CY2C4AM2.js +0 -2
  441. package/dist/gateway/static/root/assets/tool-friendly-title-o6sxGVUu.js +0 -1
  442. package/dist/gateway/static/root/assets/tracing-settings-page-B1ZRh-Is.js +0 -1
  443. package/dist/gateway/static/root/assets/use-composer-attachments-BLc4dBfe.js +0 -2
  444. package/dist/gateway/static/root/assets/use-file-preview-expanded-BaOmTXsT.js +0 -2
  445. package/dist/gateway/static/root/assets/user-model-page-Den5Lg-k.js +0 -2
  446. package/dist/gateway/static/root/assets/voice-transcribe-api-CxVeANPX.js +0 -1
  447. package/dist/gateway/static/root/assets/working-directory-picker-modal-BO9qdJyZ.js +0 -1
  448. package/dist/gateway/static/root/assets/workspace-editor-agent-store-Bo5dwoWP.js +0 -1
@@ -1,6 +1,6 @@
1
+ import { resolveMcpSetupConfig } from "./effective-server.js";
1
2
  import { createEmbeddedModelRuntime } from "../embedded/model-runtime.js";
2
3
  import { getNativePiAgentDir, prepareNativeMcpConfig } from "./native-mcp.js";
3
- import { resolveMcpSetupConfig } from "./effective-server.js";
4
4
  import { join } from "node:path";
5
5
  import { InMemoryCredentialStore, InMemoryModelsStore } from "@earendil-works/pi-ai";
6
6
  import { DefaultResourceLoader, ModelRuntime, SessionManager, SettingsManager, createAgentSession, createMcpExtension, createToolSearchExtension } from "@earendil-works/pi-coding-agent";
@@ -22,6 +22,22 @@ async function runNativeMcpSession(config, workspaceDir, serverId, interaction,
22
22
  const entry = loaded.servers.find((server) => server.name === serverId);
23
23
  if (!entry) throw new Error(`MCP server "${serverId}" is not configured or has invalid configuration.`);
24
24
  if (entry.config.enabled === false) throw new Error(`MCP server "${serverId}" is disabled.`);
25
+ if (interaction && options?.callbackRelayUrl && "url" in entry.config) {
26
+ const relay = new URL(options.callbackRelayUrl);
27
+ if (relay.protocol !== "https:" && !(relay.protocol === "http:" && [
28
+ "127.0.0.1",
29
+ "localhost",
30
+ "[::1]"
31
+ ].includes(relay.hostname))) throw new Error("A secure callback relay is required.");
32
+ if (relay.username || relay.password || relay.search || relay.hash) throw new Error("Invalid callback relay.");
33
+ entry.config = {
34
+ ...entry.config,
35
+ oauth: {
36
+ ...entry.config.oauth,
37
+ callbackRelayUrl: relay.href
38
+ }
39
+ };
40
+ }
25
41
  const agentDir = getNativePiAgentDir();
26
42
  const settingsManager = SettingsManager.inMemory({
27
43
  retry: { enabled: false },
@@ -116,7 +132,8 @@ async function runNativeMcpSession(config, workspaceDir, serverId, interaction,
116
132
  name: tool.name,
117
133
  description: tool.description,
118
134
  inputSchema: tool.parameters,
119
- exposure: tool.exposure
135
+ exposure: tool.exposure,
136
+ annotations: tool.annotations
120
137
  })).sort((a, b) => a.name.localeCompare(b.name));
121
138
  } finally {
122
139
  try {
@@ -0,0 +1,12 @@
1
+ import type { Config } from '../../config/schema.js';
2
+ export type WeixinPrivateIdentity = {
3
+ accountId: string;
4
+ peerId: string;
5
+ principalId: string;
6
+ };
7
+ export type WeixinSetupScope = WeixinPrivateIdentity & {
8
+ origin: string;
9
+ };
10
+ /** Pairing permits a bounded proposal; it never grants general owner authority. */
11
+ export declare function weixinPrivateIdentity(conversationId: string, config: Config): WeixinPrivateIdentity | undefined;
12
+ export declare function weixinSetupScope(conversationId: string, config: Config): WeixinSetupScope | undefined;
@@ -0,0 +1,43 @@
1
+ import { getConversationRouting } from "../../storage/sqlite/conversation-repository.js";
2
+ import { init_session_key } from "../../routing/session-key.js";
3
+ import { weixinAccountIdentityRevision } from "../../channels/weixin/account-identity.js";
4
+ import { resolveWeixinAllowFromPath } from "../../channels/pairing/paths.js";
5
+ import { readAllowFromIdsSync } from "../../channels/pairing/allow-from-file.js";
6
+ import { resolveReverseProxyPublicUrl } from "../../gateway/public-url.js";
7
+ //#region src/agent/mcp/weixin-setup-scope.ts
8
+ init_session_key();
9
+ /** Pairing permits a bounded proposal; it never grants general owner authority. */
10
+ function weixinPrivateIdentity(conversationId, config) {
11
+ if (config.session.dmScope !== "per-account-channel-peer" || Object.keys(config.session.identityLinks ?? {}).length) return;
12
+ const route = getConversationRouting(conversationId);
13
+ if (route?.source !== "weixin" || route.peerKind !== "direct" || !route.accountId || !route.peerId) return;
14
+ const section = config.channels?.weixin;
15
+ const account = section?.accounts?.[route.accountId];
16
+ if (section?.enabled !== true || account?.enabled === false || (account?.dmPolicy ?? section.dmPolicy) === "disabled") return;
17
+ if (![...account?.allowFrom ?? section.allowFrom ?? [], ...readAllowFromIdsSync(resolveWeixinAllowFromPath(route.accountId))].some((id) => id.trim().toLowerCase() === route.peerId.toLowerCase())) return;
18
+ const loginRevision = weixinAccountIdentityRevision(route.accountId);
19
+ if (!loginRevision) return;
20
+ return {
21
+ accountId: route.accountId,
22
+ peerId: route.peerId,
23
+ principalId: `channel:weixin:${route.accountId}:direct:${route.peerId}:login:${loginRevision}`
24
+ };
25
+ }
26
+ function weixinSetupScope(conversationId, config) {
27
+ const identity = weixinPrivateIdentity(conversationId, config);
28
+ if (!identity) return;
29
+ const origin = resolveReverseProxyPublicUrl(config);
30
+ if (!origin) return;
31
+ const url = new URL(origin);
32
+ if (url.protocol !== "https:" && ![
33
+ "127.0.0.1",
34
+ "localhost",
35
+ "[::1]"
36
+ ].includes(url.hostname)) return;
37
+ return {
38
+ ...identity,
39
+ origin
40
+ };
41
+ }
42
+ //#endregion
43
+ export { weixinPrivateIdentity, weixinSetupScope };
@@ -19,7 +19,8 @@ or topic:"settings", "automation", "connections" as relevant; no need to load a
19
19
  /** Tool registration already reflects the host's allowlist and deny policy. */
20
20
  function getConversationalConfigurationGuide(toolNames) {
21
21
  if (!toolNames.includes("xopc_use")) return "";
22
- return toolNames.includes("tool_manual") ? conversationalConfigurationGuide : conversationalConfigurationGuide.replace(manualRouting, "No tool_manual is registered. Use documented registered parameters; report a blocker if required details are unavailable.\n");
22
+ const guide = `${toolNames.includes("tool_manual") ? conversationalConfigurationGuide : conversationalConfigurationGuide.replace(manualRouting, "No tool_manual is registered. Use documented registered parameters; report a blocker if required details are unavailable.\n")}\nxopc_use is registered and may be deferred. If its schema is absent and tool_search is available, discover the exact name before reporting it missing. Never bypass policy.\n${toolNames.includes("mcp_setup") ? "HTTP MCP: mcp_setup is directly available. Its probes execute on the Gateway host; user-provided loopback addresses are supported. Check with this tool before claiming a missing capability or unreachable address. Use inspect/start/advance; secrets use interactionPath.\n" : ""}`;
23
+ return toolNames.includes("skill_manage") ? `${guide}\nFor Skill configuration use skill_manage status/enable/disable/delete and skill_install; never edit product storage through shell/file tools. A clear request to install a specified source already authorizes that installation: do not ask for the same confirmation again. Search or a pasted URL alone does not authorize installation; overwrites or additional permissions require their own authorization. Load the skills manual topic when needed. Installation is not a verified first use. For an explicit HTTP MCP service address, use xopc_use mode mcp_setup and manual topic mcp; credentials use its trusted interaction page.\n` : guide;
23
24
  }
24
25
  //#endregion
25
26
  export { conversationalConfigurationGuide, getConversationalConfigurationGuide };
@@ -68,12 +68,12 @@ const CORE_TOOL_SUMMARIES = {
68
68
  session_status: "Show session usage/time/model state",
69
69
  tool_manual: "Load built-in usage manuals for complex tools",
70
70
  delegate_task: "Spawn an isolated sub-agent for a delegated task",
71
- automation: "Manage product automations",
71
+ automation: "Manage product automations; explicit local create/edit/pause/resume/delete requests authorize that operation without duplicate confirmation",
72
72
  skills_list: "List available skills",
73
73
  skill_view: "Load a skill SKILL.md or sub-documents",
74
74
  skill_manage: "Create or update skills on disk",
75
75
  skills_marketplace_search: "Search and rank skills across Store, ClawHub, and skills.sh without installing",
76
- skill_install: "Install a skill from an explicit Git, archive, file, or local source after confirmation",
76
+ skill_install: "Install a skill from a marketplace or explicit source when the user requests installation; that request is consent, do not ask again",
77
77
  todo: "Manage in-session todo items",
78
78
  clarify: "Ask the user a blocking clarification question",
79
79
  text_to_speech: "Send a standalone voice message",
@@ -132,6 +132,7 @@ function buildToolingSection(params) {
132
132
  "## Tooling",
133
133
  "Tool availability (filtered by policy):",
134
134
  "Use only case-sensitive names in current function schemas; prose/history examples grant no tool. Never probe invented names. Missing prerequisites: give a final blocker, without unrelated calls.",
135
+ availableTools.has("tool_search") ? "Registered tools may be deferred. Use tool_search for the exact name before reporting it missing; call only after its schema loads." : "",
135
136
  hasPublishArtifacts && !hasRead && !hasWrite && !hasPatch && !hasExec ? "Only publication is available for workspace files. For a request to edit then publish, editing is blocked: make no publication call and explain the limitation. Publish an existing file only when the user requests that existing content without an outstanding edit." : "",
136
137
  "When a tool returns an xopc product link, reuse its exact URL in a Markdown link with a short descriptive label in the user's language (for example, [打开会话](url)). Do not invent link parameters, escape the link brackets/parentheses, or wrap a navigation link in a code span. Avoid repeating raw URLs or internal object metadata unless requested.",
137
138
  toolLines.length > 0 ? toolLines.join("\n") : "- No tools are registered for this session.",
@@ -9,9 +9,9 @@ import "../../storage/sqlite/index.js";
9
9
  import { appendStablePromptSection } from "./cache-boundary.js";
10
10
  import { getUserTimezone } from "../../user-model/repository.js";
11
11
  import "../../user-model/index.js";
12
+ import { resolveResponseLanguageForSession } from "./response-language.js";
12
13
  import { resolveSystemPromptBuildParams } from "./system-prompt-params.js";
13
14
  import { buildSystemPrompt } from "./system-prompt.js";
14
- import { resolveResponseLanguageForSession } from "./response-language.js";
15
15
  import { buildTtsSystemPromptHint } from "../../voice/tts/directives.js";
16
16
  import { mergeTtsConfigFromAppConfig } from "../../voice/tts/merge-config.js";
17
17
  import { getConversationalConfigurationGuide } from "./conversational-configuration-guide.js";
@@ -2,9 +2,9 @@ import { getConnectionResumeInput, init_connection_wait_repository } from "../..
2
2
  import { getClarificationResumeInput } from "../../storage/sqlite/clarification-wait-repository.js";
3
3
  import { isPersonalConversation } from "../../personal-agent/repository.js";
4
4
  import { phoneResumeForRun } from "../../phone/assistance.js";
5
+ import { buildDelegatedTaskDirective, buildTaskExecutionDirective } from "../../tasks/task-context-assembler.js";
5
6
  import { resolveImageHandlingStrategy } from "../image/vision-detection.js";
6
7
  import { hydrateUserTurnForLlm } from "../inbound/attachment-pipeline.js";
7
- import { buildDelegatedTaskDirective, buildTaskExecutionDirective } from "../../tasks/task-context-assembler.js";
8
8
  import { shouldSkipResetOverlapCommand } from "../../session/reset-triggers.js";
9
9
  import { parseSlashCommand } from "../../chat-commands/command-parse.js";
10
10
  import { personalCommandRejection } from "../../chat-commands/personal-command-policy.js";
@@ -8,11 +8,11 @@ import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
8
8
  import { init_model_usage, modelUsageOriginFromTurn, withModelUsageOrigin } from "../../providers/model-usage.js";
9
9
  import { init_agent_session_key, resolveAgentMainConversationId } from "../../routing/agent-session-key.js";
10
10
  import { phoneResumeForRun } from "../../phone/assistance.js";
11
- import { abortEmbeddedRun } from "../embedded/runs.js";
12
- import { clearPendingTranscriptUserMessage, setPendingTranscriptUserMessage } from "../inbound/attachment-pipeline.js";
13
11
  import { mergeSttConfigFromAppConfig } from "../../voice/stt/config.js";
14
12
  import "../../voice/stt/index.js";
15
13
  import { isSessionSourceBinding, summarizeSourceContext } from "../source-context/types.js";
14
+ import { abortEmbeddedRun } from "../embedded/runs.js";
15
+ import { clearPendingTranscriptUserMessage, setPendingTranscriptUserMessage } from "../inbound/attachment-pipeline.js";
16
16
  import { formatAgentRunErrorForClient } from "../client-error-format.js";
17
17
  import { resolveConfiguredActivityDetailDefault, resolveEffectiveReasoningLevel } from "../../session/thinking-resolve.js";
18
18
  import { initSessionTurn } from "../../session/init-session-turn.js";
@@ -182,6 +182,8 @@ export declare class AgentService {
182
182
  * `agentService.sessionStore.*` directly.
183
183
  */
184
184
  clearSessionMessages(key: string): Promise<void>;
185
+ /** Revoke setup grants and release independent verification sessions before resetting. */
186
+ cancelConfigurationSetups(conversationId: string): Promise<void>;
185
187
  /**
186
188
  * Reset session transcript (archive + new session id) and evict in-memory agent state.
187
189
  * Preserves the session key and persisted per-session overrides.
@@ -20,13 +20,13 @@ import { removeSkillsLockEntry } from "./skills/hub-lock.js";
20
20
  import { installSkillFromZip } from "./skills/managed-store.js";
21
21
  import { resolveWorkspaceSkillsDir, resolveWorkspaceSkillsLockPath } from "./skills/workspace-skills-dir.js";
22
22
  import { pullSkillFromSource } from "./skills/hub-pull.js";
23
+ import { resolveResponseLanguageForSession } from "./prompt/response-language.js";
23
24
  import { persistInboundAttachments } from "../channels/attachments/inbound-persist.js";
24
25
  import { buildTranscriptUserMessage, hydrateUserTurnForLlm } from "./inbound/attachment-pipeline.js";
25
26
  import { drainEmbeddedSessionRunnerShutdowns } from "./embedded/session-runner.js";
26
27
  import { resolveCompactionPolicy } from "./memory/compaction-policy.js";
27
28
  import { getModelThinking } from "../providers/model-thinking.js";
28
29
  import { runXopcEmbeddedTurn } from "./embedded/run-turn.js";
29
- import { resolveResponseLanguageForSession } from "./prompt/response-language.js";
30
30
  import { normalizeSkillInstallTarget } from "./skills/install-target.js";
31
31
  import { AgentManager } from "./agent-manager.js";
32
32
  import { MAX_WEBCHAT_ATTACHMENT_FILE_BYTES } from "../gateway/chat-limits.js";
@@ -237,6 +237,7 @@ var AgentService = class {
237
237
  getAutomationService: config.getAutomationService,
238
238
  getBrowserAutomationService: config.getBrowserAutomationService,
239
239
  getBrowserSetupService: config.getBrowserSetupService,
240
+ getMcpSetupService: config.getMcpSetupService,
240
241
  getPhoneSetupService: config.getPhoneSetupService,
241
242
  canConfigureEndpoint: config.canConfigureEndpoint,
242
243
  emitBrowserEvent: config.emitBrowserEvent,
@@ -798,6 +799,10 @@ var AgentService = class {
798
799
  await this.sessionStore.saveMessages(key, []);
799
800
  this.agentManager.removeAgent(key);
800
801
  }
802
+ /** Revoke setup grants and release independent verification sessions before resetting. */
803
+ async cancelConfigurationSetups(conversationId) {
804
+ await Promise.all([this.config.getPhoneSetupService?.()?.cancelConversation(conversationId), this.config.getBrowserSetupService?.()?.cancelConversation(conversationId)]);
805
+ }
801
806
  /**
802
807
  * Reset session transcript (archive + new session id) and evict in-memory agent state.
803
808
  * Preserves the session key and persisted per-session overrides.
@@ -805,6 +810,11 @@ var AgentService = class {
805
810
  async resetSession(key) {
806
811
  const { abortEmbeddedRun } = await import("./embedded/runs.js");
807
812
  await abortEmbeddedRun(key);
813
+ await this.cancelConfigurationSetups(key);
814
+ const { getPhoneRuntime } = await import("../phone/runtime.js");
815
+ const { cancelPhoneAssistance } = await import("../phone/assistance.js");
816
+ cancelPhoneAssistance(key);
817
+ await getPhoneRuntime().stop(key, "close");
808
818
  const task = await this.sessionStore.reset(key);
809
819
  if (!task) return null;
810
820
  this.agentManager.removeAgent(key);
@@ -32,6 +32,7 @@ export interface AgentServiceConfig {
32
32
  canConfigureEndpoint?: (endpointId: string) => boolean;
33
33
  getPhoneSetupService?: () => import('../phone/setup/service.js').PhoneSetupService | undefined;
34
34
  getBrowserSetupService?: () => import('../browser/setup/service.js').BrowserSetupService | undefined;
35
+ getMcpSetupService?: () => import('./mcp/conversation-setup.js').McpConversationSetup | undefined;
35
36
  getBrowserAutomationService?: () => import('../browser/automations/index.js').BrowserAutomationService | undefined;
36
37
  emitBrowserEvent?: (type: string, payload: unknown) => void;
37
38
  /** Gateway: exposes first-class xopc product objects for the `xopc_use` tool. */
@@ -12,10 +12,10 @@ import { resolveTaskLocale } from "../../tasks/task-language.js";
12
12
  import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
13
13
  import { readWorkspaceRevision } from "../coding/workspace-revision.js";
14
14
  import { TaskCollaborationRepository } from "../../tasks/task-collaboration-repository.js";
15
+ import { TaskApplicationService } from "../../tasks/task-application-service.js";
16
+ import { resolveResponseLanguageForSession } from "../prompt/response-language.js";
15
17
  import { currentTaskResearchResult } from "../../tasks/task-research-result.js";
16
18
  import { buildResponseLanguageSection } from "../prompt/sections/response-language.js";
17
- import { resolveResponseLanguageForSession } from "../prompt/response-language.js";
18
- import { TaskApplicationService } from "../../tasks/task-application-service.js";
19
19
  //#region src/agent/tasks/task-judge-service.ts
20
20
  init_schema();
21
21
  init_providers();
@@ -1,10 +1,12 @@
1
1
  /** Focused product workflows; loaded on demand instead of expanding every turn. */
2
2
  export declare const xopcConfigurationTopics: {
3
+ readonly mcp: "# HTTP MCP configuration\nIn Weixin do not inspect the global registry. The host chooses a stable connection id from\nthe exact service and private identity; use the returned serverId, and displayName for human\nlabels. Different service URLs never overwrite a connection because a model reused a name.\nA paired Weixin direct conversation can propose a new connection when the host has a secure\ngateway.publicUrl. Its returned absolute interactionPath requires authenticated owner approval\nof the exact service and Weixin identity, then secure Token/OAuth input. Send that exact link\nand stop; never ask for a secret, callback URL or continue reply in Weixin. The host resumes\nand delivers the actual result to the same original account/peer after authorization.\nPairing is not owner authority; no replacing/removing shared connections through this proposal.\nMissing pairing, HTTPS access or login is an honest blocker. Do not bypass it with local tools.\nWhen registered use mcp_setup; otherwise use xopc_use mode mcp_setup, the equivalent adapter.\nProbes run on the Gateway host, including user-provided HTTP loopback addresses. Never infer\nreachability from the browser/device context; use the actual probe and report its result.\ninspect {} returns configured server IDs and revisions without\nsecrets. For a clear connection request start {serverId,url,purpose,displayName?,expectedRevision?}.\nUse displayName for the user's service name. Derive a simple ASCII serverId when none was\nsupplied; do not ask users to invent technical identifiers. Use only the user-supplied or\nverified service URL, never invent one. start is HTTP-only and does\nnot execute package installers. purpose preserves the original user objective. Replacing a\nconfigured server requires its revision from inspect. Do not alter managed connectors/plugins.\nThen advance {setupId,expectedVersion} using the returned version. get {setupId} refreshes\nstatus; cancel requires the current version. OAuth/Token steps provide interactionPath:\nlink to that trusted product page, never request credentials or OAuth callbacks in chat.\nUse the exact returned interactionPath in a Markdown link; Weixin paths are absolute. Never prepend localhost or an origin to a relative product path. Do not invent a URL\nscheme or setup id. The host also displays a trusted Complete connection action above input.\nThe page owns sign-in, safe credential entry, verification and automatic return to the\noriginal objective. When ready/continuationQueued is returned, stop this turn; the host\ncontinues in a fresh turn where native MCP tools can load. Use native tool_search and the\ndiscovered exact tools for the original read; do not invent a tool name or claim a read from\ntool counts. set_enabled {serverId,enabled,expectedRevision} and remove {serverId,expectedRevision}\nchange local custom-server configuration. Removal does not revoke remote OAuth authorization\nor uninstall a package. A clear request to connect, disable, enable or remove a specific local\nconnection already authorizes that operation; do not ask for the same confirmation again.\nNew overwrite scope or additional privileges still require authorization. Respect permission refusals and report blocked/reload_required states.\nFor an already configured healthy service prefer its actual tools over replacing its setup.";
4
+ readonly skills: "# Skill configuration\nUse skill_manage status to inspect installed skills, including disabled ones and current Agent\navailability. skills_list contains only usable skills. Search with skills_marketplace_search;\nrecommendation alone never authorizes installation. Install an exact returned reference with\nskill_install only for a clear installation request. Default target is global; explain that\nscope, and use workspace when explicitly requested. Do not force-overwrite an existing skill\nwithout an explicit update/replace request. After an uncertain install inspect status and the\nexisting source before retrying; do not blindly reinstall. Enable/disable with skill_manage;\nthese flags are shared by name, not per-Agent permissions. Inspect the resulting state; do\nnot widen an allowlist, install dependencies through shell or ask for secrets in chat.\nDelete/uninstall with skill_manage delete only for writable managed user skills; bundled,\nplugin-owned and extra-directory skills must retain their owner management path. After\ninstallation, read skill_view and complete the user's requested first task. Return an actual\nresult, two relevant example requests and the installed-skills link. A ready state is not a\nsuccessful task test. Never claim success when requirements or Agent policy still block use.";
3
5
  readonly agent: "# xopc Agent configuration\nThe host's current Agent id is authoritative. \"You / this assistant\" means that Agent,\nnot main or the default Agent. Read agent get {id} (or list for discovery) for revision\nand effective inherited configuration. For identity changes prefer agent patch_profile\n{id,expectedRevision,patch:{name?,description?,style?,language?,...},idempotencyKey?}:\nomitted fields are preserved atomically. Existing agent update {id,expectedRevision,patch}\nremains a full replacement for patch.profile, so include every field to retain when using it.\nSet a chat model with update patch.models.chat={primary:\"provider/model\",fallbacks:[]}.\nChange only the requested Agent. Global defaults and other Agents are separate explicit\nrequests and still require permission. For creation list first, then create\n{id,profile:{name,language?,style?}}; do not invent a Project or custom workspace.\nset_default {id,expectedRevision} uses the catalog revision from list, not an Agent revision.\nAfter a revision conflict re-read the target, preserve concurrent fields and retry the\nrequested change once with the new revision and a new intent key. After an uncertain write,\ninspect first and retain the original idempotency key. A permission denial is not a conflict:\ndo not switch identity, target or tools to bypass it. Inspect returned product ok and saved\nfields before reporting success. A saved model reference does not prove it can be called.";
4
- readonly phone_setup: "# Phone setup\nUse configure-xopc and references/phone/overview.md. Use plain conversation, never embedded chat\nconfiguration panels. mode phone_setup inspect/preview/start inspect or resume; models lists\ncompatible models. get/recheck/verification_report/cancel/release take {setupId}.\nAutomate source {setupId,source:local|aliyun,expectedRevision}, configure {setupId,enabled:true,\nexpectedRevision}, install_dependency {setupId,kind:adb|scrcpy,repair?:true,expectedRevision},\nset_model {setupId,modelRef:<listed compatible ref>,expectedRevision,replaceExisting?:true},\nregister_local {setupId,serial:<discovered online serial>,name?,expectedRevision}, and\nbegin_verification {setupId,deviceId,expectedRevision}. Writes require a host-authorized\ninteractive turn and preserve current policy. dryRun never writes. Do not silently select a\nphone, change the chat model, widen app access, use shell installs or submit keys in chat.\nUse set_model for the dedicated Phone model only; it cannot change the chat model; credentials use secure settings.\nExplain the Settings-only goal, screenshot sharing and model costs before testing. Get provides\nattempt.goal/completion/maxActions. Use phone_use open, observe, run, close, then verification_report.\nUser-only work is physical USB/RSA, login/OAuth, private-key entry/upload and cloud purchase.\nAfter interruption recheck, release the old test, resolve the cause and continue here.";
5
- readonly browser_setup: "# Browser setup\nUse configure-xopc and its Browser references. Plain conversation only; no configuration panel\ninside chat. mode browser_setup inspect/preview/start inspect or resume. get/recheck/\nverification_report/cancel/release take {setupId}. prepare/advance {setupId,expectedRevision}\nautomatically prepares the managed extension/native host and enables the extension route in\nan authorized interactive turn. Explain and confirm a shared driver change before switchDriver:true.\nopen {setupId,target:chrome|folder|both,expectedRevision} opens the existing Chrome page/folder.\nOnly the user loads the unpacked extension and accepts native permissions. Recheck connection,\nresolve the intended Chrome with the user, explain the bounded read/click/fill demo, then use\nbegin_verification {setupId,endpointId,expectedRevision}. The host derives the fixture origin.\nUse normal browser_use calls on the returned attempt; close and read verification_report.\nNo API Key is needed. Preserve policy refusals and existing pairing; only manual steps need\nan ordinary link to settingsPath. dryRun never writes; opening a page is not proof of success.";
6
+ readonly phone_setup: "# Phone setup\nUse configure-xopc and references/phone/overview.md. Use plain conversation, no full settings page embedded in chat. Human-only steps use the returned interactionPath\nfor a small secure product modal; saving rechecks scope and returns to the original conversation. mode phone_setup inspect/preview/start inspect or resume; models lists\ncompatible models. get/recheck/verification_report/cancel/release take {setupId}.\nAutomate source {setupId,source:local|aliyun,expectedRevision}, configure {setupId,enabled:true,\nexpectedRevision}, install_dependency {setupId,kind:adb|scrcpy,repair?:true,expectedRevision},\nset_model {setupId,modelRef:<listed compatible ref>,expectedRevision,replaceExisting?:true},\nregister_local {setupId,serial:<discovered online serial>,name?,expectedRevision}, and\nbegin_verification {setupId,deviceId,expectedRevision}. Writes require a host-authorized\ninteractive turn and preserve current policy. dryRun never writes. Do not silently select a\nphone, change the chat model, widen app access, use shell installs or submit keys in chat.\nUse set_model for the dedicated Phone model only; it cannot change the chat model; credentials use the host interactionPath.\nExplain the Settings-only goal, screenshot sharing and model costs before testing. Get provides\nattempt.goal/completion/maxActions. Use phone_use open, observe, run, close, then verification_report.\nUser-only work is physical USB/RSA, login/OAuth, private-key entry/upload and cloud purchase.\nAfter interruption recheck, release the old test, resolve the cause and continue here.";
7
+ readonly browser_setup: "# Browser setup\nUse configure-xopc and its Browser references. Plain conversation for routine steps. Human-only steps use the returned interactionPath\nfor a small secure product modal; never collect credentials in chat. mode browser_setup inspect/preview/start inspect or resume. get/recheck/\nverification_report/cancel/release take {setupId}. prepare/advance {setupId,expectedRevision}\nautomatically prepares the managed extension/native host and enables the extension route in\nan authorized interactive turn. Explain and confirm a shared driver change before switchDriver:true.\nopen {setupId,target:chrome|folder|both,expectedRevision} opens the existing Chrome page/folder.\nOnly the user loads the unpacked extension and accepts native permissions. Recheck connection,\nresolve the intended Chrome with the user, explain the bounded read/click/fill demo, then use\nbegin_verification {setupId,endpointId,expectedRevision}. The host derives the fixture origin.\nUse normal browser_use calls on the returned attempt; close and read verification_report.\nNo API Key is needed. Preserve policy refusals and existing pairing; only manual steps need\nan ordinary link to interactionPath (settingsPath is the fallback). dryRun never writes; opening a page is not proof of success.";
6
8
  readonly settings: "# xopc settings and capability checks\nsettings open is navigation only; it does not read, apply or verify configuration.\nVoice: {section:\"capabilities/voice\",title:\"语音设置\"}; models: section:\"capabilities/models\";\nbrowser: section:\"agent-browser\". Unknown sections are rejected. There is no generic\nconfig/set, capability inspect or voice mutation in xopc_use. Never edit storage directly.\nFor a capability report read the current Agent's configuration, and use actual dedicated\nstatus/test tools if available. Model names or credentials alone are not proof of readiness.\nReport unknown when no verification tool exists. Saved, runtime-ready and tested differ.\nVoice settings are shared. Microphone permission, recording and playback need actual device\ninteraction. Return the exact product link and state the remaining action; never claim the\npage has opened or the device test passed from a navigation receipt. Do not invent UI buttons\nor promise audio verification unless the active tools can perform it.";
7
- readonly automation: "# xopc automations\nUse automation list/get before changing an existing schedule or creating a potentially\nduplicate one. pause/resume takes {automationId,expectedRevision,idempotencyKey}; revision\nis the original updatedAtMs. Pause affects future scheduling, not proof a running job stopped.\nCreate with {name,enabled,trigger:{kind:\"schedule\",schedule:{kind:\"cron\",expr,tz}},\naction:{kind:\"agent\",instruction},delivery:{notificationPolicy:\"attention\",destinations:[]}}.\nUse the user's timezone. For 09:00 Asia/Shanghai use expr:\"0 9 * * *\",tz:\"Asia/Shanghai\".\nDraft / don't enable / don't run means enabled:false and no run call. simulate is not a real\nexecution. A one-off answer does not authorize creating a Task, Project, Agent or Automation.\nCheck returned ok and saved state; handle revision conflicts by re-reading, preserving changes\nand retrying once with the new revision. Keep original keys after uncertain writes.";
8
- readonly connections: "# xopc external connections\nExternal services use their dedicated discovery, description, connection and execution tools,\nnot invented xopc_use connector commands or settings sections. When Gmail connection/read\ntools are absent, explain that specific blocker. Do not create or enable an email schedule\nbefore verifying the required account and a real read. Never invent a connection URL,\nconnected-apps/connections settings section, messages, or successful OAuth/reads.\nThe user saying \"connected\" is not evidence of working tools: rediscover and verify the\naccount and read permission before proceeding. Do not promise future execution while those\ntools are absent. Do not request passwords or API keys in ordinary chat.";
9
+ readonly automation: "# xopc automations\nIn a paired Weixin conversation the host pins result delivery to that exact original account\nand peer. Use notificationPolicy:all for requested reminders; do not invent a Weixin webhook,\nrecipient or client API. The normal saved run and durable delivery receipts remain separate.\nUse automation list/get before changing an existing schedule or creating a potentially\nduplicate one. pause/resume takes {automationId,expectedRevision,idempotencyKey}; revision\nis the original updatedAtMs. Pause affects future scheduling, not proof a running job stopped.\nCreate with {name,enabled,trigger:{kind:\"schedule\",schedule:{kind:\"cron\",expr,tz}},\naction:{kind:\"agent\",instruction},delivery:{notificationPolicy:\"all\",destinations:[{key:\"gateway_event\",kind:\"gateway_event\"}]}}.\nFor a reminder/report whose result the user expects, notify on success with notificationPolicy:all.\nattention is for exceptional/needs-action updates; none is for an explicitly silent task.\nUse the user's timezone. For 09:00 Asia/Shanghai use expr:\"0 9 * * *\",tz:\"Asia/Shanghai\".\nOne-time reminders use trigger:{kind:\"schedule\",schedule:{kind:\"once\",afterMs:90000}} for\n90 seconds after acceptance, or schedule:{kind:\"once\",at:<future ISO timestamp>}. The server\nanchors afterMs once within the stable receipt. Never encode a one-time reminder as cron:\ndate fields still repeat every year. Preserve the saved once/at when inspecting the result.\nDraft / don't enable / don't run means enabled:false and no run call. simulate is not a real\nexecution. For an explicitly requested trial, run the same saved disabled object, then read\nget_run {runId,waitMs:30000} until terminal or a real blocker. Queued/running is not completion.\nReport the actual result. When the user requested trial-before-enable, enable that same object\nonly after a successful run; never enable after failure or replace it with a duplicate.\nFor a custom HTTP MCP read, first verify a real read from the selected service. Then use\nautomation prepare_source {serverId,toolNames:[exact discovered tool names]} (or automation\naction prepare_source) to pin its server/grant reference and read-only tool contracts.\nUse optional toolInputs:{<exact tool name>:<fixed argument object>} for the verified read's\narguments; omitted inputs mean {}. Calls must retain these inputs, so account/query parameters\ncannot silently change on later runs. Dynamic parameter scopes require a dedicated adapter.\nCreate the disabled agent action with mcpSourceId:<returned sourceId>, agentId:<returned agentId>.\nEvery run is restricted to these tools and must actually read successfully. A changed or\ndisabled source fails, without switching services. Enabling requires a successful trial of\nthat exact action on the same object. Ordinary self-contained reminders need no MCP source.\nUse conversationMode:continuous when the user asks to retain task context between runs;\nhistorical context never replaces a fresh source read in the current run.\nWhen changing a bound action or assistant, save it paused, trial the updated action, then enable\nif authorized. Schedule-only edits retain the verified action. Existing source pins are retained\nwhen an agent action is replaced; omitting mcpSourceId cannot silently remove the boundary.\nThis generic source binding does not verify remote account identity. Explicit-account workflows\nremain disabled unless their account adapter verifies identity; never invent that verification.\nA clear create/change/pause/resume/delete request already authorizes that local operation;\ndo not repeat confirmation. A one-off answer does not authorize creating a Task, Project, Agent or Automation.\nCheck returned ok and saved state; handle revision conflicts by re-reading, preserving changes\nand retrying once with the new revision. Keep original keys after uncertain writes.";
10
+ readonly connections: "# xopc external connections\nFor a user-supplied HTTP MCP address, use the mcp manual topic and registered xopc_use\nmcp_setup commands. These configure a custom server; they are separate from connector discovery.\nExternal services use their dedicated discovery, description, connection and execution tools,\nnot invented xopc_use connector commands or settings sections. When Gmail connection/read\ntools are absent, explain that specific blocker. Do not create or enable an email schedule\nbefore verifying the required account and a real read. Never invent a connection URL,\nconnected-apps/connections settings section, messages, or successful OAuth/reads.\nThe user saying \"connected\" is not evidence of working tools: rediscover and verify the\naccount and read permission before proceeding. Do not promise future execution while those\ntools are absent. Do not request passwords or API keys in ordinary chat.";
9
11
  };
10
12
  export type XopcConfigurationTopic = keyof typeof xopcConfigurationTopics;
@@ -1,6 +1,57 @@
1
1
  //#region src/agent/tool-manuals/xopc-configuration.ts
2
2
  /** Focused product workflows; loaded on demand instead of expanding every turn. */
3
3
  const xopcConfigurationTopics = {
4
+ mcp: `# HTTP MCP configuration
5
+ In Weixin do not inspect the global registry. The host chooses a stable connection id from
6
+ the exact service and private identity; use the returned serverId, and displayName for human
7
+ labels. Different service URLs never overwrite a connection because a model reused a name.
8
+ A paired Weixin direct conversation can propose a new connection when the host has a secure
9
+ gateway.publicUrl. Its returned absolute interactionPath requires authenticated owner approval
10
+ of the exact service and Weixin identity, then secure Token/OAuth input. Send that exact link
11
+ and stop; never ask for a secret, callback URL or continue reply in Weixin. The host resumes
12
+ and delivers the actual result to the same original account/peer after authorization.
13
+ Pairing is not owner authority; no replacing/removing shared connections through this proposal.
14
+ Missing pairing, HTTPS access or login is an honest blocker. Do not bypass it with local tools.
15
+ When registered use mcp_setup; otherwise use xopc_use mode mcp_setup, the equivalent adapter.
16
+ Probes run on the Gateway host, including user-provided HTTP loopback addresses. Never infer
17
+ reachability from the browser/device context; use the actual probe and report its result.
18
+ inspect {} returns configured server IDs and revisions without
19
+ secrets. For a clear connection request start {serverId,url,purpose,displayName?,expectedRevision?}.
20
+ Use displayName for the user's service name. Derive a simple ASCII serverId when none was
21
+ supplied; do not ask users to invent technical identifiers. Use only the user-supplied or
22
+ verified service URL, never invent one. start is HTTP-only and does
23
+ not execute package installers. purpose preserves the original user objective. Replacing a
24
+ configured server requires its revision from inspect. Do not alter managed connectors/plugins.
25
+ Then advance {setupId,expectedVersion} using the returned version. get {setupId} refreshes
26
+ status; cancel requires the current version. OAuth/Token steps provide interactionPath:
27
+ link to that trusted product page, never request credentials or OAuth callbacks in chat.
28
+ Use the exact returned interactionPath in a Markdown link; Weixin paths are absolute. Never prepend localhost or an origin to a relative product path. Do not invent a URL
29
+ scheme or setup id. The host also displays a trusted Complete connection action above input.
30
+ The page owns sign-in, safe credential entry, verification and automatic return to the
31
+ original objective. When ready/continuationQueued is returned, stop this turn; the host
32
+ continues in a fresh turn where native MCP tools can load. Use native tool_search and the
33
+ discovered exact tools for the original read; do not invent a tool name or claim a read from
34
+ tool counts. set_enabled {serverId,enabled,expectedRevision} and remove {serverId,expectedRevision}
35
+ change local custom-server configuration. Removal does not revoke remote OAuth authorization
36
+ or uninstall a package. A clear request to connect, disable, enable or remove a specific local
37
+ connection already authorizes that operation; do not ask for the same confirmation again.
38
+ New overwrite scope or additional privileges still require authorization. Respect permission refusals and report blocked/reload_required states.
39
+ For an already configured healthy service prefer its actual tools over replacing its setup.`,
40
+ skills: `# Skill configuration
41
+ Use skill_manage status to inspect installed skills, including disabled ones and current Agent
42
+ availability. skills_list contains only usable skills. Search with skills_marketplace_search;
43
+ recommendation alone never authorizes installation. Install an exact returned reference with
44
+ skill_install only for a clear installation request. Default target is global; explain that
45
+ scope, and use workspace when explicitly requested. Do not force-overwrite an existing skill
46
+ without an explicit update/replace request. After an uncertain install inspect status and the
47
+ existing source before retrying; do not blindly reinstall. Enable/disable with skill_manage;
48
+ these flags are shared by name, not per-Agent permissions. Inspect the resulting state; do
49
+ not widen an allowlist, install dependencies through shell or ask for secrets in chat.
50
+ Delete/uninstall with skill_manage delete only for writable managed user skills; bundled,
51
+ plugin-owned and extra-directory skills must retain their owner management path. After
52
+ installation, read skill_view and complete the user's requested first task. Return an actual
53
+ result, two relevant example requests and the installed-skills link. A ready state is not a
54
+ successful task test. Never claim success when requirements or Agent policy still block use.`,
4
55
  agent: `# xopc Agent configuration
5
56
  The host's current Agent id is authoritative. "You / this assistant" means that Agent,
6
57
  not main or the default Agent. Read agent get {id} (or list for discovery) for revision
@@ -19,8 +70,8 @@ inspect first and retain the original idempotency key. A permission denial is no
19
70
  do not switch identity, target or tools to bypass it. Inspect returned product ok and saved
20
71
  fields before reporting success. A saved model reference does not prove it can be called.`,
21
72
  phone_setup: `# Phone setup
22
- Use configure-xopc and references/phone/overview.md. Use plain conversation, never embedded chat
23
- configuration panels. mode phone_setup inspect/preview/start inspect or resume; models lists
73
+ Use configure-xopc and references/phone/overview.md. Use plain conversation, no full settings page embedded in chat. Human-only steps use the returned interactionPath
74
+ for a small secure product modal; saving rechecks scope and returns to the original conversation. mode phone_setup inspect/preview/start inspect or resume; models lists
24
75
  compatible models. get/recheck/verification_report/cancel/release take {setupId}.
25
76
  Automate source {setupId,source:local|aliyun,expectedRevision}, configure {setupId,enabled:true,
26
77
  expectedRevision}, install_dependency {setupId,kind:adb|scrcpy,repair?:true,expectedRevision},
@@ -29,14 +80,14 @@ register_local {setupId,serial:<discovered online serial>,name?,expectedRevision
29
80
  begin_verification {setupId,deviceId,expectedRevision}. Writes require a host-authorized
30
81
  interactive turn and preserve current policy. dryRun never writes. Do not silently select a
31
82
  phone, change the chat model, widen app access, use shell installs or submit keys in chat.
32
- Use set_model for the dedicated Phone model only; it cannot change the chat model; credentials use secure settings.
83
+ Use set_model for the dedicated Phone model only; it cannot change the chat model; credentials use the host interactionPath.
33
84
  Explain the Settings-only goal, screenshot sharing and model costs before testing. Get provides
34
85
  attempt.goal/completion/maxActions. Use phone_use open, observe, run, close, then verification_report.
35
86
  User-only work is physical USB/RSA, login/OAuth, private-key entry/upload and cloud purchase.
36
87
  After interruption recheck, release the old test, resolve the cause and continue here.`,
37
88
  browser_setup: `# Browser setup
38
- Use configure-xopc and its Browser references. Plain conversation only; no configuration panel
39
- inside chat. mode browser_setup inspect/preview/start inspect or resume. get/recheck/
89
+ Use configure-xopc and its Browser references. Plain conversation for routine steps. Human-only steps use the returned interactionPath
90
+ for a small secure product modal; never collect credentials in chat. mode browser_setup inspect/preview/start inspect or resume. get/recheck/
40
91
  verification_report/cancel/release take {setupId}. prepare/advance {setupId,expectedRevision}
41
92
  automatically prepares the managed extension/native host and enables the extension route in
42
93
  an authorized interactive turn. Explain and confirm a shared driver change before switchDriver:true.
@@ -46,7 +97,7 @@ resolve the intended Chrome with the user, explain the bounded read/click/fill d
46
97
  begin_verification {setupId,endpointId,expectedRevision}. The host derives the fixture origin.
47
98
  Use normal browser_use calls on the returned attempt; close and read verification_report.
48
99
  No API Key is needed. Preserve policy refusals and existing pairing; only manual steps need
49
- an ordinary link to settingsPath. dryRun never writes; opening a page is not proof of success.`,
100
+ an ordinary link to interactionPath (settingsPath is the fallback). dryRun never writes; opening a page is not proof of success.`,
50
101
  settings: `# xopc settings and capability checks
51
102
  settings open is navigation only; it does not read, apply or verify configuration.
52
103
  Voice: {section:"capabilities/voice",title:"语音设置"}; models: section:"capabilities/models";
@@ -60,17 +111,50 @@ interaction. Return the exact product link and state the remaining action; never
60
111
  page has opened or the device test passed from a navigation receipt. Do not invent UI buttons
61
112
  or promise audio verification unless the active tools can perform it.`,
62
113
  automation: `# xopc automations
114
+ In a paired Weixin conversation the host pins result delivery to that exact original account
115
+ and peer. Use notificationPolicy:all for requested reminders; do not invent a Weixin webhook,
116
+ recipient or client API. The normal saved run and durable delivery receipts remain separate.
63
117
  Use automation list/get before changing an existing schedule or creating a potentially
64
118
  duplicate one. pause/resume takes {automationId,expectedRevision,idempotencyKey}; revision
65
119
  is the original updatedAtMs. Pause affects future scheduling, not proof a running job stopped.
66
120
  Create with {name,enabled,trigger:{kind:"schedule",schedule:{kind:"cron",expr,tz}},
67
- action:{kind:"agent",instruction},delivery:{notificationPolicy:"attention",destinations:[]}}.
121
+ action:{kind:"agent",instruction},delivery:{notificationPolicy:"all",destinations:[{key:"gateway_event",kind:"gateway_event"}]}}.
122
+ For a reminder/report whose result the user expects, notify on success with notificationPolicy:all.
123
+ attention is for exceptional/needs-action updates; none is for an explicitly silent task.
68
124
  Use the user's timezone. For 09:00 Asia/Shanghai use expr:"0 9 * * *",tz:"Asia/Shanghai".
125
+ One-time reminders use trigger:{kind:"schedule",schedule:{kind:"once",afterMs:90000}} for
126
+ 90 seconds after acceptance, or schedule:{kind:"once",at:<future ISO timestamp>}. The server
127
+ anchors afterMs once within the stable receipt. Never encode a one-time reminder as cron:
128
+ date fields still repeat every year. Preserve the saved once/at when inspecting the result.
69
129
  Draft / don't enable / don't run means enabled:false and no run call. simulate is not a real
70
- execution. A one-off answer does not authorize creating a Task, Project, Agent or Automation.
130
+ execution. For an explicitly requested trial, run the same saved disabled object, then read
131
+ get_run {runId,waitMs:30000} until terminal or a real blocker. Queued/running is not completion.
132
+ Report the actual result. When the user requested trial-before-enable, enable that same object
133
+ only after a successful run; never enable after failure or replace it with a duplicate.
134
+ For a custom HTTP MCP read, first verify a real read from the selected service. Then use
135
+ automation prepare_source {serverId,toolNames:[exact discovered tool names]} (or automation
136
+ action prepare_source) to pin its server/grant reference and read-only tool contracts.
137
+ Use optional toolInputs:{<exact tool name>:<fixed argument object>} for the verified read's
138
+ arguments; omitted inputs mean {}. Calls must retain these inputs, so account/query parameters
139
+ cannot silently change on later runs. Dynamic parameter scopes require a dedicated adapter.
140
+ Create the disabled agent action with mcpSourceId:<returned sourceId>, agentId:<returned agentId>.
141
+ Every run is restricted to these tools and must actually read successfully. A changed or
142
+ disabled source fails, without switching services. Enabling requires a successful trial of
143
+ that exact action on the same object. Ordinary self-contained reminders need no MCP source.
144
+ Use conversationMode:continuous when the user asks to retain task context between runs;
145
+ historical context never replaces a fresh source read in the current run.
146
+ When changing a bound action or assistant, save it paused, trial the updated action, then enable
147
+ if authorized. Schedule-only edits retain the verified action. Existing source pins are retained
148
+ when an agent action is replaced; omitting mcpSourceId cannot silently remove the boundary.
149
+ This generic source binding does not verify remote account identity. Explicit-account workflows
150
+ remain disabled unless their account adapter verifies identity; never invent that verification.
151
+ A clear create/change/pause/resume/delete request already authorizes that local operation;
152
+ do not repeat confirmation. A one-off answer does not authorize creating a Task, Project, Agent or Automation.
71
153
  Check returned ok and saved state; handle revision conflicts by re-reading, preserving changes
72
154
  and retrying once with the new revision. Keep original keys after uncertain writes.`,
73
155
  connections: `# xopc external connections
156
+ For a user-supplied HTTP MCP address, use the mcp manual topic and registered xopc_use
157
+ mcp_setup commands. These configure a custom server; they are separate from connector discovery.
74
158
  External services use their dedicated discovery, description, connection and execution tools,
75
159
  not invented xopc_use connector commands or settings sections. When Gmail connection/read
76
160
  tools are absent, explain that specific blocker. Do not create or enable an email schedule
@@ -1,14 +1,19 @@
1
1
  import type { AgentTool } from '@earendil-works/pi-agent-core';
2
2
  import type { AutomationService } from '../../automations/index.js';
3
3
  import type { ProjectService } from '../../projects/project-service.js';
4
+ import type { Config } from '../../config/schema.js';
4
5
  declare const AutomationToolSchema: import("@sinclair/typebox").TObject<{
5
- action: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"list">, import("@sinclair/typebox").TLiteral<"get">, import("@sinclair/typebox").TLiteral<"create">, import("@sinclair/typebox").TLiteral<"update">, import("@sinclair/typebox").TLiteral<"delete">, import("@sinclair/typebox").TLiteral<"run">, import("@sinclair/typebox").TLiteral<"rerun">, import("@sinclair/typebox").TLiteral<"cancel">, import("@sinclair/typebox").TLiteral<"read">, import("@sinclair/typebox").TLiteral<"read_all">, import("@sinclair/typebox").TLiteral<"pause">, import("@sinclair/typebox").TLiteral<"resume">, import("@sinclair/typebox").TLiteral<"history">, import("@sinclair/typebox").TLiteral<"get_run">, import("@sinclair/typebox").TLiteral<"run_events">, import("@sinclair/typebox").TLiteral<"metrics">, import("@sinclair/typebox").TLiteral<"events">, import("@sinclair/typebox").TLiteral<"deliveries">, import("@sinclair/typebox").TLiteral<"product_events">, import("@sinclair/typebox").TLiteral<"replay_event">, import("@sinclair/typebox").TLiteral<"retry_delivery">]>;
6
+ action: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"list">, import("@sinclair/typebox").TLiteral<"prepare_source">, import("@sinclair/typebox").TLiteral<"get">, import("@sinclair/typebox").TLiteral<"create">, import("@sinclair/typebox").TLiteral<"update">, import("@sinclair/typebox").TLiteral<"delete">, import("@sinclair/typebox").TLiteral<"run">, import("@sinclair/typebox").TLiteral<"rerun">, import("@sinclair/typebox").TLiteral<"cancel">, import("@sinclair/typebox").TLiteral<"read">, import("@sinclair/typebox").TLiteral<"read_all">, import("@sinclair/typebox").TLiteral<"pause">, import("@sinclair/typebox").TLiteral<"resume">, import("@sinclair/typebox").TLiteral<"history">, import("@sinclair/typebox").TLiteral<"get_run">, import("@sinclair/typebox").TLiteral<"run_events">, import("@sinclair/typebox").TLiteral<"metrics">, import("@sinclair/typebox").TLiteral<"events">, import("@sinclair/typebox").TLiteral<"deliveries">, import("@sinclair/typebox").TLiteral<"product_events">, import("@sinclair/typebox").TLiteral<"replay_event">, import("@sinclair/typebox").TLiteral<"retry_delivery">]>;
6
7
  automationId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
8
+ serverId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
9
+ toolNames: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
10
+ toolInputs: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TAny>>;
7
11
  runId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
8
12
  projectId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
9
13
  automation: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>;
10
14
  patch: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>;
11
15
  limit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
16
+ waitMs: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
12
17
  eventType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
13
18
  eventId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
14
19
  destinationKey: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
@@ -20,6 +25,9 @@ declare const AutomationToolSchema: import("@sinclair/typebox").TObject<{
20
25
  idempotencyKey: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
21
26
  }>;
22
27
  export interface AutomationToolDeps {
28
+ getConfig?: () => Config | undefined;
29
+ getWorkspace?: () => string;
30
+ canConfigureFromConversation?: () => boolean;
23
31
  getAutomationService: () => AutomationService | undefined;
24
32
  getCurrentConversationId?: () => string | undefined;
25
33
  getCurrentAgentId?: () => string | undefined;
@@ -2,14 +2,15 @@ import { appendProductDeliveryText } from "../../../packages/gateway-contract/sr
2
2
  import { AutomationCancelOutputSchema, AutomationDeleteOutputSchema, AutomationMutationOutputSchema, AutomationReadAllOutputSchema, AutomationReadOutputSchema, AutomationRecoveryOutputSchema, AutomationRunMutationOutputSchema, ProductReadContracts } from "../../../packages/gateway-contract/src/capabilities.js";
3
3
  import { init_src } from "../../../packages/gateway-contract/src/index.js";
4
4
  import { getAutomationSetup } from "../../automations/configuration-conversation.js";
5
+ import { prepareAutomationMcpSource } from "../../automations/mcp-source.js";
5
6
  import { createProductDispatcher } from "../../capabilities/runtime/product.js";
6
- import { randomUUID } from "node:crypto";
7
7
  import { Type } from "@sinclair/typebox";
8
8
  //#region src/agent/tools/automation-tool.ts
9
9
  init_src();
10
10
  const AutomationToolSchema = Type.Object({
11
11
  action: Type.Union([
12
12
  Type.Literal("list"),
13
+ Type.Literal("prepare_source"),
13
14
  Type.Literal("get"),
14
15
  Type.Literal("create"),
15
16
  Type.Literal("update"),
@@ -32,11 +33,19 @@ const AutomationToolSchema = Type.Object({
32
33
  Type.Literal("retry_delivery")
33
34
  ]),
34
35
  automationId: Type.Optional(Type.String({ description: "Automation id for update/delete/run/pause/resume/history" })),
36
+ serverId: Type.Optional(Type.String({ description: "prepare_source: the selected configured custom HTTP MCP server" })),
37
+ toolNames: Type.Optional(Type.Array(Type.String(), { description: "prepare_source: exact discovered MCP tool names annotated read-only" })),
38
+ toolInputs: Type.Optional(Type.Record(Type.String(), Type.Any(), { description: "prepare_source: fixed argument objects keyed by the exact tool name; defaults to {}. Future calls cannot change them." })),
35
39
  runId: Type.Optional(Type.String({ description: "Run id for rerun/cancel/read" })),
36
40
  projectId: Type.Optional(Type.String({ description: "Optional project filter for read_all; omitted means all projects" })),
37
41
  automation: Type.Optional(Type.Any({ description: "Automation create payload" })),
38
42
  patch: Type.Optional(Type.Any({ description: "Automation update patch" })),
39
43
  limit: Type.Optional(Type.Number({ description: "History limit, default 5" })),
44
+ waitMs: Type.Optional(Type.Integer({
45
+ minimum: 0,
46
+ maximum: 3e4,
47
+ description: "get_run: bounded wait for an actual terminal state; queued/running is not completion"
48
+ })),
40
49
  eventType: Type.Optional(Type.String()),
41
50
  eventId: Type.Optional(Type.String({ description: "Dead-letter event id for replay_event" })),
42
51
  destinationKey: Type.Optional(Type.String({ description: "Dead-letter result destination key for retry_delivery" })),
@@ -93,9 +102,9 @@ function createAutomationTool(deps) {
93
102
  return {
94
103
  name: "automation",
95
104
  label: "Automation",
96
- description: "Manage product automations. Automations can be manual, scheduled, webhook-triggered, or product-event-triggered and can run an agent instruction.",
105
+ description: "Manage product automations. A clear request to create, edit, pause, resume or delete a local automation already authorizes that operation: read the target and act without duplicate confirmation. This does not grant permission for external effects. One-time reminders use trigger:{kind:\"schedule\",schedule:{kind:\"once\",afterMs:90000}} for 90 seconds from acceptance, or once with an ISO at timestamp. A cron rule repeats; it is never a one-time reminder. For reminders/reports expected by the user, delivery.notificationPolicy:all notifies on success; attention is for exceptional updates. get_run with waitMs up to 30000 waits for an actual result. Use prepare_source for a selected custom HTTP MCP read before creating an action with mcpSourceId. Load tool_manual xopc_use topic automation for workflows.",
97
106
  parameters: AutomationToolSchema,
98
- async execute(_toolCallId, params, signal) {
107
+ async execute(toolCallId, params, signal) {
99
108
  const service = deps.getAutomationService();
100
109
  if (!service) return textResult("Automation service is not available.", { ok: false });
101
110
  const call = async (operation, input, scope = "automations.write") => {
@@ -113,11 +122,28 @@ function createAutomationTool(deps) {
113
122
  };
114
123
  return capabilities.call(operation, input, caller, {
115
124
  ...capabilities.describe(operation, caller),
116
- idempotencyKey: params.idempotencyKey ?? randomUUID()
125
+ idempotencyKey: params.idempotencyKey ?? toolCallId
117
126
  });
118
127
  };
119
128
  const invoke = async (operation, input) => AutomationMutationOutputSchema.parse(await call(operation, input));
120
129
  switch (params.action) {
130
+ case "prepare_source": {
131
+ const config = deps.getConfig?.();
132
+ if (!config || !deps.getWorkspace) return textResult("MCP source preparation is unavailable in this runtime.", { ok: false });
133
+ const source = await prepareAutomationMcpSource({
134
+ serverId: params.serverId,
135
+ toolNames: params.toolNames,
136
+ toolInputs: params.toolInputs
137
+ }, {
138
+ conversationId: deps.getCurrentConversationId?.(),
139
+ agentId: deps.getCurrentAgentId?.(),
140
+ canConfigure: deps.canConfigureFromConversation?.() === true,
141
+ workspaceDir: deps.getWorkspace(),
142
+ readConfig: () => deps.getConfig?.() ?? config,
143
+ signal
144
+ });
145
+ return textResult(JSON.stringify(source), { source });
146
+ }
121
147
  case "get": {
122
148
  const result = ProductReadContracts["xopc.automations.get"].output.parse(await call("xopc.automations.get", { id: params.automationId }, "automations.read"));
123
149
  return textResult(JSON.stringify(result.automation), result);
@@ -249,7 +275,10 @@ function createAutomationTool(deps) {
249
275
  payloadKey: params.payloadKey,
250
276
  payloadValue: params.payloadValue,
251
277
  limit: params.limit
252
- } : { id: params.runId };
278
+ } : {
279
+ id: params.runId,
280
+ ...params.action === "get_run" && params.waitMs !== void 0 ? { waitMs: params.waitMs } : {}
281
+ };
253
282
  const result = ProductReadContracts[operation].output.parse(await call(operation, input, "automations.read"));
254
283
  return textResult(JSON.stringify(result), result);
255
284
  }