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

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,265 @@
1
+ import { isRecord, tryDecimalString } from '@azx-pbc/axiom-runtime';
2
+ import { indefiniteArticle, withArticle } from '../article.js';
3
+ import { closestNames } from '../expr/suggest.js';
4
+ import { BOUNDED_CONTROLS, CHOOSER_CONTROLS, controlsFor, OPTION_BOUND_CONTROLS, requiresControl, } from './controls.js';
5
+ import { documentItem, fieldDeclarations, isControlName, isPrimitiveName, listAt, textAt, } from './document.js';
6
+ /** Whether a declaration is a scalar or attachment array: `items`, never `fields`. */
7
+ function isScalarArray(field) {
8
+ return textAt(field, 'primitive') === 'array' && isRecord(field['items']);
9
+ }
10
+ /** The refusal a source declared on a row inside another array receives, `MODEL-3.1.8`. */
11
+ const NESTED_OPTION_SOURCE_DETAIL = 'An option source on a row inside a nested record array is not supported in v1; move this array to the top level or resolve these options from a top-level source.';
12
+ /**
13
+ * The control hint and option-domain checks.
14
+ *
15
+ * Which hint a primitive admits is one matrix in the compiler rather than a second copy in
16
+ * the metaschema, so the pairing is checked here and the refusal names the primitive, the
17
+ * hint and the hints that were available. A `field` option domain names another declaration,
18
+ * which only a whole-document pass can resolve.
19
+ */
20
+ export function fieldDiagnostics(document) {
21
+ const diagnostics = [];
22
+ const declarations = fieldDeclarations(document);
23
+ for (const [fieldId, declaration] of declarations) {
24
+ const { field, path: at } = declaration;
25
+ const primitive = textAt(field, 'primitive');
26
+ if (primitive === undefined || !isPrimitiveName(primitive))
27
+ continue;
28
+ const control = textAt(field, 'control');
29
+ const items = documentItem(field['items']);
30
+ const allowed = controlsFor({ primitive, ...(items === undefined ? {} : { items }) });
31
+ if (control === undefined) {
32
+ if (requiresControl({ primitive, ...(items === undefined ? {} : { items }) })) {
33
+ diagnostics.push({
34
+ code: 'INVALID_CONTROL',
35
+ path: `${at}.control`,
36
+ detail: `field \`${fieldId}\` is ${indefiniteArticle(primitive)} \`${primitive}\` and must declare a control; ${withArticle(primitive)} accepts ${allowed.join(', ')}`,
37
+ ...(allowed.length === 0
38
+ ? {}
39
+ : { expected: allowed.join(' | '), suggestions: [...allowed] }),
40
+ });
41
+ }
42
+ }
43
+ else if (!isControlName(control) || !allowed.includes(control)) {
44
+ diagnostics.push({
45
+ code: 'INVALID_CONTROL',
46
+ path: `${at}.control`,
47
+ detail: allowed.length === 0
48
+ ? `field \`${fieldId}\` is ${indefiniteArticle(primitive)} \`${primitive}\` and declares no control; ${withArticle(primitive)} renders its own declaration, so a control hint would name nothing`
49
+ : `field \`${fieldId}\` declares control \`${control}\`, which ${indefiniteArticle(primitive)} \`${primitive}\` does not accept; ${withArticle(primitive)} accepts ${allowed.join(', ')}`,
50
+ ...(allowed.length === 0 ? {} : { expected: allowed.join(' | ') }),
51
+ ...(allowed.length === 0 ? {} : { suggestions: closestNames(control, [...allowed]) }),
52
+ });
53
+ }
54
+ // A rating and a Likert scale take their point count from the declared domain, so a
55
+ // renderer that has none cannot know how many stars or points to draw.
56
+ if (control !== undefined &&
57
+ isControlName(control) &&
58
+ OPTION_BOUND_CONTROLS.has(control) &&
59
+ listAt(field, 'options').length === 0) {
60
+ diagnostics.push({
61
+ code: 'INVALID_CONTROL',
62
+ path: `${at}.control`,
63
+ detail: `field \`${fieldId}\` declares control \`${control}\`, which needs an explicit scale; the point count comes from \`options\`, so declare the 4- or 5-point domain`,
64
+ });
65
+ }
66
+ // A slider paints a value on a track between two bounds, so it needs both. The bounds are
67
+ // still the compiled `validate` rules; the control's copy of them is the renderer's hint.
68
+ if (control !== undefined &&
69
+ isControlName(control) &&
70
+ BOUNDED_CONTROLS.has(control) &&
71
+ allowed.includes(control)) {
72
+ const missing = ['minimum', 'maximum'].filter((member) => field[member] === undefined);
73
+ if (missing.length > 0) {
74
+ diagnostics.push({
75
+ code: 'INVALID_CONTROL',
76
+ path: `${at}.control`,
77
+ detail: `field \`${fieldId}\` declares control \`${control}\`, which sets a value between two bounds, but states no ${missing.map((member) => `\`${member}\``).join(' or ')}; declare both \`minimum\` and \`maximum\`, or choose one of the number controls that need no range (${allowed.filter((hint) => !BOUNDED_CONTROLS.has(hint)).join(', ')})`,
78
+ ...(allowed.length === 0
79
+ ? {}
80
+ : { expected: 'minimum | maximum', suggestions: [...missing] }),
81
+ });
82
+ }
83
+ }
84
+ // `step` is the increment a number input or a slider advances by. It belongs to a value the
85
+ // control can step through, and it is positive: a zero or negative step is not a size.
86
+ if (field['step'] !== undefined) {
87
+ const step = field['step'];
88
+ const positive = primitive === 'integer'
89
+ ? typeof step === 'number' && Number.isSafeInteger(step) && step > 0
90
+ : primitive === 'decimal'
91
+ ? typeof step === 'string' &&
92
+ tryDecimalString(step) !== undefined &&
93
+ !step.startsWith('-') &&
94
+ step !== '0'
95
+ : false;
96
+ if (primitive !== 'integer' && primitive !== 'decimal') {
97
+ diagnostics.push({
98
+ code: 'SCHEMA_INVALID',
99
+ path: `${at}.step`,
100
+ detail: `\`step\` is the increment a number control advances by; field \`${fieldId}\` is ${indefiniteArticle(primitive)} \`${String(primitive)}\` value, so it declares no \`step\``,
101
+ });
102
+ }
103
+ else if (!positive) {
104
+ diagnostics.push({
105
+ code: 'SCHEMA_INVALID',
106
+ path: `${at}.step`,
107
+ detail: primitive === 'integer'
108
+ ? `\`step\` on integer field \`${fieldId}\` must be a positive whole number; \`${String(step)}\` is not — write a safe integer greater than zero`
109
+ : `\`step\` on decimal field \`${fieldId}\` must be positive canonical decimal text; \`${String(step)}\` is not — write a value greater than zero without an exponent, leading zeros or trailing fractional zeros`,
110
+ });
111
+ }
112
+ }
113
+ // A chooser asks the user to pick one of a declared set, so a field that states neither
114
+ // `options` nor `optionSource` offers nothing to pick: the renderer paints the stored value
115
+ // read-only and the field can never receive the choice its control exists to collect.
116
+ if (control !== undefined &&
117
+ isControlName(control) &&
118
+ CHOOSER_CONTROLS.has(control) &&
119
+ listAt(field, 'options').length === 0 &&
120
+ field['optionSource'] === undefined) {
121
+ const domain = primitive === 'boolean'
122
+ ? ', where a boolean chooser states the codes `"true"` and `"false"`'
123
+ : '';
124
+ diagnostics.push({
125
+ code: 'INVALID_CONTROL',
126
+ path: `${at}.control`,
127
+ detail: `field \`${fieldId}\` declares control \`${control}\`, which asks the user to choose, but states no option domain; declare \`options\` or \`optionSource\` with the values the control offers${domain}`,
128
+ });
129
+ }
130
+ const source = field['optionSource'];
131
+ const optionPrimitive = primitive === 'array' ? items?.primitive : primitive;
132
+ if (optionPrimitive === 'string' ||
133
+ optionPrimitive === 'integer' ||
134
+ optionPrimitive === 'boolean' ||
135
+ optionPrimitive === 'duration') {
136
+ // A code is a value the control can write, not merely a label identifier. Its wire type
137
+ // therefore matches the field (or array item) domain; a boolean's two codes are the
138
+ // strings `true` and `false` by contract, and a duration's are the positive amounts it
139
+ // offers, because the unit is the declaration's and only the amount varies.
140
+ listAt(field, 'options').forEach((option, index) => {
141
+ if (!isRecord(option))
142
+ return;
143
+ const code = option['code'];
144
+ const admitted = optionPrimitive === 'boolean'
145
+ ? code === 'true' || code === 'false'
146
+ : optionPrimitive === 'string'
147
+ ? typeof code === 'string'
148
+ : optionPrimitive === 'duration'
149
+ ? typeof code === 'number' && Number.isSafeInteger(code) && code > 0
150
+ : typeof code === 'number';
151
+ if (admitted)
152
+ return;
153
+ const expectation = optionPrimitive === 'boolean'
154
+ ? 'the strings `true` and `false`'
155
+ : optionPrimitive === 'string'
156
+ ? 'strings'
157
+ : optionPrimitive === 'duration'
158
+ ? 'positive whole amounts'
159
+ : 'safe integers';
160
+ diagnostics.push({
161
+ code: 'INVALID_CONTROL',
162
+ path: `${at}.options[${String(index)}].code`,
163
+ detail: `field \`${fieldId}\` holds \`${optionPrimitive}\` values, so its option codes must be ${expectation}; \`${String(code)}\` is outside that domain`,
164
+ });
165
+ });
166
+ }
167
+ if (!isRecord(source))
168
+ continue;
169
+ const atSource = `${at}.optionSource`;
170
+ // A row inside a nested array has no identity this version can state, so a source
171
+ // declared there could never be keyed by the row it belongs to (`MODEL-3.1.8`).
172
+ if (declaration.arrays.length > 1) {
173
+ diagnostics.push({
174
+ code: 'INVALID_RULE_SCOPE',
175
+ path: atSource,
176
+ detail: NESTED_OPTION_SOURCE_DETAIL,
177
+ });
178
+ continue;
179
+ }
180
+ const row = declaration.rowArray;
181
+ if (source['kind'] === 'field') {
182
+ const target = textAt(source, 'fieldId');
183
+ if (target === undefined)
184
+ continue;
185
+ const declared = declarations.get(target);
186
+ if (target === fieldId) {
187
+ diagnostics.push({
188
+ code: 'UNKNOWN_IDENTIFIER',
189
+ path: `${atSource}.fieldId`,
190
+ detail: `field \`${fieldId}\` takes its options from itself; a field source names another declaration`,
191
+ });
192
+ continue;
193
+ }
194
+ if (declared === undefined) {
195
+ diagnostics.push({
196
+ code: 'UNKNOWN_IDENTIFIER',
197
+ path: `${atSource}.fieldId`,
198
+ detail: `field \`${fieldId}\` takes its options from \`${target}\`, which this document does not declare`,
199
+ suggestions: closestNames(target, [...declarations.keys()]),
200
+ });
201
+ continue;
202
+ }
203
+ // A row member is a value a row holds, so a source may read the array in its own row
204
+ // or a top-level array, and never another row's member: the loader is keyed by this
205
+ // field's row identity, which says nothing about which row the value came from.
206
+ if (declared.rowArray !== undefined && declared.rowArray !== row) {
207
+ diagnostics.push({
208
+ code: 'INVALID_RULE_SCOPE',
209
+ path: `${atSource}.fieldId`,
210
+ detail: `field \`${fieldId}\` takes its options from \`${target}\`, a member of array \`${declared.rowArray}\`${row === undefined ? '' : ` rather than of \`${row}\``}; a field source reads a top-level array or a sibling array in the same row, because another row's values have no row identity here`,
211
+ });
212
+ continue;
213
+ }
214
+ const targetItems = isScalarArray(declared.field)
215
+ ? documentItem(declared.field['items'])
216
+ : undefined;
217
+ const usable = targetItems !== undefined &&
218
+ (targetItems.primitive === 'string' || targetItems.primitive === 'integer');
219
+ if (!usable) {
220
+ diagnostics.push({
221
+ code: 'TYPE_MISMATCH',
222
+ path: `${atSource}.fieldId`,
223
+ detail: targetItems === undefined
224
+ ? `field \`${fieldId}\` takes its options from \`${target}\`, which is not a scalar array; a field source is a \`string\` or \`integer\` array whose items are the option values`
225
+ : `field \`${fieldId}\` takes its options from \`${target}\`, whose items are \`${targetItems.primitive}\`; a field source is a \`string\` or \`integer\` array whose items are the option values`,
226
+ });
227
+ }
228
+ else {
229
+ const destinationPrimitive = primitive === 'array' ? items?.primitive : primitive;
230
+ if (destinationPrimitive !== targetItems.primitive) {
231
+ diagnostics.push({
232
+ code: 'TYPE_MISMATCH',
233
+ path: `${atSource}.fieldId`,
234
+ detail: `field \`${fieldId}\` holds \`${destinationPrimitive ?? primitive}\` values but takes its options from \`${target}\`, whose items are \`${targetItems.primitive}\`; a field source and its destination must hold the same item domain`,
235
+ });
236
+ }
237
+ }
238
+ }
239
+ for (const [index, dependency] of listAt(source, 'dependsOn').entries()) {
240
+ if (typeof dependency !== 'string')
241
+ continue;
242
+ const dependencySite = declarations.get(dependency);
243
+ if (dependencySite === undefined) {
244
+ diagnostics.push({
245
+ code: 'UNKNOWN_IDENTIFIER',
246
+ path: `${atSource}.dependsOn[${String(index)}]`,
247
+ detail: `field \`${fieldId}\` keys its host options on \`${dependency}\`, which this document does not declare`,
248
+ suggestions: closestNames(dependency, [...declarations.keys()]),
249
+ });
250
+ continue;
251
+ }
252
+ // Same row boundary as a field source: a dependency in another array's row is a value
253
+ // this source cannot name, so the key would mix two rows' identities.
254
+ if (dependencySite.rowArray !== undefined && dependencySite.rowArray !== row) {
255
+ diagnostics.push({
256
+ code: 'INVALID_RULE_SCOPE',
257
+ path: `${atSource}.dependsOn[${String(index)}]`,
258
+ detail: `field \`${fieldId}\` keys its host options on \`${dependency}\`, a member of array \`${dependencySite.rowArray}\`${row === undefined ? '' : ` rather than of \`${row}\``}; a row-scoped source keys by values in its own row, or by a top-level field that has no row`,
259
+ });
260
+ }
261
+ }
262
+ }
263
+ return diagnostics;
264
+ }
265
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../src/schema/fields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,qBAAqB,EACrB,eAAe,GAChB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AAEvB,sFAAsF;AACtF,SAAS,aAAa,CAAC,KAA8B;IACnD,OAAO,MAAM,CAAC,KAAK,EAAE,WAAW,CAAC,KAAK,OAAO,IAAI,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED,2FAA2F;AAC3F,MAAM,2BAA2B,GAC/B,mKAAmK,CAAC;AAEtK;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAiC;IAChE,MAAM,WAAW,GAAuB,EAAE,CAAC;IAC3C,MAAM,YAAY,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IACjD,KAAK,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,IAAI,YAAY,EAAE,CAAC;QAClD,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,WAAW,CAAC;QACxC,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QAC7C,IAAI,SAAS,KAAK,SAAS,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC;YAAE,SAAS;QACrE,MAAM,OAAO,GAAG,MAAM,CAAC,KAA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,CAAC,QAAQ,KAAK,SAAS,IAAI,cAAc,CAAC,QAAQ,KAAK,GAAG,EAAE,CAAC;gBAC7E,WAAW,CAAC,IAAI,CAAC;oBACf,IAAI,EAAE,oBAAoB;oBAC1B,IAAI,EAAE,GAAG,QAAQ,cAAc,MAAM,CAAC,KAAK,CAAC,GAAG;oBAC/C,MAAM,EAAE,WAAW,OAAO,iCAAiC,UAAU,2BAA2B,cAAc,CAAC,QAAQ,KAAK,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAqB,GAAG,IAAI,8FAA8F;iBAChR,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["import { isRecord, tryDecimalString } from '@azx-pbc/axiom-runtime';\nimport { indefiniteArticle, withArticle } from '../article.js';\nimport { closestNames } from '../expr/suggest.js';\nimport {\n BOUNDED_CONTROLS,\n CHOOSER_CONTROLS,\n controlsFor,\n OPTION_BOUND_CONTROLS,\n requiresControl,\n} from './controls.js';\nimport type { SchemaDiagnostic } from './diagnostic.js';\nimport {\n documentItem,\n fieldDeclarations,\n isControlName,\n isPrimitiveName,\n listAt,\n textAt,\n} from './document.js';\n\n/** Whether a declaration is a scalar or attachment array: `items`, never `fields`. */\nfunction isScalarArray(field: Record<string, unknown>): boolean {\n return textAt(field, 'primitive') === 'array' && isRecord(field['items']);\n}\n\n/** The refusal a source declared on a row inside another array receives, `MODEL-3.1.8`. */\nconst NESTED_OPTION_SOURCE_DETAIL =\n 'An option source on a row inside a nested record array is not supported in v1; move this array to the top level or resolve these options from a top-level source.';\n\n/**\n * The control hint and option-domain checks.\n *\n * Which hint a primitive admits is one matrix in the compiler rather than a second copy in\n * the metaschema, so the pairing is checked here and the refusal names the primitive, the\n * hint and the hints that were available. A `field` option domain names another declaration,\n * which only a whole-document pass can resolve.\n */\nexport function fieldDiagnostics(document: Record<string, unknown>): readonly SchemaDiagnostic[] {\n const diagnostics: SchemaDiagnostic[] = [];\n const declarations = fieldDeclarations(document);\n for (const [fieldId, declaration] of declarations) {\n const { field, path: at } = declaration;\n const primitive = textAt(field, 'primitive');\n if (primitive === undefined || !isPrimitiveName(primitive)) continue;\n const control = textAt(field, 'control');\n const items = documentItem(field['items']);\n const allowed = controlsFor({ primitive, ...(items === undefined ? {} : { items }) });\n\n if (control === undefined) {\n if (requiresControl({ primitive, ...(items === undefined ? {} : { items }) })) {\n diagnostics.push({\n code: 'INVALID_CONTROL',\n path: `${at}.control`,\n detail: `field \\`${fieldId}\\` is ${indefiniteArticle(primitive)} \\`${primitive}\\` and must declare a control; ${withArticle(primitive)} accepts ${allowed.join(', ')}`,\n ...(allowed.length === 0\n ? {}\n : { expected: allowed.join(' | '), suggestions: [...allowed] }),\n });\n }\n } else if (!isControlName(control) || !allowed.includes(control)) {\n diagnostics.push({\n code: 'INVALID_CONTROL',\n path: `${at}.control`,\n detail:\n allowed.length === 0\n ? `field \\`${fieldId}\\` is ${indefiniteArticle(primitive)} \\`${primitive}\\` and declares no control; ${withArticle(primitive)} renders its own declaration, so a control hint would name nothing`\n : `field \\`${fieldId}\\` declares control \\`${control}\\`, which ${indefiniteArticle(primitive)} \\`${primitive}\\` does not accept; ${withArticle(primitive)} accepts ${allowed.join(', ')}`,\n ...(allowed.length === 0 ? {} : { expected: allowed.join(' | ') }),\n ...(allowed.length === 0 ? {} : { suggestions: closestNames(control, [...allowed]) }),\n });\n }\n\n // A rating and a Likert scale take their point count from the declared domain, so a\n // renderer that has none cannot know how many stars or points to draw.\n if (\n control !== undefined &&\n isControlName(control) &&\n OPTION_BOUND_CONTROLS.has(control) &&\n listAt(field, 'options').length === 0\n ) {\n diagnostics.push({\n code: 'INVALID_CONTROL',\n path: `${at}.control`,\n detail: `field \\`${fieldId}\\` declares control \\`${control}\\`, which needs an explicit scale; the point count comes from \\`options\\`, so declare the 4- or 5-point domain`,\n });\n }\n\n // A slider paints a value on a track between two bounds, so it needs both. The bounds are\n // still the compiled `validate` rules; the control's copy of them is the renderer's hint.\n if (\n control !== undefined &&\n isControlName(control) &&\n BOUNDED_CONTROLS.has(control) &&\n allowed.includes(control)\n ) {\n const missing = (['minimum', 'maximum'] as const).filter(\n (member) => field[member] === undefined,\n );\n if (missing.length > 0) {\n diagnostics.push({\n code: 'INVALID_CONTROL',\n path: `${at}.control`,\n detail: `field \\`${fieldId}\\` declares control \\`${control}\\`, which sets a value between two bounds, but states no ${missing.map((member) => `\\`${member}\\``).join(' or ')}; declare both \\`minimum\\` and \\`maximum\\`, or choose one of the number controls that need no range (${allowed.filter((hint) => !BOUNDED_CONTROLS.has(hint)).join(', ')})`,\n ...(allowed.length === 0\n ? {}\n : { expected: 'minimum | maximum', suggestions: [...missing] }),\n });\n }\n }\n\n // `step` is the increment a number input or a slider advances by. It belongs to a value the\n // control can step through, and it is positive: a zero or negative step is not a size.\n if (field['step'] !== undefined) {\n const step = field['step'];\n const positive =\n primitive === 'integer'\n ? typeof step === 'number' && Number.isSafeInteger(step) && step > 0\n : primitive === 'decimal'\n ? typeof step === 'string' &&\n tryDecimalString(step) !== undefined &&\n !step.startsWith('-') &&\n step !== '0'\n : false;\n if (primitive !== 'integer' && primitive !== 'decimal') {\n diagnostics.push({\n code: 'SCHEMA_INVALID',\n path: `${at}.step`,\n detail: `\\`step\\` is the increment a number control advances by; field \\`${fieldId}\\` is ${indefiniteArticle(primitive)} \\`${String(primitive)}\\` value, so it declares no \\`step\\``,\n });\n } else if (!positive) {\n diagnostics.push({\n code: 'SCHEMA_INVALID',\n path: `${at}.step`,\n detail:\n primitive === 'integer'\n ? `\\`step\\` on integer field \\`${fieldId}\\` must be a positive whole number; \\`${String(step)}\\` is not — write a safe integer greater than zero`\n : `\\`step\\` on decimal field \\`${fieldId}\\` must be positive canonical decimal text; \\`${String(step)}\\` is not — write a value greater than zero without an exponent, leading zeros or trailing fractional zeros`,\n });\n }\n }\n\n // A chooser asks the user to pick one of a declared set, so a field that states neither\n // `options` nor `optionSource` offers nothing to pick: the renderer paints the stored value\n // read-only and the field can never receive the choice its control exists to collect.\n if (\n control !== undefined &&\n isControlName(control) &&\n CHOOSER_CONTROLS.has(control) &&\n listAt(field, 'options').length === 0 &&\n field['optionSource'] === undefined\n ) {\n const domain =\n primitive === 'boolean'\n ? ', where a boolean chooser states the codes `\"true\"` and `\"false\"`'\n : '';\n diagnostics.push({\n code: 'INVALID_CONTROL',\n path: `${at}.control`,\n detail: `field \\`${fieldId}\\` declares control \\`${control}\\`, which asks the user to choose, but states no option domain; declare \\`options\\` or \\`optionSource\\` with the values the control offers${domain}`,\n });\n }\n\n const source = field['optionSource'];\n const optionPrimitive = primitive === 'array' ? items?.primitive : primitive;\n if (\n optionPrimitive === 'string' ||\n optionPrimitive === 'integer' ||\n optionPrimitive === 'boolean' ||\n optionPrimitive === 'duration'\n ) {\n // A code is a value the control can write, not merely a label identifier. Its wire type\n // therefore matches the field (or array item) domain; a boolean's two codes are the\n // strings `true` and `false` by contract, and a duration's are the positive amounts it\n // offers, because the unit is the declaration's and only the amount varies.\n listAt(field, 'options').forEach((option, index) => {\n if (!isRecord(option)) return;\n const code = option['code'];\n const admitted =\n optionPrimitive === 'boolean'\n ? code === 'true' || code === 'false'\n : optionPrimitive === 'string'\n ? typeof code === 'string'\n : optionPrimitive === 'duration'\n ? typeof code === 'number' && Number.isSafeInteger(code) && code > 0\n : typeof code === 'number';\n if (admitted) return;\n const expectation =\n optionPrimitive === 'boolean'\n ? 'the strings `true` and `false`'\n : optionPrimitive === 'string'\n ? 'strings'\n : optionPrimitive === 'duration'\n ? 'positive whole amounts'\n : 'safe integers';\n diagnostics.push({\n code: 'INVALID_CONTROL',\n path: `${at}.options[${String(index)}].code`,\n detail: `field \\`${fieldId}\\` holds \\`${optionPrimitive}\\` values, so its option codes must be ${expectation}; \\`${String(code)}\\` is outside that domain`,\n });\n });\n }\n if (!isRecord(source)) continue;\n const atSource = `${at}.optionSource`;\n // A row inside a nested array has no identity this version can state, so a source\n // declared there could never be keyed by the row it belongs to (`MODEL-3.1.8`).\n if (declaration.arrays.length > 1) {\n diagnostics.push({\n code: 'INVALID_RULE_SCOPE',\n path: atSource,\n detail: NESTED_OPTION_SOURCE_DETAIL,\n });\n continue;\n }\n const row = declaration.rowArray;\n if (source['kind'] === 'field') {\n const target = textAt(source, 'fieldId');\n if (target === undefined) continue;\n const declared = declarations.get(target);\n if (target === fieldId) {\n diagnostics.push({\n code: 'UNKNOWN_IDENTIFIER',\n path: `${atSource}.fieldId`,\n detail: `field \\`${fieldId}\\` takes its options from itself; a field source names another declaration`,\n });\n continue;\n }\n if (declared === undefined) {\n diagnostics.push({\n code: 'UNKNOWN_IDENTIFIER',\n path: `${atSource}.fieldId`,\n detail: `field \\`${fieldId}\\` takes its options from \\`${target}\\`, which this document does not declare`,\n suggestions: closestNames(target, [...declarations.keys()]),\n });\n continue;\n }\n // A row member is a value a row holds, so a source may read the array in its own row\n // or a top-level array, and never another row's member: the loader is keyed by this\n // field's row identity, which says nothing about which row the value came from.\n if (declared.rowArray !== undefined && declared.rowArray !== row) {\n diagnostics.push({\n code: 'INVALID_RULE_SCOPE',\n path: `${atSource}.fieldId`,\n detail: `field \\`${fieldId}\\` takes its options from \\`${target}\\`, a member of array \\`${declared.rowArray}\\`${row === undefined ? '' : ` rather than of \\`${row}\\``}; a field source reads a top-level array or a sibling array in the same row, because another row's values have no row identity here`,\n });\n continue;\n }\n const targetItems = isScalarArray(declared.field)\n ? documentItem(declared.field['items'])\n : undefined;\n const usable =\n targetItems !== undefined &&\n (targetItems.primitive === 'string' || targetItems.primitive === 'integer');\n if (!usable) {\n diagnostics.push({\n code: 'TYPE_MISMATCH',\n path: `${atSource}.fieldId`,\n detail:\n targetItems === undefined\n ? `field \\`${fieldId}\\` takes its options from \\`${target}\\`, which is not a scalar array; a field source is a \\`string\\` or \\`integer\\` array whose items are the option values`\n : `field \\`${fieldId}\\` takes its options from \\`${target}\\`, whose items are \\`${targetItems.primitive}\\`; a field source is a \\`string\\` or \\`integer\\` array whose items are the option values`,\n });\n } else {\n const destinationPrimitive = primitive === 'array' ? items?.primitive : primitive;\n if (destinationPrimitive !== targetItems.primitive) {\n diagnostics.push({\n code: 'TYPE_MISMATCH',\n path: `${atSource}.fieldId`,\n detail: `field \\`${fieldId}\\` holds \\`${destinationPrimitive ?? primitive}\\` values but takes its options from \\`${target}\\`, whose items are \\`${targetItems.primitive}\\`; a field source and its destination must hold the same item domain`,\n });\n }\n }\n }\n for (const [index, dependency] of listAt(source, 'dependsOn').entries()) {\n if (typeof dependency !== 'string') continue;\n const dependencySite = declarations.get(dependency);\n if (dependencySite === undefined) {\n diagnostics.push({\n code: 'UNKNOWN_IDENTIFIER',\n path: `${atSource}.dependsOn[${String(index)}]`,\n detail: `field \\`${fieldId}\\` keys its host options on \\`${dependency}\\`, which this document does not declare`,\n suggestions: closestNames(dependency, [...declarations.keys()]),\n });\n continue;\n }\n // Same row boundary as a field source: a dependency in another array's row is a value\n // this source cannot name, so the key would mix two rows' identities.\n if (dependencySite.rowArray !== undefined && dependencySite.rowArray !== row) {\n diagnostics.push({\n code: 'INVALID_RULE_SCOPE',\n path: `${atSource}.dependsOn[${String(index)}]`,\n detail: `field \\`${fieldId}\\` keys its host options on \\`${dependency}\\`, a member of array \\`${dependencySite.rowArray}\\`${row === undefined ? '' : ` rather than of \\`${row}\\``}; a row-scoped source keys by values in its own row, or by a top-level field that has no row`,\n });\n }\n }\n }\n return diagnostics;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { SchemaDiagnostic } from './diagnostic.js';
2
+ /** Every refusal the gate section owns, over one authored or compiled document. */
3
+ export declare function gateDiagnostics(document: Record<string, unknown>): readonly SchemaDiagnostic[];
4
+ //# sourceMappingURL=gates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gates.d.ts","sourceRoot":"","sources":["../../src/schema/gates.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AA2DxD,mFAAmF;AACnF,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,gBAAgB,EAAE,CAS9F"}
@@ -0,0 +1,68 @@
1
+ import { compareCodePoints, isRecord } from '@azx-pbc/axiom-runtime';
2
+ import { listAt, textAt } from './document.js';
3
+ import { selectPrimary } from './primary.js';
4
+ /**
5
+ * The gate section's own document checks: which gates the document declares, that no gate states
6
+ * one item id twice, and which gate is the primary.
7
+ *
8
+ * A gate's identity is its rule's `ruleId`, so the declared set is the gate rules the document
9
+ * lists. Everything else a gate states — its items' expressions, messages and arguments — is
10
+ * checked where rules and messages are compiled.
11
+ */
12
+ /** The declared gate rule ids, in code-point order. */
13
+ function declaredGateIds(document) {
14
+ return listAt(document, 'rules')
15
+ .flatMap((rule) => {
16
+ if (!isRecord(rule) || textAt(rule, 'kind') !== 'gate')
17
+ return [];
18
+ const ruleId = textAt(rule, 'ruleId');
19
+ return ruleId === undefined ? [] : [ruleId];
20
+ })
21
+ .sort(compareCodePoints);
22
+ }
23
+ /**
24
+ * Two items of one gate must not share an item id.
25
+ *
26
+ * A report identifies an item by its id and a gate override binds every item's status by that
27
+ * id, so two items with one id leave the binding holding whichever the walk reached last: an
28
+ * approval recorded against one item's status would satisfy a gate whose other item decided
29
+ * differently. Every other identity in a document — a field, a rule, an option code, a table —
30
+ * is refused when it repeats for the same reason, so an item id is too.
31
+ */
32
+ function duplicateItemDiagnostics(document) {
33
+ const diagnostics = [];
34
+ listAt(document, 'rules').forEach((rule, ruleIndex) => {
35
+ if (!isRecord(rule) || textAt(rule, 'kind') !== 'gate')
36
+ return;
37
+ const gate = rule['gate'];
38
+ if (!isRecord(gate))
39
+ return;
40
+ const ruleId = textAt(rule, 'ruleId') ?? `$.rules[${String(ruleIndex)}]`;
41
+ const seen = new Set();
42
+ listAt(gate, 'items').forEach((item, itemIndex) => {
43
+ if (!isRecord(item))
44
+ return;
45
+ const itemId = textAt(item, 'itemId');
46
+ if (itemId === undefined)
47
+ return;
48
+ if (seen.has(itemId)) {
49
+ diagnostics.push({
50
+ code: 'DUPLICATE_IDENTIFIER',
51
+ path: `$.rules[${String(ruleIndex)}].gate.items[${String(itemIndex)}].itemId`,
52
+ detail: `gate item id \`${itemId}\` is declared more than once in gate \`${ruleId}\`; an item's id is its identity in the report and in a gate override, so it is unique within its gate`,
53
+ });
54
+ return;
55
+ }
56
+ seen.add(itemId);
57
+ });
58
+ });
59
+ return diagnostics;
60
+ }
61
+ /** Every refusal the gate section owns, over one authored or compiled document. */
62
+ export function gateDiagnostics(document) {
63
+ return [
64
+ ...duplicateItemDiagnostics(document),
65
+ ...selectPrimary({ ruleKind: 'gate', path: '$.primaryGateId' }, declaredGateIds(document), textAt(document, 'primaryGateId')),
66
+ ];
67
+ }
68
+ //# sourceMappingURL=gates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gates.js","sourceRoot":"","sources":["../../src/schema/gates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C;;;;;;;GAOG;AAEH,uDAAuD;AACvD,SAAS,eAAe,CAAC,QAAiC;IACxD,OAAO,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC;SAC7B,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAChB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,MAAM;YAAE,OAAO,EAAE,CAAC;QAClE,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACtC,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM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AI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,eAAe,CAAC,QAAiC;IAC/D,OAAO;QACL,GAAG,wBAAwB,CAAC,QAAQ,CAAC;QACrC,GAAG,aAAa,CACd,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAC7C,eAAe,CAAC,QAAQ,CAAC,EACzB,MAAM,CAAC,QAAQ,EAAE,eAAe,CAAC,CAClC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { compareCodePoints, isRecord } from '@azx-pbc/axiom-runtime';\nimport type { SchemaDiagnostic } from './diagnostic.js';\nimport { listAt, textAt } from './document.js';\nimport { selectPrimary } from './primary.js';\n\n/**\n * The gate section's own document checks: which gates the document declares, that no gate states\n * one item id twice, and which gate is the primary.\n *\n * A gate's identity is its rule's `ruleId`, so the declared set is the gate rules the document\n * lists. Everything else a gate states — its items' expressions, messages and arguments — is\n * checked where rules and messages are compiled.\n */\n\n/** The declared gate rule ids, in code-point order. */\nfunction declaredGateIds(document: Record<string, unknown>): readonly string[] {\n return listAt(document, 'rules')\n .flatMap((rule) => {\n if (!isRecord(rule) || textAt(rule, 'kind') !== 'gate') return [];\n const ruleId = textAt(rule, 'ruleId');\n return ruleId === undefined ? [] : [ruleId];\n })\n .sort(compareCodePoints);\n}\n\n/**\n * Two items of one gate must not share an item id.\n *\n * A report identifies an item by its id and a gate override binds every item's status by that\n * id, so two items with one id leave the binding holding whichever the walk reached last: an\n * approval recorded against one item's status would satisfy a gate whose other item decided\n * differently. Every other identity in a document — a field, a rule, an option code, a table —\n * is refused when it repeats for the same reason, so an item id is too.\n */\nfunction duplicateItemDiagnostics(document: Record<string, unknown>): readonly SchemaDiagnostic[] {\n const diagnostics: SchemaDiagnostic[] = [];\n listAt(document, 'rules').forEach((rule, ruleIndex) => {\n if (!isRecord(rule) || textAt(rule, 'kind') !== 'gate') return;\n const gate = rule['gate'];\n if (!isRecord(gate)) return;\n const ruleId = textAt(rule, 'ruleId') ?? `$.rules[${String(ruleIndex)}]`;\n const seen = new Set<string>();\n listAt(gate, 'items').forEach((item, itemIndex) => {\n if (!isRecord(item)) return;\n const itemId = textAt(item, 'itemId');\n if (itemId === undefined) return;\n if (seen.has(itemId)) {\n diagnostics.push({\n code: 'DUPLICATE_IDENTIFIER',\n path: `$.rules[${String(ruleIndex)}].gate.items[${String(itemIndex)}].itemId`,\n detail: `gate item id \\`${itemId}\\` is declared more than once in gate \\`${ruleId}\\`; an item's id is its identity in the report and in a gate override, so it is unique within its gate`,\n });\n return;\n }\n seen.add(itemId);\n });\n });\n return diagnostics;\n}\n\n/** Every refusal the gate section owns, over one authored or compiled document. */\nexport function gateDiagnostics(document: Record<string, unknown>): readonly SchemaDiagnostic[] {\n return [\n ...duplicateItemDiagnostics(document),\n ...selectPrimary(\n { ruleKind: 'gate', path: '$.primaryGateId' },\n declaredGateIds(document),\n textAt(document, 'primaryGateId'),\n ),\n ];\n}\n"]}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * A validator reason paired with the instance location it names, and the location algebra the
3
+ * cascade collapse asks of it.
4
+ *
5
+ * The validator returns pointers as text; every collapse question is about ancestry, equality
6
+ * or membership, so each reason is located once and the questions become array comparisons.
7
+ */
8
+ import type { OutputUnit } from '@cfworker/json-schema';
9
+ /** A validator error whose instance location is available as pointer segments. */
10
+ export interface LocatedError {
11
+ readonly unit: OutputUnit;
12
+ readonly at: readonly string[];
13
+ }
14
+ export declare function locate(errors: readonly OutputUnit[]): readonly LocatedError[];
15
+ /** One instance location as a map key, so a prefix question is a lookup and not a scan. */
16
+ export declare function locationKey(at: readonly string[]): string;
17
+ /** Whether `prefix` names the same location as, or an ancestor of, `at`. */
18
+ export declare function isPrefix(prefix: readonly string[], at: readonly string[]): boolean;
19
+ export declare function sameLocation(left: readonly string[], right: readonly string[]): boolean;
20
+ /** Whether `at` is strictly below `ancestor`. */
21
+ export declare function isStrictDescendant(ancestor: readonly string[], at: readonly string[]): boolean;
22
+ /**
23
+ * The member-refusing wrappers by the object they refused, so a `false` leaf can carry the
24
+ * message of the wrapper that names its member.
25
+ */
26
+ export declare function memberIndex(located: readonly LocatedError[]): ReadonlyMap<string, readonly OutputUnit[]>;
27
+ //# sourceMappingURL=located.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"located.d.ts","sourceRoot":"","sources":["../../src/schema/located.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGxD,kFAAkF;AAClF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,EAAE,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC;AAmBD,wBAAgB,MAAM,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,GAAG,SAAS,YAAY,EAAE,CAE7E;AAED,2FAA2F;AAC3F,wBAAgB,WAAW,CAAC,EAAE,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAEzD;AAED,4EAA4E;AAC5E,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAGlF;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAEvF;AAED,iDAAiD;AACjD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAE9F;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,SAAS,YAAY,EAAE,GAC/B,WAAW,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAC,CAU5C"}
@@ -0,0 +1,56 @@
1
+ import { pointerSegments } from './pointer.js';
2
+ /**
3
+ * The wrappers whose own message names the member they refused, rather than a subschema.
4
+ *
5
+ * `properties` belongs here because a closed definition refuses a member it does not admit by
6
+ * putting `false` at that member (`"properties": { "minItems": false }`), and the validator's
7
+ * own `false` leaf names no member: it reports the member's instance location as its keyword
8
+ * location too. The wrapper's message — `Property "minItems" does not match schema.` — is the
9
+ * only place the refused member is named, so carrying it to the member is what lets the
10
+ * formatter say which member and which declaration it is.
11
+ */
12
+ const MEMBER_KEYWORDS = new Set([
13
+ 'additionalProperties',
14
+ 'properties',
15
+ 'unevaluatedProperties',
16
+ 'propertyNames',
17
+ ]);
18
+ export function locate(errors) {
19
+ return errors.map((unit) => ({ unit, at: pointerSegments(unit.instanceLocation) }));
20
+ }
21
+ /** One instance location as a map key, so a prefix question is a lookup and not a scan. */
22
+ export function locationKey(at) {
23
+ return JSON.stringify(at);
24
+ }
25
+ /** Whether `prefix` names the same location as, or an ancestor of, `at`. */
26
+ export function isPrefix(prefix, at) {
27
+ if (prefix.length > at.length)
28
+ return false;
29
+ return prefix.every((segment, index) => segment === at[index]);
30
+ }
31
+ export function sameLocation(left, right) {
32
+ return left.length === right.length && isPrefix(left, right);
33
+ }
34
+ /** Whether `at` is strictly below `ancestor`. */
35
+ export function isStrictDescendant(ancestor, at) {
36
+ return !sameLocation(ancestor, at) && isPrefix(ancestor, at);
37
+ }
38
+ /**
39
+ * The member-refusing wrappers by the object they refused, so a `false` leaf can carry the
40
+ * message of the wrapper that names its member.
41
+ */
42
+ export function memberIndex(located) {
43
+ const members = new Map();
44
+ for (const { unit, at } of located) {
45
+ if (!MEMBER_KEYWORDS.has(unit.keyword))
46
+ continue;
47
+ const key = locationKey(at);
48
+ const atLocation = members.get(key);
49
+ if (atLocation === undefined)
50
+ members.set(key, [unit]);
51
+ else
52
+ atLocation.push(unit);
53
+ }
54
+ return members;
55
+ }
56
+ //# sourceMappingURL=located.js.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D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CACzB,OAAgC;IAEhC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAwB,CAAC;IAChD,KAAK,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,OAAO,EAAE,CAAC;QACnC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;YAAE,SAAS;QACjD,MAAM,GAAG,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC;QAC5B,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,UAAU,KAAK,SAAS;YAAE,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;;YAClD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["/**\n * A validator reason paired with the instance location it names, and the location algebra the\n * cascade collapse asks of it.\n *\n * The validator returns pointers as text; every collapse question is about ancestry, equality\n * or membership, so each reason is located once and the questions become array comparisons.\n */\nimport type { OutputUnit } from '@cfworker/json-schema';\nimport { pointerSegments } from './pointer.js';\n\n/** A validator error whose instance location is available as pointer segments. */\nexport interface LocatedError {\n readonly unit: OutputUnit;\n readonly at: readonly string[];\n}\n\n/**\n * The wrappers whose own message names the member they refused, rather than a subschema.\n *\n * `properties` belongs here because a closed definition refuses a member it does not admit by\n * putting `false` at that member (`\"properties\": { \"minItems\": false }`), and the validator's\n * own `false` leaf names no member: it reports the member's instance location as its keyword\n * location too. The wrapper's message — `Property \"minItems\" does not match schema.` — is the\n * only place the refused member is named, so carrying it to the member is what lets the\n * formatter say which member and which declaration it is.\n */\nconst MEMBER_KEYWORDS: ReadonlySet<string> = new Set([\n 'additionalProperties',\n 'properties',\n 'unevaluatedProperties',\n 'propertyNames',\n]);\n\nexport function locate(errors: readonly OutputUnit[]): readonly LocatedError[] {\n return errors.map((unit) => ({ unit, at: pointerSegments(unit.instanceLocation) }));\n}\n\n/** One instance location as a map key, so a prefix question is a lookup and not a scan. */\nexport function locationKey(at: readonly string[]): string {\n return JSON.stringify(at);\n}\n\n/** Whether `prefix` names the same location as, or an ancestor of, `at`. */\nexport function isPrefix(prefix: readonly string[], at: readonly string[]): boolean {\n if (prefix.length > at.length) return false;\n return prefix.every((segment, index) => segment === at[index]);\n}\n\nexport function sameLocation(left: readonly string[], right: readonly string[]): boolean {\n return left.length === right.length && isPrefix(left, right);\n}\n\n/** Whether `at` is strictly below `ancestor`. */\nexport function isStrictDescendant(ancestor: readonly string[], at: readonly string[]): boolean {\n return !sameLocation(ancestor, at) && isPrefix(ancestor, at);\n}\n\n/**\n * The member-refusing wrappers by the object they refused, so a `false` leaf can carry the\n * message of the wrapper that names its member.\n */\nexport function memberIndex(\n located: readonly LocatedError[],\n): ReadonlyMap<string, readonly OutputUnit[]> {\n const members = new Map<string, OutputUnit[]>();\n for (const { unit, at } of located) {\n if (!MEMBER_KEYWORDS.has(unit.keyword)) continue;\n const key = locationKey(at);\n const atLocation = members.get(key);\n if (atLocation === undefined) members.set(key, [unit]);\n else atLocation.push(unit);\n }\n return members;\n}\n"]}
@@ -0,0 +1,9 @@
1
+ /** Records one metaschema validation. */
2
+ export declare function noteMetaschemaValidation(): void;
3
+ /** The number of metaschema validations since the process started. */
4
+ export declare function metaschemaValidations(): number;
5
+ /** Records one writer the duplicate-writer check inspected. */
6
+ export declare function noteWriterComparison(): void;
7
+ /** The writers the duplicate-writer check inspected since the process started. */
8
+ export declare function writerComparisons(): number;
9
+ //# sourceMappingURL=measurement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"measurement.d.ts","sourceRoot":"","sources":["../../src/schema/measurement.ts"],"names":[],"mappings":"AAaA,yCAAyC;AACzC,wBAAgB,wBAAwB,IAAI,IAAI,CAE/C;AAED,sEAAsE;AACtE,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAYD,+DAA+D;AAC/D,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED,kFAAkF;AAClF,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * The metaschema validations this process has performed.
3
+ *
4
+ * A measurement hook, never an input: no decision reads it. One authored-document check is one
5
+ * validation, however many times the validator is asked to retry a document it cannot walk
6
+ * exhaustively — the retry is the same check, not a second one. A compile validates the authored
7
+ * document once and the emitted artifact once, so a dispatch costs two; a store that checks the
8
+ * same authored document again first spends three, and the count makes that visible where a
9
+ * stopwatch cannot. The hook lives beside the validator rather than in it so a caller reads the
10
+ * count without importing the validator library's types.
11
+ */
12
+ let validationCount = 0;
13
+ /** Records one metaschema validation. */
14
+ export function noteMetaschemaValidation() {
15
+ validationCount += 1;
16
+ }
17
+ /** The number of metaschema validations since the process started. */
18
+ export function metaschemaValidations() {
19
+ return validationCount;
20
+ }
21
+ /**
22
+ * The writer pairs the duplicate-writer check has inspected.
23
+ *
24
+ * A measurement hook, never an input. The check indexes the writers it has already seen by the
25
+ * declaration each one writes and by the declarations above it, so one writer is a handful of
26
+ * map hits; counting the writers it visits is how a test states the check is linear in them
27
+ * rather than the writers squared.
28
+ */
29
+ let writerComparisonCount = 0;
30
+ /** Records one writer the duplicate-writer check inspected. */
31
+ export function noteWriterComparison() {
32
+ writerComparisonCount += 1;
33
+ }
34
+ /** The writers the duplicate-writer check inspected since the process started. */
35
+ export function writerComparisons() {
36
+ return writerComparisonCount;
37
+ }
38
+ //# sourceMappingURL=measurement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"measurement.js","sourceRoot":"","sources":["../../src/schema/measurement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,IAAI,eAAe,GAAG,CAAC,CAAC;AAExB,yCAAyC;AACzC,MAAM,UAAU,wBAAwB;IACtC,eAAe,IAAI,CAAC,CAAC;AACvB,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,qBAAqB;IACnC,OAAO,eAAe,CAAC;AACzB,CAAC;AAED;;;;;;;GAOG;AACH,IAAI,qBAAqB,GAAG,CAAC,CAAC;AAE9B,+DAA+D;AAC/D,MAAM,UAAU,oBAAoB;IAClC,qBAAqB,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,iBAAiB;IAC/B,OAAO,qBAAqB,CAAC;AAC/B,CAAC","sourcesContent":["/**\n * The metaschema validations this process has performed.\n *\n * A measurement hook, never an input: no decision reads it. One authored-document check is one\n * validation, however many times the validator is asked to retry a document it cannot walk\n * exhaustively — the retry is the same check, not a second one. A compile validates the authored\n * document once and the emitted artifact once, so a dispatch costs two; a store that checks the\n * same authored document again first spends three, and the count makes that visible where a\n * stopwatch cannot. The hook lives beside the validator rather than in it so a caller reads the\n * count without importing the validator library's types.\n */\nlet validationCount = 0;\n\n/** Records one metaschema validation. */\nexport function noteMetaschemaValidation(): void {\n validationCount += 1;\n}\n\n/** The number of metaschema validations since the process started. */\nexport function metaschemaValidations(): number {\n return validationCount;\n}\n\n/**\n * The writer pairs the duplicate-writer check has inspected.\n *\n * A measurement hook, never an input. The check indexes the writers it has already seen by the\n * declaration each one writes and by the declarations above it, so one writer is a handful of\n * map hits; counting the writers it visits is how a test states the check is linear in them\n * rather than the writers squared.\n */\nlet writerComparisonCount = 0;\n\n/** Records one writer the duplicate-writer check inspected. */\nexport function noteWriterComparison(): void {\n writerComparisonCount += 1;\n}\n\n/** The writers the duplicate-writer check inspected since the process started. */\nexport function writerComparisons(): number {\n return writerComparisonCount;\n}\n"]}
@@ -0,0 +1,35 @@
1
+ /** The object a refused member was written on, as the sentence about it needs it. */
2
+ export interface RefusalOwner {
3
+ readonly primitive: string;
4
+ /** Absent on an item declaration or context root. */
5
+ readonly fieldId?: string;
6
+ /** Present on a context root, which is named by its dotted path rather than a fieldId. */
7
+ readonly contextPath?: string;
8
+ /** Whether the declaration states `member`, so a companion's absence is a fact. */
9
+ readonly declares: (member: string) => boolean;
10
+ }
11
+ /**
12
+ * The sentence one refused member earns: the member, the declaration it was written on, what it
13
+ * states, and where it is admitted instead. An unknown member keeps the generic shape, because
14
+ * a member the table has not met is still a refusal an author must act on; the completeness test
15
+ * in `__tests__/member-refusal-wording.test.ts` fails before such a member can ship.
16
+ */
17
+ export declare function refusedMemberDetail(member: string, owner: RefusalOwner): string;
18
+ /**
19
+ * The sentence a `not` clause earns, from the members whose presence refused the instance.
20
+ *
21
+ * A pair that states one fact twice gets one sentence rather than two, because the repair is to
22
+ * keep one of them; every other member is stated on its own, so a `not` that refuses several
23
+ * members names each.
24
+ */
25
+ export declare function refusedMembersDetail(members: readonly string[], owner: RefusalOwner): string | undefined;
26
+ /**
27
+ * The declaration a validator instance location names, when it is a field or an item
28
+ * declaration.
29
+ *
30
+ * A `false` subschema is reported at the member (`#/fields/0/minItems`), and a `not` clause at
31
+ * the declaration (`#/fields/0`), so the caller passes the object each location names. A value
32
+ * without a `primitive` is not a declaration, and is left to the generic validator wording.
33
+ */
34
+ export declare function refusalOwnerOf(value: unknown): RefusalOwner | undefined;
35
+ //# sourceMappingURL=member-wording.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"member-wording.d.ts","sourceRoot":"","sources":["../../src/schema/member-wording.ts"],"names":[],"mappings":"AA6BA,qFAAqF;AACrF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,qDAAqD;IACrD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,0FAA0F;IAC1F,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;CAChD;AAgQD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,MAAM,CAM/E;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,KAAK,EAAE,YAAY,GAClB,MAAM,GAAG,SAAS,CAQpB;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,GAAG,SAAS,CAYvE"}