@hexagen-monaco/sync 0.13.0 → 0.14.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.
Files changed (34) hide show
  1. package/README.md +316 -16
  2. package/dist/cli.js +2039 -769
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/contract/evaluate.d.ts +54 -0
  5. package/dist/commands/contract/evaluate.d.ts.map +1 -1
  6. package/dist/commands/contract/growth.d.ts +22 -0
  7. package/dist/commands/contract/growth.d.ts.map +1 -0
  8. package/dist/commands/contract/index.d.ts +11 -3
  9. package/dist/commands/contract/index.d.ts.map +1 -1
  10. package/dist/commands/evidence/check.d.ts +2 -0
  11. package/dist/commands/evidence/check.d.ts.map +1 -1
  12. package/dist/commands/evidence/index.d.ts.map +1 -1
  13. package/dist/commands/evidence/pack.d.ts.map +1 -1
  14. package/dist/commands/evidence/verify.d.ts +83 -0
  15. package/dist/commands/evidence/verify.d.ts.map +1 -0
  16. package/dist/commands/grant/issue.d.ts.map +1 -1
  17. package/dist/commands/grant/list.d.ts +72 -0
  18. package/dist/commands/grant/list.d.ts.map +1 -0
  19. package/dist/commands/grant/verify.d.ts +7 -1
  20. package/dist/commands/grant/verify.d.ts.map +1 -1
  21. package/dist/commands/report/exec-git.d.ts.map +1 -1
  22. package/dist/commands/shared/brownfield-sidecar.d.ts +30 -0
  23. package/dist/commands/shared/brownfield-sidecar.d.ts.map +1 -1
  24. package/dist/commands/shared/grant-enumerator.d.ts +32 -0
  25. package/dist/commands/shared/grant-enumerator.d.ts.map +1 -0
  26. package/dist/commands/workbook/export.d.ts.map +1 -1
  27. package/dist/generators/root-file-templates.d.ts +2 -2
  28. package/dist/generators/root-file-templates.d.ts.map +1 -1
  29. package/dist/generators/root-files.d.ts.map +1 -1
  30. package/dist/index.js +22 -7
  31. package/dist/index.js.map +1 -1
  32. package/dist/types/manifest/monorepo.d.ts +1 -0
  33. package/dist/types/manifest/monorepo.d.ts.map +1 -1
  34. package/package.json +1 -1
