@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
@@ -15,8 +15,25 @@ export declare const US_EQUITIES_TIME_ZONE = "America/New_York";
15
15
  export declare const usEquitiesSessionConfig: {
16
16
  extendedHoursEnabled: boolean;
17
17
  };
18
- /** The workspace opted into extended hours AND the option is enabled. */
19
- export declare function isEquityExtendedSession(sessionType: unknown): boolean;
18
+ /**
19
+ * Whether a US stock chart rides its extended session at `interval` (the
20
+ * chart's interval label or milliseconds): the workspace opted into extended
21
+ * hours, the option is enabled, AND the bars are shorter than a day. Daily and
22
+ * longer bars always ride the regular session, whatever the choice:
23
+ * TradingView's rule (its D, W and M stock bars are the regular session's
24
+ * while extended hours show intraday) and the twin of the CME rule, where RTH
25
+ * applies only intraday and daily bars keep the full session
26
+ * (rth-session.util `isChartRthActive`). The persisted word is never changed,
27
+ * so back on an intraday interval the chart rides extended again. An unknown
28
+ * interval keeps the choice: only a known daily or longer interval folds it.
29
+ *
30
+ * Every reader of the setting asks here with its interval: the candle fetch
31
+ * (candle-trading-hour.util), the live lanes and their gate, the live bucket,
32
+ * the bars cache key, a fresh alert's session, the effective chart session,
33
+ * the shading and the settings control, so they cannot disagree
34
+ * (tests/utility/chart/us-equities-session.interval-rule.spec.ts).
35
+ */
36
+ export declare function isEquityExtendedSession(sessionType: unknown, interval: unknown): boolean;
20
37
  /**
21
38
  * The regular cash session as a window object, for the shared zone-day walks
22
39
  * in rth-session.util (one frozen constant so their per-window memo holds).
@@ -40,13 +57,13 @@ export interface UsEquitiesScheduleStatus {
40
57
  }
41
58
  export declare function resolveUsEquitySessionPhase(tsMs: number): UsEquitySessionPhase;
42
59
  /**
43
- * A regular-session chart on a Polygon venue: the default (unset or 'regular')
44
- * gates to the cash session; 'extended' opts into every print only while the
45
- * extended-hours option is enabled (`usEquitiesSessionConfig`). Mirrors the
46
- * `tradingHour` derivation in candle-trading-hour.util so the wire filter and
47
- * the client-side doors agree.
60
+ * A regular-session chart on a Polygon venue at `interval`: the default (unset
61
+ * or 'regular') gates to the cash session; 'extended' opts into every print
62
+ * only while `isEquityExtendedSession` holds (the option enabled, bars shorter
63
+ * than a day). Mirrors the `tradingHour` derivation in candle-trading-hour.util
64
+ * so the wire filter and the client-side doors agree.
48
65
  */
49
- export declare function isEquityRegularSessionGated(exchange: unknown, sessionType: unknown): boolean;
66
+ export declare function isEquityRegularSessionGated(exchange: unknown, sessionType: unknown, interval: unknown): boolean;
50
67
  /**
51
68
  * Whether a bar with open time `tsMs` belongs on a regular-session equities
52
69
  * chart at `intervalMs`. Intraday buckets up to 30m sit on the session grid
@@ -81,7 +98,7 @@ export declare function usEquityAnchoredBucketStartMs(tsMs: number, intervalMs:
81
98
  */
82
99
  export declare function usEquitySessionGridBucketStartMs(tsMs: number): number | null;
83
100
  export type EquityLiveTradeGate =
84
- /** Not a gated chart (non-Polygon venue, or the workspace opted into extended hours). */
101
+ /** Not a gated chart (non-Polygon venue, or an extended-hours chart below a day). */
85
102
  {
86
103
  kind: 'pass';
87
104
  }
@@ -94,8 +111,12 @@ export type EquityLiveTradeGate =
94
111
  kind: 'outside';
95
112
  phase: Exclude<UsEquitySessionPhase, 'regular'>;
96
113
  };
97
- /** The live-lane decision for one trade print at `tsMs`. */
98
- export declare function resolveEquityLiveTradeGate(exchange: unknown, sessionType: unknown, tsMs: number): EquityLiveTradeGate;
114
+ /**
115
+ * The live-lane decision for one trade print at `tsMs` on a chart at
116
+ * `interval`: a daily or longer bar takes the cash session's prints only, the
117
+ * extended-hours chart's too (`isEquityExtendedSession`).
118
+ */
119
+ export declare function resolveEquityLiveTradeGate(exchange: unknown, sessionType: unknown, tsMs: number, interval: unknown): EquityLiveTradeGate;
99
120
  /**
100
121
  * The close a stock's change is measured against, TradingView's way: the
101
122
  * previous regular session's close while the price belongs to the latest
@@ -22,15 +22,21 @@
22
22
  * Every per-row answer here reads the New York calendar (ny-calendar.util):
23
23
  * one timezone lookup per date, integer compares per row.
24
24
  *
25
+ * The session setting has one interval rule (`isEquityExtendedSession`):
26
+ * Extended reshapes intraday bars only. Daily and longer bars always ride the
27
+ * regular session, as TradingView's do, so every reader of the setting asks
28
+ * with the interval it draws or fetches.
29
+ *
25
30
  * Worker-safe: no Vue / store / i18n imports (the bars cache and the workers
26
31
  * import the row filter).
27
32
  */
