@orangecharts/wrun-chart-host 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -8
- 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/scriptEditor/builtin-script-snippets.d.ts +133 -0
- package/dist/constants/scriptEditor/builtin-script-snippets.js +451 -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 +163 -5
- package/dist/host-ports.types.d.ts +431 -0
- package/dist/host-ports.types.js +1 -0
- package/dist/index.d.ts +138 -0
- package/dist/index.js +138 -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/date-labelled-interval.leaf.d.ts +15 -0
- package/dist/utility/chart/date-labelled-interval.leaf.js +19 -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/indicator-run-interval.util.d.ts +130 -0
- package/dist/utility/chart/indicator-run-interval.util.js +268 -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/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/window-geometry.leaf.d.ts +119 -0
- package/dist/utility/chart/window-geometry.leaf.js +391 -0
- package/dist/utility/chart/window-owner.leaf.d.ts +19 -0
- package/dist/utility/chart/window-owner.leaf.js +24 -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-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/html-escape.leaf.d.ts +11 -0
- package/dist/utility/html-escape.leaf.js +20 -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 +58 -0
- package/dist/utility/wrun/sources/lanes/option_daily.js +111 -0
- package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +27 -0
- package/dist/utility/wrun/sources/lanes/option_stats_10m.js +21 -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 +215 -0
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +477 -0
- package/dist/utility/wrun/sources/registry.d.ts +21 -0
- package/dist/utility/wrun/sources/registry.js +237 -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 +55 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +126 -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 +62 -0
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +147 -0
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +70 -0
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +144 -0
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +309 -0
- package/dist/utility/wrun/sources/wrun-poll-lane.types.js +26 -0
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +350 -0
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +576 -0
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +275 -0
- package/dist/utility/wrun/sources/wrun-row-lane.types.js +16 -0
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +207 -0
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +450 -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-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-frames.d.ts +20 -1
- package/dist/utility/wrun/wrun-frames.js +103 -49
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +2 -2
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +27 -0
- 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 +49 -0
- package/dist/utility/wrun/wrun-opra-stats.leaf.js +115 -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-panel-mount.lazy.d.ts +10 -0
- package/dist/utility/wrun/wrun-panel-mount.lazy.js +68 -0
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +377 -0
- package/dist/utility/wrun/wrun-panel-mount.util.js +2251 -0
- 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-pause-dim.util.d.ts +52 -0
- package/dist/utility/wrun/wrun-pause-dim.util.js +153 -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-plot-gate.types.d.ts +23 -0
- package/dist/utility/wrun/wrun-plot-gate.types.js +7 -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 +41 -1
- package/dist/utility/wrun/wrun-refusal.util.js +69 -2
- 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-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-run-interval-projection.types.d.ts +14 -0
- package/dist/utility/wrun/wrun-run-interval-projection.types.js +1 -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-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
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import { type WrunFailureBaseCause, type WrunFailureCause } from './wrun-failure-cause.js';
|
|
2
2
|
import { WRUN_KIT_REFUSAL_STAGES, wrunKitRefusalStageOf, type WrunFrameRefusal, type WrunKitRefusalStage } from './wrun-hosted-wire-caps.js';
|
|
3
|
-
export type WrunRefusalClass = 'legs-empty' | 'feed-missing' | 'no-options' | 'coin-outside-feed' | 'interval-unserved' | 'service-no-answer' | 'waiting' | 'cme-wall' | 'pin-refused' | 'index-unserved' | 'too-big' | 'live-stopped' | 'not-reached' | 'nothing-ready' | 'slots' | 'not-added' | 'run-failed';
|
|
3
|
+
export type WrunRefusalClass = 'legs-empty' | 'feed-missing' | 'no-options' | 'coin-outside-feed' | 'interval-unserved' | 'service-no-answer' | 'waiting' | 'cme-wall' | 'pin-refused' | 'index-unserved' | 'too-big' | 'live-stopped' | 'not-reached' | 'nothing-ready' | 'slots' | 'not-added' | 'run-failed' | 'options-stopped';
|
|
4
|
+
/** A gate plane a take-back names (the app's `GateProvider`, spelled here: the package reads no app constant). */
|
|
5
|
+
export type WrunRefusalGatePlane = 'cme' | 'opra';
|
|
6
|
+
/**
|
|
7
|
+
* Why an options lane stopped although its data exists: the reason the point that stopped it already knows,
|
|
8
|
+
* carried as this word to the one place the chip is chosen (the `options-stopped` class, one variant per word).
|
|
9
|
+
* Never parsed out of an error's text.
|
|
10
|
+
* - `session-elsewhere`: the gate's close verdict. The plane's single session was taken by another screen and this
|
|
11
|
+
* tab latched the handoff (a contested kick), so no read of the plane is sent until the session is taken back.
|
|
12
|
+
* - `chart-kind`: the plane router. The chart is a kind whose options ride no plane yet (an index chart: its
|
|
13
|
+
* options list on OPRA, but the router sends no OPRA read for it).
|
|
14
|
+
* - `flag-off`: the flag check. The account's `opra` flag (a rollout flag, not a plan entitlement) is dark, so no
|
|
15
|
+
* US options read is made for it yet.
|
|
16
|
+
* The delayed tier is no stop reason here: the legend's tier note ("Delayed 15 min") already states the delay on
|
|
17
|
+
* every overlay whose OPRA reads rode the delayed reader, and one statement of it is enough.
|
|
18
|
+
*/
|
|
19
|
+
export type WrunOptionsStopReason = 'session-elsewhere' | 'chart-kind' | 'flag-off';
|
|
20
|
+
/** Every stop reason, closed: the class spec walks it, and a reason without a variant row fails it. */
|
|
21
|
+
export declare const WRUN_OPTIONS_STOP_REASONS: readonly WrunOptionsStopReason[];
|
|
4
22
|
export type WrunRefusalOut = {
|
|
5
23
|
kind: 'switch-market';
|
|
6
24
|
exchange: string;
|
|
@@ -40,6 +58,12 @@ export type WrunRefusalOut = {
|
|
|
40
58
|
* which loads the app the cloud speaks to. */
|
|
41
59
|
| {
|
|
42
60
|
kind: 'reload';
|
|
61
|
+
}
|
|
62
|
+
/** Another screen holds the plane's one session (`options-stopped` `session-elsewhere`): take it back here (the
|
|
63
|
+
* gate owner's resume, the handoff's Resume here), then run again. */
|
|
64
|
+
| {
|
|
65
|
+
kind: 'take-session';
|
|
66
|
+
plane: WrunRefusalGatePlane;
|
|
43
67
|
};
|
|
44
68
|
export interface WrunRefusalMarket {
|
|
45
69
|
exchange: string;
|
|
@@ -168,6 +192,17 @@ export declare const WRUN_REFUSAL_FEED_KEYS: Readonly<Record<string, string>>;
|
|
|
168
192
|
export declare function registerWrunRefusalFeedKeys(keys: Readonly<Record<string, string>>): void;
|
|
169
193
|
/** The full literal key of a feed's words, or undefined for a word that names no feed. */
|
|
170
194
|
export declare function wrunRefusalFeedKey(feed: unknown): string | undefined;
|
|
195
|
+
/**
|
|
196
|
+
* The seed of an options lane's stop (the one mapping from a stop reason to its record): the class is
|
|
197
|
+
* `options-stopped` and the variant is the reason itself, so every reason reads its own chip. The way out is the
|
|
198
|
+
* one that works for the reason: take the session back (`session-elsewhere`, on the plane `plane` names, OPRA when
|
|
199
|
+
* absent), the markets the Indicator works on (`chart-kind`, `flag-off`). `severity`: a note when the run drew
|
|
200
|
+
* around the lane, paused when nothing could be drawn.
|
|
201
|
+
*/
|
|
202
|
+
export declare function wrunOptionsStopSeed(reason: WrunOptionsStopReason, opts?: {
|
|
203
|
+
severity?: 'note' | 'paused';
|
|
204
|
+
plane?: WrunRefusalGatePlane;
|
|
205
|
+
}): WrunRefusalSeed;
|
|
171
206
|
/** The variants of a class, in C2 order (the spec walks every one). */
|
|
172
207
|
export declare function wrunRefusalVariants(cls: WrunRefusalClass): string[];
|
|
173
208
|
/** Equal records give equal strings: a fixed key order, the params sorted by key, the telemetry last (the join
|
|
@@ -243,6 +278,11 @@ export declare function wrunLeftOutRefusalSeed(family: string, code: string): Wr
|
|
|
243
278
|
* (a pin finer than every picker interval): the run-failed words.
|
|
244
279
|
*/
|
|
245
280
|
export declare function wrunPinFinerSeed(pinMs: number, strictlyFiner: boolean): WrunRefusalSeed;
|
|
281
|
+
/** Leg classes: an unseeded refusal of theirs names a pinned market the message alone does not
|
|
282
|
+
* give, so it keeps the generic words rather than name the chart's market wrongly. Every leg stream
|
|
283
|
+
* class is one (`candles`, `oi_candles`, `volume_profile_candles`: hand-copied from the web app's
|
|
284
|
+
* wrun-leg-stream-classes.ts, which the package cannot import; the web spec pins the copy). */
|
|
285
|
+
export declare const WRUN_REFUSAL_LEG_CLASSES: ReadonlySet<string>;
|
|
246
286
|
/** The seed `wrunRefusalFor` reads off a rejection (a cloud refusal by its code included). Never throws. */
|
|
247
287
|
export declare function wrunRefusalSeedFor(error: unknown, ctx: WrunRefusalContext): WrunRefusalSeed;
|
|
248
288
|
/**
|
|
@@ -39,6 +39,12 @@ import { isCalendarIntervalLabel } from '../chart/calendar-interval.util.js';
|
|
|
39
39
|
import { isWrunFailureCause, isWrunTransientFailureCause, wrunServerFailureCause, } from './wrun-failure-cause.js';
|
|
40
40
|
import { WRUN_KIT_REFUSAL_STAGES, WRUN_NO_CANDLES_CODE, wrunFrameRefusalOf, wrunKitRefusalStageOf, wrunServerAnswerOfText, wrunServerAnswerVerdict, } from './wrun-hosted-wire-caps.js';
|
|
41
41
|
import { WrunDeadlineError, WrunIntegrationError, WrunNoBarsError, WrunProvenTwinDeclinedError, WrunQuarantinedError, WrunRegistryAddRefusedError, WrunRegistryHostedOnlyError, WrunSourceDataUnavailableError, WrunWorkerPoisonError, } from './wrun-registry-errors.util.js';
|
|
42
|
+
/** Every stop reason, closed: the class spec walks it, and a reason without a variant row fails it. */
|
|
43
|
+
export const WRUN_OPTIONS_STOP_REASONS = Object.freeze([
|
|
44
|
+
'session-elsewhere',
|
|
45
|
+
'chart-kind',
|
|
46
|
+
'flag-off',
|
|
47
|
+
]);
|
|
42
48
|
/** Every class, in the C2 precedence order (paused before note decides first). */
|
|
43
49
|
export const WRUN_REFUSAL_CLASSES = Object.freeze([
|
|
44
50
|
'cme-wall',
|
|
@@ -46,6 +52,7 @@ export const WRUN_REFUSAL_CLASSES = Object.freeze([
|
|
|
46
52
|
'not-added',
|
|
47
53
|
'pin-refused',
|
|
48
54
|
'no-options',
|
|
55
|
+
'options-stopped',
|
|
49
56
|
'coin-outside-feed',
|
|
50
57
|
'interval-unserved',
|
|
51
58
|
'feed-missing',
|
|
@@ -77,6 +84,8 @@ export const WRUN_REFUSAL_EVENT_MARKET_KEY = 'wrun.refusal.market.event';
|
|
|
77
84
|
export const WRUN_REFUSAL_FEED_KEYS = Object.freeze({
|
|
78
85
|
ohlcv: 'wrun.refusal.feed.ohlcv',
|
|
79
86
|
candles: 'wrun.refusal.feed.candles',
|
|
87
|
+
oi_candles: 'wrun.refusal.feed.oiCandles',
|
|
88
|
+
volume_profile_candles: 'wrun.refusal.feed.volumeProfileCandles',
|
|
80
89
|
intrabar: 'wrun.refusal.feed.intrabar',
|
|
81
90
|
odds: 'wrun.refusal.feed.odds',
|
|
82
91
|
time: 'wrun.refusal.feed.time',
|
|
@@ -128,6 +137,16 @@ export function wrunRefusalFeedKey(feed) {
|
|
|
128
137
|
return Object.prototype.hasOwnProperty.call(laneFeedKeys, feed) ? laneFeedKeys[feed] : undefined;
|
|
129
138
|
}
|
|
130
139
|
const row = (sentence, chip, params, extra) => ({ sentence, chip, params, ...extra });
|
|
140
|
+
/**
|
|
141
|
+
* The `options-stopped` rows: ONE row per stop reason, typed by the reason word, so a reason without its own chip is
|
|
142
|
+
* a type error here and a failure of the class spec (tests/utility/wrun/wrun-options-stop.class.spec.ts). Each
|
|
143
|
+
* chip names the reason; none falls back to the generic "did not load" words.
|
|
144
|
+
*/
|
|
145
|
+
const OPTIONS_STOPPED_VARIANTS = {
|
|
146
|
+
'session-elsewhere': row('wrun.refusal.sentence.optionsSessionElsewhere', 'wrun.refusal.chip.optionsSessionElsewhere', ['name']),
|
|
147
|
+
'chart-kind': row('wrun.refusal.sentence.optionsChartKind', 'wrun.refusal.chip.optionsChartKind', ['name']),
|
|
148
|
+
'flag-off': row('wrun.refusal.sentence.optionsNotOnAccount', 'wrun.refusal.chip.optionsNotOnAccount', ['name']),
|
|
149
|
+
};
|
|
131
150
|
/** The C2 table. Keys are full literals (the boot scanner harvests them). */
|
|
132
151
|
const VARIANTS = {
|
|
133
152
|
'legs-empty': {
|
|
@@ -311,7 +330,31 @@ const VARIANTS = {
|
|
|
311
330
|
severity: 'note',
|
|
312
331
|
}),
|
|
313
332
|
},
|
|
333
|
+
// An options lane stopped for a reason the gate, the plane router or the flag check knows.
|
|
334
|
+
'options-stopped': OPTIONS_STOPPED_VARIANTS,
|
|
314
335
|
};
|
|
336
|
+
/**
|
|
337
|
+
* The seed of an options lane's stop (the one mapping from a stop reason to its record): the class is
|
|
338
|
+
* `options-stopped` and the variant is the reason itself, so every reason reads its own chip. The way out is the
|
|
339
|
+
* one that works for the reason: take the session back (`session-elsewhere`, on the plane `plane` names, OPRA when
|
|
340
|
+
* absent), the markets the Indicator works on (`chart-kind`, `flag-off`). `severity`: a note when the run drew
|
|
341
|
+
* around the lane, paused when nothing could be drawn.
|
|
342
|
+
*/
|
|
343
|
+
export function wrunOptionsStopSeed(reason, opts = {}) {
|
|
344
|
+
const severity = opts.severity !== undefined ? { severity: opts.severity } : {};
|
|
345
|
+
switch (reason) {
|
|
346
|
+
case 'session-elsewhere':
|
|
347
|
+
return {
|
|
348
|
+
cls: 'options-stopped',
|
|
349
|
+
variant: reason,
|
|
350
|
+
out: { kind: 'take-session', plane: opts.plane ?? 'opra' },
|
|
351
|
+
...severity,
|
|
352
|
+
};
|
|
353
|
+
case 'chart-kind':
|
|
354
|
+
case 'flag-off':
|
|
355
|
+
return { cls: 'options-stopped', variant: reason, out: { kind: 'works-on' }, ...severity };
|
|
356
|
+
}
|
|
357
|
+
}
|
|
315
358
|
/** The variants of a class, in C2 order (the spec walks every one). */
|
|
316
359
|
export function wrunRefusalVariants(cls) {
|
|
317
360
|
return Object.keys(VARIANTS[cls] ?? {});
|
|
@@ -359,6 +402,8 @@ function canonicalOut(value) {
|
|
|
359
402
|
return typeof value.line === 'number' && Number.isInteger(value.line) && value.line > 0
|
|
360
403
|
? { kind: 'go-to-line', line: value.line }
|
|
361
404
|
: undefined;
|
|
405
|
+
case 'take-session':
|
|
406
|
+
return value.plane === 'cme' || value.plane === 'opra' ? { kind: 'take-session', plane: value.plane } : undefined;
|
|
362
407
|
case 'works-on':
|
|
363
408
|
case 'open-settings':
|
|
364
409
|
case 'retry':
|
|
@@ -885,8 +930,19 @@ function tpoLetterSeed(letterMinutes, bars, ctx) {
|
|
|
885
930
|
return { cls: 'interval-unserved', variant: 'at-most', params: { interval, chartInterval: bars } };
|
|
886
931
|
}
|
|
887
932
|
/** Leg classes: an unseeded refusal of theirs names a pinned market the message alone does not
|
|
888
|
-
* give, so it keeps the generic words rather than name the chart's market wrongly.
|
|
889
|
-
|
|
933
|
+
* give, so it keeps the generic words rather than name the chart's market wrongly. Every leg stream
|
|
934
|
+
* class is one (`candles`, `oi_candles`, `volume_profile_candles`: hand-copied from the web app's
|
|
935
|
+
* wrun-leg-stream-classes.ts, which the package cannot import; the web spec pins the copy). */
|
|
936
|
+
export const WRUN_REFUSAL_LEG_CLASSES = new Set([
|
|
937
|
+
'ohlcv',
|
|
938
|
+
'candles',
|
|
939
|
+
'oi_candles',
|
|
940
|
+
'volume_profile_candles',
|
|
941
|
+
'intrabar',
|
|
942
|
+
'odds',
|
|
943
|
+
'time',
|
|
944
|
+
]);
|
|
945
|
+
const LEG_CLASSES = WRUN_REFUSAL_LEG_CLASSES;
|
|
890
946
|
/** The lane word of an unseeded "data is unavailable" refusal (`the <lane> source lane`), when it
|
|
891
947
|
* names a feed of the chart's own market. */
|
|
892
948
|
function laneFeedOf(message) {
|
|
@@ -1045,6 +1101,10 @@ function variantFor(seed, ctx) {
|
|
|
1045
1101
|
return declared !== undefined && variantSpec('not-added', declared) ? declared : 'gate';
|
|
1046
1102
|
case 'run-failed':
|
|
1047
1103
|
return declared !== undefined && variantSpec('run-failed', declared) ? declared : 'generic';
|
|
1104
|
+
// The variant IS the stop reason: there is no default reason to guess. An unknown word renders the generic words
|
|
1105
|
+
// (`renderSpec`), which the class spec forbids for every reason the lanes emit.
|
|
1106
|
+
case 'options-stopped':
|
|
1107
|
+
return declared ?? '';
|
|
1048
1108
|
default:
|
|
1049
1109
|
return 'default';
|
|
1050
1110
|
}
|
|
@@ -1152,6 +1212,11 @@ function defaultOut(cls, variant, ctx, params) {
|
|
|
1152
1212
|
// The same code, data and settings fail the same way (a transient cause seeds its own Retry):
|
|
1153
1213
|
// the source when it opens, else the report.
|
|
1154
1214
|
return ctx.editable ? { kind: 'open-editor' } : { kind: 'report' };
|
|
1215
|
+
// The way out each stop reason's seed names (`wrunOptionsStopSeed`), for a seed that named none.
|
|
1216
|
+
case 'options-stopped':
|
|
1217
|
+
if (variant === 'session-elsewhere')
|
|
1218
|
+
return { kind: 'take-session', plane: 'opra' };
|
|
1219
|
+
return { kind: 'works-on' };
|
|
1155
1220
|
}
|
|
1156
1221
|
}
|
|
1157
1222
|
/** A seed's own OUT, held to the flags: Open in editor only for an openable source, Open the
|
|
@@ -1441,6 +1506,8 @@ function outLabelOf(out, t) {
|
|
|
1441
1506
|
return t('wrunReport.legend.report');
|
|
1442
1507
|
case 'reload':
|
|
1443
1508
|
return t('dialogs.loadingTimeout.reloadApp');
|
|
1509
|
+
case 'take-session':
|
|
1510
|
+
return t('wrun.refusal.out.takeSession');
|
|
1444
1511
|
}
|
|
1445
1512
|
}
|
|
1446
1513
|
/** The longest detail line a surface shows. */
|
|
@@ -17,23 +17,10 @@ export declare class WrunRegistryAddRefusedError extends Error {
|
|
|
17
17
|
constructor(message?: string);
|
|
18
18
|
}
|
|
19
19
|
export declare function isWrunRegistryAddRefusedError(error: unknown): error is WrunRegistryAddRefusedError;
|
|
20
|
-
/** Thrown by the add chokepoint (wrun-registry-catalog.util
|
|
21
|
-
* addWrunRegistryPackage) for an official PORT (a package the twins join
|
|
22
|
-
* names) while the native indicators are off for the viewer
|
|
23
|
-
* (`wrun-native-indicators`, wrun-twins.util isWrunOfficialPackageLit):
|
|
24
|
-
* nothing resolves and nothing mounts. No door offers a port then (the
|
|
25
|
-
* OpenMarket group lists the built-ins and the originals, super search drops
|
|
26
|
-
* the port rows), so only a stale link or a leftover door reaches here; it
|
|
27
|
-
* subclasses the add refusal so no caller stacks a "failed to add" toast over
|
|
28
|
-
* a row the viewer was never offered. An ORIGINAL never meets it: it rides
|
|
29
|
-
* the Indicators section alone (WRUN-MARKET-SESSIONS C4). */
|
|
30
|
-
export declare class WrunNativeIndicatorsOffError extends WrunRegistryAddRefusedError {
|
|
31
|
-
constructor(packageName: string);
|
|
32
|
-
}
|
|
33
20
|
/** Why the proven route of a built-in's twin declined before anything mounted:
|
|
34
21
|
* the registry answered the pinned ask with another version, or the resolve
|
|
35
22
|
* failed (unreachable, past its deadline, unknown, the pin yanked or never
|
|
36
|
-
* published
|
|
23
|
+
* published). */
|
|
37
24
|
export type WrunProvenTwinDeclineReason = 'pin-mismatch' | 'resolve-failed';
|
|
38
25
|
/** Thrown by the proven route of a built-in's twin (option A,
|
|
39
26
|
* wrun-proven-twin-add.util) when it declined BEFORE anything mounted: the
|
|
@@ -21,22 +21,6 @@ export class WrunRegistryAddRefusedError extends Error {
|
|
|
21
21
|
export function isWrunRegistryAddRefusedError(error) {
|
|
22
22
|
return error instanceof WrunRegistryAddRefusedError;
|
|
23
23
|
}
|
|
24
|
-
/** Thrown by the add chokepoint (wrun-registry-catalog.util
|
|
25
|
-
* addWrunRegistryPackage) for an official PORT (a package the twins join
|
|
26
|
-
* names) while the native indicators are off for the viewer
|
|
27
|
-
* (`wrun-native-indicators`, wrun-twins.util isWrunOfficialPackageLit):
|
|
28
|
-
* nothing resolves and nothing mounts. No door offers a port then (the
|
|
29
|
-
* OpenMarket group lists the built-ins and the originals, super search drops
|
|
30
|
-
* the port rows), so only a stale link or a leftover door reaches here; it
|
|
31
|
-
* subclasses the add refusal so no caller stacks a "failed to add" toast over
|
|
32
|
-
* a row the viewer was never offered. An ORIGINAL never meets it: it rides
|
|
33
|
-
* the Indicators section alone (WRUN-MARKET-SESSIONS C4). */
|
|
34
|
-
export class WrunNativeIndicatorsOffError extends WrunRegistryAddRefusedError {
|
|
35
|
-
constructor(packageName) {
|
|
36
|
-
super(`'${packageName}' is an official Indicator, and the native indicators are off for this account`);
|
|
37
|
-
this.name = 'WrunNativeIndicatorsOffError';
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
24
|
/** Thrown by the proven route of a built-in's twin (option A,
|
|
41
25
|
* wrun-proven-twin-add.util) when it declined BEFORE anything mounted: the
|
|
42
26
|
* chart is untouched, and the caller adds the built-in's shipped template
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one row-source seam of a wrun Indicator (WRUN-PARITY-PLAN contract C7, wave 3).
|
|
3
|
+
*
|
|
4
|
+
* A wrun overlay's pass (`runWrunOverlayOnChart`, the live tick, the replay lane) asks ONE source
|
|
5
|
+
* for rows and never knows which: `SandboxWrunRowSource` (the browser lane: the engine worker and
|
|
6
|
+
* `wrun-source-rows.util.ts`) and `SocketWrunRowSource` (the cloud lane: the kScript socket worker
|
|
7
|
+
* and the socket row store) implement the same interface, so every surface a user meets (the
|
|
8
|
+
* legend, the HUD, the hover card, the children, the diagnostics, the load status) is built by the
|
|
9
|
+
* same code from the same batch shape. The lane is the author's publishing choice, read once from
|
|
10
|
+
* the record (`wrunRunTarget`), never a predicate in the pass.
|
|
11
|
+
*
|
|
12
|
+
* Rules every source honours:
|
|
13
|
+
* - It raises and lowers the load-status signals the own run uses (data-loading rule 2: derive,
|
|
14
|
+
* never set): the loading owner of `wrun-loading-owner.util.ts` and the legend loader.
|
|
15
|
+
* - It pages through the coverage planner's in-flight registry and dedupe table, never a registry
|
|
16
|
+
* of its own (`src/utility/chart/__fixtures__/fanout-golden/` stays untouched).
|
|
17
|
+
* - The render cap is one accounting on both lanes: the builder's budget on the lane's profile number
|
|
18
|
+
* (`createWrunRenderBudget`, refusing with the kit's `wrun_render_result_too_large`); a source never
|
|
19
|
+
* runs a second selection to charge it.
|
|
20
|
+
* - Refusals are the kit's codes (`WrunHostedRefusal`), rendered by `wrun-refusal.util.ts` on both
|
|
21
|
+
* lanes; no source carries a sentence. A refused family leaves the sheet the batch delivered
|
|
22
|
+
* (`wrunRowBatchDeliveredSheet`, the one rule the pass reads every batch by).
|
|
23
|
+
*/
|
|
24
|
+
import type { WrunHostedGrid, WrunHostedRefusal, WrunHostedWire } from './wrun-hosted-wire.util.js';
|
|
25
|
+
import type { RuntimeDiagnostic } from '../../interfaces/kscript-diagnostics.interface.js';
|
|
26
|
+
import type { WrunIndicatorMetadata } from '../../interfaces/wrun-runtime.interface.js';
|
|
27
|
+
/** The window a batch covers (ms, inclusive of the bar at `fromMs`, exclusive past `toMs`). */
|
|
28
|
+
export interface WrunRowWindow {
|
|
29
|
+
fromMs: number;
|
|
30
|
+
toMs: number;
|
|
31
|
+
}
|
|
32
|
+
/** What a source needs to create its session: the overlay, the package it runs and the chart facts. */
|
|
33
|
+
export interface WrunRowSourceIdentity {
|
|
34
|
+
chartIndex: number;
|
|
35
|
+
indicatorId: string;
|
|
36
|
+
/** `@scope/name` of the package; a draft carries the editor's draft ref instead. */
|
|
37
|
+
packageName: string;
|
|
38
|
+
version: string | null;
|
|
39
|
+
intervalSec: number;
|
|
40
|
+
exchange: string;
|
|
41
|
+
symbol: string;
|
|
42
|
+
}
|
|
43
|
+
/** The overlay's record as the source reads it: the sheet and the flat settings over its params
|
|
44
|
+
* (the dialog's storage types, the same record both lanes run with: contracts C1 and C4). */
|
|
45
|
+
export interface WrunRowSourceRecord {
|
|
46
|
+
sheet: WrunIndicatorMetadata;
|
|
47
|
+
settings: Record<string, unknown>;
|
|
48
|
+
/** The packed host fills (chart colours, interval, the market facts), keyed by the kit's host_fill words. */
|
|
49
|
+
hostFill: Record<string, unknown>;
|
|
50
|
+
}
|
|
51
|
+
/** A settings patch (contract C5): the changed flat values, `null` for a dropped value, plus the fills. */
|
|
52
|
+
export interface WrunRowSourcePatch {
|
|
53
|
+
settings: Record<string, unknown>;
|
|
54
|
+
hostFill?: Record<string, unknown>;
|
|
55
|
+
}
|
|
56
|
+
/** One row of a batch: the bar's open time and the module's outputs in sheet order (null = no value). */
|
|
57
|
+
export type WrunRow = WrunHostedWire['rows'][number];
|
|
58
|
+
/** The rows, cell grids, frames, handles and refusals a source answers for a window: the hosted
|
|
59
|
+
* wire's shape, which both lanes share (`wrunHost`, wrun-browser-runtime.md "The wire"). */
|
|
60
|
+
export interface WrunRowBatch {
|
|
61
|
+
window: WrunRowWindow;
|
|
62
|
+
/** Open of the newest bar the batch evaluated. */
|
|
63
|
+
asOfMs: number;
|
|
64
|
+
rows: WrunRow[];
|
|
65
|
+
grids: WrunHostedGrid[];
|
|
66
|
+
frames: WrunHostedWire['frames'];
|
|
67
|
+
handles: WrunHostedWire['handles'];
|
|
68
|
+
refusals: WrunHostedRefusal[];
|
|
69
|
+
/** The sheet the source ran (present on a create, absent on a range or a patch). */
|
|
70
|
+
sheet?: WrunIndicatorMetadata;
|
|
71
|
+
/** The run's strategy output (a strategy package's `StrategyOutput`, the run-level `strategy` key), when the
|
|
72
|
+
* source answered one. */
|
|
73
|
+
strategy?: unknown;
|
|
74
|
+
/** The diagnostics the source answered beside the rows (the cloud's), when it answered the field. */
|
|
75
|
+
diagnostics?: RuntimeDiagnostic[];
|
|
76
|
+
/** From a source keeping a session of its own: the overlay's session losses as the answer to the create that opened
|
|
77
|
+
* that session arrived, before its decode and its paging (`wrunSocketSessionLossCount`). The pass's install reads a
|
|
78
|
+
* loss noted since as the end of the session the batch came from (`wrunSessionInstallLost`). */
|
|
79
|
+
sessionLosses?: number;
|
|
80
|
+
/** The cloud run's OPRA mark (UW-PARITY contract opra-server-lanes 10b, the hosted reply's `output.wrunOpra`): true
|
|
81
|
+
* when the run's plan reads OPRA, which stamps the overlay's OPRA provenance before any row lands; false on a
|
|
82
|
+
* cloud result that names none, which sheds the stamp once its rows replaced the overlay's (under the provenance
|
|
83
|
+
* writer's own refusal); absent from a source that does not speak it (the browser lanes stamp their own runs). A
|
|
84
|
+
* live frame carries only true: a frame never clears the stamp. */
|
|
85
|
+
opra?: boolean;
|
|
86
|
+
}
|
|
87
|
+
/** A live frame: the same batch shape for the bars that moved since the last frame. */
|
|
88
|
+
export type WrunRowFrame = WrunRowBatch;
|
|
89
|
+
export type WrunRowFrameListener = (frame: WrunRowFrame) => void;
|
|
90
|
+
/** The live stream of a session: one listener at a time; `unsubscribe` stops it. */
|
|
91
|
+
export interface WrunRowFrameStream {
|
|
92
|
+
subscribe(listener: WrunRowFrameListener): () => void;
|
|
93
|
+
}
|
|
94
|
+
export interface WrunRowSource {
|
|
95
|
+
/** Create the session for `identity` over `window` and answer its first batch. `cancel`: the create's own cancel (its
|
|
96
|
+
* overlay left the chart while it was on its way): once it aborts, a source that sends its create elsewhere sends
|
|
97
|
+
* nothing more of it, and the pass drops whatever the create answers as superseded. */
|
|
98
|
+
create(identity: WrunRowSourceIdentity, record: WrunRowSourceRecord, window: WrunRowWindow, cancel?: AbortSignal): Promise<WrunRowBatch>;
|
|
99
|
+
/** Another window of the same session (a pan page, a gap repair). */
|
|
100
|
+
range(window: WrunRowWindow): Promise<WrunRowBatch>;
|
|
101
|
+
/** A compute edit or a host-fill move over the session's own window: never a recreate, never an interval. */
|
|
102
|
+
changeSettings(patch: WrunRowSourcePatch): Promise<WrunRowBatch>;
|
|
103
|
+
/** The session's live frames. */
|
|
104
|
+
readonly frames: WrunRowFrameStream;
|
|
105
|
+
/** Release the session; every raised load signal is lowered. */
|
|
106
|
+
teardown(): void;
|
|
107
|
+
}
|
|
108
|
+
/** The lane a record runs on: the author's publishing choice, read from the record once. */
|
|
109
|
+
export type WrunRowSourceKind = 'sandbox' | 'socket';
|
|
110
|
+
/** Why an ask answered nothing a source could merge: no reply at all, or a settle the transport laundered into a
|
|
111
|
+
* clean completion (a session kick, no connection or a permanently failed worker, the chart gone before the
|
|
112
|
+
* dispatch); the run capability not minted in time (`capability-unavailable`: the ask never went, and the mint keeps
|
|
113
|
+
* running, so the next ask resolves from it); the worker's request deadline (`request-timeout`: the ask went and no
|
|
114
|
+
* answer came in time); or a page of the rest of a window whose newest page answered, failed without a verdict of its
|
|
115
|
+
* own (`paging-incomplete`: the history the run asked for is incomplete). The kScript socket's own failures
|
|
116
|
+
* (kscript-transport-codes): the socket closed with the ask on it (`connection-lost`), the dial failed before the ask
|
|
117
|
+
* went (`dial-failed`), the keepalive retired a socket that stopped answering (`socket-stale`); an abort the ask's own
|
|
118
|
+
* signal did not cause (`aborted`); the data worker restarted under the ask (`worker-restarted`). */
|
|
119
|
+
export type WrunRowSourceTransientReason = 'no-reply' | 'session-kicked' | 'connection-unavailable' | 'chart-gone' | 'capability-unavailable' | 'request-timeout' | 'paging-incomplete' | 'connection-lost' | 'dial-failed' | 'socket-stale' | 'aborted' | 'worker-restarted';
|
|
120
|
+
/**
|
|
121
|
+
* An ask that answered nothing a source could merge, which the next ask may answer: never a refusal and never an
|
|
122
|
+
* empty success (an empty batch would integrate as a successful run with nothing drawn). The pass takes its retry
|
|
123
|
+
* path; the source left the session it held as it was. `cause`: the failure behind it, when one was raised (its words
|
|
124
|
+
* follow the reason, so the record's details keep them).
|
|
125
|
+
*/
|
|
126
|
+
export declare class WrunRowSourceTransientError extends Error {
|
|
127
|
+
readonly reason: WrunRowSourceTransientReason;
|
|
128
|
+
constructor(reason: WrunRowSourceTransientReason, cause?: unknown);
|
|
129
|
+
}
|
|
130
|
+
/** Structural check: a module duplicate under test still matches. */
|
|
131
|
+
export declare function isWrunRowSourceTransientError(error: unknown): error is WrunRowSourceTransientError;
|
|
132
|
+
/**
|
|
133
|
+
* What a `changeSettings` that failed left of the source's session when it is no longer the one the source's last
|
|
134
|
+
* batch stood for (contract C7, the wave-3 review round 3). The source marks its failure
|
|
135
|
+
* (`markWrunRowSourceSettingsLeft`) and the pass reads the mark (`wrunRowSourceSettingsLeftBy`), never the lane:
|
|
136
|
+
* - `moved`: the patch was answered, so the source's record, its session and its frames compute with the patched
|
|
137
|
+
* settings from here, though what followed failed (a page of the rest of the window the session covered was
|
|
138
|
+
* refused or failed: the source owes that window, and its next ask pages it first);
|
|
139
|
+
* - `unanswered`: the patch went out and no answer came in time, so what the session computes with is unknown: the
|
|
140
|
+
* source kept the settings and the rows it held, no live frame extends them, and the session is not to be asked
|
|
141
|
+
* again (the transport retires it and recreates it over the next ask's window alone).
|
|
142
|
+
* Either way the overlay's live context stands for a computation no session feeds any more.
|
|
143
|
+
*/
|
|
144
|
+
export type WrunRowSourceSettingsLeft = 'moved' | 'unanswered';
|
|
145
|
+
/** Mark a failed `changeSettings` with what it left of the session (above), and answer the failure to throw: a
|
|
146
|
+
* failure that is no object rides as an Error of its words, so it can carry the mark. */
|
|
147
|
+
export declare function markWrunRowSourceSettingsLeft(error: unknown, left: WrunRowSourceSettingsLeft): unknown;
|
|
148
|
+
/** What a failed `changeSettings` left of the session, when its source marked it (above). */
|
|
149
|
+
export declare function wrunRowSourceSettingsLeftBy(error: unknown): WrunRowSourceSettingsLeft | undefined;
|
|
150
|
+
/** The sheet a source delivered with its batch: every section a batch refusal names taken out (the kit
|
|
151
|
+
* shaper's own rule), so a refused family builds no child. Which top-level keys are sections is the
|
|
152
|
+
* kit's list (`sectionKinds`: `WRUN_SECTION_KINDS`, the one list every host reads, which the caller
|
|
153
|
+
* takes off the loaded host), never one of the chart's own: a key of the run itself (`params`,
|
|
154
|
+
* `inputs`, `outputs`, `alerts`, `layout`) is no drawn section and stays, and a dotted family names
|
|
155
|
+
* no key. The sheet itself when nothing goes. The one pass reads every source's batch by it. */
|
|
156
|
+
export declare function wrunRowBatchDeliveredSheet(sheet: WrunIndicatorMetadata, refusals: ReadonlyArray<{
|
|
157
|
+
family: string;
|
|
158
|
+
}>, sectionKinds: ReadonlyArray<string>): WrunIndicatorMetadata;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one row-source seam of a wrun Indicator (WRUN-PARITY-PLAN contract C7, wave 3).
|
|
3
|
+
*
|
|
4
|
+
* A wrun overlay's pass (`runWrunOverlayOnChart`, the live tick, the replay lane) asks ONE source
|
|
5
|
+
* for rows and never knows which: `SandboxWrunRowSource` (the browser lane: the engine worker and
|
|
6
|
+
* `wrun-source-rows.util.ts`) and `SocketWrunRowSource` (the cloud lane: the kScript socket worker
|
|
7
|
+
* and the socket row store) implement the same interface, so every surface a user meets (the
|
|
8
|
+
* legend, the HUD, the hover card, the children, the diagnostics, the load status) is built by the
|
|
9
|
+
* same code from the same batch shape. The lane is the author's publishing choice, read once from
|
|
10
|
+
* the record (`wrunRunTarget`), never a predicate in the pass.
|
|
11
|
+
*
|
|
12
|
+
* Rules every source honours:
|
|
13
|
+
* - It raises and lowers the load-status signals the own run uses (data-loading rule 2: derive,
|
|
14
|
+
* never set): the loading owner of `wrun-loading-owner.util.ts` and the legend loader.
|
|
15
|
+
* - It pages through the coverage planner's in-flight registry and dedupe table, never a registry
|
|
16
|
+
* of its own (`src/utility/chart/__fixtures__/fanout-golden/` stays untouched).
|
|
17
|
+
* - The render cap is one accounting on both lanes: the builder's budget on the lane's profile number
|
|
18
|
+
* (`createWrunRenderBudget`, refusing with the kit's `wrun_render_result_too_large`); a source never
|
|
19
|
+
* runs a second selection to charge it.
|
|
20
|
+
* - Refusals are the kit's codes (`WrunHostedRefusal`), rendered by `wrun-refusal.util.ts` on both
|
|
21
|
+
* lanes; no source carries a sentence. A refused family leaves the sheet the batch delivered
|
|
22
|
+
* (`wrunRowBatchDeliveredSheet`, the one rule the pass reads every batch by).
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* An ask that answered nothing a source could merge, which the next ask may answer: never a refusal and never an
|
|
26
|
+
* empty success (an empty batch would integrate as a successful run with nothing drawn). The pass takes its retry
|
|
27
|
+
* path; the source left the session it held as it was. `cause`: the failure behind it, when one was raised (its words
|
|
28
|
+
* follow the reason, so the record's details keep them).
|
|
29
|
+
*/
|
|
30
|
+
export class WrunRowSourceTransientError extends Error {
|
|
31
|
+
reason;
|
|
32
|
+
constructor(reason, cause) {
|
|
33
|
+
const behind = cause === undefined ? '' : `: ${cause instanceof Error ? cause.message : String(cause)}`;
|
|
34
|
+
super(`wrun row source answered nothing it could merge (${reason})${behind}`, cause === undefined ? {} : { cause });
|
|
35
|
+
this.name = 'WrunRowSourceTransientError';
|
|
36
|
+
this.reason = reason;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/** Structural check: a module duplicate under test still matches. */
|
|
40
|
+
export function isWrunRowSourceTransientError(error) {
|
|
41
|
+
return error instanceof Error && error.name === 'WrunRowSourceTransientError';
|
|
42
|
+
}
|
|
43
|
+
/** The mark's key: a plain string, so a module duplicate under test still reads it. */
|
|
44
|
+
const SETTINGS_LEFT_KEY = 'wrunRowSourceSettingsLeft';
|
|
45
|
+
/** Mark a failed `changeSettings` with what it left of the session (above), and answer the failure to throw: a
|
|
46
|
+
* failure that is no object rides as an Error of its words, so it can carry the mark. */
|
|
47
|
+
export function markWrunRowSourceSettingsLeft(error, left) {
|
|
48
|
+
const failure = typeof error === 'object' && error !== null ? error : new Error(String(error));
|
|
49
|
+
Object.defineProperty(failure, SETTINGS_LEFT_KEY, { value: left, configurable: true, writable: true });
|
|
50
|
+
return failure;
|
|
51
|
+
}
|
|
52
|
+
/** What a failed `changeSettings` left of the session, when its source marked it (above). */
|
|
53
|
+
export function wrunRowSourceSettingsLeftBy(error) {
|
|
54
|
+
if (typeof error !== 'object' || error === null)
|
|
55
|
+
return undefined;
|
|
56
|
+
const left = error[SETTINGS_LEFT_KEY];
|
|
57
|
+
return left === 'moved' || left === 'unanswered' ? left : undefined;
|
|
58
|
+
}
|
|
59
|
+
/** The sheet a source delivered with its batch: every section a batch refusal names taken out (the kit
|
|
60
|
+
* shaper's own rule), so a refused family builds no child. Which top-level keys are sections is the
|
|
61
|
+
* kit's list (`sectionKinds`: `WRUN_SECTION_KINDS`, the one list every host reads, which the caller
|
|
62
|
+
* takes off the loaded host), never one of the chart's own: a key of the run itself (`params`,
|
|
63
|
+
* `inputs`, `outputs`, `alerts`, `layout`) is no drawn section and stays, and a dotted family names
|
|
64
|
+
* no key. The sheet itself when nothing goes. The one pass reads every source's batch by it. */
|
|
65
|
+
export function wrunRowBatchDeliveredSheet(sheet, refusals, sectionKinds) {
|
|
66
|
+
const removed = refusals
|
|
67
|
+
.map((refusal) => refusal.family)
|
|
68
|
+
.filter((family) => sectionKinds.includes(family) && Object.hasOwn(sheet, family));
|
|
69
|
+
if (removed.length === 0)
|
|
70
|
+
return sheet;
|
|
71
|
+
const delivered = { ...sheet };
|
|
72
|
+
for (const family of removed)
|
|
73
|
+
delete delivered[family];
|
|
74
|
+
return delivered;
|
|
75
|
+
}
|