solve-engine 1.1.1 → 2.0.0

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 (395) hide show
  1. package/README.md +12 -17
  2. package/dist/{BytecodeBuilder-Bp9xeTmX.d.cts → BytecodeBuilder-DGGeByAP.d.cts} +18 -0
  3. package/dist/{BytecodeBuilder-Bp9xeTmX.d.ts → BytecodeBuilder-DGGeByAP.d.ts} +18 -0
  4. package/dist/{Configuration-C9W8tJv_.d.cts → Configuration-B6W0-T67.d.cts} +17 -4
  5. package/dist/{Configuration-C9W8tJv_.d.ts → Configuration-B6W0-T67.d.ts} +17 -4
  6. package/dist/{EngineError-B61GS1jp.d.cts → EngineError-Ce1lPkjZ.d.cts} +8 -0
  7. package/dist/{EngineError-B61GS1jp.d.ts → EngineError-Ce1lPkjZ.d.ts} +8 -0
  8. package/dist/{Lexer-BOs7euZe.d.cts → Lexer-B4C1qHXu.d.cts} +1 -1
  9. package/dist/{Lexer-CSI_lwbW.d.ts → Lexer-DKMlj7Sy.d.ts} +1 -1
  10. package/dist/{PackageCompatibility-B-7rK1TD.d.cts → PackageCompatibility-Bn5jnBtA.d.cts} +2 -2
  11. package/dist/{PackageCompatibility-Dh59eF-X.d.ts → PackageCompatibility-CIvq2MP5.d.ts} +2 -2
  12. package/dist/{PackageRegistry-_8rDlvxI.d.ts → PackageRegistry-DzeiWcv4.d.ts} +143 -175
  13. package/dist/{PackageRegistry-BHWJP83F.d.cts → PackageRegistry-dpdurBVO.d.cts} +143 -175
  14. package/dist/{Parselet-BBT8riYh.d.ts → Parselet-B-zoPrTa.d.ts} +9 -6
  15. package/dist/{Parselet-BHcgK9S7.d.cts → Parselet-C4Wu055_.d.cts} +9 -6
  16. package/dist/{ScopeManager-CxA24W5n.d.ts → ScopeManager-C2LDOrDx.d.ts} +14 -16
  17. package/dist/{ScopeManager-8vf02dwj.d.cts → ScopeManager-D7uMXbhS.d.cts} +14 -16
  18. package/dist/{Token-B1hdkedD.d.cts → Token-CbP_OutD.d.cts} +9 -0
  19. package/dist/{Token-B1hdkedD.d.ts → Token-CbP_OutD.d.ts} +9 -0
  20. package/dist/{TokenNormalizer-C6VzZgHa.d.ts → TokenNormalizer-DCWdZjGz.d.ts} +1 -1
  21. package/dist/{TokenNormalizer-DRc1Js1V.d.cts → TokenNormalizer-DnlL7_8c.d.cts} +1 -1
  22. package/dist/{VMCheckpoints-MK--EBH2.d.ts → VMCheckpoints-CGyFhivM.d.ts} +3 -3
  23. package/dist/{VMCheckpoints-ELYqITdF.d.cts → VMCheckpoints-I9jg3jWR.d.cts} +3 -3
  24. package/dist/{Value-BUi1RA3S.d.cts → Value-CCi_Eecs.d.cts} +72 -5
  25. package/dist/{Value-BUi1RA3S.d.ts → Value-CCi_Eecs.d.ts} +72 -5
  26. package/dist/{WorkerError-gzmaopj2.d.cts → WorkerError-B4p6PNfx.d.cts} +1 -1
  27. package/dist/{WorkerError-_-RkoQ5P.d.ts → WorkerError-Dhj9BQ_A.d.ts} +1 -1
  28. package/dist/chunk-2JMFUQZH.js +2 -0
  29. package/dist/chunk-2JMFUQZH.js.map +1 -0
  30. package/dist/chunk-2RWAXT6O.js +0 -1
  31. package/dist/chunk-4BZIYU7S.cjs +3 -0
  32. package/dist/chunk-4BZIYU7S.cjs.map +1 -0
  33. package/dist/chunk-4J7XZSZJ.cjs +5 -0
  34. package/dist/chunk-4J7XZSZJ.cjs.map +1 -0
  35. package/dist/chunk-4QVBSG6B.cjs +2 -0
  36. package/dist/chunk-4QVBSG6B.cjs.map +1 -0
  37. package/dist/chunk-5IJD5L3O.cjs +2 -0
  38. package/dist/chunk-5IJD5L3O.cjs.map +1 -0
  39. package/dist/chunk-62LMTO4F.js +2 -0
  40. package/dist/chunk-62LMTO4F.js.map +1 -0
  41. package/dist/chunk-6CY44ZPG.js +2 -0
  42. package/dist/chunk-6CY44ZPG.js.map +1 -0
  43. package/dist/chunk-6G3PMEPA.js +2 -0
  44. package/dist/chunk-6G3PMEPA.js.map +1 -0
  45. package/dist/chunk-6INX773F.cjs +2 -0
  46. package/dist/chunk-6INX773F.cjs.map +1 -0
  47. package/dist/chunk-6KFVG6UY.cjs +2 -0
  48. package/dist/chunk-6KFVG6UY.cjs.map +1 -0
  49. package/dist/chunk-76F3LCIL.js +4 -0
  50. package/dist/chunk-76F3LCIL.js.map +1 -0
  51. package/dist/chunk-7GK3XEZF.js +2 -0
  52. package/dist/chunk-7GK3XEZF.js.map +1 -0
  53. package/dist/chunk-APN442VD.cjs +2 -0
  54. package/dist/chunk-APN442VD.cjs.map +1 -0
  55. package/dist/chunk-AXMQG5TS.cjs +2 -0
  56. package/dist/chunk-AXMQG5TS.cjs.map +1 -0
  57. package/dist/chunk-CIQOK7Q4.cjs +2 -0
  58. package/dist/chunk-CIQOK7Q4.cjs.map +1 -0
  59. package/dist/chunk-E6Z4NQAS.js +2 -0
  60. package/dist/chunk-E6Z4NQAS.js.map +1 -0
  61. package/dist/chunk-EFJCC6FJ.cjs +2 -0
  62. package/dist/chunk-EFJCC6FJ.cjs.map +1 -0
  63. package/dist/chunk-ESUN2THE.cjs +2 -0
  64. package/dist/chunk-ESUN2THE.cjs.map +1 -0
  65. package/dist/chunk-EVAOPEO4.js +2 -0
  66. package/dist/chunk-EVAOPEO4.js.map +1 -0
  67. package/dist/chunk-EYRBENHC.js +3 -0
  68. package/dist/chunk-EYRBENHC.js.map +1 -0
  69. package/dist/chunk-FDE5HWDI.cjs +2 -0
  70. package/dist/chunk-FDE5HWDI.cjs.map +1 -0
  71. package/dist/chunk-FWW3M36J.cjs +2 -0
  72. package/dist/chunk-FWW3M36J.cjs.map +1 -0
  73. package/dist/chunk-GOIQYUWV.js +2 -0
  74. package/dist/chunk-GOIQYUWV.js.map +1 -0
  75. package/dist/chunk-HFKDWQUL.js +2 -0
  76. package/dist/chunk-HFKDWQUL.js.map +1 -0
  77. package/dist/chunk-HLBYHXQD.cjs +3 -0
  78. package/dist/chunk-HLBYHXQD.cjs.map +1 -0
  79. package/dist/chunk-IANAMBJQ.cjs +2 -0
  80. package/dist/chunk-IANAMBJQ.cjs.map +1 -0
  81. package/dist/chunk-IJMNVBIS.js +2 -0
  82. package/dist/chunk-IJMNVBIS.js.map +1 -0
  83. package/dist/chunk-J4LZD4ZY.js +3 -0
  84. package/dist/chunk-J4LZD4ZY.js.map +1 -0
  85. package/dist/chunk-JAK3RAFA.cjs +2 -0
  86. package/dist/chunk-JAK3RAFA.cjs.map +1 -0
  87. package/dist/chunk-JFAJN3C2.cjs +2 -0
  88. package/dist/chunk-JFAJN3C2.cjs.map +1 -0
  89. package/dist/chunk-JPFCXLJV.js +2 -0
  90. package/dist/chunk-JPFCXLJV.js.map +1 -0
  91. package/dist/chunk-JSPKKNPQ.js +3 -0
  92. package/dist/chunk-JSPKKNPQ.js.map +1 -0
  93. package/dist/chunk-L3FPQSGN.js +2 -0
  94. package/dist/chunk-L3FPQSGN.js.map +1 -0
  95. package/dist/chunk-LR4E4A4W.cjs +2 -0
  96. package/dist/chunk-LR4E4A4W.cjs.map +1 -0
  97. package/dist/chunk-MIQBJGGR.js +2 -0
  98. package/dist/chunk-MIQBJGGR.js.map +1 -0
  99. package/dist/chunk-MPB7KUN5.js +3 -0
  100. package/dist/chunk-MPB7KUN5.js.map +1 -0
  101. package/dist/chunk-MSYX32PF.cjs +2 -0
  102. package/dist/chunk-MSYX32PF.cjs.map +1 -0
  103. package/dist/chunk-MVZUTETT.js +2 -0
  104. package/dist/chunk-MVZUTETT.js.map +1 -0
  105. package/dist/chunk-N7N7MPMK.cjs +2 -0
  106. package/dist/chunk-N7N7MPMK.cjs.map +1 -0
  107. package/dist/chunk-NGBBNL4K.cjs +1 -3
  108. package/dist/chunk-P6WPEUAJ.cjs +2 -0
  109. package/dist/chunk-P6WPEUAJ.cjs.map +1 -0
  110. package/dist/chunk-PS272DZJ.cjs +2 -0
  111. package/dist/chunk-PS272DZJ.cjs.map +1 -0
  112. package/dist/chunk-QXQE7X4S.js +2 -0
  113. package/dist/chunk-QXQE7X4S.js.map +1 -0
  114. package/dist/chunk-R2ENWQ76.js +2 -0
  115. package/dist/chunk-R2ENWQ76.js.map +1 -0
  116. package/dist/chunk-R2SZFJTT.cjs +2 -0
  117. package/dist/chunk-R2SZFJTT.cjs.map +1 -0
  118. package/dist/chunk-RAF57WYO.js +2 -0
  119. package/dist/chunk-RAF57WYO.js.map +1 -0
  120. package/dist/chunk-RSF25YSJ.js +2 -0
  121. package/dist/chunk-RSF25YSJ.js.map +1 -0
  122. package/dist/chunk-SOMGSIO4.cjs +3 -0
  123. package/dist/chunk-SOMGSIO4.cjs.map +1 -0
  124. package/dist/chunk-SUXRZWH2.cjs +3 -0
  125. package/dist/chunk-SUXRZWH2.cjs.map +1 -0
  126. package/dist/chunk-SYYE3QAX.cjs +2 -0
  127. package/dist/chunk-SYYE3QAX.cjs.map +1 -0
  128. package/dist/chunk-SZGK6RIP.cjs +2 -0
  129. package/dist/chunk-SZGK6RIP.cjs.map +1 -0
  130. package/dist/chunk-TCZSPH4A.js +2 -0
  131. package/dist/chunk-TCZSPH4A.js.map +1 -0
  132. package/dist/chunk-TLG7VZRX.cjs +2 -0
  133. package/dist/chunk-TLG7VZRX.cjs.map +1 -0
  134. package/dist/chunk-TRBXW6HW.js +2 -0
  135. package/dist/{chunk-AQNHHJMJ.cjs.map → chunk-TRBXW6HW.js.map} +1 -1
  136. package/dist/chunk-TTFO4YDP.cjs +2 -0
  137. package/dist/chunk-TTFO4YDP.cjs.map +1 -0
  138. package/dist/chunk-TWC7K3ZX.js +2 -0
  139. package/dist/chunk-TWC7K3ZX.js.map +1 -0
  140. package/dist/chunk-UDQ57ZRX.cjs +2 -0
  141. package/dist/chunk-UDQ57ZRX.cjs.map +1 -0
  142. package/dist/chunk-UI6IFGBT.js +2 -0
  143. package/dist/chunk-UI6IFGBT.js.map +1 -0
  144. package/dist/chunk-UURM7P3P.cjs +4 -0
  145. package/dist/chunk-UURM7P3P.cjs.map +1 -0
  146. package/dist/chunk-W2JAR233.js +2 -0
  147. package/dist/chunk-W2JAR233.js.map +1 -0
  148. package/dist/chunk-WGZ3FNHI.js +2 -0
  149. package/dist/chunk-WGZ3FNHI.js.map +1 -0
  150. package/dist/chunk-WN5CMP4T.cjs +3 -0
  151. package/dist/chunk-WN5CMP4T.cjs.map +1 -0
  152. package/dist/chunk-XEIDV5JP.js +2 -0
  153. package/dist/chunk-XEIDV5JP.js.map +1 -0
  154. package/dist/chunk-XNIWQHXY.js +2 -0
  155. package/dist/chunk-XNIWQHXY.js.map +1 -0
  156. package/dist/chunk-XR7HEC7B.js +5 -0
  157. package/dist/chunk-XR7HEC7B.js.map +1 -0
  158. package/dist/chunk-Y7O4D3BJ.cjs +2 -0
  159. package/dist/chunk-Y7O4D3BJ.cjs.map +1 -0
  160. package/dist/chunk-YAYBVVG2.js +3 -0
  161. package/dist/chunk-YAYBVVG2.js.map +1 -0
  162. package/dist/chunk-YJ2OPULK.js +2 -0
  163. package/dist/chunk-YJ2OPULK.js.map +1 -0
  164. package/dist/chunk-YVKHEAFT.js +2 -0
  165. package/dist/chunk-YVKHEAFT.js.map +1 -0
  166. package/dist/chunk-ZCNBT44X.cjs +2 -0
  167. package/dist/chunk-ZCNBT44X.cjs.map +1 -0
  168. package/dist/chunk-ZLRJ7TDP.cjs +2 -0
  169. package/dist/chunk-ZLRJ7TDP.cjs.map +1 -0
  170. package/dist/constants.cjs +1 -21
  171. package/dist/constants.d.cts +1 -1
  172. package/dist/constants.d.ts +1 -1
  173. package/dist/constants.js +1 -4
  174. package/dist/engine.cjs +1 -94
  175. package/dist/engine.d.cts +29 -14
  176. package/dist/engine.d.ts +29 -14
  177. package/dist/engine.js +1 -37
  178. package/dist/errors.cjs +1 -105
  179. package/dist/errors.d.cts +3 -3
  180. package/dist/errors.d.ts +3 -3
  181. package/dist/errors.js +1 -4
  182. package/dist/format.cjs +1 -26
  183. package/dist/format.d.cts +2 -2
  184. package/dist/format.d.ts +2 -2
  185. package/dist/format.js +1 -9
  186. package/dist/index.cjs +1 -314
  187. package/dist/index.cjs.map +1 -1
  188. package/dist/index.d.cts +55 -23
  189. package/dist/index.d.ts +55 -23
  190. package/dist/index.js +1 -278
  191. package/dist/index.js.map +1 -1
  192. package/dist/language.cjs +1 -369
  193. package/dist/language.cjs.map +1 -1
  194. package/dist/language.d.cts +12 -13
  195. package/dist/language.d.ts +12 -13
  196. package/dist/language.js +1 -348
  197. package/dist/language.js.map +1 -1
  198. package/dist/lexer.cjs +1 -63
  199. package/dist/lexer.d.cts +3 -3
  200. package/dist/lexer.d.ts +3 -3
  201. package/dist/lexer.js +1 -10
  202. package/dist/normalizer.cjs +1 -39
  203. package/dist/normalizer.d.cts +3 -3
  204. package/dist/normalizer.d.ts +3 -3
  205. package/dist/normalizer.js +1 -10
  206. package/dist/packages.cjs +1 -128
  207. package/dist/packages.d.cts +39 -14
  208. package/dist/packages.d.ts +39 -14
  209. package/dist/packages.js +1 -23
  210. package/dist/parser.cjs +1 -54
  211. package/dist/parser.d.cts +9 -9
  212. package/dist/parser.d.ts +9 -9
  213. package/dist/parser.js +1 -9
  214. package/dist/{pipeline-CtfJtPQc.d.cts → pipeline-72QmQlGx.d.ts} +3 -3
  215. package/dist/{pipeline-DCd5M6Gk.d.ts → pipeline-DCQicwWX.d.cts} +3 -3
  216. package/dist/resolvers.cjs +1 -12
  217. package/dist/resolvers.d.cts +3 -3
  218. package/dist/resolvers.d.ts +3 -3
  219. package/dist/resolvers.js +1 -3
  220. package/dist/services.cjs +1 -20
  221. package/dist/services.js +1 -3
  222. package/dist/testing.cjs +3 -477
  223. package/dist/testing.cjs.map +1 -1
  224. package/dist/testing.d.cts +12 -13
  225. package/dist/testing.d.ts +12 -13
  226. package/dist/testing.js +3 -469
  227. package/dist/testing.js.map +1 -1
  228. package/dist/uom.cjs +1 -55
  229. package/dist/uom.d.cts +3 -3
  230. package/dist/uom.d.ts +3 -3
  231. package/dist/uom.js +1 -10
  232. package/dist/utilities.cjs +1 -36
  233. package/dist/utilities.js +1 -7
  234. package/dist/vm.cjs +1 -295
  235. package/dist/vm.cjs.map +1 -1
  236. package/dist/vm.d.cts +22 -10
  237. package/dist/vm.d.ts +22 -10
  238. package/dist/vm.js +1 -193
  239. package/dist/vm.js.map +1 -1
  240. package/dist/worker.cjs +2 -492
  241. package/dist/worker.cjs.map +1 -1
  242. package/dist/worker.d.cts +19 -20
  243. package/dist/worker.d.ts +19 -20
  244. package/dist/worker.js +2 -483
  245. package/dist/worker.js.map +1 -1
  246. package/package.json +1 -13
  247. package/dist/chunk-267JPOTF.js +0 -406
  248. package/dist/chunk-267JPOTF.js.map +0 -1
  249. package/dist/chunk-2TZKENDH.cjs +0 -448
  250. package/dist/chunk-2TZKENDH.cjs.map +0 -1
  251. package/dist/chunk-3BOK2LDK.js +0 -17
  252. package/dist/chunk-3BOK2LDK.js.map +0 -1
  253. package/dist/chunk-3OWCDIPN.js +0 -215
  254. package/dist/chunk-3OWCDIPN.js.map +0 -1
  255. package/dist/chunk-3VGDNEE3.js +0 -84
  256. package/dist/chunk-3VGDNEE3.js.map +0 -1
  257. package/dist/chunk-4D6NIHE2.js +0 -451
  258. package/dist/chunk-4D6NIHE2.js.map +0 -1
  259. package/dist/chunk-4HQKTMWG.js +0 -7985
  260. package/dist/chunk-4HQKTMWG.js.map +0 -1
  261. package/dist/chunk-536WPM2V.cjs +0 -283
  262. package/dist/chunk-536WPM2V.cjs.map +0 -1
  263. package/dist/chunk-5HRB36DK.js +0 -405
  264. package/dist/chunk-5HRB36DK.js.map +0 -1
  265. package/dist/chunk-5ON7PUAZ.js +0 -12
  266. package/dist/chunk-5ON7PUAZ.js.map +0 -1
  267. package/dist/chunk-7KYSUDQO.js +0 -109
  268. package/dist/chunk-7KYSUDQO.js.map +0 -1
  269. package/dist/chunk-7ZX6B7SY.cjs +0 -3222
  270. package/dist/chunk-7ZX6B7SY.cjs.map +0 -1
  271. package/dist/chunk-ADBA3XBE.cjs +0 -20
  272. package/dist/chunk-ADBA3XBE.cjs.map +0 -1
  273. package/dist/chunk-ALYRJ72W.cjs +0 -434
  274. package/dist/chunk-ALYRJ72W.cjs.map +0 -1
  275. package/dist/chunk-AMOJYLG2.cjs +0 -1692
  276. package/dist/chunk-AMOJYLG2.cjs.map +0 -1
  277. package/dist/chunk-AQNHHJMJ.cjs +0 -261
  278. package/dist/chunk-B4HBEFTB.cjs +0 -375
  279. package/dist/chunk-B4HBEFTB.cjs.map +0 -1
  280. package/dist/chunk-B7LXJ6LC.cjs +0 -36
  281. package/dist/chunk-B7LXJ6LC.cjs.map +0 -1
  282. package/dist/chunk-B7NLZMQ3.cjs +0 -74
  283. package/dist/chunk-B7NLZMQ3.cjs.map +0 -1
  284. package/dist/chunk-BLI4NIQY.js +0 -98
  285. package/dist/chunk-BLI4NIQY.js.map +0 -1
  286. package/dist/chunk-BYJBUL7U.js +0 -499
  287. package/dist/chunk-BYJBUL7U.js.map +0 -1
  288. package/dist/chunk-CCBZZQAE.js +0 -312
  289. package/dist/chunk-CCBZZQAE.js.map +0 -1
  290. package/dist/chunk-CKQMXMHR.cjs +0 -219
  291. package/dist/chunk-CKQMXMHR.cjs.map +0 -1
  292. package/dist/chunk-CUR2WLI4.cjs +0 -507
  293. package/dist/chunk-CUR2WLI4.cjs.map +0 -1
  294. package/dist/chunk-DLEBSLF4.js +0 -336
  295. package/dist/chunk-DLEBSLF4.js.map +0 -1
  296. package/dist/chunk-E23GZEWL.cjs +0 -209
  297. package/dist/chunk-E23GZEWL.cjs.map +0 -1
  298. package/dist/chunk-EJ3ILXX6.cjs +0 -223
  299. package/dist/chunk-EJ3ILXX6.cjs.map +0 -1
  300. package/dist/chunk-ENKKJYD3.js +0 -333
  301. package/dist/chunk-ENKKJYD3.js.map +0 -1
  302. package/dist/chunk-ENRIK36Q.cjs +0 -94
  303. package/dist/chunk-ENRIK36Q.cjs.map +0 -1
  304. package/dist/chunk-ERCOHGXD.js +0 -356
  305. package/dist/chunk-ERCOHGXD.js.map +0 -1
  306. package/dist/chunk-FD5ZZHEU.js +0 -92
  307. package/dist/chunk-FD5ZZHEU.js.map +0 -1
  308. package/dist/chunk-FEAIOR7N.cjs +0 -91
  309. package/dist/chunk-FEAIOR7N.cjs.map +0 -1
  310. package/dist/chunk-GCM5JHMX.js +0 -88
  311. package/dist/chunk-GCM5JHMX.js.map +0 -1
  312. package/dist/chunk-GLA4JXBO.js +0 -204
  313. package/dist/chunk-GLA4JXBO.js.map +0 -1
  314. package/dist/chunk-HIQ5HSZL.cjs +0 -1923
  315. package/dist/chunk-HIQ5HSZL.cjs.map +0 -1
  316. package/dist/chunk-HVRVSI2Z.cjs +0 -829
  317. package/dist/chunk-HVRVSI2Z.cjs.map +0 -1
  318. package/dist/chunk-I4GAWIPW.js +0 -825
  319. package/dist/chunk-I4GAWIPW.js.map +0 -1
  320. package/dist/chunk-J45BCEZ4.cjs +0 -339
  321. package/dist/chunk-J45BCEZ4.cjs.map +0 -1
  322. package/dist/chunk-JG6ZJ2WU.js +0 -1513
  323. package/dist/chunk-JG6ZJ2WU.js.map +0 -1
  324. package/dist/chunk-L2TE7PMO.cjs +0 -14
  325. package/dist/chunk-L2TE7PMO.cjs.map +0 -1
  326. package/dist/chunk-LHZ6VOA7.js +0 -1764
  327. package/dist/chunk-LHZ6VOA7.js.map +0 -1
  328. package/dist/chunk-MN3LHRGV.cjs +0 -8012
  329. package/dist/chunk-MN3LHRGV.cjs.map +0 -1
  330. package/dist/chunk-MVTOCRV2.js +0 -213
  331. package/dist/chunk-MVTOCRV2.js.map +0 -1
  332. package/dist/chunk-N5NNW4VG.cjs +0 -341
  333. package/dist/chunk-N5NNW4VG.cjs.map +0 -1
  334. package/dist/chunk-N7FNVFXW.cjs +0 -32
  335. package/dist/chunk-N7FNVFXW.cjs.map +0 -1
  336. package/dist/chunk-NKW7LKYU.js +0 -3185
  337. package/dist/chunk-NKW7LKYU.js.map +0 -1
  338. package/dist/chunk-NLNDMWZC.js +0 -31
  339. package/dist/chunk-NLNDMWZC.js.map +0 -1
  340. package/dist/chunk-NNQ2TYDF.js +0 -1848
  341. package/dist/chunk-NNQ2TYDF.js.map +0 -1
  342. package/dist/chunk-NNZAEUDW.js +0 -6792
  343. package/dist/chunk-NNZAEUDW.js.map +0 -1
  344. package/dist/chunk-OUHT5Z36.cjs +0 -393
  345. package/dist/chunk-OUHT5Z36.cjs.map +0 -1
  346. package/dist/chunk-QFTDTX6K.cjs +0 -457
  347. package/dist/chunk-QFTDTX6K.cjs.map +0 -1
  348. package/dist/chunk-SBUFNJVE.js +0 -258
  349. package/dist/chunk-SBUFNJVE.js.map +0 -1
  350. package/dist/chunk-SRGQ72IR.cjs +0 -2800
  351. package/dist/chunk-SRGQ72IR.cjs.map +0 -1
  352. package/dist/chunk-SSV46KFA.cjs +0 -112
  353. package/dist/chunk-SSV46KFA.cjs.map +0 -1
  354. package/dist/chunk-T6ZYQJ63.cjs +0 -6807
  355. package/dist/chunk-T6ZYQJ63.cjs.map +0 -1
  356. package/dist/chunk-UKQHXPGW.js +0 -30
  357. package/dist/chunk-UKQHXPGW.js.map +0 -1
  358. package/dist/chunk-UO6BUV6K.js +0 -278
  359. package/dist/chunk-UO6BUV6K.js.map +0 -1
  360. package/dist/chunk-V4XG5QF6.js +0 -1685
  361. package/dist/chunk-V4XG5QF6.js.map +0 -1
  362. package/dist/chunk-VEKIWQ3F.cjs +0 -39
  363. package/dist/chunk-VEKIWQ3F.cjs.map +0 -1
  364. package/dist/chunk-WWQEY7BV.js +0 -67
  365. package/dist/chunk-WWQEY7BV.js.map +0 -1
  366. package/dist/chunk-WXEHD6TT.js +0 -2795
  367. package/dist/chunk-WXEHD6TT.js.map +0 -1
  368. package/dist/chunk-X6K3HUOY.cjs +0 -86
  369. package/dist/chunk-X6K3HUOY.cjs.map +0 -1
  370. package/dist/chunk-XA4CKRML.cjs +0 -316
  371. package/dist/chunk-XA4CKRML.cjs.map +0 -1
  372. package/dist/chunk-XBTEO4OB.js +0 -391
  373. package/dist/chunk-XBTEO4OB.js.map +0 -1
  374. package/dist/chunk-XIYYHA65.cjs +0 -101
  375. package/dist/chunk-XIYYHA65.cjs.map +0 -1
  376. package/dist/chunk-YLJ4XMA6.js +0 -33
  377. package/dist/chunk-YLJ4XMA6.js.map +0 -1
  378. package/dist/chunk-YRIKITGF.cjs +0 -1768
  379. package/dist/chunk-YRIKITGF.cjs.map +0 -1
  380. package/dist/chunk-Z2XP767T.cjs +0 -35
  381. package/dist/chunk-Z2XP767T.cjs.map +0 -1
  382. package/dist/chunk-Z4X2RWOF.js +0 -37
  383. package/dist/chunk-Z4X2RWOF.js.map +0 -1
  384. package/dist/chunk-Z7XGGLI2.js +0 -455
  385. package/dist/chunk-Z7XGGLI2.js.map +0 -1
  386. package/dist/chunk-ZMW6NU2K.cjs +0 -1516
  387. package/dist/chunk-ZMW6NU2K.cjs.map +0 -1
  388. package/dist/chunk-ZVTWQLK4.cjs +0 -459
  389. package/dist/chunk-ZVTWQLK4.cjs.map +0 -1
  390. package/dist/variables.cjs +0 -17
  391. package/dist/variables.cjs.map +0 -1
  392. package/dist/variables.d.cts +0 -87
  393. package/dist/variables.d.ts +0 -87
  394. package/dist/variables.js +0 -4
  395. package/dist/variables.js.map +0 -1