28
33
  import { checkIsPolygon } from './marketKind.util.js';
29
34
  import { NY_REGULAR_CLOSE_MINUTES, NY_REGULAR_OPEN_MINUTES, NY_TIME_ZONE, nyCalendarDay, nyCalendarDayAt, nyNextRegularOpenAfterMs, nyRegularSessionOpenMs, } from './ny-calendar.util.js';
30
- import { isFootprintRthFoldTfMs, isRthBucketExactIntervalMs, sessionWindowsInRange, } from './rth-session.util.js';
35
+ import { chartIntervalToMs, isFootprintRthFoldTfMs, isRthBucketExactIntervalMs, sessionWindowsInRange, } from './rth-session.util.js';
31
36
  import { sessionGridStartMs } from './cme-session-bucket.util.js';
32
37
  import { checkUSMarketHours } from '../common/time.util.js';
33
38
  export const US_EQUITIES_TIME_ZONE = NY_TIME_ZONE;
39
+ const DAY_MS = 86_400_000;
34
40
  /**
35
41
  * Switch for the equities extended-hours session. On (since 2026-10-02):
36
42
  * Polygon's consolidated minute bars are back on exchange 92 and carry the
@@ -44,14 +50,33 @@ export const US_EQUITIES_TIME_ZONE = NY_TIME_ZONE;
44
50
  * EQUS.MINI, whose extended-hours minutes were a scatter of prints.
45
51
  */
46
52
  export const usEquitiesSessionConfig = { extendedHoursEnabled: true };
