@azx-pbc/axiom-runtime 0.0.0-stage → 0.0.5

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 (755) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +714 -2
  3. package/dist/cache/index.d.ts +191 -0
  4. package/dist/cache/index.d.ts.map +1 -0
  5. package/dist/cache/index.js +361 -0
  6. package/dist/cache/index.js.map +1 -0
  7. package/dist/canonical/jcs.d.ts +78 -0
  8. package/dist/canonical/jcs.d.ts.map +1 -0
  9. package/dist/canonical/jcs.js +500 -0
  10. package/dist/canonical/jcs.js.map +1 -0
  11. package/dist/canonical/restricted-json.d.ts +7 -0
  12. package/dist/canonical/restricted-json.d.ts.map +1 -0
  13. package/dist/canonical/restricted-json.js +318 -0
  14. package/dist/canonical/restricted-json.js.map +1 -0
  15. package/dist/canonical/restricted-value.d.ts +59 -0
  16. package/dist/canonical/restricted-value.d.ts.map +1 -0
  17. package/dist/canonical/restricted-value.js +156 -0
  18. package/dist/canonical/restricted-value.js.map +1 -0
  19. package/dist/canonical/restricted.d.ts +85 -0
  20. package/dist/canonical/restricted.d.ts.map +1 -0
  21. package/dist/canonical/restricted.js +163 -0
  22. package/dist/canonical/restricted.js.map +1 -0
  23. package/dist/canonical/signature.d.ts +38 -0
  24. package/dist/canonical/signature.d.ts.map +1 -0
  25. package/dist/canonical/signature.js +47 -0
  26. package/dist/canonical/signature.js.map +1 -0
  27. package/dist/eval/access/delivery.d.ts +63 -0
  28. package/dist/eval/access/delivery.d.ts.map +1 -0
  29. package/dist/eval/access/delivery.js +98 -0
  30. package/dist/eval/access/delivery.js.map +1 -0
  31. package/dist/eval/access/overlay.d.ts +72 -0
  32. package/dist/eval/access/overlay.d.ts.map +1 -0
  33. package/dist/eval/access/overlay.js +402 -0
  34. package/dist/eval/access/overlay.js.map +1 -0
  35. package/dist/eval/access/projection.d.ts +159 -0
  36. package/dist/eval/access/projection.d.ts.map +1 -0
  37. package/dist/eval/access/projection.js +211 -0
  38. package/dist/eval/access/projection.js.map +1 -0
  39. package/dist/eval/access/window.d.ts +128 -0
  40. package/dist/eval/access/window.d.ts.map +1 -0
  41. package/dist/eval/access/window.js +254 -0
  42. package/dist/eval/access/window.js.map +1 -0
  43. package/dist/eval/access/write.d.ts +113 -0
  44. package/dist/eval/access/write.d.ts.map +1 -0
  45. package/dist/eval/access/write.js +119 -0
  46. package/dist/eval/access/write.js.map +1 -0
  47. package/dist/eval/addressing.d.ts +131 -0
  48. package/dist/eval/addressing.d.ts.map +1 -0
  49. package/dist/eval/addressing.js +270 -0
  50. package/dist/eval/addressing.js.map +1 -0
  51. package/dist/eval/budget.d.ts +143 -0
  52. package/dist/eval/budget.d.ts.map +1 -0
  53. package/dist/eval/budget.js +387 -0
  54. package/dist/eval/budget.js.map +1 -0
  55. package/dist/eval/computed.d.ts +46 -0
  56. package/dist/eval/computed.d.ts.map +1 -0
  57. package/dist/eval/computed.js +89 -0
  58. package/dist/eval/computed.js.map +1 -0
  59. package/dist/eval/denials.d.ts +64 -0
  60. package/dist/eval/denials.d.ts.map +1 -0
  61. package/dist/eval/denials.js +87 -0
  62. package/dist/eval/denials.js.map +1 -0
  63. package/dist/eval/engine/cancellation.d.ts +12 -0
  64. package/dist/eval/engine/cancellation.d.ts.map +1 -0
  65. package/dist/eval/engine/cancellation.js +56 -0
  66. package/dist/eval/engine/cancellation.js.map +1 -0
  67. package/dist/eval/engine/delta.d.ts +104 -0
  68. package/dist/eval/engine/delta.d.ts.map +1 -0
  69. package/dist/eval/engine/delta.js +466 -0
  70. package/dist/eval/engine/delta.js.map +1 -0
  71. package/dist/eval/engine/deps.d.ts +136 -0
  72. package/dist/eval/engine/deps.d.ts.map +1 -0
  73. package/dist/eval/engine/deps.js +345 -0
  74. package/dist/eval/engine/deps.js.map +1 -0
  75. package/dist/eval/engine/identity.d.ts +128 -0
  76. package/dist/eval/engine/identity.d.ts.map +1 -0
  77. package/dist/eval/engine/identity.js +398 -0
  78. package/dist/eval/engine/identity.js.map +1 -0
  79. package/dist/eval/engine/index.d.ts +200 -0
  80. package/dist/eval/engine/index.d.ts.map +1 -0
  81. package/dist/eval/engine/index.js +1242 -0
  82. package/dist/eval/engine/index.js.map +1 -0
  83. package/dist/eval/engine/measurement.d.ts +23 -0
  84. package/dist/eval/engine/measurement.d.ts.map +1 -0
  85. package/dist/eval/engine/measurement.js +42 -0
  86. package/dist/eval/engine/measurement.js.map +1 -0
  87. package/dist/eval/engine/naive.d.ts +19 -0
  88. package/dist/eval/engine/naive.d.ts.map +1 -0
  89. package/dist/eval/engine/naive.js +59 -0
  90. package/dist/eval/engine/naive.js.map +1 -0
  91. package/dist/eval/engine/ops.d.ts +214 -0
  92. package/dist/eval/engine/ops.d.ts.map +1 -0
  93. package/dist/eval/engine/ops.js +1422 -0
  94. package/dist/eval/engine/ops.js.map +1 -0
  95. package/dist/eval/engine/patches.d.ts +40 -0
  96. package/dist/eval/engine/patches.d.ts.map +1 -0
  97. package/dist/eval/engine/patches.js +125 -0
  98. package/dist/eval/engine/patches.js.map +1 -0
  99. package/dist/eval/engine/ports.d.ts +71 -0
  100. package/dist/eval/engine/ports.d.ts.map +1 -0
  101. package/dist/eval/engine/ports.js +2 -0
  102. package/dist/eval/engine/ports.js.map +1 -0
  103. package/dist/eval/engine/session.d.ts +116 -0
  104. package/dist/eval/engine/session.d.ts.map +1 -0
  105. package/dist/eval/engine/session.js +653 -0
  106. package/dist/eval/engine/session.js.map +1 -0
  107. package/dist/eval/engine/snapshot.d.ts +97 -0
  108. package/dist/eval/engine/snapshot.d.ts.map +1 -0
  109. package/dist/eval/engine/snapshot.js +221 -0
  110. package/dist/eval/engine/snapshot.js.map +1 -0
  111. package/dist/eval/engine/subscriptions.d.ts +47 -0
  112. package/dist/eval/engine/subscriptions.d.ts.map +1 -0
  113. package/dist/eval/engine/subscriptions.js +103 -0
  114. package/dist/eval/engine/subscriptions.js.map +1 -0
  115. package/dist/eval/engine/trace.d.ts +77 -0
  116. package/dist/eval/engine/trace.d.ts.map +1 -0
  117. package/dist/eval/engine/trace.js +140 -0
  118. package/dist/eval/engine/trace.js.map +1 -0
  119. package/dist/eval/error-diagnostic.d.ts +26 -0
  120. package/dist/eval/error-diagnostic.d.ts.map +1 -0
  121. package/dist/eval/error-diagnostic.js +63 -0
  122. package/dist/eval/error-diagnostic.js.map +1 -0
  123. package/dist/eval/evaluate-expr.d.ts +44 -0
  124. package/dist/eval/evaluate-expr.d.ts.map +1 -0
  125. package/dist/eval/evaluate-expr.js +149 -0
  126. package/dist/eval/evaluate-expr.js.map +1 -0
  127. package/dist/eval/evaluate.d.ts +282 -0
  128. package/dist/eval/evaluate.d.ts.map +1 -0
  129. package/dist/eval/evaluate.js +391 -0
  130. package/dist/eval/evaluate.js.map +1 -0
  131. package/dist/eval/evolution/relocate.d.ts +72 -0
  132. package/dist/eval/evolution/relocate.d.ts.map +1 -0
  133. package/dist/eval/evolution/relocate.js +427 -0
  134. package/dist/eval/evolution/relocate.js.map +1 -0
  135. package/dist/eval/evolution/select.d.ts +11 -0
  136. package/dist/eval/evolution/select.d.ts.map +1 -0
  137. package/dist/eval/evolution/select.js +53 -0
  138. package/dist/eval/evolution/select.js.map +1 -0
  139. package/dist/eval/evolution/upcast.d.ts +13 -0
  140. package/dist/eval/evolution/upcast.d.ts.map +1 -0
  141. package/dist/eval/evolution/upcast.js +88 -0
  142. package/dist/eval/evolution/upcast.js.map +1 -0
  143. package/dist/eval/expr/aggregates.d.ts +75 -0
  144. package/dist/eval/expr/aggregates.d.ts.map +1 -0
  145. package/dist/eval/expr/aggregates.js +991 -0
  146. package/dist/eval/expr/aggregates.js.map +1 -0
  147. package/dist/eval/expr/arithmetic.d.ts +26 -0
  148. package/dist/eval/expr/arithmetic.d.ts.map +1 -0
  149. package/dist/eval/expr/arithmetic.js +387 -0
  150. package/dist/eval/expr/arithmetic.js.map +1 -0
  151. package/dist/eval/expr/between.d.ts +17 -0
  152. package/dist/eval/expr/between.d.ts.map +1 -0
  153. package/dist/eval/expr/between.js +46 -0
  154. package/dist/eval/expr/between.js.map +1 -0
  155. package/dist/eval/expr/binder.d.ts +96 -0
  156. package/dist/eval/expr/binder.d.ts.map +1 -0
  157. package/dist/eval/expr/binder.js +253 -0
  158. package/dist/eval/expr/binder.js.map +1 -0
  159. package/dist/eval/expr/call-dispatch.d.ts +28 -0
  160. package/dist/eval/expr/call-dispatch.d.ts.map +1 -0
  161. package/dist/eval/expr/call-dispatch.js +114 -0
  162. package/dist/eval/expr/call-dispatch.js.map +1 -0
  163. package/dist/eval/expr/collections.d.ts +20 -0
  164. package/dist/eval/expr/collections.d.ts.map +1 -0
  165. package/dist/eval/expr/collections.js +66 -0
  166. package/dist/eval/expr/collections.js.map +1 -0
  167. package/dist/eval/expr/compare.d.ts +36 -0
  168. package/dist/eval/expr/compare.d.ts.map +1 -0
  169. package/dist/eval/expr/compare.js +115 -0
  170. package/dist/eval/expr/compare.js.map +1 -0
  171. package/dist/eval/expr/datasets.d.ts +28 -0
  172. package/dist/eval/expr/datasets.d.ts.map +1 -0
  173. package/dist/eval/expr/datasets.js +304 -0
  174. package/dist/eval/expr/datasets.js.map +1 -0
  175. package/dist/eval/expr/digest.d.ts +23 -0
  176. package/dist/eval/expr/digest.d.ts.map +1 -0
  177. package/dist/eval/expr/digest.js +89 -0
  178. package/dist/eval/expr/digest.js.map +1 -0
  179. package/dist/eval/expr/domains.d.ts +19 -0
  180. package/dist/eval/expr/domains.d.ts.map +1 -0
  181. package/dist/eval/expr/domains.js +18 -0
  182. package/dist/eval/expr/domains.js.map +1 -0
  183. package/dist/eval/expr/host.d.ts +152 -0
  184. package/dist/eval/expr/host.d.ts.map +1 -0
  185. package/dist/eval/expr/host.js +36 -0
  186. package/dist/eval/expr/host.js.map +1 -0
  187. package/dist/eval/expr/lists.d.ts +24 -0
  188. package/dist/eval/expr/lists.d.ts.map +1 -0
  189. package/dist/eval/expr/lists.js +155 -0
  190. package/dist/eval/expr/lists.js.map +1 -0
  191. package/dist/eval/expr/member.d.ts +15 -0
  192. package/dist/eval/expr/member.d.ts.map +1 -0
  193. package/dist/eval/expr/member.js +32 -0
  194. package/dist/eval/expr/member.js.map +1 -0
  195. package/dist/eval/expr/money-ops.d.ts +10 -0
  196. package/dist/eval/expr/money-ops.d.ts.map +1 -0
  197. package/dist/eval/expr/money-ops.js +17 -0
  198. package/dist/eval/expr/money-ops.js.map +1 -0
  199. package/dist/eval/expr/operands.d.ts +27 -0
  200. package/dist/eval/expr/operands.d.ts.map +1 -0
  201. package/dist/eval/expr/operands.js +167 -0
  202. package/dist/eval/expr/operands.js.map +1 -0
  203. package/dist/eval/expr/presence.d.ts +27 -0
  204. package/dist/eval/expr/presence.d.ts.map +1 -0
  205. package/dist/eval/expr/presence.js +140 -0
  206. package/dist/eval/expr/presence.js.map +1 -0
  207. package/dist/eval/expr/records.d.ts +22 -0
  208. package/dist/eval/expr/records.d.ts.map +1 -0
  209. package/dist/eval/expr/records.js +101 -0
  210. package/dist/eval/expr/records.js.map +1 -0
  211. package/dist/eval/expr/rule-refs.d.ts +25 -0
  212. package/dist/eval/expr/rule-refs.d.ts.map +1 -0
  213. package/dist/eval/expr/rule-refs.js +60 -0
  214. package/dist/eval/expr/rule-refs.js.map +1 -0
  215. package/dist/eval/expr/sequences.d.ts +26 -0
  216. package/dist/eval/expr/sequences.d.ts.map +1 -0
  217. package/dist/eval/expr/sequences.js +151 -0
  218. package/dist/eval/expr/sequences.js.map +1 -0
  219. package/dist/eval/expr/value.d.ts +99 -0
  220. package/dist/eval/expr/value.d.ts.map +1 -0
  221. package/dist/eval/expr/value.js +14 -0
  222. package/dist/eval/expr/value.js.map +1 -0
  223. package/dist/eval/expression.d.ts +142 -0
  224. package/dist/eval/expression.d.ts.map +1 -0
  225. package/dist/eval/expression.js +446 -0
  226. package/dist/eval/expression.js.map +1 -0
  227. package/dist/eval/firing.d.ts +68 -0
  228. package/dist/eval/firing.d.ts.map +1 -0
  229. package/dist/eval/firing.js +222 -0
  230. package/dist/eval/firing.js.map +1 -0
  231. package/dist/eval/gate.d.ts +110 -0
  232. package/dist/eval/gate.d.ts.map +1 -0
  233. package/dist/eval/gate.js +278 -0
  234. package/dist/eval/gate.js.map +1 -0
  235. package/dist/eval/layout-visibility.d.ts +18 -0
  236. package/dist/eval/layout-visibility.d.ts.map +1 -0
  237. package/dist/eval/layout-visibility.js +61 -0
  238. package/dist/eval/layout-visibility.js.map +1 -0
  239. package/dist/eval/option-availability.d.ts +26 -0
  240. package/dist/eval/option-availability.d.ts.map +1 -0
  241. package/dist/eval/option-availability.js +580 -0
  242. package/dist/eval/option-availability.js.map +1 -0
  243. package/dist/eval/options-boundary.d.ts +15 -0
  244. package/dist/eval/options-boundary.d.ts.map +1 -0
  245. package/dist/eval/options-boundary.js +40 -0
  246. package/dist/eval/options-boundary.js.map +1 -0
  247. package/dist/eval/options.d.ts +99 -0
  248. package/dist/eval/options.d.ts.map +1 -0
  249. package/dist/eval/options.js +96 -0
  250. package/dist/eval/options.js.map +1 -0
  251. package/dist/eval/overrides.d.ts +116 -0
  252. package/dist/eval/overrides.d.ts.map +1 -0
  253. package/dist/eval/overrides.js +176 -0
  254. package/dist/eval/overrides.js.map +1 -0
  255. package/dist/eval/paths.d.ts +25 -0
  256. package/dist/eval/paths.d.ts.map +1 -0
  257. package/dist/eval/paths.js +47 -0
  258. package/dist/eval/paths.js.map +1 -0
  259. package/dist/eval/presentation-reads.d.ts +20 -0
  260. package/dist/eval/presentation-reads.d.ts.map +1 -0
  261. package/dist/eval/presentation-reads.js +2 -0
  262. package/dist/eval/presentation-reads.js.map +1 -0
  263. package/dist/eval/presentation.d.ts +122 -0
  264. package/dist/eval/presentation.d.ts.map +1 -0
  265. package/dist/eval/presentation.js +255 -0
  266. package/dist/eval/presentation.js.map +1 -0
  267. package/dist/eval/reader/context-value.d.ts +41 -0
  268. package/dist/eval/reader/context-value.d.ts.map +1 -0
  269. package/dist/eval/reader/context-value.js +129 -0
  270. package/dist/eval/reader/context-value.js.map +1 -0
  271. package/dist/eval/reader/covered.d.ts +53 -0
  272. package/dist/eval/reader/covered.d.ts.map +1 -0
  273. package/dist/eval/reader/covered.js +139 -0
  274. package/dist/eval/reader/covered.js.map +1 -0
  275. package/dist/eval/reader/declarations.d.ts +182 -0
  276. package/dist/eval/reader/declarations.d.ts.map +1 -0
  277. package/dist/eval/reader/declarations.js +153 -0
  278. package/dist/eval/reader/declarations.js.map +1 -0
  279. package/dist/eval/reader/member-access.d.ts +87 -0
  280. package/dist/eval/reader/member-access.d.ts.map +1 -0
  281. package/dist/eval/reader/member-access.js +212 -0
  282. package/dist/eval/reader/member-access.js.map +1 -0
  283. package/dist/eval/reader/memo.d.ts +34 -0
  284. package/dist/eval/reader/memo.d.ts.map +1 -0
  285. package/dist/eval/reader/memo.js +67 -0
  286. package/dist/eval/reader/memo.js.map +1 -0
  287. package/dist/eval/reader/overlay.d.ts +74 -0
  288. package/dist/eval/reader/overlay.d.ts.map +1 -0
  289. package/dist/eval/reader/overlay.js +365 -0
  290. package/dist/eval/reader/overlay.js.map +1 -0
  291. package/dist/eval/reader/questions.d.ts +37 -0
  292. package/dist/eval/reader/questions.d.ts.map +1 -0
  293. package/dist/eval/reader/questions.js +78 -0
  294. package/dist/eval/reader/questions.js.map +1 -0
  295. package/dist/eval/reader/resolve.d.ts +84 -0
  296. package/dist/eval/reader/resolve.d.ts.map +1 -0
  297. package/dist/eval/reader/resolve.js +310 -0
  298. package/dist/eval/reader/resolve.js.map +1 -0
  299. package/dist/eval/reader/value-read.d.ts +50 -0
  300. package/dist/eval/reader/value-read.d.ts.map +1 -0
  301. package/dist/eval/reader/value-read.js +133 -0
  302. package/dist/eval/reader/value-read.js.map +1 -0
  303. package/dist/eval/reader/withheld.d.ts +48 -0
  304. package/dist/eval/reader/withheld.d.ts.map +1 -0
  305. package/dist/eval/reader/withheld.js +108 -0
  306. package/dist/eval/reader/withheld.js.map +1 -0
  307. package/dist/eval/reader-paths.d.ts +24 -0
  308. package/dist/eval/reader-paths.d.ts.map +1 -0
  309. package/dist/eval/reader-paths.js +23 -0
  310. package/dist/eval/reader-paths.js.map +1 -0
  311. package/dist/eval/reader.d.ts +281 -0
  312. package/dist/eval/reader.d.ts.map +1 -0
  313. package/dist/eval/reader.js +560 -0
  314. package/dist/eval/reader.js.map +1 -0
  315. package/dist/eval/receipt.d.ts +37 -0
  316. package/dist/eval/receipt.d.ts.map +1 -0
  317. package/dist/eval/receipt.js +222 -0
  318. package/dist/eval/receipt.js.map +1 -0
  319. package/dist/eval/report/assemble.d.ts +84 -0
  320. package/dist/eval/report/assemble.d.ts.map +1 -0
  321. package/dist/eval/report/assemble.js +277 -0
  322. package/dist/eval/report/assemble.js.map +1 -0
  323. package/dist/eval/report/fold.d.ts +18 -0
  324. package/dist/eval/report/fold.d.ts.map +1 -0
  325. package/dist/eval/report/fold.js +58 -0
  326. package/dist/eval/report/fold.js.map +1 -0
  327. package/dist/eval/rule/alternatives.d.ts +23 -0
  328. package/dist/eval/rule/alternatives.d.ts.map +1 -0
  329. package/dist/eval/rule/alternatives.js +46 -0
  330. package/dist/eval/rule/alternatives.js.map +1 -0
  331. package/dist/eval/rule/behaviour.d.ts +47 -0
  332. package/dist/eval/rule/behaviour.d.ts.map +1 -0
  333. package/dist/eval/rule/behaviour.js +249 -0
  334. package/dist/eval/rule/behaviour.js.map +1 -0
  335. package/dist/eval/rule/compute.d.ts +46 -0
  336. package/dist/eval/rule/compute.d.ts.map +1 -0
  337. package/dist/eval/rule/compute.js +158 -0
  338. package/dist/eval/rule/compute.js.map +1 -0
  339. package/dist/eval/rule/create-state.d.ts +42 -0
  340. package/dist/eval/rule/create-state.d.ts.map +1 -0
  341. package/dist/eval/rule/create-state.js +134 -0
  342. package/dist/eval/rule/create-state.js.map +1 -0
  343. package/dist/eval/rule/diagnostics.d.ts +24 -0
  344. package/dist/eval/rule/diagnostics.d.ts.map +1 -0
  345. package/dist/eval/rule/diagnostics.js +45 -0
  346. package/dist/eval/rule/diagnostics.js.map +1 -0
  347. package/dist/eval/rule/execution.d.ts +24 -0
  348. package/dist/eval/rule/execution.d.ts.map +1 -0
  349. package/dist/eval/rule/execution.js +495 -0
  350. package/dist/eval/rule/execution.js.map +1 -0
  351. package/dist/eval/rule/gate.d.ts +12 -0
  352. package/dist/eval/rule/gate.d.ts.map +1 -0
  353. package/dist/eval/rule/gate.js +34 -0
  354. package/dist/eval/rule/gate.js.map +1 -0
  355. package/dist/eval/rule/item.d.ts +11 -0
  356. package/dist/eval/rule/item.d.ts.map +1 -0
  357. package/dist/eval/rule/item.js +265 -0
  358. package/dist/eval/rule/item.js.map +1 -0
  359. package/dist/eval/rule/prepare.d.ts +64 -0
  360. package/dist/eval/rule/prepare.d.ts.map +1 -0
  361. package/dist/eval/rule/prepare.js +131 -0
  362. package/dist/eval/rule/prepare.js.map +1 -0
  363. package/dist/eval/rule/result.d.ts +97 -0
  364. package/dist/eval/rule/result.d.ts.map +1 -0
  365. package/dist/eval/rule/result.js +347 -0
  366. package/dist/eval/rule/result.js.map +1 -0
  367. package/dist/eval/rule/runner.d.ts +128 -0
  368. package/dist/eval/rule/runner.d.ts.map +1 -0
  369. package/dist/eval/rule/runner.js +296 -0
  370. package/dist/eval/rule/runner.js.map +1 -0
  371. package/dist/eval/rule/screen.d.ts +32 -0
  372. package/dist/eval/rule/screen.d.ts.map +1 -0
  373. package/dist/eval/rule/screen.js +73 -0
  374. package/dist/eval/rule/screen.js.map +1 -0
  375. package/dist/eval/rule/state.d.ts +137 -0
  376. package/dist/eval/rule/state.d.ts.map +1 -0
  377. package/dist/eval/rule/state.js +2 -0
  378. package/dist/eval/rule/state.js.map +1 -0
  379. package/dist/eval/rule/steps.d.ts +44 -0
  380. package/dist/eval/rule/steps.d.ts.map +1 -0
  381. package/dist/eval/rule/steps.js +367 -0
  382. package/dist/eval/rule/steps.js.map +1 -0
  383. package/dist/eval/rule/visibility.d.ts +18 -0
  384. package/dist/eval/rule/visibility.d.ts.map +1 -0
  385. package/dist/eval/rule/visibility.js +79 -0
  386. package/dist/eval/rule/visibility.js.map +1 -0
  387. package/dist/eval/seal.d.ts +74 -0
  388. package/dist/eval/seal.d.ts.map +1 -0
  389. package/dist/eval/seal.js +154 -0
  390. package/dist/eval/seal.js.map +1 -0
  391. package/dist/eval/signature-coverage.d.ts +19 -0
  392. package/dist/eval/signature-coverage.d.ts.map +1 -0
  393. package/dist/eval/signature-coverage.js +160 -0
  394. package/dist/eval/signature-coverage.js.map +1 -0
  395. package/dist/eval/state/derive.d.ts +72 -0
  396. package/dist/eval/state/derive.d.ts.map +1 -0
  397. package/dist/eval/state/derive.js +61 -0
  398. package/dist/eval/state/derive.js.map +1 -0
  399. package/dist/eval/state/describe.d.ts +18 -0
  400. package/dist/eval/state/describe.d.ts.map +1 -0
  401. package/dist/eval/state/describe.js +19 -0
  402. package/dist/eval/state/describe.js.map +1 -0
  403. package/dist/eval/state/field-state.d.ts +471 -0
  404. package/dist/eval/state/field-state.d.ts.map +1 -0
  405. package/dist/eval/state/field-state.js +1604 -0
  406. package/dist/eval/state/field-state.js.map +1 -0
  407. package/dist/eval/state/measurement.d.ts +136 -0
  408. package/dist/eval/state/measurement.d.ts.map +1 -0
  409. package/dist/eval/state/measurement.js +209 -0
  410. package/dist/eval/state/measurement.js.map +1 -0
  411. package/dist/eval/state/options.d.ts +21 -0
  412. package/dist/eval/state/options.d.ts.map +1 -0
  413. package/dist/eval/state/options.js +3 -0
  414. package/dist/eval/state/options.js.map +1 -0
  415. package/dist/eval/state/readiness.d.ts +400 -0
  416. package/dist/eval/state/readiness.d.ts.map +1 -0
  417. package/dist/eval/state/readiness.js +1067 -0
  418. package/dist/eval/state/readiness.js.map +1 -0
  419. package/dist/eval/state/snapshot.d.ts +130 -0
  420. package/dist/eval/state/snapshot.d.ts.map +1 -0
  421. package/dist/eval/state/snapshot.js +35 -0
  422. package/dist/eval/state/snapshot.js.map +1 -0
  423. package/dist/eval/state/unavailable-options.d.ts +54 -0
  424. package/dist/eval/state/unavailable-options.d.ts.map +1 -0
  425. package/dist/eval/state/unavailable-options.js +82 -0
  426. package/dist/eval/state/unavailable-options.js.map +1 -0
  427. package/dist/eval/state/value-state.d.ts +38 -0
  428. package/dist/eval/state/value-state.d.ts.map +1 -0
  429. package/dist/eval/state/value-state.js +52 -0
  430. package/dist/eval/state/value-state.js.map +1 -0
  431. package/dist/eval/submission/admission.d.ts +50 -0
  432. package/dist/eval/submission/admission.d.ts.map +1 -0
  433. package/dist/eval/submission/admission.js +174 -0
  434. package/dist/eval/submission/admission.js.map +1 -0
  435. package/dist/eval/submission/authority.d.ts +71 -0
  436. package/dist/eval/submission/authority.d.ts.map +1 -0
  437. package/dist/eval/submission/authority.js +118 -0
  438. package/dist/eval/submission/authority.js.map +1 -0
  439. package/dist/eval/submission/datasets.d.ts +28 -0
  440. package/dist/eval/submission/datasets.d.ts.map +1 -0
  441. package/dist/eval/submission/datasets.js +109 -0
  442. package/dist/eval/submission/datasets.js.map +1 -0
  443. package/dist/eval/submission/index.d.ts +15 -0
  444. package/dist/eval/submission/index.d.ts.map +1 -0
  445. package/dist/eval/submission/index.js +13 -0
  446. package/dist/eval/submission/index.js.map +1 -0
  447. package/dist/eval/submission/refusals.d.ts +103 -0
  448. package/dist/eval/submission/refusals.d.ts.map +1 -0
  449. package/dist/eval/submission/refusals.js +15 -0
  450. package/dist/eval/submission/refusals.js.map +1 -0
  451. package/dist/eval/submission/signatures.d.ts +7 -0
  452. package/dist/eval/submission/signatures.d.ts.map +1 -0
  453. package/dist/eval/submission/signatures.js +215 -0
  454. package/dist/eval/submission/signatures.js.map +1 -0
  455. package/dist/eval/submission/writes.d.ts +51 -0
  456. package/dist/eval/submission/writes.d.ts.map +1 -0
  457. package/dist/eval/submission/writes.js +203 -0
  458. package/dist/eval/submission/writes.js.map +1 -0
  459. package/dist/eval/submission.d.ts +53 -0
  460. package/dist/eval/submission.d.ts.map +1 -0
  461. package/dist/eval/submission.js +521 -0
  462. package/dist/eval/submission.js.map +1 -0
  463. package/dist/eval/suggestions-to-engine.d.ts +18 -0
  464. package/dist/eval/suggestions-to-engine.d.ts.map +1 -0
  465. package/dist/eval/suggestions-to-engine.js +40 -0
  466. package/dist/eval/suggestions-to-engine.js.map +1 -0
  467. package/dist/eval/suggestions.d.ts +17 -0
  468. package/dist/eval/suggestions.d.ts.map +1 -0
  469. package/dist/eval/suggestions.js +314 -0
  470. package/dist/eval/suggestions.js.map +1 -0
  471. package/dist/eval/undecided.d.ts +64 -0
  472. package/dist/eval/undecided.d.ts.map +1 -0
  473. package/dist/eval/undecided.js +101 -0
  474. package/dist/eval/undecided.js.map +1 -0
  475. package/dist/eval/verdict.d.ts +66 -0
  476. package/dist/eval/verdict.d.ts.map +1 -0
  477. package/dist/eval/verdict.js +106 -0
  478. package/dist/eval/verdict.js.map +1 -0
  479. package/dist/eval/verify-signature.d.ts +78 -0
  480. package/dist/eval/verify-signature.d.ts.map +1 -0
  481. package/dist/eval/verify-signature.js +185 -0
  482. package/dist/eval/verify-signature.js.map +1 -0
  483. package/dist/eval/version-dispatch.d.ts +38 -0
  484. package/dist/eval/version-dispatch.d.ts.map +1 -0
  485. package/dist/eval/version-dispatch.js +61 -0
  486. package/dist/eval/version-dispatch.js.map +1 -0
  487. package/dist/eval/visibility.d.ts +33 -0
  488. package/dist/eval/visibility.d.ts.map +1 -0
  489. package/dist/eval/visibility.js +83 -0
  490. package/dist/eval/visibility.js.map +1 -0
  491. package/dist/evaluate.d.ts +24 -0
  492. package/dist/evaluate.d.ts.map +1 -0
  493. package/dist/evaluate.js +18 -0
  494. package/dist/evaluate.js.map +1 -0
  495. package/dist/expr/builtin-docs.d.ts +51 -0
  496. package/dist/expr/builtin-docs.d.ts.map +1 -0
  497. package/dist/expr/builtin-docs.js +874 -0
  498. package/dist/expr/builtin-docs.js.map +1 -0
  499. package/dist/expr/builtins.d.ts +50 -0
  500. package/dist/expr/builtins.d.ts.map +1 -0
  501. package/dist/expr/builtins.js +966 -0
  502. package/dist/expr/builtins.js.map +1 -0
  503. package/dist/expr/decimal-precision.d.ts +39 -0
  504. package/dist/expr/decimal-precision.d.ts.map +1 -0
  505. package/dist/expr/decimal-precision.js +62 -0
  506. package/dist/expr/decimal-precision.js.map +1 -0
  507. package/dist/expr/decimal.d.ts +172 -0
  508. package/dist/expr/decimal.d.ts.map +1 -0
  509. package/dist/expr/decimal.js +782 -0
  510. package/dist/expr/decimal.js.map +1 -0
  511. package/dist/expr/deprecations.d.ts +34 -0
  512. package/dist/expr/deprecations.d.ts.map +1 -0
  513. package/dist/expr/deprecations.js +17 -0
  514. package/dist/expr/deprecations.js.map +1 -0
  515. package/dist/expr/diagnostics.d.ts +21 -0
  516. package/dist/expr/diagnostics.d.ts.map +1 -0
  517. package/dist/expr/diagnostics.js +231 -0
  518. package/dist/expr/diagnostics.js.map +1 -0
  519. package/dist/expr/direction.d.ts +30 -0
  520. package/dist/expr/direction.d.ts.map +1 -0
  521. package/dist/expr/direction.js +77 -0
  522. package/dist/expr/direction.js.map +1 -0
  523. package/dist/expr/example-expression.d.ts +62 -0
  524. package/dist/expr/example-expression.d.ts.map +1 -0
  525. package/dist/expr/example-expression.js +670 -0
  526. package/dist/expr/example-expression.js.map +1 -0
  527. package/dist/expr/instant.d.ts +49 -0
  528. package/dist/expr/instant.d.ts.map +1 -0
  529. package/dist/expr/instant.js +111 -0
  530. package/dist/expr/instant.js.map +1 -0
  531. package/dist/expr/logic.d.ts +17 -0
  532. package/dist/expr/logic.d.ts.map +1 -0
  533. package/dist/expr/logic.js +65 -0
  534. package/dist/expr/logic.js.map +1 -0
  535. package/dist/expr/messages.d.ts +45 -0
  536. package/dist/expr/messages.d.ts.map +1 -0
  537. package/dist/expr/messages.js +280 -0
  538. package/dist/expr/messages.js.map +1 -0
  539. package/dist/expr/money.d.ts +38 -0
  540. package/dist/expr/money.d.ts.map +1 -0
  541. package/dist/expr/money.js +127 -0
  542. package/dist/expr/money.js.map +1 -0
  543. package/dist/expr/ordering.d.ts +56 -0
  544. package/dist/expr/ordering.d.ts.map +1 -0
  545. package/dist/expr/ordering.js +167 -0
  546. package/dist/expr/ordering.js.map +1 -0
  547. package/dist/expr/pattern.d.ts +44 -0
  548. package/dist/expr/pattern.d.ts.map +1 -0
  549. package/dist/expr/pattern.js +458 -0
  550. package/dist/expr/pattern.js.map +1 -0
  551. package/dist/expr/plain-date.d.ts +90 -0
  552. package/dist/expr/plain-date.d.ts.map +1 -0
  553. package/dist/expr/plain-date.js +230 -0
  554. package/dist/expr/plain-date.js.map +1 -0
  555. package/dist/expr/plural-categories.d.ts +8 -0
  556. package/dist/expr/plural-categories.d.ts.map +1 -0
  557. package/dist/expr/plural-categories.js +15 -0
  558. package/dist/expr/plural-categories.js.map +1 -0
  559. package/dist/expr/plural-keys.d.ts +39 -0
  560. package/dist/expr/plural-keys.d.ts.map +1 -0
  561. package/dist/expr/plural-keys.js +46 -0
  562. package/dist/expr/plural-keys.js.map +1 -0
  563. package/dist/expr/plural.d.ts +33 -0
  564. package/dist/expr/plural.d.ts.map +1 -0
  565. package/dist/expr/plural.js +50 -0
  566. package/dist/expr/plural.js.map +1 -0
  567. package/dist/expr/quantity.d.ts +31 -0
  568. package/dist/expr/quantity.d.ts.map +1 -0
  569. package/dist/expr/quantity.js +83 -0
  570. package/dist/expr/quantity.js.map +1 -0
  571. package/dist/expr/reduce.d.ts +50 -0
  572. package/dist/expr/reduce.d.ts.map +1 -0
  573. package/dist/expr/reduce.js +236 -0
  574. package/dist/expr/reduce.js.map +1 -0
  575. package/dist/expr/regex.d.ts +108 -0
  576. package/dist/expr/regex.d.ts.map +1 -0
  577. package/dist/expr/regex.js +1210 -0
  578. package/dist/expr/regex.js.map +1 -0
  579. package/dist/expr/select-locale.d.ts +67 -0
  580. package/dist/expr/select-locale.d.ts.map +1 -0
  581. package/dist/expr/select-locale.js +219 -0
  582. package/dist/expr/select-locale.js.map +1 -0
  583. package/dist/expr/sequences.d.ts +123 -0
  584. package/dist/expr/sequences.d.ts.map +1 -0
  585. package/dist/expr/sequences.js +234 -0
  586. package/dist/expr/sequences.js.map +1 -0
  587. package/dist/expr/strings.d.ts +50 -0
  588. package/dist/expr/strings.d.ts.map +1 -0
  589. package/dist/expr/strings.js +184 -0
  590. package/dist/expr/strings.js.map +1 -0
  591. package/dist/expr/validation.d.ts +32 -0
  592. package/dist/expr/validation.d.ts.map +1 -0
  593. package/dist/expr/validation.js +182 -0
  594. package/dist/expr/validation.js.map +1 -0
  595. package/dist/graph/freeze.d.ts +4 -0
  596. package/dist/graph/freeze.d.ts.map +1 -0
  597. package/dist/graph/freeze.js +52 -0
  598. package/dist/graph/freeze.js.map +1 -0
  599. package/dist/graph/index.d.ts +15 -0
  600. package/dist/graph/index.d.ts.map +1 -0
  601. package/dist/graph/index.js +13 -0
  602. package/dist/graph/index.js.map +1 -0
  603. package/dist/graph/inspect.d.ts +76 -0
  604. package/dist/graph/inspect.d.ts.map +1 -0
  605. package/dist/graph/inspect.js +263 -0
  606. package/dist/graph/inspect.js.map +1 -0
  607. package/dist/graph/read-walk.d.ts +101 -0
  608. package/dist/graph/read-walk.d.ts.map +1 -0
  609. package/dist/graph/read-walk.js +358 -0
  610. package/dist/graph/read-walk.js.map +1 -0
  611. package/dist/graph/record-index.d.ts +24 -0
  612. package/dist/graph/record-index.d.ts.map +1 -0
  613. package/dist/graph/record-index.js +35 -0
  614. package/dist/graph/record-index.js.map +1 -0
  615. package/dist/index.d.ts +104 -0
  616. package/dist/index.d.ts.map +1 -0
  617. package/dist/index.js +139 -0
  618. package/dist/index.js.map +1 -0
  619. package/dist/lookup/digest.d.ts +51 -0
  620. package/dist/lookup/digest.d.ts.map +1 -0
  621. package/dist/lookup/digest.js +46 -0
  622. package/dist/lookup/digest.js.map +1 -0
  623. package/dist/lookup/index.d.ts +28 -0
  624. package/dist/lookup/index.d.ts.map +1 -0
  625. package/dist/lookup/index.js +27 -0
  626. package/dist/lookup/index.js.map +1 -0
  627. package/dist/lookup/install.d.ts +48 -0
  628. package/dist/lookup/install.d.ts.map +1 -0
  629. package/dist/lookup/install.js +315 -0
  630. package/dist/lookup/install.js.map +1 -0
  631. package/dist/lookup/pass.d.ts +55 -0
  632. package/dist/lookup/pass.d.ts.map +1 -0
  633. package/dist/lookup/pass.js +212 -0
  634. package/dist/lookup/pass.js.map +1 -0
  635. package/dist/lookup/pins.d.ts +34 -0
  636. package/dist/lookup/pins.d.ts.map +1 -0
  637. package/dist/lookup/pins.js +39 -0
  638. package/dist/lookup/pins.js.map +1 -0
  639. package/dist/lookup/provenance.d.ts +23 -0
  640. package/dist/lookup/provenance.d.ts.map +1 -0
  641. package/dist/lookup/provenance.js +78 -0
  642. package/dist/lookup/provenance.js.map +1 -0
  643. package/dist/lookup/readiness.d.ts +13 -0
  644. package/dist/lookup/readiness.d.ts.map +1 -0
  645. package/dist/lookup/readiness.js +57 -0
  646. package/dist/lookup/readiness.js.map +1 -0
  647. package/dist/lookup/resolve.d.ts +24 -0
  648. package/dist/lookup/resolve.d.ts.map +1 -0
  649. package/dist/lookup/resolve.js +201 -0
  650. package/dist/lookup/resolve.js.map +1 -0
  651. package/dist/lookup/store.d.ts +41 -0
  652. package/dist/lookup/store.d.ts.map +1 -0
  653. package/dist/lookup/store.js +74 -0
  654. package/dist/lookup/store.js.map +1 -0
  655. package/dist/model/access.d.ts +200 -0
  656. package/dist/model/access.d.ts.map +1 -0
  657. package/dist/model/access.js +125 -0
  658. package/dist/model/access.js.map +1 -0
  659. package/dist/model/artifact-members.d.ts +3 -0
  660. package/dist/model/artifact-members.d.ts.map +1 -0
  661. package/dist/model/artifact-members.js +38 -0
  662. package/dist/model/artifact-members.js.map +1 -0
  663. package/dist/model/composition.d.ts +47 -0
  664. package/dist/model/composition.d.ts.map +1 -0
  665. package/dist/model/composition.js +66 -0
  666. package/dist/model/composition.js.map +1 -0
  667. package/dist/model/domain.d.ts +51 -0
  668. package/dist/model/domain.d.ts.map +1 -0
  669. package/dist/model/domain.js +75 -0
  670. package/dist/model/domain.js.map +1 -0
  671. package/dist/model/duration.d.ts +31 -0
  672. package/dist/model/duration.d.ts.map +1 -0
  673. package/dist/model/duration.js +136 -0
  674. package/dist/model/duration.js.map +1 -0
  675. package/dist/model/errors.d.ts +58 -0
  676. package/dist/model/errors.d.ts.map +1 -0
  677. package/dist/model/errors.js +81 -0
  678. package/dist/model/errors.js.map +1 -0
  679. package/dist/model/evolution.d.ts +177 -0
  680. package/dist/model/evolution.d.ts.map +1 -0
  681. package/dist/model/evolution.js +5 -0
  682. package/dist/model/evolution.js.map +1 -0
  683. package/dist/model/expr-children.d.ts +15 -0
  684. package/dist/model/expr-children.d.ts.map +1 -0
  685. package/dist/model/expr-children.js +45 -0
  686. package/dist/model/expr-children.js.map +1 -0
  687. package/dist/model/guards.d.ts +9 -0
  688. package/dist/model/guards.d.ts.map +1 -0
  689. package/dist/model/guards.js +11 -0
  690. package/dist/model/guards.js.map +1 -0
  691. package/dist/model/input.d.ts +42 -0
  692. package/dist/model/input.d.ts.map +1 -0
  693. package/dist/model/input.js +26 -0
  694. package/dist/model/input.js.map +1 -0
  695. package/dist/model/integer.d.ts +14 -0
  696. package/dist/model/integer.d.ts.map +1 -0
  697. package/dist/model/integer.js +16 -0
  698. package/dist/model/integer.js.map +1 -0
  699. package/dist/model/intrinsic.d.ts +18 -0
  700. package/dist/model/intrinsic.d.ts.map +1 -0
  701. package/dist/model/intrinsic.js +21 -0
  702. package/dist/model/intrinsic.js.map +1 -0
  703. package/dist/model/layout.d.ts +129 -0
  704. package/dist/model/layout.d.ts.map +1 -0
  705. package/dist/model/layout.js +2 -0
  706. package/dist/model/layout.js.map +1 -0
  707. package/dist/model/media.d.ts +33 -0
  708. package/dist/model/media.d.ts.map +1 -0
  709. package/dist/model/media.js +86 -0
  710. package/dist/model/media.js.map +1 -0
  711. package/dist/model/members.generated.d.ts +11 -0
  712. package/dist/model/members.generated.d.ts.map +1 -0
  713. package/dist/model/members.generated.js +71 -0
  714. package/dist/model/members.generated.js.map +1 -0
  715. package/dist/model/row-address.d.ts +27 -0
  716. package/dist/model/row-address.d.ts.map +1 -0
  717. package/dist/model/row-address.js +146 -0
  718. package/dist/model/row-address.js.map +1 -0
  719. package/dist/model/schema.d.ts +108 -0
  720. package/dist/model/schema.d.ts.map +1 -0
  721. package/dist/model/schema.js +2 -0
  722. package/dist/model/schema.js.map +1 -0
  723. package/dist/model/shape.d.ts +193 -0
  724. package/dist/model/shape.d.ts.map +1 -0
  725. package/dist/model/shape.js +2 -0
  726. package/dist/model/shape.js.map +1 -0
  727. package/dist/model/time.d.ts +61 -0
  728. package/dist/model/time.d.ts.map +1 -0
  729. package/dist/model/time.js +110 -0
  730. package/dist/model/time.js.map +1 -0
  731. package/dist/model/types.d.ts +1329 -0
  732. package/dist/model/types.d.ts.map +1 -0
  733. package/dist/model/types.js +424 -0
  734. package/dist/model/types.js.map +1 -0
  735. package/dist/model/values.d.ts +91 -0
  736. package/dist/model/values.d.ts.map +1 -0
  737. package/dist/model/values.js +195 -0
  738. package/dist/model/values.js.map +1 -0
  739. package/dist/model/wire.d.ts +356 -0
  740. package/dist/model/wire.d.ts.map +1 -0
  741. package/dist/model/wire.js +1504 -0
  742. package/dist/model/wire.js.map +1 -0
  743. package/dist/offline/index.d.ts +374 -0
  744. package/dist/offline/index.d.ts.map +1 -0
  745. package/dist/offline/index.js +422 -0
  746. package/dist/offline/index.js.map +1 -0
  747. package/dist/testing.d.ts +30 -0
  748. package/dist/testing.d.ts.map +1 -0
  749. package/dist/testing.js +42 -0
  750. package/dist/testing.js.map +1 -0
  751. package/dist/version.d.ts +30 -0
  752. package/dist/version.d.ts.map +1 -0
  753. package/dist/version.js +116 -0
  754. package/dist/version.js.map +1 -0
  755. package/package.json +98 -3
