@intentius/chant-lexicon-terraform 0.124.52 → 0.124.54

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 (336) hide show
  1. package/README.md +7 -6
  2. package/dist/__fixtures__/pr-loop/estate.component.d.ts +7 -0
  3. package/dist/__fixtures__/pr-loop/estate.component.d.ts.map +1 -0
  4. package/dist/__fixtures__/pr-loop/estate.component.js +7 -0
  5. package/dist/__fixtures__/report/generate.d.ts +26 -0
  6. package/dist/__fixtures__/report/generate.d.ts.map +1 -0
  7. package/dist/__fixtures__/report/generate.js +58 -0
  8. package/dist/applied-state.d.ts +27 -0
  9. package/dist/applied-state.d.ts.map +1 -0
  10. package/dist/applied-state.js +44 -0
  11. package/dist/backend-config.d.ts +53 -0
  12. package/dist/backend-config.d.ts.map +1 -0
  13. package/dist/backend-config.js +136 -0
  14. package/dist/behaviour/kinds.d.ts.map +1 -1
  15. package/dist/behaviour/kinds.js +4 -0
  16. package/dist/behaviour/predict.d.ts.map +1 -1
  17. package/dist/behaviour/predict.js +6 -2
  18. package/dist/behaviour/reference-catalog.d.ts +16 -5
  19. package/dist/behaviour/reference-catalog.d.ts.map +1 -1
  20. package/dist/behaviour/reference-catalog.js +16 -5
  21. package/dist/behaviour/request.d.ts.map +1 -1
  22. package/dist/behaviour/request.js +3 -2
  23. package/dist/changed-roots.d.ts +6 -4
  24. package/dist/changed-roots.d.ts.map +1 -1
  25. package/dist/changed-roots.js +14 -18
  26. package/dist/commands.d.ts.map +1 -1
  27. package/dist/commands.js +4 -3
  28. package/dist/components/capability-plugin.d.ts +65 -3
  29. package/dist/components/capability-plugin.d.ts.map +1 -1
  30. package/dist/components/capability-plugin.js +197 -13
  31. package/dist/components/compose-group.d.ts +145 -0
  32. package/dist/components/compose-group.d.ts.map +1 -0
  33. package/dist/components/compose-group.js +407 -0
  34. package/dist/components/placeholder-preview.d.ts +78 -0
  35. package/dist/components/placeholder-preview.d.ts.map +1 -0
  36. package/dist/components/placeholder-preview.js +254 -0
  37. package/dist/compose/apply-events.d.ts +46 -0
  38. package/dist/compose/apply-events.d.ts.map +1 -0
  39. package/dist/compose/apply-events.js +77 -0
  40. package/dist/compose/estate.d.ts +194 -0
  41. package/dist/compose/estate.d.ts.map +1 -0
  42. package/dist/compose/estate.js +363 -0
  43. package/dist/compose/hcl.d.ts +99 -0
  44. package/dist/compose/hcl.d.ts.map +1 -0
  45. package/dist/compose/hcl.js +302 -0
  46. package/dist/compose/module-address.d.ts +24 -0
  47. package/dist/compose/module-address.d.ts.map +1 -0
  48. package/dist/compose/module-address.js +43 -0
  49. package/dist/compose/root.d.ts +127 -0
  50. package/dist/compose/root.d.ts.map +1 -0
  51. package/dist/compose/root.js +586 -0
  52. package/dist/compose/run.d.ts +183 -0
  53. package/dist/compose/run.d.ts.map +1 -0
  54. package/dist/compose/run.js +447 -0
  55. package/dist/compose/slice.d.ts +102 -0
  56. package/dist/compose/slice.d.ts.map +1 -0
  57. package/dist/compose/slice.js +249 -0
  58. package/dist/compose/state-address.d.ts +28 -0
  59. package/dist/compose/state-address.d.ts.map +1 -0
  60. package/dist/compose/state-address.js +154 -0
  61. package/dist/compose/state-merge.d.ts +52 -0
  62. package/dist/compose/state-merge.d.ts.map +1 -0
  63. package/dist/compose/state-merge.js +135 -0
  64. package/dist/compose.d.ts +179 -0
  65. package/dist/compose.d.ts.map +1 -0
  66. package/dist/compose.js +482 -0
  67. package/dist/composites/terraform-apply-op.d.ts.map +1 -1
  68. package/dist/composites/terraform-apply-op.js +7 -3
  69. package/dist/config.d.ts +59 -13
  70. package/dist/config.d.ts.map +1 -1
  71. package/dist/config.js +43 -9
  72. package/dist/describe-resources.d.ts +74 -12
  73. package/dist/describe-resources.d.ts.map +1 -1
  74. package/dist/describe-resources.js +374 -66
  75. package/dist/drift-read.d.ts +33 -0
  76. package/dist/drift-read.d.ts.map +1 -0
  77. package/dist/drift-read.js +243 -0
  78. package/dist/drift-record.d.ts +147 -0
  79. package/dist/drift-record.d.ts.map +1 -0
  80. package/dist/drift-record.js +383 -0
  81. package/dist/hcl/edges.d.ts.map +1 -1
  82. package/dist/hcl/edges.js +24 -1
  83. package/dist/hcl/files.d.ts +61 -0
  84. package/dist/hcl/files.d.ts.map +1 -0
  85. package/dist/hcl/files.js +221 -0
  86. package/dist/hcl/instances.d.ts +82 -0
  87. package/dist/hcl/instances.d.ts.map +1 -0
  88. package/dist/hcl/instances.js +390 -0
  89. package/dist/hcl/parse.d.ts +81 -9
  90. package/dist/hcl/parse.d.ts.map +1 -1
  91. package/dist/hcl/parse.js +114 -16
  92. package/dist/hcl/roots.d.ts.map +1 -1
  93. package/dist/hcl/roots.js +5 -0
  94. package/dist/hcl/suppressions.d.ts.map +1 -1
  95. package/dist/hcl/suppressions.js +8 -2
  96. package/dist/index.d.ts +11 -2
  97. package/dist/index.d.ts.map +1 -1
  98. package/dist/index.js +21 -2
  99. package/dist/integrity.json +3 -3
  100. package/dist/live-plan-reasons.d.ts +21 -0
  101. package/dist/live-plan-reasons.d.ts.map +1 -0
  102. package/dist/live-plan-reasons.js +47 -0
  103. package/dist/lsp/option-keys.d.ts.map +1 -1
  104. package/dist/lsp/option-keys.js +2 -0
  105. package/dist/manifest.json +1 -1
  106. package/dist/op/activities/index.d.ts +6 -2
  107. package/dist/op/activities/index.d.ts.map +1 -1
  108. package/dist/op/activities/index.js +5 -1
  109. package/dist/op/activities/live-detect.d.ts +4 -3
  110. package/dist/op/activities/live-detect.d.ts.map +1 -1
  111. package/dist/op/activities/live-detect.js +57 -32
  112. package/dist/op/activities/pin-rollout.d.ts +2 -0
  113. package/dist/op/activities/pin-rollout.d.ts.map +1 -1
  114. package/dist/op/activities/pin-rollout.js +1 -0
  115. package/dist/op/activities/terraform.d.ts +153 -5
  116. package/dist/op/activities/terraform.d.ts.map +1 -1
  117. package/dist/op/activities/terraform.js +205 -20
  118. package/dist/op/activity-contracts.d.ts +27 -0
  119. package/dist/op/activity-contracts.d.ts.map +1 -1
  120. package/dist/op/activity-contracts.js +19 -1
  121. package/dist/op/builders.d.ts +7 -1
  122. package/dist/op/builders.d.ts.map +1 -1
  123. package/dist/op/builders.js +9 -0
  124. package/dist/pin/edit.d.ts.map +1 -1
  125. package/dist/pin/edit.js +35 -0
  126. package/dist/pin/rollout.d.ts +2 -0
  127. package/dist/pin/rollout.d.ts.map +1 -1
  128. package/dist/pin/rollout.js +14 -11
  129. package/dist/plan-shape.d.ts +30 -0
  130. package/dist/plan-shape.d.ts.map +1 -0
  131. package/dist/plan-shape.js +125 -0
  132. package/dist/plugin.d.ts.map +1 -1
  133. package/dist/plugin.js +32 -18
  134. package/dist/report.d.ts +15 -6
  135. package/dist/report.d.ts.map +1 -1
  136. package/dist/report.js +28 -55
  137. package/dist/skills/chant-terraform.md +1 -1
  138. package/dist/state/azure-blob.d.ts +68 -0
  139. package/dist/state/azure-blob.d.ts.map +1 -0
  140. package/dist/state/azure-blob.js +201 -0
  141. package/dist/state/backend.d.ts +158 -0
  142. package/dist/state/backend.d.ts.map +1 -0
  143. package/dist/state/backend.js +406 -0
  144. package/dist/state/exec.d.ts +39 -0
  145. package/dist/state/exec.d.ts.map +1 -0
  146. package/dist/state/exec.js +80 -0
  147. package/dist/state/gcs.d.ts +62 -0
  148. package/dist/state/gcs.d.ts.map +1 -0
  149. package/dist/state/gcs.js +224 -0
  150. package/dist/state/index.d.ts +15 -0
  151. package/dist/state/index.d.ts.map +1 -0
  152. package/dist/state/index.js +14 -0
  153. package/dist/state/locks.d.ts +105 -0
  154. package/dist/state/locks.d.ts.map +1 -0
  155. package/dist/state/locks.js +130 -0
  156. package/dist/state/object-store.d.ts +37 -0
  157. package/dist/state/object-store.d.ts.map +1 -0
  158. package/dist/state/object-store.js +20 -0
  159. package/dist/state/root-states.d.ts +131 -0
  160. package/dist/state/root-states.d.ts.map +1 -0
  161. package/dist/state/root-states.js +241 -0
  162. package/dist/state/s3.d.ts +68 -0
  163. package/dist/state/s3.d.ts.map +1 -0
  164. package/dist/state/s3.js +170 -0
  165. package/dist/state/store.d.ts +51 -0
  166. package/dist/state/store.d.ts.map +1 -0
  167. package/dist/state/store.js +185 -0
  168. package/dist/terragrunt/affected.d.ts.map +1 -1
  169. package/dist/terragrunt/affected.js +2 -1
  170. package/package.json +7 -3
  171. package/src/__fixtures__/ACCEPTANCE.md +69 -7
  172. package/src/__fixtures__/compose/apply-failed-in-app.jsonl +12 -0
  173. package/src/__fixtures__/compose/state-app.json +66 -0
  174. package/src/__fixtures__/compose/state-edge.json +40 -0
  175. package/src/__fixtures__/compose/state-net.json +58 -0
  176. package/src/__fixtures__/compose/three-app.plan.json +184 -0
  177. package/src/__fixtures__/compose/three-composed.plan.json +509 -0
  178. package/src/__fixtures__/compose/three-edge.plan.json +144 -0
  179. package/src/__fixtures__/compose/three-net.plan.json +174 -0
  180. package/src/__fixtures__/compose/unknown-composed.plan.json +228 -0
  181. package/src/__fixtures__/compose/working-after-apply.json +145 -0
  182. package/src/__fixtures__/config-blocks/app/main.tf +61 -0
  183. package/src/__fixtures__/config-blocks/app/modules/network/main.tf +4 -0
  184. package/src/__fixtures__/config-blocks/app-json/main.tf.json +39 -0
  185. package/src/__fixtures__/config-files/shadow/main.tf +3 -0
  186. package/src/__fixtures__/config-files/shadow/main.tofu +3 -0
  187. package/src/__fixtures__/config-files/shadow/other.tf +3 -0
  188. package/src/__fixtures__/config-files/tf/main.tf +11 -0
  189. package/src/__fixtures__/config-files/tf-json/main.tf.json +18 -0
  190. package/src/__fixtures__/config-files/tofu/main.tofu +11 -0
  191. package/src/__fixtures__/config-files/tofu-json/main.tofu.json +18 -0
  192. package/src/__fixtures__/config-files/tofu-only/main.tofu +3 -0
  193. package/src/__fixtures__/drift-record/README.md +11 -0
  194. package/src/__fixtures__/drift-record/live-plan-sections.json +27 -0
  195. package/src/__fixtures__/instance-forms/app/main.tf +110 -0
  196. package/src/__fixtures__/instance-forms/app/modules/svc/main.tf +3 -0
  197. package/src/__fixtures__/instance-vars/app/main.tf +52 -0
  198. package/src/__fixtures__/instance-vars/app/modules/app/main.tf +12 -0
  199. package/src/__fixtures__/instance-vars/app/modules/edge/main.tf +3 -0
  200. package/src/__fixtures__/instance-vars/app/terraform.tfvars +1 -0
  201. package/src/__fixtures__/live-module-keyed/live-graph.json +259 -0
  202. package/src/__fixtures__/live-module-keyed/live-plan.json +87 -0
  203. package/src/__fixtures__/live-module-keyed/root/estate.chdf.hcl +1 -0
  204. package/src/__fixtures__/live-module-keyed/root/main.tf +21 -0
  205. package/src/__fixtures__/live-module-keyed/root/modules/app/main.tf +17 -0
  206. package/src/__fixtures__/live-module-keyed/root/modules/edge/main.tf +7 -0
  207. package/src/__fixtures__/live-module-keyed/root/versions.tf +30 -0
  208. package/src/__fixtures__/live-module-keyed/show-state.json +146 -0
  209. package/src/__fixtures__/pr-loop/README.md +50 -0
  210. package/src/__fixtures__/pr-loop/chant.config.json +13 -0
  211. package/src/__fixtures__/pr-loop/estate.component.ts +10 -0
  212. package/src/__fixtures__/pr-loop/roots/a/main.tf +11 -0
  213. package/src/__fixtures__/pr-loop/roots/app/main.tf +19 -0
  214. package/src/__fixtures__/pr-loop/roots/b/main.tf +7 -0
  215. package/src/__fixtures__/pr-loop/roots/dns/main.tf +3 -0
  216. package/src/__fixtures__/pr-loop/roots/net/main.tf +7 -0
  217. package/src/__fixtures__/report/applied.show.json +51 -0
  218. package/src/__fixtures__/report/generate.ts +63 -0
  219. package/src/__fixtures__/report/plan.show.json +200 -0
  220. package/src/__fixtures__/report/tf-apply/change-set.json +170 -0
  221. package/src/__fixtures__/report/tf-apply/report.json +338 -0
  222. package/src/__fixtures__/report/tf-plan/change-set.json +170 -0
  223. package/src/__fixtures__/report/tf-plan/report.json +320 -0
  224. package/src/__fixtures__/three-cloud-azure.graph.json +290 -0
  225. package/src/applied-state.ts +52 -0
  226. package/src/backend-config.test.ts +105 -0
  227. package/src/backend-config.ts +133 -0
  228. package/src/behaviour/kinds.ts +4 -0
  229. package/src/behaviour/predict.ts +5 -2
  230. package/src/behaviour/reference-catalog.plugin.test.ts +65 -0
  231. package/src/behaviour/reference-catalog.ts +16 -5
  232. package/src/behaviour/request.ts +3 -2
  233. package/src/change-set-instances.test.ts +98 -0
  234. package/src/changed-roots.ts +14 -16
  235. package/src/commands.ts +4 -3
  236. package/src/components/capability-plugin.test.ts +172 -5
  237. package/src/components/capability-plugin.ts +212 -11
  238. package/src/components/change-set-graph.e2e.test.ts +11 -5
  239. package/src/components/compose-group.test.ts +486 -0
  240. package/src/components/compose-group.ts +489 -0
  241. package/src/components/demo-composed-roots.e2e.test.ts +440 -0
  242. package/src/components/member-outputs.test.ts +76 -0
  243. package/src/components/placeholder-preview.test.ts +147 -0
  244. package/src/components/placeholder-preview.ts +257 -0
  245. package/src/components/pr-loop-compose.tofu.e2e.test.ts +363 -0
  246. package/src/components/pr-loop.tofu.test.ts +112 -56
  247. package/src/compose/apply-events.test.ts +62 -0
  248. package/src/compose/apply-events.ts +100 -0
  249. package/src/compose/estate.choudoufu.e2e.test.ts +112 -0
  250. package/src/compose/estate.test.ts +421 -0
  251. package/src/compose/estate.ts +443 -0
  252. package/src/compose/hcl.ts +311 -0
  253. package/src/compose/module-address.ts +49 -0
  254. package/src/compose/root.test.ts +416 -0
  255. package/src/compose/root.ts +592 -0
  256. package/src/compose/run.test.ts +440 -0
  257. package/src/compose/run.tofu.test.ts +176 -0
  258. package/src/compose/run.ts +527 -0
  259. package/src/compose/slice.test.ts +184 -0
  260. package/src/compose/slice.ts +290 -0
  261. package/src/compose/state-address.ts +157 -0
  262. package/src/compose/state-merge.test.ts +131 -0
  263. package/src/compose/state-merge.ts +148 -0
  264. package/src/compose.test.ts +248 -0
  265. package/src/compose.ts +627 -0
  266. package/src/composites/terraform-apply-op.test.ts +9 -0
  267. package/src/composites/terraform-apply-op.ts +7 -3
  268. package/src/config-file-listers.test.ts +265 -0
  269. package/src/config.ts +44 -9
  270. package/src/describe-resources.engine-facts.test.ts +412 -0
  271. package/src/describe-resources.live-module-keyed.test.ts +290 -0
  272. package/src/describe-resources.ts +416 -70
  273. package/src/drift-read.ts +284 -0
  274. package/src/drift-record.test.ts +223 -0
  275. package/src/drift-record.ts +455 -0
  276. package/src/hcl/config-blocks.test.ts +174 -0
  277. package/src/hcl/edges.ts +21 -1
  278. package/src/hcl/files.ts +234 -0
  279. package/src/hcl/instance-forms.test.ts +94 -0
  280. package/src/hcl/instances.test.ts +137 -0
  281. package/src/hcl/instances.ts +422 -0
  282. package/src/hcl/parse.test.ts +139 -1
  283. package/src/hcl/parse.ts +149 -16
  284. package/src/hcl/roots.ts +6 -0
  285. package/src/hcl/suppressions.ts +8 -2
  286. package/src/index.ts +76 -0
  287. package/src/live-plan-reasons.ts +54 -0
  288. package/src/lsp/completions.test.ts +1 -1
  289. package/src/lsp/option-keys.ts +2 -0
  290. package/src/op/activities/choudoufu-plan-set-op.test.ts +111 -0
  291. package/src/op/activities/index.ts +9 -0
  292. package/src/op/activities/live-detect.ts +55 -26
  293. package/src/op/activities/pin-rollout.ts +3 -0
  294. package/src/op/activities/registry.test.ts +2 -1
  295. package/src/op/activities/terraform.test.ts +55 -0
  296. package/src/op/activities/terraform.ts +266 -22
  297. package/src/op/activity-contracts.test.ts +1 -0
  298. package/src/op/activity-contracts.ts +24 -1
  299. package/src/op/builders.ts +14 -0
  300. package/src/pin/bundle.test.ts +2 -0
  301. package/src/pin/edit.ts +30 -0
  302. package/src/pin/rollout.ts +16 -11
  303. package/src/plan-shape.test.ts +148 -0
  304. package/src/plan-shape.ts +128 -0
  305. package/src/plugin.ts +33 -19
  306. package/src/report.test.ts +82 -1
  307. package/src/report.ts +31 -54
  308. package/src/signal-only-root.test.ts +72 -0
  309. package/src/skills/chant-terraform.md +1 -1
  310. package/src/state/azure-blob.ts +223 -0
  311. package/src/state/backend-verdict.test.ts +187 -0
  312. package/src/state/backend.test.ts +127 -0
  313. package/src/state/backend.ts +488 -0
  314. package/src/state/exec.ts +111 -0
  315. package/src/state/gcs.ts +254 -0
  316. package/src/state/index.ts +15 -0
  317. package/src/state/locks.test.ts +84 -0
  318. package/src/state/locks.ts +201 -0
  319. package/src/state/object-store.ts +35 -0
  320. package/src/state/root-states-floci.e2e.test.ts +66 -0
  321. package/src/state/root-states.test.ts +462 -0
  322. package/src/state/root-states.ts +309 -0
  323. package/src/state/s3.ts +193 -0
  324. package/src/state/store.ts +225 -0
  325. package/src/terragrunt/affected.ts +2 -1
  326. package/src/workspace-kinds.test.ts +4 -17
  327. package/workspace-kinds.json +1 -24
  328. package/dist/workspace-member.d.ts +0 -30
  329. package/dist/workspace-member.d.ts.map +0 -1
  330. package/dist/workspace-member.js +0 -91
  331. package/schemas/pulumi.schema.json +0 -34
  332. package/src/testdata/pulumi-member/Pulumi.yaml +0 -2
  333. package/src/testdata/pulumi-member/stack-export.json +0 -53
  334. package/src/testdata/pulumi-unexported/Pulumi.yaml +0 -2
  335. package/src/workspace-member.test.ts +0 -89
  336. package/src/workspace-member.ts +0 -126
