@orangecharts/wrun-chart-host 0.11.1 → 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 (307) 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 +17 -0
  16. package/dist/index.js +18 -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 +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/om-panel.util.d.ts +5 -3
  88. package/dist/utility/chart/om-panel.util.js +42 -7
  89. package/dist/utility/chart/om-target.util.d.ts +14 -1
  90. package/dist/utility/chart/om-target.util.js +22 -5
  91. package/dist/utility/chart/opra-read-access.leaf.d.ts +16 -1
  92. package/dist/utility/chart/opra-read-access.leaf.js +22 -0
  93. package/dist/utility/chart/profile-row-height.util.d.ts +49 -16
  94. package/dist/utility/chart/profile-row-height.util.js +74 -37
  95. package/dist/utility/chart/rth-session.util.d.ts +55 -20
  96. package/dist/utility/chart/rth-session.util.js +94 -46
  97. package/dist/utility/chart/session-lattice.util.d.ts +150 -0
  98. package/dist/utility/chart/session-lattice.util.js +488 -0
  99. package/dist/utility/chart/trading-day.util.d.ts +40 -2
  100. package/dist/utility/chart/trading-day.util.js +84 -7
  101. package/dist/utility/chart/us-equities-session.util.d.ts +32 -11
  102. package/dist/utility/chart/us-equities-session.util.js +44 -15
  103. package/dist/utility/chart/window-geometry.leaf.d.ts +28 -7
  104. package/dist/utility/chart/window-geometry.leaf.js +57 -8
  105. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +21 -14
  106. package/dist/utility/chart/wrun-bar-session-facts.util.js +32 -38
  107. package/dist/utility/chart/wrun-run-result.util.d.ts +29 -12
  108. package/dist/utility/chart/wrun-run-result.util.js +89 -25
  109. package/dist/utility/common/time.util.js +5 -4
  110. package/dist/utility/market-events/earnings-scope.util.d.ts +10 -5
  111. package/dist/utility/market-events/earnings-scope.util.js +17 -9
  112. package/dist/utility/market-events/market-events.util.d.ts +14 -7
  113. package/dist/utility/market-events/market-events.util.js +30 -17
  114. package/dist/utility/number-format.util.d.ts +14 -21
  115. package/dist/utility/number-format.util.js +38 -24
  116. package/dist/utility/options/option-venue-disclosure.util.d.ts +40 -6
  117. package/dist/utility/options/option-venue-disclosure.util.js +71 -11
  118. package/dist/utility/options/option-venue.util.d.ts +1 -1
  119. package/dist/utility/options/option-venue.util.js +1 -1
  120. package/dist/utility/pool-symbol.leaf.d.ts +7 -0
  121. package/dist/utility/pool-symbol.leaf.js +50 -5
  122. package/dist/utility/stocks/stock-display.util.d.ts +15 -0
  123. package/dist/utility/stocks/stock-display.util.js +37 -0
  124. package/dist/utility/symbol-selection/contract-expiry.util.js +5 -4
  125. package/dist/utility/v2/gate-plane.util.d.ts +6 -0
  126. package/dist/utility/v2/gate-plane.util.js +11 -1
  127. package/dist/utility/v2/gate-session-latch.util.d.ts +1 -1
  128. package/dist/utility/v2/gate-session-latch.util.js +3 -3
  129. package/dist/utility/v2/governed-tier.leaf.d.ts +17 -16
  130. package/dist/utility/v2/governed-tier.leaf.js +17 -16
  131. package/dist/utility/v2/stocks-governed.util.d.ts +5 -0
  132. package/dist/utility/v2/stocks-governed.util.js +14 -0
  133. package/dist/utility/v2/v2-enums.leaf.d.ts +13 -0
  134. package/dist/utility/v2/v2-enums.leaf.js +458 -0
  135. package/dist/utility/wrun/derived-roots.leaf.d.ts +21 -1
  136. package/dist/utility/wrun/derived-roots.leaf.js +27 -1
  137. package/dist/utility/wrun/derived-roots.util.d.ts +44 -32
  138. package/dist/utility/wrun/derived-roots.util.js +97 -56
  139. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -3
  140. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -3
  141. package/dist/utility/wrun/sources/lanes/option_daily.d.ts +2 -1
  142. package/dist/utility/wrun/sources/lanes/option_daily.js +2 -1
  143. package/dist/utility/wrun/sources/lanes/options_flow.d.ts +3 -0
  144. package/dist/utility/wrun/sources/lanes/options_flow.js +23 -5
  145. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +3 -4
  146. package/dist/utility/wrun/sources/row-lane-registry.js +9 -4
  147. package/dist/utility/wrun/sources/row-lanes/dark_pool.d.ts +19 -0
  148. package/dist/utility/wrun/sources/row-lanes/dark_pool.js +104 -0
  149. package/dist/utility/wrun/sources/row-lanes/index.js +2 -0
  150. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.d.ts +20 -0
  151. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.js +103 -0
  152. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -2
  153. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +15 -13
  154. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +49 -23
  155. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +14 -9
  156. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +75 -27
  157. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +139 -82
  158. package/dist/utility/wrun/wrun-app-layer.leaf.d.ts +78 -0
  159. package/dist/utility/wrun/wrun-app-layer.leaf.js +89 -0
  160. package/dist/utility/wrun/wrun-bar-count.util.d.ts +11 -7
  161. package/dist/utility/wrun/wrun-bar-count.util.js +12 -8
  162. package/dist/utility/wrun/wrun-batched-kinds.leaf.d.ts +13 -0
  163. package/dist/utility/wrun/wrun-batched-kinds.leaf.js +18 -0
  164. package/dist/utility/wrun/wrun-batched-marks.util.d.ts +41 -22
  165. package/dist/utility/wrun/wrun-batched-marks.util.js +255 -59
  166. package/dist/utility/wrun/wrun-batched-readout.util.d.ts +26 -19
  167. package/dist/utility/wrun/wrun-batched-readout.util.js +81 -27
  168. package/dist/utility/wrun/wrun-book-bands.leaf.d.ts +8 -0
  169. package/dist/utility/wrun/wrun-book-bands.leaf.js +7 -0
  170. package/dist/utility/wrun/wrun-candle-equal.leaf.d.ts +19 -0
  171. package/dist/utility/wrun/wrun-candle-equal.leaf.js +40 -0
  172. package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -2
  173. package/dist/utility/wrun/wrun-canvases.util.js +7 -3
  174. package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +6 -3
  175. package/dist/utility/wrun/wrun-chart-context-names.util.js +8 -4
  176. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +47 -29
  177. package/dist/utility/wrun/wrun-chart-market-facts.util.js +201 -201
  178. package/dist/utility/wrun/wrun-child-overlay-id.util.js +2 -1
  179. package/dist/utility/wrun/wrun-cme-legs-note.util.d.ts +15 -0
  180. package/dist/utility/wrun/wrun-cme-legs-note.util.js +49 -0
  181. package/dist/utility/wrun/wrun-cme-root-specs.util.d.ts +38 -0
  182. package/dist/utility/wrun/wrun-cme-root-specs.util.js +81 -0
  183. package/dist/utility/wrun/wrun-coin-lane-live.util.js +3 -0
  184. package/dist/utility/wrun/wrun-color-settings.util.d.ts +6 -1
  185. package/dist/utility/wrun/wrun-color-settings.util.js +32 -7
  186. package/dist/utility/wrun/wrun-dark-pool.util.d.ts +50 -0
  187. package/dist/utility/wrun/wrun-dark-pool.util.js +127 -0
  188. package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +67 -12
  189. package/dist/utility/wrun/wrun-declared-warmup.util.js +165 -13
  190. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +18 -8
  191. package/dist/utility/wrun/wrun-draft-legend-note.util.js +57 -11
  192. package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +14 -10
  193. package/dist/utility/wrun/wrun-draft-overlay.util.js +26 -14
  194. package/dist/utility/wrun/wrun-earnings-facts.util.js +3 -2
  195. package/dist/utility/wrun/wrun-etf-funds.util.d.ts +2 -0
  196. package/dist/utility/wrun/wrun-etf-funds.util.js +4 -0
  197. package/dist/utility/wrun/wrun-held-lanes.util.js +8 -2
  198. package/dist/utility/wrun/wrun-history-as-of.util.d.ts +77 -0
  199. package/dist/utility/wrun/wrun-history-as-of.util.js +108 -0
  200. package/dist/utility/wrun/wrun-host.service.d.ts +64 -14
  201. package/dist/utility/wrun/wrun-host.service.js +137 -27
  202. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +3 -3
  203. package/dist/utility/wrun/wrun-hosted-wire-caps.js +12 -2
  204. package/dist/utility/wrun/wrun-inert-legend.util.d.ts +13 -0
  205. package/dist/utility/wrun/wrun-inert-legend.util.js +31 -3
  206. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +7 -5
  207. package/dist/utility/wrun/wrun-input-requirements.leaf.js +16 -6
  208. package/dist/utility/wrun/wrun-install-pacer.util.d.ts +26 -0
  209. package/dist/utility/wrun/wrun-install-pacer.util.js +145 -0
  210. package/dist/utility/wrun/wrun-kit-refusal-stages.types.d.ts +22 -0
  211. package/dist/utility/wrun/wrun-kit-refusal-stages.types.js +1 -0
  212. package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +12 -5
  213. package/dist/utility/wrun/wrun-lane-refusal.leaf.js +23 -5
  214. package/dist/utility/wrun/wrun-lane-warmup.util.js +22 -4
  215. package/dist/utility/wrun/wrun-leg-close.util.d.ts +6 -5
  216. package/dist/utility/wrun/wrun-leg-close.util.js +11 -9
  217. package/dist/utility/wrun/wrun-leg-fetch.util.d.ts +3 -1
  218. package/dist/utility/wrun/wrun-leg-fetch.util.js +9 -2
  219. package/dist/utility/wrun/wrun-levels-child.util.d.ts +2 -0
  220. package/dist/utility/wrun/wrun-levels-child.util.js +6 -0
  221. package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -0
  222. package/dist/utility/wrun/wrun-live-intake.util.d.ts +15 -6
  223. package/dist/utility/wrun/wrun-live-intake.util.js +167 -47
  224. package/dist/utility/wrun/wrun-live-tick.util.d.ts +52 -8
  225. package/dist/utility/wrun/wrun-live-tick.util.js +648 -97
  226. package/dist/utility/wrun/wrun-market-facts.util.d.ts +16 -2
  227. package/dist/utility/wrun/wrun-market-facts.util.js +32 -3
  228. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +27 -27
  229. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +28 -16
  230. package/dist/utility/wrun/wrun-market-size-defaults.util.js +34 -5
  231. package/dist/utility/wrun/wrun-oi-lane.util.d.ts +10 -7
  232. package/dist/utility/wrun/wrun-oi-lane.util.js +16 -10
  233. package/dist/utility/wrun/wrun-option-strike-flow.util.js +1 -1
  234. package/dist/utility/wrun/wrun-option-views.util.d.ts +2 -2
  235. package/dist/utility/wrun/wrun-option-views.util.js +5 -2
  236. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.d.ts +5 -0
  237. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.js +16 -0
  238. package/dist/utility/wrun/wrun-options-stop.util.d.ts +3 -2
  239. package/dist/utility/wrun/wrun-options-stop.util.js +6 -4
  240. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +75 -11
  241. package/dist/utility/wrun/wrun-overlay-drivers.util.js +176 -43
  242. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +20 -10
  243. package/dist/utility/wrun/wrun-overlay-park.util.d.ts +84 -0
  244. package/dist/utility/wrun/wrun-overlay-park.util.js +135 -0
  245. package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +37 -4
  246. package/dist/utility/wrun/wrun-overlay-recovery.util.js +26 -14
  247. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +239 -24
  248. package/dist/utility/wrun/wrun-overlay-run.util.js +2204 -405
  249. package/dist/utility/wrun/wrun-pack.util.d.ts +8 -5
  250. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +2 -1
  251. package/dist/utility/wrun/wrun-panel-mount.util.js +20 -14
  252. package/dist/utility/wrun/wrun-panel-style.util.d.ts +4 -2
  253. package/dist/utility/wrun/wrun-panel-style.util.js +3 -2
  254. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +7 -0
  255. package/dist/utility/wrun/wrun-pin-spelling.util.js +18 -4
  256. package/dist/utility/wrun/wrun-pin-venues.util.d.ts +26 -17
  257. package/dist/utility/wrun/wrun-pin-venues.util.js +43 -36
  258. package/dist/utility/wrun/wrun-pinned-lanes.util.d.ts +58 -0
  259. package/dist/utility/wrun/wrun-pinned-lanes.util.js +72 -0
  260. package/dist/utility/wrun/wrun-prefix-cohort.util.js +2 -1
  261. package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +22 -9
  262. package/dist/utility/wrun/wrun-prefix-lanes.util.js +145 -26
  263. package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +29 -0
  264. package/dist/utility/wrun/wrun-prefix-proof.util.js +23 -5
  265. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +9 -1
  266. package/dist/utility/wrun/wrun-refusal-surface.util.js +15 -1
  267. package/dist/utility/wrun/wrun-refusal.util.d.ts +19 -1
  268. package/dist/utility/wrun/wrun-refusal.util.js +103 -16
  269. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +20 -6
  270. package/dist/utility/wrun/wrun-registry-errors.util.js +20 -6
  271. package/dist/utility/wrun/wrun-replay-rows.util.js +6 -10
  272. package/dist/utility/wrun/wrun-run-health.util.d.ts +89 -2
  273. package/dist/utility/wrun/wrun-run-health.util.js +204 -1
  274. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +2 -2
  275. package/dist/utility/wrun/wrun-run-interval-session.util.js +2 -2
  276. package/dist/utility/wrun/wrun-run-interval.util.d.ts +9 -8
  277. package/dist/utility/wrun/wrun-run-interval.util.js +13 -11
  278. package/dist/utility/wrun/wrun-sandbox-row-source.js +5 -2
  279. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +13 -3
  280. package/dist/utility/wrun/wrun-script-inputs.util.js +51 -13
  281. package/dist/utility/wrun/wrun-session-composition.util.d.ts +81 -0
  282. package/dist/utility/wrun/wrun-session-composition.util.js +169 -0
  283. package/dist/utility/wrun/wrun-setting-words.util.d.ts +10 -7
  284. package/dist/utility/wrun/wrun-setting-words.util.js +25 -7
  285. package/dist/utility/wrun/wrun-source-rows.util.d.ts +94 -28
  286. package/dist/utility/wrun/wrun-source-rows.util.js +738 -93
  287. package/dist/utility/wrun/wrun-stream-clock.util.d.ts +45 -0
  288. package/dist/utility/wrun/wrun-stream-clock.util.js +108 -0
  289. package/dist/utility/wrun/wrun-tape-coins.util.d.ts +116 -0
  290. package/dist/utility/wrun/wrun-tape-coins.util.js +110 -0
  291. package/dist/utility/wrun/wrun-tape-source.util.d.ts +62 -32
  292. package/dist/utility/wrun/wrun-tape-source.util.js +72 -34
  293. package/dist/utility/wrun/wrun-tier-grid.util.d.ts +13 -5
  294. package/dist/utility/wrun/wrun-tier-grid.util.js +23 -13
  295. package/dist/utility/wrun/wrun-tpo-rows.util.js +2 -1
  296. package/dist/utility/wrun/wrun-trades-lane.util.d.ts +73 -0
  297. package/dist/utility/wrun/wrun-trades-lane.util.js +82 -0
  298. package/dist/utility/wrun/wrun-twin-compute-inputs.util.d.ts +5 -0
  299. package/dist/utility/wrun/wrun-twin-compute-inputs.util.js +9 -2
  300. package/dist/utility/wrun/wrun-visibility-table.d.ts +13 -0
  301. package/dist/utility/wrun/wrun-visibility-table.js +9 -0
  302. package/dist/utility/wrun/wrun-volume-profile.util.js +7 -3
  303. package/dist/utils/replay/replay-buffer-math.d.ts +16 -6
  304. package/dist/utils/replay/replay-buffer-math.js +60 -30
  305. package/dist/workers/constants/socket-slots.d.ts +11 -7
  306. package/dist/workers/constants/socket-slots.js +6 -5
  307. package/package.json +5 -5