@@ -0,0 +1,177 @@
1
+ import type { CompiledSchema } from './schema.js';
2
+ import type { DecimalString, FieldRef, WireValue } from './types.js';
3
+ /**
4
+ * The vocabulary of schema evolution, `spec/semantics/evolution-v1.md`.
5
+ *
6
+ * A record captured under one published version is read, verified and edited under another by
7
+ * moving values between *declarations*, never between paths: a `fieldId` is immortal, so an
8
+ * upcaster and a signature both name the identifier while the layout changes underneath them
9
+ * (`[EVOL-2.1.1]`). Everything a host supplies to that work — the retained artifacts, the
10
+ * upcasters, the currency inputs — is declared here, so the runtime and the host agree on one
11
+ * shape instead of each inventing its own.
12
+ */
13
+ /**
14
+ * The published artifacts a host retains, keyed by their own `schemaVersion`
15
+ * (`[EVOL-1.1.3]`).
16
+ *
17
+ * Retention is the host's obligation: an artifact a host no longer keeps cannot be resolved,
18
+ * and a record or signature that names it is refused rather than read against a different
19
+ * version's declarations.
20
+ */
21
+ export type SchemaCatalogue = ReadonlyMap<number, CompiledSchema>;
22
+ /**
23
+ * The members of a stored `signature_ref` that verification reads.
24
+ *
25
+ * The signature travels with the record; these are the bytes it binds and the version it was
26
+ * recorded under. `status`, `signerRole`, `signedAt`, `id` and `mediaRefId` are the blob's and
27
+ * the record's claims about the signer, never bytes the signature covers.
28
+ */
29
+ export interface StoredSignature {
30
+ readonly coveredTargets: readonly FieldRef[];
31
+ readonly schemaVersion: number;
32
+ readonly dataHash: string;
33
+ }
34
+ /**
35
+ * A host rate for one currency pair.
36
+ *
37
+ * The runtime never invents a rate, an as-of date or a rounding: a conversion is a recorded
38
+ * decision the host states, because a silently converted amount is a silently changed amount
39
+ * (`[EVOL-2.1.4]`).
40
+ */
41
+ export interface CurrencyRate {
42
+ readonly from: string;
43
+ readonly to: string;
44
+ readonly rate: DecimalString;
45
+ }
46
+ /**
47
+ * The host's conversion input for an upcast that changes a money domain.
48
+ *
49
+ * `asOf` is the civil date the rates describe, so a replayed upcast reproduces the amount the
50
+ * host decided on that day instead of reading a clock.
51
+ */
52
+ export interface CurrencyContext {
53
+ /** The civil date the rates are as of, spelled `YYYY-MM-DD`. */
54
+ readonly asOf: string;
55
+ /** The rates this context states, one per currency pair. */
56
+ readonly rates: readonly CurrencyRate[];
57
+ }
58
+ /** The rate `context` states for one pair, or `undefined` when it states none. */
59
+ export declare function currencyRate(context: CurrencyContext | undefined, from: string, to: string): DecimalString | undefined;
60
+ /**
61
+ * What one upcaster decides about one recorded value.
62
+ *
63
+ * A refusal carries the cause and never the value, so it is safe to log or store. It is a
64
+ * tagged outcome rather than a thrown error because a value a host cannot convert is an
65
+ * expected outcome of replaying history, not a violated invariant.
66
+ */
67
+ export type UpcastDecision = {
68
+ readonly kind: 'value';
69
+ readonly value: WireValue;
70
+ } | {
71
+ readonly kind: 'refused';
72
+ readonly detail: string;
73
+ };
74
+ /** The hop an upcaster runs in, and the host inputs it may read. */
75
+ export interface UpcastContext {
76
+ /** The version the value was recorded at. */
77
+ readonly from: number;
78
+ /** The version the value becomes. */
79
+ readonly to: number;
80
+ /** The conversion input a money upcaster needs, when the host states one. */
81
+ readonly currency?: CurrencyContext;
82
+ }
83
+ /**
84
+ * One version transition for one field: the value recorded at `from`, and the value it becomes
85
+ * at `to`. An upcaster never sees a path — the runtime locates the value by `fieldId` — so a
86
+ * layout change never requires one (`[EVOL-2.1.1]`, `[EVOL-2.1.2]`).
87
+ */
88
+ export type Upcaster = (value: unknown, context: UpcastContext) => UpcastDecision;
89
+ /**
90
+ * Upcasters keyed by the source version of the hop, then by the immutable `fieldId`.
91
+ *
92
+ * A version that has no map is an identity hop — the version bump validates differently but
93
+ * changes no recorded value — and a `fieldId` that has no upcaster carries its recorded value
94
+ * unchanged. Declaring the map per hop is what lets a host publish a version that adds a rule
95
+ * without also publishing a transform for every field.
96
+ */
97
+ export type Upcasters = ReadonlyMap<number, ReadonlyMap<string, Upcaster>>;
98
+ /** Everything one upcast request states. The card a host persists is the caller's. */
99
+ export interface UpcastRequest {
100
+ /** The stored record's values, keyed by `fieldId` as they were persisted. */
101
+ readonly values: Readonly<Record<string, unknown>>;
102
+ /** The version the values were recorded at. */
103
+ readonly from: number;
104
+ /** The version the record is wanted at. */
105
+ readonly to: number;
106
+ /** The retained artifacts, which must include every version between `from` and `to`. */
107
+ readonly catalogue: SchemaCatalogue;
108
+ /** The transitions the host publishes, keyed by source version. */
109
+ readonly upcasters: Upcasters;
110
+ /** The conversion input a money upcaster needs, when one runs. */
111
+ readonly currency?: CurrencyContext;
112
+ }
113
+ /** A refusal about the versions themselves: no retained artifact, or no upward path. */
114
+ export interface VersionNotRetainedRefusal {
115
+ readonly kind: 'version_not_retained';
116
+ /** The version the request starts at. */
117
+ readonly from: number;
118
+ /** The version the transition asked for; absent when a selection names no transition. */
119
+ readonly to?: number;
120
+ }
121
+ /** The request asks for an older version, which no upcaster expresses (`[EVOL-2.1.3]`). */
122
+ export interface NoPathRefusal {
123
+ readonly kind: 'no_path';
124
+ readonly from: number;
125
+ readonly to: number;
126
+ }
127
+ /** A declaration one of the two versions does not carry, so the value cannot be placed. */
128
+ export interface FieldUnresolvedRefusal {
129
+ readonly kind: 'field_unresolved';
130
+ readonly fieldId: string;
131
+ readonly from: number;
132
+ readonly to: number;
133
+ readonly detail: string;
134
+ }
135
+ /** An upcaster declined a recorded value, naming the cause and never the value. */
136
+ export interface ValueRefusedRefusal {
137
+ readonly kind: 'value_refused';
138
+ readonly fieldId: string;
139
+ readonly from: number;
140
+ readonly to: number;
141
+ readonly detail: string;
142
+ }
143
+ /** Everything an upcast can refuse, each naming the versions it was working between. */
144
+ export type UpcastRefusal = VersionNotRetainedRefusal | NoPathRefusal | FieldUnresolvedRefusal | ValueRefusedRefusal;
145
+ /** A record after an upcast, and the version its values now satisfy. */
146
+ export interface UpcastedRecord {
147
+ readonly kind: 'upcasted';
148
+ readonly values: Readonly<Record<string, unknown>>;
149
+ readonly schemaVersion: number;
150
+ }
151
+ /** The upcast's answer: the record at the requested version, or why it could not be carried. */
152
+ export type UpcastOutcome = UpcastedRecord | UpcastRefusal;
153
+ /** What a caller states when asking which version a record or draft evaluates under. */
154
+ export interface SelectEffectiveSchemaRequest {
155
+ /** The version the record or draft was created under. */
156
+ readonly recordedVersion: number;
157
+ /** Whether the host adopts a newly published version for in-flight drafts. */
158
+ readonly adoptInFlight: boolean;
159
+ }
160
+ /**
161
+ * The versions a record evaluates under, `[EVOL-5.1.1]`–`[EVOL-5.1.3]`.
162
+ *
163
+ * `first` is always the recorded version, because a draft is judged against the version it was
164
+ * completed under before a host decides anything else. `second` is present only when the host
165
+ * adopts the newest retained version, and it is reported beside the first so a transition is
166
+ * auditable rather than a silent re-judgement.
167
+ */
168
+ export interface EffectiveSchema {
169
+ readonly kind: 'selected';
170
+ readonly first: CompiledSchema;
171
+ readonly second?: CompiledSchema;
172
+ }
173
+ /** A selection whose recorded version the catalogue does not retain. */
174
+ export type SelectionRefusal = VersionNotRetainedRefusal;
175
+ /** The selection's answer: the versions to evaluate under, or why none could be named. */
176
+ export type SchemaSelection = EffectiveSchema | SelectionRefusal;
177
+ //# sourceMappingURL=evolution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evolution.d.ts","sourceRoot":"","sources":["../../src/model/evolution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAErE;;;;;;;;;GASG;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAElE;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,cAAc,EAAE,SAAS,QAAQ,EAAE,CAAC;IAC7C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;CAC9B;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;CACzC;AAED,kFAAkF;AAClF,wBAAgB,YAAY,CAC1B,OAAO,EAAE,eAAe,GAAG,SAAS,EACpC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,GACT,aAAa,GAAG,SAAS,CAE3B;AAED;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GACtB;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GACrD;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1D,oEAAoE;AACpE,MAAM,WAAW,aAAa;IAC5B,6CAA6C;IAC7C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,QAAQ,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC;CACrC;AAED;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,KAAK,cAAc,CAAC;AAElF;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAE3E,sFAAsF;AACtF,MAAM,WAAW,aAAa;IAC5B,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACnD,+CAA+C;IAC/C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,wFAAwF;IACxF,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,mEAAmE;IACnE,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,kEAAkE;IAClE,QAAQ,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC;CACrC;AAED,wFAAwF;AACxF,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACtC,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yFAAyF;IACzF,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,2FAA2F;AAC3F,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED,2FAA2F;AAC3F,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,mFAAmF;AACnF,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,wFAAwF;AACxF,MAAM,MAAM,aAAa,GACrB,yBAAyB,GACzB,aAAa,GACb,sBAAsB,GACtB,mBAAmB,CAAC;AAExB,wEAAwE;AACxE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACnD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,gGAAgG;AAChG,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,aAAa,CAAC;AAE3D,wFAAwF;AACxF,MAAM,WAAW,4BAA4B;IAC3C,yDAAyD;IACzD,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,8EAA8E;IAC9E,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC;CAClC;AAED,wEAAwE;AACxE,MAAM,MAAM,gBAAgB,GAAG,yBAAyB,CAAC;AAEzD,0FAA0F;AAC1F,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG,gBAAgB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /** The rate `context` states for one pair, or `undefined` when it states none. */
2
+ export function currencyRate(context, from, to) {
3
+ return context?.rates.find((rate) => rate.from === from && rate.to === to)?.rate;
4
+ }
5
+ //# sourceMappingURL=evolution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evolution.js","sourceRoot":"","sources":["../../src/model/evolution.ts"],"names":[],"mappings":"AA+DA,kFAAkF;AAClF,MAAM,UAAU,YAAY,CAC1B,OAAoC,EACpC,IAAY,EACZ,EAAU;IAEV,OAAO,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC;AACnF,CAAC","sourcesContent":["import type { CompiledSchema } from './schema.js';\nimport type { DecimalString, FieldRef, WireValue } from './types.js';\n\n/**\n * The vocabulary of schema evolution, `spec/semantics/evolution-v1.md`.\n *\n * A record captured under one published version is read, verified and edited under another by\n * moving values between *declarations*, never between paths: a `fieldId` is immortal, so an\n * upcaster and a signature both name the identifier while the layout changes underneath them\n * (`[EVOL-2.1.1]`). Everything a host supplies to that work — the retained artifacts, the\n * upcasters, the currency inputs — is declared here, so the runtime and the host agree on one\n * shape instead of each inventing its own.\n */\n\n/**\n * The published artifacts a host retains, keyed by their own `schemaVersion`\n * (`[EVOL-1.1.3]`).\n *\n * Retention is the host's obligation: an artifact a host no longer keeps cannot be resolved,\n * and a record or signature that names it is refused rather than read against a different\n * version's declarations.\n */\nexport type SchemaCatalogue = ReadonlyMap<number, CompiledSchema>;\n\n/**\n * The members of a stored `signature_ref` that verification reads.\n *\n * The signature travels with the record; these are the bytes it binds and the version it was\n * recorded under. `status`, `signerRole`, `signedAt`, `id` and `mediaRefId` are the blob's and\n * the record's claims about the signer, never bytes the signature covers.\n */\nexport interface StoredSignature {\n readonly coveredTargets: readonly FieldRef[];\n readonly schemaVersion: number;\n readonly dataHash: string;\n}\n\n/**\n * A host rate for one currency pair.\n *\n * The runtime never invents a rate, an as-of date or a rounding: a conversion is a recorded\n * decision the host states, because a silently converted amount is a silently changed amount\n * (`[EVOL-2.1.4]`).\n */\nexport interface CurrencyRate {\n readonly from: string;\n readonly to: string;\n readonly rate: DecimalString;\n}\n\n/**\n * The host's conversion input for an upcast that changes a money domain.\n *\n * `asOf` is the civil date the rates describe, so a replayed upcast reproduces the amount the\n * host decided on that day instead of reading a clock.\n */\nexport interface CurrencyContext {\n /** The civil date the rates are as of, spelled `YYYY-MM-DD`. */\n readonly asOf: string;\n /** The rates this context states, one per currency pair. */\n readonly rates: readonly CurrencyRate[];\n}\n\n/** The rate `context` states for one pair, or `undefined` when it states none. */\nexport function currencyRate(\n context: CurrencyContext | undefined,\n from: string,\n to: string,\n): DecimalString | undefined {\n return context?.rates.find((rate) => rate.from === from && rate.to === to)?.rate;\n}\n\n/**\n * What one upcaster decides about one recorded value.\n *\n * A refusal carries the cause and never the value, so it is safe to log or store. It is a\n * tagged outcome rather than a thrown error because a value a host cannot convert is an\n * expected outcome of replaying history, not a violated invariant.\n */\nexport type UpcastDecision =\n | { readonly kind: 'value'; readonly value: WireValue }\n | { readonly kind: 'refused'; readonly detail: string };\n\n/** The hop an upcaster runs in, and the host inputs it may read. */\nexport interface UpcastContext {\n /** The version the value was recorded at. */\n readonly from: number;\n /** The version the value becomes. */\n readonly to: number;\n /** The conversion input a money upcaster needs, when the host states one. */\n readonly currency?: CurrencyContext;\n}\n\n/**\n * One version transition for one field: the value recorded at `from`, and the value it becomes\n * at `to`. An upcaster never sees a path — the runtime locates the value by `fieldId` — so a\n * layout change never requires one (`[EVOL-2.1.1]`, `[EVOL-2.1.2]`).\n */\nexport type Upcaster = (value: unknown, context: UpcastContext) => UpcastDecision;\n\n/**\n * Upcasters keyed by the source version of the hop, then by the immutable `fieldId`.\n *\n * A version that has no map is an identity hop — the version bump validates differently but\n * changes no recorded value — and a `fieldId` that has no upcaster carries its recorded value\n * unchanged. Declaring the map per hop is what lets a host publish a version that adds a rule\n * without also publishing a transform for every field.\n */\nexport type Upcasters = ReadonlyMap<number, ReadonlyMap<string, Upcaster>>;\n\n/** Everything one upcast request states. The card a host persists is the caller's. */\nexport interface UpcastRequest {\n /** The stored record's values, keyed by `fieldId` as they were persisted. */\n readonly values: Readonly<Record<string, unknown>>;\n /** The version the values were recorded at. */\n readonly from: number;\n /** The version the record is wanted at. */\n readonly to: number;\n /** The retained artifacts, which must include every version between `from` and `to`. */\n readonly catalogue: SchemaCatalogue;\n /** The transitions the host publishes, keyed by source version. */\n readonly upcasters: Upcasters;\n /** The conversion input a money upcaster needs, when one runs. */\n readonly currency?: CurrencyContext;\n}\n\n/** A refusal about the versions themselves: no retained artifact, or no upward path. */\nexport interface VersionNotRetainedRefusal {\n readonly kind: 'version_not_retained';\n /** The version the request starts at. */\n readonly from: number;\n /** The version the transition asked for; absent when a selection names no transition. */\n readonly to?: number;\n}\n\n/** The request asks for an older version, which no upcaster expresses (`[EVOL-2.1.3]`). */\nexport interface NoPathRefusal {\n readonly kind: 'no_path';\n readonly from: number;\n readonly to: number;\n}\n\n/** A declaration one of the two versions does not carry, so the value cannot be placed. */\nexport interface FieldUnresolvedRefusal {\n readonly kind: 'field_unresolved';\n readonly fieldId: string;\n readonly from: number;\n readonly to: number;\n readonly detail: string;\n}\n\n/** An upcaster declined a recorded value, naming the cause and never the value. */\nexport interface ValueRefusedRefusal {\n readonly kind: 'value_refused';\n readonly fieldId: string;\n readonly from: number;\n readonly to: number;\n readonly detail: string;\n}\n\n/** Everything an upcast can refuse, each naming the versions it was working between. */\nexport type UpcastRefusal =\n | VersionNotRetainedRefusal\n | NoPathRefusal\n | FieldUnresolvedRefusal\n | ValueRefusedRefusal;\n\n/** A record after an upcast, and the version its values now satisfy. */\nexport interface UpcastedRecord {\n readonly kind: 'upcasted';\n readonly values: Readonly<Record<string, unknown>>;\n readonly schemaVersion: number;\n}\n\n/** The upcast's answer: the record at the requested version, or why it could not be carried. */\nexport type UpcastOutcome = UpcastedRecord | UpcastRefusal;\n\n/** What a caller states when asking which version a record or draft evaluates under. */\nexport interface SelectEffectiveSchemaRequest {\n /** The version the record or draft was created under. */\n readonly recordedVersion: number;\n /** Whether the host adopts a newly published version for in-flight drafts. */\n readonly adoptInFlight: boolean;\n}\n\n/**\n * The versions a record evaluates under, `[EVOL-5.1.1]`–`[EVOL-5.1.3]`.\n *\n * `first` is always the recorded version, because a draft is judged against the version it was\n * completed under before a host decides anything else. `second` is present only when the host\n * adopts the newest retained version, and it is reported beside the first so a transition is\n * auditable rather than a silent re-judgement.\n */\nexport interface EffectiveSchema {\n readonly kind: 'selected';\n readonly first: CompiledSchema;\n readonly second?: CompiledSchema;\n}\n\n/** A selection whose recorded version the catalogue does not retain. */\nexport type SelectionRefusal = VersionNotRetainedRefusal;\n\n/** The selection's answer: the versions to evaluate under, or why none could be named. */\nexport type SchemaSelection = EffectiveSchema | SelectionRefusal;\n"]}
@@ -0,0 +1,15 @@
1
+ import type { ExprNode } from './types.js';
2
+ /**
3
+ * The children of one expression node, in evaluation order.
4
+ *
5
+ * Every interpretation that walks the tree needs this list, and twelve files currently state it
6
+ * for themselves: reads, dependencies, cost, printing, typing, evaluation, suggestions, publish
7
+ * vectors. A node kind added to the union reaches only the walks someone remembered, which is how
8
+ * a new form silently stops being counted, printed or typechecked.
9
+ *
10
+ * This is the one place the list is written. The switch is exhaustive over the union, so a new
11
+ * kind fails to compile here — before it can be missed anywhere else. A walk that needs a
12
+ * different order (printing, for one) says so where it walks rather than forking this list.
13
+ */
14
+ export declare function childNodes(node: ExprNode): readonly ExprNode[];
15
+ //# sourceMappingURL=expr-children.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expr-children.d.ts","sourceRoot":"","sources":["../../src/model/expr-children.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,QAAQ,EAAE,CA8B9D"}
@@ -0,0 +1,45 @@
1
+ import { assertNever } from './errors.js';
2
+ /**
3
+ * The children of one expression node, in evaluation order.
4
+ *
5
+ * Every interpretation that walks the tree needs this list, and twelve files currently state it
6
+ * for themselves: reads, dependencies, cost, printing, typing, evaluation, suggestions, publish
7
+ * vectors. A node kind added to the union reaches only the walks someone remembered, which is how
8
+ * a new form silently stops being counted, printed or typechecked.
9
+ *
10
+ * This is the one place the list is written. The switch is exhaustive over the union, so a new
11
+ * kind fails to compile here — before it can be missed anywhere else. A walk that needs a
12
+ * different order (printing, for one) says so where it walks rather than forking this list.
13
+ */
14
+ export function childNodes(node) {
15
+ switch (node.kind) {
16
+ // A leaf states no child. Listed rather than defaulted, so the union cannot grow a leaf
17
+ // without a decision here.
18
+ case 'literal':
19
+ case 'path':
20
+ return [];
21
+ case 'list':
22
+ return node.items;
23
+ case 'and':
24
+ case 'or':
25
+ case 'call':
26
+ case 'coalesce':
27
+ return node.args;
28
+ case 'not':
29
+ return node.args;
30
+ case 'compare':
31
+ return node.args;
32
+ case 'if':
33
+ return node.args;
34
+ // The source is evaluated before the element, and the element before the predicate.
35
+ case 'comprehension':
36
+ return [
37
+ node.source,
38
+ ...(node.valueExpr === undefined ? [] : [node.valueExpr]),
39
+ ...(node.predicate === undefined ? [] : [node.predicate]),
40
+ ];
41
+ default:
42
+ return assertNever(node);
43
+ }
44
+ }
45
+ //# sourceMappingURL=expr-children.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expr-children.js","sourceRoot":"","sources":["../../src/model/expr-children.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,UAAU,CAAC,IAAc;IACvC,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,wFAAwF;QACxF,2BAA2B;QAC3B,KAAK,SAAS,CAAC;QACf,KAAK,MAAM;YACT,OAAO,EAAE,CAAC;QACZ,KAAK,MAAM;YACT,OAAO,IAAI,CAAC,KAAK,CAAC;QACpB,KAAK,KAAK,CAAC;QACX,KAAK,IAAI,CAAC;QACV,KAAK,MAAM,CAAC;QACZ,KAAK,UAAU;YACb,OAAO,IAAI,CAAC,IAAI,CAAC;QACnB,KAAK,KAAK;YACR,OAAO,IAAI,CAAC,IAAI,CAAC;QACnB,KAAK,SAAS;YACZ,OAAO,IAAI,CAAC,IAAI,CAAC;QACnB,KAAK,IAAI;YACP,OAAO,IAAI,CAAC,IAAI,CAAC;QACnB,oFAAoF;QACpF,KAAK,eAAe;YAClB,OAAO;gBACL,IAAI,CAAC,MAAM;gBACX,GAAG,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBACzD,GAAG,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aAC1D,CAAC;QACJ;YACE,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC","sourcesContent":["import { assertNever } from './errors.js';\nimport type { ExprNode } from './types.js';\n\n/**\n * The children of one expression node, in evaluation order.\n *\n * Every interpretation that walks the tree needs this list, and twelve files currently state it\n * for themselves: reads, dependencies, cost, printing, typing, evaluation, suggestions, publish\n * vectors. A node kind added to the union reaches only the walks someone remembered, which is how\n * a new form silently stops being counted, printed or typechecked.\n *\n * This is the one place the list is written. The switch is exhaustive over the union, so a new\n * kind fails to compile here — before it can be missed anywhere else. A walk that needs a\n * different order (printing, for one) says so where it walks rather than forking this list.\n */\nexport function childNodes(node: ExprNode): readonly ExprNode[] {\n switch (node.kind) {\n // A leaf states no child. Listed rather than defaulted, so the union cannot grow a leaf\n // without a decision here.\n case 'literal':\n case 'path':\n return [];\n case 'list':\n return node.items;\n case 'and':\n case 'or':\n case 'call':\n case 'coalesce':\n return node.args;\n case 'not':\n return node.args;\n case 'compare':\n return node.args;\n case 'if':\n return node.args;\n // The source is evaluated before the element, and the element before the predicate.\n case 'comprehension':\n return [\n node.source,\n ...(node.valueExpr === undefined ? [] : [node.valueExpr]),\n ...(node.predicate === undefined ? [] : [node.predicate]),\n ];\n default:\n return assertNever(node);\n }\n}\n"]}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Primitive shape guards shared by the model and the expression layer.
3
+ *
4
+ * This module imports nothing: it is the lowest layer of the runtime, so a guard used by both a
5
+ * wire-value normaliser and an arithmetic operation cannot create a cycle between them.
6
+ */
7
+ /** Whether `value` is a JSON object, as opposed to an array or `null`. */
8
+ export declare function isRecord(value: unknown): value is Record<string, unknown>;
9
+ //# sourceMappingURL=guards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../src/model/guards.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,0EAA0E;AAC1E,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Primitive shape guards shared by the model and the expression layer.
3
+ *
4
+ * This module imports nothing: it is the lowest layer of the runtime, so a guard used by both a
5
+ * wire-value normaliser and an arithmetic operation cannot create a cycle between them.
6
+ */
7
+ /** Whether `value` is a JSON object, as opposed to an array or `null`. */
8
+ export function isRecord(value) {
9
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
10
+ }
11
+ //# sourceMappingURL=guards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guards.js","sourceRoot":"","sources":["../../src/model/guards.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,0EAA0E;AAC1E,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["/**\n * Primitive shape guards shared by the model and the expression layer.\n *\n * This module imports nothing: it is the lowest layer of the runtime, so a guard used by both a\n * wire-value normaliser and an arithmetic operation cannot create a cycle between them.\n */\n\n/** Whether `value` is a JSON object, as opposed to an array or `null`. */\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n"]}
@@ -0,0 +1,42 @@
1
+ import type { AccessEntry, AccessOverlay, EvaluationInput } from './access.js';
2
+ import type { FieldRef } from './types.js';
3
+ /**
4
+ * Building an `EvaluationInput` from its parsed parts.
5
+ *
6
+ * The input's access answer is a union (`AccessSource` in `access.ts`), so an object literal that
7
+ * spreads an optional `overlay` and an optional `access` cannot be assigned to it: each arm
8
+ * states the other member as `?: undefined`, and a spread carries `AccessOverlay | undefined`
9
+ * where that arm requires absence. This builder is the one place the union is assembled — from
10
+ * the record members and a tag naming the access source that was read — so the wire readers and
11
+ * the engine's sessions each construct one arm the compiler proves instead of asserting.
12
+ *
13
+ * Internal to the package: `index.ts` does not re-export this module, so the builder is not part
14
+ * of the published surface.
15
+ */
16
+ export interface InputBase {
17
+ readonly values: Readonly<Record<string, unknown>>;
18
+ readonly context?: Readonly<Record<string, unknown>>;
19
+ readonly redacted?: readonly FieldRef[];
20
+ readonly sessionWrites?: readonly FieldRef[];
21
+ }
22
+ /** The one access source a caller read, or none. */
23
+ export type ParsedAccess = {
24
+ readonly kind: 'overlay';
25
+ readonly overlay: AccessOverlay;
26
+ } | {
27
+ readonly kind: 'access';
28
+ readonly access: readonly AccessEntry[];
29
+ } | {
30
+ readonly kind: 'none';
31
+ };
32
+ /**
33
+ * The tag for a pair a caller has already refused or proved exclusive.
34
+ *
35
+ * It states no precedence of its own: the wire readers call `refuseAccessPair` before this, and
36
+ * the engine's working state never holds both. A caller that has not done either must not use it
37
+ * to resolve one answer against the other.
38
+ */
39
+ export declare function parsedAccessOf(overlay: AccessOverlay | undefined, access: readonly AccessEntry[] | undefined): ParsedAccess;
40
+ /** The `EvaluationInput` for one record and its one access source. */
41
+ export declare function evaluationInputOf(base: InputBase, source: ParsedAccess): EvaluationInput;
42
+ //# sourceMappingURL=input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/model/input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACnD,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACrD,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;IACxC,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;CAC9C;AAED,oDAAoD;AACpD,MAAM,MAAM,YAAY,GACpB;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAA;CAAE,GAC7D;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,CAAA;CAAE,GACpE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9B;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,aAAa,GAAG,SAAS,EAClC,MAAM,EAAE,SAAS,WAAW,EAAE,GAAG,SAAS,GACzC,YAAY,CAId;AAED,sEAAsE;AACtE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,eAAe,CASxF"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The tag for a pair a caller has already refused or proved exclusive.
3
+ *
4
+ * It states no precedence of its own: the wire readers call `refuseAccessPair` before this, and
5
+ * the engine's working state never holds both. A caller that has not done either must not use it
6
+ * to resolve one answer against the other.
7
+ */
8
+ export function parsedAccessOf(overlay, access) {
9
+ if (overlay !== undefined)
10
+ return { kind: 'overlay', overlay };
11
+ if (access !== undefined)
12
+ return { kind: 'access', access };
13
+ return { kind: 'none' };
14
+ }
15
+ /** The `EvaluationInput` for one record and its one access source. */
16
+ export function evaluationInputOf(base, source) {
17
+ switch (source.kind) {
18
+ case 'overlay':
19
+ return { ...base, overlay: source.overlay };
20
+ case 'access':
21
+ return { ...base, access: source.access };
22
+ case 'none':
23
+ return { ...base };
24
+ }
25
+ }
26
+ //# sourceMappingURL=input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/model/input.ts"],"names":[],"mappings":"AA6BA;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAkC,EAClC,MAA0C;IAE1C,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;IAC/D,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1B,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,iBAAiB,CAAC,IAAe,EAAE,MAAoB;IACrE,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,SAAS;YACZ,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;QAC9C,KAAK,QAAQ;YACX,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;QAC5C,KAAK,MAAM;YACT,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC;IACvB,CAAC;AACH,CAAC","sourcesContent":["import type { AccessEntry, AccessOverlay, EvaluationInput } from './access.js';\nimport type { FieldRef } from './types.js';\n\n/**\n * Building an `EvaluationInput` from its parsed parts.\n *\n * The input's access answer is a union (`AccessSource` in `access.ts`), so an object literal that\n * spreads an optional `overlay` and an optional `access` cannot be assigned to it: each arm\n * states the other member as `?: undefined`, and a spread carries `AccessOverlay | undefined`\n * where that arm requires absence. This builder is the one place the union is assembled — from\n * the record members and a tag naming the access source that was read — so the wire readers and\n * the engine's sessions each construct one arm the compiler proves instead of asserting.\n *\n * Internal to the package: `index.ts` does not re-export this module, so the builder is not part\n * of the published surface.\n */\nexport interface InputBase {\n readonly values: Readonly<Record<string, unknown>>;\n readonly context?: Readonly<Record<string, unknown>>;\n readonly redacted?: readonly FieldRef[];\n readonly sessionWrites?: readonly FieldRef[];\n}\n\n/** The one access source a caller read, or none. */\nexport type ParsedAccess =\n | { readonly kind: 'overlay'; readonly overlay: AccessOverlay }\n | { readonly kind: 'access'; readonly access: readonly AccessEntry[] }\n | { readonly kind: 'none' };\n\n/**\n * The tag for a pair a caller has already refused or proved exclusive.\n *\n * It states no precedence of its own: the wire readers call `refuseAccessPair` before this, and\n * the engine's working state never holds both. A caller that has not done either must not use it\n * to resolve one answer against the other.\n */\nexport function parsedAccessOf(\n overlay: AccessOverlay | undefined,\n access: readonly AccessEntry[] | undefined,\n): ParsedAccess {\n if (overlay !== undefined) return { kind: 'overlay', overlay };\n if (access !== undefined) return { kind: 'access', access };\n return { kind: 'none' };\n}\n\n/** The `EvaluationInput` for one record and its one access source. */\nexport function evaluationInputOf(base: InputBase, source: ParsedAccess): EvaluationInput {\n switch (source.kind) {\n case 'overlay':\n return { ...base, overlay: source.overlay };\n case 'access':\n return { ...base, access: source.access };\n case 'none':\n return { ...base };\n }\n}\n"]}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The one definition of a canonical integer.
3
+ *
4
+ * A JSON integer is safe and never `-0`: `-0` is the integer zero with a spelling the canonical
5
+ * profile refuses, so a value that carries it cannot be hashed reproducibly. Every reader that
6
+ * means "a canonical integer" asks this function rather than re-spelling
7
+ * `Number.isSafeInteger(x) && !Object.is(x, -0)`; a copy that omits the second arm is exactly the
8
+ * defect class that let `-0` through the wire and into a report.
9
+ *
10
+ * This module imports nothing, so a leaf reader (`expr/decimal.ts`) and `model/values.ts` can
11
+ * both reach it without a cycle.
12
+ */
13
+ export declare function isSafeInteger(value: number): boolean;
14
+ //# sourceMappingURL=integer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integer.d.ts","sourceRoot":"","sources":["../../src/model/integer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEpD"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The one definition of a canonical integer.
3
+ *
4
+ * A JSON integer is safe and never `-0`: `-0` is the integer zero with a spelling the canonical
5
+ * profile refuses, so a value that carries it cannot be hashed reproducibly. Every reader that
6
+ * means "a canonical integer" asks this function rather than re-spelling
7
+ * `Number.isSafeInteger(x) && !Object.is(x, -0)`; a copy that omits the second arm is exactly the
8
+ * defect class that let `-0` through the wire and into a report.
9
+ *
10
+ * This module imports nothing, so a leaf reader (`expr/decimal.ts`) and `model/values.ts` can
11
+ * both reach it without a cycle.
12
+ */
13
+ export function isSafeInteger(value) {
14
+ return Number.isSafeInteger(value) && !Object.is(value, -0);
15
+ }
16
+ //# sourceMappingURL=integer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integer.js","sourceRoot":"","sources":["../../src/model/integer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,OAAO,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["/**\n * The one definition of a canonical integer.\n *\n * A JSON integer is safe and never `-0`: `-0` is the integer zero with a spelling the canonical\n * profile refuses, so a value that carries it cannot be hashed reproducibly. Every reader that\n * means \"a canonical integer\" asks this function rather than re-spelling\n * `Number.isSafeInteger(x) && !Object.is(x, -0)`; a copy that omits the second arm is exactly the\n * defect class that let `-0` through the wire and into a report.\n *\n * This module imports nothing, so a leaf reader (`expr/decimal.ts`) and `model/values.ts` can\n * both reach it without a cycle.\n */\nexport function isSafeInteger(value: number): boolean {\n return Number.isSafeInteger(value) && !Object.is(value, -0);\n}\n"]}
@@ -0,0 +1,18 @@
1
+ import type { IntrinsicPrimitive } from './members.generated.js';
2
+ import type { CompiledField } from './types.js';
3
+ /**
4
+ * The members of the primitives whose value is a closed record, `spec/semantics/model-v1.md`
5
+ * section 2.
6
+ *
7
+ * `money`, `media_ref`, `signature_ref` and `timeslot` are scalar primitives, not declared
8
+ * records: their members are part of the language, so `f_fee.currency` is a member read on a
9
+ * value rather than a path into the record. The registry is generated from the published metaschema
10
+ * (`tools/sync-metaschema.ts`), so the static checker and the wire reader agree about which
11
+ * members exist and what domain each has, and a primitive added to the source reaches both
12
+ * without a hand-written third copy.
13
+ */
14
+ /** Whether a primitive's values have intrinsic members. */
15
+ export declare function isIntrinsicPrimitive(primitive: string): primitive is IntrinsicPrimitive;
16
+ /** The declared members of an intrinsic value, or `undefined` for any other primitive. */
17
+ export declare function intrinsicMembers(primitive: string): readonly CompiledField[] | undefined;
18
+ //# sourceMappingURL=intrinsic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intrinsic.d.ts","sourceRoot":"","sources":["../../src/model/intrinsic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;;;;;;GAUG;AAEH,2DAA2D;AAC3D,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,IAAI,kBAAkB,CAEvF;AAED,0FAA0F;AAC1F,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,aAAa,EAAE,GAAG,SAAS,CAExF"}
@@ -0,0 +1,21 @@
1
+ import { INTRINSIC_MEMBERS } from './members.generated.js';
2
+ /**
3
+ * The members of the primitives whose value is a closed record, `spec/semantics/model-v1.md`
4
+ * section 2.
5
+ *
6
+ * `money`, `media_ref`, `signature_ref` and `timeslot` are scalar primitives, not declared
7
+ * records: their members are part of the language, so `f_fee.currency` is a member read on a
8
+ * value rather than a path into the record. The registry is generated from the published metaschema
9
+ * (`tools/sync-metaschema.ts`), so the static checker and the wire reader agree about which
10
+ * members exist and what domain each has, and a primitive added to the source reaches both
11
+ * without a hand-written third copy.
12
+ */
13
+ /** Whether a primitive's values have intrinsic members. */
14
+ export function isIntrinsicPrimitive(primitive) {
15
+ return Object.hasOwn(INTRINSIC_MEMBERS, primitive);
16
+ }
17
+ /** The declared members of an intrinsic value, or `undefined` for any other primitive. */
18
+ export function intrinsicMembers(primitive) {
19
+ return isIntrinsicPrimitive(primitive) ? INTRINSIC_MEMBERS[primitive] : undefined;
20
+ }
21
+ //# sourceMappingURL=intrinsic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intrinsic.js","sourceRoot":"","sources":["../../src/model/intrinsic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAI3D;;;;;;;;;;GAUG;AAEH,2DAA2D;AAC3D,MAAM,UAAU,oBAAoB,CAAC,SAAiB;IACpD,OAAO,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;AACrD,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,gBAAgB,CAAC,SAAiB;IAChD,OAAO,oBAAoB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACpF,CAAC","sourcesContent":["import { INTRINSIC_MEMBERS } from './members.generated.js';\nimport type { IntrinsicPrimitive } from './members.generated.js';\nimport type { CompiledField } from './types.js';\n\n/**\n * The members of the primitives whose value is a closed record, `spec/semantics/model-v1.md`\n * section 2.\n *\n * `money`, `media_ref`, `signature_ref` and `timeslot` are scalar primitives, not declared\n * records: their members are part of the language, so `f_fee.currency` is a member read on a\n * value rather than a path into the record. The registry is generated from the published metaschema\n * (`tools/sync-metaschema.ts`), so the static checker and the wire reader agree about which\n * members exist and what domain each has, and a primitive added to the source reaches both\n * without a hand-written third copy.\n */\n\n/** Whether a primitive's values have intrinsic members. */\nexport function isIntrinsicPrimitive(primitive: string): primitive is IntrinsicPrimitive {\n return Object.hasOwn(INTRINSIC_MEMBERS, primitive);\n}\n\n/** The declared members of an intrinsic value, or `undefined` for any other primitive. */\nexport function intrinsicMembers(primitive: string): readonly CompiledField[] | undefined {\n return isIntrinsicPrimitive(primitive) ? INTRINSIC_MEMBERS[primitive] : undefined;\n}\n"]}
@@ -0,0 +1,129 @@
1
+ import type { ExprNode } from './types.js';
2
+ /**
3
+ * The closed layout grammar, `spec/semantics/model-v1.md` section 3.
4
+ *
5
+ * Layout is presentation only: it never appears in `values`, never takes part in evaluation
6
+ * and never affects `behaviorHash` or `reportHash`. The compiler is its only producer and
7
+ * the checks that keep it away from data (C11) run there, so a node an artifact carries is
8
+ * one it has already admitted.
9
+ *
10
+ * The nodes are a discriminated union tagged by `kind`, so a renderer that walks the tree
11
+ * exhausts the grammar at typecheck time. `visibleWhen`, `params` and `readouts` carry
12
+ * compiled expressions; they are evaluated only in the runtime's presentation-only channel.
13
+ */
14
+ /** The emphasis a callout states, `MODEL-3.1.1`. */
15
+ export type LayoutTone = 'info' | 'warning' | 'danger' | 'success';
16
+ /** One read-only value a summary card shows beside its label. */
17
+ export interface LayoutReadout {
18
+ /** The message key naming the readout, resolved through the artifact's catalogue. */
19
+ readonly labelKey: string;
20
+ /** The compiled expression the presentation channel evaluates for the value. */
21
+ readonly value: ExprNode;
22
+ }
23
+ /**
24
+ * A top-level or nested section. It places a review step's content and may be collapsed;
25
+ * it never gates access (`annotations.sectionId` owns access, `ACCESS-2.1.4`).
26
+ *
27
+ * A `visibleWhen` decides whether the section is painted. It is presentation-only, so the
28
+ * condition never changes a value or its submission policy; but a hidden section's fields are
29
+ * not on the screen, so the derived readiness ignores their blockers exactly as it ignores a
30
+ * hidden field's.
31
+ */
32
+ export interface LayoutSection {
33
+ readonly kind: 'section';
34
+ readonly sectionId?: string;
35
+ readonly titleKey: string;
36
+ readonly descriptionKey?: string;
37
+ /** The column count the section lays its children out in, `1..4`. */
38
+ readonly columns: number;
39
+ readonly collapsible?: boolean;
40
+ readonly defaultExpanded?: boolean;
41
+ readonly hideWhenEmpty?: boolean;
42
+ readonly visibleWhen?: ExprNode;
43
+ /** A section holds chrome and fields, never a `wizard` or a `step`. */
44
+ readonly children: readonly LayoutNode[];
45
+ }
46
+ /** A titled field grouping inside a section or a step, with the same column contract. */
47
+ export interface LayoutGroup {
48
+ readonly kind: 'group';
49
+ readonly titleKey?: string;
50
+ readonly descriptionKey?: string;
51
+ readonly columns: number;
52
+ readonly collapsible?: boolean;
53
+ readonly defaultExpanded?: boolean;
54
+ readonly hideWhenEmpty?: boolean;
55
+ readonly children: readonly LayoutNode[];
56
+ }
57
+ /** A branching flow. At most one is declared, at the top level, and it holds only steps. */
58
+ export interface LayoutWizard {
59
+ readonly kind: 'wizard';
60
+ readonly children: readonly LayoutStep[];
61
+ }
62
+ /**
63
+ * One page of a wizard. A step that carries a `gateId` or places an interactive field is data,
64
+ * so C11 forbids a `visibleWhen` on it; only an instruction-only step is chrome the author may
65
+ * hide conditionally.
66
+ */
67
+ export interface LayoutStep {
68
+ readonly kind: 'step';
69
+ readonly stepId: string;
70
+ readonly titleKey: string;
71
+ readonly descriptionKey?: string;
72
+ readonly sectionId?: string;
73
+ /** The gate rule this step is judged by, when one applies. */
74
+ readonly gateId?: string;
75
+ readonly hideWhenEmpty?: boolean;
76
+ readonly columns: number;
77
+ readonly visibleWhen?: ExprNode;
78
+ readonly children: readonly LayoutNode[];
79
+ }
80
+ /** One interactive field's placement. A field appears at most once across the layout. */
81
+ export interface LayoutField {
82
+ readonly kind: 'field';
83
+ readonly fieldId: string;
84
+ /** How many of its parent's columns the field spans, `1..parent.columns`. */
85
+ readonly colSpan: number;
86
+ }
87
+ /** A decorative title. A heading is a leaf and names no section anchor. */
88
+ export interface LayoutHeading {
89
+ readonly kind: 'heading';
90
+ readonly titleKey: string;
91
+ readonly textKey?: string;
92
+ }
93
+ /** Presentation-only emphasis with an optional title and a body message. */
94
+ export interface LayoutCallout {
95
+ readonly kind: 'callout';
96
+ readonly tone: LayoutTone;
97
+ readonly titleKey?: string;
98
+ readonly textKey: string;
99
+ readonly params?: Readonly<Record<string, ExprNode>>;
100
+ readonly visibleWhen?: ExprNode;
101
+ }
102
+ /** A horizontal rule. */
103
+ export interface LayoutDivider {
104
+ readonly kind: 'divider';
105
+ }
106
+ /** Standard operating procedure text rendered as chrome. */
107
+ export interface LayoutSopBlock {
108
+ readonly kind: 'sop_block';
109
+ readonly sectionId?: string;
110
+ readonly titleKey: string;
111
+ readonly textKey?: string;
112
+ readonly params?: Readonly<Record<string, ExprNode>>;
113
+ readonly visibleWhen?: ExprNode;
114
+ }
115
+ /** A read-only summary of placed fields and computed readouts. */
116
+ export interface LayoutSummaryCard {
117
+ readonly kind: 'summary_card';
118
+ readonly sectionId?: string;
119
+ readonly titleKey: string;
120
+ readonly textKey?: string;
121
+ readonly params?: Readonly<Record<string, ExprNode>>;
122
+ readonly readouts?: readonly LayoutReadout[];
123
+ /** The declared fields the card lists read-only; it places no control. */
124
+ readonly fields?: readonly string[];
125
+ readonly visibleWhen?: ExprNode;
126
+ }
127
+ /** One node of the closed ten-kind layout grammar, `MODEL-3.1.1`. */
128
+ export type LayoutNode = LayoutSection | LayoutGroup | LayoutWizard | LayoutStep | LayoutField | LayoutHeading | LayoutCallout | LayoutDivider | LayoutSopBlock | LayoutSummaryCard;
129
+ //# sourceMappingURL=layout.d.ts.map