@orangecharts/wrun-chart-host 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (362) hide show
  1. package/README.md +23 -6
  2. package/dist/constants/exchange-names.leaf.d.ts +8 -0
  3. package/dist/constants/exchange-names.leaf.js +101 -0
  4. package/dist/constants/kscript-data-interval-restrictions.constants.d.ts +15 -0
  5. package/dist/constants/kscript-data-interval-restrictions.constants.js +40 -0
  6. package/dist/constants/opra-compliance.constants.d.ts +19 -0
  7. package/dist/constants/opra-compliance.constants.js +19 -0
  8. package/dist/constants/replay-ladder.leaf.d.ts +30 -0
  9. package/dist/constants/replay-ladder.leaf.js +99 -0
  10. package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +133 -0
  11. package/dist/constants/scriptEditor/builtin-script-snippets.js +451 -0
  12. package/dist/constants/scriptEditor/cme-official-scripts.constants.d.ts +168 -0
  13. package/dist/constants/scriptEditor/cme-official-scripts.constants.js +398 -0
  14. package/dist/constants/scriptEditor/converted-script-id.leaf.d.ts +8 -0
  15. package/dist/constants/scriptEditor/converted-script-id.leaf.js +10 -0
  16. package/dist/constants/scriptEditor/execution.constants.d.ts +4 -0
  17. package/dist/constants/scriptEditor/execution.constants.js +14 -0
  18. package/dist/constants/wrun-prefix-safe.constants.d.ts +23 -0
  19. package/dist/constants/wrun-prefix-safe.constants.js +26 -0
  20. package/dist/host-env.d.ts +321 -24
  21. package/dist/host-env.js +15 -0
  22. package/dist/host-ports.types.d.ts +857 -35
  23. package/dist/index.d.ts +149 -2
  24. package/dist/index.js +149 -2
  25. package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +31 -0
  26. package/dist/instances/script-engine-worker-ohlcv-transfer.js +164 -0
  27. package/dist/interfaces/market-event.interface.d.ts +231 -0
  28. package/dist/interfaces/market-event.interface.js +15 -0
  29. package/dist/interfaces/opra-realtime.interface.d.ts +70 -134
  30. package/dist/interfaces/opra-realtime.interface.js +34 -59
  31. package/dist/interfaces/replay.interface.d.ts +285 -0
  32. package/dist/interfaces/replay.interface.js +1 -0
  33. package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +1 -0
  34. package/dist/kscript-data/controls/live-ohlcv-merge.util.js +93 -0
  35. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +5 -1
  36. package/dist/kscript-data/controls/live-trades-merge.util.js +2 -2
  37. package/dist/market-data/billing.interface.d.ts +219 -0
  38. package/dist/market-data/billing.interface.js +58 -0
  39. package/dist/market-data/venue-governed.util.d.ts +2 -0
  40. package/dist/market-data/venue-governed.util.js +10 -0
  41. package/dist/market-data/venue.d.ts +122 -0
  42. package/dist/market-data/venue.js +1 -0
  43. package/dist/market-data/venues/index.d.ts +97 -0
  44. package/dist/market-data/venues/index.js +33 -0
  45. package/dist/market-data/venues/opra.contract.copy.json +35 -0
  46. package/dist/market-data/venues/opra.d.ts +70 -0
  47. package/dist/market-data/venues/opra.js +74 -0
  48. package/dist/replay/replayIndicatorRows.d.ts +31 -0
  49. package/dist/replay/replayIndicatorRows.js +117 -0
  50. package/dist/replay/replayLadder.d.ts +85 -0
  51. package/dist/replay/replayLadder.js +388 -0
  52. package/dist/utility/auth/server-clock.util.d.ts +81 -0
  53. package/dist/utility/auth/server-clock.util.js +238 -0
  54. package/dist/utility/chart/builtin-identity.util.d.ts +18 -0
  55. package/dist/utility/chart/builtin-identity.util.js +51 -0
  56. package/dist/utility/chart/cache-alignment.util.d.ts +454 -0
  57. package/dist/utility/chart/cache-alignment.util.js +926 -0
  58. package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +15 -0
  59. package/dist/utility/chart/chart-data-fetch-generation.util.js +22 -0
  60. package/dist/utility/chart/chart-mount-epoch.util.d.ts +5 -0
  61. package/dist/utility/chart/chart-mount-epoch.util.js +29 -0
  62. package/dist/utility/chart/chart-time-domain.util.d.ts +12 -0
  63. package/dist/utility/chart/chart-time-domain.util.js +23 -0
  64. package/dist/utility/chart/color-customization.leaf.d.ts +10 -0
  65. package/dist/utility/chart/color-customization.leaf.js +16 -0
  66. package/dist/utility/chart/date-labelled-interval.leaf.d.ts +15 -0
  67. package/dist/utility/chart/date-labelled-interval.leaf.js +19 -0
  68. package/dist/utility/chart/footprint-tick-grid.util.d.ts +106 -0
  69. package/dist/utility/chart/footprint-tick-grid.util.js +167 -0
  70. package/dist/utility/chart/gesture-timing.leaf.d.ts +29 -0
  71. package/dist/utility/chart/gesture-timing.leaf.js +29 -0
  72. package/dist/utility/chart/governed-contract-coin.util.d.ts +22 -0
  73. package/dist/utility/chart/governed-contract-coin.util.js +39 -0
  74. package/dist/utility/chart/host-bar-placement.util.d.ts +107 -0
  75. package/dist/utility/chart/host-bar-placement.util.js +447 -0
  76. package/dist/utility/chart/index-host-tier.util.d.ts +31 -0
  77. package/dist/utility/chart/index-host-tier.util.js +118 -0
  78. package/dist/utility/chart/index-mode-admission.util.d.ts +34 -0
  79. package/dist/utility/chart/index-mode-admission.util.js +67 -0
  80. package/dist/utility/chart/indicator-error-message.util.d.ts +35 -0
  81. package/dist/utility/chart/indicator-error-message.util.js +44 -0
  82. package/dist/utility/chart/indicator-run-interval.util.d.ts +130 -0
  83. package/dist/utility/chart/indicator-run-interval.util.js +268 -0
  84. package/dist/utility/chart/kscript-apply-fingerprint.util.d.ts +65 -0
  85. package/dist/utility/chart/kscript-apply-fingerprint.util.js +357 -0
  86. package/dist/utility/chart/kscript-chart-flush.leaf.d.ts +22 -0
  87. package/dist/utility/chart/kscript-chart-flush.leaf.js +13 -0
  88. package/dist/utility/chart/kscript-data-interval-restriction.leaf.d.ts +6 -0
  89. package/dist/utility/chart/kscript-data-interval-restriction.leaf.js +27 -0
  90. package/dist/utility/chart/kscript-integration-decision.leaf.d.ts +89 -0
  91. package/dist/utility/chart/kscript-integration-decision.leaf.js +80 -0
  92. package/dist/utility/chart/kscript-live-coalesce.util.d.ts +76 -0
  93. package/dist/utility/chart/kscript-live-coalesce.util.js +156 -0
  94. package/dist/utility/chart/kscript-live-rest-pace.util.d.ts +34 -0
  95. package/dist/utility/chart/kscript-live-rest-pace.util.js +134 -0
  96. package/dist/utility/chart/kscript-live-source-identity.util.d.ts +98 -0
  97. package/dist/utility/chart/kscript-live-source-identity.util.js +121 -0
  98. package/dist/utility/chart/kscript-mounted-plot-set.leaf.d.ts +48 -0
  99. package/dist/utility/chart/kscript-mounted-plot-set.leaf.js +145 -0
  100. package/dist/utility/chart/kscript-perf-tracker.util.d.ts +243 -0
  101. package/dist/utility/chart/kscript-perf-tracker.util.js +522 -0
  102. package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +43 -0
  103. package/dist/utility/chart/kscript-run-interval-projection.util.js +471 -0
  104. package/dist/utility/chart/kscript-run-result-equality.util.d.ts +38 -0
  105. package/dist/utility/chart/kscript-run-result-equality.util.js +89 -0
  106. package/dist/utility/chart/kscript-settings-revision.leaf.d.ts +2 -0
  107. package/dist/utility/chart/kscript-settings-revision.leaf.js +12 -0
  108. package/dist/utility/chart/kscript-source-degrade.leaf.d.ts +63 -0
  109. package/dist/utility/chart/kscript-source-degrade.leaf.js +68 -0
  110. package/dist/utility/chart/kscript-source-retention.util.d.ts +134 -0
  111. package/dist/utility/chart/kscript-source-retention.util.js +218 -0
  112. package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +57 -0
  113. package/dist/utility/chart/kscript-standin-identity.leaf.js +61 -0
  114. package/dist/utility/chart/kscript-titancharts-preparation.util.d.ts +15 -0
  115. package/dist/utility/chart/kscript-titancharts-preparation.util.js +376 -0
  116. package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +9 -0
  117. package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +130 -0
  118. package/dist/utility/chart/kscript-venue-policy.util.d.ts +217 -0
  119. package/dist/utility/chart/kscript-venue-policy.util.js +324 -0
  120. package/dist/utility/chart/live-cadence.util.d.ts +38 -0
  121. package/dist/utility/chart/live-cadence.util.js +37 -0
  122. package/dist/utility/chart/live-feed-series-match.leaf.d.ts +13 -0
  123. package/dist/utility/chart/live-feed-series-match.leaf.js +21 -0
  124. package/dist/utility/chart/local-engine-self-heal-backoff.util.d.ts +46 -0
  125. package/dist/utility/chart/local-engine-self-heal-backoff.util.js +46 -0
  126. package/dist/utility/chart/local-engine-uninit.leaf.d.ts +21 -0
  127. package/dist/utility/chart/local-engine-uninit.leaf.js +22 -0
  128. package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +62 -0
  129. package/dist/utility/chart/local-kscript-source-revalidation.util.js +123 -0
  130. package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +214 -0
  131. package/dist/utility/chart/local-kscript-warmup-depth.util.js +376 -0
  132. package/dist/utility/chart/local-technical-script-live-apply-coalescer.util.d.ts +85 -0
  133. package/dist/utility/chart/local-technical-script-live-apply-coalescer.util.js +197 -0
  134. package/dist/utility/chart/local-technical-script-range.leaf.d.ts +72 -0
  135. package/dist/utility/chart/local-technical-script-range.leaf.js +126 -0
  136. package/dist/utility/chart/mixed-mode.util.d.ts +167 -0
  137. package/dist/utility/chart/mixed-mode.util.js +139 -0
  138. package/dist/utility/chart/ohlcv-row-readiness.util.d.ts +36 -0
  139. package/dist/utility/chart/ohlcv-row-readiness.util.js +90 -0
  140. package/dist/utility/chart/opra-user-scripts-gate.util.d.ts +19 -0
  141. package/dist/utility/chart/opra-user-scripts-gate.util.js +32 -0
  142. package/dist/utility/chart/overlay-execution-guard-key.leaf.d.ts +8 -0
  143. package/dist/utility/chart/overlay-execution-guard-key.leaf.js +10 -0
  144. package/dist/utility/chart/price-precision.util.d.ts +40 -0
  145. package/dist/utility/chart/price-precision.util.js +70 -0
  146. package/dist/utility/chart/profile-block-size.util.d.ts +64 -0
  147. package/dist/utility/chart/profile-block-size.util.js +141 -0
  148. package/dist/utility/chart/protected-kscript-degenerate-rows.leaf.d.ts +11 -0
  149. package/dist/utility/chart/protected-kscript-degenerate-rows.leaf.js +29 -0
  150. package/dist/utility/chart/protected-kscript-empty-output.util.d.ts +28 -0
  151. package/dist/utility/chart/protected-kscript-empty-output.util.js +84 -0
  152. package/dist/utility/chart/run-interval-unservable.leaf.d.ts +9 -0
  153. package/dist/utility/chart/run-interval-unservable.leaf.js +20 -0
  154. package/dist/utility/chart/run-interval-warmup.leaf.d.ts +19 -0
  155. package/dist/utility/chart/run-interval-warmup.leaf.js +35 -0
  156. package/dist/utility/chart/titan-constants.pin.d.ts +9 -5
  157. package/dist/utility/chart/titan-constants.pin.js +18 -5
  158. package/dist/utility/chart/warmup-backfill-retry.leaf.d.ts +9 -0
  159. package/dist/utility/chart/warmup-backfill-retry.leaf.js +9 -0
  160. package/dist/utility/chart/window-geometry.leaf.d.ts +119 -0
  161. package/dist/utility/chart/window-geometry.leaf.js +391 -0
  162. package/dist/utility/chart/window-owner.leaf.d.ts +19 -0
  163. package/dist/utility/chart/window-owner.leaf.js +24 -0
  164. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +11 -2
  165. package/dist/utility/chart/wrun-bar-session-facts.util.js +10 -3
  166. package/dist/utility/chart/wrun-run-result.util.d.ts +5 -1
  167. package/dist/utility/chart/wrun-run-result.util.js +20 -14
  168. package/dist/utility/common/data-processing.util.d.ts +138 -0
  169. package/dist/utility/common/data-processing.util.js +346 -0
  170. package/dist/utility/common/visible-timeout.util.d.ts +13 -4
  171. package/dist/utility/common/visible-timeout.util.js +23 -8
  172. package/dist/utility/exchange-format.leaf.d.ts +1 -0
  173. package/dist/utility/exchange-format.leaf.js +47 -0
  174. package/dist/utility/html-escape.leaf.d.ts +11 -0
  175. package/dist/utility/html-escape.leaf.js +20 -0
  176. package/dist/utility/market-events/earnings-scope.util.d.ts +60 -0
  177. package/dist/utility/market-events/earnings-scope.util.js +92 -0
  178. package/dist/utility/market-events/market-events.util.d.ts +147 -0
  179. package/dist/utility/market-events/market-events.util.js +392 -0
  180. package/dist/utility/market-events/zoned-clock.util.d.ts +1 -0
  181. package/dist/utility/market-events/zoned-clock.util.js +11 -0
  182. package/dist/utility/options/option-venue-disclosure.util.d.ts +43 -0
  183. package/dist/utility/options/option-venue-disclosure.util.js +56 -0
  184. package/dist/utility/scriptEditor/package-semver.util.d.ts +51 -0
  185. package/dist/utility/scriptEditor/package-semver.util.js +120 -0
  186. package/dist/utility/scriptEditor/temp-script-id.util.d.ts +18 -0
  187. package/dist/utility/scriptEditor/temp-script-id.util.js +25 -0
  188. package/dist/utility/symbol-selection/markets-request-from-symbols.leaf.d.ts +20 -0
  189. package/dist/utility/symbol-selection/markets-request-from-symbols.leaf.js +81 -0
  190. package/dist/utility/v2/governed-tier.leaf.d.ts +103 -0
  191. package/dist/utility/v2/governed-tier.leaf.js +113 -0
  192. package/dist/utility/watchlist/import/import-request.leaf.d.ts +10 -0
  193. package/dist/utility/watchlist/import/import-request.leaf.js +10 -0
  194. package/dist/utility/wrun/sources/lanes/option_daily.d.ts +43 -15
  195. package/dist/utility/wrun/sources/lanes/option_daily.js +78 -20
  196. package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +14 -10
  197. package/dist/utility/wrun/sources/lanes/option_stats_10m.js +5 -4
  198. package/dist/utility/wrun/sources/lanes/series.js +2 -2
  199. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +22 -3
  200. package/dist/utility/wrun/sources/opra-option-lanes.util.js +38 -7
  201. package/dist/utility/wrun/sources/registry.js +31 -1
  202. package/dist/utility/wrun/sources/row-lane-registry.js +5 -5
  203. package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +49 -0
  204. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +75 -20
  205. package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +49 -0
  206. package/dist/utility/wrun/sources/row-lanes/option_strikes.js +57 -47
  207. package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +36 -4
  208. package/dist/utility/wrun/sources/row-lanes/option_surface.js +6 -12
  209. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +37 -3
  210. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +128 -2
  211. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +233 -51
  212. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +0 -8
  213. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +26 -24
  214. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +85 -104
  215. package/dist/utility/wrun/wrun-alert-outputs.registry.d.ts +166 -0
  216. package/dist/utility/wrun/wrun-alert-outputs.registry.js +219 -0
  217. package/dist/utility/wrun/wrun-bar-count.util.d.ts +83 -0
  218. package/dist/utility/wrun/wrun-bar-count.util.js +259 -0
  219. package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +84 -0
  220. package/dist/utility/wrun/wrun-chart-context-names.util.js +186 -0
  221. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +253 -0
  222. package/dist/utility/wrun/wrun-chart-market-facts.util.js +731 -0
  223. package/dist/utility/wrun/wrun-cloud-opra-stamp.util.d.ts +28 -0
  224. package/dist/utility/wrun/wrun-cloud-opra-stamp.util.js +45 -0
  225. package/dist/utility/wrun/wrun-coin-lane-live.util.d.ts +18 -0
  226. package/dist/utility/wrun/wrun-coin-lane-live.util.js +47 -0
  227. package/dist/utility/wrun/wrun-deadline.util.js +2 -1
  228. package/dist/utility/wrun/wrun-debug-output.util.d.ts +39 -0
  229. package/dist/utility/wrun/wrun-debug-output.util.js +63 -0
  230. package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +113 -0
  231. package/dist/utility/wrun/wrun-declared-warmup.util.js +181 -0
  232. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +43 -0
  233. package/dist/utility/wrun/wrun-draft-legend-note.util.js +158 -0
  234. package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +181 -0
  235. package/dist/utility/wrun/wrun-draft-overlay.util.js +357 -0
  236. package/dist/utility/wrun/wrun-draw-skipped.leaf.d.ts +16 -0
  237. package/dist/utility/wrun/wrun-draw-skipped.leaf.js +16 -0
  238. package/dist/utility/wrun/wrun-earnings-facts.util.d.ts +42 -0
  239. package/dist/utility/wrun/wrun-earnings-facts.util.js +131 -0
  240. package/dist/utility/wrun/wrun-first-run-depth.util.d.ts +32 -0
  241. package/dist/utility/wrun/wrun-first-run-depth.util.js +118 -0
  242. package/dist/utility/wrun/wrun-gate-plane-readers.util.d.ts +24 -0
  243. package/dist/utility/wrun/wrun-gate-plane-readers.util.js +31 -0
  244. package/dist/utility/wrun/wrun-held-lanes.util.d.ts +32 -0
  245. package/dist/utility/wrun/wrun-held-lanes.util.js +94 -0
  246. package/dist/utility/wrun/wrun-host-visible-clock.util.d.ts +2 -0
  247. package/dist/utility/wrun/wrun-host-visible-clock.util.js +17 -0
  248. package/dist/utility/wrun/wrun-host.service.d.ts +266 -0
  249. package/dist/utility/wrun/wrun-host.service.js +655 -0
  250. package/dist/utility/wrun/wrun-inert-legend.util.d.ts +33 -0
  251. package/dist/utility/wrun/wrun-inert-legend.util.js +125 -0
  252. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +155 -0
  253. package/dist/utility/wrun/wrun-input-requirements.leaf.js +450 -0
  254. package/dist/utility/wrun/wrun-integration-route.util.d.ts +51 -0
  255. package/dist/utility/wrun/wrun-integration-route.util.js +59 -0
  256. package/dist/utility/wrun/wrun-latest-history.leaf.d.ts +8 -0
  257. package/dist/utility/wrun/wrun-latest-history.leaf.js +8 -0
  258. package/dist/utility/wrun/wrun-legend-hover.lazy.d.ts +12 -0
  259. package/dist/utility/wrun/wrun-legend-hover.lazy.js +96 -0
  260. package/dist/utility/wrun/wrun-lifecycle-runtime.util.d.ts +21 -0
  261. package/dist/utility/wrun/wrun-lifecycle-runtime.util.js +21 -0
  262. package/dist/utility/wrun/wrun-live-hidden-hold.util.d.ts +23 -0
  263. package/dist/utility/wrun/wrun-live-hidden-hold.util.js +13 -0
  264. package/dist/utility/wrun/wrun-live-intake.util.d.ts +374 -0
  265. package/dist/utility/wrun/wrun-live-intake.util.js +2027 -0
  266. package/dist/utility/wrun/wrun-live-patch.util.d.ts +116 -0
  267. package/dist/utility/wrun/wrun-live-patch.util.js +523 -0
  268. package/dist/utility/wrun/wrun-live-tick.util.d.ts +619 -0
  269. package/dist/utility/wrun/wrun-live-tick.util.js +4974 -0
  270. package/dist/utility/wrun/wrun-loading-owner.util.d.ts +58 -0
  271. package/dist/utility/wrun/wrun-loading-owner.util.js +89 -0
  272. package/dist/utility/wrun/wrun-official-scope.leaf.d.ts +29 -0
  273. package/dist/utility/wrun/wrun-official-scope.leaf.js +36 -0
  274. package/dist/utility/wrun/wrun-oi-lane.util.d.ts +27 -0
  275. package/dist/utility/wrun/wrun-oi-lane.util.js +42 -0
  276. package/dist/utility/wrun/wrun-opra-stats.leaf.d.ts +29 -10
  277. package/dist/utility/wrun/wrun-opra-stats.leaf.js +29 -10
  278. package/dist/utility/wrun/wrun-options-stop.util.d.ts +52 -0
  279. package/dist/utility/wrun/wrun-options-stop.util.js +123 -0
  280. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +719 -0
  281. package/dist/utility/wrun/wrun-overlay-drivers.util.js +1180 -0
  282. package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.d.ts +50 -0
  283. package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.js +131 -0
  284. package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +118 -0
  285. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +466 -0
  286. package/dist/utility/wrun/wrun-overlay-metadata.util.d.ts +45 -0
  287. package/dist/utility/wrun/wrun-overlay-metadata.util.js +112 -0
  288. package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +114 -0
  289. package/dist/utility/wrun/wrun-overlay-recovery.util.js +971 -0
  290. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +858 -0
  291. package/dist/utility/wrun/wrun-overlay-run.util.js +11013 -0
  292. package/dist/utility/wrun/wrun-panel-mount.lazy.d.ts +10 -0
  293. package/dist/utility/wrun/wrun-panel-mount.lazy.js +68 -0
  294. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +392 -0
  295. package/dist/utility/wrun/wrun-panel-mount.util.js +2346 -0
  296. package/dist/utility/wrun/wrun-param-map.util.d.ts +19 -4
  297. package/dist/utility/wrun/wrun-param-map.util.js +40 -47
  298. package/dist/utility/wrun/wrun-param-values.util.d.ts +9 -3
  299. package/dist/utility/wrun/wrun-param-values.util.js +5 -5
  300. package/dist/utility/wrun/wrun-pause-dim.util.d.ts +52 -0
  301. package/dist/utility/wrun/wrun-pause-dim.util.js +153 -0
  302. package/dist/utility/wrun/wrun-plot-gate.types.d.ts +23 -0
  303. package/dist/utility/wrun/wrun-plot-gate.types.js +7 -0
  304. package/dist/utility/wrun/wrun-prefix-cohort.util.d.ts +93 -0
  305. package/dist/utility/wrun/wrun-prefix-cohort.util.js +484 -0
  306. package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +114 -0
  307. package/dist/utility/wrun/wrun-prefix-lanes.util.js +486 -0
  308. package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +317 -0
  309. package/dist/utility/wrun/wrun-prefix-proof.util.js +630 -0
  310. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +73 -0
  311. package/dist/utility/wrun/wrun-refusal-surface.util.js +380 -0
  312. package/dist/utility/wrun/wrun-refusal-text.util.d.ts +15 -0
  313. package/dist/utility/wrun/wrun-refusal-text.util.js +40 -0
  314. package/dist/utility/wrun/wrun-replay-lane.util.d.ts +139 -0
  315. package/dist/utility/wrun/wrun-replay-lane.util.js +520 -0
  316. package/dist/utility/wrun/wrun-replay-rows.util.d.ts +21 -0
  317. package/dist/utility/wrun/wrun-replay-rows.util.js +172 -0
  318. package/dist/utility/wrun/wrun-row-source-factory.d.ts +53 -0
  319. package/dist/utility/wrun/wrun-row-source-factory.js +435 -0
  320. package/dist/utility/wrun/wrun-run-cells.util.d.ts +36 -0
  321. package/dist/utility/wrun/wrun-run-cells.util.js +46 -0
  322. package/dist/utility/wrun/wrun-run-interval-projection.types.d.ts +14 -0
  323. package/dist/utility/wrun/wrun-run-interval-projection.types.js +1 -0
  324. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +133 -0
  325. package/dist/utility/wrun/wrun-run-interval-session.util.js +121 -0
  326. package/dist/utility/wrun/wrun-run-interval.util.d.ts +98 -0
  327. package/dist/utility/wrun/wrun-run-interval.util.js +207 -0
  328. package/dist/utility/wrun/wrun-run-retained.util.d.ts +122 -0
  329. package/dist/utility/wrun/wrun-run-retained.util.js +255 -0
  330. package/dist/utility/wrun/wrun-sandbox-row-source.d.ts +184 -0
  331. package/dist/utility/wrun/wrun-sandbox-row-source.js +444 -0
  332. package/dist/utility/wrun/wrun-script-inputs.util.js +4 -4
  333. package/dist/utility/wrun/wrun-series-stream.util.d.ts +86 -0
  334. package/dist/utility/wrun/wrun-series-stream.util.js +537 -0
  335. package/dist/utility/wrun/wrun-sheet-remembered.util.d.ts +21 -0
  336. package/dist/utility/wrun/wrun-sheet-remembered.util.js +36 -0
  337. package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.d.ts +7 -0
  338. package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.js +12 -0
  339. package/dist/utility/wrun/wrun-socket-row-source.js +4 -2
  340. package/dist/utility/wrun/wrun-source-rows.util.d.ts +175 -3
  341. package/dist/utility/wrun/wrun-source-rows.util.js +294 -8
  342. package/dist/utility/wrun/wrun-stats-strip.util.d.ts +46 -0
  343. package/dist/utility/wrun/wrun-stats-strip.util.js +87 -0
  344. package/dist/utility/wrun/wrun-table-chrome.util.d.ts +163 -0
  345. package/dist/utility/wrun/wrun-table-chrome.util.js +557 -0
  346. package/dist/utility/wrun/wrun-text-params.util.d.ts +11 -6
  347. package/dist/utility/wrun/wrun-text-params.util.js +19 -30
  348. package/dist/utility/wrun/wrun-transient-rerun.util.d.ts +64 -0
  349. package/dist/utility/wrun/wrun-transient-rerun.util.js +317 -0
  350. package/dist/utility/wrun/wrun-twin-lookback.util.d.ts +10 -0
  351. package/dist/utility/wrun/wrun-twin-lookback.util.js +43 -0
  352. package/dist/utility/wrun/wrun-warmup-head-store.util.d.ts +41 -0
  353. package/dist/utility/wrun/wrun-warmup-head-store.util.js +120 -0
  354. package/dist/utility/wrun-alert-params.leaf.d.ts +24 -0
  355. package/dist/utility/wrun-alert-params.leaf.js +24 -0
  356. package/dist/utils/replay/replay-buffer-math.d.ts +148 -0
  357. package/dist/utils/replay/replay-buffer-math.js +684 -0
  358. package/dist/workers/wrun/wrun-abi-host.d.ts +190 -0
  359. package/dist/workers/wrun/wrun-abi-host.js +1201 -0
  360. package/dist/workers/wrun/wrun-engine-handler.d.ts +37 -0
  361. package/dist/workers/wrun/wrun-engine-handler.js +211 -0
  362. package/package.json +3 -3
