@orangecharts/wrun-chart-host 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -6
- package/dist/constants/exchange-names.leaf.d.ts +8 -0
- package/dist/constants/exchange-names.leaf.js +101 -0
- package/dist/constants/kscript-data-interval-restrictions.constants.d.ts +15 -0
- package/dist/constants/kscript-data-interval-restrictions.constants.js +40 -0
- package/dist/constants/opra-compliance.constants.d.ts +19 -0
- package/dist/constants/opra-compliance.constants.js +19 -0
- package/dist/constants/replay-ladder.leaf.d.ts +30 -0
- package/dist/constants/replay-ladder.leaf.js +99 -0
- package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +133 -0
- package/dist/constants/scriptEditor/builtin-script-snippets.js +451 -0
- package/dist/constants/scriptEditor/cme-official-scripts.constants.d.ts +168 -0
- package/dist/constants/scriptEditor/cme-official-scripts.constants.js +398 -0
- package/dist/constants/scriptEditor/converted-script-id.leaf.d.ts +8 -0
- package/dist/constants/scriptEditor/converted-script-id.leaf.js +10 -0
- package/dist/constants/scriptEditor/execution.constants.d.ts +4 -0
- package/dist/constants/scriptEditor/execution.constants.js +14 -0
- package/dist/constants/wrun-prefix-safe.constants.d.ts +23 -0
- package/dist/constants/wrun-prefix-safe.constants.js +26 -0
- package/dist/host-env.d.ts +321 -24
- package/dist/host-env.js +15 -0
- package/dist/host-ports.types.d.ts +857 -35
- package/dist/index.d.ts +149 -2
- package/dist/index.js +149 -2
- package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +31 -0
- package/dist/instances/script-engine-worker-ohlcv-transfer.js +164 -0
- package/dist/interfaces/market-event.interface.d.ts +231 -0
- package/dist/interfaces/market-event.interface.js +15 -0
- package/dist/interfaces/opra-realtime.interface.d.ts +70 -134
- package/dist/interfaces/opra-realtime.interface.js +34 -59
- package/dist/interfaces/replay.interface.d.ts +285 -0
- package/dist/interfaces/replay.interface.js +1 -0
- package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +1 -0
- package/dist/kscript-data/controls/live-ohlcv-merge.util.js +93 -0
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +5 -1
- package/dist/kscript-data/controls/live-trades-merge.util.js +2 -2
- package/dist/market-data/billing.interface.d.ts +219 -0
- package/dist/market-data/billing.interface.js +58 -0
- package/dist/market-data/venue-governed.util.d.ts +2 -0
- package/dist/market-data/venue-governed.util.js +10 -0
- package/dist/market-data/venue.d.ts +122 -0
- package/dist/market-data/venue.js +1 -0
- package/dist/market-data/venues/index.d.ts +97 -0
- package/dist/market-data/venues/index.js +33 -0
- package/dist/market-data/venues/opra.contract.copy.json +35 -0
- package/dist/market-data/venues/opra.d.ts +70 -0
- package/dist/market-data/venues/opra.js +74 -0
- package/dist/replay/replayIndicatorRows.d.ts +31 -0
- package/dist/replay/replayIndicatorRows.js +117 -0
- package/dist/replay/replayLadder.d.ts +85 -0
- package/dist/replay/replayLadder.js +388 -0
- package/dist/utility/auth/server-clock.util.d.ts +81 -0
- package/dist/utility/auth/server-clock.util.js +238 -0
- package/dist/utility/chart/builtin-identity.util.d.ts +18 -0
- package/dist/utility/chart/builtin-identity.util.js +51 -0
- package/dist/utility/chart/cache-alignment.util.d.ts +454 -0
- package/dist/utility/chart/cache-alignment.util.js +926 -0
- package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +15 -0
- package/dist/utility/chart/chart-data-fetch-generation.util.js +22 -0
- package/dist/utility/chart/chart-mount-epoch.util.d.ts +5 -0
- package/dist/utility/chart/chart-mount-epoch.util.js +29 -0
- package/dist/utility/chart/chart-time-domain.util.d.ts +12 -0
- package/dist/utility/chart/chart-time-domain.util.js +23 -0
- package/dist/utility/chart/color-customization.leaf.d.ts +10 -0
- package/dist/utility/chart/color-customization.leaf.js +16 -0
- package/dist/utility/chart/date-labelled-interval.leaf.d.ts +15 -0
- package/dist/utility/chart/date-labelled-interval.leaf.js +19 -0
- package/dist/utility/chart/footprint-tick-grid.util.d.ts +106 -0
- package/dist/utility/chart/footprint-tick-grid.util.js +167 -0
- package/dist/utility/chart/gesture-timing.leaf.d.ts +29 -0
- package/dist/utility/chart/gesture-timing.leaf.js +29 -0
- package/dist/utility/chart/governed-contract-coin.util.d.ts +22 -0
- package/dist/utility/chart/governed-contract-coin.util.js +39 -0
- package/dist/utility/chart/host-bar-placement.util.d.ts +107 -0
- package/dist/utility/chart/host-bar-placement.util.js +447 -0
- package/dist/utility/chart/index-host-tier.util.d.ts +31 -0
- package/dist/utility/chart/index-host-tier.util.js +118 -0
- package/dist/utility/chart/index-mode-admission.util.d.ts +34 -0
- package/dist/utility/chart/index-mode-admission.util.js +67 -0
- package/dist/utility/chart/indicator-error-message.util.d.ts +35 -0
- package/dist/utility/chart/indicator-error-message.util.js +44 -0
- package/dist/utility/chart/indicator-run-interval.util.d.ts +130 -0
- package/dist/utility/chart/indicator-run-interval.util.js +268 -0
- package/dist/utility/chart/kscript-apply-fingerprint.util.d.ts +65 -0
- package/dist/utility/chart/kscript-apply-fingerprint.util.js +357 -0
- package/dist/utility/chart/kscript-chart-flush.leaf.d.ts +22 -0
- package/dist/utility/chart/kscript-chart-flush.leaf.js +13 -0
- package/dist/utility/chart/kscript-data-interval-restriction.leaf.d.ts +6 -0
- package/dist/utility/chart/kscript-data-interval-restriction.leaf.js +27 -0
- package/dist/utility/chart/kscript-integration-decision.leaf.d.ts +89 -0
- package/dist/utility/chart/kscript-integration-decision.leaf.js +80 -0
- package/dist/utility/chart/kscript-live-coalesce.util.d.ts +76 -0
- package/dist/utility/chart/kscript-live-coalesce.util.js +156 -0
- package/dist/utility/chart/kscript-live-rest-pace.util.d.ts +34 -0
- package/dist/utility/chart/kscript-live-rest-pace.util.js +134 -0
- package/dist/utility/chart/kscript-live-source-identity.util.d.ts +98 -0
- package/dist/utility/chart/kscript-live-source-identity.util.js +121 -0
- package/dist/utility/chart/kscript-mounted-plot-set.leaf.d.ts +48 -0
- package/dist/utility/chart/kscript-mounted-plot-set.leaf.js +145 -0
- package/dist/utility/chart/kscript-perf-tracker.util.d.ts +243 -0
- package/dist/utility/chart/kscript-perf-tracker.util.js +522 -0
- package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +43 -0
- package/dist/utility/chart/kscript-run-interval-projection.util.js +471 -0
- package/dist/utility/chart/kscript-run-result-equality.util.d.ts +38 -0
- package/dist/utility/chart/kscript-run-result-equality.util.js +89 -0
- package/dist/utility/chart/kscript-settings-revision.leaf.d.ts +2 -0
- package/dist/utility/chart/kscript-settings-revision.leaf.js +12 -0
- package/dist/utility/chart/kscript-source-degrade.leaf.d.ts +63 -0
- package/dist/utility/chart/kscript-source-degrade.leaf.js +68 -0
- package/dist/utility/chart/kscript-source-retention.util.d.ts +134 -0
- package/dist/utility/chart/kscript-source-retention.util.js +218 -0
- package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +57 -0
- package/dist/utility/chart/kscript-standin-identity.leaf.js +61 -0
- package/dist/utility/chart/kscript-titancharts-preparation.util.d.ts +15 -0
- package/dist/utility/chart/kscript-titancharts-preparation.util.js +376 -0
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +9 -0
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +130 -0
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +217 -0
- package/dist/utility/chart/kscript-venue-policy.util.js +324 -0
- package/dist/utility/chart/live-cadence.util.d.ts +38 -0
- package/dist/utility/chart/live-cadence.util.js +37 -0
- package/dist/utility/chart/live-feed-series-match.leaf.d.ts +13 -0
- package/dist/utility/chart/live-feed-series-match.leaf.js +21 -0
- package/dist/utility/chart/local-engine-self-heal-backoff.util.d.ts +46 -0
- package/dist/utility/chart/local-engine-self-heal-backoff.util.js +46 -0
- package/dist/utility/chart/local-engine-uninit.leaf.d.ts +21 -0
- package/dist/utility/chart/local-engine-uninit.leaf.js +22 -0
- package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +62 -0
- package/dist/utility/chart/local-kscript-source-revalidation.util.js +123 -0
- package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +214 -0
- package/dist/utility/chart/local-kscript-warmup-depth.util.js +376 -0
- package/dist/utility/chart/local-technical-script-live-apply-coalescer.util.d.ts +85 -0
- package/dist/utility/chart/local-technical-script-live-apply-coalescer.util.js +197 -0
- package/dist/utility/chart/local-technical-script-range.leaf.d.ts +72 -0
- package/dist/utility/chart/local-technical-script-range.leaf.js +126 -0
- package/dist/utility/chart/mixed-mode.util.d.ts +167 -0
- package/dist/utility/chart/mixed-mode.util.js +139 -0
- package/dist/utility/chart/ohlcv-row-readiness.util.d.ts +36 -0
- package/dist/utility/chart/ohlcv-row-readiness.util.js +90 -0
- package/dist/utility/chart/opra-user-scripts-gate.util.d.ts +19 -0
- package/dist/utility/chart/opra-user-scripts-gate.util.js +32 -0
- package/dist/utility/chart/overlay-execution-guard-key.leaf.d.ts +8 -0
- package/dist/utility/chart/overlay-execution-guard-key.leaf.js +10 -0
- package/dist/utility/chart/price-precision.util.d.ts +40 -0
- package/dist/utility/chart/price-precision.util.js +70 -0
- package/dist/utility/chart/profile-block-size.util.d.ts +64 -0
- package/dist/utility/chart/profile-block-size.util.js +141 -0
- package/dist/utility/chart/protected-kscript-degenerate-rows.leaf.d.ts +11 -0
- package/dist/utility/chart/protected-kscript-degenerate-rows.leaf.js +29 -0
- package/dist/utility/chart/protected-kscript-empty-output.util.d.ts +28 -0
- package/dist/utility/chart/protected-kscript-empty-output.util.js +84 -0
- package/dist/utility/chart/run-interval-unservable.leaf.d.ts +9 -0
- package/dist/utility/chart/run-interval-unservable.leaf.js +20 -0
- package/dist/utility/chart/run-interval-warmup.leaf.d.ts +19 -0
- package/dist/utility/chart/run-interval-warmup.leaf.js +35 -0
- package/dist/utility/chart/titan-constants.pin.d.ts +9 -5
- package/dist/utility/chart/titan-constants.pin.js +18 -5
- package/dist/utility/chart/warmup-backfill-retry.leaf.d.ts +9 -0
- package/dist/utility/chart/warmup-backfill-retry.leaf.js +9 -0
- package/dist/utility/chart/window-geometry.leaf.d.ts +119 -0
- package/dist/utility/chart/window-geometry.leaf.js +391 -0
- package/dist/utility/chart/window-owner.leaf.d.ts +19 -0
- package/dist/utility/chart/window-owner.leaf.js +24 -0
- package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +11 -2
- package/dist/utility/chart/wrun-bar-session-facts.util.js +10 -3
- package/dist/utility/chart/wrun-run-result.util.d.ts +5 -1
- package/dist/utility/chart/wrun-run-result.util.js +20 -14
- package/dist/utility/common/data-processing.util.d.ts +138 -0
- package/dist/utility/common/data-processing.util.js +346 -0
- package/dist/utility/common/visible-timeout.util.d.ts +13 -4
- package/dist/utility/common/visible-timeout.util.js +23 -8
- package/dist/utility/exchange-format.leaf.d.ts +1 -0
- package/dist/utility/exchange-format.leaf.js +47 -0
- package/dist/utility/html-escape.leaf.d.ts +11 -0
- package/dist/utility/html-escape.leaf.js +20 -0
- package/dist/utility/market-events/earnings-scope.util.d.ts +60 -0
- package/dist/utility/market-events/earnings-scope.util.js +92 -0
- package/dist/utility/market-events/market-events.util.d.ts +147 -0
- package/dist/utility/market-events/market-events.util.js +392 -0
- package/dist/utility/market-events/zoned-clock.util.d.ts +1 -0
- package/dist/utility/market-events/zoned-clock.util.js +11 -0
- package/dist/utility/options/option-venue-disclosure.util.d.ts +43 -0
- package/dist/utility/options/option-venue-disclosure.util.js +56 -0
- package/dist/utility/scriptEditor/package-semver.util.d.ts +51 -0
- package/dist/utility/scriptEditor/package-semver.util.js +120 -0
- package/dist/utility/scriptEditor/temp-script-id.util.d.ts +18 -0
- package/dist/utility/scriptEditor/temp-script-id.util.js +25 -0
- package/dist/utility/symbol-selection/markets-request-from-symbols.leaf.d.ts +20 -0
- package/dist/utility/symbol-selection/markets-request-from-symbols.leaf.js +81 -0
- package/dist/utility/v2/governed-tier.leaf.d.ts +103 -0
- package/dist/utility/v2/governed-tier.leaf.js +113 -0
- package/dist/utility/watchlist/import/import-request.leaf.d.ts +10 -0
- package/dist/utility/watchlist/import/import-request.leaf.js +10 -0
- package/dist/utility/wrun/sources/lanes/option_daily.d.ts +43 -15
- package/dist/utility/wrun/sources/lanes/option_daily.js +78 -20
- package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +14 -10
- package/dist/utility/wrun/sources/lanes/option_stats_10m.js +5 -4
- package/dist/utility/wrun/sources/lanes/series.js +2 -2
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +22 -3
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +38 -7
- package/dist/utility/wrun/sources/registry.js +31 -1
- package/dist/utility/wrun/sources/row-lane-registry.js +5 -5
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +49 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +75 -20
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +49 -0
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +57 -47
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +36 -4
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +6 -12
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +37 -3
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +128 -2
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +233 -51
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +0 -8
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +26 -24
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +85 -104
- package/dist/utility/wrun/wrun-alert-outputs.registry.d.ts +166 -0
- package/dist/utility/wrun/wrun-alert-outputs.registry.js +219 -0
- package/dist/utility/wrun/wrun-bar-count.util.d.ts +83 -0
- package/dist/utility/wrun/wrun-bar-count.util.js +259 -0
- package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +84 -0
- package/dist/utility/wrun/wrun-chart-context-names.util.js +186 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +253 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +731 -0
- package/dist/utility/wrun/wrun-cloud-opra-stamp.util.d.ts +28 -0
- package/dist/utility/wrun/wrun-cloud-opra-stamp.util.js +45 -0
- package/dist/utility/wrun/wrun-coin-lane-live.util.d.ts +18 -0
- package/dist/utility/wrun/wrun-coin-lane-live.util.js +47 -0
- package/dist/utility/wrun/wrun-deadline.util.js +2 -1
- package/dist/utility/wrun/wrun-debug-output.util.d.ts +39 -0
- package/dist/utility/wrun/wrun-debug-output.util.js +63 -0
- package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +113 -0
- package/dist/utility/wrun/wrun-declared-warmup.util.js +181 -0
- package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +43 -0
- package/dist/utility/wrun/wrun-draft-legend-note.util.js +158 -0
- package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +181 -0
- package/dist/utility/wrun/wrun-draft-overlay.util.js +357 -0
- package/dist/utility/wrun/wrun-draw-skipped.leaf.d.ts +16 -0
- package/dist/utility/wrun/wrun-draw-skipped.leaf.js +16 -0
- package/dist/utility/wrun/wrun-earnings-facts.util.d.ts +42 -0
- package/dist/utility/wrun/wrun-earnings-facts.util.js +131 -0
- package/dist/utility/wrun/wrun-first-run-depth.util.d.ts +32 -0
- package/dist/utility/wrun/wrun-first-run-depth.util.js +118 -0
- package/dist/utility/wrun/wrun-gate-plane-readers.util.d.ts +24 -0
- package/dist/utility/wrun/wrun-gate-plane-readers.util.js +31 -0
- package/dist/utility/wrun/wrun-held-lanes.util.d.ts +32 -0
- package/dist/utility/wrun/wrun-held-lanes.util.js +94 -0
- package/dist/utility/wrun/wrun-host-visible-clock.util.d.ts +2 -0
- package/dist/utility/wrun/wrun-host-visible-clock.util.js +17 -0
- package/dist/utility/wrun/wrun-host.service.d.ts +266 -0
- package/dist/utility/wrun/wrun-host.service.js +655 -0
- package/dist/utility/wrun/wrun-inert-legend.util.d.ts +33 -0
- package/dist/utility/wrun/wrun-inert-legend.util.js +125 -0
- package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +155 -0
- package/dist/utility/wrun/wrun-input-requirements.leaf.js +450 -0
- package/dist/utility/wrun/wrun-integration-route.util.d.ts +51 -0
- package/dist/utility/wrun/wrun-integration-route.util.js +59 -0
- package/dist/utility/wrun/wrun-latest-history.leaf.d.ts +8 -0
- package/dist/utility/wrun/wrun-latest-history.leaf.js +8 -0
- package/dist/utility/wrun/wrun-legend-hover.lazy.d.ts +12 -0
- package/dist/utility/wrun/wrun-legend-hover.lazy.js +96 -0
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.d.ts +21 -0
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.js +21 -0
- package/dist/utility/wrun/wrun-live-hidden-hold.util.d.ts +23 -0
- package/dist/utility/wrun/wrun-live-hidden-hold.util.js +13 -0
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +374 -0
- package/dist/utility/wrun/wrun-live-intake.util.js +2027 -0
- package/dist/utility/wrun/wrun-live-patch.util.d.ts +116 -0
- package/dist/utility/wrun/wrun-live-patch.util.js +523 -0
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +619 -0
- package/dist/utility/wrun/wrun-live-tick.util.js +4974 -0
- package/dist/utility/wrun/wrun-loading-owner.util.d.ts +58 -0
- package/dist/utility/wrun/wrun-loading-owner.util.js +89 -0
- package/dist/utility/wrun/wrun-official-scope.leaf.d.ts +29 -0
- package/dist/utility/wrun/wrun-official-scope.leaf.js +36 -0
- package/dist/utility/wrun/wrun-oi-lane.util.d.ts +27 -0
- package/dist/utility/wrun/wrun-oi-lane.util.js +42 -0
- package/dist/utility/wrun/wrun-opra-stats.leaf.d.ts +29 -10
- package/dist/utility/wrun/wrun-opra-stats.leaf.js +29 -10
- package/dist/utility/wrun/wrun-options-stop.util.d.ts +52 -0
- package/dist/utility/wrun/wrun-options-stop.util.js +123 -0
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +719 -0
- package/dist/utility/wrun/wrun-overlay-drivers.util.js +1180 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.d.ts +50 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.js +131 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +118 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +466 -0
- package/dist/utility/wrun/wrun-overlay-metadata.util.d.ts +45 -0
- package/dist/utility/wrun/wrun-overlay-metadata.util.js +112 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +114 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +971 -0
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +858 -0
- package/dist/utility/wrun/wrun-overlay-run.util.js +11013 -0
- package/dist/utility/wrun/wrun-panel-mount.lazy.d.ts +10 -0
- package/dist/utility/wrun/wrun-panel-mount.lazy.js +68 -0
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +392 -0
- package/dist/utility/wrun/wrun-panel-mount.util.js +2346 -0
- package/dist/utility/wrun/wrun-param-map.util.d.ts +19 -4
- package/dist/utility/wrun/wrun-param-map.util.js +40 -47
- package/dist/utility/wrun/wrun-param-values.util.d.ts +9 -3
- package/dist/utility/wrun/wrun-param-values.util.js +5 -5
- package/dist/utility/wrun/wrun-pause-dim.util.d.ts +52 -0
- package/dist/utility/wrun/wrun-pause-dim.util.js +153 -0
- package/dist/utility/wrun/wrun-plot-gate.types.d.ts +23 -0
- package/dist/utility/wrun/wrun-plot-gate.types.js +7 -0
- package/dist/utility/wrun/wrun-prefix-cohort.util.d.ts +93 -0
- package/dist/utility/wrun/wrun-prefix-cohort.util.js +484 -0
- package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +114 -0
- package/dist/utility/wrun/wrun-prefix-lanes.util.js +486 -0
- package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +317 -0
- package/dist/utility/wrun/wrun-prefix-proof.util.js +630 -0
- package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +73 -0
- package/dist/utility/wrun/wrun-refusal-surface.util.js +380 -0
- package/dist/utility/wrun/wrun-refusal-text.util.d.ts +15 -0
- package/dist/utility/wrun/wrun-refusal-text.util.js +40 -0
- package/dist/utility/wrun/wrun-replay-lane.util.d.ts +139 -0
- package/dist/utility/wrun/wrun-replay-lane.util.js +520 -0
- package/dist/utility/wrun/wrun-replay-rows.util.d.ts +21 -0
- package/dist/utility/wrun/wrun-replay-rows.util.js +172 -0
- package/dist/utility/wrun/wrun-row-source-factory.d.ts +53 -0
- package/dist/utility/wrun/wrun-row-source-factory.js +435 -0
- package/dist/utility/wrun/wrun-run-cells.util.d.ts +36 -0
- package/dist/utility/wrun/wrun-run-cells.util.js +46 -0
- package/dist/utility/wrun/wrun-run-interval-projection.types.d.ts +14 -0
- package/dist/utility/wrun/wrun-run-interval-projection.types.js +1 -0
- package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +133 -0
- package/dist/utility/wrun/wrun-run-interval-session.util.js +121 -0
- package/dist/utility/wrun/wrun-run-interval.util.d.ts +98 -0
- package/dist/utility/wrun/wrun-run-interval.util.js +207 -0
- package/dist/utility/wrun/wrun-run-retained.util.d.ts +122 -0
- package/dist/utility/wrun/wrun-run-retained.util.js +255 -0
- package/dist/utility/wrun/wrun-sandbox-row-source.d.ts +184 -0
- package/dist/utility/wrun/wrun-sandbox-row-source.js +444 -0
- package/dist/utility/wrun/wrun-script-inputs.util.js +4 -4
- package/dist/utility/wrun/wrun-series-stream.util.d.ts +86 -0
- package/dist/utility/wrun/wrun-series-stream.util.js +537 -0
- package/dist/utility/wrun/wrun-sheet-remembered.util.d.ts +21 -0
- package/dist/utility/wrun/wrun-sheet-remembered.util.js +36 -0
- package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.d.ts +7 -0
- package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.js +12 -0
- package/dist/utility/wrun/wrun-socket-row-source.js +4 -2
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +175 -3
- package/dist/utility/wrun/wrun-source-rows.util.js +294 -8
- package/dist/utility/wrun/wrun-stats-strip.util.d.ts +46 -0
- package/dist/utility/wrun/wrun-stats-strip.util.js +87 -0
- package/dist/utility/wrun/wrun-table-chrome.util.d.ts +163 -0
- package/dist/utility/wrun/wrun-table-chrome.util.js +557 -0
- package/dist/utility/wrun/wrun-text-params.util.d.ts +11 -6
- package/dist/utility/wrun/wrun-text-params.util.js +19 -30
- package/dist/utility/wrun/wrun-transient-rerun.util.d.ts +64 -0
- package/dist/utility/wrun/wrun-transient-rerun.util.js +317 -0
- package/dist/utility/wrun/wrun-twin-lookback.util.d.ts +10 -0
- package/dist/utility/wrun/wrun-twin-lookback.util.js +43 -0
- package/dist/utility/wrun/wrun-warmup-head-store.util.d.ts +41 -0
- package/dist/utility/wrun/wrun-warmup-head-store.util.js +120 -0
- package/dist/utility/wrun-alert-params.leaf.d.ts +24 -0
- package/dist/utility/wrun-alert-params.leaf.js +24 -0
- package/dist/utils/replay/replay-buffer-math.d.ts +148 -0
- package/dist/utils/replay/replay-buffer-math.js +684 -0
- package/dist/workers/wrun/wrun-abi-host.d.ts +190 -0
- package/dist/workers/wrun/wrun-abi-host.js +1201 -0
- package/dist/workers/wrun/wrun-engine-handler.d.ts +37 -0
- package/dist/workers/wrun/wrun-engine-handler.js +211 -0
- package/package.json +3 -3
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { wrunRowLaneByKey, wrunRowLaneOfClass, wrunRowLanes } from './row-lane-registry.js';
|
|
2
|
-
import { stableJson, wrunOpraPlaneStopDetail } from './wrun-poll-lanes.util.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { assertWrunOpraLaneReadable, wrunOpraLanePayloadFields } from '../wrun-opra-lane.util.js';
|
|
6
|
-
import { wrunOptionsStopSeed } from '../wrun-refusal.util.js';
|
|
2
|
+
import { assertWrunLaneChainPlaneReadable, stableJson, wrunChainLaneStop, wrunChartOpraPlane, wrunLaneNoChainRefusal, wrunOpraPlaneStopDetail, wrunPollLaneChainAsk, wrunPollLaneChainExchange, wrunPollLaneChainGovernedExchange, wrunPollLaneChainPlane, wrunUnservedLaneInput, } from './wrun-poll-lanes.util.js';
|
|
3
|
+
import { WRUN_ROW_LANE_ID_PREFIX, } from './wrun-row-lane.types.js';
|
|
4
|
+
import { assertWrunOpraLaneReadable } from '../wrun-opra-lane.util.js';
|
|
7
5
|
import { wrunPartialMarkerTuple, wrunPresentIsPartial, wrunTuplesMarkedPartial } from '../wrun-present-bits.util.js';
|
|
8
6
|
import { wrunCellRowsWithPartialBars, wrunHostGridAsks, wrunHostGridFallbackAsks, wrunHostGridFetchTo, wrunLandCellRowsOnHostBars, } from '../wrun-tier-grid.util.js';
|
|
9
7
|
/**
|
|
@@ -40,34 +38,54 @@ export function wrunRowLaneInstanceKey(laneKey, extras) {
|
|
|
40
38
|
const named = Object.keys(extras).some((key) => extras[key] !== undefined);
|
|
41
39
|
return `${WRUN_ROW_LANE_ID_PREFIX}${laneKey}${named ? stableJson(extras) : ''}`;
|
|
42
40
|
}
|
|
41
|
+
/** The fill a celled input reads on every bar of a feed the chart does not serve (`missing: "empty"`). */
|
|
42
|
+
const WRUN_ROW_LANE_UNSERVED_FILLS = Object.freeze(['empty']);
|
|
43
43
|
/** Why a row lane is not served on a chart, as its refusal says it. */
|
|
44
44
|
function wrunRowLaneUnadmittedReason(lane) {
|
|
45
45
|
return lane.governed === 'opra'
|
|
46
46
|
? "is not served on this chart: it reads US options data, which a US stock or ETF chart (its underlying's options) and an OPRA option contract chart serve"
|
|
47
47
|
: "is not served on this chart: it reads the chart's own market, and a stock, forex, commodity or DEX chart serves candles and time";
|
|
48
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Why a row lane that is no chain lane is not served on the chart, or undefined: a governed OPRA lane (after the OPRA
|
|
51
|
+
* wall, on any chart) off the plane (the stop's words when a known stop keeps the chart's options off it), any other
|
|
52
|
+
* lane on an index-mode chart.
|
|
53
|
+
*/
|
|
54
|
+
function wrunRowLaneUnserved(lane, plane, indexMode, run, ctx) {
|
|
55
|
+
if (lane.governed === 'opra') {
|
|
56
|
+
assertWrunOpraLaneReadable(run, ctx);
|
|
57
|
+
if (plane.onPlane)
|
|
58
|
+
return undefined;
|
|
59
|
+
return plane.stop !== undefined
|
|
60
|
+
? { words: wrunOpraPlaneStopDetail(plane.stop), stop: plane.stop }
|
|
61
|
+
: { words: wrunRowLaneUnadmittedReason(lane) };
|
|
62
|
+
}
|
|
63
|
+
return indexMode ? { words: wrunRowLaneUnadmittedReason(lane) } : undefined;
|
|
64
|
+
}
|
|
49
65
|
/**
|
|
50
66
|
* The run's plan against the chart, before any fetch, every input of a row-lane class in declaration order (the
|
|
51
67
|
* first refusal by name wins):
|
|
52
68
|
* 0. an input the market leaves undemanded (its `needed_by` leaves the market out, wrunSheetWithLaneDemand) is planned
|
|
53
69
|
* nowhere: no wall, no admission, no acquisition, no note; the row builder reads its empty block on every bar;
|
|
54
70
|
* 1. the OPRA wall: an input of a `governed: 'opra'` lane is refused for a run that may not read OPRA
|
|
55
|
-
* (`opra-official-only:<class>`, `mayReadOpra` over `run`; absent reads closed)
|
|
71
|
+
* (`opra-official-only:<class>`, `mayReadOpra` over `run`; absent reads closed), and so is an input of a chain lane
|
|
72
|
+
* on a chart whose options list on OPRA (riding the plane or stopped off it), before its chain is resolved;
|
|
56
73
|
* 2. the admission: a governed OPRA lane is served where the chart's options ride the OPRA plane
|
|
57
|
-
* (`isOpraPlaneExchange`) and nowhere else; a chain lane on every chart
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* the
|
|
63
|
-
*
|
|
64
|
-
* acquisition rule judged as anywhere, and then no instance (every input reads its empty block);
|
|
74
|
+
* (`isOpraPlaneExchange`) and nowhere else; a chain lane on every chart no known stop keeps its options off the
|
|
75
|
+
* plane on (`wrunChainLaneStop`, the chain poll lanes' one rule: no chain is resolved past the stop); any other lane
|
|
76
|
+
* wherever the chart is not index-mode. An input the chart does not serve meets the one rule both planners keep
|
|
77
|
+
* (wrun-poll-lanes.util `wrunUnservedLaneInput`): declaring `missing: "empty"` it is dropped (its blocks read EMPTY,
|
|
78
|
+
* a note names the feed), any other refuses by name, seeded feed-missing (paused); a lane off the plane for a known
|
|
79
|
+
* reason (`opraPlaneStop`: the `opra` flag dark, an index chart) says that reason instead (`options-stopped`, the
|
|
80
|
+
* note and the refusal alike);
|
|
65
81
|
* 3. the lane's identity, once per lane (the first admitted input's context names a refusal), then the input's
|
|
66
82
|
* facets (awaited, in declaration order); the instance is the identity and the facets together. A lane with
|
|
67
|
-
* `acquisitions: 'one'` refuses a second input whose acquisition differs (one fetch, one live fold per package).
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
83
|
+
* `acquisitions: 'one'` refuses a second input whose acquisition differs (one fetch, one live fold per package). A
|
|
84
|
+
* chart with no option chain (an identity or facets refusal seeded `no-options` / `chain`, `wrunLaneNoChainRefusal`:
|
|
85
|
+
* a LINK perp, a forex pair) does not serve the feed either: the same one rule, its note naming the feed with the
|
|
86
|
+
* chain decision's words, its refusal the decision's own. A chain lane's instance then meets its own plane's wall
|
|
87
|
+
* (`assertWrunLaneChainPlaneReadable`, the one rule a chain poll lane meets too): OPRA's, or the CME display wall
|
|
88
|
+
* (OpenMarket's own packages only); a plain chain (a crypto venue) none.
|
|
71
89
|
*/
|
|
72
90
|
export async function planWrunRowLanes(metadata, chart, run) {
|
|
73
91
|
const instances = new Map();
|
|
@@ -76,9 +94,8 @@ export async function planWrunRowLanes(metadata, chart, run) {
|
|
|
76
94
|
const firstOf = new Map();
|
|
77
95
|
const indexMode = chart.isIndexModeExchange?.(chart.exchange) === true;
|
|
78
96
|
const cryptoVenue = chart.isCryptoVenueExchange?.(chart.exchange);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const opraStop = opraPlane ? undefined : chart.opraPlaneStop?.(chart.exchange);
|
|
97
|
+
// The chart's OPRA plane facts, read once, as the poll lanes' planner reads them (`wrunChartOpraPlane`).
|
|
98
|
+
const plane = wrunChartOpraPlane(chart.exchange, chart);
|
|
82
99
|
for (const planned of planWrunRowLaneInputs(metadata)) {
|
|
83
100
|
if (planned.source.undemanded === true)
|
|
84
101
|
continue;
|
|
@@ -96,55 +113,42 @@ export async function planWrunRowLanes(metadata, chart, run) {
|
|
|
96
113
|
official: run?.official === true,
|
|
97
114
|
opraUserScripts: run?.opraUserScripts === true,
|
|
98
115
|
};
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
...(stop !== undefined ? { stop } : {}),
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
entry.inputNames.push(planned.inputName);
|
|
126
|
-
entry.details = `${entry.details}\n${details}`;
|
|
127
|
-
}
|
|
128
|
-
continue;
|
|
116
|
+
const unserved = {
|
|
117
|
+
inputName: planned.inputName,
|
|
118
|
+
sourceClass: lane.sourceClass,
|
|
119
|
+
feed: lane.laneKey,
|
|
120
|
+
missing: planned.source.missing,
|
|
121
|
+
};
|
|
122
|
+
// A chain lane meets the OPRA wall where the chart's options list on OPRA, and stops before its chain is resolved
|
|
123
|
+
// where a known stop keeps them off the plane (`wrunChainLaneStop`, the chain poll lanes' one rule). Any other lane
|
|
124
|
+
// is admitted by its plane or the chart's mode.
|
|
125
|
+
const why = lane.chain !== undefined
|
|
126
|
+
? wrunChainLaneStop(plane, run, ctx)
|
|
127
|
+
: wrunRowLaneUnserved(lane, plane, indexMode, run, ctx);
|
|
128
|
+
if (why !== undefined) {
|
|
129
|
+
wrunUnservedLaneInput(missing, unserved, WRUN_ROW_LANE_UNSERVED_FILLS, why, cryptoVenue);
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
let extras;
|
|
133
|
+
try {
|
|
134
|
+
let identity = identities.get(lane.laneKey);
|
|
135
|
+
if (identity === undefined) {
|
|
136
|
+
identity = definedFields(await lane.identity?.(ctx));
|
|
137
|
+
identities.set(lane.laneKey, identity);
|
|
129
138
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
139
|
+
extras = { ...identity, ...definedFields(await lane.facets?.(planned.source, ctx)) };
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
// A chart with no option chain does not serve the feed (`wrunLaneNoChainRefusal`): the same one rule.
|
|
143
|
+
if (!wrunLaneNoChainRefusal(error))
|
|
144
|
+
throw error;
|
|
145
|
+
wrunUnservedLaneInput(missing, unserved, WRUN_ROW_LANE_UNSERVED_FILLS, { noChain: error }, cryptoVenue);
|
|
146
|
+
continue;
|
|
138
147
|
}
|
|
139
|
-
|
|
140
|
-
if (
|
|
141
|
-
|
|
142
|
-
identities.set(lane.laneKey, identity);
|
|
148
|
+
// A chain instance meets its own plane's wall, by the exchange its chain lists on (the poll lanes' one rule).
|
|
149
|
+
if (lane.chain !== undefined) {
|
|
150
|
+
assertWrunLaneChainPlaneReadable(wrunRowLaneChainPlane(lane, extras), wrunRowLaneChainExchange(lane, extras), run, ctx);
|
|
143
151
|
}
|
|
144
|
-
const extras = { ...identity, ...definedFields(await lane.facets?.(planned.source, ctx)) };
|
|
145
|
-
// A chain instance meets its own plane's wall, by the exchange its chain lists on.
|
|
146
|
-
if (chainLane)
|
|
147
|
-
assertWrunRowChainPlaneReadable(lane, extras, run, ctx);
|
|
148
152
|
const key = wrunRowLaneInstanceKey(lane.laneKey, extras);
|
|
149
153
|
const first = firstOf.get(lane.laneKey);
|
|
150
154
|
if (lane.acquisitions === 'one' && first !== undefined && first.key !== key) {
|
|
@@ -153,9 +157,6 @@ export async function planWrunRowLanes(metadata, chart, run) {
|
|
|
153
157
|
}
|
|
154
158
|
if (first === undefined)
|
|
155
159
|
firstOf.set(lane.laneKey, { key, inputName: planned.inputName });
|
|
156
|
-
// Off its plane such a lane plans no instance: the row builder reads the input's empty block on every bar.
|
|
157
|
-
if (emptyOffPlane)
|
|
158
|
-
continue;
|
|
159
160
|
let instance = instances.get(key);
|
|
160
161
|
if (instance === undefined) {
|
|
161
162
|
instance = { key, sourceClass: lane.sourceClass, laneKey: lane.laneKey, extras, inputIndexes: [] };
|
|
@@ -172,30 +173,15 @@ function definedFields(fields) {
|
|
|
172
173
|
out[key] = value;
|
|
173
174
|
return out;
|
|
174
175
|
}
|
|
175
|
-
/** The record seed of the CME display wall on a chain lane's CME instance (the display wall's own record). */
|
|
176
|
-
const WRUN_CME_WALL_SEED = Object.freeze({ cls: 'cme-wall' });
|
|
177
|
-
/** A chain instance against its own plane's wall (`planWrunRowLanes` step 3): an OPRA chain the OPRA wall
|
|
178
|
-
* (`mayReadOpra`), a CME chain the CME display wall (OpenMarket's own packages only, the run door's rule on a CME
|
|
179
|
-
* chart, kscript-venue-policy.util; the `opra-user-scripts` flag never opens it), a plain chain none. */
|
|
180
|
-
function assertWrunRowChainPlaneReadable(lane, extras, run, ctx) {
|
|
181
|
-
const plane = wrunRowLaneChainPlane(lane, extras);
|
|
182
|
-
if (plane === 'opra')
|
|
183
|
-
assertWrunOpraLaneReadable(run, ctx);
|
|
184
|
-
if (plane === 'cme' && run?.official !== true) {
|
|
185
|
-
refuseWrunPollInput(ctx, `reads CME options data (${wrunRowLaneChainExchange(lane, extras)}), which is open to OpenMarket's own ` +
|
|
186
|
-
'Indicators only: a package you wrote or added from the community cannot read it yet', WRUN_CME_WALL_SEED);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
176
|
/** The exchange a chain-lane instance's chain lists on (the payload field its `chain` names); '' for any other lane
|
|
190
|
-
* or a payload naming none. */
|
|
177
|
+
* or a payload naming none. The chain poll lanes' one rule (`wrunPollLaneChainExchange`: the mark is the same). */
|
|
191
178
|
export function wrunRowLaneChainExchange(lane, extras) {
|
|
192
|
-
|
|
193
|
-
return typeof exchange === 'string' ? exchange : '';
|
|
179
|
+
return wrunPollLaneChainExchange(lane, extras);
|
|
194
180
|
}
|
|
195
|
-
/** The plane a chain-lane instance reads, by its chain's exchange (`
|
|
196
|
-
* lane (its plane, if any, is its descriptor's `governed`). */
|
|
181
|
+
/** The plane a chain-lane instance reads, by its chain's exchange (`wrunPollLaneChainPlane`, the chain poll lanes' one
|
|
182
|
+
* rule over `wrunLaneChainPlaneOf`); undefined for any other lane (its plane, if any, is its descriptor's `governed`). */
|
|
197
183
|
export function wrunRowLaneChainPlane(lane, extras) {
|
|
198
|
-
return
|
|
184
|
+
return wrunPollLaneChainPlane(lane, extras);
|
|
199
185
|
}
|
|
200
186
|
/** Whether one row-lane instance reads the OPRA plane (the provenance stamp follows it): every instance of a governed
|
|
201
187
|
* lane, a chain lane's whose chain lists on OPRA. */
|
|
@@ -204,10 +190,9 @@ export function wrunRowLaneInstanceReadsOpra(lane, extras) {
|
|
|
204
190
|
}
|
|
205
191
|
/** The governed exchange a chain-lane instance reads beside its chart's own market (the exchange its served access,
|
|
206
192
|
* and so its delayed window, is read under): its chain's when a gate governs it (OPRA, a CME Group exchange); null
|
|
207
|
-
* for a plain chain and for any other lane. */
|
|
193
|
+
* for a plain chain and for any other lane. The chain poll lanes' one rule (`wrunPollLaneChainGovernedExchange`). */
|
|
208
194
|
export function wrunRowLaneChainGovernedExchange(lane, extras) {
|
|
209
|
-
|
|
210
|
-
return plane === 'opra' || plane === 'cme' ? wrunRowLaneChainExchange(lane, extras) : null;
|
|
195
|
+
return wrunPollLaneChainGovernedExchange(lane, extras);
|
|
211
196
|
}
|
|
212
197
|
/** The first row-lane instance of a session whose acquisition moved since the run planned it (its lane's
|
|
213
198
|
* `acquisitionMoved` over the run's record of it, else over the instance's payload), or undefined: the live tick
|
|
@@ -222,19 +207,15 @@ export function wrunRowLaneMovedInstance(instances, acquisition) {
|
|
|
222
207
|
}
|
|
223
208
|
/**
|
|
224
209
|
* A chain instance's ask (the full run's and the reconcile's, re-read on every ask): its payload with the fields its
|
|
225
|
-
* plane names beside it
|
|
226
|
-
* it an OPRA ask, the legend names a delayed tier); a CME chain its routed tier alone
|
|
227
|
-
* serves one tier's rows to the other; the chart's own badge names the delay); a
|
|
228
|
-
* Any other lane's payload as it is. `tierOf` is the routing's rule
|
|
229
|
-
* handed in so this module stays off the routing graph, and asked only
|
|
230
|
-
* for any exchange no gate governs.
|
|
210
|
+
* plane names beside it, by the chain poll lanes' one rule (`wrunPollLaneChainAsk`): an OPRA chain names the plane and
|
|
211
|
+
* its routed tier (Door C judges it an OPRA ask, the legend names a delayed tier); a CME chain its routed tier alone
|
|
212
|
+
* (`servedTier`, so no source cache serves one tier's rows to the other; the chart's own badge names the delay); a
|
|
213
|
+
* plain chain (a crypto venue) nothing. Any other lane's payload as it is. `tierOf` is the routing's rule
|
|
214
|
+
* (governed-route.util `governedMarketDataTier`), handed in so this module stays off the routing graph, and asked only
|
|
215
|
+
* for a governed exchange: it answers delayed for any exchange no gate governs.
|
|
231
216
|
*/
|
|
232
217
|
export function wrunRowLaneChainAsk(lane, extras, tierOf) {
|
|
233
|
-
|
|
234
|
-
if (plane !== 'opra' && plane !== 'cme')
|
|
235
|
-
return extras;
|
|
236
|
-
const servedTier = tierOf(wrunRowLaneChainExchange(lane, extras));
|
|
237
|
-
return plane === 'opra' ? { ...extras, ...wrunOpraLanePayloadFields(servedTier) } : { ...extras, servedTier };
|
|
218
|
+
return wrunPollLaneChainAsk(lane, extras, tierOf);
|
|
238
219
|
}
|
|
239
220
|
/** How an empty answer reads for a lane: quiet (present EMPTY blocks) or degrading (a state lane's). */
|
|
240
221
|
export function wrunRowLaneEmptyAnswer(lane) {
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Alert-armable outputs of the mounted browser-run Indicator overlays, by
|
|
3
|
+
* overlay id. The registry loader stamps an overlay's package metadata here
|
|
4
|
+
* at mount (add, rehydrate, draft re-run); the alert resolver reads it to
|
|
5
|
+
* build the Indicator target's output picker.
|
|
6
|
+
*
|
|
7
|
+
* Rules are anchored server-side by output NAME, so each entry carries the
|
|
8
|
+
* metadata name as the stable identity (`outputKey` = name, `outputColumn`
|
|
9
|
+
* = 1) and as its `label`: the hosted engine labels the series by name and
|
|
10
|
+
* refuses a threshold rule whose `outputLabel` says otherwise. The sheet's
|
|
11
|
+
* own display `label` rides beside it as `displayLabel`, for the pickers
|
|
12
|
+
* only (displayOutputLabel). Data-only outputs (`plot: ''`) are never
|
|
13
|
+
* armable and are excluded here, mirroring the server's own list, and so are
|
|
14
|
+
* guides (`role: "guide"`): a guide is the kScript hline it stands for, one
|
|
15
|
+
* constant level, which the kScript lane never offers either. Two more sheet
|
|
16
|
+
* facts ride for the resolver's offer: `transparent` (a line declared
|
|
17
|
+
* `opacity: 0`, drawn clear: a fill's edge) and `displacement` (the declared
|
|
18
|
+
* bar shift, read against the armed params there).
|
|
19
|
+
*
|
|
20
|
+
* A strategy package (a sheet that declares `strategy`, OM-WRUN3-STRATEGIES-
|
|
21
|
+
* CONTRACT section 5) adds four host-published entries after its outputs,
|
|
22
|
+
* the same ones the hosted alerts engine evaluates: the two event streams
|
|
23
|
+
* (`strategy.order`, a pending order that did not exist before the bar's
|
|
24
|
+
* finalize(); `strategy.fill`, a trade opened or closed by the bar's fills;
|
|
25
|
+
* both fire on confirmed bars only) and the two reserved outputs
|
|
26
|
+
* (`strategy.position`, the signed position after the bar's fills;
|
|
27
|
+
* `strategy.equity`), addressable by name like any output. They never enter
|
|
28
|
+
* the module's output count, so their `index` continues after the declared
|
|
29
|
+
* outputs and `kind` tells them apart from a plotted output.
|
|
30
|
+
*
|
|
31
|
+
* A sheet's declared alerts (`alerts: [{ name, when, message?, description?,
|
|
32
|
+
* text?, every_bar? }]`, the kit's `alert(name, { when: handle, message })`
|
|
33
|
+
* declaration over an output the module already writes, data-only allowed)
|
|
34
|
+
* are stamped beside the armable outputs as alert CONDITIONS: the form lists
|
|
35
|
+
* them as `signal:<name>` options and the arm sends a `kind: 'signal'` rule
|
|
36
|
+
* whose `conditionTitle` is the declared name; the hosted engine fires on
|
|
37
|
+
* the `when` output's false to true flip (or on every bar it holds when the
|
|
38
|
+
* declaration or the user says `every_bar`) and refuses an undeclared title
|
|
39
|
+
* with 422 UNKNOWN_CONDITION. The two scaffold-37 facts ride along so the
|
|
40
|
+
* arm form can say what will fire and what the message will be: `text`
|
|
41
|
+
* names the declared string slot whose fired-row value is the fire text,
|
|
42
|
+
* `every_bar` the author's firing default. They never enter the output
|
|
43
|
+
* entries: the `when` output stays armable (or data-only) on its own terms.
|
|
44
|
+
* A declared `title` (frozen authoring contract C1.8: display text with
|
|
45
|
+
* spaces beside the slug name) rides as the entry's `label`: the picker
|
|
46
|
+
* lists it, the arm stamps it as the signal rule's `outputLabel`, and the
|
|
47
|
+
* cards and fired notifications show it. The entry's `title` stays the
|
|
48
|
+
* name, the `conditionTitle` every option, edit and armed rule is keyed by,
|
|
49
|
+
* so arms made before titles existed keep matching.
|
|
50
|
+
*
|
|
51
|
+
* Leaf module (no imports) so the resolver stays node-testable without the
|
|
52
|
+
* wasm host or the chart instance in its graph; the four names mirror the
|
|
53
|
+
* SDK's WRUN3_STRATEGY_EVENT_STREAMS and WRUN3_STRATEGY_RESERVED_OUTPUTS.
|
|
54
|
+
*/
|
|
55
|
+
type WrunAlertOutputKind = 'output' | 'event' | 'reserved';
|
|
56
|
+
export interface WrunAlertOutputEntry {
|
|
57
|
+
index: number;
|
|
58
|
+
label: string;
|
|
59
|
+
outputKey: string;
|
|
60
|
+
outputColumn: number;
|
|
61
|
+
panel?: string;
|
|
62
|
+
/** A declared plotted output (absent = 'output'), a strategy event
|
|
63
|
+
* stream, or a host-published reserved strategy output. */
|
|
64
|
+
kind?: WrunAlertOutputKind;
|
|
65
|
+
/** The sheet's display `label` when it says something the name does not:
|
|
66
|
+
* what the pickers show. Never on a rule (see `label`). */
|
|
67
|
+
displayLabel?: string;
|
|
68
|
+
/** Declared `opacity: 0`: a line drawn clear (a fill's edge). */
|
|
69
|
+
transparent?: true;
|
|
70
|
+
/** The declared bar shift as the sheet states it (`displacement_bars`,
|
|
71
|
+
* `displacement_bars_by`); the resolver reads it against the armed params. */
|
|
72
|
+
displacement?: {
|
|
73
|
+
bars?: number;
|
|
74
|
+
by?: unknown;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/** One declared alert of a package, in the shape the rule dialog context's
|
|
78
|
+
* `alertConditions` already carries for kScript `alertcondition()` entries. */
|
|
79
|
+
export interface WrunAlertConditionEntry {
|
|
80
|
+
kind: 'condition';
|
|
81
|
+
/** The declared alert name: the signal rule's `conditionTitle` (its identity) and, without a
|
|
82
|
+
* `label`, the picker label. */
|
|
83
|
+
title: string;
|
|
84
|
+
/** The declared display title (C1.8) when the sheet carries one that differs from the name:
|
|
85
|
+
* what the picker, the armed rule (`outputLabel`) and the notifications show. */
|
|
86
|
+
label?: string;
|
|
87
|
+
/** The declared fire text (the engine's fallback when the rule carries no user note). */
|
|
88
|
+
message?: string;
|
|
89
|
+
/** The picker sub-line. */
|
|
90
|
+
description?: string;
|
|
91
|
+
/** The declared string slot whose value on the fired row is the fire text
|
|
92
|
+
* (over `message`, over the name): the module writes it in finalize(). */
|
|
93
|
+
text?: string;
|
|
94
|
+
/** The author's firing default: true = a fire on every bar the condition
|
|
95
|
+
* holds (one per bar at most), absent = the false-to-true edge. The arm
|
|
96
|
+
* form seeds its Fire choice from it and the armed rule may override it. */
|
|
97
|
+
everyBar?: true;
|
|
98
|
+
}
|
|
99
|
+
interface WrunAlertOutputMetadataLike {
|
|
100
|
+
outputs: ReadonlyArray<{
|
|
101
|
+
index?: number;
|
|
102
|
+
name: string;
|
|
103
|
+
plot?: string;
|
|
104
|
+
panel?: string;
|
|
105
|
+
label?: string;
|
|
106
|
+
role?: string;
|
|
107
|
+
opacity?: number;
|
|
108
|
+
displacement_bars?: number;
|
|
109
|
+
displacement_bars_by?: unknown;
|
|
110
|
+
}>;
|
|
111
|
+
/** The sheet's strategy section; its presence makes the package a strategy. */
|
|
112
|
+
strategy?: unknown;
|
|
113
|
+
/** The sheet's declared alerts (read loosely: the registry hands over parsed
|
|
114
|
+
* JSON, and a sheet from an older kit has none). */
|
|
115
|
+
alerts?: unknown;
|
|
116
|
+
}
|
|
117
|
+
/** The words of a strategy package's host-published entry by its name
|
|
118
|
+
* (`strategy.fill` -> "Strategy trade opened or closed"); undefined for any
|
|
119
|
+
* other name. An alert on one names it without its sheet in hand. */
|
|
120
|
+
export declare function wrunStrategyAlertEntryLabel(outputKey: string): string | undefined;
|
|
121
|
+
/** Armable entries from a package metadata sheet (data-only outputs and
|
|
122
|
+
* guides dropped; a strategy package's event streams and reserved outputs
|
|
123
|
+
* appended). */
|
|
124
|
+
export declare function wrunAlertOutputsFromMetadata(metadata: WrunAlertOutputMetadataLike): WrunAlertOutputEntry[];
|
|
125
|
+
/** The sheet's declared alerts as picker conditions, in declaration order.
|
|
126
|
+
* A row without a string name is skipped; a repeated name keeps its first
|
|
127
|
+
* row (the sheet namespace forbids duplicates, so this only guards a
|
|
128
|
+
* hand-edited sheet). `when` is the engine's concern: the FE never
|
|
129
|
+
* re-derives the output it names. `text` rides only as a non-empty string
|
|
130
|
+
* and `every_bar` only as the literal `true` (a sheet from an older kit
|
|
131
|
+
* carries neither, and `false` means the edge, the default); `title` rides
|
|
132
|
+
* as `label` only when it is non-empty and differs from the name. */
|
|
133
|
+
export declare function wrunAlertConditionsFromMetadata(metadata: WrunAlertOutputMetadataLike): WrunAlertConditionEntry[];
|
|
134
|
+
/** Registers an overlay's entries from its sheet. `partial`: the sheet lacks
|
|
135
|
+
* the output facts the offer reads (labels, guide roles, opacity, shifts), so
|
|
136
|
+
* the entries stand in until a complete sheet replaces them
|
|
137
|
+
* (wrunOverlayAlertOutputsArePartial). */
|
|
138
|
+
export declare function setWrunOverlayAlertOutputs(overlayId: string, metadata: WrunAlertOutputMetadataLike, options?: {
|
|
139
|
+
partial?: boolean;
|
|
140
|
+
}): void;
|
|
141
|
+
/** Whether the overlay's entries were registered `partial`: a complete sheet replaces them. */
|
|
142
|
+
export declare function wrunOverlayAlertOutputsArePartial(overlayId: string): boolean;
|
|
143
|
+
export declare function clearWrunOverlayAlertOutputs(overlayId: string): void;
|
|
144
|
+
/** undefined until the overlay's package is mounted (an inert reload-time overlay has none). */
|
|
145
|
+
export declare function getWrunOverlayAlertOutputs(overlayId: string): WrunAlertOutputEntry[] | undefined;
|
|
146
|
+
/** The mounted overlay's declared alerts; undefined until its package is
|
|
147
|
+
* mounted, an empty list for a package that declares none. */
|
|
148
|
+
export declare function getWrunOverlayAlertConditions(overlayId: string): WrunAlertConditionEntry[] | undefined;
|
|
149
|
+
/**
|
|
150
|
+
* The live frontier of an Indicator overlay's alert outputs on the mounted
|
|
151
|
+
* chart, for the quick dialog's Current values, threshold seed and direction
|
|
152
|
+
* (the built-in opener's lastValues / colors / labels): each array indexed by
|
|
153
|
+
* the output's `index`, the plot's last row value, its first colour, and the
|
|
154
|
+
* output's display label. Plots live under the overlay and its series
|
|
155
|
+
* children (`<id>::series:<pane>`, wrun-run-result.util wrunSeriesChildId).
|
|
156
|
+
* An output with no mounted plot (an empty `omit_if_empty` line, a strategy's
|
|
157
|
+
* reserved output or event stream) reads NaN, which the dialog prints as "-".
|
|
158
|
+
*/
|
|
159
|
+
export declare function wrunOverlayAlertOutputValues(chart: {
|
|
160
|
+
metadata?: ReadonlyArray<unknown>;
|
|
161
|
+
} | null | undefined, overlayId: string, outputs: ReadonlyArray<Pick<WrunAlertOutputEntry, 'index' | 'label' | 'outputKey' | 'displayLabel'>>): {
|
|
162
|
+
lastValues: number[];
|
|
163
|
+
colors: (string | undefined)[];
|
|
164
|
+
labels: (string | undefined)[];
|
|
165
|
+
};
|
|
166
|
+
export {};
|