47
- /** The workspace opted into extended hours AND the option is enabled. */
48
- export function isEquityExtendedSession(sessionType) {
49
- return usEquitiesSessionConfig.extendedHoursEnabled && sessionType === 'extended';
53
+ /**
54
+ * Whether a US stock chart rides its extended session at `interval` (the
55
+ * chart's interval label or milliseconds): the workspace opted into extended
56
+ * hours, the option is enabled, AND the bars are shorter than a day. Daily and
57
+ * longer bars always ride the regular session, whatever the choice:
58
+ * TradingView's rule (its D, W and M stock bars are the regular session's
59
+ * while extended hours show intraday) and the twin of the CME rule, where RTH
60
+ * applies only intraday and daily bars keep the full session
61
+ * (rth-session.util `isChartRthActive`). The persisted word is never changed,
62
+ * so back on an intraday interval the chart rides extended again. An unknown
63
+ * interval keeps the choice: only a known daily or longer interval folds it.
64
+ *
65
+ * Every reader of the setting asks here with its interval: the candle fetch
66
+ * (candle-trading-hour.util), the live lanes and their gate, the live bucket,
67
+ * the bars cache key, a fresh alert's session, the effective chart session,
68
+ * the shading and the settings control, so they cannot disagree
69
+ * (tests/utility/chart/us-equities-session.interval-rule.spec.ts).
70
+ */
71
+ export function isEquityExtendedSession(sessionType, interval) {
72
+ if (!usEquitiesSessionConfig.extendedHoursEnabled || sessionType !== 'extended')
73
+ return false;
74
+ const intervalMs = chartIntervalToMs(interval);
75
+ return !(typeof intervalMs === 'number' && intervalMs >= DAY_MS);
50
76
  }
51
77
  /** Minutes after local midnight, matching `checkUSMarketHours` (both read the New York calendar's edges). */
52
78
  const REGULAR_OPEN_MINUTES = NY_REGULAR_OPEN_MINUTES;
53
79
  const REGULAR_CLOSE_MINUTES = NY_REGULAR_CLOSE_MINUTES;
54
- const DAY_MS = 86_400_000;
55
80
  /**
56
81
  * The regular cash session as a window object, for the shared zone-day walks
57
82
  * in rth-session.util (one frozen constant so their per-window memo holds).
@@ -73,15 +98,15 @@ export function resolveUsEquitySessionPhase(tsMs) {
73
98
  return checkUSMarketHours(tsMs).sessionType;
74
99
  }
75
100
  /**
76
- * A regular-session chart on a Polygon venue: the default (unset or 'regular')
77
- * gates to the cash session; 'extended' opts into every print only while the
78
- * extended-hours option is enabled (`usEquitiesSessionConfig`). Mirrors the
79
- * `tradingHour` derivation in candle-trading-hour.util so the wire filter and
80
- * the client-side doors agree.
101
+ * A regular-session chart on a Polygon venue at `interval`: the default (unset
102
+ * or 'regular') gates to the cash session; 'extended' opts into every print
103
+ * only while `isEquityExtendedSession` holds (the option enabled, bars shorter
104
+ * than a day). Mirrors the `tradingHour` derivation in candle-trading-hour.util
105
+ * so the wire filter and the client-side doors agree.
81
106
  */
82
- export function isEquityRegularSessionGated(exchange, sessionType) {
107
+ export function isEquityRegularSessionGated(exchange, sessionType, interval) {
83
108
  const exchangeCode = typeof exchange === 'string' ? exchange : undefined;
84
- return checkIsPolygon(exchangeCode) && !isEquityExtendedSession(sessionType);
109
+ return checkIsPolygon(exchangeCode) && !isEquityExtendedSession(sessionType, interval);
85
110
  }
86
111
  /**
87
112
  * Whether a bar with open time `tsMs` belongs on a regular-session equities
@@ -139,9 +164,13 @@ export function usEquitySessionGridBucketStartMs(tsMs) {
139
164
  return null;
140
165
  return sessionGridStartMs(tsMs - (tsMs % 86_400_000));
141
166
  }
142
- /** The live-lane decision for one trade print at `tsMs`. */
143
- export function resolveEquityLiveTradeGate(exchange, sessionType, tsMs) {
144
- if (!isEquityRegularSessionGated(exchange, sessionType))
167
+ /**
168
+ * The live-lane decision for one trade print at `tsMs` on a chart at
169
+ * `interval`: a daily or longer bar takes the cash session's prints only, the
170
+ * extended-hours chart's too (`isEquityExtendedSession`).
171
+ */
172
+ export function resolveEquityLiveTradeGate(exchange, sessionType, tsMs, interval) {
173
+ if (!isEquityRegularSessionGated(exchange, sessionType, interval))
145
174
  return { kind: 'pass' };
146
175
  const phase = resolveUsEquitySessionPhase(tsMs);
147
176
  return phase === 'regular' ? { kind: 'regular' } : { kind: 'outside', phase };
@@ -75,6 +75,10 @@ export interface WindowGeometryChart {
75
75
  /** titan's pane collapse: `hide` takes the pane out of the stack (its `isPaneHidden`, its height kept for the way
76
76
  * back) and leaves the overlay's eye alone, unlike `togglePane`, which hides the plot too. */
77
77
  togglePaneWithAnimation?(id: string, hide: boolean): void;
78
+ /** titan's focus mode (an expanded pane) holds the stack; titan's reader throws on an engine without a canvas. */
79
+ isFocusModeActive?(): boolean;
80
+ /** Ends titan's focus mode: the heights it saved at entry come back. */
81
+ exitFocusMode?(): void;
78
82
  }
79
83
  /** The body rows of a table pane (a mounted meta or an addOverlay config):
80
84
  * its one decorator row's grid minus the header; undefined when unreadable. */
@@ -96,6 +100,15 @@ export declare function mountedWindowPanes(metadata: ReadonlyArray<WindowGeometr
96
100
  export declare function ownerPaneDrawsNothing(meta: Pick<WindowGeometryMeta, 'type' | 'plot' | 'settings' | 'nestedMeta' | 'runResult'>): boolean;
97
101
  /** Whether the candle pane is hidden on this engine: the window layout is in force. */
98
102
  export declare function isMainPaneHidden(metadata: ReadonlyArray<WindowGeometryMeta>): boolean;
103
+ /**
104
+ * The band of the stack a hidden candle pane still takes, or undefined when it takes none (or shows). The engine lays
105
+ * the stack out by meta height, so a writer that lays it out again from a pane's own height hands the hidden main the
106
+ * rest: a built-in owner mounting over its stand-in on a rebuilt engine (a market switch across chart lifecycles, a
107
+ * reload) takes its control's default height, and the window became a strip under an empty band (WINDOW-SYMBOL
108
+ * 2026-10-31). The reconcile pins the band at 0; the window host reads it to learn that a writer it does not key on
109
+ * moved the layout.
110
+ */
111
+ export declare function hiddenMainBand(metadata: ReadonlyArray<WindowGeometryMeta>): number | undefined;
99
112
  /**
100
113
  * The reader dragged a splitter in a window (the engine's `resize-grids`):
101
114
  * the heights on the engine are theirs now. They become the panes' requests
@@ -104,11 +117,13 @@ export declare function isMainPaneHidden(metadata: ReadonlyArray<WindowGeometryM
104
117
  * so a request left at the plan would undo the drag there), and the plan
105
118
  * stands down: reconcileWindowOwnerGeometry writes no weight until the pane
106
119
  * set changes. No engine call: the drag already laid the panes out, and this
107
- * runs on every drag move. Silent on a normal chart (main visible) and for an
108
- * owner without a pane. Returns the held weights as the window's split
109
- * (WindowSplit: keyed relative to the owner, normalized to 1, rounded), the
110
- * value the host writes to the owner row; undefined when nothing is held, or
111
- * when a held pane has no usable height yet (nothing worth saving).
120
+ * runs on every drag move. Silent on a normal chart (main visible), for an
121
+ * owner without a pane, and while an expanded pane holds the stack (its 1 and
122
+ * 0 heights are titan's focus layout, never the reader's split). Returns the
123
+ * held weights as the window's split (WindowSplit: keyed relative to the
124
+ * owner, normalized to 1, rounded), the value the host writes to the owner
125
+ * row; undefined when nothing is held, or when a held pane has no usable
126
+ * height yet (nothing worth saving).
112
127
  */
113
128
  export declare function holdWindowPaneHeights(tc: WindowGeometryChart | null | undefined, ownerId: string): WindowSplit | undefined;
114
129
  /**
@@ -133,7 +148,10 @@ export declare function savedWindowSplit(ownerSettings: Record<string, unknown>
133
148
  * exactly the mounted panes; else the planner's. Main itself is never
134
149
  * written. First the owner's own pane is settled (settleOwnerPane: hidden
135
150
  * while it draws nothing beside other panes, C5), so the plan reads the
136
- * panes that will show. Returns whether anything was written.
151
+ * panes that will show. Writes nothing while an expanded pane holds the stack
152
+ * (focusHoldsStack): no height, no collapse, no main pin, no resize; titan's
153
+ * exit re-splits from the requests and the next pass applies the plan.
154
+ * Returns whether anything was written.
137
155
  */
138
156
  export declare function reconcileWindowOwnerGeometry(tc: WindowGeometryChart | null | undefined, ownerId: string, canvasHeightPx?: number): boolean;
139
157
  /**
@@ -144,6 +162,9 @@ export declare function reconcileWindowOwnerGeometry(tc: WindowGeometryChart | n
144
162
  * first), so the engine carves the panes out of main the way a fresh mount
145
163
  * would. Keyed by the owner id because the flag is already off by then.
146
164
  * An owner pane the window hid (C5) comes back first, as a chart shows it.
147
- * Returns whether anything was written.
165
+ * An expanded pane still holding the stack is ended first: the reversal runs
166
+ * once, so a write left for a later pass would never land (on web the host's
167
+ * main release, titan's togglePane, has ended it already). Returns whether
168
+ * anything was written.
148
169
  */
149
170
  export declare function restoreNormalOwnerGeometry(tc: WindowGeometryChart | null | undefined, ownerId: string, canvasHeightPx?: number): boolean;
@@ -69,6 +69,18 @@
69
69
  * a re-mount over the same pane ids keeps the reader's split (their intent
70
70
  * outranks the plan), a pane joining or leaving makes the split stop matching
71
71
  * and the plan applies, and Show chart deletes it with the flag.
72
+ *
73
+ * An expanded pane (titan's focus mode: the legend's maximize button, a pane
74
+ * double-click, a saved maximizedPaneId at boot) owns the stack while it is
75
+ * active: titan lays every other pane at 0, keeps no splitter, and on its exit
76
+ * puts back the heights it saved at entry (under a hidden main it re-splits
77
+ * from the requests). A height written onto that layout undoes the expanded
78
+ * view and is undone again at the exit. So no writer here writes onto it
79
+ * (focusHoldsStack): the reconcile and the hold write nothing while it holds
80
+ * (the next pass after the exit applies the plan, as titan's own updateSettings
81
+ * door defers a request), and the reversal, a one-shot structural change, ends
82
+ * it first, as titan does before each of its own (togglePane, addOverlay,
83
+ * removeOverlay).
72
84
  */
73
85
  import { PANEL_CHART_GRID_HEIGHT, panelGridHeight } from './om-panel.util.js';
74
86
  import { MIN_GRID_HEIGHT_ALLOWED } from './titan-constants.pin.js';
@@ -183,6 +195,16 @@ export function planWindowWeights(panes, canvasHeightPx) {
183
195
  const rounded = roundWeightsToOne(weights);
184
196
  return panes.map((pane, at) => ({ id: pane.id, gridHeight: rounded[at] }));
185
197
  }
198
+ /** Whether an expanded pane (titan's focus mode) holds the stack: no window height may land on it. A reader that
199
+ * throws counts as no focus. */
200
+ function focusHoldsStack(tc) {
201
+ try {
202
+ return tc.isFocusModeActive?.() === true;
203
+ }
204
+ catch {
205
+ return false;
206
+ }
207
+ }
186
208
  /** The body rows of a table pane (a mounted meta or an addOverlay config):
187
209
  * its one decorator row's grid minus the header; undefined when unreadable. */
188
210
  export function tableRowCountOf(pane) {
@@ -283,6 +305,21 @@ export function isMainPaneHidden(metadata) {
283
305
  const main = metadata.find((meta) => meta.id === 'main') ?? metadata[0];
284
306
  return main?.isPaneHidden === true;
285
307
  }
308
+ /**
309
+ * The band of the stack a hidden candle pane still takes, or undefined when it takes none (or shows). The engine lays
310
+ * the stack out by meta height, so a writer that lays it out again from a pane's own height hands the hidden main the
311
+ * rest: a built-in owner mounting over its stand-in on a rebuilt engine (a market switch across chart lifecycles, a
312
+ * reload) takes its control's default height, and the window became a strip under an empty band (WINDOW-SYMBOL
313
+ * 2026-10-31). The reconcile pins the band at 0; the window host reads it to learn that a writer it does not key on
314
+ * moved the layout.
315
+ */
316
+ export function hiddenMainBand(metadata) {
317
+ const main = metadata.find((meta) => meta.id === 'main') ?? metadata[0];
318
+ if (main?.isPaneHidden !== true)
319
+ return undefined;
320
+ const band = main.gridHeight;
321
+ return typeof band === 'number' && band >= WINDOW_GRID_HEIGHT_TOLERANCE ? band : undefined;
322
+ }
286
323
  /** Engine to its held window. Weak: a rebuilt engine starts on the plan. */
287
324
  const windowHolds = new WeakMap();
288
325
  /** Whether the reader's split still stands: a hold for this owner over exactly
@@ -306,14 +343,16 @@ function isWindowHeld(tc, ownerId, metas) {
306
343
  * so a request left at the plan would undo the drag there), and the plan
307
344
  * stands down: reconcileWindowOwnerGeometry writes no weight until the pane
308
345
  * set changes. No engine call: the drag already laid the panes out, and this
309
- * runs on every drag move. Silent on a normal chart (main visible) and for an
310
- * owner without a pane. Returns the held weights as the window's split
311
- * (WindowSplit: keyed relative to the owner, normalized to 1, rounded), the
312
- * value the host writes to the owner row; undefined when nothing is held, or
313
- * when a held pane has no usable height yet (nothing worth saving).
346
+ * runs on every drag move. Silent on a normal chart (main visible), for an
347
+ * owner without a pane, and while an expanded pane holds the stack (its 1 and
348
+ * 0 heights are titan's focus layout, never the reader's split). Returns the
349
+ * held weights as the window's split (WindowSplit: keyed relative to the
350
+ * owner, normalized to 1, rounded), the value the host writes to the owner
351
+ * row; undefined when nothing is held, or when a held pane has no usable
352
+ * height yet (nothing worth saving).
314
353
  */
315
354
  export function holdWindowPaneHeights(tc, ownerId) {
316
- if (!tc || tc.isDestroyed)
355
+ if (!tc || tc.isDestroyed || focusHoldsStack(tc))
317
356
  return undefined;
318
357
  if (!isMainPaneHidden(tc.metadata))
319
358
  return undefined;
@@ -374,11 +413,16 @@ export function savedWindowSplit(ownerSettings, panes) {
374
413
  * exactly the mounted panes; else the planner's. Main itself is never
375
414
  * written. First the owner's own pane is settled (settleOwnerPane: hidden
376
415
  * while it draws nothing beside other panes, C5), so the plan reads the
377
- * panes that will show. Returns whether anything was written.
416
+ * panes that will show. Writes nothing while an expanded pane holds the stack
417
+ * (focusHoldsStack): no height, no collapse, no main pin, no resize; titan's
418
+ * exit re-splits from the requests and the next pass applies the plan.
419
+ * Returns whether anything was written.
378
420
  */
379
421
  export function reconcileWindowOwnerGeometry(tc, ownerId, canvasHeightPx) {
380
422
  if (!tc || tc.isDestroyed || typeof tc.updateSettings !== 'function')
381
423
  return false;
424
+ if (focusHoldsStack(tc))
425
+ return false;
382
426
  if (!isMainPaneHidden(tc.metadata)) {
383
427
  // The window layout is not in force: no hold outlives it, and an owner pane it hid comes back.
384
428
  windowHolds.delete(tc);
@@ -427,13 +471,18 @@ export function reconcileWindowOwnerGeometry(tc, ownerId, canvasHeightPx) {
427
471
  * first), so the engine carves the panes out of main the way a fresh mount
428
472
  * would. Keyed by the owner id because the flag is already off by then.
429
473
  * An owner pane the window hid (C5) comes back first, as a chart shows it.
430
- * Returns whether anything was written.
474
+ * An expanded pane still holding the stack is ended first: the reversal runs
475
+ * once, so a write left for a later pass would never land (on web the host's
476
+ * main release, titan's togglePane, has ended it already). Returns whether
477
+ * anything was written.
431
478
  */
432
479
  export function restoreNormalOwnerGeometry(tc, ownerId, canvasHeightPx) {
433
480
  if (!tc || tc.isDestroyed || typeof tc.updateSettings !== 'function')
434
481
  return false;
435
482
  if (isMainPaneHidden(tc.metadata))
436
483
  return false;
484
+ if (focusHoldsStack(tc))
485
+ tc.exitFocusMode?.();
437
486
  // Back to a chart: the reader's window split ends with the window.
438
487
  windowHolds.delete(tc);
439
488
  const shown = showOwnerPane(tc, ownerId);
@@ -26,29 +26,34 @@
26
26
  * - US equities: `resolveUsEquitySessionPhase`;
27
27
  * - CME family: 0 while the weekly schedule says closed
28
28
  * (`getGovernedFuturesScheduleStatusForSymbol`, which carries the 24/7
29
- * roots); else 1 inside the root's RTH window
30
- * (`engineRthWindowForSymbol`, the chart's own: 09:30 to 16:15 New York,
31
- * 09:00 to 14:30 on the NYMEX energy roots; a root without a window is
32
- * regular all session), 2 before its trade date's RTH window and 3 after
33
- * it;
29
+ * roots); else 1 inside the root's RTH window on the trade date's own New
30
+ * York calendar day (`engineRthWindowForSymbol`, the chart's own: 09:30 to
31
+ * 16:15 New York, 09:00 to 14:30 on the NYMEX energy roots; a root without
32
+ * a window is regular all session), 2 before it and 3 after it, so a
33
+ * weekday holiday's session, booked to the next trade date, reads 2 (no
34
+ * early close is modelled);
34
35
  * - forex and everything else: 1 (forex has no phases; its closed hours
35
36
  * print no bars).
36
37
  *
37
38
  * The chart's own trading-day anchor (trading-day.util `getTradingDayAnchor`,
38
- * the gate TPO, VWAP, the session dividers and the previous close read) does
39
- * not carry the forex day yet: like US equities, forex keeps the display day
40
- * there until that gate gains a New York 17:00 anchor in its own change, so
41
- * a forex Indicator's trade date rolls at 17:00 New York while the chart's
42
- * native dividers still roll at midnight.
39
+ * the gate TPO, VWAP, the session dividers and the previous close read)
40
+ * carries the same forex day (the forex session lattice, session-lattice.util,
41
+ * since tsdb-gateway !2483 serves FX daily bars on it), so a forex
42
+ * Indicator's trade date and the chart's native dividers roll together at
43
+ * 17:00 New York. US equities keep the display day there.
43
44
  *
44
45
  * The golden vectors every other host (kscript-alerts, kscript-backend, om)
45
46
  * tests against are generated from this module:
46
- * src/fixtures/wrun-session-facts/golden.json.
47
+ * src/fixtures/wrun-session-facts/golden.json. Its copies are pinned by
48
+ * sha256, so the weekday-holiday vectors sit apart, FE-only:
49
+ * src/fixtures/wrun-session-facts/holidays.json.
47
50
  *
48
51
  * NYMEX: the facts follow the energy pit session, 09:00 to 14:30 New York, the
49
52
  * window the chart judges RTH on there (rth-session.util
50
53
  * `rthWindowForExchange`, the gateway's REGULAR window), so an indicator's
51
- * `time.session` reads regular on exactly the bars an RTH chart keeps. The
54
+ * `time.session` reads regular on exactly the bars an RTH chart keeps, a
55
+ * weekday holiday's own window aside (that filter is a calendar-day window,
56
+ * the facts follow the trade date). The
52
57
  * shared host's venue layer (om session-facts-venues.ts) reads the same
53
58
  * windows and the golden pins them, so the browser and cloud runs of one
54
59
  * indicator agree; the kScript engine's uniform 09:30 to 16:15 table is being
@@ -66,13 +71,15 @@
66
71
  * 04:00, 09:30, 16:00 and 20:00;
67
72
  * - the forex trade date per New York (date, hour): its one boundary is the
68
73
  * whole hour 17:00;
69
- * - the CME RTH window per (window, trade date).
74
+ * - the CME RTH window once per trade date in each reader (two zone-clock
75
+ * conversions).
70
76
  * Both zones sit a whole number of hours off UTC, so a reader also keeps its
71
77
  * last answer per UTC hour (CME: the trade date and the schedule bit) or half
72
78
  * hour (equities), and a sorted walk pays the lookups once per grain, not per
73
79
  * bar. The spec walks every minute of both 2026 DST weeks against the
74
80
  * definitions themselves, so a boundary moved off those grains fails there,
75
- * not in the field, and measures 50k one-minute bars from a cold module.
81
+ * not in the field, and measures 50k one-minute bars from a cold module; the
82
+ * holiday spec walks 2026 every 15 minutes on each window shape.
76
83
  *
77
84
  * Worker-safe: imports only the chart's session utils (no Vue, store, i18n).
78
85
  */
@@ -26,29 +26,34 @@
26
26
  * - US equities: `resolveUsEquitySessionPhase`;
27
27
  * - CME family: 0 while the weekly schedule says closed
28
28
  * (`getGovernedFuturesScheduleStatusForSymbol`, which carries the 24/7
29
- * roots); else 1 inside the root's RTH window
30
- * (`engineRthWindowForSymbol`, the chart's own: 09:30 to 16:15 New York,
31
- * 09:00 to 14:30 on the NYMEX energy roots; a root without a window is
32
- * regular all session), 2 before its trade date's RTH window and 3 after
33
- * it;
29
+ * roots); else 1 inside the root's RTH window on the trade date's own New
30
+ * York calendar day (`engineRthWindowForSymbol`, the chart's own: 09:30 to
31
+ * 16:15 New York, 09:00 to 14:30 on the NYMEX energy roots; a root without
32
+ * a window is regular all session), 2 before it and 3 after it, so a
33
+ * weekday holiday's session, booked to the next trade date, reads 2 (no
34
+ * early close is modelled);
34
35
  * - forex and everything else: 1 (forex has no phases; its closed hours
35
36
  * print no bars).
36
37
  *
37
38
  * The chart's own trading-day anchor (trading-day.util `getTradingDayAnchor`,
38
- * the gate TPO, VWAP, the session dividers and the previous close read) does
39
- * not carry the forex day yet: like US equities, forex keeps the display day
40
- * there until that gate gains a New York 17:00 anchor in its own change, so
41
- * a forex Indicator's trade date rolls at 17:00 New York while the chart's
42
- * native dividers still roll at midnight.
39
+ * the gate TPO, VWAP, the session dividers and the previous close read)
40
+ * carries the same forex day (the forex session lattice, session-lattice.util,
41
+ * since tsdb-gateway !2483 serves FX daily bars on it), so a forex
42
+ * Indicator's trade date and the chart's native dividers roll together at
43
+ * 17:00 New York. US equities keep the display day there.
43
44
  *
44
45
  * The golden vectors every other host (kscript-alerts, kscript-backend, om)
45
46
  * tests against are generated from this module:
46
- * src/fixtures/wrun-session-facts/golden.json.
47
+ * src/fixtures/wrun-session-facts/golden.json. Its copies are pinned by
48
+ * sha256, so the weekday-holiday vectors sit apart, FE-only:
49
+ * src/fixtures/wrun-session-facts/holidays.json.
47
50
  *
48
51
  * NYMEX: the facts follow the energy pit session, 09:00 to 14:30 New York, the
49
52
  * window the chart judges RTH on there (rth-session.util
50
53
  * `rthWindowForExchange`, the gateway's REGULAR window), so an indicator's
51
- * `time.session` reads regular on exactly the bars an RTH chart keeps. The
54
+ * `time.session` reads regular on exactly the bars an RTH chart keeps, a
55
+ * weekday holiday's own window aside (that filter is a calendar-day window,
56
+ * the facts follow the trade date). The
52
57
  * shared host's venue layer (om session-facts-venues.ts) reads the same
53
58
  * windows and the golden pins them, so the browser and cloud runs of one
54
59
  * indicator agree; the kScript engine's uniform 09:30 to 16:15 table is being
@@ -66,13 +71,15 @@
66
71
  * 04:00, 09:30, 16:00 and 20:00;
67
72
  * - the forex trade date per New York (date, hour): its one boundary is the
68
73
  * whole hour 17:00;
69
- * - the CME RTH window per (window, trade date).
74
+ * - the CME RTH window once per trade date in each reader (two zone-clock
75
+ * conversions).
70
76
  * Both zones sit a whole number of hours off UTC, so a reader also keeps its
71
77
  * last answer per UTC hour (CME: the trade date and the schedule bit) or half
72
78
  * hour (equities), and a sorted walk pays the lookups once per grain, not per
73
79
  * bar. The spec walks every minute of both 2026 DST weeks against the
74
80
  * definitions themselves, so a boundary moved off those grains fails there,
75
- * not in the field, and measures 50k one-minute bars from a cold module.
81
+ * not in the field, and measures 50k one-minute bars from a cold module; the
82
+ * holiday spec walks 2026 every 15 minutes on each window shape.
76
83
  *
77
84
  * Worker-safe: imports only the chart's session utils (no Vue, store, i18n).
78
85
  */
@@ -82,9 +89,9 @@ import { cmeSessionBucketMs } from './cme-session-bucket.util.js';
82
89
  import { isCmeGoverned } from './cme-realtime.util.js';
83
90
  import { liveBucketVenueOf } from './live-bucket.util.js';
84
91
  import { getMarketKind } from './marketKind.util.js';
85
- import { zoneOffsetMsAt } from './ny-calendar.util.js';
92
+ import { zoneOffsetMsAt, zoneWallToUtcMs } from './ny-calendar.util.js';
86
93
  import { getGovernedFuturesScheduleStatusForSymbol, GOVERNED_FUTURES_TIME_ZONE, isCmeAlwaysOnSymbol, } from './market-session-schedule.util.js';
87
- import { engineRthWindowForSymbol, sessionWindowsInRange, } from './rth-session.util.js';
94
+ import { engineRthWindowForSymbol } from './rth-session.util.js';
88
95
  import { resolveUsEquitySessionPhase, US_EQUITIES_TIME_ZONE, } from './us-equities-session.util.js';
89
96
  const MINUTE_MS = 60_000;
90
97
  const HALF_HOUR_MS = 30 * MINUTE_MS;
@@ -321,30 +328,17 @@ function cmeScheduleOpen(symbol, alwaysOn, tMs) {
321
328
  }
322
329
  return open === 1;
323
330
  }
324
- const TRADE_DATE_WINDOWS_MAX = 4096;
325
- /** Each RTH window object's window per trade date (null: no window opens on that date). */
326
- const rthWindowByTradeDate = new WeakMap();
327
331
  /**
328
- * The RTH window of the CME trade date `tradeDateMs` (00:00Z label): the
329
- * calendar-day window whose open carries that trade date. Every root's window
330
- * (09:30 to 16:15 New York, 09:00 to 14:30 on NYMEX) sits inside one trade
331
- * date (the 17:00 Chicago roll is after its close), so exactly one window
332
- * qualifies.
332
+ * The RTH window of the CME trade date `tradeDateMs` (00:00Z label): the window on that date's own calendar day in
333
+ * the window's zone, the kScript engine's rule (venue-sessions `isInRthWindow`). Never the first window whose open
334
+ * books to the date: a weekday holiday's session books forward (cme-trade-calendar.util), its own calendar window
335
+ * with it, so that pick reads Thanksgiving's Thursday morning as Friday's regular session. Null outside the span the
336
+ * zone clock serves.
333
337
  */
334
338
  function rthWindowOfTradeDate(window, tradeDateMs) {
335
- let byTradeDate = rthWindowByTradeDate.get(window);
336
- if (byTradeDate === undefined) {
337
- byTradeDate = new Map();
338
- rthWindowByTradeDate.set(window, byTradeDate);
339
- }
340
- const cached = byTradeDate.get(tradeDateMs);
341
- if (cached !== undefined)
342
- return cached;
343
- const found = sessionWindowsInRange(window, tradeDateMs - DAY_MS, tradeDateMs + 2 * DAY_MS).find((candidate) => cmeSessionBucketMs(candidate.openMs, ONE_DAY_INTERVAL_MS) === tradeDateMs) ?? null;
344
- if (byTradeDate.size >= TRADE_DATE_WINDOWS_MAX)
345
- byTradeDate.clear();
346
- byTradeDate.set(tradeDateMs, found);
347
- return found;
339
+ const openMs = zoneWallToUtcMs(window.timeZone, tradeDateMs + window.openMinutes * MINUTE_MS);
340
+ const closeMs = zoneWallToUtcMs(window.timeZone, tradeDateMs + window.closeMinutes * MINUTE_MS);
341
+ return Number.isNaN(openMs) || Number.isNaN(closeMs) ? null : { openMs, closeMs };
348
342
  }
349
343
  function cmeFactsResolver(symbol) {
350
344
  const alwaysOn = isCmeAlwaysOnSymbol(symbol);
@@ -378,7 +372,7 @@ function cmeFactsResolver(symbol) {
378
372
  rth = rthWindowOfTradeDate(window, tradeDateMs);
379
373
  rthTradeDateMs = tradeDateMs;
380
374
  }
381
- // No window on the trade date is unreachable with these windows; read it like a root without one.
375
+ // Null only outside the span the zone clock serves: read it like a root without a window.
382
376
  if (rth === null || (tMs >= rth.openMs && tMs < rth.closeMs))
383
377
  return answers[WRUN_BAR_SESSION.regular];
384
378
  return answers[tMs < rth.openMs ? WRUN_BAR_SESSION.premarket : WRUN_BAR_SESSION.afterHours];