@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
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { init_paths_state, resolveStateDir } from "../../config/paths-state.js";
|
|
2
|
+
import { createLogger } from "../../utils/logger/index.js";
|
|
3
|
+
import { init_logger } from "../../utils/logger.js";
|
|
4
|
+
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
5
|
+
import { computeExtensionDirectoryIntegrity } from "../lockfile.js";
|
|
6
|
+
import { containedPath, inspectAgentPlugin, pluginName } from "./validation.js";
|
|
7
|
+
import { readPluginMcpHealth } from "./health.js";
|
|
8
|
+
import { tmpdir } from "node:os";
|
|
9
|
+
import { dirname, join, resolve } from "node:path";
|
|
10
|
+
import { cpSync, existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
11
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
import AdmZip from "adm-zip";
|
|
14
|
+
import lockfile from "proper-lockfile";
|
|
15
|
+
//#region src/extensions/agent-plugins/store.ts
|
|
16
|
+
init_paths_state();
|
|
17
|
+
init_write_file_atomic();
|
|
18
|
+
init_logger();
|
|
19
|
+
const receiptFields = z.object({
|
|
20
|
+
id: pluginName,
|
|
21
|
+
revision: z.string().uuid(),
|
|
22
|
+
source: z.string(),
|
|
23
|
+
installedAt: z.string(),
|
|
24
|
+
enabled: z.boolean(),
|
|
25
|
+
integrity: z.string(),
|
|
26
|
+
capabilities: z.array(z.string())
|
|
27
|
+
});
|
|
28
|
+
const receiptSchema = receiptFields.extend({ previous: receiptFields.optional() });
|
|
29
|
+
const log = createLogger("AgentPlugins");
|
|
30
|
+
var AgentPluginStore = class {
|
|
31
|
+
constructor(stateDir = resolveStateDir()) {
|
|
32
|
+
this.stateDir = stateDir;
|
|
33
|
+
}
|
|
34
|
+
receiptsDir() {
|
|
35
|
+
return join(this.stateDir, "plugin-receipts");
|
|
36
|
+
}
|
|
37
|
+
revisionKey() {
|
|
38
|
+
if (!existsSync(this.receiptsDir())) return "";
|
|
39
|
+
return readdirSync(this.receiptsDir()).filter((name) => name.endsWith(".json")).sort().map((name) => {
|
|
40
|
+
try {
|
|
41
|
+
return `${name}:${statSync(join(this.receiptsDir(), name)).mtimeMs}`;
|
|
42
|
+
} catch {
|
|
43
|
+
return "";
|
|
44
|
+
}
|
|
45
|
+
}).join("|");
|
|
46
|
+
}
|
|
47
|
+
dataDir(id) {
|
|
48
|
+
return containedPath(this.stateDir, join(this.stateDir, "plugin-data", pluginName.parse(id)));
|
|
49
|
+
}
|
|
50
|
+
revisionDir(id, revision) {
|
|
51
|
+
return join(this.stateDir, "plugins", pluginName.parse(id), z.string().uuid().parse(revision));
|
|
52
|
+
}
|
|
53
|
+
receiptPath(id) {
|
|
54
|
+
return join(this.receiptsDir(), `${pluginName.parse(id)}.json`);
|
|
55
|
+
}
|
|
56
|
+
receipt(id) {
|
|
57
|
+
const path = this.receiptPath(id);
|
|
58
|
+
if (!existsSync(path)) return void 0;
|
|
59
|
+
const receipt = receiptSchema.parse(JSON.parse(readFileSync(path, "utf8")));
|
|
60
|
+
if (receipt.id !== id) throw new Error("Plugin receipt identity mismatch");
|
|
61
|
+
return receipt;
|
|
62
|
+
}
|
|
63
|
+
write(receipt) {
|
|
64
|
+
writeTextAtomicSync(this.receiptPath(receipt.id), JSON.stringify(receipt));
|
|
65
|
+
}
|
|
66
|
+
mutate(fn) {
|
|
67
|
+
mkdirSync(this.receiptsDir(), {
|
|
68
|
+
recursive: true,
|
|
69
|
+
mode: 448
|
|
70
|
+
});
|
|
71
|
+
const release = lockfile.lockSync(this.receiptsDir());
|
|
72
|
+
try {
|
|
73
|
+
return fn();
|
|
74
|
+
} finally {
|
|
75
|
+
release();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
get(id) {
|
|
79
|
+
const receipt = this.receipt(id);
|
|
80
|
+
if (!receipt) return void 0;
|
|
81
|
+
const rootDir = this.revisionDir(id, receipt.revision);
|
|
82
|
+
try {
|
|
83
|
+
validatePackageTree(rootDir);
|
|
84
|
+
const inspection = inspectAgentPlugin(rootDir, this.dataDir(id));
|
|
85
|
+
const valid = computeExtensionDirectoryIntegrity(rootDir) === receipt.integrity;
|
|
86
|
+
if (!valid) inspection.diagnostics.push({
|
|
87
|
+
component: "package",
|
|
88
|
+
message: "Installed files differ from the reviewed package"
|
|
89
|
+
});
|
|
90
|
+
const health = Object.keys(inspection.servers).map((name) => readPluginMcpHealth(id, name, receipt.revision, this.stateDir));
|
|
91
|
+
const readiness = !valid ? "blocked" : inspection.diagnostics.length || health.includes("error") ? "degraded" : health.some((status) => status !== "ready") ? "setup_required" : "ready";
|
|
92
|
+
return {
|
|
93
|
+
...inspection,
|
|
94
|
+
id,
|
|
95
|
+
receipt,
|
|
96
|
+
format: "agent-plugin",
|
|
97
|
+
readiness
|
|
98
|
+
};
|
|
99
|
+
} catch (error) {
|
|
100
|
+
return {
|
|
101
|
+
id,
|
|
102
|
+
receipt,
|
|
103
|
+
format: "agent-plugin",
|
|
104
|
+
readiness: "blocked",
|
|
105
|
+
rootDir,
|
|
106
|
+
manifest: {
|
|
107
|
+
$schema: "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
108
|
+
name: id
|
|
109
|
+
},
|
|
110
|
+
skills: [],
|
|
111
|
+
servers: {},
|
|
112
|
+
capabilities: [],
|
|
113
|
+
diagnostics: [{
|
|
114
|
+
component: "package",
|
|
115
|
+
message: error instanceof Error ? error.message : String(error)
|
|
116
|
+
}]
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
list() {
|
|
121
|
+
if (!existsSync(this.receiptsDir())) return [];
|
|
122
|
+
return readdirSync(this.receiptsDir()).filter((name) => name.endsWith(".json")).sort().flatMap((name) => {
|
|
123
|
+
const id = name.slice(0, -5);
|
|
124
|
+
if (!pluginName.safeParse(id).success) return [];
|
|
125
|
+
try {
|
|
126
|
+
const plugin = this.get(id);
|
|
127
|
+
return plugin ? [plugin] : [];
|
|
128
|
+
} catch (error) {
|
|
129
|
+
log.warn({
|
|
130
|
+
err: error,
|
|
131
|
+
pluginId: id
|
|
132
|
+
}, "Invalid Agent Plugin receipt; package disabled");
|
|
133
|
+
return [];
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
active() {
|
|
138
|
+
if (["1", "true"].includes(process.env.XOPC_SKIP_EXTENSIONS ?? "")) return [];
|
|
139
|
+
return this.list().filter((p) => p.receipt.enabled && p.readiness !== "blocked");
|
|
140
|
+
}
|
|
141
|
+
inspect(source) {
|
|
142
|
+
return this.withSource(source, (root) => this.plan(root));
|
|
143
|
+
}
|
|
144
|
+
plan(root) {
|
|
145
|
+
validatePackageTree(root);
|
|
146
|
+
const initial = inspectAgentPlugin(root);
|
|
147
|
+
const inspection = inspectAgentPlugin(root, this.dataDir(initial.manifest.name));
|
|
148
|
+
const integrity = computeExtensionDirectoryIntegrity(root);
|
|
149
|
+
const current = this.receipt(inspection.manifest.name);
|
|
150
|
+
const addedCapabilities = inspection.capabilities.filter((c) => !current?.capabilities.includes(c));
|
|
151
|
+
const reviewHash = createHash("sha256").update(JSON.stringify([integrity, inspection.capabilities])).digest("hex");
|
|
152
|
+
return {
|
|
153
|
+
...inspection,
|
|
154
|
+
integrity,
|
|
155
|
+
reviewHash,
|
|
156
|
+
addedCapabilities,
|
|
157
|
+
installed: !!current
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
install(source, options = {}) {
|
|
161
|
+
return this.mutate(() => this.withSource(source, (root) => {
|
|
162
|
+
const plan = this.plan(root);
|
|
163
|
+
const id = plan.manifest.name;
|
|
164
|
+
if (options.expectedId && options.expectedId !== id) throw new Error("Update package identity does not match installed plugin");
|
|
165
|
+
const current = this.receipt(id);
|
|
166
|
+
if (current && !options.replace) throw new Error("Plugin already installed; use update");
|
|
167
|
+
if ((!current || plan.addedCapabilities.length > 0) && options.reviewHash !== plan.reviewHash) throw new Error("Package capability review is required");
|
|
168
|
+
if (options.reviewHash && options.reviewHash !== plan.reviewHash) throw new Error("Package changed after review; inspect again");
|
|
169
|
+
validatePackageTree(root);
|
|
170
|
+
const revision = randomUUID();
|
|
171
|
+
const target = this.revisionDir(id, revision);
|
|
172
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
173
|
+
try {
|
|
174
|
+
cpSync(root, target, {
|
|
175
|
+
recursive: true,
|
|
176
|
+
dereference: false,
|
|
177
|
+
verbatimSymlinks: true
|
|
178
|
+
});
|
|
179
|
+
validatePackageTree(target);
|
|
180
|
+
const installed = inspectAgentPlugin(target, this.dataDir(id));
|
|
181
|
+
const integrity = computeExtensionDirectoryIntegrity(target);
|
|
182
|
+
if (integrity !== plan.integrity) throw new Error("Package changed during installation");
|
|
183
|
+
const label = options.sourceLabel ?? source;
|
|
184
|
+
this.write({
|
|
185
|
+
id,
|
|
186
|
+
revision,
|
|
187
|
+
source: /^(https:\/\/|store:)/.test(label) ? label : resolve(label),
|
|
188
|
+
installedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
189
|
+
enabled: current?.enabled ?? false,
|
|
190
|
+
integrity,
|
|
191
|
+
capabilities: installed.capabilities,
|
|
192
|
+
previous: current ? receiptFields.parse(current) : void 0
|
|
193
|
+
});
|
|
194
|
+
} catch (error) {
|
|
195
|
+
rmSync(target, {
|
|
196
|
+
recursive: true,
|
|
197
|
+
force: true
|
|
198
|
+
});
|
|
199
|
+
throw error;
|
|
200
|
+
}
|
|
201
|
+
return this.get(id);
|
|
202
|
+
}));
|
|
203
|
+
}
|
|
204
|
+
setEnabled(id, enabled) {
|
|
205
|
+
return this.mutate(() => {
|
|
206
|
+
const plugin = this.get(id);
|
|
207
|
+
if (!plugin) throw new Error("Plugin not installed");
|
|
208
|
+
if (enabled && plugin.readiness === "blocked") throw new Error("Repair the plugin before enabling it");
|
|
209
|
+
this.write({
|
|
210
|
+
...plugin.receipt,
|
|
211
|
+
enabled
|
|
212
|
+
});
|
|
213
|
+
return this.get(id);
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
rollback(id) {
|
|
217
|
+
return this.mutate(() => {
|
|
218
|
+
const receipt = this.receipt(id);
|
|
219
|
+
const previous = receipt?.previous;
|
|
220
|
+
if (!receipt || !previous || previous.id !== id) throw new Error("No rollback revision available");
|
|
221
|
+
if (computeExtensionDirectoryIntegrity(this.revisionDir(id, previous.revision)) !== previous.integrity) throw new Error("Rollback revision integrity failed");
|
|
222
|
+
this.write({
|
|
223
|
+
...previous,
|
|
224
|
+
enabled: receipt.enabled,
|
|
225
|
+
previous: receiptFields.parse(receipt)
|
|
226
|
+
});
|
|
227
|
+
return this.get(id);
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
remove(id, removeData = false) {
|
|
231
|
+
this.mutate(() => {
|
|
232
|
+
if (!this.receipt(id)) throw new Error("Plugin not installed");
|
|
233
|
+
rmSync(this.receiptPath(id));
|
|
234
|
+
rmSync(join(this.stateDir, "plugins", pluginName.parse(id)), {
|
|
235
|
+
recursive: true,
|
|
236
|
+
force: true
|
|
237
|
+
});
|
|
238
|
+
rmSync(join(this.stateDir, "plugin-health", id), {
|
|
239
|
+
recursive: true,
|
|
240
|
+
force: true
|
|
241
|
+
});
|
|
242
|
+
if (removeData) rmSync(this.dataDir(id), {
|
|
243
|
+
recursive: true,
|
|
244
|
+
force: true
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
withSource(source, fn) {
|
|
249
|
+
const path = resolve(source);
|
|
250
|
+
if (statSync(path).isDirectory()) return fn(path);
|
|
251
|
+
if (statSync(path).size > 50 * 1024 * 1024) throw new Error("Plugin archive exceeds 50 MiB");
|
|
252
|
+
const temp = mkdtempSync(join(tmpdir(), "xopc-agent-plugin-"));
|
|
253
|
+
try {
|
|
254
|
+
const entries = new AdmZip(path).getEntries();
|
|
255
|
+
if (entries.length > 1e4) throw new Error("Too many archive entries");
|
|
256
|
+
let bytes = 0;
|
|
257
|
+
const paths = /* @__PURE__ */ new Set();
|
|
258
|
+
for (const entry of entries) {
|
|
259
|
+
if (entry.entryName.includes("\\") || entry.entryName.startsWith("/") || /^[a-z]:/i.test(entry.entryName)) throw new Error("Unsafe archive path");
|
|
260
|
+
const target = containedPath(temp, join(temp, entry.entryName));
|
|
261
|
+
if (paths.has(target)) throw new Error("Duplicate archive path");
|
|
262
|
+
paths.add(target);
|
|
263
|
+
const mode = entry.attr >>> 16 & 65535;
|
|
264
|
+
if ((mode & 61440) === 40960) throw new Error("Archive symlinks are not supported");
|
|
265
|
+
bytes += entry.header.size;
|
|
266
|
+
if (bytes > 100 * 1024 * 1024) throw new Error("Expanded archive exceeds 100 MiB");
|
|
267
|
+
if (entry.isDirectory) mkdirSync(target, { recursive: true });
|
|
268
|
+
else {
|
|
269
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
270
|
+
const data = entry.getData();
|
|
271
|
+
if (data.length !== entry.header.size) throw new Error("Archive size mismatch");
|
|
272
|
+
writeFileSync(target, data, {
|
|
273
|
+
mode: mode & 73 ? 493 : 420,
|
|
274
|
+
flag: "wx"
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
const children = readdirSync(temp);
|
|
279
|
+
return fn(existsSync(join(temp, "plugin.json")) ? temp : children.length === 1 ? join(temp, children[0]) : temp);
|
|
280
|
+
} finally {
|
|
281
|
+
rmSync(temp, {
|
|
282
|
+
recursive: true,
|
|
283
|
+
force: true
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
function validatePackageTree(root) {
|
|
289
|
+
let files = 0;
|
|
290
|
+
let bytes = 0;
|
|
291
|
+
const visit = (path, ancestors) => {
|
|
292
|
+
const safe = containedPath(root, path);
|
|
293
|
+
if (ancestors.has(safe)) throw new Error("Cyclic package symlink");
|
|
294
|
+
const stat = statSync(safe);
|
|
295
|
+
if (++files > 1e4 || (bytes += stat.isFile() ? stat.size : 0) > 100 * 1024 * 1024) throw new Error("Package exceeds limits");
|
|
296
|
+
if (stat.isDirectory()) {
|
|
297
|
+
const next = new Set([...ancestors, safe]);
|
|
298
|
+
for (const name of readdirSync(safe)) visit(join(path, name), next);
|
|
299
|
+
} else if (!stat.isFile()) throw new Error("Unsupported package file type");
|
|
300
|
+
if (lstatSync(path).isFile() && stat.nlink > 1) throw new Error("Package hardlinks are not supported");
|
|
301
|
+
};
|
|
302
|
+
visit(root, /* @__PURE__ */ new Set());
|
|
303
|
+
}
|
|
304
|
+
//#endregion
|
|
305
|
+
export { AgentPluginStore };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const PLUGIN_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
|
|
3
|
+
export declare const MCP_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json";
|
|
4
|
+
export declare const pluginName: z.ZodString;
|
|
5
|
+
declare const manifestSchema: z.ZodObject<{
|
|
6
|
+
$schema: z.ZodLiteral<"https://agent-plugins.org/schemas/1.0.0/plugin.schema.json">;
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
version: z.ZodOptional<z.ZodString>;
|
|
9
|
+
description: z.ZodOptional<z.ZodString>;
|
|
10
|
+
author: z.ZodOptional<z.ZodObject<{
|
|
11
|
+
name: z.ZodOptional<z.ZodString>;
|
|
12
|
+
email: z.ZodOptional<z.ZodString>;
|
|
13
|
+
url: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, z.core.$strict>>;
|
|
15
|
+
homepage: z.ZodOptional<z.ZodString>;
|
|
16
|
+
repository: z.ZodOptional<z.ZodString>;
|
|
17
|
+
license: z.ZodOptional<z.ZodString>;
|
|
18
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
|
+
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
declare const serverSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
22
|
+
type: z.ZodLiteral<"stdio">;
|
|
23
|
+
command: z.ZodString;
|
|
24
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
26
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
28
|
+
type: z.ZodLiteral<"streamable-http">;
|
|
29
|
+
url: z.ZodString;
|
|
30
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
31
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
32
|
+
type: z.ZodLiteral<"sse">;
|
|
33
|
+
url: z.ZodString;
|
|
34
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
35
|
+
}, z.core.$strict>], "type">;
|
|
36
|
+
export type PluginManifest = z.infer<typeof manifestSchema>;
|
|
37
|
+
export type PluginServer = z.infer<typeof serverSchema>;
|
|
38
|
+
export interface PluginDiagnostic {
|
|
39
|
+
component: string;
|
|
40
|
+
message: string;
|
|
41
|
+
}
|
|
42
|
+
export interface PluginInspection {
|
|
43
|
+
manifest: PluginManifest;
|
|
44
|
+
rootDir: string;
|
|
45
|
+
skills: Array<{
|
|
46
|
+
name: string;
|
|
47
|
+
filePath: string;
|
|
48
|
+
}>;
|
|
49
|
+
servers: Record<string, PluginServer>;
|
|
50
|
+
capabilities: string[];
|
|
51
|
+
diagnostics: PluginDiagnostic[];
|
|
52
|
+
}
|
|
53
|
+
export declare function containedPath(root: string, path: string): string;
|
|
54
|
+
export declare function expandPluginVariables(value: string, root: string, data: string): string;
|
|
55
|
+
export declare function resolvePluginCwd(cwd: string | undefined, root: string, data: string): string;
|
|
56
|
+
export declare function validatePluginServer(raw: unknown, root: string, data: string): PluginServer;
|
|
57
|
+
export declare function inspectAgentPlugin(rootDir: string, dataDir?: string): PluginInspection;
|
|
58
|
+
export declare function pluginServerId(pluginId: string, serverName: string): string;
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
2
|
+
import { existsSync, lstatSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import yaml from "js-yaml";
|
|
5
|
+
import { validateHeaderName, validateHeaderValue } from "node:http";
|
|
6
|
+
//#region src/extensions/agent-plugins/validation.ts
|
|
7
|
+
const PLUGIN_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
|
|
8
|
+
const MCP_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json";
|
|
9
|
+
const pluginName = z.string().min(1).max(64).regex(/^(?!.*(?:--|\.\.))[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/);
|
|
10
|
+
const manifestSchema = z.object({
|
|
11
|
+
$schema: z.literal(PLUGIN_SCHEMA),
|
|
12
|
+
name: pluginName,
|
|
13
|
+
version: z.string().optional(),
|
|
14
|
+
description: z.string().optional(),
|
|
15
|
+
author: z.strictObject({
|
|
16
|
+
name: z.string().optional(),
|
|
17
|
+
email: z.string().optional(),
|
|
18
|
+
url: z.string().optional()
|
|
19
|
+
}).optional(),
|
|
20
|
+
homepage: z.string().optional(),
|
|
21
|
+
repository: z.string().optional(),
|
|
22
|
+
license: z.string().optional(),
|
|
23
|
+
keywords: z.array(z.string()).optional(),
|
|
24
|
+
extensions: z.record(z.string(), z.unknown()).optional()
|
|
25
|
+
});
|
|
26
|
+
const strings = z.record(z.string(), z.string());
|
|
27
|
+
const serverSchema = z.discriminatedUnion("type", [
|
|
28
|
+
z.strictObject({
|
|
29
|
+
type: z.literal("stdio"),
|
|
30
|
+
command: z.string().min(1),
|
|
31
|
+
args: z.array(z.string()).optional(),
|
|
32
|
+
env: strings.optional(),
|
|
33
|
+
cwd: z.string().optional()
|
|
34
|
+
}),
|
|
35
|
+
z.strictObject({
|
|
36
|
+
type: z.literal("streamable-http"),
|
|
37
|
+
url: z.string().min(1),
|
|
38
|
+
headers: strings.optional()
|
|
39
|
+
}),
|
|
40
|
+
z.strictObject({
|
|
41
|
+
type: z.literal("sse"),
|
|
42
|
+
url: z.string().min(1),
|
|
43
|
+
headers: strings.optional()
|
|
44
|
+
})
|
|
45
|
+
]);
|
|
46
|
+
function containedPath(root, path) {
|
|
47
|
+
const base = resolve(root);
|
|
48
|
+
const target = resolve(path);
|
|
49
|
+
const rel = relative(base, target);
|
|
50
|
+
if (rel === ".." || rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`) || isAbsolute(rel)) throw new Error("Path escapes package boundary");
|
|
51
|
+
let ancestor = target;
|
|
52
|
+
while (!existsSync(ancestor)) {
|
|
53
|
+
try {
|
|
54
|
+
lstatSync(ancestor);
|
|
55
|
+
throw new Error("Broken package symlink");
|
|
56
|
+
} catch (error) {
|
|
57
|
+
if (error.code !== "ENOENT") throw error;
|
|
58
|
+
}
|
|
59
|
+
if (dirname(ancestor) === ancestor) break;
|
|
60
|
+
ancestor = dirname(ancestor);
|
|
61
|
+
}
|
|
62
|
+
let baseAncestor = base;
|
|
63
|
+
while (!existsSync(baseAncestor)) baseAncestor = dirname(baseAncestor);
|
|
64
|
+
const canonicalBase = resolve(realpathSync(baseAncestor), relative(baseAncestor, base));
|
|
65
|
+
const canonicalTarget = resolve(realpathSync(ancestor), relative(ancestor, target));
|
|
66
|
+
const resolvedRelative = relative(canonicalBase, canonicalTarget);
|
|
67
|
+
if (resolvedRelative === ".." || resolvedRelative.startsWith("../") || resolvedRelative.startsWith("..\\") || isAbsolute(resolvedRelative)) throw new Error("Resolved path escapes package boundary");
|
|
68
|
+
return canonicalTarget;
|
|
69
|
+
}
|
|
70
|
+
function readPackageFile(root, path) {
|
|
71
|
+
const safe = containedPath(root, path);
|
|
72
|
+
const stat = statSync(safe);
|
|
73
|
+
if (!stat.isFile() || stat.size > 1024 * 1024) throw new Error("Expected a regular file of at most 1 MiB");
|
|
74
|
+
return readFileSync(safe, "utf8");
|
|
75
|
+
}
|
|
76
|
+
function expandPluginVariables(value, root, data) {
|
|
77
|
+
return value.replace(/\$\{PLUGIN_(ROOT|DATA)\}/g, (_, key) => key === "ROOT" ? root : data);
|
|
78
|
+
}
|
|
79
|
+
function resolvePluginCwd(cwd, root, data) {
|
|
80
|
+
if (cwd === void 0) return root;
|
|
81
|
+
const dataRooted = /^\$\{PLUGIN_DATA\}(?:\/|$)/.test(cwd);
|
|
82
|
+
if (!dataRooted && !/^(?:\.\/|\$\{PLUGIN_ROOT\}(?:\/|$))/.test(cwd)) throw new Error("Invalid MCP cwd");
|
|
83
|
+
return containedPath(dataRooted ? data : root, resolve(root, expandPluginVariables(cwd, root, data)));
|
|
84
|
+
}
|
|
85
|
+
function validatePluginServer(raw, root, data) {
|
|
86
|
+
const server = serverSchema.parse(raw);
|
|
87
|
+
if (server.type === "stdio") {
|
|
88
|
+
if (server.command.startsWith("./")) {
|
|
89
|
+
if (!statSync(containedPath(root, resolve(root, server.command))).isFile()) throw new Error("MCP command must be a file");
|
|
90
|
+
} else if (!/^[^\s/\\:;|&<>`$\x00-\x1f]+$/.test(server.command)) throw new Error("MCP command must be one bare executable or ./package-path");
|
|
91
|
+
for (const key of Object.keys(server.env ?? {})) {
|
|
92
|
+
if (["PLUGIN_ROOT", "PLUGIN_DATA"].includes(process.platform === "win32" ? key.toUpperCase() : key)) throw new Error("Reserved plugin environment variable");
|
|
93
|
+
if (!key || /[=\0]/.test(key)) throw new Error("Invalid environment name");
|
|
94
|
+
}
|
|
95
|
+
if ([
|
|
96
|
+
...server.args ?? [],
|
|
97
|
+
...Object.values(server.env ?? {}),
|
|
98
|
+
server.command,
|
|
99
|
+
server.cwd ?? ""
|
|
100
|
+
].some((value) => value.includes("\0"))) throw new Error("NUL in process configuration");
|
|
101
|
+
resolvePluginCwd(server.cwd, root, data);
|
|
102
|
+
} else {
|
|
103
|
+
const url = new URL(server.url);
|
|
104
|
+
const loopback = url.hostname === "localhost" || url.hostname === "[::1]" || /^127(?:\.\d{1,3}){3}$/.test(url.hostname);
|
|
105
|
+
if (!["https:", "http:"].includes(url.protocol) || url.protocol === "http:" && !loopback || url.username || url.password || server.url.includes("#")) throw new Error("Remote MCP requires HTTPS (HTTP is allowed on loopback), without user information or fragments");
|
|
106
|
+
const names = /* @__PURE__ */ new Set();
|
|
107
|
+
for (const [key, value] of Object.entries(server.headers ?? {})) {
|
|
108
|
+
validateHeaderName(key);
|
|
109
|
+
validateHeaderValue(key, value);
|
|
110
|
+
if (names.has(key.toLowerCase())) throw new Error("Duplicate case-insensitive header");
|
|
111
|
+
names.add(key.toLowerCase());
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return server;
|
|
115
|
+
}
|
|
116
|
+
function inspectAgentPlugin(rootDir, dataDir = join(rootDir, ".inspection-data")) {
|
|
117
|
+
const root = realpathSync(rootDir);
|
|
118
|
+
if (existsSync(join(root, "xopc.extension.json"))) throw new Error("This package is a native xopc extension");
|
|
119
|
+
if (existsSync(join(root, "package.json"))) {
|
|
120
|
+
if (JSON.parse(readPackageFile(root, join(root, "package.json")))?.xopc?.extension) throw new Error("This package is a native xopc extension");
|
|
121
|
+
}
|
|
122
|
+
const raw = JSON.parse(readPackageFile(root, join(root, "plugin.json")));
|
|
123
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) throw new Error("Plugin manifest must be an object");
|
|
124
|
+
const diagnostics = [];
|
|
125
|
+
const cleaned = { ...raw };
|
|
126
|
+
for (const key of Object.keys(cleaned)) if (!Object.hasOwn(manifestSchema.shape, key)) {
|
|
127
|
+
diagnostics.push({
|
|
128
|
+
component: "manifest",
|
|
129
|
+
message: `Ignored unknown field: ${key}`
|
|
130
|
+
});
|
|
131
|
+
delete cleaned[key];
|
|
132
|
+
}
|
|
133
|
+
if ("extensions" in cleaned && (!cleaned.extensions || typeof cleaned.extensions !== "object" || Array.isArray(cleaned.extensions))) {
|
|
134
|
+
diagnostics.push({
|
|
135
|
+
component: "manifest",
|
|
136
|
+
message: "Ignored non-object extensions field"
|
|
137
|
+
});
|
|
138
|
+
delete cleaned.extensions;
|
|
139
|
+
}
|
|
140
|
+
const result = {
|
|
141
|
+
manifest: manifestSchema.parse(cleaned),
|
|
142
|
+
rootDir: root,
|
|
143
|
+
skills: [],
|
|
144
|
+
servers: Object.create(null),
|
|
145
|
+
capabilities: [],
|
|
146
|
+
diagnostics
|
|
147
|
+
};
|
|
148
|
+
const attempt = (component, fn) => {
|
|
149
|
+
try {
|
|
150
|
+
fn();
|
|
151
|
+
} catch (error) {
|
|
152
|
+
diagnostics.push({
|
|
153
|
+
component,
|
|
154
|
+
message: error instanceof Error ? error.message : String(error)
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
const present = (path) => {
|
|
159
|
+
try {
|
|
160
|
+
lstatSync(path);
|
|
161
|
+
return true;
|
|
162
|
+
} catch (error) {
|
|
163
|
+
if (error.code === "ENOENT") return false;
|
|
164
|
+
throw error;
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
const skillsDir = join(root, "skills");
|
|
168
|
+
if (present(skillsDir)) attempt("skills", () => {
|
|
169
|
+
const safe = containedPath(root, skillsDir);
|
|
170
|
+
if (!statSync(safe).isDirectory()) throw new Error("skills must be a directory");
|
|
171
|
+
for (const name of readdirSync(safe).sort()) attempt(`skill:${name}`, () => {
|
|
172
|
+
const dir = containedPath(root, join(safe, name));
|
|
173
|
+
if (!statSync(dir).isDirectory() || !present(join(dir, "SKILL.md"))) return;
|
|
174
|
+
const filePath = containedPath(root, join(dir, "SKILL.md"));
|
|
175
|
+
const match = readPackageFile(root, filePath).match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);
|
|
176
|
+
if (!match) throw new Error("Skill requires YAML frontmatter");
|
|
177
|
+
const metadata = z.object({
|
|
178
|
+
name: z.string().min(1).max(64).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
179
|
+
description: z.string().min(1).max(1024),
|
|
180
|
+
license: z.string().optional(),
|
|
181
|
+
compatibility: z.string().min(1).max(500).optional(),
|
|
182
|
+
metadata: strings.optional(),
|
|
183
|
+
"allowed-tools": z.string().optional()
|
|
184
|
+
}).parse(yaml.load(match[1], { schema: yaml.JSON_SCHEMA }));
|
|
185
|
+
if (metadata.name !== name || !metadata.description.trim()) throw new Error("Skill name must match its directory and description must not be blank");
|
|
186
|
+
result.skills.push({
|
|
187
|
+
name,
|
|
188
|
+
filePath
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
const mcpPath = join(root, "mcp.json");
|
|
193
|
+
if (present(mcpPath)) attempt("mcp", () => {
|
|
194
|
+
const mcp = z.strictObject({
|
|
195
|
+
$schema: z.literal(MCP_SCHEMA),
|
|
196
|
+
mcpServers: z.record(z.string(), z.unknown())
|
|
197
|
+
}).parse(JSON.parse(readPackageFile(root, mcpPath)));
|
|
198
|
+
for (const [name, rawServer] of Object.entries(mcp.mcpServers)) attempt(`mcp:${name}`, () => {
|
|
199
|
+
result.servers[name] = validatePluginServer(rawServer, root, dataDir);
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
for (const skill of result.skills) result.capabilities.push(`content.skills:${skill.name}`);
|
|
203
|
+
for (const [name, server] of Object.entries(result.servers)) result.capabilities.push(server.type === "stdio" ? `runtime.mcp.stdio:${name}:${JSON.stringify(server)}` : `network.mcp:${name}:${server.type}:${server.url}:${JSON.stringify(server.headers ?? {})}`);
|
|
204
|
+
result.capabilities.sort();
|
|
205
|
+
return result;
|
|
206
|
+
}
|
|
207
|
+
function pluginServerId(pluginId, serverName) {
|
|
208
|
+
return `plugin/${encodeURIComponent(pluginId)}/${encodeURIComponent(serverName)}`;
|
|
209
|
+
}
|
|
210
|
+
//#endregion
|
|
211
|
+
export { MCP_SCHEMA, PLUGIN_SCHEMA, containedPath, expandPluginVariables, inspectAgentPlugin, pluginName, pluginServerId, resolvePluginCwd, validatePluginServer };
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
2
|
import { init_logger } from "../utils/logger.js";
|
|
4
3
|
import { init_agent_scope, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
5
4
|
import { init_paths, resolveBundledExtensionsDir, resolveExtensionsDir, resolveWorkspaceExtensionsDir } from "../config/paths.js";
|
|
6
|
-
import {
|
|
5
|
+
import { normalizeExtensionManifest } from "./normalize-manifest.js";
|
|
7
6
|
import { join } from "path";
|
|
8
7
|
import { existsSync, readFileSync, readdirSync } from "fs";
|
|
9
8
|
//#region src/extensions/discover-extensions.ts
|
|
10
9
|
/**
|
|
11
10
|
* Filesystem-only extension discovery (manifest parse, no module load).
|
|
12
11
|
*/
|
|
12
|
+
init_agent_scope();
|
|
13
|
+
init_paths();
|
|
14
|
+
init_logger();
|
|
13
15
|
function asSchemaConfig(config) {
|
|
14
16
|
return config;
|
|
15
17
|
}
|
|
18
|
+
const EXTENSION_MANIFEST_FILE = "xopc.extension.json";
|
|
19
|
+
const log = createLogger("ExtensionDiscover");
|
|
16
20
|
function isRecord(x) {
|
|
17
21
|
return typeof x === "object" && x !== null && !Array.isArray(x);
|
|
18
22
|
}
|
|
@@ -113,11 +117,11 @@ function discoverInDirectory(dir, source, discovered) {
|
|
|
113
117
|
}
|
|
114
118
|
function resolveDiscoveryPaths(options, config) {
|
|
115
119
|
const cfg = config ? asSchemaConfig(config) : null;
|
|
116
|
-
const aid = cfg ? resolveDefaultAgentId(
|
|
120
|
+
const aid = cfg ? resolveDefaultAgentId() : null;
|
|
117
121
|
return {
|
|
118
122
|
bundledDir: resolveBundledExtensionsDir(),
|
|
119
123
|
globalDir: options.extensionsDir ?? resolveExtensionsDir(),
|
|
120
|
-
workspaceExtensionsDir: options.workspaceExtensionsDir ?? (cfg && aid ? resolveWorkspaceExtensionsDir(
|
|
124
|
+
workspaceExtensionsDir: options.workspaceExtensionsDir ?? (cfg && aid ? resolveWorkspaceExtensionsDir(aid) : null)
|
|
121
125
|
};
|
|
122
126
|
}
|
|
123
127
|
/**
|
|
@@ -137,15 +141,5 @@ function areExtensionsGloballyDisabled(config) {
|
|
|
137
141
|
if (process.env.XOPC_SKIP_EXTENSIONS === "1" || process.env.XOPC_SKIP_EXTENSIONS === "true") return true;
|
|
138
142
|
return (config && isRecord(config) && isRecord(config.extensions) ? config.extensions : void 0)?.enabled === false;
|
|
139
143
|
}
|
|
140
|
-
var EXTENSION_MANIFEST_FILE, log;
|
|
141
|
-
var init_discover_extensions = __esmMin((() => {
|
|
142
|
-
init_agent_scope();
|
|
143
|
-
init_paths();
|
|
144
|
-
init_logger();
|
|
145
|
-
init_normalize_manifest();
|
|
146
|
-
EXTENSION_MANIFEST_FILE = "xopc.extension.json";
|
|
147
|
-
log = createLogger("ExtensionDiscover");
|
|
148
|
-
}));
|
|
149
144
|
//#endregion
|
|
150
|
-
|
|
151
|
-
export { areExtensionsGloballyDisabled, discoverExtensionsFromDisk, init_discover_extensions };
|
|
145
|
+
export { areExtensionsGloballyDisabled, discoverExtensionsFromDisk };
|
|
@@ -16,4 +16,4 @@ export declare function buildExtensionMetadataSnapshot(options: ExtensionLoaderO
|
|
|
16
16
|
/**
|
|
17
17
|
* Resolve loader options from app config when caller omits workspace paths.
|
|
18
18
|
*/
|
|
19
|
-
export declare function resolveExtensionLoaderOptionsFromConfig(
|
|
19
|
+
export declare function resolveExtensionLoaderOptionsFromConfig(_config: DiscoverConfig): ExtensionLoaderOptions;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
1
|
import { init_agent_scope, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
3
2
|
import { init_paths, resolveExtensionsDir, resolveWorkspaceExtensionsDir } from "../config/paths.js";
|
|
4
|
-
import { discoverExtensionsFromDisk
|
|
5
|
-
import { ManifestRegistry
|
|
3
|
+
import { discoverExtensionsFromDisk } from "./discover-extensions.js";
|
|
4
|
+
import { ManifestRegistry } from "./manifest-registry.js";
|
|
6
5
|
//#region src/extensions/extension-metadata-snapshot.ts
|
|
6
|
+
init_agent_scope();
|
|
7
|
+
init_paths();
|
|
7
8
|
/**
|
|
8
9
|
* Scan extension directories once and build a manifest registry snapshot.
|
|
9
10
|
* Pass the result to {@link ExtensionLoader.setManifestSnapshot} to avoid rediscovery.
|
|
@@ -18,21 +19,13 @@ function buildExtensionMetadataSnapshot(options, config) {
|
|
|
18
19
|
/**
|
|
19
20
|
* Resolve loader options from app config when caller omits workspace paths.
|
|
20
21
|
*/
|
|
21
|
-
function resolveExtensionLoaderOptionsFromConfig(
|
|
22
|
-
const
|
|
23
|
-
const aid = resolveDefaultAgentId(cfg);
|
|
22
|
+
function resolveExtensionLoaderOptionsFromConfig(_config) {
|
|
23
|
+
const aid = resolveDefaultAgentId();
|
|
24
24
|
return {
|
|
25
|
-
workspaceDir: resolveAgentWorkspaceDir(
|
|
25
|
+
workspaceDir: resolveAgentWorkspaceDir(aid),
|
|
26
26
|
extensionsDir: resolveExtensionsDir(),
|
|
27
|
-
workspaceExtensionsDir: resolveWorkspaceExtensionsDir(
|
|
27
|
+
workspaceExtensionsDir: resolveWorkspaceExtensionsDir(aid)
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
var init_extension_metadata_snapshot = __esmMin((() => {
|
|
31
|
-
init_agent_scope();
|
|
32
|
-
init_paths();
|
|
33
|
-
init_discover_extensions();
|
|
34
|
-
init_manifest_registry();
|
|
35
|
-
}));
|
|
36
30
|
//#endregion
|
|
37
|
-
|
|
38
|
-
export { buildExtensionMetadataSnapshot, init_extension_metadata_snapshot, resolveExtensionLoaderOptionsFromConfig };
|
|
31
|
+
export { buildExtensionMetadataSnapshot, resolveExtensionLoaderOptionsFromConfig };
|