@@ -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,EAKL,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;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EA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U,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
- kind: "forbid" | "allow-only";
9
- from: string;
10
- to: string;
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;AAepC,OAAO,EAUL,KAAK,aAAa,EACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAW1D,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,gBAAgB,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAC/C,OAAO,CAAC,aAAa,CAAC,CAiCxB;AAED,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACtD,IAAI,EAAE,QAAQ,GAAG,YAAY,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAkCD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,aAAa,CAAC,CAExB;AAyED,wBAAsB,eAAe,CACnC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,aAAa,CAAC,CAYxB;AAED,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,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;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,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,iDAAiD;IACjD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,C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S,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;AAGpC,eAAO,MAAM,iBAAiB,SAE7B,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,EAAc,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAE1D,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,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IAC5D,6CAA6C;IAC7C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,8DAA8D;IAC9D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,0DAA0D;IAC1D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 /** Repo root; `.hexagen/` lives here. Never searched upward. */
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,CAA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CAA6C;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"}
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,iFAAiF;AACjF,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;AAE7D,MAAM,WAAW,YAAY;IAC3B,sDAAsD;IACtD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,UAAU,GAAG,cAAc,GAAG,SAAS,CAAC;IAC5D,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IACnD,GAAG,CAAC,EAAE,IAAI,CAAC;IACX;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD;AAmBD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,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,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD,+FAA+F;AAC/F,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAiBtE;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,CAUpE;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IAC3D,6CAA6C;IAC7C,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,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IAC3D,6CAA6C;IAC7C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,sDAAsD;IACtD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,gBAAgB,CAAC;CAChC;AAED,wEAAwE;AACxE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,gBAAgB,CAQrE;AAyBD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,aAAa,EAClB,QAAQ,CAAC,EAAE,gBAAgB,GAC1B,iBAAiB,CA2BnB"}
@@ -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;AAc5C,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CA6BhE"}
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,GA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QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAqB5C;AAED;;;;;GAKG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,GAAG,EAAE,OAAO,GAAG,SAAS,EACxB,QAAQ,EAAE,MAAM,EAAE,GACjB,OAAO,CAAC;IAAE,YAAY,EAAE,OAAO,CAAA;CAAE,CAAC,CAcpC;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,CAAC,CAAC,CAwBZ"}
@@ -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,EACX,KAAK,EAAE,WAAW,GACjB,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAyCzC;AAED,+EAA+E;AAC/E,wBAAsB,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,EAA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E,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,uFAAuF;IACvF,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,0EAA0E;IAC1E,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,oBAAoB;IACnC,wGAAwG;IACxG,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,yDAAyD;IACzD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAmlBD;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,oBAAoB,CAAC,CA4B/B"}
@@ -1,6 +1,6 @@
1
- declare const BUILTIN_PACKAGE_JSON_TEMPLATE = "{\n \"name\": \"{system}\",\n \"private\": true,\n \"type\": \"module\",\n \"packageManager\": \"{packageManager}\",\n \"workspaces\": {workspaces},\n \"scripts\": {\n \"build\": \"turbo build\",\n \"dev\": \"turbo dev\",\n \"lint\": \"turbo lint\",\n \"typecheck\": \"turbo typecheck\",\n \"test\": \"turbo test\",\n \"clean\": \"turbo clean\",\n \"sync\": \"hexagen sync\",\n \"sync:dry\": \"hexagen sync --dry-run\",\n \"sync:force\": \"hexagen sync --force\",\n \"sync:check\": \"hexagen sync --check\",\n \"lint:arch\": \"hexagen arch validate\",\n \"templates:add\": \"hexagen add\",\n \"templates:validate\": \"hexagen validate-templates\",\n \"format\": \"prettier --write \\\"**/*.{ts,tsx}\\\"\"\n },\n \"devDependencies\": {\n \"turbo\": \"^2.0.0\",\n \"typescript\": \"^5.5.4\",\n \"eslint\": \"^9.0.0\",\n \"prettier\": \"^3.0.0\",\n \"@hexagen-monaco/sync\": \"^{toolchainVersion}\",\n \"@hexagen-monaco/arch-linter\": \"^{toolchainVersion}\"\n }\n}\n";
1
+ declare const BUILTIN_PACKAGE_JSON_TEMPLATE = "{\n \"name\": \"{system}\",\n \"private\": true,\n \"type\": \"module\",\n \"packageManager\": \"{packageManager}\",\n \"workspaces\": {workspaces},\n \"scripts\": {\n \"build\": \"turbo build\",\n \"dev\": \"turbo dev\",\n \"lint\": \"turbo lint\",\n \"typecheck\": \"turbo typecheck\",\n \"test\": \"turbo test\",\n \"clean\": \"turbo clean\",\n \"sync\": \"hexagen sync\",\n \"sync:dry\": \"hexagen sync --dry-run\",\n \"sync:force\": \"hexagen sync --force\",\n \"sync:check\": \"hexagen sync --check\",\n \"lint:arch\": \"hexagen arch validate\",\n \"templates:add\": \"hexagen add\",\n \"templates:validate\": \"hexagen validate-templates\",\n \"format\": \"prettier --write \\\"**/*.{ts,tsx}\\\"\"\n },\n \"devDependencies\": {\n \"turbo\": \"^2.11.5\",\n \"typescript\": \"^5.5.4\",\n \"eslint\": \"^9.0.0\",\n \"prettier\": \"^3.0.0\",\n \"@hexagen-monaco/sync\": \"^{toolchainVersion}\",\n \"@hexagen-monaco/arch-linter\": \"^{toolchainVersion}\"\n }\n}\n";
2
2
  declare const BUILTIN_TSCONFIG_BASE_TEMPLATE = "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"module\": \"ESNext\",\n \"moduleResolution\": \"bundler\",\n \"strict\": true,\n \"skipLibCheck\": true,\n \"composite\": true,\n \"declaration\": true,\n \"emitDeclarationOnly\": true,\n \"paths\": {\n \"@{scope}/*\": [\"./packages/*/src/index.ts\"]\n }\n }\n}\n";
