solve-engine 2.25.0 → 2.27.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 (240) hide show
  1. package/dist/CalendarBackend-MdS3Bb4P.d.cts +181 -0
  2. package/dist/CalendarBackend-MdS3Bb4P.d.ts +181 -0
  3. package/dist/{Configuration-DnzYPmoK.d.cts → Configuration-BxriK9Kw.d.cts} +63 -4
  4. package/dist/{Configuration-DnzYPmoK.d.ts → Configuration-BxriK9Kw.d.ts} +63 -4
  5. package/dist/DateCalendar-B85t6Vk6.d.ts +90 -0
  6. package/dist/DateCalendar-CUGI1fT4.d.cts +90 -0
  7. package/dist/{EngineError-fR1K1rvx.d.cts → EngineError-C-kBwYlN.d.cts} +31 -4
  8. package/dist/{EngineError-fR1K1rvx.d.ts → EngineError-C-kBwYlN.d.ts} +31 -4
  9. package/dist/{FormattingSettings-bRKjU7wI.d.ts → FormattingSettings-ByO-4wiM.d.cts} +14 -0
  10. package/dist/{FormattingSettings-bRKjU7wI.d.cts → FormattingSettings-CvCzAfsz.d.ts} +14 -0
  11. package/dist/{Lexer-aB95pjoX.d.cts → Lexer-DhGhoAa2.d.cts} +13 -3
  12. package/dist/{Lexer-Bmctxl0n.d.ts → Lexer-DqtnZMC5.d.ts} +13 -3
  13. package/dist/{PackageCompatibility-CUVg8tmt.d.cts → PackageCompatibility-CNiTtC6S.d.cts} +1 -1
  14. package/dist/{PackageCompatibility-BludTs7v.d.ts → PackageCompatibility-fj_f7uqC.d.ts} +1 -1
  15. package/dist/{PackageRegistry-Dvn4i2QK.d.cts → PackageRegistry-BHBCFswo.d.cts} +328 -14
  16. package/dist/{PackageRegistry-DT-x32OM.d.ts → PackageRegistry-CNZUwWHJ.d.ts} +328 -14
  17. package/dist/{Parselet-BawfGuTF.d.cts → Parselet-DF3864la.d.cts} +19 -3
  18. package/dist/{Parselet-DqTbbtWA.d.ts → Parselet-Dgymjxzd.d.ts} +19 -3
  19. package/dist/{Token-CbP_OutD.d.cts → Token-D8f7yaz1.d.cts} +17 -0
  20. package/dist/{Token-CbP_OutD.d.ts → Token-D8f7yaz1.d.ts} +17 -0
  21. package/dist/{TokenNormalizer-CLBtiE8M.d.ts → TokenNormalizer-IF7nPRMp.d.ts} +1 -1
  22. package/dist/{TokenNormalizer-CjTDmHgB.d.cts → TokenNormalizer-Pe3_390t.d.cts} +1 -1
  23. package/dist/{ScopeManager-B636am7Y.d.ts → VMBuiltins-CZiZRKn-.d.ts} +91 -9
  24. package/dist/{ScopeManager-CdwX0VTw.d.cts → VMBuiltins-kv4rr0y5.d.cts} +91 -9
  25. package/dist/{VMCheckpoints-DDlxNssY.d.ts → VMCheckpoints-DXze6ypg.d.ts} +2 -2
  26. package/dist/{VMCheckpoints-CYqeq8IV.d.cts → VMCheckpoints-yun4ocSv.d.cts} +2 -2
  27. package/dist/{Value-Ds3Gy07C.d.cts → Value-BYHw-x7q.d.cts} +57 -1
  28. package/dist/{Value-Ds3Gy07C.d.ts → Value-BYHw-x7q.d.ts} +57 -1
  29. package/dist/{WorkerError-B1dF3VYT.d.cts → WorkerError-BLZyNq6M.d.cts} +1 -1
  30. package/dist/{WorkerError-dneODN-u.d.ts → WorkerError-CfBJYueR.d.ts} +1 -1
  31. package/dist/chunk-2SYYKQ4Q.cjs +2 -0
  32. package/dist/chunk-2SYYKQ4Q.cjs.map +1 -0
  33. package/dist/chunk-6EYKVQT3.cjs +2 -0
  34. package/dist/chunk-6EYKVQT3.cjs.map +1 -0
  35. package/dist/chunk-7RC6RBS6.cjs +2 -0
  36. package/dist/chunk-7RC6RBS6.cjs.map +1 -0
  37. package/dist/chunk-AZX4NTYN.cjs +3 -0
  38. package/dist/chunk-AZX4NTYN.cjs.map +1 -0
  39. package/dist/{chunk-JFZ5SLF7.js → chunk-BCR53EIL.js} +2 -2
  40. package/dist/{chunk-JFZ5SLF7.js.map → chunk-BCR53EIL.js.map} +1 -1
  41. package/dist/chunk-BCY2WY5P.js +5 -0
  42. package/dist/chunk-BCY2WY5P.js.map +1 -0
  43. package/dist/chunk-BLJ6E577.js +2 -0
  44. package/dist/chunk-BLJ6E577.js.map +1 -0
  45. package/dist/chunk-CL7DM2FX.js +2 -0
  46. package/dist/chunk-CL7DM2FX.js.map +1 -0
  47. package/dist/{chunk-BMXYR5LI.cjs → chunk-CQLCTKMX.cjs} +2 -2
  48. package/dist/{chunk-BMXYR5LI.cjs.map → chunk-CQLCTKMX.cjs.map} +1 -1
  49. package/dist/chunk-D4VBWPWN.js +2 -0
  50. package/dist/chunk-D4VBWPWN.js.map +1 -0
  51. package/dist/chunk-DFMAZ6XM.cjs +3 -0
  52. package/dist/chunk-DFMAZ6XM.cjs.map +1 -0
  53. package/dist/chunk-E4HAKNBQ.cjs +2 -0
  54. package/dist/chunk-E4HAKNBQ.cjs.map +1 -0
  55. package/dist/{chunk-XHQYHXRE.js → chunk-ESZNJQ2C.js} +3 -3
  56. package/dist/{chunk-XHQYHXRE.js.map → chunk-ESZNJQ2C.js.map} +1 -1
  57. package/dist/{chunk-IJMNVBIS.js → chunk-FAO6DQ74.js} +2 -2
  58. package/dist/chunk-FAO6DQ74.js.map +1 -0
  59. package/dist/{chunk-WGP4UUO5.cjs → chunk-FDKTESBC.cjs} +2 -2
  60. package/dist/{chunk-WGP4UUO5.cjs.map → chunk-FDKTESBC.cjs.map} +1 -1
  61. package/dist/{chunk-NEGZZB7F.cjs → chunk-G2V33LFM.cjs} +2 -2
  62. package/dist/{chunk-NEGZZB7F.cjs.map → chunk-G2V33LFM.cjs.map} +1 -1
  63. package/dist/chunk-GJZIJK2Q.cjs +2 -0
  64. package/dist/chunk-GJZIJK2Q.cjs.map +1 -0
  65. package/dist/chunk-GVL3ZMS7.cjs +2 -0
  66. package/dist/chunk-GVL3ZMS7.cjs.map +1 -0
  67. package/dist/{chunk-YBQPEWT7.cjs → chunk-GXO7TSXQ.cjs} +3 -3
  68. package/dist/chunk-GXO7TSXQ.cjs.map +1 -0
  69. package/dist/{chunk-OONQ3V3I.js → chunk-HANGBVEE.js} +2 -2
  70. package/dist/{chunk-OONQ3V3I.js.map → chunk-HANGBVEE.js.map} +1 -1
  71. package/dist/chunk-J4K72CQN.js +2 -0
  72. package/dist/chunk-J4K72CQN.js.map +1 -0
  73. package/dist/{chunk-72PYPENZ.js → chunk-LE6WZLJ4.js} +2 -2
  74. package/dist/{chunk-72PYPENZ.js.map → chunk-LE6WZLJ4.js.map} +1 -1
  75. package/dist/chunk-LQIRBP4Q.js +2 -0
  76. package/dist/chunk-LQIRBP4Q.js.map +1 -0
  77. package/dist/{chunk-RDYXH7ML.js → chunk-LTUYWJGO.js} +2 -2
  78. package/dist/{chunk-RDYXH7ML.js.map → chunk-LTUYWJGO.js.map} +1 -1
  79. package/dist/chunk-O5PO4D2A.cjs +2 -0
  80. package/dist/chunk-O5PO4D2A.cjs.map +1 -0
  81. package/dist/chunk-PQFI55AC.js +3 -0
  82. package/dist/chunk-PQFI55AC.js.map +1 -0
  83. package/dist/chunk-QQHHZPEW.cjs +2 -0
  84. package/dist/chunk-QQHHZPEW.cjs.map +1 -0
  85. package/dist/chunk-REZQFPVX.js +2 -0
  86. package/dist/chunk-REZQFPVX.js.map +1 -0
  87. package/dist/chunk-RRUGQ6DM.js +2 -0
  88. package/dist/chunk-RRUGQ6DM.js.map +1 -0
  89. package/dist/chunk-S3ODNMJS.js +2 -0
  90. package/dist/chunk-S3ODNMJS.js.map +1 -0
  91. package/dist/{chunk-SAF3B3AX.cjs → chunk-SE6ZCGZ5.cjs} +2 -2
  92. package/dist/{chunk-SAF3B3AX.cjs.map → chunk-SE6ZCGZ5.cjs.map} +1 -1
  93. package/dist/chunk-TC23XEAV.js +2 -0
  94. package/dist/chunk-TC23XEAV.js.map +1 -0
  95. package/dist/{chunk-FYAMQFZZ.cjs → chunk-TMQ37JQY.cjs} +3 -3
  96. package/dist/{chunk-FYAMQFZZ.cjs.map → chunk-TMQ37JQY.cjs.map} +1 -1
  97. package/dist/chunk-TPPM4QSS.cjs +2 -0
  98. package/dist/chunk-TPPM4QSS.cjs.map +1 -0
  99. package/dist/chunk-UVHD7BBC.js +3 -0
  100. package/dist/{chunk-ZDCZ5IDD.js.map → chunk-UVHD7BBC.js.map} +1 -1
  101. package/dist/{chunk-57PSJQQW.js → chunk-VB6QMU2W.js} +3 -3
  102. package/dist/chunk-VB6QMU2W.js.map +1 -0
  103. package/dist/chunk-VQO54ZMA.js +2 -0
  104. package/dist/chunk-VQO54ZMA.js.map +1 -0
  105. package/dist/{chunk-7DP57BA7.js → chunk-Y7XRA2EV.js} +2 -2
  106. package/dist/{chunk-7DP57BA7.js.map → chunk-Y7XRA2EV.js.map} +1 -1
  107. package/dist/{chunk-5IJD5L3O.cjs → chunk-YBQOQTVL.cjs} +2 -2
  108. package/dist/chunk-YBQOQTVL.cjs.map +1 -0
  109. package/dist/{chunk-EL2XUOWX.js → chunk-YG7UWQFV.js} +2 -2
  110. package/dist/{chunk-EL2XUOWX.js.map → chunk-YG7UWQFV.js.map} +1 -1
  111. package/dist/chunk-YSHWNCDH.cjs +5 -0
  112. package/dist/chunk-YSHWNCDH.cjs.map +1 -0
  113. package/dist/chunk-ZC2NPRLO.js +3 -0
  114. package/dist/chunk-ZC2NPRLO.js.map +1 -0
  115. package/dist/{chunk-FYTB7SDP.cjs → chunk-ZDJTDFTR.cjs} +2 -2
  116. package/dist/{chunk-FYTB7SDP.cjs.map → chunk-ZDJTDFTR.cjs.map} +1 -1
  117. package/dist/chunk-ZE5KKMBV.cjs +2 -0
  118. package/dist/chunk-ZE5KKMBV.cjs.map +1 -0
  119. package/dist/{chunk-4BAUQE6A.cjs → chunk-ZPHUTCJ5.cjs} +3 -3
  120. package/dist/{chunk-4BAUQE6A.cjs.map → chunk-ZPHUTCJ5.cjs.map} +1 -1
  121. package/dist/{chunk-GBCN7FNV.cjs → chunk-ZSLVLMO5.cjs} +2 -2
  122. package/dist/{chunk-GBCN7FNV.cjs.map → chunk-ZSLVLMO5.cjs.map} +1 -1
  123. package/dist/constants.cjs +1 -1
  124. package/dist/constants.d.cts +1 -1
  125. package/dist/constants.d.ts +1 -1
  126. package/dist/constants.js +1 -1
  127. package/dist/engine.cjs +1 -1
  128. package/dist/engine.d.cts +14 -12
  129. package/dist/engine.d.ts +14 -12
  130. package/dist/engine.js +1 -1
  131. package/dist/errors.cjs +1 -1
  132. package/dist/errors.d.cts +3 -3
  133. package/dist/errors.d.ts +3 -3
  134. package/dist/errors.js +1 -1
  135. package/dist/format.cjs +1 -1
  136. package/dist/format.d.cts +4 -3
  137. package/dist/format.d.ts +4 -3
  138. package/dist/format.js +1 -1
  139. package/dist/index.cjs +1 -1
  140. package/dist/index.cjs.map +1 -1
  141. package/dist/index.d.cts +15 -13
  142. package/dist/index.d.ts +15 -13
  143. package/dist/index.js +1 -1
  144. package/dist/index.js.map +1 -1
  145. package/dist/language.d.cts +12 -11
  146. package/dist/language.d.ts +12 -11
  147. package/dist/lexer.cjs +1 -1
  148. package/dist/lexer.d.cts +4 -4
  149. package/dist/lexer.d.ts +4 -4
  150. package/dist/lexer.js +1 -1
  151. package/dist/normalizer.cjs +1 -1
  152. package/dist/normalizer.d.cts +3 -3
  153. package/dist/normalizer.d.ts +3 -3
  154. package/dist/normalizer.js +1 -1
  155. package/dist/packages.cjs +1 -1
  156. package/dist/packages.d.cts +11 -10
  157. package/dist/packages.d.ts +11 -10
  158. package/dist/packages.js +1 -1
  159. package/dist/parser.cjs +1 -1
  160. package/dist/parser.d.cts +5 -4
  161. package/dist/parser.d.ts +5 -4
  162. package/dist/parser.js +1 -1
  163. package/dist/{pipeline-69q2tsLE.d.cts → pipeline-BYkKNpql.d.cts} +1 -1
  164. package/dist/{pipeline-DTqGLPsV.d.ts → pipeline-Cl7KW8CB.d.ts} +1 -1
  165. package/dist/resolvers.d.cts +2 -2
  166. package/dist/resolvers.d.ts +2 -2
  167. package/dist/temporal.cjs +2 -0
  168. package/dist/temporal.cjs.map +1 -0
  169. package/dist/temporal.d.cts +201 -0
  170. package/dist/temporal.d.ts +201 -0
  171. package/dist/temporal.js +2 -0
  172. package/dist/temporal.js.map +1 -0
  173. package/dist/testing.cjs +2 -2
  174. package/dist/testing.cjs.map +1 -1
  175. package/dist/testing.d.cts +12 -11
  176. package/dist/testing.d.ts +12 -11
  177. package/dist/testing.js +1 -1
  178. package/dist/testing.js.map +1 -1
  179. package/dist/uom.cjs +1 -1
  180. package/dist/uom.d.cts +2 -2
  181. package/dist/uom.d.ts +2 -2
  182. package/dist/uom.js +1 -1
  183. package/dist/vm.cjs +1 -1
  184. package/dist/vm.cjs.map +1 -1
  185. package/dist/vm.d.cts +8 -56
  186. package/dist/vm.d.ts +8 -56
  187. package/dist/vm.js +1 -1
  188. package/dist/vm.js.map +1 -1
  189. package/dist/worker.cjs +2 -2
  190. package/dist/worker.cjs.map +1 -1
  191. package/dist/worker.d.cts +35 -13
  192. package/dist/worker.d.ts +35 -13
  193. package/dist/worker.js +2 -2
  194. package/dist/worker.js.map +1 -1
  195. package/package.json +12 -1
  196. package/dist/chunk-4BRTUFTH.js +0 -2
  197. package/dist/chunk-4BRTUFTH.js.map +0 -1
  198. package/dist/chunk-4NZXCHQL.cjs +0 -2
  199. package/dist/chunk-4NZXCHQL.cjs.map +0 -1
  200. package/dist/chunk-57PSJQQW.js.map +0 -1
  201. package/dist/chunk-5IJD5L3O.cjs.map +0 -1
  202. package/dist/chunk-634ILVMP.cjs +0 -2
  203. package/dist/chunk-634ILVMP.cjs.map +0 -1
  204. package/dist/chunk-63ZOOUOL.js +0 -2
  205. package/dist/chunk-63ZOOUOL.js.map +0 -1
  206. package/dist/chunk-77KI7AKJ.cjs +0 -2
  207. package/dist/chunk-77KI7AKJ.cjs.map +0 -1
  208. package/dist/chunk-7N3IJSWF.js +0 -5
  209. package/dist/chunk-7N3IJSWF.js.map +0 -1
  210. package/dist/chunk-DUYTXLO2.js +0 -2
  211. package/dist/chunk-DUYTXLO2.js.map +0 -1
  212. package/dist/chunk-IJMNVBIS.js.map +0 -1
  213. package/dist/chunk-JSM3O7EM.cjs +0 -2
  214. package/dist/chunk-JSM3O7EM.cjs.map +0 -1
  215. package/dist/chunk-MZMA32NE.js +0 -3
  216. package/dist/chunk-MZMA32NE.js.map +0 -1
  217. package/dist/chunk-N4SSR7Q6.js +0 -2
  218. package/dist/chunk-N4SSR7Q6.js.map +0 -1
  219. package/dist/chunk-NMU5E7W7.js +0 -2
  220. package/dist/chunk-NMU5E7W7.js.map +0 -1
  221. package/dist/chunk-OB2VX4IL.js +0 -2
  222. package/dist/chunk-OB2VX4IL.js.map +0 -1
  223. package/dist/chunk-RAPEZR5L.cjs +0 -2
  224. package/dist/chunk-RAPEZR5L.cjs.map +0 -1
  225. package/dist/chunk-SPOVFRZO.cjs +0 -5
  226. package/dist/chunk-SPOVFRZO.cjs.map +0 -1
  227. package/dist/chunk-SQHBOWES.cjs +0 -2
  228. package/dist/chunk-SQHBOWES.cjs.map +0 -1
  229. package/dist/chunk-UF5XMZTT.js +0 -2
  230. package/dist/chunk-UF5XMZTT.js.map +0 -1
  231. package/dist/chunk-UV3EUIBT.cjs +0 -3
  232. package/dist/chunk-UV3EUIBT.cjs.map +0 -1
  233. package/dist/chunk-VMSCRVNX.cjs +0 -2
  234. package/dist/chunk-VMSCRVNX.cjs.map +0 -1
  235. package/dist/chunk-XBGK3TTU.cjs +0 -3
  236. package/dist/chunk-XBGK3TTU.cjs.map +0 -1
  237. package/dist/chunk-XX55RR4Q.js +0 -3
  238. package/dist/chunk-XX55RR4Q.js.map +0 -1
  239. package/dist/chunk-YBQPEWT7.cjs.map +0 -1
  240. package/dist/chunk-ZDCZ5IDD.js +0 -3
