@intentius/chant 0.124.13 → 0.124.14
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/bin/chant +11 -0
- package/dist/agents/checks.js +326 -0
- package/dist/agents/discover.js +885 -0
- package/dist/agents/importer.js +17 -0
- package/dist/agents/index.js +12 -0
- package/dist/agents/types.js +19 -0
- package/dist/apply.js +151 -0
- package/dist/attrref.js +70 -0
- package/dist/audit/catalog.js +350 -0
- package/dist/audit/core.js +252 -0
- package/dist/audit/discover.js +633 -0
- package/dist/audit/fetch.js +666 -0
- package/dist/audit/lineage.js +91 -0
- package/dist/audit/nginx.js +366 -0
- package/dist/audit/prior-art.js +132 -0
- package/dist/audit/proof.js +321 -0
- package/dist/audit/report-html.js +194 -0
- package/dist/audit/report-model.js +198 -0
- package/dist/audit/report.js +102 -0
- package/dist/audit/rules-doc.js +144 -0
- package/dist/audit/secrets.js +405 -0
- package/dist/audit/terraform-state.js +140 -0
- package/dist/audit/wrangler.js +262 -0
- package/dist/behaviour-delta.js +401 -0
- package/dist/behaviour-engine.js +357 -0
- package/dist/behaviour-graph.js +83 -0
- package/dist/behaviour-http.js +188 -0
- package/dist/behaviour-kinds.js +172 -0
- package/dist/behaviour-overlay.js +50 -0
- package/dist/behaviour-predict.js +188 -0
- package/dist/behaviour-request.js +194 -0
- package/dist/behaviour.js +1325 -0
- package/dist/build-params.js +108 -0
- package/dist/build.js +668 -0
- package/dist/builder.js +44 -0
- package/dist/cdk/advise.js +30 -0
- package/dist/cdk/assembly.js +122 -0
- package/dist/cdk/graph.js +444 -0
- package/dist/cdk/tier-map.js +64 -0
- package/dist/cdk/types.js +24 -0
- package/dist/change-set.js +312 -0
- package/dist/child-project.js +21 -0
- package/dist/claimed-fields.js +135 -0
- package/dist/cli/build-options.js +70 -0
- package/dist/cli/build-params-cli.js +139 -0
- package/dist/cli/command-group.js +123 -0
- package/dist/cli/commands/audit-agents.js +326 -0
- package/dist/cli/commands/audit.js +571 -0
- package/dist/cli/commands/build.js +920 -0
- package/dist/cli/commands/carve-apply.js +153 -0
- package/dist/cli/commands/carve-bridge.js +201 -0
- package/dist/cli/commands/carve-emit.js +332 -0
- package/dist/cli/commands/carve-status.js +119 -0
- package/dist/cli/commands/carve.js +204 -0
- package/dist/cli/commands/check-lexicon-docs.js +79 -0
- package/dist/cli/commands/check-lexicon-examples.js +177 -0
- package/dist/cli/commands/check-lexicon-intrinsics.js +291 -0
- package/dist/cli/commands/check-lexicon-mcp.js +82 -0
- package/dist/cli/commands/check-lexicon-plugin.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon-plugin.js +104 -0
- package/dist/cli/commands/check-lexicon.js +766 -0
- package/dist/cli/commands/describe.js +85 -0
- package/dist/cli/commands/diff.js +175 -0
- package/dist/cli/commands/doctor.js +350 -0
- package/dist/cli/commands/import-agents.js +155 -0
- package/dist/cli/commands/import.js +670 -0
- package/dist/cli/commands/init-lexicon/templates/codegen.js +194 -0
- package/dist/cli/commands/init-lexicon/templates/docs.js +100 -0
- package/dist/cli/commands/init-lexicon/templates/examples.js +29 -0
- package/dist/cli/commands/init-lexicon/templates/lint.js +34 -0
- package/dist/cli/commands/init-lexicon/templates/lsp.js +37 -0
- package/dist/cli/commands/init-lexicon/templates/plugin.js +108 -0
- package/dist/cli/commands/init-lexicon/templates/project.js +240 -0
- package/dist/cli/commands/init-lexicon/templates/spec.js +56 -0
- package/dist/cli/commands/init-lexicon/templates/tests.js +66 -0
- package/dist/cli/commands/init-lexicon.js +172 -0
- package/dist/cli/commands/init.js +381 -0
- package/dist/cli/commands/lexicon-rolling-upgrade.js +145 -0
- package/dist/cli/commands/lexicon-surface-diff.js +145 -0
- package/dist/cli/commands/licenses.js +125 -0
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/lint.js +948 -0
- package/dist/cli/commands/list.js +63 -0
- package/dist/cli/commands/migrate.d.ts.map +1 -1
- package/dist/cli/commands/migrate.js +423 -0
- package/dist/cli/commands/onboard.js +403 -0
- package/dist/cli/commands/pinned-upgrade.js +191 -0
- package/dist/cli/commands/update.js +194 -0
- package/dist/cli/commands/vendor.js +217 -0
- package/dist/cli/conflict-check.js +104 -0
- package/dist/cli/debug.js +8 -0
- package/dist/cli/format.js +104 -0
- package/dist/cli/handlers/build.js +267 -0
- package/dist/cli/handlers/carve-apply.js +30 -0
- package/dist/cli/handlers/carve-bridge.js +28 -0
- package/dist/cli/handlers/carve-emit.js +50 -0
- package/dist/cli/handlers/carve-status.js +26 -0
- package/dist/cli/handlers/carve.js +40 -0
- package/dist/cli/handlers/change-set.js +46 -0
- package/dist/cli/handlers/components.js +730 -0
- package/dist/cli/handlers/dev.js +113 -0
- package/dist/cli/handlers/emulator.js +233 -0
- package/dist/cli/handlers/explain.js +54 -0
- package/dist/cli/handlers/fan-out.js +422 -0
- package/dist/cli/handlers/gate-resume.js +275 -0
- package/dist/cli/handlers/generate.js +84 -0
- package/dist/cli/handlers/graph.js +969 -0
- package/dist/cli/handlers/init.js +102 -0
- package/dist/cli/handlers/lifecycle.js +1727 -0
- package/dist/cli/handlers/lint.js +62 -0
- package/dist/cli/handlers/migrate.js +48 -0
- package/dist/cli/handlers/misc.js +391 -0
- package/dist/cli/handlers/operator.js +1162 -0
- package/dist/cli/handlers/override-approve.js +102 -0
- package/dist/cli/handlers/pr.js +503 -0
- package/dist/cli/handlers/promote.js +342 -0
- package/dist/cli/handlers/run-generate.js +206 -0
- package/dist/cli/handlers/run-wave.js +66 -0
- package/dist/cli/handlers/run.js +1191 -0
- package/dist/cli/handlers/scenario.js +325 -0
- package/dist/cli/handlers/search.js +924 -0
- package/dist/cli/handlers/serve.js +32 -0
- package/dist/cli/handlers/vendor.js +154 -0
- package/dist/cli/index.js +3 -0
- package/dist/cli/is-entry-point.js +23 -0
- package/dist/cli/lsp/capabilities.js +28 -0
- package/dist/cli/lsp/diagnostics.js +34 -0
- package/dist/cli/lsp/server.js +329 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +2540 -0
- package/dist/cli/mcp/lifecycle-tools.js +80 -0
- package/dist/cli/mcp/op-tools.js +306 -0
- package/dist/cli/mcp/resource-handlers.js +258 -0
- package/dist/cli/mcp/resources/context.js +85 -0
- package/dist/cli/mcp/server.js +353 -0
- package/dist/cli/mcp/tools/build.js +111 -0
- package/dist/cli/mcp/tools/composites.js +95 -0
- package/dist/cli/mcp/tools/explain.js +166 -0
- package/dist/cli/mcp/tools/import.js +49 -0
- package/dist/cli/mcp/tools/lint.js +41 -0
- package/dist/cli/mcp/tools/scaffold.js +111 -0
- package/dist/cli/mcp/tools/search.js +112 -0
- package/dist/cli/mcp/types.js +1 -0
- package/dist/cli/mcp/workspace-plugins.js +91 -0
- package/dist/cli/mcp/workspace-tools.d.ts +1 -1
- package/dist/cli/mcp/workspace-tools.js +564 -0
- package/dist/cli/mcp-config.js +70 -0
- package/dist/cli/plugins.js +313 -0
- package/dist/cli/registry.js +23 -0
- package/dist/cli/reporters/stylish.js +329 -0
- package/dist/cli/version.js +15 -0
- package/dist/cli/watch.js +79 -0
- package/dist/codegen/bound-property-types.js +82 -0
- package/dist/codegen/coverage.js +119 -0
- package/dist/codegen/docs-file-markers.js +60 -0
- package/dist/codegen/docs-pages.js +115 -0
- package/dist/codegen/docs-rule-scanning.js +164 -0
- package/dist/codegen/docs-rules.js +76 -0
- package/dist/codegen/docs-sections.js +117 -0
- package/dist/codegen/docs-sidebar.js +65 -0
- package/dist/codegen/docs-types.js +4 -0
- package/dist/codegen/docs.js +356 -0
- package/dist/codegen/fetch.js +340 -0
- package/dist/codegen/generate-post-synth-barrel.js +63 -0
- package/dist/codegen/generate-registry.js +71 -0
- package/dist/codegen/generate-runtime-index.js +56 -0
- package/dist/codegen/generate-typescript.js +119 -0
- package/dist/codegen/generate.js +115 -0
- package/dist/codegen/json-patch.js +141 -0
- package/dist/codegen/json-schema-to-ts.js +344 -0
- package/dist/codegen/json-schema.js +246 -0
- package/dist/codegen/lexicon-regen.js +412 -0
- package/dist/codegen/naming.js +217 -0
- package/dist/codegen/okf-lexicon.js +245 -0
- package/dist/codegen/package.js +150 -0
- package/dist/codegen/pinned-upgrade.d.ts.map +1 -1
- package/dist/codegen/pinned-upgrade.js +494 -0
- package/dist/codegen/registry.js +60 -0
- package/dist/codegen/rehype-base-url.mjs +68 -0
- package/dist/codegen/rolling-upgrade.js +217 -0
- package/dist/codegen/surface-snapshot.js +537 -0
- package/dist/codegen/testdata/postgres-tags.json +242 -0
- package/dist/codegen/topo-sort.js +36 -0
- package/dist/codegen/typecheck.js +115 -0
- package/dist/codegen/validate.js +200 -0
- package/dist/codegen/version-bump.js +35 -0
- package/dist/components/auto-release.js +143 -0
- package/dist/components/builders.js +47 -0
- package/dist/components/capability-plugin-loader.js +175 -0
- package/dist/components/capability-plugin-schema.js +46 -0
- package/dist/components/capability-plugin.js +99 -0
- package/dist/components/capability.js +60 -0
- package/dist/components/changed-files.js +72 -0
- package/dist/components/cli-support.js +427 -0
- package/dist/components/component.js +120 -0
- package/dist/components/component.schema.json +271 -0
- package/dist/components/config-defaults.js +130 -0
- package/dist/components/deploy-units.js +60 -0
- package/dist/components/discover.d.ts.map +1 -1
- package/dist/components/discover.js +189 -0
- package/dist/components/driver-output.js +86 -0
- package/dist/components/driver.js +728 -0
- package/dist/components/fan-out-output.js +165 -0
- package/dist/components/fan-out-record.js +94 -0
- package/dist/components/fan-out-run.js +373 -0
- package/dist/components/fan-out-support.js +60 -0
- package/dist/components/fan-out.js +273 -0
- package/dist/components/gate-plan.js +41 -0
- package/dist/components/gated-wave-pipeline.js +46 -0
- package/dist/components/index.js +24 -0
- package/dist/components/layers.js +28 -0
- package/dist/components/manifest-persistence.js +108 -0
- package/dist/components/pilots/alb-ecs.pilot.js +59 -0
- package/dist/components/pilots/dynamodb.pilot.js +51 -0
- package/dist/components/pilots/jar-emr.pilot.js +65 -0
- package/dist/components/pilots/lambda.pilot.js +52 -0
- package/dist/components/pilots/neo4j-fanout.pilot.js +68 -0
- package/dist/components/pilots/project.js +12 -0
- package/dist/components/pr-pipeline.js +134 -0
- package/dist/components/pr-run.js +363 -0
- package/dist/components/presets/ecs-fargate.js +72 -0
- package/dist/components/presets/index.js +28 -0
- package/dist/components/presets/lambda.js +34 -0
- package/dist/components/presets/single-host-compose.js +41 -0
- package/dist/components/promote.js +549 -0
- package/dist/components/registry.js +34 -0
- package/dist/components/run-progress.js +33 -0
- package/dist/components/sandbox/driver.d.ts.map +1 -1
- package/dist/components/sandbox/driver.js +93 -0
- package/dist/components/sandbox/run.js +115 -0
- package/dist/components/starter-plugin.js +104 -0
- package/dist/components/verbs/__tests__/mock-cloud-executor.js +68 -0
- package/dist/components/verbs/__tests__/mock-process-runner.js +45 -0
- package/dist/components/verbs/__tests__/mock-sbom-generator.js +56 -0
- package/dist/components/verbs/bom-writer.js +287 -0
- package/dist/components/verbs/build-archive.js +188 -0
- package/dist/components/verbs/build.js +142 -0
- package/dist/components/verbs/cloud-executor.js +110 -0
- package/dist/components/verbs/component-bom.js +125 -0
- package/dist/components/verbs/ensure-secret.js +50 -0
- package/dist/components/verbs/index.js +61 -0
- package/dist/components/verbs/license-policy.js +75 -0
- package/dist/components/verbs/lockfile-sbom-generator.js +191 -0
- package/dist/components/verbs/process-runner.js +78 -0
- package/dist/components/verbs/r2-sync.js +93 -0
- package/dist/components/verbs/reproducibility.js +62 -0
- package/dist/components/verbs/run-agent.js +577 -0
- package/dist/components/verbs/sbom-generator.js +119 -0
- package/dist/components/verbs/sbom.js +97 -0
- package/dist/components/verbs/shell.js +32 -0
- package/dist/components/verbs/sign.js +221 -0
- package/dist/components/verbs/stub.js +28 -0
- package/dist/components/verbs/tool-sbom-generator.js +154 -0
- package/dist/components/verbs/verify.js +112 -0
- package/dist/components/verbs/vex.js +131 -0
- package/dist/components/verbs/vuln-gate.js +152 -0
- package/dist/components/verbs/vuln-scan.js +288 -0
- package/dist/components/verbs/wait-verify.js +106 -0
- package/dist/components/verbs/wrangler.js +179 -0
- package/dist/components/wave-plan.js +102 -0
- package/dist/composite.js +305 -0
- package/dist/config-import.d.ts.map +1 -1
- package/dist/config-import.js +22 -0
- package/dist/config-sandbox.js +122 -0
- package/dist/config-static.js +206 -0
- package/dist/config.js +605 -0
- package/dist/content-digest.js +23 -0
- package/dist/declarable.js +114 -0
- package/dist/deep-observation.js +437 -0
- package/dist/detectLexicon.js +54 -0
- package/dist/discovery/cache.js +70 -0
- package/dist/discovery/collect.js +208 -0
- package/dist/discovery/cycles.js +95 -0
- package/dist/discovery/entity-wire-codec.js +391 -0
- package/dist/discovery/entity-wire.js +42 -0
- package/dist/discovery/files.js +121 -0
- package/dist/discovery/fold-import.d.ts.map +1 -1
- package/dist/discovery/fold-import.js +4178 -0
- package/dist/discovery/fold-rank.js +292 -0
- package/dist/discovery/graph.js +115 -0
- package/dist/discovery/import.d.ts.map +1 -1
- package/dist/discovery/import.js +65 -0
- package/dist/discovery/index.js +333 -0
- package/dist/discovery/param-deps.js +487 -0
- package/dist/discovery/resolve.js +39 -0
- package/dist/discovery/sandbox/bundle.js +214 -0
- package/dist/discovery/sandbox/child-errors.js +26 -0
- package/dist/discovery/sandbox/config-run.js +100 -0
- package/dist/discovery/sandbox/config-wire.js +183 -0
- package/dist/discovery/sandbox/driver.d.ts.map +1 -1
- package/dist/discovery/sandbox/driver.js +333 -0
- package/dist/discovery/sandbox/fork.js +229 -0
- package/dist/discovery/sandbox/policy-run.js +142 -0
- package/dist/discovery/sandbox/policy-wire.js +152 -0
- package/dist/discovery/sandbox/run.js +77 -0
- package/dist/discovery/specifier-resolve.js +320 -0
- package/dist/discovery/walk.js +284 -0
- package/dist/effect-receipt.js +340 -0
- package/dist/env.js +55 -0
- package/dist/errors.js +62 -0
- package/dist/fold/fold.js +1434 -0
- package/dist/fold/foldable-helpers.js +229 -0
- package/dist/fold/subset.js +696 -0
- package/dist/fold-provenance.js +414 -0
- package/dist/gate-decision.js +260 -0
- package/dist/gate-resume-run.js +154 -0
- package/dist/gated-waves.js +165 -0
- package/dist/governance.js +43 -0
- package/dist/graph-declared.js +45 -0
- package/dist/graph-detail.js +207 -0
- package/dist/graph-dot.js +54 -0
- package/dist/graph-effective.js +107 -0
- package/dist/graph-ir.js +623 -0
- package/dist/graph-layout.js +184 -0
- package/dist/graph-lens.js +105 -0
- package/dist/graph-mermaid.js +83 -0
- package/dist/graph-ops.js +39 -0
- package/dist/graph-refs.js +156 -0
- package/dist/held-elsewhere.js +87 -0
- package/dist/identity.js +251 -0
- package/dist/import/base-parser.js +34 -0
- package/dist/import/embedded.js +255 -0
- package/dist/import/generator.js +1 -0
- package/dist/import/ir-utils.js +85 -0
- package/dist/import/parser-options.js +45 -0
- package/dist/import/parser.js +1 -0
- package/dist/index.js +118 -0
- package/dist/intrinsic-interpolation.js +73 -0
- package/dist/intrinsic.js +31 -0
- package/dist/join-key.js +35 -0
- package/dist/kubectl-context.js +150 -0
- package/dist/lexicon-config.js +58 -0
- package/dist/lexicon-integrity.js +47 -0
- package/dist/lexicon-manifest.js +70 -0
- package/dist/lexicon-module.d.ts.map +1 -1
- package/dist/lexicon-module.js +241 -0
- package/dist/lexicon-output.js +218 -0
- package/dist/lexicon-plugin-helpers.js +104 -0
- package/dist/lexicon-schema.js +136 -0
- package/dist/lexicon.js +130 -0
- package/dist/lifecycle/affected.js +224 -0
- package/dist/lifecycle/assert-live.js +110 -0
- package/dist/lifecycle/build-ledger-store.js +160 -0
- package/dist/lifecycle/build-ledger.js +155 -0
- package/dist/lifecycle/change-set.js +356 -0
- package/dist/lifecycle/converge-ledger.js +161 -0
- package/dist/lifecycle/deep-diff.js +233 -0
- package/dist/lifecycle/deep-observe.js +147 -0
- package/dist/lifecycle/digest.js +143 -0
- package/dist/lifecycle/disruption.js +135 -0
- package/dist/lifecycle/gate-applied.js +113 -0
- package/dist/lifecycle/gate-audit.js +341 -0
- package/dist/lifecycle/gate-ledger-select.js +89 -0
- package/dist/lifecycle/gate-ledger.js +193 -0
- package/dist/lifecycle/gate-origin.js +117 -0
- package/dist/lifecycle/gate-pending.js +58 -0
- package/dist/lifecycle/git.js +1182 -0
- package/dist/lifecycle/identity.js +58 -0
- package/dist/lifecycle/index.js +26 -0
- package/dist/lifecycle/lease.js +283 -0
- package/dist/lifecycle/ledger-port.js +1 -0
- package/dist/lifecycle/legacy-digest.js +91 -0
- package/dist/lifecycle/live-diff.js +274 -0
- package/dist/lifecycle/local-note.js +15 -0
- package/dist/lifecycle/member-ledger.js +122 -0
- package/dist/lifecycle/observation-baseline.js +155 -0
- package/dist/lifecycle/observe.js +375 -0
- package/dist/lifecycle/oras-referrer-lookup.js +82 -0
- package/dist/lifecycle/override-ledger.js +54 -0
- package/dist/lifecycle/plan-digest.js +110 -0
- package/dist/lifecycle/plan-ledger.js +129 -0
- package/dist/lifecycle/receipt-plan.js +192 -0
- package/dist/lifecycle/release-ledger.js +155 -0
- package/dist/lifecycle/release-read.js +64 -0
- package/dist/lifecycle/replay.js +193 -0
- package/dist/lifecycle/rollback.js +102 -0
- package/dist/lifecycle/run-ledger.js +183 -0
- package/dist/lifecycle/scenario-eval.js +204 -0
- package/dist/lifecycle/scenario.js +214 -0
- package/dist/lifecycle/snapshot.js +239 -0
- package/dist/lifecycle/status.js +447 -0
- package/dist/lifecycle/symptoms.js +117 -0
- package/dist/lifecycle/teardown.js +255 -0
- package/dist/lifecycle/types.js +1 -0
- package/dist/lifecycle/unobserved-gate.js +33 -0
- package/dist/lifecycle/wave-plans.js +68 -0
- package/dist/lifecycle/work-item-id.js +36 -0
- package/dist/lifecycle/work-lease.js +393 -0
- package/dist/lint/component-checks.js +87 -0
- package/dist/lint/config.js +483 -0
- package/dist/lint/declarative.js +122 -0
- package/dist/lint/discover.d.ts.map +1 -1
- package/dist/lint/discover.js +138 -0
- package/dist/lint/engine.js +246 -0
- package/dist/lint/knowledge-checks.js +64 -0
- package/dist/lint/named-checks.js +22 -0
- package/dist/lint/output-checks.js +87 -0
- package/dist/lint/output-docs.js +163 -0
- package/dist/lint/parser.js +33 -0
- package/dist/lint/pipeline-change-gate.js +70 -0
- package/dist/lint/policy-import.d.ts +1 -1
- package/dist/lint/policy-import.d.ts.map +1 -1
- package/dist/lint/policy-import.js +62 -0
- package/dist/lint/policy-sandbox.js +86 -0
- package/dist/lint/policy.js +122 -0
- package/dist/lint/post-synth.js +87 -0
- package/dist/lint/presets/relaxed.json +26 -0
- package/dist/lint/presets/strict.json +24 -24
- package/dist/lint/receipt-checks.js +83 -0
- package/dist/lint/rule-loader.d.ts.map +1 -1
- package/dist/lint/rule-loader.js +89 -0
- package/dist/lint/rule-registry.js +86 -0
- package/dist/lint/rule.js +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-a.component.js +7 -0
- package/dist/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-b.component.js +7 -0
- package/dist/lint/rules/__fixtures__/comp/comp001/fail/orphan-lib.component.js +9 -0
- package/dist/lint/rules/__fixtures__/comp/comp001/pass/emr-job.component.js +11 -0
- package/dist/lint/rules/__fixtures__/comp/comp001/pass/jar-lib.component.js +9 -0
- package/dist/lint/rules/__fixtures__/comp/comp002/fail/search-service.component.js +25 -0
- package/dist/lint/rules/__fixtures__/comp/comp002/pass/jar-lib.component.js +8 -0
- package/dist/lint/rules/__fixtures__/comp/comp002/pass/search-service.component.js +21 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/fail/migrator.component.js +8 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/pass/agent-turn.component.js +24 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/pass/migrator.component.js +17 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/pass/orders-table.component.js +8 -0
- package/dist/lint/rules/__fixtures__/comp/comp004/fail/neo4j-cluster.component.js +18 -0
- package/dist/lint/rules/__fixtures__/comp/comp004/pass/neo4j-cluster.component.js +20 -0
- package/dist/lint/rules/__fixtures__/comp/comp004/pass/orders-table.component.js +8 -0
- package/dist/lint/rules/__fixtures__/comp/comp005/fail/search-service.component.js +12 -0
- package/dist/lint/rules/__fixtures__/comp/comp005/pass/search-service.component.js +16 -0
- package/dist/lint/rules/__fixtures__/comp/comp006/fail/legacy-tool.component.js +8 -0
- package/dist/lint/rules/__fixtures__/comp/comp006/pass/legacy-tool.component.js +12 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/fail/inventory-table.component.js +11 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/fail/orders-table.component.js +11 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/pass/orders-table.component.js +10 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/pass/search-service.component.js +16 -0
- package/dist/lint/rules/comp/comp001-publishes-never-applies.js +69 -0
- package/dist/lint/rules/comp/comp002-dangling-wiring-ref.js +84 -0
- package/dist/lint/rules/comp/comp003-mutating-no-rollback.js +103 -0
- package/dist/lint/rules/comp/comp004-gate-needs-durable-runtime.js +70 -0
- package/dist/lint/rules/comp/comp005-capability-kind-is-noun.js +109 -0
- package/dist/lint/rules/comp/comp006-shell-needs-reason.js +49 -0
- package/dist/lint/rules/comp/comp007-composition-sprawl.js +64 -0
- package/dist/lint/rules/comp/index.js +33 -0
- package/dist/lint/rules/comp/support.js +129 -0
- package/dist/lint/rules/composite-scope.js +51 -0
- package/dist/lint/rules/cor017-composite-name-match.js +93 -0
- package/dist/lint/rules/cor018-composite-prefer-lexicon-type.js +136 -0
- package/dist/lint/rules/cor021-env-literal-name.js +100 -0
- package/dist/lint/rules/cor022-receipt-leaf.js +118 -0
- package/dist/lint/rules/cor024-receipt-secret-pointer.js +199 -0
- package/dist/lint/rules/declarable-naming-convention.js +62 -0
- package/dist/lint/rules/evl001-non-literal-expression.js +66 -0
- package/dist/lint/rules/evl002-control-flow-resource.js +69 -0
- package/dist/lint/rules/evl003-dynamic-property-access.js +44 -0
- package/dist/lint/rules/evl004-spread-non-const.js +94 -0
- package/dist/lint/rules/evl005-resource-block-body.js +41 -0
- package/dist/lint/rules/evl007-invalid-siblings.js +105 -0
- package/dist/lint/rules/evl009-composite-no-constant.js +158 -0
- package/dist/lint/rules/evl010-composite-no-transform.js +59 -0
- package/dist/lint/rules/evl011-symbolic-in-template.js +106 -0
- package/dist/lint/rules/export-required.js +115 -0
- package/dist/lint/rules/file-declarable-limit.js +88 -0
- package/dist/lint/rules/flat-declarations.js +62 -0
- package/dist/lint/rules/index.js +90 -0
- package/dist/lint/rules/no-cyclic-declarable-ref.js +138 -0
- package/dist/lint/rules/no-redundant-type-import.js +76 -0
- package/dist/lint/rules/no-redundant-value-cast.js +41 -0
- package/dist/lint/rules/no-string-ref.js +59 -0
- package/dist/lint/rules/no-unused-declarable-import.js +75 -0
- package/dist/lint/rules/no-unused-declarable.js +142 -0
- package/dist/lint/rules/op/index.js +28 -0
- package/dist/lint/rules/op/ops012-activity-contract.js +54 -0
- package/dist/lint/rules/op/ops013-step-output-ref.js +88 -0
- package/dist/lint/rules/op/ops014-converge-rule-refusals.js +114 -0
- package/dist/lint/rules/op/ops015-gate-approval.js +45 -0
- package/dist/lint/rules/op/support.js +11 -0
- package/dist/lint/rules/op/sys010-key-over-plain-http.js +100 -0
- package/dist/lint/rules/property-kind.js +56 -0
- package/dist/lint/rules/single-concern-file.js +71 -0
- package/dist/lint/rules/sys001-no-literal-key.js +60 -0
- package/dist/lint/selectors.js +168 -0
- package/dist/lint/suppressions.js +129 -0
- package/dist/lint/typescript.js +17 -0
- package/dist/live-endpoint.js +113 -0
- package/dist/live-read-session.js +76 -0
- package/dist/lsp/lexicon-providers.js +163 -0
- package/dist/lsp/types.js +5 -0
- package/dist/managed-fields.js +293 -0
- package/dist/mcp/types.js +4 -0
- package/dist/notify-verify.js +0 -1
- package/dist/notify.js +0 -1
- package/dist/notify.schema.json +72 -0
- package/dist/observation.js +266 -0
- package/dist/okf-read.js +134 -0
- package/dist/okf.js +275 -0
- package/dist/op/__fixtures__/decide-stub-backend.js +125 -0
- package/dist/op/activities/activity-contracts.js +313 -0
- package/dist/op/activities/apply.js +582 -0
- package/dist/op/activities/build.js +18 -0
- package/dist/op/activities/change-coverage.js +40 -0
- package/dist/op/activities/change-set.js +64 -0
- package/dist/op/activities/converge.js +492 -0
- package/dist/op/activities/decide.js +211 -0
- package/dist/op/activities/env-teardown.js +110 -0
- package/dist/op/activities/factory.js +591 -0
- package/dist/op/activities/forge-pull-request.js +82 -0
- package/dist/op/activities/gh-host.js +78 -0
- package/dist/op/activities/guard-validate.js +165 -0
- package/dist/op/activities/http-check.js +40 -0
- package/dist/op/activities/index.js +59 -0
- package/dist/op/activities/lexicon-upgrade.js +629 -0
- package/dist/op/activities/lifecycle.js +109 -0
- package/dist/op/activities/pipeline-audit.js +147 -0
- package/dist/op/activities/policy.js +26 -0
- package/dist/op/activities/predict-behaviour.js +341 -0
- package/dist/op/activities/propose-upgrade.js +165 -0
- package/dist/op/activities/reconcile.js +997 -0
- package/dist/op/activities/shell.js +118 -0
- package/dist/op/activities/source-release.js +97 -0
- package/dist/op/activities/source-rollback.js +165 -0
- package/dist/op/activities/teardown.js +17 -0
- package/dist/op/activities/util.js +6 -0
- package/dist/op/activities/wait.js +51 -0
- package/dist/op/activities/work-evidence.js +35 -0
- package/dist/op/activities/workflow-audit.js +133 -0
- package/dist/op/activity-contract-registry.js +106 -0
- package/dist/op/activity-contract.js +232 -0
- package/dist/op/activity-failure.js +31 -0
- package/dist/op/activity-profiles.js +129 -0
- package/dist/op/activity-registry.js +105 -0
- package/dist/op/activity-runtime.js +28 -0
- package/dist/op/builders.js +801 -0
- package/dist/op/change-signal.js +118 -0
- package/dist/op/composites/apply-op.js +151 -0
- package/dist/op/composites/behaviour-op.js +65 -0
- package/dist/op/composites/converge-op.js +141 -0
- package/dist/op/composites/index.js +19 -0
- package/dist/op/composites/lexicon-upgrade-op.js +107 -0
- package/dist/op/composites/pipeline-audit-op.js +50 -0
- package/dist/op/composites/reconcile-op.js +84 -0
- package/dist/op/composites/watch-op.js +69 -0
- package/dist/op/composites/workflow-audit-op.js +57 -0
- package/dist/op/converge-rule.js +205 -0
- package/dist/op/cron.js +146 -0
- package/dist/op/decide-backend.js +181 -0
- package/dist/op/decide-config.js +68 -0
- package/dist/op/decide-read-inputs.js +141 -0
- package/dist/op/discover.d.ts.map +1 -1
- package/dist/op/discover.js +213 -0
- package/dist/op/duration.js +21 -0
- package/dist/op/emulator-freshness.js +80 -0
- package/dist/op/emulator-lifecycle.js +269 -0
- package/dist/op/factory.js +83 -0
- package/dist/op/gate-approval.js +172 -0
- package/dist/op/gate-name.js +86 -0
- package/dist/op/gate-plan-context.js +167 -0
- package/dist/op/gate-point-run.js +67 -0
- package/dist/op/gate-point.js +111 -0
- package/dist/op/gate-resume-plan.js +155 -0
- package/dist/op/gate-resume.js +31 -0
- package/dist/op/gate-review.js +290 -0
- package/dist/op/gate-run-locator.js +85 -0
- package/dist/op/gate-summary.js +100 -0
- package/dist/op/gate-wait.js +56 -0
- package/dist/op/gate.js +449 -0
- package/dist/op/generate-pipeline.js +124 -0
- package/dist/op/index.js +51 -0
- package/dist/op/lifecycle-receipt-store.js +45 -0
- package/dist/op/local-executor.js +1164 -0
- package/dist/op/local-output.js +140 -0
- package/dist/op/op-ir.js +317 -0
- package/dist/op/op-verb-class.js +131 -0
- package/dist/op/op-waves-notify.js +136 -0
- package/dist/op/op-waves-run.js +1657 -0
- package/dist/op/op-waves.js +409 -0
- package/dist/op/operator.js +743 -0
- package/dist/op/receipt-store.js +94 -0
- package/dist/op/resource.js +23 -0
- package/dist/op/run-context.js +28 -0
- package/dist/op/run-live.js +256 -0
- package/dist/op/runtime.js +21 -0
- package/dist/op/runtimes/local.js +195 -0
- package/dist/op/source-archive.js +131 -0
- package/dist/op/step-output-ref.js +397 -0
- package/dist/op/steward-beside.js +169 -0
- package/dist/op/steward-points.js +138 -0
- package/dist/op/steward-turn.js +59 -0
- package/dist/op/steward.js +317 -0
- package/dist/op/types.js +25 -0
- package/dist/op/work-lease-decl.js +81 -0
- package/dist/op/work-lease-run.js +393 -0
- package/dist/override-gate.js +284 -0
- package/dist/owner-chain.js +74 -0
- package/dist/ownership.js +92 -0
- package/dist/params.js +61 -0
- package/dist/plan-summary.js +711 -0
- package/dist/point-decision.js +211 -0
- package/dist/pr-forge.js +810 -0
- package/dist/pr-loop.js +203 -0
- package/dist/project-codegen.js +191 -0
- package/dist/project-root.js +74 -0
- package/dist/project-validation.js +50 -0
- package/dist/provenance.js +157 -0
- package/dist/pseudo-parameter.js +40 -0
- package/dist/reconcile.js +450 -0
- package/dist/resource-attributes.js +33 -0
- package/dist/runtime-adapter.js +77 -0
- package/dist/runtime.js +66 -0
- package/dist/secret-materialization.js +153 -0
- package/dist/secret-provenance.js +250 -0
- package/dist/serializer-walker.js +112 -0
- package/dist/serializer.js +1 -0
- package/dist/sort.js +45 -0
- package/dist/stack-output.js +115 -0
- package/dist/telemetry-attribution.js +149 -0
- package/dist/terraform/__fixtures__/build-graph.js +63 -0
- package/dist/terraform/adopt-state.js +40 -0
- package/dist/terraform/aws-resources.js +384 -0
- package/dist/terraform/bridge.js +204 -0
- package/dist/terraform/carve-provider.js +155 -0
- package/dist/terraform/carve.js +138 -0
- package/dist/terraform/data-source-shape.js +57 -0
- package/dist/terraform/emit-source.js +36 -0
- package/dist/terraform/excise.js +123 -0
- package/dist/terraform/graduate.js +128 -0
- package/dist/terraform/graph.js +435 -0
- package/dist/terraform/hcl2json.js +60 -0
- package/dist/terraform/manifest.js +149 -0
- package/dist/terraform/parse.js +81 -0
- package/dist/terraform/providers/aws.js +146 -0
- package/dist/terraform/providers/gcp.js +294 -0
- package/dist/terraform/providers/index.js +17 -0
- package/dist/terraform/providers/kubernetes.js +253 -0
- package/dist/terraform/score.js +151 -0
- package/dist/terraform/state.js +67 -0
- package/dist/terraform/tier-map.js +74 -0
- package/dist/terraform/types.js +13 -0
- package/dist/terraform/unified-diff.js +132 -0
- package/dist/testing.js +295 -0
- package/dist/toml-emit.js +153 -0
- package/dist/toml-parse.js +355 -0
- package/dist/toml-utils.js +60 -0
- package/dist/toml.js +428 -0
- package/dist/ts-loader.d.ts +46 -0
- package/dist/ts-loader.d.ts.map +1 -0
- package/dist/ts-loader.js +103 -0
- package/dist/types.js +1 -0
- package/dist/utils.js +61 -0
- package/dist/validation.js +20 -0
- package/dist/vendor/js-yaml-load.js +1662 -0
- package/dist/workspace/__fixtures__/contract-repo.js +103 -0
- package/dist/workspace/__fixtures__/decide-workspace.js +112 -0
- package/dist/workspace/__fixtures__/sessions.js +91 -0
- package/dist/workspace/__fixtures__/two-member-workspace.js +34 -0
- package/dist/workspace/agent-cli.js +99 -0
- package/dist/workspace/agent.schema.json +390 -0
- package/dist/workspace/answers-ledger.js +89 -0
- package/dist/workspace/box-cli.js +142 -0
- package/dist/workspace/box-factory-write.js +196 -0
- package/dist/workspace/box-factory-write.schema.json +342 -0
- package/dist/workspace/box-factory.js +88 -0
- package/dist/workspace/box-intent.js +126 -0
- package/dist/workspace/box-isolation.js +169 -0
- package/dist/workspace/box-listing-write.schema.json +204 -0
- package/dist/workspace/box-listing.js +298 -0
- package/dist/workspace/box-publish.js +352 -0
- package/dist/workspace/box-publish.schema.json +498 -0
- package/dist/workspace/box-services.js +39 -0
- package/dist/workspace/broker-protocol.js +359 -0
- package/dist/workspace/broker-protocol.schema.json +228 -0
- package/dist/workspace/change-set.schema.json +460 -0
- package/dist/workspace/changes-cli.js +56 -0
- package/dist/workspace/changes.js +446 -0
- package/dist/workspace/changes.schema.json +642 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-fly-site.js +198 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-live-names.js +155 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-rollback.js +214 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-ship-inputs.js +180 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-ship-policy.js +99 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit.js +847 -0
- package/dist/workspace/chant-migrations.js +113 -0
- package/dist/workspace/check.schema.json +433 -0
- package/dist/workspace/checks/box-isolation.js +62 -0
- package/dist/workspace/checks/boxes.js +491 -0
- package/dist/workspace/checks/diagrams.js +104 -0
- package/dist/workspace/checks/generated.js +419 -0
- package/dist/workspace/checks/ledgers.js +212 -0
- package/dist/workspace/checks/links.js +191 -0
- package/dist/workspace/checks/live.js +100 -0
- package/dist/workspace/checks/pipelines.js +188 -0
- package/dist/workspace/checks/records.js +169 -0
- package/dist/workspace/checks.js +426 -0
- package/dist/workspace/ci-green-cli.js +125 -0
- package/dist/workspace/ci-green-forge.js +83 -0
- package/dist/workspace/ci-green-workflow.js +199 -0
- package/dist/workspace/ci-green.js +325 -0
- package/dist/workspace/ci-last-green.schema.json +158 -0
- package/dist/workspace/compose-graph.js +235 -0
- package/dist/workspace/compose-reports.js +146 -0
- package/dist/workspace/composites.js +264 -0
- package/dist/workspace/composites.schema.json +617 -0
- package/dist/workspace/conformance/__fixture__/app/package.json +7 -0
- package/dist/workspace/conformance/__fixture__/app/src/server.mjs +29 -0
- package/dist/workspace/conformance/__fixture__/decisions/decision.kind.mjs +54 -0
- package/dist/workspace/conformance/__fixture__/decisions/decision.schema.json +512 -0
- package/dist/workspace/conformance/__fixture__/decisions/fix-001-how-the-app-is-deployed.md +40 -0
- package/dist/workspace/conformance/__fixture__/delivery/chant.config.ts +7 -0
- package/dist/workspace/conformance/__fixture__/delivery/lexicon/index.ts +26 -0
- package/dist/workspace/conformance/__fixture__/delivery/package.json +7 -0
- package/dist/workspace/conformance/__fixture__/delivery/src/app.component.ts +14 -0
- package/dist/workspace/conformance/__fixture__/delivery/src/app.ts +4 -0
- package/dist/workspace/conformance/__fixtures__/reference-broker.js +205 -0
- package/dist/workspace/conformance/__writer_fixture__/answers/answer.kind.mjs +32 -0
- package/dist/workspace/conformance/__writer_fixture__/answers/answer.schema.json +135 -0
- package/dist/workspace/conformance/__writer_fixture__/contracts/contract.kind.mjs +37 -0
- package/dist/workspace/conformance/__writer_fixture__/contracts/contract.schema.json +213 -0
- package/dist/workspace/conformance/__writer_fixture__/decisions/points.json +228 -0
- package/dist/workspace/conformance/__writer_fixture__/drivers/driver.kind.mjs +15 -0
- package/dist/workspace/conformance/__writer_fixture__/drivers/driver.schema.json +38 -0
- package/dist/workspace/conformance/__writer_fixture__/sessions/session.kind.mjs +54 -0
- package/dist/workspace/conformance/__writer_fixture__/sessions/session.schema.json +289 -0
- package/dist/workspace/conformance/__writer_fixture__/work/W-001-the-writer-suite-works-this-item.md +25 -0
- package/dist/workspace/conformance/__writer_fixture__/work/work.kind.mjs +60 -0
- package/dist/workspace/conformance/__writer_fixture__/work/work.schema.json +603 -0
- package/dist/workspace/conformance/broker.js +736 -0
- package/dist/workspace/conformance/index.js +673 -0
- package/dist/workspace/conformance/vitest.js +108 -0
- package/dist/workspace/conformance/writer.js +1080 -0
- package/dist/workspace/decide.js +879 -0
- package/dist/workspace/decision-points.schema.json +135 -135
- package/dist/workspace/declaration-write-cli.js +74 -0
- package/dist/workspace/declaration-write.js +238 -0
- package/dist/workspace/declaration.js +938 -0
- package/dist/workspace/declaration.schema.json +1413 -1413
- package/dist/workspace/declared-kinds.js +106 -0
- package/dist/workspace/environments.js +164 -0
- package/dist/workspace/evidence.schema.json +279 -0
- package/dist/workspace/export-cli.js +185 -0
- package/dist/workspace/export.js +499 -0
- package/dist/workspace/factory-rules.js +175 -0
- package/dist/workspace/generated-files.js +92 -0
- package/dist/workspace/glob.js +45 -0
- package/dist/workspace/graph-cache.js +352 -0
- package/dist/workspace/graph-cli.js +348 -0
- package/dist/workspace/graph.schema.json +1338 -0
- package/dist/workspace/identity-gate-rule.js +75 -0
- package/dist/workspace/identity.js +126 -0
- package/dist/workspace/import.js +283 -0
- package/dist/workspace/init.js +620 -0
- package/dist/workspace/intent-cli.js +263 -0
- package/dist/workspace/intent-joins.js +201 -0
- package/dist/workspace/intent-record.js +352 -0
- package/dist/workspace/intent-record.schema.json +864 -0
- package/dist/workspace/intent.js +1582 -0
- package/dist/workspace/intent.schema.json +2420 -0
- package/dist/workspace/json-edit.js +221 -0
- package/dist/workspace/jsonc.js +235 -0
- package/dist/workspace/kind-readers.js +103 -0
- package/dist/workspace/kinds.js +587 -0
- package/dist/workspace/lexicon-symbols.js +112 -0
- package/dist/workspace/lineage-adopt-cli.js +102 -0
- package/dist/workspace/lineage-adopt.js +360 -0
- package/dist/workspace/lineage-check.js +282 -0
- package/dist/workspace/lineage-cli.js +121 -0
- package/dist/workspace/lineage-hash-index.js +284 -0
- package/dist/workspace/lineage-init.js +507 -0
- package/dist/workspace/lineage-lock.js +387 -0
- package/dist/workspace/lineage-merge.js +45 -0
- package/dist/workspace/lineage-migrations.d.ts.map +1 -1
- package/dist/workspace/lineage-migrations.js +329 -0
- package/dist/workspace/lineage-provenance.js +36 -0
- package/dist/workspace/lineage-update.js +138 -0
- package/dist/workspace/lineage-upgrade-cli.js +131 -0
- package/dist/workspace/lineage-upgrade.js +889 -0
- package/dist/workspace/lineage-vendor.js +171 -0
- package/dist/workspace/lineage-version.js +128 -0
- package/dist/workspace/lineage-versions.js +275 -0
- package/dist/workspace/links.js +330 -0
- package/dist/workspace/ls-generated.js +95 -0
- package/dist/workspace/ls.js +277 -0
- package/dist/workspace/ls.schema.json +333 -0
- package/dist/workspace/member-commands.js +508 -0
- package/dist/workspace/member-handles.js +216 -0
- package/dist/workspace/member-pipeline.js +258 -0
- package/dist/workspace/member-run.js +117 -0
- package/dist/workspace/member-write.schema.json +193 -0
- package/dist/workspace/nested-graph.js +156 -0
- package/dist/workspace/nesting.js +38 -0
- package/dist/workspace/patch.js +301 -0
- package/dist/workspace/patch.schema.json +321 -0
- package/dist/workspace/pin-cli.js +55 -0
- package/dist/workspace/pin-integrity.js +100 -0
- package/dist/workspace/plan-summary.schema.json +155 -0
- package/dist/workspace/point-answer.schema.json +129 -129
- package/dist/workspace/points-cli.js +291 -0
- package/dist/workspace/points-write.schema.json +660 -0
- package/dist/workspace/points.js +521 -0
- package/dist/workspace/points.schema.json +916 -0
- package/dist/workspace/pr-report.schema.json +108 -0
- package/dist/workspace/principal-classes.js +245 -0
- package/dist/workspace/reason-codes.js +326 -0
- package/dist/workspace/record-assets.js +151 -0
- package/dist/workspace/record-decided.js +105 -0
- package/dist/workspace/record-sessions.js +96 -0
- package/dist/workspace/record-source.js +114 -0
- package/dist/workspace/records-amend.schema.json +284 -0
- package/dist/workspace/records-checkout.js +76 -0
- package/dist/workspace/records-cli.js +707 -0
- package/dist/workspace/records-close.js +116 -0
- package/dist/workspace/records-close.schema.json +278 -0
- package/dist/workspace/records-new.schema.json +202 -0
- package/dist/workspace/records-review.schema.json +367 -0
- package/dist/workspace/records-since.js +317 -0
- package/dist/workspace/records-since.schema.json +218 -0
- package/dist/workspace/records-write.js +1229 -0
- package/dist/workspace/records.js +1345 -0
- package/dist/workspace/records.schema.json +604 -0
- package/dist/workspace/reference-kinds/app/package.json +10 -0
- package/dist/workspace/reference-kinds/app/workspace-kinds.json +45 -0
- package/dist/workspace/returns.js +303 -0
- package/dist/workspace/root-refusal.js +75 -0
- package/dist/workspace/run-statement.schema.json +622 -0
- package/dist/workspace/runs-cli.js +584 -0
- package/dist/workspace/runs-write.schema.json +994 -0
- package/dist/workspace/runs.js +708 -0
- package/dist/workspace/runs.schema.json +1257 -0
- package/dist/workspace/runtimes.js +76 -0
- package/dist/workspace/session-kinds.js +83 -0
- package/dist/workspace/signers.schema.json +206 -0
- package/dist/workspace/source-block.js +125 -0
- package/dist/workspace/squash.js +177 -0
- package/dist/workspace/status-gates.js +162 -0
- package/dist/workspace/status-stewards.js +330 -0
- package/dist/workspace/status.js +514 -0
- package/dist/workspace/status.schema.json +998 -0
- package/dist/workspace/steward-index.js +191 -0
- package/dist/workspace/symbols.js +188 -0
- package/dist/workspace/template-manifest.js +227 -0
- package/dist/workspace/template-pins.js +115 -0
- package/dist/workspace/trailer-joins.js +65 -0
- package/dist/workspace/trailers.js +111 -0
- package/dist/workspace/tree.js +136 -0
- package/dist/workspace/trust/attestor.js +63 -0
- package/dist/workspace/trust/dsse.js +108 -0
- package/dist/workspace/trust/evidence-cli.js +175 -0
- package/dist/workspace/trust/evidence.js +161 -0
- package/dist/workspace/trust/gate-seal.js +226 -0
- package/dist/workspace/trust/policy.js +190 -0
- package/dist/workspace/trust/provenance.js +180 -0
- package/dist/workspace/trust/rotation.js +298 -0
- package/dist/workspace/trust/run-commits.js +101 -0
- package/dist/workspace/trust/run-statement.js +182 -0
- package/dist/workspace/trust/seal.js +272 -0
- package/dist/workspace/trust/signers-cli.js +152 -0
- package/dist/workspace/trust/ssh-commit.js +178 -0
- package/dist/workspace/trust/test-repo.js +118 -0
- package/dist/workspace/trust/trust-files.js +193 -0
- package/dist/workspace/trust/verify-cli.js +63 -0
- package/dist/workspace/trust/verify.js +192 -0
- package/dist/workspace/which-chant.js +141 -0
- package/dist/workspace/wip-cli.js +95 -0
- package/dist/workspace/wip-write.schema.json +504 -0
- package/dist/workspace/wip.js +631 -0
- package/dist/workspace/wip.schema.json +334 -0
- package/dist/workspace/work-cli.js +448 -0
- package/dist/workspace/work-evidence.js +122 -0
- package/dist/workspace/work-evidence.schema.json +222 -0
- package/dist/workspace/work-history.schema.json +421 -0
- package/dist/workspace/work-lease.schema.json +246 -0
- package/dist/workspace/work-size.js +77 -0
- package/dist/workspace/work.js +283 -0
- package/dist/workspace/workspace-kinds.schema.json +259 -259
- package/dist/workspace/workspace-principals.schema.json +53 -53
- package/dist/workspace/write-lock-cli.js +105 -0
- package/dist/workspace/write-lock.js +424 -0
- package/dist/workspace/write-lock.schema.json +172 -0
- package/dist/workspace/write-scope.js +484 -0
- package/dist/yaml.js +459 -0
- package/package.json +2 -2
- package/src/cli/commands/check-lexicon-plugin.ts +2 -0
- package/src/cli/commands/lint.ts +3 -0
- package/src/cli/commands/migrate.ts +2 -0
- package/src/cli/compiled-cli.e2e.test.ts +165 -0
- package/src/cli/main.ts +121 -27
- package/src/cli/mcp/workspace-tools.ts +1 -1
- package/src/codegen/pinned-upgrade.ts +2 -0
- package/src/components/discover.ts +2 -0
- package/src/components/sandbox/driver.ts +3 -1
- package/src/config-import.ts +3 -0
- package/src/discovery/fold-import.ts +23 -14
- package/src/discovery/import.ts +2 -0
- package/src/discovery/sandbox/driver.ts +3 -1
- package/src/lexicon-module.ts +3 -0
- package/src/lint/config.ts +1 -1
- package/src/lint/discover.ts +28 -8
- package/src/lint/policy-import.ts +4 -1
- package/src/lint/rule-loader.ts +2 -0
- package/src/op/discover.ts +3 -0
- package/src/ts-loader.test.ts +23 -0
- package/src/ts-loader.ts +122 -0
- package/src/workspace/chant-migrations/chud-lexicon-exit.ts +1 -1
- package/src/workspace/declaration.ts +1 -1
- package/src/workspace/kinds.ts +1 -1
- package/src/workspace/lineage-migrations.ts +2 -0
- package/src/workspace/points.ts +1 -1
- package/src/workspace/principal-classes.ts +1 -1
|
@@ -0,0 +1,564 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #2707 — the workspace tools of `chant serve mcp`: the read contract and the
|
|
3
|
+
* record writes, for a harness that speaks MCP and has no shell.
|
|
4
|
+
*
|
|
5
|
+
* Served when the server starts at or inside a declared workspace. Each tool
|
|
6
|
+
* is a thin call into the code the CLI runs:
|
|
7
|
+
*
|
|
8
|
+
* - The reads (`workspace-ls`, `workspace-status`, `workspace-graph`,
|
|
9
|
+
* `workspace-changes`, `workspace-records`, `workspace-points`,
|
|
10
|
+
* `workspace-work-history`, `workspace-runs`) run `chant workspace <command>
|
|
11
|
+
* ... --json` with the chant this server runs as, in the server's
|
|
12
|
+
* directory, and return the
|
|
13
|
+
* document it printed, unchanged, with its reason codes (#2536). Running the
|
|
14
|
+
* command, rather than calling into it, keeps every rule it has, handing the
|
|
15
|
+
* read to the workspace root's pinned chant included (ws-021), and keeps
|
|
16
|
+
* anything a command prints away from the protocol on stdout.
|
|
17
|
+
* - The writes (`records-new`, `records-amend`, `records-review`,
|
|
18
|
+
* `records-close`, `points-answer`, `points-retract`) call the functions
|
|
19
|
+
* `chant workspace records new|amend|review|close` and `points
|
|
20
|
+
* answer|retract` call, and return the
|
|
21
|
+
* same JSON result. They keep every rule
|
|
22
|
+
* the CLI keeps: the kind's schema, a closed record never changing, an
|
|
23
|
+
* approved one changing only as its approval rule allows, a dissent needing
|
|
24
|
+
* a note, and `sign` using this host's configured key or refusing with the
|
|
25
|
+
* CLI's remedy. Through MCP a new record also opens in the kind's first
|
|
26
|
+
* state, `proposed` for a decision, and its stored source block (#2708) says
|
|
27
|
+
* it came through MCP: `via: "mcp"` and `client`, the MCP client's
|
|
28
|
+
* `clientInfo`. Computed provenance, from git, is unchanged.
|
|
29
|
+
*
|
|
30
|
+
* Nothing here listens on a port or authenticates anyone (ws-052): the server
|
|
31
|
+
* speaks over stdio, and `by` is recorded as given, as `--by` is. A decision
|
|
32
|
+
* point's answer is the exception (#3817): `chant serve mcp` makes every call
|
|
33
|
+
* the model's (`lifecycle/gate-origin.ts`), so `points-answer` and
|
|
34
|
+
* `points-retract` count nobody `by` names toward a point's quorum, as
|
|
35
|
+
* `op-approve` records its approver as an agent.
|
|
36
|
+
*
|
|
37
|
+
* An agent session (#2548): a server started with `CHANT_AGENT` set writes in
|
|
38
|
+
* that session, bound to its one member, and its writes are refused outside
|
|
39
|
+
* the session's write scope with the CLI's codes (`write-scope-member`,
|
|
40
|
+
* `write-scope-kind`, `agent-unknown`). `workspace-agent` returns what the
|
|
41
|
+
* session reloads from.
|
|
42
|
+
*/
|
|
43
|
+
import { spawn } from "node:child_process";
|
|
44
|
+
/** `AGENT_ENV` of `workspace/write-scope.ts`, kept here so the server loads nothing under workspace/ until a tool is called. */
|
|
45
|
+
const AGENT_ENV = "CHANT_AGENT";
|
|
46
|
+
/**
|
|
47
|
+
* The chant this process runs as: node with the same flags (from source, the tsx loader
|
|
48
|
+
* `bin/chant` registers) and the same entry script.
|
|
49
|
+
*/
|
|
50
|
+
export function ownChantCommand() {
|
|
51
|
+
return [process.execPath, ...process.execArgv, process.argv[1]];
|
|
52
|
+
}
|
|
53
|
+
const PROTOCOL = "Records are proposals until they are reviewed: a new record opens proposed, and people decide it through reviews and amendments. " +
|
|
54
|
+
"by must name the person or agent that actually proposed or decided it, as it is recorded as given.";
|
|
55
|
+
const kindProp = {
|
|
56
|
+
type: "string",
|
|
57
|
+
description: "The record kind: a kind file relative to the server's directory, such as decisions/decision.kind.mjs, or a kind the workspace declaration names. Without it, the one kind the declaration names.",
|
|
58
|
+
};
|
|
59
|
+
const atProp = { type: "string", description: "Read at this git revision instead of the working tree (--at)." };
|
|
60
|
+
const dryRunProp = { type: "boolean", description: "Return the result, with the text it would write, and write nothing (--dry-run)." };
|
|
61
|
+
const signProp = {
|
|
62
|
+
type: "boolean",
|
|
63
|
+
description: "Seal with this host's configured key, git's user.signingkey with gpg.format ssh, as --sign does. Refused, with the CLI's remedy, when none is set.",
|
|
64
|
+
};
|
|
65
|
+
export const workspaceReadTools = [
|
|
66
|
+
{
|
|
67
|
+
name: "workspace-ls",
|
|
68
|
+
description: "List the workspace's members and groups: chant workspace ls --json. Returns that document unchanged, which follows ls.schema.json of the read contract, reason codes included.",
|
|
69
|
+
inputSchema: { type: "object", properties: { at: atProp } },
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "workspace-status",
|
|
73
|
+
description: "What each member has released to an environment, its gates, and the steward that runs it with each Op's last run, from the declaration and the lifecycle ledgers: chant workspace status <env> --json. Returns that document unchanged (status.schema.json).",
|
|
74
|
+
inputSchema: {
|
|
75
|
+
type: "object",
|
|
76
|
+
properties: {
|
|
77
|
+
env: { type: "string", description: "The environment, such as dev." },
|
|
78
|
+
compareTo: { type: "string", description: "A second environment to compare with (--compare-to)." },
|
|
79
|
+
},
|
|
80
|
+
required: ["env"],
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: "workspace-graph",
|
|
85
|
+
description: "The workspace graph: chant workspace graph --json (graph.schema.json); with intent, the intent graph over one region (graph --intent, intent.schema.json); with composites, each composite instance and the components that can deploy it (graph --composites, composites.schema.json). Returns the document unchanged.",
|
|
86
|
+
inputSchema: {
|
|
87
|
+
type: "object",
|
|
88
|
+
properties: {
|
|
89
|
+
kind: {
|
|
90
|
+
type: "array",
|
|
91
|
+
items: { type: "string" },
|
|
92
|
+
description: "Record kind files whose records join the graph (--kind). The plain graph takes one; intent takes several.",
|
|
93
|
+
},
|
|
94
|
+
intent: { type: "string", description: "The region for the intent graph: a workspace path, path:line, path:start-end, or path#symbol for a TypeScript or JavaScript declaration such as src/server.ts#createApp (--intent). The document's why answers why the region is like this." },
|
|
95
|
+
followSquash: { type: "boolean", description: "With intent: follow squash merges to their pull requests' original commits (--follow-squash, #3035), fetching a pull request ref the clone lacks from origin. Off by default, so a read never reaches the network." },
|
|
96
|
+
composites: { type: "boolean", description: "The composites document instead (--composites). Takes no kind or intent." },
|
|
97
|
+
at: atProp,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "workspace-changes",
|
|
103
|
+
description: "The forward coverage check over a diff: chant workspace check --changes <range> --json (changes.schema.json, #2773). Each changed path with the current records whose constrains cover it, and a change-uncovered or change-out-of-scope finding for each gap, at the severity the declaration's changes block sets. Returns the document unchanged.",
|
|
104
|
+
inputSchema: {
|
|
105
|
+
type: "object",
|
|
106
|
+
properties: {
|
|
107
|
+
range: { type: "string", description: "The diff: <base>..<head>, <base>...<head> (from their merge base), or <base> alone, to HEAD (--changes)." },
|
|
108
|
+
work: { type: "string", description: "The id of the work item in hand, whose out_of_scope and whose decisions' out_of_scope apply (--work)." },
|
|
109
|
+
severity: { type: "string", enum: ["off", "warn", "fail"], description: "In place of the declaration's changes.severity (--severity)." },
|
|
110
|
+
kind: {
|
|
111
|
+
type: "array",
|
|
112
|
+
items: { type: "string" },
|
|
113
|
+
description: "Record kind files to read in place of the declared ones (--kind).",
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
required: ["range"],
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: "workspace-records",
|
|
121
|
+
description: "The records of a kind, validated, with supersession, remediation, provenance, quorum and warnings: chant workspace records --json (records.schema.json). With since, what changed since a revision or a review session (records-since.schema.json). Returns the document unchanged; with id, only that record is kept in records. " +
|
|
122
|
+
PROTOCOL,
|
|
123
|
+
inputSchema: {
|
|
124
|
+
type: "object",
|
|
125
|
+
properties: {
|
|
126
|
+
kind: kindProp,
|
|
127
|
+
current: { type: "boolean", description: "Leave out records a closed record supersedes (--current)." },
|
|
128
|
+
uncommitted: {
|
|
129
|
+
type: "boolean",
|
|
130
|
+
description: "Only the records the working tree holds modified or new against HEAD, with the checkout's branch, head and base (--uncommitted, #3160). Takes no at or since.",
|
|
131
|
+
},
|
|
132
|
+
since: { type: "string", description: "A revision, or a review session id, to compare with (--since)." },
|
|
133
|
+
id: { type: "string", description: "Keep only the record with this id in the document's records." },
|
|
134
|
+
at: atProp,
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: "workspace-points",
|
|
140
|
+
description: "The workspace's decision points and the questions asked of them: chant workspace points --json (points.schema.json, ws-058). A question is open while it is escalated to people, or proposed by a model and not yet confirmed; each lists any model's answer with its confidence and threshold. Returns the document unchanged. chant calls no model to answer this.",
|
|
141
|
+
inputSchema: {
|
|
142
|
+
type: "object",
|
|
143
|
+
properties: {
|
|
144
|
+
open: { type: "boolean", description: "Only the open questions (--open)." },
|
|
145
|
+
kind: { type: "string", description: "One answer kind file, in place of the declared ones (--kind)." },
|
|
146
|
+
at: atProp,
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "workspace-agent",
|
|
152
|
+
description: "An agent session and what it reloads from (#2548): chant workspace agent <name> --json (agent.schema.json). The members it is bound to, the record kinds and verbs its write scope allows, and the spec records --current prints, read from the repository alone. Without name, this server's session (CHANT_AGENT). Returns the document unchanged.",
|
|
153
|
+
inputSchema: {
|
|
154
|
+
type: "object",
|
|
155
|
+
properties: {
|
|
156
|
+
name: { type: "string", description: "The session's name, as the declaration's agents list gives it." },
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: "workspace-work-history",
|
|
162
|
+
description: "One work item's lease history, from the lifecycle ledger of the member that owns its work kind: chant workspace work history <item> --json (work-history.schema.json, #2785). Each claim has its fencing token and holder and how it ended: released with an outcome, still held, or never released (expired, or lost to a later claim). Returns the document unchanged.",
|
|
163
|
+
inputSchema: {
|
|
164
|
+
type: "object",
|
|
165
|
+
properties: {
|
|
166
|
+
item: { type: "string", description: "The work item's id." },
|
|
167
|
+
kind: { type: "string", description: "The work kind file, when more than one declared work kind has the id (--kind)." },
|
|
168
|
+
},
|
|
169
|
+
required: ["item"],
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: "workspace-runs",
|
|
174
|
+
description: "The agent runs in the workspace's run ledger on chant/lifecycle: chant workspace runs --json (runs.schema.json, #3033). Each run has who it worked for, its harness and model, its tokens and cost with the price source, the transcript pinned by hash and the commits it made, and the totals are per work item, per decision and per principal. A run that reports no cost is listed as unpriced, never counted as zero. Returns the document unchanged.",
|
|
175
|
+
inputSchema: {
|
|
176
|
+
type: "object",
|
|
177
|
+
properties: {
|
|
178
|
+
unit: { type: "string", description: "Only the runs on this work item (--unit)." },
|
|
179
|
+
decision: { type: "string", description: "Only the runs that carried out this decision, by id or <kind>/<id> (--decision)." },
|
|
180
|
+
by: { type: "string", description: "Only the runs made for this principal (--by)." },
|
|
181
|
+
since: { type: "string", description: "Only the runs that made a commit after this revision, or started after it (--since)." },
|
|
182
|
+
followSquash: { type: "boolean", description: "Join each squash merge on HEAD to the runs its pull request's original commits joined (--follow-squash, #3035), fetching a pull request ref the clone lacks from origin." },
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
];
|
|
187
|
+
export const workspaceWriteTools = [
|
|
188
|
+
{
|
|
189
|
+
name: "records-new",
|
|
190
|
+
description: "Propose a new record: chant workspace records new. The record opens in the kind's first state (proposed for a decision); another state is refused. Its source block records that it came through MCP (via mcp, and this client's clientInfo). Validated against the kind's schema; nothing is written on refusal, and nothing is committed. " +
|
|
191
|
+
PROTOCOL,
|
|
192
|
+
inputSchema: {
|
|
193
|
+
type: "object",
|
|
194
|
+
properties: {
|
|
195
|
+
kind: kindProp,
|
|
196
|
+
record: { type: "object", description: "The record's fields, as the kind's schema describes them. The id is allocated when left out." },
|
|
197
|
+
prefix: { type: "string", description: "The id prefix to allocate under, when the records use several (--prefix)." },
|
|
198
|
+
by: {
|
|
199
|
+
type: "string",
|
|
200
|
+
description: "Who proposed it: written to the kind's proposedBy field, such as proposed_by, since a record opens proposed. Written to its decider field, such as decided_by, only when the record's fields open it straight into a later state. Required to sign.",
|
|
201
|
+
},
|
|
202
|
+
sign: signProp,
|
|
203
|
+
dryRun: dryRunProp,
|
|
204
|
+
},
|
|
205
|
+
required: ["record"],
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: "records-amend",
|
|
210
|
+
description: "Set top-level fields of a record: chant workspace records amend. A closed record never changes, and an approved one changes only in its state, evidence and reviews: anything else, its reasoning included, is a new record that supersedes it. A record moves to its kind's ratified state only once its review quorum is met (ratify-quorum-not-met). A source block given in the fields records that the change came through MCP. " +
|
|
211
|
+
PROTOCOL,
|
|
212
|
+
inputSchema: {
|
|
213
|
+
type: "object",
|
|
214
|
+
properties: {
|
|
215
|
+
id: { type: "string", description: "The record's id." },
|
|
216
|
+
kind: kindProp,
|
|
217
|
+
fields: { type: "object", description: "The top-level fields to set; each replaces the whole field." },
|
|
218
|
+
by: { type: "string", description: "Who decided: written to the kind's decider field." },
|
|
219
|
+
sign: signProp,
|
|
220
|
+
dryRun: dryRunProp,
|
|
221
|
+
},
|
|
222
|
+
required: ["id", "fields"],
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: "records-review",
|
|
227
|
+
description: "Give a verdict on a record: chant workspace records review. Appends one entry to its reviews with the digest of the text judged, which moves its quorum. A dissent needs a note. " +
|
|
228
|
+
PROTOCOL,
|
|
229
|
+
inputSchema: {
|
|
230
|
+
type: "object",
|
|
231
|
+
properties: {
|
|
232
|
+
id: { type: "string", description: "The record's id." },
|
|
233
|
+
kind: kindProp,
|
|
234
|
+
verdict: { type: "string", enum: ["agree", "dissent", "abstain"] },
|
|
235
|
+
by: { type: "string", description: "The reviewer: the person or agent giving the verdict (--by)." },
|
|
236
|
+
note: { type: "string", description: "Why; required for a dissent (--note)." },
|
|
237
|
+
session: { type: "string", description: "The open review session the verdict is given in (--session)." },
|
|
238
|
+
sign: signProp,
|
|
239
|
+
dryRun: dryRunProp,
|
|
240
|
+
},
|
|
241
|
+
required: ["id", "verdict", "by"],
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
name: "records-close",
|
|
246
|
+
description: "Close an open review session and seal it: chant workspace records close. " + PROTOCOL,
|
|
247
|
+
inputSchema: {
|
|
248
|
+
type: "object",
|
|
249
|
+
properties: {
|
|
250
|
+
id: { type: "string", description: "The session's id." },
|
|
251
|
+
kind: { type: "string", description: "The session kind file. Without it, the one session kind the declaration names." },
|
|
252
|
+
dryRun: dryRunProp,
|
|
253
|
+
},
|
|
254
|
+
required: ["id"],
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
name: "points-answer",
|
|
259
|
+
description: "Record people's answer to an open decision point question, or confirm a model's proposal: chant workspace points answer. Refused unless the point's quorum is met: distinct people, none holding the agent role, each holding one of the quorum's roles when it names any. On a server started with `chant serve mcp`, every call is the model's, so nobody named in by counts toward the quorum (quorum-not-met), and a question whose gate is neverOverMcp is refused outright (answer-never-over-mcp): people answer at a shell or through hud. An answered question never changes in place: points-retract takes it back. " +
|
|
260
|
+
PROTOCOL,
|
|
261
|
+
inputSchema: {
|
|
262
|
+
type: "object",
|
|
263
|
+
properties: {
|
|
264
|
+
id: { type: "string", description: "The question's id, as workspace-points lists it." },
|
|
265
|
+
answer: { type: ["string", "boolean"], description: "One of the question's candidates; for a noul, true or false." },
|
|
266
|
+
by: { type: "array", items: { type: "string" }, description: "Each person who answered (--by)." },
|
|
267
|
+
note: { type: "string", description: "What the people who answered say with it, kept on the answer (--note)." },
|
|
268
|
+
relayedBy: { type: "string", description: "Who relayed the answer for the people in by, such as a follower; recorded as relayed_by and not counted toward the quorum (--relayed-by)." },
|
|
269
|
+
kind: { type: "string", description: "The answer kind file. Without it, the declared answer kinds." },
|
|
270
|
+
dryRun: dryRunProp,
|
|
271
|
+
},
|
|
272
|
+
required: ["id", "answer", "by"],
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
name: "points-retract",
|
|
277
|
+
description: "Take back people's answer to a decision point question: chant workspace points retract. The question is escalated to people again, and the answer, who gave it and its note stay in the record's retractions with who retracted it, when and why. Refused unless the point's quorum is met, counted as for an answer, so over MCP it is refused as an answer is. " +
|
|
278
|
+
PROTOCOL,
|
|
279
|
+
inputSchema: {
|
|
280
|
+
type: "object",
|
|
281
|
+
properties: {
|
|
282
|
+
id: { type: "string", description: "The question's id, as workspace-points lists it." },
|
|
283
|
+
by: { type: "array", items: { type: "string" }, description: "Each person who takes the answer back (--by)." },
|
|
284
|
+
note: { type: "string", description: "Why, kept on the retraction (--note)." },
|
|
285
|
+
kind: { type: "string", description: "The answer kind file. Without it, the declared answer kinds." },
|
|
286
|
+
dryRun: dryRunProp,
|
|
287
|
+
},
|
|
288
|
+
required: ["id", "by"],
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
];
|
|
292
|
+
/** A tool call that can't be made as given: the client gets it as an error result, and nothing runs. */
|
|
293
|
+
class ToolInputError extends Error {
|
|
294
|
+
}
|
|
295
|
+
function str(params, key, required = false) {
|
|
296
|
+
const v = params[key];
|
|
297
|
+
if (v === undefined || v === null) {
|
|
298
|
+
if (required)
|
|
299
|
+
throw new ToolInputError(`${key} is required`);
|
|
300
|
+
return undefined;
|
|
301
|
+
}
|
|
302
|
+
if (typeof v !== "string" || v === "")
|
|
303
|
+
throw new ToolInputError(`${key} must be a non-empty string`);
|
|
304
|
+
// A value is passed as one argument; one that starts with - would read as a flag.
|
|
305
|
+
if (v.startsWith("-"))
|
|
306
|
+
throw new ToolInputError(`${key} may not start with -: ${JSON.stringify(v)}`);
|
|
307
|
+
return v;
|
|
308
|
+
}
|
|
309
|
+
function bool(params, key) {
|
|
310
|
+
const v = params[key];
|
|
311
|
+
if (v === undefined || v === null)
|
|
312
|
+
return false;
|
|
313
|
+
if (typeof v !== "boolean")
|
|
314
|
+
throw new ToolInputError(`${key} must be true or false`);
|
|
315
|
+
return v;
|
|
316
|
+
}
|
|
317
|
+
function obj(params, key) {
|
|
318
|
+
const v = params[key];
|
|
319
|
+
if (v === null || typeof v !== "object" || Array.isArray(v))
|
|
320
|
+
throw new ToolInputError(`${key} must be a JSON object`);
|
|
321
|
+
return v;
|
|
322
|
+
}
|
|
323
|
+
function kinds(params) {
|
|
324
|
+
const v = params.kind;
|
|
325
|
+
if (v === undefined || v === null)
|
|
326
|
+
return [];
|
|
327
|
+
const list = typeof v === "string" ? [v] : v;
|
|
328
|
+
if (!Array.isArray(list))
|
|
329
|
+
throw new ToolInputError("kind must be a kind file, or a list of them");
|
|
330
|
+
return list.map((k, i) => str({ [`kind[${i}]`]: k }, `kind[${i}]`, true));
|
|
331
|
+
}
|
|
332
|
+
/** The `chant` arguments each read tool runs, from its input. Exported for the conformance suite's MCP transport. */
|
|
333
|
+
export function readArgv(tool, params) {
|
|
334
|
+
const at = str(params, "at");
|
|
335
|
+
const atArgs = at !== undefined ? ["--at", at] : [];
|
|
336
|
+
switch (tool) {
|
|
337
|
+
case "workspace-ls":
|
|
338
|
+
return ["workspace", "ls", ...atArgs, "--json"];
|
|
339
|
+
case "workspace-status": {
|
|
340
|
+
const env = str(params, "env", true);
|
|
341
|
+
const compareTo = str(params, "compareTo");
|
|
342
|
+
return ["workspace", "status", env, ...(compareTo !== undefined ? ["--compare-to", compareTo] : []), "--json"];
|
|
343
|
+
}
|
|
344
|
+
case "workspace-graph": {
|
|
345
|
+
const intent = str(params, "intent");
|
|
346
|
+
const composites = bool(params, "composites");
|
|
347
|
+
const kindArgs = kinds(params).flatMap((k) => ["--kind", k]);
|
|
348
|
+
if (composites)
|
|
349
|
+
return ["workspace", "graph", "--composites", ...kindArgs, ...(intent !== undefined ? ["--intent", intent] : []), ...atArgs, "--json"];
|
|
350
|
+
if (intent !== undefined)
|
|
351
|
+
return ["workspace", "graph", "--intent", intent, ...kindArgs, ...atArgs, ...(bool(params, "followSquash") ? ["--follow-squash"] : []), "--json"];
|
|
352
|
+
return ["workspace", "graph", ...kindArgs, ...atArgs, "--json"];
|
|
353
|
+
}
|
|
354
|
+
case "workspace-changes": {
|
|
355
|
+
const range = str(params, "range", true);
|
|
356
|
+
const work = str(params, "work");
|
|
357
|
+
const severity = str(params, "severity");
|
|
358
|
+
if (severity !== undefined && !["off", "warn", "fail"].includes(severity))
|
|
359
|
+
throw new ToolInputError("severity must be off, warn or fail");
|
|
360
|
+
return [
|
|
361
|
+
"workspace",
|
|
362
|
+
"check",
|
|
363
|
+
"--changes",
|
|
364
|
+
range,
|
|
365
|
+
...(work !== undefined ? ["--work", work] : []),
|
|
366
|
+
...(severity !== undefined ? ["--severity", severity] : []),
|
|
367
|
+
...kinds(params).flatMap((k) => ["--kind", k]),
|
|
368
|
+
"--json",
|
|
369
|
+
];
|
|
370
|
+
}
|
|
371
|
+
case "workspace-agent": {
|
|
372
|
+
const name = str(params, "name", true);
|
|
373
|
+
return ["workspace", "agent", name, "--json"];
|
|
374
|
+
}
|
|
375
|
+
case "workspace-work-history": {
|
|
376
|
+
const item = str(params, "item", true);
|
|
377
|
+
const kind = str(params, "kind");
|
|
378
|
+
return ["workspace", "work", "history", item, ...(kind !== undefined ? ["--kind", kind] : []), "--json"];
|
|
379
|
+
}
|
|
380
|
+
case "workspace-runs": {
|
|
381
|
+
const flags = ["unit", "decision", "by", "since"].flatMap((f) => {
|
|
382
|
+
const v = str(params, f);
|
|
383
|
+
return v !== undefined ? [`--${f}`, v] : [];
|
|
384
|
+
});
|
|
385
|
+
return ["workspace", "runs", ...flags, ...(bool(params, "followSquash") ? ["--follow-squash"] : []), "--json"];
|
|
386
|
+
}
|
|
387
|
+
case "workspace-points": {
|
|
388
|
+
const kind = str(params, "kind");
|
|
389
|
+
return ["workspace", "points", ...(bool(params, "open") ? ["--open"] : []), ...(kind !== undefined ? ["--kind", kind] : []), ...atArgs, "--json"];
|
|
390
|
+
}
|
|
391
|
+
case "workspace-records": {
|
|
392
|
+
const kind = str(params, "kind");
|
|
393
|
+
const since = str(params, "since");
|
|
394
|
+
if (bool(params, "uncommitted") && (at !== undefined || since !== undefined))
|
|
395
|
+
throw new ToolInputError("uncommitted reads the working tree against HEAD, and takes no at or since");
|
|
396
|
+
return [
|
|
397
|
+
"workspace",
|
|
398
|
+
"records",
|
|
399
|
+
...(kind !== undefined ? ["--kind", kind] : []),
|
|
400
|
+
...(bool(params, "current") ? ["--current"] : []),
|
|
401
|
+
...(bool(params, "uncommitted") ? ["--uncommitted"] : []),
|
|
402
|
+
...(since !== undefined ? ["--since", since] : []),
|
|
403
|
+
...atArgs,
|
|
404
|
+
"--json",
|
|
405
|
+
];
|
|
406
|
+
}
|
|
407
|
+
default:
|
|
408
|
+
throw new ToolInputError(`${tool} is not a workspace read tool`);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
/** Run chant and parse the one JSON document it printed. The exit code does not matter: an error document is a document. */
|
|
412
|
+
function runRead(command, argv, cwd) {
|
|
413
|
+
return new Promise((settle, fail) => {
|
|
414
|
+
const child = spawn(command[0], [...command.slice(1), ...argv], { cwd, env: { ...process.env, NO_COLOR: "1" }, stdio: ["ignore", "pipe", "pipe"] });
|
|
415
|
+
let stdout = "";
|
|
416
|
+
let stderr = "";
|
|
417
|
+
child.stdout.setEncoding("utf-8").on("data", (s) => (stdout += s));
|
|
418
|
+
child.stderr.setEncoding("utf-8").on("data", (s) => (stderr += s));
|
|
419
|
+
child.on("error", (e) => fail(new Error(`could not run chant ${argv.join(" ")}: ${e.message}`)));
|
|
420
|
+
child.on("close", (status) => {
|
|
421
|
+
try {
|
|
422
|
+
settle(JSON.parse(stdout));
|
|
423
|
+
}
|
|
424
|
+
catch {
|
|
425
|
+
const why = stderr.trim() || stdout.trim() || `exit ${status}`;
|
|
426
|
+
fail(new Error(`chant ${argv.join(" ")} printed no JSON document: ${why}`));
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
/** Keep only the record with `id` in a records document, or in each kind of a declared set. */
|
|
432
|
+
function onlyRecord(doc, id) {
|
|
433
|
+
if (doc === null || typeof doc !== "object")
|
|
434
|
+
return doc;
|
|
435
|
+
const d = doc;
|
|
436
|
+
if (Array.isArray(d.records))
|
|
437
|
+
return { ...d, records: d.records.filter((r) => r.id === id) };
|
|
438
|
+
if (Array.isArray(d.kinds))
|
|
439
|
+
return { ...d, kinds: d.kinds.map((k) => onlyRecord(k, id)) };
|
|
440
|
+
return doc;
|
|
441
|
+
}
|
|
442
|
+
/** The source block a write through MCP lays over the record's (#2708). */
|
|
443
|
+
function mcpSource(context) {
|
|
444
|
+
const c = context?.clientInfo;
|
|
445
|
+
const client = c && typeof c.name === "string" && c.name !== ""
|
|
446
|
+
? {
|
|
447
|
+
name: c.name,
|
|
448
|
+
...(typeof c.version === "string" && c.version !== "" ? { version: c.version } : {}),
|
|
449
|
+
...(typeof c.title === "string" && c.title !== "" ? { title: c.title } : {}),
|
|
450
|
+
}
|
|
451
|
+
: undefined;
|
|
452
|
+
return { via: "mcp", ...(client ? { client } : {}) };
|
|
453
|
+
}
|
|
454
|
+
/** The workspace tools, reads then writes, bound to the server's directory. */
|
|
455
|
+
export function createWorkspaceTools(options) {
|
|
456
|
+
const { cwd } = options;
|
|
457
|
+
const chant = options.chantCommand ?? ownChantCommand();
|
|
458
|
+
const agent = options.agent ?? (process.env[AGENT_ENV] || undefined);
|
|
459
|
+
const reads = workspaceReadTools.map((definition) => ({
|
|
460
|
+
definition,
|
|
461
|
+
handler: async (params) => {
|
|
462
|
+
const given = definition.name === "workspace-agent" && params.name === undefined && agent !== undefined ? { ...params, name: agent } : params;
|
|
463
|
+
const argv = readArgv(definition.name, given);
|
|
464
|
+
const id = definition.name === "workspace-records" ? str(params, "id") : undefined;
|
|
465
|
+
const doc = await runRead(chant, argv, cwd);
|
|
466
|
+
return id !== undefined ? onlyRecord(doc, id) : doc;
|
|
467
|
+
},
|
|
468
|
+
}));
|
|
469
|
+
const write = async () => import("../../workspace/records-write.js");
|
|
470
|
+
/** The kind file a write goes through: the one named, or the one the declaration names; else the CLI's usage failure. */
|
|
471
|
+
const writeKind = async (params, schema, missing) => {
|
|
472
|
+
const w = await write();
|
|
473
|
+
const named = str(params, "kind");
|
|
474
|
+
return named !== undefined ? w.resolveWriteKind(named, cwd) : w.declaredWriteKind(schema, cwd, missing);
|
|
475
|
+
};
|
|
476
|
+
const sign = (params) => (bool(params, "sign") ? true : undefined);
|
|
477
|
+
const handlers = {
|
|
478
|
+
"records-new": async (params, context) => {
|
|
479
|
+
const w = await write();
|
|
480
|
+
const record = obj(params, "record");
|
|
481
|
+
const kind = await writeKind(params, w.RECORDS_NEW_SCHEMA_ID, "new needs the kind file");
|
|
482
|
+
if (typeof kind !== "string")
|
|
483
|
+
return kind;
|
|
484
|
+
return w.newRecord({
|
|
485
|
+
kind,
|
|
486
|
+
fields: JSON.stringify(record),
|
|
487
|
+
prefix: str(params, "prefix"),
|
|
488
|
+
by: str(params, "by"),
|
|
489
|
+
sign: sign(params),
|
|
490
|
+
dryRun: bool(params, "dryRun"),
|
|
491
|
+
cwd,
|
|
492
|
+
agent,
|
|
493
|
+
through: { source: mcpSource(context), opensInitial: true },
|
|
494
|
+
});
|
|
495
|
+
},
|
|
496
|
+
"records-amend": async (params, context) => {
|
|
497
|
+
const w = await write();
|
|
498
|
+
const id = str(params, "id", true);
|
|
499
|
+
const fields = obj(params, "fields");
|
|
500
|
+
const kind = await writeKind(params, w.RECORDS_AMEND_SCHEMA_ID, "--kind <kind file> is required");
|
|
501
|
+
if (typeof kind !== "string")
|
|
502
|
+
return kind;
|
|
503
|
+
return w.amendRecord({
|
|
504
|
+
kind,
|
|
505
|
+
id,
|
|
506
|
+
fields: JSON.stringify(fields),
|
|
507
|
+
by: str(params, "by"),
|
|
508
|
+
sign: sign(params),
|
|
509
|
+
dryRun: bool(params, "dryRun"),
|
|
510
|
+
cwd,
|
|
511
|
+
agent,
|
|
512
|
+
through: { source: mcpSource(context) },
|
|
513
|
+
});
|
|
514
|
+
},
|
|
515
|
+
"records-review": async (params) => {
|
|
516
|
+
const w = await write();
|
|
517
|
+
const id = str(params, "id", true);
|
|
518
|
+
const kind = await writeKind(params, w.RECORDS_REVIEW_SCHEMA_ID, "--kind <kind file> is required");
|
|
519
|
+
if (typeof kind !== "string")
|
|
520
|
+
return kind;
|
|
521
|
+
return w.reviewRecord({
|
|
522
|
+
kind,
|
|
523
|
+
id,
|
|
524
|
+
verdict: str(params, "verdict", true),
|
|
525
|
+
by: str(params, "by", true),
|
|
526
|
+
note: typeof params.note === "string" ? params.note : undefined,
|
|
527
|
+
session: str(params, "session"),
|
|
528
|
+
sign: sign(params),
|
|
529
|
+
dryRun: bool(params, "dryRun"),
|
|
530
|
+
cwd,
|
|
531
|
+
agent,
|
|
532
|
+
});
|
|
533
|
+
},
|
|
534
|
+
"points-answer": async (params) => {
|
|
535
|
+
const { answerPoint } = await import("../../workspace/decide.js");
|
|
536
|
+
const answer = params.answer;
|
|
537
|
+
if (typeof answer !== "string" && typeof answer !== "boolean")
|
|
538
|
+
throw new ToolInputError("answer must be a string, or true or false");
|
|
539
|
+
const by = params.by;
|
|
540
|
+
if (!Array.isArray(by) || by.length === 0 || !by.every((b) => typeof b === "string" && b.trim() !== ""))
|
|
541
|
+
throw new ToolInputError("by must list each person who answered");
|
|
542
|
+
return answerPoint({ cwd, id: str(params, "id", true), answer, by: by, note: str(params, "note"), relayedBy: str(params, "relayedBy"), kind: str(params, "kind"), dryRun: bool(params, "dryRun") });
|
|
543
|
+
},
|
|
544
|
+
"points-retract": async (params) => {
|
|
545
|
+
const { retractAnswer } = await import("../../workspace/decide.js");
|
|
546
|
+
const by = params.by;
|
|
547
|
+
if (!Array.isArray(by) || by.length === 0 || !by.every((b) => typeof b === "string" && b.trim() !== ""))
|
|
548
|
+
throw new ToolInputError("by must list each person who takes the answer back");
|
|
549
|
+
return retractAnswer({ cwd, id: str(params, "id", true), by: by, note: str(params, "note"), kind: str(params, "kind"), dryRun: bool(params, "dryRun") });
|
|
550
|
+
},
|
|
551
|
+
"records-close": async (params) => {
|
|
552
|
+
const w = await write();
|
|
553
|
+
const { closeRecord, RECORDS_CLOSE_SCHEMA_ID } = await import("../../workspace/records-close.js");
|
|
554
|
+
const id = str(params, "id", true);
|
|
555
|
+
const named = str(params, "kind");
|
|
556
|
+
const kind = named !== undefined ? w.resolveWriteKind(named, cwd) : await w.declaredSessionKind(RECORDS_CLOSE_SCHEMA_ID, cwd);
|
|
557
|
+
if (typeof kind !== "string")
|
|
558
|
+
return kind;
|
|
559
|
+
return closeRecord({ kind, id, dryRun: bool(params, "dryRun"), cwd, agent });
|
|
560
|
+
},
|
|
561
|
+
};
|
|
562
|
+
const writes = workspaceWriteTools.map((definition) => ({ definition, handler: handlers[definition.name] }));
|
|
563
|
+
return [...reads, ...writes];
|
|
564
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { existsSync, writeFileSync } from "fs";
|
|
2
|
+
import { join } from "path";
|
|
3
|
+
/**
|
|
4
|
+
* The one place chant decides where a project's MCP server registration
|
|
5
|
+
* lives, what goes in it, and which command writes it (chant #2383).
|
|
6
|
+
*
|
|
7
|
+
* Before this module the three sites disagreed: `chant init` wrote
|
|
8
|
+
* `mcp.json` into the user's home directory (picking a harness directory
|
|
9
|
+
* that happened to exist), `chant doctor` looked for `<project>/.mcp.json`,
|
|
10
|
+
* and the doctor's remediation named `chant agent setup`, which was never
|
|
11
|
+
* registered in `./main.ts`. A project chant had just scaffolded therefore
|
|
12
|
+
* failed chant's own doctor, and the fix the warning named could not be run.
|
|
13
|
+
*
|
|
14
|
+
* Project scope wins. The file versions with the project it describes, it
|
|
15
|
+
* keeps `chant init <dir>` from writing outside `<dir>`, and it is already
|
|
16
|
+
* what `../agents/discover.ts` treats as the project-scope location when
|
|
17
|
+
* chant audits an agent installation it did not create. Every consumer must
|
|
18
|
+
* go through the constants here rather than rebuilding the path, so the
|
|
19
|
+
* three sites cannot drift apart again without the shared test in
|
|
20
|
+
* ./mcp-config.test.ts noticing.
|
|
21
|
+
*/
|
|
22
|
+
/** Filename of the project-scoped MCP server registration. */
|
|
23
|
+
export const MCP_CONFIG_FILENAME = ".mcp.json";
|
|
24
|
+
/**
|
|
25
|
+
* The command a user runs to (re)write a missing {@link MCP_CONFIG_FILENAME}
|
|
26
|
+
* in an existing project. `chant init` also writes it, but init refuses a
|
|
27
|
+
* non-empty directory without `--force`, so the remediation an already
|
|
28
|
+
* scaffolded project needs is `chant update` — which is also what the
|
|
29
|
+
* doctor's neighbouring skills check tells you to run for the same reason.
|
|
30
|
+
* Kept as a constant so ./mcp-config.test.ts can assert it is a command
|
|
31
|
+
* `commandRegistry` actually registers.
|
|
32
|
+
*/
|
|
33
|
+
export const MCP_SETUP_COMMAND = "chant update";
|
|
34
|
+
/** Absolute (or caller-relative) path to a project's MCP config. */
|
|
35
|
+
export function mcpConfigPath(projectDir) {
|
|
36
|
+
return join(projectDir, MCP_CONFIG_FILENAME);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Detect whether a project uses bun or npm, from its lock file. Lives here
|
|
40
|
+
* because the package manager is the only variable in the generated config.
|
|
41
|
+
*/
|
|
42
|
+
export function detectPackageManager(dir) {
|
|
43
|
+
if (dir && (existsSync(join(dir, "bun.lockb")) || existsSync(join(dir, "bun.lock"))))
|
|
44
|
+
return "bun";
|
|
45
|
+
return "npm";
|
|
46
|
+
}
|
|
47
|
+
/** The MCP registration chant writes: one stdio server named `chant`. */
|
|
48
|
+
export function generateMcpConfig(pm) {
|
|
49
|
+
const config = {
|
|
50
|
+
mcpServers: {
|
|
51
|
+
chant: {
|
|
52
|
+
command: pm === "bun" ? "bunx" : "npx",
|
|
53
|
+
args: ["chant", "serve", "mcp"],
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
return JSON.stringify(config, null, 2);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Write `<projectDir>/.mcp.json` unless one is already there. Returns the
|
|
61
|
+
* relative path when a file was created, `undefined` when an existing config
|
|
62
|
+
* was left alone — callers report that difference to the user.
|
|
63
|
+
*/
|
|
64
|
+
export function writeProjectMcpConfig(projectDir) {
|
|
65
|
+
const path = mcpConfigPath(projectDir);
|
|
66
|
+
if (existsSync(path))
|
|
67
|
+
return undefined;
|
|
68
|
+
writeFileSync(path, generateMcpConfig(detectPackageManager(projectDir)));
|
|
69
|
+
return MCP_CONFIG_FILENAME;
|
|
70
|
+
}
|