@hexagen-monaco/sync 0.13.0 → 0.15.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/README.md +379 -16
- package/dist/application/use-cases/stamp-generator-identity.use-case.d.ts +12 -0
- package/dist/application/use-cases/stamp-generator-identity.use-case.d.ts.map +1 -0
- package/dist/cli.js +4500 -1814
- package/dist/cli.js.map +1 -1
- package/dist/commands/arch/validate-outcome.d.ts +30 -0
- package/dist/commands/arch/validate-outcome.d.ts.map +1 -0
- package/dist/commands/arch/validate.d.ts +3 -1
- package/dist/commands/arch/validate.d.ts.map +1 -1
- package/dist/commands/bootstrap/index.d.ts.map +1 -1
- package/dist/commands/contract/evaluate.d.ts +54 -0
- package/dist/commands/contract/evaluate.d.ts.map +1 -1
- package/dist/commands/contract/growth.d.ts +22 -0
- package/dist/commands/contract/growth.d.ts.map +1 -0
- package/dist/commands/contract/index.d.ts +11 -3
- package/dist/commands/contract/index.d.ts.map +1 -1
- package/dist/commands/evidence/check.d.ts +2 -0
- package/dist/commands/evidence/check.d.ts.map +1 -1
- package/dist/commands/evidence/index.d.ts.map +1 -1
- package/dist/commands/evidence/pack.d.ts.map +1 -1
- package/dist/commands/evidence/verify.d.ts +83 -0
- package/dist/commands/evidence/verify.d.ts.map +1 -0
- package/dist/commands/grant/issue.d.ts.map +1 -1
- package/dist/commands/grant/list.d.ts +72 -0
- package/dist/commands/grant/list.d.ts.map +1 -0
- package/dist/commands/grant/verify.d.ts +7 -1
- package/dist/commands/grant/verify.d.ts.map +1 -1
- package/dist/commands/manifest/migrate.d.ts +8 -0
- package/dist/commands/manifest/migrate.d.ts.map +1 -1
- package/dist/commands/remove/index.d.ts +41 -0
- package/dist/commands/remove/index.d.ts.map +1 -0
- package/dist/commands/report/exec-git.d.ts.map +1 -1
- package/dist/commands/shared/brownfield-sidecar.d.ts +30 -0
- package/dist/commands/shared/brownfield-sidecar.d.ts.map +1 -1
- package/dist/commands/shared/confirm.d.ts.map +1 -1
- package/dist/commands/shared/grant-enumerator.d.ts +32 -0
- package/dist/commands/shared/grant-enumerator.d.ts.map +1 -0
- package/dist/commands/sync/check-json.d.ts +47 -0
- package/dist/commands/sync/check-json.d.ts.map +1 -0
- package/dist/commands/workbook/export.d.ts.map +1 -1
- package/dist/generators/architecture-files.d.ts.map +1 -1
- package/dist/generators/root-file-templates.d.ts +2 -2
- package/dist/generators/root-file-templates.d.ts.map +1 -1
- package/dist/generators/root-files.d.ts.map +1 -1
- package/dist/index.js +450 -421
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/config/index.d.ts +3 -0
- package/dist/infrastructure/config/index.d.ts.map +1 -0
- package/dist/infrastructure/index.d.ts +1 -0
- package/dist/infrastructure/index.d.ts.map +1 -1
- package/dist/types/manifest/generator.d.ts +2 -0
- package/dist/types/manifest/generator.d.ts.map +1 -1
- package/dist/types/manifest/monorepo.d.ts +1 -0
- package/dist/types/manifest/monorepo.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const ARCH_VALIDATE_JSON_SCHEMA_VERSION = 1;
|
|
2
|
+
export type ArchValidateStatus = "compliant" | "violations" | "could-not-run";
|
|
3
|
+
export interface LintCounts {
|
|
4
|
+
fresh: number;
|
|
5
|
+
expired: number;
|
|
6
|
+
baselineGrowth: number;
|
|
7
|
+
filesScanned: number | null;
|
|
8
|
+
}
|
|
9
|
+
export interface ArchValidateOutcome {
|
|
10
|
+
status: ArchValidateStatus;
|
|
11
|
+
exitCode: 0 | 1 | 2;
|
|
12
|
+
counts: LintCounts | null;
|
|
13
|
+
reason: string | null;
|
|
14
|
+
}
|
|
15
|
+
/** Last stdout line that starts with "{", parsed. null when absent, unparseable, not an object, or missing any of the three arrays. */
|
|
16
|
+
export declare function parseLintJsonLine(stdout: string): LintCounts | null;
|
|
17
|
+
/**
|
|
18
|
+
* linterExit: the child's numeric exit code, or null when it did not exit on its own
|
|
19
|
+
* (timeout or signal). json: whether `--json` was passed to the linter.
|
|
20
|
+
*/
|
|
21
|
+
export declare function classifyLintRun(linterExit: number | null, stdout: string, json: boolean): ArchValidateOutcome;
|
|
22
|
+
export declare function linterNotFoundOutcome(): ArchValidateOutcome;
|
|
23
|
+
/**
|
|
24
|
+
* No `.architecture/manifest.yaml` is reachable from `cwd`. getProjectRoot()
|
|
25
|
+
* would process.exit(1) here, with no JSON line in --json mode; the consumer
|
|
26
|
+
* contract needs could-not-run/2 through the normal emission paths.
|
|
27
|
+
*/
|
|
28
|
+
export declare function noManifestOutcome(cwd: string): ArchValidateOutcome;
|
|
29
|
+
export declare function toArchValidateJson(outcome: ArchValidateOutcome): string;
|
|
30
|
+
//# sourceMappingURL=validate-outcome.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-outcome.d.ts","sourceRoot":"","sources":["../../../src/commands/arch/validate-outcome.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iCAAiC,IAAI,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,YAAY,GAAG,eAAe,CAAC;AAE9E,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,uIAAuI;AACvI,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CA+CnE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,GACZ,mBAAmB,CAkDrB;AAED,wBAAgB,qBAAqB,IAAI,mBAAmB,CAO3D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAOlE;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAYvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/commands/arch/validate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/commands/arch/validate.ts"],"names":[],"mappings":"AAiBA,wBAAsB,eAAe,CACnC,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/B,OAAO,CAAC,IAAI,CAAC,CA8Ef"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/bootstrap/index.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/bootstrap/index.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAU9D,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,E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AM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BhB;AAED,eAAO,MAAM,kBAAkB,SA0B5B,CAAC"}
|
|
@@ -26,6 +26,9 @@ export declare function unreadLanguageSpecifier(ext: string): string;
|
|
|
26
26
|
* `allow-only`: an edge from the `from` prefix to anywhere that is neither
|
|
27
27
|
* the `to` prefix nor the `from` prefix itself (same-prefix imports are
|
|
28
28
|
* allowed).
|
|
29
|
+
* `closed`: the slice is the rule's `from` side, so an edge from anywhere in
|
|
30
|
+
* the slice to a target that is neither inside the slice nor under one of the
|
|
31
|
+
* rule's `except` prefixes (an exclude still wins over an except).
|
|
29
32
|
*/
|
|
30
33
|
export declare function evaluateContract(input: {
|
|
31
34
|
slice: Slice;
|
|
@@ -42,4 +45,55 @@ export declare function proposeCrossPrefixEdges(slice: Slice, observed: Observed
|
|
|
42
45
|
count: number;
|
|
43
46
|
example: string;
|
|
44
47
|
}[];
|
|
48
|
+
export interface ClosedProposal {
|
|
49
|
+
/** Except entries, in the order `observed.json` lists them. */
|
|
50
|
+
excepts: string[];
|
|
51
|
+
/** Crossings that get no entry, each with the advice that would accept it. */
|
|
52
|
+
notProposed: {
|
|
53
|
+
to: string;
|
|
54
|
+
advice: string;
|
|
55
|
+
}[];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The `except` list a `closed` rule would need to accept the crossings the
|
|
59
|
+
* observed edges already make: every edge target that leaves the slice, emitted
|
|
60
|
+
* exactly as `slice check` prints it, deduplicated.
|
|
61
|
+
*
|
|
62
|
+
* A target is never turned into a directory. `observed.json` types `to` as a
|
|
63
|
+
* slice path, so a hand-edited report may spell a package root as a directory
|
|
64
|
+
* (`outside/pkg/`); emitting that verbatim gives an except entry which accepts
|
|
65
|
+
* every edge under it, and dropping the slash gives an exact entry which does
|
|
66
|
+
* not match the target at all (`underPrefix` compares equality without a
|
|
67
|
+
* trailing `/`). Neither names the one crossing that was observed, so such a
|
|
68
|
+
* target is reported with the flag that would accept it instead.
|
|
69
|
+
*
|
|
70
|
+
* A crossing no `except` can accept is reported the same way, because a rule
|
|
71
|
+
* naming one would still fail: `.` is never inside a prefix, and an `excludes`
|
|
72
|
+
* entry beats any except.
|
|
73
|
+
*/
|
|
74
|
+
export declare function proposeClosedExcepts(slice: Slice, observed: ObservedReport): ClosedProposal;
|
|
75
|
+
/**
|
|
76
|
+
* The warning a `closed` rule earns when ITS OWN `except` list covers every
|
|
77
|
+
* observed package outside the slice: that rule then accepts every crossing it
|
|
78
|
+
* could have refused, so the slice is not closed.
|
|
79
|
+
*
|
|
80
|
+
* One rule, never a pool. Rules are ANDed (`edgeViolatesRule` answers one
|
|
81
|
+
* boolean per rule, and `evaluateContract` raises a violation for each rule an
|
|
82
|
+
* edge breaks), so an edge has to pass every one of them. Two rules that between
|
|
83
|
+
* them cover the whole repo leave each edge with one rule still to fail, which
|
|
84
|
+
* is exactly what a closed slice wants; pooling their lists would warn about a
|
|
85
|
+
* slice that is still shut.
|
|
86
|
+
*
|
|
87
|
+
* Coverage is asked per package root, and it means the root lies UNDER an entry:
|
|
88
|
+
* `--except apps/` covers `apps/web` and `apps/admin`, while `--except apps/web/ui/`
|
|
89
|
+
* covers neither the rest of its own package nor any sibling. An entry without a
|
|
90
|
+
* trailing `/` is an exact file (`underPrefix`), so a bare name covers nothing
|
|
91
|
+
* below it.
|
|
92
|
+
*
|
|
93
|
+
* A package the slice occupies, and one an `excludes` entry denies, are not
|
|
94
|
+
* units to cover: an except opens neither, so no crossing through them could be
|
|
95
|
+
* accepted either. The root package (`.`) is the repo, not a package an except
|
|
96
|
+
* can name.
|
|
97
|
+
*/
|
|
98
|
+
export declare function closedRuleCoverageWarning(slice: Slice, observed: ObservedReport, rules: readonly Contract["rules"][number][]): string | null;
|
|
45
99
|
//# sourceMappingURL=evaluate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../../../src/commands/contract/evaluate.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../../../src/commands/contract/evaluate.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,KAAK,EACX,MAAM,iBAAiB,CAAC;AAIzB,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB;;;;OAIG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,iEAAiE;AACjE,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,QAAQ,EAAE,cAAc,CAAC;IACzB,4DAA4D;IAC5D,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1B,GAAG,UAAU,CAyDb;AAGD,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAEhE,wEAAwE;AACxE,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,cAAc,GACvB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,CAuBhE;AAED,MAAM,WAAW,cAAc;IAC7B,+DAA+D;IAC/D,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,8EAA8E;IAC9E,WAAW,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,cAAc,GACvB,cAAc,CA8BhB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,cAAc,EACxB,KAAK,EAAE,SAAS,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,EAAE,GAC1C,MAAM,GAAG,IAAI,CAef"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Contract, Slice } from "@hexagen/shared";
|
|
2
|
+
export interface ContractBase {
|
|
3
|
+
/** The commit `<ref>` resolved to — the hash the files were read at. */
|
|
4
|
+
hash: string;
|
|
5
|
+
contract: Contract;
|
|
6
|
+
slice: Slice;
|
|
7
|
+
}
|
|
8
|
+
/** The part of `GitReader` the guard needs, so a caller can supply its own. */
|
|
9
|
+
export interface BaseFileReader {
|
|
10
|
+
show(hash: string, relativePath: string): string | null;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The contract and the slice as committed at `ref`.
|
|
14
|
+
*
|
|
15
|
+
* Bad input throws `UsageError` (exit 2), never a pass: an unresolvable ref
|
|
16
|
+
* (a shallow CI clone that never fetched the base) and a sidecar file that was
|
|
17
|
+
* never staged are both "the guard cannot tell", and a guard that cannot tell
|
|
18
|
+
* must fail closed. `GitReader.show` returns `null` for both causes, so the ref
|
|
19
|
+
* is resolved FIRST and the two cannot be confused.
|
|
20
|
+
*/
|
|
21
|
+
export declare function readContractBase(root: string, ref: string, reader?: BaseFileReader): ContractBase;
|
|
22
|
+
//# sourceMappingURL=growth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"growth.d.ts","sourceRoot":"","sources":["../../../src/commands/contract/growth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAgBlD,MAAM,WAAW,YAAY;IAC3B,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;CACd;AAED,+EAA+E;AAC/E,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CACzD;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,cAAsC,GAC7C,YAAY,CAmBd"}
|
|
@@ -3,11 +3,15 @@ import { type CommandResult } from "../shared/brownfield-sidecar.js";
|
|
|
3
3
|
import { type SliceRootOptions } from "../slice/index.js";
|
|
4
4
|
export declare function runContractPropose(options: SliceRootOptions & {
|
|
5
5
|
strict?: boolean;
|
|
6
|
+
closed?: boolean;
|
|
6
7
|
}): Promise<CommandResult>;
|
|
7
8
|
export interface AddRuleOptions extends SliceRootOptions {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/** `closed` takes `except` and no `from`/`to`; the prefix kinds the reverse. */
|
|
10
|
+
kind: "forbid" | "allow-only" | "closed";
|
|
11
|
+
from?: string;
|
|
12
|
+
to?: string;
|
|
13
|
+
/** The accepted crossings of a `closed` rule. `undefined` when the flag was not given, `[]` when it was given with no prefixes. */
|
|
14
|
+
except?: string[];
|
|
11
15
|
severity?: "error" | "warn";
|
|
12
16
|
id?: string;
|
|
13
17
|
yes?: boolean;
|
|
@@ -16,6 +20,10 @@ export declare function runContractAddRule(options: AddRuleOptions): Promise<Com
|
|
|
16
20
|
export declare function runContractShow(options: SliceRootOptions): Promise<CommandResult>;
|
|
17
21
|
export interface ContractCheckOptions extends SliceRootOptions {
|
|
18
22
|
baseline?: boolean;
|
|
23
|
+
/** Git ref holding the contract and slice this check is compared against. */
|
|
24
|
+
base?: string;
|
|
25
|
+
allowGrowth?: boolean;
|
|
26
|
+
reason?: string;
|
|
19
27
|
yes?: boolean;
|
|
20
28
|
strict?: boolean;
|
|
21
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/contract/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/contract/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBpC,OAAO,EAUL,KAAK,aAAa,EACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAoD1D,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,gBAAgB,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GACjE,OAAO,CAAC,aAAa,CAAC,CAqDxB;AAED,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACtD,gFAAgF;IAChF,IAAI,EAAE,QAAQ,GAAG,YAAY,GAAG,QAAQ,CAAC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,mIAAmI;IACnI,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAgFD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,aAAa,CAAC,CAExB;AA6DD,wBAAsB,eAAe,CACnC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,aAAa,CAAC,CAkBxB;AAuBD,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6EAA6E;IAC7E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AA0BD,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,aAAa,CAAC,CAWxB;AAqKD,eAAO,MAAM,iBAAiB,SAE7B,CAAC"}
|
|
@@ -23,6 +23,8 @@ export interface LineVerdict {
|
|
|
23
23
|
readonly time?: string;
|
|
24
24
|
readonly reason?: string;
|
|
25
25
|
}
|
|
26
|
+
/** One verdict as a reader reports it: its position and every reason. */
|
|
27
|
+
export declare function describeVerdict(v: LineVerdict): string;
|
|
26
28
|
/**
|
|
27
29
|
* One verdict per line, in file order. `grants` holds only grants whose
|
|
28
30
|
* signature verified, so a line citing a forged grant fails Rule 3.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/commands/evidence/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,SAAS,EACf,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAEL,KAAK,KAAK,EAEX,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;GAOG;AAEH,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzD,MAAM,WAAW,WAAW;IAC1B,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,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,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAqDD,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,CAAC,EAAE,WAAW,GAAG,MAAM,CAGtD;AAiDD;;;GAGG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,GACjC,WAAW,EAAE,CAoEf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/evidence/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/evidence/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,eAAO,MAAM,iBAAiB,SAE7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack.d.ts","sourceRoot":"","sources":["../../../src/commands/evidence/pack.ts"],"names":[],"mappings":"AA4BA,OAAO,
|
|
1
|
+
{"version":3,"file":"pack.d.ts","sourceRoot":"","sources":["../../../src/commands/evidence/pack.ts"],"names":[],"mappings":"AA4BA,OAAO,EAA+B,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAE3E,MAAM,WAAW,mBAAmB;IAClC,gEAAgE;IAChE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,GAAG,CAA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
|
|
4
|
+
readonly root: string;
|
|
5
|
+
/** Any git ref; only lines appended after it can cover anything. */
|
|
6
|
+
readonly since: string;
|
|
7
|
+
/** Upper end of the range. Defaults to `HEAD`. */
|
|
8
|
+
readonly until?: string;
|
|
9
|
+
/** Grant file(s) the trace's lines may cite, and whose paths widen scope. */
|
|
10
|
+
readonly grantFiles: readonly string[];
|
|
11
|
+
readonly keyFile?: string;
|
|
12
|
+
readonly engagement?: string;
|
|
13
|
+
/** Treat an empty diff as a pass instead of a precondition failure. */
|
|
14
|
+
readonly allowEmpty?: boolean;
|
|
15
|
+
readonly env?: Readonly<Record<string, string | undefined>>;
|
|
16
|
+
/** Test seam; defaults to `os.homedir()`. */
|
|
17
|
+
readonly homeDir?: string;
|
|
18
|
+
}
|
|
19
|
+
/** One changed file no anchored line covers, with the nearest line that does. */
|
|
20
|
+
export interface UnaccountedFile {
|
|
21
|
+
readonly path: string;
|
|
22
|
+
/**
|
|
23
|
+
* Lines that would cover `path` but that no `evidence pack` has anchored.
|
|
24
|
+
* Always present, and empty when no such line exists — an empty list means
|
|
25
|
+
* nothing was written at all, a non-empty one means the cover exists on paper
|
|
26
|
+
* only.
|
|
27
|
+
*/
|
|
28
|
+
readonly unanchoredCover: readonly number[];
|
|
29
|
+
readonly nearestSeq?: number;
|
|
30
|
+
readonly nearestGrantId?: string;
|
|
31
|
+
readonly nearestPaths?: readonly string[];
|
|
32
|
+
}
|
|
33
|
+
export interface EvidenceVerifyResult {
|
|
34
|
+
/** 0 nothing unaccounted; 1 a change has no line; 2 bad input or bad state. */
|
|
35
|
+
readonly exitCode: 0 | 1 | 2;
|
|
36
|
+
/** Status lines, printed to stderr. */
|
|
37
|
+
readonly messages: readonly string[];
|
|
38
|
+
/** The unaccounted paths, one per line, printed to stdout. */
|
|
39
|
+
readonly stdout?: string;
|
|
40
|
+
readonly unaccounted?: readonly UnaccountedFile[];
|
|
41
|
+
/** The kept paths that a candidate line does cover. */
|
|
42
|
+
readonly covered?: readonly string[];
|
|
43
|
+
/** Raw changed paths outside the slice and every supplied grant. */
|
|
44
|
+
readonly skipped?: number;
|
|
45
|
+
/** Lines appended after `--since` that are valid completed evidence. */
|
|
46
|
+
readonly candidateLines?: number;
|
|
47
|
+
}
|
|
48
|
+
/** A joined line: the valid evidence line and the proposal that claims it. */
|
|
49
|
+
export interface CandidateLine {
|
|
50
|
+
readonly seq: number;
|
|
51
|
+
readonly grantId: string;
|
|
52
|
+
/** The proposal's paths, in the order the writer recorded them. */
|
|
53
|
+
readonly paths: readonly string[];
|
|
54
|
+
/** `result_digest` recomputed from the joined proposal. */
|
|
55
|
+
readonly digest: string;
|
|
56
|
+
/** The line's calls as written; the covering one names the paths. */
|
|
57
|
+
readonly calls: readonly {
|
|
58
|
+
readonly result_digest: string;
|
|
59
|
+
readonly time: string;
|
|
60
|
+
}[];
|
|
61
|
+
/**
|
|
62
|
+
* A key-holder's `evidence pack` anchored this line (`seq <= tip.seq` with the
|
|
63
|
+
* tip's HMAC verified). An unanchored line covers nothing.
|
|
64
|
+
*/
|
|
65
|
+
readonly anchored: boolean;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Whether `candidate` covers `file`. Three things must hold, and the path and
|
|
69
|
+
* the time always come from the same record:
|
|
70
|
+
*
|
|
71
|
+
* 1. the joined proposal names `file`, exactly as the writer recorded it (both
|
|
72
|
+
* sides NFC-normalised, so a tree that spells a name in NFD and a proposal
|
|
73
|
+
* that spells it in NFC still name one file);
|
|
74
|
+
* 2. `file` sits inside *that* line's grant's paths — coverage is scoped to one
|
|
75
|
+
* grant, so a file another supplied grant allows is not covered here;
|
|
76
|
+
* 3. one of the line's calls carries the proposal's recomputed digest and sits
|
|
77
|
+
* inside that grant's window at its own time (`checkGrantWindow`, the same
|
|
78
|
+
* function the accept path and `grant check` call). A call that names the
|
|
79
|
+
* paths out of window does not cover them.
|
|
80
|
+
*/
|
|
81
|
+
export declare function coveringLine(candidate: CandidateLine, grant: Grant, file: string): boolean;
|
|
82
|
+
export declare function runEvidenceVerify(options: EvidenceVerifyOptions): Promise<EvidenceVerifyResult>;
|
|
83
|
+
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/commands/evidence/verify.ts"],"names":[],"mappings":"AAEA,OAAO,EAOL,KAAK,KAAK,EACX,MAAM,iBAAiB,CAAC;AAwEzB,MAAM,WAAW,qBAAqB;IACpC,gEAAgE;IAChE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,kDAAkD;IAClD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,6EAA6E;IAC7E,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,uEAAuE;IACvE,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IAC5D,6CAA6C;IAC7C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,iFAAiF;AACjF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3C;AAED,MAAM,WAA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
|
|
|
1
|
-
{"version":3,"file":"issue.d.ts","sourceRoot":"","sources":["../../../src/commands/grant/issue.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"issue.d.ts","sourceRoot":"","sources":["../../../src/commands/grant/issue.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkDpC,UAAU,YAAY;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAQD,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAsV5E;AAED,eAAO,MAAM,cAAc,SAE1B,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
/**
|
|
3
|
+
* `hexagen grant list`: a read-only listing of `.hexagen/grants/`, so an FDE can
|
|
4
|
+
* see every grant, whether each is live, expired or revoked, and which one
|
|
5
|
+
* verifies, without opening JSON by hand (plan 4, lane 4B).
|
|
6
|
+
*
|
|
7
|
+
* Three rules the listing is built on:
|
|
8
|
+
*
|
|
9
|
+
* - The window is never recomputed here. A row's status comes from
|
|
10
|
+
* `checkGrantWindow` (the same call `grant show` and `grant check` make), and
|
|
11
|
+
* its signature verdict from `verifyGrantSignature` (the same two the
|
|
12
|
+
* workbook export uses), so a listing cannot disagree with enforcement.
|
|
13
|
+
* - Every entry in the directory becomes a row, including every refusal the
|
|
14
|
+
* shared enumerator returns and every error one raises. That is the one
|
|
15
|
+
* deliberate difference from `workbook export`, which fails the whole call
|
|
16
|
+
* instead: a listing is diagnostic, and one unreadable grant must not hide
|
|
17
|
+
* the others.
|
|
18
|
+
* - A symlink is classified from its own `lstat` and never read, so it prints
|
|
19
|
+
* as `invalid: symlink` rather than as the enumerator's refusal wording.
|
|
20
|
+
* `readAllowed` still runs its own lstat and its `O_NOFOLLOW` read below that
|
|
21
|
+
* point; this is a reason, not a second read guard.
|
|
22
|
+
*
|
|
23
|
+
* It reads only. It prints the key's path and fingerprint, never the key.
|
|
24
|
+
*/
|
|
25
|
+
/** The statuses a row can carry, and the filters `--status` accepts. */
|
|
26
|
+
export declare const GRANT_LIST_STATUSES: readonly ["live", "expired", "revoked", "invalid", "all"];
|
|
27
|
+
export type GrantListFilter = (typeof GRANT_LIST_STATUSES)[number];
|
|
28
|
+
/** What a row's status column says: `--status all` matches every one of them. */
|
|
29
|
+
export type GrantRowStatus = Exclude<GrantListFilter, "all">;
|
|
30
|
+
export interface GrantListRow {
|
|
31
|
+
/** Path relative to `.hexagen/` (forward slashes). */
|
|
32
|
+
readonly file: string;
|
|
33
|
+
readonly id?: string;
|
|
34
|
+
readonly principal?: string;
|
|
35
|
+
readonly agent?: string;
|
|
36
|
+
readonly mode?: string;
|
|
37
|
+
readonly expires_at?: string;
|
|
38
|
+
readonly revoked_at?: string;
|
|
39
|
+
readonly status: GrantRowStatus;
|
|
40
|
+
readonly signature: "verified" | "not verified" | "invalid";
|
|
41
|
+
/** Why the signature failed, or why the row is invalid. Never key material. */
|
|
42
|
+
readonly reason?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface GrantListOptions {
|
|
45
|
+
/** A `GRANT_LIST_STATUSES` member; anything else is bad input. */
|
|
46
|
+
status?: string;
|
|
47
|
+
json?: boolean;
|
|
48
|
+
workspaceRoot?: string;
|
|
49
|
+
keyFile?: string;
|
|
50
|
+
engagement?: string;
|
|
51
|
+
/** Test seams. */
|
|
52
|
+
homeDir?: string;
|
|
53
|
+
env?: Readonly<Record<string, string | undefined>>;
|
|
54
|
+
now?: Date;
|
|
55
|
+
/**
|
|
56
|
+
* Test seam: runs inside every guarded read, after the enumerator's checks
|
|
57
|
+
* and before the bytes are read (the hook `openSidecar` already takes).
|
|
58
|
+
*/
|
|
59
|
+
afterValidate?: (file: string) => Promise<void>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The row an entry that raised instead of returning gets. `readAllowed` refuses
|
|
63
|
+
* the cases it knows about and its wording is kept verbatim. Anything else it
|
|
64
|
+
* raises is an fs error (ENOENT when an entry vanishes between its lstat and its
|
|
65
|
+
* realpath, EACCES, ELOOP, ENOTDIR) or a parse verdict that escaped: all of them
|
|
66
|
+
* are the same kind of finding about the same file, so they become the same kind
|
|
67
|
+
* of row rather than stopping the listing and hiding every other grant.
|
|
68
|
+
*/
|
|
69
|
+
export declare function unreadableRow(file: string, error: unknown): GrantListRow;
|
|
70
|
+
export declare function grantListCommand(options: GrantListOptions): Promise<void>;
|
|
71
|
+
export declare const grantListCommander: Command;
|
|
72
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/grant/list.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBpC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,wEAAwE;AACxE,eAAO,MAAM,mBAAmB,2DAMtB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnE,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AAE,OAAO,GAAG,YAAY,CAWxE;AAuHD,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CAmHf;AAED,eAAO,MAAM,kBAAkB,SAE9B,CAAC"}
|
|
@@ -40,6 +40,12 @@ export declare function resolveVerifyKey(ctx: VerifyContext): ResolvedGrantKey;
|
|
|
40
40
|
* a missing or weak key, or a mismatch. When the operator overrode the key
|
|
41
41
|
* (`--key-file` / `--engagement`) and it fails, the message also names the key
|
|
42
42
|
* the MCP server would use without the override, with both fingerprints.
|
|
43
|
+
*
|
|
44
|
+
* `resolved` is the key already resolved from this same `ctx` — `hexagen grant
|
|
45
|
+
* list` resolves once for the whole listing instead of once per row. Callers
|
|
46
|
+
* that omit it are unaffected. It changes nothing about what is trusted: the
|
|
47
|
+
* key is still read and checked on every call (verify never caches key
|
|
48
|
+
* material), and only the resolution is skipped.
|
|
43
49
|
*/
|
|
44
|
-
export declare function verifyGrantSignature(grant: Grant, ctx: VerifyContext): GrantVerification;
|
|
50
|
+
export declare function verifyGrantSignature(grant: Grant, ctx: VerifyContext, resolved?: ResolvedGrantKey): GrantVerification;
|
|
45
51
|
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/commands/grant/verify.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,gCAAgC,CAAC;AAGxC,oHAAoH;AACpH,eAAO,MAAM,WAAW,2CASrB,CAAC;AAmBJ,MAAM,MAAM,WAAW,GACnB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAA;CAAE,GAC5C;IAAE,QAAQ,CA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back (with a backup, mirroring
|
|
5
5
|
* `manifest split`'s `.pre-split-backup`). All migration semantics — and
|
|
6
6
|
* their tests — live in the use-case.
|
|
7
|
+
*
|
|
8
|
+
* Since H1, it also stamps the generator identity marker (`generator.name`,
|
|
9
|
+
* see stamp-generator-identity.use-case.ts). For a split manifest the marker
|
|
10
|
+
* lives in the side-car named by `workspace_config` (whose `generator`, when
|
|
11
|
+
* present, replaces the root's), otherwise at the root. H1 review 2: both
|
|
12
|
+
* files are resolved to canonical paths inside `.architecture/` — and refused
|
|
13
|
+
* when they are not regular files or resolve elsewhere — before anything is
|
|
14
|
+
* read, backed up or written.
|
|
7
15
|
*/
|
|
8
16
|
import { Command } from "commander";
|
|
9
17
|
export declare const manifestMigrateCommander: Command;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../../src/commands/manifest/migrate.ts"],"names":[],"mappings":"AACA
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../../src/commands/manifest/migrate.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwbpC,eAAO,MAAM,wBAAwB,SAmCjC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { RemoveTemplateUseCase } from "@hexagen/template-engine";
|
|
2
|
+
import type { RemoveTemplateResult } from "@hexagen/template-engine";
|
|
3
|
+
/**
|
|
4
|
+
* `hexagen remove <template>` — the command shell and the testable core
|
|
5
|
+
* (proposal 2026-10-10, "The decided contract"). The core never calls
|
|
6
|
+
* `process.exit`, never reads `process.cwd()`, and prints everything
|
|
7
|
+
* through injected `log` / `error`; the use case owns every decision.
|
|
8
|
+
* Exit codes are 0 and 1 only — there is NO exit code 2.
|
|
9
|
+
*/
|
|
10
|
+
export interface RemoveCommandOptions {
|
|
11
|
+
/** Print the plan and change nothing. */
|
|
12
|
+
dryRun?: boolean;
|
|
13
|
+
/** Remove the registry entry only; delete no file. */
|
|
14
|
+
keepFiles?: boolean;
|
|
15
|
+
/** Skip the prompt and override the dependents / changed-file refusals. */
|
|
16
|
+
force?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface RemoveCommandDeps {
|
|
19
|
+
projectRoot: string;
|
|
20
|
+
useCase: Pick<RemoveTemplateUseCase, "execute">;
|
|
21
|
+
log: (line: string) => void;
|
|
22
|
+
error: (line: string) => void;
|
|
23
|
+
isInteractive: boolean;
|
|
24
|
+
confirm: (message: string) => Promise<boolean>;
|
|
25
|
+
/** Workspace package folders other than the registry root, when known. */
|
|
26
|
+
otherPackages?: string[];
|
|
27
|
+
}
|
|
28
|
+
type RemovalPlanAnswer = Extract<RemoveTemplateResult, {
|
|
29
|
+
kind: "dry-run";
|
|
30
|
+
}>;
|
|
31
|
+
type RemovalOutcomeAnswer = Extract<RemoveTemplateResult, {
|
|
32
|
+
kind: "removed";
|
|
33
|
+
}>;
|
|
34
|
+
/** The --dry-run plan, as lines. Only non-empty lists get a header. */
|
|
35
|
+
export declare function formatRemovalPlan(plan: RemovalPlanAnswer): string[];
|
|
36
|
+
/** The removal outcome, as lines. Only non-empty lists get a header. */
|
|
37
|
+
export declare function formatRemovalOutcome(result: RemovalOutcomeAnswer): string[];
|
|
38
|
+
export declare function runRemoveTemplate(templateId: string, options: RemoveCommandOptions, deps: RemoveCommandDeps): Promise<0 | 1>;
|
|
39
|
+
export declare function removeTemplateCommand(templateId: string, options?: RemoveCommandOptions): Promise<void>;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/remove/index.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,qBAAqB,EAEtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AASrE;;;;;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,IAAI,CAAC,CA+Bf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec-git.d.ts","sourceRoot":"","sources":["../../../src/commands/report/exec-git.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"exec-git.d.ts","sourceRoot":"","sources":["../../../src/commands/report/exec-git.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAmB5C,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CA6BhE"}
|
|
@@ -28,6 +28,36 @@ export declare function isAncestor(root: string, ancestor: string, descendant: s
|
|
|
28
28
|
export declare function headCommit(root: string): string | null;
|
|
29
29
|
/** Files changed between `commit` and HEAD, restricted to the pathspecs. */
|
|
30
30
|
export declare function changedSince(root: string, commit: string, pathspecs: readonly string[]): string[] | null;
|
|
31
|
+
/** One `git diff --name-status -M -z` record. */
|
|
32
|
+
export interface ChangedPath {
|
|
33
|
+
/** The record's status field: `A`, `M`, `D`, `R100`, `C075`, ... */
|
|
34
|
+
readonly status: string;
|
|
35
|
+
/** The new side: the only path for every status but a rename or copy. */
|
|
36
|
+
readonly path: string;
|
|
37
|
+
/** The old side of a rename or copy, which is a path that moved too. */
|
|
38
|
+
readonly oldPath?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Files changed in `from..to`, renames and copies expanded into both of their
|
|
42
|
+
* paths. The sibling of `changedSince`, not a replacement: that one answers
|
|
43
|
+
* "which files under these pathspecs changed" for `slice check` and keeps
|
|
44
|
+
* `--name-only`, while this one has to know which side of a rename moved —
|
|
45
|
+
* `--name-only` prints one name per side and loses the pairing. Both go through
|
|
46
|
+
* the module-private `gitZ`, so NUL splitting is written once.
|
|
47
|
+
*
|
|
48
|
+
* Both refs may be any rev; the caller resolves them. Null means git failed,
|
|
49
|
+
* which for a range ref is how a shallow clone that cannot reach `from` answers:
|
|
50
|
+
* never treat that as "nothing changed".
|
|
51
|
+
*/
|
|
52
|
+
export declare function changedPaths(root: string, from: string, to: string): ChangedPath[] | null;
|
|
53
|
+
/**
|
|
54
|
+
* The NUL-split fields of one `git diff --name-status -M -z` run, read as
|
|
55
|
+
* records. A truncated record — a status with no path, or a rename missing its
|
|
56
|
+
* second path — cannot be read honestly, and returning the records before the
|
|
57
|
+
* cut would judge a partial range as if it were the whole one. Null refuses the
|
|
58
|
+
* whole diff instead, so the caller cannot pass a range it only half read.
|
|
59
|
+
*/
|
|
60
|
+
export declare function parseChangedPaths(fields: readonly string[]): ChangedPath[] | null;
|
|
31
61
|
export declare const slicePath: (root: string) => string;
|
|
32
62
|
export declare const observedPath: (root: string) => string;
|
|
33
63
|
export declare const contractPath: (root: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brownfield-sidecar.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/brownfield-sidecar.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,QAAQ,EACR,cAAc,EACd,KAAK,EAEN,MAAM,iBAAiB,CAAC;AAMzB,8DAA8D;AAC9D,MAAM,WAAW,aAAa;IAC5B,gEAAgE;IAChE,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,2DAA2D;AAC3D,qBAAa,UAAW,SAAQ,KAAK;CAAG;AAExC,yFAAyF;AACzF,qBAAa,aAAc,SAAQ,UAAU;CAAG;AAEhD,gEAAgE;AAChE,wBAAgB,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,aAAa,CAWtE;AAED,eAAO,MAAM,aAAa,cAAc,CAAC;AAGzC,OAAO,EACL,eAAe,EACf,YAAY,EACZ,aAAa,EACb,WA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GACnB,OAAO,CAAC,CAAC,CAAC,CAwBZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/confirm.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"confirm.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/confirm.ts"],"names":[],"mappings":"AAmBA,wBAAsB,OAAO,CAC3B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GACnD,OAAO,CAAC,OAAO,CAAC,CAelB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type AllowedFile } from "../workbook/allow-list.js";
|
|
2
|
+
export declare class Refusal extends Error {
|
|
3
|
+
readonly exitCode: 1 | 2;
|
|
4
|
+
constructor(message: string, exitCode?: 1 | 2);
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* True when `target` is `base` itself or lies under it, compared as paths.
|
|
8
|
+
* Callers that must hold through a symlink pass real paths.
|
|
9
|
+
*/
|
|
10
|
+
export declare const inside: (base: string, target: string) => boolean;
|
|
11
|
+
export interface Sidecar {
|
|
12
|
+
readonly root: string;
|
|
13
|
+
readonly dir: string;
|
|
14
|
+
/** Real path of `<root>/.hexagen`. */
|
|
15
|
+
readonly real: string;
|
|
16
|
+
readonly homeKeys: string;
|
|
17
|
+
readonly afterValidate?: (file: string) => Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export declare function openSidecar(root: string, home: string, afterValidate?: (file: string) => Promise<void>): Promise<Sidecar>;
|
|
20
|
+
/**
|
|
21
|
+
* Reads one allow-listed file. The path must be a regular file (never a
|
|
22
|
+
* symlink), must resolve under the real sidecar, and never under the home keys
|
|
23
|
+
* directory. The forbidden pattern runs on the path as written and on the
|
|
24
|
+
* resolved path relative to the sidecar.
|
|
25
|
+
*/
|
|
26
|
+
export declare function readAllowed(sc: Sidecar, entry: AllowedFile): Promise<{
|
|
27
|
+
text: Buffer;
|
|
28
|
+
file: string;
|
|
29
|
+
}>;
|
|
30
|
+
/** Names in `<sidecar>/<sub>/`, sorted; empty when the directory is absent. */
|
|
31
|
+
export declare function listDir(sc: Sidecar, sub: string): Promise<string[]>;
|
|
32
|
+
//# sourceMappingURL=grant-enumerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grant-enumerator.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/grant-enumerator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAiB9E,qBAAa,OAAQ,SAAQ,KAAK;IAG9B,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC;gBADxB,OAAO,EAAE,MAAM,EACN,QAAQ,GAAE,CAAC,GAAG,CAAK;CAI/B;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,GAAI,MAAM,MAAM,EAAE,QAAQ,MAAM,KAAG,OAGrD,CAAC;AAEF,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1D;AAED,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAC9C,OAAO,CAAC,OAAO,CAAC,CAgBlB;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,EAAE,EAAE,OAAO,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