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
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { CommandMountRegistry } from '../surfaces/commands-mounts.js';
|
|
2
|
-
import { HooksMountRegistry } from '../surfaces/hooks-mounts.js';
|
|
3
|
-
import { LspMountRegistry } from '../lsp/lsp-mounts.js';
|
|
4
|
-
import { McpMountRegistry } from '../mcp/mcp-mounts.js';
|
|
5
|
-
import { bindHostLocale } from '../host/host-locale.js';
|
|
6
|
-
export class RuntimeReconciler {
|
|
7
|
-
mcp;
|
|
8
|
-
commands;
|
|
9
|
-
hooks;
|
|
10
|
-
lspRegistry;
|
|
11
|
-
queues = new Map();
|
|
12
|
-
disposed = false;
|
|
13
|
-
constructor(ctx, dataRoot, t = bindHostLocale(undefined)) {
|
|
14
|
-
this.mcp = new McpMountRegistry(ctx, dataRoot);
|
|
15
|
-
this.commands = new CommandMountRegistry(ctx, t, dataRoot);
|
|
16
|
-
this.hooks = new HooksMountRegistry(ctx);
|
|
17
|
-
this.lspRegistry = new LspMountRegistry(ctx);
|
|
18
|
-
this.lspRegistry.setPluginDataRoot(dataRoot);
|
|
19
|
-
}
|
|
20
|
-
/** The LSP mount registry, consumed by the LSP status surface. */
|
|
21
|
-
get lsp() {
|
|
22
|
-
return this.lspRegistry;
|
|
23
|
-
}
|
|
24
|
-
/** Install the per-suite MCP overrides provider used at mount time. */
|
|
25
|
-
setMcpOverridesProvider(provider) {
|
|
26
|
-
this.mcp.setOverridesProvider(provider);
|
|
27
|
-
}
|
|
28
|
-
/** Install the live tool-name provider used for foreign-namespace mount guards. */
|
|
29
|
-
setMcpToolNamesProvider(provider) {
|
|
30
|
-
this.mcp.setToolNamesProvider(provider);
|
|
31
|
-
}
|
|
32
|
-
/** Install the backend provider deciding which MCP client mounts each server. */
|
|
33
|
-
setMcpBackendProvider(provider) {
|
|
34
|
-
this.mcp.setBackendProvider(provider);
|
|
35
|
-
}
|
|
36
|
-
/** Whether the current MCP snapshot uses one credential reference. */
|
|
37
|
-
usesCredential(ref) {
|
|
38
|
-
return this.mcp.usesCredential(ref);
|
|
39
|
-
}
|
|
40
|
-
/** Flag one MCP mount for an explicit rebuild on the next reconcile. */
|
|
41
|
-
forceMcpRemount(suiteId, serverKey) {
|
|
42
|
-
this.mcp.forceRemount(suiteId, serverKey);
|
|
43
|
-
}
|
|
44
|
-
/** Flag every live MCP mount for a rebuild on the next reconcile. */
|
|
45
|
-
forceMcpRemountAll() {
|
|
46
|
-
this.mcp.forceRemountAll();
|
|
47
|
-
}
|
|
48
|
-
/** The mount key owning one derived serverName; undefined when not mounted here. */
|
|
49
|
-
mcpServerOwner(serverName) {
|
|
50
|
-
return this.mcp.serverOwner(serverName);
|
|
51
|
-
}
|
|
52
|
-
/** Reconcile all runtime surfaces against one enabled-suite snapshot. */
|
|
53
|
-
async reconcile(enabledSuites) {
|
|
54
|
-
const suites = [...enabledSuites];
|
|
55
|
-
const diagnostics = { mcp: [], commands: [], hooks: [], lsp: [], errors: [] };
|
|
56
|
-
if (this.disposed)
|
|
57
|
-
return diagnostics;
|
|
58
|
-
const reconcileSurface = (surface, reconcile) => {
|
|
59
|
-
const run = (this.queues.get(surface) ?? Promise.resolve()).then(async () => {
|
|
60
|
-
if (this.disposed)
|
|
61
|
-
return;
|
|
62
|
-
try {
|
|
63
|
-
diagnostics[surface] = await reconcile();
|
|
64
|
-
}
|
|
65
|
-
catch (error) {
|
|
66
|
-
diagnostics.errors.push({ surface, reason: messageOf(error) });
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
this.queues.set(surface, run);
|
|
70
|
-
return run;
|
|
71
|
-
};
|
|
72
|
-
// Network-backed MCP startup must not delay local commands, hooks or LSP.
|
|
73
|
-
// Each surface retains its own order when catalog mutations overlap.
|
|
74
|
-
await Promise.all([
|
|
75
|
-
reconcileSurface('mcp', () => this.mcp.reconcile(suites)),
|
|
76
|
-
reconcileSurface('commands', () => this.commands.reconcile(suites)),
|
|
77
|
-
reconcileSurface('hooks', () => this.hooks.reconcile(suites)),
|
|
78
|
-
reconcileSurface('lsp', () => this.lspRegistry.reconcile(suites))
|
|
79
|
-
]);
|
|
80
|
-
return diagnostics;
|
|
81
|
-
}
|
|
82
|
-
/** Dispose all live mounts and registrations. */
|
|
83
|
-
async dispose() {
|
|
84
|
-
this.disposed = true;
|
|
85
|
-
const disposeSurface = async (surface, dispose) => {
|
|
86
|
-
await this.queues.get(surface);
|
|
87
|
-
await dispose();
|
|
88
|
-
};
|
|
89
|
-
await Promise.all([
|
|
90
|
-
disposeSurface('mcp', () => this.mcp.disposeAll()),
|
|
91
|
-
disposeSurface('commands', () => this.commands.disposeAll()),
|
|
92
|
-
disposeSurface('hooks', () => this.hooks.disposeAll()),
|
|
93
|
-
disposeSurface('lsp', () => this.lspRegistry.disposeAll())
|
|
94
|
-
]);
|
|
95
|
-
this.queues.clear();
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
function messageOf(error) {
|
|
99
|
-
return error instanceof Error ? error.message : String(error);
|
|
100
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* User command mounting: every enabled entry of the user commands panel
|
|
3
|
-
* registers as a dsh slash command, so user-authored quick replies behave
|
|
4
|
-
* exactly like suite commands — the body with `$ARGUMENTS` substituted rides
|
|
5
|
-
* one follow-up message on the receiving agent. A nested entry registers
|
|
6
|
-
* under its flattened call name (`git/commit` → `git-commit`) while the panel
|
|
7
|
-
* keeps addressing it by path; when two entries flatten to one call name the
|
|
8
|
-
* first registers and the other is reported. Reconciled on every catalog
|
|
9
|
-
* change, keyed by the call name.
|
|
10
|
-
* @module runtime/user-commands
|
|
11
|
-
*/
|
|
12
|
-
import { createUserMessage } from '@deepseek-ai/dsh-llm';
|
|
13
|
-
import { commandCallName } from '../../model/command-names.js';
|
|
14
|
-
import { USER_ENTRY_PATH } from '../../application/panels/user-store.js';
|
|
15
|
-
import { pluginMarketSource } from '../host/plugin-message-source.js';
|
|
16
|
-
/** Register/unregister user-panel commands to match the panel's enabled entries. */
|
|
17
|
-
export class UserCommandMountRegistry {
|
|
18
|
-
ctx;
|
|
19
|
-
store;
|
|
20
|
-
t;
|
|
21
|
-
fingerprints = new Map();
|
|
22
|
-
live = new Map();
|
|
23
|
-
constructor(ctx, store, t) {
|
|
24
|
-
this.ctx = ctx;
|
|
25
|
-
this.store = store;
|
|
26
|
-
this.t = t;
|
|
27
|
-
}
|
|
28
|
-
/** Sync the live registrations with the panel's enabled entries. */
|
|
29
|
-
async reconcile() {
|
|
30
|
-
const diagnostics = [];
|
|
31
|
-
const entries = await this.store.list();
|
|
32
|
-
const wanted = new Map();
|
|
33
|
-
// Registration is keyed by call name, so two entries that flatten to the
|
|
34
|
-
// same one cannot silently shadow each other.
|
|
35
|
-
const owners = new Map();
|
|
36
|
-
for (const entry of entries) {
|
|
37
|
-
if (entry.disabled)
|
|
38
|
-
continue;
|
|
39
|
-
if (!USER_ENTRY_PATH.test(entry.name))
|
|
40
|
-
continue;
|
|
41
|
-
const callName = commandCallName(entry.name);
|
|
42
|
-
const owner = owners.get(callName);
|
|
43
|
-
if (owner !== undefined) {
|
|
44
|
-
diagnostics.push(`command "${callName}": "${entry.name}" is shadowed by "${owner}" — both flatten to the same call name`);
|
|
45
|
-
continue;
|
|
46
|
-
}
|
|
47
|
-
owners.set(callName, entry.name);
|
|
48
|
-
wanted.set(callName, {
|
|
49
|
-
name: callName,
|
|
50
|
-
description: entry.description === '' ? `[${this.t('userCommandSourceLabel')}] ${callName}` : `[${this.t('userCommandSourceLabel')}] ${entry.description}`,
|
|
51
|
-
...(typeof entry.metadata['argument-hint'] === 'string' && entry.metadata['argument-hint'] !== '' ? { hint: entry.metadata['argument-hint'] } : {}),
|
|
52
|
-
body: entry.content
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
for (const [key, disposer] of [...this.live]) {
|
|
56
|
-
if (!wanted.has(key)) {
|
|
57
|
-
disposer();
|
|
58
|
-
this.live.delete(key);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
const host = this.ctx;
|
|
62
|
-
if (typeof host.commands?.register !== 'function') {
|
|
63
|
-
if (wanted.size > 0)
|
|
64
|
-
diagnostics.push('ctx.commands is not available in this profile; user commands stay unregistered');
|
|
65
|
-
return diagnostics;
|
|
66
|
-
}
|
|
67
|
-
for (const [key, spec] of wanted) {
|
|
68
|
-
const fingerprint = JSON.stringify(spec);
|
|
69
|
-
if (this.live.has(key) && this.fingerprints.get(key) === fingerprint)
|
|
70
|
-
continue;
|
|
71
|
-
this.live.get(key)?.();
|
|
72
|
-
this.live.delete(key);
|
|
73
|
-
this.fingerprints.delete(key);
|
|
74
|
-
try {
|
|
75
|
-
const disposer = host.commands.register({
|
|
76
|
-
name: spec.name,
|
|
77
|
-
description: spec.description,
|
|
78
|
-
...(spec.hint === undefined ? {} : { input: { hint: spec.hint } }),
|
|
79
|
-
handler: invocation => {
|
|
80
|
-
const agent = invocation.agent;
|
|
81
|
-
const text = spec.body.replaceAll('$ARGUMENTS', invocation.rawInput.trim());
|
|
82
|
-
agent.followup(createUserMessage({
|
|
83
|
-
content: [{ type: 'text', text }],
|
|
84
|
-
source: pluginMarketSource()
|
|
85
|
-
}));
|
|
86
|
-
return { kind: 'success', text: this.t('commandAcknowledged', { command: spec.name }) };
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
this.live.set(key, disposer);
|
|
90
|
-
this.fingerprints.set(key, fingerprint);
|
|
91
|
-
}
|
|
92
|
-
catch (error) {
|
|
93
|
-
diagnostics.push(`command "${spec.name}": ${error instanceof Error ? error.message : String(error)}`);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
return diagnostics;
|
|
97
|
-
}
|
|
98
|
-
/** Dispose every registration (plugin teardown). */
|
|
99
|
-
disposeAll() {
|
|
100
|
-
for (const disposer of [...this.live.values()])
|
|
101
|
-
disposer();
|
|
102
|
-
this.live.clear();
|
|
103
|
-
this.fingerprints.clear();
|
|
104
|
-
}
|
|
105
|
-
}
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import { createUserMessage } from '@deepseek-ai/dsh-llm';
|
|
2
|
-
import { parse as parseYaml } from 'yaml';
|
|
3
|
-
import { stripFrontmatter } from '../../catalog/skills-parse.js';
|
|
4
|
-
import { parseFrontmatterRecord } from '../../application/panels/user-store.js';
|
|
5
|
-
import { qualifiedSuiteId, suiteDataDir } from '../../catalog/paths.js';
|
|
6
|
-
import { expandPluginPaths, pluginRootOf } from '../../catalog/plugin-variables.js';
|
|
7
|
-
import { defaultMarkdownResources, resourceText, resourceCommandName } from '../../catalog/component-files.js';
|
|
8
|
-
import { bindHostLocale } from '../host/host-locale.js';
|
|
9
|
-
import { injectDynamicContext, shellSeamOf } from './dynamic-context.js';
|
|
10
|
-
import { pluginMarketSource } from '../host/plugin-message-source.js';
|
|
11
|
-
const COMMAND_NAME = /^[a-z][a-z0-9_-]*$/;
|
|
12
|
-
export class CommandMountRegistry {
|
|
13
|
-
ctx;
|
|
14
|
-
t;
|
|
15
|
-
dataRoot;
|
|
16
|
-
fingerprints = new Map();
|
|
17
|
-
live = new Map();
|
|
18
|
-
constructor(ctx, t = bindHostLocale(undefined), dataRoot) {
|
|
19
|
-
this.ctx = ctx;
|
|
20
|
-
this.t = t;
|
|
21
|
-
this.dataRoot = dataRoot;
|
|
22
|
-
}
|
|
23
|
-
/** The live shell seam, when the profile has one; dynamic context stays literal without it. */
|
|
24
|
-
shell() {
|
|
25
|
-
return shellSeamOf(this.ctx);
|
|
26
|
-
}
|
|
27
|
-
/** Register/unregister suite commands to match the enabled suites exactly. */
|
|
28
|
-
async reconcile(enabledSuites) {
|
|
29
|
-
const diagnostics = [];
|
|
30
|
-
const wanted = new Map();
|
|
31
|
-
for (const suite of enabledSuites) {
|
|
32
|
-
const specs = suite.activeSurfaces.commands === false ? [] : await readCommands(suite.root, suite.resources?.commands);
|
|
33
|
-
const suiteRoot = pluginRootOf(suite);
|
|
34
|
-
const suiteData = suiteRoot === undefined || this.dataRoot === undefined ? undefined : suiteDataDir(this.dataRoot, suite.sourceId, suite.id);
|
|
35
|
-
for (const spec of specs) {
|
|
36
|
-
// The registry key is source-qualified: bare suite ids are unique per
|
|
37
|
-
// source only, so two sources' same-named suites would collide.
|
|
38
|
-
const suiteKey = qualifiedSuiteId(suite.sourceId, suite.id);
|
|
39
|
-
const key = `${suiteKey}/${spec.name}`;
|
|
40
|
-
if (wanted.has(key)) {
|
|
41
|
-
diagnostics.push({ suiteId: suiteKey, command: spec.name, reason: 'duplicate normalized command name' });
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
wanted.set(key, {
|
|
45
|
-
...spec,
|
|
46
|
-
suiteId: suiteKey,
|
|
47
|
-
suiteName: suite.manifest.name,
|
|
48
|
-
...(suiteRoot === undefined ? {} : { suiteRoot }),
|
|
49
|
-
...(suiteData === undefined ? {} : { suiteData })
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
for (const [key, disposer] of [...this.live]) {
|
|
54
|
-
if (!wanted.has(key)) {
|
|
55
|
-
disposer();
|
|
56
|
-
this.live.delete(key);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
const host = this.ctx;
|
|
60
|
-
if (typeof host.commands?.register !== 'function') {
|
|
61
|
-
if (wanted.size > 0)
|
|
62
|
-
diagnostics.push({ suiteId: '', command: '', reason: 'ctx.commands is not available in this profile' });
|
|
63
|
-
return diagnostics;
|
|
64
|
-
}
|
|
65
|
-
for (const [key, spec] of wanted) {
|
|
66
|
-
const fingerprint = JSON.stringify(spec);
|
|
67
|
-
if (this.live.has(key) && this.fingerprints.get(key) === fingerprint)
|
|
68
|
-
continue;
|
|
69
|
-
this.live.get(key)?.();
|
|
70
|
-
this.live.delete(key);
|
|
71
|
-
this.fingerprints.delete(key);
|
|
72
|
-
try {
|
|
73
|
-
const disposer = host.commands.register({
|
|
74
|
-
name: spec.name,
|
|
75
|
-
description: `[${spec.suiteName}] ${spec.description}`,
|
|
76
|
-
...(spec.hint === undefined ? {} : { input: { hint: spec.hint } }),
|
|
77
|
-
handler: async (invocation) => {
|
|
78
|
-
const agent = invocation.agent;
|
|
79
|
-
const workdir = agent.session?.header?.cwd;
|
|
80
|
-
// The template rides the agent verbatim apart from the placeholders
|
|
81
|
-
// its author wrote: a decorator line naming this plugin or the
|
|
82
|
-
// suite would be text the command author never wrote, and the
|
|
83
|
-
// follow-up's `source` already records provenance.
|
|
84
|
-
const body = expandPluginPaths(spec.body, {
|
|
85
|
-
...(spec.suiteRoot === undefined ? {} : { root: spec.suiteRoot }),
|
|
86
|
-
...(spec.suiteData === undefined ? {} : { data: spec.suiteData }),
|
|
87
|
-
...(workdir === undefined ? {} : { projectDir: workdir })
|
|
88
|
-
}).replaceAll('$ARGUMENTS', invocation.rawInput.trim());
|
|
89
|
-
const shell = this.shell();
|
|
90
|
-
if (shell === undefined) {
|
|
91
|
-
agent.followup(createUserMessage({
|
|
92
|
-
content: [{ type: 'text', text: body }],
|
|
93
|
-
source: pluginMarketSource()
|
|
94
|
-
}));
|
|
95
|
-
return { kind: 'success', text: this.t('commandAcknowledged', { command: spec.name }) };
|
|
96
|
-
}
|
|
97
|
-
let text;
|
|
98
|
-
try {
|
|
99
|
-
text = await injectDynamicContext(body, { shell, ...(workdir === undefined ? {} : { workdir }) });
|
|
100
|
-
}
|
|
101
|
-
catch (error) {
|
|
102
|
-
return { kind: 'error', text: error instanceof Error ? error.message : String(error) };
|
|
103
|
-
}
|
|
104
|
-
agent.followup(createUserMessage({
|
|
105
|
-
content: [{ type: 'text', text }],
|
|
106
|
-
source: pluginMarketSource()
|
|
107
|
-
}));
|
|
108
|
-
return { kind: 'success', text: this.t('commandAcknowledged', { command: spec.name }) };
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
this.live.set(key, disposer);
|
|
112
|
-
this.fingerprints.set(key, fingerprint);
|
|
113
|
-
}
|
|
114
|
-
catch (error) {
|
|
115
|
-
diagnostics.push({ suiteId: spec.suiteId, command: spec.name, reason: error instanceof Error ? error.message : String(error) });
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return diagnostics;
|
|
119
|
-
}
|
|
120
|
-
/** Dispose every registered command; used at plugin teardown. */
|
|
121
|
-
disposeAll() {
|
|
122
|
-
for (const disposer of [...this.live.values()])
|
|
123
|
-
disposer();
|
|
124
|
-
this.live.clear();
|
|
125
|
-
this.fingerprints.clear();
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
/** Parse `commands/*.md` of one suite root (Claude Code format). */
|
|
129
|
-
export async function readCommands(root, resources) {
|
|
130
|
-
const entries = resources ?? (await defaultMarkdownResources(root, 'commands'));
|
|
131
|
-
const specs = [];
|
|
132
|
-
for (const entry of entries) {
|
|
133
|
-
const name = resourceCommandName(entry.name);
|
|
134
|
-
if (!COMMAND_NAME.test(name))
|
|
135
|
-
continue;
|
|
136
|
-
let text;
|
|
137
|
-
try {
|
|
138
|
-
text = await resourceText(entry);
|
|
139
|
-
}
|
|
140
|
-
catch {
|
|
141
|
-
continue;
|
|
142
|
-
}
|
|
143
|
-
try {
|
|
144
|
-
if (parseFrontmatterRecord(text).disabled === true)
|
|
145
|
-
continue;
|
|
146
|
-
}
|
|
147
|
-
catch {
|
|
148
|
-
continue;
|
|
149
|
-
}
|
|
150
|
-
const meta = commandMeta(text);
|
|
151
|
-
const description = meta?.description ?? firstLine(text);
|
|
152
|
-
if (description === undefined)
|
|
153
|
-
continue;
|
|
154
|
-
specs.push({ name, description, hint: meta?.hint, body: stripFrontmatter(text) });
|
|
155
|
-
}
|
|
156
|
-
return specs;
|
|
157
|
-
}
|
|
158
|
-
function commandMeta(text) {
|
|
159
|
-
const frontmatter = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec(text)?.[1];
|
|
160
|
-
if (frontmatter === undefined)
|
|
161
|
-
return undefined;
|
|
162
|
-
try {
|
|
163
|
-
const raw = parseYaml(frontmatter);
|
|
164
|
-
if (typeof raw !== 'object' || raw === null)
|
|
165
|
-
return undefined;
|
|
166
|
-
const record = raw;
|
|
167
|
-
const meta = {};
|
|
168
|
-
const description = record['description'];
|
|
169
|
-
if (typeof description === 'string' && description.trim() !== '')
|
|
170
|
-
meta.description = description.trim();
|
|
171
|
-
const hint = record['argument-hint'] ?? record['argumentHint'];
|
|
172
|
-
if (typeof hint === 'string' && hint.trim() !== '')
|
|
173
|
-
meta.hint = hint.trim();
|
|
174
|
-
return meta;
|
|
175
|
-
}
|
|
176
|
-
catch {
|
|
177
|
-
return undefined;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
function firstLine(text) {
|
|
181
|
-
const line = text
|
|
182
|
-
.split('\n')
|
|
183
|
-
.map(line => line.trim())
|
|
184
|
-
.find(line => line !== '');
|
|
185
|
-
return line;
|
|
186
|
-
}
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skill provider feeding installed suites into `ctx.skills`.
|
|
3
|
-
*
|
|
4
|
-
* One provider serves both dimensions. Ranks sit between the shipped
|
|
5
|
-
* filesystem roots so each dimension's own skills still win:
|
|
6
|
-
* project suites (250) lose to the project's `.dsh/skills` (100) and
|
|
7
|
-
* `.agents/skills` (200) but beat custom (300); user suites (450) lose to
|
|
8
|
-
* the user's own `~/.dsh/skills` (400) and beat `~/.agents/skills` (500).
|
|
9
|
-
*
|
|
10
|
-
* Bodies are rewritten on load: the path variables Claude Code authors write
|
|
11
|
-
* into skill prose (`${CLAUDE_PLUGIN_ROOT}`, `${CLAUDE_PLUGIN_DATA}`,
|
|
12
|
-
* `${CLAUDE_PROJECT_DIR}`, `${CLAUDE_SKILL_DIR}`) are substituted, `` !`cmd` ``
|
|
13
|
-
* dynamic-context placeholders run, and the resource base points at the skill
|
|
14
|
-
* directory, so CC-authored skills work verbatim under the harness.
|
|
15
|
-
*/
|
|
16
|
-
import { readFile } from 'node:fs/promises';
|
|
17
|
-
import { parseSkillFrontmatter, stripFrontmatter } from '../../catalog/skills-parse.js';
|
|
18
|
-
import { parseFrontmatterRecord } from '../../application/panels/user-store.js';
|
|
19
|
-
import { expandPluginPaths, pluginRootOf } from '../../catalog/plugin-variables.js';
|
|
20
|
-
import { suiteDataDir } from '../../catalog/paths.js';
|
|
21
|
-
import { injectDynamicContext } from './dynamic-context.js';
|
|
22
|
-
export const SUITE_PROJECT_SOURCE = 'agent-plugin-project';
|
|
23
|
-
export const SUITE_USER_SOURCE = 'agent-plugin-user';
|
|
24
|
-
const PROJECT_RANK = 250;
|
|
25
|
-
const USER_RANK = 450;
|
|
26
|
-
export class SuiteSkillProvider {
|
|
27
|
-
manager;
|
|
28
|
-
options;
|
|
29
|
-
name = 'agent-plugin';
|
|
30
|
-
constructor(manager, options = {}) {
|
|
31
|
-
this.manager = manager;
|
|
32
|
-
this.options = options;
|
|
33
|
-
}
|
|
34
|
-
async list(options) {
|
|
35
|
-
const located = await this.locate(options.cwd);
|
|
36
|
-
located.sort((a, b) => a.rank - b.rank || a.suite.id.localeCompare(b.suite.id) || a.skill.name.localeCompare(b.skill.name));
|
|
37
|
-
// Dedupe by skill name across dimensions: the sort above puts project
|
|
38
|
-
// suites (250) ahead of user suites (450), so a project's own skill
|
|
39
|
-
// always wins over an installed suite shipping a skill of the same name.
|
|
40
|
-
const seen = new Set();
|
|
41
|
-
const unique = [];
|
|
42
|
-
for (const entry of located) {
|
|
43
|
-
if (seen.has(entry.skill.name))
|
|
44
|
-
continue;
|
|
45
|
-
seen.add(entry.skill.name);
|
|
46
|
-
unique.push(entry);
|
|
47
|
-
}
|
|
48
|
-
return unique.map(entry => this.candidateFor(entry));
|
|
49
|
-
}
|
|
50
|
-
async get(candidate, options) {
|
|
51
|
-
const locator = candidate.locator;
|
|
52
|
-
let text;
|
|
53
|
-
try {
|
|
54
|
-
text = locator.content ?? (await readFile(locator.file, 'utf8'));
|
|
55
|
-
}
|
|
56
|
-
catch {
|
|
57
|
-
return undefined;
|
|
58
|
-
}
|
|
59
|
-
try {
|
|
60
|
-
if (parseFrontmatterRecord(text).disabled === true)
|
|
61
|
-
return undefined;
|
|
62
|
-
}
|
|
63
|
-
catch {
|
|
64
|
-
return undefined;
|
|
65
|
-
}
|
|
66
|
-
const parsed = parseSkillFrontmatter(text, candidate.name);
|
|
67
|
-
if (typeof parsed === 'string')
|
|
68
|
-
return undefined;
|
|
69
|
-
const authored = [stripFrontmatter(text), ...(locator.skillInstructions === undefined ? [] : [locator.skillInstructions])].join('\n\n');
|
|
70
|
-
const withPaths = expandPluginPaths(authored, {
|
|
71
|
-
...(locator.suiteRoot === undefined ? {} : { root: locator.suiteRoot }),
|
|
72
|
-
...(locator.data === undefined ? {} : { data: locator.data }),
|
|
73
|
-
skillDir: locator.directory,
|
|
74
|
-
...(options.cwd === undefined ? {} : { projectDir: options.cwd })
|
|
75
|
-
});
|
|
76
|
-
const shell = this.options.shell?.();
|
|
77
|
-
const content = shell === undefined
|
|
78
|
-
? withPaths
|
|
79
|
-
: await injectDynamicContext(withPaths, {
|
|
80
|
-
shell,
|
|
81
|
-
...(options.cwd === undefined ? {} : { workdir: options.cwd }),
|
|
82
|
-
...(options.signal === undefined ? {} : { signal: options.signal })
|
|
83
|
-
});
|
|
84
|
-
return {
|
|
85
|
-
name: parsed.name,
|
|
86
|
-
description: candidate.description,
|
|
87
|
-
...(parsed.whenToUse === undefined ? {} : { whenToUse: parsed.whenToUse }),
|
|
88
|
-
invocation: parsed.invocation,
|
|
89
|
-
source: candidate.source,
|
|
90
|
-
provider: this.name,
|
|
91
|
-
resourceBase: { kind: 'directory', path: locator.directory },
|
|
92
|
-
path: locator.file,
|
|
93
|
-
content
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
candidateFor(entry) {
|
|
97
|
-
return {
|
|
98
|
-
name: entry.skill.name,
|
|
99
|
-
// The author's description verbatim — the harness renders it into the
|
|
100
|
-
// model's skill catalog, where a suite-name prefix is our packaging.
|
|
101
|
-
description: entry.skill.description,
|
|
102
|
-
...(entry.skill.whenToUse === undefined ? {} : { whenToUse: entry.skill.whenToUse }),
|
|
103
|
-
invocation: entry.skill.invocation,
|
|
104
|
-
source: entry.source,
|
|
105
|
-
provider: this.name,
|
|
106
|
-
rank: entry.rank,
|
|
107
|
-
locator: {
|
|
108
|
-
...(entry.content === undefined ? {} : { content: entry.content }),
|
|
109
|
-
...(entry.suite.manifest.skillInstructions === undefined ? {} : { skillInstructions: entry.suite.manifest.skillInstructions }),
|
|
110
|
-
file: entry.skill.file,
|
|
111
|
-
directory: entry.skill.directory,
|
|
112
|
-
...(pluginRootOf(entry.suite) === undefined
|
|
113
|
-
? {}
|
|
114
|
-
: {
|
|
115
|
-
suiteRoot: entry.suite.root,
|
|
116
|
-
...(this.options.dataRoot === undefined ? {} : { data: suiteDataDir(this.options.dataRoot, entry.suite.sourceId, entry.suite.id) })
|
|
117
|
-
})
|
|
118
|
-
},
|
|
119
|
-
path: entry.skill.file,
|
|
120
|
-
resourceBase: { kind: 'directory', path: entry.skill.directory }
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
async locate(cwd) {
|
|
124
|
-
const located = [];
|
|
125
|
-
const userSuites = await this.manager.enabledUserSuites();
|
|
126
|
-
for (const suite of userSuites) {
|
|
127
|
-
for (const skill of suite.activeSurfaces.skills === false ? [] : suite.skills) {
|
|
128
|
-
try {
|
|
129
|
-
if (parseFrontmatterRecord(await readFile(skill.file, 'utf8')).disabled === true)
|
|
130
|
-
continue;
|
|
131
|
-
}
|
|
132
|
-
catch {
|
|
133
|
-
continue;
|
|
134
|
-
}
|
|
135
|
-
located.push({ rank: USER_RANK, source: SUITE_USER_SOURCE, suite, skill });
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
if (cwd !== undefined) {
|
|
139
|
-
located.push(...(await this.locateProject(cwd)));
|
|
140
|
-
}
|
|
141
|
-
return located;
|
|
142
|
-
}
|
|
143
|
-
async locateProject(cwd) {
|
|
144
|
-
const snapshot = await this.manager.readProjectCatalog(cwd);
|
|
145
|
-
const located = [];
|
|
146
|
-
for (const suite of snapshot.enabledSuites) {
|
|
147
|
-
for (const skill of suite.activeSurfaces.skills === false ? [] : suite.skills) {
|
|
148
|
-
try {
|
|
149
|
-
if (parseFrontmatterRecord(await readFile(skill.file, 'utf8')).disabled === true)
|
|
150
|
-
continue;
|
|
151
|
-
}
|
|
152
|
-
catch {
|
|
153
|
-
continue;
|
|
154
|
-
}
|
|
155
|
-
located.push({ rank: PROJECT_RANK, source: SUITE_PROJECT_SOURCE, suite, skill });
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
return located;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SkillContent, SuiteDetail } from '../contracts/market.js';
|
|
2
|
-
import { type InstalledEntry, type Suite } from '../model/types.js';
|
|
3
|
-
import type { McpMountDiagnostic as McpDiagnostic } from '../contracts/mcp.js';
|
|
4
|
-
/** Build the detail response for one normalized suite. */
|
|
5
|
-
export declare function buildSuiteDetail(suite: Suite, installed: InstalledEntry | undefined, diagnostics: readonly McpDiagnostic[], mcpOverrides?: Record<string, Record<string, unknown>>): Promise<SuiteDetail>;
|
|
6
|
-
/** Read one skill body from a normalized suite. */
|
|
7
|
-
export declare function readSkillContent(suite: Suite, skillName: string): Promise<SkillContent>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { McpSuiteOverrides } from './mcp-overrides.js';
|
|
2
|
-
import type { McpStatusCode, McpStatusPayload } from '../../contracts/mcp-status.js';
|
|
3
|
-
import type { McpToolSnapshot } from '../ports.js';
|
|
4
|
-
import type { Suite } from '../../model/types.js';
|
|
5
|
-
export type { McpStatusEntry, McpStatusPayload, McpStatusKind, McpStatusState } from '../../contracts/mcp-status.js';
|
|
6
|
-
export type { McpToolSnapshot };
|
|
7
|
-
export interface McpDiagnostic {
|
|
8
|
-
suiteId: string;
|
|
9
|
-
serverKey: string;
|
|
10
|
-
reason: string;
|
|
11
|
-
code?: McpStatusCode;
|
|
12
|
-
causes?: string[];
|
|
13
|
-
credentialRefs?: string[];
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Whether one effective configuration supplies its own Authorization header.
|
|
17
|
-
*
|
|
18
|
-
* Such a server authenticates with that header: the browser authorization a
|
|
19
|
-
* re-authorize would restart is not the path it uses, so the action is not
|
|
20
|
-
* offered for it.
|
|
21
|
-
*/
|
|
22
|
-
export declare function declaresAuthHeader(config: Record<string, unknown> | undefined): boolean;
|
|
23
|
-
/** Build status rows from discovered plugin MCP definitions and observed tool names. */
|
|
24
|
-
export declare function buildMcpStatus(suites: Suite[], diagnostics: McpDiagnostic[], observed: readonly McpToolSnapshot[], overrides?: Map<string, McpSuiteOverrides>): McpStatusPayload;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { UserPanelEntryWire, UserPanelKind } from '../contracts/market.js';
|
|
2
|
-
/** The user-panel store surface the panel resources drive (structural). */
|
|
3
|
-
interface UserPanelEntries {
|
|
4
|
-
list(strict?: boolean): Promise<UserPanelEntryWire[]>;
|
|
5
|
-
create(name: string, text: string): Promise<UserPanelEntryWire>;
|
|
6
|
-
update(name: string, text: string): Promise<void>;
|
|
7
|
-
remove(name: string): Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
import type { Catalog } from './catalog.js';
|
|
10
|
-
/** The routes consume this structural surface, also implemented by user-only stores in tests. */
|
|
11
|
-
export interface PanelResourceStore {
|
|
12
|
-
/** Strict runtime reads propagate I/O failures so catalogs cannot publish partial replacements. */
|
|
13
|
-
list(strict?: boolean): Promise<UserPanelEntryWire[]>;
|
|
14
|
-
get(id: string): Promise<UserPanelEntryWire | undefined>;
|
|
15
|
-
create(name: string, text: string): Promise<UserPanelEntryWire>;
|
|
16
|
-
update(id: string, text: string): Promise<void>;
|
|
17
|
-
remove(id: string): Promise<void>;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Id of one panel entry backed by a file inside an installed suite's checkout.
|
|
21
|
-
* The leading `[` is what distinguishes a plugin entry from a user-authored
|
|
22
|
-
* one; `update`/`remove` use {@link isPluginResourceId} to tell them apart.
|
|
23
|
-
*/
|
|
24
|
-
export declare function pluginResourceId(sourceId: string, suiteId: string, kind: UserPanelKind, name: string): string;
|
|
25
|
-
/** Whether a panel entry id addresses a file inside an installed suite. */
|
|
26
|
-
export declare function isPluginResourceId(id: string): boolean;
|
|
27
|
-
export declare function createPanelResources(catalog: Catalog, users: Record<UserPanelKind, UserPanelEntries>): Record<UserPanelKind, PanelResourceStore>;
|
|
28
|
-
export {};
|