3
- declare const BUILTIN_TURBO_TEMPLATE = "{\n \"$schema\": \"https://turbo.build/schema.json\",\n \"tasks\": {\n \"build\": {\n \"dependsOn\": [\"^build\"],\n \"outputs\": [\"dist/**\"]\n },\n \"dev\": {\n \"cache\": false,\n \"persistent\": true\n },\n \"lint\": {\n \"dependsOn\": [\"^build\"]\n },\n \"typecheck\": {\n \"dependsOn\": [\"^build\"],\n \"outputs\": [],\n \"cache\": true\n },\n \"test\": {\n \"dependsOn\": [\"^build\"]\n }\n }\n}\n";
3
+ declare const BUILTIN_TURBO_TEMPLATE = "{\n \"$schema\": \"https://turbo.build/schema.json\",\n \"agentGuidance\": false,\n \"tasks\": {\n \"build\": {\n \"dependsOn\": [\"^build\"],\n \"outputs\": [\"dist/**\"]\n },\n \"dev\": {\n \"cache\": false,\n \"persistent\": true\n },\n \"lint\": {\n \"dependsOn\": [\"^build\"]\n },\n \"typecheck\": {\n \"dependsOn\": [\"^build\"],\n \"outputs\": [],\n \"cache\": true\n },\n \"test\": {\n \"dependsOn\": [\"^build\"]\n }\n }\n}\n";
4
4
  declare const BUILTIN_GITIGNORE_TEMPLATE = "# Dependencies\nnode_modules/\n.yarn/cache\n.yarn/install-state.gz\n.pnp.*\n\n# Build output\ndist/\n.turbo/\n.next/\n.nitro/\n.output/\n\n# Failed/partial tsc runs can leave vitest.config declaration artifacts at\n# package roots (F20) \u2014 build noise, never source; keep them out of git status.\npackages/*/vitest.config.d.ts\npackages/*/vitest.config.d.ts.map\n\n# Next.js static export \u2014 anchored to apps so a bare `out/` can't shadow a\n# bounded context's hexagonal `src/application/ports/out/` source (which a\n# pattern without a leading path matches at any depth).\napps/*/out/\n\n# Test / coverage\ncoverage/\n\n# Environment\n.env\n.env.*\n!.env.example\n# Add-on templates ship additional committed examples (.env.bullmq.example,\n# .env.rate-limit.example, \u2026) that `.env.*` would otherwise swallow \u2014 without\n# this re-include `git add -A` stages only 1 of N example files (F3).\n!.env.*.example\n\n# Logs & OS\n*.log\n.DS_Store\n";
5
5
  declare const BUILTIN_YARNRC_TEMPLATE = "# Generated by hexagen. Corepack reads `packageManager` in package.json to\n# select the Yarn version; the node-modules linker keeps installs conventional.\nnodeLinker: node-modules\n";
6
6
  declare const BUILTIN_SETUP_MD_TEMPLATE = "# Setup\n\nThis project was scaffolded by hexagen. Before your first push:\n\n```bash\ncorepack enable # activate the pinned package manager\nyarn install # resolves dependencies, writes yarn.lock\ngit add yarn.lock && git commit -m \"chore: add lockfile\"\ngit push\n```\n\nOnce `yarn.lock` is committed, you can switch CI to a reproducible install by\nadding `--immutable` to the `yarn install` step in\n`.github/workflows/ci.yml` (npm: `npm ci`; pnpm: `pnpm install --frozen-lockfile`).\n\n**Notes**\n\n- CI reads your package-manager version from `package.json` (`packageManager`)\n via Corepack, so bumping it stays in sync automatically \u2014 nothing to edit in\n `ci.yml`.\n- **This file is a one-time bootstrap doc \u2014 delete it after your first push.**\n Its pre-lockfile guidance goes stale once `yarn.lock` is committed. (Run\n `hexagen sync` won't bring it back \u2014 it's a protected root file.)\n";
