@sdd-method/sdd-cli 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/NOTICE +17 -0
- package/README.md +151 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +8 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +66 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/bundle.d.ts +20 -0
- package/dist/lib/bundle.d.ts.map +1 -0
- package/dist/lib/bundle.js +75 -0
- package/dist/lib/bundle.js.map +1 -0
- package/dist/lib/generate-claude-md/index.d.ts +16 -0
- package/dist/lib/generate-claude-md/index.d.ts.map +1 -0
- package/dist/lib/generate-claude-md/index.js +89 -0
- package/dist/lib/generate-claude-md/index.js.map +1 -0
- package/dist/lib/hooks-seed/entries.d.ts +16 -0
- package/dist/lib/hooks-seed/entries.d.ts.map +1 -0
- package/dist/lib/hooks-seed/entries.js +47 -0
- package/dist/lib/hooks-seed/entries.js.map +1 -0
- package/dist/lib/hooks-seed/index.d.ts +17 -0
- package/dist/lib/hooks-seed/index.d.ts.map +1 -0
- package/dist/lib/hooks-seed/index.js +15 -0
- package/dist/lib/hooks-seed/index.js.map +1 -0
- package/dist/lib/hooks-seed/merge.d.ts +24 -0
- package/dist/lib/hooks-seed/merge.d.ts.map +1 -0
- package/dist/lib/hooks-seed/merge.js +73 -0
- package/dist/lib/hooks-seed/merge.js.map +1 -0
- package/dist/lib/hooks-seed/types.d.ts +27 -0
- package/dist/lib/hooks-seed/types.d.ts.map +1 -0
- package/dist/lib/hooks-seed/types.js +20 -0
- package/dist/lib/hooks-seed/types.js.map +1 -0
- package/dist/lib/init/app.d.ts +21 -0
- package/dist/lib/init/app.d.ts.map +1 -0
- package/dist/lib/init/app.js +132 -0
- package/dist/lib/init/app.js.map +1 -0
- package/dist/lib/init/ci-workflow.d.ts +29 -0
- package/dist/lib/init/ci-workflow.d.ts.map +1 -0
- package/dist/lib/init/ci-workflow.js +78 -0
- package/dist/lib/init/ci-workflow.js.map +1 -0
- package/dist/lib/init/claude-md.d.ts +19 -0
- package/dist/lib/init/claude-md.d.ts.map +1 -0
- package/dist/lib/init/claude-md.js +140 -0
- package/dist/lib/init/claude-md.js.map +1 -0
- package/dist/lib/init/index.d.ts +33 -0
- package/dist/lib/init/index.d.ts.map +1 -0
- package/dist/lib/init/index.js +232 -0
- package/dist/lib/init/index.js.map +1 -0
- package/dist/lib/init/integration.d.ts +53 -0
- package/dist/lib/init/integration.d.ts.map +1 -0
- package/dist/lib/init/integration.js +237 -0
- package/dist/lib/init/integration.js.map +1 -0
- package/dist/lib/init/platform.d.ts +26 -0
- package/dist/lib/init/platform.d.ts.map +1 -0
- package/dist/lib/init/platform.js +188 -0
- package/dist/lib/init/platform.js.map +1 -0
- package/dist/lib/list/discover.d.ts +8 -0
- package/dist/lib/list/discover.d.ts.map +1 -0
- package/dist/lib/list/discover.js +77 -0
- package/dist/lib/list/discover.js.map +1 -0
- package/dist/lib/list/format.d.ts +9 -0
- package/dist/lib/list/format.d.ts.map +1 -0
- package/dist/lib/list/format.js +44 -0
- package/dist/lib/list/format.js.map +1 -0
- package/dist/lib/list/index.d.ts +12 -0
- package/dist/lib/list/index.d.ts.map +1 -0
- package/dist/lib/list/index.js +15 -0
- package/dist/lib/list/index.js.map +1 -0
- package/dist/lib/lock-file.d.ts +14 -0
- package/dist/lib/lock-file.d.ts.map +1 -0
- package/dist/lib/lock-file.js +80 -0
- package/dist/lib/lock-file.js.map +1 -0
- package/dist/lib/mcp/build-info.d.ts +9 -0
- package/dist/lib/mcp/build-info.d.ts.map +1 -0
- package/dist/lib/mcp/build-info.js +10 -0
- package/dist/lib/mcp/build-info.js.map +1 -0
- package/dist/lib/mcp/errors.d.ts +23 -0
- package/dist/lib/mcp/errors.d.ts.map +1 -0
- package/dist/lib/mcp/errors.js +25 -0
- package/dist/lib/mcp/errors.js.map +1 -0
- package/dist/lib/mcp/parse/frontmatter.d.ts +22 -0
- package/dist/lib/mcp/parse/frontmatter.d.ts.map +1 -0
- package/dist/lib/mcp/parse/frontmatter.js +49 -0
- package/dist/lib/mcp/parse/frontmatter.js.map +1 -0
- package/dist/lib/mcp/parse/gate-registry.d.ts +19 -0
- package/dist/lib/mcp/parse/gate-registry.d.ts.map +1 -0
- package/dist/lib/mcp/parse/gate-registry.js +68 -0
- package/dist/lib/mcp/parse/gate-registry.js.map +1 -0
- package/dist/lib/mcp/parse/paths.d.ts +21 -0
- package/dist/lib/mcp/parse/paths.d.ts.map +1 -0
- package/dist/lib/mcp/parse/paths.js +83 -0
- package/dist/lib/mcp/parse/paths.js.map +1 -0
- package/dist/lib/mcp/pin/errors.d.ts +11 -0
- package/dist/lib/mcp/pin/errors.d.ts.map +1 -0
- package/dist/lib/mcp/pin/errors.js +32 -0
- package/dist/lib/mcp/pin/errors.js.map +1 -0
- package/dist/lib/mcp/pin/index.d.ts +18 -0
- package/dist/lib/mcp/pin/index.d.ts.map +1 -0
- package/dist/lib/mcp/pin/index.js +29 -0
- package/dist/lib/mcp/pin/index.js.map +1 -0
- package/dist/lib/mcp/pin/read.d.ts +24 -0
- package/dist/lib/mcp/pin/read.d.ts.map +1 -0
- package/dist/lib/mcp/pin/read.js +64 -0
- package/dist/lib/mcp/pin/read.js.map +1 -0
- package/dist/lib/mcp/pin/resolve.d.ts +12 -0
- package/dist/lib/mcp/pin/resolve.d.ts.map +1 -0
- package/dist/lib/mcp/pin/resolve.js +33 -0
- package/dist/lib/mcp/pin/resolve.js.map +1 -0
- package/dist/lib/mcp/prompts/evaluate-cascade.d.ts +14 -0
- package/dist/lib/mcp/prompts/evaluate-cascade.d.ts.map +1 -0
- package/dist/lib/mcp/prompts/evaluate-cascade.js +147 -0
- package/dist/lib/mcp/prompts/evaluate-cascade.js.map +1 -0
- package/dist/lib/mcp/prompts/index.d.ts +9 -0
- package/dist/lib/mcp/prompts/index.d.ts.map +1 -0
- package/dist/lib/mcp/prompts/index.js +23 -0
- package/dist/lib/mcp/prompts/index.js.map +1 -0
- package/dist/lib/mcp/prompts/propose-adr.d.ts +12 -0
- package/dist/lib/mcp/prompts/propose-adr.d.ts.map +1 -0
- package/dist/lib/mcp/prompts/propose-adr.js +94 -0
- package/dist/lib/mcp/prompts/propose-adr.js.map +1 -0
- package/dist/lib/mcp/prompts/review-data-model-change.d.ts +10 -0
- package/dist/lib/mcp/prompts/review-data-model-change.d.ts.map +1 -0
- package/dist/lib/mcp/prompts/review-data-model-change.js +134 -0
- package/dist/lib/mcp/prompts/review-data-model-change.js.map +1 -0
- package/dist/lib/mcp/prompts/template-loader.d.ts +29 -0
- package/dist/lib/mcp/prompts/template-loader.d.ts.map +1 -0
- package/dist/lib/mcp/prompts/template-loader.js +44 -0
- package/dist/lib/mcp/prompts/template-loader.js.map +1 -0
- package/dist/lib/mcp/prompts/types.d.ts +17 -0
- package/dist/lib/mcp/prompts/types.d.ts.map +1 -0
- package/dist/lib/mcp/prompts/types.js +10 -0
- package/dist/lib/mcp/prompts/types.js.map +1 -0
- package/dist/lib/mcp/prompts/write-capability-spec.d.ts +8 -0
- package/dist/lib/mcp/prompts/write-capability-spec.d.ts.map +1 -0
- package/dist/lib/mcp/prompts/write-capability-spec.js +85 -0
- package/dist/lib/mcp/prompts/write-capability-spec.js.map +1 -0
- package/dist/lib/mcp/prompts/write-feature-spec.d.ts +10 -0
- package/dist/lib/mcp/prompts/write-feature-spec.d.ts.map +1 -0
- package/dist/lib/mcp/prompts/write-feature-spec.js +94 -0
- package/dist/lib/mcp/prompts/write-feature-spec.js.map +1 -0
- package/dist/lib/mcp/prompts/write-work-order.d.ts +7 -0
- package/dist/lib/mcp/prompts/write-work-order.d.ts.map +1 -0
- package/dist/lib/mcp/prompts/write-work-order.js +69 -0
- package/dist/lib/mcp/prompts/write-work-order.js.map +1 -0
- package/dist/lib/mcp/reader.d.ts +37 -0
- package/dist/lib/mcp/reader.d.ts.map +1 -0
- package/dist/lib/mcp/reader.js +93 -0
- package/dist/lib/mcp/reader.js.map +1 -0
- package/dist/lib/mcp/resources/adrs.d.ts +3 -0
- package/dist/lib/mcp/resources/adrs.d.ts.map +1 -0
- package/dist/lib/mcp/resources/adrs.js +97 -0
- package/dist/lib/mcp/resources/adrs.js.map +1 -0
- package/dist/lib/mcp/resources/data-models.d.ts +14 -0
- package/dist/lib/mcp/resources/data-models.d.ts.map +1 -0
- package/dist/lib/mcp/resources/data-models.js +81 -0
- package/dist/lib/mcp/resources/data-models.js.map +1 -0
- package/dist/lib/mcp/resources/gates.d.ts +9 -0
- package/dist/lib/mcp/resources/gates.d.ts.map +1 -0
- package/dist/lib/mcp/resources/gates.js +90 -0
- package/dist/lib/mcp/resources/gates.js.map +1 -0
- package/dist/lib/mcp/resources/glossary.d.ts +16 -0
- package/dist/lib/mcp/resources/glossary.d.ts.map +1 -0
- package/dist/lib/mcp/resources/glossary.js +87 -0
- package/dist/lib/mcp/resources/glossary.js.map +1 -0
- package/dist/lib/mcp/resources/specs.d.ts +23 -0
- package/dist/lib/mcp/resources/specs.d.ts.map +1 -0
- package/dist/lib/mcp/resources/specs.js +151 -0
- package/dist/lib/mcp/resources/specs.js.map +1 -0
- package/dist/lib/mcp/resources/version.d.ts +3 -0
- package/dist/lib/mcp/resources/version.d.ts.map +1 -0
- package/dist/lib/mcp/resources/version.js +45 -0
- package/dist/lib/mcp/resources/version.js.map +1 -0
- package/dist/lib/mcp/server.d.ts +29 -0
- package/dist/lib/mcp/server.d.ts.map +1 -0
- package/dist/lib/mcp/server.js +104 -0
- package/dist/lib/mcp/server.js.map +1 -0
- package/dist/lib/mcp/tools/cascade-impact.d.ts +22 -0
- package/dist/lib/mcp/tools/cascade-impact.d.ts.map +1 -0
- package/dist/lib/mcp/tools/cascade-impact.js +53 -0
- package/dist/lib/mcp/tools/cascade-impact.js.map +1 -0
- package/dist/lib/mcp/tools/find-consumers-of-contract.d.ts +7 -0
- package/dist/lib/mcp/tools/find-consumers-of-contract.d.ts.map +1 -0
- package/dist/lib/mcp/tools/find-consumers-of-contract.js +70 -0
- package/dist/lib/mcp/tools/find-consumers-of-contract.js.map +1 -0
- package/dist/lib/mcp/tools/find-consumers.d.ts +7 -0
- package/dist/lib/mcp/tools/find-consumers.d.ts.map +1 -0
- package/dist/lib/mcp/tools/find-consumers.js +52 -0
- package/dist/lib/mcp/tools/find-consumers.js.map +1 -0
- package/dist/lib/mcp/tools/find-dependencies.d.ts +8 -0
- package/dist/lib/mcp/tools/find-dependencies.d.ts.map +1 -0
- package/dist/lib/mcp/tools/find-dependencies.js +89 -0
- package/dist/lib/mcp/tools/find-dependencies.js.map +1 -0
- package/dist/lib/mcp/tools/find-dependents.d.ts +8 -0
- package/dist/lib/mcp/tools/find-dependents.d.ts.map +1 -0
- package/dist/lib/mcp/tools/find-dependents.js +89 -0
- package/dist/lib/mcp/tools/find-dependents.js.map +1 -0
- package/dist/lib/mcp/tools/find-producers.d.ts +8 -0
- package/dist/lib/mcp/tools/find-producers.d.ts.map +1 -0
- package/dist/lib/mcp/tools/find-producers.js +57 -0
- package/dist/lib/mcp/tools/find-producers.js.map +1 -0
- package/dist/lib/mcp/tools/find-related-specs.d.ts +9 -0
- package/dist/lib/mcp/tools/find-related-specs.d.ts.map +1 -0
- package/dist/lib/mcp/tools/find-related-specs.js +92 -0
- package/dist/lib/mcp/tools/find-related-specs.js.map +1 -0
- package/dist/lib/mcp/tools/list-adrs.d.ts +3 -0
- package/dist/lib/mcp/tools/list-adrs.d.ts.map +1 -0
- package/dist/lib/mcp/tools/list-adrs.js +73 -0
- package/dist/lib/mcp/tools/list-adrs.js.map +1 -0
- package/dist/lib/mcp/tools/query-gate-status.d.ts +3 -0
- package/dist/lib/mcp/tools/query-gate-status.d.ts.map +1 -0
- package/dist/lib/mcp/tools/query-gate-status.js +82 -0
- package/dist/lib/mcp/tools/query-gate-status.js.map +1 -0
- package/dist/lib/mcp/tools/search-specs.d.ts +12 -0
- package/dist/lib/mcp/tools/search-specs.d.ts.map +1 -0
- package/dist/lib/mcp/tools/search-specs.js +151 -0
- package/dist/lib/mcp/tools/search-specs.js.map +1 -0
- package/dist/lib/mcp/workspace.d.ts +25 -0
- package/dist/lib/mcp/workspace.d.ts.map +1 -0
- package/dist/lib/mcp/workspace.js +129 -0
- package/dist/lib/mcp/workspace.js.map +1 -0
- package/dist/lib/mcp-seed/entries.d.ts +19 -0
- package/dist/lib/mcp-seed/entries.d.ts.map +1 -0
- package/dist/lib/mcp-seed/entries.js +14 -0
- package/dist/lib/mcp-seed/entries.js.map +1 -0
- package/dist/lib/mcp-seed/index.d.ts +36 -0
- package/dist/lib/mcp-seed/index.d.ts.map +1 -0
- package/dist/lib/mcp-seed/index.js +28 -0
- package/dist/lib/mcp-seed/index.js.map +1 -0
- package/dist/lib/mcp-seed/merge.d.ts +34 -0
- package/dist/lib/mcp-seed/merge.d.ts.map +1 -0
- package/dist/lib/mcp-seed/merge.js +99 -0
- package/dist/lib/mcp-seed/merge.js.map +1 -0
- package/dist/lib/mcp-seed/types.d.ts +24 -0
- package/dist/lib/mcp-seed/types.d.ts.map +1 -0
- package/dist/lib/mcp-seed/types.js +13 -0
- package/dist/lib/mcp-seed/types.js.map +1 -0
- package/dist/lib/plan/index.d.ts +19 -0
- package/dist/lib/plan/index.d.ts.map +1 -0
- package/dist/lib/plan/index.js +69 -0
- package/dist/lib/plan/index.js.map +1 -0
- package/dist/lib/plan/read-sdd.d.ts +46 -0
- package/dist/lib/plan/read-sdd.d.ts.map +1 -0
- package/dist/lib/plan/read-sdd.js +102 -0
- package/dist/lib/plan/read-sdd.js.map +1 -0
- package/dist/lib/plan/render-template.d.ts +8 -0
- package/dist/lib/plan/render-template.d.ts.map +1 -0
- package/dist/lib/plan/render-template.js +60 -0
- package/dist/lib/plan/render-template.js.map +1 -0
- package/dist/lib/repo-kind.d.ts +20 -0
- package/dist/lib/repo-kind.d.ts.map +1 -0
- package/dist/lib/repo-kind.js +73 -0
- package/dist/lib/repo-kind.js.map +1 -0
- package/dist/lib/scripts.d.ts +2 -0
- package/dist/lib/scripts.d.ts.map +1 -0
- package/dist/lib/scripts.js +7 -0
- package/dist/lib/scripts.js.map +1 -0
- package/dist/lib/sdd-index/cascade.d.ts +46 -0
- package/dist/lib/sdd-index/cascade.d.ts.map +1 -0
- package/dist/lib/sdd-index/cascade.js +91 -0
- package/dist/lib/sdd-index/cascade.js.map +1 -0
- package/dist/lib/sdd-index/contracts.d.ts +29 -0
- package/dist/lib/sdd-index/contracts.d.ts.map +1 -0
- package/dist/lib/sdd-index/contracts.js +216 -0
- package/dist/lib/sdd-index/contracts.js.map +1 -0
- package/dist/lib/sdd-index/data-model.d.ts +13 -0
- package/dist/lib/sdd-index/data-model.d.ts.map +1 -0
- package/dist/lib/sdd-index/data-model.js +23 -0
- package/dist/lib/sdd-index/data-model.js.map +1 -0
- package/dist/lib/sdd-index/execution-map.d.ts +34 -0
- package/dist/lib/sdd-index/execution-map.d.ts.map +1 -0
- package/dist/lib/sdd-index/execution-map.js +105 -0
- package/dist/lib/sdd-index/execution-map.js.map +1 -0
- package/dist/lib/sdd-index/graph.d.ts +28 -0
- package/dist/lib/sdd-index/graph.d.ts.map +1 -0
- package/dist/lib/sdd-index/graph.js +122 -0
- package/dist/lib/sdd-index/graph.js.map +1 -0
- package/dist/lib/sdd-index/index.d.ts +29 -0
- package/dist/lib/sdd-index/index.d.ts.map +1 -0
- package/dist/lib/sdd-index/index.js +79 -0
- package/dist/lib/sdd-index/index.js.map +1 -0
- package/dist/lib/sdd-index/repo-config.d.ts +23 -0
- package/dist/lib/sdd-index/repo-config.d.ts.map +1 -0
- package/dist/lib/sdd-index/repo-config.js +150 -0
- package/dist/lib/sdd-index/repo-config.js.map +1 -0
- package/dist/lib/sdd-index/types.d.ts +106 -0
- package/dist/lib/sdd-index/types.d.ts.map +1 -0
- package/dist/lib/sdd-index/types.js +13 -0
- package/dist/lib/sdd-index/types.js.map +1 -0
- package/dist/lib/sdd-index/watch.d.ts +24 -0
- package/dist/lib/sdd-index/watch.d.ts.map +1 -0
- package/dist/lib/sdd-index/watch.js +112 -0
- package/dist/lib/sdd-index/watch.js.map +1 -0
- package/dist/lib/spawn.d.ts +8 -0
- package/dist/lib/spawn.d.ts.map +1 -0
- package/dist/lib/spawn.js +16 -0
- package/dist/lib/spawn.js.map +1 -0
- package/dist/lib/sync/apply.d.ts +3 -0
- package/dist/lib/sync/apply.d.ts.map +1 -0
- package/dist/lib/sync/apply.js +16 -0
- package/dist/lib/sync/apply.js.map +1 -0
- package/dist/lib/sync/diff.d.ts +8 -0
- package/dist/lib/sync/diff.d.ts.map +1 -0
- package/dist/lib/sync/diff.js +48 -0
- package/dist/lib/sync/diff.js.map +1 -0
- package/dist/lib/sync/index.d.ts +17 -0
- package/dist/lib/sync/index.d.ts.map +1 -0
- package/dist/lib/sync/index.js +184 -0
- package/dist/lib/sync/index.js.map +1 -0
- package/dist/lib/sync/settings-merge.d.ts +45 -0
- package/dist/lib/sync/settings-merge.d.ts.map +1 -0
- package/dist/lib/sync/settings-merge.js +109 -0
- package/dist/lib/sync/settings-merge.js.map +1 -0
- package/dist/lib/sync/source-tag.d.ts +5 -0
- package/dist/lib/sync/source-tag.d.ts.map +1 -0
- package/dist/lib/sync/source-tag.js +34 -0
- package/dist/lib/sync/source-tag.js.map +1 -0
- package/dist/lib/sync/yaml-block-merge.d.ts +50 -0
- package/dist/lib/sync/yaml-block-merge.d.ts.map +1 -0
- package/dist/lib/sync/yaml-block-merge.js +113 -0
- package/dist/lib/sync/yaml-block-merge.js.map +1 -0
- package/dist/lib/validate/aggregate.d.ts +13 -0
- package/dist/lib/validate/aggregate.d.ts.map +1 -0
- package/dist/lib/validate/aggregate.js +35 -0
- package/dist/lib/validate/aggregate.js.map +1 -0
- package/dist/lib/validate/dispatch.d.ts +34 -0
- package/dist/lib/validate/dispatch.d.ts.map +1 -0
- package/dist/lib/validate/dispatch.js +167 -0
- package/dist/lib/validate/dispatch.js.map +1 -0
- package/dist/lib/validate/index.d.ts +13 -0
- package/dist/lib/validate/index.d.ts.map +1 -0
- package/dist/lib/validate/index.js +69 -0
- package/dist/lib/validate/index.js.map +1 -0
- package/dist/lib/validate/runner.d.ts +16 -0
- package/dist/lib/validate/runner.d.ts.map +1 -0
- package/dist/lib/validate/runner.js +66 -0
- package/dist/lib/validate/runner.js.map +1 -0
- package/dist/verbs/generate-claude-md.d.ts +3 -0
- package/dist/verbs/generate-claude-md.d.ts.map +1 -0
- package/dist/verbs/generate-claude-md.js +36 -0
- package/dist/verbs/generate-claude-md.js.map +1 -0
- package/dist/verbs/init.d.ts +3 -0
- package/dist/verbs/init.d.ts.map +1 -0
- package/dist/verbs/init.js +90 -0
- package/dist/verbs/init.js.map +1 -0
- package/dist/verbs/list.d.ts +3 -0
- package/dist/verbs/list.d.ts.map +1 -0
- package/dist/verbs/list.js +43 -0
- package/dist/verbs/list.js.map +1 -0
- package/dist/verbs/mcp.d.ts +3 -0
- package/dist/verbs/mcp.d.ts.map +1 -0
- package/dist/verbs/mcp.js +22 -0
- package/dist/verbs/mcp.js.map +1 -0
- package/dist/verbs/plan.d.ts +3 -0
- package/dist/verbs/plan.d.ts.map +1 -0
- package/dist/verbs/plan.js +41 -0
- package/dist/verbs/plan.js.map +1 -0
- package/dist/verbs/sync.d.ts +3 -0
- package/dist/verbs/sync.d.ts.map +1 -0
- package/dist/verbs/sync.js +27 -0
- package/dist/verbs/sync.js.map +1 -0
- package/dist/verbs/validate.d.ts +3 -0
- package/dist/verbs/validate.d.ts.map +1 -0
- package/dist/verbs/validate.js +21 -0
- package/dist/verbs/validate.js.map +1 -0
- package/package.json +61 -0
- package/scripts/README.md +48 -0
- package/scripts/sync-method-baseline.sh +258 -0
- package/scripts/validate-app-dependencies.sh +289 -0
- package/scripts/validate-app-docs.sh +185 -0
- package/scripts/validate-integration-docs.sh +222 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { discoverSddRepos } from "./discover.js";
|
|
2
|
+
import { format } from "./format.js";
|
|
3
|
+
export async function runList(inputs, write) {
|
|
4
|
+
const roots = inputs.workspaceRoots.length > 0
|
|
5
|
+
? inputs.workspaceRoots
|
|
6
|
+
: [process.cwd()];
|
|
7
|
+
const repos = await discoverSddRepos(roots);
|
|
8
|
+
const output = format(repos, {
|
|
9
|
+
format: inputs.format,
|
|
10
|
+
...(inputs.profileFilter ? { profileFilter: inputs.profileFilter } : {}),
|
|
11
|
+
});
|
|
12
|
+
write(output);
|
|
13
|
+
return { exitCode: 0 };
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/list/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAC;AAYxD,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,MAAkB,EAClB,KAA0B;IAE1B,MAAM,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC;QAC5C,CAAC,CAAC,MAAM,CAAC,cAAc;QACvB,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAEpB,MAAM,KAAK,GAAG,MAAM,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE;QAC3B,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACzE,CAAC,CAAC;IACH,KAAK,CAAC,MAAM,CAAC,CAAC;IACd,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const LOCK_FILE = "method-baseline.lock";
|
|
2
|
+
export interface LockFile {
|
|
3
|
+
methodRepo: string;
|
|
4
|
+
bundleVersion: string;
|
|
5
|
+
sourceCommit: string;
|
|
6
|
+
bundleSha256: string;
|
|
7
|
+
syncedAtUtc: string;
|
|
8
|
+
managedPaths: string[];
|
|
9
|
+
}
|
|
10
|
+
export declare function readLockFile(repoRoot: string): Promise<LockFile | null>;
|
|
11
|
+
export declare function writeLockFile(repoRoot: string, lock: LockFile): Promise<void>;
|
|
12
|
+
export declare function parseLockFile(raw: string): LockFile;
|
|
13
|
+
export declare function serialiseLockFile(lock: LockFile): string;
|
|
14
|
+
//# sourceMappingURL=lock-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock-file.d.ts","sourceRoot":"","sources":["../../src/lib/lock-file.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,yBAAyB,CAAC;AAEhD,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAS7E;AAED,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,QAAQ,GACb,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CA6CnD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAWxD"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
export const LOCK_FILE = "method-baseline.lock";
|
|
4
|
+
export async function readLockFile(repoRoot) {
|
|
5
|
+
let raw;
|
|
6
|
+
try {
|
|
7
|
+
raw = await readFile(join(repoRoot, LOCK_FILE), "utf8");
|
|
8
|
+
}
|
|
9
|
+
catch (err) {
|
|
10
|
+
if (err.code === "ENOENT")
|
|
11
|
+
return null;
|
|
12
|
+
throw err;
|
|
13
|
+
}
|
|
14
|
+
return parseLockFile(raw);
|
|
15
|
+
}
|
|
16
|
+
export async function writeLockFile(repoRoot, lock) {
|
|
17
|
+
await writeFile(join(repoRoot, LOCK_FILE), serialiseLockFile(lock), "utf8");
|
|
18
|
+
}
|
|
19
|
+
export function parseLockFile(raw) {
|
|
20
|
+
const scalars = new Map();
|
|
21
|
+
const managedPaths = [];
|
|
22
|
+
let inManagedList = false;
|
|
23
|
+
for (const line of raw.split("\n")) {
|
|
24
|
+
if (inManagedList) {
|
|
25
|
+
if (line.startsWith(" - ")) {
|
|
26
|
+
managedPaths.push(line.slice(4));
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
inManagedList = false;
|
|
30
|
+
}
|
|
31
|
+
if (line === "managed_paths:") {
|
|
32
|
+
inManagedList = true;
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
const match = /^([a-z_][a-z0-9_]*): (.*)$/.exec(line);
|
|
36
|
+
if (match) {
|
|
37
|
+
const [, key, rawValue] = match;
|
|
38
|
+
scalars.set(key, stripQuotes(rawValue));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const required = [
|
|
42
|
+
"method_repo",
|
|
43
|
+
"bundle_version",
|
|
44
|
+
"source_commit",
|
|
45
|
+
"bundle_sha256",
|
|
46
|
+
"synced_at_utc",
|
|
47
|
+
];
|
|
48
|
+
for (const key of required) {
|
|
49
|
+
if (!scalars.has(key)) {
|
|
50
|
+
throw new Error(`method-baseline.lock is missing required key: ${key}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
methodRepo: scalars.get("method_repo"),
|
|
55
|
+
bundleVersion: scalars.get("bundle_version"),
|
|
56
|
+
sourceCommit: scalars.get("source_commit"),
|
|
57
|
+
bundleSha256: scalars.get("bundle_sha256"),
|
|
58
|
+
syncedAtUtc: scalars.get("synced_at_utc"),
|
|
59
|
+
managedPaths,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
export function serialiseLockFile(lock) {
|
|
63
|
+
const lines = [
|
|
64
|
+
`method_repo: ${lock.methodRepo}`,
|
|
65
|
+
`bundle_version: "${lock.bundleVersion}"`,
|
|
66
|
+
`source_commit: "${lock.sourceCommit}"`,
|
|
67
|
+
`bundle_sha256: "${lock.bundleSha256}"`,
|
|
68
|
+
`synced_at_utc: "${lock.syncedAtUtc}"`,
|
|
69
|
+
"managed_paths:",
|
|
70
|
+
...lock.managedPaths.map((p) => ` - ${p}`),
|
|
71
|
+
];
|
|
72
|
+
return lines.join("\n") + "\n";
|
|
73
|
+
}
|
|
74
|
+
function stripQuotes(value) {
|
|
75
|
+
if (value.length >= 2 && value.startsWith('"') && value.endsWith('"')) {
|
|
76
|
+
return value.slice(1, -1);
|
|
77
|
+
}
|
|
78
|
+
return value;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=lock-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock-file.js","sourceRoot":"","sources":["../../src/lib/lock-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,CAAC,MAAM,SAAS,GAAG,sBAAsB,CAAC;AAWhD,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,QAAgB;IACjD,IAAI,GAAW,CAAC;IAChB,IAAI,CAAC;QACH,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,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,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACtE,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build-time constants for the MCP server. Updated when sdd-cli is
|
|
3
|
+
* released; Phase 6 of the MCP plan may swap this for a generated file
|
|
4
|
+
* populated by `npm version`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SERVER_VERSION = "0.9.0";
|
|
7
|
+
export declare const DISTRIBUTION = "sdd-method";
|
|
8
|
+
export declare const MCP_PROTOCOL_SPEC_VERSION = "2025-06-18";
|
|
9
|
+
//# sourceMappingURL=build-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-info.d.ts","sourceRoot":"","sources":["../../../src/lib/mcp/build-info.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,eAAO,MAAM,cAAc,UAAU,CAAC;AAEtC,eAAO,MAAM,YAAY,eAAe,CAAC;AAEzC,eAAO,MAAM,yBAAyB,eAAe,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build-time constants for the MCP server. Updated when sdd-cli is
|
|
3
|
+
* released; Phase 6 of the MCP plan may swap this for a generated file
|
|
4
|
+
* populated by `npm version`.
|
|
5
|
+
*/
|
|
6
|
+
// Mirror of package.json version — bump in lockstep on release.
|
|
7
|
+
export const SERVER_VERSION = "0.9.0";
|
|
8
|
+
export const DISTRIBUTION = "sdd-method";
|
|
9
|
+
export const MCP_PROTOCOL_SPEC_VERSION = "2025-06-18";
|
|
10
|
+
//# sourceMappingURL=build-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-info.js","sourceRoot":"","sources":["../../../src/lib/mcp/build-info.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,gEAAgE;AAChE,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AAEtC,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CAAC;AAEzC,MAAM,CAAC,MAAM,yBAAyB,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured error envelope per the MCP context extension plan
|
|
3
|
+
* §Error and response schema. Every handler throws an McpEnvelopeError;
|
|
4
|
+
* the server adapter converts it to an MCP JSON-RPC error with a
|
|
5
|
+
* human-actionable remediation field.
|
|
6
|
+
*/
|
|
7
|
+
export interface McpErrorLink {
|
|
8
|
+
readonly title: string;
|
|
9
|
+
readonly url: string;
|
|
10
|
+
}
|
|
11
|
+
export interface McpErrorEnvelope {
|
|
12
|
+
readonly code: string;
|
|
13
|
+
readonly message: string;
|
|
14
|
+
readonly remediation: string;
|
|
15
|
+
readonly context?: Record<string, unknown>;
|
|
16
|
+
readonly links?: readonly McpErrorLink[];
|
|
17
|
+
}
|
|
18
|
+
export declare class McpEnvelopeError extends Error {
|
|
19
|
+
readonly envelope: McpErrorEnvelope;
|
|
20
|
+
constructor(envelope: McpErrorEnvelope);
|
|
21
|
+
}
|
|
22
|
+
export declare function envelopeFromUnknown(err: unknown): McpErrorEnvelope;
|
|
23
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/lib/mcp/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;CAC1C;AAED,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;gBAExB,QAAQ,EAAE,gBAAgB;CAKvC;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB,CASlE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured error envelope per the MCP context extension plan
|
|
3
|
+
* §Error and response schema. Every handler throws an McpEnvelopeError;
|
|
4
|
+
* the server adapter converts it to an MCP JSON-RPC error with a
|
|
5
|
+
* human-actionable remediation field.
|
|
6
|
+
*/
|
|
7
|
+
export class McpEnvelopeError extends Error {
|
|
8
|
+
envelope;
|
|
9
|
+
constructor(envelope) {
|
|
10
|
+
super(envelope.message);
|
|
11
|
+
this.name = "McpEnvelopeError";
|
|
12
|
+
this.envelope = envelope;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export function envelopeFromUnknown(err) {
|
|
16
|
+
if (err instanceof McpEnvelopeError)
|
|
17
|
+
return err.envelope;
|
|
18
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
19
|
+
return {
|
|
20
|
+
code: "INTERNAL_ERROR",
|
|
21
|
+
message,
|
|
22
|
+
remediation: "This is an unexpected internal error. Re-run with stderr captured and file an issue against sdd-cli including the server_build value from sdd://method/version.",
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/lib/mcp/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAChC,QAAQ,CAAmB;IAEpC,YAAY,QAA0B;QACpC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAED,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC9C,IAAI,GAAG,YAAY,gBAAgB;QAAE,OAAO,GAAG,CAAC,QAAQ,CAAC;IACzD,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACjE,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,OAAO;QACP,WAAW,EACT,iKAAiK;KACpK,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Small parser for the method's ADR metadata block — the `* **Key:**
|
|
3
|
+
* Value` bullet list enforced by
|
|
4
|
+
* orchestration/scripts/validate-adr-structure.sh.
|
|
5
|
+
*
|
|
6
|
+
* This is not YAML frontmatter; it's a convention-enforced bullet
|
|
7
|
+
* list at the top of every ADR file. Parsing it ourselves keeps the
|
|
8
|
+
* dependency footprint small (no gray-matter / front-matter libs).
|
|
9
|
+
*/
|
|
10
|
+
export interface AdrMetadata {
|
|
11
|
+
readonly title: string;
|
|
12
|
+
readonly date?: string;
|
|
13
|
+
readonly status?: string;
|
|
14
|
+
readonly deciders?: string;
|
|
15
|
+
readonly decisionType?: string;
|
|
16
|
+
readonly scope?: string;
|
|
17
|
+
readonly supersedes?: string;
|
|
18
|
+
readonly supersededBy?: string;
|
|
19
|
+
readonly raw: Record<string, string>;
|
|
20
|
+
}
|
|
21
|
+
export declare function parseAdrMetadata(markdown: string): AdrMetadata;
|
|
22
|
+
//# sourceMappingURL=frontmatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../../../../src/lib/mcp/parse/frontmatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,CAiC9D"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Small parser for the method's ADR metadata block — the `* **Key:**
|
|
3
|
+
* Value` bullet list enforced by
|
|
4
|
+
* orchestration/scripts/validate-adr-structure.sh.
|
|
5
|
+
*
|
|
6
|
+
* This is not YAML frontmatter; it's a convention-enforced bullet
|
|
7
|
+
* list at the top of every ADR file. Parsing it ourselves keeps the
|
|
8
|
+
* dependency footprint small (no gray-matter / front-matter libs).
|
|
9
|
+
*/
|
|
10
|
+
export function parseAdrMetadata(markdown) {
|
|
11
|
+
const lines = markdown.split(/\r?\n/);
|
|
12
|
+
const titleLine = lines.find((l) => l.startsWith("# "));
|
|
13
|
+
const title = titleLine ? titleLine.replace(/^#\s+/, "").trim() : "";
|
|
14
|
+
const raw = {};
|
|
15
|
+
const bulletMetadata = /^\s*[*\-]\s*\*\*([A-Za-z][A-Za-z0-9 _/-]*):\*\*\s*(.+?)\s*$/;
|
|
16
|
+
for (const line of lines) {
|
|
17
|
+
const m = line.match(bulletMetadata);
|
|
18
|
+
if (!m)
|
|
19
|
+
continue;
|
|
20
|
+
const [, key, value] = m;
|
|
21
|
+
if (key && value) {
|
|
22
|
+
raw[key.trim()] = value.trim();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const result = { title, raw };
|
|
26
|
+
const date = raw["Date"];
|
|
27
|
+
if (date)
|
|
28
|
+
result.date = date;
|
|
29
|
+
const status = raw["Status"];
|
|
30
|
+
if (status)
|
|
31
|
+
result.status = status;
|
|
32
|
+
const deciders = raw["Deciders"];
|
|
33
|
+
if (deciders)
|
|
34
|
+
result.deciders = deciders;
|
|
35
|
+
const decisionType = raw["Decision Type"];
|
|
36
|
+
if (decisionType)
|
|
37
|
+
result.decisionType = decisionType;
|
|
38
|
+
const scope = raw["Scope"];
|
|
39
|
+
if (scope)
|
|
40
|
+
result.scope = scope;
|
|
41
|
+
const supersedes = raw["Supersedes"];
|
|
42
|
+
if (supersedes)
|
|
43
|
+
result.supersedes = supersedes;
|
|
44
|
+
const supersededBy = raw["Superseded By"];
|
|
45
|
+
if (supersededBy)
|
|
46
|
+
result.supersededBy = supersededBy;
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=frontmatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontmatter.js","sourceRoot":"","sources":["../../../../src/lib/mcp/parse/frontmatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAcH,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC/C,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACtC,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI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AG,KAAK,CAAC;IAChC,MAAM,UAAU,GAAG,GAAG,CAAC,YAAY,CAAC,CAAC;IACrC,IAAI,UAAU;QAAE,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/C,MAAM,YAAY,GAAG,GAAG,CAAC,eAAe,CAAC,CAAC;IAC1C,IAAI,YAAY;QAAE,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;IACrD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* YAML reader for orchestration/gate-registry/<gate>-scores.yaml.
|
|
3
|
+
* Schema is conventional (schema_version, description, pass_threshold,
|
|
4
|
+
* plus per-entry records keyed by artefact ID). We treat the file as a
|
|
5
|
+
* generic YAML document and extract the artefact entries after
|
|
6
|
+
* excluding the known header fields.
|
|
7
|
+
*/
|
|
8
|
+
export interface GateRegistry {
|
|
9
|
+
readonly gate: string;
|
|
10
|
+
readonly path: string;
|
|
11
|
+
readonly schemaVersion: string | null;
|
|
12
|
+
readonly description: string | null;
|
|
13
|
+
readonly passThreshold: unknown;
|
|
14
|
+
readonly entries: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
export declare function gateRegistryPath(sddRoot: string, gate: string): string;
|
|
17
|
+
export declare function listGates(sddRoot: string): string[];
|
|
18
|
+
export declare function readGateRegistry(sddRoot: string, gate: string): GateRegistry | undefined;
|
|
19
|
+
//# sourceMappingURL=gate-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gate-registry.d.ts","sourceRoot":"","sources":["../../../../src/lib/mcp/parse/gate-registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAcnD;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GACX,YAAY,GAAG,SAAS,CA2B1B"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* YAML reader for orchestration/gate-registry/<gate>-scores.yaml.
|
|
3
|
+
* Schema is conventional (schema_version, description, pass_threshold,
|
|
4
|
+
* plus per-entry records keyed by artefact ID). We treat the file as a
|
|
5
|
+
* generic YAML document and extract the artefact entries after
|
|
6
|
+
* excluding the known header fields.
|
|
7
|
+
*/
|
|
8
|
+
import { readFileSync } from "node:fs";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
import { parse as parseYaml } from "yaml";
|
|
11
|
+
import { safeIsFile } from "./paths.js";
|
|
12
|
+
const HEADER_KEYS = new Set([
|
|
13
|
+
"schema_version",
|
|
14
|
+
"description",
|
|
15
|
+
"pass_threshold",
|
|
16
|
+
]);
|
|
17
|
+
export function gateRegistryPath(sddRoot, gate) {
|
|
18
|
+
return join(sddRoot, "orchestration", "gate-registry", `${gate}-scores.yaml`);
|
|
19
|
+
}
|
|
20
|
+
export function listGates(sddRoot) {
|
|
21
|
+
const candidates = [
|
|
22
|
+
"adr-quality",
|
|
23
|
+
"c4-diagram",
|
|
24
|
+
"contract-quality",
|
|
25
|
+
"domain-architecture",
|
|
26
|
+
"feature-grounding",
|
|
27
|
+
"intent-quality",
|
|
28
|
+
"strategic-doc",
|
|
29
|
+
"traceability-manifest",
|
|
30
|
+
"user-story",
|
|
31
|
+
"work-order",
|
|
32
|
+
];
|
|
33
|
+
return candidates.filter((g) => safeIsFile(gateRegistryPath(sddRoot, g)));
|
|
34
|
+
}
|
|
35
|
+
export function readGateRegistry(sddRoot, gate) {
|
|
36
|
+
const path = gateRegistryPath(sddRoot, gate);
|
|
37
|
+
if (!safeIsFile(path))
|
|
38
|
+
return undefined;
|
|
39
|
+
const raw = readFileSync(path, "utf8");
|
|
40
|
+
const parsed = parseYaml(raw);
|
|
41
|
+
if (!parsed || typeof parsed !== "object") {
|
|
42
|
+
return {
|
|
43
|
+
gate,
|
|
44
|
+
path,
|
|
45
|
+
schemaVersion: null,
|
|
46
|
+
description: null,
|
|
47
|
+
passThreshold: null,
|
|
48
|
+
entries: {},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
const entries = {};
|
|
52
|
+
for (const [k, v] of Object.entries(parsed)) {
|
|
53
|
+
if (!HEADER_KEYS.has(k))
|
|
54
|
+
entries[k] = v;
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
gate,
|
|
58
|
+
path,
|
|
59
|
+
schemaVersion: typeOrNull(parsed["schema_version"]),
|
|
60
|
+
description: typeOrNull(parsed["description"]),
|
|
61
|
+
passThreshold: parsed["pass_threshold"] ?? null,
|
|
62
|
+
entries,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function typeOrNull(v) {
|
|
66
|
+
return typeof v === "string" ? v : null;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=gate-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gate-registry.js","sourceRoot":"","sources":["../../../../src/lib/mcp/parse/gate-registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAA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OAAO,GAA4B,EAAE,CAAC;IAC5C,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5C,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO;QACL,IAAI;QACJ,IAAI;QACJ,aAAa,EAAE,UAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;QACnD,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC9C,aAAa,EAAE,MAAM,CAAC,gBAAgB,CAAC,IAAI,IAAI;QAC/C,OAAO;KACR,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,CAAU;IAC5B,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filesystem path helpers used by the MCP resource handlers to map
|
|
3
|
+
* between `sdd://` URIs and files on disk. All paths returned are
|
|
4
|
+
* absolute; callers pass the resolved SDD root as the base.
|
|
5
|
+
*/
|
|
6
|
+
export declare function adrScopeDirs(sddRoot: string): Record<string, string>;
|
|
7
|
+
export interface DiscoveredAdr {
|
|
8
|
+
readonly scope: string;
|
|
9
|
+
readonly number: string;
|
|
10
|
+
readonly title: string;
|
|
11
|
+
readonly path: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Discover every ADR file under docs/{method,platform}/adr plus
|
|
15
|
+
* docs/domains/{d}/adr in the given SDD.
|
|
16
|
+
*/
|
|
17
|
+
export declare function discoverAdrs(sddRoot: string): DiscoveredAdr[];
|
|
18
|
+
export declare function findAdr(sddRoot: string, scope: string, number: string): DiscoveredAdr | undefined;
|
|
19
|
+
export declare function safeIsFile(path: string): boolean;
|
|
20
|
+
export declare function safeIsDir(path: string): boolean;
|
|
21
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../../src/lib/mcp/parse/paths.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAKpE;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,EAAE,CAe7D;AAoBD,wBAAgB,OAAO,CACrB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,aAAa,GAAG,SAAS,CAK3B;AAUD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMhD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAM/C"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filesystem path helpers used by the MCP resource handlers to map
|
|
3
|
+
* between `sdd://` URIs and files on disk. All paths returned are
|
|
4
|
+
* absolute; callers pass the resolved SDD root as the base.
|
|
5
|
+
*/
|
|
6
|
+
import { existsSync, readdirSync, statSync } from "node:fs";
|
|
7
|
+
import { join } from "node:path";
|
|
8
|
+
export function adrScopeDirs(sddRoot) {
|
|
9
|
+
return {
|
|
10
|
+
method: join(sddRoot, "docs", "method", "adr"),
|
|
11
|
+
platform: join(sddRoot, "docs", "platform", "adr"),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Discover every ADR file under docs/{method,platform}/adr plus
|
|
16
|
+
* docs/domains/{d}/adr in the given SDD.
|
|
17
|
+
*/
|
|
18
|
+
export function discoverAdrs(sddRoot) {
|
|
19
|
+
const out = [];
|
|
20
|
+
const scopes = adrScopeDirs(sddRoot);
|
|
21
|
+
for (const [scope, dir] of Object.entries(scopes)) {
|
|
22
|
+
out.push(...readAdrsFromDir(scope, dir));
|
|
23
|
+
}
|
|
24
|
+
const domainsRoot = join(sddRoot, "docs", "domains");
|
|
25
|
+
if (existsSync(domainsRoot)) {
|
|
26
|
+
for (const entry of safeReaddir(domainsRoot)) {
|
|
27
|
+
if (entry.startsWith("_"))
|
|
28
|
+
continue;
|
|
29
|
+
const adrDir = join(domainsRoot, entry, "adr");
|
|
30
|
+
out.push(...readAdrsFromDir(`domain:${entry}`, adrDir));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return out.sort((a, b) => a.number.localeCompare(b.number));
|
|
34
|
+
}
|
|
35
|
+
function readAdrsFromDir(scope, dir) {
|
|
36
|
+
if (!existsSync(dir))
|
|
37
|
+
return [];
|
|
38
|
+
const out = [];
|
|
39
|
+
for (const entry of safeReaddir(dir)) {
|
|
40
|
+
const match = entry.match(/^ADR\s+(\d{3,4})\s*:\s*(.+)\.md$/);
|
|
41
|
+
if (!match)
|
|
42
|
+
continue;
|
|
43
|
+
const [, num, title] = match;
|
|
44
|
+
if (!num || !title)
|
|
45
|
+
continue;
|
|
46
|
+
out.push({
|
|
47
|
+
scope,
|
|
48
|
+
number: num.padStart(4, "0"),
|
|
49
|
+
title,
|
|
50
|
+
path: join(dir, entry),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return out;
|
|
54
|
+
}
|
|
55
|
+
export function findAdr(sddRoot, scope, number) {
|
|
56
|
+
const padded = number.padStart(4, "0");
|
|
57
|
+
return discoverAdrs(sddRoot).find((a) => a.scope === scope && a.number === padded);
|
|
58
|
+
}
|
|
59
|
+
function safeReaddir(dir) {
|
|
60
|
+
try {
|
|
61
|
+
return readdirSync(dir);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export function safeIsFile(path) {
|
|
68
|
+
try {
|
|
69
|
+
return statSync(path).isFile();
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
export function safeIsDir(path) {
|
|
76
|
+
try {
|
|
77
|
+
return statSync(path).isDirectory();
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../../src/lib/mcp/parse/paths.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,OAAO;QACL,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC;QAC9C,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC;KACnD,CAAC;AACJ,CAAC;AASD;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,MAAM,GAAG,GAAoB,EAAE,CAAC;IAChC,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IACrC,KAAK,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,GAA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,EAAE,GAAG,CAAC;YAC5B,KAAK;YACL,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC;SACvB,CAAC,CAAC;IACL,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,OAAO,CACrB,OAAe,EACf,KAAa,EACb,MAAc;IAEd,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACvC,OAAO,YAAY,CAAC,OAAO,CAAC,CAAC,IAAI,CAC/B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM,CAChD,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,GAAW;IAC9B,IAAI,CAAC;QACH,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured error envelopes for pin_to_commit failure modes per the
|
|
3
|
+
* scope doc §Risks — "pinning to a non-existent SHA, a pre-marker
|
|
4
|
+
* commit, or a shallow clone should surface structured errors with
|
|
5
|
+
* actionable remediation, not opaque git errors."
|
|
6
|
+
*/
|
|
7
|
+
import { McpEnvelopeError } from "../errors.js";
|
|
8
|
+
export declare function pinNotFound(sha: string, sddRoot: string): McpEnvelopeError;
|
|
9
|
+
export declare function pinPreMarker(sha: string, sddRoot: string): McpEnvelopeError;
|
|
10
|
+
export declare function shallowCloneInsufficient(sha: string, sddRoot: string): McpEnvelopeError;
|
|
11
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/lib/mcp/pin/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAQ1E;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAQ3E;AAED,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GACd,gBAAgB,CAQlB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured error envelopes for pin_to_commit failure modes per the
|
|
3
|
+
* scope doc §Risks — "pinning to a non-existent SHA, a pre-marker
|
|
4
|
+
* commit, or a shallow clone should surface structured errors with
|
|
5
|
+
* actionable remediation, not opaque git errors."
|
|
6
|
+
*/
|
|
7
|
+
import { McpEnvelopeError } from "../errors.js";
|
|
8
|
+
export function pinNotFound(sha, sddRoot) {
|
|
9
|
+
return new McpEnvelopeError({
|
|
10
|
+
code: "PIN_NOT_FOUND",
|
|
11
|
+
message: `Commit ${sha} is not present in the git object database of ${sddRoot}.`,
|
|
12
|
+
remediation: "Fetch the ref (git fetch origin <branch>) or check the SHA spelling. For shallow clones, run git fetch --unshallow.",
|
|
13
|
+
context: { sha, sddRoot },
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
export function pinPreMarker(sha, sddRoot) {
|
|
17
|
+
return new McpEnvelopeError({
|
|
18
|
+
code: "PIN_PRE_MARKER",
|
|
19
|
+
message: `Commit ${sha} predates the .sdd-repo-kind marker; cannot treat this tree as an SDD.`,
|
|
20
|
+
remediation: "Pin to a commit after the SDD repo was initialised (the first commit containing .sdd-repo-kind), or omit pin_to_commit for a live read.",
|
|
21
|
+
context: { sha, sddRoot, expected_marker: ".sdd-repo-kind" },
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export function shallowCloneInsufficient(sha, sddRoot) {
|
|
25
|
+
return new McpEnvelopeError({
|
|
26
|
+
code: "SHALLOW_CLONE_INSUFFICIENT",
|
|
27
|
+
message: `SDD ${sddRoot} is a shallow clone; history for ${sha} is not available.`,
|
|
28
|
+
remediation: "Run `git fetch --unshallow` in the SDD repo, or re-clone without --depth.",
|
|
29
|
+
context: { sha, sddRoot },
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/lib/mcp/pin/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,UAAU,WAAW,CAAC,GAAW,EAAE,OAAe;IACtD,OAAO,IAAI,gBAAgB,CAAC;QAC1B,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,UAAU,GAAG,iDAAiD,OAAO,GAAG;QACjF,WAAW,EACT,qHAAqH;QACvH,OAAO,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE;KAC1B,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,OAAe;IACvD,OAAO,IAAI,gBAAgB,CAAC;QAC1B,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,UAAU,GAAG,wEAAwE;QAC9F,WAAW,EACT,yIAAyI;QAC3I,OAAO,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE;KAC7D,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,GAAW,EACX,OAAe;IAEf,OAAO,IAAI,gBAAgB,CAAC;QAC1B,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,OAAO,OAAO,oCAAoC,GAAG,oBAAoB;QAClF,WAAW,EACT,2EAA2E;QAC7E,OAAO,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE;KAC1B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public entry point for pin_to_commit handling. Tools call
|
|
3
|
+
* `readerFor(sddRoot, pin_to_commit)` and get an SddReader they can
|
|
4
|
+
* query without branching on live vs. pinned.
|
|
5
|
+
*
|
|
6
|
+
* A pinned reader materialises a temporary git worktree at the
|
|
7
|
+
* resolved SHA and returns a liveReader pointed at it. Every existing
|
|
8
|
+
* filesystem helper keeps working; responses echo the resolved SHA
|
|
9
|
+
* via `reader.pin`.
|
|
10
|
+
*/
|
|
11
|
+
import type { SddReader } from "../reader.js";
|
|
12
|
+
export { resolvePin } from "./resolve.js";
|
|
13
|
+
export { materialisePinnedWorktree, releasePinnedWorktrees } from "./read.js";
|
|
14
|
+
export * from "./errors.js";
|
|
15
|
+
export declare function readerFor(sddRoot: string, pinToCommit: string | undefined): SddReader;
|
|
16
|
+
/** Shutdown hook — idempotent. */
|
|
17
|
+
export declare function shutdownPinSubsystem(): void;
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/mcp/pin/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAC9E,cAAc,aAAa,CAAC;AAE5B,wBAAgB,SAAS,CACvB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,GAAG,SAAS,GAC9B,SAAS,CAOX;AAED,kCAAkC;AAClC,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public entry point for pin_to_commit handling. Tools call
|
|
3
|
+
* `readerFor(sddRoot, pin_to_commit)` and get an SddReader they can
|
|
4
|
+
* query without branching on live vs. pinned.
|
|
5
|
+
*
|
|
6
|
+
* A pinned reader materialises a temporary git worktree at the
|
|
7
|
+
* resolved SHA and returns a liveReader pointed at it. Every existing
|
|
8
|
+
* filesystem helper keeps working; responses echo the resolved SHA
|
|
9
|
+
* via `reader.pin`.
|
|
10
|
+
*/
|
|
11
|
+
import { liveReader } from "../reader.js";
|
|
12
|
+
import { materialisePinnedWorktree, releasePinnedWorktrees } from "./read.js";
|
|
13
|
+
import { resolvePin } from "./resolve.js";
|
|
14
|
+
export { resolvePin } from "./resolve.js";
|
|
15
|
+
export { materialisePinnedWorktree, releasePinnedWorktrees } from "./read.js";
|
|
16
|
+
export * from "./errors.js";
|
|
17
|
+
export function readerFor(sddRoot, pinToCommit) {
|
|
18
|
+
if (!pinToCommit || pinToCommit.trim().length === 0) {
|
|
19
|
+
return liveReader(sddRoot);
|
|
20
|
+
}
|
|
21
|
+
const { sha } = resolvePin(sddRoot, pinToCommit);
|
|
22
|
+
const wtPath = materialisePinnedWorktree(sddRoot, sha);
|
|
23
|
+
return liveReader(wtPath, sha);
|
|
24
|
+
}
|
|
25
|
+
/** Shutdown hook — idempotent. */
|
|
26
|
+
export function shutdownPinSubsystem() {
|
|
27
|
+
releasePinnedWorktrees();
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/mcp/pin/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAC9E,cAAc,aAAa,CAAC;AAE5B,MAAM,UAAU,SAAS,CACvB,OAAe,EACf,WAA+B;IAE/B,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpD,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IACD,MAAM,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,yBAAyB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACvD,OAAO,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AACjC,CAAC;AAED,kCAAkC;AAClC,MAAM,UAAU,oBAAoB;IAClC,sBAAsB,EAAE,CAAC;AAC3B,CAAC"}
|