@xopcai/xopc 0.0.320 → 0.0.323
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/dist/assets/{auth-DKo-NMUY.js → auth-DocRzRlS.js} +95 -21
- package/dist/browser-ext/dist/background.js +1 -1
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +18 -2
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BXLU0HJa.js → agent-avatar-dicebear-DFzmThVi.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CAFHadiy.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-DYFYiuig.js +1 -0
- package/dist/gateway/static/root/assets/{agents-hrbGiOHn.js → agents-BqIlB5Co.js} +1 -1
- package/dist/gateway/static/root/assets/{app-link-nL8iPwEr.js → app-link-C6gA5Nck.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-C0jEvonH.js → app-management-settings-panel-BgvMRGWe.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-ByVRv2Oe.js → appearance-settings-CliHU03A.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-Drt3Foi9.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-CMITc1PQ.js → archive-plugin-DnuPpm0u.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-B5Z1PKHm.js → attachment-load-BiwaK0ie.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BOcXqVar.js → automations-page-CJSISGQH.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-B-Eduqwz.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BkRb9adx.js → binary-plugins-KDjduQZO.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DsmDlkC2.js → block-editor-bclvgove.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-BgBH3eFk.js → browser-automation-inputs-CfQ2T9t6.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-e3KpurLo.js → browser-automations-page-Cxq38Nnp.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-Dwgir6mu.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-H5L5vynP.js +8 -0
- package/dist/gateway/static/root/assets/capabilities-uFKh3Hd0.js +1 -0
- package/dist/gateway/static/root/assets/channels-settings-RFBRYe5S.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DUdkU1C5.js → chat-terminal-dock-DKQC62nQ.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-C6WR9Syy.js → computer-settings-page-D1whpIqL.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-SVKcySx0.js → connector-service-page-BAuYTgf5.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-Px-v3Q6Q.js +2 -0
- package/dist/gateway/static/root/assets/{date-picker-DBD5yedi.js → date-picker-CfCo3lqh.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-HE41Co5W.js → dependency-picker-DOuVO2M1.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DH9EU9O3.js → desktop-pet-D9tu6Bhu.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-Br6Z1Vau.js → desktop-pet-settings-CQPXub2f.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DxkOYSut.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-CFjVNb1m.js → extension-debug-page-CtWClPz-.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BQ3ldBhh.js → extension-page-BHh9HLCz.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CaXnWbRI.js → extension-settings-page-BdT3v5Uh.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-DgFmBSH9.js → gateway-config-swr-1eqyz9vZ.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-CZas_Ekx.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-C7h3xef0.js → gateway-startup-retry-C4rsW6vJ.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-w3_aWeNt.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-DJ1xaz2p.js → image-generation-api-B5DXMylk.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-CaB54QIp.js → imports-page-B1JH0G5j.js} +1 -1
- package/dist/gateway/static/root/assets/index--3c0awkr.js +121 -0
- package/dist/gateway/static/root/assets/index-CNc4N4TX.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DnvHvKQJ.js → keyboard-shortcuts-settings-DGrLJ8Yh.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-BYKrJpFF.js +1 -0
- package/dist/gateway/static/root/assets/local-apps-Bpja8nC6.js +1 -0
- package/dist/gateway/static/root/assets/local-apps-page-DqjStqbL.js +1 -0
- package/dist/gateway/static/root/assets/{locale-store-C4RjTd0C.js → locale-store-BIkcRr3t.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-N0q5DxnI.js → logs-page-Dl4kM4Na.js} +2 -2
- package/dist/gateway/static/root/assets/management-settings-gCfH4cwH.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-DkPzc50Z.js → markdown-view-Ck_5MADq.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-BzLYE9lj.js → media-plugins-DTsZqgo6.js} +1 -1
- package/dist/gateway/static/root/assets/messages-7VAhscYe.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-j6sioeL1.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-CMvvHv0f.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-DVnGa7Lu.js → page-context-capture-button-DTI_g4tz.js} +1 -1
- package/dist/gateway/static/root/assets/{page-tabs-q6lpN9OD.js → page-tabs-CfW_Q-K5.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Ck63fJaQ.js → preview-open-alternatives-CuPN-vAn.js} +1 -1
- package/dist/gateway/static/root/assets/product-delivery-bv3z8Xkh.js +1 -0
- package/dist/gateway/static/root/assets/product-open-page-BHjxRz1E.js +1 -0
- package/dist/gateway/static/root/assets/project-detail-page-C9K_e-EV.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-Bk-es4i9.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-CRnytFLF.js → registry-api-BAAZUGnU.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CLGJNA42.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Bu3XyrDI.js → runtime-tools-settings-panel-CHJBJKL1.js} +2 -2
- package/dist/gateway/static/root/assets/{scenes-page-B_5HOUzl.js → scenes-page-ClLAD1pz.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-CbOOKW1B.js → schema-form-FQAit5HL.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-Xj8MkXN1.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DwALV8mi.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-D3UN4rb4.js → settings-form-section-BDc6bw1q.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BHztZayW.js → settings-page-DnhxBJjV.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-nskqtzZs.js → settings-page-layout-D3KNSQ5g.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-BtukdJ-z.js → setup-status-panel-F0rCQ-2a.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-DbYXEqur.js → share-preview-page-DVQCRxwK.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-C7hf6Cov.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-xPrFejRE.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-CK9Jeaur.js → skills-page-RdDYu7Yj.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-B44aWbyL.js → skills-page.utils-mDwC9UJ-.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BwqpUGv_.js → system-settings-panel-Bk7GrMij.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-2A966jFY.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-BKTZzQIT.js → tunnel-api-D3Aquraj.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-BB1JBOCz.js → use-autosave-C1xQ-sHn.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-CnBxPBVe.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-C-HsgED9.js → voice-api-key-field-DCNECvcp.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-DvJKYYA0.js → voice-config-api-B-_niUTU.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-K3e5ONUo.js → work-discovery-overlay-BrGx_JS_.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-dXRTHBoE.js → workflow-run-setup-panel-CmmC2Pdr.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BZVpqw4T.js +6 -0
- package/dist/gateway/static/root/index.html +12 -11
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/capabilities.js +4 -110
- package/dist/packages/gateway-contract/src/chat-previews.js +73 -0
- package/dist/packages/gateway-contract/src/index.js +6 -0
- package/dist/packages/gateway-contract/src/local-apps.js +215 -0
- package/dist/packages/gateway-contract/src/product-delivery.js +62 -17
- package/dist/packages/gateway-contract/src/user-turn-document.js +60 -0
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +5 -4
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/embedded/transcript-runtime.d.ts +3 -0
- package/dist/src/agent/embedded/transcript-runtime.js +6 -0
- package/dist/src/agent/external-tools/cliProvider.js +4 -1
- package/dist/src/agent/external-tools/composio-provider.js +9 -3
- package/dist/src/agent/external-tools/gateway-tools.js +17 -10
- package/dist/src/agent/external-tools/mcp-provider.d.ts +3 -1
- package/dist/src/agent/external-tools/mcp-provider.js +91 -6
- package/dist/src/agent/external-tools/service.d.ts +2 -1
- package/dist/src/agent/external-tools/service.js +8 -3
- package/dist/src/agent/external-tools/types.d.ts +9 -0
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-config.js +37 -5
- package/dist/src/agent/mcp/bundle-mcp-gateway.d.ts +1 -0
- package/dist/src/agent/mcp/bundle-mcp-gateway.js +1 -0
- package/dist/src/agent/mcp/bundle-mcp-names.js +2 -1
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +33 -1
- package/dist/src/agent/mcp/bundle-mcp-types.d.ts +4 -0
- package/dist/src/agent/mcp/index.js +1 -1
- package/dist/src/agent/mcp/mcp-stdio-transport.d.ts +1 -0
- package/dist/src/agent/mcp/mcp-stdio-transport.js +10 -0
- package/dist/src/agent/mcp/mcp-transport.js +12 -8
- package/dist/src/agent/mcp/oauth/index.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.d.ts +6 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +70 -14
- package/dist/src/agent/mcp/oauth/mcp-oauth-provider.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-session.d.ts +2 -0
- package/dist/src/agent/mcp/oauth/mcp-oauth-session.js +12 -0
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.d.ts +3 -0
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +14 -2
- package/dist/src/agent/mcp/plugin-http-fetch.d.ts +2 -0
- package/dist/src/agent/mcp/plugin-http-fetch.js +56 -0
- package/dist/src/agent/service/process-direct-streaming.js +27 -12
- package/dist/src/agent/service.js +3 -2
- package/dist/src/agent/service.types.d.ts +2 -0
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +1 -1
- package/dist/src/agent/skills/index.js +8 -1
- package/dist/src/agent/skills/skill-manager.d.ts +2 -0
- package/dist/src/agent/skills/skill-manager.js +8 -0
- package/dist/src/agent/skills/skill-sources.js +17 -0
- package/dist/src/agent/skills/types.d.ts +3 -1
- package/dist/src/agent/source-context/injector.js +10 -5
- package/dist/src/agent/source-context/types.d.ts +3 -0
- package/dist/src/agent/source-context/types.js +8 -2
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +12 -2
- package/dist/src/agent/tools/automation-tool.js +1 -1
- package/dist/src/agent/tools/factory.d.ts +1 -0
- package/dist/src/agent/tools/factory.js +2 -1
- package/dist/src/agent/tools/search/registry.js +4 -1
- package/dist/src/agent/tools/workflow-tool.js +1 -1
- package/dist/src/agent/tools/write.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.d.ts +4 -2
- package/dist/src/agent/tools/xopc-use-tool.js +120 -12
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-previews/index.d.ts +2 -0
- package/dist/src/chat-previews/index.js +3 -0
- package/dist/src/chat-previews/service.d.ts +27 -0
- package/dist/src/chat-previews/service.js +106 -0
- package/dist/src/chat-previews/store.d.ts +28 -0
- package/dist/src/chat-previews/store.js +77 -0
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +3 -3
- package/dist/src/cli/commands/extension-agent-plugin.d.ts +8 -0
- package/dist/src/cli/commands/extension-agent-plugin.js +82 -0
- package/dist/src/cli/commands/extension-marketplace.js +44 -4
- package/dist/src/cli/commands/extension.js +35 -3
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/computer/runtime.js +1 -1
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +2 -2
- package/dist/src/config/schema.js +2 -2
- package/dist/src/connectors/account-selection.js +1 -1
- package/dist/src/connectors/connection-candidates.d.ts +4 -1
- package/dist/src/connectors/connection-candidates.js +8 -2
- package/dist/src/connectors/connection-capabilities.d.ts +2 -2
- package/dist/src/connectors/connection-capabilities.js +3 -1
- package/dist/src/connectors/connection-recovery-service.d.ts +6 -1
- package/dist/src/connectors/connection-recovery-service.js +138 -26
- package/dist/src/connectors/plugin-mcp-recovery.d.ts +28 -0
- package/dist/src/connectors/plugin-mcp-recovery.js +90 -0
- package/dist/src/extensions/agent-plugins/auth.d.ts +39 -0
- package/dist/src/extensions/agent-plugins/auth.js +156 -0
- package/dist/src/extensions/agent-plugins/connection.d.ts +8 -0
- package/dist/src/extensions/agent-plugins/connection.js +41 -0
- package/dist/src/extensions/agent-plugins/health.d.ts +4 -0
- package/dist/src/extensions/agent-plugins/health.js +48 -0
- package/dist/src/extensions/agent-plugins/inventory.d.ts +53 -0
- package/dist/src/extensions/agent-plugins/inventory.js +34 -0
- package/dist/src/extensions/agent-plugins/mcp-adapter.d.ts +3 -0
- package/dist/src/extensions/agent-plugins/mcp-adapter.js +47 -0
- package/dist/src/extensions/agent-plugins/sources.d.ts +5 -0
- package/dist/src/extensions/agent-plugins/sources.js +72 -0
- package/dist/src/extensions/agent-plugins/store.d.ts +61 -0
- package/dist/src/extensions/agent-plugins/store.js +305 -0
- package/dist/src/extensions/agent-plugins/validation.d.ts +59 -0
- package/dist/src/extensions/agent-plugins/validation.js +211 -0
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/update.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/chat-stream/mapper.js +10 -3
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/agent-plugins.d.ts +3 -0
- package/dist/src/gateway/hono/routes/agent-plugins.js +166 -0
- package/dist/src/gateway/hono/routes/agent-stream.js +14 -0
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +4 -2
- package/dist/src/gateway/hono/routes/chat-previews.d.ts +3 -0
- package/dist/src/gateway/hono/routes/chat-previews.js +41 -0
- package/dist/src/gateway/hono/routes/connection-waits.js +4 -2
- package/dist/src/gateway/hono/routes/index.js +2 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/local-apps.js +71 -39
- package/dist/src/gateway/hono/routes/mcp.js +48 -21
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +4 -0
- package/dist/src/gateway/hono/routes/session-input-handler.js +22 -0
- package/dist/src/gateway/hono/routes/side-chats.js +11 -0
- package/dist/src/gateway/service/agent-runner.js +7 -1
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service/marketplace-service.d.ts +1 -0
- package/dist/src/gateway/service/marketplace-service.js +15 -1
- package/dist/src/gateway/service/session-input-coordinator.js +3 -3
- package/dist/src/gateway/service.d.ts +5 -1
- package/dist/src/gateway/service.js +19 -5
- package/dist/src/gateway/side-chat/index.d.ts +3 -1
- package/dist/src/gateway/side-chat/index.js +2 -1
- package/dist/src/gateway/side-chat/manager.d.ts +16 -0
- package/dist/src/gateway/side-chat/manager.js +40 -6
- package/dist/src/gateway/side-chat/promotion-service.d.ts +19 -0
- package/dist/src/gateway/side-chat/promotion-service.js +111 -0
- package/dist/src/gateway/side-chat/run-service.js +1 -0
- package/dist/src/gateway/side-chat/types.d.ts +1 -1
- package/dist/src/local-apps/artifact-files.d.ts +3 -0
- package/dist/src/local-apps/artifact-files.js +45 -0
- package/dist/src/local-apps/capabilities/write.js +1 -1
- package/dist/src/local-apps/fix-guidance.d.ts +3 -0
- package/dist/src/local-apps/fix-guidance.js +75 -0
- package/dist/src/local-apps/index.d.ts +2 -1
- package/dist/src/local-apps/scaffold.d.ts +5 -0
- package/dist/src/local-apps/scaffold.js +18 -5
- package/dist/src/local-apps/service.d.ts +18 -3
- package/dist/src/local-apps/service.js +106 -64
- package/dist/src/local-apps/snapshot-store.d.ts +8 -0
- package/dist/src/local-apps/snapshot-store.js +68 -0
- package/dist/src/local-apps/types.d.ts +4 -87
- package/dist/src/notes/service.js +1 -1
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/session/client-history.d.ts +3 -1
- package/dist/src/session/client-history.js +10 -3
- package/dist/src/session/index.d.ts +1 -1
- package/dist/src/session/manager.d.ts +4 -0
- package/dist/src/session/manager.js +6 -0
- package/dist/src/session/session-context-for-llm.d.ts +12 -1
- package/dist/src/session/session-context-for-llm.js +16 -2
- package/dist/src/session/store.d.ts +14 -0
- package/dist/src/session/store.js +17 -0
- package/dist/src/session/stored-rows-to-file-entries.js +10 -1
- package/dist/src/session/transcript-outline.js +10 -3
- package/dist/src/storage/sqlite/connection-wait-repository.js +9 -3
- package/dist/src/storage/sqlite/migrations/202_chat_previews.sql +26 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/row-mappers.js +6 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +2 -2
- package/dist/src/voice/tts/audio.js +1 -1
- package/dist/src/work-discovery/service.js +2 -2
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +4 -4
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BGCqlTcR.js +0 -1
- package/dist/gateway/static/root/assets/api-DEneywgz.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-vC87gAyb.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-CzYmREol.js +0 -7
- package/dist/gateway/static/root/assets/browser-settings-page-BxaSzUIU.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-D0S3DuAD.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CFCu-8da.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-CENp82yt.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-g_KTZWCb.js +0 -2
- package/dist/gateway/static/root/assets/device-pairing-wizard-DO7jp0ep.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-BkeSEBxk.js +0 -1
- package/dist/gateway/static/root/assets/home-page-KoQXV4hp.js +0 -1
- package/dist/gateway/static/root/assets/index-ZxnWUdPv.css +0 -1
- package/dist/gateway/static/root/assets/index-u4709aCa.js +0 -89
- package/dist/gateway/static/root/assets/local-app-workbench-page-7QX0YFa7.js +0 -2
- package/dist/gateway/static/root/assets/local-apps-page-RSAl-NhO.js +0 -1
- package/dist/gateway/static/root/assets/management-settings-C_cb0Kue.js +0 -1
- package/dist/gateway/static/root/assets/messages-M5xl1fHE.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-CVWst-Er.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-BFwCgIls.js +0 -8
- package/dist/gateway/static/root/assets/product-delivery-chCjIpvu.js +0 -1
- package/dist/gateway/static/root/assets/product-open-page-BIGvTs9n.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-BFEtpkcf.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-CHr-P2z4.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-PhEyHSOb.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-CmIhlHPS.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CCOTu1jb.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-CG1sll8V.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-Byq23h9c.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-D5q-wk_d.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-DE3ZeJL3.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-DGZaETmN.js +0 -6
package/dist/src/config/index.js
CHANGED
|
@@ -2,15 +2,15 @@ import { ENV_VARS, XOPC_DB_FILENAME, resolveHomeDir, resolveStateDir, resolveXop
|
|
|
2
2
|
import { TelegramAccountConfigSchema, TelegramConfigSchema, TelegramGroupConfigSchema, TelegramTopicConfigSchema } from "../../extensions/telegram/src/config-schema.js";
|
|
3
3
|
import { WeixinAccountConfigSchema, WeixinConfigSchema } from "../../extensions/weixin/src/config-schema.js";
|
|
4
4
|
import { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentsConfigSchema, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CommandsConfigSchema, ConfigSchema, ConnectorsConfigSchema, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewayScenesConfigSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GatewayWebchatConfigSchema, HeartbeatConfigSchema, McpConfigSchema, McpOAuthConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelCatalogConfigSchema, ModelsDevConfigSchema, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, RuntimeToolsConfigSchema, STTConfigSchema, STTFallbackConfigSchema, STTProviderConfigSchema, SearchProviderEntrySchema, SessionConfigSchema, SessionDmScopeSchema, SessionResetByTypeSchema, SessionResetConfigSchema, SessionResetModeSchema, SessionScopeSchema, SessionStorageConfigSchema, TTSConfigSchema, TTSEdgeConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSProviderConfigSchema, TTSSummarizationConfigSchema, ToolsConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, TuiConfigSchema, TunnelConfigSchema, TunnelConsentSchema, UpdateAutoConfigSchema, UpdateConfigSchema, VoiceConfigSchema, VoiceRefinementConfigSchema, WebSearchConfigSchema, WebToolsConfigSchema, WebsiteBlocklistSchema, WorkspaceConfigSchema, WorkspaceImportConfigSchema, getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, getAgentDefaultModelRef, init_schema, parseModelRef } from "./schema.js";
|
|
5
|
-
import {
|
|
5
|
+
import { applyConfigOverrides, getConfigOverrides, resetConfigOverrides, setConfigOverride, unsetConfigOverride } from "./runtime-overrides.js";
|
|
6
6
|
import { expandWorkspacePathString, init_workspace_path, normalizeWorkspaceDir, resolveWorkspaceRoot } from "./workspace-path.js";
|
|
7
7
|
import { resolveDefaultAgentWorkspaceDir } from "./workspace-defaults.js";
|
|
8
8
|
import { resolveAgentDir as resolveAgentDir$1, resolveAgentHomeDir as resolveAgentHomeDir$1, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
9
|
+
import { extractProfileAgentId, resolveEffectiveAgentConfigForAgent, resolveEffectiveAgentConfigForSession, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "./agent-profile.js";
|
|
9
10
|
import { FILENAMES, WORKSPACE_FILES, existsSync, hasBundledExtensionManifest, init_paths, resolveAgentAuthProfilesPath, resolveAgentDir, resolveAgentHomeDir, resolveAgentProfileDir, resolveAgentProfileMarkdownPath, resolveAuthProfilesPath, resolveBinDir, resolveBundledExtensionsDir, resolveBundledSkillsDir, resolveConfigPath, resolveCredentialsDir, resolveExtensionSdkPath, resolveExtensionsDir, resolveExtensionsLockPath, resolveInboxDir, resolveInboxMessagePath, resolveInboxPendingDir, resolveInboxProcessedDir, resolveLogPath, resolveLogsDir, resolveMcpOAuthPath, resolveModelsJsonPath, resolveNodeBinDir, resolveNodeBinPath, resolveNodeToolsDir, resolveNpmBinPath, resolveOAuthPath, resolvePidPath, resolveSkillPath, resolveSkillsCachePath, resolveSkillsDir, resolveSkillsLockPath, resolveSocketPath, resolveStatusPath, resolveToolsDir, resolveWorkspaceExtensionsDir, resolveWorkspaceFile, resolveWorkspaceStateDir, resolveWorkspaceStatePath, resolveXopcBinPath } from "./paths.js";
|
|
10
|
-
import { CustomModelSchema, ImageGenerationCapabilitiesSchema, ImageGenerationModelSchema, ImageGenerationProviderSchema, ModelOverrideSchema, ModelsJsonSchema, OpenAICompatSchema, OpenAICompletionsCompatSchema, OpenAIResponsesCompatSchema, OpenRouterRoutingSchema, ProviderConfigSchema, VercelGatewayRoutingSchema, getDefaultModelValues, init_models_json, loadModelsJson, modelsJsonExists, saveModelsJson, validateModelsConfig } from "./models-json.js";
|
|
11
11
|
import { assertConfigRewriteSafeForRunningGateway, init_loader, loadConfig, saveConfig } from "./loader.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { clearConfigValueCache, getAllowedCommands, getCacheStats, init_resolve_config_value, resolveConfigValue, resolveHeaders, testApiKeyResolution } from "./resolve-config-value.js";
|
|
13
|
+
import { CustomModelSchema, ImageGenerationCapabilitiesSchema, ImageGenerationModelSchema, ImageGenerationProviderSchema, ModelOverrideSchema, ModelsJsonSchema, OpenAICompatSchema, OpenAICompletionsCompatSchema, OpenAIResponsesCompatSchema, OpenRouterRoutingSchema, ProviderConfigSchema, VercelGatewayRoutingSchema, getDefaultModelValues, init_models_json, loadModelsJson, modelsJsonExists, saveModelsJson, validateModelsConfig } from "./models-json.js";
|
|
14
14
|
import { canonicalizeConfiguredMcpServer, isKnownCliMcpTypeAlias, normalizeConfiguredMcpServers, resolveXopcMcpTransportAlias } from "./mcp-config-normalize.js";
|
|
15
15
|
import { formatThinkingLevels, listThinkingLevels, normalizeElevatedMode, normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel, thinkLevelToNumber } from "../agent/transcript/thinking-types.js";
|
|
16
16
|
import { getWorkspacePath } from "./workspace-path-helpers.js";
|
|
@@ -2,10 +2,10 @@ import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
4
|
import { ConfigSchema, init_schema } from "./schema.js";
|
|
5
|
-
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
6
5
|
import { init_paths, resolveConfigPath } from "./paths.js";
|
|
7
|
-
import {
|
|
6
|
+
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
8
7
|
import { assertChannelPluginConfigs, init_validate_channel_configs } from "./validate-channel-configs.js";
|
|
8
|
+
import { init_resolution, setActivePlatformDiscovery } from "../platform/resolution.js";
|
|
9
9
|
import { init_lock, isGatewayConfigLockedByAnotherProcessSync } from "../gateway/lock.js";
|
|
10
10
|
import { dirname } from "path";
|
|
11
11
|
import { existsSync, mkdirSync, promises, readFileSync } from "fs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { ComputerProfileSchema, init_src } from "../../packages/computer-control-contract/src/index.js";
|
|
3
|
-
import { init_write_file_atomic, writeTextAtomicSync } from "../infra/write-file-atomic.js";
|
|
4
2
|
import { init_paths, resolveModelsJsonPath } from "./paths.js";
|
|
3
|
+
import { init_write_file_atomic, writeTextAtomicSync } from "../infra/write-file-atomic.js";
|
|
4
|
+
import { ComputerProfileSchema, init_src } from "../../packages/computer-control-contract/src/index.js";
|
|
5
5
|
import { init_model_policy, isComputerModel } from "../computer/model-policy.js";
|
|
6
6
|
import { existsSync, readFileSync } from "fs";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { ComputerConfigSchema, init_config } from "../computer/config.js";
|
|
2
3
|
import { AgentModelsOverrideSchema, AgentsConfigSchema as AgentsConfigSchema$1, DEFAULT_AGENT_MODEL_REF, DEFAULT_SKILL_POLICY, ImageGenerationRouteSchema, ModelRouteSchema } from "../agent-config/schema.js";
|
|
3
4
|
import { init_agent_config } from "../agent-config/index.js";
|
|
4
|
-
import { ComputerConfigSchema, init_config } from "../computer/config.js";
|
|
5
5
|
import { DEFAULT_CONTEXT_COMPACTION_POLICY, UserContextConfigSchema, init_config as init_config$1 } from "../user-context/config.js";
|
|
6
6
|
import { init_default_model } from "./default-model.js";
|
|
7
7
|
import { init_public_url, validatePublicUrl } from "./public-url.js";
|
|
@@ -236,7 +236,7 @@ var init_schema = __esmMin((() => {
|
|
|
236
236
|
});
|
|
237
237
|
WebSearchConfigSchema = z.object({
|
|
238
238
|
maxResults: z.number().default(5),
|
|
239
|
-
/** Ordered
|
|
239
|
+
/** Ordered manual providers; when none are usable, try XOPC Cloud then HTML fallback. */
|
|
240
240
|
providers: z.array(SearchProviderEntrySchema).default([])
|
|
241
241
|
});
|
|
242
242
|
WebsiteBlocklistSchema = z.object({
|
|
@@ -11,7 +11,7 @@ function selectConnectorAccount(input) {
|
|
|
11
11
|
principalId: installation.principalId,
|
|
12
12
|
connectorId: installation.connectorId
|
|
13
13
|
}).filter((connection) => connection.status === "active" && canAccessConnectorAccount(connection, installation, input.agentId) && (!input.accept || input.accept(connection))));
|
|
14
|
-
const bindings = input.conversationId ? connectionBindings(input.conversationId).filter((binding) => binding.connectorId === installation.connectorId) : [];
|
|
14
|
+
const bindings = input.conversationId ? connectionBindings(input.conversationId).filter((binding) => binding.target.type === "connector" && binding.target.connectorId === installation.connectorId) : [];
|
|
15
15
|
const requested = input.requestedAccountId ?? (bindings.length === 1 ? bindings[0]?.accountId : void 0);
|
|
16
16
|
if (requested && bindings.length && !bindings.some((binding) => binding.accountId === requested)) throw new Error("This account is not selected for the current objective.");
|
|
17
17
|
const connection = requested ? candidates.find((candidate) => candidate.accountId === requested) : bindings.length > 1 ? void 0 : candidates.length === 1 ? candidates[0] : void 0;
|
|
@@ -5,7 +5,10 @@ export declare function connectionCandidates(query: string): {
|
|
|
5
5
|
}[];
|
|
6
6
|
export declare function resolveConnectionCandidate(ref: string): {
|
|
7
7
|
key: string;
|
|
8
|
-
|
|
8
|
+
target: {
|
|
9
|
+
type: "connector";
|
|
10
|
+
connectorId: string;
|
|
11
|
+
};
|
|
9
12
|
label: string;
|
|
10
13
|
capabilities: string[];
|
|
11
14
|
};
|
|
@@ -59,7 +59,10 @@ function resolveConnectionCandidate(ref) {
|
|
|
59
59
|
const cli = getConnectorDefinition(ref);
|
|
60
60
|
if (cli?.runtime.type === "cli") return {
|
|
61
61
|
key: `${ref}:default`,
|
|
62
|
-
|
|
62
|
+
target: {
|
|
63
|
+
type: "connector",
|
|
64
|
+
connectorId: ref
|
|
65
|
+
},
|
|
63
66
|
label: cli.displayName,
|
|
64
67
|
capabilities: Object.entries(getCliAdapter(cli.runtime.adapterId).curatedActions).filter(([, scope]) => scope === "read").map(([id]) => id)
|
|
65
68
|
};
|
|
@@ -68,7 +71,10 @@ function resolveConnectionCandidate(ref) {
|
|
|
68
71
|
if (!item || !definition) throw new Error("Unknown connection candidate. Search for a supported app first.");
|
|
69
72
|
return {
|
|
70
73
|
key: `${ref}:default`,
|
|
71
|
-
|
|
74
|
+
target: {
|
|
75
|
+
type: "connector",
|
|
76
|
+
connectorId: ref
|
|
77
|
+
},
|
|
72
78
|
label: definition.displayName,
|
|
73
79
|
capabilities: item.capabilities
|
|
74
80
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ConnectionNeed } from '@xopcai/gateway-contract';
|
|
2
2
|
export declare function isToolInputSchema(value: unknown): value is Record<string, unknown>;
|
|
3
|
-
export declare function capabilityActions(need:
|
|
4
|
-
export declare function missingConnectionCapabilities(need:
|
|
3
|
+
export declare function capabilityActions(need: ConnectionNeed): string[][];
|
|
4
|
+
export declare function missingConnectionCapabilities(need: ConnectionNeed, actions: Set<string>): string[];
|
|
@@ -28,7 +28,9 @@ function isToolInputSchema(value) {
|
|
|
28
28
|
return Boolean(value && typeof value === "object" && !Array.isArray(value) && value.type === "object");
|
|
29
29
|
}
|
|
30
30
|
function capabilityActions(need) {
|
|
31
|
-
|
|
31
|
+
if (need.target.type !== "connector") return [];
|
|
32
|
+
const connectorId = need.target.connectorId;
|
|
33
|
+
return need.capabilities.map((capability) => /^[A-Z]+_/.test(capability) ? [capability] : CAPABILITY_ACTIONS[connectorId]?.[capability] ?? []);
|
|
32
34
|
}
|
|
33
35
|
function missingConnectionCapabilities(need, actions) {
|
|
34
36
|
return capabilityActions(need).flatMap((alternatives, index) => alternatives.some((action) => actions.has(action)) ? [] : [need.capabilities[index]]);
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import type { Config } from '../config/schema.js';
|
|
2
2
|
import type { SessionInput } from '../storage/sqlite/session-input-repository.js';
|
|
3
3
|
import { ComposioSessionsAdapter } from './composio-sessions.js';
|
|
4
|
+
import { type PluginMcpRecovery } from './plugin-mcp-recovery.js';
|
|
4
5
|
import type { ConnectionWaitSnapshot } from '@xopcai/gateway-contract';
|
|
5
6
|
export type ConnectionAction = {
|
|
6
7
|
waitId: string;
|
|
7
8
|
expectedTranscriptId: string;
|
|
8
9
|
expectedVersion: number;
|
|
9
10
|
idempotencyKey: string;
|
|
10
|
-
action: 'connect' | 'check' | 'continue' | 'skip' | 'cancel' | 'select_account' | 'confirm_scope' | 'replace_source';
|
|
11
|
+
action: 'connect' | 'check' | 'continue' | 'skip' | 'cancel' | 'select_account' | 'confirm_scope' | 'replace_source' | 'submit_callback';
|
|
11
12
|
needKey?: string;
|
|
12
13
|
accountId?: string;
|
|
13
14
|
candidateRef?: string;
|
|
15
|
+
callbackUrl?: string;
|
|
14
16
|
};
|
|
15
17
|
/** Authorization lives at click time. Chat history contains only immutable explanations. */
|
|
16
18
|
export declare class ConnectionRecoveryService {
|
|
@@ -29,13 +31,16 @@ export declare class ConnectionRecoveryService {
|
|
|
29
31
|
}>;
|
|
30
32
|
drain: (conversationId: string) => void;
|
|
31
33
|
adapter?: ComposioSessionsAdapter;
|
|
34
|
+
pluginMcp?: PluginMcpRecovery;
|
|
32
35
|
});
|
|
33
36
|
private get adapter();
|
|
37
|
+
private get pluginMcp();
|
|
34
38
|
snapshot(conversationId: string): ConnectionWaitSnapshot;
|
|
35
39
|
private view;
|
|
36
40
|
private ensureInstallation;
|
|
37
41
|
private checkCapabilities;
|
|
38
42
|
private syncConnections;
|
|
43
|
+
private syncPluginMcpNeeds;
|
|
39
44
|
preflight(input: SessionInput): Promise<boolean>;
|
|
40
45
|
act(conversationId: string, action: ConnectionAction): Promise<{
|
|
41
46
|
snapshot: ConnectionWaitSnapshot;
|
|
@@ -19,6 +19,7 @@ import { capabilityActions, isToolInputSchema, missingConnectionCapabilities } f
|
|
|
19
19
|
import { resolveConnectionCandidate } from "./connection-candidates.js";
|
|
20
20
|
import { installConnector } from "./install.js";
|
|
21
21
|
import { persistConfigMutation } from "../config/config-mutation.js";
|
|
22
|
+
import { HostPluginMcpRecovery } from "./plugin-mcp-recovery.js";
|
|
22
23
|
import { randomUUID } from "node:crypto";
|
|
23
24
|
//#region src/connectors/connection-recovery-service.ts
|
|
24
25
|
init_transaction();
|
|
@@ -36,6 +37,9 @@ const SCOPE_ORDER = {
|
|
|
36
37
|
};
|
|
37
38
|
const INTENT_TTL = 30 * 6e4;
|
|
38
39
|
const ATTEMPT_TTL = 10 * 6e4;
|
|
40
|
+
function isConnectorNeed(need) {
|
|
41
|
+
return need.target.type === "connector";
|
|
42
|
+
}
|
|
39
43
|
/** Authorization lives at click time. Chat history contains only immutable explanations. */
|
|
40
44
|
var ConnectionRecoveryService = class {
|
|
41
45
|
busy = /* @__PURE__ */ new Set();
|
|
@@ -77,6 +81,9 @@ var ConnectionRecoveryService = class {
|
|
|
77
81
|
get adapter() {
|
|
78
82
|
return this.deps.adapter ?? new ComposioSessionsAdapter();
|
|
79
83
|
}
|
|
84
|
+
get pluginMcp() {
|
|
85
|
+
return this.deps.pluginMcp ?? new HostPluginMcpRecovery(this.deps.getConfig);
|
|
86
|
+
}
|
|
80
87
|
snapshot(conversationId) {
|
|
81
88
|
if (!connectorPrincipalForSession(conversationId).isLocalOwner) throw new Error("This connection belongs to another principal.");
|
|
82
89
|
const transcriptId = readCurrentTranscriptId(getSqliteDatabase(), conversationId);
|
|
@@ -90,13 +97,25 @@ var ConnectionRecoveryService = class {
|
|
|
90
97
|
}
|
|
91
98
|
view(wait, verifiedIds) {
|
|
92
99
|
const needs = wait.needs.map((need) => {
|
|
93
|
-
|
|
94
|
-
|
|
100
|
+
if (need.target.type === "plugin-mcp") {
|
|
101
|
+
const availability = this.pluginMcp.availability(need.target);
|
|
102
|
+
const phase = !availability.available || need.connectionId && need.capabilityError ? "blocked" : need.connectionId === need.target.serverId ? "ready" : need.attempt && need.attempt.expiresAt > Date.now() ? "authorizing" : need.unavailable ? "reconnect" : "connect";
|
|
103
|
+
return {
|
|
104
|
+
...need,
|
|
105
|
+
phase,
|
|
106
|
+
accounts: [],
|
|
107
|
+
alternatives: [],
|
|
108
|
+
...availability.reason || need.capabilityError ? { reason: availability.reason ?? need.capabilityError } : {}
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
const id = need.target.connectorId;
|
|
112
|
+
const instance = listConnectorInstances(this.deps.getConfig()).find((instance) => instance.connectorId === id);
|
|
113
|
+
const installation = getConnectorInstallation(`${id}-${wait.principalId}`);
|
|
95
114
|
const cli = instance?.materialized.type === "cli" ? getCliAdapter(instance.materialized.adapterId) : void 0;
|
|
96
115
|
const scopeBlocked = Math.max(1, ...need.capabilities.filter((capability) => cli || /^[A-Z]+_/.test(capability)).map((capability) => SCOPE_ORDER[cli ? cli.curatedActions[capability] ?? "read" : scopeForComposioAction(capability).scope])) > SCOPE_ORDER[installation?.maxScope ?? "read"];
|
|
97
116
|
const all = listConnectorConnections({
|
|
98
117
|
principalId: wait.principalId,
|
|
99
|
-
connectorId:
|
|
118
|
+
connectorId: id
|
|
100
119
|
});
|
|
101
120
|
const requested = need.accountId ? all.find((connection) => connection.accountId === need.accountId) : void 0;
|
|
102
121
|
const blocked = scopeBlocked || instance?.enabled === false || installation?.enabled === false || installation?.selectedAccountIds?.length === 0 || Boolean(installation && requested && !canAccessConnectorAccount(requested, installation, wait.agentId)) || Boolean(installation?.allowedAgentIds.length && !installation.allowedAgentIds.includes(wait.agentId));
|
|
@@ -115,9 +134,9 @@ var ConnectionRecoveryService = class {
|
|
|
115
134
|
"revoked",
|
|
116
135
|
"failed"
|
|
117
136
|
].includes(connection.status)) ? "reconnect" : "connect";
|
|
118
|
-
const alternatives = ["composio-gmail", "composio-outlook"].includes(
|
|
119
|
-
candidateRef:
|
|
120
|
-
label: getConnectorDefinition(
|
|
137
|
+
const alternatives = ["composio-gmail", "composio-outlook"].includes(id) ? ["composio-gmail", "composio-outlook"].filter((candidate) => candidate !== id).map((candidate) => ({
|
|
138
|
+
candidateRef: candidate,
|
|
139
|
+
label: getConnectorDefinition(candidate)?.displayName ?? candidate
|
|
121
140
|
})) : [];
|
|
122
141
|
return {
|
|
123
142
|
...need,
|
|
@@ -174,14 +193,16 @@ var ConnectionRecoveryService = class {
|
|
|
174
193
|
}))
|
|
175
194
|
}, verified).needs;
|
|
176
195
|
return Promise.all(wait.needs.map(async (need) => {
|
|
196
|
+
if (need.target.type === "plugin-mcp") return need;
|
|
177
197
|
if (views.find((view) => view.key === need.key)?.phase !== "ready") return {
|
|
178
198
|
...need,
|
|
179
199
|
capabilityError: void 0
|
|
180
200
|
};
|
|
181
201
|
try {
|
|
182
|
-
const
|
|
202
|
+
const id = need.target.connectorId;
|
|
203
|
+
const instance = listConnectorInstances(this.deps.getConfig()).find((instance) => instance.connectorId === id && instance.enabled);
|
|
183
204
|
if (!instance) throw new Error("Connector setup is unavailable");
|
|
184
|
-
const definition = getInstalledConnectorDefinition(this.deps.getConfig(), instance.instanceId) ?? getConnectorDefinition(
|
|
205
|
+
const definition = getInstalledConnectorDefinition(this.deps.getConfig(), instance.instanceId) ?? getConnectorDefinition(id);
|
|
185
206
|
if (definition?.runtime.type === "cli") {
|
|
186
207
|
const selected = views.find((view) => view.key === need.key);
|
|
187
208
|
const connection = selected?.connectionId ? getConnectorConnection(selected.connectionId) : void 0;
|
|
@@ -211,7 +232,7 @@ var ConnectionRecoveryService = class {
|
|
|
211
232
|
const missing = missingConnectionCapabilities(need, new Set(Object.entries(schemas && typeof schemas === "object" ? schemas : {}).filter(([action, value]) => value && typeof value === "object" && isToolInputSchema(value.inputSchema) && isComposioActionAllowedByCatalog(action)).map(([action]) => action)));
|
|
212
233
|
if (missing.length) log.warn({
|
|
213
234
|
conversationId: wait.conversationId,
|
|
214
|
-
connectorId:
|
|
235
|
+
connectorId: id,
|
|
215
236
|
missingCapabilities: missing
|
|
216
237
|
}, "Connected app lacks required tool contracts");
|
|
217
238
|
return {
|
|
@@ -222,7 +243,7 @@ var ConnectionRecoveryService = class {
|
|
|
222
243
|
log.warn({
|
|
223
244
|
err,
|
|
224
245
|
conversationId: wait.conversationId,
|
|
225
|
-
connectorId: need.connectorId
|
|
246
|
+
connectorId: need.target.connectorId
|
|
226
247
|
}, "Connected app capability check failed");
|
|
227
248
|
return {
|
|
228
249
|
...need,
|
|
@@ -235,9 +256,10 @@ var ConnectionRecoveryService = class {
|
|
|
235
256
|
const config = this.deps.getConfig();
|
|
236
257
|
const instances = listConnectorInstances(config);
|
|
237
258
|
const cliIds = new Set(instances.filter((item) => item.materialized.type === "cli").map((item) => item.connectorId));
|
|
238
|
-
const
|
|
259
|
+
const connectorNeeds = wait.needs.filter(isConnectorNeed);
|
|
260
|
+
const fresh = connectorNeeds.some((need) => !cliIds.has(need.target.connectorId)) ? await this.adapter.syncConnections({ principalId: wait.principalId }) : [];
|
|
239
261
|
for (const connection of currentAccountConnections(listConnectorConnections({ principalId: wait.principalId }))) {
|
|
240
|
-
if (connection.provider !== "cli" || !
|
|
262
|
+
if (connection.provider !== "cli" || !connectorNeeds.some((need) => need.target.connectorId === connection.connectorId)) continue;
|
|
241
263
|
const policy = getConnectorInstallation(`${connection.connectorId}-${wait.principalId}`);
|
|
242
264
|
if (!policy || !canAccessConnectorAccount(connection, policy, wait.agentId)) continue;
|
|
243
265
|
const instanceId = connection.metadata.runtimeInstanceId;
|
|
@@ -247,6 +269,38 @@ var ConnectionRecoveryService = class {
|
|
|
247
269
|
}
|
|
248
270
|
return fresh;
|
|
249
271
|
}
|
|
272
|
+
async syncPluginMcpNeeds(wait) {
|
|
273
|
+
return Promise.all(wait.needs.map(async (need) => {
|
|
274
|
+
if (need.target.type !== "plugin-mcp") return need;
|
|
275
|
+
const status = await this.pluginMcp.status(need.target);
|
|
276
|
+
if (status.status === "connected") {
|
|
277
|
+
const verified = await this.pluginMcp.verify(need.target);
|
|
278
|
+
return {
|
|
279
|
+
...need,
|
|
280
|
+
connectionId: need.target.serverId,
|
|
281
|
+
unavailable: false,
|
|
282
|
+
attempt: void 0,
|
|
283
|
+
capabilityError: verified.ready ? void 0 : verified.error ?? "The connected MCP tools are unavailable."
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
if (status.status === "authorizing") return {
|
|
287
|
+
...need,
|
|
288
|
+
connectionId: void 0,
|
|
289
|
+
unavailable: false,
|
|
290
|
+
attempt: {
|
|
291
|
+
id: status.session?.id ?? need.attempt?.id ?? randomUUID(),
|
|
292
|
+
expiresAt: status.session?.expiresAt ?? Date.now() + ATTEMPT_TTL
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
return {
|
|
296
|
+
...need,
|
|
297
|
+
connectionId: void 0,
|
|
298
|
+
unavailable: true,
|
|
299
|
+
attempt: void 0,
|
|
300
|
+
capabilityError: status.status === "error" ? status.session?.error : void 0
|
|
301
|
+
};
|
|
302
|
+
}));
|
|
303
|
+
}
|
|
250
304
|
async preflight(input) {
|
|
251
305
|
if (input.kind !== "connection_resume") return true;
|
|
252
306
|
const wait = input.payload ? getConnectionWait(input.payload.waitId) : void 0;
|
|
@@ -255,12 +309,13 @@ var ConnectionRecoveryService = class {
|
|
|
255
309
|
try {
|
|
256
310
|
const fresh = await this.syncConnections(wait);
|
|
257
311
|
const verified = new Set(fresh.filter((item) => item.status === "active").map((item) => item.id));
|
|
258
|
-
wait.needs = await this.
|
|
259
|
-
|
|
260
|
-
wait.needs = wait.needs.map((need) => ({
|
|
312
|
+
wait.needs = await this.syncPluginMcpNeeds(wait);
|
|
313
|
+
wait.needs = wait.needs.map((need) => need.target.type === "plugin-mcp" ? need : {
|
|
261
314
|
...need,
|
|
262
315
|
unavailable: !fresh.some((item) => item.id === need.connectionId && item.status === "active")
|
|
263
|
-
})
|
|
316
|
+
});
|
|
317
|
+
wait.needs = await this.checkCapabilities(wait, verified);
|
|
318
|
+
const ready = this.view(wait, verified).needs.every((need) => need.phase === "ready");
|
|
264
319
|
if (getConnectionWait(wait.id)?.version !== wait.version) return false;
|
|
265
320
|
if (ready && wait.intent && wait.intent.validUntil > Date.now() && wait.intent.objectiveRevision === wait.objectiveRevision) return true;
|
|
266
321
|
} catch {}
|
|
@@ -319,8 +374,51 @@ var ConnectionRecoveryService = class {
|
|
|
319
374
|
const need = wait.needs.find((need) => need.key === action.needKey);
|
|
320
375
|
if (!need) throw new Error("Unknown connection requirement.");
|
|
321
376
|
if (this.view(wait).needs.find((item) => item.key === need.key)?.phase === "blocked") throw new Error("Connector policy blocks this connection.");
|
|
322
|
-
|
|
323
|
-
|
|
377
|
+
if (need.target.type === "plugin-mcp") {
|
|
378
|
+
const serverId = need.target.serverId;
|
|
379
|
+
const attemptId = randomUUID();
|
|
380
|
+
wait = updateConnectionWait({
|
|
381
|
+
...wait,
|
|
382
|
+
intent: {
|
|
383
|
+
objectiveRevision: wait.objectiveRevision,
|
|
384
|
+
validUntil: Date.now() + INTENT_TTL
|
|
385
|
+
},
|
|
386
|
+
needs: wait.needs.map((item) => item.key === need.key ? {
|
|
387
|
+
...item,
|
|
388
|
+
unavailable: false,
|
|
389
|
+
capabilityError: void 0,
|
|
390
|
+
attempt: {
|
|
391
|
+
id: attemptId,
|
|
392
|
+
expiresAt: Date.now() + ATTEMPT_TTL
|
|
393
|
+
}
|
|
394
|
+
} : item)
|
|
395
|
+
}, wait.version);
|
|
396
|
+
publishConnectionWait(conversationId);
|
|
397
|
+
const auth = await this.pluginMcp.start(need.target);
|
|
398
|
+
const latest = getConnectionWait(wait.id);
|
|
399
|
+
if (!latest || latest.version !== wait.version || latest.status !== "open") throw new Error("WAIT_CHANGED");
|
|
400
|
+
wait = updateConnectionWait({
|
|
401
|
+
...wait,
|
|
402
|
+
needs: wait.needs.map((item) => item.key === need.key ? {
|
|
403
|
+
...item,
|
|
404
|
+
attempt: auth.status === "authorizing" ? {
|
|
405
|
+
id: auth.session?.id ?? attemptId,
|
|
406
|
+
expiresAt: auth.session?.expiresAt ?? Date.now() + ATTEMPT_TTL
|
|
407
|
+
} : void 0,
|
|
408
|
+
connectionId: auth.status === "connected" ? serverId : void 0,
|
|
409
|
+
unavailable: auth.status === "error",
|
|
410
|
+
capabilityError: auth.status === "error" ? auth.session?.error : void 0
|
|
411
|
+
} : item)
|
|
412
|
+
}, wait.version);
|
|
413
|
+
publishConnectionWait(conversationId);
|
|
414
|
+
return {
|
|
415
|
+
snapshot: this.snapshot(conversationId),
|
|
416
|
+
authorizationUrl: auth.session?.authorizationUrl
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
const id = need.target.connectorId;
|
|
420
|
+
const instance = listConnectorInstances(this.deps.getConfig()).find((item) => item.connectorId === id);
|
|
421
|
+
const definition = (instance ? getInstalledConnectorDefinition(this.deps.getConfig(), instance.instanceId) : void 0) ?? getConnectorDefinition(id);
|
|
324
422
|
if (definition?.runtime.type === "cli") {
|
|
325
423
|
updateConnectionWait({
|
|
326
424
|
...wait,
|
|
@@ -332,7 +430,7 @@ var ConnectionRecoveryService = class {
|
|
|
332
430
|
publishConnectionWait(conversationId);
|
|
333
431
|
return {
|
|
334
432
|
snapshot: this.snapshot(conversationId),
|
|
335
|
-
authorizationUrl: `/#/connectors?connector=${encodeURIComponent(
|
|
433
|
+
authorizationUrl: `/#/connectors?connector=${encodeURIComponent(id)}`
|
|
336
434
|
};
|
|
337
435
|
}
|
|
338
436
|
if (definition?.runtime.type !== "composio" || definition.runtime.role !== "toolkit") throw new Error("Unsupported connector.");
|
|
@@ -353,8 +451,8 @@ var ConnectionRecoveryService = class {
|
|
|
353
451
|
}, wait.version);
|
|
354
452
|
publishConnectionWait(conversationId);
|
|
355
453
|
const config = this.deps.getConfig();
|
|
356
|
-
await this.ensureInstallation(wait,
|
|
357
|
-
const installationId = `${
|
|
454
|
+
await this.ensureInstallation(wait, id);
|
|
455
|
+
const installationId = `${id}-${wait.principalId}`;
|
|
358
456
|
const auth = await this.adapter.authorize({
|
|
359
457
|
principalId: wait.principalId,
|
|
360
458
|
toolkit: definition.runtime.toolkit,
|
|
@@ -388,12 +486,20 @@ var ConnectionRecoveryService = class {
|
|
|
388
486
|
authorizationUrl: auth.connectUrl
|
|
389
487
|
};
|
|
390
488
|
} else {
|
|
489
|
+
if (action.action === "submit_callback") {
|
|
490
|
+
const need = wait.needs.find((need) => need.key === action.needKey);
|
|
491
|
+
if (!need || need.target.type !== "plugin-mcp") throw new Error("OAuth callback is unavailable.");
|
|
492
|
+
if (!action.callbackUrl || action.callbackUrl.length > 16384) throw new Error("Expected the complete OAuth callback URL.");
|
|
493
|
+
await this.pluginMcp.submitCallback(need.target, action.callbackUrl);
|
|
494
|
+
}
|
|
391
495
|
const fresh = await this.syncConnections(wait);
|
|
392
496
|
const verified = new Set(fresh.filter((item) => item.status === "active").map((item) => item.id));
|
|
393
497
|
const latest = getConnectionWait(wait.id);
|
|
394
498
|
if (!latest || latest.version !== wait.version || latest.status !== "open") throw new Error("WAIT_CHANGED");
|
|
395
499
|
let needs = wait.needs.map((need) => {
|
|
396
|
-
|
|
500
|
+
if (need.target.type === "plugin-mcp") return need;
|
|
501
|
+
const id = need.target.connectorId;
|
|
502
|
+
const authorized = fresh.find((item) => item.providerConnectionId === need.attempt?.connectionId && item.status === "active" && item.connectorId === id && (!need.accountId || item.accountId === need.accountId));
|
|
397
503
|
return authorized ? {
|
|
398
504
|
...need,
|
|
399
505
|
unavailable: false,
|
|
@@ -404,13 +510,19 @@ var ConnectionRecoveryService = class {
|
|
|
404
510
|
attempt: void 0
|
|
405
511
|
} : {
|
|
406
512
|
...need,
|
|
407
|
-
unavailable: !fresh.some((item) => item.connectorId ===
|
|
513
|
+
unavailable: !fresh.some((item) => item.connectorId === id && item.status === "active" && (!need.connectionId || item.id === need.connectionId) && (!need.accountId || item.accountId === need.accountId))
|
|
408
514
|
};
|
|
409
515
|
});
|
|
516
|
+
needs = await this.syncPluginMcpNeeds({
|
|
517
|
+
...wait,
|
|
518
|
+
needs
|
|
519
|
+
});
|
|
410
520
|
if (action.action === "select_account") {
|
|
411
521
|
const need = needs.find((item) => item.key === action.needKey);
|
|
412
|
-
|
|
413
|
-
|
|
522
|
+
if (!need || need.target.type !== "connector") throw new Error("Account selection is unavailable.");
|
|
523
|
+
const id = need.target.connectorId;
|
|
524
|
+
const connection = currentAccountConnections(fresh).find((item) => item.accountId === action.accountId && item.connectorId === id);
|
|
525
|
+
if (!connection || !this.view(wait, verified).needs.find((item) => item.key === need.key)?.accounts.some((item) => item.id === connection.accountId)) throw new Error("Account is unavailable.");
|
|
414
526
|
needs = needs.map((item) => item.key === need.key ? {
|
|
415
527
|
...item,
|
|
416
528
|
connectionId: connection.id,
|
|
@@ -422,7 +534,7 @@ var ConnectionRecoveryService = class {
|
|
|
422
534
|
for (const selected of this.view({
|
|
423
535
|
...wait,
|
|
424
536
|
needs
|
|
425
|
-
}, verified).needs) if (selected.phase === "ready" || selected.capabilityError && selected.connectionId) await this.ensureInstallation(wait, selected.connectorId);
|
|
537
|
+
}, verified).needs) if (selected.target.type === "connector" && (selected.phase === "ready" || selected.capabilityError && selected.connectionId)) await this.ensureInstallation(wait, selected.target.connectorId);
|
|
426
538
|
needs = await this.checkCapabilities({
|
|
427
539
|
...wait,
|
|
428
540
|
needs
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { PluginMcpConnectionTarget } from '@xopcai/gateway-contract';
|
|
2
|
+
import { type McpOAuthStatus } from '../agent/mcp/oauth/mcp-oauth-manager.js';
|
|
3
|
+
import type { Config } from '../config/schema.js';
|
|
4
|
+
export type PluginMcpAvailability = {
|
|
5
|
+
available: boolean;
|
|
6
|
+
reason?: string;
|
|
7
|
+
};
|
|
8
|
+
export type PluginMcpVerification = {
|
|
9
|
+
ready: boolean;
|
|
10
|
+
error?: string;
|
|
11
|
+
};
|
|
12
|
+
export interface PluginMcpRecovery {
|
|
13
|
+
availability(target: PluginMcpConnectionTarget): PluginMcpAvailability;
|
|
14
|
+
status(target: PluginMcpConnectionTarget): Promise<McpOAuthStatus>;
|
|
15
|
+
start(target: PluginMcpConnectionTarget): Promise<McpOAuthStatus>;
|
|
16
|
+
verify(target: PluginMcpConnectionTarget): Promise<PluginMcpVerification>;
|
|
17
|
+
submitCallback(target: PluginMcpConnectionTarget, callbackUrl: string): Promise<McpOAuthStatus>;
|
|
18
|
+
}
|
|
19
|
+
export declare class HostPluginMcpRecovery implements PluginMcpRecovery {
|
|
20
|
+
private readonly getConfig;
|
|
21
|
+
constructor(getConfig: () => Config);
|
|
22
|
+
availability(target: PluginMcpConnectionTarget): PluginMcpAvailability;
|
|
23
|
+
status(target: PluginMcpConnectionTarget): Promise<McpOAuthStatus>;
|
|
24
|
+
start(target: PluginMcpConnectionTarget): Promise<McpOAuthStatus>;
|
|
25
|
+
verify(target: PluginMcpConnectionTarget): Promise<PluginMcpVerification>;
|
|
26
|
+
submitCallback(target: PluginMcpConnectionTarget, callbackUrl: string): Promise<McpOAuthStatus>;
|
|
27
|
+
private resolveServer;
|
|
28
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { AgentPluginStore } from "../extensions/agent-plugins/store.js";
|
|
2
|
+
import { savePluginAuthBinding } from "../extensions/agent-plugins/auth.js";
|
|
3
|
+
import { loadMergedBundleMcpConfig } from "../agent/mcp/bundle-mcp-config.js";
|
|
4
|
+
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
5
|
+
import { getMcpOAuthManager } from "../agent/mcp/oauth/mcp-oauth-manager.js";
|
|
6
|
+
import { listBundleMcpServerCapabilitiesForGateway } from "../agent/mcp/bundle-mcp-gateway.js";
|
|
7
|
+
//#region src/connectors/plugin-mcp-recovery.ts
|
|
8
|
+
var HostPluginMcpRecovery = class {
|
|
9
|
+
constructor(getConfig) {
|
|
10
|
+
this.getConfig = getConfig;
|
|
11
|
+
}
|
|
12
|
+
availability(target) {
|
|
13
|
+
const plugin = new AgentPluginStore().get(target.pluginId);
|
|
14
|
+
if (!plugin) return {
|
|
15
|
+
available: false,
|
|
16
|
+
reason: "The plugin is no longer installed."
|
|
17
|
+
};
|
|
18
|
+
if (!plugin.receipt.enabled) return {
|
|
19
|
+
available: false,
|
|
20
|
+
reason: "Enable the plugin before connecting its account."
|
|
21
|
+
};
|
|
22
|
+
if (plugin.readiness === "blocked") return {
|
|
23
|
+
available: false,
|
|
24
|
+
reason: "Repair the plugin before connecting its account."
|
|
25
|
+
};
|
|
26
|
+
if (plugin.servers[target.serverName]?.type !== "streamable-http") return {
|
|
27
|
+
available: false,
|
|
28
|
+
reason: "This plugin server does not support OAuth."
|
|
29
|
+
};
|
|
30
|
+
return { available: true };
|
|
31
|
+
}
|
|
32
|
+
async status(target) {
|
|
33
|
+
const server = this.resolveServer(target);
|
|
34
|
+
return getMcpOAuthManager(server).status(target.serverId, server);
|
|
35
|
+
}
|
|
36
|
+
async start(target) {
|
|
37
|
+
const availability = this.availability(target);
|
|
38
|
+
if (!availability.available) throw new Error(availability.reason);
|
|
39
|
+
await savePluginAuthBinding(new AgentPluginStore(), target.pluginId, target.serverName, { mode: "oauth" });
|
|
40
|
+
const server = this.resolveServer(target);
|
|
41
|
+
return getMcpOAuthManager(server).start({
|
|
42
|
+
serverId: target.serverId,
|
|
43
|
+
rawServer: server,
|
|
44
|
+
cfg: this.getConfig()
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
async verify(target) {
|
|
48
|
+
const availability = this.availability(target);
|
|
49
|
+
if (!availability.available) return {
|
|
50
|
+
ready: false,
|
|
51
|
+
error: availability.reason
|
|
52
|
+
};
|
|
53
|
+
const status = await this.status(target);
|
|
54
|
+
if (status.status !== "connected") return {
|
|
55
|
+
ready: false,
|
|
56
|
+
error: status.session?.error
|
|
57
|
+
};
|
|
58
|
+
const cfg = this.getConfig();
|
|
59
|
+
const capabilities = await listBundleMcpServerCapabilitiesForGateway({
|
|
60
|
+
workspaceDir: getWorkspacePath(cfg) || "./workspace",
|
|
61
|
+
cfg,
|
|
62
|
+
serverId: target.serverId
|
|
63
|
+
});
|
|
64
|
+
if (capabilities.error) return {
|
|
65
|
+
ready: false,
|
|
66
|
+
error: capabilities.error.message
|
|
67
|
+
};
|
|
68
|
+
if (capabilities.toolCount === 0) return {
|
|
69
|
+
ready: false,
|
|
70
|
+
error: "The connected MCP server did not expose any tools."
|
|
71
|
+
};
|
|
72
|
+
return { ready: true };
|
|
73
|
+
}
|
|
74
|
+
async submitCallback(target, callbackUrl) {
|
|
75
|
+
const server = this.resolveServer(target);
|
|
76
|
+
return getMcpOAuthManager(server).submitCallback(target.serverId, server, callbackUrl);
|
|
77
|
+
}
|
|
78
|
+
resolveServer(target) {
|
|
79
|
+
const cfg = this.getConfig();
|
|
80
|
+
const server = loadMergedBundleMcpConfig({
|
|
81
|
+
workspaceDir: getWorkspacePath(cfg) || "./workspace",
|
|
82
|
+
cfg
|
|
83
|
+
}).config.mcpServers[target.serverId];
|
|
84
|
+
const origin = server?.xopcPlugin;
|
|
85
|
+
if (!server || origin?.id !== target.pluginId || origin.serverName !== target.serverName) throw new Error("Plugin MCP server is unavailable.");
|
|
86
|
+
return server;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
//#endregion
|
|
90
|
+
export { HostPluginMcpRecovery };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AgentPluginStore } from './store.js';
|
|
3
|
+
import { type PluginServer } from './validation.js';
|
|
4
|
+
declare const bindingSchema: z.ZodObject<{
|
|
5
|
+
serverName: z.ZodString;
|
|
6
|
+
mode: z.ZodEnum<{
|
|
7
|
+
none: "none";
|
|
8
|
+
auto: "auto";
|
|
9
|
+
oauth: "oauth";
|
|
10
|
+
"api-key": "api-key";
|
|
11
|
+
}>;
|
|
12
|
+
identityScope: z.ZodLiteral<"owner">;
|
|
13
|
+
endpointFingerprint: z.ZodString;
|
|
14
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
15
|
+
target: z.ZodEnum<{
|
|
16
|
+
headers: "headers";
|
|
17
|
+
env: "env";
|
|
18
|
+
}>;
|
|
19
|
+
key: z.ZodString;
|
|
20
|
+
provider: z.ZodString;
|
|
21
|
+
prefix: z.ZodString;
|
|
22
|
+
}, z.core.$strict>>;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
export type PluginAuthBinding = z.infer<typeof bindingSchema>;
|
|
25
|
+
export declare function pluginEndpointFingerprint(server: PluginServer): string;
|
|
26
|
+
export declare function readPluginAuthBinding(store: AgentPluginStore, id: string, name: string, server: PluginServer): PluginAuthBinding | undefined;
|
|
27
|
+
export declare function savePluginAuthBinding(store: AgentPluginStore, id: string, name: string, input: {
|
|
28
|
+
mode: PluginAuthBinding['mode'];
|
|
29
|
+
secrets?: Array<{
|
|
30
|
+
target: 'headers' | 'env';
|
|
31
|
+
key: string;
|
|
32
|
+
value: string;
|
|
33
|
+
prefix?: string;
|
|
34
|
+
}>;
|
|
35
|
+
}): Promise<void>;
|
|
36
|
+
export declare function applyPluginAuthBinding(raw: Record<string, unknown>, binding: PluginAuthBinding | undefined): Record<string, unknown>;
|
|
37
|
+
export declare function pluginOAuthScope(raw: unknown): string | undefined;
|
|
38
|
+
export declare function removePluginCredentials(store: AgentPluginStore, id: string): Promise<void>;
|
|
39
|
+
export {};
|