@xopcai/xopc 0.0.303 → 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/README.md +4 -4
- package/README.zh-CN.md +4 -4
- package/dist/browser-ext/dist/assets/{auth-B_9ZuGDx.js → auth-C3yV1y_l.js} +67 -22
- package/dist/browser-ext/dist/background.js +4 -4
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +3 -3
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/xopc.extension.json +0 -3
- package/dist/extensions/telegram/xopc.extension.json +1 -4
- package/dist/extensions/weixin/xopc.extension.json +0 -3
- package/dist/gateway/static/root/assets/{activity-store-DCi5rh4e.js → activity-store-wgSB2HYK.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Ch3DzUvP.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-DXHD-ST3.js → agents-BlrHMbRx.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CAV9PN9i.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-Bzw4fQP8.js +1 -0
- 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-BKGzaVvM.js → archive-plugin-CQ2NaoHb.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-8bARdLnp.js → attachment-load-BFi1H7yJ.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BAEenyzx.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-Cv3GS9Eo.js → binary-plugins-D07eWmOx.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-D4ZIVQbk.css → block-editor-BdOTO0Yo.css} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DUeb92LG.js → block-editor-CtVnjyYU.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-BGT0xoTv.js → browser-automation-inputs-BzkJog8e.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-D1O22WIf.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/button-CS04eWY9.js +1 -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-C_icwbWj.js → channels-status-swr-B2JwuTjG.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-D-JYPVYl.js → chat-terminal-dock-B62SZdAo.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-Bcfp948A.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-CTMi_tql.js +2 -0
- package/dist/gateway/static/root/assets/date-picker-B71AJK50.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-UtoUm57Q.js → dependency-picker-DlyGK-kA.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Bryx7gRM.js → desktop-pet-DGkbTE8_.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-BY8r9j66.js +1 -0
- package/dist/gateway/static/root/assets/device-pairing-wizard-DzRrgd59.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-DQlFTVBx.js → extension-debug-page-L8Mm1n3A.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BSsqRDXh.js → extension-page-CFc4vSNU.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DbVZv9ve.js → extension-settings-page-B5zWyHr3.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-D5AM8cyQ.js → gateway-config-swr-B6wHa6ZI.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-B53R0CA4.js +1 -0
- package/dist/gateway/static/root/assets/gateway-realtime-store-BLDgrJ30.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-D7qmTH4R.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CSJWdnFs.js → gateway-startup-retry-DRzGnEV-.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-Cxowc29b.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-BNh604hw.js → image-generation-api-Ck_pyDom.js} +1 -1
- package/dist/gateway/static/root/assets/imports-page-ByBX7ome.js +1 -0
- package/dist/gateway/static/root/assets/index-RBCkv8a_.js +79 -0
- package/dist/gateway/static/root/assets/index-cFU4S35z.css +1 -0
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-C45RlO8a.js +1 -0
- package/dist/gateway/static/root/assets/local-app-workbench-page-DP0x2jpR.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-CXPaPDGm.js → local-apps-page-C_AQc2bI.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-DLK05Y1a.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-D1uwSutV.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-B8maDRWh.js → markdown-view-BInabSKf.js} +2 -2
- package/dist/gateway/static/root/assets/{media-plugins-tSJ0CvcX.js → media-plugins-C4mhf13f.js} +1 -1
- package/dist/gateway/static/root/assets/messages-F74LVAiU.js +3 -0
- 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-CQx6H-GS.js → page-tabs-1go_BtX1.js} +1 -1
- package/dist/gateway/static/root/assets/{popover-select-DldSX8GX.js → popover-select-9i-ZtHXL.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-A3-bVtdy.js → preview-open-alternatives-DmoSC0j1.js} +1 -1
- package/dist/gateway/static/root/assets/{proactive-page-D46cR3sf.js → proactive-page-xAjKTIID.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CujZXOea.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-BMFL4vis.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-CR0qvq9C.js → runtime-tools-settings-panel-ClkOoxDl.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-BUD9lLEE.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-BZPCUH6a.js → settings-form-section-Dor39QON.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-XoHmqIdm.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-BFWZoXdm.js +2 -0
- 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-BE9JXz4U.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-CH-quGxZ.js → skills-page.utils-Ii8qeXhs.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-CGC7eBso.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-DDOlOYlj.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-BydB6x2K.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-CPUDBcag.js → voice-api-key-field-COTzshjL.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-bZqN8-UF.js → voice-config-api-DgJML_uM.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-D_FmJbGH.js → work-discovery-overlay-_URrXbi4.js} +1 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-CALs-1nd.js +3 -0
- 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 +14 -12
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/device-pairing.js +100 -7
- package/dist/packages/gateway-contract/src/gateway-scopes.js +53 -0
- package/dist/packages/gateway-contract/src/index.js +2 -0
- package/dist/packages/realtime-client/src/index.js +14 -2
- package/dist/packages/realtime-protocol/src/index.js +18 -14
- package/dist/src/agent/agent-instance-gateway.d.ts +2 -0
- package/dist/src/agent/agent-manager.d.ts +2 -0
- package/dist/src/agent/agent-manager.js +40 -12
- package/dist/src/agent/agent-scope.d.ts +4 -1
- package/dist/src/agent/agent-scope.js +19 -3
- package/dist/src/agent/commands/command-isolation.js +11 -9
- package/dist/src/agent/commands/command-registry.js +18 -33
- package/dist/src/agent/context/audit.js +12 -2
- package/dist/src/agent/context/coordinator.d.ts +13 -3
- package/dist/src/agent/context/coordinator.js +27 -11
- package/dist/src/agent/context/execution-context.js +42 -22
- package/dist/src/agent/context/execution-context.types.d.ts +4 -2
- package/dist/src/agent/context/execution-scope.d.ts +2 -2
- package/dist/src/agent/context/execution-scope.js +1 -1
- package/dist/src/agent/context/project-context.d.ts +2 -2
- package/dist/src/agent/context/project-context.js +3 -3
- package/dist/src/agent/embedded/run-for-session.d.ts +1 -0
- package/dist/src/agent/embedded/run-for-session.js +7 -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/inbound/attachment-pipeline.d.ts +2 -0
- package/dist/src/agent/inbound/attachment-pipeline.js +3 -3
- package/dist/src/agent/inbound/inbound-loop.js +1 -0
- package/dist/src/agent/inbound/turn-dispatcher.js +3 -3
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +1 -1
- package/dist/src/agent/mcp/mcp-stdio-transport.js +5 -2
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +1 -1
- package/dist/src/agent/memory/compaction-promotion.js +7 -2
- package/dist/src/agent/memory/create-memory-manager.js +1 -0
- package/dist/src/agent/memory/manager.d.ts +6 -0
- package/dist/src/agent/memory/manager.js +74 -39
- package/dist/src/agent/memory/runtime.d.ts +3 -3
- package/dist/src/agent/memory/runtime.js +11 -4
- package/dist/src/agent/orchestration/agent-orchestrator.js +4 -1
- package/dist/src/agent/prompt/cache-boundary.d.ts +2 -0
- package/dist/src/agent/prompt/cache-boundary.js +10 -1
- package/dist/src/agent/service/build-direct-message-content.d.ts +1 -0
- package/dist/src/agent/service/build-direct-message-content.js +2 -1
- package/dist/src/agent/service/direct-turn-helpers.js +3 -2
- package/dist/src/agent/service/process-direct-streaming.d.ts +3 -1
- package/dist/src/agent/service/process-direct-streaming.js +3 -2
- package/dist/src/agent/service/webchat-tts.d.ts +0 -4
- package/dist/src/agent/service/webchat-tts.js +20 -19
- package/dist/src/agent/tools/factory.js +3 -3
- package/dist/src/agent/tools/knowledge-memory-tool.d.ts +2 -2
- package/dist/src/agent/tools/knowledge-memory-tool.js +7 -7
- package/dist/src/browser/native-messaging-host.js +2 -2
- package/dist/src/channels/attachments/voice-stt-webchat.d.ts +3 -0
- package/dist/src/channels/attachments/voice-stt-webchat.js +22 -9
- package/dist/src/cli/commands/agent.js +2 -0
- package/dist/src/cli/commands/config.js +8 -9
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +69 -44
- package/dist/src/cli/commands/extension-pack.js +0 -2
- package/dist/src/cli/commands/extension.js +4 -25
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/onboard/gateway.js +2 -1
- package/dist/src/cli/utils/init-workspace-core.js +5 -2
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/loader.d.ts +1 -0
- package/dist/src/config/loader.js +14 -1
- package/dist/src/config/schema.d.ts +22 -3
- package/dist/src/config/schema.js +13 -3
- 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/execution-environments/local-worktree-manager.js +17 -15
- package/dist/src/execution-environments/store.js +4 -2
- package/dist/src/execution-environments/types.d.ts +3 -0
- package/dist/src/execution-environments/types.js +2 -1
- package/dist/src/execution-environments/worktree-safety.d.ts +8 -0
- package/dist/src/execution-environments/worktree-safety.js +43 -0
- package/dist/src/extensions/activation-planner.d.ts +1 -1
- package/dist/src/extensions/activation-planner.js +1 -1
- package/dist/src/extensions/api-version.d.ts +4 -0
- package/dist/src/extensions/api-version.js +15 -0
- package/dist/src/extensions/api.d.ts +3 -9
- package/dist/src/extensions/api.js +26 -32
- package/dist/src/extensions/config-validation.d.ts +8 -0
- package/dist/src/extensions/config-validation.js +25 -0
- package/dist/src/extensions/extension-registry-impl.d.ts +20 -9
- package/dist/src/extensions/extension-registry-impl.js +79 -11
- package/dist/src/extensions/hooks.d.ts +1 -1
- package/dist/src/extensions/index.d.ts +2 -1
- package/dist/src/extensions/install-transaction.d.ts +2 -0
- package/dist/src/extensions/install-transaction.js +32 -21
- package/dist/src/extensions/install.js +18 -1
- package/dist/src/extensions/loader.d.ts +5 -5
- package/dist/src/extensions/loader.js +109 -47
- package/dist/src/extensions/lockfile.d.ts +3 -5
- package/dist/src/extensions/lockfile.js +41 -14
- package/dist/src/extensions/normalize-manifest.js +6 -60
- package/dist/src/extensions/sdk/index.d.ts +3 -2
- package/dist/src/extensions/sdk/index.js +2 -2
- package/dist/src/extensions/sdk/testing.js +0 -4
- package/dist/src/extensions/security.js +5 -7
- package/dist/src/extensions/types/core.d.ts +0 -5
- package/dist/src/extensions/types/index.d.ts +1 -1
- package/dist/src/extensions/types/manifest.d.ts +1 -25
- package/dist/src/extensions/types/providers.d.ts +1 -1
- package/dist/src/extensions/types/registration.d.ts +0 -12
- package/dist/src/extensions/update.js +71 -30
- package/dist/src/gateway/heartbeat/service.js +2 -2
- package/dist/src/gateway/hono/lib/config-payload.d.ts +3 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +47 -10
- 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/devices.js +10 -7
- package/dist/src/gateway/hono/routes/endpoint-compatibility.js +6 -0
- package/dist/src/gateway/hono/routes/extension-gateway.js +0 -33
- package/dist/src/gateway/hono/routes/home.js +4 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +0 -1
- package/dist/src/gateway/hono/routes/mcp.js +1 -1
- package/dist/src/gateway/hono/routes/realtime.js +30 -8
- package/dist/src/gateway/hono/routes/user-model.js +25 -6
- package/dist/src/gateway/index.js +4 -1
- package/dist/src/gateway/lock.d.ts +2 -0
- package/dist/src/gateway/lock.js +31 -14
- package/dist/src/gateway/run-loop.js +2 -1
- package/dist/src/gateway/security/gateway-scopes.d.ts +2 -5
- package/dist/src/gateway/security/gateway-scopes.js +3 -45
- package/dist/src/gateway/security/index.js +2 -1
- package/dist/src/gateway/service.js +11 -7
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/imports/importService.d.ts +1 -1
- package/dist/src/imports/inventory.js +16 -2
- package/dist/src/imports/productImport.js +5 -5
- package/dist/src/imports/types.d.ts +3 -3
- package/dist/src/infra/exec.d.ts +2 -2
- package/dist/src/infra/exec.js +32 -27
- package/dist/src/infra/run-command.js +15 -50
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/knowledge/connected-knowledge-pipeline.js +13 -3
- package/dist/src/knowledge-memory/domain.d.ts +17 -1
- package/dist/src/knowledge-memory/index.js +2 -2
- package/dist/src/knowledge-memory/repository.d.ts +26 -4
- package/dist/src/knowledge-memory/repository.js +171 -36
- package/dist/src/mcp/channel-bridge.js +7 -3
- package/dist/src/media-understanding/registry.js +6 -1
- package/dist/src/migrations/knowledge-memory-read-policy-config.d.ts +2 -0
- package/dist/src/migrations/knowledge-memory-read-policy-config.js +48 -0
- package/dist/src/migrations/runner.js +2 -1
- package/dist/src/proactive/follow-ups.js +2 -1
- package/dist/src/process/bounded-output.d.ts +10 -0
- package/dist/src/process/bounded-output.js +41 -0
- package/dist/src/process/kill-tree.d.ts +6 -17
- package/dist/src/process/kill-tree.js +43 -75
- package/dist/src/process/process-spec.d.ts +39 -0
- package/dist/src/process/process-spec.js +13 -0
- package/dist/src/process/run-process.d.ts +4 -0
- package/dist/src/process/run-process.js +97 -0
- package/dist/src/providers/plugin-registry.d.ts +1 -1
- package/dist/src/providers/plugin-registry.js +6 -0
- package/dist/src/realtime/runtime.js +3 -1
- package/dist/src/session/store.js +1 -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/device-pairing-approval.js +1 -1
- package/dist/src/storage/sqlite/index.d.ts +1 -1
- package/dist/src/storage/sqlite/index.js +6 -4
- package/dist/src/storage/sqlite/migrations/180_execution_environment_ownership.sql +7 -0
- package/dist/src/storage/sqlite/migrations/181_knowledge_item_status_events.sql +12 -0
- 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/storage/sqlite/schema.sql +13 -0
- package/dist/src/storage/sqlite/transcript-repository.d.ts +4 -0
- package/dist/src/storage/sqlite/transcript-repository.js +36 -1
- package/dist/src/tasks/home-query-service.js +3 -3
- package/dist/src/tui/backends/embedded-backend.d.ts +24 -8
- package/dist/src/tui/backends/embedded-backend.js +114 -10
- package/dist/src/tui/backends/gateway-realtime-backend.d.ts +18 -0
- package/dist/src/tui/backends/gateway-realtime-backend.js +31 -4
- package/dist/src/tui/components/assistant-message.d.ts +4 -1
- package/dist/src/tui/components/assistant-message.js +10 -2
- package/dist/src/tui/components/cell-render-mode.d.ts +4 -0
- package/dist/src/tui/components/cell-render-mode.js +1 -0
- package/dist/src/tui/components/chat-log.d.ts +17 -4
- package/dist/src/tui/components/chat-log.js +68 -50
- package/dist/src/tui/components/custom-editor.d.ts +2 -2
- package/dist/src/tui/components/custom-editor.js +5 -1
- package/dist/src/tui/components/pending-input-preview.d.ts +9 -0
- package/dist/src/tui/components/pending-input-preview.js +33 -0
- package/dist/src/tui/components/semantic-cell.d.ts +17 -0
- package/dist/src/tui/components/semantic-cell.js +29 -0
- package/dist/src/tui/components/tool-execution.d.ts +5 -1
- package/dist/src/tui/components/tool-execution.js +33 -10
- package/dist/src/tui/components/transcript-overlay.d.ts +29 -0
- package/dist/src/tui/components/transcript-overlay.js +114 -0
- package/dist/src/tui/components/tui-bottom-bar.js +3 -1
- package/dist/src/tui/components/user-message.d.ts +5 -1
- package/dist/src/tui/components/user-message.js +12 -1
- package/dist/src/tui/extension-host/load-extensions.d.ts +1 -1
- package/dist/src/tui/extension-host/runtime-context.js +2 -1
- package/dist/src/tui/extension-host/runtime.d.ts +1 -1
- package/dist/src/tui/format-tui-hotkeys.js +8 -1
- package/dist/src/tui/tui-agent-events.js +31 -0
- package/dist/src/tui/tui-backend.d.ts +23 -11
- package/dist/src/tui/tui-backend.js +1 -9
- package/dist/src/tui/tui-chat-input-state.d.ts +25 -0
- package/dist/src/tui/tui-chat-input-state.js +36 -0
- package/dist/src/tui/tui-command-formatters.js +2 -1
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui-types.d.ts +2 -1
- package/dist/src/tui/tui-types.js +2 -1
- package/dist/src/tui/tui.js +122 -30
- package/dist/src/tui/xopc-tui-keybindings.d.ts +23 -3
- package/dist/src/tui/xopc-tui-keybindings.js +22 -2
- package/dist/src/user-context/access-policy.d.ts +2 -2
- package/dist/src/user-context/access-policy.js +10 -2
- package/dist/src/user-context/config.d.ts +23 -6
- package/dist/src/user-context/config.js +54 -7
- package/dist/src/voice/platform-streams.js +11 -1
- package/dist/src/voice/realtime/omniEngine.js +13 -1
- package/dist/src/voice/realtime/runtime.js +2 -1
- package/dist/src/voice/tts/audio.js +1 -1
- package/dist/src/voice/tts/speech-registry.js +6 -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 +5 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-4oGrNj3m.js +0 -1
- package/dist/gateway/static/root/assets/api-fPapljyb.js +0 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-CdXnNtTg.js +0 -1
- package/dist/gateway/static/root/assets/appearance-settings-izNAyDhW.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-BQb3RCga.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-5vTl4x0h.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CH9prS-f.js +0 -3
- package/dist/gateway/static/root/assets/button-CGlRPNzi.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DMURlZbj.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-CFBS3Yqy.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DI1c3BMz.js +0 -2
- package/dist/gateway/static/root/assets/cron-expression-BJMBFKCh.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-BFRIn5y9.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-DFsyEJUr.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-C3TQVPRy.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-DUqVsB3X.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CLkumXdN.js +0 -1
- package/dist/gateway/static/root/assets/imports-page-DXNfRmk9.js +0 -1
- package/dist/gateway/static/root/assets/index-BLRIcVQa.css +0 -1
- package/dist/gateway/static/root/assets/index-gheM453N.js +0 -79
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-5Hcec8Xf.js +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-BDg1-fcw.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-BWZc5jwO.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-COa3PhMs.js +0 -1
- package/dist/gateway/static/root/assets/messages-C9h8SImu.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-D_YGzNcR.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-D1f2oI2-.js +0 -8
- package/dist/gateway/static/root/assets/project-detail-page-CRlD_Rwv.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-mmX0SavY.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-Cqr3K6T5.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-CPkvbdJP.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cu0DAbeH.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-D8fQF1jZ.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-BgHqwTuT.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-Id4vRHzI.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BB2Fj_di.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-BAwF4LpS.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-BVjw812D.js +0 -1
- package/dist/gateway/static/root/assets/theme-store-KfFEGMlp.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-Do98Xk05.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-Nv68a4ak.js +0 -2
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-1lZ_btki.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-DFOhccm3.js +0 -6
- package/dist/src/extensions/when-context.d.ts +0 -6
- package/dist/src/extensions/when-context.js +0 -26
- package/dist/src/extensions/when-expression.d.ts +0 -11
- package/dist/src/extensions/when-expression.js +0 -213
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
|
|
2
|
+
import { getConnectorConnection, init_connector_repository } from "../storage/sqlite/connector-repository.js";
|
|
3
|
+
//#region src/connectors/authorization-attempts.ts
|
|
4
|
+
init_connector_repository();
|
|
5
|
+
init_transaction();
|
|
6
|
+
function saveAuthorizationAttempt(input) {
|
|
7
|
+
const now = Date.now();
|
|
8
|
+
getSqliteDatabase().prepare(`INSERT INTO connector_authorization_attempts
|
|
9
|
+
(id, principal_id, connector_id, backend_id, connection_id, expected_account_id, authorization_url, status, expires_at, created_at)
|
|
10
|
+
VALUES(?,?,?,?,?,?,?,'awaiting_user',?,?)
|
|
11
|
+
ON CONFLICT(id) DO UPDATE SET expected_account_id = excluded.expected_account_id,
|
|
12
|
+
authorization_url = excluded.authorization_url, status = 'awaiting_user',
|
|
13
|
+
expires_at = excluded.expires_at, created_at = excluded.created_at`).run(input.connectionId, input.principalId, input.connectorId, input.backendId ?? null, input.connectionId, input.expectedAccountId ?? null, input.url ?? null, now + 10 * 6e4, now);
|
|
14
|
+
return input.connectionId;
|
|
15
|
+
}
|
|
16
|
+
function getAuthorizationAttempt(id, principalId) {
|
|
17
|
+
const db = getSqliteDatabase();
|
|
18
|
+
const row = db.prepare("SELECT * FROM connector_authorization_attempts WHERE id = ? AND principal_id = ?").get(id, principalId);
|
|
19
|
+
if (!row || row.status !== "awaiting_user") return row;
|
|
20
|
+
const connection = getConnectorConnection(row.connection_id);
|
|
21
|
+
const status = row.expires_at <= Date.now() ? "expired" : connection?.status === "active" ? row.expected_account_id && row.expected_account_id !== connection.accountId ? "failed" : "succeeded" : connection && ["failed", "revoked"].includes(connection.status) ? "failed" : "awaiting_user";
|
|
22
|
+
if (status !== row.status) {
|
|
23
|
+
db.prepare("UPDATE connector_authorization_attempts SET status = ?, authorization_url = NULL WHERE id = ?").run(status, id);
|
|
24
|
+
return {
|
|
25
|
+
...row,
|
|
26
|
+
status,
|
|
27
|
+
authorization_url: null
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return row;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { getAuthorizationAttempt, saveAuthorizationAttempt };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
//#region src/connectors/builtin-catalog.ts
|
|
2
|
-
const BUILTIN_CONNECTOR_BACKGROUNDS = { filesystem: "#FFF7E6" };
|
|
3
2
|
function builtinBranding(id) {
|
|
4
3
|
return {
|
|
5
4
|
logoUrl: `/connector-icons/${id}.svg`,
|
|
6
|
-
source: "builtin"
|
|
7
|
-
backgroundColor: BUILTIN_CONNECTOR_BACKGROUNDS[id] ?? "#FFFFFF"
|
|
5
|
+
source: "builtin"
|
|
8
6
|
};
|
|
9
7
|
}
|
|
10
8
|
const BUILTIN_CONNECTORS = [{
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { init_connection, isXopcDatabaseOpen } from "../storage/sqlite/connection.js";
|
|
2
|
-
import { getCachedConnectorCatalogEntry } from "../storage/sqlite/connector-repository.js";
|
|
2
|
+
import { getCachedConnectorCatalogEntry, init_connector_repository } from "../storage/sqlite/connector-repository.js";
|
|
3
3
|
import { listConnectorProviderDefinitions, listConnectorProviders } from "./providers.js";
|
|
4
4
|
//#region src/connectors/catalog.ts
|
|
5
|
+
init_connector_repository();
|
|
5
6
|
init_connection();
|
|
6
7
|
const CONNECTOR_BY_ID = new Map(listConnectorProviderDefinitions().map((connector) => [connector.id, connector]));
|
|
7
8
|
function listConnectorCatalog() {
|
|
@@ -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>;
|