@elaraai/east 1.0.79 → 1.0.81

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 (379) hide show
  1. package/README.md +1 -1
  2. package/dist/src/builtins.d.ts +1 -1
  3. package/dist/src/builtins.d.ts.map +1 -1
  4. package/dist/src/builtins.js +19 -0
  5. package/dist/src/builtins.js.map +1 -1
  6. package/dist/src/codegen/spellings.d.ts.map +1 -1
  7. package/dist/src/codegen/spellings.js +3 -0
  8. package/dist/src/codegen/spellings.js.map +1 -1
  9. package/dist/src/comparison.d.ts +54 -0
  10. package/dist/src/comparison.d.ts.map +1 -1
  11. package/dist/src/comparison.equivalent.spec.d.ts +6 -0
  12. package/dist/src/comparison.equivalent.spec.d.ts.map +1 -0
  13. package/dist/src/comparison.equivalent.spec.js +130 -0
  14. package/dist/src/comparison.equivalent.spec.js.map +1 -0
  15. package/dist/src/comparison.js +97 -25
  16. package/dist/src/comparison.js.map +1 -1
  17. package/dist/src/compile/builtins/array.d.ts +60 -0
  18. package/dist/src/compile/builtins/array.d.ts.map +1 -0
  19. package/dist/src/compile/builtins/array.js +691 -0
  20. package/dist/src/compile/builtins/array.js.map +1 -0
  21. package/dist/src/compile/builtins/blob.d.ts +18 -0
  22. package/dist/src/compile/builtins/blob.d.ts.map +1 -0
  23. package/dist/src/compile/builtins/blob.js +150 -0
  24. package/dist/src/compile/builtins/blob.js.map +1 -0
  25. package/dist/src/compile/builtins/compare.d.ts +18 -0
  26. package/dist/src/compile/builtins/compare.d.ts.map +1 -0
  27. package/dist/src/compile/builtins/compare.js +52 -0
  28. package/dist/src/compile/builtins/compare.js.map +1 -0
  29. package/dist/src/compile/builtins/datetime.d.ts +21 -0
  30. package/dist/src/compile/builtins/datetime.d.ts.map +1 -0
  31. package/dist/src/compile/builtins/datetime.js +46 -0
  32. package/dist/src/compile/builtins/datetime.js.map +1 -0
  33. package/dist/src/compile/builtins/dict.d.ts +47 -0
  34. package/dist/src/compile/builtins/dict.d.ts.map +1 -0
  35. package/dist/src/compile/builtins/dict.js +576 -0
  36. package/dist/src/compile/builtins/dict.js.map +1 -0
  37. package/dist/src/compile/builtins/index.d.ts +9 -0
  38. package/dist/src/compile/builtins/index.d.ts.map +1 -0
  39. package/dist/src/compile/builtins/index.js +28 -0
  40. package/dist/src/compile/builtins/index.js.map +1 -0
  41. package/dist/src/compile/builtins/matrix.d.ts +31 -0
  42. package/dist/src/compile/builtins/matrix.d.ts.map +1 -0
  43. package/dist/src/compile/builtins/matrix.js +310 -0
  44. package/dist/src/compile/builtins/matrix.js.map +1 -0
  45. package/dist/src/compile/builtins/primitives.d.ts +36 -0
  46. package/dist/src/compile/builtins/primitives.d.ts.map +1 -0
  47. package/dist/src/compile/builtins/primitives.js +67 -0
  48. package/dist/src/compile/builtins/primitives.js.map +1 -0
  49. package/dist/src/compile/builtins/ref.d.ts +11 -0
  50. package/dist/src/compile/builtins/ref.d.ts.map +1 -0
  51. package/dist/src/compile/builtins/ref.js +30 -0
  52. package/dist/src/compile/builtins/ref.js.map +1 -0
  53. package/dist/src/compile/builtins/set.d.ts +42 -0
  54. package/dist/src/compile/builtins/set.d.ts.map +1 -0
  55. package/dist/src/compile/builtins/set.js +410 -0
  56. package/dist/src/compile/builtins/set.js.map +1 -0
  57. package/dist/src/compile/builtins/sparse.d.ts +19 -0
  58. package/dist/src/compile/builtins/sparse.d.ts.map +1 -0
  59. package/dist/src/compile/builtins/sparse.js +143 -0
  60. package/dist/src/compile/builtins/sparse.js.map +1 -0
  61. package/dist/src/compile/builtins/string.d.ts +34 -0
  62. package/dist/src/compile/builtins/string.d.ts.map +1 -0
  63. package/dist/src/compile/builtins/string.js +238 -0
  64. package/dist/src/compile/builtins/string.js.map +1 -0
  65. package/dist/src/compile/builtins/tree.d.ts +32 -0
  66. package/dist/src/compile/builtins/tree.d.ts.map +1 -0
  67. package/dist/src/compile/builtins/tree.js +108 -0
  68. package/dist/src/compile/builtins/tree.js.map +1 -0
  69. package/dist/src/compile/builtins/vector.d.ts +44 -0
  70. package/dist/src/compile/builtins/vector.d.ts.map +1 -0
  71. package/dist/src/compile/builtins/vector.js +463 -0
  72. package/dist/src/compile/builtins/vector.js.map +1 -0
  73. package/dist/src/compile/constructors.d.ts +13 -0
  74. package/dist/src/compile/constructors.d.ts.map +1 -0
  75. package/dist/src/compile/constructors.js +179 -0
  76. package/dist/src/compile/constructors.js.map +1 -0
  77. package/dist/src/compile/control.d.ts +13 -0
  78. package/dist/src/compile/control.d.ts.map +1 -0
  79. package/dist/src/compile/control.js +513 -0
  80. package/dist/src/compile/control.js.map +1 -0
  81. package/dist/src/compile/functions.d.ts +13 -0
  82. package/dist/src/compile/functions.d.ts.map +1 -0
  83. package/dist/src/compile/functions.js +492 -0
  84. package/dist/src/compile/functions.js.map +1 -0
  85. package/dist/src/compile/ir.d.ts +19 -0
  86. package/dist/src/compile/ir.d.ts.map +1 -0
  87. package/dist/src/compile/ir.js +193 -0
  88. package/dist/src/compile/ir.js.map +1 -0
  89. package/dist/src/compile/runtime.d.ts +75 -0
  90. package/dist/src/compile/runtime.d.ts.map +1 -0
  91. package/dist/src/compile/runtime.js +114 -0
  92. package/dist/src/compile/runtime.js.map +1 -0
  93. package/dist/src/compile/type_parameters.d.ts +4 -0
  94. package/dist/src/compile/type_parameters.d.ts.map +1 -0
  95. package/dist/src/compile/type_parameters.js +55 -0
  96. package/dist/src/compile/type_parameters.js.map +1 -0
  97. package/dist/src/compile/typed_arrays.d.ts +28 -0
  98. package/dist/src/compile/typed_arrays.d.ts.map +1 -0
  99. package/dist/src/compile/typed_arrays.js +77 -0
  100. package/dist/src/compile/typed_arrays.js.map +1 -0
  101. package/dist/src/compile.d.ts +6 -41
  102. package/dist/src/compile.d.ts.map +1 -1
  103. package/dist/src/compile.js +8 -4415
  104. package/dist/src/compile.js.map +1 -1
  105. package/dist/src/compile.open_beast.spec.js +5 -4
  106. package/dist/src/compile.open_beast.spec.js.map +1 -1
  107. package/dist/src/compile.signature.spec.d.ts +6 -0
  108. package/dist/src/compile.signature.spec.d.ts.map +1 -0
  109. package/dist/src/compile.signature.spec.js +53 -0
  110. package/dist/src/compile.signature.spec.js.map +1 -0
  111. package/dist/src/containers/sortedmap.d.ts +2 -1
  112. package/dist/src/containers/sortedmap.d.ts.map +1 -1
  113. package/dist/src/containers/sortedmap.js +4 -2
  114. package/dist/src/containers/sortedmap.js.map +1 -1
  115. package/dist/src/containers/sortedset.d.ts +2 -1
  116. package/dist/src/containers/sortedset.d.ts.map +1 -1
  117. package/dist/src/containers/sortedset.js +4 -2
  118. package/dist/src/containers/sortedset.js.map +1 -1
  119. package/dist/src/error.d.ts +15 -0
  120. package/dist/src/error.d.ts.map +1 -1
  121. package/dist/src/error.js +16 -0
  122. package/dist/src/error.js.map +1 -1
  123. package/dist/src/expr/array.d.ts +158 -81
  124. package/dist/src/expr/array.d.ts.map +1 -1
  125. package/dist/src/expr/array.js +68 -51
  126. package/dist/src/expr/array.js.map +1 -1
  127. package/dist/src/expr/ast.d.ts.map +1 -1
  128. package/dist/src/expr/ast.js +13 -0
  129. package/dist/src/expr/ast.js.map +1 -1
  130. package/dist/src/expr/blob.d.ts +8 -8
  131. package/dist/src/expr/blob.js +8 -8
  132. package/dist/src/expr/block.d.ts +18 -5
  133. package/dist/src/expr/block.d.ts.map +1 -1
  134. package/dist/src/expr/block.js +19 -0
  135. package/dist/src/expr/block.js.map +1 -1
  136. package/dist/src/expr/boolean.d.ts +10 -10
  137. package/dist/src/expr/boolean.js +10 -10
  138. package/dist/src/expr/datetime.d.ts +28 -28
  139. package/dist/src/expr/datetime.js +28 -28
  140. package/dist/src/expr/dict.d.ts +101 -51
  141. package/dist/src/expr/dict.d.ts.map +1 -1
  142. package/dist/src/expr/dict.js +97 -36
  143. package/dist/src/expr/dict.js.map +1 -1
  144. package/dist/src/expr/float.d.ts +23 -23
  145. package/dist/src/expr/float.js +23 -23
  146. package/dist/src/expr/integer.d.ts +17 -17
  147. package/dist/src/expr/integer.js +11 -11
  148. package/dist/src/expr/libs/array.d.ts +6 -6
  149. package/dist/src/expr/libs/array.js +6 -6
  150. package/dist/src/expr/libs/blob.d.ts +2 -2
  151. package/dist/src/expr/libs/blob.js +2 -2
  152. package/dist/src/expr/libs/datetime.d.ts +25 -25
  153. package/dist/src/expr/libs/datetime.js +25 -25
  154. package/dist/src/expr/libs/dict.d.ts +2 -2
  155. package/dist/src/expr/libs/dict.js +2 -2
  156. package/dist/src/expr/libs/float.d.ts +15 -15
  157. package/dist/src/expr/libs/float.js +15 -15
  158. package/dist/src/expr/libs/integer.d.ts +12 -12
  159. package/dist/src/expr/libs/integer.js +12 -12
  160. package/dist/src/expr/libs/set.d.ts +2 -2
  161. package/dist/src/expr/libs/set.js +2 -2
  162. package/dist/src/expr/libs/string.d.ts +4 -4
  163. package/dist/src/expr/libs/string.js +4 -4
  164. package/dist/src/expr/recursive.d.ts +22 -5
  165. package/dist/src/expr/recursive.d.ts.map +1 -1
  166. package/dist/src/expr/recursive.js +22 -5
  167. package/dist/src/expr/recursive.js.map +1 -1
  168. package/dist/src/expr/ref.d.ts +5 -5
  169. package/dist/src/expr/ref.js +5 -5
  170. package/dist/src/expr/set.d.ts +96 -51
  171. package/dist/src/expr/set.d.ts.map +1 -1
  172. package/dist/src/expr/set.js +85 -29
  173. package/dist/src/expr/set.js.map +1 -1
  174. package/dist/src/expr/string.d.ts +28 -28
  175. package/dist/src/expr/string.js +28 -28
  176. package/dist/src/expr/struct.d.ts.map +1 -1
  177. package/dist/src/expr/struct.js +2 -2
  178. package/dist/src/expr/variant.d.ts +12 -12
  179. package/dist/src/expr/variant.js +7 -7
  180. package/dist/src/function_symbols.d.ts +28 -0
  181. package/dist/src/function_symbols.d.ts.map +1 -0
  182. package/dist/src/function_symbols.js +28 -0
  183. package/dist/src/function_symbols.js.map +1 -0
  184. package/dist/src/index.d.ts +1 -0
  185. package/dist/src/index.d.ts.map +1 -1
  186. package/dist/src/index.js +1 -0
  187. package/dist/src/index.js.map +1 -1
  188. package/dist/src/location.d.ts +32 -0
  189. package/dist/src/location.d.ts.map +1 -1
  190. package/dist/src/location.js +38 -0
  191. package/dist/src/location.js.map +1 -1
  192. package/dist/src/location.spec.js +89 -1
  193. package/dist/src/location.spec.js.map +1 -1
  194. package/dist/src/patch/index.d.ts +1 -1
  195. package/dist/src/patch/index.d.ts.map +1 -1
  196. package/dist/src/patch/index.js +1 -1
  197. package/dist/src/patch/index.js.map +1 -1
  198. package/dist/src/patch/type_of_patch.d.ts +25 -1
  199. package/dist/src/patch/type_of_patch.d.ts.map +1 -1
  200. package/dist/src/patch/type_of_patch.js +33 -10
  201. package/dist/src/patch/type_of_patch.js.map +1 -1
  202. package/dist/src/platform.spec.js +19 -1
  203. package/dist/src/platform.spec.js.map +1 -1
  204. package/dist/src/runner_protocol.d.ts +357 -0
  205. package/dist/src/runner_protocol.d.ts.map +1 -0
  206. package/dist/src/runner_protocol.js +154 -0
  207. package/dist/src/runner_protocol.js.map +1 -0
  208. package/dist/src/serialization/beast2/index.d.ts +22 -5
  209. package/dist/src/serialization/beast2/index.d.ts.map +1 -1
  210. package/dist/src/serialization/beast2/index.js +13 -2
  211. package/dist/src/serialization/beast2/index.js.map +1 -1
  212. package/dist/src/serialization/beast2/index.spec.js +84 -3
  213. package/dist/src/serialization/beast2/index.spec.js.map +1 -1
  214. package/dist/src/serialization/beast2/shared.d.ts +32 -3
  215. package/dist/src/serialization/beast2/shared.d.ts.map +1 -1
  216. package/dist/src/serialization/beast2/shared.js +135 -10
  217. package/dist/src/serialization/beast2/shared.js.map +1 -1
  218. package/dist/src/serialization/beast2/v4/container.d.ts.map +1 -1
  219. package/dist/src/serialization/beast2/v4/container.js +5 -3
  220. package/dist/src/serialization/beast2/v4/container.js.map +1 -1
  221. package/dist/src/serialization/beast2/v5/aliasing.spec.d.ts +6 -0
  222. package/dist/src/serialization/beast2/v5/aliasing.spec.d.ts.map +1 -0
  223. package/dist/src/serialization/beast2/v5/aliasing.spec.js +75 -0
  224. package/dist/src/serialization/beast2/v5/aliasing.spec.js.map +1 -0
  225. package/dist/src/serialization/beast2/v5/boundary.d.ts +176 -0
  226. package/dist/src/serialization/beast2/v5/boundary.d.ts.map +1 -0
  227. package/dist/src/serialization/beast2/v5/boundary.js +297 -0
  228. package/dist/src/serialization/beast2/v5/boundary.js.map +1 -0
  229. package/dist/src/serialization/beast2/v5/boundary.spec.d.ts +6 -0
  230. package/dist/src/serialization/beast2/v5/boundary.spec.d.ts.map +1 -0
  231. package/dist/src/serialization/beast2/v5/boundary.spec.js +479 -0
  232. package/dist/src/serialization/beast2/v5/boundary.spec.js.map +1 -0
  233. package/dist/src/serialization/beast2/v5/canonical.d.ts +101 -0
  234. package/dist/src/serialization/beast2/v5/canonical.d.ts.map +1 -0
  235. package/dist/src/serialization/beast2/v5/canonical.js +436 -0
  236. package/dist/src/serialization/beast2/v5/canonical.js.map +1 -0
  237. package/dist/src/serialization/beast2/v5/canonical.spec.d.ts +6 -0
  238. package/dist/src/serialization/beast2/v5/canonical.spec.d.ts.map +1 -0
  239. package/dist/src/serialization/beast2/v5/canonical.spec.js +124 -0
  240. package/dist/src/serialization/beast2/v5/canonical.spec.js.map +1 -0
  241. package/dist/src/serialization/beast2/v5/codec.d.ts +6 -5
  242. package/dist/src/serialization/beast2/v5/codec.d.ts.map +1 -1
  243. package/dist/src/serialization/beast2/v5/codec.js +18 -3
  244. package/dist/src/serialization/beast2/v5/codec.js.map +1 -1
  245. package/dist/src/serialization/beast2/v5/deflate.d.ts +24 -2
  246. package/dist/src/serialization/beast2/v5/deflate.d.ts.map +1 -1
  247. package/dist/src/serialization/beast2/v5/deflate.js +47 -12
  248. package/dist/src/serialization/beast2/v5/deflate.js.map +1 -1
  249. package/dist/src/serialization/beast2/v5/deflate.spec.js +15 -1
  250. package/dist/src/serialization/beast2/v5/deflate.spec.js.map +1 -1
  251. package/dist/src/serialization/beast2/v5/elements.d.ts +66 -0
  252. package/dist/src/serialization/beast2/v5/elements.d.ts.map +1 -0
  253. package/dist/src/serialization/beast2/v5/elements.js +325 -0
  254. package/dist/src/serialization/beast2/v5/elements.js.map +1 -0
  255. package/dist/src/serialization/beast2/v5/elements.spec.d.ts +6 -0
  256. package/dist/src/serialization/beast2/v5/elements.spec.d.ts.map +1 -0
  257. package/dist/src/serialization/beast2/v5/elements.spec.js +161 -0
  258. package/dist/src/serialization/beast2/v5/elements.spec.js.map +1 -0
  259. package/dist/src/serialization/beast2/v5/frame-pool.d.ts +62 -21
  260. package/dist/src/serialization/beast2/v5/frame-pool.d.ts.map +1 -1
  261. package/dist/src/serialization/beast2/v5/frame-pool.js +138 -27
  262. package/dist/src/serialization/beast2/v5/frame-pool.js.map +1 -1
  263. package/dist/src/serialization/beast2/v5/frame-pool.spec.js +198 -71
  264. package/dist/src/serialization/beast2/v5/frame-pool.spec.js.map +1 -1
  265. package/dist/src/serialization/beast2/v5/frame-worker.js +25 -15
  266. package/dist/src/serialization/beast2/v5/frame-worker.js.map +1 -1
  267. package/dist/src/serialization/beast2/v5/frames.d.ts +22 -12
  268. package/dist/src/serialization/beast2/v5/frames.d.ts.map +1 -1
  269. package/dist/src/serialization/beast2/v5/frames.js +52 -27
  270. package/dist/src/serialization/beast2/v5/frames.js.map +1 -1
  271. package/dist/src/serialization/beast2/v5/geometry.d.ts +38 -1
  272. package/dist/src/serialization/beast2/v5/geometry.d.ts.map +1 -1
  273. package/dist/src/serialization/beast2/v5/geometry.js +73 -1
  274. package/dist/src/serialization/beast2/v5/geometry.js.map +1 -1
  275. package/dist/src/serialization/beast2/v5/geometry.spec.js +34 -23
  276. package/dist/src/serialization/beast2/v5/geometry.spec.js.map +1 -1
  277. package/dist/src/serialization/beast2/v5/index.spec.js +32 -28
  278. package/dist/src/serialization/beast2/v5/index.spec.js.map +1 -1
  279. package/dist/src/serialization/beast2/v5/intake.d.ts +98 -0
  280. package/dist/src/serialization/beast2/v5/intake.d.ts.map +1 -0
  281. package/dist/src/serialization/beast2/v5/intake.js +462 -0
  282. package/dist/src/serialization/beast2/v5/intake.js.map +1 -0
  283. package/dist/src/serialization/beast2/v5/intake.spec.d.ts +6 -0
  284. package/dist/src/serialization/beast2/v5/intake.spec.d.ts.map +1 -0
  285. package/dist/src/serialization/beast2/v5/intake.spec.js +202 -0
  286. package/dist/src/serialization/beast2/v5/intake.spec.js.map +1 -0
  287. package/dist/src/serialization/beast2/v5/lazy.d.ts +42 -1
  288. package/dist/src/serialization/beast2/v5/lazy.d.ts.map +1 -1
  289. package/dist/src/serialization/beast2/v5/lazy.js +143 -28
  290. package/dist/src/serialization/beast2/v5/lazy.js.map +1 -1
  291. package/dist/src/serialization/beast2/v5/lazy.spec.js +102 -24
  292. package/dist/src/serialization/beast2/v5/lazy.spec.js.map +1 -1
  293. package/dist/src/serialization/beast2/v5/manifest-writer.d.ts +110 -0
  294. package/dist/src/serialization/beast2/v5/manifest-writer.d.ts.map +1 -0
  295. package/dist/src/serialization/beast2/v5/manifest-writer.js +118 -0
  296. package/dist/src/serialization/beast2/v5/manifest-writer.js.map +1 -0
  297. package/dist/src/serialization/beast2/v5/manifest-writer.spec.d.ts +6 -0
  298. package/dist/src/serialization/beast2/v5/manifest-writer.spec.d.ts.map +1 -0
  299. package/dist/src/serialization/beast2/v5/manifest-writer.spec.js +207 -0
  300. package/dist/src/serialization/beast2/v5/manifest-writer.spec.js.map +1 -0
  301. package/dist/src/serialization/beast2/v5/manifest.d.ts +241 -0
  302. package/dist/src/serialization/beast2/v5/manifest.d.ts.map +1 -0
  303. package/dist/src/serialization/beast2/v5/manifest.js +233 -0
  304. package/dist/src/serialization/beast2/v5/manifest.js.map +1 -0
  305. package/dist/src/serialization/beast2/v5/merge.d.ts +93 -0
  306. package/dist/src/serialization/beast2/v5/merge.d.ts.map +1 -0
  307. package/dist/src/serialization/beast2/v5/merge.js +202 -0
  308. package/dist/src/serialization/beast2/v5/merge.js.map +1 -0
  309. package/dist/src/serialization/beast2/v5/merge.spec.d.ts +6 -0
  310. package/dist/src/serialization/beast2/v5/merge.spec.d.ts.map +1 -0
  311. package/dist/src/serialization/beast2/v5/merge.spec.js +118 -0
  312. package/dist/src/serialization/beast2/v5/merge.spec.js.map +1 -0
  313. package/dist/src/serialization/beast2/v5/recut.d.ts +143 -0
  314. package/dist/src/serialization/beast2/v5/recut.d.ts.map +1 -0
  315. package/dist/src/serialization/beast2/v5/recut.js +365 -0
  316. package/dist/src/serialization/beast2/v5/recut.js.map +1 -0
  317. package/dist/src/serialization/beast2/v5/recut.spec.d.ts +6 -0
  318. package/dist/src/serialization/beast2/v5/recut.spec.d.ts.map +1 -0
  319. package/dist/src/serialization/beast2/v5/recut.spec.js +215 -0
  320. package/dist/src/serialization/beast2/v5/recut.spec.js.map +1 -0
  321. package/dist/src/serialization/beast2/v5/runs.d.ts +148 -0
  322. package/dist/src/serialization/beast2/v5/runs.d.ts.map +1 -0
  323. package/dist/src/serialization/beast2/v5/runs.js +260 -0
  324. package/dist/src/serialization/beast2/v5/runs.js.map +1 -0
  325. package/dist/src/serialization/beast2/v5/runs.spec.d.ts +6 -0
  326. package/dist/src/serialization/beast2/v5/runs.spec.d.ts.map +1 -0
  327. package/dist/src/serialization/beast2/v5/runs.spec.js +182 -0
  328. package/dist/src/serialization/beast2/v5/runs.spec.js.map +1 -0
  329. package/dist/src/serialization/beast2/v5/sha256.d.ts +19 -0
  330. package/dist/src/serialization/beast2/v5/sha256.d.ts.map +1 -0
  331. package/dist/src/serialization/beast2/v5/sha256.js +103 -0
  332. package/dist/src/serialization/beast2/v5/sha256.js.map +1 -0
  333. package/dist/src/serialization/beast2/v5/sha256.spec.d.ts +6 -0
  334. package/dist/src/serialization/beast2/v5/sha256.spec.d.ts.map +1 -0
  335. package/dist/src/serialization/beast2/v5/sha256.spec.js +42 -0
  336. package/dist/src/serialization/beast2/v5/sha256.spec.js.map +1 -0
  337. package/dist/src/serialization/beast2/v5/stream.d.ts +273 -86
  338. package/dist/src/serialization/beast2/v5/stream.d.ts.map +1 -1
  339. package/dist/src/serialization/beast2/v5/stream.js +576 -244
  340. package/dist/src/serialization/beast2/v5/stream.js.map +1 -1
  341. package/dist/src/serialization/beast2/v5/sync-reader.spec.js +24 -10
  342. package/dist/src/serialization/beast2/v5/sync-reader.spec.js.map +1 -1
  343. package/dist/src/serialization/index.d.ts +1 -1
  344. package/dist/src/serialization/index.d.ts.map +1 -1
  345. package/dist/src/serialization/index.js +1 -1
  346. package/dist/src/serialization/index.js.map +1 -1
  347. package/dist/src/serialization/json.d.ts +28 -0
  348. package/dist/src/serialization/json.d.ts.map +1 -1
  349. package/dist/src/serialization/json.js +141 -30
  350. package/dist/src/serialization/json.js.map +1 -1
  351. package/dist/src/serialization/json.spec.js +47 -2
  352. package/dist/src/serialization/json.spec.js.map +1 -1
  353. package/dist/src/serialization/json_schema.d.ts +15 -11
  354. package/dist/src/serialization/json_schema.d.ts.map +1 -1
  355. package/dist/src/serialization/json_schema.js +21 -36
  356. package/dist/src/serialization/json_schema.js.map +1 -1
  357. package/dist/src/serialization/json_schema.spec.js +26 -32
  358. package/dist/src/serialization/json_schema.spec.js.map +1 -1
  359. package/dist/src/serialization/json_schema_to_type.d.ts +10 -5
  360. package/dist/src/serialization/json_schema_to_type.d.ts.map +1 -1
  361. package/dist/src/serialization/json_schema_to_type.js +13 -6
  362. package/dist/src/serialization/json_schema_to_type.js.map +1 -1
  363. package/dist/src/serialization/json_schema_to_type.spec.js +19 -0
  364. package/dist/src/serialization/json_schema_to_type.spec.js.map +1 -1
  365. package/dist/src/string_order.d.ts +36 -0
  366. package/dist/src/string_order.d.ts.map +1 -0
  367. package/dist/src/string_order.js +64 -0
  368. package/dist/src/string_order.js.map +1 -0
  369. package/dist/src/string_order.spec.d.ts +6 -0
  370. package/dist/src/string_order.spec.d.ts.map +1 -0
  371. package/dist/src/string_order.spec.js +79 -0
  372. package/dist/src/string_order.spec.js.map +1 -0
  373. package/dist/src/type_of_type.d.ts +17 -0
  374. package/dist/src/type_of_type.d.ts.map +1 -1
  375. package/dist/src/type_of_type.js +66 -0
  376. package/dist/src/type_of_type.js.map +1 -1
  377. package/dist/src/type_of_type.to_etv.spec.js +69 -1
  378. package/dist/src/type_of_type.to_etv.spec.js.map +1 -1
  379. package/package.json +1 -1