@@ -1,16 +1,15 @@
1
- import { a as PrecedenceParser, b as PrefixParselet, I as InfixParselet } from './Parselet-BHcgK9S7.cjs';
2
- import { V as Value, b as ValueType } from './Value-BUi1RA3S.cjs';
3
- import { IVariableSource } from './variables.cjs';
4
- import { M as MarkdownLineType, L as Lexer, e as TokenCategory, c as LexerVocabulary } from './Lexer-BOs7euZe.cjs';
1
+ import { a as PrecedenceParser, b as PrefixParselet, I as InfixParselet } from './Parselet-C4Wu055_.cjs';
2
+ import { V as Value, b as ValueType } from './Value-CCi_Eecs.cjs';
3
+ import { M as MarkdownLineType, L as Lexer, e as TokenCategory, c as LexerVocabulary } from './Lexer-B4C1qHXu.cjs';
5
4
  import { IAsyncResolver } from './resolvers.cjs';
6
- import { T as TokenFusion, c as TokenNormalizer, a as NormalizerRule } from './TokenNormalizer-DRc1Js1V.cjs';
7
- import { a as DependencyGraph, V as VM, D as DagSnapshot, b as EngineContext, S as ScopeManager, L as LineExecutionContext } from './ScopeManager-8vf02dwj.cjs';
8
- import { a as BytecodeProgram } from './BytecodeBuilder-Bp9xeTmX.cjs';
5
+ import { T as TokenFusion, c as TokenNormalizer, a as NormalizerRule } from './TokenNormalizer-DnlL7_8c.cjs';
6
+ import { a as DependencyGraph, V as VM, D as DagSnapshot, b as EngineContext, S as ScopeManager, P as PluginFunctionHandler } from './ScopeManager-D7uMXbhS.cjs';
7
+ import { a as BytecodeProgram } from './BytecodeBuilder-DGGeByAP.cjs';
9
8
  import { QueryClient } from '@tanstack/query-core';
