@intentius/chant 0.124.76 → 0.124.78

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 (212) 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/__fixtures__/notify-messages/events.d.ts +9 -0
  11. package/dist/__fixtures__/notify-messages/events.d.ts.map +1 -0
  12. package/dist/__fixtures__/notify-messages/events.js +21 -0
  13. package/dist/__fixtures__/product-words.d.ts +14 -0
  14. package/dist/__fixtures__/product-words.d.ts.map +1 -1
  15. package/dist/__fixtures__/product-words.js +11 -0
  16. package/dist/__fixtures__/terragucci-notify.d.ts +66 -0
  17. package/dist/__fixtures__/terragucci-notify.d.ts.map +1 -0
  18. package/dist/__fixtures__/terragucci-notify.js +133 -0
  19. package/dist/action-pins.d.ts +8 -0
  20. package/dist/action-pins.d.ts.map +1 -1
  21. package/dist/action-pins.js +9 -0
  22. package/dist/agent-guard.d.ts +143 -0
  23. package/dist/agent-guard.d.ts.map +1 -0
  24. package/dist/agent-guard.js +455 -0
  25. package/dist/ci-commit.d.ts +120 -5
  26. package/dist/ci-commit.d.ts.map +1 -1
  27. package/dist/ci-commit.js +214 -23
  28. package/dist/ci-own-jobs.d.ts +81 -0
  29. package/dist/ci-own-jobs.d.ts.map +1 -0
  30. package/dist/ci-own-jobs.js +233 -0
  31. package/dist/ci-product-words.d.ts +18 -4
  32. package/dist/ci-product-words.d.ts.map +1 -1
  33. package/dist/ci-product-words.js +26 -6
  34. package/dist/ci-product.d.ts +40 -1
  35. package/dist/ci-product.d.ts.map +1 -1
  36. package/dist/ci-product.js +40 -1
  37. package/dist/cli/handlers/approve.d.ts +5 -1
  38. package/dist/cli/handlers/approve.d.ts.map +1 -1
  39. package/dist/cli/handlers/approve.js +17 -11
  40. package/dist/cli/handlers/build.d.ts +1 -1
  41. package/dist/cli/handlers/build.d.ts.map +1 -1
  42. package/dist/cli/handlers/build.js +88 -2
  43. package/dist/cli/handlers/commit.d.ts.map +1 -1
  44. package/dist/cli/handlers/commit.js +3 -1
  45. package/dist/cli/handlers/notify-relay.d.ts +18 -1
  46. package/dist/cli/handlers/notify-relay.d.ts.map +1 -1
  47. package/dist/cli/handlers/notify-relay.js +90 -14
  48. package/dist/cli/handlers/pr.d.ts.map +1 -1
  49. package/dist/cli/handlers/pr.js +3 -1
  50. package/dist/cli/handlers/release.d.ts +5 -1
  51. package/dist/cli/handlers/release.d.ts.map +1 -1
  52. package/dist/cli/handlers/release.js +21 -9
  53. package/dist/cli/handlers/run-generate.d.ts.map +1 -1
  54. package/dist/cli/handlers/run-generate.js +2 -1
  55. package/dist/cli/main.d.ts.map +1 -1
  56. package/dist/cli/main.js +21 -1
  57. package/dist/cli/parse-args.d.ts.map +1 -1
  58. package/dist/cli/parse-args.js +60 -4
  59. package/dist/cli/registry.d.ts +16 -0
  60. package/dist/cli/registry.d.ts.map +1 -1
  61. package/dist/components/pr-env-components.d.ts +65 -0
  62. package/dist/components/pr-env-components.d.ts.map +1 -0
  63. package/dist/components/pr-env-components.js +162 -0
  64. package/dist/components/pr-policy.d.ts +15 -0
  65. package/dist/components/pr-policy.d.ts.map +1 -1
  66. package/dist/components/pr-policy.js +24 -1
  67. package/dist/components/release-compile.d.ts +15 -3
  68. package/dist/components/release-compile.d.ts.map +1 -1
  69. package/dist/components/release-compile.js +66 -15
  70. package/dist/config.d.ts +14 -8
  71. package/dist/config.d.ts.map +1 -1
  72. package/dist/config.js +16 -1
  73. package/dist/gate-policy.d.ts +14 -1
  74. package/dist/gate-policy.d.ts.map +1 -1
  75. package/dist/gate-policy.js +16 -6
  76. package/dist/lexicon.d.ts +25 -1
  77. package/dist/lexicon.d.ts.map +1 -1
  78. package/dist/lexicon.js +10 -0
  79. package/dist/lifecycle/gated-op.d.ts +95 -0
  80. package/dist/lifecycle/gated-op.d.ts.map +1 -0
  81. package/dist/lifecycle/gated-op.js +96 -0
  82. package/dist/lifecycle/git.d.ts.map +1 -1
  83. package/dist/lifecycle/git.js +83 -2
  84. package/dist/lifecycle/release-images.d.ts +77 -3
  85. package/dist/lifecycle/release-images.d.ts.map +1 -1
  86. package/dist/lifecycle/release-images.js +132 -6
  87. package/dist/notify-product.d.ts +11 -2
  88. package/dist/notify-product.d.ts.map +1 -1
  89. package/dist/notify-product.js +16 -4
  90. package/dist/notify-relay-repo.d.ts +131 -0
  91. package/dist/notify-relay-repo.d.ts.map +1 -0
  92. package/dist/notify-relay-repo.js +202 -0
  93. package/dist/notify-relay.d.ts +25 -1
  94. package/dist/notify-relay.d.ts.map +1 -1
  95. package/dist/notify-relay.js +27 -2
  96. package/dist/notify.d.ts +36 -4
  97. package/dist/notify.d.ts.map +1 -1
  98. package/dist/notify.js +31 -21
  99. package/dist/notify.schema.json +1 -0
  100. package/dist/op/activities/review-product.d.ts +111 -0
  101. package/dist/op/activities/review-product.d.ts.map +1 -0
  102. package/dist/op/activities/review-product.js +116 -0
  103. package/dist/op/op-waves-capability.js +2 -2
  104. package/dist/policy-engine.d.ts +95 -0
  105. package/dist/policy-engine.d.ts.map +1 -0
  106. package/dist/policy-engine.js +157 -0
  107. package/dist/pr-forge-reads.d.ts +124 -0
  108. package/dist/pr-forge-reads.d.ts.map +1 -0
  109. package/dist/pr-forge-reads.js +322 -0
  110. package/dist/pr-forge.d.ts +14 -0
  111. package/dist/pr-forge.d.ts.map +1 -1
  112. package/dist/pr-forge.js +21 -13
  113. package/dist/pr-plan-note.d.ts +293 -0
  114. package/dist/pr-plan-note.d.ts.map +1 -0
  115. package/dist/pr-plan-note.js +362 -0
  116. package/dist/release-floors.d.ts +9 -1
  117. package/dist/release-floors.d.ts.map +1 -1
  118. package/dist/release-floors.js +9 -1
  119. package/dist/state-export.d.ts +126 -0
  120. package/dist/state-export.d.ts.map +1 -0
  121. package/dist/state-export.js +156 -0
  122. package/dist/state-migration.d.ts +148 -0
  123. package/dist/state-migration.d.ts.map +1 -0
  124. package/dist/state-migration.js +146 -0
  125. package/dist/state-unlock.d.ts +167 -0
  126. package/dist/state-unlock.d.ts.map +1 -0
  127. package/dist/state-unlock.js +196 -0
  128. package/dist/wave-runtime.mjs +332 -332
  129. package/dist/workspace/declaration.schema.json +1 -1
  130. package/dist/workspace/release-workflow.d.ts +10 -0
  131. package/dist/workspace/release-workflow.d.ts.map +1 -1
  132. package/dist/workspace/release-workflow.js +10 -4
  133. package/package.json +1 -1
  134. package/src/__fixtures__/agent-guard/plywood.ts +27 -0
  135. package/src/__fixtures__/agent-guard/terragucci.ts +39 -0
  136. package/src/__fixtures__/gated-ledger.ts +58 -0
  137. package/src/__fixtures__/notify-messages/events.ts +23 -0
  138. package/src/__fixtures__/notify-messages/messages.json +50 -0
  139. package/src/__fixtures__/pr-loop/terragucci-plan.note.golden.md +53 -0
  140. package/src/__fixtures__/pr-loop/terragucci-plan.note.json +83 -0
  141. package/src/__fixtures__/product-words.ts +12 -0
  142. package/src/__fixtures__/review-agent/terragucci-review.json +94 -0
  143. package/src/__fixtures__/terragucci-notify.ts +170 -0
  144. package/src/action-pins.test.ts +12 -1
  145. package/src/action-pins.ts +11 -0
  146. package/src/agent-guard.test.ts +319 -0
  147. package/src/agent-guard.ts +547 -0
  148. package/src/ci-commit.test.ts +213 -2
  149. package/src/ci-commit.ts +258 -27
  150. package/src/ci-own-jobs.test.ts +108 -0
  151. package/src/ci-own-jobs.ts +252 -0
  152. package/src/ci-product-words.ts +35 -7
  153. package/src/ci-product.ts +81 -1
  154. package/src/cli/handlers/approve-cwd.test.ts +112 -0
  155. package/src/cli/handlers/approve.ts +22 -11
  156. package/src/cli/handlers/build-own-jobs.test.ts +80 -0
  157. package/src/cli/handlers/build-pr-loop-control.test.ts +87 -0
  158. package/src/cli/handlers/build-run-group.test.ts +59 -0
  159. package/src/cli/handlers/build.ts +83 -3
  160. package/src/cli/handlers/commit.ts +3 -0
  161. package/src/cli/handlers/notify-relay.ts +99 -17
  162. package/src/cli/handlers/pr.ts +3 -1
  163. package/src/cli/handlers/release.ts +20 -10
  164. package/src/cli/handlers/run-generate.ts +2 -1
  165. package/src/cli/main.ts +21 -1
  166. package/src/cli/parse-args.ts +45 -3
  167. package/src/cli/registry.ts +16 -0
  168. package/src/components/pr-env-components.test.ts +137 -0
  169. package/src/components/pr-env-components.ts +213 -0
  170. package/src/components/pr-policy.test.ts +41 -1
  171. package/src/components/pr-policy.ts +25 -1
  172. package/src/components/release-compile.test.ts +47 -0
  173. package/src/components/release-compile.ts +70 -13
  174. package/src/config.ts +23 -3
  175. package/src/gate-policy-bundle.test.ts +14 -0
  176. package/src/gate-policy.test.ts +7 -0
  177. package/src/gate-policy.ts +22 -7
  178. package/src/lexicon.ts +28 -1
  179. package/src/lifecycle/gated-op.ts +158 -0
  180. package/src/lifecycle/git.test.ts +92 -0
  181. package/src/lifecycle/git.ts +71 -2
  182. package/src/lifecycle/release-images-dockerfile.test.ts +221 -0
  183. package/src/lifecycle/release-images.ts +167 -8
  184. package/src/notify-message-words.test.ts +186 -0
  185. package/src/notify-product.ts +17 -4
  186. package/src/notify-relay-repo.test.ts +284 -0
  187. package/src/notify-relay-repo.ts +234 -0
  188. package/src/notify-relay.test.ts +12 -0
  189. package/src/notify-relay.ts +29 -3
  190. package/src/notify.schema.json +1 -0
  191. package/src/notify.ts +59 -19
  192. package/src/op/activities/review-product.test.ts +116 -0
  193. package/src/op/activities/review-product.ts +200 -0
  194. package/src/op/op-waves-capability.ts +2 -2
  195. package/src/op/schedule-overdue.test.ts +26 -0
  196. package/src/policy-engine.test.ts +162 -0
  197. package/src/policy-engine.ts +200 -0
  198. package/src/pr-forge-reads.test.ts +285 -0
  199. package/src/pr-forge-reads.ts +424 -0
  200. package/src/pr-forge.ts +30 -16
  201. package/src/pr-plan-note.test.ts +105 -0
  202. package/src/pr-plan-note.ts +521 -0
  203. package/src/release-floors.ts +13 -1
  204. package/src/state-export.test.ts +124 -0
  205. package/src/state-export.ts +227 -0
  206. package/src/state-migration.test.ts +133 -0
  207. package/src/state-migration.ts +236 -0
  208. package/src/state-unlock.test.ts +165 -0
  209. package/src/state-unlock.ts +293 -0
  210. package/src/workspace/declaration.schema.json +1 -1
  211. package/src/workspace/release-workflow.test.ts +34 -0
  212. package/src/workspace/release-workflow.ts +19 -4