@@ -1 +1 @@
1
- {"version":3,"file":"root-file-templates.d.ts","sourceRoot":"","sources":["../../src/generators/root-file-templates.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,6BAA6B,8gCA+BlC,CAAC;AAEF,QAAA,MAAM,8BAA8B,0WAenC,CAAC;AAEF,QAAA,MAAM,sBAAsB,0eAwB3B,CAAC;AAEF,QAAA,MAAM,0BAA0B,s8BAsC/B,CAAC;AAEF,QAAA,MAAM,uBAAuB,4LAG5B,CAAC;AAIF,QAAA,MAAM,yBAAyB,+7BAuB9B,CAAC;AAkBF,QAAA,MAAM,2BAA2B,6NAUhC,CAAC;AAEF,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,GAC5B,CAAC"}
1
+ {"version":3,"file":"root-file-templates.d.ts","sourceRoot":"","sources":["../../src/generators/root-file-templates.ts"],"names":[],"mappings":"AAmBA,QAAA,MAAM,6BAA6B,+gCA+BlC,CAAC;AAEF,QAAA,MAAM,8BAA8B,0WAenC,CAAC;AAUF,QAAA,MAAM,sBAAsB,ugBAyB3B,CAAC;AAEF,QAAA,MAAM,0BAA0B,s8BAsC/B,CAAC;AAEF,QAAA,MAAM,uBAAuB,4LAG5B,CAAC;AAIF,QAAA,MAAM,yBAAyB,+7BAuB9B,CAAC;AAkBF,QAAA,MAAM,2BAA2B,6NAUhC,CAAC;AAEF,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,GAC5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"root-files.d.ts","sourceRoot":"","sources":["../../src/generators/root-files.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,eAAe,CAAC;AAiBvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAwVzD,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC,CAiN1B"}
1
+ {"version":3,"file":"root-files.d.ts","sourceRoot":"","sources":["../../src/generators/root-files.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,eAAe,CAAC;AAiBvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAsWzD,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC,CAiN1B"}
package/dist/index.js CHANGED
@@ -1439,15 +1439,24 @@ z.object({
1439
1439
  }).strict();
1440
1440
  var UNRESOLVED_IMPORT_RULE_ID = "unresolved-import";
1441
1441
  var BUILTIN_RULE_IDS = [UNRESOLVED_IMPORT_RULE_ID];
1442
- var Rule = z.object({
1443
- id: z.string().min(1).refine((id) => !BUILTIN_RULE_IDS.includes(id), {
1444
- message: "rule id is reserved for a built-in rule"
1445
- }),
1442
+ var RuleId = z.string().min(1).refine((id) => !BUILTIN_RULE_IDS.includes(id), {
1443
+ message: "rule id is reserved for a built-in rule"
1444
+ });
1445
+ var RuleSeverity = z.enum(["error", "warn"]);
1446
+ var PrefixRule = z.object({
1447
+ id: RuleId,
1446
1448
  kind: z.enum(["forbid", "allow-only"]),
1447
1449
  from: SlicePathString,
1448
1450
  to: SlicePathString,
1449
- severity: z.enum(["error", "warn"])
1451
+ severity: RuleSeverity
1452
+ }).strict();
1453
+ var ClosedRule = z.object({
1454
+ id: RuleId,
1455
+ kind: z.literal("closed"),
1456
+ except: z.array(SlicePathString),
1457
+ severity: RuleSeverity
1450
1458
  }).strict();
1459
+ var Rule = z.discriminatedUnion("kind", [PrefixRule, ClosedRule]);
1451
1460
  function isRealCalendarDate(text) {
1452
1461
  const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(text);
1453
1462
  if (!m)
@@ -1543,7 +1552,7 @@ var BUILTIN_PACKAGE_JSON_TEMPLATE = `{
1543
1552
  "format": "prettier --write \\"**/*.{ts,tsx}\\""
1544
1553
  },
1545
1554
  "devDependencies": {
1546
- "turbo": "^2.0.0",
1555
+ "turbo": "^2.11.5",
1547
1556
  "typescript": "^5.5.4",
1548
1557
  "eslint": "^9.0.0",
1549
1558
  "prettier": "^3.0.0",
@@ -1570,6 +1579,7 @@ var BUILTIN_TSCONFIG_BASE_TEMPLATE = `{
1570
1579
  `;
1571
1580
  var BUILTIN_TURBO_TEMPLATE = `{
1572
1581
  "$schema": "https://turbo.build/schema.json",
1582
+ "agentGuidance": false,
1573
1583
  "tasks": {
1574
1584
  "build": {
1575
1585
  "dependsOn": ["^build"],
@@ -1684,7 +1694,7 @@ function assertValidToolchainVersion(version, source) {
1684
1694
  function resolveToolchainVersion() {
1685
1695
  {
1686
1696
  return assertValidToolchainVersion(
1687
- "0.13.0",
1697
+ "0.14.0",
1688
1698
  "build-injected __HEXAGEN_TOOLCHAIN_VERSION__"
1689
1699
  );
1690
1700
  }
@@ -1797,6 +1807,11 @@ function buildTurboContentFromConfig(manifest, prettierOptions) {
1797
1807
  const globalDependencies = turboConfig.globalDependencies ?? [];
1798
1808
  const doc = {
1799
1809
  $schema: builtin.$schema,
1810
+ // The opt-out the built-in template also carries (see its comment). Only a
1811
+ // manifest that states the key wins — an absent or non-boolean value keeps
1812
+ // the safe default rather than emitting turbo's own agent-rules block into
1813
+ // a project whose tree the generator owns.
1814
+ agentGuidance: typeof turboConfig.agentGuidance === "boolean" ? turboConfig.agentGuidance : false,
1800
1815
  ...globalDependencies.length > 0 ? { globalDependencies } : {},
1801
1816
  tasks
1802
1817
  };