@orangecharts/wrun-chart-host 0.11.1 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. package/README.md +1 -0
  2. package/dist/constants/feature-flags.constants.d.ts +4 -4
  3. package/dist/constants/feature-flags.constants.js +38 -52
  4. package/dist/constants/feature-limits.constants.d.ts +1 -1
  5. package/dist/constants/feature-limits.constants.js +5 -4
  6. package/dist/constants/interval.constants.d.ts +7 -0
  7. package/dist/constants/interval.constants.js +7 -0
  8. package/dist/constants/scriptEditor/cme-official-scripts.constants.d.ts +20 -149
  9. package/dist/constants/scriptEditor/cme-official-scripts.constants.js +20 -309
  10. package/dist/constants/stocks-compliance.constants.d.ts +15 -0
  11. package/dist/constants/stocks-compliance.constants.js +15 -0
  12. package/dist/host-env.d.ts +69 -3
  13. package/dist/host-env.js +21 -0
  14. package/dist/host-ports.types.d.ts +36 -3
  15. package/dist/index.d.ts +18 -0
  16. package/dist/index.js +19 -0
  17. package/dist/indicators/controls/tpo-session.util.d.ts +52 -12
  18. package/dist/indicators/controls/tpo-session.util.js +113 -16
  19. package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +6 -0
  20. package/dist/instances/script-engine-worker-ohlcv-transfer.js +16 -0
  21. package/dist/interfaces/cme-realtime.interface.d.ts +8 -0
  22. package/dist/interfaces/cme-realtime.interface.js +2 -1
  23. package/dist/interfaces/feed.interface.d.ts +15 -1
  24. package/dist/interfaces/replay.interface.d.ts +5 -0
  25. package/dist/interfaces/stocks-realtime.interface.d.ts +4 -3
  26. package/dist/interfaces/stocks-realtime.interface.js +5 -4
  27. package/dist/interfaces/wrun-runtime.interface.d.ts +141 -20
  28. package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +17 -0
  29. package/dist/kscript-data/controls/live-ohlcv-merge.util.js +22 -0
  30. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +46 -40
  31. package/dist/kscript-data/controls/live-trades-merge.util.js +80 -107
  32. package/dist/market-data/billing.interface.d.ts +9 -1
  33. package/dist/market-data/venue.d.ts +1 -1
  34. package/dist/market-data/venues/index.d.ts +5 -5
  35. package/dist/market-data/venues/opra.js +3 -3
  36. package/dist/market-data/venues/stocks.contract.copy.json +6 -5
  37. package/dist/market-data/venues/stocks.d.ts +5 -5
  38. package/dist/market-data/venues/stocks.js +21 -18
  39. package/dist/settings-templates/frvp-fields.d.ts +12 -1
  40. package/dist/settings-templates/frvp-fields.js +15 -4
  41. package/dist/settings-templates/index.js +12 -5
  42. package/dist/settings-templates/indicator-fields.js +43 -2
  43. package/dist/settings-templates/tool-rules.d.ts +17 -8
  44. package/dist/settings-templates/tool-rules.js +15 -8
  45. package/dist/settings-templates/tool-tables.generated.js +4 -2
  46. package/dist/utility/auth/server-clock.util.d.ts +3 -1
  47. package/dist/utility/auth/server-clock.util.js +3 -1
  48. package/dist/utility/chart/book-live-bucket.util.js +2 -2
  49. package/dist/utility/chart/cache-alignment.util.d.ts +38 -7
  50. package/dist/utility/chart/cache-alignment.util.js +50 -13
  51. package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +2 -0
  52. package/dist/utility/chart/chart-data-fetch-generation.util.js +16 -0
  53. package/dist/utility/chart/cme-session-bucket.util.d.ts +18 -75
  54. package/dist/utility/chart/cme-session-bucket.util.js +25 -332
  55. package/dist/utility/chart/continuous-contracts.util.js +6 -5
  56. package/dist/utility/chart/display-offset.leaf.d.ts +24 -0
  57. package/dist/utility/chart/display-offset.leaf.js +41 -0
  58. package/dist/utility/chart/effective-chart-session.util.d.ts +2 -1
  59. package/dist/utility/chart/effective-chart-session.util.js +13 -5
  60. package/dist/utility/chart/feed-interval.util.d.ts +6 -20
  61. package/dist/utility/chart/feed-interval.util.js +13 -22
  62. package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +27 -7
  63. package/dist/utility/chart/fetch-dedupe-policy.util.js +86 -11
  64. package/dist/utility/chart/footprint-band.util.d.ts +21 -5
  65. package/dist/utility/chart/footprint-band.util.js +53 -14
  66. package/dist/utility/chart/host-bar-placement.util.d.ts +7 -4
  67. package/dist/utility/chart/host-bar-placement.util.js +8 -2
  68. package/dist/utility/chart/indicator-inflight-registry.util.d.ts +32 -0
  69. package/dist/utility/chart/indicator-inflight-registry.util.js +52 -0
  70. package/dist/utility/chart/indicator-run-interval.util.d.ts +10 -4
  71. package/dist/utility/chart/indicator-run-interval.util.js +21 -12
  72. package/dist/utility/chart/interval-registry.util.d.ts +1 -1
  73. package/dist/utility/chart/interval-registry.util.js +1 -1
  74. package/dist/utility/chart/kscript-legend-entries.util.d.ts +12 -0
  75. package/dist/utility/chart/kscript-legend-entries.util.js +16 -0
  76. package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +1 -1
  77. package/dist/utility/chart/kscript-run-interval-projection.util.js +4 -2
  78. package/dist/utility/chart/kscript-venue-policy.util.d.ts +53 -62
  79. package/dist/utility/chart/kscript-venue-policy.util.js +85 -94
  80. package/dist/utility/chart/live-bucket.util.d.ts +39 -17
  81. package/dist/utility/chart/live-bucket.util.js +103 -57
  82. package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +58 -20
  83. package/dist/utility/chart/local-kscript-source-revalidation.util.js +98 -23
  84. package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +35 -11
  85. package/dist/utility/chart/local-kscript-warmup-depth.util.js +24 -3
  86. package/dist/utility/chart/market-session-schedule.util.d.ts +8 -0
  87. package/dist/utility/chart/market-session-schedule.util.js +39 -1
  88. package/dist/utility/chart/market-session.util.d.ts +136 -0
  89. package/dist/utility/chart/market-session.util.js +341 -0
  90. package/dist/utility/chart/om-panel.util.d.ts +5 -3
  91. package/dist/utility/chart/om-panel.util.js +42 -7
  92. package/dist/utility/chart/om-target.util.d.ts +14 -1
  93. package/dist/utility/chart/om-target.util.js +22 -5
  94. package/dist/utility/chart/opra-read-access.leaf.d.ts +16 -1
  95. package/dist/utility/chart/opra-read-access.leaf.js +22 -0
  96. package/dist/utility/chart/profile-row-height.util.d.ts +49 -16
  97. package/dist/utility/chart/profile-row-height.util.js +74 -37
  98. package/dist/utility/chart/rth-session.util.d.ts +55 -20
  99. package/dist/utility/chart/rth-session.util.js +94 -46
  100. package/dist/utility/chart/session-lattice.util.d.ts +150 -0
  101. package/dist/utility/chart/session-lattice.util.js +488 -0
  102. package/dist/utility/chart/trading-day.util.d.ts +40 -2
  103. package/dist/utility/chart/trading-day.util.js +84 -7
  104. package/dist/utility/chart/us-equities-session.util.d.ts +32 -11
  105. package/dist/utility/chart/us-equities-session.util.js +44 -15
  106. package/dist/utility/chart/window-geometry.leaf.d.ts +28 -7
  107. package/dist/utility/chart/window-geometry.leaf.js +57 -8
  108. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +21 -14
  109. package/dist/utility/chart/wrun-bar-session-facts.util.js +32 -38
  110. package/dist/utility/chart/wrun-run-result.util.d.ts +38 -13
  111. package/dist/utility/chart/wrun-run-result.util.js +97 -27
  112. package/dist/utility/common/time.util.js +5 -4
  113. package/dist/utility/market-events/earnings-scope.util.d.ts +10 -5
  114. package/dist/utility/market-events/earnings-scope.util.js +17 -9
  115. package/dist/utility/market-events/market-events.util.d.ts +14 -7
  116. package/dist/utility/market-events/market-events.util.js +30 -17
  117. package/dist/utility/number-format.util.d.ts +14 -21
  118. package/dist/utility/number-format.util.js +38 -24
  119. package/dist/utility/options/option-venue-disclosure.util.d.ts +40 -6
  120. package/dist/utility/options/option-venue-disclosure.util.js +71 -11
  121. package/dist/utility/options/option-venue.util.d.ts +1 -1
  122. package/dist/utility/options/option-venue.util.js +1 -1
  123. package/dist/utility/pool-symbol.leaf.d.ts +7 -0
  124. package/dist/utility/pool-symbol.leaf.js +50 -5
  125. package/dist/utility/stocks/stock-display.util.d.ts +15 -0
  126. package/dist/utility/stocks/stock-display.util.js +37 -0
  127. package/dist/utility/symbol-selection/contract-expiry.util.js +5 -4
  128. package/dist/utility/v2/gate-plane.util.d.ts +6 -0
  129. package/dist/utility/v2/gate-plane.util.js +11 -1
  130. package/dist/utility/v2/gate-session-latch.util.d.ts +1 -1
  131. package/dist/utility/v2/gate-session-latch.util.js +3 -3
  132. package/dist/utility/v2/governed-tier.leaf.d.ts +17 -16
  133. package/dist/utility/v2/governed-tier.leaf.js +17 -16
  134. package/dist/utility/v2/stocks-governed.util.d.ts +5 -0
  135. package/dist/utility/v2/stocks-governed.util.js +14 -0
  136. package/dist/utility/v2/v2-enums.leaf.d.ts +13 -0
  137. package/dist/utility/v2/v2-enums.leaf.js +458 -0
  138. package/dist/utility/wrun/derived-roots.leaf.d.ts +21 -1
  139. package/dist/utility/wrun/derived-roots.leaf.js +27 -1
  140. package/dist/utility/wrun/derived-roots.util.d.ts +44 -32
  141. package/dist/utility/wrun/derived-roots.util.js +97 -56
  142. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -3
  143. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -3
  144. package/dist/utility/wrun/sources/lanes/option_daily.d.ts +2 -1
  145. package/dist/utility/wrun/sources/lanes/option_daily.js +2 -1
  146. package/dist/utility/wrun/sources/lanes/options_flow.d.ts +3 -0
  147. package/dist/utility/wrun/sources/lanes/options_flow.js +23 -5
  148. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +3 -4
  149. package/dist/utility/wrun/sources/row-lane-registry.js +9 -4
  150. package/dist/utility/wrun/sources/row-lanes/dark_pool.d.ts +19 -0
  151. package/dist/utility/wrun/sources/row-lanes/dark_pool.js +104 -0
  152. package/dist/utility/wrun/sources/row-lanes/index.js +2 -0
  153. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.d.ts +20 -0
  154. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.js +103 -0
  155. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -2
  156. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +15 -13
  157. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +49 -23
  158. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +14 -9
  159. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +75 -27
  160. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +139 -82
  161. package/dist/utility/wrun/wrun-app-layer.leaf.d.ts +78 -0
  162. package/dist/utility/wrun/wrun-app-layer.leaf.js +89 -0
  163. package/dist/utility/wrun/wrun-bar-count.util.d.ts +11 -7
  164. package/dist/utility/wrun/wrun-bar-count.util.js +12 -8
  165. package/dist/utility/wrun/wrun-batched-kinds.leaf.d.ts +13 -0
  166. package/dist/utility/wrun/wrun-batched-kinds.leaf.js +18 -0
  167. package/dist/utility/wrun/wrun-batched-marks.util.d.ts +46 -23
  168. package/dist/utility/wrun/wrun-batched-marks.util.js +260 -62
  169. package/dist/utility/wrun/wrun-batched-readout.util.d.ts +26 -19
  170. package/dist/utility/wrun/wrun-batched-readout.util.js +81 -27
  171. package/dist/utility/wrun/wrun-book-bands.leaf.d.ts +8 -0
  172. package/dist/utility/wrun/wrun-book-bands.leaf.js +7 -0
  173. package/dist/utility/wrun/wrun-candle-equal.leaf.d.ts +19 -0
  174. package/dist/utility/wrun/wrun-candle-equal.leaf.js +40 -0
  175. package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -2
  176. package/dist/utility/wrun/wrun-canvases.util.d.ts +24 -7
  177. package/dist/utility/wrun/wrun-canvases.util.js +99 -30
  178. package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +6 -3
  179. package/dist/utility/wrun/wrun-chart-context-names.util.js +8 -4
  180. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +47 -29
  181. package/dist/utility/wrun/wrun-chart-market-facts.util.js +201 -201
  182. package/dist/utility/wrun/wrun-child-overlay-id.util.js +2 -1
  183. package/dist/utility/wrun/wrun-cme-legs-note.util.d.ts +15 -0
  184. package/dist/utility/wrun/wrun-cme-legs-note.util.js +49 -0
  185. package/dist/utility/wrun/wrun-cme-root-specs.util.d.ts +38 -0
  186. package/dist/utility/wrun/wrun-cme-root-specs.util.js +81 -0
  187. package/dist/utility/wrun/wrun-coin-lane-live.util.js +3 -0
  188. package/dist/utility/wrun/wrun-color-settings.util.d.ts +6 -1
  189. package/dist/utility/wrun/wrun-color-settings.util.js +32 -7
  190. package/dist/utility/wrun/wrun-dark-pool.util.d.ts +50 -0
  191. package/dist/utility/wrun/wrun-dark-pool.util.js +127 -0
  192. package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +67 -12
  193. package/dist/utility/wrun/wrun-declared-warmup.util.js +165 -13
  194. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +18 -8
  195. package/dist/utility/wrun/wrun-draft-legend-note.util.js +57 -11
  196. package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +14 -10
  197. package/dist/utility/wrun/wrun-draft-overlay.util.js +26 -14
  198. package/dist/utility/wrun/wrun-earnings-facts.util.js +3 -2
  199. package/dist/utility/wrun/wrun-etf-funds.util.d.ts +2 -0
  200. package/dist/utility/wrun/wrun-etf-funds.util.js +4 -0
  201. package/dist/utility/wrun/wrun-held-lanes.util.js +8 -2
  202. package/dist/utility/wrun/wrun-history-as-of.util.d.ts +77 -0
  203. package/dist/utility/wrun/wrun-history-as-of.util.js +108 -0
  204. package/dist/utility/wrun/wrun-host.service.d.ts +64 -14
  205. package/dist/utility/wrun/wrun-host.service.js +137 -27
  206. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +3 -3
  207. package/dist/utility/wrun/wrun-hosted-wire-caps.js +12 -2
  208. package/dist/utility/wrun/wrun-hover.util.d.ts +8 -2
  209. package/dist/utility/wrun/wrun-hover.util.js +24 -13
  210. package/dist/utility/wrun/wrun-inert-legend.util.d.ts +13 -0
  211. package/dist/utility/wrun/wrun-inert-legend.util.js +31 -3
  212. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +7 -5
  213. package/dist/utility/wrun/wrun-input-requirements.leaf.js +16 -6
  214. package/dist/utility/wrun/wrun-install-pacer.util.d.ts +26 -0
  215. package/dist/utility/wrun/wrun-install-pacer.util.js +145 -0
  216. package/dist/utility/wrun/wrun-kit-refusal-stages.types.d.ts +22 -0
  217. package/dist/utility/wrun/wrun-kit-refusal-stages.types.js +1 -0
  218. package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +12 -5
  219. package/dist/utility/wrun/wrun-lane-refusal.leaf.js +23 -5
  220. package/dist/utility/wrun/wrun-lane-warmup.util.js +22 -4
  221. package/dist/utility/wrun/wrun-leg-close.util.d.ts +6 -5
  222. package/dist/utility/wrun/wrun-leg-close.util.js +11 -9
  223. package/dist/utility/wrun/wrun-leg-fetch.util.d.ts +3 -1
  224. package/dist/utility/wrun/wrun-leg-fetch.util.js +9 -2
  225. package/dist/utility/wrun/wrun-levels-child.util.d.ts +2 -0
  226. package/dist/utility/wrun/wrun-levels-child.util.js +6 -0
  227. package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -0
  228. package/dist/utility/wrun/wrun-live-intake.util.d.ts +15 -6
  229. package/dist/utility/wrun/wrun-live-intake.util.js +167 -47
  230. package/dist/utility/wrun/wrun-live-tick.util.d.ts +52 -8
  231. package/dist/utility/wrun/wrun-live-tick.util.js +655 -97
  232. package/dist/utility/wrun/wrun-market-facts.util.d.ts +16 -2
  233. package/dist/utility/wrun/wrun-market-facts.util.js +32 -3
  234. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +27 -27
  235. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +28 -16
  236. package/dist/utility/wrun/wrun-market-size-defaults.util.js +34 -5
  237. package/dist/utility/wrun/wrun-oi-lane.util.d.ts +10 -7
  238. package/dist/utility/wrun/wrun-oi-lane.util.js +16 -10
  239. package/dist/utility/wrun/wrun-option-strike-flow.util.js +1 -1
  240. package/dist/utility/wrun/wrun-option-views.util.d.ts +2 -2
  241. package/dist/utility/wrun/wrun-option-views.util.js +5 -2
  242. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.d.ts +5 -0
  243. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.js +16 -0
  244. package/dist/utility/wrun/wrun-options-stop.util.d.ts +3 -2
  245. package/dist/utility/wrun/wrun-options-stop.util.js +6 -4
  246. package/dist/utility/wrun/wrun-output-words.util.d.ts +14 -0
  247. package/dist/utility/wrun/wrun-output-words.util.js +51 -0
  248. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +116 -11
  249. package/dist/utility/wrun/wrun-overlay-drivers.util.js +208 -43
  250. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +20 -10
  251. package/dist/utility/wrun/wrun-overlay-park.util.d.ts +84 -0
  252. package/dist/utility/wrun/wrun-overlay-park.util.js +135 -0
  253. package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +37 -4
  254. package/dist/utility/wrun/wrun-overlay-recovery.util.js +26 -14
  255. package/dist/utility/wrun/wrun-overlay-result.util.d.ts +6 -1
  256. package/dist/utility/wrun/wrun-overlay-result.util.js +2 -0
  257. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +247 -26
  258. package/dist/utility/wrun/wrun-overlay-run.util.js +2234 -408
  259. package/dist/utility/wrun/wrun-pack.util.d.ts +8 -5
  260. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +11 -2
  261. package/dist/utility/wrun/wrun-panel-mount.util.js +122 -19
  262. package/dist/utility/wrun/wrun-panel-style.util.d.ts +4 -2
  263. package/dist/utility/wrun/wrun-panel-style.util.js +3 -2
  264. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +7 -0
  265. package/dist/utility/wrun/wrun-pin-spelling.util.js +18 -4
  266. package/dist/utility/wrun/wrun-pin-venues.util.d.ts +26 -17
  267. package/dist/utility/wrun/wrun-pin-venues.util.js +43 -36
  268. package/dist/utility/wrun/wrun-pinned-lanes.util.d.ts +58 -0
  269. package/dist/utility/wrun/wrun-pinned-lanes.util.js +72 -0
  270. package/dist/utility/wrun/wrun-prefix-cohort.util.js +2 -1
  271. package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +22 -9
  272. package/dist/utility/wrun/wrun-prefix-lanes.util.js +145 -26
  273. package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +29 -0
  274. package/dist/utility/wrun/wrun-prefix-proof.util.js +23 -5
  275. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +9 -1
  276. package/dist/utility/wrun/wrun-refusal-surface.util.js +15 -1
  277. package/dist/utility/wrun/wrun-refusal.util.d.ts +19 -1
  278. package/dist/utility/wrun/wrun-refusal.util.js +103 -16
  279. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +20 -6
  280. package/dist/utility/wrun/wrun-registry-errors.util.js +20 -6
  281. package/dist/utility/wrun/wrun-replay-rows.util.js +6 -10
  282. package/dist/utility/wrun/wrun-run-health.util.d.ts +95 -5
  283. package/dist/utility/wrun/wrun-run-health.util.js +209 -3
  284. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +2 -2
  285. package/dist/utility/wrun/wrun-run-interval-session.util.js +2 -2
  286. package/dist/utility/wrun/wrun-run-interval.util.d.ts +9 -8
  287. package/dist/utility/wrun/wrun-run-interval.util.js +13 -11
  288. package/dist/utility/wrun/wrun-sandbox-row-source.js +5 -2
  289. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +38 -11
  290. package/dist/utility/wrun/wrun-script-inputs.util.js +194 -56
  291. package/dist/utility/wrun/wrun-session-composition.util.d.ts +81 -0
  292. package/dist/utility/wrun/wrun-session-composition.util.js +169 -0
  293. package/dist/utility/wrun/wrun-setting-words.util.d.ts +10 -7
  294. package/dist/utility/wrun/wrun-setting-words.util.js +25 -7
  295. package/dist/utility/wrun/wrun-source-rows.util.d.ts +94 -28
  296. package/dist/utility/wrun/wrun-source-rows.util.js +738 -93
  297. package/dist/utility/wrun/wrun-stream-clock.util.d.ts +45 -0
  298. package/dist/utility/wrun/wrun-stream-clock.util.js +108 -0
  299. package/dist/utility/wrun/wrun-style-names.util.d.ts +23 -0
  300. package/dist/utility/wrun/wrun-style-names.util.js +74 -0
  301. package/dist/utility/wrun/wrun-tape-coins.util.d.ts +116 -0
  302. package/dist/utility/wrun/wrun-tape-coins.util.js +110 -0
  303. package/dist/utility/wrun/wrun-tape-source.util.d.ts +62 -32
  304. package/dist/utility/wrun/wrun-tape-source.util.js +72 -34
  305. package/dist/utility/wrun/wrun-tier-grid.util.d.ts +13 -5
  306. package/dist/utility/wrun/wrun-tier-grid.util.js +23 -13
  307. package/dist/utility/wrun/wrun-tpo-rows.util.js +2 -1
  308. package/dist/utility/wrun/wrun-trades-lane.util.d.ts +73 -0
  309. package/dist/utility/wrun/wrun-trades-lane.util.js +82 -0
  310. package/dist/utility/wrun/wrun-twin-compute-inputs.util.d.ts +5 -0
  311. package/dist/utility/wrun/wrun-twin-compute-inputs.util.js +9 -2
  312. package/dist/utility/wrun/wrun-visibility-table.d.ts +13 -0
  313. package/dist/utility/wrun/wrun-visibility-table.js +9 -0
  314. package/dist/utility/wrun/wrun-volume-profile.util.js +7 -3
  315. package/dist/utils/replay/replay-buffer-math.d.ts +16 -6
  316. package/dist/utils/replay/replay-buffer-math.js +60 -30
  317. package/dist/workers/constants/socket-slots.d.ts +11 -7
  318. package/dist/workers/constants/socket-slots.js +6 -5
  319. package/package.json +5 -5