@@ -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,9 @@
1
+ /**
2
+ * Events covering every line chant's Slack and Teams messages write (#4818).
3
+ * `messages.json` beside this holds what chant 0.124.77 rendered for each,
4
+ * with and without relay buttons, so a message given no words stays byte for
5
+ * byte as it was.
6
+ */
7
+ import { type NotifyEvent } from "../../notify.js";
8
+ export declare const NOTIFY_MESSAGE_EVENTS: Record<string, NotifyEvent>;
9
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/__fixtures__/notify-messages/events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAOjE,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAS7D,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Events covering every line chant's Slack and Teams messages write (#4818).
3
+ * `messages.json` beside this holds what chant 0.124.77 rendered for each,
4
+ * with and without relay buttons, so a message given no words stays byte for
5
+ * byte as it was.
6
+ */
7
+ import { makeNotifyEvent } from "../../notify.js";
8
+ const NOW = new Date("2026-10-11T12:00:00.000Z");
9
+ const DIGEST = "jcs1-sha256:" + "a".repeat(64);
10
+ const run = { url: "https://github.com/acme/db/actions/runs/42", forge: "github", repository: "acme/db", commit: "abc123" };
11
+ const at = (fields) => makeNotifyEvent(fields, { env: {}, now: NOW });
12
+ export const NOTIFY_MESSAGE_EVENTS = {
13
+ waiting: at({ source: "chant", event: "waiting", summary: "", project: "acme/db", wave: { number: 2, name: "prod", gate: "wave-2" }, targets: ["net", "app"], digest: DIGEST, approve: { command: `chant approve tf-apply wave-2 --plan ${DIGEST}` }, run, reportUrl: "https://reports.example/42" }),
14
+ review: at({ source: "chant", event: "waiting", summary: "wave 2 waits", wave: { number: 2, gate: "wave-2" }, targets: ["net"], digest: DIGEST, approve: { command: "chant approve tf-apply wave-2", review: { pr: 7, url: "https://github.com/acme/db/pull/7/files" } }, run }),
15
+ refused: at({ source: "sql-yodeler", event: "refused", summary: "", project: "acme/db", environment: "prod", targets: [], reason: "the plan moved after approval", exitCode: 4 }),
16
+ failed: at({ source: "plywood", event: "failed", summary: "shop-prod failed", targets: ["shop-prod"], reason: "pulumi up exited 255", run: { url: "https://gitlab.com/acme/db/-/jobs/9" } }),
17
+ drift: at({ source: "chant", event: "drift", summary: "2 members drifted: net, app", targets: ["net", "app"], drift: { changed: ["net", "app"], missing: ["db"], failed: ["dns"], fingerprint: "f1" }, run, reportUrl: "https://reports.example/43" }),
18
+ driftNone: at({ source: "chant", event: "drift", summary: "no members drifted", targets: [], drift: { changed: [], failed: ["dns"] } }),
19
+ ciRed: at({ source: "chant", event: "ci.red", summary: "", project: "acme/db", targets: [], ci: { branch: "main", commit: "0123456789abcdef", phase: "test", failedRun: { name: "unit", id: 5, conclusion: "failure", url: "https://github.com/acme/db/actions/runs/5" } } }),
20
+ ciGreen: at({ source: "chant", event: "ci.green", summary: "", project: "acme/db", targets: [], ci: { branch: "main", commit: "fedcba9876543210", red: "0123456789abcdef", culprit: "aaaabbbbccccdddd" } }),
21
+ };
@@ -75,4 +75,18 @@ export declare const YODEL: {
75
75
  approval: "per-wave";
76
76
  bin: string;
77
77
  };
