@orangecharts/wrun-chart-host 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -4
- package/dist/constants/exchange-names.leaf.d.ts +8 -0
- package/dist/constants/exchange-names.leaf.js +101 -0
- package/dist/constants/kscript-data-interval-restrictions.constants.d.ts +15 -0
- package/dist/constants/kscript-data-interval-restrictions.constants.js +40 -0
- package/dist/constants/opra-compliance.constants.d.ts +19 -0
- package/dist/constants/opra-compliance.constants.js +19 -0
- package/dist/constants/replay-ladder.leaf.d.ts +30 -0
- package/dist/constants/replay-ladder.leaf.js +99 -0
- package/dist/constants/scriptEditor/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 +313 -18
- package/dist/host-env.js +15 -0
- package/dist/host-ports.types.d.ts +853 -16
- package/dist/index.d.ts +139 -2
- package/dist/index.js +139 -2
- package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +31 -0
- package/dist/instances/script-engine-worker-ohlcv-transfer.js +164 -0
- package/dist/interfaces/market-event.interface.d.ts +231 -0
- package/dist/interfaces/market-event.interface.js +15 -0
- package/dist/interfaces/opra-realtime.interface.d.ts +70 -134
- package/dist/interfaces/opra-realtime.interface.js +34 -59
- package/dist/interfaces/replay.interface.d.ts +285 -0
- package/dist/interfaces/replay.interface.js +1 -0
- package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +1 -0
- package/dist/kscript-data/controls/live-ohlcv-merge.util.js +93 -0
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +5 -1
- package/dist/kscript-data/controls/live-trades-merge.util.js +2 -2
- package/dist/market-data/billing.interface.d.ts +219 -0
- package/dist/market-data/billing.interface.js +58 -0
- package/dist/market-data/venue-governed.util.d.ts +2 -0
- package/dist/market-data/venue-governed.util.js +10 -0
- package/dist/market-data/venue.d.ts +122 -0
- package/dist/market-data/venue.js +1 -0
- package/dist/market-data/venues/index.d.ts +97 -0
- package/dist/market-data/venues/index.js +33 -0
- package/dist/market-data/venues/opra.contract.copy.json +35 -0
- package/dist/market-data/venues/opra.d.ts +70 -0
- package/dist/market-data/venues/opra.js +74 -0
- package/dist/replay/replayIndicatorRows.d.ts +31 -0
- package/dist/replay/replayIndicatorRows.js +117 -0
- package/dist/replay/replayLadder.d.ts +85 -0
- package/dist/replay/replayLadder.js +388 -0
- package/dist/utility/auth/server-clock.util.d.ts +81 -0
- package/dist/utility/auth/server-clock.util.js +238 -0
- package/dist/utility/chart/builtin-identity.util.d.ts +18 -0
- package/dist/utility/chart/builtin-identity.util.js +51 -0
- package/dist/utility/chart/cache-alignment.util.d.ts +454 -0
- package/dist/utility/chart/cache-alignment.util.js +926 -0
- package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +15 -0
- package/dist/utility/chart/chart-data-fetch-generation.util.js +22 -0
- package/dist/utility/chart/chart-mount-epoch.util.d.ts +5 -0
- package/dist/utility/chart/chart-mount-epoch.util.js +29 -0
- package/dist/utility/chart/chart-time-domain.util.d.ts +12 -0
- package/dist/utility/chart/chart-time-domain.util.js +23 -0
- package/dist/utility/chart/color-customization.leaf.d.ts +10 -0
- package/dist/utility/chart/color-customization.leaf.js +16 -0
- package/dist/utility/chart/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 +83 -0
- package/dist/utility/wrun/wrun-bar-count.util.js +259 -0
- package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +84 -0
- package/dist/utility/wrun/wrun-chart-context-names.util.js +186 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +253 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +731 -0
- package/dist/utility/wrun/wrun-cloud-opra-stamp.util.d.ts +28 -0
- package/dist/utility/wrun/wrun-cloud-opra-stamp.util.js +45 -0
- package/dist/utility/wrun/wrun-coin-lane-live.util.d.ts +18 -0
- package/dist/utility/wrun/wrun-coin-lane-live.util.js +47 -0
- package/dist/utility/wrun/wrun-deadline.util.js +2 -1
- package/dist/utility/wrun/wrun-debug-output.util.d.ts +39 -0
- package/dist/utility/wrun/wrun-debug-output.util.js +63 -0
- package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +113 -0
- package/dist/utility/wrun/wrun-declared-warmup.util.js +181 -0
- package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +43 -0
- package/dist/utility/wrun/wrun-draft-legend-note.util.js +158 -0
- package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +181 -0
- package/dist/utility/wrun/wrun-draft-overlay.util.js +357 -0
- package/dist/utility/wrun/wrun-draw-skipped.leaf.d.ts +16 -0
- package/dist/utility/wrun/wrun-draw-skipped.leaf.js +16 -0
- package/dist/utility/wrun/wrun-earnings-facts.util.d.ts +42 -0
- package/dist/utility/wrun/wrun-earnings-facts.util.js +131 -0
- package/dist/utility/wrun/wrun-first-run-depth.util.d.ts +32 -0
- package/dist/utility/wrun/wrun-first-run-depth.util.js +118 -0
- package/dist/utility/wrun/wrun-gate-plane-readers.util.d.ts +24 -0
- package/dist/utility/wrun/wrun-gate-plane-readers.util.js +31 -0
- package/dist/utility/wrun/wrun-held-lanes.util.d.ts +32 -0
- package/dist/utility/wrun/wrun-held-lanes.util.js +94 -0
- package/dist/utility/wrun/wrun-host-visible-clock.util.d.ts +2 -0
- package/dist/utility/wrun/wrun-host-visible-clock.util.js +17 -0
- package/dist/utility/wrun/wrun-host.service.d.ts +266 -0
- package/dist/utility/wrun/wrun-host.service.js +655 -0
- package/dist/utility/wrun/wrun-inert-legend.util.d.ts +33 -0
- package/dist/utility/wrun/wrun-inert-legend.util.js +125 -0
- package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +155 -0
- package/dist/utility/wrun/wrun-input-requirements.leaf.js +450 -0
- package/dist/utility/wrun/wrun-integration-route.util.d.ts +51 -0
- package/dist/utility/wrun/wrun-integration-route.util.js +59 -0
- package/dist/utility/wrun/wrun-latest-history.leaf.d.ts +8 -0
- package/dist/utility/wrun/wrun-latest-history.leaf.js +8 -0
- package/dist/utility/wrun/wrun-legend-hover.lazy.d.ts +12 -0
- package/dist/utility/wrun/wrun-legend-hover.lazy.js +96 -0
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.d.ts +21 -0
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.js +21 -0
- package/dist/utility/wrun/wrun-live-hidden-hold.util.d.ts +23 -0
- package/dist/utility/wrun/wrun-live-hidden-hold.util.js +13 -0
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +374 -0
- package/dist/utility/wrun/wrun-live-intake.util.js +2027 -0
- package/dist/utility/wrun/wrun-live-patch.util.d.ts +116 -0
- package/dist/utility/wrun/wrun-live-patch.util.js +523 -0
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +619 -0
- package/dist/utility/wrun/wrun-live-tick.util.js +4974 -0
- package/dist/utility/wrun/wrun-loading-owner.util.d.ts +58 -0
- package/dist/utility/wrun/wrun-loading-owner.util.js +89 -0
- package/dist/utility/wrun/wrun-official-scope.leaf.d.ts +29 -0
- package/dist/utility/wrun/wrun-official-scope.leaf.js +36 -0
- package/dist/utility/wrun/wrun-oi-lane.util.d.ts +27 -0
- package/dist/utility/wrun/wrun-oi-lane.util.js +42 -0
- package/dist/utility/wrun/wrun-options-stop.util.d.ts +52 -0
- package/dist/utility/wrun/wrun-options-stop.util.js +123 -0
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +719 -0
- package/dist/utility/wrun/wrun-overlay-drivers.util.js +1180 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.d.ts +50 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.js +131 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +118 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +466 -0
- package/dist/utility/wrun/wrun-overlay-metadata.util.d.ts +45 -0
- package/dist/utility/wrun/wrun-overlay-metadata.util.js +112 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +114 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +971 -0
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +858 -0
- package/dist/utility/wrun/wrun-overlay-run.util.js +11013 -0
- package/dist/utility/wrun/wrun-panel-mount.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-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-sheet-remembered.util.d.ts +21 -0
- package/dist/utility/wrun/wrun-sheet-remembered.util.js +36 -0
- package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.d.ts +7 -0
- package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.js +12 -0
- package/dist/utility/wrun/wrun-socket-row-source.js +4 -2
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +175 -3
- package/dist/utility/wrun/wrun-source-rows.util.js +294 -8
- package/dist/utility/wrun/wrun-stats-strip.util.d.ts +46 -0
- package/dist/utility/wrun/wrun-stats-strip.util.js +87 -0
- package/dist/utility/wrun/wrun-table-chrome.util.d.ts +163 -0
- package/dist/utility/wrun/wrun-table-chrome.util.js +557 -0
- package/dist/utility/wrun/wrun-text-params.util.d.ts +11 -6
- package/dist/utility/wrun/wrun-text-params.util.js +19 -30
- package/dist/utility/wrun/wrun-transient-rerun.util.d.ts +64 -0
- package/dist/utility/wrun/wrun-transient-rerun.util.js +317 -0
- package/dist/utility/wrun/wrun-twin-lookback.util.d.ts +10 -0
- package/dist/utility/wrun/wrun-twin-lookback.util.js +43 -0
- package/dist/utility/wrun/wrun-warmup-head-store.util.d.ts +41 -0
- package/dist/utility/wrun/wrun-warmup-head-store.util.js +120 -0
- package/dist/utility/wrun-alert-params.leaf.d.ts +24 -0
- package/dist/utility/wrun-alert-params.leaf.js +24 -0
- package/dist/utils/replay/replay-buffer-math.d.ts +148 -0
- package/dist/utils/replay/replay-buffer-math.js +684 -0
- package/dist/workers/wrun/wrun-abi-host.d.ts +190 -0
- package/dist/workers/wrun/wrun-abi-host.js +1201 -0
- package/dist/workers/wrun/wrun-engine-handler.d.ts +37 -0
- package/dist/workers/wrun/wrun-engine-handler.js +211 -0
- package/package.json +3 -3
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The wrun sandbox worker's request handler, apart from its realm wiring: the worker's entry
|
|
3
|
+
* (src/workers/wrun-engine.worker.ts) sets the worker's chart-host env first, then binds `self.onmessage` to the
|
|
4
|
+
* handler this factory makes and hands it the realm's `postMessage` as `post`. Every answer leaves through `post`
|
|
5
|
+
* (one argument, or the transfer list as `{ transfer }`), so the handler reads no realm global and keeps no module
|
|
6
|
+
* state: its live sessions live in the factory's closure, one handler per worker realm, and die with the worker.
|
|
7
|
+
*
|
|
8
|
+
* Live forming-bar sessions: a `live-start` request runs like a classic
|
|
9
|
+
* request but KEEPS the instantiated guest under its sessionKey, so later
|
|
10
|
+
* `live-rows` ticks execute only the new/revised rows against the retained
|
|
11
|
+
* state (the ABI's snapshot/restore replays a revised forming bar, memory
|
|
12
|
+
* and ledger alike). Sessions die with the worker; a tick against an
|
|
13
|
+
* unknown key answers `sessionLost` so the main-thread driver rebuilds via
|
|
14
|
+
* a fresh live-start.
|
|
15
|
+
*
|
|
16
|
+
* Session ownership (push-intake contract, plan section 8 fold 3): every
|
|
17
|
+
* `live-start` carries the live context generation as its `epoch`. The
|
|
18
|
+
* worker keeps, per session key, the newest epoch seen and a live-end fence
|
|
19
|
+
* counter. Instantiation is asynchronous, so a start can still be pending
|
|
20
|
+
* when a newer start or a `live-end` (teardown) arrives; when its
|
|
21
|
+
* instantiation settles it installs its session ONLY if its epoch is still
|
|
22
|
+
* the newest and no live-end passed meanwhile (the block is still computed
|
|
23
|
+
* and answered: the caller's full run integrates it, and a later tick on
|
|
24
|
+
* the uninstalled key answers `sessionLost`, whose reseed opens a fresh
|
|
25
|
+
* session under the current generation). A `live-end` bumps the fence and
|
|
26
|
+
* deletes. The session key stays the indicator id.
|
|
27
|
+
*/
|
|
28
|
+
import { type WrunStrategyResponseFields } from './wrun-abi-host.js';
|
|
29
|
+
import type { WrunDrawSkips, WrunWorkerRequest, WrunWorkerResponse } from '../../interfaces/wrun-runtime.interface.js';
|
|
30
|
+
/** How the handler answers a request: the realm's `postMessage` (the worker's entry passes
|
|
31
|
+
* `(message, options) => self.postMessage(message, options)`); a transfer list rides `options`. */
|
|
32
|
+
type WrunEnginePost = (message: WrunWorkerResponse & WrunStrategyResponseFields & WrunDrawSkips, options?: StructuredSerializeOptions) => void;
|
|
33
|
+
/** Handles one request; the promise settles once its answer is posted. */
|
|
34
|
+
type WrunEngineHandler = (request: WrunWorkerRequest) => Promise<void>;
|
|
35
|
+
/** The engine worker's request handler, answering through `post`. The worker's entry makes one, after its env. */
|
|
36
|
+
export declare function createWrunEngineHandler(post: WrunEnginePost): WrunEngineHandler;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The wrun sandbox worker's request handler, apart from its realm wiring: the worker's entry
|
|
3
|
+
* (src/workers/wrun-engine.worker.ts) sets the worker's chart-host env first, then binds `self.onmessage` to the
|
|
4
|
+
* handler this factory makes and hands it the realm's `postMessage` as `post`. Every answer leaves through `post`
|
|
5
|
+
* (one argument, or the transfer list as `{ transfer }`), so the handler reads no realm global and keeps no module
|
|
6
|
+
* state: its live sessions live in the factory's closure, one handler per worker realm, and die with the worker.
|
|
7
|
+
*
|
|
8
|
+
* Live forming-bar sessions: a `live-start` request runs like a classic
|
|
9
|
+
* request but KEEPS the instantiated guest under its sessionKey, so later
|
|
10
|
+
* `live-rows` ticks execute only the new/revised rows against the retained
|
|
11
|
+
* state (the ABI's snapshot/restore replays a revised forming bar, memory
|
|
12
|
+
* and ledger alike). Sessions die with the worker; a tick against an
|
|
13
|
+
* unknown key answers `sessionLost` so the main-thread driver rebuilds via
|
|
14
|
+
* a fresh live-start.
|
|
15
|
+
*
|
|
16
|
+
* Session ownership (push-intake contract, plan section 8 fold 3): every
|
|
17
|
+
* `live-start` carries the live context generation as its `epoch`. The
|
|
18
|
+
* worker keeps, per session key, the newest epoch seen and a live-end fence
|
|
19
|
+
* counter. Instantiation is asynchronous, so a start can still be pending
|
|
20
|
+
* when a newer start or a `live-end` (teardown) arrives; when its
|
|
21
|
+
* instantiation settles it installs its session ONLY if its epoch is still
|
|
22
|
+
* the newest and no live-end passed meanwhile (the block is still computed
|
|
23
|
+
* and answered: the caller's full run integrates it, and a later tick on
|
|
24
|
+
* the uninstalled key answers `sessionLost`, whose reseed opens a fresh
|
|
25
|
+
* session under the current generation). A `live-end` bumps the fence and
|
|
26
|
+
* deletes. The session key stays the indicator id.
|
|
27
|
+
*/
|
|
28
|
+
import { createWrunAbiSession, runWrunPackedRequest, WrunLiveOrderError, } from './wrun-abi-host.js';
|
|
29
|
+
/** The engine worker's request handler, answering through `post`. The worker's entry makes one, after its env. */
|
|
30
|
+
export function createWrunEngineHandler(post) {
|
|
31
|
+
const liveSessions = new Map();
|
|
32
|
+
/** The epoch the session installed under each key opened with (none for a legacy start). */
|
|
33
|
+
const liveSessionEpochs = new Map();
|
|
34
|
+
const liveEpochs = new Map();
|
|
35
|
+
function liveEpochFor(sessionKey) {
|
|
36
|
+
let epoch = liveEpochs.get(sessionKey);
|
|
37
|
+
if (!epoch) {
|
|
38
|
+
epoch = { newest: Number.NEGATIVE_INFINITY, ends: 0, endedThrough: Number.NEGATIVE_INFINITY };
|
|
39
|
+
liveEpochs.set(sessionKey, epoch);
|
|
40
|
+
}
|
|
41
|
+
return epoch;
|
|
42
|
+
}
|
|
43
|
+
async function handleRequest(request) {
|
|
44
|
+
try {
|
|
45
|
+
if (!('kind' in request)) {
|
|
46
|
+
postOutput(request.id, await runWrunPackedRequest(request));
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (request.kind === 'live-end') {
|
|
50
|
+
const gate = liveEpochFor(request.sessionKey);
|
|
51
|
+
if (request.epoch === undefined) {
|
|
52
|
+
// The fence moves BEFORE the delete: a start whose instantiation is
|
|
53
|
+
// pending right now must find the fence moved when it settles.
|
|
54
|
+
gate.ends += 1;
|
|
55
|
+
liveSessions.delete(request.sessionKey);
|
|
56
|
+
liveSessionEpochs.delete(request.sessionKey);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
// An epoch-scoped end (a run ending what it opened) retires that
|
|
60
|
+
// generation only: its session, and its start (or an older one) still
|
|
61
|
+
// instantiating. A newer generation's session or start under the key
|
|
62
|
+
// belongs to another owner and stays.
|
|
63
|
+
gate.endedThrough = Math.max(gate.endedThrough, request.epoch);
|
|
64
|
+
if (liveSessionEpochs.get(request.sessionKey) === request.epoch) {
|
|
65
|
+
liveSessions.delete(request.sessionKey);
|
|
66
|
+
liveSessionEpochs.delete(request.sessionKey);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
postOutput(request.id, { ready: new Uint8Array(0), outputs: new Float64Array(0), strings: undefined });
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (request.kind === 'live-start') {
|
|
73
|
+
const startRequest = request;
|
|
74
|
+
const gate = liveEpochFor(startRequest.sessionKey);
|
|
75
|
+
const epoch = startRequest.epoch;
|
|
76
|
+
// A start already older than the newest epoch seen is stale on
|
|
77
|
+
// arrival (a newer generation opened this key while it queued); it
|
|
78
|
+
// still computes its block for its caller but never installs.
|
|
79
|
+
const staleOnArrival = epoch !== undefined && epoch < gate.newest;
|
|
80
|
+
if (epoch !== undefined && !staleOnArrival)
|
|
81
|
+
gate.newest = epoch;
|
|
82
|
+
const endsAtStart = gate.ends;
|
|
83
|
+
const session = await createWrunAbiSession({
|
|
84
|
+
module: startRequest.module,
|
|
85
|
+
abi: startRequest.abi,
|
|
86
|
+
outputCount: startRequest.outputCount,
|
|
87
|
+
initArgs: startRequest.initArgs,
|
|
88
|
+
textParams: startRequest.textParams,
|
|
89
|
+
stringMaxBytes: startRequest.stringMaxBytes,
|
|
90
|
+
frameMaxBytes: startRequest.frameMaxBytes,
|
|
91
|
+
handleDefaults: startRequest.handleDefaults,
|
|
92
|
+
// The strategy config rides the session (the broker is the session's
|
|
93
|
+
// committed fold); later ticks carry only their rows' broker feed.
|
|
94
|
+
strategy: startRequest.strategy,
|
|
95
|
+
});
|
|
96
|
+
// Replace-on-start: a remount/pan rebuild under the same key must not
|
|
97
|
+
// leak the superseded guest. The output of the failed create above
|
|
98
|
+
// never replaces an existing session (the throw skips this line).
|
|
99
|
+
const output = session.runRows(startRequest, 'live');
|
|
100
|
+
const current = liveEpochFor(startRequest.sessionKey);
|
|
101
|
+
const superseded = staleOnArrival ||
|
|
102
|
+
current.ends !== endsAtStart ||
|
|
103
|
+
(epoch !== undefined && (current.newest !== epoch || epoch <= current.endedThrough));
|
|
104
|
+
if (!superseded) {
|
|
105
|
+
liveSessions.set(startRequest.sessionKey, session);
|
|
106
|
+
if (epoch !== undefined)
|
|
107
|
+
liveSessionEpochs.set(startRequest.sessionKey, epoch);
|
|
108
|
+
else
|
|
109
|
+
liveSessionEpochs.delete(startRequest.sessionKey);
|
|
110
|
+
}
|
|
111
|
+
postOutput(startRequest.id, output);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
// The one kind left is 'live-rows'.
|
|
115
|
+
const rowsRequest = request;
|
|
116
|
+
{
|
|
117
|
+
const session = liveSessions.get(rowsRequest.sessionKey);
|
|
118
|
+
if (!session) {
|
|
119
|
+
const response = {
|
|
120
|
+
id: rowsRequest.id,
|
|
121
|
+
ok: false,
|
|
122
|
+
error: `WRUN live session '${rowsRequest.sessionKey}' is not open in this worker`,
|
|
123
|
+
sessionLost: true,
|
|
124
|
+
};
|
|
125
|
+
post(response);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
let output;
|
|
129
|
+
try {
|
|
130
|
+
output = session.runRows(rowsRequest, 'live');
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
// A trapped/failed tick leaves the guest's state unknowable (the trap
|
|
134
|
+
// may have landed mid-bar). Drop the session so the next tick reports
|
|
135
|
+
// sessionLost and the driver rebuilds from a full run. The ONE
|
|
136
|
+
// exception is the pre-evaluation ordering refusal: it fires before
|
|
137
|
+
// any guest call, the state is untouched, and the session survives
|
|
138
|
+
// (the caller just sent a stale/misordered block); it answers with
|
|
139
|
+
// the 'live-order' code so the host can reject with the typed error.
|
|
140
|
+
if (error instanceof WrunLiveOrderError) {
|
|
141
|
+
const response = {
|
|
142
|
+
id: rowsRequest.id,
|
|
143
|
+
ok: false,
|
|
144
|
+
error: error.message,
|
|
145
|
+
code: 'live-order',
|
|
146
|
+
};
|
|
147
|
+
post(response);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
liveSessions.delete(rowsRequest.sessionKey);
|
|
151
|
+
liveSessionEpochs.delete(rowsRequest.sessionKey);
|
|
152
|
+
throw error;
|
|
153
|
+
}
|
|
154
|
+
postOutput(rowsRequest.id, output);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
159
|
+
const response = { id: request.id, ok: false, error: message };
|
|
160
|
+
post(response);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
function postOutput(id, output) {
|
|
164
|
+
const { ready, outputs, strings, handles, strategy, frames, live, skipped, skippedCount } = output;
|
|
165
|
+
// The handle records are small plain objects (caps bound the set), so
|
|
166
|
+
// they ride structured clone beside the transferred row buffers; so does
|
|
167
|
+
// the strategy output (the engine's StrategyOutput: plain records and
|
|
168
|
+
// number arrays, bounded by the trade cap and the render result limit),
|
|
169
|
+
// the live block's accounting (a handful of numbers), and the run's
|
|
170
|
+
// skipped draw calls (at most 64 records and a count, exactly when a call
|
|
171
|
+
// was skipped: a clean run's answer keeps its shape).
|
|
172
|
+
const handlesField = handles !== undefined ? { handles } : {};
|
|
173
|
+
const framesField = frames !== undefined ? { frames } : {};
|
|
174
|
+
const liveField = live !== undefined ? { live } : {};
|
|
175
|
+
const strategyField = strategy !== undefined ? { strategy } : {};
|
|
176
|
+
const skipsField = skipped !== undefined ? { skipped, skippedCount: skippedCount ?? 0 } : {};
|
|
177
|
+
if (strings === undefined) {
|
|
178
|
+
const response = {
|
|
179
|
+
id,
|
|
180
|
+
ok: true,
|
|
181
|
+
ready,
|
|
182
|
+
outputs,
|
|
183
|
+
...handlesField,
|
|
184
|
+
...skipsField,
|
|
185
|
+
...strategyField,
|
|
186
|
+
...framesField,
|
|
187
|
+
...liveField,
|
|
188
|
+
};
|
|
189
|
+
post(response, { transfer: [ready.buffer, outputs.buffer] });
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
const response = {
|
|
193
|
+
id,
|
|
194
|
+
ok: true,
|
|
195
|
+
ready,
|
|
196
|
+
outputs,
|
|
197
|
+
stringLens: strings.lens,
|
|
198
|
+
stringOffsets: strings.offsets,
|
|
199
|
+
stringBytes: strings.bytes,
|
|
200
|
+
...handlesField,
|
|
201
|
+
...skipsField,
|
|
202
|
+
...strategyField,
|
|
203
|
+
...framesField,
|
|
204
|
+
...liveField,
|
|
205
|
+
};
|
|
206
|
+
post(response, {
|
|
207
|
+
transfer: [ready.buffer, outputs.buffer, strings.lens.buffer, strings.offsets.buffer, strings.bytes.buffer],
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
return handleRequest;
|
|
211
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orangecharts/wrun-chart-host",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "The wrun chart-host layer shared by the kiyotaka web app and the mobile app: the wrun result reader and painter model, cut from the web app (its reference implementation).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@orangecharts/indicator-kit": "0.
|
|
31
|
+
"@orangecharts/indicator-kit": "0.87.0",
|
|
32
32
|
"@orangecharts/orange-v2-pb-common": "12.69.0",
|
|
33
33
|
"dayjs": "1.11.23",
|
|
34
34
|
"lodash-es": "4.18.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@orangecharts/indicator-kit": "0.
|
|
37
|
+
"@orangecharts/indicator-kit": "0.87.0",
|
|
38
38
|
"@orangecharts/orange-v2-pb-common": "12.69.0",
|
|
39
39
|
"@types/lodash-es": "4.17.12",
|
|
40
40
|
"dayjs": "1.11.23",
|