@orangecharts/wrun-chart-host 0.11.0 → 0.14.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 (311) hide show
  1. package/README.md +1 -0
  2. package/dist/constants/feature-flags.constants.d.ts +3 -4
  3. package/dist/constants/feature-flags.constants.js +34 -52
  4. package/dist/constants/feature-limits.constants.d.ts +1 -1
  5. package/dist/constants/feature-limits.constants.js +5 -4
  6. package/dist/constants/interval.constants.d.ts +7 -0
  7. package/dist/constants/interval.constants.js +7 -0
  8. package/dist/constants/scriptEditor/cme-official-scripts.constants.d.ts +20 -149
  9. package/dist/constants/scriptEditor/cme-official-scripts.constants.js +20 -309
  10. package/dist/constants/stocks-compliance.constants.d.ts +15 -0
  11. package/dist/constants/stocks-compliance.constants.js +15 -0
  12. package/dist/host-env.d.ts +55 -3
  13. package/dist/host-env.js +6 -0
  14. package/dist/host-ports.types.d.ts +36 -3
  15. package/dist/index.d.ts +18 -0
  16. package/dist/index.js +19 -0
  17. package/dist/indicators/controls/tpo-session.util.d.ts +78 -15
  18. package/dist/indicators/controls/tpo-session.util.js +320 -242
  19. package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +6 -0
  20. package/dist/instances/script-engine-worker-ohlcv-transfer.js +16 -0
  21. package/dist/interfaces/cme-realtime.interface.d.ts +8 -0
  22. package/dist/interfaces/cme-realtime.interface.js +2 -1
  23. package/dist/interfaces/feed.interface.d.ts +15 -1
  24. package/dist/interfaces/replay.interface.d.ts +5 -0
  25. package/dist/interfaces/stocks-realtime.interface.d.ts +4 -3
  26. package/dist/interfaces/stocks-realtime.interface.js +5 -4
  27. package/dist/interfaces/wrun-runtime.interface.d.ts +97 -19
  28. package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +17 -0
  29. package/dist/kscript-data/controls/live-ohlcv-merge.util.js +22 -0
  30. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +46 -40
  31. package/dist/kscript-data/controls/live-trades-merge.util.js +80 -107
  32. package/dist/market-data/billing.interface.d.ts +9 -1
  33. package/dist/market-data/venue.d.ts +1 -1
  34. package/dist/market-data/venues/index.d.ts +4 -4
  35. package/dist/market-data/venues/stocks.contract.copy.json +4 -4
  36. package/dist/market-data/venues/stocks.d.ts +4 -4
  37. package/dist/market-data/venues/stocks.js +15 -13
  38. package/dist/settings-templates/frvp-fields.d.ts +12 -1
  39. package/dist/settings-templates/frvp-fields.js +15 -4
  40. package/dist/settings-templates/index.js +12 -5
  41. package/dist/settings-templates/indicator-fields.js +28 -2
  42. package/dist/settings-templates/tool-rules.d.ts +17 -8
  43. package/dist/settings-templates/tool-rules.js +15 -8
  44. package/dist/settings-templates/tool-tables.generated.js +4 -2
  45. package/dist/utility/auth/server-clock.util.d.ts +3 -1
  46. package/dist/utility/auth/server-clock.util.js +3 -1
  47. package/dist/utility/chart/book-live-bucket.util.js +2 -2
  48. package/dist/utility/chart/cache-alignment.util.d.ts +15 -7
  49. package/dist/utility/chart/cache-alignment.util.js +14 -7
  50. package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +2 -0
  51. package/dist/utility/chart/chart-data-fetch-generation.util.js +16 -0
  52. package/dist/utility/chart/cme-session-bucket.util.d.ts +18 -75
  53. package/dist/utility/chart/cme-session-bucket.util.js +25 -332
  54. package/dist/utility/chart/continuous-contracts.util.js +6 -5
  55. package/dist/utility/chart/display-offset.leaf.d.ts +24 -0
  56. package/dist/utility/chart/display-offset.leaf.js +41 -0
  57. package/dist/utility/chart/effective-chart-session.util.d.ts +2 -1
  58. package/dist/utility/chart/effective-chart-session.util.js +13 -5
  59. package/dist/utility/chart/feed-interval.util.d.ts +6 -20
  60. package/dist/utility/chart/feed-interval.util.js +13 -22
  61. package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +27 -7
  62. package/dist/utility/chart/fetch-dedupe-policy.util.js +86 -11
  63. package/dist/utility/chart/host-bar-placement.util.d.ts +7 -4
  64. package/dist/utility/chart/host-bar-placement.util.js +8 -2
  65. package/dist/utility/chart/indicator-inflight-registry.util.d.ts +32 -0
  66. package/dist/utility/chart/indicator-inflight-registry.util.js +52 -0
  67. package/dist/utility/chart/indicator-run-interval.util.d.ts +10 -4
  68. package/dist/utility/chart/indicator-run-interval.util.js +21 -12
  69. package/dist/utility/chart/interval-registry.util.d.ts +1 -1
  70. package/dist/utility/chart/interval-registry.util.js +1 -1
  71. package/dist/utility/chart/kscript-legend-entries.util.d.ts +12 -0
  72. package/dist/utility/chart/kscript-legend-entries.util.js +16 -0
  73. package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +1 -1
  74. package/dist/utility/chart/kscript-run-interval-projection.util.js +4 -2
  75. package/dist/utility/chart/kscript-venue-policy.util.d.ts +53 -62
  76. package/dist/utility/chart/kscript-venue-policy.util.js +85 -94
  77. package/dist/utility/chart/live-bucket.util.d.ts +39 -17
  78. package/dist/utility/chart/live-bucket.util.js +103 -57
  79. package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +58 -20
  80. package/dist/utility/chart/local-kscript-source-revalidation.util.js +98 -23
  81. package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +35 -11
  82. package/dist/utility/chart/local-kscript-warmup-depth.util.js +24 -3
  83. package/dist/utility/chart/market-session-schedule.util.d.ts +8 -0
  84. package/dist/utility/chart/market-session-schedule.util.js +39 -1
  85. package/dist/utility/chart/market-session.util.d.ts +136 -0
  86. package/dist/utility/chart/market-session.util.js +341 -0
  87. package/dist/utility/chart/market-sessions.util.d.ts +83 -0
  88. package/dist/utility/chart/market-sessions.util.js +220 -0
  89. package/dist/utility/chart/om-panel.util.d.ts +5 -3
  90. package/dist/utility/chart/om-panel.util.js +42 -7
  91. package/dist/utility/chart/om-target.util.d.ts +14 -1
  92. package/dist/utility/chart/om-target.util.js +22 -5
  93. package/dist/utility/chart/opra-read-access.leaf.d.ts +16 -1
  94. package/dist/utility/chart/opra-read-access.leaf.js +22 -0
  95. package/dist/utility/chart/profile-row-height.util.d.ts +49 -16
  96. package/dist/utility/chart/profile-row-height.util.js +74 -37
  97. package/dist/utility/chart/rth-session.util.d.ts +55 -20
  98. package/dist/utility/chart/rth-session.util.js +94 -46
  99. package/dist/utility/chart/session-interval.util.d.ts +2 -1
  100. package/dist/utility/chart/session-interval.util.js +1 -3
  101. package/dist/utility/chart/session-lattice.util.d.ts +150 -0
  102. package/dist/utility/chart/session-lattice.util.js +488 -0
  103. package/dist/utility/chart/trading-day.util.d.ts +40 -2
  104. package/dist/utility/chart/trading-day.util.js +84 -7
  105. package/dist/utility/chart/us-equities-session.util.d.ts +32 -11
  106. package/dist/utility/chart/us-equities-session.util.js +44 -15
  107. package/dist/utility/chart/window-geometry.leaf.d.ts +28 -7
  108. package/dist/utility/chart/window-geometry.leaf.js +57 -8
  109. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +21 -14
  110. package/dist/utility/chart/wrun-bar-session-facts.util.js +32 -38
  111. package/dist/utility/chart/wrun-run-result.util.d.ts +29 -12
  112. package/dist/utility/chart/wrun-run-result.util.js +89 -25
  113. package/dist/utility/common/time.util.js +5 -4
  114. package/dist/utility/market-events/earnings-scope.util.d.ts +10 -5
  115. package/dist/utility/market-events/earnings-scope.util.js +17 -9
  116. package/dist/utility/market-events/market-events.util.d.ts +14 -7
  117. package/dist/utility/market-events/market-events.util.js +30 -17
  118. package/dist/utility/number-format.util.d.ts +14 -21
  119. package/dist/utility/number-format.util.js +38 -24
  120. package/dist/utility/options/option-venue-disclosure.util.d.ts +40 -6
  121. package/dist/utility/options/option-venue-disclosure.util.js +71 -11
  122. package/dist/utility/options/option-venue.util.d.ts +1 -1
  123. package/dist/utility/options/option-venue.util.js +1 -1
  124. package/dist/utility/pool-symbol.leaf.d.ts +7 -0
  125. package/dist/utility/pool-symbol.leaf.js +50 -5
  126. package/dist/utility/stocks/stock-display.util.d.ts +15 -0
  127. package/dist/utility/stocks/stock-display.util.js +37 -0
  128. package/dist/utility/symbol-selection/contract-expiry.util.js +5 -4
  129. package/dist/utility/v2/gate-plane.util.d.ts +6 -0
  130. package/dist/utility/v2/gate-plane.util.js +11 -1
  131. package/dist/utility/v2/gate-session-latch.util.d.ts +1 -1
  132. package/dist/utility/v2/gate-session-latch.util.js +3 -3
  133. package/dist/utility/v2/governed-tier.leaf.d.ts +17 -16
  134. package/dist/utility/v2/governed-tier.leaf.js +17 -16
  135. package/dist/utility/v2/stocks-governed.util.d.ts +5 -0
  136. package/dist/utility/v2/stocks-governed.util.js +14 -0
  137. package/dist/utility/v2/v2-enums.leaf.d.ts +13 -0
  138. package/dist/utility/v2/v2-enums.leaf.js +458 -0
  139. package/dist/utility/wrun/derived-roots.leaf.d.ts +21 -1
  140. package/dist/utility/wrun/derived-roots.leaf.js +27 -1
  141. package/dist/utility/wrun/derived-roots.util.d.ts +44 -32
  142. package/dist/utility/wrun/derived-roots.util.js +97 -56
  143. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -3
  144. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -3
  145. package/dist/utility/wrun/sources/lanes/option_daily.d.ts +2 -1
  146. package/dist/utility/wrun/sources/lanes/option_daily.js +2 -1
  147. package/dist/utility/wrun/sources/lanes/options_flow.d.ts +3 -0
  148. package/dist/utility/wrun/sources/lanes/options_flow.js +23 -5
  149. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +3 -4
  150. package/dist/utility/wrun/sources/row-lane-registry.js +9 -4
  151. package/dist/utility/wrun/sources/row-lanes/dark_pool.d.ts +19 -0
  152. package/dist/utility/wrun/sources/row-lanes/dark_pool.js +104 -0
  153. package/dist/utility/wrun/sources/row-lanes/index.js +2 -0
  154. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.d.ts +20 -0
  155. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.js +103 -0
  156. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -2
  157. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +15 -13
  158. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +49 -23
  159. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +14 -9
  160. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +75 -27
  161. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +139 -82
  162. package/dist/utility/wrun/wrun-app-layer.leaf.d.ts +78 -0
  163. package/dist/utility/wrun/wrun-app-layer.leaf.js +89 -0
  164. package/dist/utility/wrun/wrun-bar-count.util.d.ts +11 -7
  165. package/dist/utility/wrun/wrun-bar-count.util.js +12 -8
  166. package/dist/utility/wrun/wrun-batched-kinds.leaf.d.ts +13 -0
  167. package/dist/utility/wrun/wrun-batched-kinds.leaf.js +18 -0
  168. package/dist/utility/wrun/wrun-batched-marks.util.d.ts +41 -22
  169. package/dist/utility/wrun/wrun-batched-marks.util.js +255 -59
  170. package/dist/utility/wrun/wrun-batched-readout.util.d.ts +26 -19
  171. package/dist/utility/wrun/wrun-batched-readout.util.js +81 -27
  172. package/dist/utility/wrun/wrun-book-bands.leaf.d.ts +8 -0
  173. package/dist/utility/wrun/wrun-book-bands.leaf.js +7 -0
  174. package/dist/utility/wrun/wrun-candle-equal.leaf.d.ts +19 -0
  175. package/dist/utility/wrun/wrun-candle-equal.leaf.js +40 -0
  176. package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -2
  177. package/dist/utility/wrun/wrun-canvases.util.js +7 -3
  178. package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +6 -3
  179. package/dist/utility/wrun/wrun-chart-context-names.util.js +8 -4
  180. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +47 -29
  181. package/dist/utility/wrun/wrun-chart-market-facts.util.js +201 -201
  182. package/dist/utility/wrun/wrun-child-overlay-id.util.js +2 -1
  183. package/dist/utility/wrun/wrun-cme-legs-note.util.d.ts +15 -0
  184. package/dist/utility/wrun/wrun-cme-legs-note.util.js +49 -0
  185. package/dist/utility/wrun/wrun-cme-root-specs.util.d.ts +38 -0
  186. package/dist/utility/wrun/wrun-cme-root-specs.util.js +81 -0
  187. package/dist/utility/wrun/wrun-coin-lane-live.util.js +3 -0
  188. package/dist/utility/wrun/wrun-color-settings.util.d.ts +6 -1
  189. package/dist/utility/wrun/wrun-color-settings.util.js +32 -7
  190. package/dist/utility/wrun/wrun-dark-pool.util.d.ts +50 -0
  191. package/dist/utility/wrun/wrun-dark-pool.util.js +127 -0
  192. package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +67 -12
  193. package/dist/utility/wrun/wrun-declared-warmup.util.js +165 -13
  194. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +18 -8
  195. package/dist/utility/wrun/wrun-draft-legend-note.util.js +57 -11
  196. package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +14 -10
  197. package/dist/utility/wrun/wrun-draft-overlay.util.js +26 -14
  198. package/dist/utility/wrun/wrun-earnings-facts.util.js +3 -2
  199. package/dist/utility/wrun/wrun-etf-funds.util.d.ts +2 -0
  200. package/dist/utility/wrun/wrun-etf-funds.util.js +4 -0
  201. package/dist/utility/wrun/wrun-held-lanes.util.js +8 -2
  202. package/dist/utility/wrun/wrun-history-as-of.util.d.ts +77 -0
  203. package/dist/utility/wrun/wrun-history-as-of.util.js +108 -0
  204. package/dist/utility/wrun/wrun-host.service.d.ts +64 -14
  205. package/dist/utility/wrun/wrun-host.service.js +137 -27
  206. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +3 -3
  207. package/dist/utility/wrun/wrun-hosted-wire-caps.js +12 -2
  208. package/dist/utility/wrun/wrun-inert-legend.util.d.ts +13 -0
  209. package/dist/utility/wrun/wrun-inert-legend.util.js +31 -3
  210. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +7 -5
  211. package/dist/utility/wrun/wrun-input-requirements.leaf.js +16 -6
  212. package/dist/utility/wrun/wrun-install-pacer.util.d.ts +26 -0
  213. package/dist/utility/wrun/wrun-install-pacer.util.js +145 -0
  214. package/dist/utility/wrun/wrun-kit-refusal-stages.types.d.ts +22 -0
  215. package/dist/utility/wrun/wrun-kit-refusal-stages.types.js +1 -0
  216. package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +12 -5
  217. package/dist/utility/wrun/wrun-lane-refusal.leaf.js +23 -5
  218. package/dist/utility/wrun/wrun-lane-warmup.util.js +22 -4
  219. package/dist/utility/wrun/wrun-leg-close.util.d.ts +6 -5
  220. package/dist/utility/wrun/wrun-leg-close.util.js +11 -9
  221. package/dist/utility/wrun/wrun-leg-fetch.util.d.ts +3 -1
  222. package/dist/utility/wrun/wrun-leg-fetch.util.js +9 -2
  223. package/dist/utility/wrun/wrun-levels-child.util.d.ts +2 -0
  224. package/dist/utility/wrun/wrun-levels-child.util.js +6 -0
  225. package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -0
  226. package/dist/utility/wrun/wrun-live-intake.util.d.ts +15 -6
  227. package/dist/utility/wrun/wrun-live-intake.util.js +167 -47
  228. package/dist/utility/wrun/wrun-live-tick.util.d.ts +52 -8
  229. package/dist/utility/wrun/wrun-live-tick.util.js +648 -97
  230. package/dist/utility/wrun/wrun-market-facts.util.d.ts +16 -2
  231. package/dist/utility/wrun/wrun-market-facts.util.js +32 -3
  232. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +27 -27
  233. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +28 -16
  234. package/dist/utility/wrun/wrun-market-size-defaults.util.js +34 -5
  235. package/dist/utility/wrun/wrun-oi-lane.util.d.ts +10 -7
  236. package/dist/utility/wrun/wrun-oi-lane.util.js +16 -10
  237. package/dist/utility/wrun/wrun-option-strike-flow.util.js +1 -1
  238. package/dist/utility/wrun/wrun-option-views.util.d.ts +2 -2
  239. package/dist/utility/wrun/wrun-option-views.util.js +5 -2
  240. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.d.ts +5 -0
  241. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.js +16 -0
  242. package/dist/utility/wrun/wrun-options-stop.util.d.ts +3 -2
  243. package/dist/utility/wrun/wrun-options-stop.util.js +6 -4
  244. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +75 -11
  245. package/dist/utility/wrun/wrun-overlay-drivers.util.js +176 -43
  246. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +20 -10
  247. package/dist/utility/wrun/wrun-overlay-park.util.d.ts +84 -0
  248. package/dist/utility/wrun/wrun-overlay-park.util.js +135 -0
  249. package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +37 -4
  250. package/dist/utility/wrun/wrun-overlay-recovery.util.js +26 -14
  251. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +239 -24
  252. package/dist/utility/wrun/wrun-overlay-run.util.js +2204 -405
  253. package/dist/utility/wrun/wrun-pack.util.d.ts +8 -5
  254. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +2 -1
  255. package/dist/utility/wrun/wrun-panel-mount.util.js +20 -14
  256. package/dist/utility/wrun/wrun-panel-style.util.d.ts +4 -2
  257. package/dist/utility/wrun/wrun-panel-style.util.js +3 -2
  258. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +7 -0
  259. package/dist/utility/wrun/wrun-pin-spelling.util.js +18 -4
  260. package/dist/utility/wrun/wrun-pin-venues.util.d.ts +26 -17
  261. package/dist/utility/wrun/wrun-pin-venues.util.js +43 -36
  262. package/dist/utility/wrun/wrun-pinned-lanes.util.d.ts +58 -0
  263. package/dist/utility/wrun/wrun-pinned-lanes.util.js +72 -0
  264. package/dist/utility/wrun/wrun-prefix-cohort.util.js +2 -1
  265. package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +22 -9
  266. package/dist/utility/wrun/wrun-prefix-lanes.util.js +145 -26
  267. package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +29 -0
  268. package/dist/utility/wrun/wrun-prefix-proof.util.js +23 -5
  269. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +9 -1
  270. package/dist/utility/wrun/wrun-refusal-surface.util.js +15 -1
  271. package/dist/utility/wrun/wrun-refusal.util.d.ts +19 -1
  272. package/dist/utility/wrun/wrun-refusal.util.js +103 -16
  273. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +20 -6
  274. package/dist/utility/wrun/wrun-registry-errors.util.js +20 -6
  275. package/dist/utility/wrun/wrun-replay-rows.util.js +6 -10
  276. package/dist/utility/wrun/wrun-run-health.util.d.ts +89 -2
  277. package/dist/utility/wrun/wrun-run-health.util.js +204 -1
  278. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +2 -2
  279. package/dist/utility/wrun/wrun-run-interval-session.util.js +2 -2
  280. package/dist/utility/wrun/wrun-run-interval.util.d.ts +9 -8
  281. package/dist/utility/wrun/wrun-run-interval.util.js +13 -11
  282. package/dist/utility/wrun/wrun-sandbox-row-source.js +5 -2
  283. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +13 -3
  284. package/dist/utility/wrun/wrun-script-inputs.util.js +51 -13
  285. package/dist/utility/wrun/wrun-session-composition.util.d.ts +81 -0
  286. package/dist/utility/wrun/wrun-session-composition.util.js +169 -0
  287. package/dist/utility/wrun/wrun-setting-words.util.d.ts +10 -7
  288. package/dist/utility/wrun/wrun-setting-words.util.js +25 -7
  289. package/dist/utility/wrun/wrun-source-rows.util.d.ts +94 -28
  290. package/dist/utility/wrun/wrun-source-rows.util.js +738 -93
  291. package/dist/utility/wrun/wrun-stream-clock.util.d.ts +45 -0
  292. package/dist/utility/wrun/wrun-stream-clock.util.js +108 -0
  293. package/dist/utility/wrun/wrun-tape-coins.util.d.ts +116 -0
  294. package/dist/utility/wrun/wrun-tape-coins.util.js +110 -0
  295. package/dist/utility/wrun/wrun-tape-source.util.d.ts +62 -32
  296. package/dist/utility/wrun/wrun-tape-source.util.js +72 -34
  297. package/dist/utility/wrun/wrun-tier-grid.util.d.ts +13 -5
  298. package/dist/utility/wrun/wrun-tier-grid.util.js +23 -13
  299. package/dist/utility/wrun/wrun-tpo-rows.util.js +2 -1
  300. package/dist/utility/wrun/wrun-trades-lane.util.d.ts +73 -0
  301. package/dist/utility/wrun/wrun-trades-lane.util.js +82 -0
  302. package/dist/utility/wrun/wrun-twin-compute-inputs.util.d.ts +5 -0
  303. package/dist/utility/wrun/wrun-twin-compute-inputs.util.js +9 -2
  304. package/dist/utility/wrun/wrun-visibility-table.d.ts +13 -0
  305. package/dist/utility/wrun/wrun-visibility-table.js +9 -0
  306. package/dist/utility/wrun/wrun-volume-profile.util.js +44 -32
  307. package/dist/utils/replay/replay-buffer-math.d.ts +16 -6
  308. package/dist/utils/replay/replay-buffer-math.js +60 -30
  309. package/dist/workers/constants/socket-slots.d.ts +11 -7
  310. package/dist/workers/constants/socket-slots.js +6 -5
  311. package/package.json +11 -11
