@xopcai/xopc 0.0.486 → 0.0.488
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/README.md +9 -3
- package/README.zh-CN.md +9 -3
- package/dist/browser-ext/_locales/en/messages.json +1 -1
- package/dist/browser-ext/_locales/zh_CN/messages.json +1 -1
- package/dist/browser-ext/dist/assets/{auth-8EjgHa-n.js → page-context-DCkQH5LX.js} +237 -172
- package/dist/browser-ext/dist/background.js +650 -108
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +22 -4
- package/dist/browser-ext/manifest.json +2 -1
- package/dist/extensions/telegram/src/update-offset-store.js +2 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/messaging/quote-cache.js +3 -1
- package/dist/extensions/weixin/src/storage/sync-buf.js +2 -1
- package/dist/gateway/server/chunks.bin +1733 -1553
- package/dist/gateway/server/chunks.json +1 -1
- package/dist/gateway/server/dependency-records.json +42 -0
- package/dist/gateway/static/root/assets/{activity-store-hSe5Nbgk.js → activity-store-DyHjQrpP.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BY2wRiwY.js → agent-avatar-dicebear-gADhOk89.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-D_UDgOr9.js → agent-avatar-display-Dyyk4GdM.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-BrcyLG9M.js → agent-defaults-settings-panel-DD5mU7h6.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-CSJC1yud.js → agent-plugin-dialog-RZpnW9HG.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-DX-t3X7K.js → agents-Ckt9wMj7.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-DSr-PWuW.js → agents-admin-api-BW3Mzst8.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CGrHK9ij.js → api-Cd5TqEwc.js} +1 -1
- package/dist/gateway/static/root/assets/{api-B3T06TLl.js → api-DVQaJzrB.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-D6ZoYKaA.js → app-management-settings-panel-Cim6ZmGT.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BRb6kZT8.js → appearance-settings-BVMDvmUO.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-6xeWvMpF.js → apps-page-B7T55D7Y.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-CQ5UXgZk.js → archive-plugin-DVoAuR_a.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-D-gn6x5E.js → automation-api-B6YcuEsE.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-B7hq0XOL.js → automation-result-state-BycWqFXM.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-run-list-CM59-qm5.js → automation-run-list-DDDHtKq0.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-C453Q-Wa.js → automation-task-card-BBEA23Zb.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BLFBqaPX.js → automations-page-DelDZorh.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-DiO3Iyuj.js → automations-workspace-leY4yCvw.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-D_zw0TgG.js → binary-plugins-o-jwYyMd.js} +1 -1
- package/dist/gateway/static/root/assets/block-editor-BFDeQtYs.css +1 -0
- package/dist/gateway/static/root/assets/{block-editor-Cesz2DqP.js → block-editor-Bp6TLleA.js} +46 -46
- package/dist/gateway/static/root/assets/{browser-settings-page-BHElJSFt.js → browser-settings-page-CtPARtRA.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-CW-vdkz6.js → capabilities-B5gHYD8r.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-DZrjA95P.js → capabilities-G2ZaAAs2.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-DQrfkrBA.js → capabilities-page-C6KCaaHR.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-DIT2dvtc.js → capabilities-settings-panel-CVwdxuL4.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-Dcr5dgqw.js → channels-Bh2bHLni.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-CyvBfBbp.js → chat-agents-api-DRKlkcuv.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-B83s8HE9.js → chat-chart-block-DxTCx__V.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-page-DWZCzxY7.js → chat-page-XqG9aYBd.js} +31 -31
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DCUuwiTt.js → chat-terminal-dock-Ch74AWYF.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-UrqPvWR1.js → command-palette-api-CAKoTF_-.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-model-config-control-C2Bku39S.js → composer-model-config-control-Bas1wFVW.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-notifications-MGKffwC7.js → composer-notifications-CpBgWAE4.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-a0quQ25p.js → composer-payload-handoff-uT_hvvap.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-DUzQe6Bz.js → computer-settings-page-x8YUBBuX.js} +1 -1
- package/dist/gateway/static/root/assets/confirm-dialog-yhRKgG72.js +1 -0
- package/dist/gateway/static/root/assets/{connected-providers-grid-BJKEp0SE.js → connected-providers-grid-DS21-u3Q.js} +1 -1
- package/dist/gateway/static/root/assets/{connection-usage-guide-B9hoSOnN.js → connection-usage-guide-DNNFESD9.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-e67KylnM.js → connector-service-page-BS7IJ6oc.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-CRGq-TSw.js → connectors-api-B27sJ651.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-BteRI1XM.js → connectors-page-DM6TppXV.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-DwITf4I2.js → date-picker-D3N2BGVY.js} +1 -1
- package/dist/gateway/static/root/assets/{date-time-picker-ChG1CqR1.js → date-time-picker-BNw099Is.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-BHoFymL4.js → desktop-pet-BtY6aGrh.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BYeBN4jj.js → desktop-pet-settings-DVXfAMaU.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-DsjH8x76.js → dev-view-store-D4EyUkRI.js} +1 -1
- package/dist/gateway/static/root/assets/{device-connections-panel-DE01vyK_.js → device-connections-panel-DYK_DQzO.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-action-w1enAo76.js → device-pairing-action-DXo8MWy2.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-Dt737tSq.js → device-pairing-wizard-NddAztJ2.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-B-eUnbng.js → directory-picker-path-field-Bbq7ZyGn.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-authoritative-grants-DYp2nNol.js → extension-authoritative-grants-qpYvHriJ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-4jJ1uVQJ.js → extension-debug-page-BOb-6rpq.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-CJV5JETm.js → extension-iframe-host-DpgIPfJe.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-DGV5FC-v.js → extension-marketplace-api-BhGNQYHl.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-message-router-B4I-Y6qs.js → extension-message-router-QjbtEYyu.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-lc7a84nG.js → extension-page-BOp7wU9Y.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-D8_mIBI0.js → extension-provider-CFPicsnW.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-Uw2lfWRh.js → extension-settings-page-cXjBvPwg.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BD-ams0X.js → gateway-config-swr-DxelrRtx.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-D2B_nv2b.js +1 -0
- package/dist/gateway/static/root/assets/gateway-realtime-store-DrVbjYfI.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-Dos1Pp84.js → gateway-restart-Ce6rCCAr.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DUC1iOVK.js → gateway-settings-BTr0Gwdo.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DgmvR-hb.js → gateway-startup-retry-Dm0dK8BT.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-B7suATYU.js → global-defaults-api-BZnu44eA.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-mSRCU81k.js → home-page-Bxr3V5lc.js} +3 -3
- package/dist/gateway/static/root/assets/{home-task-actions-_ZAc57Y7.js → home-task-actions-GAO06s1_.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-Baz4xdZ4.js → image-generation-api-DrZPmWFt.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-DR0eLPgB.js → imports-page-D-x5kijk.js} +1 -1
- package/dist/gateway/static/root/assets/index-BjU5H5hz.js +11 -0
- package/dist/gateway/static/root/assets/index-CREeN6C_.css +1 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-CntHi8Rh.js → install-connector-dialog-st2O1bez.js} +1 -1
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-DnKkQoqR.js +1 -0
- package/dist/gateway/static/root/assets/{local-app-workbench-page-C3Lqi8E1.js → local-app-workbench-page-CKHJa4K8.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-BoCtITdL.js → local-apps-page-D28d-sO0.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-CGSV1RQg.js → local-session-drafts-KkAOxXk5.js} +2 -2
- package/dist/gateway/static/root/assets/{locale-store-CHjsq5NR.js → locale-store-Dy0B0XDJ.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-0hkRbcUR.js → logs-page-BPuHO-iA.js} +1 -1
- package/dist/gateway/static/root/assets/{management-api-FVu7eYXD.js → management-api-BtTRehT0.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-QQB1r71U.js → management-settings-B2R43Itv.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-ihzUc4ud.js → markdown-view-ByuzuGRb.js} +1 -1
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-DffQKrjd.js → mcp-conversation-setup-page-D_6XeyXG.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-C78NkHfB.js → media-plugins-B9Q7WvNF.js} +1 -1
- package/dist/gateway/static/root/assets/messages-Bj6DCoic.js +3 -0
- package/dist/gateway/static/root/assets/{model-selector-QFZY5XNN.js → model-selector-8FTrQQ2N.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-BrD6r5Qs.js → models-hub-cache-DMBOw544.js} +1 -1
- package/dist/gateway/static/root/assets/{new-session-preferences-gb411vZP.js → new-session-preferences-CxCn2Jxk.js} +1 -1
- package/dist/gateway/static/root/assets/note-detail-panel-BTNX68oO.js +7 -0
- package/dist/gateway/static/root/assets/note-image-lightbox-D20oZuOM.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-D5SvfybU.js → notes-api-M1FuRZbW.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-RPfvHnl6.js → notes-page-FocipOyc.js} +2 -2
- package/dist/gateway/static/root/assets/{oauth-api-DnMpUoyx.js → oauth-api-Dza1tHcr.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-DGYky6ut.js → oauth-provider-connect-BPNIEiMv.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-CVHz9b6c.js → page-context-capture-button-DpGnxSrD.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-Bk7jVvAG.js → page-context-draft-CHAS3BY3.js} +1 -1
- package/dist/gateway/static/root/assets/{page-header-store-NP7MCIaP.js → page-header-store-BXED3zhV.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-avatar-1TVnHakL.js → personal-avatar-BCk4KoeZ.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-Dt1d3tQT.js → personal-page-CSc2n5UD.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-profile-settings-XiT1MgTK.js → personal-profile-settings-C86FBPOH.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-bcw04REt.js → personal-settings-panel-BlPLE0Ip.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-B4QsgIEF.js → phone-dependencies-card-BCob98OY.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-Dk5kE1Ll.js → phone-model-connection-D-CcYcch.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-CFoxQiws.js → phone-model-picker-eMe7fmZu.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-Bv1xm8sh.js → phone-settings-page-D7yXeGmR.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-DGaibcsi.js → phone-workspace-store-CcA_vo-t.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-FcOJaeP0.js → plugin-details-dialog-BAmodjSZ.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-B-yK91If.js → preference-select-fields-BBd5CWkM.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-runtime-FtWOW5i4.js → preview-runtime-DUJ7XhMP.js} +3 -3
- package/dist/gateway/static/root/assets/product-automation-feedback-BDFpFrSs.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-C09VEZjY.js → product-open-page-t3hsoYql.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-B3mzl6-f.js → product-preview-content-BM0pjf0F.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-5kTp_7Qk.js → product-preview-modal-CLQcCVjI.js} +2 -2
- package/dist/gateway/static/root/assets/project-detail-page-CK_EN6Jq.js +7 -0
- package/dist/gateway/static/root/assets/{project-understanding-4IyHVmus.js → project-understanding-CwtdVbMP.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-C-9x23LR.js → projects-page-ESAmJ4I_.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-D9NuB7w3.js → providers-api-CR7FJzt-.js} +1 -1
- package/dist/gateway/static/root/assets/recording-upload-DrgujKBt.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-CDpUAb2R.js → registry-api-CaBz9f4g.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-DVTs8pwO.js → remote-access-hub-CB-Js5gd.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-CZlqZYk-.js → resource-unavailable-DiPPmZsR.js} +1 -1
- package/dist/gateway/static/root/assets/right-workspace-store-CcRApllu.js +1 -0
- package/dist/gateway/static/root/assets/{route-preload-CzorjVc9.js → route-preload-Ab7Zw-df.js} +2 -2
- package/dist/gateway/static/root/assets/{routine-panel-n4IstC8Y.js → routine-panel-DzdJGicv.js} +2 -2
- package/dist/gateway/static/root/assets/{runtime-tools-api-BhS0RWf2.js → runtime-tools-api-utBemmh4.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-jTbGPGeA.js → runtime-tools-settings-panel-ChXrIluB.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-wfd0Mjtu.js → service-recommendation-list-Dm5GcMRy.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-CR3NLqvs.js → session-api-vEn4BzjV.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-C2MCS4C5.js → session-manager-7nbjJYyy.js} +2 -2
- package/dist/gateway/static/root/assets/{sessions-page-9ibCNP9o.js → sessions-page-B__ftjgG.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DV-_ZdXD.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-CTLdGPvx.js → settings-advanced-section-DhKzGl03.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-CCQVvItG.js → settings-mode-store-CQofc337.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DsM_f07M.js → settings-page-CzW5GM5r.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-C21Iw2rD.js → settings-page-header-CiS6x6sn.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-BXcLlp6p.js → settings-page-layout-B-rj_rso.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-W2F5ZaR_.js → setup-interaction-page-DTgwtj55.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-BFNwZuhp.js → setup-status-panel-BhKPMIds.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-2JjvWs0q.js → share-link-dialog-WR7Op1vL.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-C32Mq-BY.js → share-preview-page-DonmTI11.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-BhWvN3LS.js → shares-api-CoRLwDnw.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-BDGbs8wz.js → shares-settings-UA91fiMV.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-BG9A1WF0.js → skill-api-BE-iPtTQ.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-B26hHnXq.js → skill-list-api-Dsfjdtuu.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-B9Eu5Yk_.js → skill-reload-api-BIZJWow-.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-kL8E5zgi.js → skills-page-1wvItQag.js} +1 -1
- package/dist/gateway/static/root/assets/{space-api-_uKFiASp.js → space-api-E8VbAaEl.js} +1 -1
- package/dist/gateway/static/root/assets/space-page-BCzDsNJd.js +2 -0
- package/dist/gateway/static/root/assets/{space-workbook-BAwHwK6O.js → space-workbook-CwltZeHG.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-0e2zfQLt.js → system-settings-panel-03a25GEc.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-DdCpNW8K.js → task-detail-page-B_YXsT9W.js} +1 -1
- package/dist/gateway/static/root/assets/{task-header-title-CLt_lmjb.js → task-header-title-bZVPIbyR.js} +1 -1
- package/dist/gateway/static/root/assets/{task-result-presentation-CgvcqEMD.js → task-result-presentation-_VWkiekf.js} +1 -1
- package/dist/gateway/static/root/assets/{task-run-issue-notice-8FX876PP.js → task-run-issue-notice-BXOES2t9.js} +1 -1
- package/dist/gateway/static/root/assets/{tasks-CvOAtEHv.js → tasks-D8bnpu0N.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-Cy90Ix5U.js → terminal-panel-store-BOHv5O2x.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-CvG266p8.js → theme-store-XNsFzxSj.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-Cx_fOH70.js → tracing-settings-page-Y9z2HoGj.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-Cph-ZBBy.js → tunnel-api-XHGjcUi9.js} +1 -1
- package/dist/gateway/static/root/assets/turn-outcome-Bf3N3Bmj.js +1 -0
- package/dist/gateway/static/root/assets/{understanding-activity-store-CN4JzOIO.js → understanding-activity-store-BDBAkksk.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-BuZZ1_VH.js → understanding-refresh-store-D7gBfD26.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-Du42x0ej.js → usage-page-DxESTMwa.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-B_WH_LBE.js → use-autosave-D7zZrcsj.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-BEuyorVm.js → use-composer-attachments-DWiIdMIi.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-Cehu0745.js → use-file-preview-expanded-CA9vFUTT.js} +1 -1
- package/dist/gateway/static/root/assets/{use-generated-media-CzRbgtcv.js → use-generated-media-DX4_ne7C.js} +1 -1
- package/dist/gateway/static/root/assets/{use-personal-profile-D4gLM6Wi.js → use-personal-profile-CaCORKeL.js} +1 -1
- package/dist/gateway/static/root/assets/{use-personal-work-B25WRGHj.js → use-personal-work-D0tMU1bP.js} +1 -1
- package/dist/gateway/static/root/assets/{use-realtime-voice-CV3GIt_T.js → use-realtime-voice-D9k997EW.js} +1 -1
- package/dist/gateway/static/root/assets/{use-share-link-WKZLlEqr.js → use-share-link-CqV3o-VZ.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-C0C861cb.js → use-workspace-tree-nnrez9-d.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-AK2U8vGc.js → user-model-page-CpVdbSxS.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-BqXQj51r.js → voice-api-key-field-CVi3dBKx.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-sXEIG6lz.js → voice-config-api-DZbcg7qD.js} +1 -1
- package/dist/gateway/static/root/assets/voice-input-shortcut-events-CwKpIInD.js +1 -0
- package/dist/gateway/static/root/assets/{voice-player-store-CTbnOdeM.js → voice-player-store-DT0f9GPa.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-settings-JpPo3BvX.js → voice-settings-CJdWnHas.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BjfTRFX8.js → work-discovery-overlay-qEN1Ikir.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-CSRkFiXc.js → work-discovery-page-JjCyt1Kw.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-DgM21YVT.js → working-directory-picker-modal-DX6bRmkQ.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-CQOuWbVv.js → workspace-api-CD_6YyPI.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-BuYdf4CO.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-CmMueTmW.js → workspace-file-preview-dialog-DPHnm_7A.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-BAbIGS01.js → workspace-open-location-menu-BdXn5F2i.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-e8HJFnTs.js → xopc-cloud-account-card-CLM7hfkN.js} +1 -1
- package/dist/gateway/static/root/index.html +97 -97
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/session-input-command.js +2 -1
- package/dist/packages/gateway-contract/src/task-display.js +1 -1
- package/dist/packages/gateway-contract/src/task-research-result.js +5 -0
- package/dist/packages/realtime-client/src/index.js +6 -1
- package/dist/packages/realtime-protocol/src/browser-preview.js +111 -0
- package/dist/packages/realtime-protocol/src/index.js +5 -1
- package/dist/src/agent/agent-manager.d.ts +2 -2
- package/dist/src/agent/agent-manager.js +6 -3
- package/dist/src/agent/commands/command-registry.js +2 -1
- package/dist/src/agent/embedded/execution-tool-policy.d.ts +1 -0
- package/dist/src/agent/embedded/execution-tool-policy.js +7 -3
- package/dist/src/agent/embedded/run-turn.js +9 -3
- package/dist/src/agent/mcp/continuation-guard.js +2 -1
- package/dist/src/agent/mcp/conversation-setup.js +2 -1
- package/dist/src/agent/mcp/discovery.js +2 -1
- package/dist/src/agent/orchestration/child-run-monitor.js +2 -1
- package/dist/src/agent/session/interaction-policy-state.js +2 -1
- package/dist/src/agent/tools/browser/tool/browser-use-tool.js +24 -16
- package/dist/src/agent/tools/browser/tool/schemas.d.ts +1 -0
- package/dist/src/agent/tools/browser/tool/schemas.js +6 -1
- package/dist/src/agent/tools/clarify-tool.js +1 -1
- package/dist/src/agent/tools/factory.js +9 -1
- package/dist/src/agent/tools/personal-task-tool.js +79 -16
- package/dist/src/agent/tools/session-recall-tool.js +10 -2
- package/dist/src/agent/tools/skill-install-tool.js +2 -1
- package/dist/src/agent/tools/task-collaboration-tool.js +1 -1
- package/dist/src/agent/tools/task-result-tool.js +10 -9
- package/dist/src/agent/tools/web.js +5 -3
- package/dist/src/agent/tools/xopc-use-tool.js +11 -5
- package/dist/src/automations/capabilities/write.js +2 -1
- package/dist/src/automations/mcp-source.js +2 -1
- package/dist/src/browser/drivers/browser-driver.d.ts +1 -0
- package/dist/src/browser/drivers/extension-driver.d.ts +2 -0
- package/dist/src/browser/drivers/extension-driver.js +11 -1
- package/dist/src/browser/runtime/browser-runtime.d.ts +6 -0
- package/dist/src/browser/runtime/browser-runtime.js +13 -1
- package/dist/src/capabilities/runtime/dispatcher.d.ts +6 -0
- package/dist/src/capabilities/runtime/dispatcher.js +47 -12
- package/dist/src/channels/attachments/inbound-persist.js +1 -0
- package/dist/src/channels/attachments/outbound-tts-persist.js +1 -0
- package/dist/src/channels/message-journal.js +2 -1
- package/dist/src/cli/cli-log-level-preset.js +5 -1
- package/dist/src/cli/commands/mcp.js +44 -5
- package/dist/src/cli/index.js +9 -1
- package/dist/src/computer/flows.js +2 -1
- package/dist/src/config/schema.d.ts +18 -0
- package/dist/src/config/schema.js +6 -0
- package/dist/src/connectors/composio-triggers.js +2 -1
- package/dist/src/endpoint-tools/delegation.js +2 -1
- package/dist/src/endpoint-tools/device-capability-grants.js +2 -1
- package/dist/src/endpoint-tools/execution-actor.js +2 -1
- package/dist/src/endpoint-tools/folder-connections.js +2 -1
- package/dist/src/endpoint-tools/invocation-service.js +2 -1
- package/dist/src/endpoint-tools/provider-catalog.js +2 -1
- package/dist/src/endpoint-tools/provider-operation-status.js +2 -1
- package/dist/src/endpoint-tools/runtime.js +2 -1
- package/dist/src/execution-environments/session-environment-service.js +1 -1
- package/dist/src/files/workspace-file-spaces.d.ts +4 -0
- package/dist/src/files/workspace-file-spaces.js +14 -0
- package/dist/src/gateway/file-space-service.d.ts +1 -1
- package/dist/src/gateway/file-space-service.js +2 -8
- package/dist/src/gateway/hono/app.js +29 -8
- package/dist/src/gateway/hono/lib/extension-store.js +2 -1
- package/dist/src/gateway/hono/lib/mcp-dispatcher.d.ts +2 -0
- package/dist/src/gateway/hono/lib/mcp-dispatcher.js +19 -0
- package/dist/src/gateway/hono/routes/browser.js +38 -0
- package/dist/src/gateway/hono/routes/capability-operations.d.ts +1 -0
- package/dist/src/gateway/hono/routes/capability-operations.js +6 -3
- package/dist/src/gateway/hono/routes/device-push.js +7 -2
- package/dist/src/gateway/hono/routes/execution-environments.js +4 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js +19 -0
- package/dist/src/gateway/hono/routes/mcp-bridge.d.ts +3 -0
- package/dist/src/gateway/hono/routes/mcp-bridge.js +87 -0
- package/dist/src/gateway/hono/routes/mcp-remote.d.ts +3 -0
- package/dist/src/gateway/hono/routes/mcp-remote.js +169 -0
- package/dist/src/gateway/hono/routes/notifications.js +11 -7
- package/dist/src/gateway/hono/routes/personal-agent.js +2 -1
- package/dist/src/gateway/hono/routes/projects.js +2 -3
- package/dist/src/gateway/hono/routes/session-command-handler.js +2 -1
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +2 -0
- package/dist/src/gateway/security/gateway-scopes.js +2 -0
- package/dist/src/gateway/service/agent-runner.js +9 -4
- package/dist/src/gateway/service/config-coordinator.d.ts +9 -0
- package/dist/src/gateway/service/session-command-service.js +4 -2
- package/dist/src/gateway/service/session-input-coordinator.d.ts +1 -0
- package/dist/src/gateway/service/session-input-coordinator.js +30 -2
- package/dist/src/gateway/service/session-preparation-worker.js +6 -2
- package/dist/src/gateway/service.d.ts +6 -0
- package/dist/src/gateway/service.js +44 -3
- package/dist/src/local-apps/access-audit.js +2 -1
- package/dist/src/local-apps/automation-proposals.js +2 -1
- package/dist/src/local-apps/capabilities/automation-policy.js +2 -1
- package/dist/src/local-apps/capabilities/delegate.js +2 -1
- package/dist/src/local-apps/execution-authority.js +2 -1
- package/dist/src/local-apps/p1-services.js +2 -1
- package/dist/src/local-apps/public-assets.js +2 -1
- package/dist/src/local-apps/service.js +2 -1
- package/dist/src/local-apps/store.js +2 -1
- package/dist/src/mcp/callback-config.d.ts +5 -0
- package/dist/src/mcp/callback-config.js +16 -0
- package/dist/src/mcp/capability-server.d.ts +1 -2
- package/dist/src/mcp/capability-server.js +34 -79
- package/dist/src/mcp/connection-grants.d.ts +15 -0
- package/dist/src/mcp/connection-grants.js +73 -0
- package/dist/src/mcp/delegation.d.ts +329 -0
- package/dist/src/mcp/delegation.js +610 -0
- package/dist/src/mcp/gateway-http-client.d.ts +2 -2
- package/dist/src/mcp/gateway-http-client.js +4 -4
- package/dist/src/mcp/product-tools.d.ts +7 -0
- package/dist/src/mcp/product-tools.js +292 -0
- package/dist/src/mcp/remote-auth.d.ts +8 -0
- package/dist/src/mcp/remote-auth.js +51 -0
- package/dist/src/mcp/remote-config.d.ts +11 -0
- package/dist/src/mcp/remote-config.js +31 -0
- package/dist/src/mcp/remote-grants.d.ts +20 -0
- package/dist/src/mcp/remote-grants.js +60 -0
- package/dist/src/mcp/run-callback-subscriptions.d.ts +13 -0
- package/dist/src/mcp/run-callback-subscriptions.js +17 -0
- package/dist/src/mcp/run-callbacks.d.ts +6 -0
- package/dist/src/mcp/run-callbacks.js +125 -0
- package/dist/src/mcp/tool-contract.d.ts +30 -0
- package/dist/src/mcp/tool-contract.js +81 -0
- package/dist/src/mcp/workspace-search.d.ts +16 -0
- package/dist/src/mcp/workspace-search.js +68 -0
- package/dist/src/media/index.js +4 -1
- package/dist/src/media/media-reference.js +2 -1
- package/dist/src/media/session-references.js +4 -2
- package/dist/src/media/store.js +2 -1
- package/dist/src/media/uri.js +17 -12
- package/dist/src/music-generation/artifact.js +2 -1
- package/dist/src/music-generation/settings.js +2 -1
- package/dist/src/notes/capabilities/write.js +2 -1
- package/dist/src/notifications/device-store.js +1 -1
- package/dist/src/notifications/platform-push.d.ts +2 -1
- package/dist/src/notifications/platform-push.js +4 -3
- package/dist/src/notifications/service.js +4 -4
- package/dist/src/personal-agent/proactivity/repository.js +2 -1
- package/dist/src/personal-agent/proactivity/service.js +2 -1
- package/dist/src/personal-agent/reply-result.js +4 -2
- package/dist/src/personal-agent/result-reader.d.ts +2 -0
- package/dist/src/personal-agent/result-reader.js +12 -1
- package/dist/src/personal-agent/specialist-capabilities.js +3 -2
- package/dist/src/phone/assistance.js +2 -1
- package/dist/src/phone/location-environment.js +2 -1
- package/dist/src/phone/repository.js +2 -1
- package/dist/src/phone/setup/service.js +2 -1
- package/dist/src/projects/index.js +2 -2
- package/dist/src/projects/project-kind.d.ts +0 -7
- package/dist/src/projects/project-kind.js +1 -6
- package/dist/src/projects/project-service.js +1 -9
- package/dist/src/realtime/browser-preview-ice.d.ts +2 -0
- package/dist/src/realtime/browser-preview-ice.js +42 -0
- package/dist/src/realtime/browser-preview.d.ts +45 -0
- package/dist/src/realtime/browser-preview.js +191 -0
- package/dist/src/realtime/runtime.d.ts +4 -1
- package/dist/src/realtime/runtime.js +53 -2
- package/dist/src/session/store.js +2 -1
- package/dist/src/share/hosted-session-share.js +2 -1
- package/dist/src/share/note-share-revocation.js +2 -1
- package/dist/src/share/share-store.js +2 -1
- package/dist/src/share/site-share-store.js +2 -1
- package/dist/src/space/ingest.js +2 -1
- package/dist/src/space/workbook-proposals.js +2 -1
- package/dist/src/space/workbook-turn.js +2 -1
- package/dist/src/space/worker.js +2 -1
- package/dist/src/storage/sqlite/durable-state.js +43 -39
- package/dist/src/storage/sqlite/session-creation-repository.d.ts +2 -0
- package/dist/src/storage/sqlite/session-creation-repository.js +24 -5
- package/dist/src/storage/sqlite/session-input-control-repository.js +2 -1
- package/dist/src/storage/sqlite/session-input-repository.js +9 -6
- package/dist/src/tasks/capabilities/read.js +2 -1
- package/dist/src/tasks/capabilities/runs.d.ts +101 -0
- package/dist/src/tasks/capabilities/runs.js +41 -34
- package/dist/src/tasks/capabilities/write.js +2 -1
- package/dist/src/tasks/delegated-run-result.d.ts +16 -0
- package/dist/src/tasks/delegated-run-result.js +47 -0
- package/dist/src/tasks/index.js +2 -2
- package/dist/src/tasks/task-application-service.d.ts +6 -0
- package/dist/src/tasks/task-application-service.js +20 -5
- package/dist/src/tasks/task-context-assembler.js +10 -6
- package/dist/src/tasks/task-contract-planner.js +1 -0
- package/dist/src/tasks/task-deliverables.js +19 -14
- package/dist/src/tasks/task-handoff.d.ts +20 -3
- package/dist/src/tasks/task-handoff.js +207 -146
- package/dist/src/tasks/task-json-acceptance.js +3 -2
- package/dist/src/tasks/task-main-update-decision-service.js +1 -0
- package/dist/src/tasks/task-main-update-delivery.js +4 -2
- package/dist/src/tasks/task-origin-repository.d.ts +2 -0
- package/dist/src/tasks/task-origin-repository.js +17 -0
- package/dist/src/tasks/task-repository.js +3 -0
- package/dist/src/tasks/task-research-repair.js +4 -1
- package/dist/src/tasks/task-research-result.d.ts +7 -0
- package/dist/src/tasks/task-research-result.js +132 -30
- package/dist/src/tasks/task-result-delivery-service.js +2 -1
- package/dist/src/tasks/task-run-coordinator.js +3 -2
- package/dist/src/tasks/task-run-repository.d.ts +2 -1
- package/dist/src/tasks/task-run-repository.js +9 -4
- package/dist/src/video-generation/artifact.js +2 -1
- package/dist/src/video-generation/drafts.js +2 -1
- package/dist/src/video-generation/repository.js +2 -1
- package/dist/src/video-generation/settings.js +2 -1
- package/package.json +3 -1
- package/dist/gateway/static/root/assets/block-editor-Cvy3D_4T.css +0 -1
- package/dist/gateway/static/root/assets/confirm-dialog-MHCmEEUZ.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-CoIFB3im.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-CTWm23Qi.js +0 -1
- package/dist/gateway/static/root/assets/index-B_TGvH_k.css +0 -1
- package/dist/gateway/static/root/assets/index-CJAEAcZV.js +0 -11
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-DlGDLJI2.js +0 -1
- package/dist/gateway/static/root/assets/messages-C7QSnTdg.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-uc-5k3a2.js +0 -7
- package/dist/gateway/static/root/assets/note-image-lightbox-Bvjumefe.js +0 -1
- package/dist/gateway/static/root/assets/product-automation-feedback-DdFoCDzG.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-DGPfKx5M.js +0 -7
- package/dist/gateway/static/root/assets/recording-upload-plrQDkLa.js +0 -1
- package/dist/gateway/static/root/assets/right-workspace-store-Cehybf-G.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cq4HDQu2.js +0 -1
- package/dist/gateway/static/root/assets/space-page-DwyuUvI3.js +0 -2
- package/dist/gateway/static/root/assets/turn-outcome-Dtw6OgwL.js +0 -1
- package/dist/gateway/static/root/assets/voice-input-shortcut-events-DN-_rY5a.js +0 -1
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-CX8zX9eZ.js +0 -1
|
@@ -171,6 +171,15 @@ export declare class GatewayConfigCoordinator {
|
|
|
171
171
|
};
|
|
172
172
|
channels: Record<string, unknown>;
|
|
173
173
|
gateway: {
|
|
174
|
+
mcp?: {
|
|
175
|
+
resource: string;
|
|
176
|
+
issuer: string;
|
|
177
|
+
jwksUrl: string;
|
|
178
|
+
};
|
|
179
|
+
mcpCallback?: {
|
|
180
|
+
url: string;
|
|
181
|
+
secretEnv: string;
|
|
182
|
+
};
|
|
174
183
|
outboundProxy?: {
|
|
175
184
|
mode: "custom" | "environment" | "direct";
|
|
176
185
|
url: string;
|
|
@@ -26,9 +26,9 @@ function validateCreation(service, creation) {
|
|
|
26
26
|
explicitAgentId: creation.agentId,
|
|
27
27
|
projectId: creation.projectId ?? void 0
|
|
28
28
|
}) !== creation.agentId) throw new Error("Invalid agent identity");
|
|
29
|
-
if (project?.workspaceRoot?.trim() && !creation.execution) throw new Error("Select an execution environment");
|
|
30
29
|
if (creation.execution && !project?.workspaceRoot?.trim()) throw new Error("Project requires a workspace");
|
|
31
30
|
if (!getModelThinking(resolveModel(creation.model)).options.includes(creation.thinkingLevel)) throw new Error("Unsupported model thinking level");
|
|
31
|
+
return project?.workspaceRoot?.trim() ? { mode: "local_checkout" } : null;
|
|
32
32
|
}
|
|
33
33
|
async function receiveSessionCommand(service, conversationId, principalId, command, prepareSourceContexts = async () => [], view = "full") {
|
|
34
34
|
const receive = () => withModelConfigLock(conversationId, async () => {
|
|
@@ -45,8 +45,9 @@ async function receiveSessionCommand(service, conversationId, principalId, comma
|
|
|
45
45
|
if (session.transcriptId !== command.expectedTranscriptId) throw new SessionCommandError("SESSION_CHANGED", "Conversation transcript changed");
|
|
46
46
|
}
|
|
47
47
|
if (service.voiceRealtime?.hasConversation(conversationId)) throw new SessionCommandError("SESSION_BUSY", "End the voice call before sending text");
|
|
48
|
+
let defaultExecution = null;
|
|
48
49
|
if ("creation" in command) try {
|
|
49
|
-
validateCreation(service, command.creation);
|
|
50
|
+
defaultExecution = validateCreation(service, command.creation);
|
|
50
51
|
} catch (error) {
|
|
51
52
|
throw new SessionCommandError("BAD_REQUEST", error instanceof Error ? error.message : "Invalid creation configuration");
|
|
52
53
|
}
|
|
@@ -69,6 +70,7 @@ async function receiveSessionCommand(service, conversationId, principalId, comma
|
|
|
69
70
|
endpointId: command.origin.endpointId
|
|
70
71
|
} : command.origin
|
|
71
72
|
}) : void 0,
|
|
73
|
+
defaultExecution,
|
|
72
74
|
attachProject: (id, projectId) => service.projects.attachSession(id, projectId)
|
|
73
75
|
});
|
|
74
76
|
if ("kind" in command && command.kind === "append" && receipt.inputId) await service.dispatchAcceptedSessionInput(conversationId, receipt.inputId);
|
|
@@ -120,6 +120,7 @@ export declare class SessionInputCoordinator {
|
|
|
120
120
|
code: 'BAD_REQUEST' | 'TARGET_NOT_FOUND' | 'NOT_LATEST' | 'SESSION_BUSY' | 'CONTEXT_UNAVAILABLE';
|
|
121
121
|
}>;
|
|
122
122
|
private submitLocked;
|
|
123
|
+
deliverDelegatedTaskSteer(conversationId: string, inputId: string): Promise<void>;
|
|
123
124
|
private steerInput;
|
|
124
125
|
drain(conversationId: string): Promise<void>;
|
|
125
126
|
private requestConnectionStop;
|
|
@@ -169,7 +169,7 @@ var SessionInputCoordinator = class {
|
|
|
169
169
|
await this.runSubmissionExclusive(input.conversationId, async () => {
|
|
170
170
|
const row = getSessionInputById(conversationId, inputId);
|
|
171
171
|
const state = this.snapshot(input.conversationId);
|
|
172
|
-
if (!row || row.status !== "queued" || state.control.paused) return;
|
|
172
|
+
if (!row || row.status !== "queued" || state.control.paused || row.taskRunId && row.effectiveDelivery === "steer") return;
|
|
173
173
|
if (row.payload?.connectionAction === "cancel") this.completeConnectionCancellation(row);
|
|
174
174
|
if (row.payload?.connectionAction || this.connectionTarget(row.conversationId, state)) {
|
|
175
175
|
this.requestConnectionStop(row);
|
|
@@ -504,11 +504,39 @@ var SessionInputCoordinator = class {
|
|
|
504
504
|
state: this.publish(conversationId)
|
|
505
505
|
};
|
|
506
506
|
}
|
|
507
|
+
async deliverDelegatedTaskSteer(conversationId, inputId) {
|
|
508
|
+
const row = runSqliteWriteTransaction(() => {
|
|
509
|
+
const input = getSessionInputById(conversationId, inputId);
|
|
510
|
+
if (!input?.taskRunId || !input.targetRunId || input.effectiveDelivery !== "steer" || input.status !== "queued") return;
|
|
511
|
+
const state = this.snapshot(conversationId);
|
|
512
|
+
const run = new TaskRunRepository().get(input.taskRunId);
|
|
513
|
+
if (state.activeRunId !== input.targetRunId || state.control.paused || run?.status !== "running") {
|
|
514
|
+
setSessionInputStatus(input.id, "interrupted", { error: "Target task turn stopped accepting steering" });
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
setSessionInputStatus(input.id, "injecting");
|
|
518
|
+
return input;
|
|
519
|
+
});
|
|
520
|
+
if (!row) return;
|
|
521
|
+
try {
|
|
522
|
+
if (!await this.steerInput(row, row.targetRunId)) {
|
|
523
|
+
if (getSessionInputById(conversationId, inputId)?.status === "injecting") setSessionInputStatus(inputId, "interrupted", { error: "Target task turn ended before steering" });
|
|
524
|
+
}
|
|
525
|
+
} catch (err) {
|
|
526
|
+
log.warn({
|
|
527
|
+
err,
|
|
528
|
+
conversationId,
|
|
529
|
+
inputId
|
|
530
|
+
}, "Delegated steering delivery could not be confirmed");
|
|
531
|
+
} finally {
|
|
532
|
+
this.publish(conversationId);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
507
535
|
steerInput(row, runId) {
|
|
508
536
|
const text = steeringText(row.content, row.contextSnapshots);
|
|
509
537
|
const userTurnDocument = parseUserTurnDocument(row.content);
|
|
510
538
|
const voiceAgentInstruction = isNaturalVoiceDelegation(row);
|
|
511
|
-
const trackDelivery = row.origin.type === "endpoint";
|
|
539
|
+
const trackDelivery = row.origin.type === "endpoint" || row.taskRunId !== void 0 && row.effectiveDelivery === "steer";
|
|
512
540
|
if (!trackDelivery && !voiceAgentInstruction && !row.attachments?.length && !row.contextSnapshots?.length) return this.deps.steer(row.conversationId, text, runId);
|
|
513
541
|
return this.deps.steer(row.conversationId, text, runId, {
|
|
514
542
|
attachments: row.attachments,
|
|
@@ -6,6 +6,7 @@ import { init_session_repository } from "../../storage/sqlite/session-repository
|
|
|
6
6
|
import { resolveGitCommit } from "../../execution-environments/git.js";
|
|
7
7
|
import { SessionEnvironmentService } from "../../execution-environments/session-environment-service.js";
|
|
8
8
|
import { claimSessionPreparation, finishSessionPreparation, getSessionPreparation, pendingSessionPreparations } from "../../storage/sqlite/session-creation-repository.js";
|
|
9
|
+
import { stat } from "node:fs/promises";
|
|
9
10
|
//#region src/gateway/service/session-preparation-worker.ts
|
|
10
11
|
init_transaction();
|
|
11
12
|
init_session_repository();
|
|
@@ -77,7 +78,7 @@ var SessionPreparationWorker = class {
|
|
|
77
78
|
heartbeat.unref();
|
|
78
79
|
try {
|
|
79
80
|
const project = operation.creation.projectId ? this.service.projects.get(operation.creation.projectId) : null;
|
|
80
|
-
if (!project?.workspaceRoot || !operation.creation.execution) throw new Error("Project workspace is unavailable");
|
|
81
|
+
if (!project?.workspaceRoot || !operation.creation.execution || !await stat(project.workspaceRoot).then((entry) => entry.isDirectory()).catch(() => false)) throw new Error("Project workspace is unavailable");
|
|
81
82
|
let baseRef = operation.baseCommit ?? void 0;
|
|
82
83
|
if (operation.creation.execution.mode === "managed_worktree" && !baseRef) {
|
|
83
84
|
baseRef = await resolveGitCommit(project.workspaceRoot, operation.creation.execution.baseRef ?? "HEAD");
|
|
@@ -116,7 +117,10 @@ var SessionPreparationWorker = class {
|
|
|
116
117
|
const preparation = getSessionPreparation(conversationId);
|
|
117
118
|
if (preparation) this.service.emit("session.input-state", {
|
|
118
119
|
...this.service.getSessionInputState(conversationId),
|
|
119
|
-
preparation
|
|
120
|
+
preparation: {
|
|
121
|
+
...preparation,
|
|
122
|
+
executionMode: preparation.creation.execution?.mode
|
|
123
|
+
}
|
|
120
124
|
});
|
|
121
125
|
}
|
|
122
126
|
}
|
|
@@ -24,6 +24,7 @@ import { GatewayMarketplaceService } from './service/marketplace-service.js';
|
|
|
24
24
|
import { GatewayAgentRunner } from './service/agent-runner.js';
|
|
25
25
|
import { SessionPreparationWorker } from './service/session-preparation-worker.js';
|
|
26
26
|
import { RealtimeRuntime } from '../realtime/runtime.js';
|
|
27
|
+
import { BrowserPreviewRuntime } from '../realtime/browser-preview.js';
|
|
27
28
|
import { VoiceRealtimeRuntime } from '../voice/realtime/runtime.js';
|
|
28
29
|
import type { GatewayServiceConfig } from './service/types.js';
|
|
29
30
|
import { type GatewayReadinessSnapshot } from './startup-readiness.js';
|
|
@@ -55,6 +56,7 @@ export declare class GatewayService {
|
|
|
55
56
|
private auth;
|
|
56
57
|
readonly endpointTools: EndpointToolRuntime;
|
|
57
58
|
private isRealtimePrincipalActive;
|
|
59
|
+
readonly browserPreviews: BrowserPreviewRuntime;
|
|
58
60
|
readonly realtime: RealtimeRuntime;
|
|
59
61
|
readonly phoneStreams: PhoneStreamGateway;
|
|
60
62
|
readonly voiceRealtime: VoiceRealtimeRuntime;
|
|
@@ -76,6 +78,7 @@ export declare class GatewayService {
|
|
|
76
78
|
private readonly readiness;
|
|
77
79
|
private startupTrace;
|
|
78
80
|
private taskAllocationDispatcher;
|
|
81
|
+
private mcpRunCallbacks;
|
|
79
82
|
private taskRunDispatcher;
|
|
80
83
|
private taskRunDispatchTimer;
|
|
81
84
|
private managedComposioEventPoller?;
|
|
@@ -216,6 +219,9 @@ export declare class GatewayService {
|
|
|
216
219
|
aborted: boolean;
|
|
217
220
|
idle: boolean;
|
|
218
221
|
}>;
|
|
222
|
+
deliverDelegatedTaskSteer(conversationId: string, inputId: string): Promise<void>;
|
|
223
|
+
resumeDelegatedRunClarification(wait: import('@xopcai/gateway-contract').ClarificationWait): void;
|
|
224
|
+
stopDelegatedTaskRun(taskRunId: string): void;
|
|
219
225
|
getActiveWebchatRunId(conversationId: string): string | undefined;
|
|
220
226
|
answerEphemeralClarification(requestId: string, answer: ClarificationSubmission): boolean;
|
|
221
227
|
getClarificationState(conversationId: string): import("@xopcai/gateway-contract").ClarificationWaitSnapshot;
|
|
@@ -12,7 +12,7 @@ import { buckets } from "./rate-limit/buckets.js";
|
|
|
12
12
|
import { resolveEffectiveGatewayPort } from "./host.js";
|
|
13
13
|
import { isGatewayStrictSecurityEnabled } from "./rate-limit/env-flags.js";
|
|
14
14
|
import "./rate-limit/index.js";
|
|
15
|
-
import { bumpSessionInputRevision, findSessionInput, findSessionInputByRunId, getSessionInputState, init_session_input_repository, insertSessionInput } from "../storage/sqlite/session-input-repository.js";
|
|
15
|
+
import { bumpSessionInputRevision, findSessionInput, findSessionInputByRunId, getSessionInputState, init_session_input_repository, insertSessionInput, listActiveSessionInputExecutions } from "../storage/sqlite/session-input-repository.js";
|
|
16
16
|
import { buildSessionDisplayMessages, init_session_context_for_llm } from "../session/session-context-for-llm.js";
|
|
17
17
|
import { TaskRepository } from "../tasks/task-repository.js";
|
|
18
18
|
import { init_agent_scope, listAgentEntries, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
@@ -137,6 +137,7 @@ import "./side-chat/index.js";
|
|
|
137
137
|
import { wireTunnelEventsToGateway } from "../tunnel/gateway-lifecycle.js";
|
|
138
138
|
import { getExposureManager } from "../remote-access/exposure-manager.js";
|
|
139
139
|
import { sanitizeTunnelConfig } from "../tunnel/tunnel-config.js";
|
|
140
|
+
import { McpRunCallbackDispatcher } from "../mcp/run-callbacks.js";
|
|
140
141
|
import { assertGatewayAuthNotKnownWeak } from "./security/known-weak-secrets.js";
|
|
141
142
|
import { assertGatewayRuntimeConfig } from "./runtime-config.js";
|
|
142
143
|
import { auditGatewayConfig } from "./security/audit.js";
|
|
@@ -159,6 +160,7 @@ import { GatewayAgentRunner } from "./service/agent-runner.js";
|
|
|
159
160
|
import { SessionPreparationWorker } from "./service/session-preparation-worker.js";
|
|
160
161
|
import { isBrowserSessionActive } from "../storage/sqlite/browser-session-repository.js";
|
|
161
162
|
import { RealtimeRuntime } from "../realtime/runtime.js";
|
|
163
|
+
import { BrowserPreviewRuntime } from "../realtime/browser-preview.js";
|
|
162
164
|
import { VoiceRealtimeRuntime } from "../voice/realtime/runtime.js";
|
|
163
165
|
import { DurableVoiceAgentBroker } from "../voice/realtime/agentBroker.js";
|
|
164
166
|
import { reconcileMemoryMaintenanceAutomations } from "./memory-maintenance-automation-reconciler.js";
|
|
@@ -230,7 +232,8 @@ var GatewayService = class {
|
|
|
230
232
|
return false;
|
|
231
233
|
}
|
|
232
234
|
};
|
|
233
|
-
|
|
235
|
+
browserPreviews = new BrowserPreviewRuntime((conversationId) => this.agentRunner?.getActiveRunId(conversationId));
|
|
236
|
+
realtime = new RealtimeRuntime(this.endpointTools, this.isRealtimePrincipalActive, this.browserPreviews);
|
|
234
237
|
phoneStreams = new PhoneStreamGateway(this.isRealtimePrincipalActive);
|
|
235
238
|
voiceRealtime = new VoiceRealtimeRuntime({
|
|
236
239
|
publishConversationContent: async (conversationId, transcriptId, publication) => {
|
|
@@ -429,6 +432,7 @@ var GatewayService = class {
|
|
|
429
432
|
readiness = new GatewayReadiness();
|
|
430
433
|
startupTrace = null;
|
|
431
434
|
taskAllocationDispatcher = null;
|
|
435
|
+
mcpRunCallbacks = null;
|
|
432
436
|
taskRunDispatcher = null;
|
|
433
437
|
taskRunDispatchTimer = null;
|
|
434
438
|
managedComposioEventPoller;
|
|
@@ -805,7 +809,19 @@ var GatewayService = class {
|
|
|
805
809
|
}),
|
|
806
810
|
getPhoneSetupService: () => this.phoneSetup,
|
|
807
811
|
canConfigureEndpoint: (endpointId) => this.realtime.canConfigureEndpoint(endpointId),
|
|
808
|
-
emitBrowserEvent: (type, payload) =>
|
|
812
|
+
emitBrowserEvent: (type, payload) => {
|
|
813
|
+
if (type !== "browser.preview.target") {
|
|
814
|
+
this.emit(type, payload);
|
|
815
|
+
return;
|
|
816
|
+
}
|
|
817
|
+
const { conversationId, runId, source } = payload;
|
|
818
|
+
if (source) this.browserPreviews.setTarget({
|
|
819
|
+
conversationId,
|
|
820
|
+
runId,
|
|
821
|
+
...source
|
|
822
|
+
});
|
|
823
|
+
else this.browserPreviews.clearTarget(conversationId, runId);
|
|
824
|
+
},
|
|
809
825
|
getNotesService: () => this.notesService,
|
|
810
826
|
getProjectService: () => this.projects,
|
|
811
827
|
getWorkDiscovery: () => this._workDiscovery ?? void 0,
|
|
@@ -1097,6 +1113,10 @@ var GatewayService = class {
|
|
|
1097
1113
|
this.taskResultDispatch();
|
|
1098
1114
|
this.taskRunDispatch();
|
|
1099
1115
|
this.taskMainUpdateDispatch();
|
|
1116
|
+
if (this.config.gateway.mcpCallback) {
|
|
1117
|
+
this.mcpRunCallbacks ??= new McpRunCallbackDispatcher();
|
|
1118
|
+
this.mcpRunCallbacks.dispatch(() => this.config.gateway.mcpCallback);
|
|
1119
|
+
}
|
|
1100
1120
|
}
|
|
1101
1121
|
async ensureTaskConversation(taskId, options = {}) {
|
|
1102
1122
|
return runSqliteWriteTransaction(() => {
|
|
@@ -1266,6 +1286,25 @@ var GatewayService = class {
|
|
|
1266
1286
|
abortAgentRun(runId) {
|
|
1267
1287
|
return this.agentRunner.abortAgentRun(runId);
|
|
1268
1288
|
}
|
|
1289
|
+
deliverDelegatedTaskSteer(conversationId, inputId) {
|
|
1290
|
+
return this.agentRunner.inputs.deliverDelegatedTaskSteer(conversationId, inputId);
|
|
1291
|
+
}
|
|
1292
|
+
resumeDelegatedRunClarification(wait) {
|
|
1293
|
+
this.emit("clarification.updated", wait);
|
|
1294
|
+
this.agentRunner.inputs.drain(wait.conversationId);
|
|
1295
|
+
}
|
|
1296
|
+
stopDelegatedTaskRun(taskRunId) {
|
|
1297
|
+
for (const input of listActiveSessionInputExecutions()) {
|
|
1298
|
+
if (input.taskRunId !== taskRunId) continue;
|
|
1299
|
+
this.abortAgentRun(input.runId).catch((error) => {
|
|
1300
|
+
log.warn({
|
|
1301
|
+
err: error,
|
|
1302
|
+
taskRunId,
|
|
1303
|
+
runId: input.runId
|
|
1304
|
+
}, "Failed to interrupt delegated task execution");
|
|
1305
|
+
});
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1269
1308
|
getActiveWebchatRunId(conversationId) {
|
|
1270
1309
|
return this.agentRunner.getActiveRunId(conversationId);
|
|
1271
1310
|
}
|
|
@@ -1788,6 +1827,8 @@ var GatewayService = class {
|
|
|
1788
1827
|
const { cancelAllPluginCliAuthorizations } = await import("../extensions/agent-plugins/cli-authorization.js");
|
|
1789
1828
|
cancelAllPluginCliAuthorizations();
|
|
1790
1829
|
this.taskAllocationDispatcher?.stop();
|
|
1830
|
+
this.mcpRunCallbacks?.stop();
|
|
1831
|
+
this.mcpRunCallbacks = null;
|
|
1791
1832
|
this.taskRunDispatcher?.stop();
|
|
1792
1833
|
if (this.taskRunDispatchTimer) {
|
|
1793
1834
|
clearInterval(this.taskRunDispatchTimer);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
4
|
-
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
4
|
+
import { DurableState, init_durable_state } from "../storage/sqlite/durable-state.js";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
6
6
|
//#region src/local-apps/access-audit.ts
|
|
7
|
+
init_durable_state();
|
|
7
8
|
init_transaction();
|
|
8
9
|
init_logger();
|
|
9
10
|
const log = createLogger("LocalApps:Access");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
1
|
+
import { DurableState, init_durable_state } from "../storage/sqlite/durable-state.js";
|
|
2
2
|
import { CreateAutomationSchema } from "../automations/domain/validation.js";
|
|
3
3
|
import { getAutomation } from "../automations/storage/automation-repository.js";
|
|
4
4
|
import "../automations/storage/index.js";
|
|
@@ -11,6 +11,7 @@ import "../automations/draft/index.js";
|
|
|
11
11
|
import { createHash, randomUUID } from "node:crypto";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
//#region src/local-apps/automation-proposals.ts
|
|
14
|
+
init_durable_state();
|
|
14
15
|
const AutomationProposalInputSchema = z.discriminatedUnion("kind", [z.strictObject({
|
|
15
16
|
kind: z.literal("create"),
|
|
16
17
|
definition: AutomationCreateCapabilityInputSchema
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { DurableState } from "../../storage/sqlite/durable-state.js";
|
|
1
|
+
import { DurableState, init_durable_state } from "../../storage/sqlite/durable-state.js";
|
|
2
2
|
import { getAutomation } from "../../automations/storage/automation-repository.js";
|
|
3
3
|
import { getAutomationRun } from "../../automations/storage/automation-run-repository.js";
|
|
4
4
|
import "../../automations/storage/index.js";
|
|
5
5
|
import { canonicalCapabilityJson } from "../../capabilities/runtime/dispatcher.js";
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
7
|
//#region src/local-apps/capabilities/automation-policy.ts
|
|
8
|
+
init_durable_state();
|
|
8
9
|
/** Runtime state changes do not widen execution authority; definition changes require fresh review. */
|
|
9
10
|
function automationConfigurationDigest(automation) {
|
|
10
11
|
const { state: _state, updatedAtMs: _updatedAtMs, ...definition } = automation;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LocalAppDelegateInputSchema, LocalAppDelegateOutputSchema } from "../../../packages/gateway-contract/src/local-app-delegation.js";
|
|
2
2
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
|
-
import { DurableState } from "../../storage/sqlite/durable-state.js";
|
|
3
|
+
import { DurableState, init_durable_state } from "../../storage/sqlite/durable-state.js";
|
|
4
4
|
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
5
5
|
import { resolveEffectiveAgentProfile } from "../../config/agent-profile.js";
|
|
6
6
|
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
@@ -11,6 +11,7 @@ import { defineExternalCapability } from "../../capabilities/runtime/dispatcher.
|
|
|
11
11
|
import { localAppResourceAllowed } from "./resource-policy.js";
|
|
12
12
|
//#region src/local-apps/capabilities/delegate.ts
|
|
13
13
|
init_src();
|
|
14
|
+
init_durable_state();
|
|
14
15
|
init_resolve_route();
|
|
15
16
|
init_providers();
|
|
16
17
|
const active = /* @__PURE__ */ new Map();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
2
|
-
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
2
|
+
import { DurableState, init_durable_state } from "../storage/sqlite/durable-state.js";
|
|
3
3
|
import { init_paths, resolveConfigPath } from "../config/paths.js";
|
|
4
4
|
import { withExecutionAuthority } from "../infra/execution-authority.js";
|
|
5
5
|
import { classifyCostSource } from "../usage/cost.js";
|
|
@@ -10,6 +10,7 @@ import { isBareProfileMarkdownFileName } from "../agent/tools/tool-paths.js";
|
|
|
10
10
|
import { readFileSync } from "node:fs";
|
|
11
11
|
//#region src/local-apps/execution-authority.ts
|
|
12
12
|
init_transaction();
|
|
13
|
+
init_durable_state();
|
|
13
14
|
init_paths();
|
|
14
15
|
const readTools = new Set(["read_file", "list_dir"]);
|
|
15
16
|
const writeTools = new Set([
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
1
|
+
import { DurableState, init_durable_state } from "../storage/sqlite/durable-state.js";
|
|
2
2
|
import { getConnectorAccount, init_connector_account_repository } from "../storage/sqlite/connector-account-repository.js";
|
|
3
3
|
import { decideConnectorApproval, getConnectorApproval, getConnectorConnection, init_connector_repository, listConnectorActionMetadata, listConnectorConnections } from "../storage/sqlite/connector-repository.js";
|
|
4
4
|
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
@@ -22,6 +22,7 @@ import { open, stat } from "node:fs/promises";
|
|
|
22
22
|
init_resolve_route();
|
|
23
23
|
init_connector_account_repository();
|
|
24
24
|
init_connector_repository();
|
|
25
|
+
init_durable_state();
|
|
25
26
|
const LIMIT = 512 * 1024;
|
|
26
27
|
const connectorInput = z.strictObject({
|
|
27
28
|
toolRef: z.string().min(1).max(1024),
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
1
|
+
import { DurableState, init_durable_state } from "../storage/sqlite/durable-state.js";
|
|
2
2
|
import { localAppFileHashes } from "./artifact-files.js";
|
|
3
3
|
import { extname, posix, relative, resolve, sep } from "node:path";
|
|
4
4
|
import { existsSync, readFileSync, realpathSync, statSync } from "node:fs";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
//#region src/local-apps/public-assets.ts
|
|
7
|
+
init_durable_state();
|
|
7
8
|
const PUBLIC_TYPES = new Set([
|
|
8
9
|
".html",
|
|
9
10
|
".js",
|
|
@@ -5,7 +5,7 @@ import { init_logger } from "../utils/logger.js";
|
|
|
5
5
|
import { afterSqliteCommit, getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
6
6
|
import { ExtensionCapabilityBindingsSchema, LocalAppResourceScopesSchema, extensionCapabilityPermissions } from "../../packages/gateway-contract/src/extension-capabilities.js";
|
|
7
7
|
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
8
|
-
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
8
|
+
import { DurableState, init_durable_state } from "../storage/sqlite/durable-state.js";
|
|
9
9
|
import { getConnectorAccount, init_connector_account_repository } from "../storage/sqlite/connector-account-repository.js";
|
|
10
10
|
import { getConnectorConnection, init_connector_repository } from "../storage/sqlite/connector-repository.js";
|
|
11
11
|
import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
|
|
@@ -43,6 +43,7 @@ init_transaction();
|
|
|
43
43
|
init_operation_context();
|
|
44
44
|
init_conversation_repository();
|
|
45
45
|
init_session_repository();
|
|
46
|
+
init_durable_state();
|
|
46
47
|
const log = createLogger("LocalApps");
|
|
47
48
|
const UI_ONLY_PERMISSIONS = new Set([
|
|
48
49
|
"theme",
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { getSqliteDatabase, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
2
2
|
import { LocalAppResourceScopesSchema } from "../../packages/gateway-contract/src/extension-capabilities.js";
|
|
3
3
|
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
4
|
-
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
4
|
+
import { DurableState, init_durable_state } from "../storage/sqlite/durable-state.js";
|
|
5
5
|
import "../storage/sqlite/index.js";
|
|
6
6
|
import { randomUUID } from "node:crypto";
|
|
7
7
|
//#region src/local-apps/store.ts
|
|
8
8
|
init_src();
|
|
9
|
+
init_durable_state();
|
|
9
10
|
function fromRow(row) {
|
|
10
11
|
return {
|
|
11
12
|
id: row.app_id,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/mcp/callback-config.ts
|
|
4
|
+
var McpCallbackConfigSchema;
|
|
5
|
+
var init_callback_config = __esmMin((() => {
|
|
6
|
+
McpCallbackConfigSchema = z.strictObject({
|
|
7
|
+
url: z.url().refine((value) => {
|
|
8
|
+
const url = new URL(value);
|
|
9
|
+
return url.protocol === "https:" && !url.username && !url.password && !url.hash && !url.search;
|
|
10
|
+
}, "Use an HTTPS callback URL without credentials, query or fragment"),
|
|
11
|
+
secretEnv: z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/)
|
|
12
|
+
});
|
|
13
|
+
}));
|
|
14
|
+
//#endregion
|
|
15
|
+
init_callback_config();
|
|
16
|
+
export { McpCallbackConfigSchema, init_callback_config };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
2
2
|
import { type GatewayHttpClient } from './gateway-http-client.js';
|
|
3
|
-
|
|
4
|
-
export declare function createCapabilityMcpServer(client: Pick<GatewayHttpClient, 'getJson' | 'postJson'>, capabilityIds: readonly string[]): Server;
|
|
3
|
+
export declare function createCapabilityMcpServer(client: Pick<GatewayHttpClient, 'getJson' | 'postJson'>): Server;
|
|
@@ -1,93 +1,48 @@
|
|
|
1
1
|
import { PACKAGE_VERSION, init_package_version } from "../package-version.js";
|
|
2
|
-
import {
|
|
3
|
-
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
2
|
+
import { MCP_BRIDGE_PATH } from "./connection-grants.js";
|
|
4
3
|
import { GatewayHttpError } from "./gateway-http-client.js";
|
|
4
|
+
import { describeTool, parseToolArguments, toolFailure, toolName, toolResult } from "./tool-contract.js";
|
|
5
5
|
import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
6
6
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
7
7
|
//#region src/mcp/capability-server.ts
|
|
8
|
-
init_src();
|
|
9
8
|
init_package_version();
|
|
10
|
-
|
|
11
|
-
/** An opt-in HTTP proxy, not a new principal or an approval authority. */
|
|
12
|
-
function createCapabilityMcpServer(client, capabilityIds) {
|
|
13
|
-
if (!capabilityIds.length || capabilityIds.some((id) => !/^xopc\.[a-z0-9_.]+$/.test(id))) throw new Error("At least one explicit xopc capability ID is required (wildcards are not supported)");
|
|
14
|
-
const allowed = new Set(capabilityIds);
|
|
9
|
+
function createCapabilityMcpServer(client) {
|
|
15
10
|
const server = new Server({
|
|
16
|
-
name: "xopc-
|
|
11
|
+
name: "xopc-gateway",
|
|
17
12
|
version: PACKAGE_VERSION
|
|
18
|
-
}, {
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
}, {
|
|
14
|
+
capabilities: { tools: {} },
|
|
15
|
+
instructions: "Use list tools to look up stable IDs, then get tools for details. Writes need an idempotencyKey per intent. Retry uncertain writes with the same arguments and key."
|
|
16
|
+
});
|
|
17
|
+
const catalog = async (signal) => {
|
|
18
|
+
return (await client.getJson(MCP_BRIDGE_PATH, signal)).capabilities.filter((item) => item.surfaces.includes("mcp"));
|
|
21
19
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"descriptorDigest",
|
|
31
|
-
"input",
|
|
32
|
-
...item.effect === "read" ? [] : ["idempotencyKey"]
|
|
33
|
-
],
|
|
34
|
-
properties: {
|
|
35
|
-
majorVersion: {
|
|
36
|
-
type: "integer",
|
|
37
|
-
const: item.majorVersion
|
|
38
|
-
},
|
|
39
|
-
descriptorDigest: {
|
|
40
|
-
type: "string",
|
|
41
|
-
const: item.descriptorDigest
|
|
42
|
-
},
|
|
43
|
-
input: item.inputSchema,
|
|
44
|
-
idempotencyKey: {
|
|
45
|
-
type: "string",
|
|
46
|
-
minLength: 1,
|
|
47
|
-
maxLength: 200
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
annotations: {
|
|
52
|
-
readOnlyHint: item.effect === "read",
|
|
53
|
-
destructiveHint: item.effect === "destructive",
|
|
54
|
-
openWorldHint: true
|
|
55
|
-
}
|
|
56
|
-
})) }));
|
|
57
|
-
server.setRequestHandler(CallToolRequestSchema, async ({ params }) => {
|
|
58
|
-
const fail = (code, operationId) => ({
|
|
59
|
-
isError: true,
|
|
60
|
-
content: [{
|
|
61
|
-
type: "text",
|
|
62
|
-
text: JSON.stringify({
|
|
63
|
-
code,
|
|
64
|
-
...operationId ? { operationId } : {}
|
|
65
|
-
})
|
|
66
|
-
}]
|
|
67
|
-
});
|
|
68
|
-
if (!allowed.has(params.name)) return fail("FORBIDDEN");
|
|
69
|
-
const parsed = CapabilityCallSchema.safeParse(params.arguments);
|
|
70
|
-
if (!parsed.success) return fail("INVALID_INPUT");
|
|
71
|
-
let dispatched = false;
|
|
72
|
-
let write = false;
|
|
20
|
+
let discovered = /* @__PURE__ */ new Map();
|
|
21
|
+
server.setRequestHandler(ListToolsRequestSchema, async (_request, { signal }) => {
|
|
22
|
+
const items = await catalog(signal);
|
|
23
|
+
discovered = new Map(items.map((item) => [item.id, item.descriptorDigest]));
|
|
24
|
+
return { tools: items.map(describeTool) };
|
|
25
|
+
});
|
|
26
|
+
server.setRequestHandler(CallToolRequestSchema, async ({ params }, { signal }) => {
|
|
27
|
+
let writeDispatched = false;
|
|
73
28
|
try {
|
|
74
|
-
const
|
|
75
|
-
if (!
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
29
|
+
const item = (await catalog(signal)).find((tool) => toolName(tool.id) === params.name);
|
|
30
|
+
if (!item) return toolFailure("FORBIDDEN");
|
|
31
|
+
const previous = discovered.get(item.id);
|
|
32
|
+
if (previous && previous !== item.descriptorDigest) return toolFailure("CONTRACT_CHANGED");
|
|
33
|
+
const args = parseToolArguments(item, params.arguments);
|
|
34
|
+
if (!args) return toolFailure("INVALID_INPUT");
|
|
35
|
+
writeDispatched = item.effect !== "read";
|
|
36
|
+
const { data } = await client.postJson(MCP_BRIDGE_PATH, {
|
|
37
|
+
capability: item.id,
|
|
38
|
+
majorVersion: item.majorVersion,
|
|
39
|
+
descriptorDigest: item.descriptorDigest,
|
|
40
|
+
...args
|
|
41
|
+
}, signal);
|
|
42
|
+
return toolResult(data);
|
|
88
43
|
} catch (error) {
|
|
89
|
-
if (error instanceof GatewayHttpError) return
|
|
90
|
-
return
|
|
44
|
+
if (error instanceof GatewayHttpError) return toolFailure(error.code ?? (error.status === 401 || error.status === 403 ? "FORBIDDEN" : error.status === 400 || error.status === 413 ? "INVALID_INPUT" : writeDispatched && error.status !== 429 ? "OUTCOME_UNKNOWN" : "UNAVAILABLE"), error.operationId);
|
|
45
|
+
return toolFailure(writeDispatched ? "OUTCOME_UNKNOWN" : signal.aborted ? "CANCELLED" : "UNAVAILABLE");
|
|
91
46
|
}
|
|
92
47
|
});
|
|
93
48
|
return server;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const MCP_BRIDGE_PATH = "/api/mcp/bridge";
|
|
2
|
+
export declare function createMcpConnection(capabilityIds: readonly string[]): {
|
|
3
|
+
connectionId: string;
|
|
4
|
+
token: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function revokeMcpConnection(connectionId: string): void;
|
|
7
|
+
export declare function getMcpBearerToken(authorization: string | undefined): string;
|
|
8
|
+
export declare function readMcpConnectionGrant(connectionId: string): {
|
|
9
|
+
tokenHash: string;
|
|
10
|
+
capabilityIds: string[];
|
|
11
|
+
};
|
|
12
|
+
export declare function authenticateMcpConnection(token: string): {
|
|
13
|
+
connectionId: string;
|
|
14
|
+
capabilityIds: string[];
|
|
15
|
+
} | null;
|