@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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { normalizeAgentId } from "../../agent-catalog/id.js";
|
|
4
|
-
import { init_agent_scope } from "../../agent/agent-scope.js";
|
|
5
3
|
import { init_session_key, resolveConversationId } from "../../routing/session-key.js";
|
|
6
4
|
import { init_model_usage, withModelUsageOrigin } from "../../providers/model-usage.js";
|
|
5
|
+
import { normalizeAgentId } from "../../agent-catalog/id.js";
|
|
6
|
+
import { init_agent_scope } from "../../agent/agent-scope.js";
|
|
7
7
|
import { resolveAutomationTimeoutSeconds } from "../domain/defaults.js";
|
|
8
8
|
//#region src/automations/service/action-executor.ts
|
|
9
9
|
init_model_usage();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { requireXopcDatabase } from "../storage/sqlite/connection.js";
|
|
2
2
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
3
3
|
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
4
|
+
import { ensureStarterAgentsInitialized } from "../agent/starter-agents.js";
|
|
4
5
|
import { cutoverLegacyAgentConfig } from "../agent-catalog/migrations/legacy-config-cutover.js";
|
|
5
6
|
import "../agent-catalog/index.js";
|
|
6
|
-
import { ensureStarterAgentsInitialized } from "../agent/starter-agents.js";
|
|
7
7
|
import { migrateIdentityMarkdownToCatalog } from "../agent-catalog/migrations/identity-markdown-cutover.js";
|
|
8
8
|
import { migrateCloudPublicModelsSync } from "../migrations/cloud-public-models.js";
|
|
9
9
|
import { runBootstrapMigrationsSync } from "../migrations/runner.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SqliteCommitEffectError, init_transaction } from "../../storage/sqlite/transaction.js";
|
|
2
|
-
import { OperationConflictError, executeAtomicOperation } from "./atomic-operations.js";
|
|
3
2
|
import { CapabilityError } from "./errors.js";
|
|
4
3
|
import { executeExternalOperation } from "./external-operations.js";
|
|
4
|
+
import { OperationConflictError, executeAtomicOperation } from "./atomic-operations.js";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/capabilities/runtime/dispatcher.ts
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CapabilityError } from "./errors.js";
|
|
2
2
|
import { CapabilityDispatcher } from "./dispatcher.js";
|
|
3
|
-
import { registerAgentCapabilities } from "../../agent-catalog/capabilities.js";
|
|
4
3
|
import { registerLocalAppReadCapabilities } from "../../local-apps/capabilities/read.js";
|
|
5
4
|
import { registerNoteReadCapabilities } from "../../notes/capabilities/read.js";
|
|
6
5
|
import { registerNoteWriteCapabilities } from "../../notes/capabilities/write.js";
|
|
@@ -17,6 +16,7 @@ import { registerAutomationDraftCapabilities } from "../../automations/capabilit
|
|
|
17
16
|
import { registerTaskWriteCapabilities } from "../../tasks/capabilities/write.js";
|
|
18
17
|
import { registerSettingsCapability } from "./settings.js";
|
|
19
18
|
import { registerAppContextCapability } from "./app-context.js";
|
|
19
|
+
import { registerAgentCapabilities } from "../../agent-catalog/capabilities.js";
|
|
20
20
|
//#region src/capabilities/runtime/product.ts
|
|
21
21
|
function createProductDispatcher(getNotes, taskWrites) {
|
|
22
22
|
const dispatcher = new CapabilityDispatcher();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../routing/agent-session-key.js";
|
|
1
2
|
import { normalizeAgentId } from "../agent-catalog/id.js";
|
|
2
3
|
import { init_agent_scope, resolveAgentProfileDir } from "../agent/agent-scope.js";
|
|
3
|
-
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../routing/agent-session-key.js";
|
|
4
4
|
import { WORKSPACE_FILES, init_paths } from "../config/paths.js";
|
|
5
5
|
import { commandRegistry } from "./registry.js";
|
|
6
6
|
import { join } from "node:path";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { init_agent_scope, resolveDefaultAgentId } from "../../agent/agent-scope.js";
|
|
4
3
|
import { init_agent_session_key, resolveAgentMainConversationId } from "../../routing/agent-session-key.js";
|
|
4
|
+
import { init_agent_scope, resolveDefaultAgentId } from "../../agent/agent-scope.js";
|
|
5
5
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
6
6
|
import { getWorkspacePath } from "../../config/workspace-path-helpers.js";
|
|
7
7
|
import { ExtensionLoader } from "../../extensions/loader.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
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, resolveAgentDir, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../../agent/agent-scope.js";
|
|
4
|
-
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
5
4
|
import { resolveEffectiveAgentConfigForAgent } from "../../config/agent-profile.js";
|
|
5
|
+
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
6
6
|
import { colors } from "../utils/colors.js";
|
|
7
7
|
//#region src/cli/commands/agents.ts
|
|
8
8
|
init_repository();
|
|
@@ -53,7 +53,7 @@ async function checkDatabaseSchema(ctx) {
|
|
|
53
53
|
id: "database-schema",
|
|
54
54
|
label: "Database schema",
|
|
55
55
|
status: "pass",
|
|
56
|
-
message: `SQLite schema v${status.dbVersion} (current release
|
|
56
|
+
message: `SQLite schema v${status.dbVersion} (current release v257).`,
|
|
57
57
|
hints: []
|
|
58
58
|
};
|
|
59
59
|
}
|
|
@@ -1,24 +1,35 @@
|
|
|
1
|
+
import { getWorkspacePath } from "../../config/workspace-path-helpers.js";
|
|
2
|
+
import { pluginAuthorizations } from "../../extensions/agent-plugins/setup-contract.js";
|
|
3
|
+
import { PLUGIN_MANIFEST_PATHS } from "../../extensions/agent-plugins/formats.js";
|
|
4
|
+
import { pluginServerId } from "../../extensions/agent-plugins/validation.js";
|
|
5
|
+
import { isGitPluginSource } from "../../extensions/agent-plugins/source-catalog.js";
|
|
1
6
|
import { AgentPluginStore } from "../../extensions/agent-plugins/store.js";
|
|
2
7
|
import { loadConfig } from "../../config/loader.js";
|
|
3
8
|
import { getContextWithOpts } from "../context.js";
|
|
4
9
|
import { isAgentPluginArchive, withAgentPluginSource } from "../../extensions/agent-plugins/sources.js";
|
|
10
|
+
import { PluginSetupService } from "../../extensions/agent-plugins/setup.js";
|
|
5
11
|
import { removePluginCredentials } from "../../extensions/agent-plugins/credentials.js";
|
|
6
12
|
import { join, resolve } from "node:path";
|
|
7
13
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
14
|
+
import { readFile } from "node:fs/promises";
|
|
8
15
|
import { confirm } from "@inquirer/prompts";
|
|
9
16
|
//#region src/cli/commands/extension-agent-plugin.ts
|
|
10
17
|
function isAgentPluginSource(source) {
|
|
11
|
-
if (source.startsWith("https://")) return true;
|
|
18
|
+
if (source.startsWith("https://") || isGitPluginSource(source) || source.includes("#plugin=")) return true;
|
|
12
19
|
const path = resolve(source);
|
|
13
20
|
if (existsSync(join(path, "package.json"))) {
|
|
14
21
|
if (JSON.parse(readFileSync(join(path, "package.json"), "utf8"))?.xopc?.extension) return false;
|
|
15
22
|
}
|
|
16
|
-
return existsSync(path) && (statSync(path).isFile() && /\.zip$/i.test(path) && statSync(path).size <= 50 * 1024 * 1024 && isAgentPluginArchive(readFileSync(path)) ||
|
|
23
|
+
return existsSync(path) && (statSync(path).isFile() && /\.zip$/i.test(path) && statSync(path).size <= 50 * 1024 * 1024 && isAgentPluginArchive(readFileSync(path)) || [
|
|
24
|
+
...PLUGIN_MANIFEST_PATHS,
|
|
25
|
+
".agents/plugins/marketplace.json",
|
|
26
|
+
".claude-plugin/marketplace.json"
|
|
27
|
+
].some((file) => existsSync(join(path, file))) && !existsSync(join(path, "xopc.extension.json")));
|
|
17
28
|
}
|
|
18
29
|
async function installAgentPluginFromCli(source, options) {
|
|
19
30
|
const store = new AgentPluginStore();
|
|
20
31
|
const cfg = loadConfig(getContextWithOpts().configPath);
|
|
21
|
-
const plan = await withAgentPluginSource(source, cfg, (local) => store.inspect(local));
|
|
32
|
+
const plan = await withAgentPluginSource(source, cfg, (local, _p, _commit, importManifest) => store.inspect(local, source, importManifest));
|
|
22
33
|
console.log(JSON.stringify({
|
|
23
34
|
format: "agent-plugin",
|
|
24
35
|
name: plan.manifest.name,
|
|
@@ -34,22 +45,96 @@ async function installAgentPluginFromCli(source, options) {
|
|
|
34
45
|
default: false
|
|
35
46
|
})) return;
|
|
36
47
|
}
|
|
37
|
-
const plugin = await withAgentPluginSource(source, cfg, (local, provenance) => store.install(local, {
|
|
48
|
+
const plugin = await withAgentPluginSource(source, cfg, (local, provenance, resolvedCommit, importManifest) => store.install(local, {
|
|
38
49
|
reviewHash: plan.reviewHash,
|
|
39
50
|
replace: options.force,
|
|
51
|
+
stage: options.force,
|
|
40
52
|
expectedId: options.expectedId,
|
|
41
|
-
sourceLabel: source
|
|
42
|
-
provenance
|
|
53
|
+
sourceLabel: source,
|
|
54
|
+
provenance,
|
|
55
|
+
resolvedCommit,
|
|
56
|
+
importManifest
|
|
43
57
|
}));
|
|
58
|
+
if (plugin.readiness !== "blocked") new PluginSetupService(store).create(plugin.id, "gateway-owner");
|
|
44
59
|
console.log(`Installed plugin:${plugin.id} (${plugin.receipt.enabled ? "enabled" : "disabled"}).`);
|
|
60
|
+
if (plugin.readiness !== "blocked") console.log(`Continue with: xopc extensions setup plugin:${plugin.id} --prepare`);
|
|
45
61
|
return plugin;
|
|
46
62
|
}
|
|
47
63
|
function addAgentPluginLifecycleCommands(command) {
|
|
64
|
+
command.command("setup").argument("<id>", "plugin:<id>").option("--prepare", "Prepare resources and check tools").option("--authorize <server>", "Authorize a plugin account or show native MCP sign-in instructions").option("--method <id>", "Choose one of the account authorization methods").option("--skip-auth", "Finish installation and authorize later in plugin details").option("--complete", "Finish setup and enable globally for all agents").option("--workspace <paths...>", "Restrict the plugin to these workspace paths").option("--config-file <path>", "Read typed user configuration from a JSON file").option("--allow-partial", "Enable available components after reviewing compatibility limits").option("--cancel", "Cancel preparation").action(async (raw, options) => {
|
|
65
|
+
const store = new AgentPluginStore(), setup = new PluginSetupService(store), id = raw.replace(/^plugin:/, "");
|
|
66
|
+
const cfg = loadConfig(getContextWithOpts().configPath), workspace = getWorkspacePath(cfg) || process.cwd(), owner = "gateway-owner";
|
|
67
|
+
let job = setup.create(id, owner);
|
|
68
|
+
const declaration = pluginAuthorizations((store.pending(id) ?? store.get(id)).manifest).find((value) => value.id === options.authorize);
|
|
69
|
+
const method = declaration?.methods.find((value) => value.id === (options.method ?? declaration.methods[0]?.id));
|
|
70
|
+
if (options.configFile) job = await setup.act(id, owner, {
|
|
71
|
+
action: "configure",
|
|
72
|
+
expectedRevision: job.revision,
|
|
73
|
+
values: JSON.parse(await readFile(options.configFile, "utf8")),
|
|
74
|
+
...method?.type === "form" ? {
|
|
75
|
+
authorization: declaration.id,
|
|
76
|
+
method: method.id
|
|
77
|
+
} : {}
|
|
78
|
+
}, cfg, workspace);
|
|
79
|
+
if (options.prepare || declaration) job = await setup.act(id, owner, {
|
|
80
|
+
action: "prepare",
|
|
81
|
+
expectedRevision: job.revision
|
|
82
|
+
}, cfg, workspace);
|
|
83
|
+
if (options.authorize) if (declaration) {
|
|
84
|
+
if (!method) throw new Error("Unknown authorization method");
|
|
85
|
+
if (method.type !== "form") {
|
|
86
|
+
job = await setup.act(id, owner, {
|
|
87
|
+
action: "authorize",
|
|
88
|
+
expectedRevision: job.revision,
|
|
89
|
+
server: declaration.id,
|
|
90
|
+
method: method.id
|
|
91
|
+
}, cfg, workspace);
|
|
92
|
+
let lastUrl = "";
|
|
93
|
+
for (;;) {
|
|
94
|
+
const attempt = await setup.authorization(id, owner, declaration.id, cfg);
|
|
95
|
+
if (!attempt) throw new Error("Sign-in is unavailable. Retry authorization.");
|
|
96
|
+
const url = "challenge" in attempt ? attempt.challenge?.url : "authorizationUrl" in attempt ? attempt.authorizationUrl : void 0;
|
|
97
|
+
if (url && url !== lastUrl) {
|
|
98
|
+
console.log(`Complete sign-in: ${url}`);
|
|
99
|
+
lastUrl = url;
|
|
100
|
+
}
|
|
101
|
+
if (attempt.state === "connected") break;
|
|
102
|
+
if (["cancelled", "error"].includes(attempt.state)) throw new Error("Sign-in did not complete. Retry authorization.");
|
|
103
|
+
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
104
|
+
}
|
|
105
|
+
job = await setup.act(id, owner, {
|
|
106
|
+
action: "prepare",
|
|
107
|
+
expectedRevision: job.revision
|
|
108
|
+
}, cfg, workspace);
|
|
109
|
+
} else if (!options.configFile) throw new Error("Provide credential fields with --config-file");
|
|
110
|
+
} else {
|
|
111
|
+
if (!job.connections.some((c) => c.name === options.authorize)) throw new Error("Unknown plugin MCP server");
|
|
112
|
+
console.log(`Sign in with: xopc mcp login ${pluginServerId(id, options.authorize)}`);
|
|
113
|
+
}
|
|
114
|
+
if (options.complete) job = await setup.act(id, owner, {
|
|
115
|
+
action: "complete",
|
|
116
|
+
expectedRevision: job.revision,
|
|
117
|
+
workspacePaths: options.workspace,
|
|
118
|
+
allowPartial: options.allowPartial === true
|
|
119
|
+
}, cfg, workspace);
|
|
120
|
+
if (options.skipAuth) job = await setup.act(id, owner, {
|
|
121
|
+
action: "defer",
|
|
122
|
+
expectedRevision: job.revision
|
|
123
|
+
}, cfg, workspace);
|
|
124
|
+
if (options.cancel) job = await setup.act(id, owner, {
|
|
125
|
+
action: "cancel",
|
|
126
|
+
expectedRevision: job.revision
|
|
127
|
+
}, cfg, workspace);
|
|
128
|
+
console.log(JSON.stringify(job, null, 2));
|
|
129
|
+
});
|
|
48
130
|
command.command("rollback").argument("<id>", "plugin:<name>").action((raw) => {
|
|
49
131
|
console.log(JSON.stringify(new AgentPluginStore().rollback(raw.replace(/^plugin:/, "")), null, 2));
|
|
50
132
|
});
|
|
51
133
|
for (const action of ["enable", "disable"]) command.command(action).argument("<id>", "plugin:<name>").action((raw) => {
|
|
52
|
-
const
|
|
134
|
+
const store = new AgentPluginStore(), id = raw.replace(/^plugin:/, "");
|
|
135
|
+
const job = new PluginSetupService(store).get(id, "gateway-owner");
|
|
136
|
+
if (action === "enable" && job && job.state !== "completed") throw new Error("Finish plugin setup before enabling");
|
|
137
|
+
const plugin = store.setEnabled(id, action === "enable");
|
|
53
138
|
console.log(`${plugin.id}: ${action}d`);
|
|
54
139
|
});
|
|
55
140
|
command.command("remove").argument("<id>", "plugin:<name>").option("--remove-data", "Also remove persistent plugin data").option("--remove-credentials", "Also delete local credentials").action(async (raw, options) => {
|
|
@@ -224,7 +224,7 @@ async function installExtensionFromStoreWithLock(params) {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
function createExtensionInstallCommand() {
|
|
227
|
-
return new Command("install").description("Install a native extension or portable Agent Plugin
|
|
227
|
+
return new Command("install").description("Install a native extension or Codex, Claude or portable Agent Plugin").argument("<target>", "store:<id>, npm:<package>, Git / marketplace source, directory or plugin ZIP").option("-f, --force", "Replace an existing store or local extension with the same manifest id", false).option("-y, --yes", "Skip interactive install confirmation", false).action(async (target, opts) => {
|
|
228
228
|
if (isAgentPluginSource(target)) {
|
|
229
229
|
await installAgentPluginFromCli(target, opts);
|
|
230
230
|
return;
|
|
@@ -78,7 +78,7 @@ function createExtensionInspectCommand() {
|
|
|
78
78
|
try {
|
|
79
79
|
if (extensionId.startsWith("plugin:") || extensionId.startsWith("store:") || isAgentPluginSource(extensionId)) {
|
|
80
80
|
const store = new AgentPluginStore();
|
|
81
|
-
const result = extensionId.startsWith("plugin:") ? store.get(extensionId.slice(7)) : await withAgentPluginSource(extensionId, loadConfig(getContextWithOpts().configPath), (source) => store.inspect(source));
|
|
81
|
+
const result = extensionId.startsWith("plugin:") ? store.get(extensionId.slice(7)) : await withAgentPluginSource(extensionId, loadConfig(getContextWithOpts().configPath), (source, _p, _commit, importManifest) => store.inspect(source, extensionId, importManifest));
|
|
82
82
|
if (!result) throw new Error("Plugin not installed");
|
|
83
83
|
console.log(JSON.stringify(result, null, 2));
|
|
84
84
|
return;
|
|
@@ -3,6 +3,7 @@ import { loadConfig } from "../../config/loader.js";
|
|
|
3
3
|
import { register } from "../registry.js";
|
|
4
4
|
import { createGatewayHttpClientFromConfig } from "../../mcp/gateway-http-client.js";
|
|
5
5
|
import { createCapabilityMcpServer } from "../../mcp/capability-server.js";
|
|
6
|
+
import { resolveMcpSetupConfig } from "../../agent/mcp/effective-server.js";
|
|
6
7
|
import { join } from "node:path";
|
|
7
8
|
import { chmodSync, existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
8
9
|
import { main } from "@earendil-works/pi-coding-agent";
|
|
@@ -18,24 +19,25 @@ function createMcpCommand(ctx) {
|
|
|
18
19
|
]) {
|
|
19
20
|
const native = command.command(action).description(`Use pi's native MCP ${action}`);
|
|
20
21
|
if (action !== "list") native.argument("<server>", "Configured MCP server ID");
|
|
21
|
-
if (action === "list") native.option("--json", "Print pi MCP diagnostics as JSON");
|
|
22
|
+
if (action === "list") native.option("--json", "Print pi MCP diagnostics as JSON").option("--agent <id>", "Include plugins bound to this agent");
|
|
22
23
|
if (action === "login") native.option("--timeout <seconds>", "Browser sign-in timeout in seconds");
|
|
23
24
|
native.action(async (serverOrOptions, loginOptions) => {
|
|
24
25
|
const server = typeof serverOrOptions === "string" ? serverOrOptions : void 0;
|
|
25
26
|
const options = typeof serverOrOptions === "string" ? loginOptions : serverOrOptions;
|
|
26
|
-
const
|
|
27
|
+
const config = loadConfig(ctx.configPath);
|
|
28
|
+
const mcp = await prepareNativeMcpConfig(server ? resolveMcpSetupConfig(config, server) : config, ctx.workspacePath || process.cwd(), options?.agent);
|
|
27
29
|
if (mcp.errors.length) throw new Error(mcp.errors.join("\n"));
|
|
28
30
|
const path = join(getNativePiAgentDir(), "mcp.json");
|
|
29
31
|
if (existsSync(path) && JSON.parse(readFileSync(path, "utf8")).xopcGenerated !== true) throw new Error("The pi directory contains a user-managed mcp.json. Use a dedicated PI_CODING_AGENT_DIR for xopc.");
|
|
30
32
|
if (existsSync(path)) chmodSync(path, 384);
|
|
31
33
|
writeFileSync(path, JSON.stringify({
|
|
32
34
|
xopcGenerated: true,
|
|
33
|
-
mcpServers: Object.fromEntries(mcp.servers.map((entry) => [entry.name, entry.config]))
|
|
35
|
+
mcpServers: Object.fromEntries(mcp.servers.filter((entry) => !server || entry.name === server).map((entry) => [mcp.credentialAliases?.[entry.name] ?? entry.name, entry.config]))
|
|
34
36
|
}), { mode: 384 });
|
|
35
37
|
await main([
|
|
36
38
|
"mcp",
|
|
37
39
|
action,
|
|
38
|
-
...server ? [server] : [],
|
|
40
|
+
...server ? [mcp.credentialAliases?.[server] ?? server] : [],
|
|
39
41
|
...action === "list" && options?.json ? ["--json"] : [],
|
|
40
42
|
...action === "login" && loginOptions?.timeout ? ["--timeout", loginOptions.timeout] : []
|
|
41
43
|
]);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { creditDecimal } from "../../../packages/gateway-contract/src/cloud-credits.js";
|
|
2
2
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
3
|
import { AgentCatalogRepository, init_repository } from "../../agent-catalog/repository.js";
|
|
4
|
-
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
5
4
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
6
5
|
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
7
6
|
import { getAllModels, getAvailableModels, getConfiguredProviders, getProviderAuthState, getProviderDisplayName, init_providers, isProviderConfigured, providerSupportsApiKey, providerSupportsOAuth, resolveModel } from "../../providers/index.js";
|
|
8
7
|
import { XopcCloudAccountService } from "../../providers/xopc-cloud-account-service.js";
|
|
8
|
+
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
9
9
|
import { listImageProviderSpecs } from "../../../packages/image-providers/src/catalog.js";
|
|
10
10
|
import "../../../packages/image-providers/src/index.js";
|
|
11
11
|
import { loadConfig } from "../../config/loader.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AgentCatalogRepository, init_repository } from "../../../agent-catalog/repository.js";
|
|
2
|
-
import { AgentCatalogService } from "../../../agent-catalog/service.js";
|
|
3
2
|
import { ConfigSchema, getAgentDefaultModelRef, init_schema } from "../../../config/schema.js";
|
|
4
3
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
5
4
|
import { init_models_json, loadModelsJson, saveModelsJson } from "../../../config/models-json.js";
|
|
@@ -7,6 +6,7 @@ import { getApiKeyFromEnv } from "../../../providers/env-keys.js";
|
|
|
7
6
|
import { getModelRegistry } from "../../../providers/model-registry.js";
|
|
8
7
|
import { CredentialResolver, init_credentials } from "../../../auth/credentials.js";
|
|
9
8
|
import { getAllProviders, getModelsByProvider, getProviderDisplayName, init_providers, providerSupportsApiKey, providerSupportsOAuth } from "../../../providers/index.js";
|
|
9
|
+
import { AgentCatalogService } from "../../../agent-catalog/service.js";
|
|
10
10
|
import { prepareUpdateGlobalDefaults } from "../../../gateway/global-defaults-admin.js";
|
|
11
11
|
import { discoverProviderModels, isProviderApiDiscoverable } from "../../../providers/model-discovery.js";
|
|
12
12
|
import { getXopcCloudCatalogCoordinator } from "../../../providers/xopc-cloud-catalog-coordinator.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AgentCatalogRepository, init_repository } from "../../agent-catalog/repository.js";
|
|
2
|
-
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
3
2
|
import { ConfigSchema, init_schema } from "../../config/schema.js";
|
|
3
|
+
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
4
4
|
import { assertConfigRewriteSafeForRunningGateway, saveConfig } from "../../config/loader.js";
|
|
5
5
|
import { ensureStarterAgentsInitialized } from "../../agent/starter-agents.js";
|
|
6
6
|
import { bootstrapApplicationStateSync } from "../../bootstrap/application-state.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { getModelUsageOrigin, init_model_usage } from "../providers/model-usage.js";
|
|
1
2
|
import { ModelIntentSchema } from "../agent-config/schema.js";
|
|
2
3
|
import { init_agent_config } from "../agent-config/index.js";
|
|
3
|
-
import { getModelUsageOrigin, init_model_usage } from "../providers/model-usage.js";
|
|
4
4
|
import { resolveEffectiveAgentConfigForAgent } from "./agent-profile.js";
|
|
5
5
|
import { init_schema, parseModelRef } from "./schema.js";
|
|
6
6
|
//#region src/config/agent-model-intents.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { getConversationRouting } from "../storage/sqlite/conversation-repository.js";
|
|
2
|
+
import { init_session_key } from "../routing/session-key.js";
|
|
1
3
|
import { resolveEffectiveAgentConfig } from "../agent-config/resolver.js";
|
|
2
4
|
import { init_agent_config } from "../agent-config/index.js";
|
|
3
5
|
import { normalizeAgentId } from "../agent-catalog/id.js";
|
|
4
6
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
5
7
|
import { init_agent_scope, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
6
|
-
import { getConversationRouting } from "../storage/sqlite/conversation-repository.js";
|
|
7
|
-
import { init_session_key } from "../routing/session-key.js";
|
|
8
8
|
import { agentExists, getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
9
9
|
//#region src/config/agent-profile.ts
|
|
10
10
|
init_agent_config();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
4
3
|
import { ConfigSchema, init_schema } from "./schema.js";
|
|
4
|
+
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
5
5
|
import { init_paths, resolveConfigPath } from "./paths.js";
|
|
6
6
|
import { init_resolution, setActivePlatformDiscovery } from "../platform/resolution.js";
|
|
7
7
|
import { assertChannelPluginConfigs } from "./validate-channel-configs.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { init_write_file_atomic, writeTextAtomicSync } from "../infra/write-file-atomic.js";
|
|
3
2
|
import { ComputerProfileSchema, init_src } from "../../packages/computer-control-contract/src/index.js";
|
|
3
|
+
import { init_write_file_atomic, writeTextAtomicSync } from "../infra/write-file-atomic.js";
|
|
4
4
|
import { init_paths, resolveModelsJsonPath } from "./paths.js";
|
|
5
5
|
import { init_model_policy, isComputerModel } from "../computer/model-policy.js";
|
|
6
6
|
import { assertCurrentModelProvider, init_provider_policy } from "../providers/provider-policy.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { DEFAULT_CONTEXT_COMPACTION_POLICY, UserContextConfigSchema, init_config } from "../user-context/config.js";
|
|
3
|
+
import { getModelUsageOrigin, init_model_usage } from "../providers/model-usage.js";
|
|
2
4
|
import { AgentModelsOverrideSchema, ImageGenerationRouteSchema, ModelRouteSchema } from "../agent-config/schema.js";
|
|
3
5
|
import { resolveEffectiveAgentConfig } from "../agent-config/resolver.js";
|
|
4
6
|
import { init_agent_config } from "../agent-config/index.js";
|
|
5
7
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
6
|
-
import { DEFAULT_CONTEXT_COMPACTION_POLICY, UserContextConfigSchema, init_config } from "../user-context/config.js";
|
|
7
|
-
import { getModelUsageOrigin, init_model_usage } from "../providers/model-usage.js";
|
|
8
8
|
import { TracingConfigSchema, init_config as init_config$1 } from "../observability/config.js";
|
|
9
9
|
import { OutboundProxySchema, init_outbound_proxy } from "./outbound-proxy.js";
|
|
10
10
|
import { ComputerConfigSchema, init_config as init_config$2 } from "../computer/config.js";
|
|
@@ -9,6 +9,11 @@ declare const bindingSchema: z.ZodObject<{
|
|
|
9
9
|
}>;
|
|
10
10
|
identityScope: z.ZodLiteral<"owner">;
|
|
11
11
|
endpointFingerprint: z.ZodString;
|
|
12
|
+
oauthReference: z.ZodOptional<z.ZodObject<{
|
|
13
|
+
sourceServerId: z.ZodString;
|
|
14
|
+
credentialId: z.ZodString;
|
|
15
|
+
fingerprint: z.ZodString;
|
|
16
|
+
}, z.core.$strict>>;
|
|
12
17
|
fields: z.ZodArray<z.ZodObject<{
|
|
13
18
|
target: z.ZodEnum<{
|
|
14
19
|
headers: "headers";
|
|
@@ -23,7 +28,7 @@ export type PluginAuthBinding = z.infer<typeof bindingSchema>;
|
|
|
23
28
|
export declare const pluginCredentialProviderPrefix: (id: string) => string;
|
|
24
29
|
export declare const parsePluginAuthBinding: (value: unknown) => PluginAuthBinding;
|
|
25
30
|
export declare function pluginEndpointFingerprint(server: PluginServer): string;
|
|
26
|
-
export declare function readPluginAuthBinding(store: AgentPluginStore, id: string, name: string, server: PluginServer): PluginAuthBinding | undefined;
|
|
31
|
+
export declare function readPluginAuthBinding(store: AgentPluginStore, id: string, name: string, server: PluginServer, revision?: string): PluginAuthBinding | undefined;
|
|
27
32
|
export declare function savePluginAuthBinding(store: AgentPluginStore, id: string, name: string, input: {
|
|
28
33
|
mode: PluginAuthBinding['mode'];
|
|
29
34
|
secrets?: Array<{
|
|
@@ -33,5 +38,6 @@ export declare function savePluginAuthBinding(store: AgentPluginStore, id: strin
|
|
|
33
38
|
prefix?: string;
|
|
34
39
|
}>;
|
|
35
40
|
}): Promise<void>;
|
|
41
|
+
export declare function savePluginOAuthReference(store: AgentPluginStore, id: string, name: string, reference: NonNullable<PluginAuthBinding['oauthReference']>): void;
|
|
36
42
|
export declare function applyPluginAuthBinding(raw: Record<string, unknown>, binding: PluginAuthBinding | undefined): Record<string, unknown>;
|
|
37
43
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { init_paths_state, resolveStateDir } from "../../config/paths-state.js";
|
|
2
|
-
import { init_write_file_atomic, writeTextAtomic } from "../../infra/write-file-atomic.js";
|
|
2
|
+
import { init_write_file_atomic, writeTextAtomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
3
3
|
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
4
4
|
import { isDangerousHostEnvVarName } from "../../infra/host-env-security.js";
|
|
5
5
|
import { pluginName } from "./validation.js";
|
|
@@ -17,6 +17,11 @@ const bindingSchema = z.strictObject({
|
|
|
17
17
|
mode: z.enum(["auto", "api-key"]),
|
|
18
18
|
identityScope: z.literal("owner"),
|
|
19
19
|
endpointFingerprint: z.string(),
|
|
20
|
+
oauthReference: z.strictObject({
|
|
21
|
+
sourceServerId: z.string(),
|
|
22
|
+
credentialId: z.string().regex(/^mcp_draft_[a-f0-9]{32}$/),
|
|
23
|
+
fingerprint: z.string()
|
|
24
|
+
}).optional(),
|
|
20
25
|
fields: z.array(z.strictObject({
|
|
21
26
|
target: z.enum(["headers", "env"]),
|
|
22
27
|
key: z.string(),
|
|
@@ -28,19 +33,36 @@ const hash = (value) => createHash("sha256").update(value).digest("hex");
|
|
|
28
33
|
const pluginCredentialProviderPrefix = (id) => `plugin-${hash(id).slice(0, 16)}-`;
|
|
29
34
|
const parsePluginAuthBinding = (value) => bindingSchema.parse(value);
|
|
30
35
|
function pluginEndpointFingerprint(server) {
|
|
31
|
-
return hash(server.type === "stdio" ? JSON.stringify(server) :
|
|
36
|
+
return hash(server.type === "stdio" ? JSON.stringify(server) : JSON.stringify([
|
|
37
|
+
new URL(server.url).toString(),
|
|
38
|
+
server.oauth ?? null,
|
|
39
|
+
server.connectionAuth ?? null
|
|
40
|
+
]));
|
|
32
41
|
}
|
|
33
|
-
function bindingPath(store, id, name) {
|
|
34
|
-
return join(store.stateDir, "plugin-auth", pluginName.parse(id), `${hash(name)}.json`);
|
|
42
|
+
function bindingPath(store, id, name, revision) {
|
|
43
|
+
return join(store.stateDir, "plugin-auth", pluginName.parse(id), `${hash(name)}${revision ? `-${z.string().uuid().parse(revision)}` : ""}.json`);
|
|
35
44
|
}
|
|
36
|
-
function readPluginAuthBinding(store, id, name, server) {
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
45
|
+
function readPluginAuthBinding(store, id, name, server, revision) {
|
|
46
|
+
const current = store.receipt(id);
|
|
47
|
+
const targetRevision = revision ?? current?.revision;
|
|
48
|
+
const revisions = [...new Set([
|
|
49
|
+
targetRevision,
|
|
50
|
+
current?.revision,
|
|
51
|
+
current?.previous?.revision
|
|
52
|
+
].filter((value) => !!value))];
|
|
53
|
+
for (const candidate of [...revisions.map((value) => bindingPath(store, id, name, value)), bindingPath(store, id, name)]) {
|
|
54
|
+
if (!existsSync(candidate)) continue;
|
|
55
|
+
const binding = bindingSchema.parse(JSON.parse(readFileSync(candidate, "utf8")));
|
|
56
|
+
const fingerprint = pluginEndpointFingerprint(server);
|
|
57
|
+
const legacy = server.type !== "stdio" && !server.oauth && !server.connectionAuth && binding.endpointFingerprint === hash(new URL(server.url).toString());
|
|
58
|
+
if (binding.endpointFingerprint !== fingerprint && !legacy) continue;
|
|
59
|
+
if (legacy) binding.endpointFingerprint = fingerprint;
|
|
60
|
+
if (targetRevision && candidate !== bindingPath(store, id, name, targetRevision)) writeTextAtomicSync(bindingPath(store, id, name, targetRevision), JSON.stringify(binding));
|
|
61
|
+
return binding;
|
|
62
|
+
}
|
|
41
63
|
}
|
|
42
64
|
async function savePluginAuthBinding(store, id, name, input) {
|
|
43
|
-
const plugin = store.get(id);
|
|
65
|
+
const plugin = store.pending(id) ?? store.get(id);
|
|
44
66
|
const server = plugin?.servers[name];
|
|
45
67
|
if (!server || plugin?.readiness === "blocked") throw new Error("Plugin MCP server unavailable");
|
|
46
68
|
const endpointFingerprint = pluginEndpointFingerprint(server);
|
|
@@ -67,6 +89,7 @@ async function savePluginAuthBinding(store, id, name, input) {
|
|
|
67
89
|
const provider = `${pluginCredentialProviderPrefix(id)}${hash(JSON.stringify([
|
|
68
90
|
"owner",
|
|
69
91
|
id,
|
|
92
|
+
plugin.receipt.revision,
|
|
70
93
|
name,
|
|
71
94
|
endpointFingerprint,
|
|
72
95
|
field.target,
|
|
@@ -87,7 +110,21 @@ async function savePluginAuthBinding(store, id, name, input) {
|
|
|
87
110
|
endpointFingerprint,
|
|
88
111
|
fields
|
|
89
112
|
});
|
|
90
|
-
await writeTextAtomic(bindingPath(store, id, name), JSON.stringify(binding));
|
|
113
|
+
await writeTextAtomic(bindingPath(store, id, name, plugin.receipt.revision), JSON.stringify(binding));
|
|
114
|
+
}
|
|
115
|
+
function savePluginOAuthReference(store, id, name, reference) {
|
|
116
|
+
const plugin = store.pending(id) ?? store.get(id);
|
|
117
|
+
const server = plugin?.servers[name];
|
|
118
|
+
if (!server || !plugin || plugin.readiness === "blocked") throw new Error("Plugin MCP server unavailable");
|
|
119
|
+
const binding = bindingSchema.parse({
|
|
120
|
+
serverName: name,
|
|
121
|
+
mode: "auto",
|
|
122
|
+
identityScope: "owner",
|
|
123
|
+
endpointFingerprint: pluginEndpointFingerprint(server),
|
|
124
|
+
fields: [],
|
|
125
|
+
oauthReference: reference
|
|
126
|
+
});
|
|
127
|
+
writeTextAtomicSync(bindingPath(store, id, name, plugin.receipt.revision), JSON.stringify(binding));
|
|
91
128
|
}
|
|
92
129
|
function applyPluginAuthBinding(raw, binding) {
|
|
93
130
|
if (!binding) return raw;
|
|
@@ -103,8 +140,12 @@ function applyPluginAuthBinding(raw, binding) {
|
|
|
103
140
|
} };
|
|
104
141
|
result[field.target] = values;
|
|
105
142
|
}
|
|
143
|
+
if (binding.oauthReference) {
|
|
144
|
+
result.xopcOAuthCredentialId = binding.oauthReference.credentialId;
|
|
145
|
+
result.xopcPluginOAuthReference = binding.oauthReference;
|
|
146
|
+
}
|
|
106
147
|
result.xopcAuthRevision = hash(JSON.stringify(binding));
|
|
107
148
|
return result;
|
|
108
149
|
}
|
|
109
150
|
//#endregion
|
|
110
|
-
export { applyPluginAuthBinding, parsePluginAuthBinding, pluginCredentialProviderPrefix, pluginEndpointFingerprint, readPluginAuthBinding, savePluginAuthBinding };
|
|
151
|
+
export { applyPluginAuthBinding, parsePluginAuthBinding, pluginCredentialProviderPrefix, pluginEndpointFingerprint, readPluginAuthBinding, savePluginAuthBinding, savePluginOAuthReference };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type PluginManifest } from './validation.js';
|
|
2
|
+
export declare function pluginLocalizations(manifest: PluginManifest): {
|
|
3
|
+
[k: string]: {
|
|
4
|
+
description?: string;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
/** Inline bounded package assets so authenticated and offline inventories need no extra fetch. */
|
|
9
|
+
export declare function pluginBranding(root: string, manifest: PluginManifest): {
|
|
10
|
+
iconUrl: string;
|
|
11
|
+
iconSha256: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { containedPath } from "./validation.js";
|
|
2
|
+
import { extname, resolve } from "node:path";
|
|
3
|
+
import { readFileSync, statSync } from "node:fs";
|
|
4
|
+
import { createHash } from "node:crypto";
|
|
5
|
+
//#region src/extensions/agent-plugins/branding.ts
|
|
6
|
+
function pluginLocalizations(manifest) {
|
|
7
|
+
const extension = manifest.extensions?.["ai.xopc"];
|
|
8
|
+
return Object.fromEntries(["en", "zh-CN"].flatMap((locale) => {
|
|
9
|
+
const value = extension?.localizations?.[locale];
|
|
10
|
+
return typeof value?.displayName === "string" && value.displayName.trim() ? [[locale, {
|
|
11
|
+
displayName: value.displayName,
|
|
12
|
+
...typeof value.description === "string" ? { description: value.description } : {}
|
|
13
|
+
}]] : [];
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
/** Inline bounded package assets so authenticated and offline inventories need no extra fetch. */
|
|
17
|
+
function pluginBranding(root, manifest) {
|
|
18
|
+
const icon = (manifest.extensions?.["ai.xopc"])?.branding?.icon;
|
|
19
|
+
if (typeof icon !== "string" || !icon || icon.includes("\0")) return void 0;
|
|
20
|
+
try {
|
|
21
|
+
const file = containedPath(root, resolve(root, icon));
|
|
22
|
+
const info = statSync(file);
|
|
23
|
+
if (!info.isFile() || info.size < 1 || info.size > 128 * 1024) return void 0;
|
|
24
|
+
const type = extname(file).toLowerCase();
|
|
25
|
+
const mime = {
|
|
26
|
+
".svg": "image/svg+xml",
|
|
27
|
+
".png": "image/png",
|
|
28
|
+
".webp": "image/webp"
|
|
29
|
+
}[type];
|
|
30
|
+
if (!mime) return void 0;
|
|
31
|
+
const bytes = readFileSync(file);
|
|
32
|
+
if (type === ".svg") {
|
|
33
|
+
const source = bytes.toString("utf8");
|
|
34
|
+
if (!/<svg\b/i.test(source) || /<(?:script|foreignObject|iframe|object|embed)\b|\son[a-z]+\s*=|(?:href|src)\s*=\s*["']\s*(?:https?:|\/\/|data:)/i.test(source)) return void 0;
|
|
35
|
+
} else if (type === ".png" ? !bytes.subarray(0, 8).equals(Buffer.from([
|
|
36
|
+
137,
|
|
37
|
+
80,
|
|
38
|
+
78,
|
|
39
|
+
71,
|
|
40
|
+
13,
|
|
41
|
+
10,
|
|
42
|
+
26,
|
|
43
|
+
10
|
|
44
|
+
])) : bytes.subarray(0, 4).toString() !== "RIFF" || bytes.subarray(8, 12).toString() !== "WEBP") return void 0;
|
|
45
|
+
return {
|
|
46
|
+
iconUrl: `data:${mime};base64,${bytes.toString("base64")}`,
|
|
47
|
+
iconSha256: createHash("sha256").update(bytes).digest("hex")
|
|
48
|
+
};
|
|
49
|
+
} catch {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { pluginBranding, pluginLocalizations };
|