@orangecharts/wrun-chart-host 0.11.1 → 0.15.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 (319) hide show
  1. package/README.md +1 -0
  2. package/dist/constants/feature-flags.constants.d.ts +4 -4
  3. package/dist/constants/feature-flags.constants.js +38 -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 +69 -3
  13. package/dist/host-env.js +21 -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 +52 -12
  18. package/dist/indicators/controls/tpo-session.util.js +113 -16
  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 +141 -20
  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 +5 -5
  35. package/dist/market-data/venues/opra.js +3 -3
  36. package/dist/market-data/venues/stocks.contract.copy.json +6 -5
  37. package/dist/market-data/venues/stocks.d.ts +5 -5
  38. package/dist/market-data/venues/stocks.js +21 -18
  39. package/dist/settings-templates/frvp-fields.d.ts +12 -1
  40. package/dist/settings-templates/frvp-fields.js +15 -4
  41. package/dist/settings-templates/index.js +12 -5
  42. package/dist/settings-templates/indicator-fields.js +43 -2
  43. package/dist/settings-templates/tool-rules.d.ts +17 -8
  44. package/dist/settings-templates/tool-rules.js +15 -8
  45. package/dist/settings-templates/tool-tables.generated.js +4 -2
  46. package/dist/utility/auth/server-clock.util.d.ts +3 -1
  47. package/dist/utility/auth/server-clock.util.js +3 -1
  48. package/dist/utility/chart/book-live-bucket.util.js +2 -2
  49. package/dist/utility/chart/cache-alignment.util.d.ts +38 -7
  50. package/dist/utility/chart/cache-alignment.util.js +50 -13
  51. package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +2 -0
  52. package/dist/utility/chart/chart-data-fetch-generation.util.js +16 -0
  53. package/dist/utility/chart/cme-session-bucket.util.d.ts +18 -75
  54. package/dist/utility/chart/cme-session-bucket.util.js +25 -332
  55. package/dist/utility/chart/continuous-contracts.util.js +6 -5
  56. package/dist/utility/chart/display-offset.leaf.d.ts +24 -0
  57. package/dist/utility/chart/display-offset.leaf.js +41 -0
  58. package/dist/utility/chart/effective-chart-session.util.d.ts +2 -1
  59. package/dist/utility/chart/effective-chart-session.util.js +13 -5
  60. package/dist/utility/chart/feed-interval.util.d.ts +6 -20
  61. package/dist/utility/chart/feed-interval.util.js +13 -22
  62. package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +27 -7
  63. package/dist/utility/chart/fetch-dedupe-policy.util.js +86 -11
  64. package/dist/utility/chart/footprint-band.util.d.ts +21 -5
  65. package/dist/utility/chart/footprint-band.util.js +53 -14
  66. package/dist/utility/chart/host-bar-placement.util.d.ts +7 -4
  67. package/dist/utility/chart/host-bar-placement.util.js +8 -2
  68. package/dist/utility/chart/indicator-inflight-registry.util.d.ts +32 -0
  69. package/dist/utility/chart/indicator-inflight-registry.util.js +52 -0
  70. package/dist/utility/chart/indicator-run-interval.util.d.ts +10 -4
  71. package/dist/utility/chart/indicator-run-interval.util.js +21 -12
  72. package/dist/utility/chart/interval-registry.util.d.ts +1 -1
  73. package/dist/utility/chart/interval-registry.util.js +1 -1
  74. package/dist/utility/chart/kscript-legend-entries.util.d.ts +12 -0
  75. package/dist/utility/chart/kscript-legend-entries.util.js +16 -0
  76. package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +1 -1
  77. package/dist/utility/chart/kscript-run-interval-projection.util.js +4 -2
  78. package/dist/utility/chart/kscript-venue-policy.util.d.ts +53 -62
  79. package/dist/utility/chart/kscript-venue-policy.util.js +85 -94
  80. package/dist/utility/chart/live-bucket.util.d.ts +39 -17
  81. package/dist/utility/chart/live-bucket.util.js +103 -57
  82. package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +58 -20
  83. package/dist/utility/chart/local-kscript-source-revalidation.util.js +98 -23
  84. package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +35 -11
  85. package/dist/utility/chart/local-kscript-warmup-depth.util.js +24 -3
  86. package/dist/utility/chart/market-session-schedule.util.d.ts +8 -0
  87. package/dist/utility/chart/market-session-schedule.util.js +39 -1
  88. package/dist/utility/chart/market-session.util.d.ts +136 -0
  89. package/dist/utility/chart/market-session.util.js +341 -0
  90. package/dist/utility/chart/om-panel.util.d.ts +5 -3
  91. package/dist/utility/chart/om-panel.util.js +42 -7
  92. package/dist/utility/chart/om-target.util.d.ts +14 -1
  93. package/dist/utility/chart/om-target.util.js +22 -5
  94. package/dist/utility/chart/opra-read-access.leaf.d.ts +16 -1
  95. package/dist/utility/chart/opra-read-access.leaf.js +22 -0
  96. package/dist/utility/chart/profile-row-height.util.d.ts +49 -16
  97. package/dist/utility/chart/profile-row-height.util.js +74 -37
  98. package/dist/utility/chart/rth-session.util.d.ts +55 -20
  99. package/dist/utility/chart/rth-session.util.js +94 -46
  100. package/dist/utility/chart/session-lattice.util.d.ts +150 -0
  101. package/dist/utility/chart/session-lattice.util.js +488 -0
  102. package/dist/utility/chart/trading-day.util.d.ts +40 -2
  103. package/dist/utility/chart/trading-day.util.js +84 -7
  104. package/dist/utility/chart/us-equities-session.util.d.ts +32 -11
  105. package/dist/utility/chart/us-equities-session.util.js +44 -15
  106. package/dist/utility/chart/window-geometry.leaf.d.ts +28 -7
  107. package/dist/utility/chart/window-geometry.leaf.js +57 -8
  108. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +21 -14
  109. package/dist/utility/chart/wrun-bar-session-facts.util.js +32 -38
  110. package/dist/utility/chart/wrun-run-result.util.d.ts +38 -13
  111. package/dist/utility/chart/wrun-run-result.util.js +97 -27
  112. package/dist/utility/common/time.util.js +5 -4
  113. package/dist/utility/market-events/earnings-scope.util.d.ts +10 -5
  114. package/dist/utility/market-events/earnings-scope.util.js +17 -9
  115. package/dist/utility/market-events/market-events.util.d.ts +14 -7
  116. package/dist/utility/market-events/market-events.util.js +30 -17
  117. package/dist/utility/number-format.util.d.ts +14 -21
  118. package/dist/utility/number-format.util.js +38 -24
  119. package/dist/utility/options/option-venue-disclosure.util.d.ts +40 -6
  120. package/dist/utility/options/option-venue-disclosure.util.js +71 -11
  121. package/dist/utility/options/option-venue.util.d.ts +1 -1
  122. package/dist/utility/options/option-venue.util.js +1 -1
  123. package/dist/utility/pool-symbol.leaf.d.ts +7 -0
  124. package/dist/utility/pool-symbol.leaf.js +50 -5
  125. package/dist/utility/stocks/stock-display.util.d.ts +15 -0
  126. package/dist/utility/stocks/stock-display.util.js +37 -0
  127. package/dist/utility/symbol-selection/contract-expiry.util.js +5 -4
  128. package/dist/utility/v2/gate-plane.util.d.ts +6 -0
  129. package/dist/utility/v2/gate-plane.util.js +11 -1
  130. package/dist/utility/v2/gate-session-latch.util.d.ts +1 -1
  131. package/dist/utility/v2/gate-session-latch.util.js +3 -3
  132. package/dist/utility/v2/governed-tier.leaf.d.ts +17 -16
  133. package/dist/utility/v2/governed-tier.leaf.js +17 -16
  134. package/dist/utility/v2/stocks-governed.util.d.ts +5 -0
  135. package/dist/utility/v2/stocks-governed.util.js +14 -0
  136. package/dist/utility/v2/v2-enums.leaf.d.ts +13 -0
  137. package/dist/utility/v2/v2-enums.leaf.js +458 -0
  138. package/dist/utility/wrun/derived-roots.leaf.d.ts +21 -1
  139. package/dist/utility/wrun/derived-roots.leaf.js +27 -1
  140. package/dist/utility/wrun/derived-roots.util.d.ts +44 -32
  141. package/dist/utility/wrun/derived-roots.util.js +97 -56
  142. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -3
  143. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -3
  144. package/dist/utility/wrun/sources/lanes/option_daily.d.ts +2 -1
  145. package/dist/utility/wrun/sources/lanes/option_daily.js +2 -1
  146. package/dist/utility/wrun/sources/lanes/options_flow.d.ts +3 -0
  147. package/dist/utility/wrun/sources/lanes/options_flow.js +23 -5
  148. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +3 -4
  149. package/dist/utility/wrun/sources/row-lane-registry.js +9 -4
  150. package/dist/utility/wrun/sources/row-lanes/dark_pool.d.ts +19 -0
  151. package/dist/utility/wrun/sources/row-lanes/dark_pool.js +104 -0
  152. package/dist/utility/wrun/sources/row-lanes/index.js +2 -0
  153. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.d.ts +20 -0
  154. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.js +103 -0
  155. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -2
  156. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +15 -13
  157. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +49 -23
  158. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +14 -9
  159. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +75 -27
  160. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +139 -82
  161. package/dist/utility/wrun/wrun-app-layer.leaf.d.ts +78 -0
  162. package/dist/utility/wrun/wrun-app-layer.leaf.js +89 -0
  163. package/dist/utility/wrun/wrun-bar-count.util.d.ts +11 -7
  164. package/dist/utility/wrun/wrun-bar-count.util.js +12 -8
  165. package/dist/utility/wrun/wrun-batched-kinds.leaf.d.ts +13 -0
  166. package/dist/utility/wrun/wrun-batched-kinds.leaf.js +18 -0
  167. package/dist/utility/wrun/wrun-batched-marks.util.d.ts +46 -23
  168. package/dist/utility/wrun/wrun-batched-marks.util.js +260 -62
  169. package/dist/utility/wrun/wrun-batched-readout.util.d.ts +26 -19
  170. package/dist/utility/wrun/wrun-batched-readout.util.js +81 -27
  171. package/dist/utility/wrun/wrun-book-bands.leaf.d.ts +8 -0
  172. package/dist/utility/wrun/wrun-book-bands.leaf.js +7 -0
  173. package/dist/utility/wrun/wrun-candle-equal.leaf.d.ts +19 -0
  174. package/dist/utility/wrun/wrun-candle-equal.leaf.js +40 -0
  175. package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -2
  176. package/dist/utility/wrun/wrun-canvases.util.d.ts +24 -7
  177. package/dist/utility/wrun/wrun-canvases.util.js +99 -30
  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-hover.util.d.ts +8 -2
  209. package/dist/utility/wrun/wrun-hover.util.js +24 -13
  210. package/dist/utility/wrun/wrun-inert-legend.util.d.ts +13 -0
  211. package/dist/utility/wrun/wrun-inert-legend.util.js +31 -3
  212. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +7 -5
  213. package/dist/utility/wrun/wrun-input-requirements.leaf.js +16 -6
  214. package/dist/utility/wrun/wrun-install-pacer.util.d.ts +26 -0
  215. package/dist/utility/wrun/wrun-install-pacer.util.js +145 -0
  216. package/dist/utility/wrun/wrun-kit-refusal-stages.types.d.ts +22 -0
  217. package/dist/utility/wrun/wrun-kit-refusal-stages.types.js +1 -0
  218. package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +12 -5
  219. package/dist/utility/wrun/wrun-lane-refusal.leaf.js +23 -5
  220. package/dist/utility/wrun/wrun-lane-warmup.util.js +22 -4
  221. package/dist/utility/wrun/wrun-leg-close.util.d.ts +6 -5
  222. package/dist/utility/wrun/wrun-leg-close.util.js +11 -9
  223. package/dist/utility/wrun/wrun-leg-fetch.util.d.ts +3 -1
  224. package/dist/utility/wrun/wrun-leg-fetch.util.js +9 -2
  225. package/dist/utility/wrun/wrun-levels-child.util.d.ts +2 -0
  226. package/dist/utility/wrun/wrun-levels-child.util.js +6 -0
  227. package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -0
  228. package/dist/utility/wrun/wrun-live-intake.util.d.ts +15 -6
  229. package/dist/utility/wrun/wrun-live-intake.util.js +167 -47
  230. package/dist/utility/wrun/wrun-live-tick.util.d.ts +52 -8
  231. package/dist/utility/wrun/wrun-live-tick.util.js +655 -97
  232. package/dist/utility/wrun/wrun-market-facts.util.d.ts +16 -2
  233. package/dist/utility/wrun/wrun-market-facts.util.js +32 -3
  234. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +27 -27
  235. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +28 -16
  236. package/dist/utility/wrun/wrun-market-size-defaults.util.js +34 -5
  237. package/dist/utility/wrun/wrun-oi-lane.util.d.ts +10 -7
  238. package/dist/utility/wrun/wrun-oi-lane.util.js +16 -10
  239. package/dist/utility/wrun/wrun-option-strike-flow.util.js +1 -1
  240. package/dist/utility/wrun/wrun-option-views.util.d.ts +2 -2
  241. package/dist/utility/wrun/wrun-option-views.util.js +5 -2
  242. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.d.ts +5 -0
  243. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.js +16 -0
  244. package/dist/utility/wrun/wrun-options-stop.util.d.ts +3 -2
  245. package/dist/utility/wrun/wrun-options-stop.util.js +6 -4
  246. package/dist/utility/wrun/wrun-output-words.util.d.ts +14 -0
  247. package/dist/utility/wrun/wrun-output-words.util.js +51 -0
  248. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +116 -11
  249. package/dist/utility/wrun/wrun-overlay-drivers.util.js +208 -43
  250. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +20 -10
  251. package/dist/utility/wrun/wrun-overlay-park.util.d.ts +84 -0
  252. package/dist/utility/wrun/wrun-overlay-park.util.js +135 -0
  253. package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +37 -4
  254. package/dist/utility/wrun/wrun-overlay-recovery.util.js +26 -14
  255. package/dist/utility/wrun/wrun-overlay-result.util.d.ts +6 -1
  256. package/dist/utility/wrun/wrun-overlay-result.util.js +2 -0
  257. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +247 -26
  258. package/dist/utility/wrun/wrun-overlay-run.util.js +2234 -408
  259. package/dist/utility/wrun/wrun-pack.util.d.ts +8 -5
  260. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +11 -2
  261. package/dist/utility/wrun/wrun-panel-mount.util.js +122 -19
  262. package/dist/utility/wrun/wrun-panel-style.util.d.ts +4 -2
  263. package/dist/utility/wrun/wrun-panel-style.util.js +3 -2
  264. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +7 -0
  265. package/dist/utility/wrun/wrun-pin-spelling.util.js +18 -4
  266. package/dist/utility/wrun/wrun-pin-venues.util.d.ts +26 -17
  267. package/dist/utility/wrun/wrun-pin-venues.util.js +43 -36
  268. package/dist/utility/wrun/wrun-pinned-lanes.util.d.ts +58 -0
  269. package/dist/utility/wrun/wrun-pinned-lanes.util.js +72 -0
  270. package/dist/utility/wrun/wrun-prefix-cohort.util.js +2 -1
  271. package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +22 -9
  272. package/dist/utility/wrun/wrun-prefix-lanes.util.js +145 -26
  273. package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +29 -0
  274. package/dist/utility/wrun/wrun-prefix-proof.util.js +23 -5
  275. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +9 -1
  276. package/dist/utility/wrun/wrun-refusal-surface.util.js +15 -1
  277. package/dist/utility/wrun/wrun-refusal.util.d.ts +19 -1
  278. package/dist/utility/wrun/wrun-refusal.util.js +103 -16
  279. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +20 -6
  280. package/dist/utility/wrun/wrun-registry-errors.util.js +20 -6
  281. package/dist/utility/wrun/wrun-replay-rows.util.js +6 -10
  282. package/dist/utility/wrun/wrun-run-health.util.d.ts +95 -5
  283. package/dist/utility/wrun/wrun-run-health.util.js +209 -3
  284. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +2 -2
  285. package/dist/utility/wrun/wrun-run-interval-session.util.js +2 -2
  286. package/dist/utility/wrun/wrun-run-interval.util.d.ts +9 -8
  287. package/dist/utility/wrun/wrun-run-interval.util.js +13 -11
  288. package/dist/utility/wrun/wrun-sandbox-row-source.js +5 -2
  289. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +38 -11
  290. package/dist/utility/wrun/wrun-script-inputs.util.js +194 -56
  291. package/dist/utility/wrun/wrun-session-composition.util.d.ts +81 -0
  292. package/dist/utility/wrun/wrun-session-composition.util.js +169 -0
  293. package/dist/utility/wrun/wrun-setting-words.util.d.ts +10 -7
  294. package/dist/utility/wrun/wrun-setting-words.util.js +25 -7
  295. package/dist/utility/wrun/wrun-source-rows.util.d.ts +94 -28
  296. package/dist/utility/wrun/wrun-source-rows.util.js +738 -93
  297. package/dist/utility/wrun/wrun-stream-clock.util.d.ts +45 -0
  298. package/dist/utility/wrun/wrun-stream-clock.util.js +108 -0
  299. package/dist/utility/wrun/wrun-style-names.util.d.ts +23 -0
  300. package/dist/utility/wrun/wrun-style-names.util.js +74 -0
  301. package/dist/utility/wrun/wrun-tape-coins.util.d.ts +116 -0
  302. package/dist/utility/wrun/wrun-tape-coins.util.js +110 -0
  303. package/dist/utility/wrun/wrun-tape-source.util.d.ts +62 -32
  304. package/dist/utility/wrun/wrun-tape-source.util.js +72 -34
  305. package/dist/utility/wrun/wrun-tier-grid.util.d.ts +13 -5
  306. package/dist/utility/wrun/wrun-tier-grid.util.js +23 -13
  307. package/dist/utility/wrun/wrun-tpo-rows.util.js +2 -1
  308. package/dist/utility/wrun/wrun-trades-lane.util.d.ts +73 -0
  309. package/dist/utility/wrun/wrun-trades-lane.util.js +82 -0
  310. package/dist/utility/wrun/wrun-twin-compute-inputs.util.d.ts +5 -0
  311. package/dist/utility/wrun/wrun-twin-compute-inputs.util.js +9 -2
  312. package/dist/utility/wrun/wrun-visibility-table.d.ts +13 -0
  313. package/dist/utility/wrun/wrun-visibility-table.js +9 -0
  314. package/dist/utility/wrun/wrun-volume-profile.util.js +7 -3
  315. package/dist/utils/replay/replay-buffer-math.d.ts +16 -6
  316. package/dist/utils/replay/replay-buffer-math.js +60 -30
  317. package/dist/workers/constants/socket-slots.d.ts +11 -7
  318. package/dist/workers/constants/socket-slots.js +6 -5
  319. package/package.json +5 -5
