@orangecharts/wrun-chart-host 0.1.0 → 0.3.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 (337) hide show
  1. package/README.md +39 -6
  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/venue-presets.constants.d.ts +10 -0
  23. package/dist/constants/venue-presets.constants.js +22 -0
  24. package/dist/enums/chart.enum.d.ts +68 -0
  25. package/dist/enums/chart.enum.js +70 -0
  26. package/dist/helpers/data.helpers.d.ts +2 -0
  27. package/dist/helpers/data.helpers.js +14 -0
  28. package/dist/host-env.d.ts +161 -5
  29. package/dist/host-ports.types.d.ts +446 -0
  30. package/dist/host-ports.types.js +1 -0
  31. package/dist/index.d.ts +131 -0
  32. package/dist/index.js +131 -0
  33. package/dist/indicators/controls/technical-script/technical-script-input-rendering.d.ts +86 -0
  34. package/dist/indicators/controls/technical-script/technical-script-input-rendering.js +179 -0
  35. package/dist/interfaces/asset-venue.interface.d.ts +91 -0
  36. package/dist/interfaces/asset-venue.interface.js +1 -0
  37. package/dist/interfaces/cancel-reason.interface.d.ts +24 -0
  38. package/dist/interfaces/cancel-reason.interface.js +2 -0
  39. package/dist/interfaces/catalog-display.interface.d.ts +3 -0
  40. package/dist/interfaces/catalog-display.interface.js +1 -0
  41. package/dist/interfaces/cme-realtime.interface.d.ts +251 -0
  42. package/dist/interfaces/cme-realtime.interface.js +46 -0
  43. package/dist/interfaces/feed.interface.d.ts +80 -0
  44. package/dist/interfaces/feed.interface.js +7 -0
  45. package/dist/interfaces/market-kind.interface.d.ts +8 -0
  46. package/dist/interfaces/market-kind.interface.js +1 -0
  47. package/dist/interfaces/opra-realtime.interface.d.ts +224 -0
  48. package/dist/interfaces/opra-realtime.interface.js +105 -0
  49. package/dist/interfaces/option-instrument.interface.d.ts +32 -0
  50. package/dist/interfaces/option-instrument.interface.js +1 -0
  51. package/dist/interfaces/options-chain-scope.interface.d.ts +29 -0
  52. package/dist/interfaces/options-chain-scope.interface.js +7 -0
  53. package/dist/interfaces/prediction-market.interface.d.ts +88 -0
  54. package/dist/interfaces/prediction-market.interface.js +8 -0
  55. package/dist/interfaces/wrun-runtime.interface.d.ts +5 -0
  56. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +185 -0
  57. package/dist/kscript-data/controls/live-trades-merge.util.js +357 -0
  58. package/dist/settings-templates/frvp-fields.d.ts +27 -0
  59. package/dist/settings-templates/frvp-fields.js +108 -0
  60. package/dist/settings-templates/index.d.ts +119 -0
  61. package/dist/settings-templates/index.js +442 -0
  62. package/dist/settings-templates/indicator-fields.d.ts +56 -0
  63. package/dist/settings-templates/indicator-fields.js +793 -0
  64. package/dist/settings-templates/tool-rules.d.ts +59 -0
  65. package/dist/settings-templates/tool-rules.js +49 -0
  66. package/dist/settings-templates/tool-tables.generated.d.ts +2 -0
  67. package/dist/settings-templates/tool-tables.generated.js +1668 -0
  68. package/dist/utility/blk-market.util.d.ts +5 -0
  69. package/dist/utility/blk-market.util.js +12 -0
  70. package/dist/utility/chart/chart-load-phase.util.d.ts +32 -0
  71. package/dist/utility/chart/chart-load-phase.util.js +78 -0
  72. package/dist/utility/chart/cme-cache-context.util.d.ts +108 -0
  73. package/dist/utility/chart/cme-cache-context.util.js +166 -0
  74. package/dist/utility/chart/cme-session-bucket.util.d.ts +82 -0
  75. package/dist/utility/chart/cme-session-bucket.util.js +343 -0
  76. package/dist/utility/chart/cme-trade-calendar.util.d.ts +26 -0
  77. package/dist/utility/chart/cme-trade-calendar.util.js +147 -0
  78. package/dist/utility/chart/continuous-contracts.util.d.ts +138 -0
  79. package/dist/utility/chart/continuous-contracts.util.js +374 -0
  80. package/dist/utility/chart/feed-interval.util.d.ts +119 -0
  81. package/dist/utility/chart/feed-interval.util.js +321 -0
  82. package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +110 -0
  83. package/dist/utility/chart/fetch-dedupe-policy.util.js +407 -0
  84. package/dist/utility/chart/footprint-band.util.d.ts +76 -0
  85. package/dist/utility/chart/footprint-band.util.js +205 -0
  86. package/dist/utility/chart/footprint-cell-identity.util.d.ts +82 -0
  87. package/dist/utility/chart/footprint-cell-identity.util.js +346 -0
  88. package/dist/utility/chart/formula-calendar.util.d.ts +27 -0
  89. package/dist/utility/chart/formula-calendar.util.js +59 -0
  90. package/dist/utility/chart/history-wall.util.d.ts +67 -0
  91. package/dist/utility/chart/history-wall.util.js +87 -0
  92. package/dist/utility/chart/index-mode.util.d.ts +66 -0
  93. package/dist/utility/chart/index-mode.util.js +360 -0
  94. package/dist/utility/chart/indicator-coverage-planner.util.d.ts +217 -0
  95. package/dist/utility/chart/indicator-coverage-planner.util.js +443 -0
  96. package/dist/utility/chart/indicator-coverage-state.util.d.ts +33 -0
  97. package/dist/utility/chart/indicator-coverage-state.util.js +110 -0
  98. package/dist/utility/chart/indicator-gap-detector.util.d.ts +127 -0
  99. package/dist/utility/chart/indicator-gap-detector.util.js +260 -0
  100. package/dist/utility/chart/indicator-gap-repair.util.d.ts +88 -0
  101. package/dist/utility/chart/indicator-gap-repair.util.js +177 -0
  102. package/dist/utility/chart/indicator-inflight-registry.util.d.ts +26 -0
  103. package/dist/utility/chart/indicator-inflight-registry.util.js +254 -0
  104. package/dist/utility/chart/interval-registry.util.d.ts +23 -0
  105. package/dist/utility/chart/interval-registry.util.js +83 -0
  106. package/dist/utility/chart/kscript-main-grid-stages.util.d.ts +21 -0
  107. package/dist/utility/chart/kscript-main-grid-stages.util.js +332 -0
  108. package/dist/utility/chart/legacy-exchange.leaf.d.ts +11 -0
  109. package/dist/utility/chart/legacy-exchange.leaf.js +43 -0
  110. package/dist/utility/chart/live-bucket.util.d.ts +66 -0
  111. package/dist/utility/chart/live-bucket.util.js +165 -0
  112. package/dist/utility/chart/market-session-schedule.util.d.ts +91 -0
  113. package/dist/utility/chart/market-session-schedule.util.js +337 -0
  114. package/dist/utility/chart/marketKind.util.d.ts +181 -0
  115. package/dist/utility/chart/marketKind.util.js +371 -0
  116. package/dist/utility/chart/om-panel.util.js +6 -0
  117. package/dist/utility/chart/om-widget.util.d.ts +4 -0
  118. package/dist/utility/chart/opra-read-access.leaf.d.ts +26 -0
  119. package/dist/utility/chart/opra-read-access.leaf.js +25 -0
  120. package/dist/utility/chart/prediction-identity.util.d.ts +159 -0
  121. package/dist/utility/chart/prediction-identity.util.js +236 -0
  122. package/dist/utility/chart/rth-session.util.d.ts +352 -0
  123. package/dist/utility/chart/rth-session.util.js +926 -0
  124. package/dist/utility/chart/titan-constants.pin.d.ts +43 -0
  125. package/dist/utility/chart/titan-constants.pin.js +50 -0
  126. package/dist/utility/chart/us-equities-session.util.d.ts +127 -0
  127. package/dist/utility/chart/us-equities-session.util.js +251 -0
  128. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +100 -0
  129. package/dist/utility/chart/wrun-bar-session-facts.util.js +354 -0
  130. package/dist/utility/chart/wrun-run-result.util.js +10 -0
  131. package/dist/utility/chart/wrun-wire-ref.util.d.ts +23 -0
  132. package/dist/utility/chart/wrun-wire-ref.util.js +16 -0
  133. package/dist/utility/common/safe-math-eval.d.ts +18 -0
  134. package/dist/utility/common/safe-math-eval.js +160 -0
  135. package/dist/utility/common/time.util.d.ts +134 -0
  136. package/dist/utility/common/time.util.js +428 -0
  137. package/dist/utility/common/transformations.util.d.ts +126 -0
  138. package/dist/utility/common/transformations.util.js +711 -0
  139. package/dist/utility/common/visible-timeout.util.d.ts +17 -0
  140. package/dist/utility/common/visible-timeout.util.js +75 -0
  141. package/dist/utility/exchange-normalization.util.d.ts +8 -0
  142. package/dist/utility/exchange-normalization.util.js +32 -0
  143. package/dist/utility/intl-locale.util.d.ts +2 -0
  144. package/dist/utility/intl-locale.util.js +28 -0
  145. package/dist/utility/number-format.util.d.ts +14 -1
  146. package/dist/utility/number-format.util.js +50 -19
  147. package/dist/utility/options/option-symbol.util.d.ts +28 -0
  148. package/dist/utility/options/option-symbol.util.js +176 -0
  149. package/dist/utility/options/option-trade-units.util.d.ts +190 -0
  150. package/dist/utility/options/option-trade-units.util.js +283 -0
  151. package/dist/utility/options/option-venue.util.d.ts +75 -0
  152. package/dist/utility/options/option-venue.util.js +85 -0
  153. package/dist/utility/pool-symbol.leaf.d.ts +34 -0
  154. package/dist/utility/pool-symbol.leaf.js +95 -0
  155. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.d.ts +109 -0
  156. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +302 -0
  157. package/dist/utility/symbol-selection/contract-expiry.util.d.ts +39 -0
  158. package/dist/utility/symbol-selection/contract-expiry.util.js +111 -0
  159. package/dist/utility/v2/gate-plane.util.d.ts +58 -0
  160. package/dist/utility/v2/gate-plane.util.js +99 -0
  161. package/dist/utility/v2/gate-session-latch.util.d.ts +22 -0
  162. package/dist/utility/v2/gate-session-latch.util.js +34 -0
  163. package/dist/utility/watchlist/import/tradingview-symbols.leaf.d.ts +76 -0
  164. package/dist/utility/watchlist/import/tradingview-symbols.leaf.js +221 -0
  165. package/dist/utility/wrun/sources/host-grid-landing.d.ts +15 -0
  166. package/dist/utility/wrun/sources/host-grid-landing.js +26 -0
  167. package/dist/utility/wrun/sources/lanes/bitfinex_funding.d.ts +27 -0
  168. package/dist/utility/wrun/sources/lanes/bitfinex_funding.js +85 -0
  169. package/dist/utility/wrun/sources/lanes/economic.d.ts +27 -0
  170. package/dist/utility/wrun/sources/lanes/economic.js +79 -0
  171. package/dist/utility/wrun/sources/lanes/etf_holdings.d.ts +35 -0
  172. package/dist/utility/wrun/sources/lanes/etf_holdings.js +165 -0
  173. package/dist/utility/wrun/sources/lanes/etf_premium.d.ts +19 -0
  174. package/dist/utility/wrun/sources/lanes/etf_premium.js +114 -0
  175. package/dist/utility/wrun/sources/lanes/ethena_positions.d.ts +30 -0
  176. package/dist/utility/wrun/sources/lanes/ethena_positions.js +51 -0
  177. package/dist/utility/wrun/sources/lanes/index.d.ts +2 -0
  178. package/dist/utility/wrun/sources/lanes/index.js +32 -0
  179. package/dist/utility/wrun/sources/lanes/long_short_ratio.d.ts +17 -0
  180. package/dist/utility/wrun/sources/lanes/long_short_ratio.js +47 -0
  181. package/dist/utility/wrun/sources/lanes/option_daily.d.ts +30 -0
  182. package/dist/utility/wrun/sources/lanes/option_daily.js +53 -0
  183. package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +23 -0
  184. package/dist/utility/wrun/sources/lanes/option_stats_10m.js +20 -0
  185. package/dist/utility/wrun/sources/lanes/options_flow.d.ts +50 -0
  186. package/dist/utility/wrun/sources/lanes/options_flow.js +155 -0
  187. package/dist/utility/wrun/sources/lanes/options_oi.d.ts +29 -0
  188. package/dist/utility/wrun/sources/lanes/options_oi.js +59 -0
  189. package/dist/utility/wrun/sources/lanes/options_volume.d.ts +38 -0
  190. package/dist/utility/wrun/sources/lanes/options_volume.js +63 -0
  191. package/dist/utility/wrun/sources/lanes/series.d.ts +67 -0
  192. package/dist/utility/wrun/sources/lanes/series.js +321 -0
  193. package/dist/utility/wrun/sources/lanes/token_supply.d.ts +30 -0
  194. package/dist/utility/wrun/sources/lanes/token_supply.js +145 -0
  195. package/dist/utility/wrun/sources/lanes/treasury_balance.d.ts +25 -0
  196. package/dist/utility/wrun/sources/lanes/treasury_balance.js +47 -0
  197. package/dist/utility/wrun/sources/lanes/volatility_index.d.ts +21 -0
  198. package/dist/utility/wrun/sources/lanes/volatility_index.js +11 -0
  199. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +196 -0
  200. package/dist/utility/wrun/sources/opra-option-lanes.util.js +446 -0
  201. package/dist/utility/wrun/sources/registry.d.ts +21 -0
  202. package/dist/utility/wrun/sources/registry.js +207 -0
  203. package/dist/utility/wrun/sources/row-lane-registry.d.ts +28 -0
  204. package/dist/utility/wrun/sources/row-lane-registry.js +230 -0
  205. package/dist/utility/wrun/sources/row-lanes/index.d.ts +2 -0
  206. package/dist/utility/wrun/sources/row-lanes/index.js +12 -0
  207. package/dist/utility/wrun/sources/row-lanes/option_contract_flow.d.ts +2 -0
  208. package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +38 -0
  209. package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +6 -0
  210. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +70 -0
  211. package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +4 -0
  212. package/dist/utility/wrun/sources/row-lanes/option_prints.js +191 -0
  213. package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +13 -0
  214. package/dist/utility/wrun/sources/row-lanes/option_strikes.js +137 -0
  215. package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +38 -0
  216. package/dist/utility/wrun/sources/row-lanes/option_surface.js +150 -0
  217. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +275 -0
  218. package/dist/utility/wrun/sources/wrun-poll-lane.types.js +26 -0
  219. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +224 -0
  220. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +394 -0
  221. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +283 -0
  222. package/dist/utility/wrun/sources/wrun-row-lane.types.js +16 -0
  223. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +205 -0
  224. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +469 -0
  225. package/dist/utility/wrun/wrun-browser-sources.leaf.d.ts +28 -0
  226. package/dist/utility/wrun/wrun-browser-sources.leaf.js +66 -0
  227. package/dist/utility/wrun/wrun-cloud-record.util.d.ts +65 -0
  228. package/dist/utility/wrun/wrun-cloud-record.util.js +121 -0
  229. package/dist/utility/wrun/wrun-color-settings.util.js +1 -1
  230. package/dist/utility/wrun/wrun-daily-lane.util.d.ts +95 -0
  231. package/dist/utility/wrun/wrun-daily-lane.util.js +297 -0
  232. package/dist/utility/wrun/wrun-deadline.util.d.ts +52 -0
  233. package/dist/utility/wrun/wrun-deadline.util.js +82 -0
  234. package/dist/utility/wrun/wrun-etf-flow-lane.util.d.ts +94 -0
  235. package/dist/utility/wrun/wrun-etf-flow-lane.util.js +224 -0
  236. package/dist/utility/wrun/wrun-etf-funds.util.d.ts +82 -0
  237. package/dist/utility/wrun/wrun-etf-funds.util.js +242 -0
  238. package/dist/utility/wrun/wrun-failure-cause.d.ts +39 -0
  239. package/dist/utility/wrun/wrun-failure-cause.js +94 -0
  240. package/dist/utility/wrun/wrun-frames.d.ts +28 -3
  241. package/dist/utility/wrun/wrun-frames.js +132 -52
  242. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +167 -4
  243. package/dist/utility/wrun/wrun-hosted-wire-caps.js +47 -2
  244. package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +5 -2
  245. package/dist/utility/wrun/wrun-hosted-wire.util.js +4 -2
  246. package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +22 -0
  247. package/dist/utility/wrun/wrun-lane-refusal.leaf.js +32 -0
  248. package/dist/utility/wrun/wrun-lane-warmup.util.d.ts +18 -0
  249. package/dist/utility/wrun/wrun-lane-warmup.util.js +112 -0
  250. package/dist/utility/wrun/wrun-leg-close.util.d.ts +57 -0
  251. package/dist/utility/wrun/wrun-leg-close.util.js +187 -0
  252. package/dist/utility/wrun/wrun-leg-fetch.util.d.ts +144 -0
  253. package/dist/utility/wrun/wrun-leg-fetch.util.js +212 -0
  254. package/dist/utility/wrun/wrun-leg-stream-classes.d.ts +73 -0
  255. package/dist/utility/wrun/wrun-leg-stream-classes.js +86 -0
  256. package/dist/utility/wrun/wrun-levels-child.util.d.ts +101 -6
  257. package/dist/utility/wrun/wrun-levels-child.util.js +335 -157
  258. package/dist/utility/wrun/wrun-memory-clamp.util.d.ts +33 -0
  259. package/dist/utility/wrun/wrun-memory-clamp.util.js +146 -0
  260. package/dist/utility/wrun/wrun-odds-template-market.util.d.ts +51 -0
  261. package/dist/utility/wrun/wrun-odds-template-market.util.js +251 -0
  262. package/dist/utility/wrun/wrun-opra-flow.leaf.d.ts +65 -0
  263. package/dist/utility/wrun/wrun-opra-flow.leaf.js +94 -0
  264. package/dist/utility/wrun/wrun-opra-lane.util.d.ts +47 -0
  265. package/dist/utility/wrun/wrun-opra-lane.util.js +58 -0
  266. package/dist/utility/wrun/wrun-opra-stats.leaf.d.ts +30 -0
  267. package/dist/utility/wrun/wrun-opra-stats.leaf.js +96 -0
  268. package/dist/utility/wrun/wrun-opra-underlying.util.d.ts +12 -0
  269. package/dist/utility/wrun/wrun-opra-underlying.util.js +1 -0
  270. package/dist/utility/wrun/wrun-option-contract-flow.util.d.ts +142 -0
  271. package/dist/utility/wrun/wrun-option-contract-flow.util.js +451 -0
  272. package/dist/utility/wrun/wrun-option-knobs.util.d.ts +43 -0
  273. package/dist/utility/wrun/wrun-option-knobs.util.js +81 -0
  274. package/dist/utility/wrun/wrun-option-prints.util.d.ts +144 -0
  275. package/dist/utility/wrun/wrun-option-prints.util.js +356 -0
  276. package/dist/utility/wrun/wrun-option-summary-lane.util.d.ts +102 -0
  277. package/dist/utility/wrun/wrun-option-summary-lane.util.js +143 -0
  278. package/dist/utility/wrun/wrun-options-chain.util.d.ts +308 -0
  279. package/dist/utility/wrun/wrun-options-chain.util.js +502 -0
  280. package/dist/utility/wrun/wrun-overlay-identity.util.d.ts +9 -4
  281. package/dist/utility/wrun/wrun-overlay-identity.util.js +16 -6
  282. package/dist/utility/wrun/wrun-pack.util.d.ts +6 -2
  283. package/dist/utility/wrun/wrun-pack.util.js +13 -3
  284. package/dist/utility/wrun/wrun-param-map.util.d.ts +298 -0
  285. package/dist/utility/wrun/wrun-param-map.util.js +581 -0
  286. package/dist/utility/wrun/wrun-param-values.util.d.ts +8 -0
  287. package/dist/utility/wrun/wrun-param-values.util.js +8 -0
  288. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +149 -0
  289. package/dist/utility/wrun/wrun-pin-spelling.util.js +523 -0
  290. package/dist/utility/wrun/wrun-pin-venues.util.d.ts +116 -0
  291. package/dist/utility/wrun/wrun-pin-venues.util.js +320 -0
  292. package/dist/utility/wrun/wrun-pinned-interval.util.d.ts +20 -0
  293. package/dist/utility/wrun/wrun-pinned-interval.util.js +47 -0
  294. package/dist/utility/wrun/wrun-present-bits.util.d.ts +37 -0
  295. package/dist/utility/wrun/wrun-present-bits.util.js +73 -0
  296. package/dist/utility/wrun/wrun-protocol-pending.util.d.ts +33 -0
  297. package/dist/utility/wrun/wrun-protocol-pending.util.js +57 -0
  298. package/dist/utility/wrun/wrun-refusal.util.d.ts +95 -7
  299. package/dist/utility/wrun/wrun-refusal.util.js +314 -18
  300. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +1 -14
  301. package/dist/utility/wrun/wrun-registry-errors.util.js +0 -16
  302. package/dist/utility/wrun/wrun-render-select.util.js +1 -0
  303. package/dist/utility/wrun/wrun-row-market.util.d.ts +29 -0
  304. package/dist/utility/wrun/wrun-row-market.util.js +92 -0
  305. package/dist/utility/wrun/wrun-row-source.d.ts +158 -0
  306. package/dist/utility/wrun/wrun-row-source.js +75 -0
  307. package/dist/utility/wrun/wrun-run-health.util.d.ts +155 -0
  308. package/dist/utility/wrun/wrun-run-health.util.js +273 -0
  309. package/dist/utility/wrun/wrun-socket-row-source.d.ts +439 -0
  310. package/dist/utility/wrun/wrun-socket-row-source.js +1689 -0
  311. package/dist/utility/wrun/wrun-socket-session-losses.util.d.ts +18 -0
  312. package/dist/utility/wrun/wrun-socket-session-losses.util.js +25 -0
  313. package/dist/utility/wrun/wrun-source-rows.util.d.ts +911 -0
  314. package/dist/utility/wrun/wrun-source-rows.util.js +2597 -0
  315. package/dist/utility/wrun/wrun-symbol-code.util.d.ts +32 -0
  316. package/dist/utility/wrun/wrun-symbol-code.util.js +56 -0
  317. package/dist/utility/wrun/wrun-tape-source.util.d.ts +82 -0
  318. package/dist/utility/wrun/wrun-tape-source.util.js +151 -0
  319. package/dist/utility/wrun/wrun-tier-grid.util.d.ts +137 -0
  320. package/dist/utility/wrun/wrun-tier-grid.util.js +279 -0
  321. package/dist/utility/wrun/wrun-trades-lane.util.d.ts +52 -0
  322. package/dist/utility/wrun/wrun-trades-lane.util.js +58 -0
  323. package/dist/utility/wrun/wrun-volume-profile-lane.util.d.ts +41 -0
  324. package/dist/utility/wrun/wrun-volume-profile-lane.util.js +66 -0
  325. package/dist/utility/wrun-display-name.util.d.ts +33 -0
  326. package/dist/utility/wrun-display-name.util.js +64 -0
  327. package/dist/workers/constants/kscript-transport-codes.d.ts +15 -0
  328. package/dist/workers/constants/kscript-transport-codes.js +15 -0
  329. package/dist/workers/constants/socket-slots.d.ts +574 -0
  330. package/dist/workers/constants/socket-slots.js +539 -0
  331. package/dist/workers/utils/number.worker.util.d.ts +5 -0
  332. package/dist/workers/utils/number.worker.util.js +10 -0
  333. package/dist/workers/utils/time.worker.util.d.ts +12 -0
  334. package/dist/workers/utils/time.worker.util.js +24 -0
  335. package/dist/workers/utils/volume-profile.worker.util.d.ts +200 -0
  336. package/dist/workers/utils/volume-profile.worker.util.js +631 -0
  337. package/package.json +10 -4
