@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,120 @@
1
+ /**
2
+ * kScript packages semver grammar — a pure, DOM-free mirror of the backend's
3
+ * `PACKAGE_PUBLISH_SEMVER_RE` (plan task E2, landed + frozen on the Phase-1
4
+ * head). The seal zod on tharamine is the ENFORCEMENT point; the FE mirrors the
5
+ * exact grammar for pre-submit UX and renders any server 422 verbatim.
6
+ *
7
+ * Grammar: strict `x.y.z` with no leading zeros, an OPTIONAL prerelease
8
+ * (`-rc.1`), and NO build metadata. `+build` is rejected at every enforcement
9
+ * boundary because `parseSemver` drops build from the compare tuple, so
10
+ * `1.0.0+a` and `1.0.0+b` would collide to one logical version yet index as two
11
+ * rows with a nondeterministic `latest`.
12
+ *
13
+ * Do NOT reuse KSCRIPT_LIB_VERSION_RE (`^\d+\.\d+\.\d+$`) — it rejects the
14
+ * prerelease packages allow and tolerates leading zeros this grammar forbids.
15
+ */
16
+ /** Full package-publish semver: no leading zeros, optional prerelease, no build. */
17
+ export const KSCRIPT_PACKAGE_SEMVER_RE = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/;
18
+ /** A core-or-prerelease-or-BUILD semver — used only to distinguish "has build
19
+ * metadata" from "malformed" so the UI can show the specific `+build` hint. */
20
+ const SEMVER_WITH_BUILD_RE = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/;
21
+ /** True iff the string is an accepted package-publish version. */
22
+ export function isValidPackageSemver(version) {
23
+ return KSCRIPT_PACKAGE_SEMVER_RE.test(version.trim());
24
+ }
25
+ /**
26
+ * True iff the string is a well-formed semver whose ONLY defect is a `+build`
27
+ * suffix — lets the version input show the dedicated "build metadata is not
28
+ * accepted" hint instead of the generic "not a valid version" message.
29
+ */
30
+ export function hasBuildMetadata(version) {
31
+ const v = version.trim();
32
+ if (isValidPackageSemver(v))
33
+ return false;
34
+ return v.includes('+') && SEMVER_WITH_BUILD_RE.test(v);
35
+ }
36
+ /** Parse an accepted package semver into its compare tuple; null when invalid.
37
+ * Build metadata is intentionally NOT represented (it never affects ordering). */
38
+ export function parseSemver(version) {
39
+ const v = version.trim();
40
+ const match = KSCRIPT_PACKAGE_SEMVER_RE.exec(v);
41
+ if (!match)
42
+ return null;
43
+ return {
44
+ major: Number(match[1]),
45
+ minor: Number(match[2]),
46
+ patch: Number(match[3]),
47
+ prerelease: match[4] ? match[4].split('.') : [],
48
+ };
49
+ }
50
+ function comparePrerelease(a, b) {
51
+ // A release (no prerelease) outranks any prerelease of the same core.
52
+ if (a.length === 0 && b.length === 0)
53
+ return 0;
54
+ if (a.length === 0)
55
+ return 1;
56
+ if (b.length === 0)
57
+ return -1;
58
+ const len = Math.min(a.length, b.length);
59
+ for (let i = 0; i < len; i++) {
60
+ const ai = a[i];
61
+ const bi = b[i];
62
+ const aNum = /^\d+$/.test(ai);
63
+ const bNum = /^\d+$/.test(bi);
64
+ if (aNum && bNum) {
65
+ const diff = Number(ai) - Number(bi);
66
+ if (diff !== 0)
67
+ return diff < 0 ? -1 : 1;
68
+ }
69
+ else if (aNum !== bNum) {
70
+ // Numeric identifiers always have LOWER precedence than alphanumeric ones.
71
+ return aNum ? -1 : 1;
72
+ }
73
+ else if (ai !== bi) {
74
+ return ai < bi ? -1 : 1;
75
+ }
76
+ }
77
+ // The shorter set has lower precedence when all preceding identifiers match.
78
+ return a.length === b.length ? 0 : a.length < b.length ? -1 : 1;
79
+ }
80
+ /**
81
+ * Semver precedence compare with prerelease rules (SemVer §11). Returns <0 when
82
+ * `a` precedes `b`, 0 when equal, >0 when `a` follows `b`. An UNPARSEABLE input
83
+ * sorts lowest (deterministic, never throws), so a stray value can't reorder a
84
+ * real ledger.
85
+ */
86
+ export function compareSemver(a, b) {
87
+ const pa = parseSemver(a);
88
+ const pb = parseSemver(b);
89
+ if (!pa && !pb)
90
+ return 0;
91
+ if (!pa)
92
+ return -1;
93
+ if (!pb)
94
+ return 1;
95
+ if (pa.major !== pb.major)
96
+ return pa.major - pb.major;
97
+ if (pa.minor !== pb.minor)
98
+ return pa.minor - pb.minor;
99
+ if (pa.patch !== pb.patch)
100
+ return pa.patch - pb.patch;
101
+ return comparePrerelease(pa.prerelease, pb.prerelease);
102
+ }
103
+ /**
104
+ * The obvious next version to prefill: the patch bump of `latest` (dropping any
105
+ * prerelease so `1.2.3-rc.1` suggests `1.2.3`, not `1.2.4`). No latest (fresh
106
+ * ledger) ⇒ `1.0.0`. Never called against an `importing` envelope — real
107
+ * registry history may already be higher, so the caller suppresses the
108
+ * suggestion there (plan int-M8 / F3).
109
+ */
110
+ export function nextPatch(latest) {
111
+ if (!latest)
112
+ return '1.0.0';
113
+ const parsed = parseSemver(latest);
114
+ if (!parsed)
115
+ return '1.0.0';
116
+ // A prerelease of x.y.z releases AS x.y.z; a release bumps the patch.
117
+ if (parsed.prerelease.length > 0)
118
+ return `${parsed.major}.${parsed.minor}.${parsed.patch}`;
119
+ return `${parsed.major}.${parsed.minor}.${parsed.patch + 1}`;
120
+ }
@@ -0,0 +1,18 @@
1
+ export type KScriptRunState = 'unsaved-draft' | 'unsaved-edits';
2
+ export interface TempScriptOverlayLike {
3
+ settings?: {
4
+ customScriptId?: unknown;
5
+ };
6
+ }
7
+ export interface TempScriptWorkspaceLike<TOverlay extends TempScriptOverlayLike = TempScriptOverlayLike> {
8
+ onchart?: TOverlay[];
9
+ offchart?: TOverlay[];
10
+ multiCharts?: {
11
+ workspaces?: TempScriptWorkspaceLike<TOverlay>[];
12
+ };
13
+ }
14
+ export declare function tempScriptIdForDraft(tabId: string): string;
15
+ export declare function isTempScriptId(scriptId: unknown): boolean;
16
+ export declare function stripTempScriptOverlays<TOverlay extends TempScriptOverlayLike>(overlays: TOverlay[] | undefined): TOverlay[];
17
+ export declare function stripTempScriptOverlaysFromWorkspace<TWorkspace extends TempScriptWorkspaceLike>(workspace: TWorkspace): TWorkspace;
18
+ export declare function isKScriptRunState(value: unknown): value is KScriptRunState;
@@ -0,0 +1,25 @@
1
+ const TEMP_SCRIPT_ID = 'TEMP_SCRIPT';
2
+ const TEMP_SCRIPT_ID_PREFIX = `${TEMP_SCRIPT_ID}:`;
3
+ export function tempScriptIdForDraft(tabId) {
4
+ return tabId ? `${TEMP_SCRIPT_ID_PREFIX}${tabId}` : TEMP_SCRIPT_ID;
5
+ }
6
+ export function isTempScriptId(scriptId) {
7
+ return typeof scriptId === 'string' && (scriptId === TEMP_SCRIPT_ID || scriptId.startsWith(TEMP_SCRIPT_ID_PREFIX));
8
+ }
9
+ function isTempScriptOverlay(overlay) {
10
+ return isTempScriptId(overlay?.settings?.customScriptId);
11
+ }
12
+ export function stripTempScriptOverlays(overlays) {
13
+ return (overlays ?? []).filter((overlay) => !isTempScriptOverlay(overlay));
14
+ }
15
+ export function stripTempScriptOverlaysFromWorkspace(workspace) {
16
+ workspace.onchart = stripTempScriptOverlays(workspace.onchart);
17
+ workspace.offchart = stripTempScriptOverlays(workspace.offchart);
18
+ for (const subWorkspace of workspace.multiCharts?.workspaces ?? []) {
19
+ stripTempScriptOverlaysFromWorkspace(subWorkspace);
20
+ }
21
+ return workspace;
22
+ }
23
+ export function isKScriptRunState(value) {
24
+ return value === 'unsaved-draft' || value === 'unsaved-edits';
25
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The markets request a list of exchange-symbol pairs asks the catalog with (a leaf of services/v2.service.ts;
3
+ * P2/inventory.md section 1.1): the wrun executor's foreign pin catalog builds its request with it. Pure, its one import
4
+ * is the protocol package (a chart-host peer), so it moves into the chart-host package with the phase 2 closure; the V2
5
+ * service imports and re-exports it.
6
+ */
7
+ import { type GetMarketsRequest } from '@orangecharts/orange-v2-pb-common';
8
+ /**
9
+ * Build a Partial<GetMarketsRequest> from an array of {exchange, rawSymbol/normalizedSymbol} pairs.
10
+ * Use this when callers think in terms of symbols rather than raw GetMarketsRequest fields.
11
+ *
12
+ * @param symbols - Array of exchange-symbol pairs (use normalizedSymbol for exchanges like Hyperliquid)
13
+ * @param types - Type strings (e.g., ['TRADE', 'TICKER_AGG'])
14
+ * @param fields - Additional GetMarketsRequest fields (pageSize, pageOffset, symbolFilter, etc.)
15
+ */
16
+ export declare function buildMarketsRequestFromSymbols(symbols: Array<{
17
+ exchange: string;
18
+ rawSymbol?: string;
19
+ normalizedSymbol?: string;
20
+ }>, types: string[], fields?: Partial<Omit<GetMarketsRequest, 'type' | 'seriesFilters' | 'exchange'>>): Partial<GetMarketsRequest>;
@@ -0,0 +1,81 @@
1
+ /**
2
+ * The markets request a list of exchange-symbol pairs asks the catalog with (a leaf of services/v2.service.ts;
3
+ * P2/inventory.md section 1.1): the wrun executor's foreign pin catalog builds its request with it. Pure, its one import
4
+ * is the protocol package (a chart-host peer), so it moves into the chart-host package with the phase 2 closure; the V2
5
+ * service imports and re-exports it.
6
+ */
7
+ import { Exchange, Type } from '@orangecharts/orange-v2-pb-common';
8
+ function groupSymbolsByExchange(symbols) {
9
+ const grouped = new Map();
10
+ for (const { exchange, rawSymbol, normalizedSymbol } of symbols) {
11
+ if (!grouped.has(exchange)) {
12
+ grouped.set(exchange, { rawSymbols: [], normalizedSymbols: [] });
13
+ }
14
+ const group = grouped.get(exchange);
15
+ if (normalizedSymbol && normalizedSymbol.trim() !== '') {
16
+ group.normalizedSymbols.push(normalizedSymbol);
17
+ }
18
+ else if (rawSymbol && rawSymbol.trim() !== '') {
19
+ group.rawSymbols.push(rawSymbol);
20
+ }
21
+ }
22
+ return grouped;
23
+ }
24
+ function buildSeriesFilters(grouped) {
25
+ const filters = [];
26
+ for (const [exchangeStr, group] of grouped.entries()) {
27
+ const exchangeId = Exchange[exchangeStr];
28
+ if (!exchangeId) {
29
+ console.warn(`Unknown exchange: ${exchangeStr}`);
30
+ continue;
31
+ }
32
+ const filter = {
33
+ exchanges: [exchangeId],
34
+ rawSymbols: group.rawSymbols.length > 0 ? group.rawSymbols : [],
35
+ normalizedSymbols: group.normalizedSymbols.length > 0 ? group.normalizedSymbols : [],
36
+ };
37
+ filters.push(filter);
38
+ }
39
+ return filters;
40
+ }
41
+ /**
42
+ * Build a Partial<GetMarketsRequest> from an array of {exchange, rawSymbol/normalizedSymbol} pairs.
43
+ * Use this when callers think in terms of symbols rather than raw GetMarketsRequest fields.
44
+ *
45
+ * @param symbols - Array of exchange-symbol pairs (use normalizedSymbol for exchanges like Hyperliquid)
46
+ * @param types - Type strings (e.g., ['TRADE', 'TICKER_AGG'])
47
+ * @param fields - Additional GetMarketsRequest fields (pageSize, pageOffset, symbolFilter, etc.)
48
+ */
49
+ export function buildMarketsRequestFromSymbols(symbols, types, fields) {
50
+ const marketsRequest = {
51
+ type: types.map((type) => Type[type]),
52
+ ...fields,
53
+ };
54
+ if (symbols.length === 0) {
55
+ return marketsRequest;
56
+ }
57
+ const grouped = groupSymbolsByExchange(symbols);
58
+ // Single exchange with no symbols → request all markets on that exchange.
59
+ const firstGroup = Array.from(grouped.values())[0];
60
+ const isExchangeOnly = grouped.size === 1 && firstGroup.rawSymbols.length === 0 && firstGroup.normalizedSymbols.length === 0;
61
+ if (isExchangeOnly) {
62
+ const exchangeStr = Array.from(grouped.keys())[0];
63
+ const exchangeId = Exchange[exchangeStr];
64
+ if (!exchangeId) {
65
+ console.warn(`Unknown exchange: ${exchangeStr}`);
66
+ return marketsRequest;
67
+ }
68
+ marketsRequest.exchange = [exchangeId];
69
+ // For POLYMARKET, use rawSymbol from symbols array as symbolFilter if available
70
+ if (exchangeStr === 'POLYMARKET' && symbols.length > 0) {
71
+ const rawSymbol = symbols[0].rawSymbol;
72
+ if (rawSymbol && rawSymbol !== '' && !marketsRequest.symbolFilter) {
73
+ marketsRequest.symbolFilter = rawSymbol;
74
+ }
75
+ }
76
+ }
77
+ else {
78
+ marketsRequest.seriesFilters = buildSeriesFilters(grouped);
79
+ }
80
+ return marketsRequest;
81
+ }
@@ -0,0 +1,103 @@
1
+ /**
2
+ * The governed tier rules (a leaf of utility/v2/governed-route.util.ts; P2/inventory.md section 1.1): which slot and
3
+ * which delay a governed exchange's data rides for a served access, the names the live tick and the executor read. They
4
+ * read package modules only (the CME cache context, the socket slots, the gate planes), so this leaf moves into the
5
+ * chart-host package with the phase 2 closure; the old module re-exports its public names and imports back the ones it
6
+ * still uses.
7
+ */
8
+ import type { CmeServedAccess } from '../../interfaces/cme-realtime.interface.js';
9
+ import { type LivefeedSlotId, type ReaderSlotId, type WsSlotId } from '../../workers/constants/socket-slots.js';
10
+ /**
11
+ * What a caller is asking for, transport-agnostic. `candles` = all StreamPoints
12
+ * reader traffic (OHLCV, indicators, heatmap); `metadata` = the one-shot reader
13
+ * wrappers (reference data, always the delayed reader); `optionSummary` = a
14
+ * quoted option chain summary (market data, so it rides the served-access tier
15
+ * like candles); `trades`/`book` = live-feed streams. Reader kinds ride the
16
+ * plane's reader tier slot, feed kinds its live-feed tier slot (one socket
17
+ * carries both trades and book); the realtime/delayed variant comes from served
18
+ * access.
19
+ */
20
+ export type DataKind = 'candles' | 'metadata' | 'optionSummary' | 'trades' | 'book';
21
+ export declare function isReaderKind(kind: DataKind): boolean;
22
+ /**
23
+ * Realtime served, but capped at top-of-book (the p1 plan). That lane REJECTS an
24
+ * over-request ("depth exceeds plan cap") rather than clamping it; the delayed
25
+ * lane is never capped.
26
+ */
27
+ export declare function isRealtimeDepthCapped(access: CmeServedAccess | undefined): boolean;
28
+ /**
29
+ * True when a request targets ONE gate plane exclusively (CME or OPRA). Read from
30
+ * the RAW payload exchange: a string, a pb-common enum id, or an array of either.
31
+ *
32
+ * `.every` (not `.some`) is load-bearing: a cross-exchange metadata query (e.g.
33
+ * categories over 30 exchanges that happen to include CME) must keep the ungated
34
+ * reader, and a request spanning two planes rides neither. False for a refused
35
+ * request too; callers that must tell refused from public read
36
+ * `classifyGateRequestPlane` (or `resolveCmeRoute`'s `refused` transport).
37
+ */
38
+ export declare function isGovernedExchange(exchange: unknown): boolean;
39
+ /**
40
+ * The gate slot for a governed request, or `null` when no single plane governs
41
+ * it (public, or refused: the worker reads the refusal through
42
+ * {@link planGovernedReaderRequest}, the main thread through
43
+ * {@link resolveCmeRoute}). The plane comes from the request's own exchange
44
+ * (`classifyGateRequestPlane`), the tier from served access. Slot-only, no guest
45
+ * gating: the worker send path uses this; guest handling is main-thread, in
46
+ * {@link resolveCmeRoute}.
47
+ *
48
+ * `wantsDepth` is the mixed-tier (R5b) axis: a full-depth book request on a
49
+ * realtime-L1-capped (p1) exchange routes to the DELAYED slot — delayed depth
50
+ * is never capped, while the realtime socket would silently serve one level.
51
+ * It defaults TRUE for the `book` kind as fail-safety: a call site that
52
+ * forgets to classify can never strand a full book on the capped socket; the
53
+ * one consumer that genuinely wants realtime top-of-book opts in with
54
+ * `wantsDepth: false`. Non-book kinds never route by depth.
55
+ */
56
+ export declare function resolveGovernedSlot(exchange: unknown, kind: 'candles' | 'metadata' | 'optionSummary', access?: CmeServedAccess, wantsDepth?: boolean): ReaderSlotId | null;
57
+ export declare function resolveGovernedSlot(exchange: unknown, kind: 'trades' | 'book', access?: CmeServedAccess, wantsDepth?: boolean): LivefeedSlotId | null;
58
+ export declare function resolveGovernedSlot(exchange: unknown, kind: DataKind, access?: CmeServedAccess, wantsDepth?: boolean): WsSlotId | null;
59
+ /**
60
+ * The reader tier a quoted option chain summary of a governed exchange rides now, on this thread's
61
+ * served-access mirror: the tier of the slot {@link resolveGovernedSlot} picks for the `optionSummary`
62
+ * kind, so the worker's chain store and the main thread's wrun chain lane name the tier the routing
63
+ * uses. Delayed for an exchange no gate governs, and until the gate confirms real-time.
64
+ */
65
+ export declare function governedOptionSummaryTier(exchange: string | undefined | null): 'realtime' | 'delayed';
66
+ /**
67
+ * The reader tier a governed market-data read (StreamPoints: a print, a per-contract or a flow aggregate,
68
+ * a strike or a surface series) of an exchange rides now, on this thread's served-access mirror: the tier of
69
+ * the slot {@link resolveGovernedSlot} picks for the `candles` kind, the one the worker routes StreamPoints by.
70
+ * A wrun lane that reads such a series names this tier in its acquisition and its legend note. Delayed for
71
+ * an exchange no gate governs, and until the gate confirms real-time.
72
+ */
73
+ export declare function governedMarketDataTier(exchange: string | undefined | null): 'realtime' | 'delayed';
74
+ /**
75
+ * Extra seconds subtracted from a bounded window's end, on TOP of the delay.
76
+ *
77
+ * Since 2026-07-28 the gate no longer refuses a delayed window that reaches
78
+ * inside the embargo: it clamps the window to end at `now - delay`
79
+ * (cme-entitlement-service `clampDelayedWindow`). The margin stays for the
80
+ * boundary bucket: the reader serves the bucket holding the window end WHOLE,
81
+ * so a window ending at `now - delay` would ship up to one 1m bar of data
82
+ * younger than the delay. Ending `margin` behind it keeps that 1m boundary
83
+ * bucket older than the delay, even with a client clock running less than a
84
+ * minute ahead of the gate.
85
+ *
86
+ * The cost is the delayed SEAM: history ends `delay + margin` behind now while
87
+ * the delayed feed starts `delay` behind it, so on intervals finer than the
88
+ * margin whole candles in between are missing until they exit the embargo.
89
+ * Seam polling fills them (`delayedSeamPollWindowMs`). Shrink the margin only
90
+ * once the gate cuts its boundary buckets at the window end.
91
+ */
92
+ export declare const CME_DELAYED_EMBARGO_MARGIN_SECONDS = 120;
93
+ /**
94
+ * The delay the delayed lane is serving for this account: the tier frame's
95
+ * reported `delay_seconds` where available, else the exchange's plane default
96
+ * (`delayedDefaultSecondsFor`: CME 600 s, OPRA 900 s; an absent exchange keeps
97
+ * CME's, the shape every caller had before a second plane). Only the delayed
98
+ * variant of the union carries `delaySeconds`. A mixed-tier p1 account
99
+ * (realtime ticks, L1-capped) routes its DEPTH requests to the delayed lane
100
+ * while its timing is 'realtime', so that path always takes the nominal
101
+ * fallback, which is exactly why the margin above is not optional.
102
+ */
103
+ export declare function servedDelaySecondsForAccess(access: CmeServedAccess | undefined, exchange?: unknown): number;
@@ -0,0 +1,113 @@
1
+ import { cmeServedAccessForExchange } from '../chart/cme-cache-context.util.js';
2
+ import { delayedDefaultSecondsFor, governedPlaneOf } from './gate-plane.util.js';
3
+ import { gateSlotForTier, SOCKET_SLOTS, } from '../../workers/constants/socket-slots.js';
4
+ export function isReaderKind(kind) {
5
+ return kind === 'candles' || kind === 'metadata' || kind === 'optionSummary';
6
+ }
7
+ /** Realtime iff a socket serving this exchange has said so; unknown is delayed-safe. */
8
+ function isRealtimeServed(access) {
9
+ return access?.status === 'known' && access.timing === 'realtime';
10
+ }
11
+ /**
12
+ * Realtime served, but capped at top-of-book (the p1 plan). That lane REJECTS an
13
+ * over-request ("depth exceeds plan cap") rather than clamping it; the delayed
14
+ * lane is never capped.
15
+ */
16
+ export function isRealtimeDepthCapped(access) {
17
+ return access?.status === 'known' && access.timing === 'realtime' && access.depth === 'l1';
18
+ }
19
+ /**
20
+ * True when a request targets ONE gate plane exclusively (CME or OPRA). Read from
21
+ * the RAW payload exchange: a string, a pb-common enum id, or an array of either.
22
+ *
23
+ * `.every` (not `.some`) is load-bearing: a cross-exchange metadata query (e.g.
24
+ * categories over 30 exchanges that happen to include CME) must keep the ungated
25
+ * reader, and a request spanning two planes rides neither. False for a refused
26
+ * request too; callers that must tell refused from public read
27
+ * `classifyGateRequestPlane` (or `resolveCmeRoute`'s `refused` transport).
28
+ */
29
+ export function isGovernedExchange(exchange) {
30
+ return governedPlaneOf(exchange) !== null;
31
+ }
32
+ export function resolveGovernedSlot(exchange, kind, access, wantsDepth = kind === 'book') {
33
+ const plane = governedPlaneOf(exchange);
34
+ if (plane === null)
35
+ return null;
36
+ // Path-based tier (contract C1): route by the exchange's served access.
37
+ // Realtime-served rides `/live/*`; unknown or delayed rides `/delayed/*` (safe
38
+ // for free+, and a delayed socket's tier frame still reveals the full
39
+ // entitlement map). Mixed-tier (R5b): a depth-wanting request on a
40
+ // realtime-but-L1-capped exchange rides `/delayed/*` for the uncapped book
41
+ // while ticks stay realtime — the caller holds both sockets at once.
42
+ const realtime = isRealtimeServed(access);
43
+ const delayed = !realtime || (wantsDepth && isRealtimeDepthCapped(access));
44
+ // Metadata one-shots (StreamMarkets / RawSymbols / BlockSizes) are reference
45
+ // data — symbol lists and block sizes, not time-series market data. They are
46
+ // tier-agnostic and signature-only, so they always ride the delayed reader
47
+ // regardless of entitlement; only market data earns the realtime path. An
48
+ // option chain SUMMARY carries quotes, so it is market data (`optionSummary`).
49
+ if (kind === 'metadata')
50
+ return gateSlotForTier(plane.provider, 'reader', 'delayed');
51
+ const tier = delayed ? 'delayed' : 'realtime';
52
+ return isReaderKind(kind)
53
+ ? gateSlotForTier(plane.provider, 'reader', tier)
54
+ : gateSlotForTier(plane.provider, 'livefeed', tier);
55
+ }
56
+ /**
57
+ * The reader tier a quoted option chain summary of a governed exchange rides now, on this thread's
58
+ * served-access mirror: the tier of the slot {@link resolveGovernedSlot} picks for the `optionSummary`
59
+ * kind, so the worker's chain store and the main thread's wrun chain lane name the tier the routing
60
+ * uses. Delayed for an exchange no gate governs, and until the gate confirms real-time.
61
+ */
62
+ export function governedOptionSummaryTier(exchange) {
63
+ if (!exchange)
64
+ return 'delayed';
65
+ const slot = resolveGovernedSlot(exchange, 'optionSummary', cmeServedAccessForExchange(exchange));
66
+ return slot !== null && SOCKET_SLOTS[slot].tier === 'realtime' ? 'realtime' : 'delayed';
67
+ }
68
+ /**
69
+ * The reader tier a governed market-data read (StreamPoints: a print, a per-contract or a flow aggregate,
70
+ * a strike or a surface series) of an exchange rides now, on this thread's served-access mirror: the tier of
71
+ * the slot {@link resolveGovernedSlot} picks for the `candles` kind, the one the worker routes StreamPoints by.
72
+ * A wrun lane that reads such a series names this tier in its acquisition and its legend note. Delayed for
73
+ * an exchange no gate governs, and until the gate confirms real-time.
74
+ */
75
+ export function governedMarketDataTier(exchange) {
76
+ if (!exchange)
77
+ return 'delayed';
78
+ const slot = resolveGovernedSlot(exchange, 'candles', cmeServedAccessForExchange(exchange));
79
+ return slot !== null && SOCKET_SLOTS[slot].tier === 'realtime' ? 'realtime' : 'delayed';
80
+ }
81
+ /**
82
+ * Extra seconds subtracted from a bounded window's end, on TOP of the delay.
83
+ *
84
+ * Since 2026-07-28 the gate no longer refuses a delayed window that reaches
85
+ * inside the embargo: it clamps the window to end at `now - delay`
86
+ * (cme-entitlement-service `clampDelayedWindow`). The margin stays for the
87
+ * boundary bucket: the reader serves the bucket holding the window end WHOLE,
88
+ * so a window ending at `now - delay` would ship up to one 1m bar of data
89
+ * younger than the delay. Ending `margin` behind it keeps that 1m boundary
90
+ * bucket older than the delay, even with a client clock running less than a
91
+ * minute ahead of the gate.
92
+ *
93
+ * The cost is the delayed SEAM: history ends `delay + margin` behind now while
94
+ * the delayed feed starts `delay` behind it, so on intervals finer than the
95
+ * margin whole candles in between are missing until they exit the embargo.
96
+ * Seam polling fills them (`delayedSeamPollWindowMs`). Shrink the margin only
97
+ * once the gate cuts its boundary buckets at the window end.
98
+ */
99
+ export const CME_DELAYED_EMBARGO_MARGIN_SECONDS = 120;
100
+ /**
101
+ * The delay the delayed lane is serving for this account: the tier frame's
102
+ * reported `delay_seconds` where available, else the exchange's plane default
103
+ * (`delayedDefaultSecondsFor`: CME 600 s, OPRA 900 s; an absent exchange keeps
104
+ * CME's, the shape every caller had before a second plane). Only the delayed
105
+ * variant of the union carries `delaySeconds`. A mixed-tier p1 account
106
+ * (realtime ticks, L1-capped) routes its DEPTH requests to the delayed lane
107
+ * while its timing is 'realtime', so that path always takes the nominal
108
+ * fallback, which is exactly why the margin above is not optional.
109
+ */
110
+ export function servedDelaySecondsForAccess(access, exchange) {
111
+ return ((access?.status === 'known' && access.timing === 'delayed' ? access.delaySeconds : undefined) ??
112
+ delayedDefaultSecondsFor(exchange));
113
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The watchlist import's markets request shape (a leaf of utility/watchlist/import/import-resolution.util.ts;
3
+ * P2/inventory.md section 1.1): the timeout of one markets request and the types it asks for, which the wrun executor's
4
+ * foreign pin catalog asks with. Constants only, no imports, so it moves into the chart-host package with the phase 2
5
+ * closure; the import resolution module imports and re-exports both. The type list stays a `const` read-only array
6
+ * over a literal, never written (the phase 2 leaf-state guard's immutable form).
7
+ */
8
+ export declare const IMPORT_REQUEST_TIMEOUT_MS = 20000;
9
+ /** The types the poll asks for: a priced row of any venue answers on one of them. */
10
+ export declare const IMPORT_MARKET_TYPES: readonly string[];
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The watchlist import's markets request shape (a leaf of utility/watchlist/import/import-resolution.util.ts;
3
+ * P2/inventory.md section 1.1): the timeout of one markets request and the types it asks for, which the wrun executor's
4
+ * foreign pin catalog asks with. Constants only, no imports, so it moves into the chart-host package with the phase 2
5
+ * closure; the import resolution module imports and re-exports both. The type list stays a `const` read-only array
6
+ * over a literal, never written (the phase 2 leaf-state guard's immutable form).
7
+ */
8
+ export const IMPORT_REQUEST_TIMEOUT_MS = 20_000;
9
+ /** The types the poll asks for: a priced row of any venue answers on one of them. */
10
+ export const IMPORT_MARKET_TYPES = ['TICKER_AGG', 'TRADE'];
@@ -1,30 +1,58 @@
1
1
  /**
2
- * The `option_daily` lane (UW-PARITY source S5a): the chart underlying's daily options statistics (US listed options,
3
- * OPRA) as 31 scalars, a daily join (`input("iv30", option_daily.atm_iv_30d, { missing: "nan" })`): the underlying as
2
+ * The `option_daily` lane (UW-PARITY source S5a, OPTIONS-PORT P5): the daily options statistics of the chart's options
3
+ * chain as 31 scalars, a daily join (`input("iv30", option_daily.atm_iv_30d, { missing: "nan" })`): the underlying as
4
4
  * a symbol code, its price, the at-the-money IV at nine tenors, the 30-day 25-delta risk reversal, call and put
5
5
  * volume, premium and open interest, the net exposures, the walls, the gamma flip and magnet, the front expiry's max
6
- * pain and implied move, and the contracts counted (wrun-opra-stats.leaf).
6
+ * pain and implied move, and the contracts counted (wrun-opra-stats.leaf, its units per plane).
7
7
  *
8
- * It reads OPTION_UNDERLYING_STATS DAY rows by coin through `K_OPTION_UNDERLYING_STATS_DAY` (om's fetch type
9
- * `option_underlying_stats_day`) and its worker twin. A DAY row is stamped at its New York session date's UTC
10
- * midnight and written after that session's close, so the daily `last` landing lands it on the first chart bar of
11
- * that UTC day and carries it across the day; the day before's row stands until the session's row is written
12
- * (`lookbackDays` 7 keeps it in the ask after a holiday weekend). Not `global`: it follows the chart's underlying,
13
- * read on the OPRA plane's native-rows path (`nativeRows` with a daily join), so the index-mode stock chart serves it.
8
+ * It reads OPTION_UNDERLYING_STATS DAY rows through `K_OPTION_UNDERLYING_STATS_DAY` (om's fetch type
9
+ * `option_underlying_stats_day`) and its worker twin. A DAY row is stamped at its session date's UTC midnight and
10
+ * written after that session closes, so the daily `last` landing lands it on the first chart bar of that UTC day and
11
+ * carries it across the day; the day before's row stands until the session's row is written (`lookbackDays` 7 keeps
12
+ * it in the ask after a holiday weekend).
13
+ *
14
+ * A CHAIN lane (`chain`): the chain is the one chain resolver's (opra-option-lanes.util `resolveWrunLaneChainChart`
15
+ * then `decideWrunLaneChain`, the decision `options_chain` and `option_surface` read), per input, and its plane is per
16
+ * instance: OPRA's rules on a US stock or OPRA contract chart, CME's on a CME futures chart (a continuous chart reads
17
+ * its lead contract, and a live session rebuilds once the lead rolls: `acquisitionMoved`), none on a crypto chain. On
18
+ * the OPRA plane (`ctx.opraPlane`, the planner's verdict) the chain is the plane's own by coin
19
+ * (`wrunLaneOpraPlaneChain`): the read goes by coin with no chain directory read, as it always went, so a stock listing
20
+ * no options or a directory that does not answer refuses nothing before the read. Each input reads ONE book, decided
21
+ * when the run plans (`auto`: the chain's default book) and named in the acquisition off OPRA. It rides the
22
+ * native-rows path on every plane (`nativeRows`), so the index-mode stock chart serves it too.
14
23
  *
15
24
  * Refused by name before any fetch: `opra-official-only:option_daily` for a package that may not read US options, a
16
- * chart that names no underlying, and `protocol-pending:OPTION_UNDERLYING_STATS` until the protocol release. An
17
- * underlying with no row in the window answers empty: the empty-answer rule speaks for it.
25
+ * chart that names no underlying, `protocol-pending:OPTION_UNDERLYING_STATS` until the protocol release, a chart whose
26
+ * options a known stop keeps off the OPRA plane (`options-stopped`), a chart with no option chain (the options chain's
27
+ * `no-chain`), the CME display wall for a package that is not OpenMarket's own and a venue or book outside its words.
28
+ * The planner drops an input that declared `missing: "nan"` or `"zero"` instead of the stop's and the no-chain refusal
29
+ * (a note names the feed). An underlying with no row in the window answers empty: the empty-answer rule speaks for it.
18
30
  */
19
- import { type WrunPollLane, type WrunPollLaneContext, type WrunPollLaneExtras } from '../wrun-poll-lane.types.js';
31
+ import { type WrunPollLane, type WrunPollLaneContext, type WrunPollLaneExtras, type WrunPollLaneSource } from '../wrun-poll-lane.types.js';
32
+ import { type WrunLaneChain } from '../opra-option-lanes.util.js';
20
33
  /** The lane key (the refusal record's feed words, `wrun.refusal.feed.optionDaily`). */
21
34
  export declare const WRUN_OPTION_DAILY_LANE_KEY = "option_daily";
22
35
  /** The days before the chart window the ask opens: a session's row is written after its close, so the newest row
23
36
  * standing at the window's head can be a few days old (a weekend, a holiday). */
24
37
  export declare const WRUN_OPTION_DAILY_LOOKBACK_DAYS = 7;
25
38
  /**
26
- * One input against the chart: its underlying (the chart's coin, upper case), then the protocol gate. Shared with
27
- * `option_stats_10m`, which reads the same underlying at ten minutes.
39
+ * An input's acquisition, the chain it reads as the ask's fields (the acquisition key: the class, the plane its
40
+ * exchange names, the exchange, the underlying, the book and the grain): `coin`, the chain's underlying (the OPRA
41
+ * ticker, the CME futures contract, a crypto venue's root coin: the key the plane files its rows under), and
42
+ * `statsExchange` always; `statsBook`, the ONE book the run decided, on every plane but OPRA (an OPRA read stays by
43
+ * coin with no symbol: contract C1); `statsContinuous` for a CME chain read off a continuous alias
44
+ * (`wrunOptionStatsAcquisitionMoved` reads it).
45
+ */
46
+ export declare function wrunOptionStatsExtras(chain: WrunLaneChain): Record<string, unknown>;
47
+ /** Whether an acquisition no longer names the chain the lane would plan now (D12): a CME chain read off a continuous
48
+ * alias whose lead contract rolled since the run planned it (`wrunLaneChainLeadMoved`). A live session holding it
49
+ * rebuilds, so no ask, cache or buffer joins the old contract's statistics to the new one's. */
50
+ export declare function wrunOptionStatsAcquisitionMoved(acquisition: Readonly<Record<string, unknown>>): boolean;
51
+ /**
52
+ * One input against the chart: a chart that names no underlying refused by name, the protocol gate, then the chain
53
+ * (the run's one resolution of the chart, `statsChartOf`: on the OPRA plane the plane's own by coin, no directory read)
54
+ * and the input's `venue` and `book` decided by the one chain resolver; its refusals are the options chain's own.
55
+ * Shared with `option_stats_10m`, which reads the same chain at ten minutes.
28
56
  */
29
- export declare function planWrunOptionStatsInput(ctx: WrunPollLaneContext, feed: string, series: string): Promise<WrunPollLaneExtras>;
57
+ export declare function planWrunOptionStatsInput(source: WrunPollLaneSource, ctx: WrunPollLaneContext, feed: string, series: string): Promise<WrunPollLaneExtras>;
30
58
  export declare const lane: WrunPollLane;