@orangecharts/wrun-chart-host 0.11.1 → 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 (307) 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 +17 -0
  16. package/dist/index.js +18 -0
  17. package/dist/indicators/controls/tpo-session.util.d.ts +52 -12
  18. package/dist/indicators/controls/tpo-session.util.js +113 -16
  19. package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +6 -0
  20. package/dist/instances/script-engine-worker-ohlcv-transfer.js +16 -0
  21. package/dist/interfaces/cme-realtime.interface.d.ts +8 -0
  22. package/dist/interfaces/cme-realtime.interface.js +2 -1
  23. package/dist/interfaces/feed.interface.d.ts +15 -1
  24. package/dist/interfaces/replay.interface.d.ts +5 -0
  25. package/dist/interfaces/stocks-realtime.interface.d.ts +4 -3
  26. package/dist/interfaces/stocks-realtime.interface.js +5 -4
  27. package/dist/interfaces/wrun-runtime.interface.d.ts +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/om-panel.util.d.ts +5 -3
  88. package/dist/utility/chart/om-panel.util.js +42 -7
  89. package/dist/utility/chart/om-target.util.d.ts +14 -1
  90. package/dist/utility/chart/om-target.util.js +22 -5
  91. package/dist/utility/chart/opra-read-access.leaf.d.ts +16 -1
  92. package/dist/utility/chart/opra-read-access.leaf.js +22 -0
  93. package/dist/utility/chart/profile-row-height.util.d.ts +49 -16
  94. package/dist/utility/chart/profile-row-height.util.js +74 -37
  95. package/dist/utility/chart/rth-session.util.d.ts +55 -20
  96. package/dist/utility/chart/rth-session.util.js +94 -46
  97. package/dist/utility/chart/session-lattice.util.d.ts +150 -0
  98. package/dist/utility/chart/session-lattice.util.js +488 -0
  99. package/dist/utility/chart/trading-day.util.d.ts +40 -2
  100. package/dist/utility/chart/trading-day.util.js +84 -7
  101. package/dist/utility/chart/us-equities-session.util.d.ts +32 -11
  102. package/dist/utility/chart/us-equities-session.util.js +44 -15
  103. package/dist/utility/chart/window-geometry.leaf.d.ts +28 -7
  104. package/dist/utility/chart/window-geometry.leaf.js +57 -8
  105. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +21 -14
  106. package/dist/utility/chart/wrun-bar-session-facts.util.js +32 -38
  107. package/dist/utility/chart/wrun-run-result.util.d.ts +29 -12
  108. package/dist/utility/chart/wrun-run-result.util.js +89 -25
  109. package/dist/utility/common/time.util.js +5 -4
  110. package/dist/utility/market-events/earnings-scope.util.d.ts +10 -5
  111. package/dist/utility/market-events/earnings-scope.util.js +17 -9
  112. package/dist/utility/market-events/market-events.util.d.ts +14 -7
  113. package/dist/utility/market-events/market-events.util.js +30 -17
  114. package/dist/utility/number-format.util.d.ts +14 -21
  115. package/dist/utility/number-format.util.js +38 -24
  116. package/dist/utility/options/option-venue-disclosure.util.d.ts +40 -6
  117. package/dist/utility/options/option-venue-disclosure.util.js +71 -11
  118. package/dist/utility/options/option-venue.util.d.ts +1 -1
  119. package/dist/utility/options/option-venue.util.js +1 -1
  120. package/dist/utility/pool-symbol.leaf.d.ts +7 -0
  121. package/dist/utility/pool-symbol.leaf.js +50 -5
  122. package/dist/utility/stocks/stock-display.util.d.ts +15 -0
  123. package/dist/utility/stocks/stock-display.util.js +37 -0
  124. package/dist/utility/symbol-selection/contract-expiry.util.js +5 -4
  125. package/dist/utility/v2/gate-plane.util.d.ts +6 -0
  126. package/dist/utility/v2/gate-plane.util.js +11 -1
  127. package/dist/utility/v2/gate-session-latch.util.d.ts +1 -1
  128. package/dist/utility/v2/gate-session-latch.util.js +3 -3
  129. package/dist/utility/v2/governed-tier.leaf.d.ts +17 -16
  130. package/dist/utility/v2/governed-tier.leaf.js +17 -16
  131. package/dist/utility/v2/stocks-governed.util.d.ts +5 -0
  132. package/dist/utility/v2/stocks-governed.util.js +14 -0
  133. package/dist/utility/v2/v2-enums.leaf.d.ts +13 -0
  134. package/dist/utility/v2/v2-enums.leaf.js +458 -0
  135. package/dist/utility/wrun/derived-roots.leaf.d.ts +21 -1
  136. package/dist/utility/wrun/derived-roots.leaf.js +27 -1
  137. package/dist/utility/wrun/derived-roots.util.d.ts +44 -32
  138. package/dist/utility/wrun/derived-roots.util.js +97 -56
  139. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -3
  140. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -3
  141. package/dist/utility/wrun/sources/lanes/option_daily.d.ts +2 -1
  142. package/dist/utility/wrun/sources/lanes/option_daily.js +2 -1
  143. package/dist/utility/wrun/sources/lanes/options_flow.d.ts +3 -0
  144. package/dist/utility/wrun/sources/lanes/options_flow.js +23 -5
  145. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +3 -4
  146. package/dist/utility/wrun/sources/row-lane-registry.js +9 -4
  147. package/dist/utility/wrun/sources/row-lanes/dark_pool.d.ts +19 -0
  148. package/dist/utility/wrun/sources/row-lanes/dark_pool.js +104 -0
  149. package/dist/utility/wrun/sources/row-lanes/index.js +2 -0
  150. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.d.ts +20 -0
  151. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.js +103 -0
  152. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -2
  153. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +15 -13
  154. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +49 -23
  155. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +14 -9
  156. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +75 -27
  157. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +139 -82
  158. package/dist/utility/wrun/wrun-app-layer.leaf.d.ts +78 -0
  159. package/dist/utility/wrun/wrun-app-layer.leaf.js +89 -0
  160. package/dist/utility/wrun/wrun-bar-count.util.d.ts +11 -7
  161. package/dist/utility/wrun/wrun-bar-count.util.js +12 -8
  162. package/dist/utility/wrun/wrun-batched-kinds.leaf.d.ts +13 -0
  163. package/dist/utility/wrun/wrun-batched-kinds.leaf.js +18 -0
  164. package/dist/utility/wrun/wrun-batched-marks.util.d.ts +41 -22
  165. package/dist/utility/wrun/wrun-batched-marks.util.js +255 -59
  166. package/dist/utility/wrun/wrun-batched-readout.util.d.ts +26 -19
  167. package/dist/utility/wrun/wrun-batched-readout.util.js +81 -27
  168. package/dist/utility/wrun/wrun-book-bands.leaf.d.ts +8 -0
  169. package/dist/utility/wrun/wrun-book-bands.leaf.js +7 -0
  170. package/dist/utility/wrun/wrun-candle-equal.leaf.d.ts +19 -0
  171. package/dist/utility/wrun/wrun-candle-equal.leaf.js +40 -0
  172. package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -2
  173. package/dist/utility/wrun/wrun-canvases.util.js +7 -3
  174. package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +6 -3
  175. package/dist/utility/wrun/wrun-chart-context-names.util.js +8 -4
  176. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +47 -29
  177. package/dist/utility/wrun/wrun-chart-market-facts.util.js +201 -201
  178. package/dist/utility/wrun/wrun-child-overlay-id.util.js +2 -1
  179. package/dist/utility/wrun/wrun-cme-legs-note.util.d.ts +15 -0
  180. package/dist/utility/wrun/wrun-cme-legs-note.util.js +49 -0
  181. package/dist/utility/wrun/wrun-cme-root-specs.util.d.ts +38 -0
  182. package/dist/utility/wrun/wrun-cme-root-specs.util.js +81 -0
  183. package/dist/utility/wrun/wrun-coin-lane-live.util.js +3 -0
  184. package/dist/utility/wrun/wrun-color-settings.util.d.ts +6 -1
  185. package/dist/utility/wrun/wrun-color-settings.util.js +32 -7
  186. package/dist/utility/wrun/wrun-dark-pool.util.d.ts +50 -0
  187. package/dist/utility/wrun/wrun-dark-pool.util.js +127 -0
  188. package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +67 -12
  189. package/dist/utility/wrun/wrun-declared-warmup.util.js +165 -13
  190. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +18 -8
  191. package/dist/utility/wrun/wrun-draft-legend-note.util.js +57 -11
  192. package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +14 -10
  193. package/dist/utility/wrun/wrun-draft-overlay.util.js +26 -14
  194. package/dist/utility/wrun/wrun-earnings-facts.util.js +3 -2
  195. package/dist/utility/wrun/wrun-etf-funds.util.d.ts +2 -0
  196. package/dist/utility/wrun/wrun-etf-funds.util.js +4 -0
  197. package/dist/utility/wrun/wrun-held-lanes.util.js +8 -2
  198. package/dist/utility/wrun/wrun-history-as-of.util.d.ts +77 -0
  199. package/dist/utility/wrun/wrun-history-as-of.util.js +108 -0
  200. package/dist/utility/wrun/wrun-host.service.d.ts +64 -14
  201. package/dist/utility/wrun/wrun-host.service.js +137 -27
  202. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +3 -3
  203. package/dist/utility/wrun/wrun-hosted-wire-caps.js +12 -2
  204. package/dist/utility/wrun/wrun-inert-legend.util.d.ts +13 -0
  205. package/dist/utility/wrun/wrun-inert-legend.util.js +31 -3
  206. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +7 -5
  207. package/dist/utility/wrun/wrun-input-requirements.leaf.js +16 -6
  208. package/dist/utility/wrun/wrun-install-pacer.util.d.ts +26 -0
  209. package/dist/utility/wrun/wrun-install-pacer.util.js +145 -0
  210. package/dist/utility/wrun/wrun-kit-refusal-stages.types.d.ts +22 -0
  211. package/dist/utility/wrun/wrun-kit-refusal-stages.types.js +1 -0
  212. package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +12 -5
  213. package/dist/utility/wrun/wrun-lane-refusal.leaf.js +23 -5
  214. package/dist/utility/wrun/wrun-lane-warmup.util.js +22 -4
  215. package/dist/utility/wrun/wrun-leg-close.util.d.ts +6 -5
  216. package/dist/utility/wrun/wrun-leg-close.util.js +11 -9
  217. package/dist/utility/wrun/wrun-leg-fetch.util.d.ts +3 -1
  218. package/dist/utility/wrun/wrun-leg-fetch.util.js +9 -2
  219. package/dist/utility/wrun/wrun-levels-child.util.d.ts +2 -0
  220. package/dist/utility/wrun/wrun-levels-child.util.js +6 -0
  221. package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -0
  222. package/dist/utility/wrun/wrun-live-intake.util.d.ts +15 -6
  223. package/dist/utility/wrun/wrun-live-intake.util.js +167 -47
  224. package/dist/utility/wrun/wrun-live-tick.util.d.ts +52 -8
  225. package/dist/utility/wrun/wrun-live-tick.util.js +648 -97
  226. package/dist/utility/wrun/wrun-market-facts.util.d.ts +16 -2
  227. package/dist/utility/wrun/wrun-market-facts.util.js +32 -3
  228. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +27 -27
  229. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +28 -16
  230. package/dist/utility/wrun/wrun-market-size-defaults.util.js +34 -5
  231. package/dist/utility/wrun/wrun-oi-lane.util.d.ts +10 -7
  232. package/dist/utility/wrun/wrun-oi-lane.util.js +16 -10
  233. package/dist/utility/wrun/wrun-option-strike-flow.util.js +1 -1
  234. package/dist/utility/wrun/wrun-option-views.util.d.ts +2 -2
  235. package/dist/utility/wrun/wrun-option-views.util.js +5 -2
  236. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.d.ts +5 -0
  237. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.js +16 -0
  238. package/dist/utility/wrun/wrun-options-stop.util.d.ts +3 -2
  239. package/dist/utility/wrun/wrun-options-stop.util.js +6 -4
  240. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +75 -11
  241. package/dist/utility/wrun/wrun-overlay-drivers.util.js +176 -43
  242. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +20 -10
  243. package/dist/utility/wrun/wrun-overlay-park.util.d.ts +84 -0
  244. package/dist/utility/wrun/wrun-overlay-park.util.js +135 -0
  245. package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +37 -4
  246. package/dist/utility/wrun/wrun-overlay-recovery.util.js +26 -14
  247. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +239 -24
  248. package/dist/utility/wrun/wrun-overlay-run.util.js +2204 -405
  249. package/dist/utility/wrun/wrun-pack.util.d.ts +8 -5
  250. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +2 -1
  251. package/dist/utility/wrun/wrun-panel-mount.util.js +20 -14
  252. package/dist/utility/wrun/wrun-panel-style.util.d.ts +4 -2
  253. package/dist/utility/wrun/wrun-panel-style.util.js +3 -2
  254. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +7 -0
  255. package/dist/utility/wrun/wrun-pin-spelling.util.js +18 -4
  256. package/dist/utility/wrun/wrun-pin-venues.util.d.ts +26 -17
  257. package/dist/utility/wrun/wrun-pin-venues.util.js +43 -36
  258. package/dist/utility/wrun/wrun-pinned-lanes.util.d.ts +58 -0
  259. package/dist/utility/wrun/wrun-pinned-lanes.util.js +72 -0
  260. package/dist/utility/wrun/wrun-prefix-cohort.util.js +2 -1
  261. package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +22 -9
  262. package/dist/utility/wrun/wrun-prefix-lanes.util.js +145 -26
  263. package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +29 -0
  264. package/dist/utility/wrun/wrun-prefix-proof.util.js +23 -5
  265. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +9 -1
  266. package/dist/utility/wrun/wrun-refusal-surface.util.js +15 -1
  267. package/dist/utility/wrun/wrun-refusal.util.d.ts +19 -1
  268. package/dist/utility/wrun/wrun-refusal.util.js +103 -16
  269. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +20 -6
  270. package/dist/utility/wrun/wrun-registry-errors.util.js +20 -6
  271. package/dist/utility/wrun/wrun-replay-rows.util.js +6 -10
  272. package/dist/utility/wrun/wrun-run-health.util.d.ts +89 -2
  273. package/dist/utility/wrun/wrun-run-health.util.js +204 -1
  274. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +2 -2
  275. package/dist/utility/wrun/wrun-run-interval-session.util.js +2 -2
  276. package/dist/utility/wrun/wrun-run-interval.util.d.ts +9 -8
  277. package/dist/utility/wrun/wrun-run-interval.util.js +13 -11
  278. package/dist/utility/wrun/wrun-sandbox-row-source.js +5 -2
  279. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +13 -3
  280. package/dist/utility/wrun/wrun-script-inputs.util.js +51 -13
  281. package/dist/utility/wrun/wrun-session-composition.util.d.ts +81 -0
  282. package/dist/utility/wrun/wrun-session-composition.util.js +169 -0
  283. package/dist/utility/wrun/wrun-setting-words.util.d.ts +10 -7
  284. package/dist/utility/wrun/wrun-setting-words.util.js +25 -7
  285. package/dist/utility/wrun/wrun-source-rows.util.d.ts +94 -28
  286. package/dist/utility/wrun/wrun-source-rows.util.js +738 -93
  287. package/dist/utility/wrun/wrun-stream-clock.util.d.ts +45 -0
  288. package/dist/utility/wrun/wrun-stream-clock.util.js +108 -0
  289. package/dist/utility/wrun/wrun-tape-coins.util.d.ts +116 -0
  290. package/dist/utility/wrun/wrun-tape-coins.util.js +110 -0
  291. package/dist/utility/wrun/wrun-tape-source.util.d.ts +62 -32
  292. package/dist/utility/wrun/wrun-tape-source.util.js +72 -34
  293. package/dist/utility/wrun/wrun-tier-grid.util.d.ts +13 -5
  294. package/dist/utility/wrun/wrun-tier-grid.util.js +23 -13
  295. package/dist/utility/wrun/wrun-tpo-rows.util.js +2 -1
  296. package/dist/utility/wrun/wrun-trades-lane.util.d.ts +73 -0
  297. package/dist/utility/wrun/wrun-trades-lane.util.js +82 -0
  298. package/dist/utility/wrun/wrun-twin-compute-inputs.util.d.ts +5 -0
  299. package/dist/utility/wrun/wrun-twin-compute-inputs.util.js +9 -2
  300. package/dist/utility/wrun/wrun-visibility-table.d.ts +13 -0
  301. package/dist/utility/wrun/wrun-visibility-table.js +9 -0
  302. package/dist/utility/wrun/wrun-volume-profile.util.js +7 -3
  303. package/dist/utils/replay/replay-buffer-math.d.ts +16 -6
  304. package/dist/utils/replay/replay-buffer-math.js +60 -30
  305. package/dist/workers/constants/socket-slots.d.ts +11 -7
  306. package/dist/workers/constants/socket-slots.js +6 -5
  307. package/package.json +5 -5
