@intentius/chant 0.79.0 → 0.81.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/core.d.ts.map +1 -1
- package/dist/audit/discover.d.ts +30 -0
- package/dist/audit/discover.d.ts.map +1 -1
- package/dist/audit/report-html.d.ts +5 -0
- package/dist/audit/report-html.d.ts.map +1 -1
- package/dist/audit/report-model.d.ts +13 -0
- package/dist/audit/report-model.d.ts.map +1 -1
- package/dist/audit/terraform-state.d.ts +13 -0
- package/dist/audit/terraform-state.d.ts.map +1 -1
- package/dist/cli/command-group.d.ts +6 -0
- package/dist/cli/command-group.d.ts.map +1 -1
- package/dist/cli/commands/audit.d.ts +44 -3
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon-examples.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon.d.ts +8 -0
- package/dist/cli/commands/check-lexicon.d.ts.map +1 -1
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/import-agents.d.ts.map +1 -1
- package/dist/cli/commands/init.d.ts +6 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/onboard.d.ts.map +1 -1
- package/dist/cli/commands/update.d.ts +6 -0
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/vendor.d.ts +5 -0
- package/dist/cli/commands/vendor.d.ts.map +1 -1
- package/dist/cli/conflict-check.d.ts +6 -0
- package/dist/cli/conflict-check.d.ts.map +1 -1
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/components.d.ts.map +1 -1
- package/dist/cli/handlers/dev.d.ts.map +1 -1
- package/dist/cli/handlers/fan-out.d.ts.map +1 -1
- package/dist/cli/handlers/init.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/handlers/misc.d.ts.map +1 -1
- package/dist/cli/handlers/operator.d.ts +7 -0
- package/dist/cli/handlers/operator.d.ts.map +1 -1
- package/dist/cli/handlers/promote.d.ts +20 -0
- package/dist/cli/handlers/promote.d.ts.map +1 -0
- package/dist/cli/handlers/run-generate.d.ts +39 -0
- package/dist/cli/handlers/run-generate.d.ts.map +1 -0
- package/dist/cli/handlers/run.d.ts +4 -1
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/vendor.d.ts +8 -3
- package/dist/cli/handlers/vendor.d.ts.map +1 -1
- package/dist/cli/main.d.ts +12 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/mcp/op-tools.d.ts.map +1 -1
- package/dist/cli/plugins.d.ts +14 -0
- package/dist/cli/plugins.d.ts.map +1 -1
- package/dist/cli/registry.d.ts +46 -1
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/codegen/fetch.d.ts +10 -0
- package/dist/codegen/fetch.d.ts.map +1 -1
- package/dist/components/capability-plugin-loader.d.ts.map +1 -1
- package/dist/components/cli-support.d.ts +3 -1
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/components/discover.d.ts.map +1 -1
- package/dist/components/driver.d.ts +16 -2
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/fan-out-support.d.ts.map +1 -1
- package/dist/components/gate-plan.d.ts +40 -0
- package/dist/components/gate-plan.d.ts.map +1 -0
- package/dist/components/pilots/alb-ecs.pilot.d.ts +7 -1
- package/dist/components/pilots/alb-ecs.pilot.d.ts.map +1 -1
- package/dist/components/presets/ecs-fargate.d.ts +10 -4
- package/dist/components/presets/ecs-fargate.d.ts.map +1 -1
- package/dist/components/promote.d.ts +264 -0
- package/dist/components/promote.d.ts.map +1 -0
- package/dist/components/sandbox/driver.d.ts.map +1 -1
- package/dist/components/sandbox/run.d.ts.map +1 -1
- package/dist/components/verbs/build-archive.d.ts +22 -11
- package/dist/components/verbs/build-archive.d.ts.map +1 -1
- package/dist/components/verbs/run-agent.d.ts.map +1 -1
- package/dist/config-static.d.ts +59 -0
- package/dist/config-static.d.ts.map +1 -0
- package/dist/config.d.ts +104 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/content-digest.d.ts +17 -0
- package/dist/content-digest.d.ts.map +1 -0
- package/dist/discovery/files.d.ts +48 -4
- package/dist/discovery/files.d.ts.map +1 -1
- package/dist/discovery/fold-import.d.ts +32 -1
- package/dist/discovery/fold-import.d.ts.map +1 -1
- package/dist/discovery/index.d.ts.map +1 -1
- package/dist/discovery/sandbox/driver.d.ts +20 -0
- package/dist/discovery/sandbox/driver.d.ts.map +1 -1
- package/dist/discovery/sandbox/fork.d.ts +20 -0
- package/dist/discovery/sandbox/fork.d.ts.map +1 -1
- package/dist/discovery/walk.d.ts +119 -0
- package/dist/discovery/walk.d.ts.map +1 -0
- package/dist/graph-ir.d.ts +17 -1
- package/dist/graph-ir.d.ts.map +1 -1
- package/dist/join-key.d.ts +31 -0
- package/dist/join-key.d.ts.map +1 -0
- package/dist/lexicon-module.d.ts +110 -0
- package/dist/lexicon-module.d.ts.map +1 -0
- package/dist/lexicon.d.ts +82 -1
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/build-ledger-store.d.ts.map +1 -1
- package/dist/lifecycle/digest.d.ts +5 -1
- package/dist/lifecycle/digest.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.d.ts +20 -5
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/git.d.ts +64 -0
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/lease.d.ts +8 -1
- package/dist/lifecycle/lease.d.ts.map +1 -1
- package/dist/lifecycle/legacy-digest.d.ts +59 -0
- package/dist/lifecycle/legacy-digest.d.ts.map +1 -0
- package/dist/lifecycle/member-ledger.d.ts +67 -0
- package/dist/lifecycle/member-ledger.d.ts.map +1 -0
- package/dist/lifecycle/plan-digest.d.ts +4 -3
- package/dist/lifecycle/plan-digest.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.d.ts +42 -1
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/status.d.ts +90 -5
- package/dist/lifecycle/status.d.ts.map +1 -1
- package/dist/lint/rules/comp/comp003-mutating-no-rollback.d.ts +2 -3
- package/dist/lint/rules/comp/comp003-mutating-no-rollback.d.ts.map +1 -1
- package/dist/op/activities/activity-contracts.d.ts +32 -0
- package/dist/op/activities/activity-contracts.d.ts.map +1 -1
- package/dist/op/activities/index.d.ts +2 -0
- package/dist/op/activities/index.d.ts.map +1 -1
- package/dist/op/activities/propose-upgrade.d.ts +75 -0
- package/dist/op/activities/propose-upgrade.d.ts.map +1 -0
- package/dist/op/activity-contract-registry.d.ts.map +1 -1
- package/dist/op/activity-registry.d.ts.map +1 -1
- package/dist/op/discover.d.ts.map +1 -1
- package/dist/op/gate-approval.d.ts.map +1 -1
- package/dist/op/gate-name.d.ts +7 -0
- package/dist/op/gate-name.d.ts.map +1 -1
- package/dist/op/gate-summary.d.ts +16 -0
- package/dist/op/gate-summary.d.ts.map +1 -1
- package/dist/op/gate.d.ts +16 -2
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/generate-pipeline.d.ts.map +1 -1
- package/dist/op/runtimes/local.d.ts.map +1 -1
- package/dist/project-root.d.ts +26 -0
- package/dist/project-root.d.ts.map +1 -1
- package/dist/workspace/__fixtures__/contract-repo.d.ts +37 -0
- package/dist/workspace/__fixtures__/contract-repo.d.ts.map +1 -0
- package/dist/workspace/__fixtures__/two-member-workspace.d.ts +11 -0
- package/dist/workspace/__fixtures__/two-member-workspace.d.ts.map +1 -0
- package/dist/workspace/checks/generated.d.ts +156 -0
- package/dist/workspace/checks/generated.d.ts.map +1 -0
- package/dist/workspace/checks/ledgers.d.ts +78 -0
- package/dist/workspace/checks/ledgers.d.ts.map +1 -0
- package/dist/workspace/checks/links.d.ts +25 -0
- package/dist/workspace/checks/links.d.ts.map +1 -0
- package/dist/workspace/checks/pipelines.d.ts +76 -0
- package/dist/workspace/checks/pipelines.d.ts.map +1 -0
- package/dist/workspace/checks.d.ts +161 -0
- package/dist/workspace/checks.d.ts.map +1 -0
- package/dist/workspace/compose-graph.d.ts +115 -0
- package/dist/workspace/compose-graph.d.ts.map +1 -0
- package/dist/workspace/compose-reports.d.ts +68 -0
- package/dist/workspace/compose-reports.d.ts.map +1 -0
- package/dist/workspace/declaration.d.ts +220 -0
- package/dist/workspace/declaration.d.ts.map +1 -0
- package/dist/workspace/declaration.schema.json +434 -0
- package/dist/workspace/generated-files.d.ts +65 -0
- package/dist/workspace/generated-files.d.ts.map +1 -0
- package/dist/workspace/glob.d.ts +13 -0
- package/dist/workspace/glob.d.ts.map +1 -0
- package/dist/workspace/graph-cli.d.ts +75 -0
- package/dist/workspace/graph-cli.d.ts.map +1 -0
- package/dist/workspace/init.d.ts +96 -0
- package/dist/workspace/init.d.ts.map +1 -0
- package/dist/workspace/jsonc.d.ts +38 -0
- package/dist/workspace/jsonc.d.ts.map +1 -0
- package/dist/workspace/kinds.d.ts +192 -0
- package/dist/workspace/kinds.d.ts.map +1 -0
- package/dist/workspace/lineage-check.d.ts +84 -0
- package/dist/workspace/lineage-check.d.ts.map +1 -0
- package/dist/workspace/lineage-cli.d.ts +31 -0
- package/dist/workspace/lineage-cli.d.ts.map +1 -0
- package/dist/workspace/lineage-init.d.ts +101 -0
- package/dist/workspace/lineage-init.d.ts.map +1 -0
- package/dist/workspace/lineage-lock.d.ts +258 -0
- package/dist/workspace/lineage-lock.d.ts.map +1 -0
- package/dist/workspace/lineage-merge.d.ts +14 -0
- package/dist/workspace/lineage-merge.d.ts.map +1 -0
- package/dist/workspace/lineage-migrations.d.ts +178 -0
- package/dist/workspace/lineage-migrations.d.ts.map +1 -0
- package/dist/workspace/lineage-update.d.ts +59 -0
- package/dist/workspace/lineage-update.d.ts.map +1 -0
- package/dist/workspace/lineage-upgrade-cli.d.ts +40 -0
- package/dist/workspace/lineage-upgrade-cli.d.ts.map +1 -0
- package/dist/workspace/lineage-upgrade.d.ts +146 -0
- package/dist/workspace/lineage-upgrade.d.ts.map +1 -0
- package/dist/workspace/lineage-vendor.d.ts +63 -0
- package/dist/workspace/lineage-vendor.d.ts.map +1 -0
- package/dist/workspace/lineage-version.d.ts +32 -0
- package/dist/workspace/lineage-version.d.ts.map +1 -0
- package/dist/workspace/links.d.ts +150 -0
- package/dist/workspace/links.d.ts.map +1 -0
- package/dist/workspace/ls.d.ts +99 -0
- package/dist/workspace/ls.d.ts.map +1 -0
- package/dist/workspace/member-commands.d.ts +139 -0
- package/dist/workspace/member-commands.d.ts.map +1 -0
- package/dist/workspace/member-handles.d.ts +54 -0
- package/dist/workspace/member-handles.d.ts.map +1 -0
- package/dist/workspace/member-pipeline.d.ts +143 -0
- package/dist/workspace/member-pipeline.d.ts.map +1 -0
- package/dist/workspace/member-run.d.ts +67 -0
- package/dist/workspace/member-run.d.ts.map +1 -0
- package/dist/workspace/reason-codes.d.ts +65 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -0
- package/dist/workspace/record-source.d.ts +22 -0
- package/dist/workspace/record-source.d.ts.map +1 -0
- package/dist/workspace/records-cli.d.ts +81 -0
- package/dist/workspace/records-cli.d.ts.map +1 -0
- package/dist/workspace/records.d.ts +118 -0
- package/dist/workspace/records.d.ts.map +1 -0
- package/dist/workspace/root-refusal.d.ts +53 -0
- package/dist/workspace/root-refusal.d.ts.map +1 -0
- package/dist/workspace/status.d.ts +150 -0
- package/dist/workspace/status.d.ts.map +1 -0
- package/dist/workspace/template-manifest.d.ts +90 -0
- package/dist/workspace/template-manifest.d.ts.map +1 -0
- package/dist/workspace/tree.d.ts +36 -0
- package/dist/workspace/tree.d.ts.map +1 -0
- package/dist/workspace/trust/attestor.d.ts +67 -0
- package/dist/workspace/trust/attestor.d.ts.map +1 -0
- package/dist/workspace/trust/policy.d.ts +111 -0
- package/dist/workspace/trust/policy.d.ts.map +1 -0
- package/dist/workspace/trust/provenance.d.ts +67 -0
- package/dist/workspace/trust/provenance.d.ts.map +1 -0
- package/dist/workspace/trust/ssh-commit.d.ts +43 -0
- package/dist/workspace/trust/ssh-commit.d.ts.map +1 -0
- package/dist/workspace/trust/test-repo.d.ts +42 -0
- package/dist/workspace/trust/test-repo.d.ts.map +1 -0
- package/dist/workspace/trust/verify-cli.d.ts +9 -0
- package/dist/workspace/trust/verify-cli.d.ts.map +1 -0
- package/dist/workspace/trust/verify.d.ts +66 -0
- package/dist/workspace/trust/verify.d.ts.map +1 -0
- package/dist/workspace/which-chant.d.ts +58 -0
- package/dist/workspace/which-chant.d.ts.map +1 -0
- package/dist/workspace/workspace-kinds.schema.json +133 -0
- package/package.json +4 -3
- package/src/audit/core.ts +13 -2
- package/src/audit/discover.ts +102 -36
- package/src/audit/report-html.ts +3 -1
- package/src/audit/report-model.ts +14 -1
- package/src/audit/terraform-state.test.ts +81 -1
- package/src/audit/terraform-state.ts +25 -0
- package/src/cli/command-group.ts +7 -0
- package/src/cli/commands/audit-truncation.test.ts +167 -0
- package/src/cli/commands/audit.ts +132 -29
- package/src/cli/commands/check-lexicon-examples.ts +2 -1
- package/src/cli/commands/check-lexicon.ts +24 -0
- package/src/cli/commands/doctor.test.ts +30 -0
- package/src/cli/commands/doctor.ts +21 -0
- package/src/cli/commands/import-agents.ts +15 -4
- package/src/cli/commands/init.ts +76 -25
- package/src/cli/commands/lint.test.ts +52 -1
- package/src/cli/commands/lint.ts +41 -71
- package/src/cli/commands/onboard.ts +15 -0
- package/src/cli/commands/update.ts +18 -5
- package/src/cli/commands/vendor.ts +11 -6
- package/src/cli/conflict-check.test.ts +18 -1
- package/src/cli/conflict-check.ts +13 -0
- package/src/cli/discovery-skip.test.ts +168 -0
- package/src/cli/handlers/__snapshots__/build-member.test.ts.snap +38 -0
- package/src/cli/handlers/build-member.test.ts +127 -0
- package/src/cli/handlers/build.test.ts +11 -0
- package/src/cli/handlers/build.ts +35 -1
- package/src/cli/handlers/components.test.ts +127 -0
- package/src/cli/handlers/components.ts +70 -8
- package/src/cli/handlers/dev.ts +6 -1
- package/src/cli/handlers/fan-out.ts +9 -2
- package/src/cli/handlers/graph.test.ts +20 -0
- package/src/cli/handlers/graph.ts +4 -2
- package/src/cli/handlers/init.ts +54 -1
- package/src/cli/handlers/lifecycle.ts +2 -1
- package/src/cli/handlers/misc.ts +16 -0
- package/src/cli/handlers/operator.test.ts +68 -0
- package/src/cli/handlers/operator.ts +39 -10
- package/src/cli/handlers/promote.test.ts +377 -0
- package/src/cli/handlers/promote.ts +391 -0
- package/src/cli/handlers/run-generate-member.test.ts +83 -0
- package/src/cli/handlers/run-generate.test.ts +158 -0
- package/src/cli/handlers/run-generate.ts +168 -0
- package/src/cli/handlers/run.test.ts +47 -0
- package/src/cli/handlers/run.ts +41 -6
- package/src/cli/handlers/vendor.ts +147 -43
- package/src/cli/main.test.ts +137 -1
- package/src/cli/main.ts +290 -24
- package/src/cli/mcp/op-tools.ts +2 -1
- package/src/cli/path-lexicon-messages.test.ts +152 -0
- package/src/cli/plugins.ts +43 -5
- package/src/cli/registry.ts +46 -1
- package/src/cli/static-config-read.test.ts +208 -0
- package/src/codegen/fetch.test.ts +63 -1
- package/src/codegen/fetch.ts +30 -1
- package/src/components/__fixtures__/alb-ecs-service.json +0 -8
- package/src/components/capability-plugin-loader.ts +3 -1
- package/src/components/cli-support.ts +9 -3
- package/src/components/discover.test.ts +27 -57
- package/src/components/discover.ts +20 -51
- package/src/components/driver.test.ts +90 -12
- package/src/components/driver.ts +43 -5
- package/src/components/fan-out-support.ts +2 -1
- package/src/components/gate-plan.ts +53 -0
- package/src/components/pilots/README.md +1 -1
- package/src/components/pilots/alb-ecs.pilot.ts +7 -7
- package/src/components/presets/ecs-fargate.ts +10 -5
- package/src/components/promote.test.ts +645 -0
- package/src/components/promote.ts +641 -0
- package/src/components/sandbox/driver.ts +8 -8
- package/src/components/sandbox/run.ts +4 -1
- package/src/components/verbs/build-archive.ts +27 -21
- package/src/components/verbs/run-agent.ts +3 -5
- package/src/config-static.test.ts +136 -0
- package/src/config-static.ts +232 -0
- package/src/config.test.ts +40 -0
- package/src/config.ts +161 -11
- package/src/content-digest.test.ts +120 -0
- package/src/content-digest.ts +21 -0
- package/src/discovery/files.test.ts +127 -1
- package/src/discovery/files.ts +91 -59
- package/src/discovery/fold-import.ts +127 -9
- package/src/discovery/index.ts +1 -0
- package/src/discovery/sandbox/driver.ts +73 -35
- package/src/discovery/sandbox/fork-diagnostic.test.ts +136 -13
- package/src/discovery/sandbox/fork.ts +83 -43
- package/src/discovery/sandbox/path-lexicon-multifile.test.ts +285 -0
- package/src/discovery/sandbox/path-lexicon-parity.test.ts +162 -0
- package/src/discovery/walk.test.ts +263 -0
- package/src/discovery/walk.ts +334 -0
- package/src/effect-receipt.ts +2 -2
- package/src/graph-ir.ts +18 -1
- package/src/join-key.test.ts +25 -0
- package/src/join-key.ts +39 -0
- package/src/lexicon-module.test.ts +203 -0
- package/src/lexicon-module.ts +215 -0
- package/src/lexicon.ts +105 -1
- package/src/lifecycle/build-ledger-store.ts +13 -2
- package/src/lifecycle/digest.ts +9 -5
- package/src/lifecycle/gate-ledger.test.ts +20 -0
- package/src/lifecycle/gate-ledger.ts +28 -6
- package/src/lifecycle/git.test.ts +13 -1
- package/src/lifecycle/git.ts +221 -176
- package/src/lifecycle/lease.ts +25 -10
- package/src/lifecycle/legacy-digest.test.ts +206 -0
- package/src/lifecycle/legacy-digest.ts +103 -0
- package/src/lifecycle/member-ledger.test.ts +319 -0
- package/src/lifecycle/member-ledger.ts +145 -0
- package/src/lifecycle/plan-digest.ts +7 -7
- package/src/lifecycle/release-ledger.test.ts +20 -0
- package/src/lifecycle/release-ledger.ts +53 -3
- package/src/lifecycle/status.test.ts +151 -1
- package/src/lifecycle/status.ts +228 -7
- package/src/lint/rules/comp/comp003-mutating-no-rollback.ts +2 -3
- package/src/op/activities/activity-contracts.ts +37 -0
- package/src/op/activities/index.ts +10 -0
- package/src/op/activities/propose-upgrade.ts +206 -0
- package/src/op/activity-contract-registry.ts +18 -4
- package/src/op/activity-registry.ts +26 -0
- package/src/op/discover.test.ts +14 -4
- package/src/op/discover.ts +19 -23
- package/src/op/gate-approval.ts +3 -1
- package/src/op/gate-name.ts +8 -0
- package/src/op/gate-summary.test.ts +14 -0
- package/src/op/gate-summary.ts +25 -2
- package/src/op/gate.ts +36 -7
- package/src/op/generate-pipeline.test.ts +14 -5
- package/src/op/generate-pipeline.ts +2 -1
- package/src/op/runtimes/local.ts +2 -1
- package/src/project-root.test.ts +66 -1
- package/src/project-root.ts +48 -0
- package/src/workspace/__fixtures__/contract-repo.ts +100 -0
- package/src/workspace/__fixtures__/two-member-workspace.ts +35 -0
- package/src/workspace/behold-kinds.test.ts +162 -0
- package/src/workspace/check-contract.test.ts +127 -0
- package/src/workspace/check.schema.json +347 -0
- package/src/workspace/checks/generated.test.ts +287 -0
- package/src/workspace/checks/generated.ts +475 -0
- package/src/workspace/checks/ledgers.test.ts +139 -0
- package/src/workspace/checks/ledgers.ts +246 -0
- package/src/workspace/checks/links.ts +183 -0
- package/src/workspace/checks/pipelines.test.ts +133 -0
- package/src/workspace/checks/pipelines.ts +225 -0
- package/src/workspace/checks-repo.test.ts +71 -0
- package/src/workspace/checks.test.ts +450 -0
- package/src/workspace/checks.ts +461 -0
- package/src/workspace/compose-graph.test.ts +146 -0
- package/src/workspace/compose-graph.ts +228 -0
- package/src/workspace/compose-reports.test.ts +109 -0
- package/src/workspace/compose-reports.ts +186 -0
- package/src/workspace/declaration.schema.json +434 -0
- package/src/workspace/declaration.test.ts +347 -0
- package/src/workspace/declaration.ts +623 -0
- package/src/workspace/generated-files.test.ts +114 -0
- package/src/workspace/generated-files.ts +94 -0
- package/src/workspace/glob.ts +49 -0
- package/src/workspace/graph-cli.ts +220 -0
- package/src/workspace/graph-contract.test.ts +204 -0
- package/src/workspace/graph.schema.json +662 -0
- package/src/workspace/init.test.ts +223 -0
- package/src/workspace/init.ts +585 -0
- package/src/workspace/jsonc.test.ts +65 -0
- package/src/workspace/jsonc.ts +231 -0
- package/src/workspace/kinds.test.ts +288 -0
- package/src/workspace/kinds.ts +506 -0
- package/src/workspace/lineage-check.ts +264 -0
- package/src/workspace/lineage-cli.ts +114 -0
- package/src/workspace/lineage-init.test.ts +231 -0
- package/src/workspace/lineage-init.ts +365 -0
- package/src/workspace/lineage-lock.test.ts +224 -0
- package/src/workspace/lineage-lock.ts +357 -0
- package/src/workspace/lineage-merge.ts +44 -0
- package/src/workspace/lineage-migrations.test.ts +178 -0
- package/src/workspace/lineage-migrations.ts +343 -0
- package/src/workspace/lineage-update.ts +160 -0
- package/src/workspace/lineage-upgrade-cli.ts +151 -0
- package/src/workspace/lineage-upgrade.test.ts +474 -0
- package/src/workspace/lineage-upgrade.ts +624 -0
- package/src/workspace/lineage-vendor.test.ts +126 -0
- package/src/workspace/lineage-vendor.ts +215 -0
- package/src/workspace/lineage-version.ts +127 -0
- package/src/workspace/links.test.ts +344 -0
- package/src/workspace/links.ts +331 -0
- package/src/workspace/ls-contract.test.ts +200 -0
- package/src/workspace/ls.schema.json +190 -0
- package/src/workspace/ls.ts +254 -0
- package/src/workspace/member-commands.e2e.test.ts +244 -0
- package/src/workspace/member-commands.test.ts +217 -0
- package/src/workspace/member-commands.ts +540 -0
- package/src/workspace/member-handles.test.ts +76 -0
- package/src/workspace/member-handles.ts +228 -0
- package/src/workspace/member-pipeline.test.ts +135 -0
- package/src/workspace/member-pipeline.ts +317 -0
- package/src/workspace/member-run.ts +146 -0
- package/src/workspace/read-contract.test.ts +129 -0
- package/src/workspace/reason-codes.test.ts +113 -0
- package/src/workspace/reason-codes.ts +81 -0
- package/src/workspace/record-source.ts +117 -0
- package/src/workspace/records-cli.ts +198 -0
- package/src/workspace/records-contract.test.ts +93 -0
- package/src/workspace/records.schema.json +150 -0
- package/src/workspace/records.test.ts +243 -0
- package/src/workspace/records.ts +384 -0
- package/src/workspace/root-refusal.ts +97 -0
- package/src/workspace/status-contract.test.ts +308 -0
- package/src/workspace/status.schema.json +210 -0
- package/src/workspace/status.ts +412 -0
- package/src/workspace/template-manifest.test.ts +79 -0
- package/src/workspace/template-manifest.ts +221 -0
- package/src/workspace/tree.ts +132 -0
- package/src/workspace/trust/attestor.ts +93 -0
- package/src/workspace/trust/policy.ts +306 -0
- package/src/workspace/trust/provenance.ts +181 -0
- package/src/workspace/trust/ssh-commit.ts +138 -0
- package/src/workspace/trust/test-repo.ts +138 -0
- package/src/workspace/trust/trust.test.ts +397 -0
- package/src/workspace/trust/verify-cli.ts +56 -0
- package/src/workspace/trust/verify.ts +194 -0
- package/src/workspace/which-chant.test.ts +117 -0
- package/src/workspace/which-chant.ts +151 -0
- package/src/workspace/workspace-kinds.schema.json +133 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant workspace init [dir] [--name <name>] [--yes] [--verbose]` (#2534):
|
|
3
|
+
* propose a declaration from the projects already in a repository, print it
|
|
4
|
+
* with the directories that would leave the root project, and write it only
|
|
5
|
+
* once the user confirms (#2525 rule 1, ws-012).
|
|
6
|
+
*
|
|
7
|
+
* The proposal is a starting point for review, never written silently:
|
|
8
|
+
*
|
|
9
|
+
* - each outermost chant project (a chant.config.ts or .json) becomes a
|
|
10
|
+
* `chant` member, and the root's own config makes a root member `"."`;
|
|
11
|
+
* - each nested declaration becomes a `workspace` member;
|
|
12
|
+
* - each other npm package, from the npm workspaces or any other
|
|
13
|
+
* package.json, becomes an `other` member with a `because`;
|
|
14
|
+
* - projects under an `examples`, `test` or `fixtures`-style directory become
|
|
15
|
+
* example groups (ws-051), one glob per tree where the tree is mostly
|
|
16
|
+
* projects, explicit paths where it isn't;
|
|
17
|
+
* - each `chant` member gets an `ownership.stack` of its own (#2538, ws-037):
|
|
18
|
+
* a stack no other member uses is kept, and a shared or missing one gets a
|
|
19
|
+
* proposed name. The stack stays in the member's chant.config, since
|
|
20
|
+
* markers carry no member key, so this is printed for the user to apply and
|
|
21
|
+
* never written.
|
|
22
|
+
*
|
|
23
|
+
* Nothing here runs project code: it reads file names and package.json files.
|
|
24
|
+
*/
|
|
25
|
+
import type { CommandContext } from "../cli/registry.js";
|
|
26
|
+
import { type WorkspaceTree } from "./tree.js";
|
|
27
|
+
export interface ProposedEntry {
|
|
28
|
+
name: string;
|
|
29
|
+
dir?: string;
|
|
30
|
+
kind: string;
|
|
31
|
+
because?: string;
|
|
32
|
+
glob?: string | string[];
|
|
33
|
+
}
|
|
34
|
+
/** The ownership stack proposed for one `chant` member (#2538). */
|
|
35
|
+
export interface StackProposal {
|
|
36
|
+
member: string;
|
|
37
|
+
dir: string;
|
|
38
|
+
/** The config file the stack is set in, relative to the root. */
|
|
39
|
+
config: string;
|
|
40
|
+
/**
|
|
41
|
+
* The member's `ownership.stack` as written, when it is a plain string in
|
|
42
|
+
* the config. Null when it sets none, or computes it.
|
|
43
|
+
*/
|
|
44
|
+
current: string | null;
|
|
45
|
+
/** The stack the member should use; equal to `current` when that is kept. */
|
|
46
|
+
proposed: string;
|
|
47
|
+
/** Why the stack changes: `missing`, `shared` with another member, or `computed`. Absent when kept. */
|
|
48
|
+
reason?: "missing" | "shared" | "computed";
|
|
49
|
+
}
|
|
50
|
+
export interface Proposal {
|
|
51
|
+
root: string;
|
|
52
|
+
/** The declaration as it would be written. */
|
|
53
|
+
declaration: {
|
|
54
|
+
name: string;
|
|
55
|
+
schema: 1;
|
|
56
|
+
members: ProposedEntry[];
|
|
57
|
+
};
|
|
58
|
+
/** Directories leaving the root project, with the .ts source files each holds. */
|
|
59
|
+
leaving: {
|
|
60
|
+
dir: string;
|
|
61
|
+
owner: string;
|
|
62
|
+
files: string[];
|
|
63
|
+
}[];
|
|
64
|
+
/** One ownership stack per `chant` member, all distinct (ws-037). */
|
|
65
|
+
stacks: StackProposal[];
|
|
66
|
+
}
|
|
67
|
+
export declare function sanitizeName(raw: string): string;
|
|
68
|
+
/**
|
|
69
|
+
* A member's `ownership.stack` read from its config's text, without running
|
|
70
|
+
* it: `{ stack }` when it is a plain string, `{ computed: true }` when the
|
|
71
|
+
* config has an ownership block whose stack is not one, and `{}` when it sets
|
|
72
|
+
* none.
|
|
73
|
+
*/
|
|
74
|
+
export declare function readOwnershipStack(tree: WorkspaceTree, dir: string): {
|
|
75
|
+
config: string;
|
|
76
|
+
stack?: string;
|
|
77
|
+
computed?: boolean;
|
|
78
|
+
} | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* One distinct stack per `chant` member, in declaration order, so the root
|
|
81
|
+
* member and then the outermost directories keep theirs first. A stack only
|
|
82
|
+
* one member uses is kept. A shared stack stays with the first member using
|
|
83
|
+
* it, and the others get their member name. A member with no stack, or one
|
|
84
|
+
* the config computes, gets its member name too. A proposed name never takes
|
|
85
|
+
* a stack another member already sets.
|
|
86
|
+
*/
|
|
87
|
+
export declare function proposeStacks(tree: WorkspaceTree, members: {
|
|
88
|
+
name: string;
|
|
89
|
+
dir: string;
|
|
90
|
+
kind: string;
|
|
91
|
+
}[]): StackProposal[];
|
|
92
|
+
export declare function proposeWorkspace(root: string, options?: {
|
|
93
|
+
name?: string;
|
|
94
|
+
}): Proposal;
|
|
95
|
+
export declare function runWorkspaceInit(ctx: CommandContext): Promise<number>;
|
|
96
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/workspace/init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAYtD,OAAO,EAAmC,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAsB7E,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B;AAED,mEAAmE;AACnE,MAAM,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,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,QAAQ,CAsFxF;AA4ED,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAkE3E"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A small JSON reader that keeps positions, for the workspace declaration
|
|
3
|
+
* (#2534). `chant.workspace.json` is strict JSON; `chant.workspace.jsonc` also
|
|
4
|
+
* allows `//` and `/* *\/` comments and trailing commas.
|
|
5
|
+
*
|
|
6
|
+
* `JSON.parse` would do for the strict file, but it reports neither a line
|
|
7
|
+
* nor a column in every runtime, it accepts duplicate keys by keeping the last
|
|
8
|
+
* one, and it can't say where a value sits once parsed. A schema error has to
|
|
9
|
+
* name the line it comes from, so this reader records where each value and
|
|
10
|
+
* each key starts, by JSON Pointer.
|
|
11
|
+
*/
|
|
12
|
+
export interface TextLocation {
|
|
13
|
+
/** 1-based. */
|
|
14
|
+
line: number;
|
|
15
|
+
/** 1-based, counted in UTF-16 code units. */
|
|
16
|
+
column: number;
|
|
17
|
+
}
|
|
18
|
+
export interface JsonParseOptions {
|
|
19
|
+
/** Allow comments and trailing commas (`.jsonc`). */
|
|
20
|
+
jsonc: boolean;
|
|
21
|
+
}
|
|
22
|
+
export type JsonParseResult = {
|
|
23
|
+
ok: true;
|
|
24
|
+
value: unknown;
|
|
25
|
+
/**
|
|
26
|
+
* Where the value at `pointer` starts, or where its key starts when
|
|
27
|
+
* `key` is set. Falls back to the nearest ancestor that has a position.
|
|
28
|
+
*/
|
|
29
|
+
locate(pointer: string, key?: boolean): TextLocation;
|
|
30
|
+
} | {
|
|
31
|
+
ok: false;
|
|
32
|
+
message: string;
|
|
33
|
+
location: TextLocation;
|
|
34
|
+
};
|
|
35
|
+
/** Escape one reference token for a JSON Pointer (RFC 6901). */
|
|
36
|
+
export declare function pointerToken(token: string | number): string;
|
|
37
|
+
export declare function parseJsonText(text: string, options: JsonParseOptions): JsonParseResult;
|
|
38
|
+
//# sourceMappingURL=jsonc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonc.d.ts","sourceRoot":"","sources":["../../src/workspace/jsonc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,YAAY;IAC3B,eAAe;IACf,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,MAAM,eAAe,GACvB;IACE,EAAE,EAAE,IAAI,CAAC;IACT,KAAK,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;CACtD,GACD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,YAAY,CAAA;CAAE,CAAC;AAW3D,gEAAgE;AAChE,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,eAAe,CAoLtF"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Member kinds (#2524 D3, #2535; ws-031 for the plugin shape, ws-051 for
|
|
3
|
+
* `examples`).
|
|
4
|
+
*
|
|
5
|
+
* A kind is data: a name, a precedence and a probe that says what its
|
|
6
|
+
* directory holds. Probes run no code (K3). Four kinds are built in: the
|
|
7
|
+
* member kinds `chant`, `workspace` and `other`, and the group kind
|
|
8
|
+
* `examples`. Every other kind comes from a pinned package, which publishes
|
|
9
|
+
* its kinds as a JSON file at a `./workspace-kinds` subpath, the way a
|
|
10
|
+
* lexicon publishes a slim `./detect` entry (#426). chant finds that file
|
|
11
|
+
* through the package's `package.json` and reads it with the file system, so
|
|
12
|
+
* reading kinds never imports the package and never loads a lexicon.
|
|
13
|
+
*
|
|
14
|
+
* The vocabulary is closed: a member whose kind no registry knows fails
|
|
15
|
+
* closed, and the message lists the known kinds. When the probes of several
|
|
16
|
+
* kinds claim one directory, the highest precedence decides, and a tie
|
|
17
|
+
* fails ({@link resolveKind}).
|
|
18
|
+
*/
|
|
19
|
+
import type { WorkspaceTree } from "./tree.js";
|
|
20
|
+
export declare const KINDS_SCHEMA_ID: string;
|
|
21
|
+
/** The subpath a package publishes its kinds at. */
|
|
22
|
+
export declare const KINDS_SUBPATH = "./workspace-kinds";
|
|
23
|
+
/**
|
|
24
|
+
* The probe a package's kind carries (#2535, #2545). It passes when any of
|
|
25
|
+
* its clauses does. A name in either clause may use `*`, which matches any
|
|
26
|
+
* run of characters in one file name, so `*.tf` is every Terraform file.
|
|
27
|
+
*/
|
|
28
|
+
export interface FileProbe {
|
|
29
|
+
/** A file matching one of these names sits directly in the directory. */
|
|
30
|
+
anyFile?: string[];
|
|
31
|
+
/**
|
|
32
|
+
* A file directly in the directory whose name matches one of `in` has a
|
|
33
|
+
* line that opens an unlabelled block named in `blocks`: leading space,
|
|
34
|
+
* the name, optional space, then `{`. This is how a choudoufu root's
|
|
35
|
+
* `live {` block is found without parsing HCL (#2545).
|
|
36
|
+
*/
|
|
37
|
+
anyBlock?: {
|
|
38
|
+
in: string[];
|
|
39
|
+
blocks: string[];
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/** What a kind's probe checks in a directory. */
|
|
43
|
+
export type KindProbe =
|
|
44
|
+
/** Files, or blocks in files, sit directly in the directory. */
|
|
45
|
+
FileProbe
|
|
46
|
+
/** The directory exists; nothing else is checked (`other`). */
|
|
47
|
+
| {
|
|
48
|
+
directory: true;
|
|
49
|
+
}
|
|
50
|
+
/** The directory holds a chant project, as {@link holdsChantProject} says (`examples`). */
|
|
51
|
+
| {
|
|
52
|
+
chantProject: true;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Which outputs a member of a kind exposes as link targets (#2524 D6,
|
|
56
|
+
* #2539). A member link may only name an output its producer exposes.
|
|
57
|
+
*/
|
|
58
|
+
export type KindOutputs =
|
|
59
|
+
/** The chant project's own outputs, read from its source without running it (`chant`). */
|
|
60
|
+
{
|
|
61
|
+
from: "chant-source";
|
|
62
|
+
}
|
|
63
|
+
/** None: the member is opaque to links (`workspace`, and the group kind `examples`). */
|
|
64
|
+
| {
|
|
65
|
+
from: "none";
|
|
66
|
+
}
|
|
67
|
+
/** The names listed here, plus any the member entry lists in `outputs` (`other`, and kinds from a package). */
|
|
68
|
+
| {
|
|
69
|
+
from: "declared";
|
|
70
|
+
names: string[];
|
|
71
|
+
};
|
|
72
|
+
export interface MemberKind {
|
|
73
|
+
name: string;
|
|
74
|
+
/** One line for listings and error messages. */
|
|
75
|
+
description: string;
|
|
76
|
+
probe: KindProbe;
|
|
77
|
+
/**
|
|
78
|
+
* When several kinds' probes claim one directory, the highest precedence
|
|
79
|
+
* decides; equal highest precedences are a tie, and a tie fails. `other`
|
|
80
|
+
* and `examples` are never claimants.
|
|
81
|
+
*/
|
|
82
|
+
precedence: number;
|
|
83
|
+
/** A member kind, or the kind of an example group (ws-051). */
|
|
84
|
+
shape: "member" | "group";
|
|
85
|
+
/** The outputs a member of this kind exposes as link targets (#2539). */
|
|
86
|
+
outputs: KindOutputs;
|
|
87
|
+
/** Where the kind comes from: `builtin`, or the package that supplies it. */
|
|
88
|
+
source: string;
|
|
89
|
+
}
|
|
90
|
+
export interface KindRegistry {
|
|
91
|
+
get(name: string): MemberKind | undefined;
|
|
92
|
+
/** Every member kind's name, sorted, for "unknown kind" messages. */
|
|
93
|
+
names(): string[];
|
|
94
|
+
/** Every kind, group kinds included, in registration order. */
|
|
95
|
+
all(): MemberKind[];
|
|
96
|
+
}
|
|
97
|
+
/** The group kind (ws-051). An entry of this kind is a group, not a member. */
|
|
98
|
+
export declare const EXAMPLES_KIND = "examples";
|
|
99
|
+
export declare const BUILTIN_KINDS: readonly MemberKind[];
|
|
100
|
+
export declare const BUILTIN_KIND_NAMES: readonly string[];
|
|
101
|
+
/** A registry holding the built-in kinds and then `extra`, which must not repeat a name. */
|
|
102
|
+
export declare function createKindRegistry(extra?: readonly MemberKind[]): KindRegistry;
|
|
103
|
+
export declare function builtinKindRegistry(): KindRegistry;
|
|
104
|
+
/** Whether `dir` (tree-relative) passes `kind`'s probe. The directory is known to exist. */
|
|
105
|
+
export declare function probeKind(kind: MemberKind, tree: WorkspaceTree, dir: string): boolean;
|
|
106
|
+
export interface KindResolution {
|
|
107
|
+
/** Every member kind whose probe claims the directory, highest precedence first. */
|
|
108
|
+
claims: MemberKind[];
|
|
109
|
+
/** The kind the precedence order picks, when exactly one has the highest precedence. */
|
|
110
|
+
winner: MemberKind | undefined;
|
|
111
|
+
/** The kinds sharing the highest precedence, when there are two or more. A tie fails. */
|
|
112
|
+
tie: MemberKind[];
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Which kind's probe claims `dir` (tree-relative). Only member kinds whose
|
|
116
|
+
* probe looks at the directory take part: `other` claims every directory and
|
|
117
|
+
* so claims none, and `examples` is a group kind. `exclude` leaves kinds out,
|
|
118
|
+
* such as `workspace` for the root member, whose directory holds the
|
|
119
|
+
* workspace's own declaration.
|
|
120
|
+
*/
|
|
121
|
+
export declare function resolveKind(kinds: KindRegistry, tree: WorkspaceTree, dir: string, exclude?: readonly string[]): KindResolution;
|
|
122
|
+
/**
|
|
123
|
+
* Whether directory `dir` holds a chant project, for an example group's
|
|
124
|
+
* matches (ws-051). That is true when a chant config sits in it or up to four
|
|
125
|
+
* levels below it (many examples keep theirs in `src/`), or when its own
|
|
126
|
+
* `package.json` depends on `@intentius/chant` or a chant lexicon, which is
|
|
127
|
+
* how an example with no config names its lexicon.
|
|
128
|
+
*/
|
|
129
|
+
export declare function holdsChantProject(tree: WorkspaceTree, dir: string): boolean;
|
|
130
|
+
export interface KindData {
|
|
131
|
+
kinds: MemberKind[];
|
|
132
|
+
/** Why the data can't be used, one line each. Empty when it can. */
|
|
133
|
+
problems: string[];
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Check the text of a kinds file against `workspace-kinds.schema.json` and
|
|
137
|
+
* the rules the schema can't say: no built-in name, and no name twice.
|
|
138
|
+
* `source` names the package in the kinds and in the messages.
|
|
139
|
+
*/
|
|
140
|
+
export declare function parseKindData(text: string, source: string): KindData;
|
|
141
|
+
export interface PackageKinds extends KindData {
|
|
142
|
+
/** The kinds file, absolute, or undefined when the package publishes none. */
|
|
143
|
+
file: string | undefined;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Where a package's `exports` send `./workspace-kinds`, or undefined when
|
|
147
|
+
* the package doesn't export that subpath. Only the literal key counts: a
|
|
148
|
+
* `./*` pattern maps the subpath to code, which chant never runs for kinds.
|
|
149
|
+
*/
|
|
150
|
+
export declare function kindsExportTarget(pkg: Record<string, unknown>): string | undefined | {
|
|
151
|
+
problem: string;
|
|
152
|
+
};
|
|
153
|
+
/** Read the kinds a package directory publishes. Reads files only; imports nothing. */
|
|
154
|
+
export declare function readPackageKinds(packageDir: string, source?: string): PackageKinds;
|
|
155
|
+
/**
|
|
156
|
+
* The directory of an installed package `name`, found the way Node finds a
|
|
157
|
+
* bare import: `node_modules/<name>` in `fromDir` and each directory above it.
|
|
158
|
+
* It looks for the directory, not for an entry point, so it works for a
|
|
159
|
+
* package whose `exports` don't expose `package.json`.
|
|
160
|
+
*/
|
|
161
|
+
export declare function findInstalledPackage(name: string, fromDir: string): string | undefined;
|
|
162
|
+
export interface PinLike {
|
|
163
|
+
package: string | null;
|
|
164
|
+
version: string | null;
|
|
165
|
+
path: string | null;
|
|
166
|
+
}
|
|
167
|
+
export interface KindLoadProblem {
|
|
168
|
+
/** The pin's index in the declaration's `pins`. */
|
|
169
|
+
pin: number;
|
|
170
|
+
message: string;
|
|
171
|
+
}
|
|
172
|
+
export interface LoadedKinds {
|
|
173
|
+
registry: KindRegistry;
|
|
174
|
+
problems: KindLoadProblem[];
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Build the registry for a workspace: the built-in kinds plus the kinds
|
|
178
|
+
* every pin publishes. `workspaceRoot` is the absolute workspace root; a
|
|
179
|
+
* package pin is looked up from there, and a path pin is relative to it.
|
|
180
|
+
* An installed version that differs from the pin, a kinds file that doesn't
|
|
181
|
+
* validate, and a kind name two packages both supply are problems; the kinds
|
|
182
|
+
* involved are left out, so members of those kinds read as unknown.
|
|
183
|
+
* Never throws.
|
|
184
|
+
*/
|
|
185
|
+
export declare function loadKindRegistry(pins: readonly PinLike[], workspaceRoot: string): LoadedKinds;
|
|
186
|
+
/**
|
|
187
|
+
* Whether `file` (absolute, inside `packageDir`) is published, as far as the
|
|
188
|
+
* package's `files` list says. A package with no `files` list publishes
|
|
189
|
+
* everything npm doesn't ignore by default.
|
|
190
|
+
*/
|
|
191
|
+
export declare function kindsFileShips(packageDir: string, file: string): boolean;
|
|
192
|
+
//# sourceMappingURL=kinds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../../src/workspace/kinds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAG5C,eAAO,MAAM,eAAe,QAAa,CAAC;AAE1C,oDAAoD;AACpD,eAAO,MAAM,aAAa,sBAAsB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,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MAAM,GAAG,YAAY,CAwBlF;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUtF;AAED,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,mDAAmD;IACnD,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,EAAE,aAAa,EAAE,MAAM,GAAG,WAAW,CA8C7F;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAcxE"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant workspace check [--at <rev>] [--json] [--format stylish|json|sarif] [--generated]`:
|
|
3
|
+
* the lineage checks (#2550, D9), and the declaration checks (#2535, D16)
|
|
4
|
+
* when a declaration sits between the current directory and the git root.
|
|
5
|
+
*
|
|
6
|
+
* D9 says open manual steps fail `check`. So far, `check` checks the
|
|
7
|
+
* lineage lock only: the lock must be readable, and no scope may have an open
|
|
8
|
+
* manual step. It needs no `chant.workspace.json`, the way `chant workspace
|
|
9
|
+
* lineage` needs none, and a directory without a lock passes with nothing to
|
|
10
|
+
* check. The declaration checks report `WSP` findings through lint's
|
|
11
|
+
* reporters (`./checks.ts`), and cover member ledgers (#2538), recorded
|
|
12
|
+
* pipelines (#2542) and generated files (#2541) as well as the declaration
|
|
13
|
+
* itself (#2641). `--generated` runs each declared generator too.
|
|
14
|
+
*
|
|
15
|
+
* `chant workspace upgrade` runs the same checks in its staging worktree
|
|
16
|
+
* before it reaches its gate.
|
|
17
|
+
*/
|
|
18
|
+
import type { CommandContext } from "../cli/registry.js";
|
|
19
|
+
import type { DeclarationCheckReport } from "./checks.js";
|
|
20
|
+
/** Closed: a reader may switch on it. */
|
|
21
|
+
export declare const CHECK_CODES: readonly ["lock-invalid", "manual-step-open"];
|
|
22
|
+
export type CheckCode = (typeof CHECK_CODES)[number];
|
|
23
|
+
export interface CheckFinding {
|
|
24
|
+
code: CheckCode;
|
|
25
|
+
/** The scope the finding is in, or null for the lock as a whole. */
|
|
26
|
+
scope: string | null;
|
|
27
|
+
/** The file, relative to the lock's directory, when the finding is about one. */
|
|
28
|
+
path?: string;
|
|
29
|
+
message: string;
|
|
30
|
+
}
|
|
31
|
+
export interface CheckReport {
|
|
32
|
+
lock: string | null;
|
|
33
|
+
ok: boolean;
|
|
34
|
+
findings: CheckFinding[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Run the lineage checks over the lock at `root`. Never throws a
|
|
38
|
+
* {@link LockError}. `lockText` is the lock's text when it comes from
|
|
39
|
+
* somewhere other than the disk, such as a revision (`--at`), with null
|
|
40
|
+
* for no lock.
|
|
41
|
+
*/
|
|
42
|
+
export declare function checkLineage(root: string, lockText?: string | null): CheckReport;
|
|
43
|
+
/** A finding's identity, for comparing two reports. */
|
|
44
|
+
export declare function findingKey(f: CheckFinding): string;
|
|
45
|
+
/** The version of the `check` document this chant writes. */
|
|
46
|
+
export declare const CHECK_CONTRACT_VERSION = 1;
|
|
47
|
+
/** `$id` of the JSON Schema for the `--format json` output, shipped beside this file. */
|
|
48
|
+
export declare const CHECK_OUTPUT_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/check/v1/check.schema.json";
|
|
49
|
+
/** Why `check` could not run at all: only the `--at` codes. A declaration that can't be read is a WSP001 finding instead. */
|
|
50
|
+
export declare const CHECK_ERROR_CODES: readonly ["not-a-git-repository", "revision-unknown"];
|
|
51
|
+
export type CheckErrorCode = (typeof CHECK_ERROR_CODES)[number];
|
|
52
|
+
/** What `check --format json` prints (#2536). `check.schema.json` describes it. */
|
|
53
|
+
export type CheckDocument = (CheckReport & {
|
|
54
|
+
$schema: string;
|
|
55
|
+
contract: number;
|
|
56
|
+
chant: string;
|
|
57
|
+
at: string | null;
|
|
58
|
+
/** The declaration's workspace, or null when there is none; `name` is null when it can't be read. */
|
|
59
|
+
workspace: {
|
|
60
|
+
name: string | null;
|
|
61
|
+
root: string;
|
|
62
|
+
} | null;
|
|
63
|
+
declaration?: DeclarationCheckReport;
|
|
64
|
+
}) | {
|
|
65
|
+
$schema: string;
|
|
66
|
+
contract: number;
|
|
67
|
+
chant: string;
|
|
68
|
+
error: {
|
|
69
|
+
code: CheckErrorCode;
|
|
70
|
+
message: string;
|
|
71
|
+
location: null;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Run every check from `cwd`, in the working tree or at revision `at`, and
|
|
76
|
+
* build the document the JSON formats print. Paths in findings are relative
|
|
77
|
+
* to `cwd`. `runGenerators` is `--generated`; with `at` it does nothing,
|
|
78
|
+
* since the member facts describe the working tree, not the revision.
|
|
79
|
+
*/
|
|
80
|
+
export declare function runChecks(cwd: string, at?: string, options?: {
|
|
81
|
+
runGenerators?: boolean;
|
|
82
|
+
}): Promise<CheckDocument>;
|
|
83
|
+
export declare function runWorkspaceCheck(ctx: CommandContext): Promise<number>;
|
|
84
|
+
//# sourceMappingURL=lineage-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineage-check.d.ts","sourceRoot":"","sources":["../../src/workspace/lineage-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,KA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AC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACxD,WAAW,CAAC,EAAE,sBAAsB,CAAC;CACtC,CAAC,GACF;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE;QAAE,IAAI,EAAE,cAAc,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE,CAAA;CAAE,CAAC;AAE3H;;;;;GAKG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAwD3H;AAED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA6D5E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant workspace lineage [--json]` and
|
|
3
|
+
* `chant workspace lineage resolve <path>` (#2540).
|
|
4
|
+
*
|
|
5
|
+
* The first shows each scope in `.chant/workspace.lock.json`: where it came
|
|
6
|
+
* from, which files the project has edited since, and which manual steps are
|
|
7
|
+
* open. The second closes a manual step once the file has been merged by
|
|
8
|
+
* hand. Neither needs a `chant.workspace.json`: lineage works for a plain
|
|
9
|
+
* project (#2525 rule 4).
|
|
10
|
+
*/
|
|
11
|
+
import type { CommandContext } from "../cli/registry.js";
|
|
12
|
+
import { type ManualStep } from "./lineage-lock.js";
|
|
13
|
+
export interface LineageScopeView {
|
|
14
|
+
scope: string;
|
|
15
|
+
kind: "template" | "vendor";
|
|
16
|
+
name?: string;
|
|
17
|
+
template: string;
|
|
18
|
+
ref?: string;
|
|
19
|
+
address: Record<string, unknown> | null;
|
|
20
|
+
files: number;
|
|
21
|
+
edited: string[];
|
|
22
|
+
missing: string[];
|
|
23
|
+
manualSteps: ManualStep[];
|
|
24
|
+
}
|
|
25
|
+
/** The lock as `--json` prints it: one view per scope, with its state in the tree. */
|
|
26
|
+
export declare function lineageView(root: string): {
|
|
27
|
+
lock: string;
|
|
28
|
+
scopes: LineageScopeView[];
|
|
29
|
+
} | null;
|
|
30
|
+
export declare function runWorkspaceLineage(ctx: CommandContext): Promise<number>;
|
|
31
|
+
//# sourceMappingURL=lineage-cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineage-cli.d.ts","sourceRoot":"","sources":["../../src/workspace/lineage-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAA6E,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI5H,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,GAAG,QAAQ,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AAED,sFAAsF;AACtF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,gBAAgB,EAAE,CAAA;CAAE,GAAG,IAAI,CAmB7F;AAED,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAmC9E"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The lineage lock at init (#2540, ws-047): `chant init --from <repo>@<ref>`
|
|
3
|
+
* and `chant init --template <name>` both leave `.chant/workspace.lock.json`
|
|
4
|
+
* with one lineage, scope `"."`, so a project made from a template can be
|
|
5
|
+
* upgraded later without first running adopt-lineage.
|
|
6
|
+
*
|
|
7
|
+
* `--from` fetches with `git`: the one network step, listed in the egress
|
|
8
|
+
* catalogue (`test/egress-catalogue.ts`). The commit and the tree of the
|
|
9
|
+
* chosen directory become the content address.
|
|
10
|
+
*
|
|
11
|
+
* Plain `chant init` without `--template` writes no lock. That keeps the
|
|
12
|
+
* output of an existing command unchanged (#2525 rule 2), and this module
|
|
13
|
+
* never loads for it.
|
|
14
|
+
*/
|
|
15
|
+
export interface TemplateSpec {
|
|
16
|
+
/** The repository as written. */
|
|
17
|
+
repo: string;
|
|
18
|
+
/** What `git fetch` is given: a URL, or an absolute local path. */
|
|
19
|
+
url: string;
|
|
20
|
+
ref: string;
|
|
21
|
+
/** The directory inside the repository to instantiate (`#<member>`). */
|
|
22
|
+
member?: string;
|
|
23
|
+
/** Stable identity: `<host>/<path>` for a remote, the path as written for a local repo, plus `#<member>`. */
|
|
24
|
+
id: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Parse `<repo>@<ref>[#<member>]`. `<repo>` is a git URL, an scp-style
|
|
28
|
+
* `git@host:path`, a local path, or `owner/name` for a GitHub repository.
|
|
29
|
+
*/
|
|
30
|
+
export declare function parseTemplateSpec(spec: string, cwd?: string): TemplateSpec;
|
|
31
|
+
export interface FetchedTemplate {
|
|
32
|
+
commit: string;
|
|
33
|
+
tree: string;
|
|
34
|
+
/** Files under the chosen directory, relative to it. */
|
|
35
|
+
files: Map<string, {
|
|
36
|
+
data: Buffer;
|
|
37
|
+
executable: boolean;
|
|
38
|
+
}>;
|
|
39
|
+
/** Paths that were not copied, with the reason. */
|
|
40
|
+
skipped: Array<{
|
|
41
|
+
path: string;
|
|
42
|
+
reason: string;
|
|
43
|
+
}>;
|
|
44
|
+
}
|
|
45
|
+
export declare function git(cwd: string, args: string[]): string;
|
|
46
|
+
/**
|
|
47
|
+
* Read the files of `member` (or the whole tree) at `commit` from a scratch
|
|
48
|
+
* repository that already holds the commit. Symbolic links, submodules and
|
|
49
|
+
* the template's own lineage lock are skipped, with the reason.
|
|
50
|
+
*/
|
|
51
|
+
export declare function readTemplateTree(scratch: string, commit: string, member: string | undefined, label: string): {
|
|
52
|
+
tree: string;
|
|
53
|
+
files: FetchedTemplate["files"];
|
|
54
|
+
skipped: FetchedTemplate["skipped"];
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Fetch one commit of the template repository into a scratch repository and
|
|
58
|
+
* read the files of the chosen directory from it. The template's own lock is
|
|
59
|
+
* never copied: it describes the template's lineage, not the new project's.
|
|
60
|
+
*/
|
|
61
|
+
export declare function fetchTemplate(spec: TemplateSpec): FetchedTemplate;
|
|
62
|
+
export interface InitFromOptions {
|
|
63
|
+
from: string;
|
|
64
|
+
/** Target directory (defaults to cwd). */
|
|
65
|
+
path?: string;
|
|
66
|
+
force?: boolean;
|
|
67
|
+
/** `--param name=value` values, parsed. Checked against the template's `chant.template.json` (#2627). */
|
|
68
|
+
params?: Record<string, string>;
|
|
69
|
+
}
|
|
70
|
+
export interface InitFromResult {
|
|
71
|
+
success: boolean;
|
|
72
|
+
createdFiles: string[];
|
|
73
|
+
warnings: string[];
|
|
74
|
+
error?: string;
|
|
75
|
+
spec?: TemplateSpec;
|
|
76
|
+
commit?: string;
|
|
77
|
+
/** The parameter values used, recorded in the lock. */
|
|
78
|
+
parameters?: Record<string, string>;
|
|
79
|
+
}
|
|
80
|
+
/** `chant init --from <repo>@<ref>[#<member>] [path]`. */
|
|
81
|
+
export declare function initFromCommand(options: InitFromOptions): Promise<InitFromResult>;
|
|
82
|
+
export interface TemplateLockInput {
|
|
83
|
+
targetDir: string;
|
|
84
|
+
lexicon: string;
|
|
85
|
+
template: string;
|
|
86
|
+
/** Files init wrote, relative to `targetDir`. */
|
|
87
|
+
createdFiles: string[];
|
|
88
|
+
chantVersion: string;
|
|
89
|
+
/** Set when the project's config declares the lexicon by path (#2520): the path, recorded instead of a package. */
|
|
90
|
+
lexiconModule?: string;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Record the lineage of a `chant init --template` project. Only files init
|
|
94
|
+
* actually wrote are listed; a file that already existed was not made from
|
|
95
|
+
* the template. `.chant/types/` is gitignored and left out (D14).
|
|
96
|
+
*
|
|
97
|
+
* Returns the lock's path relative to `targetDir`, or null when the target
|
|
98
|
+
* already has a lock (init never overwrites a lineage).
|
|
99
|
+
*/
|
|
100
|
+
export declare function writeTemplateLock(input: TemplateLockInput): string | null;
|
|
101
|
+
//# sourceMappingURL=lineage-init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineage-init.d.ts","sourceRoot":"","sources":["../../src/workspace/lineage-init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAuBH,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6GAA6G;IAC7G,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,MAAsB,GAAG,YAAY,CAwCzF;AAID,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC1D,mDAAmD;I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