@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
|
@@ -1,55 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { OPRA_VENUE } from '../market-data/venues/opra.js';
|
|
2
|
+
import { MarketDataBillingError, isMarketDataAgreementCurrent, isMarketDataAttestationCurrent, isMarketDataAttestationLive, isMarketDataNonProfessional, isMarketDataProfessionalDeclaration, marketDataAttestationRenewBy, } from '../market-data/billing.interface.js';
|
|
3
|
+
/** Every OPRA-governed exchange code (one consolidated venue by design): the OPRA card's product groups. */
|
|
4
|
+
export const OPRA_GOVERNED_EXCHANGES = OPRA_VENUE.productGroups;
|
|
3
5
|
/** OPRA defines delayed data as at least 15 minutes old; the gate's delayed window matches. */
|
|
4
|
-
export const OPRA_DELAY_MINUTES =
|
|
6
|
+
export const OPRA_DELAY_MINUTES = OPRA_VENUE.delayMinutes;
|
|
5
7
|
// ---------------------------------------------------------------------------
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
8
|
+
// The frozen billing contract of `/opra/*`, the OPRA twin of `/cme/*` (orange's OPRA routes implement it; the service
|
|
9
|
+
// speaks it in one place, src/services/opra-realtime.service.ts, through the venue-generic market-data service).
|
|
10
|
+
// Differences from CME are deliberate: one product, no depth, non-professional only, EXPLICIT agreement acceptance
|
|
11
|
+
// (never inferred from a grant or a subscription), and pay first: the declaration and the agreement bind real-time
|
|
12
|
+
// ACCESS, not the payment, so checkout needs neither and the server serves real-time only once the account is both
|
|
13
|
+
// paid and qualified (delayed otherwise).
|
|
11
14
|
// ---------------------------------------------------------------------------
|
|
12
15
|
/** The one OPRA plan: real-time top of book, billed monthly. */
|
|
13
|
-
export const OPRA_REALTIME_MONTHLY_USD =
|
|
14
|
-
export const OPRA_ATTESTATION_FORM_VERSION = 'opra-v1';
|
|
16
|
+
export const OPRA_REALTIME_MONTHLY_USD = OPRA_VENUE.products[0].priceUsd;
|
|
15
17
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* `isOpraNonProfessional` reads from the same answers.
|
|
18
|
+
* v2 asks questions 3 to 5 as one group ("Do any of these apply to you?") and adds the subscriber's country and
|
|
19
|
+
* address. A record of any other version reads as no declaration: the subscriber declares again.
|
|
19
20
|
*/
|
|
21
|
+
export const OPRA_ATTESTATION_FORM_VERSION = OPRA_VENUE.questionnaire.formVersion;
|
|
20
22
|
/** The server's bound on each identity field (`legalName`, `employer`, `occupation`), trimmed. */
|
|
21
|
-
export const OPRA_IDENTITY_FIELD_MAX_LENGTH =
|
|
23
|
+
export const OPRA_IDENTITY_FIELD_MAX_LENGTH = OPRA_VENUE.questionnaire.identityLimits.legalName;
|
|
24
|
+
/** The server's bound on the one-line `address`, trimmed. */
|
|
25
|
+
export const OPRA_ADDRESS_FIELD_MAX_LENGTH = OPRA_VENUE.questionnaire.identityLimits.address;
|
|
22
26
|
/**
|
|
23
27
|
* The OPRA subscriber agreement version this build presents and posts. Bump on ANY change to the
|
|
24
28
|
* agreement text the dialog shows or links: a new version is a new acceptance, and the store reads a
|
|
25
29
|
* record of any other version as not accepted. RELEASE BLOCKER (named, do not bury): the agreement
|
|
26
30
|
* text, this version id and the link below need the compliance sign-off before the flag is lit.
|
|
27
31
|
*/
|
|
28
|
-
export const OPRA_SUBSCRIBER_AGREEMENT_VERSION =
|
|
32
|
+
export const OPRA_SUBSCRIBER_AGREEMENT_VERSION = OPRA_VENUE.agreement.version;
|
|
29
33
|
/** Where the agreement step links for OPRA's own subscriber terms (see the release blocker above). */
|
|
30
|
-
export const OPRA_SUBSCRIBER_AGREEMENT_URL =
|
|
34
|
+
export const OPRA_SUBSCRIBER_AGREEMENT_URL = OPRA_VENUE.agreement.url;
|
|
31
35
|
/**
|
|
32
36
|
* OPRA's non-professional qualification, one stable machine id per question: these ids key the
|
|
33
37
|
* submitted `answers` record and are never swapped for translated question text. `qualifying` is the
|
|
34
38
|
* answer a non-professional gives. Every answer must match it; anything else is a professional
|
|
35
|
-
* declaration, which
|
|
36
|
-
* and then ends in "not available".
|
|
37
|
-
*
|
|
39
|
+
* declaration, which is not sold: it is submitted (the server records it and withdraws eligibility)
|
|
40
|
+
* and then ends in "not available". The form asks the three whose qualifying answer is No as one group
|
|
41
|
+
* question; the record still carries all five. Bump OPRA_ATTESTATION_FORM_VERSION on any change to this
|
|
42
|
+
* set, its order or its wording.
|
|
38
43
|
*/
|
|
39
|
-
export const OPRA_QUALIFICATION_QUESTIONS =
|
|
40
|
-
{ id: 'natural_person', qualifying: true },
|
|
41
|
-
{ id: 'personal_use_only', qualifying: true },
|
|
42
|
-
{ id: 'securities_registered', qualifying: false },
|
|
43
|
-
{ id: 'investment_adviser', qualifying: false },
|
|
44
|
-
{ id: 'exempt_institution_role', qualifying: false },
|
|
45
|
-
];
|
|
44
|
+
export const OPRA_QUALIFICATION_QUESTIONS = OPRA_VENUE.questionnaire.questions;
|
|
46
45
|
/** Every question answered with its qualifying answer. A missing answer never qualifies. */
|
|
47
46
|
export function isOpraNonProfessional(answers) {
|
|
48
|
-
return
|
|
47
|
+
return isMarketDataNonProfessional(OPRA_VENUE, answers);
|
|
49
48
|
}
|
|
50
49
|
/** How long before a declaration's expiry the management page asks the subscriber to renew it. */
|
|
51
|
-
export const OPRA_ATTESTATION_RENEW_WINDOW_DAYS =
|
|
52
|
-
const DAY_MS = 86_400_000;
|
|
50
|
+
export const OPRA_ATTESTATION_RENEW_WINDOW_DAYS = OPRA_VENUE.questionnaire.renewalWindowDays;
|
|
53
51
|
/**
|
|
54
52
|
* A declaration on the current form (a new question set means a new declaration) whose validity has not
|
|
55
53
|
* ended at `now`, either classification. The client owns expiry: `now` is the caller's clock (the store's
|
|
@@ -57,49 +55,26 @@ const DAY_MS = 86_400_000;
|
|
|
57
55
|
* `expiresAt` does not parse reads expired (ask again rather than trust it).
|
|
58
56
|
*/
|
|
59
57
|
export function isOpraAttestationLive(attestation, now) {
|
|
60
|
-
|
|
61
|
-
return false;
|
|
62
|
-
if (attestation.expiresAt === undefined)
|
|
63
|
-
return true;
|
|
64
|
-
const ends = Date.parse(attestation.expiresAt);
|
|
65
|
-
return Number.isFinite(ends) && now < ends;
|
|
58
|
+
return isMarketDataAttestationLive(OPRA_VENUE, attestation, now);
|
|
66
59
|
}
|
|
67
60
|
/** A non-professional declaration on the current form, still valid at `now`: the account may buy real-time. */
|
|
68
61
|
export function isOpraAttestationCurrent(attestation, now) {
|
|
69
|
-
return
|
|
62
|
+
return isMarketDataAttestationCurrent(OPRA_VENUE, attestation, now);
|
|
70
63
|
}
|
|
71
64
|
/** A professional declaration on the current form, still valid at `now`: real-time is not sold to the account. */
|
|
72
65
|
export function isOpraProfessionalDeclaration(attestation, now) {
|
|
73
|
-
return
|
|
66
|
+
return isMarketDataProfessionalDeclaration(OPRA_VENUE, attestation, now);
|
|
74
67
|
}
|
|
75
68
|
/**
|
|
76
69
|
* The expiry (ISO, as served) a still-current non-professional declaration must be renewed by, once `now` is
|
|
77
70
|
* inside the renewal window before it; null otherwise (no expiry named, further off, or already lapsed).
|
|
78
71
|
*/
|
|
79
72
|
export function opraAttestationRenewBy(attestation, now) {
|
|
80
|
-
|
|
81
|
-
return null;
|
|
82
|
-
return Date.parse(attestation.expiresAt) - now <= OPRA_ATTESTATION_RENEW_WINDOW_DAYS * DAY_MS
|
|
83
|
-
? attestation.expiresAt
|
|
84
|
-
: null;
|
|
73
|
+
return marketDataAttestationRenewBy(OPRA_VENUE, attestation, now);
|
|
85
74
|
}
|
|
86
75
|
/** An acceptance counts only for the version this build presents, never for an older text. */
|
|
87
76
|
export function isOpraAgreementCurrent(agreement) {
|
|
88
|
-
return
|
|
89
|
-
}
|
|
90
|
-
export class OpraBillingError extends Error {
|
|
91
|
-
kind;
|
|
92
|
-
status;
|
|
93
|
-
/** Raw backend message: diagnostic content only, never primary UI copy. */
|
|
94
|
-
diagnosticMessage;
|
|
95
|
-
/** Stripe's hosted invoice on an 'invoice_owed' refusal; null otherwise. */
|
|
96
|
-
invoiceUrl;
|
|
97
|
-
constructor(kind, options) {
|
|
98
|
-
super(`opra billing error: ${kind}`);
|
|
99
|
-
this.name = 'OpraBillingError';
|
|
100
|
-
this.kind = kind;
|
|
101
|
-
this.status = options?.status ?? null;
|
|
102
|
-
this.diagnosticMessage = options?.diagnosticMessage ?? null;
|
|
103
|
-
this.invoiceUrl = options?.invoiceUrl ?? null;
|
|
104
|
-
}
|
|
77
|
+
return isMarketDataAgreementCurrent(OPRA_VENUE, agreement);
|
|
105
78
|
}
|
|
79
|
+
/** The venue-generic billing error (market-data/billing.interface.ts): one class for every venue's calls. */
|
|
80
|
+
export const OpraBillingError = MarketDataBillingError;
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
export type RailTf = '1m' | '5m' | '15m' | '1h' | '1d';
|
|
2
|
+
export type ReplayStepTf = '1m' | '5m' | '10m' | '15m' | '30m' | '1h' | '2h' | '3h' | '4h' | '1d';
|
|
3
|
+
type ReplayTimestampMode = 'uniform' | 'irregular';
|
|
4
|
+
export interface ReplayRailDomain {
|
|
5
|
+
nowSec: number;
|
|
6
|
+
fromSec: number;
|
|
7
|
+
toSec?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface ReplayLane {
|
|
10
|
+
kind: 'tick' | 'bars';
|
|
11
|
+
tf: 'tick' | RailTf;
|
|
12
|
+
bucketMs: number;
|
|
13
|
+
hasBook: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface ReplayDisplayLane {
|
|
16
|
+
mode: 'tick' | 'coarse';
|
|
17
|
+
tf: 'tick' | RailTf;
|
|
18
|
+
tfMs: number;
|
|
19
|
+
hasBook: boolean;
|
|
20
|
+
bookTf?: RailTf;
|
|
21
|
+
}
|
|
22
|
+
export type ReplayResolution = {
|
|
23
|
+
kind: 'tick';
|
|
24
|
+
} | {
|
|
25
|
+
kind: 'bar';
|
|
26
|
+
tf: ReplayStepTf;
|
|
27
|
+
};
|
|
28
|
+
export type ReplayResolutionPick = 'auto' | ReplayResolution;
|
|
29
|
+
export interface ReplayBuffer {
|
|
30
|
+
anchorMs: number;
|
|
31
|
+
generation?: number;
|
|
32
|
+
tf: ReplayResolution;
|
|
33
|
+
timestampMode?: ReplayTimestampMode;
|
|
34
|
+
chartIntervalMs?: number;
|
|
35
|
+
availableResolutions?: ReplayResolution[];
|
|
36
|
+
abortController: AbortController;
|
|
37
|
+
/** Total visible X span used by replay follow range syncs. */
|
|
38
|
+
viewBehindMs: number;
|
|
39
|
+
/**
|
|
40
|
+
* Span implied by the last follow range replay itself applied, in both
|
|
41
|
+
* denominations (key span x chart interval when the range carried keys, and
|
|
42
|
+
* the raw ts span). The user-zoom detector's echo baseline: a viewport span
|
|
43
|
+
* matching it is replay's own write coming back, not a user zoom, and must
|
|
44
|
+
* not be re-adopted into viewBehindMs. On a sparse grid (thin market:
|
|
45
|
+
* interval buckets with no bar) the applied window holds fewer keys than
|
|
46
|
+
* span / interval, so re-adopting the echo every sync ratcheted the follow
|
|
47
|
+
* zoom down (300 -> 2 bars).
|
|
48
|
+
*/
|
|
49
|
+
followAppliedSpan?: {
|
|
50
|
+
tsSpanMs: number;
|
|
51
|
+
keySpanMs?: number;
|
|
52
|
+
};
|
|
53
|
+
loadedBars: number;
|
|
54
|
+
loading: boolean;
|
|
55
|
+
heatmapLoading: boolean;
|
|
56
|
+
heatmapFollowLoading?: boolean;
|
|
57
|
+
heatmapFollowCooldown?: number;
|
|
58
|
+
heatmapGapFillLoading?: boolean;
|
|
59
|
+
heatmapGapFillCooldown?: number;
|
|
60
|
+
heatmapGapFillRangeKey?: string;
|
|
61
|
+
heatmapOverlayLoadCount?: number;
|
|
62
|
+
/** Forward book coverage claimed on wire evidence (both lanes); the follow loops heal from here. */
|
|
63
|
+
heatmapCoverageEndMs?: number;
|
|
64
|
+
subRows?: number[][];
|
|
65
|
+
subCoverageEndMs?: number;
|
|
66
|
+
subOriginMs?: number;
|
|
67
|
+
subRequestInterval?: string;
|
|
68
|
+
subStepMs?: number;
|
|
69
|
+
subFollowLoading?: boolean;
|
|
70
|
+
subFollowCooldown?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Set by the anchor load: the replay step's own rail answered servedEmpty on
|
|
73
|
+
* the wire over the whole anchor window while the chart's own rows sit inside
|
|
74
|
+
* it, so the step's retained history ends before this depth. Committed as is,
|
|
75
|
+
* the window would end on the start bar (no step, silent Play); the session
|
|
76
|
+
* restarts on whole chart bars instead.
|
|
77
|
+
*/
|
|
78
|
+
stepRailEmptyAtAnchor?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Sub-row window a wire-complete reply answered servedEmpty while coverage
|
|
81
|
+
* already reached it: the active chart bucket is TRADELESS, not unfetched,
|
|
82
|
+
* so the covered-window refetch must not re-ask it once per cooldown lapse.
|
|
83
|
+
* Mirrors the forward frontier's proof discipline: TTL-bounded via atMs
|
|
84
|
+
* (read through provenReplaySubServedEmptyFloor) and falsified the moment
|
|
85
|
+
* later sub rows land inside the span, so delayed ingestion is never
|
|
86
|
+
* blocked for the buffer's lifetime.
|
|
87
|
+
*/
|
|
88
|
+
subServedEmptyFloor?: {
|
|
89
|
+
startMs: number;
|
|
90
|
+
endMs: number;
|
|
91
|
+
atMs: number;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Forward frontier PROVEN empty on the wire by the proven-empty forward
|
|
95
|
+
* walk (session-bound venues, and uniform period-fetch venues since the
|
|
96
|
+
* sparse-grid round): every candle window between the last
|
|
97
|
+
* loaded row and this timestamp completed a round trip whose completion
|
|
98
|
+
* carried the worker's authoritative servedEmpty verdict, so the span is a
|
|
99
|
+
* calendar hole (weekend/holiday/maintenance halt), not unfetched data.
|
|
100
|
+
* The clock latches its terminal finished state once this reaches the
|
|
101
|
+
* forward limit and probes again only after the limit advances past it.
|
|
102
|
+
* NOT permanent knowledge: consumers read it through
|
|
103
|
+
* `provenForwardScannedToMs` (TTL-bounded via forwardScannedAtMs, so
|
|
104
|
+
* delayed gateway ingestion near the live edge is re-asked), and any batch
|
|
105
|
+
* rows later landing inside the span falsify and clear it.
|
|
106
|
+
*/
|
|
107
|
+
forwardScannedToMs?: number;
|
|
108
|
+
/** When the frontier above was last raised; the TTL clock for its proof. */
|
|
109
|
+
forwardScannedAtMs?: number;
|
|
110
|
+
fullRows: number[][];
|
|
111
|
+
heatmapColumns: Float64Array[];
|
|
112
|
+
/**
|
|
113
|
+
* Last pan-back gap-fill outcome, keyed to stable evidence (column count and
|
|
114
|
+
* deepest captured column) rather than window bounds: the window's floor
|
|
115
|
+
* widens with every candle prepend, and an exact-bounds key would never
|
|
116
|
+
* latch while the book edge stays put.
|
|
117
|
+
*/
|
|
118
|
+
panBackGapFill?: {
|
|
119
|
+
maxMs: number;
|
|
120
|
+
queriedMinMs: number;
|
|
121
|
+
columnCount: number;
|
|
122
|
+
deepestColumnMs: number;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
export interface ReplayFollowRange {
|
|
126
|
+
startTs: number;
|
|
127
|
+
endTs: number;
|
|
128
|
+
startKey?: number;
|
|
129
|
+
endKey?: number;
|
|
130
|
+
}
|
|
131
|
+
export type ReplayClockState = 'paused' | 'playing' | 'loading';
|
|
132
|
+
interface ReplayClockIndicators {
|
|
133
|
+
extendForwardTo?(endMs: number): void;
|
|
134
|
+
markNextReplayTickAsReseed?(): void;
|
|
135
|
+
revealTo(playheadMs: number): void;
|
|
136
|
+
seekTo(playheadMs: number, options?: {
|
|
137
|
+
incremental?: boolean;
|
|
138
|
+
relocateFoldedFootprintFine?: boolean;
|
|
139
|
+
}): void;
|
|
140
|
+
}
|
|
141
|
+
export interface ReplayClockSnapshot {
|
|
142
|
+
playheadMs: number;
|
|
143
|
+
state: ReplayClockState;
|
|
144
|
+
speed: number;
|
|
145
|
+
endMs: number;
|
|
146
|
+
finished: boolean;
|
|
147
|
+
}
|
|
148
|
+
export interface ReplayClockOptions {
|
|
149
|
+
chartIndex: number;
|
|
150
|
+
intervalMs: number;
|
|
151
|
+
tfMs: number;
|
|
152
|
+
stepMs?: number;
|
|
153
|
+
playheadMs: number;
|
|
154
|
+
speed?: number;
|
|
155
|
+
indicators: ReplayClockIndicators;
|
|
156
|
+
getForwardLimitMs: () => number;
|
|
157
|
+
shouldFollow?: () => boolean;
|
|
158
|
+
onUpdate?: (snapshot: ReplayClockSnapshot) => void;
|
|
159
|
+
/**
|
|
160
|
+
* Group boundary barrier: while true, ticks reschedule without advancing
|
|
161
|
+
* (state stays 'playing', so the transport never flip-flops). Used by the
|
|
162
|
+
* multichart master to hold for a member's forward load.
|
|
163
|
+
*/
|
|
164
|
+
shouldHold?: () => boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Mixed-timeline group: walk continuous wall time even on an irregular
|
|
167
|
+
* (session-gap) buffer, so uniform co-members keep playing through this
|
|
168
|
+
* chart's closed hours and this pane simply reveals nothing until its
|
|
169
|
+
* market reopens. Solo irregular replay keeps native bar-stepping.
|
|
170
|
+
*/
|
|
171
|
+
forceUniformTimeline?: () => boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Frame scheduler of the damped follow camera. The app leaves it unset
|
|
174
|
+
* (window.requestAnimationFrame); specs inject a fake rAF to drive the
|
|
175
|
+
* camera frame by frame between ticks.
|
|
176
|
+
*/
|
|
177
|
+
motion?: {
|
|
178
|
+
raf?: ((callback: FrameRequestCallback) => number) | null;
|
|
179
|
+
caf?: ((handle: number) => void) | null;
|
|
180
|
+
now?: () => number;
|
|
181
|
+
reducedMotion?: boolean;
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
export interface ReplayIndicatorsResult {
|
|
185
|
+
replayed: string[];
|
|
186
|
+
hidden: string[];
|
|
187
|
+
/**
|
|
188
|
+
* Workspace overlays that were skipped only because they had not mounted in
|
|
189
|
+
* the chart yet when prepare enumerated (fresh-boot replay entries race
|
|
190
|
+
* indicator mounting). The start flow re-dispatches these through
|
|
191
|
+
* loadOverlayDuringReplay, which waits for the mount and lanes them; without
|
|
192
|
+
* that they silently stay live production overlays for the whole session.
|
|
193
|
+
*/
|
|
194
|
+
deferredMountIds: string[];
|
|
195
|
+
}
|
|
196
|
+
export type ReplayZoomWindowMs = number | null;
|
|
197
|
+
export interface ReplayWindowBounds {
|
|
198
|
+
startMs: number;
|
|
199
|
+
endMs: number;
|
|
200
|
+
spanMs: number;
|
|
201
|
+
}
|
|
202
|
+
type ReplayRailCoverageRanges = Array<[number, number]>;
|
|
203
|
+
export interface RailsCoverage {
|
|
204
|
+
bars: Partial<Record<RailTf, ReplayRailCoverageRanges>>;
|
|
205
|
+
columns: Partial<Record<RailTf, ReplayRailCoverageRanges>>;
|
|
206
|
+
oldestBars: Partial<Record<RailTf, number>>;
|
|
207
|
+
done: boolean;
|
|
208
|
+
}
|
|
209
|
+
export type ReplayLaneEvent = {
|
|
210
|
+
mode: 'tick';
|
|
211
|
+
tf: 'tick';
|
|
212
|
+
tfMs: number;
|
|
213
|
+
tfLabel: string;
|
|
214
|
+
hasBook: boolean;
|
|
215
|
+
tickSource: 'live' | 'rails';
|
|
216
|
+
} | {
|
|
217
|
+
mode: 'coarse';
|
|
218
|
+
tf: ReplayStepTf;
|
|
219
|
+
tfMs: number;
|
|
220
|
+
tfLabel: string;
|
|
221
|
+
hasBook: boolean;
|
|
222
|
+
};
|
|
223
|
+
/** The wall that binds a replay reach decision (replayLadder.clampReplayReach). */
|
|
224
|
+
export type ReplayReachLimitedBy = 'retention' | 'plan' | 'gateway';
|
|
225
|
+
export interface ReplayUiState {
|
|
226
|
+
active: boolean;
|
|
227
|
+
loading: boolean;
|
|
228
|
+
state: string;
|
|
229
|
+
playheadMs: number;
|
|
230
|
+
lastRevealedOpen: number | null;
|
|
231
|
+
lastRevealedClose: number | null;
|
|
232
|
+
lastRevealedCloseMs: number | null;
|
|
233
|
+
speed: number;
|
|
234
|
+
finished: boolean;
|
|
235
|
+
follow: boolean;
|
|
236
|
+
buffered: Array<[number, number]>;
|
|
237
|
+
fidelity: {
|
|
238
|
+
level: 'approx' | 'exact';
|
|
239
|
+
};
|
|
240
|
+
status: string;
|
|
241
|
+
indicators: {
|
|
242
|
+
replayed: string[];
|
|
243
|
+
hidden: string[];
|
|
244
|
+
} | null;
|
|
245
|
+
pickArmed: boolean;
|
|
246
|
+
jumpPickTimeMs: number | null;
|
|
247
|
+
catchupPct: number | null;
|
|
248
|
+
resolutionAnchorMs: number | null;
|
|
249
|
+
resolutionAvailable: ReplayResolution[];
|
|
250
|
+
replayTimestampMode: ReplayTimestampMode;
|
|
251
|
+
replayV3Timestamps: number[];
|
|
252
|
+
domainStartMs: number;
|
|
253
|
+
domainEndMs: number;
|
|
254
|
+
reachWallMs: number | null;
|
|
255
|
+
reachLimited: boolean;
|
|
256
|
+
/** What binds `reachWallMs`; null when no reach decision stands. */
|
|
257
|
+
reachLimitedBy: ReplayReachLimitedBy | null;
|
|
258
|
+
reachClampNotice: number;
|
|
259
|
+
reachClampSource: 'anchor' | 'scrub' | null;
|
|
260
|
+
bookLayersAllowed: boolean;
|
|
261
|
+
/** Why book layers are off: plan gate vs the concurrent-session memory cap. */
|
|
262
|
+
bookLayersDeniedReason?: 'plan' | 'concurrency';
|
|
263
|
+
/** Multichart replay: arm the next anchor pick to enter a synced group. */
|
|
264
|
+
groupArmed: boolean;
|
|
265
|
+
/** Entry two-choice (this chart / all charts) is showing; anchor pick waits. */
|
|
266
|
+
groupChoicePending: boolean;
|
|
267
|
+
groupRole: 'master' | 'follower' | null;
|
|
268
|
+
groupMasterIndex: number | null;
|
|
269
|
+
bookLayersRequested: boolean;
|
|
270
|
+
zoomWindowMs: ReplayZoomWindowMs;
|
|
271
|
+
lane: ReplayLaneEvent;
|
|
272
|
+
railsCoverage: RailsCoverage;
|
|
273
|
+
replayV3Window: {
|
|
274
|
+
startMs: number;
|
|
275
|
+
endMs: number;
|
|
276
|
+
} | null;
|
|
277
|
+
replayVersion: 'v3' | null;
|
|
278
|
+
rebuilding: boolean;
|
|
279
|
+
/** Playback effects (user-toggleable via the transport FX menu). */
|
|
280
|
+
/** Bumped when a blocked gesture should pulse the Follow control. */
|
|
281
|
+
followHintPulse: number;
|
|
282
|
+
/** Increments each time a user gesture auto-releases Follow (drives the transient "Follow off" chip). */
|
|
283
|
+
followReleasePulse: number;
|
|
284
|
+
}
|
|
285
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -14,9 +14,17 @@
|
|
|
14
14
|
* when string slots are declared.
|
|
15
15
|
* - Response: `ready` (Uint8Array) + `outputs` (Float64Array, row-major at
|
|
16
16
|
* the output count), plus the packed string table when slots are declared.
|
|
17
|
-
* - Every buffer is transferred, never structured-cloned
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* - Every row and output buffer is transferred, never structured-cloned.
|
|
18
|
+
* - The module crosses as its original BYTES, never as a compiled
|
|
19
|
+
* `WebAssembly.Module` (the shared engine protocol, wrun-chart-host 0.6.0):
|
|
20
|
+
* `module-load` hands the worker the bytes once to hash, verify against the
|
|
21
|
+
* sheet's pin, clamp, prepare and compile, and answers the client's opaque
|
|
22
|
+
* handle (`WrunModuleHandle`); every full run and live-start names the
|
|
23
|
+
* compiled module by its key and carries the bytes again (copied by
|
|
24
|
+
* structured clone, never transferred), so a worker that lost its cache
|
|
25
|
+
* (a respawn, an eviction) compiles them again. The worker answers
|
|
26
|
+
* `{ id, running: true }` once the module is instantiated (the request
|
|
27
|
+
* executes from there), and the run's deadline starts there.
|
|
20
28
|
*/
|
|
21
29
|
import type { WrunHandleDefaultsByKind, WrunHandleKind, WrunHandleRecord, WrunLabelPosition, WrunTextStyle } from '../utility/wrun/wrun-handles.util.js';
|
|
22
30
|
import type { WrunParamHostFill, WrunWarmupWindow } from '@orangecharts/indicator-kit';
|
|
@@ -53,7 +61,14 @@ export interface WrunPackedRunRequest extends WrunPackedRowsBlock {
|
|
|
53
61
|
/** 'live' arms same-bar snapshot/restore replay; 'historical' drives each
|
|
54
62
|
* row exactly once. */
|
|
55
63
|
mode: 'historical' | 'live';
|
|
56
|
-
module
|
|
64
|
+
/** The module's key in the worker's cache (`${sha256}|${abi}`, the handle's
|
|
65
|
+
* `key`): a worker holding it reuses its compiled module. */
|
|
66
|
+
moduleKey: string;
|
|
67
|
+
/** The module's original bytes: the host's private snapshot behind the
|
|
68
|
+
* handle, copied by structured clone (never transferred). The worker
|
|
69
|
+
* compiles them only on a miss (it never held the key, or let it go),
|
|
70
|
+
* after checking they hash to the key's digest. */
|
|
71
|
+
moduleBytes: Uint8Array;
|
|
57
72
|
outputCount: number;
|
|
58
73
|
/** init()'s positional argument block (declared params, in order). */
|
|
59
74
|
initArgs: number[];
|
|
@@ -71,14 +86,67 @@ export interface WrunPackedRunRequest extends WrunPackedRowsBlock {
|
|
|
71
86
|
* a text param with no entry reads as "" at the module. */
|
|
72
87
|
textParams?: Readonly<Record<number, Uint8Array>>;
|
|
73
88
|
}
|
|
89
|
+
/** One import of a module, as WebAssembly.Module.imports() lists it. */
|
|
90
|
+
export interface WrunModuleImport {
|
|
91
|
+
readonly module: string;
|
|
92
|
+
readonly name: string;
|
|
93
|
+
}
|
|
94
|
+
/** A module the engine worker verified and compiled: the client's opaque handle, never a WebAssembly.Module.
|
|
95
|
+
* The host keeps the original bytes privately (a WeakMap behind the handle); nothing outside the host reads them. */
|
|
96
|
+
export interface WrunModuleHandle {
|
|
97
|
+
/** `${sha256}|${abi}`: the worker's cache key. Minted by the worker's verified load, never by a caller. */
|
|
98
|
+
readonly key: string;
|
|
99
|
+
/** Hex sha256 of the ORIGINAL package bytes (the sheet's wasm_sha256 pin when it has one; computed otherwise). */
|
|
100
|
+
readonly sha256: string;
|
|
101
|
+
/** The ABI version the sheet declares (metadata.abi_version). */
|
|
102
|
+
readonly abi: WrunAbiVersion;
|
|
103
|
+
/** Every import in WebAssembly.Module.imports() order (the bar-count and stamp readers). */
|
|
104
|
+
readonly imports: readonly WrunModuleImport[];
|
|
105
|
+
}
|
|
106
|
+
/** A module's key in the engine worker's cache, the handle's `key`: the sha256 of its original bytes and the ABI it
|
|
107
|
+
* compiles for. The worker mints it from the digest it computed; the client keys its own cache of a pinned sheet's
|
|
108
|
+
* handle by the same spelling of the pin, so the two never drift apart. */
|
|
109
|
+
export declare function wrunModuleKey(sha256: string, abi: WrunAbiVersion): string;
|
|
110
|
+
/** main -> worker: hash, verify, prepare and compile a module; cache it under its key. */
|
|
111
|
+
export interface WrunModuleLoadRequest {
|
|
112
|
+
kind: 'module-load';
|
|
113
|
+
id: number;
|
|
114
|
+
abi: WrunAbiVersion;
|
|
115
|
+
/** The sheet's pin; a mismatch answers `module-pin-mismatch` (with the digest found) and caches nothing. */
|
|
116
|
+
sha256Pin?: string;
|
|
117
|
+
/** The original bytes. Copied, never transferred: the host keeps its own snapshot. */
|
|
118
|
+
bytes: Uint8Array;
|
|
119
|
+
}
|
|
120
|
+
export interface WrunModuleLoadResponse {
|
|
121
|
+
id: number;
|
|
122
|
+
ok: true;
|
|
123
|
+
kind: 'module-load';
|
|
124
|
+
key: string;
|
|
125
|
+
sha256: string;
|
|
126
|
+
imports: WrunModuleImport[];
|
|
127
|
+
}
|
|
128
|
+
/** worker -> main, once per run, live-start and live-rows request, once the module is instantiated, right before the
|
|
129
|
+
* guest's first call (or at once for live-rows): the run deadline starts. A terminal reply may come without it (a
|
|
130
|
+
* lost session, a refused load). */
|
|
131
|
+
export interface WrunWorkerRunningMessage {
|
|
132
|
+
id: number;
|
|
133
|
+
running: true;
|
|
134
|
+
}
|
|
135
|
+
/** A full run as the ABI host runs it (`runWrunPackedRequest`): the wire request minus the module's transport (its
|
|
136
|
+
* key and bytes) plus the module the engine worker resolved them to. An internal type the worker's handler builds;
|
|
137
|
+
* the wire type never carries a module. */
|
|
138
|
+
export type WrunResolvedRunRequest = Omit<WrunPackedRunRequest, 'moduleKey' | 'moduleBytes'> & {
|
|
139
|
+
module: WebAssembly.Module;
|
|
140
|
+
};
|
|
74
141
|
/** Full run that also OPENS (or replaces) a live session under sessionKey. */
|
|
75
142
|
export interface WrunLiveStartRequest extends WrunPackedRunRequest {
|
|
76
143
|
kind: 'live-start';
|
|
77
144
|
sessionKey: string;
|
|
78
145
|
/** The live context generation opening this session. The worker keeps the
|
|
79
146
|
* newest epoch per session key: a live-start whose epoch is no longer the
|
|
80
|
-
* newest when its instantiation
|
|
81
|
-
* arrived meanwhile
|
|
147
|
+
* newest when its compile and instantiation settle (a newer start or a
|
|
148
|
+
* live-end arrived meanwhile; the worker reads the fence and the epoch as
|
|
149
|
+
* the start arrives) computes its block but installs no session, so a
|
|
82
150
|
* torn-down overlay's pending start can never resurrect a session. Absent
|
|
83
151
|
* on legacy callers: installs unconditionally after the live-end fence. */
|
|
84
152
|
epoch?: number;
|
|
@@ -130,7 +198,7 @@ export interface WrunLiveEndRequest {
|
|
|
130
198
|
}
|
|
131
199
|
/** Everything the sandbox worker accepts. A bare WrunPackedRunRequest (no
|
|
132
200
|
* `kind`) stays the classic one-shot run. */
|
|
133
|
-
export type WrunWorkerRequest = WrunPackedRunRequest | WrunLiveStartRequest | WrunLiveRowsRequest | WrunLiveEndRequest;
|
|
201
|
+
export type WrunWorkerRequest = WrunPackedRunRequest | WrunLiveStartRequest | WrunLiveRowsRequest | WrunLiveEndRequest | WrunModuleLoadRequest;
|
|
134
202
|
interface WrunPackedRunStrings {
|
|
135
203
|
lens: Int32Array;
|
|
136
204
|
offsets: Int32Array;
|
|
@@ -157,7 +225,7 @@ export type WrunWorkerResponse = {
|
|
|
157
225
|
frames?: (string | undefined)[];
|
|
158
226
|
/** Live-mode blocks only: the block's restore/snapshot accounting. */
|
|
159
227
|
live?: WrunLiveBlockStats;
|
|
160
|
-
} | {
|
|
228
|
+
} | WrunModuleLoadResponse | WrunWorkerRunningMessage | {
|
|
161
229
|
id: number;
|
|
162
230
|
ok: false;
|
|
163
231
|
error: string;
|
|
@@ -165,11 +233,18 @@ export type WrunWorkerResponse = {
|
|
|
165
233
|
* started, disposed, or lost to a worker respawn). The caller rebuilds
|
|
166
234
|
* via a fresh live-start instead of treating this as a compute error. */
|
|
167
235
|
sessionLost?: true;
|
|
168
|
-
/** live-rows only: the block was refused before
|
|
169
|
-
* rows run backwards (WrunLiveOrderError); the
|
|
170
|
-
* the caller reseeds it from its buffers (the
|
|
171
|
-
* disagree on the watermark) instead of retrying
|
|
172
|
-
|
|
236
|
+
/** `live-order` (live-rows only): the block was refused before
|
|
237
|
+
* evaluation because its rows run backwards (WrunLiveOrderError); the
|
|
238
|
+
* session survives, and the caller reseeds it from its buffers (the
|
|
239
|
+
* worker and the context disagree on the watermark) instead of retrying
|
|
240
|
+
* the same block. `module-pin-mismatch`: the bytes do not hash to the
|
|
241
|
+
* sheet's pin (a load) or to the run's module key (a full run or
|
|
242
|
+
* live-start compiling on a miss); nothing is cached. `module-compile-
|
|
243
|
+
* failed`: the engine refused to compile the module (a
|
|
244
|
+
* WebAssembly.CompileError); nothing is cached. */
|
|
245
|
+
code?: 'live-order' | 'module-pin-mismatch' | 'module-compile-failed';
|
|
246
|
+
/** `module-pin-mismatch` only: the hex sha256 the bytes hash to. */
|
|
247
|
+
sha256?: string;
|
|
173
248
|
};
|
|
174
249
|
/** One unpacked result row: `outputs` is null on a non-ready row; `strings`
|
|
175
250
|
* entries are undefined for ABSENT slots and '' for present-empty writes. */
|
|
@@ -14,9 +14,17 @@
|
|
|
14
14
|
* when string slots are declared.
|
|
15
15
|
* - Response: `ready` (Uint8Array) + `outputs` (Float64Array, row-major at
|
|
16
16
|
* the output count), plus the packed string table when slots are declared.
|
|
17
|
-
* - Every buffer is transferred, never structured-cloned
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* - Every row and output buffer is transferred, never structured-cloned.
|
|
18
|
+
* - The module crosses as its original BYTES, never as a compiled
|
|
19
|
+
* `WebAssembly.Module` (the shared engine protocol, wrun-chart-host 0.6.0):
|
|
20
|
+
* `module-load` hands the worker the bytes once to hash, verify against the
|
|
21
|
+
* sheet's pin, clamp, prepare and compile, and answers the client's opaque
|
|
22
|
+
* handle (`WrunModuleHandle`); every full run and live-start names the
|
|
23
|
+
* compiled module by its key and carries the bytes again (copied by
|
|
24
|
+
* structured clone, never transferred), so a worker that lost its cache
|
|
25
|
+
* (a respawn, an eviction) compiles them again. The worker answers
|
|
26
|
+
* `{ id, running: true }` once the module is instantiated (the request
|
|
27
|
+
* executes from there), and the run's deadline starts there.
|
|
20
28
|
*/
|
|
21
29
|
const WRUN_ABI_ORDER = {
|
|
22
30
|
'wrun-1': 1,
|
|
@@ -29,6 +37,12 @@ const WRUN_ABI_ORDER = {
|
|
|
29
37
|
export function abiAtLeast(abi, floor) {
|
|
30
38
|
return WRUN_ABI_ORDER[abi] >= WRUN_ABI_ORDER[floor];
|
|
31
39
|
}
|
|
40
|
+
/** A module's key in the engine worker's cache, the handle's `key`: the sha256 of its original bytes and the ABI it
|
|
41
|
+
* compiles for. The worker mints it from the digest it computed; the client keys its own cache of a pinned sheet's
|
|
42
|
+
* handle by the same spelling of the pin, so the two never drift apart. */
|
|
43
|
+
export function wrunModuleKey(sha256, abi) {
|
|
44
|
+
return `${sha256}|${abi}`;
|
|
45
|
+
}
|
|
32
46
|
/** A live rows block was refused BEFORE any evaluation because its rows run
|
|
33
47
|
* backwards relative to the session watermark (or each other). The guest
|
|
34
48
|
* state is untouched: the session stays valid, so the worker answers a
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function mergeLiveOhlcvDataPoint(lastData: any[], data: any, normalizedTime: number): any[];
|