@xopcai/xopc 0.0.306 → 0.0.307
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-DLtim-_I.js → activity-store-wgSB2HYK.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-iQXtiilH.js → agent-avatar-dicebear-CZeQo09T.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BPsRb9Ck.js +1 -0
- package/dist/gateway/static/root/assets/agents-BlrHMbRx.js +1 -0
- package/dist/gateway/static/root/assets/{api-DfSU0-lD.js → api-BKHmTb0w.js} +1 -1
- package/dist/gateway/static/root/assets/api-DFOlahZv.js +1 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BpYFKz7B.js → app-management-settings-panel-Bzw4fQP8.js} +1 -1
- package/dist/gateway/static/root/assets/appearance-settings-8GZpUXva.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-BkQQtIxH.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BxOvZ-ZX.js → archive-plugin-CQ2NaoHb.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-B0FzTMAJ.js → attachment-load-BFi1H7yJ.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BpXuPaPg.js → automations-page-CDBXcii_.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CUpiTTiY.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BP7wfpqy.js → binary-plugins-D07eWmOx.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-oMLvdnOQ.js → block-editor-CtVnjyYU.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-DTxSZ00u.js → browser-automation-inputs-BzkJog8e.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-IbJnwEY4.js → browser-automations-page-DyrSbDdG.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-CqTxLpil.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BZ_-pnS6.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-DAD9qE3J.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-D2AmAoty.js → channels-status-swr-B2JwuTjG.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-B-yI3Mi1.js → chat-terminal-dock-B62SZdAo.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-CWx_jnng.js → computer-settings-page-ClSresNq.js} +1 -1
- package/dist/gateway/static/root/assets/connector-service-page-CPqVmNvx.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-BUQyg3CW.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-DMRRL4Zg.js → cron-expression-CTMi_tql.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-BSwL0e6E.js → date-picker-B71AJK50.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-BQTspLzC.js → dependency-picker-DlyGK-kA.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-C3lFxDF6.js → desktop-pet-DGkbTE8_.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-Y8pjpXFE.js → desktop-pet-settings-BY8r9j66.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DzRrgd59.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-CVGiGVcR.js → extension-debug-page-L8Mm1n3A.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-g3JtCP_y.js → extension-page-CFc4vSNU.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CjpoKV1f.js → extension-settings-page-B5zWyHr3.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BSvXXpKM.js → gateway-config-swr-B6wHa6ZI.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-BDCpS7U1.js → gateway-realtime-B53R0CA4.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-BLDgrJ30.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-settings-CYG9WCZn.js → gateway-settings-D7qmTH4R.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-Caf8g3sC.js → gateway-startup-retry-DRzGnEV-.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-Cl834-SS.js → heartbeat-settings-Glsl3X5b.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-s9hDQ8Hc.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-BwEWBUVC.js → image-generation-api-Ck_pyDom.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-CoMlgSIA.js → imports-page-ByBX7ome.js} +1 -1
- package/dist/gateway/static/root/assets/{index-Do9MltC4.js → index-RBCkv8a_.js} +48 -48
- package/dist/gateway/static/root/assets/index-cFU4S35z.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CNq5D4pe.js → keyboard-shortcuts-settings-C45RlO8a.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-DP0x2jpR.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-DQnRA598.js → local-apps-page-C_AQc2bI.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-D16nmbaN.js → locale-store-msTfRK8P.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-DvM8Pyok.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-DKcO5fQ-.js → management-settings-D1uwSutV.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-DCp4BlZP.js → markdown-view-BInabSKf.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Cy64sn_C.js → media-plugins-C4mhf13f.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-C-9oo69N.js → messages-F74LVAiU.js} +3 -3
- package/dist/gateway/static/root/assets/note-detail-panel-D35sErp2.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-8jCDklDn.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-CgEoHSVT.js → page-tabs-1go_BtX1.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Ck2uKTbf.js → preview-open-alternatives-DmoSC0j1.js} +1 -1
- package/dist/gateway/static/root/assets/{proactive-page-Dr1mCJhZ.js → proactive-page-xAjKTIID.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-DbZvJ5GE.js → product-open-page-gmi5LLwM.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-BUMQHy_N.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DT-Mt7XR.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-DcQdwpPu.js → registry-api-BSWtko7U.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-Clz3byir.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CPwdgWKo.js → runtime-tools-settings-panel-ClkOoxDl.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-8psK4cFO.js → schema-form-BuEmLiaU.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-tQRwktKm.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DqWg9XS5.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-D_Gsz5rl.js → settings-form-section-Dor39QON.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-C_Tj_mkZ.js → settings-page-Xj-yvIc8.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BB_sMB7P.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-B_M_oPsT.js → share-preview-page-BFWZoXdm.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-oDALm4b6.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-DmwelnfK.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-DYgwzl5B.js → skills-page-BE9JXz4U.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-Cuh6s2HM.js → skills-page.utils-Ii8qeXhs.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-aassGyNb.js → system-settings-panel-Di6OSO-0.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-D1AWszc7.js +1 -0
- package/dist/gateway/static/root/assets/theme-store-1SZ-HFHX.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-DJYcPWIV.js → tunnel-api-DDOlOYlj.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-QGYG7oMZ.js → use-autosave-CQ8uWNnB.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-C00i4ea0.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-D1s0gIRW.js → voice-api-key-field-COTzshjL.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-D2goEn5e.js → voice-config-api-DgJML_uM.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DkFW9aJ6.js → work-discovery-overlay-_URrXbi4.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BYToUPUY.js → workflow-run-setup-panel-CALs-1nd.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BUiBjz6m.js +6 -0
- package/dist/gateway/static/root/channel-icons/feishu.svg +6 -12
- package/dist/gateway/static/root/connector-icons/SOURCES.md +12 -0
- package/dist/gateway/static/root/connector-icons/dingtalk-mark.svg +1 -0
- package/dist/gateway/static/root/connector-icons/tencent-meeting-mark.svg +37 -0
- package/dist/gateway/static/root/connector-icons/wps-calendar.svg +14 -0
- package/dist/gateway/static/root/connector-icons/wps-docs.svg +14 -0
- package/dist/gateway/static/root/connector-icons/wps-mail.svg +7 -0
- package/dist/gateway/static/root/index.html +12 -12
- package/dist/package.js +1 -1
- package/dist/src/agent/external-tools/composio-provider.js +83 -20
- package/dist/src/agent/external-tools/gateway-tools.js +2 -1
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +2 -2
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/config/schema.d.ts +12 -0
- package/dist/src/config/schema.js +4 -2
- package/dist/src/connectors/account-access.d.ts +4 -0
- package/dist/src/connectors/account-access.js +23 -0
- package/dist/src/connectors/approval-resume.d.ts +4 -0
- package/dist/src/connectors/approval-resume.js +23 -0
- package/dist/src/connectors/auth-provider-registry.d.ts +1 -0
- package/dist/src/connectors/auth-provider-registry.js +2 -1
- package/dist/src/connectors/authorization-attempts.d.ts +21 -0
- package/dist/src/connectors/authorization-attempts.js +33 -0
- package/dist/src/connectors/builtin-catalog.js +1 -3
- package/dist/src/connectors/catalog.js +2 -1
- package/dist/src/connectors/china-catalog.d.ts +2 -0
- package/dist/src/connectors/china-catalog.js +430 -0
- package/dist/src/connectors/composio-backends.d.ts +26 -0
- package/dist/src/connectors/composio-backends.js +65 -0
- package/dist/src/connectors/composio-catalog.js +2 -1
- package/dist/src/connectors/composio-managed-client.js +3 -1
- package/dist/src/connectors/composio-managed-events.js +5 -2
- package/dist/src/connectors/composio-session-types.d.ts +2 -0
- package/dist/src/connectors/composio-sessions.d.ts +11 -2
- package/dist/src/connectors/composio-sessions.js +137 -35
- package/dist/src/connectors/composio-triggers.js +4 -2
- package/dist/src/connectors/composio.d.ts +11 -8
- package/dist/src/connectors/composio.js +68 -84
- package/dist/src/connectors/connected-source-ingestion.js +4 -3
- package/dist/src/connectors/connection-recovery-service.js +25 -13
- package/dist/src/connectors/connector-identity.d.ts +2 -0
- package/dist/src/connectors/connector-identity.js +18 -5
- package/dist/src/connectors/content-enrichment.js +1 -1
- package/dist/src/connectors/instances.js +1 -7
- package/dist/src/connectors/learning-coordinator.js +4 -3
- package/dist/src/connectors/materialize.js +14 -1
- package/dist/src/connectors/policy.d.ts +1 -1
- package/dist/src/connectors/policy.js +1 -1
- package/dist/src/connectors/principal.js +24 -3
- package/dist/src/connectors/providers.d.ts +1 -0
- package/dist/src/connectors/providers.js +14 -2
- package/dist/src/connectors/runtime-adapter-registry.js +4 -9
- package/dist/src/connectors/secret-store.d.ts +4 -1
- package/dist/src/connectors/secret-store.js +7 -3
- package/dist/src/connectors/source-change-publisher.js +4 -2
- package/dist/src/connectors/types.d.ts +16 -11
- package/dist/src/connectors/workflow-preflight.d.ts +2 -1
- package/dist/src/connectors/workflow-preflight.js +20 -3
- package/dist/src/gateway/hono/routes/connectors.js +208 -17
- package/dist/src/gateway/hono/routes/context-sources.js +1 -1
- package/dist/src/gateway/hono/routes/home.js +4 -1
- package/dist/src/gateway/hono/routes/imports.js +1 -1
- package/dist/src/gateway/hono/routes/local-apps.js +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +1 -1
- package/dist/src/gateway/hono/routes/update.js +2 -2
- package/dist/src/gateway/index.js +1 -1
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/service.js +10 -10
- package/dist/src/infra/gateway-processes.js +1 -1
- package/dist/src/infra/update-restart.js +2 -2
- package/dist/src/infra/update-runner.js +2 -2
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/proactive/follow-ups.js +2 -1
- package/dist/src/storage/sqlite/connection-wait-repository.d.ts +3 -0
- package/dist/src/storage/sqlite/connection-wait-repository.js +63 -2
- package/dist/src/storage/sqlite/connector-account-repository.d.ts +6 -0
- package/dist/src/storage/sqlite/connector-account-repository.js +35 -7
- package/dist/src/storage/sqlite/connector-repository.js +15 -10
- package/dist/src/storage/sqlite/connector-sync-policy-repository.js +1 -1
- package/dist/src/storage/sqlite/index.js +4 -2
- package/dist/src/storage/sqlite/migrations/182_connector_account_policies.sql +92 -0
- package/dist/src/storage/sqlite/migrations/183_connector_backend_consistency.sql +20 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +7 -7
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/tasks/home-query-service.js +3 -3
- package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/workflows/domain/definition.d.ts +1 -0
- package/dist/src/workflows/domain/validation.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +14 -0
- package/dist/src/workflows/service/workflow-session-bridge.d.ts +1 -0
- package/dist/src/workflows/service/workflow-session-bridge.js +1 -0
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CxOv4ivK.js +0 -1
- package/dist/gateway/static/root/assets/agents-DzKx7z3k.js +0 -1
- package/dist/gateway/static/root/assets/api-gpHh07OL.js +0 -1
- package/dist/gateway/static/root/assets/appearance-settings-BQfR5vrq.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-BceB7JHZ.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-Cn_p8zY_.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CCUO3G23.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BjMb5H2_.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-P22-_i13.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-BLgPORmH.js +0 -2
- package/dist/gateway/static/root/assets/device-pairing-wizard-DM4_GMzo.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-BGmP1obI.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CB_XVtIM.js +0 -1
- package/dist/gateway/static/root/assets/index-CI37dTAn.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-BxQlEje6.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-CT5GrcMs.js +0 -2
- package/dist/gateway/static/root/assets/note-detail-panel-5dc3LKTL.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-AbwxgXuG.js +0 -8
- package/dist/gateway/static/root/assets/project-detail-page-DnE1zI1c.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-BD0nLYxk.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-TYuE6A3S.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BcWDQQFX.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DzGQX6Hq.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-CE2X89qN.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BL4H9Iym.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-WMKIgUOp.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-BjeRslap.js +0 -1
- package/dist/gateway/static/root/assets/theme-store-RUBQBsFP.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-PrRsd4go.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-Z8iZe9YP.js +0 -6
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
//#region src/connectors/china-catalog.ts
|
|
2
|
+
const FEISHU_MCP_VERSION = "0.5.1";
|
|
3
|
+
const DINGTALK_MCP_VERSION = "1.1.21";
|
|
4
|
+
const CHINA_CONNECTORS = [
|
|
5
|
+
{
|
|
6
|
+
id: "feishu-workspace",
|
|
7
|
+
version: FEISHU_MCP_VERSION,
|
|
8
|
+
displayName: "飞书办公",
|
|
9
|
+
description: "连接飞书文档、知识库、日历、消息和多维表格。",
|
|
10
|
+
category: "docs",
|
|
11
|
+
kind: "mcp",
|
|
12
|
+
source: "builtin",
|
|
13
|
+
capabilities: [
|
|
14
|
+
"tools",
|
|
15
|
+
"runtime.mcp.stdio",
|
|
16
|
+
"auth.apiKey"
|
|
17
|
+
],
|
|
18
|
+
benefits: ["understand", "act"],
|
|
19
|
+
tags: [
|
|
20
|
+
"中国",
|
|
21
|
+
"飞书",
|
|
22
|
+
"文档",
|
|
23
|
+
"知识库",
|
|
24
|
+
"日历",
|
|
25
|
+
"多维表格"
|
|
26
|
+
],
|
|
27
|
+
branding: {
|
|
28
|
+
logoUrl: "/channel-icons/feishu.svg",
|
|
29
|
+
source: "builtin"
|
|
30
|
+
},
|
|
31
|
+
verificationLevel: "verified",
|
|
32
|
+
auth: { mode: "apiKey" },
|
|
33
|
+
setup: {
|
|
34
|
+
links: [{
|
|
35
|
+
label: "前往飞书开放平台创建应用",
|
|
36
|
+
href: "https://open.feishu.cn/app",
|
|
37
|
+
external: true
|
|
38
|
+
}],
|
|
39
|
+
secrets: [{
|
|
40
|
+
key: "appId",
|
|
41
|
+
label: "App ID",
|
|
42
|
+
description: "在飞书开放平台的应用凭证页复制。",
|
|
43
|
+
required: true
|
|
44
|
+
}, {
|
|
45
|
+
key: "appSecret",
|
|
46
|
+
label: "App Secret",
|
|
47
|
+
description: "与 App ID 同一凭证页,仅保存在本机凭据存储。",
|
|
48
|
+
required: true
|
|
49
|
+
}],
|
|
50
|
+
config: [{
|
|
51
|
+
key: "tools",
|
|
52
|
+
label: "启用工具",
|
|
53
|
+
type: "string",
|
|
54
|
+
required: true,
|
|
55
|
+
defaultValue: "preset.light",
|
|
56
|
+
description: "飞书 MCP 工具预设或逗号分隔的工具列表。"
|
|
57
|
+
}]
|
|
58
|
+
},
|
|
59
|
+
runtime: {
|
|
60
|
+
type: "mcp",
|
|
61
|
+
serverId: "feishu_workspace",
|
|
62
|
+
localPackage: {
|
|
63
|
+
registry: "npm",
|
|
64
|
+
name: "@larksuiteoapi/lark-mcp",
|
|
65
|
+
version: FEISHU_MCP_VERSION
|
|
66
|
+
},
|
|
67
|
+
serverTemplate: {
|
|
68
|
+
command: "npx",
|
|
69
|
+
args: [
|
|
70
|
+
"-y",
|
|
71
|
+
`@larksuiteoapi/lark-mcp@${FEISHU_MCP_VERSION}`,
|
|
72
|
+
"mcp"
|
|
73
|
+
],
|
|
74
|
+
env: {
|
|
75
|
+
APP_ID: "{{secrets.appId}}",
|
|
76
|
+
APP_SECRET: "{{secrets.appSecret}}",
|
|
77
|
+
LARK_TOOLS: "{{config.tools}}",
|
|
78
|
+
LARK_DOMAIN: "https://open.feishu.cn",
|
|
79
|
+
LARK_TOKEN_MODE: "auto"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
permissions: {
|
|
84
|
+
data: [
|
|
85
|
+
"documents",
|
|
86
|
+
"communications",
|
|
87
|
+
"calendar"
|
|
88
|
+
],
|
|
89
|
+
networkDomains: ["open.feishu.cn"],
|
|
90
|
+
localExec: true,
|
|
91
|
+
filesystem: []
|
|
92
|
+
},
|
|
93
|
+
integrationStrategy: {
|
|
94
|
+
lane: "mcp",
|
|
95
|
+
workload: "core",
|
|
96
|
+
preferred: true
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: "dingtalk-workspace",
|
|
101
|
+
version: DINGTALK_MCP_VERSION,
|
|
102
|
+
displayName: "钉钉办公",
|
|
103
|
+
description: "连接钉钉通讯录、待办、日历、机器人和工作通知。",
|
|
104
|
+
category: "automation",
|
|
105
|
+
kind: "mcp",
|
|
106
|
+
source: "builtin",
|
|
107
|
+
capabilities: [
|
|
108
|
+
"tools",
|
|
109
|
+
"runtime.mcp.stdio",
|
|
110
|
+
"auth.apiKey"
|
|
111
|
+
],
|
|
112
|
+
benefits: ["act", "reach"],
|
|
113
|
+
tags: [
|
|
114
|
+
"中国",
|
|
115
|
+
"钉钉",
|
|
116
|
+
"通讯录",
|
|
117
|
+
"待办",
|
|
118
|
+
"日历",
|
|
119
|
+
"机器人"
|
|
120
|
+
],
|
|
121
|
+
branding: {
|
|
122
|
+
logoUrl: "/connector-icons/dingtalk-mark.svg",
|
|
123
|
+
source: "builtin"
|
|
124
|
+
},
|
|
125
|
+
verificationLevel: "verified",
|
|
126
|
+
auth: { mode: "apiKey" },
|
|
127
|
+
setup: {
|
|
128
|
+
links: [{
|
|
129
|
+
label: "前往钉钉开发者后台创建应用",
|
|
130
|
+
href: "https://open-dev.dingtalk.com/fe/app",
|
|
131
|
+
external: true
|
|
132
|
+
}],
|
|
133
|
+
secrets: [{
|
|
134
|
+
key: "clientId",
|
|
135
|
+
label: "Client ID",
|
|
136
|
+
description: "在钉钉应用的凭证与基础信息页复制。",
|
|
137
|
+
required: true
|
|
138
|
+
}, {
|
|
139
|
+
key: "clientSecret",
|
|
140
|
+
label: "Client Secret",
|
|
141
|
+
description: "与 Client ID 同一页面,仅保存在本机凭据存储。",
|
|
142
|
+
required: true
|
|
143
|
+
}],
|
|
144
|
+
config: [{
|
|
145
|
+
key: "activeProfiles",
|
|
146
|
+
label: "启用服务",
|
|
147
|
+
type: "string",
|
|
148
|
+
required: true,
|
|
149
|
+
defaultValue: "dingtalk-contacts,dingtalk-calendar,dingtalk-todo,dingtalk-robot",
|
|
150
|
+
description: "逗号分隔的钉钉 MCP 服务列表。"
|
|
151
|
+
}]
|
|
152
|
+
},
|
|
153
|
+
runtime: {
|
|
154
|
+
type: "mcp",
|
|
155
|
+
serverId: "dingtalk_workspace",
|
|
156
|
+
localPackage: {
|
|
157
|
+
registry: "npm",
|
|
158
|
+
name: "dingtalk-mcp",
|
|
159
|
+
version: DINGTALK_MCP_VERSION
|
|
160
|
+
},
|
|
161
|
+
serverTemplate: {
|
|
162
|
+
command: "npx",
|
|
163
|
+
args: ["-y", `dingtalk-mcp@${DINGTALK_MCP_VERSION}`],
|
|
164
|
+
env: {
|
|
165
|
+
DINGTALK_Client_ID: "{{secrets.clientId}}",
|
|
166
|
+
DINGTALK_Client_Secret: "{{secrets.clientSecret}}",
|
|
167
|
+
ACTIVE_PROFILES: "{{config.activeProfiles}}"
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
permissions: {
|
|
172
|
+
data: [
|
|
173
|
+
"contacts",
|
|
174
|
+
"communications",
|
|
175
|
+
"calendar",
|
|
176
|
+
"tasks"
|
|
177
|
+
],
|
|
178
|
+
networkDomains: ["api.dingtalk.com", "oapi.dingtalk.com"],
|
|
179
|
+
localExec: true,
|
|
180
|
+
filesystem: []
|
|
181
|
+
},
|
|
182
|
+
integrationStrategy: {
|
|
183
|
+
lane: "mcp",
|
|
184
|
+
workload: "core",
|
|
185
|
+
preferred: true
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
id: "wps-cloud-docs",
|
|
190
|
+
version: "2.0.0",
|
|
191
|
+
displayName: "WPS 365 云文档",
|
|
192
|
+
description: "通过 WPS 官方 MCP 搜索云文档、读取内容与评论并管理分享权限。",
|
|
193
|
+
category: "docs",
|
|
194
|
+
kind: "mcp",
|
|
195
|
+
source: "builtin",
|
|
196
|
+
capabilities: [
|
|
197
|
+
"tools",
|
|
198
|
+
"runtime.mcp.streamableHttp",
|
|
199
|
+
"auth.apiKey"
|
|
200
|
+
],
|
|
201
|
+
benefits: ["understand", "act"],
|
|
202
|
+
tags: [
|
|
203
|
+
"中国",
|
|
204
|
+
"WPS",
|
|
205
|
+
"云文档",
|
|
206
|
+
"知识库"
|
|
207
|
+
],
|
|
208
|
+
branding: {
|
|
209
|
+
logoUrl: "/connector-icons/wps-docs.svg",
|
|
210
|
+
source: "builtin"
|
|
211
|
+
},
|
|
212
|
+
verificationLevel: "verified",
|
|
213
|
+
auth: { mode: "apiKey" },
|
|
214
|
+
setup: {
|
|
215
|
+
links: [{
|
|
216
|
+
label: "查看 WPS 用户 Access Token 获取流程",
|
|
217
|
+
href: "https://open.wps.cn/documents/app-integration-dev/wps365/server/certification-authorization/user-authorization/flow",
|
|
218
|
+
external: true
|
|
219
|
+
}],
|
|
220
|
+
secrets: [{
|
|
221
|
+
key: "accessToken",
|
|
222
|
+
label: "用户 Access Token",
|
|
223
|
+
description: "需先创建 WPS 开放平台应用并完成用户授权。",
|
|
224
|
+
required: true
|
|
225
|
+
}]
|
|
226
|
+
},
|
|
227
|
+
runtime: {
|
|
228
|
+
type: "mcp",
|
|
229
|
+
serverId: "wps_cloud_docs",
|
|
230
|
+
serverTemplate: {
|
|
231
|
+
url: "https://openapi.wps.cn/mcp/v2/kso-yundoc/message",
|
|
232
|
+
transport: "streamable-http",
|
|
233
|
+
headers: { Authorization: "Bearer {{secrets.accessToken}}" }
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
permissions: {
|
|
237
|
+
data: ["documents"],
|
|
238
|
+
networkDomains: ["openapi.wps.cn"],
|
|
239
|
+
localExec: false,
|
|
240
|
+
filesystem: []
|
|
241
|
+
},
|
|
242
|
+
integrationStrategy: {
|
|
243
|
+
lane: "mcp",
|
|
244
|
+
workload: "core",
|
|
245
|
+
preferred: true
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
id: "tencent-meeting",
|
|
250
|
+
version: "1.0.0",
|
|
251
|
+
displayName: "腾讯会议",
|
|
252
|
+
description: "通过腾讯会议官方 MCP 查询、创建和管理个人会议。",
|
|
253
|
+
category: "automation",
|
|
254
|
+
kind: "mcp",
|
|
255
|
+
source: "builtin",
|
|
256
|
+
capabilities: [
|
|
257
|
+
"tools",
|
|
258
|
+
"runtime.mcp.streamableHttp",
|
|
259
|
+
"auth.apiKey"
|
|
260
|
+
],
|
|
261
|
+
benefits: ["understand", "act"],
|
|
262
|
+
tags: [
|
|
263
|
+
"中国",
|
|
264
|
+
"腾讯会议",
|
|
265
|
+
"会议",
|
|
266
|
+
"日程"
|
|
267
|
+
],
|
|
268
|
+
branding: {
|
|
269
|
+
logoUrl: "/connector-icons/tencent-meeting-mark.svg",
|
|
270
|
+
source: "builtin"
|
|
271
|
+
},
|
|
272
|
+
verificationLevel: "beta",
|
|
273
|
+
auth: { mode: "apiKey" },
|
|
274
|
+
setup: {
|
|
275
|
+
links: [{
|
|
276
|
+
label: "前往腾讯会议 MCP 获取说明",
|
|
277
|
+
href: "https://meeting.tencent.com/support/topic/2233/index.html",
|
|
278
|
+
external: true
|
|
279
|
+
}],
|
|
280
|
+
secrets: [{
|
|
281
|
+
key: "token",
|
|
282
|
+
label: "腾讯会议 MCP Token",
|
|
283
|
+
description: "目前个人账号可直接获取,企业账号需申请灰度。",
|
|
284
|
+
required: true
|
|
285
|
+
}]
|
|
286
|
+
},
|
|
287
|
+
runtime: {
|
|
288
|
+
type: "mcp",
|
|
289
|
+
serverId: "tencent_meeting",
|
|
290
|
+
serverTemplate: {
|
|
291
|
+
url: "https://mcp.meeting.tencent.com/mcp",
|
|
292
|
+
transport: "streamable-http",
|
|
293
|
+
headers: { "X-Tencent-Meeting-Token": "{{secrets.token}}" }
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
permissions: {
|
|
297
|
+
data: ["calendar", "meeting_records"],
|
|
298
|
+
networkDomains: ["mcp.meeting.tencent.com"],
|
|
299
|
+
localExec: false,
|
|
300
|
+
filesystem: []
|
|
301
|
+
},
|
|
302
|
+
integrationStrategy: {
|
|
303
|
+
lane: "mcp",
|
|
304
|
+
workload: "core",
|
|
305
|
+
preferred: true
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
id: "wps-calendar",
|
|
310
|
+
version: "2.0.0",
|
|
311
|
+
displayName: "WPS 365 日历",
|
|
312
|
+
description: "通过 WPS 官方 MCP 查询日程、管理参与人并创建会议安排。",
|
|
313
|
+
category: "automation",
|
|
314
|
+
kind: "mcp",
|
|
315
|
+
source: "builtin",
|
|
316
|
+
capabilities: [
|
|
317
|
+
"tools",
|
|
318
|
+
"runtime.mcp.streamableHttp",
|
|
319
|
+
"auth.apiKey"
|
|
320
|
+
],
|
|
321
|
+
benefits: ["understand", "act"],
|
|
322
|
+
tags: [
|
|
323
|
+
"中国",
|
|
324
|
+
"WPS",
|
|
325
|
+
"日历",
|
|
326
|
+
"日程"
|
|
327
|
+
],
|
|
328
|
+
branding: {
|
|
329
|
+
logoUrl: "/connector-icons/wps-calendar.svg",
|
|
330
|
+
source: "builtin"
|
|
331
|
+
},
|
|
332
|
+
verificationLevel: "verified",
|
|
333
|
+
auth: { mode: "apiKey" },
|
|
334
|
+
setup: {
|
|
335
|
+
links: [{
|
|
336
|
+
label: "查看 WPS 用户 Access Token 获取流程",
|
|
337
|
+
href: "https://open.wps.cn/documents/app-integration-dev/wps365/server/certification-authorization/user-authorization/flow",
|
|
338
|
+
external: true
|
|
339
|
+
}],
|
|
340
|
+
secrets: [{
|
|
341
|
+
key: "accessToken",
|
|
342
|
+
label: "用户 Access Token",
|
|
343
|
+
description: "需先创建 WPS 开放平台应用并完成用户授权。",
|
|
344
|
+
required: true
|
|
345
|
+
}]
|
|
346
|
+
},
|
|
347
|
+
runtime: {
|
|
348
|
+
type: "mcp",
|
|
349
|
+
serverId: "wps_calendar",
|
|
350
|
+
serverTemplate: {
|
|
351
|
+
url: "https://openapi.wps.cn/mcp/v2/kso-calendar/message",
|
|
352
|
+
transport: "streamable-http",
|
|
353
|
+
headers: { Authorization: "Bearer {{secrets.accessToken}}" }
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
permissions: {
|
|
357
|
+
data: ["calendar"],
|
|
358
|
+
networkDomains: ["openapi.wps.cn"],
|
|
359
|
+
localExec: false,
|
|
360
|
+
filesystem: []
|
|
361
|
+
},
|
|
362
|
+
integrationStrategy: {
|
|
363
|
+
lane: "mcp",
|
|
364
|
+
workload: "core",
|
|
365
|
+
preferred: true
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
id: "wps-mail",
|
|
370
|
+
version: "2.0.0",
|
|
371
|
+
displayName: "WPS 365 邮箱",
|
|
372
|
+
description: "通过 WPS 官方 MCP 搜索邮件、读取邮件并创建或发送草稿。",
|
|
373
|
+
category: "automation",
|
|
374
|
+
kind: "mcp",
|
|
375
|
+
source: "builtin",
|
|
376
|
+
capabilities: [
|
|
377
|
+
"tools",
|
|
378
|
+
"runtime.mcp.streamableHttp",
|
|
379
|
+
"auth.apiKey"
|
|
380
|
+
],
|
|
381
|
+
benefits: ["understand", "act"],
|
|
382
|
+
tags: [
|
|
383
|
+
"中国",
|
|
384
|
+
"WPS",
|
|
385
|
+
"邮箱",
|
|
386
|
+
"邮件"
|
|
387
|
+
],
|
|
388
|
+
branding: {
|
|
389
|
+
logoUrl: "/connector-icons/wps-mail.svg",
|
|
390
|
+
source: "builtin"
|
|
391
|
+
},
|
|
392
|
+
verificationLevel: "verified",
|
|
393
|
+
auth: { mode: "apiKey" },
|
|
394
|
+
setup: {
|
|
395
|
+
links: [{
|
|
396
|
+
label: "查看 WPS 用户 Access Token 获取流程",
|
|
397
|
+
href: "https://open.wps.cn/documents/app-integration-dev/wps365/server/certification-authorization/user-authorization/flow",
|
|
398
|
+
external: true
|
|
399
|
+
}],
|
|
400
|
+
secrets: [{
|
|
401
|
+
key: "accessToken",
|
|
402
|
+
label: "用户 Access Token",
|
|
403
|
+
description: "需先创建 WPS 开放平台应用并完成用户授权。",
|
|
404
|
+
required: true
|
|
405
|
+
}]
|
|
406
|
+
},
|
|
407
|
+
runtime: {
|
|
408
|
+
type: "mcp",
|
|
409
|
+
serverId: "wps_mail",
|
|
410
|
+
serverTemplate: {
|
|
411
|
+
url: "https://openapi.wps.cn/mcp/v2/kso-mail/message",
|
|
412
|
+
transport: "streamable-http",
|
|
413
|
+
headers: { Authorization: "Bearer {{secrets.accessToken}}" }
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
permissions: {
|
|
417
|
+
data: ["email"],
|
|
418
|
+
networkDomains: ["openapi.wps.cn"],
|
|
419
|
+
localExec: false,
|
|
420
|
+
filesystem: []
|
|
421
|
+
},
|
|
422
|
+
integrationStrategy: {
|
|
423
|
+
lane: "mcp",
|
|
424
|
+
workload: "core",
|
|
425
|
+
preferred: true
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
];
|
|
429
|
+
//#endregion
|
|
430
|
+
export { CHINA_CONNECTORS };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CredentialResolver } from '../auth/credentials.js';
|
|
2
|
+
export type ComposioBackend = {
|
|
3
|
+
id: string;
|
|
4
|
+
mode: 'managed' | 'byok';
|
|
5
|
+
label: string;
|
|
6
|
+
credential_ref: string | null;
|
|
7
|
+
credential_source: 'stored' | 'environment';
|
|
8
|
+
verified_at: string | null;
|
|
9
|
+
active: number;
|
|
10
|
+
created_at: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function listComposioBackends(): ComposioBackend[];
|
|
13
|
+
export declare function getComposioBackend(id?: string): ComposioBackend | undefined;
|
|
14
|
+
export declare function addComposioBackend(input: {
|
|
15
|
+
id?: string;
|
|
16
|
+
mode: 'managed' | 'byok';
|
|
17
|
+
label: string;
|
|
18
|
+
credentialRef?: string;
|
|
19
|
+
credentialSource?: 'stored' | 'environment';
|
|
20
|
+
}): ComposioBackend;
|
|
21
|
+
export declare function activateComposioBackend(id: string): void;
|
|
22
|
+
export declare function removeComposioBackend(id: string, resolver?: CredentialResolver): Promise<void>;
|
|
23
|
+
/** Bootstrap once; subsequent routing always uses the explicitly selected backend. */
|
|
24
|
+
export declare function ensureComposioBackend(resolver?: CredentialResolver): Promise<ComposioBackend>;
|
|
25
|
+
export declare function resolveBackendKey(backend: ComposioBackend, resolver?: CredentialResolver): Promise<string | null>;
|
|
26
|
+
export declare function markComposioBackendVerified(id: string): void;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
2
|
+
import { CredentialResolver, init_credentials } from "../auth/credentials.js";
|
|
3
|
+
import { randomUUID } from "node:crypto";
|
|
4
|
+
//#region src/connectors/composio-backends.ts
|
|
5
|
+
init_credentials();
|
|
6
|
+
init_transaction();
|
|
7
|
+
function listComposioBackends() {
|
|
8
|
+
return getSqliteDatabase().prepare("SELECT * FROM connector_backends ORDER BY created_at").all();
|
|
9
|
+
}
|
|
10
|
+
function getComposioBackend(id) {
|
|
11
|
+
return id ? getSqliteDatabase().prepare("SELECT * FROM connector_backends WHERE id = ?").get(id) : getSqliteDatabase().prepare("SELECT * FROM connector_backends WHERE active = 1").get();
|
|
12
|
+
}
|
|
13
|
+
function addComposioBackend(input) {
|
|
14
|
+
const id = input.id ?? randomUUID();
|
|
15
|
+
getSqliteDatabase().prepare(`INSERT INTO connector_backends(id, mode, label, credential_ref, credential_source, created_at)
|
|
16
|
+
VALUES (?, ?, ?, ?, ?, ?)`).run(id, input.mode, input.label, input.credentialRef ?? null, input.credentialSource ?? "stored", (/* @__PURE__ */ new Date()).toISOString());
|
|
17
|
+
return getComposioBackend(id);
|
|
18
|
+
}
|
|
19
|
+
function activateComposioBackend(id) {
|
|
20
|
+
if (!getComposioBackend(id)) throw new Error("Connection service not found.");
|
|
21
|
+
runSqliteWriteTransaction((db) => {
|
|
22
|
+
db.prepare("UPDATE connector_backends SET active = 0 WHERE active = 1").run();
|
|
23
|
+
db.prepare("UPDATE connector_backends SET active = 1 WHERE id = ?").run(id);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
async function removeComposioBackend(id, resolver = new CredentialResolver()) {
|
|
27
|
+
const backend = getComposioBackend(id);
|
|
28
|
+
if (!backend) throw new Error("Connection service not found.");
|
|
29
|
+
if (backend.active) throw new Error("Select another connection service before removing this one.");
|
|
30
|
+
if (getSqliteDatabase().prepare(`SELECT 1 FROM connector_connections c JOIN connector_accounts a ON a.id = c.account_id
|
|
31
|
+
WHERE a.backend_id = ? AND c.status NOT IN ('revoked') LIMIT 1`).get(id)) throw new Error("Disconnect the accounts using this service before removing its credentials.");
|
|
32
|
+
if (backend.credential_ref && backend.credential_source === "stored") await resolver.deleteProviderCredential(backend.credential_ref);
|
|
33
|
+
getSqliteDatabase().prepare("DELETE FROM connector_backends WHERE id = ?").run(id);
|
|
34
|
+
}
|
|
35
|
+
/** Bootstrap once; subsequent routing always uses the explicitly selected backend. */
|
|
36
|
+
async function ensureComposioBackend(resolver = new CredentialResolver()) {
|
|
37
|
+
const existing = getComposioBackend();
|
|
38
|
+
if (existing) return existing;
|
|
39
|
+
const storedKey = await resolver.resolveApiKey("connector-composio-api-key").catch(() => null);
|
|
40
|
+
const envRef = process.env.XOPC_COMPOSIO_API_KEY?.trim() ? "XOPC_COMPOSIO_API_KEY" : process.env.COMPOSIO_API_KEY?.trim() ? "COMPOSIO_API_KEY" : void 0;
|
|
41
|
+
const key = storedKey || (envRef ? process.env[envRef] : void 0);
|
|
42
|
+
const initialized = getComposioBackend();
|
|
43
|
+
if (initialized) return initialized;
|
|
44
|
+
const backend = addComposioBackend({
|
|
45
|
+
mode: key ? "byok" : "managed",
|
|
46
|
+
label: key ? "Composio" : "XOPC Cloud",
|
|
47
|
+
credentialRef: storedKey ? "connector-composio-api-key" : envRef,
|
|
48
|
+
credentialSource: !storedKey && envRef ? "environment" : "stored"
|
|
49
|
+
});
|
|
50
|
+
getSqliteDatabase().prepare("UPDATE connector_accounts SET backend_id = ? WHERE backend_id IS NULL").run(backend.id);
|
|
51
|
+
activateComposioBackend(backend.id);
|
|
52
|
+
return getComposioBackend(backend.id);
|
|
53
|
+
}
|
|
54
|
+
async function resolveBackendKey(backend, resolver = new CredentialResolver()) {
|
|
55
|
+
if (backend.mode === "managed") return null;
|
|
56
|
+
if (backend.credential_source === "environment") return backend.credential_ref ? process.env[backend.credential_ref]?.trim() || null : null;
|
|
57
|
+
const key = backend.credential_ref ? await resolver.resolveApiKey(backend.credential_ref) : null;
|
|
58
|
+
if (key?.trim()) return key.trim();
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
function markComposioBackendVerified(id) {
|
|
62
|
+
getSqliteDatabase().prepare("UPDATE connector_backends SET verified_at = ? WHERE id = ?").run((/* @__PURE__ */ new Date()).toISOString(), id);
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { activateComposioBackend, addComposioBackend, ensureComposioBackend, getComposioBackend, listComposioBackends, markComposioBackendVerified, removeComposioBackend, resolveBackendKey };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { listCachedConnectorCatalogEntries, replaceConnectorCatalogEntries } from "../storage/sqlite/connector-repository.js";
|
|
1
|
+
import { init_connector_repository, listCachedConnectorCatalogEntries, replaceConnectorCatalogEntries } from "../storage/sqlite/connector-repository.js";
|
|
2
2
|
import { ComposioSessionsAdapter } from "./composio-sessions.js";
|
|
3
3
|
import { composioIntegrationStrategy } from "./integration-strategy.js";
|
|
4
4
|
import { connectorUnderstandingCapability } from "./learning-recipes.js";
|
|
5
5
|
//#region src/connectors/composio-catalog.ts
|
|
6
|
+
init_connector_repository();
|
|
6
7
|
const CATALOG_CACHE_TTL_MS = 360 * 60 * 1e3;
|
|
7
8
|
const COMPOSIO_RECOMMENDED_TOOLKITS = [
|
|
8
9
|
"gmail",
|
|
@@ -81,7 +81,9 @@ var ManagedComposioClient = class {
|
|
|
81
81
|
return { toolSchemas: Object.assign({}, ...results.map((result) => result.toolSchemas ?? {})) };
|
|
82
82
|
},
|
|
83
83
|
execute: async (toolSlug, args = {}, options) => {
|
|
84
|
-
const
|
|
84
|
+
const candidates = connectedAccounts[toolkit()] ?? [];
|
|
85
|
+
const selected = options?.account ?? (candidates.length === 1 ? candidates[0] : void 0);
|
|
86
|
+
if (!selected) throw new Error("Select one account explicitly before executing a connected app tool.");
|
|
85
87
|
return (await this.request({
|
|
86
88
|
path: "/connectors/composio/execute",
|
|
87
89
|
method: "POST",
|
|
@@ -2,7 +2,7 @@ import { createLogger } from "../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { claimConnectorWebhookDelivery, completeConnectorWebhookDelivery, releaseConnectorWebhookDelivery } from "../storage/sqlite/connector-repository.js";
|
|
4
4
|
import "../storage/sqlite/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { ensureComposioBackend, listComposioBackends } from "./composio-backends.js";
|
|
6
6
|
import { ManagedComposioClient } from "./composio-managed-client.js";
|
|
7
7
|
import { appendComposioTriggerEvent, applyComposioConnectionLifecycleEvent, normalizeComposioTriggerPayload } from "./composio-triggers.js";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
@@ -43,7 +43,10 @@ var ManagedComposioEventPoller = class {
|
|
|
43
43
|
}
|
|
44
44
|
async runSync() {
|
|
45
45
|
const config = this.input.getConfig();
|
|
46
|
-
const hasByok = this.input.hasByok ?? (async () =>
|
|
46
|
+
const hasByok = this.input.hasByok ?? (async () => {
|
|
47
|
+
await ensureComposioBackend();
|
|
48
|
+
return !listComposioBackends().some((backend) => backend.mode === "managed");
|
|
49
|
+
});
|
|
47
50
|
if (!hasInstalledComposioToolkit(config) || await hasByok()) return;
|
|
48
51
|
const client = this.input.client ?? new ManagedComposioClient();
|
|
49
52
|
try {
|
|
@@ -54,6 +54,7 @@ export type ComposioSessionLike = {
|
|
|
54
54
|
}): Promise<unknown>;
|
|
55
55
|
};
|
|
56
56
|
export type ComposioSessionsClient = {
|
|
57
|
+
backendId?: string;
|
|
57
58
|
mode?: 'managed' | 'byok';
|
|
58
59
|
sessions: {
|
|
59
60
|
create(userId: string, config?: ToolRouterCreateSessionConfig): Promise<ComposioSessionLike>;
|
|
@@ -62,6 +63,7 @@ export type ComposioSessionsClient = {
|
|
|
62
63
|
list(query?: {
|
|
63
64
|
userIds?: string[];
|
|
64
65
|
toolkitSlugs?: string[];
|
|
66
|
+
cursor?: string;
|
|
65
67
|
}): Promise<unknown>;
|
|
66
68
|
delete(id: string): Promise<unknown>;
|
|
67
69
|
refresh(id: string): Promise<unknown>;
|
|
@@ -12,6 +12,7 @@ export type ComposioToolkitCatalogItem = {
|
|
|
12
12
|
providerConnectionId?: string;
|
|
13
13
|
};
|
|
14
14
|
export type ComposioAuthorizeResult = {
|
|
15
|
+
attemptId: string;
|
|
15
16
|
toolkit: string;
|
|
16
17
|
connectionId: string;
|
|
17
18
|
connectUrl?: string;
|
|
@@ -19,6 +20,7 @@ export type ComposioAuthorizeResult = {
|
|
|
19
20
|
};
|
|
20
21
|
export type { ComposioAuthConfigOption, ComposioSessionLike, ComposioSessionsClient, ComposioToolkitAuthState, } from './composio-session-types.js';
|
|
21
22
|
export type ComposioSessionContext = {
|
|
23
|
+
backendId?: string;
|
|
22
24
|
principalId: string;
|
|
23
25
|
installationScope?: string;
|
|
24
26
|
providerPrincipalId?: string;
|
|
@@ -27,15 +29,18 @@ export type ComposioSessionContext = {
|
|
|
27
29
|
connectedAccounts?: Record<string, string[]>;
|
|
28
30
|
callbackUrl?: string;
|
|
29
31
|
};
|
|
30
|
-
type ClientFactory = () => Promise<ComposioSessionsClient>;
|
|
32
|
+
type ClientFactory = (backendId?: string) => Promise<ComposioSessionsClient>;
|
|
31
33
|
/** Convert local identities to stable opaque Composio user IDs without disclosing user data. */
|
|
32
34
|
export declare function createComposioPrincipalId(principalId: string, installationScope?: string): string;
|
|
33
35
|
export declare class ComposioSessionsAdapter {
|
|
34
36
|
private readonly createClient;
|
|
37
|
+
private readonly injectedClient;
|
|
38
|
+
private readonly resolver;
|
|
35
39
|
constructor(options?: {
|
|
36
40
|
resolver?: CredentialResolver;
|
|
37
41
|
clientFactory?: ClientFactory;
|
|
38
42
|
fileDownloadDir?: string;
|
|
43
|
+
apiKey?: string;
|
|
39
44
|
});
|
|
40
45
|
createSession(context: ComposioSessionContext): Promise<ComposioSessionLike>;
|
|
41
46
|
getToolkitAuthState(toolkit: string): Promise<ComposioToolkitAuthState>;
|
|
@@ -45,8 +50,12 @@ export declare class ComposioSessionsAdapter {
|
|
|
45
50
|
authConfigId?: string;
|
|
46
51
|
installationId?: string;
|
|
47
52
|
alias?: string;
|
|
53
|
+
expectedAccountId?: string;
|
|
48
54
|
}): Promise<ComposioAuthorizeResult>;
|
|
49
|
-
|
|
55
|
+
/** Verify a replacement credential without changing local authorizations. */
|
|
56
|
+
verifyConnections(connections: ConnectorConnection[]): Promise<void>;
|
|
57
|
+
private listAllAccounts;
|
|
58
|
+
syncConnections(context: Pick<ComposioSessionContext, 'principalId' | 'installationScope' | 'backendId'>): Promise<ConnectorConnection[]>;
|
|
50
59
|
revokeConnection(connection: ConnectorConnection): Promise<void>;
|
|
51
60
|
refreshConnection(connection: ConnectorConnection): Promise<ConnectorConnection>;
|
|
52
61
|
executeWithPolicy(input: {
|