@orangecharts/wrun-chart-host 0.4.0 → 0.5.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 (322) hide show
  1. package/README.md +15 -4
  2. package/dist/constants/exchange-names.leaf.d.ts +8 -0
  3. package/dist/constants/exchange-names.leaf.js +101 -0
  4. package/dist/constants/kscript-data-interval-restrictions.constants.d.ts +15 -0
  5. package/dist/constants/kscript-data-interval-restrictions.constants.js +40 -0
  6. package/dist/constants/opra-compliance.constants.d.ts +19 -0
  7. package/dist/constants/opra-compliance.constants.js +19 -0
  8. package/dist/constants/replay-ladder.leaf.d.ts +30 -0
  9. package/dist/constants/replay-ladder.leaf.js +99 -0
  10. package/dist/constants/scriptEditor/cme-official-scripts.constants.d.ts +168 -0
  11. package/dist/constants/scriptEditor/cme-official-scripts.constants.js +398 -0
  12. package/dist/constants/scriptEditor/converted-script-id.leaf.d.ts +8 -0
  13. package/dist/constants/scriptEditor/converted-script-id.leaf.js +10 -0
  14. package/dist/constants/scriptEditor/execution.constants.d.ts +4 -0
  15. package/dist/constants/scriptEditor/execution.constants.js +14 -0
  16. package/dist/constants/wrun-prefix-safe.constants.d.ts +23 -0
  17. package/dist/constants/wrun-prefix-safe.constants.js +26 -0
  18. package/dist/host-env.d.ts +313 -18
  19. package/dist/host-env.js +15 -0
  20. package/dist/host-ports.types.d.ts +853 -16
  21. package/dist/index.d.ts +139 -2
  22. package/dist/index.js +139 -2
  23. package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +31 -0
  24. package/dist/instances/script-engine-worker-ohlcv-transfer.js +164 -0
  25. package/dist/interfaces/market-event.interface.d.ts +231 -0
  26. package/dist/interfaces/market-event.interface.js +15 -0
  27. package/dist/interfaces/opra-realtime.interface.d.ts +70 -134
  28. package/dist/interfaces/opra-realtime.interface.js +34 -59
  29. package/dist/interfaces/replay.interface.d.ts +285 -0
  30. package/dist/interfaces/replay.interface.js +1 -0
  31. package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +1 -0
  32. package/dist/kscript-data/controls/live-ohlcv-merge.util.js +93 -0
  33. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +5 -1
  34. package/dist/kscript-data/controls/live-trades-merge.util.js +2 -2
  35. package/dist/market-data/billing.interface.d.ts +219 -0
  36. package/dist/market-data/billing.interface.js +58 -0
  37. package/dist/market-data/venue-governed.util.d.ts +2 -0
  38. package/dist/market-data/venue-governed.util.js +10 -0
  39. package/dist/market-data/venue.d.ts +122 -0
  40. package/dist/market-data/venue.js +1 -0
  41. package/dist/market-data/venues/index.d.ts +97 -0
  42. package/dist/market-data/venues/index.js +33 -0
  43. package/dist/market-data/venues/opra.contract.copy.json +35 -0
  44. package/dist/market-data/venues/opra.d.ts +70 -0
  45. package/dist/market-data/venues/opra.js +74 -0
  46. package/dist/replay/replayIndicatorRows.d.ts +31 -0
  47. package/dist/replay/replayIndicatorRows.js +117 -0
  48. package/dist/replay/replayLadder.d.ts +85 -0
  49. package/dist/replay/replayLadder.js +388 -0
  50. package/dist/utility/auth/server-clock.util.d.ts +81 -0
  51. package/dist/utility/auth/server-clock.util.js +238 -0
  52. package/dist/utility/chart/builtin-identity.util.d.ts +18 -0
  53. package/dist/utility/chart/builtin-identity.util.js +51 -0
  54. package/dist/utility/chart/cache-alignment.util.d.ts +454 -0
  55. package/dist/utility/chart/cache-alignment.util.js +926 -0
  56. package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +15 -0
  57. package/dist/utility/chart/chart-data-fetch-generation.util.js +22 -0
  58. package/dist/utility/chart/chart-mount-epoch.util.d.ts +5 -0
  59. package/dist/utility/chart/chart-mount-epoch.util.js +29 -0
  60. package/dist/utility/chart/chart-time-domain.util.d.ts +12 -0
  61. package/dist/utility/chart/chart-time-domain.util.js +23 -0
  62. package/dist/utility/chart/color-customization.leaf.d.ts +10 -0
  63. package/dist/utility/chart/color-customization.leaf.js +16 -0
  64. package/dist/utility/chart/footprint-tick-grid.util.d.ts +106 -0
  65. package/dist/utility/chart/footprint-tick-grid.util.js +167 -0
  66. package/dist/utility/chart/gesture-timing.leaf.d.ts +29 -0
  67. package/dist/utility/chart/gesture-timing.leaf.js +29 -0
  68. package/dist/utility/chart/governed-contract-coin.util.d.ts +22 -0
  69. package/dist/utility/chart/governed-contract-coin.util.js +39 -0
  70. package/dist/utility/chart/host-bar-placement.util.d.ts +107 -0
  71. package/dist/utility/chart/host-bar-placement.util.js +447 -0
  72. package/dist/utility/chart/index-host-tier.util.d.ts +31 -0
  73. package/dist/utility/chart/index-host-tier.util.js +118 -0
  74. package/dist/utility/chart/index-mode-admission.util.d.ts +34 -0
  75. package/dist/utility/chart/index-mode-admission.util.js +67 -0
  76. package/dist/utility/chart/indicator-error-message.util.d.ts +35 -0
  77. package/dist/utility/chart/indicator-error-message.util.js +44 -0
  78. package/dist/utility/chart/kscript-apply-fingerprint.util.d.ts +65 -0
  79. package/dist/utility/chart/kscript-apply-fingerprint.util.js +357 -0
  80. package/dist/utility/chart/kscript-chart-flush.leaf.d.ts +22 -0
  81. package/dist/utility/chart/kscript-chart-flush.leaf.js +13 -0
  82. package/dist/utility/chart/kscript-data-interval-restriction.leaf.d.ts +6 -0
  83. package/dist/utility/chart/kscript-data-interval-restriction.leaf.js +27 -0
  84. package/dist/utility/chart/kscript-integration-decision.leaf.d.ts +89 -0
  85. package/dist/utility/chart/kscript-integration-decision.leaf.js +80 -0
  86. package/dist/utility/chart/kscript-live-coalesce.util.d.ts +76 -0
  87. package/dist/utility/chart/kscript-live-coalesce.util.js +156 -0
  88. package/dist/utility/chart/kscript-live-rest-pace.util.d.ts +34 -0
  89. package/dist/utility/chart/kscript-live-rest-pace.util.js +134 -0
  90. package/dist/utility/chart/kscript-live-source-identity.util.d.ts +98 -0
  91. package/dist/utility/chart/kscript-live-source-identity.util.js +121 -0
  92. package/dist/utility/chart/kscript-mounted-plot-set.leaf.d.ts +48 -0
  93. package/dist/utility/chart/kscript-mounted-plot-set.leaf.js +145 -0
  94. package/dist/utility/chart/kscript-perf-tracker.util.d.ts +243 -0
  95. package/dist/utility/chart/kscript-perf-tracker.util.js +522 -0
  96. package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +43 -0
  97. package/dist/utility/chart/kscript-run-interval-projection.util.js +471 -0
  98. package/dist/utility/chart/kscript-run-result-equality.util.d.ts +38 -0
  99. package/dist/utility/chart/kscript-run-result-equality.util.js +89 -0
  100. package/dist/utility/chart/kscript-settings-revision.leaf.d.ts +2 -0
  101. package/dist/utility/chart/kscript-settings-revision.leaf.js +12 -0
  102. package/dist/utility/chart/kscript-source-degrade.leaf.d.ts +63 -0
  103. package/dist/utility/chart/kscript-source-degrade.leaf.js +68 -0
  104. package/dist/utility/chart/kscript-source-retention.util.d.ts +134 -0
  105. package/dist/utility/chart/kscript-source-retention.util.js +218 -0
  106. package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +57 -0
  107. package/dist/utility/chart/kscript-standin-identity.leaf.js +61 -0
  108. package/dist/utility/chart/kscript-titancharts-preparation.util.d.ts +15 -0
  109. package/dist/utility/chart/kscript-titancharts-preparation.util.js +376 -0
  110. package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +9 -0
  111. package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +130 -0
  112. package/dist/utility/chart/kscript-venue-policy.util.d.ts +217 -0
  113. package/dist/utility/chart/kscript-venue-policy.util.js +324 -0
  114. package/dist/utility/chart/live-cadence.util.d.ts +38 -0
  115. package/dist/utility/chart/live-cadence.util.js +37 -0
  116. package/dist/utility/chart/live-feed-series-match.leaf.d.ts +13 -0
  117. package/dist/utility/chart/live-feed-series-match.leaf.js +21 -0
  118. package/dist/utility/chart/local-engine-self-heal-backoff.util.d.ts +46 -0
  119. package/dist/utility/chart/local-engine-self-heal-backoff.util.js +46 -0
  120. package/dist/utility/chart/local-engine-uninit.leaf.d.ts +21 -0
  121. package/dist/utility/chart/local-engine-uninit.leaf.js +22 -0
  122. package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +62 -0
  123. package/dist/utility/chart/local-kscript-source-revalidation.util.js +123 -0
  124. package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +214 -0
  125. package/dist/utility/chart/local-kscript-warmup-depth.util.js +376 -0
  126. package/dist/utility/chart/local-technical-script-live-apply-coalescer.util.d.ts +85 -0
  127. package/dist/utility/chart/local-technical-script-live-apply-coalescer.util.js +197 -0
  128. package/dist/utility/chart/local-technical-script-range.leaf.d.ts +72 -0
  129. package/dist/utility/chart/local-technical-script-range.leaf.js +126 -0
  130. package/dist/utility/chart/mixed-mode.util.d.ts +167 -0
  131. package/dist/utility/chart/mixed-mode.util.js +139 -0
  132. package/dist/utility/chart/ohlcv-row-readiness.util.d.ts +36 -0
  133. package/dist/utility/chart/ohlcv-row-readiness.util.js +90 -0
  134. package/dist/utility/chart/opra-user-scripts-gate.util.d.ts +19 -0
  135. package/dist/utility/chart/opra-user-scripts-gate.util.js +32 -0
  136. package/dist/utility/chart/overlay-execution-guard-key.leaf.d.ts +8 -0
  137. package/dist/utility/chart/overlay-execution-guard-key.leaf.js +10 -0
  138. package/dist/utility/chart/price-precision.util.d.ts +40 -0
  139. package/dist/utility/chart/price-precision.util.js +70 -0
  140. package/dist/utility/chart/profile-block-size.util.d.ts +64 -0
  141. package/dist/utility/chart/profile-block-size.util.js +141 -0
  142. package/dist/utility/chart/protected-kscript-degenerate-rows.leaf.d.ts +11 -0
  143. package/dist/utility/chart/protected-kscript-degenerate-rows.leaf.js +29 -0
  144. package/dist/utility/chart/protected-kscript-empty-output.util.d.ts +28 -0
  145. package/dist/utility/chart/protected-kscript-empty-output.util.js +84 -0
  146. package/dist/utility/chart/run-interval-unservable.leaf.d.ts +9 -0
  147. package/dist/utility/chart/run-interval-unservable.leaf.js +20 -0
  148. package/dist/utility/chart/run-interval-warmup.leaf.d.ts +19 -0
  149. package/dist/utility/chart/run-interval-warmup.leaf.js +35 -0
  150. package/dist/utility/chart/titan-constants.pin.d.ts +9 -5
  151. package/dist/utility/chart/titan-constants.pin.js +18 -5
  152. package/dist/utility/chart/warmup-backfill-retry.leaf.d.ts +9 -0
  153. package/dist/utility/chart/warmup-backfill-retry.leaf.js +9 -0
  154. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +11 -2
  155. package/dist/utility/chart/wrun-bar-session-facts.util.js +10 -3
  156. package/dist/utility/chart/wrun-run-result.util.d.ts +5 -1
  157. package/dist/utility/chart/wrun-run-result.util.js +20 -14
  158. package/dist/utility/common/data-processing.util.d.ts +138 -0
  159. package/dist/utility/common/data-processing.util.js +346 -0
  160. package/dist/utility/common/visible-timeout.util.d.ts +13 -4
  161. package/dist/utility/common/visible-timeout.util.js +23 -8
  162. package/dist/utility/exchange-format.leaf.d.ts +1 -0
  163. package/dist/utility/exchange-format.leaf.js +47 -0
  164. package/dist/utility/market-events/earnings-scope.util.d.ts +60 -0
  165. package/dist/utility/market-events/earnings-scope.util.js +92 -0
  166. package/dist/utility/market-events/market-events.util.d.ts +147 -0
  167. package/dist/utility/market-events/market-events.util.js +392 -0
  168. package/dist/utility/market-events/zoned-clock.util.d.ts +1 -0
  169. package/dist/utility/market-events/zoned-clock.util.js +11 -0
  170. package/dist/utility/options/option-venue-disclosure.util.d.ts +43 -0
  171. package/dist/utility/options/option-venue-disclosure.util.js +56 -0
  172. package/dist/utility/scriptEditor/package-semver.util.d.ts +51 -0
  173. package/dist/utility/scriptEditor/package-semver.util.js +120 -0
  174. package/dist/utility/scriptEditor/temp-script-id.util.d.ts +18 -0
  175. package/dist/utility/scriptEditor/temp-script-id.util.js +25 -0
  176. package/dist/utility/symbol-selection/markets-request-from-symbols.leaf.d.ts +20 -0
  177. package/dist/utility/symbol-selection/markets-request-from-symbols.leaf.js +81 -0
  178. package/dist/utility/v2/governed-tier.leaf.d.ts +103 -0
  179. package/dist/utility/v2/governed-tier.leaf.js +113 -0
  180. package/dist/utility/watchlist/import/import-request.leaf.d.ts +10 -0
  181. package/dist/utility/watchlist/import/import-request.leaf.js +10 -0
  182. package/dist/utility/wrun/sources/lanes/series.js +2 -2
  183. package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +4 -4
  184. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +5 -6
  185. package/dist/utility/wrun/wrun-alert-outputs.registry.d.ts +166 -0
  186. package/dist/utility/wrun/wrun-alert-outputs.registry.js +219 -0
  187. package/dist/utility/wrun/wrun-bar-count.util.d.ts +83 -0
  188. package/dist/utility/wrun/wrun-bar-count.util.js +259 -0
  189. package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +84 -0
  190. package/dist/utility/wrun/wrun-chart-context-names.util.js +186 -0
  191. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +253 -0
  192. package/dist/utility/wrun/wrun-chart-market-facts.util.js +731 -0
  193. package/dist/utility/wrun/wrun-cloud-opra-stamp.util.d.ts +28 -0
  194. package/dist/utility/wrun/wrun-cloud-opra-stamp.util.js +45 -0
  195. package/dist/utility/wrun/wrun-coin-lane-live.util.d.ts +18 -0
  196. package/dist/utility/wrun/wrun-coin-lane-live.util.js +47 -0
  197. package/dist/utility/wrun/wrun-deadline.util.js +2 -1
  198. package/dist/utility/wrun/wrun-debug-output.util.d.ts +39 -0
  199. package/dist/utility/wrun/wrun-debug-output.util.js +63 -0
  200. package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +113 -0
  201. package/dist/utility/wrun/wrun-declared-warmup.util.js +181 -0
  202. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +43 -0
  203. package/dist/utility/wrun/wrun-draft-legend-note.util.js +158 -0
  204. package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +181 -0
  205. package/dist/utility/wrun/wrun-draft-overlay.util.js +357 -0
  206. package/dist/utility/wrun/wrun-draw-skipped.leaf.d.ts +16 -0
  207. package/dist/utility/wrun/wrun-draw-skipped.leaf.js +16 -0
  208. package/dist/utility/wrun/wrun-earnings-facts.util.d.ts +42 -0
  209. package/dist/utility/wrun/wrun-earnings-facts.util.js +131 -0
  210. package/dist/utility/wrun/wrun-first-run-depth.util.d.ts +32 -0
  211. package/dist/utility/wrun/wrun-first-run-depth.util.js +118 -0
  212. package/dist/utility/wrun/wrun-gate-plane-readers.util.d.ts +24 -0
  213. package/dist/utility/wrun/wrun-gate-plane-readers.util.js +31 -0
  214. package/dist/utility/wrun/wrun-held-lanes.util.d.ts +32 -0
  215. package/dist/utility/wrun/wrun-held-lanes.util.js +94 -0
  216. package/dist/utility/wrun/wrun-host-visible-clock.util.d.ts +2 -0
  217. package/dist/utility/wrun/wrun-host-visible-clock.util.js +17 -0
  218. package/dist/utility/wrun/wrun-host.service.d.ts +266 -0
  219. package/dist/utility/wrun/wrun-host.service.js +655 -0
  220. package/dist/utility/wrun/wrun-inert-legend.util.d.ts +33 -0
  221. package/dist/utility/wrun/wrun-inert-legend.util.js +125 -0
  222. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +155 -0
  223. package/dist/utility/wrun/wrun-input-requirements.leaf.js +450 -0
  224. package/dist/utility/wrun/wrun-integration-route.util.d.ts +51 -0
  225. package/dist/utility/wrun/wrun-integration-route.util.js +59 -0
  226. package/dist/utility/wrun/wrun-latest-history.leaf.d.ts +8 -0
  227. package/dist/utility/wrun/wrun-latest-history.leaf.js +8 -0
  228. package/dist/utility/wrun/wrun-legend-hover.lazy.d.ts +12 -0
  229. package/dist/utility/wrun/wrun-legend-hover.lazy.js +96 -0
  230. package/dist/utility/wrun/wrun-lifecycle-runtime.util.d.ts +21 -0
  231. package/dist/utility/wrun/wrun-lifecycle-runtime.util.js +21 -0
  232. package/dist/utility/wrun/wrun-live-hidden-hold.util.d.ts +23 -0
  233. package/dist/utility/wrun/wrun-live-hidden-hold.util.js +13 -0
  234. package/dist/utility/wrun/wrun-live-intake.util.d.ts +374 -0
  235. package/dist/utility/wrun/wrun-live-intake.util.js +2027 -0
  236. package/dist/utility/wrun/wrun-live-patch.util.d.ts +116 -0
  237. package/dist/utility/wrun/wrun-live-patch.util.js +523 -0
  238. package/dist/utility/wrun/wrun-live-tick.util.d.ts +619 -0
  239. package/dist/utility/wrun/wrun-live-tick.util.js +4974 -0
  240. package/dist/utility/wrun/wrun-loading-owner.util.d.ts +58 -0
  241. package/dist/utility/wrun/wrun-loading-owner.util.js +89 -0
  242. package/dist/utility/wrun/wrun-official-scope.leaf.d.ts +29 -0
  243. package/dist/utility/wrun/wrun-official-scope.leaf.js +36 -0
  244. package/dist/utility/wrun/wrun-oi-lane.util.d.ts +27 -0
  245. package/dist/utility/wrun/wrun-oi-lane.util.js +42 -0
  246. package/dist/utility/wrun/wrun-options-stop.util.d.ts +52 -0
  247. package/dist/utility/wrun/wrun-options-stop.util.js +123 -0
  248. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +719 -0
  249. package/dist/utility/wrun/wrun-overlay-drivers.util.js +1180 -0
  250. package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.d.ts +50 -0
  251. package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.js +131 -0
  252. package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +118 -0
  253. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +466 -0
  254. package/dist/utility/wrun/wrun-overlay-metadata.util.d.ts +45 -0
  255. package/dist/utility/wrun/wrun-overlay-metadata.util.js +112 -0
  256. package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +114 -0
  257. package/dist/utility/wrun/wrun-overlay-recovery.util.js +971 -0
  258. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +858 -0
  259. package/dist/utility/wrun/wrun-overlay-run.util.js +11013 -0
  260. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +24 -9
  261. package/dist/utility/wrun/wrun-panel-mount.util.js +138 -43
  262. package/dist/utility/wrun/wrun-param-map.util.d.ts +19 -4
  263. package/dist/utility/wrun/wrun-param-map.util.js +40 -47
  264. package/dist/utility/wrun/wrun-param-values.util.d.ts +9 -3
  265. package/dist/utility/wrun/wrun-param-values.util.js +5 -5
  266. package/dist/utility/wrun/wrun-prefix-cohort.util.d.ts +93 -0
  267. package/dist/utility/wrun/wrun-prefix-cohort.util.js +484 -0
  268. package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +114 -0
  269. package/dist/utility/wrun/wrun-prefix-lanes.util.js +486 -0
  270. package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +317 -0
  271. package/dist/utility/wrun/wrun-prefix-proof.util.js +630 -0
  272. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +73 -0
  273. package/dist/utility/wrun/wrun-refusal-surface.util.js +380 -0
  274. package/dist/utility/wrun/wrun-refusal-text.util.d.ts +15 -0
  275. package/dist/utility/wrun/wrun-refusal-text.util.js +40 -0
  276. package/dist/utility/wrun/wrun-replay-lane.util.d.ts +139 -0
  277. package/dist/utility/wrun/wrun-replay-lane.util.js +520 -0
  278. package/dist/utility/wrun/wrun-replay-rows.util.d.ts +21 -0
  279. package/dist/utility/wrun/wrun-replay-rows.util.js +172 -0
  280. package/dist/utility/wrun/wrun-row-source-factory.d.ts +53 -0
  281. package/dist/utility/wrun/wrun-row-source-factory.js +435 -0
  282. package/dist/utility/wrun/wrun-run-cells.util.d.ts +36 -0
  283. package/dist/utility/wrun/wrun-run-cells.util.js +46 -0
  284. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +133 -0
  285. package/dist/utility/wrun/wrun-run-interval-session.util.js +121 -0
  286. package/dist/utility/wrun/wrun-run-interval.util.d.ts +98 -0
  287. package/dist/utility/wrun/wrun-run-interval.util.js +207 -0
  288. package/dist/utility/wrun/wrun-run-retained.util.d.ts +122 -0
  289. package/dist/utility/wrun/wrun-run-retained.util.js +255 -0
  290. package/dist/utility/wrun/wrun-sandbox-row-source.d.ts +184 -0
  291. package/dist/utility/wrun/wrun-sandbox-row-source.js +444 -0
  292. package/dist/utility/wrun/wrun-script-inputs.util.js +4 -4
  293. package/dist/utility/wrun/wrun-series-stream.util.d.ts +86 -0
  294. package/dist/utility/wrun/wrun-series-stream.util.js +537 -0
  295. package/dist/utility/wrun/wrun-sheet-remembered.util.d.ts +21 -0
  296. package/dist/utility/wrun/wrun-sheet-remembered.util.js +36 -0
  297. package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.d.ts +7 -0
  298. package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.js +12 -0
  299. package/dist/utility/wrun/wrun-socket-row-source.js +4 -2
  300. package/dist/utility/wrun/wrun-source-rows.util.d.ts +175 -3
  301. package/dist/utility/wrun/wrun-source-rows.util.js +294 -8
  302. package/dist/utility/wrun/wrun-stats-strip.util.d.ts +46 -0
  303. package/dist/utility/wrun/wrun-stats-strip.util.js +87 -0
  304. package/dist/utility/wrun/wrun-table-chrome.util.d.ts +163 -0
  305. package/dist/utility/wrun/wrun-table-chrome.util.js +557 -0
  306. package/dist/utility/wrun/wrun-text-params.util.d.ts +11 -6
  307. package/dist/utility/wrun/wrun-text-params.util.js +19 -30
  308. package/dist/utility/wrun/wrun-transient-rerun.util.d.ts +64 -0
  309. package/dist/utility/wrun/wrun-transient-rerun.util.js +317 -0
  310. package/dist/utility/wrun/wrun-twin-lookback.util.d.ts +10 -0
  311. package/dist/utility/wrun/wrun-twin-lookback.util.js +43 -0
  312. package/dist/utility/wrun/wrun-warmup-head-store.util.d.ts +41 -0
  313. package/dist/utility/wrun/wrun-warmup-head-store.util.js +120 -0
  314. package/dist/utility/wrun-alert-params.leaf.d.ts +24 -0
  315. package/dist/utility/wrun-alert-params.leaf.js +24 -0
  316. package/dist/utils/replay/replay-buffer-math.d.ts +148 -0
  317. package/dist/utils/replay/replay-buffer-math.js +684 -0
  318. package/dist/workers/wrun/wrun-abi-host.d.ts +190 -0
  319. package/dist/workers/wrun/wrun-abi-host.js +1201 -0
  320. package/dist/workers/wrun/wrun-engine-handler.d.ts +37 -0
  321. package/dist/workers/wrun/wrun-engine-handler.js +211 -0
  322. package/package.json +3 -3
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Per-chart data-fetch generation counter, in a leaf module on purpose: the
3
+ * counter is read by chart-context tokens (chart-context.util) and by every
4
+ * generation-scoped continuation, and importing it from data-fetching.util
5
+ * dragged that module's whole graph into each consumer. No imports here.
6
+ */
7
+ /** Bumped by every cancelFetchDataOfChart (symbol/interval switch, refetch, teardown). */
8
+ export declare function bumpChartDataFetchGeneration(chartIndex: number): number;
9
+ /**
10
+ * Current data-fetch generation for a chart. Exported for callers that
11
+ * dispatch generation-scoped child fetches (an `IndicatorDataOptions.
12
+ * chartDataFetchGeneration` captured here is invalidated by the next
13
+ * `cancelFetchDataOfChart`) and for the transition-supersede specs.
14
+ */
15
+ export declare function getChartDataFetchGeneration(chartIndex: number): number;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Per-chart data-fetch generation counter, in a leaf module on purpose: the
3
+ * counter is read by chart-context tokens (chart-context.util) and by every
4
+ * generation-scoped continuation, and importing it from data-fetching.util
5
+ * dragged that module's whole graph into each consumer. No imports here.
6
+ */
7
+ const chartDataFetchGenerations = new Map();
8
+ /** Bumped by every cancelFetchDataOfChart (symbol/interval switch, refetch, teardown). */
9
+ export function bumpChartDataFetchGeneration(chartIndex) {
10
+ const nextGeneration = (chartDataFetchGenerations.get(chartIndex) ?? 0) + 1;
11
+ chartDataFetchGenerations.set(chartIndex, nextGeneration);
12
+ return nextGeneration;
13
+ }
14
+ /**
15
+ * Current data-fetch generation for a chart. Exported for callers that
16
+ * dispatch generation-scoped child fetches (an `IndicatorDataOptions.
17
+ * chartDataFetchGeneration` captured here is invalidated by the next
18
+ * `cancelFetchDataOfChart`) and for the transition-supersede specs.
19
+ */
20
+ export function getChartDataFetchGeneration(chartIndex) {
21
+ return chartDataFetchGenerations.get(chartIndex) ?? 0;
22
+ }
@@ -0,0 +1,5 @@
1
+ export declare function getChartMountEpoch(): number;
2
+ /** Makes every run or continuation that captured the epoch before this call stale at its next check. */
3
+ export declare function bumpChartMountEpoch(): number;
4
+ /** Captures the epoch now; the returned check reads false once a workspace switch moved it. */
5
+ export declare function captureMountEpochOwner(): () => boolean;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Mount epoch (warm workspace switch seam). The switch teardown bumps it
3
+ * (destroyChartsForWorkspaceSwitch), and so does a newer click that cancels
4
+ * the incoming mount. Work started for a pane captures it and re-reads it
5
+ * after each await: initializeChart returns there instead of constructing,
6
+ * destroying or painting over the incoming document, and a continuation
7
+ * started for the outgoing layout's pane (the interval switch's hook pass,
8
+ * the overlay's Retry, a journal navigation) writes nothing to the incoming
9
+ * pane at the same index. The instance checks (`tcGroup[i] !== tc`) cannot see
10
+ * work that owns no instance. Nothing else moves it, so an ordinary boot,
11
+ * rebuild or grid change never observes a change.
12
+ *
13
+ * Its own module so a continuation outside the engine host reads it without
14
+ * importing titan-charts (which re-exports both functions for its callers).
15
+ */
16
+ let chartMountEpoch = 0;
17
+ export function getChartMountEpoch() {
18
+ return chartMountEpoch;
19
+ }
20
+ /** Makes every run or continuation that captured the epoch before this call stale at its next check. */
21
+ export function bumpChartMountEpoch() {
22
+ chartMountEpoch += 1;
23
+ return chartMountEpoch;
24
+ }
25
+ /** Captures the epoch now; the returned check reads false once a workspace switch moved it. */
26
+ export function captureMountEpochOwner() {
27
+ const epoch = chartMountEpoch;
28
+ return () => epoch === chartMountEpoch;
29
+ }
@@ -0,0 +1,12 @@
1
+ export declare const MIN_REAL_CHART_TIME_MS: number;
2
+ export declare function isRealChartTimestampMs(value: unknown): value is number;
3
+ export declare function isRealChartTimeRangeMs(start: unknown, end: unknown): start is number;
4
+ /**
5
+ * A calendar chart's window start clamped up to the floor. A month, quarter, half-year or year
6
+ * chart (1M 3M 6M 1Y) zoomed out far enough asks for bars before 1971 (55 bars back on 1Y, 110 on
7
+ * 6M), a time no backend serves: the window starts at `MIN_REAL_CHART_TIME_MS` instead (itself a
8
+ * calendar bar's open, January 1) while it still ends after it. Undefined for every other window:
9
+ * a real one keeps its start, and anything else stays the caller's refusal (on a fixed interval a
10
+ * pre-1971 start is a placeholder or index-domain range, never a real chart's).
11
+ */
12
+ export declare function calendarRangeStartAtFloorMs(interval: unknown, start: unknown, end: unknown): number | undefined;
@@ -0,0 +1,23 @@
1
+ import { isCalendarIntervalLabel } from './calendar-interval.util.js';
2
+ export const MIN_REAL_CHART_TIME_MS = Date.UTC(1971, 0, 1);
3
+ export function isRealChartTimestampMs(value) {
4
+ return typeof value === 'number' && Number.isFinite(value) && value >= MIN_REAL_CHART_TIME_MS;
5
+ }
6
+ export function isRealChartTimeRangeMs(start, end) {
7
+ return isRealChartTimestampMs(start) && isRealChartTimestampMs(end) && start < end;
8
+ }
9
+ /**
10
+ * A calendar chart's window start clamped up to the floor. A month, quarter, half-year or year
11
+ * chart (1M 3M 6M 1Y) zoomed out far enough asks for bars before 1971 (55 bars back on 1Y, 110 on
12
+ * 6M), a time no backend serves: the window starts at `MIN_REAL_CHART_TIME_MS` instead (itself a
13
+ * calendar bar's open, January 1) while it still ends after it. Undefined for every other window:
14
+ * a real one keeps its start, and anything else stays the caller's refusal (on a fixed interval a
15
+ * pre-1971 start is a placeholder or index-domain range, never a real chart's).
16
+ */
17
+ export function calendarRangeStartAtFloorMs(interval, start, end) {
18
+ if (!isCalendarIntervalLabel(interval))
19
+ return undefined;
20
+ if (typeof start !== 'number' || !Number.isFinite(start) || start >= MIN_REAL_CHART_TIME_MS)
21
+ return undefined;
22
+ return isRealChartTimeRangeMs(MIN_REAL_CHART_TIME_MS, end) ? MIN_REAL_CHART_TIME_MS : undefined;
23
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The cleared colour customization flags (a leaf of utility/chart/color-customization.util.ts; P2/inventory.md section
3
+ * 1.1): the patch that hands colour ownership back to the theme, which the wrun executor stamps beside the theme's
4
+ * colours. Pure, no imports, so it moves into the chart-host package with the phase 2 closure; the colour
5
+ * customization module re-exports it.
6
+ */
7
+ export declare function clearedColorCustomizationFlags(): {
8
+ colorsCustomized: false;
9
+ customizedColorIndices: never[];
10
+ };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The cleared colour customization flags (a leaf of utility/chart/color-customization.util.ts; P2/inventory.md section
3
+ * 1.1): the patch that hands colour ownership back to the theme, which the wrun executor stamps beside the theme's
4
+ * colours. Pure, no imports, so it moves into the chart-host package with the phase 2 closure; the colour
5
+ * customization module re-exports it.
6
+ */
7
+ // When a settings dialog re-stamps theme-default colors (plot-type or
8
+ // leg-count changes rebuild the color layout), color ownership returns to the
9
+ // theme. The customization flags must be cleared in the same write: a stale
10
+ // `colorsCustomized` makes every future theme pass skip the overlay, freezing
11
+ // it on the defaults of whatever theme was active at stamp time (mirrors the
12
+ // CvdBySizeSettings precedent). Spread the returned patch into the same
13
+ // settings update that stamps the default colors.
14
+ export function clearedColorCustomizationFlags() {
15
+ return { colorsCustomized: false, customizedColorIndices: [] };
16
+ }
@@ -0,0 +1,106 @@
1
+ /**
2
+ * The tick-grid fold for sparse-block venues (field case 2026-09-14).
3
+ *
4
+ * The gateway derives crypto VOLUME_PROFILE_AGG block sizes from price and
5
+ * snaps them to the exchange tick only for CME, so some venues bucket their
6
+ * profiles on a block FINER than the tick (Binance PUMPUSDT: 3.28125e-7 under
7
+ * a 1e-6 tick; Hyperliquid HIP-3 xyz:SNDK: 0.06 under 0.1). Rows are keyed
8
+ * FLOOR(price / block) * block, so every served level is one traded tick with
9
+ * empty blocks between. The live feed (a separate service) buckets the same
10
+ * trades with integer math at 1e9, so ITS block is truncated (3.28e-7) and its
11
+ * levels drift a fraction of a block BELOW the gateway's exact lows: floored
12
+ * onto the catalog block they land one block low, and the next poll's exact
13
+ * row then merges beside them, doubling every cell (Brian's clip, ring event
14
+ * footprint-forming-max-merge with heldTotal == fetchedTotal, mergedTotal 2x).
15
+ *
16
+ * The tick is the only lattice both lanes can agree on: whichever block a
17
+ * level was bucketed with, its own bucket [level, level + block) holds exactly
18
+ * ONE tick multiple, the price that traded (block < tick). So on these venues
19
+ * both footprint workers and the live fold map every level to that tick price
20
+ * (`tickPriceOfServedLevel`) and fold on the tick instead of the block
21
+ * (`resolveFootprintTickGrid`): "Ticks per bar" then means ticks, which is
22
+ * what the UI says. Two venue classes stay exactly as they were: a block that
23
+ * is a whole fraction of the tick (NEARUSDT 0.0002 under 0.001: per-tick
24
+ * levels already sit on the block lattice, and the live feed's block is exact
25
+ * at 9 decimals) and a block at or above the tick (Binance BTCUSDT 3.0 over
26
+ * 0.1, CME after the exchange-tick move).
27
+ *
28
+ * DOM-free on purpose: imported by the main-thread controls, the worker fetch
29
+ * lane, the worker live fold (aggregated-volume-profile-storage.service) and
30
+ * the settings readout (profileRowSizeField), which is why the anchor identity
31
+ * helpers live here and footprint-anchor-tick.util re-exports them.
32
+ */
33
+ /**
34
+ * True when the served block is FINER than the exchange tick and the tick is
35
+ * not a whole number of blocks: the venue serves one level per traded tick on
36
+ * a lattice the tick prices do not sit on. Unknown or invalid inputs are never
37
+ * sparse (block anchoring, the pre-existing convention).
38
+ */
39
+ export declare function isSparseTickVenue(blockSize: unknown, priceTick: unknown): boolean;
40
+ /**
41
+ * The tick price a served level holds: the unique multiple of `priceTick`
42
+ * inside the level's own bucket [level, level + blockSize), snapped to the
43
+ * tick's decimals. Defensive: a level whose bucket holds no tick multiple (not
44
+ * a per-tick level, or a bucket wider than the block it is tested with) is
45
+ * returned unchanged, never thrown on.
46
+ */
47
+ export declare function tickPriceOfServedLevel(level: number, blockSize: number, priceTick: number): number;
48
+ /** The unit the rows fold on: the exchange tick on a sparse-block venue, the served block elsewhere. */
49
+ export declare function resolveFootprintGridUnit(blockSize: number, priceTick: number | null | undefined): number;
50
+ /**
51
+ * What a persisted anchor is scoped to. The single-venue footprint anchors per
52
+ * instrument (venue + symbol); the aggregated footprint anchors per coin, and
53
+ * ONLY per coin: its settings also carry a `symbol` the shared fetch path
54
+ * stamps on every switch, which must never enter the identity.
55
+ */
56
+ export type FootprintAnchorScope = 'instrument' | 'coin';
57
+ interface FootprintIdentitySettings {
58
+ exchange?: unknown;
59
+ symbol?: unknown;
60
+ coin?: unknown;
61
+ anchorTick?: unknown;
62
+ anchorTickIdentity?: unknown;
63
+ }
64
+ /** The identity a persisted anchor (and an auto row size) belongs to under `scope`. */
65
+ export declare function footprintAnchorIdentity(settings: FootprintIdentitySettings | undefined, scope?: FootprintAnchorScope): string;
66
+ /** The persisted anchor tick when it was inferred for THIS identity, else undefined. */
67
+ export declare function persistedFootprintAnchorTick(settings: FootprintIdentitySettings | undefined, scope?: FootprintAnchorScope): number | undefined;
68
+ /**
69
+ * The tick the footprint workers fold on for these settings (the fetch payload
70
+ * and the live SUBSCRIBE carry the persisted anchor): the anchor when it names
71
+ * the settings' own instrument (Volume Footprint) or coin (Agg. Volume
72
+ * Footprint), else undefined (block fold). Profile overlays carry no anchor.
73
+ */
74
+ export declare function footprintDrawnTick(settings: FootprintIdentitySettings | null | undefined): number | undefined;
75
+ /**
76
+ * The row height a "Ticks per bar" multiplier draws: the tick times the
77
+ * multiplier on a sparse-tick venue (`resolveFootprintTickGrid`, the workers'
78
+ * and the live fold's rule), the block times the multiplier everywhere else.
79
+ * Null for missing or degenerate inputs.
80
+ */
81
+ export declare function footprintDrawnRowHeight(blockSize: unknown, multiplier: unknown, priceTick: unknown): number | null;
82
+ export interface FootprintTickGrid {
83
+ /** The fold unit: the exchange tick. */
84
+ minimumBarHeight: number;
85
+ /** The render height: tick x "Ticks per bar", snapped to 9 significant digits. */
86
+ barHeight: number;
87
+ }
88
+ /**
89
+ * The tick-based grid a sparse-block venue folds on, or null on every other
90
+ * venue (whose grid stays the block and its raw settings product, byte for
91
+ * byte). "Ticks per bar" is read back from the requested heights
92
+ * (`barHeight / minimumBarHeight`, the block times the integer multiplier the
93
+ * settings hold) and rounded back to that integer, which also kills the dust
94
+ * a settings product carries through a division; the render height is never
95
+ * finer than one tick. Both footprint workers and the live fold derive their
96
+ * grid from the same three inputs through this function, which is what keeps
97
+ * the fetched rows, the staged handoff grid, and the live fold on ONE lattice.
98
+ */
99
+ export declare function resolveFootprintTickGrid(minimumBarHeight: unknown, barHeight: unknown, priceTick: unknown): FootprintTickGrid | null;
100
+ /**
101
+ * The same points with every served level replaced by the tick price it holds
102
+ * (`tickPriceOfServedLevel`); volumes, counts, and timestamps ride untouched.
103
+ * Rebuilds rather than mutates: the input is the transport's own buffer.
104
+ */
105
+ export declare function mapServedPointsToTickGrid(points: unknown[], blockSize: number, priceTick: number): unknown[];
106
+ export {};
@@ -0,0 +1,167 @@
1
+ /**
2
+ * The tick-grid fold for sparse-block venues (field case 2026-09-14).
3
+ *
4
+ * The gateway derives crypto VOLUME_PROFILE_AGG block sizes from price and
5
+ * snaps them to the exchange tick only for CME, so some venues bucket their
6
+ * profiles on a block FINER than the tick (Binance PUMPUSDT: 3.28125e-7 under
7
+ * a 1e-6 tick; Hyperliquid HIP-3 xyz:SNDK: 0.06 under 0.1). Rows are keyed
8
+ * FLOOR(price / block) * block, so every served level is one traded tick with
9
+ * empty blocks between. The live feed (a separate service) buckets the same
10
+ * trades with integer math at 1e9, so ITS block is truncated (3.28e-7) and its
11
+ * levels drift a fraction of a block BELOW the gateway's exact lows: floored
12
+ * onto the catalog block they land one block low, and the next poll's exact
13
+ * row then merges beside them, doubling every cell (Brian's clip, ring event
14
+ * footprint-forming-max-merge with heldTotal == fetchedTotal, mergedTotal 2x).
15
+ *
16
+ * The tick is the only lattice both lanes can agree on: whichever block a
17
+ * level was bucketed with, its own bucket [level, level + block) holds exactly
18
+ * ONE tick multiple, the price that traded (block < tick). So on these venues
19
+ * both footprint workers and the live fold map every level to that tick price
20
+ * (`tickPriceOfServedLevel`) and fold on the tick instead of the block
21
+ * (`resolveFootprintTickGrid`): "Ticks per bar" then means ticks, which is
22
+ * what the UI says. Two venue classes stay exactly as they were: a block that
23
+ * is a whole fraction of the tick (NEARUSDT 0.0002 under 0.001: per-tick
24
+ * levels already sit on the block lattice, and the live feed's block is exact
25
+ * at 9 decimals) and a block at or above the tick (Binance BTCUSDT 3.0 over
26
+ * 0.1, CME after the exchange-tick move).
27
+ *
28
+ * DOM-free on purpose: imported by the main-thread controls, the worker fetch
29
+ * lane, the worker live fold (aggregated-volume-profile-storage.service) and
30
+ * the settings readout (profileRowSizeField), which is why the anchor identity
31
+ * helpers live here and footprint-anchor-tick.util re-exports them.
32
+ */
33
+ /** Relative tolerance for "the tick is a whole number of blocks" (float dust on the ratio). */
34
+ const WHOLE_RATIO_TOLERANCE = 1e-6;
35
+ /** Slack on the bucket window, as a fraction of the block: absorbs float dust on the served level. */
36
+ const WINDOW_SLACK = 1e-6;
37
+ function positiveFinite(value) {
38
+ return typeof value === 'number' && Number.isFinite(value) && value > 0;
39
+ }
40
+ // Local, exponent-aware decimal counter (mirrors footprint-band.util.ts): a
41
+ // micro tick stringifies as "1e-7", and an exponent-blind count would snap the
42
+ // tick price to 0 decimals.
43
+ function decimalPlaces(value) {
44
+ if (!Number.isFinite(value))
45
+ return 0;
46
+ const text = String(value);
47
+ const eIndex = text.indexOf('e') !== -1 ? text.indexOf('e') : text.indexOf('E');
48
+ if (eIndex === -1) {
49
+ const dot = text.indexOf('.');
50
+ return dot === -1 ? 0 : text.length - dot - 1;
51
+ }
52
+ const mantissa = text.slice(0, eIndex);
53
+ const exponent = Number(text.slice(eIndex + 1));
54
+ const dot = mantissa.indexOf('.');
55
+ const mantissaDecimals = dot === -1 ? 0 : mantissa.length - dot - 1;
56
+ return Math.max(0, mantissaDecimals - exponent);
57
+ }
58
+ /**
59
+ * True when the served block is FINER than the exchange tick and the tick is
60
+ * not a whole number of blocks: the venue serves one level per traded tick on
61
+ * a lattice the tick prices do not sit on. Unknown or invalid inputs are never
62
+ * sparse (block anchoring, the pre-existing convention).
63
+ */
64
+ export function isSparseTickVenue(blockSize, priceTick) {
65
+ if (!positiveFinite(blockSize) || !positiveFinite(priceTick))
66
+ return false;
67
+ if (!(blockSize < priceTick))
68
+ return false;
69
+ const blocksPerTick = priceTick / blockSize;
70
+ return Math.abs(blocksPerTick - Math.round(blocksPerTick)) > blocksPerTick * WHOLE_RATIO_TOLERANCE;
71
+ }
72
+ /**
73
+ * The tick price a served level holds: the unique multiple of `priceTick`
74
+ * inside the level's own bucket [level, level + blockSize), snapped to the
75
+ * tick's decimals. Defensive: a level whose bucket holds no tick multiple (not
76
+ * a per-tick level, or a bucket wider than the block it is tested with) is
77
+ * returned unchanged, never thrown on.
78
+ */
79
+ export function tickPriceOfServedLevel(level, blockSize, priceTick) {
80
+ if (!Number.isFinite(level) || !positiveFinite(blockSize) || !positiveFinite(priceTick))
81
+ return level;
82
+ const slack = blockSize * WINDOW_SLACK;
83
+ const tickPrice = Number((Math.ceil((level - slack) / priceTick) * priceTick).toFixed(decimalPlaces(priceTick)));
84
+ if (!Number.isFinite(tickPrice))
85
+ return level;
86
+ if (tickPrice < level - slack || tickPrice > level + blockSize * (1 + WINDOW_SLACK))
87
+ return level;
88
+ return tickPrice;
89
+ }
90
+ /** The unit the rows fold on: the exchange tick on a sparse-block venue, the served block elsewhere. */
91
+ export function resolveFootprintGridUnit(blockSize, priceTick) {
92
+ return isSparseTickVenue(blockSize, priceTick) ? priceTick : blockSize;
93
+ }
94
+ /** The identity a persisted anchor (and an auto row size) belongs to under `scope`. */
95
+ export function footprintAnchorIdentity(settings, scope = 'instrument') {
96
+ if (scope === 'coin')
97
+ return `coin|${String(settings?.coin ?? '')}`;
98
+ return `${String(settings?.exchange ?? '')}|${String(settings?.symbol ?? '')}`;
99
+ }
100
+ /** The persisted anchor tick when it was inferred for THIS identity, else undefined. */
101
+ export function persistedFootprintAnchorTick(settings, scope = 'instrument') {
102
+ const tick = settings?.anchorTick;
103
+ if (!positiveFinite(tick))
104
+ return undefined;
105
+ return settings?.anchorTickIdentity === footprintAnchorIdentity(settings, scope) ? tick : undefined;
106
+ }
107
+ /**
108
+ * The tick the footprint workers fold on for these settings (the fetch payload
109
+ * and the live SUBSCRIBE carry the persisted anchor): the anchor when it names
110
+ * the settings' own instrument (Volume Footprint) or coin (Agg. Volume
111
+ * Footprint), else undefined (block fold). Profile overlays carry no anchor.
112
+ */
113
+ export function footprintDrawnTick(settings) {
114
+ if (!settings)
115
+ return undefined;
116
+ return persistedFootprintAnchorTick(settings, 'instrument') ?? persistedFootprintAnchorTick(settings, 'coin');
117
+ }
118
+ /**
119
+ * The row height a "Ticks per bar" multiplier draws: the tick times the
120
+ * multiplier on a sparse-tick venue (`resolveFootprintTickGrid`, the workers'
121
+ * and the live fold's rule), the block times the multiplier everywhere else.
122
+ * Null for missing or degenerate inputs.
123
+ */
124
+ export function footprintDrawnRowHeight(blockSize, multiplier, priceTick) {
125
+ if (!positiveFinite(blockSize) || !positiveFinite(multiplier))
126
+ return null;
127
+ return resolveFootprintTickGrid(blockSize, blockSize * multiplier, priceTick)?.barHeight ?? blockSize * multiplier;
128
+ }
129
+ /**
130
+ * The tick-based grid a sparse-block venue folds on, or null on every other
131
+ * venue (whose grid stays the block and its raw settings product, byte for
132
+ * byte). "Ticks per bar" is read back from the requested heights
133
+ * (`barHeight / minimumBarHeight`, the block times the integer multiplier the
134
+ * settings hold) and rounded back to that integer, which also kills the dust
135
+ * a settings product carries through a division; the render height is never
136
+ * finer than one tick. Both footprint workers and the live fold derive their
137
+ * grid from the same three inputs through this function, which is what keeps
138
+ * the fetched rows, the staged handoff grid, and the live fold on ONE lattice.
139
+ */
140
+ export function resolveFootprintTickGrid(minimumBarHeight, barHeight, priceTick) {
141
+ if (!isSparseTickVenue(minimumBarHeight, priceTick))
142
+ return null;
143
+ const tick = priceTick;
144
+ const ratio = positiveFinite(barHeight) ? barHeight / minimumBarHeight : 1;
145
+ const multiplier = Math.max(1, Math.round(ratio));
146
+ return { minimumBarHeight: tick, barHeight: Number((tick * multiplier).toPrecision(9)) };
147
+ }
148
+ /**
149
+ * The same points with every served level replaced by the tick price it holds
150
+ * (`tickPriceOfServedLevel`); volumes, counts, and timestamps ride untouched.
151
+ * Rebuilds rather than mutates: the input is the transport's own buffer.
152
+ */
153
+ export function mapServedPointsToTickGrid(points, blockSize, priceTick) {
154
+ return points.map((point) => {
155
+ const aggregation = point?.volumeProfileAggregation;
156
+ const profile = aggregation?.profile;
157
+ if (!aggregation || !Array.isArray(profile))
158
+ return point;
159
+ const mapped = profile.slice();
160
+ for (let i = 0; i < mapped.length; i += 3) {
161
+ const level = mapped[i];
162
+ if (typeof level === 'number')
163
+ mapped[i] = tickPriceOfServedLevel(level, blockSize, priceTick);
164
+ }
165
+ return { ...point, volumeProfileAggregation: { ...aggregation, profile: mapped } };
166
+ });
167
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The gesture timing constants (a leaf of utility/chart/viewport-pan-tracking.util.ts; P2/inventory.md section 1.1):
3
+ * the linger that keeps a gesture live between segments and the ceiling of a heavy apply's pan-idle wait, the two
4
+ * numbers the wrun executor's warm-up ask reads. Constants only, no imports, so it moves into the chart-host package
5
+ * with the phase 2 closure; the pan tracking module imports and re-exports both.
6
+ */
7
+ /**
8
+ * Recency window that keeps a gesture "live" between segments. A real
9
+ * pan-back is multi-segment (drag, reversal micro-pause, drag again) and the
10
+ * titan `isGestureActive` getter reads false inside those pauses, so the
11
+ * live-gesture signal below must bridge them: a herd of held applies flushing
12
+ * into a reversal pause is the exact failure the 400ms idle wait allows.
13
+ * Production constant; deliberately NOT coupled to the debug-only
14
+ * PAN_GESTURE_IDLE_MS bracket in lazy-load-debug.util.
15
+ */
16
+ export declare const GESTURE_LINGER_MS = 600;
17
+ /**
18
+ * `maxWaitMs` for HEAVY apply deferrals: heatmap chunk merges, indicator
19
+ * backfill applies, protected result integrations. A real wide-pan gesture
20
+ * runs 10-15s (2026-07-12 dump: 13.8s, 422 pan notes), so the earlier 3-5s
21
+ * caps expired mid-gesture and force-applied wide-span layer mutations; the
22
+ * next frame's first full re-raster of that content then stalled presentation
23
+ * for 5-11 vsyncs with the main thread idle (10 render-bound gaps, worst
24
+ * 184ms, jsBusyMs 0). Holding longer is safe: every call site re-validates
25
+ * request staleness and supersession after the wait, and `idleMs` stays 400
26
+ * so calm-path and post-gesture backfill latency are unchanged. The ceiling
27
+ * exists only to bound a pathological never-idle viewport.
28
+ */
29
+ export declare const HEAVY_APPLY_GESTURE_CEILING_MS = 20000;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The gesture timing constants (a leaf of utility/chart/viewport-pan-tracking.util.ts; P2/inventory.md section 1.1):
3
+ * the linger that keeps a gesture live between segments and the ceiling of a heavy apply's pan-idle wait, the two
4
+ * numbers the wrun executor's warm-up ask reads. Constants only, no imports, so it moves into the chart-host package
5
+ * with the phase 2 closure; the pan tracking module imports and re-exports both.
6
+ */
7
+ /**
8
+ * Recency window that keeps a gesture "live" between segments. A real
9
+ * pan-back is multi-segment (drag, reversal micro-pause, drag again) and the
10
+ * titan `isGestureActive` getter reads false inside those pauses, so the
11
+ * live-gesture signal below must bridge them: a herd of held applies flushing
12
+ * into a reversal pause is the exact failure the 400ms idle wait allows.
13
+ * Production constant; deliberately NOT coupled to the debug-only
14
+ * PAN_GESTURE_IDLE_MS bracket in lazy-load-debug.util.
15
+ */
16
+ export const GESTURE_LINGER_MS = 600;
17
+ /**
18
+ * `maxWaitMs` for HEAVY apply deferrals: heatmap chunk merges, indicator
19
+ * backfill applies, protected result integrations. A real wide-pan gesture
20
+ * runs 10-15s (2026-07-12 dump: 13.8s, 422 pan notes), so the earlier 3-5s
21
+ * caps expired mid-gesture and force-applied wide-span layer mutations; the
22
+ * next frame's first full re-raster of that content then stalled presentation
23
+ * for 5-11 vsyncs with the main thread idle (10 render-bound gaps, worst
24
+ * 184ms, jsBusyMs 0). Holding longer is safe: every call site re-validates
25
+ * request staleness and supersession after the wait, and `idleMs` stays 400
26
+ * so calm-path and post-gesture backfill latency are unchanged. The ceiling
27
+ * exists only to bound a pathological never-idle viewport.
28
+ */
29
+ export const HEAVY_APPLY_GESTURE_CEILING_MS = 20_000;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Coin identity of a CME-governed contract code: the product root ("CLV6" ->
3
+ * "CL", "MNQZ6" -> "MNQ", "CL1!" -> "CL"), or null when the code carries no
4
+ * delivery month. The live-feed stamps every governed frame's `coin` with the
5
+ * root (normalized-symbol prefix), and the VP-family live fold
6
+ * (aggregated-volume-profile-storage) admits a frame only on
7
+ * `subscription.coin === series.coin`, so the chart coin MUST be the root. The
8
+ * crypto prefix guess in getCoin is meaningless on a contract code: "CLV6"
9
+ * matched the Clover token (CLV) and every NYMEX CL profile froze live while
10
+ * candles kept ticking (Delta Profile reports, 2026-08 ticket 305 / 2026-09).
11
+ * The registry also lists contract codes themselves as coins (NQZ6, ESU6: the
12
+ * option underlyings), so a search row's pre-resolved coin can be the contract
13
+ * code; on a governed venue the root always wins over it.
14
+ */
15
+ export declare function governedContractCoin(symbol: string | undefined | null): string | null;
16
+ /**
17
+ * The governed contract root when `exchange` is CME-governed, else null (the
18
+ * caller falls through to its own coin source). One rung for every writer of
19
+ * a chart or cell coin, so a multimode cell and a single chart on the same
20
+ * contract fold live frames on the same identity.
21
+ */
22
+ export declare function governedVenueCoin(exchange: string | undefined | null, symbol: string | undefined | null): string | null;
@@ -0,0 +1,39 @@
1
+ import { isCmeGoverned } from './cme-realtime.util.js';
2
+ import { continuousRootOf } from './continuous-contracts.util.js';
3
+ import { parseCmeContractExpiry } from '../symbol-selection/contract-expiry.util.js';
4
+ // Light, store-free module: the governed rung of the chart coin resolver, shared
5
+ // by `getCoin` (symbol-resolve.util, store-coupled) and the multimode cell
6
+ // writers, which must resolve the same coin synchronously without pulling the
7
+ // chart store, the metadata service or the icon composable into the store graph.
8
+ /**
9
+ * Coin identity of a CME-governed contract code: the product root ("CLV6" ->
10
+ * "CL", "MNQZ6" -> "MNQ", "CL1!" -> "CL"), or null when the code carries no
11
+ * delivery month. The live-feed stamps every governed frame's `coin` with the
12
+ * root (normalized-symbol prefix), and the VP-family live fold
13
+ * (aggregated-volume-profile-storage) admits a frame only on
14
+ * `subscription.coin === series.coin`, so the chart coin MUST be the root. The
15
+ * crypto prefix guess in getCoin is meaningless on a contract code: "CLV6"
16
+ * matched the Clover token (CLV) and every NYMEX CL profile froze live while
17
+ * candles kept ticking (Delta Profile reports, 2026-08 ticket 305 / 2026-09).
18
+ * The registry also lists contract codes themselves as coins (NQZ6, ESU6: the
19
+ * option underlyings), so a search row's pre-resolved coin can be the contract
20
+ * code; on a governed venue the root always wins over it.
21
+ */
22
+ export function governedContractCoin(symbol) {
23
+ if (!symbol)
24
+ return null;
25
+ const continuousRoot = continuousRootOf(symbol);
26
+ if (continuousRoot)
27
+ return continuousRoot;
28
+ const parsed = parseCmeContractExpiry(symbol);
29
+ return parsed?.root || null;
30
+ }
31
+ /**
32
+ * The governed contract root when `exchange` is CME-governed, else null (the
33
+ * caller falls through to its own coin source). One rung for every writer of
34
+ * a chart or cell coin, so a multimode cell and a single chart on the same
35
+ * contract fold live frames on the same identity.
36
+ */
37
+ export function governedVenueCoin(exchange, symbol) {
38
+ return isCmeGoverned(exchange) ? governedContractCoin(symbol) : null;
39
+ }
@@ -0,0 +1,107 @@
1
+ /**
2
+ * The host bar that holds each row: ONE placement for every series that rides another bar grid than the chart it
3
+ * lands on. Since 2026-09-16 a regular-session US stock's 45m to 12h bars open on the 09:30 New York anchor (13:30Z
4
+ * hours in EDT, the session's last bar a stub closing at 16:00), while a 24/7 series buckets on the UTC grid (:00
5
+ * hours). A row matched to the host's bars by its exact timestamp never lands there; this module puts each row in
6
+ * the host bar whose [open, close) holds it, through the host's own bucket function (`liveBucketStartMs` over
7
+ * `liveBucketVenueOf(<host metadata>)`), and merges a bar's rows by the series' kind.
8
+ *
9
+ * Its readers: the app's overlay doors (`filterIndicatorData`'s index branch, the cache paint, the live doors), the
10
+ * kScript source alignment (`dataFetch`) and the wrun row builder's grid and trades legs (`wrun-source-rows.util`),
11
+ * so the package and the app place a row the same way. The app re-exports every name from `overlay-grid-rule.util`.
12
+ *
13
+ * The code below is the app's placement as the anchored-host fix round left it (015defa671), moved byte for byte
14
+ * apart from its import paths.
15
+ *
16
+ * Pure: the package's bucket function and session option, nothing else.
17
+ */
18
+ import { type LiveBucketVenue } from './live-bucket.util.js';
19
+ /**
20
+ * How a host merges what lands in one of its bars: `flow` sums the rows,
21
+ * `level` keeps the last row, `candle` folds OHLCV rows into one candle, and
22
+ * `cells` (rows of time-stamped cells: a trade tape, option prints) places
23
+ * each CELL by its own instant, its offset rebased to the bar's open.
24
+ */
25
+ export type IndexHostMerge = 'flow' | 'level' | 'candle' | 'cells';
26
+ /** An index-mode host's bars as the placement reads them. */
27
+ export interface IndexHostBars {
28
+ /** The mounted main candles, ascending by timestamp (ms). */
29
+ mainRows: readonly number[][];
30
+ /** The chart interval in ms. */
31
+ intervalMs: number;
32
+ /** The host chart's bar-grid identity (`liveBucketVenueOf(metadata)`); absent, the UTC floor. */
33
+ venue?: LiveBucketVenue | null;
34
+ }
35
+ /**
36
+ * The row one host bar shows for the rows it holds, in timestamp order (the
37
+ * merge `placeRowsInHostBars` runs per bar): a single row stamped on the bar's
38
+ * open is itself, anything else a new row (`flow` sums, `level` keeps the
39
+ * last, `candle` folds). Exported for a live door that re-places one bar
40
+ * from its own rows, with no bucket call.
41
+ */
42
+ export declare function hostBarRowOf(barTs: number, rows: readonly number[][], merge: Exclude<IndexHostMerge, 'cells'>): number[];
43
+ /** Options of `placeRowsInHostBars`. */
44
+ export interface PlaceRowsInHostBarsOptions {
45
+ /**
46
+ * The span of each row: the rows' OWN interval (their wire interval, never
47
+ * the chart's; a 1m leg on a 5m chart passes 1m). With it a row lands in the
48
+ * host bar holding its LAST instant (`ts + rowSpanMs - 1`), so a closed host
49
+ * bar holds only values known by its close (TradingView's `request.security`
50
+ * with lookahead off): a 24/7 hour [14:00, 15:00) lands in a stock's 14:30
51
+ * bar, never in the 13:30 bar it opens in, and the 15:30 stub holds the
52
+ * [15:00, 16:00) hour. A row stamped on a host bar's open stays in that bar
53
+ * (a series on the host grid comes back as the same objects); a row whose
54
+ * last instant falls in a bar the host has not printed yet (still forming at
55
+ * the live edge) lands in the bar holding its open, so the forming bar shows
56
+ * the latest value; any other row is dropped. Without it a row lands in the
57
+ * bar holding its open (the overlay doors' tier rows sit inside one host bar).
58
+ */
59
+ rowSpanMs?: number;
60
+ /**
61
+ * The host bar forming NOW (`liveBucketStartMs` of the server clock's now),
62
+ * or null when the chart is not live (go-to-date history). The live-edge
63
+ * rule of `rowSpanMs` applies only to a row whose open falls in this bar;
64
+ * absent or null, no row takes it.
65
+ */
66
+ formingBarTs?: number | null;
67
+ }
68
+ /**
69
+ * Place every row in the host bar whose [open, close) holds its timestamp and
70
+ * merge each bar's rows (`merge`: a flow sums, a level keeps the last row, a
71
+ * candle opens on the first row, spans the rows' high and low, closes on the
72
+ * last and sums the volume).
73
+ * A row stamped on a bar lands on it; any other row lands on the last bar
74
+ * opening before it when that bar is still open at the row's instant: a bar
75
+ * whose successor opens exactly one interval later spans the gap between them,
76
+ * and any other bar (the session's stub before the close, a bar before a
77
+ * halt, a session-long bar at 8h or 12h, the last bar) asks the host's own
78
+ * bucket function (`liveBucketStartMs` over `venue`) once per bar span, not
79
+ * once per row (`heldRowsAfterOpen`). Rows before the first bar, off session
80
+ * or in a bar the host does not hold are dropped. A bar holding one row
81
+ * stamped on it keeps that row object, so a series already on the host grid
82
+ * comes back as the exact timestamp filter returned it; every other bar's row
83
+ * is new and is handed to `onMade`. `opts.rowSpanMs` places each row by its
84
+ * last instant instead (`PlaceRowsInHostBarsOptions`).
85
+ */
86
+ export declare function placeRowsInHostBars(rows: readonly number[][], bars: IndexHostBars, merge: IndexHostMerge, onMade?: (row: number[]) => void, opts?: PlaceRowsInHostBarsOptions): number[][];
87
+ /**
88
+ * A host's bucket function for a stream of instants (a live door's ticks):
89
+ * `liveBucketStartMs` over `venue` at `intervalMs`, asked only when an instant
90
+ * leaves the span it last resolved. A bar's span is [its start, its true
91
+ * end): the interval, cut at the session close for a stub bar (the end found
92
+ * once per bar by bisection on the minute grid every session boundary sits
93
+ * on); an off-session instant resolves to null for its own minute. So 1,000
94
+ * ticks inside one bar ask the bucket function a handful of times (on a
95
+ * regular-session stock above 30m each call is several time-zone
96
+ * conversions), never once per tick.
97
+ *
98
+ * A bar whose instants do not all sit in [stamp, end) misses that span: a CME
99
+ * trade-date bar (1D, 3D, 1W and the months, stamped 00:00Z) opens at 22:00Z
100
+ * or 23:00Z the evening before its stamp, and a regular-session stock's 3D bar
101
+ * holds three sessions with nights between them. Each bar's end is therefore
102
+ * remembered (the last few bars a door met), so such a miss costs the one
103
+ * bucket call that names the bar, never the end's bisection again.
104
+ */
105
+ export declare function createHostBucketResolver(intervalMs: number, venue: LiveBucketVenue | null | undefined): (tsMs: number) => number | null;
106
+ /** The shared `createHostBucketResolver` of a host grid (every live door on that grid reuses its cached span). */
107
+ export declare function hostBucketResolverFor(intervalMs: number, venue: LiveBucketVenue | null | undefined): (tsMs: number) => number | null;