dsh-agent-plugins-market 0.9.0 → 0.9.2
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/README.md +64 -154
- package/README.zh.md +74 -164
- package/assets/dsh-agent-plugins.png +0 -0
- package/client/client.js +5371 -1085
- package/client/client.js.map +1 -1
- package/lib/index.js +2 -257
- package/lib/{application → packages/market-bundle/src/application}/catalog.js +207 -41
- package/lib/{application → packages/market-bundle/src/application}/details.js +73 -29
- package/lib/packages/market-bundle/src/application/extension-inventory.js +408 -0
- package/lib/packages/market-bundle/src/application/extension-project.js +64 -0
- package/lib/packages/market-bundle/src/application/resource-inventory.js +96 -0
- package/lib/packages/market-bundle/src/application/server-config.js +9 -0
- package/lib/packages/market-bundle/src/application/suite-queries.js +86 -0
- package/lib/packages/market-bundle/src/index.js +372 -0
- package/lib/{runtime/host → packages/market-bundle/src/platform}/feedback-tool.js +2 -2
- package/lib/{runtime/host → packages/market-bundle/src/platform}/settings-namespace.js +55 -7
- package/lib/packages/market-bundle/src/platform/settings-schema.js +25 -0
- package/lib/packages/market-bundle/src/routes-extension-presets.js +161 -0
- package/lib/packages/market-bundle/src/routes-resources.js +127 -0
- package/lib/{routes.js → packages/market-bundle/src/routes.js} +225 -21
- package/lib/packages/market-bundle/src/runtime-adapters.js +57 -0
- package/lib/packages/market-bundle/src/session-extension.js +337 -0
- package/lib/{application → packages/market-catalog/src/application}/catalog-context.js +7 -4
- package/lib/{application → packages/market-catalog/src/application}/install-store.js +3 -3
- package/lib/{application → packages/market-catalog/src/application}/snapshot-cache.js +100 -11
- package/lib/{application → packages/market-catalog/src/application}/source-store.js +24 -11
- package/lib/{application → packages/market-catalog/src/application}/state/state-store.js +1 -1
- package/lib/{application → packages/market-catalog/src/application}/state/storage-migration.js +1 -1
- package/lib/packages/market-catalog/src/index.js +19 -0
- package/lib/{catalog → packages/market-catalog/src/scanning}/archive.js +1 -1
- package/lib/{catalog → packages/market-catalog/src/scanning}/codex-mcp.js +1 -1
- package/lib/{catalog → packages/market-catalog/src/scanning}/component-files.js +2 -2
- package/lib/{catalog → packages/market-catalog/src/scanning}/manifests.js +2 -2
- package/lib/{catalog → packages/market-catalog/src/scanning}/native-project.js +1 -1
- package/lib/{catalog → packages/market-catalog/src/scanning}/paths.js +1 -1
- package/lib/{catalog → packages/market-catalog/src/scanning}/plugin-variables.js +21 -1
- package/lib/{catalog → packages/market-catalog/src/scanning}/scan-resolvers.js +35 -2
- package/lib/{catalog → packages/market-catalog/src/scanning}/skills-parse.js +40 -10
- package/lib/{catalog → packages/market-catalog/src/scanning}/validate.js +15 -2
- package/lib/packages/market-contracts/src/contracts/extension-presets.js +125 -0
- package/lib/{contracts → packages/market-contracts/src/contracts}/market.js +33 -5
- package/lib/packages/market-contracts/src/contracts/mcp-overrides.js +2 -0
- package/lib/packages/market-contracts/src/contracts/resource-window.js +29 -0
- package/lib/packages/market-contracts/src/contracts/settings.js +130 -0
- package/lib/packages/market-contracts/src/contracts/surface-toggles.js +29 -0
- package/lib/packages/market-contracts/src/contracts/translation.js +28 -0
- package/lib/packages/market-contracts/src/index.js +4 -0
- package/lib/{model → packages/market-contracts/src/model}/layouts.js +11 -0
- package/lib/{application → packages/market-contracts/src/ports}/ports.js +3 -0
- package/lib/{application/mcp/mcp-redaction.js → packages/market-contracts/src/redaction.js} +17 -1
- package/lib/{application → packages/market-lsp/src/application}/lsp/lsp-direct-config.js +2 -2
- package/lib/{application → packages/market-lsp/src/application}/lsp/lsp-server-state.js +1 -1
- package/lib/{application → packages/market-lsp/src/application}/lsp/lsp-status.js +20 -3
- package/lib/{application → packages/market-lsp/src/application}/lsp/profile-seam.js +1 -1
- package/lib/packages/market-lsp/src/application/lsp/validation.js +46 -0
- package/lib/{application → packages/market-lsp/src/application}/lsp-service.js +61 -3
- package/lib/packages/market-lsp/src/index.js +8 -0
- package/lib/{runtime → packages/market-lsp/src/runtime}/lsp/lsp-mounts.js +79 -40
- package/lib/{application → packages/market-mcp/src/application}/mcp/mcp-backend.js +0 -16
- package/lib/{application → packages/market-mcp/src/application}/mcp/mcp-config.js +104 -21
- package/lib/{application → packages/market-mcp/src/application}/mcp/mcp-direct-config.js +12 -4
- package/lib/{application → packages/market-mcp/src/application}/mcp/mcp-overrides.js +4 -4
- package/lib/{application → packages/market-mcp/src/application}/mcp/mcp-status.js +49 -10
- package/lib/packages/market-mcp/src/application/mcp/validation.js +63 -0
- package/lib/{application → packages/market-mcp/src/application}/mcp-service.js +111 -91
- package/lib/packages/market-mcp/src/index.js +10 -0
- package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/bridge.js +12 -9
- package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/connection.js +1 -1
- package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/oauth.js +1 -1
- package/lib/packages/market-mcp/src/runtime/mcp/bridge/tool-ownership.js +26 -0
- package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/tools.js +1 -1
- package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/mcp-auth-record.js +35 -4
- package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/mcp-mounts.js +35 -4
- package/lib/packages/market-runtime/src/adapter-contracts.js +1 -0
- package/lib/packages/market-runtime/src/application/command-resources.js +74 -0
- package/lib/packages/market-runtime/src/application/extension-authorization.js +27 -0
- package/lib/packages/market-runtime/src/application/extension-hook-selection.js +56 -0
- package/lib/packages/market-runtime/src/application/extension-suite-declarations.js +57 -0
- package/lib/packages/market-runtime/src/application/extension-suite-selection.js +84 -0
- package/lib/packages/market-runtime/src/application/fs-probe.js +43 -0
- package/lib/packages/market-runtime/src/application/panel-resources.js +370 -0
- package/lib/{application → packages/market-runtime/src/application}/panels/user-hooks.js +2 -2
- package/lib/{application → packages/market-runtime/src/application}/panels/user-store.js +53 -13
- package/lib/{application → packages/market-runtime/src/application}/project-agent-roles.js +20 -11
- package/lib/packages/market-runtime/src/application/state/extension-presets.js +144 -0
- package/lib/packages/market-runtime/src/application/state/resource-favorites.js +90 -0
- package/lib/packages/market-runtime/src/application/state/resource-filters.js +2 -0
- package/lib/packages/market-runtime/src/application/state/surface-toggles.js +10 -0
- package/lib/packages/market-runtime/src/application/state/workspace-policy.js +56 -0
- package/lib/packages/market-runtime/src/catalog-port.js +1 -0
- package/lib/packages/market-runtime/src/extension-service.js +1 -0
- package/lib/packages/market-runtime/src/index.js +31 -0
- package/lib/{runtime → packages/market-runtime/src/runtime}/agents/agent-role-router.js +74 -79
- package/lib/packages/market-runtime/src/runtime/agents/agent-teams-seat.js +58 -0
- package/lib/{runtime → packages/market-runtime/src/runtime}/agents/subagent-catalog.js +89 -21
- package/lib/packages/market-runtime/src/runtime/agents/team-coordination.js +51 -0
- package/lib/packages/market-runtime/src/runtime/agents/teammate-role-runtime.js +241 -0
- package/lib/packages/market-runtime/src/runtime/agents/teammate-role-tool.js +130 -0
- package/lib/{runtime → packages/market-runtime/src/runtime}/core/reconcile-scheduler.js +2 -2
- package/lib/packages/market-runtime/src/runtime/core/reconciler.js +457 -0
- package/lib/packages/market-runtime/src/runtime/host/command-name-allocator.js +168 -0
- package/lib/packages/market-runtime/src/runtime/host/extension-progress.js +120 -0
- package/lib/packages/market-runtime/src/runtime/host/extension-runtime.js +405 -0
- package/lib/packages/market-runtime/src/runtime/host/extension-session-state.js +839 -0
- package/lib/packages/market-runtime/src/runtime/host/extension-tool-gates.js +96 -0
- package/lib/{runtime → packages/market-runtime/src/runtime}/host/failure-detail.js +1 -1
- package/lib/{runtime → packages/market-runtime/src/runtime}/host/host-locale.js +2 -0
- package/lib/packages/market-runtime/src/runtime/host/menu-row-identities.js +38 -0
- package/lib/packages/market-runtime/src/runtime/host/resource-filter-service.js +81 -0
- package/lib/packages/market-runtime/src/runtime/host/scoped-contributors.js +304 -0
- package/lib/packages/market-runtime/src/runtime/host/surface-toggle-service.js +15 -0
- package/lib/packages/market-runtime/src/runtime/panels/user-commands.js +211 -0
- package/lib/{runtime → packages/market-runtime/src/runtime}/panels/user-panels.js +34 -14
- package/lib/packages/market-runtime/src/runtime/surfaces/commands-mounts.js +256 -0
- package/lib/packages/market-runtime/src/runtime/surfaces/extension-hooks.js +294 -0
- package/lib/packages/market-runtime/src/runtime/surfaces/hook-dry-run.js +122 -0
- package/lib/{runtime → packages/market-runtime/src/runtime}/surfaces/hooks-mounts.js +1 -1
- package/lib/{runtime → packages/market-runtime/src/runtime}/surfaces/project-runtime.js +23 -13
- package/lib/packages/market-runtime/src/runtime/surfaces/skills-provider.js +241 -0
- package/lib/packages/market-translation/src/application/state/translation-cache.js +122 -0
- package/lib/packages/market-translation/src/application/translation/chain.js +99 -0
- package/lib/packages/market-translation/src/application/translation/document.js +384 -0
- package/lib/packages/market-translation/src/application/translation/localizer.js +642 -0
- package/lib/packages/market-translation/src/application/translation/service.js +113 -0
- package/lib/packages/market-translation/src/application/translation/unit.js +19 -0
- package/lib/packages/market-translation/src/index.js +4 -0
- package/lib/packages/market-translation/src/runtime/host/llm-translator.js +278 -0
- package/lib/packages/market-translation/src/runtime/host/machine-translator.js +152 -0
- package/lib/packages/market-translation/src/runtime/host/text-masking.js +96 -0
- package/lib/packages/market-translation/src/runtime/host/translation-providers.js +116 -0
- package/lib/types/index.d.ts +2 -130
- package/lib/types/{application → packages/market-bundle/src/application}/catalog.d.ts +117 -22
- package/lib/types/packages/market-bundle/src/application/details.d.ts +24 -0
- package/lib/types/packages/market-bundle/src/application/extension-inventory.d.ts +45 -0
- package/lib/types/packages/market-bundle/src/application/extension-project.d.ts +26 -0
- package/lib/types/packages/market-bundle/src/application/resource-inventory.d.ts +42 -0
- package/lib/types/packages/market-bundle/src/application/server-config.d.ts +9 -0
- package/lib/types/packages/market-bundle/src/application/suite-queries.d.ts +84 -0
- package/lib/types/packages/market-bundle/src/index.d.ts +125 -0
- package/lib/types/{runtime/host → packages/market-bundle/src/platform}/settings-namespace.d.ts +44 -9
- package/lib/types/{application/mcp/mcp-backend.d.ts → packages/market-bundle/src/platform/settings-schema.d.ts} +13 -28
- package/lib/types/packages/market-bundle/src/routes-extension-presets.d.ts +15 -0
- package/lib/types/packages/market-bundle/src/routes-resources.d.ts +17 -0
- package/lib/types/packages/market-bundle/src/routes.d.ts +32 -0
- package/lib/types/packages/market-bundle/src/runtime-adapters.d.ts +42 -0
- package/lib/types/packages/market-bundle/src/session-extension.d.ts +62 -0
- package/lib/types/{application → packages/market-catalog/src/application}/catalog-context.d.ts +11 -3
- package/lib/types/{application → packages/market-catalog/src/application}/install-store.d.ts +1 -1
- package/lib/types/{application → packages/market-catalog/src/application}/regions.d.ts +1 -1
- package/lib/types/{application → packages/market-catalog/src/application}/snapshot-cache.d.ts +44 -2
- package/lib/types/{application → packages/market-catalog/src/application}/source-store.d.ts +12 -3
- package/lib/types/{application → packages/market-catalog/src/application}/state/state-store.d.ts +1 -1
- package/lib/types/packages/market-catalog/src/index.d.ts +22 -0
- package/lib/types/{catalog → packages/market-catalog/src/scanning}/archive.d.ts +1 -1
- package/lib/types/{catalog → packages/market-catalog/src/scanning}/codex-mcp.d.ts +1 -1
- package/lib/types/{catalog → packages/market-catalog/src/scanning}/component-files.d.ts +1 -1
- package/lib/types/{catalog → packages/market-catalog/src/scanning}/lsp-spec.d.ts +1 -1
- package/lib/types/{catalog → packages/market-catalog/src/scanning}/manifests.d.ts +3 -3
- package/lib/types/{catalog → packages/market-catalog/src/scanning}/native-project.d.ts +2 -2
- package/lib/types/{catalog → packages/market-catalog/src/scanning}/plugin-variables.d.ts +12 -1
- package/lib/types/{catalog → packages/market-catalog/src/scanning}/project-config.d.ts +2 -2
- package/lib/types/{catalog → packages/market-catalog/src/scanning}/project-hooks.d.ts +2 -2
- package/lib/types/{catalog → packages/market-catalog/src/scanning}/scan-pipeline.d.ts +1 -1
- package/lib/types/{catalog → packages/market-catalog/src/scanning}/scan-resolvers.d.ts +3 -3
- package/lib/types/{catalog → packages/market-catalog/src/scanning}/source-catalog.d.ts +1 -1
- package/lib/types/{catalog → packages/market-catalog/src/scanning}/suite-components.d.ts +1 -1
- package/lib/types/{catalog → packages/market-catalog/src/scanning}/suite-scanner.d.ts +1 -1
- package/lib/types/{catalog → packages/market-catalog/src/scanning}/surfaces.d.ts +1 -1
- package/lib/types/{catalog → packages/market-catalog/src/scanning}/validate.d.ts +1 -1
- package/lib/types/packages/market-contracts/src/contracts/extension-presets.d.ts +237 -0
- package/lib/types/{contracts → packages/market-contracts/src/contracts}/market.d.ts +87 -16
- package/lib/types/packages/market-contracts/src/contracts/mcp-overrides.d.ts +39 -0
- package/lib/types/{contracts → packages/market-contracts/src/contracts}/mcp-status.d.ts +9 -0
- package/lib/types/packages/market-contracts/src/contracts/resource-window.d.ts +70 -0
- package/lib/types/packages/market-contracts/src/contracts/settings.d.ts +121 -0
- package/lib/types/packages/market-contracts/src/contracts/surface-toggles.d.ts +28 -0
- package/lib/types/packages/market-contracts/src/contracts/translation.d.ts +81 -0
- package/lib/types/{runtime → packages/market-contracts/src}/host/plugin-message-source.d.ts +1 -1
- package/lib/types/packages/market-contracts/src/index.d.ts +5 -0
- package/lib/types/{model → packages/market-contracts/src/model}/layouts.d.ts +7 -0
- package/lib/types/{model → packages/market-contracts/src/model}/types.d.ts +2 -2
- package/lib/types/packages/market-contracts/src/ports/ports.d.ts +183 -0
- package/lib/types/{application → packages/market-contracts/src/ports}/queries.d.ts +27 -6
- package/lib/types/{application/mcp/mcp-redaction.d.ts → packages/market-contracts/src/redaction.d.ts} +2 -0
- package/lib/types/{application → packages/market-lsp/src/application}/lsp/lsp-direct-config.d.ts +1 -1
- package/lib/types/{application → packages/market-lsp/src/application}/lsp/lsp-status.d.ts +21 -5
- package/lib/types/packages/market-lsp/src/application/lsp/validation.d.ts +8 -0
- package/lib/types/{application → packages/market-lsp/src/application}/lsp-service.d.ts +19 -6
- package/lib/types/packages/market-lsp/src/index.d.ts +8 -0
- package/lib/types/{runtime → packages/market-lsp/src/runtime}/lsp/lsp-mounts.d.ts +26 -6
- package/lib/types/packages/market-mcp/src/application/mcp/mcp-backend.d.ts +28 -0
- package/lib/types/{application → packages/market-mcp/src/application}/mcp/mcp-bridge-config.d.ts +1 -1
- package/lib/types/{application → packages/market-mcp/src/application}/mcp/mcp-config.d.ts +2 -2
- package/lib/types/{application → packages/market-mcp/src/application}/mcp/mcp-direct-config.d.ts +6 -1
- package/lib/types/{application → packages/market-mcp/src/application}/mcp/mcp-overrides.d.ts +4 -38
- package/lib/types/packages/market-mcp/src/application/mcp/mcp-status.d.ts +40 -0
- package/lib/types/{application/server-config.d.ts → packages/market-mcp/src/application/mcp/validation.d.ts} +2 -10
- package/lib/types/{application → packages/market-mcp/src/application}/mcp-service.d.ts +22 -16
- package/lib/types/packages/market-mcp/src/index.d.ts +12 -0
- package/lib/types/packages/market-mcp/src/runtime/mcp/bridge/tool-ownership.d.ts +14 -0
- package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/mcp-auth-record.d.ts +4 -0
- package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/mcp-mounts.d.ts +19 -3
- package/lib/types/packages/market-runtime/src/adapter-contracts.d.ts +89 -0
- package/lib/types/{application → packages/market-runtime/src/application}/agent-roles.d.ts +2 -0
- package/lib/types/packages/market-runtime/src/application/command-resources.d.ts +26 -0
- package/lib/types/packages/market-runtime/src/application/extension-authorization.d.ts +12 -0
- package/lib/types/packages/market-runtime/src/application/extension-hook-selection.d.ts +23 -0
- package/lib/types/packages/market-runtime/src/application/extension-suite-declarations.d.ts +10 -0
- package/lib/types/packages/market-runtime/src/application/extension-suite-selection.d.ts +30 -0
- package/lib/types/packages/market-runtime/src/application/fs-probe.d.ts +12 -0
- package/lib/types/packages/market-runtime/src/application/panel-resources.d.ts +100 -0
- package/lib/types/{application → packages/market-runtime/src/application}/panels/user-hooks.d.ts +1 -1
- package/lib/types/packages/market-runtime/src/application/project-agent-roles.d.ts +10 -0
- package/lib/types/packages/market-runtime/src/application/state/extension-presets.d.ts +24 -0
- package/lib/types/packages/market-runtime/src/application/state/resource-favorites.d.ts +9 -0
- package/lib/types/packages/market-runtime/src/application/state/resource-filters.d.ts +2 -0
- package/lib/types/packages/market-runtime/src/application/state/surface-toggles.d.ts +6 -0
- package/lib/types/packages/market-runtime/src/application/state/workspace-policy.d.ts +19 -0
- package/lib/types/packages/market-runtime/src/catalog-port.d.ts +30 -0
- package/lib/types/packages/market-runtime/src/extension-service.d.ts +14 -0
- package/lib/types/packages/market-runtime/src/index.d.ts +41 -0
- package/lib/types/{runtime → packages/market-runtime/src/runtime}/agents/agent-role-router.d.ts +66 -31
- package/lib/types/packages/market-runtime/src/runtime/agents/agent-teams-seat.d.ts +41 -0
- package/lib/types/{runtime → packages/market-runtime/src/runtime}/agents/subagent-catalog.d.ts +34 -2
- package/lib/types/packages/market-runtime/src/runtime/agents/team-coordination.d.ts +8 -0
- package/lib/types/packages/market-runtime/src/runtime/agents/teammate-role-runtime.d.ts +74 -0
- package/lib/types/packages/market-runtime/src/runtime/agents/teammate-role-tool.d.ts +6 -0
- package/lib/types/{runtime → packages/market-runtime/src/runtime}/core/reconcile-scheduler.d.ts +5 -2
- package/lib/types/packages/market-runtime/src/runtime/core/reconciler.d.ts +141 -0
- package/lib/types/packages/market-runtime/src/runtime/host/command-name-allocator.d.ts +132 -0
- package/lib/types/packages/market-runtime/src/runtime/host/extension-progress.d.ts +91 -0
- package/lib/types/packages/market-runtime/src/runtime/host/extension-runtime.d.ts +77 -0
- package/lib/types/packages/market-runtime/src/runtime/host/extension-session-state.d.ts +242 -0
- package/lib/types/packages/market-runtime/src/runtime/host/extension-tool-gates.d.ts +38 -0
- package/lib/types/{runtime → packages/market-runtime/src/runtime}/host/host-locale.d.ts +1 -1
- package/lib/types/packages/market-runtime/src/runtime/host/menu-row-identities.d.ts +50 -0
- package/lib/types/{runtime → packages/market-runtime/src/runtime}/host/model-catalog.d.ts +1 -1
- package/lib/types/packages/market-runtime/src/runtime/host/resource-filter-service.d.ts +34 -0
- package/lib/types/packages/market-runtime/src/runtime/host/scoped-contributors.d.ts +58 -0
- package/lib/types/packages/market-runtime/src/runtime/host/surface-toggle-service.d.ts +10 -0
- package/lib/types/packages/market-runtime/src/runtime/panels/user-commands.d.ts +74 -0
- package/lib/types/{runtime → packages/market-runtime/src/runtime}/panels/user-panels.d.ts +7 -1
- package/lib/types/packages/market-runtime/src/runtime/surfaces/commands-mounts.d.ts +81 -0
- package/lib/types/packages/market-runtime/src/runtime/surfaces/extension-hooks.d.ts +59 -0
- package/lib/types/packages/market-runtime/src/runtime/surfaces/hook-dry-run.d.ts +91 -0
- package/lib/types/{runtime → packages/market-runtime/src/runtime}/surfaces/hooks-mounts.d.ts +1 -1
- package/lib/types/{runtime → packages/market-runtime/src/runtime}/surfaces/project-runtime.d.ts +8 -5
- package/lib/types/packages/market-runtime/src/runtime/surfaces/skills-provider.d.ts +71 -0
- package/lib/types/packages/market-translation/src/application/state/translation-cache.d.ts +56 -0
- package/lib/types/packages/market-translation/src/application/translation/chain.d.ts +47 -0
- package/lib/types/packages/market-translation/src/application/translation/document.d.ts +54 -0
- package/lib/types/packages/market-translation/src/application/translation/localizer.d.ts +325 -0
- package/lib/types/packages/market-translation/src/application/translation/service.d.ts +89 -0
- package/lib/types/packages/market-translation/src/application/translation/unit.d.ts +35 -0
- package/lib/types/packages/market-translation/src/index.d.ts +4 -0
- package/lib/types/packages/market-translation/src/runtime/host/llm-translator.d.ts +30 -0
- package/lib/types/packages/market-translation/src/runtime/host/machine-translator.d.ts +52 -0
- package/lib/types/packages/market-translation/src/runtime/host/text-masking.d.ts +42 -0
- package/lib/types/packages/market-translation/src/runtime/host/translation-providers.d.ts +42 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +47 -10
- package/schemas/README.md +4 -4
- package/schemas/agent-plugins/spec.md +2 -2
- package/schemas/com.deepseek.harness/spec.md +1 -1
- package/schemas/skill-collection/spec.md +10 -2
- package/lib/application/panel-resources.js +0 -161
- package/lib/application/server-config.js +0 -109
- package/lib/contracts/settings.js +0 -63
- package/lib/runtime/core/reconciler.js +0 -100
- package/lib/runtime/panels/user-commands.js +0 -105
- package/lib/runtime/surfaces/commands-mounts.js +0 -186
- package/lib/runtime/surfaces/skills-provider.js +0 -160
- package/lib/types/application/details.d.ts +0 -7
- package/lib/types/application/mcp/mcp-status.d.ts +0 -24
- package/lib/types/application/panel-resources.d.ts +0 -28
- package/lib/types/application/ports.d.ts +0 -86
- package/lib/types/application/project-agent-roles.d.ts +0 -3
- package/lib/types/contracts/settings.d.ts +0 -59
- package/lib/types/routes.d.ts +0 -16
- package/lib/types/runtime/core/reconciler.d.ts +0 -58
- package/lib/types/runtime/panels/user-commands.d.ts +0 -27
- package/lib/types/runtime/surfaces/commands-mounts.d.ts +0 -48
- package/lib/types/runtime/surfaces/skills-provider.d.ts +0 -23
- /package/lib/{application → packages/market-catalog/src/application}/deadline.js +0 -0
- /package/lib/{application → packages/market-catalog/src/application}/json-file.js +0 -0
- /package/lib/{application → packages/market-catalog/src/application}/regions.js +0 -0
- /package/lib/{catalog → packages/market-catalog/src/scanning}/fs-probes.js +0 -0
- /package/lib/{catalog → packages/market-catalog/src/scanning}/git.js +0 -0
- /package/lib/{catalog → packages/market-catalog/src/scanning}/lsp-spec.js +0 -0
- /package/lib/{catalog → packages/market-catalog/src/scanning}/project-config.js +0 -0
- /package/lib/{catalog → packages/market-catalog/src/scanning}/project-hooks.js +0 -0
- /package/lib/{catalog → packages/market-catalog/src/scanning}/scan-pipeline.js +0 -0
- /package/lib/{catalog → packages/market-catalog/src/scanning}/source-catalog.js +0 -0
- /package/lib/{catalog → packages/market-catalog/src/scanning}/suite-components.js +0 -0
- /package/lib/{catalog → packages/market-catalog/src/scanning}/suite-scanner.js +0 -0
- /package/lib/{catalog → packages/market-catalog/src/scanning}/surfaces.js +0 -0
- /package/lib/{contracts → packages/market-contracts/src/contracts}/lsp-status.js +0 -0
- /package/lib/{contracts → packages/market-contracts/src/contracts}/lsp.js +0 -0
- /package/lib/{contracts → packages/market-contracts/src/contracts}/mcp-status.js +0 -0
- /package/lib/{contracts → packages/market-contracts/src/contracts}/mcp.js +0 -0
- /package/lib/{runtime → packages/market-contracts/src}/host/plugin-message-source.js +0 -0
- /package/lib/{model → packages/market-contracts/src/model}/command-names.js +0 -0
- /package/lib/{model → packages/market-contracts/src/model}/preset-source.js +0 -0
- /package/lib/{model → packages/market-contracts/src/model}/types.js +0 -0
- /package/lib/{application → packages/market-contracts/src/ports}/queries.js +0 -0
- /package/lib/{application → packages/market-mcp/src/application}/mcp/mcp-bridge-config.js +0 -0
- /package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/host-contract.js +0 -0
- /package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/host-seams.js +0 -0
- /package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/plugin-identity.js +0 -0
- /package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/projection.js +0 -0
- /package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/transport.js +0 -0
- /package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/mcp-credentials.js +0 -0
- /package/lib/{application → packages/market-runtime/src/application}/agent-roles.js +0 -0
- /package/lib/{runtime → packages/market-runtime/src/runtime}/agents/agent-role-names.js +0 -0
- /package/lib/{runtime → packages/market-runtime/src/runtime}/core/context.js +0 -0
- /package/lib/{runtime → packages/market-runtime/src/runtime}/core/mount-lifecycle.js +0 -0
- /package/lib/{runtime → packages/market-runtime/src/runtime}/core/source-auto-update.js +0 -0
- /package/lib/{runtime → packages/market-runtime/src/runtime}/core/timer-seat.js +0 -0
- /package/lib/{runtime → packages/market-runtime/src/runtime}/host/model-catalog.js +0 -0
- /package/lib/{runtime → packages/market-runtime/src/runtime}/host/shell-path.js +0 -0
- /package/lib/{runtime → packages/market-runtime/src/runtime}/host/tool-registry-observer.js +0 -0
- /package/lib/{runtime → packages/market-runtime/src/runtime}/surfaces/dynamic-context.js +0 -0
- /package/lib/types/{runtime/host → packages/market-bundle/src/platform}/feedback-tool.d.ts +0 -0
- /package/lib/types/{application → packages/market-catalog/src/application}/deadline.d.ts +0 -0
- /package/lib/types/{application → packages/market-catalog/src/application}/json-file.d.ts +0 -0
- /package/lib/types/{application → packages/market-catalog/src/application}/state/storage-migration.d.ts +0 -0
- /package/lib/types/{catalog → packages/market-catalog/src/scanning}/fs-probes.d.ts +0 -0
- /package/lib/types/{catalog → packages/market-catalog/src/scanning}/git.d.ts +0 -0
- /package/lib/types/{catalog → packages/market-catalog/src/scanning}/paths.d.ts +0 -0
- /package/lib/types/{catalog → packages/market-catalog/src/scanning}/skills-parse.d.ts +0 -0
- /package/lib/types/{contracts → packages/market-contracts/src/contracts}/lsp-status.d.ts +0 -0
- /package/lib/types/{contracts → packages/market-contracts/src/contracts}/lsp.d.ts +0 -0
- /package/lib/types/{contracts → packages/market-contracts/src/contracts}/mcp.d.ts +0 -0
- /package/lib/types/{model → packages/market-contracts/src/model}/command-names.d.ts +0 -0
- /package/lib/types/{model → packages/market-contracts/src/model}/preset-source.d.ts +0 -0
- /package/lib/types/{application → packages/market-lsp/src/application}/lsp/lsp-server-state.d.ts +0 -0
- /package/lib/types/{application → packages/market-lsp/src/application}/lsp/profile-seam.d.ts +0 -0
- /package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/bridge.d.ts +0 -0
- /package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/connection.d.ts +0 -0
- /package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/host-contract.d.ts +0 -0
- /package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/host-seams.d.ts +0 -0
- /package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/oauth.d.ts +0 -0
- /package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/plugin-identity.d.ts +0 -0
- /package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/projection.d.ts +0 -0
- /package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/tools.d.ts +0 -0
- /package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/transport.d.ts +0 -0
- /package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/mcp-credentials.d.ts +0 -0
- /package/lib/types/{application → packages/market-runtime/src/application}/panels/user-store.d.ts +0 -0
- /package/lib/types/{runtime → packages/market-runtime/src/runtime}/agents/agent-role-names.d.ts +0 -0
- /package/lib/types/{runtime → packages/market-runtime/src/runtime}/core/context.d.ts +0 -0
- /package/lib/types/{runtime → packages/market-runtime/src/runtime}/core/mount-lifecycle.d.ts +0 -0
- /package/lib/types/{runtime → packages/market-runtime/src/runtime}/core/source-auto-update.d.ts +0 -0
- /package/lib/types/{runtime → packages/market-runtime/src/runtime}/core/timer-seat.d.ts +0 -0
- /package/lib/types/{runtime → packages/market-runtime/src/runtime}/host/failure-detail.d.ts +0 -0
- /package/lib/types/{runtime → packages/market-runtime/src/runtime}/host/shell-path.d.ts +0 -0
- /package/lib/types/{runtime → packages/market-runtime/src/runtime}/host/tool-registry-observer.d.ts +0 -0
- /package/lib/types/{runtime → packages/market-runtime/src/runtime}/surfaces/dynamic-context.d.ts +0 -0
|
@@ -7,13 +7,38 @@
|
|
|
7
7
|
* enable/disable against a local profile.
|
|
8
8
|
*/
|
|
9
9
|
import { isAbsolute } from 'node:path';
|
|
10
|
-
import { MARKET_ROUTES, userPanelRoute } from '
|
|
11
|
-
import { expandHome } from '
|
|
12
|
-
import { sanitizeOverridePatch } from '
|
|
13
|
-
import { readModelCatalog } from '
|
|
10
|
+
import { MARKET_ROUTES, userPanelRoute } from '../../market-contracts/src/contracts/market.js';
|
|
11
|
+
import { expandHome } from '../../market-catalog/src/index.js';
|
|
12
|
+
import { sanitizeOverridePatch } from '../../market-mcp/src/index.js';
|
|
13
|
+
import { readModelCatalog } from '../../market-runtime/src/index.js';
|
|
14
14
|
const MAX_BODY_BYTES = 64 * 1024;
|
|
15
|
+
/** Recount a merged MCP view so its totals describe the entries actually returned. */
|
|
16
|
+
function mcpTotals(entries) {
|
|
17
|
+
const count = (state) => entries.filter(entry => entry.state === state).length;
|
|
18
|
+
return {
|
|
19
|
+
all: entries.length,
|
|
20
|
+
connected: count('connected'),
|
|
21
|
+
degraded: count('degraded'),
|
|
22
|
+
failed: count('failed'),
|
|
23
|
+
needsCredentials: count('needs-credentials'),
|
|
24
|
+
orphaned: count('orphaned'),
|
|
25
|
+
disabled: count('disabled'),
|
|
26
|
+
foreign: count('foreign')
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/** Recount a merged LSP view the way the status builder counts its own rows. */
|
|
30
|
+
function lspTotals(entries) {
|
|
31
|
+
const count = (state) => entries.filter(entry => entry.state === state).length;
|
|
32
|
+
return {
|
|
33
|
+
all: entries.length,
|
|
34
|
+
mounted: count('mounted'),
|
|
35
|
+
failed: count('failed'),
|
|
36
|
+
blocked: count('host-missing') + count('conflict'),
|
|
37
|
+
disabled: count('disabled')
|
|
38
|
+
};
|
|
39
|
+
}
|
|
15
40
|
/** Mount every route; returns the disposer releasing them all. */
|
|
16
|
-
export function mountSuiteRoutes(hostCtx, manager, panels) {
|
|
41
|
+
export function mountSuiteRoutes(hostCtx, manager, panels, surfaceToggles, session) {
|
|
17
42
|
const host = hostCtx;
|
|
18
43
|
const disposers = [];
|
|
19
44
|
const get = (path, handler) => {
|
|
@@ -52,9 +77,71 @@ export function mountSuiteRoutes(hostCtx, manager, panels) {
|
|
|
52
77
|
}
|
|
53
78
|
}));
|
|
54
79
|
};
|
|
80
|
+
/**
|
|
81
|
+
* A read naming a session answers for that session's workspace; a read without
|
|
82
|
+
* one keeps answering from the global user catalog. Resolution failures are
|
|
83
|
+
* diagnosable rather than silent: an unknown session, a workspace-less agent,
|
|
84
|
+
* or an unwired project reader never falls back to a request path or to the
|
|
85
|
+
* process working directory.
|
|
86
|
+
*/
|
|
87
|
+
const readSource = (request) => {
|
|
88
|
+
const sessionId = queryOf(request).get('sessionId');
|
|
89
|
+
if (sessionId === null || sessionId === '')
|
|
90
|
+
return {};
|
|
91
|
+
const agent = session?.agent(sessionId);
|
|
92
|
+
if (agent === undefined)
|
|
93
|
+
return { error: 'no live session "' + sessionId + '"' };
|
|
94
|
+
const cwd = agent.session.header.cwd;
|
|
95
|
+
if (typeof cwd !== 'string' || !isAbsolute(cwd))
|
|
96
|
+
return { error: 'session "' + sessionId + '" has no absolute workspace' };
|
|
97
|
+
const reader = session?.project?.(agent);
|
|
98
|
+
return reader === undefined ? { error: 'session-scoped project reads are unavailable' } : { reader };
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Read one resource from whichever source owns it. A source-qualified id can
|
|
102
|
+
* name a user-dimension suite that merely rode along with a session, so a
|
|
103
|
+
* session-scoped request asks that workspace's project reader first and falls
|
|
104
|
+
* back to the user catalog. The session itself is validated before either, so
|
|
105
|
+
* an unknown session can never become a global read.
|
|
106
|
+
*/
|
|
107
|
+
const readOwned = async (source, fromProject, fromCatalog) => {
|
|
108
|
+
if ('error' in source)
|
|
109
|
+
throw new Error(source.error);
|
|
110
|
+
if (source.reader === undefined)
|
|
111
|
+
return fromCatalog();
|
|
112
|
+
try {
|
|
113
|
+
return await fromProject(source.reader);
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
// The id is not this workspace's project resource; the catalog that owns it answers.
|
|
117
|
+
return fromCatalog();
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* One status view for a session: the user catalog stays visible and that
|
|
122
|
+
* workspace's own declarations join it. Replacing the catalog outright would
|
|
123
|
+
* hide every user server behind a session id.
|
|
124
|
+
*/
|
|
125
|
+
const mergeById = (base, extra) => {
|
|
126
|
+
const seen = new Set(base.map(entry => entry.id));
|
|
127
|
+
return [...base, ...extra.filter(entry => !seen.has(entry.id))];
|
|
128
|
+
};
|
|
55
129
|
get(MARKET_ROUTES.overview, async (_request, response) => {
|
|
56
130
|
sendJson(response, 200, await manager.overview());
|
|
57
131
|
});
|
|
132
|
+
// The slash menu's row faces. The menu asks on mount and on a locale change;
|
|
133
|
+
// translation stays lazy, so this reads the cache the panels filled and never
|
|
134
|
+
// starts a provider round of its own.
|
|
135
|
+
get(MARKET_ROUTES.menuRowFaces, async (_request, response) => {
|
|
136
|
+
sendJson(response, 200, await manager.menuRowFaces());
|
|
137
|
+
});
|
|
138
|
+
// The reset control in the plugin's configuration card. Dropping the cache is
|
|
139
|
+
// the whole operation: translation is lazy, so the next overview read
|
|
140
|
+
// repopulates it and the panel shows the authored text until it lands.
|
|
141
|
+
post(MARKET_ROUTES.clearTranslations, async () => {
|
|
142
|
+
await manager.clearTranslations();
|
|
143
|
+
return {};
|
|
144
|
+
});
|
|
58
145
|
get(MARKET_ROUTES.modelCatalog, async (request, response) => {
|
|
59
146
|
try {
|
|
60
147
|
const query = queryOf(request);
|
|
@@ -64,8 +151,20 @@ export function mountSuiteRoutes(hostCtx, manager, panels) {
|
|
|
64
151
|
sendJson(response, 503, { ok: false, error: error instanceof Error ? error.message : String(error) });
|
|
65
152
|
}
|
|
66
153
|
});
|
|
67
|
-
get(MARKET_ROUTES.mcpStatus, async (
|
|
68
|
-
|
|
154
|
+
get(MARKET_ROUTES.mcpStatus, async (request, response) => {
|
|
155
|
+
const source = readSource(request);
|
|
156
|
+
if ('error' in source) {
|
|
157
|
+
sendJson(response, 404, { ok: false, error: source.error });
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const global = await manager.mcpStatus();
|
|
161
|
+
if (source.reader === undefined) {
|
|
162
|
+
sendJson(response, 200, global);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
const project = await source.reader.mcpStatus();
|
|
166
|
+
const entries = mergeById(global.entries, project.entries);
|
|
167
|
+
sendJson(response, 200, { ...global, entries, totals: mcpTotals(entries) });
|
|
69
168
|
});
|
|
70
169
|
get(MARKET_ROUTES.serverConfig, async (request, response) => {
|
|
71
170
|
try {
|
|
@@ -73,7 +172,7 @@ export function mountSuiteRoutes(hostCtx, manager, panels) {
|
|
|
73
172
|
const kind = query.get('kind');
|
|
74
173
|
if (kind !== 'mcp' && kind !== 'lsp')
|
|
75
174
|
throw new Error('invalid service kind');
|
|
76
|
-
sendJson(response, 200, await manager.serverConfig(kind, query.get('id') ?? ''));
|
|
175
|
+
sendJson(response, 200, await manager.serverConfig(kind, query.get('id') ?? '', query.get('create') === 'true'));
|
|
77
176
|
}
|
|
78
177
|
catch (error) {
|
|
79
178
|
sendJson(response, 400, { ok: false, error: error instanceof Error ? error.message : String(error) });
|
|
@@ -90,15 +189,42 @@ export function mountSuiteRoutes(hostCtx, manager, panels) {
|
|
|
90
189
|
post(MARKET_ROUTES.addMcpServer, async (body) => {
|
|
91
190
|
if (typeof body.name !== 'string')
|
|
92
191
|
throw new Error('MCP server name is required');
|
|
93
|
-
await manager.addMcpServer(body.name, body.config);
|
|
192
|
+
await manager.addMcpServer(body.name, body.config, body.policy);
|
|
94
193
|
return {};
|
|
95
194
|
});
|
|
96
|
-
get(MARKET_ROUTES.lspStatus, async (
|
|
97
|
-
|
|
195
|
+
get(MARKET_ROUTES.lspStatus, async (request, response) => {
|
|
196
|
+
const source = readSource(request);
|
|
197
|
+
if ('error' in source) {
|
|
198
|
+
sendJson(response, 404, { ok: false, error: source.error });
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
const global = await manager.lspStatus();
|
|
202
|
+
if (source.reader === undefined) {
|
|
203
|
+
sendJson(response, 200, global);
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
const project = await source.reader.lspStatus();
|
|
207
|
+
const entries = mergeById(global.entries, project.entries);
|
|
208
|
+
sendJson(response, 200, { ...global, entries, totals: lspTotals(entries), hostMissing: entries.length > 0 && entries.every(entry => entry.state === 'host-missing') });
|
|
98
209
|
});
|
|
99
210
|
get(MARKET_ROUTES.lspServers, async (_request, response) => {
|
|
100
211
|
sendJson(response, 200, { lspServers: await manager.lspServers() });
|
|
101
212
|
});
|
|
213
|
+
get(MARKET_ROUTES.surfaceToggles, async (_request, response) => {
|
|
214
|
+
sendJson(response, 200, surfaceToggles?.currentToggles() ?? {});
|
|
215
|
+
});
|
|
216
|
+
post(MARKET_ROUTES.setSurfaceToggle, async (body) => {
|
|
217
|
+
if (surfaceToggles === undefined)
|
|
218
|
+
throw new Error('surface toggles are not available');
|
|
219
|
+
const key = body.key;
|
|
220
|
+
if (typeof key !== 'string' || !['market', 'skills', 'commands', 'agents', 'mcp', 'lsp'].includes(key)) {
|
|
221
|
+
throw new Error('invalid surface key');
|
|
222
|
+
}
|
|
223
|
+
if (typeof body.enabled !== 'boolean')
|
|
224
|
+
throw new Error('enabled must be a boolean');
|
|
225
|
+
await surfaceToggles.set(key, body.enabled);
|
|
226
|
+
return { toggles: surfaceToggles.currentToggles() };
|
|
227
|
+
});
|
|
102
228
|
get(MARKET_ROUTES.progress, async (_request, response) => {
|
|
103
229
|
sendJson(response, 200, manager.sourceProgress());
|
|
104
230
|
});
|
|
@@ -114,28 +240,63 @@ export function mountSuiteRoutes(hostCtx, manager, panels) {
|
|
|
114
240
|
return;
|
|
115
241
|
}
|
|
116
242
|
try {
|
|
117
|
-
|
|
243
|
+
const source = readSource(request);
|
|
244
|
+
if ('error' in source)
|
|
245
|
+
throw new Error(source.error);
|
|
246
|
+
// The project reader resolves source and suite inside this session's own
|
|
247
|
+
// workspace, so an id invented for another workspace simply is not found.
|
|
248
|
+
sendJson(response, 200, await readOwned(source, reader => reader.suiteDetail(sourceId, suiteId), () => manager.suiteDetail(sourceId, suiteId)));
|
|
118
249
|
}
|
|
119
250
|
catch (error) {
|
|
120
251
|
sendJson(response, 404, { ok: false, error: error instanceof Error ? error.message : String(error) });
|
|
121
252
|
}
|
|
122
253
|
});
|
|
123
|
-
|
|
254
|
+
// One suite document's authored text, whole. This is the market detail page's
|
|
255
|
+
// only document read — skills, commands, and agents all arrive through it when
|
|
256
|
+
// a reader opens the row — and it names the suite and the document rather than
|
|
257
|
+
// a path, so the catalog re-reads the file the scan found.
|
|
258
|
+
get(MARKET_ROUTES.suiteDocument, async (request, response) => {
|
|
124
259
|
const query = queryOf(request);
|
|
125
260
|
const sourceId = query.get('sourceId');
|
|
126
261
|
const suiteId = query.get('suiteId');
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
262
|
+
const kind = query.get('kind');
|
|
263
|
+
const name = query.get('name');
|
|
264
|
+
if (sourceId === null || suiteId === null || name === null || (kind !== 'skills' && kind !== 'commands' && kind !== 'agents')) {
|
|
265
|
+
sendJson(response, 400, { ok: false, error: 'missing sourceId, suiteId, kind, or name' });
|
|
130
266
|
return;
|
|
131
267
|
}
|
|
132
268
|
try {
|
|
133
|
-
|
|
269
|
+
const source = readSource(request);
|
|
270
|
+
sendJson(response, 200, await readOwned(source, reader => reader.suiteDocument(sourceId, suiteId, kind, name), () => manager.suiteDocument(sourceId, suiteId, kind, name)));
|
|
134
271
|
}
|
|
135
272
|
catch (error) {
|
|
136
273
|
sendJson(response, 404, { ok: false, error: error instanceof Error ? error.message : String(error) });
|
|
137
274
|
}
|
|
138
275
|
});
|
|
276
|
+
// One suite document's translation, for the market detail page's skills,
|
|
277
|
+
// commands, and agents. The body names the suite and the document and nothing
|
|
278
|
+
// else: the catalog re-reads that file from the suite's own checkout, so a
|
|
279
|
+
// script on the page cannot spend the operator's translation quota on text of
|
|
280
|
+
// its own choosing — the same contract the user-panel route keeps. The
|
|
281
|
+
// document the reader sees arrives through the document route above, and this
|
|
282
|
+
// route re-reads the same file rather than trusting the page.
|
|
283
|
+
post(MARKET_ROUTES.suiteDocumentTranslation, async (body, request) => {
|
|
284
|
+
const { sourceId, suiteId } = parseTarget(body);
|
|
285
|
+
const kind = body['kind'];
|
|
286
|
+
if (kind !== 'skills' && kind !== 'commands' && kind !== 'agents')
|
|
287
|
+
throw new Error('invalid document kind');
|
|
288
|
+
const name = textField(body['name'] ?? '', 'document name');
|
|
289
|
+
if (name === '')
|
|
290
|
+
throw new Error('missing document name');
|
|
291
|
+
if (body['retry'] !== undefined && typeof body['retry'] !== 'boolean')
|
|
292
|
+
throw new Error('retry must be a boolean');
|
|
293
|
+
const retry = body['retry'] === true;
|
|
294
|
+
// The same reader the document GET uses: the session is taken from the query,
|
|
295
|
+
// validated once, and an unknown or workspace-less session is a diagnostic.
|
|
296
|
+
const source = readSource(request);
|
|
297
|
+
const translated = await readOwned(source, reader => reader.suiteDocumentTranslation(sourceId, suiteId, kind, name, retry), () => manager.suiteDocumentTranslation(sourceId, suiteId, kind, name, retry));
|
|
298
|
+
return { ...translated };
|
|
299
|
+
});
|
|
139
300
|
post(MARKET_ROUTES.addSource, async (body) => {
|
|
140
301
|
const url = textField(body['url'] ?? '', 'source url').trim();
|
|
141
302
|
if (url === '')
|
|
@@ -358,20 +519,63 @@ export function mountSuiteRoutes(hostCtx, manager, panels) {
|
|
|
358
519
|
// each mutation notifies the change pipeline so skills/commands remount.
|
|
359
520
|
if (panels !== undefined) {
|
|
360
521
|
const kinds = ['skills', 'commands', 'agents'];
|
|
361
|
-
|
|
522
|
+
// Reads answer for the requesting session's own panels when one is named;
|
|
523
|
+
// the mutations below stay global, so a project query can never edit the
|
|
524
|
+
// user's own panel documents.
|
|
525
|
+
const storeOf = (kind, reader) => (reader?.panels ?? panels)[kind];
|
|
526
|
+
const readStore = (kind, request) => {
|
|
527
|
+
const source = readSource(request);
|
|
528
|
+
return 'error' in source ? { error: source.error } : { store: storeOf(kind, source.reader) };
|
|
529
|
+
};
|
|
362
530
|
for (const kind of kinds) {
|
|
363
|
-
get(userPanelRoute(kind), async (
|
|
364
|
-
|
|
531
|
+
get(userPanelRoute(kind), async (request, response) => {
|
|
532
|
+
const source = readStore(kind, request);
|
|
533
|
+
if ('error' in source) {
|
|
534
|
+
sendJson(response, 404, { ok: false, error: source.error });
|
|
535
|
+
return;
|
|
536
|
+
}
|
|
537
|
+
// `refresh=1` is the panel's Refresh button: a user asking for the
|
|
538
|
+
// working tree as it stands must never be answered from the row cache,
|
|
539
|
+
// so the route carries an explicit force path instead of relying on how
|
|
540
|
+
// old the cached rows happen to be.
|
|
541
|
+
const force = queryOf(request).get('refresh') === '1';
|
|
542
|
+
// The pending count rides the same read: a panel re-reads while it is
|
|
543
|
+
// non-zero, so translated text arrives without a manual refresh.
|
|
544
|
+
const read = await source.store.read(false, force);
|
|
545
|
+
sendJson(response, 200, {
|
|
546
|
+
entries: read.entries,
|
|
547
|
+
...(read.translationPending === 0 ? {} : { translationPending: read.translationPending })
|
|
548
|
+
});
|
|
365
549
|
});
|
|
366
550
|
get(`${userPanelRoute(kind)}/entry`, async (request, response) => {
|
|
551
|
+
const source = readStore(kind, request);
|
|
552
|
+
if ('error' in source) {
|
|
553
|
+
sendJson(response, 404, { ok: false, error: source.error });
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
367
556
|
const name = queryOf(request).get('name') ?? '';
|
|
368
|
-
const entry = await
|
|
557
|
+
const entry = await source.store.get(name);
|
|
369
558
|
if (entry === undefined) {
|
|
370
559
|
sendJson(response, 404, { ok: false, error: `no entry named "${name}"` });
|
|
371
560
|
return;
|
|
372
561
|
}
|
|
373
562
|
sendJson(response, 200, { entry });
|
|
374
563
|
});
|
|
564
|
+
// One entry's document, translated chunk by chunk. The body names the
|
|
565
|
+
// entry and nothing else: the store re-reads that entry itself, so a
|
|
566
|
+
// script on the page cannot spend the operator's translation quota on
|
|
567
|
+
// text of its own choosing.
|
|
568
|
+
post(`${userPanelRoute(kind)}/entry/translation`, async (body, request) => {
|
|
569
|
+
const source = readStore(kind, request);
|
|
570
|
+
if ('error' in source)
|
|
571
|
+
throw new Error(source.error);
|
|
572
|
+
const name = textField(body['name'] ?? '', 'entry name');
|
|
573
|
+
if (name === '')
|
|
574
|
+
throw new Error('missing entry name');
|
|
575
|
+
if (body['retry'] !== undefined && typeof body['retry'] !== 'boolean')
|
|
576
|
+
throw new Error('retry must be a boolean');
|
|
577
|
+
return { ...(await source.store.translateDocument(name, body['retry'] === true)) };
|
|
578
|
+
});
|
|
375
579
|
post(`${userPanelRoute(kind)}/create`, async (body) => {
|
|
376
580
|
const name = textField(body['name'] ?? '', 'entry name').trim();
|
|
377
581
|
const text = textField(body['text'] ?? '', 'entry text');
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { McpMountRegistry } from '../../market-mcp/src/index.js';
|
|
2
|
+
import { deriveServerName } from '../../market-mcp/src/index.js';
|
|
3
|
+
import { LspMountRegistry } from '../../market-lsp/src/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Build the shared-service MCP adapter over one context.
|
|
6
|
+
*
|
|
7
|
+
* The mount registry stays the sole owner of its transport state: this wrapper
|
|
8
|
+
* only adds the mount proof, which needs the registry's own server-name
|
|
9
|
+
* derivation, and forwards every other call unchanged.
|
|
10
|
+
* @param ctx - the context the registry mounts through.
|
|
11
|
+
* @param dataRoot - the plugin data root the registry stores overrides under.
|
|
12
|
+
* @returns the MCP adapter the coordinator drives.
|
|
13
|
+
*/
|
|
14
|
+
export function createSharedMcpMount(ctx, dataRoot) {
|
|
15
|
+
const registry = new McpMountRegistry(ctx, dataRoot);
|
|
16
|
+
return {
|
|
17
|
+
setOverridesProvider: provider => registry.setOverridesProvider(provider),
|
|
18
|
+
setBackendProvider: provider => registry.setBackendProvider(provider),
|
|
19
|
+
setToolNamesProvider: provider => registry.setToolNamesProvider(provider),
|
|
20
|
+
setEntryFilter: filter => registry.setEntryFilter(filter),
|
|
21
|
+
usesCredential: ref => registry.usesCredential(ref),
|
|
22
|
+
forceRemount: (suiteId, serverKey) => registry.forceRemount(suiteId, serverKey),
|
|
23
|
+
forceRemountAll: () => registry.forceRemountAll(),
|
|
24
|
+
serverOwner: serverName => registry.serverOwner(serverName),
|
|
25
|
+
reconcile: suites => registry.reconcile(suites),
|
|
26
|
+
disposeAll: () => registry.disposeAll(),
|
|
27
|
+
toolOwnership: () => registry.toolOwnership(),
|
|
28
|
+
assertMounted: (suite, diagnostics, failed) => {
|
|
29
|
+
const key = suite.sourceId + '/' + suite.id;
|
|
30
|
+
for (const serverKey of Object.keys(suite.mcp?.servers ?? {})) {
|
|
31
|
+
const owner = registry.serverOwner(deriveServerName(suite, serverKey));
|
|
32
|
+
if (owner?.suiteId !== key || owner.serverKey !== serverKey || diagnostics.some(row => row.suiteId === key && row.serverKey === serverKey) || failed)
|
|
33
|
+
throw new Error('extension-shared-mcp-unavailable: ' + key + '/' + serverKey);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Create one MCP mount for an agent-scoped contributor.
|
|
40
|
+
*
|
|
41
|
+
* The contributor mounts into contexts it does not own, so it takes the factory
|
|
42
|
+
* and calls it per context; the adapter is the same object the coordinator
|
|
43
|
+
* drives, which keeps one registry implementation behind both seams.
|
|
44
|
+
* @param ctx - the context the mount registers into.
|
|
45
|
+
* @param dataRoot - the plugin data root the mount stores overrides under.
|
|
46
|
+
* @returns the MCP mount for that context.
|
|
47
|
+
*/
|
|
48
|
+
export const createMcpMount = (ctx, dataRoot) => createSharedMcpMount(ctx, dataRoot);
|
|
49
|
+
/**
|
|
50
|
+
* Build both mount adapters one reconciler drives.
|
|
51
|
+
* @param ctx - the context the registries mount through.
|
|
52
|
+
* @param dataRoot - the plugin data root the MCP registry stores overrides under.
|
|
53
|
+
* @returns the MCP and LSP adapters for that reconciler.
|
|
54
|
+
*/
|
|
55
|
+
export function createRuntimeMounts(ctx, dataRoot) {
|
|
56
|
+
return { mcp: createSharedMcpMount(ctx, dataRoot), lsp: new LspMountRegistry(ctx) };
|
|
57
|
+
}
|