@orangecharts/wrun-chart-host 0.3.0 → 0.5.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 +23 -6
- package/dist/constants/exchange-names.leaf.d.ts +8 -0
- package/dist/constants/exchange-names.leaf.js +101 -0
- 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/builtin-script-snippets.d.ts +133 -0
- package/dist/constants/scriptEditor/builtin-script-snippets.js +451 -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 +321 -24
- package/dist/host-env.js +15 -0
- package/dist/host-ports.types.d.ts +857 -35
- package/dist/index.d.ts +149 -2
- package/dist/index.js +149 -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/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 +5 -0
- package/dist/utility/chart/chart-mount-epoch.util.js +29 -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/date-labelled-interval.leaf.d.ts +15 -0
- package/dist/utility/chart/date-labelled-interval.leaf.js +19 -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/indicator-run-interval.util.d.ts +130 -0
- package/dist/utility/chart/indicator-run-interval.util.js +268 -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/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 +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/html-escape.leaf.d.ts +11 -0
- package/dist/utility/html-escape.leaf.js +20 -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/option_daily.d.ts +43 -15
- package/dist/utility/wrun/sources/lanes/option_daily.js +78 -20
- package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +14 -10
- package/dist/utility/wrun/sources/lanes/option_stats_10m.js +5 -4
- package/dist/utility/wrun/sources/lanes/series.js +2 -2
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +22 -3
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +38 -7
- package/dist/utility/wrun/sources/registry.js +31 -1
- package/dist/utility/wrun/sources/row-lane-registry.js +5 -5
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +49 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +75 -20
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +49 -0
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +57 -47
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +36 -4
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +6 -12
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +37 -3
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +128 -2
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +233 -51
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +0 -8
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +26 -24
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +85 -104
- 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 +83 -0
- package/dist/utility/wrun/wrun-bar-count.util.js +259 -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 +266 -0
- package/dist/utility/wrun/wrun-host.service.js +655 -0
- 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-opra-stats.leaf.d.ts +29 -10
- package/dist/utility/wrun/wrun-opra-stats.leaf.js +29 -10
- 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-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 +392 -0
- package/dist/utility/wrun/wrun-panel-mount.util.js +2346 -0
- 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-pause-dim.util.d.ts +52 -0
- package/dist/utility/wrun/wrun-pause-dim.util.js +153 -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-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-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-projection.types.d.ts +14 -0
- package/dist/utility/wrun/wrun-run-interval-projection.types.js +1 -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-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 +190 -0
- package/dist/workers/wrun/wrun-abi-host.js +1201 -0
- package/dist/workers/wrun/wrun-engine-handler.d.ts +37 -0
- package/dist/workers/wrun/wrun-engine-handler.js +211 -0
- package/package.json +3 -3
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Editor-built Indicator overlays (the TypeScript draft lane): identity and the
|
|
3
|
+
* NAMED PERSISTENCE SKIP, the twin of wrun-dev-overlay.util.ts.
|
|
4
|
+
*
|
|
5
|
+
* A draft overlay is a TECHNICAL_SCRIPT record the registry loader mounts from
|
|
6
|
+
* bytes the in-browser compiler just produced (services/wrun-registry-loader
|
|
7
|
+
* mountDraftPackage). Its identity is `settings.wrunDraftRef`
|
|
8
|
+
* ({scriptDocId, sourceDigest, position}) under the synthetic customScriptId
|
|
9
|
+
* `wrun-draft-<key>` (the script doc id when the tab is saved, the tab id
|
|
10
|
+
* otherwise).
|
|
11
|
+
*
|
|
12
|
+
* Session-only by decision: `wrunDraftRef` is deliberately NOT in
|
|
13
|
+
* `settingsToSave`, and every persistence seam (the workspace serializer, the
|
|
14
|
+
* PUT payload builder, the addIndicator workspace append, the hydration
|
|
15
|
+
* sanitizer) skips these overlays by the predicate below, exactly like the
|
|
16
|
+
* wrun-dev overlays and temp editor drafts. The only thing that can compute a
|
|
17
|
+
* draft is the editor tab that built it: a persisted record would restore
|
|
18
|
+
* with a `wrun-draft-*` id that names no script-service doc and would toast a
|
|
19
|
+
* failed doc fetch on every reload. THIS BROWSER brings it back instead: the
|
|
20
|
+
* pane remembers it in the draft ledger (wrun-draft-ledger.util) and the
|
|
21
|
+
* restore coordinator (wrun-draft-restore.util) runs it again from its editor
|
|
22
|
+
* tab once the pane is back on the glass; the saved script doc stays the
|
|
23
|
+
* durable artifact everywhere else.
|
|
24
|
+
*
|
|
25
|
+
* The settings dialog still opens on a draft: it resolves the row from the
|
|
26
|
+
* engine meta (utility/chart/overlay-settings-target.util.ts), and a save
|
|
27
|
+
* edits the running draft and writes no workspace row. THIS BROWSER keeps the
|
|
28
|
+
* values the save leaves off their declared defaults in the pane's draft
|
|
29
|
+
* ledger entry (wrun-draft-settings.util), so the draft's next mount starts
|
|
30
|
+
* from them: a reload, a layout switch back, the next Run (a value whose row
|
|
31
|
+
* the code removed or changed kind is dropped; a row the user never changed
|
|
32
|
+
* follows the code's current default) and the package a publish swaps in. A
|
|
33
|
+
* Reset to defaults keeps nothing, and a removal forgets them with the entry.
|
|
34
|
+
*
|
|
35
|
+
* Leaf module (no imports) so production persistence code can read it without
|
|
36
|
+
* pulling the compiler or the wasm host into its graph.
|
|
37
|
+
*/
|
|
38
|
+
export const WRUN_DRAFT_SCRIPT_ID_PREFIX = 'wrun-draft-';
|
|
39
|
+
/** Synthetic customScriptId for a draft: `wrun-draft-<key>`, every
|
|
40
|
+
* non-alphanumeric run in the key collapsed to one dash (the registry slug
|
|
41
|
+
* discipline, so ids stay legend/DOM safe). */
|
|
42
|
+
export function wrunDraftSlugFor(draftKey) {
|
|
43
|
+
return `${WRUN_DRAFT_SCRIPT_ID_PREFIX}${draftKey.replace(/[^a-zA-Z0-9]+/g, '-')}`;
|
|
44
|
+
}
|
|
45
|
+
export function isWrunDraftScriptId(scriptId) {
|
|
46
|
+
return typeof scriptId === 'string' && scriptId.startsWith(WRUN_DRAFT_SCRIPT_ID_PREFIX);
|
|
47
|
+
}
|
|
48
|
+
/** True for settings minted by the draft mount. Keyed on the id prefix like
|
|
49
|
+
* the dev skip (so a stray persisted record without its ref is still
|
|
50
|
+
* recognized on the way in) OR on the ref itself; the `wrunRef` guard keeps
|
|
51
|
+
* marketplace overlays safe, whose `wrun-<package>-<version>` slugs could
|
|
52
|
+
* legitimately start with `draft-` (a marketplace overlay always carries
|
|
53
|
+
* `wrunRef`). */
|
|
54
|
+
export function isWrunDraftOverlaySettings(settings) {
|
|
55
|
+
if (!settings)
|
|
56
|
+
return false;
|
|
57
|
+
const candidate = settings;
|
|
58
|
+
if (candidate.wrunDraftRef && typeof candidate.wrunDraftRef === 'object')
|
|
59
|
+
return true;
|
|
60
|
+
return isWrunDraftScriptId(candidate.customScriptId) && !candidate.wrunRef;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The class-to-kScript mapping table, checked against the chart's own fetch
|
|
64
|
+
* code (the lane each class rides: wrun-overlay-run.util, wrun-live-tick.util
|
|
65
|
+
* LANE_FETCH, wrun-source-rows.util for the legs, sources/lanes/* for the
|
|
66
|
+
* poll lanes, wrun-option-summary-lane.util) and SOURCE_TYPE_CONFIG's params:
|
|
67
|
+
*
|
|
68
|
+
* - The candle family is kScript `ohlcv`: `ohlcv` (the chart spine when
|
|
69
|
+
* unpinned with no interval: free; a market pin is that market's grid leg;
|
|
70
|
+
* an interval pin is a `request()` leg, one per market + interval), the
|
|
71
|
+
* `candles` stream (the leg a period view of the same market and interval
|
|
72
|
+
* fetches), `intrabar` (kScript `ltf()`, whose payload is the same market +
|
|
73
|
+
* interval) and `odds` (a Polymarket market's candles).
|
|
74
|
+
* - The lane streams ride their lane's kScript type at the leg's interval:
|
|
75
|
+
* `oi_candles` an `open_interest` leg, `volume_profile_candles` a
|
|
76
|
+
* `volume_profile` leg, one per market, interval and quote, and a profile
|
|
77
|
+
* stream one per bucket size too: each identity is its own leg fetch
|
|
78
|
+
* (wrunLaneStreamLegFetchKey), as kScript's own sources take `currency` and
|
|
79
|
+
* `ticksPerBar` params.
|
|
80
|
+
* - The chart's own feeds, one lane fetch each (market pins are payload for
|
|
81
|
+
* the hosted lane; the chart lane serves them on ohlcv alone): `trades` is
|
|
82
|
+
* the buy/sell volume lane (both sides one fetch), `tape` the raw trade
|
|
83
|
+
* lane, `book` the order book (block_size and max_depth shape the cells,
|
|
84
|
+
* not the fetch), `volume_profile` the package's ONE profile lane
|
|
85
|
+
* (wrun_volume_profile_one_lane refuses two, so ticks_per_bar and currency
|
|
86
|
+
* shape that fetch and never add one), `oi` and `funding` (an interval pin
|
|
87
|
+
* buckets the lane's own rows, kScript's htf() resample: no fetch).
|
|
88
|
+
* - The Deribit option summary reads the chart's coin: implied volatility is
|
|
89
|
+
* ONE ask for every tenor (the tenors are fields of the one kScript
|
|
90
|
+
* source), skew one ask per delta.
|
|
91
|
+
* - The poll lanes ride their K types: one fetch per distinct knob value
|
|
92
|
+
* (fund, publisher + series, venue, asset); bitfinex_funding's four fields
|
|
93
|
+
* are four K types (no engine source config: 1 each).
|
|
94
|
+
* - No kScript type: `options_chain` (the package's ONE chain,
|
|
95
|
+
* wrun_options_chain_one_venue), `token_supply` (one per token),
|
|
96
|
+
* `series` (one per feed, its `ref`: the lane's own relay fetch) and the
|
|
97
|
+
* OPRA scalar classes (`options_flow` one per scope, dte, moneyness and
|
|
98
|
+
* venue: its knobs shape the acquisition). Any other
|
|
99
|
+
* class (metric, a class this table does not know) charges 1 per distinct
|
|
100
|
+
* entry, keyed on every key but the read modifiers.
|
|
101
|
+
* - The row lanes (sources/row-lanes/*) have no kScript type either:
|
|
102
|
+
* - `option_strikes`: the package's ONE strike chain (acquisitions 'one'),
|
|
103
|
+
* keyed by its venue word and book.
|
|
104
|
+
* - `option_contract_state`: one chain read per chart market, venue and
|
|
105
|
+
* book (expiries and strike_window_pct filter that read).
|
|
106
|
+
* - `option_surface`: one surface read per chart market, venue and book (the
|
|
107
|
+
* run's bar span picks its tier), keyed as the lane plans its instances:
|
|
108
|
+
* the options chain's venue word (absent reads `auto`) and the book
|
|
109
|
+
* (absent or `auto` reads `auto`, a series name upper case).
|
|
110
|
+
*/
|
|
111
|
+
export const WRUN_KSCRIPT_SOURCE_CLASSES = Object.freeze({
|
|
112
|
+
ohlcv: { type: 'ohlcv', payload: ['market', 'interval'] },
|
|
113
|
+
candles: { type: 'ohlcv', payload: ['market', 'interval'] },
|
|
114
|
+
// The lane streams: an open-interest or volume-profile leg at its own interval (a kScript request() of that
|
|
115
|
+
// source), one per market, interval and quote, a profile stream per bucket size too (each its own leg fetch).
|
|
116
|
+
oi_candles: { type: 'open_interest', payload: ['market', 'interval', 'stream_currency'] },
|
|
117
|
+
volume_profile_candles: {
|
|
118
|
+
type: 'volume_profile',
|
|
119
|
+
payload: ['market', 'interval', 'stream_currency', 'ticks_per_bar'],
|
|
120
|
+
},
|
|
121
|
+
intrabar: { type: 'ohlcv', payload: ['market', 'interval'] },
|
|
122
|
+
odds: { type: 'ohlcv', payload: ['odds', 'interval'] },
|
|
123
|
+
time: { type: null, payload: [], free: true },
|
|
124
|
+
trades: { type: 'buy_sell_volume', payload: ['market'] },
|
|
125
|
+
tape: { type: 'trades', payload: ['market', 'min_size', 'history'] },
|
|
126
|
+
oi: { type: 'open_interest', payload: ['market'] },
|
|
127
|
+
liquidations: { type: 'liquidations', payload: ['market'] },
|
|
128
|
+
funding: { type: 'funding_rate', payload: ['market'] },
|
|
129
|
+
book: { type: 'orderbook', payload: ['market'] },
|
|
130
|
+
volume_profile: { type: 'volume_profile', payload: ['market'] },
|
|
131
|
+
trade_volume_by_size: { type: 'trade_volume_by_size', payload: ['market'] },
|
|
132
|
+
implied_volatility: { type: 'deribit_implied_volatility', payload: ['market'] },
|
|
133
|
+
skew: { type: 'skew', payload: ['market', 'delta'] },
|
|
134
|
+
etf_flow: { type: 'etf_flow', payload: ['market', 'fund'] },
|
|
135
|
+
etf_holdings: { type: 'etf_holding', payload: ['market', 'fund'] },
|
|
136
|
+
etf_premium: { type: 'etf_premium_rate', payload: ['market', 'fund'] },
|
|
137
|
+
economic: { type: 'economic', payload: ['publisher', 'series'] },
|
|
138
|
+
options_oi: { type: 'options_open_interest', payload: ['market', 'venue'] },
|
|
139
|
+
options_volume: { type: 'options_volume', payload: ['market', 'venue'] },
|
|
140
|
+
treasury_balance: { type: 'binance_treasury_balance', payload: ['asset'] },
|
|
141
|
+
volatility_index: { type: 'deribit_volatility_index', payload: ['market'] },
|
|
142
|
+
long_short_ratio: { type: 'long_short_ratio', payload: ['market'] },
|
|
143
|
+
ethena_positions: { type: 'ethena_positions', payload: ['market'] },
|
|
144
|
+
bitfinex_funding: {
|
|
145
|
+
type: null,
|
|
146
|
+
typeByField: {
|
|
147
|
+
funding_size: 'bitfinex_funding_size',
|
|
148
|
+
credit_size: 'bitfinex_credit_size',
|
|
149
|
+
active_credit_size: 'bitfinex_active_credit_size',
|
|
150
|
+
margin_rate: 'bitfinex_margin_rate',
|
|
151
|
+
},
|
|
152
|
+
payload: ['market'],
|
|
153
|
+
},
|
|
154
|
+
options_chain: { type: null, payload: [] },
|
|
155
|
+
// The chain classes key as their lanes plan their instances: the chart market's chain under the input's venue word
|
|
156
|
+
// and its ONE book (an absent venue or book reads `auto`).
|
|
157
|
+
option_strikes: { type: null, payload: ['chain_venue', 'book'] },
|
|
158
|
+
option_contract_state: { type: null, payload: ['market', 'chain_venue', 'book'] },
|
|
159
|
+
option_surface: { type: null, payload: ['market', 'chain_venue', 'book'] },
|
|
160
|
+
token_supply: { type: null, payload: ['token'] },
|
|
161
|
+
// OPRA's prints of the chart's underlying (sources/row-lanes/option_prints): the package's ONE acquisition
|
|
162
|
+
// (wrun_option_prints_one_acquisition), so one fetch.
|
|
163
|
+
option_prints: { type: null, payload: [] },
|
|
164
|
+
// OPRA's per-contract flow (sources/row-lanes/option_contract_flow): one read per chart market at the bars' tier;
|
|
165
|
+
// only `0dte` narrows it (nearest expiries, the strike window and the volume floor fold on the chart).
|
|
166
|
+
option_contract_flow: { type: null, payload: ['market', 'expiries'] },
|
|
167
|
+
series: { type: null, payload: ['ref'] },
|
|
168
|
+
// The OPRA flow scope rows (sources/lanes/options_flow): one fetch per scope, dte, moneyness and venue.
|
|
169
|
+
options_flow: { type: null, payload: ['scope', 'dte', 'moneyness', 'venue'] },
|
|
170
|
+
// The statistics of the chart's options chain (sources/lanes/option_daily, a chain lane): one fetch per venue word
|
|
171
|
+
// and book, as the lane plans its instances.
|
|
172
|
+
option_daily: { type: null, payload: ['chain_venue', 'book'] },
|
|
173
|
+
option_stats_10m: { type: null, payload: ['chain_venue', 'book'] },
|
|
174
|
+
});
|
|
175
|
+
/** The kScript source weights (SOURCE_TYPE_CONFIG's `weight`; a type absent
|
|
176
|
+
* here weighs 1). A spec pins the copy. */
|
|
177
|
+
export const WRUN_KSCRIPT_SOURCE_WEIGHTS = Object.freeze({
|
|
178
|
+
orderbook: 2,
|
|
179
|
+
trades: 2,
|
|
180
|
+
trade_volume_by_size: 2,
|
|
181
|
+
});
|
|
182
|
+
/** The skew quote an entry without `delta` reads (wrun-option-summary-lane). */
|
|
183
|
+
const WRUN_SKEW_STANDARD_DELTA = 25;
|
|
184
|
+
/** The options flow venue an entry without `venue` reads (the options_oi and
|
|
185
|
+
* options_volume lanes). */
|
|
186
|
+
const WRUN_OPTIONS_FLOW_STANDARD_VENUE = 'deribit';
|
|
187
|
+
/** The word a chain class's absent `venue` and `book` read (the options
|
|
188
|
+
* chain's `auto`; opra-option-lanes.util WRUN_LANE_CHAIN_BOOK_AUTO). */
|
|
189
|
+
const WRUN_CHAIN_AUTO_WORD = 'auto';
|
|
190
|
+
/** The short interval spellings the kit and the chart lane accept, folded to
|
|
191
|
+
* the kit's words (the kit's WRUN_INTERVAL_ALIASES). */
|
|
192
|
+
const WRUN_INTERVAL_ALIASES = Object.freeze({
|
|
193
|
+
'1m': 'MINUTE',
|
|
194
|
+
'5m': 'FIVE_MINUTES',
|
|
195
|
+
'15m': 'FIFTEEN_MINUTES',
|
|
196
|
+
'30m': 'THIRTY_MINUTES',
|
|
197
|
+
'1h': 'HOUR',
|
|
198
|
+
'4h': 'FOUR_HOURS',
|
|
199
|
+
'1d': 'DAY',
|
|
200
|
+
'1w': 'WEEK',
|
|
201
|
+
'2m': 'TWO_MINUTES',
|
|
202
|
+
'3m': 'THREE_MINUTES',
|
|
203
|
+
'10m': 'TEN_MINUTES',
|
|
204
|
+
'45m': 'FORTY_FIVE_MINUTES',
|
|
205
|
+
'2h': 'TWO_HOURS',
|
|
206
|
+
'6h': 'SIX_HOURS',
|
|
207
|
+
'8h': 'EIGHT_HOURS',
|
|
208
|
+
'12h': 'TWELVE_HOURS',
|
|
209
|
+
'3d': 'THREE_DAYS',
|
|
210
|
+
});
|
|
211
|
+
/** The keys that never shape a fetch: the payload of a class outside the
|
|
212
|
+
* table is every other key. */
|
|
213
|
+
const WRUN_READ_MODIFIER_KEYS = new Set([
|
|
214
|
+
'source',
|
|
215
|
+
'field',
|
|
216
|
+
'view',
|
|
217
|
+
'offset',
|
|
218
|
+
'bars',
|
|
219
|
+
'side',
|
|
220
|
+
'outcome',
|
|
221
|
+
'tenor',
|
|
222
|
+
'missing',
|
|
223
|
+
'binding',
|
|
224
|
+
'bindingClasses',
|
|
225
|
+
'field_param',
|
|
226
|
+
'interval_param',
|
|
227
|
+
'symbol_param',
|
|
228
|
+
'block_size',
|
|
229
|
+
'max_depth',
|
|
230
|
+
'expiries',
|
|
231
|
+
]);
|
|
232
|
+
const hasOwn = (record, key) => Object.prototype.hasOwnProperty.call(record, key);
|
|
233
|
+
function knobWord(value) {
|
|
234
|
+
return typeof value === 'string' && value !== '' ? value : undefined;
|
|
235
|
+
}
|
|
236
|
+
function canonicalInterval(value) {
|
|
237
|
+
const spelled = knobWord(value);
|
|
238
|
+
if (spelled === undefined)
|
|
239
|
+
return null;
|
|
240
|
+
return hasOwn(WRUN_INTERVAL_ALIASES, spelled) ? WRUN_INTERVAL_ALIASES[spelled] : spelled;
|
|
241
|
+
}
|
|
242
|
+
/** A nested knob's canonical form: object keys sorted at every depth. */
|
|
243
|
+
function canonicalValue(value) {
|
|
244
|
+
if (Array.isArray(value))
|
|
245
|
+
return value.map(canonicalValue);
|
|
246
|
+
if (value !== null && typeof value === 'object') {
|
|
247
|
+
const record = value;
|
|
248
|
+
return Object.keys(record)
|
|
249
|
+
.filter((key) => record[key] !== undefined)
|
|
250
|
+
.sort()
|
|
251
|
+
.map((key) => [key, canonicalValue(record[key])]);
|
|
252
|
+
}
|
|
253
|
+
return value ?? null;
|
|
254
|
+
}
|
|
255
|
+
/** A profile stream's bucket size as the profile lane normalizes it (volume-profile.worker.util's
|
|
256
|
+
* `normalizeTicksPerBar`, restated: this module is a leaf; wrun-draft-overlay.util.spec pins the two together), or
|
|
257
|
+
* an unresolved `"@<param>"` as written. */
|
|
258
|
+
function streamTicksPerBar(value) {
|
|
259
|
+
if (typeof value === 'string' && value.startsWith('@'))
|
|
260
|
+
return value;
|
|
261
|
+
const n = Math.floor(Number(value));
|
|
262
|
+
return Number.isFinite(n) && n >= 1 ? Math.min(n, 500) : 1;
|
|
263
|
+
}
|
|
264
|
+
function payloadEntry(key, entry) {
|
|
265
|
+
switch (key) {
|
|
266
|
+
case 'market':
|
|
267
|
+
return ['market', [knobWord(entry.symbol) ?? null, knobWord(entry.exchange) ?? null]];
|
|
268
|
+
case 'odds':
|
|
269
|
+
return ['market', [(knobWord(entry.symbol) ?? '').toLowerCase(), 'POLYMARKET']];
|
|
270
|
+
case 'interval':
|
|
271
|
+
return ['interval', canonicalInterval(entry.interval)];
|
|
272
|
+
case 'expiries':
|
|
273
|
+
return ['expiries', knobWord(entry.expiries) === '0dte' ? '0dte' : 'all'];
|
|
274
|
+
case 'delta':
|
|
275
|
+
return ['delta', typeof entry.delta === 'number' ? entry.delta : WRUN_SKEW_STANDARD_DELTA];
|
|
276
|
+
case 'venue':
|
|
277
|
+
return ['venue', knobWord(entry.venue) ?? WRUN_OPTIONS_FLOW_STANDARD_VENUE];
|
|
278
|
+
case 'chain_venue':
|
|
279
|
+
return ['venue', knobWord(entry.venue) ?? WRUN_CHAIN_AUTO_WORD];
|
|
280
|
+
case 'book': {
|
|
281
|
+
const book = knobWord(entry.book);
|
|
282
|
+
return ['book', book === undefined || book === WRUN_CHAIN_AUTO_WORD ? WRUN_CHAIN_AUTO_WORD : book.toUpperCase()];
|
|
283
|
+
}
|
|
284
|
+
case 'min_size':
|
|
285
|
+
return ['min_size', typeof entry.min_size === 'number' ? entry.min_size : 0];
|
|
286
|
+
case 'history':
|
|
287
|
+
return ['history', knobWord(entry.history) ?? '0'];
|
|
288
|
+
case 'scope':
|
|
289
|
+
return ['scope', knobWord(entry.scope) ?? 'ticker'];
|
|
290
|
+
case 'dte':
|
|
291
|
+
case 'moneyness':
|
|
292
|
+
return [key, knobWord(entry[key]) ?? 'all'];
|
|
293
|
+
case 'stream_currency':
|
|
294
|
+
return ['currency', entry.currency === 'USD' ? 'USD' : 'Coin'];
|
|
295
|
+
case 'ticks_per_bar':
|
|
296
|
+
return ['ticks_per_bar', streamTicksPerBar(entry.ticks_per_bar)];
|
|
297
|
+
default:
|
|
298
|
+
return [key, knobWord(entry[key]) ?? null];
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
/** The kScript weight of a source type (1 for anything SOURCE_TYPE_CONFIG
|
|
302
|
+
* does not weigh, and for no type). */
|
|
303
|
+
export function wrunKScriptSourceWeight(type) {
|
|
304
|
+
return type !== null && hasOwn(WRUN_KSCRIPT_SOURCE_WEIGHTS, type) ? WRUN_KSCRIPT_SOURCE_WEIGHTS[type] : 1;
|
|
305
|
+
}
|
|
306
|
+
/** The kScript source an input-source entry reads, or null when it reads
|
|
307
|
+
* nothing chargeable (the chart spine, the bar clock, no class at all). */
|
|
308
|
+
export function wrunKScriptSourceOf(value) {
|
|
309
|
+
if (!value || typeof value !== 'object')
|
|
310
|
+
return null;
|
|
311
|
+
const entry = value;
|
|
312
|
+
const sourceClass = knobWord(entry.source);
|
|
313
|
+
if (sourceClass === undefined)
|
|
314
|
+
return null;
|
|
315
|
+
const mapping = hasOwn(WRUN_KSCRIPT_SOURCE_CLASSES, sourceClass) ? WRUN_KSCRIPT_SOURCE_CLASSES[sourceClass] : null;
|
|
316
|
+
if (mapping?.free)
|
|
317
|
+
return null;
|
|
318
|
+
if (sourceClass === 'ohlcv' &&
|
|
319
|
+
knobWord(entry.symbol) === undefined &&
|
|
320
|
+
knobWord(entry.exchange) === undefined &&
|
|
321
|
+
knobWord(entry.interval) === undefined) {
|
|
322
|
+
return null;
|
|
323
|
+
}
|
|
324
|
+
const field = knobWord(entry.field) ?? '';
|
|
325
|
+
const type = mapping === null
|
|
326
|
+
? null
|
|
327
|
+
: mapping.typeByField
|
|
328
|
+
? hasOwn(mapping.typeByField, field)
|
|
329
|
+
? mapping.typeByField[field]
|
|
330
|
+
: null
|
|
331
|
+
: mapping.type;
|
|
332
|
+
const payload = mapping === null
|
|
333
|
+
? Object.keys(entry)
|
|
334
|
+
.filter((key) => !WRUN_READ_MODIFIER_KEYS.has(key) && entry[key] !== undefined)
|
|
335
|
+
.map((key) => [
|
|
336
|
+
key,
|
|
337
|
+
key === 'interval' ? canonicalInterval(entry[key]) : canonicalValue(entry[key]),
|
|
338
|
+
])
|
|
339
|
+
: mapping.payload.map((key) => payloadEntry(key, entry));
|
|
340
|
+
payload.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));
|
|
341
|
+
return { type, key: JSON.stringify([type ?? `wrun:${sourceClass}`, payload]), weight: wrunKScriptSourceWeight(type) };
|
|
342
|
+
}
|
|
343
|
+
/** The slot charge of a sheet in kScript's unit (the rule above): the
|
|
344
|
+
* weighted count of the distinct kScript sources its entries read, never
|
|
345
|
+
* below 1. */
|
|
346
|
+
export function wrunMetadataSourceCount(metadata) {
|
|
347
|
+
const weights = new Map();
|
|
348
|
+
for (const value of Object.values(metadata.inputSources ?? {})) {
|
|
349
|
+
const source = wrunKScriptSourceOf(value);
|
|
350
|
+
if (source !== null && !weights.has(source.key))
|
|
351
|
+
weights.set(source.key, source.weight);
|
|
352
|
+
}
|
|
353
|
+
let charge = 0;
|
|
354
|
+
for (const weight of weights.values())
|
|
355
|
+
charge += weight;
|
|
356
|
+
return Math.max(1, charge);
|
|
357
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The skipped draw calls' row code and the run-owned code set its notice replaces (a leaf of
|
|
3
|
+
* utility/scriptEditor/runtime-diagnostics.util.ts and utility/wrun/wrun-skipped-notice.util.ts; P2/inventory.md section
|
|
4
|
+
* 1.1): the wrun executor reads the set (its refusal note codes and its owned rows). Constants only, no imports, so it
|
|
5
|
+
* moves into the chart-host package with the phase 2 closure; both old modules import and re-export what they held.
|
|
6
|
+
* The set stays a `const` `ReadonlySet` over a literal, never written (the phase 2 leaf-state guard's immutable form).
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* A wrun run that skipped draw calls one bar's values could not carry (a label at x = NaN, a style value out of
|
|
10
|
+
* range, an unwritten slot: om docs/WRUN3_ABI.md "Skipped calls", WRUN-REPORTS-CLASSES C3). The run drew the rest;
|
|
11
|
+
* ONE warning row per Indicator says how many and names the first (wrun-skipped-notice.util), and its fix speaks to
|
|
12
|
+
* the code, so the legend never lends it (AUTHOR_ONLY_FIX_CODES).
|
|
13
|
+
*/
|
|
14
|
+
export declare const WRUN_DRAW_SKIPPED_CODE = "WRUN_DRAW_SKIPPED";
|
|
15
|
+
/** The run-owned row code set this notice replaces per full run. */
|
|
16
|
+
export declare const WRUN_DRAW_SKIPPED_ROW_CODES: ReadonlySet<string>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The skipped draw calls' row code and the run-owned code set its notice replaces (a leaf of
|
|
3
|
+
* utility/scriptEditor/runtime-diagnostics.util.ts and utility/wrun/wrun-skipped-notice.util.ts; P2/inventory.md section
|
|
4
|
+
* 1.1): the wrun executor reads the set (its refusal note codes and its owned rows). Constants only, no imports, so it
|
|
5
|
+
* moves into the chart-host package with the phase 2 closure; both old modules import and re-export what they held.
|
|
6
|
+
* The set stays a `const` `ReadonlySet` over a literal, never written (the phase 2 leaf-state guard's immutable form).
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* A wrun run that skipped draw calls one bar's values could not carry (a label at x = NaN, a style value out of
|
|
10
|
+
* range, an unwritten slot: om docs/WRUN3_ABI.md "Skipped calls", WRUN-REPORTS-CLASSES C3). The run drew the rest;
|
|
11
|
+
* ONE warning row per Indicator says how many and names the first (wrun-skipped-notice.util), and its fix speaks to
|
|
12
|
+
* the code, so the legend never lends it (AUTHOR_ONLY_FIX_CODES).
|
|
13
|
+
*/
|
|
14
|
+
export const WRUN_DRAW_SKIPPED_CODE = 'WRUN_DRAW_SKIPPED';
|
|
15
|
+
/** The run-owned row code set this notice replaces per full run. */
|
|
16
|
+
export const WRUN_DRAW_SKIPPED_ROW_CODES = new Set([WRUN_DRAW_SKIPPED_CODE]);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { WrunIndicatorMetadata } from '../../interfaces/wrun-runtime.interface.js';
|
|
2
|
+
import type { MarketEvent } from '../../interfaces/market-event.interface.js';
|
|
3
|
+
import { type EarningsScope } from '../market-events/earnings-scope.util.js';
|
|
4
|
+
/** The host_fill words of the earnings facts, in declaration order (om `WRUN_EARNINGS_FACT_FILLS`). */
|
|
5
|
+
export declare const WRUN_EARNINGS_FACT_FILLS: readonly string[];
|
|
6
|
+
/** The facts as the host fill carries them; 0 for each fact the chart does not know. */
|
|
7
|
+
export interface WrunEarningsFacts {
|
|
8
|
+
earningsNextMs: number;
|
|
9
|
+
earningsPrevMs: number;
|
|
10
|
+
earningsSession: number;
|
|
11
|
+
}
|
|
12
|
+
/** How long a run waits for the earnings window's first answer before it fills what the store holds (0 when none). */
|
|
13
|
+
export declare const WRUN_EARNINGS_WARM_TIMEOUT_MS = 3000;
|
|
14
|
+
/** The chart market an earnings read names: its exchange, symbol and coin, as the chart metadata holds them. */
|
|
15
|
+
export interface WrunEarningsMarket {
|
|
16
|
+
exchange?: unknown;
|
|
17
|
+
symbol?: unknown;
|
|
18
|
+
coin?: unknown;
|
|
19
|
+
}
|
|
20
|
+
/** True when the sheet declares an earnings fact (a host-filled param on one of the three words). */
|
|
21
|
+
export declare function wrunReadsEarningsFacts(metadata: Pick<WrunIndicatorMetadata, 'params'> | undefined): boolean;
|
|
22
|
+
/** The ticker whose reports a chart reads: a US stock chart's own, an OPRA contract chart's underlying; else null. */
|
|
23
|
+
export declare function wrunEarningsTickerOf(market: WrunEarningsMarket | undefined): string | null;
|
|
24
|
+
/** The earnings window a chart holds for `ticker` (the pips' and the Events tab's own: the stored horizon). */
|
|
25
|
+
export declare function wrunEarningsScopeOf(ticker: string, nowMs: number): EarningsScope;
|
|
26
|
+
/** The facts of `ticker` among the earnings rows `events`, at `nowMs` (pure). */
|
|
27
|
+
export declare function wrunEarningsFactsOf(events: readonly MarketEvent[], ticker: string, nowMs: number): WrunEarningsFacts;
|
|
28
|
+
/**
|
|
29
|
+
* The facts the chart fills for `market` now (synchronous): off the earnings window the store holds for its ticker
|
|
30
|
+
* (warmed by `warmWrunEarningsFacts`, or held by the chart's pips), 0 for each fact the window does not answer.
|
|
31
|
+
*/
|
|
32
|
+
export declare function wrunEarningsFactsFor(market: WrunEarningsMarket | undefined, nowMs?: number): WrunEarningsFacts;
|
|
33
|
+
/**
|
|
34
|
+
* Warm the earnings window of `market`'s ticker before a host fill reads it: hold it (the first holder fetches it),
|
|
35
|
+
* wait for its first answer up to `timeoutMs`, and release the hold when that fetch settles (the store keeps the rows
|
|
36
|
+
* five minutes). The deadline ends the WAIT only: a release there would park the window and abort its own fetch
|
|
37
|
+
* whenever this run is its only holder, so a backend slower than the deadline would never fill the facts. Never
|
|
38
|
+
* rejects; a chart with no ticker asks nothing.
|
|
39
|
+
*/
|
|
40
|
+
export declare function warmWrunEarningsFacts(market: WrunEarningsMarket | undefined, timeoutMs?: number, nowMs?: number): Promise<void>;
|
|
41
|
+
/** Spec hook: forget the resolved store. */
|
|
42
|
+
export declare function __resetWrunEarningsFactsForTest(): void;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The issuer's earnings facts a wrun package reads (UW-PARITY S8; om `WRUN_EARNINGS_FACT_FILLS`, the host_fill words
|
|
3
|
+
* after the five market facts): `market.earnings_next_ms()` and `market.earnings_prev_ms()` (epoch ms, read through
|
|
4
|
+
* the kit's `earningsMs()`, which turns the 0 a host writes for an unknown date into NaN) and
|
|
5
|
+
* `market.earnings_session()` (+1 before the open, -1 after the close, 0 unknown). The chart's browser lane is the one
|
|
6
|
+
* host that fills them; every other lane writes 0, and the cloud, alerts and the om daemon refuse a package reading
|
|
7
|
+
* them (om, U9). Multi-report history is not served.
|
|
8
|
+
*
|
|
9
|
+
* Where they come from: the market-events earnings rows the app already loads for the chart's stock (the chart's
|
|
10
|
+
* earnings pips and the Events tab hold the same window, `subscribeEarnings` over the ticker's whole stored horizon:
|
|
11
|
+
* one slice, one poll, no new backend). A run whose sheet reads a fact warms that window before its host fill
|
|
12
|
+
* (`warmWrunEarningsFacts`: the first answer, bounded by a deadline, the hold released after; the store keeps the
|
|
13
|
+
* rows five minutes) and reads it synchronously there (`wrunEarningsFactsFor`).
|
|
14
|
+
*
|
|
15
|
+
* The facts, at the run's clock (`wrunEarningsFactsOf`): the next report is the earliest one not released yet, the
|
|
16
|
+
* last report the newest one released (market-events.util `isReleased`: an actual printed, or its instant passed),
|
|
17
|
+
* and the session the next report's slot (`earningsSlot`: the served slot, else its Eastern clock; a date-only row's
|
|
18
|
+
* slot is unknown, and its instant is the calendar's 09:30 New York placeholder). Charts: a US stock chart (its
|
|
19
|
+
* ticker, `paneTicker`) and an OPRA contract chart (its underlying, the chart's coin); any other reads 0.
|
|
20
|
+
*/
|
|
21
|
+
import { wrunChartHostEnv } from '../../host-env.js';
|
|
22
|
+
import { EARNINGS_TICKER_PATTERN, earningsScopeKey, tickerWindow, } from '../market-events/earnings-scope.util.js';
|
|
23
|
+
import { earningsSlot, isReleased, paneTicker } from '../market-events/market-events.util.js';
|
|
24
|
+
/** The host_fill words of the earnings facts, in declaration order (om `WRUN_EARNINGS_FACT_FILLS`). */
|
|
25
|
+
export const WRUN_EARNINGS_FACT_FILLS = Object.freeze(['earnings_next_ms', 'earnings_prev_ms', 'earnings_session']);
|
|
26
|
+
const UNKNOWN = Object.freeze({ earningsNextMs: 0, earningsPrevMs: 0, earningsSession: 0 });
|
|
27
|
+
/** How long a run waits for the earnings window's first answer before it fills what the store holds (0 when none). */
|
|
28
|
+
export const WRUN_EARNINGS_WARM_TIMEOUT_MS = 3_000;
|
|
29
|
+
const DAY_MS = 86_400_000;
|
|
30
|
+
/** True when the sheet declares an earnings fact (a host-filled param on one of the three words). */
|
|
31
|
+
export function wrunReadsEarningsFacts(metadata) {
|
|
32
|
+
return (metadata?.params ?? []).some((param) => {
|
|
33
|
+
const fill = param.host_fill;
|
|
34
|
+
return fill !== undefined && WRUN_EARNINGS_FACT_FILLS.includes(fill);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/** The ticker whose reports a chart reads: a US stock chart's own, an OPRA contract chart's underlying; else null. */
|
|
38
|
+
export function wrunEarningsTickerOf(market) {
|
|
39
|
+
const exchange = typeof market?.exchange === 'string' ? market.exchange : undefined;
|
|
40
|
+
const symbol = typeof market?.symbol === 'string' ? market.symbol : undefined;
|
|
41
|
+
const stock = paneTicker({ exchange, symbol });
|
|
42
|
+
if (stock !== null)
|
|
43
|
+
return stock;
|
|
44
|
+
if (exchange !== 'OPRA')
|
|
45
|
+
return null;
|
|
46
|
+
const coin = typeof market?.coin === 'string' ? market.coin.trim().toUpperCase() : '';
|
|
47
|
+
return EARNINGS_TICKER_PATTERN.test(coin) ? coin : null;
|
|
48
|
+
}
|
|
49
|
+
/** The earnings window a chart holds for `ticker` (the pips' and the Events tab's own: the stored horizon). */
|
|
50
|
+
export function wrunEarningsScopeOf(ticker, nowMs) {
|
|
51
|
+
return { kind: 'earnings', ticker, majorOnly: false, ...tickerWindow(Math.floor(nowMs / DAY_MS) * DAY_MS) };
|
|
52
|
+
}
|
|
53
|
+
/** The facts of `ticker` among the earnings rows `events`, at `nowMs` (pure). */
|
|
54
|
+
export function wrunEarningsFactsOf(events, ticker, nowMs) {
|
|
55
|
+
let next;
|
|
56
|
+
let prev;
|
|
57
|
+
for (const event of events) {
|
|
58
|
+
if (event.kind !== 'earnings' || event.earnings?.ticker?.toUpperCase() !== ticker)
|
|
59
|
+
continue;
|
|
60
|
+
if (!Number.isFinite(event.at))
|
|
61
|
+
continue;
|
|
62
|
+
if (isReleased(event, nowMs)) {
|
|
63
|
+
if (prev === undefined || event.at > prev.at)
|
|
64
|
+
prev = event;
|
|
65
|
+
}
|
|
66
|
+
else if (next === undefined || event.at < next.at) {
|
|
67
|
+
next = event;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const slot = next === undefined ? null : earningsSlot(next);
|
|
71
|
+
return {
|
|
72
|
+
earningsNextMs: next?.at ?? 0,
|
|
73
|
+
earningsPrevMs: prev?.at ?? 0,
|
|
74
|
+
earningsSession: slot === 'bmo' ? 1 : slot === 'amc' ? -1 : 0,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
let earningsStore;
|
|
78
|
+
/**
|
|
79
|
+
* The facts the chart fills for `market` now (synchronous): off the earnings window the store holds for its ticker
|
|
80
|
+
* (warmed by `warmWrunEarningsFacts`, or held by the chart's pips), 0 for each fact the window does not answer.
|
|
81
|
+
*/
|
|
82
|
+
export function wrunEarningsFactsFor(market, nowMs = Date.now()) {
|
|
83
|
+
const ticker = wrunEarningsTickerOf(market);
|
|
84
|
+
if (ticker === null || earningsStore === undefined)
|
|
85
|
+
return UNKNOWN;
|
|
86
|
+
const slice = earningsStore.earningsSlice(earningsScopeKey(wrunEarningsScopeOf(ticker, nowMs)));
|
|
87
|
+
return wrunEarningsFactsOf(slice.events, ticker, nowMs);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Warm the earnings window of `market`'s ticker before a host fill reads it: hold it (the first holder fetches it),
|
|
91
|
+
* wait for its first answer up to `timeoutMs`, and release the hold when that fetch settles (the store keeps the rows
|
|
92
|
+
* five minutes). The deadline ends the WAIT only: a release there would park the window and abort its own fetch
|
|
93
|
+
* whenever this run is its only holder, so a backend slower than the deadline would never fill the facts. Never
|
|
94
|
+
* rejects; a chart with no ticker asks nothing.
|
|
95
|
+
*/
|
|
96
|
+
export async function warmWrunEarningsFacts(market, timeoutMs = WRUN_EARNINGS_WARM_TIMEOUT_MS, nowMs = Date.now()) {
|
|
97
|
+
const ticker = wrunEarningsTickerOf(market);
|
|
98
|
+
if (ticker === null)
|
|
99
|
+
return;
|
|
100
|
+
try {
|
|
101
|
+
if (earningsStore === undefined) {
|
|
102
|
+
const { useMarketEventsStore } = await wrunChartHostEnv().market.loadMarketEventsStore();
|
|
103
|
+
earningsStore = useMarketEventsStore();
|
|
104
|
+
}
|
|
105
|
+
const store = earningsStore;
|
|
106
|
+
const hold = store.subscribeEarnings(wrunEarningsScopeOf(ticker, nowMs));
|
|
107
|
+
if (store.earningsSlice(hold.key).status !== 'loading') {
|
|
108
|
+
hold.release();
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
// The hold lives until the fetch settles, success or failure, whenever the wait below gives up.
|
|
112
|
+
const settled = Promise.resolve()
|
|
113
|
+
.then(() => store.refreshEarnings(hold.key))
|
|
114
|
+
.catch(() => undefined)
|
|
115
|
+
.finally(() => hold.release());
|
|
116
|
+
let timer;
|
|
117
|
+
await Promise.race([
|
|
118
|
+
settled,
|
|
119
|
+
new Promise((resolve) => {
|
|
120
|
+
timer = setTimeout(resolve, timeoutMs);
|
|
121
|
+
}),
|
|
122
|
+
]).finally(() => clearTimeout(timer));
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
// No store, a failed fetch: the facts read what the store holds (0 when nothing).
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/** Spec hook: forget the resolved store. */
|
|
129
|
+
export function __resetWrunEarningsFactsForTest() {
|
|
130
|
+
earningsStore = undefined;
|
|
131
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { WrunDeclaredDepthAsk } from '../../host-ports.types.js';
|
|
2
|
+
/** The kScript first run's bound on an in-flight main candle fetch (LOCAL_KSCRIPT_FIRST_RUN_MAIN_FETCH_WAIT_MS). */
|
|
3
|
+
export declare const WRUN_FIRST_RUN_MAIN_FETCH_WAIT_MS = 4000;
|
|
4
|
+
/** The kScript first run's poll between its rounds (LOCAL_KSCRIPT_FIRST_RUN_DEPTH_POLL_MS). */
|
|
5
|
+
export declare const WRUN_FIRST_RUN_DEPTH_POLL_MS = 100;
|
|
6
|
+
/**
|
|
7
|
+
* The whole ordering's ceiling. The kScript lane holds its first run up to 75 s; a wrun first run
|
|
8
|
+
* rides inside the add's 90 s compute deadline (WRUN_RUN_DEADLINE_MS) with its own fetches and
|
|
9
|
+
* sandbox run after the ordering, so the ordering takes half of it. Past the ceiling the run computes
|
|
10
|
+
* on the rows at hand and the post-run ask owes the rest, as on the kScript lane.
|
|
11
|
+
*/
|
|
12
|
+
export declare const WRUN_FIRST_RUN_DEPTH_HOLD_CEILING_MS = 45000;
|
|
13
|
+
/**
|
|
14
|
+
* How the ordering ended: `fits` (the declaration fits the loaded window, or the window is
|
|
15
|
+
* unreadable: nothing owed), `superseded` (the run stopped standing), `ceiling` (pages were asked
|
|
16
|
+
* until the ceiling), `read-failed`, else the decider's own last word (`rounds-exhausted`,
|
|
17
|
+
* `left-exhausted`, `no-progress`, `gesture-active` after the retries, ...).
|
|
18
|
+
*/
|
|
19
|
+
export type WrunFirstRunDepthOutcome = string;
|
|
20
|
+
export interface WrunFirstRunDepthInput extends Omit<WrunDeclaredDepthAsk, 'ringDetails'> {
|
|
21
|
+
intervalMs: number;
|
|
22
|
+
/** The run still stands (its chart and overlay; the run pass's own `isCurrent`). */
|
|
23
|
+
isCurrent: () => boolean;
|
|
24
|
+
/** An in-flight main candle fetch (data-fetching.util `isMainCandleFetchInFlight`); absent, none. */
|
|
25
|
+
isMainCandleFetchInFlight?: () => boolean;
|
|
26
|
+
/** Test seams: the clock and the wait between polls. */
|
|
27
|
+
now?: () => number;
|
|
28
|
+
tick?: (ms: number) => Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
/** Order the history a twin's first run computes on (see the module note); resolves with the outcome
|
|
31
|
+
* and logs it as `wrun-first-run-declared-depth`. Never throws. */
|
|
32
|
+
export declare function orderWrunFirstRunHistory(input: WrunFirstRunDepthInput): Promise<WrunFirstRunDepthOutcome>;
|