@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
|
@@ -2,11 +2,13 @@ import { init_paths_state, resolveStateDir } from "../../config/paths-state.js";
|
|
|
2
2
|
import { createLogger } from "../../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../../utils/logger.js";
|
|
4
4
|
import { init_string_coerce, normalizeOptionalString } from "../../utils/string-coerce.js";
|
|
5
|
+
import { McpOAuthStore } from "./oauth/mcp-oauth-store.js";
|
|
6
|
+
import { pluginOAuthScope } from "../../extensions/agent-plugins/auth.js";
|
|
5
7
|
import { buildRuntimeEnvironment, resolveRuntimeCommand } from "../../runtime-tools/environment.js";
|
|
6
8
|
import { XopcStdioClientTransport } from "./mcp-stdio-transport.js";
|
|
7
9
|
import { resolveMcpTransportConfig } from "./mcp-transport-config.js";
|
|
8
|
-
import { McpOAuthStore } from "./oauth/mcp-oauth-store.js";
|
|
9
10
|
import { XopcMcpOAuthClientProvider } from "./oauth/mcp-oauth-provider.js";
|
|
11
|
+
import { createPluginHttpFetch } from "./plugin-http-fetch.js";
|
|
10
12
|
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
11
13
|
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
12
14
|
import { getDefaultEnvironment } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
@@ -64,6 +66,7 @@ function buildScopedHttpFetch(serverUrl, headers) {
|
|
|
64
66
|
async function resolveMcpTransport(serverName, rawServer, config, options = {}) {
|
|
65
67
|
const resolved = resolveMcpTransportConfig(serverName, rawServer);
|
|
66
68
|
if (!resolved) return null;
|
|
69
|
+
const plugin = rawServer && typeof rawServer === "object" ? rawServer.xopcPlugin : void 0;
|
|
67
70
|
if (resolved.kind === "stdio") {
|
|
68
71
|
const command = config ? await resolveRuntimeCommand({
|
|
69
72
|
command: resolved.command,
|
|
@@ -84,7 +87,8 @@ async function resolveMcpTransport(serverName, rawServer, config, options = {})
|
|
|
84
87
|
args: resolved.args,
|
|
85
88
|
env,
|
|
86
89
|
cwd: resolved.cwd,
|
|
87
|
-
stderr: "pipe"
|
|
90
|
+
stderr: "pipe",
|
|
91
|
+
pluginDataDir: plugin?.dataDir
|
|
88
92
|
});
|
|
89
93
|
return {
|
|
90
94
|
transport,
|
|
@@ -100,7 +104,7 @@ async function resolveMcpTransport(serverName, rawServer, config, options = {})
|
|
|
100
104
|
const oauthEnabled = Boolean(resolved.auth);
|
|
101
105
|
let oauthProvider = options.oauthProvider;
|
|
102
106
|
if (resolved.auth && !oauthProvider) {
|
|
103
|
-
const store = options.oauthStore ?? new McpOAuthStore();
|
|
107
|
+
const store = options.oauthStore ?? new McpOAuthStore(pluginOAuthScope(rawServer));
|
|
104
108
|
if ((await store.load(serverUrl))?.tokens) oauthProvider = new XopcMcpOAuthClientProvider({
|
|
105
109
|
serverUrl,
|
|
106
110
|
clientId: resolved.auth.clientId,
|
|
@@ -110,8 +114,8 @@ async function resolveMcpTransport(serverName, rawServer, config, options = {})
|
|
|
110
114
|
return {
|
|
111
115
|
transport: new StreamableHTTPClientTransport(serverUrl, {
|
|
112
116
|
authProvider: oauthProvider,
|
|
113
|
-
requestInit: !oauthEnabled && resolved.headers ? { headers: resolved.headers } : void 0,
|
|
114
|
-
fetch: oauthEnabled ? buildScopedHttpFetch(serverUrl, resolved.headers ?? {}) : fetchWithUndici
|
|
117
|
+
requestInit: !plugin && !oauthEnabled && resolved.headers ? { headers: resolved.headers } : void 0,
|
|
118
|
+
fetch: plugin ? createPluginHttpFetch(serverUrl, resolved.headers ?? {}) : oauthEnabled ? buildScopedHttpFetch(serverUrl, resolved.headers ?? {}) : fetchWithUndici
|
|
115
119
|
}),
|
|
116
120
|
description: resolved.description,
|
|
117
121
|
transportType: "streamable-http",
|
|
@@ -123,9 +127,9 @@ async function resolveMcpTransport(serverName, rawServer, config, options = {})
|
|
|
123
127
|
const hasHeaders = Object.keys(headers).length > 0;
|
|
124
128
|
return {
|
|
125
129
|
transport: new SSEClientTransport(new URL(resolved.url), {
|
|
126
|
-
requestInit: hasHeaders ? { headers } : void 0,
|
|
127
|
-
fetch: fetchWithUndici,
|
|
128
|
-
eventSourceInit: { fetch: buildSseEventSourceFetch(headers) }
|
|
130
|
+
requestInit: !plugin && hasHeaders ? { headers } : void 0,
|
|
131
|
+
fetch: plugin ? createPluginHttpFetch(new URL(resolved.url), headers) : fetchWithUndici,
|
|
132
|
+
eventSourceInit: { fetch: plugin ? createPluginHttpFetch(new URL(resolved.url), headers) : buildSseEventSourceFetch(headers) }
|
|
129
133
|
}),
|
|
130
134
|
description: resolved.description,
|
|
131
135
|
transportType: "sse",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { McpAuthorizationRequiredError, isMcpAuthorizationError } from "./mcp-oauth-errors.js";
|
|
2
1
|
import { McpOAuthStore, canonicalMcpServerUrl, mcpOAuthServerKey } from "./mcp-oauth-store.js";
|
|
2
|
+
import { McpAuthorizationRequiredError, isMcpAuthorizationError } from "./mcp-oauth-errors.js";
|
|
3
3
|
import { XopcMcpOAuthClientProvider } from "./mcp-oauth-provider.js";
|
|
4
4
|
import { McpOAuthSession } from "./mcp-oauth-session.js";
|
|
5
5
|
import { McpOAuthManager, getMcpOAuthManager } from "./mcp-oauth-manager.js";
|
|
@@ -15,11 +15,16 @@ type StartMcpOAuthParams = {
|
|
|
15
15
|
export declare class McpOAuthManager {
|
|
16
16
|
private readonly store;
|
|
17
17
|
private readonly sessionsByServerUrl;
|
|
18
|
+
private readonly pending;
|
|
19
|
+
private cancelling;
|
|
18
20
|
constructor(store?: McpOAuthStore);
|
|
19
21
|
status(serverId: string, rawServer: unknown): Promise<McpOAuthStatus>;
|
|
20
22
|
start(params: StartMcpOAuthParams): Promise<McpOAuthStatus>;
|
|
23
|
+
cancelPending(): Promise<void>;
|
|
24
|
+
private startSession;
|
|
21
25
|
disconnect(serverId: string, rawServer: unknown): Promise<McpOAuthStatus>;
|
|
26
|
+
submitCallback(serverId: string, rawServer: unknown, callbackUrl: string): Promise<McpOAuthStatus>;
|
|
22
27
|
private finishAuthorization;
|
|
23
28
|
}
|
|
24
|
-
export declare function getMcpOAuthManager(): McpOAuthManager;
|
|
29
|
+
export declare function getMcpOAuthManager(rawServer?: unknown): McpOAuthManager;
|
|
25
30
|
export {};
|
|
@@ -2,10 +2,12 @@ import { createLogger } from "../../../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../../../utils/logger.js";
|
|
3
3
|
import { init_global_singleton, resolveGlobalSingleton } from "../../../utils/global-singleton.js";
|
|
4
4
|
import { resolveConnectorSecretReferences } from "../../../connectors/secret-store.js";
|
|
5
|
+
import { recordPluginMcpHealth } from "../../../extensions/agent-plugins/health.js";
|
|
5
6
|
import { redactSensitiveUrlLikeString } from "../../../utils/redact-sensitive-url.js";
|
|
7
|
+
import { McpOAuthStore, canonicalMcpServerUrl } from "./mcp-oauth-store.js";
|
|
8
|
+
import { pluginOAuthScope } from "../../../extensions/agent-plugins/auth.js";
|
|
6
9
|
import { resolveMcpTransportConfig } from "../mcp-transport-config.js";
|
|
7
10
|
import { isMcpAuthorizationError } from "./mcp-oauth-errors.js";
|
|
8
|
-
import { McpOAuthStore, canonicalMcpServerUrl } from "./mcp-oauth-store.js";
|
|
9
11
|
import { XopcMcpOAuthClientProvider } from "./mcp-oauth-provider.js";
|
|
10
12
|
import { resolveMcpTransport } from "../mcp-transport.js";
|
|
11
13
|
import { disposeAllSessionMcpRuntimes } from "../bundle-mcp-runtime.js";
|
|
@@ -49,6 +51,8 @@ function isAuthorizing(snapshot) {
|
|
|
49
51
|
var McpOAuthManager = class {
|
|
50
52
|
store;
|
|
51
53
|
sessionsByServerUrl = /* @__PURE__ */ new Map();
|
|
54
|
+
pending = /* @__PURE__ */ new Set();
|
|
55
|
+
cancelling = false;
|
|
52
56
|
constructor(store = new McpOAuthStore()) {
|
|
53
57
|
this.store = store;
|
|
54
58
|
}
|
|
@@ -83,7 +87,28 @@ var McpOAuthManager = class {
|
|
|
83
87
|
};
|
|
84
88
|
}
|
|
85
89
|
async start(params) {
|
|
90
|
+
if (this.cancelling) throw new Error("OAuth connections are being cleared");
|
|
91
|
+
const task = this.startSession(params);
|
|
92
|
+
this.pending.add(task);
|
|
93
|
+
try {
|
|
94
|
+
return await task;
|
|
95
|
+
} finally {
|
|
96
|
+
this.pending.delete(task);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
async cancelPending() {
|
|
100
|
+
this.cancelling = true;
|
|
101
|
+
try {
|
|
102
|
+
await Promise.all([...this.sessionsByServerUrl.values()].map((session) => session.close()));
|
|
103
|
+
await Promise.allSettled([...this.pending]);
|
|
104
|
+
this.sessionsByServerUrl.clear();
|
|
105
|
+
} finally {
|
|
106
|
+
this.cancelling = false;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
async startSession(params) {
|
|
86
110
|
const rawServer = await resolveConnectorSecretReferences(params.rawServer);
|
|
111
|
+
if (this.cancelling) throw new Error("OAuth connections are being cleared");
|
|
87
112
|
const resolvedConfig = resolveMcpTransportConfig(params.serverId, rawServer);
|
|
88
113
|
if (!resolvedConfig || resolvedConfig.kind !== "http" || !resolvedConfig.auth) throw new Error(`MCP server "${params.serverId}" is not configured for OAuth`);
|
|
89
114
|
const serverUrl = new URL(resolvedConfig.url);
|
|
@@ -139,23 +164,39 @@ var McpOAuthManager = class {
|
|
|
139
164
|
const client = createClient();
|
|
140
165
|
try {
|
|
141
166
|
await connectClient(client, resolved);
|
|
167
|
+
if (session.snapshot().status === "cancelled") {
|
|
168
|
+
await this.store.delete(serverUrl);
|
|
169
|
+
await closeConnection(client, resolved);
|
|
170
|
+
return {
|
|
171
|
+
configured: true,
|
|
172
|
+
status: "disconnected"
|
|
173
|
+
};
|
|
174
|
+
}
|
|
142
175
|
session.complete();
|
|
176
|
+
recordPluginMcpHealth(rawServer, "ready");
|
|
143
177
|
await closeConnection(client, resolved);
|
|
144
178
|
await disposeAllSessionMcpRuntimes();
|
|
145
179
|
} catch (error) {
|
|
146
|
-
if (
|
|
180
|
+
if (session.snapshot().status === "cancelled") {
|
|
181
|
+
await this.store.delete(serverUrl);
|
|
182
|
+
await closeConnection(client, resolved);
|
|
183
|
+
} else if (!isMcpAuthorizationError(error) || !session.snapshot().authorizationUrl) {
|
|
147
184
|
session.fail(error);
|
|
148
185
|
await closeConnection(client, resolved);
|
|
149
|
-
} else
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
186
|
+
} else {
|
|
187
|
+
const task = this.finishAuthorization({
|
|
188
|
+
session,
|
|
189
|
+
provider,
|
|
190
|
+
client,
|
|
191
|
+
resolved,
|
|
192
|
+
params: {
|
|
193
|
+
...params,
|
|
194
|
+
rawServer
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
this.pending.add(task);
|
|
198
|
+
task.finally(() => this.pending.delete(task));
|
|
199
|
+
}
|
|
159
200
|
}
|
|
160
201
|
return this.status(params.serverId, params.rawServer);
|
|
161
202
|
}
|
|
@@ -167,12 +208,21 @@ var McpOAuthManager = class {
|
|
|
167
208
|
this.sessionsByServerUrl.delete(conversationId);
|
|
168
209
|
if (session) await session.close();
|
|
169
210
|
await this.store.delete(resolved.url);
|
|
211
|
+
recordPluginMcpHealth(rawServer, "authorization_required");
|
|
170
212
|
await disposeAllSessionMcpRuntimes();
|
|
171
213
|
return {
|
|
172
214
|
configured: true,
|
|
173
215
|
status: "disconnected"
|
|
174
216
|
};
|
|
175
217
|
}
|
|
218
|
+
async submitCallback(serverId, rawServer, callbackUrl) {
|
|
219
|
+
const resolved = resolveMcpTransportConfig(serverId, rawServer);
|
|
220
|
+
if (!resolved || resolved.kind !== "http") throw new Error("Unknown OAuth server");
|
|
221
|
+
const session = this.sessionsByServerUrl.get(canonicalMcpServerUrl(resolved.url));
|
|
222
|
+
if (!session) throw new Error("OAuth session not found");
|
|
223
|
+
session.submitCallback(callbackUrl);
|
|
224
|
+
return this.status(serverId, rawServer);
|
|
225
|
+
}
|
|
176
226
|
async finishAuthorization(context) {
|
|
177
227
|
const { session, provider, client, resolved, params } = context;
|
|
178
228
|
try {
|
|
@@ -195,7 +245,12 @@ var McpOAuthManager = class {
|
|
|
195
245
|
} finally {
|
|
196
246
|
await closeConnection(authenticatedClient, authenticated);
|
|
197
247
|
}
|
|
248
|
+
if (session.snapshot().status === "cancelled") {
|
|
249
|
+
await this.store.delete(session.serverUrl);
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
198
252
|
session.complete();
|
|
253
|
+
recordPluginMcpHealth(params.rawServer, "ready");
|
|
199
254
|
await disposeAllSessionMcpRuntimes();
|
|
200
255
|
} catch (error) {
|
|
201
256
|
if (session.snapshot().status === "cancelled") {
|
|
@@ -213,8 +268,9 @@ var McpOAuthManager = class {
|
|
|
213
268
|
}
|
|
214
269
|
}
|
|
215
270
|
};
|
|
216
|
-
function getMcpOAuthManager() {
|
|
217
|
-
|
|
271
|
+
function getMcpOAuthManager(rawServer) {
|
|
272
|
+
const scope = pluginOAuthScope(rawServer);
|
|
273
|
+
return resolveGlobalSingleton(scope ? Symbol.for(`xopc.mcpOAuthManager:${scope}`) : MCP_OAUTH_MANAGER_KEY, () => new McpOAuthManager(new McpOAuthStore(scope)));
|
|
218
274
|
}
|
|
219
275
|
//#endregion
|
|
220
276
|
export { McpOAuthManager, getMcpOAuthManager };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { McpAuthorizationRequiredError } from "./mcp-oauth-errors.js";
|
|
2
1
|
import { McpOAuthStore } from "./mcp-oauth-store.js";
|
|
2
|
+
import { McpAuthorizationRequiredError } from "./mcp-oauth-errors.js";
|
|
3
3
|
//#region src/agent/mcp/oauth/mcp-oauth-provider.ts
|
|
4
4
|
var XopcMcpOAuthClientProvider = class {
|
|
5
5
|
store;
|
|
@@ -19,6 +19,8 @@ export declare class McpOAuthSession {
|
|
|
19
19
|
get redirectUrl(): URL;
|
|
20
20
|
start(): Promise<void>;
|
|
21
21
|
setAuthorizationUrl(url: URL): void;
|
|
22
|
+
/** Remote Gateway users can submit the browser's loopback callback URL over the authenticated API. */
|
|
23
|
+
submitCallback(url: string): void;
|
|
22
24
|
waitForCode(): Promise<string>;
|
|
23
25
|
complete(): void;
|
|
24
26
|
fail(error: unknown): void;
|
|
@@ -110,6 +110,18 @@ var McpOAuthSession = class {
|
|
|
110
110
|
this.authorizationUrlValue = url.toString();
|
|
111
111
|
this.statusValue = "waiting_browser";
|
|
112
112
|
}
|
|
113
|
+
/** Remote Gateway users can submit the browser's loopback callback URL over the authenticated API. */
|
|
114
|
+
submitCallback(url) {
|
|
115
|
+
const callback = new URL(url);
|
|
116
|
+
if (callback.origin !== this.redirectUrl.origin || callback.pathname !== CALLBACK_PATH || callback.searchParams.get("state") !== this.state) throw new Error("MCP OAuth callback mismatch");
|
|
117
|
+
if (this.statusValue !== "waiting_browser" || this.callbackConsumed || Date.now() >= this.expiresAt) throw new Error("MCP OAuth session is not waiting for a callback");
|
|
118
|
+
const code = callback.searchParams.get("code");
|
|
119
|
+
if (!code || callback.searchParams.has("error")) throw new Error("MCP OAuth authorization code is missing or denied");
|
|
120
|
+
this.callbackConsumed = true;
|
|
121
|
+
this.statusValue = "exchanging_code";
|
|
122
|
+
this.settleCode?.({ code });
|
|
123
|
+
this.settleCode = void 0;
|
|
124
|
+
}
|
|
113
125
|
async waitForCode() {
|
|
114
126
|
const result = await this.codePromise;
|
|
115
127
|
if (result.error) throw result.error;
|
|
@@ -2,7 +2,10 @@ import type { McpOAuthRecord } from './mcp-oauth-types.js';
|
|
|
2
2
|
export declare function canonicalMcpServerUrl(input: string | URL): string;
|
|
3
3
|
export declare function mcpOAuthServerKey(input: string | URL): string;
|
|
4
4
|
export declare class McpOAuthStore {
|
|
5
|
+
private readonly identityScope?;
|
|
6
|
+
constructor(identityScope?: string);
|
|
5
7
|
pathFor(serverUrl: string | URL): string;
|
|
8
|
+
deleteScope(): Promise<void>;
|
|
6
9
|
load(serverUrlInput: string | URL): Promise<McpOAuthRecord | undefined>;
|
|
7
10
|
update(serverUrlInput: string | URL, update: (current: McpOAuthRecord | undefined) => McpOAuthRecord | undefined): Promise<McpOAuthRecord | undefined>;
|
|
8
11
|
delete(serverUrl: string | URL): Promise<void>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { init_paths, resolveMcpOAuthPath } from "../../../config/paths.js";
|
|
2
2
|
import { init_write_file_atomic, writeTextAtomic } from "../../../infra/write-file-atomic.js";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
3
4
|
import { createHash } from "node:crypto";
|
|
4
5
|
import { readFile, rm } from "node:fs/promises";
|
|
5
6
|
//#region src/agent/mcp/oauth/mcp-oauth-store.ts
|
|
@@ -41,8 +42,19 @@ async function serializeWrite(key, operation) {
|
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
var McpOAuthStore = class {
|
|
45
|
+
constructor(identityScope) {
|
|
46
|
+
this.identityScope = identityScope;
|
|
47
|
+
}
|
|
44
48
|
pathFor(serverUrl) {
|
|
45
|
-
|
|
49
|
+
const endpoint = mcpOAuthServerKey(serverUrl);
|
|
50
|
+
return this.identityScope ? join(dirname(resolveMcpOAuthPath(endpoint)), createHash("sha256").update(this.identityScope).digest("hex"), `${endpoint}.json`) : resolveMcpOAuthPath(endpoint);
|
|
51
|
+
}
|
|
52
|
+
async deleteScope() {
|
|
53
|
+
if (!this.identityScope) throw new Error("Cannot remove unscoped MCP credentials");
|
|
54
|
+
await rm(dirname(this.pathFor("https://scope.invalid")), {
|
|
55
|
+
recursive: true,
|
|
56
|
+
force: true
|
|
57
|
+
});
|
|
46
58
|
}
|
|
47
59
|
async load(serverUrlInput) {
|
|
48
60
|
const serverUrl = canonicalMcpServerUrl(serverUrlInput);
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { BlockList, isIP } from "node:net";
|
|
2
|
+
import { Agent, fetch } from "undici";
|
|
3
|
+
import { lookup } from "node:dns";
|
|
4
|
+
//#region src/agent/mcp/plugin-http-fetch.ts
|
|
5
|
+
const blocked = new BlockList();
|
|
6
|
+
for (const [network, prefix] of [
|
|
7
|
+
["0.0.0.0", 8],
|
|
8
|
+
["10.0.0.0", 8],
|
|
9
|
+
["100.64.0.0", 10],
|
|
10
|
+
["127.0.0.0", 8],
|
|
11
|
+
["169.254.0.0", 16],
|
|
12
|
+
["172.16.0.0", 12],
|
|
13
|
+
["192.168.0.0", 16],
|
|
14
|
+
["224.0.0.0", 4],
|
|
15
|
+
["240.0.0.0", 4]
|
|
16
|
+
]) blocked.addSubnet(network, prefix);
|
|
17
|
+
for (const [network, prefix] of [
|
|
18
|
+
["::", 128],
|
|
19
|
+
["::1", 128],
|
|
20
|
+
["fc00::", 7],
|
|
21
|
+
["fe80::", 10],
|
|
22
|
+
["ff00::", 8]
|
|
23
|
+
]) blocked.addSubnet(network, prefix, "ipv6");
|
|
24
|
+
const isBlocked = (address) => blocked.check(address, isIP(address) === 6 ? "ipv6" : "ipv4");
|
|
25
|
+
const loopback = (host) => host === "localhost" || host === "[::1]" || /^127(?:\.\d{1,3}){3}$/.test(host);
|
|
26
|
+
const publicDispatcher = new Agent({ connect: { lookup(host, options, callback) {
|
|
27
|
+
lookup(host, {
|
|
28
|
+
...options,
|
|
29
|
+
all: true
|
|
30
|
+
}, (error, addresses) => {
|
|
31
|
+
if (error) return callback(error, []);
|
|
32
|
+
if (!addresses.length || addresses.some((entry) => isBlocked(entry.address))) return callback(/* @__PURE__ */ new Error("Plugin MCP cannot access private network addresses"), []);
|
|
33
|
+
if (options.all) callback(null, addresses);
|
|
34
|
+
else callback(null, addresses[0].address, addresses[0].family);
|
|
35
|
+
});
|
|
36
|
+
} } });
|
|
37
|
+
function createPluginHttpFetch(endpoint, configuredHeaders) {
|
|
38
|
+
return async (input, init) => {
|
|
39
|
+
const url = new URL(input);
|
|
40
|
+
if (!["https:", "http:"].includes(url.protocol) || url.username || url.password || url.hash) throw new Error("Invalid plugin MCP request URL");
|
|
41
|
+
const local = loopback(endpoint.hostname) && url.origin === endpoint.origin;
|
|
42
|
+
if (!local && url.protocol !== "https:") throw new Error("Plugin MCP requires HTTPS");
|
|
43
|
+
const address = url.hostname.replace(/^\[|\]$/g, "");
|
|
44
|
+
if (!local && isIP(address) && isBlocked(address)) throw new Error("Plugin MCP cannot access private network addresses");
|
|
45
|
+
const headers = new Headers(url.origin === endpoint.origin ? configuredHeaders : void 0);
|
|
46
|
+
new Headers(init?.headers).forEach((value, key) => headers.set(key, value));
|
|
47
|
+
return await fetch(url, {
|
|
48
|
+
...init,
|
|
49
|
+
headers,
|
|
50
|
+
redirect: "error",
|
|
51
|
+
...local ? {} : { dispatcher: publicDispatcher }
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { createPluginHttpFetch };
|
|
@@ -90,7 +90,7 @@ export declare function throwCapabilityGenerationFailure(params: ThrowCapability
|
|
|
90
90
|
export interface BuildNoCapabilityModelConfiguredMessageParams {
|
|
91
91
|
/** Display label, e.g. "image-generation". */
|
|
92
92
|
capabilityLabel: string;
|
|
93
|
-
/**
|
|
93
|
+
/** Agent model capability key, e.g. "imageGeneration". */
|
|
94
94
|
modelConfigKey: string;
|
|
95
95
|
providers: ReadonlyArray<CapabilityProviderCandidate>;
|
|
96
96
|
/** Optional env-var lookup, e.g. (id) => PROVIDER_ENV_MAP[id]. */
|
|
@@ -190,7 +190,7 @@ function throwCapabilityGenerationFailure(params) {
|
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
192
|
function buildNoCapabilityModelConfiguredMessage(params) {
|
|
193
|
-
const lines = [`No ${params.capabilityLabel} model configured.
|
|
193
|
+
const lines = [`No ${params.capabilityLabel} model configured. Configure ${params.modelConfigKey} in global Agent defaults or pass modelOverride at call site.`];
|
|
194
194
|
if (params.providers.length > 0) {
|
|
195
195
|
lines.push("Registered providers:");
|
|
196
196
|
for (const p of params.providers) {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { discoverExtensionsFromDisk
|
|
1
|
+
import { discoverExtensionsFromDisk } from "../../extensions/discover-extensions.js";
|
|
2
2
|
import { isAbsolute, join } from "node:path";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
4
|
import { stat } from "node:fs/promises";
|
|
5
5
|
//#region src/agent/memory/plugin-discovery.ts
|
|
6
|
-
init_discover_extensions();
|
|
7
6
|
async function discoverMemoryPlugins(config) {
|
|
8
7
|
const plugins = [];
|
|
9
8
|
for (const extension of discoverMemoryProviderExtensions(config)) for (const providerId of extension.manifest.contracts?.memoryProviders ?? []) plugins.push({
|
|
@@ -19,7 +19,7 @@ export declare class ModelManager {
|
|
|
19
19
|
private currentProvider;
|
|
20
20
|
private sessionModels;
|
|
21
21
|
private fixedSessionModels;
|
|
22
|
-
/** Baseline model from
|
|
22
|
+
/** Baseline model from the Agent catalog/defaults merge when the session Agent is created. */
|
|
23
23
|
private sessionProfileDefaults;
|
|
24
24
|
private sessionProfileFallbacks;
|
|
25
25
|
constructor(config?: ModelManagerConfig);
|
|
@@ -16,7 +16,7 @@ var ModelManager = class {
|
|
|
16
16
|
currentProvider;
|
|
17
17
|
sessionModels = /* @__PURE__ */ new Map();
|
|
18
18
|
fixedSessionModels = /* @__PURE__ */ new Set();
|
|
19
|
-
/** Baseline model from
|
|
19
|
+
/** Baseline model from the Agent catalog/defaults merge when the session Agent is created. */
|
|
20
20
|
sessionProfileDefaults = /* @__PURE__ */ new Map();
|
|
21
21
|
sessionProfileFallbacks = /* @__PURE__ */ new Map();
|
|
22
22
|
constructor(config = {}) {
|
|
@@ -30,7 +30,7 @@ var ModelManager = class {
|
|
|
30
30
|
*/
|
|
31
31
|
updateFromConfig(config) {
|
|
32
32
|
this.config = config;
|
|
33
|
-
const ref = getAgentDefaultModelRef(
|
|
33
|
+
const ref = getAgentDefaultModelRef();
|
|
34
34
|
this.defaultModel = ref ? ref : getDefaultModelSync(config);
|
|
35
35
|
this.sessionProfileDefaults.clear();
|
|
36
36
|
this.sessionProfileFallbacks.clear();
|
|
@@ -20,7 +20,7 @@ function isAgentTurnUnsettledError(err) {
|
|
|
20
20
|
}
|
|
21
21
|
function resolveAgentTurnTimeoutMs(config, conversationId) {
|
|
22
22
|
if (!config) return DEFAULT_AGENT_TURN_TIMEOUT_MS;
|
|
23
|
-
const configured = resolveEffectiveAgentConfigForSession(
|
|
23
|
+
const configured = resolveEffectiveAgentConfigForSession(conversationId).config.runtime.timeoutMs;
|
|
24
24
|
if (!configured) return DEFAULT_AGENT_TURN_TIMEOUT_MS;
|
|
25
25
|
return Math.min(MAX_AGENT_TURN_TIMEOUT_MS, Math.max(MIN_AGENT_TURN_TIMEOUT_MS, configured));
|
|
26
26
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { isXopcDatabaseOpen } from "../../storage/sqlite/connection.js";
|
|
2
2
|
import { getSessionConfig } from "../../storage/sqlite/config-repository.js";
|
|
3
|
-
import "../../storage/sqlite/index.js";
|
|
3
|
+
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
4
4
|
import { init_response_language, resolveResponseLanguage } from "../../i18n/response-language.js";
|
|
5
5
|
//#region src/agent/prompt/response-language.ts
|
|
6
6
|
init_response_language();
|
|
7
|
+
init_sqlite();
|
|
7
8
|
function resolveResponseLanguageForSession(config, conversationId) {
|
|
8
9
|
return resolveResponseLanguage(config?.userContext?.preferences?.responseLanguage ?? "auto", conversationId && isXopcDatabaseOpen() ? getSessionConfig(conversationId)?.responseLanguage : void 0);
|
|
9
10
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { isXopcDatabaseOpen } from "../../storage/sqlite/connection.js";
|
|
4
|
-
import { buildInteractionStatePrompt } from "../../user-context/interaction-state.js";
|
|
4
|
+
import { buildInteractionStatePrompt, init_interaction_state } from "../../user-context/interaction-state.js";
|
|
5
5
|
import { getInteractionState } from "../../storage/sqlite/interaction-state-repository.js";
|
|
6
|
-
import { DEFAULT_USER_TRUST_LEVEL } from "../../user-context/trust-policy.js";
|
|
6
|
+
import { DEFAULT_USER_TRUST_LEVEL, init_trust_policy } from "../../user-context/trust-policy.js";
|
|
7
7
|
import { getUserTrustPolicy } from "../../storage/sqlite/user-trust-repository.js";
|
|
8
|
-
import "../../storage/sqlite/index.js";
|
|
8
|
+
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
9
9
|
import { appendStablePromptSection } from "./cache-boundary.js";
|
|
10
10
|
import { getUserTimezone } from "../../user-model/repository.js";
|
|
11
11
|
import "../../user-model/index.js";
|
|
@@ -15,6 +15,9 @@ import { resolveResponseLanguageForSession } from "./response-language.js";
|
|
|
15
15
|
import { buildTtsSystemPromptHint } from "../../voice/tts/directives.js";
|
|
16
16
|
import { mergeTtsConfigFromAppConfig } from "../../voice/tts/merge-config.js";
|
|
17
17
|
//#region src/agent/prompt/service-prompt-builder.ts
|
|
18
|
+
init_sqlite();
|
|
19
|
+
init_interaction_state();
|
|
20
|
+
init_trust_policy();
|
|
18
21
|
init_logger();
|
|
19
22
|
const log = createLogger("SystemPromptBuilder");
|
|
20
23
|
var SystemPromptBuilder = class {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { buildActionTrustPrompt } from "../../user-context/trust-policy.js";
|
|
1
|
+
import { buildActionTrustPrompt, init_trust_policy } from "../../user-context/trust-policy.js";
|
|
2
2
|
import { PROMPT_CACHE_BOUNDARY, splitPromptCacheBoundary } from "./cache-boundary.js";
|
|
3
3
|
import { buildAestheticSection, buildExecutionBiasSection, buildHumanCollaborationSection, buildProblemSolvingSection, buildSafetySection, buildToolCallStyleSection, buildWorkContinuitySection } from "./sections/behavior.js";
|
|
4
4
|
import { buildExternalMemorySection, buildMemorySection, buildSkillsSection } from "./sections/memory-skills.js";
|
|
@@ -9,6 +9,7 @@ import { buildRuntimeSection, buildWorkspaceFilesIntroSection, buildWorkspaceSec
|
|
|
9
9
|
import { buildResponseLanguageSection } from "./sections/response-language.js";
|
|
10
10
|
import { buildOverridablePromptSection } from "./system-prompt-params.js";
|
|
11
11
|
//#region src/agent/prompt/system-prompt.ts
|
|
12
|
+
init_trust_policy();
|
|
12
13
|
function joinSections(sections) {
|
|
13
14
|
return sections.filter((section) => Boolean(section?.trim())).join("\n\n");
|
|
14
15
|
}
|
|
@@ -73,12 +73,12 @@ function readPostCompactionContext(params) {
|
|
|
73
73
|
if (!cfg) return null;
|
|
74
74
|
let agentId = params.agentId;
|
|
75
75
|
if (!agentId && params.conversationId) try {
|
|
76
|
-
agentId = resolveEffectiveAgentProfileForSession(
|
|
76
|
+
agentId = resolveEffectiveAgentProfileForSession(params.conversationId).agentId;
|
|
77
77
|
} catch {
|
|
78
78
|
return null;
|
|
79
79
|
}
|
|
80
80
|
if (!agentId) return null;
|
|
81
|
-
const resolved = resolve(join(resolveAgentProfileDir(
|
|
81
|
+
const resolved = resolve(join(resolveAgentProfileDir(agentId), "AGENTS.md"));
|
|
82
82
|
try {
|
|
83
83
|
return readPostCompactionContextFromAgentsMd(readFileSync(resolved, "utf-8"), {
|
|
84
84
|
cfg,
|
|
@@ -6,7 +6,7 @@ init_schema();
|
|
|
6
6
|
init_providers();
|
|
7
7
|
async function buildDirectUserMessageContent(opts) {
|
|
8
8
|
const sk = opts.conversationId ?? "";
|
|
9
|
-
const modelRef = sk !== "" ? opts.modelManager.getModelForSession(sk) : getAgentDefaultModelRef(
|
|
9
|
+
const modelRef = sk !== "" ? opts.modelManager.getModelForSession(sk) : getAgentDefaultModelRef() ?? getDefaultModelSync(opts.config);
|
|
10
10
|
return buildTranscriptUserMessage({
|
|
11
11
|
text: opts.content,
|
|
12
12
|
prepared: opts.attachments,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getClarificationResumeInput } from "../../storage/sqlite/clarification-wait-repository.js";
|
|
1
|
+
import { getClarificationResumeInput, init_clarification_wait_repository } from "../../storage/sqlite/clarification-wait-repository.js";
|
|
2
2
|
import { getConnectionResumeInput, init_connection_wait_repository } from "../../storage/sqlite/connection-wait-repository.js";
|
|
3
3
|
import { resolveImageHandlingStrategy } from "../image/vision-detection.js";
|
|
4
4
|
import { hydrateUserTurnForLlm } from "../inbound/attachment-pipeline.js";
|
|
@@ -21,6 +21,7 @@ import crypto from "node:crypto";
|
|
|
21
21
|
* TTS, transcript persistence).
|
|
22
22
|
*/
|
|
23
23
|
init_connection_wait_repository();
|
|
24
|
+
init_clarification_wait_repository();
|
|
24
25
|
/** Workspace + model + thinking level — common prep before any direct turn. */
|
|
25
26
|
async function hydratePerTurnState(deps, conversationId, thinking) {
|
|
26
27
|
await deps.hydrateSessionWorkspaceFromStore(conversationId);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
2
|
-
import "../../storage/sqlite/index.js";
|
|
2
|
+
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
3
3
|
import { INTERNAL_OUTBOUND_DROP_CHANNEL } from "../../channels/internal-outbound.js";
|
|
4
4
|
//#region src/agent/service/parse-outbound-session-key.ts
|
|
5
|
+
init_sqlite();
|
|
5
6
|
/**
|
|
6
7
|
* Map a session key to outbound channel routing (heartbeat/cron/virtual keys included).
|
|
7
8
|
*/
|