@orangecharts/wrun-chart-host 0.4.0 → 0.6.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 +17 -5
- package/dist/constants/exchange-names.leaf.d.ts +8 -0
- package/dist/constants/exchange-names.leaf.js +101 -0
- package/dist/constants/feature-flags.constants.js +7 -2
- package/dist/constants/kscript-data-interval-restrictions.constants.d.ts +15 -0
- package/dist/constants/kscript-data-interval-restrictions.constants.js +40 -0
- package/dist/constants/opra-compliance.constants.d.ts +19 -0
- package/dist/constants/opra-compliance.constants.js +19 -0
- package/dist/constants/replay-ladder.leaf.d.ts +30 -0
- package/dist/constants/replay-ladder.leaf.js +99 -0
- package/dist/constants/scriptEditor/cme-official-scripts.constants.d.ts +168 -0
- package/dist/constants/scriptEditor/cme-official-scripts.constants.js +398 -0
- package/dist/constants/scriptEditor/converted-script-id.leaf.d.ts +8 -0
- package/dist/constants/scriptEditor/converted-script-id.leaf.js +10 -0
- package/dist/constants/scriptEditor/execution.constants.d.ts +4 -0
- package/dist/constants/scriptEditor/execution.constants.js +14 -0
- package/dist/constants/wrun-prefix-safe.constants.d.ts +23 -0
- package/dist/constants/wrun-prefix-safe.constants.js +26 -0
- package/dist/host-env.d.ts +301 -22
- package/dist/host-env.js +15 -0
- package/dist/host-ports.types.d.ts +853 -29
- package/dist/index.d.ts +140 -2
- package/dist/index.js +140 -2
- package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +31 -0
- package/dist/instances/script-engine-worker-ohlcv-transfer.js +164 -0
- package/dist/interfaces/market-event.interface.d.ts +231 -0
- package/dist/interfaces/market-event.interface.js +15 -0
- package/dist/interfaces/opra-realtime.interface.d.ts +70 -134
- package/dist/interfaces/opra-realtime.interface.js +34 -59
- package/dist/interfaces/replay.interface.d.ts +285 -0
- package/dist/interfaces/replay.interface.js +1 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +88 -13
- package/dist/interfaces/wrun-runtime.interface.js +17 -3
- package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +1 -0
- package/dist/kscript-data/controls/live-ohlcv-merge.util.js +93 -0
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +5 -1
- package/dist/kscript-data/controls/live-trades-merge.util.js +2 -2
- package/dist/market-data/billing.interface.d.ts +219 -0
- package/dist/market-data/billing.interface.js +58 -0
- package/dist/market-data/venue-governed.util.d.ts +2 -0
- package/dist/market-data/venue-governed.util.js +10 -0
- package/dist/market-data/venue.d.ts +122 -0
- package/dist/market-data/venue.js +1 -0
- package/dist/market-data/venues/index.d.ts +97 -0
- package/dist/market-data/venues/index.js +33 -0
- package/dist/market-data/venues/opra.contract.copy.json +35 -0
- package/dist/market-data/venues/opra.d.ts +70 -0
- package/dist/market-data/venues/opra.js +74 -0
- package/dist/replay/replayIndicatorRows.d.ts +31 -0
- package/dist/replay/replayIndicatorRows.js +117 -0
- package/dist/replay/replayLadder.d.ts +85 -0
- package/dist/replay/replayLadder.js +388 -0
- package/dist/utility/auth/server-clock.util.d.ts +81 -0
- package/dist/utility/auth/server-clock.util.js +238 -0
- package/dist/utility/chart/builtin-identity.util.d.ts +18 -0
- package/dist/utility/chart/builtin-identity.util.js +51 -0
- package/dist/utility/chart/cache-alignment.util.d.ts +454 -0
- package/dist/utility/chart/cache-alignment.util.js +926 -0
- package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +15 -0
- package/dist/utility/chart/chart-data-fetch-generation.util.js +22 -0
- package/dist/utility/chart/chart-mount-epoch.util.d.ts +17 -0
- package/dist/utility/chart/chart-mount-epoch.util.js +61 -0
- package/dist/utility/chart/chart-time-domain.util.d.ts +12 -0
- package/dist/utility/chart/chart-time-domain.util.js +23 -0
- package/dist/utility/chart/color-customization.leaf.d.ts +10 -0
- package/dist/utility/chart/color-customization.leaf.js +16 -0
- package/dist/utility/chart/footprint-tick-grid.util.d.ts +106 -0
- package/dist/utility/chart/footprint-tick-grid.util.js +167 -0
- package/dist/utility/chart/gesture-timing.leaf.d.ts +29 -0
- package/dist/utility/chart/gesture-timing.leaf.js +29 -0
- package/dist/utility/chart/governed-contract-coin.util.d.ts +22 -0
- package/dist/utility/chart/governed-contract-coin.util.js +39 -0
- package/dist/utility/chart/host-bar-placement.util.d.ts +107 -0
- package/dist/utility/chart/host-bar-placement.util.js +447 -0
- package/dist/utility/chart/index-host-tier.util.d.ts +31 -0
- package/dist/utility/chart/index-host-tier.util.js +118 -0
- package/dist/utility/chart/index-mode-admission.util.d.ts +34 -0
- package/dist/utility/chart/index-mode-admission.util.js +67 -0
- package/dist/utility/chart/indicator-error-message.util.d.ts +35 -0
- package/dist/utility/chart/indicator-error-message.util.js +44 -0
- package/dist/utility/chart/kscript-apply-fingerprint.util.d.ts +65 -0
- package/dist/utility/chart/kscript-apply-fingerprint.util.js +357 -0
- package/dist/utility/chart/kscript-chart-flush.leaf.d.ts +22 -0
- package/dist/utility/chart/kscript-chart-flush.leaf.js +13 -0
- package/dist/utility/chart/kscript-data-interval-restriction.leaf.d.ts +6 -0
- package/dist/utility/chart/kscript-data-interval-restriction.leaf.js +27 -0
- package/dist/utility/chart/kscript-integration-decision.leaf.d.ts +89 -0
- package/dist/utility/chart/kscript-integration-decision.leaf.js +80 -0
- package/dist/utility/chart/kscript-live-coalesce.util.d.ts +76 -0
- package/dist/utility/chart/kscript-live-coalesce.util.js +156 -0
- package/dist/utility/chart/kscript-live-rest-pace.util.d.ts +34 -0
- package/dist/utility/chart/kscript-live-rest-pace.util.js +134 -0
- package/dist/utility/chart/kscript-live-source-identity.util.d.ts +98 -0
- package/dist/utility/chart/kscript-live-source-identity.util.js +121 -0
- package/dist/utility/chart/kscript-mounted-plot-set.leaf.d.ts +48 -0
- package/dist/utility/chart/kscript-mounted-plot-set.leaf.js +145 -0
- package/dist/utility/chart/kscript-perf-tracker.util.d.ts +243 -0
- package/dist/utility/chart/kscript-perf-tracker.util.js +522 -0
- package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +43 -0
- package/dist/utility/chart/kscript-run-interval-projection.util.js +471 -0
- package/dist/utility/chart/kscript-run-result-equality.util.d.ts +38 -0
- package/dist/utility/chart/kscript-run-result-equality.util.js +89 -0
- package/dist/utility/chart/kscript-settings-revision.leaf.d.ts +2 -0
- package/dist/utility/chart/kscript-settings-revision.leaf.js +12 -0
- package/dist/utility/chart/kscript-source-degrade.leaf.d.ts +63 -0
- package/dist/utility/chart/kscript-source-degrade.leaf.js +68 -0
- package/dist/utility/chart/kscript-source-retention.util.d.ts +134 -0
- package/dist/utility/chart/kscript-source-retention.util.js +218 -0
- package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +57 -0
- package/dist/utility/chart/kscript-standin-identity.leaf.js +61 -0
- package/dist/utility/chart/kscript-titancharts-preparation.util.d.ts +15 -0
- package/dist/utility/chart/kscript-titancharts-preparation.util.js +376 -0
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +9 -0
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +130 -0
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +217 -0
- package/dist/utility/chart/kscript-venue-policy.util.js +324 -0
- package/dist/utility/chart/live-cadence.util.d.ts +38 -0
- package/dist/utility/chart/live-cadence.util.js +37 -0
- package/dist/utility/chart/live-feed-series-match.leaf.d.ts +13 -0
- package/dist/utility/chart/live-feed-series-match.leaf.js +21 -0
- package/dist/utility/chart/local-engine-self-heal-backoff.util.d.ts +46 -0
- package/dist/utility/chart/local-engine-self-heal-backoff.util.js +46 -0
- package/dist/utility/chart/local-engine-uninit.leaf.d.ts +21 -0
- package/dist/utility/chart/local-engine-uninit.leaf.js +22 -0
- package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +62 -0
- package/dist/utility/chart/local-kscript-source-revalidation.util.js +123 -0
- package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +214 -0
- package/dist/utility/chart/local-kscript-warmup-depth.util.js +376 -0
- package/dist/utility/chart/local-technical-script-live-apply-coalescer.util.d.ts +85 -0
- package/dist/utility/chart/local-technical-script-live-apply-coalescer.util.js +197 -0
- package/dist/utility/chart/local-technical-script-range.leaf.d.ts +72 -0
- package/dist/utility/chart/local-technical-script-range.leaf.js +126 -0
- package/dist/utility/chart/mixed-mode.util.d.ts +167 -0
- package/dist/utility/chart/mixed-mode.util.js +139 -0
- package/dist/utility/chart/ohlcv-row-readiness.util.d.ts +36 -0
- package/dist/utility/chart/ohlcv-row-readiness.util.js +90 -0
- package/dist/utility/chart/opra-user-scripts-gate.util.d.ts +19 -0
- package/dist/utility/chart/opra-user-scripts-gate.util.js +32 -0
- package/dist/utility/chart/overlay-execution-guard-key.leaf.d.ts +8 -0
- package/dist/utility/chart/overlay-execution-guard-key.leaf.js +10 -0
- package/dist/utility/chart/price-precision.util.d.ts +40 -0
- package/dist/utility/chart/price-precision.util.js +70 -0
- package/dist/utility/chart/profile-block-size.util.d.ts +64 -0
- package/dist/utility/chart/profile-block-size.util.js +141 -0
- package/dist/utility/chart/protected-kscript-degenerate-rows.leaf.d.ts +11 -0
- package/dist/utility/chart/protected-kscript-degenerate-rows.leaf.js +29 -0
- package/dist/utility/chart/protected-kscript-empty-output.util.d.ts +28 -0
- package/dist/utility/chart/protected-kscript-empty-output.util.js +84 -0
- package/dist/utility/chart/run-interval-unservable.leaf.d.ts +9 -0
- package/dist/utility/chart/run-interval-unservable.leaf.js +20 -0
- package/dist/utility/chart/run-interval-warmup.leaf.d.ts +19 -0
- package/dist/utility/chart/run-interval-warmup.leaf.js +35 -0
- package/dist/utility/chart/titan-constants.pin.d.ts +9 -5
- package/dist/utility/chart/titan-constants.pin.js +18 -5
- package/dist/utility/chart/warmup-backfill-retry.leaf.d.ts +9 -0
- package/dist/utility/chart/warmup-backfill-retry.leaf.js +9 -0
- package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +11 -2
- package/dist/utility/chart/wrun-bar-session-facts.util.js +10 -3
- package/dist/utility/chart/wrun-run-result.util.d.ts +5 -1
- package/dist/utility/chart/wrun-run-result.util.js +20 -14
- package/dist/utility/common/data-processing.util.d.ts +138 -0
- package/dist/utility/common/data-processing.util.js +346 -0
- package/dist/utility/common/visible-timeout.util.d.ts +13 -4
- package/dist/utility/common/visible-timeout.util.js +23 -8
- package/dist/utility/exchange-format.leaf.d.ts +1 -0
- package/dist/utility/exchange-format.leaf.js +47 -0
- package/dist/utility/market-events/earnings-scope.util.d.ts +60 -0
- package/dist/utility/market-events/earnings-scope.util.js +92 -0
- package/dist/utility/market-events/market-events.util.d.ts +147 -0
- package/dist/utility/market-events/market-events.util.js +392 -0
- package/dist/utility/market-events/zoned-clock.util.d.ts +1 -0
- package/dist/utility/market-events/zoned-clock.util.js +11 -0
- package/dist/utility/options/option-venue-disclosure.util.d.ts +43 -0
- package/dist/utility/options/option-venue-disclosure.util.js +56 -0
- package/dist/utility/scriptEditor/package-semver.util.d.ts +51 -0
- package/dist/utility/scriptEditor/package-semver.util.js +120 -0
- package/dist/utility/scriptEditor/temp-script-id.util.d.ts +18 -0
- package/dist/utility/scriptEditor/temp-script-id.util.js +25 -0
- package/dist/utility/symbol-selection/markets-request-from-symbols.leaf.d.ts +20 -0
- package/dist/utility/symbol-selection/markets-request-from-symbols.leaf.js +81 -0
- package/dist/utility/v2/governed-tier.leaf.d.ts +103 -0
- package/dist/utility/v2/governed-tier.leaf.js +113 -0
- package/dist/utility/watchlist/import/import-request.leaf.d.ts +10 -0
- package/dist/utility/watchlist/import/import-request.leaf.js +10 -0
- package/dist/utility/wrun/sources/lanes/series.js +2 -2
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +4 -4
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +5 -6
- package/dist/utility/wrun/wrun-alert-outputs.registry.d.ts +166 -0
- package/dist/utility/wrun/wrun-alert-outputs.registry.js +219 -0
- package/dist/utility/wrun/wrun-bar-count.util.d.ts +94 -0
- package/dist/utility/wrun/wrun-bar-count.util.js +274 -0
- package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +84 -0
- package/dist/utility/wrun/wrun-chart-context-names.util.js +186 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +253 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +731 -0
- package/dist/utility/wrun/wrun-cloud-opra-stamp.util.d.ts +28 -0
- package/dist/utility/wrun/wrun-cloud-opra-stamp.util.js +45 -0
- package/dist/utility/wrun/wrun-coin-lane-live.util.d.ts +18 -0
- package/dist/utility/wrun/wrun-coin-lane-live.util.js +47 -0
- package/dist/utility/wrun/wrun-deadline.util.js +2 -1
- package/dist/utility/wrun/wrun-debug-output.util.d.ts +39 -0
- package/dist/utility/wrun/wrun-debug-output.util.js +63 -0
- package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +113 -0
- package/dist/utility/wrun/wrun-declared-warmup.util.js +181 -0
- package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +43 -0
- package/dist/utility/wrun/wrun-draft-legend-note.util.js +158 -0
- package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +181 -0
- package/dist/utility/wrun/wrun-draft-overlay.util.js +357 -0
- package/dist/utility/wrun/wrun-draw-skipped.leaf.d.ts +16 -0
- package/dist/utility/wrun/wrun-draw-skipped.leaf.js +16 -0
- package/dist/utility/wrun/wrun-earnings-facts.util.d.ts +42 -0
- package/dist/utility/wrun/wrun-earnings-facts.util.js +131 -0
- package/dist/utility/wrun/wrun-first-run-depth.util.d.ts +32 -0
- package/dist/utility/wrun/wrun-first-run-depth.util.js +118 -0
- package/dist/utility/wrun/wrun-gate-plane-readers.util.d.ts +24 -0
- package/dist/utility/wrun/wrun-gate-plane-readers.util.js +31 -0
- package/dist/utility/wrun/wrun-held-lanes.util.d.ts +32 -0
- package/dist/utility/wrun/wrun-held-lanes.util.js +94 -0
- package/dist/utility/wrun/wrun-host-visible-clock.util.d.ts +2 -0
- package/dist/utility/wrun/wrun-host-visible-clock.util.js +17 -0
- package/dist/utility/wrun/wrun-host.service.d.ts +330 -0
- package/dist/utility/wrun/wrun-host.service.js +855 -0
- package/dist/utility/wrun/wrun-hover.util.d.ts +3 -0
- package/dist/utility/wrun/wrun-hover.util.js +25 -4
- package/dist/utility/wrun/wrun-inert-legend.util.d.ts +33 -0
- package/dist/utility/wrun/wrun-inert-legend.util.js +125 -0
- package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +155 -0
- package/dist/utility/wrun/wrun-input-requirements.leaf.js +450 -0
- package/dist/utility/wrun/wrun-integration-route.util.d.ts +51 -0
- package/dist/utility/wrun/wrun-integration-route.util.js +59 -0
- package/dist/utility/wrun/wrun-latest-history.leaf.d.ts +8 -0
- package/dist/utility/wrun/wrun-latest-history.leaf.js +8 -0
- package/dist/utility/wrun/wrun-legend-hover.lazy.d.ts +12 -0
- package/dist/utility/wrun/wrun-legend-hover.lazy.js +96 -0
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.d.ts +21 -0
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.js +21 -0
- package/dist/utility/wrun/wrun-live-hidden-hold.util.d.ts +23 -0
- package/dist/utility/wrun/wrun-live-hidden-hold.util.js +13 -0
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +374 -0
- package/dist/utility/wrun/wrun-live-intake.util.js +2027 -0
- package/dist/utility/wrun/wrun-live-patch.util.d.ts +116 -0
- package/dist/utility/wrun/wrun-live-patch.util.js +523 -0
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +619 -0
- package/dist/utility/wrun/wrun-live-tick.util.js +4974 -0
- package/dist/utility/wrun/wrun-loading-owner.util.d.ts +58 -0
- package/dist/utility/wrun/wrun-loading-owner.util.js +89 -0
- package/dist/utility/wrun/wrun-official-scope.leaf.d.ts +29 -0
- package/dist/utility/wrun/wrun-official-scope.leaf.js +36 -0
- package/dist/utility/wrun/wrun-oi-lane.util.d.ts +27 -0
- package/dist/utility/wrun/wrun-oi-lane.util.js +42 -0
- package/dist/utility/wrun/wrun-options-stop.util.d.ts +52 -0
- package/dist/utility/wrun/wrun-options-stop.util.js +123 -0
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +719 -0
- package/dist/utility/wrun/wrun-overlay-drivers.util.js +1180 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.d.ts +50 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.js +131 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +118 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +466 -0
- package/dist/utility/wrun/wrun-overlay-metadata.util.d.ts +45 -0
- package/dist/utility/wrun/wrun-overlay-metadata.util.js +112 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +114 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +971 -0
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +858 -0
- package/dist/utility/wrun/wrun-overlay-run.util.js +11013 -0
- package/dist/utility/wrun/wrun-pack.util.d.ts +2 -1
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +24 -9
- package/dist/utility/wrun/wrun-panel-mount.util.js +138 -43
- package/dist/utility/wrun/wrun-param-map.util.d.ts +19 -4
- package/dist/utility/wrun/wrun-param-map.util.js +40 -47
- package/dist/utility/wrun/wrun-param-values.util.d.ts +9 -3
- package/dist/utility/wrun/wrun-param-values.util.js +5 -5
- package/dist/utility/wrun/wrun-prefix-cohort.util.d.ts +93 -0
- package/dist/utility/wrun/wrun-prefix-cohort.util.js +484 -0
- package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +114 -0
- package/dist/utility/wrun/wrun-prefix-lanes.util.js +486 -0
- package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +317 -0
- package/dist/utility/wrun/wrun-prefix-proof.util.js +630 -0
- package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +73 -0
- package/dist/utility/wrun/wrun-refusal-surface.util.js +380 -0
- package/dist/utility/wrun/wrun-refusal-text.util.d.ts +15 -0
- package/dist/utility/wrun/wrun-refusal-text.util.js +40 -0
- package/dist/utility/wrun/wrun-registry-errors.util.d.ts +5 -3
- package/dist/utility/wrun/wrun-replay-lane.util.d.ts +139 -0
- package/dist/utility/wrun/wrun-replay-lane.util.js +520 -0
- package/dist/utility/wrun/wrun-replay-rows.util.d.ts +21 -0
- package/dist/utility/wrun/wrun-replay-rows.util.js +172 -0
- package/dist/utility/wrun/wrun-row-source-factory.d.ts +53 -0
- package/dist/utility/wrun/wrun-row-source-factory.js +435 -0
- package/dist/utility/wrun/wrun-run-cells.util.d.ts +36 -0
- package/dist/utility/wrun/wrun-run-cells.util.js +46 -0
- package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +133 -0
- package/dist/utility/wrun/wrun-run-interval-session.util.js +121 -0
- package/dist/utility/wrun/wrun-run-interval.util.d.ts +98 -0
- package/dist/utility/wrun/wrun-run-interval.util.js +207 -0
- package/dist/utility/wrun/wrun-run-retained.util.d.ts +122 -0
- package/dist/utility/wrun/wrun-run-retained.util.js +255 -0
- package/dist/utility/wrun/wrun-sandbox-row-source.d.ts +184 -0
- package/dist/utility/wrun/wrun-sandbox-row-source.js +444 -0
- package/dist/utility/wrun/wrun-script-inputs.util.js +4 -4
- package/dist/utility/wrun/wrun-series-stream.util.d.ts +86 -0
- package/dist/utility/wrun/wrun-series-stream.util.js +537 -0
- package/dist/utility/wrun/wrun-sha256.leaf.d.ts +13 -0
- package/dist/utility/wrun/wrun-sha256.leaf.js +84 -0
- package/dist/utility/wrun/wrun-sheet-remembered.util.d.ts +21 -0
- package/dist/utility/wrun/wrun-sheet-remembered.util.js +36 -0
- package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.d.ts +7 -0
- package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.js +12 -0
- package/dist/utility/wrun/wrun-socket-row-source.js +4 -2
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +175 -3
- package/dist/utility/wrun/wrun-source-rows.util.js +294 -8
- package/dist/utility/wrun/wrun-stats-strip.util.d.ts +46 -0
- package/dist/utility/wrun/wrun-stats-strip.util.js +87 -0
- package/dist/utility/wrun/wrun-table-chrome.util.d.ts +163 -0
- package/dist/utility/wrun/wrun-table-chrome.util.js +557 -0
- package/dist/utility/wrun/wrun-text-params.util.d.ts +11 -6
- package/dist/utility/wrun/wrun-text-params.util.js +19 -30
- package/dist/utility/wrun/wrun-transient-rerun.util.d.ts +64 -0
- package/dist/utility/wrun/wrun-transient-rerun.util.js +317 -0
- package/dist/utility/wrun/wrun-twin-lookback.util.d.ts +10 -0
- package/dist/utility/wrun/wrun-twin-lookback.util.js +43 -0
- package/dist/utility/wrun/wrun-warmup-head-store.util.d.ts +41 -0
- package/dist/utility/wrun/wrun-warmup-head-store.util.js +120 -0
- package/dist/utility/wrun-alert-params.leaf.d.ts +24 -0
- package/dist/utility/wrun-alert-params.leaf.js +24 -0
- package/dist/utils/replay/replay-buffer-math.d.ts +148 -0
- package/dist/utils/replay/replay-buffer-math.js +684 -0
- package/dist/workers/wrun/wrun-abi-host.d.ts +203 -0
- package/dist/workers/wrun/wrun-abi-host.js +1220 -0
- package/dist/workers/wrun/wrun-engine-handler.d.ts +20 -0
- package/dist/workers/wrun/wrun-engine-handler.js +380 -0
- package/package.json +3 -3
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What every input of an Indicator needs from a market (contract C5) and the run's admission (the capability rule), the
|
|
3
|
+
* names the wrun executor reads (a leaf of utility/wrun/wrun-input-requirements.util.ts; P2/inventory.md section 1.1):
|
|
4
|
+
* the requirement table, the requirements of an effective sheet, the fill an input reads over an empty lane, and the
|
|
5
|
+
* lanes the chart's fetch never serves on a market. Pure: it reads package modules (the leg stream classes, the option
|
|
6
|
+
* summary lanes, the row lane registry, the market facts) and the index-mode admission, so it moves into the
|
|
7
|
+
* chart-host package with the phase 2 closure. The requirements module keeps the market meeting, the OPRA plane reads
|
|
8
|
+
* and the switch target (`market.switchTargetFor`), imports back the helpers its pre-fetch verdict shares with the
|
|
9
|
+
* admission, and re-exports every public name. The two lookup tables (`WRUN_ADMISSION_LANES`, `WRUN_STATE_LANES`) stay
|
|
10
|
+
* `const` read-only tables over literals, never written (the phase 2 leaf-state guard's immutable form).
|
|
11
|
+
*/
|
|
12
|
+
import { Intervals } from '../../constants/interval.constants.js';
|
|
13
|
+
import { wrunLaneServiceOnMarket } from '../chart/index-mode-admission.util.js';
|
|
14
|
+
import { wrunFollowsCoin } from './wrun-market-facts.util.js';
|
|
15
|
+
import { WRUN_OPTION_SUMMARY_LANES } from './wrun-option-summary-lane.util.js';
|
|
16
|
+
import { wrunRowLaneClasses, wrunRowLaneOfClass } from './sources/row-lane-registry.js';
|
|
17
|
+
import { WRUN_LEG_STREAM_CLASSES, WRUN_LEG_STREAM_CLASS_NAMES, isWrunLaneStreamClass, isWrunLegStreamClass, } from './wrun-leg-stream-classes.js';
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
// The table
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
/** The leg stream classes over a lane of their own (`oi_candles`, `volume_profile_candles`), in the table's order. */
|
|
22
|
+
const LANE_STREAM_CLASSES = WRUN_LEG_STREAM_CLASS_NAMES.filter(isWrunLaneStreamClass);
|
|
23
|
+
/** The gateway type each chart-market class's lane fetches (its K control's data type). */
|
|
24
|
+
export const CHART_MARKET_GATEWAY_TYPES = Object.freeze({
|
|
25
|
+
// A lane stream reads its class's gateway type on the chart's market (wrun-leg-stream-classes).
|
|
26
|
+
...Object.fromEntries(LANE_STREAM_CLASSES.map((cls) => [cls, WRUN_LEG_STREAM_CLASSES[cls].gatewayType])),
|
|
27
|
+
book: 'BLOCK_BOOK_SNAPSHOT_AGG',
|
|
28
|
+
trades: 'TRADE_AGG',
|
|
29
|
+
oi: 'OPEN_INTEREST_AGG',
|
|
30
|
+
volume_profile: 'VOLUME_PROFILE_AGG',
|
|
31
|
+
trade_volume_by_size: 'TRADE_VOLUME_BY_SIZE_AGG',
|
|
32
|
+
// The tape's live prints ride the raw TRADE channel (its history reads TRADE_LARGE, a copy of the
|
|
33
|
+
// same prints): the markets that list raw trades.
|
|
34
|
+
tape: 'TRADE',
|
|
35
|
+
liquidations: 'LIQUIDATION_AGG',
|
|
36
|
+
funding: 'FUNDING_RATE_AGG',
|
|
37
|
+
long_short_ratio: 'LONG_SHORT_RATIO_AGG',
|
|
38
|
+
});
|
|
39
|
+
/** K_OHLCV's gateway type: the chart market's candles an intrabar input slices into its rows. */
|
|
40
|
+
export const K_OHLCV_GATEWAY_TYPE = 'TRADE_SIDE_AGNOSTIC_AGG';
|
|
41
|
+
/** The tape exists on 1m charts up to the week (the run pass's interval policy: K_TRADES is
|
|
42
|
+
* restricted below a minute, and calendar bars are not served). */
|
|
43
|
+
const TAPE_MIN_INTERVAL_MS = Intervals.MINUTE;
|
|
44
|
+
const TAPE_MAX_INTERVAL_MS = Intervals.MONTH - 1;
|
|
45
|
+
/** Long/short ratios exist on 5m and coarser charts (`long_short_ratio.ts`). */
|
|
46
|
+
const LONG_SHORT_RATIO_MIN_INTERVAL_MS = 5 * Intervals.MINUTE;
|
|
47
|
+
/** ETF holdings: a 1m or coarser chart, finer than a week (`etf_holdings.ts`). */
|
|
48
|
+
const ETF_HOLDINGS_MIN_INTERVAL_MS = Intervals.MINUTE;
|
|
49
|
+
const ETF_HOLDINGS_MAX_INTERVAL_MS = Intervals.WEEK - 1;
|
|
50
|
+
/** Prediction markets ride MINUTE and coarser charts (the odds planner's floor). */
|
|
51
|
+
const ODDS_MIN_INTERVAL_MS = Intervals.MINUTE;
|
|
52
|
+
const ODDS_EXCHANGE = 'POLYMARKET';
|
|
53
|
+
/** The coins with listed spot ETFs (`ETF_COVERED_COINS`, copied: that module drags the i18n
|
|
54
|
+
* catalog; the spec pins the copy). */
|
|
55
|
+
export const WRUN_ETF_COVERED_COINS = Object.freeze(['BTC', 'ETH', 'SOL']);
|
|
56
|
+
/** The coins the options flow lanes, DVOL and Ethena serve (each lane's own gate), and the
|
|
57
|
+
* option summary's implied volatility and skew (`WRUN_OPTION_SUMMARY_COINS`, the run pass's
|
|
58
|
+
* coin table: no other coin's chart is asked for them). */
|
|
59
|
+
const BTC_ETH = Object.freeze(['BTC', 'ETH']);
|
|
60
|
+
/** The options flow lanes' venue words and the exchange each names. */
|
|
61
|
+
const OPTIONS_FLOW_PROVIDERS = Object.freeze({
|
|
62
|
+
deribit: 'DERIBIT',
|
|
63
|
+
binance: 'BINANCE_OPTIONS',
|
|
64
|
+
});
|
|
65
|
+
/** The om interval words a chart interval may be spelled in (the fixed spans), beside the chart's
|
|
66
|
+
* own labels. */
|
|
67
|
+
const OM_INTERVAL_WORDS = Object.freeze({
|
|
68
|
+
MINUTE: '1m',
|
|
69
|
+
FIVE_MINUTES: '5m',
|
|
70
|
+
FIFTEEN_MINUTES: '15m',
|
|
71
|
+
THIRTY_MINUTES: '30m',
|
|
72
|
+
HOUR: '1h',
|
|
73
|
+
FOUR_HOURS: '4h',
|
|
74
|
+
DAY: '1d',
|
|
75
|
+
WEEK: '1w',
|
|
76
|
+
});
|
|
77
|
+
export function intervalSpanMs(word) {
|
|
78
|
+
if (typeof word !== 'string' || word === '')
|
|
79
|
+
return undefined;
|
|
80
|
+
const spelling = OM_INTERVAL_WORDS[word] ?? word;
|
|
81
|
+
const ms = Intervals.map_unit[spelling];
|
|
82
|
+
return typeof ms === 'number' && Number.isFinite(ms) && ms > 0 ? ms : undefined;
|
|
83
|
+
}
|
|
84
|
+
function text(value) {
|
|
85
|
+
return typeof value === 'string' ? value : '';
|
|
86
|
+
}
|
|
87
|
+
const pinnedOf = (source) => ({
|
|
88
|
+
kind: 'pinned',
|
|
89
|
+
exchange: text(source.exchange),
|
|
90
|
+
symbol: text(source.symbol),
|
|
91
|
+
});
|
|
92
|
+
const hasPin = (source) => source.symbol !== undefined || source.exchange !== undefined;
|
|
93
|
+
const chartMarket = (sourceClass, extra) => ({
|
|
94
|
+
kind: 'chart-market',
|
|
95
|
+
sourceClass,
|
|
96
|
+
gatewayType: CHART_MARKET_GATEWAY_TYPES[sourceClass] ?? '',
|
|
97
|
+
...extra,
|
|
98
|
+
});
|
|
99
|
+
/**
|
|
100
|
+
* One row per class: the requirement of an input of that class, or null when the input needs
|
|
101
|
+
* nothing from a market (the chart's own candles, `time`). Classes outside the table are unknown.
|
|
102
|
+
*/
|
|
103
|
+
const REQUIREMENT_ROWS = {
|
|
104
|
+
ohlcv: (source) => (hasPin(source) ? pinnedOf(source) : null),
|
|
105
|
+
candles: (source) => (hasPin(source) ? pinnedOf(source) : null),
|
|
106
|
+
// A lane stream (an open-interest or volume-profile leg): the chart market's feed of its class, or its pinned
|
|
107
|
+
// market (judged there by the run's admission, wrunUnservedLanes).
|
|
108
|
+
...Object.fromEntries(LANE_STREAM_CLASSES.map((cls) => [cls, (source) => (hasPin(source) ? pinnedOf(source) : chartMarket(cls))])),
|
|
109
|
+
time: () => null,
|
|
110
|
+
// The chart's candles at any interval: kScript's ltf() rule, a leg never refused for its span
|
|
111
|
+
// against the chart's (an equal or coarser leg brings at most one candle to a row; the cell
|
|
112
|
+
// capacity stays the leg's own check at run).
|
|
113
|
+
intrabar: (source) => hasPin(source)
|
|
114
|
+
? pinnedOf(source)
|
|
115
|
+
: { kind: 'chart-market', sourceClass: 'intrabar', gatewayType: K_OHLCV_GATEWAY_TYPE },
|
|
116
|
+
odds: (source) => ({
|
|
117
|
+
kind: 'pinned',
|
|
118
|
+
exchange: ODDS_EXCHANGE,
|
|
119
|
+
symbol: text(source.symbol).toLowerCase(),
|
|
120
|
+
minIntervalMs: ODDS_MIN_INTERVAL_MS,
|
|
121
|
+
}),
|
|
122
|
+
trades: () => chartMarket('trades'),
|
|
123
|
+
oi: () => chartMarket('oi'),
|
|
124
|
+
liquidations: () => chartMarket('liquidations'),
|
|
125
|
+
funding: () => chartMarket('funding'),
|
|
126
|
+
volume_profile: () => chartMarket('volume_profile'),
|
|
127
|
+
book: () => chartMarket('book'),
|
|
128
|
+
trade_volume_by_size: () => chartMarket('trade_volume_by_size'),
|
|
129
|
+
tape: () => chartMarket('tape', { minIntervalMs: TAPE_MIN_INTERVAL_MS, maxIntervalMs: TAPE_MAX_INTERVAL_MS }),
|
|
130
|
+
long_short_ratio: () => chartMarket('long_short_ratio', { minIntervalMs: LONG_SHORT_RATIO_MIN_INTERVAL_MS }),
|
|
131
|
+
// The option summary holds BTC and ETH alone (the run pass refuses every other coin before the
|
|
132
|
+
// fetch), whatever Deribit lists options for: the works-on list names the same two.
|
|
133
|
+
implied_volatility: () => ({
|
|
134
|
+
kind: 'provider',
|
|
135
|
+
sourceClass: 'implied_volatility',
|
|
136
|
+
provider: 'DERIBIT',
|
|
137
|
+
coins: BTC_ETH,
|
|
138
|
+
}),
|
|
139
|
+
skew: () => ({ kind: 'provider', sourceClass: 'skew', provider: 'DERIBIT', coins: BTC_ETH }),
|
|
140
|
+
options_chain: (source) => ({ kind: 'options', venueWord: text(source.venue) || 'auto' }),
|
|
141
|
+
options_oi: (source) => ({
|
|
142
|
+
kind: 'provider',
|
|
143
|
+
sourceClass: 'options_oi',
|
|
144
|
+
provider: OPTIONS_FLOW_PROVIDERS[text(source.venue) || 'deribit'] ?? text(source.venue).toUpperCase(),
|
|
145
|
+
coins: BTC_ETH,
|
|
146
|
+
}),
|
|
147
|
+
options_volume: (source) => ({
|
|
148
|
+
kind: 'provider',
|
|
149
|
+
sourceClass: 'options_volume',
|
|
150
|
+
provider: OPTIONS_FLOW_PROVIDERS[text(source.venue) || 'deribit'] ?? text(source.venue).toUpperCase(),
|
|
151
|
+
coins: BTC_ETH,
|
|
152
|
+
}),
|
|
153
|
+
volatility_index: () => ({ kind: 'provider', sourceClass: 'volatility_index', provider: 'DERIBIT', coins: BTC_ETH }),
|
|
154
|
+
// US listed options (OPRA) of the chart's underlying, or of a scope across underlyings: read on the OPRA plane on the
|
|
155
|
+
// native-rows path, served where the chart's options ride it (a US stock or ETF chart, an OPRA contract chart) for
|
|
156
|
+
// an overlay the plane is open to (the poll lane's `opra`).
|
|
157
|
+
options_flow: () => ({ kind: 'governed', sourceClass: 'options_flow', plane: 'opra' }),
|
|
158
|
+
// The daily options statistics of the chart's options chain (a chain poll lane, sources/lanes/option_daily): read on
|
|
159
|
+
// whichever plane the chain lists on, through the options chain's own venue decision (`wrunChainLaneRequirement`).
|
|
160
|
+
option_daily: (source) => wrunChainLaneRequirement('option_daily', source),
|
|
161
|
+
// The same statistics every ten minutes: the plane decides which underlyings it samples (refused after the fetch).
|
|
162
|
+
option_stats_10m: (source) => wrunChainLaneRequirement('option_stats_10m', source),
|
|
163
|
+
ethena_positions: () => ({ kind: 'provider', sourceClass: 'ethena_positions', provider: 'ETHENA', coins: BTC_ETH }),
|
|
164
|
+
etf_flow: (source) => ({
|
|
165
|
+
kind: 'provider',
|
|
166
|
+
sourceClass: 'etf_flow',
|
|
167
|
+
provider: 'ETF',
|
|
168
|
+
coins: WRUN_ETF_COVERED_COINS,
|
|
169
|
+
...(text(source.fund) ? { fund: text(source.fund) } : {}),
|
|
170
|
+
}),
|
|
171
|
+
etf_holdings: (source) => ({
|
|
172
|
+
kind: 'provider',
|
|
173
|
+
sourceClass: 'etf_holdings',
|
|
174
|
+
provider: 'ETF',
|
|
175
|
+
coins: WRUN_ETF_COVERED_COINS,
|
|
176
|
+
...(text(source.fund) ? { fund: text(source.fund) } : {}),
|
|
177
|
+
minIntervalMs: ETF_HOLDINGS_MIN_INTERVAL_MS,
|
|
178
|
+
maxIntervalMs: ETF_HOLDINGS_MAX_INTERVAL_MS,
|
|
179
|
+
}),
|
|
180
|
+
etf_premium: (source) => ({
|
|
181
|
+
kind: 'provider',
|
|
182
|
+
sourceClass: 'etf_premium',
|
|
183
|
+
provider: 'ETF',
|
|
184
|
+
coins: WRUN_ETF_COVERED_COINS,
|
|
185
|
+
...(text(source.fund) ? { fund: text(source.fund) } : {}),
|
|
186
|
+
// The issuer is the fund's, resolved from the listing at plan time; a sheet that names one
|
|
187
|
+
// carries it here.
|
|
188
|
+
...(text(source.issuer) ? { issuer: text(source.issuer) } : {}),
|
|
189
|
+
}),
|
|
190
|
+
bitfinex_funding: () => ({
|
|
191
|
+
kind: 'provider',
|
|
192
|
+
sourceClass: 'bitfinex_funding',
|
|
193
|
+
provider: 'BITFINEX',
|
|
194
|
+
coins: 'chart-coin',
|
|
195
|
+
}),
|
|
196
|
+
treasury_balance: (source) => text(source.asset)
|
|
197
|
+
? { kind: 'global', sourceClass: 'treasury_balance' }
|
|
198
|
+
: { kind: 'provider', sourceClass: 'treasury_balance', provider: 'BINANCE', coins: 'chart-coin' },
|
|
199
|
+
economic: () => ({ kind: 'global', sourceClass: 'economic' }),
|
|
200
|
+
token_supply: () => ({ kind: 'global', sourceClass: 'token_supply' }),
|
|
201
|
+
// A feed reads nothing of the chart's market. The lane is not `global` in the registry (an exact
|
|
202
|
+
// join never lands the relay's UTC buckets on a session grid), so an index-mode chart and a chart
|
|
203
|
+
// off the relay's eight intervals refuse it in its plan, which this kind does not state.
|
|
204
|
+
series: () => ({ kind: 'global', sourceClass: 'series' }),
|
|
205
|
+
};
|
|
206
|
+
/** The classes the table has a row for (the spec holds it to the row builder and the registries): its own rows,
|
|
207
|
+
* then every row lane's (derived from the descriptor, `wrunRowLaneRequirement`). */
|
|
208
|
+
export function wrunRequirementClasses() {
|
|
209
|
+
return [...Object.keys(REQUIREMENT_ROWS), ...wrunRowLaneClasses()];
|
|
210
|
+
}
|
|
211
|
+
/** A chain lane's requirement, a row lane's or a poll lane's (`chain`): it reads the chart's chain by its venue word,
|
|
212
|
+
* through the options chain's own decision, so its row is the options chain's (`options`) naming its class: never
|
|
213
|
+
* refused before a fetch, met where the chain decision answers, an index-mode chart included. */
|
|
214
|
+
function wrunChainLaneRequirement(sourceClass, source) {
|
|
215
|
+
return { kind: 'options', venueWord: text(source?.venue) || 'auto', sourceClass };
|
|
216
|
+
}
|
|
217
|
+
/** A row lane's requirement, from its descriptor: a chain lane reads the chart's chain by its venue word (the options
|
|
218
|
+
* chain's own decision: the `options` row naming its class), a governed lane reads its plane (`governed`); any other
|
|
219
|
+
* is unknown here (a chart-market row with no gateway type), never "needs nothing". */
|
|
220
|
+
function wrunRowLaneRequirement(sourceClass, source) {
|
|
221
|
+
const lane = wrunRowLaneOfClass(sourceClass);
|
|
222
|
+
if (lane === undefined)
|
|
223
|
+
return undefined;
|
|
224
|
+
if (lane.chain !== undefined)
|
|
225
|
+
return wrunChainLaneRequirement(sourceClass, source);
|
|
226
|
+
if (lane.governed !== 'opra')
|
|
227
|
+
return { kind: 'chart-market', sourceClass, gatewayType: '' };
|
|
228
|
+
return { kind: 'governed', sourceClass, plane: 'opra' };
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* The requirements of an effective sheet (settings applied), one entry per distinct requirement
|
|
232
|
+
* with every input that shares it, in input order. An input of a class outside the table yields a
|
|
233
|
+
* chart-market requirement with an empty gateway type: unknown, never "needs nothing".
|
|
234
|
+
*/
|
|
235
|
+
export function wrunInputRequirements(effectiveSheet) {
|
|
236
|
+
const byKey = new Map();
|
|
237
|
+
const inputs = [...(effectiveSheet.inputs ?? [])].sort((a, b) => a.index - b.index);
|
|
238
|
+
for (const input of inputs) {
|
|
239
|
+
const source = effectiveSheet.inputSources?.[input.name];
|
|
240
|
+
const sourceClass = source?.source ?? input.source;
|
|
241
|
+
if (typeof sourceClass !== 'string' || sourceClass === '')
|
|
242
|
+
continue;
|
|
243
|
+
const rowOf = REQUIREMENT_ROWS[sourceClass];
|
|
244
|
+
const row = rowOf
|
|
245
|
+
? rowOf(source ?? { source: sourceClass })
|
|
246
|
+
: (wrunRowLaneRequirement(sourceClass, source) ?? { kind: 'chart-market', sourceClass, gatewayType: '' });
|
|
247
|
+
if (row === null)
|
|
248
|
+
continue;
|
|
249
|
+
// The markets the input is read on (`needed_by`): an input differing only in it is its own
|
|
250
|
+
// requirement, met without the feed where it is not read. A pin and the options chain keep their
|
|
251
|
+
// own rules: the run plans and checks those legs on every market (a chain row lane plans an
|
|
252
|
+
// undemanded input nowhere, so it keeps `needed_by`).
|
|
253
|
+
const neededBy = source?.needed_by?.size_unit;
|
|
254
|
+
const keepsNeededBy = row.kind !== 'pinned' && (row.kind !== 'options' || row.sourceClass !== undefined);
|
|
255
|
+
const shape = Array.isArray(neededBy) && keepsNeededBy ? { ...row, neededBy } : row;
|
|
256
|
+
const key = JSON.stringify(shape);
|
|
257
|
+
// Whether the input is optional rides beside the shape, never in it: inputs that need the same
|
|
258
|
+
// thing share one requirement whatever fills they declare.
|
|
259
|
+
const optional = isOptionalOn(shape, input, source);
|
|
260
|
+
const existing = byKey.get(key);
|
|
261
|
+
if (existing) {
|
|
262
|
+
existing.inputs.push(input.name);
|
|
263
|
+
if (optional)
|
|
264
|
+
existing.optional = [...(existing.optional ?? []), input.name];
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
byKey.set(key, {
|
|
268
|
+
...shape,
|
|
269
|
+
inputs: [input.name],
|
|
270
|
+
...(optional ? { optional: [input.name] } : {}),
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return [...byKey.values()];
|
|
275
|
+
}
|
|
276
|
+
// ---------------------------------------------------------------------------
|
|
277
|
+
// The run's admission (the capability rule, WRUN-REFUSALS U3a step 5)
|
|
278
|
+
// ---------------------------------------------------------------------------
|
|
279
|
+
/**
|
|
280
|
+
* The row-builder lanes the capability rule judges, in the run pass's declaration order (a run
|
|
281
|
+
* refuses on the first lane that holds it), each with the fetch type the dispatcher's admission
|
|
282
|
+
* reads (`wrunLaneServiceOnMarket`; the run's own fetch types, WRUN_BUILTIN_LANE_FETCH_TYPES). The
|
|
283
|
+
* dollar trades lane asks the coin lane's type, so `trades` judges both.
|
|
284
|
+
*/
|
|
285
|
+
const WRUN_ADMISSION_LANES = new Map([
|
|
286
|
+
['book', 'orderbook'],
|
|
287
|
+
['trades', 'buy_sell_volume'],
|
|
288
|
+
['oi', 'open_interest'],
|
|
289
|
+
['volume_profile', 'volume_profile'],
|
|
290
|
+
['trade_volume_by_size', 'trade_volume_by_size'],
|
|
291
|
+
['liquidations', 'liquidations'],
|
|
292
|
+
['funding', 'funding_rate'],
|
|
293
|
+
['implied_volatility', WRUN_OPTION_SUMMARY_LANES.implied_volatility.type],
|
|
294
|
+
['skew', WRUN_OPTION_SUMMARY_LANES.skew.type],
|
|
295
|
+
['options_chain', 'options_chain'],
|
|
296
|
+
['etf_flow', 'etf_flow'],
|
|
297
|
+
['tape', 'trades'],
|
|
298
|
+
// A lane stream's leg is judged as the lane its fetch asks (wrun-leg-stream-classes `fetchType`), on its own market.
|
|
299
|
+
...LANE_STREAM_CLASSES.map((cls) => [cls, WRUN_LEG_STREAM_CLASSES[cls].fetchType]),
|
|
300
|
+
]);
|
|
301
|
+
/** The row-builder lanes whose empty answer is broken (the honest-picture rule): an input reading
|
|
302
|
+
* one draws without it only through its fill over an empty lane. */
|
|
303
|
+
const WRUN_STATE_LANES = new Set([
|
|
304
|
+
'volume_profile',
|
|
305
|
+
'trade_volume_by_size',
|
|
306
|
+
'implied_volatility',
|
|
307
|
+
'skew',
|
|
308
|
+
'options_chain',
|
|
309
|
+
'etf_flow',
|
|
310
|
+
]);
|
|
311
|
+
/** Whether a lane's absence can hold the run: a state lane, or funding (a reader on the default carry
|
|
312
|
+
* policy has nothing to carry). The quiet lanes (book, trades, oi, liquidations, tape) never do. */
|
|
313
|
+
function laneCanHold(lane) {
|
|
314
|
+
// A leg stream holds the run without its lane (it reads its leg or nothing).
|
|
315
|
+
return lane === 'funding' || WRUN_STATE_LANES.has(lane) || isWrunLegStreamClass(lane);
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Whether an input reads its declared fill over an empty lane instead of holding the run (the
|
|
319
|
+
* honest-picture rule's quiet reader): a scalar input's `missing: "nan"` blanks the outputs it
|
|
320
|
+
* feeds, and a celled input's `missing: "empty"` (frozen authoring contract C1.2: on celled inputs
|
|
321
|
+
* `missing` accepts only "empty") reads an EMPTY block on every bar.
|
|
322
|
+
*/
|
|
323
|
+
export function wrunInputReadsFillOverEmptyLane(input, source) {
|
|
324
|
+
return input.cellType === 'array' ? source?.missing === 'empty' : source?.missing === 'nan';
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Whether an input draws without the row-builder lane it reads where the chart's fetch never serves
|
|
328
|
+
* that lane, instead of holding the run: always over a quiet lane; over funding unless it rides the
|
|
329
|
+
* default carry policy (`missing` absent or "carry": an absent rate has nothing to carry); over a
|
|
330
|
+
* state lane only through its fill over an empty lane (`wrunInputReadsFillOverEmptyLane`).
|
|
331
|
+
*/
|
|
332
|
+
export function wrunInputDrawsWithoutLane(lane, input, source) {
|
|
333
|
+
if (lane === 'funding')
|
|
334
|
+
return source?.missing !== undefined && source.missing !== 'carry';
|
|
335
|
+
if (WRUN_STATE_LANES.has(lane))
|
|
336
|
+
return wrunInputReadsFillOverEmptyLane(input, source);
|
|
337
|
+
// A leg stream declares no fill (the class takes no `missing`): where its lane is never served it cannot draw.
|
|
338
|
+
if (isWrunLegStreamClass(lane))
|
|
339
|
+
return false;
|
|
340
|
+
return true;
|
|
341
|
+
}
|
|
342
|
+
/** The row-builder lane a requirement reads, when the capability rule judges it. */
|
|
343
|
+
export function admissionLaneOf(req) {
|
|
344
|
+
let lane;
|
|
345
|
+
// A chain row lane's `options` row rides its own row lane, never the options chain's.
|
|
346
|
+
if (req.kind === 'options')
|
|
347
|
+
lane = req.sourceClass === undefined ? 'options_chain' : undefined;
|
|
348
|
+
else if (req.kind === 'chart-market' || req.kind === 'provider')
|
|
349
|
+
lane = req.sourceClass;
|
|
350
|
+
return lane !== undefined && WRUN_ADMISSION_LANES.has(lane) ? lane : undefined;
|
|
351
|
+
}
|
|
352
|
+
/** A registry poll lane's requirement (planWrunPollLanes plans it): a provider or chart-market row
|
|
353
|
+
* that is no row-builder lane, nor the chart's own candles, nor a class the table does not know. */
|
|
354
|
+
export function isPollLaneRequirement(req) {
|
|
355
|
+
if (admissionLaneOf(req) !== undefined)
|
|
356
|
+
return false;
|
|
357
|
+
if (req.kind === 'provider')
|
|
358
|
+
return true;
|
|
359
|
+
return req.kind === 'chart-market' && req.gatewayType !== '' && req.sourceClass !== 'intrabar';
|
|
360
|
+
}
|
|
361
|
+
/** Whether an input is optional on its requirement (`WrunInputRequirement.optional`): it draws
|
|
362
|
+
* without a lane whose absence can hold the run. */
|
|
363
|
+
function isOptionalOn(req, input, source) {
|
|
364
|
+
// A governed or chain row lane's reader draws without it through its empty block (the run drops such an input, or
|
|
365
|
+
// reads its empty block over an empty answer).
|
|
366
|
+
if (req.kind === 'governed' || (req.kind === 'options' && req.sourceClass !== undefined)) {
|
|
367
|
+
return wrunInputReadsFillOverEmptyLane(input, source);
|
|
368
|
+
}
|
|
369
|
+
const lane = admissionLaneOf(req);
|
|
370
|
+
if (lane !== undefined)
|
|
371
|
+
return laneCanHold(lane) && wrunInputDrawsWithoutLane(lane, input, source);
|
|
372
|
+
return isPollLaneRequirement(req) && (source?.missing === 'nan' || source?.missing === 'zero');
|
|
373
|
+
}
|
|
374
|
+
/** Whether a requirement's inputs hold the run without their lane: one of them is not optional, on
|
|
375
|
+
* a lane whose absence can hold it (a state lane, funding, a registry poll lane). */
|
|
376
|
+
export function holdsWithoutLane(req) {
|
|
377
|
+
const lane = admissionLaneOf(req);
|
|
378
|
+
if (lane !== undefined ? !laneCanHold(lane) : !isPollLaneRequirement(req))
|
|
379
|
+
return false;
|
|
380
|
+
return req.inputs.some((name) => !req.optional?.includes(name));
|
|
381
|
+
}
|
|
382
|
+
/** The capability verdict of one row-builder lane on a market: undefined while the chart's fetch
|
|
383
|
+
* serves it there, and for a class that is no row-builder lane. A lane asked on the fetch's
|
|
384
|
+
* native-rows path (`nativeRows`: its rows are not the market's own) is served wherever it is asked. */
|
|
385
|
+
export function unservedLaneOn(lane, market, nativeRows = false) {
|
|
386
|
+
const type = WRUN_ADMISSION_LANES.get(lane);
|
|
387
|
+
if (type === undefined)
|
|
388
|
+
return undefined;
|
|
389
|
+
const service = wrunLaneServiceOnMarket({ type, exchange: market.exchange, coin: market.coin, nativeRows });
|
|
390
|
+
return service.served ? undefined : { type, service };
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* The capability rule on one market, before any fetch: every row-builder lane the sheet demands (an
|
|
394
|
+
* input the sheet on the market left undemanded, its `needed_by`, asks none) that the chart's fetch
|
|
395
|
+
* never serves there (`wrunLaneServiceOnMarket`: the dispatcher's index-mode admission, the
|
|
396
|
+
* market-kind table and the coin table, never an empty window), in the run's declaration order,
|
|
397
|
+
* with the reader it cannot draw without; a trades leg on its own market. The run pass refuses on
|
|
398
|
+
* the first lane holding one and leaves the others undispatched, their readers on their fill; the
|
|
399
|
+
* picker greys a row on the same verdict (`wrunMarketRefusesBeforeFetch`). `nativeLanes` names the
|
|
400
|
+
* lanes this run asks on the fetch's native-rows path (a governed options chain, CME or OPRA, the run
|
|
401
|
+
* resolved before this rule): their rows are their plane's, so the market's admission never judges them.
|
|
402
|
+
*/
|
|
403
|
+
export function wrunUnservedLanes(sheet, market, opts = {}) {
|
|
404
|
+
const inputs = [...sheet.inputs].sort((a, b) => a.index - b.index);
|
|
405
|
+
const unserved = [];
|
|
406
|
+
const judge = (lane, readers, on, legMarket) => {
|
|
407
|
+
if (readers.length === 0)
|
|
408
|
+
return;
|
|
409
|
+
const verdict = unservedLaneOn(lane, on, opts.nativeLanes?.includes(lane) === true);
|
|
410
|
+
if (verdict === undefined)
|
|
411
|
+
return;
|
|
412
|
+
const holding = readers.find((input) => !wrunInputDrawsWithoutLane(lane, input, sheet.inputSources[input.name]));
|
|
413
|
+
unserved.push({
|
|
414
|
+
lane,
|
|
415
|
+
...verdict,
|
|
416
|
+
inputNames: readers.map((input) => input.name),
|
|
417
|
+
...(legMarket !== undefined ? { market: legMarket } : {}),
|
|
418
|
+
...(holding !== undefined ? { holding: { name: holding.name, celled: holding.cellType === 'array' } } : {}),
|
|
419
|
+
});
|
|
420
|
+
};
|
|
421
|
+
for (const lane of WRUN_ADMISSION_LANES.keys()) {
|
|
422
|
+
const readers = inputs.filter((input) => {
|
|
423
|
+
const source = sheet.inputSources[input.name];
|
|
424
|
+
return source?.source === lane && source.undemanded !== true;
|
|
425
|
+
});
|
|
426
|
+
if (lane !== 'trades' && !isWrunLaneStreamClass(lane)) {
|
|
427
|
+
judge(lane, readers, market);
|
|
428
|
+
continue;
|
|
429
|
+
}
|
|
430
|
+
// A pinned trades input (and a lane stream pinned to another market) is judged on its leg's market; an
|
|
431
|
+
// unresolved coin leg or a half pin nowhere (the row builder refuses it by name).
|
|
432
|
+
const own = [];
|
|
433
|
+
const legs = new Map();
|
|
434
|
+
for (const input of readers) {
|
|
435
|
+
const { exchange, symbol, ...source } = sheet.inputSources[input.name];
|
|
436
|
+
if (exchange === undefined && symbol === undefined && !wrunFollowsCoin(source))
|
|
437
|
+
own.push(input);
|
|
438
|
+
else if (typeof exchange === 'string' && typeof symbol === 'string') {
|
|
439
|
+
const key = `${exchange}|${symbol}`;
|
|
440
|
+
const leg = legs.get(key) ?? { market: { exchange, symbol }, readers: [] };
|
|
441
|
+
leg.readers.push(input);
|
|
442
|
+
legs.set(key, leg);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
judge(lane, own, market);
|
|
446
|
+
for (const leg of legs.values())
|
|
447
|
+
judge(lane, leg.readers, { exchange: leg.market.exchange, coin: market.coin }, leg.market);
|
|
448
|
+
}
|
|
449
|
+
return unserved;
|
|
450
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The integration route of a wrun run: kScript's local-run decision core
|
|
3
|
+
* (`localRunIntegrationRoute`, kscript-integration-decision.util) fed from a
|
|
4
|
+
* wrun run, plus the two checks the wrun lane makes around it, the way the
|
|
5
|
+
* kScript ladder makes its own around the core: the chart left the identity
|
|
6
|
+
* the run computed for, and the result renders equal to what this lane last
|
|
7
|
+
* integrated on the overlay. Pure: the run keeps every side effect, this pins
|
|
8
|
+
* the CHOICE. Leaf: the decision leaf and the contract's types only.
|
|
9
|
+
*/
|
|
10
|
+
import { type LocalRunRoute } from '../chart/kscript-integration-decision.leaf.js';
|
|
11
|
+
import type { WrunRunReason } from './wrun-lifecycle.contract.js';
|
|
12
|
+
/** The core's `owedFullIntegration` for a wrun run: one of the reasons above,
|
|
13
|
+
* or no good result on the overlay yet. */
|
|
14
|
+
export declare function wrunRunOwesFullIntegration(reason: WrunRunReason, hasGoodResult: boolean): boolean;
|
|
15
|
+
export interface WrunIntegrationRouteInput {
|
|
16
|
+
reason: WrunRunReason;
|
|
17
|
+
/** The overlay shows a result an earlier run of this lane integrated. */
|
|
18
|
+
hasGoodResult: boolean;
|
|
19
|
+
/** The live tick's apply (the run itself is never one). */
|
|
20
|
+
isLiveTick: boolean;
|
|
21
|
+
/** The chart or the overlay moved off what the run computed for (another
|
|
22
|
+
* market or interval, a rebuilt chart, a remounted overlay). */
|
|
23
|
+
identityLeft: boolean;
|
|
24
|
+
/** The overlay's settings changed while the run computed with the old ones. */
|
|
25
|
+
settingsStale: boolean;
|
|
26
|
+
/** The output rows the worker answered. */
|
|
27
|
+
outputRowCount: number;
|
|
28
|
+
/** The result carries something to paint: an output, a drawing, a child overlay. */
|
|
29
|
+
hasRenderables: boolean;
|
|
30
|
+
/** Read only when the result could skip as unchanged (a good result, no full integration owed). */
|
|
31
|
+
renderEqual: () => boolean;
|
|
32
|
+
/** Read only for a range refresh that owes no full integration: the mounted
|
|
33
|
+
* plot set fits the result (`mountedPlotSetMatchesRunResult`) and the mount
|
|
34
|
+
* is no zombie (`resolveLazyMergePlan` answers 'canonical-merge'). */
|
|
35
|
+
mountedPlotSetFits: () => boolean;
|
|
36
|
+
}
|
|
37
|
+
export type WrunIntegrationRoute = LocalRunRoute | {
|
|
38
|
+
action: 'skip';
|
|
39
|
+
reason: 'identity-left' | 'render-equal';
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* In order: the identity check, the unchanged-result skip (never over stale
|
|
43
|
+
* settings or an owed full integration), then the core. Its inputs: stale
|
|
44
|
+
* settings are its style mismatch; no output rows over a good result its
|
|
45
|
+
* transient preserve; a result with nothing to paint skips only when no full
|
|
46
|
+
* integration is owed (a first run or a settings run of a strategy package
|
|
47
|
+
* still mounts its title); the range-refresh attribution is the shared one
|
|
48
|
+
* (`isLocalRunRangeRefreshResult` over the reason), so only the lazy and the
|
|
49
|
+
* loaded-range refreshes merge onto the mounted rows.
|
|
50
|
+
*/
|
|
51
|
+
export declare function wrunIntegrationRoute(input: WrunIntegrationRouteInput): WrunIntegrationRoute;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The integration route of a wrun run: kScript's local-run decision core
|
|
3
|
+
* (`localRunIntegrationRoute`, kscript-integration-decision.util) fed from a
|
|
4
|
+
* wrun run, plus the two checks the wrun lane makes around it, the way the
|
|
5
|
+
* kScript ladder makes its own around the core: the chart left the identity
|
|
6
|
+
* the run computed for, and the result renders equal to what this lane last
|
|
7
|
+
* integrated on the overlay. Pure: the run keeps every side effect, this pins
|
|
8
|
+
* the CHOICE. Leaf: the decision leaf and the contract's types only.
|
|
9
|
+
*/
|
|
10
|
+
import { isLocalRunRangeRefreshResult, localRunIntegrationRoute, } from '../chart/kscript-integration-decision.leaf.js';
|
|
11
|
+
/** Reasons whose result answers a new question (a first run, new settings, a
|
|
12
|
+
* new theme, another market, a resume, a Retry, the replay's bars): it
|
|
13
|
+
* replaces the mounted picture whatever the mount holds. */
|
|
14
|
+
const WRUN_FULL_INTEGRATION_REASONS = new Set([
|
|
15
|
+
'replay',
|
|
16
|
+
'initial',
|
|
17
|
+
'settings',
|
|
18
|
+
'theme',
|
|
19
|
+
'switch',
|
|
20
|
+
'resume',
|
|
21
|
+
'retry',
|
|
22
|
+
]);
|
|
23
|
+
/** The core's `owedFullIntegration` for a wrun run: one of the reasons above,
|
|
24
|
+
* or no good result on the overlay yet. */
|
|
25
|
+
export function wrunRunOwesFullIntegration(reason, hasGoodResult) {
|
|
26
|
+
return !hasGoodResult || WRUN_FULL_INTEGRATION_REASONS.has(reason);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* In order: the identity check, the unchanged-result skip (never over stale
|
|
30
|
+
* settings or an owed full integration), then the core. Its inputs: stale
|
|
31
|
+
* settings are its style mismatch; no output rows over a good result its
|
|
32
|
+
* transient preserve; a result with nothing to paint skips only when no full
|
|
33
|
+
* integration is owed (a first run or a settings run of a strategy package
|
|
34
|
+
* still mounts its title); the range-refresh attribution is the shared one
|
|
35
|
+
* (`isLocalRunRangeRefreshResult` over the reason), so only the lazy and the
|
|
36
|
+
* loaded-range refreshes merge onto the mounted rows.
|
|
37
|
+
*/
|
|
38
|
+
export function wrunIntegrationRoute(input) {
|
|
39
|
+
if (input.identityLeft)
|
|
40
|
+
return { action: 'skip', reason: 'identity-left' };
|
|
41
|
+
const owedFullIntegration = wrunRunOwesFullIntegration(input.reason, input.hasGoodResult);
|
|
42
|
+
if (!input.settingsStale && !owedFullIntegration && input.renderEqual()) {
|
|
43
|
+
return { action: 'skip', reason: 'render-equal' };
|
|
44
|
+
}
|
|
45
|
+
const rangeRefresh = isLocalRunRangeRefreshResult({
|
|
46
|
+
resyncReason: input.reason,
|
|
47
|
+
deferred: input.isLiveTick,
|
|
48
|
+
wasFirstRun: !input.hasGoodResult,
|
|
49
|
+
});
|
|
50
|
+
return localRunIntegrationRoute({
|
|
51
|
+
styleMatch: !input.settingsStale,
|
|
52
|
+
preservePreviousOutput: input.outputRowCount === 0 && input.hasGoodResult,
|
|
53
|
+
hasRendererUpdate: input.hasRenderables || owedFullIntegration,
|
|
54
|
+
allowOrderbookZeroBar: false,
|
|
55
|
+
isLiveSourceRefresh: input.isLiveTick,
|
|
56
|
+
owedFullIntegration,
|
|
57
|
+
rangeRefreshSamePlotSet: rangeRefresh && !owedFullIntegration && !input.settingsStale && input.mountedPlotSetFits(),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The length of a latest-values snapshot's history (a leaf of utility/wrun/wrun-hud-state.ts; P2/inventory.md section
|
|
3
|
+
* 1.1): the trailing values per output the run path keeps in each snapshot it publishes. A constant, no imports, so it
|
|
4
|
+
* moves into the chart-host package with the phase 2 closure; the HUD's reactive state stays web (the members
|
|
5
|
+
* `chart.clearLatestValues`, `chart.publishLatestValues`, `chart.latestSnapshot`) and re-exports it.
|
|
6
|
+
*/
|
|
7
|
+
/** How many trailing values per output a snapshot's `history` carries. */
|
|
8
|
+
export declare const WRUN_LATEST_HISTORY_LENGTH = 64;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The length of a latest-values snapshot's history (a leaf of utility/wrun/wrun-hud-state.ts; P2/inventory.md section
|
|
3
|
+
* 1.1): the trailing values per output the run path keeps in each snapshot it publishes. A constant, no imports, so it
|
|
4
|
+
* moves into the chart-host package with the phase 2 closure; the HUD's reactive state stays web (the members
|
|
5
|
+
* `chart.clearLatestValues`, `chart.publishLatestValues`, `chart.latestSnapshot`) and re-exports it.
|
|
6
|
+
*/
|
|
7
|
+
/** How many trailing values per output a snapshot's `history` carries. */
|
|
8
|
+
export const WRUN_LATEST_HISTORY_LENGTH = 64;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WrunHoverChart, WrunHoverSurfaces, WrunLegendHoverModule } from '../../host-ports.types.js';
|
|
2
|
+
/** The hover surfaces as the door reads them (the host's view of wrun-legend-hover: its attach). */
|
|
3
|
+
export type WrunLegendHoverRuntime = WrunLegendHoverModule;
|
|
4
|
+
/** Hand the surfaces over: a loader calls this with its static import as it evaluates; every pane
|
|
5
|
+
* still waiting attaches now. */
|
|
6
|
+
export declare function bindWrunLegendHover(loaded: WrunLegendHoverRuntime): void;
|
|
7
|
+
/** A wrun sheet was remembered (wrun-overlay-metadata.util): the surfaces now have an overlay to
|
|
8
|
+
* answer for, so a pane waiting for them loads them. */
|
|
9
|
+
export declare function primeWrunLegendHover(): void;
|
|
10
|
+
/** `attachWrunHoverSurfaces` (the hover surfaces): the same handle shape, the surfaces' own once
|
|
11
|
+
* they are here. */
|
|
12
|
+
export declare function attachWrunHoverSurfaces(chartIndex: number, chart: WrunHoverChart): WrunHoverSurfaces;
|