10
- import { E as EngineError } from './EngineError-B61GS1jp.cjs';
11
- import { a as DiagnosticReportJSON, D as DiagnosticPipeline } from './pipeline-CtfJtPQc.cjs';
12
- import { T as Token } from './Token-B1hdkedD.cjs';
13
- import { D as DEFAULT_CONFIG, E as EngineConfig } from './Configuration-C9W8tJv_.cjs';
9
+ import { E as EngineError } from './EngineError-Ce1lPkjZ.cjs';
10
+ import { a as DiagnosticReportJSON, D as DiagnosticPipeline } from './pipeline-DCQicwWX.cjs';
11
+ import { T as Token } from './Token-CbP_OutD.cjs';
12
+ import { E as EngineConfigOverride, a as EngineConfig } from './Configuration-B6W0-T67.cjs';
14
13
 
15
14
  /**
16
15
  * One line's compiled bytecode, plus the variables it reads and writes.
@@ -1444,15 +1443,16 @@ interface EngineRestoreOptions {
1444
1443
  * Packages to register on the restored engine. This MUST be the same set
1445
1444
  * the snapshot was taken with: a snapshot carries compiled bytecode whose
1446
1445
  * plugin-function indices and parselet-produced opcodes only line up
1447
- * against the packages that were present when it was written. Defaults to
1448
- * {@link BUILTIN_PACKAGES}, exactly like the constructor's own `packages`
1449
- * parameter, so a host using the default package set needs to pass nothing.
1446
+ * against the packages that were present when it was written. Registers no
1447
+ * packages when omitted, exactly like the constructor's own `packages`
1448
+ * parameter, so a host that snapshotted a full engine passes the same
1449
+ * `BUILTIN_PACKAGES` here that it constructed with.
1450
1450
  */