@@ -0,0 +1,193 @@
1
+ import { compile_constructors } from "./constructors.js";
2
+ import { compile_control } from "./control.js";
3
+ import { compile_functions } from "./functions.js";
4
+ import { getContextValue, requiresBoxing } from "./runtime.js";
5
+ import { variant } from "../containers/variant.js";
6
+ import { get_current_source_map } from "../location.js";
7
+ // Captured once per top-level compile; all closures share the same SourceMap.
8
+ let _compile_source_map = null;
9
+ /** Compile `IR` into a JavaScript function using a closure-compiler technique.
10
+ * This should execute faster than a simple tree-walking interpreter, but slower than hand-written Javascript.
11
+ *
12
+ * A "context" of the current variables in scope is given. For toplevel function IR, provide `{}`.
13
+ * A "platform" is provided with JavaScript functions to perform effects, like logging. If no effects are needed, simply provide `{}`.
14
+ *
15
+ * @internal
16
+ */
17
+ export function compile_internal(ir, ctx, platform, asyncPlatformFns, platformDef, fresh_ctx = true, compilingNodes = new Set()) {
18
+ // Capture source map from the active scope on first call
19
+ if (fresh_ctx)
20
+ _compile_source_map = get_current_source_map();
21
+ const source_map = _compile_source_map;
22
+ // The IR is checked prior to compilation, so we can assume it's valid here.
23
+ // The compiler needs to take care that Promises are properly awaited, so most IR nodes need both sync and async implementations.
24
+ // We assume unnecessary `async` functions degrade performance but unnecessary `await`s are not too bad, so while we could be more "specific" in our awaits we do not bother
25
+ if (ir.type === "Value") {
26
+ const v = ir.value.value.value;
27
+ return (_ctx) => v;
28
+ }
29
+ else if (ir.type === "Variable") {
30
+ const name = ir.value.name;
31
+ // All context values are variants - read via .value
32
+ return (ctx) => getContextValue(ctx, name).value;
33
+ }
34
+ else if (ir.type === "Let") {
35
+ const compiled_statement = compile_internal(ir.value.value, ctx, platform, asyncPlatformFns, platformDef, false, compilingNodes);
36
+ const name = ir.value.variable.value.name;
37
+ ctx[name] = ir.value.variable.value.type;
38
+ const boxed = requiresBoxing(ir.value.variable.value);
39
+ if (ir.value.isAsync) {
40
+ return async (ctx) => {
41
+ ctx[name] = boxed
42
+ ? variant("boxed", await compiled_statement(ctx))
43
+ : variant("value", await compiled_statement(ctx));
44
+ return null;
45
+ };
46
+ }
47
+ else {
48
+ return (ctx) => {
49
+ ctx[name] = boxed
50
+ ? variant("boxed", compiled_statement(ctx))
51
+ : variant("value", compiled_statement(ctx));
52
+ return null;
53
+ };
54
+ }
55
+ }
56
+ else if (ir.type === "Assign") {
57
+ const name = ir.value.variable.value.name;
58
+ const compiled_statement = compile_internal(ir.value.value, ctx, platform, asyncPlatformFns, platformDef, false, compilingNodes);
59
+ if (requiresBoxing(ir.value.variable.value)) {
60
+ // Boxed variables: mutate in place via .value
61
+ if (ir.value.isAsync) {
62
+ return async (ctx) => {
63
+ getContextValue(ctx, name).value = await compiled_statement(ctx);
64
+ return null;
65
+ };
66
+ }
67
+ else {
68
+ return (ctx) => {
69
+ getContextValue(ctx, name).value = compiled_statement(ctx);
70
+ return null;
71
+ };
72
+ }
73
+ }
74
+ else {
75
+ // Non-boxed variables: replace the variant
76
+ if (ir.value.isAsync) {
77
+ return async (ctx) => {
78
+ const value = await compiled_statement(ctx);
79
+ // We need to check in which prototype the variable lives
80
+ while (!Object.hasOwn(ctx, name))
81
+ ctx = Object.getPrototypeOf(ctx);
82
+ ctx[name] = variant("value", value);
83
+ return null;
84
+ };
85
+ }
86
+ else {
87
+ return (ctx) => {
88
+ const value = compiled_statement(ctx);
89
+ // We need to check in which prototype the variable lives
90
+ while (!Object.hasOwn(ctx, name))
91
+ ctx = Object.getPrototypeOf(ctx);
92
+ ctx[name] = variant("value", value);
93
+ return null;
94
+ };
95
+ }
96
+ }
97
+ }
98
+ else if (ir.type === "As") {
99
+ // in dynamically typed runtimes like Javascript, this is a no-op
100
+ // (for statically typed runtimes this assists in unifying types in branches)
101
+ return compile_internal(ir.value.value, ctx, platform, asyncPlatformFns, platformDef, fresh_ctx, compilingNodes);
102
+ }
103
+ else if (ir.type === "UnwrapRecursive") {
104
+ // in dynamically typed runtimes like Javascript, this is a no-op
105
+ // (for statically typed runtimes this assists in e.g. typing a reference or pointer)
106
+ return compile_internal(ir.value.value, ctx, platform, asyncPlatformFns, platformDef, fresh_ctx, compilingNodes);
107
+ }
108
+ else if (ir.type === "WrapRecursive") {
109
+ // in dynamically typed runtimes like Javascript, this is a no-op
110
+ // (for statically typed runtimes this assists in e.g. typing a heap allocation)
111
+ return compile_internal(ir.value.value, ctx, platform, asyncPlatformFns, platformDef, false, compilingNodes);
112
+ }
113
+ else if (ir.type === "Block") {
114
+ // The pattern of creating a new context (e.g. a function) and then immediately invoking a block (e.g. as the function body) is very common.
115
+ // Here we avoid creating a second context when possible, as an optimization.
116
+ if (fresh_ctx) {
117
+ const compiled_statements = [];
118
+ for (const statement of ir.value.statements) {
119
+ const compiled_statement = compile_internal(statement, ctx, platform, asyncPlatformFns, platformDef, true, compilingNodes);
120
+ compiled_statements.push(compiled_statement);
121
+ }
122
+ if (ir.value.isAsync) {
123
+ return async (ctx) => {
124
+ let ret = null;
125
+ for (const statement of compiled_statements) {
126
+ ret = await statement(ctx);
127
+ }
128
+ return ret;
129
+ };
130
+ }
131
+ else {
132
+ return (ctx) => {
133
+ let ret = null;
134
+ for (const statement of compiled_statements) {
135
+ ret = statement(ctx);
136
+ }
137
+ return ret;
138
+ };
139
+ }
140
+ }
141
+ else {
142
+ const ctx2 = Object.create(ctx);
143
+ const compiled_statements = [];
144
+ for (const statement of ir.value.statements) {
145
+ const compiled_statement = compile_internal(statement, ctx2, platform, asyncPlatformFns, platformDef, true, compilingNodes);
146
+ compiled_statements.push(compiled_statement);
147
+ }
148
+ if (ir.value.isAsync) {
149
+ return async (ctx) => {
150
+ const ctx2 = Object.create(ctx);
151
+ let ret = null;
152
+ for (const statement of compiled_statements) {
153
+ ret = await statement(ctx2);
154
+ }
155
+ return ret;
156
+ };
157
+ }
158
+ else {
159
+ return (ctx) => {
160
+ const ctx2 = Object.create(ctx);
161
+ let ret = null;
162
+ for (const statement of compiled_statements) {
163
+ ret = statement(ctx2);
164
+ }
165
+ return ret;
166
+ };
167
+ }
168
+ }
169
+ }
170
+ else if (ir.type === "GetField") {
171
+ const struct = compile_internal(ir.value.struct, ctx, platform, asyncPlatformFns, platformDef, false, compilingNodes);
172
+ const field = ir.value.field;
173
+ if (ir.value.isAsync) {
174
+ return async (ctx) => (await struct(ctx))[field];
175
+ }
176
+ else {
177
+ return (ctx) => struct(ctx)[field];
178
+ }
179
+ }
180
+ else if (ir.type === "Error" || ir.type === "TryCatch" || ir.type === "IfElse" || ir.type === "Match" || ir.type === "While" || ir.type === "ForArray" || ir.type === "ForSet" || ir.type === "ForDict" || ir.type === "Return" || ir.type === "Continue" || ir.type === "Break") {
181
+ return compile_control(ir, ctx, platform, asyncPlatformFns, platformDef, compilingNodes, source_map);
182
+ }
183
+ else if (ir.type === "Function" || ir.type === "AsyncFunction" || ir.type === "Call" || ir.type === "CallAsync" || ir.type === "Builtin" || ir.type === "Platform") {
184
+ return compile_functions(ir, ctx, platform, asyncPlatformFns, platformDef, compilingNodes, source_map);
185
+ }
186
+ else if (ir.type === "Struct" || ir.type === "Variant" || ir.type === "NewRef" || ir.type === "NewArray" || ir.type === "NewSet" || ir.type === "NewDict" || ir.type === "NewVector" || ir.type === "NewMatrix") {
187
+ return compile_constructors(ir, ctx, platform, asyncPlatformFns, platformDef, compilingNodes, source_map);
188
+ }
189
+ else {
190
+ throw new Error(`Unhandled IR type ${ir.type} at loc_id ${ir.value.loc_id}`); // The `satisfies never` here ensures that this branch is unreachable if all IR types are handled
191
+ }
192
+ }
193
+ //# sourceMappingURL=ir.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ir.js","sourceRoot":"","sources":["../../../src/compile/ir.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,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AoB,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,gBAAgB,EAAE,WAAW,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC;IAC5G,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,qBAAsB,EAAyB,CAAC,IAAI,cAAe,EAAS,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,iGAAiG;IACjN,CAAC;AACH,CAAC"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ import type { BuiltinName } from "../builtins.js";
6
+ import { variant } from "../containers/variant.js";
7
+ import type { SourceMap } from "../location.js";
8
+ import type { PlatformFunction } from "../platform.js";
9
+ import { type EastTypeValue } from "../type_of_type.js";
10
+ export declare const printTypeValue: (type: EastTypeValue) => string;
11
+ export { EAST_IR_SYMBOL, EAST_CAPTURES_SYMBOL, EAST_SOURCE_MAP_SYMBOL } from "../function_symbols.js";
12
+ /**
13
+ * Context values are stored as variants to distinguish regular values from boxed mutable captures.
14
+ * - variant("value", x): regular immutable or non-captured mutable variable
15
+ * - variant("boxed", x): mutable captured variable (box enables shared mutation across closures)
16
+ */
17
+ export type ContextValue<T = unknown> = variant<"value", T> | variant<"boxed", T>;
18
+ /** Runtime context mapping variable names to their wrapped values */
19
+ export type RuntimeContext = Record<string, ContextValue>;
20
+ /** Determines if a variable requires boxing (mutable + captured) */
21
+ export declare function requiresBoxing(variable: {
22
+ mutable: boolean;
23
+ captured: boolean;
24
+ }): boolean;
25
+ /** Get a context value, throwing InternalError if missing */
26
+ export declare function getContextValue(ctx: RuntimeContext, name: string): ContextValue;
27
+ /** @internal The frozen-mutation error message — identical across the TS, C
28
+ * and Python runtimes (compliance-tested), so a body that mutates a frozen
29
+ * task input fails the same way everywhere. */
30
+ export declare const FROZEN_MESSAGE = "cannot mutate a frozen value (task inputs are immutable) \u2014 copy first";
31
+ /** @internal The error an East call nested too deeply raises — identical
32
+ * across the TS, C and Python runtimes (compliance-tested), so runaway
33
+ * recursion is one catchable East error everywhere rather than a crash. */
34
+ export declare const CALL_DEPTH_MESSAGE = "call stack exhausted: East calls nested too deeply";
35
+ /** @internal The error to throw for `e` at an East call site: JavaScript's
36
+ * stack overflow becomes the East error {@link CALL_DEPTH_MESSAGE} at this
37
+ * call's location, which a program can catch; anything else is thrown as it
38
+ * is. Converting where the overflow is caught may itself overflow — the new
39
+ * `RangeError` then reaches the next call site out, which tries again with
40
+ * more stack. */
41
+ export declare function callDepthErrorAt(e: unknown, loc_id: bigint, source_map: SourceMap | null): unknown;
42
+ /** @internal Track iteration locks to prevent concurrent modification */
43
+ export declare const iterationLocks: WeakMap<any, number>;
44
+ /** @internal Lock a collection for iteration (prevents size/keyset modifications) */
45
+ export declare const lockForIteration: (obj: any) => void;
46
+ /** @internal Unlock a collection after iteration */
47
+ export declare const unlockForIteration: (obj: any) => void;
48
+ /** @internal An exception throw for the purpose of early function return */
49
+ export declare class ReturnException {
50
+ value: any;
51
+ constructor(value: any);
52
+ }
53
+ /** @internal An exception throw for the purpose of early loop continue */
54
+ export declare class ContinueException {
55
+ label: string;
56
+ constructor(label: string);
57
+ }
58
+ /** @internal An exception throw for the purpose of early loop break */
59
+ export declare class BreakException {
60
+ label: string;
61
+ constructor(label: string);
62
+ }
63
+ /** Used to call a compiled function with the given arguments and handle errors within builtin functions */
64
+ export declare function call_function(loc_id: bigint, source_map: SourceMap | null, compiled_f: (...args: any[]) => any, ...args: any[]): any;
65
+ /** @internal The error a node that reads collections throws for `e`: a read a
66
+ * lazy input served that failed becomes an East error at this node's
67
+ * location, where east-c raises it, so a program can catch it; anything else
68
+ * is thrown as it is. */
69
+ export declare function lazyReadErrorAt(e: unknown, loc_id: bigint, source_map: SourceMap | null): unknown;
70
+ /** Builds a builtin's implementation from its node: its location and source map, for
71
+ * its errors, the platform, and its type parameters. */
72
+ export type BuiltinEvaluator = (loc_id: bigint, source_map: SourceMap | null, platformDef: PlatformFunction[], ...arg_types: any[]) => (...args: any[]) => any;
73
+ /** A domain's builtins, keyed by name. */
74
+ export type BuiltinEvaluators = Partial<Record<BuiltinName, BuiltinEvaluator>>;
75
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/compile/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,KAAK,EAAY,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAE,KAAK,aAAa,EAAqB,MAAM,oBAAoB,CAAC;AAM3E,eAAO,MAAM,cAAc,EAAkC,CAAC,IAAI,EAAE,aAAa,KAAK,MAAM,CAAC;AAI7F,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAMtG;;;;GAIG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,OAAO,IAChC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,GACnB,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;AAExB,qEAAqE;AACrE,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AAE1D,oEAAoE;AACpE,wBAAgB,cAAc,CAAC,QAAQ,EAAE;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAEzF;AAED,6DAA6D;AAC7D,wBAAgB,eAAe,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,CAM/E;AAID;;+CAE+C;AA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AAE,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAE/J,0CAA0C;AAC1C,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,114 @@
1
+ import { variant } from "../containers/variant.js";
2
+ import { EastError, InternalError, LazyReadError } from "../error.js";
3
+ import { printFor } from "../serialization/east.js";
4
+ import { EastTypeValueType } from "../type_of_type.js";
5
+ /* The pieces every compiled closure and builtin shares: the context values
6
+ * variables live in, the control-flow exceptions, the iteration locks, and
7
+ * the call into a compiled East function a builtin makes. */
8
+ export const printTypeValue = printFor(EastTypeValueType);
9
+ // The symbols a compiled function value carries live in their own module, so
10
+ // the comparators that read function values need not import the compiler.
11
+ export { EAST_IR_SYMBOL, EAST_CAPTURES_SYMBOL, EAST_SOURCE_MAP_SYMBOL } from "../function_symbols.js";
12
+ /** Determines if a variable requires boxing (mutable + captured) */
13
+ export function requiresBoxing(variable) {
14
+ return variable.mutable && variable.captured;
15
+ }
16
+ /** Get a context value, throwing InternalError if missing */
17
+ export function getContextValue(ctx, name) {
18
+ const value = ctx[name];
19
+ if (value === undefined) {
20
+ throw new InternalError(`Variable '${name}' not found in runtime context`);
21
+ }
22
+ return value;
23
+ }
24
+ // =============================================================================
25
+ /** @internal The frozen-mutation error message — identical across the TS, C
26
+ * and Python runtimes (compliance-tested), so a body that mutates a frozen
27
+ * task input fails the same way everywhere. */
28
+ export const FROZEN_MESSAGE = "cannot mutate a frozen value (task inputs are immutable) — copy first";
29
+ /** @internal The error an East call nested too deeply raises — identical
30
+ * across the TS, C and Python runtimes (compliance-tested), so runaway
31
+ * recursion is one catchable East error everywhere rather than a crash. */
32
+ export const CALL_DEPTH_MESSAGE = "call stack exhausted: East calls nested too deeply";
33
+ /** @internal The error to throw for `e` at an East call site: JavaScript's
34
+ * stack overflow becomes the East error {@link CALL_DEPTH_MESSAGE} at this
35
+ * call's location, which a program can catch; anything else is thrown as it
36
+ * is. Converting where the overflow is caught may itself overflow — the new
37
+ * `RangeError` then reaches the next call site out, which tries again with
38
+ * more stack. */
39
+ export function callDepthErrorAt(e, loc_id, source_map) {
40
+ return e instanceof RangeError && /call stack/i.test(e.message)
41
+ ? new EastError(CALL_DEPTH_MESSAGE, { location: (source_map?.resolve(loc_id) ?? []) })
42
+ : e;
43
+ }
44
+ /** @internal Track iteration locks to prevent concurrent modification */
45
+ export const iterationLocks = new WeakMap();
46
+ /** @internal Lock a collection for iteration (prevents size/keyset modifications) */
47
+ export const lockForIteration = (obj) => {
48
+ iterationLocks.set(obj, (iterationLocks.get(obj) || 0) + 1);
49
+ };
50
+ /** @internal Unlock a collection after iteration */
51
+ export const unlockForIteration = (obj) => {
52
+ const count = iterationLocks.get(obj) || 0;
53
+ if (count > 1) {
54
+ iterationLocks.set(obj, count - 1);
55
+ }
56
+ else {
57
+ iterationLocks.delete(obj);
58
+ }
59
+ };
60
+ /** @internal An exception throw for the purpose of early function return */
61
+ export class ReturnException {
62
+ value;
63
+ constructor(value) {
64
+ this.value = value;
65
+ }
66
+ }
67
+ /** @internal An exception throw for the purpose of early loop continue */
68
+ export class ContinueException {
69
+ label;
70
+ constructor(label) {
71
+ this.label = label;
72
+ }
73
+ }
74
+ /** @internal An exception throw for the purpose of early loop break */
75
+ export class BreakException {
76
+ label;
77
+ constructor(label) {
78
+ this.label = label;
79
+ }
80
+ }
81
+ /** Used to call a compiled function with the given arguments and handle errors within builtin functions */
82
+ export function call_function(loc_id, source_map, compiled_f, ...args) {
83
+ try {
84
+ return compiled_f(...args);
85
+ }
86
+ catch (e) {
87
+ if (e instanceof ReturnException) {
88
+ return e.value;
89
+ }
90
+ else if (e instanceof EastError) {
91
+ // TODO: push loc_id to EastError once SourceMap resolution is wired up
92
+ throw (e);
93
+ }
94
+ else if (e instanceof ContinueException) {
95
+ throw new Error(`continue failed to find label ${e.label} at loc_id ${loc_id}`);
96
+ }
97
+ else if (e instanceof BreakException) {
98
+ throw new Error(`break failed to find label ${e.label} at loc_id ${loc_id}`);
99
+ }
100
+ else {
101
+ throw callDepthErrorAt(e, loc_id, source_map);
102
+ }
103
+ }
104
+ }
105
+ /** @internal The error a node that reads collections throws for `e`: a read a
106
+ * lazy input served that failed becomes an East error at this node's
107
+ * location, where east-c raises it, so a program can catch it; anything else
108
+ * is thrown as it is. */
109
+ export function lazyReadErrorAt(e, loc_id, source_map) {
110
+ return e instanceof LazyReadError
111
+ ? new EastError(e.message, { location: (source_map?.resolve(loc_id) ?? []), cause: e })
112
+ : e;
113
+ }
114
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../../src/compile/runtime.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGtE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAsB,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE3E;;6DAE6D;AAE7D,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC,iBAAiB,CAAoC,CAAC;AAE7F,6EAA6E;AAC7E,0EAA0E;AAC1E,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAkBtG,oEAAoE;AACpE,MAAM,UAAU,cAAc,CAAC,QAAiD;IAC9E,OAAO,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,QAAQ,CAAC;AAC/C,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,eAAe,CAAC,GAAmB,EAAE,IAAY;IAC/D,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;IACxB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,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,MAAc,EAAE,UAA4B;IACtF,OAAO,CAAC,YAAY,aAAa;QAC/B,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAe,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QACrG,CAAC,CAAC,CAAC,CAAC;AACR,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { EastTypeValue } from "../type_of_type.js";
2
+ /** @internal */
3
+ export declare function applyTypeParameters(t: EastTypeValue | string, params: Map<string, EastTypeValue>): EastTypeValue;
4
+ //# sourceMappingURL=type_parameters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type_parameters.d.ts","sourceRoot":"","sources":["../../../src/compile/type_parameters.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,gBAAgB;AAChB,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,aAAa,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,aAAa,CAkChH"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ import { variant } from "../containers/variant.js";
6
+ /** @internal */
7
+ export function applyTypeParameters(t, params) {
8
+ if (typeof (t) === "string") {
9
+ let ret = params.get(t);
10
+ if (ret === undefined) {
11
+ throw new Error(`Unable to find type parameter ${JSON.stringify(t)}`);
12
+ }
13
+ return ret;
14
+ }
15
+ else if (t.type === "Null" || t.type === "Boolean" || t.type === "Integer" || t.type === "Float" || t.type === "String" || t.type === "DateTime" || t.type === "Blob" || t.type === "Never") {
16
+ return t;
17
+ }
18
+ else if (t.type === "Ref") {
19
+ return variant("Ref", applyTypeParameters(t.value, params));
20
+ }
21
+ else if (t.type === "Array") {
22
+ return variant("Array", applyTypeParameters(t.value, params));
23
+ }
24
+ else if (t.type === "Set") {
25
+ return variant("Set", applyTypeParameters(t.value, params));
26
+ }
27
+ else if (t.type === "Dict") {
28
+ return variant("Dict", { key: applyTypeParameters(t.value.key, params), value: applyTypeParameters(t.value.value, params) });
29
+ }
30
+ else if (t.type === "Struct") {
31
+ return variant("Struct", t.value.map(({ name, type }) => ({ name, type: applyTypeParameters(type, params) })));
32
+ }
33
+ else if (t.type === "Variant") {
34
+ return variant("Variant", t.value.map(({ name, type }) => ({ name, type: applyTypeParameters(type, params) })));
35
+ }
36
+ else if (t.type === "Recursive") {
37
+ return t;
38
+ }
39
+ else if (t.type === "Function") {
40
+ return variant("Function", { inputs: t.value.inputs.map(i => applyTypeParameters(i, params)), output: applyTypeParameters(t.value.output, params) });
41
+ }
42
+ else if (t.type === "AsyncFunction") {
43
+ return variant("AsyncFunction", { inputs: t.value.inputs.map(i => applyTypeParameters(i, params)), output: applyTypeParameters(t.value.output, params) });
44
+ }
45
+ else if (t.type === "Vector") {
46
+ return variant("Vector", applyTypeParameters(t.value, params));
47
+ }
48
+ else if (t.type === "Matrix") {
49
+ return variant("Matrix", applyTypeParameters(t.value, params));
50
+ }
51
+ else {
52
+ throw new Error(`Unhandled type ${t.type}`);
53
+ }
54
+ }
55
+ //# sourceMappingURL=type_parameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type_parameters.js","sourceRoot":"","sources":["../../../src/compile/type_parameters.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAGnD,gBAAgB;AAChB,MAAM,UAAU,mBAAmB,CAAC,CAAyB,EAAE,MAAkC;IAC/F,IAAI,OAAM,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC3B,IAAI,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,GAAG,KAAK,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,CAAC,CAAC,EAAE,CAAC,mBAAmB,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAE,CAAC;IAC7J,CAAC;SAAM,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,OAAO,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IACjE,CAAC;SAAM,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,OAAO,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IACjE,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,kBAAoB,CAAoC,CAAC,IAAI,EAAE,CAAC,CAAA;IAClF,CAAC;AACH,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ import { matrix } from "../containers/matrix.js";
6
+ import type { SourceMap } from "../location.js";
7
+ import type { EastTypeValue } from "../type_of_type.js";
8
+ /** Allocates an empty TypedArray of the given length for a given element type */
9
+ export declare function allocateTypedArray(elementType: EastTypeValue, length: number): Float64Array | BigInt64Array | Uint8ClampedArray;
10
+ /** Wraps to East's 64-bit Integer semantics */
11
+ export declare function wrapI64(x: bigint): bigint;
12
+ /** Throws unless the vector/matrix element type parameter is Float or Integer */
13
+ export declare function requireNumericElem(builtin: string, T: EastTypeValue, loc_id: bigint, source_map: SourceMap | null): "Float" | "Integer";
14
+ /** Throws the shared length-mismatch error for elementwise vector operands */
15
+ export declare function requireSameLength(a: {
16
+ length: number;
17
+ }, b: {
18
+ length: number;
19
+ }, loc_id: bigint, source_map: SourceMap | null): void;
20
+ /** Throws the shared dimension-mismatch error for elementwise matrix operands */
21
+ export declare function requireSameDims(a: matrix, b: matrix, loc_id: bigint, source_map: SourceMap | null): void;
22
+ /** Validates the sparse-accumulator invariant: parallel lengths and strictly ascending indices */
23
+ export declare function requireSparse(ix: BigInt64Array, v: {
24
+ length: number;
25
+ }, loc_id: bigint, source_map: SourceMap | null): void;
26
+ /** Creates the appropriate TypedArray for a given element type */
27
+ export declare function createTypedArray(elementType: EastTypeValue, values: any[]): Float64Array | BigInt64Array | Uint8ClampedArray;
28
+ //# sourceMappingURL=typed_arrays.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typed_arrays.d.ts","sourceRoot":"","sources":["../../../src/compile/typed_arrays.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,OAAO,KAAK,EAAY,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKxD,iFAAiF;AACjF,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,aAAa,GAAG,iBAAiB,CAK/H;AAED,+CAA+C;AAC/C,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED,iFAAiF;AACjF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,CAKvI;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,CAAC,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,CAAC,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAIlI;AAED,iFAAiF;AACjF,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAIxG;AAED,kGAAkG;AAClG,wBAAgB,aAAa,CAAC,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAS1H;AAED,kEAAkE;AAClE,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,GAAG,aAAa,GAAG,iBAAiB,CAgB5H"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ import { matrix } from "../containers/matrix.js";
6
+ import { EastError } from "../error.js";
7
+ /* The TypedArray storage Vector and Matrix values use, and the checks their
8
+ * builtins share. */
9
+ /** Allocates an empty TypedArray of the given length for a given element type */
10
+ export function allocateTypedArray(elementType, length) {
11
+ if (elementType.type === "Float")
12
+ return new Float64Array(length);
13
+ if (elementType.type === "Integer")
14
+ return new BigInt64Array(length);
15
+ if (elementType.type === "Boolean")
16
+ return new Uint8ClampedArray(length);
17
+ throw new Error(`Unsupported vector element type: ${elementType.type}`);
18
+ }
19
+ /** Wraps to East's 64-bit Integer semantics */
20
+ export function wrapI64(x) {
21
+ return BigInt.asIntN(64, x);
22
+ }
23
+ /** Throws unless the vector/matrix element type parameter is Float or Integer */
24
+ export function requireNumericElem(builtin, T, loc_id, source_map) {
25
+ if (T.type !== "Float" && T.type !== "Integer") {
26
+ throw new EastError(`${builtin} requires Float or Integer elements`, { location: (source_map?.resolve(loc_id) ?? []) });
27
+ }
28
+ return T.type;
29
+ }
30
+ /** Throws the shared length-mismatch error for elementwise vector operands */
31
+ export function requireSameLength(a, b, loc_id, source_map) {
32
+ if (a.length !== b.length) {
33
+ throw new EastError(`Vector length mismatch (${a.length} vs ${b.length})`, { location: (source_map?.resolve(loc_id) ?? []) });
34
+ }
35
+ }
36
+ /** Throws the shared dimension-mismatch error for elementwise matrix operands */
37
+ export function requireSameDims(a, b, loc_id, source_map) {
38
+ if (a.rows !== b.rows || a.cols !== b.cols) {
39
+ throw new EastError(`Matrix dimension mismatch (${a.rows}x${a.cols} vs ${b.rows}x${b.cols})`, { location: (source_map?.resolve(loc_id) ?? []) });
40
+ }
41
+ }
42
+ /** Validates the sparse-accumulator invariant: parallel lengths and strictly ascending indices */
43
+ export function requireSparse(ix, v, loc_id, source_map) {
44
+ if (ix.length !== v.length) {
45
+ throw new EastError(`Sparse index and value lengths differ (${ix.length} vs ${v.length})`, { location: (source_map?.resolve(loc_id) ?? []) });
46
+ }
47
+ for (let i = 1; i < ix.length; i++) {
48
+ if (ix[i] <= ix[i - 1]) {
49
+ throw new EastError(`Sparse index vector must be strictly ascending`, { location: (source_map?.resolve(loc_id) ?? []) });
50
+ }
51
+ }
52
+ }
53
+ /** Creates the appropriate TypedArray for a given element type */
54
+ export function createTypedArray(elementType, values) {
55
+ if (elementType.type === "Float") {
56
+ const arr = new Float64Array(values.length);
57
+ for (let i = 0; i < values.length; i++)
58
+ arr[i] = values[i];
59
+ return arr;
60
+ }
61
+ else if (elementType.type === "Integer") {
62
+ const arr = new BigInt64Array(values.length);
63
+ for (let i = 0; i < values.length; i++)
64
+ arr[i] = values[i];
65
+ return arr;
66
+ }
67
+ else if (elementType.type === "Boolean") {
68
+ const arr = new Uint8ClampedArray(values.length);
69
+ for (let i = 0; i < values.length; i++)
70
+ arr[i] = values[i] ? 1 : 0;
71
+ return arr;
72
+ }
73
+ else {
74
+ throw new Error(`Unsupported vector element type: ${elementType.type}`);
75
+ }
76
+ }
77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