@@ -17,28 +17,22 @@
17
17
  * Worker-safe by design: no Vue / store / i18n imports (workers filter fetched
18
18
  * rows through `isWithinRthWindow`, the live-feed service gates merges).
19
19
  *
20
- * The ROOT SET mirrors the engine's venue-sessions module
21
- * (`@orangecharts/kscript` `dist/kscript/venue-sessions.d.ts`) and the shared
22
- * host's venue layer (om `packages/sdk/src/wrun-host/session-facts-venues.ts`
23
- * `RTH_ROOT_EXCHANGES`, the same root to listing-exchange table): when a root
24
- * is added to one, add it to the others in the same wave. The published
25
- * engine package ships ONLY the .d.ts for that subpath (the implementation is
26
- * bundled and mangled inside `dist/kscript-engine.js` and not re-exported
27
- * from the main entry), so the runtime import cannot resolve; `futuresRootOf`
28
- * below is a verbatim mirror of the engine source. The WINDOWS follow the
29
- * wire, not the engine: the engine table (3.0.94) gives the NYMEX energy
30
- * roots the uniform 09:30-16:15 window, and that table is being retired, so it
31
- * binds nothing here. Every reader takes the root's own window from this
32
- * table: the chart's gates (`getRthWindowForSymbol`) and the script-facing
33
- * session facts (`engineRthWindowForSymbol`, wrun `time.session`), the energy
34
- * pit session on NYMEX included, and the shared host's venue layer reads the
35
- * same windows, so a browser run and a cloud run of one indicator agree.
20
+ * The ROOT SET mirrors the shared host's venue layer (om
21
+ * `packages/sdk/src/wrun-host/session-facts-venues.ts` `RTH_ROOT_EXCHANGES`,
22
+ * the same root to listing-exchange table): when a root is added to one, add
23
+ * it to the other in the same wave. The WINDOWS follow the wire: every reader
24
+ * takes the root's own window from this table, the chart's gates
25
+ * (`getRthWindowForSymbol`) and the script-facing session facts
26
+ * (`engineRthWindowForSymbol`, wrun `time.session`) alike, the energy pit
27
+ * session on NYMEX included, and the shared host's venue layer reads the same
28
+ * windows, so a browser run and a cloud run of one indicator agree.
36
29
  */
