solve-engine 2.24.0 → 2.26.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 (258) hide show
  1. package/dist/{BytecodeBuilder-aqVa7Plx.d.cts → BytecodeBuilder-DSWKZi4f.d.cts} +11 -9
  2. package/dist/{BytecodeBuilder-aqVa7Plx.d.ts → BytecodeBuilder-DSWKZi4f.d.ts} +11 -9
  3. package/dist/CalendarBackend-MdS3Bb4P.d.cts +181 -0
  4. package/dist/CalendarBackend-MdS3Bb4P.d.ts +181 -0
  5. package/dist/{Configuration-DnzYPmoK.d.cts → Configuration-BxriK9Kw.d.cts} +63 -4
  6. package/dist/{Configuration-DnzYPmoK.d.ts → Configuration-BxriK9Kw.d.ts} +63 -4
  7. package/dist/DateCalendar-B85t6Vk6.d.ts +90 -0
  8. package/dist/DateCalendar-CUGI1fT4.d.cts +90 -0
  9. package/dist/{EngineError-D1kXsjIj.d.cts → EngineError-C-kBwYlN.d.cts} +33 -4
  10. package/dist/{EngineError-D1kXsjIj.d.ts → EngineError-C-kBwYlN.d.ts} +33 -4
  11. package/dist/{FormattingSettings-bRKjU7wI.d.ts → FormattingSettings-ByO-4wiM.d.cts} +14 -0
  12. package/dist/{FormattingSettings-bRKjU7wI.d.cts → FormattingSettings-CvCzAfsz.d.ts} +14 -0
  13. package/dist/{Lexer-CqagTewQ.d.ts → Lexer-DhGhoAa2.d.cts} +96 -37
  14. package/dist/{Lexer-CCHFDcgP.d.cts → Lexer-DqtnZMC5.d.ts} +96 -37
  15. package/dist/{PackageCompatibility-CeAPVHZr.d.cts → PackageCompatibility-CNiTtC6S.d.cts} +1 -1
  16. package/dist/{PackageCompatibility-Bq82y0ZN.d.ts → PackageCompatibility-fj_f7uqC.d.ts} +1 -1
  17. package/dist/{PackageRegistry-B9-7fJGH.d.cts → PackageRegistry-BHBCFswo.d.cts} +377 -15
  18. package/dist/{PackageRegistry-CDEgfhT_.d.ts → PackageRegistry-CNZUwWHJ.d.ts} +377 -15
  19. package/dist/{Parselet-4oH5OuRt.d.cts → Parselet-DF3864la.d.cts} +26 -4
  20. package/dist/{Parselet-BwDqKFfK.d.ts → Parselet-Dgymjxzd.d.ts} +26 -4
  21. package/dist/{Token-CbP_OutD.d.cts → Token-D8f7yaz1.d.cts} +17 -0
  22. package/dist/{Token-CbP_OutD.d.ts → Token-D8f7yaz1.d.ts} +17 -0
  23. package/dist/{TokenNormalizer-OTPS0Otq.d.ts → TokenNormalizer-IF7nPRMp.d.ts} +46 -27
  24. package/dist/{TokenNormalizer-MXaKLJ_m.d.cts → TokenNormalizer-Pe3_390t.d.cts} +46 -27
  25. package/dist/{ScopeManager-BQBhlDAu.d.ts → VMBuiltins-CZiZRKn-.d.ts} +92 -10
  26. package/dist/{ScopeManager-DrXB3Nvm.d.cts → VMBuiltins-kv4rr0y5.d.cts} +92 -10
  27. package/dist/{VMCheckpoints-C5jC92o3.d.ts → VMCheckpoints-DXze6ypg.d.ts} +3 -3
  28. package/dist/{VMCheckpoints-BK32PTl2.d.cts → VMCheckpoints-yun4ocSv.d.cts} +3 -3
  29. package/dist/{Value-Ds3Gy07C.d.cts → Value-BYHw-x7q.d.cts} +57 -1
  30. package/dist/{Value-Ds3Gy07C.d.ts → Value-BYHw-x7q.d.ts} +57 -1
  31. package/dist/{WorkerError-DaNWQFp1.d.cts → WorkerError-BLZyNq6M.d.cts} +1 -1
  32. package/dist/{WorkerError-CVQbs6_D.d.ts → WorkerError-CfBJYueR.d.ts} +1 -1
  33. package/dist/chunk-2SYYKQ4Q.cjs +2 -0
  34. package/dist/chunk-2SYYKQ4Q.cjs.map +1 -0
  35. package/dist/chunk-6EYKVQT3.cjs +2 -0
  36. package/dist/chunk-6EYKVQT3.cjs.map +1 -0
  37. package/dist/chunk-7RC6RBS6.cjs +2 -0
  38. package/dist/chunk-7RC6RBS6.cjs.map +1 -0
  39. package/dist/chunk-AZX4NTYN.cjs +3 -0
  40. package/dist/chunk-AZX4NTYN.cjs.map +1 -0
  41. package/dist/{chunk-PTQCHMYA.js → chunk-BCR53EIL.js} +2 -2
  42. package/dist/{chunk-PTQCHMYA.js.map → chunk-BCR53EIL.js.map} +1 -1
  43. package/dist/chunk-BLJ6E577.js +2 -0
  44. package/dist/chunk-BLJ6E577.js.map +1 -0
  45. package/dist/{chunk-CMZSK6FY.cjs → chunk-C5GEMKUY.cjs} +3 -3
  46. package/dist/{chunk-CMZSK6FY.cjs.map → chunk-C5GEMKUY.cjs.map} +1 -1
  47. package/dist/chunk-CL7DM2FX.js +2 -0
  48. package/dist/chunk-CL7DM2FX.js.map +1 -0
  49. package/dist/chunk-CQLCTKMX.cjs +2 -0
  50. package/dist/chunk-CQLCTKMX.cjs.map +1 -0
  51. package/dist/chunk-CQY23OF5.cjs +5 -0
  52. package/dist/chunk-CQY23OF5.cjs.map +1 -0
  53. package/dist/chunk-D4VBWPWN.js +2 -0
  54. package/dist/chunk-D4VBWPWN.js.map +1 -0
  55. package/dist/chunk-E4HAKNBQ.cjs +2 -0
  56. package/dist/chunk-E4HAKNBQ.cjs.map +1 -0
  57. package/dist/{chunk-GP4H5OIT.js → chunk-ESZNJQ2C.js} +3 -3
  58. package/dist/{chunk-GP4H5OIT.js.map → chunk-ESZNJQ2C.js.map} +1 -1
  59. package/dist/{chunk-IJMNVBIS.js → chunk-FAO6DQ74.js} +2 -2
  60. package/dist/chunk-FAO6DQ74.js.map +1 -0
  61. package/dist/{chunk-2VE4OW4A.cjs → chunk-FDKTESBC.cjs} +2 -2
  62. package/dist/{chunk-2VE4OW4A.cjs.map → chunk-FDKTESBC.cjs.map} +1 -1
  63. package/dist/{chunk-RN3ISTM3.cjs → chunk-G2V33LFM.cjs} +2 -2
  64. package/dist/{chunk-RN3ISTM3.cjs.map → chunk-G2V33LFM.cjs.map} +1 -1
  65. package/dist/chunk-GJZIJK2Q.cjs +2 -0
  66. package/dist/chunk-GJZIJK2Q.cjs.map +1 -0
  67. package/dist/chunk-GQM6ICDM.js +2 -0
  68. package/dist/chunk-GQM6ICDM.js.map +1 -0
  69. package/dist/chunk-GVL3ZMS7.cjs +2 -0
  70. package/dist/chunk-GVL3ZMS7.cjs.map +1 -0
  71. package/dist/chunk-GXO7TSXQ.cjs +3 -0
  72. package/dist/chunk-GXO7TSXQ.cjs.map +1 -0
  73. package/dist/{chunk-OMHRBKAT.js → chunk-HANGBVEE.js} +2 -2
  74. package/dist/{chunk-OMHRBKAT.js.map → chunk-HANGBVEE.js.map} +1 -1
  75. package/dist/chunk-J4K72CQN.js +2 -0
  76. package/dist/chunk-J4K72CQN.js.map +1 -0
  77. package/dist/chunk-LE6WZLJ4.js +2 -0
  78. package/dist/chunk-LE6WZLJ4.js.map +1 -0
  79. package/dist/chunk-LMZDTQS5.js +3 -0
  80. package/dist/chunk-LMZDTQS5.js.map +1 -0
  81. package/dist/chunk-LQIRBP4Q.js +2 -0
  82. package/dist/chunk-LQIRBP4Q.js.map +1 -0
  83. package/dist/{chunk-UXR7JIPX.js → chunk-LTUYWJGO.js} +2 -2
  84. package/dist/{chunk-UXR7JIPX.js.map → chunk-LTUYWJGO.js.map} +1 -1
  85. package/dist/chunk-MCU7UYKG.js +3 -0
  86. package/dist/{chunk-7EP36NXE.js.map → chunk-MCU7UYKG.js.map} +1 -1
  87. package/dist/chunk-MTN53APQ.js +5 -0
  88. package/dist/chunk-MTN53APQ.js.map +1 -0
  89. package/dist/chunk-OPKJ2WWB.cjs +3 -0
  90. package/dist/chunk-OPKJ2WWB.cjs.map +1 -0
  91. package/dist/chunk-QQHHZPEW.cjs +2 -0
  92. package/dist/chunk-QQHHZPEW.cjs.map +1 -0
  93. package/dist/chunk-RRUGQ6DM.js +2 -0
  94. package/dist/chunk-RRUGQ6DM.js.map +1 -0
  95. package/dist/chunk-S3ODNMJS.js +2 -0
  96. package/dist/chunk-S3ODNMJS.js.map +1 -0
  97. package/dist/{chunk-CDNJZBM3.cjs → chunk-SE6ZCGZ5.cjs} +2 -2
  98. package/dist/{chunk-CDNJZBM3.cjs.map → chunk-SE6ZCGZ5.cjs.map} +1 -1
  99. package/dist/chunk-TC23XEAV.js +2 -0
  100. package/dist/chunk-TC23XEAV.js.map +1 -0
  101. package/dist/{chunk-MWWAKZOD.cjs → chunk-TMQ37JQY.cjs} +3 -3
  102. package/dist/{chunk-MWWAKZOD.cjs.map → chunk-TMQ37JQY.cjs.map} +1 -1
  103. package/dist/chunk-TPPM4QSS.cjs +2 -0
  104. package/dist/chunk-TPPM4QSS.cjs.map +1 -0
  105. package/dist/chunk-VB6QMU2W.js +3 -0
  106. package/dist/chunk-VB6QMU2W.js.map +1 -0
  107. package/dist/chunk-VQO54ZMA.js +2 -0
  108. package/dist/chunk-VQO54ZMA.js.map +1 -0
  109. package/dist/chunk-Y7XRA2EV.js +2 -0
  110. package/dist/chunk-Y7XRA2EV.js.map +1 -0
  111. package/dist/{chunk-5IJD5L3O.cjs → chunk-YBQOQTVL.cjs} +2 -2
  112. package/dist/chunk-YBQOQTVL.cjs.map +1 -0
  113. package/dist/chunk-YG7UWQFV.js +2 -0
  114. package/dist/chunk-YG7UWQFV.js.map +1 -0
  115. package/dist/chunk-YS2OW75C.cjs +2 -0
  116. package/dist/chunk-YS2OW75C.cjs.map +1 -0
  117. package/dist/chunk-ZC2NPRLO.js +3 -0
  118. package/dist/chunk-ZC2NPRLO.js.map +1 -0
  119. package/dist/chunk-ZDJTDFTR.cjs +2 -0
  120. package/dist/chunk-ZDJTDFTR.cjs.map +1 -0
  121. package/dist/chunk-ZE5KKMBV.cjs +2 -0
  122. package/dist/chunk-ZE5KKMBV.cjs.map +1 -0
  123. package/dist/chunk-ZSLVLMO5.cjs +2 -0
  124. package/dist/chunk-ZSLVLMO5.cjs.map +1 -0
  125. package/dist/constants.cjs +1 -1
  126. package/dist/constants.d.cts +1 -1
  127. package/dist/constants.d.ts +1 -1
  128. package/dist/constants.js +1 -1
  129. package/dist/engine.cjs +1 -1
  130. package/dist/engine.d.cts +15 -13
  131. package/dist/engine.d.ts +15 -13
  132. package/dist/engine.js +1 -1
  133. package/dist/errors.cjs +1 -1
  134. package/dist/errors.d.cts +3 -3
  135. package/dist/errors.d.ts +3 -3
  136. package/dist/errors.js +1 -1
  137. package/dist/format.cjs +1 -1
  138. package/dist/format.d.cts +4 -3
  139. package/dist/format.d.ts +4 -3
  140. package/dist/format.js +1 -1
  141. package/dist/index.cjs +1 -1
  142. package/dist/index.cjs.map +1 -1
  143. package/dist/index.d.cts +16 -14
  144. package/dist/index.d.ts +16 -14
  145. package/dist/index.js +1 -1
  146. package/dist/index.js.map +1 -1
  147. package/dist/language.d.cts +13 -12
  148. package/dist/language.d.ts +13 -12
  149. package/dist/lexer.cjs +1 -1
  150. package/dist/lexer.cjs.map +1 -1
  151. package/dist/lexer.d.cts +9 -8
  152. package/dist/lexer.d.ts +9 -8
  153. package/dist/lexer.js +1 -1
  154. package/dist/lexer.js.map +1 -1
  155. package/dist/normalizer.cjs +1 -1
  156. package/dist/normalizer.d.cts +3 -3
  157. package/dist/normalizer.d.ts +3 -3
  158. package/dist/normalizer.js +1 -1
  159. package/dist/packages.cjs +1 -1
  160. package/dist/packages.d.cts +12 -11
  161. package/dist/packages.d.ts +12 -11
  162. package/dist/packages.js +1 -1
  163. package/dist/parser.cjs +1 -1
  164. package/dist/parser.d.cts +6 -5
  165. package/dist/parser.d.ts +6 -5
  166. package/dist/parser.js +1 -1
  167. package/dist/{pipeline-69q2tsLE.d.cts → pipeline-BYkKNpql.d.cts} +1 -1
  168. package/dist/{pipeline-DTqGLPsV.d.ts → pipeline-Cl7KW8CB.d.ts} +1 -1
  169. package/dist/resolvers.d.cts +3 -3
  170. package/dist/resolvers.d.ts +3 -3
  171. package/dist/temporal.cjs +2 -0
  172. package/dist/temporal.cjs.map +1 -0
  173. package/dist/temporal.d.cts +201 -0
  174. package/dist/temporal.d.ts +201 -0
  175. package/dist/temporal.js +2 -0
  176. package/dist/temporal.js.map +1 -0
  177. package/dist/testing.cjs +2 -2
  178. package/dist/testing.cjs.map +1 -1
  179. package/dist/testing.d.cts +13 -12
  180. package/dist/testing.d.ts +13 -12
  181. package/dist/testing.js +1 -1
  182. package/dist/testing.js.map +1 -1
  183. package/dist/uom.cjs +1 -1
  184. package/dist/uom.d.cts +3 -3
  185. package/dist/uom.d.ts +3 -3
  186. package/dist/uom.js +1 -1
  187. package/dist/vm.cjs +1 -1
  188. package/dist/vm.cjs.map +1 -1
  189. package/dist/vm.d.cts +9 -57
  190. package/dist/vm.d.ts +9 -57
  191. package/dist/vm.js +1 -1
  192. package/dist/vm.js.map +1 -1
  193. package/dist/worker.cjs +2 -2
  194. package/dist/worker.cjs.map +1 -1
  195. package/dist/worker.d.cts +36 -14
  196. package/dist/worker.d.ts +36 -14
  197. package/dist/worker.js +2 -2
  198. package/dist/worker.js.map +1 -1
  199. package/package.json +16 -5
  200. package/dist/chunk-2BXNZM3G.js +0 -2
  201. package/dist/chunk-2BXNZM3G.js.map +0 -1
  202. package/dist/chunk-2JSNWYYA.cjs +0 -3
  203. package/dist/chunk-2JSNWYYA.cjs.map +0 -1
  204. package/dist/chunk-3SHWTGTP.js +0 -2
  205. package/dist/chunk-3SHWTGTP.js.map +0 -1
  206. package/dist/chunk-5GL4SAVH.cjs +0 -2
  207. package/dist/chunk-5GL4SAVH.cjs.map +0 -1
  208. package/dist/chunk-5IJD5L3O.cjs.map +0 -1
  209. package/dist/chunk-72N3ZRVE.cjs +0 -2
  210. package/dist/chunk-72N3ZRVE.cjs.map +0 -1
  211. package/dist/chunk-7EP36NXE.js +0 -3
  212. package/dist/chunk-A4JV7HRB.js +0 -3
  213. package/dist/chunk-A4JV7HRB.js.map +0 -1
  214. package/dist/chunk-AUOE7MFI.cjs +0 -2
  215. package/dist/chunk-AUOE7MFI.cjs.map +0 -1
  216. package/dist/chunk-BDF4VCQX.js +0 -3
  217. package/dist/chunk-BDF4VCQX.js.map +0 -1
  218. package/dist/chunk-D2Q2VFJ6.js +0 -2
  219. package/dist/chunk-D2Q2VFJ6.js.map +0 -1
  220. package/dist/chunk-DA7M6H63.cjs +0 -2
  221. package/dist/chunk-DA7M6H63.cjs.map +0 -1
  222. package/dist/chunk-ELQQKZN3.cjs +0 -3
  223. package/dist/chunk-ELQQKZN3.cjs.map +0 -1
  224. package/dist/chunk-F7QIBC4B.cjs +0 -3
  225. package/dist/chunk-F7QIBC4B.cjs.map +0 -1
  226. package/dist/chunk-HQ7BKXG7.js +0 -2
  227. package/dist/chunk-HQ7BKXG7.js.map +0 -1
  228. package/dist/chunk-IHAZL4EF.cjs +0 -2
  229. package/dist/chunk-IHAZL4EF.cjs.map +0 -1
  230. package/dist/chunk-IJMNVBIS.js.map +0 -1
  231. package/dist/chunk-IPSOWFCA.js +0 -2
  232. package/dist/chunk-IPSOWFCA.js.map +0 -1
  233. package/dist/chunk-LM6ZQUEU.js +0 -2
  234. package/dist/chunk-LM6ZQUEU.js.map +0 -1
  235. package/dist/chunk-LTJV3VJE.cjs +0 -2
  236. package/dist/chunk-LTJV3VJE.cjs.map +0 -1
  237. package/dist/chunk-NUF66H57.js +0 -5
  238. package/dist/chunk-NUF66H57.js.map +0 -1
  239. package/dist/chunk-PWWQZFAE.js +0 -2
  240. package/dist/chunk-PWWQZFAE.js.map +0 -1
  241. package/dist/chunk-RE6AIU6Y.js +0 -3
  242. package/dist/chunk-RE6AIU6Y.js.map +0 -1
  243. package/dist/chunk-RECRD45C.cjs +0 -5
  244. package/dist/chunk-RECRD45C.cjs.map +0 -1
  245. package/dist/chunk-RENO2AWO.js +0 -2
  246. package/dist/chunk-RENO2AWO.js.map +0 -1
  247. package/dist/chunk-RMCN5WFO.cjs +0 -2
  248. package/dist/chunk-RMCN5WFO.cjs.map +0 -1
  249. package/dist/chunk-S46R5QZP.cjs +0 -2
  250. package/dist/chunk-S46R5QZP.cjs.map +0 -1
  251. package/dist/chunk-UPH22K2T.cjs +0 -2
  252. package/dist/chunk-UPH22K2T.cjs.map +0 -1
  253. package/dist/chunk-UY3ID6JF.cjs +0 -2
  254. package/dist/chunk-UY3ID6JF.cjs.map +0 -1
  255. package/dist/chunk-WFOQRPA6.js +0 -2
  256. package/dist/chunk-WFOQRPA6.js.map +0 -1
  257. package/dist/chunk-XFJABR3B.js +0 -2
  258. package/dist/chunk-XFJABR3B.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { T as Token } from './Token-CbP_OutD.js';
