@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.
- package/README.md +39 -6
- package/dist/constants/common.constants.d.ts +15 -0
- package/dist/constants/common.constants.js +23 -0
- package/dist/constants/data-source.constants.d.ts +1 -0
- package/dist/constants/data-source.constants.js +1 -0
- package/dist/constants/economic.constants.d.ts +39 -0
- package/dist/constants/economic.constants.js +77 -0
- package/dist/constants/etf-covered-coins.constants.d.ts +1 -0
- package/dist/constants/etf-covered-coins.constants.js +9 -0
- package/dist/constants/feature-flags.constants.d.ts +60 -0
- package/dist/constants/feature-flags.constants.js +308 -0
- package/dist/constants/feature-limits.constants.d.ts +134 -0
- package/dist/constants/feature-limits.constants.js +155 -0
- package/dist/constants/marketCapabilities.constants.d.ts +87 -0
- package/dist/constants/marketCapabilities.constants.js +213 -0
- package/dist/constants/option-venues.constants.d.ts +100 -0
- package/dist/constants/option-venues.constants.js +167 -0
- package/dist/constants/overlay-data.constants.d.ts +53 -0
- package/dist/constants/overlay-data.constants.js +80 -0
- package/dist/constants/pane-grid.constants.d.ts +15 -0
- package/dist/constants/pane-grid.constants.js +17 -0
- package/dist/constants/venue-presets.constants.d.ts +10 -0
- package/dist/constants/venue-presets.constants.js +22 -0
- package/dist/enums/chart.enum.d.ts +68 -0
- package/dist/enums/chart.enum.js +70 -0
- package/dist/helpers/data.helpers.d.ts +2 -0
- package/dist/helpers/data.helpers.js +14 -0
- package/dist/host-env.d.ts +161 -5
- package/dist/host-ports.types.d.ts +446 -0
- package/dist/host-ports.types.js +1 -0
- package/dist/index.d.ts +131 -0
- package/dist/index.js +131 -0
- package/dist/indicators/controls/technical-script/technical-script-input-rendering.d.ts +86 -0
- package/dist/indicators/controls/technical-script/technical-script-input-rendering.js +179 -0
- package/dist/interfaces/asset-venue.interface.d.ts +91 -0
- package/dist/interfaces/asset-venue.interface.js +1 -0
- package/dist/interfaces/cancel-reason.interface.d.ts +24 -0
- package/dist/interfaces/cancel-reason.interface.js +2 -0
- package/dist/interfaces/catalog-display.interface.d.ts +3 -0
- package/dist/interfaces/catalog-display.interface.js +1 -0
- package/dist/interfaces/cme-realtime.interface.d.ts +251 -0
- package/dist/interfaces/cme-realtime.interface.js +46 -0
- package/dist/interfaces/feed.interface.d.ts +80 -0
- package/dist/interfaces/feed.interface.js +7 -0
- package/dist/interfaces/market-kind.interface.d.ts +8 -0
- package/dist/interfaces/market-kind.interface.js +1 -0
- package/dist/interfaces/opra-realtime.interface.d.ts +224 -0
- package/dist/interfaces/opra-realtime.interface.js +105 -0
- package/dist/interfaces/option-instrument.interface.d.ts +32 -0
- package/dist/interfaces/option-instrument.interface.js +1 -0
- package/dist/interfaces/options-chain-scope.interface.d.ts +29 -0
- package/dist/interfaces/options-chain-scope.interface.js +7 -0
- package/dist/interfaces/prediction-market.interface.d.ts +88 -0
- package/dist/interfaces/prediction-market.interface.js +8 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +5 -0
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +185 -0
- package/dist/kscript-data/controls/live-trades-merge.util.js +357 -0
- package/dist/settings-templates/frvp-fields.d.ts +27 -0
- package/dist/settings-templates/frvp-fields.js +108 -0
- package/dist/settings-templates/index.d.ts +119 -0
- package/dist/settings-templates/index.js +442 -0
- package/dist/settings-templates/indicator-fields.d.ts +56 -0
- package/dist/settings-templates/indicator-fields.js +793 -0
- package/dist/settings-templates/tool-rules.d.ts +59 -0
- package/dist/settings-templates/tool-rules.js +49 -0
- package/dist/settings-templates/tool-tables.generated.d.ts +2 -0
- package/dist/settings-templates/tool-tables.generated.js +1668 -0
- package/dist/utility/blk-market.util.d.ts +5 -0
- package/dist/utility/blk-market.util.js +12 -0
- package/dist/utility/chart/chart-load-phase.util.d.ts +32 -0
- package/dist/utility/chart/chart-load-phase.util.js +78 -0
- package/dist/utility/chart/cme-cache-context.util.d.ts +108 -0
- package/dist/utility/chart/cme-cache-context.util.js +166 -0
- package/dist/utility/chart/cme-session-bucket.util.d.ts +82 -0
- package/dist/utility/chart/cme-session-bucket.util.js +343 -0
- package/dist/utility/chart/cme-trade-calendar.util.d.ts +26 -0
- package/dist/utility/chart/cme-trade-calendar.util.js +147 -0
- package/dist/utility/chart/continuous-contracts.util.d.ts +138 -0
- package/dist/utility/chart/continuous-contracts.util.js +374 -0
- package/dist/utility/chart/feed-interval.util.d.ts +119 -0
- package/dist/utility/chart/feed-interval.util.js +321 -0
- package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +110 -0
- package/dist/utility/chart/fetch-dedupe-policy.util.js +407 -0
- package/dist/utility/chart/footprint-band.util.d.ts +76 -0
- package/dist/utility/chart/footprint-band.util.js +205 -0
- package/dist/utility/chart/footprint-cell-identity.util.d.ts +82 -0
- package/dist/utility/chart/footprint-cell-identity.util.js +346 -0
- package/dist/utility/chart/formula-calendar.util.d.ts +27 -0
- package/dist/utility/chart/formula-calendar.util.js +59 -0
- package/dist/utility/chart/history-wall.util.d.ts +67 -0
- package/dist/utility/chart/history-wall.util.js +87 -0
- package/dist/utility/chart/index-mode.util.d.ts +66 -0
- package/dist/utility/chart/index-mode.util.js +360 -0
- package/dist/utility/chart/indicator-coverage-planner.util.d.ts +217 -0
- package/dist/utility/chart/indicator-coverage-planner.util.js +443 -0
- package/dist/utility/chart/indicator-coverage-state.util.d.ts +33 -0
- package/dist/utility/chart/indicator-coverage-state.util.js +110 -0
- package/dist/utility/chart/indicator-gap-detector.util.d.ts +127 -0
- package/dist/utility/chart/indicator-gap-detector.util.js +260 -0
- package/dist/utility/chart/indicator-gap-repair.util.d.ts +88 -0
- package/dist/utility/chart/indicator-gap-repair.util.js +177 -0
- package/dist/utility/chart/indicator-inflight-registry.util.d.ts +26 -0
- package/dist/utility/chart/indicator-inflight-registry.util.js +254 -0
- package/dist/utility/chart/interval-registry.util.d.ts +23 -0
- package/dist/utility/chart/interval-registry.util.js +83 -0
- package/dist/utility/chart/kscript-main-grid-stages.util.d.ts +21 -0
- package/dist/utility/chart/kscript-main-grid-stages.util.js +332 -0
- package/dist/utility/chart/legacy-exchange.leaf.d.ts +11 -0
- package/dist/utility/chart/legacy-exchange.leaf.js +43 -0
- package/dist/utility/chart/live-bucket.util.d.ts +66 -0
- package/dist/utility/chart/live-bucket.util.js +165 -0
- package/dist/utility/chart/market-session-schedule.util.d.ts +91 -0
- package/dist/utility/chart/market-session-schedule.util.js +337 -0
- package/dist/utility/chart/marketKind.util.d.ts +181 -0
- package/dist/utility/chart/marketKind.util.js +371 -0
- package/dist/utility/chart/om-panel.util.js +6 -0
- package/dist/utility/chart/om-widget.util.d.ts +4 -0
- package/dist/utility/chart/opra-read-access.leaf.d.ts +26 -0
- package/dist/utility/chart/opra-read-access.leaf.js +25 -0
- package/dist/utility/chart/prediction-identity.util.d.ts +159 -0
- package/dist/utility/chart/prediction-identity.util.js +236 -0
- package/dist/utility/chart/rth-session.util.d.ts +352 -0
- package/dist/utility/chart/rth-session.util.js +926 -0
- package/dist/utility/chart/titan-constants.pin.d.ts +43 -0
- package/dist/utility/chart/titan-constants.pin.js +50 -0
- package/dist/utility/chart/us-equities-session.util.d.ts +127 -0
- package/dist/utility/chart/us-equities-session.util.js +251 -0
- package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +100 -0
- package/dist/utility/chart/wrun-bar-session-facts.util.js +354 -0
- package/dist/utility/chart/wrun-run-result.util.js +10 -0
- package/dist/utility/chart/wrun-wire-ref.util.d.ts +23 -0
- package/dist/utility/chart/wrun-wire-ref.util.js +16 -0
- package/dist/utility/common/safe-math-eval.d.ts +18 -0
- package/dist/utility/common/safe-math-eval.js +160 -0
- package/dist/utility/common/time.util.d.ts +134 -0
- package/dist/utility/common/time.util.js +428 -0
- package/dist/utility/common/transformations.util.d.ts +126 -0
- package/dist/utility/common/transformations.util.js +711 -0
- package/dist/utility/common/visible-timeout.util.d.ts +17 -0
- package/dist/utility/common/visible-timeout.util.js +75 -0
- package/dist/utility/exchange-normalization.util.d.ts +8 -0
- package/dist/utility/exchange-normalization.util.js +32 -0
- package/dist/utility/intl-locale.util.d.ts +2 -0
- package/dist/utility/intl-locale.util.js +28 -0
- package/dist/utility/number-format.util.d.ts +14 -1
- package/dist/utility/number-format.util.js +50 -19
- package/dist/utility/options/option-symbol.util.d.ts +28 -0
- package/dist/utility/options/option-symbol.util.js +176 -0
- package/dist/utility/options/option-trade-units.util.d.ts +190 -0
- package/dist/utility/options/option-trade-units.util.js +283 -0
- package/dist/utility/options/option-venue.util.d.ts +75 -0
- package/dist/utility/options/option-venue.util.js +85 -0
- package/dist/utility/pool-symbol.leaf.d.ts +34 -0
- package/dist/utility/pool-symbol.leaf.js +95 -0
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.d.ts +109 -0
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +302 -0
- package/dist/utility/symbol-selection/contract-expiry.util.d.ts +39 -0
- package/dist/utility/symbol-selection/contract-expiry.util.js +111 -0
- package/dist/utility/v2/gate-plane.util.d.ts +58 -0
- package/dist/utility/v2/gate-plane.util.js +99 -0
- package/dist/utility/v2/gate-session-latch.util.d.ts +22 -0
- package/dist/utility/v2/gate-session-latch.util.js +34 -0
- package/dist/utility/watchlist/import/tradingview-symbols.leaf.d.ts +76 -0
- package/dist/utility/watchlist/import/tradingview-symbols.leaf.js +221 -0
- package/dist/utility/wrun/sources/host-grid-landing.d.ts +15 -0
- package/dist/utility/wrun/sources/host-grid-landing.js +26 -0
- package/dist/utility/wrun/sources/lanes/bitfinex_funding.d.ts +27 -0
- package/dist/utility/wrun/sources/lanes/bitfinex_funding.js +85 -0
- package/dist/utility/wrun/sources/lanes/economic.d.ts +27 -0
- package/dist/utility/wrun/sources/lanes/economic.js +79 -0
- package/dist/utility/wrun/sources/lanes/etf_holdings.d.ts +35 -0
- package/dist/utility/wrun/sources/lanes/etf_holdings.js +165 -0
- package/dist/utility/wrun/sources/lanes/etf_premium.d.ts +19 -0
- package/dist/utility/wrun/sources/lanes/etf_premium.js +114 -0
- package/dist/utility/wrun/sources/lanes/ethena_positions.d.ts +30 -0
- package/dist/utility/wrun/sources/lanes/ethena_positions.js +51 -0
- package/dist/utility/wrun/sources/lanes/index.d.ts +2 -0
- package/dist/utility/wrun/sources/lanes/index.js +32 -0
- package/dist/utility/wrun/sources/lanes/long_short_ratio.d.ts +17 -0
- package/dist/utility/wrun/sources/lanes/long_short_ratio.js +47 -0
- package/dist/utility/wrun/sources/lanes/option_daily.d.ts +30 -0
- package/dist/utility/wrun/sources/lanes/option_daily.js +53 -0
- package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +23 -0
- package/dist/utility/wrun/sources/lanes/option_stats_10m.js +20 -0
- package/dist/utility/wrun/sources/lanes/options_flow.d.ts +50 -0
- package/dist/utility/wrun/sources/lanes/options_flow.js +155 -0
- package/dist/utility/wrun/sources/lanes/options_oi.d.ts +29 -0
- package/dist/utility/wrun/sources/lanes/options_oi.js +59 -0
- package/dist/utility/wrun/sources/lanes/options_volume.d.ts +38 -0
- package/dist/utility/wrun/sources/lanes/options_volume.js +63 -0
- package/dist/utility/wrun/sources/lanes/series.d.ts +67 -0
- package/dist/utility/wrun/sources/lanes/series.js +321 -0
- package/dist/utility/wrun/sources/lanes/token_supply.d.ts +30 -0
- package/dist/utility/wrun/sources/lanes/token_supply.js +145 -0
- package/dist/utility/wrun/sources/lanes/treasury_balance.d.ts +25 -0
- package/dist/utility/wrun/sources/lanes/treasury_balance.js +47 -0
- package/dist/utility/wrun/sources/lanes/volatility_index.d.ts +21 -0
- package/dist/utility/wrun/sources/lanes/volatility_index.js +11 -0
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +196 -0
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +446 -0
- package/dist/utility/wrun/sources/registry.d.ts +21 -0
- package/dist/utility/wrun/sources/registry.js +207 -0
- package/dist/utility/wrun/sources/row-lane-registry.d.ts +28 -0
- package/dist/utility/wrun/sources/row-lane-registry.js +230 -0
- package/dist/utility/wrun/sources/row-lanes/index.d.ts +2 -0
- package/dist/utility/wrun/sources/row-lanes/index.js +12 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.d.ts +2 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +38 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +6 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +70 -0
- package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +4 -0
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +191 -0
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +13 -0
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +137 -0
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +38 -0
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +150 -0
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +275 -0
- package/dist/utility/wrun/sources/wrun-poll-lane.types.js +26 -0
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +224 -0
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +394 -0
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +283 -0
- package/dist/utility/wrun/sources/wrun-row-lane.types.js +16 -0
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +205 -0
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +469 -0
- package/dist/utility/wrun/wrun-browser-sources.leaf.d.ts +28 -0
- package/dist/utility/wrun/wrun-browser-sources.leaf.js +66 -0
- package/dist/utility/wrun/wrun-cloud-record.util.d.ts +65 -0
- package/dist/utility/wrun/wrun-cloud-record.util.js +121 -0
- package/dist/utility/wrun/wrun-color-settings.util.js +1 -1
- package/dist/utility/wrun/wrun-daily-lane.util.d.ts +95 -0
- package/dist/utility/wrun/wrun-daily-lane.util.js +297 -0
- package/dist/utility/wrun/wrun-deadline.util.d.ts +52 -0
- package/dist/utility/wrun/wrun-deadline.util.js +82 -0
- package/dist/utility/wrun/wrun-etf-flow-lane.util.d.ts +94 -0
- package/dist/utility/wrun/wrun-etf-flow-lane.util.js +224 -0
- package/dist/utility/wrun/wrun-etf-funds.util.d.ts +82 -0
- package/dist/utility/wrun/wrun-etf-funds.util.js +242 -0
- package/dist/utility/wrun/wrun-failure-cause.d.ts +39 -0
- package/dist/utility/wrun/wrun-failure-cause.js +94 -0
- package/dist/utility/wrun/wrun-frames.d.ts +28 -3
- package/dist/utility/wrun/wrun-frames.js +132 -52
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +167 -4
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +47 -2
- package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +5 -2
- package/dist/utility/wrun/wrun-hosted-wire.util.js +4 -2
- package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +22 -0
- package/dist/utility/wrun/wrun-lane-refusal.leaf.js +32 -0
- package/dist/utility/wrun/wrun-lane-warmup.util.d.ts +18 -0
- package/dist/utility/wrun/wrun-lane-warmup.util.js +112 -0
- package/dist/utility/wrun/wrun-leg-close.util.d.ts +57 -0
- package/dist/utility/wrun/wrun-leg-close.util.js +187 -0
- package/dist/utility/wrun/wrun-leg-fetch.util.d.ts +144 -0
- package/dist/utility/wrun/wrun-leg-fetch.util.js +212 -0
- package/dist/utility/wrun/wrun-leg-stream-classes.d.ts +73 -0
- package/dist/utility/wrun/wrun-leg-stream-classes.js +86 -0
- package/dist/utility/wrun/wrun-levels-child.util.d.ts +101 -6
- package/dist/utility/wrun/wrun-levels-child.util.js +335 -157
- package/dist/utility/wrun/wrun-memory-clamp.util.d.ts +33 -0
- package/dist/utility/wrun/wrun-memory-clamp.util.js +146 -0
- package/dist/utility/wrun/wrun-odds-template-market.util.d.ts +51 -0
- package/dist/utility/wrun/wrun-odds-template-market.util.js +251 -0
- package/dist/utility/wrun/wrun-opra-flow.leaf.d.ts +65 -0
- package/dist/utility/wrun/wrun-opra-flow.leaf.js +94 -0
- package/dist/utility/wrun/wrun-opra-lane.util.d.ts +47 -0
- package/dist/utility/wrun/wrun-opra-lane.util.js +58 -0
- package/dist/utility/wrun/wrun-opra-stats.leaf.d.ts +30 -0
- package/dist/utility/wrun/wrun-opra-stats.leaf.js +96 -0
- package/dist/utility/wrun/wrun-opra-underlying.util.d.ts +12 -0
- package/dist/utility/wrun/wrun-opra-underlying.util.js +1 -0
- package/dist/utility/wrun/wrun-option-contract-flow.util.d.ts +142 -0
- package/dist/utility/wrun/wrun-option-contract-flow.util.js +451 -0
- package/dist/utility/wrun/wrun-option-knobs.util.d.ts +43 -0
- package/dist/utility/wrun/wrun-option-knobs.util.js +81 -0
- package/dist/utility/wrun/wrun-option-prints.util.d.ts +144 -0
- package/dist/utility/wrun/wrun-option-prints.util.js +356 -0
- package/dist/utility/wrun/wrun-option-summary-lane.util.d.ts +102 -0
- package/dist/utility/wrun/wrun-option-summary-lane.util.js +143 -0
- package/dist/utility/wrun/wrun-options-chain.util.d.ts +308 -0
- package/dist/utility/wrun/wrun-options-chain.util.js +502 -0
- package/dist/utility/wrun/wrun-overlay-identity.util.d.ts +9 -4
- package/dist/utility/wrun/wrun-overlay-identity.util.js +16 -6
- package/dist/utility/wrun/wrun-pack.util.d.ts +6 -2
- package/dist/utility/wrun/wrun-pack.util.js +13 -3
- package/dist/utility/wrun/wrun-param-map.util.d.ts +298 -0
- package/dist/utility/wrun/wrun-param-map.util.js +581 -0
- package/dist/utility/wrun/wrun-param-values.util.d.ts +8 -0
- package/dist/utility/wrun/wrun-param-values.util.js +8 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +149 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.js +523 -0
- package/dist/utility/wrun/wrun-pin-venues.util.d.ts +116 -0
- package/dist/utility/wrun/wrun-pin-venues.util.js +320 -0
- package/dist/utility/wrun/wrun-pinned-interval.util.d.ts +20 -0
- package/dist/utility/wrun/wrun-pinned-interval.util.js +47 -0
- package/dist/utility/wrun/wrun-present-bits.util.d.ts +37 -0
- package/dist/utility/wrun/wrun-present-bits.util.js +73 -0
- package/dist/utility/wrun/wrun-protocol-pending.util.d.ts +33 -0
- package/dist/utility/wrun/wrun-protocol-pending.util.js +57 -0
- package/dist/utility/wrun/wrun-refusal.util.d.ts +95 -7
- package/dist/utility/wrun/wrun-refusal.util.js +314 -18
- package/dist/utility/wrun/wrun-registry-errors.util.d.ts +1 -14
- package/dist/utility/wrun/wrun-registry-errors.util.js +0 -16
- package/dist/utility/wrun/wrun-render-select.util.js +1 -0
- package/dist/utility/wrun/wrun-row-market.util.d.ts +29 -0
- package/dist/utility/wrun/wrun-row-market.util.js +92 -0
- package/dist/utility/wrun/wrun-row-source.d.ts +158 -0
- package/dist/utility/wrun/wrun-row-source.js +75 -0
- package/dist/utility/wrun/wrun-run-health.util.d.ts +155 -0
- package/dist/utility/wrun/wrun-run-health.util.js +273 -0
- package/dist/utility/wrun/wrun-socket-row-source.d.ts +439 -0
- package/dist/utility/wrun/wrun-socket-row-source.js +1689 -0
- package/dist/utility/wrun/wrun-socket-session-losses.util.d.ts +18 -0
- package/dist/utility/wrun/wrun-socket-session-losses.util.js +25 -0
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +911 -0
- package/dist/utility/wrun/wrun-source-rows.util.js +2597 -0
- package/dist/utility/wrun/wrun-symbol-code.util.d.ts +32 -0
- package/dist/utility/wrun/wrun-symbol-code.util.js +56 -0
- package/dist/utility/wrun/wrun-tape-source.util.d.ts +82 -0
- package/dist/utility/wrun/wrun-tape-source.util.js +151 -0
- package/dist/utility/wrun/wrun-tier-grid.util.d.ts +137 -0
- package/dist/utility/wrun/wrun-tier-grid.util.js +279 -0
- package/dist/utility/wrun/wrun-trades-lane.util.d.ts +52 -0
- package/dist/utility/wrun/wrun-trades-lane.util.js +58 -0
- package/dist/utility/wrun/wrun-volume-profile-lane.util.d.ts +41 -0
- package/dist/utility/wrun/wrun-volume-profile-lane.util.js +66 -0
- package/dist/utility/wrun-display-name.util.d.ts +33 -0
- package/dist/utility/wrun-display-name.util.js +64 -0
- package/dist/workers/constants/kscript-transport-codes.d.ts +15 -0
- package/dist/workers/constants/kscript-transport-codes.js +15 -0
- package/dist/workers/constants/socket-slots.d.ts +574 -0
- package/dist/workers/constants/socket-slots.js +539 -0
- package/dist/workers/utils/number.worker.util.d.ts +5 -0
- package/dist/workers/utils/number.worker.util.js +10 -0
- package/dist/workers/utils/time.worker.util.d.ts +12 -0
- package/dist/workers/utils/time.worker.util.js +24 -0
- package/dist/workers/utils/volume-profile.worker.util.d.ts +200 -0
- package/dist/workers/utils/volume-profile.worker.util.js +631 -0
- package/package.json +10 -4
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chart coin's spot-ETF facts a hosted wrun run sends the cloud (`wrunFacts`, the client half of
|
|
3
|
+
* cloud slice C6). The cloud holds no market directory, so it resolves the `fund` words of ETF inputs
|
|
4
|
+
* from what the chart sends: two independent lists, each exactly as the chart's own lanes look it up,
|
|
5
|
+
* never merged.
|
|
6
|
+
*
|
|
7
|
+
* - `etfFlowTickers`: the ETF_FLOW listing's tickers (wrun-etf-flow-lane.util
|
|
8
|
+
* `resolveWrunEtfFlowTickers`, the chart coin trimmed and upper-cased), for an `etf_flow` input.
|
|
9
|
+
* - `etfFunds`: the ETF_METRICS listing's funds (sources/lanes/etf_premium.ts
|
|
10
|
+
* `resolveWrunEtfPremiumFunds`, the tickers the holdings lane sums, each with the issuer the
|
|
11
|
+
* premium ask names; the coin read as the ETF family spells it, BitMEX's XBT as BTC), for an
|
|
12
|
+
* `etf_holdings` or `etf_premium` input.
|
|
13
|
+
* - Each lane gates the coin by `ETF_COVERED_COINS` before any read, and so does each list.
|
|
14
|
+
* - Which lists a payload carries: the sheet's (when the sheet is known) and every list the cloud
|
|
15
|
+
* asked this overlay for (a refusal's `needsFacts`, kept by `noteWrunHostedFactsAsked`). With
|
|
16
|
+
* neither, nothing rides.
|
|
17
|
+
* - A list is absent when it is unknown or not needed (no coin, a coin the family does not cover, a
|
|
18
|
+
* listing not answered yet, a read that failed or answered no fund), never empty; `wrunFacts` is
|
|
19
|
+
* absent when it would hold neither. Nothing rides until every listing needed has a definite
|
|
20
|
+
* answer, so a sheet reading both kinds recreates its session once, not twice.
|
|
21
|
+
*
|
|
22
|
+
* Session memo per listing and coin, the market facts' rule (wrun-chart-market-facts.util): a
|
|
23
|
+
* definite answer kept, concurrent reads share one, a failed or empty read asked again a minute
|
|
24
|
+
* later. The hosted createScript never waits for it (`wrunHostedEtfFacts` starts the read and sends
|
|
25
|
+
* nothing; the socket worker holds the facts as session identity, so the next fetch after they land
|
|
26
|
+
* recreates the session once); Run once awaits it (`awaitWrunEtfFacts`); the one extra ask after a
|
|
27
|
+
* refusal for absent facts (the socket row source's `routeWrunSocketFactsNeeded`) waits for it too
|
|
28
|
+
* (`wrunAskedFactsReady`).
|
|
29
|
+
*
|
|
30
|
+
* Main thread only. Light at module load: the directory read, the lanes and the covered-coin
|
|
31
|
+
* constants load on demand.
|
|
32
|
+
*/
|
|
33
|
+
import { WRUN_HOSTED_FACT_KINDS, } from './wrun-param-map.util.js';
|
|
34
|
+
/** The listing each ETF source class reads. */
|
|
35
|
+
const LISTING_OF_SOURCE = {
|
|
36
|
+
etf_flow: 'flow',
|
|
37
|
+
etf_holdings: 'metrics',
|
|
38
|
+
etf_premium: 'metrics',
|
|
39
|
+
};
|
|
40
|
+
/** The listing each fact list is read from. */
|
|
41
|
+
const LISTING_OF_FACT = {
|
|
42
|
+
etfFlowTickers: 'flow',
|
|
43
|
+
etfFunds: 'metrics',
|
|
44
|
+
};
|
|
45
|
+
/** How long a failed or empty read waits before a run asks the directory again. */
|
|
46
|
+
const RETRY_MS = 60_000;
|
|
47
|
+
/** Definite answers for the session, by listing and coin: a non-empty list, or none for a coin the
|
|
48
|
+
* ETF family does not cover. */
|
|
49
|
+
const settled = new Map();
|
|
50
|
+
/** Reads in flight: concurrent runs share one. */
|
|
51
|
+
const pending = new Map();
|
|
52
|
+
/** When a listing whose read failed or answered no fund may be asked again (epoch ms). */
|
|
53
|
+
const retryAfter = new Map();
|
|
54
|
+
/** The fact lists the cloud asked each overlay for (`chartIndex:overlayId`), in the fixed order. */
|
|
55
|
+
const asked = new Map();
|
|
56
|
+
function isRecord(value) {
|
|
57
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
58
|
+
}
|
|
59
|
+
/** Listings in the fixed order (ETF_FLOW first), each once. */
|
|
60
|
+
function orderedListings(read) {
|
|
61
|
+
return ['flow', 'metrics'].filter((listing) => read.has(listing));
|
|
62
|
+
}
|
|
63
|
+
/** The listings a sheet's inputs read (its `inputSources`), ETF_FLOW first: none when no input reads
|
|
64
|
+
* an ETF source. */
|
|
65
|
+
export function wrunEtfListingsOf(sheet) {
|
|
66
|
+
const sources = isRecord(sheet) && isRecord(sheet.inputSources) ? sheet.inputSources : undefined;
|
|
67
|
+
if (sources === undefined)
|
|
68
|
+
return [];
|
|
69
|
+
const read = new Set();
|
|
70
|
+
for (const source of Object.values(sources)) {
|
|
71
|
+
const sourceClass = isRecord(source) ? source.source : undefined;
|
|
72
|
+
if (typeof sourceClass === 'string' && Object.hasOwn(LISTING_OF_SOURCE, sourceClass)) {
|
|
73
|
+
read.add(LISTING_OF_SOURCE[sourceClass]);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return orderedListings(read);
|
|
77
|
+
}
|
|
78
|
+
/** The listings fact lists are read from, ETF_FLOW first. */
|
|
79
|
+
export function wrunEtfListingsOfFacts(kinds) {
|
|
80
|
+
return orderedListings(new Set(kinds.map((kind) => LISTING_OF_FACT[kind])));
|
|
81
|
+
}
|
|
82
|
+
/** The coin a listing is asked by, as its lane spells it: trimmed and upper-cased, and on the
|
|
83
|
+
* ETF_METRICS listing BitMEX's XBT read as BTC (wrunEtfHoldingsCoinWord, wrunEtfPremiumFamilyCoin);
|
|
84
|
+
* '' when the chart has none. */
|
|
85
|
+
export function wrunEtfListingCoin(listing, coin) {
|
|
86
|
+
const word = typeof coin === 'string' ? coin.trim().toUpperCase() : '';
|
|
87
|
+
return listing === 'metrics' && word === 'XBT' ? 'BTC' : word;
|
|
88
|
+
}
|
|
89
|
+
function memoKey(listing, coinWord) {
|
|
90
|
+
return `${listing}\u0000${coinWord}`;
|
|
91
|
+
}
|
|
92
|
+
/** One listing's funds through its lane's own lookup, in the directory's order (an ETF_FLOW entry is
|
|
93
|
+
* a ticker alone: the flow lane reads no issuer). */
|
|
94
|
+
async function readListing(listing, coinWord) {
|
|
95
|
+
if (listing === 'flow') {
|
|
96
|
+
const { resolveWrunEtfFlowTickers } = await import('./wrun-etf-flow-lane.util.js');
|
|
97
|
+
return (await resolveWrunEtfFlowTickers(coinWord)).map((ticker) => ({ ticker }));
|
|
98
|
+
}
|
|
99
|
+
const { resolveWrunEtfPremiumFunds } = await import('./sources/lanes/etf_premium.js');
|
|
100
|
+
return (await resolveWrunEtfPremiumFunds(coinWord)).map(({ ticker, issuer }) => issuer === undefined ? { ticker } : { ticker, issuer });
|
|
101
|
+
}
|
|
102
|
+
/** Ask one listing for one coin: once per session for a definite answer, a failed or empty read
|
|
103
|
+
* again a minute later, concurrent callers sharing one read. Never rejects. */
|
|
104
|
+
function warmListing(listing, coinWord) {
|
|
105
|
+
const key = memoKey(listing, coinWord);
|
|
106
|
+
if (coinWord === '' || settled.has(key))
|
|
107
|
+
return Promise.resolve();
|
|
108
|
+
if (Date.now() < (retryAfter.get(key) ?? 0))
|
|
109
|
+
return Promise.resolve();
|
|
110
|
+
let read = pending.get(key);
|
|
111
|
+
if (read === undefined) {
|
|
112
|
+
read = (async () => {
|
|
113
|
+
// The native ETF indicators' covered-coin gate (its leaf, loaded lazily as the constants module
|
|
114
|
+
// it was split from was: the load's boundary and timing hold).
|
|
115
|
+
const { ETF_COVERED_COINS } = await import('../../constants/etf-covered-coins.constants.js');
|
|
116
|
+
if (!ETF_COVERED_COINS.includes(coinWord)) {
|
|
117
|
+
settled.set(key, []);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const funds = await readListing(listing, coinWord);
|
|
121
|
+
if (funds.length > 0) {
|
|
122
|
+
settled.set(key, funds);
|
|
123
|
+
retryAfter.delete(key);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
retryAfter.set(key, Date.now() + RETRY_MS);
|
|
127
|
+
}
|
|
128
|
+
})()
|
|
129
|
+
.catch(() => {
|
|
130
|
+
retryAfter.set(key, Date.now() + RETRY_MS);
|
|
131
|
+
})
|
|
132
|
+
.finally(() => pending.delete(key));
|
|
133
|
+
pending.set(key, read);
|
|
134
|
+
}
|
|
135
|
+
return read;
|
|
136
|
+
}
|
|
137
|
+
/** Start (or join) the reads `listings` need for the chart's `coin`. Never rejects. */
|
|
138
|
+
export function warmWrunEtfFunds(listings, coin) {
|
|
139
|
+
return Promise.all(listings.map((listing) => warmListing(listing, wrunEtfListingCoin(listing, coin)))).then(() => undefined);
|
|
140
|
+
}
|
|
141
|
+
/** The facts now, without waiting: `known` false while a listing they need has no definite answer
|
|
142
|
+
* (not read yet, in flight, or failed or empty within the last minute); else the facts, each list
|
|
143
|
+
* only when its listing holds a fund, undefined when neither does (no coin, a coin the family does
|
|
144
|
+
* not cover). */
|
|
145
|
+
export function wrunEtfFactsNow(listings, coin) {
|
|
146
|
+
const facts = {};
|
|
147
|
+
for (const listing of listings) {
|
|
148
|
+
const coinWord = wrunEtfListingCoin(listing, coin);
|
|
149
|
+
if (coinWord === '')
|
|
150
|
+
continue;
|
|
151
|
+
const answer = settled.get(memoKey(listing, coinWord));
|
|
152
|
+
if (answer === undefined)
|
|
153
|
+
return { known: false };
|
|
154
|
+
if (answer.length === 0)
|
|
155
|
+
continue;
|
|
156
|
+
if (listing === 'flow')
|
|
157
|
+
facts.etfFlowTickers = answer.map((fund) => fund.ticker);
|
|
158
|
+
else
|
|
159
|
+
facts.etfFunds = answer.map((fund) => ({ ...fund }));
|
|
160
|
+
}
|
|
161
|
+
return { known: true, facts: facts.etfFlowTickers || facts.etfFunds ? facts : undefined };
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* The facts a hosted createScript carries on a chart of `coin`, without waiting: the lists the sheet
|
|
165
|
+
* reads (the remembered sheet, else the record's own `wrunSheet`; undefined when unknown) and the
|
|
166
|
+
* lists the cloud asked this overlay for (`askedFacts`). Undefined when neither names a list, when
|
|
167
|
+
* there is nothing to send, or while the directory has not answered, in which case the read starts
|
|
168
|
+
* here and a later fetch carries the facts.
|
|
169
|
+
*/
|
|
170
|
+
export function wrunHostedEtfFacts(sheet, coin, askedFacts = []) {
|
|
171
|
+
const listings = orderedListings(new Set([...wrunEtfListingsOf(sheet), ...wrunEtfListingsOfFacts(askedFacts)]));
|
|
172
|
+
if (listings.length === 0)
|
|
173
|
+
return undefined;
|
|
174
|
+
const now = wrunEtfFactsNow(listings, coin);
|
|
175
|
+
if (now.known)
|
|
176
|
+
return now.facts;
|
|
177
|
+
void warmWrunEtfFunds(listings, coin);
|
|
178
|
+
return undefined;
|
|
179
|
+
}
|
|
180
|
+
/** The facts Run once sends for a build's sheet on a chart of `coin`, once the directory answered:
|
|
181
|
+
* undefined when the sheet reads no ETF source or there is nothing to send. Never rejects. */
|
|
182
|
+
export async function awaitWrunEtfFacts(sheet, coin) {
|
|
183
|
+
const listings = wrunEtfListingsOf(sheet);
|
|
184
|
+
if (listings.length === 0)
|
|
185
|
+
return undefined;
|
|
186
|
+
await warmWrunEtfFunds(listings, coin);
|
|
187
|
+
const now = wrunEtfFactsNow(listings, coin);
|
|
188
|
+
return now.known ? now.facts : undefined;
|
|
189
|
+
}
|
|
190
|
+
/** Whether every asked fact list has a definite non-empty answer for the chart's `coin`, once the
|
|
191
|
+
* directory answered (the reads start here). False for no list, for a definite none (no coin, a
|
|
192
|
+
* coin the family does not cover) and while an answer is not definite. Never rejects. */
|
|
193
|
+
export async function wrunAskedFactsReady(kinds, coin) {
|
|
194
|
+
if (kinds.length === 0)
|
|
195
|
+
return false;
|
|
196
|
+
const listings = wrunEtfListingsOfFacts(kinds);
|
|
197
|
+
await warmWrunEtfFunds(listings, coin);
|
|
198
|
+
const now = wrunEtfFactsNow(listings, coin);
|
|
199
|
+
if (!now.known || now.facts === undefined)
|
|
200
|
+
return false;
|
|
201
|
+
return kinds.every((kind) => now.facts?.[kind] !== undefined);
|
|
202
|
+
}
|
|
203
|
+
function overlayKey(chartIndex, overlayId) {
|
|
204
|
+
return `${chartIndex}:${overlayId}`;
|
|
205
|
+
}
|
|
206
|
+
/** Remember the fact lists the cloud asked an overlay for (a refusal's `needsFacts`), beside the ones
|
|
207
|
+
* it asked before: the overlay's payloads send them from now on. Answers every list asked so far, in
|
|
208
|
+
* the fixed order. */
|
|
209
|
+
export function noteWrunHostedFactsAsked(chartIndex, overlayId, kinds) {
|
|
210
|
+
const key = overlayKey(chartIndex, overlayId);
|
|
211
|
+
const before = asked.get(key) ?? [];
|
|
212
|
+
const union = WRUN_HOSTED_FACT_KINDS.filter((kind) => before.includes(kind) || kinds.includes(kind));
|
|
213
|
+
if (union.length > 0)
|
|
214
|
+
asked.set(key, union);
|
|
215
|
+
return [...union];
|
|
216
|
+
}
|
|
217
|
+
/** The fact lists the cloud asked an overlay for: none until a refusal named one. */
|
|
218
|
+
export function wrunHostedFactsAsked(chartIndex, overlayId) {
|
|
219
|
+
return [...(asked.get(overlayKey(chartIndex, overlayId)) ?? [])];
|
|
220
|
+
}
|
|
221
|
+
/** Forget what the cloud asked: one overlay on one chart, every overlay of a chart (`overlayId`
|
|
222
|
+
* undefined), or one overlay on every chart (`chartIndex` undefined). */
|
|
223
|
+
export function forgetWrunHostedFactsAsked(chartIndex, overlayId) {
|
|
224
|
+
if (chartIndex !== undefined && overlayId !== undefined) {
|
|
225
|
+
asked.delete(overlayKey(chartIndex, overlayId));
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
for (const key of [...asked.keys()]) {
|
|
229
|
+
const separator = key.indexOf(':');
|
|
230
|
+
const keyChart = Number(key.slice(0, separator));
|
|
231
|
+
const keyOverlay = key.slice(separator + 1);
|
|
232
|
+
if (chartIndex !== undefined ? keyChart === chartIndex : keyOverlay === overlayId)
|
|
233
|
+
asked.delete(key);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
/** Forget every kept answer and every asked list (spec isolation). */
|
|
237
|
+
export function clearWrunEtfFundsMemo() {
|
|
238
|
+
settled.clear();
|
|
239
|
+
pending.clear();
|
|
240
|
+
retryAfter.clear();
|
|
241
|
+
asked.clear();
|
|
242
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why a wrun run failed, as one closed word every failure event carries (`feature:failed`, `wrun_lane_mount`,
|
|
3
|
+
* `wrun_failure_shown`): the attempt reason says what kind of failure it was, the cause says what produced it, so a
|
|
4
|
+
* readout can tell a dropped socket from a slow permission or a server refusal without joining server logs.
|
|
5
|
+
*
|
|
6
|
+
* Closed set, pinned two-way on the `WRUN_FAILURE_CAUSES:` and `WRUN_TRANSIENT_FAILURE_CAUSES:` lines of
|
|
7
|
+
* docs/features/diagnostics/analytics-taxonomy/events.md. Never message text: a cause is one of these words, or
|
|
8
|
+
* `server:<row>` for a cloud answer, where `<row>` is an answer-table row id (wrun-hosted-wire-caps
|
|
9
|
+
* `WRUN_SERVER_ANSWER_ROW_IDS`, listed on the same page's `WRUN_FAILURE_SERVER_ROWS:` line). The refusal record
|
|
10
|
+
* reads it off a failure (wrun-refusal.util `wrunFailureCauseOf`) and carries it at `refusal.telemetry.cause`.
|
|
11
|
+
*/
|
|
12
|
+
import { type WrunServerAnswerRowId } from './wrun-hosted-wire-caps.js';
|
|
13
|
+
export declare const WRUN_FAILURE_CAUSES: readonly ["no-reply", "session-kicked", "connection-unavailable", "connection-lost", "dial-failed", "socket-stale", "worker-restarted", "chart-gone", "capability-unavailable", "request-timeout", "paging-incomplete", "aborted", "superseded", "access-denied", "session-expired", "backend-unavailable", "reply-unreadable", "worker-dead", "chunk-load", "network", "none", "other"];
|
|
14
|
+
export type WrunFailureBaseCause = (typeof WRUN_FAILURE_CAUSES)[number];
|
|
15
|
+
/** A cloud answer's cause: `server:` and the answer-table row the frame matched. */
|
|
16
|
+
export type WrunFailureServerCause = `server:${WrunServerAnswerRowId}`;
|
|
17
|
+
export type WrunFailureCause = WrunFailureBaseCause | WrunFailureServerCause;
|
|
18
|
+
/**
|
|
19
|
+
* The causes a later attempt usually gets past without the person doing anything: the connection, the permission,
|
|
20
|
+
* the worker or the network was briefly unavailable. A refusal with one of these causes waits out the transient grace
|
|
21
|
+
* (wrun-transient-rerun.util) before it shows. A cloud answer the answer table retries (`server:<row>` of a `retry`
|
|
22
|
+
* row: `[INTERNAL]`, the rate limit, a busy rebind) is transient too (`isWrunTransientFailureCause`), except a cap the
|
|
23
|
+
* person must act on (WRUN_PERSON_ACTION_SERVER_ROWS).
|
|
24
|
+
*/
|
|
25
|
+
export declare const WRUN_TRANSIENT_FAILURE_CAUSES: readonly WrunFailureBaseCause[];
|
|
26
|
+
/**
|
|
27
|
+
* The answer-table rows that retry but wait on the person, never on time: the tab's foreign-source and instance caps
|
|
28
|
+
* (`tab-full`) clear only once an overlay leaves the tab, so no rerun inside a grace gets past them. Their refusal
|
|
29
|
+
* (with Retry) shows at once.
|
|
30
|
+
*/
|
|
31
|
+
export declare const WRUN_PERSON_ACTION_SERVER_ROWS: readonly WrunServerAnswerRowId[];
|
|
32
|
+
/** The cause of a cloud answer by the answer-table row that read it. */
|
|
33
|
+
export declare function wrunServerFailureCause(row: WrunServerAnswerRowId): WrunFailureServerCause;
|
|
34
|
+
/** True for a word of the closed set: a base cause, or `server:` and a row id of the answer table. */
|
|
35
|
+
export declare function isWrunFailureCause(value: unknown): value is WrunFailureCause;
|
|
36
|
+
/** True when a refusal with this cause should wait out the transient grace before it shows: a transient base cause,
|
|
37
|
+
* or a cloud answer whose answer-table row says the same ask may pass (`retry`) without the person acting first
|
|
38
|
+
* (never a row of WRUN_PERSON_ACTION_SERVER_ROWS). */
|
|
39
|
+
export declare function isWrunTransientFailureCause(cause: string | null | undefined): boolean;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why a wrun run failed, as one closed word every failure event carries (`feature:failed`, `wrun_lane_mount`,
|
|
3
|
+
* `wrun_failure_shown`): the attempt reason says what kind of failure it was, the cause says what produced it, so a
|
|
4
|
+
* readout can tell a dropped socket from a slow permission or a server refusal without joining server logs.
|
|
5
|
+
*
|
|
6
|
+
* Closed set, pinned two-way on the `WRUN_FAILURE_CAUSES:` and `WRUN_TRANSIENT_FAILURE_CAUSES:` lines of
|
|
7
|
+
* docs/features/diagnostics/analytics-taxonomy/events.md. Never message text: a cause is one of these words, or
|
|
8
|
+
* `server:<row>` for a cloud answer, where `<row>` is an answer-table row id (wrun-hosted-wire-caps
|
|
9
|
+
* `WRUN_SERVER_ANSWER_ROW_IDS`, listed on the same page's `WRUN_FAILURE_SERVER_ROWS:` line). The refusal record
|
|
10
|
+
* reads it off a failure (wrun-refusal.util `wrunFailureCauseOf`) and carries it at `refusal.telemetry.cause`.
|
|
11
|
+
*/
|
|
12
|
+
import { WRUN_SERVER_ANSWER_ROW_IDS, wrunServerAnswerRowVerdict, } from './wrun-hosted-wire-caps.js';
|
|
13
|
+
export const WRUN_FAILURE_CAUSES = Object.freeze([
|
|
14
|
+
'no-reply',
|
|
15
|
+
'session-kicked',
|
|
16
|
+
'connection-unavailable',
|
|
17
|
+
'connection-lost',
|
|
18
|
+
'dial-failed',
|
|
19
|
+
'socket-stale',
|
|
20
|
+
'worker-restarted',
|
|
21
|
+
'chart-gone',
|
|
22
|
+
'capability-unavailable',
|
|
23
|
+
'request-timeout',
|
|
24
|
+
'paging-incomplete',
|
|
25
|
+
'aborted',
|
|
26
|
+
'superseded',
|
|
27
|
+
'access-denied',
|
|
28
|
+
'session-expired',
|
|
29
|
+
'backend-unavailable',
|
|
30
|
+
'reply-unreadable',
|
|
31
|
+
'worker-dead',
|
|
32
|
+
'chunk-load',
|
|
33
|
+
'network',
|
|
34
|
+
'none',
|
|
35
|
+
'other',
|
|
36
|
+
]);
|
|
37
|
+
/**
|
|
38
|
+
* The causes a later attempt usually gets past without the person doing anything: the connection, the permission,
|
|
39
|
+
* the worker or the network was briefly unavailable. A refusal with one of these causes waits out the transient grace
|
|
40
|
+
* (wrun-transient-rerun.util) before it shows. A cloud answer the answer table retries (`server:<row>` of a `retry`
|
|
41
|
+
* row: `[INTERNAL]`, the rate limit, a busy rebind) is transient too (`isWrunTransientFailureCause`), except a cap the
|
|
42
|
+
* person must act on (WRUN_PERSON_ACTION_SERVER_ROWS).
|
|
43
|
+
*/
|
|
44
|
+
export const WRUN_TRANSIENT_FAILURE_CAUSES = Object.freeze([
|
|
45
|
+
'no-reply',
|
|
46
|
+
'session-kicked',
|
|
47
|
+
'connection-unavailable',
|
|
48
|
+
'connection-lost',
|
|
49
|
+
'dial-failed',
|
|
50
|
+
'socket-stale',
|
|
51
|
+
'worker-restarted',
|
|
52
|
+
'capability-unavailable',
|
|
53
|
+
'request-timeout',
|
|
54
|
+
'paging-incomplete',
|
|
55
|
+
'aborted',
|
|
56
|
+
'backend-unavailable',
|
|
57
|
+
'network',
|
|
58
|
+
]);
|
|
59
|
+
/**
|
|
60
|
+
* The answer-table rows that retry but wait on the person, never on time: the tab's foreign-source and instance caps
|
|
61
|
+
* (`tab-full`) clear only once an overlay leaves the tab, so no rerun inside a grace gets past them. Their refusal
|
|
62
|
+
* (with Retry) shows at once.
|
|
63
|
+
*/
|
|
64
|
+
export const WRUN_PERSON_ACTION_SERVER_ROWS = Object.freeze(['tab-full']);
|
|
65
|
+
const SERVER_PREFIX = 'server:';
|
|
66
|
+
const PERSON_ACTION_ROWS = new Set(WRUN_PERSON_ACTION_SERVER_ROWS);
|
|
67
|
+
const BASE_CAUSES = new Set(WRUN_FAILURE_CAUSES);
|
|
68
|
+
const TRANSIENT_CAUSES = new Set(WRUN_TRANSIENT_FAILURE_CAUSES);
|
|
69
|
+
const SERVER_ROWS = new Set(WRUN_SERVER_ANSWER_ROW_IDS);
|
|
70
|
+
/** The cause of a cloud answer by the answer-table row that read it. */
|
|
71
|
+
export function wrunServerFailureCause(row) {
|
|
72
|
+
return `${SERVER_PREFIX}${row}`;
|
|
73
|
+
}
|
|
74
|
+
/** True for a word of the closed set: a base cause, or `server:` and a row id of the answer table. */
|
|
75
|
+
export function isWrunFailureCause(value) {
|
|
76
|
+
if (typeof value !== 'string')
|
|
77
|
+
return false;
|
|
78
|
+
if (BASE_CAUSES.has(value))
|
|
79
|
+
return true;
|
|
80
|
+
return value.startsWith(SERVER_PREFIX) && SERVER_ROWS.has(value.slice(SERVER_PREFIX.length));
|
|
81
|
+
}
|
|
82
|
+
/** True when a refusal with this cause should wait out the transient grace before it shows: a transient base cause,
|
|
83
|
+
* or a cloud answer whose answer-table row says the same ask may pass (`retry`) without the person acting first
|
|
84
|
+
* (never a row of WRUN_PERSON_ACTION_SERVER_ROWS). */
|
|
85
|
+
export function isWrunTransientFailureCause(cause) {
|
|
86
|
+
if (typeof cause !== 'string')
|
|
87
|
+
return false;
|
|
88
|
+
if (TRANSIENT_CAUSES.has(cause))
|
|
89
|
+
return true;
|
|
90
|
+
if (!cause.startsWith(SERVER_PREFIX))
|
|
91
|
+
return false;
|
|
92
|
+
const row = cause.slice(SERVER_PREFIX.length);
|
|
93
|
+
return SERVER_ROWS.has(row) && !PERSON_ACTION_ROWS.has(row) && wrunServerAnswerRowVerdict(row) === 'retry';
|
|
94
|
+
}
|
|
@@ -22,6 +22,7 @@ import type { WrunFontWeight, WrunLevels, WrunMatrix, WrunPanel, WrunPanelGuide,
|
|
|
22
22
|
import { type ParsedPanel } from '../chart/om-panel.util.js';
|
|
23
23
|
import type { FeedLine, LadderProps, LadderRow } from '../chart/om-widget.util.js';
|
|
24
24
|
import type { WrunMiniChartsFrame } from '@orangecharts/indicator-kit/host';
|
|
25
|
+
import { type WrunRowMarket } from './wrun-row-market.util.js';
|
|
25
26
|
export declare const WRUN_FRAME_DEFAULT_MAX_BYTES = 98304;
|
|
26
27
|
export declare const WRUN_FRAME_MAX_SLOTS = 8;
|
|
27
28
|
/** Rows per levels frame on the pane dock, and per span (g2, g6). */
|
|
@@ -86,13 +87,25 @@ export interface WrunLevelsFrame {
|
|
|
86
87
|
scale_max?: number;
|
|
87
88
|
}
|
|
88
89
|
/** One time span of a span "time" frame (DL-time-anchored): its bounds in
|
|
89
|
-
* epoch seconds and its own rows; colours are colour words.
|
|
90
|
+
* epoch seconds and its own rows; colours are colour words. The per-span
|
|
91
|
+
* fields (kit 0.86.0, WRUN-OI-PROFILE D6) are the pane frame's, read per
|
|
92
|
+
* span: a text per row, the stacked series cells, the span's own value
|
|
93
|
+
* area and its own POC price and tag. */
|
|
90
94
|
export interface WrunLevelsSpan {
|
|
91
95
|
start: number;
|
|
92
96
|
end: number;
|
|
93
97
|
prices: number[];
|
|
94
98
|
values: (number | null)[];
|
|
95
99
|
colors?: string[];
|
|
100
|
+
/** DL-row-text: a string is the row's text, "" no label, null the formatted value. */
|
|
101
|
+
labels_text?: (string | null)[];
|
|
102
|
+
/** DL-stacked: one array per declared series, each the length of the span's prices; never beside `colors`. */
|
|
103
|
+
series?: (number | null)[][];
|
|
104
|
+
/** DL-value-area: the span's own [low, high]. */
|
|
105
|
+
value_area?: [number, number];
|
|
106
|
+
/** DL-poc: the span's own marked price and tag text. */
|
|
107
|
+
poc_price?: number;
|
|
108
|
+
poc_label_text?: string;
|
|
96
109
|
}
|
|
97
110
|
/** The span "time" frame: 1..64 spans holding at most 4096 rows in all. */
|
|
98
111
|
export interface WrunLevelsSpansFrame {
|
|
@@ -107,11 +120,13 @@ export interface WrunLadderFrame {
|
|
|
107
120
|
divider?: LadderProps['divider'];
|
|
108
121
|
title?: string;
|
|
109
122
|
}
|
|
110
|
-
/** A feed frame: 1..50 lines of [time ms, text, colour word?]
|
|
111
|
-
*
|
|
123
|
+
/** A feed frame: 1..50 lines of [time ms, text, colour word?], an optional
|
|
124
|
+
* per-run title (DW15) and optional markets, one per line (UW-PARITY H4,
|
|
125
|
+
* wrun-row-market.util): the market a click on the line opens. */
|
|
112
126
|
export interface WrunFeedFrame {
|
|
113
127
|
lines: FeedLine[];
|
|
114
128
|
title?: string;
|
|
129
|
+
markets?: (WrunRowMarket | null)[];
|
|
115
130
|
}
|
|
116
131
|
/** A heatmap summary row (SC18, frame only): values follow the columns in
|
|
117
132
|
* first-seen order. */
|
|
@@ -141,6 +156,9 @@ export interface WrunPanelFrameChrome {
|
|
|
141
156
|
summary?: WrunPanelSummaryRow[];
|
|
142
157
|
hole_text?: string;
|
|
143
158
|
hole_caption?: string;
|
|
159
|
+
/** A table's rows' markets (UW-PARITY H4), one per row: null or the market
|
|
160
|
+
* a click on the row opens (wrun-row-market.util). */
|
|
161
|
+
markets?: (WrunRowMarket | null)[];
|
|
144
162
|
}
|
|
145
163
|
export type WrunPanelFrameWord = keyof WrunPanelFrameChrome;
|
|
146
164
|
/** A styled matrix cell: at least one field. */
|
|
@@ -171,6 +189,13 @@ export interface WrunMatrixFrame {
|
|
|
171
189
|
};
|
|
172
190
|
}
|
|
173
191
|
export declare function invalidWrunFrame(slot: string, reason: string): never;
|
|
192
|
+
/** The pane frame's keys (the kit's `WrunLevelsPaneFrameSchema`, pinned by the kit mirror spec). */
|
|
193
|
+
export declare const WRUN_LEVELS_PANE_KEYS: readonly ["prices", "values", "colors", "labels_text", "series", "lows", "highs", "tooltips", "value_area", "poc_price", "poc_label_text", "scale_max"];
|
|
194
|
+
/** A span's keys: its bounds and rows, then the pane frame's per-row and
|
|
195
|
+
* per-profile fields a span carries for itself (kit 0.86.0). The pane-only
|
|
196
|
+
* fields stay off a span: `lows` / `highs` (cells 4 and 5 hold the span's
|
|
197
|
+
* bounds), `tooltips` and `scale_max`. Exported for the kit mirror spec. */
|
|
198
|
+
export declare const WRUN_LEVELS_SPAN_KEYS: readonly ["start", "end", "prices", "values", "colors", "labels_text", "series", "value_area", "poc_price", "poc_label_text"];
|
|
174
199
|
/** Parses a levels frame: the pane shape (`prices`, `values`, ...) or the
|
|
175
200
|
* spans shape (`spans`), told apart by the `spans` key; shape rules only
|
|
176
201
|
* (the kit's `WrunLevelsFrameSchema`). With a declaration, the shape must
|