@@ -0,0 +1,36 @@
1
+ /**
2
+ * The run allocation bound of the browser worker (WRUN-BATCHED-MARKS round 2, fold 4): a run block
3
+ * holds one f64 cell per row and declared output (`rowCount x outputCount`, the packed outputs the
4
+ * worker answers), allocated in one buffer before any row is evaluated. A batched section multiplies
5
+ * the outputs a sheet declares (Big Trades 0.4.0: 97 of them), so the worker checks the product
6
+ * BEFORE the buffer and refuses a run past `WRUN_MAX_RUN_CELLS` by name (`wrun_run_cells_too_large`,
7
+ * a refusal of the kit's vocabulary and of the chart's refusal table, run-failure-props.util). The
8
+ * mounted budget of the batched children (2,000,000 cells, overlay-execution-guard) is the chart's
9
+ * second bound, over what stays mounted.
10
+ *
11
+ * The main thread never sends a block past the bound (WRUN-MARKS-CONTRACT design 5): the run's
12
+ * retained range (wrun-run-retained.util) asks the newest `wrunRunCellsRows(outputCount)` rows at
13
+ * most, so the refusal is the backstop of a request the planner did not size.
14
+ *
15
+ * Imports nothing: the worker host (wrun-abi-host) reads it, and the main thread names the refusal.
16
+ */
17
+ /** The largest `rowCount x outputCount` one run block may allocate (32 MB of f64 cells). */
18
+ export declare const WRUN_MAX_RUN_CELLS = 4000000;
19
+ /** The refusal names the run allocation raises (a code of the kit's refusal table). */
20
+ export declare const WRUN_RUN_CELLS_REFUSALS: {
21
+ /** A run block whose rows times declared outputs pass WRUN_MAX_RUN_CELLS. */
22
+ readonly tooLarge: "wrun_run_cells_too_large";
23
+ };
24
+ /**
25
+ * The most rows one run block of `outputCount` declared outputs may hold under WRUN_MAX_RUN_CELLS:
26
+ * `floor(WRUN_MAX_RUN_CELLS / outputCount)` (Big Trades 0.4.0, 97 outputs: 41,237 rows). Null for a
27
+ * run that declares no outputs (a frame-only run allocates no cells) and for a count that is not a
28
+ * positive finite number.
29
+ */
30
+ export declare function wrunRunCellsRows(outputCount: number): number | null;
31
+ /**
32
+ * The words a run block of `rowCount` rows and `outputCount` declared outputs refuses with, named by
33
+ * `wrun_run_cells_too_large`; null when the block's cells fit WRUN_MAX_RUN_CELLS. A count that is not
34
+ * a finite number refuses too: its allocation could not be checked.
35
+ */
36
+ export declare function wrunRunCellsRefusal(rowCount: number, outputCount: number): string | null;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The run allocation bound of the browser worker (WRUN-BATCHED-MARKS round 2, fold 4): a run block
3
+ * holds one f64 cell per row and declared output (`rowCount x outputCount`, the packed outputs the
4
+ * worker answers), allocated in one buffer before any row is evaluated. A batched section multiplies
5
+ * the outputs a sheet declares (Big Trades 0.4.0: 97 of them), so the worker checks the product
6
+ * BEFORE the buffer and refuses a run past `WRUN_MAX_RUN_CELLS` by name (`wrun_run_cells_too_large`,
7
+ * a refusal of the kit's vocabulary and of the chart's refusal table, run-failure-props.util). The
8
+ * mounted budget of the batched children (2,000,000 cells, overlay-execution-guard) is the chart's
9
+ * second bound, over what stays mounted.
10
+ *
11
+ * The main thread never sends a block past the bound (WRUN-MARKS-CONTRACT design 5): the run's
12
+ * retained range (wrun-run-retained.util) asks the newest `wrunRunCellsRows(outputCount)` rows at
13
+ * most, so the refusal is the backstop of a request the planner did not size.
14
+ *
15
+ * Imports nothing: the worker host (wrun-abi-host) reads it, and the main thread names the refusal.
16
+ */
17
+ /** The largest `rowCount x outputCount` one run block may allocate (32 MB of f64 cells). */
18
+ export const WRUN_MAX_RUN_CELLS = 4_000_000;
19
+ /** The refusal names the run allocation raises (a code of the kit's refusal table). */
20
+ export const WRUN_RUN_CELLS_REFUSALS = {
21
+ /** A run block whose rows times declared outputs pass WRUN_MAX_RUN_CELLS. */
22
+ tooLarge: 'wrun_run_cells_too_large',
23
+ };
24
+ /**
25
+ * The most rows one run block of `outputCount` declared outputs may hold under WRUN_MAX_RUN_CELLS:
26
+ * `floor(WRUN_MAX_RUN_CELLS / outputCount)` (Big Trades 0.4.0, 97 outputs: 41,237 rows). Null for a
27
+ * run that declares no outputs (a frame-only run allocates no cells) and for a count that is not a
28
+ * positive finite number.
29
+ */
30
+ export function wrunRunCellsRows(outputCount) {
31
+ if (!Number.isFinite(outputCount) || outputCount <= 0)
32
+ return null;
33
+ return Math.floor(WRUN_MAX_RUN_CELLS / outputCount);
34
+ }
35
+ /**
36
+ * The words a run block of `rowCount` rows and `outputCount` declared outputs refuses with, named by
37
+ * `wrun_run_cells_too_large`; null when the block's cells fit WRUN_MAX_RUN_CELLS. A count that is not
38
+ * a finite number refuses too: its allocation could not be checked.
39
+ */
40
+ export function wrunRunCellsRefusal(rowCount, outputCount) {
41
+ const cells = rowCount * outputCount;
42
+ if (Number.isFinite(cells) && cells <= WRUN_MAX_RUN_CELLS)
43
+ return null;
44
+ return (`WRUN ${WRUN_RUN_CELLS_REFUSALS.tooLarge}: this run holds ${rowCount} rows x ${outputCount} outputs = ` +
45
+ `${cells} cells, over the ${WRUN_MAX_RUN_CELLS} a run may allocate; load a shorter range or declare fewer outputs`);
46
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The run-interval projection type of wrun-run-interval-session.util.ts (which re-exports it and builds one per run,
3
+ * `wrunRunIntervalProjectionOf`) as a type leaf: the child mount (wrun-panel-mount.util) hands it to the series
4
+ * child's integrate, and it moves into the wrun chart-host package, which the session's live context
5
+ * (wrun-overlay-drivers.util) and run-interval engine may not reach.
6
+ */
7
+ import type { OverlayRunInterval } from '../chart/indicator-run-interval.util.js';
8
+ /** What the kScript adapter's run-interval projection reads off a wrun integrate
9
+ * (kscript-titancharts-integration.util): the result's stamp, the chart and its venue. */
10
+ export interface WrunRunIntervalProjection {
11
+ runInterval: OverlayRunInterval;
12
+ chartIndex: number;
13
+ chartExchange?: string;
14
+ }
@@ -0,0 +1,133 @@
1
+ /**
2
+ * The session half of a wrun run at another interval (WRUN-HTF-NATIVE-PLAN.md 3.2 to 3.4): what a
3
+ * live session whose package computes at its run interval X (wrun-run-interval.util) keeps beside
4
+ * its live context, and the pure rules the full run, the reseed, the live intake and the live tick
5
+ * share.
6
+ *
7
+ * - The session's primary rows are its run bars: the X candles the full run fetched with their
8
+ * warm-up (or reused from the previous session, planWrunRunIntervalRows), never the chart's
9
+ * candles. The live intake folds the chart market's candle frames into the forming run bar, the
10
+ * tick's reconcile re-asks the newest run bars, the reseed rebuilds from them.
11
+ * - Wait for close on, the package computes on the closed run bars only (the forming one waits in
12
+ * the buffer until the chart shows a bar past it, wrunRunIntervalComputeRows): inside the
13
+ * forming bucket a tick only re-applies the held result, the roll computes the bar that closed.
14
+ * Off, the forming run bar is computed on every tick.
15
+ * - `run` is the stamp the full run read once: the projection, the HUD snapshot and every tick of
16
+ * the session read it, never the overlay's current settings.
17
+ * - The chart clock stays beside it: the history check keys on the chart's first bar, the plan
18
+ * clock on the chart's newest bar.
19
+ * - Every rule reads a run bar's open and close by runBarSpan (indicator-run-interval.util): on the
20
+ * CME session lattice (`run.sessionLattice`) a 1D or 1W run bar is stamped 00:00Z after its own
21
+ * evening open, so its stamp is neither its open nor a whole interval before its close.
22
+ *
23
+ * Kept beside the context object (the full run installs a new context per run, so the state goes
24
+ * with the one it was built for), like the session's chart names (wrun-chart-context-names.util).
25
+ */
26
+ import { type OverlayRunInterval, type RunBarCalendar } from '../chart/indicator-run-interval.util.js';
27
+ import type { WrunRunInterval } from './wrun-run-interval.util.js';
28
+ import type { WrunRunIntervalProjection } from './wrun-run-interval-projection.types.js';
29
+ export type { WrunRunIntervalProjection };
30
+ /** The intake queue key the chart market's candle frames ride for a session at another interval
31
+ * (beside the grid legs' queues, never a leg's fetch key). */
32
+ export declare const WRUN_RUN_INTERVAL_ROWS_KEY = "run-interval|main";
33
+ export interface WrunRunIntervalSession {
34
+ /** The run interval the session computes at, as the full run read it. */
35
+ run: WrunRunInterval;
36
+ /** Identity of the run bars (wrunRunIntervalCoverageKey): the run interval and the chart market. */
37
+ key: string;
38
+ /** The chart's own interval in ms (the chart clock beside the run clock). */
39
+ chartIntervalMs: number;
40
+ /** The chart's first loaded bar the session was built over: a chart whose first bar moved
41
+ * rebuilds (a lazy page, a shed head), whatever the run bars hold. */
42
+ chartFirstTs: number;
43
+ /** The start the run bars were asked from (the warm-up's first run bar): what the buffer covers
44
+ * even when the market's history starts later. */
45
+ coveredFromTs: number;
46
+ /** The end of the last window an ask answered for the run bars (the full run's, then each
47
+ * reconcile's); a failed re-ask leaves it behind and the next window reaches back to it. */
48
+ coveredThroughTs: number;
49
+ /** The run bars [ts, open, high, low, close, volume], ascending, the forming one included:
50
+ * replaced (never mutated) by every fold and every reconcile merge. */
51
+ rows: ArrayLike<number>[];
52
+ /** The newest trade stamp (ms) a live candle frame folded into `rows`: a replayed frame at or
53
+ * before it re-sends increments the fold already holds. */
54
+ newestTradeStampMs?: number;
55
+ /** The input row the package last evaluated as its newest (the full run's, the reseed's, each
56
+ * block's): with wait for close on, a block that would re-send it unchanged computes nothing. */
57
+ lastSentRow?: {
58
+ ts: number;
59
+ values: number[];
60
+ };
61
+ }
62
+ /** Store the run-interval state of a live context (the full run, right after it installs it). */
63
+ export declare function rememberWrunRunIntervalSession(context: object, session: WrunRunIntervalSession): void;
64
+ /** The run-interval state of a live context; undefined for a session on the chart's own bars. */
65
+ export declare function wrunRunIntervalSessionOf(context: object | undefined): WrunRunIntervalSession | undefined;
66
+ /** The run interval in ms the overlay's live session computes at, undefined when it computes on
67
+ * the chart's bars (or holds no session): the bucket a rider's rows are floored on. */
68
+ export declare function wrunLiveRunIntervalMs(indicatorId: string): number | undefined;
69
+ /** The identity of the run bars a session holds: the run interval and the chart market they were
70
+ * fetched for (exchange, symbol, transformations), never the chart's own interval. */
71
+ export declare function wrunRunIntervalCoverageKey(run: Pick<OverlayRunInterval, 'interval'>, market: {
72
+ exchange?: unknown;
73
+ symbol?: unknown;
74
+ transformations?: unknown;
75
+ } | null | undefined): string;
76
+ /** The run bars open at or before the chart's newest bar: a frame or an answer may hold the next
77
+ * bucket before the chart shows a bar in it. A bar opens at its stamp, on the session lattice at
78
+ * its session open (a CME trade date is stamped after its own evening bars, and its forming bar
79
+ * passes from that open on). The same array when every row passes. */
80
+ export declare function wrunRunIntervalRowsThrough(run: RunBarCalendar, rows: ReadonlyArray<ArrayLike<number>>, lastChartTs: number): ArrayLike<number>[];
81
+ /**
82
+ * The run bars a session computes over at the chart's newest bar. Wait for close on: the closed
83
+ * ones only (a run bar closes once the chart shows a bar at or past its close), so every output the
84
+ * package draws as of its newest bar (a projected cloud, a zone, a label) is the last closed bar's,
85
+ * like its lines on the forming bucket's chart bars; the forming bar stays in the buffer until it
86
+ * closes. Off: the forming bar too (the chart bars of its bucket show it).
87
+ */
88
+ export declare function wrunRunIntervalComputeRows(run: Pick<OverlayRunInterval, 'intervalMs' | 'waitForClose' | 'sessionLattice'>, rows: ReadonlyArray<ArrayLike<number>>, lastChartTs: number): ArrayLike<number>[];
89
+ /** The input row a session last evaluated as its newest, copied (wrunRunIntervalSession.lastSentRow). */
90
+ export declare function wrunRunIntervalSentRow(row: {
91
+ ts: number;
92
+ values: ArrayLike<number>;
93
+ }): {
94
+ ts: number;
95
+ values: number[];
96
+ };
97
+ export interface WrunRunIntervalRowsPlan {
98
+ /** The start the run bars are asked from, or were (held). */
99
+ fromTs: number;
100
+ /** The previous session's run bars when they still cover the chart and its full warm-up: the run
101
+ * recomputes over them and fetches nothing. */
102
+ held?: ArrayLike<number>[];
103
+ /** With `held`, what the next session inherits from the held one: its covered watermark (a failed
104
+ * re-ask's obligation, which the next reconcile reaches back to) and the newest trade its fold
105
+ * took (a replayed frame at or before it re-sends trades the bars hold). */
106
+ carry?: {
107
+ coveredThroughTs: number;
108
+ newestTradeStampMs?: number;
109
+ };
110
+ }
111
+ /**
112
+ * Which run bars one full run computes over (run-interval-engine.util's planRunIntervalRefresh
113
+ * rule, on the session's buffer): the previous session's run bars when they are the same run
114
+ * interval on the same market (`key`), were asked from at or before the warm-up the chart's first
115
+ * bar needs (`warmupBars` run bars below the run bar holding it), hold the run bar of the chart's
116
+ * newest bar (one still open there: its close past it) and hold no bar stamped past their coverage
117
+ * (the ask windows' end, read on stamps; the intake extends the forming bar it opened at the
118
+ * coverage end; a bar further on, appended after a failed or missed window, may stand past a hole
119
+ * no answer filled); else a fetch from that warm-up start. Without the warm-up term, consecutive
120
+ * prepended pages would erode the warm-up toward zero run bars. Every full run passes here (a lazy
121
+ * page, a settings save, a live rebuild), so a style edit or a pan inside the held warm-up reuses
122
+ * the bars while another timeframe (a new key) or a raised lookback (an earlier start) refetches.
123
+ * The live reconcile right after the run refreshes the newest run bars either way.
124
+ */
125
+ export declare function planWrunRunIntervalRows(input: {
126
+ run: WrunRunInterval;
127
+ key: string;
128
+ chartFirstTs: number;
129
+ chartLastTs: number;
130
+ held: WrunRunIntervalSession | undefined;
131
+ }): WrunRunIntervalRowsPlan;
132
+ /** The projection a run's integrates pass: its stamp on its chart. */
133
+ export declare function wrunRunIntervalProjectionOf(run: OverlayRunInterval, chartIndex: number, chartExchange: unknown): WrunRunIntervalProjection;
@@ -0,0 +1,121 @@
1
+ /**
2
+ * The session half of a wrun run at another interval (WRUN-HTF-NATIVE-PLAN.md 3.2 to 3.4): what a
3
+ * live session whose package computes at its run interval X (wrun-run-interval.util) keeps beside
4
+ * its live context, and the pure rules the full run, the reseed, the live intake and the live tick
5
+ * share.
6
+ *
7
+ * - The session's primary rows are its run bars: the X candles the full run fetched with their
8
+ * warm-up (or reused from the previous session, planWrunRunIntervalRows), never the chart's
9
+ * candles. The live intake folds the chart market's candle frames into the forming run bar, the
10
+ * tick's reconcile re-asks the newest run bars, the reseed rebuilds from them.
11
+ * - Wait for close on, the package computes on the closed run bars only (the forming one waits in
12
+ * the buffer until the chart shows a bar past it, wrunRunIntervalComputeRows): inside the
13
+ * forming bucket a tick only re-applies the held result, the roll computes the bar that closed.
14
+ * Off, the forming run bar is computed on every tick.
15
+ * - `run` is the stamp the full run read once: the projection, the HUD snapshot and every tick of
16
+ * the session read it, never the overlay's current settings.
17
+ * - The chart clock stays beside it: the history check keys on the chart's first bar, the plan
18
+ * clock on the chart's newest bar.
19
+ * - Every rule reads a run bar's open and close by runBarSpan (indicator-run-interval.util): on the
20
+ * CME session lattice (`run.sessionLattice`) a 1D or 1W run bar is stamped 00:00Z after its own
21
+ * evening open, so its stamp is neither its open nor a whole interval before its close.
22
+ *
23
+ * Kept beside the context object (the full run installs a new context per run, so the state goes
24
+ * with the one it was built for), like the session's chart names (wrun-chart-context-names.util).
25
+ */
26
+ import { runBarSpan } from '../chart/indicator-run-interval.util.js';
27
+ import { runIntervalWarmupStartTs } from '../chart/run-interval-warmup.leaf.js';
28
+ import { getWrunOverlayLiveContext } from './wrun-overlay-drivers.util.js';
29
+ /** The intake queue key the chart market's candle frames ride for a session at another interval
30
+ * (beside the grid legs' queues, never a leg's fetch key). */
31
+ export const WRUN_RUN_INTERVAL_ROWS_KEY = 'run-interval|main';
32
+ const sessions = new WeakMap();
33
+ /** Store the run-interval state of a live context (the full run, right after it installs it). */
34
+ export function rememberWrunRunIntervalSession(context, session) {
35
+ sessions.set(context, session);
36
+ }
37
+ /** The run-interval state of a live context; undefined for a session on the chart's own bars. */
38
+ export function wrunRunIntervalSessionOf(context) {
39
+ return context === undefined ? undefined : sessions.get(context);
40
+ }
41
+ /** The run interval in ms the overlay's live session computes at, undefined when it computes on
42
+ * the chart's bars (or holds no session): the bucket a rider's rows are floored on. */
43
+ export function wrunLiveRunIntervalMs(indicatorId) {
44
+ return wrunRunIntervalSessionOf(getWrunOverlayLiveContext(indicatorId))?.run.intervalMs;
45
+ }
46
+ /** The identity of the run bars a session holds: the run interval and the chart market they were
47
+ * fetched for (exchange, symbol, transformations), never the chart's own interval. */
48
+ export function wrunRunIntervalCoverageKey(run, market) {
49
+ return [run.interval, market?.exchange, market?.symbol, market?.transformations]
50
+ .map((part) => (part === undefined || part === null ? '' : String(part)))
51
+ .join('|');
52
+ }
53
+ /** The run bars open at or before the chart's newest bar: a frame or an answer may hold the next
54
+ * bucket before the chart shows a bar in it. A bar opens at its stamp, on the session lattice at
55
+ * its session open (a CME trade date is stamped after its own evening bars, and its forming bar
56
+ * passes from that open on). The same array when every row passes. */
57
+ export function wrunRunIntervalRowsThrough(run, rows, lastChartTs) {
58
+ let end = rows.length;
59
+ while (end > 0 && !(runBarSpan(Number(rows[end - 1][0]), run).open <= lastChartTs))
60
+ end -= 1;
61
+ return end === rows.length ? rows : rows.slice(0, end);
62
+ }
63
+ /**
64
+ * The run bars a session computes over at the chart's newest bar. Wait for close on: the closed
65
+ * ones only (a run bar closes once the chart shows a bar at or past its close), so every output the
66
+ * package draws as of its newest bar (a projected cloud, a zone, a label) is the last closed bar's,
67
+ * like its lines on the forming bucket's chart bars; the forming bar stays in the buffer until it
68
+ * closes. Off: the forming bar too (the chart bars of its bucket show it).
69
+ */
70
+ export function wrunRunIntervalComputeRows(run, rows, lastChartTs) {
71
+ if (!run.waitForClose)
72
+ return wrunRunIntervalRowsThrough(run, rows, lastChartTs);
73
+ let end = rows.length;
74
+ while (end > 0 && !(runBarSpan(Number(rows[end - 1][0]), run).close <= lastChartTs))
75
+ end -= 1;
76
+ return end === rows.length ? rows : rows.slice(0, end);
77
+ }
78
+ /** The input row a session last evaluated as its newest, copied (wrunRunIntervalSession.lastSentRow). */
79
+ export function wrunRunIntervalSentRow(row) {
80
+ return { ts: row.ts, values: Array.from(row.values) };
81
+ }
82
+ /**
83
+ * Which run bars one full run computes over (run-interval-engine.util's planRunIntervalRefresh
84
+ * rule, on the session's buffer): the previous session's run bars when they are the same run
85
+ * interval on the same market (`key`), were asked from at or before the warm-up the chart's first
86
+ * bar needs (`warmupBars` run bars below the run bar holding it), hold the run bar of the chart's
87
+ * newest bar (one still open there: its close past it) and hold no bar stamped past their coverage
88
+ * (the ask windows' end, read on stamps; the intake extends the forming bar it opened at the
89
+ * coverage end; a bar further on, appended after a failed or missed window, may stand past a hole
90
+ * no answer filled); else a fetch from that warm-up start. Without the warm-up term, consecutive
91
+ * prepended pages would erode the warm-up toward zero run bars. Every full run passes here (a lazy
92
+ * page, a settings save, a live rebuild), so a style edit or a pan inside the held warm-up reuses
93
+ * the bars while another timeframe (a new key) or a raised lookback (an earlier start) refetches.
94
+ * The live reconcile right after the run refreshes the newest run bars either way.
95
+ */
96
+ export function planWrunRunIntervalRows(input) {
97
+ const { run, held } = input;
98
+ const fromTs = runIntervalWarmupStartTs(input.chartFirstTs, run.intervalMs, run.warmupBars);
99
+ if (held === undefined || held.key !== input.key || held.coveredFromTs > fromTs)
100
+ return { fromTs };
101
+ const rows = wrunRunIntervalRowsThrough(run, held.rows, input.chartLastTs);
102
+ const newestTs = rows.length > 0 ? Number(rows[rows.length - 1][0]) : Number.NaN;
103
+ if (!(runBarSpan(newestTs, run).close > input.chartLastTs) || newestTs > held.coveredThroughTs)
104
+ return { fromTs };
105
+ return {
106
+ fromTs: held.coveredFromTs,
107
+ held: rows,
108
+ carry: {
109
+ coveredThroughTs: held.coveredThroughTs,
110
+ ...(held.newestTradeStampMs !== undefined ? { newestTradeStampMs: held.newestTradeStampMs } : {}),
111
+ },
112
+ };
113
+ }
114
+ /** The projection a run's integrates pass: its stamp on its chart. */
115
+ export function wrunRunIntervalProjectionOf(run, chartIndex, chartExchange) {
116
+ return {
117
+ runInterval: run,
118
+ chartIndex,
119
+ ...(typeof chartExchange === 'string' ? { chartExchange } : {}),
120
+ };
121
+ }
@@ -0,0 +1,98 @@
1
+ import { type OverlayRunInterval } from '../chart/indicator-run-interval.util.js';
2
+ /** The param a twin selects its timeframe with, and the one that says whether to wait for closes. */
3
+ export declare const WRUN_TIMEFRAME_PARAM = "timeframe";
4
+ export declare const WRUN_WAIT_FOR_CLOSE_PARAM = "wait_for_close";
5
+ /** The twins' timeframe option labels by option value (index), the fallback when the overlay's
6
+ * persisted `scriptInputs` carry none. Index 0 is the chart's own interval. */
7
+ export declare const WRUN_TWIN_TIMEFRAME_LABELS: readonly string[];
8
+ /** The option value of the chart path, the value the host forces for a run at another interval. */
9
+ export declare const WRUN_TIMEFRAME_CHART_VALUE = "0";
10
+ type TwinSettings = Record<string, unknown>;
11
+ /**
12
+ * The proven twins whose `timeframe` runs at its own interval, each with the lookback (in run bars)
13
+ * its current settings need before a value settles: the warm-up is runIntervalWarmupBars of it
14
+ * (max(300, 16 x lookback), capped). Param names are the ports' (WRUN-OFFICIAL-PORTS
15
+ * ports/<name>/src/gen/params.ts at the proven 0.3.0); a cumulative or path-dependent twin (ADL,
16
+ * OBV, PSAR) reads 0, the warm-up floor. The staples' twins (WRUN-PARITY-REST A3, their proven
17
+ * sheets' params) take their built-in's lookback term for term: the declared window inputs where
18
+ * the declaration is right (ATR, CMF, Momentum, ROC, the Awesome Oscillator's longer SMA),
19
+ * NATIVE_RUN_INTERVAL_LOOKBACK_BARS where it misses a term (the offset of Donchian, WMA and VWMA,
20
+ * Hull's outer average, the input the pass does not trace into atr(), wpr() and highestbars(),
21
+ * Keltner's ATR bands, the Stochastic RSI's chain).
22
+ */
23
+ export declare const WRUN_RUN_INTERVAL_TWINS: Readonly<Record<string, (settings: TwinSettings) => number>>;
24
+ /**
25
+ * The lookback a proven twin's current settings need before a value settles, in bars of the
26
+ * interval it runs at (WRUN_RUN_INTERVAL_TWINS), null for any other overlay (a twin outside the
27
+ * table, an authored Indicator): the run-interval warm-up sizes from it, and a run on the chart's
28
+ * own bars hands it to the warm-up ask as the declared lookback (local-kscript-warmup-backfill-ask.util).
29
+ */
30
+ export declare function wrunTwinLookbackBars(settings: unknown): number | null;
31
+ /** A wrun overlay's run interval: the kScript shape plus the warm-up its settings need, in run bars. */
32
+ export interface WrunRunInterval extends OverlayRunInterval {
33
+ warmupBars: number;
34
+ }
35
+ export interface WrunRunIntervalInput {
36
+ /** The overlay's settings: params flat under their names, `builtinTwinOf`, `scriptInputs`. */
37
+ settings: unknown;
38
+ /** The chart's interval, as a key ("5m") or milliseconds. */
39
+ chartInterval: unknown;
40
+ /** Market replay keeps the package's own path. */
41
+ replay?: boolean;
42
+ /** An index-mode chart (forex, equities, DEX) keeps the package's own path. */
43
+ indexMode?: boolean;
44
+ /**
45
+ * A market whose run bars one candle ask at the chart's venue and symbol cannot reproduce keeps the
46
+ * package's own path: a formula chart (several legs) or a prediction market (event-sparse candles
47
+ * the chart's own request gap-fills). A CME-family venue runs at its interval (its run bars ride
48
+ * the session lattice: OverlayRunInterval.sessionLattice).
49
+ */
50
+ unsupportedMarket?: boolean;
51
+ }
52
+ /** The label of the timeframe option a twin's settings select: through its persisted select's
53
+ * `optionLabels`, else the twins' fixed list. Undefined when unreadable. */
54
+ export declare function wrunTimeframeLabel(settings: unknown): string | undefined;
55
+ /**
56
+ * Whether a proven twin's Timeframe selects the chart's own interval or a finer one. Such a
57
+ * selection means "chart" for its built-in (timeframeIsChartOrFiner: the engine sees
58
+ * `timeframe: "chart"`, chartIntervalEngineMetadata), so the twin's package must compute its plain
59
+ * chart path too, its Timeframe forced to the chart option in the init args
60
+ * (wrunSettingsForRunInterval): its selected-timeframe branch shows each bar one closed bar late at
61
+ * the chart's interval and refuses (or draws nothing) below it. Read the built-in's way: every
62
+ * proven twin (`builtinTwinOf`), listed in WRUN_RUN_INTERVAL_TWINS or not, on replay, index mode and
63
+ * the unsupported markets alike; an authored Indicator's own `timeframe` param is its author's.
64
+ */
65
+ export declare function wrunTimeframeIsChartOrFiner(settings: unknown, chartInterval: unknown): boolean;
66
+ /** Whether a twin waits for the selected bar to close (the param defaults on). */
67
+ export declare function wrunWaitsForClose(settings: unknown): boolean;
68
+ /**
69
+ * The interval a wrun overlay's package runs at when it is coarser than the chart's, else null (the
70
+ * package runs on the chart's bars, as before): a proven twin listed in WRUN_RUN_INTERVAL_TWINS,
71
+ * off replay, index mode and the markets one candle ask cannot serve (`unsupportedMarket`), whose
72
+ * timeframe selects an interval coarser than the chart. A selection at or below the chart's interval
73
+ * is the chart's own (wrunTimeframeIsChartOrFiner).
74
+ */
75
+ export declare function resolveWrunRunInterval(input: WrunRunIntervalInput): WrunRunInterval | null;
76
+ /** Whether one candle ask at the chart's venue and symbol cannot stand in for the chart's own series
77
+ * (see WrunRunIntervalInput.unsupportedMarket): a formula chart or a prediction market
78
+ * (isRunIntervalUnservableMarket). Unlike the kScript built-ins' predicate
79
+ * (isRunIntervalUnsupportedMarket), a CME-family venue is supported: its run bars are read on the
80
+ * session lattice. */
81
+ export declare function isWrunRunIntervalUnsupportedMarket(exchange: string | undefined, transformations: string | null | undefined): boolean;
82
+ /**
83
+ * The run interval of one mounted wrun overlay: its settings against the chart's interval, venue,
84
+ * series (`chartTransformations`, a formula chart's legs) and replay state. `chartExchange` is the
85
+ * chart's venue; omitted, the overlay's own `settings.exchange` stands in. A venue that rides the CME
86
+ * session lattice (CME, CBOT, NYMEX, COMEX: isCmeSessionLatticeExchange, the rule the chart's own
87
+ * live bars and the run bars' live fold key on) stamps the run `sessionLattice`.
88
+ */
89
+ export declare function overlayWrunRunInterval(chartIndex: number, overlay: {
90
+ settings?: unknown;
91
+ } | null | undefined, chartInterval: unknown, chartExchange?: string | null, chartTransformations?: string | null): WrunRunInterval | null;
92
+ /**
93
+ * The settings a run at another interval sends the package: the twin's `timeframe` forced to its
94
+ * chart option, on a copy. Only the values the package computes with (the init args); the
95
+ * persisted settings, the dialog, the legend title and the alert arm keep the user's choice.
96
+ */
97
+ export declare function wrunSettingsForRunInterval<T extends object>(settings: T): T;
98
+ export {};