@intentius/chant 0.79.0 → 0.81.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (462) hide show
  1. package/dist/audit/core.d.ts.map +1 -1
  2. package/dist/audit/discover.d.ts +30 -0
  3. package/dist/audit/discover.d.ts.map +1 -1
  4. package/dist/audit/report-html.d.ts +5 -0
  5. package/dist/audit/report-html.d.ts.map +1 -1
  6. package/dist/audit/report-model.d.ts +13 -0
  7. package/dist/audit/report-model.d.ts.map +1 -1
  8. package/dist/audit/terraform-state.d.ts +13 -0
  9. package/dist/audit/terraform-state.d.ts.map +1 -1
  10. package/dist/cli/command-group.d.ts +6 -0
  11. package/dist/cli/command-group.d.ts.map +1 -1
  12. package/dist/cli/commands/audit.d.ts +44 -3
  13. package/dist/cli/commands/audit.d.ts.map +1 -1
  14. package/dist/cli/commands/check-lexicon-examples.d.ts.map +1 -1
  15. package/dist/cli/commands/check-lexicon.d.ts +8 -0
  16. package/dist/cli/commands/check-lexicon.d.ts.map +1 -1
  17. package/dist/cli/commands/doctor.d.ts.map +1 -1
  18. package/dist/cli/commands/import-agents.d.ts.map +1 -1
  19. package/dist/cli/commands/init.d.ts +6 -0
  20. package/dist/cli/commands/init.d.ts.map +1 -1
  21. package/dist/cli/commands/lint.d.ts.map +1 -1
  22. package/dist/cli/commands/onboard.d.ts.map +1 -1
  23. package/dist/cli/commands/update.d.ts +6 -0
  24. package/dist/cli/commands/update.d.ts.map +1 -1
  25. package/dist/cli/commands/vendor.d.ts +5 -0
  26. package/dist/cli/commands/vendor.d.ts.map +1 -1
  27. package/dist/cli/conflict-check.d.ts +6 -0
  28. package/dist/cli/conflict-check.d.ts.map +1 -1
  29. package/dist/cli/handlers/build.d.ts.map +1 -1
  30. package/dist/cli/handlers/components.d.ts.map +1 -1
  31. package/dist/cli/handlers/dev.d.ts.map +1 -1
  32. package/dist/cli/handlers/fan-out.d.ts.map +1 -1
  33. package/dist/cli/handlers/init.d.ts.map +1 -1
  34. package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
  35. package/dist/cli/handlers/misc.d.ts.map +1 -1
  36. package/dist/cli/handlers/operator.d.ts +7 -0
  37. package/dist/cli/handlers/operator.d.ts.map +1 -1
  38. package/dist/cli/handlers/promote.d.ts +20 -0
  39. package/dist/cli/handlers/promote.d.ts.map +1 -0
  40. package/dist/cli/handlers/run-generate.d.ts +39 -0
  41. package/dist/cli/handlers/run-generate.d.ts.map +1 -0
  42. package/dist/cli/handlers/run.d.ts +4 -1
  43. package/dist/cli/handlers/run.d.ts.map +1 -1
  44. package/dist/cli/handlers/vendor.d.ts +8 -3
  45. package/dist/cli/handlers/vendor.d.ts.map +1 -1
  46. package/dist/cli/main.d.ts +12 -0
  47. package/dist/cli/main.d.ts.map +1 -1
  48. package/dist/cli/mcp/op-tools.d.ts.map +1 -1
  49. package/dist/cli/plugins.d.ts +14 -0
  50. package/dist/cli/plugins.d.ts.map +1 -1
  51. package/dist/cli/registry.d.ts +46 -1
  52. package/dist/cli/registry.d.ts.map +1 -1
  53. package/dist/codegen/fetch.d.ts +10 -0
  54. package/dist/codegen/fetch.d.ts.map +1 -1
  55. package/dist/components/capability-plugin-loader.d.ts.map +1 -1
  56. package/dist/components/cli-support.d.ts +3 -1
  57. package/dist/components/cli-support.d.ts.map +1 -1
  58. package/dist/components/discover.d.ts.map +1 -1
  59. package/dist/components/driver.d.ts +16 -2
  60. package/dist/components/driver.d.ts.map +1 -1
  61. package/dist/components/fan-out-support.d.ts.map +1 -1
  62. package/dist/components/gate-plan.d.ts +40 -0
  63. package/dist/components/gate-plan.d.ts.map +1 -0
  64. package/dist/components/pilots/alb-ecs.pilot.d.ts +7 -1
  65. package/dist/components/pilots/alb-ecs.pilot.d.ts.map +1 -1
  66. package/dist/components/presets/ecs-fargate.d.ts +10 -4
  67. package/dist/components/presets/ecs-fargate.d.ts.map +1 -1
  68. package/dist/components/promote.d.ts +264 -0
  69. package/dist/components/promote.d.ts.map +1 -0
  70. package/dist/components/sandbox/driver.d.ts.map +1 -1
  71. package/dist/components/sandbox/run.d.ts.map +1 -1
  72. package/dist/components/verbs/build-archive.d.ts +22 -11
  73. package/dist/components/verbs/build-archive.d.ts.map +1 -1
  74. package/dist/components/verbs/run-agent.d.ts.map +1 -1
  75. package/dist/config-static.d.ts +59 -0
  76. package/dist/config-static.d.ts.map +1 -0
  77. package/dist/config.d.ts +104 -5
  78. package/dist/config.d.ts.map +1 -1
  79. package/dist/content-digest.d.ts +17 -0
  80. package/dist/content-digest.d.ts.map +1 -0
  81. package/dist/discovery/files.d.ts +48 -4
  82. package/dist/discovery/files.d.ts.map +1 -1
  83. package/dist/discovery/fold-import.d.ts +32 -1
  84. package/dist/discovery/fold-import.d.ts.map +1 -1
  85. package/dist/discovery/index.d.ts.map +1 -1
  86. package/dist/discovery/sandbox/driver.d.ts +20 -0
  87. package/dist/discovery/sandbox/driver.d.ts.map +1 -1
  88. package/dist/discovery/sandbox/fork.d.ts +20 -0
  89. package/dist/discovery/sandbox/fork.d.ts.map +1 -1
  90. package/dist/discovery/walk.d.ts +119 -0
  91. package/dist/discovery/walk.d.ts.map +1 -0
  92. package/dist/graph-ir.d.ts +17 -1
  93. package/dist/graph-ir.d.ts.map +1 -1
  94. package/dist/join-key.d.ts +31 -0
  95. package/dist/join-key.d.ts.map +1 -0
  96. package/dist/lexicon-module.d.ts +110 -0
  97. package/dist/lexicon-module.d.ts.map +1 -0
  98. package/dist/lexicon.d.ts +82 -1
  99. package/dist/lexicon.d.ts.map +1 -1
  100. package/dist/lifecycle/build-ledger-store.d.ts.map +1 -1
  101. package/dist/lifecycle/digest.d.ts +5 -1
  102. package/dist/lifecycle/digest.d.ts.map +1 -1
  103. package/dist/lifecycle/gate-ledger.d.ts +20 -5
  104. package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
  105. package/dist/lifecycle/git.d.ts +64 -0
  106. package/dist/lifecycle/git.d.ts.map +1 -1
  107. package/dist/lifecycle/lease.d.ts +8 -1
  108. package/dist/lifecycle/lease.d.ts.map +1 -1
  109. package/dist/lifecycle/legacy-digest.d.ts +59 -0
  110. package/dist/lifecycle/legacy-digest.d.ts.map +1 -0
  111. package/dist/lifecycle/member-ledger.d.ts +67 -0
  112. package/dist/lifecycle/member-ledger.d.ts.map +1 -0
  113. package/dist/lifecycle/plan-digest.d.ts +4 -3
  114. package/dist/lifecycle/plan-digest.d.ts.map +1 -1
  115. package/dist/lifecycle/release-ledger.d.ts +42 -1
  116. package/dist/lifecycle/release-ledger.d.ts.map +1 -1
  117. package/dist/lifecycle/status.d.ts +90 -5
  118. package/dist/lifecycle/status.d.ts.map +1 -1
  119. package/dist/lint/rules/comp/comp003-mutating-no-rollback.d.ts +2 -3
  120. package/dist/lint/rules/comp/comp003-mutating-no-rollback.d.ts.map +1 -1
  121. package/dist/op/activities/activity-contracts.d.ts +32 -0
  122. package/dist/op/activities/activity-contracts.d.ts.map +1 -1
  123. package/dist/op/activities/index.d.ts +2 -0
  124. package/dist/op/activities/index.d.ts.map +1 -1
  125. package/dist/op/activities/propose-upgrade.d.ts +75 -0
  126. package/dist/op/activities/propose-upgrade.d.ts.map +1 -0
  127. package/dist/op/activity-contract-registry.d.ts.map +1 -1
  128. package/dist/op/activity-registry.d.ts.map +1 -1
  129. package/dist/op/discover.d.ts.map +1 -1
  130. package/dist/op/gate-approval.d.ts.map +1 -1
  131. package/dist/op/gate-name.d.ts +7 -0
  132. package/dist/op/gate-name.d.ts.map +1 -1
  133. package/dist/op/gate-summary.d.ts +16 -0
  134. package/dist/op/gate-summary.d.ts.map +1 -1
  135. package/dist/op/gate.d.ts +16 -2
  136. package/dist/op/gate.d.ts.map +1 -1
  137. package/dist/op/generate-pipeline.d.ts.map +1 -1
  138. package/dist/op/runtimes/local.d.ts.map +1 -1
  139. package/dist/project-root.d.ts +26 -0
  140. package/dist/project-root.d.ts.map +1 -1
  141. package/dist/workspace/__fixtures__/contract-repo.d.ts +37 -0
  142. package/dist/workspace/__fixtures__/contract-repo.d.ts.map +1 -0
  143. package/dist/workspace/__fixtures__/two-member-workspace.d.ts +11 -0
  144. package/dist/workspace/__fixtures__/two-member-workspace.d.ts.map +1 -0
  145. package/dist/workspace/checks/generated.d.ts +156 -0
  146. package/dist/workspace/checks/generated.d.ts.map +1 -0
  147. package/dist/workspace/checks/ledgers.d.ts +78 -0
  148. package/dist/workspace/checks/ledgers.d.ts.map +1 -0
  149. package/dist/workspace/checks/links.d.ts +25 -0
  150. package/dist/workspace/checks/links.d.ts.map +1 -0
  151. package/dist/workspace/checks/pipelines.d.ts +76 -0
  152. package/dist/workspace/checks/pipelines.d.ts.map +1 -0
  153. package/dist/workspace/checks.d.ts +161 -0
  154. package/dist/workspace/checks.d.ts.map +1 -0
  155. package/dist/workspace/compose-graph.d.ts +115 -0
  156. package/dist/workspace/compose-graph.d.ts.map +1 -0
  157. package/dist/workspace/compose-reports.d.ts +68 -0
  158. package/dist/workspace/compose-reports.d.ts.map +1 -0
  159. package/dist/workspace/declaration.d.ts +220 -0
  160. package/dist/workspace/declaration.d.ts.map +1 -0
  161. package/dist/workspace/declaration.schema.json +434 -0
  162. package/dist/workspace/generated-files.d.ts +65 -0
  163. package/dist/workspace/generated-files.d.ts.map +1 -0
  164. package/dist/workspace/glob.d.ts +13 -0
  165. package/dist/workspace/glob.d.ts.map +1 -0
  166. package/dist/workspace/graph-cli.d.ts +75 -0
  167. package/dist/workspace/graph-cli.d.ts.map +1 -0
  168. package/dist/workspace/init.d.ts +96 -0
  169. package/dist/workspace/init.d.ts.map +1 -0
  170. package/dist/workspace/jsonc.d.ts +38 -0
  171. package/dist/workspace/jsonc.d.ts.map +1 -0
  172. package/dist/workspace/kinds.d.ts +192 -0
  173. package/dist/workspace/kinds.d.ts.map +1 -0
  174. package/dist/workspace/lineage-check.d.ts +84 -0
  175. package/dist/workspace/lineage-check.d.ts.map +1 -0
  176. package/dist/workspace/lineage-cli.d.ts +31 -0
  177. package/dist/workspace/lineage-cli.d.ts.map +1 -0
  178. package/dist/workspace/lineage-init.d.ts +101 -0
  179. package/dist/workspace/lineage-init.d.ts.map +1 -0
  180. package/dist/workspace/lineage-lock.d.ts +258 -0
  181. package/dist/workspace/lineage-lock.d.ts.map +1 -0
  182. package/dist/workspace/lineage-merge.d.ts +14 -0
  183. package/dist/workspace/lineage-merge.d.ts.map +1 -0
  184. package/dist/workspace/lineage-migrations.d.ts +178 -0
  185. package/dist/workspace/lineage-migrations.d.ts.map +1 -0
  186. package/dist/workspace/lineage-update.d.ts +59 -0
  187. package/dist/workspace/lineage-update.d.ts.map +1 -0
  188. package/dist/workspace/lineage-upgrade-cli.d.ts +40 -0
  189. package/dist/workspace/lineage-upgrade-cli.d.ts.map +1 -0
  190. package/dist/workspace/lineage-upgrade.d.ts +146 -0
  191. package/dist/workspace/lineage-upgrade.d.ts.map +1 -0
  192. package/dist/workspace/lineage-vendor.d.ts +63 -0
  193. package/dist/workspace/lineage-vendor.d.ts.map +1 -0
  194. package/dist/workspace/lineage-version.d.ts +32 -0
  195. package/dist/workspace/lineage-version.d.ts.map +1 -0
  196. package/dist/workspace/links.d.ts +150 -0
  197. package/dist/workspace/links.d.ts.map +1 -0
  198. package/dist/workspace/ls.d.ts +99 -0
  199. package/dist/workspace/ls.d.ts.map +1 -0
  200. package/dist/workspace/member-commands.d.ts +139 -0
  201. package/dist/workspace/member-commands.d.ts.map +1 -0
  202. package/dist/workspace/member-handles.d.ts +54 -0
  203. package/dist/workspace/member-handles.d.ts.map +1 -0
  204. package/dist/workspace/member-pipeline.d.ts +143 -0
  205. package/dist/workspace/member-pipeline.d.ts.map +1 -0
  206. package/dist/workspace/member-run.d.ts +67 -0
  207. package/dist/workspace/member-run.d.ts.map +1 -0
  208. package/dist/workspace/reason-codes.d.ts +65 -0
  209. package/dist/workspace/reason-codes.d.ts.map +1 -0
  210. package/dist/workspace/record-source.d.ts +22 -0
  211. package/dist/workspace/record-source.d.ts.map +1 -0
  212. package/dist/workspace/records-cli.d.ts +81 -0
  213. package/dist/workspace/records-cli.d.ts.map +1 -0
  214. package/dist/workspace/records.d.ts +118 -0
  215. package/dist/workspace/records.d.ts.map +1 -0
  216. package/dist/workspace/root-refusal.d.ts +53 -0
  217. package/dist/workspace/root-refusal.d.ts.map +1 -0
  218. package/dist/workspace/status.d.ts +150 -0
  219. package/dist/workspace/status.d.ts.map +1 -0
  220. package/dist/workspace/template-manifest.d.ts +90 -0
  221. package/dist/workspace/template-manifest.d.ts.map +1 -0
  222. package/dist/workspace/tree.d.ts +36 -0
  223. package/dist/workspace/tree.d.ts.map +1 -0
  224. package/dist/workspace/trust/attestor.d.ts +67 -0
  225. package/dist/workspace/trust/attestor.d.ts.map +1 -0
  226. package/dist/workspace/trust/policy.d.ts +111 -0
  227. package/dist/workspace/trust/policy.d.ts.map +1 -0
  228. package/dist/workspace/trust/provenance.d.ts +67 -0
  229. package/dist/workspace/trust/provenance.d.ts.map +1 -0
  230. package/dist/workspace/trust/ssh-commit.d.ts +43 -0
  231. package/dist/workspace/trust/ssh-commit.d.ts.map +1 -0
  232. package/dist/workspace/trust/test-repo.d.ts +42 -0
  233. package/dist/workspace/trust/test-repo.d.ts.map +1 -0
  234. package/dist/workspace/trust/verify-cli.d.ts +9 -0
  235. package/dist/workspace/trust/verify-cli.d.ts.map +1 -0
  236. package/dist/workspace/trust/verify.d.ts +66 -0
  237. package/dist/workspace/trust/verify.d.ts.map +1 -0
  238. package/dist/workspace/which-chant.d.ts +58 -0
  239. package/dist/workspace/which-chant.d.ts.map +1 -0
  240. package/dist/workspace/workspace-kinds.schema.json +133 -0
  241. package/package.json +4 -3
  242. package/src/audit/core.ts +13 -2
  243. package/src/audit/discover.ts +102 -36
  244. package/src/audit/report-html.ts +3 -1
  245. package/src/audit/report-model.ts +14 -1
  246. package/src/audit/terraform-state.test.ts +81 -1
  247. package/src/audit/terraform-state.ts +25 -0
  248. package/src/cli/command-group.ts +7 -0
  249. package/src/cli/commands/audit-truncation.test.ts +167 -0
  250. package/src/cli/commands/audit.ts +132 -29
  251. package/src/cli/commands/check-lexicon-examples.ts +2 -1
  252. package/src/cli/commands/check-lexicon.ts +24 -0
  253. package/src/cli/commands/doctor.test.ts +30 -0
  254. package/src/cli/commands/doctor.ts +21 -0
  255. package/src/cli/commands/import-agents.ts +15 -4
  256. package/src/cli/commands/init.ts +76 -25
  257. package/src/cli/commands/lint.test.ts +52 -1
  258. package/src/cli/commands/lint.ts +41 -71
  259. package/src/cli/commands/onboard.ts +15 -0
  260. package/src/cli/commands/update.ts +18 -5
  261. package/src/cli/commands/vendor.ts +11 -6
  262. package/src/cli/conflict-check.test.ts +18 -1
  263. package/src/cli/conflict-check.ts +13 -0
  264. package/src/cli/discovery-skip.test.ts +168 -0
  265. package/src/cli/handlers/__snapshots__/build-member.test.ts.snap +38 -0
  266. package/src/cli/handlers/build-member.test.ts +127 -0
  267. package/src/cli/handlers/build.test.ts +11 -0
  268. package/src/cli/handlers/build.ts +35 -1
  269. package/src/cli/handlers/components.test.ts +127 -0
  270. package/src/cli/handlers/components.ts +70 -8
  271. package/src/cli/handlers/dev.ts +6 -1
  272. package/src/cli/handlers/fan-out.ts +9 -2
  273. package/src/cli/handlers/graph.test.ts +20 -0
  274. package/src/cli/handlers/graph.ts +4 -2
  275. package/src/cli/handlers/init.ts +54 -1
  276. package/src/cli/handlers/lifecycle.ts +2 -1
  277. package/src/cli/handlers/misc.ts +16 -0
  278. package/src/cli/handlers/operator.test.ts +68 -0
  279. package/src/cli/handlers/operator.ts +39 -10
  280. package/src/cli/handlers/promote.test.ts +377 -0
  281. package/src/cli/handlers/promote.ts +391 -0
  282. package/src/cli/handlers/run-generate-member.test.ts +83 -0
  283. package/src/cli/handlers/run-generate.test.ts +158 -0
  284. package/src/cli/handlers/run-generate.ts +168 -0
  285. package/src/cli/handlers/run.test.ts +47 -0
  286. package/src/cli/handlers/run.ts +41 -6
  287. package/src/cli/handlers/vendor.ts +147 -43
  288. package/src/cli/main.test.ts +137 -1
  289. package/src/cli/main.ts +290 -24
  290. package/src/cli/mcp/op-tools.ts +2 -1
  291. package/src/cli/path-lexicon-messages.test.ts +152 -0
  292. package/src/cli/plugins.ts +43 -5
  293. package/src/cli/registry.ts +46 -1
  294. package/src/cli/static-config-read.test.ts +208 -0
  295. package/src/codegen/fetch.test.ts +63 -1
  296. package/src/codegen/fetch.ts +30 -1
  297. package/src/components/__fixtures__/alb-ecs-service.json +0 -8
  298. package/src/components/capability-plugin-loader.ts +3 -1
  299. package/src/components/cli-support.ts +9 -3
  300. package/src/components/discover.test.ts +27 -57
  301. package/src/components/discover.ts +20 -51
  302. package/src/components/driver.test.ts +90 -12
  303. package/src/components/driver.ts +43 -5
  304. package/src/components/fan-out-support.ts +2 -1
  305. package/src/components/gate-plan.ts +53 -0
  306. package/src/components/pilots/README.md +1 -1
  307. package/src/components/pilots/alb-ecs.pilot.ts +7 -7
  308. package/src/components/presets/ecs-fargate.ts +10 -5
  309. package/src/components/promote.test.ts +645 -0
  310. package/src/components/promote.ts +641 -0
  311. package/src/components/sandbox/driver.ts +8 -8
  312. package/src/components/sandbox/run.ts +4 -1
  313. package/src/components/verbs/build-archive.ts +27 -21
  314. package/src/components/verbs/run-agent.ts +3 -5
  315. package/src/config-static.test.ts +136 -0
  316. package/src/config-static.ts +232 -0
  317. package/src/config.test.ts +40 -0
  318. package/src/config.ts +161 -11
  319. package/src/content-digest.test.ts +120 -0
  320. package/src/content-digest.ts +21 -0
  321. package/src/discovery/files.test.ts +127 -1
  322. package/src/discovery/files.ts +91 -59
  323. package/src/discovery/fold-import.ts +127 -9
  324. package/src/discovery/index.ts +1 -0
  325. package/src/discovery/sandbox/driver.ts +73 -35
  326. package/src/discovery/sandbox/fork-diagnostic.test.ts +136 -13
  327. package/src/discovery/sandbox/fork.ts +83 -43
  328. package/src/discovery/sandbox/path-lexicon-multifile.test.ts +285 -0
  329. package/src/discovery/sandbox/path-lexicon-parity.test.ts +162 -0
  330. package/src/discovery/walk.test.ts +263 -0
  331. package/src/discovery/walk.ts +334 -0
  332. package/src/effect-receipt.ts +2 -2
  333. package/src/graph-ir.ts +18 -1
  334. package/src/join-key.test.ts +25 -0
  335. package/src/join-key.ts +39 -0
  336. package/src/lexicon-module.test.ts +203 -0
  337. package/src/lexicon-module.ts +215 -0
  338. package/src/lexicon.ts +105 -1
  339. package/src/lifecycle/build-ledger-store.ts +13 -2
  340. package/src/lifecycle/digest.ts +9 -5
  341. package/src/lifecycle/gate-ledger.test.ts +20 -0
  342. package/src/lifecycle/gate-ledger.ts +28 -6
  343. package/src/lifecycle/git.test.ts +13 -1
  344. package/src/lifecycle/git.ts +221 -176
  345. package/src/lifecycle/lease.ts +25 -10
  346. package/src/lifecycle/legacy-digest.test.ts +206 -0
  347. package/src/lifecycle/legacy-digest.ts +103 -0
  348. package/src/lifecycle/member-ledger.test.ts +319 -0
  349. package/src/lifecycle/member-ledger.ts +145 -0
  350. package/src/lifecycle/plan-digest.ts +7 -7
  351. package/src/lifecycle/release-ledger.test.ts +20 -0
  352. package/src/lifecycle/release-ledger.ts +53 -3
  353. package/src/lifecycle/status.test.ts +151 -1
  354. package/src/lifecycle/status.ts +228 -7
  355. package/src/lint/rules/comp/comp003-mutating-no-rollback.ts +2 -3
  356. package/src/op/activities/activity-contracts.ts +37 -0
  357. package/src/op/activities/index.ts +10 -0
  358. package/src/op/activities/propose-upgrade.ts +206 -0
  359. package/src/op/activity-contract-registry.ts +18 -4
  360. package/src/op/activity-registry.ts +26 -0
  361. package/src/op/discover.test.ts +14 -4
  362. package/src/op/discover.ts +19 -23
  363. package/src/op/gate-approval.ts +3 -1
  364. package/src/op/gate-name.ts +8 -0
  365. package/src/op/gate-summary.test.ts +14 -0
  366. package/src/op/gate-summary.ts +25 -2
  367. package/src/op/gate.ts +36 -7
  368. package/src/op/generate-pipeline.test.ts +14 -5
  369. package/src/op/generate-pipeline.ts +2 -1
  370. package/src/op/runtimes/local.ts +2 -1
  371. package/src/project-root.test.ts +66 -1
  372. package/src/project-root.ts +48 -0
  373. package/src/workspace/__fixtures__/contract-repo.ts +100 -0
  374. package/src/workspace/__fixtures__/two-member-workspace.ts +35 -0
  375. package/src/workspace/behold-kinds.test.ts +162 -0
  376. package/src/workspace/check-contract.test.ts +127 -0
  377. package/src/workspace/check.schema.json +347 -0
  378. package/src/workspace/checks/generated.test.ts +287 -0
  379. package/src/workspace/checks/generated.ts +475 -0
  380. package/src/workspace/checks/ledgers.test.ts +139 -0
  381. package/src/workspace/checks/ledgers.ts +246 -0
  382. package/src/workspace/checks/links.ts +183 -0
  383. package/src/workspace/checks/pipelines.test.ts +133 -0
  384. package/src/workspace/checks/pipelines.ts +225 -0
  385. package/src/workspace/checks-repo.test.ts +71 -0
  386. package/src/workspace/checks.test.ts +450 -0
  387. package/src/workspace/checks.ts +461 -0
  388. package/src/workspace/compose-graph.test.ts +146 -0
  389. package/src/workspace/compose-graph.ts +228 -0
  390. package/src/workspace/compose-reports.test.ts +109 -0
  391. package/src/workspace/compose-reports.ts +186 -0
  392. package/src/workspace/declaration.schema.json +434 -0
  393. package/src/workspace/declaration.test.ts +347 -0
  394. package/src/workspace/declaration.ts +623 -0
  395. package/src/workspace/generated-files.test.ts +114 -0
  396. package/src/workspace/generated-files.ts +94 -0
  397. package/src/workspace/glob.ts +49 -0
  398. package/src/workspace/graph-cli.ts +220 -0
  399. package/src/workspace/graph-contract.test.ts +204 -0
  400. package/src/workspace/graph.schema.json +662 -0
  401. package/src/workspace/init.test.ts +223 -0
  402. package/src/workspace/init.ts +585 -0
  403. package/src/workspace/jsonc.test.ts +65 -0
  404. package/src/workspace/jsonc.ts +231 -0
  405. package/src/workspace/kinds.test.ts +288 -0
  406. package/src/workspace/kinds.ts +506 -0
  407. package/src/workspace/lineage-check.ts +264 -0
  408. package/src/workspace/lineage-cli.ts +114 -0
  409. package/src/workspace/lineage-init.test.ts +231 -0
  410. package/src/workspace/lineage-init.ts +365 -0
  411. package/src/workspace/lineage-lock.test.ts +224 -0
  412. package/src/workspace/lineage-lock.ts +357 -0
  413. package/src/workspace/lineage-merge.ts +44 -0
  414. package/src/workspace/lineage-migrations.test.ts +178 -0
  415. package/src/workspace/lineage-migrations.ts +343 -0
  416. package/src/workspace/lineage-update.ts +160 -0
  417. package/src/workspace/lineage-upgrade-cli.ts +151 -0
  418. package/src/workspace/lineage-upgrade.test.ts +474 -0
  419. package/src/workspace/lineage-upgrade.ts +624 -0
  420. package/src/workspace/lineage-vendor.test.ts +126 -0
  421. package/src/workspace/lineage-vendor.ts +215 -0
  422. package/src/workspace/lineage-version.ts +127 -0
  423. package/src/workspace/links.test.ts +344 -0
  424. package/src/workspace/links.ts +331 -0
  425. package/src/workspace/ls-contract.test.ts +200 -0
  426. package/src/workspace/ls.schema.json +190 -0
  427. package/src/workspace/ls.ts +254 -0
  428. package/src/workspace/member-commands.e2e.test.ts +244 -0
  429. package/src/workspace/member-commands.test.ts +217 -0
  430. package/src/workspace/member-commands.ts +540 -0
  431. package/src/workspace/member-handles.test.ts +76 -0
  432. package/src/workspace/member-handles.ts +228 -0
  433. package/src/workspace/member-pipeline.test.ts +135 -0
  434. package/src/workspace/member-pipeline.ts +317 -0
  435. package/src/workspace/member-run.ts +146 -0
  436. package/src/workspace/read-contract.test.ts +129 -0
  437. package/src/workspace/reason-codes.test.ts +113 -0
  438. package/src/workspace/reason-codes.ts +81 -0
  439. package/src/workspace/record-source.ts +117 -0
  440. package/src/workspace/records-cli.ts +198 -0
  441. package/src/workspace/records-contract.test.ts +93 -0
  442. package/src/workspace/records.schema.json +150 -0
  443. package/src/workspace/records.test.ts +243 -0
  444. package/src/workspace/records.ts +384 -0
  445. package/src/workspace/root-refusal.ts +97 -0
  446. package/src/workspace/status-contract.test.ts +308 -0
  447. package/src/workspace/status.schema.json +210 -0
  448. package/src/workspace/status.ts +412 -0
  449. package/src/workspace/template-manifest.test.ts +79 -0
  450. package/src/workspace/template-manifest.ts +221 -0
  451. package/src/workspace/tree.ts +132 -0
  452. package/src/workspace/trust/attestor.ts +93 -0
  453. package/src/workspace/trust/policy.ts +306 -0
  454. package/src/workspace/trust/provenance.ts +181 -0
  455. package/src/workspace/trust/ssh-commit.ts +138 -0
  456. package/src/workspace/trust/test-repo.ts +138 -0
  457. package/src/workspace/trust/trust.test.ts +397 -0
  458. package/src/workspace/trust/verify-cli.ts +56 -0
  459. package/src/workspace/trust/verify.ts +194 -0
  460. package/src/workspace/which-chant.test.ts +117 -0
  461. package/src/workspace/which-chant.ts +151 -0
  462. package/src/workspace/workspace-kinds.schema.json +133 -0
