@orangecharts/wrun-chart-host 0.4.0 → 0.6.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 (331) hide show
  1. package/README.md +17 -5
  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/feature-flags.constants.js +7 -2
  5. package/dist/constants/kscript-data-interval-restrictions.constants.d.ts +15 -0
  6. package/dist/constants/kscript-data-interval-restrictions.constants.js +40 -0
  7. package/dist/constants/opra-compliance.constants.d.ts +19 -0
  8. package/dist/constants/opra-compliance.constants.js +19 -0
  9. package/dist/constants/replay-ladder.leaf.d.ts +30 -0
  10. package/dist/constants/replay-ladder.leaf.js +99 -0
  11. package/dist/constants/scriptEditor/cme-official-scripts.constants.d.ts +168 -0
  12. package/dist/constants/scriptEditor/cme-official-scripts.constants.js +398 -0
  13. package/dist/constants/scriptEditor/converted-script-id.leaf.d.ts +8 -0
  14. package/dist/constants/scriptEditor/converted-script-id.leaf.js +10 -0
  15. package/dist/constants/scriptEditor/execution.constants.d.ts +4 -0
  16. package/dist/constants/scriptEditor/execution.constants.js +14 -0
  17. package/dist/constants/wrun-prefix-safe.constants.d.ts +23 -0
  18. package/dist/constants/wrun-prefix-safe.constants.js +26 -0
  19. package/dist/host-env.d.ts +301 -22
  20. package/dist/host-env.js +15 -0
  21. package/dist/host-ports.types.d.ts +853 -29
  22. package/dist/index.d.ts +140 -2
  23. package/dist/index.js +140 -2
  24. package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +31 -0
  25. package/dist/instances/script-engine-worker-ohlcv-transfer.js +164 -0
  26. package/dist/interfaces/market-event.interface.d.ts +231 -0
  27. package/dist/interfaces/market-event.interface.js +15 -0
  28. package/dist/interfaces/opra-realtime.interface.d.ts +70 -134
  29. package/dist/interfaces/opra-realtime.interface.js +34 -59
  30. package/dist/interfaces/replay.interface.d.ts +285 -0
  31. package/dist/interfaces/replay.interface.js +1 -0
  32. package/dist/interfaces/wrun-runtime.interface.d.ts +88 -13
  33. package/dist/interfaces/wrun-runtime.interface.js +17 -3
  34. package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +1 -0
  35. package/dist/kscript-data/controls/live-ohlcv-merge.util.js +93 -0
  36. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +5 -1
  37. package/dist/kscript-data/controls/live-trades-merge.util.js +2 -2
  38. package/dist/market-data/billing.interface.d.ts +219 -0
  39. package/dist/market-data/billing.interface.js +58 -0
  40. package/dist/market-data/venue-governed.util.d.ts +2 -0
  41. package/dist/market-data/venue-governed.util.js +10 -0
  42. package/dist/market-data/venue.d.ts +122 -0
  43. package/dist/market-data/venue.js +1 -0
  44. package/dist/market-data/venues/index.d.ts +97 -0
  45. package/dist/market-data/venues/index.js +33 -0
  46. package/dist/market-data/venues/opra.contract.copy.json +35 -0
  47. package/dist/market-data/venues/opra.d.ts +70 -0
  48. package/dist/market-data/venues/opra.js +74 -0
  49. package/dist/replay/replayIndicatorRows.d.ts +31 -0
  50. package/dist/replay/replayIndicatorRows.js +117 -0
  51. package/dist/replay/replayLadder.d.ts +85 -0
  52. package/dist/replay/replayLadder.js +388 -0
  53. package/dist/utility/auth/server-clock.util.d.ts +81 -0
  54. package/dist/utility/auth/server-clock.util.js +238 -0
  55. package/dist/utility/chart/builtin-identity.util.d.ts +18 -0
  56. package/dist/utility/chart/builtin-identity.util.js +51 -0
  57. package/dist/utility/chart/cache-alignment.util.d.ts +454 -0
  58. package/dist/utility/chart/cache-alignment.util.js +926 -0
  59. package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +15 -0
  60. package/dist/utility/chart/chart-data-fetch-generation.util.js +22 -0
  61. package/dist/utility/chart/chart-mount-epoch.util.d.ts +17 -0
  62. package/dist/utility/chart/chart-mount-epoch.util.js +61 -0
  63. package/dist/utility/chart/chart-time-domain.util.d.ts +12 -0
  64. package/dist/utility/chart/chart-time-domain.util.js +23 -0
  65. package/dist/utility/chart/color-customization.leaf.d.ts +10 -0
  66. package/dist/utility/chart/color-customization.leaf.js +16 -0
  67. package/dist/utility/chart/footprint-tick-grid.util.d.ts +106 -0
  68. package/dist/utility/chart/footprint-tick-grid.util.js +167 -0
  69. package/dist/utility/chart/gesture-timing.leaf.d.ts +29 -0
  70. package/dist/utility/chart/gesture-timing.leaf.js +29 -0
  71. package/dist/utility/chart/governed-contract-coin.util.d.ts +22 -0
  72. package/dist/utility/chart/governed-contract-coin.util.js +39 -0
  73. package/dist/utility/chart/host-bar-placement.util.d.ts +107 -0
  74. package/dist/utility/chart/host-bar-placement.util.js +447 -0
  75. package/dist/utility/chart/index-host-tier.util.d.ts +31 -0
  76. package/dist/utility/chart/index-host-tier.util.js +118 -0
  77. package/dist/utility/chart/index-mode-admission.util.d.ts +34 -0
  78. package/dist/utility/chart/index-mode-admission.util.js +67 -0
  79. package/dist/utility/chart/indicator-error-message.util.d.ts +35 -0
  80. package/dist/utility/chart/indicator-error-message.util.js +44 -0
  81. package/dist/utility/chart/kscript-apply-fingerprint.util.d.ts +65 -0
  82. package/dist/utility/chart/kscript-apply-fingerprint.util.js +357 -0
  83. package/dist/utility/chart/kscript-chart-flush.leaf.d.ts +22 -0
  84. package/dist/utility/chart/kscript-chart-flush.leaf.js +13 -0
  85. package/dist/utility/chart/kscript-data-interval-restriction.leaf.d.ts +6 -0
  86. package/dist/utility/chart/kscript-data-interval-restriction.leaf.js +27 -0
  87. package/dist/utility/chart/kscript-integration-decision.leaf.d.ts +89 -0
  88. package/dist/utility/chart/kscript-integration-decision.leaf.js +80 -0
  89. package/dist/utility/chart/kscript-live-coalesce.util.d.ts +76 -0
  90. package/dist/utility/chart/kscript-live-coalesce.util.js +156 -0
  91. package/dist/utility/chart/kscript-live-rest-pace.util.d.ts +34 -0
  92. package/dist/utility/chart/kscript-live-rest-pace.util.js +134 -0
  93. package/dist/utility/chart/kscript-live-source-identity.util.d.ts +98 -0
  94. package/dist/utility/chart/kscript-live-source-identity.util.js +121 -0
  95. package/dist/utility/chart/kscript-mounted-plot-set.leaf.d.ts +48 -0
  96. package/dist/utility/chart/kscript-mounted-plot-set.leaf.js +145 -0
  97. package/dist/utility/chart/kscript-perf-tracker.util.d.ts +243 -0
  98. package/dist/utility/chart/kscript-perf-tracker.util.js +522 -0
  99. package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +43 -0
  100. package/dist/utility/chart/kscript-run-interval-projection.util.js +471 -0
  101. package/dist/utility/chart/kscript-run-result-equality.util.d.ts +38 -0
  102. package/dist/utility/chart/kscript-run-result-equality.util.js +89 -0
  103. package/dist/utility/chart/kscript-settings-revision.leaf.d.ts +2 -0
  104. package/dist/utility/chart/kscript-settings-revision.leaf.js +12 -0
  105. package/dist/utility/chart/kscript-source-degrade.leaf.d.ts +63 -0
  106. package/dist/utility/chart/kscript-source-degrade.leaf.js +68 -0
  107. package/dist/utility/chart/kscript-source-retention.util.d.ts +134 -0
  108. package/dist/utility/chart/kscript-source-retention.util.js +218 -0
  109. package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +57 -0
  110. package/dist/utility/chart/kscript-standin-identity.leaf.js +61 -0
  111. package/dist/utility/chart/kscript-titancharts-preparation.util.d.ts +15 -0
  112. package/dist/utility/chart/kscript-titancharts-preparation.util.js +376 -0
  113. package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +9 -0
  114. package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +130 -0
  115. package/dist/utility/chart/kscript-venue-policy.util.d.ts +217 -0
  116. package/dist/utility/chart/kscript-venue-policy.util.js +324 -0
  117. package/dist/utility/chart/live-cadence.util.d.ts +38 -0
  118. package/dist/utility/chart/live-cadence.util.js +37 -0
  119. package/dist/utility/chart/live-feed-series-match.leaf.d.ts +13 -0
  120. package/dist/utility/chart/live-feed-series-match.leaf.js +21 -0
  121. package/dist/utility/chart/local-engine-self-heal-backoff.util.d.ts +46 -0
  122. package/dist/utility/chart/local-engine-self-heal-backoff.util.js +46 -0
  123. package/dist/utility/chart/local-engine-uninit.leaf.d.ts +21 -0
  124. package/dist/utility/chart/local-engine-uninit.leaf.js +22 -0
  125. package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +62 -0
  126. package/dist/utility/chart/local-kscript-source-revalidation.util.js +123 -0
  127. package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +214 -0
  128. package/dist/utility/chart/local-kscript-warmup-depth.util.js +376 -0
  129. package/dist/utility/chart/local-technical-script-live-apply-coalescer.util.d.ts +85 -0
  130. package/dist/utility/chart/local-technical-script-live-apply-coalescer.util.js +197 -0
  131. package/dist/utility/chart/local-technical-script-range.leaf.d.ts +72 -0
  132. package/dist/utility/chart/local-technical-script-range.leaf.js +126 -0
  133. package/dist/utility/chart/mixed-mode.util.d.ts +167 -0
  134. package/dist/utility/chart/mixed-mode.util.js +139 -0
  135. package/dist/utility/chart/ohlcv-row-readiness.util.d.ts +36 -0
  136. package/dist/utility/chart/ohlcv-row-readiness.util.js +90 -0
  137. package/dist/utility/chart/opra-user-scripts-gate.util.d.ts +19 -0
  138. package/dist/utility/chart/opra-user-scripts-gate.util.js +32 -0
  139. package/dist/utility/chart/overlay-execution-guard-key.leaf.d.ts +8 -0
  140. package/dist/utility/chart/overlay-execution-guard-key.leaf.js +10 -0
  141. package/dist/utility/chart/price-precision.util.d.ts +40 -0
  142. package/dist/utility/chart/price-precision.util.js +70 -0
  143. package/dist/utility/chart/profile-block-size.util.d.ts +64 -0
  144. package/dist/utility/chart/profile-block-size.util.js +141 -0
  145. package/dist/utility/chart/protected-kscript-degenerate-rows.leaf.d.ts +11 -0
  146. package/dist/utility/chart/protected-kscript-degenerate-rows.leaf.js +29 -0
  147. package/dist/utility/chart/protected-kscript-empty-output.util.d.ts +28 -0
  148. package/dist/utility/chart/protected-kscript-empty-output.util.js +84 -0
  149. package/dist/utility/chart/run-interval-unservable.leaf.d.ts +9 -0
  150. package/dist/utility/chart/run-interval-unservable.leaf.js +20 -0
  151. package/dist/utility/chart/run-interval-warmup.leaf.d.ts +19 -0
  152. package/dist/utility/chart/run-interval-warmup.leaf.js +35 -0
  153. package/dist/utility/chart/titan-constants.pin.d.ts +9 -5
  154. package/dist/utility/chart/titan-constants.pin.js +18 -5
  155. package/dist/utility/chart/warmup-backfill-retry.leaf.d.ts +9 -0
  156. package/dist/utility/chart/warmup-backfill-retry.leaf.js +9 -0
  157. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +11 -2
  158. package/dist/utility/chart/wrun-bar-session-facts.util.js +10 -3
  159. package/dist/utility/chart/wrun-run-result.util.d.ts +5 -1
  160. package/dist/utility/chart/wrun-run-result.util.js +20 -14
  161. package/dist/utility/common/data-processing.util.d.ts +138 -0
  162. package/dist/utility/common/data-processing.util.js +346 -0
  163. package/dist/utility/common/visible-timeout.util.d.ts +13 -4
  164. package/dist/utility/common/visible-timeout.util.js +23 -8
  165. package/dist/utility/exchange-format.leaf.d.ts +1 -0
  166. package/dist/utility/exchange-format.leaf.js +47 -0
  167. package/dist/utility/market-events/earnings-scope.util.d.ts +60 -0
  168. package/dist/utility/market-events/earnings-scope.util.js +92 -0
  169. package/dist/utility/market-events/market-events.util.d.ts +147 -0
  170. package/dist/utility/market-events/market-events.util.js +392 -0
  171. package/dist/utility/market-events/zoned-clock.util.d.ts +1 -0
  172. package/dist/utility/market-events/zoned-clock.util.js +11 -0
  173. package/dist/utility/options/option-venue-disclosure.util.d.ts +43 -0
  174. package/dist/utility/options/option-venue-disclosure.util.js +56 -0
  175. package/dist/utility/scriptEditor/package-semver.util.d.ts +51 -0
  176. package/dist/utility/scriptEditor/package-semver.util.js +120 -0
  177. package/dist/utility/scriptEditor/temp-script-id.util.d.ts +18 -0
  178. package/dist/utility/scriptEditor/temp-script-id.util.js +25 -0
  179. package/dist/utility/symbol-selection/markets-request-from-symbols.leaf.d.ts +20 -0
  180. package/dist/utility/symbol-selection/markets-request-from-symbols.leaf.js +81 -0
  181. package/dist/utility/v2/governed-tier.leaf.d.ts +103 -0
  182. package/dist/utility/v2/governed-tier.leaf.js +113 -0
  183. package/dist/utility/watchlist/import/import-request.leaf.d.ts +10 -0
  184. package/dist/utility/watchlist/import/import-request.leaf.js +10 -0
  185. package/dist/utility/wrun/sources/lanes/series.js +2 -2
  186. package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +4 -4
  187. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +5 -6
  188. package/dist/utility/wrun/wrun-alert-outputs.registry.d.ts +166 -0
  189. package/dist/utility/wrun/wrun-alert-outputs.registry.js +219 -0
  190. package/dist/utility/wrun/wrun-bar-count.util.d.ts +94 -0
  191. package/dist/utility/wrun/wrun-bar-count.util.js +274 -0
  192. package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +84 -0
  193. package/dist/utility/wrun/wrun-chart-context-names.util.js +186 -0
  194. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +253 -0
  195. package/dist/utility/wrun/wrun-chart-market-facts.util.js +731 -0
  196. package/dist/utility/wrun/wrun-cloud-opra-stamp.util.d.ts +28 -0
  197. package/dist/utility/wrun/wrun-cloud-opra-stamp.util.js +45 -0
  198. package/dist/utility/wrun/wrun-coin-lane-live.util.d.ts +18 -0
  199. package/dist/utility/wrun/wrun-coin-lane-live.util.js +47 -0
  200. package/dist/utility/wrun/wrun-deadline.util.js +2 -1
  201. package/dist/utility/wrun/wrun-debug-output.util.d.ts +39 -0
  202. package/dist/utility/wrun/wrun-debug-output.util.js +63 -0
  203. package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +113 -0
  204. package/dist/utility/wrun/wrun-declared-warmup.util.js +181 -0
  205. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +43 -0
  206. package/dist/utility/wrun/wrun-draft-legend-note.util.js +158 -0
  207. package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +181 -0
  208. package/dist/utility/wrun/wrun-draft-overlay.util.js +357 -0
  209. package/dist/utility/wrun/wrun-draw-skipped.leaf.d.ts +16 -0
  210. package/dist/utility/wrun/wrun-draw-skipped.leaf.js +16 -0
  211. package/dist/utility/wrun/wrun-earnings-facts.util.d.ts +42 -0
  212. package/dist/utility/wrun/wrun-earnings-facts.util.js +131 -0
  213. package/dist/utility/wrun/wrun-first-run-depth.util.d.ts +32 -0
  214. package/dist/utility/wrun/wrun-first-run-depth.util.js +118 -0
  215. package/dist/utility/wrun/wrun-gate-plane-readers.util.d.ts +24 -0
  216. package/dist/utility/wrun/wrun-gate-plane-readers.util.js +31 -0
  217. package/dist/utility/wrun/wrun-held-lanes.util.d.ts +32 -0
  218. package/dist/utility/wrun/wrun-held-lanes.util.js +94 -0
  219. package/dist/utility/wrun/wrun-host-visible-clock.util.d.ts +2 -0
  220. package/dist/utility/wrun/wrun-host-visible-clock.util.js +17 -0
  221. package/dist/utility/wrun/wrun-host.service.d.ts +330 -0
  222. package/dist/utility/wrun/wrun-host.service.js +855 -0
  223. package/dist/utility/wrun/wrun-hover.util.d.ts +3 -0
  224. package/dist/utility/wrun/wrun-hover.util.js +25 -4
  225. package/dist/utility/wrun/wrun-inert-legend.util.d.ts +33 -0
  226. package/dist/utility/wrun/wrun-inert-legend.util.js +125 -0
  227. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +155 -0
  228. package/dist/utility/wrun/wrun-input-requirements.leaf.js +450 -0
  229. package/dist/utility/wrun/wrun-integration-route.util.d.ts +51 -0
  230. package/dist/utility/wrun/wrun-integration-route.util.js +59 -0
  231. package/dist/utility/wrun/wrun-latest-history.leaf.d.ts +8 -0
  232. package/dist/utility/wrun/wrun-latest-history.leaf.js +8 -0
  233. package/dist/utility/wrun/wrun-legend-hover.lazy.d.ts +12 -0
  234. package/dist/utility/wrun/wrun-legend-hover.lazy.js +96 -0
  235. package/dist/utility/wrun/wrun-lifecycle-runtime.util.d.ts +21 -0
  236. package/dist/utility/wrun/wrun-lifecycle-runtime.util.js +21 -0
  237. package/dist/utility/wrun/wrun-live-hidden-hold.util.d.ts +23 -0
  238. package/dist/utility/wrun/wrun-live-hidden-hold.util.js +13 -0
  239. package/dist/utility/wrun/wrun-live-intake.util.d.ts +374 -0
  240. package/dist/utility/wrun/wrun-live-intake.util.js +2027 -0
  241. package/dist/utility/wrun/wrun-live-patch.util.d.ts +116 -0
  242. package/dist/utility/wrun/wrun-live-patch.util.js +523 -0
  243. package/dist/utility/wrun/wrun-live-tick.util.d.ts +619 -0
  244. package/dist/utility/wrun/wrun-live-tick.util.js +4974 -0
  245. package/dist/utility/wrun/wrun-loading-owner.util.d.ts +58 -0
  246. package/dist/utility/wrun/wrun-loading-owner.util.js +89 -0
  247. package/dist/utility/wrun/wrun-official-scope.leaf.d.ts +29 -0
  248. package/dist/utility/wrun/wrun-official-scope.leaf.js +36 -0
  249. package/dist/utility/wrun/wrun-oi-lane.util.d.ts +27 -0
  250. package/dist/utility/wrun/wrun-oi-lane.util.js +42 -0
  251. package/dist/utility/wrun/wrun-options-stop.util.d.ts +52 -0
  252. package/dist/utility/wrun/wrun-options-stop.util.js +123 -0
  253. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +719 -0
  254. package/dist/utility/wrun/wrun-overlay-drivers.util.js +1180 -0
  255. package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.d.ts +50 -0
  256. package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.js +131 -0
  257. package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +118 -0
  258. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +466 -0
  259. package/dist/utility/wrun/wrun-overlay-metadata.util.d.ts +45 -0
  260. package/dist/utility/wrun/wrun-overlay-metadata.util.js +112 -0
  261. package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +114 -0
  262. package/dist/utility/wrun/wrun-overlay-recovery.util.js +971 -0
  263. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +858 -0
  264. package/dist/utility/wrun/wrun-overlay-run.util.js +11013 -0
  265. package/dist/utility/wrun/wrun-pack.util.d.ts +2 -1
  266. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +24 -9
  267. package/dist/utility/wrun/wrun-panel-mount.util.js +138 -43
  268. package/dist/utility/wrun/wrun-param-map.util.d.ts +19 -4
  269. package/dist/utility/wrun/wrun-param-map.util.js +40 -47
  270. package/dist/utility/wrun/wrun-param-values.util.d.ts +9 -3
  271. package/dist/utility/wrun/wrun-param-values.util.js +5 -5
  272. package/dist/utility/wrun/wrun-prefix-cohort.util.d.ts +93 -0
  273. package/dist/utility/wrun/wrun-prefix-cohort.util.js +484 -0
  274. package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +114 -0
  275. package/dist/utility/wrun/wrun-prefix-lanes.util.js +486 -0
  276. package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +317 -0
  277. package/dist/utility/wrun/wrun-prefix-proof.util.js +630 -0
  278. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +73 -0
  279. package/dist/utility/wrun/wrun-refusal-surface.util.js +380 -0
  280. package/dist/utility/wrun/wrun-refusal-text.util.d.ts +15 -0
  281. package/dist/utility/wrun/wrun-refusal-text.util.js +40 -0
  282. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +5 -3
  283. package/dist/utility/wrun/wrun-replay-lane.util.d.ts +139 -0
  284. package/dist/utility/wrun/wrun-replay-lane.util.js +520 -0
  285. package/dist/utility/wrun/wrun-replay-rows.util.d.ts +21 -0
  286. package/dist/utility/wrun/wrun-replay-rows.util.js +172 -0
  287. package/dist/utility/wrun/wrun-row-source-factory.d.ts +53 -0
  288. package/dist/utility/wrun/wrun-row-source-factory.js +435 -0
  289. package/dist/utility/wrun/wrun-run-cells.util.d.ts +36 -0
  290. package/dist/utility/wrun/wrun-run-cells.util.js +46 -0
  291. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +133 -0
  292. package/dist/utility/wrun/wrun-run-interval-session.util.js +121 -0
  293. package/dist/utility/wrun/wrun-run-interval.util.d.ts +98 -0
  294. package/dist/utility/wrun/wrun-run-interval.util.js +207 -0
  295. package/dist/utility/wrun/wrun-run-retained.util.d.ts +122 -0
  296. package/dist/utility/wrun/wrun-run-retained.util.js +255 -0
  297. package/dist/utility/wrun/wrun-sandbox-row-source.d.ts +184 -0
  298. package/dist/utility/wrun/wrun-sandbox-row-source.js +444 -0
  299. package/dist/utility/wrun/wrun-script-inputs.util.js +4 -4
  300. package/dist/utility/wrun/wrun-series-stream.util.d.ts +86 -0
  301. package/dist/utility/wrun/wrun-series-stream.util.js +537 -0
  302. package/dist/utility/wrun/wrun-sha256.leaf.d.ts +13 -0
  303. package/dist/utility/wrun/wrun-sha256.leaf.js +84 -0
  304. package/dist/utility/wrun/wrun-sheet-remembered.util.d.ts +21 -0
  305. package/dist/utility/wrun/wrun-sheet-remembered.util.js +36 -0
  306. package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.d.ts +7 -0
  307. package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.js +12 -0
  308. package/dist/utility/wrun/wrun-socket-row-source.js +4 -2
  309. package/dist/utility/wrun/wrun-source-rows.util.d.ts +175 -3
  310. package/dist/utility/wrun/wrun-source-rows.util.js +294 -8
  311. package/dist/utility/wrun/wrun-stats-strip.util.d.ts +46 -0
  312. package/dist/utility/wrun/wrun-stats-strip.util.js +87 -0
  313. package/dist/utility/wrun/wrun-table-chrome.util.d.ts +163 -0
  314. package/dist/utility/wrun/wrun-table-chrome.util.js +557 -0
  315. package/dist/utility/wrun/wrun-text-params.util.d.ts +11 -6
  316. package/dist/utility/wrun/wrun-text-params.util.js +19 -30
  317. package/dist/utility/wrun/wrun-transient-rerun.util.d.ts +64 -0
  318. package/dist/utility/wrun/wrun-transient-rerun.util.js +317 -0
  319. package/dist/utility/wrun/wrun-twin-lookback.util.d.ts +10 -0
  320. package/dist/utility/wrun/wrun-twin-lookback.util.js +43 -0
  321. package/dist/utility/wrun/wrun-warmup-head-store.util.d.ts +41 -0
  322. package/dist/utility/wrun/wrun-warmup-head-store.util.js +120 -0
  323. package/dist/utility/wrun-alert-params.leaf.d.ts +24 -0
  324. package/dist/utility/wrun-alert-params.leaf.js +24 -0
  325. package/dist/utils/replay/replay-buffer-math.d.ts +148 -0
  326. package/dist/utils/replay/replay-buffer-math.js +684 -0
  327. package/dist/workers/wrun/wrun-abi-host.d.ts +203 -0
  328. package/dist/workers/wrun/wrun-abi-host.js +1220 -0
  329. package/dist/workers/wrun/wrun-engine-handler.d.ts +20 -0
  330. package/dist/workers/wrun/wrun-engine-handler.js +380 -0
  331. package/package.json +3 -3