package/dist/hcl/parse.js CHANGED
@@ -1,11 +1,13 @@
1
1
  /**
2
2
  * The one shared HCL parse for the terraform lexicon.
3
3
  *
4
- * Two entry points, one entity shape. `parseTerraformRootDir` reads the `.tf`
5
- * files of a directory (non-recursive, matching Terraform's own module
6
- * scoping) and is what `buildRoots()` calls. `parseTerraformRootContent` takes
7
- * the joined-file string `chant audit` hands a lexicon for a discovered root
8
- * module: every `.tf` in filename order behind a `# file: <name>` line comment.
4
+ * Two entry points, one entity shape. `parseTerraformRootDir` reads the
5
+ * configuration files of a directory (non-recursive, matching Terraform's own
6
+ * module scoping; `.tf` and `.tf.json`, plus `.tofu` and `.tofu.json` for a
7
+ * tofu or choudoufu root, see `./files.ts`) and is what `buildRoots()` calls.
8
+ * `parseTerraformRootContent` takes the joined-file string `chant audit` hands
9
+ * a lexicon for a discovered root module: every configuration file in filename
10
+ * order behind a `# file: <name>` line comment, narrowed to the same set.
9
11
  * Both funnel through `blocksToEntities`, so an entity the audit path sees is
10
12
  * the entity the build path sees.
11
13
  *
@@ -17,12 +19,14 @@
17
19
  * core's exports map already carries (`"./*"` to `./src/*.ts`), so nothing
18
20
  * changed in `packages/core/package.json` for this.
19
21
  */