@@ -0,0 +1,115 @@
1
+ /**
2
+ * The composed workspace IR that `chant workspace graph` prints (#2537, #2524
3
+ * D8, ws-009, ws-018, ws-022).
4
+ *
5
+ * Each member is read through its own `chant graph --format ir`, under its
6
+ * own toolchain. This module takes those documents and composes them:
7
+ *
8
+ * - Every node id becomes `<member>/<id>`. Member names can't hold `/`, and
9
+ * `::` keeps its meaning for stacks inside a member (`app/web::Bucket`).
10
+ * Edge ends, `$ref` values in attributes, `compositeInstance`,
11
+ * `runtimeOwner` and export and import nodes are rewritten the same way.
12
+ * - `groups.byMember` maps each member to its node ids. `byLexicon` and
13
+ * `byComposite` keep their keys (a lexicon or composite type is the same
14
+ * thing in every member) and merge the ids. `byStack`, `byContainer` and
15
+ * `byWave` name things inside one member, so their keys are prefixed too.
16
+ * - `links` holds the member links (#2524 D6, #2539): the declared links and
17
+ * the joins inferred from members' `imports` and `exports` with the core
18
+ * `joinKey()`, labelled `exact` or `folded` (`./links.ts`). A declared link
19
+ * suppresses the inferred edge it covers. `records` is the section record
20
+ * kinds fill (#2524 D4), empty so far.
21
+ *
22
+ * A member's IR with no `version` field comes from a chant older than #2529.
23
+ * It is version 1, and it is upgraded in place by stamping that version. An IR
24
+ * newer than {@link GRAPH_IR_VERSION} can't be read safely, so that member is
25
+ * listed with a reason code and left out, like any other member that can't be
26
+ * read (#2524 D15).
27
+ *
28
+ * `chant graph` itself is untouched: this is the only place members compose.
29
+ */
30
+ import type { Declaration } from "./declaration.js";
31
+ import type { KindRegistry } from "./kinds.js";
32
+ import { type LinkTableRow } from "./links.js";
33
+ import { type GraphIR, type IRExport, type IRGroups, type IRImport, type IREdge, type IRNode } from "../graph-ir.js";
34
+ /** The version of the composed document `chant workspace graph` writes. */
35
+ export declare const WORKSPACE_GRAPH_VERSION = 1;
36
+ /**
37
+ * Why a member is missing from the composed graph, or from any per-member
38
+ * run. Closed, like the `ls` reason codes: a new code is a contract change.
39
+ */
40
+ export declare const MEMBER_RUN_REASON_CODES: readonly ["kind-not-run", "dir-missing", "unknown-kind", "kind-probe-failed", "command-failed", "output-unreadable", "ir-version-unsupported"];
41
+ export type MemberRunReasonCode = (typeof MEMBER_RUN_REASON_CODES)[number];
42
+ export interface MemberReason {
43
+ code: MemberRunReasonCode;
44
+ message: string;
45
+ }
46
+ export interface ComposedMember {
47
+ name: string;
48
+ dir: string;
49
+ kind: string;
50
+ status: "composed" | "skipped" | "failed";
51
+ reason: MemberReason | null;
52
+ /** The chant version that read the member, when its toolchain said. */
53
+ chant: string | null;
54
+ /** The IR version the member printed; `null` when it printed none and was upgraded as version 1. */
55
+ irVersion: number | null;
56
+ /** Whole-read facts the member's IR carried (`meta`, `pipeline`), kept apart from the composed sections. */
57
+ meta?: Record<string, unknown>;
58
+ pipeline?: unknown;
59
+ }
60
+ export type ComposedNode = IRNode & {
61
+ member: string;
62
+ };
63
+ export type ComposedEdge = IREdge & {
64
+ member: string;
65
+ };
66
+ export interface WorkspaceGraph {
67
+ version: number;
68
+ workspace: {
69
+ name: string;
70
+ root: string;
71
+ };
72
+ members: ComposedMember[];
73
+ nodes: ComposedNode[];
74
+ edges: ComposedEdge[];
75
+ groups: IRGroups & {
76
+ byMember: Record<string, string[]>;
77
+ };
78
+ exports: (IRExport & {
79
+ member: string;
80
+ })[];
81
+ imports: (IRImport & {
82
+ member: string;
83
+ })[];
84
+ derivedAttrs?: Record<string, string[]>;
85
+ /** Member links (#2524 D6, #2539), declared and inferred. Empty when no declaration is given. */
86
+ links: LinkTableRow[];
87
+ /** Record sections (#2524 D4). Empty until record kinds join the graph. */
88
+ records: unknown[];
89
+ }
90
+ /** Read one member's `chant graph --format ir` output, upgrading an unversioned (v1) IR in place. */
91
+ export declare function readMemberIr(text: string): {
92
+ ir: GraphIR;
93
+ irVersion: number | null;
94
+ } | {
95
+ reason: MemberReason;
96
+ };
97
+ export interface ComposeInput {
98
+ member: ComposedMember;
99
+ /** Present for a member whose IR was read. */
100
+ ir?: GraphIR;
101
+ }
102
+ /**
103
+ * Compose the members' IRs into the workspace document. Members keep the
104
+ * order they are given in. With `links`, the `links` section is filled from
105
+ * the declaration; `kinds` lets a member that isn't composed but whose kind
106
+ * lists its outputs (`other`, kinds from a package) be a link target.
107
+ */
108
+ export declare function composeWorkspaceGraph(workspace: {
109
+ name: string;
110
+ root: string;
111
+ }, inputs: ComposeInput[], links?: {
112
+ declaration: Declaration;
113
+ kinds?: KindRegistry;
114
+ }): WorkspaceGraph;
115
+ //# sourceMappingURL=compose-graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compose-graph.d.ts","sourceRoot":"","sources":["../../src/workspace/compose-graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAExD,OAAO,EAAoB,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAEpI,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,uBAAuB,gJAeM,CAAC;AAC3C,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,uBAAuB,CAAC,C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AAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACxC,iGAAiG;IACjG,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,2EAA2E;IAC3E,OAAO,EAAE,OAAO,EAAE,CAAC;CACpB;AAED,qGAAqG;AACrG,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,CAwB/G;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,cAAc,CAAC;IACvB,8CAA8C;IAC9C,EAAE,CAAC,EAAE,OAAO,CAAC;CACd;AAwBD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACzC,MAAM,EAAE,YAAY,EAAE,EACtB,KAAK,CAAC,EAAE;IAAE,WAAW,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,YAAY,CAAA;CAAE,GACzD,cAAc,CA8DhB"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Merging per-member lint and audit output (#2537, #2524 D16, ws-025, ws-026).
3
+ *
4
+ * `chant workspace lint --format sarif` prints one SARIF log with one run per
5
+ * member, each run being what that member's own `chant lint --format sarif`
6
+ * printed. `chant workspace audit --format json` prints one document whose
7
+ * findings each carry a `member` field. Both keep what the member's chant
8
+ * said and only add where it came from.
9
+ */
10
+ /** One member's output, as the merge sees it. */
11
+ export interface MemberOutput {
12
+ /** The member's name, or `<group>:<dir>` for an example-group match. */
13
+ id: string;
14
+ /** The member or group name. */
15
+ member: string;
16
+ /** Relative to the workspace root, `"."` for the root member. */
17
+ dir: string;
18
+ exitCode: number;
19
+ stdout: string;
20
+ stderr: string;
21
+ /**
22
+ * Directories (relative to the member) that belong to other members. Set
23
+ * for member `.`: its audit walks the whole root, and findings in these
24
+ * directories are reported by the members they belong to.
25
+ */
26
+ exclude?: string[];
27
+ }
28
+ type Json = Record<string, unknown>;
29
+ /**
30
+ * One SARIF log with one run per member. A member's own log normally holds
31
+ * one run; if it holds more, their results are folded into the first so the
32
+ * member still has exactly one. Artifact URIs become relative to the
33
+ * workspace root, and each run's `automationDetails.id` is `<member>/`, the
34
+ * SARIF way to tell runs of one tool apart.
35
+ */
36
+ export declare function mergeSarif(units: MemberOutput[], root: string): Json;
37
+ export interface MemberAuditStatus {
38
+ member: string;
39
+ dir: string;
40
+ exitCode: number;
41
+ status: "ok" | "no-lexicons" | "failed";
42
+ summary: Json | null;
43
+ error: string | null;
44
+ /** What the member's audit printed instead of a report when it had nothing to audit. */
45
+ note?: string;
46
+ /** Findings dropped from member `.` because they sit in another member's directory. */
47
+ leftToMembers?: number;
48
+ }
49
+ export interface WorkspaceAuditDocument {
50
+ /** The audit report schema version the members wrote, when they all agree. */
51
+ schemaVersion: string | null;
52
+ workspace: {
53
+ name: string;
54
+ root: string;
55
+ };
56
+ members: MemberAuditStatus[];
57
+ findings: Json[];
58
+ }
59
+ /**
60
+ * Merge each member's `chant audit --format json` report. Every finding keeps
61
+ * its fields, with `file` still relative to its member, and gains `member`.
62
+ */
63
+ export declare function mergeAudit(units: MemberOutput[], workspace: {
64
+ name: string;
65
+ root: string;
66
+ }): WorkspaceAuditDocument;
67
+ export {};
68
+ //# sourceMappingURL=compose-reports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compose-reports.d.ts","sourceRoot":"","sources":["../../src/workspace/compose-reports.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,iDAAiD;AACjD,MAAM,WAAW,YAAY;IAC3B,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAC;IACX,gCAAgC;IAChC,MAAM,EAAE,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` or `.jsonc` (#2524 D1, D2;
3
+ * ws-051 for example groups).
4
+ *
5
+ * Every read goes through {@link parseDeclaration}: the text is parsed with
6
+ * positions, the declared `minReader` is checked, the result is validated
7
+ * against the JSON Schema shipped beside this file, and then the rules JSON
8
+ * Schema can't say are checked in code: unique names, and the placement rules.
9
+ * Any failure is a {@link WorkspaceReadError} naming the file, line and
10
+ * column. A declaration never reads as empty.
11
+ *
12
+ * Group matches depend on the tree, so their placement is checked when they
13
+ * are expanded ({@link resolveGroups}).
14
+ *
15
+ * Everything under `workspace/` loads only when a `chant workspace` command
16
+ * runs. The level-0 goldens (#2526) fail if a level-0 command loads it.
17
+ */
18
+ import { EXAMPLES_KIND } from "./kinds.js";
19
+ import { type TextLocation } from "./jsonc.js";
20
+ import { type WorkspaceTree } from "./tree.js";
21
+ export declare const DECLARATION_SCHEMA_ID: string;
22
+ export declare const DECLARATION_FILES: readonly ["chant.workspace.json", "chant.workspace.jsonc"];
23
+ export declare const DECLARATION_SCHEMA_VERSION = 1;
24
+ /** Names no member or group may take: ledger paths use them (#2524 D7, D17). */
25
+ export declare const RESERVED_NAMES: readonly ["_workspace", "_members"];
26
+ export declare const NAME_PATTERN: RegExp;
27
+ /**
28
+ * Why a workspace could not be read. The list is closed: a reader may switch
29
+ * on it, and a new code is a contract change (#2524 D15).
30
+ */
31
+ export declare const WORKSPACE_ERROR_CODES: readonly ["declaration-missing", "declaration-ambiguous", "declaration-unparseable", "declaration-invalid", "placement-invalid", "reader-too-old", "root-chant-required", "not-a-git-repository", "revision-unknown"];
32
+ export type WorkspaceErrorCode = (typeof WORKSPACE_ERROR_CODES)[number];
33
+ export interface ErrorLocation extends TextLocation {
34
+ /** The declaration file, relative to the workspace root's tree. */
35
+ file: string;
36
+ }
37
+ export declare class WorkspaceReadError extends Error {
38
+ readonly code: WorkspaceErrorCode;
39
+ readonly location?: ErrorLocation | undefined;
40
+ constructor(code: WorkspaceErrorCode, message: string, location?: ErrorLocation | undefined);
41
+ /** `file:line:column: message`, or the message alone. */
42
+ describe(): string;
43
+ }
44
+ /** A declaration check suppressed for one entry (#2535). */
45
+ export interface Suppression {
46
+ /** A `WSP` id. */
47
+ check: string;
48
+ because: string;
49
+ }
50
+ /** What `checks` may set a declaration check's severity to. */
51
+ export type CheckSeverity = "error" | "warning" | "info" | "off";
52
+ export interface MemberRole {
53
+ name: string;
54
+ /** Relative to the member's directory, or null for the whole member. */
55
+ path: string | null;
56
+ }
57
+ /** A file a member lists as written by a command (#2524 D14, #2541). */
58
+ export interface GeneratedFile {
59
+ /** Relative to the member's directory. */
60
+ path: string;
61
+ /** The command line that writes the file, run in the member's directory. */
62
+ generator: string;
63
+ /** What the generator reads, relative to the workspace root. */
64
+ sources: string[];
65
+ /** Set when the file is kept by hand instead of regenerated. */
66
+ handWritten: {
67
+ because: string;
68
+ } | null;
69
+ /** The entry's JSON Pointer in the file, for messages. */
70
+ pointer: string;
71
+ }
72
+ /** A member link as the consumer states it (#2524 D6, #2539). */
73
+ export interface LinkDeclaration {
74
+ /** The producer member. */
75
+ member: string;
76
+ /** The producer's output, compared exactly. */
77
+ output: string;
78
+ /** The link kind as written, or null for the default (`output`). */
79
+ kind: string | null;
80
+ /** The link's JSON Pointer in the file, for messages. */
81
+ pointer: string;
82
+ }
83
+ export interface Member {
84
+ type: "member";
85
+ name: string;
86
+ /** Relative to the workspace root; `"."` is the root member. */
87
+ dir: string;
88
+ kind: string;
89
+ roles: MemberRole[];
90
+ /** Declared generated files, in file order. The implicit ones are not listed here (see `generated-files.ts`). */
91
+ generated: GeneratedFile[];
92
+ /** Outputs the entry lists as link targets, or null when it lists none (#2539). */
93
+ outputs: string[] | null;
94
+ /** The links this member states as a consumer, in file order (#2539). */
95
+ links: LinkDeclaration[];
96
+ upstream: string | null;
97
+ because: string | null;
98
+ suppress: Suppression[];
99
+ /** The entry's JSON Pointer in the file, for messages. */
100
+ pointer: string;
101
+ }
102
+ export interface Group {
103
+ type: "group";
104
+ name: string;
105
+ kind: typeof EXAMPLES_KIND;
106
+ globs: string[];
107
+ suppress: Suppression[];
108
+ pointer: string;
109
+ /** Where the entry's `glob` sits in the file, for placement errors. */
110
+ globLocation: TextLocation;
111
+ }
112
+ export type Entry = Member | Group;
113
+ export interface Pin {
114
+ package: string | null;
115
+ version: string | null;
116
+ path: string | null;
117
+ integrity: string | null;
118
+ }
119
+ export interface Declaration {
120
+ name: string;
121
+ schema: number;
122
+ minReader: string | null;
123
+ /** Members and groups, in file order. */
124
+ entries: Entry[];
125
+ members: Member[];
126
+ groups: Group[];
127
+ pins: Pin[];
128
+ /** Severities set for declaration checks, keyed by `WSP` id (#2535). */
129
+ checks: Record<string, CheckSeverity>;
130
+ /** The file, relative to the workspace root's tree (`chant.workspace.json` or `.jsonc`). */
131
+ file: string;
132
+ }
133
+ /** The package whose pin names the root's chant (#2524 D15, ws-021). */
134
+ export declare const CHANT_PACKAGE = "@intentius/chant";
135
+ /**
136
+ * The version of the chant doing the reading. Read as a file, not through
137
+ * `require`: discovery reads the declaration on every walk under a workspace
138
+ * root (#2527), and a CJS require of `package.json` took about a minute per
139
+ * call in a vitest worker once a build had run in it, where a file read takes
140
+ * well under a millisecond.
141
+ */
142
+ export declare function readerVersion(): string;
143
+ /** Negative when `a` is older than `b`. Build metadata is not allowed, and prereleases sort before their release. */
144
+ export declare function compareVersions(a: string, b: string): number;
145
+ export interface ReadOptions {
146
+ /**
147
+ * Apply "which chant reads it" (#2524 D15, ws-021): when the declaration
148
+ * pins `@intentius/chant` at a version other than `reader`, that pinned
149
+ * chant, the root's, reads it, and this one refuses with
150
+ * `root-chant-required`. The read-contract commands (`ls`, `graph`,
151
+ * `check`, `status`) set it, and hand the command to the root's chant
152
+ * first when it is installed (`which-chant.ts`). Other commands leave it
153
+ * off: a member's own toolchain writes its ledger whatever the root pins.
154
+ */
155
+ rootChant?: boolean;
156
+ }
157
+ /** The version the declaration's `@intentius/chant` pin names, and where the pin is. Undefined without one. */
158
+ export declare function pinnedChant(obj: Record<string, unknown>): {
159
+ version: string;
160
+ index: number;
161
+ } | undefined;
162
+ /**
163
+ * Parse and check a declaration's text. `file` is the name used in messages
164
+ * and decides the dialect: a name ending in `.jsonc` allows comments and
165
+ * trailing commas.
166
+ */
167
+ export declare function parseDeclaration(text: string, file: string, reader?: string, options?: ReadOptions): Declaration;
168
+ /** Whether `path` is `dir` or sits under it. Both are tree-relative; `"."` is the root. */
169
+ export declare function isInside(path: string, dir: string): boolean;
170
+ /**
171
+ * Read the declaration in directory `dir` of `tree`. Throws
172
+ * `declaration-missing` when neither name is there and
173
+ * `declaration-ambiguous` when both are.
174
+ */
175
+ export declare function readDeclaration(tree: WorkspaceTree, dir?: string, options?: ReadOptions): Declaration;
176
+ /**
177
+ * Walk up from `start` (tree-relative) to the nearest directory holding a
178
+ * declaration, within `tree`. The tree's root is the git root, so this is
179
+ * `findWorkspaceRoot` for a revision. Returns the directory, or undefined.
180
+ */
181
+ export declare function findDeclarationDir(tree: WorkspaceTree, start: string): string | undefined;
182
+ export interface ResolvedGroup {
183
+ group: Group;
184
+ /** Directories the globs match that hold a chant project, sorted. */
185
+ matches: string[];
186
+ /** Directories the globs match that hold none; they are left alone. */
187
+ skipped: string[];
188
+ }
189
+ /**
190
+ * Expand every group's globs in `tree` (rooted at the workspace root) and
191
+ * check where the matches sit (ws-051): a match is never a member's directory
192
+ * and never contains one, it doesn't sit inside a nested workspace, and no
193
+ * two groups claim the same directory. A match may sit inside any other
194
+ * member's directory; that member leaves it to the group.
195
+ */
196
+ export declare function resolveGroups(declaration: Declaration, tree: WorkspaceTree): ResolvedGroup[];
197
+ /**
198
+ * Which entry owns `path` (relative to the workspace root): the group whose
199
+ * match holds it, else the member with the deepest directory holding it, else
200
+ * none. A group match wins over the member whose directory it sits in
201
+ * (ws-051). Ledgers (#2538), telemetry attribution (#2558) and the root
202
+ * project's discovery (#2537) all ask this question.
203
+ */
204
+ export declare function ownerOf(declaration: Declaration, groups: ResolvedGroup[], path: string): {
205
+ member: Member;
206
+ } | {
207
+ group: Group;
208
+ match: string;
209
+ } | undefined;
210
+ /**
211
+ * The directories that leave the root project once the declaration exists
212
+ * (#2524 D0, D2): every member's directory but the root's, and every group
213
+ * match. The root project's build, lint, Op and audit discovery skip them
214
+ * (#2537); `chant workspace init` prints them before it writes.
215
+ */
216
+ export declare function rootExclusions(declaration: Declaration, groups: ResolvedGroup[]): {
217
+ dir: string;
218
+ owner: string;
219
+ }[];
220
+ //# sourceMappingURL=declaration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declaration.d.ts","sourceRoot":"","sources":["../../src/workspace/declaration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAOH,OAAO,EAAE,aAAa,EAAqB,MAAM,SAAS,CAAC;AAC3D,OAAO,EAA+B,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAEzE,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEtD,eAAO,MAAM,qBAAqB,QAAa,CAAC;AAChD,eAAO,MAAM,iBAAiB,4DAA6D,CAAC;AAC5F,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C,gFAAgF;AAChF,eAAO,MAAM,cAAc,qCAAsC,CAAC;AAClE,eAAO,MAAM,YAAY,QAA8B,CAAC;AAIxD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,uNAmBQ,CAAC;AAC3C,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,kBAAmB,SAAQ,KAAK;IAEzC,QAAQ,CAAC,IAAI,EAAE,kBAAkB;IAEjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa;gBAFxB,IAAI,EAAE,kBAAkB,EACjC,OAAO,EAAE,MAAM,EACN,QAAQ,CAAC,EAAE,aAAa,YAAA;IAM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