@intentius/chant 0.124.76 → 0.124.77

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 (146) hide show
  1. package/dist/__fixtures__/agent-guard/plywood.d.ts +8 -0
  2. package/dist/__fixtures__/agent-guard/plywood.d.ts.map +1 -0
  3. package/dist/__fixtures__/agent-guard/plywood.js +19 -0
  4. package/dist/__fixtures__/agent-guard/terragucci.d.ts +8 -0
  5. package/dist/__fixtures__/agent-guard/terragucci.d.ts.map +1 -0
  6. package/dist/__fixtures__/agent-guard/terragucci.js +30 -0
  7. package/dist/__fixtures__/gated-ledger.d.ts +10 -0
  8. package/dist/__fixtures__/gated-ledger.d.ts.map +1 -0
  9. package/dist/__fixtures__/gated-ledger.js +51 -0
  10. package/dist/agent-guard.d.ts +143 -0
  11. package/dist/agent-guard.d.ts.map +1 -0
  12. package/dist/agent-guard.js +456 -0
  13. package/dist/ci-commit.d.ts +54 -3
  14. package/dist/ci-commit.d.ts.map +1 -1
  15. package/dist/ci-commit.js +69 -7
  16. package/dist/ci-own-jobs.d.ts +81 -0
  17. package/dist/ci-own-jobs.d.ts.map +1 -0
  18. package/dist/ci-own-jobs.js +234 -0
  19. package/dist/ci-product.d.ts +39 -0
  20. package/dist/ci-product.d.ts.map +1 -1
  21. package/dist/ci-product.js +40 -0
  22. package/dist/cli/handlers/approve.d.ts +5 -1
  23. package/dist/cli/handlers/approve.d.ts.map +1 -1
  24. package/dist/cli/handlers/approve.js +17 -11
  25. package/dist/cli/handlers/build.d.ts +1 -1
  26. package/dist/cli/handlers/build.d.ts.map +1 -1
  27. package/dist/cli/handlers/build.js +88 -2
  28. package/dist/cli/handlers/commit.d.ts.map +1 -1
  29. package/dist/cli/handlers/commit.js +3 -1
  30. package/dist/cli/handlers/notify-relay.d.ts +18 -1
  31. package/dist/cli/handlers/notify-relay.d.ts.map +1 -1
  32. package/dist/cli/handlers/notify-relay.js +90 -14
  33. package/dist/cli/handlers/pr.d.ts.map +1 -1
  34. package/dist/cli/handlers/pr.js +3 -1
  35. package/dist/cli/handlers/release.d.ts +5 -1
  36. package/dist/cli/handlers/release.d.ts.map +1 -1
  37. package/dist/cli/handlers/release.js +17 -5
  38. package/dist/cli/handlers/run-generate.d.ts.map +1 -1
  39. package/dist/cli/handlers/run-generate.js +2 -1
  40. package/dist/cli/main.d.ts.map +1 -1
  41. package/dist/cli/main.js +21 -1
  42. package/dist/cli/parse-args.d.ts.map +1 -1
  43. package/dist/cli/parse-args.js +60 -4
  44. package/dist/cli/registry.d.ts +16 -0
  45. package/dist/cli/registry.d.ts.map +1 -1
  46. package/dist/components/pr-env-components.d.ts +65 -0
  47. package/dist/components/pr-env-components.d.ts.map +1 -0
  48. package/dist/components/pr-env-components.js +163 -0
  49. package/dist/components/pr-policy.d.ts +15 -0
  50. package/dist/components/pr-policy.d.ts.map +1 -1
  51. package/dist/components/pr-policy.js +24 -1
  52. package/dist/components/release-compile.d.ts +15 -3
  53. package/dist/components/release-compile.d.ts.map +1 -1
  54. package/dist/components/release-compile.js +66 -15
  55. package/dist/gate-policy.d.ts +14 -1
  56. package/dist/gate-policy.d.ts.map +1 -1
  57. package/dist/gate-policy.js +16 -6
  58. package/dist/lexicon.d.ts +17 -1
  59. package/dist/lexicon.d.ts.map +1 -1
  60. package/dist/lexicon.js +1 -0
  61. package/dist/lifecycle/gated-op.d.ts +95 -0
  62. package/dist/lifecycle/gated-op.d.ts.map +1 -0
  63. package/dist/lifecycle/gated-op.js +96 -0
  64. package/dist/lifecycle/git.d.ts.map +1 -1
  65. package/dist/lifecycle/git.js +83 -2
  66. package/dist/notify-relay-repo.d.ts +131 -0
  67. package/dist/notify-relay-repo.d.ts.map +1 -0
  68. package/dist/notify-relay-repo.js +202 -0
  69. package/dist/notify-relay.d.ts +25 -1
  70. package/dist/notify-relay.d.ts.map +1 -1
  71. package/dist/notify-relay.js +28 -2
  72. package/dist/op/op-waves-capability.js +2 -2
  73. package/dist/policy-engine.d.ts +95 -0
  74. package/dist/policy-engine.d.ts.map +1 -0
  75. package/dist/policy-engine.js +158 -0
  76. package/dist/release-floors.d.ts +1 -1
  77. package/dist/release-floors.js +1 -1
  78. package/dist/state-export.d.ts +126 -0
  79. package/dist/state-export.d.ts.map +1 -0
  80. package/dist/state-export.js +157 -0
  81. package/dist/state-migration.d.ts +148 -0
  82. package/dist/state-migration.d.ts.map +1 -0
  83. package/dist/state-migration.js +147 -0
  84. package/dist/state-unlock.d.ts +167 -0
  85. package/dist/state-unlock.d.ts.map +1 -0
  86. package/dist/state-unlock.js +197 -0
  87. package/dist/wave-runtime.mjs +329 -329
  88. package/dist/workspace/declaration.schema.json +1 -1
  89. package/dist/workspace/release-workflow.d.ts +10 -0
  90. package/dist/workspace/release-workflow.d.ts.map +1 -1
  91. package/dist/workspace/release-workflow.js +8 -3
  92. package/package.json +1 -1
  93. package/src/__fixtures__/agent-guard/plywood.ts +27 -0
  94. package/src/__fixtures__/agent-guard/terragucci.ts +39 -0
  95. package/src/__fixtures__/gated-ledger.ts +58 -0
  96. package/src/agent-guard.test.ts +320 -0
  97. package/src/agent-guard.ts +548 -0
  98. package/src/ci-commit.test.ts +50 -2
  99. package/src/ci-commit.ts +93 -9
  100. package/src/ci-own-jobs.test.ts +109 -0
  101. package/src/ci-own-jobs.ts +253 -0
  102. package/src/ci-product.ts +81 -0
  103. package/src/cli/handlers/approve-cwd.test.ts +112 -0
  104. package/src/cli/handlers/approve.ts +22 -11
  105. package/src/cli/handlers/build-own-jobs.test.ts +80 -0
  106. package/src/cli/handlers/build-pr-loop-control.test.ts +88 -0
  107. package/src/cli/handlers/build-run-group.test.ts +60 -0
  108. package/src/cli/handlers/build.ts +83 -3
  109. package/src/cli/handlers/commit.ts +3 -0
  110. package/src/cli/handlers/notify-relay.ts +99 -17
  111. package/src/cli/handlers/pr.ts +3 -1
  112. package/src/cli/handlers/release.ts +15 -5
  113. package/src/cli/handlers/run-generate.ts +2 -1
  114. package/src/cli/main.ts +21 -1
  115. package/src/cli/parse-args.ts +45 -3
  116. package/src/cli/registry.ts +16 -0
  117. package/src/components/pr-env-components.test.ts +138 -0
  118. package/src/components/pr-env-components.ts +214 -0
  119. package/src/components/pr-policy.test.ts +41 -1
  120. package/src/components/pr-policy.ts +25 -1
  121. package/src/components/release-compile.test.ts +47 -0
  122. package/src/components/release-compile.ts +70 -13
  123. package/src/gate-policy-bundle.test.ts +14 -0
  124. package/src/gate-policy.test.ts +7 -0
  125. package/src/gate-policy.ts +22 -7
  126. package/src/lexicon.ts +18 -1
  127. package/src/lifecycle/gated-op.ts +158 -0
  128. package/src/lifecycle/git.test.ts +92 -0
  129. package/src/lifecycle/git.ts +71 -2
  130. package/src/notify-relay-repo.test.ts +284 -0
  131. package/src/notify-relay-repo.ts +234 -0
  132. package/src/notify-relay.test.ts +12 -0
  133. package/src/notify-relay.ts +30 -3
  134. package/src/op/op-waves-capability.ts +2 -2
  135. package/src/policy-engine.test.ts +163 -0
  136. package/src/policy-engine.ts +201 -0
  137. package/src/release-floors.ts +1 -1
  138. package/src/state-export.test.ts +125 -0
  139. package/src/state-export.ts +228 -0
  140. package/src/state-migration.test.ts +134 -0
  141. package/src/state-migration.ts +237 -0
  142. package/src/state-unlock.test.ts +166 -0
  143. package/src/state-unlock.ts +294 -0
  144. package/src/workspace/declaration.schema.json +1 -1
  145. package/src/workspace/release-workflow.test.ts +34 -0
  146. package/src/workspace/release-workflow.ts +17 -3
