@orangecharts/wrun-chart-host 0.4.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 (322) hide show
  1. package/README.md +15 -4
  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/cme-official-scripts.constants.d.ts +168 -0
  11. package/dist/constants/scriptEditor/cme-official-scripts.constants.js +398 -0
  12. package/dist/constants/scriptEditor/converted-script-id.leaf.d.ts +8 -0
  13. package/dist/constants/scriptEditor/converted-script-id.leaf.js +10 -0
  14. package/dist/constants/scriptEditor/execution.constants.d.ts +4 -0
  15. package/dist/constants/scriptEditor/execution.constants.js +14 -0
  16. package/dist/constants/wrun-prefix-safe.constants.d.ts +23 -0
  17. package/dist/constants/wrun-prefix-safe.constants.js +26 -0
  18. package/dist/host-env.d.ts +313 -18
  19. package/dist/host-env.js +15 -0
  20. package/dist/host-ports.types.d.ts +853 -16
  21. package/dist/index.d.ts +139 -2
  22. package/dist/index.js +139 -2
  23. package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +31 -0
  24. package/dist/instances/script-engine-worker-ohlcv-transfer.js +164 -0
  25. package/dist/interfaces/market-event.interface.d.ts +231 -0
  26. package/dist/interfaces/market-event.interface.js +15 -0
  27. package/dist/interfaces/opra-realtime.interface.d.ts +70 -134
  28. package/dist/interfaces/opra-realtime.interface.js +34 -59
  29. package/dist/interfaces/replay.interface.d.ts +285 -0
  30. package/dist/interfaces/replay.interface.js +1 -0
  31. package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +1 -0
  32. package/dist/kscript-data/controls/live-ohlcv-merge.util.js +93 -0
  33. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +5 -1
  34. package/dist/kscript-data/controls/live-trades-merge.util.js +2 -2
  35. package/dist/market-data/billing.interface.d.ts +219 -0
  36. package/dist/market-data/billing.interface.js +58 -0
  37. package/dist/market-data/venue-governed.util.d.ts +2 -0
  38. package/dist/market-data/venue-governed.util.js +10 -0
  39. package/dist/market-data/venue.d.ts +122 -0
  40. package/dist/market-data/venue.js +1 -0
  41. package/dist/market-data/venues/index.d.ts +97 -0
  42. package/dist/market-data/venues/index.js +33 -0
  43. package/dist/market-data/venues/opra.contract.copy.json +35 -0
  44. package/dist/market-data/venues/opra.d.ts +70 -0
  45. package/dist/market-data/venues/opra.js +74 -0
  46. package/dist/replay/replayIndicatorRows.d.ts +31 -0
  47. package/dist/replay/replayIndicatorRows.js +117 -0
  48. package/dist/replay/replayLadder.d.ts +85 -0
  49. package/dist/replay/replayLadder.js +388 -0
  50. package/dist/utility/auth/server-clock.util.d.ts +81 -0
  51. package/dist/utility/auth/server-clock.util.js +238 -0
  52. package/dist/utility/chart/builtin-identity.util.d.ts +18 -0
  53. package/dist/utility/chart/builtin-identity.util.js +51 -0
  54. package/dist/utility/chart/cache-alignment.util.d.ts +454 -0
  55. package/dist/utility/chart/cache-alignment.util.js +926 -0
  56. package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +15 -0
  57. package/dist/utility/chart/chart-data-fetch-generation.util.js +22 -0
  58. package/dist/utility/chart/chart-mount-epoch.util.d.ts +5 -0
  59. package/dist/utility/chart/chart-mount-epoch.util.js +29 -0
  60. package/dist/utility/chart/chart-time-domain.util.d.ts +12 -0
  61. package/dist/utility/chart/chart-time-domain.util.js +23 -0
  62. package/dist/utility/chart/color-customization.leaf.d.ts +10 -0
  63. package/dist/utility/chart/color-customization.leaf.js +16 -0
  64. package/dist/utility/chart/footprint-tick-grid.util.d.ts +106 -0
  65. package/dist/utility/chart/footprint-tick-grid.util.js +167 -0
  66. package/dist/utility/chart/gesture-timing.leaf.d.ts +29 -0
  67. package/dist/utility/chart/gesture-timing.leaf.js +29 -0
  68. package/dist/utility/chart/governed-contract-coin.util.d.ts +22 -0
  69. package/dist/utility/chart/governed-contract-coin.util.js +39 -0
  70. package/dist/utility/chart/host-bar-placement.util.d.ts +107 -0
  71. package/dist/utility/chart/host-bar-placement.util.js +447 -0
  72. package/dist/utility/chart/index-host-tier.util.d.ts +31 -0
  73. package/dist/utility/chart/index-host-tier.util.js +118 -0
  74. package/dist/utility/chart/index-mode-admission.util.d.ts +34 -0
  75. package/dist/utility/chart/index-mode-admission.util.js +67 -0
  76. package/dist/utility/chart/indicator-error-message.util.d.ts +35 -0
  77. package/dist/utility/chart/indicator-error-message.util.js +44 -0
  78. package/dist/utility/chart/kscript-apply-fingerprint.util.d.ts +65 -0
  79. package/dist/utility/chart/kscript-apply-fingerprint.util.js +357 -0
  80. package/dist/utility/chart/kscript-chart-flush.leaf.d.ts +22 -0
  81. package/dist/utility/chart/kscript-chart-flush.leaf.js +13 -0
  82. package/dist/utility/chart/kscript-data-interval-restriction.leaf.d.ts +6 -0
  83. package/dist/utility/chart/kscript-data-interval-restriction.leaf.js +27 -0
  84. package/dist/utility/chart/kscript-integration-decision.leaf.d.ts +89 -0
  85. package/dist/utility/chart/kscript-integration-decision.leaf.js +80 -0
  86. package/dist/utility/chart/kscript-live-coalesce.util.d.ts +76 -0
  87. package/dist/utility/chart/kscript-live-coalesce.util.js +156 -0
  88. package/dist/utility/chart/kscript-live-rest-pace.util.d.ts +34 -0
  89. package/dist/utility/chart/kscript-live-rest-pace.util.js +134 -0
  90. package/dist/utility/chart/kscript-live-source-identity.util.d.ts +98 -0
  91. package/dist/utility/chart/kscript-live-source-identity.util.js +121 -0
  92. package/dist/utility/chart/kscript-mounted-plot-set.leaf.d.ts +48 -0
  93. package/dist/utility/chart/kscript-mounted-plot-set.leaf.js +145 -0
  94. package/dist/utility/chart/kscript-perf-tracker.util.d.ts +243 -0
  95. package/dist/utility/chart/kscript-perf-tracker.util.js +522 -0
  96. package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +43 -0
  97. package/dist/utility/chart/kscript-run-interval-projection.util.js +471 -0
  98. package/dist/utility/chart/kscript-run-result-equality.util.d.ts +38 -0
  99. package/dist/utility/chart/kscript-run-result-equality.util.js +89 -0
  100. package/dist/utility/chart/kscript-settings-revision.leaf.d.ts +2 -0
  101. package/dist/utility/chart/kscript-settings-revision.leaf.js +12 -0
  102. package/dist/utility/chart/kscript-source-degrade.leaf.d.ts +63 -0
  103. package/dist/utility/chart/kscript-source-degrade.leaf.js +68 -0
  104. package/dist/utility/chart/kscript-source-retention.util.d.ts +134 -0
  105. package/dist/utility/chart/kscript-source-retention.util.js +218 -0
  106. package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +57 -0
  107. package/dist/utility/chart/kscript-standin-identity.leaf.js +61 -0
  108. package/dist/utility/chart/kscript-titancharts-preparation.util.d.ts +15 -0
  109. package/dist/utility/chart/kscript-titancharts-preparation.util.js +376 -0
  110. package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +9 -0
  111. package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +130 -0
  112. package/dist/utility/chart/kscript-venue-policy.util.d.ts +217 -0
  113. package/dist/utility/chart/kscript-venue-policy.util.js +324 -0
  114. package/dist/utility/chart/live-cadence.util.d.ts +38 -0
  115. package/dist/utility/chart/live-cadence.util.js +37 -0
  116. package/dist/utility/chart/live-feed-series-match.leaf.d.ts +13 -0
  117. package/dist/utility/chart/live-feed-series-match.leaf.js +21 -0
  118. package/dist/utility/chart/local-engine-self-heal-backoff.util.d.ts +46 -0
  119. package/dist/utility/chart/local-engine-self-heal-backoff.util.js +46 -0
  120. package/dist/utility/chart/local-engine-uninit.leaf.d.ts +21 -0
  121. package/dist/utility/chart/local-engine-uninit.leaf.js +22 -0
  122. package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +62 -0
  123. package/dist/utility/chart/local-kscript-source-revalidation.util.js +123 -0
  124. package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +214 -0
  125. package/dist/utility/chart/local-kscript-warmup-depth.util.js +376 -0
  126. package/dist/utility/chart/local-technical-script-live-apply-coalescer.util.d.ts +85 -0
  127. package/dist/utility/chart/local-technical-script-live-apply-coalescer.util.js +197 -0
  128. package/dist/utility/chart/local-technical-script-range.leaf.d.ts +72 -0
  129. package/dist/utility/chart/local-technical-script-range.leaf.js +126 -0
  130. package/dist/utility/chart/mixed-mode.util.d.ts +167 -0
  131. package/dist/utility/chart/mixed-mode.util.js +139 -0
  132. package/dist/utility/chart/ohlcv-row-readiness.util.d.ts +36 -0
  133. package/dist/utility/chart/ohlcv-row-readiness.util.js +90 -0
  134. package/dist/utility/chart/opra-user-scripts-gate.util.d.ts +19 -0
  135. package/dist/utility/chart/opra-user-scripts-gate.util.js +32 -0
  136. package/dist/utility/chart/overlay-execution-guard-key.leaf.d.ts +8 -0
  137. package/dist/utility/chart/overlay-execution-guard-key.leaf.js +10 -0
  138. package/dist/utility/chart/price-precision.util.d.ts +40 -0
  139. package/dist/utility/chart/price-precision.util.js +70 -0
  140. package/dist/utility/chart/profile-block-size.util.d.ts +64 -0
  141. package/dist/utility/chart/profile-block-size.util.js +141 -0
  142. package/dist/utility/chart/protected-kscript-degenerate-rows.leaf.d.ts +11 -0
  143. package/dist/utility/chart/protected-kscript-degenerate-rows.leaf.js +29 -0
  144. package/dist/utility/chart/protected-kscript-empty-output.util.d.ts +28 -0
  145. package/dist/utility/chart/protected-kscript-empty-output.util.js +84 -0
  146. package/dist/utility/chart/run-interval-unservable.leaf.d.ts +9 -0
  147. package/dist/utility/chart/run-interval-unservable.leaf.js +20 -0
  148. package/dist/utility/chart/run-interval-warmup.leaf.d.ts +19 -0
  149. package/dist/utility/chart/run-interval-warmup.leaf.js +35 -0
  150. package/dist/utility/chart/titan-constants.pin.d.ts +9 -5
  151. package/dist/utility/chart/titan-constants.pin.js +18 -5
  152. package/dist/utility/chart/warmup-backfill-retry.leaf.d.ts +9 -0
  153. package/dist/utility/chart/warmup-backfill-retry.leaf.js +9 -0
  154. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +11 -2
  155. package/dist/utility/chart/wrun-bar-session-facts.util.js +10 -3
  156. package/dist/utility/chart/wrun-run-result.util.d.ts +5 -1
  157. package/dist/utility/chart/wrun-run-result.util.js +20 -14
  158. package/dist/utility/common/data-processing.util.d.ts +138 -0
  159. package/dist/utility/common/data-processing.util.js +346 -0
  160. package/dist/utility/common/visible-timeout.util.d.ts +13 -4
  161. package/dist/utility/common/visible-timeout.util.js +23 -8
  162. package/dist/utility/exchange-format.leaf.d.ts +1 -0
  163. package/dist/utility/exchange-format.leaf.js +47 -0
  164. package/dist/utility/market-events/earnings-scope.util.d.ts +60 -0
  165. package/dist/utility/market-events/earnings-scope.util.js +92 -0
  166. package/dist/utility/market-events/market-events.util.d.ts +147 -0
  167. package/dist/utility/market-events/market-events.util.js +392 -0
  168. package/dist/utility/market-events/zoned-clock.util.d.ts +1 -0
  169. package/dist/utility/market-events/zoned-clock.util.js +11 -0
  170. package/dist/utility/options/option-venue-disclosure.util.d.ts +43 -0
  171. package/dist/utility/options/option-venue-disclosure.util.js +56 -0
  172. package/dist/utility/scriptEditor/package-semver.util.d.ts +51 -0
  173. package/dist/utility/scriptEditor/package-semver.util.js +120 -0
  174. package/dist/utility/scriptEditor/temp-script-id.util.d.ts +18 -0
  175. package/dist/utility/scriptEditor/temp-script-id.util.js +25 -0
  176. package/dist/utility/symbol-selection/markets-request-from-symbols.leaf.d.ts +20 -0
  177. package/dist/utility/symbol-selection/markets-request-from-symbols.leaf.js +81 -0
  178. package/dist/utility/v2/governed-tier.leaf.d.ts +103 -0
  179. package/dist/utility/v2/governed-tier.leaf.js +113 -0
  180. package/dist/utility/watchlist/import/import-request.leaf.d.ts +10 -0
  181. package/dist/utility/watchlist/import/import-request.leaf.js +10 -0
  182. package/dist/utility/wrun/sources/lanes/series.js +2 -2
  183. package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +4 -4
  184. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +5 -6
  185. package/dist/utility/wrun/wrun-alert-outputs.registry.d.ts +166 -0
  186. package/dist/utility/wrun/wrun-alert-outputs.registry.js +219 -0
  187. package/dist/utility/wrun/wrun-bar-count.util.d.ts +83 -0
  188. package/dist/utility/wrun/wrun-bar-count.util.js +259 -0
  189. package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +84 -0
  190. package/dist/utility/wrun/wrun-chart-context-names.util.js +186 -0
  191. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +253 -0
  192. package/dist/utility/wrun/wrun-chart-market-facts.util.js +731 -0
  193. package/dist/utility/wrun/wrun-cloud-opra-stamp.util.d.ts +28 -0
  194. package/dist/utility/wrun/wrun-cloud-opra-stamp.util.js +45 -0
  195. package/dist/utility/wrun/wrun-coin-lane-live.util.d.ts +18 -0
  196. package/dist/utility/wrun/wrun-coin-lane-live.util.js +47 -0
  197. package/dist/utility/wrun/wrun-deadline.util.js +2 -1
  198. package/dist/utility/wrun/wrun-debug-output.util.d.ts +39 -0
  199. package/dist/utility/wrun/wrun-debug-output.util.js +63 -0
  200. package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +113 -0
  201. package/dist/utility/wrun/wrun-declared-warmup.util.js +181 -0
  202. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +43 -0
  203. package/dist/utility/wrun/wrun-draft-legend-note.util.js +158 -0
  204. package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +181 -0
  205. package/dist/utility/wrun/wrun-draft-overlay.util.js +357 -0
  206. package/dist/utility/wrun/wrun-draw-skipped.leaf.d.ts +16 -0
  207. package/dist/utility/wrun/wrun-draw-skipped.leaf.js +16 -0
  208. package/dist/utility/wrun/wrun-earnings-facts.util.d.ts +42 -0
  209. package/dist/utility/wrun/wrun-earnings-facts.util.js +131 -0
  210. package/dist/utility/wrun/wrun-first-run-depth.util.d.ts +32 -0
  211. package/dist/utility/wrun/wrun-first-run-depth.util.js +118 -0
  212. package/dist/utility/wrun/wrun-gate-plane-readers.util.d.ts +24 -0
  213. package/dist/utility/wrun/wrun-gate-plane-readers.util.js +31 -0
  214. package/dist/utility/wrun/wrun-held-lanes.util.d.ts +32 -0
  215. package/dist/utility/wrun/wrun-held-lanes.util.js +94 -0
  216. package/dist/utility/wrun/wrun-host-visible-clock.util.d.ts +2 -0
  217. package/dist/utility/wrun/wrun-host-visible-clock.util.js +17 -0
  218. package/dist/utility/wrun/wrun-host.service.d.ts +266 -0
  219. package/dist/utility/wrun/wrun-host.service.js +655 -0
  220. package/dist/utility/wrun/wrun-inert-legend.util.d.ts +33 -0
  221. package/dist/utility/wrun/wrun-inert-legend.util.js +125 -0
  222. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +155 -0
  223. package/dist/utility/wrun/wrun-input-requirements.leaf.js +450 -0
  224. package/dist/utility/wrun/wrun-integration-route.util.d.ts +51 -0
  225. package/dist/utility/wrun/wrun-integration-route.util.js +59 -0
  226. package/dist/utility/wrun/wrun-latest-history.leaf.d.ts +8 -0
  227. package/dist/utility/wrun/wrun-latest-history.leaf.js +8 -0
  228. package/dist/utility/wrun/wrun-legend-hover.lazy.d.ts +12 -0
  229. package/dist/utility/wrun/wrun-legend-hover.lazy.js +96 -0
  230. package/dist/utility/wrun/wrun-lifecycle-runtime.util.d.ts +21 -0
  231. package/dist/utility/wrun/wrun-lifecycle-runtime.util.js +21 -0
  232. package/dist/utility/wrun/wrun-live-hidden-hold.util.d.ts +23 -0
  233. package/dist/utility/wrun/wrun-live-hidden-hold.util.js +13 -0
  234. package/dist/utility/wrun/wrun-live-intake.util.d.ts +374 -0
  235. package/dist/utility/wrun/wrun-live-intake.util.js +2027 -0
  236. package/dist/utility/wrun/wrun-live-patch.util.d.ts +116 -0
  237. package/dist/utility/wrun/wrun-live-patch.util.js +523 -0
  238. package/dist/utility/wrun/wrun-live-tick.util.d.ts +619 -0
  239. package/dist/utility/wrun/wrun-live-tick.util.js +4974 -0
  240. package/dist/utility/wrun/wrun-loading-owner.util.d.ts +58 -0
  241. package/dist/utility/wrun/wrun-loading-owner.util.js +89 -0
  242. package/dist/utility/wrun/wrun-official-scope.leaf.d.ts +29 -0
  243. package/dist/utility/wrun/wrun-official-scope.leaf.js +36 -0
  244. package/dist/utility/wrun/wrun-oi-lane.util.d.ts +27 -0
  245. package/dist/utility/wrun/wrun-oi-lane.util.js +42 -0
  246. package/dist/utility/wrun/wrun-options-stop.util.d.ts +52 -0
  247. package/dist/utility/wrun/wrun-options-stop.util.js +123 -0
  248. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +719 -0
  249. package/dist/utility/wrun/wrun-overlay-drivers.util.js +1180 -0
  250. package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.d.ts +50 -0
  251. package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.js +131 -0
  252. package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +118 -0
  253. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +466 -0
  254. package/dist/utility/wrun/wrun-overlay-metadata.util.d.ts +45 -0
  255. package/dist/utility/wrun/wrun-overlay-metadata.util.js +112 -0
  256. package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +114 -0
  257. package/dist/utility/wrun/wrun-overlay-recovery.util.js +971 -0
  258. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +858 -0
  259. package/dist/utility/wrun/wrun-overlay-run.util.js +11013 -0
  260. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +24 -9
  261. package/dist/utility/wrun/wrun-panel-mount.util.js +138 -43
  262. package/dist/utility/wrun/wrun-param-map.util.d.ts +19 -4
  263. package/dist/utility/wrun/wrun-param-map.util.js +40 -47
  264. package/dist/utility/wrun/wrun-param-values.util.d.ts +9 -3
  265. package/dist/utility/wrun/wrun-param-values.util.js +5 -5
  266. package/dist/utility/wrun/wrun-prefix-cohort.util.d.ts +93 -0
  267. package/dist/utility/wrun/wrun-prefix-cohort.util.js +484 -0
  268. package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +114 -0
  269. package/dist/utility/wrun/wrun-prefix-lanes.util.js +486 -0
  270. package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +317 -0
  271. package/dist/utility/wrun/wrun-prefix-proof.util.js +630 -0
  272. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +73 -0
  273. package/dist/utility/wrun/wrun-refusal-surface.util.js +380 -0
  274. package/dist/utility/wrun/wrun-refusal-text.util.d.ts +15 -0
  275. package/dist/utility/wrun/wrun-refusal-text.util.js +40 -0
  276. package/dist/utility/wrun/wrun-replay-lane.util.d.ts +139 -0
  277. package/dist/utility/wrun/wrun-replay-lane.util.js +520 -0
  278. package/dist/utility/wrun/wrun-replay-rows.util.d.ts +21 -0
  279. package/dist/utility/wrun/wrun-replay-rows.util.js +172 -0
  280. package/dist/utility/wrun/wrun-row-source-factory.d.ts +53 -0
  281. package/dist/utility/wrun/wrun-row-source-factory.js +435 -0
  282. package/dist/utility/wrun/wrun-run-cells.util.d.ts +36 -0
  283. package/dist/utility/wrun/wrun-run-cells.util.js +46 -0
  284. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +133 -0
  285. package/dist/utility/wrun/wrun-run-interval-session.util.js +121 -0
  286. package/dist/utility/wrun/wrun-run-interval.util.d.ts +98 -0
  287. package/dist/utility/wrun/wrun-run-interval.util.js +207 -0
  288. package/dist/utility/wrun/wrun-run-retained.util.d.ts +122 -0
  289. package/dist/utility/wrun/wrun-run-retained.util.js +255 -0
  290. package/dist/utility/wrun/wrun-sandbox-row-source.d.ts +184 -0
  291. package/dist/utility/wrun/wrun-sandbox-row-source.js +444 -0
  292. package/dist/utility/wrun/wrun-script-inputs.util.js +4 -4
  293. package/dist/utility/wrun/wrun-series-stream.util.d.ts +86 -0
  294. package/dist/utility/wrun/wrun-series-stream.util.js +537 -0
  295. package/dist/utility/wrun/wrun-sheet-remembered.util.d.ts +21 -0
  296. package/dist/utility/wrun/wrun-sheet-remembered.util.js +36 -0
  297. package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.d.ts +7 -0
  298. package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.js +12 -0
  299. package/dist/utility/wrun/wrun-socket-row-source.js +4 -2
  300. package/dist/utility/wrun/wrun-source-rows.util.d.ts +175 -3
  301. package/dist/utility/wrun/wrun-source-rows.util.js +294 -8
  302. package/dist/utility/wrun/wrun-stats-strip.util.d.ts +46 -0
  303. package/dist/utility/wrun/wrun-stats-strip.util.js +87 -0
  304. package/dist/utility/wrun/wrun-table-chrome.util.d.ts +163 -0
  305. package/dist/utility/wrun/wrun-table-chrome.util.js +557 -0
  306. package/dist/utility/wrun/wrun-text-params.util.d.ts +11 -6
  307. package/dist/utility/wrun/wrun-text-params.util.js +19 -30
  308. package/dist/utility/wrun/wrun-transient-rerun.util.d.ts +64 -0
  309. package/dist/utility/wrun/wrun-transient-rerun.util.js +317 -0
  310. package/dist/utility/wrun/wrun-twin-lookback.util.d.ts +10 -0
  311. package/dist/utility/wrun/wrun-twin-lookback.util.js +43 -0
  312. package/dist/utility/wrun/wrun-warmup-head-store.util.d.ts +41 -0
  313. package/dist/utility/wrun/wrun-warmup-head-store.util.js +120 -0
  314. package/dist/utility/wrun-alert-params.leaf.d.ts +24 -0
  315. package/dist/utility/wrun-alert-params.leaf.js +24 -0
  316. package/dist/utils/replay/replay-buffer-math.d.ts +148 -0
  317. package/dist/utils/replay/replay-buffer-math.js +684 -0
  318. package/dist/workers/wrun/wrun-abi-host.d.ts +190 -0
  319. package/dist/workers/wrun/wrun-abi-host.js +1201 -0
  320. package/dist/workers/wrun/wrun-engine-handler.d.ts +37 -0
  321. package/dist/workers/wrun/wrun-engine-handler.js +211 -0
  322. package/package.json +3 -3