@@ -40,13 +40,51 @@ export declare const US_OPTIONS_TRADING_DAY_ANCHOR: Readonly<TradingDayAnchor>;
40
40
  * 16:00, so their last quarter hour carries no rows.
41
41
  */
42
42
  export declare const US_OPTIONS_TRADING_DAY_TPO_TIME_RANGE: Readonly<TradingDayTpoTimeRange>;
43
+ /**
44
+ * Forex (FX_OTC): the trading day opens 17:00 America/New_York, read off the
45
+ * forex session lattice so the anchor and the live bar grid share one open.
46
+ * TPO has no wire projection here: the gateway's custom-time-range path takes
47
+ * a 17:00 -> 17:00 window (`detectCrossMidnight`: an end at or before the
48
+ * start is a cross-day session), but TPO is not offered on forex
49
+ * (tradfi.constants FOREX_EXCEPTION_INDICATORS), so the entry waits for it.
50
+ */
51
+ export declare const FX_TRADING_DAY_ANCHOR: Readonly<TradingDayAnchor>;
52
+ /**
53
+ * US stocks on intraday rows: the trading day opens 20:00 America/New_York,
54
+ * at the after-hours close. It is an evening open (openMinutes >= 720), so the
55
+ * day opening 20:00 on X is X+1's trading day and holds X+1's pre-market,
56
+ * regular session and after-hours. In EDT that boundary is 00:00Z, the UTC day
57
+ * exactly; in EST it is 01:00Z, so a winter evening's after-hours (19:00 to
58
+ * 20:00 New York) stays with its own day instead of opening the next one.
59
+ * Answered only through getTradingDayAnchor with a row interval below 12h
60
+ * (its doc says why). TPO has no wire projection for it
61
+ * (getTradingDayTpoTimeRange answers undefined) and passes no interval.
62
+ */
63
+ export declare const US_EQUITIES_TRADING_DAY_ANCHOR: Readonly<TradingDayAnchor>;
43
64
  export declare function isTradingDayAnchor(value: unknown): value is TradingDayAnchor;
