@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,858 @@
1
+ /**
2
+ * The ONE compute-and-integrate pass for a browser-executed WRUN overlay,
3
+ * shared by the DEV fixture loader (services/wrun-dev-loader.service.ts) and
4
+ * the registry loader (services/wrun-registry-loader.service.ts): gather the
5
+ * chart's source rows through the kScript fetch lanes, run the compiled wasm
6
+ * in the sandbox worker, and integrate the result through the canonical
7
+ * kScript run-result adapter (`safeIntegrateKScriptRunResultToTitanCharts`,
8
+ * mode 'metadata') — the one-render-path rule from
9
+ * docs/features/wrun-browser-runtime.md.
10
+ *
11
+ * Extracted verbatim from the dev loader's runWrunDevOverlay so a
12
+ * registry-loaded package computes on EXACTLY the machinery the fixtures
13
+ * proved out; both loaders keep their own mount bookkeeping and call this
14
+ * with a mounted record's fields.
15
+ *
16
+ * Indicator strategies (wrun-3): a package whose sheet declares `strategy`
17
+ * also hands the host its broker feed (the chart's own candles, one OHLC
18
+ * per input row), the chart interval and its display name; the run result
19
+ * then carries the engine's StrategyOutput under `strategy`, and after the
20
+ * adapter integrate it is published to `setIndicatorRunOutputSummary`, the
21
+ * store path that feeds `setIndicatorStrategyPayload` for a kScript
22
+ * strategy, so the Strategy Tester, the trade markers and compare mode read
23
+ * it with no change of their own.
24
+ *
25
+ * Odds inputs (the odds lane, WRUN-ODDS-LANE-PLAN decisions 4 and 5): an
26
+ * `odds` input's pinned leg (`leg.odds`, market POLYMARKET|<condition id>,
27
+ * the planner's contract) is served through the same K_OHLCV lane under the
28
+ * prediction flag (`wrunLegPayloadExtras`: gapfill on the wire, volume-less
29
+ * bars as 0), its answer cut at the chart's last row (`cutWrunOddsLegRows`:
30
+ * gapfill mints bars past it; a grid leg's on a live chart at the forming
31
+ * bar's close, its forming row the forming bar's), and a thin market's
32
+ * window seeded with the last observation before it (prepended as its own
33
+ * row, never a row inside the window): a 250-bar seed asked alongside the
34
+ * window, the full 1440 leg bars only when that span holds no trade. Live it
35
+ * is poll-only: no candle feed and no push-frame admission
36
+ * (wrun-live-intake.util); the tick's reconcile and the pinned-close poll
37
+ * re-ask it through the same two helpers.
38
+ *
39
+ * The lifecycle (WRUN-PARITY-P1, wrun-lifecycle.contract): every run names
40
+ * its reason and may carry a clamped window. A paused or tripped overlay
41
+ * refuses at the head; the secondary lanes degrade instead of failing the
42
+ * run (kScript's secondary-source rule: budget, degrade registry, recovery
43
+ * ladder); the result reaches the chart through kScript's local-run
44
+ * decision core (wrun-integration-route.util: skip, rows merge or remount),
45
+ * measured by the execution guard behind the preflight budget; a proven
46
+ * twin's full result is stored as its stand-in.
47
+ *
48
+ * Refusals (WRUN-REFUSALS, contracts C1 to C5): every rejection of a run
49
+ * leaves with its typed record annotated (`wrunRefusalFor` against the
50
+ * run's context: the declared name, the chart's facts, the switch OUT) and
51
+ * lands on the legend through the common surface (`projectWrunRefusal`,
52
+ * owner `run`), which toasts once for a failed user attempt; this file
53
+ * never toasts. A feed is called missing only on capability evidence (the
54
+ * dispatcher's index-mode admission, `wrunLaneServedOnMarket`): such a lane
55
+ * is never dispatched, a reader that needs it refuses, the others draw
56
+ * beside a note. A pinned leg whose readers all read a scalar and declared
57
+ * a missing fill reads that fill when its market sends nothing (the leg
58
+ * gate, `wrunLegGate`). A lane answering empty keeps the degrade and its
59
+ * ladder; when the ladder gives up on it, the card says the service did not
60
+ * answer. A run's notes (empty legs, missing feeds, unserved pins, the
61
+ * nothing-ready health) ride its owned diagnostics rows with their records;
62
+ * a success retracts every earlier verdict.
63
+ */
64
+ import type { WrunDegradedLane, WrunRunReason, WrunRunWindow } from './wrun-lifecycle.contract.js';
65
+ import { type WrunIntegrationRoute } from './wrun-integration-route.util.js';
66
+ import type { OverlayRunInterval } from '../chart/indicator-run-interval.util.js';
67
+ import { type WrunPrefixLaneClause } from './wrun-prefix-lanes.util.js';
68
+ import { type WrunCandleGroup, type WrunFillPair, type WrunRunResult } from '../chart/wrun-run-result.util.js';
69
+ import { type WrunEarningsMarket } from './wrun-earnings-facts.util.js';
70
+ import { type WrunRunHealth } from './wrun-run-health.util.js';
71
+ import { type WrunChartNames } from './wrun-chart-context.util.js';
72
+ import { type WrunFactsMarket } from './wrun-chart-market-facts.util.js';
73
+ import { type WrunStrategyBarInput } from './wrun-host.service.js';
74
+ import { type WrunRefusalAttemptToken, type WrunRefusalContext, type WrunRefusalSeed } from './wrun-refusal.util.js';
75
+ import { type WrunHostFillContext } from './wrun-script-inputs.util.js';
76
+ import type { WrunLatestSnapshot } from './wrun-latest-snapshot.js';
77
+ import { wrunChartMarketIdentity, type WrunOverlayLiveContext, type WrunWarmupMiss } from './wrun-overlay-drivers.util.js';
78
+ import type { WrunLegCandleClose } from '@orangecharts/indicator-kit/host';
79
+ import { type WrunPinnedLeg, type WrunPinnedWire } from './wrun-source-rows.util.js';
80
+ import { type WrunOptionsChainRefusal } from './wrun-options-chain.util.js';
81
+ import { type WrunRunIntervalProjection } from './wrun-run-interval-session.util.js';
82
+ import { type WrunIndicatorMetadata, type WrunModuleHandle, type WrunOutputRow } from '../../interfaces/wrun-runtime.interface.js';
83
+ import type { RuntimeDiagnostic } from '../../interfaces/kscript-diagnostics.interface.js';
84
+ import { buildWrunOverlayRunResult, type WrunCanvasHostFill, type WrunOverlayResultOptions } from './wrun-overlay-result.util.js';
85
+ import { wrunIntegratedRowsView } from './wrun-integration-budget.util.js';
86
+ export { buildWrunOverlayRunResult, type WrunCanvasHostFill, type WrunOverlayResultOptions };
87
+ export { wrunIntegratedRowsView };
88
+ /** The leg bars an odds seed fetch reaches back before the window's open
89
+ * (the hosted lane's seed span): the last observation before a thin
90
+ * market's window, prepended as its own row. */
91
+ export declare const WRUN_ODDS_SEED_LEG_BARS = 1440;
92
+ /** The leg bars the first seed ask covers (one 250-bar piece): asked alongside
93
+ * the window, it finds a thin market's last observation without a second
94
+ * round trip; WRUN_ODDS_SEED_LEG_BARS stays the reach when it holds no trade.
95
+ * Cold, the gateway answered a 290-bar Polymarket window in 2.6 to 4.6 s and
96
+ * the serial 1440-bar seed that followed it in up to 12.5 s. */
97
+ export declare const WRUN_ODDS_SHORT_SEED_LEG_BARS = 250;
98
+ /**
99
+ * A pinned leg's fetch payload extras over the current-market placeholders:
100
+ * its market (absent = the chart's own), plus the K_OHLCV prediction flag
101
+ * (k-ohlcv.control `KOhlcvPredictionPayloadFields`: gapfill on the wire,
102
+ * volume-less bars as 0) for an odds leg (`leg.odds`, the planner's contract
103
+ * for every leg an `odds` input plans: market POLYMARKET|<condition id>).
104
+ * Shared by the full run and the tick's leg reconcile, so the two asks
105
+ * cannot drift.
106
+ */
107
+ export declare function wrunLegPayloadExtras(leg: Pick<WrunPinnedLeg, 'market' | 'odds' | 'stream'>): Record<string, unknown> | undefined;
108
+ /**
109
+ * The chart fetch type a pinned leg is asked through: a lane stream's own lane (`oi_candles` the open-interest
110
+ * lane, `volume_profile_candles` the volume-profile lane: wrun-leg-stream-classes), the chart's candle lane for
111
+ * every other leg (a period leg's candles, a `candles` stream, a grid, odds or intrabar leg). Shared by the full
112
+ * run and the tick's leg reconcile, so the two asks cannot drift.
113
+ */
114
+ export declare function wrunLegFetchType(leg: Pick<WrunPinnedLeg, 'stream'>): string;
115
+ /** What one candle of a pinned leg is, in a legend label or a refusal: a lane stream's own noun, else a candle. */
116
+ export declare function wrunLegCandleNoun(leg: Pick<WrunPinnedLeg, 'stream'>): string;
117
+ /**
118
+ * An odds leg's answer cut at the chart's last row: gapfill mints carried
119
+ * bars through the request's end, past the chart's newest candle, and a bar
120
+ * the chart does not hold yet must never enter a leg buffer. A grid leg on a
121
+ * live chart is cut at the forming bar's close instead (`lastChartTs` is then
122
+ * that close less one): its row opening inside the forming bar is the
123
+ * market's forming one, which the forming bar shows on a chart whose bars
124
+ * open off the leg's grid (`WrunChartSourceRows.formingBarTs`). Shared by the
125
+ * full run and the tick's leg reconcile.
126
+ */
127
+ export declare function cutWrunOddsLegRows<T extends ArrayLike<unknown>>(rows: ReadonlyArray<T>, lastChartTs: number): T[];
128
+ export interface WrunOverlayRunTarget {
129
+ chartIndex: number;
130
+ indicatorId: string;
131
+ metadata: WrunIndicatorMetadata;
132
+ /** The compiled package the browser lanes run; null for a record whose row source computes the
133
+ * package elsewhere (the socket source: the cloud runs it, contract C7). */
134
+ module: WrunModuleHandle | null;
135
+ /** Legend/run-result title. */
136
+ title: string;
137
+ position: 'onchart' | 'offchart';
138
+ axis?: boolean;
139
+ /** Loader-supplied presentation hints (the dev fixtures manifest); registry
140
+ * packages declare visuals in their metadata instead, so these stay unset. */
141
+ colors?: Record<string, string>;
142
+ fills?: WrunFillPair[];
143
+ candles?: WrunCandleGroup[];
144
+ /** Distinguishes the loaders' fetch lanes in cache keys/diagnostics. */
145
+ fetchKey: string;
146
+ /** Open (or rebuild) a live forming-bar session for this overlay: the run
147
+ * executes as a `live-start` in the sandbox worker (keeping the guest
148
+ * instantiated) and stores the live tick context, so the live fan-out can
149
+ * extend the forming bar per tick without recomputing history. */
150
+ live?: boolean;
151
+ /** Why the run starts (wrun-lifecycle.contract); absent means
152
+ * 'loaded-range-refresh'. It picks the integration route, and a Retry or a
153
+ * settings run may dispatch a quarantined package. */
154
+ reason?: WrunRunReason;
155
+ /** The clamped window to compute over (the pan wave's
156
+ * `resolveLocalTechnicalScriptLazyRefreshRange`); absent means the whole
157
+ * loaded window. */
158
+ window?: WrunRunWindow;
159
+ /** The registry version the module IS (the loader's mounted record): a
160
+ * session fallback (pinForThisSession) may run an older version than the
161
+ * row's saved pin, and the stand-in is written only for the version the
162
+ * row names. Absent for a lane with no registry version. */
163
+ version?: string;
164
+ }
165
+ /** Recompute one mounted WRUN overlay over the chart's CURRENT loaded rows
166
+ * and integrate the result through the shared adapter path. */
167
+ export declare function runWrunOverlayOnChart(target: WrunOverlayRunTarget): Promise<void>;
168
+ /** Why a run was superseded by its overlay's own newer intent (C4), in the order judged: the overlay left
169
+ * the chart (`unmounted`); the run is no longer the overlay's own (`not-current`: a remount under the id,
170
+ * or a later request's refusal attempt); the chart moved to another market or interval, or the chart the
171
+ * run computed for left (`market`: a switch, a workspace switch, a rebuild); the chart's data was replaced
172
+ * under it (`data-generation`: a switch, a refetch or a teardown, cancelFetchDataOfChart); a compute save
173
+ * landed after the run read its settings (`compute-revision`). */
174
+ export type WrunRunSupersededReason = 'unmounted' | 'not-current' | 'market' | 'data-generation' | 'compute-revision';
175
+ /** What a run computes for, read at its head before anything awaits (C4): the facts a failure of the run is
176
+ * judged against (`wrunRunSupersededReason`). */
177
+ export interface WrunRunComputedFor {
178
+ chartIndex: number;
179
+ indicatorId: string;
180
+ /** The run is still the overlay's own: its chart and overlay meta stand, and the refusal attempt it
181
+ * resolved is still the live one. */
182
+ isCurrent: () => boolean;
183
+ /** The chart data fetch generation at the run's head. */
184
+ dataGenerationAtStart: number;
185
+ /** The compute revision the run computes with (the one its params were read under, else the head's). */
186
+ computeRevision: number;
187
+ /** The chart and market the run computes for, once its head read them (absent for a run that failed
188
+ * before): the owner `wrunRunOwnerLeft` judges, the main series' market identity
189
+ * (`wrunChartMarketIdentity`: exchange, symbol, interval, transformations), and the reader of the main
190
+ * series now (the store loaded at the head, read in the caller's task). */
191
+ market?: {
192
+ owner: WrunRunChartOwner;
193
+ identity: string;
194
+ read: () => Parameters<typeof wrunChartMarketIdentity>[0];
195
+ };
196
+ }
197
+ /**
198
+ * Whether a run was superseded by its overlay's own newer intent, and why (C4); undefined for a run that is
199
+ * still the overlay's current one, whose failure is its own (a real timeout included). The mount and the
200
+ * refusal attempt alone never tell: a switch opens no attempt for a browser driver (the executor opens the
201
+ * next one only once this run settled), so the market, the chart data and the compute revision the run
202
+ * computed for are read too, and the cancel a switch causes reaches the run as an ordinary rejection of any
203
+ * type. Synchronous over what it reads, so the caller judges in the same task as the act the verdict guards.
204
+ */
205
+ export declare function wrunRunSupersededReason(run: WrunRunComputedFor): WrunRunSupersededReason | undefined;
206
+ /**
207
+ * A failed full run lands on the OVERLAY, not on whoever triggered it: the
208
+ * add mounts first and runs in the background, a rehydrate or chart wave
209
+ * has no dialog at all, so the legend's chip and card (the refusal record:
210
+ * one sentence and one way out, contract C3) is the one place a data
211
+ * problem shows, the same way a kScript overlay reports a data failure.
212
+ * Keep-last-good is untouched: the chip sits beside whatever the previous
213
+ * run rendered. A chart that is gone (or re-tenanted at the index) has
214
+ * nothing to stamp; the projection never masks the run's own error.
215
+ *
216
+ * The record is the one annotated on the rejection (the run pass annotates
217
+ * before it calls here), else built from `context.refusalContext`, else
218
+ * from the overlay itself (a failure the run pass never saw: the loader's
219
+ * download, compile and run-deadline outcomes, the parked casualty). The
220
+ * run's own note rows (its legs, its health) go with it. A paused record
221
+ * toasts once for a user attempt: the notice is claimed from
222
+ * `context.token` (no token, no toast) only while `context.isCurrent()`.
223
+ * Resolves once the legend holds the record; never rejects.
224
+ */
225
+ export declare function surfaceWrunRunFailureOnLegend(chartIndex: number, indicatorId: string, error: unknown, context?: {
226
+ outputNames?: readonly string[];
227
+ /** The run's refusal context (the run pass builds it from the chart it ran on). */
228
+ refusalContext?: WrunRefusalContext;
229
+ /** The attempt token the run resolved before its first await; absent or null: no toast. */
230
+ token?: WrunRefusalAttemptToken | null;
231
+ /** Whether the failure still belongs to the overlay's current mount (default: its chart stands). */
232
+ isCurrent?: () => boolean;
233
+ }): Promise<void>;
234
+ export declare function isWrunCryptoVenueExchange(exchange: string | null | undefined): boolean;
235
+ /** The chart's main-series metadata fields a refusal context reads. */
236
+ type WrunRefusalChartMetadata = {
237
+ exchange?: unknown;
238
+ symbol?: unknown;
239
+ coin?: unknown;
240
+ interval?: unknown;
241
+ } | null | undefined;
242
+ /**
243
+ * The refusal context of an overlay run (contract C1): named by the run's title (the Indicator's
244
+ * declared name), the chart's facts (`checkIsIndexMode`, `isCmeGoverned`, the crypto-venue rule),
245
+ * whether its source can be opened in the editor (`wrunOverlayEditable`), whether it has settings
246
+ * to open (declared params), each input's source class (the too-big variant), and the switch OUT
247
+ * the requirements of the sheet as the settings paint it give (C5, static facts; official
248
+ * provenance passes the CME wall). `chartMetadata` is the chart's main-series metadata (the store's
249
+ * `mergedAllCharts[i].metadata`). Never throws: a fact that cannot be read is left out.
250
+ */
251
+ export declare function wrunRefusalContextFor(input: {
252
+ title: string;
253
+ metadata: WrunIndicatorMetadata | undefined;
254
+ settings: unknown;
255
+ chartMetadata: WrunRefusalChartMetadata;
256
+ }): Promise<WrunRefusalContext>;
257
+ /**
258
+ * The run health the chart's surfaces read (the chip policy, FE-RUN): an output a viewer cannot
259
+ * see is not watched (`legend: false` and a sheet `visible: false`, which `wrunRunHealth` skips,
260
+ * and a Style page Visible row turned off, folded into `visible` here); and while a source the run
261
+ * reads is absent on this market and says so itself (`sourceAbsent`: a lane the chart never
262
+ * serves, a degraded lane, a pinned leg left unfetched or found empty, a series lane the market
263
+ * answered nothing for) no output counts as silent: such an output is empty because its source
264
+ * is, and that source's own note (the feed-missing note, the degrade chip, the leg notes, the
265
+ * empty-series note) says so once, never a NaN row per output. An empty window that publishes no
266
+ * note (quiet liquidations, a loaded-empty ETF day) is no absence: a silent output keeps its row.
267
+ * An output `visible_by` leaves out on the market's size unit (`sizeUnit`) mounts nothing, so it
268
+ * is not watched either. `watched` keeps the silent outputs the absence explains (the empty-series
269
+ * note is owed only when one went silent); `health` is what the rows are built from.
270
+ */
271
+ export declare function wrunChartRunHealth(metadata: Pick<WrunIndicatorMetadata, 'outputs'> & Partial<Pick<WrunIndicatorMetadata, 'params'>>, settings: unknown, outputRows: ReadonlyArray<WrunOutputRow>, sourceAbsent: boolean, sizeUnit?: number): {
272
+ watched: WrunRunHealth;
273
+ health: WrunRunHealth;
274
+ };
275
+ /** The chart run health of a live session's rows (a reseed's, a tick's health re-read): the
276
+ * session's sheet, the overlay's current settings and its full run's absent-source verdict. */
277
+ export declare function wrunSessionRunHealth(context: WrunOverlayLiveContext, settings: unknown, outputRows: ReadonlyArray<WrunOutputRow>): WrunRunHealth;
278
+ /**
279
+ * The record seed of a refused options-chain decision (contract C2), picked by the decision's
280
+ * reason: the no-options variants carry the coin the decision asked about (left out when it named
281
+ * none) and, for a pinned venue, the venue's name; a chain directory's own failure (CME, OPRA) is a
282
+ * service that did not answer; an OPRA chain read by a package that is not OpenMarket's own is the
283
+ * wall on US options data; a bad venue word or two chains in one sheet are the author's to fix.
284
+ */
285
+ export declare function wrunOptionsChainRefusalSeed(refusal: Pick<WrunOptionsChainRefusal, 'reason' | 'venueName' | 'coin' | 'stop' | 'plane'>): WrunRefusalSeed;
286
+ /** How the run treats a pinned leg's empty answer (`wrunLegGate`). */
287
+ export type WrunLegGate = 'blocking' | 'quiet' | 'unread';
288
+ /**
289
+ * The leg gate (WRUN-REFUSALS U3a step 4), over the inputs that read the leg's FETCHED rows
290
+ * (`wrunLegFetchedRowReaders`: an own-market forming view folds the primary rows and never
291
+ * counts, a foreign forming view counts for its grid leg only):
292
+ * - `blocking`: an odds leg, a cell or signal reader, or a scalar reader on the default carry
293
+ * policy (nothing to carry): an empty answer refuses the run, naming the market;
294
+ * - `quiet`: every reader reads a scalar and declares `missing: "nan"` or `"zero"`: an empty
295
+ * answer, or a failed fetch short of a deadline, is the fill they declared, so the run draws and
296
+ * one note names the empty markets;
297
+ * - `unread`: no input reads the leg's fetched rows (the period leg of foreign forming views): its
298
+ * answer moves nothing, so it never refuses and is never named.
299
+ * An intrabar leg is not gated: it reads like kScript's ltf() source, which answers a failed or
300
+ * empty fetch with empty cells and runs, so it always rides the quiet lane (fetchLegRows).
301
+ */
302
+ export declare function wrunLegGate(leg: Pick<WrunPinnedLeg, 'fetchKey' | 'odds'>, wires: ReadonlyMap<number, WrunPinnedWire>): {
303
+ gate: WrunLegGate;
304
+ readers: number[];
305
+ };
306
+ /** Test seam: forget every terminal-degrade watch and every in-flight run count. */
307
+ export declare function __resetWrunRunRefusalsForTests(): void;
308
+ /** The sheet's output names in slot order, for the failure rows that name a slot; a sheet
309
+ * without outputs (a strategy, a bare test double) reads as none. The failure seam runs
310
+ * inside a catch block and must never raise a second error over the first. */
311
+ export declare function wrunOutputNamesOf(metadata: {
312
+ outputs?: ReadonlyArray<{
313
+ name?: unknown;
314
+ }>;
315
+ } | null | undefined): string[];
316
+ /** The runtime diagnostic row for a sandbox error that is the author's code failing: an
317
+ * AssemblyScript trap, the host's output contract (an output never written, emitRow never
318
+ * called), the run deadline, the no-growth rule, or an import the host cannot link
319
+ * (`wrunRunFailureRuntimeDiagnostic`); null for every other failure (no bars, a declined
320
+ * source, a chart gone), which keeps the data-problem chip with Retry. */
321
+ export declare function wrunRuntimeTrapDiagnostic(error: unknown, context?: {
322
+ outputNames?: readonly string[];
323
+ }): RuntimeDiagnostic | null;
324
+ /** Replace the health warnings of an overlay's previous run with this run's (wrun-run-health.util:
325
+ * a draft's both verdicts, a viewer's nothing-ready row); none from a healthy run, which is also
326
+ * what clears them. Returns whether warnings are published after the call (the live session's
327
+ * `runHealthWarned`, which the tick's health re-read follows). Nothing is written for an
328
+ * overlay that left the chart while the run was in flight (the store would recreate its
329
+ * entry). A full run or a reseed refreshes the rows whenever they differ (a rerun over a
330
+ * fuller history rewrites "on all 3 bars"); a live tick passes `onlyOnVerdictChange` and
331
+ * writes only when the verdict itself changes (a new bar count is not a new warning).
332
+ * Advisory: a store that is gone has nothing to tell. */
333
+ export declare function publishWrunRunHealth(chartIndex: number, indicatorId: string, diagnostics: RuntimeDiagnostic[], options?: {
334
+ onlyOnVerdictChange?: boolean;
335
+ }): Promise<boolean>;
336
+ /** The unserved-leg rows of a run (the venue soft refusals, `WRUN_LEG_UNSERVED`): their own
337
+ * owned set beside the health rows, replaced by every full run, cleared by a run that served
338
+ * every leg. Advisory like the health rows. */
339
+ export declare function publishWrunUnservedLegDiagnostics(chartIndex: number, indicatorId: string, diagnostics: RuntimeDiagnostic[]): Promise<boolean>;
340
+ /**
341
+ * A live session's committed canvas notices: a reseed or a refine publishes its result's set
342
+ * (none clears a stale warning); a tick (`tick: true`) publishes only when its set differs from
343
+ * the one the session last published, so the forming period's coarsening (or its relief)
344
+ * reaches Problems and the legend while a standing set costs the tick no store read.
345
+ */
346
+ export declare function publishWrunSessionCanvasNotices(session: WrunOverlayLiveContext, runResult: WrunRunResult, options?: {
347
+ tick?: boolean;
348
+ }): Promise<void>;
349
+ /** Replace the rows of one owned code set on the overlay's diagnostics (every other row is
350
+ * kept), the shared body of the publishers above and of the canvas cost rows
351
+ * (wrun-canvas-cost-notice.util). */
352
+ export declare function publishWrunOwnedDiagnostics(chartIndex: number, indicatorId: string, ownedCodes: ReadonlySet<string>, diagnostics: RuntimeDiagnostic[], options?: {
353
+ onlyOnVerdictChange?: boolean;
354
+ /** Skip the write when the published owned rows already say the same (the caller's rule). */
355
+ unlessSame?: (published: RuntimeDiagnostic[], next: RuntimeDiagnostic[]) => boolean;
356
+ }): Promise<boolean>;
357
+ /** Drop the run-failure rows this seam owns (only those: a trap, the output contract, the
358
+ * no-growth rule, an unlinkable import) once a run of the same overlay succeeds. */
359
+ export declare function clearWrunRuntimeTrapDiagnostic(chartIndex: number, indicatorId: string): Promise<void>;
360
+ /** One pin a run respelled: the input, its halves as the sheet the resolver read wrote them, and the halves the run
361
+ * reads. */
362
+ export interface WrunRespelledPin {
363
+ inputName: string;
364
+ written: {
365
+ exchange?: string;
366
+ symbol?: string;
367
+ };
368
+ resolved: {
369
+ exchange?: string;
370
+ symbol?: string;
371
+ };
372
+ }
373
+ /** The pins a resolution respelled (the inputs whose source the resolved copy replaced), none when nothing moved. */
374
+ export declare function wrunRespelledPinsOf(written: WrunIndicatorMetadata, resolved: WrunIndicatorMetadata): WrunRespelledPin[];
375
+ /** A sheet with a run's respelled pins laid on (the respelling lives on the run's copy; every paint starts from the
376
+ * overlay's own sheet): an input whose pin still reads as the resolver read it runs on the market the run
377
+ * resolved. The same sheet when nothing applies (none respelled, or a pin since edited). */
378
+ export declare function wrunSheetWithRespelledPins(sheet: WrunIndicatorMetadata, pins: ReadonlyArray<WrunRespelledPin>): WrunIndicatorMetadata;
379
+ /** The sheet a live session plans its pinned legs from: its context's sheet with the installing run's respelled pins
380
+ * laid on, so a tick's leg plan names the markets the session's legs were fetched for even after a paint-only save
381
+ * repainted the context's sheet. */
382
+ export declare function wrunSessionPinnedSheet(context: WrunOverlayLiveContext): WrunIndicatorMetadata;
383
+ /** The sheet a browser session builds with as `settings` paint the overlay's `sheet`, when the run that installed it
384
+ * respelled pins: the painted sheet with them laid on again, exactly as that run built its own (the live tick's
385
+ * sheet reader answers it, so a paint-only save swaps in a sheet whose tail rows and reseeds key every respelled leg
386
+ * by the market it was fetched for). Undefined when the session holds none. */
387
+ export declare function wrunSessionRespelledSheet(context: WrunOverlayLiveContext, sheet: WrunIndicatorMetadata, settings: unknown): WrunIndicatorMetadata | undefined;
388
+ /** The settings patch from what a source computed with to the overlay's settings now (C5): the
389
+ * changed flat values, `null` for a value the overlay dropped. */
390
+ export declare function wrunRowSourcePatchOf(previous: Readonly<Record<string, unknown>>, next: Readonly<Record<string, unknown>>): Record<string, unknown>;
391
+ /**
392
+ * The kScript socket lost the overlay's cloud session: its `reconnected` or `session-swept` status (the worker
393
+ * cleared its instances as the socket closed, or dropped the ones a sweep named), which useVisiblityChanges hands
394
+ * every cloud driver the registry loader lists before it asks their rebuild. The socket's status is the session's
395
+ * truth and no rebuild moves it: from here the live context reads lost (`holdWrunLiveSessionLost`: its picture kept,
396
+ * its drains held, unhealthy to the heal ladder) and the source the overlay holds routes nothing more, since an ask on
397
+ * it would reach an instance the worker no longer has: a settings change the worker answers as a create over that one
398
+ * ask's window, and a page, which carries no settings to create with (`sessionPage`), answers nothing. A run that
399
+ * installs a fresh session ends both: the rebuild when it runs, else its next chance
400
+ * (the replay lane's next step, Resume, the heal). The held source is not released here: its session is gone already,
401
+ * and an end sent now could reach the session the rebuild opens for the same overlay. A run installing a session as
402
+ * the status lands reads the loss too (`wrunSessionInstallLost`, the loss counted in wrun-socket-session-losses.util):
403
+ * the session its batch came from went with it.
404
+ */
405
+ export declare function holdWrunSocketSessionLost(chartIndex: number, indicatorId: string, status: 'reconnected' | 'session-swept'): void;
406
+ /** Specs only: forget every held source (none is released), the socket's losses and the pending asks (none is
407
+ * cancelled). */
408
+ export declare function __resetWrunHeldRowSourcesForTests(): void;
409
+ /** One overlay's row-source retention as the memory census reads it (memory spec 4.4). */
410
+ export interface WrunRowSourceCensusEntry {
411
+ id: string;
412
+ /** The source the overlay holds (`wrunHeldRowSources`): 0 or 1. */
413
+ heldSourceCount: number;
414
+ /** The module input rows of the preparations its held source and its pending asks still reach
415
+ * (`WrunRunHost.prepared`, the displaced entries' among them): a run in flight keeps its own, a settled run none. */
416
+ heldPreparedRows: number;
417
+ /** Its fresh asks still pending (`wrunPendingRowSourceAsks`): a create on its way, or one whose run is landing. */
418
+ pendingAskCount: number;
419
+ /** The rows its mount memo keeps (`wrunMountMemos`): the last applied result's, plus the parent rows that result
420
+ * applied over once a later writer replaced them on the chart. */
421
+ memoRows: number;
422
+ }
423
+ /** Every overlay holding a row source or a pending ask, read-only: the memory census section the run pass registers
424
+ * at the first write of either map (`mainCaches.wrunRowSources`, `registerWrunRowSourceCensus`), beside the live
425
+ * sessions the chart census walks. */
426
+ export declare function wrunRowSourceMemoryCensus(): {
427
+ overlays: WrunRowSourceCensusEntry[];
428
+ };
429
+ /** The chart a full run computes for, read at its head before anything awaits:
430
+ * the live session the run opens belongs to it. */
431
+ interface WrunRunChartOwner {
432
+ chartIndex: number;
433
+ /** The mount epoch at the head (chart-mount-epoch.util): a workspace switch moves it. */
434
+ mountEpoch: number;
435
+ /** The chart instance at the head: a rebuild at the index replaces it. */
436
+ tc: unknown;
437
+ }
438
+ /**
439
+ * A replay run's run bars as of its cutoff (WRUN-PARITY-REST B1): the run
440
+ * bars the window fetched hold every bucket in full, the one the playhead is
441
+ * in included. The bucket holding the newest completed chart bar is folded
442
+ * from the completed chart bars inside it (the replay's own candle fold,
443
+ * `aggregateOhlcvRows`) until the cutoff bar closes it, the buckets before it
444
+ * stay as fetched, and none after it is kept: a run bar shows only what the
445
+ * replay revealed, the live rule (live, the forming run bar folds the candles
446
+ * as they trade and the closed one is the fetched one).
447
+ */
448
+ export declare function wrunReplayRunBars(runBars: ReadonlyArray<ArrayLike<number>>, chartRows: ReadonlyArray<ArrayLike<number>>, cutoffTs: number, runIntervalMs: number, chartIntervalMs: number): ArrayLike<number>[];
449
+ /** The candles of a pinned leg that have CLOSED by `nowMs` (a candle
450
+ * stamped `ts` closes at `ts + legMs`, or where its host's `closeMs` puts
451
+ * it: a CME session bar, `wrunLegCandleClose`), in the answer's order; the
452
+ * forming candle and any malformed row are dropped. Shared by the full run
453
+ * and the tick's leg reconcile. */
454
+ export declare function closedLegCandles(rows: ReadonlyArray<ArrayLike<number>>, legMs: number, nowMs: number, closeMs?: WrunLegCandleClose): ArrayLike<number>[];
455
+ /** The candles of a leg answer still OPEN at `nowMs` (the complement of `closedLegCandles` over
456
+ * the readable rows: the venue's running candle, a repeated open kept in the answer's order), the
457
+ * rows a `candles` input read with view "forming" reads its live candle from. */
458
+ export declare function openLegCandles(rows: ReadonlyArray<ArrayLike<number>>, legMs: number, nowMs: number, closeMs?: WrunLegCandleClose): ArrayLike<number>[];
459
+ /** Whether a `candles` input reads this leg's still-open candles: view "forming" (its live
460
+ * candle) or view "forming_open" (the running candle's open holds its rows). The leg's fetch
461
+ * then asks through now and keeps the candles it answered still open. */
462
+ export declare function wrunLegReadsLiveCandle(leg: Pick<WrunPinnedLeg, 'kind' | 'inputIndexes'>, wires: ReadonlyMap<number, WrunPinnedWire>): boolean;
463
+ /** Whether a `candles` input read with view "forming_open" reads this leg: every row's block is
464
+ * the open of the candle holding it, so a candle the leg shows anew (the running one served
465
+ * late) changes committed rows' blocks. */
466
+ export declare function wrunLegReadsFormingOpen(leg: Pick<WrunPinnedLeg, 'kind' | 'inputIndexes'>, wires: ReadonlyMap<number, WrunPinnedWire>): boolean;
467
+ /** Whether every input reading this leg reads its live candle (view "forming") and none its
468
+ * closed candles: the leg's closed buffer then reaches no committed row (the live candle sits
469
+ * on the live row alone), so its asks may be shallow and its revisions revise nothing. */
470
+ export declare function wrunLegReadsLiveCandleOnly(leg: Pick<WrunPinnedLeg, 'kind' | 'inputIndexes'>, wires: ReadonlyMap<number, WrunPinnedWire>): boolean;
471
+ /** Whether the funding lane must answer rows for this package: true when any
472
+ * funding input rides the default carry policy (an absent rate has nothing
473
+ * to carry, so an empty lane refuses loud); a package whose every funding
474
+ * input declares `missing: "nan"` or `"zero"` reads its fill on markets
475
+ * without funding and the lane stays quiet, like oi. */
476
+ export declare function wrunFundingLaneRequired(metadata: WrunIndicatorMetadata): boolean;
477
+ /**
478
+ * Reseed a live session from the context's OWN buffers, no fetch (plan
479
+ * section 8 fold 1): the full input rows are rebuilt from the lane buffers
480
+ * over the chart's current candles, the worker session is ended and
481
+ * reopened under the retained seed (module, init args, strategy config)
482
+ * and a FRESH generation (stored on the retained context first, the
483
+ * queued intake points adopted into it: a full run that reached the worker
484
+ * but failed to integrate left the worker's newest epoch past this
485
+ * context's generation, so a start under the old value would never
486
+ * install), the result integrates through the full run's helpers (drawing
487
+ * budget included), and the watermarks reset to the newest row with the
488
+ * carry seed rebuilt and `dirtyFromTs` cleared. Takes the overlay's
489
+ * session lock itself: call it from OUTSIDE a held lock (the lock is not
490
+ * reentrant). `options.eligible` is the caller's own gate (the tick's
491
+ * eligibility predicate), consulted beside the fan-out's facts (replay,
492
+ * protection, pane budget, market identity) before the session reopens and
493
+ * again before its answer applies.
494
+ *
495
+ * Returns 'reseeded' when the session was reopened (the render may still
496
+ * have failed: then `repaintOwed` is set and the next successful patch
497
+ * repaints), 'refused' when the drawing budget refused the integrate
498
+ * (`liveSuspended` is set: no drains until the next full run or settings
499
+ * change), and 'skipped' when there was nothing to reseed (no context or
500
+ * seed, a suspended context, a chart or overlay gone, an ineligible chart,
501
+ * a context replaced mid-flight) or the worker failed: a death goes to the
502
+ * casualty window, a quarantine suspends the session, and any other failure
503
+ * suspends the context (`liveSuspended`, `liveSuspendedBy: 'reopen-failed'`)
504
+ * and hands ONE rebuild to the full run driver, so a failure that repeats
505
+ * never loops the drains; the heal ladder retries a retryable one.
506
+ */
507
+ export declare function reseedWrunOverlayFromBuffers(indicatorId: string, reason: 'closed-bar-revised' | 'late-input' | 'order-error' | 'session-lost' | 'bar-count' | 'replay-seek', options?: {
508
+ eligible?: () => boolean;
509
+ /** A replay lane's primary rows (wrun-replay-lane.util): the replay's bars through its
510
+ * cutoff with the window's head, or the run bars as of it; the session rebuilds over them
511
+ * instead of the chart's current candles. */
512
+ ohlcvRows?: ReadonlyArray<ArrayLike<number>>;
513
+ }): Promise<'reseeded' | 'refused' | 'skipped'>;
514
+ type WrunLaneRows = ArrayLike<number>[];
515
+ /** The row builder's own lanes, one optional thunk each. */
516
+ type WrunBuiltinLaneThunks = {
517
+ book?: () => Promise<WrunLaneRows>;
518
+ trades?: () => Promise<WrunLaneRows>;
519
+ trades_usd?: () => Promise<WrunLaneRows>;
520
+ oi?: () => Promise<WrunLaneRows>;
521
+ volume_profile?: () => Promise<WrunLaneRows>;
522
+ trade_volume_by_size?: () => Promise<WrunLaneRows>;
523
+ liquidations?: () => Promise<WrunLaneRows>;
524
+ funding?: () => Promise<WrunLaneRows>;
525
+ implied_volatility?: () => Promise<WrunLaneRows>;
526
+ skew?: () => Promise<WrunLaneRows>;
527
+ options_chain?: () => Promise<WrunLaneRows>;
528
+ etf_flow?: () => Promise<WrunLaneRows>;
529
+ tape?: () => Promise<WrunLaneRows>;
530
+ };
531
+ /** One lane keyed by its id to dispatch (a registry poll lane instance, a trades leg lane): its id and its fetch,
532
+ * handed the signal its run raises when the lane's budget runs out (`runWrunSourceLanes`). */
533
+ type WrunPollLaneThunk = readonly [key: string, run: (abandoned: AbortSignal) => Promise<WrunLaneRows>];
534
+ type WrunSourceLaneThunks = WrunBuiltinLaneThunks & {
535
+ /** The trades leg lanes (kit 0.77.0), one thunk per (quote, market) by its lane id. */
536
+ tradeLegs?: ReadonlyArray<WrunPollLaneThunk>;
537
+ /** The registry poll lanes (`sources/`), one thunk per planned instance. */
538
+ pollLanes?: ReadonlyArray<WrunPollLaneThunk>;
539
+ /** The row lanes (`sources/row-lane-registry.ts`), one thunk per planned instance. */
540
+ rowLanes?: ReadonlyArray<WrunPollLaneThunk>;
541
+ };
542
+ type WrunSourceLaneResults = {
543
+ [K in keyof WrunBuiltinLaneThunks]: WrunLaneRows | undefined;
544
+ } & {
545
+ /** The trades leg lanes' rows by lane id; present only when one was dispatched. */
546
+ tradeLegRows?: Record<string, WrunLaneRows>;
547
+ /** The registry poll lanes' rows by instance id; present only when one was dispatched. */
548
+ pollLaneRows?: Record<string, WrunLaneRows>;
549
+ /** The row lanes' rows by instance id; present only when one was dispatched. */
550
+ rowLaneRows?: Record<string, WrunLaneRows>;
551
+ };
552
+ /** One secondary lane's outcome (D2 2.3): its rows, or degraded to empty
553
+ * rows with the cause (a budget expiry, an empty or declined answer, any
554
+ * other rejection). Every cause here is retryable, except an answer the
555
+ * data plane refused by name (wrun-lane-refusal.leaf): the same ask is
556
+ * refused again, so no ladder re-asks it. */
557
+ export type WrunLaneOutcome = {
558
+ kind: 'rows';
559
+ rows: WrunLaneRows;
560
+ } | {
561
+ kind: 'degraded';
562
+ rows: [];
563
+ cause: WrunDegradedLane['cause'];
564
+ retryable: boolean;
565
+ error?: unknown;
566
+ };
567
+ export interface WrunSourceLaneRun {
568
+ /** Every declared lane's rows (a degraded lane's empty); undeclared lanes stay undefined. */
569
+ results: WrunSourceLaneResults;
570
+ /** Every dispatched lane's outcome, in declaration order (poll lanes by instance id, last). */
571
+ outcomes: Array<{
572
+ lane: string;
573
+ outcome: WrunLaneOutcome;
574
+ }>;
575
+ /** The degraded lanes alone, in the same order. */
576
+ degraded: Array<{
577
+ lane: string;
578
+ outcome: Extract<WrunLaneOutcome, {
579
+ kind: 'degraded';
580
+ }>;
581
+ }>;
582
+ }
583
+ export interface WrunSourceLanePolicy {
584
+ /** Each lane's budget (kScript's `resolveSecondarySourceBudgetMs`): one for
585
+ * every lane, or each lane's own by its id (the tape's is sized by its
586
+ * history span). A lane still out at it degrades (cause 'budget'), its
587
+ * fetch abandoned, not aborted. Absent: the fetch's own deadline only. */
588
+ budgetMs?: number | ((lane: string) => number);
589
+ /** Called with each lane id right before its thunk runs. */
590
+ onDispatch?: (lane: string) => void;
591
+ }
592
+ /**
593
+ * Dispatch every declared lane at once and settle them all (S7, F103/F127:
594
+ * a multi-source package pays the slowest lane, not the sum). Every lane here
595
+ * is a DEGRADABLE secondary lane (kScript's rule: a source that does not own
596
+ * the timeline never holds the run): a rejection, a budget expiry or a state
597
+ * lane's empty answer (`WrunLaneEmptyAnswer`) comes back degraded with empty
598
+ * rows, never a failure, and no lane toasts. The blocking lanes (the chart
599
+ * rows, the run bars, the pinned legs) are awaited by the caller. The trades
600
+ * leg lanes (`thunks.tradeLegs`, one per quote and market) and the registry
601
+ * poll lanes (`thunks.pollLanes`, one thunk per planned instance) dispatch with
602
+ * them, after the row builder's own lanes; their rows come back under
603
+ * `tradeLegRows` and `pollLaneRows`, keyed by lane id and instance id.
604
+ */
605
+ export declare function runWrunSourceLanes(thunks: WrunSourceLaneThunks, policy?: WrunSourceLanePolicy): Promise<WrunSourceLaneRun>;
606
+ /**
607
+ * The host-filled values a run's `market.*` params read (WRUN-INPUTS-PLAN
608
+ * 1.1, `host_fill`): `tickSize` = the instrument tick the pane's engine
609
+ * holds (`getPriceTick`, CME venues today), else the tick the chart's own
610
+ * candles reveal (`wrunInferredMainTick`: Binance BTCUSDT reads 0.1, so a
611
+ * `ticks` offset moves by ticks off CME too); absent when neither knows one,
612
+ * which the kit helpers read as unavailable. `pricePrecision` = the decimals
613
+ * the chart's MAIN price scale prints at (the engine tick's own decimals
614
+ * when it holds one, else the axis-step rule; HIP-4 overrides both), the
615
+ * same resolution `calculatePricePrecision` makes for the axis: an inferred
616
+ * tick never moves it. Feature-detected on the engine: a pin without the
617
+ * tick API, or a bare test double, yields no engine tick.
618
+ * The chart words (`intervalSec` = `intervalMs` / 1000, the run clock's
619
+ * interval; `bgColor` / `fgColor` = the pane theme's background and axis
620
+ * text colour, packed) ride beside them (wrunChartContextHostFill); an
621
+ * unknown interval or a theme-less engine leaves them absent. The main
622
+ * scale's `priceStep` is the axis label spacing (it moves with zoom), never
623
+ * a price unit: it only picks the axis precision here. With `market` (the
624
+ * chart metadata), the market's facts ride too (`kind`, `pointValue`, `zone`,
625
+ * `quoteIsUsd`, `sessionOpen`: wrunMarketFactsFor, over the directory row a
626
+ * run of a package declaring `kind` or `quote_is_usd` awaited first). With
627
+ * `earnings` (the chart metadata, passed for a sheet that declares an
628
+ * earnings fact), the issuer's earnings facts ride too (`earningsNextMs`,
629
+ * `earningsPrevMs`, `earningsSession`: wrunEarningsFactsFor, over the earnings
630
+ * window a run of such a package warmed first).
631
+ */
632
+ export declare function wrunHostFillContextFor(tc: unknown, chartExchange: unknown, intervalMs?: number, market?: WrunFactsMarket, earnings?: WrunEarningsMarket): WrunHostFillContext;
633
+ /**
634
+ * The latest-values snapshot of a run's rows (wrun-hud-state, U10's frozen
635
+ * shape): the last READY row's bar time, every output's value on it (NaN
636
+ * for a slot it never wrote), every string slot's text on it, and the last
637
+ * `WRUN_LATEST_HISTORY_LENGTH` ready rows' values per output, oldest first.
638
+ * Rows that never ran (`outputs === null`, the warm-up) hold no value and
639
+ * are skipped, like the debug log skips them. `chartNames` substitutes the
640
+ * chart-name placeholders in the string slots, the way the run result does
641
+ * (the snapshot reads the host's rows, not the substituted result).
642
+ */
643
+ export declare function wrunLatestSnapshotOf(metadata: Pick<WrunIndicatorMetadata, 'outputs' | 'string_slots'>, outputRows: ReadonlyArray<WrunOutputRow>, chartNames?: WrunChartNames): WrunLatestSnapshot;
644
+ /**
645
+ * A run-interval session's output rows as the chart's newest bars show them
646
+ * (up to WRUN_LATEST_HISTORY_LENGTH bars): each chart bar carries the run
647
+ * bar the adapter's projection maps it to (kscript-run-interval-projection
648
+ * .util, the same rule: wait for close on shows the last run bar that closed
649
+ * before it, off also shows the forming run bar inside its own bucket),
650
+ * stamped with the chart bar's time. Chart bars that show no run bar are
651
+ * left out.
652
+ */
653
+ export declare function wrunOutputRowsOnChartBars(outputRows: ReadonlyArray<WrunOutputRow>, chart: unknown, run: Pick<OverlayRunInterval, 'intervalMs' | 'waitForClose' | 'sessionLattice'>): WrunOutputRow[];
654
+ /**
655
+ * What follows every successful integrate, the full run's, the reseed's and
656
+ * the tick's (after the lower-pane children mounted): the nested output
657
+ * visibility the sheet (`visible: false`) and the Style page's Visible rows
658
+ * ask for (U9's `applyWrunOutputVisibility`, parent and children), and the
659
+ * latest-values snapshot the HUD layer, the legend and the hover inspector
660
+ * read (`publishWrunLatestValues`), then the Indicator store's seen note for
661
+ * a registry Indicator (`noteWrunRegistryRun`: once a page and day, the maker's
662
+ * private reach; both row sources pass here). Presentation only: a failure here
663
+ * is logged, never a second failure over a run that rendered.
664
+ */
665
+ export declare function presentWrunIntegration(chartIndex: number, indicatorId: string, metadata: WrunIndicatorMetadata, settings: unknown, outputRows: ReadonlyArray<WrunOutputRow>, chart?: unknown, initArgs?: ReadonlyArray<number>, chartNames?: WrunChartNames, runInterval?: OverlayRunInterval | null): void;
666
+ /**
667
+ * The canvas fill a run integrates with: for a sheet that declares a TPO,
668
+ * the block the catalog mirror holds for the chart market (a mirror miss, a
669
+ * market without an exchange and a symbol, or a catalog that fails to load
670
+ * leave it absent).
671
+ */
672
+ export declare function wrunCanvasHostFillFor(metadata: Pick<WrunIndicatorMetadata, 'profiles'>, market: {
673
+ exchange?: unknown;
674
+ symbol?: unknown;
675
+ } | undefined): Promise<WrunCanvasHostFill>;
676
+ export declare function rememberWrunSessionCanvasFill(session: object, fill: WrunCanvasHostFill): void;
677
+ /** The canvas fill a live session was integrated with; undefined for a
678
+ * session no integrate recorded one for. */
679
+ export declare function wrunSessionCanvasFillOf(session: object | undefined): WrunCanvasHostFill | undefined;
680
+ /** The host build's main-thread ms (WRUN guardrails G3a) into the overlay's
681
+ * apply signal: the perf tracker's windowed median, never the execution
682
+ * guard's breaker (a cold full run on 3,000 bars must not pause a healthy
683
+ * indicator). The one sample per update: the lifecycle's execution measure
684
+ * times the apply inside it for the breaker alone (`sample: false`). The
685
+ * slow verdict reaches the existing toast with cause `apply`. */
686
+ export declare function recordWrunHostBuildMs(chartIndex: number | undefined, indicatorId: string, ms: number, live?: boolean): void;
687
+ /** Drop an overlay's canvas run state (its refine latches, its run serial):
688
+ * called from the live tick lane's teardown hook beside the canvas cache. */
689
+ export declare function forgetWrunOverlayCanvasState(indicatorId: string): void;
690
+ /** Spec probe: settles once every refine in flight has applied or stood down. */
691
+ export declare function __settleWrunTpoBlockRefinesForTests(): Promise<void>;
692
+ /**
693
+ * The chart's price digits (WRUN-STYLE X7: the one source, the legend's
694
+ * `calculatePricePrecision`), undefined without a chart index or an engine
695
+ * to read (a bare test double, a chart that is gone).
696
+ */
697
+ export declare function wrunChartPriceDigits(chartIndex: number | undefined): number | undefined;
698
+ /** The broker feed for input rows: the chart's own candles joined by
699
+ * timestamp (a row with no candle is a non-finite bar, which the engine
700
+ * handles as such). Shared by the full run and the reseed. */
701
+ export declare function wrunStrategyBarsFor(rows: ReadonlyArray<{
702
+ ts: number;
703
+ }>, ohlcvRows: ReadonlyArray<ArrayLike<number>>): WrunStrategyBarInput[];
704
+ /** Publish a strategy run result to the store path the Strategy Tester
705
+ * reads: `setIndicatorRunOutputSummary` feeds `setIndicatorStrategyPayload`
706
+ * (which extracts `runResult.strategy` through the same
707
+ * `extractKScriptStrategyPayloadFromRunResult` a kScript strategy takes),
708
+ * the run-output summary and the perf ledger. Live frames replace the
709
+ * payload wholesale. A result without `strategy` publishes nothing (a
710
+ * non-strategy package's store bookkeeping is untouched). The store is
711
+ * loaded lazily: its graph is heavy and only a strategy package needs it.
712
+ *
713
+ * Only while the run's overlay is still mounted on the chart it ran on
714
+ * (`mount`: the engine and the meta the run integrated into). A run
715
+ * outlives its overlay when the overlay leaves mid-run (the editor's next
716
+ * Run of the tab swaps the draft for the new build, the legend X, a chart
717
+ * rebuild), and the removal has already dropped the overlay's payload.
718
+ * Publishing that late result stored the strategy again with no overlay
719
+ * behind it: the tester dock kept a strip on a chart whose Indicators
720
+ * declare no strategy, and its Remove all asked "Remove 1 strategy overlays
721
+ * from this chart?". The live tick needs no such check: its context gate
722
+ * already refuses a torn-down overlay. */
723
+ export declare function publishWrunStrategyRunResult(chartIndex: number, indicatorId: string, runResult: WrunRunResult, mount: WrunRunMount): Promise<void>;
724
+ /** The engine and the overlay meta a run integrated into. */
725
+ interface WrunRunMount {
726
+ tc: unknown;
727
+ meta: unknown;
728
+ }
729
+ /**
730
+ * A sheet with colour settings: the overlay palette (the collapsed-legend
731
+ * chip reads `settings.colors[0]`) is the colours this
732
+ * run paints, in row order (frozen sheet contract, round 6). The settings
733
+ * save drops a TECHNICAL_SCRIPT's `colors` (stripKScriptRuntimeSettings), so
734
+ * the dialog's rewrite never reaches the chart: every full run stamps the
735
+ * palette on the live overlay through titan's own settings update (which
736
+ * repaints the legend colour blocks) and refreshes the collapsed summary.
737
+ * A sheet without colour settings keeps its mount palette untouched.
738
+ *
739
+ * A sheet whose whole look is a stats strip (wrunSheetDrawsOnlyStatsStrip):
740
+ * titan's strip reads the palette as its "Candle colors" theme pair, and the
741
+ * built-in's template holds the theme's line palette there, owned by the
742
+ * theme (the technical-script control's stamp, then the theme pass). So the
743
+ * run stamps that same palette, theme-owned, sized like the template's (one
744
+ * colour per colour setting), and never the colour settings themselves (they
745
+ * paint their own rows through their style targets); a palette the theme or
746
+ * the user already owns (`colorsCustomized` set) stays with its owner, so the
747
+ * theme pass keeps it in step on every theme switch, as it keeps the
748
+ * template's.
749
+ */
750
+ export declare function syncWrunRunOverlayPalette(tc: unknown, indicatorId: string, meta: Record<string, unknown>, metadata: WrunIndicatorMetadata): void;
751
+ /**
752
+ * A sheet with a stats strip look (om `stats_strip`): the Display settings
753
+ * titan's strip reads off the overlay by name (statsGrading, statsLabelSide,
754
+ * statsTheme; a kScript overlay holds them as the Bar Statistics template's
755
+ * inputs) are the look the sheet paints under the current settings, in the
756
+ * template's labels (wrunStatsStripSettings). Every full run stamps the ones
757
+ * that moved through titan's own settings update (the strip's data key reads
758
+ * them, so it repaints), the way the palette is stamped. A sheet without a
759
+ * strip look never touches them.
760
+ */
761
+ export declare function syncWrunRunStripSettings(tc: unknown, indicatorId: string, meta: Record<string, unknown>, stripSettings: Record<string, string> | undefined): void;
762
+ /**
763
+ * A wrun result's price-pane corner tables placed clear of the chart's own
764
+ * chrome (the legend stack, the pane action bar, the High/Low tags;
765
+ * wrun-table-chrome.util), right before a wrun lane hands it to the adapter:
766
+ * the full run below and the live tick (wrun-live-tick.util). The overlay is
767
+ * tracked while it has such a table, and when the chrome moves (a legend row
768
+ * comes or goes, the tags toggle) its last result is placed again and goes
769
+ * through the adapter's mounted-row refresh, the live tick's own call, with
770
+ * the lane's projection; a refresh that cannot apply waits for the next run
771
+ * or tick. kScript tables never pass here.
772
+ *
773
+ * The follow-up re-applies only under the chart context the result was placed
774
+ * in: the overlay still mounted, the chart not replaying (the replay lane owns
775
+ * the rows; a placement while replaying is not followed at all), the same
776
+ * market and interval on titan's main series, and its table rows not blanked
777
+ * by a domain switch (which empties them in place, ahead of titan's new
778
+ * domain). Otherwise the tracked result is stale and leaves the follow-up
779
+ * until the next run places it again.
780
+ */
781
+ export declare function placeWrunResultTables(tc: unknown, indicatorId: string, meta: Record<string, unknown>, runResult: WrunRunResult, lane?: {
782
+ chartIndex?: number;
783
+ projection?: WrunRunIntervalProjection;
784
+ }): WrunRunResult;
785
+ /** The full run's route facts (wrun-integration-route.util), read by the run
786
+ * around its worker call. */
787
+ export interface WrunIntegrationFacts {
788
+ reason: WrunRunReason;
789
+ /** The overlay shows a result an earlier run of this lane integrated. */
790
+ hasGoodResult: boolean;
791
+ /** The chart, the overlay or the market moved off what the run computed for. */
792
+ identityLeft: boolean;
793
+ /** The settings changed while the run computed with the old ones. */
794
+ settingsStale: boolean;
795
+ /** The first row of the window the run's budget retained, when it left older loaded bars out (WRUN-MARKS-CONTRACT
796
+ * design 5): a mount that reaches before it is replaced, never merged onto. */
797
+ retainedFromTs?: number;
798
+ }
799
+ export type WrunIntegrateOptions = WrunOverlayResultOptions & {
800
+ tc: unknown;
801
+ meta: Record<string, unknown>;
802
+ indicatorId: string;
803
+ projection?: WrunRunIntervalProjection;
804
+ /** The owning chart: its price digits reach the selection and the children (X7), its table
805
+ * follow-up stands down while it replays, the execution guard measures the apply on it, and
806
+ * its key carries the host build's cost. */
807
+ chartIndex?: number;
808
+ /** The clamped window the rows were computed over: a partial one keeps the mounted rows outside
809
+ * it on a remount. */
810
+ window?: WrunRunWindow;
811
+ /** The full run's route facts; absent, the result remounts (a reseed, a direct caller). */
812
+ integration?: WrunIntegrationFacts;
813
+ };
814
+ export interface WrunIntegrateOutcome {
815
+ /** The result (its tables placed when it applied). */
816
+ runResult: WrunRunResult;
817
+ route: WrunIntegrationRoute;
818
+ /** The adapter took the result onto the mounted overlay (a merge or a remount); false for a
819
+ * route skip or a sparse run the mounted rows outrank. */
820
+ applied: boolean;
821
+ }
822
+ /**
823
+ * The chart's integration budget over the parent and its lower panes (`applyWrunIntegrationBudgetPolicy`,
824
+ * wrun-integration-budget.util): rows past the kScript preflight's 400k refuse with the kScript path's diagnostic
825
+ * code (thrown here as the run's error, its refusal seed attached), drawings past 2,000 are trimmed in place.
826
+ * Returns the result.
827
+ */
828
+ export declare function applyWrunIntegrationBudget(runResult: WrunRunResult, chartIndex: number | undefined, indicatorId: string): WrunRunResult;
829
+ /** Build the canonical run-result from full-range WRUN output rows and apply
830
+ * it through the shared adapter (the one-render-path rule): the remount
831
+ * route, for the reseed and every direct caller. A run at another interval
832
+ * than the chart hands its `projection` (the stamp, the chart and its
833
+ * venue): the result carries its run timeline and the adapter projects its
834
+ * rows, and its lower pane's, onto the chart's bars. Throws on integration
835
+ * failure; returns the integrated result (a strategy package's caller
836
+ * publishes its `strategy` to the store after this). */
837
+ export declare function integrateWrunOutputRows(options: WrunIntegrateOptions): WrunRunResult;
838
+ /**
839
+ * The full run's integrate (D2 2.6): the result goes through the route
840
+ * (`wrunIntegrationRoute`, kScript's local-run decision core), then the
841
+ * preflight budget, then the apply, measured by the execution guard
842
+ * (`withWrunOverlayExecutionMeasure`: a tripped measurement pauses the
843
+ * overlay). A rows merge unions the result with the mounted rows (a pan page
844
+ * never remounts) and falls back to the remount on any refusal but a sparse
845
+ * run (the adapter forbids falling through then: the mounted rows are the
846
+ * picture); a remount keeps the mounted rows outside a partial window (a
847
+ * mounted heatmap child's too, through the child mount's `historyWindow`),
848
+ * and the merge route lands a mounted heatmap child's rows inside whatever
849
+ * window the run recomputed, partial or not. A route skip (an unchanged
850
+ * result: the same window, the parent and every child equal) applies nothing
851
+ * and leaves the caller to act on it. The whole pass (every full run, reseed
852
+ * and refine reaches it) is the host's own main-thread work and is counted as
853
+ * one apply sample for the overlay (G3a), whether it applies, skips or
854
+ * refuses.
855
+ */
856
+ export declare function integrateWrunRunThroughRoute(options: WrunIntegrateOptions): WrunIntegrateOutcome;
857
+ /** Why a pan wave runs whole instead of as a prefix run (C1 v3's skip reasons). */
858
+ export type WrunPrefixSkipReason = 'no-context' | 'not-backward-extension' | 'not-audited' | 'version-outside-audit' | `unsupported-outputs:${string}` | 'replay' | 'clamped' | 'htf' | `lanes:${WrunPrefixLaneClause}` | 'whole-range-script' | 'prefix-unsafe' | 'no-closed-book-observation' | WrunWarmupMiss | 'warmup-cold' | 'candle-revised';