@@ -0,0 +1,169 @@
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 { wrunChartHostEnv, hasWrunChartHostEnv } from '../../host-env.js';
14
+ import { wrunCmeDollarPointValue } from './wrun-cme-root-specs.util.js';
15
+ import { wrunDeclaredSourceLanes } from './wrun-source-rows.util.js';
16
+ import { wrunTradesLegOf } from './wrun-trades-lane.util.js';
17
+ /** The market placeholders a lane's payload names when it reads the chart's own market (`fetchLane`). */
18
+ const CURRENT_EXCHANGE = 'currentExchange';
19
+ const CURRENT_SYMBOL = 'currentSymbol';
20
+ function asksOwnMarket(acquisition, market) {
21
+ const exchange = acquisition.exchange;
22
+ const symbol = acquisition.symbol;
23
+ const ownExchange = exchange === undefined || exchange === CURRENT_EXCHANGE || exchange === market?.exchange;
24
+ const ownSymbol = symbol === undefined || symbol === CURRENT_SYMBOL || symbol === market?.symbol;
25
+ return ownExchange && ownSymbol;
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 function wrunSessionDollarPointValue(market) {
35
+ return wrunCmeDollarPointValue(market) ?? undefined;
36
+ }
37
+ /**
38
+ * Whether a session may compose this run's lanes: a dollar trades lane only where a print can be valued
39
+ * (`wrunSessionDollarPointValue`), no trades leg on the chart's own market (its rows would read OpenMarket's beside a
40
+ * session-fed trades lane), a tape asked by contract size (`minSize`, never a dollar or coins floor) on the chart's
41
+ * market, a trades lane in contracts on the chart's market, and a dollar trades lane asked in USD on the chart's
42
+ * market. A lane never asked has no payload and composes nothing, so it refuses nothing.
43
+ */
44
+ export function wrunSessionCompositionEligible(view) {
45
+ const declared = wrunDeclaredSourceLanes(view.metadata);
46
+ if (declared.has('trades_usd') && wrunSessionDollarPointValue(view.market) === undefined)
47
+ return false;
48
+ for (const lane of declared) {
49
+ const leg = wrunTradesLegOf(lane);
50
+ if (leg !== undefined && leg.exchange === view.market?.exchange && leg.symbol === view.market?.symbol)
51
+ return false;
52
+ }
53
+ const tape = view.acquisition.tape;
54
+ if (tape !== undefined) {
55
+ if (typeof tape.minSize !== 'number' || tape.minValue !== undefined || tape.minCoins !== undefined)
56
+ return false;
57
+ if (!asksOwnMarket(tape, view.market))
58
+ return false;
59
+ }
60
+ const trades = view.acquisition.trades;
61
+ if (trades !== undefined) {
62
+ if (trades.currency !== undefined && trades.currency !== 'Coin')
63
+ return false;
64
+ if (!asksOwnMarket(trades, view.market))
65
+ return false;
66
+ }
67
+ const dollars = view.acquisition.trades_usd;
68
+ if (dollars !== undefined) {
69
+ if (dollars.currency !== 'USD' || wrunSessionDollarPointValue(view.market) === undefined)
70
+ return false;
71
+ if (!asksOwnMarket(dollars, view.market))
72
+ return false;
73
+ }
74
+ return true;
75
+ }
76
+ /** The host's session seams, or undefined: a host without them (the sandbox worker, the phone app, every spec env
77
+ * that sets none) composes nothing, and every read point reads its buffers as before. */
78
+ export function wrunHostSessionSeams() {
79
+ return hasWrunChartHostEnv() ? wrunChartHostEnv().session : undefined;
80
+ }
81
+ /** The token the host's session holds for the overlay now (its order-flow generation while owned), else null. */
82
+ export function wrunSessionCompositionToken(indicatorId) {
83
+ return wrunHostSessionSeams()?.compositionToken(indicatorId) ?? null;
84
+ }
85
+ /** Sessions a reseed landed on while the host's session changed owner: the revision that change owes (from the old
86
+ * seam) stays owed past the landing. Empty unless a session owns an overlay, so the cold path never reads it. */
87
+ const compositionRevisionsKept = new WeakSet();
88
+ /**
89
+ * Lands a reseed's owed marks against the composition it read: the token it composed under still the host's, it
90
+ * served them (true: the caller clears them); an owner change since (a hand-back, a new seam) owes a revision its
91
+ * rows never read, kept for the next drain (false), and the drain's own clearing skips it once.
92
+ */
93
+ export function wrunReseedServedComposition(indicatorId, context, composedToken) {
94
+ if (composedToken === wrunSessionCompositionToken(indicatorId)) {
95
+ // Served: an earlier landing's kept mark (one no drain took, a recovery's reseed) is served with it.
96
+ compositionRevisionsKept.delete(context);
97
+ return true;
98
+ }
99
+ compositionRevisionsKept.add(context);
100
+ return false;
101
+ }
102
+ /** Whether the last reseed of `context` kept an owner change's revision owed (read once: the drain clears none). */
103
+ export function takeWrunCompositionRevisionKept(context) {
104
+ return compositionRevisionsKept.delete(context);
105
+ }
106
+ /**
107
+ * The rows a compute reads, composed where the host's session owns the overlay. Cold path first: no seams, or no
108
+ * token (nothing owns the overlay), answers `sources` itself, so every read point is byte-identical to before.
109
+ */
110
+ export function composeWrunSessionSources(input, sources) {
111
+ const seams = wrunHostSessionSeams();
112
+ if (seams === undefined)
113
+ return { sources, token: null };
114
+ const token = seams.compositionToken(input.indicatorId);
115
+ if (token === null)
116
+ return { sources, token };
117
+ if (sources.tapeRows === undefined &&
118
+ sources.buySellVolumeRows === undefined &&
119
+ sources.buySellVolumeUsdRows === undefined) {
120
+ return { sources, token };
121
+ }
122
+ if (!wrunSessionCompositionEligible(input.lanes))
123
+ return { sources, token };
124
+ const tapeAcquisition = input.lanes.acquisition.tape;
125
+ const grid = {
126
+ chartIndex: input.chartIndex,
127
+ intervalMs: input.intervalMs,
128
+ exchange: input.lanes.market?.exchange ?? '',
129
+ market: input.lanes.market?.symbol ?? '',
130
+ // The chart's session (the field wrunLiveBucketTs('trades') keys on): an RTH pane's buckets and seam bar sit on
131
+ // the RTH-anchored grid, never the exchange's full-session lattice.
132
+ ...(input.lanes.market?.sessionType !== undefined ? { sessionType: input.lanes.market.sessionType } : {}),
133
+ floor: typeof tapeAcquisition?.minSize === 'number' ? tapeAcquisition.minSize : 0,
134
+ // The wrun tape asks the large-print table on every market (wrunTapeLaneExtras).
135
+ large: tapeAcquisition?.large !== false,
136
+ };
137
+ const tapeRows = sources.tapeRows !== undefined
138
+ ? seams.composeLaneRows(input.indicatorId, 'tape', sources.tapeRows, grid)
139
+ : undefined;
140
+ const buySellVolumeRows = sources.buySellVolumeRows !== undefined
141
+ ? seams.composeLaneRows(input.indicatorId, 'trades', sources.buySellVolumeRows, grid)
142
+ : undefined;
143
+ // The dollar lane rides the same grid plus the point value that prices its bars; none known, it stays OpenMarket's.
144
+ const pointValue = wrunSessionDollarPointValue(input.lanes.market);
145
+ const buySellVolumeUsdRows = sources.buySellVolumeUsdRows !== undefined && pointValue !== undefined
146
+ ? seams.composeLaneRows(input.indicatorId, 'trades_usd', sources.buySellVolumeUsdRows, {
147
+ ...grid,
148
+ pointValue,
149
+ })
150
+ : undefined;
151
+ if (tapeRows === sources.tapeRows &&
152
+ buySellVolumeRows === sources.buySellVolumeRows &&
153
+ (buySellVolumeUsdRows === undefined || buySellVolumeUsdRows === sources.buySellVolumeUsdRows)) {
154
+ return { sources, token };
155
+ }
156
+ return {
157
+ sources: {
158
+ ...sources,
159
+ ...(tapeRows !== undefined ? { tapeRows } : {}),
160
+ ...(buySellVolumeRows !== undefined ? { buySellVolumeRows } : {}),
161
+ ...(buySellVolumeUsdRows !== undefined ? { buySellVolumeUsdRows } : {}),
162
+ },
163
+ token,
164
+ };
165
+ }
166
+ /** The live context's lanes view (its sheet, its recorded acquisitions, the chart's market at its run). */
167
+ export function wrunSessionLanesOfContext(context) {
168
+ return { metadata: context.metadata, acquisition: context.acquisition, market: context.market };
169
+ }
@@ -14,6 +14,7 @@
14
14
  * wrun-dialog-rows); without them a choice prints its label as the author
