@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,719 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mounted browser-WRUN overlay registry: the chart-lifecycle seam between the
|
|
3
|
+
* wrun loaders (services/wrun-dev-loader.service.ts,
|
|
4
|
+
* services/wrun-registry-loader.service.ts) and the chart's shared triggers
|
|
5
|
+
* (the lazy-load indicator wave in instances/titan-charts.ts and the live
|
|
6
|
+
* fan-out in services/live-feed.service.ts).
|
|
7
|
+
*
|
|
8
|
+
* Each loader registers a DRIVER when it mounts an overlay: chart placement,
|
|
9
|
+
* an isMounted probe, and the loader's own full-recompute entry point. The
|
|
10
|
+
* chart triggers only consult this registry; they never import a loader, so
|
|
11
|
+
* the dependency arrow stays instances -> utility.
|
|
12
|
+
*
|
|
13
|
+
* Failure policy: a failed recompute NEVER breaks the rendered overlay. The
|
|
14
|
+
* run only integrates on success, so the last good result stays mounted and
|
|
15
|
+
* the failure logs. The executor never words a failure itself: the run pass
|
|
16
|
+
* (and the loader, for its own phases) project each one as a refusal record
|
|
17
|
+
* through the common surface (wrun-refusal-surface.util), which toasts at
|
|
18
|
+
* most once per failed attempt a person made.
|
|
19
|
+
*
|
|
20
|
+
* Refusal attempts (WRUN-REFUSALS amendment 9): every run answers one attempt
|
|
21
|
+
* token, resolved before the run starts so the run pass reads it before its
|
|
22
|
+
* first await. A request a person made (a Retry, a settings save, a switch)
|
|
23
|
+
* opens a user attempt; 'initial' keeps the token the loader opened at mount
|
|
24
|
+
* (a user add, or a restore that is system); every other request is the
|
|
25
|
+
* chart's own and opens a system attempt, unless a user attempt is still
|
|
26
|
+
* waiting on its first answer (it keeps that one, so an automatic run in
|
|
27
|
+
* between never takes its notice away). A teardown closes the overlay's
|
|
28
|
+
* attempts, so a late settlement claims nothing.
|
|
29
|
+
*
|
|
30
|
+
* Every run carries a reason and, optionally, a clamped window (the shared
|
|
31
|
+
* vocabulary of wrun-lifecycle.contract.ts). Requests queued behind a run
|
|
32
|
+
* merge into its one follow-up by rank, and each one's caller waits for that
|
|
33
|
+
* follow-up (a settings save's tail settles after the run that computes its
|
|
34
|
+
* settings, never after the run that was already in flight); a pan wave
|
|
35
|
+
* asking for rows the last good run already computed over the same main rows
|
|
36
|
+
* is skipped (the kScript wave's duplicate-range rule, widened to coverage: a
|
|
37
|
+
* pan-back page's live rebuild already computed the rows its wave then asks
|
|
38
|
+
* for). Settled runs and successful computes are announced through hooks, so
|
|
39
|
+
* the lifecycle door and the recovery ladders follow the executor without
|
|
40
|
+
* this module importing them.
|
|
41
|
+
*
|
|
42
|
+
* Settings sync (SETTINGS-RAPID-TOGGLE C1, C4): every settled run reports the
|
|
43
|
+
* settings generation it computed with and its outcome (applied, dropped,
|
|
44
|
+
* held, failed) to the chart store's `noteIndicatorSettingsSettled`, with a
|
|
45
|
+
* `settings-run-settled` ring event, so a failed or held trailing run reaches
|
|
46
|
+
* the store's reconcile instead of keeping the last good picture silently.
|
|
47
|
+
* The run pass notes the generation and the outcome
|
|
48
|
+
* (`noteWrunOverlayRunSettle`); the report goes out after the follow-up
|
|
49
|
+
* decision, so `isWrunOverlayFullRerunInFlight` answers whether a run computing
|
|
50
|
+
* newer settings over the whole loaded window is already on its way. A run
|
|
51
|
+
* over a partial window (a pan page) computes its rows only and keeps the
|
|
52
|
+
* mounted rows and the live session outside it: it reports nothing.
|
|
53
|
+
*
|
|
54
|
+
* Prefix runs (C1 v3): a pan wave the door planned as a prefix run rides
|
|
55
|
+
* the executor tagged; it is replanned when it starts (its prefix window,
|
|
56
|
+
* the wave whole, or no run when nothing is left), any full request merged
|
|
57
|
+
* with it wins, and its coverage counts only once its commit landed. The
|
|
58
|
+
* plan itself lives with the run pass (`setWrunPrefixRuntime`).
|
|
59
|
+
*
|
|
60
|
+
* Unanswered drops (C4's backstop): a dropped run settles quietly on the
|
|
61
|
+
* promise that a newer run reports for the overlay. When the follow-up
|
|
62
|
+
* decision finds none (nothing queued, and no first-compute waiter, whose
|
|
63
|
+
* loader keeps its own deadline), the executor arms ONE visible-time run
|
|
64
|
+
* deadline (`WRUN_RUN_DEADLINE_MS`) for the overlay, first run or rerun. A
|
|
65
|
+
* full run that starts clears it (a run in flight is the answer until it
|
|
66
|
+
* settles; dropped again with nothing after it, it arms a fresh one), and so
|
|
67
|
+
* do any run that fails or is held (each says what the overlay shows), a
|
|
68
|
+
* buffer reseed that draws (`noteWrunOverlayWholeWindowDrawn`), a waiter
|
|
69
|
+
* latching, a re-register, a pause and a teardown. If it fires, the run pass
|
|
70
|
+
* (`setWrunUnansweredDropSurface`) shows the run deadline's retryable
|
|
71
|
+
* not-reached record with the cause `superseded` and settles the mount's
|
|
72
|
+
* attempt with it: a quiet settle that nothing answered ends in a chip and a
|
|
73
|
+
* counted failure, never a blank row. The surface works across awaits, so it
|
|
74
|
+
* re-checks `isCurrent()`: anything that would have cleared the deadline also
|
|
75
|
+
* retires a surface already on its way.
|
|
76
|
+
*/
|
|
77
|
+
import type { WrunStrategyRunInput } from './wrun-host.service.js';
|
|
78
|
+
import { WrunDeadlineError } from './wrun-registry-errors.util.js';
|
|
79
|
+
import { type WrunRefusalAttemptToken } from './wrun-refusal.util.js';
|
|
80
|
+
import type { WrunIndicatorMetadata, WrunModuleHandle, WrunOutputRow } from '../../interfaces/wrun-runtime.interface.js';
|
|
81
|
+
import type { WrunCandleGroup, WrunFillPair } from '../chart/wrun-run-result.util.js';
|
|
82
|
+
import type { WrunLaneAcquisition, WrunLiveLane } from './wrun-live-intake.util.js';
|
|
83
|
+
import type { WrunPollLaneInstance } from './sources/wrun-poll-lane.types.js';
|
|
84
|
+
import type { WrunRowLaneInstance } from './sources/wrun-row-lane.types.js';
|
|
85
|
+
import type { WrunLiveApplied } from './wrun-live-patch.util.js';
|
|
86
|
+
import type { WrunCandleEvidence, WrunCandleFingerprint } from './wrun-prefix-proof.util.js';
|
|
87
|
+
import type { WrunInputCarry, WrunPinnedLeg } from './wrun-source-rows.util.js';
|
|
88
|
+
import type { WrunRetainedRange } from './wrun-run-retained.util.js';
|
|
89
|
+
import type { WrunRerunOptions, WrunRunSettledEvent, WrunRunWindow } from './wrun-lifecycle.contract.js';
|
|
90
|
+
export interface WrunOverlayDriver {
|
|
91
|
+
chartIndex: number;
|
|
92
|
+
/** True while the overlay's TECHNICAL_SCRIPT record is still on the chart. */
|
|
93
|
+
isMounted(): boolean;
|
|
94
|
+
/** The loader's full compute-and-integrate pass (rebuilds the live session
|
|
95
|
+
* when one is armed). The executor always names the reason; a window
|
|
96
|
+
* clamps the compute, its absence means the whole loaded window. */
|
|
97
|
+
rerun(options?: WrunRerunOptions): Promise<void>;
|
|
98
|
+
}
|
|
99
|
+
/** How a settled run left the overlay's requested settings (C1's outcomes):
|
|
100
|
+
* `applied`, the chart shows what it computed; `dropped`, superseded (a newer
|
|
101
|
+
* compute save, another chart, overlay or replay: the run that follows
|
|
102
|
+
* computes for the current ones); `held`, a pause, a trip, the venue wall or
|
|
103
|
+
* a source the ladder waits on (each has its own way back); `failed`,
|
|
104
|
+
* anything else (the last good picture stays, the store's reconcile reruns). */
|
|
105
|
+
export type WrunSettingsRunOutcome = 'applied' | 'dropped' | 'held' | 'failed';
|
|
106
|
+
/** What a run settled with, as the run pass notes it (`noteWrunOverlayRunSettle`):
|
|
107
|
+
* the settings generation it computed with (the compute revision its params
|
|
108
|
+
* were read under, else the one at its head) and its outcome. */
|
|
109
|
+
export interface WrunRunSettleNote {
|
|
110
|
+
generation: number;
|
|
111
|
+
outcome: WrunSettingsRunOutcome;
|
|
112
|
+
reason?: string;
|
|
113
|
+
}
|
|
114
|
+
/** Register (or clear, with null) the chart main-rows identity reader the
|
|
115
|
+
* pan wave's coverage skip compares runs by. */
|
|
116
|
+
export declare function setWrunChartRowsIdentityReader(reader: ((chartIndex: number, indicatorId?: string) => string | undefined) | null): void;
|
|
117
|
+
/** Subscribe to every settled executor run (wave, initial compute, follow-up):
|
|
118
|
+
* once per run, with the run's reason and outcome. Returns the unsubscribe. */
|
|
119
|
+
export declare function onWrunOverlayRunSettled(fn: (event: WrunRunSettledEvent) => void): () => void;
|
|
120
|
+
/** Subscribe to the run pass's success marker (`markWrunOverlayComputeSucceeded`),
|
|
121
|
+
* with the driver's chart index. Returns the unsubscribe. */
|
|
122
|
+
export declare function onWrunOverlayComputeSucceeded(fn: (indicatorId: string, chartIndex: number) => void): () => void;
|
|
123
|
+
/** Everything a live forming-bar tick needs to extend the last full run
|
|
124
|
+
* without re-executing history: the run's presentation context, the merged
|
|
125
|
+
* full-range output rows (the render source of truth), and the cached
|
|
126
|
+
* secondary-lane rows the tick tops up incrementally. Stored by the run
|
|
127
|
+
* pass on every successful LIVE run; absence means no live session. */
|
|
128
|
+
export interface WrunOverlayLiveContext {
|
|
129
|
+
chartIndex: number;
|
|
130
|
+
indicatorId: string;
|
|
131
|
+
metadata: WrunIndicatorMetadata;
|
|
132
|
+
title: string;
|
|
133
|
+
position: 'onchart' | 'offchart';
|
|
134
|
+
axis: boolean;
|
|
135
|
+
colors?: Record<string, string>;
|
|
136
|
+
fills?: WrunFillPair[];
|
|
137
|
+
candles?: WrunCandleGroup[];
|
|
138
|
+
fetchKey: string;
|
|
139
|
+
/** Full-range outputs, kept in ts order; ticks merge into this. */
|
|
140
|
+
outputRows: WrunOutputRow[];
|
|
141
|
+
/** What the run computed, stamped at install (wrunRunComputeIdentity): the package version and the
|
|
142
|
+
* arm's param map over the settings the run read. The arm parity check sends these rows only for
|
|
143
|
+
* an arm of the same identity; a save leaves the previous context until the rerun installs its
|
|
144
|
+
* own. Absent on contexts stored before this field existed and on a draft: never sent. */
|
|
145
|
+
computeIdentity?: string;
|
|
146
|
+
/** An editor draft (isWrunDraftOverlaySettings): the run seam raised its run-health
|
|
147
|
+
* verdict (wrun-run-health.util) and the live session keeps it honest. */
|
|
148
|
+
draft: boolean;
|
|
149
|
+
/** Health warnings are published for this draft right now: a tick or reseed that changes
|
|
150
|
+
* the verdict (the session starts drawing) republishes; a healthy draft costs a tick nothing. */
|
|
151
|
+
runHealthWarned: boolean;
|
|
152
|
+
/** The market identity the run computed on (wrunChartMarketIdentity): a
|
|
153
|
+
* mismatch against the chart's current identity means the dataset was
|
|
154
|
+
* swapped under the session (an in-place symbol or interval switch whose
|
|
155
|
+
* new window happens to start on the same bar), so a tick must hand the
|
|
156
|
+
* rebuild to the full-run driver instead of stitching the new market's
|
|
157
|
+
* tail onto the old market's history. Absent on contexts stored before
|
|
158
|
+
* this field existed: treated as matching. */
|
|
159
|
+
marketIdentity?: string;
|
|
160
|
+
/** The chart stream identity the live fan-out compares frames to (the
|
|
161
|
+
* alias-aware matcher: a continuous chart's frames arrive under the
|
|
162
|
+
* resolved lead contract, a delivery symbol's under its wire exchange,
|
|
163
|
+
* a normalized symbol's under its normalized form). Absent on contexts
|
|
164
|
+
* stored before this field existed: the intake parses `marketIdentity`. */
|
|
165
|
+
market?: {
|
|
166
|
+
exchange?: string;
|
|
167
|
+
symbol?: string;
|
|
168
|
+
normalizedSymbol?: string;
|
|
169
|
+
resolvedContract?: string;
|
|
170
|
+
/** The chart's session at the run (`metadata.sessionType`): the session every leg's
|
|
171
|
+
* history was fetched under, so the live intake buckets a stock leg on the same bars. */
|
|
172
|
+
sessionType?: string;
|
|
173
|
+
};
|
|
174
|
+
/** First candle ts of the run's window: a mismatch against the chart's
|
|
175
|
+
* current first row means history changed (lazy-load prepend), so a tick
|
|
176
|
+
* must yield to the full-range wave instead of extending the session. */
|
|
177
|
+
firstRowTs: number;
|
|
178
|
+
/** The live session's last evaluated ts (the forming bar). */
|
|
179
|
+
lastRowTs: number;
|
|
180
|
+
/** The chart shape (market identity plus first row ts) the live tick last
|
|
181
|
+
* handed a rebuild to the full-run driver for. A failed rerun keeps this
|
|
182
|
+
* context (keep-last-good) and the mismatch with it, so the tick hands off
|
|
183
|
+
* once per shape instead of re-firing the full run on every drain; a
|
|
184
|
+
* successful rerun replaces the context and the latch with it. */
|
|
185
|
+
rebuildHandoffShape?: string;
|
|
186
|
+
/** The live source buffers (the row builder's own lanes): the last full
|
|
187
|
+
* run's fetched rows, extended by the push intake's folds and corrected
|
|
188
|
+
* by the reconcile fetches. Undeclared lanes stay undefined. */
|
|
189
|
+
bookRows?: ArrayLike<number>[];
|
|
190
|
+
buySellVolumeRows?: ArrayLike<number>[];
|
|
191
|
+
/** The buy/sell lane asked in dollars (`trades_usd`): read by the trades
|
|
192
|
+
* inputs that ask `currency: "USD"`. */
|
|
193
|
+
buySellVolumeUsdRows?: ArrayLike<number>[];
|
|
194
|
+
/** The trades leg lanes the full run asked (kit 0.77.0), by leg lane id: push lanes like the
|
|
195
|
+
* chart's own, on the leg's market. */
|
|
196
|
+
tradeLegRows?: Record<string, ArrayLike<number>[]>;
|
|
197
|
+
openInterestRows?: ArrayLike<number>[];
|
|
198
|
+
volumeProfileRows?: ReadonlyArray<ReadonlyArray<unknown>>;
|
|
199
|
+
/** The trade_volume_by_size lane's dense per-bar rows `[ts, [bucket, buy_usd,
|
|
200
|
+
* sell_usd, buy_count, sell_count], ...]` (nested like the profile's), a
|
|
201
|
+
* poll lane re-asked by the reconcile (no live channel). */
|
|
202
|
+
tradeVolumeBySizeRows?: ReadonlyArray<ReadonlyArray<unknown>>;
|
|
203
|
+
/** The tape lane's rows `[barTs, [offsetMs, price, size, side], ...]` (the prints at or above
|
|
204
|
+
* the acquisition's min_size): the K_TRADES large lane's history, fed per print by the push
|
|
205
|
+
* intake's K_TRADES fold and corrected by the reconcile's TRADE_LARGE asks. */
|
|
206
|
+
tapeRows?: ReadonlyArray<ReadonlyArray<unknown>>;
|
|
207
|
+
/** The tape buckets whose live fold hit the 20k print cap (the intake records them at the
|
|
208
|
+
* drain): their rows lost their oldest prints, and a block is never truncated, so the tick
|
|
209
|
+
* refuses them by name and suspends the session; a full run (which refetches) replaces the
|
|
210
|
+
* context. */
|
|
211
|
+
tapeCappedBuckets?: Set<number>;
|
|
212
|
+
/** The tape buckets whose prints the intake's queue cap dropped where nothing can restore them (a
|
|
213
|
+
* live-edge tape, history "0", or a market the large-print table never holds; the intake records
|
|
214
|
+
* them at the drain): their blocks are short, so the tick refuses them by name and suspends the
|
|
215
|
+
* session, like a capped bucket. A restorable loss rides the reconcile instead (`tape-lost`). */
|
|
216
|
+
tapeLostBuckets?: Set<number>;
|
|
217
|
+
liquidationRows?: ArrayLike<number>[];
|
|
218
|
+
fundingRateRows?: ArrayLike<number>[];
|
|
219
|
+
impliedVolatilityRows?: ArrayLike<number>[];
|
|
220
|
+
skewRows?: ArrayLike<number>[];
|
|
221
|
+
/** The options_chain lane's snapshot rows `[stampTs, [tuple], ...]` (the
|
|
222
|
+
* newest row is the live row's chain), re-asked by the poll reconcile. */
|
|
223
|
+
optionsChainRows?: ReadonlyArray<ReadonlyArray<unknown>>;
|
|
224
|
+
/** The etf_flow lane rows `[dayTs, ...one column per declared fund word]`
|
|
225
|
+
* (wrun-etf-flow-lane.util), a poll lane re-asked per ticker by the
|
|
226
|
+
* reconcile from the window's day start. */
|
|
227
|
+
etfFlowRows?: ArrayLike<number>[];
|
|
228
|
+
/** The registry poll lanes (`utility/wrun/sources/`): the lane instances
|
|
229
|
+
* the full run planned (lane, payload extras, the inputs reading it) and
|
|
230
|
+
* ONE row buffer per instance, keyed by the instance id (`poll:*`, also
|
|
231
|
+
* its key in `acquisition` and `coveredThroughTs`). Poll lanes: the
|
|
232
|
+
* reconcile re-asks each instance at its lane's own interval (fetched
|
|
233
|
+
* rows win, the record replaced); never pushed. Absent when the package
|
|
234
|
+
* reads no registry class. */
|
|
235
|
+
pollLanes?: WrunPollLaneInstance[];
|
|
236
|
+
pollLaneRows?: Record<string, ArrayLike<number>[]>;
|
|
237
|
+
/** The row lanes (`utility/wrun/sources/row-lane-registry.ts`): the instances the full run planned (lane,
|
|
238
|
+
* acquisition extras, the celled inputs reading it) and ONE host-bar row buffer per instance
|
|
239
|
+
* (`[barOpen, ...tuples]`), keyed by the instance id (`row:*`, also its key in `acquisition`,
|
|
240
|
+
* `coveredThroughTs` and `fedBuckets`). The reconcile re-asks each instance (fetched rows win; a
|
|
241
|
+
* `liveByCoin` lane's answer merged by its own rule), and a `liveByCoin` lane's points fold in per drain.
|
|
242
|
+
* Absent when the package reads no row-lane class. */
|
|
243
|
+
rowLanes?: WrunRowLaneInstance[];
|
|
244
|
+
rowLaneRows?: Record<string, ReadonlyArray<ReadonlyArray<unknown>>>;
|
|
245
|
+
/** The pinned legs this package declares (absent or empty when it pins
|
|
246
|
+
* none) and their candle buffers, keyed by the leg's fetch key: a PERIOD
|
|
247
|
+
* leg holds the CLOSED candles the full run fetched at the leg's
|
|
248
|
+
* interval, corrected by the reconcile (fetched rows win); a GRID leg (a
|
|
249
|
+
* foreign market at the chart's interval, `kind: 'grid'`) holds that
|
|
250
|
+
* market's rows with the forming candle, fed per frame by the push
|
|
251
|
+
* intake from the market's candle feed and corrected by the reconcile.
|
|
252
|
+
* The tail builder aligns period legs as-of candle close and folds or
|
|
253
|
+
* exact-joins grid legs. Torn down with the context. */
|
|
254
|
+
pinnedLegs?: WrunOverlayPinnedLeg[];
|
|
255
|
+
pinnedCandleRows?: Record<string, ArrayLike<number>[]>;
|
|
256
|
+
/** The candles a period leg's newest fetch answered still open at that fetch's clock (the
|
|
257
|
+
* venue's running candle), keyed by the leg's fetch key, for the legs a `candles` input read
|
|
258
|
+
* with view "forming" reads (`WrunChartSourceRows.pinnedLiveCandleRows`): the full run's
|
|
259
|
+
* answer, replaced whole by every reconcile answer of the leg (a failed ask keeps the last
|
|
260
|
+
* one). The tail builds and the reseed read the live candle from them. */
|
|
261
|
+
pinnedLiveCandleRows?: Record<string, ArrayLike<number>[]>;
|
|
262
|
+
/** The intrabar legs' finer candle buffers (`kind: 'intrabar'` in
|
|
263
|
+
* `pinnedLegs`), keyed by the leg's fetch key: CLOSED finer bars the full
|
|
264
|
+
* run fetched over the chart window, refreshed by the reconcile at every
|
|
265
|
+
* finer close (fetched rows win). The tail builder cuts each chart row's
|
|
266
|
+
* block from them. */
|
|
267
|
+
intrabarRows?: Record<string, ArrayLike<number>[]>;
|
|
268
|
+
/** The own-market `forming` pre-roll the full run fetched (the primary rows from the head's
|
|
269
|
+
* leg bucket open up to the head, `WrunChartSourceRows.formingPreRoll`): history before the
|
|
270
|
+
* session's first row, never re-asked (a moved head rebuilds the session), read by the reseed
|
|
271
|
+
* and the tail builds so the head's bucket folds whole. */
|
|
272
|
+
formingPreRoll?: {
|
|
273
|
+
fromTs: number;
|
|
274
|
+
rows: ReadonlyArray<ArrayLike<number>>;
|
|
275
|
+
};
|
|
276
|
+
/** The generation this context was installed under (bumped by every
|
|
277
|
+
* install and teardown through `nextWrunOverlayLiveGeneration`): a frame
|
|
278
|
+
* or a drain carrying another generation belongs to a superseded session
|
|
279
|
+
* and is discarded. */
|
|
280
|
+
generation: number;
|
|
281
|
+
/** The chart interval in ms the run computed on (every lane's bucket rule
|
|
282
|
+
* and the tail window read it). */
|
|
283
|
+
intervalMs: number;
|
|
284
|
+
/** Per lane, the SAME payload object the history fetch used (units, quote,
|
|
285
|
+
* ladder identity), so a live fold lands in the history lane's units. */
|
|
286
|
+
acquisition: Partial<Record<WrunLiveLane, WrunLaneAcquisition>>;
|
|
287
|
+
/** The carry-forward state after every input row strictly before
|
|
288
|
+
* `lastRowTs` (the seed the tail builder resumes from): the forward-fill
|
|
289
|
+
* scalars, the forming buckets and the pinned legs' confirmed cursors. */
|
|
290
|
+
carrySeed: WrunInputCarry;
|
|
291
|
+
/** Per lane, the buckets the push intake fed since the last reconcile
|
|
292
|
+
* covered them (a fed bucket is live data, not fetched data). */
|
|
293
|
+
fedBuckets: Partial<Record<WrunLiveLane, Set<number>>>;
|
|
294
|
+
/** False when the package declares a pin the push intake cannot ride (a
|
|
295
|
+
* market pin, a finer or non-ohlcv interval pin): no push, a repair on
|
|
296
|
+
* every drain. The full run refuses those pins by name before any fetch,
|
|
297
|
+
* so a context it installs is eligible; an own-market coarser interval
|
|
298
|
+
* pin is eligible (the chart's own push lanes stay valid, the leg is a
|
|
299
|
+
* poll lane). */
|
|
300
|
+
pushEligible: boolean;
|
|
301
|
+
/** The newest row ts a successful integrate has painted; `lastRowTs` may
|
|
302
|
+
* run ahead of it after a failed integrate (the next successful patch
|
|
303
|
+
* covers everything since). */
|
|
304
|
+
paintedThroughTs: number;
|
|
305
|
+
/** The oldest committed bar a late input or a revised closed candle
|
|
306
|
+
* touched since the last reseed (null = nothing owed). */
|
|
307
|
+
dirtyFromTs: number | null;
|
|
308
|
+
/** Everything a reseed needs to reopen the session over the buffers
|
|
309
|
+
* without a fetch: the compiled module, init()'s argument block and the
|
|
310
|
+
* strategy half minus the bars (rebuilt from the chart's candles). */
|
|
311
|
+
sessionSeed?: {
|
|
312
|
+
module: WrunModuleHandle;
|
|
313
|
+
initArgs: readonly number[];
|
|
314
|
+
/** wrun-5: the typed text settings' bytes by init slot, beside initArgs. */
|
|
315
|
+
textParams?: Readonly<Record<number, Uint8Array>>;
|
|
316
|
+
strategy?: Omit<WrunStrategyRunInput, 'bars'>;
|
|
317
|
+
};
|
|
318
|
+
/** Per lane, the newest bucket a fetch answered authoritatively (the full
|
|
319
|
+
* run's window end, then each reconcile's), independent of `lastRowTs`. */
|
|
320
|
+
coveredThroughTs: Partial<Record<WrunLiveLane, number>>;
|
|
321
|
+
/** The window start the full run asked its source lanes from (the chart's
|
|
322
|
+
* first bar, or the run bars' warm-up start): a settings save may compute
|
|
323
|
+
* over these buffers only when its own window opens there or later
|
|
324
|
+
* (wrun-held-lanes.util). Absent on contexts stored before this field. */
|
|
325
|
+
lanesFromTs?: number;
|
|
326
|
+
/** The OHLCV rows of the last 8 CLOSED bars as evaluated ([ts, o, h, l,
|
|
327
|
+
* c, v] copies): a drain compares them to the chart's current rows, and a
|
|
328
|
+
* changed closed candle sets `dirtyFromTs`. */
|
|
329
|
+
evaluatedMainTail: number[][];
|
|
330
|
+
/** A render failed after the session advanced: the next successful
|
|
331
|
+
* integrate repaints everything since `paintedThroughTs`. */
|
|
332
|
+
repaintOwed: boolean;
|
|
333
|
+
/** The result the live tick last patched into the mounted rows, with the
|
|
334
|
+
* chart bars it applied on and the mounted plots it left
|
|
335
|
+
* (wrun-live-patch.util): a block whose result reads the same on the same
|
|
336
|
+
* bars skips the patch and its paint, and one that changed rows from some
|
|
337
|
+
* bar on patches only those rows. Set only by a successful patch; unset by
|
|
338
|
+
* the tick's full integrate, a failure, a reseed and a canvas refine (a
|
|
339
|
+
* full run installs a new context), so the first patch after them applies
|
|
340
|
+
* the whole result. */
|
|
341
|
+
liveApplied?: WrunLiveApplied;
|
|
342
|
+
/** The live session is held: no drains until a run installs a fresh
|
|
343
|
+
* context. Set when a reseed was refused by the drawing budget (the
|
|
344
|
+
* outcome a refused full run has), when a tick's merged result is over
|
|
345
|
+
* the row budget, and when a reseed's reopen failed in the worker: that
|
|
346
|
+
* reopen starts exactly one full run, and drains hold until a successful
|
|
347
|
+
* run, a settings change or a Retry installs a fresh context (a run that
|
|
348
|
+
* fails keeps the hold, `liveSuspendedBy` says who may retry it). Also set
|
|
349
|
+
* when a full run stopped because another screen holds the session of a
|
|
350
|
+
* gate plane its lanes read (wrun-overlay-run `holdWrunOverlayOnSessionStop`):
|
|
351
|
+
* the kept picture takes no drain until the take-back's run replaces it. */
|
|
352
|
+
liveSuspended: boolean;
|
|
353
|
+
/** Why the session is held, where the heal ladder must tell: 'reopen-failed'
|
|
354
|
+
* (a reseed's reopen failed in the worker; for a session a row source
|
|
355
|
+
* feeds, its session is known gone: a failed create that reached the cloud
|
|
356
|
+
* replaced it, or the kScript socket's reconnect or session sweep said the
|
|
357
|
+
* worker lost it, and only a run installing a fresh context lifts the mark;
|
|
358
|
+
* a replay lane's next step reads it and reopens the whole replay window)
|
|
359
|
+
* makes the overlay idle to the heal, so a retryable failure of the full
|
|
360
|
+
* run it handed off is retried on the heal's dwell and backoff and a
|
|
361
|
+
* deterministic one is declined. The budget holds leave it unset: a heal
|
|
362
|
+
* run over the same window would be refused again (Resume or a settings
|
|
363
|
+
* change is their way out). */
|
|
364
|
+
liveSuspendedBy?: 'reopen-failed';
|
|
365
|
+
/** A run widened to the whole loaded range over this lost context failed
|
|
366
|
+
* (wrun-overlay-run's `wrunRunTargetOverLiveContext` widens once): later
|
|
367
|
+
* pans over it run their own window again, so a page paints something,
|
|
368
|
+
* and the heal ladder's whole-range retry stays its own. A fresh context,
|
|
369
|
+
* which a run that succeeds installs, never carries it. */
|
|
370
|
+
wideRunFailed?: true;
|
|
371
|
+
/** The clamped window the full run computed over (the run pass writes it);
|
|
372
|
+
* `partial` means narrower than the chart's loaded range, so the mounted
|
|
373
|
+
* rows outside it are kept: an older page landing under the session is
|
|
374
|
+
* not a moved history, and a tick merges its rows instead of replacing
|
|
375
|
+
* them. Absent: the whole loaded window. */
|
|
376
|
+
window?: WrunRunWindow;
|
|
377
|
+
/** The secondary lanes the full run degraded to empty (the run pass writes
|
|
378
|
+
* it): they carry no `coveredThroughTs`, so the reconcile keeps asking
|
|
379
|
+
* their tail while the source ladder owns the window. */
|
|
380
|
+
degradedLanes?: ReadonlySet<string>;
|
|
381
|
+
/** The row-builder lanes the capability rule (`wrunUnservedLanes`) kept from
|
|
382
|
+
* dispatch on the session's market (the run pass writes it): never fetched,
|
|
383
|
+
* their buffers empty, every reader reading its fill on every row. The
|
|
384
|
+
* prefix lanes rule admits them with no ask (wrun-prefix-lanes.util). */
|
|
385
|
+
unservedLanes?: ReadonlySet<string>;
|
|
386
|
+
/** Per lane, the span of buffer rows a live reconcile replaced with another
|
|
387
|
+
* value (exactly, its tolerated float noise included) since the session's
|
|
388
|
+
* outputs were last computed whole (the full run's install, a reseed that
|
|
389
|
+
* committed): the mounted rows over that span rest on the values it
|
|
390
|
+
* replaced. A prefix whose overlap a span reaches answers an output
|
|
391
|
+
* mismatch as the data's, never latched (wrun-prefix-lanes.util). Absent:
|
|
392
|
+
* none. */
|
|
393
|
+
laneRevisions?: Readonly<Partial<Record<WrunLiveLane, WrunLaneRevision>>>;
|
|
394
|
+
/** A replay lane's session (wrun-replay-lane.util): its rows are the
|
|
395
|
+
* replay's completed bars, only the replay lane advances it, and only
|
|
396
|
+
* while the chart replays (the live drain, ticks and reseeds refuse it
|
|
397
|
+
* otherwise, as they refuse a live session while the chart replays). */
|
|
398
|
+
replay?: true;
|
|
399
|
+
/** The prefix run planned over this session's older bars (C1 v3); absent: none was. */
|
|
400
|
+
prefixOwner?: WrunPrefixOwner;
|
|
401
|
+
/** A prefix proof failed over this session: every later wave runs whole (absent reads false). */
|
|
402
|
+
prefixUnsafe?: boolean;
|
|
403
|
+
/** Every prefix rule but the backward extension held at the install: a page in front of this
|
|
404
|
+
* session may wait for its pan wave instead of a whole rebuild (absent reads false). */
|
|
405
|
+
prefixCapable?: boolean;
|
|
406
|
+
/** Every candle this session's guests evaluated (warm-up D2: the head included, frozen, ascending), the
|
|
407
|
+
* prefix proof's mounted side (wrun-prefix-proof.util). Warm-up sessions only. */
|
|
408
|
+
candleEvidence?: WrunCandleEvidence;
|
|
409
|
+
/** An exact warm-up session's hidden head: never landed (wrun-overlay-run.util). */
|
|
410
|
+
warmupHead?: WrunWarmupHead;
|
|
411
|
+
/** The live guest's warmth: a prefix plans only while it matches (`warmup-cold`). */
|
|
412
|
+
warmRun?: WrunWarmRun;
|
|
413
|
+
/** Why a warm-up session runs cold (`warmup-invalid`: its sheet carries a torn stamp). */
|
|
414
|
+
warmupMiss?: WrunWarmupMiss;
|
|
415
|
+
/** The package computes its chart arm (4b): the full run sent it its Timeframe forced to the chart option (a run
|
|
416
|
+
* at another interval, or a built-in twin whose Timeframe is at or below the chart's), so every warm-up W reader
|
|
417
|
+
* (the plan's admission, the capability line) sizes from those settings, as the install's warmth record did.
|
|
418
|
+
* Absent: the package computes with the overlay's own settings. */
|
|
419
|
+
chartArm?: true;
|
|
420
|
+
/** The cloud's warm-up head (WRUN parity row 53, wrun-lane-warmup.util): the chart candles the guest ran before the
|
|
421
|
+
* landed start. A reseed runs them first while they still precede what it lands; the next full run takes them
|
|
422
|
+
* again while they cover its span under the same data generation. Never landed. */
|
|
423
|
+
laneWarmupHead?: WrunLaneWarmupHead;
|
|
424
|
+
/** The run budget's row cap (design 5, wrun-run-retained.util): a live block evicts past it, a reseed decides
|
|
425
|
+
* under it. Absent: no budget binds. */
|
|
426
|
+
retainedRowsCap?: number;
|
|
427
|
+
/** The worker's cell bound alone (`wrunRunBlockRowsCap`): a reseed's or a prefix's hidden head is checked on it. */
|
|
428
|
+
runBlockRowsCap?: number;
|
|
429
|
+
/** What the budget kept once the session holds fewer bars than its chart (its first row starts the retained
|
|
430
|
+
* range). Absent: every loaded bar is calculated. */
|
|
431
|
+
retained?: WrunRetainedRange;
|
|
432
|
+
}
|
|
433
|
+
/** The span of a lane buffer's rows a live reconcile replaced with another value (`laneRevisions`): the first and
|
|
434
|
+
* the last replaced row's timestamp, inclusive. */
|
|
435
|
+
export interface WrunLaneRevision {
|
|
436
|
+
fromTs: number;
|
|
437
|
+
toTs: number;
|
|
438
|
+
}
|
|
439
|
+
/** The W candles a guest ran before `beforeTs` (fewer at a `wall`), at data generation `dataGen`. */
|
|
440
|
+
export interface WrunWarmupHead {
|
|
441
|
+
bars: number;
|
|
442
|
+
beforeTs: number;
|
|
443
|
+
rows: ReadonlyArray<WrunCandleFingerprint>;
|
|
444
|
+
dataGen: number;
|
|
445
|
+
wall?: true;
|
|
446
|
+
}
|
|
447
|
+
/** The cloud's warm-up head a session ran (WRUN parity row 53): the chart candles in `[fromTs, beforeTs)`, asked from
|
|
448
|
+
* the cloud's warm-up start `fromTs` (a venue's closed hours hold no candle, so the first may open later), read under
|
|
449
|
+
* the chart's data-fetch generation `dataGen`; each row `[ts, open, high, low, close, volume]`, ascending. */
|
|
450
|
+
export interface WrunLaneWarmupHead {
|
|
451
|
+
beforeTs: number;
|
|
452
|
+
fromTs: number;
|
|
453
|
+
rows: ReadonlyArray<ReadonlyArray<number>>;
|
|
454
|
+
dataGen: number;
|
|
455
|
+
}
|
|
456
|
+
/** The live guest's warmth record (round A). */
|
|
457
|
+
export interface WrunWarmRun {
|
|
458
|
+
generation: number;
|
|
459
|
+
settingsGen: number;
|
|
460
|
+
warmupBars: number;
|
|
461
|
+
headFromTs: number;
|
|
462
|
+
wall?: true;
|
|
463
|
+
}
|
|
464
|
+
/** Why an exact warm-up session runs cold: an input beyond the chart's candles (`warmup-lanes`), a W past the cap or
|
|
465
|
+
* a number the kit never writes (`warmup-cap`), a term its settings cannot resolve (`warmup-unresolved`), a run the
|
|
466
|
+
* head cannot join (`warmup-mode`), a head that could not be had (`warmup-short`), a torn stamp: the sheet carries
|
|
467
|
+
* `history_warmup` and no frozen shape reads off it (`warmup-invalid`, never read as no stamp), or a first paint that
|
|
468
|
+
* did not wait for a head it did not hold (`warmup-deferred`: the rerun the landed head owes the overlay is warm). */
|
|
469
|
+
export type WrunWarmupMiss = 'warmup-lanes' | 'warmup-cap' | 'warmup-unresolved' | 'warmup-mode' | 'warmup-short' | 'warmup-invalid' | 'warmup-deferred';
|
|
470
|
+
/** One pinned leg of a live context (the G4 multi-timeframe contract): the
|
|
471
|
+
* plan's leg (fetch key = market + interval, the leg span, the inputs it
|
|
472
|
+
* serves, its kind and market) plus the newest moment a fetch answered it
|
|
473
|
+
* authoritatively. A period leg is a POLL lane: no subscription, no push,
|
|
474
|
+
* fetched at its own interval by the full run and by the tick's
|
|
475
|
+
* reconcile. A grid leg is reconciled like a poll lane (the chart-bar
|
|
476
|
+
* window at the chart's interval) AND tick-merged from its market's
|
|
477
|
+
* candle feed, which the run subscribes for it. An intrabar leg is
|
|
478
|
+
* fetch-only: re-asked at every finer close (the `pinned-close` timer
|
|
479
|
+
* fires on the finer grid) over at least one chart bar of finer bars. */
|
|
480
|
+
export interface WrunOverlayPinnedLeg extends WrunPinnedLeg {
|
|
481
|
+
/** The end of the last window a fetch answered for this leg (the full
|
|
482
|
+
* run's clock, then each reconcile's window end); a FAILED ask leaves it
|
|
483
|
+
* behind, which is what widens the next window. */
|
|
484
|
+
coveredThroughTs: number;
|
|
485
|
+
}
|
|
486
|
+
/** Why the live teardown hooks run: 'teardown' (the overlay leaves: the
|
|
487
|
+
* driver goes too) or 'suspend' (Pause: the live session ends, the driver
|
|
488
|
+
* and the overlay stay, and Resume reruns it). */
|
|
489
|
+
export type WrunLiveTeardownCause = 'teardown' | 'suspend';
|
|
490
|
+
/** The host's side of the teardown door: bound once, when the host service evaluates. */
|
|
491
|
+
export declare function bindWrunHostLiveSeriesEnd(end: (sessionKey: string) => void): void;
|
|
492
|
+
/** Bump and return the overlay's live generation. Every install (the full
|
|
493
|
+
* run opening a session) and every teardown moves it; the run passes the
|
|
494
|
+
* new value to the worker as the session epoch and stores it on the
|
|
495
|
+
* context, so frames and drains carrying an older value are discarded. */
|
|
496
|
+
export declare function nextWrunOverlayLiveGeneration(indicatorId: string): number;
|
|
497
|
+
/** The overlay's current live generation (0 before the first install). */
|
|
498
|
+
export declare function currentWrunOverlayLiveGeneration(indicatorId: string): number;
|
|
499
|
+
/**
|
|
500
|
+
* Register a synchronous teardown hook: called with the overlay id by
|
|
501
|
+
* `teardownWrunOverlay` (and so by the chart teardown) and by
|
|
502
|
+
* `suspendWrunOverlayLiveSession` AFTER the generation bump and BEFORE the
|
|
503
|
+
* registries are deleted and the worker session ended, so a hook can still
|
|
504
|
+
* read the context it is disposing state for. The cause tells a hook that
|
|
505
|
+
* holds overlay state (not session state) to keep it on 'suspend'. The
|
|
506
|
+
* push intake and the tick lane register at import time. Returns the
|
|
507
|
+
* unregister function.
|
|
508
|
+
*/
|
|
509
|
+
export declare function onWrunOverlayLiveTeardown(fn: (indicatorId: string, cause: WrunLiveTeardownCause) => void): () => void;
|
|
510
|
+
/**
|
|
511
|
+
* Per-overlay async mutex for SESSION operations (a tick's worker call plus
|
|
512
|
+
* its apply, a reseed, the full run's live-start plus its context install):
|
|
513
|
+
* `fn` runs after every earlier holder settled, and the lock is released
|
|
514
|
+
* whether it resolves or rejects (the caller gets `fn`'s own outcome).
|
|
515
|
+
* Non-reentrant: a holder must never call it again for the same id (the
|
|
516
|
+
* reseed takes the lock itself, so it is called from OUTSIDE a held lock).
|
|
517
|
+
*/
|
|
518
|
+
export declare function withWrunOverlaySessionLock<T>(indicatorId: string, fn: () => Promise<T> | T): Promise<T>;
|
|
519
|
+
/**
|
|
520
|
+
* The market identity a wrun run is bound to: exchange, symbol, interval and
|
|
521
|
+
* transformations of the chart's main series. Read from the chart metadata
|
|
522
|
+
* the caller hands in (the store stays out of this registry's eager graph).
|
|
523
|
+
*/
|
|
524
|
+
export declare function wrunChartMarketIdentity(metadata: {
|
|
525
|
+
exchange?: unknown;
|
|
526
|
+
symbol?: unknown;
|
|
527
|
+
interval?: unknown;
|
|
528
|
+
transformations?: unknown;
|
|
529
|
+
} | null | undefined): string;
|
|
530
|
+
export declare function registerWrunOverlayDriver(indicatorId: string, driver: WrunOverlayDriver): void;
|
|
531
|
+
export declare function hasWrunOverlayDriver(indicatorId: string): boolean;
|
|
532
|
+
/** Marked by the shared run pass after a successful integrate, whatever
|
|
533
|
+
* triggered it (add, rehydrate, wave, tick rebuild); announced to the
|
|
534
|
+
* compute-succeeded subscribers with the driver's chart. */
|
|
535
|
+
export declare function markWrunOverlayComputeSucceeded(indicatorId: string): void;
|
|
536
|
+
/** Noted by the run pass for the run it is computing (C1): the generation it
|
|
537
|
+
* computed with and how it settled. The executor reports the note once the
|
|
538
|
+
* run settles; a later note of the same run replaces an earlier one. */
|
|
539
|
+
export declare function noteWrunOverlayRunSettle(indicatorId: string, note: WrunRunSettleNote): void;
|
|
540
|
+
export declare function setWrunOverlayLiveContext(context: WrunOverlayLiveContext): void;
|
|
541
|
+
export declare function getWrunOverlayLiveContext(indicatorId: string): WrunOverlayLiveContext | undefined;
|
|
542
|
+
export declare function hasWrunOverlayLiveContext(indicatorId: string): boolean;
|
|
543
|
+
/** The sheet a live session builds with as settings paint the overlay's sheet (undefined: that painted sheet is the
|
|
544
|
+
* one it builds with). */
|
|
545
|
+
type WrunLiveSheetReader = (context: WrunOverlayLiveContext, settings: unknown, sheet: WrunIndicatorMetadata) => WrunIndicatorMetadata | undefined;
|
|
546
|
+
/** Register (or clear, with null) the reader of the sheet a live session builds with. */
|
|
547
|
+
export declare function setWrunLiveSheetReader(reader: WrunLiveSheetReader | null): void;
|
|
548
|
+
/** The sheet `context` builds with as `settings` paint `sheet` (the overlay's own): when a row source feeds it, the
|
|
549
|
+
* sheet the source ran less every family its refusals leave out now; for a browser session whose installing run
|
|
550
|
+
* respelled pins, the painted sheet with those pins laid on again (the respelling lives on the run's copy, never on
|
|
551
|
+
* the overlay's sheet). Undefined for any other session: the overlay's sheet with the settings is the one it builds
|
|
552
|
+
* with. */
|
|
553
|
+
export declare function wrunLiveContextSheetFor(context: WrunOverlayLiveContext, settings: unknown, sheet: WrunIndicatorMetadata): WrunIndicatorMetadata | undefined;
|
|
554
|
+
/** Drop everything the lifecycle holds for one overlay: the driver, the live
|
|
555
|
+
* context, the intake/tick state (through the teardown hooks), and the
|
|
556
|
+
* worker-side live session. Called when the overlay is found unmounted
|
|
557
|
+
* (and safe to call redundantly). The order is frozen (plan section 8
|
|
558
|
+
* fold 3): capture the identity, bump the generation, run the synchronous
|
|
559
|
+
* hooks, delete the registries, ALWAYS end the worker session. */
|
|
560
|
+
export declare function teardownWrunOverlay(indicatorId: string): void;
|
|
561
|
+
/** Pause: end the overlay's live session in the teardown order (generation
|
|
562
|
+
* bump, teardown hooks with cause 'suspend', context delete, worker session
|
|
563
|
+
* end) while the driver stays registered, so nothing ticks or reconciles
|
|
564
|
+
* until Resume reruns it. A no-op for an id with neither a driver nor a
|
|
565
|
+
* live context. */
|
|
566
|
+
export declare function suspendWrunOverlayLiveSession(indicatorId: string): void;
|
|
567
|
+
/** Chart teardown: drop every driver, live context, and worker session this
|
|
568
|
+
* chart owns (a rebuilt chart at the same index must not inherit them), then
|
|
569
|
+
* run the chart-teardown hooks (`onWrunChartTeardown`). */
|
|
570
|
+
export declare function teardownWrunOverlaysForChart(chartIndex: number): void;
|
|
571
|
+
/**
|
|
572
|
+
* Register a synchronous chart-teardown hook: called with the chart index at
|
|
573
|
+
* the end of `teardownWrunOverlaysForChart` (chart destroy and group
|
|
574
|
+
* teardown), after the per-overlay teardowns, for state a chart owns that no
|
|
575
|
+
* driver or live context names. Returns the unregister function.
|
|
576
|
+
*/
|
|
577
|
+
export declare function onWrunChartTeardown(fn: (chartIndex: number) => void): () => void;
|
|
578
|
+
/** One live session as the memory census reads it (titan-charts' census walk, `wrun.overlays`). */
|
|
579
|
+
export interface WrunOverlayMemoryCensusEntry {
|
|
580
|
+
id: string;
|
|
581
|
+
chartIndex: number;
|
|
582
|
+
/** The session's output rows (`outputRows`, the render source of truth). */
|
|
583
|
+
liveRows: number;
|
|
584
|
+
/** The rows its source buffers hold: every lane, poll lane and pinned leg, and the forming pre-roll. */
|
|
585
|
+
laneRows: number;
|
|
586
|
+
/** Those buffers' size, estimated at 8 bytes a number from sampled rows. */
|
|
587
|
+
laneBytes: number;
|
|
588
|
+
/** The rows of the result the live tick last applied (`liveApplied`), plus its build's when that is another result. */
|
|
589
|
+
liveAppliedRows: number;
|
|
590
|
+
}
|
|
591
|
+
/** Every live session's retention (memory spec 4.4), read-only: rows counted, bytes sampled, nothing created. */
|
|
592
|
+
export declare function wrunOverlayMemoryCensus(): WrunOverlayMemoryCensusEntry[];
|
|
593
|
+
/** A prefix run's owner on the session it extends (C1 v3): its request, window, the session and the
|
|
594
|
+
* generations it was planned against, and its state, pending from the plan to the outcome. */
|
|
595
|
+
export interface WrunPrefixOwner {
|
|
596
|
+
requestId: string;
|
|
597
|
+
fromTs: number;
|
|
598
|
+
toTs: number;
|
|
599
|
+
contextId: number;
|
|
600
|
+
settingsGen: number;
|
|
601
|
+
liveGen: number;
|
|
602
|
+
state: 'pending' | 'landed' | 'rejected';
|
|
603
|
+
}
|
|
604
|
+
/** A pan wave's prefix tag (its owner's request id). */
|
|
605
|
+
export interface WrunPrefixRequest {
|
|
606
|
+
requestId: string;
|
|
607
|
+
}
|
|
608
|
+
/** The window a prefix run receives through the driver: always partial, with its tag, the session it
|
|
609
|
+
* was planned against and the wave's own window (the full run it falls back to; absent: whole). */
|
|
610
|
+
export interface WrunPrefixRunWindow extends WrunRunWindow {
|
|
611
|
+
partial: true;
|
|
612
|
+
prefix: {
|
|
613
|
+
requestId: string;
|
|
614
|
+
contextId: number;
|
|
615
|
+
fallback?: WrunRunWindow;
|
|
616
|
+
};
|
|
617
|
+
/** The hidden head's first candle; `fromMs`/`toMs` stay the landed range. */
|
|
618
|
+
warmupFromTs?: number;
|
|
619
|
+
}
|
|
620
|
+
/** The rerun options a pan wave hands the executor: the contract's plus its prefix tag. */
|
|
621
|
+
export type WrunWaveRerunOptions = WrunRerunOptions & {
|
|
622
|
+
prefix?: WrunPrefixRequest;
|
|
623
|
+
};
|
|
624
|
+
/** The prefix side the run pass registers at its import (none of it throws). `plan`: the door's plan
|
|
625
|
+
* (the owner stamped pending), undefined to run the wave whole. `start`: a tagged wave as it starts,
|
|
626
|
+
* its prefix window or the wave's own, null when nothing is left to compute. `drop`: a tag that
|
|
627
|
+
* will never run (its owner, while still pending, goes rejected). `landed`: whether its commit did. */
|
|
628
|
+
export interface WrunPrefixRuntime {
|
|
629
|
+
plan(chartIndex: number, indicatorId: string): WrunPrefixRequest | undefined;
|
|
630
|
+
start(chartIndex: number, indicatorId: string, tag: WrunPrefixRequest, wave: WrunRunWindow | undefined): {
|
|
631
|
+
window: WrunRunWindow | undefined;
|
|
632
|
+
} | null;
|
|
633
|
+
drop(chartIndex: number, indicatorId: string, tag: WrunPrefixRequest, why: string): void;
|
|
634
|
+
landed(indicatorId: string, requestId: string): boolean;
|
|
635
|
+
}
|
|
636
|
+
/** Register (or clear, with null) the run pass's prefix side. */
|
|
637
|
+
export declare function setWrunPrefixRuntime(runtime: WrunPrefixRuntime | null): void;
|
|
638
|
+
/** The lifecycle door's plan for a pan wave: none without a driver or a registered prefix side. */
|
|
639
|
+
export declare function planWrunOverlayPrefixRequest(chartIndex: number, indicatorId: string): WrunPrefixRequest | undefined;
|
|
640
|
+
/** A plan the lifecycle door queued no run for (held, skipped, failed). */
|
|
641
|
+
export declare function dropWrunOverlayPrefixRequest(chartIndex: number, indicatorId: string, tag: WrunPrefixRequest, why: string): void;
|
|
642
|
+
/** Whether a run window is a prefix run's (its tag rides it). */
|
|
643
|
+
export declare function isWrunPrefixRunWindow(window: WrunRunWindow | undefined): window is WrunPrefixRunWindow;
|
|
644
|
+
/** Whether a request that replaces the session waits behind the run in flight (the prefix commit's
|
|
645
|
+
* staleness rule): any queued follow-up but another planned pan wave. */
|
|
646
|
+
export declare function isWrunOverlayReplacementPending(indicatorId: string): boolean;
|
|
647
|
+
/** True while a chart-wave recompute for this overlay is running: the live
|
|
648
|
+
* tick lane skips its work then (the rerun rebuilds the session and the
|
|
649
|
+
* tick's inputs/session would straddle two generations). */
|
|
650
|
+
export declare function isWrunOverlayRerunInFlight(indicatorId: string): boolean;
|
|
651
|
+
/** Whether a run over the whole loaded window is in flight (C1): it computes the
|
|
652
|
+
* overlay's latest settings everywhere and reports its settle. A run over a
|
|
653
|
+
* partial window (a pan page) does not count: it computes its rows only and
|
|
654
|
+
* reports nothing, so the store's reconcile never waits on it. */
|
|
655
|
+
export declare function isWrunOverlayFullRerunInFlight(indicatorId: string): boolean;
|
|
656
|
+
/** Whether a run settled `dropped` (C4): the quiet WrunChartGoneError of a run its overlay's newer intent
|
|
657
|
+
* superseded (the run pass rewraps any rejection of such a run), of an overlay that left or of replay
|
|
658
|
+
* taking the chart. Nothing failed. The one rule readers of a settled run tell dropped from failed by. */
|
|
659
|
+
export declare function isWrunRunDroppedError(error: unknown): boolean;
|
|
660
|
+
/** What an unanswered drop's deadline hands the run pass (`setWrunUnansweredDropSurface`). */
|
|
661
|
+
export interface WrunUnansweredDrop {
|
|
662
|
+
chartIndex: number;
|
|
663
|
+
indicatorId: string;
|
|
664
|
+
/** The deadline's rejection (`wrunUnansweredDropError`): the overlay's record and the mount attempt's outcome. */
|
|
665
|
+
error: WrunDeadlineError;
|
|
666
|
+
/** Whether the drop still stands unanswered: false once a full run started or drew, a run failed or held, a
|
|
667
|
+
* buffer reseed drew, or the overlay was paused, re-registered, latched by a waiter or torn down after the
|
|
668
|
+
* deadline fired. The surface re-checks it after every await, so it never words a row that recovered. */
|
|
669
|
+
isCurrent(): boolean;
|
|
670
|
+
/** The surface is about to show the record: the person's attempt the drop left waiting (`token`, read before the
|
|
671
|
+
* surface awaited) is answered by it, so a later automatic run never keeps it for a second notice. A no-op once
|
|
672
|
+
* the drop no longer stands. */
|
|
673
|
+
answer(token: WrunRefusalAttemptToken | null): void;
|
|
674
|
+
}
|
|
675
|
+
/** The run pass's side of an unanswered drop: shows the record and settles the mount's attempt. Never throws into
|
|
676
|
+
* the executor. */
|
|
677
|
+
export type WrunUnansweredDropSurface = (drop: WrunUnansweredDrop) => void;
|
|
678
|
+
/** Register (or clear, with null) the surface an unanswered drop's deadline hands its rejection to. */
|
|
679
|
+
export declare function setWrunUnansweredDropSurface(surface: WrunUnansweredDropSurface | null): void;
|
|
680
|
+
/** The rejection an unanswered drop settles with: the run deadline's (`WrunDeadlineError`, the retryable
|
|
681
|
+
* `not-reached` record), stamped with the cause `superseded` (a run its overlay's newer intent superseded, and
|
|
682
|
+
* no run replaced it), so the attempt, the record and the shown failure name one cause. */
|
|
683
|
+
export declare function wrunUnansweredDropError(indicatorId: string): WrunDeadlineError;
|
|
684
|
+
/**
|
|
685
|
+
* The overlay drew its whole window outside the executor: a buffer reseed that integrated (the run pass's
|
|
686
|
+
* `reseedWrunOverlayFromBuffers`, which supersedes every earlier verdict like a full run, contract C3). An
|
|
687
|
+
* unanswered drop's deadline, and a surface it already handed over, have nothing left to say.
|
|
688
|
+
*/
|
|
689
|
+
export declare function noteWrunOverlayWholeWindowDrawn(indicatorId: string): void;
|
|
690
|
+
/**
|
|
691
|
+
* Chart-wave recompute entry (the lazy-load pan lane, and every lifecycle
|
|
692
|
+
* rerun): single flight per overlay with latest-wins coalescing, exactly one
|
|
693
|
+
* queued follow-up whose options merge by rank (`mergeWrunRunRequests`).
|
|
694
|
+
* Returns the completion of the run that computes this request (never
|
|
695
|
+
* rejects): the run it starts, or, behind a run in flight, the follow-up's
|
|
696
|
+
* (every request queued behind one run shares it), so a settings save's tail
|
|
697
|
+
* waits for its own settings to land, not for the run that read the older
|
|
698
|
+
* ones. Undefined when the overlay has no driver, is no longer mounted (which
|
|
699
|
+
* also tears it down), or the request is a pan wave whose window the last
|
|
700
|
+
* good run already computed over the same main rows while nothing is in
|
|
701
|
+
* flight (the coverage skip).
|
|
702
|
+
*/
|
|
703
|
+
export declare function rerunWrunOverlayForChartWave(indicatorId: string, options?: WrunWaveRerunOptions): Promise<void> | undefined;
|
|
704
|
+
/**
|
|
705
|
+
* Add/rehydrate-time initial compute, routed THROUGH the same single-flight
|
|
706
|
+
* executor as the chart wave: the driver is registered before the initial run,
|
|
707
|
+
* so a lazy wave firing during the add must coalesce with it instead of
|
|
708
|
+
* starting a concurrent duplicate compute (two overlapping runs also
|
|
709
|
+
* interleaved the legend loader's raise/lower). Unlike the wave entry, the
|
|
710
|
+
* returned promise settles with the run's OWN outcome: a failure rejects here
|
|
711
|
+
* so the caller's typed error semantics stay intact. When a wave run is
|
|
712
|
+
* already in flight, this latches the executor's one follow-up and settles
|
|
713
|
+
* with that follow-up's outcome (the same computation over the current rows).
|
|
714
|
+
* The run it settles with carries the reason 'initial', so it answers the
|
|
715
|
+
* attempt the loader opened at mount.
|
|
716
|
+
*/
|
|
717
|
+
export declare function runWrunOverlayInitialComputeThroughExecutor(indicatorId: string): Promise<void>;
|
|
718
|
+
export declare function __resetWrunOverlayDriversForTests(): void;
|
|
719
|
+
export {};
|