@orangecharts/wrun-chart-host 0.11.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (311) hide show
  1. package/README.md +1 -0
  2. package/dist/constants/feature-flags.constants.d.ts +3 -4
  3. package/dist/constants/feature-flags.constants.js +34 -52
  4. package/dist/constants/feature-limits.constants.d.ts +1 -1
  5. package/dist/constants/feature-limits.constants.js +5 -4
  6. package/dist/constants/interval.constants.d.ts +7 -0
  7. package/dist/constants/interval.constants.js +7 -0
  8. package/dist/constants/scriptEditor/cme-official-scripts.constants.d.ts +20 -149
  9. package/dist/constants/scriptEditor/cme-official-scripts.constants.js +20 -309
  10. package/dist/constants/stocks-compliance.constants.d.ts +15 -0
  11. package/dist/constants/stocks-compliance.constants.js +15 -0
  12. package/dist/host-env.d.ts +55 -3
  13. package/dist/host-env.js +6 -0
  14. package/dist/host-ports.types.d.ts +36 -3
  15. package/dist/index.d.ts +18 -0
  16. package/dist/index.js +19 -0
  17. package/dist/indicators/controls/tpo-session.util.d.ts +78 -15
  18. package/dist/indicators/controls/tpo-session.util.js +320 -242
  19. package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +6 -0
  20. package/dist/instances/script-engine-worker-ohlcv-transfer.js +16 -0
  21. package/dist/interfaces/cme-realtime.interface.d.ts +8 -0
  22. package/dist/interfaces/cme-realtime.interface.js +2 -1
  23. package/dist/interfaces/feed.interface.d.ts +15 -1
  24. package/dist/interfaces/replay.interface.d.ts +5 -0
  25. package/dist/interfaces/stocks-realtime.interface.d.ts +4 -3
  26. package/dist/interfaces/stocks-realtime.interface.js +5 -4
  27. package/dist/interfaces/wrun-runtime.interface.d.ts +97 -19
  28. package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +17 -0
  29. package/dist/kscript-data/controls/live-ohlcv-merge.util.js +22 -0
  30. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +46 -40
  31. package/dist/kscript-data/controls/live-trades-merge.util.js +80 -107
  32. package/dist/market-data/billing.interface.d.ts +9 -1
  33. package/dist/market-data/venue.d.ts +1 -1
  34. package/dist/market-data/venues/index.d.ts +4 -4
  35. package/dist/market-data/venues/stocks.contract.copy.json +4 -4
  36. package/dist/market-data/venues/stocks.d.ts +4 -4
  37. package/dist/market-data/venues/stocks.js +15 -13
  38. package/dist/settings-templates/frvp-fields.d.ts +12 -1
  39. package/dist/settings-templates/frvp-fields.js +15 -4
  40. package/dist/settings-templates/index.js +12 -5
  41. package/dist/settings-templates/indicator-fields.js +28 -2
  42. package/dist/settings-templates/tool-rules.d.ts +17 -8
  43. package/dist/settings-templates/tool-rules.js +15 -8
  44. package/dist/settings-templates/tool-tables.generated.js +4 -2
  45. package/dist/utility/auth/server-clock.util.d.ts +3 -1
  46. package/dist/utility/auth/server-clock.util.js +3 -1
  47. package/dist/utility/chart/book-live-bucket.util.js +2 -2
  48. package/dist/utility/chart/cache-alignment.util.d.ts +15 -7
  49. package/dist/utility/chart/cache-alignment.util.js +14 -7
  50. package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +2 -0
  51. package/dist/utility/chart/chart-data-fetch-generation.util.js +16 -0
  52. package/dist/utility/chart/cme-session-bucket.util.d.ts +18 -75
  53. package/dist/utility/chart/cme-session-bucket.util.js +25 -332
  54. package/dist/utility/chart/continuous-contracts.util.js +6 -5
  55. package/dist/utility/chart/display-offset.leaf.d.ts +24 -0
  56. package/dist/utility/chart/display-offset.leaf.js +41 -0
  57. package/dist/utility/chart/effective-chart-session.util.d.ts +2 -1
  58. package/dist/utility/chart/effective-chart-session.util.js +13 -5
  59. package/dist/utility/chart/feed-interval.util.d.ts +6 -20
  60. package/dist/utility/chart/feed-interval.util.js +13 -22
  61. package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +27 -7
  62. package/dist/utility/chart/fetch-dedupe-policy.util.js +86 -11
  63. package/dist/utility/chart/host-bar-placement.util.d.ts +7 -4
  64. package/dist/utility/chart/host-bar-placement.util.js +8 -2
  65. package/dist/utility/chart/indicator-inflight-registry.util.d.ts +32 -0
  66. package/dist/utility/chart/indicator-inflight-registry.util.js +52 -0
  67. package/dist/utility/chart/indicator-run-interval.util.d.ts +10 -4
  68. package/dist/utility/chart/indicator-run-interval.util.js +21 -12
  69. package/dist/utility/chart/interval-registry.util.d.ts +1 -1
  70. package/dist/utility/chart/interval-registry.util.js +1 -1
  71. package/dist/utility/chart/kscript-legend-entries.util.d.ts +12 -0
  72. package/dist/utility/chart/kscript-legend-entries.util.js +16 -0
  73. package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +1 -1
  74. package/dist/utility/chart/kscript-run-interval-projection.util.js +4 -2
  75. package/dist/utility/chart/kscript-venue-policy.util.d.ts +53 -62
  76. package/dist/utility/chart/kscript-venue-policy.util.js +85 -94
  77. package/dist/utility/chart/live-bucket.util.d.ts +39 -17
  78. package/dist/utility/chart/live-bucket.util.js +103 -57
  79. package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +58 -20
  80. package/dist/utility/chart/local-kscript-source-revalidation.util.js +98 -23
  81. package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +35 -11
  82. package/dist/utility/chart/local-kscript-warmup-depth.util.js +24 -3
  83. package/dist/utility/chart/market-session-schedule.util.d.ts +8 -0
  84. package/dist/utility/chart/market-session-schedule.util.js +39 -1
  85. package/dist/utility/chart/market-session.util.d.ts +136 -0
  86. package/dist/utility/chart/market-session.util.js +341 -0
  87. package/dist/utility/chart/market-sessions.util.d.ts +83 -0
  88. package/dist/utility/chart/market-sessions.util.js +220 -0
  89. package/dist/utility/chart/om-panel.util.d.ts +5 -3
  90. package/dist/utility/chart/om-panel.util.js +42 -7
  91. package/dist/utility/chart/om-target.util.d.ts +14 -1
  92. package/dist/utility/chart/om-target.util.js +22 -5
  93. package/dist/utility/chart/opra-read-access.leaf.d.ts +16 -1
  94. package/dist/utility/chart/opra-read-access.leaf.js +22 -0
  95. package/dist/utility/chart/profile-row-height.util.d.ts +49 -16
  96. package/dist/utility/chart/profile-row-height.util.js +74 -37
  97. package/dist/utility/chart/rth-session.util.d.ts +55 -20
  98. package/dist/utility/chart/rth-session.util.js +94 -46
  99. package/dist/utility/chart/session-interval.util.d.ts +2 -1
  100. package/dist/utility/chart/session-interval.util.js +1 -3
  101. package/dist/utility/chart/session-lattice.util.d.ts +150 -0
  102. package/dist/utility/chart/session-lattice.util.js +488 -0
  103. package/dist/utility/chart/trading-day.util.d.ts +40 -2
  104. package/dist/utility/chart/trading-day.util.js +84 -7
  105. package/dist/utility/chart/us-equities-session.util.d.ts +32 -11
  106. package/dist/utility/chart/us-equities-session.util.js +44 -15
  107. package/dist/utility/chart/window-geometry.leaf.d.ts +28 -7
  108. package/dist/utility/chart/window-geometry.leaf.js +57 -8
  109. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +21 -14
  110. package/dist/utility/chart/wrun-bar-session-facts.util.js +32 -38
  111. package/dist/utility/chart/wrun-run-result.util.d.ts +29 -12
  112. package/dist/utility/chart/wrun-run-result.util.js +89 -25
  113. package/dist/utility/common/time.util.js +5 -4
  114. package/dist/utility/market-events/earnings-scope.util.d.ts +10 -5
  115. package/dist/utility/market-events/earnings-scope.util.js +17 -9
  116. package/dist/utility/market-events/market-events.util.d.ts +14 -7
  117. package/dist/utility/market-events/market-events.util.js +30 -17
  118. package/dist/utility/number-format.util.d.ts +14 -21
  119. package/dist/utility/number-format.util.js +38 -24
  120. package/dist/utility/options/option-venue-disclosure.util.d.ts +40 -6
  121. package/dist/utility/options/option-venue-disclosure.util.js +71 -11
  122. package/dist/utility/options/option-venue.util.d.ts +1 -1
  123. package/dist/utility/options/option-venue.util.js +1 -1
  124. package/dist/utility/pool-symbol.leaf.d.ts +7 -0
  125. package/dist/utility/pool-symbol.leaf.js +50 -5
  126. package/dist/utility/stocks/stock-display.util.d.ts +15 -0
  127. package/dist/utility/stocks/stock-display.util.js +37 -0
  128. package/dist/utility/symbol-selection/contract-expiry.util.js +5 -4
  129. package/dist/utility/v2/gate-plane.util.d.ts +6 -0
  130. package/dist/utility/v2/gate-plane.util.js +11 -1
  131. package/dist/utility/v2/gate-session-latch.util.d.ts +1 -1
  132. package/dist/utility/v2/gate-session-latch.util.js +3 -3
  133. package/dist/utility/v2/governed-tier.leaf.d.ts +17 -16
  134. package/dist/utility/v2/governed-tier.leaf.js +17 -16
  135. package/dist/utility/v2/stocks-governed.util.d.ts +5 -0
  136. package/dist/utility/v2/stocks-governed.util.js +14 -0
  137. package/dist/utility/v2/v2-enums.leaf.d.ts +13 -0
  138. package/dist/utility/v2/v2-enums.leaf.js +458 -0
  139. package/dist/utility/wrun/derived-roots.leaf.d.ts +21 -1
  140. package/dist/utility/wrun/derived-roots.leaf.js +27 -1
  141. package/dist/utility/wrun/derived-roots.util.d.ts +44 -32
  142. package/dist/utility/wrun/derived-roots.util.js +97 -56
  143. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -3
  144. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -3
  145. package/dist/utility/wrun/sources/lanes/option_daily.d.ts +2 -1
  146. package/dist/utility/wrun/sources/lanes/option_daily.js +2 -1
  147. package/dist/utility/wrun/sources/lanes/options_flow.d.ts +3 -0
  148. package/dist/utility/wrun/sources/lanes/options_flow.js +23 -5
  149. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +3 -4
  150. package/dist/utility/wrun/sources/row-lane-registry.js +9 -4
  151. package/dist/utility/wrun/sources/row-lanes/dark_pool.d.ts +19 -0
  152. package/dist/utility/wrun/sources/row-lanes/dark_pool.js +104 -0
  153. package/dist/utility/wrun/sources/row-lanes/index.js +2 -0
  154. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.d.ts +20 -0
  155. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.js +103 -0
  156. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -2
  157. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +15 -13
  158. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +49 -23
  159. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +14 -9
  160. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +75 -27
  161. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +139 -82
  162. package/dist/utility/wrun/wrun-app-layer.leaf.d.ts +78 -0
  163. package/dist/utility/wrun/wrun-app-layer.leaf.js +89 -0
  164. package/dist/utility/wrun/wrun-bar-count.util.d.ts +11 -7
  165. package/dist/utility/wrun/wrun-bar-count.util.js +12 -8
  166. package/dist/utility/wrun/wrun-batched-kinds.leaf.d.ts +13 -0
  167. package/dist/utility/wrun/wrun-batched-kinds.leaf.js +18 -0
  168. package/dist/utility/wrun/wrun-batched-marks.util.d.ts +41 -22
  169. package/dist/utility/wrun/wrun-batched-marks.util.js +255 -59
  170. package/dist/utility/wrun/wrun-batched-readout.util.d.ts +26 -19
  171. package/dist/utility/wrun/wrun-batched-readout.util.js +81 -27
  172. package/dist/utility/wrun/wrun-book-bands.leaf.d.ts +8 -0
  173. package/dist/utility/wrun/wrun-book-bands.leaf.js +7 -0
  174. package/dist/utility/wrun/wrun-candle-equal.leaf.d.ts +19 -0
  175. package/dist/utility/wrun/wrun-candle-equal.leaf.js +40 -0
  176. package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -2
  177. package/dist/utility/wrun/wrun-canvases.util.js +7 -3
  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-inert-legend.util.d.ts +13 -0
  209. package/dist/utility/wrun/wrun-inert-legend.util.js +31 -3
  210. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +7 -5
  211. package/dist/utility/wrun/wrun-input-requirements.leaf.js +16 -6
  212. package/dist/utility/wrun/wrun-install-pacer.util.d.ts +26 -0
  213. package/dist/utility/wrun/wrun-install-pacer.util.js +145 -0
  214. package/dist/utility/wrun/wrun-kit-refusal-stages.types.d.ts +22 -0
  215. package/dist/utility/wrun/wrun-kit-refusal-stages.types.js +1 -0
  216. package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +12 -5
  217. package/dist/utility/wrun/wrun-lane-refusal.leaf.js +23 -5
  218. package/dist/utility/wrun/wrun-lane-warmup.util.js +22 -4
  219. package/dist/utility/wrun/wrun-leg-close.util.d.ts +6 -5
  220. package/dist/utility/wrun/wrun-leg-close.util.js +11 -9
  221. package/dist/utility/wrun/wrun-leg-fetch.util.d.ts +3 -1
  222. package/dist/utility/wrun/wrun-leg-fetch.util.js +9 -2
  223. package/dist/utility/wrun/wrun-levels-child.util.d.ts +2 -0
  224. package/dist/utility/wrun/wrun-levels-child.util.js +6 -0
  225. package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -0
  226. package/dist/utility/wrun/wrun-live-intake.util.d.ts +15 -6
  227. package/dist/utility/wrun/wrun-live-intake.util.js +167 -47
  228. package/dist/utility/wrun/wrun-live-tick.util.d.ts +52 -8
  229. package/dist/utility/wrun/wrun-live-tick.util.js +648 -97
  230. package/dist/utility/wrun/wrun-market-facts.util.d.ts +16 -2
  231. package/dist/utility/wrun/wrun-market-facts.util.js +32 -3
  232. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +27 -27
  233. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +28 -16
  234. package/dist/utility/wrun/wrun-market-size-defaults.util.js +34 -5
  235. package/dist/utility/wrun/wrun-oi-lane.util.d.ts +10 -7
  236. package/dist/utility/wrun/wrun-oi-lane.util.js +16 -10
  237. package/dist/utility/wrun/wrun-option-strike-flow.util.js +1 -1
  238. package/dist/utility/wrun/wrun-option-views.util.d.ts +2 -2
  239. package/dist/utility/wrun/wrun-option-views.util.js +5 -2
  240. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.d.ts +5 -0
  241. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.js +16 -0
  242. package/dist/utility/wrun/wrun-options-stop.util.d.ts +3 -2
  243. package/dist/utility/wrun/wrun-options-stop.util.js +6 -4
  244. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +75 -11
  245. package/dist/utility/wrun/wrun-overlay-drivers.util.js +176 -43
  246. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +20 -10
  247. package/dist/utility/wrun/wrun-overlay-park.util.d.ts +84 -0
  248. package/dist/utility/wrun/wrun-overlay-park.util.js +135 -0
  249. package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +37 -4
  250. package/dist/utility/wrun/wrun-overlay-recovery.util.js +26 -14
  251. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +239 -24
  252. package/dist/utility/wrun/wrun-overlay-run.util.js +2204 -405
  253. package/dist/utility/wrun/wrun-pack.util.d.ts +8 -5
  254. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +2 -1
  255. package/dist/utility/wrun/wrun-panel-mount.util.js +20 -14
  256. package/dist/utility/wrun/wrun-panel-style.util.d.ts +4 -2
  257. package/dist/utility/wrun/wrun-panel-style.util.js +3 -2
  258. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +7 -0
  259. package/dist/utility/wrun/wrun-pin-spelling.util.js +18 -4
  260. package/dist/utility/wrun/wrun-pin-venues.util.d.ts +26 -17
  261. package/dist/utility/wrun/wrun-pin-venues.util.js +43 -36
  262. package/dist/utility/wrun/wrun-pinned-lanes.util.d.ts +58 -0
  263. package/dist/utility/wrun/wrun-pinned-lanes.util.js +72 -0
  264. package/dist/utility/wrun/wrun-prefix-cohort.util.js +2 -1
  265. package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +22 -9
  266. package/dist/utility/wrun/wrun-prefix-lanes.util.js +145 -26
  267. package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +29 -0
  268. package/dist/utility/wrun/wrun-prefix-proof.util.js +23 -5
  269. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +9 -1
  270. package/dist/utility/wrun/wrun-refusal-surface.util.js +15 -1
  271. package/dist/utility/wrun/wrun-refusal.util.d.ts +19 -1
  272. package/dist/utility/wrun/wrun-refusal.util.js +103 -16
  273. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +20 -6
  274. package/dist/utility/wrun/wrun-registry-errors.util.js +20 -6
  275. package/dist/utility/wrun/wrun-replay-rows.util.js +6 -10
  276. package/dist/utility/wrun/wrun-run-health.util.d.ts +89 -2
  277. package/dist/utility/wrun/wrun-run-health.util.js +204 -1
  278. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +2 -2
  279. package/dist/utility/wrun/wrun-run-interval-session.util.js +2 -2
  280. package/dist/utility/wrun/wrun-run-interval.util.d.ts +9 -8
  281. package/dist/utility/wrun/wrun-run-interval.util.js +13 -11
  282. package/dist/utility/wrun/wrun-sandbox-row-source.js +5 -2
  283. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +13 -3
  284. package/dist/utility/wrun/wrun-script-inputs.util.js +51 -13
  285. package/dist/utility/wrun/wrun-session-composition.util.d.ts +81 -0
  286. package/dist/utility/wrun/wrun-session-composition.util.js +169 -0
  287. package/dist/utility/wrun/wrun-setting-words.util.d.ts +10 -7
  288. package/dist/utility/wrun/wrun-setting-words.util.js +25 -7
  289. package/dist/utility/wrun/wrun-source-rows.util.d.ts +94 -28
  290. package/dist/utility/wrun/wrun-source-rows.util.js +738 -93
  291. package/dist/utility/wrun/wrun-stream-clock.util.d.ts +45 -0
  292. package/dist/utility/wrun/wrun-stream-clock.util.js +108 -0
  293. package/dist/utility/wrun/wrun-tape-coins.util.d.ts +116 -0
  294. package/dist/utility/wrun/wrun-tape-coins.util.js +110 -0
  295. package/dist/utility/wrun/wrun-tape-source.util.d.ts +62 -32
  296. package/dist/utility/wrun/wrun-tape-source.util.js +72 -34
  297. package/dist/utility/wrun/wrun-tier-grid.util.d.ts +13 -5
  298. package/dist/utility/wrun/wrun-tier-grid.util.js +23 -13
  299. package/dist/utility/wrun/wrun-tpo-rows.util.js +2 -1
  300. package/dist/utility/wrun/wrun-trades-lane.util.d.ts +73 -0
  301. package/dist/utility/wrun/wrun-trades-lane.util.js +82 -0
  302. package/dist/utility/wrun/wrun-twin-compute-inputs.util.d.ts +5 -0
  303. package/dist/utility/wrun/wrun-twin-compute-inputs.util.js +9 -2
  304. package/dist/utility/wrun/wrun-visibility-table.d.ts +13 -0
  305. package/dist/utility/wrun/wrun-visibility-table.js +9 -0
  306. package/dist/utility/wrun/wrun-volume-profile.util.js +44 -32
  307. package/dist/utils/replay/replay-buffer-math.d.ts +16 -6
  308. package/dist/utils/replay/replay-buffer-math.js +60 -30
  309. package/dist/workers/constants/socket-slots.d.ts +11 -7
  310. package/dist/workers/constants/socket-slots.js +6 -5
  311. package/package.json +11 -11
