@devtrack-solution/codesdd 1.2.2 → 1.2.3
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/.sdd/skills/curated/api-clean-flask-langgraph/SKILL.md +17 -17
- package/.sdd/skills/curated/devtrack-api/SKILL.md +160 -28
- package/.sdd/skills/curated/devtrack-api/agents/openai.yaml +1 -1
- package/.sdd/skills/curated/devtrack-api/references/architecture-governance.md +8 -7
- package/.sdd/skills/curated/devtrack-api/references/consumer-sync-policy.md +93 -0
- package/.sdd/skills/curated/devtrack-api/references/contract-pack.yaml +317 -0
- package/.sdd/skills/curated/devtrack-api/references/field-validation-protocol.md +95 -0
- package/.sdd/skills/curated/devtrack-api/references/foundation-layout.md +295 -0
- package/.sdd/skills/curated/devtrack-api/references/implementation-checklist.md +4 -4
- package/.sdd/skills/curated/devtrack-api/references/imports-lint.md +4 -0
- package/.sdd/skills/curated/devtrack-api/references/testing-validation.md +2 -2
- package/LICENSE +1 -1
- package/README.md +243 -51
- package/bin/codesdd.js +3 -2
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +11 -558
- package/dist/cli/program.d.ts +14 -0
- package/dist/cli/program.js +645 -0
- package/dist/commands/change.js +5 -5
- package/dist/commands/completion.d.ts +1 -1
- package/dist/commands/completion.js +9 -2
- package/dist/commands/config.js +159 -20
- package/dist/commands/feedback.js +1 -1
- package/dist/commands/schema.d.ts +63 -0
- package/dist/commands/schema.js +12 -12
- package/dist/commands/sdd/backlog.d.ts +3 -0
- package/dist/commands/sdd/backlog.js +54 -0
- package/dist/commands/sdd/execution.js +147 -16
- package/dist/commands/sdd/plugin.d.ts +3 -0
- package/dist/commands/sdd/plugin.js +153 -0
- package/dist/commands/sdd/shared.js +2 -23
- package/dist/commands/sdd/skills.js +7 -0
- package/dist/commands/sdd.js +69 -12
- package/dist/commands/spec.js +9 -9
- package/dist/commands/validate.js +6 -6
- package/dist/commands/workflow/instructions.js +6 -6
- package/dist/commands/workflow/new-change.js +3 -3
- package/dist/commands/workflow/shared.d.ts +1 -1
- package/dist/commands/workflow/shared.js +4 -4
- package/dist/core/archive.js +15 -5
- package/dist/core/artifact-graph/instruction-loader.d.ts +1 -1
- package/dist/core/artifact-graph/instruction-loader.js +3 -3
- package/dist/core/artifact-graph/resolver.d.ts +4 -4
- package/dist/core/artifact-graph/resolver.js +6 -6
- package/dist/core/branding.js +3 -3
- package/dist/core/cli/command-matrix.js +10 -1
- package/dist/core/cli-command-quality.d.ts +27 -0
- package/dist/core/cli-command-quality.js +171 -0
- package/dist/core/command-generation/adapters/costrict.d.ts +1 -1
- package/dist/core/command-generation/adapters/costrict.js +2 -2
- package/dist/core/command-generation/types.d.ts +1 -1
- package/dist/core/completions/command-registry.d.ts +1 -1
- package/dist/core/completions/command-registry.js +155 -12
- package/dist/core/completions/completion-provider.d.ts +14 -1
- package/dist/core/completions/completion-provider.js +29 -1
- package/dist/core/completions/generators/bash-generator.d.ts +1 -1
- package/dist/core/completions/generators/bash-generator.js +20 -12
- package/dist/core/completions/generators/fish-generator.d.ts +9 -1
- package/dist/core/completions/generators/fish-generator.js +39 -25
- package/dist/core/completions/generators/powershell-generator.d.ts +1 -1
- package/dist/core/completions/generators/powershell-generator.js +21 -11
- package/dist/core/completions/generators/zsh-generator.d.ts +3 -6
- package/dist/core/completions/generators/zsh-generator.js +21 -42
- package/dist/core/completions/installers/bash-installer.js +6 -6
- package/dist/core/completions/installers/fish-installer.js +1 -1
- package/dist/core/completions/installers/powershell-installer.js +14 -14
- package/dist/core/completions/installers/zsh-installer.d.ts +7 -1
- package/dist/core/completions/installers/zsh-installer.js +36 -8
- package/dist/core/completions/templates/bash-templates.d.ts +1 -1
- package/dist/core/completions/templates/bash-templates.js +12 -6
- package/dist/core/completions/templates/fish-templates.d.ts +2 -2
- package/dist/core/completions/templates/fish-templates.js +20 -9
- package/dist/core/completions/templates/powershell-templates.d.ts +1 -1
- package/dist/core/completions/templates/powershell-templates.js +13 -4
- package/dist/core/completions/templates/zsh-templates.d.ts +1 -1
- package/dist/core/completions/templates/zsh-templates.js +18 -9
- package/dist/core/config-schema.d.ts +3 -1
- package/dist/core/config-schema.js +26 -1
- package/dist/core/config.d.ts +3 -3
- package/dist/core/config.js +4 -4
- package/dist/core/global-config.d.ts +41 -12
- package/dist/core/global-config.js +344 -27
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +2 -2
- package/dist/core/init.d.ts +6 -1
- package/dist/core/init.js +99 -77
- package/dist/core/legacy-cleanup.d.ts +17 -17
- package/dist/core/legacy-cleanup.js +96 -79
- package/dist/core/list.js +18 -4
- package/dist/core/migration.d.ts +3 -1
- package/dist/core/migration.js +7 -8
- package/dist/core/parsers/change-parser.js +1 -1
- package/dist/core/parsers/markdown-parser.js +2 -2
- package/dist/core/profile-sync-drift.d.ts +1 -1
- package/dist/core/profile-sync-drift.js +13 -13
- package/dist/core/project-config.d.ts +4 -4
- package/dist/core/project-config.js +11 -11
- package/dist/core/schemas/change.schema.d.ts +1 -1
- package/dist/core/schemas/change.schema.js +1 -1
- package/dist/core/schemas/spec.schema.d.ts +1 -1
- package/dist/core/schemas/spec.schema.js +1 -1
- package/dist/core/sdd/adr.js +23 -1
- package/dist/core/sdd/agent-binding.d.ts +346 -0
- package/dist/core/sdd/agent-binding.js +343 -0
- package/dist/core/sdd/backlog-cli.d.ts +16 -0
- package/dist/core/sdd/backlog-cli.js +146 -0
- package/dist/core/sdd/backlog-conflict-policy.d.ts +58 -0
- package/dist/core/sdd/backlog-conflict-policy.js +230 -0
- package/dist/core/sdd/backlog-projection.d.ts +8 -0
- package/dist/core/sdd/backlog-projection.js +89 -0
- package/dist/core/sdd/backlog-provider-contract.d.ts +252 -0
- package/dist/core/sdd/backlog-provider-contract.js +158 -0
- package/dist/core/sdd/bootstrap.js +2 -2
- package/dist/core/sdd/check.d.ts +42 -0
- package/dist/core/sdd/check.js +22 -22
- package/dist/core/sdd/contract.d.ts +13 -0
- package/dist/core/sdd/contract.js +36 -0
- package/dist/core/sdd/coordination/coordination-adapters.d.ts +38 -0
- package/dist/core/sdd/coordination/coordination-adapters.js +139 -1
- package/dist/core/sdd/deepagent-contracts.d.ts +276 -0
- package/dist/core/sdd/deepagent-contracts.js +173 -0
- package/dist/core/sdd/deepagents/adr-governor.d.ts +2 -0
- package/dist/core/sdd/deepagents/adr-governor.js +30 -0
- package/dist/core/sdd/deepagents/backend.d.ts +63 -0
- package/dist/core/sdd/deepagents/backend.js +174 -0
- package/dist/core/sdd/deepagents/codesdd-tools.d.ts +39 -0
- package/dist/core/sdd/deepagents/codesdd-tools.js +83 -0
- package/dist/core/sdd/deepagents/evidence-mapper.d.ts +86 -0
- package/dist/core/sdd/deepagents/evidence-mapper.js +178 -0
- package/dist/core/sdd/deepagents/model-provider.d.ts +53 -0
- package/dist/core/sdd/deepagents/model-provider.js +379 -0
- package/dist/core/sdd/deepagents/policy-enforcement.d.ts +30 -0
- package/dist/core/sdd/deepagents/policy-enforcement.js +90 -0
- package/dist/core/sdd/deepagents/policy.d.ts +75 -0
- package/dist/core/sdd/deepagents/policy.js +358 -0
- package/dist/core/sdd/deepagents/quality-witness.d.ts +3 -0
- package/dist/core/sdd/deepagents/quality-witness.js +77 -0
- package/dist/core/sdd/deepagents/reversa-subagents.d.ts +75 -0
- package/dist/core/sdd/deepagents/reversa-subagents.js +182 -0
- package/dist/core/sdd/deepagents/runtime-factory.d.ts +90 -0
- package/dist/core/sdd/deepagents/runtime-factory.js +231 -0
- package/dist/core/sdd/deepagents/runtime-loader.d.ts +16 -0
- package/dist/core/sdd/deepagents/runtime-loader.js +65 -0
- package/dist/core/sdd/default-bootstrap-files.d.ts +2 -2
- package/dist/core/sdd/default-bootstrap-files.js +36 -2
- package/dist/core/sdd/default-skills.d.ts +30 -0
- package/dist/core/sdd/default-skills.js +181 -5
- package/dist/core/sdd/devtrack-api-appliance.d.ts +84 -0
- package/dist/core/sdd/devtrack-api-appliance.js +257 -0
- package/dist/core/sdd/devtrack-api-architecture.d.ts +31 -0
- package/dist/core/sdd/devtrack-api-architecture.js +608 -0
- package/dist/core/sdd/devtrack-api-import-boundary.d.ts +19 -0
- package/dist/core/sdd/devtrack-api-import-boundary.js +32 -0
- package/dist/core/sdd/diagnose.d.ts +59 -0
- package/dist/core/sdd/diagnose.js +37 -37
- package/dist/core/sdd/docs-sync.js +33 -5
- package/dist/core/sdd/domain/post-active-validation.d.ts +7 -0
- package/dist/core/sdd/domain/post-active-validation.js +61 -0
- package/dist/core/sdd/domain/transition-engine.js +1 -0
- package/dist/core/sdd/entity-reference.d.ts +5 -0
- package/dist/core/sdd/entity-reference.js +22 -0
- package/dist/core/sdd/governance-backfill.d.ts +31 -0
- package/dist/core/sdd/governance-backfill.js +359 -0
- package/dist/core/sdd/governance-parser.d.ts +21 -0
- package/dist/core/sdd/governance-parser.js +91 -0
- package/dist/core/sdd/governance-schemas.d.ts +245 -0
- package/dist/core/sdd/governance-schemas.js +143 -0
- package/dist/core/sdd/{import-openspec.d.ts → import-legacy-spec.d.ts} +7 -7
- package/dist/core/sdd/{import-openspec.js → import-legacy-spec.js} +21 -29
- package/dist/core/sdd/init.d.ts +3 -0
- package/dist/core/sdd/init.js +6 -3
- package/dist/core/sdd/json-schema.js +100 -6
- package/dist/core/sdd/knowledge-graph.d.ts +45 -0
- package/dist/core/sdd/knowledge-graph.js +288 -0
- package/dist/core/sdd/legacy-operations.js +431 -43
- package/dist/core/sdd/lenses.d.ts +1 -0
- package/dist/core/sdd/lenses.js +29 -1
- package/dist/core/sdd/migrate-workspace.js +56 -2
- package/dist/core/sdd/migrate.d.ts +1 -1
- package/dist/core/sdd/migrate.js +36 -2
- package/dist/core/sdd/package-structure-gate.d.ts +83 -0
- package/dist/core/sdd/package-structure-gate.js +362 -0
- package/dist/core/sdd/parallel-feat-automation.d.ts +152 -0
- package/dist/core/sdd/parallel-feat-automation.js +212 -0
- package/dist/core/sdd/plugin-broker.d.ts +558 -0
- package/dist/core/sdd/plugin-broker.js +482 -0
- package/dist/core/sdd/plugin-certification.d.ts +79 -0
- package/dist/core/sdd/plugin-certification.js +453 -0
- package/dist/core/sdd/plugin-cli.d.ts +109 -0
- package/dist/core/sdd/plugin-cli.js +198 -0
- package/dist/core/sdd/plugin-evidence.d.ts +275 -0
- package/dist/core/sdd/plugin-evidence.js +307 -0
- package/dist/core/sdd/plugin-manifest.d.ts +164 -0
- package/dist/core/sdd/plugin-manifest.js +215 -0
- package/dist/core/sdd/plugin-policy-pack.d.ts +88 -0
- package/dist/core/sdd/plugin-policy-pack.js +236 -0
- package/dist/core/sdd/plugin-policy.d.ts +68 -0
- package/dist/core/sdd/plugin-policy.js +212 -0
- package/dist/core/sdd/plugin-registry.d.ts +311 -0
- package/dist/core/sdd/plugin-registry.js +138 -0
- package/dist/core/sdd/plugin-skill-binding.d.ts +151 -0
- package/dist/core/sdd/plugin-skill-binding.js +339 -0
- package/dist/core/sdd/quality-artifact-manifest-validator.d.ts +28 -0
- package/dist/core/sdd/quality-artifact-manifest-validator.js +167 -0
- package/dist/core/sdd/quality-evidence-renderer.d.ts +65 -0
- package/dist/core/sdd/quality-evidence-renderer.js +218 -0
- package/dist/core/sdd/quality-scenario-runner.d.ts +42 -0
- package/dist/core/sdd/quality-scenario-runner.js +613 -0
- package/dist/core/sdd/quality-validation.d.ts +547 -0
- package/dist/core/sdd/quality-validation.js +239 -0
- package/dist/core/sdd/resolve-project-root.d.ts +2 -2
- package/dist/core/sdd/resolve-project-root.js +11 -5
- package/dist/core/sdd/sanitize.d.ts +30 -1
- package/dist/core/sdd/sanitize.js +23 -23
- package/dist/core/sdd/services/agent-run.service.d.ts +65 -0
- package/dist/core/sdd/services/agent-run.service.js +189 -0
- package/dist/core/sdd/services/breakdown.service.js +2 -1
- package/dist/core/sdd/services/context.service.js +18 -16
- package/dist/core/sdd/services/debate.service.js +15 -2
- package/dist/core/sdd/services/feature-lint.service.d.ts +22 -0
- package/dist/core/sdd/services/feature-lint.service.js +105 -5
- package/dist/core/sdd/services/finalize.service.d.ts +80 -0
- package/dist/core/sdd/services/finalize.service.js +323 -24
- package/dist/core/sdd/services/frontend-gap.service.js +22 -7
- package/dist/core/sdd/services/governance-control-plane-runtime-adapters.d.ts +17 -0
- package/dist/core/sdd/services/governance-control-plane-runtime-adapters.js +38 -0
- package/dist/core/sdd/services/governance-control-plane.service.d.ts +66 -0
- package/dist/core/sdd/services/governance-control-plane.service.js +134 -0
- package/dist/core/sdd/services/ingest-deposito.service.js +1 -1
- package/dist/core/sdd/services/legacy-capability.service.d.ts +10 -7
- package/dist/core/sdd/services/legacy-capability.service.js +38 -21
- package/dist/core/sdd/services/mcp-runtime.service.d.ts +123 -8
- package/dist/core/sdd/services/mcp-runtime.service.js +1085 -33
- package/dist/core/sdd/services/onboard.service.js +2 -1
- package/dist/core/sdd/services/rebuild.service.js +6 -1
- package/dist/core/sdd/services/skills-sync.service.d.ts +17 -5
- package/dist/core/sdd/services/skills-sync.service.js +55 -2
- package/dist/core/sdd/services/start.service.js +6 -4
- package/dist/core/sdd/skill-bundles-curation-schema.d.ts +66 -0
- package/dist/core/sdd/skill-bundles-curation-schema.js +52 -0
- package/dist/core/sdd/skill-evidence.d.ts +19 -0
- package/dist/core/sdd/skill-evidence.js +38 -0
- package/dist/core/sdd/skill-policy-pool.d.ts +46 -0
- package/dist/core/sdd/skill-policy-pool.js +185 -0
- package/dist/core/sdd/state.d.ts +22 -0
- package/dist/core/sdd/state.js +66 -41
- package/dist/core/sdd/structural-health.d.ts +42 -42
- package/dist/core/sdd/types.d.ts +33 -7
- package/dist/core/sdd/types.js +17 -0
- package/dist/core/sdd/upgrade-to-codesdd.d.ts +45 -0
- package/dist/core/sdd/upgrade-to-codesdd.js +179 -0
- package/dist/core/sdd/workspace-schemas.d.ts +285 -14
- package/dist/core/sdd/workspace-schemas.js +148 -0
- package/dist/core/sdd/write-manifest.js +22 -4
- package/dist/core/shared/skill-generation.d.ts +1 -1
- package/dist/core/shared/skill-generation.js +15 -15
- package/dist/core/shared/tool-detection.d.ts +3 -3
- package/dist/core/shared/tool-detection.js +14 -14
- package/dist/core/specs-apply.js +6 -6
- package/dist/core/templates/index.d.ts +1 -1
- package/dist/core/templates/index.js +1 -1
- package/dist/core/templates/workflows/apply-change.js +14 -14
- package/dist/core/templates/workflows/archive-change.js +32 -32
- package/dist/core/templates/workflows/bulk-archive-change.js +25 -25
- package/dist/core/templates/workflows/continue-change.js +12 -12
- package/dist/core/templates/workflows/explore.js +29 -29
- package/dist/core/templates/workflows/feedback.js +6 -6
- package/dist/core/templates/workflows/ff-change.js +24 -24
- package/dist/core/templates/workflows/new-change.js +20 -20
- package/dist/core/templates/workflows/onboard.js +33 -33
- package/dist/core/templates/workflows/propose.js +23 -23
- package/dist/core/templates/workflows/sdd.js +8 -8
- package/dist/core/templates/workflows/sync-specs.js +19 -19
- package/dist/core/templates/workflows/verify-change.js +17 -17
- package/dist/core/update.d.ts +2 -2
- package/dist/core/update.js +16 -15
- package/dist/core/validation/constants.d.ts +1 -1
- package/dist/core/validation/constants.js +1 -1
- package/dist/core/view.js +11 -11
- package/dist/telemetry/config.d.ts +2 -1
- package/dist/telemetry/config.js +17 -8
- package/dist/telemetry/index.d.ts +10 -2
- package/dist/telemetry/index.js +40 -7
- package/dist/ui/ascii-patterns.d.ts +2 -2
- package/dist/ui/ascii-patterns.js +2 -2
- package/dist/ui/welcome-screen.js +2 -2
- package/dist/utils/change-metadata.d.ts +4 -4
- package/dist/utils/change-metadata.js +6 -6
- package/dist/utils/change-utils.d.ts +3 -3
- package/dist/utils/change-utils.js +5 -5
- package/dist/utils/file-system.js +1 -1
- package/dist/utils/interactive.js +1 -1
- package/dist/utils/item-discovery.js +4 -4
- package/dist/utils/legacy-spec-compat.d.ts +2 -0
- package/dist/utils/legacy-spec-compat.js +2 -0
- package/dist/utils/shell-detection.d.ts +1 -0
- package/dist/utils/shell-detection.js +16 -0
- package/package.json +27 -17
- package/schemas/sdd/1-spec.schema.json +1 -1
- package/schemas/sdd/2-plan.schema.json +73 -1
- package/schemas/sdd/3-tasks.schema.json +73 -1
- package/schemas/sdd/4-changelog.schema.json +1 -1
- package/schemas/sdd/5-quality.schema.json +442 -2
- package/schemas/sdd/adr.schema.json +148 -0
- package/schemas/sdd/agent-binding-adapter.schema.json +210 -0
- package/schemas/sdd/agent-binding-resolution.schema.json +338 -0
- package/schemas/sdd/backlog-projection-plan.schema.json +180 -0
- package/schemas/sdd/backlog-provider-contract.schema.json +260 -0
- package/schemas/sdd/codesdd-plugin.schema.json +474 -0
- package/schemas/sdd/debate.schema.json +244 -0
- package/schemas/sdd/deepagent-decision-evidence.schema.json +58 -0
- package/schemas/sdd/deepagent-env-contract.schema.json +143 -0
- package/schemas/sdd/deepagent-quality-evidence.schema.json +108 -0
- package/schemas/sdd/deepagent-run-evidence.schema.json +192 -0
- package/schemas/sdd/deepagent-run-plan.schema.json +197 -0
- package/schemas/sdd/deepagent-run-request.schema.json +321 -0
- package/schemas/sdd/deepagent-subagent-evidence.schema.json +110 -0
- package/schemas/sdd/deepagent-tool-call-evidence.schema.json +78 -0
- package/schemas/sdd/discarded.schema.json +127 -0
- package/schemas/sdd/epic.schema.json +147 -0
- package/schemas/sdd/insight.schema.json +136 -0
- package/schemas/sdd/parallel-feat-automation-plan.schema.json +215 -0
- package/schemas/sdd/parallel-feat-automation-request.schema.json +109 -0
- package/schemas/sdd/plugin-artifact-manifest.schema.json +150 -0
- package/schemas/sdd/plugin-compliance-index.schema.json +136 -0
- package/schemas/sdd/plugin-dry-run-plan.schema.json +260 -0
- package/schemas/sdd/plugin-evidence-manifest.schema.json +569 -0
- package/schemas/sdd/plugin-policy-evaluation.schema.json +92 -0
- package/schemas/sdd/plugin-policy-pack-evaluation.schema.json +94 -0
- package/schemas/sdd/plugin-policy-pack.schema.json +196 -0
- package/schemas/sdd/plugin-registry.schema.json +558 -0
- package/schemas/sdd/plugin-rollback-manifest.schema.json +87 -0
- package/schemas/sdd/plugin-runtime-invocation-plan.schema.json +845 -0
- package/schemas/sdd/plugin-skill-binding-resolution.schema.json +305 -0
- package/schemas/sdd/plugin-skill-binding.schema.json +88 -0
- package/schemas/sdd/plugin-validation-manifest.schema.json +123 -0
- package/schemas/sdd/quality-architecture-schema.schema.json +216 -0
- package/schemas/sdd/quality-evidence-bundle.schema.json +1228 -0
- package/schemas/sdd/quality-run.schema.json +197 -0
- package/schemas/sdd/quality-scenario.schema.json +252 -0
- package/schemas/sdd/workspace-catalog.schema.json +9841 -22
- package/schemas/spec-driven/schema.yaml +4 -4
- package/schemas/spec-driven/templates/proposal.md +1 -1
- package/dist/utils/openspec-compat.d.ts +0 -2
- package/dist/utils/openspec-compat.js +0 -2
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type PluginCapability, type PluginManifest } from './plugin-manifest.js';
|
|
3
|
+
export declare const pluginRegistrySourceSchema: z.ZodObject<{
|
|
4
|
+
type: z.ZodEnum<{
|
|
5
|
+
local: "local";
|
|
6
|
+
workspace: "workspace";
|
|
7
|
+
"enterprise-catalog": "enterprise-catalog";
|
|
8
|
+
}>;
|
|
9
|
+
uri: z.ZodString;
|
|
10
|
+
checksum: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export declare const pluginRegistryEntrySchema: z.ZodObject<{
|
|
13
|
+
manifest: z.ZodObject<{
|
|
14
|
+
id: z.ZodString;
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
version: z.ZodString;
|
|
17
|
+
contract_version: z.ZodLiteral<1>;
|
|
18
|
+
vendor: z.ZodString;
|
|
19
|
+
codesdd_compat: z.ZodObject<{
|
|
20
|
+
versions: z.ZodString;
|
|
21
|
+
sdd_contract_versions: z.ZodArray<z.ZodNumber>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
technology: z.ZodObject<{
|
|
24
|
+
language: z.ZodString;
|
|
25
|
+
framework: z.ZodOptional<z.ZodString>;
|
|
26
|
+
runtime: z.ZodOptional<z.ZodString>;
|
|
27
|
+
package_manager: z.ZodOptional<z.ZodString>;
|
|
28
|
+
min_versions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
capabilities: z.ZodArray<z.ZodObject<{
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
description: z.ZodString;
|
|
33
|
+
input_schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
34
|
+
output_schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
35
|
+
deterministic: z.ZodBoolean;
|
|
36
|
+
idempotent: z.ZodBoolean;
|
|
37
|
+
supports_dry_run: z.ZodBoolean;
|
|
38
|
+
supports_apply: z.ZodBoolean;
|
|
39
|
+
supports_rollback: z.ZodDefault<z.ZodBoolean>;
|
|
40
|
+
write_scope: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
41
|
+
risk_tier: z.ZodDefault<z.ZodEnum<{
|
|
42
|
+
low: "low";
|
|
43
|
+
medium: "medium";
|
|
44
|
+
high: "high";
|
|
45
|
+
critical: "critical";
|
|
46
|
+
}>>;
|
|
47
|
+
approval: z.ZodDefault<z.ZodEnum<{
|
|
48
|
+
none: "none";
|
|
49
|
+
maintainer: "maintainer";
|
|
50
|
+
security: "security";
|
|
51
|
+
"architecture-board": "architecture-board";
|
|
52
|
+
}>>;
|
|
53
|
+
}, z.core.$strip>>;
|
|
54
|
+
execution: z.ZodObject<{
|
|
55
|
+
command: z.ZodString;
|
|
56
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
57
|
+
timeout_seconds: z.ZodDefault<z.ZodNumber>;
|
|
58
|
+
env_allowlist: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
59
|
+
network: z.ZodDefault<z.ZodEnum<{
|
|
60
|
+
disabled: "disabled";
|
|
61
|
+
restricted: "restricted";
|
|
62
|
+
enabled: "enabled";
|
|
63
|
+
}>>;
|
|
64
|
+
process_spawn: z.ZodDefault<z.ZodEnum<{
|
|
65
|
+
forbidden: "forbidden";
|
|
66
|
+
declared: "declared";
|
|
67
|
+
}>>;
|
|
68
|
+
working_directory: z.ZodDefault<z.ZodString>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
artifacts: z.ZodObject<{
|
|
71
|
+
writes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
72
|
+
forbidden_writes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
73
|
+
naming_conventions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
supply_chain: z.ZodObject<{
|
|
76
|
+
checksum: z.ZodOptional<z.ZodString>;
|
|
77
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
78
|
+
provenance: z.ZodOptional<z.ZodString>;
|
|
79
|
+
sbom: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
governance: z.ZodObject<{
|
|
82
|
+
owner: z.ZodString;
|
|
83
|
+
support_sla: z.ZodString;
|
|
84
|
+
deprecation_window: z.ZodString;
|
|
85
|
+
policy_packs: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
86
|
+
trust_tier: z.ZodEnum<{
|
|
87
|
+
experimental: "experimental";
|
|
88
|
+
blocked: "blocked";
|
|
89
|
+
"local-dev": "local-dev";
|
|
90
|
+
"enterprise-approved": "enterprise-approved";
|
|
91
|
+
}>;
|
|
92
|
+
allowed_domains: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
93
|
+
risk_tier: z.ZodDefault<z.ZodEnum<{
|
|
94
|
+
low: "low";
|
|
95
|
+
medium: "medium";
|
|
96
|
+
high: "high";
|
|
97
|
+
critical: "critical";
|
|
98
|
+
}>>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
validation: z.ZodObject<{
|
|
101
|
+
commands: z.ZodArray<z.ZodString>;
|
|
102
|
+
coverage_target: z.ZodDefault<z.ZodNumber>;
|
|
103
|
+
security_checks: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
104
|
+
dependency_checks: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
105
|
+
}, z.core.$strip>;
|
|
106
|
+
compression: z.ZodDefault<z.ZodObject<{
|
|
107
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
108
|
+
engine: z.ZodDefault<z.ZodEnum<{
|
|
109
|
+
none: "none";
|
|
110
|
+
rtk: "rtk";
|
|
111
|
+
headroom: "headroom";
|
|
112
|
+
builtin: "builtin";
|
|
113
|
+
}>>;
|
|
114
|
+
mode: z.ZodDefault<z.ZodLiteral<"pretooluse">>;
|
|
115
|
+
exclude_commands: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
116
|
+
tee: z.ZodDefault<z.ZodEnum<{
|
|
117
|
+
never: "never";
|
|
118
|
+
failures: "failures";
|
|
119
|
+
always: "always";
|
|
120
|
+
}>>;
|
|
121
|
+
max_output_tokens: z.ZodDefault<z.ZodNumber>;
|
|
122
|
+
}, z.core.$strip>>;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
source: z.ZodObject<{
|
|
125
|
+
type: z.ZodEnum<{
|
|
126
|
+
local: "local";
|
|
127
|
+
workspace: "workspace";
|
|
128
|
+
"enterprise-catalog": "enterprise-catalog";
|
|
129
|
+
}>;
|
|
130
|
+
uri: z.ZodString;
|
|
131
|
+
checksum: z.ZodOptional<z.ZodString>;
|
|
132
|
+
}, z.core.$strip>;
|
|
133
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
134
|
+
disabled: "disabled";
|
|
135
|
+
active: "active";
|
|
136
|
+
blocked: "blocked";
|
|
137
|
+
deprecated: "deprecated";
|
|
138
|
+
}>>;
|
|
139
|
+
registered_at: z.ZodString;
|
|
140
|
+
notes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
141
|
+
}, z.core.$strip>;
|
|
142
|
+
export declare const pluginRegistryStateSchema: z.ZodObject<{
|
|
143
|
+
schema_version: z.ZodLiteral<1>;
|
|
144
|
+
generated_at: z.ZodString;
|
|
145
|
+
entries: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
146
|
+
manifest: z.ZodObject<{
|
|
147
|
+
id: z.ZodString;
|
|
148
|
+
name: z.ZodString;
|
|
149
|
+
version: z.ZodString;
|
|
150
|
+
contract_version: z.ZodLiteral<1>;
|
|
151
|
+
vendor: z.ZodString;
|
|
152
|
+
codesdd_compat: z.ZodObject<{
|
|
153
|
+
versions: z.ZodString;
|
|
154
|
+
sdd_contract_versions: z.ZodArray<z.ZodNumber>;
|
|
155
|
+
}, z.core.$strip>;
|
|
156
|
+
technology: z.ZodObject<{
|
|
157
|
+
language: z.ZodString;
|
|
158
|
+
framework: z.ZodOptional<z.ZodString>;
|
|
159
|
+
runtime: z.ZodOptional<z.ZodString>;
|
|
160
|
+
package_manager: z.ZodOptional<z.ZodString>;
|
|
161
|
+
min_versions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
capabilities: z.ZodArray<z.ZodObject<{
|
|
164
|
+
name: z.ZodString;
|
|
165
|
+
description: z.ZodString;
|
|
166
|
+
input_schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
167
|
+
output_schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
168
|
+
deterministic: z.ZodBoolean;
|
|
169
|
+
idempotent: z.ZodBoolean;
|
|
170
|
+
supports_dry_run: z.ZodBoolean;
|
|
171
|
+
supports_apply: z.ZodBoolean;
|
|
172
|
+
supports_rollback: z.ZodDefault<z.ZodBoolean>;
|
|
173
|
+
write_scope: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
174
|
+
risk_tier: z.ZodDefault<z.ZodEnum<{
|
|
175
|
+
low: "low";
|
|
176
|
+
medium: "medium";
|
|
177
|
+
high: "high";
|
|
178
|
+
critical: "critical";
|
|
179
|
+
}>>;
|
|
180
|
+
approval: z.ZodDefault<z.ZodEnum<{
|
|
181
|
+
none: "none";
|
|
182
|
+
maintainer: "maintainer";
|
|
183
|
+
security: "security";
|
|
184
|
+
"architecture-board": "architecture-board";
|
|
185
|
+
}>>;
|
|
186
|
+
}, z.core.$strip>>;
|
|
187
|
+
execution: z.ZodObject<{
|
|
188
|
+
command: z.ZodString;
|
|
189
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
190
|
+
timeout_seconds: z.ZodDefault<z.ZodNumber>;
|
|
191
|
+
env_allowlist: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
192
|
+
network: z.ZodDefault<z.ZodEnum<{
|
|
193
|
+
disabled: "disabled";
|
|
194
|
+
restricted: "restricted";
|
|
195
|
+
enabled: "enabled";
|
|
196
|
+
}>>;
|
|
197
|
+
process_spawn: z.ZodDefault<z.ZodEnum<{
|
|
198
|
+
forbidden: "forbidden";
|
|
199
|
+
declared: "declared";
|
|
200
|
+
}>>;
|
|
201
|
+
working_directory: z.ZodDefault<z.ZodString>;
|
|
202
|
+
}, z.core.$strip>;
|
|
203
|
+
artifacts: z.ZodObject<{
|
|
204
|
+
writes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
205
|
+
forbidden_writes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
206
|
+
naming_conventions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
207
|
+
}, z.core.$strip>;
|
|
208
|
+
supply_chain: z.ZodObject<{
|
|
209
|
+
checksum: z.ZodOptional<z.ZodString>;
|
|
210
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
211
|
+
provenance: z.ZodOptional<z.ZodString>;
|
|
212
|
+
sbom: z.ZodOptional<z.ZodString>;
|
|
213
|
+
}, z.core.$strip>;
|
|
214
|
+
governance: z.ZodObject<{
|
|
215
|
+
owner: z.ZodString;
|
|
216
|
+
support_sla: z.ZodString;
|
|
217
|
+
deprecation_window: z.ZodString;
|
|
218
|
+
policy_packs: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
219
|
+
trust_tier: z.ZodEnum<{
|
|
220
|
+
experimental: "experimental";
|
|
221
|
+
blocked: "blocked";
|
|
222
|
+
"local-dev": "local-dev";
|
|
223
|
+
"enterprise-approved": "enterprise-approved";
|
|
224
|
+
}>;
|
|
225
|
+
allowed_domains: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
226
|
+
risk_tier: z.ZodDefault<z.ZodEnum<{
|
|
227
|
+
low: "low";
|
|
228
|
+
medium: "medium";
|
|
229
|
+
high: "high";
|
|
230
|
+
critical: "critical";
|
|
231
|
+
}>>;
|
|
232
|
+
}, z.core.$strip>;
|
|
233
|
+
validation: z.ZodObject<{
|
|
234
|
+
commands: z.ZodArray<z.ZodString>;
|
|
235
|
+
coverage_target: z.ZodDefault<z.ZodNumber>;
|
|
236
|
+
security_checks: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
237
|
+
dependency_checks: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
238
|
+
}, z.core.$strip>;
|
|
239
|
+
compression: z.ZodDefault<z.ZodObject<{
|
|
240
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
241
|
+
engine: z.ZodDefault<z.ZodEnum<{
|
|
242
|
+
none: "none";
|
|
243
|
+
rtk: "rtk";
|
|
244
|
+
headroom: "headroom";
|
|
245
|
+
builtin: "builtin";
|
|
246
|
+
}>>;
|
|
247
|
+
mode: z.ZodDefault<z.ZodLiteral<"pretooluse">>;
|
|
248
|
+
exclude_commands: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
249
|
+
tee: z.ZodDefault<z.ZodEnum<{
|
|
250
|
+
never: "never";
|
|
251
|
+
failures: "failures";
|
|
252
|
+
always: "always";
|
|
253
|
+
}>>;
|
|
254
|
+
max_output_tokens: z.ZodDefault<z.ZodNumber>;
|
|
255
|
+
}, z.core.$strip>>;
|
|
256
|
+
}, z.core.$strip>;
|
|
257
|
+
source: z.ZodObject<{
|
|
258
|
+
type: z.ZodEnum<{
|
|
259
|
+
local: "local";
|
|
260
|
+
workspace: "workspace";
|
|
261
|
+
"enterprise-catalog": "enterprise-catalog";
|
|
262
|
+
}>;
|
|
263
|
+
uri: z.ZodString;
|
|
264
|
+
checksum: z.ZodOptional<z.ZodString>;
|
|
265
|
+
}, z.core.$strip>;
|
|
266
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
267
|
+
disabled: "disabled";
|
|
268
|
+
active: "active";
|
|
269
|
+
blocked: "blocked";
|
|
270
|
+
deprecated: "deprecated";
|
|
271
|
+
}>>;
|
|
272
|
+
registered_at: z.ZodString;
|
|
273
|
+
notes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
274
|
+
}, z.core.$strip>>>;
|
|
275
|
+
}, z.core.$strip>;
|
|
276
|
+
export type PluginRegistrySource = z.infer<typeof pluginRegistrySourceSchema>;
|
|
277
|
+
export type PluginRegistryEntry = z.infer<typeof pluginRegistryEntrySchema>;
|
|
278
|
+
export type PluginRegistryState = z.infer<typeof pluginRegistryStateSchema>;
|
|
279
|
+
export type PluginTrustTier = PluginManifest['governance']['trust_tier'];
|
|
280
|
+
export type PluginRiskTier = PluginManifest['governance']['risk_tier'];
|
|
281
|
+
export type PluginRegistryStatus = PluginRegistryEntry['status'];
|
|
282
|
+
export interface RegisterPluginInput {
|
|
283
|
+
manifest: PluginManifest;
|
|
284
|
+
source: PluginRegistrySource;
|
|
285
|
+
status?: PluginRegistryStatus;
|
|
286
|
+
registered_at?: string;
|
|
287
|
+
notes?: string[];
|
|
288
|
+
}
|
|
289
|
+
export interface PluginCapabilityResolutionRequest {
|
|
290
|
+
capability: string;
|
|
291
|
+
trust_tiers?: PluginTrustTier[];
|
|
292
|
+
statuses?: PluginRegistryStatus[];
|
|
293
|
+
technology?: {
|
|
294
|
+
language?: string;
|
|
295
|
+
framework?: string;
|
|
296
|
+
};
|
|
297
|
+
require_apply?: boolean;
|
|
298
|
+
require_dry_run?: boolean;
|
|
299
|
+
}
|
|
300
|
+
export type PluginCapabilityResolution = {
|
|
301
|
+
status: 'resolved';
|
|
302
|
+
entry: PluginRegistryEntry;
|
|
303
|
+
capability: PluginCapability;
|
|
304
|
+
reasons: string[];
|
|
305
|
+
} | {
|
|
306
|
+
status: 'unresolved';
|
|
307
|
+
reasons: string[];
|
|
308
|
+
};
|
|
309
|
+
export declare function createPluginRegistryState(plugins: RegisterPluginInput[], generatedAt?: string): PluginRegistryState;
|
|
310
|
+
export declare function resolvePluginCapability(registryState: PluginRegistryState, request: PluginCapabilityResolutionRequest): PluginCapabilityResolution;
|
|
311
|
+
//# sourceMappingURL=plugin-registry.d.ts.map
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { pluginCapabilitySchema, pluginManifestSchema, } from './plugin-manifest.js';
|
|
3
|
+
const TRUST_RANK = {
|
|
4
|
+
'enterprise-approved': 3,
|
|
5
|
+
'local-dev': 2,
|
|
6
|
+
experimental: 1,
|
|
7
|
+
blocked: 0,
|
|
8
|
+
};
|
|
9
|
+
const RISK_RANK = {
|
|
10
|
+
low: 4,
|
|
11
|
+
medium: 3,
|
|
12
|
+
high: 2,
|
|
13
|
+
critical: 1,
|
|
14
|
+
};
|
|
15
|
+
export const pluginRegistrySourceSchema = z.object({
|
|
16
|
+
type: z.enum(['local', 'workspace', 'enterprise-catalog']),
|
|
17
|
+
uri: z.string().min(1),
|
|
18
|
+
checksum: z.string().optional(),
|
|
19
|
+
});
|
|
20
|
+
export const pluginRegistryEntrySchema = z.object({
|
|
21
|
+
manifest: pluginManifestSchema,
|
|
22
|
+
source: pluginRegistrySourceSchema,
|
|
23
|
+
status: z.enum(['active', 'disabled', 'blocked', 'deprecated']).default('active'),
|
|
24
|
+
registered_at: z.string().datetime(),
|
|
25
|
+
notes: z.array(z.string()).default([]),
|
|
26
|
+
});
|
|
27
|
+
export const pluginRegistryStateSchema = z
|
|
28
|
+
.object({
|
|
29
|
+
schema_version: z.literal(1),
|
|
30
|
+
generated_at: z.string().datetime(),
|
|
31
|
+
entries: z.array(pluginRegistryEntrySchema).default([]),
|
|
32
|
+
})
|
|
33
|
+
.superRefine((state, context) => {
|
|
34
|
+
const seen = new Set();
|
|
35
|
+
for (const [index, entry] of state.entries.entries()) {
|
|
36
|
+
const key = `${entry.manifest.id}@${entry.manifest.version}`;
|
|
37
|
+
if (seen.has(key)) {
|
|
38
|
+
context.addIssue({
|
|
39
|
+
code: 'custom',
|
|
40
|
+
path: ['entries', index, 'manifest', 'id'],
|
|
41
|
+
message: `Duplicate plugin registration: ${key}.`,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
seen.add(key);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
export function createPluginRegistryState(plugins, generatedAt = new Date().toISOString()) {
|
|
48
|
+
return pluginRegistryStateSchema.parse({
|
|
49
|
+
schema_version: 1,
|
|
50
|
+
generated_at: generatedAt,
|
|
51
|
+
entries: plugins.map((plugin) => ({
|
|
52
|
+
manifest: plugin.manifest,
|
|
53
|
+
source: plugin.source,
|
|
54
|
+
status: plugin.status ?? 'active',
|
|
55
|
+
registered_at: plugin.registered_at ?? generatedAt,
|
|
56
|
+
notes: plugin.notes ?? [],
|
|
57
|
+
})),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
export function resolvePluginCapability(registryState, request) {
|
|
61
|
+
const registry = pluginRegistryStateSchema.parse(registryState);
|
|
62
|
+
const statuses = request.statuses ?? ['active'];
|
|
63
|
+
const trustTiers = request.trust_tiers ?? ['enterprise-approved', 'local-dev', 'experimental'];
|
|
64
|
+
const requireDryRun = request.require_dry_run ?? true;
|
|
65
|
+
const reasons = [];
|
|
66
|
+
const candidates = [];
|
|
67
|
+
for (const entry of registry.entries) {
|
|
68
|
+
const pluginRef = `${entry.manifest.id}@${entry.manifest.version}`;
|
|
69
|
+
const entryReasons = collectEntryRejectionReasons(entry, request, statuses, trustTiers);
|
|
70
|
+
if (entryReasons.length > 0) {
|
|
71
|
+
reasons.push(...entryReasons.map((reason) => `${pluginRef}: ${reason}`));
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
const capability = entry.manifest.capabilities.find((candidate) => candidate.name === request.capability);
|
|
75
|
+
if (!capability) {
|
|
76
|
+
reasons.push(`${pluginRef}: capability ${request.capability} is not advertised.`);
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const capabilityReasons = collectCapabilityRejectionReasons(capability, request, requireDryRun);
|
|
80
|
+
if (capabilityReasons.length > 0) {
|
|
81
|
+
reasons.push(...capabilityReasons.map((reason) => `${pluginRef}/${capability.name}: ${reason}`));
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
candidates.push({
|
|
85
|
+
entry,
|
|
86
|
+
capability: pluginCapabilitySchema.parse(capability),
|
|
87
|
+
score: scoreCandidate(entry, capability),
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
const [winner] = candidates.sort((left, right) => {
|
|
91
|
+
if (right.score !== left.score) {
|
|
92
|
+
return right.score - left.score;
|
|
93
|
+
}
|
|
94
|
+
return `${left.entry.manifest.id}@${left.entry.manifest.version}`.localeCompare(`${right.entry.manifest.id}@${right.entry.manifest.version}`);
|
|
95
|
+
});
|
|
96
|
+
if (!winner) {
|
|
97
|
+
return {
|
|
98
|
+
status: 'unresolved',
|
|
99
|
+
reasons: reasons.length > 0 ? reasons : [`No registered plugins are available for ${request.capability}.`],
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
status: 'resolved',
|
|
104
|
+
entry: winner.entry,
|
|
105
|
+
capability: winner.capability,
|
|
106
|
+
reasons: [`Resolved ${request.capability} to ${winner.entry.manifest.id}@${winner.entry.manifest.version}.`],
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function collectEntryRejectionReasons(entry, request, statuses, trustTiers) {
|
|
110
|
+
const reasons = [];
|
|
111
|
+
if (!statuses.includes(entry.status)) {
|
|
112
|
+
reasons.push(`status ${entry.status} is not eligible.`);
|
|
113
|
+
}
|
|
114
|
+
if (!trustTiers.includes(entry.manifest.governance.trust_tier)) {
|
|
115
|
+
reasons.push(`trust tier ${entry.manifest.governance.trust_tier} is not eligible.`);
|
|
116
|
+
}
|
|
117
|
+
if (request.technology?.language && entry.manifest.technology.language !== request.technology.language) {
|
|
118
|
+
reasons.push(`language ${entry.manifest.technology.language} does not match ${request.technology.language}.`);
|
|
119
|
+
}
|
|
120
|
+
if (request.technology?.framework && entry.manifest.technology.framework !== request.technology.framework) {
|
|
121
|
+
reasons.push(`framework ${entry.manifest.technology.framework ?? '<none>'} does not match ${request.technology.framework}.`);
|
|
122
|
+
}
|
|
123
|
+
return reasons;
|
|
124
|
+
}
|
|
125
|
+
function collectCapabilityRejectionReasons(capability, request, requireDryRun) {
|
|
126
|
+
const reasons = [];
|
|
127
|
+
if (request.require_apply && !capability.supports_apply) {
|
|
128
|
+
reasons.push('apply mode is required but not supported.');
|
|
129
|
+
}
|
|
130
|
+
if (requireDryRun && !capability.supports_dry_run) {
|
|
131
|
+
reasons.push('dry-run mode is required but not supported.');
|
|
132
|
+
}
|
|
133
|
+
return reasons;
|
|
134
|
+
}
|
|
135
|
+
function scoreCandidate(entry, capability) {
|
|
136
|
+
return TRUST_RANK[entry.manifest.governance.trust_tier] * 100 + RISK_RANK[capability.risk_tier] * 10;
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=plugin-registry.js.map
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type PluginRegistryState } from './plugin-registry.js';
|
|
3
|
+
export declare const pluginSkillBindingSchema: z.ZodObject<{
|
|
4
|
+
schema_version: z.ZodDefault<z.ZodLiteral<1>>;
|
|
5
|
+
skill_id: z.ZodString;
|
|
6
|
+
plugin_id: z.ZodString;
|
|
7
|
+
plugin_version: z.ZodOptional<z.ZodString>;
|
|
8
|
+
capabilities: z.ZodArray<z.ZodString>;
|
|
9
|
+
operations: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
10
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
11
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
12
|
+
disabled: "disabled";
|
|
13
|
+
active: "active";
|
|
14
|
+
deprecated: "deprecated";
|
|
15
|
+
}>>;
|
|
16
|
+
rationale: z.ZodOptional<z.ZodString>;
|
|
17
|
+
technology: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
language: z.ZodOptional<z.ZodString>;
|
|
19
|
+
framework: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export declare const pluginSkillBindingResolutionRequestSchema: z.ZodObject<{
|
|
23
|
+
schema_version: z.ZodDefault<z.ZodLiteral<1>>;
|
|
24
|
+
feature_ref: z.ZodString;
|
|
25
|
+
recommended_skills: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
26
|
+
requested_operation: z.ZodOptional<z.ZodString>;
|
|
27
|
+
requested_capability: z.ZodOptional<z.ZodString>;
|
|
28
|
+
explicit_plugin_id: z.ZodOptional<z.ZodString>;
|
|
29
|
+
technology: z.ZodOptional<z.ZodObject<{
|
|
30
|
+
language: z.ZodOptional<z.ZodString>;
|
|
31
|
+
framework: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
trust_tiers: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
34
|
+
experimental: "experimental";
|
|
35
|
+
blocked: "blocked";
|
|
36
|
+
"local-dev": "local-dev";
|
|
37
|
+
"enterprise-approved": "enterprise-approved";
|
|
38
|
+
}>>>;
|
|
39
|
+
statuses: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
40
|
+
disabled: "disabled";
|
|
41
|
+
active: "active";
|
|
42
|
+
blocked: "blocked";
|
|
43
|
+
deprecated: "deprecated";
|
|
44
|
+
}>>>;
|
|
45
|
+
require_apply: z.ZodDefault<z.ZodBoolean>;
|
|
46
|
+
require_dry_run: z.ZodDefault<z.ZodBoolean>;
|
|
47
|
+
created_at: z.ZodOptional<z.ZodString>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export declare const pluginSkillBindingCandidateSchema: z.ZodObject<{
|
|
50
|
+
source: z.ZodEnum<{
|
|
51
|
+
"explicit-plugin": "explicit-plugin";
|
|
52
|
+
"skill-binding": "skill-binding";
|
|
53
|
+
"capability-match": "capability-match";
|
|
54
|
+
}>;
|
|
55
|
+
skill_id: z.ZodOptional<z.ZodString>;
|
|
56
|
+
plugin_ref: z.ZodObject<{
|
|
57
|
+
id: z.ZodString;
|
|
58
|
+
version: z.ZodString;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
capability: z.ZodString;
|
|
61
|
+
operation: z.ZodOptional<z.ZodString>;
|
|
62
|
+
binding_priority: z.ZodOptional<z.ZodNumber>;
|
|
63
|
+
rank: z.ZodNumber;
|
|
64
|
+
reasons: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
export declare const pluginSkillBindingResolutionSchema: z.ZodObject<{
|
|
67
|
+
schema_version: z.ZodLiteral<1>;
|
|
68
|
+
created_at: z.ZodString;
|
|
69
|
+
status: z.ZodEnum<{
|
|
70
|
+
resolved: "resolved";
|
|
71
|
+
fallback: "fallback";
|
|
72
|
+
}>;
|
|
73
|
+
request: z.ZodObject<{
|
|
74
|
+
schema_version: z.ZodDefault<z.ZodLiteral<1>>;
|
|
75
|
+
feature_ref: z.ZodString;
|
|
76
|
+
recommended_skills: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
77
|
+
requested_operation: z.ZodOptional<z.ZodString>;
|
|
78
|
+
requested_capability: z.ZodOptional<z.ZodString>;
|
|
79
|
+
explicit_plugin_id: z.ZodOptional<z.ZodString>;
|
|
80
|
+
technology: z.ZodOptional<z.ZodObject<{
|
|
81
|
+
language: z.ZodOptional<z.ZodString>;
|
|
82
|
+
framework: z.ZodOptional<z.ZodString>;
|
|
83
|
+
}, z.core.$strip>>;
|
|
84
|
+
trust_tiers: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
85
|
+
experimental: "experimental";
|
|
86
|
+
blocked: "blocked";
|
|
87
|
+
"local-dev": "local-dev";
|
|
88
|
+
"enterprise-approved": "enterprise-approved";
|
|
89
|
+
}>>>;
|
|
90
|
+
statuses: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
91
|
+
disabled: "disabled";
|
|
92
|
+
active: "active";
|
|
93
|
+
blocked: "blocked";
|
|
94
|
+
deprecated: "deprecated";
|
|
95
|
+
}>>>;
|
|
96
|
+
require_apply: z.ZodDefault<z.ZodBoolean>;
|
|
97
|
+
require_dry_run: z.ZodDefault<z.ZodBoolean>;
|
|
98
|
+
created_at: z.ZodOptional<z.ZodString>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
selected: z.ZodOptional<z.ZodObject<{
|
|
101
|
+
source: z.ZodEnum<{
|
|
102
|
+
"explicit-plugin": "explicit-plugin";
|
|
103
|
+
"skill-binding": "skill-binding";
|
|
104
|
+
"capability-match": "capability-match";
|
|
105
|
+
}>;
|
|
106
|
+
skill_id: z.ZodOptional<z.ZodString>;
|
|
107
|
+
plugin_ref: z.ZodObject<{
|
|
108
|
+
id: z.ZodString;
|
|
109
|
+
version: z.ZodString;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
capability: z.ZodString;
|
|
112
|
+
operation: z.ZodOptional<z.ZodString>;
|
|
113
|
+
binding_priority: z.ZodOptional<z.ZodNumber>;
|
|
114
|
+
rank: z.ZodNumber;
|
|
115
|
+
reasons: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
116
|
+
}, z.core.$strip>>;
|
|
117
|
+
candidates: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
118
|
+
source: z.ZodEnum<{
|
|
119
|
+
"explicit-plugin": "explicit-plugin";
|
|
120
|
+
"skill-binding": "skill-binding";
|
|
121
|
+
"capability-match": "capability-match";
|
|
122
|
+
}>;
|
|
123
|
+
skill_id: z.ZodOptional<z.ZodString>;
|
|
124
|
+
plugin_ref: z.ZodObject<{
|
|
125
|
+
id: z.ZodString;
|
|
126
|
+
version: z.ZodString;
|
|
127
|
+
}, z.core.$strip>;
|
|
128
|
+
capability: z.ZodString;
|
|
129
|
+
operation: z.ZodOptional<z.ZodString>;
|
|
130
|
+
binding_priority: z.ZodOptional<z.ZodNumber>;
|
|
131
|
+
rank: z.ZodNumber;
|
|
132
|
+
reasons: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
133
|
+
}, z.core.$strip>>>;
|
|
134
|
+
reasons: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
135
|
+
fallback: z.ZodOptional<z.ZodObject<{
|
|
136
|
+
strategy: z.ZodEnum<{
|
|
137
|
+
"manual-selection": "manual-selection";
|
|
138
|
+
"llm-guidance": "llm-guidance";
|
|
139
|
+
"no-compatible-plugin": "no-compatible-plugin";
|
|
140
|
+
}>;
|
|
141
|
+
message: z.ZodString;
|
|
142
|
+
}, z.core.$strip>>;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
export type PluginSkillBinding = z.infer<typeof pluginSkillBindingSchema>;
|
|
145
|
+
export type PluginSkillBindingResolutionRequest = z.infer<typeof pluginSkillBindingResolutionRequestSchema>;
|
|
146
|
+
export type PluginSkillBindingCandidate = z.infer<typeof pluginSkillBindingCandidateSchema>;
|
|
147
|
+
export type PluginSkillBindingResolution = z.infer<typeof pluginSkillBindingResolutionSchema>;
|
|
148
|
+
export type PluginSkillBindingInput = z.input<typeof pluginSkillBindingSchema>;
|
|
149
|
+
export type PluginSkillBindingResolutionRequestInput = z.input<typeof pluginSkillBindingResolutionRequestSchema>;
|
|
150
|
+
export declare function resolvePluginSkillBinding(registryState: PluginRegistryState, bindings: PluginSkillBindingInput[], request: PluginSkillBindingResolutionRequestInput): PluginSkillBindingResolution;
|
|
151
|
+
//# sourceMappingURL=plugin-skill-binding.d.ts.map
|