@@ -0,0 +1,619 @@
1
+ /**
2
+ * WRUN live forming-bar lane (push intake): keeps a mounted browser-WRUN
3
+ * overlay's forming bar current WITHOUT remounting, WITHOUT recomputing
4
+ * history per tick and WITHOUT a fetch per frame.
5
+ *
6
+ * Intake: the live fan-out (`scheduleTechnicalScriptLiveUpdates` in
7
+ * services/live-feed.service.ts) hands every frame a mounted overlay's
8
+ * declared push lanes match to `scheduleWrunOverlayLiveTick`, which enqueues
9
+ * it O(1) under the context's generation (wrun-live-intake.util owns the
10
+ * queues and the per-lane folds) and arms ONE drain per overlay. The drain
11
+ * delay is the longest of: the wrun cadence (the interval-scaled minimum,
12
+ * 200 ms base, 1 s when a book input is declared, x chartInterval/60 capped
13
+ * at 1 s, under the adaptive/at-rest/hidden tiering and the persistent
14
+ * at-rest pacing floor), the kScript 1 s per-script refresh gate and the
15
+ * 250 ms per-script coalescing window (kscript-live-refresh-pace.util); a
16
+ * book frame cuts the window short, a pan gesture holds the run, and
17
+ * foregrounding snaps a pending drain. A gap mark (`markWrunLiveGap`) arms
18
+ * the same drain with no frame, through the requester registered at import,
19
+ * and so does a prefix run's outcome (`rearmWrunLiveTickDrain`, contract C7):
20
+ * the drain a run in flight turned away left its frames queued.
21
+ *
22
+ * Drain (`runWrunOverlayLiveTick`): fold the queue into the context's lane
23
+ * buffers, compare the last closed candles with the chart, decide ONE plan
24
+ * (`decideWrunLiveTickPlan`, pure): compute, reconcile, reseed or rebuild.
25
+ * - compute: the tail input rows from the session watermark (1 row inside a
26
+ * bar, 2 at a roll, N for a catch-up) go to the worker session as ONE
27
+ * `runLiveRows` block under the overlay's session lock; the outputs merge
28
+ * by timestamp into the stored full-range rows; the run result is built
29
+ * over the FULL window (displacement and box coordinates derive from the
30
+ * supplied rows), compared with the result last applied, and only the rows
31
+ * it changed are patched (the tail patch), the whole result's live row
32
+ * patch and the full adapter integrate as the fallbacks; one paint.
33
+ * - reconcile, the ONLY fetch path: on session-start, main-jump, wake and
34
+ * poll-due every declared lane is re-asked in parallel over
35
+ * [min(lastRowTs - 8 bars, oldest outstanding fed bucket), lastMainTs +
36
+ * interval) through the explicit-range kScript fetch (never `isPolling`,
37
+ * which turns `to` into a period and ignores `from`), as a FRESH
38
+ * acquisition (the revalidation bypass token is held for its duration). A
39
+ * DAILY lane (the ETF lane, a registry lane with a daily join) opens its
40
+ * ask before that window: at the window's day, the lane's lookback earlier
41
+ * (a day row is stamped at its midnight and often published days later),
42
+ * never before the session's own full run opened. A ROUTINE poll (poll-due
43
+ * alone) re-asks the ETF lane only when its coverage is behind (no
44
+ * answered window, or its last answer WRUN_ETF_FLOW_RECHECK_MS old), and a
45
+ * registry poll lane naming its own poll period (a relay feed,
46
+ * `WrunPollLane.pollIntervalMs`) on the same terms at that period; such a
47
+ * lane with its own fetch is asked through it. A lane whose own live channel
48
+ * carries it (`WrunPollLane.live`: a relay feed's stream, wrun-series-stream
49
+ * .util) is not re-asked by a routine poll while the channel is up: the
50
+ * channel's rows wake the drain (the requester this lane registers there),
51
+ * which folds them beside the push intake's and computes without a fetch; a
52
+ * reopen of the channel marks `wake`, which re-asks it.
53
+ * Fetched rows win for the buckets they cover; an unanswered bucket inside
54
+ * the window is dropped only on authoritative absence, else it stays
55
+ * outstanding; a lane that failed keeps its obligation; a changed closed
56
+ * bar reseeds; then compute. A pinned PERIOD leg (`context.pinnedLegs`,
57
+ * the G4 multi-timeframe contract) is a poll lane re-asked by every
58
+ * reconcile in LEG bars, [lastRowTs - 8 legs, now + leg), at its own
59
+ * interval on the leg's market, except that a routine poll skips a leg
60
+ * whose coverage already reaches its last closed candle (no live-candle
61
+ * reading, no odds leg); `pinned-close`, armed by this lane at the
62
+ * leg's next close plus a grace (the backend member's timer mirrored),
63
+ * re-asks the period legs alone. A GRID leg (a foreign market at the
64
+ * chart's interval, `kind: 'grid'`) rides every lane reconcile over the
65
+ * chart-bar window at the chart's interval, its forming candle kept, and
66
+ * is tick-merged from that market's candle feed between reconciles (the
67
+ * intake's fold). An INTRABAR leg (`kind: 'intrabar'`, the chart market's
68
+ * finer candles as cells) is fetch-only: `pinned-close` fires at every
69
+ * finer close (freshness = the finer span plus the grace) and re-asks it
70
+ * over at least one chart bar of finer bars (`[lastRowTs - P, lastMainTs
71
+ * + P)`), every lane reconcile over the chart-bar window; the answer's
72
+ * forming finer bar is dropped, fetched bars win, and the forming row's
73
+ * block grows by one tuple per finer close (the re-sent forming row). A
74
+ * changed candle a committed row admitted reseeds. An ODDS leg
75
+ * (`leg.odds`, the odds lane: POLYMARKET|<condition id>, grid or period)
76
+ * is poll-only: no candle feed, no push-frame admission (the intake), so
77
+ * these reconciles are its whole live path; it is re-asked with the full
78
+ * run's odds fetch options (`wrunLegPayloadExtras`: the prediction flag)
79
+ * and its answer is cut (`cutWrunOddsLegRows`, gapfill mints bars past the
80
+ * chart) before the buffer merge: a period leg's at the chart's last row, a
81
+ * grid leg's at the forming bar's close.
82
+ * - reseed (no fetch, `reseedWrunOverlayFromBuffers` in
83
+ * wrun-overlay-run.util): a late point or a revised closed candle marks
84
+ * `dirtyFromTs`, and the next poll-due drain (or an explicit late-input
85
+ * gap) reopens the session over the buffers, at most once per poll
86
+ * interval; a live-order refusal or a lost session reseeds too. A reopen
87
+ * the worker fails hands ONE full run off and suspends the context (no
88
+ * drains) until a run installs a fresh one: a failure that repeats (a cap
89
+ * the session crossed live) never loops reseed and rerun on every drain.
90
+ * The held session's frames and gap marks feed the heal ladder instead,
91
+ * which retries a retryable failure on its dwell and backoff.
92
+ * - rebuild (`rerunWrunOverlayForChartWave`, reason 'live-rebuild'): identity
93
+ * or history moved (for a clamped session only a head rolled past its
94
+ * first row), a gap wider than 250 bars, a row-lane or poll-lane
95
+ * acquisition the lane would plan otherwise now (its `acquisitionMoved`: a
96
+ * CME surface or a CME chain's statistics read off a continuous alias whose
97
+ * lead rolled; the full run re-plans it and the fresh session holds none of
98
+ * its old rows). A pan-back page left to its wave
99
+ * (contract C1: a verified backward extension under an owner pending or
100
+ * landed over it, or on a prefix-capable session within the grace its wave
101
+ * has to stamp one) moves no history: the wave lands the page's rows into
102
+ * the session, and the tick keeps the forming bar live meanwhile, holding
103
+ * its reseeds while the prefix is pending or while a reopen would lack the
104
+ * page's source rows. A poisoned worker hands the
105
+ * overlay to the casualty seam instead (`requestWrunCasualtyRebuilds`),
106
+ * which reopens every casualty under one window; a quarantined package is
107
+ * held like a pause (the session suspended quietly, the driver kept for
108
+ * the heal ladder or a user Retry or settings save).
109
+ *
110
+ * Gates on the apply: a paused overlay or a tripped execution guard computes
111
+ * nothing ('ignored:paused'); the merged result passes the kScript preflight
112
+ * budget or the session is suspended; the apply is measured for the guard
113
+ * (`withWrunOverlayExecutionMeasure`); a clamped session merges its rows
114
+ * into the mounted ones instead of replacing them.
115
+ *
116
+ * Watermarks: `lastRowTs`, `outputRows` and the carry seed advance the
117
+ * moment the worker answers (the session moved); `paintedThroughTs` only on
118
+ * a successful integrate, so a failed integrate at a roll never re-sends the
119
+ * closed bar (the order-error wedge) and the next successful patch covers
120
+ * everything since. Before the send AND before the apply the drain rechecks
121
+ * generation, chart identity, replay, protection and the pane budget; a
122
+ * failed recheck discards the block silently.
123
+ *
124
+ * Handles (wrun-3), strategies (wrun-3) and frames (wrun-4) ride the block
125
+ * as before: the answer carries the ledger's full live set, the whole
126
+ * StrategyOutput and the run-level snapshots, which replace what the
127
+ * previous rows carried. A strategy result is published to the store after
128
+ * the render.
129
+ *
130
+ * A session at another interval than the chart (a built-in twin's Timeframe,
131
+ * wrun-run-interval-session.util) computes on its run bars instead of the
132
+ * chart's candles: the intake folds the chart market's candle frames into the
133
+ * forming run bar, the plan runs on the chart's clock (the history check on
134
+ * the chart's first bar), every lane reconcile also re-asks the newest run
135
+ * bars at the run interval, and every apply hands the adapter's run-interval
136
+ * projection the session's stamp, the result carrying the run timeline. With
137
+ * wait for close on it computes the closed run bars only: a drain inside the
138
+ * forming bucket re-applies the held result, the roll computes the bar that
139
+ * closed.
140
+ *
141
+ * Refusals (WRUN-REFUSALS): a drain failure the refusal record classifies (a
142
+ * chain or block over its `max_cells`, a raiser's seed) projects a note for
143
+ * the `tick` owner through the common surface: no toast, the last good result
144
+ * kept; the next healthy tick retracts it (a full run or reseed success
145
+ * retracts every owner). Generic failures stay quiet, retried by the next
146
+ * drain. A warned session re-reads its health on every tick, for every
147
+ * overlay: a draft's whole verdict, a viewer's nothing-ready row, cleared
148
+ * the moment the session draws.
149
+ *
150
+ * The integrate half (`integrateWrunLiveTail`: the build memo or the shown
151
+ * result reused, the tail patch, the measure around the apply, the children,
152
+ * the presentation) is shared: a socket row source's live frames
153
+ * (`integrateWrunOverlayLiveFrame`, WRUN-PARITY-PLAN C7 and row 18) enter it
154
+ * with the rows the cloud computed instead of a worker block. They ride the
155
+ * same scheduler: the frame listener only folds the frame onto the ones the
156
+ * session has not integrated yet and arms the overlay's ONE drain
157
+ * (`queueWrunSourceLiveFrame`), whose cadence stack (the interval-scaled
158
+ * minimum, the rest floor, the per-script gate and its perf-shed gap, the pan
159
+ * hold, the hidden tier) is the browser twin's; the drain integrates every
160
+ * frame folded since the last one as one tail.
161
+ */
162
+ import { type WrunPollLaneId } from './sources/wrun-poll-lane.types.js';
163
+ import { type WrunOverlayLiveContext } from './wrun-overlay-drivers.util.js';
164
+ import { type WrunCellRows } from './wrun-canvases.util.js';
165
+ import { type WrunRunIntervalSession } from './wrun-run-interval-session.util.js';
166
+ import { type WrunRefusal, type WrunRefusalContext } from './wrun-refusal.util.js';
167
+ import { type WrunPinnedMarket } from './wrun-source-rows.util.js';
168
+ import { type WrunLiveFrame, type WrunLiveGapReason, type WrunLiveLane } from './wrun-live-intake.util.js';
169
+ import type { WrunIndicatorMetadata } from '../../interfaces/wrun-runtime.interface.js';
170
+ import type { RuntimeDiagnostic } from '../../interfaces/kscript-diagnostics.interface.js';
171
+ import type { WrunRowFrame } from './wrun-row-source.js';
172
+ import type { WrunLegStreamLane } from './wrun-leg-stream-classes.js';
173
+ /** The reconcile window reaches this many bars behind the session watermark
174
+ * (the kScript poll's 8-bar tail, V2_TECHNICAL_SOURCE_REFRESH_TAIL_BARS),
175
+ * and a late point older than this many bars reseeds on its own gap. */
176
+ export declare const WRUN_LIVE_RECONCILE_TAIL_BARS = 8;
177
+ /** A live block never spans more bars than this: a wider gap rebuilds
178
+ * through the full run (the wake heal's own rule for local kScripts). */
179
+ export declare const WRUN_LIVE_REBUILD_GAP_BARS = 250;
180
+ /** Rule 7's budget: at most one late-input reseed per poll interval per
181
+ * overlay (the poll cadence's lower bound). */
182
+ export declare const WRUN_LIVE_RESEED_MIN_GAP_MS = 25000;
183
+ /** The `pinned-close` grace: a pinned leg is re-asked this long after its
184
+ * candle closes (the backend live member's own timer, mirrored), so the
185
+ * gateway has sealed the candle by the time the ask lands. */
186
+ export declare const WRUN_LIVE_PINNED_CLOSE_GRACE_MS = 500;
187
+ /** How long a prefix-capable session leaves a pan-back page no prefix owner
188
+ * covers yet to its wave (C1, `wrunPrefixPageLeftToWave`), from the page's
189
+ * first sight; with still no owner after it, the tick rebuilds the history. */
190
+ export declare const WRUN_PREFIX_OWNER_GRACE_MS = 10000;
191
+ /** How long a routine poll leaves an answered ETF lane alone (TEMPLATE-QA E33): a day's flow is
192
+ * published once, hours after its day ends, and revised now and then, so a slow re-check still
193
+ * lands it, where re-asking every fund on every poll (twice a minute on a 1m chart) fetched the
194
+ * same days again and again. */
195
+ export declare const WRUN_ETF_FLOW_RECHECK_MS: number;
196
+ /** The tick lane's own counters for an overlay (the intake's stats read them
197
+ * beside its queue counters; `restores`, `snapshots` and `lastEvalMs` come
198
+ * from the `live` accounting the host hangs on every answered block, never
199
+ * inferred). */
200
+ export interface WrunLiveTickStats {
201
+ computes: number;
202
+ /** Rows per block, newest last (the last 64). */
203
+ blockRows: number[];
204
+ repairs: Partial<Record<WrunLiveGapReason, number>>;
205
+ reseeds: number;
206
+ rebuilds: number;
207
+ /** Every kScript source fetch the tick issued (reconciles only). */
208
+ fetches: number;
209
+ /** Main-thread time of the last drain in ms (worker and wire waits excluded). */
210
+ lastMainMs: number;
211
+ restores: number;
212
+ snapshots: number;
213
+ lastEvalMs: number;
214
+ /** The last 8 reconcile windows, newest last. */
215
+ reconcileWindows: Array<{
216
+ fromTs: number;
217
+ toTs: number;
218
+ lanes: WrunLiveLane[];
219
+ }>;
220
+ /** Revalidation bypass tokens held right now (0 between reconciles). */
221
+ bypassTokensHeld: number;
222
+ }
223
+ /** A snapshot of the tick counters for an overlay (zeros before its first drain). */
224
+ export declare function wrunLiveTickStats(indicatorId: string): WrunLiveTickStats;
225
+ /**
226
+ * The live tick's idle reader for the dev rig hook `window.__kiyoRig.wrunLiveIdle`
227
+ * (docs/features/diagnostics/debugging-diagnostics.md "Rig hooks"), or undefined outside dev builds. The host's
228
+ * `diagnostics.devBuild` gates it when the hook asks (web: Vite's dev flag), so this module reads no env at import
229
+ * (P2 contract R3) and a production build never hands it out.
230
+ */
231
+ export declare function wrunLiveTickIdleReader(): ((indicatorId: string) => boolean) | undefined;
232
+ /**
233
+ * The live-feed rider lane's intake for a riding book source: `rows` are
234
+ * the script-shaped rows projected from the heatmap stream, already labelled
235
+ * with their chart bucket (the caller floors them like the engine lane's
236
+ * rows). They enter the intake as ONE `bucketed: true` book frame under the
237
+ * context's generation (never re-bucketed, never re-sorted here): the next
238
+ * drain folds them into `context.bookRows` and marks their buckets fed, and a
239
+ * reconcile keeps a fed bucket until an answer covers it. False when the
240
+ * overlay holds no live context on this chart or the intake refused the
241
+ * frame (replay, another generation, an undeclared lane).
242
+ */
243
+ export declare function feedWrunRideBookRows(args: {
244
+ chartIndex: number;
245
+ indicatorId: string;
246
+ rows: ReadonlyArray<ArrayLike<number>>;
247
+ }): boolean;
248
+ /** The book buckets currently fed by the push intake and not yet covered by
249
+ * a reconcile answer (`context.fedBuckets.book`; diagnostics and the specs). */
250
+ export declare function wrunLiveFedBookTimestamps(indicatorId: string): ReadonlySet<number> | undefined;
251
+ /** The declared source classes that are the row builder's own live lanes
252
+ * (every one is fetchable through the kScript source lanes), in the full
253
+ * run's lane order. */
254
+ export declare function wrunLiveLanesOf(metadata: WrunIndicatorMetadata): WrunLiveLane[];
255
+ /** Every lane a session's reconcile re-asks: the row builder's own lanes
256
+ * the sheet declares, then the trades leg lanes the full run asked (kit 0.77.0:
257
+ * the ones the session holds a buffer for, `context.tradeLegRows`; a leg never
258
+ * asked is never re-asked), then the registry poll lane instances the full run
259
+ * planned (`context.pollLanes`), then its row lane instances
260
+ * (`context.rowLanes`), in the full run's order. */
261
+ export declare function wrunLiveLanesOfContext(context: WrunOverlayLiveContext): WrunLiveLane[];
262
+ /**
263
+ * What the pass that installed a source-fed session hands its drain (WRUN-PARITY-PLAN C7, plan row 20): the verdict
264
+ * of the batch the session starts from, as the pass published it (the families the source left out, its own
265
+ * diagnostics), and the pass's own seams for the verdicts the session's frames carry, so a frame does to the legend
266
+ * and to the sheet the session builds with what a batch does.
267
+ */
268
+ export interface WrunSourceFedSession {
269
+ /** The families the batch's source left out: the sheet the session builds with is cut for them. */
270
+ refusals: WrunRowFrame['refusals'];
271
+ /** The source's own diagnostics the batch answered (absent: it answered no list). */
272
+ diagnostics?: RuntimeDiagnostic[];
273
+ /** The calculation the session's rows and live frames belong to (its source's session generation: a create or a
274
+ * settings change opens another, a page keeps it). Absent for a source that names none. */
275
+ generation?: string;
276
+ /** The sheet the session builds with under a refusal set: every family it refuses taken out, as `settings`
277
+ * paint it. */
278
+ sheetFor(refusals: WrunRowFrame['refusals'], settings: unknown): WrunIndicatorMetadata;
279
+ /** The pass's writer of a source verdict on the overlay's mounted record: the left-out family rows when
280
+ * `refusals` is given, the source's own rows when `diagnostics` is; a part not given keeps its rows. */
281
+ publish(meta: object, verdict: Partial<Pick<WrunRowFrame, 'refusals' | 'diagnostics'>>): Promise<void>;
282
+ }
283
+ /** The run pass installed `context` for a session its row source feeds (above), with the verdict its batch carried
284
+ * and the pass's seams for the verdicts its frames carry (`session`; without one a frame publishes none). */
285
+ export declare function markWrunSourceFedLiveContext(context: WrunOverlayLiveContext, session?: WrunSourceFedSession): void;
286
+ /** Whether a row source feeds `context` from elsewhere (its drain integrates the source's frames only). */
287
+ export declare function isWrunSourceFedLiveContext(context: WrunOverlayLiveContext | undefined): boolean;
288
+ /**
289
+ * A source-fed session's live frame (WRUN-PARITY-PLAN C7, plan row 18), the listener the pass takes the
290
+ * session with: the source merged the frame into its store, and here it only joins the frames the session
291
+ * has not integrated yet (folded into one tail) and marks the overlay live-due, arming its ONE drain on
292
+ * the browser twin's cadence stack (`armWrunLiveDrain`: the interval-scaled minimum capped at 1 s, the
293
+ * rest floor, the per-script gate with the perf-shed ladder's gap, the pan hold, the hidden tier). The
294
+ * drain (`runWrunOverlayLiveTick`) integrates everything folded since the last one as one tail, so a busy
295
+ * Protected package costs the main thread what its Public twin's ticks cost. A frame for a session the
296
+ * overlay no longer runs, or a replay lane's (its steps ask its source), is dropped, and so is one that moves
297
+ * nothing: no bar, snapshot or strategy, and the verdict the session reaches anyway (a diagnostics list or a
298
+ * refusal set that moved still arms the drain, which publishes it, `landWrunSourceFrameVerdict`).
299
+ */
300
+ export declare function queueWrunSourceLiveFrame(context: WrunOverlayLiveContext, frame: WrunRowFrame, cellRowsOf: (ohlcvRows: ReadonlyArray<ArrayLike<number>>) => WrunCellRows): void;
301
+ /**
302
+ * The frames queued for `replaced`, a session the pass replaced with `context` over the same row source, go to
303
+ * `context` when both stand for the same calculation (`WrunSourceFedSession.generation`: a page of the held source):
304
+ * the run held the overlay, so the drain stood aside and never integrated them, though the source merged them into
305
+ * the session `context` starts from. Its drain paints them and lands their verdict. A queue of another calculation
306
+ * (a settings save opened a new one: its frames carry the earlier settings' bars, handles and strategy) is dropped;
307
+ * the snapshot the install queues from the painted edge covers what the new calculation merged meanwhile.
308
+ */
309
+ export declare function adoptWrunSourceLiveFrames(replaced: WrunOverlayLiveContext | undefined, context: WrunOverlayLiveContext): void;
310
+ /**
311
+ * Fan-out entry: enqueue the frame under the context's generation and arm
312
+ * the overlay's ONE drain timer. `matchedSources` are the fan-out's script
313
+ * source names for the arriving frame; without a `frame` (the rider lane's
314
+ * follow-up call, legacy callers) the drain arms when the frame carries the
315
+ * primary grid ('ohlcv') or any source class the overlay declares. With a
316
+ * frame it arms when the intake queued it, or always for a candle frame (the
317
+ * forming bar's ohlcv inputs moved even when no lane point queued). A book
318
+ * frame cuts the coalescing window short.
319
+ */
320
+ export declare function scheduleWrunOverlayLiveTick(chartIndex: number, indicatorId: string, matchedSources: readonly string[], frame?: WrunLiveFrame): void;
321
+ /** A bare drain request (a gap mark, the poll owner): arms the same timer
322
+ * with no frame. Registered with the intake at import so `markWrunLiveGap`
323
+ * wakes the tick without a frame. */
324
+ export declare function requestWrunOverlayLiveDrain(indicatorId: string): void;
325
+ /**
326
+ * Contract C7: re-arm the overlay's deferred drain on a prefix run's outcome
327
+ * (landed, rejected, or skipped after planning). A frame that arrived while
328
+ * the prefix ran woke a drain the in-flight gate turned away
329
+ * (`runWrunOverlayLiveTick` returns before its planner while any executor run
330
+ * is active), and the scheduler then dropped its record with nothing pending,
331
+ * so the frame would sit in the intake until another frame or a poll woke the
332
+ * lane. This is the wake the full installation's `session-start` mark
333
+ * performs (the drain requester), without the reconcile: a prefix keeps the
334
+ * session, so the points it held still belong to it. An outcome is noted
335
+ * while the executor still marks a run in flight (inside the prefix's run
336
+ * pass, or as its plan drops at a merge or a replan), so a drain this wakes
337
+ * can still meet the run in flight: it drains again on the cadence
338
+ * (`drainWrunLiveTick`) until it gets past the gate.
339
+ */
340
+ export declare function rearmWrunLiveTickDrain(chartIndex: number, indicatorId: string): void;
341
+ /** The next moment any pinned leg of the context closes (the earliest over
342
+ * the legs), null without legs: `floor(now / L) * L + L` for a fixed span,
343
+ * and for a WEEK leg the Monday-anchored week (`findMonday`, the main
344
+ * path's and the intake's week bucket), never the epoch week (a Thursday);
345
+ * a leg on the CME session lattice closes where its venue's bar holding
346
+ * now does (`wrunLegBarCloseAt`: a 3d group at the next group's open), a
347
+ * leg on a US listing with the session (the daily at 16:00 New York), read
348
+ * once its venue's rows hold the whole candle (`wrunLegCloseSettleMs`: a
349
+ * stock's minutes after its close). */
350
+ export declare function wrunNextPinnedCloseTs(context: WrunOverlayLiveContext, nowMs: number): number | null;
351
+ /**
352
+ * One drain: fold the queue, take the gap marks, compare the closed candles,
353
+ * decide the plan and run it (compute, reconcile then compute, reseed, or a
354
+ * rebuild handoff). Never throws; a failure keeps the last rendered result.
355
+ * Exported for the specs (the scheduler above is its only production
356
+ * caller); at most one body runs per overlay at a time.
357
+ */
358
+ export declare function runWrunOverlayLiveTick(indicatorId: string): Promise<void>;
359
+ /**
360
+ * One step of a replay lane's session (wrun-replay-lane.util): the drain's
361
+ * compute (`computeWrunOverlayTail`: the tail from the session's newest bar,
362
+ * the session lock, the live ladder's apply, the children, the presentation)
363
+ * over `ohlcvRows`, the replay's completed bars through the lane's cutoff (or
364
+ * the run bars as of it). 'advanced' when the session reached their newest
365
+ * bar, 'reseed' when the package reads the bar count (every bar runs again
366
+ * when one appears), 'skipped' when the tail could not run (the lane reopens
367
+ * the session then). Never throws.
368
+ */
369
+ export declare function advanceWrunReplaySession(indicatorId: string, ohlcvRows: ReadonlyArray<ArrayLike<number>>): Promise<'advanced' | 'reseed' | 'skipped'>;
370
+ /** What a socket row source's live frame did (`integrateWrunOverlayLiveFrame`). */
371
+ export type WrunLiveFrameOutcome = 'applied' | 'skipped' | 'failed';
372
+ /**
373
+ * A socket row source's live frames (WRUN-PARITY-PLAN C7, plan row 18), the drain's integrate of every
374
+ * frame folded since the last one (`queueWrunSourceLiveFrame`): the bars the cloud moved enter the live
375
+ * tick's integrate half (`integrateWrunLiveTail`: the build memo, the tail patch, the measure around the
376
+ * apply, the children, the presentation), exactly as a browser block's rows do, so a busy Protected
377
+ * package's frame costs no more than its Public twin's block. The cloud computed the rows: no fold, no
378
+ * plan, no worker. The frame merges into the overlay's live session by the tick's own tail rule
379
+ * (`mergeWrunOutputTail`: the stored rows from the frame's first bar are replaced), its handles re-based
380
+ * from the frame's rows onto the merged ones (a frame without handles keeps the session's), its frames
381
+ * snapshot attached when it carries one (the frame-backed children then take it), its strategy output
382
+ * the session's from here (a frame without one keeps the session's, which the tick publishes to the
383
+ * Strategy Tester's store path as the browser lane's block does); `cellRowsOf` hands the cell rows the
384
+ * source's store holds (the canvases' rows). Under the overlay's session lock, after the tick's own gates
385
+ * (the generation, replay, pause, the market, the pane budget). A replay lane's session takes the
386
+ * batches its steps ask for (wrun-replay-lane.util), cut to the playhead after the apply; a step hands its cutoff
387
+ * (`cutoffTs`), and the chart's candles the canvases build with keep to it, the browser lane's step slice, so the
388
+ * forming bar and a bar the replay revealed while the page was out never reach them. The frame's verdict
389
+ * lands first, as the pass lands a batch's (`landWrunSourceFrameVerdict`: its diagnostics and the families it
390
+ * leaves out, through the pass's own writer); a frame that moved only its verdict publishes it and paints nothing
391
+ * ('skipped'), unless the families it refuses moved (the sheet the session builds with is cut again and repainted).
392
+ * Never throws: 'failed' keeps the last picture and owes a repaint, like a failed tick.
393
+ */
394
+ export declare function integrateWrunOverlayLiveFrame(indicatorId: string, frame: WrunRowFrame, cellRowsOf: (ohlcvRows: ReadonlyArray<ArrayLike<number>>) => WrunCellRows, cutoffTs?: number): Promise<WrunLiveFrameOutcome>;
395
+ /** A tape bar the live session cannot evaluate whole (WRUN-BIG-TRADES-PLAN C3): a bucket the live
396
+ * fold capped at `LIVE_MAX_CELLS_PER_BAR` prints, or a forming block over its input's max_cells.
397
+ * Typed so the drain suspends the session on it instead of refusing the same bar on every frame:
398
+ * a tape bar only grows until it closes, and a block is never truncated. */
399
+ export declare class WrunTapeLiveRefusal extends Error {
400
+ constructor(message: string);
401
+ }
402
+ /**
403
+ * The note a tick's failure leaves, or null when the record does not classify
404
+ * it (a generic failure, or a class the full run owns: no bars, a deadline).
405
+ * A tick drew before, so its record is a note wherever the C2 table leaves the
406
+ * severity to the raiser (too-big: paused for a run, a note for a tick); the
407
+ * raiser's technical text stays its details.
408
+ */
409
+ export declare function wrunLiveTickRefusalOf(error: unknown, ctx: WrunRefusalContext): WrunRefusal | null;
410
+ /**
411
+ * Whether a routine poll re-asks the ETF lane (TEMPLATE-QA E33): only when its daily coverage is
412
+ * behind. It is behind when the lane holds no answered window (a run that degraded it, a failed
413
+ * ask: the obligation stays, every poll keeps asking) or when this session's last answer is
414
+ * WRUN_ETF_FLOW_RECHECK_MS old or older (unknown counts as old), both ends on performance.now().
415
+ * The non-routine reasons (session-start, main-jump, wake) re-ask it whatever this says; the lane's
416
+ * acquisition record is untouched (the full run and the reconcile read it as before).
417
+ */
418
+ export declare function wrunEtfFlowRecheckDue(context: WrunOverlayLiveContext, answeredAtMs: number | undefined, paceNowMs: number): boolean;
419
+ /**
420
+ * Whether a routine poll re-asks a registry poll lane instance: the ETF lane's rule
421
+ * (`wrunEtfFlowRecheckDue`) for a lane naming its own poll period (`WrunPollLane.pollIntervalMs`,
422
+ * a relay feed's `max(10 s, cadence / 2)`). Always for an instance the session does not hold,
423
+ * while the instance's coverage is behind (no answered window: a failed or missing answer keeps
424
+ * asking) and while it owes a read its live channel cannot stand for (a span the stream skipped, a
425
+ * join that may have missed readings: wrun-series-stream.util `wrunPollLaneLiveOwed`, which rolled
426
+ * its coverage back to the span); never while the lane's own live channel carries the instance
427
+ * (`WrunPollLane.live`, a relay feed's stream up: its rows reach the buffer without a fetch,
428
+ * `wrunPollLaneLiveUp`); always for a lane naming no period (the chart's poll cycle is its pace);
429
+ * for one naming a period, once this session's last answer is that period old or older (unknown
430
+ * counts as old; both ends on performance.now()). The non-routine reasons (session-start,
431
+ * main-jump, wake: a reopen of the channel marks one) re-ask it whatever this says.
432
+ */
433
+ export declare function wrunPollLaneRecheckDue(context: WrunOverlayLiveContext, laneId: WrunPollLaneId, answeredAtMs: number | undefined, paceNowMs: number): boolean;
434
+ /** One pinned leg's reconcile ask: its identity and its own window. A
435
+ * period leg's is in LEG bars ([lastRowTs - 8 legs, now + leg), reaching
436
+ * back to a failed ask's coverage), never the chart-bar window; a grid
437
+ * leg's is the lanes' chart-bar window at the chart's interval. */
438
+ interface WrunLiveLegReconcile {
439
+ fetchKey: string;
440
+ intervalKey: string;
441
+ legMs: number;
442
+ fromTs: number;
443
+ toTs: number;
444
+ kind?: 'grid' | 'intrabar';
445
+ market?: WrunPinnedMarket;
446
+ /** An odds leg (the odds lane): asked with the prediction flag, its
447
+ * answer cut at the chart's last row. */
448
+ odds?: true;
449
+ /** A lane stream's leg (wrun-leg-stream-classes): asked through its own
450
+ * lane with its lane words, never the candle lane. */
451
+ stream?: WrunLegStreamLane;
452
+ /** The fetch-key suffix under the live prefix; absent = the leg's own
453
+ * (`leg-<wrunPinnedLegFetchSuffix>`). A session's run bars ride `main-<X>`. */
454
+ fetchSuffix?: string;
455
+ /** The leg's record names the native-rows path (`WrunPinnedLeg.nativeRows`): the reconcile asks it so. */
456
+ nativeRows?: true;
457
+ /** A grid leg asked at a tier (`WrunPinnedLeg.tierMs`): the reconcile asks the window at it, in wire pieces. */
458
+ tierMs?: number;
459
+ }
460
+ export type WrunLiveTickPlan =
461
+ /** Replay the block from the buffers. */
462
+ /** `reseedHeld`: the drain owed a reseed that a page ahead of the session
463
+ * holds (C1, `wrunPrefixHoldsReseed`): the tick keeps it owed and serves
464
+ * it on the drain after the hold. */
465
+ {
466
+ kind: 'compute';
467
+ reseedHeld?: true;
468
+ }
469
+ /** Fetch every declared lane over the window (and every pinned leg over
470
+ * its own), then compute. `legs` is present only for a context with
471
+ * pinned legs; a `pinned-close` alone asks the legs and no lane. */
472
+ | {
473
+ kind: 'reconcile';
474
+ lanes: WrunLiveLane[];
475
+ fromTs: number;
476
+ toTs: number;
477
+ reasons: WrunLiveGapReason[];
478
+ legs?: WrunLiveLegReconcile[];
479
+ /** A session at another interval (`runClock`): its run bars' re-ask
480
+ * window, the lanes' window reaching back to the bars' own coverage. */
481
+ runRows?: {
482
+ fromTs: number;
483
+ toTs: number;
484
+ };
485
+ }
486
+ /** A new session from the buffers, NO fetch. */
487
+ | {
488
+ kind: 'reseed';
489
+ reason: 'closed-bar-revised' | 'late-input' | 'order-error' | 'session-lost' | 'bar-count';
490
+ }
491
+ /** rerunWrunOverlayForChartWave (fetches). */
492
+ | {
493
+ kind: 'rebuild';
494
+ reason: 'identity' | 'history' | 'gap-too-wide' | 'acquisition';
495
+ };
496
+ export interface WrunLiveTickPlanInput {
497
+ context: WrunOverlayLiveContext;
498
+ mainRows: readonly ArrayLike<number>[];
499
+ gaps: WrunLiveGapReason[];
500
+ drained: {
501
+ dirtyFromTs: number | null;
502
+ };
503
+ /** The chart's current market identity (`wrunChartMarketIdentity`); when
504
+ * given, a context bound to another identity rebuilds. */
505
+ chartIdentity?: string;
506
+ /** A row-lane or poll-lane instance of the session whose acquisition moved
507
+ * since the run planned it (`wrunRowLaneMovedInstance`,
508
+ * `wrunPollLaneMovedInstance`): the session rebuilds, so the full run
509
+ * re-plans it and none of its buffered rows survive. */
510
+ rowLaneMoved?: boolean;
511
+ /** Rule 7's per-overlay budget (at most one late-input reseed per poll
512
+ * interval); the tick supplies it, default open. */
513
+ reseedBudgetOpen?: boolean;
514
+ /** The kScript poll window in bars (the reconcile window's floor); default
515
+ * the 8-bar tail. */
516
+ pollFloorBars?: number;
517
+ /** The drain's server-time clock (the legs' window end); default `serverNowMs()`. */
518
+ nowMs?: number;
519
+ /** The clock the pacing stamps below are on: performance.now() (their default), never the
520
+ * server's, which steps when a calibration lands between two drains. */
521
+ paceNowMs?: number;
522
+ /** When this session's ETF lane last answered a reconcile (the ask's time, on `paceNowMs`'s
523
+ * clock), undefined when it has not: a routine poll re-asks the lane only once that is
524
+ * WRUN_ETF_FLOW_RECHECK_MS old. */
525
+ etfFlowAnsweredAtMs?: number;
526
+ /** When this session's registry poll lane instances last answered a reconcile, by instance id
527
+ * (on `paceNowMs`'s clock): a routine poll re-asks a lane naming its own poll period only once
528
+ * that is that old (`wrunPollLaneRecheckDue`). */
529
+ pollLaneAnsweredAtMs?: ReadonlyMap<string, number>;
530
+ /** The oldest closed bar the session committed whose candle the chart has revised since (the
531
+ * bar's last trades landing after the roll, the main poll's correction), not yet reseeded;
532
+ * null or absent when none is owed. */
533
+ closedBarRevisedTs?: number | null;
534
+ /** A session at another interval than the chart (wrun-run-interval-session
535
+ * .util): `mainRows` are its run bars, while the chart's own bars key the
536
+ * history check and the plan clock. */
537
+ runClock?: WrunLiveRunClock;
538
+ /** When the tick first saw the chart's first row now ahead of the session's
539
+ * (`wrunPrefixPageSeenAt`, on `paceNowMs`'s clock): the start of the grace a
540
+ * prefix-capable session gives the page's wave (C1). Absent: no grace. */
541
+ prefixPageSeenAtMs?: number;
542
+ /** An earlier drain owed a reseed a page held (C1): still owed, as a late
543
+ * input whose gap that drain took. */
544
+ reseedHeld?: boolean;
545
+ }
546
+ /** The chart clock of a session at another interval than the chart. */
547
+ export interface WrunLiveRunClock {
548
+ /** The chart's first loaded bar now. */
549
+ chartFirstTs: number;
550
+ /** The chart's first loaded bar the session's run was built over. */
551
+ sessionChartFirstTs: number;
552
+ /** The open of the run bar holding the chart's newest bar (the forming one):
553
+ * the reconcile window ends with it. */
554
+ formingTs: number;
555
+ /** The open of the newest run bar the session computes (the plan clock):
556
+ * the forming one with wait for close off; with it on, the run bar of the
557
+ * newest chart bar before the forming bucket (a bucket without a chart bar
558
+ * held no trade: no run bar to wait on). */
559
+ lastMainTs: number;
560
+ /** The run bars' covered watermark: a failed re-ask leaves it behind. */
561
+ coveredThroughTs: number;
562
+ }
563
+ /**
564
+ * Decide one drain's plan from the context, the chart's main rows, the gap
565
+ * marks taken and what the fold reported. In order: a moved identity, a
566
+ * moved row-lane acquisition, or history (a clamped session: a head rolled
567
+ * past its first row; a pan-back page left to its wave is not one, C1), or a
568
+ * gap wider than 250 bars, rebuilds; any reconcile trigger
569
+ * (session-start, main-jump, wake, poll-due; main-jump is detected here from
570
+ * the rows) reconciles every declared lane over
571
+ * [min(lastRowTs - 8 bars, oldest outstanding fed bucket), the close of the
572
+ * bar at lastMainTs) (`barEndMs`: a calendar bar's own end on a month,
573
+ * quarter, half-year or year chart, one interval past it on every other), at
574
+ * least the kScript poll window wide; a dirty context with an
575
+ * explicit late-input gap, or a dirty bucket older than 8 bars, reseeds
576
+ * while the budget is open (a page ahead of the session holds it while its
577
+ * prefix is pending or a reopen would lack the page's source rows, kept owed
578
+ * for the drain after the hold); else compute.
579
+ */
580
+ export declare function decideWrunLiveTickPlan(input: WrunLiveTickPlanInput): WrunLiveTickPlan;
581
+ /** The chart clock a session at another interval plans on, read off the
582
+ * chart's real bars (`chartRows`, never empty here): the run bar holding the
583
+ * chart's newest bar (bucketed like the intake's folds), and the newest run
584
+ * bar the session computes. With wait for close on that is the run bar of
585
+ * the newest chart bar before the forming bucket opens (runBarSpan: on the
586
+ * CME session lattice a 1D or 1W bar opens the evening before its stamp): a
587
+ * bucket the chart shows no bar in held no trade (an illiquid pair, a
588
+ * weekend), so it has no run bar to wait on and the clock never names it;
589
+ * before any such chart bar, the session's own watermark. */
590
+ export declare function wrunLiveRunClockOf(session: WrunRunIntervalSession, context: WrunOverlayLiveContext, chartRows: ReadonlyArray<ArrayLike<number>>): WrunLiveRunClock;
591
+ /**
592
+ * Cached lane rows before `tailFromTs` plus the tail answer, deduplicated on
593
+ * the row timestamp (the tail wins on a collision), in ascending order. A
594
+ * cached row at or after `tailFromTs` survives only when its bucket is in
595
+ * `liveFedTs` and the tail lacks it: the reconcile passes the buckets the
596
+ * answer did not cover authoritatively (fed rows the wire cannot answer
597
+ * yet, buckets behind a short or empty answer), so a stale observation the
598
+ * answer superseded falls to the declared missing-data policy while an
599
+ * outstanding one is kept. Without a set every row at or after the start is
600
+ * the answer's to serve. Exported for the specs.
601
+ */
602
+ export declare function mergeWrunLaneRowsByTs<T extends ArrayLike<unknown>>(cached: ReadonlyArray<T> | undefined, tail: ReadonlyArray<T>, tailFromTs: number, liveFedTs?: ReadonlySet<number>): T[];
603
+ export declare function __resetWrunLiveTickForTests(): void;
604
+ /** Spec probe: the due time of the overlay's armed `pinned-close` timer, null when none. */
605
+ export declare function wrunPinnedCloseTimerDueAt(indicatorId: string): number | null;
606
+ /** The chart's main-rows identity the executor's pan-wave coverage skip
607
+ * compares runs by: the market, the first row, the newest closed row and the
608
+ * row count. A forming-bar tick changes none of them; a prepended page, a
609
+ * roll, a gap fill or a switch changes at least one. The executor reads it
610
+ * by chart through the seam registered below, and its own stamp counts a
611
+ * prefix run's coverage only once the commit landed (C1). Read for an
612
+ * overlay (`indicatorId`), the key says the same: while no run is in flight
613
+ * for the overlay (the coverage check), a page in front of its session whose
614
+ * prefix has not landed reads no identity, so no earlier run's coverage
615
+ * skips the wave that owes the page's rows; a run's own start (in flight)
616
+ * reads the chart's identity, so a prefix that lands covers the waves over
617
+ * the same rows after it. Exported for the specs. */
618
+ export declare function wrunChartRowsIdentity(chartIndex: number, indicatorId?: string): string | undefined;
619
+ export {};