@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
@@ -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,13 +22,17 @@
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
31
- * pane's outputs carry the same words.
32
+ * pane's outputs carry the same words. A built-in's port (`builtIn`)
33
+ * names each line its built-in names in that built-in's words instead
34
+ * (wrun-output-words.util wrunOutputWords: MACD's `macdLine` reads "MACD
35
+ * line"), the sheet's label kept everywhere else.
32
36
  * - Panes: an on-price result whose sheet leaves `overlay` undeclared and
33
37
  * draws a `lower` output owns ONE lower pane: a `series` child overlay
34
38
  * (`childOverlays`, mounted below by wrun-panel-mount.util through the
@@ -488,17 +492,27 @@
488
492
  * each legend line in mount order instead of the control's amber
489
493
  * fallback. A malformed `legend_palette` refuses every run by name.
490
494
  * - Typed-inputs presentation keys (WRUN-INPUTS-PLAN 1.3, 1.4), all
491
- * optional, a sheet without them byte-identical:
495
+ * optional, a sheet without them byte-identical (but for the no-ink
496
+ * `hover_card: false` below):
492
497
  * - an output's `format` (one of the frozen words, wrun-pane-format.util)
493
498
  * rides the mounted output as `format`, an FE-only field the legend
494
499
  * reads off the run output (kScriptLegendLineFormat) to print that line;
495
500
  * `legend: false` rides as the `legend: false` kScriptLegendLines reads
496
501
  * (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).
502
+ * `hover_card: false` rides as the `hover_card: false` the hover
503
+ * surfaces read (optsOutOfHover: drawn, listed and printed all the same,
504
+ * never a hover card, over the plot or the legend value); `glow` (px, a
505
+ * line output) is the engine's plotOutput.glow and `corner` (px, a bar
506
+ * output) the histogram corner radius the engine lights on its next pin.
507
+ * A malformed key, `glow` off a line or `corner` off a bar refuses by
508
+ * name; `visible` is validated here and applied after integration
509
+ * (applyWrunOutputVisibility). Every mount takes these words from one
510
+ * helper (wrunMountPresentationFields; a candle group from its four
511
+ * members), which also stamps `hover_card: false` on a mount that paints
512
+ * no ink (no ink, no card): a transparent fill side, any drawn output at
513
+ * opacity 0 (every colour it draws fades to nothing, OT30: a laddered
514
+ * line or mark, a bar sign palette), a candle group whose first output
515
+ * is at opacity 0.
502
516
  * - `legend_title` (top level, the kit's legend({ title })) is the legend
503
517
  * suffix with `{{param}}` placeholders, resolved against the run's param
504
518
  * values (a select as its label, a toggle as true / false) and emitted as
@@ -517,7 +531,10 @@
517
531
  * - `presentation` (legend entries, HUD cards) and an output's `hover`,
518
532
  * `tooltip`, `hint` and `badges` never reach the run result: the legend,
519
533
  * the HUD and the hover card read them off the sheet
520
- * (wrun-legend-hover, wrun-hover.util).
534
+ * (wrun-legend-hover, wrun-hover.util). Whether a mounted plot answers a
535
+ * card at all is the run output's `hover_card` (above), never the
536
+ * sheet's: the readers walk mounted plots, and only the mount knows
537
+ * whether it paints ink.
521
538
  * - WRUN-STYLE (FREEZE.md 3.5.4): this file is wiring only. The look of
522
539
  * every surface lives with its area util and reaches the result through
523
540
  * frozen seams: outputs through `wrunOutputLookPatch` and the guide,
@@ -667,6 +684,11 @@ export interface WrunRunResultOptions {
667
684
  /** A live tick's build memo (wrun-build-memo.util): an output or band mount none of whose columns changed on the
668
685
  * newest row replays what it wrote last build. Full runs, reseeds and pans leave it absent. */
669
686
  buildMemo?: WrunBuildMemo;
687
+ /** The built-in the overlay ports (builtinPortOf over its settings; absent for any other package): every line its
688
+ * built-in names carries the built-in's words in `labels` (wrun-output-words.util wrunOutputWords), never the
689
+ * contract label a proven twin's sheet keeps (`macdLine`). The sheet, the output keys and every binding are as
690
+ * published: only the words change. */
691
+ builtIn?: string;
670
692
  }
671
693
  interface WrunRunResultOutput {
672
694
  plotType: string;
@@ -834,6 +856,9 @@ export interface WrunRunResult {
834
856
  * `visible` is an output's own kit key). The sheet itself when no declaration carries the key.
835
857
  */
836
858
  export declare function wrunSelectionSheet(metadata: WrunIndicatorMetadata): WrunIndicatorMetadata;
859
+ /** The value bytes the build of `result` charged its render budget (wrunResultRenderBytes); undefined for a result
860
+ * this builder did not make (a refusal's empty result, a copy). */
861
+ export declare function wrunRunResultRenderBytes(result: WrunRunResult): number | undefined;
837
862
  export declare function buildWrunRunResult(options: WrunRunResultOptions): WrunRunResult;
838
863
  /** A run result's author-facing notices (every canvas child's, in child
839
864
  * order; a fresh array, empty when there are none). A run seam publishes
@@ -854,8 +879,8 @@ export declare function resolveWrunLegendTitle(template: string, params: Readonl
854
879
  * legend line i paints (titan's legend text colour, alpha stripped, so the
855
880
  * chip reads opaque like a kScript colour input). The lines are the
856
881
  * 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
882
+ * (kScriptLegendLines: value plots and candle groups, never a guide, mark,
883
+ * background, data-only output or a `legend: false` output or range). A result with
859
884
  * no legend line gets the first visible colour it draws (its outputs, then
860
885
  * `renderers`, the sheet's declarations). Empty when nothing draws a
861
886
  * colour (the control's amber fallback). The lower pane (the `series`
@@ -22,13 +22,17 @@
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
31
- * pane's outputs carry the same words.
32
+ * pane's outputs carry the same words. A built-in's port (`builtIn`)
33
+ * names each line its built-in names in that built-in's words instead
34
+ * (wrun-output-words.util wrunOutputWords: MACD's `macdLine` reads "MACD
35
+ * line"), the sheet's label kept everywhere else.
32
36
  * - Panes: an on-price result whose sheet leaves `overlay` undeclared and
33
37
  * draws a `lower` output owns ONE lower pane: a `series` child overlay
34
38
  * (`childOverlays`, mounted below by wrun-panel-mount.util through the
@@ -488,17 +492,27 @@
488
492
  * each legend line in mount order instead of the control's amber
489
493
  * fallback. A malformed `legend_palette` refuses every run by name.
490
494
  * - Typed-inputs presentation keys (WRUN-INPUTS-PLAN 1.3, 1.4), all
491
- * optional, a sheet without them byte-identical:
495
+ * optional, a sheet without them byte-identical (but for the no-ink
496
+ * `hover_card: false` below):
492
497
  * - an output's `format` (one of the frozen words, wrun-pane-format.util)
493
498
  * rides the mounted output as `format`, an FE-only field the legend
494
499
  * reads off the run output (kScriptLegendLineFormat) to print that line;
495
500
  * `legend: false` rides as the `legend: false` kScriptLegendLines reads
496
501
  * (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).
502
+ * `hover_card: false` rides as the `hover_card: false` the hover
503
+ * surfaces read (optsOutOfHover: drawn, listed and printed all the same,
504
+ * never a hover card, over the plot or the legend value); `glow` (px, a
505
+ * line output) is the engine's plotOutput.glow and `corner` (px, a bar
506
+ * output) the histogram corner radius the engine lights on its next pin.
507
+ * A malformed key, `glow` off a line or `corner` off a bar refuses by
508
+ * name; `visible` is validated here and applied after integration
509
+ * (applyWrunOutputVisibility). Every mount takes these words from one
510
+ * helper (wrunMountPresentationFields; a candle group from its four
511
+ * members), which also stamps `hover_card: false` on a mount that paints
512
+ * no ink (no ink, no card): a transparent fill side, any drawn output at
513
+ * opacity 0 (every colour it draws fades to nothing, OT30: a laddered
514
+ * line or mark, a bar sign palette), a candle group whose first output
515
+ * is at opacity 0.
502
516
  * - `legend_title` (top level, the kit's legend({ title })) is the legend
503
517
  * suffix with `{{param}}` placeholders, resolved against the run's param
504
518
  * values (a select as its label, a toggle as true / false) and emitted as
@@ -517,7 +531,10 @@
517
531
  * - `presentation` (legend entries, HUD cards) and an output's `hover`,
518
532
  * `tooltip`, `hint` and `badges` never reach the run result: the legend,
519
533
  * the HUD and the hover card read them off the sheet
520
- * (wrun-legend-hover, wrun-hover.util).
534
+ * (wrun-legend-hover, wrun-hover.util). Whether a mounted plot answers a
535
+ * card at all is the run output's `hover_card` (above), never the
536
+ * sheet's: the readers walk mounted plots, and only the mount knows
537
+ * whether it paints ink.
521
538
  * - WRUN-STYLE (FREEZE.md 3.5.4): this file is wiring only. The look of
522
539
  * every surface lives with its area util and reaches the result through
523
540
  * frozen seams: outputs through `wrunOutputLookPatch` and the guide,
@@ -543,6 +560,7 @@ import { kScriptLegendLines } from './kscript-legend-entries.util.js';
543
560
  import { KSCRIPT_CONTAINER_OUTPUT_KEY } from './kscript-titancharts-container.util.js';
544
561
  import { KSCRIPT_VIEWPORT_MINI_CHART_PLOT_TYPE } from './kscript-viewport-overlays.util.js';
545
562
  import { wrunLegendName } from './wrun-legend-name.util.js';
563
+ import { wrunOutputWords } from '../wrun/wrun-output-words.util.js';
546
564
  import { wrunChartHostEnv } from '../../host-env.js';
547
565
  import { evaluateWrunSpans, isWrunAlphaColor, readWrunBoxSpecs, readWrunSegmentSpecs, wrunSpanEdgeTs, wrunStrategyOf, } from '../wrun/wrun-box-segment.util.js';
548
566
  import { WRUN_BATCHED_MARKS_KINDS, wrunBatchedMarksChildren, } from '../wrun/wrun-batched-marks.util.js';
@@ -708,6 +726,14 @@ export function wrunSelectionSheet(metadata) {
708
726
  selectionSheets.set(metadata, selected);
709
727
  return selected;
710
728
  }
729
+ /** The value bytes each built result's render budget charged (the selection's rows, drawings, labels, tables and frame
730
+ * consumers, the handle set, the strategy): what a holder of the result keeps besides object overhead. */
731
+ const wrunResultRenderBytes = new WeakMap();
732
+ /** The value bytes the build of `result` charged its render budget (wrunResultRenderBytes); undefined for a result
733
+ * this builder did not make (a refusal's empty result, a copy). */
734
+ export function wrunRunResultRenderBytes(result) {
735
+ return wrunResultRenderBytes.get(result);
736
+ }
711
737
  export function buildWrunRunResult(options) {
712
738
  // A live tick's build memo (wrun-build-memo.util): the selection's renderers and the builder's units reuse what
713
739
  // the memo's last build did, keyed on every option they read beside the sheet and the rows.
@@ -725,6 +751,7 @@ export function buildWrunRunResult(options) {
725
751
  options.intervalMs,
726
752
  options.selectContext,
727
753
  options.runTimeline,
754
+ options.builtIn,
728
755
  ], options.rows);
729
756
  try {
730
757
  const budget = options.renderBudget ?? createWrunRenderBudget();
@@ -752,6 +779,7 @@ export function buildWrunRunResult(options) {
752
779
  const headline = wrunHudHeadlineOf(options);
753
780
  if (headline !== undefined)
754
781
  result.headline = headline;
782
+ wrunResultRenderBytes.set(result, budget.spent);
755
783
  return result;
756
784
  }
757
785
  catch (error) {
@@ -967,8 +995,8 @@ function wrunColorIsVisible(color) {
967
995
  * legend line i paints (titan's legend text colour, alpha stripped, so the
968
996
  * chip reads opaque like a kScript colour input). The lines are the
969
997
  * 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
998
+ * (kScriptLegendLines: value plots and candle groups, never a guide, mark,
999
+ * background, data-only output or a `legend: false` output or range). A result with
972
1000
  * no legend line gets the first visible colour it draws (its outputs, then
973
1001
  * `renderers`, the sheet's declarations). Empty when nothing draws a
974
1002
  * colour (the control's amber fallback). The lower pane (the `series`
@@ -1221,7 +1249,7 @@ function readWrunOutputPresentation(sheetId, output, mount) {
1221
1249
  }
1222
1250
  presentation.format = format;
1223
1251
  }
1224
- for (const key of ['legend', 'visible']) {
1252
+ for (const key of ['legend', 'hover_card', 'visible']) {
1225
1253
  const flag = output[key];
1226
1254
  if (flag !== undefined && typeof flag !== 'boolean') {
1227
1255
  throw new Error(`WRUN ${sheetId}: ${subject} ${key} must be a boolean, got ${JSON.stringify(flag)}`);
@@ -1229,6 +1257,8 @@ function readWrunOutputPresentation(sheetId, output, mount) {
1229
1257
  }
1230
1258
  if (output.legend === false)
1231
1259
  presentation.legend = false;
1260
+ if (output.hover_card === false)
1261
+ presentation.hover_card = false;
1232
1262
  const px = (key, takers, taken) => {
1233
1263
  const value = output[key];
1234
1264
  if (value === undefined)
@@ -1252,6 +1282,36 @@ function readWrunOutputPresentation(sheetId, output, mount) {
1252
1282
  presentation.corner = corner;
1253
1283
  return presentation;
1254
1284
  }
1285
+ /** Whether a mount of `output` paints no ink: every colour an output draws fades with its opacity
1286
+ * (WRUN-STYLE OT30: the static colour, the sign pair, the ladders, the marks, a candle group's body,
1287
+ * border and wick pairs by its first member's), so at opacity 0 nothing it draws shows. A transparent
1288
+ * output (isWrunTransparentOutput: opacity 0 with no ladder or bar palette, a fill side that mounts as a
1289
+ * transparent stroke) is one such mount. */
1290
+ function wrunOutputPaintsNoInk(output) {
1291
+ return output.opacity === 0 || isWrunTransparentOutput(output);
1292
+ }
1293
+ /** The words every mounted output carries for the surfaces that read it off the run output
1294
+ * (`legend: false` for the legend, `hover_card: false` for the hover card, `format` for both), read
1295
+ * off the presentation of the outputs it draws: one output for a line, a bar, a shape or a guide, all
1296
+ * four members for a candle group (ONE legend entry reading O H L C, ONE hover card). A member's
1297
+ * `legend: false` keeps the entry out of the legend, a member's `hover_card: false` keeps the mount
1298
+ * off every hover card, and the first declared `format` prints its values, so no member's word is
1299
+ * dropped because it sits off the group's first output. `paints` is the output whose colours the
1300
+ * mount draws (the output itself, a candle group's first member): a mount that paints no ink
1301
+ * (wrunOutputPaintsNoInk) answers no hover card either, whatever its sheet says, since a card over
1302
+ * nothing drawn answers for a line the user cannot see. Every mount takes these words from here: a
1303
+ * mount that built them by hand dropped them (the candle group's legend: false printed the close on
1304
+ * the pane's legend row, 2026-11-02; the transparent fill side, a literal `legend: false`, opened a
1305
+ * card over the empty price pane where it sits, 2026-11-03). */
1306
+ function wrunMountPresentationFields(presentations, paints) {
1307
+ const format = presentations.find((presentation) => presentation.format !== undefined)?.format;
1308
+ const noCard = wrunOutputPaintsNoInk(paints) || presentations.some((presentation) => presentation.hover_card === false);
1309
+ return {
1310
+ ...(presentations.some((presentation) => presentation.legend === false) ? { legend: false } : {}),
1311
+ ...(noCard ? { hover_card: false } : {}),
1312
+ ...(format !== undefined ? { format } : {}),
1313
+ };
1314
+ }
1255
1315
  /** Whether any ready row carries a finite value in every named column: what
1256
1316
  * an `omit_if_empty` declaration needs to mount. */
1257
1317
  function wrunRowsCarryValue(rows, columns) {
@@ -1682,7 +1742,8 @@ function buildWrunRunResultWithSelection(options, memo) {
1682
1742
  // (Volume Bubbles' twenty) stays inside the integration row budget.
1683
1743
  const lastRunRow = rows.length - 1;
1684
1744
  const markEndRow = (lastMarkRow, tsOf) => lastRunRow < 0 || lastMarkRow === lastRunRow ? undefined : [tsOf(lastRunRow), Number.NaN];
1685
- const labelByName = new Map(orderedOutputs.map((output) => [output.name, wrunLegendName(output.name, output.label)]));
1745
+ // Each line's words (wrunOutputWords): the legend's rule, a built-in port's line in its built-in's words.
1746
+ const labelByName = new Map(orderedOutputs.map((output) => [output.name, wrunOutputWords(output, options.builtIn)]));
1686
1747
  const labelOf = (name) => labelByName.get(name) ?? wrunLegendName(name);
1687
1748
  // Sheet candle groups (frozen sheet contract): four consecutive plot
1688
1749
  // 'candle' outputs mount as ONE candle plot at the first member's slot in
@@ -1755,13 +1816,15 @@ function buildWrunRunResultWithSelection(options, memo) {
1755
1816
  const mount = wrunOutputMount(output, candleMembers, candleGroupByOpen);
1756
1817
  const chrome = readWrunOutputChrome(metadata.id, output, mount);
1757
1818
  // 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.
1819
+ // false`, `hover_card: false`, `glow`, `corner` (plan 1.3), read up front
1820
+ // like the chrome so a malformed key refuses on every run.
1760
1821
  const presentation = readWrunOutputPresentation(metadata.id, output, mount);
1761
1822
  if (hiddenOutputs.has(output.name))
1762
1823
  return;
1763
- const legendFields = presentation.legend === false ? { legend: false } : {};
1764
- const formatFields = presentation.format !== undefined ? { format: presentation.format } : {};
1824
+ // The words every mount carries for its readers (`legend: false`, `hover_card: false`, `format`), the
1825
+ // hover's also when the mount paints no ink; a candle group reads its four members'
1826
+ // (wrunMountPresentationFields).
1827
+ const mountFields = wrunMountPresentationFields([presentation], output);
1765
1828
  const styled = output;
1766
1829
  // Every colour the output draws fades with its opacity (WRUN-STYLE
1767
1830
  // OT30): the static colour, the sign pair, the ladders, the marks.
@@ -1846,9 +1909,16 @@ function buildWrunRunResultWithSelection(options, memo) {
1846
1909
  if (group === undefined)
1847
1910
  refusePackedOn('only the first output of a candle group takes the group colours');
1848
1911
  else {
1849
- // The first output's glow lights the whole group (OT16).
1912
+ // The group is one legend entry and one hover card: its words are its four members'
1913
+ // (a member's `legend: false` keeps it out of the legend, a member's `hover_card: false`
1914
+ // off the card, the first `format` prints it), and it paints with its first output's
1915
+ // colours (every one faded by that output's opacity), so that output's ink decides the
1916
+ // card too. The first output's glow lights the whole group (OT16).
1850
1917
  const candle = {
1851
1918
  ...sheetCandleOutput(group),
1919
+ ...wrunMountPresentationFields(group.map((member) => member === output
1920
+ ? presentation
1921
+ : readWrunOutputPresentation(metadata.id, member, wrunOutputMount(member, candleMembers, candleGroupByOpen))), group[0]),
1852
1922
  ...(presentation.glow !== undefined ? { glow: presentation.glow } : {}),
1853
1923
  };
1854
1924
  // `omit_if_empty`: a candle group that never drew a bar (no row with
@@ -1884,12 +1954,15 @@ function buildWrunRunResultWithSelection(options, memo) {
1884
1954
  // legend slot or price tag; ranges read its values off the rows. A fill
1885
1955
  // resolves its sides as sibling plots, so a transparent fill side is drawn
1886
1956
  // (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).
1957
+ // that paints nothing (a transparent stroke, no legend line, no tag, and
1958
+ // no hover card: the mount words carry `hover_card: false`, since it
1959
+ // paints no ink, and the series hover passes over it).
1888
1960
  if (isWrunTransparentOutput(output)) {
1889
1961
  if (fillSides.has(output.name)) {
1890
1962
  outputs[output.name] = {
1891
1963
  plotType: 'spline',
1892
1964
  labels: [labelOf(output.name)],
1965
+ ...mountFields,
1893
1966
  legend: false,
1894
1967
  priceMarkers: false,
1895
1968
  showPriceDisplay: false,
@@ -2002,8 +2075,7 @@ function buildWrunRunResultWithSelection(options, memo) {
2002
2075
  // Off per_output there is no marker role to keep its NaN row.
2003
2076
  ...(perOutputPriceDisplay ? {} : { markerSkeleton: true }),
2004
2077
  labels: [labelOf(output.name)],
2005
- ...legendFields,
2006
- ...formatFields,
2078
+ ...mountFields,
2007
2079
  ...(presentation.glow !== undefined ? { glow: presentation.glow } : {}),
2008
2080
  colors: [staticColor],
2009
2081
  ...(sized !== undefined ? sized.width : output.width !== undefined ? { width: output.width } : {}),
@@ -2088,8 +2160,7 @@ function buildWrunRunResultWithSelection(options, memo) {
2088
2160
  lineStyle: output.line_style ?? 'solid',
2089
2161
  ...lineage('guide'),
2090
2162
  labels: [labelOf(output.name)],
2091
- ...legendFields,
2092
- ...formatFields,
2163
+ ...mountFields,
2093
2164
  ...(onPricePane ? { forceOnChart: true } : {}),
2094
2165
  data: fillSides.has(output.name) ? rows.map((row) => [row.ts, value]) : [],
2095
2166
  ...wrunOutputLookPatch(output, 'line', lookContext(baseColor, guideTag)),
@@ -2210,8 +2281,7 @@ function buildWrunRunResultWithSelection(options, memo) {
2210
2281
  // is no marker role, so it keeps its NaN row through markerSkeleton.
2211
2282
  ...(kind === 'point' ? { ...wrunMarkTag(valueTag), markerSkeleton: true } : valueTag),
2212
2283
  labels: [labelOf(output.name)],
2213
- ...legendFields,
2214
- ...formatFields,
2284
+ ...mountFields,
2215
2285
  // `glow` (px) is the engine's plotOutput.glow; `corner` (px) the
2216
2286
  // histogram corner radius, lit by the engine's next pin.
2217
2287
  ...(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
  /**