@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
@@ -67,6 +67,18 @@ export function wrunDeclaredWarmupEndTs(rows, bars, intervalMs, creditedBars = 0
67
67
  const ts = at < rows.length ? rows[at].ts : rows[rows.length - 1].ts + (at - (rows.length - 1)) * intervalMs;
68
68
  return Number.isFinite(ts) ? ts : null;
69
69
  }
70
+ /**
71
+ * Whether the run's evaluated rows (with a credited head) hold a declared warm-up of `bars` plus `slackBars` and the
72
+ * bar after them: the first bar the runner evaluates past the slack is a row of the window. Counted in rows like
73
+ * `wrunDeclaredWarmupEndTs`, so a gapped tape is measured in bars, never clock time.
74
+ */
75
+ export function wrunDeclaredWarmupCovered(rows, bars, slackBars, creditedBars = 0) {
76
+ if (!(bars > 0))
77
+ return false;
78
+ const credit = Number.isFinite(creditedBars) && creditedBars > 0 ? Math.floor(creditedBars) : 0;
79
+ const slack = Number.isFinite(slackBars) && slackBars > 0 ? Math.floor(slackBars) : 0;
80
+ return Math.ceil(bars) + slack - credit < rows.length;
81
+ }
70
82
  /** The deepest exact warm-up a chart session takes (`warmup-cap` past it): a head is fetched in at most
71
83
  * six pages and 1,000 bars (wrun-overlay-run.util), so a running start deeper than that is never owed. */
72
84
  export const WRUN_HISTORY_WARMUP_MAX_BARS = 1000;
@@ -99,17 +111,10 @@ function historyWarmupWindowOf(value) {
99
111
  ...(value.min !== undefined ? { min: value.min } : {}),
100
112
  };
101
113
  }
