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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +1207 -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,358 @@
1
+ import { compareCodePoints } from '../expr/strings.js';
2
+ import { AxiomError, assertNever } from '../model/errors.js';
3
+ import { childNodes } from '../model/expr-children.js';
4
+ import { DATASET_BUILTINS } from '../model/types.js';
5
+ import { isContextRootPath } from '../eval/reader.js';
6
+ import { schemaIndex } from './record-index.js';
7
+ /** The implicit binders of an enclosing comprehension or item scope. */
8
+ const IMPLICIT_BINDERS = ['$it', '$prev', '$next'];
9
+ /**
10
+ * The declared path a comprehension source iterates, so a member read through its binder is
11
+ * reported as a read of the array the source names. `undefined` where no declaration backs
12
+ * it: a computed list, a context root, or a source that is itself an index.
13
+ */
14
+ function sourceOrigin(node, binders, index) {
15
+ if (node.kind !== 'path')
16
+ return undefined;
17
+ const segments = node.path.split('.');
18
+ const head = segments[0] ?? '';
19
+ if (head.startsWith('$') || binders.has(head)) {
20
+ const origin = binders.get(head);
21
+ if (origin === undefined)
22
+ return undefined;
23
+ const rest = segments.slice(1);
24
+ return rest.length === 0 ? origin : `${origin}.${rest.join('.')}`;
25
+ }
26
+ if (isContextRootPath(node.path, index))
27
+ return undefined;
28
+ return node.path;
29
+ }
30
+ /**
31
+ * Every record field and context root a set of expressions reads, in sorted order.
32
+ *
33
+ * A nested read traverses every container on the way to the member it lands on, and all of them
34
+ * are fields it read: reporting only the outermost would hide the member a `write_only`
35
+ * projection refused, and reporting only the outermost and the innermost would hide a refused
36
+ * container in between. A path read through a comprehension binder is reported against the
37
+ * array the binder iterates, including the binder's own member segments. A `context.` prefix is
38
+ * a root only where the reader resolves one — a declared record field of that name is a field
39
+ * the rule read.
40
+ *
41
+ * This is the one read walk. A compiled artifact reports a rule's dependencies through it, and
42
+ * an authoring tool asks it what a rule would read in a draft that has not compiled, so the two
43
+ * answers cannot disagree about which declaration a path names or which reads are row-scoped.
44
+ */
45
+ export function collectReadRefs(nodes, index, itemFieldId) {
46
+ const refs = new Map();
47
+ const contextRefs = new Set();
48
+ const addSegments = (path, rowScoped) => {
49
+ for (const segment of path.split('.')) {
50
+ if (segment === '')
51
+ continue;
52
+ refs.set(`${rowScoped ? 'row:' : 'field:'}${segment}`, { fieldId: segment, rowScoped });
53
+ }
54
+ };
55
+ const visitPath = (path, binders, itemRowInScope) => {
56
+ const segments = path.split('.');
57
+ const head = segments[0] ?? '';
58
+ const rest = segments.slice(1);
59
+ if (binders.has(head)) {
60
+ const origin = binders.get(head);
61
+ if (origin === undefined) {
62
+ // The binder iterates a list no declaration backs (a computed source), so which field
63
+ // the elements came from is unknown — but the member the expression read still names
64
+ // one, and requires every path read to be reported.
65
+ addSegments(rest.join('.'), false);
66
+ return;
67
+ }
68
+ // The iterated array is a read of the whole container, never of one row's member, so only
69
+ // the binder's own segments carry the row a row-scoped read belongs to. A neighbour binder
70
+ // (`$prev`/`$next`) reads another row's member, and that row's key is not knowable
71
+ // statically, so the read is reported unkeyed rather than against the wrong row.
72
+ addSegments(origin, false);
73
+ const rowScoped = itemRowInScope && head === '$it' && origin === itemFieldId;
74
+ if (rest.length === 0) {
75
+ // A bare row binder reads every member the row carries, including computed members.
76
+ // Expanding the declaration is what makes a bare `$it` a writer's self-read and a
77
+ // transitive read of every other computed member, rather than only a container read.
78
+ const prefix = `${origin}.`;
79
+ for (const declaredPath of index.fieldsByPath.keys()) {
80
+ if (declaredPath.startsWith(prefix))
81
+ addSegments(declaredPath.slice(prefix.length), rowScoped);
82
+ }
83
+ }
84
+ addSegments(rest.join('.'), rowScoped);
85
+ return;
86
+ }
87
+ if (head.startsWith('$'))
88
+ return;
89
+ if (isContextRootPath(path, index)) {
90
+ // A context read is not a record-field read, but it is still a dependency: a session
91
+ // that changes this root must recompute the rules that read it. Dropping the path here
92
+ // would leave the reactive closure blind to `setContext`.
93
+ contextRefs.add(path);
94
+ return;
95
+ }
96
+ addSegments(path, false);
97
+ };
98
+ const visit = (node, binders, itemRowInScope) => {
99
+ if (typeof node !== 'object' || node === null) {
100
+ throw new AxiomError('ENGINE_ERROR', 'expression node is not an object');
101
+ }
102
+ switch (node.kind) {
103
+ case 'path':
104
+ visitPath(node.path, binders, itemRowInScope);
105
+ return;
106
+ case 'literal':
107
+ return;
108
+ case 'list':
109
+ for (const item of node.items)
110
+ visit(item, binders, itemRowInScope);
111
+ return;
112
+ case 'comprehension': {
113
+ visit(node.source, binders, itemRowInScope);
114
+ const origin = sourceOrigin(node.source, binders, index);
115
+ const inner = new Map(binders);
116
+ for (const name of [node.binder.name, ...IMPLICIT_BINDERS])
117
+ inner.set(name, origin);
118
+ inner.set('$i', undefined);
119
+ // A comprehension's binders address its own current element, never the enclosing
120
+ // item rule's row, including when both iterate the same declared array.
121
+ if (node.valueExpr !== undefined)
122
+ visit(node.valueExpr, inner, false);
123
+ if (node.predicate !== undefined)
124
+ visit(node.predicate, inner, false);
125
+ return;
126
+ }
127
+ case 'call': {
128
+ if (!isExpressionList(node.args)) {
129
+ throw new AxiomError('ENGINE_ERROR', 'expression node has no argument list');
130
+ }
131
+ // A dataset built-in's first argument names a table, not a field,
132
+ // so it is not a read the rule performed and must not appear in its `fields`.
133
+ const start = DATASET_BUILTINS.has(node.op) ? 1 : 0;
134
+ for (const arg of node.args.slice(start))
135
+ visit(arg, binders, itemRowInScope);
136
+ return;
137
+ }
138
+ default:
139
+ if (!isExpressionList(node.args)) {
140
+ throw new AxiomError('ENGINE_ERROR', 'expression node has no argument list');
141
+ }
142
+ for (const arg of node.args)
143
+ visit(arg, binders, itemRowInScope);
144
+ }
145
+ };
146
+ const initial = new Map();
147
+ if (itemFieldId !== undefined) {
148
+ for (const name of IMPLICIT_BINDERS)
149
+ initial.set(name, itemFieldId);
150
+ initial.set('$i', undefined);
151
+ }
152
+ for (const node of nodes)
153
+ visit(node, initial, itemFieldId !== undefined);
154
+ return {
155
+ reads: [...refs.values()].sort((a, b) => compareCodePoints(a.fieldId, b.fieldId) ||
156
+ (a.rowScoped === b.rowScoped ? 0 : a.rowScoped ? -1 : 1)),
157
+ contextReads: [...contextRefs].sort(compareCodePoints),
158
+ };
159
+ }
160
+ function isExpressionList(value) {
161
+ return Array.isArray(value);
162
+ }
163
+ /** Every expression slot one rule carries, in the order the artifact declares them. */
164
+ export function ruleExpressionSlots(rule) {
165
+ const base = `$.rules.${rule.ruleId}`;
166
+ const slots = [{ node: rule.expr, path: `${base}.expr` }];
167
+ if (rule.referWhen !== undefined) {
168
+ slots.push({ node: rule.referWhen, path: `${base}.referWhen` });
169
+ }
170
+ for (const [name, node] of Object.entries(rule.params ?? {})) {
171
+ slots.push({ node, path: `${base}.params.${name}` });
172
+ }
173
+ for (const [index, reason] of (rule.kind === 'screen' ? (rule.reasons ?? []) : []).entries()) {
174
+ slots.push({ node: reason.when, path: `${base}.reasons[${String(index)}].when` });
175
+ for (const [name, node] of Object.entries(reason.params ?? {})) {
176
+ slots.push({ node, path: `${base}.reasons[${String(index)}].params.${name}` });
177
+ }
178
+ }
179
+ if (rule.gate?.activeWhen !== undefined) {
180
+ slots.push({ node: rule.gate.activeWhen, path: `${base}.gate.activeWhen` });
181
+ }
182
+ for (const [index, item] of (rule.gate?.items ?? []).entries()) {
183
+ slots.push({ node: item.expr, path: `${base}.gate.items[${String(index)}].expr` });
184
+ for (const [name, node] of Object.entries(item.params ?? {})) {
185
+ slots.push({
186
+ node,
187
+ path: `${base}.gate.items[${String(index)}].params.${name}`,
188
+ });
189
+ }
190
+ }
191
+ // An alternative is a change set a host may apply, and its expressions read the record exactly
192
+ // as the rule's own slots do: a value expression may reach a dataset table, and the compiled
193
+ // operation is data the artifact carries.
194
+ slots.push(...suggestionExpressionSlots(rule.suggests, `${base}.suggests`));
195
+ return slots;
196
+ }
197
+ /**
198
+ * Every expression slot one list of alternatives carries, `RULES-6.1.2`.
199
+ *
200
+ * Only `value` and an `append` template state an expression; `null`, `remove` and a row key are
201
+ * values. A rule's alternatives and a declared option's are the same shape, so one walk answers
202
+ * both and a new operation kind reaches both through the `assertNever` arm.
203
+ */
204
+ function suggestionExpressionSlots(suggestions, at) {
205
+ const slots = [];
206
+ for (const [index, suggestion] of (suggestions ?? []).entries()) {
207
+ for (const [operationIndex, operation] of suggestion.operations.entries()) {
208
+ const operationAt = `${at}[${String(index)}].operations[${String(operationIndex)}]`;
209
+ switch (operation.kind) {
210
+ case 'value':
211
+ slots.push({ node: operation.value, path: `${operationAt}.value` });
212
+ break;
213
+ case 'append':
214
+ for (const [name, node] of Object.entries(operation.row)) {
215
+ slots.push({ node, path: `${operationAt}.row.${name}` });
216
+ }
217
+ break;
218
+ case 'null':
219
+ case 'remove':
220
+ case 'removeRow':
221
+ break;
222
+ default:
223
+ assertNever(operation);
224
+ }
225
+ }
226
+ }
227
+ return slots;
228
+ }
229
+ /**
230
+ * Every expression one declared field carries: its `rowsFrom` count and every declared option's
231
+ * availability condition, reason arguments and alternatives.
232
+ *
233
+ * These are the expressions the device evaluates outside a rule, so they are the field's own
234
+ * slots for the same reasons a rule's are: a dataset table they name is a table the artifact must
235
+ * pin, and a table it never declares is a read the submission door refuses. Enumerating them here
236
+ * keeps that list from being re-derived wherever a field's reachability is asked for.
237
+ */
238
+ function fieldExpressionSlots(field) {
239
+ const base = `$.fields.${field.fieldId}`;
240
+ const slots = [];
241
+ const add = (slot) => {
242
+ slots.push({ node: slot.node, path: slot.path, fieldId: field.fieldId });
243
+ };
244
+ if (field.rowsFrom !== undefined)
245
+ add({ node: field.rowsFrom, path: `${base}.rowsFrom` });
246
+ for (const [index, option] of (field.options ?? []).entries()) {
247
+ const at = `${base}.options[${String(index)}]`;
248
+ if (option.availableWhen !== undefined) {
249
+ add({ node: option.availableWhen, path: `${at}.availableWhen` });
250
+ }
251
+ for (const [name, node] of Object.entries(option.unavailableParams ?? {})) {
252
+ add({ node, path: `${at}.unavailableParams.${name}` });
253
+ }
254
+ for (const slot of suggestionExpressionSlots(option.suggests, `${at}.suggests`))
255
+ add(slot);
256
+ }
257
+ return slots;
258
+ }
259
+ /** Every expression slot every declared field carries, at any nesting level. */
260
+ export function declaredFieldExpressions(fields) {
261
+ const slots = [];
262
+ const visit = (members) => {
263
+ for (const member of members) {
264
+ slots.push(...fieldExpressionSlots(member));
265
+ if (member.fields !== undefined)
266
+ visit(member.fields);
267
+ }
268
+ };
269
+ visit(fields);
270
+ return slots;
271
+ }
272
+ /**
273
+ * The record fields and context roots one declared field's own expressions read, keyed by the
274
+ * field that carries them.
275
+ *
276
+ * A field's derived entry depends on these reads: an availability condition decides from the
277
+ * record and context, so a write to either moves what the declaring field states. No rule
278
+ * expression names the edge, so a reactive pass cannot see it in the rule closure and would
279
+ * reuse an entry the inputs have moved.
280
+ */
281
+ export function declaredFieldReads(compiled) {
282
+ const index = schemaIndex(compiled);
283
+ const reads = new Map();
284
+ const visit = (members, itemFieldId) => {
285
+ for (const field of members) {
286
+ const collected = collectReadRefs(fieldExpressionSlots(field).map((slot) => slot.node), index, itemFieldId);
287
+ if (collected.reads.length > 0 || collected.contextReads.length > 0) {
288
+ const read = reads.get(field.fieldId) ?? {
289
+ fields: new Set(),
290
+ contextRoots: new Set(),
291
+ };
292
+ for (const ref of collected.reads)
293
+ read.fields.add(ref.fieldId);
294
+ for (const root of collected.contextReads) {
295
+ read.contextRoots.add(root.replace(/^context\./, ''));
296
+ }
297
+ reads.set(field.fieldId, read);
298
+ }
299
+ visit(field.fields ?? [], field.primitive === 'array' ? field.fieldId : itemFieldId);
300
+ }
301
+ };
302
+ visit(compiled.fields, undefined);
303
+ return new Map([...reads].map(([fieldId, read]) => [
304
+ fieldId,
305
+ {
306
+ fields: [...read.fields].sort(compareCodePoints),
307
+ contextRoots: [...read.contextRoots].sort(compareCodePoints),
308
+ },
309
+ ]));
310
+ }
311
+ /**
312
+ * Every expression slot a rule carries: its own expression, message parameters, a
313
+ * screen's refer condition and declared reasons, every gate item and the condition its
314
+ * gate is switched by — each item's expression and the arguments its message binds — and every
315
+ * expression an alternative's operations carry. A read in any of them is a read the rule
316
+ * performed.
317
+ */
318
+ export function ruleExpressions(rule) {
319
+ return ruleExpressionSlots(rule).map((slot) => slot.node);
320
+ }
321
+ /** The record fields one rule's expressions read. */
322
+ export function ruleReads(compiled, rule) {
323
+ return collectReadRefs(ruleExpressions(rule), schemaIndex(compiled), itemScopeOf(rule)).reads;
324
+ }
325
+ /** The declared context roots one rule's expressions read, in code-point order. */
326
+ export function ruleContextReads(compiled, rule) {
327
+ return collectReadRefs(ruleExpressions(rule), schemaIndex(compiled), itemScopeOf(rule))
328
+ .contextReads;
329
+ }
330
+ /** The record fields one gate item reads, reported per row for an item-scoped gate item. */
331
+ export function gateItemReads(compiled, rule, item) {
332
+ const nodes = [item.expr, ...Object.values(item.params ?? {})];
333
+ return collectReadRefs(nodes, schemaIndex(compiled), itemScopeOf(rule)).reads;
334
+ }
335
+ /** The array an item-scoped rule addresses, or `undefined` for every other scope. */
336
+ function itemScopeOf(rule) {
337
+ return rule.scope === 'item' ? rule.fieldId : undefined;
338
+ }
339
+ /** The rule ids a gate rule names through `rule_ok`: its outcome folds theirs. */
340
+ export function ruleOkTargets(rule) {
341
+ const targets = new Set();
342
+ const visit = (node) => {
343
+ // The walk states only what it looks for; the child list is `childNodes`, so a node kind added
344
+ // to the union reaches this walk without an edit here.
345
+ if (node.kind === 'call' && node.op === 'rule_ok') {
346
+ const [target] = node.args;
347
+ if (target?.kind === 'literal' && typeof target.value === 'string') {
348
+ targets.add(target.value);
349
+ }
350
+ }
351
+ for (const child of childNodes(node))
352
+ visit(child);
353
+ };
354
+ for (const node of ruleExpressions(rule))
355
+ visit(node);
356
+ return [...targets].sort(compareCodePoints);
357
+ }
358
+ //# sourceMappingURL=read-walk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-walk.js","sourceRoot":"","sources":["../../src/graph/read-walk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AASrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAwBhD,wEAAwE;AACxE,MAAM,gBAAgB,GAAsB,CAAC,KAA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AAe,CAAC,IAAI,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["import { compareCodePoints } from '../expr/strings.js';\nimport { AxiomError, assertNever } from '../model/errors.js';\nimport { childNodes } from '../model/expr-children.js';\nimport { DATASET_BUILTINS } from '../model/types.js';\nimport type {\n CompiledField,\n CompiledRule,\n CompiledSuggestion,\n ExprNode,\n GateItemDeclaration,\n} from '../model/types.js';\nimport type { CompiledSchema } from '../model/schema.js';\nimport { isContextRootPath } from '../eval/reader.js';\nimport type { RecordIndex } from '../eval/reader.js';\nimport { schemaIndex } from './record-index.js';\n\n/**\n * What a set of expressions reads.\n *\n * Three consumers need the same answer: a report states the fields a rule read, the compiler\n * refuses a computed cycle before it can reach a device, and a reactive engine needs the\n * recalculation order. Deriving them in one walk keeps those three from disagreeing about what a\n * rule depends on, and lets an authoring tool ask the same question about a draft that has not\n * compiled.\n */\n\n/**\n * One field a rule read, and whether the read happened through the rule's own item scope.\n * A row-scoped read names a row its result carries; a container-level one does not.\n */\nexport interface ReadRef {\n readonly fieldId: string;\n readonly rowScoped: boolean;\n}\n\n/** The binder names in force, mapped to the declared path each one iterates. */\ntype BinderOrigins = ReadonlyMap<string, string | undefined>;\n\n/** The implicit binders of an enclosing comprehension or item scope. */\nconst IMPLICIT_BINDERS: readonly string[] = ['$it', '$prev', '$next'];\n\n/**\n * The declared path a comprehension source iterates, so a member read through its binder is\n * reported as a read of the array the source names. `undefined` where no declaration backs\n * it: a computed list, a context root, or a source that is itself an index.\n */\nfunction sourceOrigin(\n node: ExprNode,\n binders: BinderOrigins,\n index: RecordIndex,\n): string | undefined {\n if (node.kind !== 'path') return undefined;\n const segments = node.path.split('.');\n const head = segments[0] ?? '';\n if (head.startsWith('$') || binders.has(head)) {\n const origin = binders.get(head);\n if (origin === undefined) return undefined;\n const rest = segments.slice(1);\n return rest.length === 0 ? origin : `${origin}.${rest.join('.')}`;\n }\n if (isContextRootPath(node.path, index)) return undefined;\n return node.path;\n}\n\n/** The record fields and context roots one set of expressions reads. */\nexport interface CollectedReads {\n readonly reads: readonly ReadRef[];\n readonly contextReads: readonly string[];\n}\n\n/**\n * Every record field and context root a set of expressions reads, in sorted order.\n *\n * A nested read traverses every container on the way to the member it lands on, and all of them\n * are fields it read: reporting only the outermost would hide the member a `write_only`\n * projection refused, and reporting only the outermost and the innermost would hide a refused\n * container in between. A path read through a comprehension binder is reported against the\n * array the binder iterates, including the binder's own member segments. A `context.` prefix is\n * a root only where the reader resolves one — a declared record field of that name is a field\n * the rule read.\n *\n * This is the one read walk. A compiled artifact reports a rule's dependencies through it, and\n * an authoring tool asks it what a rule would read in a draft that has not compiled, so the two\n * answers cannot disagree about which declaration a path names or which reads are row-scoped.\n */\nexport function collectReadRefs(\n nodes: readonly ExprNode[],\n index: RecordIndex,\n itemFieldId: string | undefined,\n): CollectedReads {\n const refs = new Map<string, ReadRef>();\n const contextRefs = new Set<string>();\n const addSegments = (path: string, rowScoped: boolean): void => {\n for (const segment of path.split('.')) {\n if (segment === '') continue;\n refs.set(`${rowScoped ? 'row:' : 'field:'}${segment}`, { fieldId: segment, rowScoped });\n }\n };\n const visitPath = (path: string, binders: BinderOrigins, itemRowInScope: boolean): void => {\n const segments = path.split('.');\n const head = segments[0] ?? '';\n const rest = segments.slice(1);\n if (binders.has(head)) {\n const origin = binders.get(head);\n if (origin === undefined) {\n // The binder iterates a list no declaration backs (a computed source), so which field\n // the elements came from is unknown — but the member the expression read still names\n // one, and requires every path read to be reported.\n addSegments(rest.join('.'), false);\n return;\n }\n // The iterated array is a read of the whole container, never of one row's member, so only\n // the binder's own segments carry the row a row-scoped read belongs to. A neighbour binder\n // (`$prev`/`$next`) reads another row's member, and that row's key is not knowable\n // statically, so the read is reported unkeyed rather than against the wrong row.\n addSegments(origin, false);\n const rowScoped = itemRowInScope && head === '$it' && origin === itemFieldId;\n if (rest.length === 0) {\n // A bare row binder reads every member the row carries, including computed members.\n // Expanding the declaration is what makes a bare `$it` a writer's self-read and a\n // transitive read of every other computed member, rather than only a container read.\n const prefix = `${origin}.`;\n for (const declaredPath of index.fieldsByPath.keys()) {\n if (declaredPath.startsWith(prefix))\n addSegments(declaredPath.slice(prefix.length), rowScoped);\n }\n }\n addSegments(rest.join('.'), rowScoped);\n return;\n }\n if (head.startsWith('$')) return;\n if (isContextRootPath(path, index)) {\n // A context read is not a record-field read, but it is still a dependency: a session\n // that changes this root must recompute the rules that read it. Dropping the path here\n // would leave the reactive closure blind to `setContext`.\n contextRefs.add(path);\n return;\n }\n addSegments(path, false);\n };\n const visit = (node: ExprNode, binders: BinderOrigins, itemRowInScope: boolean): void => {\n if (typeof node !== 'object' || node === null) {\n throw new AxiomError('ENGINE_ERROR', 'expression node is not an object');\n }\n switch (node.kind) {\n case 'path':\n visitPath(node.path, binders, itemRowInScope);\n return;\n case 'literal':\n return;\n case 'list':\n for (const item of node.items) visit(item, binders, itemRowInScope);\n return;\n case 'comprehension': {\n visit(node.source, binders, itemRowInScope);\n const origin = sourceOrigin(node.source, binders, index);\n const inner = new Map(binders);\n for (const name of [node.binder.name, ...IMPLICIT_BINDERS]) inner.set(name, origin);\n inner.set('$i', undefined);\n // A comprehension's binders address its own current element, never the enclosing\n // item rule's row, including when both iterate the same declared array.\n if (node.valueExpr !== undefined) visit(node.valueExpr, inner, false);\n if (node.predicate !== undefined) visit(node.predicate, inner, false);\n return;\n }\n case 'call': {\n if (!isExpressionList(node.args)) {\n throw new AxiomError('ENGINE_ERROR', 'expression node has no argument list');\n }\n // A dataset built-in's first argument names a table, not a field,\n // so it is not a read the rule performed and must not appear in its `fields`.\n const start = DATASET_BUILTINS.has(node.op) ? 1 : 0;\n for (const arg of node.args.slice(start)) visit(arg, binders, itemRowInScope);\n return;\n }\n default:\n if (!isExpressionList(node.args)) {\n throw new AxiomError('ENGINE_ERROR', 'expression node has no argument list');\n }\n for (const arg of node.args) visit(arg, binders, itemRowInScope);\n }\n };\n const initial: Map<string, string | undefined> = new Map();\n if (itemFieldId !== undefined) {\n for (const name of IMPLICIT_BINDERS) initial.set(name, itemFieldId);\n initial.set('$i', undefined);\n }\n for (const node of nodes) visit(node, initial, itemFieldId !== undefined);\n return {\n reads: [...refs.values()].sort(\n (a, b) =>\n compareCodePoints(a.fieldId, b.fieldId) ||\n (a.rowScoped === b.rowScoped ? 0 : a.rowScoped ? -1 : 1),\n ),\n contextReads: [...contextRefs].sort(compareCodePoints),\n };\n}\n\nfunction isExpressionList(value: unknown): value is readonly ExprNode[] {\n return Array.isArray(value);\n}\n\n/**\n * Every expression slot a rule carries, with the artifact path it lives at.\n *\n * This is the one walk: `ruleExpressions` derives the nodes from it, and the submission door's\n * table allow-list reads the same slots with the paths a refusal names. A second hand-written\n * list of slots is how a gate item or a screen reason escaped the walk that the rest of the\n * engine uses, so the slots are enumerated once here and nowhere else.\n */\nexport interface RuleExpressionSlot {\n readonly node: ExprNode;\n /** The artifact path of the slot, e.g. `$.rules.r_gate.gate.items[0].expr`. */\n readonly path: string;\n}\n\n/** Every expression slot one rule carries, in the order the artifact declares them. */\nexport function ruleExpressionSlots(rule: CompiledRule): readonly RuleExpressionSlot[] {\n const base = `$.rules.${rule.ruleId}`;\n const slots: RuleExpressionSlot[] = [{ node: rule.expr, path: `${base}.expr` }];\n if (rule.referWhen !== undefined) {\n slots.push({ node: rule.referWhen, path: `${base}.referWhen` });\n }\n for (const [name, node] of Object.entries(rule.params ?? {})) {\n slots.push({ node, path: `${base}.params.${name}` });\n }\n for (const [index, reason] of (rule.kind === 'screen' ? (rule.reasons ?? []) : []).entries()) {\n slots.push({ node: reason.when, path: `${base}.reasons[${String(index)}].when` });\n for (const [name, node] of Object.entries(reason.params ?? {})) {\n slots.push({ node, path: `${base}.reasons[${String(index)}].params.${name}` });\n }\n }\n if (rule.gate?.activeWhen !== undefined) {\n slots.push({ node: rule.gate.activeWhen, path: `${base}.gate.activeWhen` });\n }\n for (const [index, item] of (rule.gate?.items ?? []).entries()) {\n slots.push({ node: item.expr, path: `${base}.gate.items[${String(index)}].expr` });\n for (const [name, node] of Object.entries(item.params ?? {})) {\n slots.push({\n node,\n path: `${base}.gate.items[${String(index)}].params.${name}`,\n });\n }\n }\n // An alternative is a change set a host may apply, and its expressions read the record exactly\n // as the rule's own slots do: a value expression may reach a dataset table, and the compiled\n // operation is data the artifact carries.\n slots.push(...suggestionExpressionSlots(rule.suggests, `${base}.suggests`));\n return slots;\n}\n\n/**\n * Every expression slot one list of alternatives carries, `RULES-6.1.2`.\n *\n * Only `value` and an `append` template state an expression; `null`, `remove` and a row key are\n * values. A rule's alternatives and a declared option's are the same shape, so one walk answers\n * both and a new operation kind reaches both through the `assertNever` arm.\n */\nfunction suggestionExpressionSlots(\n suggestions: readonly CompiledSuggestion[] | undefined,\n at: string,\n): readonly RuleExpressionSlot[] {\n const slots: RuleExpressionSlot[] = [];\n for (const [index, suggestion] of (suggestions ?? []).entries()) {\n for (const [operationIndex, operation] of suggestion.operations.entries()) {\n const operationAt = `${at}[${String(index)}].operations[${String(operationIndex)}]`;\n switch (operation.kind) {\n case 'value':\n slots.push({ node: operation.value, path: `${operationAt}.value` });\n break;\n case 'append':\n for (const [name, node] of Object.entries(operation.row)) {\n slots.push({ node, path: `${operationAt}.row.${name}` });\n }\n break;\n case 'null':\n case 'remove':\n case 'removeRow':\n break;\n default:\n assertNever(operation);\n }\n }\n }\n return slots;\n}\n\n/**\n * One expression slot a declared field carries, with the artifact path it lives at and the\n * declaration that carries it.\n *\n * `fieldId` is the field a refusal names, which is the declaration holding the slot rather than a\n * read of it: a table a field's condition names belongs to that field's declaration.\n */\ninterface FieldExpressionSlot {\n readonly node: ExprNode;\n readonly path: string;\n readonly fieldId: string;\n}\n\n/**\n * Every expression one declared field carries: its `rowsFrom` count and every declared option's\n * availability condition, reason arguments and alternatives.\n *\n * These are the expressions the device evaluates outside a rule, so they are the field's own\n * slots for the same reasons a rule's are: a dataset table they name is a table the artifact must\n * pin, and a table it never declares is a read the submission door refuses. Enumerating them here\n * keeps that list from being re-derived wherever a field's reachability is asked for.\n */\nfunction fieldExpressionSlots(field: CompiledField): readonly FieldExpressionSlot[] {\n const base = `$.fields.${field.fieldId}`;\n const slots: FieldExpressionSlot[] = [];\n const add = (slot: RuleExpressionSlot): void => {\n slots.push({ node: slot.node, path: slot.path, fieldId: field.fieldId });\n };\n if (field.rowsFrom !== undefined) add({ node: field.rowsFrom, path: `${base}.rowsFrom` });\n for (const [index, option] of (field.options ?? []).entries()) {\n const at = `${base}.options[${String(index)}]`;\n if (option.availableWhen !== undefined) {\n add({ node: option.availableWhen, path: `${at}.availableWhen` });\n }\n for (const [name, node] of Object.entries(option.unavailableParams ?? {})) {\n add({ node, path: `${at}.unavailableParams.${name}` });\n }\n for (const slot of suggestionExpressionSlots(option.suggests, `${at}.suggests`)) add(slot);\n }\n return slots;\n}\n\n/** Every expression slot every declared field carries, at any nesting level. */\nexport function declaredFieldExpressions(\n fields: readonly CompiledField[],\n): readonly FieldExpressionSlot[] {\n const slots: FieldExpressionSlot[] = [];\n const visit = (members: readonly CompiledField[]): void => {\n for (const member of members) {\n slots.push(...fieldExpressionSlots(member));\n if (member.fields !== undefined) visit(member.fields);\n }\n };\n visit(fields);\n return slots;\n}\n\n/**\n * The record fields and context roots one declared field's own expressions read, keyed by the\n * field that carries them.\n *\n * A field's derived entry depends on these reads: an availability condition decides from the\n * record and context, so a write to either moves what the declaring field states. No rule\n * expression names the edge, so a reactive pass cannot see it in the rule closure and would\n * reuse an entry the inputs have moved.\n */\nexport function declaredFieldReads(compiled: CompiledSchema): ReadonlyMap<\n string,\n {\n readonly fields: readonly string[];\n readonly contextRoots: readonly string[];\n }\n> {\n const index = schemaIndex(compiled);\n const reads = new Map<\n string,\n { readonly fields: Set<string>; readonly contextRoots: Set<string> }\n >();\n const visit = (members: readonly CompiledField[], itemFieldId: string | undefined): void => {\n for (const field of members) {\n const collected = collectReadRefs(\n fieldExpressionSlots(field).map((slot) => slot.node),\n index,\n itemFieldId,\n );\n if (collected.reads.length > 0 || collected.contextReads.length > 0) {\n const read = reads.get(field.fieldId) ?? {\n fields: new Set<string>(),\n contextRoots: new Set<string>(),\n };\n for (const ref of collected.reads) read.fields.add(ref.fieldId);\n for (const root of collected.contextReads) {\n read.contextRoots.add(root.replace(/^context\\./, ''));\n }\n reads.set(field.fieldId, read);\n }\n visit(field.fields ?? [], field.primitive === 'array' ? field.fieldId : itemFieldId);\n }\n };\n visit(compiled.fields, undefined);\n return new Map(\n [...reads].map(\n ([fieldId, read]) =>\n [\n fieldId,\n {\n fields: [...read.fields].sort(compareCodePoints),\n contextRoots: [...read.contextRoots].sort(compareCodePoints),\n },\n ] as const,\n ),\n );\n}\n\n/**\n * Every expression slot a rule carries: its own expression, message parameters, a\n * screen's refer condition and declared reasons, every gate item and the condition its\n * gate is switched by — each item's expression and the arguments its message binds — and every\n * expression an alternative's operations carry. A read in any of them is a read the rule\n * performed.\n */\nexport function ruleExpressions(rule: CompiledRule): readonly ExprNode[] {\n return ruleExpressionSlots(rule).map((slot) => slot.node);\n}\n\n/** The record fields one rule's expressions read. */\nexport function ruleReads(compiled: CompiledSchema, rule: CompiledRule): readonly ReadRef[] {\n return collectReadRefs(ruleExpressions(rule), schemaIndex(compiled), itemScopeOf(rule)).reads;\n}\n\n/** The declared context roots one rule's expressions read, in code-point order. */\nexport function ruleContextReads(compiled: CompiledSchema, rule: CompiledRule): readonly string[] {\n return collectReadRefs(ruleExpressions(rule), schemaIndex(compiled), itemScopeOf(rule))\n .contextReads;\n}\n\n/** The record fields one gate item reads, reported per row for an item-scoped gate item. */\nexport function gateItemReads(\n compiled: CompiledSchema,\n rule: CompiledRule,\n item: GateItemDeclaration,\n): readonly ReadRef[] {\n const nodes: ExprNode[] = [item.expr, ...Object.values(item.params ?? {})];\n return collectReadRefs(nodes, schemaIndex(compiled), itemScopeOf(rule)).reads;\n}\n\n/** The array an item-scoped rule addresses, or `undefined` for every other scope. */\nfunction itemScopeOf(rule: CompiledRule): string | undefined {\n return rule.scope === 'item' ? rule.fieldId : undefined;\n}\n\n/** The rule ids a gate rule names through `rule_ok`: its outcome folds theirs. */\nexport function ruleOkTargets(rule: CompiledRule): readonly string[] {\n const targets = new Set<string>();\n const visit = (node: ExprNode): void => {\n // The walk states only what it looks for; the child list is `childNodes`, so a node kind added\n // to the union reaches this walk without an edit here.\n if (node.kind === 'call' && node.op === 'rule_ok') {\n const [target] = node.args;\n if (target?.kind === 'literal' && typeof target.value === 'string') {\n targets.add(target.value);\n }\n }\n for (const child of childNodes(node)) visit(child);\n };\n for (const node of ruleExpressions(rule)) visit(node);\n return [...targets].sort(compareCodePoints);\n}\n"]}
@@ -0,0 +1,24 @@
1
+ import type { RecordIndex } from '../eval/reader.js';
2
+ import type { CompiledField, ContextRoot } from '../model/types.js';
3
+ import type { CompiledSchema } from '../model/schema.js';
4
+ /**
5
+ * The declared shape a set of expressions is read against: the record's fields by path and the
6
+ * context roots they may name.
7
+ *
8
+ * Two consumers need the same index from different inputs. A compiled artifact derives it from
9
+ * its own declarations, and an authoring tool derives it from a draft that may not compile, so
10
+ * the derivation is stated once here and both callers index the declarations they hold. The
11
+ * index is what the reader resolves a path against and what the derived read walk reports a path
12
+ * in, so a projection and an evaluation cannot disagree about which declaration a path names.
13
+ */
14
+ export declare function recordIndexFromDeclarations(fields: readonly CompiledField[], contextRoots: readonly ContextRoot[] | undefined): RecordIndex;
15
+ /**
16
+ * One artifact's index, derived on first use and kept for the artifact's lifetime.
17
+ *
18
+ * Deriving reads and the computed order is input-independent and every rule walk asks for the
19
+ * index again, so one artifact pays for its index once. The cache is keyed by object identity,
20
+ * which is sound only while the object cannot change under it: an artifact is frozen before its
21
+ * first derivation (see `freezeArtifact`), so nothing can.
22
+ */
23
+ export declare function schemaIndex(compiled: CompiledSchema): RecordIndex;
24
+ //# sourceMappingURL=record-index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record-index.d.ts","sourceRoot":"","sources":["../../src/graph/record-index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,YAAY,EAAE,SAAS,WAAW,EAAE,GAAG,SAAS,GAC/C,WAAW,CAKb;AAID;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,cAAc,GAAG,WAAW,CAMjE"}
@@ -0,0 +1,35 @@
1
+ import { indexContextRoots, indexFields } from '../eval/reader.js';
2
+ /**
3
+ * The declared shape a set of expressions is read against: the record's fields by path and the
4
+ * context roots they may name.
5
+ *
6
+ * Two consumers need the same index from different inputs. A compiled artifact derives it from
7
+ * its own declarations, and an authoring tool derives it from a draft that may not compile, so
8
+ * the derivation is stated once here and both callers index the declarations they hold. The
9
+ * index is what the reader resolves a path against and what the derived read walk reports a path
10
+ * in, so a projection and an evaluation cannot disagree about which declaration a path names.
11
+ */
12
+ export function recordIndexFromDeclarations(fields, contextRoots) {
13
+ return {
14
+ fieldsByPath: indexFields(fields),
15
+ contextRoots: indexContextRoots(contextRoots),
16
+ };
17
+ }
18
+ const SCHEMA_INDEXES = new WeakMap();
19
+ /**
20
+ * One artifact's index, derived on first use and kept for the artifact's lifetime.
21
+ *
22
+ * Deriving reads and the computed order is input-independent and every rule walk asks for the
23
+ * index again, so one artifact pays for its index once. The cache is keyed by object identity,
24
+ * which is sound only while the object cannot change under it: an artifact is frozen before its
25
+ * first derivation (see `freezeArtifact`), so nothing can.
26
+ */
27
+ export function schemaIndex(compiled) {
28
+ const cached = SCHEMA_INDEXES.get(compiled);
29
+ if (cached !== undefined)
30
+ return cached;
31
+ const index = recordIndexFromDeclarations(compiled.fields, compiled.context?.roots);
32
+ SCHEMA_INDEXES.set(compiled, index);
33
+ return index;
34
+ }
35
+ //# sourceMappingURL=record-index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record-index.js","sourceRoot":"","sources":["../../src/graph/record-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKnE;;;;;;;;;GASG;AACH,MAAM,UAAU,2BAA2B,CACzC,MAAgC,EAChC,YAAgD;IAEhD,OAAO;QACL,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC;QACjC,YAAY,EAAE,iBAAiB,CAAC,YAAY,CAAC;KAC9C,CAAC;AACJ,CAAC;AAED,MAAM,cAAc,GAAyC,IAAI,OAAO,EAAE,CAAC;AAE3E;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,QAAwB;IAClD,MAAM,MAAM,GAAG,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC5C,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACxC,MAAM,KAAK,GAAG,2BAA2B,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACpF,cAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACpC,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { indexContextRoots, indexFields } from '../eval/reader.js';\nimport type { RecordIndex } from '../eval/reader.js';\nimport type { CompiledField, ContextRoot } from '../model/types.js';\nimport type { CompiledSchema } from '../model/schema.js';\n\n/**\n * The declared shape a set of expressions is read against: the record's fields by path and the\n * context roots they may name.\n *\n * Two consumers need the same index from different inputs. A compiled artifact derives it from\n * its own declarations, and an authoring tool derives it from a draft that may not compile, so\n * the derivation is stated once here and both callers index the declarations they hold. The\n * index is what the reader resolves a path against and what the derived read walk reports a path\n * in, so a projection and an evaluation cannot disagree about which declaration a path names.\n */\nexport function recordIndexFromDeclarations(\n fields: readonly CompiledField[],\n contextRoots: readonly ContextRoot[] | undefined,\n): RecordIndex {\n return {\n fieldsByPath: indexFields(fields),\n contextRoots: indexContextRoots(contextRoots),\n };\n}\n\nconst SCHEMA_INDEXES: WeakMap<CompiledSchema, RecordIndex> = new WeakMap();\n\n/**\n * One artifact's index, derived on first use and kept for the artifact's lifetime.\n *\n * Deriving reads and the computed order is input-independent and every rule walk asks for the\n * index again, so one artifact pays for its index once. The cache is keyed by object identity,\n * which is sound only while the object cannot change under it: an artifact is frozen before its\n * first derivation (see `freezeArtifact`), so nothing can.\n */\nexport function schemaIndex(compiled: CompiledSchema): RecordIndex {\n const cached = SCHEMA_INDEXES.get(compiled);\n if (cached !== undefined) return cached;\n const index = recordIndexFromDeclarations(compiled.fields, compiled.context?.roots);\n SCHEMA_INDEXES.set(compiled, index);\n return index;\n}\n"]}
@@ -0,0 +1,104 @@
1
+ /**
2
+ * `@azx-pbc/axiom-runtime` — the target-neutral core.
3
+ *
4
+ * One package serves Web, Node and React Native's Hermes, so nothing below may *depend on*
5
+ * a locale database, a clock, dynamic code evaluation, a DOM or a Node built-in. `Intl` is
6
+ * not a dependency: plural selection reads the vendored CLDR registry the package carries,
7
+ * never the host's `Intl.PluralRules`, so two hosts on different ICU releases render the
8
+ * same text. The entry point re-exports the shared wire contracts, the exact numeric and
9
+ * civil-date primitives, restricted canonical hashing and stateless evaluation. It carries no
10
+ * locale database: message rendering and cardinal selection are a separate entry,
11
+ * `@azx-pbc/axiom-runtime/messages`, so a rule-only host never loads the CLDR registry. The one
12
+ * locale fact on the root entry is the small vendored text-direction map (`directionOf`), which a
13
+ * host needs to paint `dir`/`lang` without loading message rendering. The
14
+ * built-in documentation registry and the documentation-example parser/evaluator are build-time
15
+ * reference machinery for the docs tools and ride on `@azx-pbc/axiom-runtime/docs`, so a device
16
+ * bundle never carries them.
17
+ */
18
+ export * from './model/types.js';
19
+ export * from './model/time.js';
20
+ export * from './model/duration.js';
21
+ export * from './model/row-address.js';
22
+ export type { ArtifactShape, DeclaredFieldLike, DeclaredFieldShape, FieldIdsOf, FieldShapeOf, RecordOf, RowKeyRequirement, RowKeyRequirementOf, RuleIdsOf, ShapeOfArtifact, ShapeOfDocument, TypedArtifact, WireValueOf, } from './model/shape.js';
23
+ export { isCompositionReport } from './model/composition.js';
24
+ export type { AppliedOverlay, CompositionReport } from './model/composition.js';
25
+ export * from './model/access.js';
26
+ export * from './model/layout.js';
27
+ export * from './model/schema.js';
28
+ export * from './model/errors.js';
29
+ export { AXIOM_VERSION, isVersionText } from './version.js';
30
+ export * from './expr/decimal.js';
31
+ export * from './expr/logic.js';
32
+ export * from './expr/money.js';
33
+ export * from './expr/quantity.js';
34
+ export * from './expr/plain-date.js';
35
+ export * from './expr/instant.js';
36
+ export * from './expr/builtins.js';
37
+ export * from './expr/validation.js';
38
+ export * from './expr/pattern.js';
39
+ export * from './expr/regex.js';
40
+ export * from './expr/reduce.js';
41
+ export * from './expr/diagnostics.js';
42
+ export * from './expr/deprecations.js';
43
+ export { resolveSchemaLocale } from './expr/select-locale.js';
44
+ export type { LocaleCatalogue, SchemaLocaleMatch, SchemaLocaleOptions, SchemaLocaleRefusal, SchemaLocaleResolution, } from './expr/select-locale.js';
45
+ export { directionOf } from './expr/direction.js';
46
+ export type { Direction } from './expr/direction.js';
47
+ export { compareCodePoints } from './expr/strings.js';
48
+ export { canonicalHash, canonicalHashOwned, canonicalizeOwned, canonicalizeRestricted, copyRestricted, parseRestrictedJson, sha256Hex, sha256HexOfBytes, utf8BytesOf, } from './canonical/jcs.js';
49
+ export * from './canonical/restricted-value.js';
50
+ export * from './canonical/signature.js';
51
+ export { memberOf, readArtifact, refusalOf, rowKeyToken, rowKeyValue, toAccessEntry, toEvaluationContext, toEvaluationEnv, toEvaluationInput, toEvaluationRecord, toFieldRef, toGateOverride, toHostWireValue, toLookupPort, toSessionWireValue, toSubmissionInput, toWireValue, wireDeclarationOf, wireDeclarationOfColumn, wireDeclarationOfDomain, } from './model/wire.js';
52
+ export type { ArtifactAdmission, BoundaryRefusal, HostOnlySubmissionMember, WireDeclaration, } from './model/wire.js';
53
+ export { valueDomainOf } from './model/domain.js';
54
+ export type { ItemValueDomain, ValueDomain, ValueDomainDeclaration, ValueDomainFields, } from './model/domain.js';
55
+ export { isRecord, isWireValue, sameWireValue } from './model/values.js';
56
+ export * from './model/intrinsic.js';
57
+ export { canonicalMediaAcceptEntry, isCanonicalMediaAcceptEntry, MEDIA_EXTENSION_TYPES, mediaAcceptEntryMatches, mediaAcceptMatches, } from './model/media.js';
58
+ export * from './eval/evaluate.js';
59
+ export * from './eval/presentation.js';
60
+ export * from './eval/gate.js';
61
+ export { toEngineOperations } from './eval/suggestions-to-engine.js';
62
+ export { ineligibleOptionValue, ineligibleWireValue, OPTION_NO_LONGER_ELIGIBLE, optionCodeValue, optionEligibility, } from './eval/options.js';
63
+ export type { OptionDomains, OptionItem, OptionPage, OptionValue } from './eval/options.js';
64
+ export { isE164PhoneNumber } from './expr/validation.js';
65
+ export { readGateOverrides, applyApprovedOverrides } from './eval/overrides.js';
66
+ export type { GateOverrideRefusal, GateRefusal, GateOverrideOutcome, ReadOverrides, } from './eval/overrides.js';
67
+ export * from './eval/evaluate-expr.js';
68
+ export * from './eval/verify-signature.js';
69
+ export { firingBranch, isFiring, isRuleKind, unreachableBranchOf } from './eval/firing.js';
70
+ export type { Observation, UnreachableBranch } from './eval/firing.js';
71
+ export * from './model/evolution.js';
72
+ export { upcastRecord } from './eval/evolution/upcast.js';
73
+ export { selectEffectiveSchema } from './eval/evolution/select.js';
74
+ export { sameValueDomain, unpairableRows, unresolvedUpcasters } from './eval/evolution/relocate.js';
75
+ export * from './graph/index.js';
76
+ export { isContextRootPath } from './eval/reader.js';
77
+ export type { RecordIndex } from './eval/reader.js';
78
+ export { createAccessResolver, fieldKey } from './eval/access/projection.js';
79
+ export type { AccessResolver, FieldAccessState } from './eval/access/projection.js';
80
+ export { accessFor, meetAccess, projectAccessEntries, resolveOverlay, ruleReadFor, } from './eval/access/overlay.js';
81
+ export type { ResolvedAccess } from './eval/access/overlay.js';
82
+ export { createAccessWindow } from './eval/access/window.js';
83
+ export type { AccessWindow } from './eval/access/window.js';
84
+ export { checkWrite, permitsUserWrite, WriteRefusedError } from './eval/access/write.js';
85
+ export { WRITE_REFUSAL_CODES, WRITE_REFUSAL_REPAIRS, writeRefusalRepair, } from './eval/access/write.js';
86
+ export type { WriteOrigin, WriteRefusal, WriteRefusalCode, WriteRequest, } from './eval/access/write.js';
87
+ export { describeFormState } from './eval/state/describe.js';
88
+ export { deriveFormState } from './eval/state/derive.js';
89
+ export type { FormState } from './eval/state/derive.js';
90
+ export { evaluateForm } from './eval/state/snapshot.js';
91
+ export { sealReport } from './eval/seal.js';
92
+ export type { FormSnapshot } from './eval/state/snapshot.js';
93
+ export { projectSubmission } from './eval/submission.js';
94
+ export type { SubmissionProjectionOptions, SubmissionSnapshot } from './eval/submission.js';
95
+ export { createEngine, SessionRefusedError } from './eval/engine/index.js';
96
+ export { SESSION_REFUSAL_CODES, SESSION_REFUSAL_REPAIRS, sessionRefusalRepair, } from './eval/engine/index.js';
97
+ export { createCancellationPort } from './eval/engine/cancellation.js';
98
+ export type { CancellationPort, CancellationSignal } from './eval/engine/ports.js';
99
+ export type { CandidateDelta, CandidateOutcome, ChangedComputation, Engine, EngineCandidate, EngineConfig, EngineFieldDeps, EngineFieldExplanation, EngineFieldState, EngineOperation, EngineOutcome, EnginePatch, EnginePorts, EvaluationObserver, IdFactory, LastPass, PendingCheck, ProposedCandidate, SessionRefusal, SessionRefusalCode, StructuralWrite, } from './eval/engine/index.js';
100
+ export type { FormStateOptions } from './eval/state/options.js';
101
+ export type { ArrayCardinality, DecimalScale, FieldComputation, FieldMessage, FieldValueRefusal, FormFieldState, FormRowState, MediaConstraints, MediaConstraintViolation, RequiredStatus, RowAddressing, RowCountState, UnavailableOption, } from './eval/state/field-state.js';
102
+ export type { ValueState, WithheldReason } from './eval/state/value-state.js';
103
+ export type { FormBlocker, FormGateState, FormScreenState, FormSkippedCheck, FormUndeterminedCheck, FormUndeterminedComputation, GateOutcome, Readiness, SubmissionVerdict, } from './eval/state/readiness.js';
104
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,cAAc,kBAAkB,CAAC;AAGjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,wBAAwB,CAAC;AAIvC,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,mBAAmB,EACnB,SAAS,EACT,eAAe,EACf,eAAe,EACf,aAAa,EACb,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAI7D,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChF,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAKlC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC5D,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CA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