@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
@@ -1,13 +1,3 @@
1
- /**
2
- * The batched records' readout (WRUN-BATCHED-MARKS): a `marks`, `spans` or `rays` record's meta
3
- * decode, the number formats a template (and a marks caption) prints with (THE one list,
4
- * WRUN_BATCHED_NUMBER_FORMATS), and the tooltip text.
5
- * The batched mount registers the text as its readout's `text` (wrun-batched-marks.util
6
- * `wrunBatchedChildConfig`), so the boot-path hover inspector prints a record through the thin
7
- * registry (wrun-canvas-readout.util) and never loads this module itself. A timed spans or rays
8
- * record (stride 5, WRUN-MARKS-CONTRACT F2) answers `{{start}}` and `{{end}}`, printed as the
9
- * chart prints a time (wrun-chart-time.util), its meta read from its fifth field.
10
- */
11
1
  import { type WrunBatchedHoverRecord, type WrunCanvasReadout } from './wrun-canvas-readout.util.js';
12
2
  /** A marks record's meta, `side + 4 * fills + 262144 * offset_ms`, read apart. */
13
3
  export interface WrunMarkMeta {
@@ -26,6 +16,17 @@ export declare const WRUN_MARK_META_MAX_OFFSET_MS: number;
26
16
  * a finite whole number, negative, or past the largest offset.
27
17
  */
28
18
  export declare function decodeWrunMarkMeta(meta: number): WrunMarkMeta | null;
19
+ /** A flags record's meta, `word + 4 * count + 262144 * offset_ms` (a marks meta's packing), read apart. */
20
+ export interface WrunFlagMeta {
21
+ /** 0..3: the chip template the record names (`words[word]`). */
22
+ word: number;
23
+ /** 0..65535. */
24
+ count: number;
25
+ /** 0..2^30: the record's time inside its bar. */
26
+ offsetMs: number;
27
+ }
28
+ /** A flags meta read apart as a marks meta is (`decodeWrunMarkMeta`); null for a value that is no packed meta. */
29
+ export declare function decodeWrunFlagMeta(meta: number): WrunFlagMeta | null;
29
30
  /** A spans or rays record's meta, `style + 8 * word + 256 * extend`, read apart. */
30
31
  export interface WrunSpanMeta {
31
32
  /** 0..7: the record's colour index. */
@@ -54,13 +55,15 @@ export declare const WRUN_BATCHED_TIMED_TOOLTIP_TOKENS: Readonly<{
54
55
  export declare function wrunTimedRecordSpan(record: Pick<WrunBatchedHoverRecord, 'ts' | 'fields'>): [number, number];
55
56
  /**
56
57
  * THE number formats a batched template and a marks caption print with, the kit's WRUN_MARK_TEXT_FORMATS (its
57
- * WRUN_BATCHED_TOOLTIP_FORMATS): `compact` (Big Trades 0.3.2's caption, "1.2M", "1.2K"), `price` (the pane's price),
58
- * `int` (rounded), `usd` ("$" before the compact amount, "$12M", "-$1.2K") and `units` (a mark's quantity in the
59
- * market's own unit, `wrunMarkQtyInUnits`, printed compact; in dollars where no unit is proven). The layout gate's
58
+ * WRUN_BATCHED_TOOLTIP_FORMATS): `compact` (Big Trades 0.3.2's caption, "1.2B", "1.2M", "1.2K"), `price` (the pane's
59
+ * price), `int` (rounded), `usd` ("$" before the compact amount, "$12M", "-$1.2K") and `units` (a mark's quantity in
60
+ * the market's own unit, `wrunMarkQtyInUnits`, printed compact; in dollars where no unit is proven). The layout gate's
60
61
  * vocabulary, the engine settings and this readout read this list, and the format type derives from it: a word added
61
62
  * in one hand copy alone refused the section ("Needs a newer chart") or printed the placeholder as written
62
63
  * (tests/utility/wrun/wrun-batched-readout.util.spec.ts holds it to its golden and finds any second spelling of it in
63
- * the package). TitanCharts keeps the engine's own copy for the caption, pinned to the same golden there.
64
+ * the package). TitanCharts keeps the engine's own copy for the caption and a flag's chip (batchedMarks formats.ts):
65
+ * the same spec runs the INSTALLED engine's copy and holds this list and every word's text to it, so a hover always
66
+ * prints a record as its bubble does.
64
67
  */
65
68
  export declare const WRUN_BATCHED_NUMBER_FORMATS: readonly ["compact", "price", "int", "usd", "units"];
66
69
  /** A number format of the one list. */
@@ -78,10 +81,11 @@ export declare function wrunMarkUnitValue(value: unknown): number | undefined;
78
81
  * caller prints dollars (`usd`) then, never a wrong number.
79
82
  */
80
83
  export declare function wrunMarkQtyInUnits(qty: number, price: number, valuePerUnit: number | undefined): number | undefined;
81
- /** A number in a batched format: `compact` is Big Trades 0.3.2's caption ("1.2M", "1.2K", a whole
82
- * number from 100, one decimal from 1, two below 1), `usd` the same after a "$" ("$12M", "-$1.2K"),
83
- * `units` compact (a mark's quantity reaches it converted, `wrunMarkQtyInUnits`), `int` the rounded
84
- * whole number, `price` the pane's price; a negative value keeps its sign. Not finite: '-'. */
84
+ /** A number in a batched format, as the engine captions it: `compact` is Big Trades 0.3.2's caption ("1.2B", "1.2M",
85
+ * "1.2K", a whole number from 100, one decimal from 1, two below 1), `usd` the same after a "$" ("$12M", "-$1.2K"),
86
+ * `units` compact (a mark's quantity reaches it converted, `wrunMarkQtyInUnits`), `int` the whole number (a half
87
+ * away from zero, never "-0"), `price` the pane's price; a negative value keeps its sign. Not finite: '-' (the
88
+ * caption draws nothing). */
85
89
  export declare function formatWrunBatchedNumber(value: number, format: WrunBatchedNumberFormat | 'amount', formatPrice: (value: number) => string): string;
86
90
  /**
87
91
  * A batched record's tooltip (WRUN-BATCHED-MARKS): `{{name}}` or `{{name:<format>}}`, a word of
@@ -92,7 +96,10 @@ export declare function formatWrunBatchedNumber(value: number, format: WrunBatch
92
96
  * price), both `{{length}}` (the length in bars, default int) and `{{word}}` (the section's word the meta
93
97
  * names, '' when none); a timed record (stride 5) `{{start}}` and `{{end}}` in place of `{{length}}`,
94
98
  * each the time as the chart prints it (`formatters.formatTime`, else wrun-chart-time.util shifted by
95
- * the display offset the mount door stamped on the readout), its meta its fifth field; `{{label}}` is
99
+ * the display offset the mount door stamped on the readout, read at that time), its meta its fifth field; flags read
100
+ * `{{qty}}` and `{{price}}` as marks do, `{{count}}` (default int) and `{{word}}` (the chip text: the
101
+ * template the meta's word names, its own `{{qty}}` (default compact, the chip's caption), `{{price}}` and
102
+ * `{{count}}` printed from the same record; '' when none); `{{label}}` is
96
103
  * the readout's title. A placeholder
97
104
  * the record does not read, or a format word outside the list, stays as written; a hole (a
98
105
  * non-finite field) prints '-'.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The batched records' readout (WRUN-BATCHED-MARKS): a `marks`, `spans` or `rays` record's meta
2
+ * The batched records' readout (WRUN-BATCHED-MARKS): a `marks`, `spans`, `rays` or `flags` record's meta
3
3
  * decode, the number formats a template (and a marks caption) prints with (THE one list,
4
4
  * WRUN_BATCHED_NUMBER_FORMATS), and the tooltip text.
5
5
  * The batched mount registers the text as its readout's `text` (wrun-batched-marks.util
@@ -8,6 +8,7 @@
8
8
  * record (stride 5, WRUN-MARKS-CONTRACT F2) answers `{{start}}` and `{{end}}`, printed as the
9
9
  * chart prints a time (wrun-chart-time.util), its meta read from its fifth field.
10
10
  */
11
+ import { displayWallMs } from '../chart/display-offset.leaf.js';
11
12
  import { CANVAS_PLACEHOLDER } from './wrun-canvas-readout.util.js';
12
13
  import { wrunChartTimeText } from './wrun-chart-time.util.js';
13
14
  /** The largest `offset_ms` a marks meta packs (2^30 ms, 12.4 days). */
@@ -25,6 +26,11 @@ export function decodeWrunMarkMeta(meta) {
25
26
  return null;
26
27
  return { side: meta % 4, fills: Math.floor(meta / 4) % 65536, offsetMs };
27
28
  }
29
+ /** A flags meta read apart as a marks meta is (`decodeWrunMarkMeta`); null for a value that is no packed meta. */
30
+ export function decodeWrunFlagMeta(meta) {
31
+ const packed = decodeWrunMarkMeta(meta);
32
+ return packed === null ? null : { word: packed.side, count: packed.fills, offsetMs: packed.offsetMs };
33
+ }
28
34
  /** A spans or rays meta read apart, extend as the bit it is (`floor(meta / 256) % 2`, the engine's
29
35
  * read); null for a value that is no packed meta (not a whole number from 0 to 511: a meta past
30
36
  * the extend bit packs a field this chart does not read). */
@@ -61,13 +67,15 @@ export function wrunTimedRecordSpan(record) {
61
67
  }
62
68
  /**
63
69
  * THE number formats a batched template and a marks caption print with, the kit's WRUN_MARK_TEXT_FORMATS (its
64
- * WRUN_BATCHED_TOOLTIP_FORMATS): `compact` (Big Trades 0.3.2's caption, "1.2M", "1.2K"), `price` (the pane's price),
65
- * `int` (rounded), `usd` ("$" before the compact amount, "$12M", "-$1.2K") and `units` (a mark's quantity in the
66
- * market's own unit, `wrunMarkQtyInUnits`, printed compact; in dollars where no unit is proven). The layout gate's
70
+ * WRUN_BATCHED_TOOLTIP_FORMATS): `compact` (Big Trades 0.3.2's caption, "1.2B", "1.2M", "1.2K"), `price` (the pane's
71
+ * price), `int` (rounded), `usd` ("$" before the compact amount, "$12M", "-$1.2K") and `units` (a mark's quantity in
72
+ * the market's own unit, `wrunMarkQtyInUnits`, printed compact; in dollars where no unit is proven). The layout gate's
67
73
  * vocabulary, the engine settings and this readout read this list, and the format type derives from it: a word added
68
74
  * in one hand copy alone refused the section ("Needs a newer chart") or printed the placeholder as written
69
75
  * (tests/utility/wrun/wrun-batched-readout.util.spec.ts holds it to its golden and finds any second spelling of it in
70
- * the package). TitanCharts keeps the engine's own copy for the caption, pinned to the same golden there.
76
+ * the package). TitanCharts keeps the engine's own copy for the caption and a flag's chip (batchedMarks formats.ts):
77
+ * the same spec runs the INSTALLED engine's copy and holds this list and every word's text to it, so a hover always
78
+ * prints a record as its bubble does.
71
79
  */
72
80
  export const WRUN_BATCHED_NUMBER_FORMATS = Object.freeze(['compact', 'price', 'int', 'usd', 'units']);
73
81
  const BATCHED_FORMATS = new Set(WRUN_BATCHED_NUMBER_FORMATS);
@@ -91,7 +99,11 @@ export function wrunMarkQtyInUnits(qty, price, valuePerUnit) {
91
99
  const unit = wrunMarkUnitValue(valuePerUnit);
92
100
  if (unit === undefined || !(Number.isFinite(price) && price > 0))
93
101
  return undefined;
94
- return qty / (price * unit);
102
+ // A product past the doubles (or under them) is no unit either: the caption prints dollars then, so does the hover.
103
+ const perUnit = price * unit;
104
+ if (!(Number.isFinite(perUnit) && perUnit > 0))
105
+ return undefined;
106
+ return qty / perUnit;
95
107
  }
96
108
  /** `tenths` (a whole count of tenths) as "1.5" or "2" (never "2.0"). */
97
109
  function tenthsText(tenths) {
@@ -108,25 +120,34 @@ function amountText(value) {
108
120
  return tenthsText(Math.round(value * 10));
109
121
  return (Math.round(value * 100) / 100).toFixed(2);
110
122
  }
111
- /** A size, at least 0, compact: "1.2M", "1.2K", else the full amount. */
123
+ /** The largest magnitude a compact number shows: a larger one prints as this (the engine caption's VALUE_TEXT_MAX). */
124
+ const COMPACT_MAX = 1e15;
125
+ /** A size, at least 0, compact as the engine captions it: "1.2B", "1.2M", "1.2K", else the full amount; past 1e15
126
+ * as 1e15. */
112
127
  function compactText(size) {
113
- if (size >= 1_000_000)
114
- return `${tenthsText(Math.round(size / 100_000))}M`;
115
- if (size >= 1_000)
116
- return `${tenthsText(Math.round(size / 100))}K`;
117
- return amountText(size);
128
+ const v = Math.min(size, COMPACT_MAX);
129
+ if (v >= 1_000_000_000)
130
+ return `${tenthsText(Math.round(v / 100_000_000))}B`;
131
+ if (v >= 1_000_000)
132
+ return `${tenthsText(Math.round(v / 100_000))}M`;
133
+ if (v >= 1_000)
134
+ return `${tenthsText(Math.round(v / 100))}K`;
135
+ return amountText(v);
118
136
  }
119
- /** A number in a batched format: `compact` is Big Trades 0.3.2's caption ("1.2M", "1.2K", a whole
120
- * number from 100, one decimal from 1, two below 1), `usd` the same after a "$" ("$12M", "-$1.2K"),
121
- * `units` compact (a mark's quantity reaches it converted, `wrunMarkQtyInUnits`), `int` the rounded
122
- * whole number, `price` the pane's price; a negative value keeps its sign. Not finite: '-'. */
137
+ /** A number in a batched format, as the engine captions it: `compact` is Big Trades 0.3.2's caption ("1.2B", "1.2M",
138
+ * "1.2K", a whole number from 100, one decimal from 1, two below 1), `usd` the same after a "$" ("$12M", "-$1.2K"),
139
+ * `units` compact (a mark's quantity reaches it converted, `wrunMarkQtyInUnits`), `int` the whole number (a half
140
+ * away from zero, never "-0"), `price` the pane's price; a negative value keeps its sign. Not finite: '-' (the
141
+ * caption draws nothing). */
123
142
  export function formatWrunBatchedNumber(value, format, formatPrice) {
124
143
  if (!Number.isFinite(value))
125
144
  return '-';
126
145
  if (format === 'price')
127
146
  return formatPrice(value);
128
- if (format === 'int')
129
- return String(Math.round(value));
147
+ if (format === 'int') {
148
+ const whole = Math.sign(value) * Math.round(Math.abs(value));
149
+ return String(whole === 0 ? 0 : whole);
150
+ }
130
151
  const sign = value < 0 ? '-' : '';
131
152
  const size = Math.abs(value);
132
153
  if (format === 'amount')
@@ -146,7 +167,10 @@ const SIDE_WORDS = { 0: 'Sell', 1: 'Buy' };
146
167
  * price), both `{{length}}` (the length in bars, default int) and `{{word}}` (the section's word the meta
147
168
  * names, '' when none); a timed record (stride 5) `{{start}}` and `{{end}}` in place of `{{length}}`,
148
169
  * each the time as the chart prints it (`formatters.formatTime`, else wrun-chart-time.util shifted by
149
- * the display offset the mount door stamped on the readout), its meta its fifth field; `{{label}}` is
170
+ * the display offset the mount door stamped on the readout, read at that time), its meta its fifth field; flags read
171
+ * `{{qty}}` and `{{price}}` as marks do, `{{count}}` (default int) and `{{word}}` (the chip text: the
172
+ * template the meta's word names, its own `{{qty}}` (default compact, the chip's caption), `{{price}}` and
173
+ * `{{count}}` printed from the same record; '' when none); `{{label}}` is
150
174
  * the readout's title. A placeholder
151
175
  * the record does not read, or a format word outside the list, stays as written; a hole (a
152
176
  * non-finite field) prints '-'.
@@ -158,31 +182,61 @@ export function wrunBatchedReadoutText(readout, record, formatters) {
158
182
  };
159
183
  const timed = readout.timed === true && (readout.kind === 'spans' || readout.kind === 'rays');
160
184
  const markMeta = readout.kind === 'marks' ? decodeWrunMarkMeta(field(2)) : null;
185
+ const flagMeta = readout.kind === 'flags' ? decodeWrunFlagMeta(field(2)) : null;
161
186
  const spanMeta = readout.kind === 'spans' || readout.kind === 'rays' ? decodeWrunSpanMeta(field(timed ? TIMED_META : 3)) : null;
162
187
  // A printed time never breaks across the card's lines: its words are joined by no-break spaces.
163
188
  const timeText = (ms) => {
164
189
  const text = formatters.formatTime !== undefined
165
190
  ? formatters.formatTime(ms)
166
- : wrunChartTimeText(ms + (readout.timeOffsetMs ?? 0));
191
+ : wrunChartTimeText(displayWallMs(readout.timeOffsetMs ?? 0, ms));
167
192
  return text === undefined ? '-' : text.replace(/ /g, '\u00a0');
168
193
  };
169
194
  const number = (value, written, fallback) => formatWrunBatchedNumber(value, written !== undefined ? written : fallback, formatters.formatPrice);
195
+ // A record's quantity (marks, flags): `units` in the market's own unit, in dollars where the readout holds no unit or
196
+ // the record no price.
197
+ const qty = (format, fallback) => {
198
+ if (format !== 'units')
199
+ return number(field(1), format, fallback);
200
+ const units = wrunMarkQtyInUnits(field(1), field(0), readout.valuePerUnit);
201
+ return units === undefined ? number(field(1), 'usd', fallback) : number(units, 'units', fallback);
202
+ };
203
+ // A flags record's tokens. Inside its chip text (`inWord`) the quantity defaults to compact, as a caption prints it,
204
+ // and `{{word}}` stays as written.
205
+ const flagToken = (literal, name, format, inWord) => {
206
+ if (format !== undefined && !BATCHED_FORMATS.has(format))
207
+ return literal;
208
+ switch (name) {
209
+ case 'qty':
210
+ return qty(format, inWord ? 'compact' : 'amount');
211
+ case 'price':
212
+ return number(field(0), format, 'price');
213
+ case 'count':
214
+ return flagMeta === null ? '-' : number(flagMeta.count, format, 'int');
215
+ case 'word': {
216
+ if (inWord)
217
+ return literal;
218
+ const word = flagMeta === null ? undefined : readout.words?.[flagMeta.word];
219
+ return word === undefined
220
+ ? ''
221
+ : word.replace(CANVAS_PLACEHOLDER, (inner, token, written) => flagToken(inner, token, written, true));
222
+ }
223
+ default:
224
+ return literal;
225
+ }
226
+ };
170
227
  return readout.tooltip.replace(CANVAS_PLACEHOLDER, (literal, name, format) => {
171
228
  if (format !== undefined && !BATCHED_FORMATS.has(format))
172
229
  return literal;
173
230
  if (name === 'label')
174
231
  return readout.label;
232
+ if (readout.kind === 'flags')
233
+ return flagToken(literal, name, format, false);
175
234
  if (readout.kind === 'marks') {
176
235
  switch (name) {
177
236
  case 'side':
178
237
  return markMeta === null ? '-' : (SIDE_WORDS[markMeta.side] ?? String(markMeta.side));
179
- case 'qty': {
180
- if (format !== 'units')
181
- return number(field(1), format, 'amount');
182
- // The quantity in the market's own unit; dollars where the readout holds no unit or the record no price.
183
- const units = wrunMarkQtyInUnits(field(1), field(0), readout.valuePerUnit);
184
- return units === undefined ? number(field(1), 'usd', 'amount') : number(units, 'units', 'amount');
185
- }
238
+ case 'qty':
239
+ return qty(format, 'amount');
186
240
  case 'price':
187
241
  return number(field(0), format, 'price');
188
242
  case 'fills':
@@ -0,0 +1,8 @@
1
+ /** Banded book inputs (kit 0.109.0). A LEAF (no imports): the packer's width rule rides the boot path. */
2
+ /** A banded book block's f64s per tuple: a band's bid sum and its ask sum. */
3
+ export declare const WRUN_BOOK_BAND_TUPLE_WIDTH = 2;
4
+ /** Whether a source is a `book` input declaring `bands`: its block holds band sums, never the book's levels. */
5
+ export declare function isWrunBandedBookSource(source: {
6
+ readonly source?: unknown;
7
+ readonly bands?: unknown;
8
+ } | undefined): boolean;
@@ -0,0 +1,7 @@
1
+ /** Banded book inputs (kit 0.109.0). A LEAF (no imports): the packer's width rule rides the boot path. */
2
+ /** A banded book block's f64s per tuple: a band's bid sum and its ask sum. */
3
+ export const WRUN_BOOK_BAND_TUPLE_WIDTH = 2;
4
+ /** Whether a source is a `book` input declaring `bands`: its block holds band sums, never the book's levels. */
5
+ export function isWrunBandedBookSource(source) {
6
+ return source?.source === 'book' && source.bands !== undefined;
7
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The one rule for whether a live session can tell two lane values, or two candles, apart: the drain's closed-candle
3
+ * comparison (wrun-live-tick.util `noteRevisedClosedCandles`, a revised closed candle owes a reseed) and the
4
+ * carry-with-build install (wrun-overlay-run.util: a carry built with its rows is kept only while every closed candle
5
+ * it read still reads the same) both read it, so the install falls back to the two steps exactly when a drain would
6
+ * see a revision. Pure functions and constants, no imports.
7
+ */
8
+ /**
9
+ * Whether a session cannot tell two lane values apart: the same value, both
10
+ * NaN, or two finite numbers within float rounding of each other. A control
11
+ * that sums or averages sub-rows rounds another way when its window moves
12
+ * (measured 2026-10-02: 1.9177000000000004 against 1.9177 on a long/short
13
+ * ratio, a candle volume one step apart), and read as a revision that
14
+ * reseeded the whole session on every poll.
15
+ */
16
+ export declare function wrunLaneValuesEqual(x: unknown, y: unknown): boolean;
17
+ /** Whether two candles `[ts, o, h, l, c, v]` read the same: every OHLCV column within lane noise (the stamps are the
18
+ * caller's to match). */
19
+ export declare function wrunCandleEqual(evaluated: ArrayLike<number>, current: ArrayLike<number>): boolean;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The one rule for whether a live session can tell two lane values, or two candles, apart: the drain's closed-candle
3
+ * comparison (wrun-live-tick.util `noteRevisedClosedCandles`, a revised closed candle owes a reseed) and the
4
+ * carry-with-build install (wrun-overlay-run.util: a carry built with its rows is kept only while every closed candle
5
+ * it read still reads the same) both read it, so the install falls back to the two steps exactly when a drain would
6
+ * see a revision. Pure functions and constants, no imports.
7
+ */
8
+ /** The rounding two answers for the same value can differ by, relative to
9
+ * the value, with an absolute floor for a value at zero: far below one price
10
+ * tick, one trade or one cent of notional on any series a lane serves. */
11
+ const WRUN_LANE_VALUE_NOISE = 1e-9;
12
+ const WRUN_LANE_VALUE_NOISE_FLOOR = 1e-12;
13
+ /**
14
+ * Whether a session cannot tell two lane values apart: the same value, both
15
+ * NaN, or two finite numbers within float rounding of each other. A control
16
+ * that sums or averages sub-rows rounds another way when its window moves
17
+ * (measured 2026-10-02: 1.9177000000000004 against 1.9177 on a long/short
18
+ * ratio, a candle volume one step apart), and read as a revision that
19
+ * reseeded the whole session on every poll.
20
+ */
21
+ export function wrunLaneValuesEqual(x, y) {
22
+ if (x === y)
23
+ return true;
24
+ if (typeof x !== 'number' || typeof y !== 'number')
25
+ return false;
26
+ if (x !== x && y !== y)
27
+ return true;
28
+ if (!Number.isFinite(x) || !Number.isFinite(y))
29
+ return false;
30
+ return (Math.abs(x - y) <= Math.max(WRUN_LANE_VALUE_NOISE_FLOOR, WRUN_LANE_VALUE_NOISE * Math.max(Math.abs(x), Math.abs(y))));
31
+ }
32
+ /** Whether two candles `[ts, o, h, l, c, v]` read the same: every OHLCV column within lane noise (the stamps are the
33
+ * caller's to match). */
34
+ export function wrunCandleEqual(evaluated, current) {
35
+ for (let column = 1; column <= 5; column += 1) {
36
+ if (!wrunLaneValuesEqual(Number(evaluated[column]), Number(current[column])))
37
+ return false;
38
+ }
39
+ return true;
40
+ }
@@ -11,6 +11,7 @@
11
11
  * already answers for a cell without a readout: no card.
12
12
  */
13
13
  import type { WrunBatchedMarksKind } from '../../interfaces/wrun-runtime.interface.js';
14
+ import type { DisplayOffset } from '../chart/display-offset.leaf.js';
14
15
  import { type WrunNumberFormatSpec } from './wrun-style-words.util.js';
15
16
  /** A hover readout (a heatmap or matrix with a `tooltip`, or a batched section with one): the
16
17
  * title, the template and the number format the inspector prints the cell or record with. */
@@ -25,8 +26,9 @@ export interface WrunCanvasReadout {
25
26
  words?: string[];
26
27
  /** Spans and rays at stride 5: `[top|y1, bottom|y2, startTs, endTs, meta]`, times in ms. */
27
28
  timed?: true;
28
- /** The display offset (ms) a timed record's `{{start}}` and `{{end}}` print in, stamped by the mount door. */
29
- timeOffsetMs?: number;
29
+ /** The display offset (ms) a timed record's `{{start}}` and `{{end}}` print in, stamped by the mount door: a fixed
30
+ * shift, or the shift at each instant (each time reads its own, a zone moves its clock). */
31
+ timeOffsetMs?: DisplayOffset;
30
32
  /** Marks: the market's dollar unit (US dollars per price unit and size unit, the run's `wrunMarketDollarUnit`),
31
33
  * which `{{qty:units}}` divides a record's dollar value by; stamped by the batched build, absent where none is
32
34
  * proven (`units` then prints dollars). */
@@ -176,13 +176,28 @@ export declare function wrunCellRowsOf(metadata: Pick<WrunIndicatorMetadata, 'in
176
176
  inputIndexes: ReadonlyArray<number>;
177
177
  }>): WrunCellRows;
178
178
  /**
179
- * A windowed landing (wrun-panel-mount.util: a pan-back page or a prefix run landed inside its history
180
- * window) keeps the colour scale its heatmap was drawn with; only a full run samples again. The rows it lands
181
- * take the sample the mounted rows' bounds were picked from, so a Sensitivity re-pick afterwards reads that
182
- * sample instead of walking the landed rows into another basis. A child with no kept sample (one that
183
- * crossed a copy or a trim) still walks its rows on the next re-pick, as before.
179
+ * The colour scale a heatmap child was decided with, carried onto another child: `to` takes the sample `from`'s
180
+ * bounds were picked from, so a Sensitivity re-pick on `to` reads that sample instead of walking `to`'s rows into
181
+ * another basis. The mount's scale hold calls it when a pass of the same picture brings new rows
182
+ * (wrun-panel-mount.util `carryHeatmapScale`: the held child is the pass's own with the decided bounds). A child
183
+ * with no kept sample (one that crossed a copy) still walks its rows on the next re-pick, as before.
184
184
  */
185
- export declare function keepWrunHeatmapScaleSample(from: object, to: object): void;
185
+ export declare function keepWrunHeatmapScaleSample(from: Pick<WrunCanvasChildOverlay, 'settings'>, to: Pick<WrunCanvasChildOverlay, 'settings'>): void;
186
+ /** Whether a heatmap child's colour bounds were picked from a sample kept beside it (`heatmapSamples`), whatever it
187
+ * gave: false for a child whose bounds were all declared and for one that crossed a copy. A mount's merge keeps
188
+ * such a scale on its record, as the engine keeps it on screen. */
189
+ export declare function wrunHeatmapScaleKept(child: Pick<WrunCanvasChildOverlay, 'settings'>): boolean;
190
+ /**
191
+ * Whether the colour bounds a heatmap child shows were given by its kept sample, judged on the sample at the
192
+ * quantile they are read at (`pickCanvasScale`'s `spread`, never the bound numbers): its own bounds at the
193
+ * author's quantile, or, with the viewer's Sensitivity on a child with scale words, the re-pick at that position's
194
+ * quantile. False for a sample with no finite cell, one whose cells all sit at the zero floor, a declared bound or
195
+ * the centre (a grid writing 0 until a late input lands, a window of zero-volume buckets), one where at least the
196
+ * quantile's share of them does, a child with no kept sample, and one whose bounds were all declared: the bounds
197
+ * are then stand-ins or the author's, never a scale the cells chose. The mount holds a scale only when this is true
198
+ * (wrun-panel-mount.util `holdsHeatmapScale`); anything else is decided again by the next pass.
199
+ */
200
+ export declare function wrunHeatmapScaleDecided(child: WrunCanvasChildOverlay, sensitivity: number | undefined): boolean;
186
201
  /** A canvas row as the engine reads it: a plain array. The live book lane
187
202
  * hands typed rows (`Float64Array`, wrunLiveBookRows) the worker run wants,
188
203
  * which the engine's row readers and live merge skip, so the bars fed live
@@ -213,7 +228,9 @@ export declare function wrunHeatmapSensitivityRows(sheet: Pick<WrunIndicatorMeta
213
228
  * re-picked from the child's own scale sample at the position's quantile
214
229
  * (the options heatmap's map); the child's own bounds, the author's exactly,
215
230
  * when no position is set or the child carries no scale words. The centre
216
- * never depends on the quantile, so only `min` and `max` move.
231
+ * never depends on the quantile, so only `min` and `max` move. A mounted
232
+ * record's own bounds and sample are its decided scale's (the mount's scale
233
+ * hold), so a re-pick never reads the rows the canvas holds now.
217
234
  */
218
235
  export declare function wrunHeatmapSensitivityBounds(child: WrunCanvasChildOverlay, sensitivity: number | undefined): {
219
236
  min: number;