20
- import { existsSync, readdirSync, readFileSync } from "node:fs";
22
+ import { existsSync, readFileSync } from "node:fs";
21
23
  import { join } from "node:path";
22
24
  import { loadHcl2json } from "@intentius/chant/terraform/hcl2json";
23
25
  import { DECLARABLE_MARKER } from "@intentius/chant/declarable";
24
26
  import { redactSensitiveBody, redactSensitiveSource } from "./redact.js";
25
27
  import { scanSuppressions, directivesFor } from "./suppressions.js";
28
+ import { isJsonConfigFile, jsonConfigTree, listConfigFiles, selectConfigFiles } from "./files.js";
29
+ export { TERRAFORM_SUFFIXES, TOFU_SUFFIXES, isConfigFileFor, isJsonConfigFile, isTofuConfigFile, jsonConfigTree, listConfigFiles, listConfigFilesSafe, readsTofuFiles, selectConfigFiles, } from "./files.js";
26
30
  /** `entityType` per block kind. */
27
31
  export const TERRAFORM_TYPE = "Terraform::Terraform";
28
32
  export const PROVIDER_TYPE = "Terraform::Provider";
@@ -34,6 +38,23 @@ export const OUTPUT_TYPE = "Terraform::Output";
34
38
  export const LOCALS_TYPE = "Terraform::Locals";
35
39
  /** A `live { estate = "..." }` block, or an `estate.chdf.hcl` sidecar's content (#2103). */
36
40
  export const LIVE_TYPE = "Terraform::Live";