102
- /**
103
- * The exact warm-up stamp in its frozen shape (`history_warmup`, the kit contract D3), copied, or undefined
104
- * for anything else: `kind` "exact" (another kind is a later round's and reads as no stamp), a `windows` list
105
- * of the declaration's window shape (`{ terms: [{ param, multiplier }], plus?, min? }`) and a number `plus`
106
- * when present. Strict: one malformed window makes the whole value no stamp, so a torn or foreign value never
107
- * reads as a smaller W. The shape only: a number the kit never writes (a multiplier at or below 0, a negative
108
- * `plus` or `min`, NaN or an infinity) reads here and is refused by `wrunHistoryWarmupNumbersRefusal`, so the
109
- * chart names it (`warmup-cap`) and the compile pipeline stamps no such facet. Pure.
110
- */
111
- export function wrunHistoryWarmupOf(value) {
112
- if (!isPlainRecord(value) || value.kind !== 'exact' || !Array.isArray(value.windows))
114
+ /** The windows and the top-level `plus` both stamp kinds share, copied, or undefined when either is malformed (one
115
+ * malformed window makes the whole value no stamp). */
116
+ function historyWarmupWindowsOf(value) {
117
+ if (!Array.isArray(value.windows))
113
118
  return undefined;
114
119
  if (value.plus !== undefined && typeof value.plus !== 'number')
115
120
  return undefined;
@@ -120,7 +125,153 @@ export function wrunHistoryWarmupOf(value) {
120
125
  return undefined;
121
126
  windows.push(window);
122
127
  }
123
- return { kind: 'exact', windows, ...(value.plus !== undefined ? { plus: value.plus } : {}) };
128
+ return { windows, ...(value.plus !== undefined ? { plus: value.plus } : {}) };
129
+ }
130
+ /**
131
+ * The exact warm-up stamp in its frozen shape (`history_warmup`, the kit contract D3), copied, or undefined
132
+ * for anything else: `kind` "exact" (any other kind, a converging stamp included, reads as no stamp here), a
133
+ * `windows` list of the declaration's window shape (`{ terms: [{ param, multiplier }], plus?, min? }`) and a
134
+ * number `plus` when present. Strict: one malformed window makes the whole value no stamp, so a torn or foreign
135
+ * value never reads as a smaller W. The shape only: a number the kit never writes (a multiplier at or below 0, a
136
+ * negative `plus` or `min`, NaN or an infinity) reads here and is refused by `wrunHistoryWarmupNumbersRefusal`, so
137
+ * the chart names it (`warmup-cap`) and the compile pipeline stamps no such facet. The browser compile pipeline's
138
+ * stamp writer reads through here alone: a browser compile has no gate, so it never writes a converging value
139
+ * whatever the shared reader accepts. Pure.
140
+ */
141
+ export function wrunHistoryWarmupExactOf(value) {
142
+ if (!isPlainRecord(value) || value.kind !== 'exact')
143
+ return undefined;
144
+ const shared = historyWarmupWindowsOf(value);
145
+ return shared === undefined ? undefined : { kind: 'exact', ...shared };
146
+ }
147
+ /** The one tolerance a converging stamp may carry in round A: a literal of the frozen contract, compared with `===`. */
148
+ export const WRUN_HISTORY_WARMUP_TOLERANCE = 1e-6;
149
+ /** The gate corpus round A knows; a converging stamp naming any other reads as no stamp. */
150
+ export const WRUN_HISTORY_WARMUP_GATE_CORPUS = 'om-history-matrix-v1';
151
+ /** The fewest valid split points a gate certifies (its own minimum): a record claiming fewer is one the gate could not
152
+ * have written, so it reads as no stamp. */
153
+ export const WRUN_HISTORY_WARMUP_GATE_MIN_SPLITS = 24;
154
+ const integerAtLeast = (value, floor) => typeof value === 'number' && Number.isInteger(value) && value >= floor;
155
+ /** The gate record of a converging stamp, copied, or undefined when it is not the round A one: the known corpus, an
156
+ * integer `bars` at or above 1, an integer `splits` at or above the gate's minimum, the `defaults` settings. A key
157
+ * besides these four is not read (a later gate's), as the exact reader reads no key besides its own. */
158
+ function historyWarmupGateOf(value) {
159
+ if (!isPlainRecord(value))
160
+ return undefined;
161
+ const { corpus, bars, splits, settings } = value;
162
+ if (corpus !== WRUN_HISTORY_WARMUP_GATE_CORPUS || settings !== 'defaults')
163
+ return undefined;
164
+ if (!integerAtLeast(bars, 1) || !integerAtLeast(splits, WRUN_HISTORY_WARMUP_GATE_MIN_SPLITS))
165
+ return undefined;
166
+ return { corpus: WRUN_HISTORY_WARMUP_GATE_CORPUS, bars, splits, settings: 'defaults' };
167
+ }
168
+ /** The converging stamp in its frozen round A shape, copied, or undefined for anything else: the exact shape's
169
+ * windows and `plus`, `tolerance` exactly WRUN_HISTORY_WARMUP_TOLERANCE, and the round A gate. */
170
+ function historyWarmupConvergesOf(value) {
171
+ if (value.tolerance !== WRUN_HISTORY_WARMUP_TOLERANCE)
172
+ return undefined;
173
+ const gate = historyWarmupGateOf(value.gate);
174
+ if (gate === undefined)
175
+ return undefined;
176
+ const shared = historyWarmupWindowsOf(value);
177
+ if (shared === undefined)
178
+ return undefined;
179
+ return { kind: 'converges', ...shared, tolerance: WRUN_HISTORY_WARMUP_TOLERANCE, gate };
180
+ }
181
+ /**
182
+ * The warm-up stamp of either kind in its frozen shape (`history_warmup`), copied, or undefined for anything else:
183
+ * the exact stamp (`wrunHistoryWarmupExactOf`), or the converging one in its round A shape alone (the exact shape's
184
+ * windows and `plus`, `tolerance === 1e-6`, a `gate` record naming the corpus `om-history-matrix-v1` with an integer
185
+ * `bars` at or above 1, an integer `splits` at or above 24 and `settings: "defaults"`): another tolerance, another
186
+ * corpus, a count below its floor or no gate reads as no stamp, and so does any other kind (a later round's). The
187
+ * overlay run decides whether a chart honors a converging stamp at all (its flag, before any other reading); this
188
+ * reader only reads. Pure.
189
+ */
190
+ export function wrunHistoryWarmupOf(value) {
191
+ if (!isPlainRecord(value))
192
+ return undefined;
193
+ if (value.kind === 'converges')
194
+ return historyWarmupConvergesOf(value);
195
+ return wrunHistoryWarmupExactOf(value);
196
+ }
197
+ /** A key whose string value names a declared output that SELECTS (a colour or a packed colour, a width, a size, an
198
+ * opacity, a position, a row count, a state, a gate, a flag), never a level: every `*_by` and `*_where` key, in any
199
+ * section of the sheet. */
200
+ const WRUN_SELECTOR_KEY = /(?:_by|_where)$/;
201
+ /** The selector keys without the suffix: a renderer's `where` gate (`bgcolor`, `barcolor`, `shape`: a record on a
202
+ * row whose gate is finite and nonzero) and an output's `badges` (its value picks a ladder label as a chip). */
203
+ const WRUN_SELECTOR_BARE_KEYS = new Set(['where', 'badges']);
204
+ /** The block lists whose blocks name an output under `output` as a selector: an output's `hover` list (a `chips`
205
+ * block's value picks a ladder label, wrun-hover.util `resolveWrunChips`). Every block of the list counts, whatever
206
+ * its kind; a key nested deeper in a block (a ring's level) is read by the suffix rules alone. */
207
+ const WRUN_SELECTOR_BLOCK_LISTS = new Set(['hover']);
208
+ /**
209
+ * The selector columns of a sheet's row outputs (STAMPS round A, R2-2): every output index a selector-style field
210
+ * anywhere in the sheet names (by the output's name), and every barcolor output's own index. A selector field is any
211
+ * `*_by` or `*_where` key holding an output name, in every section that carries one: an output's `color_by`,
212
+ * `color_packed_by`, `width_by`, `stroke_width_by`, `shape_where`, `show_price_display_by`, `fill_color_by` and
213
+ * `fill_color_packed_by`; a fill's `color_by`, `color_packed_by` and `opacity_by`; a range's `color_by`,
214
+ * `color_packed_by`, `edge_width_by` and `show_price_display_by`; a renderer's, a table cell's, a box's, a card's, a
215
+ * hover block's, a legend entry's and the HUD's ladders (a section the interface leaves untyped, boxes and segments,
216
+ * included); plus a renderer's `where` gate, an output's `badges`, and the `output` a block of an output's `hover` list
217
+ * names (a `chips` block picks a ladder label with it). A barcolor output (`barcolor: true`) is a selector of itself:
218
+ * its value indexes its colours. Such a column picks a colour, a width, a shape, a chip or a gate, never a level, so a
219
+ * converging session's overlap proof compares it exactly whatever the tolerance (`wrunConvergedEqual` with no
220
+ * tolerance): a value a hair across an index boundary, a gate a hair off zero or a packed colour a few units off is
221
+ * another picture. Read by key, never by a list of sections, so a ladder a later sheet adds is a selector the day it
222
+ * ships. The chart's copy of the sdk rule the gate applies (one rule, two copies). Empty for a sheet that declares no
223
+ * selector. Pure.
224
+ */
225
+ export function wrunHistoryStampExactColumns(sheet) {
226
+ const outputs = Array.isArray(sheet.outputs) ? sheet.outputs : [];
227
+ const indexesByName = new Map();
228
+ for (const output of outputs) {
229
+ if (!isPlainRecord(output) || typeof output.name !== 'string' || !integerAtLeast(output.index, 0))
230
+ continue;
231
+ indexesByName.set(output.name, [...(indexesByName.get(output.name) ?? []), output.index]);
232
+ }
233
+ const columns = new Set();
234
+ if (indexesByName.size === 0)
235
+ return columns;
236
+ const select = (name) => {
237
+ if (typeof name !== 'string')
238
+ return;
239
+ for (const index of indexesByName.get(name) ?? [])
240
+ columns.add(index);
241
+ };
242
+ for (const output of outputs) {
243
+ if (isPlainRecord(output) && output.barcolor === true)
244
+ select(output.name);
245
+ }
246
+ // Every section, walked whole (a shared or looping container read once).
247
+ const pending = [sheet];
248
+ const walked = new Set();
249
+ while (pending.length > 0) {
250
+ const node = pending.pop();
251
+ if (node === null || typeof node !== 'object' || walked.has(node))
252
+ continue;
253
+ walked.add(node);
254
+ if (Array.isArray(node)) {
255
+ for (const item of node)
256
+ pending.push(item);
257
+ continue;
258
+ }
259
+ for (const [key, value] of Object.entries(node)) {
260
+ if (typeof value === 'string') {
261
+ if (WRUN_SELECTOR_KEY.test(key) || WRUN_SELECTOR_BARE_KEYS.has(key))
262
+ select(value);
263
+ }
264
+ else if (value !== null && typeof value === 'object') {
265
+ if (WRUN_SELECTOR_BLOCK_LISTS.has(key) && Array.isArray(value)) {
266
+ for (const block of value)
267
+ if (isPlainRecord(block))
268
+ select(block.output);
269
+ }
270
+ pending.push(value);
271
+ }
272
+ }
273
+ }
274
+ return columns;
124
275
  }
125
276
  const soundCount = (value) => value === undefined || (isFiniteNumber(value) && value >= 0);
126
277
  /** `warmup-cap` when the stamp carries a number the kit's affine bound never writes (a multiplier at or below 0, a
@@ -142,7 +293,8 @@ export function wrunHistoryWarmupNumbersRefusal(warmup) {
142
293
  return undefined;
143
294
  }
144
295
  /**
145
- * The W of an exact warm-up stamp with the overlay's param values (by name), or the reason it has none: the
296
+ * The W of a warm-up stamp with the overlay's param values (by name), or the reason it has none, one arithmetic for
297
+ * both kinds (a converging stamp's W counts accepted inputs, read off the same windows): the
146
298
  * stamp's numbers first (`wrunHistoryWarmupNumbersRefusal`, `warmup-cap`), then each window evaluated with the
147
299
  * declaration's own arithmetic (`wrunDeclaredWarmupBars` over the window alone: max(ceil(min),
148
300
  * ceil(sum(value x multiplier)) + plus), whole bars, a window answering nothing counting 0), summed, plus the
@@ -13,6 +13,11 @@ export declare function wrunChainServedTierNote(acquisition: Readonly<Record<str
13
13
  * alike). Undefined when every OPRA read rode real-time, or none was made.
14
14
  */
15
15
  export declare function wrunOpraLanesServedTierNote(acquisitions: Iterable<unknown> | undefined): string | undefined;
16
+ /** A tape read delayed: its venue, then the CTA statement verbatim (stock-tape-overlay.util `stockTapeLegendNote`). */
17
+ export declare function wrunStocksTapeDelayNote(exchange: string): string;
18
+ /** The tape note of the `stocks` lanes a run read (`wrunPlane: 'stocks'`, `exchange`, `servedTier`) when one rode the
19
+ * delayed reader (an unknown tier reads delayed); undefined otherwise. */
20
+ export declare function wrunStocksLanesServedTierNote(acquisitions: Iterable<unknown> | undefined): string | undefined;
16
21
  /**
17
22
  * The served tier of a hosted (Cloud) run's OPRA reads as its frame's receipt names it (`WrunOpraServedReceipt`,
18
23
  * contract opra-server-lanes C4), in the chain's own words: OPRA's delay notice for a delayed receipt (its minutes the
@@ -22,8 +27,12 @@ export declare function wrunOpraLanesServedTierNote(acquisitions: Iterable<unkno
22
27
  export declare function wrunCloudOpraServedNote(served: WrunOpraServedReceipt | undefined): string | undefined;
23
28
  /** The whole note a run's legend carries: the draft's word, then the served tier of its OPRA reads (the chain's,
24
29
  * else any OPRA lane's among `acquisitions`, the run's record by lane, else a Cloud run's frame receipt,
25
- * `cloudOpraServed`), joined by " · "; undefined when none applies. */
26
- export declare function wrunOverlayLegendNote(settings: unknown, chainAcquisition?: Readonly<Record<string, unknown>>, acquisitions?: Readonly<Record<string, unknown>>, cloudOpraServed?: WrunOpraServedReceipt): string | undefined;
30
+ * `cloudOpraServed`), then a delayed `stocks` lane's tape note, then one sentence per delayed CME leg (`cmeDelayed`),
31
+ * joined by " · "; undefined when none applies. */
32
+ export declare function wrunOverlayLegendNote(settings: unknown, chainAcquisition?: Readonly<Record<string, unknown>>, acquisitions?: Readonly<Record<string, unknown>>, cloudOpraServed?: WrunOpraServedReceipt, cmeDelayed?: ReadonlyArray<{
33
+ symbol: string;
34
+ mins: number;
35
+ }>): string | undefined;
27
36
  /**
28
37
  * Every wording a legend note can hold in a SAVED title that today's words do not produce: the title is
29
38
  * written by the run and kept in the overlay's settings, so a title written under an older build or another
@@ -42,10 +51,11 @@ export declare const WRUN_LEGACY_LEGEND_NOTES: {
42
51
  readonly draft: readonly ["draft · only in this browser", "草稿 · 仅在此浏览器中", "下書き · このブラウザのみ", "초안 · 이 브라우저에서만", "черновик · только в этом браузере", "ड्राफ़्ट · केवल इस ब्राउज़र में", "borrador · solo en este navegador", "taslak · yalnızca bu tarayıcıda"];
43
52
  };
44
53
  /** A legend title suffix (the define's custom title, as the overlay's settings keep it) without the note
45
- * `wrunOverlayLegendNote` appended to it, recomputed from the settings alone: the draft's word and the
46
- * delayed tier of the OPRA chain the settings' provenance names. The run that wrote the title may have read
47
- * that chain real-time (no tier note) or delayed, which the settings cannot tell, so the tier note is tried
48
- * off the end first (only on settings with OPRA provenance), then the draft's word (only on a draft), each in
49
- * today's words and in every pinned wording a saved title can hold (`WRUN_LEGACY_LEGEND_NOTES`). A suffix
50
- * that ends with none of them is returned as it is. */
54
+ * `wrunOverlayLegendNote` appended to it, recomputed from the settings alone: the delayed CME legs' sentences
55
+ * (today's words), the tape note (on tape provenance), the draft's word and the delayed tier of the OPRA chain the
56
+ * settings' provenance names. The run that wrote the title may have read that chain real-time (no tier note) or
57
+ * delayed, which the settings
58
+ * cannot tell, so the tier note is tried off the end first (only on settings with OPRA provenance), then the
59
+ * draft's word (only on a draft), each in today's words and in every pinned wording a saved title can hold
60
+ * (`WRUN_LEGACY_LEGEND_NOTES`). A suffix that ends with none of them is returned as it is. */
51
61
  export declare function wrunWithoutLegendNote(suffix: string, settings: unknown): string;
@@ -3,7 +3,7 @@
3
3
  * define (wrun-run-result.util `legendNote`, every full run and every live tick, so a tick never flips
4
4
  * it), resolved at call time against the active locale, never captured at module load:
5
5
  * - an editor draft's word (Kyle's decision, 2026-10-08): "draft · only in this browser"; a package