1
+ import { T as Token } from './Token-D8f7yaz1.js';
2
2
 
3
3
  /**
4
4
  * NormalizerRule, pluggable token normalization rule for the
@@ -320,14 +320,16 @@ interface NormalizerOptions {
320
320
  */
321
321
  onFusion?: (fusion: TokenFusion) => void;
322
322
  /**
323
- * Try every registered rule at every position, ignoring the shape index.
323
+ * Try every registered rule at every position, ignoring both the shape
324
+ * index and the first-token buckets the first call uses.
324
325
  *
325
- * Diagnostic only, and much slower. It exists so the indexed walk can be
326
- * compared against the unindexed one over a corpus: the index is a pure
327
- * filter, so the two must agree token for token, and a rule whose declared
326
+ * Diagnostic only, and much slower. It exists so the filtered walks can be
327
+ * compared against the exhaustive one over a corpus: each filter is pure,
328
+ * so all of them must agree token for token, and a rule whose declared
328
329
  * {@link NormalizerRule.shape} is too narrow shows up as a difference rather
329
330
  * than as a feature that quietly stopped working.
330
- * `NormalizerIndexFidelity.spec` is the consumer.
331
+ * `NormalizerIndexFidelity.spec` and `RuleHintsMatchGuards.spec` are the
332
+ * consumers.
331
333
  *
332
334
  * @default false
333
335
  */
