@xopcai/xopc 0.0.321 → 0.0.324
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/dist/assets/{auth-DKo-NMUY.js → auth-DocRzRlS.js} +95 -21
- package/dist/browser-ext/dist/background.js +1 -1
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +18 -2
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/plugin.js +1 -9
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-C69p1Gbr.js → agent-avatar-dicebear-B-Gczr_A.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CxcIHW_Z.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-CNuqJcHQ.js +1 -0
- package/dist/gateway/static/root/assets/{agents-CWR3p3t3.js → agents-CPpmkx7O.js} +1 -1
- package/dist/gateway/static/root/assets/{app-link-nL8iPwEr.js → app-link-C6gA5Nck.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-D98bt40S.js → app-management-settings-panel-BwWdVRlb.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-ChMUELAZ.js → appearance-settings-EoXNDO1j.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-6xEgLDv8.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BIIiu6uP.js → archive-plugin-B_T0uMvL.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CDJpcsCp.js → attachment-load-D9DDwxd2.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-Cb5a_WOk.js → automations-page-jI9vNr2r.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-rztQnZDk.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-zp55zQPu.js → binary-plugins-Dzsxh9OL.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-B0CTIZb-.js → block-editor-CWUUgWWk.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-Bx3W4J4H.js → browser-automation-inputs-DSWXq9lI.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-D5Lr9b8a.js → browser-automations-page-D96o3bDY.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-DUQzQ3ic.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-sAZT4brT.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CKWtXof8.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-C8ducWB7.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-1I1PdIq0.js → chat-terminal-dock-WXZrEB3K.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-BT-EfoI6.js → computer-settings-page-uy9YDwxJ.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-mhQ-19tj.js → connector-service-page-BpF0SjB9.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-eZTfIMWI.js +2 -0
- package/dist/gateway/static/root/assets/date-picker-Do1dl0La.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-DLDLJx3D.js → dependency-picker-BhS8s080.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-kSFeHyrt.js → desktop-pet-DPVPqFlh.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BjY7DqD7.js → desktop-pet-settings-Dv3vG9HZ.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DdvO1O6W.js +1 -0
- package/dist/gateway/static/root/assets/dist-3h6cXXhT.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-DbWJDT4X.js → extension-debug-page-cuG5Lnwf.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-lAC_2xWA.js → extension-page-BCTAXdyE.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-jFy1NJg9.js → extension-settings-page-kadW_icu.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-B7WpH3VW.js → gateway-config-swr-CoQVulMd.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-CLZyN-u9.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-C8F_z865.js → gateway-startup-retry-B5GJ-CQV.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-BSqg-JE9.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-Dc7d0_7q.js → image-generation-api-DvWDkbk1.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-_fMvJvzM.js → imports-page-_pddpuej.js} +1 -1
- package/dist/gateway/static/root/assets/index-BKL5tg2f.css +1 -0
- package/dist/gateway/static/root/assets/index-CJuypaNt.js +121 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CHnZYx1U.js → keyboard-shortcuts-settings-C1fKIjz4.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-DXFnYiA0.js +1 -0
- package/dist/gateway/static/root/assets/local-apps-Bpja8nC6.js +1 -0
- package/dist/gateway/static/root/assets/local-apps-page-CkXKS5xe.js +1 -0
- package/dist/gateway/static/root/assets/{locale-store-D9krC43K.js → locale-store-BPZR8x9b.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-C33z-ife.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-8eDZb0uS.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-CurpvCbB.js → markdown-view-Dft8ASFD.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CYldyH6K.js → media-plugins-Cjj-fidX.js} +1 -1
- package/dist/gateway/static/root/assets/messages-kFWhF6_t.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-C95RtLuL.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-kFxknjMR.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-DZOiI84c.js → page-context-capture-button-OUL3fEYh.js} +1 -1
- package/dist/gateway/static/root/assets/{page-tabs-C-XCf9cR.js → page-tabs-CVbY7_N5.js} +1 -1
- package/dist/gateway/static/root/assets/popover-select-DcsFzD_i.js +1 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-CvgeoEU8.js → preview-open-alternatives-CKiIby0r.js} +1 -1
- package/dist/gateway/static/root/assets/product-delivery-bv3z8Xkh.js +1 -0
- package/dist/gateway/static/root/assets/product-open-page-DlpCi5zT.js +1 -0
- package/dist/gateway/static/root/assets/project-detail-page-LPAxUszX.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-Cbyb4hyy.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-cK-g8BDq.js → registry-api-DWWO6ajd.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BtDFZc6g.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DlUodTo-.js → runtime-tools-settings-panel-BT_ANpaT.js} +2 -2
- package/dist/gateway/static/root/assets/scenes-page-CJlc-mg1.js +2 -0
- package/dist/gateway/static/root/assets/{schema-form-BfboLCeN.js → schema-form-BcqsqSsV.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-CUo6-iV2.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-XeSxPjP7.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BytEfCGo.js → settings-form-section-Dol9j_pF.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-Da2ql9KX.js → settings-page-B65vii9U.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-CBfB_7yz.js → settings-page-layout-eqTUTW2L.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BCt__prc.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-B8J0Saj5.js → share-preview-page-BS8o58NJ.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-BsjSqEnw.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-evN7gs0S.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-BifYwEhe.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-B53tyGx5.js → skills-page.utils-DOk-iOvN.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-0HAvlVtR.js → system-settings-panel-CcSvoHfY.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-pCRG7Jb3.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-DJsxU6q_.js → tunnel-api-DDGMf44u.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-eIELzAOD.js → use-autosave-DiIkxIq7.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-CvYeM0Ml.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-BJ59ZCAn.js → voice-api-key-field-DJV-qERt.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-DBXZJWLS.js → voice-config-api-BaxITrwZ.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BpSxdIgB.js → work-discovery-overlay-DcHhy54L.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Bhlv3VUX.js → workflow-run-setup-panel-DbVtLh0R.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-CT8ouKcB.js +6 -0
- package/dist/gateway/static/root/index.html +14 -12
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/capabilities.js +4 -110
- package/dist/packages/gateway-contract/src/chat-previews.js +73 -0
- package/dist/packages/gateway-contract/src/home.js +284 -55
- package/dist/packages/gateway-contract/src/index.js +6 -2
- package/dist/packages/gateway-contract/src/local-apps.js +215 -0
- package/dist/packages/gateway-contract/src/notifications.js +3 -10
- package/dist/packages/gateway-contract/src/product-delivery.js +62 -17
- package/dist/packages/gateway-contract/src/user-turn-document.js +60 -0
- package/dist/src/activity/emitter.js +2 -1
- package/dist/src/activity/service.js +2 -1
- package/dist/src/agent/agent-manager.d.ts +4 -2
- package/dist/src/agent/agent-manager.js +37 -44
- package/dist/src/agent/agent-scope.d.ts +19 -48
- package/dist/src/agent/agent-scope.js +47 -169
- package/dist/src/agent/background-review/run-background-review.js +5 -4
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -1
- package/dist/src/agent/commands/command-registry.js +7 -3
- package/dist/src/agent/context/coordinator.js +1 -1
- package/dist/src/agent/context/execution-context.js +2 -1
- package/dist/src/agent/context/execution-scope.js +2 -1
- package/dist/src/agent/context/workspace-seed.d.ts +1 -2
- package/dist/src/agent/context/workspace-seed.js +3 -3
- package/dist/src/agent/context/workspace-state.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +2 -2
- package/dist/src/agent/embedded/run-turn.js +2 -1
- package/dist/src/agent/embedded/sqlite-hydrating-session-manager.js +2 -1
- package/dist/src/agent/embedded/transcript-runtime.d.ts +3 -0
- package/dist/src/agent/embedded/transcript-runtime.js +6 -0
- package/dist/src/agent/external-tools/cliProvider.js +6 -2
- package/dist/src/agent/external-tools/composio-provider.js +11 -4
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/external-tools/gateway-tools.js +17 -10
- package/dist/src/agent/external-tools/index.js +2 -3
- package/dist/src/agent/external-tools/mcp-provider.d.ts +3 -1
- package/dist/src/agent/external-tools/mcp-provider.js +93 -8
- package/dist/src/agent/external-tools/service.d.ts +2 -1
- package/dist/src/agent/external-tools/service.js +8 -3
- package/dist/src/agent/external-tools/types.d.ts +9 -0
- package/dist/src/agent/image/tool-model-config.js +4 -5
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/ipc/bus.js +1 -1
- package/dist/src/agent/ipc/socket.js +3 -3
- package/dist/src/agent/mcp/bundle-mcp-config.js +37 -5
- package/dist/src/agent/mcp/bundle-mcp-gateway.d.ts +1 -0
- package/dist/src/agent/mcp/bundle-mcp-gateway.js +1 -0
- package/dist/src/agent/mcp/bundle-mcp-names.js +2 -1
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +33 -1
- package/dist/src/agent/mcp/bundle-mcp-types.d.ts +4 -0
- package/dist/src/agent/mcp/index.js +1 -1
- package/dist/src/agent/mcp/mcp-stdio-transport.d.ts +1 -0
- package/dist/src/agent/mcp/mcp-stdio-transport.js +10 -0
- package/dist/src/agent/mcp/mcp-transport.js +12 -8
- package/dist/src/agent/mcp/oauth/index.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.d.ts +6 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +70 -14
- package/dist/src/agent/mcp/oauth/mcp-oauth-provider.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-session.d.ts +2 -0
- package/dist/src/agent/mcp/oauth/mcp-oauth-session.js +12 -0
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.d.ts +3 -0
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +13 -1
- package/dist/src/agent/mcp/plugin-http-fetch.d.ts +2 -0
- package/dist/src/agent/mcp/plugin-http-fetch.js +56 -0
- package/dist/src/agent/media-generation/runtime-shared.d.ts +1 -1
- package/dist/src/agent/media-generation/runtime-shared.js +1 -1
- package/dist/src/agent/memory/plugin-discovery.js +1 -2
- package/dist/src/agent/models/manager.d.ts +1 -1
- package/dist/src/agent/models/manager.js +2 -2
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.js +1 -1
- package/dist/src/agent/prompt/response-language.js +2 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +6 -3
- package/dist/src/agent/prompt/system-prompt.js +2 -1
- package/dist/src/agent/reply/post-compaction-context.js +2 -2
- package/dist/src/agent/service/build-direct-message-content.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +2 -1
- package/dist/src/agent/service/parse-outbound-session-key.js +2 -1
- package/dist/src/agent/service/process-direct-streaming.js +30 -14
- package/dist/src/agent/service/webchat-tts.js +2 -1
- package/dist/src/agent/service.d.ts +1 -1
- package/dist/src/agent/service.js +13 -11
- package/dist/src/agent/service.types.d.ts +4 -0
- package/dist/src/agent/session/session-inspector.js +4 -5
- package/dist/src/agent/skills/hub-pull.js +1 -1
- package/dist/src/agent/skills/index.js +8 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.d.ts +5 -0
- package/dist/src/agent/skills/skill-manager.d.ts +2 -0
- package/dist/src/agent/skills/skill-manager.js +8 -0
- package/dist/src/agent/skills/skill-sources.js +17 -0
- package/dist/src/agent/skills/types.d.ts +3 -1
- package/dist/src/agent/source-context/injector.js +10 -5
- package/dist/src/agent/source-context/types.d.ts +3 -0
- package/dist/src/agent/source-context/types.js +8 -2
- package/dist/src/agent/starter-agents.d.ts +4 -5
- package/dist/src/agent/starter-agents.js +21 -20
- package/dist/src/agent/tasks/task-judge-service.js +2 -2
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +42 -2
- package/dist/src/agent/tools/automation-tool.js +1 -1
- package/dist/src/agent/tools/delegation-parent-policy.js +2 -3
- package/dist/src/agent/tools/factory.d.ts +3 -0
- package/dist/src/agent/tools/factory.js +12 -10
- package/dist/src/agent/tools/image-generate-tool.js +1 -1
- package/dist/src/agent/tools/workflow-tool.js +3 -4
- package/dist/src/agent/tools/write.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.d.ts +5 -2
- package/dist/src/agent/tools/xopc-use-tool.js +171 -15
- package/dist/src/agent/workflow/workflow-child-tools.js +1 -2
- package/dist/src/agent/workspace-runtime/registry.d.ts +1 -1
- package/dist/src/agent/workspace-runtime/registry.js +2 -2
- package/dist/src/agent-catalog/capabilities.d.ts +3 -0
- package/dist/src/agent-catalog/capabilities.js +238 -0
- package/dist/src/agent-catalog/id.d.ts +15 -0
- package/dist/src/agent-catalog/id.js +101 -0
- package/dist/src/agent-catalog/index.d.ts +6 -0
- package/dist/src/agent-catalog/index.js +10 -0
- package/dist/src/agent-catalog/migrations/legacy-config-cutover.d.ts +11 -0
- package/dist/src/agent-catalog/migrations/legacy-config-cutover.js +195 -0
- package/dist/src/agent-catalog/repository.d.ts +39 -0
- package/dist/src/agent-catalog/repository.js +319 -0
- package/dist/src/agent-catalog/service.d.ts +33 -0
- package/dist/src/agent-catalog/service.js +202 -0
- package/dist/src/agent-catalog/test-support.d.ts +14 -0
- package/dist/src/agent-catalog/test-support.js +34 -0
- package/dist/src/agent-catalog/types.d.ts +26 -0
- package/dist/src/agent-catalog/types.js +1 -0
- package/dist/src/agent-config/index.js +2 -2
- package/dist/src/agent-config/schema.d.ts +1 -172
- package/dist/src/agent-config/schema.js +2 -41
- package/dist/src/auth/credentials.js +3 -3
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/sync-provider-auth.d.ts +1 -1
- package/dist/src/auth/sync-provider-auth.js +5 -9
- package/dist/src/automations/capabilities/drafts.js +8 -7
- package/dist/src/automations/service/action-executor.js +2 -1
- package/dist/src/bootstrap/application-state.d.ts +10 -0
- package/dist/src/bootstrap/application-state.js +26 -0
- package/dist/src/browser/automations/repository.js +2 -1
- package/dist/src/browser/automations/schema.d.ts +1 -1
- package/dist/src/browser/automations/service.d.ts +1 -1
- package/dist/src/browser/native-messaging-host.js +5 -4
- package/dist/src/browser/providers/extension.js +4 -2
- package/dist/src/browser/providers/realtime-extension.js +2 -1
- package/dist/src/capabilities/readiness/from-config.js +7 -4
- package/dist/src/capabilities/runtime/dispatcher.d.ts +1 -0
- package/dist/src/capabilities/runtime/dispatcher.js +10 -4
- package/dist/src/capabilities/runtime/product.js +2 -0
- package/dist/src/channels/catalog/channel-catalog-service.js +7 -13
- package/dist/src/chat-commands/agent-edit.js +4 -3
- package/dist/src/chat-commands/builtins/config.js +6 -8
- package/dist/src/chat-commands/builtins/review.js +1 -1
- package/dist/src/chat-commands/builtins/workflow.js +1 -1
- package/dist/src/chat-commands/config-paths.js +1 -1
- package/dist/src/chat-commands/context.js +2 -3
- package/dist/src/chat-previews/index.d.ts +2 -0
- package/dist/src/chat-previews/index.js +3 -0
- package/dist/src/chat-previews/service.d.ts +27 -0
- package/dist/src/chat-previews/service.js +106 -0
- package/dist/src/chat-previews/store.d.ts +28 -0
- package/dist/src/chat-previews/store.js +78 -0
- package/dist/src/cli/command-manifest.js +1 -1
- package/dist/src/cli/commands/agent.js +4 -4
- package/dist/src/cli/commands/agents.d.ts +1 -1
- package/dist/src/cli/commands/agents.js +36 -48
- package/dist/src/cli/commands/auth.js +1 -0
- package/dist/src/cli/commands/browser-cli-helpers.js +1 -2
- package/dist/src/cli/commands/channels.js +2 -4
- package/dist/src/cli/commands/config.js +4 -5
- package/dist/src/cli/commands/connectors.js +1 -2
- package/dist/src/cli/commands/doctor/checks/channel-config.js +2 -4
- package/dist/src/cli/commands/doctor/checks/channel-pairing-pending.js +1 -2
- package/dist/src/cli/commands/doctor/checks/channel-plugins.js +1 -2
- package/dist/src/cli/commands/doctor/checks/config-health.js +1 -2
- package/dist/src/cli/commands/doctor/checks/database-schema.js +4 -4
- package/dist/src/cli/commands/doctor/checks/gateway-health.js +1 -2
- package/dist/src/cli/commands/doctor/checks/gateway-service.js +1 -2
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +13 -11
- package/dist/src/cli/commands/doctor/checks/security-audit.js +1 -2
- package/dist/src/cli/commands/doctor/checks/session-integrity.js +3 -3
- package/dist/src/cli/commands/doctor/checks/tool-runtimes.js +1 -2
- package/dist/src/cli/commands/doctor/checks/workspace-status.js +5 -7
- package/dist/src/cli/commands/extension-agent-plugin.d.ts +8 -0
- package/dist/src/cli/commands/extension-agent-plugin.js +81 -0
- package/dist/src/cli/commands/extension-dev.js +2 -4
- package/dist/src/cli/commands/extension-marketplace.js +45 -6
- package/dist/src/cli/commands/extension-pack.js +1 -2
- package/dist/src/cli/commands/extension.js +36 -5
- package/dist/src/cli/commands/gateway/run-foreground.js +3 -3
- package/dist/src/cli/commands/gateway/shared.js +1 -1
- package/dist/src/cli/commands/history.js +2 -1
- package/dist/src/cli/commands/image.js +2 -2
- package/dist/src/cli/commands/init.js +11 -30
- package/dist/src/cli/commands/mcp.js +1 -2
- package/dist/src/cli/commands/models.js +13 -11
- package/dist/src/cli/commands/onboard/channels/registry.js +1 -2
- package/dist/src/cli/commands/onboard/gateway.js +1 -2
- package/dist/src/cli/commands/onboard/model.d.ts +1 -1
- package/dist/src/cli/commands/onboard/model.js +17 -25
- package/dist/src/cli/commands/onboard.js +4 -2
- package/dist/src/cli/commands/platform.js +1 -0
- package/dist/src/cli/commands/project.js +3 -3
- package/dist/src/cli/commands/providers.js +1 -0
- package/dist/src/cli/commands/runtime.js +1 -2
- package/dist/src/cli/commands/search.js +1 -2
- package/dist/src/cli/commands/skills.js +1 -2
- package/dist/src/cli/commands/tui-runner.js +3 -2
- package/dist/src/cli/commands/tui.js +6 -8
- package/dist/src/cli/commands/tunnel.js +1 -1
- package/dist/src/cli/commands/voice.js +1 -2
- package/dist/src/cli/extension-cli-register.js +1 -1
- package/dist/src/cli/index.js +4 -2
- package/dist/src/cli/utils/gateway-client.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +15 -16
- package/dist/src/cli/utils/session.js +1 -2
- package/dist/src/computer/model-config.d.ts +3 -3
- package/dist/src/computer/model-config.js +10 -20
- package/dist/src/computer/runtime.js +1 -1
- package/dist/src/config/agent-model-intents.js +2 -2
- package/dist/src/config/agent-profile.d.ts +5 -6
- package/dist/src/config/agent-profile.js +19 -19
- package/dist/src/config/config-surface.d.ts +0 -3
- package/dist/src/config/default-model.js +2 -6
- package/dist/src/config/index.js +7 -8
- package/dist/src/config/loader.js +12 -18
- package/dist/src/config/models-json.d.ts +6 -6
- package/dist/src/config/paths.d.ts +18 -19
- package/dist/src/config/paths.js +35 -35
- package/dist/src/config/reload.d.ts +0 -1
- package/dist/src/config/reload.js +1 -6
- package/dist/src/config/rules.js +0 -15
- package/dist/src/config/schema.d.ts +3 -406
- package/dist/src/config/schema.js +24 -86
- package/dist/src/config/validate-channel-configs.js +8 -14
- package/dist/src/config/workspace-dirs.d.ts +3 -4
- package/dist/src/config/workspace-dirs.js +9 -8
- package/dist/src/config/workspace-path-helpers.d.ts +1 -1
- package/dist/src/config/workspace-path-helpers.js +2 -2
- package/dist/src/connectors/account-selection.js +1 -1
- package/dist/src/connectors/cli/lifecycle.js +2 -1
- package/dist/src/connectors/composio-managed-events.js +2 -1
- package/dist/src/connectors/connected-source-ingestion.js +2 -1
- package/dist/src/connectors/connected-source-understanding.js +4 -2
- package/dist/src/connectors/connection-candidates.d.ts +4 -1
- package/dist/src/connectors/connection-candidates.js +8 -2
- package/dist/src/connectors/connection-capabilities.d.ts +2 -2
- package/dist/src/connectors/connection-capabilities.js +3 -1
- package/dist/src/connectors/connection-recovery-service.d.ts +6 -1
- package/dist/src/connectors/connection-recovery-service.js +138 -26
- package/dist/src/connectors/content-enrichment.js +2 -1
- package/dist/src/connectors/learning-coordinator.js +2 -1
- package/dist/src/connectors/plugin-mcp-recovery.d.ts +28 -0
- package/dist/src/connectors/plugin-mcp-recovery.js +90 -0
- package/dist/src/connectors/runtime-adapter-registry.js +2 -1
- package/dist/src/connectors/workflow-preflight.d.ts +8 -1
- package/dist/src/connectors/workflow-preflight.js +11 -3
- package/dist/src/discussions/analyzer.js +2 -2
- package/dist/src/endpoint-tools/runtime.js +2 -1
- package/dist/src/execution-environments/subject.js +2 -1
- package/dist/src/extensions/activation-context.js +3 -16
- package/dist/src/extensions/agent-plugins/auth.d.ts +39 -0
- package/dist/src/extensions/agent-plugins/auth.js +156 -0
- package/dist/src/extensions/agent-plugins/connection.d.ts +8 -0
- package/dist/src/extensions/agent-plugins/connection.js +41 -0
- package/dist/src/extensions/agent-plugins/health.d.ts +4 -0
- package/dist/src/extensions/agent-plugins/health.js +48 -0
- package/dist/src/extensions/agent-plugins/inventory.d.ts +53 -0
- package/dist/src/extensions/agent-plugins/inventory.js +34 -0
- package/dist/src/extensions/agent-plugins/mcp-adapter.d.ts +3 -0
- package/dist/src/extensions/agent-plugins/mcp-adapter.js +47 -0
- package/dist/src/extensions/agent-plugins/sources.d.ts +5 -0
- package/dist/src/extensions/agent-plugins/sources.js +72 -0
- package/dist/src/extensions/agent-plugins/store.d.ts +61 -0
- package/dist/src/extensions/agent-plugins/store.js +305 -0
- package/dist/src/extensions/agent-plugins/validation.d.ts +59 -0
- package/dist/src/extensions/agent-plugins/validation.js +211 -0
- package/dist/src/extensions/discover-extensions.js +9 -15
- package/dist/src/extensions/extension-metadata-snapshot.d.ts +1 -1
- package/dist/src/extensions/extension-metadata-snapshot.js +9 -16
- package/dist/src/extensions/index.js +4 -10
- package/dist/src/extensions/install.js +1 -1
- package/dist/src/extensions/loader.js +7 -14
- package/dist/src/extensions/manifest-registry.js +93 -98
- package/dist/src/extensions/marketplace.js +5 -2
- package/dist/src/extensions/normalize-manifest.js +12 -17
- package/dist/src/extensions/update.js +2 -3
- package/dist/src/files/file-service.js +7 -8
- package/dist/src/gateway/agents-admin.d.ts +23 -27
- package/dist/src/gateway/agents-admin.js +109 -130
- package/dist/src/gateway/chat-stream/mapper.js +10 -3
- package/dist/src/gateway/file-path-classifier.js +3 -3
- package/dist/src/gateway/file-space-service.js +2 -1
- package/dist/src/gateway/global-defaults-admin.d.ts +6 -4
- package/dist/src/gateway/global-defaults-admin.js +21 -20
- package/dist/src/gateway/hono/app.js +2 -1
- package/dist/src/gateway/hono/lib/config-payload.js +12 -9
- package/dist/src/gateway/hono/middleware/auth.js +2 -1
- package/dist/src/gateway/hono/middleware/scopes.js +2 -1
- package/dist/src/gateway/hono/routes/agent-plugins.d.ts +3 -0
- package/dist/src/gateway/hono/routes/agent-plugins.js +166 -0
- package/dist/src/gateway/hono/routes/agent-stream.js +14 -0
- package/dist/src/gateway/hono/routes/agents.js +22 -49
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +4 -2
- package/dist/src/gateway/hono/routes/browser.js +4 -2
- package/dist/src/gateway/hono/routes/channels.js +1 -2
- package/dist/src/gateway/hono/routes/chat-previews.d.ts +3 -0
- package/dist/src/gateway/hono/routes/chat-previews.js +41 -0
- package/dist/src/gateway/hono/routes/cli-connectors.js +2 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +3 -1
- package/dist/src/gateway/hono/routes/composer-history.js +2 -1
- package/dist/src/gateway/hono/routes/config-patch/index.d.ts +1 -3
- package/dist/src/gateway/hono/routes/config-patch/index.js +1 -2
- package/dist/src/gateway/hono/routes/config-patch/misc.js +18 -11
- package/dist/src/gateway/hono/routes/config.js +0 -2
- package/dist/src/gateway/hono/routes/connection-waits.js +4 -2
- package/dist/src/gateway/hono/routes/connectors.js +8 -4
- package/dist/src/gateway/hono/routes/context-sources.js +4 -3
- package/dist/src/gateway/hono/routes/device-pairing-approval.js +2 -1
- package/dist/src/gateway/hono/routes/device-push.js +3 -2
- package/dist/src/gateway/hono/routes/devices.js +6 -3
- package/dist/src/gateway/hono/routes/discussions.js +2 -1
- package/dist/src/gateway/hono/routes/endpoint-tools.js +2 -1
- package/dist/src/gateway/hono/routes/global-defaults.js +8 -16
- package/dist/src/gateway/hono/routes/home.js +93 -4
- package/dist/src/gateway/hono/routes/index.js +2 -0
- package/dist/src/gateway/hono/routes/interaction-state.js +2 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/local-apps.js +71 -39
- package/dist/src/gateway/hono/routes/mcp.js +48 -21
- package/dist/src/gateway/hono/routes/models.js +8 -7
- package/dist/src/gateway/hono/routes/notes.js +4 -5
- package/dist/src/gateway/hono/routes/projects.js +6 -6
- package/dist/src/gateway/hono/routes/public-gateway.js +2 -1
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +4 -0
- package/dist/src/gateway/hono/routes/session-input-handler.js +23 -1
- package/dist/src/gateway/hono/routes/sessions.js +4 -2
- package/dist/src/gateway/hono/routes/shares.js +4 -3
- package/dist/src/gateway/hono/routes/side-chats.js +11 -0
- package/dist/src/gateway/hono/routes/site-shares.js +2 -2
- package/dist/src/gateway/hono/routes/status.js +2 -3
- package/dist/src/gateway/hono/routes/tasks.js +1 -2
- package/dist/src/gateway/hono/routes/user-model-refresh.js +2 -1
- package/dist/src/gateway/hono/routes/user-model.js +3 -2
- package/dist/src/gateway/hono/routes/work-discovery.js +1 -1
- package/dist/src/gateway/hono/routes/workflows.js +2 -2
- package/dist/src/gateway/image-generation-setup.d.ts +19 -10
- package/dist/src/gateway/image-generation-setup.js +59 -23
- package/dist/src/gateway/index.js +1 -4
- package/dist/src/gateway/lock.js +13 -18
- package/dist/src/gateway/memory-maintenance-automation-reconciler.js +4 -3
- package/dist/src/gateway/run-loop.js +2 -3
- package/dist/src/gateway/security/gateway-scopes.js +6 -2
- package/dist/src/gateway/security/index.js +4 -1
- package/dist/src/gateway/service/agent-runner.js +11 -3
- package/dist/src/gateway/service/app-context-access.js +2 -1
- package/dist/src/gateway/service/config-coordinator.d.ts +0 -1
- package/dist/src/gateway/service/config-coordinator.js +4 -22
- package/dist/src/gateway/service/marketplace-service.d.ts +1 -0
- package/dist/src/gateway/service/marketplace-service.js +18 -2
- package/dist/src/gateway/service/run-gateway-agent.js +4 -2
- package/dist/src/gateway/service/session-input-coordinator.js +7 -5
- package/dist/src/gateway/service.d.ts +10 -1
- package/dist/src/gateway/service.js +123 -33
- package/dist/src/gateway/session-context-summary.js +4 -2
- package/dist/src/gateway/side-chat/index.d.ts +3 -1
- package/dist/src/gateway/side-chat/index.js +2 -1
- package/dist/src/gateway/side-chat/manager.d.ts +16 -0
- package/dist/src/gateway/side-chat/manager.js +40 -6
- package/dist/src/gateway/side-chat/promotion-service.d.ts +19 -0
- package/dist/src/gateway/side-chat/promotion-service.js +111 -0
- package/dist/src/gateway/side-chat/run-service.js +1 -0
- package/dist/src/gateway/side-chat/types.d.ts +1 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.d.ts +2 -0
- package/dist/src/gateway/xopc-cloud-capability-setup.js +15 -10
- package/dist/src/home-intelligence/application-service.d.ts +31 -0
- package/dist/src/home-intelligence/application-service.js +134 -0
- package/dist/src/home-intelligence/capability-preflight.d.ts +32 -0
- package/dist/src/home-intelligence/capability-preflight.js +118 -0
- package/dist/src/home-intelligence/evaluation.d.ts +34 -0
- package/dist/src/home-intelligence/evaluation.js +49 -0
- package/dist/src/home-intelligence/generator.d.ts +125 -0
- package/dist/src/home-intelligence/generator.js +227 -0
- package/dist/src/home-intelligence/host.d.ts +53 -0
- package/dist/src/home-intelligence/host.js +257 -0
- package/dist/src/home-intelligence/notification.d.ts +8 -0
- package/dist/src/home-intelligence/notification.js +20 -0
- package/dist/src/home-intelligence/policy.d.ts +16 -0
- package/dist/src/home-intelligence/policy.js +152 -0
- package/dist/src/home-intelligence/repository.d.ts +81 -0
- package/dist/src/home-intelligence/repository.js +495 -0
- package/dist/src/home-intelligence/snapshot.d.ts +43 -0
- package/dist/src/home-intelligence/snapshot.js +133 -0
- package/dist/src/home-intelligence/strategy.d.ts +14 -0
- package/dist/src/home-intelligence/strategy.js +10 -0
- package/dist/src/home-intelligence/types.d.ts +13 -0
- package/dist/src/home-intelligence/types.js +1 -0
- package/dist/src/infra/update-restart.js +4 -2
- package/dist/src/knowledge/connected-knowledge-pipeline.js +2 -1
- package/dist/src/knowledge/ingestion-service.js +2 -1
- package/dist/src/knowledge-memory/repository.js +2 -1
- package/dist/src/local-apps/artifact-files.d.ts +3 -0
- package/dist/src/local-apps/artifact-files.js +45 -0
- package/dist/src/local-apps/capabilities/write.js +1 -1
- package/dist/src/local-apps/fix-guidance.d.ts +3 -0
- package/dist/src/local-apps/fix-guidance.js +75 -0
- package/dist/src/local-apps/index.d.ts +2 -1
- package/dist/src/local-apps/scaffold.d.ts +5 -0
- package/dist/src/local-apps/scaffold.js +18 -5
- package/dist/src/local-apps/service.d.ts +18 -3
- package/dist/src/local-apps/service.js +107 -65
- package/dist/src/local-apps/snapshot-store.d.ts +8 -0
- package/dist/src/local-apps/snapshot-store.js +68 -0
- package/dist/src/local-apps/store.js +2 -1
- package/dist/src/local-apps/types.d.ts +4 -87
- package/dist/src/mcp/channel-bridge.js +1 -2
- package/dist/src/mcp/channel-server.js +1 -2
- package/dist/src/mcp/gateway-http-client.js +1 -2
- package/dist/src/media/session-references.js +2 -1
- package/dist/src/memory-maintenance/service.js +2 -1
- package/dist/src/migrations/memory-config.js +1 -2
- package/dist/src/notes/agent-context.js +2 -1
- package/dist/src/notes/attachment-ref.js +8 -4
- package/dist/src/notes/note-attachment-sync.js +2 -1
- package/dist/src/notes/note-index-meta.js +14 -7
- package/dist/src/notes/note-markdown.js +13 -7
- package/dist/src/notes/service.js +6 -3
- package/dist/src/notes/store.js +4 -2
- package/dist/src/notifications/device-store.js +1 -1
- package/dist/src/notifications/planner.js +24 -0
- package/dist/src/notifications/service.d.ts +7 -14
- package/dist/src/notifications/service.js +13 -3
- package/dist/src/notifications/store.js +1 -1
- package/dist/src/notifications/types.d.ts +1 -1
- package/dist/src/notifications/types.js +1 -1
- package/dist/src/projects/capabilities/write.js +2 -1
- package/dist/src/projects/project-agent-suggestion.js +1 -1
- package/dist/src/projects/project-agent.js +4 -4
- package/dist/src/projects/project-service.js +2 -1
- package/dist/src/projects/workspace.js +3 -2
- package/dist/src/providers/index.js +3 -3
- package/dist/src/providers/model-reference-auditor.d.ts +1 -2
- package/dist/src/providers/model-reference-auditor.js +8 -5
- package/dist/src/realtime/runtime.js +2 -1
- package/dist/src/routing/binding-schema.d.ts +41 -0
- package/dist/src/routing/binding-schema.js +26 -0
- package/dist/src/routing/bindings.d.ts +4 -2
- package/dist/src/routing/bindings.js +4 -4
- package/dist/src/routing/index.d.ts +1 -1
- package/dist/src/routing/resolve-route.d.ts +7 -24
- package/dist/src/routing/resolve-route.js +17 -18
- package/dist/src/routing/resolve-tui-session-key.d.ts +1 -4
- package/dist/src/routing/resolve-tui-session-key.js +10 -9
- package/dist/src/scenes/execution.d.ts +1 -1
- package/dist/src/scenes/model.js +1 -1
- package/dist/src/scenes/taskFollowUp/contracts.d.ts +1 -1
- package/dist/src/scenes/taskFollowUp/service.js +6 -4
- package/dist/src/scenes/templates.d.ts +2 -2
- package/dist/src/session/client-history.d.ts +3 -1
- package/dist/src/session/client-history.js +10 -3
- package/dist/src/session/config-store.js +2 -1
- package/dist/src/session/index.d.ts +1 -1
- package/dist/src/session/init-session-turn.js +2 -1
- package/dist/src/session/manager.d.ts +4 -0
- package/dist/src/session/manager.js +6 -0
- package/dist/src/session/resolve-session.js +2 -1
- package/dist/src/session/session-context-for-llm.d.ts +12 -1
- package/dist/src/session/session-context-for-llm.js +16 -2
- package/dist/src/session/session-workspace.js +1 -1
- package/dist/src/session/store.d.ts +14 -0
- package/dist/src/session/store.js +20 -2
- package/dist/src/session/stored-rows-to-file-entries.js +10 -1
- package/dist/src/session/transcript-outline.js +10 -3
- package/dist/src/storage/sqlite/activity-repository.js +6 -2
- package/dist/src/storage/sqlite/browser-tab-binding-repository.js +6 -2
- package/dist/src/storage/sqlite/clarification-wait-repository.js +13 -8
- package/dist/src/storage/sqlite/collaboration-rule-repository.d.ts +1 -1
- package/dist/src/storage/sqlite/collaboration-rule-repository.js +8 -3
- package/dist/src/storage/sqlite/composer-input-history-repository.js +8 -3
- package/dist/src/storage/sqlite/config-repository.js +9 -5
- package/dist/src/storage/sqlite/connection-wait-repository.js +9 -3
- package/dist/src/storage/sqlite/connector-learning-repository.js +6 -2
- package/dist/src/storage/sqlite/connector-sync-policy-repository.js +6 -2
- package/dist/src/storage/sqlite/context-evidence-repository.js +8 -3
- package/dist/src/storage/sqlite/context-extraction-repository.js +8 -3
- package/dist/src/storage/sqlite/device-access-repository.js +15 -9
- package/dist/src/storage/sqlite/device-pairing-approval.js +6 -2
- package/dist/src/storage/sqlite/device-pairing-repository.js +10 -5
- package/dist/src/storage/sqlite/endpoint-principal-repository.js +6 -2
- package/dist/src/storage/sqlite/endpoint-session-binding-repository.js +6 -2
- package/dist/src/storage/sqlite/endpoint-tool-invocation-repository.js +6 -2
- package/dist/src/storage/sqlite/gateway-identity-repository.js +6 -2
- package/dist/src/storage/sqlite/home-attention-repository.js +6 -2
- package/dist/src/storage/sqlite/index.d.ts +0 -1
- package/dist/src/storage/sqlite/index.js +72 -42
- package/dist/src/storage/sqlite/interaction-state-repository.js +10 -4
- package/dist/src/storage/sqlite/knowledge-repository.js +6 -2
- package/dist/src/storage/sqlite/migrations/202_chat_previews.sql +26 -0
- package/dist/src/storage/sqlite/migrations/203_remove_retired_proactive_contracts.sql +70 -0
- package/dist/src/storage/sqlite/migrations/204_home_intelligence.sql +78 -0
- package/dist/src/storage/sqlite/migrations/205_agent_catalog.sql +66 -0
- package/dist/src/storage/sqlite/migrations/206_home_advice_strategy_version.sql +3 -0
- package/dist/src/storage/sqlite/migrations/conversation-backup.d.ts +2 -0
- package/dist/src/storage/sqlite/migrations/conversation-backup.js +8 -4
- package/dist/src/storage/sqlite/migrations/conversation-windows-owners.d.ts +7 -1
- package/dist/src/storage/sqlite/migrations/conversation-windows-owners.js +2 -2
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +4 -4
- package/dist/src/storage/sqlite/note-agent-context-repository.js +6 -2
- package/dist/src/storage/sqlite/notes-repository.js +9 -4
- package/dist/src/storage/sqlite/row-mappers.js +6 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-task-plan-repository.js +14 -9
- package/dist/src/storage/sqlite/session-turn-replace-repository.js +9 -5
- package/dist/src/storage/sqlite/sidebar-layout-repository.js +14 -9
- package/dist/src/storage/sqlite/transcript-repository.js +10 -6
- package/dist/src/storage/sqlite/user-people-repository.js +8 -3
- package/dist/src/storage/sqlite/user-trust-repository.js +8 -3
- package/dist/src/tasks/attention-governor.d.ts +0 -1
- package/dist/src/tasks/attention-governor.js +1 -7
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.d.ts +1 -1
- package/dist/src/tasks/execution-context.d.ts +2 -2
- package/dist/src/tasks/execution-context.js +6 -5
- package/dist/src/tasks/home-query-service.d.ts +3 -2
- package/dist/src/tasks/home-query-service.js +23 -44
- package/dist/src/tasks/task-context-assembler.js +2 -1
- package/dist/src/tasks/task-context-repository.d.ts +1 -1
- package/dist/src/tasks/task-contract-planner.d.ts +0 -3
- package/dist/src/tasks/task-contract-planner.js +1 -4
- package/dist/src/tasks/task-handoff-service.d.ts +0 -2
- package/dist/src/tasks/task-handoff-service.js +3 -3
- package/dist/src/tasks/task-value-metrics-service.js +2 -1
- package/dist/src/tui/backends/embedded-backend.js +12 -14
- package/dist/src/tui/extension-host/load-extensions.js +1 -1
- package/dist/src/tui/tui-commands.js +5 -3
- package/dist/src/tui/tui-skills-autocomplete.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +3 -3
- package/dist/src/tui/tui.js +5 -5
- package/dist/src/tunnel/registration-proof.js +2 -1
- package/dist/src/user-context/access-policy.js +2 -1
- package/dist/src/user-context/domain.d.ts +1 -1
- package/dist/src/user-context/domain.js +18 -13
- package/dist/src/user-context/extraction/registry.js +2 -1
- package/dist/src/user-context/interaction-state.js +4 -1
- package/dist/src/user-context/relationship-continuity.js +2 -1
- package/dist/src/user-context/trust-policy.js +13 -8
- package/dist/src/user-model/bootstrap.js +2 -1
- package/dist/src/user-model/capture/executor.js +4 -2
- package/dist/src/user-model/capture/semantic.d.ts +1 -1
- package/dist/src/user-model/capture/semantic.js +1 -1
- package/dist/src/user-model/domain.js +7 -2
- package/dist/src/user-model/goals.js +2 -1
- package/dist/src/user-model/index.js +4 -1
- package/dist/src/user-model/repository.js +2 -1
- package/dist/src/utils/helpers.js +1 -4
- package/dist/src/utils/index.js +2 -2
- package/dist/src/utils/logger/index.d.ts +1 -1
- package/dist/src/utils/logger/index.js +2 -2
- package/dist/src/utils/logger/redact.d.ts +2 -0
- package/dist/src/utils/logger/redact.js +11 -3
- package/dist/src/utils/logger.js +2 -2
- package/dist/src/voice/realtime/memory-context.js +2 -1
- package/dist/src/voice/realtime/persona-context.js +6 -6
- package/dist/src/voice/tts/audio.js +1 -1
- package/dist/src/work-discovery/analyzer.js +3 -3
- package/dist/src/work-discovery/investigator.js +1 -1
- package/dist/src/work-discovery/service.js +12 -11
- package/dist/src/workflows/draft/workflow-draft-service.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +4 -5
- package/dist/src/workflows/store/paths.js +1 -1
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DWLXHWXg.js +0 -1
- package/dist/gateway/static/root/assets/api-Df2D6d3C.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-BzytHIn1.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-CtSV8tp-.js +0 -7
- package/dist/gateway/static/root/assets/browser-settings-page-DrvNA-G2.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-D0S3DuAD.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-c0k2virA.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-Bkl9fDHc.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Dw_h-5Qh.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-BqcldZoN.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-C5f4FRpE.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-D7XbH6Hk.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CFJypY6Y.js +0 -1
- package/dist/gateway/static/root/assets/index-B4Vwh0H-.css +0 -1
- package/dist/gateway/static/root/assets/index-BNubE2Zi.js +0 -89
- package/dist/gateway/static/root/assets/local-app-workbench-page-BLKCFXvr.js +0 -2
- package/dist/gateway/static/root/assets/local-apps-page-BNFmOkxs.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-COxOJsgX.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-BX5NtnQ2.js +0 -1
- package/dist/gateway/static/root/assets/messages-B1sTgIrE.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-DZ0IWx1R.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-B9F1uue_.js +0 -8
- package/dist/gateway/static/root/assets/popover-select-B-GDnZO9.js +0 -1
- package/dist/gateway/static/root/assets/product-delivery-chCjIpvu.js +0 -1
- package/dist/gateway/static/root/assets/product-open-page-DEYWx__w.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-9qMDEKVd.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-D4UTOpEm.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CPmOucUB.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-DO8vGorm.js +0 -2
- package/dist/gateway/static/root/assets/sessions-page-zu5P0dk5.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-ClEw-i1l.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DElF2sgq.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-MLolJfoV.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DTPsW9TY.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-CNQHhsiv.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-Dc30oS9J.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-Bq6ab5WJ.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-Ci-4HAYm.js +0 -6
- package/dist/packages/gateway-contract/src/proactive.js +0 -136
- package/dist/src/commands/agents.config.d.ts +0 -31
- package/dist/src/commands/agents.config.js +0 -129
- package/dist/src/gateway/hono/routes/config-patch/agents.d.ts +0 -2
- package/dist/src/gateway/hono/routes/config-patch/agents.js +0 -6
- package/dist/src/storage/sqlite/relationship-settings-repository.d.ts +0 -17
- package/dist/src/storage/sqlite/relationship-settings-repository.js +0 -65
|
@@ -19,6 +19,7 @@ import { capabilityActions, isToolInputSchema, missingConnectionCapabilities } f
|
|
|
19
19
|
import { resolveConnectionCandidate } from "./connection-candidates.js";
|
|
20
20
|
import { installConnector } from "./install.js";
|
|
21
21
|
import { persistConfigMutation } from "../config/config-mutation.js";
|
|
22
|
+
import { HostPluginMcpRecovery } from "./plugin-mcp-recovery.js";
|
|
22
23
|
import { randomUUID } from "node:crypto";
|
|
23
24
|
//#region src/connectors/connection-recovery-service.ts
|
|
24
25
|
init_transaction();
|
|
@@ -36,6 +37,9 @@ const SCOPE_ORDER = {
|
|
|
36
37
|
};
|
|
37
38
|
const INTENT_TTL = 30 * 6e4;
|
|
38
39
|
const ATTEMPT_TTL = 10 * 6e4;
|
|
40
|
+
function isConnectorNeed(need) {
|
|
41
|
+
return need.target.type === "connector";
|
|
42
|
+
}
|
|
39
43
|
/** Authorization lives at click time. Chat history contains only immutable explanations. */
|
|
40
44
|
var ConnectionRecoveryService = class {
|
|
41
45
|
busy = /* @__PURE__ */ new Set();
|
|
@@ -77,6 +81,9 @@ var ConnectionRecoveryService = class {
|
|
|
77
81
|
get adapter() {
|
|
78
82
|
return this.deps.adapter ?? new ComposioSessionsAdapter();
|
|
79
83
|
}
|
|
84
|
+
get pluginMcp() {
|
|
85
|
+
return this.deps.pluginMcp ?? new HostPluginMcpRecovery(this.deps.getConfig);
|
|
86
|
+
}
|
|
80
87
|
snapshot(conversationId) {
|
|
81
88
|
if (!connectorPrincipalForSession(conversationId).isLocalOwner) throw new Error("This connection belongs to another principal.");
|
|
82
89
|
const transcriptId = readCurrentTranscriptId(getSqliteDatabase(), conversationId);
|
|
@@ -90,13 +97,25 @@ var ConnectionRecoveryService = class {
|
|
|
90
97
|
}
|
|
91
98
|
view(wait, verifiedIds) {
|
|
92
99
|
const needs = wait.needs.map((need) => {
|
|
93
|
-
|
|
94
|
-
|
|
100
|
+
if (need.target.type === "plugin-mcp") {
|
|
101
|
+
const availability = this.pluginMcp.availability(need.target);
|
|
102
|
+
const phase = !availability.available || need.connectionId && need.capabilityError ? "blocked" : need.connectionId === need.target.serverId ? "ready" : need.attempt && need.attempt.expiresAt > Date.now() ? "authorizing" : need.unavailable ? "reconnect" : "connect";
|
|
103
|
+
return {
|
|
104
|
+
...need,
|
|
105
|
+
phase,
|
|
106
|
+
accounts: [],
|
|
107
|
+
alternatives: [],
|
|
108
|
+
...availability.reason || need.capabilityError ? { reason: availability.reason ?? need.capabilityError } : {}
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
const id = need.target.connectorId;
|
|
112
|
+
const instance = listConnectorInstances(this.deps.getConfig()).find((instance) => instance.connectorId === id);
|
|
113
|
+
const installation = getConnectorInstallation(`${id}-${wait.principalId}`);
|
|
95
114
|
const cli = instance?.materialized.type === "cli" ? getCliAdapter(instance.materialized.adapterId) : void 0;
|
|
96
115
|
const scopeBlocked = Math.max(1, ...need.capabilities.filter((capability) => cli || /^[A-Z]+_/.test(capability)).map((capability) => SCOPE_ORDER[cli ? cli.curatedActions[capability] ?? "read" : scopeForComposioAction(capability).scope])) > SCOPE_ORDER[installation?.maxScope ?? "read"];
|
|
97
116
|
const all = listConnectorConnections({
|
|
98
117
|
principalId: wait.principalId,
|
|
99
|
-
connectorId:
|
|
118
|
+
connectorId: id
|
|
100
119
|
});
|
|
101
120
|
const requested = need.accountId ? all.find((connection) => connection.accountId === need.accountId) : void 0;
|
|
102
121
|
const blocked = scopeBlocked || instance?.enabled === false || installation?.enabled === false || installation?.selectedAccountIds?.length === 0 || Boolean(installation && requested && !canAccessConnectorAccount(requested, installation, wait.agentId)) || Boolean(installation?.allowedAgentIds.length && !installation.allowedAgentIds.includes(wait.agentId));
|
|
@@ -115,9 +134,9 @@ var ConnectionRecoveryService = class {
|
|
|
115
134
|
"revoked",
|
|
116
135
|
"failed"
|
|
117
136
|
].includes(connection.status)) ? "reconnect" : "connect";
|
|
118
|
-
const alternatives = ["composio-gmail", "composio-outlook"].includes(
|
|
119
|
-
candidateRef:
|
|
120
|
-
label: getConnectorDefinition(
|
|
137
|
+
const alternatives = ["composio-gmail", "composio-outlook"].includes(id) ? ["composio-gmail", "composio-outlook"].filter((candidate) => candidate !== id).map((candidate) => ({
|
|
138
|
+
candidateRef: candidate,
|
|
139
|
+
label: getConnectorDefinition(candidate)?.displayName ?? candidate
|
|
121
140
|
})) : [];
|
|
122
141
|
return {
|
|
123
142
|
...need,
|
|
@@ -174,14 +193,16 @@ var ConnectionRecoveryService = class {
|
|
|
174
193
|
}))
|
|
175
194
|
}, verified).needs;
|
|
176
195
|
return Promise.all(wait.needs.map(async (need) => {
|
|
196
|
+
if (need.target.type === "plugin-mcp") return need;
|
|
177
197
|
if (views.find((view) => view.key === need.key)?.phase !== "ready") return {
|
|
178
198
|
...need,
|
|
179
199
|
capabilityError: void 0
|
|
180
200
|
};
|
|
181
201
|
try {
|
|
182
|
-
const
|
|
202
|
+
const id = need.target.connectorId;
|
|
203
|
+
const instance = listConnectorInstances(this.deps.getConfig()).find((instance) => instance.connectorId === id && instance.enabled);
|
|
183
204
|
if (!instance) throw new Error("Connector setup is unavailable");
|
|
184
|
-
const definition = getInstalledConnectorDefinition(this.deps.getConfig(), instance.instanceId) ?? getConnectorDefinition(
|
|
205
|
+
const definition = getInstalledConnectorDefinition(this.deps.getConfig(), instance.instanceId) ?? getConnectorDefinition(id);
|
|
185
206
|
if (definition?.runtime.type === "cli") {
|
|
186
207
|
const selected = views.find((view) => view.key === need.key);
|
|
187
208
|
const connection = selected?.connectionId ? getConnectorConnection(selected.connectionId) : void 0;
|
|
@@ -211,7 +232,7 @@ var ConnectionRecoveryService = class {
|
|
|
211
232
|
const missing = missingConnectionCapabilities(need, new Set(Object.entries(schemas && typeof schemas === "object" ? schemas : {}).filter(([action, value]) => value && typeof value === "object" && isToolInputSchema(value.inputSchema) && isComposioActionAllowedByCatalog(action)).map(([action]) => action)));
|
|
212
233
|
if (missing.length) log.warn({
|
|
213
234
|
conversationId: wait.conversationId,
|
|
214
|
-
connectorId:
|
|
235
|
+
connectorId: id,
|
|
215
236
|
missingCapabilities: missing
|
|
216
237
|
}, "Connected app lacks required tool contracts");
|
|
217
238
|
return {
|
|
@@ -222,7 +243,7 @@ var ConnectionRecoveryService = class {
|
|
|
222
243
|
log.warn({
|
|
223
244
|
err,
|
|
224
245
|
conversationId: wait.conversationId,
|
|
225
|
-
connectorId: need.connectorId
|
|
246
|
+
connectorId: need.target.connectorId
|
|
226
247
|
}, "Connected app capability check failed");
|
|
227
248
|
return {
|
|
228
249
|
...need,
|
|
@@ -235,9 +256,10 @@ var ConnectionRecoveryService = class {
|
|
|
235
256
|
const config = this.deps.getConfig();
|
|
236
257
|
const instances = listConnectorInstances(config);
|
|
237
258
|
const cliIds = new Set(instances.filter((item) => item.materialized.type === "cli").map((item) => item.connectorId));
|
|
238
|
-
const
|
|
259
|
+
const connectorNeeds = wait.needs.filter(isConnectorNeed);
|
|
260
|
+
const fresh = connectorNeeds.some((need) => !cliIds.has(need.target.connectorId)) ? await this.adapter.syncConnections({ principalId: wait.principalId }) : [];
|
|
239
261
|
for (const connection of currentAccountConnections(listConnectorConnections({ principalId: wait.principalId }))) {
|
|
240
|
-
if (connection.provider !== "cli" || !
|
|
262
|
+
if (connection.provider !== "cli" || !connectorNeeds.some((need) => need.target.connectorId === connection.connectorId)) continue;
|
|
241
263
|
const policy = getConnectorInstallation(`${connection.connectorId}-${wait.principalId}`);
|
|
242
264
|
if (!policy || !canAccessConnectorAccount(connection, policy, wait.agentId)) continue;
|
|
243
265
|
const instanceId = connection.metadata.runtimeInstanceId;
|
|
@@ -247,6 +269,38 @@ var ConnectionRecoveryService = class {
|
|
|
247
269
|
}
|
|
248
270
|
return fresh;
|
|
249
271
|
}
|
|
272
|
+
async syncPluginMcpNeeds(wait) {
|
|
273
|
+
return Promise.all(wait.needs.map(async (need) => {
|
|
274
|
+
if (need.target.type !== "plugin-mcp") return need;
|
|
275
|
+
const status = await this.pluginMcp.status(need.target);
|
|
276
|
+
if (status.status === "connected") {
|
|
277
|
+
const verified = await this.pluginMcp.verify(need.target);
|
|
278
|
+
return {
|
|
279
|
+
...need,
|
|
280
|
+
connectionId: need.target.serverId,
|
|
281
|
+
unavailable: false,
|
|
282
|
+
attempt: void 0,
|
|
283
|
+
capabilityError: verified.ready ? void 0 : verified.error ?? "The connected MCP tools are unavailable."
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
if (status.status === "authorizing") return {
|
|
287
|
+
...need,
|
|
288
|
+
connectionId: void 0,
|
|
289
|
+
unavailable: false,
|
|
290
|
+
attempt: {
|
|
291
|
+
id: status.session?.id ?? need.attempt?.id ?? randomUUID(),
|
|
292
|
+
expiresAt: status.session?.expiresAt ?? Date.now() + ATTEMPT_TTL
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
return {
|
|
296
|
+
...need,
|
|
297
|
+
connectionId: void 0,
|
|
298
|
+
unavailable: true,
|
|
299
|
+
attempt: void 0,
|
|
300
|
+
capabilityError: status.status === "error" ? status.session?.error : void 0
|
|
301
|
+
};
|
|
302
|
+
}));
|
|
303
|
+
}
|
|
250
304
|
async preflight(input) {
|
|
251
305
|
if (input.kind !== "connection_resume") return true;
|
|
252
306
|
const wait = input.payload ? getConnectionWait(input.payload.waitId) : void 0;
|
|
@@ -255,12 +309,13 @@ var ConnectionRecoveryService = class {
|
|
|
255
309
|
try {
|
|
256
310
|
const fresh = await this.syncConnections(wait);
|
|
257
311
|
const verified = new Set(fresh.filter((item) => item.status === "active").map((item) => item.id));
|
|
258
|
-
wait.needs = await this.
|
|
259
|
-
|
|
260
|
-
wait.needs = wait.needs.map((need) => ({
|
|
312
|
+
wait.needs = await this.syncPluginMcpNeeds(wait);
|
|
313
|
+
wait.needs = wait.needs.map((need) => need.target.type === "plugin-mcp" ? need : {
|
|
261
314
|
...need,
|
|
262
315
|
unavailable: !fresh.some((item) => item.id === need.connectionId && item.status === "active")
|
|
263
|
-
})
|
|
316
|
+
});
|
|
317
|
+
wait.needs = await this.checkCapabilities(wait, verified);
|
|
318
|
+
const ready = this.view(wait, verified).needs.every((need) => need.phase === "ready");
|
|
264
319
|
if (getConnectionWait(wait.id)?.version !== wait.version) return false;
|
|
265
320
|
if (ready && wait.intent && wait.intent.validUntil > Date.now() && wait.intent.objectiveRevision === wait.objectiveRevision) return true;
|
|
266
321
|
} catch {}
|
|
@@ -319,8 +374,51 @@ var ConnectionRecoveryService = class {
|
|
|
319
374
|
const need = wait.needs.find((need) => need.key === action.needKey);
|
|
320
375
|
if (!need) throw new Error("Unknown connection requirement.");
|
|
321
376
|
if (this.view(wait).needs.find((item) => item.key === need.key)?.phase === "blocked") throw new Error("Connector policy blocks this connection.");
|
|
322
|
-
|
|
323
|
-
|
|
377
|
+
if (need.target.type === "plugin-mcp") {
|
|
378
|
+
const serverId = need.target.serverId;
|
|
379
|
+
const attemptId = randomUUID();
|
|
380
|
+
wait = updateConnectionWait({
|
|
381
|
+
...wait,
|
|
382
|
+
intent: {
|
|
383
|
+
objectiveRevision: wait.objectiveRevision,
|
|
384
|
+
validUntil: Date.now() + INTENT_TTL
|
|
385
|
+
},
|
|
386
|
+
needs: wait.needs.map((item) => item.key === need.key ? {
|
|
387
|
+
...item,
|
|
388
|
+
unavailable: false,
|
|
389
|
+
capabilityError: void 0,
|
|
390
|
+
attempt: {
|
|
391
|
+
id: attemptId,
|
|
392
|
+
expiresAt: Date.now() + ATTEMPT_TTL
|
|
393
|
+
}
|
|
394
|
+
} : item)
|
|
395
|
+
}, wait.version);
|
|
396
|
+
publishConnectionWait(conversationId);
|
|
397
|
+
const auth = await this.pluginMcp.start(need.target);
|
|
398
|
+
const latest = getConnectionWait(wait.id);
|
|
399
|
+
if (!latest || latest.version !== wait.version || latest.status !== "open") throw new Error("WAIT_CHANGED");
|
|
400
|
+
wait = updateConnectionWait({
|
|
401
|
+
...wait,
|
|
402
|
+
needs: wait.needs.map((item) => item.key === need.key ? {
|
|
403
|
+
...item,
|
|
404
|
+
attempt: auth.status === "authorizing" ? {
|
|
405
|
+
id: auth.session?.id ?? attemptId,
|
|
406
|
+
expiresAt: auth.session?.expiresAt ?? Date.now() + ATTEMPT_TTL
|
|
407
|
+
} : void 0,
|
|
408
|
+
connectionId: auth.status === "connected" ? serverId : void 0,
|
|
409
|
+
unavailable: auth.status === "error",
|
|
410
|
+
capabilityError: auth.status === "error" ? auth.session?.error : void 0
|
|
411
|
+
} : item)
|
|
412
|
+
}, wait.version);
|
|
413
|
+
publishConnectionWait(conversationId);
|
|
414
|
+
return {
|
|
415
|
+
snapshot: this.snapshot(conversationId),
|
|
416
|
+
authorizationUrl: auth.session?.authorizationUrl
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
const id = need.target.connectorId;
|
|
420
|
+
const instance = listConnectorInstances(this.deps.getConfig()).find((item) => item.connectorId === id);
|
|
421
|
+
const definition = (instance ? getInstalledConnectorDefinition(this.deps.getConfig(), instance.instanceId) : void 0) ?? getConnectorDefinition(id);
|
|
324
422
|
if (definition?.runtime.type === "cli") {
|
|
325
423
|
updateConnectionWait({
|
|
326
424
|
...wait,
|
|
@@ -332,7 +430,7 @@ var ConnectionRecoveryService = class {
|
|
|
332
430
|
publishConnectionWait(conversationId);
|
|
333
431
|
return {
|
|
334
432
|
snapshot: this.snapshot(conversationId),
|
|
335
|
-
authorizationUrl: `/#/connectors?connector=${encodeURIComponent(
|
|
433
|
+
authorizationUrl: `/#/connectors?connector=${encodeURIComponent(id)}`
|
|
336
434
|
};
|
|
337
435
|
}
|
|
338
436
|
if (definition?.runtime.type !== "composio" || definition.runtime.role !== "toolkit") throw new Error("Unsupported connector.");
|
|
@@ -353,8 +451,8 @@ var ConnectionRecoveryService = class {
|
|
|
353
451
|
}, wait.version);
|
|
354
452
|
publishConnectionWait(conversationId);
|
|
355
453
|
const config = this.deps.getConfig();
|
|
356
|
-
await this.ensureInstallation(wait,
|
|
357
|
-
const installationId = `${
|
|
454
|
+
await this.ensureInstallation(wait, id);
|
|
455
|
+
const installationId = `${id}-${wait.principalId}`;
|
|
358
456
|
const auth = await this.adapter.authorize({
|
|
359
457
|
principalId: wait.principalId,
|
|
360
458
|
toolkit: definition.runtime.toolkit,
|
|
@@ -388,12 +486,20 @@ var ConnectionRecoveryService = class {
|
|
|
388
486
|
authorizationUrl: auth.connectUrl
|
|
389
487
|
};
|
|
390
488
|
} else {
|
|
489
|
+
if (action.action === "submit_callback") {
|
|
490
|
+
const need = wait.needs.find((need) => need.key === action.needKey);
|
|
491
|
+
if (!need || need.target.type !== "plugin-mcp") throw new Error("OAuth callback is unavailable.");
|
|
492
|
+
if (!action.callbackUrl || action.callbackUrl.length > 16384) throw new Error("Expected the complete OAuth callback URL.");
|
|
493
|
+
await this.pluginMcp.submitCallback(need.target, action.callbackUrl);
|
|
494
|
+
}
|
|
391
495
|
const fresh = await this.syncConnections(wait);
|
|
392
496
|
const verified = new Set(fresh.filter((item) => item.status === "active").map((item) => item.id));
|
|
393
497
|
const latest = getConnectionWait(wait.id);
|
|
394
498
|
if (!latest || latest.version !== wait.version || latest.status !== "open") throw new Error("WAIT_CHANGED");
|
|
395
499
|
let needs = wait.needs.map((need) => {
|
|
396
|
-
|
|
500
|
+
if (need.target.type === "plugin-mcp") return need;
|
|
501
|
+
const id = need.target.connectorId;
|
|
502
|
+
const authorized = fresh.find((item) => item.providerConnectionId === need.attempt?.connectionId && item.status === "active" && item.connectorId === id && (!need.accountId || item.accountId === need.accountId));
|
|
397
503
|
return authorized ? {
|
|
398
504
|
...need,
|
|
399
505
|
unavailable: false,
|
|
@@ -404,13 +510,19 @@ var ConnectionRecoveryService = class {
|
|
|
404
510
|
attempt: void 0
|
|
405
511
|
} : {
|
|
406
512
|
...need,
|
|
407
|
-
unavailable: !fresh.some((item) => item.connectorId ===
|
|
513
|
+
unavailable: !fresh.some((item) => item.connectorId === id && item.status === "active" && (!need.connectionId || item.id === need.connectionId) && (!need.accountId || item.accountId === need.accountId))
|
|
408
514
|
};
|
|
409
515
|
});
|
|
516
|
+
needs = await this.syncPluginMcpNeeds({
|
|
517
|
+
...wait,
|
|
518
|
+
needs
|
|
519
|
+
});
|
|
410
520
|
if (action.action === "select_account") {
|
|
411
521
|
const need = needs.find((item) => item.key === action.needKey);
|
|
412
|
-
|
|
413
|
-
|
|
522
|
+
if (!need || need.target.type !== "connector") throw new Error("Account selection is unavailable.");
|
|
523
|
+
const id = need.target.connectorId;
|
|
524
|
+
const connection = currentAccountConnections(fresh).find((item) => item.accountId === action.accountId && item.connectorId === id);
|
|
525
|
+
if (!connection || !this.view(wait, verified).needs.find((item) => item.key === need.key)?.accounts.some((item) => item.id === connection.accountId)) throw new Error("Account is unavailable.");
|
|
414
526
|
needs = needs.map((item) => item.key === need.key ? {
|
|
415
527
|
...item,
|
|
416
528
|
connectionId: connection.id,
|
|
@@ -422,7 +534,7 @@ var ConnectionRecoveryService = class {
|
|
|
422
534
|
for (const selected of this.view({
|
|
423
535
|
...wait,
|
|
424
536
|
needs
|
|
425
|
-
}, verified).needs) if (selected.phase === "ready" || selected.capabilityError && selected.connectionId) await this.ensureInstallation(wait, selected.connectorId);
|
|
537
|
+
}, verified).needs) if (selected.target.type === "connector" && (selected.phase === "ready" || selected.capabilityError && selected.connectionId)) await this.ensureInstallation(wait, selected.target.connectorId);
|
|
426
538
|
needs = await this.checkCapabilities({
|
|
427
539
|
...wait,
|
|
428
540
|
needs
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getConnectorConnection, getConnectorInstallation } from "../storage/sqlite/connector-repository.js";
|
|
2
2
|
import { getKnowledgeSourceItem, listKnowledgeSourceItems, upsertKnowledgeSourceItems } from "../storage/sqlite/knowledge-repository.js";
|
|
3
|
-
import "../storage/sqlite/index.js";
|
|
3
|
+
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
4
4
|
import { ComposioSessionsAdapter } from "./composio-sessions.js";
|
|
5
5
|
import { ConnectedKnowledgePipeline } from "../knowledge/connected-knowledge-pipeline.js";
|
|
6
6
|
import { sanitizeConnectedSourceValue } from "./connected-source-sanitization.js";
|
|
@@ -9,6 +9,7 @@ import { isAbsolute, join, relative, sep } from "node:path";
|
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
10
10
|
import { mkdtemp, readFile, realpath, rm } from "node:fs/promises";
|
|
11
11
|
//#region src/connectors/content-enrichment.ts
|
|
12
|
+
init_sqlite();
|
|
12
13
|
const MAX_SELECTION = 5;
|
|
13
14
|
const MAX_CONTENT_BYTES = 1e6;
|
|
14
15
|
const MAX_CONTENT_CHARS = 24e3;
|
|
@@ -4,7 +4,7 @@ import { claimNextConnectorLearningJob, enqueueConnectorLearningJob, listConnect
|
|
|
4
4
|
import { getConnectorAccount, reconcileConnectorAccount } from "../storage/sqlite/connector-account-repository.js";
|
|
5
5
|
import { getConnectorInstallation, listConnectorConnections, upsertConnectorConnection } from "../storage/sqlite/connector-repository.js";
|
|
6
6
|
import { getConnectorSyncPolicyForConnection } from "../storage/sqlite/connector-sync-policy-repository.js";
|
|
7
|
-
import "../storage/sqlite/index.js";
|
|
7
|
+
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
8
8
|
import { connectorIdentityKey, normalizeConnectorIdentity } from "./connector-identity.js";
|
|
9
9
|
import { ComposioSessionsAdapter } from "./composio-sessions.js";
|
|
10
10
|
import { buildConnectorLearningArguments, getConnectorLearningPlan } from "./learning-recipes.js";
|
|
@@ -17,6 +17,7 @@ import { deriveConnectedSourceUnderstanding } from "./connected-source-understan
|
|
|
17
17
|
import { listConnectedContentCandidates, readConnectedContent } from "./content-enrichment.js";
|
|
18
18
|
import { getConnectorUnderstandingSourceRun, getOrCreateConnectorUnderstandingSourceRun, getUnderstandingSourceGrant, listUnderstandingSourceGrants, updateUnderstandingSourceGrantCheckpoint, updateUnderstandingSourceRun, upsertUnderstandingSourceGrant } from "../user-context/sources/repository.js";
|
|
19
19
|
//#region src/connectors/learning-coordinator.ts
|
|
20
|
+
init_sqlite();
|
|
20
21
|
init_logger();
|
|
21
22
|
const log = createLogger("ConnectorLearning");
|
|
22
23
|
const CONNECTED_ACCOUNT_UNAVAILABLE = "connected_account_unavailable";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { PluginMcpConnectionTarget } from '@xopcai/gateway-contract';
|
|
2
|
+
import { type McpOAuthStatus } from '../agent/mcp/oauth/mcp-oauth-manager.js';
|
|
3
|
+
import type { Config } from '../config/schema.js';
|
|
4
|
+
export type PluginMcpAvailability = {
|
|
5
|
+
available: boolean;
|
|
6
|
+
reason?: string;
|
|
7
|
+
};
|
|
8
|
+
export type PluginMcpVerification = {
|
|
9
|
+
ready: boolean;
|
|
10
|
+
error?: string;
|
|
11
|
+
};
|
|
12
|
+
export interface PluginMcpRecovery {
|
|
13
|
+
availability(target: PluginMcpConnectionTarget): PluginMcpAvailability;
|
|
14
|
+
status(target: PluginMcpConnectionTarget): Promise<McpOAuthStatus>;
|
|
15
|
+
start(target: PluginMcpConnectionTarget): Promise<McpOAuthStatus>;
|
|
16
|
+
verify(target: PluginMcpConnectionTarget): Promise<PluginMcpVerification>;
|
|
17
|
+
submitCallback(target: PluginMcpConnectionTarget, callbackUrl: string): Promise<McpOAuthStatus>;
|
|
18
|
+
}
|
|
19
|
+
export declare class HostPluginMcpRecovery implements PluginMcpRecovery {
|
|
20
|
+
private readonly getConfig;
|
|
21
|
+
constructor(getConfig: () => Config);
|
|
22
|
+
availability(target: PluginMcpConnectionTarget): PluginMcpAvailability;
|
|
23
|
+
status(target: PluginMcpConnectionTarget): Promise<McpOAuthStatus>;
|
|
24
|
+
start(target: PluginMcpConnectionTarget): Promise<McpOAuthStatus>;
|
|
25
|
+
verify(target: PluginMcpConnectionTarget): Promise<PluginMcpVerification>;
|
|
26
|
+
submitCallback(target: PluginMcpConnectionTarget, callbackUrl: string): Promise<McpOAuthStatus>;
|
|
27
|
+
private resolveServer;
|
|
28
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { AgentPluginStore } from "../extensions/agent-plugins/store.js";
|
|
2
|
+
import { savePluginAuthBinding } from "../extensions/agent-plugins/auth.js";
|
|
3
|
+
import { loadMergedBundleMcpConfig } from "../agent/mcp/bundle-mcp-config.js";
|
|
4
|
+
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
5
|
+
import { getMcpOAuthManager } from "../agent/mcp/oauth/mcp-oauth-manager.js";
|
|
6
|
+
import { listBundleMcpServerCapabilitiesForGateway } from "../agent/mcp/bundle-mcp-gateway.js";
|
|
7
|
+
//#region src/connectors/plugin-mcp-recovery.ts
|
|
8
|
+
var HostPluginMcpRecovery = class {
|
|
9
|
+
constructor(getConfig) {
|
|
10
|
+
this.getConfig = getConfig;
|
|
11
|
+
}
|
|
12
|
+
availability(target) {
|
|
13
|
+
const plugin = new AgentPluginStore().get(target.pluginId);
|
|
14
|
+
if (!plugin) return {
|
|
15
|
+
available: false,
|
|
16
|
+
reason: "The plugin is no longer installed."
|
|
17
|
+
};
|
|
18
|
+
if (!plugin.receipt.enabled) return {
|
|
19
|
+
available: false,
|
|
20
|
+
reason: "Enable the plugin before connecting its account."
|
|
21
|
+
};
|
|
22
|
+
if (plugin.readiness === "blocked") return {
|
|
23
|
+
available: false,
|
|
24
|
+
reason: "Repair the plugin before connecting its account."
|
|
25
|
+
};
|
|
26
|
+
if (plugin.servers[target.serverName]?.type !== "streamable-http") return {
|
|
27
|
+
available: false,
|
|
28
|
+
reason: "This plugin server does not support OAuth."
|
|
29
|
+
};
|
|
30
|
+
return { available: true };
|
|
31
|
+
}
|
|
32
|
+
async status(target) {
|
|
33
|
+
const server = this.resolveServer(target);
|
|
34
|
+
return getMcpOAuthManager(server).status(target.serverId, server);
|
|
35
|
+
}
|
|
36
|
+
async start(target) {
|
|
37
|
+
const availability = this.availability(target);
|
|
38
|
+
if (!availability.available) throw new Error(availability.reason);
|
|
39
|
+
await savePluginAuthBinding(new AgentPluginStore(), target.pluginId, target.serverName, { mode: "oauth" });
|
|
40
|
+
const server = this.resolveServer(target);
|
|
41
|
+
return getMcpOAuthManager(server).start({
|
|
42
|
+
serverId: target.serverId,
|
|
43
|
+
rawServer: server,
|
|
44
|
+
cfg: this.getConfig()
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
async verify(target) {
|
|
48
|
+
const availability = this.availability(target);
|
|
49
|
+
if (!availability.available) return {
|
|
50
|
+
ready: false,
|
|
51
|
+
error: availability.reason
|
|
52
|
+
};
|
|
53
|
+
const status = await this.status(target);
|
|
54
|
+
if (status.status !== "connected") return {
|
|
55
|
+
ready: false,
|
|
56
|
+
error: status.session?.error
|
|
57
|
+
};
|
|
58
|
+
const cfg = this.getConfig();
|
|
59
|
+
const capabilities = await listBundleMcpServerCapabilitiesForGateway({
|
|
60
|
+
workspaceDir: getWorkspacePath(cfg) || "./workspace",
|
|
61
|
+
cfg,
|
|
62
|
+
serverId: target.serverId
|
|
63
|
+
});
|
|
64
|
+
if (capabilities.error) return {
|
|
65
|
+
ready: false,
|
|
66
|
+
error: capabilities.error.message
|
|
67
|
+
};
|
|
68
|
+
if (capabilities.toolCount === 0) return {
|
|
69
|
+
ready: false,
|
|
70
|
+
error: "The connected MCP server did not expose any tools."
|
|
71
|
+
};
|
|
72
|
+
return { ready: true };
|
|
73
|
+
}
|
|
74
|
+
async submitCallback(target, callbackUrl) {
|
|
75
|
+
const server = this.resolveServer(target);
|
|
76
|
+
return getMcpOAuthManager(server).submitCallback(target.serverId, server, callbackUrl);
|
|
77
|
+
}
|
|
78
|
+
resolveServer(target) {
|
|
79
|
+
const cfg = this.getConfig();
|
|
80
|
+
const server = loadMergedBundleMcpConfig({
|
|
81
|
+
workspaceDir: getWorkspacePath(cfg) || "./workspace",
|
|
82
|
+
cfg
|
|
83
|
+
}).config.mcpServers[target.serverId];
|
|
84
|
+
const origin = server?.xopcPlugin;
|
|
85
|
+
if (!server || origin?.id !== target.pluginId || origin.serverName !== target.serverName) throw new Error("Plugin MCP server is unavailable.");
|
|
86
|
+
return server;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
//#endregion
|
|
90
|
+
export { HostPluginMcpRecovery };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isXopcDatabaseOpen } from "../storage/sqlite/connection.js";
|
|
2
2
|
import { deleteConnectorInstallation, getConnectorInstallation, upsertConnectorInstallation } from "../storage/sqlite/connector-repository.js";
|
|
3
|
-
import "../storage/sqlite/index.js";
|
|
3
|
+
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
4
4
|
import { getCliAdapter } from "./cli/adapterRegistry.js";
|
|
5
5
|
import { assertComposioAccessConfigured } from "./composio-sessions.js";
|
|
6
6
|
import { saveConnectorSecrets } from "./secret-store.js";
|
|
@@ -10,6 +10,7 @@ import { listConnectorInstances } from "./instances.js";
|
|
|
10
10
|
import { installCli } from "./cli/installer.js";
|
|
11
11
|
import { stopCliInstance } from "./cli/lifecycle.js";
|
|
12
12
|
//#region src/connectors/runtime-adapter-registry.ts
|
|
13
|
+
init_sqlite();
|
|
13
14
|
const adapters = /* @__PURE__ */ new Map();
|
|
14
15
|
function registerConnectorRuntimeAdapter(adapter) {
|
|
15
16
|
if (adapters.has(adapter.type)) throw new Error(`Connector runtime adapter is already registered: ${adapter.type}`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Config } from '../config/schema.js';
|
|
2
|
-
import type { WorkflowDefinition } from '../workflows/domain/definition.js';
|
|
2
|
+
import type { WorkflowConnectorRequirement, WorkflowDefinition } from '../workflows/domain/definition.js';
|
|
3
3
|
export type ConnectorPreflightIssueCode = 'not_installed' | 'disabled' | 'agent_not_allowed' | 'scope_too_narrow' | 'connection_missing' | 'account_selection_required' | 'reauthorization_required';
|
|
4
4
|
export type ConnectorPreflightIssue = {
|
|
5
5
|
connectorId: string;
|
|
@@ -13,6 +13,13 @@ export type ConnectorPreflightResult = {
|
|
|
13
13
|
issues: ConnectorPreflightIssue[];
|
|
14
14
|
optionalIssues: ConnectorPreflightIssue[];
|
|
15
15
|
};
|
|
16
|
+
export type ConnectorRequirementPreflightInput = {
|
|
17
|
+
requirements: readonly WorkflowConnectorRequirement[];
|
|
18
|
+
config: Config;
|
|
19
|
+
agentId: string;
|
|
20
|
+
principalId?: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function preflightConnectorRequirements(input: ConnectorRequirementPreflightInput): ConnectorPreflightResult;
|
|
16
23
|
export declare function preflightWorkflowConnectors(input: {
|
|
17
24
|
definition: WorkflowDefinition;
|
|
18
25
|
config: Config;
|
|
@@ -18,7 +18,7 @@ function issue(requirement, code, message) {
|
|
|
18
18
|
recoveryPath: `/connectors?connector=${encodeURIComponent(requirement.connectorId)}`
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function preflightConnectorRequirements(input) {
|
|
22
22
|
const principalId = input.principalId ?? "local-owner";
|
|
23
23
|
const instances = listConnectorInstances(input.config);
|
|
24
24
|
const issues = [];
|
|
@@ -27,7 +27,7 @@ function preflightWorkflowConnectors(input) {
|
|
|
27
27
|
const add = (requirement, value) => {
|
|
28
28
|
(requirement.optional ? optionalIssues : issues).push(value);
|
|
29
29
|
};
|
|
30
|
-
for (const requirement of input.
|
|
30
|
+
for (const requirement of input.requirements) {
|
|
31
31
|
const instance = instances.find((candidate) => candidate.connectorId === requirement.connectorId);
|
|
32
32
|
if (!instance) {
|
|
33
33
|
add(requirement, issue(requirement, "not_installed", `${requirement.connectorId} is not installed.`));
|
|
@@ -85,5 +85,13 @@ function preflightWorkflowConnectors(input) {
|
|
|
85
85
|
optionalIssues
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
|
+
function preflightWorkflowConnectors(input) {
|
|
89
|
+
return preflightConnectorRequirements({
|
|
90
|
+
requirements: input.definition.connectors ?? [],
|
|
91
|
+
config: input.config,
|
|
92
|
+
agentId: input.agentId,
|
|
93
|
+
...input.principalId ? { principalId: input.principalId } : {}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
88
96
|
//#endregion
|
|
89
|
-
export { preflightWorkflowConnectors };
|
|
97
|
+
export { preflightConnectorRequirements, preflightWorkflowConnectors };
|
|
@@ -151,7 +151,7 @@ async function summarizeMeetingOverview(chapters, reduce) {
|
|
|
151
151
|
return latest;
|
|
152
152
|
}
|
|
153
153
|
async function analyzeDiscussion(input) {
|
|
154
|
-
const modelRef = getAgentDefaultModelRef(
|
|
154
|
+
const modelRef = getAgentDefaultModelRef();
|
|
155
155
|
if (!modelRef) throw new Error("No model configured for discussion organization");
|
|
156
156
|
const batches = partitionDiscussionSegments(input.segments);
|
|
157
157
|
if (!batches.length) throw new Error("Discussion transcript is empty");
|
|
@@ -275,7 +275,7 @@ async function analyzeDiscussion(input) {
|
|
|
275
275
|
};
|
|
276
276
|
}
|
|
277
277
|
async function enrichLiveDiscussion(input) {
|
|
278
|
-
const modelRef = getAgentDefaultModelRef(
|
|
278
|
+
const modelRef = getAgentDefaultModelRef();
|
|
279
279
|
if (!modelRef) throw new Error("No default model configured for discussion enrichment");
|
|
280
280
|
const transcript = input.transcript.trim().slice(0, 12e3);
|
|
281
281
|
if (!transcript) throw new Error("Discussion transcript is empty");
|
|
@@ -5,7 +5,7 @@ import { deleteEndpointSessionBinding, getEndpointSessionBinding, setEndpointSes
|
|
|
5
5
|
import { deleteBrowserTabBindingsByEndpoint } from "../storage/sqlite/browser-tab-binding-repository.js";
|
|
6
6
|
import { bindEndpointPrincipal, getEndpointPrincipal, touchEndpointPrincipal } from "../storage/sqlite/endpoint-principal-repository.js";
|
|
7
7
|
import { finishEndpointToolInvocationAudit, startEndpointToolInvocationAudit } from "../storage/sqlite/endpoint-tool-invocation-repository.js";
|
|
8
|
-
import "../storage/sqlite/index.js";
|
|
8
|
+
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
9
9
|
import { init_paths } from "../config/paths.js";
|
|
10
10
|
import { EndpointAuthenticator } from "./auth.js";
|
|
11
11
|
import { EndpointBindingService } from "./binding-service.js";
|
|
@@ -16,6 +16,7 @@ import { EndpointUploadService } from "./upload-service.js";
|
|
|
16
16
|
import { join } from "node:path";
|
|
17
17
|
//#region src/endpoint-tools/runtime.ts
|
|
18
18
|
init_paths();
|
|
19
|
+
init_sqlite();
|
|
19
20
|
init_logger();
|
|
20
21
|
const log = createLogger("EndpointTools");
|
|
21
22
|
const MAX_MESSAGE_CLOCK_SKEW_MS = 6e4;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { isXopcDatabaseOpen } from "../storage/sqlite/connection.js";
|
|
2
|
-
import "../storage/sqlite/index.js";
|
|
2
|
+
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
3
3
|
import { ExecutionEnvironmentStore } from "./store.js";
|
|
4
4
|
//#region src/execution-environments/subject.ts
|
|
5
|
+
init_sqlite();
|
|
5
6
|
function getExecutionEnvironmentForSession(conversationId) {
|
|
6
7
|
if (!isXopcDatabaseOpen()) return void 0;
|
|
7
8
|
const store = new ExecutionEnvironmentStore();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
1
2
|
import { PROVIDER_ENV_MAP, init_env_keys } from "../providers/env-keys.js";
|
|
2
3
|
import { init_providers, isProviderConfiguredSync } from "../providers/index.js";
|
|
3
4
|
import { collectSttProviderConfigEntries } from "../voice/stt/config-slice.js";
|
|
@@ -10,6 +11,7 @@ import { isSttProviderConfigured } from "../voice/stt/list-providers.js";
|
|
|
10
11
|
//#region src/extensions/activation-context.ts
|
|
11
12
|
init_providers();
|
|
12
13
|
init_env_keys();
|
|
14
|
+
init_schema();
|
|
13
15
|
function isRecord(x) {
|
|
14
16
|
return typeof x === "object" && x !== null && !Array.isArray(x);
|
|
15
17
|
}
|
|
@@ -89,21 +91,6 @@ function collectConfiguredProviderIds(config) {
|
|
|
89
91
|
]);
|
|
90
92
|
return ids.size > 0 ? [...ids] : void 0;
|
|
91
93
|
}
|
|
92
|
-
function defaultModelId(config) {
|
|
93
|
-
const agents = config?.agents;
|
|
94
|
-
if (!isRecord(agents)) return void 0;
|
|
95
|
-
const list = agents.list;
|
|
96
|
-
if (!Array.isArray(list)) return void 0;
|
|
97
|
-
const defaultId = typeof agents.default === "string" ? agents.default : void 0;
|
|
98
|
-
const entry = list.find((candidate) => isRecord(candidate) && candidate.id === defaultId) ?? list.find((candidate) => isRecord(candidate) && candidate.enabled !== false);
|
|
99
|
-
const overrideModels = isRecord(entry) && isRecord(entry.models) ? entry.models : void 0;
|
|
100
|
-
const overrideChat = overrideModels && isRecord(overrideModels.chat) ? overrideModels.chat : void 0;
|
|
101
|
-
if (typeof overrideChat?.primary === "string" && overrideChat.primary.trim()) return overrideChat.primary;
|
|
102
|
-
const defaults = isRecord(agents.defaults) ? agents.defaults : void 0;
|
|
103
|
-
const models = defaults && isRecord(defaults.models) ? defaults.models : void 0;
|
|
104
|
-
const chat = models && isRecord(models.chat) ? models.chat : void 0;
|
|
105
|
-
return typeof chat?.primary === "string" && chat.primary.trim() ? chat.primary : void 0;
|
|
106
|
-
}
|
|
107
94
|
/**
|
|
108
95
|
* Merge partial activation context over values inferred from loaded app config.
|
|
109
96
|
*/
|
|
@@ -112,7 +99,7 @@ function mergeActivationContext(appConfig, partial) {
|
|
|
112
99
|
const base = {
|
|
113
100
|
enabledIds: Array.isArray(ext?.enabled) ? ext.enabled.filter((x) => typeof x === "string") : void 0,
|
|
114
101
|
disabledIds: Array.isArray(ext?.disabled) ? ext.disabled.filter((x) => typeof x === "string") : void 0,
|
|
115
|
-
requestedModelId:
|
|
102
|
+
requestedModelId: getAgentDefaultModelRef(),
|
|
116
103
|
configuredProviderIds: collectConfiguredProviderIds(appConfig),
|
|
117
104
|
configuredChannelIds: collectConfiguredChannelIds(appConfig),
|
|
118
105
|
env: process.env
|