44
65
  /**
45
66
  * The trading-day anchor for a symbol's exchange, or undefined for venues
46
67
  * that keep the legacy UTC-midnight day (all of crypto). This is the single
47
- * venue gate both TPO and the session volume profile consume.
68
+ * venue gate both TPO and the session volume profile consume. The CME family
69
+ * answers first by its governed set (the GLOBEX alias included), OPRA by its
70
+ * gate, and every venue the gateway rolls up on a session lattice (forex)
71
+ * answers the lattice's own open, so a venue added to the lattice table
72
+ * gains its anchor here without a new branch.
73
+ *
74
+ * A US stock (market-session.util `isUsEquityMarket`) answers
75
+ * US_EQUITIES_TRADING_DAY_ANCHOR only to a caller that passes its ROW
76
+ * interval, `rowIntervalMs`, finite and strictly between 0 and 12h:
77
+ * - A daily or longer row is a date label at 00:00Z, not an instant (in EST,
78
+ * 00:00Z Monday is 19:00 Sunday New York), so it keeps its UTC date.
79
+ * - A 12h row keeps the UTC date too: in EST the 12h UTC bucket starting
80
+ * 00:00Z spans 19:00 to 07:00 New York, one day's after-hours and the next
81
+ * day's pre-market, which no anchor can split. Every row from 1m to 8h sits
82
+ * inside one trading day under the 20:00 New York boundary.
83
+ * A caller that passes no interval (TPO, DOM, reference lines, session
84
+ * breaks, tape mode, the titan chart-level anchor, calendar weeks and months)
85
+ * keeps the UTC day on stocks, as before.
48
86
  */