37
30
  import dayjs from 'dayjs';
38
31
  import timezone from 'dayjs/plugin/timezone.js';
39
32
  import utc from 'dayjs/plugin/utc.js';
40
33
  import { Intervals } from '../../constants/interval.constants.js';
41
34
  import { isCmeGoverned, normalizeExchangeCode } from './cme-realtime.util.js';
35
+ import { isCmeTradeDate } from './cme-trade-calendar.util.js';
42
36
  import { intervalLabelForMs, isSubMinuteInterval, standardIntervalMsAtOrBelow } from './interval-registry.util.js';
43
37
  // No reading here goes through dayjs any more; the plugins stay registered for importers that rely on it.
44
38
  dayjs.extend(utc);
@@ -142,6 +136,8 @@ const RTH_ROOT_EXCHANGES = {
142
136
  ZS: 'CBOT',
143
137
  ZL: 'CBOT',
144
138
  };
139
+ /** Every root with an RTH window, in table order: the trade-date class guard walks each one, so a new root is covered on arrival. */
140
+ export const RTH_MAPPED_ROOTS = Object.freeze(Object.keys(RTH_ROOT_EXCHANGES));
145
141
  /**
146
142
  * The RTH window of a CME-group exchange, the client mirror of tsdb-gateway
147
143
  * `SessionVenueGroupOf`: NYMEX serves the energy pit session, CME, CBOT and
@@ -544,6 +540,7 @@ function rthDayBoundsFor(window, tsMs) {
544
540
  dayStartMs: zoneWallToUtcMs(zone, wall.year, wall.month, wall.day, 0),
545
541
  dayEndMs: zoneWallToUtcMs(zone, next.getUTCFullYear(), next.getUTCMonth() + 1, next.getUTCDate(), 0),
546
542
  weekday: (next.getUTCDay() + 6) % 7,
543
+ calendarDayMs: Date.UTC(wall.year, wall.month - 1, wall.day),
547
544
  };
548
545
  }
549
546
  catch {
@@ -554,17 +551,39 @@ function rthDayBoundsFor(window, tsMs) {
554
551
  spans.length = RTH_DAY_SPANS_PER_WINDOW;
555
552
  return bounds;
556
553
  }
554
+ /**
555
+ * The venue-local calendar day holding `tsMs` on `window`, with that day's window edges: the per-window day memo
556
+ * every op in this module reads, open to a window of any market (market-session.util walks the US equities window
557
+ * on it). Calendar-based like the ops: Saturday and Sunday have bounds too, so a caller that needs a trading day
558
+ * checks `weekday` (or a trade calendar) itself. Null for a non-finite instant or a zone the runtime rejects. Pass a
559
+ * frozen window constant: an ad-hoc object misses the memo (correct, slower).
560
+ */
561
+ export function sessionDayBoundsFor(window, tsMs) {
562
+ if (!Number.isFinite(tsMs))
563
+ return null;
564
+ return rthDayBoundsFor(window, tsMs);
565
+ }
566
+ /**
567
+ * Whether a session pick may name this venue day: its date is a CME trade date (every mapped root is CME-family; a
568
+ * weekend or rule holiday books its trading to the next date, as wrun `time.session` reads), so a pick never names a
569
+ * window the venue left empty. Membership and the bar walks keep every calendar day: the gateway's REGULAR filter is
570
+ * a wall clock, so an early-halt holiday morning and an always-on root's weekend still hold RTH bars.
571
+ */
572
+ function isRthTradeDay(bounds) {
573
+ return isCmeTradeDate(bounds.calendarDayMs);
574
+ }
557
575
  /**
558
576
  * Every venue-local calendar day's `[open, close)` window that touches
559
577
  * `[fromMs, toMs]`, in order: the walk steps one calendar day at a time in
560
578
  * the window's zone (`rthDayBoundsFor`, so it is DST-exact on 23h/25h days)
561
579
  * and keeps a day whose close is after `fromMs` and whose open is before
562
- * `toMs`. Calendar-based like the other walks: Saturday, Sunday and holidays
563
- * have mathematical bounds too, which is harmless for consumers that shade
564
- * or gate BARS (no bar trades 09:30-16:15 New York on a weekend) and wrong
565
- * for anyone who would count the windows as trading days. Empty for an
566
- * inverted or non-finite span. Ad-hoc window objects miss the per-window
567
- * memo (correct, slower); pass the frozen module constants.
580
+ * `toMs`. Calendar-based like `nextRthSessionOpenMs`: Saturday, Sunday and
581
+ * holidays have mathematical bounds too, which is harmless for consumers that
582
+ * shade or gate BARS (no bar trades 09:30-16:15 New York on a weekend) and
583
+ * wrong for anyone who would count the windows as trading days (the session
584
+ * picks below read `isRthTradeDay` for that). Empty for an inverted or
585
+ * non-finite span. Ad-hoc window objects miss the per-window memo (correct,
586
+ * slower); pass the frozen module constants.
568
587
  */
