@sdd-method/sdd-cli 1.43.0 → 1.44.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/NOTICE +1 -1
- package/README.md +13 -14
- package/dist/author-program.js +1 -1
- package/dist/author-program.js.map +1 -1
- package/dist/cli.js +0 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/catalogue/aggregate.js +6 -6
- package/dist/lib/catalogue/aggregate.js.map +1 -1
- package/dist/lib/catalogue/build.js +1 -1
- package/dist/lib/catalogue/build.js.map +1 -1
- package/dist/lib/catalogue/builders/c4-components.js +1 -1
- package/dist/lib/catalogue/builders/c4-components.js.map +1 -1
- package/dist/lib/catalogue/builders/c4-containers.d.ts +1 -1
- package/dist/lib/catalogue/builders/c4-containers.js +1 -1
- package/dist/lib/catalogue/builders/c4-l1-candidates.js +1 -1
- package/dist/lib/catalogue/builders/c4-l1-candidates.js.map +1 -1
- package/dist/lib/catalogue/builders/container-dependency.d.ts +1 -1
- package/dist/lib/catalogue/builders/container-dependency.js +1 -1
- package/dist/lib/catalogue/builders/data-store-mapping.js +1 -1
- package/dist/lib/catalogue/builders/data-store-mapping.js.map +1 -1
- package/dist/lib/catalogue/builders/screen-tree.d.ts +1 -1
- package/dist/lib/catalogue/builders/screen-tree.js +1 -1
- package/dist/lib/catalogue/contract-path-resolution.d.ts +2 -2
- package/dist/lib/catalogue/contract-path-resolution.js +2 -2
- package/dist/lib/catalogue/dedupe-keyed-tables.d.ts +1 -1
- package/dist/lib/catalogue/dedupe-keyed-tables.js +0 -0
- package/dist/lib/catalogue/dedupe-keyed-tables.js.map +1 -1
- package/dist/lib/catalogue/scores-coverage.js +1 -1
- package/dist/lib/catalogue/scores-coverage.js.map +1 -1
- package/dist/lib/catalogue/service-contract-aliases-loader.d.ts +1 -1
- package/dist/lib/catalogue/service-contract-aliases-loader.js +1 -1
- package/dist/lib/ci-binding/index.d.ts.map +1 -1
- package/dist/lib/ci-binding/index.js +44 -5
- package/dist/lib/ci-binding/index.js.map +1 -1
- package/dist/lib/ci-binding/module.d.ts +10 -0
- package/dist/lib/ci-binding/module.d.ts.map +1 -1
- package/dist/lib/ci-binding/module.js +74 -2
- package/dist/lib/ci-binding/module.js.map +1 -1
- package/dist/lib/hooks-seed/entries.d.ts +35 -11
- package/dist/lib/hooks-seed/entries.d.ts.map +1 -1
- package/dist/lib/hooks-seed/entries.js +43 -21
- package/dist/lib/hooks-seed/entries.js.map +1 -1
- package/dist/lib/hooks-seed/index.d.ts +2 -1
- package/dist/lib/hooks-seed/index.d.ts.map +1 -1
- package/dist/lib/hooks-seed/index.js +1 -1
- package/dist/lib/hooks-seed/index.js.map +1 -1
- package/dist/lib/init/ci-workflow.js +26 -2
- package/dist/lib/init/ci-workflow.js.map +1 -1
- package/dist/lib/init/platform.d.ts.map +1 -1
- package/dist/lib/init/platform.js +1 -0
- package/dist/lib/init/platform.js.map +1 -1
- package/dist/lib/lock-file.d.ts +7 -0
- package/dist/lib/lock-file.d.ts.map +1 -1
- package/dist/lib/lock-file.js +10 -0
- package/dist/lib/lock-file.js.map +1 -1
- package/dist/lib/pack/builder.d.ts +14 -0
- package/dist/lib/pack/builder.d.ts.map +1 -1
- package/dist/lib/pack/builder.js +56 -4
- package/dist/lib/pack/builder.js.map +1 -1
- package/dist/lib/pack/index.d.ts +3 -1
- package/dist/lib/pack/index.d.ts.map +1 -1
- package/dist/lib/pack/index.js +1 -0
- package/dist/lib/pack/index.js.map +1 -1
- package/dist/lib/pack/publish-transform.js +1 -1
- package/dist/lib/pack/publish-transform.js.map +1 -1
- package/dist/lib/snapshot/targets.js +1 -1
- package/dist/lib/snapshot/targets.js.map +1 -1
- package/dist/lib/sync/index.d.ts +11 -0
- package/dist/lib/sync/index.d.ts.map +1 -1
- package/dist/lib/sync/index.js +26 -2
- package/dist/lib/sync/index.js.map +1 -1
- package/dist/lib/sync/settings-merge.d.ts +3 -1
- package/dist/lib/sync/settings-merge.d.ts.map +1 -1
- package/dist/lib/sync/settings-merge.js +1 -1
- package/dist/lib/sync/settings-merge.js.map +1 -1
- package/dist/lib/validate/plan.d.ts +10 -1
- package/dist/lib/validate/plan.d.ts.map +1 -1
- package/dist/lib/validate/plan.js +6 -3
- package/dist/lib/validate/plan.js.map +1 -1
- package/dist/maintain-program.js +1 -1
- package/dist/maintain-program.js.map +1 -1
- package/dist/maintain-version.json +2 -2
- package/dist/verbs/pack-build.d.ts.map +1 -1
- package/dist/verbs/pack-build.js +22 -0
- package/dist/verbs/pack-build.js.map +1 -1
- package/dist/verbs/plan.js +1 -1
- package/dist/verbs/plan.js.map +1 -1
- package/dist/verbs/sync.d.ts.map +1 -1
- package/dist/verbs/sync.js +17 -0
- package/dist/verbs/sync.js.map +1 -1
- package/dist/verbs/validate.d.ts.map +1 -1
- package/dist/verbs/validate.js +6 -1
- package/dist/verbs/validate.js.map +1 -1
- package/dist/verify-program.js +1 -1
- package/dist/verify-program.js.map +1 -1
- package/dist/verify-version.json +2 -2
- package/package.json +2 -10
- package/scripts/README.md +1 -1
- package/scripts/author-version.json +2 -2
- package/scripts/maintain-acceptance.mjs +3 -2
- package/scripts/maintain-version.json +2 -2
- package/scripts/publish-release.mjs +117 -0
- package/scripts/release-gate.mjs +18 -7
- package/scripts/verify-version.json +2 -2
- package/dist/lib/catalogue/advisory-container-type.d.ts +0 -13
- package/dist/lib/catalogue/advisory-container-type.d.ts.map +0 -1
- package/dist/lib/catalogue/advisory-container-type.js +0 -56
- package/dist/lib/catalogue/advisory-container-type.js.map +0 -1
- package/dist/lib/hooks-seed/copilot.d.ts +0 -93
- package/dist/lib/hooks-seed/copilot.d.ts.map +0 -1
- package/dist/lib/hooks-seed/copilot.js +0 -167
- package/dist/lib/hooks-seed/copilot.js.map +0 -1
- package/dist/lib/hooks-seed/lifecycle-mapping.d.ts +0 -12
- package/dist/lib/hooks-seed/lifecycle-mapping.d.ts.map +0 -1
- package/dist/lib/hooks-seed/lifecycle-mapping.js +0 -28
- package/dist/lib/hooks-seed/lifecycle-mapping.js.map +0 -1
- package/dist/lib/mcp/build-info.d.ts +0 -7
- package/dist/lib/mcp/build-info.d.ts.map +0 -1
- package/dist/lib/mcp/build-info.js +0 -10
- package/dist/lib/mcp/build-info.js.map +0 -1
- package/dist/lib/mcp/errors.d.ts +0 -23
- package/dist/lib/mcp/errors.d.ts.map +0 -1
- package/dist/lib/mcp/errors.js +0 -25
- package/dist/lib/mcp/errors.js.map +0 -1
- package/dist/lib/mcp/parse/frontmatter.d.ts +0 -22
- package/dist/lib/mcp/parse/frontmatter.d.ts.map +0 -1
- package/dist/lib/mcp/parse/frontmatter.js +0 -49
- package/dist/lib/mcp/parse/frontmatter.js.map +0 -1
- package/dist/lib/mcp/parse/gate-registry.d.ts +0 -78
- package/dist/lib/mcp/parse/gate-registry.d.ts.map +0 -1
- package/dist/lib/mcp/parse/gate-registry.js +0 -164
- package/dist/lib/mcp/parse/gate-registry.js.map +0 -1
- package/dist/lib/mcp/parse/paths.d.ts +0 -21
- package/dist/lib/mcp/parse/paths.d.ts.map +0 -1
- package/dist/lib/mcp/parse/paths.js +0 -84
- package/dist/lib/mcp/parse/paths.js.map +0 -1
- package/dist/lib/mcp/pin/errors.d.ts +0 -11
- package/dist/lib/mcp/pin/errors.d.ts.map +0 -1
- package/dist/lib/mcp/pin/errors.js +0 -32
- package/dist/lib/mcp/pin/errors.js.map +0 -1
- package/dist/lib/mcp/pin/index.d.ts +0 -18
- package/dist/lib/mcp/pin/index.d.ts.map +0 -1
- package/dist/lib/mcp/pin/index.js +0 -29
- package/dist/lib/mcp/pin/index.js.map +0 -1
- package/dist/lib/mcp/pin/read.d.ts +0 -24
- package/dist/lib/mcp/pin/read.d.ts.map +0 -1
- package/dist/lib/mcp/pin/read.js +0 -64
- package/dist/lib/mcp/pin/read.js.map +0 -1
- package/dist/lib/mcp/pin/resolve.d.ts +0 -12
- package/dist/lib/mcp/pin/resolve.d.ts.map +0 -1
- package/dist/lib/mcp/pin/resolve.js +0 -33
- package/dist/lib/mcp/pin/resolve.js.map +0 -1
- package/dist/lib/mcp/prompts/evaluate-cascade.d.ts +0 -14
- package/dist/lib/mcp/prompts/evaluate-cascade.d.ts.map +0 -1
- package/dist/lib/mcp/prompts/evaluate-cascade.js +0 -147
- package/dist/lib/mcp/prompts/evaluate-cascade.js.map +0 -1
- package/dist/lib/mcp/prompts/index.d.ts +0 -9
- package/dist/lib/mcp/prompts/index.d.ts.map +0 -1
- package/dist/lib/mcp/prompts/index.js +0 -23
- package/dist/lib/mcp/prompts/index.js.map +0 -1
- package/dist/lib/mcp/prompts/propose-adr.d.ts +0 -12
- package/dist/lib/mcp/prompts/propose-adr.d.ts.map +0 -1
- package/dist/lib/mcp/prompts/propose-adr.js +0 -100
- package/dist/lib/mcp/prompts/propose-adr.js.map +0 -1
- package/dist/lib/mcp/prompts/review-data-model-change.d.ts +0 -10
- package/dist/lib/mcp/prompts/review-data-model-change.d.ts.map +0 -1
- package/dist/lib/mcp/prompts/review-data-model-change.js +0 -134
- package/dist/lib/mcp/prompts/review-data-model-change.js.map +0 -1
- package/dist/lib/mcp/prompts/template-loader.d.ts +0 -29
- package/dist/lib/mcp/prompts/template-loader.d.ts.map +0 -1
- package/dist/lib/mcp/prompts/template-loader.js +0 -44
- package/dist/lib/mcp/prompts/template-loader.js.map +0 -1
- package/dist/lib/mcp/prompts/types.d.ts +0 -17
- package/dist/lib/mcp/prompts/types.d.ts.map +0 -1
- package/dist/lib/mcp/prompts/types.js +0 -10
- package/dist/lib/mcp/prompts/types.js.map +0 -1
- package/dist/lib/mcp/prompts/write-capability-spec.d.ts +0 -8
- package/dist/lib/mcp/prompts/write-capability-spec.d.ts.map +0 -1
- package/dist/lib/mcp/prompts/write-capability-spec.js +0 -85
- package/dist/lib/mcp/prompts/write-capability-spec.js.map +0 -1
- package/dist/lib/mcp/prompts/write-feature-spec.d.ts +0 -10
- package/dist/lib/mcp/prompts/write-feature-spec.d.ts.map +0 -1
- package/dist/lib/mcp/prompts/write-feature-spec.js +0 -94
- package/dist/lib/mcp/prompts/write-feature-spec.js.map +0 -1
- package/dist/lib/mcp/prompts/write-work-order.d.ts +0 -7
- package/dist/lib/mcp/prompts/write-work-order.d.ts.map +0 -1
- package/dist/lib/mcp/prompts/write-work-order.js +0 -69
- package/dist/lib/mcp/prompts/write-work-order.js.map +0 -1
- package/dist/lib/mcp/reader.d.ts +0 -37
- package/dist/lib/mcp/reader.d.ts.map +0 -1
- package/dist/lib/mcp/reader.js +0 -93
- package/dist/lib/mcp/reader.js.map +0 -1
- package/dist/lib/mcp/resources/adrs.d.ts +0 -3
- package/dist/lib/mcp/resources/adrs.d.ts.map +0 -1
- package/dist/lib/mcp/resources/adrs.js +0 -97
- package/dist/lib/mcp/resources/adrs.js.map +0 -1
- package/dist/lib/mcp/resources/catalogue.d.ts +0 -19
- package/dist/lib/mcp/resources/catalogue.d.ts.map +0 -1
- package/dist/lib/mcp/resources/catalogue.js +0 -240
- package/dist/lib/mcp/resources/catalogue.js.map +0 -1
- package/dist/lib/mcp/resources/data-models.d.ts +0 -14
- package/dist/lib/mcp/resources/data-models.d.ts.map +0 -1
- package/dist/lib/mcp/resources/data-models.js +0 -81
- package/dist/lib/mcp/resources/data-models.js.map +0 -1
- package/dist/lib/mcp/resources/gates.d.ts +0 -9
- package/dist/lib/mcp/resources/gates.d.ts.map +0 -1
- package/dist/lib/mcp/resources/gates.js +0 -76
- package/dist/lib/mcp/resources/gates.js.map +0 -1
- package/dist/lib/mcp/resources/glossary.d.ts +0 -16
- package/dist/lib/mcp/resources/glossary.d.ts.map +0 -1
- package/dist/lib/mcp/resources/glossary.js +0 -87
- package/dist/lib/mcp/resources/glossary.js.map +0 -1
- package/dist/lib/mcp/resources/specs.d.ts +0 -23
- package/dist/lib/mcp/resources/specs.d.ts.map +0 -1
- package/dist/lib/mcp/resources/specs.js +0 -151
- package/dist/lib/mcp/resources/specs.js.map +0 -1
- package/dist/lib/mcp/resources/version.d.ts +0 -3
- package/dist/lib/mcp/resources/version.d.ts.map +0 -1
- package/dist/lib/mcp/resources/version.js +0 -45
- package/dist/lib/mcp/resources/version.js.map +0 -1
- package/dist/lib/mcp/server.d.ts +0 -29
- package/dist/lib/mcp/server.d.ts.map +0 -1
- package/dist/lib/mcp/server.js +0 -108
- package/dist/lib/mcp/server.js.map +0 -1
- package/dist/lib/mcp/tools/cascade-impact.d.ts +0 -22
- package/dist/lib/mcp/tools/cascade-impact.d.ts.map +0 -1
- package/dist/lib/mcp/tools/cascade-impact.js +0 -53
- package/dist/lib/mcp/tools/cascade-impact.js.map +0 -1
- package/dist/lib/mcp/tools/catalogue.d.ts +0 -16
- package/dist/lib/mcp/tools/catalogue.d.ts.map +0 -1
- package/dist/lib/mcp/tools/catalogue.js +0 -268
- package/dist/lib/mcp/tools/catalogue.js.map +0 -1
- package/dist/lib/mcp/tools/find-consumers-of-contract.d.ts +0 -7
- package/dist/lib/mcp/tools/find-consumers-of-contract.d.ts.map +0 -1
- package/dist/lib/mcp/tools/find-consumers-of-contract.js +0 -70
- package/dist/lib/mcp/tools/find-consumers-of-contract.js.map +0 -1
- package/dist/lib/mcp/tools/find-consumers.d.ts +0 -7
- package/dist/lib/mcp/tools/find-consumers.d.ts.map +0 -1
- package/dist/lib/mcp/tools/find-consumers.js +0 -52
- package/dist/lib/mcp/tools/find-consumers.js.map +0 -1
- package/dist/lib/mcp/tools/find-dependencies.d.ts +0 -8
- package/dist/lib/mcp/tools/find-dependencies.d.ts.map +0 -1
- package/dist/lib/mcp/tools/find-dependencies.js +0 -101
- package/dist/lib/mcp/tools/find-dependencies.js.map +0 -1
- package/dist/lib/mcp/tools/find-dependents.d.ts +0 -8
- package/dist/lib/mcp/tools/find-dependents.d.ts.map +0 -1
- package/dist/lib/mcp/tools/find-dependents.js +0 -89
- package/dist/lib/mcp/tools/find-dependents.js.map +0 -1
- package/dist/lib/mcp/tools/find-producers.d.ts +0 -8
- package/dist/lib/mcp/tools/find-producers.d.ts.map +0 -1
- package/dist/lib/mcp/tools/find-producers.js +0 -57
- package/dist/lib/mcp/tools/find-producers.js.map +0 -1
- package/dist/lib/mcp/tools/find-related-specs.d.ts +0 -9
- package/dist/lib/mcp/tools/find-related-specs.d.ts.map +0 -1
- package/dist/lib/mcp/tools/find-related-specs.js +0 -92
- package/dist/lib/mcp/tools/find-related-specs.js.map +0 -1
- package/dist/lib/mcp/tools/list-adrs.d.ts +0 -3
- package/dist/lib/mcp/tools/list-adrs.d.ts.map +0 -1
- package/dist/lib/mcp/tools/list-adrs.js +0 -73
- package/dist/lib/mcp/tools/list-adrs.js.map +0 -1
- package/dist/lib/mcp/tools/query-gate-status.d.ts +0 -3
- package/dist/lib/mcp/tools/query-gate-status.d.ts.map +0 -1
- package/dist/lib/mcp/tools/query-gate-status.js +0 -68
- package/dist/lib/mcp/tools/query-gate-status.js.map +0 -1
- package/dist/lib/mcp/tools/search-specs.d.ts +0 -12
- package/dist/lib/mcp/tools/search-specs.d.ts.map +0 -1
- package/dist/lib/mcp/tools/search-specs.js +0 -151
- package/dist/lib/mcp/tools/search-specs.js.map +0 -1
- package/dist/lib/mcp/workspace.d.ts +0 -31
- package/dist/lib/mcp/workspace.d.ts.map +0 -1
- package/dist/lib/mcp/workspace.js +0 -146
- package/dist/lib/mcp/workspace.js.map +0 -1
- package/dist/lib/mcp-seed/entries.d.ts +0 -32
- package/dist/lib/mcp-seed/entries.d.ts.map +0 -1
- package/dist/lib/mcp-seed/entries.js +0 -14
- package/dist/lib/mcp-seed/entries.js.map +0 -1
- package/dist/lib/mcp-seed/index.d.ts +0 -36
- package/dist/lib/mcp-seed/index.d.ts.map +0 -1
- package/dist/lib/mcp-seed/index.js +0 -28
- package/dist/lib/mcp-seed/index.js.map +0 -1
- package/dist/lib/mcp-seed/merge.d.ts +0 -34
- package/dist/lib/mcp-seed/merge.d.ts.map +0 -1
- package/dist/lib/mcp-seed/merge.js +0 -99
- package/dist/lib/mcp-seed/merge.js.map +0 -1
- package/dist/lib/mcp-seed/types.d.ts +0 -24
- package/dist/lib/mcp-seed/types.d.ts.map +0 -1
- package/dist/lib/mcp-seed/types.js +0 -13
- package/dist/lib/mcp-seed/types.js.map +0 -1
- package/dist/lib/sdd-index/cascade.d.ts +0 -46
- package/dist/lib/sdd-index/cascade.d.ts.map +0 -1
- package/dist/lib/sdd-index/cascade.js +0 -91
- package/dist/lib/sdd-index/cascade.js.map +0 -1
- package/dist/lib/sdd-index/contracts.d.ts +0 -29
- package/dist/lib/sdd-index/contracts.d.ts.map +0 -1
- package/dist/lib/sdd-index/contracts.js +0 -216
- package/dist/lib/sdd-index/contracts.js.map +0 -1
- package/dist/lib/sdd-index/data-model.d.ts +0 -13
- package/dist/lib/sdd-index/data-model.d.ts.map +0 -1
- package/dist/lib/sdd-index/data-model.js +0 -23
- package/dist/lib/sdd-index/data-model.js.map +0 -1
- package/dist/lib/sdd-index/execution-map.d.ts +0 -34
- package/dist/lib/sdd-index/execution-map.d.ts.map +0 -1
- package/dist/lib/sdd-index/execution-map.js +0 -105
- package/dist/lib/sdd-index/execution-map.js.map +0 -1
- package/dist/lib/sdd-index/graph.d.ts +0 -28
- package/dist/lib/sdd-index/graph.d.ts.map +0 -1
- package/dist/lib/sdd-index/graph.js +0 -122
- package/dist/lib/sdd-index/graph.js.map +0 -1
- package/dist/lib/sdd-index/index.d.ts +0 -29
- package/dist/lib/sdd-index/index.d.ts.map +0 -1
- package/dist/lib/sdd-index/index.js +0 -79
- package/dist/lib/sdd-index/index.js.map +0 -1
- package/dist/lib/sdd-index/watch.d.ts +0 -24
- package/dist/lib/sdd-index/watch.d.ts.map +0 -1
- package/dist/lib/sdd-index/watch.js +0 -112
- package/dist/lib/sdd-index/watch.js.map +0 -1
- package/dist/lib/sync/copilot-hooks-merge.d.ts +0 -36
- package/dist/lib/sync/copilot-hooks-merge.d.ts.map +0 -1
- package/dist/lib/sync/copilot-hooks-merge.js +0 -108
- package/dist/lib/sync/copilot-hooks-merge.js.map +0 -1
- package/dist/verbs/mcp.d.ts +0 -3
- package/dist/verbs/mcp.d.ts.map +0 -1
- package/dist/verbs/mcp.js +0 -22
- package/dist/verbs/mcp.js.map +0 -1
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Builders + drift detection for the method-managed GitHub Copilot CLI
|
|
3
|
-
* hooks, per `docs/method/methods/hook-contracts.md` (Hook 1, Hook 2)
|
|
4
|
-
* and the portable contracts in `hook-portable-contract-schema.yaml`.
|
|
5
|
-
*
|
|
6
|
-
* The Copilot CLI surface differs from Claude Code in three ways
|
|
7
|
-
* (per ADR 0141 §4.3 + hook-contracts.md):
|
|
8
|
-
*
|
|
9
|
-
* 1. Hook configs live in per-event JSON files (`.github/hooks/<event>.json`),
|
|
10
|
-
* not a single settings.json.
|
|
11
|
-
* 2. No per-tool matcher — every `preToolUse` hook fires for every
|
|
12
|
-
* tool, with in-script filtering instead.
|
|
13
|
-
* 3. Approval semantic is declarative (`approval: deny-on-nonzero`)
|
|
14
|
-
* rather than exit-code based.
|
|
15
|
-
*
|
|
16
|
-
* Ownership is sentinel-based, same as Claude Code: the `bash` and
|
|
17
|
-
* `powershell` command strings carry `# sdd-method-managed:true`.
|
|
18
|
-
* Adopter-added events in the same `events[]` array lack the sentinel
|
|
19
|
-
* and survive sync.
|
|
20
|
-
*/
|
|
21
|
-
import { type PortableLifecycleEventClass } from "./lifecycle-mapping.js";
|
|
22
|
-
/**
|
|
23
|
-
* The shape of one event entry in `.github/hooks/<event>.json`.
|
|
24
|
-
* `command` may be either a single shell string or a per-shell object —
|
|
25
|
-
* we always emit the per-shell object for Windows/PowerShell parity.
|
|
26
|
-
*/
|
|
27
|
-
export interface CopilotHookCommand {
|
|
28
|
-
readonly bash: string;
|
|
29
|
-
readonly powershell: string;
|
|
30
|
-
}
|
|
31
|
-
export interface CopilotHookEvent {
|
|
32
|
-
readonly type: string;
|
|
33
|
-
readonly command: CopilotHookCommand;
|
|
34
|
-
readonly timeout_ms?: number;
|
|
35
|
-
readonly approval?: "always-allow" | "deny-on-nonzero";
|
|
36
|
-
}
|
|
37
|
-
export interface CopilotHookFile {
|
|
38
|
-
readonly version: 1;
|
|
39
|
-
readonly events: readonly CopilotHookEvent[];
|
|
40
|
-
readonly [key: string]: unknown;
|
|
41
|
-
}
|
|
42
|
-
export declare function copilotHookFilePath(portable: PortableLifecycleEventClass): string;
|
|
43
|
-
/**
|
|
44
|
-
* Hook 1 — `block-edits-to-method-managed-paths` (pre_tool_use).
|
|
45
|
-
* Copilot CLI has no per-tool matcher, so the script
|
|
46
|
-
* (orchestration/scripts/copilot-method-guard.{sh,ps1}) does the
|
|
47
|
-
* filtering on tool name in addition to the path check. Method-side
|
|
48
|
-
* authors the scripts; we just emit the wiring.
|
|
49
|
-
*/
|
|
50
|
-
export declare function buildCopilotPreToolUseEvent(): CopilotHookEvent;
|
|
51
|
-
/**
|
|
52
|
-
* Hook 2 — `validate-adr-structure-on-session-start` (session_start).
|
|
53
|
-
* Output is surfaced as session-baseline context; non-blocking
|
|
54
|
-
* (`approval: always-allow`) to match the portable contract's `warn`
|
|
55
|
-
* exit-code semantic.
|
|
56
|
-
*/
|
|
57
|
-
export declare function buildCopilotSessionStartEvent(): CopilotHookEvent;
|
|
58
|
-
/**
|
|
59
|
-
* Method-managed Copilot CLI hook surface. The map is portable-class →
|
|
60
|
-
* `{ filePath, events: [method-managed events to write] }`. The
|
|
61
|
-
* settings-merge pass walks this to render each `.github/hooks/*.json`
|
|
62
|
-
* file with sentinel-based ownership.
|
|
63
|
-
*/
|
|
64
|
-
export type CopilotHookSurface = Readonly<Record<PortableLifecycleEventClass, {
|
|
65
|
-
filePath: string;
|
|
66
|
-
events: readonly CopilotHookEvent[];
|
|
67
|
-
}>>;
|
|
68
|
-
export declare function buildMethodManagedCopilotHooks(): Partial<CopilotHookSurface>;
|
|
69
|
-
/**
|
|
70
|
-
* An event entry is method-managed iff its `command.bash` (or
|
|
71
|
-
* `command.powershell`) carries the sentinel.
|
|
72
|
-
*/
|
|
73
|
-
export declare function isMethodManagedEvent(event: CopilotHookEvent): boolean;
|
|
74
|
-
export interface CopilotMergeResult {
|
|
75
|
-
readonly file: CopilotHookFile;
|
|
76
|
-
/** True iff a method-managed event differs from incoming or was added. */
|
|
77
|
-
readonly changed: boolean;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Upsert method-managed events into an existing hook file. Adopter-
|
|
81
|
-
* added events (no sentinel) survive. An unmarked adopter event that
|
|
82
|
-
* is equivalent (modulo sentinel) to a method-managed event we're
|
|
83
|
-
* adding gets de-duped — same safety net as the Claude Code merge
|
|
84
|
-
* post-v0.12.2.
|
|
85
|
-
*/
|
|
86
|
-
export declare function upsertCopilotHookFile(existing: CopilotHookFile | null, owned: readonly CopilotHookEvent[]): CopilotMergeResult;
|
|
87
|
-
/**
|
|
88
|
-
* Detect adopter drift: an event still carrying the sentinel but whose
|
|
89
|
-
* content no longer matches the canonical version we'd write. Returns
|
|
90
|
-
* `true` iff drift is present.
|
|
91
|
-
*/
|
|
92
|
-
export declare function detectCopilotHookDrift(existing: CopilotHookFile | null, owned: readonly CopilotHookEvent[]): boolean;
|
|
93
|
-
//# sourceMappingURL=copilot.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"copilot.d.ts","sourceRoot":"","sources":["../../../src/lib/hooks-seed/copilot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAmB,KAAK,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAI3F;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC,QAAQ,CAAC,UAAU,CAAC,EA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
1
|
-
/**
|
|
2
|
-
* Builders + drift detection for the method-managed GitHub Copilot CLI
|
|
3
|
-
* hooks, per `docs/method/methods/hook-contracts.md` (Hook 1, Hook 2)
|
|
4
|
-
* and the portable contracts in `hook-portable-contract-schema.yaml`.
|
|
5
|
-
*
|
|
6
|
-
* The Copilot CLI surface differs from Claude Code in three ways
|
|
7
|
-
* (per ADR 0141 §4.3 + hook-contracts.md):
|
|
8
|
-
*
|
|
9
|
-
* 1. Hook configs live in per-event JSON files (`.github/hooks/<event>.json`),
|
|
10
|
-
* not a single settings.json.
|
|
11
|
-
* 2. No per-tool matcher — every `preToolUse` hook fires for every
|
|
12
|
-
* tool, with in-script filtering instead.
|
|
13
|
-
* 3. Approval semantic is declarative (`approval: deny-on-nonzero`)
|
|
14
|
-
* rather than exit-code based.
|
|
15
|
-
*
|
|
16
|
-
* Ownership is sentinel-based, same as Claude Code: the `bash` and
|
|
17
|
-
* `powershell` command strings carry `# sdd-method-managed:true`.
|
|
18
|
-
* Adopter-added events in the same `events[]` array lack the sentinel
|
|
19
|
-
* and survive sync.
|
|
20
|
-
*/
|
|
21
|
-
import { METHOD_MANAGED_SENTINEL } from "./types.js";
|
|
22
|
-
import { nativeEventName } from "./lifecycle-mapping.js";
|
|
23
|
-
const HARNESS = "github-copilot-cli";
|
|
24
|
-
/** Filename per portable lifecycle class. */
|
|
25
|
-
const HOOK_FILE_BY_PORTABLE = {
|
|
26
|
-
pre_tool_use: "pre-tool-use.json",
|
|
27
|
-
session_start: "session-start.json",
|
|
28
|
-
};
|
|
29
|
-
export function copilotHookFilePath(portable) {
|
|
30
|
-
const name = HOOK_FILE_BY_PORTABLE[portable];
|
|
31
|
-
if (!name) {
|
|
32
|
-
throw new Error(`No Copilot CLI hook file mapped for portable class "${portable}"`);
|
|
33
|
-
}
|
|
34
|
-
return `.github/hooks/${name}`;
|
|
35
|
-
}
|
|
36
|
-
function withSentinel(command) {
|
|
37
|
-
if (command.includes(METHOD_MANAGED_SENTINEL))
|
|
38
|
-
return command;
|
|
39
|
-
return `${command} ${METHOD_MANAGED_SENTINEL}`;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Hook 1 — `block-edits-to-method-managed-paths` (pre_tool_use).
|
|
43
|
-
* Copilot CLI has no per-tool matcher, so the script
|
|
44
|
-
* (orchestration/scripts/copilot-method-guard.{sh,ps1}) does the
|
|
45
|
-
* filtering on tool name in addition to the path check. Method-side
|
|
46
|
-
* authors the scripts; we just emit the wiring.
|
|
47
|
-
*/
|
|
48
|
-
export function buildCopilotPreToolUseEvent() {
|
|
49
|
-
return {
|
|
50
|
-
type: nativeEventName(HARNESS, "pre_tool_use"),
|
|
51
|
-
command: {
|
|
52
|
-
bash: withSentinel("./orchestration/scripts/copilot-method-guard.sh"),
|
|
53
|
-
powershell: withSentinel("./orchestration/scripts/copilot-method-guard.ps1"),
|
|
54
|
-
},
|
|
55
|
-
timeout_ms: 5000,
|
|
56
|
-
approval: "deny-on-nonzero",
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Hook 2 — `validate-adr-structure-on-session-start` (session_start).
|
|
61
|
-
* Output is surfaced as session-baseline context; non-blocking
|
|
62
|
-
* (`approval: always-allow`) to match the portable contract's `warn`
|
|
63
|
-
* exit-code semantic.
|
|
64
|
-
*/
|
|
65
|
-
export function buildCopilotSessionStartEvent() {
|
|
66
|
-
return {
|
|
67
|
-
type: nativeEventName(HARNESS, "session_start"),
|
|
68
|
-
command: {
|
|
69
|
-
bash: withSentinel("sdd-cli validate --validator adr-structure 2>&1 | head -20"),
|
|
70
|
-
powershell: withSentinel("sdd-cli validate --validator adr-structure 2>&1 | Select-Object -First 20"),
|
|
71
|
-
},
|
|
72
|
-
timeout_ms: 30000,
|
|
73
|
-
approval: "always-allow",
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
export function buildMethodManagedCopilotHooks() {
|
|
77
|
-
return {
|
|
78
|
-
pre_tool_use: {
|
|
79
|
-
filePath: copilotHookFilePath("pre_tool_use"),
|
|
80
|
-
events: [buildCopilotPreToolUseEvent()],
|
|
81
|
-
},
|
|
82
|
-
session_start: {
|
|
83
|
-
filePath: copilotHookFilePath("session_start"),
|
|
84
|
-
events: [buildCopilotSessionStartEvent()],
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* An event entry is method-managed iff its `command.bash` (or
|
|
90
|
-
* `command.powershell`) carries the sentinel.
|
|
91
|
-
*/
|
|
92
|
-
export function isMethodManagedEvent(event) {
|
|
93
|
-
const bash = typeof event.command?.bash === "string" ? event.command.bash : "";
|
|
94
|
-
const ps = typeof event.command?.powershell === "string"
|
|
95
|
-
? event.command.powershell
|
|
96
|
-
: "";
|
|
97
|
-
return (bash.includes(METHOD_MANAGED_SENTINEL) ||
|
|
98
|
-
ps.includes(METHOD_MANAGED_SENTINEL));
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Strip the sentinel and trailing whitespace from a command string so
|
|
102
|
-
* two commands can be compared modulo ownership marker. Symmetric to
|
|
103
|
-
* the Claude Code merge logic.
|
|
104
|
-
*/
|
|
105
|
-
function normaliseCommandString(command) {
|
|
106
|
-
return command.replace(METHOD_MANAGED_SENTINEL, "").trimEnd();
|
|
107
|
-
}
|
|
108
|
-
function eventsEquivalentExcludingSentinel(a, b) {
|
|
109
|
-
if (a.type !== b.type)
|
|
110
|
-
return false;
|
|
111
|
-
if (a.approval !== b.approval)
|
|
112
|
-
return false;
|
|
113
|
-
if (a.timeout_ms !== b.timeout_ms)
|
|
114
|
-
return false;
|
|
115
|
-
const aBash = a.command?.bash ?? "";
|
|
116
|
-
const bBash = b.command?.bash ?? "";
|
|
117
|
-
const aPs = a.command?.powershell ?? "";
|
|
118
|
-
const bPs = b.command?.powershell ?? "";
|
|
119
|
-
return (normaliseCommandString(aBash) === normaliseCommandString(bBash) &&
|
|
120
|
-
normaliseCommandString(aPs) === normaliseCommandString(bPs));
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Upsert method-managed events into an existing hook file. Adopter-
|
|
124
|
-
* added events (no sentinel) survive. An unmarked adopter event that
|
|
125
|
-
* is equivalent (modulo sentinel) to a method-managed event we're
|
|
126
|
-
* adding gets de-duped — same safety net as the Claude Code merge
|
|
127
|
-
* post-v0.12.2.
|
|
128
|
-
*/
|
|
129
|
-
export function upsertCopilotHookFile(existing, owned) {
|
|
130
|
-
const currentEvents = existing?.events ?? [];
|
|
131
|
-
let dedupedAny = false;
|
|
132
|
-
const adopterEvents = currentEvents.filter((evt) => {
|
|
133
|
-
if (isMethodManagedEvent(evt))
|
|
134
|
-
return false;
|
|
135
|
-
const equivalent = owned.some((o) => eventsEquivalentExcludingSentinel(evt, o));
|
|
136
|
-
if (equivalent) {
|
|
137
|
-
dedupedAny = true;
|
|
138
|
-
return false;
|
|
139
|
-
}
|
|
140
|
-
return true;
|
|
141
|
-
});
|
|
142
|
-
const before = currentEvents.filter((e) => isMethodManagedEvent(e));
|
|
143
|
-
const after = owned;
|
|
144
|
-
const methodChanged = JSON.stringify(before) !== JSON.stringify(after);
|
|
145
|
-
const nextFile = {
|
|
146
|
-
version: 1,
|
|
147
|
-
events: [...adopterEvents, ...owned],
|
|
148
|
-
};
|
|
149
|
-
return {
|
|
150
|
-
file: nextFile,
|
|
151
|
-
changed: methodChanged || dedupedAny,
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Detect adopter drift: an event still carrying the sentinel but whose
|
|
156
|
-
* content no longer matches the canonical version we'd write. Returns
|
|
157
|
-
* `true` iff drift is present.
|
|
158
|
-
*/
|
|
159
|
-
export function detectCopilotHookDrift(existing, owned) {
|
|
160
|
-
if (!existing)
|
|
161
|
-
return false;
|
|
162
|
-
const existingMethod = existing.events.filter((e) => isMethodManagedEvent(e));
|
|
163
|
-
if (existingMethod.length === 0)
|
|
164
|
-
return false;
|
|
165
|
-
return JSON.stringify(existingMethod) !== JSON.stringify(owned);
|
|
166
|
-
}
|
|
167
|
-
//# sourceMappingURL=copilot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"copilot.js","sourceRoot":"","sources":["../../../src/lib/hooks-seed/copilot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,eAAe,EAAoC,MAAM,wBAAwB,CAAC;AAE3F,MAAM,OAAO,GAAG,oBAA6B,CAAC;AAyB9C,6CAA6C;AAC7C,MAAM,qBAAqB,GAEvB;IACF,YAAY,EAAE,mBAAmB;IACjC,aAAa,EAAE,oBAAoB;CACpC,CAAC;AAEF,MAAM,UAAU,mBAAmB,CACjC,QAAqC;IAErC,MAAM,IAAI,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IAC7C,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CACb,uDAAuD,QAAQ,GAAG,CACnE,CAAC;IACJ,CAAC;IACD,OAAO,iBAAiB,IAAI,EAAE,CAAC;AACjC,CAAC;AAED,SAAS,YAAY,CAAC,OAAe;IACnC,IAAI,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QAAE,OAAO,OAAO,CAAC;IAC9D,OAAO,GAAG,OAAO,IAAI,uBAAuB,EAAE,CAAC;AACjD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B;IACzC,OAAO;QACL,IAAI,EAAE,eAAe,CAAC,OAAO,EAAE,cAAc,CAAC;QAC9C,OAAO,EAAE;YACP,IAAI,EAAE,YAAY,CAAC,iDAAiD,CAAC;YACrE,UAAU,EAAE,YAAY,CACtB,kDAAkD,CACnD;SACF;QACD,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,iBAAiB;KAC5B,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,6BAA6B;IAC3C,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C,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;IACpE,MAAM,KAAK,GAAG,KAAK,CAAC;IACpB,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAEvE,MAAM,QAAQ,GAAoB;QAChC,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,CAAC,GAAG,aAAa,EAAE,GAAG,KAAK,CAAC;KACrC,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,aAAa,IAAI,UAAU;KACrC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CACpC,QAAgC,EAChC,KAAkC;IAElC,IAAI,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5B,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9E,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9C,OAAO,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Portable lifecycle event class → harness-native event mapping per
|
|
3
|
-
* ADR 0141 §4.3 and the table in `docs/method/foundations/lifecycle-event-classes.yaml`.
|
|
4
|
-
*
|
|
5
|
-
* Adding a new harness binding is mechanical: extend `AgentHarness`
|
|
6
|
-
* in src/lib/agent-harness.ts and add a row here. Hook builders
|
|
7
|
-
* consume this mapping rather than hand-coding native event names.
|
|
8
|
-
*/
|
|
9
|
-
import type { AgentHarness } from "../agent-harness.js";
|
|
10
|
-
export type PortableLifecycleEventClass = "pre_tool_use" | "post_tool_use" | "user_prompt_submit" | "session_start" | "session_stop";
|
|
11
|
-
export declare function nativeEventName(harness: AgentHarness, portable: PortableLifecycleEventClass): string;
|
|
12
|
-
//# sourceMappingURL=lifecycle-mapping.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle-mapping.d.ts","sourceRoot":"","sources":["../../../src/lib/hooks-seed/lifecycle-mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,MAAM,2BAA2B,GACnC,cAAc,GACd,eAAe,GACf,oBAAoB,GACpB,eAAe,GACf,cAAc,CAAC;AAqBnB,wBAAgB,eAAe,CAC7B,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,2BAA2B,GACpC,MAAM,CAER"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Portable lifecycle event class → harness-native event mapping per
|
|
3
|
-
* ADR 0141 §4.3 and the table in `docs/method/foundations/lifecycle-event-classes.yaml`.
|
|
4
|
-
*
|
|
5
|
-
* Adding a new harness binding is mechanical: extend `AgentHarness`
|
|
6
|
-
* in src/lib/agent-harness.ts and add a row here. Hook builders
|
|
7
|
-
* consume this mapping rather than hand-coding native event names.
|
|
8
|
-
*/
|
|
9
|
-
const MAPPINGS = {
|
|
10
|
-
"claude-code": {
|
|
11
|
-
pre_tool_use: "PreToolUse",
|
|
12
|
-
post_tool_use: "PostToolUse",
|
|
13
|
-
user_prompt_submit: "UserPromptSubmit",
|
|
14
|
-
session_start: "SessionStart",
|
|
15
|
-
session_stop: "Stop",
|
|
16
|
-
},
|
|
17
|
-
"github-copilot-cli": {
|
|
18
|
-
pre_tool_use: "preToolUse",
|
|
19
|
-
post_tool_use: "postToolUse",
|
|
20
|
-
user_prompt_submit: "userPromptSubmitted",
|
|
21
|
-
session_start: "sessionStart",
|
|
22
|
-
session_stop: "agentStop",
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
export function nativeEventName(harness, portable) {
|
|
26
|
-
return MAPPINGS[harness][portable];
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=lifecycle-mapping.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle-mapping.js","sourceRoot":"","sources":["../../../src/lib/hooks-seed/lifecycle-mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAWH,MAAM,QAAQ,GAEV;IACF,aAAa,EAAE;QACb,YAAY,EAAE,YAAY;QAC1B,aAAa,EAAE,aAAa;QAC5B,kBAAkB,EAAE,kBAAkB;QACtC,aAAa,EAAE,cAAc;QAC7B,YAAY,EAAE,MAAM;KACrB;IACD,oBAAoB,EAAE;QACpB,YAAY,EAAE,YAAY;QAC1B,aAAa,EAAE,aAAa;QAC5B,kBAAkB,EAAE,qBAAqB;QACzC,aAAa,EAAE,cAAc;QAC7B,YAAY,EAAE,WAAW;KAC1B;CACF,CAAC;AAEF,MAAM,UAAU,eAAe,CAC7B,OAAqB,EACrB,QAAqC;IAErC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-info.d.ts","sourceRoot":"","sources":["../../../src/lib/mcp/build-info.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,eAAO,MAAM,cAAc,QAAqB,CAAC;AAEjD,eAAO,MAAM,YAAY,eAAe,CAAC;AAEzC,eAAO,MAAM,yBAAyB,eAAe,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Build-time constants for the MCP server.
|
|
3
|
-
*/
|
|
4
|
-
import { getSddCliVersion } from "../package-version.js";
|
|
5
|
-
// Sourced from package.json at module load via getSddCliVersion() (the engine version) so
|
|
6
|
-
// the MCP server identity cannot drift from the published version.
|
|
7
|
-
export const SERVER_VERSION = getSddCliVersion();
|
|
8
|
-
export const DISTRIBUTION = "sdd-method";
|
|
9
|
-
export const MCP_PROTOCOL_SPEC_VERSION = "2025-06-18";
|
|
10
|
-
//# sourceMappingURL=build-info.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-info.js","sourceRoot":"","sources":["../../../src/lib/mcp/build-info.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,0FAA0F;AAC1F,mEAAmE;AACnE,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,EAAE,CAAC;AAEjD,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CAAC;AAEzC,MAAM,CAAC,MAAM,yBAAyB,GAAG,YAAY,CAAC"}
|
package/dist/lib/mcp/errors.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/lib/mcp/errors.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,49 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,CAAC,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAErE,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,MAAM,cAAc,GAClB,6DAA6D,CAAC;IAChE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QACrC,IAAI,CAAC,CAAC;YAAE,SAAS;QACjB,MAAM,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;QACzB,IAAI,GAAG,IAAI,KAAK,EAAE,CAAC;YACjB,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QACjC,CAAC;IACH,CAAC;IAED,MAAM,MAAM,GAAyB,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;IACpD,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,IAAI,IAAI;QAAE,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;IAC7B,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC7B,IAAI,MAAM;QAAE,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;IACnC,MAAM,QAAQ,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC;IACjC,IAAI,QAAQ;QAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACzC,MAAM,YAAY,GAAG,GAAG,CAAC,eAAe,CAAC,CAAC;IAC1C,IAAI,YAAY;QAAE,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;IACrD,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC;IAC3B,IAAI,KAAK;QAAE,MAAM,CAAC,KAAK,GAAG,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"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* YAML reader for orchestration/gate-registry/<gate>-scores.yaml.
|
|
3
|
-
*
|
|
4
|
-
* Registry shape: header fields (schema_version, description, pass_threshold,
|
|
5
|
-
* and the reverse family's registry_type / assessed_at / assessed_by) plus ONE
|
|
6
|
-
* container key holding the per-artefact entries. The container key is not a
|
|
7
|
-
* stable name — it drifts between the method template and live estate data,
|
|
8
|
-
* and is not unique across rubrics — so it is unwrapped rather than trusted.
|
|
9
|
-
*
|
|
10
|
-
* Three defects were found here by the M-ADR 0205 Phase-B survey (2026-08-06)
|
|
11
|
-
* and fixed together, since all three are the same mistake in different
|
|
12
|
-
* places: assuming the registry population looks like the reader's model of it.
|
|
13
|
-
*
|
|
14
|
-
* - `listGates` hard-coded ten names, so gate discovery was silently blind
|
|
15
|
-
* to nine of the nineteen rubric families now in existence (five newer
|
|
16
|
-
* method-side registries and four reverse-only ones). An unlisted gate
|
|
17
|
-
* read as absent. It now enumerates the directory.
|
|
18
|
-
* - `entries` returned the CONTAINER, not the artefacts, so the summary in
|
|
19
|
-
* `resources/gates.ts` reported `total: 1` for a registry holding 99
|
|
20
|
-
* scored ADRs — while its own description advertised "per-artefact
|
|
21
|
-
* entries". It now unwraps the single container.
|
|
22
|
-
* - `parseYaml` ran unguarded, so a malformed registry threw a raw
|
|
23
|
-
* YAMLParseError through two surfaces that otherwise honour the
|
|
24
|
-
* McpEnvelopeError contract. Measured: three of one estate's ten
|
|
25
|
-
* registries are unparseable. It now reports `parseError` and returns an
|
|
26
|
-
* empty-but-well-formed registry, leaving each caller to decide how to
|
|
27
|
-
* surface it — the reader's job is to report, not to throw.
|
|
28
|
-
*/
|
|
29
|
-
export interface GateRegistry {
|
|
30
|
-
readonly gate: string;
|
|
31
|
-
readonly path: string;
|
|
32
|
-
readonly schemaVersion: string | null;
|
|
33
|
-
readonly description: string | null;
|
|
34
|
-
readonly passThreshold: unknown;
|
|
35
|
-
/** Per-artefact entries, unwrapped from the container key. */
|
|
36
|
-
readonly entries: Record<string, unknown>;
|
|
37
|
-
/** The container key the entries came from, when there was exactly one. */
|
|
38
|
-
readonly entryContainer: string | null;
|
|
39
|
-
/**
|
|
40
|
-
* Parser message when the registry is malformed. Non-null means `entries` is
|
|
41
|
-
* empty because the file could not be read — NOT because nothing is scored.
|
|
42
|
-
* A caller that conflates the two reports an empty gate as a clean one.
|
|
43
|
-
*/
|
|
44
|
-
readonly parseError: string | null;
|
|
45
|
-
}
|
|
46
|
-
export declare function gateRegistryPath(sddRoot: string, gate: string): string;
|
|
47
|
-
/**
|
|
48
|
-
* Every gate this SDD actually carries, by enumeration — never a fixed list.
|
|
49
|
-
* A registry is any `<gate>-scores.yaml` in the gate-registry directory, so a
|
|
50
|
-
* newly-shipped rubric is discoverable the moment its registry exists.
|
|
51
|
-
*/
|
|
52
|
-
export declare function listGates(sddRoot: string): string[];
|
|
53
|
-
export declare function readGateRegistry(sddRoot: string, gate: string): GateRegistry | undefined;
|
|
54
|
-
export interface GateSummary {
|
|
55
|
-
readonly total: number;
|
|
56
|
-
readonly pass: number;
|
|
57
|
-
readonly conditional: number;
|
|
58
|
-
readonly fail: number;
|
|
59
|
-
readonly unscored: number;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Verdict tally over unwrapped entries. ONE implementation, deliberately: this
|
|
63
|
-
* existed identically in both MCP consumers, and a duplicated counter is a
|
|
64
|
-
* drift surface that only shows up as two surfaces disagreeing about the same
|
|
65
|
-
* registry.
|
|
66
|
-
*
|
|
67
|
-
* Reads BOTH authored dialects. The gate sits at `entry.current.gate` in the
|
|
68
|
-
* nested shape all fifteen method templates specify, and at `entry.gate` in
|
|
69
|
-
* the flat shape the live estate data overwhelmingly uses. Reading only the
|
|
70
|
-
* flat one reports every nested entry as `unscored` — a confident false zero
|
|
71
|
-
* of exactly the kind this arc keeps paying for.
|
|
72
|
-
*
|
|
73
|
-
* An out-of-vocabulary verdict counts as `unscored` rather than being dropped,
|
|
74
|
-
* so `pass + conditional + fail + unscored === total` always holds and the
|
|
75
|
-
* tally can never quietly lose a row.
|
|
76
|
-
*/
|
|
77
|
-
export declare function summariseGateEntries(entries: Record<string, unknown>): GateSummary;
|
|
78
|
-
//# sourceMappingURL=gate-registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gate-registry.d.ts","sourceRoot":"","sources":["../../../../src/lib/mcp/parse/gate-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAiBH,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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