@orangecharts/wrun-chart-host 0.2.0 → 0.4.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 (342) hide show
  1. package/README.md +22 -8
  2. package/dist/constants/common.constants.d.ts +15 -0
  3. package/dist/constants/common.constants.js +23 -0
  4. package/dist/constants/data-source.constants.d.ts +1 -0
  5. package/dist/constants/data-source.constants.js +1 -0
  6. package/dist/constants/economic.constants.d.ts +39 -0
  7. package/dist/constants/economic.constants.js +77 -0
  8. package/dist/constants/etf-covered-coins.constants.d.ts +1 -0
  9. package/dist/constants/etf-covered-coins.constants.js +9 -0
  10. package/dist/constants/feature-flags.constants.d.ts +60 -0
  11. package/dist/constants/feature-flags.constants.js +308 -0
  12. package/dist/constants/feature-limits.constants.d.ts +134 -0
  13. package/dist/constants/feature-limits.constants.js +155 -0
  14. package/dist/constants/marketCapabilities.constants.d.ts +87 -0
  15. package/dist/constants/marketCapabilities.constants.js +213 -0
  16. package/dist/constants/option-venues.constants.d.ts +100 -0
  17. package/dist/constants/option-venues.constants.js +167 -0
  18. package/dist/constants/overlay-data.constants.d.ts +53 -0
  19. package/dist/constants/overlay-data.constants.js +80 -0
  20. package/dist/constants/pane-grid.constants.d.ts +15 -0
  21. package/dist/constants/pane-grid.constants.js +17 -0
  22. package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +133 -0
  23. package/dist/constants/scriptEditor/builtin-script-snippets.js +451 -0
  24. package/dist/constants/venue-presets.constants.d.ts +10 -0
  25. package/dist/constants/venue-presets.constants.js +22 -0
  26. package/dist/enums/chart.enum.d.ts +68 -0
  27. package/dist/enums/chart.enum.js +70 -0
  28. package/dist/helpers/data.helpers.d.ts +2 -0
  29. package/dist/helpers/data.helpers.js +14 -0
  30. package/dist/host-env.d.ts +163 -5
  31. package/dist/host-ports.types.d.ts +431 -0
  32. package/dist/host-ports.types.js +1 -0
  33. package/dist/index.d.ts +138 -0
  34. package/dist/index.js +138 -0
  35. package/dist/indicators/controls/technical-script/technical-script-input-rendering.d.ts +86 -0
  36. package/dist/indicators/controls/technical-script/technical-script-input-rendering.js +179 -0
  37. package/dist/interfaces/asset-venue.interface.d.ts +91 -0
  38. package/dist/interfaces/asset-venue.interface.js +1 -0
  39. package/dist/interfaces/cancel-reason.interface.d.ts +24 -0
  40. package/dist/interfaces/cancel-reason.interface.js +2 -0
  41. package/dist/interfaces/catalog-display.interface.d.ts +3 -0
  42. package/dist/interfaces/catalog-display.interface.js +1 -0
  43. package/dist/interfaces/cme-realtime.interface.d.ts +251 -0
  44. package/dist/interfaces/cme-realtime.interface.js +46 -0
  45. package/dist/interfaces/feed.interface.d.ts +80 -0
  46. package/dist/interfaces/feed.interface.js +7 -0
  47. package/dist/interfaces/market-kind.interface.d.ts +8 -0
  48. package/dist/interfaces/market-kind.interface.js +1 -0
  49. package/dist/interfaces/opra-realtime.interface.d.ts +224 -0
  50. package/dist/interfaces/opra-realtime.interface.js +105 -0
  51. package/dist/interfaces/option-instrument.interface.d.ts +32 -0
  52. package/dist/interfaces/option-instrument.interface.js +1 -0
  53. package/dist/interfaces/options-chain-scope.interface.d.ts +29 -0
  54. package/dist/interfaces/options-chain-scope.interface.js +7 -0
  55. package/dist/interfaces/prediction-market.interface.d.ts +88 -0
  56. package/dist/interfaces/prediction-market.interface.js +8 -0
  57. package/dist/interfaces/wrun-runtime.interface.d.ts +5 -0
  58. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +185 -0
  59. package/dist/kscript-data/controls/live-trades-merge.util.js +357 -0
  60. package/dist/settings-templates/frvp-fields.d.ts +27 -0
  61. package/dist/settings-templates/frvp-fields.js +108 -0
  62. package/dist/settings-templates/index.d.ts +119 -0
  63. package/dist/settings-templates/index.js +442 -0
  64. package/dist/settings-templates/indicator-fields.d.ts +56 -0
  65. package/dist/settings-templates/indicator-fields.js +793 -0
  66. package/dist/settings-templates/tool-rules.d.ts +59 -0
  67. package/dist/settings-templates/tool-rules.js +49 -0
  68. package/dist/settings-templates/tool-tables.generated.d.ts +2 -0
  69. package/dist/settings-templates/tool-tables.generated.js +1668 -0
  70. package/dist/utility/blk-market.util.d.ts +5 -0
  71. package/dist/utility/blk-market.util.js +12 -0
  72. package/dist/utility/chart/chart-load-phase.util.d.ts +32 -0
  73. package/dist/utility/chart/chart-load-phase.util.js +78 -0
  74. package/dist/utility/chart/cme-cache-context.util.d.ts +108 -0
  75. package/dist/utility/chart/cme-cache-context.util.js +166 -0
  76. package/dist/utility/chart/cme-session-bucket.util.d.ts +82 -0
  77. package/dist/utility/chart/cme-session-bucket.util.js +343 -0
  78. package/dist/utility/chart/cme-trade-calendar.util.d.ts +26 -0
  79. package/dist/utility/chart/cme-trade-calendar.util.js +147 -0
  80. package/dist/utility/chart/continuous-contracts.util.d.ts +138 -0
  81. package/dist/utility/chart/continuous-contracts.util.js +374 -0
  82. package/dist/utility/chart/date-labelled-interval.leaf.d.ts +15 -0
  83. package/dist/utility/chart/date-labelled-interval.leaf.js +19 -0
  84. package/dist/utility/chart/feed-interval.util.d.ts +119 -0
  85. package/dist/utility/chart/feed-interval.util.js +321 -0
  86. package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +110 -0
  87. package/dist/utility/chart/fetch-dedupe-policy.util.js +407 -0
  88. package/dist/utility/chart/footprint-band.util.d.ts +76 -0
  89. package/dist/utility/chart/footprint-band.util.js +205 -0
  90. package/dist/utility/chart/footprint-cell-identity.util.d.ts +82 -0
  91. package/dist/utility/chart/footprint-cell-identity.util.js +346 -0
  92. package/dist/utility/chart/formula-calendar.util.d.ts +27 -0
  93. package/dist/utility/chart/formula-calendar.util.js +59 -0
  94. package/dist/utility/chart/history-wall.util.d.ts +67 -0
  95. package/dist/utility/chart/history-wall.util.js +87 -0
  96. package/dist/utility/chart/index-mode.util.d.ts +66 -0
  97. package/dist/utility/chart/index-mode.util.js +360 -0
  98. package/dist/utility/chart/indicator-coverage-planner.util.d.ts +217 -0
  99. package/dist/utility/chart/indicator-coverage-planner.util.js +443 -0
  100. package/dist/utility/chart/indicator-coverage-state.util.d.ts +33 -0
  101. package/dist/utility/chart/indicator-coverage-state.util.js +110 -0
  102. package/dist/utility/chart/indicator-gap-detector.util.d.ts +127 -0
  103. package/dist/utility/chart/indicator-gap-detector.util.js +260 -0
  104. package/dist/utility/chart/indicator-gap-repair.util.d.ts +88 -0
  105. package/dist/utility/chart/indicator-gap-repair.util.js +177 -0
  106. package/dist/utility/chart/indicator-inflight-registry.util.d.ts +26 -0
  107. package/dist/utility/chart/indicator-inflight-registry.util.js +254 -0
  108. package/dist/utility/chart/indicator-run-interval.util.d.ts +130 -0
  109. package/dist/utility/chart/indicator-run-interval.util.js +268 -0
  110. package/dist/utility/chart/interval-registry.util.d.ts +23 -0
  111. package/dist/utility/chart/interval-registry.util.js +83 -0
  112. package/dist/utility/chart/kscript-main-grid-stages.util.d.ts +21 -0
  113. package/dist/utility/chart/kscript-main-grid-stages.util.js +332 -0
  114. package/dist/utility/chart/legacy-exchange.leaf.d.ts +11 -0
  115. package/dist/utility/chart/legacy-exchange.leaf.js +43 -0
  116. package/dist/utility/chart/live-bucket.util.d.ts +66 -0
  117. package/dist/utility/chart/live-bucket.util.js +165 -0
  118. package/dist/utility/chart/market-session-schedule.util.d.ts +91 -0
  119. package/dist/utility/chart/market-session-schedule.util.js +337 -0
  120. package/dist/utility/chart/marketKind.util.d.ts +181 -0
  121. package/dist/utility/chart/marketKind.util.js +371 -0
  122. package/dist/utility/chart/opra-read-access.leaf.d.ts +26 -0
  123. package/dist/utility/chart/opra-read-access.leaf.js +25 -0
  124. package/dist/utility/chart/prediction-identity.util.d.ts +159 -0
  125. package/dist/utility/chart/prediction-identity.util.js +236 -0
  126. package/dist/utility/chart/rth-session.util.d.ts +352 -0
  127. package/dist/utility/chart/rth-session.util.js +926 -0
  128. package/dist/utility/chart/titan-constants.pin.d.ts +43 -0
  129. package/dist/utility/chart/titan-constants.pin.js +50 -0
  130. package/dist/utility/chart/us-equities-session.util.d.ts +127 -0
  131. package/dist/utility/chart/us-equities-session.util.js +251 -0
  132. package/dist/utility/chart/window-geometry.leaf.d.ts +119 -0
  133. package/dist/utility/chart/window-geometry.leaf.js +391 -0
  134. package/dist/utility/chart/window-owner.leaf.d.ts +19 -0
  135. package/dist/utility/chart/window-owner.leaf.js +24 -0
  136. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +100 -0
  137. package/dist/utility/chart/wrun-bar-session-facts.util.js +354 -0
  138. package/dist/utility/chart/wrun-wire-ref.util.d.ts +23 -0
  139. package/dist/utility/chart/wrun-wire-ref.util.js +16 -0
  140. package/dist/utility/common/safe-math-eval.d.ts +18 -0
  141. package/dist/utility/common/safe-math-eval.js +160 -0
  142. package/dist/utility/common/time.util.d.ts +134 -0
  143. package/dist/utility/common/time.util.js +428 -0
  144. package/dist/utility/common/transformations.util.d.ts +126 -0
  145. package/dist/utility/common/transformations.util.js +711 -0
  146. package/dist/utility/common/visible-timeout.util.d.ts +17 -0
  147. package/dist/utility/common/visible-timeout.util.js +75 -0
  148. package/dist/utility/exchange-normalization.util.d.ts +8 -0
  149. package/dist/utility/exchange-normalization.util.js +32 -0
  150. package/dist/utility/html-escape.leaf.d.ts +11 -0
  151. package/dist/utility/html-escape.leaf.js +20 -0
  152. package/dist/utility/intl-locale.util.d.ts +2 -0
  153. package/dist/utility/intl-locale.util.js +28 -0
  154. package/dist/utility/number-format.util.d.ts +14 -1
  155. package/dist/utility/number-format.util.js +50 -19
  156. package/dist/utility/options/option-symbol.util.d.ts +28 -0
  157. package/dist/utility/options/option-symbol.util.js +176 -0
  158. package/dist/utility/options/option-trade-units.util.d.ts +190 -0
  159. package/dist/utility/options/option-trade-units.util.js +283 -0
  160. package/dist/utility/options/option-venue.util.d.ts +75 -0
  161. package/dist/utility/options/option-venue.util.js +85 -0
  162. package/dist/utility/pool-symbol.leaf.d.ts +34 -0
  163. package/dist/utility/pool-symbol.leaf.js +95 -0
  164. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.d.ts +109 -0
  165. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +302 -0
  166. package/dist/utility/symbol-selection/contract-expiry.util.d.ts +39 -0
  167. package/dist/utility/symbol-selection/contract-expiry.util.js +111 -0
  168. package/dist/utility/v2/gate-plane.util.d.ts +58 -0
  169. package/dist/utility/v2/gate-plane.util.js +99 -0
  170. package/dist/utility/v2/gate-session-latch.util.d.ts +22 -0
  171. package/dist/utility/v2/gate-session-latch.util.js +34 -0
  172. package/dist/utility/watchlist/import/tradingview-symbols.leaf.d.ts +76 -0
  173. package/dist/utility/watchlist/import/tradingview-symbols.leaf.js +221 -0
  174. package/dist/utility/wrun/sources/host-grid-landing.d.ts +15 -0
  175. package/dist/utility/wrun/sources/host-grid-landing.js +26 -0
  176. package/dist/utility/wrun/sources/lanes/bitfinex_funding.d.ts +27 -0
  177. package/dist/utility/wrun/sources/lanes/bitfinex_funding.js +85 -0
  178. package/dist/utility/wrun/sources/lanes/economic.d.ts +27 -0
  179. package/dist/utility/wrun/sources/lanes/economic.js +79 -0
  180. package/dist/utility/wrun/sources/lanes/etf_holdings.d.ts +35 -0
  181. package/dist/utility/wrun/sources/lanes/etf_holdings.js +165 -0
  182. package/dist/utility/wrun/sources/lanes/etf_premium.d.ts +19 -0
  183. package/dist/utility/wrun/sources/lanes/etf_premium.js +114 -0
  184. package/dist/utility/wrun/sources/lanes/ethena_positions.d.ts +30 -0
  185. package/dist/utility/wrun/sources/lanes/ethena_positions.js +51 -0
  186. package/dist/utility/wrun/sources/lanes/index.d.ts +2 -0
  187. package/dist/utility/wrun/sources/lanes/index.js +32 -0
  188. package/dist/utility/wrun/sources/lanes/long_short_ratio.d.ts +17 -0
  189. package/dist/utility/wrun/sources/lanes/long_short_ratio.js +47 -0
  190. package/dist/utility/wrun/sources/lanes/option_daily.d.ts +58 -0
  191. package/dist/utility/wrun/sources/lanes/option_daily.js +111 -0
  192. package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +27 -0
  193. package/dist/utility/wrun/sources/lanes/option_stats_10m.js +21 -0
  194. package/dist/utility/wrun/sources/lanes/options_flow.d.ts +50 -0
  195. package/dist/utility/wrun/sources/lanes/options_flow.js +155 -0
  196. package/dist/utility/wrun/sources/lanes/options_oi.d.ts +29 -0
  197. package/dist/utility/wrun/sources/lanes/options_oi.js +59 -0
  198. package/dist/utility/wrun/sources/lanes/options_volume.d.ts +38 -0
  199. package/dist/utility/wrun/sources/lanes/options_volume.js +63 -0
  200. package/dist/utility/wrun/sources/lanes/series.d.ts +67 -0
  201. package/dist/utility/wrun/sources/lanes/series.js +321 -0
  202. package/dist/utility/wrun/sources/lanes/token_supply.d.ts +30 -0
  203. package/dist/utility/wrun/sources/lanes/token_supply.js +145 -0
  204. package/dist/utility/wrun/sources/lanes/treasury_balance.d.ts +25 -0
  205. package/dist/utility/wrun/sources/lanes/treasury_balance.js +47 -0
  206. package/dist/utility/wrun/sources/lanes/volatility_index.d.ts +21 -0
  207. package/dist/utility/wrun/sources/lanes/volatility_index.js +11 -0
  208. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +215 -0
  209. package/dist/utility/wrun/sources/opra-option-lanes.util.js +477 -0
  210. package/dist/utility/wrun/sources/registry.d.ts +21 -0
  211. package/dist/utility/wrun/sources/registry.js +237 -0
  212. package/dist/utility/wrun/sources/row-lane-registry.d.ts +28 -0
  213. package/dist/utility/wrun/sources/row-lane-registry.js +230 -0
  214. package/dist/utility/wrun/sources/row-lanes/index.d.ts +2 -0
  215. package/dist/utility/wrun/sources/row-lanes/index.js +12 -0
  216. package/dist/utility/wrun/sources/row-lanes/option_contract_flow.d.ts +2 -0
  217. package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +38 -0
  218. package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +55 -0
  219. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +126 -0
  220. package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +4 -0
  221. package/dist/utility/wrun/sources/row-lanes/option_prints.js +191 -0
  222. package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +62 -0
  223. package/dist/utility/wrun/sources/row-lanes/option_strikes.js +147 -0
  224. package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +70 -0
  225. package/dist/utility/wrun/sources/row-lanes/option_surface.js +144 -0
  226. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +309 -0
  227. package/dist/utility/wrun/sources/wrun-poll-lane.types.js +26 -0
  228. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +350 -0
  229. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +576 -0
  230. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +275 -0
  231. package/dist/utility/wrun/sources/wrun-row-lane.types.js +16 -0
  232. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +207 -0
  233. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +450 -0
  234. package/dist/utility/wrun/wrun-browser-sources.leaf.d.ts +28 -0
  235. package/dist/utility/wrun/wrun-browser-sources.leaf.js +66 -0
  236. package/dist/utility/wrun/wrun-cloud-record.util.d.ts +65 -0
  237. package/dist/utility/wrun/wrun-cloud-record.util.js +121 -0
  238. package/dist/utility/wrun/wrun-daily-lane.util.d.ts +95 -0
  239. package/dist/utility/wrun/wrun-daily-lane.util.js +297 -0
  240. package/dist/utility/wrun/wrun-deadline.util.d.ts +52 -0
  241. package/dist/utility/wrun/wrun-deadline.util.js +82 -0
  242. package/dist/utility/wrun/wrun-etf-flow-lane.util.d.ts +94 -0
  243. package/dist/utility/wrun/wrun-etf-flow-lane.util.js +224 -0
  244. package/dist/utility/wrun/wrun-etf-funds.util.d.ts +82 -0
  245. package/dist/utility/wrun/wrun-etf-funds.util.js +242 -0
  246. package/dist/utility/wrun/wrun-frames.d.ts +20 -1
  247. package/dist/utility/wrun/wrun-frames.js +103 -49
  248. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +2 -2
  249. package/dist/utility/wrun/wrun-hosted-wire-caps.js +27 -0
  250. package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +22 -0
  251. package/dist/utility/wrun/wrun-lane-refusal.leaf.js +32 -0
  252. package/dist/utility/wrun/wrun-lane-warmup.util.d.ts +18 -0
  253. package/dist/utility/wrun/wrun-lane-warmup.util.js +112 -0
  254. package/dist/utility/wrun/wrun-leg-close.util.d.ts +57 -0
  255. package/dist/utility/wrun/wrun-leg-close.util.js +187 -0
  256. package/dist/utility/wrun/wrun-leg-fetch.util.d.ts +144 -0
  257. package/dist/utility/wrun/wrun-leg-fetch.util.js +212 -0
  258. package/dist/utility/wrun/wrun-leg-stream-classes.d.ts +73 -0
  259. package/dist/utility/wrun/wrun-leg-stream-classes.js +86 -0
  260. package/dist/utility/wrun/wrun-levels-child.util.d.ts +101 -6
  261. package/dist/utility/wrun/wrun-levels-child.util.js +335 -157
  262. package/dist/utility/wrun/wrun-memory-clamp.util.d.ts +33 -0
  263. package/dist/utility/wrun/wrun-memory-clamp.util.js +146 -0
  264. package/dist/utility/wrun/wrun-odds-template-market.util.d.ts +51 -0
  265. package/dist/utility/wrun/wrun-odds-template-market.util.js +251 -0
  266. package/dist/utility/wrun/wrun-opra-flow.leaf.d.ts +65 -0
  267. package/dist/utility/wrun/wrun-opra-flow.leaf.js +94 -0
  268. package/dist/utility/wrun/wrun-opra-lane.util.d.ts +47 -0
  269. package/dist/utility/wrun/wrun-opra-lane.util.js +58 -0
  270. package/dist/utility/wrun/wrun-opra-stats.leaf.d.ts +49 -0
  271. package/dist/utility/wrun/wrun-opra-stats.leaf.js +115 -0
  272. package/dist/utility/wrun/wrun-opra-underlying.util.d.ts +12 -0
  273. package/dist/utility/wrun/wrun-opra-underlying.util.js +1 -0
  274. package/dist/utility/wrun/wrun-option-contract-flow.util.d.ts +142 -0
  275. package/dist/utility/wrun/wrun-option-contract-flow.util.js +451 -0
  276. package/dist/utility/wrun/wrun-option-knobs.util.d.ts +43 -0
  277. package/dist/utility/wrun/wrun-option-knobs.util.js +81 -0
  278. package/dist/utility/wrun/wrun-option-prints.util.d.ts +144 -0
  279. package/dist/utility/wrun/wrun-option-prints.util.js +356 -0
  280. package/dist/utility/wrun/wrun-option-summary-lane.util.d.ts +102 -0
  281. package/dist/utility/wrun/wrun-option-summary-lane.util.js +143 -0
  282. package/dist/utility/wrun/wrun-options-chain.util.d.ts +308 -0
  283. package/dist/utility/wrun/wrun-options-chain.util.js +502 -0
  284. package/dist/utility/wrun/wrun-overlay-identity.util.d.ts +9 -4
  285. package/dist/utility/wrun/wrun-overlay-identity.util.js +16 -6
  286. package/dist/utility/wrun/wrun-panel-mount.lazy.d.ts +10 -0
  287. package/dist/utility/wrun/wrun-panel-mount.lazy.js +68 -0
  288. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +377 -0
  289. package/dist/utility/wrun/wrun-panel-mount.util.js +2251 -0
  290. package/dist/utility/wrun/wrun-param-map.util.d.ts +298 -0
  291. package/dist/utility/wrun/wrun-param-map.util.js +581 -0
  292. package/dist/utility/wrun/wrun-pause-dim.util.d.ts +52 -0
  293. package/dist/utility/wrun/wrun-pause-dim.util.js +153 -0
  294. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +149 -0
  295. package/dist/utility/wrun/wrun-pin-spelling.util.js +523 -0
  296. package/dist/utility/wrun/wrun-pin-venues.util.d.ts +116 -0
  297. package/dist/utility/wrun/wrun-pin-venues.util.js +320 -0
  298. package/dist/utility/wrun/wrun-pinned-interval.util.d.ts +20 -0
  299. package/dist/utility/wrun/wrun-pinned-interval.util.js +47 -0
  300. package/dist/utility/wrun/wrun-plot-gate.types.d.ts +23 -0
  301. package/dist/utility/wrun/wrun-plot-gate.types.js +7 -0
  302. package/dist/utility/wrun/wrun-present-bits.util.d.ts +37 -0
  303. package/dist/utility/wrun/wrun-present-bits.util.js +73 -0
  304. package/dist/utility/wrun/wrun-protocol-pending.util.d.ts +33 -0
  305. package/dist/utility/wrun/wrun-protocol-pending.util.js +57 -0
  306. package/dist/utility/wrun/wrun-refusal.util.d.ts +41 -1
  307. package/dist/utility/wrun/wrun-refusal.util.js +69 -2
  308. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +1 -14
  309. package/dist/utility/wrun/wrun-registry-errors.util.js +0 -16
  310. package/dist/utility/wrun/wrun-row-source.d.ts +158 -0
  311. package/dist/utility/wrun/wrun-row-source.js +75 -0
  312. package/dist/utility/wrun/wrun-run-health.util.d.ts +155 -0
  313. package/dist/utility/wrun/wrun-run-health.util.js +273 -0
  314. package/dist/utility/wrun/wrun-run-interval-projection.types.d.ts +14 -0
  315. package/dist/utility/wrun/wrun-run-interval-projection.types.js +1 -0
  316. package/dist/utility/wrun/wrun-socket-row-source.d.ts +439 -0
  317. package/dist/utility/wrun/wrun-socket-row-source.js +1689 -0
  318. package/dist/utility/wrun/wrun-socket-session-losses.util.d.ts +18 -0
  319. package/dist/utility/wrun/wrun-socket-session-losses.util.js +25 -0
  320. package/dist/utility/wrun/wrun-source-rows.util.d.ts +911 -0
  321. package/dist/utility/wrun/wrun-source-rows.util.js +2597 -0
  322. package/dist/utility/wrun/wrun-tape-source.util.d.ts +82 -0
  323. package/dist/utility/wrun/wrun-tape-source.util.js +151 -0
  324. package/dist/utility/wrun/wrun-tier-grid.util.d.ts +137 -0
  325. package/dist/utility/wrun/wrun-tier-grid.util.js +279 -0
  326. package/dist/utility/wrun/wrun-trades-lane.util.d.ts +52 -0
  327. package/dist/utility/wrun/wrun-trades-lane.util.js +58 -0
  328. package/dist/utility/wrun/wrun-volume-profile-lane.util.d.ts +41 -0
  329. package/dist/utility/wrun/wrun-volume-profile-lane.util.js +66 -0
  330. package/dist/utility/wrun-display-name.util.d.ts +33 -0
  331. package/dist/utility/wrun-display-name.util.js +64 -0
  332. package/dist/workers/constants/kscript-transport-codes.d.ts +15 -0
  333. package/dist/workers/constants/kscript-transport-codes.js +15 -0
  334. package/dist/workers/constants/socket-slots.d.ts +574 -0
  335. package/dist/workers/constants/socket-slots.js +539 -0
  336. package/dist/workers/utils/number.worker.util.d.ts +5 -0
  337. package/dist/workers/utils/number.worker.util.js +10 -0
  338. package/dist/workers/utils/time.worker.util.d.ts +12 -0
  339. package/dist/workers/utils/time.worker.util.js +24 -0
  340. package/dist/workers/utils/volume-profile.worker.util.d.ts +200 -0
  341. package/dist/workers/utils/volume-profile.worker.util.js +631 -0
  342. package/package.json +10 -4