@@ -1,9 +1,10 @@
1
1
  /**
2
- * Byte-for-byte copies of the three titan constants package-bound code reads (`@orangecharts/titan-charts-next/constants`
3
- * `findMonday`, `TimeIntervalConstant`, `MIN_GRID_HEIGHT_ALLOWED`), in a leaf with no import: the extraction walker
4
- * refuses every titan edge (scripts/wrun-chart-host-extract.mjs), so a module that moves into the chart-host package
5
- * reads these instead of the engine's. tests/utility/chart/titan-constants.pin.spec.ts compares them with the installed
6
- * engine's (values and 200 sampled timestamps), and src/utility/wrun/wrun-chart-host-type-pins.ts pins their types.
2
+ * Byte-for-byte copies of the four titan constants package-bound code reads (`@orangecharts/titan-charts-next/constants`
3
+ * `findMonday`, `TimeIntervalConstant`, `MIN_GRID_HEIGHT_ALLOWED`, `getDecimalPlaces`), in a leaf with no import: the
4
+ * extraction walker refuses every titan edge (scripts/wrun-chart-host-extract.mjs), so a module that moves into the
5
+ * chart-host package reads these instead of the engine's. tests/utility/chart/titan-constants.pin.spec.ts compares them
6
+ * with the installed engine's (values, 200 sampled timestamps and 200 sampled numbers), and
7
+ * src/utility/wrun/wrun-chart-host-type-pins.ts pins their types.
7
8
  */