15
15
  * wrote it, a word all the same.
16
16
  */
17
+ import { type DisplayOffset } from '../chart/display-offset.leaf.js';
17
18
  import type { WrunScriptInputDeclaration } from './wrun-script-inputs.util.js';
18
19
  /** What a decode needs to know about a setting: its kind and, for a choice, its option values and labels. */
19
20
  export interface WrunWordsShape {
@@ -38,8 +39,9 @@ export interface WrunSettingWords {
38
39
  chart?: string;
39
40
  /** The line styles by their platform word (solid, dashed, dotted). */
40
41
  lineStyles?: Readonly<Record<string, string>>;
41
- /** The zone a time reads in, ms east of UTC; UTC when absent. */
42
- zoneOffsetMs?: number;
42
+ /** The zone a time reads in, ms east of UTC: a fixed shift, or the shift at each instant (each time reads its
43
+ * own, a zone moves its clock); UTC when absent. */
44
+ zoneOffsetMs?: DisplayOffset;
43
45
  }
44
46
  /** A choice label as the viewer reads it: a platform word ("chart", a line
45
47
  * style) in the viewer's language when the surface passes its words, any
@@ -72,12 +74,13 @@ export declare function minutesToClock(minutes: number): string;
72
74
  * from midnight; undefined for anything else. */
73
75
  export declare function clockToMinutes(text: string): number | undefined;
74
76
  /** Epoch seconds as the "YYYY-MM-DDTHH:MM" wall time a datetime-local field
75
- * holds, in the zone `offsetMs` east of UTC (read with UTC getters, never
76
- * the browser's zone); '' (an empty field) for an unset time. A sheet
77
+ * holds, in the zone `offset` east of UTC (fixed, or read at this instant
78
+ * for a zone that moves its clock; read with UTC getters, never the
79
+ * browser's zone); '' (an empty field) for an unset time. A sheet
77
80
  * declares a time that may be off with `default: 0` (no date picked: the
78
81
  * script's own fallback, such as the first expiry), so 0, a negative and a
79
82
  * non-finite value are no instant, never the epoch's date (31/12/1969 west
80
83
  * of UTC). Every time text reads through here, the field and the words. */
81
- export declare function epochToLocalInput(seconds: number, offsetMs?: number): string;
82
- /** A time value as people read it: its date and clock in the zone `offsetMs` east of UTC, '' when unset. */
83
- export declare function describeTime(value: unknown, offsetMs?: number): string;
84
+ export declare function epochToLocalInput(seconds: number, offset?: DisplayOffset): string;
85
+ /** A time value as people read it: its date and clock in the zone `offset` east of UTC at that time, '' when unset. */
86
+ export declare function describeTime(value: unknown, offset?: DisplayOffset): string;
@@ -1,3 +1,20 @@
1
+ /**
2
+ * Setting words: a wrun setting as the words a person reads, the ONE decode
3
+ * every text surface goes through (docs/features/kscript/wrun/wrun-typed-inputs.md,
4
+ * "Setting words"). wrun stores a choice as a code: a select its option value
5
+ * (a timeframe is a position in its sheet's word list, so "2" is 5m on one
6
+ * sheet and 15m on another), a multi a bitmask, a time epoch seconds, a
7
+ * session's start and end minutes after midnight. A surface hands the
8
+ * setting's shape and its stored value here and prints what comes back; it
9
+ * never decodes a code on its own.
10
+ *
11
+ * Pure and worker-safe: no i18n. The boot path reaches it through its door
12
+ * (wrun-setting-words.lazy.ts, bound below as this module evaluates). A
13
+ * surface that localizes passes the platform words (wrunSettingWordsFor,
14
+ * wrun-dialog-rows); without them a choice prints its label as the author
15
+ * wrote it, a word all the same.
16
+ */
17
+ import { displayWallMs } from '../chart/display-offset.leaf.js';
1
18
  import { WRUN_TIMEFRAME_WORDS, wrunSelectOptionValue } from './wrun-color-settings.util.js';
2
19
  import { bindWrunSettingWords } from './wrun-setting-words.lazy.js';
3
20
  const CHART_WORD = WRUN_TIMEFRAME_WORDS[0];
@@ -162,23 +179,24 @@ export function clockToMinutes(text) {
162
179
  return hours * 60 + mins;
163
180
  }
164
181
  /** Epoch seconds as the "YYYY-MM-DDTHH:MM" wall time a datetime-local field
165
- * holds, in the zone `offsetMs` east of UTC (read with UTC getters, never
166
- * the browser's zone); '' (an empty field) for an unset time. A sheet
182
+ * holds, in the zone `offset` east of UTC (fixed, or read at this instant
183
+ * for a zone that moves its clock; read with UTC getters, never the
184
+ * browser's zone); '' (an empty field) for an unset time. A sheet
167
185
  * declares a time that may be off with `default: 0` (no date picked: the
168
186
  * script's own fallback, such as the first expiry), so 0, a negative and a
169
187
  * non-finite value are no instant, never the epoch's date (31/12/1969 west
170
188
  * of UTC). Every time text reads through here, the field and the words. */
171
- export function epochToLocalInput(seconds, offsetMs = 0) {
189
+ export function epochToLocalInput(seconds, offset = 0) {
172
190
  if (!Number.isFinite(seconds) || seconds <= 0)
173
191
  return '';
174
- const wall = new Date(seconds * 1000 + offsetMs);
192
+ const wall = new Date(displayWallMs(offset, seconds * 1000));
175
193
  if (Number.isNaN(wall.getTime()))
176
194
  return '';
177
195
  const pad = (n) => String(n).padStart(2, '0');
178
196
  return `${wall.getUTCFullYear()}-${pad(wall.getUTCMonth() + 1)}-${pad(wall.getUTCDate())}T${pad(wall.getUTCHours())}:${pad(wall.getUTCMinutes())}`;
179
197
  }
180
- /** A time value as people read it: its date and clock in the zone `offsetMs` east of UTC, '' when unset. */
181
- export function describeTime(value, offsetMs = 0) {
182
- return epochToLocalInput(Number(value), offsetMs).replace('T', ' ');
198
+ /** A time value as people read it: its date and clock in the zone `offset` east of UTC at that time, '' when unset. */
199
+ export function describeTime(value, offset = 0) {
200
+ return epochToLocalInput(Number(value), offset).replace('T', ' ');
183
201
  }
184
202
  bindWrunSettingWords({ wrunCodedWords, wrunRowWordsShapes });
@@ -179,6 +179,21 @@
179
179
  * Any other class refuses by name (fail closed), matching the daemon's
180
180
  * serving-gate behavior for unserved classes.
181
181
  *
182
+ * Market pins on typed feeds and the book (U9e, wrun-pinned-lanes.util): a
183
+ * secondary `book`, `oi`, `funding` or `liquidations` input pinned to one
184
+ * whole market (`symbol` AND `exchange`) reads a lane of its own there
185
+ * (`pinnedLaneRows`, keyed `<class>@<exchange>|<symbol>`), in its class's row
186
+ * dialect on the chart's bars: the shared host's foreign ask of the class is
187
+ * answered from the lane of the ask's market, never from the chart's own lane
188
+ * (an own book and a pinned book in one package read one lane each). It takes
189
+ * no interval of its own (one equal to the chart's is the chart's grid) and no
190
+ * view. Which classes a pin is served on is ONE table every gate reads
191
+ * (`WRUN_BROWSER_PINNED_LANE_CLASSES`: this planner's refusal, the push
192
+ * intake's eligibility and the run's admission); a pin on any other class
193
+ * (`implied_volatility`, `skew`, `volume_profile`, `tape`, ...) refuses by
194
+ * name: "the chart reads <class> on its own market only; a market pin on it
195
+ * is not served yet".
196
+ *
182
197
  * Scalar missingness honors the declared `missing` policy: absent = 'carry'
183
198
  * (the latest eligible value forward-fills; until every carry input has a
184
199
  * first value the row abstains, absent from the rows), 'nan' delivers NaN,
@@ -310,10 +325,13 @@
310
325
  * The builders take a `clock: { intervalMs, nowMs }` whenever a leg or a
311
326
  * typed pin exists and refuse to guess without one (an open-stamped coarse
312
327
  * leg is exactly the lookahead leak the clock prevents). Refused by name
313
- * before any fetch: a market pin on anything but a secondary `ohlcv` input
314
- * (typed feeds, cells and `time` follow the chart's own market; the primary
315
- * input follows the chart's market; an `odds` input is the exception, it
316
- * pins its own Polymarket market, primary included), a finer pin, a leg that is not a whole
328
+ * before any fetch: a market pin on a class the one table leaves out (the
329
+ * chart reads it on its own market only; the served pins are a secondary
330
+ * `ohlcv` input's leg, a trades leg, a lane stream's leg and a secondary
331
+ * book, oi, funding or liquidations input's lane), a half pin, a pin on the
332
+ * primary input (it follows the chart's market; an `odds` input is the
333
+ * exception, it pins its own Polymarket market, primary included), an
334
+ * interval or a view on a pinned typed feed, a finer pin, a leg that is not a whole
317
335
  * multiple of the chart interval (7 days for WEEK), a pin on a celled,
318
336
  * `time`, trades, liquidations, implied_volatility or skew input, an
319
337
  * interval pin on the primary input (index 0), an interval the vocabulary
@@ -334,6 +352,7 @@
334
352
  * `time`, the bucket open itself) until a pan-back loads the rest, and the
335
353
  * tail build gives the same answer.
336
354
  */
355
+ import { type KScriptWorkerPackedOhlcvRows } from '../../instances/script-engine-worker-ohlcv-transfer.js';
337
356
  import { type WrunPinnedInterval } from './wrun-pinned-interval.util.js';
338
357
  import { type LiveBucketVenue } from '../chart/live-bucket.util.js';
339
358
  import { type WrunBarVenue } from '../chart/wrun-bar-session-facts.util.js';
@@ -383,25 +402,13 @@ export declare function wrunChartCandleRows(tc: {
383
402
  }>;
384
403
  } | null | undefined): number[][];
385
404
  /**
386
- * Why `rows` are not the chart's candles at `intervalMs`, or null when they are. An interval switch
387
- * replaces the main series in steps (the cached paint, then the resident commit), so a run planned
388
- * between them reads the previous interval's bars under the new interval: it then asks its warm-up
389
- * on the new clock over the old bars, and the host refuses the mixed phases it is handed
390
- * (`wrun_densify_mixed_phase`, "Could not draw" over the stand-in; the 2026-10-15 tap-storm rig,
391
- * three of four 300 ms storms, Ichimoku Cloud and EMA). The full run asks this before it plans and
392
- * waits for the next chart trigger instead (`WrunNoBarsError`), as for no rows at all.
393
- *
394
- * Judged on the newest rows alone (a chart holds one interval at a time):
395
- * - `mixed-phase`: the rows open on three or more phases of the interval (4h bars on a 1d chart
396
- * open on six); a DST shift moves a session-bound venue's bars by one phase, never two;
397
- * - `coarser`: every spacing between the newest rows is at least two and a half intervals (1d
398
- * bars on a 4h chart); a session-bound venue's overnight or weekend gap is one spacing among
399
- * several, never all of them.
400
- * A calendar interval (1M, 3M, 6M, 1Y) opens on the 1st of a month at no fixed phase, a non-time
401
- * interval has no grid, and a chart of fewer rows than the check reads (a new listing, a spec's
402
- * three-row chart) leaves nothing to judge: all pass.
405
+ * Why `rows` are not the chart's candles at `intervalMs` yet, judged on the bar grid `venue` keeps (`live-bucket.util`),
406
+ * or null when they are: a run planned between an interval switch's cached paint and its commit would read the previous
407
+ * interval's bars, so the full run waits for the next chart trigger instead (`WrunNoBarsError`). `mixed-phase` names
408
+ * finer bars, `coarser` bars that skip the chart's own on every spacing. A calendar or non-time interval, or fewer rows
409
+ * than the check reads, pass.
403
410
  */
404
- export declare function wrunChartRowsOffIntervalGrid(rows: ReadonlyArray<ArrayLike<number>>, intervalMs: number): 'mixed-phase' | 'coarser' | null;
411
+ export declare function wrunChartRowsOffIntervalGrid(rows: ReadonlyArray<ArrayLike<number>>, intervalMs: number, venue?: LiveBucketVenue | null): 'mixed-phase' | 'coarser' | null;
405
412
  /**
406
413
  * The rows of a `wrunChartCandleRows` array from `fromMs` through `toMs`, with its recorded
407
414
  * missing bars strictly between the first and the last row kept: a clamped run window (the full
@@ -429,9 +436,12 @@ export declare function wrunDemandedSourceClass(source: Pick<WrunInputSource, 's
429
436
  * C1.4): the dollar lane `trades_usd` (rows `buySellVolumeUsdRows`) for
430
437
  * `currency: "USD"`, the coin lane `trades` (the chart's own buy/sell lane)
431
438
  * otherwise, and a trades input pinned to one whole market its quote's leg lane
432
- * there (kit 0.77.0, `trades@BYBIT|BTCUSDT`); none for an undemanded input
433
- * (wrunDemandedSourceClass) or a half pin (refused by name). The one rule the
434
- * full run's lane fetches, the live intake and the reconcile share.
439
+ * there (kit 0.77.0, `trades@BYBIT|BTCUSDT`); a book, oi, funding or
440
+ * liquidations input pinned to one whole market reads that class's lane there
441
+ * (U9e, wrun-pinned-lanes.util, `book@COINBASE|BTC-USD`); none for an
442
+ * undemanded input (wrunDemandedSourceClass) or a trades half pin (refused by
443
+ * name). The one rule the full run's lane fetches, the live intake and the
444
+ * reconcile share.
435
445
  */
436
446
  export declare function wrunSourceLane(source: Pick<WrunInputSource, 'source' | 'currency' | 'undemanded' | 'symbol' | 'exchange' | 'follow'> | undefined): string | undefined;
437
447
  /** Every lane a sheet's inputs read (wrunSourceLane), declaration order kept. */
@@ -459,6 +469,11 @@ export interface WrunChartSourceRows {
459
469
  * lane's acquisition, `wrunLaneAcquisitionIntervalMs`), so every row nests inside one chart bar; a lane without
460
470
  * one rides the chart's interval. */
461
471
  tradeLegIntervals?: Readonly<Record<string, number>>;
472
+ /** The pinned lanes (U9e, wrun-pinned-lanes.util) by lane id (`book@COINBASE|BTC-USD`, `oi@BINANCE_FUTURES|BTCUSDT`):
473
+ * the rows of a book, oi, funding or liquidations input pinned to another market, in the dialect of the chart's own
474
+ * lane of the class, on the chart's bars. The shared host's foreign ask of the class reads the lane of its market; a
475
+ * lane never asked holds none (its inputs read their fill), and no ask reads the chart's own lane in its place. */
476
+ pinnedLaneRows?: Readonly<Record<string, ReadonlyArray<ArrayLike<number>>>>;
462
477
  /** kScript open_interest lane rows [ts, open, high, low, close]; optional
463
478
  * when no `oi` input is declared. */
464
479
  openInterestRows?: ReadonlyArray<ArrayLike<number>>;
@@ -616,6 +631,12 @@ export declare function wrunCalendarRowBounds(intervalMs: number): WrunLegRowBou
616
631
  export interface WrunAlignClock {
617
632
  intervalMs: number;
618
633
  nowMs: number;
634
+ /** The instant a declared history (a leg's `bars`) counts back from when it is not `nowMs`
635
+ * (wrun-history-as-of.util): a live session's earliest lane pin, its first run's now, or a
636
+ * replay's present. Absent, or not earlier than `nowMs`, the clock reads exactly as `nowMs`. A
637
+ * full build splits at it (`buildWrunInputRows`): the rows the as-of closed align under it, so
638
+ * the leg core counts each backlog back from it, and the rows after them align under `nowMs`. */
639
+ historyAsOfMs?: number;
619
640
  }
620
641
  /** The typed-feed classes an own-market interval pin buckets by the clock
621
642
  * (no extra fetch: the lane's own rows). */
@@ -1032,6 +1053,33 @@ export declare function wrunBrowserRunWireCaps(): string[];
1032
1053
  * read the one lane its class rides, an unasked one none (`wrunUnaskedCelledInput`; the class guard walks this set,
1033
1054
  * tests/utility/wrun/wrun-source-rows.lane-demand.spec.ts). */
1034
1055
  export declare const WRUN_LANE_CELL_CLASSES: ReadonlySet<string>;
1056
+ /** The call that made a run (`wrunHostRunOf`): a full build, a carry advance, a tail build, the one run
1057
+ * `buildWrunInputRowsAndCarry` shares between its rows and its carry, or the advance that recovers a combined build's
1058
+ * carry after what the build read moved during the awaits before its install (the host's `carryWithBuild` guard). */
1059
+ export type WrunWindowConversionSite = 'build' | 'advance' | 'tail' | 'combined' | 'recovered';
1060
+ /**
1061
+ * The page's full-window conversions by site: every run made with no carry to start after (`cellsAfterTs` absent),
1062
+ * which adapts every celled lane row of the window (the book's cells, the profile's, the finer candles') where a tail
1063
+ * adapts the rows past its carry alone. A reseed or a full run makes two on the two-step path (its build, then its
1064
+ * carry advanced from the empty seed) and one on the combined one, plus one under `recovered` when the combined
1065
+ * build's carry was recomputed because a closed candle or a leg record moved during the awaits before its install.
1066
+ * Page-wide, read by the dev rig probes (`__wrunRegistry.windowConversions`, `__wrunDev.windowConversions`).
1067
+ */
1068
+ export type WrunWindowConversionCounts = Record<WrunWindowConversionSite, number>;
1069
+ /** A copy of the page's full-window conversion counts (above). */
1070
+ export declare function wrunWindowConversionCounts(): WrunWindowConversionCounts;
1071
+ /** The overlay a packed book block was fetched for. */
1072
+ export interface WrunBookLaneOwner {
1073
+ chartIndex: number;
1074
+ indicatorId: string;
1075
+ }
1076
+ /**
1077
+ * A lane's packed transfer as the run reads it (WRUN-PANBACK-2 S2). A K_ORDERBOOK lane (`orderbook`) keeps the worker's
1078
+ * block: its rows are zero-copy views of the transferred buffer (`packedOhlcvRowViews`, the zero padding past a shorter
1079
+ * row cut off by its length), recorded with the overlay that fetched them, so no row of the lane becomes a plain array
1080
+ * and the book adapter reads the block where it stands. Every other lane unpacks to plain rows, as before.
1081
+ */
1082
+ export declare function wrunPackedLaneRows(type: string, payload: KScriptWorkerPackedOhlcvRows, owner: WrunBookLaneOwner): ArrayLike<number>[];
1035
1083
  /**
1036
1084
  * The state the aligner holds between builds (the shared host's `WrunInputCarry`): the newest row
1037
1085
  * folded in, each carry input's newest finite value, each forming fold's bucket, each leg's
@@ -1054,9 +1102,25 @@ export declare function emptyWrunInputCarry(): WrunInputCarry;
1054
1102
  * session venue or a daily-landed lane, where it walks the chart's own rows too
1055
1103
  * (`wrunNeedsChartPrimary`). `clock` is required when any input pins a leg, a typed feed or a daily
1056
1104
  * lane (the as-of alignment), and carries the chart's exact interval: a calendar chart is known by
1057
- * it.
1105
+ * it. A clock naming an as-of earlier than its now (`historyAsOfMs`: a live session's pin, a replay's
1106
+ * present) splits the build there (`wrunAlignHostRows`), so each declared depth counts back from it.
1058
1107
  */
1059
1108
  export declare function buildWrunInputRows(metadata: WrunIndicatorMetadata, sources: WrunChartSourceRows, clock?: WrunAlignClock): WrunInputRow[];
1109
+ /**
1110
+ * `buildWrunInputRows` and the carry seed a session takes from it, from ONE conversion of the window's lanes: the rows
1111
+ * exactly as `buildWrunInputRows(metadata, sources, clock)` builds them, and the carry exactly as
1112
+ * `advanceWrunInputCarry(metadata, emptyWrunInputCarry(), rows.slice(0, -1), sources, clock)` advances it (a full run's
1113
+ * and a reseed's seed). That advance runs `wrunHostRunOf` again with the build's own arguments: the empty seed names no
1114
+ * `throughTs`, so no lane row is skipped, and rows to advance over are the chart rows' own (its replay branch), so it
1115
+ * converts every celled lane row of the window a second time. Here the carry advances on the build's run instead.
1116
+ *
1117
+ * The run reads the sources once, as they stand at the call: a caller that awaits before it seeds the carry (the
1118
+ * worker's answer) gets the carry of the rows it evaluated, never of buffers rewritten in place meanwhile.
1119
+ */
1120
+ export declare function buildWrunInputRowsAndCarry(metadata: WrunIndicatorMetadata, sources: WrunChartSourceRows, clock?: WrunAlignClock): {
1121
+ rows: WrunInputRow[];
1122
+ carry: WrunInputCarry;
1123
+ };
1060
1124
  /**
1061
1125
  * The TAIL of the full build: the input rows for every primary bar at or after `fromTs`, resumed
1062
1126
  * from `carrySeed` (the state after every bar strictly before `fromTs`, see
@@ -1069,9 +1133,11 @@ export declare function buildWrunInputTailRows(metadata: WrunIndicatorMetadata,
1069
1133
  * full build holds after them (the host's `advanceWrunCarry`: the aligner's own pass replayed
1070
1134
  * through the last closed row over the same rows and clock; with no rows handed in, a plan that
1071
1135
  * reads no leg advances from the rows' carry values alone). Returns a NEW carry; the seed is never
1072
- * mutated.
1136
+ * mutated. From the empty seed, a clock naming an as-of advances the way the full build aligned
1137
+ * (`wrunHistoryAsOfSplit`): under the as-of through the split, then under the clock. `site` names the conversion
1138
+ * count it moves (`advance`, or `recovered` for the advance that replaces a combined build's moved carry).
1073
1139
  */
1074
- export declare function advanceWrunInputCarry(metadata: WrunIndicatorMetadata, seed: WrunInputCarry, closedRows: readonly WrunInputRow[], sources?: Partial<WrunChartSourceRows>, clock?: WrunAlignClock): WrunInputCarry;
1140
+ export declare function advanceWrunInputCarry(metadata: WrunIndicatorMetadata, seed: WrunInputCarry, closedRows: readonly WrunInputRow[], sources?: Partial<WrunChartSourceRows>, clock?: WrunAlignClock, site?: 'advance' | 'recovered'): WrunInputCarry;
1075
1141
  /** init()'s positional argument block: declared param defaults overlaid with
1076
1142
  * any user-provided values by param name (wrunParamValuesFromSettings reads
1077
1143
  * them off the overlay's settings, a colour as its packed number). Every