6
- * overlay, a hosted (Cloud) run and every non-draft answer none;
6
+ * overlay, a hosted (Cloud) run, an app layer (wrun-app-layer.leaf) and every non-draft answer none;
7
7
  * - the delay of an options chain the run read on the OPRA plane's delayed reader, the line a stock
8
8
  * chart's native options overlays carry (`optionsOverlayDisclosure`): OPRA's delay notice verbatim
9
9
  * (`OPRA_DELAY_NOTICE`, never translated). The tier rides the chain lane's acquisition (`chainServedTier`,
@@ -17,19 +17,28 @@
17
17
  * (contract opra-server-lanes C4: `wrunOpraTier` beside the cloud's OPRA mark, `WrunOpraServedReceipt`):
18
18
  * the same delayed line for a delayed receipt, none for a real-time one, and none for a frame that
19
19
  * named no tier (an unknown tier shows no word: the account's current tier is never put in its place).
20
+ * - a `stocks` row lane's delayed tape read: the order-flow legends' note, "NASDAQ · Delayed 15 minutes" (verbatim).
21
+ * - a CME leg read delayed off the chart's own exchange (wrun-cme-legs-note.util): a CME chart badge's sentence.
20
22
  * The note lands in the define's custom title, which the overlay's settings keep: every reader of the
21
23
  * inputs alone (the indicator menu, the settings headers) drops it through `wrunWithoutLegendNote`, the
22
24
  * one stripper of whatever `wrunOverlayLegendNote` appends, in today's words and in every wording a saved
23
25
  * title can still hold (`WRUN_LEGACY_LEGEND_NOTES`).
24
26
  */
25
27
  import { wrunChartHostEnv } from '../../host-env.js';
28
+ import { STOCKS_DELAY_STATEMENT } from '../../constants/stocks-compliance.constants.js';
29
+ import { WRUN_PLANE_PAYLOAD_KEY } from '../chart/opra-read-access.leaf.js';
30
+ import { isStocksTapeGoverned, stocksTapeVenueLabel } from '../v2/stocks-governed.util.js';
26
31
  import { optionVenueForExchange } from '../options/option-venue.util.js';
27
32
  import { optionVenueDelayMinutes, optionVenueDisclosure } from '../options/option-venue-disclosure.util.js';
28
33
  import { isWrunDraftOverlaySettings } from './wrun-draft-overlay.util.js';
34
+ import { isWrunAppLayerOverlaySettings } from './wrun-app-layer.leaf.js';
29
35
  import { isWrunOpraLaneAcquisition, wrunOpraLaneServedTier } from './wrun-opra-lane.util.js';
30
36
  export function wrunDraftLegendNote(settings) {
31
37
  if (!settings || typeof settings !== 'object' || !isWrunDraftOverlaySettings(settings))
32
38
  return undefined;
39
+ // An app layer rides the draft lane but is the app's own (wrun-app-layer.leaf): no draft word on its row.
40
+ if (isWrunAppLayerOverlaySettings(settings))
41
+ return undefined;
33
42
  return wrunChartHostEnv().t('wrun.draft.legend');
34
43
  }
35
44
  /**
@@ -66,6 +75,25 @@ export function wrunOpraLanesServedTierNote(acquisitions) {
66
75
  }
67
76
  return undefined;
68
77
  }
78
+ /** A tape read delayed: its venue, then the CTA statement verbatim (stock-tape-overlay.util `stockTapeLegendNote`). */
79
+ export function wrunStocksTapeDelayNote(exchange) {
80
+ return `${stocksTapeVenueLabel(exchange)} · ${STOCKS_DELAY_STATEMENT}`;
81
+ }
82
+ /** The tape note of the `stocks` lanes a run read (`wrunPlane: 'stocks'`, `exchange`, `servedTier`) when one rode the
83
+ * delayed reader (an unknown tier reads delayed); undefined otherwise. */
84
+ export function wrunStocksLanesServedTierNote(acquisitions) {
85
+ for (const acquisition of acquisitions ?? []) {
86
+ if (acquisition === null || typeof acquisition !== 'object')
87
+ continue;
88
+ const record = acquisition;
89
+ if (record[WRUN_PLANE_PAYLOAD_KEY] !== 'stocks' || record.servedTier === 'realtime')
90
+ continue;
91
+ const exchange = record.exchange;
92
+ if (typeof exchange === 'string' && isStocksTapeGoverned(exchange))
93
+ return wrunStocksTapeDelayNote(exchange);
94
+ }
95
+ return undefined;
96
+ }
69
97
  /**
70
98
  * The served tier of a hosted (Cloud) run's OPRA reads as its frame's receipt names it (`WrunOpraServedReceipt`,
71
99
  * contract opra-server-lanes C4), in the chain's own words: OPRA's delay notice for a delayed receipt (its minutes the
@@ -83,16 +111,28 @@ export function wrunCloudOpraServedNote(served) {
83
111
  : optionVenueDelayMinutes(venue);
84
112
  return optionVenueDisclosure(venue, 'delayed', minutes, wrunChartHostEnv().t);
85
113
  }
114
+ /** The badge sentence a delayed CME leg's note reads. */
115
+ const CME_DELAY_KEY = 'cmeRealtimeData.intro.bodyDelayedNoPurchase';
86
116
  /** The whole note a run's legend carries: the draft's word, then the served tier of its OPRA reads (the chain's,
87
117
  * else any OPRA lane's among `acquisitions`, the run's record by lane, else a Cloud run's frame receipt,
88
- * `cloudOpraServed`), joined by " · "; undefined when none applies. */
89
- export function wrunOverlayLegendNote(settings, chainAcquisition, acquisitions, cloudOpraServed) {
118
+ * `cloudOpraServed`), then a delayed `stocks` lane's tape note, then one sentence per delayed CME leg (`cmeDelayed`),
119
+ * joined by " · "; undefined when none applies. */
120
+ export function wrunOverlayLegendNote(settings, chainAcquisition, acquisitions, cloudOpraServed, cmeDelayed) {
90
121
  const opra = wrunChainServedTierNote(chainAcquisition) ??
91
122
  (acquisitions === undefined ? undefined : wrunOpraLanesServedTierNote(Object.values(acquisitions))) ??
92
123
  wrunCloudOpraServedNote(cloudOpraServed);
93
- const notes = [wrunDraftLegendNote(settings), opra].filter((note) => typeof note === 'string' && note.trim() !== '');
124
+ const stocks = acquisitions === undefined ? undefined : wrunStocksLanesServedTierNote(Object.values(acquisitions));
125
+ const cme = (cmeDelayed ?? []).map((leg) => wrunChartHostEnv().t(CME_DELAY_KEY, leg));
126
+ const notes = [wrunDraftLegendNote(settings), opra, stocks, ...cme].filter((note) => typeof note === 'string' && note.trim() !== '');
94
127
  return notes.length > 0 ? notes.join(' · ') : undefined;
95
128
  }
129
+ /** The tape provenance an overlay's settings keep (`metaExchange` naming a tape), else undefined. */
130
+ function wrunTapeOfProvenance(settings) {
131
+ const exchange = settings !== null && typeof settings === 'object'
132
+ ? settings.metaExchange
133
+ : undefined;
134
+ return typeof exchange === 'string' && isStocksTapeGoverned(exchange) ? exchange : undefined;
135
+ }
96
136
  /** The chain fact an overlay's settings keep for its note: the OPRA provenance its run stamps on them
97
137
  * (`metaExchange`, options-overlay-provenance.util `setOptionsOverlayOpraProvenance`) names a chain read
98
138
  * on the OPRA plane; the tier is the one a note names (delayed), since a real-time read appended none. */
@@ -164,16 +204,22 @@ function withoutTrailingNote(suffix, notes, legacy) {
164
204
  return suffix;
165
205
  }
166
206
  /** A legend title suffix (the define's custom title, as the overlay's settings keep it) without the note
167
- * `wrunOverlayLegendNote` appended to it, recomputed from the settings alone: the draft's word and the
168
- * delayed tier of the OPRA chain the settings' provenance names. The run that wrote the title may have read
169
- * that chain real-time (no tier note) or delayed, which the settings cannot tell, so the tier note is tried
170
- * off the end first (only on settings with OPRA provenance), then the draft's word (only on a draft), each in
171
- * today's words and in every pinned wording a saved title can hold (`WRUN_LEGACY_LEGEND_NOTES`). A suffix
172
- * that ends with none of them is returned as it is. */
207
+ * `wrunOverlayLegendNote` appended to it, recomputed from the settings alone: the delayed CME legs' sentences
208
+ * (today's words), the tape note (on tape provenance), the draft's word and the delayed tier of the OPRA chain the
209
+ * settings' provenance names. The run that wrote the title may have read that chain real-time (no tier note) or
210
+ * delayed, which the settings
211
+ * cannot tell, so the tier note is tried off the end first (only on settings with OPRA provenance), then the
212
+ * draft's word (only on a draft), each in today's words and in every pinned wording a saved title can hold
213
+ * (`WRUN_LEGACY_LEGEND_NOTES`). A suffix that ends with none of them is returned as it is. */
173
214
  export function wrunWithoutLegendNote(suffix, settings) {
174
215
  const chain = wrunChainOfProvenance(settings);
216
+ const tape = wrunTapeOfProvenance(settings);
175
217
  const draft = wrunDraftLegendNote(settings);
176
- let rest = chain ? withoutTrailingNote(suffix, [wrunChainServedTierNote(chain)], LEGACY_TAILS.opraTier) : suffix;
218
+ // The CME legs' sentences come last: cut from the first one, its symbol and figure any.
219
+ const cme = escapeRegExp(` · ${wrunChartHostEnv().t(CME_DELAY_KEY, { symbol: '\u0001', mins: '\u0002' })}`);
220
+ let rest = suffix.replace(new RegExp(`${cme.replace('\u0001', '.+?').replace('\u0002', '\\d+')}.*$`), '');
221
+ rest = tape !== undefined ? withoutTrailingNote(rest, [wrunStocksTapeDelayNote(tape)], []) : rest;
222
+ rest = chain ? withoutTrailingNote(rest, [wrunChainServedTierNote(chain)], LEGACY_TAILS.opraTier) : rest;
177
223
  if (draft !== undefined)
178
224
  rest = withoutTrailingNote(rest, [draft], LEGACY_TAILS.draft);
179
225
  return rest;
@@ -50,6 +50,9 @@ export interface WrunDraftRef {
50
50
  * document. */
51
51
  workspaceDigest?: string;
52
52
  position: 'onchart' | 'offchart';
53
+ /** The app layer this run is (a key of wrun-app-layer.leaf WRUN_APP_LAYERS): the app mounted the kit template for
54
+ * one of its panels (`mountWrunAppLayer`), so it is the app's own and its panel owns it. Absent on an editor draft. */
55
+ appLayer?: string;
53
56
  }
54
57
  /** Synthetic customScriptId for a draft: `wrun-draft-<key>`, every
55
58
  * non-alphanumeric run in the key collapsed to one dash (the registry slug
@@ -96,7 +99,7 @@ export interface WrunSourceCountMetadataLike {
96
99
  * - the grouped flow knobs (OPTLOAD G3, each value its own read): numbers as they are, a setting's name as written, a
97
100
  * flag true or false, `flow_expiries` absent "all", `span` absent "bar", `flow_history` (`history`) absent "window".
98
101
  */
99
- export type WrunKScriptPayloadKey = 'market' | 'odds' | 'interval' | 'expiries' | 'delta' | 'venue' | 'fund' | 'publisher' | 'series' | 'token' | 'asset' | 'ref' | 'min_size' | 'history' | 'scope' | 'dte' | 'moneyness' | 'chain_venue' | 'book' | 'stream_currency' | 'ticks_per_bar' | 'group' | 'flow_expiries' | 'strike_window_pct' | 'strike_rows' | 'min_volume' | 'min_premium' | 'split_dte' | 'fold_types' | 'span' | 'flow_history';
102
+ export type WrunKScriptPayloadKey = 'market' | 'odds' | 'interval' | 'expiries' | 'delta' | 'venue' | 'fund' | 'publisher' | 'series' | 'token' | 'asset' | 'ref' | 'min_size' | 'history' | 'scope' | 'dte' | 'moneyness' | 'chain_venue' | 'book' | 'stream_currency' | 'ticks_per_bar' | 'group' | 'flow_expiries' | 'strike_window_pct' | 'strike_rows' | 'min_volume' | 'min_premium' | 'split_dte' | 'fold_types' | 'span' | 'flow_history' | 'underlying';
100
103
  /** How a wrun source class reads as a kScript source call. */
101
104
  export interface WrunKScriptSourceMapping {
102
105
  /** The kScript-equivalent source type (a SOURCE_TYPE_CONFIG key, or a K data
@@ -128,8 +131,8 @@ export interface WrunKScriptSourceMapping {
128
131
  * stream one per bucket size too: each identity is its own leg fetch
129
132
  * (wrunLaneStreamLegFetchKey), as kScript's own sources take `currency` and
130
133
  * `ticksPerBar` params.
131
- * - The chart's own feeds, one lane fetch each (market pins are payload for
132
- * the hosted lane; the chart lane serves them on ohlcv alone): `trades` is
134
+ * - The chart's own feeds, one lane fetch each (a market pin is payload: a
135
+ * fetch of its own on that market): `trades` is
133
136
  * the buy/sell volume lane (both sides one fetch), `tape` the raw trade
134
137
  * lane, `book` the order book (block_size and max_depth shape the cells,
135
138
  * not the fetch), `volume_profile` the package's ONE profile lane
@@ -145,8 +148,9 @@ export interface WrunKScriptSourceMapping {
145
148
  * - No kScript type: `options_chain` (the package's ONE chain,
146
149
  * wrun_options_chain_one_venue), `token_supply` (one per token),
147
150
  * `series` (one per feed, its `ref`: the lane's own relay fetch) and the
148
- * OPRA scalar classes (`options_flow` one per scope, dte, moneyness and
149
- * venue: its knobs shape the acquisition). Any other
151
+ * OPRA scalar classes (`options_flow` one per scope, dte, moneyness,
152
+ * venue and underlying: its knobs shape the acquisition, and each root a
153
+ * package reads is a fetch of its own). Any other
150
154
  * class (metric, a class this table does not know) charges 1 per distinct
151
155
  * entry, keyed on every key but the read modifiers.
152
156
  * - The row lanes (sources/row-lanes/*) have no kScript type either:
@@ -180,9 +184,9 @@ export declare function wrunKScriptSourceOf(value: unknown): WrunKScriptSource |
180
184
  /** The slot charge of a sheet in kScript's unit (the rule above): the
181
185
  * weighted count of the distinct kScript sources its entries read, never
182
186
  * below 1. The per-bar sums of the chart chain's prints (`options_flow`
183
- * scope `prints`) ride the slot of the package's print read of that chain,
184
- * when it makes one: a print template reads its marks or table from the
185
- * prints and its columns from the sums, one slot (OPTLOAD W3: Flow Marks
186
- * 0.3.0, Option Prints 0.5.0). Sums with no such print read charge as
187
- * their own source. */
187
+ * scope `prints`, `underlying` auto) ride the slot of the package's print
188
+ * read of that chain, when it makes one: a print template reads its marks
189
+ * or table from the prints and its columns from the sums, one slot (OPTLOAD
190
+ * W3: Flow Marks 0.3.0, Option Prints 0.5.0). Sums with no such print read,
191
+ * and another root's sums, charge as their own source. */
188
192
  export declare function wrunMetadataSourceCount(metadata: WrunSourceCountMetadataLike): number;
@@ -77,8 +77,8 @@ export function isWrunDraftOverlaySettings(settings) {
77
77
  * stream one per bucket size too: each identity is its own leg fetch
78
78
  * (wrunLaneStreamLegFetchKey), as kScript's own sources take `currency` and
79
79
  * `ticksPerBar` params.
80
- * - The chart's own feeds, one lane fetch each (market pins are payload for
81
- * the hosted lane; the chart lane serves them on ohlcv alone): `trades` is
80
+ * - The chart's own feeds, one lane fetch each (a market pin is payload: a
81
+ * fetch of its own on that market): `trades` is
82
82
  * the buy/sell volume lane (both sides one fetch), `tape` the raw trade
83
83
  * lane, `book` the order book (block_size and max_depth shape the cells,
84
84
  * not the fetch), `volume_profile` the package's ONE profile lane
@@ -94,8 +94,9 @@ export function isWrunDraftOverlaySettings(settings) {
94
94
  * - No kScript type: `options_chain` (the package's ONE chain,
95
95
  * wrun_options_chain_one_venue), `token_supply` (one per token),
96
96
  * `series` (one per feed, its `ref`: the lane's own relay fetch) and the
97
- * OPRA scalar classes (`options_flow` one per scope, dte, moneyness and
98
- * venue: its knobs shape the acquisition). Any other
97
+ * OPRA scalar classes (`options_flow` one per scope, dte, moneyness,
98
+ * venue and underlying: its knobs shape the acquisition, and each root a
99
+ * package reads is a fetch of its own). Any other
99
100
  * class (metric, a class this table does not know) charges 1 per distinct
100
101
  * entry, keyed on every key but the read modifiers.
101
102
  * - The row lanes (sources/row-lanes/*) have no kScript type either:
@@ -192,12 +193,16 @@ export const WRUN_KSCRIPT_SOURCE_CLASSES = Object.freeze({
192
193
  },
193
194
  series: { type: null, payload: ['ref'] },
194
195
  // The flow scope rows of the chart's chain (sources/lanes/options_flow, a chain lane read by `auto`, its `venue` a
195
- // scope's venue): one fetch per scope, dte, moneyness, venue and a ticker's book.
196
- options_flow: { type: null, payload: ['scope', 'dte', 'moneyness', 'venue', 'book'] },
196
+ // scope's venue): one fetch per scope, dte, moneyness, venue, a ticker's book and root (`underlying`, contract F: the
197
+ // lane plans each root's read as an instance of its own).
198
+ options_flow: { type: null, payload: ['scope', 'dte', 'moneyness', 'venue', 'book', 'underlying'] },
197
199
  // The statistics of the chart's options chain (sources/lanes/option_daily, a chain lane): one fetch per venue word
198
200
  // and book, as the lane plans its instances.
199
201
  option_daily: { type: null, payload: ['chain_venue', 'book'] },
200
202
  option_stats_10m: { type: null, payload: ['chain_venue', 'book'] },
203
+ // The off-exchange prints of the chart's US stock tape (sources/row-lanes/dark_pool, kit 0.116.0): every input of a
204
+ // chart shares the lane's one read (`overflow` and `max_cells` shape the cells, never the fetch), so one fetch.
205
+ dark_pool: { type: null, payload: [] },
201
206
  });
202
207
  /** The kScript source weights (SOURCE_TYPE_CONFIG's `weight`; a type absent
203
208
  * here weighs 1). A spec pins the copy. */
@@ -254,6 +259,7 @@ const WRUN_READ_MODIFIER_KEYS = new Set([
254
259
  'symbol_param',
255
260
  'block_size',
256
261
  'max_depth',
262
+ 'bands',
257
263
  'expiries',
258
264
  ]);
259
265
  const hasOwn = (record, key) => Object.prototype.hasOwnProperty.call(record, key);
@@ -335,6 +341,8 @@ function payloadEntry(key, entry) {
335
341
  return [key, entry[key] === true];
336
342
  case 'span':
337
343
  return ['span', knobWord(entry.span) ?? 'bar'];
344
+ case 'underlying':
345
+ return ['underlying', knobWord(entry.underlying) ?? 'auto'];
338
346
  case 'flow_history':
339
347
  return ['history', knobWord(entry.history) ?? 'window'];
340
348
  default:
@@ -391,19 +399,23 @@ function readsChartChainPrints(entry) {
391
399
  const venue = knobWord(entry.venue);
392
400
  return WRUN_PRINT_READ_CLASSES.has(knobWord(entry.source) ?? '') && (venue === undefined || venue === 'auto');
393
401
  }
394
- /** Whether an entry is the per-bar sums of the chart chain's prints: `options_flow` under scope `prints` (it takes
395
- * no venue or book there, so it always reads the chart's own chain). */
402
+ /** Whether an entry is the per-bar sums of the chart chain's prints: `options_flow` under scope `prints` (it takes no
403
+ * venue or book there) reading the chart's own chain (`underlying` absent or `auto`: another root's sums read that
404
+ * root's chain, a fetch of their own). */
396
405
  function sumsChartChainPrints(entry) {
397
- return knobWord(entry.source) === 'options_flow' && knobWord(entry.scope) === 'prints';
406
+ const underlying = knobWord(entry.underlying);
407
+ return (knobWord(entry.source) === 'options_flow' &&
408
+ knobWord(entry.scope) === 'prints' &&
409
+ (underlying === undefined || underlying === 'auto'));
398
410
  }
399
411
  /** The slot charge of a sheet in kScript's unit (the rule above): the
400
412
  * weighted count of the distinct kScript sources its entries read, never
401
413
  * below 1. The per-bar sums of the chart chain's prints (`options_flow`
402
- * scope `prints`) ride the slot of the package's print read of that chain,
403
- * when it makes one: a print template reads its marks or table from the
404
- * prints and its columns from the sums, one slot (OPTLOAD W3: Flow Marks
405
- * 0.3.0, Option Prints 0.5.0). Sums with no such print read charge as
406
- * their own source. */
414
+ * scope `prints`, `underlying` auto) ride the slot of the package's print
415
+ * read of that chain, when it makes one: a print template reads its marks
416
+ * or table from the prints and its columns from the sums, one slot (OPTLOAD
417
+ * W3: Flow Marks 0.3.0, Option Prints 0.5.0). Sums with no such print read,
418
+ * and another root's sums, charge as their own source. */
407
419
  export function wrunMetadataSourceCount(metadata) {
408
420
  const entries = Object.values(metadata.inputSources ?? {}).filter((value) => value !== null && typeof value === 'object');
409
421
  const printRead = entries.find(readsChartChainPrints);
@@ -21,6 +21,7 @@
21
21
  import { wrunChartHostEnv } from '../../host-env.js';
22
22
  import { EARNINGS_TICKER_PATTERN, earningsScopeKey, tickerWindow, } from '../market-events/earnings-scope.util.js';
23
23
  import { earningsSlot, isReleased, paneTicker } from '../market-events/market-events.util.js';
24
+ import { serverNowMs } from '../auth/server-clock.util.js';
24
25
  /** The host_fill words of the earnings facts, in declaration order (om `WRUN_EARNINGS_FACT_FILLS`). */
25
26
  export const WRUN_EARNINGS_FACT_FILLS = Object.freeze(['earnings_next_ms', 'earnings_prev_ms', 'earnings_session']);
26
27
  const UNKNOWN = Object.freeze({ earningsNextMs: 0, earningsPrevMs: 0, earningsSession: 0 });
@@ -79,7 +80,7 @@ let earningsStore;
79
80
  * The facts the chart fills for `market` now (synchronous): off the earnings window the store holds for its ticker
80
81
  * (warmed by `warmWrunEarningsFacts`, or held by the chart's pips), 0 for each fact the window does not answer.
81
82
  */
82
- export function wrunEarningsFactsFor(market, nowMs = Date.now()) {
83
+ export function wrunEarningsFactsFor(market, nowMs = serverNowMs()) {
83
84
  const ticker = wrunEarningsTickerOf(market);
84
85
  if (ticker === null || earningsStore === undefined)
85
86
  return UNKNOWN;
@@ -93,7 +94,7 @@ export function wrunEarningsFactsFor(market, nowMs = Date.now()) {
93
94
  * whenever this run is its only holder, so a backend slower than the deadline would never fill the facts. Never
94
95
  * rejects; a chart with no ticker asks nothing.
95
96
  */
96
- export async function warmWrunEarningsFacts(market, timeoutMs = WRUN_EARNINGS_WARM_TIMEOUT_MS, nowMs = Date.now()) {
97
+ export async function warmWrunEarningsFacts(market, timeoutMs = WRUN_EARNINGS_WARM_TIMEOUT_MS, nowMs = serverNowMs()) {
97
98
  const ticker = wrunEarningsTickerOf(market);
98
99
  if (ticker === null)
99
100
  return;
@@ -78,5 +78,7 @@ export declare function wrunHostedFactsAsked(chartIndex: number, overlayId: stri
78
78
  /** Forget what the cloud asked: one overlay on one chart, every overlay of a chart (`overlayId`
79
79
  * undefined), or one overlay on every chart (`chartIndex` undefined). */
80
80
  export declare function forgetWrunHostedFactsAsked(chartIndex: number | undefined, overlayId?: string): void;
81
+ /** A person's Retry or Run once must not wait out a failed or empty listing's rest; a definite answer stays. */
82
+ export declare function forgetWrunEtfFundsFailures(): void;
81
83
  /** Forget every kept answer and every asked list (spec isolation). */
82
84
  export declare function clearWrunEtfFundsMemo(): void;
@@ -233,6 +233,10 @@ export function forgetWrunHostedFactsAsked(chartIndex, overlayId) {
233
233
  asked.delete(key);
234
234
  }
235
235
  }
236
+ /** A person's Retry or Run once must not wait out a failed or empty listing's rest; a definite answer stays. */
237
+ export function forgetWrunEtfFundsFailures() {
238
+ retryAfter.clear();
239
+ }
236
240
  /** Forget every kept answer and every asked list (spec isolation). */
237
241
  export function clearWrunEtfFundsMemo() {
238
242
  settled.clear();
@@ -19,6 +19,7 @@
19
19
  * session in.
20
20
  */
21
21
  import isEqual from 'lodash-es/isEqual.js';
22
+ import { SOURCE_HISTORY_AS_OF_FIELD } from '../../kscript-data/controls/live-trades-merge.util.js';
22
23
  import { isWrunTradesLegLane } from './wrun-trades-lane.util.js';
23
24
  /** The lanes a session may hold, by the buffer each one fills: the row builder's history lanes,
24
25
  * each one window ask the reconcile keeps current, and every trades leg lane (`tradeLegRows`, by
@@ -38,8 +39,12 @@ const HELD_LANE_ROWS = {
38
39
  /** Acquisition words that are not the lane's own ask: the chart words the chart's fetch resolves
39
40
  * into the payload object in place (titan-charts dataFetch writes the chart's symbol, exchange and
40
41
  * coin over the placeholders and stamps the interval, and the acquisition records that object),
41
- * judged here by the market identity and the clock instead; and how the history was served, the
42
- * book's transport (the packed worker or the plain lane) and the profile's lattice step. */
42
+ * judged here by the market identity and the clock instead; how the history was served, the
43
+ * book's transport (the packed worker or the plain lane) and the profile's lattice step; and the
44
+ * instant a declared history counts back from (`SOURCE_HISTORY_AS_OF_FIELD`): a live session names
45
+ * its pin from its second run on (wrun-history-as-of.util), the same instant its first run counted
46
+ * back from unnamed, so it is judged by the session (this overlay's own, on the same market and
47
+ * clock) and never by the word. */
43
48
  const NOT_THE_ASK = new Set([
44
49
  'symbol',
45
50
  'exchange',
@@ -47,6 +52,7 @@ const NOT_THE_ASK = new Set([
47
52
  'interval',
48
53
  'preferPackedOrderbookWorker',
49
54
  'minimumBarHeight',
55
+ SOURCE_HISTORY_AS_OF_FIELD,
50
56
  ]);
51
57
  function askOf(acquisition) {
52
58
  return Object.fromEntries(Object.entries(acquisition).filter(([word]) => !NOT_THE_ASK.has(word)));