8
9
  /** The UTC midnight of the Monday that starts the week holding `unixTimeStamp` (ms). */
9
10
  export function findMonday(unixTimeStamp) {
@@ -48,3 +49,15 @@ export const TimeIntervalConstant = {
48
49
  };
49
50
  /** The smallest grid height share a pane may take (the engine's split floor). */
50
51
  export const MIN_GRID_HEIGHT_ALLOWED = 0.13;
52
+ /** The decimal places of `num`: the digits right of its decimal point, less a scientific-notation exponent (titan
53
+ * 0.0.4-alpha.1136 src/utils/price.ts). */
54
+ export function getDecimalPlaces(num) {
55
+ const match = num.toString().match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);
56
+ if (!match)
57
+ return 0;
58
+ return Math.max(0,
59
+ // Number of digits right of decimal point.
60
+ (match[1] ? match[1].length : 0) -
61
+ // Adjust for scientific notation.
62
+ (match[2] ? +match[2] : 0));
63
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The warm-up backfill's gesture retry (a leaf of utility/chart/local-kscript-warmup-backfill-ask.util.ts;
3
+ * P2/inventory.md section 1.1): how often and how many times an ask is made again while the viewport reads as moving,
4
+ * the two names the wrun first-run depth reads beside the kScript lane's first run. Two numbers, no state, so it moves
5
+ * into the chart-host package with the phase 2 closure. The old module re-exports both.
6
+ */
7
+ /** The re-ask cadence while the viewport reads as moving (the boot camera settle, an add-time reset). */
8
+ export declare const WARMUP_BACKFILL_GESTURE_RETRY_MS = 400;
9
+ export declare const WARMUP_BACKFILL_GESTURE_RETRY_LIMIT = 3;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The warm-up backfill's gesture retry (a leaf of utility/chart/local-kscript-warmup-backfill-ask.util.ts;
3
+ * P2/inventory.md section 1.1): how often and how many times an ask is made again while the viewport reads as moving,
4
+ * the two names the wrun first-run depth reads beside the kScript lane's first run. Two numbers, no state, so it moves
5
+ * into the chart-host package with the phase 2 closure. The old module re-exports both.
6
+ */
7
+ /** The re-ask cadence while the viewport reads as moving (the boot camera settle, an add-time reset). */
8
+ export const WARMUP_BACKFILL_GESTURE_RETRY_MS = 400;
9
+ export const WARMUP_BACKFILL_GESTURE_RETRY_LIMIT = 3;
@@ -58,6 +58,7 @@
58
58
  *