@@ -0,0 +1,92 @@
1
+ /**
2
+ * The market a wrun table row or feed line is about (UW-PARITY H4): a `panel.table` frame's and a
3
+ * `draw.feed` frame's `markets`, one entry per row or line, each null or one market. Two forms, in
4
+ * symbol codes (wrun-symbol-code.util):
5
+ *
6
+ * { contract: [root_code, expiry_ms, side_cp, strike] } one US listed (OPRA) option contract
7
+ * { ticker: code } one stock or ETF
8
+ *
9
+ * The grammar restates the om kit's rule (wrun-host/row-markets.ts `wrunRowMarketIssue`) with its
10
+ * words, so a frame refuses alike on every host. The contract is the OPRA cells' own identity
11
+ * (option_prints, option_contract_flow and option_contract_state lead with it): the option root as
12
+ * listed (1 to 6 characters, the OSI root), the expiry in epoch milliseconds, side_cp +1 a call and
13
+ * -1 a put, the strike above 0 and below 100000.
14
+ *
15
+ * Pure and worker-safe: the frame grammar (wrun-frames.ts) parses with it. What a click on a named
16
+ * row opens is the host's (web: src/utility/wrun/wrun-row-market-target.util.ts and the row click).
17
+ */
18
+ import { decodeSymbol, WRUN_SYMBOL_CODE_MAX_CHARS } from './wrun-symbol-code.util.js';
19
+ /** The longest option root a contract names (the OSI root field). */
20
+ export const WRUN_ROW_MARKET_ROOT_MAX_CHARS = 6;
21
+ /** A contract's strike stays below this (eight digits of thousandths). */
22
+ export const WRUN_ROW_MARKET_STRIKE_LIMIT = 100_000;
23
+ export const WRUN_ROW_MARKET_MESSAGE = 'a market is null, { "contract": [root_code, expiry_ms, side_cp, strike] } or { "ticker": code }';
24
+ export const WRUN_ROW_MARKET_CONTRACT_MESSAGE = "a contract is [root_code, expiry_ms, side_cp, strike]: the option root's symbol code (1 to 6 characters), the expiry in epoch milliseconds, +1 for a call or -1 for a put, and a strike above 0 and below 100000";
25
+ export const WRUN_ROW_MARKET_TICKER_MESSAGE = 'a ticker is a symbol code of 1 to 10 characters';
26
+ function symbolCode(value, maxChars) {
27
+ if (typeof value !== 'number')
28
+ return false;
29
+ const text = decodeSymbol(value);
30
+ return text !== undefined && text.length <= maxChars;
31
+ }
32
+ function contractValues(value) {
33
+ if (!Array.isArray(value) || value.length !== 4)
34
+ return false;
35
+ const [root, expiryMs, sideCp, strike] = value;
36
+ return (symbolCode(root, WRUN_ROW_MARKET_ROOT_MAX_CHARS) &&
37
+ typeof expiryMs === 'number' &&
38
+ Number.isSafeInteger(expiryMs) &&
39
+ expiryMs > 0 &&
40
+ (sideCp === 1 || sideCp === -1) &&
41
+ typeof strike === 'number' &&
42
+ Number.isFinite(strike) &&
43
+ strike > 0 &&
44
+ strike < WRUN_ROW_MARKET_STRIKE_LIMIT);
45
+ }
46
+ /** One non-null entry's refusal (its path below the entry and the kit's words), or null when it
47
+ * names a market. */
48
+ export function wrunRowMarketIssue(value) {
49
+ if (value === null || typeof value !== 'object' || Array.isArray(value)) {
50
+ return { path: [], message: WRUN_ROW_MARKET_MESSAGE };
51
+ }
52
+ const keys = Object.keys(value);
53
+ const entry = value;
54
+ if (keys.length !== 1 || (keys[0] !== 'contract' && keys[0] !== 'ticker')) {
55
+ return { path: [], message: WRUN_ROW_MARKET_MESSAGE };
56
+ }
57
+ if (keys[0] === 'contract') {
58
+ return contractValues(entry.contract) ? null : { path: ['contract'], message: WRUN_ROW_MARKET_CONTRACT_MESSAGE };
59
+ }
60
+ return symbolCode(entry.ticker, WRUN_SYMBOL_CODE_MAX_CHARS)
61
+ ? null
62
+ : { path: ['ticker'], message: WRUN_ROW_MARKET_TICKER_MESSAGE };
63
+ }
64
+ /** The refusal when `markets` and the rows it names differ in length (the kit's words). */
65
+ export function wrunRowMarketsLengthMessage(noun, count) {
66
+ return `markets must hold one entry per ${noun} (${count}), null for a ${noun} about no market`;
67
+ }
68
+ /** A frame's `markets`, checked against its row or line count: the list as written (each entry a
69
+ * copy), or the refusal as `[path, message]` (the path below the frame). */
70
+ export function parseWrunRowMarkets(value, noun, count) {
71
+ if (!Array.isArray(value)) {
72
+ // zod's words for a value that is no list (a decoded frame holds JSON types only).
73
+ const received = value === null ? 'null' : typeof value;
74
+ return { path: ['markets'], message: `Invalid input: expected array, received ${received}` };
75
+ }
76
+ const markets = [];
77
+ for (let at = 0; at < value.length; at += 1) {
78
+ const entry = value[at];
79
+ if (entry === null) {
80
+ markets.push(null);
81
+ continue;
82
+ }
83
+ const issue = wrunRowMarketIssue(entry);
84
+ if (issue)
85
+ return { path: ['markets', at, ...issue.path], message: issue.message };
86
+ const market = entry;
87
+ markets.push('contract' in market ? { contract: [...market.contract] } : { ticker: market.ticker });
88
+ }
89
+ if (markets.length !== count)
90
+ return { path: ['markets'], message: wrunRowMarketsLengthMessage(noun, count) };
91
+ return { markets };
92
+ }
@@ -0,0 +1,158 @@
1
+ /**
2
+ * The one row-source seam of a wrun Indicator (WRUN-PARITY-PLAN contract C7, wave 3).
3
+ *
4
+ * A wrun overlay's pass (`runWrunOverlayOnChart`, the live tick, the replay lane) asks ONE source
5
+ * for rows and never knows which: `SandboxWrunRowSource` (the browser lane: the engine worker and
6
+ * `wrun-source-rows.util.ts`) and `SocketWrunRowSource` (the cloud lane: the kScript socket worker
7
+ * and the socket row store) implement the same interface, so every surface a user meets (the
8
+ * legend, the HUD, the hover card, the children, the diagnostics, the load status) is built by the
9
+ * same code from the same batch shape. The lane is the author's publishing choice, read once from
10
+ * the record (`wrunRunTarget`), never a predicate in the pass.
11
+ *
12
+ * Rules every source honours:
13
+ * - It raises and lowers the load-status signals the own run uses (data-loading rule 2: derive,
14
+ * never set): the loading owner of `wrun-loading-owner.util.ts` and the legend loader.
15
+ * - It pages through the coverage planner's in-flight registry and dedupe table, never a registry
16
+ * of its own (`src/utility/chart/__fixtures__/fanout-golden/` stays untouched).
17
+ * - The render cap is one accounting on both lanes: the builder's budget on the lane's profile number
18
+ * (`createWrunRenderBudget`, refusing with the kit's `wrun_render_result_too_large`); a source never
19
+ * runs a second selection to charge it.
20
+ * - Refusals are the kit's codes (`WrunHostedRefusal`), rendered by `wrun-refusal.util.ts` on both
21
+ * lanes; no source carries a sentence. A refused family leaves the sheet the batch delivered
22
+ * (`wrunRowBatchDeliveredSheet`, the one rule the pass reads every batch by).
23
+ */
24
+ import type { WrunHostedGrid, WrunHostedRefusal, WrunHostedWire } from './wrun-hosted-wire.util.js';
25
+ import type { RuntimeDiagnostic } from '../../interfaces/kscript-diagnostics.interface.js';
26
+ import type { WrunIndicatorMetadata } from '../../interfaces/wrun-runtime.interface.js';
27
+ /** The window a batch covers (ms, inclusive of the bar at `fromMs`, exclusive past `toMs`). */
28
+ export interface WrunRowWindow {
29
+ fromMs: number;
30
+ toMs: number;
31
+ }
32
+ /** What a source needs to create its session: the overlay, the package it runs and the chart facts. */
33
+ export interface WrunRowSourceIdentity {
34
+ chartIndex: number;
35
+ indicatorId: string;
36
+ /** `@scope/name` of the package; a draft carries the editor's draft ref instead. */
37
+ packageName: string;
38
+ version: string | null;
39
+ intervalSec: number;
40
+ exchange: string;
41
+ symbol: string;
42
+ }
43
+ /** The overlay's record as the source reads it: the sheet and the flat settings over its params
44
+ * (the dialog's storage types, the same record both lanes run with: contracts C1 and C4). */
45
+ export interface WrunRowSourceRecord {
46
+ sheet: WrunIndicatorMetadata;
47
+ settings: Record<string, unknown>;
48
+ /** The packed host fills (chart colours, interval, the market facts), keyed by the kit's host_fill words. */
49
+ hostFill: Record<string, unknown>;
50
+ }
51
+ /** A settings patch (contract C5): the changed flat values, `null` for a dropped value, plus the fills. */
52
+ export interface WrunRowSourcePatch {
53
+ settings: Record<string, unknown>;
54
+ hostFill?: Record<string, unknown>;
55
+ }
56
+ /** One row of a batch: the bar's open time and the module's outputs in sheet order (null = no value). */
57
+ export type WrunRow = WrunHostedWire['rows'][number];
58
+ /** The rows, cell grids, frames, handles and refusals a source answers for a window: the hosted
59
+ * wire's shape, which both lanes share (`wrunHost`, wrun-browser-runtime.md "The wire"). */
60
+ export interface WrunRowBatch {
61
+ window: WrunRowWindow;
62
+ /** Open of the newest bar the batch evaluated. */
63
+ asOfMs: number;
64
+ rows: WrunRow[];
65
+ grids: WrunHostedGrid[];
66
+ frames: WrunHostedWire['frames'];
67
+ handles: WrunHostedWire['handles'];
68
+ refusals: WrunHostedRefusal[];
69
+ /** The sheet the source ran (present on a create, absent on a range or a patch). */
70
+ sheet?: WrunIndicatorMetadata;
71
+ /** The run's strategy output (a strategy package's `StrategyOutput`, the run-level `strategy` key), when the
72
+ * source answered one. */
73
+ strategy?: unknown;
74
+ /** The diagnostics the source answered beside the rows (the cloud's), when it answered the field. */
75
+ diagnostics?: RuntimeDiagnostic[];
76
+ /** From a source keeping a session of its own: the overlay's session losses as the answer to the create that opened
77
+ * that session arrived, before its decode and its paging (`wrunSocketSessionLossCount`). The pass's install reads a
78
+ * loss noted since as the end of the session the batch came from (`wrunSessionInstallLost`). */
79
+ sessionLosses?: number;
80
+ /** The cloud run's OPRA mark (UW-PARITY contract opra-server-lanes 10b, the hosted reply's `output.wrunOpra`): true
81
+ * when the run's plan reads OPRA, which stamps the overlay's OPRA provenance before any row lands; false on a
82
+ * cloud result that names none, which sheds the stamp once its rows replaced the overlay's (under the provenance
83
+ * writer's own refusal); absent from a source that does not speak it (the browser lanes stamp their own runs). A
84
+ * live frame carries only true: a frame never clears the stamp. */
85
+ opra?: boolean;
86
+ }
87
+ /** A live frame: the same batch shape for the bars that moved since the last frame. */
88
+ export type WrunRowFrame = WrunRowBatch;
89
+ export type WrunRowFrameListener = (frame: WrunRowFrame) => void;
90
+ /** The live stream of a session: one listener at a time; `unsubscribe` stops it. */
91
+ export interface WrunRowFrameStream {
92
+ subscribe(listener: WrunRowFrameListener): () => void;
93
+ }
94
+ export interface WrunRowSource {
95
+ /** Create the session for `identity` over `window` and answer its first batch. `cancel`: the create's own cancel (its
96
+ * overlay left the chart while it was on its way): once it aborts, a source that sends its create elsewhere sends
97
+ * nothing more of it, and the pass drops whatever the create answers as superseded. */
98
+ create(identity: WrunRowSourceIdentity, record: WrunRowSourceRecord, window: WrunRowWindow, cancel?: AbortSignal): Promise<WrunRowBatch>;
99
+ /** Another window of the same session (a pan page, a gap repair). */
100
+ range(window: WrunRowWindow): Promise<WrunRowBatch>;
101
+ /** A compute edit or a host-fill move over the session's own window: never a recreate, never an interval. */
102
+ changeSettings(patch: WrunRowSourcePatch): Promise<WrunRowBatch>;
103
+ /** The session's live frames. */
104
+ readonly frames: WrunRowFrameStream;
105
+ /** Release the session; every raised load signal is lowered. */
106
+ teardown(): void;
107
+ }
108
+ /** The lane a record runs on: the author's publishing choice, read from the record once. */
109
+ export type WrunRowSourceKind = 'sandbox' | 'socket';
110
+ /** Why an ask answered nothing a source could merge: no reply at all, or a settle the transport laundered into a
111
+ * clean completion (a session kick, no connection or a permanently failed worker, the chart gone before the
112
+ * dispatch); the run capability not minted in time (`capability-unavailable`: the ask never went, and the mint keeps
113
+ * running, so the next ask resolves from it); the worker's request deadline (`request-timeout`: the ask went and no
114
+ * answer came in time); or a page of the rest of a window whose newest page answered, failed without a verdict of its
115
+ * own (`paging-incomplete`: the history the run asked for is incomplete). The kScript socket's own failures
116
+ * (kscript-transport-codes): the socket closed with the ask on it (`connection-lost`), the dial failed before the ask
117
+ * went (`dial-failed`), the keepalive retired a socket that stopped answering (`socket-stale`); an abort the ask's own
118
+ * signal did not cause (`aborted`); the data worker restarted under the ask (`worker-restarted`). */
119
+ export type WrunRowSourceTransientReason = 'no-reply' | 'session-kicked' | 'connection-unavailable' | 'chart-gone' | 'capability-unavailable' | 'request-timeout' | 'paging-incomplete' | 'connection-lost' | 'dial-failed' | 'socket-stale' | 'aborted' | 'worker-restarted';
120
+ /**
121
+ * An ask that answered nothing a source could merge, which the next ask may answer: never a refusal and never an
122
+ * empty success (an empty batch would integrate as a successful run with nothing drawn). The pass takes its retry
123
+ * path; the source left the session it held as it was. `cause`: the failure behind it, when one was raised (its words
124
+ * follow the reason, so the record's details keep them).
125
+ */
126
+ export declare class WrunRowSourceTransientError extends Error {
127
+ readonly reason: WrunRowSourceTransientReason;
128
+ constructor(reason: WrunRowSourceTransientReason, cause?: unknown);
129
+ }
130
+ /** Structural check: a module duplicate under test still matches. */
131
+ export declare function isWrunRowSourceTransientError(error: unknown): error is WrunRowSourceTransientError;
132
+ /**
133
+ * What a `changeSettings` that failed left of the source's session when it is no longer the one the source's last
134
+ * batch stood for (contract C7, the wave-3 review round 3). The source marks its failure
135
+ * (`markWrunRowSourceSettingsLeft`) and the pass reads the mark (`wrunRowSourceSettingsLeftBy`), never the lane:
136
+ * - `moved`: the patch was answered, so the source's record, its session and its frames compute with the patched
137
+ * settings from here, though what followed failed (a page of the rest of the window the session covered was
138
+ * refused or failed: the source owes that window, and its next ask pages it first);
139
+ * - `unanswered`: the patch went out and no answer came in time, so what the session computes with is unknown: the
140
+ * source kept the settings and the rows it held, no live frame extends them, and the session is not to be asked
141
+ * again (the transport retires it and recreates it over the next ask's window alone).
142
+ * Either way the overlay's live context stands for a computation no session feeds any more.
143
+ */
144
+ export type WrunRowSourceSettingsLeft = 'moved' | 'unanswered';
145
+ /** Mark a failed `changeSettings` with what it left of the session (above), and answer the failure to throw: a
146
+ * failure that is no object rides as an Error of its words, so it can carry the mark. */
147
+ export declare function markWrunRowSourceSettingsLeft(error: unknown, left: WrunRowSourceSettingsLeft): unknown;
148
+ /** What a failed `changeSettings` left of the session, when its source marked it (above). */
149
+ export declare function wrunRowSourceSettingsLeftBy(error: unknown): WrunRowSourceSettingsLeft | undefined;
150
+ /** The sheet a source delivered with its batch: every section a batch refusal names taken out (the kit
151
+ * shaper's own rule), so a refused family builds no child. Which top-level keys are sections is the
152
+ * kit's list (`sectionKinds`: `WRUN_SECTION_KINDS`, the one list every host reads, which the caller
153
+ * takes off the loaded host), never one of the chart's own: a key of the run itself (`params`,
154
+ * `inputs`, `outputs`, `alerts`, `layout`) is no drawn section and stays, and a dotted family names
155
+ * no key. The sheet itself when nothing goes. The one pass reads every source's batch by it. */
156
+ export declare function wrunRowBatchDeliveredSheet(sheet: WrunIndicatorMetadata, refusals: ReadonlyArray<{
157
+ family: string;
158
+ }>, sectionKinds: ReadonlyArray<string>): WrunIndicatorMetadata;
@@ -0,0 +1,75 @@
1
+ /**
2
+ * The one row-source seam of a wrun Indicator (WRUN-PARITY-PLAN contract C7, wave 3).
3
+ *
4
+ * A wrun overlay's pass (`runWrunOverlayOnChart`, the live tick, the replay lane) asks ONE source
5
+ * for rows and never knows which: `SandboxWrunRowSource` (the browser lane: the engine worker and
6
+ * `wrun-source-rows.util.ts`) and `SocketWrunRowSource` (the cloud lane: the kScript socket worker
7
+ * and the socket row store) implement the same interface, so every surface a user meets (the
8
+ * legend, the HUD, the hover card, the children, the diagnostics, the load status) is built by the
9
+ * same code from the same batch shape. The lane is the author's publishing choice, read once from
10
+ * the record (`wrunRunTarget`), never a predicate in the pass.
11
+ *
12
+ * Rules every source honours:
13
+ * - It raises and lowers the load-status signals the own run uses (data-loading rule 2: derive,
14
+ * never set): the loading owner of `wrun-loading-owner.util.ts` and the legend loader.
15
+ * - It pages through the coverage planner's in-flight registry and dedupe table, never a registry
16
+ * of its own (`src/utility/chart/__fixtures__/fanout-golden/` stays untouched).
17
+ * - The render cap is one accounting on both lanes: the builder's budget on the lane's profile number
18
+ * (`createWrunRenderBudget`, refusing with the kit's `wrun_render_result_too_large`); a source never
19
+ * runs a second selection to charge it.
20
+ * - Refusals are the kit's codes (`WrunHostedRefusal`), rendered by `wrun-refusal.util.ts` on both
21
+ * lanes; no source carries a sentence. A refused family leaves the sheet the batch delivered
22
+ * (`wrunRowBatchDeliveredSheet`, the one rule the pass reads every batch by).
23
+ */
24
+ /**
25
+ * An ask that answered nothing a source could merge, which the next ask may answer: never a refusal and never an
26
+ * empty success (an empty batch would integrate as a successful run with nothing drawn). The pass takes its retry
27
+ * path; the source left the session it held as it was. `cause`: the failure behind it, when one was raised (its words
28
+ * follow the reason, so the record's details keep them).
29
+ */
30
+ export class WrunRowSourceTransientError extends Error {
31
+ reason;
32
+ constructor(reason, cause) {
33
+ const behind = cause === undefined ? '' : `: ${cause instanceof Error ? cause.message : String(cause)}`;
34
+ super(`wrun row source answered nothing it could merge (${reason})${behind}`, cause === undefined ? {} : { cause });
35
+ this.name = 'WrunRowSourceTransientError';
36
+ this.reason = reason;
37
+ }
38
+ }
39
+ /** Structural check: a module duplicate under test still matches. */
40
+ export function isWrunRowSourceTransientError(error) {
41
+ return error instanceof Error && error.name === 'WrunRowSourceTransientError';
42
+ }
43
+ /** The mark's key: a plain string, so a module duplicate under test still reads it. */
44
+ const SETTINGS_LEFT_KEY = 'wrunRowSourceSettingsLeft';
45
+ /** Mark a failed `changeSettings` with what it left of the session (above), and answer the failure to throw: a
46
+ * failure that is no object rides as an Error of its words, so it can carry the mark. */
47
+ export function markWrunRowSourceSettingsLeft(error, left) {
48
+ const failure = typeof error === 'object' && error !== null ? error : new Error(String(error));
49
+ Object.defineProperty(failure, SETTINGS_LEFT_KEY, { value: left, configurable: true, writable: true });
50
+ return failure;
51
+ }
52
+ /** What a failed `changeSettings` left of the session, when its source marked it (above). */
53
+ export function wrunRowSourceSettingsLeftBy(error) {
54
+ if (typeof error !== 'object' || error === null)
55
+ return undefined;
56
+ const left = error[SETTINGS_LEFT_KEY];
57
+ return left === 'moved' || left === 'unanswered' ? left : undefined;
58
+ }
59
+ /** The sheet a source delivered with its batch: every section a batch refusal names taken out (the kit
60
+ * shaper's own rule), so a refused family builds no child. Which top-level keys are sections is the
61
+ * kit's list (`sectionKinds`: `WRUN_SECTION_KINDS`, the one list every host reads, which the caller
62
+ * takes off the loaded host), never one of the chart's own: a key of the run itself (`params`,
63
+ * `inputs`, `outputs`, `alerts`, `layout`) is no drawn section and stays, and a dotted family names
64
+ * no key. The sheet itself when nothing goes. The one pass reads every source's batch by it. */
65
+ export function wrunRowBatchDeliveredSheet(sheet, refusals, sectionKinds) {
66
+ const removed = refusals
67
+ .map((refusal) => refusal.family)
68
+ .filter((family) => sectionKinds.includes(family) && Object.hasOwn(sheet, family));
69
+ if (removed.length === 0)
70
+ return sheet;
71
+ const delivered = { ...sheet };
72
+ for (const family of removed)
73
+ delete delivered[family];
74
+ return delivered;
75
+ }
@@ -0,0 +1,155 @@
1
+ /**
2
+ * The health of a finished Indicator run, for the two outcomes that draw nothing and say
3
+ * nothing: every bar was warm-up (`state()` never returned 1), and a drawn series that is NaN
4
+ * on every ready bar. Both compile clean, run clean and used to print the green check over an
5
+ * empty pane; the author's only way to see it was to type `rows` at the console.
6
+ *
7
+ * A short-form file (a top-level `function onBar(): void`, scaffold 29) has no warm-up row: its
8
+ * build returns 1 from state() on every bar and writes NaN to every output before `onBar()`,
9
+ * so the first verdict (`WRUN_NO_READY_ROWS`, anchored on state()) can never fire for it and
10
+ * its silent plot is the second one, counted over EVERY bar (`Output 'sma' is NaN on all 50
11
+ * ready bars`, the four-function form's 31 ready of 50 are 50 of 50 here). That row keeps its
12
+ * `finalize` anchor: the console resolves it onto `onBar()` in a short-form buffer
13
+ * (`runtimeDiagnosticToScriptEditorIssue`), the hook that runs the finalize phase.
14
+ *
15
+ * `wrunRunHealth` is the pure read over the run's output rows; `wrunRunHealthDiagnostics`
16
+ * turns it into runtime diagnostic rows (warnings, never errors: the run did finish) that name
17
+ * the export to look at (`details.anchorExport`, resolved against the buffer by
18
+ * `runtimeDiagnosticToScriptEditorIssue`). The run seam publishes them for DRAFT overlays only
19
+ * (`wrun-overlay-run.util`): on a viewer's chart a long window over a short history is an
20
+ * ordinary state, not a mistake to flag. A draft's live session keeps the verdict honest: a
21
+ * tick or reseed that makes the draft draw clears the rows (`sameWrunRunHealthVerdict` keeps
22
+ * a still-true verdict from being rewritten for every new bar).
23
+ *
24
+ * Only CONTINUOUS plots count as silent when all NaN (line, area, histogram, bar). An event
25
+ * plot (shape, scatter) with no event in the window, a candle group, and a data-only output
26
+ * (`none`, the `color_by` / `width_by` ladders) are legitimately empty. So is an output nobody
27
+ * sees: `legend: false` (drawn without a legend line: a hidden helper, a picked level that may be
28
+ * off) and `visible: false` (a caller folds the Style page's Visible row into it first). A silent
29
+ * output is named by its display label (`labels`, the legend's own words, never the raw id) on
30
+ * the chart's surfaces; the row's technical message keeps the id for the author's console.
31
+ *
32
+ * The refusal record (WRUN-REFUSALS): a row a viewer may read carries its completed record in
33
+ * `details.refusal` (a `WrunRefusal`, serialized by the publisher), so the legend and the console
34
+ * word it through the one text path; `message` keeps the technical words (the record's
35
+ * `details`, Copy details). `wrunNothingReadyRefusal` is the nothing-ready record (every bar was
36
+ * warm-up, never an all-NaN output); the leg rows (`WRUN_LEG_ROW_CODES`) add the markets a pinned
37
+ * leg found empty (`wrunEmptyLegDiagnostics`, one row for all) and the feeds the chart's fetch
38
+ * never serves to inputs that declared a missing fill (`wrunFeedMissingDiagnostics`).
39
+ *
40
+ * Leaf module, like wrun-debug-output.util: types and the pure refusal record only, so both
41
+ * drivers and the specs read it without dragging the host or the store.
42
+ */
43
+ import type { RuntimeDiagnostic } from '../../interfaces/kscript-diagnostics.interface.js';
44
+ import type { WrunIndicatorMetadata, WrunOutputRow } from '../../interfaces/wrun-runtime.interface.js';
45
+ import { type WrunOptionsStopReason, type WrunRefusal, type WrunRefusalContext, type WrunRefusalMarket } from './wrun-refusal.util.js';
46
+ export declare const WRUN_NO_READY_ROWS_CODE = "WRUN_NO_READY_ROWS";
47
+ export declare const WRUN_OUTPUT_ALL_NAN_CODE = "WRUN_OUTPUT_ALL_NAN";
48
+ /** A pinned leg the chart could not serve (a venue the gateway serves no series for to scripts
49
+ * yet): the run proceeded, the leg's inputs read their missing fill on every bar. */
50
+ export declare const WRUN_LEG_UNSERVED_CODE = "WRUN_LEG_UNSERVED";
51
+ /** A leg ask the chart's history wall cut (the leg core's `wrunServedLegStart` note): the run
52
+ * drew from the history served, never refused for depth. */
53
+ export declare const WRUN_LEG_HISTORY_CLAMPED_CODE = "WRUN_LEG_HISTORY_CLAMPED";
54
+ /** Pinned markets that sent no rows for the window (or whose fetch failed short of a deadline)
55
+ * while every input reading them declared a missing fill: the run drew, those rows are empty. */
56
+ export declare const WRUN_LEG_EMPTY_CODE = "WRUN_LEG_EMPTY";
57
+ /** A feed the chart's fetch never serves on this market (the capability evidence) read by inputs
58
+ * that declared a missing fill: the run drew, those inputs read their fill. */
59
+ export declare const WRUN_FEED_MISSING_CODE = "WRUN_FEED_MISSING";
60
+ /** The rows the run seam owns for a run's health: replaced by every full run of a draft,
61
+ * cleared by a healthy one. */
62
+ export declare const WRUN_RUN_HEALTH_ROW_CODES: ReadonlySet<string>;
63
+ /** The rows the run seam owns for its legs (draft and registry runs alike): the unserved legs,
64
+ * the asks the history wall cut, the pinned markets found empty and the feeds the chart's fetch
65
+ * never serves, replaced by every full run, cleared by a run that served every leg in full. Its
66
+ * own set, so the draft health seam above never drops them on a tick. */
67
+ export declare const WRUN_LEG_ROW_CODES: ReadonlySet<string>;
68
+ /** One pinned leg that sent nothing for the window, or whose fetch failed short of a deadline,
69
+ * while every input reading its fetched rows declared a missing fill: those inputs read the fill
70
+ * and the run drew. */
71
+ export interface WrunEmptyLeg {
72
+ /** The declared input names reading the leg's fetched rows, ascending by index. */
73
+ inputNames: string[];
74
+ /** The leg's market (its symbol is the label the sentence names). */
75
+ market: WrunRefusalMarket;
76
+ cause: 'empty' | 'failed';
77
+ /** The technical words (Copy details only). */
78
+ details: string;
79
+ }
80
+ /** One feed the chart's fetch never serves on this market (index-mode admission, never an empty
81
+ * window) read by inputs that declared a missing fill: they read the fill and the run drew. */
82
+ export interface WrunMissingFeed {
83
+ /** The declared input names reading the feed, in declaration order. */
84
+ inputNames: string[];
85
+ /** A builtin source class or a poll lane key (a key of `WRUN_REFUSAL_FEED_KEYS`). */
86
+ feed: string;
87
+ /** `crypto-only` only when the chart is provably no crypto venue; `market` otherwise. */
88
+ variant: 'crypto-only' | 'market';
89
+ /** The technical words (Copy details only). */
90
+ details: string;
91
+ /**
92
+ * Why an options lane is not served although the chart's options exist (the flag check's `flag-off`, the plane
93
+ * router's `chart-kind`; opra-options-gate.util `opraOptionPlaneStop`): the note then says that reason
94
+ * (`options-stopped`), never "this market has no such feed".
95
+ */
96
+ stop?: WrunOptionsStopReason;
97
+ }
98
+ /** ONE note row for every pinned leg the run found empty: the record names their markets
99
+ * (`legs-empty` `drew`, `count` the distinct markets, the first market as the record's), its
100
+ * details the legs' technical words; empty for no leg. */
101
+ export declare function wrunEmptyLegDiagnostics(legs: readonly WrunEmptyLeg[], ctx: WrunRefusalContext): RuntimeDiagnostic[];
102
+ /** One note row per feed the chart's fetch never serves on this market (entries naming the same
103
+ * feed and variant merge): the record is `feed-missing`, `crypto-only` where the chart is provably
104
+ * no crypto venue, else `market-note`; its OUT the context's switch target, else the works-on
105
+ * list. Empty for no feed. */
106
+ export declare function wrunFeedMissingDiagnostics(feeds: readonly WrunMissingFeed[], ctx: WrunRefusalContext): RuntimeDiagnostic[];
107
+ /** One pinned leg the run pass left unfetched because its venue serves no series to scripts
108
+ * yet (`WRUN_PIN_UNSERVED_EXCHANGES` in wrun-pin-venues.util: the index venues, held out of the
109
+ * gateway's directory until the data service opens them), so the leg is not servable. */
110
+ export interface WrunUnservedLeg {
111
+ /** The declared input names served off the leg, ascending by index. */
112
+ inputNames: string[];
113
+ /** The chart's spelling of the leg interval (`1h`, `4h`, ...). */
114
+ intervalKey: string;
115
+ /** The pinned market the leg would have read, and its `exchange/symbol` label. */
116
+ exchange: string;
117
+ symbol: string;
118
+ market: string;
119
+ reason: 'venue-unserved';
120
+ }
121
+ /** The warning rows of the unserved legs: an input is NaN on every bar (0 for an `is_new_period`
122
+ * view, 0 under `missing: "zero"`, an absent block for intrabar cells) and the row says why, so
123
+ * the author can read the input as absent and draw a words line.
124
+ * - Without `ctx`: one row per input, as the author's console has always read them.
125
+ * - With `ctx`: one row per pinned market (its legs merged, every input named in
126
+ * `details.inputs`), carrying the completed `index-unserved` record in `details.refusal`, so a
127
+ * viewer's legend words one note per market. */
128
+ export declare function wrunUnservedLegDiagnostics(legs: ReadonlyArray<WrunUnservedLeg>, ctx?: WrunRefusalContext): RuntimeDiagnostic[];
129
+ export interface WrunRunHealth {
130
+ /** Rows the run returned (one per bar fed). */
131
+ bars: number;
132
+ /** Rows on which `state()` returned 1 (outputs present). */
133
+ ready: number;
134
+ /** Rows on which `state()` returned 0. */
135
+ warmup: number;
136
+ /** Continuous plots that are NaN (or never finite) on every ready row, in slot order. */
137
+ silentOutputs: string[];
138
+ /** The display label of each silent output by name (the declared `label`, else the name read
139
+ * as words): present only while an output is silent. */
140
+ labels?: Readonly<Record<string, string>>;
141
+ }
142
+ export declare function wrunRunHealth(metadata: Pick<WrunIndicatorMetadata, 'outputs'>, rows: ReadonlyArray<WrunOutputRow>): WrunRunHealth;
143
+ /** True when two health row sets state the same verdicts (a live session recomputing its
144
+ * health on every tick republishes only when the verdict changes, never for a bar count). */
145
+ export declare function sameWrunRunHealthVerdict(current: ReadonlyArray<RuntimeDiagnostic>, next: ReadonlyArray<RuntimeDiagnostic>): boolean;
146
+ /** The warnings a run's health raises; empty for a run that drew something on every watched
147
+ * plot, and for a run over no bars at all (no data is another seam's message). `refusal` (the
148
+ * `wrunNothingReadyRefusal` record) rides the all-warm-up row as `details.refusal`; a silent
149
+ * output row never carries one. */
150
+ export declare function wrunRunHealthDiagnostics(health: WrunRunHealth, refusal?: WrunRefusal): RuntimeDiagnostic[];
151
+ /** The nothing-ready record of a run's health: only when bars arrived and EVERY one was warm-up
152
+ * (`ready === 0 && bars > 0`), never from an all-NaN output (a drawn series that is empty is the
153
+ * author's to read, not a viewer's refusal); null otherwise. Its details are the all-warm-up
154
+ * row's technical words. */
155
+ export declare function wrunNothingReadyRefusal(health: WrunRunHealth, ctx: WrunRefusalContext): WrunRefusal | null;