@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,238 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server time for every thread: the device clock is never the server's "now".
|
|
3
|
+
*
|
|
4
|
+
* About 1.3% of devices run a clock more than 30 s ahead (18 in 8,196 more
|
|
5
|
+
* than 30 min). A window sent to the gateway, or a "now" compared with server
|
|
6
|
+
* timestamps, read off such a clock asks the future: a 30 s trailing window
|
|
7
|
+
* an hour ahead answers 0 rows and the pane says "No data in range". Anything
|
|
8
|
+
* compared with server time reads `serverNowMs()`; a duration between two
|
|
9
|
+
* device events reads `performance.now()`; a device wall-clock stamp that
|
|
10
|
+
* must survive a reload (an IndexedDB TTL) reads `deviceNowMs()`, so every
|
|
11
|
+
* device-clock read is a decision (docs/features/data/loading/architecture.md, "Server time").
|
|
12
|
+
* The server clock steps when a calibration lands (the first response, a
|
|
13
|
+
* device clock jump), so a duration never subtracts two server-clock reads.
|
|
14
|
+
*
|
|
15
|
+
* The offset (server minus client, ms) comes from responses the app already
|
|
16
|
+
* receives: no request of its own. Every API response carries a `Date`
|
|
17
|
+
* header; the app calls the API on its own origin, so the header is readable.
|
|
18
|
+
* HttpService and the refresh-token call hand each response's header here
|
|
19
|
+
* with the client time it arrived. The header floors to the second and is
|
|
20
|
+
* stamped before the response travels, and the arrival is stamped after the
|
|
21
|
+
* body landed and the continuation ran, so each sample is a LOWER bound of
|
|
22
|
+
* the true offset (by up to about one second plus transit, seconds more
|
|
23
|
+
* behind a slow response or a busy main thread): the largest sample is the
|
|
24
|
+
* tightest. A sample more than `JUMP_MS` above the estimate is a device clock
|
|
25
|
+
* that went back, followed at once (a delay only lowers a sample); one more
|
|
26
|
+
* than `JUMP_MS` below it is a late sample or a device clock that jumped
|
|
27
|
+
* ahead, held until a second sample confirms it. An estimate is stored only
|
|
28
|
+
* once a second sample agrees with it.
|
|
29
|
+
*
|
|
30
|
+
* Not the access token: internal roles get a 1-day token while the login and
|
|
31
|
+
* refresh responses report the 15-minute lifetime, so `exp` against the
|
|
32
|
+
* client's `accessExpiresAt` reads a day of fake skew for those accounts.
|
|
33
|
+
*
|
|
34
|
+
* Threads: the main thread samples responses and applies a correction (the
|
|
35
|
+
* offset outside the deadband, else 0) that moves on a change of
|
|
36
|
+
* `APPLY_STEP_MS` or more and on every deadband crossing. The data worker
|
|
37
|
+
* receives exactly that correction through the WorkerManager mirror
|
|
38
|
+
* (`setServerClockOffsetMs`) on every move and in each worker's bootstrap,
|
|
39
|
+
* so `serverNowMs()` reads the same clock in both.
|
|
40
|
+
*
|
|
41
|
+
* Boot: nothing awaits an API response before the first chart request, so the
|
|
42
|
+
* last measured offset is kept in localStorage (a device's skew is stable for
|
|
43
|
+
* days) and serves until this page measures one. It is rewritten at least
|
|
44
|
+
* daily while it holds, so a stable skew never ages out.
|
|
45
|
+
*/
|
|
46
|
+
/** A sample this far from the estimate is a device clock jump or a late sample, not jitter. */
|
|
47
|
+
const JUMP_MS = 5_000;
|
|
48
|
+
/** An offset this close to zero reads as zero: a synced device keeps the device clock exactly. */
|
|
49
|
+
export const SERVER_CLOCK_DEADBAND_MS = 2_000;
|
|
50
|
+
/** The applied correction (and the mirror and the change listeners with it) moves on a change at least this large. */
|
|
51
|
+
const APPLY_STEP_MS = 500;
|
|
52
|
+
/** A stored offset is rewritten when it moved at least this far, */
|
|
53
|
+
const PERSIST_STEP_MS = 1_000;
|
|
54
|
+
/** or when its stamp is this old, so an offset that holds never ages out. */
|
|
55
|
+
const PERSIST_REFRESH_MS = 24 * 60 * 60_000;
|
|
56
|
+
export const SERVER_CLOCK_STORAGE_KEY = 'kiyo:server-clock-offset';
|
|
57
|
+
/** A stored offset older than this is ignored (the device may have been fixed since). */
|
|
58
|
+
const PERSIST_MAX_AGE_MS = 7 * 24 * 60 * 60_000;
|
|
59
|
+
/** Measured this session: sampled from responses (main thread) or mirrored from the main thread (worker). */
|
|
60
|
+
let measuredOffsetMs = null;
|
|
61
|
+
/** A sample far below the estimate, waiting for a second sample to confirm it (a late one never does). */
|
|
62
|
+
let candidateOffsetMs = null;
|
|
63
|
+
/** A second sample of this session agreed with the measured offset: it may be stored. */
|
|
64
|
+
let measuredAgreed = false;
|
|
65
|
+
/** The last session's offset, read once from localStorage (undefined until read). */
|
|
66
|
+
let storedOffsetMs;
|
|
67
|
+
/** What localStorage holds: the offset and its server-time stamp, as read or last written. */
|
|
68
|
+
let persisted = null;
|
|
69
|
+
/** The correction `serverNowMs` applies and the mirror carries (undefined until first derived). */
|
|
70
|
+
let appliedCorrectionMs;
|
|
71
|
+
const listeners = new Set();
|
|
72
|
+
function readStoredOffsetMs() {
|
|
73
|
+
if (storedOffsetMs !== undefined)
|
|
74
|
+
return storedOffsetMs;
|
|
75
|
+
storedOffsetMs = null;
|
|
76
|
+
try {
|
|
77
|
+
const raw = globalThis.localStorage?.getItem(SERVER_CLOCK_STORAGE_KEY);
|
|
78
|
+
const parsed = raw ? JSON.parse(raw) : null;
|
|
79
|
+
const offsetMs = Number(parsed?.offsetMs);
|
|
80
|
+
const atMs = Number(parsed?.atMs);
|
|
81
|
+
if (Number.isFinite(offsetMs) &&
|
|
82
|
+
Number.isFinite(atMs) &&
|
|
83
|
+
Math.abs(Date.now() + offsetMs - atMs) < PERSIST_MAX_AGE_MS) {
|
|
84
|
+
storedOffsetMs = offsetMs;
|
|
85
|
+
persisted = { offsetMs, atMs };
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
// No storage (a worker, a private window): the stored offset stays unknown.
|
|
90
|
+
}
|
|
91
|
+
return storedOffsetMs;
|
|
92
|
+
}
|
|
93
|
+
function persist(offsetMs) {
|
|
94
|
+
readStoredOffsetMs();
|
|
95
|
+
const atMs = Date.now() + offsetMs;
|
|
96
|
+
if (persisted !== null &&
|
|
97
|
+
Math.abs(offsetMs - persisted.offsetMs) < PERSIST_STEP_MS &&
|
|
98
|
+
Math.abs(atMs - persisted.atMs) < PERSIST_REFRESH_MS) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
try {
|
|
102
|
+
globalThis.localStorage?.setItem(SERVER_CLOCK_STORAGE_KEY, JSON.stringify({ offsetMs, atMs }));
|
|
103
|
+
persisted = { offsetMs, atMs };
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
// Storage full or blocked: the next session measures again.
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/** The correction an offset asks for: zero inside the deadband, null when no offset is known. */
|
|
110
|
+
function correctionFor(offsetMs) {
|
|
111
|
+
if (offsetMs === null)
|
|
112
|
+
return null;
|
|
113
|
+
return Math.abs(offsetMs) < SERVER_CLOCK_DEADBAND_MS ? 0 : offsetMs;
|
|
114
|
+
}
|
|
115
|
+
function applied() {
|
|
116
|
+
if (appliedCorrectionMs === undefined)
|
|
117
|
+
appliedCorrectionMs = correctionFor(effectiveServerClockOffsetMs());
|
|
118
|
+
return appliedCorrectionMs;
|
|
119
|
+
}
|
|
120
|
+
function notify(correctionMs) {
|
|
121
|
+
for (const listener of listeners) {
|
|
122
|
+
try {
|
|
123
|
+
listener(correctionMs);
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
// A listener's failure never stops the clock.
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/** Moves the applied correction off `before` on a change of APPLY_STEP_MS or more and on every deadband crossing. */
|
|
131
|
+
function publish(before) {
|
|
132
|
+
const next = correctionFor(effectiveServerClockOffsetMs());
|
|
133
|
+
const moved = next === null || before === null
|
|
134
|
+
? next !== before
|
|
135
|
+
: (next === 0) !== (before === 0) || Math.abs(next - before) >= APPLY_STEP_MS;
|
|
136
|
+
if (!moved)
|
|
137
|
+
return;
|
|
138
|
+
appliedCorrectionMs = next;
|
|
139
|
+
notify(next);
|
|
140
|
+
}
|
|
141
|
+
/** Record one response's `Date` header against the client time it arrived. */
|
|
142
|
+
export function noteServerDateHeader(dateHeader, receivedAtMs) {
|
|
143
|
+
if (typeof dateHeader !== 'string' || dateHeader.length === 0)
|
|
144
|
+
return;
|
|
145
|
+
const serverMs = Date.parse(dateHeader);
|
|
146
|
+
if (!Number.isFinite(serverMs) || !Number.isFinite(receivedAtMs))
|
|
147
|
+
return;
|
|
148
|
+
const sampleMs = serverMs - receivedAtMs;
|
|
149
|
+
const before = applied();
|
|
150
|
+
// Judged against this session's estimate, else the last session's: a boot response that lands late behind a busy
|
|
151
|
+
// main thread never moves a synced device off its stored offset.
|
|
152
|
+
const estimateMs = measuredOffsetMs ?? readStoredOffsetMs();
|
|
153
|
+
if (estimateMs !== null && estimateMs - sampleMs > JUMP_MS) {
|
|
154
|
+
// Far below: a late sample, or a device clock that jumped ahead. Only a second sample tells them apart.
|
|
155
|
+
if (candidateOffsetMs === null || Math.abs(sampleMs - candidateOffsetMs) > JUMP_MS) {
|
|
156
|
+
candidateOffsetMs = sampleMs;
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
measuredOffsetMs = Math.max(candidateOffsetMs, sampleMs);
|
|
160
|
+
measuredAgreed = true;
|
|
161
|
+
}
|
|
162
|
+
else if (measuredOffsetMs === null || sampleMs - measuredOffsetMs > JUMP_MS) {
|
|
163
|
+
// This session's first sample, or one far above (a device clock that went back): followed at once.
|
|
164
|
+
measuredOffsetMs = sampleMs;
|
|
165
|
+
measuredAgreed = false;
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
// Within the band: the tightest lower bound, and a second sample that agrees.
|
|
169
|
+
measuredOffsetMs = Math.max(measuredOffsetMs, sampleMs);
|
|
170
|
+
measuredAgreed = true;
|
|
171
|
+
}
|
|
172
|
+
candidateOffsetMs = null;
|
|
173
|
+
if (measuredAgreed)
|
|
174
|
+
persist(measuredOffsetMs);
|
|
175
|
+
publish(before);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* The worker side of the mirror: the correction the main thread applies (null when it has none), applied exactly. A
|
|
179
|
+
* worker never samples a response itself, so this is its only source.
|
|
180
|
+
*/
|
|
181
|
+
export function setServerClockOffsetMs(correctionMs) {
|
|
182
|
+
const before = applied();
|
|
183
|
+
measuredOffsetMs = typeof correctionMs === 'number' && Number.isFinite(correctionMs) ? correctionMs : null;
|
|
184
|
+
candidateOffsetMs = null;
|
|
185
|
+
appliedCorrectionMs = correctionFor(measuredOffsetMs);
|
|
186
|
+
if (appliedCorrectionMs !== before)
|
|
187
|
+
notify(appliedCorrectionMs);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Server minus client clock (ms) measured in this session, or null when no response carried a usable `Date`
|
|
191
|
+
* (a dev build pointed at a cross-origin API never exposes it). A label that must not guess reads this and
|
|
192
|
+
* treats null as "no server clock" (the CME late-feed label).
|
|
193
|
+
*/
|
|
194
|
+
export function serverClockOffsetMs() {
|
|
195
|
+
return measuredOffsetMs;
|
|
196
|
+
}
|
|
197
|
+
/** The offset before the deadband: this session's, else the last session's, else null. */
|
|
198
|
+
export function effectiveServerClockOffsetMs() {
|
|
199
|
+
return measuredOffsetMs ?? readStoredOffsetMs();
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* The correction `serverNowMs` applies to the device clock (ms): the offset outside the deadband, else 0; null when
|
|
203
|
+
* none is known. The WorkerManager mirror carries exactly this, so both threads apply the same.
|
|
204
|
+
*/
|
|
205
|
+
export function serverClockCorrectionMs() {
|
|
206
|
+
return applied();
|
|
207
|
+
}
|
|
208
|
+
/** The server's "now" in ms: the device clock corrected by the offset (exactly the device clock when synced). */
|
|
209
|
+
export function serverNowMs() {
|
|
210
|
+
const correctionMs = applied();
|
|
211
|
+
return correctionMs ? Date.now() + correctionMs : Date.now();
|
|
212
|
+
}
|
|
213
|
+
/** The server's "now" in whole unix seconds. */
|
|
214
|
+
export function serverNowS() {
|
|
215
|
+
return Math.floor(serverNowMs() / 1000);
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* The device wall clock, named: for a stamp that must survive a reload and is only ever compared with other device
|
|
219
|
+
* stamps (an IndexedDB TTL). Never for anything compared with server time.
|
|
220
|
+
*/
|
|
221
|
+
export function deviceNowMs() {
|
|
222
|
+
return Date.now();
|
|
223
|
+
}
|
|
224
|
+
/** Called with the applied correction whenever it moves (the WorkerManager mirror). Returns the unsubscribe. */
|
|
225
|
+
export function onServerClockChange(listener) {
|
|
226
|
+
listeners.add(listener);
|
|
227
|
+
return () => listeners.delete(listener);
|
|
228
|
+
}
|
|
229
|
+
/** Specs only: forget every observation, the stored offset and the listeners. */
|
|
230
|
+
export function resetServerClockForTests() {
|
|
231
|
+
measuredOffsetMs = null;
|
|
232
|
+
candidateOffsetMs = null;
|
|
233
|
+
measuredAgreed = false;
|
|
234
|
+
storedOffsetMs = undefined;
|
|
235
|
+
persisted = null;
|
|
236
|
+
appliedCorrectionMs = undefined;
|
|
237
|
+
listeners.clear();
|
|
238
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type BuiltinIdentity = {
|
|
2
|
+
kind: 'template';
|
|
3
|
+
key: string;
|
|
4
|
+
} | {
|
|
5
|
+
kind: 'twin';
|
|
6
|
+
key: string;
|
|
7
|
+
package: string;
|
|
8
|
+
version: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Which shipped built-in an overlay stands for, or undefined. Twin first (the stamp, with the
|
|
12
|
+
* package and version of the registry identity beside it), else the template key (`subType`
|
|
13
|
+
* whenever present, else `customScriptId`: isChartOnlyOfficialOverlay's rule, no fall-through)
|
|
14
|
+
* when it names a shipped built-in and the row carries no wrun identity.
|
|
15
|
+
*/
|
|
16
|
+
export declare function builtinIdentityOf(settings: unknown): BuiltinIdentity | undefined;
|
|
17
|
+
/** `builtinIdentityOf(settings)?.key`: the built-in's registry key, template or twin. */
|
|
18
|
+
export declare function builtinKeyOf(settings: unknown): string | undefined;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which shipped built-in an overlay stands for: the template it runs (a TECHNICAL_INDICATOR_SCRIPTS
|
|
3
|
+
* key), or the PROVEN wrun twin mounted in its place (the `builtinTwinOf` stamp beside its registry
|
|
4
|
+
* identity, wrun-builtin-twin.util). The one resolver behind every site that treats a twin as its
|
|
5
|
+
* built-in: the shipped-built-in predicate (the boot stand-in and the price-pane fold), the
|
|
6
|
+
* stand-in key, the legend shape, the Forex volume rule, the CME display wall and the theme. It
|
|
7
|
+
* names the built-in and nothing more: protected placement, editor source and the zero-cost slot
|
|
8
|
+
* rule stay each site's own refusals, and chart-only-official.util (orange's save-gate mirror)
|
|
9
|
+
* never reads it.
|
|
10
|
+
*
|
|
11
|
+
* Leaf: no store, no chart graph, no i18n, so the worker-safe venue decider imports it.
|
|
12
|
+
*/
|
|
13
|
+
import { TECHNICAL_INDICATOR_SCRIPT_KEY_SET } from '../../constants/scriptEditor/technicalIndicatorScriptKeys.constants.js';
|
|
14
|
+
import { builtinTwinOf } from '../wrun/wrun-builtin-twin.util.js';
|
|
15
|
+
import { wrunRegistryRefOf } from '../wrun/wrun-overlay-identity.util.js';
|
|
16
|
+
const isAbsent = (value) => value === undefined || value === null || value === '';
|
|
17
|
+
function hasPackage(ref) {
|
|
18
|
+
return typeof ref === 'object' && ref !== null && !!ref.package;
|
|
19
|
+
}
|
|
20
|
+
// A wrun identity outranks the template in the technical-script control (initializeOverlay): the
|
|
21
|
+
// package lane runs. The four markers chart-only-official.util and shipped-template-key.util read.
|
|
22
|
+
function carriesWrunIdentity(settings) {
|
|
23
|
+
return (hasPackage(settings.wrunRef) ||
|
|
24
|
+
hasPackage(settings.wrunRegistryRef) ||
|
|
25
|
+
!!settings.wrunDraftRef ||
|
|
26
|
+
settings.wrunDevLocal === true);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Which shipped built-in an overlay stands for, or undefined. Twin first (the stamp, with the
|
|
30
|
+
* package and version of the registry identity beside it), else the template key (`subType`
|
|
31
|
+
* whenever present, else `customScriptId`: isChartOnlyOfficialOverlay's rule, no fall-through)
|
|
32
|
+
* when it names a shipped built-in and the row carries no wrun identity.
|
|
33
|
+
*/
|
|
34
|
+
export function builtinIdentityOf(settings) {
|
|
35
|
+
if (!settings || typeof settings !== 'object')
|
|
36
|
+
return undefined;
|
|
37
|
+
const record = settings;
|
|
38
|
+
const twinKey = builtinTwinOf(record);
|
|
39
|
+
const ref = wrunRegistryRefOf(record);
|
|
40
|
+
if (twinKey !== undefined && ref !== undefined) {
|
|
41
|
+
return { kind: 'twin', key: twinKey, package: ref.package, version: ref.version };
|
|
42
|
+
}
|
|
43
|
+
if (carriesWrunIdentity(record))
|
|
44
|
+
return undefined;
|
|
45
|
+
const key = isAbsent(record.subType) ? record.customScriptId : record.subType;
|
|
46
|
+
return typeof key === 'string' && TECHNICAL_INDICATOR_SCRIPT_KEY_SET.has(key) ? { kind: 'template', key } : undefined;
|
|
47
|
+
}
|
|
48
|
+
/** `builtinIdentityOf(settings)?.key`: the built-in's registry key, template or twin. */
|
|
49
|
+
export function builtinKeyOf(settings) {
|
|
50
|
+
return builtinIdentityOf(settings)?.key;
|
|
51
|
+
}
|