@@ -1,4 +1,6 @@
1
1
  import { wrunLegendName } from '../chart/wrun-legend-name.util.js';
2
+ import { isWrunLegStreamClass } from './wrun-leg-stream-classes.js';
3
+ import { WRUN_VISIBILITY_RULES, wrunOutputDraw } from './wrun-visibility-table.js';
2
4
  import { attachWrunRefusal, wrunOptionsStopSeed, wrunRefusalFor, } from './wrun-refusal.util.js';
3
5
  export const WRUN_NO_READY_ROWS_CODE = 'WRUN_NO_READY_ROWS';
4
6
  export const WRUN_OUTPUT_ALL_NAN_CODE = 'WRUN_OUTPUT_ALL_NAN';
@@ -182,7 +184,10 @@ const CONTINUOUS_PLOTS = new Set(['line', 'area', 'histogram', 'bar']);
182
184
  const DEFAULT_PLOT = 'line';
183
185
  export function wrunRunHealth(metadata, rows) {
184
186
  const outputs = Array.isArray(metadata?.outputs) ? metadata.outputs : [];
185
- const watched = outputs.filter((output) => CONTINUOUS_PLOTS.has(output.plot ?? DEFAULT_PLOT) && output.legend !== false && output.visible !== false);
187
+ const watched = outputs.filter((output) => CONTINUOUS_PLOTS.has(output.plot ?? DEFAULT_PLOT) &&
188
+ output.legend !== false &&
189
+ output.visible !== false &&
190
+ output.omit_if_empty !== true);
186
191
  const finite = new Set();
187
192
  let ready = 0;
188
193
  for (const row of rows) {
@@ -271,3 +276,201 @@ export function wrunNothingReadyRefusal(health, ctx) {
271
276
  return null;
272
277
  return wrunRowRefusal({ cls: 'nothing-ready' }, noReadyRowsMessage(health), ctx);
273
278
  }
279
+ // ---------------------------------------------------------------------------
280
+ // The viewer's nothing-drawn note (FB27)
281
+ // ---------------------------------------------------------------------------
282
+ /**
283
+ * A published Indicator that drew nothing over the whole loaded window (ready bars came, no plotted value was finite
284
+ * on any of them, the run made no drawing) used to tell its viewer nothing: the all-NaN rows above are a draft's, and
285
+ * a viewer saw a legend row over an empty chart (ZigZag on 1m forex, a band that reads volume on quote candles, a
286
+ * 50-week average on a 1h chart). The note says it once, quietly (the `nothing-ready` record's `drawn` variant, a
287
+ * note: no toast), and says the cause instead when the run knows it (`reach`: a scalar input pinned to a coarser
288
+ * interval, whatever its `bars`, or a candles stream with no `bars`, sees only the few candles the loaded history
289
+ * spans). Its own owned set beside the health rows:
290
+ * the live tick re-reads those (a viewer keeps only the nothing-ready row there), so this note is raised by a full
291
+ * run, a reseed, an adoption and a landed page, and lowered by any integrate that draws, a tick's included
292
+ * (wrun-overlay-run.util `presentWrunIntegration`).
293
+ */
294
+ export const WRUN_NOTHING_DRAWN_CODE = 'WRUN_NOTHING_DRAWN';
295
+ export const WRUN_NOTHING_DRAWN_ROW_CODES = new Set([WRUN_NOTHING_DRAWN_CODE]);
296
+ /**
297
+ * The sections of the visibility table (wrun-visibility-table `WRUN_VISIBILITY_RULES`) whose picture the rows hold:
298
+ * an output's values, a fill's or a range's edges (outputs too) and the handle kinds (the live set riding the rows),
299
+ * plus the two that draw nothing of their own (the look, the pane layout). Every other section (a renderer, a box, a
300
+ * segment, a drawing, a canvas, a level, a panel, a batched mark, the stats strip, the strategy's markers) draws
301
+ * through a builder of its own, so a sheet declaring one is never judged empty: the note claims nothing it cannot see.
302
+ */
303
+ const ROW_JUDGED_SECTIONS = new Set([
304
+ 'outputs',
305
+ 'ranges',
306
+ 'fills',
307
+ 'handles',
308
+ 'presentation',
309
+ 'panes',
310
+ ]);
311
+ /** Sheet keys outside the visibility table that feed a builder of their own (wrun-4 frames). */
312
+ const BUILDER_SHEET_KEYS = ['frames'];
313
+ function declaresAny(value) {
314
+ if (Array.isArray(value))
315
+ return value.length > 0;
316
+ if (typeof value === 'object' && value !== null)
317
+ return Object.keys(value).length > 0;
318
+ return value !== undefined && value !== null && value !== false;
319
+ }
320
+ function recordsOf(value) {
321
+ return Array.isArray(value)
322
+ ? value.filter((entry) => typeof entry === 'object' && entry !== null)
323
+ : [];
324
+ }
325
+ /** What of a sheet's picture its rows hold: the output columns whose values draw (`wrunOutputDraw`: a plot or the
326
+ * candle tint, never a data-only output or a transparent edge helper; and every edge of a fill or a range) and
327
+ * whether it draws handles. Null for a sheet with a section the rows cannot show (ROW_JUDGED_SECTIONS), a
328
+ * builder-fed key, or an inset output (a child the run result builds, with a picture of its own). */
329
+ function wrunRowJudgedPicture(metadata) {
330
+ const sheet = metadata;
331
+ for (const section of Object.keys(WRUN_VISIBILITY_RULES)) {
332
+ if (!ROW_JUDGED_SECTIONS.has(section) && declaresAny(sheet[section]))
333
+ return null;
334
+ }
335
+ for (const key of BUILDER_SHEET_KEYS)
336
+ if (declaresAny(sheet[key]))
337
+ return null;
338
+ const outputs = Array.isArray(metadata?.outputs) ? metadata.outputs : [];
339
+ const indexOf = new Map(outputs.map((output) => [output.name, output.index]));
340
+ const plotted = new Set();
341
+ for (const output of outputs) {
342
+ const draw = wrunOutputDraw(output);
343
+ if (draw === undefined)
344
+ continue;
345
+ if (draw.group !== 'nested')
346
+ return null;
347
+ plotted.add(output.index);
348
+ }
349
+ const edges = [
350
+ ...recordsOf(sheet.fills).flatMap((fill) => (Array.isArray(fill.between) ? fill.between : [])),
351
+ ...recordsOf(sheet.ranges).flatMap((range) => [range.upper, range.lower]),
352
+ ];
353
+ for (const edge of edges) {
354
+ const index = typeof edge === 'string' ? indexOf.get(edge) : undefined;
355
+ if (index !== undefined)
356
+ plotted.add(index);
357
+ }
358
+ return { plotted, handles: declaresAny(sheet.handles) };
359
+ }
360
+ /** A ready row of `rows` holds a finite value in one of `plotted`'s columns. */
361
+ function rowsPlotAny(rows, plotted) {
362
+ for (const row of rows) {
363
+ if (row.outputs === null)
364
+ continue;
365
+ for (const index of plotted)
366
+ if (Number.isFinite(row.outputs[index]))
367
+ return true;
368
+ }
369
+ return false;
370
+ }
371
+ /**
372
+ * Whether a run drew nothing a viewer could see over `rows`: at least one ready row, no plotted column
373
+ * (`wrunRowJudgedPicture`) finite on any of them, and no drawing record (`drawings`: the live handle set's size the
374
+ * rows carry, undefined when they carry none). Never true for a sheet the rows cannot show, for one declaring handles
375
+ * whose set the rows do not carry, for one that draws nothing at all (only data-only outputs), or for a run with no
376
+ * ready row (the nothing-ready row is that one's). A sparse output (one finite value, one label) drew.
377
+ */
378
+ export function wrunRunDrewNothing(metadata, rows, drawings) {
379
+ const picture = wrunRowJudgedPicture(metadata);
380
+ if (picture === null)
381
+ return false;
382
+ if (picture.handles ? drawings !== 0 : (drawings ?? 0) > 0)
383
+ return false;
384
+ if (picture.plotted.size === 0 && !picture.handles)
385
+ return false;
386
+ if (!rows.some((row) => row.outputs !== null))
387
+ return false;
388
+ return !rowsPlotAny(rows, picture.plotted);
389
+ }
390
+ /** Whether `rows` show something drawn: a drawing record, or a finite value in a plotted column on a ready row. The
391
+ * half of the verdict that lowers a standing note (a live tick that starts drawing): rows of a sheet the verdict
392
+ * cannot read never lower it, since no note is raised for one. */
393
+ export function wrunRunDrewSomething(metadata, rows, drawings) {
394
+ if (drawings !== undefined && drawings > 0)
395
+ return true;
396
+ const picture = wrunRowJudgedPicture(metadata);
397
+ return picture !== null && rowsPlotAny(rows, picture.plotted);
398
+ }
399
+ /**
400
+ * The short reach behind an empty run, when the run has one: an input pinned to an interval coarser than the run's
401
+ * that reads a leg's history (not its forming candle), whose candles over the rows number fewer than the rule's floor.
402
+ * A scalar pin is short whatever its `bars`: each row reads one leg candle, the newest closed by it, so `bars` only
403
+ * deepens the fetch and a window fed from the pin holds the candles the rows span plus the two the host reads before
404
+ * the first (the kit's WRUN_DECL_INTERVAL_WINDOW_SHORT warns on the same shape). A leg stream is short only without
405
+ * `bars` (such a stream starts two leg spans before the chart's first row; declared, its first row carries the backlog
406
+ * that far back). The coarsest such input names the cause; undefined for none.
407
+ */
408
+ export function wrunShortLegReach(metadata, rows, runIntervalMs, rule) {
409
+ if (!(typeof runIntervalMs === 'number' && runIntervalMs > 0) || rows.length === 0)
410
+ return undefined;
411
+ const spanMs = Math.max(0, rows[rows.length - 1].ts - rows[0].ts);
412
+ let short;
413
+ for (const source of Object.values(metadata?.inputSources ?? {})) {
414
+ if (typeof source !== 'object' || source === null)
415
+ continue;
416
+ const stream = isWrunLegStreamClass(source.source);
417
+ if (stream && typeof source.bars === 'number' && source.bars > 0)
418
+ continue;
419
+ if (source.view === 'forming' || source.view === 'forming_open')
420
+ continue;
421
+ const leg = rule.intervalOf(source.interval);
422
+ if (leg === undefined || leg.ms <= runIntervalMs)
423
+ continue;
424
+ const bars = Math.floor(spanMs / leg.ms) + 2;
425
+ if (bars >= rule.floor)
426
+ continue;
427
+ if (short === undefined || leg.ms > short.ms) {
428
+ short = { reach: { interval: leg.key, bars, ...(stream ? { stream: true } : {}) }, ms: leg.ms };
429
+ }
430
+ }
431
+ return short?.reach;
432
+ }
433
+ /** The note a settled viewer run owes: null when it owes none (a draft, a run that drew, a run with no ready bar), else
434
+ * the cause when the run knows it. Undefined for a run that is not settled: the note stands as it is. */
435
+ export function wrunViewerNothingDrawn(run) {
436
+ if (run.draft)
437
+ return null;
438
+ if (!run.settled)
439
+ return undefined;
440
+ if (!wrunRunDrewNothing(run.metadata, run.rows, run.drawings))
441
+ return null;
442
+ const reach = run.legs ? wrunShortLegReach(run.metadata, run.rows, run.runIntervalMs, run.legs) : undefined;
443
+ return reach !== undefined ? { reach } : {};
444
+ }
445
+ /** The note row of a verdict (none for null): the `nothing-ready` record's `drawn` variant, or `reach` naming the
446
+ * leg's interval and the candles it reaches; the row's message keeps the technical words (Copy details). */
447
+ export function wrunNothingDrawnDiagnostics(verdict, ctx) {
448
+ if (verdict === null)
449
+ return [];
450
+ const { reach } = verdict;
451
+ // The technical words name the cause each kind has: a stream's missing `bars`, or a scalar pin's one candle a bar.
452
+ const cause = reach === undefined
453
+ ? ''
454
+ : reach.stream
455
+ ? ` Its ${reach.interval} input declares no bars, so it reaches ${reach.bars} ${reach.interval} candles here.`
456
+ : ` Its ${reach.interval} input is a scalar pin, which reads one ${reach.interval} candle a bar whatever its` +
457
+ ` bars, so it reaches ${reach.bars} ${reach.interval} candles here.`;
458
+ const message = 'Nothing was drawn: no plotted value is finite on any ready bar of the loaded window and the run made no drawing.' +
459
+ cause;
460
+ const seed = reach !== undefined
461
+ ? { cls: 'nothing-ready', variant: 'reach', params: { interval: reach.interval, bars: reach.bars } }
462
+ : { cls: 'nothing-ready', variant: 'drawn' };
463
+ return [
464
+ {
465
+ stage: 'compute',
466
+ severity: 'warning',
467
+ code: WRUN_NOTHING_DRAWN_CODE,
468
+ type: 'execution',
469
+ message,
470
+ details: {
471
+ refusal: wrunRowRefusal(seed, message, ctx),
472
+ ...(reach !== undefined ? { interval: reach.interval, bars: reach.bars } : {}),
473
+ },
474
+ },
475
+ ];
476
+ }
@@ -68,7 +68,7 @@ export declare function wrunRunIntervalSessionOf(context: object | undefined): W
68
68
  export declare function wrunLiveRunIntervalMs(indicatorId: string): number | undefined;
69
69
  /** Whether the chart's candle lane fetches `intervalMs` bars on a session filter, its `tradingHour`
70
70
  * following the chart's session (candle-trading-hour.util): regular hours on a US listing unless it
71
- * opted into extended hours, RTH on a CME chart in RTH at an intraday interval. */
71
+ * rides extended hours there (opted in, below a day), RTH on a CME chart in RTH at an intraday interval. */
72
72
  export declare function wrunBarsSessionFiltered(market: {
73
73
  exchange?: unknown;
74
74
  symbol?: unknown;
@@ -99,7 +99,7 @@ export declare function wrunRunIntervalRowsThrough(run: RunBarCalendar, rows: Re
99
99
  * like its lines on the forming bucket's chart bars; the forming bar stays in the buffer until it
100
100
  * closes. Off: the forming bar too (the chart bars of its bucket show it).
101
101
  */
102
- export declare function wrunRunIntervalComputeRows(run: Pick<OverlayRunInterval, 'intervalMs' | 'waitForClose' | 'sessionLattice'>, rows: ReadonlyArray<ArrayLike<number>>, lastChartTs: number): ArrayLike<number>[];
102
+ export declare function wrunRunIntervalComputeRows(run: Pick<OverlayRunInterval, 'intervalMs' | 'waitForClose' | 'sessionLattice' | 'sessionLatticeId'>, rows: ReadonlyArray<ArrayLike<number>>, lastChartTs: number): ArrayLike<number>[];
103
103
  /** The input row a session last evaluated as its newest, copied (wrunRunIntervalSession.lastSentRow). */
104
104
  export declare function wrunRunIntervalSentRow(row: {
105
105
  ts: number;
@@ -47,9 +47,9 @@ export function wrunLiveRunIntervalMs(indicatorId) {
47
47
  }
48
48
  /** Whether the chart's candle lane fetches `intervalMs` bars on a session filter, its `tradingHour`
49
49
  * following the chart's session (candle-trading-hour.util): regular hours on a US listing unless it
50
- * opted into extended hours, RTH on a CME chart in RTH at an intraday interval. */
50
+ * rides extended hours there (opted in, below a day), RTH on a CME chart in RTH at an intraday interval. */
51
51
  export function wrunBarsSessionFiltered(market, intervalMs) {
52
- return (isEquityRegularSessionGated(market?.exchange, market?.sessionType) ||
52
+ return (isEquityRegularSessionGated(market?.exchange, market?.sessionType, intervalMs) ||
53
53
  isChartRthActive(market?.exchange, market?.symbol, market?.sessionType, intervalMs));
54
54
  }
55
55
  /** The identity of the run bars a session holds: the run interval, the chart market they were
@@ -95,20 +95,21 @@ export declare function resolveWrunRunInterval(input: WrunRunIntervalInput): Wru
95
95
  export declare function isWrunRunIntervalUnsupportedMarket(exchange: string | undefined, transformations: string | null | undefined): boolean;
96
96
  /**
97
97
  * Whether a chart's market rides a session calendar its twins' own resampler cannot fold from the
98
- * chart's bars (see WrunRunIntervalInput.sessionMarket): a venue on the CME session lattice
99
- * (isCmeSessionLatticeExchange: its 4h bars on the 17:00 Chicago lattice), or a chart whose own bars
100
- * ride a session filter (wrunBarsSessionFiltered at the chart's interval: RTH on a CME chart, where
101
- * a run bar above 30m is anchored on the session open and a 1D run bar holds the whole session).
98
+ * chart's bars (see WrunRunIntervalInput.sessionMarket): a venue on a session lattice
99
+ * (sessionLatticeOf: CME's 4h bars on the 17:00 Chicago lattice, forex's on the 17:00 New York one),
100
+ * or a chart whose own bars ride a session filter (wrunBarsSessionFiltered at the chart's interval:
101
+ * RTH on a CME chart, where a run bar above 30m is anchored on the session open and a 1D run bar
102
+ * holds the whole session).
102
103
  */
103
104
  export declare function isWrunRunIntervalSessionMarket(exchange: string | undefined, chart: WrunChartSessionFields | null | undefined, chartInterval: unknown): boolean;
104
105
  /**
105
106
  * The run interval of one mounted wrun overlay: its settings against the chart's interval, venue,
106
107
  * series (`chartTransformations`, a formula chart's legs), session (`chartMarket`: the symbol and the
107
108
  * session type a replaying chart's session market reads) and replay state. `chartExchange` is the
108
- * chart's venue; omitted, the overlay's own `settings.exchange` stands in. A venue that rides the CME
109
- * session lattice (CME, CBOT, NYMEX, COMEX: isCmeSessionLatticeExchange, the rule the chart's own
110
- * live bars and the run bars' live fold key on) stamps the run `sessionLattice`. The same question
111
- * with replay off is liveOverlayWrunRunInterval.
109
+ * chart's venue; omitted, the overlay's own `settings.exchange` stands in. A venue that rides a
110
+ * session lattice (sessionLatticeOf: the CME family, forex; the rule the chart's own live bars and
111
+ * the run bars' live fold key on) stamps the run `sessionLattice` and the lattice's id. The same
112
+ * question with replay off is liveOverlayWrunRunInterval.
112
113
  */
113
114
  export declare function overlayWrunRunInterval(chartIndex: number, overlay: {
114
115
  settings?: unknown;
@@ -37,7 +37,7 @@
37
37
  */
38
38
  import { wrunChartHostEnv } from '../../host-env.js';
39
39
  import { runIntervalOfTimeframeLabel, timeframeIsChartOrFiner, } from '../chart/indicator-run-interval.util.js';
40
- import { isCmeSessionLatticeExchange } from '../chart/cme-session-bucket.util.js';
40
+ import { sessionLatticeOf } from '../chart/session-lattice.util.js';
41
41
  import { checkIsIndexMode } from '../chart/index-mode.util.js';
42
42
  import { chartIntervalToMs } from '../chart/rth-session.util.js';
43
43
  import { isRunIntervalUnservableMarket } from '../chart/run-interval-unservable.leaf.js';
@@ -192,23 +192,24 @@ export function isWrunRunIntervalUnsupportedMarket(exchange, transformations) {
192
192
  }
193
193
  /**
194
194
  * Whether a chart's market rides a session calendar its twins' own resampler cannot fold from the
195
- * chart's bars (see WrunRunIntervalInput.sessionMarket): a venue on the CME session lattice
196
- * (isCmeSessionLatticeExchange: its 4h bars on the 17:00 Chicago lattice), or a chart whose own bars
197
- * ride a session filter (wrunBarsSessionFiltered at the chart's interval: RTH on a CME chart, where
198
- * a run bar above 30m is anchored on the session open and a 1D run bar holds the whole session).
195
+ * chart's bars (see WrunRunIntervalInput.sessionMarket): a venue on a session lattice
196
+ * (sessionLatticeOf: CME's 4h bars on the 17:00 Chicago lattice, forex's on the 17:00 New York one),
197
+ * or a chart whose own bars ride a session filter (wrunBarsSessionFiltered at the chart's interval:
198
+ * RTH on a CME chart, where a run bar above 30m is anchored on the session open and a 1D run bar
199
+ * holds the whole session).
199
200
  */
200
201
  export function isWrunRunIntervalSessionMarket(exchange, chart, chartInterval) {
201
- return (isCmeSessionLatticeExchange(exchange) ||
202
+ return (sessionLatticeOf(exchange) !== null ||
202
203
  wrunBarsSessionFiltered({ ...chart, exchange }, chartIntervalToMs(chartInterval)));
203
204
  }
204
205
  /**
205
206
  * The run interval of one mounted wrun overlay: its settings against the chart's interval, venue,
206
207
  * series (`chartTransformations`, a formula chart's legs), session (`chartMarket`: the symbol and the
207
208
  * session type a replaying chart's session market reads) and replay state. `chartExchange` is the
208
- * chart's venue; omitted, the overlay's own `settings.exchange` stands in. A venue that rides the CME
209
- * session lattice (CME, CBOT, NYMEX, COMEX: isCmeSessionLatticeExchange, the rule the chart's own
210
- * live bars and the run bars' live fold key on) stamps the run `sessionLattice`. The same question
211
- * with replay off is liveOverlayWrunRunInterval.
209
+ * chart's venue; omitted, the overlay's own `settings.exchange` stands in. A venue that rides a
210
+ * session lattice (sessionLatticeOf: the CME family, forex; the rule the chart's own live bars and
211
+ * the run bars' live fold key on) stamps the run `sessionLattice` and the lattice's id. The same
212
+ * question with replay off is liveOverlayWrunRunInterval.
212
213
  */
213
214
  export function overlayWrunRunInterval(chartIndex, overlay, chartInterval, chartExchange, chartTransformations, chartMarket) {
214
215
  // The replay flags are web's (replay/replayFlags.ts `isChartReplaying`, the same Set read at call time).
@@ -238,7 +239,8 @@ function overlayRunIntervalUnder(replay, overlay, chartInterval, chartExchange,
238
239
  unsupportedMarket: isWrunRunIntervalUnsupportedMarket(venue, chartTransformations),
239
240
  sessionMarket: isWrunRunIntervalSessionMarket(venue, chartMarket, chartInterval),
240
241
  });
241
- return run && isCmeSessionLatticeExchange(venue) ? { ...run, sessionLattice: true } : run;
242
+ const lattice = run ? sessionLatticeOf(venue) : null;
243
+ return run && lattice !== null ? { ...run, sessionLattice: true, sessionLatticeId: lattice.id } : run;
242
244
  }
243
245
  /**
244
246
  * The settings a run at another interval sends the package: the twin's `timeframe` forced to its
@@ -33,6 +33,7 @@
33
33
  */
34
34
  import { ensureWrunChartHostSharedHost, wrunChartHostEnv } from '../../host-env.js';
35
35
  import { KSCRIPT_STALLED_CODE } from '../../constants/scriptEditor/execution.constants.js';
36
+ import { isWrunBandedBookSource } from './wrun-book-bands.leaf.js';
36
37
  import { wrunHandlesOf } from './wrun-handles.util.js';
37
38
  import { getWrunBrowserHost } from './wrun-host.service.js';
38
39
  import { claimWrunRunLoading, releaseWrunLoading } from './wrun-loading-owner.util.js';
@@ -122,7 +123,8 @@ export function wrunRowBatchCellRows(batch) {
122
123
  return wrunBatchCellRows.get(batch);
123
124
  }
124
125
  /** The wire's `grids` of a sandbox run: one entry per book, volume_profile or intrabar input a canvas names in
125
- * `cells`, its rows `[ts, ...block]` off the input rows the module read (the kit shaper's own spelling). */
126
+ * `cells`, its rows `[ts, ...block]` off the input rows the module read (the kit shaper's own spelling). A banded book
127
+ * input (`isWrunBandedBookSource`) is none: its block is band sums, never the class's tuples. */
126
128
  function wrunSandboxCellGrids(sheet, inputs) {
127
129
  const names = [];
128
130
  for (const canvas of [...(sheet.heatmaps ?? []), ...(sheet.profiles ?? [])]) {
@@ -133,7 +135,8 @@ function wrunSandboxCellGrids(sheet, inputs) {
133
135
  const grids = [];
134
136
  for (const name of names) {
135
137
  const input = sheet.inputs.find((entry) => entry.name === name);
136
- const source = Object.hasOwn(sheet.inputSources, name) ? sheet.inputSources[name]?.source : undefined;
138
+ const declared = Object.hasOwn(sheet.inputSources, name) ? sheet.inputSources[name] : undefined;
139
+ const source = isWrunBandedBookSource(declared) ? undefined : declared?.source;
137
140
  if (input === undefined || source === undefined || !WRUN_GRID_CELL_CLASSES.has(source))
138
141
  continue;
139
142
  const width = widths[source];
@@ -322,9 +322,19 @@ export declare function isWrunLocalizedStyleTarget(target: string): boolean;
322
322
  export declare function buildWrunScriptInputs(metadata: WrunScriptInputsSheet, options?: WrunRowBuildOptions): WrunScriptInputDeclaration[];
323
323
  /** The rows as the dialog shows them on a market of size unit `sizeUnit` (wrunChartSizeUnit): a
324
324
  * row whose `visibleBy` leaves the unit out is hidden like a composite member, never placed, its
325
- * value kept (the run still reads it and the dialog's Reset still resets it). The rows themselves
326
- * when none hides. */
327
- export declare function wrunRowsOnMarket(rows: ReadonlyArray<WrunScriptInputDeclaration>, sizeUnit: number): WrunScriptInputDeclaration[];
325
+ * value kept (the run still reads it and the dialog's Reset still resets it). A setting key beside
326
+ * the unit (contract C-COINS item 1) hides its row while the select it names reads none of its
327
+ * values in `settings`, the dialog's current values (wrunRowSettingReader), so the rows follow the
328
+ * select as the user flips it. The rows themselves when none hides. */
329
+ export declare function wrunRowsOnMarket(rows: ReadonlyArray<WrunScriptInputDeclaration>, sizeUnit: number, settings?: unknown): WrunScriptInputDeclaration[];
330
+ /**
331
+ * The value a setting key reads in the dialog (contract C-COINS item 1), the rows' side of the run's
332
+ * `wrunSheetSettingReader`: the select row it names reads its current value in `settings` (its default without
333
+ * one), or its default where the select's own row is hidden on the market (its size-unit list alone: a keyed
334
+ * select is never keyed by another setting), so a stock chart that saved Coins shows the Dollars rows. Undefined
335
+ * for a name no row holds or a value that is no number (the key then never hides).
336
+ */
337
+ export declare function wrunRowSettingReader(rows: ReadonlyArray<WrunScriptInputDeclaration>, settings: unknown, sizeUnit: number): (name: string) => number | undefined;
328
338
  /**
329
339
  * The rows an overlay persisted, drawn with the sheet's words: every row the
330
340
  * sheet builds now (a param, a composite, a colour array, a member) takes
@@ -108,7 +108,7 @@ import { isWrunColorWord, wrunThemeTokenOfPacked, wrunThemeTokenWord } from './w
108
108
  import { isWrunColorParam, isWrunStyleParam, wrunColorArrayKey, wrunColorPalette, wrunColorParamDefault, wrunColorSettingString, wrunLineStyles, wrunParamChoices, wrunSelectOptionValue, wrunStyleBinding, parseWrunStyleTarget, wrunVisibilityOwnedOutputs, wrunVisibilityOwners, } from './wrun-color-settings.util.js';
109
109
  import { findWrunVisibilityTarget, WRUN_HANDLE_KIND_RULES, WRUN_VISIBILITY_RULES, wrunVisibilityEntryTarget, wrunVisibilityTargetAt, } from './wrun-visibility-table.js';
110
110
  import { isTruthySetting, wrunCodedWords } from './wrun-setting-words.util.js';
111
- import { wrunRowVisibleHere } from './wrun-market-facts.util.js';
111
+ import { wrunRowVisibleHere, wrunVisibleBySettingKeys } from './wrun-market-facts.util.js';
112
112
  import { bitmaskValue, finiteNumber, nonEmptyString, numericValue, toggleValue, wrunMultiLabels, wrunTimeValue, } from './wrun-param-values.util.js';
113
113
  import { wrunLegendLiteral, wrunTextParamCap, wrunTextParamDefault, wrunTextValueWithinCap, } from './wrun-text-params.util.js';
114
114
  // The choice set and the one select read live beside the other settings
@@ -269,14 +269,21 @@ function rowBase(param, options) {
269
269
  ...(param.hide === true ? { hide: true } : {}),
270
270
  ...(param.slider === true ? { slider: true } : {}),
271
271
  ...(param.host === 'source' || param.host === 'interval' || param.host === 'symbol' ? { host: param.host } : {}),
272
- ...wrunRowVisibleBy(param.visible_by),
272
+ ...wrunRowVisibleBy(param.visible_by, true),
273
273
  };
274
274
  }
275
- /** A row's `visibleBy` from a declaration's `visible_by`: a copy of its size-unit list, nothing when
276
- * the word is absent or holds no list. */
277
- function wrunRowVisibleBy(visibleBy) {
275
+ /** A row's `visibleBy` from a declaration's `visible_by`: a copy of its size-unit list and, on a setting's row
276
+ * (`settingKeys`), of every setting key it names (wrunVisibleBySettingKeys, contract C-COINS item 1; an output's
277
+ * Style rows keep the size unit only), nothing when the word holds neither. */
278
+ function wrunRowVisibleBy(visibleBy, settingKeys = false) {
278
279
  const codes = visibleBy?.size_unit;
279
- return Array.isArray(codes) ? { visibleBy: { size_unit: [...codes] } } : {};
280
+ const keys = settingKeys ? wrunVisibleBySettingKeys(visibleBy) : [];
281
+ if (!Array.isArray(codes) && keys.length === 0)
282
+ return {};
283
+ const copy = Array.isArray(codes) ? { size_unit: [...codes] } : {};
284
+ for (const key of keys)
285
+ copy[key.name] = [...key.values];
286
+ return { visibleBy: copy };
280
287
  }
281
288
  /** The `<name>_unit` selects by the value param they qualify (`unit_for`). */
282
289
  function unitSelectsByValue(params) {
@@ -800,8 +807,9 @@ function undeclaredTextColorOf(renderer) {
800
807
  * its opacity (a mark's `opacity_pct` read as 0..1, default 0.3; a span's
801
808
  * 0.2; a ray's 1: the kit's defaults, mirrored in wrun-batched-marks.util
802
809
  * LOOK_DEFAULTS); a ray its width (default 1) and line style (default
803
- * solid) too. Its look, size, caption and position take no row: a param
804
- * binds them (`style_targets`);
810
+ * solid) too. A flags section (`flags:<name>`) takes its colours alone (it
811
+ * declares no opacity). Its look, size, caption and position take no row: a
812
+ * param binds them (`style_targets`);
805
813
  * - a band (`range:<upper>/<lower>#<n>`, `fill:<first>/<second>#<n>`), a box,
806
814
  * a segment, a sheet drawing, a draw-API handle kind, a matrix and a panel:
807
815
  * Visible only (their colours ride params or the declaration).
@@ -872,6 +880,12 @@ function childStyleRows(targets, declared) {
872
880
  }
873
881
  break;
874
882
  }
883
+ case 'flags': {
884
+ const colors = batchedColorsOf(entry.colors);
885
+ if (colors !== undefined)
886
+ add(target, 'colors', colors, stops(colors));
887
+ break;
888
+ }
875
889
  default:
876
890
  break;
877
891
  }
@@ -981,7 +995,7 @@ function styleRows(metadata) {
981
995
  return rows;
982
996
  }
983
997
  /** The sections whose readout `label` titles their Style line. */
984
- const LABELLED_STYLE_SECTIONS = new Set(['heatmaps', 'marks', 'spans', 'rays']);
998
+ const LABELLED_STYLE_SECTIONS = new Set(['heatmaps', 'marks', 'spans', 'rays', 'flags']);
985
999
  /** A draw-API handle kind's Style line title, the dialog's English fallback
986
1000
  * (WrunLayoutPanel localizes a handles section by its id). */
987
1001
  const HANDLE_STYLE_TITLES = {
@@ -1111,14 +1125,38 @@ export function buildWrunScriptInputs(metadata, options) {
1111
1125
  }
1112
1126
  /** The rows as the dialog shows them on a market of size unit `sizeUnit` (wrunChartSizeUnit): a
1113
1127
  * row whose `visibleBy` leaves the unit out is hidden like a composite member, never placed, its
1114
- * value kept (the run still reads it and the dialog's Reset still resets it). The rows themselves
1115
- * when none hides. */
1116
- export function wrunRowsOnMarket(rows, sizeUnit) {
1117
- const hides = (row) => row.hidden !== true && !wrunRowVisibleHere(row.visibleBy, sizeUnit);
1128
+ * value kept (the run still reads it and the dialog's Reset still resets it). A setting key beside
1129
+ * the unit (contract C-COINS item 1) hides its row while the select it names reads none of its
1130
+ * values in `settings`, the dialog's current values (wrunRowSettingReader), so the rows follow the
1131
+ * select as the user flips it. The rows themselves when none hides. */
1132
+ export function wrunRowsOnMarket(rows, sizeUnit, settings) {
1133
+ const read = wrunRowSettingReader(rows, settings, sizeUnit);
1134
+ const hides = (row) => row.hidden !== true && !wrunRowVisibleHere(row.visibleBy, sizeUnit, read);
1118
1135
  if (!rows.some(hides))
1119
1136
  return rows;
1120
1137
  return rows.map((row) => (hides(row) ? { ...row, hidden: true } : row));
1121
1138
  }
1139
+ /**
1140
+ * The value a setting key reads in the dialog (contract C-COINS item 1), the rows' side of the run's
1141
+ * `wrunSheetSettingReader`: the select row it names reads its current value in `settings` (its default without
1142
+ * one), or its default where the select's own row is hidden on the market (its size-unit list alone: a keyed
1143
+ * select is never keyed by another setting), so a stock chart that saved Coins shows the Dollars rows. Undefined
1144
+ * for a name no row holds or a value that is no number (the key then never hides).
1145
+ */
1146
+ export function wrunRowSettingReader(rows, settings, sizeUnit) {
1147
+ const flat = settings !== null && typeof settings === 'object' ? settings : {};
1148
+ return (name) => {
1149
+ const row = rows.find((candidate) => candidate.name === name && candidate.virtual !== true);
1150
+ if (row === undefined)
1151
+ return undefined;
1152
+ const own = flat[name];
1153
+ const raw = wrunRowVisibleHere(row.visibleBy, sizeUnit) && own !== undefined && own !== null && own !== ''
1154
+ ? own
1155
+ : row.defaultValue;
1156
+ const value = Number(raw);
1157
+ return Number.isFinite(value) ? value : undefined;
1158
+ };
1159
+ }
1122
1160
  function paramInput(param, base) {
1123
1161
  if (isWrunStyleParam(param))
1124
1162
  return styleKnobInput(param, base);
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Order flow from a session on a script overlay (web: docs/features/session-feed/README.md, "Order flow"): where a
3
+ * run reads its tape and trades rows, an overlay the host's session owns reads OpenMarket's rows before the seam and
4
+ * the session's from it. The host composes (`WrunChartHostEnv.session`, optional); this module decides where.
5
+ *
6
+ * The session never writes a lane buffer: the context's buffers, watermarks, fed marks, coverage and reconciles keep
7
+ * OpenMarket's rows exactly. Only the rows a compute reads are composed, at the read points (the full run's and the
8
+ * reseed's row build, the drain's tail build), and only when every lane the composition would feed is one it can
9
+ * value on the chart's own market: a session's prints are contracts on that market, so a contracts lane composes as
10
+ * they are, and the dollar trades lane prices each side of a bar as OpenMarket's history does (contracts x the root's
11
+ * point value x that side's (high + low + close) / 3) where the point value is known (`wrunSessionDollarPointValue`).
12
+ */
13
+ import { type WrunHostSession } from '../../host-env.js';
14
+ import type { WrunIndicatorMetadata } from '../../interfaces/wrun-runtime.interface.js';
15
+ import { type WrunChartSourceRows } from './wrun-source-rows.util.js';
16
+ /** What the lanes rule reads of a run or a live session: its sheet, the payload each lane was asked with, and the
17
+ * chart's market (the one the session's prints are on). */
18
+ export interface WrunSessionLanesView {
19
+ metadata: Pick<WrunIndicatorMetadata, 'inputs' | 'inputSources'>;
20
+ acquisition: Partial<Record<string, Readonly<Record<string, unknown>> | undefined>>;
21
+ market?: {
22
+ exchange?: string;
23
+ symbol?: string;
24
+ sessionType?: string;
25
+ };
26
+ }
27
+ /**
28
+ * The one rule for the dollar lane: the US dollars one contract of the chart's market is worth per whole point of its
29
+ * price (CME_ROOT_SPECS: NQ1! and NQZ6 read NQ, 20) on a CME Group futures market whose root is quoted in US dollars,
30
+ * so a side of a session-fed bar prices at contracts x this x (high + low + close) / 3. Undefined everywhere else (a
31
+ * root off the table, a cents-quoted grain, an option contract, a market off the CME family): a script declaring the
32
+ * dollar lane there is ineligible and reads OpenMarket's rows whole.
33
+ */
34
+ export declare function wrunSessionDollarPointValue(market: WrunSessionLanesView['market']): number | undefined;
35
+ /**
36
+ * Whether a session may compose this run's lanes: a dollar trades lane only where a print can be valued
37
+ * (`wrunSessionDollarPointValue`), no trades leg on the chart's own market (its rows would read OpenMarket's beside a
38
+ * session-fed trades lane), a tape asked by contract size (`minSize`, never a dollar or coins floor) on the chart's
39
+ * market, a trades lane in contracts on the chart's market, and a dollar trades lane asked in USD on the chart's
40
+ * market. A lane never asked has no payload and composes nothing, so it refuses nothing.
41
+ */
42
+ export declare function wrunSessionCompositionEligible(view: WrunSessionLanesView): boolean;
43
+ /** The host's session seams, or undefined: a host without them (the sandbox worker, the phone app, every spec env
44
+ * that sets none) composes nothing, and every read point reads its buffers as before. */
45
+ export declare function wrunHostSessionSeams(): WrunHostSession | undefined;
46
+ /** The token the host's session holds for the overlay now (its order-flow generation while owned), else null. */
47
+ export declare function wrunSessionCompositionToken(indicatorId: string): number | null;
48
+ /**
49
+ * Lands a reseed's owed marks against the composition it read: the token it composed under still the host's, it
50
+ * served them (true: the caller clears them); an owner change since (a hand-back, a new seam) owes a revision its
51
+ * rows never read, kept for the next drain (false), and the drain's own clearing skips it once.
52
+ */
53
+ export declare function wrunReseedServedComposition(indicatorId: string, context: object, composedToken: number | null): boolean;
54
+ /** Whether the last reseed of `context` kept an owner change's revision owed (read once: the drain clears none). */
55
+ export declare function takeWrunCompositionRevisionKept(context: object): boolean;
56
+ export interface WrunSessionComposeInput {
57
+ chartIndex: number;
58
+ indicatorId: string;
59
+ /** The interval the lanes' buckets are on (the run's clock). */
60
+ intervalMs: number;
61
+ lanes: WrunSessionLanesView;
62
+ }
63
+ export interface WrunSessionComposed {
64
+ /** The sources the compute reads: the same object when nothing composed. */
65
+ sources: WrunChartSourceRows;
66
+ /** The host's token for the overlay, read with the composition: what the drain's guard compares at landing. It is
67
+ * the host's answer whether or not anything composed (a candle-only or ineligible run of an owned overlay answers
68
+ * the owned generation), so it never reads as an owner change by itself. Null only when nothing owns the overlay. */
69
+ token: number | null;
70
+ }
71
+ /**
72
+ * The rows a compute reads, composed where the host's session owns the overlay. Cold path first: no seams, or no
73
+ * token (nothing owns the overlay), answers `sources` itself, so every read point is byte-identical to before.
74
+ */
75
+ export declare function composeWrunSessionSources(input: WrunSessionComposeInput, sources: WrunChartSourceRows): WrunSessionComposed;
76
+ /** The live context's lanes view (its sheet, its recorded acquisitions, the chart's market at its run). */
77
+ export declare function wrunSessionLanesOfContext(context: {
78
+ metadata: WrunSessionLanesView['metadata'];
79
+ acquisition: WrunSessionLanesView['acquisition'];
80
+ market?: WrunSessionLanesView['market'];
81
+ }): WrunSessionLanesView;