59
59
  * Worker-safe: imports only the chart's session utils (no Vue, store, i18n).
60
60
  */
61
+ import { type LiveBucketVenue } from './live-bucket.util.js';
61
62
  /** The `time.session` codes (contract C3). */
62
63
  export declare const WRUN_BAR_SESSION: Readonly<{
63
64
  readonly closed: 0;
@@ -78,14 +79,22 @@ export interface WrunBarVenue {
78
79
  symbol: string;
79
80
  /** The series' bar interval (ms); one day or longer reads the calendar-bar rule. */
80
81
  intervalMs: number;
82
+ /**
83
+ * The chart's bar grid: where its own bars open and close (`liveBucketVenueOf` over the same metadata, its
84
+ * session mode and formula included). The wrun row builder lands another market's grid rows on it
85
+ * (wrun-source-rows.util). The facts never read it: they follow the market and the interval alone, never the
86
+ * chart's RTH or extended mode. Absent: the UTC floor.
87
+ */
88
+ barGrid?: LiveBucketVenue;
81
89
  }
82
90
  /** Which C3 rule a market follows. */
83
91
  export type WrunBarFactsMarket = 'cme' | 'us_equities' | 'utc';
84
92
  export declare function wrunBarFactsMarketOf(exchange: string): WrunBarFactsMarket;
85
93
  /**
86
94
  * The venue of chart metadata (or a live context's market) at the series'
87
- * bar interval: undefined unless exchange and symbol are non-empty strings and
88
- * the interval is a positive number.
95
+ * bar interval, with the chart's bar grid (`barGrid`): undefined unless
96
+ * exchange and symbol are non-empty strings and the interval is a positive
97
+ * number.
89
98
  */
90
99
  export declare function wrunBarVenueOf(market: unknown, intervalMs: number): WrunBarVenue | undefined;
91
100
  /**
@@ -61,6 +61,7 @@
61
61
  import { Intervals } from '../../constants/interval.constants.js';
62
62
  import { cmeSessionBucketMs } from './cme-session-bucket.util.js';
63
63
  import { isCmeGoverned } from './cme-realtime.util.js';
64
+ import { liveBucketVenueOf } from './live-bucket.util.js';
64
65
  import { getMarketKind } from './marketKind.util.js';
65
66
  import { getGovernedFuturesScheduleStatusForSymbol, GOVERNED_FUTURES_TIME_ZONE, isCmeAlwaysOnSymbol, } from './market-session-schedule.util.js';
66
67
  import { engineRthWindowForSymbol, sessionWindowsInRange, } from './rth-session.util.js';
@@ -84,8 +85,9 @@ export function wrunBarFactsMarketOf(exchange) {
84
85
  }
85
86
  /**
86
87
  * The venue of chart metadata (or a live context's market) at the series'
87
- * bar interval: undefined unless exchange and symbol are non-empty strings and
88
- * the interval is a positive number.
88
+ * bar interval, with the chart's bar grid (`barGrid`): undefined unless
89
+ * exchange and symbol are non-empty strings and the interval is a positive
90
+ * number.
89
91
  */
90
92
  export function wrunBarVenueOf(market, intervalMs) {
91
93
  if (!market || typeof market !== 'object')
@@ -97,7 +99,12 @@ export function wrunBarVenueOf(market, intervalMs) {
97
99
  return undefined;
98
100
  if (!Number.isFinite(intervalMs) || intervalMs <= 0)
99
101
  return undefined;
100
- return { exchange, symbol, intervalMs };
102
+ return {
103
+ exchange,
104
+ symbol,
105
+ intervalMs,
106
+ barGrid: liveBucketVenueOf(market),
107
+ };
101
108
  }
102
109
  const NO_FACTS = Object.freeze({ tradeDateSec: Number.NaN, session: Number.NaN });
103
110
  /** Every session code, indexable by its own value. */
@@ -827,7 +827,11 @@ export declare function wrunRunNoticesOf(runResult: Pick<WrunRunResult, 'notices
827
827
  * param's rendered value; a placeholder naming no param stays as written.
828
828
  * `texts` is the run's text settings by name (absent = the declared words):
829
829
  * the words are inserted after the one placeholder pass and never re-read
830
- * as a template (a typed `{{close}}` arrives literally). */
830
+ * as a template (a typed `{{close}}` arrives literally). The result is a
831
+ * legend suffix, so each value is LITERAL legend text (wrunLegendLiteral:
832
+ * its own characters, each `$` kept out of the `$token` pass titan runs
833
+ * over the raw settings before it shows `define.customTitle` as text); the
834
+ * template's own characters stay as the author wrote them. */
831
835
  export declare function resolveWrunLegendTitle(template: string, params: ReadonlyArray<WrunMetadataParam>, values?: Readonly<Record<string, number>>, texts?: Readonly<Record<string, string>>): string;
832
836
  /** The legend colours of a mounted result's outputs: entry i is the colour
833
837
  * legend line i paints (titan's legend text colour, alpha stripped, so the
@@ -796,8 +796,8 @@ function wrunRunDefine(options, position) {
796
796
  : typeof template === 'string' && template !== ''
797
797
  ? resolveWrunCustomTitle(template, metadata.params ?? [], options.params, options.texts)
798
798
  : undefined;
799
- // The note rides after the args, in the args' grey, as a literal (titan writes the title
800
- // through innerHTML): " (14, close) · draft · only in this browser", or " · draft · ..." alone.
799
+ // The note rides after the args, in the args' grey, as a literal (titan's `$token` pass never
800
+ // reads it): " (14, close) · draft · only in this browser", or " · draft · ..." alone.
801
801
  const note = typeof options.legendNote === 'string' ? options.legendNote.trim() : '';
802
802
  const customTitle = note ? `${resolvedTitle ?? ''} · ${wrunLegendLiteral(note)}` : resolvedTitle;
803
803
  return {
@@ -816,14 +816,7 @@ function wrunLegendSuffix(resolved) {
816
816
  /** A param's value rendered the way a legend reads it: a select as its
817
817
  * option label, a colour as its colour string, a boolean as true / false
818
818
  * (the custom-title path's own word for a toggle), a text setting as its
819
- * plain words (never markup), a number as written. The value is inserted
820
- * as LITERAL legend text (wrunLegendLiteral: the HTML specials and `$` as
821
- * entities), because titan writes `define.customTitle` through innerHTML
822
- * after its own `$token` pass over the raw settings; the template's own
823
- * characters stay as the author wrote them. */
824
- function wrunParamLegendValue(param, value, text) {
825
- return wrunLegendLiteral(wrunParamLegendWords(param, value, text));
826
- }
819
+ * plain words (never markup), a number as written. */
827
820
  function wrunParamLegendWords(param, value, text) {
828
821
  // A coded value (a choice, a multi, a time, a session clock) prints as its words, never its code
829
822
  // (wrun-setting-words.util); an empty multi and an unset time (0) print the dash a missing number does.
@@ -851,15 +844,28 @@ function wrunParamLegendWords(param, value, text) {
851
844
  * param's rendered value; a placeholder naming no param stays as written.
852
845
  * `texts` is the run's text settings by name (absent = the declared words):
853
846
  * the words are inserted after the one placeholder pass and never re-read
854
- * as a template (a typed `{{close}}` arrives literally). */
847
+ * as a template (a typed `{{close}}` arrives literally). The result is a
848
+ * legend suffix, so each value is LITERAL legend text (wrunLegendLiteral:
849
+ * its own characters, each `$` kept out of the `$token` pass titan runs
850
+ * over the raw settings before it shows `define.customTitle` as text); the
851
+ * template's own characters stay as the author wrote them. */
855
852
  export function resolveWrunLegendTitle(template, params, values, texts) {
853
+ return resolveWrunTitleTemplate(template, params, values, texts, wrunLegendLiteral);
854
+ }
855
+ /** A declared pane title against the run's param values, the same way, with
856
+ * the words as they are: it is the child overlay's NAME, which titan shows
857
+ * as text and never runs a `$token` pass over. */
858
+ function resolveWrunPaneTitle(template, params, values, texts) {
859
+ return resolveWrunTitleTemplate(template, params, values, texts, (words) => words);
860
+ }
861
+ function resolveWrunTitleTemplate(template, params, values, texts, insert) {
856
862
  const byName = new Map(params.map((param) => [param.name, param]));
857
863
  return resolveWrunPlaceholders(template, (name) => {
858
864
  const param = byName.get(name);
859
865
  if (param === undefined)
860
866
  return undefined;
861
867
  const fallback = typeof param.default === 'number' ? param.default : 0;
862
- return wrunParamLegendValue(param, values?.[name] ?? fallback, texts?.[name]);
868
+ return insert(wrunParamLegendWords(param, values?.[name] ?? fallback, texts?.[name]));
863
869
  });
864
870
  }
865
871
  /** A theme token word (`theme.<t>`, or the wire's `theme.<t>/aa`): the
@@ -3779,7 +3785,7 @@ function buildWrunRunResultWithSelection(options, memo) {
3779
3785
  ...withWrunLineFills(parentHandles),
3780
3786
  ];
3781
3787
  // A child pane's define: the declared pane title resolved like
3782
- // `legend_title` (no customTitle), else the parent's title and suffix;
3788
+ // `legend_title`, its words as they are (a name, no customTitle), else the parent's title and suffix;
3783
3789
  // its own position; the declared pane's scale look and axis format
3784
3790
  // (wrun-output-style.util, OT18 OT19).
3785
3791
  const homePane = plan.home;
@@ -3787,7 +3793,7 @@ function buildWrunRunResultWithSelection(options, memo) {
3787
3793
  const title = pane?.title;
3788
3794
  const own = typeof title === 'string' && title.trim() !== ''
3789
3795
  ? {
3790
- title: resolveWrunLegendTitle(title, metadata.params ?? [], options.params, options.texts),
3796
+ title: resolveWrunPaneTitle(title, metadata.params ?? [], options.params, options.texts),
3791
3797
  position: routePane(route),
3792
3798
  axis: define.axis,
3793
3799
  }
@@ -0,0 +1,138 @@
1
+ import { BlockBookSnapshot } from '@orangecharts/orange-v2-pb-common';
2
+ export declare function timestampToTsdbTimestamp(timestamp: any): number;
3
+ /**
4
+ * Convert the tsdb timestamp to milliseconds
5
+ * @param timestamp - The timestamp to convert
6
+ * @returns The timestamp in milliseconds
7
+ */
8
+ export declare function tsdbTimestampToMs(timestamp: {
9
+ seconds: number;
10
+ nanoseconds?: number;
11
+ }): number;
12
+ /**
13
+ * Round the timestamp to the nearest interval in the past. A calendar length
14
+ * (1M 3M 6M 1Y) rounds onto its UTC calendar boundary, where its candles open.
15
+ * @param timestamp - The timestamp to round
16
+ * @param interval - The interval to round to
17
+ * @returns The rounded timestamp
18
+ */
19
+ export declare function roundObTimestamp(timestamp: number, interval: number): number;
20
+ /**
21
+ * Parses flattened orderbook data, transforming
22
+ * [numPriceLevels, timestamp_μs, price1, amount1, ...]
23
+ * into
24
+ * [segmentSize, timestamp_ms, price1, amount1, ...]
25
+ *
26
+ * Orderbook consumers must additionally call `shiftOrderbookTimestamps` to
27
+ * align timestamps with the candle interval start. TPSL consumers skip the
28
+ * shift since their timestamps are used as-is.
29
+ *
30
+ * @param flatPoints - Flattened data from backend
31
+ * @returns Float64Array with format [segmentSize, timestamp_ms, price1, amount1, ...]
32
+ */
33
+ export declare function parseOrderbookFlatData(flatPoints: number[]): Float64Array;
34
+ /**
35
+ * The bar an END-stamped book point paints on: one interval back on a fixed
36
+ * grid, the calendar bar the stamp closes at a calendar length (1M 3M 6M 1Y:
37
+ * a bar of 28 to 366 days, where one average-length step back lands mid-bar
38
+ * or inside the bar before). The ladder projections (orderbook-ladder.util)
39
+ * must place a stamp exactly as this does: both heatmap paths paint one grid.
40
+ */
41
+ export declare function bookBarStartMs(stampMs: number, intervalMs: number): number;
42
+ /**
43
+ * Moves each segment's timestamp, in place, from the bucket-end stamp to the
44
+ * start of the bar it closes (`bookBarStartMs`), so the orderbook heatmap
45
+ * aligns with the candles. TPSL does not need this.
46
+ *
47
+ * @param data - Float64Array produced by `parseOrderbookFlatData`
48
+ * @param intervalMs - The chart interval in ms
49
+ */
50
+ export declare function shiftOrderbookTimestamps(data: Float64Array, intervalMs: number): void;
51
+ /**
52
+ * Process block book snapshot data (live feed)
53
+ * @param point - The point to process
54
+ * @returns Float64Array
55
+ *
56
+ * @note The data is sorted by ascending price
57
+ */
58
+ export declare function processBlockBookSnapshot(point: {
59
+ blockBookSnapshot?: BlockBookSnapshot;
60
+ }): Float64Array;
61
+ export declare function processBlockBookSnapshots(points: {
62
+ blockBookSnapshot?: BlockBookSnapshot;
63
+ }[]): Float64Array[];
64
+ /**
65
+ * The bid level count of a flat book frame (`processBlockBookSnapshot`), so a
66
+ * kScript riding a heatmap's stream can split the price-ascending flat back
67
+ * into sides on the main thread (`kScriptOrderbookRowFromFlatBook`). The flat
68
+ * merges levels by price, so the split is only knowable when every wire level
69
+ * survived: -1 when the flat's level count differs from the snapshot's bid
70
+ * pairs plus ask pairs (a duplicate price inside a side, or one price on both
71
+ * sides), or when both sides exist and the book is crossed, locked or merged
72
+ * (`!(bids[0] < asks[0])`, best levels first on the wire). A -1 makes the
73
+ * rider skip that frame instead of guessing the boundary.
74
+ */
75
+ export declare function flatBookBidLevels(flat: ArrayLike<number>, bids: ArrayLike<number>, asks: ArrayLike<number>): number;
76
+ export interface KScriptBlockBookSnapshotOptions {
77
+ maxDepth?: number;
78
+ sourceBlockSize?: number;
79
+ targetBlockSize?: number;
80
+ }
81
+ export declare function processKScriptBlockBookSnapshot(point: {
82
+ blockBookSnapshot?: BlockBookSnapshot;
83
+ }, options?: number | KScriptBlockBookSnapshotOptions): Float64Array;
84
+ export declare function processKScriptBlockBookSnapshots(points: {
85
+ blockBookSnapshot?: BlockBookSnapshot;
86
+ }[], options?: number | KScriptBlockBookSnapshotOptions): Float64Array[];
87
+ /**
88
+ * Rows `[ts, value per subset]` from values keyed by subset name and ms timestamp: each `subsetEnum` member (bar the
89
+ * zero member) at its enum value's index, null where it has no value at that ts; ts ascending over every subset.
90
+ */
91
+ export declare function subsetRows(values: ReadonlyMap<string, ReadonlyMap<number, number>>, subsetEnum: Record<string | number, string | number>): Array<Array<number | null>>;
92
+ /**
93
+ * The column `subsetRows` gives a subset inside each row: the subset's enum
94
+ * VALUE (the timestamp holds column 0, the slot of the enum's zero member), so a subset is read
95
+ * by its enum member, whichever members the enum gains later. Undefined for a name the enum
96
+ * does not hold.
97
+ */
98
+ export declare function subsetPointColumn(subsetEnum: Record<string, unknown>, subsetName: string): number | undefined;
99
+ /**
100
+ * Whether the gateway-side BLOCK_BOOK replay clip still applies to history
101
+ * windows on this request interval.
102
+ *
103
+ * SECOND (intervalSec === 1) windows are served directly up to now since
104
+ * tsdb-gateway MR !1954 (coin-grouped SUM in the 1s BLOCK_BOOK_SNAPSHOT_AGG
105
+ * fold, gateway issue #13), so they are exempt from the client clip, and so
106
+ * are the other sub-minute rungs (5s 15s 30s: the 1s fold labelled and
107
+ * gapfilled on the bar's grid, tsdb-gateway !2189). Every other interval
108
+ * (MINUTE and coarser, or callers that do not declare an interval) keeps the
109
+ * 3-minute clip: the gateway hard-errors ("internal error") on younger
110
+ * windows there. If the gateway ever regresses on young SECOND windows,
111
+ * re-enforcing here restores the full clip and widens the seam top-up's owned
112
+ * window from the boot subscribe seam back to the whole young window
113
+ * (heatmap-seam-topup.util.ts).
114
+ */
115
+ export declare const isObReplayCapEnforcedForIntervalSec: (intervalSec?: number, exchange?: string) => boolean;
116
+ /**
117
+ * Calculates a safe replay cap timestamp for orderbook data.
118
+ * Clip-enforced intervals cap at truncate(now, 3 minutes); exempt intervals
119
+ * (sub-minute, see isObReplayCapEnforcedForIntervalSec) cap at now. `now` is
120
+ * the server's: the gateway clips on its own clock, and a device clock an
121
+ * hour ahead put the cap an hour past it (the young window it refuses was
122
+ * asked), one an hour behind cut the newest hour off every window.
123
+ * Returns UNIX seconds.
124
+ */
125
+ export declare const calculateObReplayCapInSeconds: (intervalSec?: number, exchange?: string) => number;
126
+ /**
127
+ * Applies the orderbook replay cap to data requests: prevents fetching the
128
+ * last 3 minutes on clip-enforced intervals, passes exempt intervals
129
+ * (sub-minute) through capped at now.
130
+ *
131
+ * @param from - The start timestamp in seconds
132
+ * @param period - The period duration in seconds
133
+ * @param intervalSec - The request interval in seconds, when the caller knows it
134
+ */
135
+ export declare const applyObReplayCap: (from: number, period: number, intervalSec?: number, exchange?: string) => {
136
+ from: number;
137
+ period: number;
138
+ };