569
588
  export function sessionWindowsInRange(window, fromMs, toMs) {
570
589
  const windows = [];
@@ -760,13 +779,12 @@ export function rthAnchoredBucketEndMs(symbol, bucketStartMs, tfMs) {
760
779
  * "which session am I in" (null out of session); this answers "which session
761
780
  * did I most recently enter" — the primitive a session-anchored profile needs
762
781
  * to show the last completed session outside trading hours. Walks venue-local
763
- * calendar days backward (bounded) so a post-close Friday timestamp or a
764
- * weekend one resolves Friday's window. NOTE: the walk is calendar-based; a
765
- * calendar day with no trading (Saturday, holidays) still has mathematical
766
- * bounds, so DATA-aware callers must fall back a day when the returned window
767
- * turns out empty (dsp-session-window.util's deriveDspWindow is that guard).
768
- * Additive to the kscript venue-sessions mirror; not part of the mirrored
769
- * surface.
782
+ * calendar days backward (bounded) and names only a CME trade date
783
+ * (`isRthTradeDay`): a weekend or Monday pre-open timestamp resolves Friday's
784
+ * window, the Friday after Thanksgiving before the open Wednesday's. A trade
785
+ * date can still hold no rows for a thin contract, so DATA-aware callers keep
786
+ * their own skip (dsp-session-window.util's deriveDspWindow). Additive to the
787
+ * kscript venue-sessions mirror; not part of the mirrored surface.
770
788
  */
771
789
  const LATEST_RTH_LOOKBACK_DAYS = 7;
772
790
  export function latestRthSessionBoundsAtOrBefore(symbol, tsMs) {
@@ -775,30 +793,60 @@ export function latestRthSessionBoundsAtOrBefore(symbol, tsMs) {
775
793
  return null;
776
794
  if (!Number.isFinite(tsMs))
777
795
  return null;
778
- for (let daysBack = 0; daysBack <= LATEST_RTH_LOOKBACK_DAYS; daysBack++) {
779
- const bounds = rthDayBoundsFor(window, tsMs - daysBack * 24 * 60 * 60 * 1000);
796
+ let cursorMs = tsMs;
797
+ for (let day = 0; day <= LATEST_RTH_LOOKBACK_DAYS; day++) {
798
+ const bounds = rthDayBoundsFor(window, cursorMs);
780
799
  if (!bounds)
781
800
  return null;
782
- if (bounds.openMs <= tsMs)
801
+ if (bounds.openMs <= tsMs && isRthTradeDay(bounds))
783
802
  return { openMs: bounds.openMs, closeMs: bounds.closeMs };
803
+ cursorMs = bounds.dayStartMs - 1;
804
+ }
805
+ return null;
806
+ }
807
+ /**
808
+ * The next RTH session open strictly AFTER `tsMs` on a CME trade date
809
+ * (`isRthTradeDay`, the rule `latestRthSessionBoundsAtOrBefore` reads): inside
810
+ * a session or after the close it is the next trade date's open, before the
811
+ * open it is today's when today trades; Friday after the close names Monday.
812
+ * NON-AUTHORITATIVE, a HINT only (data-loading S6, the poll cadence's probe
813
+ * hint): the RthWindow is a chart-side filter (a timezone plus open and close
814
+ * minutes), not a venue schedule. The RTH window (09:30 to 16:15 New York,
815
+ * 09:00 to 14:30 on NYMEX) is not the Globex cycle, an early-halt holiday
816
+ * trades a morning this skips, and it can neither prove a venue still closed
817
+ * nor name the 17:00 CT reopen. A caller may shorten a timer to it; it must
818
+ * never skip a request, derive 'closed' or resume a cadence from it. Null for
819
+ * an unmapped symbol or a non-finite instant.
820
+ */
821
+ export function nextRthTradeSessionOpenMs(symbol, tsMs) {
822
+ const window = getRthWindowForSymbol(symbol);
823
+ if (!window)
824
+ return null;
825
+ if (!Number.isFinite(tsMs))
826
+ return null;
827
+ let cursorMs = tsMs;
828
+ for (let day = 0; day <= LATEST_RTH_LOOKBACK_DAYS; day++) {
829
+ const bounds = rthDayBoundsFor(window, cursorMs);
830
+ if (!bounds)
831
+ return null;
832
+ if (bounds.openMs > tsMs && isRthTradeDay(bounds))
833
+ return bounds.openMs;
834
+ cursorMs = bounds.dayEndMs;
784
835
  }
785
836
  return null;
786
837
  }
787
838
  /**
788
- * The next RTH open strictly AFTER `tsMs` on the same memoized window: inside
789
- * a session it is tomorrow's open, after the close it is the next calendar
790
- * day's, before the open it is today's. NON-AUTHORITATIVE, a HINT only
791
- * (data-loading S6, the poll cadence's probe hint): the RthWindow is a
792
- * chart-side filter (a timezone plus open and close minutes), not a venue
793
- * schedule. It admits Saturday and holiday sessions exactly like
794
- * `latestRthSessionBoundsAtOrBefore` (every calendar day has mathematical
795
- * bounds), the RTH window (09:30 to 16:15 New York, 09:00 to 14:30 on NYMEX)
796
- * is not the Globex cycle, and it can neither prove a venue still closed nor
797
- * name the 17:00 CT
798
- * reopen. A caller may shorten a timer to it (one extra probe on a
799
- * non-trading day at worst); it must never skip a request, derive 'closed'
800
- * or resume a cadence from it. Null for an unmapped symbol or a non-finite
801
- * instant.
839
+ * The next calendar day's RTH window open strictly AFTER `tsMs` on the same
840
+ * memoized window: inside a session it is tomorrow's open, after the close it
841
+ * is the next calendar day's, before the open it is today's. Every calendar
842
+ * day counts (Saturday and holidays included) on purpose: this is the step of
843
+ * the BAR walks (live-bucket's off-session resume, wrun-leg-close's next bar),
844
+ * which keep a bar only where the product trades by its schedule, and an
845
+ * early-halt holiday morning or an always-on root's weekend holds RTH bars a
846
+ * trade-date step would skip. Never a session pick: those read
847
+ * `nextRthTradeSessionOpenMs` and `latestRthSessionBoundsAtOrBefore`. Steps
848
+ * 24 h, so a Saturday instant in the hour before the spring-forward midnight
849
+ * resolves Monday's open. Null for an unmapped symbol or a non-finite instant.
802
850
  */
803
851
  export function nextRthSessionOpenMs(symbol, tsMs) {
804
852
  const window = getRthWindowForSymbol(symbol);
@@ -1 +1,2 @@
1
- export declare function getSessionInterval(sessionType: string, chartInterval: string): number | string;
1
+ /** Always ms: a named session (a region, the day split) is a day; its hours ride its window (sessionWindowKeysFor). */
2
+ export declare function getSessionInterval(sessionType: string, chartInterval: string): number;
@@ -16,10 +16,8 @@ const SESSION_INTERVALS = {
16
16
  '3M': { Footprint: Intervals.MONTH3, Targeted: Intervals.MONTH3, Wide: Intervals.MONTH3 },
17
17
  '1Y': { Footprint: Intervals.YEAR, Targeted: Intervals.YEAR, Wide: Intervals.YEAR },
18
18
  };
19
+ /** Always ms: a named session (a region, the day split) is a day; its hours ride its window (sessionWindowKeysFor). */
19
20
  export function getSessionInterval(sessionType, chartInterval) {
20
- if (['US', 'EU', 'Asia'].includes(sessionType)) {
21
- return sessionType;
22
- }
23
21
  // A preset or an extended rung reads the row of its standard at or below
24
22
  // (10m -> 5m, 30s -> 1s, 6M -> 3M), floored at its own bar: a session never
25
23
  // splits a bar, so Footprint (one profile per chart bar) keeps the chart's
@@ -0,0 +1,150 @@
1
+ /**
2
+ * Session lattices: the client mirror of how tsdb-gateway labels a session
3
+ * venue's history at 4h, 1d, 1w and the rolled-up presets. The gateway keeps
4
+ * ONE rollup for every venue that owns its trading day (pkg/tsdb/selects/
5
+ * session_profile.go `sessionProfile`, generalised from the CME rollup by
6
+ * !2483): a profile names the wall clock the bars are cut on, the venues, the
7
+ * intervals and the weekend rule, and the rollup re-groups source-tier rows on
8
+ * that wall clock. This module is the same table: a venue with its own trading
9
+ * day is one more profile here, and every live writer, fetch window, run-bar
10
+ * span and trading-day anchor reads the profile instead of naming a venue.
11
+ *
12
+ * The two profiles the gateway serves today:
13
+ *
14
+ * - CME Group (`cmeSession`, cme.go, since c645fd6; the presets since !2151):
15
+ * 17:00 America/Chicago, on the CME trade calendar (a weekday holiday's
16
+ * session belongs to the next trade date, cme-trade-calendar.util, !2154),
17
+ * a weekend day keeps its own date (the 24/7 crypto products trade it).
18
+ * Served for TRADE_AGG, TRADE_SIDE_AGNOSTIC_AGG and the per-symbol
19
+ * VOLUME_PROFILE_AGG / BLOCK_BOOK_SNAPSHOT_AGG of CME, CBOT, NYMEX, COMEX.
20
+ * - Forex (`forexSession`, forex_session.go, !2483, Discord ticket 603): 17:00
21
+ * America/New_York, the day TradingView and MT4 cut on, no calendar, and a
22
+ * session day falling on a weekend moves to the Monday after (Sunday's
23
+ * 17:00 open starts Monday's bar; there is no Sunday bar). Served for
24
+ * FX_OTC TICKER_AGG at 4h and wider only: finer bars nest in the hours.
25
+ *
26
+ * How the gateway stamps a bar (`sessionProfile.bucketExpression`):
27
+ *
28
+ * - intraday widths: `time_bucket(width, ts, timezone => zone, offset =>
29
+ * open modulo the width)`, so the open starts a bar. 4h on a 17:00 open:
30
+ * local 01/05/09/13/17/21 (22/02/06/10/14/18Z in daylight time, an hour
31
+ * later in standard time); 2h and 8h offset 1h, 6h and 12h 5h, 45m 30m,
32
+ * 2m 3m 10m none. The source tier is the coarsest of 1h/15m/5m/1m dividing
33
+ * both the width and that offset (`sourceStepMs`);
34
+ * - 1d: the trade date (the date flips at the open), stamped at 00:00Z of
35
+ * that date, so an evening print belongs to TOMORROW's bar; the weekend
36
+ * rule, then the calendar, move the date;
37
+ * - 3d: the trade dates in threes (the calendar's `DayGroupStart`, else the
38
+ * weekday grid from 2000-01-03), labeled by the first;
39
+ * - 1w: the Monday of the trade-date week, 00:00Z;
40
+ * - 1M 3M 6M 1Y: the months of the trade dates, stamped on the first month's
41
+ * 1st at 00:00Z (29dda19, intervals part 4); a weekend day joins the Friday
42
+ * before, so a stale weekend book never opens a month.
43
+ *
44
+ * A live writer that floored session frames on the UTC grid instead split the
45
+ * forming bar (a 04:00 ET CME candle beside the 02:00 ET one; an FX 4h candle
46
+ * frozen for two hours after each lattice open) and titan dropped the frames
47
+ * keyed before it.
48
+ *
49
+ * Pure and worker-safe: Intl only, no dayjs.
50
+ */
51
+ /** A venue's trade calendar, the holidays its trade dates skip (the gateway's `tradecalendar.Calendar`). */
52
+ export interface SessionTradeCalendar {
53
+ isTradeDate(dayMs: number): boolean;
54
+ tradeDateOnOrAfter(dayMs: number): number;
55
+ tradeDateOnOrBefore(dayMs: number): number;
56
+ dayGroupStartMs(tradeDateMs: number, days: number): number;
57
+ }
58
+ export type SessionLatticeId = 'cme' | 'forex';
59
+ /**
60
+ * One venue group's trading day (the gateway's `sessionProfile`): the wall
61
+ * clock its bars are cut on, the venues, the intraday widths the gateway
62
+ * buckets on the lattice (1d, 3d, 1w and the calendar rungs always are), the
63
+ * weekend rule and the trade calendar. Plain data, so a profile can be named
64
+ * in a context that crosses a worker boundary by its `id`.
65
+ */
66
+ export interface SessionLatticeProfile {
67
+ readonly id: SessionLatticeId;
68
+ readonly timeZone: string;
69
+ /** The zone's standard-time and daylight-time UTC offsets (Postgres reads an ambiguous wall time as standard). */
70
+ readonly standardOffsetMs: number;
71
+ readonly daylightOffsetMs: number;
72
+ /** The session open on the zone's wall clock, a whole evening hour: everything at or after it trades toward the next date. */
73
+ readonly openHour: number;
74
+ /** The exchange codes the gateway rolls up on this lattice (`isExplicitExchangePlan`), upper case. */
75
+ readonly exchanges: ReadonlySet<string>;
76
+ readonly intradayLatticeMs: ReadonlySet<number>;
77
+ /** A session day on a weekend moves to the Monday after it (rows stamped on a weekend date join the session they open). */
78
+ readonly weekendToMonday: boolean;
79
+ readonly calendar: SessionTradeCalendar | null;
80
+ }
81
+ /** CME Group: 17:00 America/Chicago on the CME trade calendar (gateway `cmeSession`). GLOBEX is a metadata alias with no gate mapping. */
82
+ export declare const CME_SESSION_LATTICE: SessionLatticeProfile;
83
+ /** Forex: 17:00 America/New_York, Sunday's open starts Monday's bar (gateway `forexSession`, 4h and wider only). */
84
+ export declare const FOREX_SESSION_LATTICE: SessionLatticeProfile;
85
+ /** Every venue group with a trading day of its own (the gateway's `sessionProfiles`). */
86
+ export declare const SESSION_LATTICE_PROFILES: readonly SessionLatticeProfile[];
87
+ /** The profile named `id`, or null. */
88
+ export declare function sessionLatticeById(id: unknown): SessionLatticeProfile | null;
89
+ /** The lattice the gateway rolls `exchange` up on, or null for a venue that keeps the UTC aggregates. */
90
+ export declare function sessionLatticeOf(exchange: unknown): SessionLatticeProfile | null;
91
+ /** The intervals the gateway serves on the profile's lattice: its intraday widths, 1d, 3d, 1w and the calendar rungs. */
92
+ export declare function isSessionLatticeIntervalMs(profile: SessionLatticeProfile, intervalMs: unknown): boolean;
93
+ /**
94
+ * The first trade date (00:00Z) of the 3d session bar holding the trade date
95
+ * `dayMs` (gateway `sessionGridStart`, session_grid.go): trade dates are
96
+ * counted in weekdays from 2000-01-03, a Monday, three to a bar; a weekend
97
+ * date counts as the Friday before it. The regular US equities session and
98
+ * the forex lattice (no calendar); CME rides the trade calendar, every other
99
+ * market's 3d is the calendar floor.
100
+ */
101
+ export declare function sessionGridStartMs(dayMs: number): number;
102
+ /**
103
+ * The bar key the gateway stamps for the profile's session bar holding
104
+ * `tsMs`: the intraday bucket start, or the trade-date label (00:00Z of the
105
+ * trade date, not the open instant) at 1d, the first trade date of its 3d
106
+ * group, the Monday of its week at 1w, and the 1st of its trade date's month,
107
+ * quarter, half or year at a calendar length. Null when the interval is not a
108
+ * lattice interval of the profile or the input is not a number.
109
+ */
110
+ export declare function sessionLatticeBucketMs(profile: SessionLatticeProfile, tsMs: number, intervalMs: number): number | null;
111
+ /**
112
+ * The instant the session bar stamped `barMs` (a key `sessionLatticeBucketMs` stamps) stops taking
113
+ * source rows: the end of the last source row the lattice books to it, for a reader that must never
114
+ * take a bar before it closes (a pinned wrun leg). At 1d, 3d and 1w the key only advances with the
115
+ * session day, so the bar ends at the first source row booked elsewhere: a 3d bar runs to the open of
116
+ * the next group's first session, a weekend or a weekday holiday inside it (Thursday, Friday and
117
+ * Monday close at Monday's open), a 1d bar to the open that starts the next session day (a forex
118
+ * Monday, which holds the weekend before it, still ends at Monday's 17:00 New York). An intraday bar
119
+ * ends at its stamp plus its width, except across a DST change: on the fall-back Sunday a bucket
120
+ * reaching the repeated hour holds its rows an hour longer (the 01:00 4h bar runs five real hours),
121
+ * and the 45m lattice books rows of the repeated hour back to an earlier stamp, so the end is the end
122
+ * of the LAST row booked to it within its width and an hour. A calendar bar runs to the next one's
123
+ * open (July 2026 to Sunday 8/2 at 17:00 CDT). Null off the lattice intervals, or for a stamp the
124
+ * lattice books no row to.
125
+ */
126
+ export declare function sessionLatticeBarEndMs(profile: SessionLatticeProfile, barMs: number, intervalMs: number): number | null;
127
+ /**
128
+ * The instant the session bar holding `tsMs` opens, for a fetch window that
129
+ * must cover the whole bar: the intraday bucket start, or the open before the
130
+ * first session day booked to the label (1d, 3d, 1w and the calendar rungs,
131
+ * where the bar key is a 00:00Z label that runs ahead of the open): the
132
+ * 17:00 open before a trade date, Sunday's open before a week's Monday, a
133
+ * month's first trade date (August 2026 opens Sunday 8/2). A 1d or 3d bar
134
+ * after a weekday holiday opens with the holiday's session (9/8 opens Sunday
135
+ * 9/6); a forex Monday opens at Friday's close, where its weekend prints
136
+ * start. Null off the lattice intervals.
137
+ */
138
+ export declare function sessionLatticeBarOpenMs(profile: SessionLatticeProfile, tsMs: number, intervalMs: number): number | null;
139
+ /**
140
+ * The stamp of the session bar after `barMs` (a stamp `sessionLatticeBucketMs` gives), for a walk that must visit
141
+ * every bar of a window once: the first later stamp a source row is booked to, read row by row from `barMs` at the
142
+ * gateway's source step (an hour on the daily and calendar bars). Never the bucket of `barMs + intervalMs`: a
143
+ * lattice bar can outlast its width (the 01:00 4h bar runs five real hours on a fall-back Sunday, a 3d bar holds the
144
+ * weekend inside it, a 31-day month outlasts the 1M width), and inside such a bar that bucket is the bar itself, so
145
+ * a walk stepping it never moves (the k-trades grid spun until the data worker's heap ran out, 2026-11-05). Rows
146
+ * after the change can book back to an earlier stamp (the 45m lattice's repeated hour), so the first LATER stamp is
147
+ * the next bar, never the bar the last row of `barMs` ends at. Null off the lattice intervals or when no later
148
+ * stamp sits within reach.
149
+ */
150
+ export declare function sessionLatticeNextBarMs(profile: SessionLatticeProfile, barMs: number, intervalMs: number): number | null;