@@ -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];
@@ -22,9 +22,10 @@
22
22
  * draws. Data-only outputs (sheet plot "", the wrun ABI's
23
23
  * color_by/width_by index sources) never mount, and neither do fully
24
24
  * transparent ones (opacity 0 with no color ladder, a range's edge
25
- * helper). Every mounted output, range and fill pair carries `labels`:
26
- * each output's declared `label`, else its name in words
27
- * (`wrunLegendName`, wrun-legend-name.util: `odds_by_price` -> "Odds by
25
+ * helper), except a fill side, which mounts as a stroke that paints
26
+ * nothing and answers no hover card. Every mounted output, range and fill
27
+ * pair carries `labels`: each output's declared `label`, else its name in
28
+ * words (`wrunLegendName`, wrun-legend-name.util: `odds_by_price` -> "Odds by
28
29
  * price", `gex_curve` -> "GEX curve"), the column the kScript engine fills
29
30
  * from plot(label=...) and the legend, the alert pickers and the
30
31
  * price-axis menu read, never the numbered "Plot N" fallback. The lower
@@ -488,17 +489,27 @@
488
489
  * each legend line in mount order instead of the control's amber
489
490
  * fallback. A malformed `legend_palette` refuses every run by name.
490
491
  * - Typed-inputs presentation keys (WRUN-INPUTS-PLAN 1.3, 1.4), all
491
- * optional, a sheet without them byte-identical:
492
+ * optional, a sheet without them byte-identical (but for the no-ink
493
+ * `hover_card: false` below):
492
494
  * - an output's `format` (one of the frozen words, wrun-pane-format.util)
493
495
  * rides the mounted output as `format`, an FE-only field the legend
494
496
  * reads off the run output (kScriptLegendLineFormat) to print that line;
495
497
  * `legend: false` rides as the `legend: false` kScriptLegendLines reads
496
498
  * (drawn all the same, never a legend line, nor in the derived palette);
497
- * `glow` (px, a line output) is the engine's plotOutput.glow and
498
- * `corner` (px, a bar output) the histogram corner radius the engine
499
- * lights on its next pin. A malformed key, `glow` off a line or `corner`
500
- * off a bar refuses by name; `visible` is validated here and applied
501
- * after integration (applyWrunOutputVisibility).
499
+ * `hover_card: false` rides as the `hover_card: false` the hover
500
+ * surfaces read (optsOutOfHover: drawn, listed and printed all the same,
501
+ * never a hover card, over the plot or the legend value); `glow` (px, a
502
+ * line output) is the engine's plotOutput.glow and `corner` (px, a bar
503
+ * output) the histogram corner radius the engine lights on its next pin.
504
+ * A malformed key, `glow` off a line or `corner` off a bar refuses by
505
+ * name; `visible` is validated here and applied after integration
506
+ * (applyWrunOutputVisibility). Every mount takes these words from one
507
+ * helper (wrunMountPresentationFields; a candle group from its four
508
+ * members), which also stamps `hover_card: false` on a mount that paints
509
+ * no ink (no ink, no card): a transparent fill side, any drawn output at
510
+ * opacity 0 (every colour it draws fades to nothing, OT30: a laddered
511
+ * line or mark, a bar sign palette), a candle group whose first output
512
+ * is at opacity 0.
502
513
  * - `legend_title` (top level, the kit's legend({ title })) is the legend
503
514
  * suffix with `{{param}}` placeholders, resolved against the run's param
504
515
  * values (a select as its label, a toggle as true / false) and emitted as
@@ -517,7 +528,10 @@
517
528
  * - `presentation` (legend entries, HUD cards) and an output's `hover`,
518
529
  * `tooltip`, `hint` and `badges` never reach the run result: the legend,
519
530
  * the HUD and the hover card read them off the sheet
520
- * (wrun-legend-hover, wrun-hover.util).
531
+ * (wrun-legend-hover, wrun-hover.util). Whether a mounted plot answers a
532
+ * card at all is the run output's `hover_card` (above), never the
533
+ * sheet's: the readers walk mounted plots, and only the mount knows
534
+ * whether it paints ink.
521
535
  * - WRUN-STYLE (FREEZE.md 3.5.4): this file is wiring only. The look of
522
536
  * every surface lives with its area util and reaches the result through
523
537
  * frozen seams: outputs through `wrunOutputLookPatch` and the guide,
@@ -834,6 +848,9 @@ export interface WrunRunResult {
834
848
  * `visible` is an output's own kit key). The sheet itself when no declaration carries the key.
835
849
  */
836
850
  export declare function wrunSelectionSheet(metadata: WrunIndicatorMetadata): WrunIndicatorMetadata;
851
+ /** The value bytes the build of `result` charged its render budget (wrunResultRenderBytes); undefined for a result
852
+ * this builder did not make (a refusal's empty result, a copy). */
853
+ export declare function wrunRunResultRenderBytes(result: WrunRunResult): number | undefined;
837
854
  export declare function buildWrunRunResult(options: WrunRunResultOptions): WrunRunResult;
838
855
  /** A run result's author-facing notices (every canvas child's, in child
839
856
  * order; a fresh array, empty when there are none). A run seam publishes
@@ -854,8 +871,8 @@ export declare function resolveWrunLegendTitle(template: string, params: Readonl
854
871
  * legend line i paints (titan's legend text colour, alpha stripped, so the
855
872
  * chip reads opaque like a kScript colour input). The lines are the
856
873
  * outputs the adapter mounts, in mount order, that the legend lists
857
- * (kScriptLegendLines: value plots, never a guide, mark, candle,
858
- * background, data-only output or a `legend: false` range). A result with
874
+ * (kScriptLegendLines: value plots and candle groups, never a guide, mark,
875
+ * background, data-only output or a `legend: false` output or range). A result with
859
876
  * no legend line gets the first visible colour it draws (its outputs, then
860
877
  * `renderers`, the sheet's declarations). Empty when nothing draws a
861
878
  * colour (the control's amber fallback). The lower pane (the `series`
@@ -22,9 +22,10 @@
22
22
  * draws. Data-only outputs (sheet plot "", the wrun ABI's
23
23
  * color_by/width_by index sources) never mount, and neither do fully
24
24
  * transparent ones (opacity 0 with no color ladder, a range's edge
25
- * helper). Every mounted output, range and fill pair carries `labels`:
26
- * each output's declared `label`, else its name in words
27
- * (`wrunLegendName`, wrun-legend-name.util: `odds_by_price` -> "Odds by
25
+ * helper), except a fill side, which mounts as a stroke that paints
26
+ * nothing and answers no hover card. Every mounted output, range and fill
27
+ * pair carries `labels`: each output's declared `label`, else its name in
28
+ * words (`wrunLegendName`, wrun-legend-name.util: `odds_by_price` -> "Odds by
28
29
  * price", `gex_curve` -> "GEX curve"), the column the kScript engine fills
29
30
  * from plot(label=...) and the legend, the alert pickers and the
30
31
  * price-axis menu read, never the numbered "Plot N" fallback. The lower
@@ -488,17 +489,27 @@
488
489
  * each legend line in mount order instead of the control's amber
489
490
  * fallback. A malformed `legend_palette` refuses every run by name.
490
491
  * - Typed-inputs presentation keys (WRUN-INPUTS-PLAN 1.3, 1.4), all
491
- * optional, a sheet without them byte-identical:
492
+ * optional, a sheet without them byte-identical (but for the no-ink
493
+ * `hover_card: false` below):
492
494
  * - an output's `format` (one of the frozen words, wrun-pane-format.util)
493
495
  * rides the mounted output as `format`, an FE-only field the legend
494
496
  * reads off the run output (kScriptLegendLineFormat) to print that line;
495
497
  * `legend: false` rides as the `legend: false` kScriptLegendLines reads
496
498
  * (drawn all the same, never a legend line, nor in the derived palette);
497
- * `glow` (px, a line output) is the engine's plotOutput.glow and
498
- * `corner` (px, a bar output) the histogram corner radius the engine
499
- * lights on its next pin. A malformed key, `glow` off a line or `corner`
500
- * off a bar refuses by name; `visible` is validated here and applied
501
- * after integration (applyWrunOutputVisibility).
499
+ * `hover_card: false` rides as the `hover_card: false` the hover
500
+ * surfaces read (optsOutOfHover: drawn, listed and printed all the same,
501
+ * never a hover card, over the plot or the legend value); `glow` (px, a
502
+ * line output) is the engine's plotOutput.glow and `corner` (px, a bar
503
+ * output) the histogram corner radius the engine lights on its next pin.
504
+ * A malformed key, `glow` off a line or `corner` off a bar refuses by
505
+ * name; `visible` is validated here and applied after integration
506
+ * (applyWrunOutputVisibility). Every mount takes these words from one
507
+ * helper (wrunMountPresentationFields; a candle group from its four
508
+ * members), which also stamps `hover_card: false` on a mount that paints
509
+ * no ink (no ink, no card): a transparent fill side, any drawn output at
510
+ * opacity 0 (every colour it draws fades to nothing, OT30: a laddered
511
+ * line or mark, a bar sign palette), a candle group whose first output
512
+ * is at opacity 0.
502
513
  * - `legend_title` (top level, the kit's legend({ title })) is the legend
503
514
  * suffix with `{{param}}` placeholders, resolved against the run's param
504
515
  * values (a select as its label, a toggle as true / false) and emitted as
@@ -517,7 +528,10 @@
517
528
  * - `presentation` (legend entries, HUD cards) and an output's `hover`,
518
529
  * `tooltip`, `hint` and `badges` never reach the run result: the legend,
519
530
  * the HUD and the hover card read them off the sheet
520
- * (wrun-legend-hover, wrun-hover.util).
531
+ * (wrun-legend-hover, wrun-hover.util). Whether a mounted plot answers a
532
+ * card at all is the run output's `hover_card` (above), never the
533
+ * sheet's: the readers walk mounted plots, and only the mount knows
534
+ * whether it paints ink.
521
535
  * - WRUN-STYLE (FREEZE.md 3.5.4): this file is wiring only. The look of
522
536
  * every surface lives with its area util and reaches the result through
523
537
  * frozen seams: outputs through `wrunOutputLookPatch` and the guide,
@@ -708,6 +722,14 @@ export function wrunSelectionSheet(metadata) {
708
722
  selectionSheets.set(metadata, selected);
709
723
  return selected;
710
724
  }
725
+ /** The value bytes each built result's render budget charged (the selection's rows, drawings, labels, tables and frame
726
+ * consumers, the handle set, the strategy): what a holder of the result keeps besides object overhead. */
727
+ const wrunResultRenderBytes = new WeakMap();
728
+ /** The value bytes the build of `result` charged its render budget (wrunResultRenderBytes); undefined for a result
729
+ * this builder did not make (a refusal's empty result, a copy). */
730
+ export function wrunRunResultRenderBytes(result) {
731
+ return wrunResultRenderBytes.get(result);
732
+ }
711
733
  export function buildWrunRunResult(options) {
712
734
  // A live tick's build memo (wrun-build-memo.util): the selection's renderers and the builder's units reuse what
713
735
  // the memo's last build did, keyed on every option they read beside the sheet and the rows.
@@ -752,6 +774,7 @@ export function buildWrunRunResult(options) {
752
774
  const headline = wrunHudHeadlineOf(options);
753
775
  if (headline !== undefined)
754
776
  result.headline = headline;
777
+ wrunResultRenderBytes.set(result, budget.spent);
755
778
  return result;
756
779
  }
757
780
  catch (error) {
@@ -967,8 +990,8 @@ function wrunColorIsVisible(color) {
967
990
  * legend line i paints (titan's legend text colour, alpha stripped, so the
968
991
  * chip reads opaque like a kScript colour input). The lines are the
969
992
  * outputs the adapter mounts, in mount order, that the legend lists
970
- * (kScriptLegendLines: value plots, never a guide, mark, candle,
971
- * background, data-only output or a `legend: false` range). A result with
993
+ * (kScriptLegendLines: value plots and candle groups, never a guide, mark,
994
+ * background, data-only output or a `legend: false` output or range). A result with
972
995
  * no legend line gets the first visible colour it draws (its outputs, then
973
996
  * `renderers`, the sheet's declarations). Empty when nothing draws a
974
997
  * colour (the control's amber fallback). The lower pane (the `series`
@@ -1221,7 +1244,7 @@ function readWrunOutputPresentation(sheetId, output, mount) {
1221
1244
  }
1222
1245
  presentation.format = format;
1223
1246
  }
1224
- for (const key of ['legend', 'visible']) {
1247
+ for (const key of ['legend', 'hover_card', 'visible']) {
1225
1248
  const flag = output[key];
1226
1249
  if (flag !== undefined && typeof flag !== 'boolean') {
1227
1250
  throw new Error(`WRUN ${sheetId}: ${subject} ${key} must be a boolean, got ${JSON.stringify(flag)}`);
@@ -1229,6 +1252,8 @@ function readWrunOutputPresentation(sheetId, output, mount) {
1229
1252
  }
1230
1253
  if (output.legend === false)
1231
1254
  presentation.legend = false;
1255
+ if (output.hover_card === false)
1256
+ presentation.hover_card = false;
1232
1257
  const px = (key, takers, taken) => {
1233
1258
  const value = output[key];
1234
1259
  if (value === undefined)
@@ -1252,6 +1277,36 @@ function readWrunOutputPresentation(sheetId, output, mount) {
1252
1277
  presentation.corner = corner;
1253
1278
  return presentation;
1254
1279
  }
1280
+ /** Whether a mount of `output` paints no ink: every colour an output draws fades with its opacity
1281
+ * (WRUN-STYLE OT30: the static colour, the sign pair, the ladders, the marks, a candle group's body,
1282
+ * border and wick pairs by its first member's), so at opacity 0 nothing it draws shows. A transparent
1283
+ * output (isWrunTransparentOutput: opacity 0 with no ladder or bar palette, a fill side that mounts as a
1284
+ * transparent stroke) is one such mount. */
1285
+ function wrunOutputPaintsNoInk(output) {
1286
+ return output.opacity === 0 || isWrunTransparentOutput(output);
1287
+ }
1288
+ /** The words every mounted output carries for the surfaces that read it off the run output
1289
+ * (`legend: false` for the legend, `hover_card: false` for the hover card, `format` for both), read
1290
+ * off the presentation of the outputs it draws: one output for a line, a bar, a shape or a guide, all
1291
+ * four members for a candle group (ONE legend entry reading O H L C, ONE hover card). A member's
1292
+ * `legend: false` keeps the entry out of the legend, a member's `hover_card: false` keeps the mount
1293
+ * off every hover card, and the first declared `format` prints its values, so no member's word is
1294
+ * dropped because it sits off the group's first output. `paints` is the output whose colours the
1295
+ * mount draws (the output itself, a candle group's first member): a mount that paints no ink
1296
+ * (wrunOutputPaintsNoInk) answers no hover card either, whatever its sheet says, since a card over
1297
+ * nothing drawn answers for a line the user cannot see. Every mount takes these words from here: a
1298
+ * mount that built them by hand dropped them (the candle group's legend: false printed the close on
1299
+ * the pane's legend row, 2026-11-02; the transparent fill side, a literal `legend: false`, opened a
1300
+ * card over the empty price pane where it sits, 2026-11-03). */
1301
+ function wrunMountPresentationFields(presentations, paints) {
1302
+ const format = presentations.find((presentation) => presentation.format !== undefined)?.format;
1303
+ const noCard = wrunOutputPaintsNoInk(paints) || presentations.some((presentation) => presentation.hover_card === false);
1304
+ return {
1305
+ ...(presentations.some((presentation) => presentation.legend === false) ? { legend: false } : {}),
1306
+ ...(noCard ? { hover_card: false } : {}),
1307
+ ...(format !== undefined ? { format } : {}),
1308
+ };
1309
+ }
1255
1310
  /** Whether any ready row carries a finite value in every named column: what
1256
1311
  * an `omit_if_empty` declaration needs to mount. */
1257
1312
  function wrunRowsCarryValue(rows, columns) {
@@ -1755,13 +1810,15 @@ function buildWrunRunResultWithSelection(options, memo) {
1755
1810
  const mount = wrunOutputMount(output, candleMembers, candleGroupByOpen);
1756
1811
  const chrome = readWrunOutputChrome(metadata.id, output, mount);
1757
1812
  // The presentation keys that ride the mounted output: `format`, `legend:
1758
- // false`, `glow`, `corner` (plan 1.3), read up front like the chrome so
1759
- // a malformed key refuses on every run.
1813
+ // false`, `hover_card: false`, `glow`, `corner` (plan 1.3), read up front
1814
+ // like the chrome so a malformed key refuses on every run.
1760
1815
  const presentation = readWrunOutputPresentation(metadata.id, output, mount);
1761
1816
  if (hiddenOutputs.has(output.name))
1762
1817
  return;
1763
- const legendFields = presentation.legend === false ? { legend: false } : {};
1764
- const formatFields = presentation.format !== undefined ? { format: presentation.format } : {};
1818
+ // The words every mount carries for its readers (`legend: false`, `hover_card: false`, `format`), the
1819
+ // hover's also when the mount paints no ink; a candle group reads its four members'
1820
+ // (wrunMountPresentationFields).
1821
+ const mountFields = wrunMountPresentationFields([presentation], output);
1765
1822
  const styled = output;
1766
1823
  // Every colour the output draws fades with its opacity (WRUN-STYLE
1767
1824
  // OT30): the static colour, the sign pair, the ladders, the marks.
@@ -1846,9 +1903,16 @@ function buildWrunRunResultWithSelection(options, memo) {
1846
1903
  if (group === undefined)
1847
1904
  refusePackedOn('only the first output of a candle group takes the group colours');
1848
1905
  else {
1849
- // The first output's glow lights the whole group (OT16).
1906
+ // The group is one legend entry and one hover card: its words are its four members'
1907
+ // (a member's `legend: false` keeps it out of the legend, a member's `hover_card: false`
1908
+ // off the card, the first `format` prints it), and it paints with its first output's
1909
+ // colours (every one faded by that output's opacity), so that output's ink decides the
1910
+ // card too. The first output's glow lights the whole group (OT16).
1850
1911
  const candle = {
1851
1912
  ...sheetCandleOutput(group),
1913
+ ...wrunMountPresentationFields(group.map((member) => member === output
1914
+ ? presentation
1915
+ : readWrunOutputPresentation(metadata.id, member, wrunOutputMount(member, candleMembers, candleGroupByOpen))), group[0]),
1852
1916
  ...(presentation.glow !== undefined ? { glow: presentation.glow } : {}),
1853
1917
  };
1854
1918
  // `omit_if_empty`: a candle group that never drew a bar (no row with
@@ -1884,12 +1948,15 @@ function buildWrunRunResultWithSelection(options, memo) {
1884
1948
  // legend slot or price tag; ranges read its values off the rows. A fill
1885
1949
  // resolves its sides as sibling plots, so a transparent fill side is drawn
1886
1950
  // (the om reference's rule, the cloud shaper's own): it mounts as a series
1887
- // that paints nothing (a transparent stroke, no legend line, no tag).
1951
+ // that paints nothing (a transparent stroke, no legend line, no tag, and
1952
+ // no hover card: the mount words carry `hover_card: false`, since it
1953
+ // paints no ink, and the series hover passes over it).
1888
1954
  if (isWrunTransparentOutput(output)) {
1889
1955
  if (fillSides.has(output.name)) {
1890
1956
  outputs[output.name] = {
1891
1957
  plotType: 'spline',
1892
1958
  labels: [labelOf(output.name)],
1959
+ ...mountFields,
1893
1960
  legend: false,
1894
1961
  priceMarkers: false,
1895
1962
  showPriceDisplay: false,
@@ -2002,8 +2069,7 @@ function buildWrunRunResultWithSelection(options, memo) {
2002
2069
  // Off per_output there is no marker role to keep its NaN row.
2003
2070
  ...(perOutputPriceDisplay ? {} : { markerSkeleton: true }),
2004
2071
  labels: [labelOf(output.name)],
2005
- ...legendFields,
2006
- ...formatFields,
2072
+ ...mountFields,
2007
2073
  ...(presentation.glow !== undefined ? { glow: presentation.glow } : {}),
2008
2074
  colors: [staticColor],
2009
2075
  ...(sized !== undefined ? sized.width : output.width !== undefined ? { width: output.width } : {}),
@@ -2088,8 +2154,7 @@ function buildWrunRunResultWithSelection(options, memo) {
2088
2154
  lineStyle: output.line_style ?? 'solid',
2089
2155
  ...lineage('guide'),
2090
2156
  labels: [labelOf(output.name)],
2091
- ...legendFields,
2092
- ...formatFields,
2157
+ ...mountFields,
2093
2158
  ...(onPricePane ? { forceOnChart: true } : {}),
2094
2159
  data: fillSides.has(output.name) ? rows.map((row) => [row.ts, value]) : [],
2095
2160
  ...wrunOutputLookPatch(output, 'line', lookContext(baseColor, guideTag)),
@@ -2210,8 +2275,7 @@ function buildWrunRunResultWithSelection(options, memo) {
2210
2275
  // is no marker role, so it keeps its NaN row through markerSkeleton.
2211
2276
  ...(kind === 'point' ? { ...wrunMarkTag(valueTag), markerSkeleton: true } : valueTag),
2212
2277
  labels: [labelOf(output.name)],
2213
- ...legendFields,
2214
- ...formatFields,
2278
+ ...mountFields,
2215
2279
  // `glow` (px) is the engine's plotOutput.glow; `corner` (px) the
2216
2280
  // histogram corner radius, lit by the engine's next pin.
2217
2281
  ...(presentation.glow !== undefined ? { glow: presentation.glow } : {}),
@@ -6,6 +6,7 @@ import IsoWeek from 'dayjs/plugin/isoWeek.js';
6
6
  import QuarterOfYear from 'dayjs/plugin/quarterOfYear.js';
7
7
  import { Intervals } from '../../constants/interval.constants.js';
8
8
  import { nyMarketPhaseAt } from '../chart/ny-calendar.util.js';
9
+ import { serverNowMs } from '../auth/server-clock.util.js';
9
10
  dayjs.extend(Utc);
10
11
  dayjs.extend(Timezone);
11
12
  dayjs.extend(IsoWeek);
@@ -297,7 +298,7 @@ const WEEKDAY_INDEX = {
297
298
  * (not dayjs) because consumers want discrete year/month/day/weekday fields
298
299
  * for slug building and arithmetic, not a formatted string.
299
300
  */
300
- export function getETParts(now = new Date()) {
301
+ export function getETParts(now = new Date(serverNowMs())) {
301
302
  const parts = new Intl.DateTimeFormat('en-US', {
302
303
  timeZone: ET_TIMEZONE,
303
304
  year: 'numeric',
@@ -335,17 +336,17 @@ export function shiftETDay(base, deltaDays) {
335
336
  * Stable "ET day" key. Two instants in the same ET calendar day produce the
336
337
  * same string across any local timezone — use for rollover detection.
337
338
  */
338
- export function getETDayKey(now = new Date()) {
339
+ export function getETDayKey(now = new Date(serverNowMs())) {
339
340
  const { year, month, day } = getETParts(now);
340
341
  return `${year}-${month}-${day}`;
341
342
  }
342
343
  /** Stable ET-month key (e.g. "2026-3" for April). */
343
- export function getETMonthKey(now = new Date()) {
344
+ export function getETMonthKey(now = new Date(serverNowMs())) {
344
345
  const { year, month } = getETParts(now);
345
346
  return `${year}-${month}`;
346
347
  }
347
348
  /** Stable ET-week key anchored on Monday (matches PM weekly slug windows). */
348
- export function getETWeekKey(now = new Date()) {
349
+ export function getETWeekKey(now = new Date(serverNowMs())) {
349
350
  const parts = getETParts(now);
350
351
  const diffToMonday = parts.weekday === 0 ? -6 : 1 - parts.weekday;
351
352
  const monday = shiftETDay(parts, diffToMonday);
@@ -1,4 +1,5 @@
1
1
  import type { EarningsEventKind, MarketEventsCoverage } from '../../interfaces/market-event.interface.js';
2
+ import { type DisplayOffset } from '../chart/display-offset.leaf.js';
2
3
  export declare const DAY_MS: number;
3
4
  /** What one slice holds: one kind, one ticker or every ticker, the major companies (impact >= 2) or all of them. */
4
5
  export interface EarningsScope {
@@ -37,15 +38,19 @@ export declare function earningsKeyKind(key: string): EarningsEventKind | null;
37
38
  * The list: the week behind today and the two ahead as days of the chart's
38
39
  * zone, [today − 7 d, today + 14 d), rounded out to whole UTC days so no zone
39
40
  * day is cut at either edge. In UTC that is exactly [today − 7 d, today + 14 d).
41
+ * Each edge is a zone midnight on its own offset (`offset`: a fixed shift, or
42
+ * the shift at each instant), so a clock change inside the three weeks never
43
+ * cuts the hour after an edge's midnight.
40
44
  */
41
- export declare function listWindow(now: number, offsetMs?: number): EarningsWindow;
45
+ export declare function listWindow(now: number, offset?: DisplayOffset): EarningsWindow;
42
46
  /**
43
47
  * One calendar month of the chart's zone (`month` 0 to 11 as
44
- * `Date#getUTCMonth()` reads it), rounded out to whole UTC days. A zone east
45
- * of UTC starts its month before UTC midnight: a US after-close print on the
46
- * zone's 1st would otherwise fall out of both months.
48
+ * `Date#getUTCMonth()` reads it), rounded out to whole UTC days, each edge a
49
+ * zone midnight on its own offset. A zone east of UTC starts its month before
50
+ * UTC midnight: a US after-close print on the zone's 1st would otherwise fall
51
+ * out of both months.
47
52
  */
48
- export declare function monthWindow(year: number, month: number, offsetMs?: number): EarningsWindow;
53
+ export declare function monthWindow(year: number, month: number, offset?: DisplayOffset): EarningsWindow;
49
54
  /**
50
55
  * One ticker's whole stored horizon, [today − 400 d, today + 90 d): 490 days,
51
56
  * allowed because a ticker query is not held to the 92-day span of a broad one.
@@ -1,3 +1,4 @@
1
+ import { displayWallMs, displayWallToUtcMs } from '../chart/display-offset.leaf.js';
1
2
  export const DAY_MS = 24 * 60 * 60 * 1000;
2
3
  /** The ticker filter the backend accepts (`^[A-Z][A-Z0-9.\-]{0,9}$`, upper case). */
3
4
  export const EARNINGS_TICKER_PATTERN = /^[A-Z][A-Z0-9.-]{0,9}$/;
@@ -56,21 +57,28 @@ export function earningsKeyKind(key) {
56
57
  * The list: the week behind today and the two ahead as days of the chart's
57
58
  * zone, [today − 7 d, today + 14 d), rounded out to whole UTC days so no zone
58
59
  * day is cut at either edge. In UTC that is exactly [today − 7 d, today + 14 d).
60
+ * Each edge is a zone midnight on its own offset (`offset`: a fixed shift, or
61
+ * the shift at each instant), so a clock change inside the three weeks never
62
+ * cuts the hour after an edge's midnight.
59
63
  */
60
- export function listWindow(now, offsetMs = 0) {
61
- const today = Math.floor((now + offsetMs) / DAY_MS) * DAY_MS - offsetMs;
62
- return { from: floorUtcDay(today - 7 * DAY_MS), to: ceilUtcDay(today + 14 * DAY_MS) };
64
+ export function listWindow(now, offset = 0) {
65
+ const today = Math.floor(displayWallMs(offset, now) / DAY_MS) * DAY_MS;
66
+ return {
67
+ from: floorUtcDay(displayWallToUtcMs(offset, today - 7 * DAY_MS)),
68
+ to: ceilUtcDay(displayWallToUtcMs(offset, today + 14 * DAY_MS)),
69
+ };
63
70
  }
64
71
  /**
65
72
  * One calendar month of the chart's zone (`month` 0 to 11 as
66
- * `Date#getUTCMonth()` reads it), rounded out to whole UTC days. A zone east
67
- * of UTC starts its month before UTC midnight: a US after-close print on the
68
- * zone's 1st would otherwise fall out of both months.
73
+ * `Date#getUTCMonth()` reads it), rounded out to whole UTC days, each edge a
74
+ * zone midnight on its own offset. A zone east of UTC starts its month before
75
+ * UTC midnight: a US after-close print on the zone's 1st would otherwise fall
76
+ * out of both months.
69
77
  */
70
- export function monthWindow(year, month, offsetMs = 0) {
78
+ export function monthWindow(year, month, offset = 0) {
71
79
  return {
72
- from: floorUtcDay(Date.UTC(year, month, 1) - offsetMs),
73
- to: ceilUtcDay(Date.UTC(year, month + 1, 1) - offsetMs),
80
+ from: floorUtcDay(displayWallToUtcMs(offset, Date.UTC(year, month, 1))),
81
+ to: ceilUtcDay(displayWallToUtcMs(offset, Date.UTC(year, month + 1, 1))),
74
82
  };
75
83
  }
76
84
  /**
@@ -1,4 +1,5 @@
1
1
  import type { EarningsSlot, MarketAssetClass, MarketEvent, MarketEventImpact, MarketEventSeriesLink } from '../../interfaces/market-event.interface.js';
2
+ import { type DisplayOffset } from '../chart/display-offset.leaf.js';
2
3
  import { type VenueMarketKind } from '../chart/marketKind.util.js';
3
4
  /** Chart-side market kind → the server's relevance bucket. */
4
5
  export declare function assetClassForMarketKind(kind: VenueMarketKind): MarketAssetClass;
@@ -94,8 +95,11 @@ export declare function surpriseGlyph(event: MarketEvent): string;
94
95
  /** Escape vendor text before it rides an HTML-capable tooltip. */
95
96
  export declare function escapeHtml(text: string): string;
96
97
  export declare function isSourceFresh(lastSyncAt: number | null | undefined, now: number): boolean;
97
- /** Day bucket in a fixed UTC-offset zone (the chart's time zone), for list headers. */
98
- export declare function dayKey(at: number, offsetMs: number): string;
98
+ /**
99
+ * Day bucket in the chart's time zone, for list headers: the instant's own wall date, `offset` read at the instant
100
+ * (a fixed shift, or the shift at each instant for a zone that moves its clock).
101
+ */
102
+ export declare function dayKey(at: number, offset: DisplayOffset): string;
99
103
  /**
100
104
  * The calendar day a row belongs to in the zone. A date-only row (every
101
105
  * dividend, a report with no announced time) carries a 09:30 Eastern
@@ -104,7 +108,7 @@ export declare function dayKey(at: number, offsetMs: number): string;
104
108
  */
105
109
  export declare function rowDayKey(event: Pick<MarketEvent, 'at'> & {
106
110
  timing?: MarketEvent['timing'];
107
- }, offsetMs: number): string;
111
+ }, offset: DisplayOffset): string;
108
112
  /** Where a day sits relative to today; the panels localize it ("Today", "Tomorrow", else the date). */
109
113
  export type DayGroupKey = 'today' | 'tomorrow' | 'date';
110
114
  export interface DayGroup<T extends Pick<MarketEvent, 'at'> = MarketEvent> {
@@ -117,13 +121,16 @@ export interface DayGroup<T extends Pick<MarketEvent, 'at'> = MarketEvent> {
117
121
  events: T[];
118
122
  }
119
123
  /**
120
- * Rows by calendar day in a fixed UTC-offset zone (the chart's time zone), in
121
- * order of first appearance (pass rows sorted by time). Raw keys only: the
122
- * panels word them.
124
+ * Rows by calendar day in the chart's time zone, in order of first
125
+ * appearance (pass rows sorted by time). Each row reads its own day at its
126
+ * own instant's offset (a zone moves its clock: one offset read now puts a
127
+ * row across a clock change an hour off its day), and tomorrow is the
128
+ * calendar's next date, never now plus 24 hours (a zone day around a change
129
+ * is 23 or 25 hours long). Raw keys only: the panels word them.
123
130
  */
124
131
  export declare function dayGroups<T extends Pick<MarketEvent, 'at'> & {
125
132
  timing?: MarketEvent['timing'];
126
- } = MarketEvent>(events: readonly T[], nowMs: number, offsetMs: number): DayGroup<T>[];
133
+ } = MarketEvent>(events: readonly T[], nowMs: number, offset: DisplayOffset): DayGroup<T>[];
127
134
  /** Whether an exact print is close enough that surfaces should poll fast; earnings and dividends never count. */
128
135
  export declare function isNearRelease(events: MarketEvent[], now: number, beforeMs: number, afterMs: number): boolean;
129
136
  export interface ChartReach {