41
+ /**
42
+ * The four configuration blocks that change how a plan treats addresses
43
+ * rather than declaring anything (#4458): `moved`, `import`, `removed` and
44
+ * `check`. The first three carry no label and key as `moved`, `import`,
45
+ * `removed` (numbered `~2`, `~3` when a root holds several, as `locals` is);
46
+ * a `check` keys as `check.<name>`. Their references are edges like any other
47
+ * block's: a `moved` block's `from` and `to`, an `import` block's `to`, a
48
+ * `removed` block's `from`, and everything a `check` block's assertions and
49
+ * scoped `data` blocks read. A `from` usually names an address that is no
50
+ * longer declared, which resolves to no entity and so draws no edge, and
51
+ * that is all that happens: an unresolved reference is dropped, never
52
+ * reported (`./edges.ts`).
53
+ */
54
+ export const MOVED_TYPE = "Terraform::Moved";
55
+ export const IMPORT_TYPE = "Terraform::Import";
56
+ export const REMOVED_TYPE = "Terraform::Removed";
57
+ export const CHECK_TYPE = "Terraform::Check";
37
58
  /**
38
59
  * Terragrunt config entities (#3417). A `terragrunt.hcl` or `root.hcl` is not
39
60
  * a Terraform module, so its blocks are read into these types and never into
@@ -61,6 +82,58 @@ function expansionOf(body) {
61
82
  return "for_each";
62
83
  return undefined;
63
84
  }
85
+ /** The most instance keys read off one literal; past it the block draws as the block alone. */
86
+ const MAX_LITERAL_INSTANCES = 256;
87
+ /**
88
+ * The instance keys a literal expansion gives (#4454), as Terraform prints
89
+ * them, or undefined when the expansion is not a literal a read of the
90
+ * source can count. `count` as a number (`count = 3`), `for_each` as a
91
+ * literal map (`{ a = 1 }`, keys in Terraform's lexical order) or
92
+ * `toset([...])` over string literals. Anything holding a reference is a
93
+ * plan-time answer.
94
+ */
95
+ export function literalInstanceKeys(body) {
96
+ const keys = literalKeys(body);
97
+ if (keys === undefined || keys.length > MAX_LITERAL_INSTANCES)
98
+ return undefined;
99
+ return keys;
100
+ }
101
+ function literalKeys(body) {
102
+ if ("count" in body) {
103
+ const count = body.count;
104
+ const n = typeof count === "number" ? count
105
+ : typeof count === "string" && /^\$\{\s*\d+\s*\}$/.test(count.trim()) ? Number(count.trim().slice(2, -1))
106
+ : undefined;
107
+ if (n === undefined || !Number.isInteger(n) || n < 0)
108
+ return undefined;
109
+ return Array.from({ length: n }, (_, i) => `[${i}]`);
110
+ }
111
+ if ("for_each" in body) {
112
+ const each = body.for_each;
113
+ if (typeof each === "object" && each !== null && !Array.isArray(each)) {
114
+ const names = Object.keys(each);
115
+ if (names.some((k) => k.includes("${")))
116
+ return undefined;
117
+ return names.sort().map((k) => `[${JSON.stringify(k)}]`);
118
+ }
119
+ if (typeof each === "string") {
120
+ const m = /^\$\{\s*toset\(\s*(\[[\s\S]*\])\s*\)\s*\}$/.exec(each.trim());
121
+ if (!m)
122
+ return undefined;
123
+ let list;
124
+ try {
125
+ list = JSON.parse(m[1].replace(/,\s*\]$/, "]"));
126
+ }
127
+ catch {
128
+ return undefined;
129
+ }
130
+ if (!Array.isArray(list) || !list.every((v) => typeof v === "string"))
131
+ return undefined;
132
+ return [...new Set(list)].sort().map((k) => `[${JSON.stringify(k)}]`);
133
+ }
134
+ }
135
+ return undefined;
136
+ }
64
137
  /**
65
138
  * Build one entity. Written out rather than run through `createResource`
66
139
  * from `@intentius/chant/runtime`: that factory is for generated resource
@@ -71,6 +144,7 @@ function expansionOf(body) {
71
144
  */