@@ -0,0 +1,275 @@
1
+ /**
2
+ * A ROW LANE of the browser (chart) lane, as one descriptor (`WrunRowLaneDescriptor`): a CELLED source class
3
+ * the row builder serves through a table instead of a hand-wired branch. The row builder's own lanes
4
+ * (`WRUN_BROWSER_BUILTIN_SOURCE_CLASSES`: `options_chain`, `tape`, ...) keep their branches; a new celled class
5
+ * (the options classes of the UW-PARITY source contract: S1, S3, S4, S7, S9) is a lane module instead, and
6
+ * adding one is two files and no shared edit:
7
+ *
8
+ * 1. `src/utility/wrun/sources/row-lanes/<source_class>.ts`, exporting `rowLane` (one descriptor) or
9
+ * `rowLanes`. The FILE is named after the source class (`wrunPollLaneClassOfFile`, the leaf's one rule);
10
+ * the registry (`row-lane-registry.ts`) discovers it by glob and checks it once at load.
11
+ * 2. A spec.
12
+ *
13
+ * What the host derives from a descriptor (nothing lists a lane by name):
14
+ * - the served-class set (`wrun-browser-sources.ts`), the template picker's verdicts, the tuple width the
15
+ * packer counts `max_cells` in (`wrun-pack.util` `wrunCellTupleWidths`) and the requirement table's row;
16
+ * - the full run (`wrun-overlay-run.util.ts`): the plan before any fetch (the chart's admission, the OPRA wall,
17
+ * the lane's identity and each input's facets, refusals by name), one fetch per lane INSTANCE beside the other
18
+ * lanes (inputs whose facets are equal share one), the host-grid landing (rule 9) and the partial bars, the
19
+ * degrade, the acquisition record, the OPRA provenance stamp and the legend's tier note (a `chain` lane's by the
20
+ * plane each instance's chain lists on);
21
+ * - the row builder (`wrun-source-rows.util.ts`): each input's cell block per bar, exact-joined on the chart's
22
+ * bars (a `latest` lane: the live row only), the lane's per-input projection applied;
23
+ * - the live tick (`wrun-live-tick.util.ts`): the lane in every poll reconcile with its recorded acquisition,
24
+ * fetched rows winning; and a `liveByCoin` lane's points folded per drain (`wrun-live-intake.util.ts`).
25
+ *
26
+ * Rules a lane file keeps (the poll lanes' own, wrun-poll-lane.types.ts): LIGHT at module load (types and small
27
+ * pure helpers; anything heavy imported lazily inside `identity`, `facets` or `fetch`); `identity` and `facets`
28
+ * are the ONLY places a lane refuses, by name (`refuseWrunPollInput`), before any fetch; it never serves a class
29
+ * the row builder or a poll lane serves (the registry refuses that).
30
+ */
31
+ import type { WrunInputSource } from '../../../interfaces/wrun-runtime.interface.js';
32
+ import type { LiveBucketVenue } from '../../chart/live-bucket.util.js';
33
+ import type { WrunPollLaneContext, WrunPollLaneExtras, WrunPollLaneFetchAsk, WrunPollLaneSource } from './wrun-poll-lane.types.js';
34
+ import type { WrunBackendTier, WrunHostBarGroup, WrunTierChoice } from '../wrun-tier-grid.util.js';
35
+ /** An input's declaration as a row lane reads it (the typed fields and any knob the sheet carries). */
36
+ export type WrunRowLaneSource = WrunPollLaneSource;
37
+ /** The chart a row lane is planned against, and the input being planned (the poll lanes' context: the
38
+ * market, the interval, the index-mode verdict and the run's OPRA facts, `official` and `opraUserScripts`). */
39
+ export type WrunRowLaneContext = WrunPollLaneContext;
40
+ /**
41
+ * How a lane's rows reach the chart's bars:
42
+ * - `flow`: per bar, a tier's buckets summed onto each host bar (a celled flow keeps every tuple of the bar's
43
+ * buckets, in time order, unless the lane `fold`s them itself: a per-contract sum, an offset re-based on the
44
+ * host bar's open);
45
+ * - `snapshot`: per bar, the newest SEALED bucket of the bar (a forming bucket is never the bar's state);
46
+ * - `latest`: the live bar only (the options chain's rule): the newest row's tuples are the chart's LAST row's
47
+ * block, every other row a present EMPTY block; no host-grid landing.
48
+ * `fold` reads the acquisition beside the bar's rows, so a knob that needs the whole bar (a strike window around the
49
+ * bar's underlying, a floor on a contract's total) is applied where the bar is whole.
50
+ * `tiers` (flow and snapshot) puts the asks under the tier rule (wrun-tier-grid.util `wrunHostGridAsks`): each
51
+ * host bar is read from the finest backend tier that fits it and still retains it, one ask per run of bars on a
52
+ * tier (the tier's key in the ask's payload, `tier`), and a bar no tier retains is PARTIAL: its tuples carry bit
53
+ * 14 of `present`, or it holds one marker tuple (wrun-present-bits.util). Absent: one ask, the rows landed as
54
+ * the control answers them.
55
+ * `tierChoice: 'coarsest'` (a flow with tiers and a `fold` only) reads each bar from the coarsest fitting tier that
56
+ * retains it and already serves it (a tier's `servedLagMs`) instead of the finest: for a lane whose fold reads the same
57
+ * per-bar values from any tier (`option_contract_flow`'s per-contract sums), so a coarse bar reads fewer buckets.
58
+ * Absent: the finest (rule 9).
59
+ */
60
+ export type WrunRowLaneLanding = {
61
+ kind: 'flow' | 'snapshot';
62
+ tiers?: readonly WrunBackendTier[];
63
+ tierChoice?: WrunTierChoice;
64
+ /** Folds one host bar's tier rows itself, reading the acquisition the rows were asked with (the instance's
65
+ * payload with the ask's `tier`: its knobs, a strike window, a volume floor). */
66
+ fold?: (group: WrunHostBarGroup, acquisition: Readonly<Record<string, unknown>>) => ReadonlyArray<ReadonlyArray<number>>;
67
+ /** A snapshot with tiers only: whether, for one acquisition (the instance's payload), a bar its tier answered
68
+ * nothing for is read again from the next coarser tier that fits and retains it (`wrunHostGridFallbackAsks`):
69
+ * a chain whose plane keeps a coarse tier where the fine one fills only inside a session (OPTIONS-PORT D12: a
70
+ * CME surface's settlement DAY rows under its 5m tier). Absent: a bar its tier left empty stays empty. */
71
+ coarserWhenEmpty?: (acquisition: Readonly<Record<string, unknown>>) => boolean;
72
+ } | {
73
+ kind: 'latest';
74
+ };
75
+ /**
76
+ * The span a lane's backend serves for ONE acquisition, at the clock: for a lane whose history depends on its knobs
77
+ * rather than on a tier (a raw print table kept 3 days beside a large-print table kept 90, picked by the floor the
78
+ * input asks; a gateway that trims a raw read to its bar limit), which the static `landing.tiers` cannot say.
79
+ * - `servedFromMs`: where the lane's rows start. A host bar that ENDS at or before it asks nothing and is PARTIAL (bit
80
+ * 14 of `present`: one marker tuple); an ask that opens earlier opens at the first bar that ends after it.
81
+ * - `completeFromMs` (default `servedFromMs`): where they are whole. A host bar that OPENS before it is PARTIAL (its
82
+ * tuples carry bit 14, a bar holding none the marker tuple), asked or not.
83
+ * Applied after the tier rule, beside its own partial bars.
84
+ */
85
+ export interface WrunRowLaneHorizon {
86
+ servedFromMs?: number;
87
+ completeFromMs?: number;
88
+ }
89
+ /**
90
+ * A read that can pass its worker's row cap (`option_contract_flow` reads every contract of the underlying): the cap,
91
+ * in rows, and the rows one host bar is projected to read at its tier, up to the clock. Before any fetch the host
92
+ * keeps the NEWEST asked bars whose projected rows fit the cap and marks every older asked bar PARTIAL (bit 14 of
93
+ * `present`: one marker tuple), the asks starting at the first kept bar's open, never inside a bar; a bar whose own
94
+ * projection passes the cap leaves every bar at or before it partial. Applied after the tier rule and the horizon.
95
+ */
96
+ export interface WrunRowLaneRowBudget {
97
+ maxRows: number;
98
+ barRows: (bar: {
99
+ openMs: number;
100
+ endMs: number;
101
+ tier?: WrunBackendTier;
102
+ }, nowMs: number) => number;
103
+ }
104
+ /** What a lane's live fold reads beside the points: the chart's bar span and grid, and the acquisition the
105
+ * instance's history was asked with (its knobs: a floor, an expiry set). */
106
+ export interface WrunRowLaneFoldContext {
107
+ intervalMs: number;
108
+ barGrid?: LiveBucketVenue | null;
109
+ acquisition: Readonly<Record<string, unknown>>;
110
+ }
111
+ /**
112
+ * A lane fed live by COIN (UW-PARITY rule for the print class): a coin-scoped channel carries every point of
113
+ * the chart's underlying (one OPRA print per contract of the root), and the intake admits a point whose coin is
114
+ * the coin the instance was asked for (`WrunRowLaneDescriptor.coinOf`), whatever contract it names, the chart's
115
+ * own market or not. The channel's key is `wrunCoinChannel` (live-feed-channel-factory.util); no lane opens one
116
+ * until the live-feed serves the coin route.
117
+ */
118
+ export interface WrunRowLaneLiveByCoin {
119
+ /** The fan-out's script source name the lane's frames arrive under. */
120
+ scriptSource: string;
121
+ /** The coin a point names (its series' coin); absent: `point.series.coin`, else the frame's own. */
122
+ coinOf?: (point: unknown) => string | undefined;
123
+ /** A point's time, ms (the host bar it folds into); null for a point that names none. */
124
+ stampOf: (point: unknown) => number | null;
125
+ /** The points folded into the instance's host-bar rows `[barOpen, ...tuples]`: a NEW array, ascending (pure;
126
+ * a point the acquisition's knobs turn away folds nowhere). */
127
+ fold: (rows: ReadonlyArray<ReadonlyArray<unknown>>, points: readonly unknown[], ctx: WrunRowLaneFoldContext) => unknown[][];
128
+ /** A reconcile answer merged over the rows held (a print-key union, so a print shown live never vanishes);
129
+ * absent: the answer's bars replace the held ones. */
130
+ reconcile?: (held: ReadonlyArray<ReadonlyArray<unknown>>, answer: ReadonlyArray<ReadonlyArray<unknown>>) => unknown[][];
131
+ }
132
+ /**
133
+ * A chain lane's plane, per instance (`WrunRowLaneDescriptor.chain`): `exchangeField` names the payload field the
134
+ * lane's identity and facets answer the chain's exchange in, and the instance's plane follows that exchange
135
+ * (opra-option-lanes.util `wrunLaneChainPlaneOf`, off the governed exchange sets):
136
+ * - `opra` (US options data): the OPRA wall (`opra-official-only:<class>`, before the chain is resolved on a chart
137
+ * whose options ride the plane), the plane stamp and its routed tier in the ask (`wrunPlane`, `servedTier`), the
138
+ * overlay's OPRA provenance before the first fetch and the legend's delayed-tier note, as a governed lane's;
139
+ * - `cme` (a CME Group exchange): the CME display wall (official packages only) and the routed tier in the ask
140
+ * (`servedTier`, so no source cache serves one tier's rows to the other); no plane stamp, no provenance, no legend
141
+ * note (the chart's own delay badge names the delay);
142
+ * - `plain` (a crypto options venue): nothing beside the lane's own fields.
143
+ */
144
+ export interface WrunRowLaneChain {
145
+ exchangeField: string;
146
+ }
147
+ /** The plane a chain lane instance reads: the gate its chain's exchange rides (`opra`, `cme`), or `plain` (a crypto
148
+ * options venue: no gate, no licence delay, no plane stamp, no routed tier). */
149
+ export type WrunLaneChainPlane = 'opra' | 'cme' | 'plain';
150
+ /** An exchange's plane, read off the governed exchange sets the gate table is built from (never a venue list): a CME
151
+ * Group exchange is `cme`, OPRA `opra`, any other `plain`. Here, beside the chain mark, so the planner on the row
152
+ * builder's (and the boot path's) import graph reads it without the chain resolver's module. */
153
+ export declare function wrunLaneChainPlaneOf(exchange: string | undefined | null): WrunLaneChainPlane;
154
+ export interface WrunRowLaneDescriptor {
155
+ /** The kit source class this lane serves (celled). Its file is named `<sourceClass>.ts`. */
156
+ sourceClass: string;
157
+ /** Unique across both registries (lower snake case): the stem of the lane's fetch key and instance ids. */
158
+ laneKey: string;
159
+ /** The kScript source type the chart's fetch rides (`option_strike` asks the `K_OPTION_STRIKE` control); a
160
+ * lane with its own `fetch` names itself here (the degrade chips). */
161
+ kType: string;
162
+ /** The series' name in the "data is unavailable" refusal and the degrade chips. */
163
+ label: string;
164
+ /** The i18n key of the lane's feed words in a refusal record (`wrun.refusal.feed.*`, in all six locales):
165
+ * the record names the lane by them (registered under the lane key, wrun-refusal.util
166
+ * `registerWrunRefusalFeedKeys`). Absent: a record naming the lane reads the generic words. */
167
+ feedWords?: string;
168
+ /** f64s per tuple, the `present` mask included where the class carries one (the source contract's width). */
169
+ width: number;
170
+ /**
171
+ * The lane's IDENTITY on the chart, resolved once per run before any fetch (a stock chart's underlying, an
172
+ * OPRA contract's root): the payload fields every instance's ask carries, or a refusal by name
173
+ * (`refuseWrunPollInput` with the first input's context). May be async. Absent: the chart's own placeholders.
174
+ */
175
+ identity?: (ctx: WrunRowLaneContext) => WrunPollLaneExtras | void | Promise<WrunPollLaneExtras | void>;
176
+ /**
177
+ * One input's ACQUISITION FACETS: the knobs that change the fetch (`expiries`, `strike_window_pct`,
178
+ * `min_premium`), validated and answered as payload fields, or a refusal by name. Inputs whose facets are
179
+ * equal share ONE instance (one fetch, one buffer). Field selection is projection, never a facet. May be async (a
180
+ * chain lane decides its book from the chain's directory). Absent: none.
181
+ */
182
+ facets?: (source: WrunRowLaneSource, ctx: WrunRowLaneContext) => WrunPollLaneExtras | void | Promise<WrunPollLaneExtras | void>;
183
+ /**
184
+ * Whether an instance's acquisition (the full run's record of its payload) no longer names the read the lane would
185
+ * plan now (`option_surface`: a CME chain read off a continuous alias whose lead contract rolled). A live session
186
+ * holding such an instance rebuilds (wrun-live-tick.util, rebuild `acquisition`: the full run re-plans every lane
187
+ * and the fresh session holds none of the old buffered rows), so no ask, cache or buffer joins two reads.
188
+ * Synchronous, read on every drain. Absent: an acquisition never moves.
189
+ */
190
+ acquisitionMoved?: (acquisition: Readonly<Record<string, unknown>>) => boolean;
191
+ /** `one`: the package's inputs of this class must resolve to ONE acquisition (two that differ refuse by name,
192
+ * the tape's rule); absent: one instance per distinct set of facets. */
193
+ acquisitions?: 'one';
194
+ landing: WrunRowLaneLanding;
195
+ /** The backend's span for one acquisition at the clock (`WrunRowLaneHorizon`): the bars it no longer holds, or
196
+ * holds only in part, are PARTIAL and the asks start where its rows do. Called with the instance's payload (its
197
+ * identity, facets and plane fields) and the window's clock, for a flow or snapshot lane. Absent: the tier rule
198
+ * alone. */
199
+ horizon?: (extras: Readonly<Record<string, unknown>>, nowMs: number) => WrunRowLaneHorizon | undefined;
200
+ /** The row cap the lane's read keeps under (`WrunRowLaneRowBudget`), for a flow or snapshot lane: the newest bars
201
+ * that fit are read, every older asked bar is partial. Absent: the asks as the tier rule and the horizon made
202
+ * them. */
203
+ rowBudget?: WrunRowLaneRowBudget;
204
+ /**
205
+ * The lane reads a governed plane on every chart it serves: `opra` (US options data). Its inputs are refused by
206
+ * name before any fetch for a run that may not read OPRA (`opra-official-only:<class>`); it is admitted on the
207
+ * charts whose options ride the plane (a US stock or ETF chart while the `opra` flag is lit, an OPRA contract
208
+ * chart) and nowhere else; its asks ride the native-rows path naming the plane and their routed tier; the run
209
+ * stamps the overlay's OPRA provenance before its first fetch and the legend names a delayed tier. A `chain` lane
210
+ * declares none: its plane is its instance's.
211
+ */
212
+ governed?: 'opra';
213
+ /**
214
+ * A CHAIN lane: it reads the chart's options chain on whichever plane that chain lists on, decided per INSTANCE by
215
+ * the one chain resolver (sources/opra-option-lanes.util `decideWrunLaneChain`), never per descriptor (see
216
+ * `WrunRowLaneChain`). It is admitted on every chart (a chart with no chain is refused by name in its identity or
217
+ * facets), and its asks ride the native-rows path on every plane (its rows are its chain's, never the chart
218
+ * market's).
219
+ */
220
+ chain?: WrunRowLaneChain;
221
+ /** How an empty answer reads: `quiet` (a window with nothing in it is legitimate: present EMPTY blocks) or
222
+ * `degrades` (a snapshot that answers nothing is broken: the lane degrades like every state lane). Absent:
223
+ * quiet for a flow, degrades for a snapshot or a latest lane. */
224
+ emptyAnswer?: 'quiet' | 'degrades';
225
+ /**
226
+ * The columns (0-based) a tuple must hold a finite number in to be read at all (om's `option_strikes`: the strike
227
+ * and the expiry). A tuple failing one is dropped whole; any OTHER column that is not a finite number (a side the
228
+ * row does not list, an absent IV) reads NaN instead of dropping the tuple, the om host's own adapter rule for
229
+ * such a class. Absent: every column must be finite (UW-PARITY rule 1: no NaN in a cell).
230
+ */
231
+ finiteColumns?: readonly number[];
232
+ /**
233
+ * `false`: the class's tuple carries no `present` mask (om's `option_strikes`), so nothing reads or writes bit 14
234
+ * on it: a bar no fitting tier retains asks nothing and reads an EMPTY block (never the marker tuple), and the
235
+ * per-input projection is applied as it is. Absent: the last column is the `present` mask.
236
+ */
237
+ presentMask?: false;
238
+ /** One input's projection of a bar's tuples (its own `expiries` word over a lane two inputs share, a field
239
+ * selection, a cut to the input's own `max_cells`): applied per input per bar, never refetching. Absent: the
240
+ * bar's tuples as they are. */
241
+ cells?: (tuples: ReadonlyArray<ReadonlyArray<number>>, input: WrunRowLaneCellInput) => ReadonlyArray<ReadonlyArray<number>>;
242
+ /** The lane's OWN fetch in place of the chart's (a series no K control serves): the poll lanes' ask shape,
243
+ * answered as rows `[ts, tuple, ...]` at the asked tier, ascending. */
244
+ fetch?: (ask: WrunPollLaneFetchAsk) => Promise<ReadonlyArray<ReadonlyArray<unknown>>>;
245
+ /** Live points by coin (see `WrunRowLaneLiveByCoin`); absent: a poll lane (the reconcile re-asks it). */
246
+ liveByCoin?: WrunRowLaneLiveByCoin;
247
+ }
248
+ /** The input a lane's per-input projection (`cells`) reads: its name, its declaration and the most tuples a bar of
249
+ * it may hold (`max_cells`, the bound the packer refuses past; the row builder hands it from the static plan). */
250
+ export interface WrunRowLaneCellInput {
251
+ name: string;
252
+ source: WrunInputSource;
253
+ maxCells?: number;
254
+ }
255
+ /** What a row-lane file may export: one lane, several, or both. */
256
+ export interface WrunRowLaneModule {
257
+ rowLane?: WrunRowLaneDescriptor;
258
+ rowLanes?: readonly WrunRowLaneDescriptor[];
259
+ }
260
+ /** The id of one row-lane INSTANCE (a lane under one acquisition): its row buffer's key, its fetch-key suffix
261
+ * and its live lane name, apart from the poll lanes' (`poll:`) and the row builder's own. */
262
+ export type WrunRowLaneId = `row:${string}`;
263
+ export declare const WRUN_ROW_LANE_ID_PREFIX = "row:";
264
+ export declare function isWrunRowLaneId(value: unknown): value is WrunRowLaneId;
265
+ /** One planned row-lane instance of a run: plain data (the live context keeps it for the reconcile and the
266
+ * reseed); the descriptor is looked up by `laneKey`. */
267
+ export interface WrunRowLaneInstance {
268
+ key: WrunRowLaneId;
269
+ sourceClass: string;
270
+ laneKey: string;
271
+ /** The payload fields the lane's identity and the inputs' facets answered (empty when none). */
272
+ extras: Record<string, unknown>;
273
+ /** The inputs reading this instance, by index, ascending. */
274
+ inputIndexes: number[];
275
+ }
@@ -0,0 +1,16 @@
1
+ import { isCmeGoverned } from '../../chart/cme-realtime.util.js';
2
+ import { isOpraGoverned } from '../../v2/opra-governed.util.js';
3
+ /** An exchange's plane, read off the governed exchange sets the gate table is built from (never a venue list): a CME
4
+ * Group exchange is `cme`, OPRA `opra`, any other `plain`. Here, beside the chain mark, so the planner on the row
5
+ * builder's (and the boot path's) import graph reads it without the chain resolver's module. */
6
+ export function wrunLaneChainPlaneOf(exchange) {
7
+ if (isCmeGoverned(exchange))
8
+ return 'cme';
9
+ if (isOpraGoverned(exchange))
10
+ return 'opra';
11
+ return 'plain';
12
+ }
13
+ export const WRUN_ROW_LANE_ID_PREFIX = 'row:';
14
+ export function isWrunRowLaneId(value) {
15
+ return typeof value === 'string' && value.startsWith(WRUN_ROW_LANE_ID_PREFIX);
16
+ }
@@ -0,0 +1,207 @@
1
+ /**
2
+ * The generic half of every row lane (`wrun-row-lane.types.ts` is the contract a lane file keeps,
3
+ * `row-lane-registry.ts` the discovery): what the run pass, the row builder and the live tick ask of a row lane,
4
+ * written once over the descriptor, so no consumer names a lane.
5
+ *
6
+ * - `planWrunRowLaneInputs`: the STATIC plan, from the sheet alone: each input of a row-lane class, which must be
7
+ * celled with a `max_cells` (refused by name otherwise). The row builder runs it before any row.
8
+ * - `planWrunRowLanes`: the run's plan against the chart, before any fetch, of every input the market demands (an
9
+ * undemanded one is planned nowhere): the OPRA wall, the chart's admission, the lane's identity (once per lane) and
10
+ * each input's facets, grouped into instances (equal facets share one fetch and one buffer; an
11
+ * `acquisitions: 'one'` lane refuses two that differ), a chain lane's instance meeting its own plane's wall,
12
+ * refusals by name.
13
+ * - a chain lane's plane per instance (`wrunRowLaneChainPlane`) and the fields its asks name for it
14
+ * (`wrunRowLaneChainAsk`): the run's and the reconcile's one rule.
15
+ * - `wrunRowLaneRequired`: the empty-answer rule (a `degrades` lane must answer rows unless every reader declares
16
+ * `missing: "empty"`).
17
+ * - `fetchWrunRowLaneRows`: a lane's rows over a chart window: its asks under the tier rule, landed on the host
18
+ * bars, the partial bars marked (a `latest` lane asked once, its rows as they come).
19
+ * - `wrunRowLaneCellRows`: the row builder's read of one input: the lane's host-bar rows as cell blocks on the
20
+ * chart's grid (exact width, finite values or NaN outside a lane's `finiteColumns`, the lane's per-input
21
+ * projection with a partial bar kept partial unless the class carries no `present` mask; a `latest` lane on the
22
+ * live row).
23
+ */
24
+ import type { WrunIndicatorMetadata, WrunInputSource } from '../../../interfaces/wrun-runtime.interface.js';
25
+ import type { LiveBucketVenue } from '../../chart/live-bucket.util.js';
26
+ import type { OpraReadFacts } from '../../chart/opra-read-access.leaf.js';
27
+ import type { OpraOptionPlaneStop } from '../../../host-ports.types.js';
28
+ import type { WrunPollLaneFetchAsk } from './wrun-poll-lane.types.js';
29
+ import { type WrunLaneChainPlane, type WrunRowLaneCellInput, type WrunRowLaneDescriptor, type WrunRowLaneHorizon, type WrunRowLaneId, type WrunRowLaneInstance, type WrunRowLaneRowBudget } from './wrun-row-lane.types.js';
30
+ import type { WrunMissingFeed } from '../wrun-run-health.util.js';
31
+ import { type WrunHostGridAsk } from '../wrun-tier-grid.util.js';
32
+ /** One input of a row-lane class under the static plan. */
33
+ export interface WrunRowLaneInput {
34
+ inputIndex: number;
35
+ inputName: string;
36
+ source: WrunInputSource;
37
+ lane: WrunRowLaneDescriptor;
38
+ maxCells: number;
39
+ }
40
+ /**
41
+ * The static plan: every input whose class a row lane serves, in declaration order, with its lane. Refused by
42
+ * name: a scalar input (a row lane serves cell blocks) and a celled one with no `max_cells` (the bound its blocks
43
+ * are packed under). Empty when the sheet reads no row-lane class.
44
+ */
45
+ export declare function planWrunRowLaneInputs(metadata: WrunIndicatorMetadata): WrunRowLaneInput[];
46
+ /** The id of the instance `extras` names: `row:<laneKey>` when the ask carries no extras, else the extras'
47
+ * canonical text appended (equal asks are ONE instance whatever their field order). */
48
+ export declare function wrunRowLaneInstanceKey(laneKey: string, extras: Readonly<Record<string, unknown>>): WrunRowLaneId;
49
+ /** The chart a row lane is planned against: its market, interval and the predicates the run injects (so this
50
+ * module, on the row builder's import graph, stays off the chart modules'). */
51
+ export interface WrunRowLaneChart {
52
+ coin: string;
53
+ exchange: string;
54
+ symbol: string;
55
+ /** The chart market's category (pb-common `Category`), handed to the lanes' context: a chain lane resolves the
56
+ * chart's chain with it, as the options chain lane does (an option contract chart reads its own contract's). */
57
+ category?: number;
58
+ intervalMs: number;
59
+ /** Index mode (a stock, forex, commodity or DEX chart): a lane reading the chart's own market is not served
60
+ * there unless it rides a governed plane. */
61
+ isIndexModeExchange?: (exchange: string) => boolean;
62
+ /** A crypto venue (the refusal's words). */
63
+ isCryptoVenueExchange?: (exchange: string) => boolean;
64
+ /** The chart's options ride the OPRA plane (a US stock or ETF chart while the `opra` flag is lit, an OPRA
65
+ * contract chart: `governedOptionPlane(metadata) === 'opra'`, either spelling of the stock venue). */
66
+ isOpraPlaneExchange?: (exchange: string) => boolean;
67
+ /** Why a chart off the plane is off it although its options list on OPRA (opra-options-gate.util
68
+ * `opraOptionPlaneStop`: the flag check's `flag-off`, the plane router's `chart-kind`); absent, the market's own
69
+ * words. */
70
+ opraPlaneStop?: (exchange: string) => OpraOptionPlaneStop | undefined;
71
+ }
72
+ /** The run's plan of its row lanes: the instances to fetch, and the feeds the chart never serves to inputs that
73
+ * declared `missing: "empty"` (one entry per lane key). */
74
+ export interface WrunRowLanePlan {
75
+ lanes: WrunRowLaneInstance[];
76
+ missingFeeds: WrunMissingFeed[];
77
+ }
78
+ /**
79
+ * The run's plan against the chart, before any fetch, every input of a row-lane class in declaration order (the
80
+ * first refusal by name wins):
81
+ * 0. an input the market leaves undemanded (its `needed_by` leaves the market out, wrunSheetWithLaneDemand) is planned
82
+ * nowhere: no wall, no admission, no acquisition, no note; the row builder reads its empty block on every bar;
83
+ * 1. the OPRA wall: an input of a `governed: 'opra'` lane is refused for a run that may not read OPRA
84
+ * (`opra-official-only:<class>`, `mayReadOpra` over `run`; absent reads closed), and so is an input of a chain lane
85
+ * on a chart whose options list on OPRA (riding the plane or stopped off it), before its chain is resolved;
86
+ * 2. the admission: a governed OPRA lane is served where the chart's options ride the OPRA plane
87
+ * (`isOpraPlaneExchange`) and nowhere else; a chain lane on every chart no known stop keeps its options off the
88
+ * plane on (`wrunChainLaneStop`, the chain poll lanes' one rule: no chain is resolved past the stop); any other lane
89
+ * wherever the chart is not index-mode. An input the chart does not serve meets the one rule both planners keep
90
+ * (wrun-poll-lanes.util `wrunUnservedLaneInput`): declaring `missing: "empty"` it is dropped (its blocks read EMPTY,
91
+ * a note names the feed), any other refuses by name, seeded feed-missing (paused); a lane off the plane for a known
92
+ * reason (`opraPlaneStop`: the `opra` flag dark, an index chart) says that reason instead (`options-stopped`, the
93
+ * note and the refusal alike);
94
+ * 3. the lane's identity, once per lane (the first admitted input's context names a refusal), then the input's
95
+ * facets (awaited, in declaration order); the instance is the identity and the facets together. A lane with
96
+ * `acquisitions: 'one'` refuses a second input whose acquisition differs (one fetch, one live fold per package). A
97
+ * chart with no option chain (an identity or facets refusal seeded `no-options` / `chain`, `wrunLaneNoChainRefusal`:
98
+ * a LINK perp, a forex pair) does not serve the feed either: the same one rule, its note naming the feed with the
99
+ * chain decision's words, its refusal the decision's own. A chain lane's instance then meets its own plane's wall
100
+ * (`assertWrunLaneChainPlaneReadable`, the one rule a chain poll lane meets too): OPRA's, or the CME display wall
101
+ * (OpenMarket's own packages only); a plain chain (a crypto venue) none.
102
+ */
103
+ export declare function planWrunRowLanes(metadata: WrunIndicatorMetadata, chart: WrunRowLaneChart, run?: OpraReadFacts): Promise<WrunRowLanePlan>;
104
+ /** The exchange a chain-lane instance's chain lists on (the payload field its `chain` names); '' for any other lane
105
+ * or a payload naming none. The chain poll lanes' one rule (`wrunPollLaneChainExchange`: the mark is the same). */
106
+ export declare function wrunRowLaneChainExchange(lane: Pick<WrunRowLaneDescriptor, 'chain'>, extras: Readonly<Record<string, unknown>>): string;
107
+ /** The plane a chain-lane instance reads, by its chain's exchange (`wrunPollLaneChainPlane`, the chain poll lanes' one
108
+ * rule over `wrunLaneChainPlaneOf`); undefined for any other lane (its plane, if any, is its descriptor's `governed`). */
109
+ export declare function wrunRowLaneChainPlane(lane: Pick<WrunRowLaneDescriptor, 'chain'>, extras: Readonly<Record<string, unknown>>): WrunLaneChainPlane | undefined;
110
+ /** Whether one row-lane instance reads the OPRA plane (the provenance stamp follows it): every instance of a governed
111
+ * lane, a chain lane's whose chain lists on OPRA. */
112
+ export declare function wrunRowLaneInstanceReadsOpra(lane: Pick<WrunRowLaneDescriptor, 'governed' | 'chain'>, extras: Readonly<Record<string, unknown>>): boolean;
113
+ /** The governed exchange a chain-lane instance reads beside its chart's own market (the exchange its served access,
114
+ * and so its delayed window, is read under): its chain's when a gate governs it (OPRA, a CME Group exchange); null
115
+ * for a plain chain and for any other lane. The chain poll lanes' one rule (`wrunPollLaneChainGovernedExchange`). */
116
+ export declare function wrunRowLaneChainGovernedExchange(lane: Pick<WrunRowLaneDescriptor, 'chain'>, extras: Readonly<Record<string, unknown>>): string | null;
117
+ /** The first row-lane instance of a session whose acquisition moved since the run planned it (its lane's
118
+ * `acquisitionMoved` over the run's record of it, else over the instance's payload), or undefined: the live tick
119
+ * rebuilds the session then. */
120
+ export declare function wrunRowLaneMovedInstance(instances: ReadonlyArray<Pick<WrunRowLaneInstance, 'key' | 'laneKey' | 'extras'>> | undefined, acquisition: Readonly<Partial<Record<WrunRowLaneId, Readonly<Record<string, unknown>>>>>): WrunRowLaneId | undefined;
121
+ /**
122
+ * A chain instance's ask (the full run's and the reconcile's, re-read on every ask): its payload with the fields its
123
+ * plane names beside it, by the chain poll lanes' one rule (`wrunPollLaneChainAsk`): an OPRA chain names the plane and
124
+ * its routed tier (Door C judges it an OPRA ask, the legend names a delayed tier); a CME chain its routed tier alone
125
+ * (`servedTier`, so no source cache serves one tier's rows to the other; the chart's own badge names the delay); a
126
+ * plain chain (a crypto venue) nothing. Any other lane's payload as it is. `tierOf` is the routing's rule
127
+ * (governed-route.util `governedMarketDataTier`), handed in so this module stays off the routing graph, and asked only
128
+ * for a governed exchange: it answers delayed for any exchange no gate governs.
129
+ */
130
+ export declare function wrunRowLaneChainAsk(lane: Pick<WrunRowLaneDescriptor, 'chain'>, extras: Readonly<Record<string, unknown>>, tierOf: (exchange: string) => 'realtime' | 'delayed'): Readonly<Record<string, unknown>>;
131
+ /** How an empty answer reads for a lane: quiet (present EMPTY blocks) or degrading (a state lane's). */
132
+ export declare function wrunRowLaneEmptyAnswer(lane: Pick<WrunRowLaneDescriptor, 'emptyAnswer' | 'landing'>): 'quiet' | 'degrades';
133
+ /** Whether an instance must answer rows: its lane degrades on an empty answer and some input reading it does not
134
+ * declare `missing: "empty"` (a celled input's fill over an empty lane, the honest-picture rule). */
135
+ export declare function wrunRowLaneRequired(metadata: WrunIndicatorMetadata, instance: Pick<WrunRowLaneInstance, 'inputIndexes' | 'laneKey'>): boolean;
136
+ /** The fetch options a row lane's asks carry: the native-rows path for a governed lane and a chain lane (their rows
137
+ * are their plane's or their chain's, never the chart market's, an index-mode one included), none otherwise. */
138
+ export declare function wrunRowLaneFetchOptions(lane: Pick<WrunRowLaneDescriptor, 'governed' | 'chain'>): {
139
+ nativeRows: true;
140
+ } | undefined;
141
+ /** The payload field a tiered ask names its backend tier in (`landing.tiers`, the tier's key). */
142
+ export declare const WRUN_ROW_LANE_TIER_FIELD = "tier";
143
+ /** The chart window a row lane's asks cover: the host bars, ascending, the bar span and grid, the clock. */
144
+ export interface WrunRowLaneWindow {
145
+ barOpens: readonly number[];
146
+ intervalMs: number;
147
+ barGrid?: LiveBucketVenue | null;
148
+ nowMs: number;
149
+ }
150
+ /**
151
+ * A row lane's rows over a chart window `[barOpens[0], last bar's end)`: a flow or snapshot lane's asks under the
152
+ * tier rule and the lane's `tierChoice` (one per run of bars on a tier, the tier's key as `tier` in the ask's
153
+ * extras), cut to its horizon and its row budget, each answer landed on the host bars (`wrunLandCellRowsOnHostBars`,
154
+ * the lane's own `fold` when it has one), a snapshot's bar its tier answered nothing for asked again one tier coarser
155
+ * where one fits and retains it when the lane's `coarserWhenEmpty` says so of the acquisition (D12), and the bars no
156
+ * tier retains (or the budget left out) marked partial (bit 14, a marker tuple when empty); a `latest` lane asked
157
+ * once over `fallback`, its rows as they come. `ask` is the caller's fetch (the full run's, a reconcile's). Ascending,
158
+ * one row per host bar.
159
+ */
160
+ export declare function fetchWrunRowLaneRows(lane: WrunRowLaneDescriptor, extras: Readonly<Record<string, unknown>>, window: WrunRowLaneWindow, fallback: {
161
+ fromTs: number;
162
+ toTs: number;
163
+ }, ask: (extras: Readonly<Record<string, unknown>>, fromTs: number, toTs: number) => Promise<ReadonlyArray<ReadonlyArray<unknown>>>): Promise<unknown[][]>;
164
+ /**
165
+ * A host-grid ask plan cut to a lane's horizon for one acquisition (`WrunRowLaneHorizon`): every window bar that
166
+ * opens before `completeFromMs` joins the partial bars, and the asks start at the first bar that ends after
167
+ * `servedFromMs` (an ask wholly before it is dropped). No horizon: the plan as the tier rule made it.
168
+ */
169
+ export declare function wrunRowLaneAsksWithinHorizon(plan: {
170
+ asks: WrunHostGridAsk[];
171
+ partialBars: number[];
172
+ }, window: Pick<WrunRowLaneWindow, 'barOpens' | 'intervalMs'>, horizon: WrunRowLaneHorizon | undefined): {
173
+ asks: WrunHostGridAsk[];
174
+ partialBars: number[];
175
+ };
176
+ /**
177
+ * A host-grid ask plan cut to a lane's row budget (`WrunRowLaneRowBudget`), before any fetch: walking the asked bars
178
+ * from the newest, each at its ask's tier, it keeps the bars whose projected rows still fit `maxRows`; every older
179
+ * asked bar joins the partial bars and the asks start at the oldest kept bar's open (a bar is read whole or not at
180
+ * all). A bar whose own projection passes the cap stops the walk there. No budget, or every bar fitting: the plan
181
+ * as it came.
182
+ */
183
+ export declare function wrunRowLaneAsksWithinRowBudget(plan: {
184
+ asks: WrunHostGridAsk[];
185
+ partialBars: number[];
186
+ }, window: Pick<WrunRowLaneWindow, 'barOpens' | 'intervalMs' | 'nowMs'>, budget: WrunRowLaneRowBudget | undefined): {
187
+ asks: WrunHostGridAsk[];
188
+ partialBars: number[];
189
+ };
190
+ /** The ask shape a lane's own `fetch` takes, over a window. */
191
+ export declare function wrunRowLaneOwnAsk(extras: Readonly<Record<string, unknown>>, fromTs: number, toTs: number, intervalMs: number): WrunPollLaneFetchAsk;
192
+ /**
193
+ * One input's cell blocks from its lane's host-bar rows (`[barOpen, ...tuples]`), as the shared host's aligner
194
+ * reads them (`{ ts, cells }`, the tuples flattened): each row's exact tuples (`width` finite numbers), through the
195
+ * lane's per-input projection (`cells`), on the row's own stamp (the aligner exact-joins it on the chart's grid; a
196
+ * bar the lane holds no row for reads a present EMPTY block). A PARTIAL bar stays partial through the projection
197
+ * (`wrunProjectedBlock`). A `latest` lane's newest row lands on the LIVE row alone (`liveTs`, the chart's last row;
198
+ * the options chain's rule) whatever its stamp, every other row reading an empty block. `afterTs` (a tail build's
199
+ * carry) keeps the rows stamped after it, except a `latest` lane's newest.
200
+ */
201
+ export declare function wrunRowLaneCellRows(lane: Pick<WrunRowLaneDescriptor, 'width' | 'landing' | 'cells' | 'finiteColumns' | 'presentMask'>, rows: ReadonlyArray<ReadonlyArray<unknown>>, input: WrunRowLaneCellInput, opts?: {
202
+ liveTs?: number;
203
+ afterTs?: number;
204
+ }): Array<{
205
+ ts: number;
206
+ cells: number[];
207
+ }>;