@ybotok/loam 0.1.0-beta.3 → 0.2.0-alpha.13
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/CHANGELOG.md +5992 -82
- package/COMPARISON.md +168 -63
- package/CONTRIBUTING.md +121 -0
- package/MIGRATING-from-OpenSpec.md +238 -55
- package/QUICKSTART.md +302 -0
- package/README.md +653 -144
- package/ROADMAP.md +1035 -0
- package/SCHEMA.md +3916 -263
- package/SECURITY.md +21 -3
- package/WORKFLOW.md +927 -0
- package/dist/cli.js +133 -21
- package/dist/cli.js.map +1 -1
- package/dist/commands/adopt/adopt.js +204 -0
- package/dist/commands/adopt/adopt.js.map +1 -0
- package/dist/commands/adopt/render.js +309 -0
- package/dist/commands/adopt/render.js.map +1 -0
- package/dist/commands/archive/archive.js +74 -0
- package/dist/commands/archive/archive.js.map +1 -0
- package/dist/commands/archive/closing.js +42 -0
- package/dist/commands/archive/closing.js.map +1 -0
- package/dist/commands/archive/plan/contracts/asyncapi.js +172 -0
- package/dist/commands/archive/plan/contracts/asyncapi.js.map +1 -0
- package/dist/commands/archive/plan/contracts/consumers.js +56 -0
- package/dist/commands/archive/plan/contracts/consumers.js.map +1 -0
- package/dist/commands/archive/plan/contracts/openapi.js +193 -0
- package/dist/commands/archive/plan/contracts/openapi.js.map +1 -0
- package/dist/commands/archive/plan/contracts/verdict-lines.js +103 -0
- package/dist/commands/archive/plan/contracts/verdict-lines.js.map +1 -0
- package/dist/commands/archive/plan/document/head.js +151 -0
- package/dist/commands/archive/plan/document/head.js.map +1 -0
- package/dist/commands/archive/plan/document/links.js +284 -0
- package/dist/commands/archive/plan/document/links.js.map +1 -0
- package/dist/commands/archive/plan/document/run.js +136 -0
- package/dist/commands/archive/plan/document/run.js.map +1 -0
- package/dist/commands/archive/plan/gate.js +319 -0
- package/dist/commands/archive/plan/gate.js.map +1 -0
- package/dist/commands/archive/plan/landscape.js +298 -0
- package/dist/commands/archive/plan/landscape.js.map +1 -0
- package/dist/commands/archive/plan/model/extending.js +85 -0
- package/dist/commands/archive/plan/model/extending.js.map +1 -0
- package/dist/commands/archive/plan/refusal.js +106 -0
- package/dist/commands/archive/plan/refusal.js.map +1 -0
- package/dist/commands/archive/plan/specs.js +318 -0
- package/dist/commands/archive/plan/specs.js.map +1 -0
- package/dist/commands/archive/plan/state.js +30 -0
- package/dist/commands/archive/plan/state.js.map +1 -0
- package/dist/commands/archive/run.js +355 -0
- package/dist/commands/archive/run.js.map +1 -0
- package/dist/commands/archive/shipped.js +49 -0
- package/dist/commands/archive/shipped.js.map +1 -0
- package/dist/commands/context/context.js +166 -0
- package/dist/commands/context/context.js.map +1 -0
- package/dist/commands/context/print.js +305 -0
- package/dist/commands/context/print.js.map +1 -0
- package/dist/commands/delta/delta.js +367 -0
- package/dist/commands/delta/delta.js.map +1 -0
- package/dist/commands/delta/print.js +221 -0
- package/dist/commands/delta/print.js.map +1 -0
- package/dist/commands/dependencies.js +6 -8
- package/dist/commands/dependencies.js.map +1 -1
- package/dist/commands/diff/diff.js +86 -0
- package/dist/commands/diff/diff.js.map +1 -0
- package/dist/commands/diff/print.js +38 -0
- package/dist/commands/diff/print.js.map +1 -0
- package/dist/commands/doctor.js +65 -5
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/explain/explain.js +227 -0
- package/dist/commands/explain/explain.js.map +1 -0
- package/dist/commands/explore.js +39 -28
- package/dist/commands/explore.js.map +1 -1
- package/dist/commands/gate/gate.js +152 -0
- package/dist/commands/gate/gate.js.map +1 -0
- package/dist/commands/gate/print.js +66 -0
- package/dist/commands/gate/print.js.map +1 -0
- package/dist/commands/gherkin/commit.js +105 -0
- package/dist/commands/gherkin/commit.js.map +1 -0
- package/dist/commands/gherkin/gherkin.js +262 -0
- package/dist/commands/gherkin/gherkin.js.map +1 -0
- package/dist/commands/gherkin/reconcile.js +146 -0
- package/dist/commands/gherkin/reconcile.js.map +1 -0
- package/dist/commands/gherkin/render.js +77 -0
- package/dist/commands/gherkin/render.js.map +1 -0
- package/dist/commands/init/example.js +204 -0
- package/dist/commands/init/example.js.map +1 -0
- package/dist/commands/init/first-hour.js +72 -0
- package/dist/commands/init/first-hour.js.map +1 -0
- package/dist/commands/{init.js → init/init.js} +142 -71
- package/dist/commands/init/init.js.map +1 -0
- package/dist/commands/init/mcp.js +131 -0
- package/dist/commands/init/mcp.js.map +1 -0
- package/dist/commands/init/options.js +78 -0
- package/dist/commands/init/options.js.map +1 -0
- package/dist/commands/instructions.js +72 -14
- package/dist/commands/instructions.js.map +1 -1
- package/dist/commands/list/campaign/campaign.js +63 -0
- package/dist/commands/list/campaign/campaign.js.map +1 -0
- package/dist/commands/list/campaign/owners.js +65 -0
- package/dist/commands/list/campaign/owners.js.map +1 -0
- package/dist/commands/list/json.js +155 -0
- package/dist/commands/list/json.js.map +1 -0
- package/dist/commands/list/list.js +358 -0
- package/dist/commands/list/list.js.map +1 -0
- package/dist/commands/list/print.js +344 -0
- package/dist/commands/list/print.js.map +1 -0
- package/dist/commands/list/review.js +120 -0
- package/dist/commands/list/review.js.map +1 -0
- package/dist/commands/list/suites/suites.js +140 -0
- package/dist/commands/list/suites/suites.js.map +1 -0
- package/dist/commands/list/views.js +108 -0
- package/dist/commands/list/views.js.map +1 -0
- package/dist/commands/mcp/dispatch.js +238 -0
- package/dist/commands/mcp/dispatch.js.map +1 -0
- package/dist/commands/mcp/mcp.js +75 -0
- package/dist/commands/mcp/mcp.js.map +1 -0
- package/dist/commands/mcp/serve.js +55 -0
- package/dist/commands/mcp/serve.js.map +1 -0
- package/dist/commands/migrate-openspec/materialize/active.js +175 -0
- package/dist/commands/migrate-openspec/materialize/active.js.map +1 -0
- package/dist/commands/migrate-openspec/materialize/feature.js +41 -0
- package/dist/commands/migrate-openspec/materialize/feature.js.map +1 -0
- package/dist/commands/migrate-openspec/materialize/living.js +62 -0
- package/dist/commands/migrate-openspec/materialize/living.js.map +1 -0
- package/dist/commands/migrate-openspec/materialize/stage.js +143 -0
- package/dist/commands/migrate-openspec/materialize/stage.js.map +1 -0
- package/dist/commands/migrate-openspec/materialize/target.js +219 -0
- package/dist/commands/migrate-openspec/materialize/target.js.map +1 -0
- package/dist/commands/migrate-openspec/migrate-openspec.js +142 -0
- package/dist/commands/migrate-openspec/migrate-openspec.js.map +1 -0
- package/dist/commands/migrate-openspec/openspec/decisions.js +86 -0
- package/dist/commands/migrate-openspec/openspec/decisions.js.map +1 -0
- package/dist/commands/migrate-openspec/openspec/error.js +18 -0
- package/dist/commands/migrate-openspec/openspec/error.js.map +1 -0
- package/dist/commands/migrate-openspec/openspec/mapping.js +162 -0
- package/dist/commands/migrate-openspec/openspec/mapping.js.map +1 -0
- package/dist/commands/migrate-openspec/openspec/paths.js +40 -0
- package/dist/commands/migrate-openspec/openspec/paths.js.map +1 -0
- package/dist/commands/migrate-openspec/openspec/read.js +49 -0
- package/dist/commands/migrate-openspec/openspec/read.js.map +1 -0
- package/dist/commands/migrate-openspec/print.js +89 -0
- package/dist/commands/migrate-openspec/print.js.map +1 -0
- package/dist/commands/new/capability-template.js +118 -0
- package/dist/commands/new/capability-template.js.map +1 -0
- package/dist/commands/new/commit.js +62 -0
- package/dist/commands/new/commit.js.map +1 -0
- package/dist/commands/new/modifies.js +206 -0
- package/dist/commands/new/modifies.js.map +1 -0
- package/dist/commands/new/new.js +328 -0
- package/dist/commands/new/new.js.map +1 -0
- package/dist/commands/new/templates.js +279 -0
- package/dist/commands/new/templates.js.map +1 -0
- package/dist/commands/open.js +199 -0
- package/dist/commands/open.js.map +1 -0
- package/dist/commands/policy/format.js +152 -0
- package/dist/commands/policy/format.js.map +1 -0
- package/dist/commands/{docs-repo-gate.js → policy/gate.js} +38 -11
- package/dist/commands/policy/gate.js.map +1 -0
- package/dist/commands/rebase/edit.js +106 -0
- package/dist/commands/rebase/edit.js.map +1 -0
- package/dist/commands/rebase/living.js +185 -0
- package/dist/commands/rebase/living.js.map +1 -0
- package/dist/commands/rebase/plan.js +245 -0
- package/dist/commands/rebase/plan.js.map +1 -0
- package/dist/commands/rebase/rebase.js +300 -0
- package/dist/commands/rebase/rebase.js.map +1 -0
- package/dist/commands/seed/commit.js +221 -0
- package/dist/commands/seed/commit.js.map +1 -0
- package/dist/commands/seed/plan.js +278 -0
- package/dist/commands/seed/plan.js.map +1 -0
- package/dist/commands/seed/seed.js +174 -0
- package/dist/commands/seed/seed.js.map +1 -0
- package/dist/commands/show/feature.js +182 -0
- package/dist/commands/show/feature.js.map +1 -0
- package/dist/commands/show/introduced.js +157 -0
- package/dist/commands/show/introduced.js.map +1 -0
- package/dist/commands/show/marks.js +53 -0
- package/dist/commands/show/marks.js.map +1 -0
- package/dist/commands/show/service.js +239 -0
- package/dist/commands/show/service.js.map +1 -0
- package/dist/commands/show/show.js +87 -0
- package/dist/commands/show/show.js.map +1 -0
- package/dist/commands/status/fleet-next.js +90 -0
- package/dist/commands/status/fleet-next.js.map +1 -0
- package/dist/commands/status/json.js +47 -0
- package/dist/commands/status/json.js.map +1 -0
- package/dist/commands/status/print.js +209 -0
- package/dist/commands/status/print.js.map +1 -0
- package/dist/commands/status/status.js +115 -0
- package/dist/commands/status/status.js.map +1 -0
- package/dist/commands/steps/steps.js +269 -0
- package/dist/commands/steps/steps.js.map +1 -0
- package/dist/commands/subsystem/edit.js +192 -0
- package/dist/commands/subsystem/edit.js.map +1 -0
- package/dist/commands/subsystem/move.js +325 -0
- package/dist/commands/subsystem/move.js.map +1 -0
- package/dist/commands/subsystem/query.js +113 -0
- package/dist/commands/subsystem/query.js.map +1 -0
- package/dist/commands/subsystem/subsystem.js +98 -0
- package/dist/commands/subsystem/subsystem.js.map +1 -0
- package/dist/commands/subsystem/sync.js +318 -0
- package/dist/commands/subsystem/sync.js.map +1 -0
- package/dist/commands/subsystem/txn/exclude.js +132 -0
- package/dist/commands/subsystem/txn/exclude.js.map +1 -0
- package/dist/commands/subsystem/txn/links.js +128 -0
- package/dist/commands/subsystem/txn/links.js.map +1 -0
- package/dist/commands/subsystem/txn/report.js +174 -0
- package/dist/commands/subsystem/txn/report.js.map +1 -0
- package/dist/commands/subsystem/txn/txn.js +196 -0
- package/dist/commands/subsystem/txn/txn.js.map +1 -0
- package/dist/commands/subsystem/txn/views.js +249 -0
- package/dist/commands/subsystem/txn/views.js.map +1 -0
- package/dist/commands/tasks/actions.js +107 -0
- package/dist/commands/tasks/actions.js.map +1 -0
- package/dist/commands/tasks/render.js +253 -0
- package/dist/commands/tasks/render.js.map +1 -0
- package/dist/commands/tasks/tasks.js +119 -0
- package/dist/commands/tasks/tasks.js.map +1 -0
- package/dist/commands/unarchive/manifest.js +176 -0
- package/dist/commands/unarchive/manifest.js.map +1 -0
- package/dist/commands/unarchive/restore.js +254 -0
- package/dist/commands/unarchive/restore.js.map +1 -0
- package/dist/commands/unarchive/unarchive.js +59 -0
- package/dist/commands/unarchive/unarchive.js.map +1 -0
- package/dist/commands/validate/arch-coverage.js +245 -0
- package/dist/commands/validate/arch-coverage.js.map +1 -0
- package/dist/commands/validate/checks/fleet-shape.js +204 -0
- package/dist/commands/validate/checks/fleet-shape.js.map +1 -0
- package/dist/commands/validate/checks/health-deps.js +58 -0
- package/dist/commands/validate/checks/health-deps.js.map +1 -0
- package/dist/commands/validate/checks/introduced.js +102 -0
- package/dist/commands/validate/checks/introduced.js.map +1 -0
- package/dist/commands/validate/checks/requirements.js +264 -0
- package/dist/commands/validate/checks/requirements.js.map +1 -0
- package/dist/commands/validate/checks/sources.js +85 -0
- package/dist/commands/validate/checks/sources.js.map +1 -0
- package/dist/commands/validate/coverage/covers-after.js +105 -0
- package/dist/commands/validate/coverage/covers-after.js.map +1 -0
- package/dist/commands/validate/feature.js +222 -0
- package/dist/commands/validate/feature.js.map +1 -0
- package/dist/commands/validate/fleet/census.js +93 -0
- package/dist/commands/validate/fleet/census.js.map +1 -0
- package/dist/commands/validate/fleet/kind-tags.js +39 -0
- package/dist/commands/validate/fleet/kind-tags.js.map +1 -0
- package/dist/commands/validate/fleet/landscape.js +371 -0
- package/dist/commands/validate/fleet/landscape.js.map +1 -0
- package/dist/commands/validate/fleet/load.js +118 -0
- package/dist/commands/validate/fleet/load.js.map +1 -0
- package/dist/commands/validate/fleet/map/attest.js +98 -0
- package/dist/commands/validate/fleet/map/attest.js.map +1 -0
- package/dist/commands/validate/fleet/map/bindings.js +107 -0
- package/dist/commands/validate/fleet/map/bindings.js.map +1 -0
- package/dist/commands/validate/fleet/map/consumers.js +244 -0
- package/dist/commands/validate/fleet/map/consumers.js.map +1 -0
- package/dist/commands/validate/fleet/map/isolation.js +116 -0
- package/dist/commands/validate/fleet/map/isolation.js.map +1 -0
- package/dist/commands/validate/fleet/map/usecases.js +54 -0
- package/dist/commands/validate/fleet/map/usecases.js.map +1 -0
- package/dist/commands/validate/fleet/obligations.js +266 -0
- package/dist/commands/validate/fleet/obligations.js.map +1 -0
- package/dist/commands/validate/fleet/scorecard/adoption.js +102 -0
- package/dist/commands/validate/fleet/scorecard/adoption.js.map +1 -0
- package/dist/commands/validate/fleet/scorecard/contracts.js +98 -0
- package/dist/commands/validate/fleet/scorecard/contracts.js.map +1 -0
- package/dist/commands/validate/fleet/scorecard/print.js +71 -0
- package/dist/commands/validate/fleet/scorecard/print.js.map +1 -0
- package/dist/commands/validate/fleet/scorecard/scorecard.js +162 -0
- package/dist/commands/validate/fleet/scorecard/scorecard.js.map +1 -0
- package/dist/commands/validate/fleet/usecases/place.js +13 -0
- package/dist/commands/validate/fleet/usecases/place.js.map +1 -0
- package/dist/commands/validate/fleet/views/fleet-project.js +217 -0
- package/dist/commands/validate/fleet/views/fleet-project.js.map +1 -0
- package/dist/commands/validate/fleet/views/ids.js +75 -0
- package/dist/commands/validate/fleet/views/ids.js.map +1 -0
- package/dist/commands/validate/fleet/views/projects.js +278 -0
- package/dist/commands/validate/fleet/views/projects.js.map +1 -0
- package/dist/commands/validate/fleet/views/root-documents.js +83 -0
- package/dist/commands/validate/fleet/views/root-documents.js.map +1 -0
- package/dist/commands/validate/fleet/views/stale.js +52 -0
- package/dist/commands/validate/fleet/views/stale.js.map +1 -0
- package/dist/commands/validate/links/corpus.js +89 -0
- package/dist/commands/validate/links/corpus.js.map +1 -0
- package/dist/commands/validate/links/glossary.js +75 -0
- package/dist/commands/validate/links/glossary.js.map +1 -0
- package/dist/commands/validate/render/repeats.js +63 -0
- package/dist/commands/validate/render/repeats.js.map +1 -0
- package/dist/commands/validate/render/rollups.js +115 -0
- package/dist/commands/validate/render/rollups.js.map +1 -0
- package/dist/commands/validate/render/text.js +199 -0
- package/dist/commands/validate/render/text.js.map +1 -0
- package/dist/commands/validate/report.js +145 -0
- package/dist/commands/validate/report.js.map +1 -0
- package/dist/commands/validate/scope.js +113 -0
- package/dist/commands/validate/scope.js.map +1 -0
- package/dist/commands/validate/service/api.js +252 -0
- package/dist/commands/validate/service/api.js.map +1 -0
- package/dist/commands/validate/service/contracts/generated.js +134 -0
- package/dist/commands/validate/service/contracts/generated.js.map +1 -0
- package/dist/commands/validate/service/events/events.js +241 -0
- package/dist/commands/validate/service/events/events.js.map +1 -0
- package/dist/commands/validate/service/events/message-producers.js +77 -0
- package/dist/commands/validate/service/events/message-producers.js.map +1 -0
- package/dist/commands/validate/service/evidence-pins.js +177 -0
- package/dist/commands/validate/service/evidence-pins.js.map +1 -0
- package/dist/commands/validate/service/model/diverged.js +226 -0
- package/dist/commands/validate/service/model/diverged.js.map +1 -0
- package/dist/commands/validate/service/model/grade.js +163 -0
- package/dist/commands/validate/service/model/grade.js.map +1 -0
- package/dist/commands/validate/service/service.js +310 -0
- package/dist/commands/validate/service/service.js.map +1 -0
- package/dist/commands/validate/service/specs.js +279 -0
- package/dist/commands/validate/service/specs.js.map +1 -0
- package/dist/commands/validate/service/spine.js +148 -0
- package/dist/commands/validate/service/spine.js.map +1 -0
- package/dist/commands/validate/service/usecases/tags.js +113 -0
- package/dist/commands/validate/service/usecases/tags.js.map +1 -0
- package/dist/commands/validate/service/usecases/usecases.js +209 -0
- package/dist/commands/validate/service/usecases/usecases.js.map +1 -0
- package/dist/commands/validate/validate.js +363 -0
- package/dist/commands/validate/validate.js.map +1 -0
- package/dist/commands/verify/cross/diff.js +178 -0
- package/dist/commands/verify/cross/diff.js.map +1 -0
- package/dist/commands/verify/evidence/contract.js +32 -0
- package/dist/commands/verify/evidence/contract.js.map +1 -0
- package/dist/commands/verify/evidence/pins.js +52 -0
- package/dist/commands/verify/evidence/pins.js.map +1 -0
- package/dist/commands/verify/evidence/read.js +81 -0
- package/dist/commands/verify/evidence/read.js.map +1 -0
- package/dist/commands/verify/frozen.js +263 -0
- package/dist/commands/verify/frozen.js.map +1 -0
- package/dist/commands/verify/record.js +278 -0
- package/dist/commands/verify/record.js.map +1 -0
- package/dist/commands/verify/report.js +206 -0
- package/dist/commands/verify/report.js.map +1 -0
- package/dist/commands/verify/results.js +328 -0
- package/dist/commands/verify/results.js.map +1 -0
- package/dist/commands/verify/verify.js +220 -0
- package/dist/commands/verify/verify.js.map +1 -0
- package/dist/commands/vouch/contract.js +11 -0
- package/dist/commands/vouch/contract.js.map +1 -0
- package/dist/commands/vouch/pack/contract.js +2 -0
- package/dist/commands/vouch/pack/contract.js.map +1 -0
- package/dist/commands/vouch/pack/pack.js +266 -0
- package/dist/commands/vouch/pack/pack.js.map +1 -0
- package/dist/commands/vouch/pack/print.js +266 -0
- package/dist/commands/vouch/pack/print.js.map +1 -0
- package/dist/commands/vouch/pack/sections.js +141 -0
- package/dist/commands/vouch/pack/sections.js.map +1 -0
- package/dist/commands/vouch/prompt/confirm.js +46 -0
- package/dist/commands/vouch/prompt/confirm.js.map +1 -0
- package/dist/commands/vouch/report.js +101 -0
- package/dist/commands/vouch/report.js.map +1 -0
- package/dist/commands/vouch/run.js +230 -0
- package/dist/commands/vouch/run.js.map +1 -0
- package/dist/commands/vouch/sample/plan.js +111 -0
- package/dist/commands/vouch/sample/plan.js.map +1 -0
- package/dist/commands/vouch/sample/print.js +109 -0
- package/dist/commands/vouch/sample/print.js.map +1 -0
- package/dist/commands/vouch/vet/verify.js +155 -0
- package/dist/commands/vouch/vet/verify.js.map +1 -0
- package/dist/commands/vouch/vouch.js +169 -0
- package/dist/commands/vouch/vouch.js.map +1 -0
- package/dist/core/agent/agents-md/command-map.js +299 -0
- package/dist/core/agent/agents-md/command-map.js.map +1 -0
- package/dist/core/agent/agents-md/map/explain.js +46 -0
- package/dist/core/agent/agents-md/map/explain.js.map +1 -0
- package/dist/core/agent/agents-md/map/lenses/context.js +50 -0
- package/dist/core/agent/agents-md/map/lenses/context.js.map +1 -0
- package/dist/core/agent/agents-md/map/lenses/diff.js +59 -0
- package/dist/core/agent/agents-md/map/lenses/diff.js.map +1 -0
- package/dist/core/agent/agents-md/map/lenses/gate.js +65 -0
- package/dist/core/agent/agents-md/map/lenses/gate.js.map +1 -0
- package/dist/core/agent/agents-md/map/mcp.js +44 -0
- package/dist/core/agent/agents-md/map/mcp.js.map +1 -0
- package/dist/core/agent/agents-md/map/status.js +78 -0
- package/dist/core/agent/agents-md/map/status.js.map +1 -0
- package/dist/core/agent/agents-md/map/subsystem.js +104 -0
- package/dist/core/agent/agents-md/map/subsystem.js.map +1 -0
- package/dist/core/agent/agents-md/map/usecases.js +138 -0
- package/dist/core/agent/agents-md/map/usecases.js.map +1 -0
- package/dist/core/agent/agents-md/refusals.js +273 -0
- package/dist/core/agent/agents-md/refusals.js.map +1 -0
- package/dist/core/agent/agents-md.js +203 -0
- package/dist/core/agent/agents-md.js.map +1 -0
- package/dist/core/{agents-stamp.js → agent/agents-stamp.js} +60 -0
- package/dist/core/agent/agents-stamp.js.map +1 -0
- package/dist/core/agent/contract.js +2 -0
- package/dist/core/agent/contract.js.map +1 -0
- package/dist/core/agent/protocol.js +193 -0
- package/dist/core/agent/protocol.js.map +1 -0
- package/dist/core/agent/scaffold.js +254 -0
- package/dist/core/agent/scaffold.js.map +1 -0
- package/dist/core/agent/support/report.js +144 -0
- package/dist/core/agent/support/report.js.map +1 -0
- package/dist/core/agent/tools/dialects.js +151 -0
- package/dist/core/agent/tools/dialects.js.map +1 -0
- package/dist/core/agent/tools/registry.js +193 -0
- package/dist/core/agent/tools/registry.js.map +1 -0
- package/dist/core/agent/workflows/adopt.js +280 -0
- package/dist/core/agent/workflows/adopt.js.map +1 -0
- package/dist/core/agent/workflows/check.js +373 -0
- package/dist/core/agent/workflows/check.js.map +1 -0
- package/dist/core/agent/workflows/closing.js +323 -0
- package/dist/core/agent/workflows/closing.js.map +1 -0
- package/dist/core/agent/workflows/feature.js +220 -0
- package/dist/core/agent/workflows/feature.js.map +1 -0
- package/dist/core/agent/workflows/implement.js +188 -0
- package/dist/core/agent/workflows/implement.js.map +1 -0
- package/dist/core/agent/workflows/reference/authoring.js +311 -0
- package/dist/core/agent/workflows/reference/authoring.js.map +1 -0
- package/dist/core/agent/workflows/reference/codes.js +67 -0
- package/dist/core/agent/workflows/reference/codes.js.map +1 -0
- package/dist/core/agent/workflows/reference/done-check.js +210 -0
- package/dist/core/agent/workflows/reference/done-check.js.map +1 -0
- package/dist/core/agent/workflows/reference/drawing/drawing.js +253 -0
- package/dist/core/agent/workflows/reference/drawing/drawing.js.map +1 -0
- package/dist/core/agent/workflows/reference/reference.js +19 -0
- package/dist/core/agent/workflows/reference/reference.js.map +1 -0
- package/dist/core/agent/workflows/reference/spine.js +338 -0
- package/dist/core/agent/workflows/reference/spine.js.map +1 -0
- package/dist/core/asyncapi/baseline/plan.js +43 -0
- package/dist/core/asyncapi/baseline/plan.js.map +1 -0
- package/dist/core/asyncapi/baseline/surfaces.js +54 -0
- package/dist/core/asyncapi/baseline/surfaces.js.map +1 -0
- package/dist/core/asyncapi/depth.js +164 -0
- package/dist/core/asyncapi/depth.js.map +1 -0
- package/dist/core/asyncapi/digest.js +146 -0
- package/dist/core/asyncapi/digest.js.map +1 -0
- package/dist/core/asyncapi/merge/components.js +92 -0
- package/dist/core/asyncapi/merge/components.js.map +1 -0
- package/dist/core/asyncapi/merge/error.js +38 -0
- package/dist/core/asyncapi/merge/error.js.map +1 -0
- package/dist/core/asyncapi/merge/markers.js +290 -0
- package/dist/core/asyncapi/merge/markers.js.map +1 -0
- package/dist/core/asyncapi/merge/merge.js +195 -0
- package/dist/core/asyncapi/merge/merge.js.map +1 -0
- package/dist/core/asyncapi/merge/pin.js +83 -0
- package/dist/core/asyncapi/merge/pin.js.map +1 -0
- package/dist/core/asyncapi/model.js +11 -0
- package/dist/core/asyncapi/model.js.map +1 -0
- package/dist/core/asyncapi/producers.js +50 -0
- package/dist/core/asyncapi/producers.js.map +1 -0
- package/dist/core/asyncapi/read.js +263 -0
- package/dist/core/asyncapi/read.js.map +1 -0
- package/dist/core/brief/brief.js +285 -0
- package/dist/core/brief/brief.js.map +1 -0
- package/dist/core/brief/checks.js +385 -0
- package/dist/core/brief/checks.js.map +1 -0
- package/dist/core/brief/landscape.js +273 -0
- package/dist/core/brief/landscape.js.map +1 -0
- package/dist/core/brief/map/extend.js +84 -0
- package/dist/core/brief/map/extend.js.map +1 -0
- package/dist/core/brief/map/owed.js +266 -0
- package/dist/core/brief/map/owed.js.map +1 -0
- package/dist/core/brief/targets.js +304 -0
- package/dist/core/brief/targets.js.map +1 -0
- package/dist/core/brief/unchecked.js +58 -0
- package/dist/core/brief/unchecked.js.map +1 -0
- package/dist/core/c4/arch.js +190 -0
- package/dist/core/c4/arch.js.map +1 -0
- package/dist/core/c4/direction/direction.js +114 -0
- package/dist/core/c4/direction/direction.js.map +1 -0
- package/dist/core/c4/likec4.js +243 -0
- package/dist/core/c4/likec4.js.map +1 -0
- package/dist/core/c4/locate/unlocated.js +150 -0
- package/dist/core/c4/locate/unlocated.js.map +1 -0
- package/dist/core/c4/parsed/deployment.js +160 -0
- package/dist/core/c4/parsed/deployment.js.map +1 -0
- package/dist/core/c4/parsed/dynamic-views.js +132 -0
- package/dist/core/c4/parsed/dynamic-views.js.map +1 -0
- package/dist/core/c4/parsed/specification.js +78 -0
- package/dist/core/c4/parsed/specification.js.map +1 -0
- package/dist/core/c4/parsed/values.js +110 -0
- package/dist/core/c4/parsed/values.js.map +1 -0
- package/dist/core/c4/parsed/view-ids.js +113 -0
- package/dist/core/c4/parsed/view-ids.js.map +1 -0
- package/dist/core/c4/prefetch/fleet.js +134 -0
- package/dist/core/c4/prefetch/fleet.js.map +1 -0
- package/dist/core/c4/project/architecture.js +161 -0
- package/dist/core/c4/project/architecture.js.map +1 -0
- package/dist/core/c4/project/batch.js +140 -0
- package/dist/core/c4/project/batch.js.map +1 -0
- package/dist/core/c4/project/documents.js +89 -0
- package/dist/core/c4/project/documents.js.map +1 -0
- package/dist/core/c4/project/load.js +219 -0
- package/dist/core/c4/project/load.js.map +1 -0
- package/dist/core/c4/project/staged.js +277 -0
- package/dist/core/c4/project/staged.js.map +1 -0
- package/dist/core/c4/resolve/attested.js +0 -0
- package/dist/core/c4/resolve/attested.js.map +1 -0
- package/dist/core/c4/resolve/external.js +51 -0
- package/dist/core/c4/resolve/external.js.map +1 -0
- package/dist/core/c4/resolve/service.js +174 -0
- package/dist/core/c4/resolve/service.js.map +1 -0
- package/dist/core/c4/resolve/steps.js +290 -0
- package/dist/core/c4/resolve/steps.js.map +1 -0
- package/dist/core/c4/resolve/systems.js +154 -0
- package/dist/core/c4/resolve/systems.js.map +1 -0
- package/dist/core/c4/root-project/exclude.js +352 -0
- package/dist/core/c4/root-project/exclude.js.map +1 -0
- package/dist/core/c4/seed/fleet-file.js +201 -0
- package/dist/core/c4/seed/fleet-file.js.map +1 -0
- package/dist/core/c4/seed/items.js +91 -0
- package/dist/core/c4/seed/items.js.map +1 -0
- package/dist/core/c4/seed/stamp.js +48 -0
- package/dist/core/c4/seed/stamp.js.map +1 -0
- package/dist/core/c4/seed/template.js +173 -0
- package/dist/core/c4/seed/template.js.map +1 -0
- package/dist/core/c4/service-model/created/models.js +96 -0
- package/dist/core/c4/service-model/created/models.js.map +1 -0
- package/dist/core/c4/service-model/documents.js +47 -0
- package/dist/core/c4/service-model/documents.js.map +1 -0
- package/dist/core/c4/service-model/fleet/extending.js +82 -0
- package/dist/core/c4/service-model/fleet/extending.js.map +1 -0
- package/dist/core/c4/service-model/load.js +165 -0
- package/dist/core/c4/service-model/load.js.map +1 -0
- package/dist/core/c4/service-model/renderer.js +128 -0
- package/dist/core/c4/service-model/renderer.js.map +1 -0
- package/dist/core/c4/service-model/shape.js +106 -0
- package/dist/core/c4/service-model/shape.js.map +1 -0
- package/dist/core/c4/service-model/slice.js +188 -0
- package/dist/core/c4/service-model/slice.js.map +1 -0
- package/dist/core/c4/source-mask.js +369 -0
- package/dist/core/c4/source-mask.js.map +1 -0
- package/dist/core/c4/source-scan.js +308 -0
- package/dist/core/c4/source-scan.js.map +1 -0
- package/dist/core/c4/splice/authored-source.js +167 -0
- package/dist/core/c4/splice/authored-source.js.map +1 -0
- package/dist/core/c4/splice/contract.js +30 -0
- package/dist/core/c4/splice/contract.js.map +1 -0
- package/dist/core/c4/splice/delta-blocks.js +126 -0
- package/dist/core/c4/splice/delta-blocks.js.map +1 -0
- package/dist/core/c4/splice/identity/declared.js +87 -0
- package/dist/core/c4/splice/identity/declared.js.map +1 -0
- package/dist/core/c4/splice/identity/edges.js +73 -0
- package/dist/core/c4/splice/identity/edges.js.map +1 -0
- package/dist/core/c4/splice/identity/existing.js +80 -0
- package/dist/core/c4/splice/identity/existing.js.map +1 -0
- package/dist/core/c4/splice/identity/interior.js +80 -0
- package/dist/core/c4/splice/identity/interior.js.map +1 -0
- package/dist/core/c4/splice/identity/owner.js +50 -0
- package/dist/core/c4/splice/identity/owner.js.map +1 -0
- package/dist/core/c4/splice/landscape-merge.js +337 -0
- package/dist/core/c4/splice/landscape-merge.js.map +1 -0
- package/dist/core/c4/splice/model/merge.js +151 -0
- package/dist/core/c4/splice/model/merge.js.map +1 -0
- package/dist/core/c4/splice/placement.js +298 -0
- package/dist/core/c4/splice/placement.js.map +1 -0
- package/dist/core/c4/splice/text/spot.js +131 -0
- package/dist/core/c4/splice/text/spot.js.map +1 -0
- package/dist/core/c4/workspace.js +166 -0
- package/dist/core/c4/workspace.js.map +1 -0
- package/dist/core/capabilities/authoring/notes.js +141 -0
- package/dist/core/capabilities/authoring/notes.js.map +1 -0
- package/dist/core/capabilities/capabilities.js +124 -0
- package/dist/core/capabilities/capabilities.js.map +1 -0
- package/dist/core/capabilities/delta/doc.js +47 -0
- package/dist/core/capabilities/delta/doc.js.map +1 -0
- package/dist/core/capabilities/delta/overlay.js +129 -0
- package/dist/core/capabilities/delta/overlay.js.map +1 -0
- package/dist/core/capabilities/delta/summary.js +57 -0
- package/dist/core/capabilities/delta/summary.js.map +1 -0
- package/dist/core/capabilities/delta/tree.js +43 -0
- package/dist/core/capabilities/delta/tree.js.map +1 -0
- package/dist/core/capabilities/delta/uncovered.js +222 -0
- package/dist/core/capabilities/delta/uncovered.js.map +1 -0
- package/dist/core/capabilities/findings.js +338 -0
- package/dist/core/capabilities/findings.js.map +1 -0
- package/dist/core/capabilities/realizes/findings.js +174 -0
- package/dist/core/capabilities/realizes/findings.js.map +1 -0
- package/dist/core/capabilities/realizes/join.js +123 -0
- package/dist/core/capabilities/realizes/join.js.map +1 -0
- package/dist/core/capabilities/rollup.js +205 -0
- package/dist/core/capabilities/rollup.js.map +1 -0
- package/dist/core/capabilities/tree.js +104 -0
- package/dist/core/capabilities/tree.js.map +1 -0
- package/dist/core/capabilities/usecase-join.js +267 -0
- package/dist/core/capabilities/usecase-join.js.map +1 -0
- package/dist/core/coherence/authoring/scaffold.js +185 -0
- package/dist/core/coherence/authoring/scaffold.js.map +1 -0
- package/dist/core/coherence/authoring/sentinels.js +75 -0
- package/dist/core/coherence/authoring/sentinels.js.map +1 -0
- package/dist/core/coherence/calls/called.js +52 -0
- package/dist/core/coherence/calls/called.js.map +1 -0
- package/dist/core/coherence/coherence.js +332 -0
- package/dist/core/coherence/coherence.js.map +1 -0
- package/dist/core/coherence/consumed/operations.js +70 -0
- package/dist/core/coherence/consumed/operations.js.map +1 -0
- package/dist/core/coherence/consumed/refusal.js +38 -0
- package/dist/core/coherence/consumed/refusal.js.map +1 -0
- package/dist/core/coherence/covers/health.js +85 -0
- package/dist/core/coherence/covers/health.js.map +1 -0
- package/dist/core/coherence/declared.js +295 -0
- package/dist/core/coherence/declared.js.map +1 -0
- package/dist/core/coherence/events/declared.js +191 -0
- package/dist/core/coherence/events/declared.js.map +1 -0
- package/dist/core/coherence/events/events.js +335 -0
- package/dist/core/coherence/events/events.js.map +1 -0
- package/dist/core/coherence/events/grades.js +189 -0
- package/dist/core/coherence/events/grades.js.map +1 -0
- package/dist/core/coherence/events/lookups.js +63 -0
- package/dist/core/coherence/events/lookups.js.map +1 -0
- package/dist/core/coherence/events/produced.js +100 -0
- package/dist/core/coherence/events/produced.js.map +1 -0
- package/dist/core/coherence/living.js +198 -0
- package/dist/core/coherence/living.js.map +1 -0
- package/dist/core/coherence/lookups.js +95 -0
- package/dist/core/coherence/lookups.js.map +1 -0
- package/dist/core/coherence/pending.js +39 -0
- package/dist/core/coherence/pending.js.map +1 -0
- package/dist/core/coherence/retired/archived.js +285 -0
- package/dist/core/coherence/retired/archived.js.map +1 -0
- package/dist/core/coherence/retired/event-pair.js +62 -0
- package/dist/core/coherence/retired/event-pair.js.map +1 -0
- package/dist/core/coherence/retired/merged.js +79 -0
- package/dist/core/coherence/retired/merged.js.map +1 -0
- package/dist/core/coherence/retired/retirement.js +49 -0
- package/dist/core/coherence/retired/retirement.js.map +1 -0
- package/dist/core/coherence/retired/revival/arrivals.js +131 -0
- package/dist/core/coherence/retired/revival/arrivals.js.map +1 -0
- package/dist/core/coherence/retired/revival/revived.js +297 -0
- package/dist/core/coherence/retired/revival/revived.js.map +1 -0
- package/dist/core/conflict-markers.js +60 -0
- package/dist/core/conflict-markers.js.map +1 -0
- package/dist/core/consumers/after.js +113 -0
- package/dist/core/consumers/after.js.map +1 -0
- package/dist/core/consumers/consumers.js +296 -0
- package/dist/core/consumers/consumers.js.map +1 -0
- package/dist/core/consumers/current.js +211 -0
- package/dist/core/consumers/current.js.map +1 -0
- package/dist/core/consumers/scan.js +46 -0
- package/dist/core/consumers/scan.js.map +1 -0
- package/dist/core/consumers/state.js +27 -0
- package/dist/core/consumers/state.js.map +1 -0
- package/dist/core/delta/claims.js +73 -0
- package/dist/core/delta/claims.js.map +1 -0
- package/dist/core/delta/delta.js +341 -0
- package/dist/core/delta/delta.js.map +1 -0
- package/dist/core/delta/document.js +177 -0
- package/dist/core/delta/document.js.map +1 -0
- package/dist/core/delta/scope.js +48 -0
- package/dist/core/delta/scope.js.map +1 -0
- package/dist/core/delta/select.js +237 -0
- package/dist/core/delta/select.js.map +1 -0
- package/dist/core/dependencies/dependencies.js +141 -0
- package/dist/core/dependencies/dependencies.js.map +1 -0
- package/dist/core/dependencies/facts.js +165 -0
- package/dist/core/dependencies/facts.js.map +1 -0
- package/dist/core/dependencies/fanin.js +88 -0
- package/dist/core/dependencies/fanin.js.map +1 -0
- package/dist/core/dependencies/graph.js +106 -0
- package/dist/core/dependencies/graph.js.map +1 -0
- package/dist/core/deployment/delta.js +191 -0
- package/dist/core/deployment/delta.js.map +1 -0
- package/dist/core/deployment/objects.js +145 -0
- package/dist/core/deployment/objects.js.map +1 -0
- package/dist/core/diff/base-git.js +230 -0
- package/dist/core/diff/base-git.js.map +1 -0
- package/dist/core/diff/base-state.js +237 -0
- package/dist/core/diff/base-state.js.map +1 -0
- package/dist/core/diff/joins.js +136 -0
- package/dist/core/diff/joins.js.map +1 -0
- package/dist/core/diff/scope/changed-paths.js +204 -0
- package/dist/core/diff/scope/changed-paths.js.map +1 -0
- package/dist/core/diff/scope/edges.js +82 -0
- package/dist/core/diff/scope/edges.js.map +1 -0
- package/dist/core/diff/semantic.js +312 -0
- package/dist/core/diff/semantic.js.map +1 -0
- package/dist/core/docs.js +37 -85
- package/dist/core/docs.js.map +1 -1
- package/dist/core/doctor/agents.js +238 -0
- package/dist/core/doctor/agents.js.map +1 -0
- package/dist/core/doctor/config.js +139 -0
- package/dist/core/doctor/config.js.map +1 -0
- package/dist/core/doctor/doctor.js +355 -0
- package/dist/core/doctor/doctor.js.map +1 -0
- package/dist/core/doctor/report.js +13 -0
- package/dist/core/doctor/report.js.map +1 -0
- package/dist/core/doctor/reports/scan.js +242 -0
- package/dist/core/doctor/reports/scan.js.map +1 -0
- package/dist/core/doctor/residue.js +110 -0
- package/dist/core/doctor/residue.js.map +1 -0
- package/dist/core/document/apply.js +224 -0
- package/dist/core/document/apply.js.map +1 -0
- package/dist/core/{frontmatter.js → document/frontmatter.js} +103 -2
- package/dist/core/document/frontmatter.js.map +1 -0
- package/dist/core/document/grammar/directives.js +143 -0
- package/dist/core/document/grammar/directives.js.map +1 -0
- package/dist/core/document/parse.js +286 -0
- package/dist/core/document/parse.js.map +1 -0
- package/dist/core/document/scenarios.js +238 -0
- package/dist/core/document/scenarios.js.map +1 -0
- package/dist/core/document/spec.js +234 -0
- package/dist/core/document/spec.js.map +1 -0
- package/dist/core/{config.js → envelope/config.js} +89 -18
- package/dist/core/envelope/config.js.map +1 -0
- package/dist/core/envelope/json.js +209 -0
- package/dist/core/envelope/json.js.map +1 -0
- package/dist/core/{version.js → envelope/version.js} +3 -3
- package/dist/core/envelope/version.js.map +1 -0
- package/dist/core/explain/families.js +180 -0
- package/dist/core/explain/families.js.map +1 -0
- package/dist/core/explain/fix-tables.js +178 -0
- package/dist/core/explain/fix-tables.js.map +1 -0
- package/dist/core/explain/lookup.js +194 -0
- package/dist/core/explain/lookup.js.map +1 -0
- package/dist/core/explain/refusals.js +49 -0
- package/dist/core/explain/refusals.js.map +1 -0
- package/dist/core/explain/terms/documents.js +227 -0
- package/dist/core/explain/terms/documents.js.map +1 -0
- package/dist/core/explain/terms/done-check.js +144 -0
- package/dist/core/explain/terms/done-check.js.map +1 -0
- package/dist/core/explain/terms/entry.js +14 -0
- package/dist/core/explain/terms/entry.js.map +1 -0
- package/dist/core/explain/terms/stages.js +71 -0
- package/dist/core/explain/terms/stages.js.map +1 -0
- package/dist/core/explain/terms/tasks.js +97 -0
- package/dist/core/explain/terms/tasks.js.map +1 -0
- package/dist/core/explain/terms.js +103 -0
- package/dist/core/explain/terms.js.map +1 -0
- package/dist/core/explore/describe.js +105 -0
- package/dist/core/explore/describe.js.map +1 -0
- package/dist/core/explore/explore.js +204 -0
- package/dist/core/explore/explore.js.map +1 -0
- package/dist/core/fleet-context.js +174 -146
- package/dist/core/fleet-context.js.map +1 -1
- package/dist/core/gate/checks.js +208 -0
- package/dist/core/gate/checks.js.map +1 -0
- package/dist/core/gate/partners.js +246 -0
- package/dist/core/gate/partners.js.map +1 -0
- package/dist/core/gate/report.js +47 -0
- package/dist/core/gate/report.js.map +1 -0
- package/dist/core/gate/verification.js +176 -0
- package/dist/core/gate/verification.js.map +1 -0
- package/dist/core/gherkin/digest.js +60 -0
- package/dist/core/gherkin/digest.js.map +1 -0
- package/dist/core/gherkin/emit.js +177 -0
- package/dist/core/gherkin/emit.js.map +1 -0
- package/dist/core/gherkin/read.js +76 -0
- package/dist/core/gherkin/read.js.map +1 -0
- package/dist/core/gherkin/stale.js +210 -0
- package/dist/core/gherkin/stale.js.map +1 -0
- package/dist/core/gherkin/stamp.js +77 -0
- package/dist/core/gherkin/stamp.js.map +1 -0
- package/dist/core/gherkin/steps/catalogue.js +154 -0
- package/dist/core/gherkin/steps/catalogue.js.map +1 -0
- package/dist/core/gherkin/steps/inventory.js +98 -0
- package/dist/core/gherkin/steps/inventory.js.map +1 -0
- package/dist/core/gherkin/steps/phrase.js +72 -0
- package/dist/core/gherkin/steps/phrase.js.map +1 -0
- package/dist/core/glossary/delta.js +109 -0
- package/dist/core/glossary/delta.js.map +1 -0
- package/dist/core/glossary/tree.js +73 -0
- package/dist/core/glossary/tree.js.map +1 -0
- package/dist/core/{concurrency.js → kernel/concurrency.js} +19 -0
- package/dist/core/kernel/concurrency.js.map +1 -0
- package/dist/core/{document-bytes.js → kernel/document-bytes.js} +1 -1
- package/dist/core/kernel/document-bytes.js.map +1 -0
- package/dist/core/kernel/fences.js +42 -0
- package/dist/core/kernel/fences.js.map +1 -0
- package/dist/core/kernel/ids/capability.js +72 -0
- package/dist/core/kernel/ids/capability.js.map +1 -0
- package/dist/core/kernel/ids/dirs.js +33 -0
- package/dist/core/kernel/ids/dirs.js.map +1 -0
- package/dist/core/kernel/ids/feature.js +75 -0
- package/dist/core/kernel/ids/feature.js.map +1 -0
- package/dist/core/kernel/ids/fqn/ancestors.js +65 -0
- package/dist/core/kernel/ids/fqn/ancestors.js.map +1 -0
- package/dist/core/kernel/ids/service.js +156 -0
- package/dist/core/kernel/ids/service.js.map +1 -0
- package/dist/core/kernel/ids/subsystem.js +63 -0
- package/dist/core/kernel/ids/subsystem.js.map +1 -0
- package/dist/core/{path-safety.js → kernel/path-safety.js} +56 -4
- package/dist/core/kernel/path-safety.js.map +1 -0
- package/dist/core/{records.js → kernel/records.js} +11 -0
- package/dist/core/kernel/records.js.map +1 -0
- package/dist/core/links/backlinks.js +66 -0
- package/dist/core/links/backlinks.js.map +1 -0
- package/dist/core/links/case.js +74 -0
- package/dist/core/links/case.js.map +1 -0
- package/dist/core/links/corpus.js +118 -0
- package/dist/core/links/corpus.js.map +1 -0
- package/dist/core/links/findings.js +110 -0
- package/dist/core/links/findings.js.map +1 -0
- package/dist/core/links/parse.js +265 -0
- package/dist/core/links/parse.js.map +1 -0
- package/dist/core/mcp/argv.js +212 -0
- package/dist/core/mcp/argv.js.map +1 -0
- package/dist/core/mcp/author-tools.js +73 -0
- package/dist/core/mcp/author-tools.js.map +1 -0
- package/dist/core/mcp/framing.js +46 -0
- package/dist/core/mcp/framing.js.map +1 -0
- package/dist/core/mcp/protocol.js +280 -0
- package/dist/core/mcp/protocol.js.map +1 -0
- package/dist/core/mcp/tools.js +324 -0
- package/dist/core/mcp/tools.js.map +1 -0
- package/dist/core/obligations/obligations.js +106 -0
- package/dist/core/obligations/obligations.js.map +1 -0
- package/dist/core/openapi/baseline/gate.js +207 -0
- package/dist/core/openapi/baseline/gate.js.map +1 -0
- package/dist/core/openapi/baseline/plan.js +142 -0
- package/dist/core/openapi/baseline/plan.js.map +1 -0
- package/dist/core/openapi/baseline/record.js +174 -0
- package/dist/core/openapi/baseline/record.js.map +1 -0
- package/dist/core/openapi/contract-text.js +33 -0
- package/dist/core/openapi/contract-text.js.map +1 -0
- package/dist/core/openapi/contract-tree.js +301 -0
- package/dist/core/openapi/contract-tree.js.map +1 -0
- package/dist/core/openapi/depth.js +136 -0
- package/dist/core/openapi/depth.js.map +1 -0
- package/dist/core/openapi/digest.js +239 -0
- package/dist/core/openapi/digest.js.map +1 -0
- package/dist/core/{openapi.js → openapi/doc.js} +54 -108
- package/dist/core/openapi/doc.js.map +1 -0
- package/dist/core/openapi/merge/components.js +199 -0
- package/dist/core/openapi/merge/components.js.map +1 -0
- package/dist/core/openapi/merge/error.js +16 -0
- package/dist/core/openapi/merge/error.js.map +1 -0
- package/dist/core/openapi/merge/markers.js +204 -0
- package/dist/core/openapi/merge/markers.js.map +1 -0
- package/dist/core/openapi/merge/merge.js +232 -0
- package/dist/core/openapi/merge/merge.js.map +1 -0
- package/dist/core/openapi/merge/pin.js +110 -0
- package/dist/core/openapi/merge/pin.js.map +1 -0
- package/dist/core/openspec/decide/capabilities.js +244 -0
- package/dist/core/openspec/decide/capabilities.js.map +1 -0
- package/dist/core/openspec/decide/dispositions.js +63 -0
- package/dist/core/openspec/decide/dispositions.js.map +1 -0
- package/dist/core/openspec/decide/renames.js +179 -0
- package/dist/core/openspec/decide/renames.js.map +1 -0
- package/dist/core/openspec/decide/verdict.js +84 -0
- package/dist/core/openspec/decide/verdict.js.map +1 -0
- package/dist/core/openspec/inventory.js +220 -0
- package/dist/core/openspec/inventory.js.map +1 -0
- package/dist/core/openspec/model/mapping.js +78 -0
- package/dist/core/openspec/model/mapping.js.map +1 -0
- package/dist/core/openspec/model/model.js +70 -0
- package/dist/core/openspec/model/model.js.map +1 -0
- package/dist/core/openspec/scan/changes.js +241 -0
- package/dist/core/openspec/scan/changes.js.map +1 -0
- package/dist/core/openspec/scan/config.js +191 -0
- package/dist/core/openspec/scan/config.js.map +1 -0
- package/dist/core/openspec/scan/shape.js +304 -0
- package/dist/core/openspec/scan/shape.js.map +1 -0
- package/dist/core/openspec/scan/walk.js +116 -0
- package/dist/core/openspec/scan/walk.js.map +1 -0
- package/dist/core/openspec/scan/workspace.js +71 -0
- package/dist/core/openspec/scan/workspace.js.map +1 -0
- package/dist/core/owners/codeowners.js +141 -0
- package/dist/core/owners/codeowners.js.map +1 -0
- package/dist/core/pack/features.js +120 -0
- package/dist/core/pack/features.js.map +1 -0
- package/dist/core/pack/joins.js +112 -0
- package/dist/core/pack/joins.js.map +1 -0
- package/dist/core/pack/living.js +157 -0
- package/dist/core/pack/living.js.map +1 -0
- package/dist/core/pack/pack.js +120 -0
- package/dist/core/pack/pack.js.map +1 -0
- package/dist/core/permissions/permissions.js +87 -0
- package/dist/core/permissions/permissions.js.map +1 -0
- package/dist/core/projection/api.js +84 -0
- package/dist/core/projection/api.js.map +1 -0
- package/dist/core/projection/arch-slice.js +63 -0
- package/dist/core/projection/arch-slice.js.map +1 -0
- package/dist/core/projection/events.js +34 -0
- package/dist/core/projection/events.js.map +1 -0
- package/dist/core/projection/introduced.js +14 -0
- package/dist/core/projection/introduced.js.map +1 -0
- package/dist/core/provenance/findings.js +244 -0
- package/dist/core/provenance/findings.js.map +1 -0
- package/dist/core/provenance/git.js +201 -0
- package/dist/core/provenance/git.js.map +1 -0
- package/dist/core/provenance/gitq/moves.js +139 -0
- package/dist/core/provenance/gitq/moves.js.map +1 -0
- package/dist/core/provenance/gitq/vouched-ancestor.js +179 -0
- package/dist/core/provenance/gitq/vouched-ancestor.js.map +1 -0
- package/dist/core/provenance/sample/scope.js +238 -0
- package/dist/core/provenance/sample/scope.js.map +1 -0
- package/dist/core/provenance/sample/sections.js +61 -0
- package/dist/core/provenance/sample/sections.js.map +1 -0
- package/dist/core/provenance/sources.js +280 -0
- package/dist/core/provenance/sources.js.map +1 -0
- package/dist/core/provenance/stamp.js +220 -0
- package/dist/core/provenance/stamp.js.map +1 -0
- package/dist/core/provenance/walk.js +157 -0
- package/dist/core/provenance/walk.js.map +1 -0
- package/dist/core/repo/authored/paths.js +210 -0
- package/dist/core/repo/authored/paths.js.map +1 -0
- package/dist/core/repo/entries.js +126 -0
- package/dist/core/repo/entries.js.map +1 -0
- package/dist/core/repo/paths.js +322 -0
- package/dist/core/repo/paths.js.map +1 -0
- package/dist/core/repo/repo.js +308 -0
- package/dist/core/repo/repo.js.map +1 -0
- package/dist/core/repo/service-target.js +153 -0
- package/dist/core/repo/service-target.js.map +1 -0
- package/dist/core/repo/state.js +58 -0
- package/dist/core/repo/state.js.map +1 -0
- package/dist/core/repo/tree/find.js +61 -0
- package/dist/core/repo/tree/find.js.map +1 -0
- package/dist/core/repo/tree/fs.js +90 -0
- package/dist/core/repo/tree/fs.js.map +1 -0
- package/dist/core/repo/tree/marker.js +61 -0
- package/dist/core/repo/tree/marker.js.map +1 -0
- package/dist/core/repo/tree/render/body.js +258 -0
- package/dist/core/repo/tree/render/body.js.map +1 -0
- package/dist/core/repo/tree/render/projects.js +182 -0
- package/dist/core/repo/tree/render/projects.js.map +1 -0
- package/dist/core/repo/tree/render/service/header.js +125 -0
- package/dist/core/repo/tree/render/service/header.js.map +1 -0
- package/dist/core/repo/tree/render/service/peers.js +28 -0
- package/dist/core/repo/tree/render/service/peers.js.map +1 -0
- package/dist/core/repo/tree/render/service/view-id.js +67 -0
- package/dist/core/repo/tree/render/service/view-id.js.map +1 -0
- package/dist/core/repo/tree/render/service/views.js +78 -0
- package/dist/core/repo/tree/render/service/views.js.map +1 -0
- package/dist/core/repo/tree/render/stale.js +42 -0
- package/dist/core/repo/tree/render/stale.js.map +1 -0
- package/dist/core/repo/tree/render/text.js +84 -0
- package/dist/core/repo/tree/render/text.js.map +1 -0
- package/dist/core/repo/tree/render/views.js +293 -0
- package/dist/core/repo/tree/render/views.js.map +1 -0
- package/dist/core/repo/tree/walk.js +255 -0
- package/dist/core/repo/tree/walk.js.map +1 -0
- package/dist/core/results.js +146 -14
- package/dist/core/results.js.map +1 -1
- package/dist/core/scaffold/landscape.js +239 -0
- package/dist/core/scaffold/landscape.js.map +1 -0
- package/dist/core/scaffold/legacy.js +271 -0
- package/dist/core/scaffold/legacy.js.map +1 -0
- package/dist/core/scaffold/readme.js +84 -0
- package/dist/core/scaffold/readme.js.map +1 -0
- package/dist/core/staging/commit.js +252 -0
- package/dist/core/staging/commit.js.map +1 -0
- package/dist/core/staging/interrupted.js +96 -0
- package/dist/core/staging/interrupted.js.map +1 -0
- package/dist/core/staging/lock.js +268 -0
- package/dist/core/staging/lock.js.map +1 -0
- package/dist/core/staging/recovery/finding.js +35 -0
- package/dist/core/staging/recovery/finding.js.map +1 -0
- package/dist/core/staging/recovery/intent.js +95 -0
- package/dist/core/staging/recovery/intent.js.map +1 -0
- package/dist/core/staging/recovery/recover.js +204 -0
- package/dist/core/staging/recovery/recover.js.map +1 -0
- package/dist/core/staging/recovery/residue.js +62 -0
- package/dist/core/staging/recovery/residue.js.map +1 -0
- package/dist/core/staging/snapshot/manifest.js +188 -0
- package/dist/core/staging/snapshot/manifest.js.map +1 -0
- package/dist/core/staging/snapshot/snapshot.js +196 -0
- package/dist/core/staging/snapshot/snapshot.js.map +1 -0
- package/dist/core/staging/txn/forward.js +181 -0
- package/dist/core/staging/txn/forward.js.map +1 -0
- package/dist/core/staging/txn/journal.js +139 -0
- package/dist/core/staging/txn/journal.js.map +1 -0
- package/dist/core/staging/txn/transaction.js +75 -0
- package/dist/core/staging/txn/transaction.js.map +1 -0
- package/dist/core/staging/writes.js +113 -0
- package/dist/core/staging/writes.js.map +1 -0
- package/dist/core/status/actions/execution.js +60 -0
- package/dist/core/status/actions/execution.js.map +1 -0
- package/dist/core/status/contracts.js +126 -0
- package/dist/core/status/contracts.js.map +1 -0
- package/dist/core/status/feature/artifacts.js +196 -0
- package/dist/core/status/feature/artifacts.js.map +1 -0
- package/dist/core/status/feature/feature.js +214 -0
- package/dist/core/status/feature/feature.js.map +1 -0
- package/dist/core/status/feature/next.js +163 -0
- package/dist/core/status/feature/next.js.map +1 -0
- package/dist/core/status/feature/state.js +21 -0
- package/dist/core/status/feature/state.js.map +1 -0
- package/dist/core/status/feature/words.js +96 -0
- package/dist/core/status/feature/words.js.map +1 -0
- package/dist/core/status/fleet/fleet.js +216 -0
- package/dist/core/status/fleet/fleet.js.map +1 -0
- package/dist/core/status/fleet/next.js +302 -0
- package/dist/core/status/fleet/next.js.map +1 -0
- package/dist/core/status/interrupted.js +97 -0
- package/dist/core/status/interrupted.js.map +1 -0
- package/dist/core/status/report.js +31 -0
- package/dist/core/status/report.js.map +1 -0
- package/dist/core/status/scan.js +41 -0
- package/dist/core/status/scan.js.map +1 -0
- package/dist/core/status/verification.js +216 -0
- package/dist/core/status/verification.js.map +1 -0
- package/dist/core/tasks/packet.js +199 -0
- package/dist/core/tasks/packet.js.map +1 -0
- package/dist/core/tasks/record.js +43 -0
- package/dist/core/tasks/record.js.map +1 -0
- package/dist/core/tasks/sources.js +181 -0
- package/dist/core/tasks/sources.js.map +1 -0
- package/dist/core/tasks/stamps.js +76 -0
- package/dist/core/tasks/stamps.js.map +1 -0
- package/dist/core/tasks/unit.js +0 -0
- package/dist/core/tasks/unit.js.map +1 -0
- package/dist/core/usecases/capability.js +166 -0
- package/dist/core/usecases/capability.js.map +1 -0
- package/dist/core/usecases/delta/claims.js +140 -0
- package/dist/core/usecases/delta/claims.js.map +1 -0
- package/dist/core/usecases/delta/flows.js +101 -0
- package/dist/core/usecases/delta/flows.js.map +1 -0
- package/dist/core/usecases/delta/modified.js +315 -0
- package/dist/core/usecases/delta/modified.js.map +1 -0
- package/dist/core/usecases/delta/overlay.js +76 -0
- package/dist/core/usecases/delta/overlay.js.map +1 -0
- package/dist/core/usecases/fleet.js +296 -0
- package/dist/core/usecases/fleet.js.map +1 -0
- package/dist/core/usecases/grade/capability-tag.js +93 -0
- package/dist/core/usecases/grade/capability-tag.js.map +1 -0
- package/dist/core/usecases/grade/feature.js +88 -0
- package/dist/core/usecases/grade/feature.js.map +1 -0
- package/dist/core/usecases/grade/requirement-tag.js +94 -0
- package/dist/core/usecases/grade/requirement-tag.js.map +1 -0
- package/dist/core/usecases/grade/steps.js +266 -0
- package/dist/core/usecases/grade/steps.js.map +1 -0
- package/dist/core/usecases/grade/usecases.js +112 -0
- package/dist/core/usecases/grade/usecases.js.map +1 -0
- package/dist/core/usecases/operations.js +123 -0
- package/dist/core/usecases/operations.js.map +1 -0
- package/dist/core/usecases/place.js +44 -0
- package/dist/core/usecases/place.js.map +1 -0
- package/dist/core/usecases/service/exclude.js +119 -0
- package/dist/core/usecases/service/exclude.js.map +1 -0
- package/dist/core/usecases/service/flows.js +164 -0
- package/dist/core/usecases/service/flows.js.map +1 -0
- package/dist/core/usecases/suites/participants.js +83 -0
- package/dist/core/usecases/suites/participants.js.map +1 -0
- package/dist/core/usecases/suites/suites.js +45 -0
- package/dist/core/usecases/suites/suites.js.map +1 -0
- package/dist/core/usecases/touch.js +101 -0
- package/dist/core/usecases/touch.js.map +1 -0
- package/dist/core/verify/answers.js +180 -0
- package/dist/core/verify/answers.js.map +1 -0
- package/dist/core/verify/build.js +170 -0
- package/dist/core/verify/build.js.map +1 -0
- package/dist/core/verify/checklist.js +259 -0
- package/dist/core/verify/checklist.js.map +1 -0
- package/dist/core/verify/claims/identity.js +61 -0
- package/dist/core/verify/claims/identity.js.map +1 -0
- package/dist/core/verify/cross/diff.js +97 -0
- package/dist/core/verify/cross/diff.js.map +1 -0
- package/dist/core/verify/evidence/contract.js +169 -0
- package/dist/core/verify/evidence/contract.js.map +1 -0
- package/dist/core/verify/location.js +67 -0
- package/dist/core/verify/location.js.map +1 -0
- package/dist/core/verify/pins/lint.js +158 -0
- package/dist/core/verify/pins/lint.js.map +1 -0
- package/dist/core/verify/pins/pin.js +95 -0
- package/dist/core/verify/pins/pin.js.map +1 -0
- package/dist/core/verify/read/file.js +224 -0
- package/dist/core/verify/read/file.js.map +1 -0
- package/dist/core/verify/read/shape.js +169 -0
- package/dist/core/verify/read/shape.js.map +1 -0
- package/dist/core/verify/read/union.js +105 -0
- package/dist/core/verify/read/union.js.map +1 -0
- package/dist/core/verify/record.js +165 -0
- package/dist/core/verify/record.js.map +1 -0
- package/dist/core/verify/store/commit.js +99 -0
- package/dist/core/verify/store/commit.js.map +1 -0
- package/dist/core/verify/store/render.js +61 -0
- package/dist/core/verify/store/render.js.map +1 -0
- package/dist/core/vocabulary/health.js +91 -0
- package/dist/core/vocabulary/health.js.map +1 -0
- package/dist/core/vocabulary/issue.js +59 -0
- package/dist/core/vocabulary/issue.js.map +1 -0
- package/dist/core/vocabulary/maturity.js +216 -0
- package/dist/core/vocabulary/maturity.js.map +1 -0
- package/dist/core/vocabulary/report.js +90 -0
- package/dist/core/vocabulary/report.js.map +1 -0
- package/dist/core/vocabulary/steps.js +266 -0
- package/dist/core/vocabulary/steps.js.map +1 -0
- package/dist/core/workspace/discover.js +239 -0
- package/dist/core/workspace/discover.js.map +1 -0
- package/dist/core/workspace/render.js +52 -0
- package/dist/core/workspace/render.js.map +1 -0
- package/examples/README.md +232 -0
- package/examples/docs/architecture/adrs/0001-transactional-outbox.md +33 -0
- package/examples/docs/architecture/capabilities.yaml +31 -0
- package/examples/docs/architecture/landscape.likec4 +336 -0
- package/examples/docs/architecture/obligations.yaml +23 -0
- package/examples/docs/architecture/permissions.yaml +50 -0
- package/examples/docs/architecture/services.likec4 +70 -0
- package/examples/docs/architecture/subsystems.likec4 +18 -0
- package/examples/docs/architecture/usecases/order-notification.likec4 +74 -0
- package/examples/docs/capabilities/checkout/spec.md +55 -0
- package/examples/docs/capabilities/identity/tokens/spec.md +42 -0
- package/examples/docs/capabilities/order-notifications/spec.md +43 -0
- package/examples/docs/features/FEAT-101-payment-splitting/adrs/0001-dedicated-split-service.md +18 -0
- package/examples/docs/features/FEAT-101-payment-splitting/delta.likec4 +94 -0
- package/examples/docs/features/FEAT-101-payment-splitting/intent.md +44 -0
- package/examples/docs/features/FEAT-101-payment-splitting/specs/checkout-web/spec.md +21 -0
- package/examples/docs/features/FEAT-101-payment-splitting/specs/payment-service/asyncapi.yaml +132 -0
- package/examples/docs/features/FEAT-101-payment-splitting/specs/payment-service/spec.md +36 -0
- package/examples/docs/features/FEAT-101-payment-splitting/specs/payment-split-service/arch.spec.md +40 -0
- package/examples/docs/features/FEAT-101-payment-splitting/specs/payment-split-service/openapi.yaml +116 -0
- package/examples/docs/features/FEAT-101-payment-splitting/specs/payment-split-service/spec.md +55 -0
- package/examples/docs/features/FEAT-112-retire-order-v1/intent.md +35 -0
- package/examples/docs/features/FEAT-112-retire-order-v1/specs/order-service/openapi.yaml +31 -0
- package/examples/docs/features/FEAT-112-retire-order-v1/specs/order-service/spec.md +17 -0
- package/examples/docs/features/archive/FEAT-088-refunds/.loam-before/files/architecture/landscape.likec4 +253 -0
- package/examples/docs/features/archive/FEAT-088-refunds/.loam-before/files/services/order-service/spec.md +121 -0
- package/examples/docs/features/archive/FEAT-088-refunds/.loam-before/files/services/payment-service/openapi.yaml +111 -0
- package/examples/docs/features/archive/FEAT-088-refunds/.loam-before/files/services/payment-service/spec.md +58 -0
- package/examples/docs/features/archive/FEAT-088-refunds/.loam-before/manifest.json +32 -0
- package/examples/docs/features/archive/FEAT-088-refunds/adrs/0001-refunds-stay-in-payment-service.md +26 -0
- package/examples/docs/features/archive/FEAT-088-refunds/delta.likec4 +28 -0
- package/examples/docs/features/archive/FEAT-088-refunds/intent.md +26 -0
- package/examples/docs/features/archive/FEAT-088-refunds/specs/order-service/spec.md +37 -0
- package/examples/docs/features/archive/FEAT-088-refunds/specs/payment-service/openapi.yaml +73 -0
- package/examples/docs/features/archive/FEAT-088-refunds/specs/payment-service/spec.md +23 -0
- package/examples/docs/features/archive/FEAT-088-refunds/verification.yaml +76 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/.loam-before/files/architecture/landscape.likec4 +275 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/.loam-before/files/services/payment-service/asyncapi.yaml +96 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/.loam-before/files/services/payment-service/spec.md +82 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/.loam-before/files/services/platform/notification-service/asyncapi.yaml +164 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/.loam-before/files/services/platform/notification-service/spec.md +91 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/.loam-before/manifest.json +46 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/delta.likec4 +36 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/intent.md +22 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/scenario-report.json +10 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/specs/notification-service/asyncapi.yaml +208 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/specs/notification-service/spec.md +24 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/specs/payment-service/asyncapi.yaml +137 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/specs/payment-service/spec.md +31 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/verification.yaml +84 -0
- package/examples/docs/glossary/order.md +15 -0
- package/examples/docs/glossary/payments/authorization.md +14 -0
- package/examples/docs/likec4.config.json +8 -0
- package/examples/docs/loam.json +3 -0
- package/examples/docs/services/checkout-web/model.likec4 +92 -0
- package/examples/docs/services/checkout-web/spec.md +91 -0
- package/examples/docs/services/checkout-web/ui/pages/checkout.page.yaml +40 -0
- package/examples/docs/services/checkout-web/ui/pages/order-status.page.yaml +24 -0
- package/examples/docs/services/checkout-web/ui/pages/split-payment.page.yaml +26 -0
- package/examples/docs/services/order-service/adrs/0001-orchestrated-order-lifecycle.md +52 -0
- package/examples/docs/services/order-service/arch.spec.md +134 -0
- package/examples/docs/services/order-service/asyncapi.yaml +109 -0
- package/examples/docs/services/order-service/health.yaml +57 -0
- package/examples/docs/services/order-service/model.likec4 +126 -0
- package/examples/docs/services/order-service/openapi.yaml +257 -0
- package/examples/docs/services/order-service/runbook.md +62 -0
- package/examples/docs/services/order-service/spec.md +134 -0
- package/examples/docs/services/payment-service/adrs/0001-payments-outbox.md +18 -0
- package/examples/docs/services/payment-service/adrs/0002-idempotency-keys-on-authorization.md +27 -0
- package/examples/docs/services/payment-service/arch.spec.md +76 -0
- package/examples/docs/services/payment-service/asyncapi.yaml +130 -0
- package/examples/docs/services/payment-service/health.yaml +39 -0
- package/examples/docs/services/payment-service/model.likec4 +68 -0
- package/examples/docs/services/payment-service/openapi.yaml +151 -0
- package/examples/docs/services/payment-service/runbook.md +37 -0
- package/examples/docs/services/payment-service/spec.md +88 -0
- package/examples/docs/services/platform/identity-service/adrs/0001-token-introspection-over-local-validation.md +60 -0
- package/examples/docs/services/platform/identity-service/arch.spec.md +120 -0
- package/examples/docs/services/platform/identity-service/health.yaml +70 -0
- package/examples/docs/services/platform/identity-service/model.likec4 +81 -0
- package/examples/docs/services/platform/identity-service/openapi.yaml +197 -0
- package/examples/docs/services/platform/identity-service/runbook.md +95 -0
- package/examples/docs/services/platform/identity-service/spec.md +119 -0
- package/examples/docs/services/platform/notification-service/asyncapi.yaml +200 -0
- package/examples/docs/services/platform/notification-service/health.yaml +40 -0
- package/examples/docs/services/platform/notification-service/model.likec4 +97 -0
- package/examples/docs/services/platform/notification-service/runbook.md +48 -0
- package/examples/docs/services/platform/notification-service/spec.md +112 -0
- package/examples/docs/services/platform/subsystem.yaml +2 -0
- package/examples/fleet.yaml +57 -0
- package/package.json +19 -6
- package/dist/commands/adopt.js +0 -240
- package/dist/commands/adopt.js.map +0 -1
- package/dist/commands/archive.js +0 -1313
- package/dist/commands/archive.js.map +0 -1
- package/dist/commands/delta.js +0 -388
- package/dist/commands/delta.js.map +0 -1
- package/dist/commands/docs-repo-gate.js.map +0 -1
- package/dist/commands/format.js +0 -17
- package/dist/commands/format.js.map +0 -1
- package/dist/commands/gherkin.js +0 -309
- package/dist/commands/gherkin.js.map +0 -1
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/list.js +0 -295
- package/dist/commands/list.js.map +0 -1
- package/dist/commands/migrate-openspec.js +0 -950
- package/dist/commands/migrate-openspec.js.map +0 -1
- package/dist/commands/new.js +0 -413
- package/dist/commands/new.js.map +0 -1
- package/dist/commands/rebase.js +0 -356
- package/dist/commands/rebase.js.map +0 -1
- package/dist/commands/show.js +0 -320
- package/dist/commands/show.js.map +0 -1
- package/dist/commands/status.js +0 -262
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/unarchive.js +0 -317
- package/dist/commands/unarchive.js.map +0 -1
- package/dist/commands/validate.js +0 -1773
- package/dist/commands/validate.js.map +0 -1
- package/dist/commands/verify.js +0 -775
- package/dist/commands/verify.js.map +0 -1
- package/dist/commands/vouch.js +0 -421
- package/dist/commands/vouch.js.map +0 -1
- package/dist/core/agent.js +0 -2173
- package/dist/core/agent.js.map +0 -1
- package/dist/core/agents-stamp.js.map +0 -1
- package/dist/core/arch.js +0 -130
- package/dist/core/arch.js.map +0 -1
- package/dist/core/asyncapi.js +0 -253
- package/dist/core/asyncapi.js.map +0 -1
- package/dist/core/brief.js +0 -755
- package/dist/core/brief.js.map +0 -1
- package/dist/core/coherence.js +0 -577
- package/dist/core/coherence.js.map +0 -1
- package/dist/core/concurrency.js.map +0 -1
- package/dist/core/config.js.map +0 -1
- package/dist/core/delta.js +0 -476
- package/dist/core/delta.js.map +0 -1
- package/dist/core/dependencies.js +0 -356
- package/dist/core/dependencies.js.map +0 -1
- package/dist/core/doctor.js +0 -596
- package/dist/core/doctor.js.map +0 -1
- package/dist/core/document-bytes.js.map +0 -1
- package/dist/core/explore.js +0 -225
- package/dist/core/explore.js.map +0 -1
- package/dist/core/frontmatter.js.map +0 -1
- package/dist/core/gherkin.js +0 -463
- package/dist/core/gherkin.js.map +0 -1
- package/dist/core/health.js +0 -67
- package/dist/core/health.js.map +0 -1
- package/dist/core/ids.js +0 -122
- package/dist/core/ids.js.map +0 -1
- package/dist/core/issue.js +0 -9
- package/dist/core/issue.js.map +0 -1
- package/dist/core/json.js +0 -74
- package/dist/core/json.js.map +0 -1
- package/dist/core/likec4.js +0 -489
- package/dist/core/likec4.js.map +0 -1
- package/dist/core/maturity.js +0 -66
- package/dist/core/maturity.js.map +0 -1
- package/dist/core/openapi-merge.js +0 -552
- package/dist/core/openapi-merge.js.map +0 -1
- package/dist/core/openapi.js.map +0 -1
- package/dist/core/openspec-inventory.js +0 -1440
- package/dist/core/openspec-inventory.js.map +0 -1
- package/dist/core/path-safety.js.map +0 -1
- package/dist/core/provenance.js +0 -787
- package/dist/core/provenance.js.map +0 -1
- package/dist/core/records.js.map +0 -1
- package/dist/core/repo.js +0 -438
- package/dist/core/repo.js.map +0 -1
- package/dist/core/report.js +0 -47
- package/dist/core/report.js.map +0 -1
- package/dist/core/spec.js +0 -505
- package/dist/core/spec.js.map +0 -1
- package/dist/core/staging.js +0 -890
- package/dist/core/staging.js.map +0 -1
- package/dist/core/status.js +0 -1132
- package/dist/core/status.js.map +0 -1
- package/dist/core/steps.js +0 -72
- package/dist/core/steps.js.map +0 -1
- package/dist/core/verify.js +0 -807
- package/dist/core/verify.js.map +0 -1
- package/dist/core/version.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/commands/init/init.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,eAAe,EACf,cAAc,EACd,UAAU,EACV,eAAe,EACf,UAAU,GAEX,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,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CAAC,GAAG,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAC;QAC3G,CAAC;QAED,yEAAyE;QACzE,wEAAwE;QACxE,wEAAwE;QACxE,+DAA+D;QAC/D,oEAAoE;QACpE,yEAAyE;QACzE,oEAAoE;QACpE,uEAAuE;QACvE,wEAAwE;QACxE,wEAAwE;QACxE,mEAAmE;QACnE,uEAAuE;QACvE,kEAAkE;QAClE,0EAA0E;QAC1E,IAAI,CAAC,OAAO;YAAE,KAAK,MAAM,IAAI,IAAI,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC;gBAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import type { Command } from \"commander\";\nimport { existsSync, statSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\nimport {\n CONFIG_FILENAME,\n findConfigPath,\n loadConfig,\n localConfigPath,\n saveConfig,\n type StoredConfig,\n} from \"../../core/envelope/config.js\";\nimport { docsDirOf } from \"../../core/kernel/ids/dirs.js\";\nimport { emitJson, fail } from \"../../core/envelope/json.js\";\nimport { plannedDocsFiles, scaffoldDocs } from \"../../core/docs.js\";\nimport { docsRepoState } from \"../../core/repo/state.js\";\nimport { listServices } from \"../../core/repo/repo.js\";\nimport { InvalidIdError, assertServiceId } from \"../../core/kernel/ids/service.js\";\nimport {\n detectAgentTools,\n plannedCommandFiles,\n syncAgentCommands,\n updatedAgentFileManifest,\n type Delivery,\n} from \"../../core/agent/scaffold.js\";\nimport { AGENT_TOOLS } from \"../../core/agent/tools/registry.js\";\nimport { initExample } from \"./example.js\";\nimport { firstHourLines } from \"./first-hour.js\";\nimport { MCP_CONFIG_FILENAME, mcpConfigPath, mcpServerSnippet, writeMcpConfig } from \"./mcp.js\";\nimport { isDocsRepo, resolveAgentProfile, resolveTools, storedDocsDir } from \"./options.js\";\n\ninterface InitOptions {\n docs: string;\n service?: string;\n /** --create: make a new docs repo at --docs instead of joining an existing one. */\n create?: boolean;\n /** --force: write loam.json here even though one already governs a parent directory. */\n force?: boolean;\n /** commander's --no-commands: true unless the flag is passed. */\n commands: boolean;\n /** commander's --no-skills: true unless the flag is passed. */\n skills: boolean;\n /**\n * --mcp: also write the repo-root `.mcp.json`. Opt-in and default off — a\n * third delivery, independent of the two `--no-*` flags rather than a\n * variation on them, so it neither contradicts them nor is suppressed by\n * either. See ./mcp.ts for why the file is opt-in at all.\n */\n mcp?: boolean;\n mcpAuthor?: boolean;\n /** --tools: comma-separated AGENT_TOOLS ids, or \"all\". Absent = autodetect. */\n tools?: string;\n /** Workflow subset to scaffold. */\n agentProfile?: string;\n /** --example: copy the packaged example fleet to this directory and do nothing else. */\n example?: string;\n json?: boolean;\n}\n\nexport function registerInit(program: Command): void {\n program\n .command(\"init\")\n .description(\"Initialize loam: create/point at the shared docs repo and write local config\")\n .option(\"--docs <dir>\", \"path to the shared docs repo (the source of truth)\", \".loam-docs\")\n .option(\"--service <id>\", \"canonical id of the service in this repo\")\n .option(\"--create\", \"create a new docs repo at --docs instead of joining an existing one\")\n .option(\"--force\", `write ${CONFIG_FILENAME} here even though one governs a parent directory`)\n .option(\n \"--tools <ids>\",\n \"agent tools to generate for, overriding the scan of this directory: \" +\n `comma-separated (${Object.keys(AGENT_TOOLS).join(\", \")}) or \"all\"`,\n )\n .option(\"--agent-profile <profile>\", \"workflow set: full | service | docs\")\n .option(\n \"--example <dir>\",\n \"copy the packaged example fleet to <dir> and stop: no repository is bound, nothing is scaffolded\",\n )\n .option(\"--no-commands\", \"skip the slash commands for this repo entirely\")\n .option(\"--no-skills\", \"skip the agent skills for this repo entirely\")\n .option(\n \"--mcp\",\n `also write ${MCP_CONFIG_FILENAME} here, so an MCP host launches \\`loam mcp\\` for this repo`,\n )\n .option(\"--mcp-author\", `write ${MCP_CONFIG_FILENAME} with the opt-in authoring profile`)\n .option(\"--json\", \"emit the machine contract instead of the human view\")\n .action(async (opts: InitOptions, command: Command) => {\n const json = opts.json === true;\n const cwd = process.cwd();\n\n // FIRST, before every guard below including the governing-config one:\n // `--example` writes a fresh tree, it does not join a system. A\n // loam.json in an ancestor governs the directories a repository is bound\n // INTO, and this flag binds nothing — refusing here would be the tool\n // declining to show itself working because of a config that has no\n // bearing on the copy. Before the --service id check too, so a run\n // combining the two answers the contradiction rather than grading an id\n // it is about to refuse to use.\n if (opts.example !== undefined) {\n await initExample({\n dir: opts.example,\n conflicts: [\n // `--docs` carries a default, so only its SOURCE can say whether\n // anybody typed it — the same question the docsDir precedence\n // below asks, for the same reason.\n ...(command.getOptionValueSource(\"docs\") !== \"default\" ? [\"--docs\"] : []),\n ...(opts.service !== undefined ? [\"--service\"] : []),\n ...(opts.create === true ? [\"--create\"] : []),\n ...(opts.tools !== undefined ? [\"--tools\"] : []),\n ...(opts.agentProfile !== undefined ? [\"--agent-profile\"] : []),\n ...(opts.mcpAuthor === true ? [\"--mcp-author\"] : []),\n ],\n json,\n });\n return;\n }\n\n // The id becomes services/<id>/ in the shared repo, so it is validated\n // before anything is written — by the same rule adopt, vouch and gherkin\n // use, never by a guard invented here.\n if (opts.service !== undefined) {\n try {\n assertServiceId(opts.service);\n } catch (err) {\n if (!(err instanceof InvalidIdError)) throw err;\n fail(json, \"invalid-option\", err.message);\n return;\n }\n }\n\n // A loam.json in an ancestor already governs this directory: every command\n // run from here resolves to it. Writing a second one below it would shadow\n // the first for this subtree only — the kind of split-brain nobody\n // discovers until two commands disagree about which docs repo is the fleet.\n const governing = findConfigPath(cwd);\n if (governing !== null && governing !== localConfigPath(cwd) && opts.force !== true) {\n fail(\n json,\n \"already-exists\",\n `${governing} already governs this directory. ` +\n `Run loam from ${resolve(governing, \"..\")}, or pass --force to give this ` +\n `subdirectory its own ${CONFIG_FILENAME}.`,\n );\n return;\n }\n\n // Only THIS directory's config is spread forward. Under --force there is\n // a config in an ancestor too, and inheriting its `service` would bind\n // this repo to a service somebody else's repo declared.\n // `kind: \"invalid\"` reads as null on purpose: init REPAIRS a corrupt\n // loam.json by rewriting it, so a config nobody can read is treated\n // exactly like no config at all. The old stderr line about it was\n // core's side effect, promised nowhere.\n const load = existsSync(localConfigPath(cwd)) ? await loadConfig(cwd) : null;\n const existing = load?.kind === \"loaded\" ? load.config : null;\n\n // A re-run must not move a committed pointer. `--docs` has a default\n // (`.loam-docs`), so an init invoked for any OTHER reason — `--service`,\n // a new `--tools`, the fix `doctor.agent-files-missing` prints — used to\n // arrive here carrying a docsDir nobody typed: the default then named no\n // docs repo, the refusal steered the caller to `--create`, and `--create`\n // rewrote `docsDir` in the committed loam.json to a freshly scaffolded\n // empty one. `validate --all` went green over an empty fleet, which is\n // the exact outcome `--create` exists to prevent. So the flag wins only\n // when it was actually passed; otherwise the file this repo already\n // committed does.\n const committedDocs = existing?.docsDirAsWritten;\n const docsTyped = command.getOptionValueSource(\"docs\") !== \"default\";\n const docsSource: \"flag\" | \"config\" | \"default\" =\n docsTyped ? \"flag\" : committedDocs === undefined ? \"default\" : \"config\";\n const docsOption = !docsTyped && committedDocs !== undefined ? committedDocs : opts.docs;\n // Branded at the resolution, because the guards below are what validate\n // it — the brand's provenance is \"an explicit --docs a command\n // validated\", and this command is the one that does. The STORED spelling\n // (`storedDocsDir` below) deliberately stays a plain string.\n const docsDir = docsDirOf(resolve(cwd, docsOption));\n\n // The one predictable failure: --docs naming a file. Refused here so the\n // caller gets a clean envelope/message instead of mkdir's ENOTDIR throw.\n if (existsSync(docsDir) && !statSync(docsDir).isDirectory()) {\n fail(json, \"invalid-option\", `--docs points at a file, not a directory: ${docsDir}`);\n return;\n }\n\n // Joining an existing docs repo and creating a new one are different\n // intentions, and `init` used to perform the second one whenever the first\n // was misspelled: `--docs ../dcos` scaffolded a second, empty docs repo\n // beside the real one, and the fleet quietly split in two. Creation is now\n // something the caller asks for.\n const joining = isDocsRepo(docsDir);\n if (!joining && opts.create !== true) {\n fail(\n json,\n \"invalid-option\",\n docsRepoState(docsDir).kind === \"missing\"\n ? `--docs points at a directory that does not exist: ${docsDir}. ` +\n \"If that is a typo, fix it; to create a new docs repo there, pass --create.\"\n : `--docs points at ${docsDir}, which is not a docs repo ` +\n \"(a docs repo has services/ and AGENTS.md). \" +\n \"Point --docs at the shared docs repo, or pass --create to make a new one here.\",\n );\n return;\n }\n\n // --tools selects the files to write; --no-commands and --no-skills each\n // say write none of that kind. Together they contradict — refused, not\n // arbitrated, in either combination.\n const suppressed = [\n ...(opts.commands ? [] : [\"--no-commands\"]),\n ...(opts.skills ? [] : [\"--no-skills\"]),\n ];\n if (opts.tools !== undefined && suppressed.length > 0) {\n fail(\n json,\n \"invalid-option\",\n `--tools contradicts ${suppressed.join(\" and \")}: ` +\n \"one selects the files to generate, the other suppresses them.\",\n );\n return;\n }\n const delivery: Delivery[] = [\n ...(opts.commands ? ([\"commands\"] as const) : []),\n ...(opts.skills ? ([\"skills\"] as const) : []),\n ];\n\n // Without --tools the repo decides: whichever tools have left their own\n // dot-directories here. Falling back to claude keeps a bare repo behaving\n // exactly as it did before the scan existed. `detected` is reported either\n // way — what the scan saw is a fact about the repo, not about the flags.\n const detected = detectAgentTools(cwd);\n const scanned = detected.length > 0 ? detected : [\"claude\"];\n const tools = opts.tools === undefined ? scanned : resolveTools(opts.tools, json);\n if (tools === null) return;\n const profile = resolveAgentProfile(opts.agentProfile, existing?.agentProfile, json);\n if (profile === null) return;\n\n // Probe the pre-existing paths in planned order. Managed files refreshed\n // below are removed from `skipped`; custom and already-current files stay.\n const plannedAgentFiles = delivery.length > 0 ? plannedCommandFiles(cwd, tools, delivery, profile) : [];\n // `.mcp.json` joins the same list rather than being reported on the side:\n // it is a scaffolded path like any other, so it must appear in `created`\n // or in `skipped` by the one rule that governs both. Last, because it is\n // written last.\n const candidates = [\n ...plannedDocsFiles(docsDir),\n ...plannedAgentFiles.map((f) => f.path),\n ...(opts.mcp === true || opts.mcpAuthor === true ? [mcpConfigPath(cwd)] : []),\n ];\n let skipped = candidates.filter((p) => existsSync(p));\n\n // Joining touches the docs repo not at all: it is somebody's committed\n // repository, and \"point at it\" must never mean \"write to it\".\n const created = joining && opts.create !== true ? [] : (await scaffoldDocs(docsDir)).created;\n const generatedFor = delivery.length > 0 ? tools : [];\n let refreshed: string[] = [];\n let managedFiles: Record<string, string> = {};\n if (delivery.length > 0) {\n const synced = await syncAgentCommands({\n cwd,\n toolIds: tools,\n delivery,\n profile,\n known: existing?.agentFiles,\n });\n created.push(...synced.created);\n refreshed = synced.refreshed;\n managedFiles = synced.managed;\n skipped = skipped.filter((path) => !refreshed.includes(path));\n }\n\n // The third delivery, and the only machine-readable one. It refuses out\n // loud rather than being written best-effort: a `.mcp.json` half-landed\n // is a host that starts a broken server, and the caller asked for it by\n // name. Before saveConfig, so a run that cannot write this file has not\n // yet moved the committed pointer either.\n let mcpWritten = false;\n if (opts.mcp === true || opts.mcpAuthor === true) {\n const write = await writeMcpConfig(cwd, opts.mcpAuthor === true);\n if (write.kind === \"failed\") {\n fail(json, write.code, write.message);\n return;\n }\n mcpWritten = write.kind === \"created\";\n if (mcpWritten) created.push(mcpConfigPath(cwd));\n }\n\n const stored = storedDocsDir(docsOption);\n // Union, not replacement: this run's files join the ones earlier runs left\n // on disk, and `agentTools` is a record of what the repo HOLDS. A run that\n // generated nothing adds nothing and erases nothing.\n const recordedTools = [...new Set([...(existing?.agentTools ?? []), ...generatedFor])];\n const agentFileManifest = updatedAgentFileManifest(cwd, plannedAgentFiles, existing?.agentFiles, managedFiles);\n const config: StoredConfig = {\n ...existing,\n docsDir: stored,\n ...(opts.service ? { service: opts.service } : {}),\n ...(recordedTools.length > 0 ? { agentTools: recordedTools } : {}),\n agentProfile: profile,\n };\n if (Object.keys(agentFileManifest).length > 0) config.agentFiles = agentFileManifest;\n const configFile = await saveConfig(config, cwd);\n\n const serviceCount = (await listServices(docsDir)).length;\n\n if (json) {\n // `docsDir` stays the resolved absolute path — it is what a consumer\n // needs to find the repo. `docsDirStored` is what was written to\n // loam.json, which is the fact this command is now careful about.\n // `tools` names what files were generated FOR — empty when every\n // delivery was suppressed and none were. `detected` is the separate\n // question of what the scan SAW, which `--tools` overrides without\n // changing: an agent comparing the two learns whether its selection\n // matches the repo.\n emitJson({\n command: \"init\",\n docsDir,\n docsDirStored: stored,\n // Where the pointer came from: `flag` (a --docs somebody typed),\n // `config` (the one this repo already committed — a re-run cannot\n // move it), or `default` (nothing said, nothing committed).\n docsDirSource: docsSource,\n docsRepo: joining ? \"existing\" : \"created\",\n services: serviceCount,\n created,\n refreshed,\n skipped,\n tools: generatedFor,\n agentProfile: profile,\n detected,\n });\n return;\n }\n\n console.log(\"loam initialized.\");\n if (joining) {\n console.log(` docs repo: ${docsDir}`);\n console.log(` pointing at existing docs repo (${serviceCount} services)`);\n } else {\n console.log(` docs repo: ${docsDir} (created)`);\n }\n console.log(\n ` docsDir: ${stored} (as stored in ${CONFIG_FILENAME}`\n + (docsSource === \"config\" ? \" — kept; no --docs was passed\" : \"\") + \")\",\n );\n if (config.service) console.log(` service: ${config.service}`);\n console.log(` config: ${configFile}`);\n console.log(` commit ${CONFIG_FILENAME} — docsDir is resolved relative to it`);\n if (opts.tools === undefined && detected.length > 0) {\n console.log(` detected: ${detected.join(\", \")}`);\n }\n if (opts.commands) console.log(` commands: ${tools.join(\", \")}`);\n if (opts.skills) console.log(` skills: ${tools.join(\", \")}`);\n console.log(` profile: ${profile}`);\n if (created.length > 0) {\n console.log(\" scaffolded:\");\n for (const c of created) console.log(` + ${c}`);\n }\n if (refreshed.length > 0) {\n console.log(\" refreshed (unchanged since loam last wrote them):\");\n for (const path of refreshed) console.log(` ↻ ${path}`);\n }\n\n // The one skipped path that earns more than its line in `skipped`: loam\n // will not merge into a `.mcp.json` a human owns, and the caller asked\n // for this delivery by name — so they are handed the exact key to paste\n // into their own `mcpServers` object. Nothing was read out of their file\n // to produce it; the snippet is the same bytes a fresh write would have\n // used, which is also why it names the launch form this install shape\n // actually needs.\n if ((opts.mcp === true || opts.mcpAuthor === true) && !mcpWritten) {\n console.log(` mcp: ${MCP_CONFIG_FILENAME} is already here — left exactly as it is.`);\n console.log(` paste this into its \"mcpServers\" object:`);\n for (const line of mcpServerSnippet(cwd, opts.mcpAuthor === true)) console.log(` ${line}`);\n }\n\n // Printed ONLY when this run created the docs repo. With a service bound\n // (the binding may predate the run — the config spread above carries an\n // existing loam.json's `service` forward) it is the single-repo trial's\n // hour. `loam status` is NOT mute here — its first-hour ladder\n // (core/status/fleet/next.ts) already answers `next.adopt-bound` in\n // exactly this state — but status has to be run to say so, and no status\n // rung ever names `loam vouch`, the one step of this loop that is a\n // person's; init's output is already on screen, so it prints the whole\n // hour once. With none bound it is the docs repo's own hour (map, bind,\n // adopt — first-hour.ts says why that used to be silence). A join stays\n // silent on purpose: a joined fleet has other repositories already\n // through this loop, and `loam status` in its docs repo is the working\n // guide there. The --json path returned above, so the envelope is\n // byte-identical to before this block existed: neither variant has a key.\n if (!joining) for (const line of firstHourLines(config.service)) console.log(line);\n });\n}\n"]}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `loam init --mcp`: the one MACHINE delivery `init` makes.
|
|
3
|
+
*
|
|
4
|
+
* Every other thing init writes is prose an agent reads — command files and
|
|
5
|
+
* Agent Skills, twenty tools' worth of dialects, all of them pointers at
|
|
6
|
+
* `loam instructions`. The MCP facade is the opposite: a typed read surface,
|
|
7
|
+
* four bounded authoring entries under `--author`, version-matched resources,
|
|
8
|
+
* and every result carrying the `--json` envelope as `structuredContent`. It
|
|
9
|
+
* was also the only delivery that required a human to hand-edit a JSON file
|
|
10
|
+
* before anything could reach it — the generated
|
|
11
|
+
* AGENTS.md said no more than "configure the host to launch `loam mcp` in the
|
|
12
|
+
* repository the tools should answer for", so a scaffolded repository reliably
|
|
13
|
+
* got the prose deliveries and never the typed one.
|
|
14
|
+
*
|
|
15
|
+
* OPT-IN, and that is not timidity. `.mcp.json` at the repo root is a file a
|
|
16
|
+
* host reads and then STARTS A PROCESS from, for everyone who checks the
|
|
17
|
+
* repository out. Writing one by default would mean `loam init` silently
|
|
18
|
+
* arranging for a binary to be launched on a teammate's machine, which is a
|
|
19
|
+
* decision that belongs to whoever runs the command, not to us.
|
|
20
|
+
*
|
|
21
|
+
* ## Why only the repo-root `.mcp.json`
|
|
22
|
+
*
|
|
23
|
+
* loam knows twenty agent tools and several of them read MCP configuration
|
|
24
|
+
* from a file of their own. None of the others is written here, and a future
|
|
25
|
+
* reader who wants to add them should meet the argument first:
|
|
26
|
+
*
|
|
27
|
+
* - `.github/.mcp.json` is already in the registry as a Copilot DETECTION
|
|
28
|
+
* marker (tools/registry.ts). Writing it would make the next `init` detect
|
|
29
|
+
* Copilot in a repository that has none, because we put the marker there —
|
|
30
|
+
* a scan reporting its own output back to itself.
|
|
31
|
+
* - `.cursor/mcp.json` and `.vscode/mcp.json` carry different schemas
|
|
32
|
+
* (`servers` rather than `mcpServers`, plus per-host keys), so a single set
|
|
33
|
+
* of bytes cannot serve all three, and one template per host is one more
|
|
34
|
+
* thing to keep true across releases of somebody else's product.
|
|
35
|
+
* - `.gemini/settings.json` is a GENERAL settings file. Its MCP block is one
|
|
36
|
+
* key among many, so loam could only land it by merging into a file the
|
|
37
|
+
* user owns — and merging into a file a human owns is the one thing every
|
|
38
|
+
* init delivery is built not to do.
|
|
39
|
+
*
|
|
40
|
+
* The repo-root `.mcp.json` is the form with none of those problems: it is a
|
|
41
|
+
* dedicated file, it is nobody's detection marker, and it is read by the hosts
|
|
42
|
+
* that matter without being owned by any of them.
|
|
43
|
+
*/
|
|
44
|
+
import { existsSync } from "node:fs";
|
|
45
|
+
import { join } from "node:path";
|
|
46
|
+
import { stageWrites } from "../../core/staging/commit.js";
|
|
47
|
+
import { commitStaged } from "../../core/staging/txn/transaction.js";
|
|
48
|
+
import { planWrite } from "../../core/staging/writes.js";
|
|
49
|
+
export const MCP_CONFIG_FILENAME = ".mcp.json";
|
|
50
|
+
/** The one file this delivery writes, so init's `skipped` probe and the writer cannot disagree. */
|
|
51
|
+
export function mcpConfigPath(cwd) {
|
|
52
|
+
return join(cwd, MCP_CONFIG_FILENAME);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* How `loam` is launched HERE, decided from how it is installed here.
|
|
56
|
+
*
|
|
57
|
+
* A fixed `"command": "loam"` would be an unlaunchable entry in exactly the
|
|
58
|
+
* repositories README tells people to make: the documented install is a
|
|
59
|
+
* per-repo devDependency, which puts the binary in `node_modules/.bin/` and on
|
|
60
|
+
* no PATH an MCP host inherits. So the local bin decides — `npx --no` when it
|
|
61
|
+
* is there, the bare name when it is not.
|
|
62
|
+
*
|
|
63
|
+
* `--no` and not a bare `npx loam mcp`: without it npx will FETCH `loam` from
|
|
64
|
+
* the registry when the local resolution misses, which turns a stale checkout
|
|
65
|
+
* into a silent download of a package with a name loam does not own. With it,
|
|
66
|
+
* a missing local binary is an error the host reports.
|
|
67
|
+
*
|
|
68
|
+
* The probe is the extensionless name on both platforms deliberately: npm's
|
|
69
|
+
* shim writer lays down `loam`, `loam.cmd` and `loam.ps1` together on Windows,
|
|
70
|
+
* the first of them for the POSIX shells that run there, so its presence is the
|
|
71
|
+
* portable question "is loam installed into this project".
|
|
72
|
+
*/
|
|
73
|
+
export function mcpLaunch(cwd, author = false) {
|
|
74
|
+
const localBin = join(cwd, "node_modules", ".bin", "loam");
|
|
75
|
+
const args = ["mcp", ...(author ? ["--author"] : [])];
|
|
76
|
+
return existsSync(localBin)
|
|
77
|
+
? { command: "npx", args: ["--no", "loam", ...args] }
|
|
78
|
+
: { command: "loam", args };
|
|
79
|
+
}
|
|
80
|
+
/** The whole file, exactly as it lands. */
|
|
81
|
+
export function mcpConfigContent(cwd, author = false) {
|
|
82
|
+
return `${JSON.stringify({ mcpServers: { loam: mcpLaunch(cwd, author) } }, null, 2)}\n`;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The `"loam": { … }` entry alone, as lines — what init prints when the file
|
|
86
|
+
* is already there so a person can paste the one key into their own
|
|
87
|
+
* `mcpServers` object.
|
|
88
|
+
*
|
|
89
|
+
* Sliced out of the same object the file is made of rather than spelled a
|
|
90
|
+
* second time: a snippet that drifts from the bytes is worse than no snippet,
|
|
91
|
+
* because the reader has no way to tell which of the two is current.
|
|
92
|
+
*/
|
|
93
|
+
export function mcpServerSnippet(cwd, author = false) {
|
|
94
|
+
return JSON.stringify({ loam: mcpLaunch(cwd, author) }, null, 2)
|
|
95
|
+
.split("\n")
|
|
96
|
+
.slice(1, -1)
|
|
97
|
+
.map((line) => line.slice(2));
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Write `.mcp.json`, or report why not.
|
|
101
|
+
*
|
|
102
|
+
* Through the journaled transaction every other loam writer uses, not a bare
|
|
103
|
+
* `writeFile`: the write is an exclusive create (the existsSync above proves
|
|
104
|
+
* the path is free), so two inits racing for the same repository serialise
|
|
105
|
+
* into the same "already there, left alone" answer instead of one of them
|
|
106
|
+
* silently burying the other's bytes. `root` is the repository being
|
|
107
|
+
* scaffolded, which is where a killed run's `.loam-commit` belongs — the same
|
|
108
|
+
* place `gherkin` journals its own writes into a service repo.
|
|
109
|
+
*/
|
|
110
|
+
export async function writeMcpConfig(cwd, author = false) {
|
|
111
|
+
const path = mcpConfigPath(cwd);
|
|
112
|
+
if (existsSync(path))
|
|
113
|
+
return { kind: "skipped" };
|
|
114
|
+
const staged = await stageWrites([planWrite(path, mcpConfigContent(cwd, author))]);
|
|
115
|
+
const committed = await commitStaged({
|
|
116
|
+
root: cwd,
|
|
117
|
+
command: "init",
|
|
118
|
+
rerun: author ? "loam init --mcp-author" : "loam init --mcp",
|
|
119
|
+
target: MCP_CONFIG_FILENAME,
|
|
120
|
+
}, staged, "written");
|
|
121
|
+
if (committed.ok)
|
|
122
|
+
return { kind: "created" };
|
|
123
|
+
// A lost exclusive create is the never-overwrite contract firing one layer
|
|
124
|
+
// down — somebody else's `.mcp.json` is there now, and "present, so skipped"
|
|
125
|
+
// is the answer the probe above would have given a moment later. Nothing of
|
|
126
|
+
// ours went in; there is no half-state to report.
|
|
127
|
+
if (committed.raced)
|
|
128
|
+
return { kind: "skipped" };
|
|
129
|
+
return { kind: "failed", code: committed.code, message: committed.message };
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=mcp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../src/commands/init/mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAE/C,mGAAmG;AACnG,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO,IAAI,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;AACxC,CAAC;AAQD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW,EAAE,MAAM,GAAG,KAAK;IACnD,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3D,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACtD,OAAO,UAAU,CAAC,QAAQ,CAAC;QACzB,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE;QACrD,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,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AAM,EAAE,mBAAmB;KAC5B,EACD,MAAM,EACN,SAAS,CACV,CAAC;IACF,IAAI,SAAS,CAAC,EAAE;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC7C,2EAA2E;IAC3E,6EAA6E;IAC7E,4EAA4E;IAC5E,kDAAkD;IAClD,IAAI,SAAS,CAAC,KAAK;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAChD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE,CAAC;AAC9E,CAAC","sourcesContent":["/**\n * `loam init --mcp`: the one MACHINE delivery `init` makes.\n *\n * Every other thing init writes is prose an agent reads — command files and\n * Agent Skills, twenty tools' worth of dialects, all of them pointers at\n * `loam instructions`. The MCP facade is the opposite: a typed read surface,\n * four bounded authoring entries under `--author`, version-matched resources,\n * and every result carrying the `--json` envelope as `structuredContent`. It\n * was also the only delivery that required a human to hand-edit a JSON file\n * before anything could reach it — the generated\n * AGENTS.md said no more than \"configure the host to launch `loam mcp` in the\n * repository the tools should answer for\", so a scaffolded repository reliably\n * got the prose deliveries and never the typed one.\n *\n * OPT-IN, and that is not timidity. `.mcp.json` at the repo root is a file a\n * host reads and then STARTS A PROCESS from, for everyone who checks the\n * repository out. Writing one by default would mean `loam init` silently\n * arranging for a binary to be launched on a teammate's machine, which is a\n * decision that belongs to whoever runs the command, not to us.\n *\n * ## Why only the repo-root `.mcp.json`\n *\n * loam knows twenty agent tools and several of them read MCP configuration\n * from a file of their own. None of the others is written here, and a future\n * reader who wants to add them should meet the argument first:\n *\n * - `.github/.mcp.json` is already in the registry as a Copilot DETECTION\n * marker (tools/registry.ts). Writing it would make the next `init` detect\n * Copilot in a repository that has none, because we put the marker there —\n * a scan reporting its own output back to itself.\n * - `.cursor/mcp.json` and `.vscode/mcp.json` carry different schemas\n * (`servers` rather than `mcpServers`, plus per-host keys), so a single set\n * of bytes cannot serve all three, and one template per host is one more\n * thing to keep true across releases of somebody else's product.\n * - `.gemini/settings.json` is a GENERAL settings file. Its MCP block is one\n * key among many, so loam could only land it by merging into a file the\n * user owns — and merging into a file a human owns is the one thing every\n * init delivery is built not to do.\n *\n * The repo-root `.mcp.json` is the form with none of those problems: it is a\n * dedicated file, it is nobody's detection marker, and it is read by the hosts\n * that matter without being owned by any of them.\n */\nimport { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { stageWrites } from \"../../core/staging/commit.js\";\nimport { commitStaged } from \"../../core/staging/txn/transaction.js\";\nimport { planWrite } from \"../../core/staging/writes.js\";\n\nexport const MCP_CONFIG_FILENAME = \".mcp.json\";\n\n/** The one file this delivery writes, so init's `skipped` probe and the writer cannot disagree. */\nexport function mcpConfigPath(cwd: string): string {\n return join(cwd, MCP_CONFIG_FILENAME);\n}\n\n/** What a host is told to run: the `command`/`args` pair of the `loam` server entry. */\nexport interface McpLaunch {\n command: string;\n args: string[];\n}\n\n/**\n * How `loam` is launched HERE, decided from how it is installed here.\n *\n * A fixed `\"command\": \"loam\"` would be an unlaunchable entry in exactly the\n * repositories README tells people to make: the documented install is a\n * per-repo devDependency, which puts the binary in `node_modules/.bin/` and on\n * no PATH an MCP host inherits. So the local bin decides — `npx --no` when it\n * is there, the bare name when it is not.\n *\n * `--no` and not a bare `npx loam mcp`: without it npx will FETCH `loam` from\n * the registry when the local resolution misses, which turns a stale checkout\n * into a silent download of a package with a name loam does not own. With it,\n * a missing local binary is an error the host reports.\n *\n * The probe is the extensionless name on both platforms deliberately: npm's\n * shim writer lays down `loam`, `loam.cmd` and `loam.ps1` together on Windows,\n * the first of them for the POSIX shells that run there, so its presence is the\n * portable question \"is loam installed into this project\".\n */\nexport function mcpLaunch(cwd: string, author = false): McpLaunch {\n const localBin = join(cwd, \"node_modules\", \".bin\", \"loam\");\n const args = [\"mcp\", ...(author ? [\"--author\"] : [])];\n return existsSync(localBin)\n ? { command: \"npx\", args: [\"--no\", \"loam\", ...args] }\n : { command: \"loam\", args };\n}\n\n/** The whole file, exactly as it lands. */\nexport function mcpConfigContent(cwd: string, author = false): string {\n return `${JSON.stringify({ mcpServers: { loam: mcpLaunch(cwd, author) } }, null, 2)}\\n`;\n}\n\n/**\n * The `\"loam\": { … }` entry alone, as lines — what init prints when the file\n * is already there so a person can paste the one key into their own\n * `mcpServers` object.\n *\n * Sliced out of the same object the file is made of rather than spelled a\n * second time: a snippet that drifts from the bytes is worse than no snippet,\n * because the reader has no way to tell which of the two is current.\n */\nexport function mcpServerSnippet(cwd: string, author = false): string[] {\n return JSON.stringify({ loam: mcpLaunch(cwd, author) }, null, 2)\n .split(\"\\n\")\n .slice(1, -1)\n .map((line) => line.slice(2));\n}\n\n/**\n * What happened to `.mcp.json` on this run. `skipped` is the never-overwrite\n * contract every other init delivery follows, and for the same reason: loam\n * does not merge into a file a human owns, so an existing `.mcp.json` is\n * reported and left byte-for-byte alone — no parse, no key merge, no rewrite.\n */\nexport type McpWrite =\n | { kind: \"created\" }\n | { kind: \"skipped\" }\n | { kind: \"failed\"; code: \"merge-failed\" | \"rollback-incomplete\"; message: string };\n\n/**\n * Write `.mcp.json`, or report why not.\n *\n * Through the journaled transaction every other loam writer uses, not a bare\n * `writeFile`: the write is an exclusive create (the existsSync above proves\n * the path is free), so two inits racing for the same repository serialise\n * into the same \"already there, left alone\" answer instead of one of them\n * silently burying the other's bytes. `root` is the repository being\n * scaffolded, which is where a killed run's `.loam-commit` belongs — the same\n * place `gherkin` journals its own writes into a service repo.\n */\nexport async function writeMcpConfig(cwd: string, author = false): Promise<McpWrite> {\n const path = mcpConfigPath(cwd);\n if (existsSync(path)) return { kind: \"skipped\" };\n\n const staged = await stageWrites([planWrite(path, mcpConfigContent(cwd, author))]);\n const committed = await commitStaged(\n {\n root: cwd,\n command: \"init\",\n rerun: author ? \"loam init --mcp-author\" : \"loam init --mcp\",\n target: MCP_CONFIG_FILENAME,\n },\n staged,\n \"written\",\n );\n if (committed.ok) return { kind: \"created\" };\n // A lost exclusive create is the never-overwrite contract firing one layer\n // down — somebody else's `.mcp.json` is there now, and \"present, so skipped\"\n // is the answer the probe above would have given a moment later. Nothing of\n // ours went in; there is no half-state to report.\n if (committed.raced) return { kind: \"skipped\" };\n return { kind: \"failed\", code: committed.code, message: committed.message };\n}\n"]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The three questions `loam init` answers before it writes anything: which
|
|
3
|
+
* agent tools were asked for, where the docs are being recorded, and whether a
|
|
4
|
+
* directory already IS a docs repo.
|
|
5
|
+
*
|
|
6
|
+
* They are here rather than inline because each one has a default that is a
|
|
7
|
+
* decision. `--tools` has no commander default on purpose, so an explicit flag
|
|
8
|
+
* stays distinguishable from none — which is what lets the autodetection
|
|
9
|
+
* fallback and the `--no-*` contradiction be decided rather than silently
|
|
10
|
+
* arbitrated.
|
|
11
|
+
*/
|
|
12
|
+
import { existsSync } from "node:fs";
|
|
13
|
+
import { fail } from "../../core/envelope/json.js";
|
|
14
|
+
import { agentsPath } from "../../core/repo/paths.js";
|
|
15
|
+
import { docsRepoState } from "../../core/repo/state.js";
|
|
16
|
+
import { AGENT_TOOLS } from "../../core/agent/tools/registry.js";
|
|
17
|
+
import { AGENT_PROFILES, } from "../../core/agent/scaffold.js";
|
|
18
|
+
export function resolveAgentProfile(raw, current, json) {
|
|
19
|
+
const value = raw ?? current ?? "full";
|
|
20
|
+
if (AGENT_PROFILES.includes(value))
|
|
21
|
+
return value;
|
|
22
|
+
fail(json, "invalid-option", `Unknown --agent-profile '${value}'. Expected: ${AGENT_PROFILES.join(" | ")}.`);
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Resolve --tools to registry ids, or null after reporting the refusal. The
|
|
27
|
+
* default (the cwd scan) lives at the call site, not in commander, so an
|
|
28
|
+
* explicit `--tools` is distinguishable from none — which is what lets both the
|
|
29
|
+
* autodetection fallback and the `--no-*` contradiction be decided instead of
|
|
30
|
+
* silently arbitrated.
|
|
31
|
+
*/
|
|
32
|
+
export function resolveTools(raw, json) {
|
|
33
|
+
const supported = Object.keys(AGENT_TOOLS);
|
|
34
|
+
if (raw === "all")
|
|
35
|
+
return supported;
|
|
36
|
+
const ids = [...new Set(raw.split(",").map((t) => t.trim()).filter((t) => t !== ""))];
|
|
37
|
+
const unknown = ids.filter((t) => !(t in AGENT_TOOLS));
|
|
38
|
+
if (ids.length === 0 || unknown.length > 0) {
|
|
39
|
+
fail(json, "invalid-option", (ids.length === 0
|
|
40
|
+
? "--tools names no tool."
|
|
41
|
+
: `--tools does not recognize: ${unknown.join(", ")}.`) +
|
|
42
|
+
` Supported: ${supported.join(", ")} — or "all".`);
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
return ids;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* `--docs` exactly as the caller wrote it, with separators normalised.
|
|
49
|
+
*
|
|
50
|
+
* Stored verbatim on purpose. `init` used to resolve it and write the absolute
|
|
51
|
+
* result, which meant a committed loam.json named a directory that existed on
|
|
52
|
+
* one laptop: every teammate who cloned the service repo got a docsDir under
|
|
53
|
+
* someone else's home directory, and `loam list` reported an empty fleet
|
|
54
|
+
* instead of saying so. `loadConfig` resolves relative paths against the config
|
|
55
|
+
* file's own directory, so `../docs` keeps meaning "next to this repo" wherever
|
|
56
|
+
* the pair is checked out. An absolute `--docs` is still stored absolute — that
|
|
57
|
+
* is the caller's explicit choice, and `loam doctor` warns about it.
|
|
58
|
+
*
|
|
59
|
+
* Backslashes become forward slashes so a config written on Windows resolves on
|
|
60
|
+
* POSIX; a trailing separator is dropped so the stored spelling is stable.
|
|
61
|
+
*/
|
|
62
|
+
export function storedDocsDir(raw) {
|
|
63
|
+
const slashed = raw.split("\\").join("/");
|
|
64
|
+
if (slashed.length <= 1)
|
|
65
|
+
return slashed;
|
|
66
|
+
const trimmed = slashed.replace(/\/+$/, "");
|
|
67
|
+
return trimmed === "" ? "/" : trimmed;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Does this directory already hold a docs repo? `services/` plus `AGENTS.md` —
|
|
71
|
+
* the two things every docs repo has and no service repo does. The pair is the
|
|
72
|
+
* whole point: a single marker would make `init --docs ../srv` (a typo for
|
|
73
|
+
* `../docs`) look like a join and adopt the service repo as the fleet.
|
|
74
|
+
*/
|
|
75
|
+
export function isDocsRepo(dir) {
|
|
76
|
+
return docsRepoState(dir).kind === "ok" && existsSync(agentsPath(dir));
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/commands/init/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EACL,cAAc,GAEf,MAAM,8BAA8B,CAAC;AAEtC,MAAM,UAAU,mBAAmB,CACjC,GAAuB,EACvB,OAAiC,EACjC,IAAa;IAEb,MAAM,KAAK,GAAG,GAAG,IAAI,OAAO,IAAI,MAAM,CAAC;IACvC,IAAI,cAAc,CAAC,QAAQ,CAAC,KAAqB,CAAC;QAAE,OAAO,KAAqB,CAAC;IACjF,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,4BAA4B,KAAK,gBAAgB,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7G,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,IAAa;IACrD,MAAM,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E,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;AACxC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,GAAY;IACrC,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AACzE,CAAC","sourcesContent":["/**\n * The three questions `loam init` answers before it writes anything: which\n * agent tools were asked for, where the docs are being recorded, and whether a\n * directory already IS a docs repo.\n *\n * They are here rather than inline because each one has a default that is a\n * decision. `--tools` has no commander default on purpose, so an explicit flag\n * stays distinguishable from none — which is what lets the autodetection\n * fallback and the `--no-*` contradiction be decided rather than silently\n * arbitrated.\n */\nimport { existsSync } from \"node:fs\";\nimport type { DocsDir } from \"../../core/kernel/ids/dirs.js\";\nimport { fail } from \"../../core/envelope/json.js\";\nimport { agentsPath } from \"../../core/repo/paths.js\";\nimport { docsRepoState } from \"../../core/repo/state.js\";\nimport { AGENT_TOOLS } from \"../../core/agent/tools/registry.js\";\nimport {\n AGENT_PROFILES,\n type AgentProfile,\n} from \"../../core/agent/scaffold.js\";\n\nexport function resolveAgentProfile(\n raw: string | undefined,\n current: AgentProfile | undefined,\n json: boolean,\n): AgentProfile | null {\n const value = raw ?? current ?? \"full\";\n if (AGENT_PROFILES.includes(value as AgentProfile)) return value as AgentProfile;\n fail(json, \"invalid-option\", `Unknown --agent-profile '${value}'. Expected: ${AGENT_PROFILES.join(\" | \")}.`);\n return null;\n}\n\n/**\n * Resolve --tools to registry ids, or null after reporting the refusal. The\n * default (the cwd scan) lives at the call site, not in commander, so an\n * explicit `--tools` is distinguishable from none — which is what lets both the\n * autodetection fallback and the `--no-*` contradiction be decided instead of\n * silently arbitrated.\n */\nexport function resolveTools(raw: string, json: boolean): string[] | null {\n const supported = Object.keys(AGENT_TOOLS);\n if (raw === \"all\") return supported;\n const ids = [...new Set(raw.split(\",\").map((t) => t.trim()).filter((t) => t !== \"\"))];\n const unknown = ids.filter((t) => !(t in AGENT_TOOLS));\n if (ids.length === 0 || unknown.length > 0) {\n fail(\n json,\n \"invalid-option\",\n (ids.length === 0\n ? \"--tools names no tool.\"\n : `--tools does not recognize: ${unknown.join(\", \")}.`) +\n ` Supported: ${supported.join(\", \")} — or \"all\".`,\n );\n return null;\n }\n return ids;\n}\n\n/**\n * `--docs` exactly as the caller wrote it, with separators normalised.\n *\n * Stored verbatim on purpose. `init` used to resolve it and write the absolute\n * result, which meant a committed loam.json named a directory that existed on\n * one laptop: every teammate who cloned the service repo got a docsDir under\n * someone else's home directory, and `loam list` reported an empty fleet\n * instead of saying so. `loadConfig` resolves relative paths against the config\n * file's own directory, so `../docs` keeps meaning \"next to this repo\" wherever\n * the pair is checked out. An absolute `--docs` is still stored absolute — that\n * is the caller's explicit choice, and `loam doctor` warns about it.\n *\n * Backslashes become forward slashes so a config written on Windows resolves on\n * POSIX; a trailing separator is dropped so the stored spelling is stable.\n */\nexport function storedDocsDir(raw: string): string {\n const slashed = raw.split(\"\\\\\").join(\"/\");\n if (slashed.length <= 1) return slashed;\n const trimmed = slashed.replace(/\\/+$/, \"\");\n return trimmed === \"\" ? \"/\" : trimmed;\n}\n\n/**\n * Does this directory already hold a docs repo? `services/` plus `AGENTS.md` —\n * the two things every docs repo has and no service repo does. The pair is the\n * whole point: a single marker would make `init --docs ../srv` (a typo for\n * `../docs`) look like a join and adopt the service repo as the fleet.\n */\nexport function isDocsRepo(dir: DocsDir): boolean {\n return docsRepoState(dir).kind === \"ok\" && existsSync(agentsPath(dir));\n}\n"]}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import { PROTOCOLS, WORKFLOWS, placeholderProblems, protocolFor } from "../core/agent.js";
|
|
2
|
-
import { emitJson, fail } from "../core/json.js";
|
|
3
|
-
import { LOAM_VERSION } from "../core/version.js";
|
|
1
|
+
import { PROTOCOLS, REFERENCE_PAGES, SUPPORT_PAGES, WORKFLOWS, placeholderProblems, protocolFor, } from "../core/agent/protocol.js";
|
|
2
|
+
import { emitJson, fail } from "../core/envelope/json.js";
|
|
3
|
+
import { LOAM_VERSION } from "../core/envelope/version.js";
|
|
4
|
+
import { withoutFixTables } from "../core/explain/fix-tables.js";
|
|
4
5
|
/**
|
|
5
|
-
* The workflow protocols, from the binary rather than
|
|
6
|
-
* generated once.
|
|
6
|
+
* The workflow protocols and the reference pages, from the binary rather than
|
|
7
|
+
* from a file somebody generated once.
|
|
8
|
+
*
|
|
9
|
+
* The pages are the newer half and the reason this command now has two lists.
|
|
10
|
+
* They are the sections that left the scaffolded AGENTS.md — a file every
|
|
11
|
+
* agents.md-aware host auto-loads on every session, which two hosts truncate
|
|
12
|
+
* silently — and they are printed here instead. That trade only works if they
|
|
13
|
+
* can be FOUND, so the bare menu names them; `core/agent/workflows/reference/
|
|
14
|
+
* reference.ts` carries the rest of the argument.
|
|
7
15
|
*
|
|
8
16
|
* This is the only command in loam that reads nothing: no `loam.json`, no docs
|
|
9
17
|
* repo, no service. That is deliberate and it is the point — an agent runs this
|
|
@@ -16,10 +24,25 @@ import { LOAM_VERSION } from "../core/version.js";
|
|
|
16
24
|
export function registerInstructions(program) {
|
|
17
25
|
program
|
|
18
26
|
.command("instructions")
|
|
19
|
-
|
|
27
|
+
// Still spelled `workflow`, not `page`: the positional is in every
|
|
28
|
+
// generated command file loam has ever written (`loam instructions
|
|
29
|
+
// loam-adopt $1`) and in `--help` output people have copied. Renaming it
|
|
30
|
+
// buys a more accurate word in one usage line and costs nothing anywhere
|
|
31
|
+
// the rename would be visible, so the accuracy goes in the menu text instead.
|
|
32
|
+
.argument("[workflow]", "workflow or reference page (loam-adopt, loam-codes, …); omit to list them")
|
|
20
33
|
.argument("[args...]", "values substituted for the protocol's $1, $2, … placeholders")
|
|
21
|
-
.description("Print a workflow protocol, version-matched to this binary")
|
|
34
|
+
.description("Print a workflow protocol or reference page, version-matched to this binary")
|
|
22
35
|
.option("--json", "emit the machine contract instead of the human view")
|
|
36
|
+
// Opt-in, and off by default, so the default page of every lifecycle protocol
|
|
37
|
+
// stays byte-identical: this narrows what an agent CAN ask for, it does not
|
|
38
|
+
// change what it gets when it asks for nothing. The one protocol this is
|
|
39
|
+
// about is /loam-check, whose fix tables are 83 KB of the 84 it prints —
|
|
40
|
+
// about a fifth of a 100k-token window spent before the first check has
|
|
41
|
+
// run — while `loam explain <code>` answers any one of those rows in under
|
|
42
|
+
// 500 bytes. The narrowed page keeps every paragraph that INTRODUCES a
|
|
43
|
+
// table, because that sentence is what says which scope a code was graded
|
|
44
|
+
// in; only the rows go.
|
|
45
|
+
.option("--no-fix-tables", "drop the per-code fix tables; `loam explain <code>` answers any code a run reports")
|
|
23
46
|
// Every positional here is DATA — a feature id, a service id, a validate
|
|
24
47
|
// target — and one of those targets is spelled `--all`. Without this,
|
|
25
48
|
// commander reads a leading-dash argument as an option it does not have and
|
|
@@ -31,15 +54,44 @@ export function registerInstructions(program) {
|
|
|
31
54
|
const json = opts.json === true;
|
|
32
55
|
if (workflow === undefined) {
|
|
33
56
|
if (json) {
|
|
34
|
-
|
|
57
|
+
// `support` and `references` are ADDITIVE beside the `workflows` key
|
|
58
|
+
// a consumer already reads. Appending either kind to `workflows`
|
|
59
|
+
// would have been the smaller diff and the wrong one: a caller
|
|
60
|
+
// iterating that array to drive the cycle would start running
|
|
61
|
+
// diagnostics or documentation as steps.
|
|
62
|
+
emitJson({
|
|
63
|
+
command: "instructions",
|
|
64
|
+
version: LOAM_VERSION,
|
|
65
|
+
workflows: WORKFLOWS,
|
|
66
|
+
support: SUPPORT_PAGES,
|
|
67
|
+
references: REFERENCE_PAGES,
|
|
68
|
+
});
|
|
35
69
|
return;
|
|
36
70
|
}
|
|
71
|
+
// One column width across all three lists, so the blocks line up as one
|
|
72
|
+
// menu — they are separate KINDS, not separate tables.
|
|
73
|
+
const width = Math.max(...[...WORKFLOWS, ...SUPPORT_PAGES, ...REFERENCE_PAGES].map((w) => w.name.length));
|
|
37
74
|
console.log(`loam ${LOAM_VERSION} — workflows\n`);
|
|
38
|
-
const width = Math.max(...WORKFLOWS.map((w) => w.name.length));
|
|
39
75
|
for (const w of WORKFLOWS) {
|
|
40
76
|
console.log(` ${w.name.padEnd(width)} ${w.description}`);
|
|
41
77
|
}
|
|
42
|
-
console.log(`\
|
|
78
|
+
console.log(`\nsupport — use when a run or agent integration behaves unexpectedly\n`);
|
|
79
|
+
for (const s of SUPPORT_PAGES) {
|
|
80
|
+
console.log(` ${s.name.padEnd(width)} ${s.description}`);
|
|
81
|
+
}
|
|
82
|
+
// Under their own heading, and never merged into the six above. A page
|
|
83
|
+
// has no steps and is not part of the cycle; a flat list of ten would
|
|
84
|
+
// read as a ten-step process, which is the one thing the cycle must not
|
|
85
|
+
// be confused with. The sentence says what they are FOR, because a name
|
|
86
|
+
// alone does not distinguish "reference" from "seventh step".
|
|
87
|
+
console.log(`\nreference pages — printed whole, no arguments\n`);
|
|
88
|
+
for (const r of REFERENCE_PAGES) {
|
|
89
|
+
console.log(` ${r.name.padEnd(width)} ${r.description}`);
|
|
90
|
+
}
|
|
91
|
+
console.log(`\nloam instructions <workflow> [args...] prints one, placeholders filled in.` +
|
|
92
|
+
`\nloam instructions loam-report prints the local incident-reporting protocol.` +
|
|
93
|
+
`\nloam instructions <page> prints a reference page. The pages carry what AGENTS.md` +
|
|
94
|
+
`\nleaves out; \`loam explain <code>\` answers a single code without opening one.`);
|
|
43
95
|
return;
|
|
44
96
|
}
|
|
45
97
|
// Before the substitution, not after: a rendered protocol is a page of
|
|
@@ -56,17 +108,23 @@ export function registerInstructions(program) {
|
|
|
56
108
|
if (body === null) {
|
|
57
109
|
// `unknown-target`, the same code `show` uses for a name that resolves
|
|
58
110
|
// to nothing. The known set is small and closed, so it is listed rather
|
|
59
|
-
// than described: a caller that mistyped
|
|
60
|
-
//
|
|
111
|
+
// than described: a caller that mistyped a known name should not have
|
|
112
|
+
// to run a second command to see the choices.
|
|
61
113
|
fail(json, "unknown-target", `No workflow '${workflow}'. Known: ${Object.keys(PROTOCOLS).join(", ")}.`);
|
|
62
114
|
return;
|
|
63
115
|
}
|
|
116
|
+
// The narrowing composes with `--json` rather than forking the envelope:
|
|
117
|
+
// the shorter page rides in the same `body` field, so no key is added or
|
|
118
|
+
// renamed and a consumer that never passes the flag cannot tell the
|
|
119
|
+
// difference. `--json` is the larger of the two views (the whole table is
|
|
120
|
+
// one JSON string), which is exactly why it needs this too.
|
|
121
|
+
const page = opts.fixTables === false ? withoutFixTables(body) : body;
|
|
64
122
|
if (json) {
|
|
65
123
|
// `body` is the substituted text, not the template: a consumer that
|
|
66
124
|
// asked for `loam instructions loam-adopt payment-service --json` wants
|
|
67
125
|
// the protocol it is about to follow, and re-implementing the
|
|
68
126
|
// substitution on the other side is a second copy of the rule.
|
|
69
|
-
emitJson({ command: "instructions", version: LOAM_VERSION, workflow, args, body });
|
|
127
|
+
emitJson({ command: "instructions", version: LOAM_VERSION, workflow, args, body: page });
|
|
70
128
|
return;
|
|
71
129
|
}
|
|
72
130
|
// `console.log`, like every other command, rather than a raw stdout
|
|
@@ -74,7 +132,7 @@ export function registerInstructions(program) {
|
|
|
74
132
|
// invisible to it — an untestable print is how a protocol nobody notices
|
|
75
133
|
// went missing would ship. The body already ends in a newline, so the
|
|
76
134
|
// one console.log adds is trimmed rather than doubled.
|
|
77
|
-
console.log(
|
|
135
|
+
console.log(page.replace(/\n+$/, ""));
|
|
78
136
|
});
|
|
79
137
|
}
|
|
80
138
|
//# sourceMappingURL=instructions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../src/commands/instructions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;A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wE;QACxE,uEAAuE;QACvE,0DAA0D;QAC1D,MAAM,QAAQ,GAAG,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACrD,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YACtB,IAAI,CACF,IAAI,EACJ,gBAAgB,EAChB,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,8CAA8C,QAAQ,YAAY;gBACrF,sFAAsF,CACzF,CAAC;YACF,OAAO;QACT,CAAC;QAED,MAAM,IAAI,GAAG,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACzC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,uEAAuE;YACvE,wEAAwE;YACxE,qEAAqE;YACrE,4CAA4C;YAC5C,IAAI,CACF,IAAI,EACJ,gBAAgB,EAChB,gBAAgB,QAAQ,aAAa,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAC1E,CAAC;YACF,OAAO;QACT,CAAC;QAED,IAAI,IAAI,EAAE,CAAC;YACT,oEAAoE;YACpE,wEAAwE;YACxE,8DAA8D;YAC9D,+DAA+D;YAC/D,QAAQ,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;YACnF,OAAO;QACT,CAAC;QACD,oEAAoE;QACpE,qEAAqE;QACrE,yEAAyE;QACzE,sEAAsE;QACtE,uDAAuD;QACvD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import type { Command } from \"commander\";\nimport { PROTOCOLS, WORKFLOWS, placeholderProblems, protocolFor } from \"../core/agent.js\";\nimport { emitJson, fail } from \"../core/json.js\";\nimport { LOAM_VERSION } from \"../core/version.js\";\n\ninterface InstructionsOptions {\n json?: boolean;\n}\n\n/**\n * The workflow protocols, from the binary rather than from a file somebody\n * generated once.\n *\n * This is the only command in loam that reads nothing: no `loam.json`, no docs\n * repo, no service. That is deliberate and it is the point — an agent runs this\n * BEFORE the repository is wired, and a protocol that refused with `no-config`\n * would be unreachable exactly when it is most needed, which is the first\n * minute in an unfamiliar repository. `loam-adopt`'s own first step is to run\n * `loam init` when there is no config, and it cannot be the step that requires\n * one.\n */\nexport function registerInstructions(program: Command): void {\n program\n .command(\"instructions\")\n .argument(\"[workflow]\", \"workflow name (loam-adopt, loam-feature, …); omit to list them\")\n .argument(\"[args...]\", \"values substituted for the protocol's $1, $2, … placeholders\")\n .description(\"Print a workflow protocol, version-matched to this binary\")\n .option(\"--json\", \"emit the machine contract instead of the human view\")\n // Every positional here is DATA — a feature id, a service id, a validate\n // target — and one of those targets is spelled `--all`. Without this,\n // commander reads a leading-dash argument as an option it does not have and\n // refuses the whole invocation, so `/loam-check --all` (the first form the\n // command file's own argument hint offers) got a usage error instead of the\n // protocol. `--json` still parses as the flag it is, because it is declared.\n .allowUnknownOption()\n .action((workflow: string | undefined, args: string[], opts: InstructionsOptions) => {\n const json = opts.json === true;\n\n if (workflow === undefined) {\n if (json) {\n emitJson({ command: \"instructions\", version: LOAM_VERSION, workflows: WORKFLOWS });\n return;\n }\n console.log(`loam ${LOAM_VERSION} — workflows\\n`);\n const width = Math.max(...WORKFLOWS.map((w) => w.name.length));\n for (const w of WORKFLOWS) {\n console.log(` ${w.name.padEnd(width)} ${w.description}`);\n }\n console.log(`\\nloam instructions <workflow> [args...] prints one, placeholders filled in.`);\n return;\n }\n\n // Before the substitution, not after: a rendered protocol is a page of\n // instructions an agent acts on, and a `$1` that cannot be a service id\n // makes every command on that page unrunnable. The refusal reaches the\n // caller in the same shape a mistyped workflow name does.\n const problems = placeholderProblems(workflow, args);\n if (problems !== null) {\n fail(\n json,\n \"invalid-option\",\n `${problems.join(\" \")} Nothing was printed: every command in the ${workflow} protocol ` +\n \"interpolates that value, so the page would name a target no loam command can accept.\",\n );\n return;\n }\n\n const body = protocolFor(workflow, args);\n if (body === null) {\n // `unknown-target`, the same code `show` uses for a name that resolves\n // to nothing. The known set is small and closed, so it is listed rather\n // than described: a caller that mistyped one of six names should not\n // have to run a second command to see them.\n fail(\n json,\n \"unknown-target\",\n `No workflow '${workflow}'. Known: ${Object.keys(PROTOCOLS).join(\", \")}.`,\n );\n return;\n }\n\n if (json) {\n // `body` is the substituted text, not the template: a consumer that\n // asked for `loam instructions loam-adopt payment-service --json` wants\n // the protocol it is about to follow, and re-implementing the\n // substitution on the other side is a second copy of the rule.\n emitJson({ command: \"instructions\", version: LOAM_VERSION, workflow, args, body });\n return;\n }\n // `console.log`, like every other command, rather than a raw stdout\n // write: the test harness captures the console and a direct write is\n // invisible to it — an untestable print is how a protocol nobody notices\n // went missing would ship. The body already ends in a newline, so the\n // one console.log adds is trimmed rather than doubled.\n console.log(body.replace(/\\n+$/, \"\"));\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../src/commands/instructions.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,eAAe,EACf,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,WAAW,GACZ,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAajE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,OAAO;SACJ,OAAO,CAAC,cAAc,CAAC;QACxB,mEAAmE;QACnE,mEAAmE;QACnE,yEAAyE;QACzE,yEAAyE;QACzE,8EAA8E;SAC7E,QAAQ,CAAC,YAAY,EAAE,2EAA2E,CAAC;SACnG,QAAQ,CAAC,WAAW,EAA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,uEAAuE;YACvE,wEAAwE;YACxE,sEAAsE;YACtE,8CAA8C;YAC9C,IAAI,CACF,IAAI,EACJ,gBAAgB,EAChB,gBAAgB,QAAQ,aAAa,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAC1E,CAAC;YACF,OAAO;QACT,CAAC;QAED,yEAAyE;QACzE,yEAAyE;QACzE,oEAAoE;QACpE,0EAA0E;QAC1E,4DAA4D;QAC5D,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAEtE,IAAI,IAAI,EAAE,CAAC;YACT,oEAAoE;YACpE,wEAAwE;YACxE,8DAA8D;YAC9D,+DAA+D;YAC/D,QAAQ,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;YACzF,OAAO;QACT,CAAC;QACD,oEAAoE;QACpE,qEAAqE;QACrE,yEAAyE;QACzE,sEAAsE;QACtE,uDAAuD;QACvD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import type { Command } from \"commander\";\nimport {\n PROTOCOLS,\n REFERENCE_PAGES,\n SUPPORT_PAGES,\n WORKFLOWS,\n placeholderProblems,\n protocolFor,\n} from \"../core/agent/protocol.js\";\nimport { emitJson, fail } from \"../core/envelope/json.js\";\nimport { LOAM_VERSION } from \"../core/envelope/version.js\";\nimport { withoutFixTables } from \"../core/explain/fix-tables.js\";\n\ninterface InstructionsOptions {\n json?: boolean;\n /**\n * Commander's negated-boolean shape: absent means `true`, and only\n * `--no-fix-tables` on the command line makes it `false`. Read as\n * `=== false` at the call site so an undefined — a caller constructing the\n * options object itself, in a test — keeps the default page.\n */\n fixTables?: boolean;\n}\n\n/**\n * The workflow protocols and the reference pages, from the binary rather than\n * from a file somebody generated once.\n *\n * The pages are the newer half and the reason this command now has two lists.\n * They are the sections that left the scaffolded AGENTS.md — a file every\n * agents.md-aware host auto-loads on every session, which two hosts truncate\n * silently — and they are printed here instead. That trade only works if they\n * can be FOUND, so the bare menu names them; `core/agent/workflows/reference/\n * reference.ts` carries the rest of the argument.\n *\n * This is the only command in loam that reads nothing: no `loam.json`, no docs\n * repo, no service. That is deliberate and it is the point — an agent runs this\n * BEFORE the repository is wired, and a protocol that refused with `no-config`\n * would be unreachable exactly when it is most needed, which is the first\n * minute in an unfamiliar repository. `loam-adopt`'s own first step is to run\n * `loam init` when there is no config, and it cannot be the step that requires\n * one.\n */\nexport function registerInstructions(program: Command): void {\n program\n .command(\"instructions\")\n // Still spelled `workflow`, not `page`: the positional is in every\n // generated command file loam has ever written (`loam instructions\n // loam-adopt $1`) and in `--help` output people have copied. Renaming it\n // buys a more accurate word in one usage line and costs nothing anywhere\n // the rename would be visible, so the accuracy goes in the menu text instead.\n .argument(\"[workflow]\", \"workflow or reference page (loam-adopt, loam-codes, …); omit to list them\")\n .argument(\"[args...]\", \"values substituted for the protocol's $1, $2, … placeholders\")\n .description(\"Print a workflow protocol or reference page, version-matched to this binary\")\n .option(\"--json\", \"emit the machine contract instead of the human view\")\n // Opt-in, and off by default, so the default page of every lifecycle protocol\n // stays byte-identical: this narrows what an agent CAN ask for, it does not\n // change what it gets when it asks for nothing. The one protocol this is\n // about is /loam-check, whose fix tables are 83 KB of the 84 it prints —\n // about a fifth of a 100k-token window spent before the first check has\n // run — while `loam explain <code>` answers any one of those rows in under\n // 500 bytes. The narrowed page keeps every paragraph that INTRODUCES a\n // table, because that sentence is what says which scope a code was graded\n // in; only the rows go.\n .option(\n \"--no-fix-tables\",\n \"drop the per-code fix tables; `loam explain <code>` answers any code a run reports\",\n )\n // Every positional here is DATA — a feature id, a service id, a validate\n // target — and one of those targets is spelled `--all`. Without this,\n // commander reads a leading-dash argument as an option it does not have and\n // refuses the whole invocation, so `/loam-check --all` (the first form the\n // command file's own argument hint offers) got a usage error instead of the\n // protocol. `--json` still parses as the flag it is, because it is declared.\n .allowUnknownOption()\n .action((workflow: string | undefined, args: string[], opts: InstructionsOptions) => {\n const json = opts.json === true;\n\n if (workflow === undefined) {\n if (json) {\n // `support` and `references` are ADDITIVE beside the `workflows` key\n // a consumer already reads. Appending either kind to `workflows`\n // would have been the smaller diff and the wrong one: a caller\n // iterating that array to drive the cycle would start running\n // diagnostics or documentation as steps.\n emitJson({\n command: \"instructions\",\n version: LOAM_VERSION,\n workflows: WORKFLOWS,\n support: SUPPORT_PAGES,\n references: REFERENCE_PAGES,\n });\n return;\n }\n // One column width across all three lists, so the blocks line up as one\n // menu — they are separate KINDS, not separate tables.\n const width = Math.max(\n ...[...WORKFLOWS, ...SUPPORT_PAGES, ...REFERENCE_PAGES].map((w) => w.name.length),\n );\n console.log(`loam ${LOAM_VERSION} — workflows\\n`);\n for (const w of WORKFLOWS) {\n console.log(` ${w.name.padEnd(width)} ${w.description}`);\n }\n console.log(`\\nsupport — use when a run or agent integration behaves unexpectedly\\n`);\n for (const s of SUPPORT_PAGES) {\n console.log(` ${s.name.padEnd(width)} ${s.description}`);\n }\n // Under their own heading, and never merged into the six above. A page\n // has no steps and is not part of the cycle; a flat list of ten would\n // read as a ten-step process, which is the one thing the cycle must not\n // be confused with. The sentence says what they are FOR, because a name\n // alone does not distinguish \"reference\" from \"seventh step\".\n console.log(`\\nreference pages — printed whole, no arguments\\n`);\n for (const r of REFERENCE_PAGES) {\n console.log(` ${r.name.padEnd(width)} ${r.description}`);\n }\n console.log(\n `\\nloam instructions <workflow> [args...] prints one, placeholders filled in.` +\n `\\nloam instructions loam-report prints the local incident-reporting protocol.` +\n `\\nloam instructions <page> prints a reference page. The pages carry what AGENTS.md` +\n `\\nleaves out; \\`loam explain <code>\\` answers a single code without opening one.`,\n );\n return;\n }\n\n // Before the substitution, not after: a rendered protocol is a page of\n // instructions an agent acts on, and a `$1` that cannot be a service id\n // makes every command on that page unrunnable. The refusal reaches the\n // caller in the same shape a mistyped workflow name does.\n const problems = placeholderProblems(workflow, args);\n if (problems !== null) {\n fail(\n json,\n \"invalid-option\",\n `${problems.join(\" \")} Nothing was printed: every command in the ${workflow} protocol ` +\n \"interpolates that value, so the page would name a target no loam command can accept.\",\n );\n return;\n }\n\n const body = protocolFor(workflow, args);\n if (body === null) {\n // `unknown-target`, the same code `show` uses for a name that resolves\n // to nothing. The known set is small and closed, so it is listed rather\n // than described: a caller that mistyped a known name should not have\n // to run a second command to see the choices.\n fail(\n json,\n \"unknown-target\",\n `No workflow '${workflow}'. Known: ${Object.keys(PROTOCOLS).join(\", \")}.`,\n );\n return;\n }\n\n // The narrowing composes with `--json` rather than forking the envelope:\n // the shorter page rides in the same `body` field, so no key is added or\n // renamed and a consumer that never passes the flag cannot tell the\n // difference. `--json` is the larger of the two views (the whole table is\n // one JSON string), which is exactly why it needs this too.\n const page = opts.fixTables === false ? withoutFixTables(body) : body;\n\n if (json) {\n // `body` is the substituted text, not the template: a consumer that\n // asked for `loam instructions loam-adopt payment-service --json` wants\n // the protocol it is about to follow, and re-implementing the\n // substitution on the other side is a second copy of the rule.\n emitJson({ command: \"instructions\", version: LOAM_VERSION, workflow, args, body: page });\n return;\n }\n // `console.log`, like every other command, rather than a raw stdout\n // write: the test harness captures the console and a direct write is\n // invisible to it — an untestable print is how a protocol nobody notices\n // went missing would ship. The body already ends in a newline, so the\n // one console.log adds is trimmed rather than doubled.\n console.log(page.replace(/\\n+$/, \"\"));\n });\n}\n"]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `--subsystem` slice behind `loam list`: what the flag's name denotes,
|
|
3
|
+
* and which services the filter keeps. A sub-package of list/ because the
|
|
4
|
+
* list package proper stands at its five-file limit (review.ts records
|
|
5
|
+
* that), and the adoption-campaign flag surface is its own subject beside
|
|
6
|
+
* the section renderers. The dependency direction is list → list/campaign,
|
|
7
|
+
* never back — this package imports core only, the same rule repo → repo/tree
|
|
8
|
+
* already keeps.
|
|
9
|
+
*
|
|
10
|
+
* Resolution reuses the tree machinery verbatim (`findInTree`,
|
|
11
|
+
* `servicesUnder`, `closeNamesHint`), so `list --subsystem` and every
|
|
12
|
+
* `loam subsystem` verb read the flat namespace the same way — two spellings
|
|
13
|
+
* of "what does this name mean" would drift.
|
|
14
|
+
*/
|
|
15
|
+
import { fail } from "../../../core/envelope/json.js";
|
|
16
|
+
import { closeNamesHint, findInTree, servicesUnder, subsystemsUnder } from "../../../core/repo/tree/find.js";
|
|
17
|
+
/**
|
|
18
|
+
* Resolve `--subsystem <name>` against the flat namespace, or report the
|
|
19
|
+
* refusal and return null. The reserved name `unfiled` selects the services
|
|
20
|
+
* filed under no subsystem — the tree's own concept, otherwise unreachable —
|
|
21
|
+
* but only while nothing in the tree claims that name: a REAL subsystem or
|
|
22
|
+
* service spelled `unfiled` wins, the same concrete-name-wins precedence
|
|
23
|
+
* `findInTree` already applies to service/subsystem ties. An unknown name
|
|
24
|
+
* refuses `unknown-target` with close-name hints rather than succeeding
|
|
25
|
+
* emptily — an empty table over a typo would read as a finished campaign —
|
|
26
|
+
* and a service name refuses `invalid-option` exactly as `loam adopt
|
|
27
|
+
* --subsystem` does: a service never contains other services.
|
|
28
|
+
*/
|
|
29
|
+
export function resolveSubsystemSlice(tree, name, json) {
|
|
30
|
+
const hit = findInTree(tree, name);
|
|
31
|
+
if (hit === null && name === "unfiled") {
|
|
32
|
+
return {
|
|
33
|
+
members: new Set(tree.services.filter((s) => s.subsystem.length === 0).map((s) => s.dir)),
|
|
34
|
+
subsystems: [],
|
|
35
|
+
label: "unfiled services (directly under services/)",
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
if (hit === null) {
|
|
39
|
+
// The Set: a real subsystem named 'unfiled' would otherwise sit in the
|
|
40
|
+
// hint pool twice and could be offered twice in one hint.
|
|
41
|
+
const pool = [...new Set([...tree.subsystems.map((s) => s.name), "unfiled"])];
|
|
42
|
+
fail(json, "unknown-target", `No subsystem '${name}' in the tree.` +
|
|
43
|
+
closeNamesHint(name, pool, " `loam subsystem list` shows what exists; `unfiled` selects the services filed under none."));
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
if (hit.kind === "service") {
|
|
47
|
+
// With a SERVICE claiming the name 'unfiled' the reserved reading has no
|
|
48
|
+
// spelling at all, so the refusal must say what is shadowed — otherwise
|
|
49
|
+
// the message reads as loam misunderstanding the request.
|
|
50
|
+
const shadowed = name === "unfiled"
|
|
51
|
+
? " While a service claims this name, the reserved unfiled-services reading is shadowed; rename the service to reach it."
|
|
52
|
+
: "";
|
|
53
|
+
fail(json, "invalid-option", `--subsystem names the service '${name}' — a service never contains other services.${shadowed}`);
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
const sub = hit.subsystem;
|
|
57
|
+
return {
|
|
58
|
+
members: new Set(servicesUnder(tree, sub).map((s) => s.dir)),
|
|
59
|
+
subsystems: [sub, ...subsystemsUnder(tree, sub)],
|
|
60
|
+
label: `subsystem '${sub.name}' (services/${sub.path.join("/")}/)`,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=campaign.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign.js","sourceRoot":"","sources":["../../../../src/commands/list/campaign/campaign.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAqB7G;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAe,EAAE,IAAY,EAAE,IAAa;IAChF,MAAM,GAAG,GAAG,UAAU,CAAC,IA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AO,EAAE,IAAI,GAAG,CAAS,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACpE,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAChD,KAAK,EAAE,cAAc,GAAG,CAAC,IAAI,eAAe,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI;KACnE,CAAC;AACJ,CAAC","sourcesContent":["/**\n * The `--subsystem` slice behind `loam list`: what the flag's name denotes,\n * and which services the filter keeps. A sub-package of list/ because the\n * list package proper stands at its five-file limit (review.ts records\n * that), and the adoption-campaign flag surface is its own subject beside\n * the section renderers. The dependency direction is list → list/campaign,\n * never back — this package imports core only, the same rule repo → repo/tree\n * already keeps.\n *\n * Resolution reuses the tree machinery verbatim (`findInTree`,\n * `servicesUnder`, `closeNamesHint`), so `list --subsystem` and every\n * `loam subsystem` verb read the flat namespace the same way — two spellings\n * of \"what does this name mean\" would drift.\n */\nimport { fail } from \"../../../core/envelope/json.js\";\nimport { closeNamesHint, findInTree, servicesUnder, subsystemsUnder } from \"../../../core/repo/tree/find.js\";\nimport type { FleetTree, SubsystemEntry } from \"../../../core/repo/tree/walk.js\";\n\nexport interface SubsystemSlice {\n /**\n * DIRECTORIES of the member services, at any depth beneath the filter\n * target — the directory, not the id, because the id is a leaf name the\n * fleet does not guarantee unique: a `subsystem.name-collision` tree still\n * enumerates both claimants on purpose, and an id-keyed slice would let\n * each of two disjoint slices claim the other's service.\n */\n readonly members: ReadonlySet<string>;\n /**\n * The subsystem rows the filtered payload shows — the named subsystem and\n * its descendants; `[]` for the unfiled slice, which sits under no group.\n */\n readonly subsystems: SubsystemEntry[];\n /** The human filter line's description of what the slice is. */\n readonly label: string;\n}\n\n/**\n * Resolve `--subsystem <name>` against the flat namespace, or report the\n * refusal and return null. The reserved name `unfiled` selects the services\n * filed under no subsystem — the tree's own concept, otherwise unreachable —\n * but only while nothing in the tree claims that name: a REAL subsystem or\n * service spelled `unfiled` wins, the same concrete-name-wins precedence\n * `findInTree` already applies to service/subsystem ties. An unknown name\n * refuses `unknown-target` with close-name hints rather than succeeding\n * emptily — an empty table over a typo would read as a finished campaign —\n * and a service name refuses `invalid-option` exactly as `loam adopt\n * --subsystem` does: a service never contains other services.\n */\nexport function resolveSubsystemSlice(tree: FleetTree, name: string, json: boolean): SubsystemSlice | null {\n const hit = findInTree(tree, name);\n if (hit === null && name === \"unfiled\") {\n return {\n members: new Set<string>(tree.services.filter((s) => s.subsystem.length === 0).map((s) => s.dir)),\n subsystems: [],\n label: \"unfiled services (directly under services/)\",\n };\n }\n if (hit === null) {\n // The Set: a real subsystem named 'unfiled' would otherwise sit in the\n // hint pool twice and could be offered twice in one hint.\n const pool = [...new Set([...tree.subsystems.map((s) => s.name), \"unfiled\"])];\n fail(\n json,\n \"unknown-target\",\n `No subsystem '${name}' in the tree.` +\n closeNamesHint(name, pool, \" `loam subsystem list` shows what exists; `unfiled` selects the services filed under none.\"),\n );\n return null;\n }\n if (hit.kind === \"service\") {\n // With a SERVICE claiming the name 'unfiled' the reserved reading has no\n // spelling at all, so the refusal must say what is shadowed — otherwise\n // the message reads as loam misunderstanding the request.\n const shadowed =\n name === \"unfiled\"\n ? \" While a service claims this name, the reserved unfiled-services reading is shadowed; rename the service to reach it.\"\n : \"\";\n fail(\n json,\n \"invalid-option\",\n `--subsystem names the service '${name}' — a service never contains other services.${shadowed}`,\n );\n return null;\n }\n const sub = hit.subsystem;\n return {\n members: new Set<string>(servicesUnder(tree, sub).map((s) => s.dir)),\n subsystems: [sub, ...subsystemsUnder(tree, sub)],\n label: `subsystem '${sub.name}' (services/${sub.path.join(\"/\")}/)`,\n };\n}\n"]}
|