@xopcai/xopc 0.0.396 → 0.0.398
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DwTaeL1e.js → agent-avatar-dicebear-Q-lKLSrc.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CobxTBV_.js +1 -0
- package/dist/gateway/static/root/assets/agents-Bgmmue5K.js +77 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-BjGOUrAf.js → agents-admin-api-DvSe10zu.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-B1ApwlFh.js → app-management-settings-panel-CB_W2ano.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-Avd_jVji.js → appearance-settings-B-ppSGBm.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-3qUgsGui.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-C26WGbj9.js → archive-plugin-CeQrQ693.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-T3FSuURJ.js → automations-page-Cc9vZanv.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-Bc4c_AEq.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-CLaLkM3M.js → binary-plugins-BqaVBv1R.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CB4oRyM5.js → block-editor-B4ij8nZi.js} +40 -40
- package/dist/gateway/static/root/assets/{browser-automation-inputs-0nkk3bLA.js → browser-automation-inputs-DngvcZH9.js} +1 -1
- package/dist/gateway/static/root/assets/browser-automations-page-CdqwXyYq.js +3 -0
- package/dist/gateway/static/root/assets/browser-settings-page-CJT0rB-I.js +3 -0
- package/dist/gateway/static/root/assets/{capabilities-CTfLd_UE.js → capabilities-glv1DeRI.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-C56VsP0Y.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DZiA8JIq.js +8 -0
- package/dist/gateway/static/root/assets/{capability-header-actions-Br5PchG2.js → capability-header-actions-Cu-ATcJq.js} +1 -1
- package/dist/gateway/static/root/assets/capability-links--dcwUjgv.js +1 -0
- package/dist/gateway/static/root/assets/channels-gIjZtYnV.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Cl0hAav9.js → chat-terminal-dock-COdvmTgN.js} +2 -2
- package/dist/gateway/static/root/assets/computer-settings-page-C1XHsuI8.js +1 -0
- package/dist/gateway/static/root/assets/{connector-service-page-AqsoqTnF.js → connector-service-page-Cv2bhnQ5.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-SmKItq0N.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-CyFehuto.js → date-picker-CCnqYwy0.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-Vu_5QGGJ.js → dependency-picker-nt5ruIio.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Dw9k0Z2p.js → desktop-pet-Bn8xj1v3.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DKqkhvxu.js → desktop-pet-settings-Cbl1J_VE.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-4l4ESMon.js → device-pairing-wizard-Tadg9co1.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-7svbL2tR.js → directory-picker-path-field-DuE5ez1E.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CFa6PCBV.js → extension-debug-page-jsNxwqNi.js} +1 -1
- package/dist/gateway/static/root/assets/extension-page-N_rBjYX8.js +1 -0
- package/dist/gateway/static/root/assets/extension-settings-page-7qAdvlRB.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-swr-Di9g6pE8.js → gateway-config-swr-DAir1JsW.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-2-o7qk92.js → gateway-realtime-dE0XrVAT.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-CPlVuu0d.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-ViqOhx_m.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-BCUswcVy.js → gateway-startup-retry-CqyGHM2M.js} +1 -1
- package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-DzEeyJpH.js → highlighted-body-KQOG7T2V-XrkWdmrk.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-C_Xn_Kkz.js +2 -0
- package/dist/gateway/static/root/assets/{image-generation-api-Zo56ZmKs.js → image-generation-api-CmHdM2uL.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-C_PPaOFv.js → imports-page-B-dnvHP_.js} +1 -1
- package/dist/gateway/static/root/assets/index-DWzv8ZoO.css +1 -0
- package/dist/gateway/static/root/assets/{index-XRbEWVyZ.js → index-DvKDT-RQ.js} +116 -116
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BGtrzFT6.js → keyboard-shortcuts-settings-mCs9cDgv.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-Cu80fCA0.js → local-app-workbench-page-B7AtlfWQ.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-Zsu8FnwP.js → local-apps-page-CIJE7jME.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-BjwlkAKA.js → local-session-drafts-fhip41-L.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-Djl2FW6_.js → locale-store-Jnhw2WMv.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DlIhfEW_.js → logs-page-HawXUKF2.js} +2 -2
- package/dist/gateway/static/root/assets/management-settings-DByEh6rq.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-DyO7Q0Ms.js → markdown-view-B58RypQ4.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Ba1_QMmZ.js → media-plugins-B8BLxQgj.js} +1 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-CZjPT7xE.js +1 -0
- package/dist/gateway/static/root/assets/messages-DBvKzlCl.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-hQHB5fCs.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-BEusEk31.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-BqNWtf_f.js → page-context-capture-button-42bq8N6-.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-DPR5gzhf.js +1 -0
- package/dist/gateway/static/root/assets/plugin-details-dialog-D8dKKIY9.js +1 -0
- package/dist/gateway/static/root/assets/plugin-presentation-BrQpVvjC.js +1 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-kkbrbiVd.js → preview-open-alternatives-DKyLVLpX.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-Dheqo_4J.js → product-open-page-DcGH0AXN.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-B9Y6dIuh.js → product-preview-content-Ck6OzP09.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-BHoQ10Eo.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DYsq_OLJ.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BwR2CiR5.js → registry-api-BbUEMGcj.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CU3EChY0.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-C_VOMhLI.js → runtime-tools-api-D0xtCTXr.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BjyZGNP3.js → runtime-tools-settings-panel-Bfs5zKDg.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DelMOLjg.js → schema-form-BbI2BuSU.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-DbNNQps9.js → session-api-CAKgrbgz.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-DfVviLTK.js → session-manager-D_N7qha7.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-CjB2GOTs.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-jbVx8gcF.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-DNWEDA71.js → settings-form-section-BfBBJlr-.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DJ27gC7J.js → settings-page-9yu4SN1j.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DhWB3feW.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-Du4mumVM.js → share-preview-page-B6lQl5xb.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-UJGjdz3F.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-zOxHjU7m.js → skill-api-y2m3k_R4.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-Bk9FqsVa.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-DLd4O-Fo.js +2 -0
- package/dist/gateway/static/root/assets/{style-DsnKw5jo.js → style-C2ptQg95.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-mz9hWo_H.js → system-settings-panel-DYzcLnVk.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-DLGtmHAH.js +2 -0
- package/dist/gateway/static/root/assets/{task-expandable-content-D3i_51Oc.js → task-expandable-content-HdEeV_0-.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-aC-ziRbY.js → tracing-settings-page-DKQYmzFn.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-Ch2Veztk.js → tunnel-api-C2VY_HTy.js} +1 -1
- package/dist/gateway/static/root/assets/usage-page-CjzunQtj.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-BLW3t_OK.js → use-autosave-BElgnGMt.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-DsOGCDTR.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-DulF6Cm4.js → voice-api-key-field-FVjX0qhn.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-Ceo_hqZC.js → voice-config-api-T3nM4buh.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-bBMZM8tN.js → work-discovery-overlay-B2S2NZuK.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-CsxXS1WI.js → workflow-run-setup-panel-2Gq34KQk.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-CjeFD3mk.js +6 -0
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-wwIRBFCs.js → xopc-cloud-account-card-BZMIZxWg.js} +1 -1
- package/dist/gateway/static/root/index.html +15 -15
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +8 -0
- package/dist/src/agent/agent-manager.js +3 -3
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/embedded/codemode-extension.d.ts +1 -0
- package/dist/src/agent/embedded/codemode-extension.js +6 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/embedded/run-turn.js +34 -2
- package/dist/src/agent/embedded/session-runner.js +1 -1
- package/dist/src/agent/external-tools/cliProvider.js +2 -2
- package/dist/src/agent/external-tools/composio-provider.js +2 -2
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/mcp/config.d.ts +2 -0
- package/dist/src/agent/mcp/config.js +2 -2
- package/dist/src/agent/mcp/connection-setup.js +13 -1
- package/dist/src/agent/mcp/effective-server.d.ts +3 -0
- package/dist/src/agent/mcp/effective-server.js +27 -0
- package/dist/src/agent/mcp/native-mcp.d.ts +1 -1
- package/dist/src/agent/mcp/native-mcp.js +13 -4
- package/dist/src/agent/mcp/tool-catalog.js +2 -1
- package/dist/src/agent/service/process-direct-streaming.js +1 -1
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/skills/index.d.ts +1 -0
- package/dist/src/agent/skills/index.js +7 -3
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/skill-manager.d.ts +1 -0
- package/dist/src/agent/skills/skill-manager.js +6 -1
- package/dist/src/agent/skills/skill-sources.d.ts +1 -0
- package/dist/src/agent/skills/skill-sources.js +4 -3
- package/dist/src/agent/skills/types.d.ts +1 -0
- package/dist/src/agent/tools/factory.js +1 -1
- package/dist/src/agent/tools/personal-read-tool.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/agent/workspace-runtime/registry.js +7 -3
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/service/action-executor.js +2 -2
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +92 -7
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/extension.js +1 -1
- package/dist/src/cli/commands/mcp.js +6 -4
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/config/agent-model-intents.js +1 -1
- package/dist/src/config/agent-profile.js +2 -2
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.js +2 -2
- package/dist/src/extensions/agent-plugins/auth.d.ts +7 -1
- package/dist/src/extensions/agent-plugins/auth.js +53 -12
- package/dist/src/extensions/agent-plugins/branding.d.ts +12 -0
- package/dist/src/extensions/agent-plugins/branding.js +54 -0
- package/dist/src/extensions/agent-plugins/cli-authorization.d.ts +33 -0
- package/dist/src/extensions/agent-plugins/cli-authorization.js +203 -0
- package/dist/src/extensions/agent-plugins/connection-reuse.d.ts +10 -0
- package/dist/src/extensions/agent-plugins/connection-reuse.js +23 -0
- package/dist/src/extensions/agent-plugins/credentials.js +24 -1
- package/dist/src/extensions/agent-plugins/formats.d.ts +27 -0
- package/dist/src/extensions/agent-plugins/formats.js +208 -0
- package/dist/src/extensions/agent-plugins/inventory.d.ts +154 -2
- package/dist/src/extensions/agent-plugins/inventory.js +40 -5
- package/dist/src/extensions/agent-plugins/mcp-adapter.d.ts +2 -1
- package/dist/src/extensions/agent-plugins/mcp-adapter.js +42 -8
- package/dist/src/extensions/agent-plugins/mcp-format.d.ts +2 -0
- package/dist/src/extensions/agent-plugins/mcp-format.js +82 -0
- package/dist/src/extensions/agent-plugins/resources.d.ts +14 -0
- package/dist/src/extensions/agent-plugins/resources.js +112 -0
- package/dist/src/extensions/agent-plugins/setup-contract.d.ts +74 -0
- package/dist/src/extensions/agent-plugins/setup-contract.js +77 -0
- package/dist/src/extensions/agent-plugins/setup.d.ts +127 -0
- package/dist/src/extensions/agent-plugins/setup.js +496 -0
- package/dist/src/extensions/agent-plugins/skill-catalog.d.ts +14 -0
- package/dist/src/extensions/agent-plugins/skill-catalog.js +95 -0
- package/dist/src/extensions/agent-plugins/source-catalog.d.ts +21 -0
- package/dist/src/extensions/agent-plugins/source-catalog.js +175 -0
- package/dist/src/extensions/agent-plugins/sources.d.ts +1 -1
- package/dist/src/extensions/agent-plugins/sources.js +12 -3
- package/dist/src/extensions/agent-plugins/store.d.ts +33 -2
- package/dist/src/extensions/agent-plugins/store.js +175 -25
- package/dist/src/extensions/agent-plugins/user-config.d.ts +5 -0
- package/dist/src/extensions/agent-plugins/user-config.js +49 -0
- package/dist/src/extensions/agent-plugins/validation.d.ts +26 -1
- package/dist/src/extensions/agent-plugins/validation.js +143 -28
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/agent-plugins.js +121 -10
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/composer-history.js +22 -4
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/context-sources.js +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +6 -4
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/lock.js +1 -1
- package/dist/src/gateway/service/marketplace-service.js +4 -2
- package/dist/src/gateway/service.js +8 -6
- package/dist/src/gateway/session-context-summary.js +1 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/personal-agent/proactivity/service.js +1 -1
- package/dist/src/personal-agent/service.js +2 -2
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/routing/resolve-route.js +1 -1
- package/dist/src/routing/resolve-tui-session-key.js +1 -1
- package/dist/src/storage/sqlite/composer-input-history-repository.d.ts +4 -3
- package/dist/src/storage/sqlite/composer-input-history-repository.js +10 -8
- package/dist/src/storage/sqlite/migrations/257_session_composer_history.sql +11 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.js +1 -1
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tui/backends/embedded-backend.d.ts +2 -2
- package/dist/src/tui/backends/embedded-backend.js +6 -6
- package/dist/src/tui/backends/gateway-realtime-backend.d.ts +2 -2
- package/dist/src/tui/backends/gateway-realtime-backend.js +7 -4
- package/dist/src/tui/composer-history.d.ts +14 -0
- package/dist/src/tui/composer-history.js +85 -0
- package/dist/src/tui/tui-backend.d.ts +4 -3
- package/dist/src/tui/tui.js +19 -46
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/package.json +12 -4
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-D8Q9Cpge.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-C-UKhDkS.js +0 -1
- package/dist/gateway/static/root/assets/agents-DOv68iBN.js +0 -77
- package/dist/gateway/static/root/assets/apps-page-Da6Ar2U3.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-B9r27rPk.js +0 -6
- package/dist/gateway/static/root/assets/browser-automations-page-KLG8IXvl.js +0 -3
- package/dist/gateway/static/root/assets/browser-settings-page-Tcejw5fF.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-page-BJlw9rhA.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-kEvUR6Yu.js +0 -8
- package/dist/gateway/static/root/assets/channels-DRaE6_ub.js +0 -1
- package/dist/gateway/static/root/assets/computer-settings-page-B6JI2S1b.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-cDRZ8bqm.js +0 -1
- package/dist/gateway/static/root/assets/extension-page-BD4nZ9sf.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-CxPIMrmn.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DQ6-whg-.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-Da2CtQ7c.js +0 -1
- package/dist/gateway/static/root/assets/home-page-Cp4-sTfX.js +0 -2
- package/dist/gateway/static/root/assets/index-zIgp-ZTu.css +0 -1
- package/dist/gateway/static/root/assets/management-settings-CDV-xItG.js +0 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-CpK57Kgp.js +0 -1
- package/dist/gateway/static/root/assets/messages-DPxcWxfD.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-BXi6BrXd.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-ClR9R90o.js +0 -8
- package/dist/gateway/static/root/assets/personal-page-CSF-sn8w.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-l5dXxnSq.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-95Od8gLy.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-DPEpPFax.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BN0nMm0w.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BvfEKyfy.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BWA_puDN.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-C0ixka9_.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-743oJIiS.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-DBYhEjP9.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-Brp2wrEc.js +0 -2
- package/dist/gateway/static/root/assets/usage-page-KfKZ2a3t.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-BSsT8WjA.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-a-mfjQ2h.js +0 -6
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
2
|
+
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
3
|
+
import { pluginAuthorizations } from "./setup-contract.js";
|
|
4
|
+
import { pluginName } from "./validation.js";
|
|
5
|
+
import { pluginCredentialProviderPrefix } from "./auth.js";
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
8
|
+
import { createHash } from "node:crypto";
|
|
9
|
+
//#region src/extensions/agent-plugins/user-config.ts
|
|
10
|
+
init_credentials();
|
|
11
|
+
init_write_file_atomic();
|
|
12
|
+
function readPluginUserConfig(store, id, revision) {
|
|
13
|
+
const path = join(store.stateDir, "plugin-config", `${pluginName.parse(id)}-${revision}.json`);
|
|
14
|
+
return existsSync(path) ? JSON.parse(readFileSync(path, "utf8")) : {};
|
|
15
|
+
}
|
|
16
|
+
async function savePluginUserConfig(store, plugin, input) {
|
|
17
|
+
const fields = plugin.layout?.userConfig ?? {};
|
|
18
|
+
const values = readPluginUserConfig(store, plugin.id, plugin.receipt.revision);
|
|
19
|
+
for (const [key, value] of Object.entries(input)) {
|
|
20
|
+
const field = fields[key];
|
|
21
|
+
if (!field || typeof value !== field.type || typeof value === "string" && (value.length > 16384 || value.includes("\0"))) throw new Error(`Invalid configuration: ${key}`);
|
|
22
|
+
if (field.sensitive) {
|
|
23
|
+
const provider = `${pluginCredentialProviderPrefix(plugin.id)}config-${createHash("sha256").update(`${plugin.receipt.revision}:${key}`).digest("hex")}`;
|
|
24
|
+
await new CredentialResolver({ stateDir: store.stateDir }).saveApiKey(provider, String(value));
|
|
25
|
+
values[key] = { xopcSecretRef: {
|
|
26
|
+
provider,
|
|
27
|
+
fieldKey: key,
|
|
28
|
+
prefix: ""
|
|
29
|
+
} };
|
|
30
|
+
} else values[key] = value;
|
|
31
|
+
}
|
|
32
|
+
writeTextAtomicSync(join(store.stateDir, "plugin-config", `${plugin.id}-${plugin.receipt.revision}.json`), JSON.stringify(values));
|
|
33
|
+
}
|
|
34
|
+
function pluginConfigMissing(store, plugin) {
|
|
35
|
+
const saved = readPluginUserConfig(store, plugin.id, plugin.receipt.revision);
|
|
36
|
+
const accountFields = new Set(pluginAuthorizations(plugin.manifest).flatMap((value) => value.methods.flatMap((method) => method.type === "form" || method.type === "cli" ? method.fields : [])));
|
|
37
|
+
return Object.entries(plugin.layout?.userConfig ?? {}).filter(([key, field]) => !accountFields.has(key) && field.required && (saved[key] === void 0 || saved[key] === "") && field.default === void 0).map(([key]) => key);
|
|
38
|
+
}
|
|
39
|
+
function expandUserConfig(value, values) {
|
|
40
|
+
const exact = value.match(/^\$\{user_config\.([A-Za-z_][A-Za-z0-9_]*)\}$/);
|
|
41
|
+
if (exact && typeof values[exact[1]] === "object") return values[exact[1]];
|
|
42
|
+
return value.replace(/\$\{user_config\.([A-Za-z_][A-Za-z0-9_]*)\}/g, (_all, key) => {
|
|
43
|
+
if (values[key] === void 0) throw new Error(`Configure ${key} before starting tools`);
|
|
44
|
+
if (typeof values[key] === "object") throw new Error("Sensitive configuration must occupy an entire environment/header value");
|
|
45
|
+
return String(values[key]);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { expandUserConfig, pluginConfigMissing, readPluginUserConfig, savePluginUserConfig };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { pluginResources } from './resources.js';
|
|
2
|
+
import { type PluginLayout } from './formats.js';
|
|
1
3
|
import { z } from 'zod';
|
|
2
4
|
export declare const PLUGIN_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
|
|
3
5
|
export declare const MCP_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json";
|
|
@@ -28,6 +30,27 @@ declare const serverSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
28
30
|
type: z.ZodLiteral<"streamable-http">;
|
|
29
31
|
url: z.ZodString;
|
|
30
32
|
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
33
|
+
oauth: z.ZodOptional<z.ZodObject<{
|
|
34
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
35
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
36
|
+
callbackPort: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
callbackUrl: z.ZodOptional<z.ZodString>;
|
|
38
|
+
clientName: z.ZodOptional<z.ZodString>;
|
|
39
|
+
clientRegistration: z.ZodOptional<z.ZodEnum<{
|
|
40
|
+
dcr: "dcr";
|
|
41
|
+
cimd: "cimd";
|
|
42
|
+
}>>;
|
|
43
|
+
authServerMetadataUrl: z.ZodOptional<z.ZodString>;
|
|
44
|
+
}, z.core.$strict>>;
|
|
45
|
+
connectionAuth: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
mode: z.ZodEnum<{
|
|
47
|
+
none: "none";
|
|
48
|
+
oauth: "oauth";
|
|
49
|
+
"api-key": "api-key";
|
|
50
|
+
}>;
|
|
51
|
+
headerName: z.ZodOptional<z.ZodString>;
|
|
52
|
+
prefix: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, z.core.$strict>>;
|
|
31
54
|
}, z.core.$strict>], "type">;
|
|
32
55
|
export type PluginManifest = z.infer<typeof manifestSchema>;
|
|
33
56
|
export type PluginServer = z.infer<typeof serverSchema>;
|
|
@@ -36,6 +59,8 @@ export interface PluginDiagnostic {
|
|
|
36
59
|
message: string;
|
|
37
60
|
}
|
|
38
61
|
export interface PluginInspection {
|
|
62
|
+
resources?: ReturnType<typeof pluginResources>;
|
|
63
|
+
layout?: PluginLayout;
|
|
39
64
|
manifest: PluginManifest;
|
|
40
65
|
rootDir: string;
|
|
41
66
|
skills: Array<{
|
|
@@ -50,6 +75,6 @@ export declare function containedPath(root: string, path: string): string;
|
|
|
50
75
|
export declare function expandPluginVariables(value: string, root: string, data: string): string;
|
|
51
76
|
export declare function resolvePluginCwd(cwd: string | undefined, root: string, data: string): string;
|
|
52
77
|
export declare function validatePluginServer(raw: unknown, root: string, data: string): PluginServer;
|
|
53
|
-
export declare function inspectAgentPlugin(rootDir: string, dataDir?: string): PluginInspection;
|
|
78
|
+
export declare function inspectAgentPlugin(rootDir: string, dataDir?: string, importManifest?: Record<string, unknown>): PluginInspection;
|
|
54
79
|
export declare function pluginServerId(pluginId: string, serverName: string): string;
|
|
55
80
|
export {};
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
import { McpOAuthConfigSchema, init_schema } from "../../config/schema.js";
|
|
2
|
+
import { pluginAuthorizations, safeAuthorizationUrl } from "./setup-contract.js";
|
|
3
|
+
import { normalizePluginMcpServer } from "./mcp-format.js";
|
|
4
|
+
import { pluginResources } from "./resources.js";
|
|
5
|
+
import { collectPluginSkillFiles, readPluginLayout } from "./formats.js";
|
|
1
6
|
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
2
7
|
import { existsSync, lstatSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
|
|
3
8
|
import { createHash } from "node:crypto";
|
|
4
9
|
import { z } from "zod";
|
|
5
|
-
import yaml from "js-yaml";
|
|
6
10
|
import { validateHeaderName, validateHeaderValue } from "node:http";
|
|
11
|
+
import yaml from "js-yaml";
|
|
7
12
|
//#region src/extensions/agent-plugins/validation.ts
|
|
13
|
+
init_schema();
|
|
8
14
|
const PLUGIN_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
|
|
9
15
|
const MCP_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json";
|
|
10
16
|
const pluginName = z.string().min(1).max(64).regex(/^(?!.*(?:--|\.\.))[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/);
|
|
@@ -34,7 +40,17 @@ const serverSchema = z.discriminatedUnion("type", [z.strictObject({
|
|
|
34
40
|
}), z.strictObject({
|
|
35
41
|
type: z.literal("streamable-http"),
|
|
36
42
|
url: z.string().min(1),
|
|
37
|
-
headers: strings.optional()
|
|
43
|
+
headers: strings.optional(),
|
|
44
|
+
oauth: McpOAuthConfigSchema.omit({ clientSecret: true }).optional(),
|
|
45
|
+
connectionAuth: z.strictObject({
|
|
46
|
+
mode: z.enum([
|
|
47
|
+
"none",
|
|
48
|
+
"oauth",
|
|
49
|
+
"api-key"
|
|
50
|
+
]),
|
|
51
|
+
headerName: z.string().optional(),
|
|
52
|
+
prefix: z.string().optional()
|
|
53
|
+
}).optional()
|
|
38
54
|
})]);
|
|
39
55
|
function containedPath(root, path) {
|
|
40
56
|
const base = resolve(root);
|
|
@@ -67,7 +83,7 @@ function readPackageFile(root, path) {
|
|
|
67
83
|
return readFileSync(safe, "utf8");
|
|
68
84
|
}
|
|
69
85
|
function expandPluginVariables(value, root, data) {
|
|
70
|
-
return value.replace(/\$\{PLUGIN_(ROOT|DATA)\}/g, (_, key) => key === "ROOT" ? root : data);
|
|
86
|
+
return value.replace(/\$\{(?:CLAUDE_)?PLUGIN_(ROOT|DATA)\}/g, (_, key) => key === "ROOT" ? root : data);
|
|
71
87
|
}
|
|
72
88
|
function resolvePluginCwd(cwd, root, data) {
|
|
73
89
|
if (cwd === void 0) return root;
|
|
@@ -80,7 +96,7 @@ function validatePluginServer(raw, root, data) {
|
|
|
80
96
|
if (server.type === "stdio") {
|
|
81
97
|
if (server.command.startsWith("./")) {
|
|
82
98
|
if (!statSync(containedPath(root, resolve(root, server.command))).isFile()) throw new Error("MCP command must be a file");
|
|
83
|
-
} else if (!/^[^\s/\\:;|&<>`$\x00-\x1f]+$/.test(server.command)) throw new Error("MCP command must be one bare executable or ./package-path");
|
|
99
|
+
} else if (!/^\$\{PLUGIN_RESOURCES\}\/[a-z][a-z0-9.-]{0,63}$/.test(server.command) && !/^[^\s/\\:;|&<>`$\x00-\x1f]+$/.test(server.command)) throw new Error("MCP command must be one bare executable or ./package-path");
|
|
84
100
|
for (const key of Object.keys(server.env ?? {})) {
|
|
85
101
|
if (["PLUGIN_ROOT", "PLUGIN_DATA"].includes(process.platform === "win32" ? key.toUpperCase() : key)) throw new Error("Reserved plugin environment variable");
|
|
86
102
|
if (!key || /[=\0]/.test(key)) throw new Error("Invalid environment name");
|
|
@@ -96,6 +112,16 @@ function validatePluginServer(raw, root, data) {
|
|
|
96
112
|
const url = new URL(server.url);
|
|
97
113
|
const loopback = url.hostname === "localhost" || url.hostname === "[::1]" || /^127(?:\.\d{1,3}){3}$/.test(url.hostname);
|
|
98
114
|
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");
|
|
115
|
+
if (server.connectionAuth?.headerName) {
|
|
116
|
+
validateHeaderName(server.connectionAuth.headerName);
|
|
117
|
+
if ([
|
|
118
|
+
"host",
|
|
119
|
+
"cookie",
|
|
120
|
+
"content-length",
|
|
121
|
+
"connection",
|
|
122
|
+
"transfer-encoding"
|
|
123
|
+
].includes(server.connectionAuth.headerName.toLowerCase())) throw new Error("Unsupported authentication header");
|
|
124
|
+
}
|
|
99
125
|
const names = /* @__PURE__ */ new Set();
|
|
100
126
|
for (const [key, value] of Object.entries(server.headers ?? {})) {
|
|
101
127
|
validateHeaderName(key);
|
|
@@ -106,15 +132,19 @@ function validatePluginServer(raw, root, data) {
|
|
|
106
132
|
}
|
|
107
133
|
return server;
|
|
108
134
|
}
|
|
109
|
-
function inspectAgentPlugin(rootDir, dataDir = join(rootDir, ".inspection-data")) {
|
|
135
|
+
function inspectAgentPlugin(rootDir, dataDir = join(rootDir, ".inspection-data"), importManifest) {
|
|
110
136
|
const root = realpathSync(rootDir);
|
|
111
137
|
if (existsSync(join(root, "xopc.extension.json"))) throw new Error("This package is a native xopc extension");
|
|
112
138
|
if (existsSync(join(root, "package.json"))) {
|
|
113
139
|
if (JSON.parse(readPackageFile(root, join(root, "package.json")))?.xopc?.extension) throw new Error("This package is a native xopc extension");
|
|
114
140
|
}
|
|
115
|
-
const
|
|
141
|
+
const layout = readPluginLayout(root, (path) => readPackageFile(root, path), (path) => containedPath(root, path), importManifest);
|
|
142
|
+
const raw = layout.manifest;
|
|
116
143
|
if (!raw || typeof raw !== "object" || Array.isArray(raw)) throw new Error("Plugin manifest must be an object");
|
|
117
|
-
const diagnostics =
|
|
144
|
+
const diagnostics = layout.compatibility.filter((item) => item.support !== "supported").map((item) => ({
|
|
145
|
+
component: item.component,
|
|
146
|
+
message: item.message
|
|
147
|
+
}));
|
|
118
148
|
const cleaned = { ...raw };
|
|
119
149
|
for (const key of Object.keys(cleaned)) if (!Object.hasOwn(manifestSchema.shape, key)) {
|
|
120
150
|
diagnostics.push({
|
|
@@ -130,21 +160,34 @@ function inspectAgentPlugin(rootDir, dataDir = join(rootDir, ".inspection-data")
|
|
|
130
160
|
});
|
|
131
161
|
delete cleaned.extensions;
|
|
132
162
|
}
|
|
163
|
+
const manifest = manifestSchema.parse(cleaned);
|
|
133
164
|
const result = {
|
|
134
|
-
|
|
165
|
+
layout,
|
|
166
|
+
manifest,
|
|
135
167
|
rootDir: root,
|
|
136
168
|
skills: [],
|
|
137
169
|
servers: Object.create(null),
|
|
138
170
|
capabilities: [],
|
|
139
171
|
diagnostics
|
|
140
172
|
};
|
|
173
|
+
const report = (item) => {
|
|
174
|
+
const existing = layout.compatibility.findIndex((value) => value.component === item.component);
|
|
175
|
+
if (existing >= 0) layout.compatibility[existing] = item;
|
|
176
|
+
else layout.compatibility.push(item);
|
|
177
|
+
};
|
|
141
178
|
const attempt = (component, fn) => {
|
|
142
179
|
try {
|
|
143
180
|
fn();
|
|
144
181
|
} catch (error) {
|
|
182
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
145
183
|
diagnostics.push({
|
|
146
184
|
component,
|
|
147
|
-
message
|
|
185
|
+
message
|
|
186
|
+
});
|
|
187
|
+
report({
|
|
188
|
+
component,
|
|
189
|
+
support: "invalid",
|
|
190
|
+
message
|
|
148
191
|
});
|
|
149
192
|
}
|
|
150
193
|
};
|
|
@@ -153,47 +196,119 @@ function inspectAgentPlugin(rootDir, dataDir = join(rootDir, ".inspection-data")
|
|
|
153
196
|
lstatSync(path);
|
|
154
197
|
return true;
|
|
155
198
|
} catch (error) {
|
|
156
|
-
if (error.code
|
|
199
|
+
if (["ENOENT", "ENOTDIR"].includes(error.code ?? "")) return false;
|
|
157
200
|
throw error;
|
|
158
201
|
}
|
|
159
202
|
};
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
const filePath = containedPath(root, join(dir, "SKILL.md"));
|
|
168
|
-
const match = readPackageFile(root, filePath).match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);
|
|
203
|
+
const seenSkills = /* @__PURE__ */ new Set();
|
|
204
|
+
for (const skillsDir of layout.skillRoots) attempt("skills", () => {
|
|
205
|
+
const files = layout.dialect === "portable" ? readdirSync(skillsDir).sort().map((name) => join(skillsDir, name, "SKILL.md")).filter(present) : collectPluginSkillFiles(skillsDir, (path) => containedPath(root, path));
|
|
206
|
+
for (const file of files) attempt(`skill:${file.slice(root.length + 1)}`, () => {
|
|
207
|
+
const filePath = containedPath(root, file);
|
|
208
|
+
const content = readPackageFile(root, filePath);
|
|
209
|
+
const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);
|
|
169
210
|
if (!match) throw new Error("Skill requires YAML frontmatter");
|
|
170
|
-
const
|
|
211
|
+
const parsed = yaml.load(match[1], { schema: yaml.JSON_SCHEMA });
|
|
212
|
+
const metadata = (layout.dialect === "portable" ? z.object({
|
|
171
213
|
name: z.string().min(1).max(64).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
172
214
|
description: z.string().min(1).max(1024),
|
|
173
215
|
license: z.string().optional(),
|
|
174
216
|
compatibility: z.string().min(1).max(500).optional(),
|
|
175
217
|
metadata: strings.optional(),
|
|
176
218
|
"allowed-tools": z.string().optional()
|
|
177
|
-
})
|
|
178
|
-
|
|
219
|
+
}) : z.object({
|
|
220
|
+
name: z.string().min(1).max(64).optional(),
|
|
221
|
+
description: z.string().min(1).max(1024)
|
|
222
|
+
})).parse(parsed);
|
|
223
|
+
const name = metadata.name ?? dirname(filePath).split(/[\\/]/).pop();
|
|
224
|
+
if (layout.dialect === "portable" && metadata.name !== dirname(filePath).split(/[\\/]/).pop()) throw new Error("Skill name must match its directory");
|
|
225
|
+
if (!metadata.description.trim() || seenSkills.has(name)) throw new Error("Blank description or duplicate skill name");
|
|
226
|
+
seenSkills.add(name);
|
|
179
227
|
result.skills.push({
|
|
180
228
|
name,
|
|
181
229
|
filePath
|
|
182
230
|
});
|
|
231
|
+
const references = [...new Set(content.match(/\bmcp__[A-Za-z0-9_-]+__[A-Za-z0-9_-]+|\bfunctions\.(?:exec_command|apply_patch|spawn_agent|send_input|wait_agent)|\$\{(?:CLAUDE_)?PLUGIN_(?:ROOT|DATA|RESOURCES)\}/g) ?? [])].slice(0, 20);
|
|
232
|
+
const message = references.length ? `Host-specific references need execution verification: ${references.join(", ")}` : "Skill format accepted; business execution is not verified.";
|
|
233
|
+
report({
|
|
234
|
+
component: `skill:${name}`,
|
|
235
|
+
support: references.length ? "needs_adapter" : "supported",
|
|
236
|
+
message
|
|
237
|
+
});
|
|
238
|
+
if (references.length) diagnostics.push({
|
|
239
|
+
component: `skill:${name}`,
|
|
240
|
+
message
|
|
241
|
+
});
|
|
183
242
|
});
|
|
184
243
|
});
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
const mcp = z.strictObject({
|
|
244
|
+
for (const rawConfig of layout.mcpConfigs) attempt("mcp", () => {
|
|
245
|
+
const mcp = layout.dialect === "portable" && present(join(root, "mcp.json")) ? z.strictObject({
|
|
188
246
|
$schema: z.literal(MCP_SCHEMA),
|
|
189
247
|
mcpServers: z.record(z.string(), z.unknown())
|
|
190
|
-
}).parse(
|
|
191
|
-
for (const [name,
|
|
248
|
+
}).parse(rawConfig) : z.object({ mcpServers: z.record(z.string(), z.unknown()) }).parse(rawConfig);
|
|
249
|
+
for (const [name, value] of Object.entries(mcp.mcpServers)) attempt(`mcp:${name}`, () => {
|
|
250
|
+
delete result.servers[name];
|
|
251
|
+
let incomplete = false;
|
|
252
|
+
const rawServer = normalizePluginMcpServer(value, layout.dialect !== "portable", (message) => {
|
|
253
|
+
incomplete = true;
|
|
254
|
+
diagnostics.push({
|
|
255
|
+
component: `mcp:${name}`,
|
|
256
|
+
message
|
|
257
|
+
});
|
|
258
|
+
});
|
|
192
259
|
result.servers[name] = validatePluginServer(rawServer, root, dataDir);
|
|
260
|
+
report({
|
|
261
|
+
component: `mcp:${name}`,
|
|
262
|
+
support: incomplete ? "needs_adapter" : "supported",
|
|
263
|
+
message: incomplete ? "Some MCP declarations require adaptation." : "MCP configuration accepted; connection and tools require setup."
|
|
264
|
+
});
|
|
193
265
|
});
|
|
194
266
|
});
|
|
195
267
|
for (const skill of result.skills) result.capabilities.push(`content.skills:${skill.name}`);
|
|
196
|
-
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 ?? {})}`);
|
|
268
|
+
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 ?? {})}:${JSON.stringify(server.oauth ?? {})}:${JSON.stringify(server.connectionAuth ?? {})}`);
|
|
269
|
+
attempt("resources", () => {
|
|
270
|
+
result.resources = pluginResources(result);
|
|
271
|
+
for (const resource of result.resources) {
|
|
272
|
+
const supported = (!resource.platform || resource.platform === process.platform) && (!resource.arch || resource.arch === process.arch);
|
|
273
|
+
report({
|
|
274
|
+
component: `resource:${resource.id}`,
|
|
275
|
+
support: supported ? "supported" : "unsupported",
|
|
276
|
+
message: supported ? "Pinned resource declaration accepted." : "Resource does not support this host platform or architecture."
|
|
277
|
+
});
|
|
278
|
+
if (!supported) diagnostics.push({
|
|
279
|
+
component: `resource:${resource.id}`,
|
|
280
|
+
message: "Resource does not support this host platform or architecture."
|
|
281
|
+
});
|
|
282
|
+
result.capabilities.push(`${resource.executable ? "runtime.resource" : "network.resource"}:${resource.id}:${resource.url}:${resource.sha256}:${resource.maxBytes}:${resource.platform ?? "any"}:${resource.arch ?? "any"}`);
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
attempt("authorizations", () => {
|
|
286
|
+
const declarations = pluginAuthorizations(manifest);
|
|
287
|
+
const ids = /* @__PURE__ */ new Set();
|
|
288
|
+
for (const authorization of declarations) {
|
|
289
|
+
if (ids.has(authorization.id) || authorization.servers.some((name) => !result.servers[name])) throw new Error("Invalid or duplicate authorization target");
|
|
290
|
+
ids.add(authorization.id);
|
|
291
|
+
const methods = /* @__PURE__ */ new Set();
|
|
292
|
+
for (const method of authorization.methods) {
|
|
293
|
+
if (methods.has(method.id)) throw new Error("Duplicate authorization method");
|
|
294
|
+
methods.add(method.id);
|
|
295
|
+
if (method.helpUrl) safeAuthorizationUrl(method.helpUrl);
|
|
296
|
+
if ((method.type === "form" || method.type === "cli") && method.fields.some((key) => !layout.userConfig[key])) throw new Error("Authorization field is not declared in userConfig");
|
|
297
|
+
if (method.type === "oauth" && (!authorization.servers.includes(method.server) || result.servers[method.server]?.type === "stdio")) throw new Error("OAuth requires a remote MCP server");
|
|
298
|
+
if (method.type === "cli") {
|
|
299
|
+
validatePluginServer({
|
|
300
|
+
type: "stdio",
|
|
301
|
+
...method.login
|
|
302
|
+
}, root, dataDir);
|
|
303
|
+
validatePluginServer({
|
|
304
|
+
type: "stdio",
|
|
305
|
+
...method.check
|
|
306
|
+
}, root, dataDir);
|
|
307
|
+
result.capabilities.push(`runtime.authorization:${authorization.id}:${JSON.stringify(method)}`);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
});
|
|
197
312
|
result.capabilities.sort();
|
|
198
313
|
return result;
|
|
199
314
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { normalizeAgentId, validateAgentIdForNewAgent } from "../agent-catalog/id.js";
|
|
2
2
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
3
3
|
import { init_agent_scope, listAgentEntries, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath } from "../agent/agent-scope.js";
|
|
4
|
-
import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
5
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
6
4
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
5
|
+
import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
7
6
|
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
7
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
8
8
|
import { GATEWAY_BUILTIN_TOOL_IDS } from "./agent-builtin-tools.js";
|
|
9
9
|
import { resolve } from "node:path";
|
|
10
10
|
import { mkdir, readFile, realpath, stat, unlink, writeFile } from "node:fs/promises";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { ContextPlanningConfigSchema, KnowledgeMemoryConfigSchema, UserModelConfigSchema, init_config } from "../../../user-context/config.js";
|
|
1
2
|
import { normalizeAgentId } from "../../../agent-catalog/id.js";
|
|
2
3
|
import { AgentCatalogRepository, init_repository } from "../../../agent-catalog/repository.js";
|
|
3
4
|
import { init_agent_scope, listAgentEntries, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
4
|
-
import { ContextPlanningConfigSchema, KnowledgeMemoryConfigSchema, UserModelConfigSchema, init_config } from "../../../user-context/config.js";
|
|
5
5
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
6
6
|
import { init_models_json, loadModelsJson } from "../../../config/models-json.js";
|
|
7
7
|
import { CredentialResolver, init_credentials } from "../../../auth/credentials.js";
|
|
@@ -1,17 +1,28 @@
|
|
|
1
|
+
import { getWorkspacePath } from "../../../config/workspace-path-helpers.js";
|
|
2
|
+
import { PluginSelectionRequired } from "../../../extensions/agent-plugins/source-catalog.js";
|
|
1
3
|
import { AgentPluginStore } from "../../../extensions/agent-plugins/store.js";
|
|
2
4
|
import { savePluginAuthBinding } from "../../../extensions/agent-plugins/auth.js";
|
|
3
5
|
import { evictAllEmbeddedSessionRunners } from "../../../agent/embedded/session-runner.js";
|
|
4
|
-
import { withAgentPluginSource } from "../../../extensions/agent-plugins/sources.js";
|
|
5
6
|
import { agentPluginInventoryRow } from "../../../extensions/agent-plugins/inventory.js";
|
|
7
|
+
import { withAgentPluginSource } from "../../../extensions/agent-plugins/sources.js";
|
|
8
|
+
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
9
|
+
import { cancelPluginCliAuthorizations } from "../../../extensions/agent-plugins/cli-authorization.js";
|
|
10
|
+
import { PluginSetupService, setupActionSchema } from "../../../extensions/agent-plugins/setup.js";
|
|
6
11
|
import { removePluginCredentials } from "../../../extensions/agent-plugins/credentials.js";
|
|
7
12
|
import { z } from "zod";
|
|
8
13
|
//#region src/gateway/hono/routes/agent-plugins.ts
|
|
9
14
|
const sourceBody = z.strictObject({
|
|
10
15
|
source: z.string().min(1),
|
|
11
|
-
reviewHash: z.string().optional()
|
|
16
|
+
reviewHash: z.string().optional(),
|
|
17
|
+
setup: z.boolean().optional()
|
|
12
18
|
});
|
|
19
|
+
function setupOwner(c) {
|
|
20
|
+
const principal = getGatewayPrincipal(c);
|
|
21
|
+
return principal.kind === "owner" ? "gateway-owner" : principal.principalId;
|
|
22
|
+
}
|
|
13
23
|
function registerAgentPluginRoutes(app, deps) {
|
|
14
24
|
const store = new AgentPluginStore();
|
|
25
|
+
const setup = new PluginSetupService(store);
|
|
15
26
|
const refresh = async () => {
|
|
16
27
|
evictAllEmbeddedSessionRunners();
|
|
17
28
|
deps.service.marketplace.reloadSkills();
|
|
@@ -21,9 +32,16 @@ function registerAgentPluginRoutes(app, deps) {
|
|
|
21
32
|
const body = sourceBody.parse(await c.req.json());
|
|
22
33
|
return c.json({
|
|
23
34
|
ok: true,
|
|
24
|
-
payload: await withAgentPluginSource(body.source, deps.service.currentConfig, (source) =>
|
|
35
|
+
payload: await withAgentPluginSource(body.source, deps.service.currentConfig, (source, _provenance, resolvedCommit, importManifest) => ({
|
|
36
|
+
...store.inspect(source, body.source, importManifest),
|
|
37
|
+
resolvedCommit
|
|
38
|
+
}))
|
|
25
39
|
});
|
|
26
40
|
} catch (error) {
|
|
41
|
+
if (error instanceof PluginSelectionRequired) return c.json({
|
|
42
|
+
ok: true,
|
|
43
|
+
payload: { candidates: error.candidates }
|
|
44
|
+
});
|
|
27
45
|
return c.json({
|
|
28
46
|
ok: false,
|
|
29
47
|
error: error instanceof Error ? error.message : String(error)
|
|
@@ -33,15 +51,18 @@ function registerAgentPluginRoutes(app, deps) {
|
|
|
33
51
|
app.post("/api/extensions/install", deps.strictRateLimitMiddleware, async (c) => {
|
|
34
52
|
try {
|
|
35
53
|
const body = sourceBody.parse(await c.req.json());
|
|
36
|
-
const plugin = await withAgentPluginSource(body.source, deps.service.currentConfig, (source, provenance) => store.install(source, {
|
|
54
|
+
const plugin = await withAgentPluginSource(body.source, deps.service.currentConfig, (source, provenance, resolvedCommit, importManifest) => store.install(source, {
|
|
37
55
|
reviewHash: body.reviewHash,
|
|
38
56
|
sourceLabel: body.source,
|
|
39
|
-
provenance
|
|
57
|
+
provenance,
|
|
58
|
+
resolvedCommit,
|
|
59
|
+
importManifest
|
|
40
60
|
}));
|
|
61
|
+
if (body.setup && plugin.readiness !== "blocked") setup.create(plugin.id, setupOwner(c));
|
|
41
62
|
await refresh();
|
|
42
63
|
return c.json({
|
|
43
64
|
ok: true,
|
|
44
|
-
payload: agentPluginInventoryRow(plugin)
|
|
65
|
+
payload: agentPluginInventoryRow(store.get(plugin.id))
|
|
45
66
|
});
|
|
46
67
|
} catch (error) {
|
|
47
68
|
return c.json({
|
|
@@ -52,7 +73,7 @@ function registerAgentPluginRoutes(app, deps) {
|
|
|
52
73
|
});
|
|
53
74
|
app.get("/api/extensions/agent-plugins/:id", (c) => {
|
|
54
75
|
try {
|
|
55
|
-
const plugin = store.get(c.req.param("id"));
|
|
76
|
+
const plugin = store.pending(c.req.param("id")) ?? store.get(c.req.param("id"));
|
|
56
77
|
return plugin ? c.json({
|
|
57
78
|
ok: true,
|
|
58
79
|
payload: agentPluginInventoryRow(plugin)
|
|
@@ -67,9 +88,91 @@ function registerAgentPluginRoutes(app, deps) {
|
|
|
67
88
|
}, 400);
|
|
68
89
|
}
|
|
69
90
|
});
|
|
91
|
+
app.get("/api/extensions/agent-plugins/:id/setup", (c) => {
|
|
92
|
+
try {
|
|
93
|
+
const id = c.req.param("id"), job = setup.get(id, setupOwner(c));
|
|
94
|
+
const plugin = store.pending(id) ?? store.get(id);
|
|
95
|
+
return c.json({
|
|
96
|
+
ok: true,
|
|
97
|
+
payload: job?.packageRevision === plugin?.receipt.revision ? job : null
|
|
98
|
+
});
|
|
99
|
+
} catch {
|
|
100
|
+
return c.json({
|
|
101
|
+
ok: false,
|
|
102
|
+
error: "Setup unavailable"
|
|
103
|
+
}, 403);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
app.get("/api/extensions/agent-plugins/:id/setup/reusable", async (c) => {
|
|
107
|
+
try {
|
|
108
|
+
return c.json({
|
|
109
|
+
ok: true,
|
|
110
|
+
payload: await setup.reusableConnections(c.req.param("id"), setupOwner(c), deps.service.currentConfig)
|
|
111
|
+
});
|
|
112
|
+
} catch {
|
|
113
|
+
return c.json({
|
|
114
|
+
ok: false,
|
|
115
|
+
error: "Reusable connections unavailable"
|
|
116
|
+
}, 400);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
app.post("/api/extensions/agent-plugins/:id/setup", deps.strictRateLimitMiddleware, async (c) => {
|
|
120
|
+
try {
|
|
121
|
+
const id = c.req.param("id"), owner = setupOwner(c);
|
|
122
|
+
const body = await c.req.json();
|
|
123
|
+
if (body.action === "start") return c.json({
|
|
124
|
+
ok: true,
|
|
125
|
+
payload: setup.create(id, owner)
|
|
126
|
+
});
|
|
127
|
+
const action = setupActionSchema.parse(body);
|
|
128
|
+
if (action.action === "prepare") return c.json({
|
|
129
|
+
ok: true,
|
|
130
|
+
payload: setup.startPrepare(id, owner, action.expectedRevision, deps.service.currentConfig, getWorkspacePath(deps.service.currentConfig) || process.cwd(), action.idempotencyKey)
|
|
131
|
+
});
|
|
132
|
+
const job = await setup.act(id, owner, action, deps.service.currentConfig, getWorkspacePath(deps.service.currentConfig) || process.cwd());
|
|
133
|
+
await refresh();
|
|
134
|
+
return c.json({
|
|
135
|
+
ok: true,
|
|
136
|
+
payload: job
|
|
137
|
+
});
|
|
138
|
+
} catch (error) {
|
|
139
|
+
return c.json({
|
|
140
|
+
ok: false,
|
|
141
|
+
error: error instanceof Error ? error.message : "Setup failed"
|
|
142
|
+
}, 400);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
app.get("/api/extensions/agent-plugins/:id/setup/auth/:server", async (c) => {
|
|
146
|
+
try {
|
|
147
|
+
const result = await setup.authorization(c.req.param("id"), setupOwner(c), c.req.param("server"), deps.service.currentConfig);
|
|
148
|
+
return c.json({
|
|
149
|
+
ok: true,
|
|
150
|
+
payload: result ?? null
|
|
151
|
+
});
|
|
152
|
+
} catch {
|
|
153
|
+
return c.json({
|
|
154
|
+
ok: false,
|
|
155
|
+
error: "Authorization unavailable"
|
|
156
|
+
}, 400);
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
app.post("/api/extensions/agent-plugins/:id/setup/auth/:server/redirect", deps.strictRateLimitMiddleware, async (c) => {
|
|
160
|
+
try {
|
|
161
|
+
const body = z.strictObject({ url: z.string().max(16384) }).parse(await c.req.json());
|
|
162
|
+
if (!setup.redirect(c.req.param("id"), setupOwner(c), c.req.param("server"), body.url, deps.service.currentConfig)) throw new Error("Callback does not match this sign-in");
|
|
163
|
+
return c.json({ ok: true });
|
|
164
|
+
} catch {
|
|
165
|
+
return c.json({
|
|
166
|
+
ok: false,
|
|
167
|
+
error: "Invalid sign-in callback"
|
|
168
|
+
}, 400);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
70
171
|
app.post("/api/extensions/agent-plugins/:id/activation", deps.strictRateLimitMiddleware, async (c) => {
|
|
71
172
|
try {
|
|
72
173
|
const body = z.strictObject({ enabled: z.boolean() }).parse(await c.req.json());
|
|
174
|
+
const job = setup.get(c.req.param("id"), setupOwner(c));
|
|
175
|
+
if (body.enabled && job?.packageRevision === store.receipt(c.req.param("id"))?.revision && job.state !== "completed") throw new Error("Finish plugin setup before enabling");
|
|
73
176
|
const plugin = store.setEnabled(c.req.param("id"), body.enabled);
|
|
74
177
|
await refresh();
|
|
75
178
|
return c.json({
|
|
@@ -86,17 +189,21 @@ function registerAgentPluginRoutes(app, deps) {
|
|
|
86
189
|
app.post("/api/extensions/agent-plugins/:id/update", deps.strictRateLimitMiddleware, async (c) => {
|
|
87
190
|
try {
|
|
88
191
|
const body = sourceBody.parse(await c.req.json());
|
|
89
|
-
const plugin = await withAgentPluginSource(body.source, deps.service.currentConfig, (source, provenance) => store.install(source, {
|
|
192
|
+
const plugin = await withAgentPluginSource(body.source, deps.service.currentConfig, (source, provenance, resolvedCommit, importManifest) => store.install(source, {
|
|
90
193
|
reviewHash: body.reviewHash,
|
|
91
194
|
replace: true,
|
|
92
195
|
expectedId: c.req.param("id"),
|
|
196
|
+
stage: body.setup,
|
|
93
197
|
sourceLabel: body.source,
|
|
94
|
-
provenance
|
|
198
|
+
provenance,
|
|
199
|
+
resolvedCommit,
|
|
200
|
+
importManifest
|
|
95
201
|
}));
|
|
202
|
+
if (body.setup && plugin.readiness !== "blocked") setup.create(plugin.id, setupOwner(c));
|
|
96
203
|
await refresh();
|
|
97
204
|
return c.json({
|
|
98
205
|
ok: true,
|
|
99
|
-
payload: agentPluginInventoryRow(plugin)
|
|
206
|
+
payload: agentPluginInventoryRow(store.pending(plugin.id) ?? store.get(plugin.id))
|
|
100
207
|
});
|
|
101
208
|
} catch (error) {
|
|
102
209
|
return c.json({
|
|
@@ -131,7 +238,10 @@ function registerAgentPluginRoutes(app, deps) {
|
|
|
131
238
|
prefix: z.string().optional()
|
|
132
239
|
})).max(20).optional()
|
|
133
240
|
}).parse(await c.req.json());
|
|
241
|
+
const owner = setupOwner(c);
|
|
242
|
+
setup.get(c.req.param("id"), owner);
|
|
134
243
|
await savePluginAuthBinding(store, c.req.param("id"), c.req.param("server"), body);
|
|
244
|
+
setup.invalidateConnection(c.req.param("id"), owner, c.req.param("server"));
|
|
135
245
|
await refresh();
|
|
136
246
|
return c.json({ ok: true });
|
|
137
247
|
} catch (error) {
|
|
@@ -143,6 +253,7 @@ function registerAgentPluginRoutes(app, deps) {
|
|
|
143
253
|
});
|
|
144
254
|
app.delete("/api/extensions/agent-plugins/:id", deps.strictRateLimitMiddleware, async (c) => {
|
|
145
255
|
try {
|
|
256
|
+
cancelPluginCliAuthorizations(c.req.param("id"));
|
|
146
257
|
const body = z.strictObject({
|
|
147
258
|
removeData: z.boolean().optional(),
|
|
148
259
|
removeCredentials: z.boolean().optional()
|
|
@@ -3,11 +3,11 @@ import { ActivationPlanner } from "../../../extensions/activation-planner.js";
|
|
|
3
3
|
import { mergeActivationContext } from "../../../extensions/activation-context.js";
|
|
4
4
|
import { validateExtensionConfig } from "../../../extensions/config-validation.js";
|
|
5
5
|
import { fetchRegistry, listExtensions, searchExtensions } from "../../../extensions/marketplace.js";
|
|
6
|
+
import { listAgentPluginInventory } from "../../../extensions/agent-plugins/inventory.js";
|
|
6
7
|
import { createOAuthAsyncHandler } from "../oauth-async.js";
|
|
7
8
|
import { createOAuthHandler } from "../oauth.js";
|
|
8
9
|
import { extensionAssetMimeType } from "../lib/extension-assets.js";
|
|
9
10
|
import { loadExtensionStore, saveExtensionStore } from "../lib/extension-store.js";
|
|
10
|
-
import { listAgentPluginInventory } from "../../../extensions/agent-plugins/inventory.js";
|
|
11
11
|
import { relative, resolve } from "node:path";
|
|
12
12
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
13
13
|
//#region src/gateway/hono/routes/auth-registry-extensions.ts
|