72
145
  export function terraformEntity(entityType, address, body, file, root, extra, source = "", line, suppressions) {
73
146
  const expansion = expansionOf(body);
147
+ const instanceKeys = expansion && (entityType === RESOURCE_TYPE || entityType === DATA_TYPE) ? literalInstanceKeys(body) : undefined;
74
148
  const labels = entityType === RESOURCE_TYPE ? blockLabels(address)
75
149
  : entityType === DATA_TYPE && address.startsWith("data.") ? blockLabels(address.slice("data.".length))
76
150
  : undefined;
@@ -80,6 +154,7 @@ export function terraformEntity(entityType, address, body, file, root, extra, so
80
154
  entityType,
81
155
  kind: "resource",
82
156
  stack: root,
157
+ ...(instanceKeys ? { instanceKeys } : {}),
83
158
  props: {
84
159
  address,
85
160
  ...(labels ?? {}),
@@ -130,11 +205,20 @@ export function splitBundleContent(content, fallbackName = "main.tf") {
130
205
  }
131
206
  return files.filter((f) => f.source.trim() !== "");
132
207
  }
133
- /** Every `.tf` directly under `dir`, in filename order. Non-recursive. */
134
- export function listTerraformFiles(dir) {
135
- return readdirSync(dir)
136
- .filter((f) => f.endsWith(".tf"))
137
- .sort();
208
+ /**
209
+ * Every configuration file directly under `dir` that a root run by `binary`
210
+ * reads, in filename order, non-recursive: `.tf` and `.tf.json`, plus `.tofu`
211
+ * and `.tofu.json` for a tofu or choudoufu root, with `x.tofu` shadowing
212
+ * `x.tf` (chant#4457). The shared lister is `./files.ts`'s `listConfigFiles`.
213
+ */
214
+ export function listTerraformFiles(dir, binary) {
215
+ return listConfigFiles(dir, binary);
216
+ }
217
+ /** One file's tree in hcl2json's shape: hcl2json for HCL, {@link jsonConfigTree} for Terraform's JSON syntax. */
218
+ export async function parseFileTree(parser, file) {
219
+ if (isJsonConfigFile(file.name))
220
+ return jsonConfigTree(file.source);
221
+ return (await parser.parse(file.name, file.source));
138
222
  }
139
223
  /** The Terragrunt config files directly under `dir` (`root.hcl`, `terragrunt.hcl`), in filename order like the audit's bundle. */
140
224
  export function listTerragruntFiles(dir) {
@@ -241,7 +325,7 @@ export async function blocksToEntities(files, root, hcl2json, modeOptions, sidec
241
325
  }
242
326
  };
243
327
  for (const file of files) {
244
- const tree = (await parser.parse(file.name, file.source));
328
+ const tree = await parseFileTree(parser, file);
245
329
  const scan = scanSuppressions(file.name, file.source);
246
330
  if (isTerragruntFileName(file.name)) {
247
331
  terragruntBlocks(tree, file, scan, add);
@@ -257,6 +341,10 @@ export async function blocksToEntities(files, root, hcl2json, modeOptions, sidec
257
341
  oneLabel(tree, "output", OUTPUT_TYPE, (n) => `output.${n}`, file, scan);
258
342
  twoLabels(tree, "resource", RESOURCE_TYPE, (t, n) => `${t}.${n}`, file, scan);
259
343
  twoLabels(tree, "data", DATA_TYPE, (t, n) => `data.${t}.${n}`, file, scan);
344
+ unlabelled(tree, "moved", MOVED_TYPE, file, scan);
345
+ unlabelled(tree, "import", IMPORT_TYPE, file, scan);
346
+ unlabelled(tree, "removed", REMOVED_TYPE, file, scan);
347
+ oneLabel(tree, "check", CHECK_TYPE, (n) => `check.${n}`, file, scan);
260
348
  }
261
349
  if (sidecar) {
262
350
  const tree = (await parser.parse(sidecar.name, sidecar.source));
@@ -319,14 +407,15 @@ function terragruntBlocks(tree, file, scan, add) {
319
407
  }
320
408
  }
321
409
  /**
322
- * Parse a root module directory. Reads every `.tf` directly under `dir`, plus
323
- * the `estate.chdf.hcl` sidecar beside them when present. Throws whatever the
410
+ * Parse a root module directory. Reads the configuration files directly under
411
+ * `dir` that `modeOptions.binary` reads ({@link listTerraformFiles}), plus the
412
+ * `estate.chdf.hcl` sidecar beside them when present. Throws whatever the
324
413
  * parser throws for malformed HCL; `buildRoots()` is where that becomes a
325
414
  * warning.
326
415
  */
327
416
  export async function parseTerraformRootDir(dir, root, hcl2json, modeOptions, callers = []) {
328
417
  // A child module is a Terraform module, never a Terragrunt unit (#3417).
329
- const names = [...listTerraformFiles(dir), ...(callers.length === 0 ? listTerragruntFiles(dir) : [])];
418
+ const names = [...listTerraformFiles(dir, modeOptions?.binary), ...(callers.length === 0 ? listTerragruntFiles(dir) : [])];
330
419
  const files = names.map((name) => ({
331
420
  name,
332
421
  source: readFileSync(join(dir, name), "utf-8"),
@@ -349,7 +438,16 @@ export async function parseTerraformRootDir(dir, root, hcl2json, modeOptions, ca
349
438
  * the same way `parseTerraformRootDir`'s callers exercise it against files.
350
439
  */
351
440
  export async function parseTerraformRootContent(content, root, hcl2json, modeOptions) {
352
- return blocksToEntities(splitBundleContent(content), root, hcl2json, modeOptions);
441
+ return blocksToEntities(bundleFilesFor(splitBundleContent(content), modeOptions?.binary), root, hcl2json, modeOptions);
442
+ }
443
+ /**
444
+ * The files of a joined bundle a root run by `binary` reads: the same set
445
+ * {@link listTerraformFiles} gives for a directory holding them, plus the
446
+ * Terragrunt files, in bundle order (chant#4457).
447
+ */
448
+ export function bundleFilesFor(files, binary) {
449
+ const keep = new Set(selectConfigFiles(files.map((f) => f.name), binary));
450
+ return files.filter((f) => keep.has(f.name) || isTerragruntFileName(f.name));
353
451
  }
354
452
  /** The root name an audit of the audited directory itself parses under. */
355
453
  export const AUDIT_ROOT_NAME = "audit-root";
@@ -1 +1 @@
1
- {"version":3,"file":"roots.d.ts","sourceRoot":"","sources":["../../src/hcl/roots.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH,OAAO,EAAwB,KAAK,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC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A2B;IAC1C,wFAAwF;IACxF,WAAW,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC;IACrD;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,2BAA2B,GAChC,OAAO,CAAC,oBAAoB,CAAC,CAsE/B"}
package/dist/hcl/roots.js CHANGED
@@ -31,6 +31,7 @@ import { isResourceDeclarable } from "@intentius/chant/declarable";
31
31
  import { LIVE_TYPE, parseTerraformRootDir } from "./parse.js";
32
32
  import { descendModules, resolveCallModuleType } from "./descend.js";
33
33
  import { resolveEntityReferences } from "./edges.js";
34
+ import { resolveInstanceNodes } from "./instances.js";
34
35
  /**
35
36
  * Parse each configured root into entities keyed `<root>/<address>`, plus its
36
37
  * local child modules, keyed `<root>/module.<name>/<address>` (#2112). Roots
@@ -71,6 +72,10 @@ export async function renderTerraformRoots(opts) {
71
72
  for (const [key, entity] of descended.entities)
72
73
  entities.set(key, entity);
73
74
  warnings.push(...descended.warnings);
75
+ // Instance nodes the root's variables let the declared graph count,
76
+ // and those under expanded module calls (#4486). Needs the root and
77
+ // every child scope parsed, so it runs once the descent has.
78
+ await resolveInstanceNodes(entities, name, { dir, ...(root.varFiles ? { varFiles: root.varFiles } : {}), hcl2json: opts.hcl2json });
74
79
  // A `live` block or `estate.chdf.hcl` sidecar only takes effect under
75
80
  // choudoufu; under any other binary it parses fine but is inert, which
76
81
  // is worth a warning rather than silence (#2103).
@@ -1 +1 @@
1
- {"version":3,"file":"suppressions.d.ts","sourceRoot":"","sources":["../../src/hcl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AAoB,CAAC;CACtC;AAQD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,CA8D3E;AAED,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIhF;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,oBAAoB,EAAE,CAAA;CAAE,CAKvH"}
@@ -24,9 +24,9 @@
24
24
  * queue slot in file order, same as they're numbered `~2`/`~3` in file order.
25
25
  */
26
26
  /** A block header keyword with zero labels (`terraform {`, `locals {`). */
27
- const BARE_RE = /^\s*(terraform|locals|remote_state)\s*\{/;
27
+ const BARE_RE = /^\s*(terraform|locals|remote_state|moved|import|removed)\s*\{/;
28
28
  /** One label (`provider "aws" {`, `module "vpc" {`, `variable "x" {`, `output "x" {`). */
29
- const ONE_LABEL_RE = /^\s*(provider|module|variable|output|dependency|generate)\s+"([^"]*)"\s*\{/;
29
+ const ONE_LABEL_RE = /^\s*(provider|module|variable|output|check|dependency|generate)\s+"([^"]*)"\s*\{/;
30
30
  /** Two labels (`resource "aws_s3_bucket" "assets" {`, `data "aws_ami" "x" {`). */
31
31
  const TWO_LABEL_RE = /^\s*(resource|data)\s+"([^"]*)"\s+"([^"]*)"\s*\{/;
32
32
  /** A `#`/`//` comment naming one of the three suppression forms. */
@@ -40,6 +40,12 @@ function addressFor(keyword, labels) {
40
40
  return "locals";
41
41
  case "remote_state":
42
42
  return "remote_state";
43
+ case "moved":
44
+ case "import":
45
+ case "removed":
46
+ return keyword;
47
+ case "check":
48
+ return `check.${labels[0]}`;
43
49
  case "dependency":
44
50
  return `dependency.${labels[0]}`;
45
51
  case "generate":
package/dist/index.d.ts CHANGED
@@ -1,10 +1,19 @@
1
1
  export { terraformPlugin } from "./plugin.js";
2
- export { terraformCapabilityPlugin, terraformApplyCapability, TerraformPlanMovedError, TERRAFORM_VERB_FAMILIES, type TerraformApplyStepInput, type TerraformApplyStepOutput, } from "./components/capability-plugin.js";
2
+ export { terraformCapabilityPlugin, terraformApplyCapability, TerraformPlanMovedError, TERRAFORM_VERB_FAMILIES, choudoufuOutputSource, choudoufuMemberPlannedOutputs, type TerraformApplyStepInput, type TerraformApplyStepOutput, } from "./components/capability-plugin.js";
3
+ export { mergeStates, splitState, splitStates, derivedLineage, COMPOSE_LINEAGE, type SplitState } from "./compose/state-merge.js";
4
+ export { slicePlan as sliceComposedPlan, sliceText, planCounts, composedReads, composedMemberPlans, type PlanCounts, type ComposedMemberRead, type ComposedMemberPlan, type ComposedMemberPlansOptions, } from "./compose/slice.js";
5
+ export { readApplyEvents, memberApply, composedApplyOutcomes, type ApplyEvents, type MemberApply, type MemberApplyOutcome } from "./compose/apply-events.js";
6
+ export { topModule, stripModule, stripChange, moduleChanges } from "./compose/module-address.js";
7
+ export { EstateRun, estateVersionFallback, estateOutcomes, readEstateApplyText, type ComposedRunner, type ComposedRunPlan, type ComposedRunApply, type ComposedMemberOutcome, type EstateRunOptions, } from "./compose/estate.js";
8
+ export { priorStateValues, stateResources, stateOutputs, type StateResourceValues } from "./applied-state.js";
9
+ export { ComposedRun, composedPlanDigest, changesSomething, type ComposedRunOptions, type ComposedRunStage, type StateRunPlan, type StateRunApply, type StateMemberOutcome, type ComposedStateWrite, type ComposeHook, type ComposeHookMoment, } from "./compose/run.js";
10
+ export { terraformPlanShape, type TerraformPlanShapeOptions } from "./plan-shape.js";
11
+ export { compositionFor, compositionIfEnabled, composeOff, composeSet, readOrder, moduleNames, fallbackLine, withPlanFailed, identityKey, DEFAULT_COMPOSE_MAX, COMPOSE_STEP_KIND, type Composition, type CompositionInput, type ComposedRead, type ComposeFallback, type ComposeFallbackKind, type ExpectedBinary, } from "./compose.js";
3
12
  export { terraformSerializer } from "./serializer.js";
4
13
  export { terraformConfigSchema, terraformRootSchema, type TerraformConfig, type TerraformRootConfig, type TerraformConfigNamespace, } from "./config.js";
5
14
  export { blocksToEntities, parseTerraformRootContent, parseTerraformRootDir, readLiveSidecarFile, splitBundleContent, terraformEntity, DATA_TYPE, LIVE_SIDECAR_FILENAME, LIVE_TYPE, LOCALS_TYPE, MODULE_TYPE, OUTPUT_TYPE, PROVIDER_TYPE, RESOURCE_TYPE, TERRAFORM_TYPE, VARIABLE_TYPE, type BlockBody, type TerraformEntity, type TerraformFile, type TerraformRootMode, type TerraformRootModeOptions, } from "./hcl/parse.js";
6
15
  export { renderTerraformRoots, type TerraformRootsResult } from "./hcl/roots.js";
7
- export { terraformInit, terraformPlan, terraformApply, terraformShow, choudoufuLivePlan, choudoufuLiveLs, choudoufuLiveCheck, choudoufuAdopt, terraformPinRollout, } from "./op/builders.js";
16
+ export { terraformInit, terraformPlan, terraformApply, terraformShow, choudoufuLivePlan, choudoufuLiveLs, choudoufuLiveCheck, choudoufuAdopt, choudoufuPlanSet, terraformPinRollout, } from "./op/builders.js";
8
17
  export { parseAdoptionCommands, readAdoptionLedger, renderAdoptionLedger, type AdoptionCandidate, type AdoptionLedger, type AdoptionMatch, } from "./op/adoption.js";
9
18
  export { TerraformApplyOp } from "./composites/terraform-apply-op.js";
10
19
  export type { TerraformApplyOpConfig, TerraformApplyOpResources, TerraformGateMode, } from "./composites/terraform-apply-op.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAM3C,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,GAC9B,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,C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MAAM,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -4,7 +4,26 @@ export { terraformPlugin } from "./plugin.js";
4
4
  // capability-plugin seam. Core loads `terraformCapabilityPlugin` when a
5
5
  // project's chant.config lists this lexicon, so a component can deploy a root
6
6
  // and a fan-out can run many of them in gated waves.
7
- export { terraformCapabilityPlugin, terraformApplyCapability, TerraformPlanMovedError, TERRAFORM_VERB_FAMILIES, } from "./components/capability-plugin.js";
7
+ export { terraformCapabilityPlugin, terraformApplyCapability, TerraformPlanMovedError, TERRAFORM_VERB_FAMILIES,
8
+ // #4455: a choudoufu member's outputs, read for core's `member-outputs`.
9
+ choudoufuOutputSource, choudoufuMemberPlannedOutputs, } from "./components/capability-plugin.js";
10
+ // Composed runs (#4442): the working state merged and split, the composed
11
+ // plan cut into one plan per member, and each member's apply outcome.
12
+ export { mergeStates, splitState, splitStates, derivedLineage, COMPOSE_LINEAGE } from "./compose/state-merge.js";
13
+ export { slicePlan as sliceComposedPlan, sliceText, planCounts, composedReads, composedMemberPlans, } from "./compose/slice.js";
14
+ export { readApplyEvents, memberApply, composedApplyOutcomes } from "./compose/apply-events.js";
15
+ export { topModule, stripModule, stripChange, moduleChanges } from "./compose/module-address.js";
16
+ // Composed runs of choudoufu estates (#4445): one plan and one apply, values read from a post-apply plan.
17
+ export { EstateRun, estateVersionFallback, estateOutcomes, readEstateApplyText, } from "./compose/estate.js";
18
+ export { priorStateValues, stateResources, stateOutputs } from "./applied-state.js";
19
+ // Composed runs over roots with state (#4444): one plan and one apply, each
20
+ // state written back whatever happened. Implements `ComposedRunner` (#4445).
21
+ export { ComposedRun, composedPlanDigest, changesSomething, } from "./compose/run.js";
22
+ // The plan shape of a `show -json` plan (#4436), for core's `coveredRound`.
23
+ export { terraformPlanShape } from "./plan-shape.js";
24
+ // Composed runs (#4419, #4438): which roots compose, in what order, and why
25
+ // the others fall back. Off unless `terraform.compose.enabled` is set.
26
+ export { compositionFor, compositionIfEnabled, composeOff, composeSet, readOrder, moduleNames, fallbackLine, withPlanFailed, identityKey, DEFAULT_COMPOSE_MAX, COMPOSE_STEP_KIND, } from "./compose.js";
8
27
  // Serializer
9
28
  export { terraformSerializer } from "./serializer.js";
10
29
  // The `terraform` config namespace. Importing this package is what brings the
@@ -18,7 +37,7 @@ export { renderTerraformRoots } from "./hcl/roots.js";
18
37
  // Typed Op step builders (#2086). Same names as the activities they wrap, and
19
38
  // like k3s's they are opt-in from the lexicon root — the activities themselves
20
39
  // are reached by the registry through `./op/activities`, never from here.
21
- export { terraformInit, terraformPlan, terraformApply, terraformShow, choudoufuLivePlan, choudoufuLiveLs, choudoufuLiveCheck, choudoufuAdopt, terraformPinRollout, } from "./op/builders.js";
40
+ export { terraformInit, terraformPlan, terraformApply, terraformShow, choudoufuLivePlan, choudoufuLiveLs, choudoufuLiveCheck, choudoufuAdopt, choudoufuPlanSet, terraformPinRollout, } from "./op/builders.js";
22
41
  // The adoption ledger over `live-plan -json`'s document (#2105). Pure, and
23
42
  // exported because the ledger's shape is what a project reading an Op's own
24
43
  // result is reading.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "2b3f8b18903d43627d811f5ccfb418ddbcf2ce8aecde7fe38eafd28a6a593559",
4
+ "manifest.json": "a4392033f97c3faba6875ccbdaee0d9702511e9c441b628b5ad7352aa61bd101",
5
5
  "meta.json": "ca3d163bab055381827226140568f3bef7eaac187cebd76878e0b63e9e442356",
6
6
  "types/index.d.ts": "022927e6a7b351cc4cf52d5f973f60ccd140e5810e17b32fb8868965aa1db161",
7
7
  "rules/plan-before-apply.ts": "7c10245b2c3335253b48ee7d8b075d89f43116bde20313a5d1031b343fef1282",
@@ -54,7 +54,7 @@
54
54
  "rules/tf043.ts": "c8724a7c0734870101d73e411ed97240c03a01a1133adbf0b445a5083f40faee",
55
55
  "rules/tf044.ts": "4e9b17a6080074d2b2e02862a9f1c9c2baf0ef32d4f3b48df1e62d9d8c362008",
56
56
  "rules/tf045.ts": "760b1f4f385fbe7a86897efe3078fdeac11bcc9bfb806285d63db50488174b7b",
57
- "skills/chant-terraform.md": "d9ca7b7c28aed0038ce775a3491150298492eed2858fd3651ed9bfca0e577ae8"
57
+ "skills/chant-terraform.md": "53dd11c7b289652f92fdaf2c03766abda46d8964e31fe709e8b142ced4f19c50"
58
58
  },
59
- "composite": "acd11f24f4546441f7084748e2617792a690dedbd9677aa19333461e23c47a0d"
59
+ "composite": "8f145fa60592252c6d7e4bb60ce4599c7bcfb273853c12a1626757b34bd72411"
60
60
  }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * choudoufu's live-plan omission codes, in chant's vocabulary.
3
+ *
4
+ * Its own module so the observation reader (`./describe-resources.ts`) and
5
+ * the drift adapters (`./drift-record.ts`) read one table, and the drift
6
+ * adapters bundle without the reader's process and file-system imports.
7
+ */
8
+ import type { UnobservedReason } from "@intentius/chant/observation";
9
+ /**
10
+ * choudoufu's omission reason codes, mapped onto chant's total vocabulary
11
+ * (`internal/live/projection/result.go`). `"absent"` is not an
12
+ * {@link UnobservedReason}: it is the tri-state's OBSERVED-ABSENT, the one
13
+ * omission that is a claim of knowledge rather than of ignorance.
14
+ *
15
+ * A code this table does not know maps to `read-failed`, which is the safe
16
+ * direction: no NOT-OBSERVED verdict ever becomes a create or a delete.
17
+ */
18
+ export declare const LIVE_PLAN_OMISSION_REASONS: Readonly<Record<string, UnobservedReason | "absent">>;
19
+ /** Does this text name a credentials or authorization failure rather than any other error? */
20
+ export declare function readsAsCredentials(text: string): boolean;
21
+ //# sourceMappingURL=live-plan-reasons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live-plan-reasons.d.ts","sourceRoot":"","sources":["../src/live-plan-reasons.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,QAAQ,CAAC,CA0B5F,CAAC;AAEF,8FAA8F;AAC9F,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAIxD"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * choudoufu's live-plan omission codes, in chant's vocabulary.
3
+ *
4
+ * Its own module so the observation reader (`./describe-resources.ts`) and
5
+ * the drift adapters (`./drift-record.ts`) read one table, and the drift
6
+ * adapters bundle without the reader's process and file-system imports.
7
+ */
8
+ /**
9
+ * choudoufu's omission reason codes, mapped onto chant's total vocabulary
10
+ * (`internal/live/projection/result.go`). `"absent"` is not an
11
+ * {@link UnobservedReason}: it is the tri-state's OBSERVED-ABSENT, the one
12
+ * omission that is a claim of knowledge rather than of ignorance.
13
+ *
14
+ * A code this table does not know maps to `read-failed`, which is the safe
15
+ * direction: no NOT-OBSERVED verdict ever becomes a create or a delete.
16
+ */
17
+ export const LIVE_PLAN_OMISSION_REASONS = {
18
+ // The provider was asked and reported, normally, that nothing is there.
19
+ ABSENT: "absent",
20
+ // The provider errored, or could not be reached in a usable order.
21
+ FAILED: "read-failed",
22
+ PARENT_UNAVAILABLE: "read-failed",
23
+ CYCLE: "read-failed",
24
+ INCOMPLETE_BLOCK: "read-failed",
25
+ LISTED_NOT_IMPORTABLE: "read-failed",
26
+ // Something exists at the identity and does not carry this estate's marker.
27
+ // Normally answered by the `unowned[]` section before this table is read;
28
+ // this entry is what happens if a document ever carries the omission alone.
29
+ UNOWNED: "read-failed",
30
+ // The mode cannot name, list or tag this instance at all: a server-assigned
31
+ // identity with no marker to find it by, a resource with no cloud object to
32
+ // read, or an address another declared instance has taken over.
33
+ NEEDS_DISCOVERY: "unsupported-kind",
34
+ UNREADABLE: "unsupported-kind",
35
+ SUPERSEDED: "unsupported-kind",
36
+ // The run's own tag index saw an object at the identity and the import
37
+ // read could not confirm it (choudoufu #1043). The read failed; the
38
+ // object is not proposed for creation.
39
+ VERIFIED_NOT_IMPORTABLE: "read-failed",
40
+ // -target or -exclude left the block out of the plan graph (choudoufu
41
+ // #1176): nothing was read because the caller asked for it not to be.
42
+ OUT_OF_SCOPE: "filtered",
43
+ };
44
+ /** Does this text name a credentials or authorization failure rather than any other error? */
45
+ export function readsAsCredentials(text) {
46
+ return /\b(no valid credential|credentials?|not authorized|unauthorized|accessdenied|access denied|expiredtoken|invalidclienttokenid|signature)\b/i.test(text);
47
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"option-keys.d.ts","sourceRoot":"","sources":["../../src/lsp/option-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wEAAwE;AACxE,eAAO,MAAM,qBAAqB,EAAE,SAAS,EAG5C,CAAC;AAEF,wFAAwF;AACxF,eAAO,MAAM,eAAe,EAAE,SAAS,EAMtC,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,aAAa,EAAE,SAAS,EAYpC,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,eAAe,EAAE,SAAS,EAEtC,CAAC;AAQF,mGAAmG;AACnG,eAAO,MAAM,cAAc,EAAE,SAAS,EAKrC,CAAC;AAEF,mGAAmG;AACnG,eAAO,MAAM,cAAc,EAAE,SAAS,EAKrC,CAAC;AAEF,qGAAqG;AACrG,eAAO,MAAM,eAAe,EAAE,SAAS,EAStC,CAAC;AAEF,mGAAmG;AACnG,eAAO,MAAM,cAAc,EAAE,SAAS,EAIrC,CAAC;AAEF,oGAAoG;AACpG,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAK5D,CAAC;AAEF,iPAAiP;AACjP,eAAO,MAAM,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAW/C,CAAC"}
1
+ {"version":3,"file":"option-keys.d.ts","sourceRoot":"","sources":["../../src/lsp/option-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wEAAwE;AACxE,eAAO,MAAM,qBAAqB,EAAE,SAAS,EAG5C,CAAC;AAEF,wFAAwF;AACxF,eAAO,MAAM,eAAe,EAAE,SAAS,EAQtC,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,aAAa,EAAE,SAAS,EAYpC,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,eAAe,EAAE,SAAS,EAEtC,CAAC;AAQF,mGAAmG;AACnG,eAAO,MAAM,cAAc,EAAE,SAAS,EAKrC,CAAC;AAEF,mGAAmG;AACnG,eAAO,MAAM,cAAc,EAAE,SAAS,EAKrC,CAAC;AAEF,qGAAqG;AACrG,eAAO,MAAM,eAAe,EAAE,SAAS,EAStC,CAAC;AAEF,mGAAmG;AACnG,eAAO,MAAM,cAAc,EAAE,SAAS,EAIrC,CAAC;AAEF,oGAAoG;AACpG,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAK5D,CAAC;AAEF,iPAAiP;AACjP,eAAO,MAAM,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAW/C,CAAC"}
@@ -18,7 +18,9 @@ export const ROOT_ENTRY_KEYS = [
18
18
  { key: "workspace", detail: "Terraform workspace to select for this root. Omitted means `default`." },
19
19
  { key: "varFiles", detail: "`-var-file` arguments, in order, relative to `dir`." },
20
20
  { key: "backendConfig", detail: "`-backend-config` key/value pairs handed to `init`." },
21
+ { key: "backendConfigFiles", detail: "Backend-config files handed to `init` as `-backend-config=<path>`, before the pairs, relative to `dir`." },
21
22
  { key: "delete", detail: '"never" | "owned-only" | "gated" — this root\'s delete mode, mapped onto choudoufu\'s policy block on a live root.' },
23
+ { key: "signalOnly", detail: "`true` when the root is declared only so a change to it brings this project into the change. The build and live reads skip it." },
22
24
  ];
23
25
  /** `TerraformApplyOpConfig`'s keys (`TerraformApplyOp({ <here> })`). */
24
26
  export const APPLY_OP_KEYS = [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "terraform",
3
- "version": "0.124.52",
3
+ "version": "0.124.54",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "Terraform"
6
6
  }
@@ -16,6 +16,10 @@
16
16
  * - choudoufuLiveLs: `live-ls -estate=<estate> -json [-consistent]` (#2103).
17
17
  * - choudoufuLiveCheck: `live-check -json`, no cloud calls (#2103).
18
18
  * - choudoufuAdopt: the tag writes that claim an adoption ledger's matches (#2105).
19
+ * - choudoufuPlanSet: `live-plan-set -json` over one live root, as a
20
+ * one-root set (#3459). Its `changeSet` is the root's part, so an Op can
21
+ * plan several clouds' roots and hand the parts to `composeChangeSet`
22
+ * (#4483).
19
23
  * - terraformPinRollout: one run of a pin-bump rollout, opening at most one
20
24
  * wave's pull request (#3189). It loads the HCL parser on first call.
21
25
  *
@@ -25,8 +29,8 @@
25
29
  * run time. The pure command and environment builders are exported alongside
26
30
  * the activities because they are what the tests assert on.
27
31
  */
28
- export { terraformInit, terraformPlan, terraformApply, terraformShow, choudoufuLivePlan, choudoufuLiveLs, choudoufuLiveCheck, choudoufuAdopt, terraformInitCommand, terraformPlanCommand, terraformApplyCommand, terraformShowCommand, choudoufuLivePlanCommand, choudoufuLiveLsCommand, choudoufuLiveCheckCommand, terraformEnvironment, terraformBinary, countPlanChanges, countLivePlanUnowned, isOlderVersion, parseChoudoufuVersion, quoteArg, DEFAULT_PLAN_FILE, DEFAULT_TERRAFORM_BINARY, DEFAULT_LIVE_PLAN_DOCUMENT_FILE, MIN_CHOUDOUFU_VERSION, classifyApprovalRefusal, CHOUDOUFU_LIVE_PLAN_OUT_REFUSAL, CHOUDOUFU_APPROVAL_EXIT_CODE, CHOUDOUFU_APPROVAL_MISMATCH_REFUSAL, CHOUDOUFU_WRONG_ESTATE_REFUSAL, } from "./terraform.js";
29
- export type { TerraformRootArgs, TerraformInitArgs, TerraformPlanArgs, TerraformApplyArgs, TerraformShowArgs, ChoudoufuLivePlanArgs, ChoudoufuLiveLsArgs, ChoudoufuLiveCheckArgs, ChoudoufuAdoptArgs, TerraformInitResult, TerraformPlanResult, TerraformApplyResult, TerraformApprovalRefusal, TerraformShowResult, ChoudoufuLivePlanResult, ChoudoufuLiveLsResult, ChoudoufuLiveCheckResult, ChoudoufuAdoptResult, AdoptionRefusal, PlanChangeCounts, LivePlanUnownedCounts, } from "./terraform.js";
32
+ export { terraformInit, terraformPlan, terraformApply, terraformShow, choudoufuLivePlan, choudoufuLiveLs, choudoufuLiveCheck, choudoufuAdopt, choudoufuPlanSet, choudoufuPlanSetCommand, terraformInitCommand, terraformPlanCommand, terraformApplyCommand, terraformShowCommand, choudoufuLivePlanCommand, choudoufuLiveLsCommand, choudoufuLiveCheckCommand, terraformEnvironment, terraformBinary, countPlanChanges, countLivePlanUnowned, isOlderVersion, parseChoudoufuVersion, quoteArg, DEFAULT_PLAN_FILE, DEFAULT_TERRAFORM_BINARY, DEFAULT_LIVE_PLAN_DOCUMENT_FILE, MIN_CHOUDOUFU_VERSION, MIN_CHOUDOUFU_ESTATES_VERSION, classifyApprovalRefusal, CHOUDOUFU_LIVE_PLAN_OUT_REFUSAL, CHOUDOUFU_APPROVAL_EXIT_CODE, CHOUDOUFU_APPROVAL_MISMATCH_REFUSAL, CHOUDOUFU_WRONG_ESTATE_REFUSAL, } from "./terraform.js";
33
+ export type { TerraformRootArgs, TerraformInitArgs, TerraformPlanArgs, TerraformApplyArgs, TerraformShowArgs, ChoudoufuLivePlanArgs, ChoudoufuLiveLsArgs, ChoudoufuLiveCheckArgs, ChoudoufuAdoptArgs, TerraformInitResult, TerraformPlanResult, TerraformApplyResult, TerraformApprovalRefusal, TerraformShowResult, ChoudoufuLivePlanResult, ChoudoufuLiveLsResult, ChoudoufuLiveCheckResult, ChoudoufuAdoptResult, ChoudoufuPlanSet, ChoudoufuPlanSetResult, AdoptionRefusal, PlanChangeCounts, LivePlanUnownedCounts, } from "./terraform.js";
30
34
  export { detectLiveEstate } from "./live-detect.js";
31
35
  export { terraformPinRollout } from "./pin-rollout.js";
32
36
  export type { TerraformPinRolloutArgs, TerraformPinRolloutResult } from "./pin-rollout.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/op/activities/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EACL,aAAa,EACb,aAAa,EACb,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,sBAAsB,EACtB,yBAAyB,EACzB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,QAAQ,EACR,iBAAiB,EACjB,wBAAwB,EACxB,+BAA+B,EAC/B,qBAAqB,EACrB,uBAAuB,EACvB,+BAA+B,EAC/B,4BAA4B,EAC5B,mCAAmC,EACnC,8BAA8B,GAC/B,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,YAAY,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/op/activities/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EACL,aAAa,EACb,aAAa,EACb,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,sBAAsB,EACtB,yBAAyB,EACzB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,QAAQ,EACR,iBAAiB,EACjB,wBAAwB,EACxB,+BAA+B,EAC/B,qBAAqB,EACrB,6BAA6B,EAC7B,uBAAuB,EACvB,+BAA+B,EAC/B,4BAA4B,EAC5B,mCAAmC,EACnC,8BAA8B,GAC/B,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,YAAY,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC"}
@@ -16,6 +16,10 @@
16
16
  * - choudoufuLiveLs: `live-ls -estate=<estate> -json [-consistent]` (#2103).
17
17
  * - choudoufuLiveCheck: `live-check -json`, no cloud calls (#2103).
18
18
  * - choudoufuAdopt: the tag writes that claim an adoption ledger's matches (#2105).
19
+ * - choudoufuPlanSet: `live-plan-set -json` over one live root, as a
20
+ * one-root set (#3459). Its `changeSet` is the root's part, so an Op can
21
+ * plan several clouds' roots and hand the parts to `composeChangeSet`
22
+ * (#4483).
19
23
  * - terraformPinRollout: one run of a pin-bump rollout, opening at most one
20
24
  * wave's pull request (#3189). It loads the HCL parser on first call.
21
25
  *
@@ -25,6 +29,6 @@
25
29
  * run time. The pure command and environment builders are exported alongside
26
30
  * the activities because they are what the tests assert on.
27
31
  */
28
- export { terraformInit, terraformPlan, terraformApply, terraformShow, choudoufuLivePlan, choudoufuLiveLs, choudoufuLiveCheck, choudoufuAdopt, terraformInitCommand, terraformPlanCommand, terraformApplyCommand, terraformShowCommand, choudoufuLivePlanCommand, choudoufuLiveLsCommand, choudoufuLiveCheckCommand, terraformEnvironment, terraformBinary, countPlanChanges, countLivePlanUnowned, isOlderVersion, parseChoudoufuVersion, quoteArg, DEFAULT_PLAN_FILE, DEFAULT_TERRAFORM_BINARY, DEFAULT_LIVE_PLAN_DOCUMENT_FILE, MIN_CHOUDOUFU_VERSION, classifyApprovalRefusal, CHOUDOUFU_LIVE_PLAN_OUT_REFUSAL, CHOUDOUFU_APPROVAL_EXIT_CODE, CHOUDOUFU_APPROVAL_MISMATCH_REFUSAL, CHOUDOUFU_WRONG_ESTATE_REFUSAL, } from "./terraform.js";
32
+ export { terraformInit, terraformPlan, terraformApply, terraformShow, choudoufuLivePlan, choudoufuLiveLs, choudoufuLiveCheck, choudoufuAdopt, choudoufuPlanSet, choudoufuPlanSetCommand, terraformInitCommand, terraformPlanCommand, terraformApplyCommand, terraformShowCommand, choudoufuLivePlanCommand, choudoufuLiveLsCommand, choudoufuLiveCheckCommand, terraformEnvironment, terraformBinary, countPlanChanges, countLivePlanUnowned, isOlderVersion, parseChoudoufuVersion, quoteArg, DEFAULT_PLAN_FILE, DEFAULT_TERRAFORM_BINARY, DEFAULT_LIVE_PLAN_DOCUMENT_FILE, MIN_CHOUDOUFU_VERSION, MIN_CHOUDOUFU_ESTATES_VERSION, classifyApprovalRefusal, CHOUDOUFU_LIVE_PLAN_OUT_REFUSAL, CHOUDOUFU_APPROVAL_EXIT_CODE, CHOUDOUFU_APPROVAL_MISMATCH_REFUSAL, CHOUDOUFU_WRONG_ESTATE_REFUSAL, } from "./terraform.js";
29
33
  export { detectLiveEstate } from "./live-detect.js";
30
34
  export { terraformPinRollout } from "./pin-rollout.js";
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * A fast, regex-based read of whether a root module directory declares a
3
3
  * live estate: an `estate.chdf.hcl` sidecar, or a `live { ... }` block nested
4
- * inside a `terraform { ... }` block of some `.tf` file (#2103).
4
+ * inside a `terraform { ... }` block of some configuration file (#2103), the
5
+ * `terraform` object of a `.tf.json` file included (chant#4504).
5
6
  *
6
7
  * Deliberately separate from `../../hcl/parse.ts`'s AST-accurate detection
7
8
  * (`blocksToEntities`'s `liveBlocksIn`), which the build and lint paths use.
@@ -25,7 +26,7 @@
25
26
  * no sidecar (or one this function cannot read) yields `undefined` rather
26
27
  * than throwing, since this is a best-effort check, not the authoritative parse.
27
28
  */
28
- export declare function detectLiveEstate(dir: string): string | undefined;
29
+ export declare function detectLiveEstate(dir: string, binary?: string): string | undefined;
29
30
  /**
30
31
  * The `undeclared_tagged`/`undeclared_untagged` verbs a live root's `policy {
31
32
  * }` block assigns, or `undefined` when the directory declares no `policy`
@@ -47,5 +48,5 @@ export interface LivePolicyVerbs {
47
48
  /** The `undeclared_untagged` quadrant's verb, verbatim, or `undefined` when the attribute is absent. */
48
49
  undeclaredUntagged?: string;
49
50
  }
50
- export declare function detectLivePolicyVerbs(dir: string): LivePolicyVerbs | undefined;
51
+ export declare function detectLivePolicyVerbs(dir: string, binary?: string): LivePolicyVerbs | undefined;
51
52
  //# sourceMappingURL=live-detect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"live-detect.d.ts","sourceRoot":"","sources":["../../../src/op/activities/live-detect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AA6CH;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAoChE;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,eAAe;IAC9B,+HAA+H;IAC/H,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wGAAwG;IACxG,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CA8B9E"}
1
+ {"version":3,"file":"live-detect.d.ts","sourceRoot":"","sources":["../../../src/op/activities/live-detect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AA2EH;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,SAAc,GAAG,MAAM,GAAG,SAAS,CAgCtF;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,eAAe;IAC9B,+HAA+H;IAC/H,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wGAAwG;IACxG,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,SAAc,GAAG,eAAe,GAAG,SAAS,CAgCpG"}