@xopcai/xopc 0.0.426 → 0.0.428
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-D_DXNHba.js → activity-store-WqnVruhY.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CjaQxFQt.js → agent-avatar-dicebear-CSiO9c2F.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-6Z4m31Fz.js → agent-avatar-display-D-yds6wG.js} +2 -2
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-_UT9C7bg.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-DVzYXsAy.js +1 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-u5c3GREg.js → agents-admin-api-Bgv4lJ9Y.js} +1 -1
- package/dist/gateway/static/root/assets/agents-yTsbcxRi.js +77 -0
- package/dist/gateway/static/root/assets/{api-C3Tp9MkF.js → api-C-9J9ghT.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CRT9ZyH0.js → api-Dv6Cn-Rs.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-C8yc3yHG.js → app-management-settings-panel-BXJrrjH5.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BELgtR3O.js → appearance-settings-oYjAVulT.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-D95yzj-f.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BCQnOkV8.js → archive-plugin-DBPu3xCJ.js} +1 -1
- package/dist/gateway/static/root/assets/attachment-load-DrVGNxJm.js +1 -0
- package/dist/gateway/static/root/assets/automation-api-DAou8Kji.js +1 -0
- package/dist/gateway/static/root/assets/{automation-result-state-CMfVTv_i.js → automation-result-state-CA7LV098.js} +1 -1
- package/dist/gateway/static/root/assets/automation-task-card-w6cKxfaP.js +3 -0
- package/dist/gateway/static/root/assets/{automations-page-CdIPdwF0.js → automations-page-D4LyOLzY.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BGyvZZj5.js +9 -0
- package/dist/gateway/static/root/assets/{binary-plugins-CIB5cbvQ.js → binary-plugins-D25P9ZxQ.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BQtTLe6Q.js → block-editor-BI105p1U.js} +2 -2
- package/dist/gateway/static/root/assets/{browser-automation-inputs-DeraGZ1y.js → browser-automation-inputs-DhDRvWQE.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-SpPzRNqU.js → browser-automations-page-CCPi1Bvy.js} +2 -2
- package/dist/gateway/static/root/assets/{browser-control-api-CbbPvhHR.js → browser-control-api-BN4F-bM1.js} +1 -1
- package/dist/gateway/static/root/assets/browser-settings-page-BZXUZpjp.js +3 -0
- package/dist/gateway/static/root/assets/{button-CnRSIP6m.js → button-Cc4hUNTt.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-DLMuj21P.js → capabilities-LC-yEQYo.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-DHJLl4RD.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-FJ3Vo7Wa.js +8 -0
- package/dist/gateway/static/root/assets/capabilities-u2z_KFRt.js +1 -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-9Uaa-IN0.js +1 -0
- package/dist/gateway/static/root/assets/{chat-agents-api-D8YS5amE.js → chat-agents-api-Cffxfzi1.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-DCzUECct.js → chat-chart-block-Bbk0b3TV.js} +1 -1
- package/dist/gateway/static/root/assets/chat-page--dKUIg5W.js +72 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Dl-OTkJI.js → chat-terminal-dock-CQMuG-Bz.js} +2 -2
- package/dist/gateway/static/root/assets/{command-palette-api-Dijix7V6.js → command-palette-api-BRxfFgGA.js} +1 -1
- package/dist/gateway/static/root/assets/composer-payload-handoff-_9L2A5AZ.js +1 -0
- package/dist/gateway/static/root/assets/{computer-settings-page-B-lGMimW.js → computer-settings-page-Bm70SIjD.js} +1 -1
- package/dist/gateway/static/root/assets/confirm-dialog-D7dQJytv.js +1 -0
- package/dist/gateway/static/root/assets/connected-providers-grid-B7ktDgqt.js +1 -0
- package/dist/gateway/static/root/assets/{connector-service-page-C8InhrMt.js → connector-service-page-BVMEg8n-.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-DEJU8mgn.js → connectors-api-B07yoCzk.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-hPKaJUWY.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-kqic8j73.js → date-picker-BvEnSGZK.js} +1 -1
- package/dist/gateway/static/root/assets/dependency-picker-XjPB8FJS.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-DFNehTtd.js → desktop-pet-C1z9YDEg.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BDS7_tQ_.js → desktop-pet-settings-CbbVb8GY.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-CeZZLOc6.js → dev-view-store-38EmUIEC.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-Wb1EKiXA.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-Di0h3ws4.js → directory-picker-path-field-BvKDrKc4.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-ClKEyXmN.js → discussion-annotation-sync-BfVzIwe2.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-DwB5KMGk.js → extension-debug-page-CB9Lu3Sq.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-Cqg1K70e.js → extension-iframe-host-BzjrVAUR.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-DRBszrCR.js → extension-marketplace-api-DigziAgd.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DyrQtG82.js → extension-page-DUa9MeaZ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-C_uKqJxP.js → extension-provider-301x0rh-.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BAMQHzkX.js → extension-settings-page-CP9ciZUI.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-DfkXvFnc.js → file-preview-surface-BaMGmCbw.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BOCt_zOo.js → gateway-config-swr-BD4Bf8uu.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-BL_Cf0OQ.js → gateway-realtime-CSd9VB7Z.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-Bxkv62qs.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-CHf8qY7H.js → gateway-restart-CIUCTKYR.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-uAboiElC.js → gateway-settings-CCqF1uZv.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CvkJYurV.js → gateway-startup-retry-BsU5k8oi.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-BWMbKu72.js → global-defaults-api-asOZQeM8.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-Bb_RC1O9.js +2 -0
- package/dist/gateway/static/root/assets/{image-generation-api-CQxZSTWA.js → image-generation-api-BbEnKsK1.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-C90644id.js → imports-page-CVnoGUyp.js} +1 -1
- package/dist/gateway/static/root/assets/index-ClPeYgQk.js +11 -0
- package/dist/gateway/static/root/assets/index-Cz-VjTNd.css +1 -0
- package/dist/gateway/static/root/assets/install-connector-dialog-DXVOHMhS.js +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CbeubKe1.js → keyboard-shortcuts-settings-BCl90SrD.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-CcJc9xLJ.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-C6zFgwkr.js → local-apps-page-CdAKoWfg.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-BJ1B1dQ7.js → local-session-drafts-nRGeybku.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-Br7IfbXK.js → locale-store-B7y-RVe8.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-CpVCvAWE.js → logs-page-McbSQwJI.js} +2 -2
- package/dist/gateway/static/root/assets/management-settings-BIR0BwNV.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-DrVAMlwc.js → markdown-view-DFHa8rUg.js} +2 -2
- package/dist/gateway/static/root/assets/mcp-conversation-setup-page-Dwx4TuIr.js +1 -0
- package/dist/gateway/static/root/assets/{media-plugins-Ba6vUE4J.js → media-plugins-BzzLV7wW.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DYDkJvXj.js +3 -0
- package/dist/gateway/static/root/assets/model-selector-DJSVr3LM.js +1 -0
- package/dist/gateway/static/root/assets/{models-hub-cache-Bd-fYUrV.js → models-hub-cache-BUapaPTN.js} +1 -1
- package/dist/gateway/static/root/assets/new-chat-navigation-B6NPQ4h4.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-CJ-dPovd.js +5 -0
- package/dist/gateway/static/root/assets/note-image-lightbox-ClPkeHe5.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-CUlhTRv0.js → notes-api-ulup1oFS.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-eoKX85K5.js → notes-page-BaFNplIr.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-DMMdeaNd.js → oauth-api-DINa08-z.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-C8BXow79.js → oauth-provider-connect-C0PVEHC2.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-CBFK41OS.js → page-context-capture-button-CGfR0dsc.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-LF33STHC.js → page-context-draft-DhRNxc0v.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-CoKMiYoi.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-D6CzIIfo.js → personal-avatar-DiVFO2Aw.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-CiKdXLeR.js +1 -0
- package/dist/gateway/static/root/assets/{personal-settings-panel-DnYapLo7.js → personal-settings-panel-Ds4ntiqu.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-DBiKtzwz.js → phone-dependencies-card-B3R6L5Qu.js} +1 -1
- package/dist/gateway/static/root/assets/phone-model-connection-ucX3Tvl8.js +1 -0
- package/dist/gateway/static/root/assets/{phone-model-picker-BmSxEr7M.js → phone-model-picker-CU37sziM.js} +1 -1
- package/dist/gateway/static/root/assets/phone-settings-page-BSdB2pnW.js +1 -0
- package/dist/gateway/static/root/assets/{phone-workspace-store-SN7hfddU.js → phone-workspace-store-Cmes9gQ4.js} +1 -1
- package/dist/gateway/static/root/assets/plugin-details-dialog-DblFhnuC.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-Cu_ZC9Up.js → preference-select-fields-D2-QfMN5.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-Tn2dUJWM.js → product-automation-feedback-BzY3z8zu.js} +2 -2
- package/dist/gateway/static/root/assets/{product-open-page-Nf-Oqf1h.js → product-open-page-BKw6H0Mn.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-D6NwUm3A.js → product-preview-content-CNaJb6Bj.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-BfNcGgXA.js → product-preview-modal-DgwrrpqJ.js} +2 -2
- package/dist/gateway/static/root/assets/project-detail-page-FReFYUv0.js +7 -0
- package/dist/gateway/static/root/assets/{project-understanding-B1BK7Ixi.js → project-understanding-CrSkrJnM.js} +1 -1
- package/dist/gateway/static/root/assets/projects-page-Cp91_KzA.js +1 -0
- package/dist/gateway/static/root/assets/{providers-api-DOnNfkwQ.js → providers-api-CBSC3jdu.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-RAhaLUcQ.js → recording-upload-DBHAGKZj.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-DFDvOTg4.js → registry-api-QZEjziDq.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-DWsOWetc.js → remote-access-hub-BdXxFQfH.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-TQcRCpAg.js → resource-unavailable-BTNhcOHF.js} +1 -1
- package/dist/gateway/static/root/assets/route-preload-DS4fVFbc.js +2 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-9o3Wfji1.js → runtime-tools-api-BDTUD8Rj.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BGiXeHF5.js → runtime-tools-settings-panel-CYEzIrDf.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-BEnNx0u7.js → service-recommendation-list-CfeYH6lK.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-Bs3r_d2_.js → session-api-DVXLCZX2.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-DjRWxXJG.js +23 -0
- package/dist/gateway/static/root/assets/sessions-page-C8gwrFHR.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BMHe9uwy.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-CURRjsLK.js → settings-advanced-section-BmrbHgQa.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-CiRpsdTJ.js → settings-mode-store-Bk_hzwPK.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-GtsbT6as.js → settings-page-DCQnHCNN.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-DBL0_u0Z.js → settings-page-header-BLKI3_9N.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-IAvpbz4A.js → settings-page-layout-BqBVrkC9.js} +1 -1
- package/dist/gateway/static/root/assets/setup-interaction-page-B9ACeAvO.js +1 -0
- package/dist/gateway/static/root/assets/setup-status-panel-DEefuWo3.js +1 -0
- package/dist/gateway/static/root/assets/share-link-dialog-C2LyeNzj.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-L9KYu8M7.js → share-preview-page-BFwEr7Ws.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-D8Q-m46d.js → shares-api-CTFkLQxq.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-CpK3yhtc.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-uKU4sRiv.js → skill-api-DpicfA6o.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-BzKzG-xG.js → skill-list-api-B8fegRLZ.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-DkUXekcd.js → skill-reload-api-VmC8ySUy.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page-BIWXS6Ki.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-CsvcFoaJ.js → system-settings-panel-BmoA92oX.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-L5RIelv0.js +3 -0
- package/dist/gateway/static/root/assets/{task-result-evidence-B8xUiwW3.js → task-result-evidence-BV-6hBVU.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-DJVC7HqA.js → terminal-panel-store-BGdKE9hU.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-Dlnmgryi.js → theme-store-Dvv79Wb2.js} +1 -1
- package/dist/gateway/static/root/assets/tracing-settings-page-B4uA4Pnz.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-BB7u79ID.js → tunnel-api-BurZtvqx.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-C4bblRnQ.js → understanding-activity-store-C1cLL8zq.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-BvCj9-Ue.js → understanding-refresh-store-C3Lr_pjY.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-Cv4Je5XJ.js → usage-page-C91ZzLm9.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-YHxQ-UZg.js → use-autosave-zkzRuUtx.js} +1 -1
- package/dist/gateway/static/root/assets/use-composer-attachments-CoiQAgjo.js +2 -0
- package/dist/gateway/static/root/assets/use-file-preview-expanded-DFzy6iVy.js +2 -0
- package/dist/gateway/static/root/assets/{use-personal-profile-D2Un8G1L.js → use-personal-profile-BB10h9ED.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-BQEiJzK7.js → use-workspace-tree-sF5DcONt.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-WFnD5utO.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-DCM69u8Y.js → voice-api-key-field-Bqa4PeZx.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-CrULrSKC.js → voice-config-api-LNO2xXHk.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-DFMNIyy4.js → voice-input-shortcut-events-AzfhxBX7.js} +1 -1
- package/dist/gateway/static/root/assets/voice-transcribe-api-Cb8i6dLb.js +1 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-CVe9UmFl.js → work-discovery-overlay-CdQUiV-a.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-CtqkRMN5.js → work-discovery-page-HcUloXxf.js} +1 -1
- package/dist/gateway/static/root/assets/working-directory-picker-modal-Dv1HUipe.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-api-tbifz2zY.js → workspace-api-Am2ee4R6.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-CqHcVFhS.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-BubQwQwU.js → workspace-file-preview-dialog-z5Q00v92.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-DZk3MBSa.js → workspace-open-location-menu-4ONYaGy0.js} +1 -1
- package/dist/gateway/static/root/assets/xopc-cloud-account-card-DimGN59n.js +1 -0
- package/dist/gateway/static/root/index.html +99 -97
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/automations.js +8 -0
- package/dist/packages/gateway-contract/src/capabilities.js +7 -3
- package/dist/packages/gateway-contract/src/home.js +12 -2
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +1 -0
- package/dist/src/agent/background-review/prompts.js +11 -6
- package/dist/src/agent/background-review/run-background-review.js +12 -3
- package/dist/src/agent/child-agent-factory.js +1 -1
- package/dist/src/agent/context/execution-context.js +3 -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 +25 -2
- package/dist/src/agent/embedded/session-runner.js +10 -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 +5 -2
- package/dist/src/agent/mcp/connection-drafts.js +6 -4
- package/dist/src/agent/mcp/connection-setup.d.ts +15 -1
- package/dist/src/agent/mcp/connection-setup.js +223 -78
- package/dist/src/agent/mcp/continuation-guard.d.ts +3 -0
- package/dist/src/agent/mcp/continuation-guard.js +54 -0
- package/dist/src/agent/mcp/continuation-input.d.ts +4 -0
- package/dist/src/agent/mcp/continuation-input.js +13 -0
- package/dist/src/agent/mcp/conversation-setup.d.ts +282 -0
- package/dist/src/agent/mcp/conversation-setup.js +856 -0
- package/dist/src/agent/mcp/discovery.d.ts +102 -0
- package/dist/src/agent/mcp/discovery.js +219 -0
- package/dist/src/agent/mcp/native-mcp.d.ts +1 -0
- package/dist/src/agent/mcp/native-mcp.js +8 -1
- package/dist/src/agent/mcp/setup-plan.d.ts +76 -0
- package/dist/src/agent/mcp/setup-plan.js +93 -0
- package/dist/src/agent/mcp/tool-catalog.d.ts +7 -0
- package/dist/src/agent/mcp/tool-catalog.js +26 -3
- package/dist/src/agent/mcp/transport.d.ts +20 -0
- package/dist/src/agent/mcp/transport.js +188 -0
- 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/orchestration/delegation-scope.d.ts +2 -1
- 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 +3 -2
- package/dist/src/agent/service/process-direct-streaming.js +4 -3
- package/dist/src/agent/service.d.ts +2 -0
- package/dist/src/agent/service.js +15 -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 +125 -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 +35 -24
- 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 +36 -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 +5 -2
- package/dist/src/agent/tools/xopc-use-tool.js +81 -10
- package/dist/src/agent-catalog/service.d.ts +1 -1
- package/dist/src/agent-catalog/service.js +2 -1
- package/dist/src/automations/api/routes.js +13 -5
- package/dist/src/automations/capabilities/drafts.js +5 -2
- package/dist/src/automations/capabilities/read.js +49 -10
- 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 +10 -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 +12 -0
- package/dist/src/automations/service/automation-service.js +61 -4
- package/dist/src/automations/service/index.js +2 -2
- package/dist/src/automations/storage/automation-run-repository.d.ts +11 -2
- package/dist/src/automations/storage/automation-run-repository.js +28 -24
- package/dist/src/automations/storage/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/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/schema.d.ts +3 -0
- package/dist/src/config/schema.js +3 -2
- package/dist/src/extensions/agent-plugins/credentials.js +1 -1
- package/dist/src/extensions/agent-plugins/setup.d.ts +2 -1
- package/dist/src/extensions/agent-plugins/setup.js +4 -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/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 +33 -9
- 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 -5
- 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 +2 -2
- 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 +97 -22
- 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/home-intelligence/evidence-presentation.d.ts +3 -0
- package/dist/src/home-intelligence/evidence-presentation.js +30 -0
- package/dist/src/home-intelligence/generator.d.ts +8 -0
- package/dist/src/home-intelligence/generator.js +15 -4
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/home-intelligence/policy.js +3 -0
- package/dist/src/memory-learning/repository.d.ts +6 -1
- package/dist/src/memory-learning/repository.js +10 -5
- package/dist/src/memory-learning/service.js +23 -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/setup/service.d.ts +14 -4
- package/dist/src/phone/setup/service.js +106 -28
- package/dist/src/process/mcp-stdio-supervisor.d.ts +1 -0
- package/dist/src/process/mcp-stdio-supervisor.js +14 -0
- package/dist/src/projects/index.js +1 -1
- package/dist/src/projects/project-service.js +1 -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-criterion-review-repository.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/user-context/extraction/registry.js +2 -2
- package/dist/src/user-model/capture/executor.d.ts +1 -0
- package/dist/src/user-model/capture/executor.js +6 -6
- package/dist/src/user-model/capture/semantic.d.ts +3 -0
- package/dist/src/user-model/capture/semantic.js +14 -4
- 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-Dne9A10p.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-BoHL-b1o.js +0 -1
- package/dist/gateway/static/root/assets/agents-CIiIlVBp.js +0 -77
- package/dist/gateway/static/root/assets/app-link-1j40sJ-z.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-vgS1CHDj.js +0 -1
- package/dist/gateway/static/root/assets/attachment-load-qjPpQzYY.js +0 -1
- package/dist/gateway/static/root/assets/automation-api-hRsGx-qe.js +0 -1
- package/dist/gateway/static/root/assets/automation-task-card-MnzgyTVA.js +0 -3
- package/dist/gateway/static/root/assets/automations-workspace-C3xZLafX.js +0 -9
- package/dist/gateway/static/root/assets/browser-settings-page-BD1uF_Nb.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-BGE6hiUE.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-page-Bda4mSdf.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-B2B7no22.js +0 -8
- package/dist/gateway/static/root/assets/channels-NtsjZThx.js +0 -1
- package/dist/gateway/static/root/assets/chat-page-BnOCCAXG.js +0 -72
- package/dist/gateway/static/root/assets/composer-payload-handoff-CQc-VTaL.js +0 -1
- package/dist/gateway/static/root/assets/confirm-dialog-XGclfBqe.js +0 -1
- package/dist/gateway/static/root/assets/connected-providers-grid-CcXe9kz5.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Ci0L2How.js +0 -1
- package/dist/gateway/static/root/assets/dependency-picker-cbC6-2Ya.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-_3BJFWVQ.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-BHBOPF_q.js +0 -1
- package/dist/gateway/static/root/assets/home-page-D6pCBY1V.js +0 -2
- package/dist/gateway/static/root/assets/index-Cc41XQid.css +0 -1
- package/dist/gateway/static/root/assets/index-CnOYR6jq.js +0 -11
- package/dist/gateway/static/root/assets/install-connector-dialog-BuNXON0P.js +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CP-BkbB6.js +0 -1
- package/dist/gateway/static/root/assets/management-settings-I-pXv4ML.js +0 -1
- package/dist/gateway/static/root/assets/messages-ByFlEbsu.js +0 -3
- package/dist/gateway/static/root/assets/model-selector-CXcxc30J.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-CbpLXAVh.js +0 -5
- package/dist/gateway/static/root/assets/note-image-lightbox-cLGiF8oU.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-Du44NIEJ.js +0 -1
- package/dist/gateway/static/root/assets/personal-page-CXR1Gy0x.js +0 -1
- package/dist/gateway/static/root/assets/phone-settings-page-vg65qilc.js +0 -1
- package/dist/gateway/static/root/assets/plugin-details-dialog-B3Hn2cbx.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-Ch-ZMyTu.js +0 -7
- package/dist/gateway/static/root/assets/projects-page-B7cetxao.js +0 -1
- package/dist/gateway/static/root/assets/route-preload-Zc5Z3fNv.js +0 -2
- package/dist/gateway/static/root/assets/send-1f1Ntw6E.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-ChUtTAoG.js +0 -23
- package/dist/gateway/static/root/assets/sessions-page-Bt52kBvJ.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BI4DMz4_.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-A6uMpGRy.js +0 -1
- package/dist/gateway/static/root/assets/share-link-dialog-D1otGSXD.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-Bmfadz8A.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-BZklXTX9.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-SjZGW1Dx.js +0 -2
- package/dist/gateway/static/root/assets/tracing-settings-page-MvG4SH64.js +0 -1
- package/dist/gateway/static/root/assets/use-composer-attachments-vDdxHtUb.js +0 -2
- package/dist/gateway/static/root/assets/use-file-preview-expanded-Ce2mgYme.js +0 -2
- package/dist/gateway/static/root/assets/user-model-page-DRSsn4EV.js +0 -2
- package/dist/gateway/static/root/assets/voice-transcribe-api-Bbyj0yGR.js +0 -1
- package/dist/gateway/static/root/assets/working-directory-picker-modal-CDZ1xh3o.js +0 -1
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-4cZ26iaD.js +0 -1
- package/dist/gateway/static/root/assets/xopc-cloud-account-card-CIavPUr3.js +0 -1
|
@@ -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,16 +34,21 @@ 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?: {
|
|
42
47
|
projectId?: string;
|
|
43
48
|
}): Promise<Automation[]>;
|
|
49
|
+
executionSummaries(projectId?: string): Record<string, {
|
|
50
|
+
unreadCount: number;
|
|
51
|
+
}>;
|
|
44
52
|
get(id: string): Promise<Automation | null>;
|
|
45
53
|
update(id: string, patch: UpdateAutomationInput): Promise<Automation | null>;
|
|
46
54
|
/** SQLite-only mutation; callers must refresh scheduling after their outer transaction commits. */
|
|
@@ -87,6 +95,10 @@ export declare class AutomationService {
|
|
|
87
95
|
automationId?: string;
|
|
88
96
|
projectId?: string;
|
|
89
97
|
limit?: number;
|
|
98
|
+
before?: {
|
|
99
|
+
createdAtMs: number;
|
|
100
|
+
id: string;
|
|
101
|
+
};
|
|
90
102
|
}): Promise<AutomationRun[]>;
|
|
91
103
|
listRunsForProductEvent(options: {
|
|
92
104
|
eventType: string;
|
|
@@ -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
|
-
import { appendAutomationRunEvent, getAutomationRun, getAutomationRunRequest, listAutomationRunEvents, listAutomationRuns, listAutomationRunsForProductEvent, listUnfinishedAutomationRuns, markAllAutomationRunsRead, markAutomationRunRead, pruneAutomationHistory, saveAutomationRun, saveAutomationRunRequest, touchAutomationRunLease } from "../storage/automation-run-repository.js";
|
|
10
|
+
import { appendAutomationRunEvent, getAutomationExecutionSummaries, getAutomationRun, getAutomationRunRequest, isAutomationConversationShared, 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;
|
|
@@ -162,6 +210,9 @@ var AutomationService = class {
|
|
|
162
210
|
async list(options) {
|
|
163
211
|
return listAutomations(options);
|
|
164
212
|
}
|
|
213
|
+
executionSummaries(projectId) {
|
|
214
|
+
return getAutomationExecutionSummaries(projectId);
|
|
215
|
+
}
|
|
165
216
|
async get(id) {
|
|
166
217
|
return getAutomation(id);
|
|
167
218
|
}
|
|
@@ -193,9 +244,11 @@ var AutomationService = class {
|
|
|
193
244
|
...parsed.state ?? {}
|
|
194
245
|
}
|
|
195
246
|
});
|
|
247
|
+
if (current.action.kind === "agent" && current.action.mcpSourceId && next.action.kind === "agent" && !next.action.mcpSourceId) next.action.mcpSourceId = current.action.mcpSourceId;
|
|
196
248
|
if (parsed.action) this.assertExecutionAgent(next);
|
|
197
249
|
if (parsed.trigger || parsed.enabled === true && next.trigger.kind === "schedule" && next.trigger.schedule.kind === "once") this.prepareSchedule(next, now);
|
|
198
250
|
this.pinBrowserVersion(next);
|
|
251
|
+
this.assertMcpSource(next);
|
|
199
252
|
if ("enabled" in parsed || "trigger" in parsed) next.state.nextRunAtMs = computeNextAutomationRunAtMs(next, now);
|
|
200
253
|
saveAutomation(next);
|
|
201
254
|
return next;
|
|
@@ -377,7 +430,11 @@ var AutomationService = class {
|
|
|
377
430
|
return listAutomationRunsForProductEvent(options);
|
|
378
431
|
}
|
|
379
432
|
async getRun(runId) {
|
|
380
|
-
|
|
433
|
+
const run = getAutomationRun(runId);
|
|
434
|
+
return run ? {
|
|
435
|
+
...run,
|
|
436
|
+
conversationShared: Boolean(run.conversationId && isAutomationConversationShared(run.automationId, run.conversationId, runId))
|
|
437
|
+
} : null;
|
|
381
438
|
}
|
|
382
439
|
async listRunEvents(runId) {
|
|
383
440
|
return listAutomationRunEvents(runId);
|
|
@@ -844,4 +901,4 @@ function readAutomationEventFromRunEvent(event) {
|
|
|
844
901
|
};
|
|
845
902
|
}
|
|
846
903
|
//#endregion
|
|
847
|
-
export { AutomationAlreadyExistsError, AutomationAlreadyRunningError, AutomationInvalidAgentError, AutomationInvalidScheduleError, AutomationService };
|
|
904
|
+
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 };
|
|
@@ -7,11 +7,20 @@ export declare function saveAutomationRun(run: AutomationRun): void;
|
|
|
7
7
|
export declare function touchAutomationRunLease(runId: string, leaseOwner: string, heartbeatAtMs: number, leaseExpiresAtMs: number): void;
|
|
8
8
|
export declare function listAutomationRunEvents(runId: string): AutomationRunEvent[];
|
|
9
9
|
export declare function getAutomationRun(runId: string): AutomationRun | null;
|
|
10
|
-
export
|
|
10
|
+
export interface AutomationRunListOptions {
|
|
11
11
|
automationId?: string;
|
|
12
12
|
projectId?: string;
|
|
13
13
|
limit?: number;
|
|
14
|
-
|
|
14
|
+
before?: {
|
|
15
|
+
createdAtMs: number;
|
|
16
|
+
id: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare function listAutomationRuns(options?: AutomationRunListOptions): AutomationRun[];
|
|
20
|
+
export declare function isAutomationConversationShared(automationId: string, conversationId: string, runId: string): boolean;
|
|
21
|
+
export declare function getAutomationExecutionSummaries(projectId?: string): Record<string, {
|
|
22
|
+
unreadCount: number;
|
|
23
|
+
}>;
|
|
15
24
|
export declare function listAutomationRunsForProductEvent(options: {
|
|
16
25
|
eventType: string;
|
|
17
26
|
source?: string;
|
|
@@ -117,29 +117,33 @@ function getAutomationRun(runId) {
|
|
|
117
117
|
}
|
|
118
118
|
function listAutomationRuns(options) {
|
|
119
119
|
const limit = Math.min(Math.max(options?.limit ?? 50, 1), 500);
|
|
120
|
-
const
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
120
|
+
const clauses = [];
|
|
121
|
+
const params = [];
|
|
122
|
+
if (options?.automationId) {
|
|
123
|
+
clauses.push("automation_id = ?");
|
|
124
|
+
params.push(options.automationId);
|
|
125
|
+
}
|
|
126
|
+
if (options?.projectId) {
|
|
127
|
+
clauses.push("EXISTS (SELECT 1 FROM automations a WHERE a.automation_id = automation_runs.automation_id AND a.project_id = ?)");
|
|
128
|
+
params.push(options.projectId);
|
|
129
|
+
}
|
|
130
|
+
if (options?.before) {
|
|
131
|
+
clauses.push("(created_at_ms < ? OR (created_at_ms = ? AND run_id < ?))");
|
|
132
|
+
params.push(options.before.createdAtMs, options.before.createdAtMs, options.before.id);
|
|
133
|
+
}
|
|
134
|
+
return getSqliteDatabase().prepare(`SELECT * FROM automation_runs
|
|
135
|
+
${clauses.length ? `WHERE ${clauses.join(" AND ")}` : ""}
|
|
136
|
+
ORDER BY created_at_ms DESC, run_id DESC LIMIT ?`).all(...params, limit).map(rowToRun);
|
|
137
|
+
}
|
|
138
|
+
function isAutomationConversationShared(automationId, conversationId, runId) {
|
|
139
|
+
return Boolean(getSqliteDatabase().prepare("SELECT 1 FROM automation_runs WHERE automation_id = ? AND conversation_id = ? AND run_id != ? LIMIT 1").get(automationId, conversationId, runId));
|
|
140
|
+
}
|
|
141
|
+
function getAutomationExecutionSummaries(projectId) {
|
|
142
|
+
const rows = getSqliteDatabase().prepare(`SELECT r.automation_id,
|
|
143
|
+
SUM(CASE WHEN r.ended_at_ms IS NOT NULL AND r.read_at_ms IS NULL THEN 1 ELSE 0 END) AS unread_count
|
|
144
|
+
FROM automation_runs r JOIN automations a ON a.automation_id = r.automation_id
|
|
145
|
+
${projectId ? "WHERE a.project_id = ?" : ""} GROUP BY r.automation_id`).all(...projectId ? [projectId] : []);
|
|
146
|
+
return Object.fromEntries(rows.map((row) => [row.automation_id, { unreadCount: row.unread_count }]));
|
|
143
147
|
}
|
|
144
148
|
function listAutomationRunsForProductEvent(options) {
|
|
145
149
|
const limit = Math.min(Math.max(options.limit ?? 10, 1), 100);
|
|
@@ -220,4 +224,4 @@ function markAllAutomationRunsRead(options) {
|
|
|
220
224
|
return Number(result.changes);
|
|
221
225
|
}
|
|
222
226
|
//#endregion
|
|
223
|
-
export { appendAutomationRunEvent, deleteAutomationRunsForAutomation, getAutomationRun, getAutomationRunRequest, listAutomationRunEvents, listAutomationRuns, listAutomationRunsForProductEvent, listUnfinishedAutomationRuns, markAllAutomationRunsRead, markAutomationRunRead, pruneAutomationHistory, saveAutomationRun, saveAutomationRunRequest, touchAutomationRunLease };
|
|
227
|
+
export { appendAutomationRunEvent, deleteAutomationRunsForAutomation, getAutomationExecutionSummaries, getAutomationRun, getAutomationRunRequest, isAutomationConversationShared, listAutomationRunEvents, listAutomationRuns, listAutomationRunsForProductEvent, listUnfinishedAutomationRuns, markAllAutomationRunsRead, markAutomationRunRead, pruneAutomationHistory, saveAutomationRun, saveAutomationRunRequest, touchAutomationRunLease };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { deleteAutomation, getAutomation, getDeletedAutomationRevision, listAutomations, saveAutomation, saveAutomations } from "./automation-repository.js";
|
|
2
|
-
import { appendAutomationRunEvent, deleteAutomationRunsForAutomation, getAutomationRun, getAutomationRunRequest, listAutomationRunEvents, listAutomationRuns, listAutomationRunsForProductEvent, listUnfinishedAutomationRuns, markAllAutomationRunsRead, markAutomationRunRead, pruneAutomationHistory, saveAutomationRun, saveAutomationRunRequest, touchAutomationRunLease } from "./automation-run-repository.js";
|
|
3
|
-
export { appendAutomationRunEvent, deleteAutomation, deleteAutomationRunsForAutomation, getAutomation, getAutomationRun, getAutomationRunRequest, getDeletedAutomationRevision, listAutomationRunEvents, listAutomationRuns, listAutomationRunsForProductEvent, listAutomations, listUnfinishedAutomationRuns, markAllAutomationRunsRead, markAutomationRunRead, pruneAutomationHistory, saveAutomation, saveAutomationRun, saveAutomationRunRequest, saveAutomations, touchAutomationRunLease };
|
|
2
|
+
import { appendAutomationRunEvent, deleteAutomationRunsForAutomation, getAutomationExecutionSummaries, getAutomationRun, getAutomationRunRequest, isAutomationConversationShared, listAutomationRunEvents, listAutomationRuns, listAutomationRunsForProductEvent, listUnfinishedAutomationRuns, markAllAutomationRunsRead, markAutomationRunRead, pruneAutomationHistory, saveAutomationRun, saveAutomationRunRequest, touchAutomationRunLease } from "./automation-run-repository.js";
|
|
3
|
+
export { appendAutomationRunEvent, deleteAutomation, deleteAutomationRunsForAutomation, getAutomation, getAutomationExecutionSummaries, getAutomationRun, getAutomationRunRequest, getDeletedAutomationRevision, isAutomationConversationShared, listAutomationRunEvents, listAutomationRuns, listAutomationRunsForProductEvent, listAutomations, listUnfinishedAutomationRuns, markAllAutomationRunsRead, markAutomationRunRead, pruneAutomationHistory, saveAutomation, saveAutomationRun, saveAutomationRunRequest, saveAutomations, touchAutomationRunLease };
|
|
@@ -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;
|