@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.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/src/adapters/security-adapter.js +1 -1
- package/dist/extensions/telegram/src/pairing-config-resolver.js +1 -1
- package/dist/extensions/telegram/src/plugin.js +2 -2
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.js +1 -1
- package/dist/extensions/weixin/src/auth/accounts.js +2 -2
- package/dist/extensions/weixin/src/auth/pairing.js +1 -1
- package/dist/extensions/weixin/src/cdn/upload.js +1 -1
- package/dist/extensions/weixin/src/cli/gateway-qr-login.js +1 -1
- package/dist/extensions/weixin/src/cli/qr-login.js +1 -1
- package/dist/extensions/weixin/src/messaging/debug-mode.js +1 -1
- package/dist/extensions/weixin/src/messaging/inbound.js +2 -2
- package/dist/extensions/weixin/src/messaging/process-message.js +3 -3
- package/dist/extensions/weixin/src/messaging/send.js +12 -3
- package/dist/extensions/weixin/src/monitor/monitor.js +1 -1
- package/dist/extensions/weixin/src/outbound-send.js +12 -3
- package/dist/extensions/weixin/src/pairing-config-resolver.js +1 -1
- package/dist/extensions/weixin/src/plugin.js +1 -1
- package/dist/gateway/static/root/assets/{activity-store-CMw8qBuC.js → activity-store-D_DXNHba.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-JI0YWOIm.js → agent-avatar-dicebear-CjaQxFQt.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-YqmwzOSa.js → agent-avatar-display-6Z4m31Fz.js} +2 -2
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-D4ClP_DJ.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-m1A8wF9p.js +1 -0
- package/dist/gateway/static/root/assets/agents-B9slUA_1.js +77 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-DLnmdC1h.js → agents-admin-api-u5c3GREg.js} +1 -1
- package/dist/gateway/static/root/assets/{api-Boc-CVh7.js → api-C3Tp9MkF.js} +1 -1
- package/dist/gateway/static/root/assets/{api-bL7sxjAF.js → api-CRT9ZyH0.js} +1 -1
- package/dist/gateway/static/root/assets/app-link-DRy3-k7j.js +1 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-jIG5i7KE.js → app-management-settings-panel-XqoIBF2H.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BnaQW9Xd.js → appearance-settings-9ZtqCASo.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-DUeu_7iC.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-DjboG3kA.js → archive-plugin-BCQnOkV8.js} +1 -1
- package/dist/gateway/static/root/assets/attachment-load-DrVGNxJm.js +1 -0
- package/dist/gateway/static/root/assets/{automation-api-CZqL9l_d.js → automation-api-hRsGx-qe.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-DRd-X_Ai.js → automation-result-state-CMfVTv_i.js} +1 -1
- package/dist/gateway/static/root/assets/automation-task-card-Bur78p68.js +3 -0
- package/dist/gateway/static/root/assets/{automations-page-HyBQIfmn.js → automations-page-DMIyWsP0.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-DEkDjxeU.js +9 -0
- package/dist/gateway/static/root/assets/{binary-plugins-Bg8ARZUH.js → binary-plugins-CIB5cbvQ.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DKohqFAW.js → block-editor-CXdlNAmZ.js} +2 -2
- package/dist/gateway/static/root/assets/{browser-automation-inputs-YeibTzw4.js → browser-automation-inputs-Fxo7HbK6.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-BWNcbuz2.js → browser-automations-page-Dn3LN5wo.js} +2 -2
- package/dist/gateway/static/root/assets/{browser-control-api-CDeuxy2x.js → browser-control-api-CbbPvhHR.js} +1 -1
- package/dist/gateway/static/root/assets/browser-settings-page-Cpm9fEPV.js +3 -0
- package/dist/gateway/static/root/assets/{button-CnRSIP6m.js → button-Cc4hUNTt.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BcQa8c9n.js → capabilities-BEvywfF9.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-Bo2qEJhH.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-page-BCzsIzvC.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-Cr67ziwX.js +8 -0
- package/dist/gateway/static/root/assets/{capability-header-actions-CTUCuBlW.js → capability-header-actions-BxMYfQ8y.js} +1 -1
- package/dist/gateway/static/root/assets/channels-CA5z5dGY.js +1 -0
- package/dist/gateway/static/root/assets/{chat-agents-api-B8JO6Tcj.js → chat-agents-api-D8YS5amE.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-DRtuFfF1.js → chat-chart-block-B39npsXj.js} +1 -1
- package/dist/gateway/static/root/assets/chat-page-D92AWJbh.js +72 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Dkqq5FSL.js → chat-terminal-dock-DjFnElAM.js} +2 -2
- package/dist/gateway/static/root/assets/{command-palette-api-qujvNqkK.js → command-palette-api-Dijix7V6.js} +1 -1
- package/dist/gateway/static/root/assets/composer-payload-handoff-BQXlFKf4.js +1 -0
- package/dist/gateway/static/root/assets/{computer-settings-page-8q4hRmoo.js → computer-settings-page-MkqyKyf3.js} +1 -1
- package/dist/gateway/static/root/assets/confirm-dialog-D7dQJytv.js +1 -0
- package/dist/gateway/static/root/assets/connected-providers-grid-BSvKP2u-.js +1 -0
- package/dist/gateway/static/root/assets/{connector-service-page-DQaTI21R.js → connector-service-page-DlIl9bLx.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-BjypBp2g.js → connectors-api-DEJU8mgn.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-Vx8-MY0Y.js +1 -0
- package/dist/gateway/static/root/assets/{copy-text-row-CYIv7RfP.js → copy-text-row-CpiRzq4G.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-D_PSHGpe.js → date-picker-BIfjfOTM.js} +1 -1
- package/dist/gateway/static/root/assets/dependency-picker-XjPB8FJS.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-1Et9VqkM.js → desktop-pet-DFNehTtd.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-narrative-rADKU0FX.js → desktop-pet-narrative-ChwjpnsG.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-0fCGgaG7.js → desktop-pet-settings-BDjsFown.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-TTj_djD8.js → dev-view-store-CeZZLOc6.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DH_uJ698.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-C07a7wYX.js → directory-picker-path-field-DiZXY7jF.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-BFqKm9ky.js → discussion-annotation-sync-BXqNuZnx.js} +1 -1
- package/dist/gateway/static/root/assets/dist-BGTk37IG.js +1 -0
- package/dist/gateway/static/root/assets/dist-BuHnPloF.js +1 -0
- package/dist/gateway/static/root/assets/dist-GJ8-1PAx.js +1 -0
- package/dist/gateway/static/root/assets/dist-ZrL34Ps4.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-DFaVlqas.js → extension-debug-page-myQqsol2.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-BfzPfXBq.js → extension-iframe-host-DaL-OcTw.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-ow0K1Y4_.js → extension-marketplace-api-DRBszrCR.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CrDADV5W.js → extension-page-DvlGhZLa.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-mnRoa63o.js → extension-provider-fOi6V6Cr.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BLl02GFY.js → extension-settings-page-DOGlQpkx.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-TGdKqhCf.js → file-preview-surface-DfkXvFnc.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-DfPQIHOL.js → gateway-config-swr-BOCt_zOo.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-67vWg_M2.js → gateway-realtime-BL_Cf0OQ.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-BHBOPF_q.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-CLtR2wkL.js → gateway-restart-CHf8qY7H.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-COvC3r-l.js → gateway-settings-Di41peSM.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-9YQllbw2.js → gateway-startup-retry-CvkJYurV.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-DYMRjGvd.js → global-defaults-api-BWMbKu72.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-B3sgqrl3.js +2 -0
- package/dist/gateway/static/root/assets/{image-generation-api-Dzydfvy8.js → image-generation-api-Ce-IY7Ug.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-Csd_YZXZ.js → imports-page-W7_cDbxy.js} +1 -1
- package/dist/gateway/static/root/assets/index-D4B6O8B3.js +11 -0
- package/dist/gateway/static/root/assets/index-DGWBJDAM.css +1 -0
- package/dist/gateway/static/root/assets/install-connector-dialog-DWVl9ekV.js +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-B201bMIa.js → keyboard-shortcuts-settings-Doyu0Q9e.js} +1 -1
- package/dist/gateway/static/root/assets/link-2-D_ZKYUW7.js +1 -0
- package/dist/gateway/static/root/assets/local-app-workbench-page-B3h3P6aI.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-BOwqNH0L.js → local-apps-page-D6D2bZGW.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-DjmK-SM9.js → local-session-drafts-BJ1B1dQ7.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-Bg_XR36n.js → locale-store-Br7IfbXK.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-gw3E9CMQ.js → logs-page-qiXos_12.js} +2 -2
- package/dist/gateway/static/root/assets/management-settings-C0WcSdK7.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-BUpXJUPv.js → markdown-view-Ck5s16p9.js} +2 -2
- package/dist/gateway/static/root/assets/mcp-conversation-setup-page-CENs3hGU.js +1 -0
- package/dist/gateway/static/root/assets/{media-plugins-_shnaEMY.js → media-plugins-Ba6vUE4J.js} +1 -1
- package/dist/gateway/static/root/assets/messages-ByFlEbsu.js +3 -0
- package/dist/gateway/static/root/assets/model-selector-DCBmsHzj.js +1 -0
- package/dist/gateway/static/root/assets/{models-hub-cache-KOJC3z6Q.js → models-hub-cache-Bd-fYUrV.js} +1 -1
- package/dist/gateway/static/root/assets/note-detail-panel-CnuxqWMd.js +5 -0
- package/dist/gateway/static/root/assets/note-image-lightbox-BFKZ7qJr.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-BSmikUKI.js → notes-api-8kp0X1x6.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-CA0NRL8O.js → notes-page-XMdy-H3H.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-D2t9HXoC.js → oauth-api-DMMdeaNd.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-DGGGGtcB.js → oauth-provider-connect-CfOK8mPM.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-BH54VO0V.js → page-context-capture-button-CKlKWSJ7.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-BS5y8Cx9.js → page-context-draft-LF33STHC.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-Du44NIEJ.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-D8DtpDTa.js → personal-avatar-D6CzIIfo.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-CIMMSI25.js +1 -0
- package/dist/gateway/static/root/assets/{personal-settings-panel-9uDaNJy5.js → personal-settings-panel-wKdlrfPq.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-DLYrI0C4.js → phone-dependencies-card-CDhk5277.js} +1 -1
- package/dist/gateway/static/root/assets/phone-model-connection-DZ-ZunPz.js +1 -0
- package/dist/gateway/static/root/assets/{phone-model-picker-BbA2iI-3.js → phone-model-picker-DuZc5jYO.js} +1 -1
- package/dist/gateway/static/root/assets/phone-settings-page-0u0GQl_R.js +1 -0
- package/dist/gateway/static/root/assets/{phone-workspace-store-CVDk80Bf.js → phone-workspace-store-SN7hfddU.js} +1 -1
- package/dist/gateway/static/root/assets/plugin-details-dialog-Bfc-Wmrd.js +1 -0
- package/dist/gateway/static/root/assets/{popover-select-DD8fmrxH.js → popover-select-CEMWIrtY.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-BVoN-lAv.js → preference-select-fields-BKeHZLXZ.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-DCo90zGh.js → product-automation-feedback-BPur0vyo.js} +2 -2
- package/dist/gateway/static/root/assets/{product-open-page-OWl8IAoY.js → product-open-page-Bfd7R483.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-Cjas7UNe.js → product-preview-content-Bnq68oVw.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-CPWRvBI9.js → product-preview-modal-BPmTeweh.js} +2 -2
- package/dist/gateway/static/root/assets/project-detail-page-D9nnyvrI.js +7 -0
- package/dist/gateway/static/root/assets/{project-understanding-Ba02SFzB.js → project-understanding-DLvxAoTT.js} +1 -1
- package/dist/gateway/static/root/assets/projects-page-BGy1pw9a.js +1 -0
- package/dist/gateway/static/root/assets/{providers-api-rwQ4LWzr.js → providers-api-DOnNfkwQ.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-BSmvRrZQ.js → recording-upload-CHFJbqW1.js} +1 -1
- package/dist/gateway/static/root/assets/{refresh-button-bU_0NarN.js → refresh-button-DiWdGAaX.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-Vy7LfH6E.js → registry-api-DFDvOTg4.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-UXrnpGev.js → remote-access-hub-BVqwnOqO.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-f9OzSi4W.js → resource-unavailable-TQcRCpAg.js} +1 -1
- package/dist/gateway/static/root/assets/route-preload-DI43HQV_.js +2 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-Bt8t37z5.js → runtime-tools-api-9o3Wfji1.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DU4UXnBm.js → runtime-tools-settings-panel-ccVBG-bZ.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-BKeP5G7b.js → schema-form-C-jw6Hid.js} +1 -1
- package/dist/gateway/static/root/assets/{secret-input-BQvFXqzz.js → secret-input-Dryrns2s.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-CuYsRcBB.js → service-recommendation-list-CNghOavt.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-DJI9eSgw.js → session-api-Bs3r_d2_.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-Bnq3qpqy.js +23 -0
- package/dist/gateway/static/root/assets/sessions-page-CyBj1Xw2.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BI4DMz4_.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-BxUuF_yi.js → settings-advanced-section-DwpPPxT0.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-CaoRh2gt.js → settings-mode-store-CiRpsdTJ.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-qQ8-6dJ_.js → settings-page-Cd8Ermnn.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-CyUHrn7c.js → settings-page-header-BZl4AMiN.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-DGVqXrlp.js → settings-page-layout-onhEgq-K.js} +1 -1
- package/dist/gateway/static/root/assets/setup-interaction-page-Cvvj6JyV.js +1 -0
- package/dist/gateway/static/root/assets/setup-status-panel-D4qgE7QM.js +1 -0
- package/dist/gateway/static/root/assets/share-link-dialog-DA0QuFOD.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-Cem96FbB.js → share-preview-page-YDpIY4dC.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-Dowes16l.js → shares-api-D8Q-m46d.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-DUvjOMmA.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-D8ZwFEVe.js → skill-api-uKU4sRiv.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-B4gp00-f.js → skill-list-api-BzKzG-xG.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-ClmaaDXo.js → skill-reload-api-DkUXekcd.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page-ClyNSh-7.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-D095uacX.js → system-settings-panel-BN6sUX0H.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-CS9m7Ipo.js +2 -0
- package/dist/gateway/static/root/assets/{task-result-evidence-LUrJlUhb.js → task-result-evidence-DKygspo2.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-BqEDB1Vl.js → terminal-panel-store-DJVC7HqA.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-gAcojLgP.js → theme-store-Dlnmgryi.js} +1 -1
- package/dist/gateway/static/root/assets/tool-friendly-title-DcCc6g7o.js +1 -0
- package/dist/gateway/static/root/assets/tracing-settings-page-Bs76WeoF.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-C9u9E3UQ.js → tunnel-api-B7nx0NQJ.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-BTrzsR6_.js → understanding-activity-store-C4bblRnQ.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-5Qava3jh.js → understanding-refresh-store-BvCj9-Ue.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-DFMLYKAc.js → usage-page-anU5gslJ.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-3O-X7x15.js → use-autosave-YHxQ-UZg.js} +1 -1
- package/dist/gateway/static/root/assets/use-composer-attachments-DYY3Yz4a.js +2 -0
- package/dist/gateway/static/root/assets/use-file-preview-expanded-CYgWzDnv.js +2 -0
- package/dist/gateway/static/root/assets/{use-personal-profile-MusPgljM.js → use-personal-profile-D2Un8G1L.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-Ck_U2yTw.js → use-workspace-tree-Dkg9tUr4.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-DIgPL3tN.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-C5zJApoa.js → voice-api-key-field-BUes-Jlp.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-DC1bYDt1.js → voice-config-api-CrULrSKC.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-0SZjJdVV.js → voice-input-shortcut-events-DFMNIyy4.js} +1 -1
- package/dist/gateway/static/root/assets/voice-transcribe-api-Dy4hfftb.js +1 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DAQ8McVe.js → work-discovery-overlay-CFF4cRFl.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-DUQysEyb.js → work-discovery-page-BnYaVH3V.js} +1 -1
- package/dist/gateway/static/root/assets/working-directory-picker-modal-GFwVefVA.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-api-ZrN6yUER.js → workspace-api-BdB4NEOh.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-4cZ26iaD.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-Yj_kBWSb.js → workspace-file-preview-dialog-NRL3YRjg.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-yxT7wajO.js → workspace-open-location-menu-Dcij7wvJ.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-IcH9KDzx.js → xopc-cloud-account-card-DC9aG7Pl.js} +1 -1
- package/dist/gateway/static/root/index.html +100 -98
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/automations.js +7 -0
- package/dist/packages/gateway-contract/src/capabilities.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +1 -0
- package/dist/src/agent/child-agent-factory.js +1 -1
- package/dist/src/agent/data-acquisition/service.js +1 -1
- package/dist/src/agent/embedded/configuration-capability-correction.d.ts +3 -0
- package/dist/src/agent/embedded/configuration-capability-correction.js +14 -0
- package/dist/src/agent/embedded/run-for-session.js +20 -5
- package/dist/src/agent/embedded/run-turn.js +13 -1
- package/dist/src/agent/embedded/session-runner.js +6 -3
- package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
- package/dist/src/agent/image/load-image-media.js +1 -1
- package/dist/src/agent/inbound/inbound-loop.js +4 -1
- package/dist/src/agent/independent-execution.js +1 -1
- package/dist/src/agent/mcp/config.js +1 -1
- package/dist/src/agent/mcp/connection-drafts.d.ts +3 -1
- package/dist/src/agent/mcp/connection-drafts.js +3 -2
- package/dist/src/agent/mcp/connection-setup.js +34 -2
- package/dist/src/agent/mcp/conversation-setup.d.ts +163 -0
- package/dist/src/agent/mcp/conversation-setup.js +621 -0
- package/dist/src/agent/mcp/native-mcp.d.ts +1 -0
- package/dist/src/agent/mcp/tool-catalog.d.ts +5 -0
- package/dist/src/agent/mcp/tool-catalog.js +19 -2
- package/dist/src/agent/mcp/weixin-setup-scope.d.ts +12 -0
- package/dist/src/agent/mcp/weixin-setup-scope.js +43 -0
- package/dist/src/agent/prompt/conversational-configuration-guide.js +2 -1
- package/dist/src/agent/prompt/sections/tooling.js +3 -2
- package/dist/src/agent/prompt/service-prompt-builder.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +1 -1
- package/dist/src/agent/service/process-direct-streaming.js +2 -2
- package/dist/src/agent/service.d.ts +2 -0
- package/dist/src/agent/service.js +11 -1
- package/dist/src/agent/service.types.d.ts +1 -0
- package/dist/src/agent/tasks/task-judge-service.js +2 -2
- package/dist/src/agent/tool-manuals/xopc-configuration.d.ts +6 -4
- package/dist/src/agent/tool-manuals/xopc-configuration.js +92 -8
- package/dist/src/agent/tools/automation-tool.d.ts +9 -1
- package/dist/src/agent/tools/automation-tool.js +34 -5
- package/dist/src/agent/tools/create-share-tool.js +1 -1
- package/dist/src/agent/tools/factory.d.ts +3 -0
- package/dist/src/agent/tools/factory.js +34 -23
- package/dist/src/agent/tools/image-generate-tool.js +3 -3
- package/dist/src/agent/tools/index.d.ts +1 -0
- package/dist/src/agent/tools/index.js +5 -4
- package/dist/src/agent/tools/mcp-setup-tool.d.ts +9 -0
- package/dist/src/agent/tools/mcp-setup-tool.js +32 -0
- package/dist/src/agent/tools/personal-task-tool.js +2 -2
- package/dist/src/agent/tools/publish-artifacts.js +1 -1
- package/dist/src/agent/tools/read.js +1 -1
- package/dist/src/agent/tools/skill-install-tool.js +56 -1
- package/dist/src/agent/tools/skill-manage-tool.d.ts +4 -0
- package/dist/src/agent/tools/skill-manage-tool.js +74 -2
- package/dist/src/agent/tools/skills-tools.js +1 -1
- package/dist/src/agent/tools/task-collaboration-tool.js +1 -1
- package/dist/src/agent/tools/tool-manual-tool.d.ts +1 -1
- package/dist/src/agent/tools/tool-manual-tool.js +3 -1
- package/dist/src/agent/tools/toolExposure.js +2 -0
- package/dist/src/agent/tools/write.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.d.ts +4 -2
- package/dist/src/agent/tools/xopc-use-tool.js +60 -10
- package/dist/src/agent-catalog/service.d.ts +1 -1
- package/dist/src/agent-catalog/service.js +2 -1
- package/dist/src/automations/capabilities/drafts.js +5 -2
- package/dist/src/automations/capabilities/read.js +18 -7
- package/dist/src/automations/capabilities/write.d.ts +111 -52
- package/dist/src/automations/capabilities/write.js +44 -10
- package/dist/src/automations/delivery/delivery-router.d.ts +1 -0
- package/dist/src/automations/delivery/delivery-router.js +7 -1
- package/dist/src/automations/domain/types.d.ts +8 -0
- package/dist/src/automations/domain/validation.d.ts +24 -0
- package/dist/src/automations/domain/validation.js +7 -0
- package/dist/src/automations/draft/automation-draft-validator.d.ts +6 -0
- package/dist/src/automations/index.js +2 -2
- package/dist/src/automations/mcp-source.d.ts +60 -0
- package/dist/src/automations/mcp-source.js +173 -0
- package/dist/src/automations/service/action-executor.js +15 -1
- package/dist/src/automations/service/automation-service.d.ts +5 -0
- package/dist/src/automations/service/automation-service.js +52 -2
- package/dist/src/automations/service/index.js +2 -2
- package/dist/src/browser/setup/repository.d.ts +1 -0
- package/dist/src/browser/setup/repository.js +7 -1
- package/dist/src/browser/setup/service.d.ts +3 -0
- package/dist/src/browser/setup/service.js +41 -18
- package/dist/src/browser/setup/types.d.ts +1 -0
- package/dist/src/channels/attachments/voice-stt-webchat.js +1 -1
- package/dist/src/channels/index.js +1 -1
- package/dist/src/channels/manager.d.ts +1 -0
- package/dist/src/channels/outbound-sender.d.ts +1 -0
- package/dist/src/channels/outbound-sender.js +3 -0
- package/dist/src/channels/pairing/pairing-service.js +1 -1
- package/dist/src/channels/weixin/account-identity.d.ts +2 -0
- package/dist/src/channels/weixin/account-identity.js +15 -0
- package/dist/src/chat-commands/builtins/config.js +1 -1
- package/dist/src/cli/commands/backup.js +1 -1
- package/dist/src/cli/commands/channels.js +2 -2
- package/dist/src/cli/commands/doctor/checks/channel-pairing-pending.js +1 -1
- package/dist/src/cli/commands/mcp.js +1 -1
- package/dist/src/config/models-json.d.ts +12 -0
- package/dist/src/extensions/agent-plugins/credentials.js +1 -1
- package/dist/src/extensions/agent-plugins/setup.d.ts +1 -1
- package/dist/src/extensions/agent-plugins/setup.js +3 -3
- package/dist/src/extensions/api.js +1 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/device-routes.js +1 -1
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/hono/app.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/oauth-async.js +1 -1
- package/dist/src/gateway/hono/routes/channels.js +1 -1
- package/dist/src/gateway/hono/routes/config.js +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +39 -2
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/phone-setup.js +45 -16
- package/dist/src/gateway/hono/routes/phone.js +2 -4
- package/dist/src/gateway/hono/routes/projects.js +1 -1
- package/dist/src/gateway/hono/routes/provider-setup.js +1 -1
- package/dist/src/gateway/hono/routes/public-gateway.js +22 -0
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/shares.js +1 -1
- package/dist/src/gateway/hono/routes/site-shares.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/media-access.js +1 -1
- package/dist/src/gateway/service/agent-runner.d.ts +1 -0
- package/dist/src/gateway/service/agent-runner.js +3 -1
- package/dist/src/gateway/service/config-coordinator.d.ts +1 -1
- package/dist/src/gateway/service/config-coordinator.js +2 -1
- package/dist/src/gateway/service/run-gateway-agent.js +1 -1
- package/dist/src/gateway/service/sessions-api.js +2 -1
- package/dist/src/gateway/service.d.ts +5 -1
- package/dist/src/gateway/service.js +86 -12
- package/dist/src/gateway/session-context-summary.js +1 -1
- package/dist/src/gateway/session-reset-service.d.ts +1 -0
- package/dist/src/gateway/session-reset-service.js +15 -2
- package/dist/src/gateway/xopc-cloud-capability-setup.js +9 -1
- package/dist/src/notes/service.js +1 -1
- package/dist/src/personal-agent/prompts.js +1 -1
- package/dist/src/personal-agent/reply-composer.js +2 -2
- package/dist/src/personal-agent/request-service.js +3 -3
- package/dist/src/personal-agent/service.js +1 -1
- package/dist/src/personal-agent/task-cancel.js +1 -1
- package/dist/src/phone/cloud-adb-connection.js +8 -5
- package/dist/src/phone/contracts.d.ts +4 -0
- package/dist/src/phone/contracts.js +6 -1
- package/dist/src/phone/gui-protocol.d.ts +7 -0
- package/dist/src/phone/gui-protocol.js +302 -0
- package/dist/src/phone/model-adapter.d.ts +1 -1
- package/dist/src/phone/model-adapter.js +7 -4
- package/dist/src/phone/runtime.js +8 -2
- package/dist/src/phone/setup/service.d.ts +14 -4
- package/dist/src/phone/setup/service.js +106 -28
- package/dist/src/phone/ui-dump-binary.d.ts +1 -1
- package/dist/src/phone/ui-dump-binary.js +1 -1
- package/dist/src/phone/ui-session.d.ts +2 -0
- package/dist/src/phone/ui-session.js +23 -4
- package/dist/src/projects/index.js +1 -1
- package/dist/src/projects/project-service.js +1 -1
- package/dist/src/providers/env-keys.js +2 -0
- package/dist/src/providers/index.js +11 -0
- package/dist/src/providers/model-catalog-types.d.ts +1 -1
- package/dist/src/providers/model-supplements.d.ts +1 -1
- package/dist/src/providers/model-supplements.js +6 -3
- package/dist/src/providers/phone-models.d.ts +3 -0
- package/dist/src/providers/phone-models.js +33 -0
- package/dist/src/providers/presentation.js +0 -1
- package/dist/src/runtime-tools/phone-dependencies.d.ts +2 -0
- package/dist/src/runtime-tools/phone-dependencies.js +10 -0
- package/dist/src/share/note-share-service.js +1 -1
- package/dist/src/share/site-proxy.js +1 -1
- package/dist/src/tasks/capabilities/write.js +1 -1
- package/dist/src/tasks/index.js +1 -1
- package/dist/src/tasks/task-allocation-service.js +3 -3
- package/dist/src/tasks/task-application-service.js +2 -2
- package/dist/src/tasks/task-context-assembler.js +1 -1
- package/dist/src/tasks/task-contract-planner.js +1 -1
- package/dist/src/tasks/task-handoff.js +1 -1
- package/dist/src/tasks/task-research-result.js +1 -1
- package/dist/src/tasks/task-run-coordinator.js +2 -2
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/voice/platform-catalog.d.ts +1 -1
- package/package.json +3 -1
- package/skills/tools/configure-xopc/SKILL.md +10 -3
- package/skills/tools/configure-xopc/references/browser/chrome-extension.md +4 -1
- package/skills/tools/configure-xopc/references/browser/overview.md +2 -2
- package/skills/tools/configure-xopc/references/phone/aliyun.md +3 -2
- package/skills/tools/configure-xopc/references/phone/overview.md +2 -2
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DlvjxWg6.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-OBueuQSc.js +0 -1
- package/dist/gateway/static/root/assets/agents-Cp6_5OOQ.js +0 -77
- package/dist/gateway/static/root/assets/app-link-1j40sJ-z.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-C2WKUwtN.js +0 -1
- package/dist/gateway/static/root/assets/attachment-load-qjPpQzYY.js +0 -1
- package/dist/gateway/static/root/assets/automation-task-card-wbnR5i6N.js +0 -3
- package/dist/gateway/static/root/assets/automations-workspace-D6cTOKr7.js +0 -9
- package/dist/gateway/static/root/assets/browser-settings-page-L0nBjfhG.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-aT-QjNTl.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-page-DlpuHdHi.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-pvqkN2-2.js +0 -8
- package/dist/gateway/static/root/assets/channels-BUPtawh6.js +0 -1
- package/dist/gateway/static/root/assets/chat-page-BP0huA-W.js +0 -72
- package/dist/gateway/static/root/assets/composer-payload-handoff-CYIhcczq.js +0 -1
- package/dist/gateway/static/root/assets/confirm-dialog-XGclfBqe.js +0 -1
- package/dist/gateway/static/root/assets/connected-providers-grid-CKZfhHSD.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Lf1ZzaVn.js +0 -1
- package/dist/gateway/static/root/assets/dependency-picker-UqKVJ9dv.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-ByEL5lvM.js +0 -1
- package/dist/gateway/static/root/assets/dist-CaUuvp8-.js +0 -1
- package/dist/gateway/static/root/assets/dist-D3lWNSe7.js +0 -1
- package/dist/gateway/static/root/assets/dist-DfWfZ9iu.js +0 -1
- package/dist/gateway/static/root/assets/dist-DusecO_p.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-Bkt1z-xo.js +0 -1
- package/dist/gateway/static/root/assets/home-page-k9LFXcVa.js +0 -2
- package/dist/gateway/static/root/assets/index-CpwPxKQ8.css +0 -1
- package/dist/gateway/static/root/assets/index-DKW7BeT_.js +0 -11
- package/dist/gateway/static/root/assets/install-connector-dialog-CTQAKTPv.js +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CD_8_gd_.js +0 -1
- package/dist/gateway/static/root/assets/management-settings-t_Z2mCyw.js +0 -1
- package/dist/gateway/static/root/assets/messages-DG4HLOER.js +0 -3
- package/dist/gateway/static/root/assets/model-selector-a7PIT1Lk.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-BsHYUFgk.js +0 -5
- package/dist/gateway/static/root/assets/note-image-lightbox-B-bEtjhj.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-BdZnUh-D.js +0 -1
- package/dist/gateway/static/root/assets/personal-page-KJezmTKP.js +0 -1
- package/dist/gateway/static/root/assets/phone-settings-page-Cg_BPss4.js +0 -1
- package/dist/gateway/static/root/assets/plugin-details-dialog-DgibLkc3.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-B_HlZux_.js +0 -7
- package/dist/gateway/static/root/assets/projects-page-CdfKjp95.js +0 -1
- package/dist/gateway/static/root/assets/route-preload-BtObM-co.js +0 -2
- package/dist/gateway/static/root/assets/session-manager-CtKgACGl.js +0 -23
- package/dist/gateway/static/root/assets/sessions-page-BAsKzRHt.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CjAFqg2U.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BpaPb625.js +0 -1
- package/dist/gateway/static/root/assets/share-link-dialog-CQJ6Ykm2.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DZEkZDR0.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-CV0X9rvG.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-CY2C4AM2.js +0 -2
- package/dist/gateway/static/root/assets/tool-friendly-title-o6sxGVUu.js +0 -1
- package/dist/gateway/static/root/assets/tracing-settings-page-B1ZRh-Is.js +0 -1
- package/dist/gateway/static/root/assets/use-composer-attachments-BLc4dBfe.js +0 -2
- package/dist/gateway/static/root/assets/use-file-preview-expanded-BaOmTXsT.js +0 -2
- package/dist/gateway/static/root/assets/user-model-page-Den5Lg-k.js +0 -2
- package/dist/gateway/static/root/assets/voice-transcribe-api-CxVeANPX.js +0 -1
- package/dist/gateway/static/root/assets/working-directory-picker-modal-BO9qdJyZ.js +0 -1
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-Bo5dwoWP.js +0 -1
|
@@ -40,6 +40,7 @@ export declare const AutomationActionSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
40
40
|
kind: z.ZodLiteral<"agent">;
|
|
41
41
|
agentId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string>>;
|
|
42
42
|
instruction: z.ZodString;
|
|
43
|
+
mcpSourceId: z.ZodOptional<z.ZodString>;
|
|
43
44
|
workingDirectory: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string>>;
|
|
44
45
|
model: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string>>;
|
|
45
46
|
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
@@ -182,6 +183,11 @@ export declare const AutomationDeliveryPolicySchema: z.ZodObject<{
|
|
|
182
183
|
destinations: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
183
184
|
key: z.ZodString;
|
|
184
185
|
kind: z.ZodLiteral<"gateway_event">;
|
|
186
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
187
|
+
key: z.ZodString;
|
|
188
|
+
kind: z.ZodLiteral<"weixin">;
|
|
189
|
+
conversationId: z.ZodString;
|
|
190
|
+
principalId: z.ZodString;
|
|
185
191
|
}, z.core.$strict>, z.ZodObject<{
|
|
186
192
|
key: z.ZodString;
|
|
187
193
|
kind: z.ZodLiteral<"webhook">;
|
|
@@ -250,6 +256,7 @@ export declare const AutomationSchema: z.ZodObject<{
|
|
|
250
256
|
kind: z.ZodLiteral<"agent">;
|
|
251
257
|
agentId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string>>;
|
|
252
258
|
instruction: z.ZodString;
|
|
259
|
+
mcpSourceId: z.ZodOptional<z.ZodString>;
|
|
253
260
|
workingDirectory: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string>>;
|
|
254
261
|
model: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string>>;
|
|
255
262
|
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
@@ -381,6 +388,11 @@ export declare const AutomationSchema: z.ZodObject<{
|
|
|
381
388
|
destinations: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
382
389
|
key: z.ZodString;
|
|
383
390
|
kind: z.ZodLiteral<"gateway_event">;
|
|
391
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
392
|
+
key: z.ZodString;
|
|
393
|
+
kind: z.ZodLiteral<"weixin">;
|
|
394
|
+
conversationId: z.ZodString;
|
|
395
|
+
principalId: z.ZodString;
|
|
384
396
|
}, z.core.$strict>, z.ZodObject<{
|
|
385
397
|
key: z.ZodString;
|
|
386
398
|
kind: z.ZodLiteral<"webhook">;
|
|
@@ -439,6 +451,7 @@ export declare const CreateAutomationSchema: z.ZodObject<{
|
|
|
439
451
|
kind: z.ZodLiteral<"agent">;
|
|
440
452
|
agentId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string>>;
|
|
441
453
|
instruction: z.ZodString;
|
|
454
|
+
mcpSourceId: z.ZodOptional<z.ZodString>;
|
|
442
455
|
workingDirectory: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string>>;
|
|
443
456
|
model: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string>>;
|
|
444
457
|
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
@@ -585,6 +598,11 @@ export declare const CreateAutomationSchema: z.ZodObject<{
|
|
|
585
598
|
destinations: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
586
599
|
key: z.ZodString;
|
|
587
600
|
kind: z.ZodLiteral<"gateway_event">;
|
|
601
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
602
|
+
key: z.ZodString;
|
|
603
|
+
kind: z.ZodLiteral<"weixin">;
|
|
604
|
+
conversationId: z.ZodString;
|
|
605
|
+
principalId: z.ZodString;
|
|
588
606
|
}, z.core.$strict>, z.ZodObject<{
|
|
589
607
|
key: z.ZodString;
|
|
590
608
|
kind: z.ZodLiteral<"webhook">;
|
|
@@ -655,6 +673,7 @@ export declare const UpdateAutomationSchema: z.ZodObject<{
|
|
|
655
673
|
kind: z.ZodLiteral<"agent">;
|
|
656
674
|
agentId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string>>;
|
|
657
675
|
instruction: z.ZodString;
|
|
676
|
+
mcpSourceId: z.ZodOptional<z.ZodString>;
|
|
658
677
|
workingDirectory: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string>>;
|
|
659
678
|
model: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string>>;
|
|
660
679
|
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
@@ -827,6 +846,11 @@ export declare const UpdateAutomationSchema: z.ZodObject<{
|
|
|
827
846
|
destinations: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
828
847
|
key: z.ZodString;
|
|
829
848
|
kind: z.ZodLiteral<"gateway_event">;
|
|
849
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
850
|
+
key: z.ZodString;
|
|
851
|
+
kind: z.ZodLiteral<"weixin">;
|
|
852
|
+
conversationId: z.ZodString;
|
|
853
|
+
principalId: z.ZodString;
|
|
830
854
|
}, z.core.$strict>, z.ZodObject<{
|
|
831
855
|
key: z.ZodString;
|
|
832
856
|
kind: z.ZodLiteral<"webhook">;
|
|
@@ -71,6 +71,7 @@ const AutomationActionSchema = z.discriminatedUnion("kind", [
|
|
|
71
71
|
kind: z.literal("agent"),
|
|
72
72
|
agentId: optionalTrimmedString(64),
|
|
73
73
|
instruction: nonEmptyString.max(5e4),
|
|
74
|
+
mcpSourceId: nonEmptyString.max(200).optional(),
|
|
74
75
|
workingDirectory: optionalTrimmedString(4096),
|
|
75
76
|
model: optionalTrimmedString(100),
|
|
76
77
|
timeoutSeconds: z.number().int().min(1).max(86400).optional()
|
|
@@ -126,6 +127,12 @@ const AutomationDeliveryPolicySchema = z.object({
|
|
|
126
127
|
key: nonEmptyString.max(100),
|
|
127
128
|
kind: z.literal("gateway_event")
|
|
128
129
|
}).strict(),
|
|
130
|
+
z.object({
|
|
131
|
+
key: nonEmptyString.max(100),
|
|
132
|
+
kind: z.literal("weixin"),
|
|
133
|
+
conversationId: z.string().uuid(),
|
|
134
|
+
principalId: nonEmptyString.max(500)
|
|
135
|
+
}).strict(),
|
|
129
136
|
z.object({
|
|
130
137
|
key: nonEmptyString.max(100),
|
|
131
138
|
kind: z.literal("webhook"),
|
|
@@ -16,6 +16,11 @@ export declare function buildAutomationDraftResponse(draft: GeneratedAutomationD
|
|
|
16
16
|
destinations: ({
|
|
17
17
|
key: string;
|
|
18
18
|
kind: "gateway_event";
|
|
19
|
+
} | {
|
|
20
|
+
key: string;
|
|
21
|
+
kind: "weixin";
|
|
22
|
+
conversationId: string;
|
|
23
|
+
principalId: string;
|
|
19
24
|
} | {
|
|
20
25
|
key: string;
|
|
21
26
|
kind: "webhook";
|
|
@@ -39,6 +44,7 @@ export declare function buildAutomationDraftResponse(draft: GeneratedAutomationD
|
|
|
39
44
|
kind: "agent";
|
|
40
45
|
instruction: string;
|
|
41
46
|
agentId?: string;
|
|
47
|
+
mcpSourceId?: string;
|
|
42
48
|
workingDirectory?: string;
|
|
43
49
|
model?: string;
|
|
44
50
|
timeoutSeconds?: number;
|
|
@@ -9,7 +9,7 @@ import { computeNextAutomationRunAtMs, computeNextScheduleRunAtMs, timerDelayUnt
|
|
|
9
9
|
import { DEFAULT_AUTOMATION_TIMEOUT_SECONDS, DEFAULT_BROWSER_AUTOMATION_TIMEOUT_SECONDS, defaultAutomationTimeoutSeconds, resolveAutomationTimeoutSeconds } from "./domain/defaults.js";
|
|
10
10
|
import { AutomationActionExecutor } from "./service/action-executor.js";
|
|
11
11
|
import "./delivery/index.js";
|
|
12
|
-
import { AutomationAlreadyExistsError, AutomationAlreadyRunningError, AutomationInvalidAgentError, AutomationInvalidScheduleError, AutomationService } from "./service/automation-service.js";
|
|
12
|
+
import { AutomationAlreadyExistsError, AutomationAlreadyRunningError, AutomationInvalidAgentError, AutomationInvalidScheduleError, AutomationInvalidSourceError, AutomationService } from "./service/automation-service.js";
|
|
13
13
|
import "./domain/index.js";
|
|
14
14
|
import "./service/index.js";
|
|
15
|
-
export { AutomationActionExecutor, AutomationActionSchema, AutomationAlreadyExistsError, AutomationAlreadyRunningError, AutomationDeliveryPolicySchema, AutomationDeliveryRouter, AutomationEventDispatcher, AutomationInvalidAgentError, AutomationInvalidScheduleError, AutomationManagementSchema, AutomationReliabilitySchema, AutomationSafetyPolicySchema, AutomationScheduleSchema, AutomationSchema, AutomationService, AutomationStateSchema, AutomationTriggerSchema, CreateAutomationSchema, DEFAULT_AUTOMATION_TIMEOUT_SECONDS, DEFAULT_BROWSER_AUTOMATION_TIMEOUT_SECONDS, UpdateAutomationSchema, automationEventPublisher, claimAutomationEventDeliveries, claimAutomationEventsForProjection, completeAutomationEventDelivery, completeAutomationEventProjection, computeNextAutomationRunAtMs, computeNextScheduleRunAtMs, defaultAutomationTimeoutSeconds, deferAutomationEventDelivery, expireAutomationEventProjectionLeases, failAutomationEventProjection, getAutomationEventDeliveryRunId, getAutomationEventForRun, getAutomationEventQueueMetrics, getAutomationResultDeliveryMetrics, ingestAutomationEvent, listAutomationEventRecords, listAutomationEvents, listAutomationResultDeliveries, listBusinessEventDefinitions, markAutomationEventDeliveryQueued, reconcileAutomationEventDeliveries, registerBusinessEvent, releaseAutomationEventDelivery, releaseAutomationEventProjection, replayAutomationEvent, resolveAutomationTimeoutSeconds, resolveAutomationWebhookSecret, retryAutomationResultDelivery, skipAutomationEventDelivery, timerDelayUntil, validateCatalogedBusinessEvent };
|
|
15
|
+
export { AutomationActionExecutor, AutomationActionSchema, AutomationAlreadyExistsError, AutomationAlreadyRunningError, AutomationDeliveryPolicySchema, AutomationDeliveryRouter, AutomationEventDispatcher, AutomationInvalidAgentError, AutomationInvalidScheduleError, AutomationInvalidSourceError, AutomationManagementSchema, AutomationReliabilitySchema, AutomationSafetyPolicySchema, AutomationScheduleSchema, AutomationSchema, AutomationService, AutomationStateSchema, AutomationTriggerSchema, CreateAutomationSchema, DEFAULT_AUTOMATION_TIMEOUT_SECONDS, DEFAULT_BROWSER_AUTOMATION_TIMEOUT_SECONDS, UpdateAutomationSchema, automationEventPublisher, claimAutomationEventDeliveries, claimAutomationEventsForProjection, completeAutomationEventDelivery, completeAutomationEventProjection, computeNextAutomationRunAtMs, computeNextScheduleRunAtMs, defaultAutomationTimeoutSeconds, deferAutomationEventDelivery, expireAutomationEventProjectionLeases, failAutomationEventProjection, getAutomationEventDeliveryRunId, getAutomationEventForRun, getAutomationEventQueueMetrics, getAutomationResultDeliveryMetrics, ingestAutomationEvent, listAutomationEventRecords, listAutomationEvents, listAutomationResultDeliveries, listBusinessEventDefinitions, markAutomationEventDeliveryQueued, reconcileAutomationEventDeliveries, registerBusinessEvent, releaseAutomationEventDelivery, releaseAutomationEventProjection, replayAutomationEvent, resolveAutomationTimeoutSeconds, resolveAutomationWebhookSecret, retryAutomationResultDelivery, skipAutomationEventDelivery, timerDelayUntil, validateCatalogedBusinessEvent };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { ExtensionFactory } from '@earendil-works/pi-coding-agent';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { Config } from '../config/schema.js';
|
|
4
|
+
import type { NativeMcpConfig } from '../agent/mcp/native-mcp.js';
|
|
5
|
+
export declare const AutomationMcpSourceInput: z.ZodObject<{
|
|
6
|
+
serverId: z.ZodString;
|
|
7
|
+
toolNames: z.ZodArray<z.ZodString>;
|
|
8
|
+
toolInputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodJSONSchema>>>;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
type Source = {
|
|
11
|
+
id: string;
|
|
12
|
+
agentId: string;
|
|
13
|
+
serverId: string;
|
|
14
|
+
revision: string;
|
|
15
|
+
workspaceDir: string;
|
|
16
|
+
tools: Array<{
|
|
17
|
+
name: string;
|
|
18
|
+
digest: string;
|
|
19
|
+
argumentsHash?: string;
|
|
20
|
+
}>;
|
|
21
|
+
createdAtMs: number;
|
|
22
|
+
};
|
|
23
|
+
export declare class AutomationMcpSourceError extends Error {
|
|
24
|
+
}
|
|
25
|
+
export declare function getAutomationMcpSource(id: string, agentId: string): Source;
|
|
26
|
+
export declare function assertAutomationMcpSource(source: Source, config: Config): void;
|
|
27
|
+
/** Discovery is outside SQLite write transactions; the saved reference contains no credentials. */
|
|
28
|
+
export declare function prepareAutomationMcpSource(input: unknown, context: {
|
|
29
|
+
conversationId?: string;
|
|
30
|
+
agentId?: string;
|
|
31
|
+
canConfigure: boolean;
|
|
32
|
+
readConfig: () => Config;
|
|
33
|
+
workspaceDir: string;
|
|
34
|
+
signal?: AbortSignal;
|
|
35
|
+
}): Promise<{
|
|
36
|
+
sourceId: string;
|
|
37
|
+
serverId: string;
|
|
38
|
+
agentId: string;
|
|
39
|
+
toolNames: string[];
|
|
40
|
+
fixedInputs: {
|
|
41
|
+
[k: string]: Record<string, z.core.util.JSONType>;
|
|
42
|
+
};
|
|
43
|
+
verified: boolean;
|
|
44
|
+
accountIdentityVerified: boolean;
|
|
45
|
+
instruction: string;
|
|
46
|
+
}>;
|
|
47
|
+
/** A run cannot succeed from a model answer alone or silently select a different service. */
|
|
48
|
+
export declare function withAutomationMcpSource<T>(input: {
|
|
49
|
+
runId: string;
|
|
50
|
+
conversationId: string;
|
|
51
|
+
sourceId: string;
|
|
52
|
+
agentId: string;
|
|
53
|
+
readConfig: () => Config;
|
|
54
|
+
signal: AbortSignal;
|
|
55
|
+
}, operation: () => Promise<T>): Promise<T>;
|
|
56
|
+
export declare function boundAutomationMcpSource(runId: string, conversationId: string): Source | undefined;
|
|
57
|
+
export declare function restrictAutomationMcpConfig(runId: string, conversationId: string, loaded: NativeMcpConfig): NativeMcpConfig;
|
|
58
|
+
/** Native pi still executes tools. The guard pins the current contract at each actual call. */
|
|
59
|
+
export declare function createAutomationMcpSourceGuard(runId: string): ExtensionFactory;
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
|
|
2
|
+
import { init_session_repository } from "../storage/sqlite/session-repository.js";
|
|
3
|
+
import { connectorPrincipalForSession } from "../connectors/principal.js";
|
|
4
|
+
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
5
|
+
import { isManagedConnectorServer } from "../connectors/materialize.js";
|
|
6
|
+
import { discoverMcpTools } from "../agent/mcp/tool-catalog.js";
|
|
7
|
+
import { mcpConfigRevision } from "../agent/mcp/connection-drafts.js";
|
|
8
|
+
import { createHash } from "node:crypto";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
//#region src/automations/mcp-source.ts
|
|
11
|
+
init_session_repository();
|
|
12
|
+
const AutomationMcpSourceInput = z.object({
|
|
13
|
+
serverId: z.string().min(1).max(64),
|
|
14
|
+
toolNames: z.array(z.string().min(1).max(300)).min(1).max(10),
|
|
15
|
+
toolInputs: z.record(z.string(), z.record(z.string(), z.json())).optional()
|
|
16
|
+
}).strict();
|
|
17
|
+
const sources = new DurableState("automation.mcp-source.v1");
|
|
18
|
+
const executions = /* @__PURE__ */ new Map();
|
|
19
|
+
var AutomationMcpSourceError = class extends Error {};
|
|
20
|
+
const fail = (message) => {
|
|
21
|
+
throw new AutomationMcpSourceError(message);
|
|
22
|
+
};
|
|
23
|
+
const serverFor = (config, id) => Object.hasOwn(config.mcp?.servers ?? {}, id) ? config.mcp.servers[id] : void 0;
|
|
24
|
+
const toolDigest = (tool) => mcpConfigRevision({
|
|
25
|
+
name: tool.name,
|
|
26
|
+
schema: tool.inputSchema,
|
|
27
|
+
annotations: tool.annotations
|
|
28
|
+
});
|
|
29
|
+
function getAutomationMcpSource(id, agentId) {
|
|
30
|
+
const source = sources.get(id);
|
|
31
|
+
if (!source || source.agentId !== agentId) return fail("The prepared MCP source is missing or belongs to another assistant. Prepare it again for the selected assistant.");
|
|
32
|
+
return source;
|
|
33
|
+
}
|
|
34
|
+
function assertAutomationMcpSource(source, config) {
|
|
35
|
+
const server = serverFor(config, source.serverId);
|
|
36
|
+
if (!server || server.enabled === false || mcpConfigRevision(server) !== source.revision) fail("The selected MCP source changed, was removed or is disabled. Reconnect and verify that source; no alternative source will be used.");
|
|
37
|
+
}
|
|
38
|
+
/** Discovery is outside SQLite write transactions; the saved reference contains no credentials. */
|
|
39
|
+
async function prepareAutomationMcpSource(input, context) {
|
|
40
|
+
const args = AutomationMcpSourceInput.parse(input);
|
|
41
|
+
const session = context.conversationId ? getSessionMetadata(context.conversationId) : void 0;
|
|
42
|
+
if (!context.canConfigure || !session || session.agentId !== context.agentId || !connectorPrincipalForSession(context.conversationId).isLocalOwner) return fail("An active owner conversation is required to prepare an automation source.");
|
|
43
|
+
const config = structuredClone(context.readConfig()), server = serverFor(config, args.serverId);
|
|
44
|
+
if (!server?.url || server.enabled === false || isManagedConnectorServer(server) || server.xopcPlugin) return fail("This workflow supports an enabled custom HTTP MCP connection. Managed connectors and account-specific bindings require their own adapter.");
|
|
45
|
+
const catalog = await discoverMcpTools(config, context.workspaceDir, args.serverId, { signal: context.signal });
|
|
46
|
+
const selected = [...new Set(args.toolNames)].sort().map((name) => {
|
|
47
|
+
const tool = catalog.find((item) => item.name === name);
|
|
48
|
+
if (!tool || tool.exposure === "hidden" || tool.annotations?.readOnlyHint !== true || tool.annotations.destructiveHint === true) return fail("Select discovered, exposed MCP tools explicitly annotated read-only. No tool permissions will be widened.");
|
|
49
|
+
return {
|
|
50
|
+
name,
|
|
51
|
+
digest: toolDigest(tool),
|
|
52
|
+
argumentsHash: mcpConfigRevision(args.toolInputs?.[name] ?? {})
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
const fields = {
|
|
56
|
+
agentId: context.agentId,
|
|
57
|
+
serverId: args.serverId,
|
|
58
|
+
revision: mcpConfigRevision(server),
|
|
59
|
+
workspaceDir: context.workspaceDir,
|
|
60
|
+
tools: selected
|
|
61
|
+
};
|
|
62
|
+
const id = `mcp-source-${createHash("sha256").update(JSON.stringify(fields)).digest("hex")}`;
|
|
63
|
+
const source = {
|
|
64
|
+
...fields,
|
|
65
|
+
id,
|
|
66
|
+
createdAtMs: Date.now()
|
|
67
|
+
};
|
|
68
|
+
assertAutomationMcpSource(source, context.readConfig());
|
|
69
|
+
if (!sources.get(id)) sources.set(id, source);
|
|
70
|
+
return {
|
|
71
|
+
sourceId: id,
|
|
72
|
+
serverId: source.serverId,
|
|
73
|
+
agentId: source.agentId,
|
|
74
|
+
toolNames: selected.map((tool) => tool.name),
|
|
75
|
+
fixedInputs: Object.fromEntries(selected.map((tool) => [tool.name, args.toolInputs?.[tool.name] ?? {}])),
|
|
76
|
+
verified: false,
|
|
77
|
+
accountIdentityVerified: false,
|
|
78
|
+
instruction: "Create a disabled agent automation with action.mcpSourceId set to sourceId. Run an actual trial, inspect its terminal result, then enable the same object only when authorized. This pins the selected server and grant reference, not an independently verified remote account identity. Do not enable explicit-account workflows without their identity adapter."
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/** A run cannot succeed from a model answer alone or silently select a different service. */
|
|
82
|
+
async function withAutomationMcpSource(input, operation) {
|
|
83
|
+
const source = getAutomationMcpSource(input.sourceId, input.agentId);
|
|
84
|
+
assertAutomationMcpSource(source, input.readConfig());
|
|
85
|
+
const catalog = await discoverMcpTools(input.readConfig(), source.workspaceDir, source.serverId, { signal: input.signal });
|
|
86
|
+
assertAutomationMcpSource(source, input.readConfig());
|
|
87
|
+
if (source.tools.some((expected) => !catalog.some((tool) => tool.name === expected.name && tool.exposure !== "hidden" && toolDigest(tool) === expected.digest))) return fail("The selected MCP tool contract changed. Verify a new source before running again.");
|
|
88
|
+
if (executions.has(input.runId)) return fail("This source-bound run is already executing.");
|
|
89
|
+
const execution = {
|
|
90
|
+
source,
|
|
91
|
+
conversationId: input.conversationId,
|
|
92
|
+
readConfig: input.readConfig,
|
|
93
|
+
signal: input.signal,
|
|
94
|
+
successful: /* @__PURE__ */ new Set(),
|
|
95
|
+
failed: false
|
|
96
|
+
};
|
|
97
|
+
executions.set(input.runId, execution);
|
|
98
|
+
try {
|
|
99
|
+
const result = await operation();
|
|
100
|
+
input.signal.throwIfAborted();
|
|
101
|
+
assertAutomationMcpSource(source, input.readConfig());
|
|
102
|
+
if (execution.failed || source.tools.some((tool) => !execution.successful.has(tool.name))) return fail("The selected MCP read did not complete successfully in this run. An assistant answer is not verified source data.");
|
|
103
|
+
return result;
|
|
104
|
+
} finally {
|
|
105
|
+
executions.delete(input.runId);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function boundAutomationMcpSource(runId, conversationId) {
|
|
109
|
+
const execution = executions.get(runId);
|
|
110
|
+
if (execution && execution.conversationId !== conversationId) return fail("The MCP source belongs to a different execution conversation.");
|
|
111
|
+
return execution?.source;
|
|
112
|
+
}
|
|
113
|
+
function restrictAutomationMcpConfig(runId, conversationId, loaded) {
|
|
114
|
+
const source = boundAutomationMcpSource(runId, conversationId);
|
|
115
|
+
if (!source) return loaded;
|
|
116
|
+
const entry = loaded.servers.find((server) => server.name === source.serverId && server.config.enabled !== false);
|
|
117
|
+
if (!entry) return fail("The selected MCP source is not available to this execution.");
|
|
118
|
+
return {
|
|
119
|
+
...loaded,
|
|
120
|
+
errors: [],
|
|
121
|
+
automationSourceRunId: runId,
|
|
122
|
+
servers: [{
|
|
123
|
+
...entry,
|
|
124
|
+
config: {
|
|
125
|
+
...entry.config,
|
|
126
|
+
exposure: entry.config.exposure === "hidden" ? "hidden" : "deferred"
|
|
127
|
+
}
|
|
128
|
+
}]
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
/** Native pi still executes tools. The guard pins the current contract at each actual call. */
|
|
132
|
+
function createAutomationMcpSourceGuard(runId) {
|
|
133
|
+
return (pi) => {
|
|
134
|
+
pi.on("tool_call", (event) => {
|
|
135
|
+
const execution = executions.get(runId);
|
|
136
|
+
if (!execution || execution.signal.aborted) return {
|
|
137
|
+
block: true,
|
|
138
|
+
reason: "The bound automation execution ended."
|
|
139
|
+
};
|
|
140
|
+
try {
|
|
141
|
+
assertAutomationMcpSource(execution.source, execution.readConfig());
|
|
142
|
+
if (event.toolName === "tool_search") return;
|
|
143
|
+
const expected = execution.source.tools.find((tool) => tool.name === event.toolName);
|
|
144
|
+
const actual = pi.getAllTools().find((tool) => tool.name === event.toolName);
|
|
145
|
+
if (!expected || !actual || actual.exposure === "hidden" || toolDigest({
|
|
146
|
+
name: actual.name,
|
|
147
|
+
inputSchema: actual.parameters,
|
|
148
|
+
annotations: actual.annotations
|
|
149
|
+
}) !== expected.digest || mcpConfigRevision(event.input ?? {}) !== (expected.argumentsHash ?? mcpConfigRevision({}))) {
|
|
150
|
+
execution.failed = true;
|
|
151
|
+
return {
|
|
152
|
+
block: true,
|
|
153
|
+
reason: "This tool is outside the pinned MCP read contract."
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
} catch {
|
|
157
|
+
execution.failed = true;
|
|
158
|
+
return {
|
|
159
|
+
block: true,
|
|
160
|
+
reason: "The selected MCP source changed. No alternative source is allowed."
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
pi.on("tool_result", (event) => {
|
|
165
|
+
const execution = executions.get(runId);
|
|
166
|
+
if (!execution || !execution.source.tools.some((tool) => tool.name === event.toolName)) return;
|
|
167
|
+
if (event.isError) execution.failed = true;
|
|
168
|
+
else execution.successful.add(event.toolName);
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
//#endregion
|
|
173
|
+
export { AutomationMcpSourceError, AutomationMcpSourceInput, assertAutomationMcpSource, boundAutomationMcpSource, createAutomationMcpSourceGuard, getAutomationMcpSource, prepareAutomationMcpSource, restrictAutomationMcpConfig, withAutomationMcpSource };
|
|
@@ -6,6 +6,7 @@ import { init_model_usage, withModelUsageOrigin } from "../../providers/model-us
|
|
|
6
6
|
import { init_session_key, resolveConversationId } from "../../routing/session-key.js";
|
|
7
7
|
import { getAutomationRunRequest, listAutomationRuns } from "../storage/automation-run-repository.js";
|
|
8
8
|
import "../storage/index.js";
|
|
9
|
+
import { withAutomationMcpSource } from "../mcp-source.js";
|
|
9
10
|
import { resolveAutomationTimeoutSeconds } from "../domain/defaults.js";
|
|
10
11
|
//#region src/automations/service/action-executor.ts
|
|
11
12
|
init_session_repository();
|
|
@@ -279,7 +280,7 @@ var AutomationActionExecutor = class {
|
|
|
279
280
|
}),
|
|
280
281
|
"</automation_handoff>"
|
|
281
282
|
].join("\n") : "";
|
|
282
|
-
const
|
|
283
|
+
const process = () => agentService.turnDispatcher.processDirect(buildSafetyInstruction(automation, [appendTriggerContext(action.instruction, context.triggerEvent), handoff].filter(Boolean).join("\n\n")), conversationId, {
|
|
283
284
|
type: "system",
|
|
284
285
|
source: "automation"
|
|
285
286
|
}, void 0, void 0, {
|
|
@@ -287,6 +288,19 @@ var AutomationActionExecutor = class {
|
|
|
287
288
|
runId: run.id,
|
|
288
289
|
deadlineAtMs
|
|
289
290
|
});
|
|
291
|
+
if (action.mcpSourceId && !this.deps.getConfig) return {
|
|
292
|
+
status: "failed",
|
|
293
|
+
error: "The selected MCP source cannot be checked in this runtime.",
|
|
294
|
+
conversationId
|
|
295
|
+
};
|
|
296
|
+
const response = action.mcpSourceId ? await withAutomationMcpSource({
|
|
297
|
+
runId: run.id,
|
|
298
|
+
conversationId,
|
|
299
|
+
sourceId: action.mcpSourceId,
|
|
300
|
+
agentId,
|
|
301
|
+
readConfig: this.deps.getConfig,
|
|
302
|
+
signal
|
|
303
|
+
}, process) : await process();
|
|
290
304
|
const model = agentService.getModelForSession?.(conversationId);
|
|
291
305
|
return {
|
|
292
306
|
status: "succeeded",
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import type { AutomationDeliveryPolicy } from '../domain/types.js';
|
|
1
2
|
import type { Automation, AutomationDeps, AutomationEvent, AutomationMetrics, AutomationProductEventRun, AutomationRun, AutomationRunEvent } from '../domain/types.js';
|
|
2
3
|
import { type CreateAutomationInput, type UpdateAutomationInput } from '../domain/validation.js';
|
|
3
4
|
export declare class AutomationInvalidScheduleError extends Error {
|
|
4
5
|
}
|
|
5
6
|
export declare class AutomationInvalidAgentError extends Error {
|
|
6
7
|
}
|
|
8
|
+
export declare class AutomationInvalidSourceError extends Error {
|
|
9
|
+
}
|
|
7
10
|
export declare class AutomationAlreadyRunningError extends Error {
|
|
8
11
|
readonly automationId: string;
|
|
9
12
|
readonly runningRunId?: string;
|
|
@@ -31,11 +34,13 @@ export declare class AutomationService {
|
|
|
31
34
|
maxConcurrentRuns?: number;
|
|
32
35
|
}): Promise<void>;
|
|
33
36
|
stop(): Promise<void>;
|
|
37
|
+
bindConversationDelivery(conversationId: string | undefined, input: unknown): AutomationDeliveryPolicy;
|
|
34
38
|
create(input: CreateAutomationInput): Promise<Automation>;
|
|
35
39
|
/** SQLite-only creation; scheduling starts after the caller commits. */
|
|
36
40
|
createAtomically(input: CreateAutomationInput): Automation;
|
|
37
41
|
private applyCreate;
|
|
38
42
|
private assertExecutionAgent;
|
|
43
|
+
private assertMcpSource;
|
|
39
44
|
private prepareSchedule;
|
|
40
45
|
private pinBrowserVersion;
|
|
41
46
|
list(options?: {
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { init_transaction, runSqliteWriteTransaction } from "../../storage/sqlite/transaction.js";
|
|
4
|
-
import {
|
|
4
|
+
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
5
|
+
import { init_session_repository } from "../../storage/sqlite/session-repository.js";
|
|
6
|
+
import { normalizeAgentId } from "../../agent-catalog/id.js";
|
|
7
|
+
import { init_agent_scope } from "../../agent/agent-scope.js";
|
|
8
|
+
import { AutomationDeliveryPolicySchema, AutomationSchema, CreateAutomationSchema, UpdateAutomationSchema } from "../domain/validation.js";
|
|
5
9
|
import { deleteAutomation, getAutomation, getDeletedAutomationRevision, listAutomations, saveAutomation, saveAutomations } from "../storage/automation-repository.js";
|
|
6
10
|
import { appendAutomationRunEvent, getAutomationRun, getAutomationRunRequest, listAutomationRunEvents, listAutomationRuns, listAutomationRunsForProductEvent, listUnfinishedAutomationRuns, markAllAutomationRunsRead, markAutomationRunRead, pruneAutomationHistory, saveAutomationRun, saveAutomationRunRequest, touchAutomationRunLease } from "../storage/automation-run-repository.js";
|
|
7
11
|
import "../storage/index.js";
|
|
8
12
|
import { getAutomationEventDeliveryRunId, getAutomationEventForRun, getAutomationEventQueueMetrics, ingestAutomationEvent, listAutomationEventRecords, markAutomationEventDeliveryQueued, replayAutomationEvent } from "../events/event-repository.js";
|
|
9
13
|
import { AutomationEventDispatcher } from "../events/event-dispatcher.js";
|
|
10
14
|
import { AutomationDeliveryRouter, getAutomationResultDeliveryMetrics, listAutomationResultDeliveries, retryAutomationResultDelivery } from "../delivery/delivery-router.js";
|
|
15
|
+
import { mcpConfigRevision } from "../../agent/mcp/connection-drafts.js";
|
|
16
|
+
import { assertAutomationMcpSource, getAutomationMcpSource } from "../mcp-source.js";
|
|
17
|
+
import { weixinPrivateIdentity } from "../../agent/mcp/weixin-setup-scope.js";
|
|
11
18
|
import { computeNextAutomationRunAtMs, timerDelayUntil } from "../domain/schedule.js";
|
|
12
19
|
import { AutomationActionExecutor } from "./action-executor.js";
|
|
13
20
|
import "../delivery/index.js";
|
|
14
21
|
import { randomUUID } from "node:crypto";
|
|
15
22
|
//#region src/automations/service/automation-service.ts
|
|
23
|
+
init_session_repository();
|
|
16
24
|
init_logger();
|
|
25
|
+
init_agent_scope();
|
|
17
26
|
init_transaction();
|
|
18
27
|
const log = createLogger("AutomationService");
|
|
19
28
|
const DEFAULT_MAX_CONCURRENT_RUNS = 5;
|
|
@@ -22,6 +31,7 @@ const RUN_LEASE_DURATION_MS = 3e4;
|
|
|
22
31
|
const RETRY_BASE_DELAY_MS = 1e3;
|
|
23
32
|
var AutomationInvalidScheduleError = class extends Error {};
|
|
24
33
|
var AutomationInvalidAgentError = class extends Error {};
|
|
34
|
+
var AutomationInvalidSourceError = class extends Error {};
|
|
25
35
|
var AutomationAlreadyRunningError = class extends Error {
|
|
26
36
|
constructor(automationId, runningRunId) {
|
|
27
37
|
super(`Automation is already running: ${automationId}`);
|
|
@@ -44,6 +54,10 @@ var AutomationService = class {
|
|
|
44
54
|
onDeadLetter: (input) => this.deps.onReliabilityAttention?.(input)
|
|
45
55
|
});
|
|
46
56
|
deliveryRouter = new AutomationDeliveryRouter({
|
|
57
|
+
deliverWeixin: (conversationId, principalId, run) => {
|
|
58
|
+
if (!this.deps.onWeixinRunCompleted) throw new Error("Weixin delivery is unavailable.");
|
|
59
|
+
return this.deps.onWeixinRunCompleted(conversationId, principalId, run);
|
|
60
|
+
},
|
|
47
61
|
deliverGatewayEvent: (run, context) => {
|
|
48
62
|
if (!this.deps.onRunCompleted) throw new Error("Notification service is unavailable. Delivery will retry.");
|
|
49
63
|
return this.deps.onRunCompleted(run, context);
|
|
@@ -89,6 +103,25 @@ var AutomationService = class {
|
|
|
89
103
|
await this.deliveryRouter.stop();
|
|
90
104
|
log.info("Automation service stopped");
|
|
91
105
|
}
|
|
106
|
+
bindConversationDelivery(conversationId, input) {
|
|
107
|
+
const delivery = AutomationDeliveryPolicySchema.parse(input);
|
|
108
|
+
if (!conversationId || getSessionMetadata(conversationId)?.sourceChannel !== "weixin") return delivery;
|
|
109
|
+
const scope = this.deps.getConfig && weixinPrivateIdentity(conversationId, this.deps.getConfig());
|
|
110
|
+
if (!scope) throw new AutomationInvalidSourceError("A paired Weixin conversation is required for this notification.");
|
|
111
|
+
const destinations = delivery.destinations.filter((item) => item.kind !== "weixin");
|
|
112
|
+
if (delivery.destinations.some((item) => item.kind === "weixin" && (item.conversationId !== conversationId || item.principalId !== scope.principalId))) throw new AutomationInvalidSourceError("Notifications cannot be redirected to another Weixin identity.");
|
|
113
|
+
let key = "weixin";
|
|
114
|
+
while (destinations.some((item) => item.key === key)) key = `_${key}`;
|
|
115
|
+
return {
|
|
116
|
+
...delivery,
|
|
117
|
+
destinations: [...destinations, {
|
|
118
|
+
key,
|
|
119
|
+
kind: "weixin",
|
|
120
|
+
conversationId,
|
|
121
|
+
principalId: scope.principalId
|
|
122
|
+
}]
|
|
123
|
+
};
|
|
124
|
+
}
|
|
92
125
|
async create(input) {
|
|
93
126
|
const automation = this.createAtomically(input);
|
|
94
127
|
this.refreshSchedule();
|
|
@@ -121,6 +154,7 @@ var AutomationService = class {
|
|
|
121
154
|
this.assertExecutionAgent(automation);
|
|
122
155
|
this.prepareSchedule(automation, now);
|
|
123
156
|
this.pinBrowserVersion(automation);
|
|
157
|
+
this.assertMcpSource(automation);
|
|
124
158
|
if (getAutomation(automation.id)) throw new AutomationAlreadyExistsError(automation.id);
|
|
125
159
|
automation.updatedAtMs = Math.max(automation.updatedAtMs, (getDeletedAutomationRevision(automation.id) ?? -1) + 1);
|
|
126
160
|
automation.state.nextRunAtMs = computeNextAutomationRunAtMs(automation, now);
|
|
@@ -131,6 +165,20 @@ var AutomationService = class {
|
|
|
131
165
|
if (automation.action.kind !== "agent" || !automation.action.agentId || !this.deps.isAgentAvailable) return;
|
|
132
166
|
if (!this.deps.isAgentAvailable(automation.action.agentId)) throw new AutomationInvalidAgentError("Execution assistant is unavailable. Choose an available assistant or use the default.");
|
|
133
167
|
}
|
|
168
|
+
assertMcpSource(automation) {
|
|
169
|
+
if (automation.action.kind !== "agent" || !automation.action.mcpSourceId || !automation.enabled) return;
|
|
170
|
+
try {
|
|
171
|
+
const source = getAutomationMcpSource(automation.action.mcpSourceId, normalizeAgentId(automation.action.agentId || this.deps.getDefaultAgentId?.() || "main"));
|
|
172
|
+
if (!this.deps.getConfig) throw new Error("The selected MCP source cannot be checked in this runtime.");
|
|
173
|
+
assertAutomationMcpSource(source, this.deps.getConfig());
|
|
174
|
+
if (!listAutomationRuns({
|
|
175
|
+
automationId: automation.id,
|
|
176
|
+
limit: 500
|
|
177
|
+
}).some((run) => run.status === "succeeded" && mcpConfigRevision(run.actionSnapshot) === mcpConfigRevision(automation.action))) throw new Error("Run and verify this exact source-bound action before enabling its schedule. Save a disabled draft first.");
|
|
178
|
+
} catch (error) {
|
|
179
|
+
throw new AutomationInvalidSourceError(error instanceof Error ? error.message : "The MCP source is unavailable.");
|
|
180
|
+
}
|
|
181
|
+
}
|
|
134
182
|
prepareSchedule(automation, now) {
|
|
135
183
|
if (automation.trigger.kind !== "schedule") return;
|
|
136
184
|
const schedule = automation.trigger.schedule;
|
|
@@ -193,9 +241,11 @@ var AutomationService = class {
|
|
|
193
241
|
...parsed.state ?? {}
|
|
194
242
|
}
|
|
195
243
|
});
|
|
244
|
+
if (current.action.kind === "agent" && current.action.mcpSourceId && next.action.kind === "agent" && !next.action.mcpSourceId) next.action.mcpSourceId = current.action.mcpSourceId;
|
|
196
245
|
if (parsed.action) this.assertExecutionAgent(next);
|
|
197
246
|
if (parsed.trigger || parsed.enabled === true && next.trigger.kind === "schedule" && next.trigger.schedule.kind === "once") this.prepareSchedule(next, now);
|
|
198
247
|
this.pinBrowserVersion(next);
|
|
248
|
+
this.assertMcpSource(next);
|
|
199
249
|
if ("enabled" in parsed || "trigger" in parsed) next.state.nextRunAtMs = computeNextAutomationRunAtMs(next, now);
|
|
200
250
|
saveAutomation(next);
|
|
201
251
|
return next;
|
|
@@ -844,4 +894,4 @@ function readAutomationEventFromRunEvent(event) {
|
|
|
844
894
|
};
|
|
845
895
|
}
|
|
846
896
|
//#endregion
|
|
847
|
-
export { AutomationAlreadyExistsError, AutomationAlreadyRunningError, AutomationInvalidAgentError, AutomationInvalidScheduleError, AutomationService };
|
|
897
|
+
export { AutomationAlreadyExistsError, AutomationAlreadyRunningError, AutomationInvalidAgentError, AutomationInvalidScheduleError, AutomationInvalidSourceError, AutomationService };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { AutomationActionExecutor } from "./action-executor.js";
|
|
2
|
-
import { AutomationAlreadyExistsError, AutomationAlreadyRunningError, AutomationInvalidAgentError, AutomationInvalidScheduleError, AutomationService } from "./automation-service.js";
|
|
3
|
-
export { AutomationActionExecutor, AutomationAlreadyExistsError, AutomationAlreadyRunningError, AutomationInvalidAgentError, AutomationInvalidScheduleError, AutomationService };
|
|
2
|
+
import { AutomationAlreadyExistsError, AutomationAlreadyRunningError, AutomationInvalidAgentError, AutomationInvalidScheduleError, AutomationInvalidSourceError, AutomationService } from "./automation-service.js";
|
|
3
|
+
export { AutomationActionExecutor, AutomationAlreadyExistsError, AutomationAlreadyRunningError, AutomationInvalidAgentError, AutomationInvalidScheduleError, AutomationInvalidSourceError, AutomationService };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BrowserSetup } from './types.js';
|
|
2
2
|
export declare function readBrowserSetup(id: string): BrowserSetup | undefined;
|
|
3
|
+
export declare function listConversationBrowserSetups(conversationId: string): BrowserSetup[];
|
|
3
4
|
export declare function findBrowserSetup(conversationId: string, agentId: string): BrowserSetup | undefined;
|
|
4
5
|
export declare function createBrowserSetup(conversationId: string, agentId: string, configRevision: string): BrowserSetup;
|
|
5
6
|
export declare function saveBrowserSetup(next: BrowserSetup, expectedRevision: number): BrowserSetup;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "../../storage/sqlite/transaction.js";
|
|
2
|
+
import { getSessionMetadata, init_session_read_repository } from "../../storage/sqlite/session-read-repository.js";
|
|
2
3
|
import { randomUUID } from "node:crypto";
|
|
3
4
|
//#region src/browser/setup/repository.ts
|
|
4
5
|
init_transaction();
|
|
6
|
+
init_session_read_repository();
|
|
5
7
|
function readBrowserSetup(id) {
|
|
6
8
|
const row = getSqliteDatabase().prepare("SELECT payload_json FROM browser_setup_runs WHERE id = ?").get(id);
|
|
7
9
|
return row ? JSON.parse(row.payload_json) : void 0;
|
|
8
10
|
}
|
|
11
|
+
function listConversationBrowserSetups(conversationId) {
|
|
12
|
+
return getSqliteDatabase().prepare("SELECT payload_json FROM browser_setup_runs WHERE conversation_id = ?").all(conversationId).map((row) => JSON.parse(row.payload_json));
|
|
13
|
+
}
|
|
9
14
|
function findBrowserSetup(conversationId, agentId) {
|
|
10
15
|
const row = getSqliteDatabase().prepare("SELECT payload_json FROM browser_setup_runs WHERE conversation_id = ? AND agent_id = ? ORDER BY updated_at DESC, rowid DESC LIMIT 1").get(conversationId, agentId);
|
|
11
16
|
return row ? JSON.parse(row.payload_json) : void 0;
|
|
@@ -19,6 +24,7 @@ function createBrowserSetup(conversationId, agentId, configRevision) {
|
|
|
19
24
|
id: randomUUID(),
|
|
20
25
|
conversationId,
|
|
21
26
|
agentId,
|
|
27
|
+
transcriptId: getSessionMetadata(conversationId)?.transcriptId,
|
|
22
28
|
configRevision,
|
|
23
29
|
state: "plan_ready",
|
|
24
30
|
revision: 1,
|
|
@@ -39,4 +45,4 @@ function saveBrowserSetup(next, expectedRevision) {
|
|
|
39
45
|
return next;
|
|
40
46
|
}
|
|
41
47
|
//#endregion
|
|
42
|
-
export { createBrowserSetup, findBrowserSetup, readBrowserSetup, saveBrowserSetup };
|
|
48
|
+
export { createBrowserSetup, findBrowserSetup, listConversationBrowserSetups, readBrowserSetup, saveBrowserSetup };
|
|
@@ -31,7 +31,10 @@ export interface BrowserSetupDeps {
|
|
|
31
31
|
export declare class BrowserSetupService {
|
|
32
32
|
private readonly deps;
|
|
33
33
|
private readonly preparing;
|
|
34
|
+
private readonly preparationSettled;
|
|
34
35
|
constructor(deps: BrowserSetupDeps);
|
|
36
|
+
private scopeCurrent;
|
|
37
|
+
cancelConversation(conversationId: string): Promise<void>;
|
|
35
38
|
private policyRevision;
|
|
36
39
|
endpoints(): {
|
|
37
40
|
endpointId: string;
|