@orangecharts/wrun-chart-host 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (362) hide show
  1. package/README.md +23 -6
  2. package/dist/constants/exchange-names.leaf.d.ts +8 -0
  3. package/dist/constants/exchange-names.leaf.js +101 -0
  4. package/dist/constants/kscript-data-interval-restrictions.constants.d.ts +15 -0
  5. package/dist/constants/kscript-data-interval-restrictions.constants.js +40 -0
  6. package/dist/constants/opra-compliance.constants.d.ts +19 -0
  7. package/dist/constants/opra-compliance.constants.js +19 -0
  8. package/dist/constants/replay-ladder.leaf.d.ts +30 -0
  9. package/dist/constants/replay-ladder.leaf.js +99 -0
  10. package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +133 -0
  11. package/dist/constants/scriptEditor/builtin-script-snippets.js +451 -0
  12. package/dist/constants/scriptEditor/cme-official-scripts.constants.d.ts +168 -0
  13. package/dist/constants/scriptEditor/cme-official-scripts.constants.js +398 -0
  14. package/dist/constants/scriptEditor/converted-script-id.leaf.d.ts +8 -0
  15. package/dist/constants/scriptEditor/converted-script-id.leaf.js +10 -0
  16. package/dist/constants/scriptEditor/execution.constants.d.ts +4 -0
  17. package/dist/constants/scriptEditor/execution.constants.js +14 -0
  18. package/dist/constants/wrun-prefix-safe.constants.d.ts +23 -0
  19. package/dist/constants/wrun-prefix-safe.constants.js +26 -0
  20. package/dist/host-env.d.ts +321 -24
  21. package/dist/host-env.js +15 -0
  22. package/dist/host-ports.types.d.ts +857 -35
  23. package/dist/index.d.ts +149 -2
  24. package/dist/index.js +149 -2
  25. package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +31 -0
  26. package/dist/instances/script-engine-worker-ohlcv-transfer.js +164 -0
  27. package/dist/interfaces/market-event.interface.d.ts +231 -0
  28. package/dist/interfaces/market-event.interface.js +15 -0
  29. package/dist/interfaces/opra-realtime.interface.d.ts +70 -134
  30. package/dist/interfaces/opra-realtime.interface.js +34 -59
  31. package/dist/interfaces/replay.interface.d.ts +285 -0
  32. package/dist/interfaces/replay.interface.js +1 -0
  33. package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +1 -0
  34. package/dist/kscript-data/controls/live-ohlcv-merge.util.js +93 -0
  35. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +5 -1
  36. package/dist/kscript-data/controls/live-trades-merge.util.js +2 -2
  37. package/dist/market-data/billing.interface.d.ts +219 -0
  38. package/dist/market-data/billing.interface.js +58 -0
  39. package/dist/market-data/venue-governed.util.d.ts +2 -0
  40. package/dist/market-data/venue-governed.util.js +10 -0
  41. package/dist/market-data/venue.d.ts +122 -0
  42. package/dist/market-data/venue.js +1 -0
  43. package/dist/market-data/venues/index.d.ts +97 -0
  44. package/dist/market-data/venues/index.js +33 -0
  45. package/dist/market-data/venues/opra.contract.copy.json +35 -0
  46. package/dist/market-data/venues/opra.d.ts +70 -0
  47. package/dist/market-data/venues/opra.js +74 -0
  48. package/dist/replay/replayIndicatorRows.d.ts +31 -0
  49. package/dist/replay/replayIndicatorRows.js +117 -0
  50. package/dist/replay/replayLadder.d.ts +85 -0
  51. package/dist/replay/replayLadder.js +388 -0
  52. package/dist/utility/auth/server-clock.util.d.ts +81 -0
  53. package/dist/utility/auth/server-clock.util.js +238 -0
  54. package/dist/utility/chart/builtin-identity.util.d.ts +18 -0
  55. package/dist/utility/chart/builtin-identity.util.js +51 -0
  56. package/dist/utility/chart/cache-alignment.util.d.ts +454 -0
  57. package/dist/utility/chart/cache-alignment.util.js +926 -0
  58. package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +15 -0
  59. package/dist/utility/chart/chart-data-fetch-generation.util.js +22 -0
  60. package/dist/utility/chart/chart-mount-epoch.util.d.ts +5 -0
  61. package/dist/utility/chart/chart-mount-epoch.util.js +29 -0
  62. package/dist/utility/chart/chart-time-domain.util.d.ts +12 -0
  63. package/dist/utility/chart/chart-time-domain.util.js +23 -0
  64. package/dist/utility/chart/color-customization.leaf.d.ts +10 -0
  65. package/dist/utility/chart/color-customization.leaf.js +16 -0
  66. package/dist/utility/chart/date-labelled-interval.leaf.d.ts +15 -0
  67. package/dist/utility/chart/date-labelled-interval.leaf.js +19 -0
  68. package/dist/utility/chart/footprint-tick-grid.util.d.ts +106 -0
  69. package/dist/utility/chart/footprint-tick-grid.util.js +167 -0
  70. package/dist/utility/chart/gesture-timing.leaf.d.ts +29 -0
  71. package/dist/utility/chart/gesture-timing.leaf.js +29 -0
  72. package/dist/utility/chart/governed-contract-coin.util.d.ts +22 -0
  73. package/dist/utility/chart/governed-contract-coin.util.js +39 -0
  74. package/dist/utility/chart/host-bar-placement.util.d.ts +107 -0
  75. package/dist/utility/chart/host-bar-placement.util.js +447 -0
  76. package/dist/utility/chart/index-host-tier.util.d.ts +31 -0
  77. package/dist/utility/chart/index-host-tier.util.js +118 -0
  78. package/dist/utility/chart/index-mode-admission.util.d.ts +34 -0
  79. package/dist/utility/chart/index-mode-admission.util.js +67 -0
  80. package/dist/utility/chart/indicator-error-message.util.d.ts +35 -0
  81. package/dist/utility/chart/indicator-error-message.util.js +44 -0
  82. package/dist/utility/chart/indicator-run-interval.util.d.ts +130 -0
  83. package/dist/utility/chart/indicator-run-interval.util.js +268 -0
  84. package/dist/utility/chart/kscript-apply-fingerprint.util.d.ts +65 -0
  85. package/dist/utility/chart/kscript-apply-fingerprint.util.js +357 -0
  86. package/dist/utility/chart/kscript-chart-flush.leaf.d.ts +22 -0
  87. package/dist/utility/chart/kscript-chart-flush.leaf.js +13 -0
  88. package/dist/utility/chart/kscript-data-interval-restriction.leaf.d.ts +6 -0
  89. package/dist/utility/chart/kscript-data-interval-restriction.leaf.js +27 -0
  90. package/dist/utility/chart/kscript-integration-decision.leaf.d.ts +89 -0
  91. package/dist/utility/chart/kscript-integration-decision.leaf.js +80 -0
  92. package/dist/utility/chart/kscript-live-coalesce.util.d.ts +76 -0
  93. package/dist/utility/chart/kscript-live-coalesce.util.js +156 -0
  94. package/dist/utility/chart/kscript-live-rest-pace.util.d.ts +34 -0
  95. package/dist/utility/chart/kscript-live-rest-pace.util.js +134 -0
  96. package/dist/utility/chart/kscript-live-source-identity.util.d.ts +98 -0
  97. package/dist/utility/chart/kscript-live-source-identity.util.js +121 -0
  98. package/dist/utility/chart/kscript-mounted-plot-set.leaf.d.ts +48 -0
  99. package/dist/utility/chart/kscript-mounted-plot-set.leaf.js +145 -0
  100. package/dist/utility/chart/kscript-perf-tracker.util.d.ts +243 -0
  101. package/dist/utility/chart/kscript-perf-tracker.util.js +522 -0
  102. package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +43 -0
  103. package/dist/utility/chart/kscript-run-interval-projection.util.js +471 -0
  104. package/dist/utility/chart/kscript-run-result-equality.util.d.ts +38 -0
  105. package/dist/utility/chart/kscript-run-result-equality.util.js +89 -0
  106. package/dist/utility/chart/kscript-settings-revision.leaf.d.ts +2 -0
  107. package/dist/utility/chart/kscript-settings-revision.leaf.js +12 -0
  108. package/dist/utility/chart/kscript-source-degrade.leaf.d.ts +63 -0
  109. package/dist/utility/chart/kscript-source-degrade.leaf.js +68 -0
  110. package/dist/utility/chart/kscript-source-retention.util.d.ts +134 -0
  111. package/dist/utility/chart/kscript-source-retention.util.js +218 -0
  112. package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +57 -0
  113. package/dist/utility/chart/kscript-standin-identity.leaf.js +61 -0
  114. package/dist/utility/chart/kscript-titancharts-preparation.util.d.ts +15 -0
  115. package/dist/utility/chart/kscript-titancharts-preparation.util.js +376 -0
  116. package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +9 -0
  117. package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +130 -0
  118. package/dist/utility/chart/kscript-venue-policy.util.d.ts +217 -0
  119. package/dist/utility/chart/kscript-venue-policy.util.js +324 -0
  120. package/dist/utility/chart/live-cadence.util.d.ts +38 -0
  121. package/dist/utility/chart/live-cadence.util.js +37 -0
  122. package/dist/utility/chart/live-feed-series-match.leaf.d.ts +13 -0
  123. package/dist/utility/chart/live-feed-series-match.leaf.js +21 -0
  124. package/dist/utility/chart/local-engine-self-heal-backoff.util.d.ts +46 -0
  125. package/dist/utility/chart/local-engine-self-heal-backoff.util.js +46 -0
  126. package/dist/utility/chart/local-engine-uninit.leaf.d.ts +21 -0
  127. package/dist/utility/chart/local-engine-uninit.leaf.js +22 -0
  128. package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +62 -0
  129. package/dist/utility/chart/local-kscript-source-revalidation.util.js +123 -0
  130. package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +214 -0
  131. package/dist/utility/chart/local-kscript-warmup-depth.util.js +376 -0
  132. package/dist/utility/chart/local-technical-script-live-apply-coalescer.util.d.ts +85 -0
  133. package/dist/utility/chart/local-technical-script-live-apply-coalescer.util.js +197 -0
  134. package/dist/utility/chart/local-technical-script-range.leaf.d.ts +72 -0
  135. package/dist/utility/chart/local-technical-script-range.leaf.js +126 -0
  136. package/dist/utility/chart/mixed-mode.util.d.ts +167 -0
  137. package/dist/utility/chart/mixed-mode.util.js +139 -0
  138. package/dist/utility/chart/ohlcv-row-readiness.util.d.ts +36 -0
  139. package/dist/utility/chart/ohlcv-row-readiness.util.js +90 -0
  140. package/dist/utility/chart/opra-user-scripts-gate.util.d.ts +19 -0
  141. package/dist/utility/chart/opra-user-scripts-gate.util.js +32 -0
  142. package/dist/utility/chart/overlay-execution-guard-key.leaf.d.ts +8 -0
  143. package/dist/utility/chart/overlay-execution-guard-key.leaf.js +10 -0
  144. package/dist/utility/chart/price-precision.util.d.ts +40 -0
  145. package/dist/utility/chart/price-precision.util.js +70 -0
  146. package/dist/utility/chart/profile-block-size.util.d.ts +64 -0
  147. package/dist/utility/chart/profile-block-size.util.js +141 -0
  148. package/dist/utility/chart/protected-kscript-degenerate-rows.leaf.d.ts +11 -0
  149. package/dist/utility/chart/protected-kscript-degenerate-rows.leaf.js +29 -0
  150. package/dist/utility/chart/protected-kscript-empty-output.util.d.ts +28 -0
  151. package/dist/utility/chart/protected-kscript-empty-output.util.js +84 -0
  152. package/dist/utility/chart/run-interval-unservable.leaf.d.ts +9 -0
  153. package/dist/utility/chart/run-interval-unservable.leaf.js +20 -0
  154. package/dist/utility/chart/run-interval-warmup.leaf.d.ts +19 -0
  155. package/dist/utility/chart/run-interval-warmup.leaf.js +35 -0
  156. package/dist/utility/chart/titan-constants.pin.d.ts +9 -5
  157. package/dist/utility/chart/titan-constants.pin.js +18 -5
  158. package/dist/utility/chart/warmup-backfill-retry.leaf.d.ts +9 -0
  159. package/dist/utility/chart/warmup-backfill-retry.leaf.js +9 -0
  160. package/dist/utility/chart/window-geometry.leaf.d.ts +119 -0
  161. package/dist/utility/chart/window-geometry.leaf.js +391 -0
  162. package/dist/utility/chart/window-owner.leaf.d.ts +19 -0
  163. package/dist/utility/chart/window-owner.leaf.js +24 -0
  164. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +11 -2
  165. package/dist/utility/chart/wrun-bar-session-facts.util.js +10 -3
  166. package/dist/utility/chart/wrun-run-result.util.d.ts +5 -1
  167. package/dist/utility/chart/wrun-run-result.util.js +20 -14
  168. package/dist/utility/common/data-processing.util.d.ts +138 -0
  169. package/dist/utility/common/data-processing.util.js +346 -0
  170. package/dist/utility/common/visible-timeout.util.d.ts +13 -4
  171. package/dist/utility/common/visible-timeout.util.js +23 -8
  172. package/dist/utility/exchange-format.leaf.d.ts +1 -0
  173. package/dist/utility/exchange-format.leaf.js +47 -0
  174. package/dist/utility/html-escape.leaf.d.ts +11 -0
  175. package/dist/utility/html-escape.leaf.js +20 -0
  176. package/dist/utility/market-events/earnings-scope.util.d.ts +60 -0
  177. package/dist/utility/market-events/earnings-scope.util.js +92 -0
  178. package/dist/utility/market-events/market-events.util.d.ts +147 -0
  179. package/dist/utility/market-events/market-events.util.js +392 -0
  180. package/dist/utility/market-events/zoned-clock.util.d.ts +1 -0
  181. package/dist/utility/market-events/zoned-clock.util.js +11 -0
  182. package/dist/utility/options/option-venue-disclosure.util.d.ts +43 -0
  183. package/dist/utility/options/option-venue-disclosure.util.js +56 -0
  184. package/dist/utility/scriptEditor/package-semver.util.d.ts +51 -0
  185. package/dist/utility/scriptEditor/package-semver.util.js +120 -0
  186. package/dist/utility/scriptEditor/temp-script-id.util.d.ts +18 -0
  187. package/dist/utility/scriptEditor/temp-script-id.util.js +25 -0
  188. package/dist/utility/symbol-selection/markets-request-from-symbols.leaf.d.ts +20 -0
  189. package/dist/utility/symbol-selection/markets-request-from-symbols.leaf.js +81 -0
  190. package/dist/utility/v2/governed-tier.leaf.d.ts +103 -0
  191. package/dist/utility/v2/governed-tier.leaf.js +113 -0
  192. package/dist/utility/watchlist/import/import-request.leaf.d.ts +10 -0
  193. package/dist/utility/watchlist/import/import-request.leaf.js +10 -0
  194. package/dist/utility/wrun/sources/lanes/option_daily.d.ts +43 -15
  195. package/dist/utility/wrun/sources/lanes/option_daily.js +78 -20
  196. package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +14 -10
  197. package/dist/utility/wrun/sources/lanes/option_stats_10m.js +5 -4
  198. package/dist/utility/wrun/sources/lanes/series.js +2 -2
  199. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +22 -3
  200. package/dist/utility/wrun/sources/opra-option-lanes.util.js +38 -7
  201. package/dist/utility/wrun/sources/registry.js +31 -1
  202. package/dist/utility/wrun/sources/row-lane-registry.js +5 -5
  203. package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +49 -0
  204. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +75 -20
  205. package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +49 -0
  206. package/dist/utility/wrun/sources/row-lanes/option_strikes.js +57 -47
  207. package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +36 -4
  208. package/dist/utility/wrun/sources/row-lanes/option_surface.js +6 -12
  209. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +37 -3
  210. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +128 -2
  211. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +233 -51
  212. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +0 -8
  213. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +26 -24
  214. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +85 -104
  215. package/dist/utility/wrun/wrun-alert-outputs.registry.d.ts +166 -0
  216. package/dist/utility/wrun/wrun-alert-outputs.registry.js +219 -0
  217. package/dist/utility/wrun/wrun-bar-count.util.d.ts +83 -0
  218. package/dist/utility/wrun/wrun-bar-count.util.js +259 -0
  219. package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +84 -0
  220. package/dist/utility/wrun/wrun-chart-context-names.util.js +186 -0
  221. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +253 -0
  222. package/dist/utility/wrun/wrun-chart-market-facts.util.js +731 -0
  223. package/dist/utility/wrun/wrun-cloud-opra-stamp.util.d.ts +28 -0
  224. package/dist/utility/wrun/wrun-cloud-opra-stamp.util.js +45 -0
  225. package/dist/utility/wrun/wrun-coin-lane-live.util.d.ts +18 -0
  226. package/dist/utility/wrun/wrun-coin-lane-live.util.js +47 -0
  227. package/dist/utility/wrun/wrun-deadline.util.js +2 -1
  228. package/dist/utility/wrun/wrun-debug-output.util.d.ts +39 -0
  229. package/dist/utility/wrun/wrun-debug-output.util.js +63 -0
  230. package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +113 -0
  231. package/dist/utility/wrun/wrun-declared-warmup.util.js +181 -0
  232. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +43 -0
  233. package/dist/utility/wrun/wrun-draft-legend-note.util.js +158 -0
  234. package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +181 -0
  235. package/dist/utility/wrun/wrun-draft-overlay.util.js +357 -0
  236. package/dist/utility/wrun/wrun-draw-skipped.leaf.d.ts +16 -0
  237. package/dist/utility/wrun/wrun-draw-skipped.leaf.js +16 -0
  238. package/dist/utility/wrun/wrun-earnings-facts.util.d.ts +42 -0
  239. package/dist/utility/wrun/wrun-earnings-facts.util.js +131 -0
  240. package/dist/utility/wrun/wrun-first-run-depth.util.d.ts +32 -0
  241. package/dist/utility/wrun/wrun-first-run-depth.util.js +118 -0
  242. package/dist/utility/wrun/wrun-gate-plane-readers.util.d.ts +24 -0
  243. package/dist/utility/wrun/wrun-gate-plane-readers.util.js +31 -0
  244. package/dist/utility/wrun/wrun-held-lanes.util.d.ts +32 -0
  245. package/dist/utility/wrun/wrun-held-lanes.util.js +94 -0
  246. package/dist/utility/wrun/wrun-host-visible-clock.util.d.ts +2 -0
  247. package/dist/utility/wrun/wrun-host-visible-clock.util.js +17 -0
  248. package/dist/utility/wrun/wrun-host.service.d.ts +266 -0
  249. package/dist/utility/wrun/wrun-host.service.js +655 -0
  250. package/dist/utility/wrun/wrun-inert-legend.util.d.ts +33 -0
  251. package/dist/utility/wrun/wrun-inert-legend.util.js +125 -0
  252. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +155 -0
  253. package/dist/utility/wrun/wrun-input-requirements.leaf.js +450 -0
  254. package/dist/utility/wrun/wrun-integration-route.util.d.ts +51 -0
  255. package/dist/utility/wrun/wrun-integration-route.util.js +59 -0
  256. package/dist/utility/wrun/wrun-latest-history.leaf.d.ts +8 -0
  257. package/dist/utility/wrun/wrun-latest-history.leaf.js +8 -0
  258. package/dist/utility/wrun/wrun-legend-hover.lazy.d.ts +12 -0
  259. package/dist/utility/wrun/wrun-legend-hover.lazy.js +96 -0
  260. package/dist/utility/wrun/wrun-lifecycle-runtime.util.d.ts +21 -0
  261. package/dist/utility/wrun/wrun-lifecycle-runtime.util.js +21 -0
  262. package/dist/utility/wrun/wrun-live-hidden-hold.util.d.ts +23 -0
  263. package/dist/utility/wrun/wrun-live-hidden-hold.util.js +13 -0
  264. package/dist/utility/wrun/wrun-live-intake.util.d.ts +374 -0
  265. package/dist/utility/wrun/wrun-live-intake.util.js +2027 -0
  266. package/dist/utility/wrun/wrun-live-patch.util.d.ts +116 -0
  267. package/dist/utility/wrun/wrun-live-patch.util.js +523 -0
  268. package/dist/utility/wrun/wrun-live-tick.util.d.ts +619 -0
  269. package/dist/utility/wrun/wrun-live-tick.util.js +4974 -0
  270. package/dist/utility/wrun/wrun-loading-owner.util.d.ts +58 -0
  271. package/dist/utility/wrun/wrun-loading-owner.util.js +89 -0
  272. package/dist/utility/wrun/wrun-official-scope.leaf.d.ts +29 -0
  273. package/dist/utility/wrun/wrun-official-scope.leaf.js +36 -0
  274. package/dist/utility/wrun/wrun-oi-lane.util.d.ts +27 -0
  275. package/dist/utility/wrun/wrun-oi-lane.util.js +42 -0
  276. package/dist/utility/wrun/wrun-opra-stats.leaf.d.ts +29 -10
  277. package/dist/utility/wrun/wrun-opra-stats.leaf.js +29 -10
  278. package/dist/utility/wrun/wrun-options-stop.util.d.ts +52 -0
  279. package/dist/utility/wrun/wrun-options-stop.util.js +123 -0
  280. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +719 -0
  281. package/dist/utility/wrun/wrun-overlay-drivers.util.js +1180 -0
  282. package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.d.ts +50 -0
  283. package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.js +131 -0
  284. package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +118 -0
  285. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +466 -0
  286. package/dist/utility/wrun/wrun-overlay-metadata.util.d.ts +45 -0
  287. package/dist/utility/wrun/wrun-overlay-metadata.util.js +112 -0
  288. package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +114 -0
  289. package/dist/utility/wrun/wrun-overlay-recovery.util.js +971 -0
  290. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +858 -0
  291. package/dist/utility/wrun/wrun-overlay-run.util.js +11013 -0
  292. package/dist/utility/wrun/wrun-panel-mount.lazy.d.ts +10 -0
  293. package/dist/utility/wrun/wrun-panel-mount.lazy.js +68 -0
  294. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +392 -0
  295. package/dist/utility/wrun/wrun-panel-mount.util.js +2346 -0
  296. package/dist/utility/wrun/wrun-param-map.util.d.ts +19 -4
  297. package/dist/utility/wrun/wrun-param-map.util.js +40 -47
  298. package/dist/utility/wrun/wrun-param-values.util.d.ts +9 -3
  299. package/dist/utility/wrun/wrun-param-values.util.js +5 -5
  300. package/dist/utility/wrun/wrun-pause-dim.util.d.ts +52 -0
  301. package/dist/utility/wrun/wrun-pause-dim.util.js +153 -0
  302. package/dist/utility/wrun/wrun-plot-gate.types.d.ts +23 -0
  303. package/dist/utility/wrun/wrun-plot-gate.types.js +7 -0
  304. package/dist/utility/wrun/wrun-prefix-cohort.util.d.ts +93 -0
  305. package/dist/utility/wrun/wrun-prefix-cohort.util.js +484 -0
  306. package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +114 -0
  307. package/dist/utility/wrun/wrun-prefix-lanes.util.js +486 -0
  308. package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +317 -0
  309. package/dist/utility/wrun/wrun-prefix-proof.util.js +630 -0
  310. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +73 -0
  311. package/dist/utility/wrun/wrun-refusal-surface.util.js +380 -0
  312. package/dist/utility/wrun/wrun-refusal-text.util.d.ts +15 -0
  313. package/dist/utility/wrun/wrun-refusal-text.util.js +40 -0
  314. package/dist/utility/wrun/wrun-replay-lane.util.d.ts +139 -0
  315. package/dist/utility/wrun/wrun-replay-lane.util.js +520 -0
  316. package/dist/utility/wrun/wrun-replay-rows.util.d.ts +21 -0
  317. package/dist/utility/wrun/wrun-replay-rows.util.js +172 -0
  318. package/dist/utility/wrun/wrun-row-source-factory.d.ts +53 -0
  319. package/dist/utility/wrun/wrun-row-source-factory.js +435 -0
  320. package/dist/utility/wrun/wrun-run-cells.util.d.ts +36 -0
  321. package/dist/utility/wrun/wrun-run-cells.util.js +46 -0
  322. package/dist/utility/wrun/wrun-run-interval-projection.types.d.ts +14 -0
  323. package/dist/utility/wrun/wrun-run-interval-projection.types.js +1 -0
  324. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +133 -0
  325. package/dist/utility/wrun/wrun-run-interval-session.util.js +121 -0
  326. package/dist/utility/wrun/wrun-run-interval.util.d.ts +98 -0
  327. package/dist/utility/wrun/wrun-run-interval.util.js +207 -0
  328. package/dist/utility/wrun/wrun-run-retained.util.d.ts +122 -0
  329. package/dist/utility/wrun/wrun-run-retained.util.js +255 -0
  330. package/dist/utility/wrun/wrun-sandbox-row-source.d.ts +184 -0
  331. package/dist/utility/wrun/wrun-sandbox-row-source.js +444 -0
  332. package/dist/utility/wrun/wrun-script-inputs.util.js +4 -4
  333. package/dist/utility/wrun/wrun-series-stream.util.d.ts +86 -0
  334. package/dist/utility/wrun/wrun-series-stream.util.js +537 -0
  335. package/dist/utility/wrun/wrun-sheet-remembered.util.d.ts +21 -0
  336. package/dist/utility/wrun/wrun-sheet-remembered.util.js +36 -0
  337. package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.d.ts +7 -0
  338. package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.js +12 -0
  339. package/dist/utility/wrun/wrun-socket-row-source.js +4 -2
  340. package/dist/utility/wrun/wrun-source-rows.util.d.ts +175 -3
  341. package/dist/utility/wrun/wrun-source-rows.util.js +294 -8
  342. package/dist/utility/wrun/wrun-stats-strip.util.d.ts +46 -0
  343. package/dist/utility/wrun/wrun-stats-strip.util.js +87 -0
  344. package/dist/utility/wrun/wrun-table-chrome.util.d.ts +163 -0
  345. package/dist/utility/wrun/wrun-table-chrome.util.js +557 -0
  346. package/dist/utility/wrun/wrun-text-params.util.d.ts +11 -6
  347. package/dist/utility/wrun/wrun-text-params.util.js +19 -30
  348. package/dist/utility/wrun/wrun-transient-rerun.util.d.ts +64 -0
  349. package/dist/utility/wrun/wrun-transient-rerun.util.js +317 -0
  350. package/dist/utility/wrun/wrun-twin-lookback.util.d.ts +10 -0
  351. package/dist/utility/wrun/wrun-twin-lookback.util.js +43 -0
  352. package/dist/utility/wrun/wrun-warmup-head-store.util.d.ts +41 -0
  353. package/dist/utility/wrun/wrun-warmup-head-store.util.js +120 -0
  354. package/dist/utility/wrun-alert-params.leaf.d.ts +24 -0
  355. package/dist/utility/wrun-alert-params.leaf.js +24 -0
  356. package/dist/utils/replay/replay-buffer-math.d.ts +148 -0
  357. package/dist/utils/replay/replay-buffer-math.js +684 -0
  358. package/dist/workers/wrun/wrun-abi-host.d.ts +190 -0
  359. package/dist/workers/wrun/wrun-abi-host.js +1201 -0
  360. package/dist/workers/wrun/wrun-engine-handler.d.ts +37 -0
  361. package/dist/workers/wrun/wrun-engine-handler.js +211 -0
  362. package/package.json +3 -3