@@ -0,0 +1,90 @@
1
+ import { C as CalendarBackend, a as CalendarFields, Z as ZonedFields } from './CalendarBackend-MdS3Bb4P.cjs';
2
+
3
+ /**
4
+ * The default {@link CalendarBackend}: the JavaScript `Date` object, read in
5
+ * the host process's time zone, with `Intl.DateTimeFormat` for named zones.
6
+ *
7
+ * This is the calendar code the engine has always run, moved behind the
8
+ * interface method by method rather than rewritten, so a host that configures
9
+ * nothing sees the same instants and the same strings it did before the
10
+ * backend existed. Where `Date` has a quirk (a two-digit year in a
11
+ * constructor maps to the 1900s, an out-of-range instant answers `NaN`), the
12
+ * quirk is kept here deliberately: the point of this backend is to be the
13
+ * behaviour the `Temporal` backend is measured against, not to improve on it.
14
+ *
15
+ * It stays the default because it is the one calendar every supported runtime
16
+ * has. `Temporal` ships unflagged in Node 26 and in current Chrome, Firefox
17
+ * and Deno, but not in Safari or in the Node 22 and 24 the engine supports,
18
+ * and the smallest polyfill adds about twenty kilobytes gzipped to a bundle
19
+ * that a host doing plain arithmetic never needs. A host that wants
20
+ * `Temporal` opts in through the engine's `calendar` option with the backend
21
+ * from `solve-engine/temporal`, and pays for it only then.
22
+ */
23
+ declare class DateCalendar implements CalendarBackend {
24
+ now(): number;
25
+ fields(epochMs: number): CalendarFields;
26
+ localMidnight(year: number, month0: number, day: number): number;
27
+ localWallClock(year: number, month0: number, day: number, minutesPastMidnight: number): number;
28
+ addDays(epochMs: number, days: number): number;
29
+ addMonths(epochMs: number, months: number): number;
30
+ utcOffsetMinutes(epochMs: number): number;
31
+ parseIso8601(text: string): number;
32
+ formatLongDate(epochMs: number, locale: string): string;
33
+ formatTimeOfDay(epochMs: number, locale: string): string;
34
+ zoneOffsetMinutes(zone: string, epochMs: number): number;
35
+ fieldsInZone(zone: string, epochMs: number): ZonedFields;
36
+ formatTimeInZone(zone: string, epochMs: number): string;
37
+ formatDateInZone(zone: string, epochMs: number): string;
38
+ }
39
+ /**
40
+ * The one `Date` backend, shared by every engine that configures no other.
41
+ *
42
+ * Stateless, so sharing is safe: it holds no zone of its own and reads the
43
+ * process's. It is also what the sites with no engine in hand use (the
44
+ * normaliser rules that fuse a literal, `days in <period>`, the stocks and
45
+ * historical-currency date phrases, and `formatValue`), which is why an
46
+ * engine's own backend is the default here rather than a second copy.
47
+ */
48
+ declare const DATE_CALENDAR: CalendarBackend;
49
+ /**
50
+ * The backend a plugin function or converter should compute with: the one
51
+ * on its execution context, or the `Date` backend when the handler was
52
+ * called with no context (a direct call from a test, or an `as` converter
53
+ * invoked outside the VM).
54
+ *
55
+ * @param context - The execution context the handler received, if any.
56
+ * @returns The engine's backend when the context carries one, else {@link DATE_CALENDAR}.
57
+ */
58
+ declare function calendarOf(context?: {
59
+ readonly calendar?: CalendarBackend;
60
+ }): CalendarBackend;
61
+ /**
62
+ * A `Date` backend that computes in a named time zone rather than the host
63
+ * process's.
64
+ *
65
+ * This is how a host pins the zone the engine reads dates in, and it is the
66
+ * only knob for it: the zone belongs to the calendar backend, which already
67
+ * owns what "local" means, so there is deliberately no `date.zone` config
68
+ * field to drift against it.
69
+ *
70
+ * ```ts
71
+ * import { createEngine, dateCalendarInZone } from "solve-engine";
72
+ * const engine = createEngine({ calendar: dateCalendarInZone("Asia/Tokyo") });
73
+ * ```
74
+ *
75
+ * It ships on the `Date` backend on purpose. `Temporal` is undefined on Node
76
+ * 24 and in Safari, so "pass a `Temporal` backend" would put the zone out of
77
+ * reach for most hosts today; `Temporal` stays an accuracy upgrade for the
78
+ * ambiguous wall clocks around a daylight-saving transition, never a
79
+ * prerequisite for naming a zone at all.
80
+ *
81
+ * @param zone - An IANA zone name, e.g. `"Asia/Tokyo"`.
82
+ * @returns A backend whose local zone is that one.
83
+ * @throws A `DATE_ZONE_UNKNOWN` config error when this runtime's `Intl` does
84
+ * not know the zone. Refused here rather than per line, because a backend
85
+ * that cannot compute in the zone it was asked for must not quietly answer
86
+ * in another one.
87
+ */
88
+ declare function dateCalendarInZone(zone: string): CalendarBackend;
89
+
90
+ export { DATE_CALENDAR as D, DateCalendar as a, calendarOf as c, dateCalendarInZone as d };
@@ -170,6 +170,10 @@ declare const CoreErrorCodes: {
170
170
  readonly INVALID_TIME_LITERAL: "INVALID_TIME_LITERAL";
171
171
  /** A live-data form evaluated on an engine whose host switched the network off (`network.enabled: false`, see `constants/Configuration.ts`'s `NetworkConfig`). A recoverable Error value, raised by the VM for a currency conversion with no primed rate and for a plugin function that returned a promise, and by `createQueryResolver`'s plugin function when its preflight was skipped. Names the setting, so the reader knows it is policy rather than an outage. */
172
172
  readonly NETWORK_DISABLED: "NETWORK_DISABLED";
173
+ /** `createTemporalCalendar()` was handed something that is not a usable `Temporal` implementation: no `Now.instant`, `Now.timeZoneId`, `Instant.fromEpochMilliseconds` or `PlainDateTime.from`. Raised at construction, naming the missing member, rather than letting the first date computation fail on it obscurely. */
174
+ readonly TEMPORAL_IMPLEMENTATION_INVALID: "TEMPORAL_IMPLEMENTATION_INVALID";
175
+ /** The `timeZone` given to `createTemporalCalendar()` is not one the `Temporal` implementation knows. Raised at construction, so a misspelt zone is a configuration error the host sees once, not a `RangeError` from inside every date the engine computes. */
176
+ readonly TEMPORAL_TIME_ZONE_UNKNOWN: "TEMPORAL_TIME_ZONE_UNKNOWN";
173
177
  /** `fromJSON()` handed an object that is not a snapshot at all, or whose serialised-shape version does not match this engine's reader. The versioning gate that refuses an incompatible snapshot clearly rather than restoring it wrongly. See `engine/EngineSnapshot.ts`'s `assertRestorable()`. */
174
178
  readonly SNAPSHOT_VERSION_MISMATCH: "SNAPSHOT_VERSION_MISMATCH";
175
179
  /** A snapshot with the right envelope but internally inconsistent contents (an unrecognised number sentinel, an unknown value tag). Distinct from a version mismatch: the format is right, the payload is not. */
@@ -180,6 +184,8 @@ declare const CoreErrorCodes: {
180
184
  readonly INVALID_CONFIG_PATH: "INVALID_CONFIG_PATH";
181
185
  readonly CONFIG_SECTION_NOT_FOUND: "CONFIG_SECTION_NOT_FOUND";
182
186
  readonly CONFIG_PROPERTY_NOT_FOUND: "CONFIG_PROPERTY_NOT_FOUND";
187
+ /** `calendar: "temporal"` was asked for on a runtime with no `Temporal`. Refused rather than silently computing on `Date`, because a host that named Temporal did so to be sure what it was computing on. Recoverable. */
188
+ readonly CALENDAR_TEMPORAL_UNAVAILABLE: "CALENDAR_TEMPORAL_UNAVAILABLE";
183
189
  readonly PLUGIN_OPERATOR_COLLISION: "PLUGIN_OPERATOR_COLLISION";
184
190
  readonly PLUGIN_KEYWORD_COLLISION: "PLUGIN_KEYWORD_COLLISION";
185
191
  readonly PLUGIN_UNIT_COLLISION: "PLUGIN_UNIT_COLLISION";
@@ -201,11 +207,32 @@ declare const CoreErrorCodes: {
201
207
  /** Every error code the engine's own layers can produce, from {@link CoreErrorCodes}. */
202
208
  type CoreErrorCode = (typeof CoreErrorCodes)[keyof typeof CoreErrorCodes];
203
209
  /**
204
- * The aggregated catalog type. Currently just `CoreErrorCode`, union in
205
- * each package's own code-object type here as Phase 5 converts it, e.g.
206
- * `CoreErrorCode | WeatherErrorCode | StocksErrorCode | ...`.
210
+ * Codes for the datetime forms whose failure is raised OUTSIDE the datetime
211
+ * package.
212
+ *
213
+ * These sit here rather than beside the datetime parselets, which is where a
214
+ * package's own code object belongs, because the two sites that raise them are
215
+ * `vm/VM.ts` (the `in <zone>` branch of the unit-conversion opcode) and
216
+ * `calendar/DateCalendar.ts` (the zone-bound backend factory), and neither may
217
+ * import from `packages/`. A code object in the datetime package would put the
218
+ * name a core file needs on the wrong side of that line.
219
+ */
220
+ declare const DatetimeErrorCodes: {
221
+ /** `2026-04-03 in Atlantis`: a Datetime met `in <name>` and the name is neither a zone this engine knows nor a unit. Before this code the epoch-millisecond payload was simply labelled with the name, and the line answered a fourteen-digit quantity in a unit called Atlantis. */
222
+ readonly DATETIME_ZONE_UNKNOWN: "DATETIME_ZONE_UNKNOWN";
223
+ /** `2026-04-03 in furlongs`: the same handler, where the name IS a real unit. Separate from `DATETIME_ZONE_UNKNOWN` because the two mistakes have different fixes: one is a misspelt zone, the other is a category error, and a message that suggests checking the spelling of `furlongs` would be no help at all. */
224
+ readonly DATETIME_NOT_CONVERTIBLE: "DATETIME_NOT_CONVERTIBLE";
225
+ /** `dateCalendarInZone("Europe/Atlantis")`: the zone-bound `Date` backend factory, given a zone this runtime's `Intl` cannot format with. Raised at construction rather than per line, because a backend that cannot compute in the zone it was asked for must not silently answer in another one. */
226
+ readonly DATE_ZONE_UNKNOWN: "DATE_ZONE_UNKNOWN";
227
+ };
228
+ /** Every code from {@link DatetimeErrorCodes}. */
229
+ type DatetimeErrorCode = (typeof DatetimeErrorCodes)[keyof typeof DatetimeErrorCodes];
230
+ /**
231
+ * The aggregated catalog type. Currently `CoreErrorCode` and
232
+ * `DatetimeErrorCode`, union in each package's own code-object type here as
233
+ * Phase 5 converts it, e.g. `CoreErrorCode | WeatherErrorCode | ...`.
207
234
  */
208
- type ErrorCode = CoreErrorCode;
235
+ type ErrorCode = CoreErrorCode | DatetimeErrorCode;
209
236
 
210
237
  /**
211
238
  * The engine's structured error type, the "Rust/Go-style, verbose, easy to
@@ -170,6 +170,10 @@ declare const CoreErrorCodes: {
170
170
  readonly INVALID_TIME_LITERAL: "INVALID_TIME_LITERAL";
171
171
  /** A live-data form evaluated on an engine whose host switched the network off (`network.enabled: false`, see `constants/Configuration.ts`'s `NetworkConfig`). A recoverable Error value, raised by the VM for a currency conversion with no primed rate and for a plugin function that returned a promise, and by `createQueryResolver`'s plugin function when its preflight was skipped. Names the setting, so the reader knows it is policy rather than an outage. */
172
172
  readonly NETWORK_DISABLED: "NETWORK_DISABLED";
173
+ /** `createTemporalCalendar()` was handed something that is not a usable `Temporal` implementation: no `Now.instant`, `Now.timeZoneId`, `Instant.fromEpochMilliseconds` or `PlainDateTime.from`. Raised at construction, naming the missing member, rather than letting the first date computation fail on it obscurely. */
174
+ readonly TEMPORAL_IMPLEMENTATION_INVALID: "TEMPORAL_IMPLEMENTATION_INVALID";
175
+ /** The `timeZone` given to `createTemporalCalendar()` is not one the `Temporal` implementation knows. Raised at construction, so a misspelt zone is a configuration error the host sees once, not a `RangeError` from inside every date the engine computes. */
176
+ readonly TEMPORAL_TIME_ZONE_UNKNOWN: "TEMPORAL_TIME_ZONE_UNKNOWN";
173
177
  /** `fromJSON()` handed an object that is not a snapshot at all, or whose serialised-shape version does not match this engine's reader. The versioning gate that refuses an incompatible snapshot clearly rather than restoring it wrongly. See `engine/EngineSnapshot.ts`'s `assertRestorable()`. */
174
178
  readonly SNAPSHOT_VERSION_MISMATCH: "SNAPSHOT_VERSION_MISMATCH";
175
179
  /** A snapshot with the right envelope but internally inconsistent contents (an unrecognised number sentinel, an unknown value tag). Distinct from a version mismatch: the format is right, the payload is not. */
@@ -180,6 +184,8 @@ declare const CoreErrorCodes: {
180
184
  readonly INVALID_CONFIG_PATH: "INVALID_CONFIG_PATH";
181
185
  readonly CONFIG_SECTION_NOT_FOUND: "CONFIG_SECTION_NOT_FOUND";
182
186
  readonly CONFIG_PROPERTY_NOT_FOUND: "CONFIG_PROPERTY_NOT_FOUND";
187
+ /** `calendar: "temporal"` was asked for on a runtime with no `Temporal`. Refused rather than silently computing on `Date`, because a host that named Temporal did so to be sure what it was computing on. Recoverable. */
188
+ readonly CALENDAR_TEMPORAL_UNAVAILABLE: "CALENDAR_TEMPORAL_UNAVAILABLE";
183
189
  readonly PLUGIN_OPERATOR_COLLISION: "PLUGIN_OPERATOR_COLLISION";
184
190
  readonly PLUGIN_KEYWORD_COLLISION: "PLUGIN_KEYWORD_COLLISION";
185
191
  readonly PLUGIN_UNIT_COLLISION: "PLUGIN_UNIT_COLLISION";
@@ -201,11 +207,32 @@ declare const CoreErrorCodes: {
201
207
  /** Every error code the engine's own layers can produce, from {@link CoreErrorCodes}. */
202
208
  type CoreErrorCode = (typeof CoreErrorCodes)[keyof typeof CoreErrorCodes];
203
209
  /**
204
- * The aggregated catalog type. Currently just `CoreErrorCode`, union in
205
- * each package's own code-object type here as Phase 5 converts it, e.g.
206
- * `CoreErrorCode | WeatherErrorCode | StocksErrorCode | ...`.
210
+ * Codes for the datetime forms whose failure is raised OUTSIDE the datetime
211
+ * package.
212
+ *
213
+ * These sit here rather than beside the datetime parselets, which is where a
214
+ * package's own code object belongs, because the two sites that raise them are
215
+ * `vm/VM.ts` (the `in <zone>` branch of the unit-conversion opcode) and
216
+ * `calendar/DateCalendar.ts` (the zone-bound backend factory), and neither may
217
+ * import from `packages/`. A code object in the datetime package would put the
218
+ * name a core file needs on the wrong side of that line.
219
+ */
220
+ declare const DatetimeErrorCodes: {
221
+ /** `2026-04-03 in Atlantis`: a Datetime met `in <name>` and the name is neither a zone this engine knows nor a unit. Before this code the epoch-millisecond payload was simply labelled with the name, and the line answered a fourteen-digit quantity in a unit called Atlantis. */
222
+ readonly DATETIME_ZONE_UNKNOWN: "DATETIME_ZONE_UNKNOWN";
223
+ /** `2026-04-03 in furlongs`: the same handler, where the name IS a real unit. Separate from `DATETIME_ZONE_UNKNOWN` because the two mistakes have different fixes: one is a misspelt zone, the other is a category error, and a message that suggests checking the spelling of `furlongs` would be no help at all. */
224
+ readonly DATETIME_NOT_CONVERTIBLE: "DATETIME_NOT_CONVERTIBLE";
225
+ /** `dateCalendarInZone("Europe/Atlantis")`: the zone-bound `Date` backend factory, given a zone this runtime's `Intl` cannot format with. Raised at construction rather than per line, because a backend that cannot compute in the zone it was asked for must not silently answer in another one. */
226
+ readonly DATE_ZONE_UNKNOWN: "DATE_ZONE_UNKNOWN";
227
+ };
228
+ /** Every code from {@link DatetimeErrorCodes}. */
229
+ type DatetimeErrorCode = (typeof DatetimeErrorCodes)[keyof typeof DatetimeErrorCodes];
230
+ /**
231
+ * The aggregated catalog type. Currently `CoreErrorCode` and
232
+ * `DatetimeErrorCode`, union in each package's own code-object type here as
233
+ * Phase 5 converts it, e.g. `CoreErrorCode | WeatherErrorCode | ...`.
207
234
  */
208
- type ErrorCode = CoreErrorCode;
235
+ type ErrorCode = CoreErrorCode | DatetimeErrorCode;
209
236
 
210
237
  /**
211
238
  * The engine's structured error type, the "Rust/Go-style, verbose, easy to
@@ -1,3 +1,5 @@
1
+ import { C as CalendarBackend } from './CalendarBackend-MdS3Bb4P.cjs';
2
+
1
3
  /**
2
4
  * How a Datetime value is rendered.
3
5
  *
@@ -15,6 +17,18 @@ type DateOutputFormat = "long" | "iso" | "dmy" | "mdy";
15
17
  * This allows the engine to format values without depending on app-specific settings
16
18
  */
17
19
  interface FormattingSettings {
20
+ /**
21
+ * The calendar backend a date is written out through: which local day and
22
+ * wall-clock time an instant shows as. Pass the same backend the engine
23
+ * was given as its `calendar` option, so a date displays in the zone it
24
+ * was computed in. Absent means the built-in `Date` backend, the process's
25
+ * own zone, which is what every engine computes with by default.
26
+ *
27
+ * A backend is an object of functions, so it cannot cross a `postMessage`
28
+ * boundary: a worker runtime takes its backend from `WorkerRuntimeOptions`
29
+ * and applies it to the formatting it receives.
30
+ */
31
+ calendar?: CalendarBackend;
18
32
  floatResult: {
19
33
  decimalPlaces: number;
20
34
  enableSeperator: boolean;
@@ -1,3 +1,5 @@
1
+ import { C as CalendarBackend } from './CalendarBackend-MdS3Bb4P.js';
2
+
1
3
  /**
2
4
  * How a Datetime value is rendered.
3
5
  *
@@ -15,6 +17,18 @@ type DateOutputFormat = "long" | "iso" | "dmy" | "mdy";
15
17
  * This allows the engine to format values without depending on app-specific settings
16
18
  */
17
19
  interface FormattingSettings {
20
+ /**
21
+ * The calendar backend a date is written out through: which local day and
22
+ * wall-clock time an instant shows as. Pass the same backend the engine
23
+ * was given as its `calendar` option, so a date displays in the zone it
24
+ * was computed in. Absent means the built-in `Date` backend, the process's
25
+ * own zone, which is what every engine computes with by default.
26
+ *
27
+ * A backend is an object of functions, so it cannot cross a `postMessage`
28
+ * boundary: a worker runtime takes its backend from `WorkerRuntimeOptions`
29
+ * and applies it to the formatting it receives.
30
+ */
31
+ calendar?: CalendarBackend;
18
32
  floatResult: {
19
33
  decimalPlaces: number;
20
34
  enableSeperator: boolean;
@@ -1,5 +1,5 @@
1
- import { T as Token } from './Token-CbP_OutD.cjs';
2
- import { E as EngineError } from './EngineError-fR1K1rvx.cjs';
1
+ import { T as Token } from './Token-D8f7yaz1.cjs';
2
+ import { E as EngineError } from './EngineError-C-kBwYlN.cjs';
3
3
 
4
4
  /** Trie node for multi-word phrase matching. */
5
5
  interface PhraseNode {
@@ -129,9 +129,19 @@ declare class LexerToken implements Token {
129
129
  col: number;
130
130
  /** See {@link Token.sourceEnd}. Set only on normalizer-fused tokens. */
131
131
  sourceEnd?: number | undefined;
132
+ /** See {@link Token.fault}. Set only on a fused token standing for a run the engine refuses to read. */
133
+ fault?: {
134
+ readonly code: string;
135
+ readonly message: string;
136
+ } | undefined;
132
137
  constructor(type: string, typeId: number, value: string, text: string, offset: number, lineBreaks: number, line: number, col: number,
133
138
  /** See {@link Token.sourceEnd}. Set only on normalizer-fused tokens. */
134
- sourceEnd?: number | undefined);
139
+ sourceEnd?: number | undefined,
140
+ /** See {@link Token.fault}. Set only on a fused token standing for a run the engine refuses to read. */
141
+ fault?: {
142
+ readonly code: string;
143
+ readonly message: string;
144
+ } | undefined);
135
145
  }
136
146
  /**
137
147
  * Plugin interface for extending the ExpressionLexer with custom tokens.
@@ -1,5 +1,5 @@
1
- import { T as Token } from './Token-CbP_OutD.js';
2
- import { E as EngineError } from './EngineError-fR1K1rvx.js';
1
+ import { T as Token } from './Token-D8f7yaz1.js';
2
+ import { E as EngineError } from './EngineError-C-kBwYlN.js';
3
3
 
4
4
  /** Trie node for multi-word phrase matching. */
5
5
  interface PhraseNode {
@@ -129,9 +129,19 @@ declare class LexerToken implements Token {
129
129
  col: number;
130
130
  /** See {@link Token.sourceEnd}. Set only on normalizer-fused tokens. */
131
131
  sourceEnd?: number | undefined;
132
+ /** See {@link Token.fault}. Set only on a fused token standing for a run the engine refuses to read. */
133
+ fault?: {
134
+ readonly code: string;
135
+ readonly message: string;
136
+ } | undefined;
132
137
  constructor(type: string, typeId: number, value: string, text: string, offset: number, lineBreaks: number, line: number, col: number,
133
138
  /** See {@link Token.sourceEnd}. Set only on normalizer-fused tokens. */
134
- sourceEnd?: number | undefined);
139
+ sourceEnd?: number | undefined,
140
+ /** See {@link Token.fault}. Set only on a fused token standing for a run the engine refuses to read. */
141
+ fault?: {
142
+ readonly code: string;
143
+ readonly message: string;
144
+ } | undefined);
135
145
  }
136
146
  /**
137
147
  * Plugin interface for extending the ExpressionLexer with custom tokens.
@@ -1,4 +1,4 @@
1
- import { I as IEnginePackage } from './PackageRegistry-Dvn4i2QK.cjs';
1
+ import { I as IEnginePackage } from './PackageRegistry-BHBCFswo.cjs';
2
2
 
3
3
  /**
4
4
  * Package load-time compatibility checking, the "detect overlapping
@@ -1,4 +1,4 @@
1
- import { I as IEnginePackage } from './PackageRegistry-DT-x32OM.js';
1
+ import { I as IEnginePackage } from './PackageRegistry-CNZUwWHJ.js';
2
2
 
3
3
  /**
4
4
  * Package load-time compatibility checking, the "detect overlapping