@@ -393,13 +395,12 @@ declare class TokenNormalizer {
393
395
  */
394
396
  private sortedRulesCache;
395
397
  /**
396
- * Per-token-type view of the priority-sorted rules: for a token type, the
397
- * rules that could match a token of that type (those with no
398
- * {@link NormalizerRule.startTokenTypes} hint, plus those that list the type),
399
- * in the same priority order {@link getSortedRules} produces. Built lazily on
400
- * the first token of each type and cached, so a document of many number and
401
- * operator tokens never re-tries the many rules that only fire on an
402
- * identifier. Invalidated alongside {@link sortedRulesCache}.
398
+ * Per-token-type view of the priority-sorted rules, for the one
399
+ * {@link normalize} call that runs before the index exists: for a token
400
+ * type, the rules whose first declared slot admits it (or constrains no
401
+ * type at all), in the same priority order {@link getSortedRules} produces.
402
+ * See {@link rulesForTokenType}. Built once per distinct type and cached,
403
+ * invalidated alongside {@link sortedRulesCache}.
403
404
  */
404
405
  private rulesByTokenType;
405
406
  /**
@@ -421,7 +422,10 @@ declare class TokenNormalizer {
421
422
  * what evaluating a single expression on a fresh engine does, would never
422
423
  * reach the payback. Skipping the build on the first call keeps that case at
423
424
  * the cost it had before the index existed, and a document reaches line two
424
- * immediately.
425
+ * immediately. The first call is not unfiltered, though: it reads the same
426
+ * first-slot types the index would, through {@link rulesForTokenType}, so a
427
+ * single expression still skips every rule that could not start at its
428
+ * tokens.
425
429
  */
426
430
  private normalizeCalls;
427
431
  /**
@@ -467,12 +471,8 @@ declare class TokenNormalizer {
467
471
  */
468
472
  private getSortedRules;
469
473
  /**
470
- * The priority-sorted rules to try at a token of `type`: every rule with no
471
- * {@link NormalizerRule.startTokenTypes} hint, plus those that list this type.
472
- * A rule that declares a different trigger would have returned null here
473
- * anyway, so omitting it is behaviour-preserving. Built once per distinct type
474
- * and cached, which is what turns the per-position rule scan from "try all R
475
- * rules" into "try only the ones that could fire on this token".
474
+ * The shape index over the priority-sorted rules, built on first use after
475
+ * a mutation and cached. See {@link RuleIndex}.
476
476
  */
477
477
  private getRuleIndex;
478
478
  /**
@@ -492,16 +492,35 @@ declare class TokenNormalizer {
492
492
  * wins on both counts. Worst case is 32 iterations per word of pure integer
493
493
  * work.
494
494
  *
495
- * With `null` (the {@link NormalizerOptions.ignoreRuleIndex} path) it falls
496
- * back to the type-bucketed list, which is the behaviour this replaced.
495
+ * With `null` there is no index to consult, for one of two reasons: this is
496
+ * the first call, which reads the first-token bucket from
497
+ * {@link rulesForTokenType}, or {@link NormalizerOptions.ignoreRuleIndex} is
498
+ * set, which is the exhaustive scan every filter is measured against. Both
499
+ * hand back a cached list directly, since the caller only reads it.
497
500
  *
498
- * Returns a buffer reused across positions, so the caller must finish with it
499
- * before calling again. Copying the surviving rules out here rather than
500
- * yielding them lazily is deliberate twice over: it keeps the mask's own
501
- * scratch buffer from being read after the next position overwrites it, and
502
- * it avoids a generator on the hottest loop in the pass.
501
+ * With a mask, returns a buffer reused across positions, so the caller must
502
+ * finish with it before calling again. Copying the surviving rules out here
503
+ * rather than yielding them lazily is deliberate twice over: it keeps the
504
+ * mask's own scratch buffer from being read after the next position
505
+ * overwrites it, and it avoids a generator on the hottest loop in the pass.
503
506
  */
504
507
  private rulesAt;
508
+ /**
509
+ * The priority-sorted rules that could start at a token of `type`, for the
510
+ * first {@link normalize} call, which runs before the index is built.
511
+ *
512
+ * The filter is the first slot of each rule's {@link effectiveShape}: a rule
513
+ * naming types there is bucketed under exactly those, and one naming none is
514
+ * in every bucket. That is the same declaration the index reads at its first
515
+ * plane, only without the value axis, so a rule the bucket omits is one the
516
+ * index would omit too, and one that would have returned null here anyway.
517
+ * An earlier version read only the older `startTokenTypes` hint, which most
518
+ * rules had by then replaced with a `shape`, so the first call tried nearly
519
+ * every rule at every position and a fresh engine evaluating one expression
520
+ * paid several times the rule calls of the second line of a document.
521
+ *
522
+ * Built once per distinct type and cached until the rule set changes.
523
+ */
505
524
  private rulesForTokenType;
506
525
  /**
507
526
  * Get the number of currently registered rules (excludes phrase trie entries).
@@ -1,4 +1,4 @@
1
- import { T as Token } from './Token-CbP_OutD.cjs';
1
+ import { T as Token } from './Token-D8f7yaz1.cjs';
2
2
 
3
3
  /**
4
4
  * NormalizerRule, pluggable token normalization rule for the
@@ -320,14 +320,16 @@ interface NormalizerOptions {
320
320
  */
321
321
  onFusion?: (fusion: TokenFusion) => void;
322
322
  /**
323
- * Try every registered rule at every position, ignoring the shape index.
323
+ * Try every registered rule at every position, ignoring both the shape
324
+ * index and the first-token buckets the first call uses.
324
325
  *
325
- * Diagnostic only, and much slower. It exists so the indexed walk can be
326
- * compared against the unindexed one over a corpus: the index is a pure
327
- * filter, so the two must agree token for token, and a rule whose declared
326
+ * Diagnostic only, and much slower. It exists so the filtered walks can be
327
+ * compared against the exhaustive one over a corpus: each filter is pure,
328
+ * so all of them must agree token for token, and a rule whose declared
328
329
  * {@link NormalizerRule.shape} is too narrow shows up as a difference rather
329
330
  * than as a feature that quietly stopped working.
330
- * `NormalizerIndexFidelity.spec` is the consumer.
331
+ * `NormalizerIndexFidelity.spec` and `RuleHintsMatchGuards.spec` are the
332
+ * consumers.
331
333
  *
332
334
  * @default false
333
335
  */
@@ -393,13 +395,12 @@ declare class TokenNormalizer {
393
395
  */
394
396
  private sortedRulesCache;
395
397
  /**
396
- * Per-token-type view of the priority-sorted rules: for a token type, the
397
- * rules that could match a token of that type (those with no
398
- * {@link NormalizerRule.startTokenTypes} hint, plus those that list the type),
399
- * in the same priority order {@link getSortedRules} produces. Built lazily on
400
- * the first token of each type and cached, so a document of many number and
401
- * operator tokens never re-tries the many rules that only fire on an
402
- * identifier. Invalidated alongside {@link sortedRulesCache}.
398
+ * Per-token-type view of the priority-sorted rules, for the one
399
+ * {@link normalize} call that runs before the index exists: for a token
400
+ * type, the rules whose first declared slot admits it (or constrains no
401
+ * type at all), in the same priority order {@link getSortedRules} produces.
402
+ * See {@link rulesForTokenType}. Built once per distinct type and cached,
403
+ * invalidated alongside {@link sortedRulesCache}.
403
404
  */
404
405
  private rulesByTokenType;
405
406
  /**
@@ -421,7 +422,10 @@ declare class TokenNormalizer {
421
422
  * what evaluating a single expression on a fresh engine does, would never
422
423
  * reach the payback. Skipping the build on the first call keeps that case at
423
424
  * the cost it had before the index existed, and a document reaches line two
424
- * immediately.
425
+ * immediately. The first call is not unfiltered, though: it reads the same
426
+ * first-slot types the index would, through {@link rulesForTokenType}, so a
427
+ * single expression still skips every rule that could not start at its
428
+ * tokens.
425
429
  */
426
430
  private normalizeCalls;
427
431
  /**
@@ -467,12 +471,8 @@ declare class TokenNormalizer {
467
471
  */
468
472
  private getSortedRules;
469
473
  /**
470
- * The priority-sorted rules to try at a token of `type`: every rule with no
471
- * {@link NormalizerRule.startTokenTypes} hint, plus those that list this type.
472
- * A rule that declares a different trigger would have returned null here
473
- * anyway, so omitting it is behaviour-preserving. Built once per distinct type
474
- * and cached, which is what turns the per-position rule scan from "try all R
475
- * rules" into "try only the ones that could fire on this token".
474
+ * The shape index over the priority-sorted rules, built on first use after
475
+ * a mutation and cached. See {@link RuleIndex}.
476
476
  */
477
477
  private getRuleIndex;
478
478
  /**
@@ -492,16 +492,35 @@ declare class TokenNormalizer {
492
492
  * wins on both counts. Worst case is 32 iterations per word of pure integer
493
493
  * work.
494
494
  *
495
- * With `null` (the {@link NormalizerOptions.ignoreRuleIndex} path) it falls
496
- * back to the type-bucketed list, which is the behaviour this replaced.
495
+ * With `null` there is no index to consult, for one of two reasons: this is
496
+ * the first call, which reads the first-token bucket from
497
+ * {@link rulesForTokenType}, or {@link NormalizerOptions.ignoreRuleIndex} is
498
+ * set, which is the exhaustive scan every filter is measured against. Both
499
+ * hand back a cached list directly, since the caller only reads it.
497
500
  *
498
- * Returns a buffer reused across positions, so the caller must finish with it
499
- * before calling again. Copying the surviving rules out here rather than
500
- * yielding them lazily is deliberate twice over: it keeps the mask's own
501
- * scratch buffer from being read after the next position overwrites it, and
502
- * it avoids a generator on the hottest loop in the pass.
501
+ * With a mask, returns a buffer reused across positions, so the caller must
502
+ * finish with it before calling again. Copying the surviving rules out here
503
+ * rather than yielding them lazily is deliberate twice over: it keeps the
504
+ * mask's own scratch buffer from being read after the next position
505
+ * overwrites it, and it avoids a generator on the hottest loop in the pass.
503
506
  */
504
507
  private rulesAt;
508
+ /**
509
+ * The priority-sorted rules that could start at a token of `type`, for the
510
+ * first {@link normalize} call, which runs before the index is built.
511
+ *
512
+ * The filter is the first slot of each rule's {@link effectiveShape}: a rule
513
+ * naming types there is bucketed under exactly those, and one naming none is
514
+ * in every bucket. That is the same declaration the index reads at its first
515
+ * plane, only without the value axis, so a rule the bucket omits is one the
516
+ * index would omit too, and one that would have returned null here anyway.
517
+ * An earlier version read only the older `startTokenTypes` hint, which most
518
+ * rules had by then replaced with a `shape`, so the first call tried nearly
519
+ * every rule at every position and a fresh engine evaluating one expression
520
+ * paid several times the rule calls of the second line of a document.
521
+ *
522
+ * Built once per distinct type and cached until the rule set changes.
523
+ */
505
524
  private rulesForTokenType;
506
525
  /**
507
526
  * Get the number of currently registered rules (excludes phrase trie entries).
@@ -1,7 +1,8 @@
1
- import { V as Value } from './Value-Ds3Gy07C.js';
2
- import { U as UserFunctionDef, A as AnonymousBodyDef, a as BytecodeProgram } from './BytecodeBuilder-aqVa7Plx.js';
3
- import { E as EngineError } from './EngineError-D1kXsjIj.js';
4
- import { D as DiagnosticPipeline } from './pipeline-DTqGLPsV.js';
1
+ import { V as Value } from './Value-BYHw-x7q.js';
2
+ import { U as UserFunctionDef, A as AnonymousBodyDef, a as BytecodeProgram } from './BytecodeBuilder-DSWKZi4f.js';
3
+ import { C as CalendarBackend } from './CalendarBackend-MdS3Bb4P.js';
4
+ import { E as EngineError } from './EngineError-C-kBwYlN.js';
5
+ import { D as DiagnosticPipeline } from './pipeline-Cl7KW8CB.js';
5
6
 
6
7
  /**
7
8
  * Create a new VM instance with the given opcode registry and configurable limits.
@@ -83,6 +84,14 @@ interface LineExecutionContext {
83
84
  * message that describes a different fault. Absent means enabled.
84
85
  */
85
86
  networkEnabled?: boolean;
87
+ /**
88
+ * The calendar backend this engine computes dates with (`EngineContext.calendar`).
89
+ * A plugin function that reads or steps a date computes through it, so the
90
+ * date it answers agrees with the one the VM's own opcodes would produce.
91
+ * Absent means the `Date` backend; `calendarOf()` in
92
+ * `calendar/DateCalendar.ts` resolves either case.
93
+ */
94
+ calendar?: CalendarBackend;
86
95
  /** Look up another line's cached result by 1-based line number. `undefined` = not evaluated yet (or out of range), distinct from a line that evaluated to an actual `undefined`-like Value, which can't happen (every Value type has a concrete representation). */
87
96
  getLineResult?: (lineNumber: number) => Value | undefined;
88
97
  /** Whether line `lineNumber` is a blank line or a `#` heading, the stopping condition for "total above"/"sum above"/"average above" aggregation. */
@@ -190,11 +199,13 @@ declare function executeBytecode(bytecode: Bytecode, vm: VM, pipeline?: Diagnost
190
199
  * by that engine. Anything that needs one of these registries receives the
191
200
  * context rather than importing a singleton.
192
201
  *
193
- * Runtime imports here are restricted to leaf modules of `vm/`. This file is
194
- * imported by `vm/`, which `engine/` imports in turn, so pulling in anything
195
- * that reaches back into `engine/` would close a cycle. `OpRegistry` is safe
196
- * because it imports only types plus the error factory. Everything else arrives
197
- * through `import type`, which is erased before the code runs.
202
+ * Runtime imports here are restricted to leaf modules of `vm/` and
203
+ * `calendar/`. This file is imported by `vm/`, which `engine/` imports in
204
+ * turn, so pulling in anything that reaches back into `engine/` would close a
205
+ * cycle. `OpRegistry` is safe because it imports only types plus the error
206
+ * factory, and the `Date` calendar backend imports nothing of the engine's at
207
+ * all. Everything else arrives through `import type`, which is erased before
208
+ * the code runs.
198
209
  */
199
210
 
200
211
  /**
@@ -268,6 +279,18 @@ interface EngineContext {
268
279
  * the context is the one object every VM already holds.
269
280
  */
270
281
  readonly networkEnabled: boolean;
282
+ /**
283
+ * The calendar this engine computes dates with, from the engine's
284
+ * `calendar` option.
285
+ *
286
+ * One backend per engine, held here for the same reason the network
287
+ * switch is: the VM is where a date literal is stepped, a working-day
288
+ * walk runs and `now` is read, and every plugin function that touches a
289
+ * date reaches it through the execution context the VM builds from this
290
+ * one object. Defaults to Temporal where the runtime has it and `Date`
291
+ * where it does not. See `calendar/resolveCalendar.ts`.
292
+ */
293
+ readonly calendar: CalendarBackend;
271
294
  }
272
295
 
273
296
  /**
@@ -705,4 +728,63 @@ declare class ScopeManager {
705
728
  clear(): void;
706
729
  }
707
730
 
708
- export { type Bytecode as B, DependencyGraph as D, type ExpressionRecord as E, OpRegistry as O, type PluginFunctionHandler as P, ScopeManager as S, type VM as V, type DagSnapshot as a, type EngineContext as b, createVM as c, executeBytecode as e, sharedOpRegistry as s };
731
+ /**
732
+ * Registry of built-in mathematical functions.
733
+ * Indexed by the number pushed as an operand of OpCode.CALL_BUILTIN.
734
+ */
735
+ declare const builtinFunctions: Record<number, (args: Value[]) => Value>;
736
+ /**
737
+ * Registry of package-registered functions, indexed by the number pushed as an
738
+ * operand of `OpCode.CALL_PLUGIN`.
739
+ *
740
+ * Functions may return a promise. The orchestrator resolves it and re-executes
741
+ * rather than blocking the VM.
742
+ *
743
+ * Populated declaratively via {@link IEnginePackage.pluginFunctions} at
744
+ * package-registration time. Entries are cleared on unregister.
745
+ *
746
+ * @deprecated This is the {@link defaultEngineContext}'s map, kept as a
747
+ * module-level alias so existing callers keep working during the context
748
+ * migration. An engine registers into its own context, so writing here affects
749
+ * only code that has not been migrated. Take an {@link EngineContext} instead.
750
+ */
751
+ declare const pluginFunctionRegistry: Record<number, PluginFunctionHandler>;
752
+ /**
753
+ * Allocate a unique index into {@link pluginFunctionRegistry} for a package's
754
+ * plugin function.
755
+ *
756
+ * Call once per function, typically at module scope, right where the
757
+ * function is defined, and store the result in a constant. Don't hardcode
758
+ * an index: two packages independently picking the same arbitrary number
759
+ * would silently overwrite each other's handler in the shared registry.
760
+ *
761
+ * @throws If the index pool is exhausted (up to 65536: two opcode-stream bytes
762
+ * via CALL_PLUGIN_WIDE, the first 256 via the one-byte CALL_PLUGIN).
763
+ */
764
+ declare function allocatePluginFunctionIndex(): number;
765
+ /**
766
+ * The stable index for a package's named plugin function, allocated once per
767
+ * `${packageName}:${functionName}` and cached process-wide, so the same function
768
+ * always maps to the same {@link pluginFunctionRegistry} slot no matter which
769
+ * engine registers it or in what order: the property compiled bytecode, and so
770
+ * a snapshot, relies on.
771
+ *
772
+ * The engine calls this at {@link ExpressionEngine.registerPackage} time for each
773
+ * entry of a package's `pluginFunctions` record, so a package author names the
774
+ * function and never sees an index. {@link allocatePluginFunctionIndex} remains
775
+ * for a host that needs a raw index directly.
776
+ */
777
+ declare function pluginFunctionIndexFor(qualifiedName: string): number;
778
+ /**
779
+ * A package-registered `as <name>` converter: the value on the left of `as`
780
+ * in, the converted value out.
781
+ *
782
+ * The optional `context` is the per-line execution context the VM passes to
783
+ * a plugin function, handed to a converter for the same reason: a converter
784
+ * that reads a date computes through the engine's calendar backend on it
785
+ * rather than a module-level default, so `<date> as weekday` and `weekday on
786
+ * <date>` cannot disagree. A converter that needs nothing from it ignores it.
787
+ */
788
+ type AsConverter = (value: Value, context?: LineExecutionContext) => Value;
789
+
790
+ export { type AsConverter as A, type Bytecode as B, DependencyGraph as D, type ExpressionRecord as E, type LineExecutionContext as L, OpRegistry as O, type PluginFunctionHandler as P, ScopeManager as S, type VM as V, allocatePluginFunctionIndex as a, builtinFunctions as b, createVM as c, pluginFunctionRegistry as d, executeBytecode as e, type DagSnapshot as f, type EngineContext as g, pluginFunctionIndexFor as p, sharedOpRegistry as s };
@@ -1,7 +1,8 @@
1
- import { V as Value } from './Value-Ds3Gy07C.cjs';
2
- import { U as UserFunctionDef, A as AnonymousBodyDef, a as BytecodeProgram } from './BytecodeBuilder-aqVa7Plx.cjs';
3
- import { E as EngineError } from './EngineError-D1kXsjIj.cjs';
4
- import { D as DiagnosticPipeline } from './pipeline-69q2tsLE.cjs';
1
+ import { V as Value } from './Value-BYHw-x7q.cjs';
2
+ import { U as UserFunctionDef, A as AnonymousBodyDef, a as BytecodeProgram } from './BytecodeBuilder-DSWKZi4f.cjs';
3
+ import { C as CalendarBackend } from './CalendarBackend-MdS3Bb4P.cjs';
4
+ import { E as EngineError } from './EngineError-C-kBwYlN.cjs';
5
+ import { D as DiagnosticPipeline } from './pipeline-BYkKNpql.cjs';
5
6
 
6
7
  /**
7
8
  * Create a new VM instance with the given opcode registry and configurable limits.
@@ -83,6 +84,14 @@ interface LineExecutionContext {
83
84
  * message that describes a different fault. Absent means enabled.
84
85
  */
85
86
  networkEnabled?: boolean;
87
+ /**
88
+ * The calendar backend this engine computes dates with (`EngineContext.calendar`).
89
+ * A plugin function that reads or steps a date computes through it, so the
90
+ * date it answers agrees with the one the VM's own opcodes would produce.
91
+ * Absent means the `Date` backend; `calendarOf()` in
92
+ * `calendar/DateCalendar.ts` resolves either case.
93
+ */
94
+ calendar?: CalendarBackend;
86
95
  /** Look up another line's cached result by 1-based line number. `undefined` = not evaluated yet (or out of range), distinct from a line that evaluated to an actual `undefined`-like Value, which can't happen (every Value type has a concrete representation). */
87
96
  getLineResult?: (lineNumber: number) => Value | undefined;
88
97
  /** Whether line `lineNumber` is a blank line or a `#` heading, the stopping condition for "total above"/"sum above"/"average above" aggregation. */
@@ -190,11 +199,13 @@ declare function executeBytecode(bytecode: Bytecode, vm: VM, pipeline?: Diagnost
190
199
  * by that engine. Anything that needs one of these registries receives the
191
200
  * context rather than importing a singleton.
192
201
  *
193
- * Runtime imports here are restricted to leaf modules of `vm/`. This file is
194
- * imported by `vm/`, which `engine/` imports in turn, so pulling in anything
195
- * that reaches back into `engine/` would close a cycle. `OpRegistry` is safe
196
- * because it imports only types plus the error factory. Everything else arrives
197
- * through `import type`, which is erased before the code runs.
202
+ * Runtime imports here are restricted to leaf modules of `vm/` and
203
+ * `calendar/`. This file is imported by `vm/`, which `engine/` imports in
204
+ * turn, so pulling in anything that reaches back into `engine/` would close a
205
+ * cycle. `OpRegistry` is safe because it imports only types plus the error
206
+ * factory, and the `Date` calendar backend imports nothing of the engine's at
207
+ * all. Everything else arrives through `import type`, which is erased before
208
+ * the code runs.
198
209
  */
199
210
 
200
211
  /**
@@ -268,6 +279,18 @@ interface EngineContext {
268
279
  * the context is the one object every VM already holds.
269
280
  */
270
281
  readonly networkEnabled: boolean;
282
+ /**
283
+ * The calendar this engine computes dates with, from the engine's
284
+ * `calendar` option.
285
+ *
286
+ * One backend per engine, held here for the same reason the network
287
+ * switch is: the VM is where a date literal is stepped, a working-day
288
+ * walk runs and `now` is read, and every plugin function that touches a
289
+ * date reaches it through the execution context the VM builds from this
290
+ * one object. Defaults to Temporal where the runtime has it and `Date`
291
+ * where it does not. See `calendar/resolveCalendar.ts`.
292
+ */
293
+ readonly calendar: CalendarBackend;
271
294
  }
272
295
 
273
296
  /**
@@ -705,4 +728,63 @@ declare class ScopeManager {
705
728
  clear(): void;
706
729
  }
707
730
 
708
- export { type Bytecode as B, DependencyGraph as D, type ExpressionRecord as E, OpRegistry as O, type PluginFunctionHandler as P, ScopeManager as S, type VM as V, type DagSnapshot as a, type EngineContext as b, createVM as c, executeBytecode as e, sharedOpRegistry as s };
731
+ /**
732
+ * Registry of built-in mathematical functions.
733
+ * Indexed by the number pushed as an operand of OpCode.CALL_BUILTIN.
734
+ */
735
+ declare const builtinFunctions: Record<number, (args: Value[]) => Value>;
736
+ /**
737
+ * Registry of package-registered functions, indexed by the number pushed as an
738
+ * operand of `OpCode.CALL_PLUGIN`.
739
+ *
740
+ * Functions may return a promise. The orchestrator resolves it and re-executes
741
+ * rather than blocking the VM.
742
+ *
743
+ * Populated declaratively via {@link IEnginePackage.pluginFunctions} at
744
+ * package-registration time. Entries are cleared on unregister.
745
+ *
746
+ * @deprecated This is the {@link defaultEngineContext}'s map, kept as a
747
+ * module-level alias so existing callers keep working during the context
748
+ * migration. An engine registers into its own context, so writing here affects
749
+ * only code that has not been migrated. Take an {@link EngineContext} instead.
750
+ */
751
+ declare const pluginFunctionRegistry: Record<number, PluginFunctionHandler>;
752
+ /**
753
+ * Allocate a unique index into {@link pluginFunctionRegistry} for a package's
754
+ * plugin function.
755
+ *
756
+ * Call once per function, typically at module scope, right where the
757
+ * function is defined, and store the result in a constant. Don't hardcode
758
+ * an index: two packages independently picking the same arbitrary number
759
+ * would silently overwrite each other's handler in the shared registry.
760
+ *
761
+ * @throws If the index pool is exhausted (up to 65536: two opcode-stream bytes
762
+ * via CALL_PLUGIN_WIDE, the first 256 via the one-byte CALL_PLUGIN).
763
+ */
764
+ declare function allocatePluginFunctionIndex(): number;
765
+ /**
766
+ * The stable index for a package's named plugin function, allocated once per
767
+ * `${packageName}:${functionName}` and cached process-wide, so the same function
768
+ * always maps to the same {@link pluginFunctionRegistry} slot no matter which
769
+ * engine registers it or in what order: the property compiled bytecode, and so
770
+ * a snapshot, relies on.
771
+ *
772
+ * The engine calls this at {@link ExpressionEngine.registerPackage} time for each
773
+ * entry of a package's `pluginFunctions` record, so a package author names the
774
+ * function and never sees an index. {@link allocatePluginFunctionIndex} remains
775
+ * for a host that needs a raw index directly.
776
+ */
777
+ declare function pluginFunctionIndexFor(qualifiedName: string): number;
778
+ /**
779
+ * A package-registered `as <name>` converter: the value on the left of `as`
780
+ * in, the converted value out.
781
+ *
782
+ * The optional `context` is the per-line execution context the VM passes to
783
+ * a plugin function, handed to a converter for the same reason: a converter
784
+ * that reads a date computes through the engine's calendar backend on it
785
+ * rather than a module-level default, so `<date> as weekday` and `weekday on
786
+ * <date>` cannot disagree. A converter that needs nothing from it ignores it.
787
+ */
788
+ type AsConverter = (value: Value, context?: LineExecutionContext) => Value;
789
+
790
+ export { type AsConverter as A, type Bytecode as B, DependencyGraph as D, type ExpressionRecord as E, type LineExecutionContext as L, OpRegistry as O, type PluginFunctionHandler as P, ScopeManager as S, type VM as V, allocatePluginFunctionIndex as a, builtinFunctions as b, createVM as c, pluginFunctionRegistry as d, executeBytecode as e, type DagSnapshot as f, type EngineContext as g, pluginFunctionIndexFor as p, sharedOpRegistry as s };
@@ -1,6 +1,6 @@
1
- import { V as Value } from './Value-Ds3Gy07C.js';
2
- import { V as VM } from './ScopeManager-BQBhlDAu.js';
3
- import { U as UserFunctionDef } from './BytecodeBuilder-aqVa7Plx.js';
1
+ import { V as Value } from './Value-BYHw-x7q.js';
2
+ import { V as VM } from './VMBuiltins-CZiZRKn-.js';
3
+ import { U as UserFunctionDef } from './BytecodeBuilder-DSWKZi4f.js';
4
4
 
5
5
  /**
6
6
  * A point-in-time snapshot of VM variable state.
@@ -1,6 +1,6 @@
1
- import { V as Value } from './Value-Ds3Gy07C.cjs';
2
- import { V as VM } from './ScopeManager-DrXB3Nvm.cjs';
3
- import { U as UserFunctionDef } from './BytecodeBuilder-aqVa7Plx.cjs';
1
+ import { V as Value } from './Value-BYHw-x7q.cjs';
2
+ import { V as VM } from './VMBuiltins-kv4rr0y5.cjs';
3
+ import { U as UserFunctionDef } from './BytecodeBuilder-DSWKZi4f.cjs';
4
4
 
5
5
  /**
6
6
  * A point-in-time snapshot of VM variable state.
@@ -250,6 +250,23 @@ interface SplitData {
250
250
  * switches on `kind` keeps working for the ones it already knows.
251
251
  */
252
252
  type ChartKind = "sparkline" | "plot";
253
+ /**
254
+ * What a `Datetime`'s epoch-millisecond payload anchors.
255
+ *
256
+ * Three questions share one number and mean different things by it, which is
257
+ * why the distinction is recorded rather than inferred:
258
+ *
259
+ * - `date`: a calendar day, held as its local midnight (`2026-04-03`,
260
+ * `3 April 2026`, `03/04/2026`). The time of day carries no meaning.
261
+ * - `datetime`: a wall-clock reading on a day, in the calendar backend's own
262
+ * zone (`2026-04-03T09:30`, `6pm`). The reading is what was named; the
263
+ * instant follows from the zone it is read in.
264
+ * - `instant`: a fixed point on the timeline, named without depending on a
265
+ * zone (`2026-04-03T10:30:00Z`, `...+09:00`, `now`).
266
+ *
267
+ * See {@link Value.grain} for why the number cannot answer this on its own.
268
+ */
269
+ type DatetimeGrain = "date" | "datetime" | "instant";
253
270
  /**
254
271
  * A chart specification: the DATA to draw, never pixels. One shape holds every
255
272
  * visual the engine produces, `[1,2,3] as sparkline` and `plot sin(x) from 0 to
@@ -407,6 +424,45 @@ declare class Value {
407
424
  * by {@link recycle} alongside the other sidecars.
408
425
  */
409
426
  decimalPlaces?: number;
427
+ /**
428
+ * What this instant anchors: a calendar day, a wall-clock reading on one, or
429
+ * a fixed point on the timeline.
430
+ *
431
+ * The fifth sidecar, the same shape as {@link exact}, {@link rational},
432
+ * {@link uncertainty} and {@link decimalPlaces} and for the same reason: a
433
+ * `Datetime`'s payload is epoch milliseconds and has to stay a plain number,
434
+ * because the arena union, the worker DTO, the snapshot's Datetime variant
435
+ * and the `Datetime` SUB path all read it as one. The number cannot say
436
+ * which of three questions it is the answer to, and the difference is not
437
+ * recoverable from it: `formatDatetime` decides whether to print a time by
438
+ * testing whether the local hour, minute, second and millisecond are all
439
+ * zero, which is a guess that `2026-04-03T09:00:00+09:00` under `TZ=UTC`
440
+ * gets wrong, because the nine o'clock the reader typed IS UTC midnight.
441
+ *
442
+ * Set only where the shape is known: a date literal is `'date'`, a
443
+ * wall-clock literal (`2026-04-03T09:30`, `6pm`) is `'datetime'`, a literal
444
+ * carrying `Z` or an offset is `'instant'`, and so is `now`. Absent means
445
+ * not recorded, which every reader treats as an instant rather than
446
+ * inferring one. Nothing in 2.26.0 displays it: the formatter does not read
447
+ * it, so every rendered date is byte-identical to 2.25.0. Cleared by
448
+ * {@link recycle} alongside the other sidecars.
449
+ */
450
+ grain?: DatetimeGrain;
451
+ /**
452
+ * The zone this instant should be read and displayed in, when the line
453
+ * named one.
454
+ *
455
+ * A zone reference in the encoding `calendar/IntlZone.ts` documents: an IANA
456
+ * name (`"Asia/Tokyo"`) or a fixed offset (`"UTCOFFSET:540"`). Set by
457
+ * `<datetime> in <zone>` and by an ISO literal carrying `Z` or an explicit
458
+ * offset, which names an offset rather than a zone and so records one.
459
+ * Absent means the value is read in the calendar backend's own zone, which
460
+ * is what every `Datetime` meant before this sidecar existed. Like
461
+ * {@link grain} it is recorded and readable in 2.26.0 and read by the
462
+ * formatter from 3.0. Cleared by {@link recycle} alongside the other
463
+ * sidecars.
464
+ */
465
+ zone?: string;
410
466
  constructor(type: ValueType, value: number | bigint | string | boolean | MatrixData | RangeData | ColourData | SplitData | ChartData | IpCidrData | SymbolicNode, unit?: string);
411
467
  /**
412
468
  * Phase 5.3: Reset all fields for arena reuse.
@@ -533,4 +589,4 @@ declare function colVectorValue(data: readonly number[]): Value;
533
589
  /** Create a Range value, a first-class integer range `min:max`, both bounds inclusive. */
534
590
  declare function rangeValue(min: number, max: number): Value;
535
591
 
536
- export { type ColourData as C, type IpCidrData as I, type MatrixData as M, type RangeData as R, type SplitData as S, Value as V, ValueType as a, type MatrixEntry as b, bigIntValue as c, colVectorValue as d, rowVectorValue as e, type ChartData as f, type SymbolicNode as g, hexValue as h, type ColourFormat as i, matrixValue as m, numberValue as n, rangeValue as r, stringValue as s, uomValue as u };
592
+ export { type ColourData as C, type DatetimeGrain as D, type IpCidrData as I, type MatrixData as M, type RangeData as R, type SplitData as S, Value as V, type MatrixEntry as a, ValueType as b, bigIntValue as c, colVectorValue as d, rowVectorValue as e, type ChartData as f, type SymbolicNode as g, hexValue as h, type ColourFormat as i, matrixValue as m, numberValue as n, rangeValue as r, stringValue as s, uomValue as u };