1451
1451
  packages?: IEnginePackage[];
1452
1452
  /** Config overrides, merged over `DEFAULT_CONFIG`, as in the constructor. */
1453
- config?: Partial<typeof DEFAULT_CONFIG>;
1454
- /** Turn on the diagnostic pipeline, as in the constructor's `diagnosticMode`. */
1455
- diagnosticMode?: boolean;
1453
+ config?: EngineConfigOverride;
1454
+ /** Turn on the diagnostic pipeline, as in the constructor's `diagnostics`. */
1455
+ diagnostics?: boolean;
1456
1456
  /**
1457
1457
  * Override the locale the snapshot recorded. Rarely needed: the snapshot's
1458
1458
  * own {@link EngineSnapshot.locale} is used by default, so a restored engine
@@ -1461,17 +1461,23 @@ interface EngineRestoreOptions {
1461
1461
  locale?: string;
1462
1462
  }
1463
1463
  /**
1464
- * Return type of {@link evaluateLine} and {@link evaluateExpression}.
1464
+ * Options for constructing an {@link ExpressionEngine}. Every field is optional.
1465
1465
  *
1466
- * A single-element `Value[]`, kept as an array (rather than a bare
1467
- * `Value`) for API stability.
1466
+ * An engine registers exactly the {@link EngineOptions.packages} it is given, so
1467
+ * a bundler can tree-shake away every built-in a consumer never imports; pass
1468
+ * `BUILTIN_PACKAGES` (from `solve-engine/packages`) for the full set, a subset
1469
+ * for a slimmer engine, or use {@link createEngine} for the batteries-included
1470
+ * convenience.
1468
1471
  */