78
+ /** terragucci's plan note words (#4810), as its report/views.ts writes them. */
79
+ export declare const TERRAGUCCI_NOTE: {
80
+ footer: string;
81
+ artifact: string;
82
+ noReport: string;
83
+ marker: string;
84
+ anchors: {
85
+ member: string;
86
+ group: string;
87
+ };
88
+ overrideKey: string;
89
+ approvalRulesKey: string;
90
+ applyStage: string;
91
+ };
78
92
  //# sourceMappingURL=product-words.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"product-words.d.ts","sourceRoot":"","sources":["../../src/__fixtures__/product-words.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,eAAO,MAAM,OAAO;IAClB,OAAO;IACP,MAAM;QAAI,IAAI;QAAa,KAAK;;IAChC,KAAK;QAAI,IAAI,EAA8B,CAAC,MAAM,EAAE,MAAM,CAAC;QAAE,KAAK,EAA2B,CAAC,MAAM,EAAE,MAAM,CAAC;;IAC7G,IAAI,EAAyB,CAAC,MAAM,EAAE,MAAM,CAAC;IAC7C,QAAQ;QAAI,OAAO,EAAE,MAAM;QAAW,EAAE,EAAE,OAAO;QAAW,IAAI,EAAE,MAAM;QAAW,MAAM,EAAE,QAAQ;;IACnG,OAAO;IACP,QAAQ;IACR,EAAE;IACF,MAAM;IACN,QAAQ;IACR,QAAQ,EAAE,cAAc;IACxB,GAAG;CACJ,CAAC;AACF,eAAO,MAAM,UAAU;;UAEM,CAAC,MAAM,EAAE,MAAM,CAAC;;QAC/B,IAAI,EAAE,MAAM;QAAW,KAAK,EAAE,OAAO;QAAW,IAAI,EAAE,MAAM;QAAW,MAAM,EAAE,QAAQ;QAAW,KAAK,EAAE,OAAO;;;;iBAExF,MAAM;;;;iBACL,OAAO;;;;;;cAKlC,UAAU;;CAErB,CAAC;AAEF,0GAA0G;AAC1G,eAAO,MAAM,KAAK;IAChB,OAAO;IACP,MAAM;QAAI,IAAI;QAAU,KAAK;QAAW,MAAM;QAAY,KAAK;QAAW,KAAK;QAAW,IAAI;QAAU,QAAQ;QAAc,OAAO;;IACrI,KAAK;QAAI,IAAI,EAAyB,CAAC,MAAM,EAAE,MAAM,CAAC;QAAE,KAAK,EAA0B,CAAC,MAAM,EAAE,MAAM,CAAC;;IACvG,IAAI,EAAqC,CAAC,MAAM,EAAE,MAAM,CAAC;IACzD,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,EAAE;IACF,QAAQ;IACR,QAAQ,EAAE,UAAU;IACpB,GAAG;CACJ,CAAC"}