@@ -0,0 +1,96 @@
1
+ /**
2
+ * The boot graph's side of the wrun hover surfaces (`wrun-legend-hover`: the legend entries and the
3
+ * series under the cursor, answering with the hover card): the chart's hover bridge attaches them
4
+ * through here for every pane (instances/titan-charts.ts), so the hover card builders and the
5
+ * run-result adapter behind them stay out of the pre-candle closure
6
+ * (docs/features/kscript/wrun/wrun-browser-runtime.md, "Boot doors").
7
+ *
8
+ * The door's contract:
9
+ * - The surfaces in hand: the attach goes straight to them in the bridge's turn and returns their
10
+ * own handle. The loaders bind them (`bindWrunLegendHover`, from their static import) as they
11
+ * evaluate, before any overlay of theirs mounts.
12
+ * - Not mine: the surfaces answer only for an overlay whose sheet is remembered
13
+ * (wrun-overlay-metadata.util, `wrunHoverOwner`), so before any sheet is remembered they have
14
+ * nothing to do: the attach registers the pane's chart (the alert arm and the visibility apply
15
+ * read it, wrun-visibility-chart.util) and hands back a handle that holds the pane, with no
16
+ * import. A flag-off session and every kScript chart stay here.
17
+ * - A sheet before the surfaces (a hosted Indicator's restore, `primeWrunLegendHover` from the
18
+ * metadata registry): the surfaces load once and attach on every pane still waiting; the handle
19
+ * the bridge holds forwards to them from then on. A load that fails leaves the handle inert.
20
+ * Ring `wrun-legend-hover-late`.
21
+ */
22
+ import { wrunChartHostEnv } from '../../host-env.js';
23
+ import { registerWrunVisibilityChart } from '../chart/wrun-visibility-chart.util.js';
24
+ let runtime;
25
+ let loading;
26
+ /** A sheet was remembered before the surfaces bound: a pane attached later loads them. */
27
+ let primed = false;
28
+ const waiting = new Set();
29
+ function attachWaiting(loaded) {
30
+ for (const pane of [...waiting]) {
31
+ waiting.delete(pane);
32
+ pane.surfaces = loaded.attachWrunHoverSurfaces(pane.chartIndex, pane.chart);
33
+ }
34
+ }
35
+ /** Hand the surfaces over: a loader calls this with its static import as it evaluates; every pane
36
+ * still waiting attaches now. */
37
+ export function bindWrunLegendHover(loaded) {
38
+ runtime = loaded;
39
+ attachWaiting(loaded);
40
+ }
41
+ /** Load the surfaces once for the panes waiting, through the host's loader (`ui.loadWrunLegendHover`);
42
+ * a failed chunk load resets the latch so a later sheet or pane retries. Never rejects. */
43
+ function loadWrunLegendHover() {
44
+ loading ??= wrunChartHostEnv()
45
+ .ui.loadWrunLegendHover()
46
+ .then((loaded) => {
47
+ if (!runtime)
48
+ bindWrunLegendHover(loaded);
49
+ }, (error) => {
50
+ loading = undefined;
51
+ console.warn('[wrun] hover surfaces unavailable:', error);
52
+ });
53
+ return loading;
54
+ }
55
+ /** A wrun sheet was remembered (wrun-overlay-metadata.util): the surfaces now have an overlay to
56
+ * answer for, so a pane waiting for them loads them. */
57
+ export function primeWrunLegendHover() {
58
+ if (runtime)
59
+ return;
60
+ primed = true;
61
+ // A load in flight serves every pane waiting; a load that failed (the latch reset) is asked again by
62
+ // the next remembered sheet, so a transient chunk failure costs the hover cards one sheet, not the session.
63
+ if (waiting.size === 0 || loading)
64
+ return;
65
+ if (wrunChartHostEnv().diagnostics.debugEnabled()) {
66
+ wrunChartHostEnv().diagnostics.debug('wrun-legend-hover-late', { panes: waiting.size });
67
+ }
68
+ void loadWrunLegendHover();
69
+ }
70
+ /** `attachWrunHoverSurfaces` (the hover surfaces): the same handle shape, the surfaces' own once
71
+ * they are here. */
72
+ export function attachWrunHoverSurfaces(chartIndex, chart) {
73
+ if (runtime)
74
+ return runtime.attachWrunHoverSurfaces(chartIndex, chart);
75
+ // The pane's chart registers now, as the surfaces' own attach registers it first.
76
+ registerWrunVisibilityChart(chartIndex, chart);
77
+ const pane = { chartIndex, chart, surfaces: undefined };
78
+ waiting.add(pane);
79
+ if (primed) {
80
+ if (wrunChartHostEnv().diagnostics.debugEnabled()) {
81
+ wrunChartHostEnv().diagnostics.debug('wrun-legend-hover-late', { chartIndex });
82
+ }
83
+ void loadWrunLegendHover();
84
+ }
85
+ return {
86
+ onHover: (event) => pane.surfaces?.onHover(event),
87
+ detach: () => {
88
+ waiting.delete(pane);
89
+ if (pane.surfaces)
90
+ pane.surfaces.detach();
91
+ else
92
+ registerWrunVisibilityChart(chartIndex, null);
93
+ pane.surfaces = undefined;
94
+ },
95
+ };
96
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The browser-run wrun overlay runtime that the chart's boot graph reaches only through
3
+ * `wrun-overlay-lifecycle.lazy.ts`: the lifecycle door (with the recovery ladders and the replay
4
+ * lane behind it) and the live tick lane, and through them the run pass. None of it can do
5
+ * anything for an overlay without a driver, and only the wrun loaders register drivers (behind the
6
+ * Indicators gate), so this graph stays out of the pre-candle closure and evaluates with the first
7
+ * loader instead.
8
+ *
9
+ * The loaders import this module statically and bind it (`bindWrunLifecycleRuntime`) before they
10
+ * register a driver. Two things follow, and both must hold before any driver exists:
11
+ * - the import-time registrations of these modules (the door's compute-succeeded and teardown
12
+ * hooks, the recovery ladders' hooks, the replay lane's teardown, the live tick's drain
13
+ * requester, teardown hook and rows identity reader) are in place, exactly as when they
14
+ * evaluated at boot;
15
+ * - the boot-side accessor answers synchronously for a driver id, so a trigger runs in the same
16
+ * turn as before.
17
+ *
18
+ * Re-exports only: the accessor reads each entry off this namespace at call time.
19
+ */
20
+ export { healWrunOverlayIfIdle, pauseWrunOverlay, requestWrunOverlayRerun, requestWrunOverlayRerunsForChart, resumeWrunOverlay, resyncWrunOverlayAfterWake, } from './wrun-overlay-lifecycle.util.js';
21
+ export { feedWrunRideBookRows, scheduleWrunOverlayLiveTick } from './wrun-live-tick.util.js';
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The browser-run wrun overlay runtime that the chart's boot graph reaches only through
3
+ * `wrun-overlay-lifecycle.lazy.ts`: the lifecycle door (with the recovery ladders and the replay
4
+ * lane behind it) and the live tick lane, and through them the run pass. None of it can do
5
+ * anything for an overlay without a driver, and only the wrun loaders register drivers (behind the
6
+ * Indicators gate), so this graph stays out of the pre-candle closure and evaluates with the first
7
+ * loader instead.
8
+ *
9
+ * The loaders import this module statically and bind it (`bindWrunLifecycleRuntime`) before they
10
+ * register a driver. Two things follow, and both must hold before any driver exists:
11
+ * - the import-time registrations of these modules (the door's compute-succeeded and teardown
12
+ * hooks, the recovery ladders' hooks, the replay lane's teardown, the live tick's drain
13
+ * requester, teardown hook and rows identity reader) are in place, exactly as when they
14
+ * evaluated at boot;
15
+ * - the boot-side accessor answers synchronously for a driver id, so a trigger runs in the same
16
+ * turn as before.
17
+ *
18
+ * Re-exports only: the accessor reads each entry off this namespace at call time.
19
+ */
20
+ export { healWrunOverlayIfIdle, pauseWrunOverlay, requestWrunOverlayRerun, requestWrunOverlayRerunsForChart, resumeWrunOverlay, resyncWrunOverlayAfterWake, } from './wrun-overlay-lifecycle.util.js';
21
+ export { feedWrunRideBookRows, scheduleWrunOverlayLiveTick } from './wrun-live-tick.util.js';
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Hidden hold counters of the wrun live tick (rest-cost H8), for the hidden live pace stats
3
+ * (`window.__kiyoLiveHiddenPaceStats()`, hidden-live-drain.util), beside the local kScript hold's
4
+ * (kscript-live-coalesce.util `getLocalKScriptHiddenHoldStats`). Dependency-free on purpose: the
5
+ * stats readout imports it, and the tick module's import graph is far too heavy for that.
6
+ *
7
+ * - `wrunHolds`: overlay holds taken, once per overlay per hide (the `wrun-live-hidden-hold` ring
8
+ * event): the page is hidden with the hidden live pace on, so the drain arms no timer and frames
9
+ * keep folding into the intake.
10
+ * - `wrunHiddenRuns`: drains a held overlay ran while hidden because one of its intake queues reached
11
+ * the backlog bound (`WRUN_LIVE_HIDDEN_BACKLOG_RUN_POINTS`), then held again. A healthy hide adds 0.
12
+ * - `wrunReturnDrains`: drains the return snap started for held overlays, one per held overlay per
13
+ * return (the `wrun-live-hidden-drain` ring event).
14
+ */
15
+ export interface WrunLiveHiddenHoldStats {
16
+ wrunHolds: number;
17
+ wrunHiddenRuns: number;
18
+ wrunReturnDrains: number;
19
+ }
20
+ export declare function noteWrunLiveHiddenHold(): void;
21
+ export declare function noteWrunLiveHiddenRun(): void;
22
+ export declare function noteWrunLiveHiddenReturnDrains(count: number): void;
23
+ export declare function getWrunLiveHiddenHoldStats(): WrunLiveHiddenHoldStats;
@@ -0,0 +1,13 @@
1
+ const wrunLiveHiddenHoldStats = { wrunHolds: 0, wrunHiddenRuns: 0, wrunReturnDrains: 0 };
2
+ export function noteWrunLiveHiddenHold() {
3
+ wrunLiveHiddenHoldStats.wrunHolds += 1;
4
+ }
5
+ export function noteWrunLiveHiddenRun() {
6
+ wrunLiveHiddenHoldStats.wrunHiddenRuns += 1;
7
+ }
8
+ export function noteWrunLiveHiddenReturnDrains(count) {
9
+ wrunLiveHiddenHoldStats.wrunReturnDrains += count;
10
+ }
11
+ export function getWrunLiveHiddenHoldStats() {
12
+ return { ...wrunLiveHiddenHoldStats };
13
+ }
@@ -0,0 +1,374 @@
1
+ import { type WrunOverlayLiveContext } from './wrun-overlay-drivers.util.js';
2
+ import { type WrunPinnedMarket } from './wrun-source-rows.util.js';
3
+ import type { WrunIndicatorMetadata, WrunLiveBlockStats } from '../../interfaces/wrun-runtime.interface.js';
4
+ import { type WrunLegStreamLane } from './wrun-leg-stream-classes.js';
5
+ import type { WrunPollLaneId } from './sources/wrun-poll-lane.types.js';
6
+ import type { WrunRowLaneId } from './sources/wrun-row-lane.types.js';
7
+ import { type WrunTradesLegLane } from './wrun-trades-lane.util.js';
8
+ /** The lanes the row builder serves through its own branches, each with a named buffer on the
9
+ * live context. */
10
+ export type WrunBuiltinLiveLane = 'book' | 'trades'
11
+ /** The buy/sell lane asked in dollars (a trades input's `currency: "USD"`,
12
+ * wrunSourceLane): the same TRADE_AGG frames as `trades`, folded as
13
+ * volume x close by its acquisition's quote. */
14
+ | 'trades_usd' | 'oi' | 'funding' | 'liquidations' | 'volume_profile' | 'trade_volume_by_size' | 'implied_volatility' | 'skew' | 'options_chain' | 'etf_flow'
15
+ /** The raw prints per bar (a `tape` input): the K_TRADES large lane's history, fed per print by
16
+ * the raw TRADE channel (the `trades` script source, K_TRADES). */
17
+ | 'tape';
18
+ /** A live lane: one of the row builder's own, a registry poll lane instance by its id
19
+ * (`poll:*`, `utility/wrun/sources/`; its buffer is `context.pollLaneRows[id]`), a row lane
20
+ * instance (`row:*`, `context.rowLaneRows[id]`), or a trades leg lane (`context.tradeLegRows[id]`,
21
+ * kit 0.77.0). */
22
+ export type WrunLiveLane = WrunBuiltinLiveLane | WrunPollLaneId | WrunRowLaneId | WrunTradesLegLane;
23
+ /** The fan-out's script source name of a frame -> the lane it feeds. The `trades` SOURCE (K_TRADES,
24
+ * the raw TRADE channel) feeds the `tape` lane; the `trades` LANE (the package's per-bar volume
25
+ * by side) is fed by the `buy_sell_volume` source (K_BUY_SELL_VOLUME, TRADE_AGG). */
26
+ export declare const WRUN_LIVE_LANE_OF_SCRIPT_SOURCE: Readonly<Record<string, WrunLiveLane | 'ohlcv'>>;
27
+ export declare const WRUN_PUSH_LANES: ReadonlySet<WrunLiveLane>;
28
+ /** Lanes with no push channel: the poll-due reconcile re-asks them (`trade_volume_by_size` is
29
+ * the chart market's USD size-bucketed flow, K_TRADE_VOLUME_BY_SIZE has no live channel and the
30
+ * legacy poll re-asks its tail too; `options_chain` is the chart market's chain snapshot,
31
+ * re-asked through K_OPTIONS_CHAIN with the identity the full run resolved; `etf_flow` is the
32
+ * daily ETF lane, wrun-etf-flow-lane.util: K_ETF_FLOW has no live feed and a day's value lands
33
+ * after the US session). The row builder's own poll lanes are named here; a registry poll lane
34
+ * instance (a `poll:*` id) is a poll lane by construction and is never listed. */
35
+ export declare const WRUN_POLL_LANES: ReadonlySet<WrunLiveLane>;
36
+ /** The payloadExtras the history fetch used for a lane (units, quote, ladder identity). */
37
+ export type WrunLaneAcquisition = Readonly<Record<string, unknown>>;
38
+ export interface WrunLiveFrame {
39
+ scriptSource: string;
40
+ data: unknown;
41
+ incomingExchange?: string;
42
+ incomingSymbol?: string;
43
+ /** The frame's coin (its series' underlying), when the fan-out names it: a row lane fed by coin admits by it
44
+ * (else the point's own `series.coin`). */
45
+ incomingCoin?: string;
46
+ /** Rider rows already floored by roundObTimestamp: never re-bucket. */
47
+ bucketed?: boolean;
48
+ }
49
+ export type WrunLiveIntakeVerdict = 'queued' | 'ignored:no-context' | 'ignored:foreign' | 'ignored:undeclared' | 'ignored:replaying' | 'ignored:ineligible' | 'ignored:generation'
50
+ /** A raw print below the tape acquisition's `minSize`: it can never fold (the kScript fan-out's
51
+ * floor), so it takes no queue slot and arms no drain. */
52
+ | 'ignored:below-floor'
53
+ /** The tick's own verdict: the overlay is paused or its execution guard tripped. */
54
+ | 'ignored:paused';
55
+ /** `pinned-close`: a pinned coarser leg's candle closed (armed by the tick
56
+ * at the leg's next close plus a grace, the backend member timer mirrored);
57
+ * the reconcile re-asks the legs, in leg bars. `tape-lost`: the additive
58
+ * queue cap dropped tape prints since the last drain; the reconcile re-asks
59
+ * their buckets from the large-print table (a routine re-ask, like poll-due). */
60
+ export type WrunLiveGapReason = 'session-start' | 'main-jump' | 'wake' | 'poll-due' | 'late-input' | 'pinned-close' | 'tape-lost';
61
+ export interface WrunLiveIntakeStats {
62
+ /** Frames each lane took, per lane. The tape lane counts every raw print that reached it, the
63
+ * ones its floors turned away (`ignored:below-floor`) included: the live leg's signal. */
64
+ frames: Partial<Record<WrunLiveLane | 'ohlcv', number>>;
65
+ /** Candle frames admitted for a foreign grid leg, per leg fetch key. */
66
+ legFrames?: Record<string, number>;
67
+ /** Points pending in the queues right now. */
68
+ queued: number;
69
+ /** Points the additive cap dropped (the oldest of a lane over 1024). */
70
+ dropped: number;
71
+ /** Points discarded because a full run replaced the context they were
72
+ * accepted under (`dropped:generation`). */
73
+ droppedGeneration: number;
74
+ drains: number;
75
+ computes: number;
76
+ /** The last 64 compute blocks' row counts (1 inside a bar, 2 at a roll, N after a gap). */
77
+ blockRows: number[];
78
+ repairs: Partial<Record<WrunLiveGapReason, number>>;
79
+ reseeds: number;
80
+ rebuilds: number;
81
+ restores: number;
82
+ snapshots: number;
83
+ lastEvalMs: number;
84
+ lastMainMs: number;
85
+ fetches: number;
86
+ reconcileWindows: Array<{
87
+ fromTs: number;
88
+ toTs: number;
89
+ lanes: WrunLiveLane[];
90
+ }>;
91
+ coveredThroughTs: Partial<Record<WrunLiveLane, number>>;
92
+ repaintOwed: boolean;
93
+ liveSuspended: boolean;
94
+ bypassTokensHeld: number;
95
+ /** Frames the intake refused, per verdict (the tick reports 'ignored:replaying'). */
96
+ ignored: Partial<Record<WrunLiveIntakeVerdict, number>>;
97
+ }
98
+ /** The tick lane's own accounting, recorded here so one probe reads it
99
+ * all: computes and their blocks (with the ABI host's live field, never
100
+ * inferred), reconciles (the fetch count and the window), reseeds,
101
+ * rebuilds, cache-bypass tokens, and the verdicts it decides itself. */
102
+ export type WrunLiveIntakeEvent = {
103
+ kind: 'compute';
104
+ blockRows: number;
105
+ live?: WrunLiveBlockStats;
106
+ mainMs?: number;
107
+ } | {
108
+ kind: 'reconcile';
109
+ reasons: readonly WrunLiveGapReason[];
110
+ fromTs: number;
111
+ toTs: number;
112
+ lanes: readonly WrunLiveLane[];
113
+ fetches: number;
114
+ } | {
115
+ kind: 'reseed';
116
+ }
117
+ /** A live-start block (the full run's install, a reseed): its first
118
+ * snapshot joins the counters without counting as a compute. */
119
+ | {
120
+ kind: 'session-start';
121
+ live?: WrunLiveBlockStats;
122
+ } | {
123
+ kind: 'rebuild';
124
+ } | {
125
+ kind: 'bypass-token';
126
+ delta: 1 | -1;
127
+ } | {
128
+ kind: 'ignored';
129
+ verdict: WrunLiveIntakeVerdict;
130
+ };
131
+ /** A raw book frame (the K_ORDERBOOK live payload), or a bucketed row. */
132
+ export type WrunLiveBookPoint = ArrayLike<number> | {
133
+ series?: {
134
+ isKScript?: boolean;
135
+ isReplay?: boolean;
136
+ };
137
+ blockBookSnapshot?: ArrayLike<number>;
138
+ float64Arrays?: ReadonlyArray<ArrayLike<number>>;
139
+ };
140
+ /** Per additive lane, cap 1024 queued points (the kScript coalescer's cap:
141
+ * about 50 s of the busiest tape); the OLDEST are dropped and counted. */
142
+ export declare const WRUN_LIVE_ADDITIVE_QUEUE_CAP = 1024;
143
+ /** The live tick's hidden hold (rest-cost H8) keeps the queues filling for as long as the page stays
144
+ * hidden: the drain arms no timer. So that the cap above never drops a held point, a held overlay
145
+ * whose longest capped queue reaches this many points runs ONE drain while hidden
146
+ * (`wrunLiveIntakeBacklogDue`), then holds again. Half the cap: the run leaves the other half as
147
+ * headroom for the frames that land while it is in flight (the local kScript hold's bound, same cap). */
148
+ export declare const WRUN_LIVE_HIDDEN_BACKLOG_RUN_POINTS: number;
149
+ /** The tick util registers its drain scheduler here at import time so a gap
150
+ * mark wakes the tick without a frame (the intake never imports the tick). */
151
+ export declare function setWrunLiveDrainRequester(fn: ((indicatorId: string) => void) | null): void;
152
+ /** A reseed reopens the SESSION over the retained buffers under a fresh
153
+ * generation: the points queued under the previous generation are still
154
+ * owed to those buffers, so the reseed adopts them instead of dropping
155
+ * them (the run util calls this right after it stores the generation). */
156
+ export declare function adoptWrunLiveIntakeGeneration(indicatorId: string, generation: number): void;
157
+ /** The market a lane's rows were fetched for: the chart's own for the lanes,
158
+ * the leg's for a grid leg's candles. */
159
+ /** The market a live stamp is bucketed for, and the host chart's session
160
+ * (`sessionType`): the session the market's history was fetched under
161
+ * (`kOhlcvSessionPayloadFields` reads the chart's for a stock leg), so the
162
+ * live bucket keys the same bars the history has. */
163
+ export type WrunLiveBucketMarket = {
164
+ exchange?: string;
165
+ symbol?: string;
166
+ sessionType?: string;
167
+ normalizedSymbol?: string;
168
+ };
169
+ /** The chart bucket a live stamp belongs to: every lane floors to the bar
170
+ * open (a week bucket is its Monday, the main path's `findMonday`; a month,
171
+ * quarter, half or year bucket its UTC calendar boundary), except
172
+ * the book, whose snapshots are stamped at the observation and an exact
173
+ * boundary belongs to the PREVIOUS bar (`roundObTimestamp`, the rule the
174
+ * K_ORDERBOOK lane and the rider projection apply), and a session-lattice
175
+ * lane on a `market`, which keys the bar its fetched rows have through the
176
+ * chart's one live boundary rule (`liveBucketStartMs`: the Chicago session
177
+ * lattice on a CME Group market, the 09:30 New York anchored bars and the
178
+ * three-trade-date 3d group on a regular-session US equities market under
179
+ * the host chart's `sessionType`, the UTC floor everywhere else). Null is a
180
+ * stamp with no bar on that calendar (a stock print outside the cash
181
+ * session on a regular-session chart): the caller drops it. Any other
182
+ * market passes no venue, so nothing else starts anchoring. */
183
+ export declare function wrunLiveBucketTs(lane: WrunLiveLane | 'ohlcv', tsMs: number, intervalMs: number, market?: WrunLiveBucketMarket | null): number | null;
184
+ export interface FoldResult {
185
+ rows: ArrayLike<number>[];
186
+ touched: number[];
187
+ earliestTouchedTs: number;
188
+ /** Tape only: the buckets whose fold hit the live print cap (their rows lost their oldest
189
+ * prints, and a block is never truncated, so the tick refuses them by name). */
190
+ capped?: number[];
191
+ }
192
+ /** K_FUNDING_RATE.mergeLiveDataPoint's value: the rate normalized to one
193
+ * hour (the series' funding interval, 8h by default) in percent, the same
194
+ * unit the history lane fetches (`fundingInterval: 1h`, `rateClose * 100`). */
195
+ export declare function wrunLiveFundingValue(point: unknown): {
196
+ tsMs: number;
197
+ value: number;
198
+ } | null;
199
+ /** K_OHLCV.mergeLiveDataPoint's reading of a candle frame: the TRADE_AGG
200
+ * aggregation, or a TICKER quote as a zero-volume print (forex and
201
+ * commodity venues), stamped by its wire timestamp. */
202
+ export declare function wrunLiveOhlcvPoint(point: unknown): {
203
+ tsMs: number;
204
+ data: Record<string, unknown>;
205
+ } | null;
206
+ /**
207
+ * The candle fold of a foreign grid leg: K_OHLCV.mergeLiveDataPoint per
208
+ * point (`mergeLiveOhlcvDataPoint`, run over the bucket's own row and its
209
+ * predecessor so the plausibility band reads the same reference price the
210
+ * control reads: the first frame of a bucket opens the row, later frames
211
+ * widen high/low, replace the close and ADD volume), bucketed by the chart
212
+ * rule on the leg's own `market` (a WEEK bucket on its Monday, a CME Group
213
+ * leg on the session lattice). Never mutates its inputs.
214
+ */
215
+ export declare function foldWrunLegCandleRows(base: ReadonlyArray<ArrayLike<number>>, points: readonly unknown[], intervalMs: number, market?: WrunLiveBucketMarket | null): FoldResult | null;
216
+ /** K_ORDERBOOK.buildLiveDataRows over a raw frame: replay bursts floor
217
+ * every row (copied), a live snapshot floors its one row (copied); a
218
+ * bucketed row (`ArrayLike<number>`) is taken as-is. Frames without a
219
+ * book payload yield nothing. */
220
+ export declare function wrunLiveBookRows(point: WrunLiveBookPoint, intervalMs: number): ArrayLike<number>[];
221
+ /**
222
+ * Fold queued points into a lane's rows under the lane's kScript fold rule.
223
+ * Returns the NEW rows array (untouched rows shared, touched rows new), the
224
+ * touched buckets and the earliest of them, or null when nothing folded.
225
+ * Never mutates `rows` or any point. `acquisition` is the SAME payload the
226
+ * history fetch used for the lane, so the fold's units equal the lane's;
227
+ * `market` is the market that fetch resolved to (the chart's own), so the
228
+ * fold keys the bars its rows have (wrunLiveBucketTs).
229
+ */
230
+ export declare function foldWrunLaneRows(lane: WrunLiveLane, rows: readonly ArrayLike<number>[] | undefined, points: readonly unknown[], intervalMs: number, acquisition: WrunLaneAcquisition, market?: WrunLiveBucketMarket | null): FoldResult | null;
231
+ /** Whether an overlay's longest capped queue (an additive lane, a leg's candle frames) reached the
232
+ * hidden hold's backlog bound: the live tick then runs one drain while hidden. */
233
+ export declare function wrunLiveIntakeBacklogDue(indicatorId: string): boolean;
234
+ /**
235
+ * Whether a frame of the given series identity has a taker on the overlay:
236
+ * the chart's own market (the fan-out's rule), the market of a declared
237
+ * grid leg (a pinned market's candle feed, subscribed for that leg) or a
238
+ * trades leg's. The
239
+ * live fan-out consults this before dropping a foreign-market frame; the
240
+ * intake still decides the verdict per frame. A frame without a full
241
+ * identity, or an overlay without a live context, answers true (the
242
+ * fan-out already admitted it, the intake judges it).
243
+ */
244
+ export declare function wrunLiveFrameMarketAdmitted(indicatorId: string, series: {
245
+ exchange?: unknown;
246
+ symbol?: unknown;
247
+ coin?: unknown;
248
+ } | undefined): boolean;
249
+ /**
250
+ * One pushed frame, O(1): after the fan-out's own gates (protected, replay,
251
+ * budget-hidden) the intake checks the context, its generation, the frame's
252
+ * market, the package's eligibility and the declared lanes, then queues the
253
+ * point by lane rule (additive lanes keep every point up to the cap; book
254
+ * and funding keep the newest per bar; a replay burst in its own slot). An
255
+ * `ohlcv` frame carries no lane data (the main rows live on the chart) but
256
+ * is 'queued' as the drain trigger it is, eligibility aside; for a session
257
+ * at another interval the chart market's frame also queues for its run bars.
258
+ */
259
+ export declare function enqueueWrunLiveFrame(a: {
260
+ chartIndex: number;
261
+ indicatorId: string;
262
+ generation: number;
263
+ frame: WrunLiveFrame;
264
+ }): WrunLiveIntakeVerdict;
265
+ /**
266
+ * Fold everything queued for the context's overlay into its lane buffers
267
+ * (NEW arrays, the context's lane fields replaced), mark the fed buckets,
268
+ * and report what moved. `dirtyFromTs` is the earliest touched bucket older
269
+ * than `context.lastRowTs` (a late point for a committed bar; also stamped
270
+ * on the context so the poll cadence reseeds), else null.
271
+ */
272
+ export declare function drainWrunLiveIntake(ctx: WrunOverlayLiveContext): {
273
+ touched: Partial<Record<WrunLiveLane, number[]>>;
274
+ points: Partial<Record<WrunLiveLane, number>>;
275
+ /** Per grid leg (fetch key), the buckets its candle frames touched. */
276
+ legs: Record<string, number[]>;
277
+ /** A session at another interval: the run-bar buckets the chart's candle frames touched. */
278
+ runRows?: number[];
279
+ dropped: number;
280
+ /** The tape buckets whose prints the queue cap dropped since the last drain (`tape-lost`). */
281
+ tapeLost?: number[];
282
+ dirtyFromTs: number | null;
283
+ };
284
+ /** Drop a grid leg's queued candle frames of the given buckets (a reconcile
285
+ * answer covers them: fetched rows win, a re-fold would add their volume
286
+ * twice). Returns the number of points dropped. */
287
+ export declare function dropWrunLiveQueuedLegBuckets(indicatorId: string, fetchKey: string, buckets: readonly number[]): number;
288
+ /** Drop the queued points of the given buckets (a reconcile answer covers
289
+ * them: fetched rows win). Returns the number of points dropped. Book and
290
+ * funding drop by bucket key; additive points are bucketed on the fly. */
291
+ export declare function dropWrunLiveQueuedBuckets(indicatorId: string, lane: WrunLiveLane, buckets: readonly number[]): number;
292
+ /**
293
+ * Authority of a reconcile answer over one bucket inside the answered
294
+ * window (plan section 8 fold 5): 'served' when the answer carries the
295
+ * bucket; 'absent' (authoritative absence, the fed row is dropped) only when
296
+ * the bucket is inside the window, the answer is non-empty and its last row
297
+ * is at or past the bucket; otherwise 'unserved' (the fed row is kept and
298
+ * the bucket stays outstanding).
299
+ */
300
+ export declare function wrunLaneAnswerCoversBucket(answerRows: readonly ArrayLike<number>[], windowFromTs: number, windowToTs: number, bucketTs: number): 'served' | 'absent' | 'unserved';
301
+ /** Record a reconcile reason for the overlay AND request a drain through
302
+ * the registered requester (without one, the mark is only recorded). A
303
+ * reason already pending is not recorded twice. An id without a live
304
+ * context has no session to reconcile: no record, no drain. */
305
+ export declare function markWrunLiveGap(indicatorId: string, reason: WrunLiveGapReason): void;
306
+ /** The pending reasons, in mark order, cleared on take. */
307
+ export declare function takeWrunLiveGaps(indicatorId: string): WrunLiveGapReason[];
308
+ /** Queues, gaps and stats of one overlay: registered on the drivers'
309
+ * teardown hook at import time. */
310
+ export declare function disposeWrunLiveIntake(indicatorId: string): void;
311
+ /**
312
+ * The tick lane's accounting into the overlay's stats: computes carry the
313
+ * ABI host's live field (restores and snapshots are read from it, never
314
+ * inferred), reconciles carry their fetch count and window, and the
315
+ * verdicts the tick decides itself ('ignored:replaying') land here too.
316
+ */
317
+ export declare function noteWrunLiveIntakeEvent(indicatorId: string, event: WrunLiveIntakeEvent): void;
318
+ /**
319
+ * Whether the push intake may feed this package on a chart of
320
+ * `chartInterval`. False when any input pins something the lane cannot
321
+ * ride: a market pin on anything but a secondary `ohlcv` or `trades` input, an interval
322
+ * pin on a celled input or on a class other than `ohlcv`, `funding` or
323
+ * `oi`, a finer interval, one that is not a whole multiple of the chart's,
324
+ * or a word outside the vocabulary. An `ohlcv` pin COARSER than the chart
325
+ * is eligible on the chart's own market or on a pinned one: the chart's own
326
+ * push lanes stay valid, the period leg is a poll lane (fetched at its own
327
+ * interval, never pushed) and a foreign market's grid leg is tick-merged
328
+ * from that market's candle feed; a `funding` or `oi` pin coarser than the
329
+ * chart buckets its own lane (funding pushed, oi polled); an `intrabar`
330
+ * input (finer candles as cells) is a fetch-only leg and never a push lane.
331
+ * An interval equal to the chart's is the chart's own grid on every class.
332
+ * An `odds` input (the odds lane) is a poll-only leg outside the push set:
333
+ * its market (POLYMARKET|<condition id>) or interval pin never makes the
334
+ * package ineligible, even on the primary input, so a package pairing an
335
+ * odds input with a pinned ohlcv leg keeps that leg's push feed.
336
+ * The full run refuses the ineligible pins by name before any fetch
337
+ * (`planWrunPinnedLegs`), so this only classifies.
338
+ */
339
+ export declare function wrunPushEligible(m: WrunIndicatorMetadata, chartInterval: string): boolean;
340
+ export declare function wrunLiveIntakeStats(indicatorId: string): WrunLiveIntakeStats;
341
+ /** Rig probe: a deep copy of the context's rows for one lane; null without
342
+ * a context, [] for a lane the context does not hold. */
343
+ export declare function wrunLiveLaneRows(indicatorId: string, lane: WrunLiveLane): unknown[][] | null;
344
+ export interface WrunLiveContextSnapshot {
345
+ generation: number;
346
+ intervalMs: number;
347
+ lastRowTs: number;
348
+ paintedThroughTs: number;
349
+ dirtyFromTs: number | null;
350
+ coveredThroughTs: Partial<Record<WrunLiveLane, number>>;
351
+ pushEligible: boolean;
352
+ liveSuspended: boolean;
353
+ repaintOwed: boolean;
354
+ laneRowCounts: Partial<Record<WrunLiveLane, number>>;
355
+ /** The pinned legs (present only when the package declares one): the
356
+ * leg's identity (its kind and market when pinned), its buffered candles
357
+ * and its coverage. */
358
+ pinnedLegs?: Array<{
359
+ fetchKey: string;
360
+ intervalKey: string;
361
+ legMs: number;
362
+ inputIndexes: number[];
363
+ kind?: 'grid' | 'intrabar';
364
+ market?: WrunPinnedMarket;
365
+ /** A lane stream's leg: its class and lane words (wrun-leg-stream-classes). */
366
+ stream?: WrunLegStreamLane;
367
+ rows: number;
368
+ coveredThroughTs: number;
369
+ }>;
370
+ }
371
+ /** Rig probe: a shallow snapshot of the context's watermarks and flags
372
+ * (copied scalars, never the context itself); null without a context. */
373
+ export declare function wrunLiveContextSnapshot(indicatorId: string): WrunLiveContextSnapshot | null;
374
+ export declare function __resetWrunLiveIntakeForTests(): void;