@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,439 @@
1
+ import type { WrunOutputRow } from '../../interfaces/wrun-runtime.interface.js';
2
+ import { type FetchDedupePolicy } from '../chart/fetch-dedupe-policy.util.js';
3
+ import { type IndicatorCoverageFilterReason } from '../chart/indicator-coverage-planner.util.js';
4
+ import { type IndicatorInflightScheduleOptions } from '../chart/indicator-inflight-registry.util.js';
5
+ import type { WrunCellRows } from './wrun-canvases.util.js';
6
+ import { type WrunFrameRefusal } from './wrun-hosted-wire-caps.js';
7
+ import { type WrunHostedRefusal } from './wrun-hosted-wire.util.js';
8
+ import { WrunOverlayPausedError } from './wrun-registry-errors.util.js';
9
+ import { type WrunRowBatch, type WrunRowFrameStream, type WrunRowSource, type WrunRowSourceIdentity, type WrunRowSourcePatch, type WrunRowSourceRecord, type WrunRowWindow } from './wrun-row-source.js';
10
+ import { type WrunHostedSession } from './wrun-socket-row-store.js';
11
+ /** The most bars one socket ask carries: the cloud's per-request cap (kscript-backend `MAX_BARS`, 900
12
+ * bars per createScript or rangeChanged). Plan Q3 keeps the pages and drops every other cap; phase B
13
+ * (U9a, U9b) moves this number to the `chart-cloud` profile's `caps.barsPerRequest`. */
14
+ export declare const WRUN_SOCKET_PAGE_BARS = 900;
15
+ /** The family a refused ask names when its refusal names none: the whole run. */
16
+ export declare const WRUN_SOCKET_RUN_REFUSAL_FAMILY = "*";
17
+ /** A refused ask: the cloud answered a refusal code for it, with the facts its frame carried (`wrunSocketAskFailure`
18
+ * keeps the frame as its message). The source answers it as a refusal batch; the refusal record reads its code and
19
+ * facts (wrun-refusal.util `wrunCloudRefusalSeed`). */
20
+ export declare class WrunSocketRefusalError extends Error {
21
+ readonly code: string;
22
+ readonly family?: string;
23
+ readonly facts?: Omit<WrunFrameRefusal, 'code'>;
24
+ constructor(code: string, family?: string, facts?: Omit<WrunFrameRefusal, 'code'>);
25
+ }
26
+ /** The refusal a batch's whole-run entry stands for: its ask's own (the facts and the frame kept), else one of the
27
+ * entry's code. */
28
+ export declare function wrunSocketRunRefusalOf(entry: WrunHostedRefusal): WrunSocketRefusalError;
29
+ /** The facts a batch's refusal entry carried, when it was a whole-run refusal that named any. */
30
+ export declare function wrunSocketRefusalFactsOf(refusal: WrunHostedRefusal): Omit<WrunFrameRefusal, 'code'> | undefined;
31
+ /** A denied run capability (the overlay's access ended): the bridge denied the mint, or the cloud denied the ask past
32
+ * the transport's one forced re-mint. The overlay carries the "Access required" chip through the one access door
33
+ * (useIndicatorAccessPrompt, the chip a revoked cloud run and a browser run whose access ended carry), and the run is
34
+ * held quietly, of the paused class (no refusal record words it, nothing toasts, the heal declines it). Access back
35
+ * (a purchase, a grant) mints again on the next run. */
36
+ export declare class WrunSocketAccessDeniedError extends WrunOverlayPausedError {
37
+ /** Whether the denied ask was dispatched: the cloud denied it, or the worker refused a frame that carried no
38
+ * capability after it ended the session a create replaces, so a create replaced the overlay's session. False when
39
+ * the bridge denied the mint: nothing was sent. */
40
+ readonly dispatched: boolean;
41
+ constructor(message: string, dispatched?: boolean);
42
+ }
43
+ /** An ask that stopped without an answer: a newer create or settings change superseded it, or the
44
+ * source was torn down. Its load signals are already lowered. The default transport rejects with it a
45
+ * create stopped after it went (`WrunSocketAsk.signal`): the worker opened that session all the same. */
46
+ export declare class WrunSocketRowSourceStopped extends Error {
47
+ readonly reason: 'superseded' | 'teardown';
48
+ constructor(reason: 'superseded' | 'teardown');
49
+ }
50
+ /** A reply the source cannot merge: an unreadable wire, or one the store refused. A failure, never a
51
+ * refusal: the next ask may answer. (A reply with no hosted wire at all is the legacy refusal.) */
52
+ export declare class WrunSocketReplyUnreadable extends Error {
53
+ constructor(reason: string);
54
+ }
55
+ export type WrunSocketAskKind = 'create' | 'range' | 'changeSettings';
56
+ /** One ask the source sends over the kScript socket. */
57
+ export interface WrunSocketAsk {
58
+ kind: WrunSocketAskKind;
59
+ identity: WrunRowSourceIdentity;
60
+ /** The settings record as the source holds it (C4): the overlay's flat settings and host fills. */
61
+ record: WrunRowSourceRecord;
62
+ /** The settings patch (C5) of a `changeSettings`; absent otherwise. */
63
+ patch?: WrunRowSourcePatch;
64
+ /** The bars asked, both ends included. */
65
+ window: WrunRowWindow;
66
+ /** A replay lane's session: no live feed. */
67
+ historical: boolean;
68
+ /** Aborted when a newer create or settings change supersedes the ask, the source is torn down, or a create's own
69
+ * cancel aborts (`create`'s `cancel`: its overlay left the chart). The transport asks nothing more for an aborted
70
+ * ask (no run capability, no dispatch, no heal's re-dispatch) and fails it as never sent, except a create stopped
71
+ * after it went: the worker opened its session all the same (the fetch's cancel only detaches it), so it rejects
72
+ * as its stop (`WrunSocketRowSourceStopped`) while no later create of the overlay replaced that session. */
73
+ signal: AbortSignal;
74
+ }
75
+ /** The kScript socket as the source reaches it. */
76
+ export interface WrunSocketTransport {
77
+ /** One ask: the reply output carrying `wrunHost` (or the worker's superseded marker), or undefined
78
+ * when the socket answered nothing (the source rejects such an ask as transient). Rejects with
79
+ * `WrunSocketRefusalError` for a refusal code, `WrunRowSourceTransientError` for a settle that
80
+ * answered nothing (a kick, no connection, the chart gone) or the worker's request deadline,
81
+ * `WrunSocketAccessDeniedError` for a denied run capability, any other error for a failure. */
82
+ ask(ask: WrunSocketAsk): Promise<unknown>;
83
+ /** The session's live frames (the raw `liveUpdate` outputs); returns the unsubscribe. */
84
+ live(listener: (output: unknown) => void): () => void;
85
+ /** End the cloud session (`deleteScript`). */
86
+ end(): void;
87
+ }
88
+ /** The load-status signals one ask round raises; the returned lower is idempotent. */
89
+ export interface WrunSocketLoadSignals {
90
+ raise(): Promise<() => void> | (() => void);
91
+ }
92
+ /** The chart's bars the page planner judges against: rows led by their open time, ascending, and the
93
+ * main series' synthetic flags when the chart keeps them. */
94
+ export interface WrunSocketChartRows {
95
+ rows: ReadonlyArray<ArrayLike<number>>;
96
+ syntheticFlags?: ArrayLike<number>;
97
+ }
98
+ export interface WrunSocketRowSourceDeps {
99
+ /** The transport for an overlay (default: the host's `transport.hostedSocket`, web's `createWrunSocketTransport`). */
100
+ transportFor?: (identity: WrunRowSourceIdentity) => WrunSocketTransport;
101
+ /** The load signals for an overlay (default: the host's `chart.hostedLoadSignals`). */
102
+ loadingFor?: (identity: WrunRowSourceIdentity) => WrunSocketLoadSignals;
103
+ /** The chart's bars (default: the host's `chart.mainRows`, the mounted chart's main rows). */
104
+ chartRows?: (chartIndex: number) => Promise<WrunSocketChartRows | undefined> | WrunSocketChartRows | undefined;
105
+ /** Whether a create runs a historical session (default: the host's `chart.isReplaying`, the chart replays). */
106
+ historical?: (chartIndex: number) => boolean;
107
+ /** The in-flight registry's timing for the source's pages (default: the `protected` profile's). */
108
+ inflight?: Pick<IndicatorInflightScheduleOptions, 'settleMs' | 'maxDeferMs'>;
109
+ /** The most bars one ask carries (default `WRUN_SOCKET_PAGE_BARS`). */
110
+ pageBars?: number;
111
+ /** The most leading cold rows a page re-asks of a newer window (default `wrunSocketWarmupBars`, the head). */
112
+ warmupBarsOf?: (record: WrunRowSourceRecord) => number;
113
+ }
114
+ /**
115
+ * The cloud's warm-up head for a record (wrun-lane-warmup.util: the kit planner's rule over the run's param values),
116
+ * clamped to the `chart-cloud` profile's cap once the shared host is loaded, else to the lookback cap: on a
117
+ * cloud-only chart the host may never load, and an uncapped head only re-asks more bars than the cloud ran.
118
+ */
119
+ export declare function wrunSocketWarmupBars(record: WrunRowSourceRecord): number;
120
+ /**
121
+ * The leading cold rows of every answered window, as windows (window policy rule 4): from the window's first held
122
+ * row while the rows stay cold, at most `headBars` rows. A window whose first row is warm yields nothing.
123
+ */
124
+ export declare function wrunSocketColdHeads(rows: ReadonlyArray<WrunOutputRow>, answered: ReadonlyArray<WrunRowWindow>, headBars: number): WrunRowWindow[];
125
+ /** The newest page of a window: what a create asks. */
126
+ export declare function newestWrunSocketPage(window: WrunRowWindow, intervalMs: number, pageBars: number): WrunRowWindow;
127
+ export interface WrunSocketPagePlanInput {
128
+ /** The window asked, both ends included. */
129
+ window: WrunRowWindow;
130
+ intervalMs: number;
131
+ pageBars: number;
132
+ /** The open times the store holds, ascending. */
133
+ heldTs: ReadonlyArray<number>;
134
+ /** The windows the cloud answered (with rows or none): authoritative coverage. */
135
+ answered: ReadonlyArray<WrunRowWindow>;
136
+ /** The chart's bars (rows led by their open time, ascending); the window's slice is judged. */
137
+ chartRows?: ReadonlyArray<ArrayLike<number>>;
138
+ chartSyntheticFlags?: ArrayLike<number>;
139
+ /** The leading cold rows of answered windows, as windows (rule 4; default none: nothing re-asked). */
140
+ reask?: ReadonlyArray<WrunRowWindow>;
141
+ }
142
+ export interface WrunSocketPagePlan {
143
+ /** The pages to ask, newest first, each at most `pageBars` bars, none starting on a held bar; a page ends on
144
+ * held bars only over the cold head it re-asks (rule 4). */
145
+ pages: WrunRowWindow[];
146
+ /** What the planner left out, and why (no silent drop). */
147
+ filtered: Array<WrunRowWindow & {
148
+ reason: IndicatorCoverageFilterReason;
149
+ }>;
150
+ }
151
+ /**
152
+ * The pages a window still needs (plan Q3, pinned by the socket-window golden):
153
+ *
154
+ * 1. Missing spans: with two or more chart bars inside the window, the coverage planner's
155
+ * `wave-dispatch` plan for a plain overlay holding the store's bars (the repair detector against
156
+ * the chart's bars; at most two ranges a round, the rest filtered `overlay-cap` for the next
157
+ * round), with the cloud's answered windows as authoritative-empty spans (a span answered with no
158
+ * rows is never asked again). With fewer, the wave's degenerate-clip rule: the whole window.
159
+ * 2. Each span less the answered windows, less a held bar at either end (no bar is asked twice, but for rule 4).
160
+ * 3. Pages of at most `pageBars` bars, newest first across every span (pan-back continuity).
161
+ * 4. A span that adjoins a newer answered window (no chart bar between them) re-asks that window's leading cold
162
+ * rows (`reask`: the rows it answered with no output or every output NaN, at most the cloud's warm-up head,
163
+ * `wrunSocketColdHeads`). The cloud runs every window with the planner's head, so a package whose real warm-up
164
+ * outruns it (a displaced span, an internal lag) answered the window's first bars cold; only a run that starts
165
+ * earlier computes them warm, and the page's reply splices over them (store rule 2). The newest page carries
166
+ * the overlap, still at most `pageBars` bars; a window answered warm is never asked twice.
167
+ *
168
+ * No cap on the depth and no rule on a start's distance from now: the cloud's caps live in its profile.
169
+ */
170
+ export declare function planWrunSocketPages(input: WrunSocketPagePlanInput): WrunSocketPagePlan;
171
+ /** Answered windows as disjoint ascending spans: windows that overlap or touch (the next one opens
172
+ * within one interval of the last bar) join. */
173
+ export declare function mergeWrunSocketSpans(spans: ReadonlyArray<WrunRowWindow>, intervalMs: number): WrunRowWindow[];
174
+ /** The dedupe table's policy for the source's page asks: a live session's pages coalesce through the
175
+ * in-flight registry (`IND_SKIP_DUPLICATE`: a covering ask in flight is awaited, never sent twice); a
176
+ * replay lane's bypass it (`IND_REPLAY_LANE_BYPASS`: a replay ask must neither join nor poison the
177
+ * live overlay's entry). */
178
+ export declare function wrunSocketPagePolicy(historical: boolean): FetchDedupePolicy;
179
+ /** A facts retry's claim: true at most once per overlay and fact set (`routeWrunSocketFactsNeeded`). */
180
+ export type WrunSocketFactsClaim = () => boolean;
181
+ /**
182
+ * The refusal a superseded marker stands for when it carries a foreign supersede (wrun-hosted-wire-caps
183
+ * `wrunForeignSupersedeOf`: the server superseded the overlay's LIVE create, so another chart or tab created its
184
+ * instance id): the whole-run `WRUN_SESSION_LOST_CODE` refusal, whose record is the retryable `session-lost` note,
185
+ * never a superseded stop (the run would end silently on a session the cloud no longer holds) and never the generic
186
+ * words. The frame is its message (the record's details); it is stamped a foreign supersede for the monitoring join.
187
+ * Undefined for any other reply. WRUN-REPORTS-CLASSES C1.
188
+ */
189
+ export declare function wrunSessionLostRefusalOf(output: unknown): WrunSocketRefusalError | undefined;
190
+ /** An element the cloud skipped and recorded instead of refusing the run (the skip-only draw codes, kit 0.77 ABI):
191
+ * carried through as the cloud answered it, for the warning row another lane reads. */
192
+ export type WrunSocketSkippedRecord = Readonly<Record<string, unknown>>;
193
+ /** The skipped elements a cloud answer carries beside its rows (`skipped`, at most the cloud's cap, and
194
+ * `skippedCount` of the rest), passed through untouched on the batch and the live frame. */
195
+ export interface WrunSocketSkipped {
196
+ skipped?: ReadonlyArray<WrunSocketSkippedRecord>;
197
+ skippedCount?: number;
198
+ }
199
+ /**
200
+ * The cloud lane's `WrunRowSource`: one per overlay, one cloud session at a time. Asks run one at a time
201
+ * in call order; a create or a settings change supersedes the asks of the session before it (they stop
202
+ * with `WrunSocketRowSourceStopped`, their replies are never merged). Live frames and results merge into
203
+ * the store in arrival order.
204
+ */
205
+ export declare class SocketWrunRowSource implements WrunRowSource {
206
+ readonly frames: WrunRowFrameStream;
207
+ private readonly deps;
208
+ private identity;
209
+ private record;
210
+ private historical;
211
+ private transport;
212
+ private loading;
213
+ private unsubscribeLive;
214
+ private current;
215
+ private answered;
216
+ /** The session's newest run-level keys (the strategy, the diagnostics), which every batch carries, and the legs the
217
+ * history wall cut, whose warning rows every list carries after the diagnostics. */
218
+ private runLevel;
219
+ /** The window the session owes: a patch the cloud answered moved it to new settings before the paging of what it
220
+ * covered completed (a page refused or failed). Its next page or patch pages it first. */
221
+ private owed;
222
+ /** The overlay's session losses as the cloud's answer to the create that opened the session arrived, before its
223
+ * decode (`wrunSocketSessionLossCount`): the stamp every batch of the session carries (`sessionLosses`). */
224
+ private lossesAtOpen;
225
+ /** The ask waiting on the socket (one at a time). */
226
+ private flight;
227
+ private generation;
228
+ private generationAbort;
229
+ private closed;
230
+ private scheduled;
231
+ private listener;
232
+ private readonly lowers;
233
+ /** The asks, one at a time in call order. */
234
+ private queue;
235
+ /** Every merge into the store (results and live frames), in arrival order. */
236
+ private merges;
237
+ /** The cells memo: the last cell rows answered and each celled entry's lane rows (`cellRows`). */
238
+ private cells;
239
+ constructor(deps?: WrunSocketRowSourceDeps);
240
+ /** The store's merged session (undefined before the first answer and after a teardown). */
241
+ get session(): WrunHostedSession | undefined;
242
+ /** The session's run-level keys as a batch carries them (copies): the newest strategy output and diagnostics a
243
+ * result or a live frame carried, whichever merged last, the served legs' warning rows after the diagnostics. */
244
+ get sessionRunLevel(): Pick<WrunRowBatch, 'strategy' | 'diagnostics'>;
245
+ /** The session's cell rows in the shapes the price canvases read (the store's conversion), with the
246
+ * chart's own candles. The cells memo keeps each entry's lane rows between reads: a read after a merge
247
+ * converts only the rows the merge replaced (`extendWrunCellLane`), and a read with nothing merged since,
248
+ * over the same candles, answers the very object the last one did. */
249
+ cellRows(chartCandles?: ReadonlyArray<unknown>): WrunCellRows;
250
+ create(identity: WrunRowSourceIdentity, record: WrunRowSourceRecord, window: WrunRowWindow, cancel?: AbortSignal): Promise<WrunRowBatch>;
251
+ range(window: WrunRowWindow): Promise<WrunRowBatch>;
252
+ changeSettings(patch: WrunRowSourcePatch): Promise<WrunRowBatch>;
253
+ teardown(): void;
254
+ /**
255
+ * A facts-needed note for the overlay this source follows (`routeWrunSocketFactsNeeded`): the ask waiting on the
256
+ * socket takes the retry, so its refusal asks again once the directory answered the lists. False when no ask waits.
257
+ */
258
+ takeFactsRetry(retry: Promise<WrunSocketFactsClaim | undefined>): boolean;
259
+ private enqueue;
260
+ private nextGeneration;
261
+ private assertCurrent;
262
+ /** Whether the asks of `generation` still own the session (no newer create or patch, no teardown). */
263
+ private owns;
264
+ /** The transport and the load signals follow the overlay: a create for another one ends the old session. */
265
+ private bind;
266
+ private unfollowFacts;
267
+ private intervalMs;
268
+ private pageBars;
269
+ /** The leading cold rows of the windows the cloud answered, at most the record's warm-up head (rule 4). */
270
+ private coldHeads;
271
+ private storeIdentity;
272
+ private withLoading;
273
+ private raiseLoading;
274
+ private ask;
275
+ /** One merge into the store, after every merge before it. */
276
+ private serial;
277
+ /** Merge a result reply, or the legacy refusal a reply without the hosted wire answers (see mergeResult):
278
+ * undefined when it merged. Every other reply it does not merge rejects as mergeResult does. */
279
+ private mergeOrRefuse;
280
+ /**
281
+ * Merge a result reply into the store. A fresh session's reply (a create's, a patch's: `freshSheet` seeds it)
282
+ * replaces the session held, its coverage and its run-level keys only once it merged; a page's extends the session.
283
+ * A reply it does not merge rejects, and leaves the store as it was: no reply (the socket answered nothing: a
284
+ * laundered kick, a socket that is not open, a failed worker, a skipped send) as `WrunRowSourceTransientError`,
285
+ * the worker's superseded marker as a superseded stop, no hosted wire (a server answering a cloud record on the
286
+ * legacy pre-styled path: never read) as the whole-run refusal `WRUN_LEGACY_RESULT_CODE`, an unreadable wire or
287
+ * one the store refused as `WrunSocketReplyUnreadable`.
288
+ */
289
+ private mergeResult;
290
+ /**
291
+ * Page a window until the planner's coverage says done: each round runs the pages still missing,
292
+ * newest first and planned again after each one, through the in-flight registry (or around it, for a
293
+ * replay lane's session). A round another ask of the overlay held the flight for (its covering run in flight) waits
294
+ * for it and plans again; a round whose pages went and added nothing ends the paging (the cloud holds
295
+ * no more). A refused page ends it with the refusal.
296
+ */
297
+ private pageWindow;
298
+ /** Page the window the session owes (`owed`), when it owes one: paid once that paging completed. */
299
+ private pageOwed;
300
+ private planPages;
301
+ private chartRowsOf;
302
+ /** What the session holds and the cloud answered, to tell a round that added nothing. */
303
+ private coverageMark;
304
+ /** The span a session covers: its answered windows, its rows and the window it owes. */
305
+ private coveredWindow;
306
+ /** The session's rows, cell rows and snapshots inside a window, stamped with the socket's losses as the answer to
307
+ * the session's create arrived (`sessionLosses`), with the elements the cloud skipped as it answered them. */
308
+ private batchOf;
309
+ /** A refused ask: the session's batch over the window (nothing, for a refused create), with the
310
+ * refusal's code for the whole run (the refusal itself kept by its entry, wrunSocketRunRefusalOf: its facts with it,
311
+ * wrunSocketRefusalFactsOf). */
312
+ private refusalBatch;
313
+ /** A live session follows the transport's frames; a historical one has none. */
314
+ private followLive;
315
+ private onLiveOutput;
316
+ /** The bars a live frame moved, as a batch: the session's rows from the frame's first bar, its cell
317
+ * rows, its handles re-based onto those rows, the frames the frame replaced, the refusals, and the
318
+ * run-level keys the frame itself carried, its list composed with the session's served legs (a frame
319
+ * never names them, and its list replaces the legend's rows: an empty one keeps the legs' warnings). */
320
+ private emitFrame;
321
+ }
322
+ /**
323
+ * The cloud refused a hosted ask of this overlay because fact lists an input reads were absent from its payload:
324
+ * the socket worker names them from the error frame (`details.wrunRefusal.needsFacts`) as
325
+ * `KScriptMessages.WRUN_FACTS_NEEDED`, before the ask fails, and the WorkerManager routes them here
326
+ * (wrun-browser-runtime.md "The one extra ask"). The names this client knows are remembered for the overlay
327
+ * (`noteWrunHostedFactsAsked`:
328
+ * its payloads send them from now on, beside the sheet's own), and once the market directory has a definite
329
+ * non-empty answer for every list asked (`wrunAskedFactsReady` for the chart's coin, the glue's wait) the refused ask
330
+ * goes again: an ask of a source following the overlay that still waits on the socket takes the retry and asks again
331
+ * itself when it fails (a create as a recreate, a page through the range); with none waiting, the overlay reruns
332
+ * through the lifecycle door (`requestWrunOverlayRerun`, reason `source-recovery`: a recreate on a fresh source,
333
+ * held while the overlay is paused or tripped, its chart replays, or it left). Once per overlay and fact set (a later
334
+ * refusal naming the same lists asks nothing more; refusals answered together ask once); a definite none (no coin,
335
+ * a coin the ETF family does not cover, no fund listed) asks nothing and the refusal stands. Structured data only,
336
+ * never a refusal's words. Never rejects.
337
+ */
338
+ export declare function routeWrunSocketFactsNeeded(chartIndex: number, indicatorId: string, needsFacts: unknown): Promise<void>;
339
+ /** The run attempt an overlay's ask belongs to (the refusal surface's live token, `<chart>:<overlay>#<generation>`),
340
+ * read as the ask is built, so the record of its failure names it for the monitoring join. None when no attempt is
341
+ * open or the surface did not load. Never rejects. */
342
+ export declare function wrunSocketAttemptIdOf(chartIndex: number, indicatorId: string): Promise<string | undefined>;
343
+ /** What the cloud asked an overlay's session for (a refusal's absent facts, `noteWrunHostedFactsAsked`) and its one
344
+ * extra ask leave with the session's end (the transport's, under its fence). Never rejects. */
345
+ export declare function forgetWrunSocketFacts(chartIndex: number, indicatorId: string): void;
346
+ /**
347
+ * The one reading of a failed ask (the transport's error seam, wrun-browser-runtime.md "Failure classification"): what
348
+ * the source and the pass meet for what the capability bridge or the cloud answered, read by code (WRUN-PARITY-PLAN
349
+ * row 21), never by a pattern over the cloud's sentence.
350
+ *
351
+ * - The run capability: a mint that did not land within the bridge's wait (the transient grace) is transient
352
+ * (`capability-unavailable`: the
353
+ * pass's Retry and the heal ladder; the mint keeps running, so the next ask resolves from it); a denied one is the
354
+ * access door's (`WrunSocketAccessDeniedError`): the bridge's denial sent nothing, and the cloud's (its FORBIDDEN
355
+ * frame, read by the envelope's one classifier, `isKScriptCapabilityDeniedError`) answered an ask that went, past
356
+ * the transport's one forced re-mint (`dispatched`).
357
+ * - The worker's request deadline is transient (`request-timeout`: the pass's Retry): the ask went and no answer came
358
+ * in time, so the next ask may answer.
359
+ * - A superseded create's answer (the server answer table's `stale` verdict, wrun-hosted-wire-caps
360
+ * `wrunServerAnswerOfText`) can only be the live attempt's own: the session-lost refusal (`WRUN_SESSION_LOST_CODE`,
361
+ * a note with Retry), stamped a foreign supersede. The socket worker settles a replaced attempt's answer through
362
+ * its marker before any of this.
363
+ * - A refusal the worker keeps for good (the answer table's `memory`, `wrunFrameRefusalMemory`) is a `WrunSocketRefusalError`
364
+ * of the code and the facts the error frame's `details.wrunRefusal` named (the socket worker relays them,
365
+ * `wrunFrameRefusalOf`), else the code an older server's sentence leads with, else the frame's own code; the frame
366
+ * is its message (the record's details). The source answers it as a refusal batch, and its record reads the code
367
+ * (wrun-refusal.util `wrunCloudRefusalSeed`, against the chart the pass ran on).
368
+ * - Our upstream market-data read failing (the error envelope's `DATA_UNAVAILABLE`, `isKScriptDataUnavailableError`)
369
+ * keeps the frame's own error with the market-data record (`service-no-answer`, the envelope's own words and chip,
370
+ * never the service names the frame carries), so the pass's Retry and the heal ladder re-ask it once the data is
371
+ * back.
372
+ * - Anything else passes as it came: a refusal that may pass on the next ask (one the kit raises while it reads the
373
+ * window's data, a connection's cap, the no-candles answer) keeps the frame's own error, whose record the pass reads
374
+ * by the code the frame names (`wrunRefusalFor`), as it reads a frame of no refusal or a transport failure.
375
+ * - The kScript socket's own failures read by their code (kscript-transport-codes, `KSCRIPT_TRANSPORT_REASONS`), each a
376
+ * transient reason the failure cause names word for word (wrun-failure-cause): `connection-lost`, `socket-stale`
377
+ * and `worker-restarted` (the ask may have gone), `dial-failed` (nothing went: marked never sent,
378
+ * `isWrunSocketAskUnsent`, so its create takes no session of the overlay), `capability-unavailable`. An abort is one
379
+ * the ask's own signal did not cause (the transport answers its own stop before it reads a failure: a chart switch
380
+ * cancelling the overlay's fetch): transient `aborted`, Retry, never the blocking generic failure.
381
+ * - A thrown value that is no object (the V2 fetch hands a worker's terminal text over as a bare string) rides as an
382
+ * Error of its words, its value as the cause, so the transport's stamp (the ask's clientRequestId) and the record's
383
+ * cause ride it: a bare string used to reach the record unstamped, as `other`.
384
+ */
385
+ export declare function wrunSocketAskFailure(error: unknown): unknown;
386
+ /**
387
+ * The failure a page of a create's window rejects with (the row-source factory's adapter pages the rest of the window
388
+ * after the newest page the create answered): one with a verdict of its own as it came (a stop, a refusal, a frame
389
+ * naming a refusal's code, the record a seed attaches, the access door's hold, a transient), any other (a failed or
390
+ * unreadable page) as the transient error of an incomplete first paging. Never a clean success over history the cloud
391
+ * did not answer.
392
+ */
393
+ export declare function wrunSocketPagingFailure(error: unknown): unknown;
394
+ /**
395
+ * The settings a socket ask's protected payload is built from, by the ask's kind (contracts C4, C5 and C7; the wave-3
396
+ * review round 3). Each reads what the session or the ask holds, never the overlay's saved settings beneath the record:
397
+ * a key a save the cloud refused added stays in them (the store saved it) while the source rolled back to the record
398
+ * the cloud kept, and it would ride an ask of a computation the session never took.
399
+ * - A page (`range`) carries the session's identity alone: the payload view of its registry identity (the wire
400
+ * identity, the capability's slug and the protected discriminator, `wrunSocketPayloadSettings`), never a value or a
401
+ * declaration. It asks the session the worker holds for its window, and the worker reads it with the settings that
402
+ * session holds (the payload's `sessionPage`, kscript-protected.worker).
403
+ * - A create carries the record's values under the overlay's live declarations (`scriptInputs`, as the chart holds
404
+ * them at send time) and the params of the sheet the source runs (the payload view): the rows a delivered sheet
405
+ * reconciled reach the next create, and a declaration the overlay no longer holds is gone. With no overlay on the
406
+ * chart, the record whole.
407
+ * - A settings change carries the record its patch left (the settings the call computes with, whole), less every
408
+ * value the patch drops.
409
+ */
410
+ export declare function wrunSocketAskSettings(ask: Pick<WrunSocketAsk, 'kind' | 'record' | 'patch'>, live: unknown): Record<string, unknown>;
411
+ /** An ask's failure before its dispatch, marked never sent: the failure itself, so it reads as it came everywhere else
412
+ * (a thrown value that is no object as an Error of its words). */
413
+ export declare function unsentAskFailure(error: unknown): object;
414
+ /**
415
+ * Whether a default transport rejected an ask with `error` before it dispatched it (the modules the ask loads, the chart
416
+ * and store reads, the payload builder, the run capability's ensure and the bridge's verdict, a stop before the send):
417
+ * nothing of that ask reached the worker, so a create failed so replaced no session of the overlay, and its source
418
+ * takes none (the row-source factory reads this before its own list, `wrunSocketCreateReachedCloud`). A failure past
419
+ * the dispatch is never marked.
420
+ */
421
+ export declare function isWrunSocketAskUnsent(error: unknown): boolean;
422
+ /**
423
+ * The run capability a socket ask mints with, read off the payload settings it sends (the slug the capability binds,
424
+ * `customScriptId`, and the package tuple through the one wire reader, so the mint's tuple equals the payload's). A
425
+ * mint started before the first ask (the restore pass's warm-up, wrun-registry-loader) reads it here too: the bridge
426
+ * refuses a second tuple on a slug, so the warm-up's mint is the one the ask joins.
427
+ */
428
+ export declare function wrunSocketCapabilityOf(settings: Record<string, unknown>): {
429
+ scriptId: string;
430
+ wrun: {
431
+ package: string;
432
+ version: string;
433
+ } | undefined;
434
+ };
435
+ /** Register a reset of socket state the web half keeps (run by `__resetWrunSocketRowSourceForTests`). */
436
+ export declare function onWrunSocketRowSourceTestReset(reset: () => void): void;
437
+ /** Test reset: the facts routes' state, and the state the web half registered (the default transports' live routes,
438
+ * creates and ask stamps, the denied overlays). */
439
+ export declare function __resetWrunSocketRowSourceForTests(): void;