1
+ {"version":3,"file":"product-words.d.ts","sourceRoot":"","sources":["../../src/__fixtures__/product-words.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,eAAO,MAAM,OAAO;IAClB,OAAO;IACP,MAAM;QAAI,IAAI;QAAa,KAAK;;IAChC,KAAK;QAAI,IAAI,EAA8B,CAAC,MAAM,EAAE,MAAM,CAAC;QAAE,KAAK,EAA2B,CAAC,MAAM,EAAE,MAAM,CAAC;;IAC7G,IAAI,EAAyB,CAAC,MAAM,EAAE,MAAM,CAAC;IAC7C,QAAQ;QAAI,OAAO,EAAE,MAAM;QAAW,EAAE,EAAE,OAAO;QAAW,IAAI,EAAE,MAAM;QAAW,MAAM,EAAE,QAAQ;;IACnG,OAAO;IACP,QAAQ;IACR,EAAE;IACF,MAAM;IACN,QAAQ;IACR,QAAQ,EAAE,cAAc;IACxB,GAAG;CACJ,CAAC;AACF,eAAO,MAAM,UAAU;;UAEM,CAAC,MAAM,EAAE,MAAM,CAAC;;QAC/B,IAAI,EAAE,MAAM;QAAW,KAAK,EAAE,OAAO;QAAW,IAAI,EAAE,MAAM;QAAW,MAAM,EAAE,QAAQ;QAAW,KAAK,EAAE,OAAO;;;;iBAExF,MAAM;;;;iBACL,OAAO;;;;;;cAKlC,UAAU;;CAErB,CAAC;AAEF,0GAA0G;AAC1G,eAAO,MAAM,KAAK;IAChB,OAAO;IACP,MAAM;QAAI,IAAI;QAAU,KAAK;QAAW,MAAM;QAAY,KAAK;QAAW,KAAK;QAAW,IAAI;QAAU,QAAQ;QAAc,OAAO;;IACrI,KAAK;QAAI,IAAI,EAAyB,CAAC,MAAM,EAAE,MAAM,CAAC;QAAE,KAAK,EAA0B,CAAC,MAAM,EAAE,MAAM,CAAC;;IACvG,IAAI,EAAqC,CAAC,MAAM,EAAE,MAAM,CAAC;IACzD,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,EAAE;IACF,QAAQ;IACR,QAAQ,EAAE,UAAU;IACpB,GAAG;CACJ,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,eAAe;IAC1B,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,OAAO;QAAI,MAAM;QAAe,KAAK;;IACrC,WAAW;IACX,gBAAgB;IAChB,UAAU;CACX,CAAC"}
@@ -41,3 +41,14 @@ export const YODEL = {
41
41
  approval: "per-wave",
42
42
  bin: "yodel chant",
43
43
  };
44
+ /** terragucci's plan note words (#4810), as its report/views.ts writes them. */
45
+ export const TERRAGUCCI_NOTE = {
46
+ footer: '<sub><img src="https://intentius.io/terragucci/brand/taco-small.png" width="26" height="16" alt=""> Posted by [terragucci](https://intentius.io/terragucci/)</sub>',
47
+ artifact: "terragucci-report",
48
+ noReport: "Planned in [this run]({run}), which keeps no report artifact; with `reports` set, the note links the report in the bucket.",
49
+ marker: "terragucci:waves",
50
+ anchors: { member: "root-{id}", group: "group-{id}" },
51
+ overrideKey: "policy.override",
52
+ approvalRulesKey: "approval_rules",
53
+ applyStage: "tf-apply",
54
+ };
@@ -0,0 +1,66 @@
1
+ /**
2
+ * terragucci's own Slack and Teams bodies, copied unchanged from
3
+ * packages/terragucci/src/notify.ts at terragucci commit c87473035270
4
+ * (origin/main, 2026-11-08), for #4818. chant's messages under terragucci's
5
+ * words must come out byte for byte as these do; once terragucci renders
6
+ * through chant's, it deletes the originals.
7
+ *
8
+ * Written here: the imports, `NOTIFY_SOURCE`, the notice types without the
9
+ * fields the renderers do not read, and `export` on `summary`. Every function
10
+ * body is terragucci's.
11
+ */
12
+ import { type RelayButtons } from "../notify.js";
13
+ export declare const REPLAN_ACTION = "terragucci-replan";
14
+ type WaveEvent = "waiting" | "refused" | "failed";
15
+ export interface WaveNotice {
16
+ event: WaveEvent;
17
+ wave: number;
18
+ project: string;
19
+ roots: string[];
20
+ approve: string;
21
+ digest?: string;
22
+ review?: {
23
+ pr: number;
24
+ url: string;
25
+ };
26
+ outcome?: string;
27
+ run?: string;
28
+ report?: string;
29
+ relay?: string;
30
+ }
31
+ export interface DriftNotice {
32
+ project: string;
33
+ roots: string[];
34
+ failed: string[];
35
+ run?: string;
36
+ report?: string;
37
+ replan?: string;
38
+ }
39
+ /** What happened to the wave: the first line, after `terragucci: `. */
40
+ export declare const summary: (n: WaveNotice) => string;
41
+ /** The first line of every message. */
42
+ export declare function headline(n: WaveNotice): string;
43
+ /**
44
+ * A Slack incoming webhook's body: one mrkdwn text. With the relay's signed
45
+ * button value (`relay`, which chant's sendNotify passes for a waiting wave
46
+ * when the relay key is set), the text as a block and chant's Approve and
47
+ * Decline buttons.
48
+ */
49
+ export declare function slackMessage(n: WaveNotice, relay?: RelayButtons): {
50
+ text: string;
51
+ blocks?: Record<string, unknown>[];
52
+ };
53
+ /** The Teams reply that approves or declines a waiting wave through the relay's outgoing webhook: a mention of the relay, then chant's reply. */
54
+ export declare const teamsReply: (n: Pick<WaveNotice, "relay">, relay: RelayButtons, action: "approve" | "decline") => string;
55
+ /** A Teams incoming webhook's body (a Workflows webhook): one Adaptive Card. Its actions open the pull request's review page, under pr-review, and the run. */
56
+ export declare function teamsMessage(n: WaveNotice, relay?: RelayButtons): Record<string, unknown>;
57
+ export declare const driftHeadline: (n: DriftNotice) => string;
58
+ /** The drift notice for Slack: the text, and a Re-plan button that opens the page where the check runs again. */
59
+ export declare function slackDrift(n: DriftNotice): {
60
+ text: string;
61
+ blocks?: Record<string, unknown>[];
62
+ };
63
+ /** The drift notice for Teams: an Adaptive Card whose Re-plan button opens the page where the check runs again. */
64
+ export declare function teamsDrift(n: DriftNotice): Record<string, unknown>;
65
+ export {};
66
+ //# sourceMappingURL=terragucci-notify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terragucci-notify.d.ts","sourceRoot":"","sources":["../../src/__fixtures__/terragucci-notify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAsC,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAGlF,eAAO,MAAM,aAAa,sBAAsB,CAAC;AACjD,KAAK,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAElD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAQD,uEAAuE;AACvE,eAAO,MAAM,OAAO,MAAO,UAAU,KAAG,MAA+D,CAAC;AAExG,uCAAuC;AACvC,wBAAgB,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,CAE9C;AASD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,YAAY,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CAAE,CAItH;AAeD,iJAAiJ;AACjJ,eAAO,MAAM,UAAU,MAAO,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,SAAS,YAAY,UAAU,SAAS,GAAG,SAAS,KAAG,MAAyD,CAAC;AAExK,+JAA+J;AAC/J,wBAAgB,YAAY,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiCzF;AAED,eAAO,MAAM,aAAa,MAAO,WAAW,KAAG,MACkM,CAAC;AAElP,iHAAiH;AACjH,wBAAgB,UAAU,CAAC,CAAC,EAAE,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CAAE,CAU/F;AAED,mHAAmH;AACnH,wBAAgB,UAAU,CAAC,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA0BlE"}
@@ -0,0 +1,133 @@
1
+ /**
2
+ * terragucci's own Slack and Teams bodies, copied unchanged from
3
+ * packages/terragucci/src/notify.ts at terragucci commit c87473035270
4
+ * (origin/main, 2026-11-08), for #4818. chant's messages under terragucci's
5
+ * words must come out byte for byte as these do; once terragucci renders
6
+ * through chant's, it deletes the originals.
7
+ *
8
+ * Written here: the imports, `NOTIFY_SOURCE`, the notice types without the
9
+ * fields the renderers do not read, and `export` on `summary`. Every function
10
+ * body is terragucci's.
11
+ */
12
+ import { slackRelayActions, teamsRelayReply } from "../notify.js";
13
+ const NOTIFY_SOURCE = "terragucci";
14
+ export const REPLAN_ACTION = "terragucci-replan";
15
+ const HEADLINE = {
16
+ waiting: "waits for an approval",
17
+ refused: "was refused: its plans changed after approval, so nothing in it was applied",
18
+ failed: "failed",
19
+ };
20
+ /** What happened to the wave: the first line, after `terragucci: `. */
21
+ export const summary = (n) => `wave ${n.wave} of ${n.project} ${HEADLINE[n.event]}`;
22
+ /** The first line of every message. */
23
+ export function headline(n) {
24
+ return `${NOTIFY_SOURCE}: ${summary(n)}`;
25
+ }
26
+ const rootsText = (n) => (n.roots.length > 0 ? n.roots.join(", ") : "see the run");
27
+ /** A Slack button. `url` makes it a link that opens a page. */
28
+ function slackButton(text, action, o) {
29
+ return { type: "button", action_id: action, text: { type: "plain_text", text }, ...(o.value ? { value: o.value } : {}), ...(o.url ? { url: o.url } : {}), ...(o.style ? { style: o.style } : {}) };
30
+ }
31
+ /**
32
+ * A Slack incoming webhook's body: one mrkdwn text. With the relay's signed
33
+ * button value (`relay`, which chant's sendNotify passes for a waiting wave
34
+ * when the relay key is set), the text as a block and chant's Approve and
35
+ * Decline buttons.
36
+ */
37
+ export function slackMessage(n, relay) {
38
+ const text = slackText(n);
39
+ if (!n.relay || !relay || n.event !== "waiting")
40
+ return { text };
41
+ return { text, blocks: [{ type: "section", text: { type: "mrkdwn", text } }, slackRelayActions(relay)] };
42
+ }
43
+ function slackText(n) {
44
+ return [
45
+ `*${headline(n)}*`,
46
+ ...(n.review ? [`Review and approve: <${n.review.url}|pull request ${n.review.pr}>, then run the wave again`] : []),
47
+ `Roots: ${rootsText(n)}`,
48
+ ...(n.digest ? [`Digest: \`${n.digest}\``] : []),
49
+ `${n.review ? "Or approve" : "Approve"}: \`${n.approve}\``,
50
+ ...(n.outcome ? [`Outcome: ${n.outcome}`] : []),
51
+ ...(n.run ? [`Run: <${n.run}>`] : []),
52
+ ...(n.report ? [`Report: <${n.report}>`] : []),
53
+ ].join("\n");
54
+ }
55
+ /** The Teams reply that approves or declines a waiting wave through the relay's outgoing webhook: a mention of the relay, then chant's reply. */
56
+ export const teamsReply = (n, relay, action) => `@${n.relay} ${teamsRelayReply(relay, action)}`;
57
+ /** A Teams incoming webhook's body (a Workflows webhook): one Adaptive Card. Its actions open the pull request's review page, under pr-review, and the run. */
58
+ export function teamsMessage(n, relay) {
59
+ const facts = [
60
+ { title: "Wave", value: String(n.wave) },
61
+ ...(n.review ? [{ title: "Review and approve", value: `pull request ${n.review.pr}, then run the wave again: ${n.review.url}` }] : []),
62
+ { title: "Roots", value: rootsText(n) },
63
+ ...(n.digest ? [{ title: "Digest", value: n.digest }] : []),
64
+ { title: n.review ? "Or approve" : "Approve", value: n.approve },
65
+ ...(n.outcome ? [{ title: "Outcome", value: n.outcome }] : []),
66
+ ...(n.run ? [{ title: "Run", value: n.run }] : []),
67
+ ];
68
+ return {
69
+ type: "message",
70
+ attachments: [
71
+ {
72
+ contentType: "application/vnd.microsoft.card.adaptive",
73
+ contentUrl: null,
74
+ content: {
75
+ $schema: "http://adaptivecards.io/schemas/adaptive-card.json",
76
+ type: "AdaptiveCard",
77
+ version: "1.4",
78
+ body: [
79
+ { type: "TextBlock", text: headline(n), weight: "Bolder", wrap: true },
80
+ { type: "FactSet", facts },
81
+ // Teams has no button that reaches a relay without a registered bot, so the card gives the reply its outgoing webhook reads.
82
+ ...(n.relay && relay && n.event === "waiting"
83
+ ? [{ type: "TextBlock", wrap: true, text: `Approve here: reply ${teamsReply(n, relay, "approve")}. Decline: reply ${teamsReply(n, relay, "decline")}.` }]
84
+ : []),
85
+ ],
86
+ ...(n.review || n.run ? { actions: [...(n.review ? [{ type: "Action.OpenUrl", title: "Review and approve", url: n.review.url }] : []), ...(n.run ? [{ type: "Action.OpenUrl", title: "Open the run", url: n.run }] : [])] } : {}),
87
+ },
88
+ },
89
+ ],
90
+ };
91
+ }
92
+ export const driftHeadline = (n) => `terragucci: drift in ${n.project}: ${n.roots.length > 0 ? `${n.roots.length} root${n.roots.length === 1 ? "" : "s"} changed outside Terraform` : "no drift found"}${n.failed.length > 0 ? `, ${n.failed.length} could not be refreshed` : ""}`;
93
+ /** The drift notice for Slack: the text, and a Re-plan button that opens the page where the check runs again. */
94
+ export function slackDrift(n) {
95
+ const text = [
96
+ `*${driftHeadline(n)}*`,
97
+ ...(n.roots.length > 0 ? [`Drifted: ${n.roots.join(", ")}`] : []),
98
+ ...(n.failed.length > 0 ? [`Not refreshed: ${n.failed.join(", ")}`] : []),
99
+ ...(n.run ? [`Run: <${n.run}>`] : []),
100
+ ...(n.report ? [`Report: <${n.report}>`] : []),
101
+ ].join("\n");
102
+ if (!n.replan)
103
+ return { text };
104
+ return { text, blocks: [{ type: "section", text: { type: "mrkdwn", text } }, { type: "actions", block_id: "terragucci-drift", elements: [slackButton("Re-plan", REPLAN_ACTION, { url: n.replan })] }] };
105
+ }
106
+ /** The drift notice for Teams: an Adaptive Card whose Re-plan button opens the page where the check runs again. */
107
+ export function teamsDrift(n) {
108
+ const facts = [
109
+ ...(n.roots.length > 0 ? [{ title: "Drifted", value: n.roots.join(", ") }] : []),
110
+ ...(n.failed.length > 0 ? [{ title: "Not refreshed", value: n.failed.join(", ") }] : []),
111
+ ...(n.run ? [{ title: "Run", value: n.run }] : []),
112
+ ];
113
+ const actions = [...(n.replan ? [{ type: "Action.OpenUrl", title: "Re-plan", url: n.replan }] : []), ...(n.run ? [{ type: "Action.OpenUrl", title: "Open the run", url: n.run }] : [])];
114
+ return {
115
+ type: "message",
116
+ attachments: [
117
+ {
118
+ contentType: "application/vnd.microsoft.card.adaptive",
119
+ contentUrl: null,
120
+ content: {
121
+ $schema: "http://adaptivecards.io/schemas/adaptive-card.json",
122
+ type: "AdaptiveCard",
123
+ version: "1.4",
124
+ body: [
125
+ { type: "TextBlock", text: driftHeadline(n), weight: "Bolder", wrap: true },
126
+ { type: "FactSet", facts },
127
+ ],
128
+ ...(actions.length > 0 ? { actions } : {}),
129
+ },
130
+ },
131
+ ],
132
+ };
133
+ }
@@ -9,10 +9,17 @@
9
9
  * forgejo lexicon moves `upload-artifact` and `download-artifact` to v3, whose
10
10
  * rows are here too: v4 and later refuse to run on a Forgejo runner (#4008).
11
11
  *
12
+ * actions/cache has a v4 row beside v6 (#4816): terragucci's Terragrunt cache
13
+ * step uses the action itself at the commit the restore and save rows pin.
14
+ * It follows them in the table, so `pinAtMajor` on that shared commit still
15
+ * starts from the restore row.
16
+ *
12
17
  * Refresh a row by resolving the major tag to its commit:
13
18
  *
14
19
  * gh api repos/actions/checkout/commits/v6 --jq .sha
15
20
  */
21
+ /** The first chant whose table has the `cache4` row (#4816). */
22
+ export declare const CACHE4_PIN_FLOOR = "0.124.78";
16
23
  export interface ActionPin {
17
24
  /** The action, with its subpath: `actions/cache/restore`. */
18
25
  readonly slug: string;
@@ -43,6 +50,7 @@ export declare const ACTION_PINS: {
43
50
  readonly createGithubAppToken2: ActionPin;
44
51
  readonly cacheRestore4: ActionPin;
45
52
  readonly cacheSave4: ActionPin;
53
+ readonly cache4: ActionPin;
46
54
  readonly uploadArtifact4: ActionPin;
47
55
  readonly uploadArtifact3: ActionPin;
48
56
  readonly downloadArtifact4: ActionPin;
@@ -1 +1 @@
1
- {"version":3,"file":"action-pins.d.ts","sourceRoot":"","sources":["../src/action-pins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,SAAS;IACxB,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,mEAAmE;IACnE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAID,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;CAyBsB,CAAC;AAE/C,6DAA6D;AAC7D,eAAO,MAAM,OAAO,MAAO,SAAS,KAAG,MAA8B,CAAC;AAKtE,8IAA8I;AAC9I,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKhD;AAED,sKAAsK;AACtK,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAQtD;AAED,8IAA8I;AAC9I,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAI5E;AAED,mFAAmF;AACnF,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGxD"}
1
+ {"version":3,"file":"action-pins.d.ts","sourceRoot":"","sources":["../src/action-pins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,gEAAgE;AAChE,eAAO,MAAM,gBAAgB,aAAe,CAAC;AAE7C,MAAM,WAAW,SAAS;IACxB,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,mEAAmE;IACnE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAID,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BsB,CAAC;AAE/C,6DAA6D;AAC7D,eAAO,MAAM,OAAO,MAAO,SAAS,KAAG,MAA8B,CAAC;AAKtE,8IAA8I;AAC9I,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKhD;AAED,sKAAsK;AACtK,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAQtD;AAED,8IAA8I;AAC9I,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAI5E;AAED,mFAAmF;AACnF,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGxD"}
@@ -9,10 +9,18 @@
9
9
  * forgejo lexicon moves `upload-artifact` and `download-artifact` to v3, whose
10
10
  * rows are here too: v4 and later refuse to run on a Forgejo runner (#4008).
11
11
  *
12
+ * actions/cache has a v4 row beside v6 (#4816): terragucci's Terragrunt cache
13
+ * step uses the action itself at the commit the restore and save rows pin.
14
+ * It follows them in the table, so `pinAtMajor` on that shared commit still
15
+ * starts from the restore row.
16
+ *
12
17
  * Refresh a row by resolving the major tag to its commit:
13
18
  *
14
19
  * gh api repos/actions/checkout/commits/v6 --jq .sha
15
20
  */
21
+ import { NEXT_RELEASE } from "./release-floors.js";
22
+ /** The first chant whose table has the `cache4` row (#4816). */
23
+ export const CACHE4_PIN_FLOOR = NEXT_RELEASE;
16
24
  const pin = (slug, major, sha, tag) => ({ slug, major, sha, tag });
17
25
  export const ACTION_PINS = {
18
26
  checkout7: pin("actions/checkout", "v7", "3d3c42e5aac5ba805825da76410c181273ba90b1", "v7.0.1"),
@@ -35,6 +43,7 @@ export const ACTION_PINS = {
35
43
  createGithubAppToken2: pin("actions/create-github-app-token", "v2", "fee1f7d63c2ff003460e3d139729b119787bc349", "v2.2.2"),
36
44
  cacheRestore4: pin("actions/cache/restore", "v4", "0057852bfaa89a56745cba8c7296529d2fc39830", "v4.3.0"),
37
45
  cacheSave4: pin("actions/cache/save", "v4", "0057852bfaa89a56745cba8c7296529d2fc39830", "v4.3.0"),
46
+ cache4: pin("actions/cache", "v4", "0057852bfaa89a56745cba8c7296529d2fc39830", "v4.3.0"),
38
47
  uploadArtifact4: pin("actions/upload-artifact", "v4", "ea165f8d65b6e75b540449e92b4886f43607fa02", "v4.6.2"),
39
48
  uploadArtifact3: pin("actions/upload-artifact", "v3", "ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5", "v3.2.1"),
40
49
  downloadArtifact4: pin("actions/download-artifact", "v4", "d3f86a106a0bac45b974a628896c90dbdf5c8093", "v4.3.0"),
@@ -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