@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,268 @@
1
+ /**
2
+ * Run interval: TradingView's indicator Timeframe model for built-ins (HTF-NATIVE-PLAN.md).
3
+ *
4
+ * A built-in whose `timeframe` input selects an interval coarser than its chart runs its engine AT
5
+ * that interval: the template's plain chart path on real candles of that interval, exactly what a
6
+ * chart on that interval computes. Its rows are then projected onto the chart's bars
7
+ * (projectRunRowsOntoChart). This replaces the template-side selected-timeframe branches, which
8
+ * rebuilt the coarse candles from the chart's loaded bars and never warmed up (2026-10-01: a 5m RSI
9
+ * at 1h read 51.12 against the 1h chart's 50.19).
10
+ *
11
+ * NATIVE_RUN_INTERVAL_SUBTYPES lists the built-ins converted so far. Market replay keeps the
12
+ * template path until replay can serve run-interval candles clipped at the replay cursor.
13
+ */
14
+ import { Intervals } from '../../constants/interval.constants.js';
15
+ import { cmeSessionBarEndMs, cmeSessionBarOpenMs, cmeSessionBucketMs } from './cme-session-bucket.util.js';
16
+ /**
17
+ * Built-ins whose `timeframe` input runs the engine at that interval: every built-in template with
18
+ * the input, the 14 classics (P2, 2026-10-03) and the 14 TradingView staples (2026-10-04), each
19
+ * pinned by tests/utility/chart/indicator-run-interval.parity.spec.ts against its own chart at that
20
+ * interval. A built-in without the input (Zig Zag, Pivot Points, Volume Bubbles) and every
21
+ * community script run at the chart's interval.
22
+ */
23
+ export const NATIVE_RUN_INTERVAL_SUBTYPES = new Set([
24
+ 'ADL',
25
+ 'ADX',
26
+ 'AO',
27
+ 'AROON',
28
+ 'ATR',
29
+ 'BOLLINGER_BANDS',
30
+ 'CCI',
31
+ 'CMF',
32
+ 'DONCHIAN',
33
+ 'EMA',
34
+ 'HMA',
35
+ 'ICHI_CLOUD',
36
+ 'KELTNER',
37
+ 'MACD',
38
+ 'MFI',
39
+ 'MOMENTUM',
40
+ 'OBV',
41
+ 'PSAR',
42
+ 'ROC',
43
+ 'RSI',
44
+ 'SMA',
45
+ 'STOCH',
46
+ 'STOCH_RSI',
47
+ 'SUPERTREND',
48
+ 'VOLUME_BAR',
49
+ 'VWMA',
50
+ 'WILLIAMS_R',
51
+ 'WMA',
52
+ ]);
53
+ /**
54
+ * The lookback, in run bars, a converted built-in's chart path computes over where the engine's
55
+ * declared lookback misses a term. The declaration pass reports the deepest single input of each
56
+ * function it sees (MACD's slow period, the Ichimoku lagging span, the stochastic %K window, one
57
+ * Wilder period for ADX), not the chain the template runs: MACD's signal EMA runs over the slow
58
+ * EMA, Ichimoku displaces its spans past the lagging window, the stochastic smooths %K and then
59
+ * %D (and an oscillator smoothing after that), ADX averages period DX values that each need
60
+ * period true ranges. The warm-up (run-interval-engine.util) takes the deeper of this and the
61
+ * declared lookback, so every other converted built-in, whose declaration is right (a period, a
62
+ * volume MA length, none for the path-dependent ADL, OBV and PSAR, which read the warm-up floor),
63
+ * needs no entry. Mirrors WRUN_RUN_INTERVAL_TWINS (wrun-run-interval.util) with the templates' input
64
+ * names. `inputs` reads each input as set on the overlay, else as the template declares it, else 0.
65
+ *
66
+ * The staples (measured against the declaration pass, 2026-10-04): the pass does not trace an input
67
+ * into atr(), wpr() or highestbars(), so Supertrend, Keltner's ATR bands, Williams %R and Aroon
68
+ * declare nothing for it; an offset reads the line that many bars back (Donchian, WMA, VWMA); Hull
69
+ * runs its outer average over round(sqrt(period)) hull inputs; the Stochastic RSI chains the RSI,
70
+ * its stochastic window and the K and D averages. ATR, CMF, Momentum, ROC and the Awesome
71
+ * Oscillator declare their own lookback right. Supertrend is path-dependent beyond its ATR (its
72
+ * bands and trend carry from the first loaded bar), like PSAR.
73
+ */
74
+ export const NATIVE_RUN_INTERVAL_LOOKBACK_BARS = {
75
+ ADX: (inputs) => 2 * inputs.num('period'),
76
+ AROON: (inputs) => inputs.num('length') + 1,
77
+ DONCHIAN: (inputs) => inputs.num('period') + inputs.num('offset'),
78
+ HMA: (inputs) => inputs.num('period') + Math.round(Math.sqrt(inputs.num('period'))),
79
+ ICHI_CLOUD: (inputs) => Math.max(inputs.num('conversionPeriod'), inputs.num('basePeriod'), inputs.num('laggingSpanPeriod')) +
80
+ inputs.num('displacement'),
81
+ KELTNER: (inputs) => Math.max(inputs.num('period'), keltnerBandBars(inputs)),
82
+ MACD: (inputs) => Math.max(inputs.num('fastPeriod'), inputs.num('slowPeriod')) + inputs.num('signalPeriod'),
83
+ STOCH: (inputs) => inputs.num('kPeriod') + inputs.num('kSmoothing') + inputs.num('dPeriod') + oscillatorSmoothingBars(inputs),
84
+ STOCH_RSI: (inputs) => inputs.num('rsiLength') + inputs.num('stochLength') + inputs.num('kSmoothing') + inputs.num('dSmoothing'),
85
+ SUPERTREND: (inputs) => inputs.num('atrPeriod'),
86
+ VWMA: (inputs) => inputs.num('period') + inputs.num('offset'),
87
+ WILLIAMS_R: (inputs) => inputs.num('length'),
88
+ WMA: (inputs) => inputs.num('period') + inputs.num('offset'),
89
+ };
90
+ /** Keltner's band smoothing: its own ATR period on ATR bands (the default style), nothing more otherwise. */
91
+ function keltnerBandBars(inputs) {
92
+ const style = inputs.str('bandStyle');
93
+ return style === '' || style === 'Average True Range' ? inputs.num('atrPeriod') : 0;
94
+ }
95
+ /** The oscillator smoothing MA (OSCILLATOR_SMOOTHING_INPUTS) chained after the value: 0 while it is off. */
96
+ function oscillatorSmoothingBars(inputs) {
97
+ const type = inputs.str('smoothingType');
98
+ return type === '' || type === 'None' ? 0 : inputs.num('smoothingLength');
99
+ }
100
+ /** The templates' `timeframe` options (CLASSIC_TIMEFRAME_INPUTS) as chart interval keys. */
101
+ const TIMEFRAME_INTERVALS = {
102
+ '5m': '5m',
103
+ '15m': '15m',
104
+ '30m': '30m',
105
+ '1h': '1h',
106
+ '4h': '4h',
107
+ '1D': '1d',
108
+ '1W': '1w',
109
+ };
110
+ /**
111
+ * The [open, close) of the run bar stamped `stamp`: `[stamp, stamp + intervalMs)`, or on the CME
112
+ * session lattice its session bar's (cmeSessionBarOpenMs, cmeSessionBarEndMs: a 1D bar stamped at
113
+ * 00:00Z of its trade date opens at the 17:00 Chicago open before it and closes at the next one).
114
+ * A stamp the lattice books no bar to (a width that divides an hour, a regular-hours bar, a time
115
+ * that is no run bar's) reads the plain span.
116
+ */
117
+ export function runBarSpan(stamp, run) {
118
+ const close = run.sessionLattice ? cmeSessionBarEndMs(stamp, run.intervalMs) : null;
119
+ if (close === null)
120
+ return { open: stamp, close: stamp + run.intervalMs };
121
+ return { open: cmeSessionBarOpenMs(stamp, run.intervalMs) ?? stamp, close };
122
+ }
123
+ /** runBarSpan's close alone, for a loop over many bars that never reads the session open (uncached). */
124
+ function runBarCloseMs(stamp, run) {
125
+ return (run.sessionLattice ? cmeSessionBarEndMs(stamp, run.intervalMs) : null) ?? stamp + run.intervalMs;
126
+ }
127
+ /** The first index whose time is at or after `time` (times ascending); times.length when none. */
128
+ function firstIndexAtOrAfter(times, time) {
129
+ let lo = 0;
130
+ let hi = times.length;
131
+ while (lo < hi) {
132
+ const mid = (lo + hi) >> 1;
133
+ if (times[mid] < time)
134
+ lo = mid + 1;
135
+ else
136
+ hi = mid;
137
+ }
138
+ return lo;
139
+ }
140
+ /**
141
+ * The close of the run bar after the one stamped `stamp`: from there on a chart bar shows a run bar
142
+ * later than it. Plain, the next run bar opens at its close (`stamp + 2 * intervalMs`). On the
143
+ * session lattice a gap (the daily halt, a weekend, a holiday) holds no run bar, so the next one is
144
+ * the run bar of the first chart bar (`chartTimes`, ascending) at or after its close: that chart
145
+ * bar's session bar when `stamp` is one, else the run bar it opens (a session reopens on a run
146
+ * bar's open, a regular-hours one included). Infinity when no chart bar reaches that close.
147
+ */
148
+ export function nextRunBarCloseMs(stamp, chartTimes, run) {
149
+ if (!run.sessionLattice)
150
+ return stamp + 2 * run.intervalMs;
151
+ const sessionClose = cmeSessionBarEndMs(stamp, run.intervalMs);
152
+ const at = firstIndexAtOrAfter(chartTimes, sessionClose ?? stamp + run.intervalMs);
153
+ if (at === chartTimes.length)
154
+ return Number.POSITIVE_INFINITY;
155
+ const first = chartTimes[at];
156
+ const next = sessionClose === null ? first : (cmeSessionBucketMs(first, run.intervalMs) ?? first);
157
+ return runBarCloseMs(next, run);
158
+ }
159
+ function intervalMsOf(interval) {
160
+ const ms = typeof interval === 'number' ? interval : Intervals.map_unit[String(interval)];
161
+ return typeof ms === 'number' && Number.isFinite(ms) && ms > 0 ? ms : undefined;
162
+ }
163
+ /**
164
+ * The run interval a Timeframe option label ("1h", "1D") selects on a chart of `chartInterval`:
165
+ * coarser than the chart, else null (the chart's own interval, an unknown label, "chart"). Shared
166
+ * by the kScript built-ins (resolveRunInterval) and their wrun Indicators (wrun-run-interval.util).
167
+ */
168
+ export function runIntervalOfTimeframeLabel(label, chartInterval) {
169
+ const interval = typeof label === 'string' ? TIMEFRAME_INTERVALS[label] : undefined;
170
+ const intervalMs = intervalMsOf(interval);
171
+ const chartMs = intervalMsOf(chartInterval);
172
+ if (interval === undefined || intervalMs === undefined || chartMs === undefined || intervalMs <= chartMs) {
173
+ return null;
174
+ }
175
+ return { interval, intervalMs };
176
+ }
177
+ /**
178
+ * Whether a Timeframe option label selects the chart's own interval or a finer one. Such a
179
+ * selection means "chart" (HTF-NATIVE-PLAN.md D3a): the resolver below answers null for it, and the
180
+ * engine must see `timeframe: "chart"` too (chartIntervalEngineMetadata), or the template's
181
+ * selected-timeframe branch calls htf() with an interval below its base and the engine throws on
182
+ * every update ("htf() timeframe 900000ms must be >= base interval 3600000ms": a 15m selection
183
+ * on a 1h chart froze the line at its last good run, Kyle's 2026-10-03 INT dump). Their wrun twins
184
+ * read it too (wrunTimeframeIsChartOrFiner, wrun-run-interval.util).
185
+ */
186
+ export function timeframeIsChartOrFiner(label, chartInterval) {
187
+ const interval = typeof label === 'string' ? TIMEFRAME_INTERVALS[label] : undefined;
188
+ const intervalMs = intervalMsOf(interval);
189
+ const chartMs = intervalMsOf(chartInterval);
190
+ return intervalMs !== undefined && chartMs !== undefined && intervalMs <= chartMs;
191
+ }
192
+ /**
193
+ * The interval an overlay's engine runs at when it is coarser than the chart's, else null (the
194
+ * overlay runs at the chart's interval, as before). A selection at or below the chart's interval
195
+ * is the chart's own, so it takes the plain chart path too.
196
+ */
197
+ export function resolveRunInterval(input) {
198
+ if (input.replay)
199
+ return null;
200
+ if (typeof input.subType !== 'string' || !NATIVE_RUN_INTERVAL_SUBTYPES.has(input.subType))
201
+ return null;
202
+ const settings = (input.settings ?? {});
203
+ const run = runIntervalOfTimeframeLabel(settings.timeframe, input.chartInterval);
204
+ return run ? { ...run, waitForClose: settings.waitForClose !== false } : null;
205
+ }
206
+ /** The settings the engine sees for a run-interval overlay: the template takes its plain chart path. */
207
+ export function engineSettingsForRunInterval(settings) {
208
+ return { ...settings, timeframe: 'chart' };
209
+ }
210
+ /**
211
+ * Projects run-interval rows (oldest first, `row[0]` = the run bar's stamp, its open off the
212
+ * session lattice) onto the chart's bars: one row per chart time, with the cells of the run row that
213
+ * bar shows. Each run bar's span is read by runBarSpan (`sessionLattice`: the CME session calendar).
214
+ *
215
+ * Wait for close on: a chart bar shows the last run bar that closed at or before it
216
+ * (`close <= chartTime`, plain `stamp + runMs`), so a 5m bar in hour b shows hour b - 1. Off: the
217
+ * same, except the chart bars inside the newest run row's span show that row (the forming bar,
218
+ * live; on the lattice from its session open, before a 1D or 1W stamp). Chart bars before the first
219
+ * shown row get NaN cells. Run rows before the first chart bar (the warm-up) are dropped.
220
+ */
221
+ export function projectRunRowsOntoChart(rows, chartTimes, runMs, waitForClose, sessionLattice = false) {
222
+ const run = { intervalMs: runMs, sessionLattice };
223
+ const usable = rows.filter((row) => Array.isArray(row) && Number.isFinite(Number(row[0])));
224
+ const width = usable.reduce((max, row) => Math.max(max, row.length), 1);
225
+ const emptyCells = new Array(width - 1).fill(NaN);
226
+ const newest = usable[usable.length - 1];
227
+ const forming = newest ? runBarSpan(Number(newest[0]), run) : { open: NaN, close: NaN };
228
+ const closes = usable.map((row) => runBarCloseMs(Number(row[0]), run));
229
+ const projected = [];
230
+ let shown = -1;
231
+ for (const chartTime of chartTimes) {
232
+ if (!waitForClose && newest && chartTime >= forming.open && chartTime < forming.close) {
233
+ projected.push([chartTime, ...newest.slice(1)]);
234
+ continue;
235
+ }
236
+ while (shown + 1 < usable.length && closes[shown + 1] <= chartTime)
237
+ shown++;
238
+ projected.push(shown < 0 ? [chartTime, ...emptyCells] : [chartTime, ...usable[shown].slice(1)]);
239
+ }
240
+ return projected;
241
+ }
242
+ /**
243
+ * The chart time a run-bar time anchor (a drawing point at a run bar's stamp) lands on: where that
244
+ * bar's value first shows (its close with wait for close on, its open with it off, read by
245
+ * runBarSpan), clamped to the chart's loaded bars.
246
+ */
247
+ export function projectRunTimeOntoChart(runTime, chartTimes, runMs, waitForClose, sessionLattice = false) {
248
+ if (chartTimes.length === 0)
249
+ return runTime;
250
+ const span = runBarSpan(runTime, { intervalMs: runMs, sessionLattice });
251
+ const target = waitForClose ? span.close : span.open;
252
+ const first = chartTimes[0];
253
+ const last = chartTimes[chartTimes.length - 1];
254
+ if (target <= first)
255
+ return first;
256
+ if (target >= last)
257
+ return last;
258
+ let lo = 0;
259
+ let hi = chartTimes.length - 1;
260
+ while (lo < hi) {
261
+ const mid = (lo + hi) >> 1;
262
+ if (chartTimes[mid] < target)
263
+ lo = mid + 1;
264
+ else
265
+ hi = mid;
266
+ }
267
+ return chartTimes[lo];
268
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The one resolver between chart interval labels, their wire enum
3
+ * (`AggregationInterval`) and their millisecond length. Pure and worker-safe.
4
+ *
5
+ * Standard and custom labels each map to their own wire interval, so a chart
6
+ * requests exactly the interval it shows. The custom labels (the closed
7
+ * `CUSTOM_INTERVALS` set) are served by the gateway rolling up a finer
8
+ * materialized tier (tsdb-gateway !2146-!2149) and go out like any standard
9
+ * label, with no sentinel. An unmapped label falls back to MINUTE
10
+ * (`grpcIntervalOf`), so a label missing here would paint 1m candles.
11
+ */
12
+ import { AggregationInterval } from '@orangecharts/orange-v2-pb-common';
13
+ export { CUSTOM_INTERVALS, EXTENDED_INTERVALS, intervalLabelForMs, intervalMs, isCustomInterval, isExtendedInterval, standardIntervalAtOrBelow, standardIntervalMsAtOrBelow, type CustomInterval, type ExtendedInterval, } from './interval-ladder.util.js';
14
+ /** The wire interval for a standard or custom label, `undefined` for anything else. */
15
+ export declare function lookupGrpcInterval(label: unknown): AggregationInterval | undefined;
16
+ /**
17
+ * `lookupGrpcInterval` with MINUTE for a missing label: worker payloads that
18
+ * legitimately omit their tf keep the default they always had. An unknown
19
+ * label string warns once, so the fallback is visible.
20
+ */
21
+ export declare function grpcIntervalOf(label: unknown): AggregationInterval;
22
+ /** True for the rungs shorter than a minute (1s 5s 15s 30s): one Plus gate, one venue rule, served where 1s is. */
23
+ export declare function isSubMinuteInterval(label: unknown): boolean;
@@ -0,0 +1,83 @@
1
+ /**
2
+ * The one resolver between chart interval labels, their wire enum
3
+ * (`AggregationInterval`) and their millisecond length. Pure and worker-safe.
4
+ *
5
+ * Standard and custom labels each map to their own wire interval, so a chart
6
+ * requests exactly the interval it shows. The custom labels (the closed
7
+ * `CUSTOM_INTERVALS` set) are served by the gateway rolling up a finer
8
+ * materialized tier (tsdb-gateway !2146-!2149) and go out like any standard
9
+ * label, with no sentinel. An unmapped label falls back to MINUTE
10
+ * (`grpcIntervalOf`), so a label missing here would paint 1m candles.
11
+ */
12
+ import { AggregationInterval } from '@orangecharts/orange-v2-pb-common';
13
+ import { intervalMs } from './interval-ladder.util.js';
14
+ // The label half (the labels, their lengths and the tuning ladder) is the pure leaf's (interval-ladder.util); its
15
+ // importers keep this path.
16
+ export { CUSTOM_INTERVALS, EXTENDED_INTERVALS, intervalLabelForMs, intervalMs, isCustomInterval, isExtendedInterval, standardIntervalAtOrBelow, standardIntervalMsAtOrBelow, } from './interval-ladder.util.js';
17
+ // Every label's wire interval, keyed by the leaf's label unions: a label the leaf declares without a wire interval
18
+ // here (or one here the leaf does not declare) fails the compile. The classic ladder first, then the custom presets
19
+ // and the extended rungs, each in the leaf's order (the reversed length map reads the labels in this order).
20
+ const STANDARD_INTERVAL_WIRE = {
21
+ '1m': AggregationInterval.MINUTE,
22
+ '5m': AggregationInterval.FIVE_MINUTES,
23
+ '15m': AggregationInterval.FIFTEEN_MINUTES,
24
+ '1h': AggregationInterval.HOUR,
25
+ '4h': AggregationInterval.FOUR_HOURS,
26
+ '1d': AggregationInterval.DAY,
27
+ '1w': AggregationInterval.WEEK,
28
+ '1s': AggregationInterval.SECOND,
29
+ '30m': AggregationInterval.THIRTY_MINUTES,
30
+ '1M': AggregationInterval.MONTH,
31
+ '3M': AggregationInterval.QUARTER_YEAR,
32
+ '1Y': AggregationInterval.YEAR,
33
+ };
34
+ const CUSTOM_INTERVAL_WIRE = {
35
+ '2m': AggregationInterval.TWO_MINUTES,
36
+ '3m': AggregationInterval.THREE_MINUTES,
37
+ '10m': AggregationInterval.TEN_MINUTES,
38
+ '45m': AggregationInterval.FORTY_FIVE_MINUTES,
39
+ '2h': AggregationInterval.TWO_HOURS,
40
+ '6h': AggregationInterval.SIX_HOURS,
41
+ '8h': AggregationInterval.EIGHT_HOURS,
42
+ '12h': AggregationInterval.TWELVE_HOURS,
43
+ '3d': AggregationInterval.THREE_DAYS,
44
+ };
45
+ const EXTENDED_INTERVAL_WIRE = {
46
+ '5s': AggregationInterval.FIVE_SECONDS,
47
+ '15s': AggregationInterval.FIFTEEN_SECONDS,
48
+ '30s': AggregationInterval.THIRTY_SECONDS,
49
+ '6M': AggregationInterval.HALF_YEAR,
50
+ };
51
+ const GRPC_INTERVAL_BY_LABEL = {
52
+ ...STANDARD_INTERVAL_WIRE,
53
+ ...CUSTOM_INTERVAL_WIRE,
54
+ ...EXTENDED_INTERVAL_WIRE,
55
+ };
56
+ const hasOwn = (record, key) => Object.prototype.hasOwnProperty.call(record, key);
57
+ /** The wire interval for a standard or custom label, `undefined` for anything else. */
58
+ export function lookupGrpcInterval(label) {
59
+ if (typeof label !== 'string')
60
+ return undefined;
61
+ return hasOwn(GRPC_INTERVAL_BY_LABEL, label) ? GRPC_INTERVAL_BY_LABEL[label] : undefined;
62
+ }
63
+ const warnedUnknownLabels = new Set();
64
+ /**
65
+ * `lookupGrpcInterval` with MINUTE for a missing label: worker payloads that
66
+ * legitimately omit their tf keep the default they always had. An unknown
67
+ * label string warns once, so the fallback is visible.
68
+ */
69
+ export function grpcIntervalOf(label) {
70
+ const interval = lookupGrpcInterval(label);
71
+ if (interval !== undefined)
72
+ return interval;
73
+ if (typeof label === 'string' && !warnedUnknownLabels.has(label)) {
74
+ warnedUnknownLabels.add(label);
75
+ console.warn(`[interval-registry] Unknown interval "${label}"; requesting 1m.`);
76
+ }
77
+ return AggregationInterval.MINUTE;
78
+ }
79
+ /** True for the rungs shorter than a minute (1s 5s 15s 30s): one Plus gate, one venue rule, served where 1s is. */
80
+ export function isSubMinuteInterval(label) {
81
+ const ms = intervalMs(label);
82
+ return ms !== undefined && lookupGrpcInterval(label) !== undefined && ms < 60_000;
83
+ }
@@ -0,0 +1,21 @@
1
+ /** The chart the stages read: its overlays (`metadata`), the main bars among them. A structural copy of
2
+ * kscript-drawings.util.ts `KScriptDrawingsChart` (the adapter's chart target extends it): that module loads a store,
3
+ * so this leaf may not import it, not even its types. */
4
+ type KScriptDrawingsChart = {
5
+ metadata?: unknown[];
6
+ updateDrawings?(overlayId: string, drawings: unknown[]): void;
7
+ getDrawingRenderSets?: () => unknown[];
8
+ };
9
+ declare function plotTypeOf(container: Record<string, unknown>): string | undefined;
10
+ declare function finiteRowTime(row: unknown): number | null;
11
+ declare function outputTreeHasMainIndexAlignedPlot(output: unknown, seen?: WeakSet<object>): boolean;
12
+ declare function mainChartMetaForKScript(tc: KScriptDrawingsChart): Record<string, unknown> | null;
13
+ declare function mainChartRowsForKScriptIndexAlignment(tc: KScriptDrawingsChart): unknown[];
14
+ declare function mainChartTimesForKScriptIndexAlignment(tc: KScriptDrawingsChart): number[];
15
+ declare function alignRowsToMainChartIndex(rows: unknown, mainTimes: number[], options?: {
16
+ force?: boolean;
17
+ }): unknown;
18
+ declare function shouldAlignOutputRowsToMainChartIndex(output: Record<string, unknown>): boolean;
19
+ declare function alignKScriptIndexDecoratorsToMainChart(runResult: unknown, tc: KScriptDrawingsChart): unknown;
20
+ declare function padContinuousKScriptOutputGapsOnMainGrid(runResult: unknown, tc: KScriptDrawingsChart): unknown;
21
+ export { alignKScriptIndexDecoratorsToMainChart, padContinuousKScriptOutputGapsOnMainGrid, alignRowsToMainChartIndex, finiteRowTime, mainChartMetaForKScript, mainChartRowsForKScriptIndexAlignment, mainChartTimesForKScriptIndexAlignment, outputTreeHasMainIndexAlignedPlot, plotTypeOf, shouldAlignOutputRowsToMainChartIndex, };