@intentius/chant 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/audit/catalog.d.ts +45 -5
- package/dist/audit/catalog.d.ts.map +1 -1
- package/dist/audit/fetch.d.ts.map +1 -1
- package/dist/audit/proof.d.ts +3 -0
- package/dist/audit/proof.d.ts.map +1 -1
- package/dist/audit/report-model.d.ts +4 -1
- package/dist/audit/report-model.d.ts.map +1 -1
- package/dist/audit/report.d.ts +3 -0
- package/dist/audit/report.d.ts.map +1 -1
- package/dist/audit/rules-doc.d.ts +8 -2
- package/dist/audit/rules-doc.d.ts.map +1 -1
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/lexicon-rolling-upgrade.d.ts +37 -0
- package/dist/cli/commands/lexicon-rolling-upgrade.d.ts.map +1 -0
- package/dist/cli/commands/lexicon-surface-diff.d.ts +48 -0
- package/dist/cli/commands/lexicon-surface-diff.d.ts.map +1 -0
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/pinned-upgrade.d.ts +41 -0
- package/dist/cli/commands/pinned-upgrade.d.ts.map +1 -0
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/components.d.ts +39 -0
- package/dist/cli/handlers/components.d.ts.map +1 -0
- package/dist/cli/handlers/dev.d.ts +3 -0
- package/dist/cli/handlers/dev.d.ts.map +1 -1
- package/dist/cli/handlers/graph.d.ts +4 -2
- package/dist/cli/handlers/graph.d.ts.map +1 -1
- package/dist/cli/handlers/misc.d.ts.map +1 -1
- package/dist/cli/handlers/run.d.ts +49 -0
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/registry.d.ts +35 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/codegen/fetch.d.ts +22 -0
- package/dist/codegen/fetch.d.ts.map +1 -1
- package/dist/codegen/lexicon-regen.d.ts +110 -0
- package/dist/codegen/lexicon-regen.d.ts.map +1 -0
- package/dist/codegen/pinned-upgrade.d.ts +153 -0
- package/dist/codegen/pinned-upgrade.d.ts.map +1 -0
- package/dist/codegen/rolling-upgrade.d.ts +138 -0
- package/dist/codegen/rolling-upgrade.d.ts.map +1 -0
- package/dist/codegen/surface-snapshot.d.ts +173 -0
- package/dist/codegen/surface-snapshot.d.ts.map +1 -0
- package/dist/codegen/version-bump.d.ts +21 -0
- package/dist/codegen/version-bump.d.ts.map +1 -0
- package/dist/components/auto-release.d.ts +93 -0
- package/dist/components/auto-release.d.ts.map +1 -0
- package/dist/components/builders.d.ts +37 -0
- package/dist/components/builders.d.ts.map +1 -0
- package/dist/components/capability-plugin-loader.d.ts +111 -0
- package/dist/components/capability-plugin-loader.d.ts.map +1 -0
- package/dist/components/capability-plugin-schema.d.ts +24 -0
- package/dist/components/capability-plugin-schema.d.ts.map +1 -0
- package/dist/components/capability-plugin.d.ts +85 -0
- package/dist/components/capability-plugin.d.ts.map +1 -0
- package/dist/components/capability.d.ts +89 -0
- package/dist/components/capability.d.ts.map +1 -0
- package/dist/components/cli-support.d.ts +204 -0
- package/dist/components/cli-support.d.ts.map +1 -0
- package/dist/components/component.d.ts +179 -0
- package/dist/components/component.d.ts.map +1 -0
- package/dist/components/config-defaults.d.ts +41 -0
- package/dist/components/config-defaults.d.ts.map +1 -0
- package/dist/components/discover.d.ts +60 -0
- package/dist/components/discover.d.ts.map +1 -0
- package/dist/components/driver-output.d.ts +20 -0
- package/dist/components/driver-output.d.ts.map +1 -0
- package/dist/components/driver.d.ts +209 -0
- package/dist/components/driver.d.ts.map +1 -0
- package/dist/components/index.d.ts +22 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/manifest-persistence.d.ts +79 -0
- package/dist/components/manifest-persistence.d.ts.map +1 -0
- package/dist/components/pilots/alb-ecs.pilot.d.ts +27 -0
- package/dist/components/pilots/alb-ecs.pilot.d.ts.map +1 -0
- package/dist/components/pilots/dynamodb.pilot.d.ts +22 -0
- package/dist/components/pilots/dynamodb.pilot.d.ts.map +1 -0
- package/dist/components/pilots/jar-emr.pilot.d.ts +37 -0
- package/dist/components/pilots/jar-emr.pilot.d.ts.map +1 -0
- package/dist/components/pilots/lambda.pilot.d.ts +35 -0
- package/dist/components/pilots/lambda.pilot.d.ts.map +1 -0
- package/dist/components/pilots/neo4j-fanout.pilot.d.ts +17 -0
- package/dist/components/pilots/neo4j-fanout.pilot.d.ts.map +1 -0
- package/dist/components/pilots/project.d.ts +13 -0
- package/dist/components/pilots/project.d.ts.map +1 -0
- package/dist/components/presets/ecs-fargate.d.ts +59 -0
- package/dist/components/presets/ecs-fargate.d.ts.map +1 -0
- package/dist/components/presets/index.d.ts +29 -0
- package/dist/components/presets/index.d.ts.map +1 -0
- package/dist/components/presets/lambda.d.ts +35 -0
- package/dist/components/presets/lambda.d.ts.map +1 -0
- package/dist/components/presets/single-host-compose.d.ts +43 -0
- package/dist/components/presets/single-host-compose.d.ts.map +1 -0
- package/dist/components/registry.d.ts +29 -0
- package/dist/components/registry.d.ts.map +1 -0
- package/dist/components/starter-plugin.d.ts +51 -0
- package/dist/components/starter-plugin.d.ts.map +1 -0
- package/dist/components/temporal-codegen-loader.d.ts +27 -0
- package/dist/components/temporal-codegen-loader.d.ts.map +1 -0
- package/dist/components/verbs/__tests__/mock-cloud-executor.d.ts +35 -0
- package/dist/components/verbs/__tests__/mock-cloud-executor.d.ts.map +1 -0
- package/dist/components/verbs/__tests__/mock-process-runner.d.ts +45 -0
- package/dist/components/verbs/__tests__/mock-process-runner.d.ts.map +1 -0
- package/dist/components/verbs/__tests__/mock-sbom-generator.d.ts +33 -0
- package/dist/components/verbs/__tests__/mock-sbom-generator.d.ts.map +1 -0
- package/dist/components/verbs/bom-writer.d.ts +155 -0
- package/dist/components/verbs/bom-writer.d.ts.map +1 -0
- package/dist/components/verbs/build-archive.d.ts +205 -0
- package/dist/components/verbs/build-archive.d.ts.map +1 -0
- package/dist/components/verbs/build.d.ts +150 -0
- package/dist/components/verbs/build.d.ts.map +1 -0
- package/dist/components/verbs/cloud-executor.d.ts +88 -0
- package/dist/components/verbs/cloud-executor.d.ts.map +1 -0
- package/dist/components/verbs/component-bom.d.ts +103 -0
- package/dist/components/verbs/component-bom.d.ts.map +1 -0
- package/dist/components/verbs/index.d.ts +49 -0
- package/dist/components/verbs/index.d.ts.map +1 -0
- package/dist/components/verbs/license-policy.d.ts +56 -0
- package/dist/components/verbs/license-policy.d.ts.map +1 -0
- package/dist/components/verbs/lockfile-sbom-generator.d.ts +81 -0
- package/dist/components/verbs/lockfile-sbom-generator.d.ts.map +1 -0
- package/dist/components/verbs/process-runner.d.ts +64 -0
- package/dist/components/verbs/process-runner.d.ts.map +1 -0
- package/dist/components/verbs/reproducibility.d.ts +80 -0
- package/dist/components/verbs/reproducibility.d.ts.map +1 -0
- package/dist/components/verbs/sbom-generator.d.ts +157 -0
- package/dist/components/verbs/sbom-generator.d.ts.map +1 -0
- package/dist/components/verbs/sbom.d.ts +79 -0
- package/dist/components/verbs/sbom.d.ts.map +1 -0
- package/dist/components/verbs/shell.d.ts +35 -0
- package/dist/components/verbs/shell.d.ts.map +1 -0
- package/dist/components/verbs/sign.d.ts +222 -0
- package/dist/components/verbs/sign.d.ts.map +1 -0
- package/dist/components/verbs/stub.d.ts +18 -0
- package/dist/components/verbs/stub.d.ts.map +1 -0
- package/dist/components/verbs/tool-sbom-generator.d.ts +51 -0
- package/dist/components/verbs/tool-sbom-generator.d.ts.map +1 -0
- package/dist/components/verbs/verify.d.ts +106 -0
- package/dist/components/verbs/verify.d.ts.map +1 -0
- package/dist/components/verbs/vex.d.ts +65 -0
- package/dist/components/verbs/vex.d.ts.map +1 -0
- package/dist/components/verbs/vuln-gate.d.ts +91 -0
- package/dist/components/verbs/vuln-gate.d.ts.map +1 -0
- package/dist/components/verbs/vuln-scan.d.ts +116 -0
- package/dist/components/verbs/vuln-scan.d.ts.map +1 -0
- package/dist/components/verbs/wait-verify.d.ts +85 -0
- package/dist/components/verbs/wait-verify.d.ts.map +1 -0
- package/dist/config.d.ts +205 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/lexicon.d.ts +78 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/build-ledger-store.d.ts +121 -0
- package/dist/lifecycle/build-ledger-store.d.ts.map +1 -0
- package/dist/lifecycle/build-ledger.d.ts +225 -0
- package/dist/lifecycle/build-ledger.d.ts.map +1 -0
- package/dist/lifecycle/git.d.ts +84 -0
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/index.d.ts +5 -0
- package/dist/lifecycle/index.d.ts.map +1 -1
- package/dist/lifecycle/oras-referrer-lookup.d.ts +41 -0
- package/dist/lifecycle/oras-referrer-lookup.d.ts.map +1 -0
- package/dist/lifecycle/release-ledger.d.ts +122 -0
- package/dist/lifecycle/release-ledger.d.ts.map +1 -0
- package/dist/lifecycle/status.d.ts +150 -0
- package/dist/lifecycle/status.d.ts.map +1 -0
- package/dist/lint/component-checks.d.ts +95 -0
- package/dist/lint/component-checks.d.ts.map +1 -0
- package/dist/lint/engine.d.ts +23 -0
- package/dist/lint/engine.d.ts.map +1 -1
- package/dist/lint/presets/strict.json +8 -1
- package/dist/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-a.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-a.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-b.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-b.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp001/fail/orphan-lib.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp001/fail/orphan-lib.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp001/pass/emr-job.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp001/pass/emr-job.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp001/pass/jar-lib.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp001/pass/jar-lib.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp002/fail/search-service.component.d.ts +10 -0
- package/dist/lint/rules/__fixtures__/comp/comp002/fail/search-service.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp002/pass/jar-lib.component.d.ts +3 -0
- package/dist/lint/rules/__fixtures__/comp/comp002/pass/jar-lib.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp002/pass/search-service.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp002/pass/search-service.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/fail/migrator.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/fail/migrator.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/pass/migrator.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/pass/migrator.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/pass/orders-table.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/pass/orders-table.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp004/fail/neo4j-cluster.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp004/fail/neo4j-cluster.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp004/pass/neo4j-cluster.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp004/pass/neo4j-cluster.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp004/pass/orders-table.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp004/pass/orders-table.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp005/fail/search-service.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp005/fail/search-service.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp005/pass/search-service.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp005/pass/search-service.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp006/fail/legacy-tool.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp006/fail/legacy-tool.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp006/pass/legacy-tool.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp006/pass/legacy-tool.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/fail/inventory-table.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/fail/inventory-table.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/fail/orders-table.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/fail/orders-table.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/pass/orders-table.component.d.ts +3 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/pass/orders-table.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/pass/search-service.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/pass/search-service.component.d.ts.map +1 -0
- package/dist/lint/rules/comp/comp001-publishes-never-applies.d.ts +20 -0
- package/dist/lint/rules/comp/comp001-publishes-never-applies.d.ts.map +1 -0
- package/dist/lint/rules/comp/comp002-dangling-wiring-ref.d.ts +28 -0
- package/dist/lint/rules/comp/comp002-dangling-wiring-ref.d.ts.map +1 -0
- package/dist/lint/rules/comp/comp003-mutating-no-rollback.d.ts +39 -0
- package/dist/lint/rules/comp/comp003-mutating-no-rollback.d.ts.map +1 -0
- package/dist/lint/rules/comp/comp004-gate-needs-temporal.d.ts +37 -0
- package/dist/lint/rules/comp/comp004-gate-needs-temporal.d.ts.map +1 -0
- package/dist/lint/rules/comp/comp005-capability-kind-is-noun.d.ts +43 -0
- package/dist/lint/rules/comp/comp005-capability-kind-is-noun.d.ts.map +1 -0
- package/dist/lint/rules/comp/comp006-shell-needs-reason.d.ts +22 -0
- package/dist/lint/rules/comp/comp006-shell-needs-reason.d.ts.map +1 -0
- package/dist/lint/rules/comp/comp007-composition-sprawl.d.ts +33 -0
- package/dist/lint/rules/comp/comp007-composition-sprawl.d.ts.map +1 -0
- package/dist/lint/rules/comp/index.d.ts +18 -0
- package/dist/lint/rules/comp/index.d.ts.map +1 -0
- package/dist/lint/rules/comp/support.d.ts +71 -0
- package/dist/lint/rules/comp/support.d.ts.map +1 -0
- package/dist/lsp/lexicon-providers.d.ts.map +1 -1
- package/dist/op/activity-registry.d.ts +11 -6
- package/dist/op/activity-registry.d.ts.map +1 -1
- package/dist/op/activity-runtime.d.ts +24 -0
- package/dist/op/activity-runtime.d.ts.map +1 -0
- package/dist/op/builders.d.ts +56 -0
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/index.d.ts +2 -1
- package/dist/op/index.d.ts.map +1 -1
- package/dist/ownership.d.ts +20 -14
- package/dist/ownership.d.ts.map +1 -1
- package/package.json +14 -1
- package/src/audit/catalog.test.ts +74 -22
- package/src/audit/catalog.ts +74 -471
- package/src/audit/fetch.test.ts +112 -8
- package/src/audit/fetch.ts +53 -8
- package/src/audit/proof.ts +4 -2
- package/src/audit/report-html.test.ts +14 -7
- package/src/audit/report-model.ts +20 -9
- package/src/audit/report.test.ts +36 -13
- package/src/audit/report.ts +2 -0
- package/src/audit/rules-doc.test.ts +8 -6
- package/src/audit/rules-doc.ts +13 -5
- package/src/cli/commands/audit.ts +23 -18
- package/src/cli/commands/component-lint.test.ts +158 -0
- package/src/cli/commands/doctor.test.ts +116 -2
- package/src/cli/commands/doctor.ts +46 -0
- package/src/cli/commands/lexicon-rolling-upgrade.ts +198 -0
- package/src/cli/commands/lexicon-surface-diff.test.ts +104 -0
- package/src/cli/commands/lexicon-surface-diff.ts +185 -0
- package/src/cli/commands/lint.ts +142 -1
- package/src/cli/commands/pinned-upgrade.ts +204 -0
- package/src/cli/handlers/build.ts +58 -1
- package/src/cli/handlers/components.test.ts +504 -0
- package/src/cli/handlers/components.ts +404 -0
- package/src/cli/handlers/dev.ts +60 -1
- package/src/cli/handlers/graph.ts +47 -2
- package/src/cli/handlers/misc.ts +45 -1
- package/src/cli/handlers/run.test.ts +967 -3
- package/src/cli/handlers/run.ts +618 -11
- package/src/cli/main.test.ts +66 -0
- package/src/cli/main.ts +105 -2
- package/src/cli/registry.ts +35 -0
- package/src/codegen/fetch.test.ts +84 -3
- package/src/codegen/fetch.ts +76 -2
- package/src/codegen/lexicon-regen.test.ts +298 -0
- package/src/codegen/lexicon-regen.ts +545 -0
- package/src/codegen/pinned-upgrade.test.ts +399 -0
- package/src/codegen/pinned-upgrade.ts +423 -0
- package/src/codegen/rolling-upgrade.test.ts +333 -0
- package/src/codegen/rolling-upgrade.ts +320 -0
- package/src/codegen/surface-snapshot.test.ts +461 -0
- package/src/codegen/surface-snapshot.ts +546 -0
- package/src/codegen/version-bump.test.ts +47 -0
- package/src/codegen/version-bump.ts +39 -0
- package/src/components/README.md +130 -0
- package/src/components/SPRAWL-VALIDATION.md +181 -0
- package/src/components/__fixtures__/alb-ecs-service.json +51 -0
- package/src/components/__fixtures__/dynamodb-infra.json +32 -0
- package/src/components/__fixtures__/emr-job-consumer.json +26 -0
- package/src/components/__fixtures__/jar-lib-producer.json +16 -0
- package/src/components/__fixtures__/lambda-image-processor.json +28 -0
- package/src/components/__fixtures__/neo4j-fanout.json +34 -0
- package/src/components/__fixtures__/single-host-compose.json +29 -0
- package/src/components/auto-release.test.ts +217 -0
- package/src/components/auto-release.ts +216 -0
- package/src/components/builders.test.ts +45 -0
- package/src/components/builders.ts +71 -0
- package/src/components/capability-plugin-loader.ts +218 -0
- package/src/components/capability-plugin-schema.ts +56 -0
- package/src/components/capability-plugin.test.ts +235 -0
- package/src/components/capability-plugin.ts +108 -0
- package/src/components/capability.ts +117 -0
- package/src/components/cli-support.test.ts +579 -0
- package/src/components/cli-support.ts +481 -0
- package/src/components/component-schema.test.ts +265 -0
- package/src/components/component.schema.json +235 -0
- package/src/components/component.test.ts +251 -0
- package/src/components/component.ts +255 -0
- package/src/components/config-defaults.test.ts +263 -0
- package/src/components/config-defaults.ts +145 -0
- package/src/components/discover.test.ts +352 -0
- package/src/components/discover.ts +167 -0
- package/src/components/driver-output.ts +71 -0
- package/src/components/driver.test.ts +638 -0
- package/src/components/driver.ts +690 -0
- package/src/components/index.ts +113 -0
- package/src/components/manifest-persistence.test.ts +152 -0
- package/src/components/manifest-persistence.ts +164 -0
- package/src/components/pilots/README.md +33 -0
- package/src/components/pilots/alb-ecs.pilot.ts +63 -0
- package/src/components/pilots/dynamodb.pilot.ts +59 -0
- package/src/components/pilots/jar-emr.pilot.ts +69 -0
- package/src/components/pilots/lambda.pilot.ts +55 -0
- package/src/components/pilots/neo4j-fanout.pilot.ts +92 -0
- package/src/components/pilots/pilots-lint-clean.test.ts +78 -0
- package/src/components/pilots/pilots.test.ts +126 -0
- package/src/components/pilots/project.ts +13 -0
- package/src/components/presets/comp007-reduction.test.ts +122 -0
- package/src/components/presets/ecs-fargate.test.ts +84 -0
- package/src/components/presets/ecs-fargate.ts +103 -0
- package/src/components/presets/index.ts +32 -0
- package/src/components/presets/lambda.test.ts +35 -0
- package/src/components/presets/lambda.ts +53 -0
- package/src/components/presets/single-host-compose.test.ts +65 -0
- package/src/components/presets/single-host-compose.ts +64 -0
- package/src/components/registry.test.ts +112 -0
- package/src/components/registry.ts +37 -0
- package/src/components/starter-plugin.ts +105 -0
- package/src/components/temporal-codegen-loader.ts +41 -0
- package/src/components/verbs/__fixtures__/package-lock.json +45 -0
- package/src/components/verbs/__fixtures__/pom.xml +37 -0
- package/src/components/verbs/__fixtures__/schemas/cyclonedx-1.5.schema.json +3800 -0
- package/src/components/verbs/__fixtures__/schemas/cyclonedx-spdx-license.schema.json +621 -0
- package/src/components/verbs/__fixtures__/schemas/jsf-0.82.schema.json +240 -0
- package/src/components/verbs/__fixtures__/schemas/spdx-2.3.schema.json +740 -0
- package/src/components/verbs/__tests__/mock-cloud-executor.ts +102 -0
- package/src/components/verbs/__tests__/mock-process-runner.ts +79 -0
- package/src/components/verbs/__tests__/mock-sbom-generator.ts +85 -0
- package/src/components/verbs/bom-writer.test.ts +331 -0
- package/src/components/verbs/bom-writer.ts +386 -0
- package/src/components/verbs/build-archive.test.ts +251 -0
- package/src/components/verbs/build-archive.ts +296 -0
- package/src/components/verbs/build.test.ts +222 -0
- package/src/components/verbs/build.ts +252 -0
- package/src/components/verbs/cloud-executor.ts +181 -0
- package/src/components/verbs/component-bom.test.ts +219 -0
- package/src/components/verbs/component-bom.ts +189 -0
- package/src/components/verbs/index.ts +49 -0
- package/src/components/verbs/license-policy.ts +115 -0
- package/src/components/verbs/lockfile-sbom-generator.test.ts +195 -0
- package/src/components/verbs/lockfile-sbom-generator.ts +236 -0
- package/src/components/verbs/process-runner.test.ts +79 -0
- package/src/components/verbs/process-runner.ts +113 -0
- package/src/components/verbs/reproducibility.test.ts +24 -0
- package/src/components/verbs/reproducibility.ts +100 -0
- package/src/components/verbs/sbom-generator.test.ts +96 -0
- package/src/components/verbs/sbom-generator.ts +209 -0
- package/src/components/verbs/sbom.test.ts +184 -0
- package/src/components/verbs/sbom.ts +152 -0
- package/src/components/verbs/shell.test.ts +36 -0
- package/src/components/verbs/shell.ts +51 -0
- package/src/components/verbs/sign.test.ts +210 -0
- package/src/components/verbs/sign.ts +350 -0
- package/src/components/verbs/stub.ts +34 -0
- package/src/components/verbs/tool-sbom-generator.test.ts +194 -0
- package/src/components/verbs/tool-sbom-generator.ts +192 -0
- package/src/components/verbs/verify.test.ts +159 -0
- package/src/components/verbs/verify.ts +179 -0
- package/src/components/verbs/vex.ts +182 -0
- package/src/components/verbs/vuln-gate.test.ts +201 -0
- package/src/components/verbs/vuln-gate.ts +170 -0
- package/src/components/verbs/vuln-scan.test.ts +145 -0
- package/src/components/verbs/vuln-scan.ts +266 -0
- package/src/components/verbs/wait-verify.test.ts +111 -0
- package/src/components/verbs/wait-verify.ts +171 -0
- package/src/config.test.ts +74 -1
- package/src/config.ts +219 -0
- package/src/index.ts +32 -0
- package/src/lexicon.ts +88 -0
- package/src/lifecycle/build-ledger-store.test.ts +217 -0
- package/src/lifecycle/build-ledger-store.ts +165 -0
- package/src/lifecycle/build-ledger.test.ts +349 -0
- package/src/lifecycle/build-ledger.ts +305 -0
- package/src/lifecycle/git.test.ts +118 -0
- package/src/lifecycle/git.ts +149 -14
- package/src/lifecycle/index.ts +5 -0
- package/src/lifecycle/oras-referrer-lookup.test.ts +116 -0
- package/src/lifecycle/oras-referrer-lookup.ts +110 -0
- package/src/lifecycle/release-ledger.test.ts +209 -0
- package/src/lifecycle/release-ledger.ts +185 -0
- package/src/lifecycle/status.test.ts +330 -0
- package/src/lifecycle/status.ts +278 -0
- package/src/lint/component-checks.ts +148 -0
- package/src/lint/config.test.ts +21 -0
- package/src/lint/engine.ts +11 -2
- package/src/lint/presets/relaxed.json +8 -1
- package/src/lint/presets/strict.json +8 -1
- package/src/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-a.component.ts +9 -0
- package/src/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-b.component.ts +9 -0
- package/src/lint/rules/__fixtures__/comp/comp001/fail/orphan-lib.component.ts +11 -0
- package/src/lint/rules/__fixtures__/comp/comp001/pass/emr-job.component.ts +13 -0
- package/src/lint/rules/__fixtures__/comp/comp001/pass/jar-lib.component.ts +11 -0
- package/src/lint/rules/__fixtures__/comp/comp002/fail/search-service.component.ts +27 -0
- package/src/lint/rules/__fixtures__/comp/comp002/pass/jar-lib.component.ts +10 -0
- package/src/lint/rules/__fixtures__/comp/comp002/pass/search-service.component.ts +23 -0
- package/src/lint/rules/__fixtures__/comp/comp003/fail/migrator.component.ts +10 -0
- package/src/lint/rules/__fixtures__/comp/comp003/pass/migrator.component.ts +19 -0
- package/src/lint/rules/__fixtures__/comp/comp003/pass/orders-table.component.ts +10 -0
- package/src/lint/rules/__fixtures__/comp/comp004/fail/neo4j-cluster.component.ts +20 -0
- package/src/lint/rules/__fixtures__/comp/comp004/pass/neo4j-cluster.component.ts +23 -0
- package/src/lint/rules/__fixtures__/comp/comp004/pass/orders-table.component.ts +10 -0
- package/src/lint/rules/__fixtures__/comp/comp005/fail/search-service.component.ts +14 -0
- package/src/lint/rules/__fixtures__/comp/comp005/pass/search-service.component.ts +18 -0
- package/src/lint/rules/__fixtures__/comp/comp006/fail/legacy-tool.component.ts +10 -0
- package/src/lint/rules/__fixtures__/comp/comp006/pass/legacy-tool.component.ts +14 -0
- package/src/lint/rules/__fixtures__/comp/comp007/fail/inventory-table.component.ts +13 -0
- package/src/lint/rules/__fixtures__/comp/comp007/fail/orders-table.component.ts +13 -0
- package/src/lint/rules/__fixtures__/comp/comp007/pass/orders-table.component.ts +12 -0
- package/src/lint/rules/__fixtures__/comp/comp007/pass/search-service.component.ts +18 -0
- package/src/lint/rules/comp/comp.test.ts +378 -0
- package/src/lint/rules/comp/comp001-publishes-never-applies.ts +78 -0
- package/src/lint/rules/comp/comp002-dangling-wiring-ref.ts +94 -0
- package/src/lint/rules/comp/comp003-mutating-no-rollback.ts +115 -0
- package/src/lint/rules/comp/comp004-gate-needs-temporal.ts +66 -0
- package/src/lint/rules/comp/comp005-capability-kind-is-noun.ts +113 -0
- package/src/lint/rules/comp/comp006-shell-needs-reason.ts +55 -0
- package/src/lint/rules/comp/comp007-composition-sprawl.ts +71 -0
- package/src/lint/rules/comp/index.ts +37 -0
- package/src/lint/rules/comp/support.ts +173 -0
- package/src/lsp/lexicon-providers.test.ts +55 -0
- package/src/lsp/lexicon-providers.ts +13 -3
- package/src/op/activity-registry.test.ts +38 -0
- package/src/op/activity-registry.ts +31 -12
- package/src/op/activity-runtime.ts +73 -0
- package/src/op/builders.ts +92 -0
- package/src/op/index.ts +3 -1
- package/src/ownership.test.ts +24 -26
- package/src/ownership.ts +26 -38
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 0.x-aware version bumping, shared by the pinned upgrade Op (#549) and the
|
|
3
|
+
* rolling drift re-baseline (#616). Centralised here so the single source of
|
|
4
|
+
* truth for the semver rule can't drift between the two callers.
|
|
5
|
+
*/
|
|
6
|
+
/** Surface-change severity that drives a bump. */
|
|
7
|
+
export type BumpSeverity = "additive" | "breaking" | "none";
|
|
8
|
+
/**
|
|
9
|
+
* Compute a bumped semver from a current version and a surface severity.
|
|
10
|
+
*
|
|
11
|
+
* Pre-1.0 (major 0) never auto-promotes to 1.0.0: breaking → minor, additive →
|
|
12
|
+
* patch. At >= 1.0.0: breaking → major, additive → minor. Returns null for
|
|
13
|
+
* "none" or a version string that can't be parsed as MAJOR.MINOR.PATCH.
|
|
14
|
+
*/
|
|
15
|
+
export declare function bumpForSeverity(current: string, severity: BumpSeverity): string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Read a package.json, set its `version`, and write it back — preserving all
|
|
18
|
+
* other fields, 2-space indent, and a trailing newline.
|
|
19
|
+
*/
|
|
20
|
+
export declare function bumpPackageJsonVersion(packageJsonPath: string, newVersion: string): void;
|
|
21
|
+
//# sourceMappingURL=version-bump.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-bump.d.ts","sourceRoot":"","sources":["../../src/codegen/version-bump.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,kDAAkD;AAClD,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;AAE5D;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,GAAG,MAAM,GAAG,IAAI,CAStF;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,eAAe,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAKxF"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type ReleaseRecord } from "../lifecycle/release-ledger.js";
|
|
2
|
+
import type { DriverStepRecord } from "./driver.js";
|
|
3
|
+
/**
|
|
4
|
+
* Extract the artifact digest a component run promoted, by scanning its step
|
|
5
|
+
* records for the last {@link isPromotedArtifact promoted-artifact} output (a
|
|
6
|
+
* publish-family result carrying a location `uri`) and taking its `digest`, so
|
|
7
|
+
* a release record is only ever attempted when the run actually promoted
|
|
8
|
+
* something by digest. Returns undefined when no step promoted an artifact —
|
|
9
|
+
* e.g. a component whose deploy has no publish step, even if it ran
|
|
10
|
+
* `generate-sbom` (whose content `digest` is not a promotion, #665) — the
|
|
11
|
+
* caller treats that as "nothing to record", not an error. Used by the
|
|
12
|
+
* local-executor CLI path, which has the full `DriverStepRecord[]` from
|
|
13
|
+
* `runComponentDeploy`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function extractRunDigest(records: DriverStepRecord[]): string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Same digest extraction as `extractRunDigest`, but over a component
|
|
18
|
+
* Temporal workflow's returned `phaseOutputs` (`{ [phase]: output }`) instead
|
|
19
|
+
* of a `DriverStepRecord[]` — the shape `handle.result()` resolves to for a
|
|
20
|
+
* COMPLETED component workflow (see lexicons/temporal/src/component-op/
|
|
21
|
+
* serializer.ts's generated `return { phaseOutputs, componentOutputs }`).
|
|
22
|
+
* Used by the `--temporal` CLI path, which never sees individual step
|
|
23
|
+
* records (those exist only inside the workflow/activities).
|
|
24
|
+
*/
|
|
25
|
+
export declare function extractRunDigestFromPhaseOutputs(phaseOutputs: Record<string, Record<string, unknown>> | undefined): string | undefined;
|
|
26
|
+
/** Explicit reasons `maybeRecordAutoRelease` declined to write a record — never a thrown error, since "nothing to record" (or "opted out") is an expected, common outcome. */
|
|
27
|
+
export type AutoReleaseSkipReason = "opted-out" | "run-not-successful" | "no-digest" | "no-actor";
|
|
28
|
+
export type AutoReleaseResult = {
|
|
29
|
+
recorded: true;
|
|
30
|
+
commit: string;
|
|
31
|
+
record: ReleaseRecord;
|
|
32
|
+
} | {
|
|
33
|
+
recorded: false;
|
|
34
|
+
reason: AutoReleaseSkipReason;
|
|
35
|
+
detail?: string;
|
|
36
|
+
} | {
|
|
37
|
+
recorded: false;
|
|
38
|
+
reason: "error";
|
|
39
|
+
error: string;
|
|
40
|
+
};
|
|
41
|
+
/** Input describing one component's completed run, common to both the local-executor and Temporal-durable CLI paths. */
|
|
42
|
+
export interface AutoReleaseRunInfo {
|
|
43
|
+
component: string;
|
|
44
|
+
env: string;
|
|
45
|
+
/** Whether the run reported overall success — `DriverRunResult.ok` (local) or a terminal `COMPLETED` Temporal status. A caller must not call this for a non-terminal/in-progress run. */
|
|
46
|
+
success: boolean;
|
|
47
|
+
/** The component's step records (local executor), used to locate the published digest via `extractRunDigest`. Mutually exclusive with `digest` — pass whichever the caller already has. */
|
|
48
|
+
records?: DriverStepRecord[];
|
|
49
|
+
/** A digest already resolved by the caller (e.g. the `--temporal` path, via `extractRunDigestFromPhaseOutputs` over the workflow's `handle.result()`). Takes precedence over `records` when both are given. */
|
|
50
|
+
digest?: string;
|
|
51
|
+
/** Orchestrator run identifier — a Temporal `runId`, or a locally generated id for the local executor (mirrors `runComponentsReleaseRecord`'s `--run-id` default). */
|
|
52
|
+
runId: string;
|
|
53
|
+
}
|
|
54
|
+
/** Opt-out + field-override knobs for auto-release recording, threaded from CLI flags/config (#597: "opt-out-able (flag/config), documented default"). */
|
|
55
|
+
export interface AutoReleaseOptions {
|
|
56
|
+
/** `--no-release-record` / `chant.config.ts`'s `release.autoRecord: false` — skip emission entirely. Default: emission is ON. */
|
|
57
|
+
disabled?: boolean;
|
|
58
|
+
/** Override the git sha to record (tests, or a caller that already resolved it). Defaults to `git rev-parse HEAD`. */
|
|
59
|
+
gitSha?: string;
|
|
60
|
+
/** Override the actor to record. Defaults to `$GITHUB_ACTOR`/`$GITLAB_USER_LOGIN`/`$USER`, matching `runComponentsReleaseRecord`. */
|
|
61
|
+
actor?: string;
|
|
62
|
+
/** Working directory for the git plumbing calls (tests). */
|
|
63
|
+
cwd?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* After a successful `chant run --components <name> --env <env>` (local or
|
|
67
|
+
* `--temporal`), append exactly one immutable release record to the ledger
|
|
68
|
+
* and push it — or explain, without throwing, why it didn't. Never called
|
|
69
|
+
* for a failed run (`run.success` must be true before the caller invokes
|
|
70
|
+
* this at all; see `runOpComponents`/`runComponentTemporal`) — a failed
|
|
71
|
+
* deploy writes nothing, by construction, since this function is simply
|
|
72
|
+
* never reached on that path.
|
|
73
|
+
*
|
|
74
|
+
* Skips (returns `{ recorded: false, reason }`, never throws for these
|
|
75
|
+
* expected cases):
|
|
76
|
+
* - `options.disabled` — the opt-out flag/config was set.
|
|
77
|
+
* - `run.success` false — defensive; callers should not reach here on failure.
|
|
78
|
+
* - no digest found in the run's records — a component with no publish step
|
|
79
|
+
* has nothing to bind a release record to.
|
|
80
|
+
* - no resolvable actor — mirrors `runComponentsReleaseRecord`'s hard
|
|
81
|
+
* requirement; an unattributed record defeats the ledger's purpose.
|
|
82
|
+
*
|
|
83
|
+
* Git-sha resolution failure and ledger-write failures
|
|
84
|
+
* (`InvalidReleaseRecordError`, `StaleLifecycleBranchError`, or any other
|
|
85
|
+
* error `appendReleaseRecord`/`pushLifecycle` throw) are reported as `{
|
|
86
|
+
* recorded: false, reason: "error", error }` rather than propagated — an
|
|
87
|
+
* auto-recorded ledger write is a best-effort observability side effect of a
|
|
88
|
+
* successful deploy; it must never turn a successful `chant run --components`
|
|
89
|
+
* into a failing CLI invocation. The caller should still surface the message
|
|
90
|
+
* as a warning.
|
|
91
|
+
*/
|
|
92
|
+
export declare function maybeRecordAutoRelease(run: AutoReleaseRunInfo, options?: AutoReleaseOptions): Promise<AutoReleaseResult>;
|
|
93
|
+
//# sourceMappingURL=auto-release.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-release.d.ts","sourceRoot":"","sources":["../../src/components/auto-release.ts"],"names":[],"mappings":"AAgCA,OAAO,EAAkD,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAkBjD;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,MAAM,GAAG,SAAS,CAShF;AAED;;;;;;;;GAQG;AACH,wBAAgB,gCAAgC,CAC9C,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,GAChE,MAAM,GAAG,SAAS,CAQpB;AAED,8KAA8K;AAC9K,MAAM,MAAM,qBAAqB,GAC7B,WAAW,GACX,oBAAoB,GACpB,WAAW,GACX,UAAU,CAAC;AAEf,MAAM,MAAM,iBAAiB,GACzB;IAAE,QAAQ,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,GACzD;IAAE,QAAQ,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,qBAAqB,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GACnE;IAAE,QAAQ,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD,wHAAwH;AACxH,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,yLAAyL;IACzL,OAAO,EAAE,OAAO,CAAC;IACjB,2LAA2L;IAC3L,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC7B,+MAA+M;IAC/M,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sKAAsK;IACtK,KAAK,EAAE,MAAM,CAAC;CACf;AAED,0JAA0J;AAC1J,MAAM,WAAW,kBAAkB;IACjC,iIAAiI;IACjI,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sHAAsH;IACtH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qIAAqI;IACrI,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,kBAAkB,EACvB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,iBAAiB,CAAC,CAgD5B"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed step-builder API (#658) — ergonomic sugar over the kind-literal
|
|
3
|
+
* `Step`/`BuildSpec` contract. `phase("Verify", [healthGate({ path })])`
|
|
4
|
+
* is exactly `phase("Verify", [{ kind: "health-gate", path }])`, but
|
|
5
|
+
* with per-verb argument checking and autocomplete from each capability's own
|
|
6
|
+
* `Input` type. Core exports the agnostic verbs' builders; a lexicon exports
|
|
7
|
+
* its own (e.g. the aws lexicon's `cfnDeploy`, reusing the exported `step`).
|
|
8
|
+
*
|
|
9
|
+
* These are pure projections: a builder returns the same kind-literal the
|
|
10
|
+
* driver dispatches on (see ./component.ts's `Step`), so the JSON contract
|
|
11
|
+
* (component.schema.json) stays authoritative and a hand-written or
|
|
12
|
+
* non-chant-authored component keeps working. The runtime `Capability`
|
|
13
|
+
* objects live under `*Capability` names (./verbs/*), registered by `.kind`.
|
|
14
|
+
*/
|
|
15
|
+
import type { BuildSpec, Step } from "./component.js";
|
|
16
|
+
import type { DockerBuildInput, ZipPackageInput, JvmBuildInput, GenerateSbomInput, SignInput, AttestProvenanceInput, VerifyInput, ScanVulnerabilitiesInput, VulnGateInput, WaitClusterHealthyInput, WaitEndpointInput, HealthGateInput, ShellInput } from "./verbs/index.js";
|
|
17
|
+
/**
|
|
18
|
+
* Build a `(input) => Step` for one deploy verb: tags the input with its
|
|
19
|
+
* `kind`. Exported so a lexicon's capability plugin (e.g. the aws lexicon,
|
|
20
|
+
* which owns the `cfn-deploy`/`emr-*`/… builders) can offer the same typed
|
|
21
|
+
* sugar for its own verbs without re-implementing this projection.
|
|
22
|
+
*/
|
|
23
|
+
export declare function step<In extends object>(kind: string): (input: In) => Step;
|
|
24
|
+
export declare const dockerBuild: (input: DockerBuildInput) => BuildSpec;
|
|
25
|
+
export declare const zipPackage: (input: ZipPackageInput) => BuildSpec;
|
|
26
|
+
export declare const jvmBuild: (input: JvmBuildInput) => BuildSpec;
|
|
27
|
+
export declare const generateSbom: (input: GenerateSbomInput) => Step;
|
|
28
|
+
export declare const sign: (input: SignInput) => Step;
|
|
29
|
+
export declare const attestProvenance: (input: AttestProvenanceInput) => Step;
|
|
30
|
+
export declare const verify: (input: VerifyInput) => Step;
|
|
31
|
+
export declare const scanVulnerabilities: (input: ScanVulnerabilitiesInput) => Step;
|
|
32
|
+
export declare const vulnGate: (input: VulnGateInput) => Step;
|
|
33
|
+
export declare const waitClusterHealthy: (input: WaitClusterHealthyInput) => Step;
|
|
34
|
+
export declare const waitEndpoint: (input: WaitEndpointInput) => Step;
|
|
35
|
+
export declare const healthGate: (input: HealthGateInput) => Step;
|
|
36
|
+
export declare const shell: (input: ShellInput) => Step;
|
|
37
|
+
//# sourceMappingURL=builders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../src/components/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,qBAAqB,EACrB,WAAW,EACX,wBAAwB,EACxB,aAAa,EACb,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EACf,UAAU,EACX,MAAM,eAAe,CAAC;AAEvB;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,EAAE,KAAK,IAAI,CAEzE;AAQD,eAAO,MAAM,WAAW,+BAL4C,SAKE,CAAC;AACvE,eAAO,MAAM,UAAU,8BAN6C,SAMD,CAAC;AACpE,eAAO,MAAM,QAAQ,4BAP+C,SAOP,CAAC;AAG9D,eAAO,MAAM,YAAY,gCAf6C,IAeF,CAAC;AAGrE,eAAO,MAAM,IAAI,wBAlBqD,IAkB3B,CAAC;AAC5C,eAAO,MAAM,gBAAgB,oCAnByC,IAmBU,CAAC;AACjF,eAAO,MAAM,MAAM,0BApBmD,IAoBrB,CAAC;AAClD,eAAO,MAAM,mBAAmB,uCArBsC,IAqBmB,CAAC;AAC1F,eAAO,MAAM,QAAQ,4BAtBiD,IAsBd,CAAC;AAKzD,eAAO,MAAM,kBAAkB,sCA3BuC,IA2BiB,CAAC;AACxF,eAAO,MAAM,YAAY,gCA5B6C,IA4BF,CAAC;AACrE,eAAO,MAAM,UAAU,8BA7B+C,IA6BR,CAAC;AAG/D,eAAO,MAAM,KAAK,yBAhCoD,IAgCxB,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discovery + loading for capability plugins — the capability-side analogue
|
|
3
|
+
* of ../cli/plugins.ts's `loadPlugin`/`loadPlugins` for lexicons.
|
|
4
|
+
*
|
|
5
|
+
* Naming convention mirrors lexicons exactly, substituting "capability" for
|
|
6
|
+
* "lexicon": a capability plugin package is
|
|
7
|
+
* `@intentius/chant-capability-<name>` and is expected to export a value
|
|
8
|
+
* satisfying `CapabilityPlugin` (./capability-plugin.ts), detected at
|
|
9
|
+
* runtime with `isCapabilityPlugin` — the same dynamic-import + shape-guard
|
|
10
|
+
* strategy `loadPlugin` uses for `@intentius/chant-lexicon-<name>`.
|
|
11
|
+
*
|
|
12
|
+
* `buildCapabilityRegistry` is the Phase 2 replacement for Phase 1's
|
|
13
|
+
* `createCapabilityRegistry` (./registry.ts): it always loads the built-in
|
|
14
|
+
* `starterCapabilityPlugin` (./starter-plugin.ts) first — preserving every
|
|
15
|
+
* Phase 1 kind with zero behavior change — then loads any additional
|
|
16
|
+
* requested plugin packages on top, registering every capability they
|
|
17
|
+
* contribute into one `CapabilityRegistry` the driver resolves verbs
|
|
18
|
+
* through. Duplicate `kind` registration across plugins throws (via
|
|
19
|
+
* `CapabilityRegistry.register`'s existing guard), the same hard-conflict
|
|
20
|
+
* discipline `checkConflicts` (../cli/conflict-check.ts) applies to
|
|
21
|
+
* duplicate lexicon rule IDs.
|
|
22
|
+
*/
|
|
23
|
+
import { CapabilityRegistry } from "./capability.js";
|
|
24
|
+
import type { CapabilityPlugin } from "./capability-plugin.js";
|
|
25
|
+
/** Thrown when a dynamically-imported capability package does not satisfy `CapabilityPlugin` — the "malformed capability package" case #559 asks doctor/validation to detect. */
|
|
26
|
+
export declare class MalformedCapabilityPluginError extends Error {
|
|
27
|
+
readonly packageName: string;
|
|
28
|
+
constructor(packageName: string, reason: string);
|
|
29
|
+
}
|
|
30
|
+
/** Thrown when two loaded capability plugins register the same `kind` — mirrors the lexicon loader's hard rule-ID conflict. */
|
|
31
|
+
export declare class DuplicateCapabilityKindError extends Error {
|
|
32
|
+
readonly kind: string;
|
|
33
|
+
readonly plugins: string[];
|
|
34
|
+
constructor(kind: string, plugins: string[]);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Dynamically import and validate a single capability plugin package by
|
|
38
|
+
* name. Mirrors ../cli/plugins.ts's `loadPlugin` for lexicons: imports
|
|
39
|
+
* `@intentius/chant-capability-{name}`, scans its exports for a value
|
|
40
|
+
* satisfying `isCapabilityPlugin`, and throws a descriptive
|
|
41
|
+
* `MalformedCapabilityPluginError` if the package exists but exports nothing
|
|
42
|
+
* usable (the malformed-package case), or the original import error if the
|
|
43
|
+
* package cannot be found at all.
|
|
44
|
+
*/
|
|
45
|
+
export declare function loadCapabilityPlugin(name: string): Promise<CapabilityPlugin>;
|
|
46
|
+
/**
|
|
47
|
+
* Load and initialize multiple named capability plugins, in order. Calls
|
|
48
|
+
* `init()` on each plugin if present — mirrors `loadPlugins`'s lexicon
|
|
49
|
+
* `init()` hook.
|
|
50
|
+
*/
|
|
51
|
+
export declare function loadCapabilityPlugins(names: string[]): Promise<CapabilityPlugin[]>;
|
|
52
|
+
/**
|
|
53
|
+
* Load the capability plugin a *lexicon* package contributes, if any. A cloud
|
|
54
|
+
* lexicon (`@intentius/chant-lexicon-<name>`) is the natural home for that
|
|
55
|
+
* cloud's operational leaves (`cfn-deploy`, `emr-*`, …) — the same seam that
|
|
56
|
+
* already carries the lexicon's synthesis, `describeResources`, and ownership
|
|
57
|
+
* markers (docs/components/cloud-boundary). So when a project declares
|
|
58
|
+
* `lexicons: ["aws"]`, its aws leaves come along automatically: this imports
|
|
59
|
+
* the lexicon package and returns the first export satisfying
|
|
60
|
+
* `isCapabilityPlugin`.
|
|
61
|
+
*
|
|
62
|
+
* Tolerant by design — a lexicon that contributes *no* capabilities (most do
|
|
63
|
+
* not yet) simply returns `null` rather than throwing, unlike
|
|
64
|
+
* `loadCapabilityPlugin`'s strict `@intentius/chant-capability-<name>` contract
|
|
65
|
+
* where the package's whole reason to exist is the plugin.
|
|
66
|
+
*/
|
|
67
|
+
export declare function loadCapabilityPluginFromLexicon(name: string): Promise<CapabilityPlugin | null>;
|
|
68
|
+
/** Load the capability plugins contributed by the given lexicons (skipping those that contribute none), initializing each. */
|
|
69
|
+
export declare function loadCapabilityPluginsFromLexicons(names: string[]): Promise<CapabilityPlugin[]>;
|
|
70
|
+
/**
|
|
71
|
+
* Register every capability every plugin contributes into one registry, in
|
|
72
|
+
* plugin order. Throws `DuplicateCapabilityKindError` if two plugins
|
|
73
|
+
* register the same `kind` (via a pre-check, so the error names every
|
|
74
|
+
* offending plugin rather than surfacing only the second registration
|
|
75
|
+
* attempt's generic `CapabilityRegistry.register` message).
|
|
76
|
+
*/
|
|
77
|
+
export declare function registerCapabilityPlugins(registry: CapabilityRegistry, plugins: CapabilityPlugin[]): CapabilityRegistry;
|
|
78
|
+
export interface BuildCapabilityRegistryOptions {
|
|
79
|
+
/**
|
|
80
|
+
* Additional capability plugin package names to load and register on top
|
|
81
|
+
* of the built-in starter plugin (e.g. third-party/cloud-specific
|
|
82
|
+
* capability packages `@intentius/chant-capability-<name>`). Defaults to
|
|
83
|
+
* none — Phase 1 behavior (just the starter set) is preserved when omitted.
|
|
84
|
+
*/
|
|
85
|
+
plugins?: string[];
|
|
86
|
+
/**
|
|
87
|
+
* Lexicon names (from `chant.config.ts`'s `lexicons`) whose packages may
|
|
88
|
+
* *also* contribute a capability plugin — the primary way a cloud's
|
|
89
|
+
* operational leaves are loaded (e.g. `["aws"]` pulls the aws lexicon's
|
|
90
|
+
* `cfn-deploy`/`emr-*`/… leaves). Lexicons contributing no capabilities are
|
|
91
|
+
* silently skipped; see `loadCapabilityPluginsFromLexicons`.
|
|
92
|
+
*/
|
|
93
|
+
lexicons?: string[];
|
|
94
|
+
/**
|
|
95
|
+
* Skip loading the built-in starter plugin. Only meaningful for tests that
|
|
96
|
+
* want a registry seeded purely from explicit `plugins`; real callers
|
|
97
|
+
* should leave this unset so the Phase 1 verb set is always present.
|
|
98
|
+
*/
|
|
99
|
+
includeStarter?: boolean;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Build a `CapabilityRegistry` through the Phase 2 plugin contract: always
|
|
103
|
+
* registers the built-in `starterCapabilityPlugin` first (preserving every
|
|
104
|
+
* Phase 1 `kind` — see ./starter-plugin.ts), then loads and registers any
|
|
105
|
+
* additional named plugin packages. This is the Phase 2 entry point;
|
|
106
|
+
* `createCapabilityRegistry` (./registry.ts) remains available and now
|
|
107
|
+
* delegates to this same starter plugin, so existing Phase 1 callers (and
|
|
108
|
+
* the pilots) are unaffected.
|
|
109
|
+
*/
|
|
110
|
+
export declare function buildCapabilityRegistry(options?: BuildCapabilityRegistryOptions): Promise<CapabilityRegistry>;
|
|
111
|
+
//# sourceMappingURL=capability-plugin-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-plugin-loader.d.ts","sourceRoot":"","sources":["../../src/components/capability-plugin-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAI5D,iLAAiL;AACjL,qBAAa,8BAA+B,SAAQ,KAAK;aAErC,WAAW,EAAE,MAAM;gBAAnB,WAAW,EAAE,MAAM,EACnC,MAAM,EAAE,MAAM;CAKjB;AAED,+HAA+H;AAC/H,qBAAa,4BAA6B,SAAQ,KAAK;aAEnC,IAAI,EAAE,MAAM;aACZ,OAAO,EAAE,MAAM,EAAE;gBADjB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EAAE;CAKpC;AAED;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAqBlF;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAUxF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,+BAA+B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAYpG;AAED,8HAA8H;AAC9H,wBAAsB,iCAAiC,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CASpG;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,gBAAgB,EAAE,GAC1B,kBAAkB,CAqBpB;AAED,MAAM,WAAW,8BAA8B;IAC7C;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,GAAE,8BAAmC,GAC3C,OAAO,CAAC,kBAAkB,CAAC,CAS7B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema + validation for `CapabilityManifest` (./capability-plugin.ts) —
|
|
3
|
+
* the capability-side analogue of ../lexicon-schema.ts's
|
|
4
|
+
* `LexiconManifestSchema`/`validateManifest`. Used to detect a malformed
|
|
5
|
+
* capability package's manifest (#559 acceptance criteria: "Doctor/validation
|
|
6
|
+
* covers a malformed capability package") with the same descriptive-error
|
|
7
|
+
* shape lexicon manifest validation uses.
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import type { CapabilityManifest } from "./capability-plugin.js";
|
|
11
|
+
export declare const CapabilityManifestSchema: z.ZodObject<{
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
version: z.ZodString;
|
|
14
|
+
chantVersion: z.ZodOptional<z.ZodString>;
|
|
15
|
+
kinds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export type CapabilityManifestParsed = z.infer<typeof CapabilityManifestSchema>;
|
|
18
|
+
/**
|
|
19
|
+
* Validate a capability manifest from unknown input (object or JSON string).
|
|
20
|
+
* Throws a descriptive error on invalid input — mirrors
|
|
21
|
+
* ../lexicon-schema.ts's `validateManifest`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function validateCapabilityManifest(data: unknown): CapabilityManifest;
|
|
24
|
+
//# sourceMappingURL=capability-plugin-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-plugin-schema.d.ts","sourceRoot":"","sources":["../../src/components/capability-plugin-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAI9D,eAAO,MAAM,wBAAwB;;;;;iBAKnC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEhF;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,OAAO,GAAG,kBAAkB,CA2B5E"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capability plugin contract — Phase 2 (#559, epic #551).
|
|
3
|
+
*
|
|
4
|
+
* Promotes the Phase 1 capability registry convention
|
|
5
|
+
* (`createCapabilityRegistry`/`STARTER_VERB_FAMILIES`, ./registry.ts) to a
|
|
6
|
+
* first-class chant plugin contract, mirroring the lexicon plugin contract
|
|
7
|
+
* (../lexicon.ts, ../cli/plugins.ts) so capabilities become typed,
|
|
8
|
+
* discoverable packages resolved by `kind`, the same way lexicons are
|
|
9
|
+
* discovered and resolved by resource type.
|
|
10
|
+
*
|
|
11
|
+
* Shape parity with `LexiconPlugin` (../lexicon.ts):
|
|
12
|
+
* - `name`/`version` mirror `LexiconManifest.name`/`.version`.
|
|
13
|
+
* - `capabilities()` is the required lifecycle method (like a lexicon's
|
|
14
|
+
* `serializer`/`generate`/`validate`) every capability package must
|
|
15
|
+
* implement — it returns the typed `Capability` instances this package
|
|
16
|
+
* contributes, registered by `kind` the same way a lexicon's resource
|
|
17
|
+
* types are registered by `resourceType`.
|
|
18
|
+
* - `families()`, `init()` are optional extensions, mirroring
|
|
19
|
+
* `LexiconPlugin`'s optional `lintRules`/`init`/etc.
|
|
20
|
+
* - `isCapabilityPlugin` is the runtime type guard `loadCapabilityPlugin`
|
|
21
|
+
* (./capability-plugin-loader.ts) uses to validate a dynamically-imported
|
|
22
|
+
* package before trusting it — the same defensive shape check
|
|
23
|
+
* `isLexiconPlugin` performs for lexicons.
|
|
24
|
+
*
|
|
25
|
+
* The starter verb set (./registry.ts) becomes the built-in, always-loaded
|
|
26
|
+
* plugin (`starterCapabilityPlugin`, ./starter-plugin.ts) under this same
|
|
27
|
+
* contract — see that module's docstring for the Phase 1 -> Phase 2
|
|
28
|
+
* migration path and the "no behavior change" guarantee.
|
|
29
|
+
*/
|
|
30
|
+
import type { Capability } from "./capability.js";
|
|
31
|
+
/**
|
|
32
|
+
* Manifest for a packaged capability plugin — the capability-side analogue
|
|
33
|
+
* of `LexiconManifest` (../lexicon.ts). Kept as a plain data shape (rather
|
|
34
|
+
* than folded into `CapabilityPlugin`) so it can be serialized alongside a
|
|
35
|
+
* package (e.g. into a future tarball/`meta.json`, matching how lexicons
|
|
36
|
+
* carry `LexiconManifest` in their `BundleSpec`) independent of the runtime
|
|
37
|
+
* plugin object.
|
|
38
|
+
*/
|
|
39
|
+
export interface CapabilityManifest {
|
|
40
|
+
/** Package/plugin name (e.g. "aws", "gcp"), not a capability `kind`. */
|
|
41
|
+
name: string;
|
|
42
|
+
/** Plugin package version (semver). */
|
|
43
|
+
version: string;
|
|
44
|
+
/** Minimum/compatible chant core version, checked the same way as `LexiconManifest.chantVersion` (see ../lexicon-manifest.ts's `checkVersionCompatibility`). */
|
|
45
|
+
chantVersion?: string;
|
|
46
|
+
/** Every capability `kind` this plugin contributes — informational/validation aid; must match what `capabilities()` actually returns. */
|
|
47
|
+
kinds?: string[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Plugin interface for capability packages — the capability-side analogue of
|
|
51
|
+
* `LexiconPlugin` (../lexicon.ts). A capability plugin ships one or more
|
|
52
|
+
* typed `Capability` implementations, discovered and loaded the same way a
|
|
53
|
+
* lexicon plugin is: dynamically imported by a package-naming convention
|
|
54
|
+
* (`@intentius/chant-capability-<name>`, see ./capability-plugin-loader.ts),
|
|
55
|
+
* validated with a runtime shape guard, then registered into a
|
|
56
|
+
* `CapabilityRegistry` the driver resolves verbs through by `kind`.
|
|
57
|
+
*
|
|
58
|
+
* Required lifecycle method enforces consistency: every capability package
|
|
59
|
+
* must be able to enumerate the capabilities it contributes.
|
|
60
|
+
*/
|
|
61
|
+
export interface CapabilityPlugin {
|
|
62
|
+
/** Human-readable plugin/package name (e.g. "aws", "gcp"), not a capability `kind`. */
|
|
63
|
+
readonly name: string;
|
|
64
|
+
/** Plugin package version (semver), mirrors `LexiconManifest.version`. */
|
|
65
|
+
readonly version: string;
|
|
66
|
+
/** Return every `Capability` this plugin contributes, keyed for registration by its own `kind`. */
|
|
67
|
+
capabilities(): Array<Capability<never, unknown>>;
|
|
68
|
+
/** Minimum/compatible chant core version this plugin requires (checked via ../lexicon-manifest.ts's `checkVersionCompatibility`). */
|
|
69
|
+
readonly chantVersion?: string;
|
|
70
|
+
/** Capability kinds grouped by family, informational — mirrors `STARTER_VERB_FAMILIES` (./registry.ts) shape for third-party plugins that want to publish the same grouping. */
|
|
71
|
+
families?(): Record<string, readonly string[]>;
|
|
72
|
+
/** Optional initialization hook, called once after load (mirrors `LexiconPlugin.init`). */
|
|
73
|
+
init?(): void | Promise<void>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Type guard to check if a value is a `CapabilityPlugin`. Checks for the
|
|
77
|
+
* required `name`/`version`/`capabilities` shape, the same defensive check
|
|
78
|
+
* `isLexiconPlugin` (../lexicon.ts) performs before a dynamically-imported
|
|
79
|
+
* package is trusted and registered. This is also chant's detector for a
|
|
80
|
+
* *malformed* capability package (#559 acceptance criteria): a package
|
|
81
|
+
* missing any of these fails the guard and is rejected by the loader with a
|
|
82
|
+
* descriptive error rather than registered half-working.
|
|
83
|
+
*/
|
|
84
|
+
export declare function isCapabilityPlugin(value: unknown): value is CapabilityPlugin;
|
|
85
|
+
//# sourceMappingURL=capability-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-plugin.d.ts","sourceRoot":"","sources":["../../src/components/capability-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,gKAAgK;IAChK,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yIAAyI;IACzI,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,gBAAgB;IAE/B,uFAAuF;IACvF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,mGAAmG;IACnG,YAAY,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;IAGlD,qIAAqI;IACrI,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAE/B,gLAAgL;IAChL,QAAQ,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;IAE/C,2FAA2F;IAC3F,IAAI,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAa5E"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capability contract — the typed leaf behavior components compose from.
|
|
3
|
+
*
|
|
4
|
+
* A capability is a verb ("docker-build", "cfn-deploy", "wait-steady-state"),
|
|
5
|
+
* never a noun (never named after the component that happens to use it).
|
|
6
|
+
* Registered once by `kind`, dispatched by the orchestrator, composed by an
|
|
7
|
+
* unbounded number of components. See:
|
|
8
|
+
* https://intentius.io/chant/components/capabilities/
|
|
9
|
+
*
|
|
10
|
+
* This module defines the interface and registry only. Verb implementations
|
|
11
|
+
* live under `./verbs/*` as typed stubs — no cloud calls, no side effects.
|
|
12
|
+
* Cloud implementations are a later phase (see epic #551, issue #554).
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Ambient information a capability's `run`/`rollback` receives, independent of
|
|
16
|
+
* its typed `input`. Deliberately minimal for this phase: the orchestrator
|
|
17
|
+
* (interpret-mode driver, #556) will thread through the resolved environment,
|
|
18
|
+
* a logger, and step-output wiring (`@Phase.output`) once it exists. Kept as
|
|
19
|
+
* an extensible interface so a later phase can widen it without breaking the
|
|
20
|
+
* `Capability` signature.
|
|
21
|
+
*/
|
|
22
|
+
export interface DeployContext {
|
|
23
|
+
/** Target environment name (e.g. "dev", "staging", "prod"). */
|
|
24
|
+
env: string;
|
|
25
|
+
/** Component name this run belongs to, for logging/attribution. */
|
|
26
|
+
component: string;
|
|
27
|
+
/** Arbitrary environment config resolved by the orchestrator (registry URLs, cluster names, ...). */
|
|
28
|
+
vars?: Record<string, unknown>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A typed leaf behavior. `kind` is the verb string components reference in
|
|
32
|
+
* their composition (`{ kind: "cfn-deploy", ... }`); `run` performs the
|
|
33
|
+
* operation; `rollback` is the optional paired compensation the orchestrator
|
|
34
|
+
* calls, in reverse step order, on saga unwind.
|
|
35
|
+
*
|
|
36
|
+
* Typed `In`/`Out` let a composition wire one step's output into the next
|
|
37
|
+
* step's input (`imageRef: "@Publish.digest"`) and let lint check the wiring
|
|
38
|
+
* before anything runs.
|
|
39
|
+
*/
|
|
40
|
+
export interface Capability<In = unknown, Out = unknown> {
|
|
41
|
+
/** The verb this capability implements — e.g. "docker-build", "cfn-deploy". Never a component name. */
|
|
42
|
+
readonly kind: string;
|
|
43
|
+
/** Perform the operation. */
|
|
44
|
+
run(ctx: DeployContext, input: In): Promise<Out>;
|
|
45
|
+
/** Optional paired compensation, invoked in reverse order on saga rollback. */
|
|
46
|
+
rollback?(ctx: DeployContext, input: In): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* How this verb relates to rollback, for the COMP003 composition check.
|
|
49
|
+
* Usually derivable and left unset: a capability with a `rollback` method is
|
|
50
|
+
* treated as `"native"`, everything else as `"none-by-design"` (build/publish/
|
|
51
|
+
* wait — nothing to compensate). Set it explicitly to `"needs-opt-out"` on a
|
|
52
|
+
* *mutating* verb that has no rollback and no safe undo (e.g. `s3-sync`,
|
|
53
|
+
* `run-migration`), so COMP003 requires the component to acknowledge the
|
|
54
|
+
* compensation gap. See ../lint/rules/comp/comp003-mutating-no-rollback.ts.
|
|
55
|
+
*/
|
|
56
|
+
readonly rollbackPolicy?: RollbackPolicy;
|
|
57
|
+
}
|
|
58
|
+
/** A capability's relationship to rollback — see `Capability.rollbackPolicy`. */
|
|
59
|
+
export type RollbackPolicy = "native" | "none-by-design" | "needs-opt-out";
|
|
60
|
+
/** Extract a capability's `In` type. */
|
|
61
|
+
export type CapabilityInput<C> = C extends Capability<infer In, unknown> ? In : never;
|
|
62
|
+
/** Extract a capability's `Out` type. */
|
|
63
|
+
export type CapabilityOutput<C> = C extends Capability<unknown, infer Out> ? Out : never;
|
|
64
|
+
/**
|
|
65
|
+
* Thrown by a stub `run`/`rollback` — the verb is specified and typed but has
|
|
66
|
+
* no cloud implementation yet. Distinguishes "not implemented" from a runtime
|
|
67
|
+
* failure so callers (and tests) can assert on it specifically.
|
|
68
|
+
*/
|
|
69
|
+
export declare class CapabilityNotImplementedError extends Error {
|
|
70
|
+
readonly kind: string;
|
|
71
|
+
constructor(kind: string);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Resolves capabilities by `kind`. One registry instance is the composition
|
|
75
|
+
* root the orchestrator dispatches through; `createCapabilityRegistry` builds
|
|
76
|
+
* one pre-seeded with the starter verb set (see `./verbs`).
|
|
77
|
+
*/
|
|
78
|
+
export declare class CapabilityRegistry {
|
|
79
|
+
private readonly capabilities;
|
|
80
|
+
/** Register a capability. Throws if `kind` is already registered — a capability is a verb, registered once. */
|
|
81
|
+
register<In, Out>(capability: Capability<In, Out>): this;
|
|
82
|
+
/** Resolve a capability by `kind`. Throws a friendly error listing known kinds if absent. */
|
|
83
|
+
resolve(kind: string): Capability<never, unknown>;
|
|
84
|
+
/** True if a capability is registered for `kind`. */
|
|
85
|
+
has(kind: string): boolean;
|
|
86
|
+
/** All registered kinds, sorted. */
|
|
87
|
+
kinds(): string[];
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=capability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../../src/components/capability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,+DAA+D;IAC/D,GAAG,EAAE,MAAM,CAAC;IACZ,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,qGAAqG;IACrG,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAU,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,GAAG,OAAO;IACrD,uGAAuG;IACvG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,6BAA6B;IAC7B,GAAG,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACjD,+EAA+E;IAC/E,QAAQ,CAAC,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD;;;;;;;;OAQG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;CAC1C;AAED,iFAAiF;AACjF,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAE3E,wCAAwC;AACxC,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,SAAS,UAAU,CAAC,MAAM,EAAE,EAAE,OAAO,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC;AACtF,yCAAyC;AACzC,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC;AAEzF;;;;GAIG;AACH,qBAAa,6BAA8B,SAAQ,KAAK;aAC1B,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;CAIzC;AAED;;;;GAIG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAiD;IAE9E,+GAA+G;IAC/G,QAAQ,CAAC,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,IAAI;IAQxD,6FAA6F;IAC7F,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC;IASjD,qDAAqD;IACrD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1B,oCAAoC;IACpC,KAAK,IAAI,MAAM,EAAE;CAGlB"}
|