@xopcai/xopc 0.0.369 → 0.0.371
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 +59 -174
- package/README.zh-CN.md +59 -174
- package/dist/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/esm/_md.js +131 -0
- package/dist/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.js +30 -0
- package/dist/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/esm/sha2.js +252 -0
- package/dist/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/esm/sha256.js +16 -0
- package/dist/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js +66 -0
- package/dist/browser-ext/dist/sidepanel.js +21 -1
- 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-Stj17S9u.js → agent-avatar-dicebear-C8MqXy6W.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BLaL4law.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-BrysdA6F.js +1 -0
- package/dist/gateway/static/root/assets/agents-BJRyMNx2.js +66 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-pJFe6M6c.js → app-management-settings-panel-Bi02swpZ.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BrxSpBWa.js → appearance-settings-rr0qirDm.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-DegSl5Lh.js → apps-page-Sz3wl3lV.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BZQ_VHjp.js → automations-page-DqdbP0hD.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CxgKlA5d.js +6 -0
- package/dist/gateway/static/root/assets/{block-editor-3XjFv3kK.js → block-editor-CfVR1zGa.js} +3 -3
- package/dist/gateway/static/root/assets/browser-automations-page-DeYnh3mY.js +3 -0
- package/dist/gateway/static/root/assets/{browser-settings-page-ch2_bQF0.js → browser-settings-page-DDZvlGCD.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-DO-vfNKI.js → capabilities-CY4SiHcP.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-B48r0DDa.js → capabilities-gjQtMhKu.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-Bl6PZqx3.js +2 -0
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-NckMsJ5N.js → capabilities-settings-panel-B-MM4LJA.js} +4 -4
- package/dist/gateway/static/root/assets/{capability-header-actions-CY8KCO9j.js → capability-header-actions-CAiY7HK1.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-CHOS2CGa.js → channels-D1_fDkhu.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Bwknnb4c.js → chat-terminal-dock-D6slpF2a.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-B2xeFCSt.js → computer-settings-page-D1n_uQHN.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-C83DnAqK.js → connector-service-page-FvSCyJzn.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DroD-gQn.js +1 -0
- package/dist/gateway/static/root/assets/copy-text-row-C1gaJwlZ.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-Bq9GR-DU.js → date-picker-Bl-HqvGU.js} +1 -1
- package/dist/gateway/static/root/assets/dependency-picker-DY4nU-HL.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-BwsbQw8V.js → desktop-pet-_A89B2xw.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-sL9i44pP.js → desktop-pet-settings-BJWkGynu.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DJ_ITvkI.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BFlDmsS5.js → directory-picker-path-field-Bj2Cpmxs.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-7Z1Tp7-w.js → extension-debug-page-BfAtjhoK.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-uGqvb8QX.js → extension-page-BFjc1zDp.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-xlSyz4Z6.js → extension-provider-Br6LXyIj.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CKHgrjOs.js → extension-settings-page-oAwllsMb.js} +1 -1
- package/dist/gateway/static/root/assets/{fallback-models-BwQg0G1D.js → fallback-models-KHd6tw_t.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-F6D4A7N5.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-settings-BAQnSEMJ.js → gateway-settings-BIyhyiOq.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-CEjaIUTF.js +2 -0
- package/dist/gateway/static/root/assets/{imports-page-re1_Nh64.js → imports-page-ClFqRiGQ.js} +1 -1
- package/dist/gateway/static/root/assets/index-BGBkIIzM.css +1 -0
- package/dist/gateway/static/root/assets/index-GBFmI8im.js +106 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-B_xja9LN.js → keyboard-shortcuts-settings-Ca9_GJSQ.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CErdCrPX.js → local-app-workbench-page-BaK9zX1-.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-BPL2RXdK.js → local-apps-page-1CjSftZ3.js} +1 -1
- package/dist/gateway/static/root/assets/local-session-drafts-pox8evDV.js +1 -0
- package/dist/gateway/static/root/assets/logs-page-6joZBbcx.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-Cnubkklb.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-B6DHbMzT.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-CGZkIKdi.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-tf77xIz3.js → page-context-capture-button-y3QmhTu2.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-C_roXCJB.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-Dc3Y-Y7J.js → product-open-page-CSRYWt0f.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-MG_hmVA3.js → product-preview-content-DuOML6gs.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-v7xtnvha.js +1 -0
- package/dist/gateway/static/root/assets/{projects-page-MllfNLGA.js → projects-page-BuJCBT6n.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-Bs-C70el.js → remote-access-hub-DpHnyBnG.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DpJ5jNzR.js → runtime-tools-settings-panel-DTMTL0hy.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-Dpxamkw6.js → scenes-page-B0JqO_fM.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-DUeyQ1zh.js → schema-form-g4z7GH4W.js} +1 -1
- package/dist/gateway/static/root/assets/{send-session-input-Dgn4BRk_.js → send-session-input-BW40VHiL.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-BqlvrjPE.js +16 -0
- package/dist/gateway/static/root/assets/sessions-page-CftImbH7.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BkvbSieZ.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-DouHuBXt.js → settings-page-YD-U8BVw.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-q_X3kxw2.js +1 -0
- package/dist/gateway/static/root/assets/{share-link-dialog-DJTabLAM.js → share-link-dialog-HCHM8qnf.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-jw7h4t_B.js → share-preview-page-Ce6FNWt1.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-KHRg_-03.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-CfyX_0zN.js → skill-api-BpqDMkNB.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page-Bnfn51ks.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-DWf256TE.js → system-settings-panel-CncvC2CI.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-DE6N1ZQe.js → task-detail-page-BVJKdnMC.js} +2 -2
- package/dist/gateway/static/root/assets/{tunnel-api-BBm9esrY.js → tunnel-api-g7etuoaT.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-C93x89uW.js → usage-page-Dao1I-5F.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-C7Gaaai1.js → use-composer-attachments-DJya1hIL.js} +1 -1
- package/dist/gateway/static/root/assets/use-file-preview-expanded-C5ONO7sF.js +2 -0
- package/dist/gateway/static/root/assets/user-model-page-jr986ucl.js +2 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-Bs2MKiTv.js → work-discovery-overlay-CC3mr7tX.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BR_U_snV.js → workflow-run-setup-panel-CqpXZJxs.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-DOk6tBbK.js +6 -0
- package/dist/gateway/static/root/assets/{workspace-api-Si2o3inw.js → workspace-api-WhbMvdBE.js} +2 -2
- package/dist/gateway/static/root/index.html +18 -20
- package/dist/package.js +1 -1
- package/dist/packages/endpoint-tools-client/src/index.js +189 -0
- package/dist/packages/endpoint-tools-protocol/src/bridge.js +105 -0
- package/dist/packages/endpoint-tools-protocol/src/index.js +95 -2
- package/dist/packages/endpoint-tools-protocol/src/location.js +109 -0
- package/dist/packages/endpoint-tools-protocol/src/personal.js +149 -0
- package/dist/packages/gateway-contract/src/session-input-command.js +30 -5
- package/dist/src/agent/agent-manager.js +23 -27
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/embedded/codemode-extension.d.ts +7 -0
- package/dist/src/agent/embedded/codemode-extension.js +232 -0
- package/dist/src/agent/embedded/codemode-output.d.ts +2 -0
- package/dist/src/agent/embedded/codemode-output.js +34 -0
- package/dist/src/agent/embedded/external-tool-discovery.d.ts +6 -0
- package/dist/src/agent/embedded/external-tool-discovery.js +60 -0
- package/dist/src/agent/embedded/model-runtime.js +5 -2
- package/dist/src/agent/embedded/run-for-session.js +10 -1
- package/dist/src/agent/embedded/run-turn.js +10 -3
- package/dist/src/agent/embedded/session-runner.d.ts +9 -1
- package/dist/src/agent/embedded/session-runner.js +111 -23
- package/dist/src/agent/embedded/session-tool-result-guard.d.ts +2 -0
- package/dist/src/agent/embedded/session-tool-result-guard.js +17 -0
- package/dist/src/agent/embedded/subscribe-session.js +14 -4
- package/dist/src/agent/embedded/tool-metadata.d.ts +15 -0
- package/dist/src/agent/embedded/tool-metadata.js +38 -0
- package/dist/src/agent/embedded/tool-search-extension.d.ts +5 -0
- package/dist/src/agent/embedded/tool-search-extension.js +31 -0
- package/dist/src/agent/embedded/types.d.ts +7 -0
- package/dist/src/agent/embedded/xopc-tools-bridge.js +6 -0
- package/dist/src/agent/external-tools/endpoint-provider.d.ts +1 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +174 -53
- package/dist/src/agent/external-tools/extension-provider.js +8 -1
- package/dist/src/agent/external-tools/gateway-tools.d.ts +1 -1
- package/dist/src/agent/external-tools/gateway-tools.js +45 -22
- package/dist/src/agent/external-tools/index.js +46 -14
- package/dist/src/agent/external-tools/memory-provider.js +8 -1
- package/dist/src/agent/external-tools/read-policy.js +2 -1
- package/dist/src/agent/external-tools/service.d.ts +2 -0
- package/dist/src/agent/external-tools/service.js +25 -3
- package/dist/src/agent/external-tools/tool-registry.d.ts +14 -0
- package/dist/src/agent/external-tools/tool-registry.js +14 -0
- package/dist/src/agent/external-tools/types.d.ts +8 -1
- package/dist/src/agent/external-tools/types.js +0 -1
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/mcp/config.d.ts +18 -0
- package/dist/src/agent/mcp/{bundle-mcp-config.js → config.js} +8 -25
- package/dist/src/agent/mcp/native-mcp.d.ts +6 -0
- package/dist/src/agent/mcp/native-mcp.js +73 -0
- package/dist/src/agent/service.js +3 -6
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/installer.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/skill-manager.js +1 -1
- package/dist/src/agent/skills/skill-sources.js +1 -1
- package/dist/src/agent/source-context/index.d.ts +0 -1
- package/dist/src/agent/source-context/index.js +1 -2
- package/dist/src/agent/source-context/injector.js +1 -0
- package/dist/src/agent/source-context/types.d.ts +2 -2
- package/dist/src/agent/source-context/types.js +1 -1
- package/dist/src/agent/tools/cli-clarify.js +1 -1
- package/dist/src/agent/tools/codemode-permissions.d.ts +4 -0
- package/dist/src/agent/tools/codemode-permissions.js +23 -0
- package/dist/src/agent/tools/dataBatch.js +3 -1
- package/dist/src/agent/tools/delegation-parent-policy.js +1 -4
- package/dist/src/agent/tools/factory.js +4 -3
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/agent/transcript/provider-capabilities.js +0 -1
- package/dist/src/agent/transcript/transcript-policy.js +1 -2
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/agent-catalog/migrations/legacy-config-cutover.js +1 -1
- package/dist/src/agent-catalog/repository.js +1 -1
- package/dist/src/agent-config/schema.d.ts +28 -0
- package/dist/src/agent-config/schema.js +7 -0
- package/dist/src/auth/credentials.js +7 -20
- package/dist/src/auth/model-credential-store.js +11 -4
- package/dist/src/auth/oauth/index.d.ts +1 -1
- package/dist/src/auth/oauth/index.js +3 -3
- package/dist/src/auth/oauth/openai.d.ts +2 -0
- package/dist/src/auth/oauth/openai.js +90 -0
- package/dist/src/auth/oauth/registry.js +3 -3
- package/dist/src/auth/oauth/types.d.ts +1 -0
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +5 -0
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/chat-commands/builtins/model.js +2 -2
- package/dist/src/cli/command-manifest.js +1 -1
- package/dist/src/cli/commands/agents.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 +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +0 -19
- package/dist/src/cli/commands/mcp.js +36 -2
- package/dist/src/cli/commands/models.js +2 -2
- package/dist/src/cli/commands/onboard/model.js +2 -2
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/cli/utils/oauth-login.js +2 -2
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/index.js +3 -3
- package/dist/src/config/mcp-config-normalize.d.ts +0 -3
- package/dist/src/config/mcp-config-normalize.js +2 -22
- package/dist/src/config/models-json.d.ts +0 -5
- package/dist/src/config/models-json.js +13 -4
- package/dist/src/config/paths.d.ts +0 -1
- package/dist/src/config/paths.js +1 -4
- package/dist/src/config/schema.d.ts +130 -36
- package/dist/src/config/schema.js +52 -35
- package/dist/src/connectors/auth-provider-registry.d.ts +1 -1
- package/dist/src/connectors/auth-provider-registry.js +1 -21
- package/dist/src/connectors/china-catalog.js +5 -5
- package/dist/src/connectors/connection-recovery-service.d.ts +1 -6
- package/dist/src/connectors/connection-recovery-service.js +3 -105
- package/dist/src/connectors/health.d.ts +1 -2
- package/dist/src/connectors/health.js +2 -101
- package/dist/src/connectors/types.d.ts +1 -1
- package/dist/src/endpoint-tools/binding-service.d.ts +2 -0
- package/dist/src/endpoint-tools/binding-service.js +14 -2
- package/dist/src/endpoint-tools/bridge-host.d.ts +15 -0
- package/dist/src/endpoint-tools/bridge-host.js +166 -0
- package/dist/src/endpoint-tools/bridge.d.ts +27 -0
- package/dist/src/endpoint-tools/bridge.js +88 -0
- package/dist/src/endpoint-tools/capability-catalog.d.ts +2 -0
- package/dist/src/endpoint-tools/capability-catalog.js +8 -0
- package/dist/src/endpoint-tools/grant-service.d.ts +69 -0
- package/dist/src/endpoint-tools/grant-service.js +113 -0
- package/dist/src/endpoint-tools/index.js +1 -1
- package/dist/src/endpoint-tools/invocation-service.js +21 -4
- package/dist/src/endpoint-tools/location-task.d.ts +22 -0
- package/dist/src/endpoint-tools/location-task.js +114 -0
- package/dist/src/endpoint-tools/policy.js +21 -1
- package/dist/src/endpoint-tools/registry.d.ts +2 -0
- package/dist/src/endpoint-tools/registry.js +9 -0
- package/dist/src/endpoint-tools/result-projector.d.ts +15 -0
- package/dist/src/endpoint-tools/result-projector.js +31 -0
- package/dist/src/endpoint-tools/runtime.d.ts +2 -0
- package/dist/src/endpoint-tools/runtime.js +15 -2
- package/dist/src/endpoint-tools/target-resolver.d.ts +12 -0
- package/dist/src/endpoint-tools/target-resolver.js +27 -0
- package/dist/src/endpoint-tools/turn-context.d.ts +6 -0
- package/dist/src/endpoint-tools/turn-context.js +29 -0
- package/dist/src/endpoint-tools/upload-service.d.ts +4 -2
- package/dist/src/endpoint-tools/upload-service.js +29 -4
- package/dist/src/extensions/agent-plugins/auth.d.ts +0 -2
- package/dist/src/extensions/agent-plugins/auth.js +2 -19
- package/dist/src/extensions/agent-plugins/credentials.js +3 -19
- package/dist/src/extensions/agent-plugins/inventory.d.ts +2 -2
- package/dist/src/extensions/agent-plugins/mcp-adapter.js +1 -5
- package/dist/src/extensions/agent-plugins/source-http-fetch.d.ts +2 -0
- package/dist/src/{agent/mcp/plugin-http-fetch.js → extensions/agent-plugins/source-http-fetch.js} +7 -7
- package/dist/src/extensions/agent-plugins/sources.js +2 -2
- package/dist/src/extensions/agent-plugins/store.js +1 -3
- package/dist/src/extensions/agent-plugins/validation.d.ts +0 -4
- package/dist/src/extensions/agent-plugins/validation.js +14 -21
- package/dist/src/gateway/agents-admin.d.ts +5 -0
- package/dist/src/gateway/agents-admin.js +58 -3
- package/dist/src/gateway/chat-stream/mapper.js +9 -0
- package/dist/src/gateway/chat-stream/protocol.d.ts +4 -4
- package/dist/src/gateway/hono/lib/config-payload.d.ts +9 -4
- package/dist/src/gateway/hono/lib/config-payload.js +2 -5
- package/dist/src/gateway/hono/oauth-async.js +9 -2
- package/dist/src/gateway/hono/routes/agent-plugins.js +4 -9
- package/dist/src/gateway/hono/routes/agents.js +5 -4
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/connection-waits.js +2 -5
- package/dist/src/gateway/hono/routes/connectors.js +5 -60
- package/dist/src/gateway/hono/routes/device-authorizations.d.ts +3 -0
- package/dist/src/gateway/hono/routes/device-authorizations.js +74 -0
- package/dist/src/gateway/hono/routes/endpoint-compatibility.js +8 -0
- package/dist/src/gateway/hono/routes/endpoint-tools.d.ts +1 -0
- package/dist/src/gateway/hono/routes/endpoint-tools.js +70 -3
- package/dist/src/gateway/hono/routes/lazy-bundles.js +17 -1
- package/dist/src/gateway/hono/routes/mcp.d.ts +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +11 -237
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-command-handler.js +11 -1
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +8 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +26 -2
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/service/config-coordinator.js +2 -5
- package/dist/src/gateway/service/marketplace-service.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.js +13 -5
- package/dist/src/gateway/service/session-input-coordinator.d.ts +1 -1
- package/dist/src/gateway/service/session-input-coordinator.js +29 -9
- package/dist/src/gateway/service/sessions-api.js +0 -6
- package/dist/src/gateway/service.js +7 -16
- package/dist/src/gateway/session-reset-service.js +0 -6
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/imports/compatibility.js +12 -10
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/mcp/channel-bridge.js +1 -1
- package/dist/src/notes/agent-context.js +1 -1
- package/dist/src/personal-agent/service.js +1 -1
- package/dist/src/providers/env-keys.js +1 -1
- package/dist/src/providers/index.js +26 -24
- package/dist/src/providers/model-call.d.ts +0 -2
- package/dist/src/providers/model-call.js +2 -6
- package/dist/src/providers/model-registry.js +4 -2
- package/dist/src/providers/model-supplements.d.ts +3 -3
- package/dist/src/providers/model-supplements.js +6 -27
- package/dist/src/providers/presentation.js +3 -8
- package/dist/src/providers/prompt-cache-plan.js +1 -1
- package/dist/src/providers/provider-auth-service.d.ts +1 -1
- package/dist/src/providers/provider-auth-service.js +7 -2
- package/dist/src/providers/provider-policy.d.ts +3 -0
- package/dist/src/providers/provider-policy.js +14 -0
- package/dist/src/providers/register-runtime-providers.js +6 -1
- package/dist/src/realtime/runtime.js +1 -1
- package/dist/src/session/store.js +7 -1
- package/dist/src/session/transcript-events.d.ts +5 -0
- package/dist/src/session/transcript-events.js +1 -0
- package/dist/src/session/types.d.ts +2 -0
- package/dist/src/storage/sqlite/device-grant-audit-repository.d.ts +11 -0
- package/dist/src/storage/sqlite/device-grant-audit-repository.js +10 -0
- package/dist/src/storage/sqlite/endpoint-device-settings-repository.d.ts +7 -0
- package/dist/src/storage/sqlite/endpoint-device-settings-repository.js +17 -0
- package/dist/src/storage/sqlite/migrations/240_device_settings.sql +5 -0
- package/dist/src/storage/sqlite/migrations/241_device_grant_audit.sql +13 -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/schema.js +1 -1
- package/dist/src/storage/sqlite/session-input-repository.d.ts +1 -0
- package/dist/src/storage/sqlite/session-input-repository.js +5 -1
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
- package/dist/src/tui/xopc-tui-keybindings.d.ts +4 -4
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/package.json +20 -9
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CCRfvuov.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-CRlzd8El.js +0 -1
- package/dist/gateway/static/root/assets/agents-_ug2LCQb.js +0 -66
- package/dist/gateway/static/root/assets/automations-workspace-BQywN6nG.js +0 -6
- package/dist/gateway/static/root/assets/browser-automations-page-yiEuG1v7.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-page-BEnFt_dj.js +0 -2
- package/dist/gateway/static/root/assets/connectors-page-D6wTmWA6.js +0 -2
- package/dist/gateway/static/root/assets/copy-text-row-BHDs3cBa.js +0 -1
- package/dist/gateway/static/root/assets/dependency-picker-BTERkA9X.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DI2bqaKO.js +0 -1
- package/dist/gateway/static/root/assets/dist-Che_jiQF.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-DDWymi-o.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BZDjvwet.js +0 -2
- package/dist/gateway/static/root/assets/index-BB1z8QxA.js +0 -106
- package/dist/gateway/static/root/assets/index-D9R6tU7r.css +0 -1
- package/dist/gateway/static/root/assets/link-2-D_ZKYUW7.js +0 -1
- package/dist/gateway/static/root/assets/local-session-drafts-DRPsDCj1.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-DL-BM0xq.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-BOVRHhXk.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-DJJK2yL4.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-oCxO7ZTv.js +0 -8
- package/dist/gateway/static/root/assets/personal-page-DOk9gUK5.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-3uAzbW4T.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-LInoZ_Yi.js +0 -16
- package/dist/gateway/static/root/assets/sessions-page-BCVlNHtq.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Bz-ue9fZ.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-B5BoZ-1y.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BlnlzGjH.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-DjdTeYzm.js +0 -2
- package/dist/gateway/static/root/assets/use-file-preview-expanded-Db2VYg1b.js +0 -2
- package/dist/gateway/static/root/assets/user-model-page-B74LkVbp.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-Crk4SxtC.js +0 -6
- package/dist/src/agent/embedded/system-prompt-override.d.ts +0 -2
- package/dist/src/agent/embedded/system-prompt-override.js +0 -21
- package/dist/src/agent/external-tools/mcp-provider.d.ts +0 -32
- package/dist/src/agent/external-tools/mcp-provider.js +0 -208
- package/dist/src/agent/mcp/bundle-mcp-config.d.ts +0 -20
- package/dist/src/agent/mcp/bundle-mcp-gateway.d.ts +0 -79
- package/dist/src/agent/mcp/bundle-mcp-gateway.js +0 -93
- package/dist/src/agent/mcp/bundle-mcp-names.d.ts +0 -1
- package/dist/src/agent/mcp/bundle-mcp-names.js +0 -25
- package/dist/src/agent/mcp/bundle-mcp-policy.d.ts +0 -1
- package/dist/src/agent/mcp/bundle-mcp-policy.js +0 -6
- package/dist/src/agent/mcp/bundle-mcp-runtime.d.ts +0 -46
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +0 -571
- package/dist/src/agent/mcp/bundle-mcp-tools.d.ts +0 -2
- package/dist/src/agent/mcp/bundle-mcp-tools.js +0 -2
- package/dist/src/agent/mcp/bundle-mcp-types.d.ts +0 -76
- package/dist/src/agent/mcp/bundle-mcp-types.js +0 -1
- package/dist/src/agent/mcp/embedded-mcp.d.ts +0 -10
- package/dist/src/agent/mcp/embedded-mcp.js +0 -14
- package/dist/src/agent/mcp/index.d.ts +0 -5
- package/dist/src/agent/mcp/index.js +0 -12
- package/dist/src/agent/mcp/mcp-config-shared.d.ts +0 -8
- package/dist/src/agent/mcp/mcp-config-shared.js +0 -39
- package/dist/src/agent/mcp/mcp-http.d.ts +0 -23
- package/dist/src/agent/mcp/mcp-http.js +0 -67
- package/dist/src/agent/mcp/mcp-resource-id.d.ts +0 -6
- package/dist/src/agent/mcp/mcp-resource-id.js +0 -19
- package/dist/src/agent/mcp/mcp-stdio-transport.d.ts +0 -26
- package/dist/src/agent/mcp/mcp-stdio-transport.js +0 -120
- package/dist/src/agent/mcp/mcp-stdio.d.ts +0 -18
- package/dist/src/agent/mcp/mcp-stdio.js +0 -35
- package/dist/src/agent/mcp/mcp-transport-config.d.ts +0 -28
- package/dist/src/agent/mcp/mcp-transport-config.js +0 -91
- package/dist/src/agent/mcp/mcp-transport.d.ts +0 -17
- package/dist/src/agent/mcp/mcp-transport.js +0 -141
- package/dist/src/agent/mcp/oauth/index.d.ts +0 -6
- package/dist/src/agent/mcp/oauth/index.js +0 -6
- package/dist/src/agent/mcp/oauth/mcp-oauth-errors.d.ts +0 -5
- package/dist/src/agent/mcp/oauth/mcp-oauth-errors.js +0 -14
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.d.ts +0 -30
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +0 -276
- package/dist/src/agent/mcp/oauth/mcp-oauth-provider.d.ts +0 -33
- package/dist/src/agent/mcp/oauth/mcp-oauth-provider.js +0 -103
- package/dist/src/agent/mcp/oauth/mcp-oauth-session.d.ts +0 -31
- package/dist/src/agent/mcp/oauth/mcp-oauth-session.js +0 -181
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.d.ts +0 -12
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +0 -91
- package/dist/src/agent/mcp/oauth/mcp-oauth-types.d.ts +0 -22
- package/dist/src/agent/mcp/oauth/mcp-oauth-types.js +0 -1
- package/dist/src/agent/mcp/plugin-http-fetch.d.ts +0 -2
- package/dist/src/agent/source-context/mcp-resource-context.d.ts +0 -8
- package/dist/src/agent/source-context/mcp-resource-context.js +0 -30
- package/dist/src/auth/oauth/openai-codex.d.ts +0 -9
- package/dist/src/auth/oauth/openai-codex.js +0 -414
- package/dist/src/connectors/plugin-mcp-recovery.d.ts +0 -28
- package/dist/src/connectors/plugin-mcp-recovery.js +0 -90
- package/dist/src/extensions/agent-plugins/connection.d.ts +0 -8
- package/dist/src/extensions/agent-plugins/connection.js +0 -41
- package/dist/src/extensions/agent-plugins/health.d.ts +0 -4
- package/dist/src/extensions/agent-plugins/health.js +0 -48
- package/dist/src/extensions/agent-plugins/plugin-oauth-scope.d.ts +0 -1
- package/dist/src/extensions/agent-plugins/plugin-oauth-scope.js +0 -8
|
@@ -42,7 +42,7 @@ function parseModelRef(ref) {
|
|
|
42
42
|
model: trimmed.slice(idx + 1).trim()
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
var AgentModelRefSchema, AgentImageGenerationModelSchema, AgentModelsSchema, BrowserDriverSchema, BrowserHostnameSchema, BrowserConfigSchema, SessionDmScopeSchema, SessionStorageConfigSchema, SessionResetModeSchema, SessionResetConfigSchema, SessionResetByTypeSchema, SessionScopeSchema, SessionConfigSchema, ChannelsConfigSchema, SearchProviderEntrySchema, WebSearchConfigSchema, WebsiteBlocklistSchema, WebToolsConfigSchema, ToolsConfigSchema, RuntimePreferenceSchema, RuntimeProvisionSchema, RuntimeVersionRequestSchema, LanguageRuntimeSchema, DEFAULT_RUNTIME_TOOLS_CONFIG, RuntimeToolsConfigSchema, GatewayAuthRateLimitSchema, GatewaySecuritySchema, GatewayTrustedProxySchema, GatewayAuthSchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayRemoteSchema, GatewayTlsSchema, GatewayModeSchema, GatewayChannelConnectDeferModeSchema, TunnelConsentSchema, TunnelConfigSchema, WorkspaceImportConfigSchema, WorkspaceConfigSchema, GatewayBindModeSchema, GatewayWebchatConfigSchema, GatewayScenesConfigSchema, GatewayConfigSchema, ModelsDevConfigSchema, ModelCatalogConfigSchema, SttProviderConfigCatchallSchema, STTProviderConfigSchema, STTFallbackConfigSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, STTConfigSchema, TtsProviderConfigCatchallSchema, TTSProviderConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSEdgeConfigSchema, TTSSummarizationConfigSchema, TTSConfigSchema, VoiceRefinementConfigSchema, VoiceConfigSchema, MessagesConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, ProviderAzureConfigSchema, ProviderRequestOverridesSchema, ProviderAuthConfigSchema, ProvidersConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, UpdateAutoConfigSchema, UpdateConfigSchema, CommandsConfigSchema, McpHttpUrlSchema, ConnectorSecretReferenceSchema, McpConfigScalarSchema, McpOAuthConfigSchema, McpServerSchema, McpConfigSchema, ConnectorsConfigSchema, ExperimentalConfigSchema, ConfigSchema;
|
|
45
|
+
var AgentModelRefSchema, AgentImageGenerationModelSchema, AgentModelsSchema, BrowserDriverSchema, BrowserHostnameSchema, BrowserConfigSchema, SessionDmScopeSchema, SessionStorageConfigSchema, SessionResetModeSchema, SessionResetConfigSchema, SessionResetByTypeSchema, SessionScopeSchema, SessionConfigSchema, ChannelsConfigSchema, SearchProviderEntrySchema, WebSearchConfigSchema, WebsiteBlocklistSchema, WebToolsConfigSchema, ToolsConfigSchema, RuntimePreferenceSchema, RuntimeProvisionSchema, RuntimeVersionRequestSchema, LanguageRuntimeSchema, DEFAULT_RUNTIME_TOOLS_CONFIG, RuntimeToolsConfigSchema, GatewayAuthRateLimitSchema, GatewaySecuritySchema, GatewayTrustedProxySchema, GatewayAuthSchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayRemoteSchema, GatewayTlsSchema, GatewayModeSchema, GatewayChannelConnectDeferModeSchema, TunnelConsentSchema, TunnelConfigSchema, WorkspaceImportConfigSchema, WorkspaceConfigSchema, GatewayBindModeSchema, GatewayWebchatConfigSchema, GatewayScenesConfigSchema, GatewayConfigSchema, ModelsDevConfigSchema, ModelCatalogConfigSchema, SttProviderConfigCatchallSchema, STTProviderConfigSchema, STTFallbackConfigSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, STTConfigSchema, TtsProviderConfigCatchallSchema, TTSProviderConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSEdgeConfigSchema, TTSSummarizationConfigSchema, TTSConfigSchema, VoiceRefinementConfigSchema, VoiceConfigSchema, MessagesConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, ProviderAzureConfigSchema, ProviderRequestOverridesSchema, ProviderAuthConfigSchema, ProvidersConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, UpdateAutoConfigSchema, UpdateConfigSchema, CommandsConfigSchema, McpHttpUrlSchema, ConnectorSecretReferenceSchema, McpConfigScalarSchema, McpExposureSchema, McpOAuthConfigSchema, McpServerSchema, McpConfigSchema, ConnectorsConfigSchema, ExperimentalConfigSchema, ConfigSchema;
|
|
46
46
|
var init_schema = __esmMin((() => {
|
|
47
47
|
init_config();
|
|
48
48
|
init_config$1();
|
|
@@ -903,59 +903,76 @@ tts: TTSConfigSchema.optional() }).optional();
|
|
|
903
903
|
prefix: z.string().optional(),
|
|
904
904
|
suffix: z.string().optional()
|
|
905
905
|
}) });
|
|
906
|
-
McpConfigScalarSchema = z.union([
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
906
|
+
McpConfigScalarSchema = z.union([z.string(), ConnectorSecretReferenceSchema]);
|
|
907
|
+
McpExposureSchema = z.enum([
|
|
908
|
+
"codemode",
|
|
909
|
+
"deferred",
|
|
910
|
+
"direct",
|
|
911
|
+
"hidden"
|
|
911
912
|
]);
|
|
912
913
|
McpOAuthConfigSchema = z.object({
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
914
|
+
clientId: z.string().min(1).optional(),
|
|
915
|
+
clientSecret: z.string().optional(),
|
|
916
|
+
callbackPort: z.number().int().min(1).max(65535).optional(),
|
|
917
|
+
callbackUrl: z.string().url().optional(),
|
|
918
|
+
scope: z.string().optional(),
|
|
919
|
+
clientName: z.string().optional(),
|
|
920
|
+
clientRegistration: z.enum(["dcr", "cimd"]).optional(),
|
|
921
|
+
authServerMetadataUrl: z.string().url().optional()
|
|
916
922
|
}).strict();
|
|
917
923
|
McpServerSchema = z.object({
|
|
918
|
-
|
|
924
|
+
type: z.enum([
|
|
925
|
+
"stdio",
|
|
926
|
+
"http",
|
|
927
|
+
"streamable-http"
|
|
928
|
+
]).optional(),
|
|
929
|
+
command: z.string().min(1).optional(),
|
|
919
930
|
args: z.array(z.string()).optional(),
|
|
920
931
|
env: z.record(z.string(), McpConfigScalarSchema).optional(),
|
|
921
932
|
cwd: z.string().optional(),
|
|
922
|
-
workingDirectory: z.string().optional(),
|
|
923
933
|
url: McpHttpUrlSchema.optional(),
|
|
924
|
-
transport: z.enum(["sse", "streamable-http"]).optional(),
|
|
925
934
|
headers: z.record(z.string(), McpConfigScalarSchema).optional(),
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
935
|
+
oauth: McpOAuthConfigSchema.optional(),
|
|
936
|
+
auth: z.object({ provider: z.string().min(1) }).strict().optional(),
|
|
937
|
+
timeout: z.number().finite().positive().optional(),
|
|
938
|
+
enabled: z.boolean().optional(),
|
|
939
|
+
exposure: McpExposureSchema.optional(),
|
|
940
|
+
toolExposure: z.record(z.string(), McpExposureSchema).optional(),
|
|
941
|
+
description: z.string().optional(),
|
|
942
|
+
transport: z.never().optional(),
|
|
943
|
+
workingDirectory: z.never().optional(),
|
|
944
|
+
connectionTimeoutMs: z.never().optional(),
|
|
945
|
+
requestTimeoutMs: z.never().optional()
|
|
929
946
|
}).catchall(z.unknown()).superRefine((value, ctx) => {
|
|
930
|
-
|
|
931
|
-
const hasUrl = typeof value.url === "string" && value.url.trim().length > 0;
|
|
932
|
-
if (hasCommand && hasUrl) ctx.addIssue({
|
|
947
|
+
if (Boolean(value.command) === Boolean(value.url)) ctx.addIssue({
|
|
933
948
|
code: "custom",
|
|
934
|
-
message: "MCP server
|
|
949
|
+
message: "MCP server requires exactly one command or url"
|
|
935
950
|
});
|
|
936
|
-
if (value.
|
|
951
|
+
if (value.type === "stdio" && !value.command) ctx.addIssue({
|
|
937
952
|
code: "custom",
|
|
938
|
-
|
|
939
|
-
message: "MCP OAuth requires an HTTP server URL"
|
|
953
|
+
message: "stdio requires command"
|
|
940
954
|
});
|
|
941
|
-
if (value.
|
|
955
|
+
if ((value.type === "http" || value.type === "streamable-http") && !value.url) ctx.addIssue({
|
|
942
956
|
code: "custom",
|
|
943
|
-
|
|
944
|
-
message: "MCP OAuth currently supports streamable HTTP only"
|
|
957
|
+
message: "HTTP requires url"
|
|
945
958
|
});
|
|
946
|
-
if (value.auth && value.
|
|
947
|
-
|
|
948
|
-
|
|
959
|
+
if ((value.oauth || value.auth) && !value.url) ctx.addIssue({
|
|
960
|
+
code: "custom",
|
|
961
|
+
message: "MCP authentication requires HTTP"
|
|
962
|
+
});
|
|
963
|
+
});
|
|
964
|
+
McpConfigSchema = z.object({ servers: z.record(z.string().regex(/^[a-zA-Z0-9_-]+$/), McpServerSchema).optional() }).strict().superRefine((value, ctx) => {
|
|
965
|
+
const names = /* @__PURE__ */ new Set();
|
|
966
|
+
for (const name of Object.keys(value.servers ?? {})) {
|
|
967
|
+
const normalized = name.replace(/-/g, "_");
|
|
968
|
+
if (names.has(normalized)) ctx.addIssue({
|
|
949
969
|
code: "custom",
|
|
950
|
-
path: ["
|
|
951
|
-
message: "MCP
|
|
970
|
+
path: ["servers", name],
|
|
971
|
+
message: "MCP names differing only by hyphens and underscores collide"
|
|
952
972
|
});
|
|
973
|
+
names.add(normalized);
|
|
953
974
|
}
|
|
954
|
-
});
|
|
955
|
-
McpConfigSchema = z.object({
|
|
956
|
-
servers: z.record(z.string(), McpServerSchema).optional(),
|
|
957
|
-
sessionIdleTtlMs: z.number().finite().min(0).optional()
|
|
958
|
-
}).strict().optional();
|
|
975
|
+
}).optional();
|
|
959
976
|
ConnectorsConfigSchema = z.object({ instances: z.record(z.string(), z.record(z.string(), z.unknown())).optional() }).strict().optional();
|
|
960
977
|
ExperimentalConfigSchema = z.object({
|
|
961
978
|
/** First-run activation that analyzes one explicitly selected local folder. */
|
|
@@ -8,4 +8,4 @@ export type ConnectorAuthStartResult = {
|
|
|
8
8
|
connectionId?: string;
|
|
9
9
|
attemptId?: string;
|
|
10
10
|
};
|
|
11
|
-
export declare function startConnectorAuthorization(definition: ConnectorDefinition, config?: Config,
|
|
11
|
+
export declare function startConnectorAuthorization(definition: ConnectorDefinition, config?: Config, _instanceId?: string): Promise<ConnectorAuthStartResult>;
|
|
@@ -1,28 +1,8 @@
|
|
|
1
1
|
import { startComposioAuthorize } from "./composio.js";
|
|
2
|
-
import { isManagedConnectorServer } from "./materialize.js";
|
|
3
2
|
import { getConnectorInstance } from "./instances.js";
|
|
4
|
-
import { getMcpOAuthManager } from "../agent/mcp/oauth/mcp-oauth-manager.js";
|
|
5
3
|
//#region src/connectors/auth-provider-registry.ts
|
|
6
|
-
async function startConnectorAuthorization(definition, config,
|
|
4
|
+
async function startConnectorAuthorization(definition, config, _instanceId) {
|
|
7
5
|
if (definition.auth.mode !== "oauth") throw new Error(`Connector "${definition.id}" does not use OAuth.`);
|
|
8
|
-
if (definition.runtime.type === "mcp") {
|
|
9
|
-
if (!config) throw new Error("Connector configuration is required for MCP authorization.");
|
|
10
|
-
const serverId = instanceId ?? definition.runtime.serverId;
|
|
11
|
-
const server = config.mcp?.servers?.[serverId];
|
|
12
|
-
if (!server) throw new Error(`Connector MCP server not found: ${serverId}`);
|
|
13
|
-
if (!isManagedConnectorServer(server) || server.xopcConnector.connectorId !== definition.id) throw new Error(`MCP server "${serverId}" is not managed by connector "${definition.id}".`);
|
|
14
|
-
const status = await getMcpOAuthManager().start({
|
|
15
|
-
serverId,
|
|
16
|
-
rawServer: server,
|
|
17
|
-
cfg: config
|
|
18
|
-
});
|
|
19
|
-
return {
|
|
20
|
-
connectorId: definition.id,
|
|
21
|
-
provider: "mcp",
|
|
22
|
-
status: status.status,
|
|
23
|
-
authorizationUrl: status.session?.authorizationUrl
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
6
|
if (definition.auth.provider !== "composio" || definition.runtime.type !== "composio" || definition.runtime.role !== "toolkit") throw new Error(`Connector "${definition.id}" does not support OAuth authorization.`);
|
|
27
7
|
const configuredAuthConfigId = config ? getConnectorInstance(config, definition.id)?.config?.authConfigId : void 0;
|
|
28
8
|
const authConfigId = typeof configuredAuthConfigId === "string" && configuredAuthConfigId.trim() ? configuredAuthConfigId.trim() : void 0;
|
|
@@ -284,7 +284,7 @@ const CHINA_CONNECTORS = [
|
|
|
284
284
|
serverId: "tencent_meeting",
|
|
285
285
|
serverTemplate: {
|
|
286
286
|
url: "https://mcp.meeting.tencent.com/mcp",
|
|
287
|
-
|
|
287
|
+
type: "http",
|
|
288
288
|
headers: { "X-Tencent-Meeting-Token": "{{secrets.token}}" }
|
|
289
289
|
}
|
|
290
290
|
},
|
|
@@ -352,7 +352,7 @@ const CHINA_CONNECTORS = [
|
|
|
352
352
|
serverId: "tencent_docs",
|
|
353
353
|
serverTemplate: {
|
|
354
354
|
url: "https://docs.qq.com/openapi/mcp",
|
|
355
|
-
|
|
355
|
+
type: "http",
|
|
356
356
|
headers: { Authorization: "{{secrets.token}}" }
|
|
357
357
|
}
|
|
358
358
|
},
|
|
@@ -576,7 +576,7 @@ const CHINA_CONNECTORS = [
|
|
|
576
576
|
serverId: "bailian_web_search",
|
|
577
577
|
serverTemplate: {
|
|
578
578
|
url: "https://dashscope.aliyuncs.com/api/v1/mcps/WebSearch/mcp",
|
|
579
|
-
|
|
579
|
+
type: "http",
|
|
580
580
|
headers: { Authorization: "Bearer {{secrets.apiKey}}" }
|
|
581
581
|
}
|
|
582
582
|
},
|
|
@@ -647,7 +647,7 @@ const CHINA_CONNECTORS = [
|
|
|
647
647
|
serverId: "dida365",
|
|
648
648
|
serverTemplate: {
|
|
649
649
|
url: "https://mcp.dida365.com",
|
|
650
|
-
|
|
650
|
+
type: "http",
|
|
651
651
|
headers: { Authorization: "Bearer {{secrets.token}}" }
|
|
652
652
|
}
|
|
653
653
|
},
|
|
@@ -721,7 +721,7 @@ const CHINA_CONNECTORS = [
|
|
|
721
721
|
serverId: "flomo",
|
|
722
722
|
serverTemplate: {
|
|
723
723
|
url: "https://flomoapp.com/mcp",
|
|
724
|
-
|
|
724
|
+
type: "http",
|
|
725
725
|
headers: { Authorization: "Bearer {{secrets.token}}" }
|
|
726
726
|
}
|
|
727
727
|
},
|
|
@@ -1,18 +1,16 @@
|
|
|
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';
|
|
5
4
|
import type { ConnectionWaitSnapshot } from '@xopcai/gateway-contract';
|
|
6
5
|
export type ConnectionAction = {
|
|
7
6
|
waitId: string;
|
|
8
7
|
expectedTranscriptId: string;
|
|
9
8
|
expectedVersion: number;
|
|
10
9
|
idempotencyKey: string;
|
|
11
|
-
action: 'install_complete' | 'connect' | 'check' | 'skip' | 'cancel' | 'select_account' | 'confirm_scope' | 'replace_source'
|
|
10
|
+
action: 'install_complete' | 'connect' | 'check' | 'skip' | 'cancel' | 'select_account' | 'confirm_scope' | 'replace_source';
|
|
12
11
|
needKey?: string;
|
|
13
12
|
accountId?: string;
|
|
14
13
|
candidateRef?: string;
|
|
15
|
-
callbackUrl?: string;
|
|
16
14
|
instanceId?: string;
|
|
17
15
|
};
|
|
18
16
|
/** Authorization lives at click time. Chat history contains only immutable explanations. */
|
|
@@ -34,16 +32,13 @@ export declare class ConnectionRecoveryService {
|
|
|
34
32
|
drain: (conversationId: string) => void;
|
|
35
33
|
onPersonalRequestDelivered?: (conversationId: string, requestId: string) => void;
|
|
36
34
|
adapter?: ComposioSessionsAdapter;
|
|
37
|
-
pluginMcp?: PluginMcpRecovery;
|
|
38
35
|
});
|
|
39
36
|
private get adapter();
|
|
40
|
-
private get pluginMcp();
|
|
41
37
|
snapshot(conversationId: string): ConnectionWaitSnapshot;
|
|
42
38
|
private view;
|
|
43
39
|
private ensureInstallation;
|
|
44
40
|
private checkCapabilities;
|
|
45
41
|
private syncConnections;
|
|
46
|
-
private syncPluginMcpNeeds;
|
|
47
42
|
preflight(input: SessionInput): Promise<boolean>;
|
|
48
43
|
act(conversationId: string, action: ConnectionAction): Promise<{
|
|
49
44
|
snapshot: ConnectionWaitSnapshot;
|
|
@@ -22,7 +22,6 @@ import { resolveConnectionCandidate } from "./connection-candidates.js";
|
|
|
22
22
|
import { cancelPersonalRequest, resolvePersonalRequestConnection } from "../personal-agent/request-service.js";
|
|
23
23
|
import { persistConfigMutation } from "../config/config-mutation.js";
|
|
24
24
|
import { drainPersonalRequestContinuations, drainPersonalRequestResults } from "../personal-agent/request-delivery.js";
|
|
25
|
-
import { HostPluginMcpRecovery } from "./plugin-mcp-recovery.js";
|
|
26
25
|
import { randomUUID } from "node:crypto";
|
|
27
26
|
//#region src/connectors/connection-recovery-service.ts
|
|
28
27
|
init_transaction();
|
|
@@ -95,9 +94,6 @@ var ConnectionRecoveryService = class {
|
|
|
95
94
|
get adapter() {
|
|
96
95
|
return this.deps.adapter ?? new ComposioSessionsAdapter();
|
|
97
96
|
}
|
|
98
|
-
get pluginMcp() {
|
|
99
|
-
return this.deps.pluginMcp ?? new HostPluginMcpRecovery(this.deps.getConfig);
|
|
100
|
-
}
|
|
101
97
|
snapshot(conversationId) {
|
|
102
98
|
if (!connectorPrincipalForSession(conversationId).isLocalOwner) throw new Error("This connection belongs to another principal.");
|
|
103
99
|
const transcriptId = readCurrentTranscriptId(getSqliteDatabase(), conversationId);
|
|
@@ -111,18 +107,6 @@ var ConnectionRecoveryService = class {
|
|
|
111
107
|
}
|
|
112
108
|
view(wait, verifiedIds) {
|
|
113
109
|
const needs = wait.needs.map((need) => {
|
|
114
|
-
if (need.target.type === "plugin-mcp") {
|
|
115
|
-
const availability = this.pluginMcp.availability(need.target);
|
|
116
|
-
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";
|
|
117
|
-
return {
|
|
118
|
-
...need,
|
|
119
|
-
authorizationMode: "desktop",
|
|
120
|
-
phase,
|
|
121
|
-
accounts: [],
|
|
122
|
-
alternatives: [],
|
|
123
|
-
...availability.reason || need.capabilityError ? { reason: availability.reason ?? need.capabilityError } : {}
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
110
|
if (need.target.type === "store-connector") {
|
|
127
111
|
const target = need.target;
|
|
128
112
|
const instance = listConnectorInstances(this.deps.getConfig()).find((item) => item.connectorId === target.connectorId);
|
|
@@ -238,7 +222,7 @@ var ConnectionRecoveryService = class {
|
|
|
238
222
|
}))
|
|
239
223
|
}, verified).needs;
|
|
240
224
|
return Promise.all(wait.needs.map(async (need) => {
|
|
241
|
-
if (need.target.type === "
|
|
225
|
+
if (need.target.type === "store-connector") return need;
|
|
242
226
|
if (views.find((view) => view.key === need.key)?.phase !== "ready") return {
|
|
243
227
|
...need,
|
|
244
228
|
capabilityError: void 0
|
|
@@ -314,38 +298,6 @@ var ConnectionRecoveryService = class {
|
|
|
314
298
|
}
|
|
315
299
|
return fresh;
|
|
316
300
|
}
|
|
317
|
-
async syncPluginMcpNeeds(wait) {
|
|
318
|
-
return Promise.all(wait.needs.map(async (need) => {
|
|
319
|
-
if (need.target.type !== "plugin-mcp") return need;
|
|
320
|
-
const status = await this.pluginMcp.status(need.target);
|
|
321
|
-
if (status.status === "connected") {
|
|
322
|
-
const verified = await this.pluginMcp.verify(need.target);
|
|
323
|
-
return {
|
|
324
|
-
...need,
|
|
325
|
-
connectionId: need.target.serverId,
|
|
326
|
-
unavailable: false,
|
|
327
|
-
attempt: void 0,
|
|
328
|
-
capabilityError: verified.ready ? void 0 : verified.error ?? "The connected MCP tools are unavailable."
|
|
329
|
-
};
|
|
330
|
-
}
|
|
331
|
-
if (status.status === "authorizing") return {
|
|
332
|
-
...need,
|
|
333
|
-
connectionId: void 0,
|
|
334
|
-
unavailable: false,
|
|
335
|
-
attempt: {
|
|
336
|
-
id: status.session?.id ?? need.attempt?.id ?? randomUUID(),
|
|
337
|
-
expiresAt: status.session?.expiresAt ?? Date.now() + ATTEMPT_TTL
|
|
338
|
-
}
|
|
339
|
-
};
|
|
340
|
-
return {
|
|
341
|
-
...need,
|
|
342
|
-
connectionId: void 0,
|
|
343
|
-
unavailable: true,
|
|
344
|
-
attempt: void 0,
|
|
345
|
-
capabilityError: status.status === "error" ? status.session?.error : void 0
|
|
346
|
-
};
|
|
347
|
-
}));
|
|
348
|
-
}
|
|
349
301
|
async preflight(input) {
|
|
350
302
|
if (input.kind !== "connection_resume") return true;
|
|
351
303
|
const wait = input.payload ? getConnectionWait(input.payload.waitId) : void 0;
|
|
@@ -354,11 +306,10 @@ var ConnectionRecoveryService = class {
|
|
|
354
306
|
try {
|
|
355
307
|
const fresh = await this.syncConnections(wait);
|
|
356
308
|
const verified = new Set(fresh.filter((item) => item.status === "active").map((item) => item.id));
|
|
357
|
-
wait.needs =
|
|
358
|
-
wait.needs = wait.needs.map((need) => need.target.type === "plugin-mcp" ? need : {
|
|
309
|
+
wait.needs = wait.needs.map((need) => ({
|
|
359
310
|
...need,
|
|
360
311
|
unavailable: !fresh.some((item) => item.id === need.connectionId && item.status === "active")
|
|
361
|
-
});
|
|
312
|
+
}));
|
|
362
313
|
wait.needs = await this.checkCapabilities(wait, verified);
|
|
363
314
|
const ready = this.view(wait, verified).needs.every((need) => need.phase === "ready");
|
|
364
315
|
if (getConnectionWait(wait.id)?.version !== wait.version) return false;
|
|
@@ -466,48 +417,6 @@ var ConnectionRecoveryService = class {
|
|
|
466
417
|
const need = wait.needs.find((need) => need.key === action.needKey);
|
|
467
418
|
if (!need) throw new Error("Unknown connection requirement.");
|
|
468
419
|
if (this.view(wait).needs.find((item) => item.key === need.key)?.phase === "blocked") throw new Error("Connector policy blocks this connection.");
|
|
469
|
-
if (need.target.type === "plugin-mcp") {
|
|
470
|
-
const serverId = need.target.serverId;
|
|
471
|
-
const attemptId = randomUUID();
|
|
472
|
-
wait = updateConnectionWait({
|
|
473
|
-
...wait,
|
|
474
|
-
intent: {
|
|
475
|
-
objectiveRevision: wait.objectiveRevision,
|
|
476
|
-
validUntil: Date.now() + INTENT_TTL
|
|
477
|
-
},
|
|
478
|
-
needs: wait.needs.map((item) => item.key === need.key ? {
|
|
479
|
-
...item,
|
|
480
|
-
unavailable: false,
|
|
481
|
-
capabilityError: void 0,
|
|
482
|
-
attempt: {
|
|
483
|
-
id: attemptId,
|
|
484
|
-
expiresAt: Date.now() + ATTEMPT_TTL
|
|
485
|
-
}
|
|
486
|
-
} : item)
|
|
487
|
-
}, wait.version);
|
|
488
|
-
publishConnectionWait(conversationId);
|
|
489
|
-
const auth = await this.pluginMcp.start(need.target);
|
|
490
|
-
const latest = getConnectionWait(wait.id);
|
|
491
|
-
if (!latest || latest.version !== wait.version || latest.status !== "open") throw new Error("WAIT_CHANGED");
|
|
492
|
-
wait = updateConnectionWait({
|
|
493
|
-
...wait,
|
|
494
|
-
needs: wait.needs.map((item) => item.key === need.key ? {
|
|
495
|
-
...item,
|
|
496
|
-
attempt: auth.status === "authorizing" ? {
|
|
497
|
-
id: auth.session?.id ?? attemptId,
|
|
498
|
-
expiresAt: auth.session?.expiresAt ?? Date.now() + ATTEMPT_TTL
|
|
499
|
-
} : void 0,
|
|
500
|
-
connectionId: auth.status === "connected" ? serverId : void 0,
|
|
501
|
-
unavailable: auth.status === "error",
|
|
502
|
-
capabilityError: auth.status === "error" ? auth.session?.error : void 0
|
|
503
|
-
} : item)
|
|
504
|
-
}, wait.version);
|
|
505
|
-
publishConnectionWait(conversationId);
|
|
506
|
-
return {
|
|
507
|
-
snapshot: this.snapshot(conversationId),
|
|
508
|
-
authorizationUrl: auth.session?.authorizationUrl
|
|
509
|
-
};
|
|
510
|
-
}
|
|
511
420
|
const id = need.target.connectorId;
|
|
512
421
|
const instance = listConnectorInstances(this.deps.getConfig()).find((item) => item.connectorId === id);
|
|
513
422
|
const definition = (instance ? getInstalledConnectorDefinition(this.deps.getConfig(), instance.instanceId) : void 0) ?? getConnectorDefinition(id);
|
|
@@ -578,18 +487,11 @@ var ConnectionRecoveryService = class {
|
|
|
578
487
|
authorizationUrl: auth.connectUrl
|
|
579
488
|
};
|
|
580
489
|
} else {
|
|
581
|
-
if (action.action === "submit_callback") {
|
|
582
|
-
const need = wait.needs.find((need) => need.key === action.needKey);
|
|
583
|
-
if (!need || need.target.type !== "plugin-mcp") throw new Error("OAuth callback is unavailable.");
|
|
584
|
-
if (!action.callbackUrl || action.callbackUrl.length > 16384) throw new Error("Expected the complete OAuth callback URL.");
|
|
585
|
-
await this.pluginMcp.submitCallback(need.target, action.callbackUrl);
|
|
586
|
-
}
|
|
587
490
|
const fresh = await this.syncConnections(wait);
|
|
588
491
|
const verified = new Set(fresh.filter((item) => item.status === "active").map((item) => item.id));
|
|
589
492
|
const latest = getConnectionWait(wait.id);
|
|
590
493
|
if (!latest || latest.version !== wait.version || latest.status !== "open") throw new Error("WAIT_CHANGED");
|
|
591
494
|
let needs = wait.needs.map((need) => {
|
|
592
|
-
if (need.target.type === "plugin-mcp") return need;
|
|
593
495
|
if (need.target.type === "store-connector") {
|
|
594
496
|
const selected = this.view({
|
|
595
497
|
...wait,
|
|
@@ -617,10 +519,6 @@ var ConnectionRecoveryService = class {
|
|
|
617
519
|
unavailable: !fresh.some((item) => item.connectorId === id && item.status === "active" && (!need.connectionId || item.id === need.connectionId) && (!need.accountId || item.accountId === need.accountId))
|
|
618
520
|
};
|
|
619
521
|
});
|
|
620
|
-
needs = await this.syncPluginMcpNeeds({
|
|
621
|
-
...wait,
|
|
622
|
-
needs
|
|
623
|
-
});
|
|
624
522
|
if (action.action === "select_account") {
|
|
625
523
|
const need = needs.find((item) => item.key === action.needKey);
|
|
626
524
|
if (!need || need.target.type !== "connector") throw new Error("Account selection is unavailable.");
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { Config } from '../config/schema.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ConnectorHealthResult } from './types.js';
|
|
3
3
|
export declare function testConnectorInstance(config: Config, serverId: string): Promise<ConnectorHealthResult>;
|
|
4
|
-
export declare function previewConnectorDefinition(config: Config, definition: ConnectorDefinition, input?: ConnectorInstallInput): Promise<ConnectorHealthResult>;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { init_connector_repository, listConnectorConnections } from "../storage/sqlite/connector-repository.js";
|
|
2
2
|
import { currentAccountConnections } from "./account-access.js";
|
|
3
|
-
import { materializeConnectorMcpServer } from "./materialize.js";
|
|
4
3
|
import { getConnectorInstance } from "./instances.js";
|
|
5
4
|
import { describeCliAction, verifyCliConnection } from "./cli/runtime.js";
|
|
6
|
-
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
7
|
-
import { listBundleMcpServerCapabilitiesForGateway } from "../agent/mcp/bundle-mcp-gateway.js";
|
|
8
5
|
//#region src/connectors/health.ts
|
|
9
6
|
init_connector_repository();
|
|
10
7
|
function classifyConnectorHealthError(error) {
|
|
@@ -17,12 +14,6 @@ function classifyConnectorHealthError(error) {
|
|
|
17
14
|
if (/spawn|command|start|connect/i.test(message)) return "startup_failed";
|
|
18
15
|
return "unknown_error";
|
|
19
16
|
}
|
|
20
|
-
function healthActionForStatus(status) {
|
|
21
|
-
if (status === "missing_secret") return "Reconnect the connector and provide the required secret.";
|
|
22
|
-
if (status === "timeout" || status === "network_failed") return "Check network access and retry the connector health check.";
|
|
23
|
-
if (status === "startup_failed") return "Verify the connector runtime dependency is installed and reachable.";
|
|
24
|
-
if (status === "unauthorized") return "Reconnect the connector or refresh its credentials.";
|
|
25
|
-
}
|
|
26
17
|
async function testConnectorInstance(config, serverId) {
|
|
27
18
|
const instance = getConnectorInstance(config, serverId);
|
|
28
19
|
if (!instance) return {
|
|
@@ -97,97 +88,7 @@ async function testConnectorInstance(config, serverId) {
|
|
|
97
88
|
};
|
|
98
89
|
}
|
|
99
90
|
}
|
|
100
|
-
|
|
101
|
-
try {
|
|
102
|
-
const capabilities = await listBundleMcpServerCapabilitiesForGateway({
|
|
103
|
-
workspaceDir,
|
|
104
|
-
cfg: config,
|
|
105
|
-
serverId
|
|
106
|
-
});
|
|
107
|
-
return {
|
|
108
|
-
serverId,
|
|
109
|
-
ok: true,
|
|
110
|
-
status: "ok",
|
|
111
|
-
toolCount: capabilities.toolCount,
|
|
112
|
-
resourceCount: capabilities.resourceCount,
|
|
113
|
-
promptCount: capabilities.promptCount,
|
|
114
|
-
tools: capabilities.tools,
|
|
115
|
-
resources: capabilities.resources,
|
|
116
|
-
prompts: capabilities.prompts
|
|
117
|
-
};
|
|
118
|
-
} catch (error) {
|
|
119
|
-
const status = classifyConnectorHealthError(error);
|
|
120
|
-
return {
|
|
121
|
-
serverId,
|
|
122
|
-
ok: false,
|
|
123
|
-
status,
|
|
124
|
-
toolCount: 0,
|
|
125
|
-
resourceCount: 0,
|
|
126
|
-
promptCount: 0,
|
|
127
|
-
tools: [],
|
|
128
|
-
resources: [],
|
|
129
|
-
prompts: [],
|
|
130
|
-
error: error instanceof Error ? error.message : String(error),
|
|
131
|
-
action: healthActionForStatus(status)
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
async function previewConnectorDefinition(config, definition, input = {}) {
|
|
136
|
-
if (definition.runtime.type !== "mcp") return {
|
|
137
|
-
serverId: definition.id,
|
|
138
|
-
ok: false,
|
|
139
|
-
status: "unknown_error",
|
|
140
|
-
toolCount: 0,
|
|
141
|
-
resourceCount: 0,
|
|
142
|
-
promptCount: 0,
|
|
143
|
-
tools: [],
|
|
144
|
-
resources: [],
|
|
145
|
-
prompts: [],
|
|
146
|
-
error: `Connector type "${definition.runtime.type}" does not support MCP capability preview.`
|
|
147
|
-
};
|
|
148
|
-
try {
|
|
149
|
-
const { serverId, server } = materializeConnectorMcpServer(definition, input);
|
|
150
|
-
const capabilities = await listBundleMcpServerCapabilitiesForGateway({
|
|
151
|
-
workspaceDir: getWorkspacePath(config) || "./workspace",
|
|
152
|
-
cfg: {
|
|
153
|
-
...config,
|
|
154
|
-
mcp: {
|
|
155
|
-
...config.mcp ?? {},
|
|
156
|
-
servers: {
|
|
157
|
-
...config.mcp?.servers ?? {},
|
|
158
|
-
[serverId]: server
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
serverId
|
|
163
|
-
});
|
|
164
|
-
return {
|
|
165
|
-
serverId,
|
|
166
|
-
ok: true,
|
|
167
|
-
status: "ok",
|
|
168
|
-
toolCount: capabilities.toolCount,
|
|
169
|
-
resourceCount: capabilities.resourceCount,
|
|
170
|
-
promptCount: capabilities.promptCount,
|
|
171
|
-
tools: capabilities.tools,
|
|
172
|
-
resources: capabilities.resources,
|
|
173
|
-
prompts: capabilities.prompts
|
|
174
|
-
};
|
|
175
|
-
} catch (error) {
|
|
176
|
-
const status = classifyConnectorHealthError(error);
|
|
177
|
-
return {
|
|
178
|
-
serverId: definition.id,
|
|
179
|
-
ok: false,
|
|
180
|
-
status,
|
|
181
|
-
toolCount: 0,
|
|
182
|
-
resourceCount: 0,
|
|
183
|
-
promptCount: 0,
|
|
184
|
-
tools: [],
|
|
185
|
-
resources: [],
|
|
186
|
-
prompts: [],
|
|
187
|
-
error: error instanceof Error ? error.message : String(error),
|
|
188
|
-
action: healthActionForStatus(status)
|
|
189
|
-
};
|
|
190
|
-
}
|
|
91
|
+
throw new Error("MCP diagnostics are provided by xopc mcp list.");
|
|
191
92
|
}
|
|
192
93
|
//#endregion
|
|
193
|
-
export {
|
|
94
|
+
export { testConnectorInstance };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type ConnectorKind = 'mcp' | 'cli' | 'http' | 'browser' | 'extension' | 'builtin' | 'composio' | 'memorySource';
|
|
2
2
|
export type ConnectorCategory = 'code' | 'docs' | 'browser' | 'data' | 'automation' | 'custom';
|
|
3
|
-
export type ConnectorCapability = 'tools' | 'resources' | 'prompts' | 'context' | 'channel' | 'events' | 'ui' | 'memory_source' | 'workflows' | 'auth.apiKey' | 'auth.oauth' | 'runtime.mcp.stdio' | 'runtime.mcp.
|
|
3
|
+
export type ConnectorCapability = 'tools' | 'resources' | 'prompts' | 'context' | 'channel' | 'events' | 'ui' | 'memory_source' | 'workflows' | 'auth.apiKey' | 'auth.oauth' | 'runtime.mcp.stdio' | 'runtime.mcp.streamableHttp';
|
|
4
4
|
export type ConnectorAuthMode = 'none' | 'apiKey' | 'oauth' | 'cli';
|
|
5
5
|
export type ConnectorAuthDefinition = {
|
|
6
6
|
mode: 'cli';
|
|
@@ -13,6 +13,8 @@ export interface EndpointSessionBindingStore {
|
|
|
13
13
|
export declare class EndpointBindingService {
|
|
14
14
|
private readonly registry;
|
|
15
15
|
private readonly store;
|
|
16
|
+
private readonly changeListeners;
|
|
17
|
+
onChange(listener: (conversationId: string) => void): () => void;
|
|
16
18
|
constructor(registry: EndpointRegistry, store?: EndpointSessionBindingStore);
|
|
17
19
|
bind(conversationId: string, endpointId: string, now?: number): EndpointSessionBinding;
|
|
18
20
|
get(conversationId: string): EndpointSessionBinding | undefined;
|
|
@@ -11,6 +11,13 @@ function memoryStore() {
|
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
var EndpointBindingService = class {
|
|
14
|
+
changeListeners = /* @__PURE__ */ new Set();
|
|
15
|
+
onChange(listener) {
|
|
16
|
+
this.changeListeners.add(listener);
|
|
17
|
+
return () => {
|
|
18
|
+
this.changeListeners.delete(listener);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
14
21
|
constructor(registry, store = memoryStore()) {
|
|
15
22
|
this.registry = registry;
|
|
16
23
|
this.store = store;
|
|
@@ -23,7 +30,9 @@ var EndpointBindingService = class {
|
|
|
23
30
|
endpointId,
|
|
24
31
|
boundAt: now
|
|
25
32
|
};
|
|
26
|
-
|
|
33
|
+
const stored = this.store.set(binding);
|
|
34
|
+
for (const listener of this.changeListeners) listener(normalizedConversationId);
|
|
35
|
+
return stored;
|
|
27
36
|
}
|
|
28
37
|
get(conversationId) {
|
|
29
38
|
return this.store.get(this.normalizeConversationId(conversationId));
|
|
@@ -33,7 +42,10 @@ var EndpointBindingService = class {
|
|
|
33
42
|
return binding ? this.registry.get(binding.endpointId) : void 0;
|
|
34
43
|
}
|
|
35
44
|
unbind(conversationId) {
|
|
36
|
-
|
|
45
|
+
const normalized = this.normalizeConversationId(conversationId);
|
|
46
|
+
const removed = this.store.delete(normalized);
|
|
47
|
+
if (removed) for (const listener of this.changeListeners) listener(normalized);
|
|
48
|
+
return removed;
|
|
37
49
|
}
|
|
38
50
|
normalizeConversationId(conversationId) {
|
|
39
51
|
const normalized = conversationId.trim();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type EndpointToolRegistry } from '@xopcai/endpoint-tools-client';
|
|
2
|
+
export interface DeviceBridgeHostOptions {
|
|
3
|
+
gatewayUrl: string;
|
|
4
|
+
token: string;
|
|
5
|
+
identityPath: string;
|
|
6
|
+
registry: EndpointToolRegistry;
|
|
7
|
+
displayName?: string;
|
|
8
|
+
onStateChange?: (state: string) => void;
|
|
9
|
+
}
|
|
10
|
+
/** Connects a Node hardware adapter through the existing signed Endpoint v2 transport. */
|
|
11
|
+
export declare function connectDeviceBridge(options: DeviceBridgeHostOptions): Promise<{
|
|
12
|
+
endpointId: string;
|
|
13
|
+
principalId: string;
|
|
14
|
+
close: () => void;
|
|
15
|
+
}>;
|