@@ -0,0 +1,8 @@
1
+ /**
2
+ * plywood's agent guard words and rules, as packages/plywood/src/guard.ts
3
+ * passes them to chant's `installAgentGuard` (#4770). Its tests, ported from
4
+ * plywood's test/agents.test.ts ("the agent guard"), run against these.
5
+ */
6
+ import type { AgentGuardSpec } from "../../agent-guard.js";
7
+ export declare const PLYWOOD_GUARD: AgentGuardSpec;
8
+ //# sourceMappingURL=plywood.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plywood.d.ts","sourceRoot":"","sources":["../../../src/__fixtures__/agent-guard/plywood.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAoB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAO1E,eAAO,MAAM,aAAa,EAAE,cAc3B,CAAC"}
@@ -0,0 +1,19 @@
1
+ const engine = {
2
+ refuse: ["up", "update", "destroy"],
3
+ valuedFlags: ["-C", "--cwd", "-s", "--stack", "--color", "--config-file", "--logflow", "-v", "--verbose", "--tracing", "--profiling", "--memprofilerate"],
4
+ };
5
+ export const PLYWOOD_GUARD = {
6
+ words: {
7
+ product: "plywood",
8
+ refusal: "an agent session does not run '{what}'. Open a pull request; plywood previews it, and the update runs after a person approves the digest.",
9
+ },
10
+ rules: {
11
+ engines: { pulumi: engine, plunge: engine },
12
+ // plywood's own verbs that update, approve, override or move a stack, refused as terragucci refuses its own.
13
+ product: {
14
+ commands: [["up"], ["resume"], ["approve"], ["override"], ["cancel"], ["move"], ["rollback"], ["action"]],
15
+ flagValues: [["--respond", "up"]],
16
+ },
17
+ wrapperExit: 1,
18
+ },
19
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * terragucci's agent guard words and rules, as packages/terragucci/src/guard.ts
3
+ * passes them to chant's `installAgentGuard` (#4770). Its tests, ported from
4
+ * terragucci's test/guard.test.ts, run against these.
5
+ */
6
+ import type { AgentGuardSpec } from "../../agent-guard.js";
7
+ export declare const TERRAGUCCI_GUARD: AgentGuardSpec;
8
+ //# sourceMappingURL=terragucci.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terragucci.d.ts","sourceRoot":"","sources":["../../../src/__fixtures__/agent-guard/terragucci.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAoB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAS1E,eAAO,MAAM,gBAAgB,EAAE,cAwB9B,CAAC"}
@@ -0,0 +1,30 @@
1
+ const tf = {
2
+ refuse: ["apply", "destroy", "import", "taint", "untaint", "force-unlock"],
3
+ refuseSub: { state: ["rm", "mv", "push", "replace-provider"] },
4
+ refuseFlags: ["-auto-approve", "-terragrunt-auto-approve"],
5
+ dirFlags: ["-chdir", "-working-dir", "-terragrunt-working-dir"],
6
+ };
7
+ export const TERRAGUCCI_GUARD = {
8
+ words: {
9
+ product: "terragucci",
10
+ refusal: "{what} is refused{where}. Propose the change instead: commit it to a branch and call the propose tool of terragucci mcp --propose, which pushes the branch and opens a pull request. The pipeline plans it, and a person approves its apply. init, validate, fmt and plan still run here.",
11
+ where: " in {root}, a root of this repo's pipeline",
12
+ },
13
+ rules: {
14
+ engines: {
15
+ tofu: tf,
16
+ terraform: tf,
17
+ terragrunt: {
18
+ ...tf,
19
+ allFlags: ["--all", "-a"],
20
+ prefixes: [{ words: ["run-all"], all: true }, { words: ["stack", "run"], all: true }, { words: ["run"] }],
21
+ },
22
+ choudoufu: tf,
23
+ },
24
+ product: {
25
+ commands: [["stage", "tf-apply"], ["approve"], ["override"], ["unlock-state"], ["pr-merge"]],
26
+ flagValues: [["--mode", "apply"]],
27
+ },
28
+ wrapperExit: 3,
29
+ },
30
+ };
@@ -0,0 +1,10 @@
1
+ import type { GatedRequestLedger } from "../lifecycle/gated-op.js";
2
+ export interface FakeLedger extends GatedRequestLedger {
3
+ approve(by: string): void;
4
+ /** What was written, in order: `pending`, `applied`, `finished:<result>`. */
5
+ writes: string[];
6
+ /** The finished lines' detail, in order. */
7
+ details: Array<Record<string, string | number | boolean>>;
8
+ }
9
+ export declare function fakeLedger(): FakeLedger;
10
+ //# sourceMappingURL=gated-ledger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gated-ledger.d.ts","sourceRoot":"","sources":["../../src/__fixtures__/gated-ledger.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,MAAM,WAAW,UAAW,SAAQ,kBAAkB;IACpD,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,6EAA6E;IAC7E,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,4CAA4C;IAC5C,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;CAC3D;AAED,wBAAgB,UAAU,IAAI,UAAU,CAwCvC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * A gated-request ledger in memory, for the state operations' tests
3
+ * (#4762): requests wait until `approve` is called, an approval by the
4
+ * requester is refused as chant's ledger refuses it, and a spent request
5
+ * answers `spent`. Nothing is written to git.
6
+ */
7
+ import { gatedRequestDigest } from "../lifecycle/gated-request.js";
8
+ export function fakeLedger() {
9
+ let approvedBy;
10
+ const writes = [];
11
+ const details = [];
12
+ const asked = new Map();
13
+ const spent = new Set();
14
+ return {
15
+ writes,
16
+ details,
17
+ approve(by) {
18
+ approvedBy = by;
19
+ },
20
+ async requestGate(input) {
21
+ const digest = gatedRequestDigest(input.op, input.request);
22
+ if (spent.has(digest))
23
+ return { status: "spent", digest, request: input.request };
24
+ if (!asked.has(digest)) {
25
+ asked.set(digest, { op: input.op, request: input.request, expiresAt: "2099-01-01T00:00:00Z" });
26
+ writes.push("pending");
27
+ }
28
+ const command = `chant approve ${input.op} ${input.request.subject} --plan ${digest}`;
29
+ if (!approvedBy)
30
+ return { status: "waiting", digest, request: input.request, command };
31
+ if (approvedBy === input.request.by)
32
+ return { status: "refused", digest, request: input.request, by: approvedBy, reason: "the requester's own approval does not count", command };
33
+ return { status: "approved", digest, request: input.request, approval: { version: 1, kind: "resolution", op: input.op, gate: input.request.subject, planDigest: digest, resolvedBy: approvedBy, timestamp: "2026-11-08T10:00:00Z" } };
34
+ },
35
+ async spendGatedRequest(input) {
36
+ spent.add(input.digest);
37
+ writes.push("applied");
38
+ return { version: 1, kind: "applied", op: input.op, gate: input.gate, planDigest: input.digest, approvedAt: "", approvedBy: "", timestamp: "2026-11-08T11:00:00Z" };
39
+ },
40
+ async finishGatedRequest(input) {
41
+ writes.push(`finished:${input.result}`);
42
+ details.push(input.detail ?? {});
43
+ return { record: {}, pushed: true };
44
+ },
45
+ async readGatedRequests(op) {
46
+ return [...asked.entries()]
47
+ .filter(([, a]) => a.op === op)
48
+ .map(([digest, a]) => ({ op, gate: a.request.subject, digest, request: a.request, pending: { expiresAt: a.expiresAt }, approvals: [], ...(spent.has(digest) ? { applied: {} } : {}) }));
49
+ },
50
+ };
51
+ }
@@ -0,0 +1,143 @@
1
+ /** The first chant with the shared agent guard (#4770). Products feature-detect on it, or on `installAgentGuard`. */
2
+ export declare const AGENT_GUARD_FLOOR = "0.124.77";
3
+ /** What the guard refuses of one engine binary (tofu, pulumi, terragrunt). Flag names are written with their dashes. */
4
+ export interface AgentGuardEngine {
5
+ /** Subcommands refused: `apply`, `up`. */
6
+ refuse: string[];
7
+ /** A subcommand's second words refused: `{ state: ["rm", "mv"] }`. */
8
+ refuseSub?: Record<string, string[]>;
9
+ /** Flags refused with any subcommand, also as `--x=v`: `-auto-approve`. One or two dashes both match. */
10
+ refuseFlags?: string[];
11
+ /** Flags that take the next word as their value, skipped when finding the subcommand: `-C`, `--stack`. */
12
+ valuedFlags?: string[];
13
+ /** Flags whose value is the directory the command runs in, as `-x dir` or `-x=dir`: `-chdir`. One or two dashes both match. */
14
+ dirFlags?: string[];
15
+ /** Flags that run the command in every root under the directory: terragrunt's `--all`. */
16
+ allFlags?: string[];
17
+ /** Leading words dropped before the subcommand, the first match only; `all` as with `allFlags`: terragrunt's `run-all`, `stack run`, `run`. */
18
+ prefixes?: Array<{
19
+ words: string[];
20
+ all?: boolean;
21
+ }>;
22
+ }
23
+ /** The product's rules. */
24
+ export interface AgentGuardRules {
25
+ /** The engine binaries the guard wraps and checks, by name. */
26
+ engines: Record<string, AgentGuardEngine>;
27
+ /**
28
+ * The product's own commands refused anywhere inside the repo: each is the
29
+ * leading non-flag words (`["stage", "tf-apply"]`, `["approve"]`), and
30
+ * `flagValues` a flag with the value it is refused with, with any command
31
+ * (`["--mode", "apply"]`).
32
+ */
33
+ product?: {
34
+ commands: string[][];
35
+ flagValues?: Array<[string, string]>;
36
+ };
37
+ /** The exit code a wrapper refuses with. Default 3. The hook always exits 2, Claude Code's block code. */
38
+ wrapperExit?: number;
39
+ }
40
+ /** The product's words. */
41
+ export interface AgentGuardWords {
42
+ /** The product's name and bin, as the agent types it: every refusal starts `<product> guard: `. */
43
+ product: string;
44
+ /** The refusal after that prefix, with `{what}` for the refused command (`tofu apply`) and `{where}` for {@link where}, or nothing. */
45
+ refusal: string;
46
+ /** With roots, what `{where}` becomes, with `{root}` for the root, relative to the repo. Default ` in {root}`. */
47
+ where?: string;
48
+ }
49
+ export interface AgentGuardSpec {
50
+ words: AgentGuardWords;
51
+ rules: AgentGuardRules;
52
+ }
53
+ /** What the script is given. `repo` or `repoFromScript` (a path from the script's directory) names the checkout. */
54
+ export interface AgentGuardConfig extends AgentGuardSpec {
55
+ repo?: string;
56
+ repoFromScript?: string;
57
+ /** Roots relative to the repo, where engine commands are refused; absent refuses them anywhere. */
58
+ roots?: string[];
59
+ }
60
+ /** A refusal: the binary, the refused command (`apply`, `state rm`, `-auto-approve`, `approve`), the root, and the message. */
61
+ export interface AgentGuardVerdict {
62
+ bin: string;
63
+ command: string;
64
+ what: string;
65
+ where?: string;
66
+ message: string;
67
+ }
68
+ /** The Node functions the rule uses, handed in so {@link makeGuard} stays self-contained. */
69
+ export interface AgentGuardDeps {
70
+ realpathSync: (p: string) => string;
71
+ resolve: (...p: string[]) => string;
72
+ basename: (p: string) => string;
73
+ join: (...p: string[]) => string;
74
+ relative: (from: string, to: string) => string;
75
+ sep: string;
76
+ home: string | undefined;
77
+ scriptDir?: string;
78
+ }
79
+ export interface AgentGuard {
80
+ /** The first refusal a shell command line earns, following `cd` from `cwd`. */
81
+ checkCommand(text: string, cwd: string): AgentGuardVerdict | undefined;
82
+ /** What one engine binary's command line would do that the guard refuses. */
83
+ verdict(bin: string, args: string[], cwd: string): AgentGuardVerdict | undefined;
84
+ /** What the product's own command line would do that the guard refuses, run in `cwd`. */
85
+ productVerdict(args: string[], cwd: string): AgentGuardVerdict | undefined;
86
+ repo: string;
87
+ }
88
+ /**
89
+ * The rule. It references nothing outside itself: the guard's script carries
90
+ * its source text, so keep it to its parameters and ES2020.
91
+ */
92
+ export declare function makeGuard(config: AgentGuardConfig, deps: AgentGuardDeps): AgentGuard;
93
+ /** The guard in process, for a product's `guard check`: the rule the hook runs. */
94
+ export declare function agentGuard(spec: AgentGuardSpec, at: {
95
+ repo: string;
96
+ roots?: string[];
97
+ }): AgentGuard;
98
+ /** The guard's script: {@link makeGuard}'s source, the config, and the hook and wrapper entry points. */
99
+ export declare function agentGuardScript(config: AgentGuardConfig): string;
100
+ /** A wrapper on PATH: the guard's script for one binary. `node` absolute (with `node` on PATH as the fallback) or undefined for `node`; `script` absolute, or relative to the wrapper's directory. */
101
+ export declare function agentGuardWrapper(product: string, bin: string, script: string, node?: string): string;
102
+ /** Claude Code's settings files: the shared one, and the local one it keeps out of commits. */
103
+ export declare const CLAUDE_SETTINGS_SHARED = ".claude/settings.json";
104
+ export declare const CLAUDE_SETTINGS_LOCAL = ".claude/settings.local.json";
105
+ /**
106
+ * A Claude Code settings file's text with the guard's PreToolUse hook on
107
+ * Bash, in place of an earlier one (an entry naming `command` or any of
108
+ * `markers`). Everything else in the file is kept. Throws when the file is
109
+ * not a JSON object.
110
+ */
111
+ export declare function withAgentGuardHook(text: string | undefined, command: string, at: string, markers?: readonly string[], fail?: (message: string) => Error): string;
112
+ export interface AgentGuardInstallOptions extends AgentGuardSpec {
113
+ /** The checkout's top directory. */
114
+ repo: string;
115
+ /** `local` (under the git directory, kept out of commits) or `project` (in `.claude/`, to commit). */
116
+ install: "local" | "project";
117
+ /** Roots relative to the repo where engine commands are refused; absent refuses them anywhere. */
118
+ roots?: string[];
119
+ /** `local` only: where to write the script and `bin/`, in place of `<git-dir>/<product>/guard`. */
120
+ dir?: string;
121
+ /** `local` only: the Node the wrappers and the hook run. Default: this one. `project` runs `node`. */
122
+ node?: string;
123
+ /** Leave Claude Code's settings alone. */
124
+ noHook?: boolean;
125
+ /** The error the product throws for a broken settings file or a missing git checkout. */
126
+ fail?: (message: string) => Error;
127
+ }
128
+ export interface AgentGuardInstall {
129
+ /** The script, the wrappers' directory, absolute. */
130
+ script: string;
131
+ bin: string;
132
+ /** The settings file the hook went into, when it did. */
133
+ hook?: string;
134
+ /** The hook's command as Claude Code runs it. */
135
+ hookCommand: string;
136
+ /** The files written, relative to the repo when inside it. */
137
+ written: string[];
138
+ /** The line the agent's shell runs to put the wrappers ahead of the binaries. */
139
+ path: string;
140
+ }
141
+ /** Write the guard: the script, a wrapper per engine, and the hook. */
142
+ export declare function installAgentGuard(o: AgentGuardInstallOptions): AgentGuardInstall;
143
+ //# sourceMappingURL=agent-guard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-guard.d.ts","sourceRoot":"","sources":["../src/agent-guard.ts"],"names":[],"mappings":"AAqCA,qHAAqH;AACrH,eAAO,MAAM,iBAAiB,aAAe,CAAC;AAE9C,wHAAwH;AACxH,MAAM,WAAW,gBAAgB;IAC/B,0CAA0C;IAC1C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACrC,yGAAyG;IACzG,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,0GAA0G;IAC1G,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,+HAA+H;IAC/H,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,+IAA+I;IAC/I,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,GAAG,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CACtD;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