1469
- interface EvalResults extends Array<Value> {
1470
- }
1471
- /** Explicit result of {@link ExpressionEngine.evaluateLineDetailed}. */
1472
- interface LineEvaluation {
1473
- /** The evaluated value, wrapped in a single-element array. */
1474
- values: Value[];
1472
+ interface EngineOptions {
1473
+ /** BCP-47 locale. Defaults to `"en"`. */
1474
+ locale?: string;
1475
+ /** Packages to register. None when omitted, so nothing but what you pass is bundled. */
1476
+ packages?: IEnginePackage[];
1477
+ /** Config overrides, merged per section over {@link DEFAULT_CONFIG}. */
1478
+ config?: EngineConfigOverride;
1479
+ /** Turn on the diagnostic pipeline (per-stage timing and detail). Defaults to `false`. */
1480
+ diagnostics?: boolean;
1475
1481
  }
1476
1482
  /**
1477
1483
  * Core expression evaluation engine, the top-level orchestrator.
@@ -1511,17 +1517,38 @@ interface LineEvaluation {
1511
1517
  * is the intended usage. Reusing a single engine across documents is also fine:
1512
1518
  * `clear()` resets it for the next one rather than consuming it.
1513
1519
  *
1520
+ * The constructor registers only the packages it is given, so a consumer's
1521
+ * bundler can tree-shake away every built-in they do not use. For the common
1522
+ * "I want everything" case, {@link createEngine} registers the full built-in
1523
+ * set in one call; pass an explicit package list to the constructor when
1524
+ * bundle size matters.
1525
+ *
1514
1526
  * @example
1515
1527
  * ```typescript
1516
- * import { ExpressionEngine } from "solve-engine";
1517
- * const engine = new ExpressionEngine("en");
1518
- * const [value] = engine.evaluateExpression("2 + 2 * 10");
1528
+ * import { createEngine } from "solve-engine";
1529
+ * const engine = createEngine(); // every built-in package
1530
+ * const value = engine.evaluateExpression("2 + 2 * 10");
1519
1531
  * console.log(value.toNumber()); // 22
1520
1532
  * ```
1533
+ * @example
1534
+ * ```typescript
1535
+ * // A slimmer engine: only arithmetic and units reach the bundle.
1536
+ * import { ExpressionEngine } from "solve-engine";
1537
+ * import { ARITHMETIC_PACKAGE, UOM_PACKAGE } from "solve-engine/packages";
1538
+ * const engine = new ExpressionEngine({ packages: [ARITHMETIC_PACKAGE, UOM_PACKAGE] });
1539
+ * ```
1521
1540
  */
1522
1541
  declare class ExpressionEngine {
1523
1542
  private dag;
1524
1543
  private lineCache;
1544
+ /**
1545
+ * Names ever used as a running-total target (`total += 5`). A document is
1546
+ * re-parsed top-to-bottom on every keystroke, so each accumulator is reset
1547
+ * to undefined at the start of a batch pass and re-seeds from its opening
1548
+ * `+=`/`-=` this pass, rather than reading its own previous pass's value
1549
+ * (which grew the total without bound). See {@link tryCompoundAssignment}.
1550
+ */
1551
+ private accumulatorNames;
1525
1552
  private scopeManager;
1526
1553
  private lexer;
1527
1554
  private registry;
@@ -1549,8 +1576,8 @@ declare class ExpressionEngine {
1549
1576
  /** Registry of async resolvers from registered packages. */
1550
1577
  private resolverRegistry;
1551
1578
  /**
1552
- * Per-package record of contributions made to the SHARED registries
1553
- * (this engine's variable resolver / resolver namespaces), so
1579
+ * Per-package record of contributions made to the engine's registries
1580
+ * (plugin functions, resolver namespaces, token categories), so
1554
1581
  * {@link unregisterPackage} can reverse them. Keyed by package name.
1555
1582
  */
1556
1583
  private packageContributions;
@@ -1681,10 +1708,11 @@ declare class ExpressionEngine {
1681
1708
  * the bytecode-cache benefit on re-evaluation regardless of config.
1682
1709
  */
1683
1710
  private cacheBytecode;
1711
+ private pluginFunctionIndexByName;
1684
1712
  private builderPool;
1685
1713
  private builderPoolIndex;
1686
1714
  private lastTelemetry;
1687
- constructor(localeCode?: string, diagnosticMode?: boolean, config?: Partial<typeof DEFAULT_CONFIG>, diagnosticPipeline?: DiagnosticPipeline, packages?: IEnginePackage[]);
1715
+ constructor(options?: EngineOptions);
1688
1716
  /**
1689
1717
  * Get the native event stream from the batcher for stream-based consumers.
1690
1718
  *
@@ -1716,7 +1744,6 @@ declare class ExpressionEngine {
1716
1744
  * - `lexerVocabulary` → engine's isolated lexer (via this.lexer.registerVocabulary)
1717
1745
  * - `prefixParselets` → engine's isolated ParseletRegistry
1718
1746
  * - `infixParselets` → engine's isolated ParseletRegistry
1719
- * - `variableSources` → this engine's own variable resolver
1720
1747
  *
1721
1748
  * Built-in packages (ARITHMETIC, FUNCTION, UOM, etc.) are registered
1722
1749
  * via this method during construction. External user packages can also
@@ -1993,6 +2020,45 @@ declare class ExpressionEngine {
1993
2020
  * tolerated and skipped.
1994
2021
  */
1995
2022
  private tryDefineUserUnit;
2023
+ /**
2024
+ * `name += expr` / `name -= expr`, a running total. The accumulator reads
2025
+ * its current value, adds or subtracts the right-hand side, stores the
2026
+ * result, and answers with the new value, so a note becomes a live ledger
2027
+ * where each line adjusts a balance in place. Returns null to decline
2028
+ * anything that is not the compound shape.
2029
+ *
2030
+ * Handled here, in the same effectful, cache-bypassing channel as
2031
+ * {@link tryDefineUserUnit} and the bare `count = 10` assignment (see
2032
+ * {@link trySymbolicGrammar}), rather than as a parselet: a bare identifier
2033
+ * is a Tier-1 prefix that emits `LOAD_VAR name` before any infix parselet on
2034
+ * `+=` could run, and that pre-emitted load throws UNDEFINED_VARIABLE for a
2035
+ * first-use accumulator. Seeding 0 for a first `+=`/`-=` is a one-line
2036
+ * `getVar`/`setVar` here where it cannot be from a parselet, a deliberate
2037
+ * departure from a plain reference, which still reports the undefined name.
2038
+ *
2039
+ * The right-hand side is parenthesised and run through the ORDINARY (not
2040
+ * symbolic-tolerant) path, so `bal += 3 * 4` is `bal + 12`, a genuine typo in
2041
+ * it (`total += nope`) is a real UNDEFINED_VARIABLE, and the accumulation
2042
+ * goes through the VM's own ADD/SUB: money stays money, a unit stays its
2043
+ * unit, and the seed 0 added to a typed right-hand side takes that type on
2044
+ * first use. The colon (`:name`) and `global :name` grammars are untouched:
2045
+ * they lex their own leading token, never IDENT/UNIT, so they decline here.
2046
+ */
2047
+ private tryCompoundAssignment;
2048
+ /**
2049
+ * Reset every running-total accumulator (`total += 5`) to undefined, and
2050
+ * return their names.
2051
+ *
2052
+ * An accumulator seeds 0 only while its name is undefined, then reads that
2053
+ * value on each `+=`/`-=`. A document is re-evaluated top-to-bottom on
2054
+ * every keystroke, so unless the name is cleared first the total reads its
2055
+ * own previous evaluation's value and grows without bound. The batch
2056
+ * document pass (`parseDocument`/`evaluateLines`) calls this at the start
2057
+ * of each pass; the incremental {@link ThreeTierEvaluator} calls it and
2058
+ * then marks the lines that touch each name dirty, since it re-runs lines
2059
+ * selectively rather than replaying the whole document.
2060
+ */
2061
+ resetAccumulators(): ReadonlySet<string>;
1996
2062
  private trySymbolicGrammar;
1997
2063
  /**
1998
2064
  * Stores a general scalar equation (`x^2 - 4 = 0`) keyed by its unknown, or
@@ -2150,8 +2216,8 @@ declare class ExpressionEngine {
2150
2216
  * compile-only callers. NOT used by `evaluateLine()`/
2151
2217
  * `evaluateExpression()`, those route through
2152
2218
  * {@link evaluateExpressionWithDiagnostic} instead (evaluateLine ->
2153
- * evaluateLineDetailed -> evaluateLineWithDebug ->
2154
- * evaluateExpressionWithDiagnostic), which does its own lexing and its
2219
+ * evaluateLineWithDebug -> evaluateExpressionWithDiagnostic), which does
2220
+ * its own lexing and its
2155
2221
  * own diagnostic-instrumented front-half, delegating to the SAME
2156
2222
  * {@link prepareExpression} this method calls. Delegates the front-half
2157
2223
  * to {@link prepareExpression}, then runs async preflight (via
@@ -2163,16 +2229,10 @@ declare class ExpressionEngine {
2163
2229
  *
2164
2230
  * @param lineNumber - 1-based line position in the document.
2165
2231
  * @param lineText - The raw line text.
2166
- * @returns The evaluated Value, wrapped in a single-element array.
2232
+ * @returns The evaluated {@link Value}.
2167
2233
  * @throws {EngineError} On evaluation failure.
2168
2234
  */
2169
- evaluateLine(lineNumber: number, lineText: string): EvalResults;
2170
- /**
2171
- * Evaluate a line and return an explicit `{ values }` object.
2172
- *
2173
- * @throws {EngineError} On evaluation failure.
2174
- */
2175
- evaluateLineDetailed(lineNumber: number, lineText: string): LineEvaluation;
2235
+ evaluateLine(lineNumber: number, lineText: string): Value;
2176
2236
  /**
2177
2237
  * Evaluate a line with diagnostic information, supporting both regular expressions and inline solves.
2178
2238
  *
@@ -2442,9 +2502,9 @@ declare class ExpressionEngine {
2442
2502
  getLastTelemetry(): PipelineTelemetry | null;
2443
2503
  /**
2444
2504
  * Evaluate a raw expression string without line-number context.
2445
- * Returns the Value result. Throws on error.
2505
+ * Returns the {@link Value} result. Throws on error.
2446
2506
  */
2447
- evaluateExpression(expression: string): EvalResults;
2507
+ evaluateExpression(expression: string): Value;
2448
2508
  /**
2449
2509
  * Explain how a line reached its answer, as a readable derivation.
2450
2510
  *
@@ -2562,15 +2622,25 @@ declare class ExpressionEngine {
2562
2622
  * Fast path: evaluate an expression and return a number directly.
2563
2623
  *
2564
2624
  * Skips Value object allocation when only a numeric result is needed.
2565
- * Returns NaN on error or for bare undefined variable references.
2625
+ * Returns NaN whenever the expression has no numeric answer: a thrown
2626
+ * error, a bare undefined variable reference, or a faulted result (an
2627
+ * Error or a Pending value).
2566
2628
  *
2567
2629
  * Performs a pre-check for bare identifiers (single-token variable
2568
2630
  * references). If the identifier is not a known variable, returns NaN
2569
2631
  * immediately without attempting evaluation, avoids the ambiguity of
2570
2632
  * "result === 0" when a variable might legitimately store the value 0.
2571
2633
  *
2634
+ * A faulted result is treated the same way, and for the same reason: an
2635
+ * Error or Pending reads as 0 through {@link Value.toNumber}, so returning
2636
+ * that 0 would be indistinguishable from a real zero. NaN is this fast
2637
+ * path's established "no value" signal, so `evaluateNumber("5 kg to m")`
2638
+ * (an impossible conversion) is NaN rather than a silent `0`. A caller that
2639
+ * needs the fault's detail should use {@link evaluateExpression} and read
2640
+ * {@link Value.errorCode}/{@link Value.isPending} off the result.
2641
+ *
2572
2642
  * @param expression - The raw expression string to evaluate.
2573
- * @returns The numeric result, or NaN on error/undefined variable.
2643
+ * @returns The numeric result, or NaN on error / undefined variable / fault.
2574
2644
  */
2575
2645
  evaluateNumber(expression: string): number;
2576
2646
  clear(): void;
@@ -2856,50 +2926,25 @@ declare class LanguageService {
2856
2926
  invalidateCache(): void;
2857
2927
  }
2858
2928
 
2859
- /**
2860
- * Public API for registering plugins with the solve-js engine.
2861
- *
2862
- * All registration goes through this interface, parselets, variable
2863
- * sources, and full packages. The default implementation is
2864
- * {@link PackageRegistry} (singleton via {@link packageRegistry}).
2865
- *
2866
- * @example
2867
- * ```typescript
2868
- * import { packageRegistry } from "solve-engine";
2869
- * packageRegistry.registerPackage(myCustomPackage);
2870
- * ```
2871
- */
2872
- interface IPackageRegistry {
2873
- /** Register a prefix parselet (e.g., `GE`, `NOW`, `floor`). */
2874
- registerPrefixParselet(tokenType: string, parselet: PrefixParselet): void;
2875
- /** Register an infix parselet (e.g., `+`, `in`, `to`). */
2876
- registerInfixParselet(tokenType: string, parselet: InfixParselet): void;
2877
- /** @deprecated Has no effect. See {@link IEnginePackage.variableSources}. */
2878
- registerVariableSource(source: IVariableSource): void;
2879
- /** Register a complete package (parselets + variable sources). */
2880
- registerPackage(pkg: IEnginePackage): void;
2881
- /** Convenience reference to the Value class for creating typed values. */
2882
- Value: typeof Value;
2883
- }
2884
2929
  /**
2885
2930
  * Package descriptor for registering a complete provider with the engine.
2886
2931
  *
2887
2932
  * A package bundles all the pieces needed for a domain-specific provider:
2888
2933
  * lexer plugins for custom token recognition, parselets for Pratt parsing,
2889
- * plugin functions dispatched via CALL_PLUGIN bytecode, variable sources,
2890
- * and optional async resolvers for data that loads asynchronously (e.g.,
2891
- * exchange rates, game prices).
2934
+ * plugin functions dispatched via CALL_PLUGIN bytecode, and optional async
2935
+ * resolvers for data that loads asynchronously (e.g., exchange rates, game
2936
+ * prices).
2892
2937
  *
2893
2938
  * @example
2894
2939
  * ```typescript
2895
2940
  * const myPackage: IEnginePackage = {
2896
2941
  * name: "MyProvider",
2897
2942
  * lexerVocabulary: myLexerVocabulary,
2898
- * prefixParselets: [{ tokenType: "MY_FUNC", parselet: new MyParselet() }],
2899
- * pluginFunctions: [{ index: MY_FN_IDX, handler: myHandler }],
2943
+ * prefixParselets: { MY_FUNC: new MyParselet() },
2944
+ * pluginFunctions: { myFn: myHandler },
2900
2945
  * asyncResolvers: [myAsyncResolver],
2901
2946
  * };
2902
- * packageRegistry.registerPackage(myPackage);
2947
+ * const engine = createEngine({ extraPackages: [myPackage] });
2903
2948
  * ```
2904
2949
  */
2905
2950
  interface IEnginePackage {
@@ -2926,59 +2971,30 @@ interface IEnginePackage {
2926
2971
  engineVersion?: string;
2927
2972
  /** Optional lexer vocabulary (keywords/operators/units) for recognizing custom tokens (e.g., `GE`, `£`). */
2928
2973
  lexerVocabulary?: LexerVocabulary;
2929
- /** Prefix parselets for this package's custom functions/operators. */
2930
- prefixParselets?: Array<{
2931
- tokenType: string;
2932
- parselet: PrefixParselet;
2933
- }>;
2934
- /** Infix parselets for this package's custom binary operators. */
2935
- infixParselets?: Array<{
2936
- tokenType: string;
2937
- parselet: InfixParselet;
2938
- }>;
2939
- /**
2940
- * Functions dispatched via CALL_PLUGIN bytecode (emitted by this package's
2941
- * parselets with `builder.emitIndex(index)`).
2942
- *
2943
- * Each entry's `index` MUST come from {@link allocatePluginFunctionIndex}
2944
- * (`@solve-js/vm/VMBuiltins`), never hardcode a number. Two packages
2945
- * independently picking the same index would silently overwrite each
2946
- * other's handler in the shared registry.
2947
- *
2948
- * The handler's optional second parameter, `context`, carries the
2949
- * current line's {@link LineExecutionContext} (line number, and, only
2950
- * inside a real document, never `evaluateExpression()`'s single-shot
2951
- * path, closures for reading another line's cached result). Every
2952
- * handler that doesn't need cross-line data can ignore it entirely.
2974
+ /** Prefix parselets for this package's custom functions/operators, keyed by token type. */
2975
+ prefixParselets?: Record<string, PrefixParselet>;
2976
+ /** Infix parselets for this package's custom binary operators, keyed by token type. */
2977
+ infixParselets?: Record<string, InfixParselet>;
2978
+ /**
2979
+ * Functions dispatched via `CALL_PLUGIN` bytecode, keyed by a package-local
2980
+ * name. The engine assigns each a registry index at registration, so a
2981
+ * parselet emits the call by that name (`builder.emitPluginCall(name, argCount)`)
2982
+ * and never touches a numeric index. Two packages naming a function the same
2983
+ * is a `checkPackageCompatibility` warning, the later registration wins.
2984
+ *
2985
+ * The handler's optional second parameter, `context`, carries the current
2986
+ * line's `LineExecutionContext` (line number, and, only inside a real
2987
+ * document, never `evaluateExpression()`'s single-shot path, closures for
2988
+ * reading another line's cached result). Every handler that doesn't need
2989
+ * cross-line data can ignore it entirely.
2953
2990
  *
2954
2991
  * @example
2955
2992
  * ```ts
2956
- * const MY_FN_IDX = allocatePluginFunctionIndex();
2957
- * // In a parselet's parse(): builder.emitOpcode(OpCode.CALL_PLUGIN); builder.emitIndex(MY_FN_IDX); builder.emitIndex(argCount);
2958
- * pluginFunctions: [{ index: MY_FN_IDX, handler: myHandler }]
2993
+ * // In a parselet's parse(): builder.emitPluginCall("myFn", argCount);
2994
+ * pluginFunctions: { myFn: myHandler }
2959
2995
  * ```
2960
2996
  */
2961
- pluginFunctions?: Array<{
2962
- index: number;
2963
- handler: (args: Value[], context?: LineExecutionContext) => Value | Promise<Value>;
2964
- }>;
2965
- /**
2966
- * Named-variable sources.
2967
- *
2968
- * @deprecated Currently has no effect. Sources declared here are registered
2969
- * into the engine's {@link EngineContext} and unregistered again on package
2970
- * removal, but no evaluation path ever calls `VariableResolver.resolve()`, so
2971
- * a variable a source provides is never found. Verified by searching every
2972
- * use of `IVariableSource` outside its own declaration: they are all
2973
- * registration bookkeeping.
2974
- *
2975
- * Declared here rather than deleted because removing a public field is a
2976
- * breaking change and the intended behaviour is worth keeping. Documented as
2977
- * dead so a package author does not spend an afternoon working out why their
2978
- * variables resolve to nothing. To expose a value today, contribute a plugin
2979
- * function through {@link IEnginePackage.pluginFunctions}.
2980
- */
2981
- variableSources?: IVariableSource[];
2997
+ pluginFunctions?: Record<string, PluginFunctionHandler>;
2982
2998
  /**
2983
2999
  * Async resolvers for this package's domain.
2984
3000
  * When set, the ExpressionEngine runs preflight() before VM execution
@@ -3070,53 +3086,5 @@ interface IEnginePackage {
3070
3086
  */
3071
3087
  asConverters?: Record<string, (value: Value) => Value>;
3072
3088
  }
3073
- /**
3074
- * Default implementation of {@link IPackageRegistry}, the plugin registration API.
3075
- *
3076
- * All registrations delegate to shared singletons (parselet registry,
3077
- * variable resolver, lexer). This ensures that packages registered through
3078
- * any PackageRegistry instance are visible engine-wide.
3079
- *
3080
- * @example
3081
- * ```typescript
3082
- * import { packageRegistry } from "solve-engine";
3083
- *
3084
- * // Register a complete provider package
3085
- * packageRegistry.registerPackage({
3086
- * name: "MyProvider",
3087
- * prefixParselets: [{ tokenType: "MY_FUNC", parselet: new MyParselet() }],
3088
- * });
3089
- * ```
3090
- *
3091
- * @deprecated Register on an engine instead:
3092
- * `engine.registerPackage(pkg)`.
3093
- *
3094
- * This class writes into process-wide singletons, which is incompatible with an
3095
- * engine owning its own registries. Since the introduction of
3096
- * {@link EngineContext}, an engine reads plugin functions, opcode handlers and
3097
- * variable sources from its own context, so a package registered here is not
3098
- * visible to any engine. Parselets and lexer vocabulary registered here reach
3099
- * the shared registries, which an engine also does not read: it builds its own
3100
- * `ParseletRegistry` and its own `Lexer`.
3101
- *
3102
- * In other words this path registers into state nothing evaluates against. It
3103
- * remains exported because removing it is a breaking change, and it is where
3104
- * the singletons that survive are still written from, but it should not be used
3105
- * in new code and will be removed before 1.0 proper.
3106
- */
3107
- declare class PackageRegistry implements IPackageRegistry {
3108
- Value: typeof Value;
3109
- registerPrefixParselet(tokenType: string, parselet: PrefixParselet): void;
3110
- registerInfixParselet(tokenType: string, parselet: InfixParselet): void;
3111
- registerVariableSource(source: IVariableSource): void;
3112
- registerPackage(pkg: IEnginePackage): void;
3113
- }
3114
- /**
3115
- * Singleton PackageRegistry instance, the default plugin registration API.
3116
- *
3117
- * All packages should register through this instance. The underlying registries
3118
- * are shared singletons, so multiple PackageRegistry instances would be redundant.
3119
- */
3120
- declare const packageRegistry: PackageRegistry;
3121
3089
 
3122
- export { type ApplyChangesResult as A, type BatcherMetrics as B, type CacheSnapshot as C, DocumentModel as D, ExpressionEngine as E, type LineState as F, type LinesUpdatedEvent as G, type CompletionItem as H, type IEnginePackage as I, LanguageService as J, type LanguageServiceOptions as K, type LineEvaluation as L, type SemanticToken as M, type ParsedLine as N, type ParsingResult as O, PackageRegistry as P, SNAPSHOT_FORMAT as S, type UnifiedParsingOptions as U, type ViewportRange as V, type EngineRestoreOptions as a, type EngineSnapshot as b, type EvalResults as c, type Explanation as d, type ExplanationStep as e, type IPackageRegistry as f, SNAPSHOT_VERSION as g, type SerializedAnonymousBody as h, type SerializedBytecode as i, type SerializedDecimal as j, type SerializedLineCacheEntry as k, type SerializedNumber as l, type SerializedRational as m, type SerializedUserFunction as n, type SerializedValue as o, SnapshotErrorCodes as p, packageRegistry as q, type LineChange as r, type InlineSolvePosition as s, type AsyncCachePackageInfo as t, type AsyncErrorEvent as u, AsyncResolutionBatcher as v, type AsyncResolutionEvent as w, type BytecodeCacheEntry as x, type CheckpointSnapshot as y, type LineCacheEntryInfo as z };
3090
+ export { type ApplyChangesResult as A, type BatcherMetrics as B, type CacheSnapshot as C, DocumentModel as D, ExpressionEngine as E, LanguageService as F, type LanguageServiceOptions as G, type SemanticToken as H, type IEnginePackage as I, type ParsingResult as J, type LineChange as L, type ParsedLine as P, SNAPSHOT_FORMAT as S, type UnifiedParsingOptions as U, type ViewportRange as V, type EngineOptions as a, type EngineRestoreOptions as b, type EngineSnapshot as c, type Explanation as d, type ExplanationStep as e, SNAPSHOT_VERSION as f, type SerializedAnonymousBody as g, type SerializedBytecode as h, type SerializedDecimal as i, type SerializedLineCacheEntry as j, type SerializedNumber as k, type SerializedRational as l, type SerializedUserFunction as m, type SerializedValue as n, SnapshotErrorCodes as o, type InlineSolvePosition as p, type AsyncCachePackageInfo as q, type AsyncErrorEvent as r, AsyncResolutionBatcher as s, type AsyncResolutionEvent as t, type BytecodeCacheEntry as u, type CheckpointSnapshot as v, type LineCacheEntryInfo as w, type LineState as x, type LinesUpdatedEvent as y, type CompletionItem as z };
@@ -1,6 +1,6 @@
1
- import { B as BytecodeBuilder } from './BytecodeBuilder-Bp9xeTmX.js';
2
- import { T as Token } from './Token-B1hdkedD.js';
3
- import { D as DiagnosticPipeline } from './pipeline-DCd5M6Gk.js';
1
+ import { B as BytecodeBuilder } from './BytecodeBuilder-DGGeByAP.js';
2
+ import { T as Token } from './Token-CbP_OutD.js';
3
+ import { D as DiagnosticPipeline } from './pipeline-72QmQlGx.js';
4
4
 
5
5
  /**
6
6
  * Dual-keyed ParseletRegistry, accepts both string token types and
@@ -111,8 +111,9 @@ declare class ParseletRegistry {
111
111
  * A process-wide parselet registry.
112
112
  *
113
113
  * @deprecated An engine builds its own registry and does not read this one, so
114
- * registering here reaches nothing that evaluates. It survives for the
115
- * deprecated {@link PackageRegistry} path only.
114
+ * registering here reaches nothing that evaluates. Nothing writes to it now
115
+ * that the global package-registration path is gone; it remains only so the
116
+ * `@solve-js/parser` escape hatch keeps a stable shape.
116
117
  */
117
118
  declare const sharedParseletRegistry: ParseletRegistry;
118
119
 
@@ -188,7 +189,9 @@ declare class PrecedenceParser {
188
189
  * tokenTypeId → OpCode. PERCENT and CARET are handled specially (not in this map).
189
190
  */
190
191
  private static readonly INFIX_OPCODE;
191
- constructor(parseletRegistry: ParseletRegistry, maxDepth?: number, localeCode?: string);
192
+ /** Shared with every BytecodeBuilder so a nested-body builder resolves plugin calls by name. */
193
+ private pluginFunctionIndex?;
194
+ constructor(parseletRegistry: ParseletRegistry, maxDepth?: number, localeCode?: string, pluginFunctionIndex?: ReadonlyMap<string, number>);
192
195
  /** Get locale code for NumberParselet to normalize separators */
193
196
  getLocaleCode(): string;
194
197
  /**
@@ -1,6 +1,6 @@
1
- import { B as BytecodeBuilder } from './BytecodeBuilder-Bp9xeTmX.cjs';
2
- import { T as Token } from './Token-B1hdkedD.cjs';
3
- import { D as DiagnosticPipeline } from './pipeline-CtfJtPQc.cjs';
1
+ import { B as BytecodeBuilder } from './BytecodeBuilder-DGGeByAP.cjs';
2
+ import { T as Token } from './Token-CbP_OutD.cjs';
3
+ import { D as DiagnosticPipeline } from './pipeline-DCQicwWX.cjs';
4
4
 
5
5
  /**
6
6
  * Dual-keyed ParseletRegistry, accepts both string token types and
@@ -111,8 +111,9 @@ declare class ParseletRegistry {
111
111
  * A process-wide parselet registry.
112
112
  *
113
113
  * @deprecated An engine builds its own registry and does not read this one, so
114
- * registering here reaches nothing that evaluates. It survives for the
115
- * deprecated {@link PackageRegistry} path only.
114
+ * registering here reaches nothing that evaluates. Nothing writes to it now
115
+ * that the global package-registration path is gone; it remains only so the
116
+ * `@solve-js/parser` escape hatch keeps a stable shape.
116
117
  */
117
118
  declare const sharedParseletRegistry: ParseletRegistry;
118
119
 
@@ -188,7 +189,9 @@ declare class PrecedenceParser {
188
189
  * tokenTypeId → OpCode. PERCENT and CARET are handled specially (not in this map).
189
190
  */
190
191
  private static readonly INFIX_OPCODE;
191
- constructor(parseletRegistry: ParseletRegistry, maxDepth?: number, localeCode?: string);
192
+ /** Shared with every BytecodeBuilder so a nested-body builder resolves plugin calls by name. */
193
+ private pluginFunctionIndex?;
194
+ constructor(parseletRegistry: ParseletRegistry, maxDepth?: number, localeCode?: string, pluginFunctionIndex?: ReadonlyMap<string, number>);
192
195
  /** Get locale code for NumberParselet to normalize separators */
193
196
  getLocaleCode(): string;
194
197
  /**
@@ -1,8 +1,7 @@
1
- import { V as Value } from './Value-BUi1RA3S.js';
2
- import { U as UserFunctionDef, A as AnonymousBodyDef, a as BytecodeProgram } from './BytecodeBuilder-Bp9xeTmX.js';
3
- import { E as EngineError } from './EngineError-B61GS1jp.js';
4
- import { D as DiagnosticPipeline } from './pipeline-DCd5M6Gk.js';
5
- import { VariableResolver } from './variables.js';
1
+ import { V as Value } from './Value-CCi_Eecs.js';
2
+ import { U as UserFunctionDef, A as AnonymousBodyDef, a as BytecodeProgram } from './BytecodeBuilder-DGGeByAP.js';
3
+ import { E as EngineError } from './EngineError-Ce1lPkjZ.js';
4
+ import { D as DiagnosticPipeline } from './pipeline-72QmQlGx.js';
6
5
 
7
6
  /**
8
7
  * Create a new VM instance with the given opcode registry and configurable limits.
@@ -186,9 +185,8 @@ declare function executeBytecode(bytecode: Bytecode, vm: VM, pipeline?: Diagnost
186
185
  *
187
186
  * Runtime imports here are restricted to leaf modules of `vm/`. This file is
188
187
  * imported by `vm/`, which `engine/` imports in turn, so pulling in anything
189
- * that reaches back into `engine/` would close a cycle. `OpRegistry` and
190
- * `VariableResolver` are safe because they import only types plus the error
191
- * factory. Everything else arrives
188
+ * that reaches back into `engine/` would close a cycle. `OpRegistry` is safe
189
+ * because it imports only types plus the error factory. Everything else arrives
192
190
  * through `import type`, which is erased before the code runs.
193
191
  */
194
192
 
@@ -242,13 +240,6 @@ interface EngineContext {
242
240
  * registration back into every engine at once.
243
241
  */
244
242
  readonly opRegistry: OpRegistry;
245
- /**
246
- * Named-variable sources a package contributed.
247
- *
248
- * A package registering a source used to make its variables visible to
249
- * every engine in the process, including ones that never registered it.
250
- */
251
- readonly variableResolver: VariableResolver;
252
243
  /**
253
244
  * Which package registered each plugin function index.
254
245
  *
@@ -402,6 +393,13 @@ interface VM {
402
393
  */
403
394
  getVar(key: string): Value | undefined;
404
395
  setVar(key: string, value: Value): void;
396
+ /**
397
+ * Remove a top-level variable binding. Used at the start of each document
398
+ * pass to re-seed accumulators (`total += 5`): a running total must reset
399
+ * to its seed each full re-parse, otherwise it reads its own previous
400
+ * pass's value and grows without bound on every keystroke.
401
+ */
402
+ deleteVar(key: string): void;
405
403
  /**
406
404
  * User-defined-function call frame, a name-keyed `Map` of this call's
407
405
  * bound arguments, PUSHED before `CALL_USER_FUNCTION` executes the
@@ -676,4 +674,4 @@ declare class ScopeManager {
676
674
  clear(): void;
677
675
  }
678
676
 
679
- export { type Bytecode as B, type DagSnapshot as D, type ExpressionRecord as E, type LineExecutionContext as L, OpRegistry as O, type PluginFunctionHandler as P, ScopeManager as S, type VM as V, DependencyGraph as a, type EngineContext as b, createVM as c, executeBytecode as e, sharedOpRegistry as s };
677
+ export { type Bytecode as B, type DagSnapshot as D, type ExpressionRecord as E, OpRegistry as O, type PluginFunctionHandler as P, ScopeManager as S, type VM as V, DependencyGraph as a, type EngineContext as b, createVM as c, executeBytecode as e, sharedOpRegistry as s };
@@ -1,8 +1,7 @@
1
- import { V as Value } from './Value-BUi1RA3S.cjs';
2
- import { U as UserFunctionDef, A as AnonymousBodyDef, a as BytecodeProgram } from './BytecodeBuilder-Bp9xeTmX.cjs';
3
- import { E as EngineError } from './EngineError-B61GS1jp.cjs';
4
- import { D as DiagnosticPipeline } from './pipeline-CtfJtPQc.cjs';
5
- import { VariableResolver } from './variables.cjs';
1
+ import { V as Value } from './Value-CCi_Eecs.cjs';
2
+ import { U as UserFunctionDef, A as AnonymousBodyDef, a as BytecodeProgram } from './BytecodeBuilder-DGGeByAP.cjs';
3
+ import { E as EngineError } from './EngineError-Ce1lPkjZ.cjs';
4
+ import { D as DiagnosticPipeline } from './pipeline-DCQicwWX.cjs';
6
5
 
7
6
  /**
8
7
  * Create a new VM instance with the given opcode registry and configurable limits.
@@ -186,9 +185,8 @@ declare function executeBytecode(bytecode: Bytecode, vm: VM, pipeline?: Diagnost
186
185
  *
187
186
  * Runtime imports here are restricted to leaf modules of `vm/`. This file is
188
187
  * imported by `vm/`, which `engine/` imports in turn, so pulling in anything
189
- * that reaches back into `engine/` would close a cycle. `OpRegistry` and
190
- * `VariableResolver` are safe because they import only types plus the error
191
- * factory. Everything else arrives
188
+ * that reaches back into `engine/` would close a cycle. `OpRegistry` is safe
189
+ * because it imports only types plus the error factory. Everything else arrives
192
190
  * through `import type`, which is erased before the code runs.
193
191
  */
194
192
 
@@ -242,13 +240,6 @@ interface EngineContext {
242
240
  * registration back into every engine at once.
243
241
  */
244
242
  readonly opRegistry: OpRegistry;
245
- /**
246
- * Named-variable sources a package contributed.
247
- *
248
- * A package registering a source used to make its variables visible to
249
- * every engine in the process, including ones that never registered it.
250
- */
251
- readonly variableResolver: VariableResolver;
252
243
  /**
253
244
  * Which package registered each plugin function index.
254
245
  *
@@ -402,6 +393,13 @@ interface VM {
402
393
  */
403
394
  getVar(key: string): Value | undefined;
404
395
  setVar(key: string, value: Value): void;
396
+ /**
397
+ * Remove a top-level variable binding. Used at the start of each document
398
+ * pass to re-seed accumulators (`total += 5`): a running total must reset
399
+ * to its seed each full re-parse, otherwise it reads its own previous
400
+ * pass's value and grows without bound on every keystroke.
401
+ */
402
+ deleteVar(key: string): void;
405
403
  /**
406
404
  * User-defined-function call frame, a name-keyed `Map` of this call's
407
405
  * bound arguments, PUSHED before `CALL_USER_FUNCTION` executes the
@@ -676,4 +674,4 @@ declare class ScopeManager {
676
674
  clear(): void;
677
675
  }
678
676
 
679
- export { type Bytecode as B, type DagSnapshot as D, type ExpressionRecord as E, type LineExecutionContext as L, OpRegistry as O, type PluginFunctionHandler as P, ScopeManager as S, type VM as V, DependencyGraph as a, type EngineContext as b, createVM as c, executeBytecode as e, sharedOpRegistry as s };
677
+ export { type Bytecode as B, type DagSnapshot as D, type ExpressionRecord as E, OpRegistry as O, type PluginFunctionHandler as P, ScopeManager as S, type VM as V, DependencyGraph as a, type EngineContext as b, createVM as c, executeBytecode as e, sharedOpRegistry as s };