49
- export declare function getTradingDayAnchor(exchange: string | undefined | null): TradingDayAnchor | undefined;
87
+ export declare function getTradingDayAnchor(exchange: string | undefined | null, rowIntervalMs?: number): TradingDayAnchor | undefined;
50
88
  export declare function tradingDayStartMs(tsMs: number, anchor: TradingDayAnchor): number;
51
89
  export type TradingDayPeriod = 'Session' | 'Week' | 'Month' | 'Year';
52
90
  /**
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Trading-day anchoring for session venues (the CME family and the OPRA
3
- * options plane).
2
+ * Trading-day anchoring for session venues (the CME family, forex, the OPRA
3
+ * options plane, and US stocks on intraday rows).
4
4
  *
5
5
  * The FE owns all venue knowledge: titan-charts stays venue-agnostic and only
6
6
  * consumes the generic `tradingDayAnchor` descriptor this module produces
@@ -9,10 +9,18 @@
9
9
  * 17:00 America/Chicago
10
10
  * the prior evening, halts 16:00-17:00, so the "day" of Monday runs Sunday
11
11
  * 17:00 CT through Monday 16:00 CT; DST moves the UTC edge (22:00 UTC in
12
- * summer, 23:00 UTC in winter) and Sunday evening belongs to Monday. US
12
+ * summer, 23:00 UTC in winter) and Sunday evening belongs to Monday. Forex
13
+ * (FX_OTC) trades the 17:00 America/New_York day TradingView and MT4 cut on
14
+ * (21:00 UTC in summer, 22:00 UTC in winter), Sunday evening belongs to
15
+ * Monday, and tsdb-gateway serves its daily and weekly bars on it (!2483):
16
+ * the anchor is read off the forex session lattice (session-lattice.util),
17
+ * the same table the live writers key the forming bar with, so the dividers,
18
+ * the VWAP sessions and the daily bars can never roll on different days. US
13
19
  * equity and index options (OPRA) trade one session a day that opens 09:30
14
20
  * America/New_York (us-options-session.util), so their day is labeled by its
15
- * own calendar date.
21
+ * own calendar date. US stocks trade 04:00 to 20:00 America/New_York, so on
22
+ * intraday rows their day opens at the 20:00 after-hours close
23
+ * (US_EQUITIES_TRADING_DAY_ANCHOR, read only with a row interval).
16
24
  *
17
25
  * Consumers of the SAME anchor:
18
26
  * - Session volume profile passes it straight to titan, whose daily session
@@ -33,6 +41,8 @@ import dayjs from 'dayjs';
33
41
  import timezone from 'dayjs/plugin/timezone.js';
34
42
  import utc from 'dayjs/plugin/utc.js';
35
43
  import { isCmeGoverned } from './cme-realtime.util.js';
44
+ import { isUsEquityMarket } from './market-session.util.js';
45
+ import { FOREX_SESSION_LATTICE, sessionLatticeOf } from './session-lattice.util.js';
36
46
  import { isOpraGoverned } from '../v2/opra-governed.util.js';
37
47
  dayjs.extend(utc);
38
48
  dayjs.extend(timezone);
@@ -75,6 +85,51 @@ export const US_OPTIONS_TRADING_DAY_TPO_TIME_RANGE = Object.freeze({
75
85
  end_time: '16:15',
76
86
  timezone: 'America/New_York',
77
87
  });
88
+ /**
89
+ * Forex (FX_OTC): the trading day opens 17:00 America/New_York, read off the
90
+ * forex session lattice so the anchor and the live bar grid share one open.
91
+ * TPO has no wire projection here: the gateway's custom-time-range path takes
92
+ * a 17:00 -> 17:00 window (`detectCrossMidnight`: an end at or before the
93
+ * start is a cross-day session), but TPO is not offered on forex
94
+ * (tradfi.constants FOREX_EXCEPTION_INDICATORS), so the entry waits for it.
95
+ */
96
+ export const FX_TRADING_DAY_ANCHOR = Object.freeze({
97
+ timeZone: FOREX_SESSION_LATTICE.timeZone,
98
+ openMinutes: FOREX_SESSION_LATTICE.openHour * 60,
99
+ });
100
+ /**
101
+ * US stocks on intraday rows: the trading day opens 20:00 America/New_York,
102
+ * at the after-hours close. It is an evening open (openMinutes >= 720), so the
103
+ * day opening 20:00 on X is X+1's trading day and holds X+1's pre-market,
104
+ * regular session and after-hours. In EDT that boundary is 00:00Z, the UTC day
105
+ * exactly; in EST it is 01:00Z, so a winter evening's after-hours (19:00 to
106
+ * 20:00 New York) stays with its own day instead of opening the next one.
107
+ * Answered only through getTradingDayAnchor with a row interval below 12h
108
+ * (its doc says why). TPO has no wire projection for it
109
+ * (getTradingDayTpoTimeRange answers undefined) and passes no interval.
110
+ */
111
+ export const US_EQUITIES_TRADING_DAY_ANCHOR = Object.freeze({
112
+ timeZone: 'America/New_York',
113
+ openMinutes: 20 * 60,
114
+ });
115
+ /** A stock row strictly shorter than this takes the stock anchor; 12h and longer keep the UTC date. */
116
+ const US_EQUITIES_ANCHOR_ROW_CEILING_MS = 12 * 60 * 60 * 1000;
117
+ function isUsEquitiesAnchorRowInterval(rowIntervalMs) {
118
+ return (typeof rowIntervalMs === 'number' &&
119
+ Number.isFinite(rowIntervalMs) &&
120
+ rowIntervalMs > 0 &&
121
+ rowIntervalMs < US_EQUITIES_ANCHOR_ROW_CEILING_MS);
122
+ }
123
+ /** The anchor of a session lattice: the lattice's zone and open hour (session-lattice.util). */
124
+ function sessionLatticeTradingDayAnchor(lattice) {
125
+ if (lattice === FOREX_SESSION_LATTICE)
126
+ return FX_TRADING_DAY_ANCHOR;
127
+ if (lattice.timeZone === CME_TRADING_DAY_ANCHOR.timeZone &&
128
+ lattice.openHour * 60 === CME_TRADING_DAY_ANCHOR.openMinutes) {
129
+ return CME_TRADING_DAY_ANCHOR;
130
+ }
131
+ return Object.freeze({ timeZone: lattice.timeZone, openMinutes: lattice.openHour * 60 });
132
+ }
78
133
  export function isTradingDayAnchor(value) {
79
134
  if (!value || typeof value !== 'object')
80
135
  return false;
@@ -89,14 +144,36 @@ export function isTradingDayAnchor(value) {
89
144
  /**
90
145
  * The trading-day anchor for a symbol's exchange, or undefined for venues
91
146
  * that keep the legacy UTC-midnight day (all of crypto). This is the single
92
- * venue gate both TPO and the session volume profile consume.
147
+ * venue gate both TPO and the session volume profile consume. The CME family
148
+ * answers first by its governed set (the GLOBEX alias included), OPRA by its
149
+ * gate, and every venue the gateway rolls up on a session lattice (forex)
150
+ * answers the lattice's own open, so a venue added to the lattice table
151
+ * gains its anchor here without a new branch.
152
+ *
153
+ * A US stock (market-session.util `isUsEquityMarket`) answers
154
+ * US_EQUITIES_TRADING_DAY_ANCHOR only to a caller that passes its ROW
155
+ * interval, `rowIntervalMs`, finite and strictly between 0 and 12h:
156
+ * - A daily or longer row is a date label at 00:00Z, not an instant (in EST,
157
+ * 00:00Z Monday is 19:00 Sunday New York), so it keeps its UTC date.
158
+ * - A 12h row keeps the UTC date too: in EST the 12h UTC bucket starting
159
+ * 00:00Z spans 19:00 to 07:00 New York, one day's after-hours and the next
160
+ * day's pre-market, which no anchor can split. Every row from 1m to 8h sits
161
+ * inside one trading day under the 20:00 New York boundary.
162
+ * A caller that passes no interval (TPO, DOM, reference lines, session
163
+ * breaks, tape mode, the titan chart-level anchor, calendar weeks and months)
164
+ * keeps the UTC day on stocks, as before.
93
165
  */
94
- export function getTradingDayAnchor(exchange) {
166
+ export function getTradingDayAnchor(exchange, rowIntervalMs) {
95
167
  if (isCmeGoverned(exchange))
96
168
  return CME_TRADING_DAY_ANCHOR;
97
169
  if (isOpraGoverned(exchange))
98
170
  return US_OPTIONS_TRADING_DAY_ANCHOR;
99
- return undefined;
171
+ const lattice = sessionLatticeOf(exchange);
172
+ if (lattice !== null)
173
+ return sessionLatticeTradingDayAnchor(lattice);
174
+ return isUsEquitiesAnchorRowInterval(rowIntervalMs) && isUsEquityMarket(exchange)
175
+ ? US_EQUITIES_TRADING_DAY_ANCHOR
176
+ : undefined;
100
177
  }
101
178
  /** One wall-clock reader per zone (titan src/utils/tradingDay.ts's formatter); null for a zone Intl rejects. */
102
179
  const wallClockFormatters = new Map();
@@ -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
  */