@azx-pbc/axiom-compiler 0.0.0-stage → 0.0.1

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 (655) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +415 -2
  3. package/dist/article.d.ts +12 -0
  4. package/dist/article.d.ts.map +1 -0
  5. package/dist/article.js +16 -0
  6. package/dist/article.js.map +1 -0
  7. package/dist/cli/args.d.ts +101 -0
  8. package/dist/cli/args.d.ts.map +1 -0
  9. package/dist/cli/args.js +158 -0
  10. package/dist/cli/args.js.map +1 -0
  11. package/dist/cli/check.d.ts +2 -0
  12. package/dist/cli/check.d.ts.map +1 -0
  13. package/dist/cli/check.js +33 -0
  14. package/dist/cli/check.js.map +1 -0
  15. package/dist/cli/compile.d.ts +2 -0
  16. package/dist/cli/compile.d.ts.map +1 -0
  17. package/dist/cli/compile.js +43 -0
  18. package/dist/cli/compile.js.map +1 -0
  19. package/dist/cli/count.d.ts +15 -0
  20. package/dist/cli/count.d.ts.map +1 -0
  21. package/dist/cli/count.js +21 -0
  22. package/dist/cli/count.js.map +1 -0
  23. package/dist/cli/dataset.d.ts +28 -0
  24. package/dist/cli/dataset.d.ts.map +1 -0
  25. package/dist/cli/dataset.js +115 -0
  26. package/dist/cli/dataset.js.map +1 -0
  27. package/dist/cli/diff.d.ts +2 -0
  28. package/dist/cli/diff.d.ts.map +1 -0
  29. package/dist/cli/diff.js +297 -0
  30. package/dist/cli/diff.js.map +1 -0
  31. package/dist/cli/explain.d.ts +2 -0
  32. package/dist/cli/explain.d.ts.map +1 -0
  33. package/dist/cli/explain.js +95 -0
  34. package/dist/cli/explain.js.map +1 -0
  35. package/dist/cli/fields.d.ts +11 -0
  36. package/dist/cli/fields.d.ts.map +1 -0
  37. package/dist/cli/fields.js +13 -0
  38. package/dist/cli/fields.js.map +1 -0
  39. package/dist/cli/main.d.ts +2 -0
  40. package/dist/cli/main.d.ts.map +1 -0
  41. package/dist/cli/main.js +40 -0
  42. package/dist/cli/main.js.map +1 -0
  43. package/dist/cli/read.d.ts +56 -0
  44. package/dist/cli/read.d.ts.map +1 -0
  45. package/dist/cli/read.js +179 -0
  46. package/dist/cli/read.js.map +1 -0
  47. package/dist/cli/render.d.ts +58 -0
  48. package/dist/cli/render.d.ts.map +1 -0
  49. package/dist/cli/render.js +422 -0
  50. package/dist/cli/render.js.map +1 -0
  51. package/dist/cli/schema.d.ts +28 -0
  52. package/dist/cli/schema.d.ts.map +1 -0
  53. package/dist/cli/schema.js +46 -0
  54. package/dist/cli/schema.js.map +1 -0
  55. package/dist/cli/suite-report.d.ts +18 -0
  56. package/dist/cli/suite-report.d.ts.map +1 -0
  57. package/dist/cli/suite-report.js +58 -0
  58. package/dist/cli/suite-report.js.map +1 -0
  59. package/dist/cli/suites.d.ts +25 -0
  60. package/dist/cli/suites.d.ts.map +1 -0
  61. package/dist/cli/suites.js +67 -0
  62. package/dist/cli/suites.js.map +1 -0
  63. package/dist/cli/terminal.d.ts +45 -0
  64. package/dist/cli/terminal.d.ts.map +1 -0
  65. package/dist/cli/terminal.js +119 -0
  66. package/dist/cli/terminal.js.map +1 -0
  67. package/dist/cli/test.d.ts +12 -0
  68. package/dist/cli/test.d.ts.map +1 -0
  69. package/dist/cli/test.js +199 -0
  70. package/dist/cli/test.js.map +1 -0
  71. package/dist/cli/usage.d.ts +15 -0
  72. package/dist/cli/usage.d.ts.map +1 -0
  73. package/dist/cli/usage.js +95 -0
  74. package/dist/cli/usage.js.map +1 -0
  75. package/dist/cli.d.ts +3 -0
  76. package/dist/cli.d.ts.map +1 -0
  77. package/dist/cli.js +51 -0
  78. package/dist/cli.js.map +1 -0
  79. package/dist/compile/artifact-members.d.ts +57 -0
  80. package/dist/compile/artifact-members.d.ts.map +1 -0
  81. package/dist/compile/artifact-members.js +130 -0
  82. package/dist/compile/artifact-members.js.map +1 -0
  83. package/dist/compile/artifact.d.ts +20 -0
  84. package/dist/compile/artifact.d.ts.map +1 -0
  85. package/dist/compile/artifact.js +87 -0
  86. package/dist/compile/artifact.js.map +1 -0
  87. package/dist/compile/compilation.d.ts +46 -0
  88. package/dist/compile/compilation.d.ts.map +1 -0
  89. package/dist/compile/compilation.js +4 -0
  90. package/dist/compile/compilation.js.map +1 -0
  91. package/dist/compile/computed.d.ts +22 -0
  92. package/dist/compile/computed.d.ts.map +1 -0
  93. package/dist/compile/computed.js +245 -0
  94. package/dist/compile/computed.js.map +1 -0
  95. package/dist/compile/condition-warnings.d.ts +12 -0
  96. package/dist/compile/condition-warnings.d.ts.map +1 -0
  97. package/dist/compile/condition-warnings.js +26 -0
  98. package/dist/compile/condition-warnings.js.map +1 -0
  99. package/dist/compile/conditions.d.ts +18 -0
  100. package/dist/compile/conditions.d.ts.map +1 -0
  101. package/dist/compile/conditions.js +22 -0
  102. package/dist/compile/conditions.js.map +1 -0
  103. package/dist/compile/cross-checks.d.ts +67 -0
  104. package/dist/compile/cross-checks.d.ts.map +1 -0
  105. package/dist/compile/cross-checks.js +238 -0
  106. package/dist/compile/cross-checks.js.map +1 -0
  107. package/dist/compile/datasets.d.ts +52 -0
  108. package/dist/compile/datasets.d.ts.map +1 -0
  109. package/dist/compile/datasets.js +183 -0
  110. package/dist/compile/datasets.js.map +1 -0
  111. package/dist/compile/dead-weight.d.ts +26 -0
  112. package/dist/compile/dead-weight.d.ts.map +1 -0
  113. package/dist/compile/dead-weight.js +244 -0
  114. package/dist/compile/dead-weight.js.map +1 -0
  115. package/dist/compile/declaration-rules.d.ts +54 -0
  116. package/dist/compile/declaration-rules.d.ts.map +1 -0
  117. package/dist/compile/declaration-rules.js +510 -0
  118. package/dist/compile/declaration-rules.js.map +1 -0
  119. package/dist/compile/declarations.d.ts +44 -0
  120. package/dist/compile/declarations.d.ts.map +1 -0
  121. package/dist/compile/declarations.js +160 -0
  122. package/dist/compile/declarations.js.map +1 -0
  123. package/dist/compile/document.d.ts +4 -0
  124. package/dist/compile/document.d.ts.map +1 -0
  125. package/dist/compile/document.js +13 -0
  126. package/dist/compile/document.js.map +1 -0
  127. package/dist/compile/expression.d.ts +38 -0
  128. package/dist/compile/expression.d.ts.map +1 -0
  129. package/dist/compile/expression.js +288 -0
  130. package/dist/compile/expression.js.map +1 -0
  131. package/dist/compile/hashes.d.ts +26 -0
  132. package/dist/compile/hashes.d.ts.map +1 -0
  133. package/dist/compile/hashes.js +96 -0
  134. package/dist/compile/hashes.js.map +1 -0
  135. package/dist/compile/item-targets.d.ts +12 -0
  136. package/dist/compile/item-targets.d.ts.map +1 -0
  137. package/dist/compile/item-targets.js +287 -0
  138. package/dist/compile/item-targets.js.map +1 -0
  139. package/dist/compile/messages.d.ts +8 -0
  140. package/dist/compile/messages.d.ts.map +1 -0
  141. package/dist/compile/messages.js +62 -0
  142. package/dist/compile/messages.js.map +1 -0
  143. package/dist/compile/option-availability.d.ts +51 -0
  144. package/dist/compile/option-availability.d.ts.map +1 -0
  145. package/dist/compile/option-availability.js +171 -0
  146. package/dist/compile/option-availability.js.map +1 -0
  147. package/dist/compile/option-codes.d.ts +27 -0
  148. package/dist/compile/option-codes.d.ts.map +1 -0
  149. package/dist/compile/option-codes.js +212 -0
  150. package/dist/compile/option-codes.js.map +1 -0
  151. package/dist/compile/references.d.ts +14 -0
  152. package/dist/compile/references.d.ts.map +1 -0
  153. package/dist/compile/references.js +126 -0
  154. package/dist/compile/references.js.map +1 -0
  155. package/dist/compile/rows-from.d.ts +27 -0
  156. package/dist/compile/rows-from.d.ts.map +1 -0
  157. package/dist/compile/rows-from.js +164 -0
  158. package/dist/compile/rows-from.js.map +1 -0
  159. package/dist/compile/rules.d.ts +58 -0
  160. package/dist/compile/rules.d.ts.map +1 -0
  161. package/dist/compile/rules.js +327 -0
  162. package/dist/compile/rules.js.map +1 -0
  163. package/dist/compile/suggestions.d.ts +52 -0
  164. package/dist/compile/suggestions.d.ts.map +1 -0
  165. package/dist/compile/suggestions.js +633 -0
  166. package/dist/compile/suggestions.js.map +1 -0
  167. package/dist/compile/targets.d.ts +22 -0
  168. package/dist/compile/targets.d.ts.map +1 -0
  169. package/dist/compile/targets.js +125 -0
  170. package/dist/compile/targets.js.map +1 -0
  171. package/dist/compile/types.d.ts +84 -0
  172. package/dist/compile/types.d.ts.map +1 -0
  173. package/dist/compile/types.js +2 -0
  174. package/dist/compile/types.js.map +1 -0
  175. package/dist/compile/warning.d.ts +45 -0
  176. package/dist/compile/warning.d.ts.map +1 -0
  177. package/dist/compile/warning.js +2 -0
  178. package/dist/compile/warning.js.map +1 -0
  179. package/dist/compile-yaml.d.ts +23 -0
  180. package/dist/compile-yaml.d.ts.map +1 -0
  181. package/dist/compile-yaml.js +30 -0
  182. package/dist/compile-yaml.js.map +1 -0
  183. package/dist/compile.d.ts +78 -0
  184. package/dist/compile.d.ts.map +1 -0
  185. package/dist/compile.js +372 -0
  186. package/dist/compile.js.map +1 -0
  187. package/dist/csv/limits.d.ts +43 -0
  188. package/dist/csv/limits.d.ts.map +1 -0
  189. package/dist/csv/limits.js +51 -0
  190. package/dist/csv/limits.js.map +1 -0
  191. package/dist/csv/scalar.d.ts +33 -0
  192. package/dist/csv/scalar.d.ts.map +1 -0
  193. package/dist/csv/scalar.js +77 -0
  194. package/dist/csv/scalar.js.map +1 -0
  195. package/dist/datasets/csv.d.ts +46 -0
  196. package/dist/datasets/csv.d.ts.map +1 -0
  197. package/dist/datasets/csv.js +293 -0
  198. package/dist/datasets/csv.js.map +1 -0
  199. package/dist/datasets/declaration.d.ts +16 -0
  200. package/dist/datasets/declaration.d.ts.map +1 -0
  201. package/dist/datasets/declaration.js +104 -0
  202. package/dist/datasets/declaration.js.map +1 -0
  203. package/dist/datasets/diagnostics.d.ts +65 -0
  204. package/dist/datasets/diagnostics.d.ts.map +1 -0
  205. package/dist/datasets/diagnostics.js +2 -0
  206. package/dist/datasets/diagnostics.js.map +1 -0
  207. package/dist/datasets/diff.d.ts +46 -0
  208. package/dist/datasets/diff.d.ts.map +1 -0
  209. package/dist/datasets/diff.js +84 -0
  210. package/dist/datasets/diff.js.map +1 -0
  211. package/dist/datasets/document.d.ts +12 -0
  212. package/dist/datasets/document.d.ts.map +1 -0
  213. package/dist/datasets/document.js +382 -0
  214. package/dist/datasets/document.js.map +1 -0
  215. package/dist/datasets/index.d.ts +43 -0
  216. package/dist/datasets/index.d.ts.map +1 -0
  217. package/dist/datasets/index.js +68 -0
  218. package/dist/datasets/index.js.map +1 -0
  219. package/dist/datasets/repair.d.ts +26 -0
  220. package/dist/datasets/repair.d.ts.map +1 -0
  221. package/dist/datasets/repair.js +60 -0
  222. package/dist/datasets/repair.js.map +1 -0
  223. package/dist/document-path.d.ts +62 -0
  224. package/dist/document-path.d.ts.map +1 -0
  225. package/dist/document-path.js +200 -0
  226. package/dist/document-path.js.map +1 -0
  227. package/dist/expr/boundary.d.ts +8 -0
  228. package/dist/expr/boundary.d.ts.map +1 -0
  229. package/dist/expr/boundary.js +243 -0
  230. package/dist/expr/boundary.js.map +1 -0
  231. package/dist/expr/compile-expr.d.ts +35 -0
  232. package/dist/expr/compile-expr.d.ts.map +1 -0
  233. package/dist/expr/compile-expr.js +66 -0
  234. package/dist/expr/compile-expr.js.map +1 -0
  235. package/dist/expr/deprecation.d.ts +23 -0
  236. package/dist/expr/deprecation.d.ts.map +1 -0
  237. package/dist/expr/deprecation.js +28 -0
  238. package/dist/expr/deprecation.js.map +1 -0
  239. package/dist/expr/diagnostics.d.ts +31 -0
  240. package/dist/expr/diagnostics.d.ts.map +1 -0
  241. package/dist/expr/diagnostics.js +34 -0
  242. package/dist/expr/diagnostics.js.map +1 -0
  243. package/dist/expr/lexer.d.ts +49 -0
  244. package/dist/expr/lexer.d.ts.map +1 -0
  245. package/dist/expr/lexer.js +277 -0
  246. package/dist/expr/lexer.js.map +1 -0
  247. package/dist/expr/lint-warnings.d.ts +11 -0
  248. package/dist/expr/lint-warnings.d.ts.map +1 -0
  249. package/dist/expr/lint-warnings.js +20 -0
  250. package/dist/expr/lint-warnings.js.map +1 -0
  251. package/dist/expr/lint.d.ts +41 -0
  252. package/dist/expr/lint.d.ts.map +1 -0
  253. package/dist/expr/lint.js +1034 -0
  254. package/dist/expr/lint.js.map +1 -0
  255. package/dist/expr/parse/aggregates.d.ts +13 -0
  256. package/dist/expr/parse/aggregates.d.ts.map +1 -0
  257. package/dist/expr/parse/aggregates.js +48 -0
  258. package/dist/expr/parse/aggregates.js.map +1 -0
  259. package/dist/expr/parse/budget.d.ts +11 -0
  260. package/dist/expr/parse/budget.d.ts.map +1 -0
  261. package/dist/expr/parse/budget.js +57 -0
  262. package/dist/expr/parse/budget.js.map +1 -0
  263. package/dist/expr/parse/grammar.d.ts +9 -0
  264. package/dist/expr/parse/grammar.d.ts.map +1 -0
  265. package/dist/expr/parse/grammar.js +699 -0
  266. package/dist/expr/parse/grammar.js.map +1 -0
  267. package/dist/expr/parse/literals.d.ts +20 -0
  268. package/dist/expr/parse/literals.d.ts.map +1 -0
  269. package/dist/expr/parse/literals.js +132 -0
  270. package/dist/expr/parse/literals.js.map +1 -0
  271. package/dist/expr/parse/stream.d.ts +60 -0
  272. package/dist/expr/parse/stream.d.ts.map +1 -0
  273. package/dist/expr/parse/stream.js +151 -0
  274. package/dist/expr/parse/stream.js.map +1 -0
  275. package/dist/expr/parser.d.ts +45 -0
  276. package/dist/expr/parser.d.ts.map +1 -0
  277. package/dist/expr/parser.js +110 -0
  278. package/dist/expr/parser.js.map +1 -0
  279. package/dist/expr/print/spell.d.ts +78 -0
  280. package/dist/expr/print/spell.d.ts.map +1 -0
  281. package/dist/expr/print/spell.js +592 -0
  282. package/dist/expr/print/spell.js.map +1 -0
  283. package/dist/expr/print.d.ts +20 -0
  284. package/dist/expr/print.d.ts.map +1 -0
  285. package/dist/expr/print.js +102 -0
  286. package/dist/expr/print.js.map +1 -0
  287. package/dist/expr/suggest.d.ts +26 -0
  288. package/dist/expr/suggest.d.ts.map +1 -0
  289. package/dist/expr/suggest.js +77 -0
  290. package/dist/expr/suggest.js.map +1 -0
  291. package/dist/expr/typecheck/aggregates.d.ts +8 -0
  292. package/dist/expr/typecheck/aggregates.d.ts.map +1 -0
  293. package/dist/expr/typecheck/aggregates.js +334 -0
  294. package/dist/expr/typecheck/aggregates.js.map +1 -0
  295. package/dist/expr/typecheck/arithmetic.d.ts +6 -0
  296. package/dist/expr/typecheck/arithmetic.d.ts.map +1 -0
  297. package/dist/expr/typecheck/arithmetic.js +258 -0
  298. package/dist/expr/typecheck/arithmetic.js.map +1 -0
  299. package/dist/expr/typecheck/arity.d.ts +38 -0
  300. package/dist/expr/typecheck/arity.d.ts.map +1 -0
  301. package/dist/expr/typecheck/arity.js +173 -0
  302. package/dist/expr/typecheck/arity.js.map +1 -0
  303. package/dist/expr/typecheck/calls.d.ts +6 -0
  304. package/dist/expr/typecheck/calls.d.ts.map +1 -0
  305. package/dist/expr/typecheck/calls.js +137 -0
  306. package/dist/expr/typecheck/calls.js.map +1 -0
  307. package/dist/expr/typecheck/comparison.d.ts +13 -0
  308. package/dist/expr/typecheck/comparison.d.ts.map +1 -0
  309. package/dist/expr/typecheck/comparison.js +200 -0
  310. package/dist/expr/typecheck/comparison.js.map +1 -0
  311. package/dist/expr/typecheck/compound.d.ts +24 -0
  312. package/dist/expr/typecheck/compound.d.ts.map +1 -0
  313. package/dist/expr/typecheck/compound.js +175 -0
  314. package/dist/expr/typecheck/compound.js.map +1 -0
  315. package/dist/expr/typecheck/context.d.ts +44 -0
  316. package/dist/expr/typecheck/context.d.ts.map +1 -0
  317. package/dist/expr/typecheck/context.js +2 -0
  318. package/dist/expr/typecheck/context.js.map +1 -0
  319. package/dist/expr/typecheck/datasets.d.ts +17 -0
  320. package/dist/expr/typecheck/datasets.d.ts.map +1 -0
  321. package/dist/expr/typecheck/datasets.js +136 -0
  322. package/dist/expr/typecheck/datasets.js.map +1 -0
  323. package/dist/expr/typecheck/digest.d.ts +7 -0
  324. package/dist/expr/typecheck/digest.d.ts.map +1 -0
  325. package/dist/expr/typecheck/digest.js +44 -0
  326. package/dist/expr/typecheck/digest.js.map +1 -0
  327. package/dist/expr/typecheck/fold.d.ts +41 -0
  328. package/dist/expr/typecheck/fold.d.ts.map +1 -0
  329. package/dist/expr/typecheck/fold.js +71 -0
  330. package/dist/expr/typecheck/fold.js.map +1 -0
  331. package/dist/expr/typecheck/gate-folds.d.ts +22 -0
  332. package/dist/expr/typecheck/gate-folds.d.ts.map +1 -0
  333. package/dist/expr/typecheck/gate-folds.js +40 -0
  334. package/dist/expr/typecheck/gate-folds.js.map +1 -0
  335. package/dist/expr/typecheck/guards.d.ts +6 -0
  336. package/dist/expr/typecheck/guards.d.ts.map +1 -0
  337. package/dist/expr/typecheck/guards.js +38 -0
  338. package/dist/expr/typecheck/guards.js.map +1 -0
  339. package/dist/expr/typecheck/member.d.ts +17 -0
  340. package/dist/expr/typecheck/member.d.ts.map +1 -0
  341. package/dist/expr/typecheck/member.js +46 -0
  342. package/dist/expr/typecheck/member.js.map +1 -0
  343. package/dist/expr/typecheck/money.d.ts +8 -0
  344. package/dist/expr/typecheck/money.d.ts.map +1 -0
  345. package/dist/expr/typecheck/money.js +49 -0
  346. package/dist/expr/typecheck/money.js.map +1 -0
  347. package/dist/expr/typecheck/numeric.d.ts +8 -0
  348. package/dist/expr/typecheck/numeric.d.ts.map +1 -0
  349. package/dist/expr/typecheck/numeric.js +84 -0
  350. package/dist/expr/typecheck/numeric.js.map +1 -0
  351. package/dist/expr/typecheck/operands.d.ts +27 -0
  352. package/dist/expr/typecheck/operands.d.ts.map +1 -0
  353. package/dist/expr/typecheck/operands.js +106 -0
  354. package/dist/expr/typecheck/operands.js.map +1 -0
  355. package/dist/expr/typecheck/paths.d.ts +21 -0
  356. package/dist/expr/typecheck/paths.d.ts.map +1 -0
  357. package/dist/expr/typecheck/paths.js +321 -0
  358. package/dist/expr/typecheck/paths.js.map +1 -0
  359. package/dist/expr/typecheck/records.d.ts +24 -0
  360. package/dist/expr/typecheck/records.d.ts.map +1 -0
  361. package/dist/expr/typecheck/records.js +53 -0
  362. package/dist/expr/typecheck/records.js.map +1 -0
  363. package/dist/expr/typecheck/sequences.d.ts +15 -0
  364. package/dist/expr/typecheck/sequences.d.ts.map +1 -0
  365. package/dist/expr/typecheck/sequences.js +55 -0
  366. package/dist/expr/typecheck/sequences.js.map +1 -0
  367. package/dist/expr/typecheck/strings.d.ts +8 -0
  368. package/dist/expr/typecheck/strings.d.ts.map +1 -0
  369. package/dist/expr/typecheck/strings.js +188 -0
  370. package/dist/expr/typecheck/strings.js.map +1 -0
  371. package/dist/expr/typecheck/temporal.d.ts +7 -0
  372. package/dist/expr/typecheck/temporal.d.ts.map +1 -0
  373. package/dist/expr/typecheck/temporal.js +80 -0
  374. package/dist/expr/typecheck/temporal.js.map +1 -0
  375. package/dist/expr/typecheck/types.d.ts +163 -0
  376. package/dist/expr/typecheck/types.d.ts.map +1 -0
  377. package/dist/expr/typecheck/types.js +404 -0
  378. package/dist/expr/typecheck/types.js.map +1 -0
  379. package/dist/expr/typecheck.d.ts +75 -0
  380. package/dist/expr/typecheck.d.ts.map +1 -0
  381. package/dist/expr/typecheck.js +242 -0
  382. package/dist/expr/typecheck.js.map +1 -0
  383. package/dist/expr/undecided.d.ts +13 -0
  384. package/dist/expr/undecided.d.ts.map +1 -0
  385. package/dist/expr/undecided.js +58 -0
  386. package/dist/expr/undecided.js.map +1 -0
  387. package/dist/expr/values/code-points.d.ts +13 -0
  388. package/dist/expr/values/code-points.d.ts.map +1 -0
  389. package/dist/expr/values/code-points.js +25 -0
  390. package/dist/expr/values/code-points.js.map +1 -0
  391. package/dist/expr/values/inline.d.ts +77 -0
  392. package/dist/expr/values/inline.d.ts.map +1 -0
  393. package/dist/expr/values/inline.js +404 -0
  394. package/dist/expr/values/inline.js.map +1 -0
  395. package/dist/expr/values/interval.d.ts +19 -0
  396. package/dist/expr/values/interval.d.ts.map +1 -0
  397. package/dist/expr/values/interval.js +1180 -0
  398. package/dist/expr/values/interval.js.map +1 -0
  399. package/dist/index.d.ts +163 -0
  400. package/dist/index.d.ts.map +1 -0
  401. package/dist/index.js +128 -0
  402. package/dist/index.js.map +1 -0
  403. package/dist/ingest/document.d.ts +58 -0
  404. package/dist/ingest/document.d.ts.map +1 -0
  405. package/dist/ingest/document.js +83 -0
  406. package/dist/ingest/document.js.map +1 -0
  407. package/dist/ingest/yaml-document.d.ts +15 -0
  408. package/dist/ingest/yaml-document.d.ts.map +1 -0
  409. package/dist/ingest/yaml-document.js +42 -0
  410. package/dist/ingest/yaml-document.js.map +1 -0
  411. package/dist/ingest/yaml.d.ts +51 -0
  412. package/dist/ingest/yaml.d.ts.map +1 -0
  413. package/dist/ingest/yaml.js +340 -0
  414. package/dist/ingest/yaml.js.map +1 -0
  415. package/dist/layout/compile.d.ts +6 -0
  416. package/dist/layout/compile.d.ts.map +1 -0
  417. package/dist/layout/compile.js +224 -0
  418. package/dist/layout/compile.js.map +1 -0
  419. package/dist/layout/context.d.ts +12 -0
  420. package/dist/layout/context.d.ts.map +1 -0
  421. package/dist/layout/context.js +26 -0
  422. package/dist/layout/context.js.map +1 -0
  423. package/dist/layout/grammar.d.ts +34 -0
  424. package/dist/layout/grammar.d.ts.map +1 -0
  425. package/dist/layout/grammar.js +171 -0
  426. package/dist/layout/grammar.js.map +1 -0
  427. package/dist/layout/read.d.ts +54 -0
  428. package/dist/layout/read.d.ts.map +1 -0
  429. package/dist/layout/read.js +101 -0
  430. package/dist/layout/read.js.map +1 -0
  431. package/dist/layout/shape.d.ts +34 -0
  432. package/dist/layout/shape.d.ts.map +1 -0
  433. package/dist/layout/shape.js +149 -0
  434. package/dist/layout/shape.js.map +1 -0
  435. package/dist/messages/compile.d.ts +47 -0
  436. package/dist/messages/compile.d.ts.map +1 -0
  437. package/dist/messages/compile.js +202 -0
  438. package/dist/messages/compile.js.map +1 -0
  439. package/dist/messages/locale.d.ts +18 -0
  440. package/dist/messages/locale.d.ts.map +1 -0
  441. package/dist/messages/locale.js +33 -0
  442. package/dist/messages/locale.js.map +1 -0
  443. package/dist/messages/slots.d.ts +54 -0
  444. package/dist/messages/slots.d.ts.map +1 -0
  445. package/dist/messages/slots.js +137 -0
  446. package/dist/messages/slots.js.map +1 -0
  447. package/dist/overlay/compile-overlay.d.ts +29 -0
  448. package/dist/overlay/compile-overlay.d.ts.map +1 -0
  449. package/dist/overlay/compile-overlay.js +120 -0
  450. package/dist/overlay/compile-overlay.js.map +1 -0
  451. package/dist/overlay/compose.d.ts +26 -0
  452. package/dist/overlay/compose.d.ts.map +1 -0
  453. package/dist/overlay/compose.js +674 -0
  454. package/dist/overlay/compose.js.map +1 -0
  455. package/dist/overlay/types.d.ts +41 -0
  456. package/dist/overlay/types.d.ts.map +1 -0
  457. package/dist/overlay/types.js +2 -0
  458. package/dist/overlay/types.js.map +1 -0
  459. package/dist/publish/classify.d.ts +50 -0
  460. package/dist/publish/classify.d.ts.map +1 -0
  461. package/dist/publish/classify.js +85 -0
  462. package/dist/publish/classify.js.map +1 -0
  463. package/dist/publish/environment.d.ts +15 -0
  464. package/dist/publish/environment.d.ts.map +1 -0
  465. package/dist/publish/environment.js +2 -0
  466. package/dist/publish/environment.js.map +1 -0
  467. package/dist/publish/migrations.d.ts +108 -0
  468. package/dist/publish/migrations.d.ts.map +1 -0
  469. package/dist/publish/migrations.js +166 -0
  470. package/dist/publish/migrations.js.map +1 -0
  471. package/dist/publish/observation.d.ts +29 -0
  472. package/dist/publish/observation.d.ts.map +1 -0
  473. package/dist/publish/observation.js +43 -0
  474. package/dist/publish/observation.js.map +1 -0
  475. package/dist/publish/readiness.d.ts +197 -0
  476. package/dist/publish/readiness.d.ts.map +1 -0
  477. package/dist/publish/readiness.js +239 -0
  478. package/dist/publish/readiness.js.map +1 -0
  479. package/dist/publish/vectors.d.ts +50 -0
  480. package/dist/publish/vectors.d.ts.map +1 -0
  481. package/dist/publish/vectors.js +306 -0
  482. package/dist/publish/vectors.js.map +1 -0
  483. package/dist/publish/verify.d.ts +146 -0
  484. package/dist/publish/verify.d.ts.map +1 -0
  485. package/dist/publish/verify.js +548 -0
  486. package/dist/publish/verify.js.map +1 -0
  487. package/dist/scenarios/branch.d.ts +36 -0
  488. package/dist/scenarios/branch.d.ts.map +1 -0
  489. package/dist/scenarios/branch.js +30 -0
  490. package/dist/scenarios/branch.js.map +1 -0
  491. package/dist/scenarios/capture.d.ts +89 -0
  492. package/dist/scenarios/capture.d.ts.map +1 -0
  493. package/dist/scenarios/capture.js +443 -0
  494. package/dist/scenarios/capture.js.map +1 -0
  495. package/dist/scenarios/classifier.d.ts +20 -0
  496. package/dist/scenarios/classifier.d.ts.map +1 -0
  497. package/dist/scenarios/classifier.js +88 -0
  498. package/dist/scenarios/classifier.js.map +1 -0
  499. package/dist/scenarios/credit.d.ts +33 -0
  500. package/dist/scenarios/credit.d.ts.map +1 -0
  501. package/dist/scenarios/credit.js +330 -0
  502. package/dist/scenarios/credit.js.map +1 -0
  503. package/dist/scenarios/csv.d.ts +34 -0
  504. package/dist/scenarios/csv.d.ts.map +1 -0
  505. package/dist/scenarios/csv.js +1047 -0
  506. package/dist/scenarios/csv.js.map +1 -0
  507. package/dist/scenarios/data-identity.d.ts +39 -0
  508. package/dist/scenarios/data-identity.d.ts.map +1 -0
  509. package/dist/scenarios/data-identity.js +28 -0
  510. package/dist/scenarios/data-identity.js.map +1 -0
  511. package/dist/scenarios/document.d.ts +148 -0
  512. package/dist/scenarios/document.d.ts.map +1 -0
  513. package/dist/scenarios/document.js +513 -0
  514. package/dist/scenarios/document.js.map +1 -0
  515. package/dist/scenarios/environment.d.ts +64 -0
  516. package/dist/scenarios/environment.d.ts.map +1 -0
  517. package/dist/scenarios/environment.js +106 -0
  518. package/dist/scenarios/environment.js.map +1 -0
  519. package/dist/scenarios/evidence.d.ts +128 -0
  520. package/dist/scenarios/evidence.d.ts.map +1 -0
  521. package/dist/scenarios/evidence.js +179 -0
  522. package/dist/scenarios/evidence.js.map +1 -0
  523. package/dist/scenarios/expectations.d.ts +63 -0
  524. package/dist/scenarios/expectations.d.ts.map +1 -0
  525. package/dist/scenarios/expectations.js +490 -0
  526. package/dist/scenarios/expectations.js.map +1 -0
  527. package/dist/scenarios/references.d.ts +15 -0
  528. package/dist/scenarios/references.d.ts.map +1 -0
  529. package/dist/scenarios/references.js +239 -0
  530. package/dist/scenarios/references.js.map +1 -0
  531. package/dist/scenarios/report.d.ts +216 -0
  532. package/dist/scenarios/report.d.ts.map +1 -0
  533. package/dist/scenarios/report.js +54 -0
  534. package/dist/scenarios/report.js.map +1 -0
  535. package/dist/scenarios/runner.d.ts +55 -0
  536. package/dist/scenarios/runner.d.ts.map +1 -0
  537. package/dist/scenarios/runner.js +205 -0
  538. package/dist/scenarios/runner.js.map +1 -0
  539. package/dist/scenarios/vocabulary.d.ts +19 -0
  540. package/dist/scenarios/vocabulary.d.ts.map +1 -0
  541. package/dist/scenarios/vocabulary.js +56 -0
  542. package/dist/scenarios/vocabulary.js.map +1 -0
  543. package/dist/schema/catalogue.d.ts +54 -0
  544. package/dist/schema/catalogue.d.ts.map +1 -0
  545. package/dist/schema/catalogue.js +221 -0
  546. package/dist/schema/catalogue.js.map +1 -0
  547. package/dist/schema/check.d.ts +22 -0
  548. package/dist/schema/check.d.ts.map +1 -0
  549. package/dist/schema/check.js +30 -0
  550. package/dist/schema/check.js.map +1 -0
  551. package/dist/schema/closed.d.ts +19 -0
  552. package/dist/schema/closed.d.ts.map +1 -0
  553. package/dist/schema/closed.js +33 -0
  554. package/dist/schema/closed.js.map +1 -0
  555. package/dist/schema/collapse.d.ts +27 -0
  556. package/dist/schema/collapse.d.ts.map +1 -0
  557. package/dist/schema/collapse.js +143 -0
  558. package/dist/schema/collapse.js.map +1 -0
  559. package/dist/schema/controls.d.ts +46 -0
  560. package/dist/schema/controls.d.ts.map +1 -0
  561. package/dist/schema/controls.js +75 -0
  562. package/dist/schema/controls.js.map +1 -0
  563. package/dist/schema/dataset-declaration.d.ts +11 -0
  564. package/dist/schema/dataset-declaration.d.ts.map +1 -0
  565. package/dist/schema/dataset-declaration.js +11 -0
  566. package/dist/schema/dataset-declaration.js.map +1 -0
  567. package/dist/schema/declaration-warnings.d.ts +14 -0
  568. package/dist/schema/declaration-warnings.d.ts.map +1 -0
  569. package/dist/schema/declaration-warnings.js +77 -0
  570. package/dist/schema/declaration-warnings.js.map +1 -0
  571. package/dist/schema/declarations.d.ts +41 -0
  572. package/dist/schema/declarations.d.ts.map +1 -0
  573. package/dist/schema/declarations.js +1299 -0
  574. package/dist/schema/declarations.js.map +1 -0
  575. package/dist/schema/diagnostic.d.ts +118 -0
  576. package/dist/schema/diagnostic.d.ts.map +1 -0
  577. package/dist/schema/diagnostic.js +39 -0
  578. package/dist/schema/diagnostic.js.map +1 -0
  579. package/dist/schema/document.d.ts +93 -0
  580. package/dist/schema/document.d.ts.map +1 -0
  581. package/dist/schema/document.js +507 -0
  582. package/dist/schema/document.js.map +1 -0
  583. package/dist/schema/fields.d.ts +11 -0
  584. package/dist/schema/fields.d.ts.map +1 -0
  585. package/dist/schema/fields.js +265 -0
  586. package/dist/schema/fields.js.map +1 -0
  587. package/dist/schema/gates.d.ts +4 -0
  588. package/dist/schema/gates.d.ts.map +1 -0
  589. package/dist/schema/gates.js +68 -0
  590. package/dist/schema/gates.js.map +1 -0
  591. package/dist/schema/located.d.ts +27 -0
  592. package/dist/schema/located.d.ts.map +1 -0
  593. package/dist/schema/located.js +56 -0
  594. package/dist/schema/located.js.map +1 -0
  595. package/dist/schema/measurement.d.ts +9 -0
  596. package/dist/schema/measurement.d.ts.map +1 -0
  597. package/dist/schema/measurement.js +38 -0
  598. package/dist/schema/measurement.js.map +1 -0
  599. package/dist/schema/member-wording.d.ts +35 -0
  600. package/dist/schema/member-wording.d.ts.map +1 -0
  601. package/dist/schema/member-wording.js +286 -0
  602. package/dist/schema/member-wording.js.map +1 -0
  603. package/dist/schema/metaschema.d.ts +20 -0
  604. package/dist/schema/metaschema.d.ts.map +1 -0
  605. package/dist/schema/metaschema.js +476 -0
  606. package/dist/schema/metaschema.js.map +1 -0
  607. package/dist/schema/pointer.d.ts +31 -0
  608. package/dist/schema/pointer.d.ts.map +1 -0
  609. package/dist/schema/pointer.js +73 -0
  610. package/dist/schema/pointer.js.map +1 -0
  611. package/dist/schema/primary.d.ts +29 -0
  612. package/dist/schema/primary.d.ts.map +1 -0
  613. package/dist/schema/primary.js +48 -0
  614. package/dist/schema/primary.js.map +1 -0
  615. package/dist/schema/publish-vector.d.ts +17 -0
  616. package/dist/schema/publish-vector.d.ts.map +1 -0
  617. package/dist/schema/publish-vector.js +34 -0
  618. package/dist/schema/publish-vector.js.map +1 -0
  619. package/dist/schema/repair.d.ts +34 -0
  620. package/dist/schema/repair.d.ts.map +1 -0
  621. package/dist/schema/repair.js +163 -0
  622. package/dist/schema/repair.js.map +1 -0
  623. package/dist/schema/schema-v1.generated.d.ts +14 -0
  624. package/dist/schema/schema-v1.generated.d.ts.map +1 -0
  625. package/dist/schema/schema-v1.generated.js +7089 -0
  626. package/dist/schema/schema-v1.generated.js.map +1 -0
  627. package/dist/schema/screens.d.ts +4 -0
  628. package/dist/schema/screens.d.ts.map +1 -0
  629. package/dist/schema/screens.js +28 -0
  630. package/dist/schema/screens.js.map +1 -0
  631. package/dist/schema/test-values.d.ts +12 -0
  632. package/dist/schema/test-values.d.ts.map +1 -0
  633. package/dist/schema/test-values.js +97 -0
  634. package/dist/schema/test-values.js.map +1 -0
  635. package/dist/schema/unions.d.ts +46 -0
  636. package/dist/schema/unions.d.ts.map +1 -0
  637. package/dist/schema/unions.js +131 -0
  638. package/dist/schema/unions.js.map +1 -0
  639. package/dist/schema/validate-yaml.d.ts +14 -0
  640. package/dist/schema/validate-yaml.d.ts.map +1 -0
  641. package/dist/schema/validate-yaml.js +17 -0
  642. package/dist/schema/validate-yaml.js.map +1 -0
  643. package/dist/schema/validate.d.ts +46 -0
  644. package/dist/schema/validate.d.ts.map +1 -0
  645. package/dist/schema/validate.js +186 -0
  646. package/dist/schema/validate.js.map +1 -0
  647. package/dist/testing.d.ts +21 -0
  648. package/dist/testing.d.ts.map +1 -0
  649. package/dist/testing.js +28 -0
  650. package/dist/testing.js.map +1 -0
  651. package/dist/vocabulary.d.ts +6 -0
  652. package/dist/vocabulary.d.ts.map +1 -0
  653. package/dist/vocabulary.js +26 -0
  654. package/dist/vocabulary.js.map +1 -0
  655. package/package.json +66 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yaml.js","sourceRoot":"","sources":["../../src/ingest/yaml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAE1F,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AA4DzD,4FAA4F;AAC5F,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B;;;;GAIG;AACH,MAAM,aAAa,GAAG;IACpB,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,IAAI;IACX,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,KAAK;IACd,aAAa,EAAE,eAAe;IAC9B,QAAQ,EAAE,QAAQ;IAClB,YAAY,EAAE,KAAK;CACX,CAAC;AAEX,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAC3C,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAC9C;;;;;;;GAOG;AACH,MAAM,wBAAwB,GAAG,qBAAqB,CAAC;AAEvD;;;;;;;;GAQG;AACH,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,6FAA6F;AAC7F,SAAS,iBAAiB,CAAC,KAAc;IACvC,IAAI,KAAK,YAAY,UAAU;QAAE,OAAO,IAAI,CAAC;IAC7C,OAAO,CACL,KAAK,YAAY,KAAK;QACtB,CAAC,oCAAoC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;YACvD,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,OA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C,CAAC;IACzC,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IAClE,MAAM,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IACxC,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,OAAO,QAAQ,CAAC;IAClC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;IAC7B,MAAM,OAAO,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAC9C,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO;YACL,EAAE,EAAE,KAAK;YACT,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC;SAC/D,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AAC7B,CAAC","sourcesContent":["import { restrictedNumberTextRefusal, restrictedValueRefusal } from '@azx-pbc/axiom-runtime';\nimport { isAlias, isMap, isNode, isPair, isScalar, isSeq, parseAllDocuments } from 'yaml';\nimport type { Node, Scalar, YAMLMap } from 'yaml';\nimport { documentMemberPath } from '../document-path.js';\n\n/**\n * The YAML authoring front door.\n *\n * YAML is a way to write the document, never the document's form: this module turns one YAML\n * stream into the plain JavaScript value the restricted profile admits, and nothing downstream\n * can tell which spelling the author used. It parses with the JSON-safe core schema and the\n * options below, so no feature is enabled that would then have to be undone:\n *\n * - `schema: 'core'` resolves only null, booleans, integers, floats and strings. A timestamp is\n * not a core type, so a plain date stays the text it was written as; an explicit\n * `!!timestamp` tag is refused by name rather than silently becoming a `Date`.\n * - `merge: true` makes the parser mark a `<<` key as the merge key, so the walk can refuse it\n * by name. Merge keys are two spellings of \"this member came from there\", which is the drift\n * the document contract refuses.\n * - `uniqueKeys: true` makes the parser report a duplicate mapping key; the walk adds the path\n * and reuses the restricted reader's `duplicate_member` message.\n * - `maxAliasCount` bounds alias expansion, so a \"billion laughs\" document is a refusal rather\n * than a process that runs out of memory.\n *\n * Anchors and aliases are syntax sugar: they are resolved into the plain value before the\n * restriction walk, and an alias that constructs a cycle is refused with the path where the\n * cycle closes rather than followed forever.\n */\n\n/** The construct a YAML refusal names. The diagnostic code stays `YAML_INGEST_ERROR`. */\nexport type YamlRefusalReason =\n | 'empty'\n | 'multiple_documents'\n | 'syntax'\n | 'custom_tag'\n | 'merge_key'\n | 'duplicate_member'\n | 'non_string_key'\n | 'yaml_version'\n | 'alias_limit'\n | 'negative_zero'\n | 'integer'\n | 'unsafe_integer'\n | 'unpaired_surrogate'\n | 'nesting'\n | 'cycle'\n | 'non_json_value';\n\n/** One reason a YAML stream cannot become a document, with the construct and where it is. */\nexport interface YamlRefusal {\n /** The document path in the compiler's `$.a.b[0]` notation. */\n readonly path: string;\n readonly reason: YamlRefusalReason;\n readonly detail: string;\n /** The code-unit offset in the YAML source, when the AST named one. */\n readonly offset?: number;\n}\n\n/** What one YAML stream produced: the plain value, or why it is not one. */\nexport type YamlIngest =\n | { readonly ok: true; readonly value: unknown }\n | { readonly ok: false; readonly refusal: YamlRefusal };\n\n/** One anchor may be expanded this many times before the document is refused as hostile. */\nconst MAX_ALIAS_COUNT = 100;\n\n/**\n * The parser options. Each one is a decision to keep the value JSON-safe, not a convenience:\n * a document that depends on a YAML feature JSON cannot express would make the artifact depend\n * on the authoring format.\n */\nconst PARSE_OPTIONS = {\n schema: 'core',\n merge: true,\n uniqueKeys: true,\n version: '1.2',\n maxAliasCount: MAX_ALIAS_COUNT,\n logLevel: 'silent',\n prettyErrors: false,\n} as const;\n\nconst DUPLICATE_KEY_CODE = 'DUPLICATE_KEY';\nconst TAG_PROBLEM_CODE = 'TAG_RESOLVE_FAILED';\n/**\n * The parser's own code for a stack it could not complete.\n *\n * The `yaml` parser recurses while it builds its syntax tree, so a document deeper than the call\n * stack is reported as `RESOURCE_EXHAUSTION` before this module sees a node. That failure is the\n * profile's `nesting` refusal in everything but name; mapping it here is what stops a hostile\n * document surfacing as a generic syntax error whose detail is a host stack message.\n */\nconst RESOURCE_EXHAUSTION_CODE = 'RESOURCE_EXHAUSTION';\n\n/**\n * The deepest container nesting the restricted profile admits, mirrored from\n * `MAX_NESTING_DEPTH` in the runtime's canonical profile.\n *\n * The YAML front door cannot import the runtime's internal constant, so the number is stated\n * here and `test/robustness/depth.test.ts` pins the two together: 128 levels accept, 129 refuse,\n * on both authoring spellings. The value is used only in a refusal sentence; the enforcement\n * remains the profile's own value walk.\n */\nconst NESTING_LIMIT = 128;\n\n/** Whether a thrown value is the host running out of stack rather than a document defect. */\nfunction isStackExhaustion(cause: unknown): boolean {\n if (cause instanceof RangeError) return true;\n return (\n cause instanceof Error &&\n (/Maximum call stack size exceeded/iu.test(cause.message) ||\n /Stack overflow/iu.test(cause.message))\n );\n}\n\n/** The refusal a recursion cutoff earns, stated in the profile's own vocabulary. */\nfunction nestingRefusal(offset?: number): YamlRefusal {\n return refusal(\n '$',\n 'nesting',\n `nesting deeper than ${String(NESTING_LIMIT)} levels; flatten the mapping so it nests less deeply`,\n offset,\n );\n}\n\nfunction refusal(\n path: string,\n reason: YamlRefusalReason,\n detail: string,\n offset?: number,\n): YamlRefusal {\n return {\n path,\n reason,\n detail,\n ...(offset === undefined ? {} : { offset }),\n };\n}\n\n/** How a node's source spells its tag, in the `!!name` form an author reads. */\nfunction tagSpelling(tag: string): string {\n const prefix = 'tag:yaml.org,2002:';\n return tag.startsWith(prefix) ? `!!${tag.slice(prefix.length)}` : tag;\n}\n\n/** The child path of one mapping member, in the injective notation every diagnostic uses. */\nfunction memberPath(path: string, key: string): string {\n return documentMemberPath(path, key);\n}\n\n/** The name a mapping key contributes to a path, for a key that is a plain scalar. */\nfunction scalarKeyText(node: Scalar<unknown>): string {\n return String(node.value);\n}\n\n/**\n * The refusal an explicit tag earns, with the timestamp named as the case that would otherwise\n * become a non-JSON value. A tag is a format-specific feature; the profile admits plain scalars,\n * so even a tag naming a JSON type is refused rather than trusted to stay harmless.\n *\n * Every node kind is checked, not just a scalar: the parser resolves `!!map` and `!!seq` on a\n * collection without reporting an unresolved tag, so relying on that warning would admit a\n * `!!seq` list as if it were spelling rather than a construct JSON cannot express.\n */\nfunction tagRefusal(node: Node, path: string): YamlRefusal | undefined {\n if (node.tag === undefined) return undefined;\n const spelling = tagSpelling(node.tag);\n const offset = node.range?.[0];\n if (isScalar(node) && node.tag === 'tag:yaml.org,2002:timestamp') {\n return refusal(\n path,\n 'custom_tag',\n `\\`${spelling}\\` would read this scalar as a Date, which JSON cannot state; write the date as a quoted string such as \"2026-03-01\"`,\n offset,\n );\n }\n return refusal(\n path,\n 'custom_tag',\n `a document is plain scalars, and JSON cannot express the explicit tag \\`${spelling}\\`; remove it`,\n offset,\n );\n}\n\n/**\n * The refusal a plain numeric scalar earns when its spelling is not a canonical JSON integer.\n * The text reader's rule is called here, so `0x10`, `1e3` and `1.0` are refused exactly as the\n * same spellings are in JSON.\n */\nfunction numberRefusal(node: Scalar<unknown>, path: string): YamlRefusal | undefined {\n if (node.type !== 'PLAIN' || typeof node.value !== 'number') return undefined;\n const source = node.source;\n if (source === undefined) return undefined;\n const refusalOfText = restrictedNumberTextRefusal(source);\n if (refusalOfText === undefined) return undefined;\n return refusal(path, refusalOfText.reason, refusalOfText.detail, node.range?.[0]);\n}\n\nfunction scalarRefusal(node: Scalar<unknown>, path: string): YamlRefusal | undefined {\n return tagRefusal(node, path) ?? numberRefusal(node, path);\n}\n\n/** One duplicate-key site the parser reported, located in the tree so the diagnostic has a path. */\ninterface DuplicateSite {\n readonly path: string;\n readonly key: string;\n readonly offset: number;\n}\n\n/** Whether `pos` falls inside a node's source range. */\nfunction rangeContains(range: Node['range'], pos: number): boolean {\n return range !== undefined && range !== null && range[0] <= pos && pos < range[1];\n}\n\n/** The mapping or list that holds the node at `pos`, with the path the walk reached it by. */\nfunction locatePair(node: unknown, pos: number, path: string): DuplicateSite | undefined {\n if (isMap(node)) {\n for (const pair of node.items) {\n if (!isPair(pair)) continue;\n const key = pair.key;\n if (isScalar(key) && rangeContains(key.range, pos)) {\n return { path, key: scalarKeyText(key), offset: key.range?.[0] ?? pos };\n }\n if (isScalar(key)) {\n const found = locatePair(pair.value, pos, memberPath(path, scalarKeyText(key)));\n if (found !== undefined) return found;\n continue;\n }\n const found = locatePair(pair.value, pos, path);\n if (found !== undefined) return found;\n }\n return undefined;\n }\n if (isSeq(node)) {\n for (const [index, item] of node.items.entries()) {\n const found = locatePair(item, pos, `${path}[${String(index)}]`);\n if (found !== undefined) return found;\n }\n }\n return undefined;\n}\n\n/** The first reason the parser itself reported, with a duplicate key located by path. */\nfunction parserRefusal(document: {\n readonly errors: readonly {\n readonly code: string;\n readonly message: string;\n readonly pos: readonly [number, number];\n }[];\n readonly contents: unknown;\n}): YamlRefusal | undefined {\n // A stack the parser could not complete is the profile's nesting refusal: the document is\n // deeper than any bound the profile could check after the parse, and the host message is a\n // fact about this engine rather than a diagnosis an author can act on.\n const exhausted = document.errors.find((error) => error.code === RESOURCE_EXHAUSTION_CODE);\n if (exhausted !== undefined) return nestingRefusal(exhausted.pos[0]);\n const duplicate = document.errors.find((error) => error.code === DUPLICATE_KEY_CODE);\n if (duplicate !== undefined) {\n const site = locatePair(document.contents, duplicate.pos[0], '$');\n return refusal(\n site?.path ?? '$',\n 'duplicate_member',\n `duplicate object member ${JSON.stringify(site?.key ?? '')}`,\n site?.offset ?? duplicate.pos[0],\n );\n }\n const first = document.errors[0];\n if (first === undefined) return undefined;\n const detail = first.message.split('\\n')[0] ?? first.message;\n return refusal('$', 'syntax', detail.replace(/ at line \\d+, column \\d+:$/u, ''), first.pos[0]);\n}\n\n/** The warning an unresolved tag produced, if the parser reported one before the walk did. */\nfunction warningRefusal(document: {\n readonly warnings: readonly {\n readonly code: string;\n readonly message: string;\n readonly pos: readonly [number, number];\n }[];\n}): YamlRefusal | undefined {\n const warning = document.warnings.find((entry) => entry.code === TAG_PROBLEM_CODE);\n if (warning === undefined) return undefined;\n const detail = warning.message.split('\\n')[0] ?? warning.message;\n return refusal(\n '$',\n 'custom_tag',\n detail.replace(/ at line \\d+, column \\d+:$/u, ''),\n warning.pos[0],\n );\n}\n\n/**\n * The first strict-profile refusal in one node, with the path the walk reached it by.\n *\n * The walk reads the syntax tree rather than the resolved value so it can name what the value\n * can no longer say: a tag, a merge key, a non-string key, or the source spelling of a number.\n */\nfunction walkNode(node: unknown, path: string): YamlRefusal | undefined {\n if (isAlias(node)) return undefined;\n if (!isNode(node)) return undefined;\n // A tag is refused at the node the author tagged, before any member is read: a mapping or a\n // sequence tagged `!!map`/`!!seq` would otherwise reach the value walk indistinguishable from\n // an untagged one.\n const tagged = tagRefusal(node, path);\n if (tagged !== undefined) return tagged;\n if (isScalar(node)) return numberRefusal(node, path);\n if (isSeq(node)) {\n for (const [index, item] of node.items.entries()) {\n const found = walkNode(item, `${path}[${String(index)}]`);\n if (found !== undefined) return found;\n }\n return undefined;\n }\n if (isMap(node)) return walkMap(node, path);\n return undefined;\n}\n\nfunction walkMap(node: YAMLMap<unknown, unknown>, path: string): YamlRefusal | undefined {\n for (const pair of node.items) {\n if (!isPair(pair)) continue;\n const key = pair.key;\n if (!isScalar(key)) {\n return refusal(\n path,\n 'non_string_key',\n 'a mapping key must be a string; JSON object keys are strings, so a collection or alias key is refused',\n );\n }\n if (key.type === 'PLAIN' && key.source === '<<') {\n return refusal(\n path,\n 'merge_key',\n 'a merge key (`<<`) is refused; write the merged members explicitly in this mapping',\n key.range?.[0],\n );\n }\n if (typeof key.value !== 'string') {\n return refusal(\n path,\n 'non_string_key',\n `a mapping key must be a string, not ${typeof key.value}; JSON object keys are strings`,\n key.range?.[0],\n );\n }\n const keyRefusal = scalarRefusal(key, memberPath(path, key.value));\n if (keyRefusal !== undefined) return keyRefusal;\n const found = walkNode(pair.value, memberPath(path, key.value));\n if (found !== undefined) return found;\n }\n return undefined;\n}\n\n/**\n * Resolves the document into a plain value, refusing an alias expansion the parser considers\n * hostile. A cyclic alias resolves successfully here and is refused by the value walk, which\n * can name the path at which the value contains itself.\n */\nfunction resolveValue(document: {\n toJS(options: { maxAliasCount: number }): unknown;\n}):\n | { readonly ok: true; readonly value: unknown }\n | { readonly ok: false; readonly refusal: YamlRefusal } {\n try {\n return { ok: true, value: document.toJS({ maxAliasCount: MAX_ALIAS_COUNT }) };\n } catch (cause) {\n // A recursion cutoff here is the same profile nesting refusal as one the parser reported:\n // the value tree is too deep for this engine to resolve, not a document the profile could\n // describe. Checking it before the alias rule keeps a stack message out of the diagnosis.\n if (isStackExhaustion(cause)) return { ok: false, refusal: nestingRefusal() };\n const detail = cause instanceof Error ? cause.message : 'the document could not be resolved';\n // The parser refuses an expansion bomb and an alias that names no anchor with the same\n // error class; the message is the only thing that tells them apart, and the repair differs.\n if (/alias count/iu.test(detail)) {\n return {\n ok: false,\n refusal: refusal(\n '$',\n 'alias_limit',\n `the document expands an alias more than ${String(MAX_ALIAS_COUNT)} times: ${detail}`,\n ),\n };\n }\n return {\n ok: false,\n refusal: refusal('$', 'syntax', `the document could not be resolved: ${detail}`),\n };\n }\n}\n\n/**\n * Ingests one YAML stream as the plain value the restricted profile admits.\n *\n * A YAML refusal is the ingestion boundary's own answer: it names the construct, the path and —\n * where the syntax tree carries one — the source offset, so the command line can print the\n * line, the column and the line itself.\n */\nexport function parseRestrictedYaml(source: string): YamlIngest {\n let documents: ReturnType<typeof parseAllDocuments>;\n try {\n documents = parseAllDocuments(source, PARSE_OPTIONS);\n } catch (cause) {\n // A parser that throws its own stack exhaustion has not produced a document to diagnose.\n // The depth is the profile's refusal, so it is answered as one rather than escaping as a\n // host `RangeError`.\n if (isStackExhaustion(cause)) return { ok: false, refusal: nestingRefusal() };\n throw cause;\n }\n if (documents.length === 0) {\n return { ok: false, refusal: refusal('$', 'empty', 'the document is empty') };\n }\n if (documents.length > 1) {\n const second = documents[1];\n return {\n ok: false,\n refusal: refusal(\n '$',\n 'multiple_documents',\n `multiple YAML documents in one stream (${String(documents.length)}); a schema document is one document`,\n second?.range?.[0],\n ),\n };\n }\n const document = documents[0];\n if (document === undefined) {\n return { ok: false, refusal: refusal('$', 'empty', 'the document is empty') };\n }\n // `---` on its own is an empty document, not a null value: the author wrote no content, and\n // saying so is more useful than a metaschema refusal that says the document is not an object.\n if (\n isScalar(document.contents) &&\n document.contents.value === null &&\n document.contents.source === ''\n ) {\n return { ok: false, refusal: refusal('$', 'empty', 'the document is empty') };\n }\n const parser = parserRefusal(document);\n if (parser !== undefined) return { ok: false, refusal: parser };\n const version = document.directives?.yaml;\n if (version?.explicit === true && version.version !== '1.2') {\n return {\n ok: false,\n refusal: refusal(\n '$',\n 'yaml_version',\n `a \\`%YAML ${version.version}\\` directive is refused; the profile is YAML 1.2 and a document may not declare another version`,\n document.range?.[0],\n ),\n };\n }\n // The syntax tree names a tag where the value can no longer say it, so it is walked before the\n // parser's unresolved-tag warning, which states the same fact with less information. The walk\n // itself recurses over the tree, so a tree the parser built but this walk cannot descend is\n // the profile's nesting refusal rather than a host stack error.\n let syntax: YamlRefusal | undefined;\n try {\n syntax = walkNode(document.contents, '$');\n } catch (cause) {\n if (isStackExhaustion(cause)) return { ok: false, refusal: nestingRefusal() };\n throw cause;\n }\n if (syntax !== undefined) return { ok: false, refusal: syntax };\n const warning = warningRefusal(document);\n if (warning !== undefined) return { ok: false, refusal: warning };\n const resolved = resolveValue(document);\n if (!resolved.ok) return resolved;\n const value = resolved.value;\n const profile = restrictedValueRefusal(value);\n if (profile !== undefined) {\n return {\n ok: false,\n refusal: refusal(profile.path, profile.reason, profile.detail),\n };\n }\n return { ok: true, value };\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import type { LayoutNode } from '@azx-pbc/axiom-runtime';
2
+ import type { Compilation } from '../compile/compilation.js';
3
+ import type { RawLayoutNode } from './read.js';
4
+ /** The document's layout compiled into the artifact contract, in declaration order. */
5
+ export declare function compileLayout(compilation: Compilation, layout: readonly RawLayoutNode[]): readonly LayoutNode[];
6
+ //# sourceMappingURL=compile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/layout/compile.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAY,UAAU,EAA6B,MAAM,wBAAwB,CAAC;AAQ9F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAO7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAkQ/C,uFAAuF;AACvF,wBAAgB,aAAa,CAC3B,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,SAAS,aAAa,EAAE,GAC/B,SAAS,UAAU,EAAE,CAEvB"}
@@ -0,0 +1,224 @@
1
+ import { assertNever } from '@azx-pbc/axiom-runtime';
2
+ import { crossCheckExpression, crossCheckMessageBinding, crossCheckParamslessMessage, } from '../compile/cross-checks.js';
3
+ import { refuse } from '../compile/compilation.js';
4
+ import { compileExpressionSlot, compileParams } from '../compile/expression.js';
5
+ import { crossCheckOptionCodes } from '../compile/option-codes.js';
6
+ import { isBoolean, typeName } from '../expr/typecheck/types.js';
7
+ import { isLayoutKind, isLayoutTone } from './grammar.js';
8
+ import { declaredFoldTargets } from './read.js';
9
+ function emptyBinding() {
10
+ return { nodes: {}, paramFields: new Map() };
11
+ }
12
+ /**
13
+ * One chrome expression slot, held to the same checks a rule slot earns.
14
+ *
15
+ * A layout `visibleWhen`, message argument or readout is authored Expr v1, so an option code,
16
+ * a table id or a rule reference in it must be checked exactly as the same text in a rule is.
17
+ * The step folds are gate-only and are refused here by `crossCheckExpression` itself; the
18
+ * option-domain walk has no row scope in chrome, so it answers against top-level paths.
19
+ */
20
+ function checkChromeSlot(compilation, path, node, targetIds) {
21
+ crossCheckExpression(compilation, path, node, undefined, targetIds);
22
+ crossCheckOptionCodes(compilation, path, node, undefined);
23
+ }
24
+ function compileChrome(compilation, node, targetIds) {
25
+ const binding = compileParams(compilation, node.params, node.path, undefined, []);
26
+ for (const [name, expression] of Object.entries(binding.nodes)) {
27
+ checkChromeSlot(compilation, `${node.path}.params.${name}`, expression, targetIds);
28
+ }
29
+ const params = Object.keys(binding.nodes).length === 0 ? undefined : binding.nodes;
30
+ const visibleWhenSlot = node.visibleWhen === undefined
31
+ ? undefined
32
+ : compileExpressionSlot(compilation, node.visibleWhen, `${node.path}.visibleWhen`);
33
+ if (visibleWhenSlot !== undefined) {
34
+ checkChromeSlot(compilation, `${node.path}.visibleWhen`, visibleWhenSlot.node, targetIds);
35
+ }
36
+ // A chrome predicate must produce an outcome (`EXPR-8.1.8`): only a decided `false` hides, and
37
+ // a value of another type has no outcome at all. The presentation channel discards its own
38
+ // diagnostics, so a predicate that can never fire would compile into chrome that is silently
39
+ // never hidden — the refusal has to happen here.
40
+ if (visibleWhenSlot !== undefined && !isBoolean(visibleWhenSlot.type)) {
41
+ refuse(compilation, 'TYPE_MISMATCH', `${node.path}.visibleWhen`, `\`visibleWhen\` decides whether this \`${node.kind}\` is shown, so it must produce a boolean outcome; this expression produces ${typeName(visibleWhenSlot.type)}, which decides nothing and would leave the node visible on every record`, { expected: 'boolean' });
42
+ }
43
+ return { visibleWhen: visibleWhenSlot?.node, params, binding };
44
+ }
45
+ /** One chrome message's arguments against the node's own `params` block. */
46
+ function checkChromeMessage(compilation, node, member, key, binding) {
47
+ if (key === undefined)
48
+ return;
49
+ const use = {
50
+ key,
51
+ path: `${node.path}.${member}`,
52
+ owner: `layout \`${node.kind}\``,
53
+ binding,
54
+ };
55
+ if (Object.keys(binding.nodes).length === 0)
56
+ crossCheckParamslessMessage(compilation, use);
57
+ else
58
+ crossCheckMessageBinding(compilation, use);
59
+ }
60
+ function compileChildren(compilation, nodes, targetIds) {
61
+ return nodes.flatMap((child) => {
62
+ const compiled = compileNode(compilation, child, targetIds);
63
+ return compiled === undefined ? [] : [compiled];
64
+ });
65
+ }
66
+ function compileReadouts(compilation, node, targetIds) {
67
+ const readouts = node.readouts.flatMap((readout) => {
68
+ if (readout.labelKey === undefined)
69
+ return [];
70
+ const slot = compileExpressionSlot(compilation, readout.value, `${readout.path}.value`);
71
+ if (slot === undefined)
72
+ return [];
73
+ checkChromeSlot(compilation, `${readout.path}.value`, slot.node, targetIds);
74
+ return [{ labelKey: readout.labelKey, value: slot.node }];
75
+ });
76
+ return readouts.length === 0 ? undefined : readouts;
77
+ }
78
+ function compileTone(node) {
79
+ return node.tone !== undefined && isLayoutTone(node.tone) ? node.tone : 'info';
80
+ }
81
+ /** One node compiled into the artifact's layout contract, or `undefined` when it cannot be. */
82
+ function compileNode(compilation, node, targetIds) {
83
+ if (!isLayoutKind(node.kind))
84
+ return undefined;
85
+ switch (node.kind) {
86
+ case 'section': {
87
+ if (node.titleKey === undefined)
88
+ return undefined;
89
+ const chrome = compileChrome(compilation, node, targetIds);
90
+ checkChromeMessage(compilation, node, 'titleKey', node.titleKey, chrome.binding);
91
+ return {
92
+ kind: 'section',
93
+ ...(node.sectionId === undefined ? {} : { sectionId: node.sectionId }),
94
+ titleKey: node.titleKey,
95
+ ...(node.descriptionKey === undefined ? {} : { descriptionKey: node.descriptionKey }),
96
+ columns: node.columns ?? 1,
97
+ ...(node.collapsible === undefined ? {} : { collapsible: node.collapsible }),
98
+ ...(node.defaultExpanded === undefined ? {} : { defaultExpanded: node.defaultExpanded }),
99
+ ...(node.hideWhenEmpty === undefined ? {} : { hideWhenEmpty: node.hideWhenEmpty }),
100
+ ...(chrome.visibleWhen === undefined ? {} : { visibleWhen: chrome.visibleWhen }),
101
+ children: compileChildren(compilation, node.children, targetIds),
102
+ };
103
+ }
104
+ case 'group': {
105
+ checkChromeMessage(compilation, node, 'titleKey', node.titleKey, emptyBinding());
106
+ return {
107
+ kind: 'group',
108
+ ...(node.titleKey === undefined ? {} : { titleKey: node.titleKey }),
109
+ ...(node.descriptionKey === undefined ? {} : { descriptionKey: node.descriptionKey }),
110
+ columns: node.columns ?? 1,
111
+ ...(node.collapsible === undefined ? {} : { collapsible: node.collapsible }),
112
+ ...(node.defaultExpanded === undefined ? {} : { defaultExpanded: node.defaultExpanded }),
113
+ ...(node.hideWhenEmpty === undefined ? {} : { hideWhenEmpty: node.hideWhenEmpty }),
114
+ children: compileChildren(compilation, node.children, targetIds),
115
+ };
116
+ }
117
+ case 'wizard':
118
+ return {
119
+ kind: 'wizard',
120
+ children: node.children.flatMap((child) => {
121
+ if (child.kind !== 'step')
122
+ return [];
123
+ const compiled = compileNode(compilation, child, targetIds);
124
+ return compiled?.kind === 'step' ? [compiled] : [];
125
+ }),
126
+ };
127
+ case 'step': {
128
+ if (node.stepId === undefined || node.titleKey === undefined)
129
+ return undefined;
130
+ const chrome = compileChrome(compilation, node, targetIds);
131
+ checkChromeMessage(compilation, node, 'titleKey', node.titleKey, chrome.binding);
132
+ return {
133
+ kind: 'step',
134
+ stepId: node.stepId,
135
+ titleKey: node.titleKey,
136
+ ...(node.descriptionKey === undefined ? {} : { descriptionKey: node.descriptionKey }),
137
+ ...(node.sectionId === undefined ? {} : { sectionId: node.sectionId }),
138
+ ...(node.gateId === undefined ? {} : { gateId: node.gateId }),
139
+ ...(node.hideWhenEmpty === undefined ? {} : { hideWhenEmpty: node.hideWhenEmpty }),
140
+ columns: node.columns ?? 1,
141
+ ...(chrome.visibleWhen === undefined ? {} : { visibleWhen: chrome.visibleWhen }),
142
+ children: compileChildren(compilation, node.children, targetIds),
143
+ };
144
+ }
145
+ case 'field': {
146
+ if (node.fieldId === undefined)
147
+ return undefined;
148
+ return {
149
+ kind: 'field',
150
+ fieldId: node.fieldId,
151
+ colSpan: node.colSpan ?? 1,
152
+ };
153
+ }
154
+ case 'heading': {
155
+ if (node.titleKey === undefined)
156
+ return undefined;
157
+ const binding = emptyBinding();
158
+ checkChromeMessage(compilation, node, 'titleKey', node.titleKey, binding);
159
+ checkChromeMessage(compilation, node, 'textKey', node.textKey, binding);
160
+ return {
161
+ kind: 'heading',
162
+ titleKey: node.titleKey,
163
+ ...(node.textKey === undefined ? {} : { textKey: node.textKey }),
164
+ };
165
+ }
166
+ case 'callout': {
167
+ if (node.textKey === undefined)
168
+ return undefined;
169
+ const chrome = compileChrome(compilation, node, targetIds);
170
+ checkChromeMessage(compilation, node, 'titleKey', node.titleKey, chrome.binding);
171
+ checkChromeMessage(compilation, node, 'textKey', node.textKey, chrome.binding);
172
+ return {
173
+ kind: 'callout',
174
+ tone: compileTone(node),
175
+ ...(node.titleKey === undefined ? {} : { titleKey: node.titleKey }),
176
+ textKey: node.textKey,
177
+ ...(chrome.params === undefined ? {} : { params: chrome.params }),
178
+ ...(chrome.visibleWhen === undefined ? {} : { visibleWhen: chrome.visibleWhen }),
179
+ };
180
+ }
181
+ case 'divider':
182
+ return { kind: 'divider' };
183
+ case 'sop_block': {
184
+ if (node.titleKey === undefined)
185
+ return undefined;
186
+ const chrome = compileChrome(compilation, node, targetIds);
187
+ checkChromeMessage(compilation, node, 'titleKey', node.titleKey, chrome.binding);
188
+ checkChromeMessage(compilation, node, 'textKey', node.textKey, chrome.binding);
189
+ return {
190
+ kind: 'sop_block',
191
+ ...(node.sectionId === undefined ? {} : { sectionId: node.sectionId }),
192
+ titleKey: node.titleKey,
193
+ ...(node.textKey === undefined ? {} : { textKey: node.textKey }),
194
+ ...(chrome.params === undefined ? {} : { params: chrome.params }),
195
+ ...(chrome.visibleWhen === undefined ? {} : { visibleWhen: chrome.visibleWhen }),
196
+ };
197
+ }
198
+ case 'summary_card': {
199
+ if (node.titleKey === undefined)
200
+ return undefined;
201
+ const chrome = compileChrome(compilation, node, targetIds);
202
+ checkChromeMessage(compilation, node, 'titleKey', node.titleKey, chrome.binding);
203
+ checkChromeMessage(compilation, node, 'textKey', node.textKey, chrome.binding);
204
+ const readouts = compileReadouts(compilation, node, targetIds);
205
+ return {
206
+ kind: 'summary_card',
207
+ ...(node.sectionId === undefined ? {} : { sectionId: node.sectionId }),
208
+ titleKey: node.titleKey,
209
+ ...(node.textKey === undefined ? {} : { textKey: node.textKey }),
210
+ ...(chrome.params === undefined ? {} : { params: chrome.params }),
211
+ ...(readouts === undefined ? {} : { readouts }),
212
+ ...(node.fields.length === 0 ? {} : { fields: node.fields }),
213
+ ...(chrome.visibleWhen === undefined ? {} : { visibleWhen: chrome.visibleWhen }),
214
+ };
215
+ }
216
+ default:
217
+ return assertNever(node.kind);
218
+ }
219
+ }
220
+ /** The document's layout compiled into the artifact contract, in declaration order. */
221
+ export function compileLayout(compilation, layout) {
222
+ return compileChildren(compilation, layout, declaredFoldTargets(layout));
223
+ }
224
+ //# sourceMappingURL=compile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile.js","sourceRoot":"","sources":["../../src/layout/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAGnD,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAoBhD,SAAS,YAAY;IACnB,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;AAC/C,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,eAAe,CACtB,WAAwB,EACxB,IAAY,EACZ,IAAc,EACd,SAA8B;IAE9B,oBAAoB,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IACpE,qBAAqB,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,SAA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EAAE,IAAI,CAAC,QAAQ;gBACvB,GAAG,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;gBAChE,GAAG,CAAC,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;gBACjE,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC;gBAC/C,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;gBAC5D,GAAG,CAAC,MAAM,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC;aACjF,CAAC;QACJ,CAAC;QACD;YACE,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;AACH,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,aAAa,CAC3B,WAAwB,EACxB,MAAgC;IAEhC,OAAO,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;AAC3E,CAAC","sourcesContent":["import { assertNever } from '@azx-pbc/axiom-runtime';\nimport type { ExprNode, LayoutNode, LayoutReadout, LayoutTone } from '@azx-pbc/axiom-runtime';\nimport {\n crossCheckExpression,\n crossCheckMessageBinding,\n crossCheckParamslessMessage,\n} from '../compile/cross-checks.js';\nimport type { MessageUse } from '../compile/cross-checks.js';\nimport { refuse } from '../compile/compilation.js';\nimport type { Compilation } from '../compile/compilation.js';\nimport type { CompiledMessageBinding } from '../compile/expression.js';\nimport { compileExpressionSlot, compileParams } from '../compile/expression.js';\nimport { crossCheckOptionCodes } from '../compile/option-codes.js';\nimport { isBoolean, typeName } from '../expr/typecheck/types.js';\nimport { isLayoutKind, isLayoutTone } from './grammar.js';\nimport { declaredFoldTargets } from './read.js';\nimport type { RawLayoutNode } from './read.js';\n\n/**\n * Layout expression compilation: `visibleWhen`, message `params` and summary-card `readouts`\n * are compiled through the same typed expression path as a rule, so a chrome predicate is\n * checked against the document's fields and datasets before it can reach a device.\n *\n * The walk reads the shape the structural check already admitted. A node it cannot place is\n * left out rather than thrown over: the document has failed, and the diagnostics that say why\n * were recorded before this stage ran.\n */\n\n/** The compiled expressions one chrome node carries, with the message arguments they bind. */\ninterface CompiledChrome {\n readonly visibleWhen: ExprNode | undefined;\n readonly params: Readonly<Record<string, ExprNode>> | undefined;\n readonly binding: CompiledMessageBinding;\n}\n\nfunction emptyBinding(): CompiledMessageBinding {\n return { nodes: {}, paramFields: new Map() };\n}\n\n/**\n * One chrome expression slot, held to the same checks a rule slot earns.\n *\n * A layout `visibleWhen`, message argument or readout is authored Expr v1, so an option code,\n * a table id or a rule reference in it must be checked exactly as the same text in a rule is.\n * The step folds are gate-only and are refused here by `crossCheckExpression` itself; the\n * option-domain walk has no row scope in chrome, so it answers against top-level paths.\n */\nfunction checkChromeSlot(\n compilation: Compilation,\n path: string,\n node: ExprNode,\n targetIds: ReadonlySet<string>,\n): void {\n crossCheckExpression(compilation, path, node, undefined, targetIds);\n crossCheckOptionCodes(compilation, path, node, undefined);\n}\n\nfunction compileChrome(\n compilation: Compilation,\n node: RawLayoutNode,\n targetIds: ReadonlySet<string>,\n): CompiledChrome {\n const binding = compileParams(compilation, node.params, node.path, undefined, []);\n for (const [name, expression] of Object.entries(binding.nodes)) {\n checkChromeSlot(compilation, `${node.path}.params.${name}`, expression, targetIds);\n }\n const params = Object.keys(binding.nodes).length === 0 ? undefined : binding.nodes;\n const visibleWhenSlot =\n node.visibleWhen === undefined\n ? undefined\n : compileExpressionSlot(compilation, node.visibleWhen, `${node.path}.visibleWhen`);\n if (visibleWhenSlot !== undefined) {\n checkChromeSlot(compilation, `${node.path}.visibleWhen`, visibleWhenSlot.node, targetIds);\n }\n // A chrome predicate must produce an outcome (`EXPR-8.1.8`): only a decided `false` hides, and\n // a value of another type has no outcome at all. The presentation channel discards its own\n // diagnostics, so a predicate that can never fire would compile into chrome that is silently\n // never hidden — the refusal has to happen here.\n if (visibleWhenSlot !== undefined && !isBoolean(visibleWhenSlot.type)) {\n refuse(\n compilation,\n 'TYPE_MISMATCH',\n `${node.path}.visibleWhen`,\n `\\`visibleWhen\\` decides whether this \\`${node.kind}\\` is shown, so it must produce a boolean outcome; this expression produces ${typeName(visibleWhenSlot.type)}, which decides nothing and would leave the node visible on every record`,\n { expected: 'boolean' },\n );\n }\n return { visibleWhen: visibleWhenSlot?.node, params, binding };\n}\n\n/** One chrome message's arguments against the node's own `params` block. */\nfunction checkChromeMessage(\n compilation: Compilation,\n node: RawLayoutNode,\n member: 'titleKey' | 'textKey',\n key: string | undefined,\n binding: CompiledMessageBinding,\n): void {\n if (key === undefined) return;\n const use: MessageUse = {\n key,\n path: `${node.path}.${member}`,\n owner: `layout \\`${node.kind}\\``,\n binding,\n };\n if (Object.keys(binding.nodes).length === 0) crossCheckParamslessMessage(compilation, use);\n else crossCheckMessageBinding(compilation, use);\n}\n\nfunction compileChildren(\n compilation: Compilation,\n nodes: readonly RawLayoutNode[],\n targetIds: ReadonlySet<string>,\n): readonly LayoutNode[] {\n return nodes.flatMap((child) => {\n const compiled = compileNode(compilation, child, targetIds);\n return compiled === undefined ? [] : [compiled];\n });\n}\n\nfunction compileReadouts(\n compilation: Compilation,\n node: RawLayoutNode,\n targetIds: ReadonlySet<string>,\n): readonly LayoutReadout[] | undefined {\n const readouts = node.readouts.flatMap((readout) => {\n if (readout.labelKey === undefined) return [];\n const slot = compileExpressionSlot(compilation, readout.value, `${readout.path}.value`);\n if (slot === undefined) return [];\n checkChromeSlot(compilation, `${readout.path}.value`, slot.node, targetIds);\n return [{ labelKey: readout.labelKey, value: slot.node }];\n });\n return readouts.length === 0 ? undefined : readouts;\n}\n\nfunction compileTone(node: RawLayoutNode): LayoutTone {\n return node.tone !== undefined && isLayoutTone(node.tone) ? node.tone : 'info';\n}\n\n/** One node compiled into the artifact's layout contract, or `undefined` when it cannot be. */\nfunction compileNode(\n compilation: Compilation,\n node: RawLayoutNode,\n targetIds: ReadonlySet<string>,\n): LayoutNode | undefined {\n if (!isLayoutKind(node.kind)) return undefined;\n switch (node.kind) {\n case 'section': {\n if (node.titleKey === undefined) return undefined;\n const chrome = compileChrome(compilation, node, targetIds);\n checkChromeMessage(compilation, node, 'titleKey', node.titleKey, chrome.binding);\n return {\n kind: 'section',\n ...(node.sectionId === undefined ? {} : { sectionId: node.sectionId }),\n titleKey: node.titleKey,\n ...(node.descriptionKey === undefined ? {} : { descriptionKey: node.descriptionKey }),\n columns: node.columns ?? 1,\n ...(node.collapsible === undefined ? {} : { collapsible: node.collapsible }),\n ...(node.defaultExpanded === undefined ? {} : { defaultExpanded: node.defaultExpanded }),\n ...(node.hideWhenEmpty === undefined ? {} : { hideWhenEmpty: node.hideWhenEmpty }),\n ...(chrome.visibleWhen === undefined ? {} : { visibleWhen: chrome.visibleWhen }),\n children: compileChildren(compilation, node.children, targetIds),\n };\n }\n case 'group': {\n checkChromeMessage(compilation, node, 'titleKey', node.titleKey, emptyBinding());\n return {\n kind: 'group',\n ...(node.titleKey === undefined ? {} : { titleKey: node.titleKey }),\n ...(node.descriptionKey === undefined ? {} : { descriptionKey: node.descriptionKey }),\n columns: node.columns ?? 1,\n ...(node.collapsible === undefined ? {} : { collapsible: node.collapsible }),\n ...(node.defaultExpanded === undefined ? {} : { defaultExpanded: node.defaultExpanded }),\n ...(node.hideWhenEmpty === undefined ? {} : { hideWhenEmpty: node.hideWhenEmpty }),\n children: compileChildren(compilation, node.children, targetIds),\n };\n }\n case 'wizard':\n return {\n kind: 'wizard',\n children: node.children.flatMap((child) => {\n if (child.kind !== 'step') return [];\n const compiled = compileNode(compilation, child, targetIds);\n return compiled?.kind === 'step' ? [compiled] : [];\n }),\n };\n case 'step': {\n if (node.stepId === undefined || node.titleKey === undefined) return undefined;\n const chrome = compileChrome(compilation, node, targetIds);\n checkChromeMessage(compilation, node, 'titleKey', node.titleKey, chrome.binding);\n return {\n kind: 'step',\n stepId: node.stepId,\n titleKey: node.titleKey,\n ...(node.descriptionKey === undefined ? {} : { descriptionKey: node.descriptionKey }),\n ...(node.sectionId === undefined ? {} : { sectionId: node.sectionId }),\n ...(node.gateId === undefined ? {} : { gateId: node.gateId }),\n ...(node.hideWhenEmpty === undefined ? {} : { hideWhenEmpty: node.hideWhenEmpty }),\n columns: node.columns ?? 1,\n ...(chrome.visibleWhen === undefined ? {} : { visibleWhen: chrome.visibleWhen }),\n children: compileChildren(compilation, node.children, targetIds),\n };\n }\n case 'field': {\n if (node.fieldId === undefined) return undefined;\n return {\n kind: 'field',\n fieldId: node.fieldId,\n colSpan: node.colSpan ?? 1,\n };\n }\n case 'heading': {\n if (node.titleKey === undefined) return undefined;\n const binding = emptyBinding();\n checkChromeMessage(compilation, node, 'titleKey', node.titleKey, binding);\n checkChromeMessage(compilation, node, 'textKey', node.textKey, binding);\n return {\n kind: 'heading',\n titleKey: node.titleKey,\n ...(node.textKey === undefined ? {} : { textKey: node.textKey }),\n };\n }\n case 'callout': {\n if (node.textKey === undefined) return undefined;\n const chrome = compileChrome(compilation, node, targetIds);\n checkChromeMessage(compilation, node, 'titleKey', node.titleKey, chrome.binding);\n checkChromeMessage(compilation, node, 'textKey', node.textKey, chrome.binding);\n return {\n kind: 'callout',\n tone: compileTone(node),\n ...(node.titleKey === undefined ? {} : { titleKey: node.titleKey }),\n textKey: node.textKey,\n ...(chrome.params === undefined ? {} : { params: chrome.params }),\n ...(chrome.visibleWhen === undefined ? {} : { visibleWhen: chrome.visibleWhen }),\n };\n }\n case 'divider':\n return { kind: 'divider' };\n case 'sop_block': {\n if (node.titleKey === undefined) return undefined;\n const chrome = compileChrome(compilation, node, targetIds);\n checkChromeMessage(compilation, node, 'titleKey', node.titleKey, chrome.binding);\n checkChromeMessage(compilation, node, 'textKey', node.textKey, chrome.binding);\n return {\n kind: 'sop_block',\n ...(node.sectionId === undefined ? {} : { sectionId: node.sectionId }),\n titleKey: node.titleKey,\n ...(node.textKey === undefined ? {} : { textKey: node.textKey }),\n ...(chrome.params === undefined ? {} : { params: chrome.params }),\n ...(chrome.visibleWhen === undefined ? {} : { visibleWhen: chrome.visibleWhen }),\n };\n }\n case 'summary_card': {\n if (node.titleKey === undefined) return undefined;\n const chrome = compileChrome(compilation, node, targetIds);\n checkChromeMessage(compilation, node, 'titleKey', node.titleKey, chrome.binding);\n checkChromeMessage(compilation, node, 'textKey', node.textKey, chrome.binding);\n const readouts = compileReadouts(compilation, node, targetIds);\n return {\n kind: 'summary_card',\n ...(node.sectionId === undefined ? {} : { sectionId: node.sectionId }),\n titleKey: node.titleKey,\n ...(node.textKey === undefined ? {} : { textKey: node.textKey }),\n ...(chrome.params === undefined ? {} : { params: chrome.params }),\n ...(readouts === undefined ? {} : { readouts }),\n ...(node.fields.length === 0 ? {} : { fields: node.fields }),\n ...(chrome.visibleWhen === undefined ? {} : { visibleWhen: chrome.visibleWhen }),\n };\n }\n default:\n return assertNever(node.kind);\n }\n}\n\n/** The document's layout compiled into the artifact contract, in declaration order. */\nexport function compileLayout(\n compilation: Compilation,\n layout: readonly RawLayoutNode[],\n): readonly LayoutNode[] {\n return compileChildren(compilation, layout, declaredFoldTargets(layout));\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import type { LayoutShapeContext } from './shape.js';
2
+ /**
3
+ * The document facts the layout walk answers against, read from the document itself.
4
+ *
5
+ * `layoutShapeErrors` decides containment, C11, field placement, `colSpan` fit and anchor
6
+ * resolution, but it can only do that if it knows which fields, section anchors and gates the
7
+ * document declares. That reading is the same for every caller — the compile and an authoring
8
+ * store that checks a draft before compiling it — so it lives here once instead of being spelled
9
+ * again beside each walk.
10
+ */
11
+ export declare function layoutShapeContext(document: Record<string, unknown>): LayoutShapeContext;
12
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/layout/context.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,kBAAkB,CAYxF"}
@@ -0,0 +1,26 @@
1
+ import { isRecord } from '@azx-pbc/axiom-runtime';
2
+ import { declaredSectionIds, fieldsById } from '../compile/declarations.js';
3
+ import { listAt, textAt } from '../compile/document.js';
4
+ import { declaredFields } from '../schema/document.js';
5
+ /**
6
+ * The document facts the layout walk answers against, read from the document itself.
7
+ *
8
+ * `layoutShapeErrors` decides containment, C11, field placement, `colSpan` fit and anchor
9
+ * resolution, but it can only do that if it knows which fields, section anchors and gates the
10
+ * document declares. That reading is the same for every caller — the compile and an authoring
11
+ * store that checks a draft before compiling it — so it lives here once instead of being spelled
12
+ * again beside each walk.
13
+ */
14
+ export function layoutShapeContext(document) {
15
+ return {
16
+ fieldIds: new Set(fieldsById([...declaredFields(document).values()]).keys()),
17
+ sectionIds: declaredSectionIds(document),
18
+ gateIds: new Set(listAt(document, 'rules').flatMap((rule) => {
19
+ if (!isRecord(rule) || textAt(rule, 'kind') !== 'gate')
20
+ return [];
21
+ const ruleId = textAt(rule, 'ruleId');
22
+ return ruleId === undefined ? [] : [ruleId];
23
+ })),
24
+ };
25
+ }
26
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/layout/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAiC;IAClE,OAAO;QACL,QAAQ,EAAE,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC5E,UAAU,EAAE,kBAAkB,CAAC,QAAQ,CAAC;QACxC,OAAO,EAAE,IAAI,GAAG,CACd,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACzC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,MAAM;gBAAE,OAAO,EAAE,CAAC;YAClE,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YACtC,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QAC9C,CAAC,CAAC,CACH;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { isRecord } from '@azx-pbc/axiom-runtime';\nimport { declaredSectionIds, fieldsById } from '../compile/declarations.js';\nimport { listAt, textAt } from '../compile/document.js';\nimport { declaredFields } from '../schema/document.js';\nimport type { LayoutShapeContext } from './shape.js';\n\n/**\n * The document facts the layout walk answers against, read from the document itself.\n *\n * `layoutShapeErrors` decides containment, C11, field placement, `colSpan` fit and anchor\n * resolution, but it can only do that if it knows which fields, section anchors and gates the\n * document declares. That reading is the same for every caller — the compile and an authoring\n * store that checks a draft before compiling it — so it lives here once instead of being spelled\n * again beside each walk.\n */\nexport function layoutShapeContext(document: Record<string, unknown>): LayoutShapeContext {\n return {\n fieldIds: new Set(fieldsById([...declaredFields(document).values()]).keys()),\n sectionIds: declaredSectionIds(document),\n gateIds: new Set(\n listAt(document, 'rules').flatMap((rule) => {\n if (!isRecord(rule) || textAt(rule, 'kind') !== 'gate') return [];\n const ruleId = textAt(rule, 'ruleId');\n return ruleId === undefined ? [] : [ruleId];\n }),\n ),\n };\n}\n"]}
@@ -0,0 +1,34 @@
1
+ import type { LayoutTone } from '@azx-pbc/axiom-runtime';
2
+ /**
3
+ * The one authority for the closed layout grammar: the ten node kinds, the members each kind
4
+ * admits, and which kinds a node may contain.
5
+ *
6
+ * The metaschema closes the same shape for a wire document and a generated drift test compares
7
+ * the two member lists, so a kind or member added to only one place fails a gate. The compiler
8
+ * reads this table to narrow a validated document; no second list of layout members exists.
9
+ */
10
+ /** Every node kind the grammar admits, `MODEL-3.1.1`. */
11
+ export declare const LAYOUT_KINDS: readonly ['section', 'group', 'wizard', 'step', 'field', 'heading', 'callout', 'divider', 'sop_block', 'summary_card'];
12
+ /** One node kind of the closed layout grammar. */
13
+ export type LayoutKind = (typeof LAYOUT_KINDS)[number];
14
+ /** The emphasis vocabulary a callout states. */
15
+ export declare const LAYOUT_TONES: readonly LayoutTone[];
16
+ /** Every member a layout node of any kind may state. A drift gate compares this with the metaschema. */
17
+ export declare const LAYOUT_MEMBERS: readonly string[];
18
+ /** Whether a document's spelling names a kind of the closed grammar. */
19
+ export declare function isLayoutKind(value: string): value is LayoutKind;
20
+ /** Whether a document's spelling names a callout tone the contract admits. */
21
+ export declare function isLayoutTone(value: string): value is LayoutTone;
22
+ /** Whether a node of this kind holds children at all. */
23
+ export declare function admitsChildren(kind: LayoutKind): boolean;
24
+ /**
25
+ * Whether `child` may appear directly inside `parent`. `undefined` is the document's layout
26
+ * root, which admits every kind but a step.
27
+ */
28
+ export declare function admitsChild(parent: LayoutKind | undefined, child: LayoutKind): boolean;
29
+ /**
30
+ * The members of a node of `kind` that the kind does not admit, so the caller can refuse a
31
+ * member the metaschema closed globally but this kind has no meaning for.
32
+ */
33
+ export declare function foreignMembers(kind: LayoutKind, members: readonly string[]): readonly string[];
34
+ //# sourceMappingURL=grammar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grammar.d.ts","sourceRoot":"","sources":["../../src/layout/grammar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;;;;;;GAOG;AAEH,yDAAyD;AACzD,eAAO,MAAM,YAAY,YACvB,SAAS,EACT,OAAO,EACP,QAAQ,EACR,MAAM,EACN,OAAO,EACP,SAAS,EACT,SAAS,EACT,SAAS,EACT,WAAW,EACX,cAAc,CACN,CAAC;AAEX,kDAAkD;AAClD,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,gDAAgD;AAChD,eAAO,MAAM,YAAY,EAAE,SAAS,UAAU,EAA6C,CAAC;AA+C5F,wGAAwG;AACxG,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAoB3C,CAAC;AAwDF,wEAAwE;AACxE,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,UAAU,CAE/D;AAED,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,UAAU,CAE/D;AAED,yDAAyD;AACzD,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAExD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAItF;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,CAG9F"}
@@ -0,0 +1,171 @@
1
+ /**
2
+ * The one authority for the closed layout grammar: the ten node kinds, the members each kind
3
+ * admits, and which kinds a node may contain.
4
+ *
5
+ * The metaschema closes the same shape for a wire document and a generated drift test compares
6
+ * the two member lists, so a kind or member added to only one place fails a gate. The compiler
7
+ * reads this table to narrow a validated document; no second list of layout members exists.
8
+ */
9
+ /** Every node kind the grammar admits, `MODEL-3.1.1`. */
10
+ export const LAYOUT_KINDS = [
11
+ 'section',
12
+ 'group',
13
+ 'wizard',
14
+ 'step',
15
+ 'field',
16
+ 'heading',
17
+ 'callout',
18
+ 'divider',
19
+ 'sop_block',
20
+ 'summary_card',
21
+ ];
22
+ /** The emphasis vocabulary a callout states. */
23
+ export const LAYOUT_TONES = ['info', 'warning', 'danger', 'success'];
24
+ /** The kinds a top-level layout array may hold. A `step` lives only inside a `wizard`. */
25
+ const TOP_LEVEL_KINDS = [
26
+ 'section',
27
+ 'group',
28
+ 'wizard',
29
+ 'field',
30
+ 'heading',
31
+ 'callout',
32
+ 'divider',
33
+ 'sop_block',
34
+ 'summary_card',
35
+ ];
36
+ /** The kinds one node may hold directly. A leaf holds none. */
37
+ const CHILD_KINDS = {
38
+ section: [
39
+ 'section',
40
+ 'group',
41
+ 'field',
42
+ 'heading',
43
+ 'callout',
44
+ 'divider',
45
+ 'sop_block',
46
+ 'summary_card',
47
+ ],
48
+ group: [
49
+ 'section',
50
+ 'group',
51
+ 'field',
52
+ 'heading',
53
+ 'callout',
54
+ 'divider',
55
+ 'sop_block',
56
+ 'summary_card',
57
+ ],
58
+ wizard: ['step'],
59
+ step: ['section', 'group', 'field', 'heading', 'callout', 'divider', 'sop_block', 'summary_card'],
60
+ field: [],
61
+ heading: [],
62
+ callout: [],
63
+ divider: [],
64
+ sop_block: [],
65
+ summary_card: [],
66
+ };
67
+ /** Every member a layout node of any kind may state. A drift gate compares this with the metaschema. */
68
+ export const LAYOUT_MEMBERS = [
69
+ 'kind',
70
+ 'sectionId',
71
+ 'titleKey',
72
+ 'descriptionKey',
73
+ 'textKey',
74
+ 'visibleWhen',
75
+ 'params',
76
+ 'readouts',
77
+ 'fields',
78
+ 'children',
79
+ 'columns',
80
+ 'collapsible',
81
+ 'defaultExpanded',
82
+ 'hideWhenEmpty',
83
+ 'stepId',
84
+ 'gateId',
85
+ 'fieldId',
86
+ 'colSpan',
87
+ 'tone',
88
+ ];
89
+ /** The members one kind admits, `kind` included. */
90
+ const MEMBERS_BY_KIND = {
91
+ section: [
92
+ 'kind',
93
+ 'sectionId',
94
+ 'titleKey',
95
+ 'descriptionKey',
96
+ 'columns',
97
+ 'collapsible',
98
+ 'defaultExpanded',
99
+ 'hideWhenEmpty',
100
+ 'visibleWhen',
101
+ 'children',
102
+ ],
103
+ group: [
104
+ 'kind',
105
+ 'titleKey',
106
+ 'descriptionKey',
107
+ 'columns',
108
+ 'collapsible',
109
+ 'defaultExpanded',
110
+ 'hideWhenEmpty',
111
+ 'children',
112
+ ],
113
+ wizard: ['kind', 'children'],
114
+ step: [
115
+ 'kind',
116
+ 'stepId',
117
+ 'titleKey',
118
+ 'descriptionKey',
119
+ 'sectionId',
120
+ 'gateId',
121
+ 'hideWhenEmpty',
122
+ 'columns',
123
+ 'visibleWhen',
124
+ 'children',
125
+ ],
126
+ field: ['kind', 'fieldId', 'colSpan'],
127
+ heading: ['kind', 'titleKey', 'textKey'],
128
+ callout: ['kind', 'visibleWhen', 'titleKey', 'textKey', 'tone', 'params'],
129
+ divider: ['kind'],
130
+ sop_block: ['kind', 'sectionId', 'titleKey', 'textKey', 'params', 'visibleWhen'],
131
+ summary_card: [
132
+ 'kind',
133
+ 'sectionId',
134
+ 'titleKey',
135
+ 'textKey',
136
+ 'params',
137
+ 'readouts',
138
+ 'fields',
139
+ 'visibleWhen',
140
+ ],
141
+ };
142
+ /** Whether a document's spelling names a kind of the closed grammar. */
143
+ export function isLayoutKind(value) {
144
+ return LAYOUT_KINDS.includes(value);
145
+ }
146
+ /** Whether a document's spelling names a callout tone the contract admits. */
147
+ export function isLayoutTone(value) {
148
+ return LAYOUT_TONES.includes(value);
149
+ }
150
+ /** Whether a node of this kind holds children at all. */
151
+ export function admitsChildren(kind) {
152
+ return CHILD_KINDS[kind].length > 0;
153
+ }
154
+ /**
155
+ * Whether `child` may appear directly inside `parent`. `undefined` is the document's layout
156
+ * root, which admits every kind but a step.
157
+ */
158
+ export function admitsChild(parent, child) {
159
+ return parent === undefined
160
+ ? TOP_LEVEL_KINDS.includes(child)
161
+ : CHILD_KINDS[parent].includes(child);
162
+ }
163
+ /**
164
+ * The members of a node of `kind` that the kind does not admit, so the caller can refuse a
165
+ * member the metaschema closed globally but this kind has no meaning for.
166
+ */
167
+ export function foreignMembers(kind, members) {
168
+ const admitted = MEMBERS_BY_KIND[kind];
169
+ return members.filter((member) => !admitted.includes(member));
170
+ }
171
+ //# sourceMappingURL=grammar.js.map