@@ -1,3 +1,4 @@
1
+ import { displayWallMs } from './display-offset.leaf.js';
1
2
  import { MAX_PANES } from './om-series.util.js';
2
3
  import { invalidPanelStyleWord, invalidSeriesStyleWord, PANEL_SERIES_STYLE_WORDS, PANEL_STYLE_WORDS, } from './om-panel-push-style.util.js';
3
4
  import { parseWrunColor } from '../wrun/wrun-color-facts.util.js';
@@ -546,12 +547,13 @@ export function withoutEmptyTableColumns(frame) {
546
547
  const pad2 = (value) => String(value).padStart(2, '0');
547
548
  /** Labels for a time-keyed curve or bars panel, as short as the key set
548
549
  * allows: clock times inside one day, dates for day-aligned keys, a year
549
- * only past a year. `offsetMs` is the chart's display-timezone shift
550
- * (SC37): the labels print the wall time of key + offset, UTC fields. */
551
- export function panelTimeLabels(keys, offsetMs = 0) {
550
+ * only past a year. `offset` is the chart's display-timezone shift (SC37),
551
+ * fixed or per instant: each label prints its key's own wall time (the key
552
+ * plus the offset at that key), UTC fields. */
553
+ export function panelTimeLabels(keys, offset = 0) {
552
554
  if (keys.length === 0)
553
555
  return [];
554
- const stamps = keys.map((key) => (key < 1e11 ? key * 1000 : key) + offsetMs);
556
+ const stamps = keys.map((key) => displayWallMs(offset, timeKeyMs(key)));
555
557
  let min = Infinity;
556
558
  let max = -Infinity;
557
559
  for (const stamp of stamps) {
@@ -575,6 +577,37 @@ export function panelTimeLabels(keys, offsetMs = 0) {
575
577
  function timeKeyMs(key) {
576
578
  return key < 1e11 ? key * 1000 : key;
577
579
  }
580
+ /** A wall time as titan's curve titles a time x (its hover card, a marker's show_value: `formatCurveTime`, titan
581
+ * src/renderers/domainPanes/curveLayout.ts): `YYYY-MM-DD HH:MM`, UTC fields. */
582
+ function curveTimeTitle(wallMs) {
583
+ const date = new Date(wallMs);
584
+ const day = `${date.getUTCFullYear()}-${pad2(date.getUTCMonth() + 1)}-${pad2(date.getUTCDate())}`;
585
+ return `${day} ${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}`;
586
+ }
587
+ /**
588
+ * The rich time curve's clock (SC37). Its x stays each key's instant, so points are spaced by true time: wall-time x
589
+ * folds the hour a fall change repeats (two passes over one stretch, the second unreachable by the hover) and opens an
590
+ * empty hour at a spring change. Titan's curve prints its ticks and its hover titles with ONE shift
591
+ * (`xTimeOffsetMs`): the offset at the newest key, right for every key while the keys hold no clock change. A key
592
+ * whose own offset differs (the far side of a change) is titled at its own offset (`xValueLabels`, the exact-x titles
593
+ * the hover card and a marker's show_value read first); the ticks over that side keep the newest key's clock until
594
+ * titan's curve takes a shift per instant (docs/features/chart/time-axis-clock.md, "A rich time-x curve pane").
595
+ */
596
+ function timeCurveClock(instants, offset) {
597
+ if (typeof offset === 'number')
598
+ return { xTimeOffsetMs: offset };
599
+ const newest = instants[instants.length - 1];
600
+ if (newest === undefined)
601
+ return { xTimeOffsetMs: 0 };
602
+ const shiftMs = offset(newest);
603
+ let titles;
604
+ for (const ms of instants) {
605
+ const own = offset(ms);
606
+ if (own !== shiftMs)
607
+ (titles ??= {})[String(ms)] = curveTimeTitle(ms + own);
608
+ }
609
+ return titles === undefined ? { xTimeOffsetMs: shiftMs } : { xTimeOffsetMs: shiftMs, xValueLabels: titles };
610
+ }
578
611
  /** A bars value cell's number (a styled cell's `value`). */
579
612
  function barCellValue(cell) {
580
613
  return isRecord(cell) ? cell.value : cell;
@@ -676,13 +709,15 @@ export function translatePanelToEngine(frame, ctx = {}) {
676
709
  if (effective !== 'box') {
677
710
  // The rich curve (every chrome but box, the hairlines default too)
678
711
  // spaces points by their time (gaps stay gaps) and labels the axis
679
- // in the chart's display timezone (SC37).
680
- panelRows = sorted.map((row) => [timeKeyMs(row[0]), ...row.slice(1)]);
712
+ // in the chart's display timezone (SC37): each x is its key's
713
+ // instant, and the clock rides the settings (timeCurveClock).
714
+ const instants = sorted.map((row) => timeKeyMs(row[0]));
715
+ panelRows = sorted.map((row, index) => [instants[index], ...row.slice(1)]);
681
716
  settings = {
682
717
  series,
683
718
  ...optional('stacked'),
684
719
  xFormat: 'time',
685
- xTimeOffsetMs: ctx.timezoneOffsetMs ?? 0,
720
+ ...timeCurveClock(instants, ctx.timezoneOffsetMs ?? 0),
686
721
  fontFamily,
687
722
  ...chromeStyle,
688
723
  };
@@ -4,8 +4,21 @@ export type OmTargetMetadata = {
4
4
  symbol?: unknown;
5
5
  exchange?: unknown;
6
6
  } | null | undefined;
7
+ export type OmTarget = {
8
+ kind: 'series';
9
+ id: string;
10
+ } | {
11
+ kind: 'panel';
12
+ id: string;
13
+ } | {
14
+ kind: 'feed';
15
+ address: string;
16
+ column: string;
17
+ };
18
+ export declare function parseOmTarget(metadata: OmTargetMetadata): OmTarget | null;
19
+ export declare function omTargetSymbol(target: OmTarget): string;
7
20
  export declare function isOmTargetSymbol(symbol: unknown): symbol is string;
8
21
  export declare function isOmTargetPane(metadata: OmTargetMetadata): boolean;
9
- export declare function omTargetKind(metadata: OmTargetMetadata): 'series' | 'panel' | null;
22
+ export declare function omTargetKind(metadata: OmTargetMetadata): OmTarget['kind'] | null;
10
23
  /** Only daemon cadences are legal, even when another chart interval exists. */
11
24
  export declare function cadenceToInterval(cadenceSeconds: unknown): string | null;
@@ -2,16 +2,33 @@ import { Intervals } from '../../constants/interval.constants.js';
2
2
  import { intervalLabelForMs } from './interval-ladder.util.js';
3
3
  export const TARGET_EXCHANGE = 'OM';
4
4
  export const OM_MAIN_CADENCES = [60, 300, 900, 1800, 3600, 14400, 86400, 604800];
5
+ const FEED_TARGET_SYMBOL = /^feed:(@[a-z0-9_-]+\/[a-z0-9][a-z0-9._-]{0,63})(?:#([^\s#]+))?$/;
6
+ function parseOmTargetSymbol(symbol) {
7
+ if (typeof symbol !== 'string')
8
+ return null;
9
+ if (symbol.startsWith('series:'))
10
+ return { kind: 'series', id: symbol.slice('series:'.length) };
11
+ if (symbol.startsWith('panel:'))
12
+ return { kind: 'panel', id: symbol.slice('panel:'.length) };
13
+ const feed = FEED_TARGET_SYMBOL.exec(symbol);
14
+ return feed ? { kind: 'feed', address: feed[1], column: feed[2] ?? '' } : null;
15
+ }
16
+ export function parseOmTarget(metadata) {
17
+ return metadata?.exchange === TARGET_EXCHANGE ? parseOmTargetSymbol(metadata?.symbol) : null;
18
+ }
19
+ export function omTargetSymbol(target) {
20
+ if (target.kind === 'feed')
21
+ return target.column ? `feed:${target.address}#${target.column}` : `feed:${target.address}`;
22
+ return `${target.kind}:${target.id}`;
23
+ }
5
24
  export function isOmTargetSymbol(symbol) {
6
- return typeof symbol === 'string' && (symbol.startsWith('series:') || symbol.startsWith('panel:'));
25
+ return parseOmTargetSymbol(symbol) !== null;
7
26
  }
8
27
  export function isOmTargetPane(metadata) {
9
- return metadata?.exchange === TARGET_EXCHANGE && isOmTargetSymbol(metadata?.symbol);
28
+ return parseOmTarget(metadata) !== null;
10
29
  }
11
30
  export function omTargetKind(metadata) {
12
- if (!isOmTargetPane(metadata))
13
- return null;
14
- return metadata.symbol.startsWith('series:') ? 'series' : 'panel';
31
+ return parseOmTarget(metadata)?.kind ?? null;
15
32
  }
16
33
  /** Only daemon cadences are legal, even when another chart interval exists. */
17
34
  export function cadenceToInterval(cadenceSeconds) {
@@ -8,18 +8,33 @@
8
8
  * and row lanes' plan context. Who may read is all it answers: the tier a read rides is the viewer's,
9
9
  * decided by the gate per socket, never by this answer.
10
10
  *
11
+ * Every CME option chain door reads `mayReadCmeChain` the same way: one that reads `official` alone walls a study.
12
+ * Every CME pin judge reads `mayReadCmePin` (the data wall's own answer, on any chart): a judge taking its verdict
13
+ * without the run's facts refuses a pin the data wall would serve.
14
+ *
11
15
  * A LEAF on purpose (no imports): the poll-lane and row-lane planners sit on the row builder's import
12
16
  * graph, and the venue policy is worker-safe; both read this without reaching each other.
13
17
  */
14
- /** The two facts the decision reads, as a run's head holds them: absent reads false (fail closed). */
18
+ /** The facts the plane decisions read, as a run's head holds them: absent reads false (fail closed). */
15
19
  export interface OpraReadFacts {
16
20
  /** A first-party run (an OpenMarket package: `isOfficialWrunOverlay`; any first-party kScript run). */
17
21
  official?: boolean;
18
22
  /** A browser user run the `opra-user-scripts` flag opened the OPRA plane to (`isOpraUserScriptRun`). */
19
23
  opraUserScripts?: boolean;
24
+ /** A CME chart study (kscript-venue-policy.util `isCmeChartStudyRun`): it reads CME option chains. */
25
+ cmeStudyChain?: boolean;
26
+ /** The `cme-user-scripts` gate opened the CME plane to this browser run, on any chart (`isCmeUserScriptRun`). */
27
+ cmeUserScripts?: boolean;
20
28
  }
29
+ /** The facts whole, each absent one read false: the one copy the planners and the run head hand on. */
30
+ export declare function planeReadFactsOf(facts: OpraReadFacts | null | undefined): Required<OpraReadFacts>;
21
31
  /** May the run the facts describe read the OPRA plane. */
22
32
  export declare function mayReadOpra(facts: OpraReadFacts | null | undefined): boolean;
33
+ /** May the run read a CME option chain: off a CME chart a user run holds no CME mark or authorisation token. */
34
+ export declare function mayReadCmeChain(facts: OpraReadFacts | null | undefined): boolean;
35
+ /** May the run read a CME market it pins, on any chart: the data wall's own answer (`isCmeReadableKScriptRun`). Chains
36
+ * stay chart-keyed (`mayReadCmeChain`). */
37
+ export declare function mayReadCmePin(facts: OpraReadFacts | null | undefined): boolean;
23
38
  /** The payload field a source ask carries when it reads the OPRA plane beyond its own exchange (a wrun lane
24
39
  * asking a stock chart's options on the native-rows path: its `exchange` is the stock's placeholder). Door C
25
40
  * judges such an ask as an OPRA one. */
@@ -8,13 +8,35 @@
8
8
  * and row lanes' plan context. Who may read is all it answers: the tier a read rides is the viewer's,
9
9
  * decided by the gate per socket, never by this answer.
10
10
  *
11
+ * Every CME option chain door reads `mayReadCmeChain` the same way: one that reads `official` alone walls a study.
12
+ * Every CME pin judge reads `mayReadCmePin` (the data wall's own answer, on any chart): a judge taking its verdict
13
+ * without the run's facts refuses a pin the data wall would serve.
14
+ *
11
15
  * A LEAF on purpose (no imports): the poll-lane and row-lane planners sit on the row builder's import
12
16
  * graph, and the venue policy is worker-safe; both read this without reaching each other.
13
17
  */
18
+ /** The facts whole, each absent one read false: the one copy the planners and the run head hand on. */
19
+ export function planeReadFactsOf(facts) {
20
+ return {
21
+ official: facts?.official === true,
22
+ opraUserScripts: facts?.opraUserScripts === true,
23
+ cmeStudyChain: facts?.cmeStudyChain === true,
24
+ cmeUserScripts: facts?.cmeUserScripts === true,
25
+ };
26
+ }
14
27
  /** May the run the facts describe read the OPRA plane. */
15
28
  export function mayReadOpra(facts) {
16
29
  return facts?.official === true || facts?.opraUserScripts === true;
17
30
  }
31
+ /** May the run read a CME option chain: off a CME chart a user run holds no CME mark or authorisation token. */
32
+ export function mayReadCmeChain(facts) {
33
+ return facts?.official === true || facts?.cmeStudyChain === true;
34
+ }
35
+ /** May the run read a CME market it pins, on any chart: the data wall's own answer (`isCmeReadableKScriptRun`). Chains
36
+ * stay chart-keyed (`mayReadCmeChain`). */
37
+ export function mayReadCmePin(facts) {
38
+ return facts?.official === true || facts?.cmeUserScripts === true;
39
+ }
18
40
  /** The payload field a source ask carries when it reads the OPRA plane beyond its own exchange (a wrun lane
19
41
  * asking a stock chart's options on the native-rows path: its `exchange` is the stock's placeholder). Door C
20
42
  * judges such an ask as an OPRA one. */
@@ -1,21 +1,54 @@
1
- /** The profile family a row table belongs to: one footprint column per bar,
2
- * the TPO letters, or a session volume profile. */
1
+ /** The profile family a row table belongs to: one footprint column per bar, the TPO letters, or a session volume
2
+ * profile. */
3
3
  export type ProfileRowKind = 'footprint' | 'tpo' | 'session';
4
- /** The table label of an interval given in milliseconds: the registry's
5
- * label when the span is a known interval (a custom one folds to its
6
- * standard, the tuning rule), else the largest table label no longer than
7
- * the span. An unknown or non-positive span reads as '' (the tables'
8
- * fallback of 1). */
4
+ /** A TPO session period: the engine's words or the sheet's. A closed set, so a chart interval can never stand in. */
5
+ export type TpoPeriod = 'Daily' | 'Weekly' | 'Monthly' | 'day' | 'week' | 'month';
6
+ /** A control's TPO session type as a period, or undefined (a custom session, an unknown word). */
7
+ export declare function tpoPeriodOf(value: unknown): TpoPeriod | undefined;
8
+ /** The session volume profile's default: 10 blocks per row on every interval (the old 5m value, so a daily SVP on 5m
9
+ * is unchanged; weekly gold on Binance Futures = 10 x 0.3 = 3.0). */
10
+ export declare const SESSION_PROFILE_ROW_MULTIPLIER = 10;
11
+ /** The TPO default's base on every interval (the old 5m value), scaled by the session period below. */
12
+ export declare const TPO_PROFILE_ROW_BASE = 10;
13
+ /** The table label of an interval given in milliseconds: the registry's label when the span is a known interval (a
14
+ * custom one folds to its standard, the tuning rule), else the largest table label no longer than the span. An
15
+ * unknown or non-positive span reads as '' (the tables' fallback of 1). */
9
16
  export declare function profileRowIntervalLabel(interval: string | number): string;
10
17
  /**
11
- * The row multiplier behind a profile canvas's `row_height: "auto"` (the
12
- * native controls' `getBarsForInterval`): the kind's table at the chart
13
- * interval (a label, or a span in milliseconds), 1 for an interval outside
14
- * the table. A TPO period word (the engine's 'Daily' | 'Weekly' | 'Monthly',
15
- * or the sheet's 'day' | 'week' | 'month') scales the TPO base by the native
16
- * session multiplier, floored, exactly like the control.
18
+ * The default row multiplier of a fresh profile (the native controls' default, and a profile canvas's
19
+ * `row_height: "auto"` for a footprint):
20
+ * - `('footprint', interval)`: the footprint table at the chart interval (a label, or a span in milliseconds), 1 for
21
+ * an interval outside it;
22
+ * - `('session')`: SESSION_PROFILE_ROW_MULTIPLIER on every interval;
23
+ * - `('tpo', period)`: TPO_PROFILE_ROW_BASE scaled by the period (Daily 10, Weekly 15, Monthly 20), floored.
24
+ * The session and TPO forms take no interval on purpose (PROFILE-ROWS): the compiler refuses one.
17
25
  */
18
- export declare function profileRowMultiplier(kind: ProfileRowKind, interval: string | number, period?: string): number;
19
- /** The engine's TPO session word for a sheet period (`day` -> 'Daily'); an
20
- * engine word passes through unchanged. */
26
+ export declare function profileRowMultiplier(kind: 'footprint', interval: string | number): number;
27
+ export declare function profileRowMultiplier(kind: 'session'): number;
28
+ export declare function profileRowMultiplier(kind: 'tpo', period?: TpoPeriod): number;
29
+ /**
30
+ * The interval-keyed session / TPO tables, for the profiles whose window is the view rather than a session: the
31
+ * kScript profile canvases (`row_height: "auto"`, visible and range spans among them). They keep the old sizing until
32
+ * titan merges rows before its 10,000-row cap (PROFILE_MAX_VISIBLE_ROWS): a fixed fine grid there can blank a
33
+ * zoomed-out view (PROFILE-ROWS LEFT). Never a session profile's default: the class scan
34
+ * (tests/indicators/controls/profile-rows-one-size.class.spec.ts) refuses it in the native controls.
35
+ */
36
+ export declare function viewScaledProfileRowMultiplier(kind: 'session' | 'tpo', interval: string | number, period?: string): number;
37
+ /** A positive finite multiplier, or undefined. */
38
+ export declare function savedProfileRowMultiplier(value: unknown): number | undefined;
39
+ /** The row height of `multiplier` blocks, or undefined while the block is unknown (a pending block). */
40
+ export declare function profileRowHeight(minimumBarHeight: unknown, multiplier: number): number | undefined;
41
+ /**
42
+ * The patch a profile dialog writes when the user types "Ticks per row": the one row size for every interval, its
43
+ * row height on the current block, and the old per-interval memory emptied (`{}` reads as absent to the conflict
44
+ * classifier and the server echo, workspace-conflict-classify.util).
45
+ */
46
+ export declare function profileRowSizeEditPatch(modelValue: {
47
+ minimumBarHeight?: unknown;
48
+ }, multiplier: number): {
49
+ barHeightMultiplier: number;
50
+ barHeight?: number;
51
+ intervalBarHeights: Record<string, number>;
52
+ };
53
+ /** The engine's TPO session word for a sheet period (`day` -> 'Daily'); an engine word passes through unchanged. */
21
54
  export declare function tpoPeriodWord(period: string): string;
@@ -1,14 +1,30 @@
1
1
  /**
2
- * The row-height multiplier tables behind every profile canvas (WRUN-STYLE
3
- * g6 PT-footprint, PT-tpo, DL-time-anchored): the three `INTERVAL_TO_BARS`
4
- * tables moved verbatim out of the native controls (aggregated volume
5
- * footprint, TPO, session volume profile), which import them back through
6
- * their unchanged `getBarsForInterval` exports. A leaf: it imports the
7
- * interval registry only, so the wrun canvases never load a control module
8
- * (stores, workers, dialogs) to size a row.
2
+ * The row-height multipliers behind every profile canvas (WRUN-STYLE g6 PT-footprint, PT-tpo, DL-time-anchored), in
3
+ * multiples of the market's served block.
4
+ *
5
+ * PROFILE-ROWS (2026-11-03): a profile that spans many candles keeps ONE row size on every chart interval. Its point of
6
+ * control and value area are the busiest rows of its grid, so a grid that follows the interval moves them: one weekly
7
+ * gold profile showed seven POCs on seven intervals (S._Trades, #general). The session and TPO defaults therefore take
8
+ * no interval at all, and the rows draw at exactly that size at every zoom, thin on a zoomed-out view (Kyle
9
+ * 2026-11-03: no titan row merge, TradingView's Ticks Per Row; docs/features/indicators/profiles.md). A footprint is
10
+ * one candle's rows, so its default still follows the chart interval (TradingView's Auto row size does the same, from
11
+ * the ATR).
12
+ *
13
+ * A leaf: it imports the interval registry only, so the wrun canvases never load a control module (stores, workers,
14
+ * dialogs) to size a row.
9
15
  */
10
16
  import { intervalLabelForMs, intervalMs, standardIntervalAtOrBelow, standardIntervalMsAtOrBelow, } from './interval-ladder.util.js';
11
- /** The native footprint's table (aggregated-volume-footprint/index.ts). */
17
+ const TPO_PERIODS = new Set(['Daily', 'Weekly', 'Monthly', 'day', 'week', 'month']);
18
+ /** A control's TPO session type as a period, or undefined (a custom session, an unknown word). */
19
+ export function tpoPeriodOf(value) {
20
+ return typeof value === 'string' && TPO_PERIODS.has(value) ? value : undefined;
21
+ }
22
+ /** The session volume profile's default: 10 blocks per row on every interval (the old 5m value, so a daily SVP on 5m
23
+ * is unchanged; weekly gold on Binance Futures = 10 x 0.3 = 3.0). */
24
+ export const SESSION_PROFILE_ROW_MULTIPLIER = 10;
25
+ /** The TPO default's base on every interval (the old 5m value), scaled by the session period below. */
26
+ export const TPO_PROFILE_ROW_BASE = 10;
27
+ /** The native footprint's table (aggregated-volume-footprint/index.ts): a footprint row follows its candle. */
12
28
  const FOOTPRINT_INTERVAL_TO_BARS = {
13
29
  '1s': 1,
14
30
  '1m': 2,
@@ -20,8 +36,8 @@ const FOOTPRINT_INTERVAL_TO_BARS = {
20
36
  '1d': 50,
21
37
  '1w': 250,
22
38
  };
23
- /** The native TPO's table (time-price-opportunity/index.ts). */
24
- const TPO_INTERVAL_TO_BARS = {
39
+ /** The interval-keyed TPO table (time-price-opportunity before PROFILE-ROWS): only the view-scaled callers below. */
40
+ const VIEW_SCALED_TPO_INTERVAL_TO_BARS = {
25
41
  '1s': 1,
26
42
  '1m': 5,
27
43
  '5m': 10,
@@ -32,8 +48,8 @@ const TPO_INTERVAL_TO_BARS = {
32
48
  '1d': 50,
33
49
  '1w': 100,
34
50
  };
35
- /** The native session profile's table (session-volume-profile/index.ts). */
36
- const SESSION_INTERVAL_TO_BARS = {
51
+ /** The interval-keyed session table (session-volume-profile before PROFILE-ROWS): only the view-scaled callers. */
52
+ const VIEW_SCALED_SESSION_INTERVAL_TO_BARS = {
37
53
  '1s': 1,
38
54
  '1m': 5,
39
55
  '5m': 10,
@@ -44,25 +60,17 @@ const SESSION_INTERVAL_TO_BARS = {
44
60
  '1d': 100,
45
61
  '1w': 200,
46
62
  };
47
- /** The TPO period's multiplier over its interval base (the native TPO's
48
- * `SESSION_MULTIPLIERS`, keyed by the engine's session words). */
63
+ /** The TPO period's multiplier over its base (the native TPO's `SESSION_MULTIPLIERS`, keyed by the engine's words). */
49
64
  const TPO_PERIOD_MULTIPLIERS = {
50
65
  Daily: 1,
51
66
  Weekly: 1.5,
52
67
  Monthly: 2,
53
68
  };
54
- const ROW_TABLES = {
55
- footprint: FOOTPRINT_INTERVAL_TO_BARS,
56
- tpo: TPO_INTERVAL_TO_BARS,
57
- session: SESSION_INTERVAL_TO_BARS,
58
- };
59
69
  /** The tables' labels, ascending by span (the scan keeps the largest match). */
60
70
  const TABLE_LABELS = ['1s', '1m', '5m', '15m', '30m', '1h', '4h', '1d', '1w'];
61
- /** The table label of an interval given in milliseconds: the registry's
62
- * label when the span is a known interval (a custom one folds to its
63
- * standard, the tuning rule), else the largest table label no longer than
64
- * the span. An unknown or non-positive span reads as '' (the tables'
65
- * fallback of 1). */
71
+ /** The table label of an interval given in milliseconds: the registry's label when the span is a known interval (a
72
+ * custom one folds to its standard, the tuning rule), else the largest table label no longer than the span. An
73
+ * unknown or non-positive span reads as '' (the tables' fallback of 1). */
66
74
  export function profileRowIntervalLabel(interval) {
67
75
  if (typeof interval === 'string')
68
76
  return standardIntervalAtOrBelow(interval);
@@ -79,23 +87,52 @@ export function profileRowIntervalLabel(interval) {
79
87
  }
80
88
  return label;
81
89
  }
82
- /**
83
- * The row multiplier behind a profile canvas's `row_height: "auto"` (the
84
- * native controls' `getBarsForInterval`): the kind's table at the chart
85
- * interval (a label, or a span in milliseconds), 1 for an interval outside
86
- * the table. A TPO period word (the engine's 'Daily' | 'Weekly' | 'Monthly',
87
- * or the sheet's 'day' | 'week' | 'month') scales the TPO base by the native
88
- * session multiplier, floored, exactly like the control.
89
- */
90
- export function profileRowMultiplier(kind, interval, period) {
91
- const base = ROW_TABLES[kind][profileRowIntervalLabel(interval)] || 1;
92
- if (kind !== 'tpo' || !period)
90
+ function tpoPeriodScaled(base, period) {
91
+ if (!period)
93
92
  return base;
94
93
  const multiplier = TPO_PERIOD_MULTIPLIERS[tpoPeriodWord(period)] || 1;
95
94
  return Math.floor(base * multiplier);
96
95
  }
97
- /** The engine's TPO session word for a sheet period (`day` -> 'Daily'); an
98
- * engine word passes through unchanged. */
96
+ export function profileRowMultiplier(kind, arg) {
97
+ if (kind === 'footprint') {
98
+ return FOOTPRINT_INTERVAL_TO_BARS[profileRowIntervalLabel(arg ?? '')] || 1;
99
+ }
100
+ if (kind === 'session')
101
+ return SESSION_PROFILE_ROW_MULTIPLIER;
102
+ return tpoPeriodScaled(TPO_PROFILE_ROW_BASE, typeof arg === 'string' ? arg : undefined);
103
+ }
104
+ /**
105
+ * The interval-keyed session / TPO tables, for the profiles whose window is the view rather than a session: the
106
+ * kScript profile canvases (`row_height: "auto"`, visible and range spans among them). They keep the old sizing until
107
+ * titan merges rows before its 10,000-row cap (PROFILE_MAX_VISIBLE_ROWS): a fixed fine grid there can blank a
108
+ * zoomed-out view (PROFILE-ROWS LEFT). Never a session profile's default: the class scan
109
+ * (tests/indicators/controls/profile-rows-one-size.class.spec.ts) refuses it in the native controls.
110
+ */
111
+ export function viewScaledProfileRowMultiplier(kind, interval, period) {
112
+ if (kind === 'session')
113
+ return VIEW_SCALED_SESSION_INTERVAL_TO_BARS[profileRowIntervalLabel(interval)] || 1;
114
+ return tpoPeriodScaled(VIEW_SCALED_TPO_INTERVAL_TO_BARS[profileRowIntervalLabel(interval)] || 1, period);
115
+ }
116
+ /** A positive finite multiplier, or undefined. */
117
+ export function savedProfileRowMultiplier(value) {
118
+ return typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : undefined;
119
+ }
120
+ /** The row height of `multiplier` blocks, or undefined while the block is unknown (a pending block). */
121
+ export function profileRowHeight(minimumBarHeight, multiplier) {
122
+ return typeof minimumBarHeight === 'number' && Number.isFinite(minimumBarHeight) && minimumBarHeight > 0
123
+ ? minimumBarHeight * multiplier
124
+ : undefined;
125
+ }
126
+ /**
127
+ * The patch a profile dialog writes when the user types "Ticks per row": the one row size for every interval, its
128
+ * row height on the current block, and the old per-interval memory emptied (`{}` reads as absent to the conflict
129
+ * classifier and the server echo, workspace-conflict-classify.util).
130
+ */
131
+ export function profileRowSizeEditPatch(modelValue, multiplier) {
132
+ const barHeight = profileRowHeight(modelValue.minimumBarHeight, multiplier);
133
+ return { barHeightMultiplier: multiplier, ...(barHeight === undefined ? {} : { barHeight }), intervalBarHeights: {} };
134
+ }
135
+ /** The engine's TPO session word for a sheet period (`day` -> 'Daily'); an engine word passes through unchanged. */
99
136
  export function tpoPeriodWord(period) {
100
137
  switch (period) {
101
138
  case 'day':
@@ -6,6 +6,8 @@ export interface RthWindow {
6
6
  /** RTH close, minutes after local midnight of the trading date. */
7
7
  closeMinutes: number;
8
8
  }
9
+ /** Every root with an RTH window, in table order: the trade-date class guard walks each one, so a new root is covered on arrival. */
10
+ export declare const RTH_MAPPED_ROOTS: readonly string[];
9
11
  /**
10
12
  * The RTH window of a CME-group exchange, the client mirror of tsdb-gateway
11
13
  * `SessionVenueGroupOf`: NYMEX serves the energy pit session, CME, CBOT and
@@ -179,6 +181,26 @@ export declare function footprintRthFoldFetchTfMs(chartTfMs: number): number;
179
181
  * its identity, its fetch interval is never overridden).
180
182
  */
181
183
  export declare function rthLiveMergeIntervalMs(ovType: unknown, chartTfMs: number): number;
184
+ /** One venue-local calendar day of a session window: its `[open, close)` edges and the day's own span. */
185
+ export interface SessionDayBounds {
186
+ openMs: number;
187
+ closeMs: number;
188
+ /** The venue-local calendar day this window belongs to, [dayStartMs, dayEndMs) in UTC ms. */
189
+ dayStartMs: number;
190
+ dayEndMs: number;
191
+ /** That day's weekday, 0 = Sunday. */
192
+ weekday: number;
193
+ /** That venue-local calendar date as its 00:00Z label, the key cme-trade-calendar.util reads; never the UTC date of an instant (23:30 New York is the next UTC date). */
194
+ calendarDayMs: number;
195
+ }
196
+ /**
197
+ * The venue-local calendar day holding `tsMs` on `window`, with that day's window edges: the per-window day memo
198
+ * every op in this module reads, open to a window of any market (market-session.util walks the US equities window
199
+ * on it). Calendar-based like the ops: Saturday and Sunday have bounds too, so a caller that needs a trading day
200
+ * checks `weekday` (or a trade calendar) itself. Null for a non-finite instant or a zone the runtime rejects. Pass a
201
+ * frozen window constant: an ad-hoc object misses the memo (correct, slower).
202
+ */
203
+ export declare function sessionDayBoundsFor(window: Readonly<RthWindow>, tsMs: number): Readonly<SessionDayBounds> | null;
182
204
  export interface SessionDayWindow {
183
205
  openMs: number;
184
206
  closeMs: number;
@@ -188,12 +210,13 @@ export interface SessionDayWindow {
188
210
  * `[fromMs, toMs]`, in order: the walk steps one calendar day at a time in
189
211
  * the window's zone (`rthDayBoundsFor`, so it is DST-exact on 23h/25h days)
190
212
  * and keeps a day whose close is after `fromMs` and whose open is before
191
- * `toMs`. Calendar-based like the other walks: Saturday, Sunday and holidays
192
- * have mathematical bounds too, which is harmless for consumers that shade
193
- * or gate BARS (no bar trades 09:30-16:15 New York on a weekend) and wrong
194
- * for anyone who would count the windows as trading days. Empty for an
195
- * inverted or non-finite span. Ad-hoc window objects miss the per-window
196
- * memo (correct, slower); pass the frozen module constants.
213
+ * `toMs`. Calendar-based like `nextRthSessionOpenMs`: Saturday, Sunday and
214
+ * holidays have mathematical bounds too, which is harmless for consumers that
215
+ * shade or gate BARS (no bar trades 09:30-16:15 New York on a weekend) and
216
+ * wrong for anyone who would count the windows as trading days (the session
217
+ * picks below read `isRthTradeDay` for that). Empty for an inverted or
218
+ * non-finite span. Ad-hoc window objects miss the per-window memo (correct,
219
+ * slower); pass the frozen module constants.
197
220
  */
198
221
  export declare function sessionWindowsInRange(window: Readonly<RthWindow>, fromMs: number, toMs: number): SessionDayWindow[];
199
222
  /**
@@ -289,20 +312,32 @@ export declare function latestRthSessionBoundsAtOrBefore(symbol: unknown, tsMs:
289
312
  closeMs: number;
290
313
  } | null;
291
314
  /**
292
- * The next RTH open strictly AFTER `tsMs` on the same memoized window: inside
293
- * a session it is tomorrow's open, after the close it is the next calendar
294
- * day's, before the open it is today's. NON-AUTHORITATIVE, a HINT only
295
- * (data-loading S6, the poll cadence's probe hint): the RthWindow is a
296
- * chart-side filter (a timezone plus open and close minutes), not a venue
297
- * schedule. It admits Saturday and holiday sessions exactly like
298
- * `latestRthSessionBoundsAtOrBefore` (every calendar day has mathematical
299
- * bounds), the RTH window (09:30 to 16:15 New York, 09:00 to 14:30 on NYMEX)
300
- * is not the Globex cycle, and it can neither prove a venue still closed nor
301
- * name the 17:00 CT
302
- * reopen. A caller may shorten a timer to it (one extra probe on a
303
- * non-trading day at worst); it must never skip a request, derive 'closed'
304
- * or resume a cadence from it. Null for an unmapped symbol or a non-finite
305
- * instant.
315
+ * The next RTH session open strictly AFTER `tsMs` on a CME trade date
316
+ * (`isRthTradeDay`, the rule `latestRthSessionBoundsAtOrBefore` reads): inside
317
+ * a session or after the close it is the next trade date's open, before the
318
+ * open it is today's when today trades; Friday after the close names Monday.
319
+ * NON-AUTHORITATIVE, a HINT only (data-loading S6, the poll cadence's probe
320
+ * hint): the RthWindow is a chart-side filter (a timezone plus open and close
321
+ * minutes), not a venue schedule. The RTH window (09:30 to 16:15 New York,
322
+ * 09:00 to 14:30 on NYMEX) is not the Globex cycle, an early-halt holiday
323
+ * trades a morning this skips, and it can neither prove a venue still closed
324
+ * nor name the 17:00 CT reopen. A caller may shorten a timer to it; it must
325
+ * never skip a request, derive 'closed' or resume a cadence from it. Null for
326
+ * an unmapped symbol or a non-finite instant.
327
+ */
328
+ export declare function nextRthTradeSessionOpenMs(symbol: unknown, tsMs: number): number | null;
329
+ /**
330
+ * The next calendar day's RTH window open strictly AFTER `tsMs` on the same
331
+ * memoized window: inside a session it is tomorrow's open, after the close it
332
+ * is the next calendar day's, before the open it is today's. Every calendar
333
+ * day counts (Saturday and holidays included) on purpose: this is the step of
334
+ * the BAR walks (live-bucket's off-session resume, wrun-leg-close's next bar),
335
+ * which keep a bar only where the product trades by its schedule, and an
336
+ * early-halt holiday morning or an always-on root's weekend holds RTH bars a
337
+ * trade-date step would skip. Never a session pick: those read
338
+ * `nextRthTradeSessionOpenMs` and `latestRthSessionBoundsAtOrBefore`. Steps
339
+ * 24 h, so a Saturday instant in the hour before the spring-forward midnight
340
+ * resolves Monday's open. Null for an unmapped symbol or a non-finite instant.
306
341
  */
307
342
  export declare function nextRthSessionOpenMs(symbol: unknown, tsMs: number): number | null;
308
343
  /**