@orangecharts/wrun-chart-host 0.7.1 → 0.9.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 +27 -4
- package/dist/constants/feature-flags.constants.d.ts +5 -0
- package/dist/constants/feature-flags.constants.js +32 -0
- package/dist/constants/marketCapabilities.constants.d.ts +14 -9
- package/dist/constants/marketCapabilities.constants.js +36 -13
- package/dist/constants/opra-compliance.constants.d.ts +14 -0
- package/dist/constants/opra-compliance.constants.js +14 -0
- package/dist/constants/option-venues.constants.d.ts +29 -6
- package/dist/constants/option-venues.constants.js +19 -2
- package/dist/constants/venue-presets.constants.d.ts +17 -3
- package/dist/constants/venue-presets.constants.js +17 -3
- package/dist/host-env.d.ts +34 -4
- package/dist/host-env.js +21 -0
- package/dist/host-ports.types.d.ts +51 -3
- package/dist/index.d.ts +17 -0
- package/dist/index.js +17 -0
- package/dist/indicators/controls/tpo-session.util.d.ts +40 -11
- package/dist/indicators/controls/tpo-session.util.js +138 -14
- package/dist/interfaces/opra-realtime.interface.d.ts +13 -11
- package/dist/interfaces/opra-realtime.interface.js +10 -10
- package/dist/interfaces/option-instrument.interface.d.ts +6 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +34 -13
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +57 -10
- package/dist/kscript-data/controls/live-trades-merge.util.js +85 -16
- package/dist/market-data/billing.interface.d.ts +138 -17
- package/dist/market-data/billing.interface.js +25 -8
- package/dist/market-data/venues/index.d.ts +3 -3
- package/dist/market-data/venues/opra.contract.copy.json +5 -3
- package/dist/market-data/venues/opra.d.ts +3 -3
- package/dist/market-data/venues/opra.js +5 -4
- package/dist/replay/replayLadder.js +3 -1
- package/dist/settings-templates/footprint-rows.d.ts +25 -0
- package/dist/settings-templates/footprint-rows.js +127 -0
- package/dist/settings-templates/form-rows.d.ts +56 -0
- package/dist/settings-templates/form-rows.js +19 -0
- package/dist/settings-templates/frvp-fields.js +14 -0
- package/dist/settings-templates/index.d.ts +10 -1
- package/dist/settings-templates/index.js +11 -2
- package/dist/settings-templates/indicator-fields.js +78 -0
- package/dist/settings-templates/tool-rules.d.ts +35 -9
- package/dist/settings-templates/tool-rules.js +42 -8
- package/dist/settings-templates/tool-tables.generated.js +13 -2
- package/dist/utility/chart/candle-volume-unit.leaf.d.ts +16 -0
- package/dist/utility/chart/candle-volume-unit.leaf.js +61 -0
- package/dist/utility/chart/crypto-index.leaf.d.ts +2 -2
- package/dist/utility/chart/crypto-index.leaf.js +2 -2
- package/dist/utility/chart/footprint-columns.util.d.ts +74 -0
- package/dist/utility/chart/footprint-columns.util.js +106 -0
- package/dist/utility/chart/footprint-display-mode.util.d.ts +40 -0
- package/dist/utility/chart/footprint-display-mode.util.js +62 -0
- package/dist/utility/chart/footprint-sierra-look.util.d.ts +2 -0
- package/dist/utility/chart/footprint-sierra-look.util.js +37 -0
- package/dist/utility/chart/index-mode-admission.util.js +9 -1
- package/dist/utility/chart/index-mode.util.d.ts +5 -2
- package/dist/utility/chart/index-mode.util.js +23 -13
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +28 -21
- package/dist/utility/chart/kscript-venue-policy.util.js +34 -26
- package/dist/utility/chart/marketKind.util.d.ts +12 -10
- package/dist/utility/chart/marketKind.util.js +17 -7
- package/dist/utility/chart/om-panel-push-style.util.d.ts +7 -7
- package/dist/utility/chart/om-panel-push-style.util.js +17 -15
- package/dist/utility/chart/om-panel.util.d.ts +11 -0
- package/dist/utility/chart/om-panel.util.js +65 -6
- package/dist/utility/chart/profile-block-size.util.d.ts +16 -0
- package/dist/utility/chart/profile-block-size.util.js +7 -0
- package/dist/utility/chart/quote-perp.leaf.d.ts +17 -0
- package/dist/utility/chart/quote-perp.leaf.js +20 -0
- package/dist/utility/chart/window-geometry.leaf.d.ts +23 -1
- package/dist/utility/chart/window-geometry.leaf.js +78 -6
- package/dist/utility/chart/window-owner.leaf.d.ts +13 -0
- package/dist/utility/chart/window-owner.leaf.js +5 -0
- package/dist/utility/chart/wrun-run-result.util.d.ts +5 -0
- package/dist/utility/chart/wrun-run-result.util.js +4 -1
- package/dist/utility/common/transformations.util.d.ts +7 -0
- package/dist/utility/common/transformations.util.js +11 -0
- package/dist/utility/options/cme-options-root.util.d.ts +25 -0
- package/dist/utility/options/cme-options-root.util.js +40 -0
- package/dist/utility/options/option-book.util.d.ts +27 -0
- package/dist/utility/options/option-book.util.js +76 -0
- package/dist/utility/options/option-trade-date.util.d.ts +50 -0
- package/dist/utility/options/option-trade-date.util.js +120 -0
- package/dist/utility/options/option-venue.util.d.ts +3 -3
- package/dist/utility/options/option-venue.util.js +3 -3
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +1 -1
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +2 -2
- package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.d.ts +2 -2
- package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.js +5 -1
- package/dist/utility/wrun/sources/host-grid-landing.d.ts +4 -2
- package/dist/utility/wrun/sources/host-grid-landing.js +8 -0
- package/dist/utility/wrun/sources/lanes/options_flow.d.ts +40 -4
- package/dist/utility/wrun/sources/lanes/options_flow.js +115 -18
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +12 -9
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +10 -7
- package/dist/utility/wrun/sources/row-lane-registry.js +10 -5
- package/dist/utility/wrun/sources/row-lanes/index.js +2 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.d.ts +3 -2
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +30 -5
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +9 -3
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +13 -5
- package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +25 -1
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +161 -30
- package/dist/utility/wrun/sources/row-lanes/option_strike_flow.d.ts +4 -0
- package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +65 -0
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +55 -1
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +83 -2
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +17 -1
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +33 -2
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +7 -1
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +51 -5
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +136 -3
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +42 -0
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +146 -0
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +25 -5
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +111 -20
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +291 -48
- package/dist/utility/wrun/wrun-batched-marks.util.d.ts +16 -3
- package/dist/utility/wrun/wrun-batched-marks.util.js +30 -19
- package/dist/utility/wrun/wrun-batched-readout.util.d.ts +37 -9
- package/dist/utility/wrun/wrun-batched-readout.util.js +61 -15
- package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-cell-capacity.leaf.d.ts +66 -0
- package/dist/utility/wrun/wrun-cell-capacity.leaf.js +86 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +147 -9
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +345 -11
- package/dist/utility/wrun/wrun-cloud-record.leaf.d.ts +27 -0
- package/dist/utility/wrun/wrun-cloud-record.leaf.js +71 -0
- package/dist/utility/wrun/wrun-cloud-record.util.d.ts +4 -21
- package/dist/utility/wrun/wrun-cloud-record.util.js +5 -65
- package/dist/utility/wrun/wrun-color-facts.util.d.ts +19 -9
- package/dist/utility/wrun/wrun-color-facts.util.js +24 -14
- package/dist/utility/wrun/wrun-color-settings.util.d.ts +22 -9
- package/dist/utility/wrun/wrun-color-settings.util.js +57 -23
- package/dist/utility/wrun/wrun-dollar-unit-port.leaf.d.ts +17 -0
- package/dist/utility/wrun/wrun-dollar-unit-port.leaf.js +9 -0
- package/dist/utility/wrun/wrun-download-meter.util.d.ts +92 -0
- package/dist/utility/wrun/wrun-download-meter.util.js +122 -0
- package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +10 -3
- package/dist/utility/wrun/wrun-draft-overlay.util.js +63 -6
- package/dist/utility/wrun/wrun-frames.js +5 -5
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +2 -2
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +11 -0
- package/dist/utility/wrun/wrun-hud-looks.util.d.ts +33 -17
- package/dist/utility/wrun/wrun-hud-looks.util.js +30 -16
- package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +29 -3
- package/dist/utility/wrun/wrun-lane-refusal.leaf.js +33 -3
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.d.ts +8 -6
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.js +8 -6
- package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -2
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +6 -2
- package/dist/utility/wrun/wrun-live-intake.util.js +136 -21
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +4 -1
- package/dist/utility/wrun/wrun-live-tick.util.js +130 -44
- package/dist/utility/wrun/wrun-market-size-contract-carry.leaf.d.ts +53 -0
- package/dist/utility/wrun/wrun-market-size-contract-carry.leaf.js +162 -0
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +224 -0
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +342 -0
- package/dist/utility/wrun/wrun-market-size-defaults.util.d.ts +88 -0
- package/dist/utility/wrun/wrun-market-size-defaults.util.js +471 -0
- package/dist/utility/wrun/wrun-opra-flow.leaf.d.ts +43 -8
- package/dist/utility/wrun/wrun-opra-flow.leaf.js +37 -6
- package/dist/utility/wrun/wrun-option-contract-flow.util.d.ts +51 -10
- package/dist/utility/wrun/wrun-option-contract-flow.util.js +85 -33
- package/dist/utility/wrun/wrun-option-prints.util.d.ts +172 -3
- package/dist/utility/wrun/wrun-option-prints.util.js +394 -17
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +99 -0
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +218 -0
- package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +365 -0
- package/dist/utility/wrun/wrun-option-strike-flow.util.js +797 -0
- package/dist/utility/wrun/wrun-option-views.util.d.ts +231 -7
- package/dist/utility/wrun/wrun-option-views.util.js +643 -23
- package/dist/utility/wrun/wrun-options-chain.util.d.ts +6 -4
- package/dist/utility/wrun/wrun-options-chain.util.js +8 -5
- package/dist/utility/wrun/wrun-options-stop.util.d.ts +2 -1
- package/dist/utility/wrun/wrun-options-stop.util.js +3 -2
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +3 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.d.ts +31 -14
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.js +22 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +9 -1
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +32 -3
- package/dist/utility/wrun/wrun-overlay-result.util.d.ts +7 -1
- package/dist/utility/wrun/wrun-overlay-result.util.js +2 -0
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +34 -6
- package/dist/utility/wrun/wrun-overlay-run.util.js +527 -180
- package/dist/utility/wrun/wrun-pack-widths.leaf.d.ts +15 -0
- package/dist/utility/wrun/wrun-pack-widths.leaf.js +22 -0
- package/dist/utility/wrun/wrun-pack.util.d.ts +13 -8
- package/dist/utility/wrun/wrun-pack.util.js +38 -21
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-panel-mount.util.js +62 -22
- package/dist/utility/wrun/wrun-panel-style.util.d.ts +41 -14
- package/dist/utility/wrun/wrun-panel-style.util.js +86 -26
- package/dist/utility/wrun/wrun-param-map.util.d.ts +7 -6
- package/dist/utility/wrun/wrun-param-map.util.js +8 -5
- package/dist/utility/wrun/wrun-param-values.util.d.ts +10 -2
- package/dist/utility/wrun/wrun-param-values.util.js +2 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.js +19 -10
- package/dist/utility/wrun/wrun-prefix-lanes.util.js +2 -2
- package/dist/utility/wrun/wrun-refusal.util.js +17 -2
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +20 -0
- package/dist/utility/wrun/wrun-script-inputs.util.js +43 -0
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-source-rows.util.js +92 -40
- package/dist/utility/wrun/wrun-tape-source.util.d.ts +133 -48
- package/dist/utility/wrun/wrun-tape-source.util.js +205 -62
- package/dist/utility/wrun/wrun-volume-profile-lane.util.d.ts +7 -5
- package/dist/utility/wrun/wrun-volume-profile-lane.util.js +8 -6
- package/dist/workers/utils/volume-profile.worker.util.d.ts +4 -1
- package/dist/workers/utils/volume-profile.worker.util.js +5 -2
- package/dist/workers/wrun/wrun-abi-host.js +3 -2
- package/package.json +11 -11
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The download meter (OPTLOAD wave 3, unit R1; UW-PARITY/reports/OPTLOAD-W3/guard-design.md section 3): what one
|
|
3
|
+
* indicator run downloads, counted from the worker's own wire count, never from the rows the page received. The run
|
|
4
|
+
* sees rows after the worker reduced them (Spot Exposures on SPY 1h: 28 bars of strike rows on the page, 17.67 MB on
|
|
5
|
+
* the wire, every minute snapshot of each bar read and all but the newest dropped), so a meter of the page's rows
|
|
6
|
+
* would miss it about 60 times over.
|
|
7
|
+
*
|
|
8
|
+
* - The unit is the wire byte the worker stamped on the FETCH_DATA's completion (`WrunSourceFetchVerdict.wireBytes`),
|
|
9
|
+
* for the asker that owned the request: a follower of a shared request, a cache and the chart's own rows carry 0.
|
|
10
|
+
* - An answer no stamp measures (a host that cannot count, the packed book worker, a relay feed's own fetch) is
|
|
11
|
+
* charged its cell bytes (8 per value, the source answer budget's unit), and the summary says so
|
|
12
|
+
* (`measure: 'cells'`).
|
|
13
|
+
* - Every byte a run asks goes through `transport.fetchSource`, whose options require a meter: a new call site without
|
|
14
|
+
* one does not typecheck. The web transport charges it once per call. The reads a run makes around the transport
|
|
15
|
+
* charge it at their own call: the warm-up heads (the chart's main candle request), a relay feed's own fetch, the
|
|
16
|
+
* chart's own candles.
|
|
17
|
+
* - A run's budget is 1 MB per 252 bars of its window, never under 1 MB, the kit's rule (`@openmarket/sdk/wrun-host`
|
|
18
|
+
* download-budget.ts) at the chart's real window.
|
|
19
|
+
*
|
|
20
|
+
* Telemetry only in R1: nothing reads the meter to change an ask; a full run hands its summary to the add's attempt
|
|
21
|
+
* (`downloadBytes` on `wrun-indicator`), the live session counts its reconciles on its own meter.
|
|
22
|
+
*/
|
|
23
|
+
import type { WrunSourceFetchVerdict } from '../../host-ports.types.js';
|
|
24
|
+
/** One indicator add may download at most this many bytes at the standard window (the kit's
|
|
25
|
+
* `WRUN_INDICATOR_DOWNLOAD_BUDGET_BYTES`; a spec pins the two equal). */
|
|
26
|
+
export declare const WRUN_INDICATOR_DOWNLOAD_BUDGET_BYTES = 1000000;
|
|
27
|
+
/** The chart's standard loaded window at an add, in bars (the kit's `WRUN_DOWNLOAD_STANDARD_BARS`; the same spec pins
|
|
28
|
+
* the two equal). */
|
|
29
|
+
export declare const WRUN_DOWNLOAD_STANDARD_BARS = 252;
|
|
30
|
+
/** A run's budget: 1 MB per 252 bars of its window, never under 1 MB, so a template under budget at 252 bars stays
|
|
31
|
+
* under on a wider chart (its cost per bar does not change). Whole bytes. */
|
|
32
|
+
export declare function wrunRunDownloadBudgetBytes(windowBars: number): number;
|
|
33
|
+
/** What an ask hands the meter: the host's transport charges every call it answers, a run its own reads. */
|
|
34
|
+
export interface WrunDownloadMeterPort {
|
|
35
|
+
charge(charge: WrunDownloadCharge): void;
|
|
36
|
+
}
|
|
37
|
+
/** One answered ask: its fetch key and K type, its verdict (with the wire the asker downloaded when the host stamps
|
|
38
|
+
* it), and the rows it answered with their cell bytes (`wrunDownloadAnswerSize`). */
|
|
39
|
+
export interface WrunDownloadCharge {
|
|
40
|
+
key: string;
|
|
41
|
+
kType: string;
|
|
42
|
+
verdict?: WrunSourceFetchVerdict;
|
|
43
|
+
cellBytes: number;
|
|
44
|
+
rows: number;
|
|
45
|
+
}
|
|
46
|
+
/** A run's download, as the add's attempt reports it (analytics-taxonomy, `downloadBytes` and its siblings). */
|
|
47
|
+
export interface WrunDownloadSummary {
|
|
48
|
+
/** Wire bytes, with the cell bytes of every answer no stamp measured. */
|
|
49
|
+
bytes: number;
|
|
50
|
+
/** `cells` once any answer was charged its cell bytes. */
|
|
51
|
+
measure: 'wire' | 'cells';
|
|
52
|
+
cellBytes: number;
|
|
53
|
+
rows: number;
|
|
54
|
+
frames: number;
|
|
55
|
+
asks: number;
|
|
56
|
+
/** Asks a stamp measured at 0 bytes: a cache, the chart's own rows, a follower of another ask's request. */
|
|
57
|
+
cachedAsks: number;
|
|
58
|
+
windowBars: number;
|
|
59
|
+
budgetBytes: number;
|
|
60
|
+
over: boolean;
|
|
61
|
+
/** R2: the run planned a newest-first cut, and the bars it left unread. Always false and 0 in R1. */
|
|
62
|
+
budgeted: boolean;
|
|
63
|
+
cutBars: number;
|
|
64
|
+
/** The K type that downloaded the most, when any downloaded a byte. */
|
|
65
|
+
topSource?: string;
|
|
66
|
+
/** R2: a first slice's bytes plus the older asks still out, projected. */
|
|
67
|
+
plannedBytes?: number;
|
|
68
|
+
}
|
|
69
|
+
export interface WrunDownloadMeter extends WrunDownloadMeterPort {
|
|
70
|
+
readonly budgetBytes: number;
|
|
71
|
+
spentBytes(): number;
|
|
72
|
+
remainingBytes(): number;
|
|
73
|
+
summary(): WrunDownloadSummary;
|
|
74
|
+
}
|
|
75
|
+
export declare function createWrunDownloadMeter(windowBars: number): WrunDownloadMeter;
|
|
76
|
+
/**
|
|
77
|
+
* Hands a fetch its download meter beside its options, never inside them: a host's port binds the call's meter to the
|
|
78
|
+
* options object it passes on, and the fetch reads it back (`wrunDownloadMeterOf`). Web's dataFetch takes it this way,
|
|
79
|
+
* so every call keeps the arguments it always had (run specs pin them whole). The binding dies with the object.
|
|
80
|
+
*/
|
|
81
|
+
export declare function bindWrunDownloadMeter<T extends object>(options: T, meter: WrunDownloadMeterPort): T;
|
|
82
|
+
/** The meter bound beside a fetch's options object, if a port bound one. */
|
|
83
|
+
export declare function wrunDownloadMeterOf(options: object): WrunDownloadMeterPort | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* The rows an answer holds and their cell bytes, by the row cache's estimate (`estimateKScriptSourceRowsBytes`): 8 a
|
|
86
|
+
* value, a celled row's nested cells by their count, a typed array by its bytes; a packed answer (the kScript
|
|
87
|
+
* engine's packed OHLCV transfer) by its rows and its buffer. Anything else (a declined ask's null) holds none.
|
|
88
|
+
*/
|
|
89
|
+
export declare function wrunDownloadAnswerSize(answer: unknown): {
|
|
90
|
+
cellBytes: number;
|
|
91
|
+
rows: number;
|
|
92
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { isPackedOhlcvRows } from '../../instances/script-engine-worker-ohlcv-transfer.js';
|
|
2
|
+
import { KSCRIPT_SOURCE_CELL_BYTES } from '../chart/kscript-source-answer-budget.leaf.js';
|
|
3
|
+
/** One indicator add may download at most this many bytes at the standard window (the kit's
|
|
4
|
+
* `WRUN_INDICATOR_DOWNLOAD_BUDGET_BYTES`; a spec pins the two equal). */
|
|
5
|
+
export const WRUN_INDICATOR_DOWNLOAD_BUDGET_BYTES = 1_000_000;
|
|
6
|
+
/** The chart's standard loaded window at an add, in bars (the kit's `WRUN_DOWNLOAD_STANDARD_BARS`; the same spec pins
|
|
7
|
+
* the two equal). */
|
|
8
|
+
export const WRUN_DOWNLOAD_STANDARD_BARS = 252;
|
|
9
|
+
/** A run's budget: 1 MB per 252 bars of its window, never under 1 MB, so a template under budget at 252 bars stays
|
|
10
|
+
* under on a wider chart (its cost per bar does not change). Whole bytes. */
|
|
11
|
+
export function wrunRunDownloadBudgetBytes(windowBars) {
|
|
12
|
+
const bars = Number.isFinite(windowBars) && windowBars > 0 ? windowBars : 0;
|
|
13
|
+
return Math.round(WRUN_INDICATOR_DOWNLOAD_BUDGET_BYTES * Math.max(1, bars / WRUN_DOWNLOAD_STANDARD_BARS));
|
|
14
|
+
}
|
|
15
|
+
function countOf(value) {
|
|
16
|
+
return typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : 0;
|
|
17
|
+
}
|
|
18
|
+
export function createWrunDownloadMeter(windowBars) {
|
|
19
|
+
const bars = Number.isFinite(windowBars) && windowBars > 0 ? Math.round(windowBars) : 0;
|
|
20
|
+
const budgetBytes = wrunRunDownloadBudgetBytes(bars);
|
|
21
|
+
let bytes = 0;
|
|
22
|
+
let cellBytes = 0;
|
|
23
|
+
let rows = 0;
|
|
24
|
+
let frames = 0;
|
|
25
|
+
let asks = 0;
|
|
26
|
+
let cachedAsks = 0;
|
|
27
|
+
let measure = 'wire';
|
|
28
|
+
const bytesByKType = new Map();
|
|
29
|
+
return {
|
|
30
|
+
budgetBytes,
|
|
31
|
+
charge(charge) {
|
|
32
|
+
asks += 1;
|
|
33
|
+
cellBytes += countOf(charge.cellBytes);
|
|
34
|
+
rows += countOf(charge.rows);
|
|
35
|
+
const wire = charge.verdict?.wireBytes;
|
|
36
|
+
let spent;
|
|
37
|
+
if (typeof wire === 'number' && Number.isFinite(wire) && wire >= 0) {
|
|
38
|
+
spent = wire;
|
|
39
|
+
frames += countOf(charge.verdict?.wireFrames);
|
|
40
|
+
if (spent === 0)
|
|
41
|
+
cachedAsks += 1;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
// No stamp measured this answer: its cell bytes stand in for its wire, and the summary says so.
|
|
45
|
+
spent = countOf(charge.cellBytes);
|
|
46
|
+
measure = 'cells';
|
|
47
|
+
}
|
|
48
|
+
bytes += spent;
|
|
49
|
+
if (spent > 0)
|
|
50
|
+
bytesByKType.set(charge.kType, (bytesByKType.get(charge.kType) ?? 0) + spent);
|
|
51
|
+
},
|
|
52
|
+
spentBytes: () => bytes,
|
|
53
|
+
remainingBytes: () => Math.max(0, budgetBytes - bytes),
|
|
54
|
+
summary() {
|
|
55
|
+
let topSource;
|
|
56
|
+
let topBytes = 0;
|
|
57
|
+
for (const [kType, spent] of bytesByKType) {
|
|
58
|
+
if (spent > topBytes) {
|
|
59
|
+
topSource = kType;
|
|
60
|
+
topBytes = spent;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
bytes,
|
|
65
|
+
measure,
|
|
66
|
+
cellBytes,
|
|
67
|
+
rows,
|
|
68
|
+
frames,
|
|
69
|
+
asks,
|
|
70
|
+
cachedAsks,
|
|
71
|
+
windowBars: bars,
|
|
72
|
+
budgetBytes,
|
|
73
|
+
over: bytes > budgetBytes,
|
|
74
|
+
budgeted: false,
|
|
75
|
+
cutBars: 0,
|
|
76
|
+
...(topSource !== undefined ? { topSource } : {}),
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/** The meters bound beside a fetch's options object (`bindWrunDownloadMeter`). */
|
|
82
|
+
const metersByOptions = new WeakMap();
|
|
83
|
+
/**
|
|
84
|
+
* Hands a fetch its download meter beside its options, never inside them: a host's port binds the call's meter to the
|
|
85
|
+
* options object it passes on, and the fetch reads it back (`wrunDownloadMeterOf`). Web's dataFetch takes it this way,
|
|
86
|
+
* so every call keeps the arguments it always had (run specs pin them whole). The binding dies with the object.
|
|
87
|
+
*/
|
|
88
|
+
export function bindWrunDownloadMeter(options, meter) {
|
|
89
|
+
metersByOptions.set(options, meter);
|
|
90
|
+
return options;
|
|
91
|
+
}
|
|
92
|
+
/** The meter bound beside a fetch's options object, if a port bound one. */
|
|
93
|
+
export function wrunDownloadMeterOf(options) {
|
|
94
|
+
return metersByOptions.get(options);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The rows an answer holds and their cell bytes, by the row cache's estimate (`estimateKScriptSourceRowsBytes`): 8 a
|
|
98
|
+
* value, a celled row's nested cells by their count, a typed array by its bytes; a packed answer (the kScript
|
|
99
|
+
* engine's packed OHLCV transfer) by its rows and its buffer. Anything else (a declined ask's null) holds none.
|
|
100
|
+
*/
|
|
101
|
+
export function wrunDownloadAnswerSize(answer) {
|
|
102
|
+
if (isPackedOhlcvRows(answer))
|
|
103
|
+
return { cellBytes: answer.buffer.byteLength, rows: answer.rows };
|
|
104
|
+
if (!Array.isArray(answer))
|
|
105
|
+
return { cellBytes: 0, rows: 0 };
|
|
106
|
+
let cellBytes = 0;
|
|
107
|
+
for (const row of answer) {
|
|
108
|
+
if (ArrayBuffer.isView(row)) {
|
|
109
|
+
cellBytes += row.byteLength;
|
|
110
|
+
}
|
|
111
|
+
else if (Array.isArray(row)) {
|
|
112
|
+
for (const cell of row) {
|
|
113
|
+
cellBytes += Array.isArray(cell)
|
|
114
|
+
? cell.length * KSCRIPT_SOURCE_CELL_BYTES
|
|
115
|
+
: ArrayBuffer.isView(cell)
|
|
116
|
+
? cell.byteLength
|
|
117
|
+
: KSCRIPT_SOURCE_CELL_BYTES;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return { cellBytes, rows: answer.length };
|
|
122
|
+
}
|
|
@@ -92,9 +92,11 @@ export interface WrunSourceCountMetadataLike {
|
|
|
92
92
|
* - `stream_currency`: a lane stream's quote (`oi_candles`, `volume_profile_candles`: absent or any word but "USD"
|
|
93
93
|
* reads Coin, the streams' default), one leg fetch per quote;
|
|
94
94
|
* - `ticks_per_bar`: a profile stream's bucket size as the profile lane normalizes it (a whole number 1 to 500,
|
|
95
|
-
* absent or invalid 1); an unresolved `"@<param>"` reads as written (its param resolves it before the run)
|
|
95
|
+
* absent or invalid 1); an unresolved `"@<param>"` reads as written (its param resolves it before the run);
|
|
96
|
+
* - the grouped flow knobs (OPTLOAD G3, each value its own read): numbers as they are, a setting's name as written, a
|
|
97
|
+
* flag true or false, `flow_expiries` absent "all", `span` absent "bar", `flow_history` (`history`) absent "window".
|
|
96
98
|
*/
|
|
97
|
-
export type WrunKScriptPayloadKey = 'market' | 'odds' | 'interval' | 'expiries' | 'delta' | 'venue' | 'fund' | 'publisher' | 'series' | 'token' | 'asset' | 'ref' | 'min_size' | 'history' | 'scope' | 'dte' | 'moneyness' | 'chain_venue' | 'book' | 'stream_currency' | 'ticks_per_bar';
|
|
99
|
+
export type WrunKScriptPayloadKey = 'market' | 'odds' | 'interval' | 'expiries' | 'delta' | 'venue' | 'fund' | 'publisher' | 'series' | 'token' | 'asset' | 'ref' | 'min_size' | 'history' | 'scope' | 'dte' | 'moneyness' | 'chain_venue' | 'book' | 'stream_currency' | 'ticks_per_bar' | 'group' | 'flow_expiries' | 'strike_window_pct' | 'strike_rows' | 'min_volume' | 'min_premium' | 'split_dte' | 'fold_types' | 'span' | 'flow_history';
|
|
98
100
|
/** How a wrun source class reads as a kScript source call. */
|
|
99
101
|
export interface WrunKScriptSourceMapping {
|
|
100
102
|
/** The kScript-equivalent source type (a SOURCE_TYPE_CONFIG key, or a K data
|
|
@@ -177,5 +179,10 @@ export declare function wrunKScriptSourceWeight(type: string | null): number;
|
|
|
177
179
|
export declare function wrunKScriptSourceOf(value: unknown): WrunKScriptSource | null;
|
|
178
180
|
/** The slot charge of a sheet in kScript's unit (the rule above): the
|
|
179
181
|
* weighted count of the distinct kScript sources its entries read, never
|
|
180
|
-
* below 1.
|
|
182
|
+
* below 1. The per-bar sums of the chart chain's prints (`options_flow`
|
|
183
|
+
* scope `prints`) ride the slot of the package's print read of that chain,
|
|
184
|
+
* when it makes one: a print template reads its marks or table from the
|
|
185
|
+
* prints and its columns from the sums, one slot (OPTLOAD W3: Flow Marks
|
|
186
|
+
* 0.3.0, Option Prints 0.5.0). Sums with no such print read charge as
|
|
187
|
+
* their own source. */
|
|
181
188
|
export declare function wrunMetadataSourceCount(metadata: WrunSourceCountMetadataLike): number;
|
|
@@ -166,9 +166,30 @@ export const WRUN_KSCRIPT_SOURCE_CLASSES = Object.freeze({
|
|
|
166
166
|
// until the identity reaches the chart (wrun-browser-sources.leaf WRUN_BROWSER_REFUSED_CLASS_CODES).
|
|
167
167
|
option_prints_v2: { type: null, payload: ['chain_venue', 'book'] },
|
|
168
168
|
// The per-contract flow of the chart's chain (sources/row-lanes/option_contract_flow, a chain lane): one read per
|
|
169
|
-
// chart market, venue word and book at the bars' tier;
|
|
170
|
-
// and the volume floor fold on the chart).
|
|
171
|
-
option_contract_flow: {
|
|
169
|
+
// chart market, venue word and book at the bars' tier; `0dte`, the span, the history and the premium floor narrow it
|
|
170
|
+
// (the nearest expiries, the strike window and the volume floor fold on the chart).
|
|
171
|
+
option_contract_flow: {
|
|
172
|
+
type: null,
|
|
173
|
+
payload: ['market', 'expiries', 'chain_venue', 'book', 'span', 'flow_history', 'min_premium'],
|
|
174
|
+
},
|
|
175
|
+
// The flow by strike and expiry of the chart's chain (OPTLOAD G3): every knob value is a read of its own.
|
|
176
|
+
option_strike_flow: {
|
|
177
|
+
type: null,
|
|
178
|
+
payload: [
|
|
179
|
+
'market',
|
|
180
|
+
'chain_venue',
|
|
181
|
+
'book',
|
|
182
|
+
'group',
|
|
183
|
+
'flow_expiries',
|
|
184
|
+
'strike_window_pct',
|
|
185
|
+
'strike_rows',
|
|
186
|
+
'split_dte',
|
|
187
|
+
'fold_types',
|
|
188
|
+
'span',
|
|
189
|
+
'flow_history',
|
|
190
|
+
'min_volume',
|
|
191
|
+
],
|
|
192
|
+
},
|
|
172
193
|
series: { type: null, payload: ['ref'] },
|
|
173
194
|
// The flow scope rows of the chart's chain (sources/lanes/options_flow, a chain lane read by `auto`, its `venue` a
|
|
174
195
|
// scope's venue): one fetch per scope, dte, moneyness, venue and a ticker's book.
|
|
@@ -300,6 +321,22 @@ function payloadEntry(key, entry) {
|
|
|
300
321
|
return ['currency', entry.currency === 'USD' ? 'USD' : 'Coin'];
|
|
301
322
|
case 'ticks_per_bar':
|
|
302
323
|
return ['ticks_per_bar', streamTicksPerBar(entry.ticks_per_bar)];
|
|
324
|
+
case 'flow_expiries':
|
|
325
|
+
return ['expiries', knobWord(entry.expiries) ?? 'all'];
|
|
326
|
+
case 'strike_window_pct':
|
|
327
|
+
case 'strike_rows':
|
|
328
|
+
case 'min_volume':
|
|
329
|
+
case 'min_premium': {
|
|
330
|
+
const value = entry[key];
|
|
331
|
+
return [key, typeof value === 'number' ? value : (knobWord(value) ?? null)];
|
|
332
|
+
}
|
|
333
|
+
case 'split_dte':
|
|
334
|
+
case 'fold_types':
|
|
335
|
+
return [key, entry[key] === true];
|
|
336
|
+
case 'span':
|
|
337
|
+
return ['span', knobWord(entry.span) ?? 'bar'];
|
|
338
|
+
case 'flow_history':
|
|
339
|
+
return ['history', knobWord(entry.history) ?? 'window'];
|
|
303
340
|
default:
|
|
304
341
|
return [key, knobWord(entry[key]) ?? null];
|
|
305
342
|
}
|
|
@@ -346,13 +383,33 @@ export function wrunKScriptSourceOf(value) {
|
|
|
346
383
|
payload.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));
|
|
347
384
|
return { type, key: JSON.stringify([type ?? `wrun:${sourceClass}`, payload]), weight: wrunKScriptSourceWeight(type) };
|
|
348
385
|
}
|
|
386
|
+
/** The print classes, the ONE print read a package makes of its chain (option_prints, option_prints_v2). */
|
|
387
|
+
const WRUN_PRINT_READ_CLASSES = new Set(['option_prints', 'option_prints_v2']);
|
|
388
|
+
/** Whether an entry reads the prints of the chart's own chain: a print class under the chain's `auto` venue word
|
|
389
|
+
* (absent too; its book only narrows the one chain). */
|
|
390
|
+
function readsChartChainPrints(entry) {
|
|
391
|
+
const venue = knobWord(entry.venue);
|
|
392
|
+
return WRUN_PRINT_READ_CLASSES.has(knobWord(entry.source) ?? '') && (venue === undefined || venue === 'auto');
|
|
393
|
+
}
|
|
394
|
+
/** Whether an entry is the per-bar sums of the chart chain's prints: `options_flow` under scope `prints` (it takes
|
|
395
|
+
* no venue or book there, so it always reads the chart's own chain). */
|
|
396
|
+
function sumsChartChainPrints(entry) {
|
|
397
|
+
return knobWord(entry.source) === 'options_flow' && knobWord(entry.scope) === 'prints';
|
|
398
|
+
}
|
|
349
399
|
/** The slot charge of a sheet in kScript's unit (the rule above): the
|
|
350
400
|
* weighted count of the distinct kScript sources its entries read, never
|
|
351
|
-
* below 1.
|
|
401
|
+
* below 1. The per-bar sums of the chart chain's prints (`options_flow`
|
|
402
|
+
* scope `prints`) ride the slot of the package's print read of that chain,
|
|
403
|
+
* when it makes one: a print template reads its marks or table from the
|
|
404
|
+
* prints and its columns from the sums, one slot (OPTLOAD W3: Flow Marks
|
|
405
|
+
* 0.3.0, Option Prints 0.5.0). Sums with no such print read charge as
|
|
406
|
+
* their own source. */
|
|
352
407
|
export function wrunMetadataSourceCount(metadata) {
|
|
408
|
+
const entries = Object.values(metadata.inputSources ?? {}).filter((value) => value !== null && typeof value === 'object');
|
|
409
|
+
const printRead = entries.find(readsChartChainPrints);
|
|
353
410
|
const weights = new Map();
|
|
354
|
-
for (const value of
|
|
355
|
-
const source = wrunKScriptSourceOf(value);
|
|
411
|
+
for (const value of entries) {
|
|
412
|
+
const source = wrunKScriptSourceOf(printRead !== undefined && sumsChartChainPrints(value) ? printRead : value);
|
|
356
413
|
if (source !== null && !weights.has(source.key))
|
|
357
414
|
weights.set(source.key, source.weight);
|
|
358
415
|
}
|
|
@@ -657,14 +657,14 @@ function panelSummary(value, at) {
|
|
|
657
657
|
};
|
|
658
658
|
});
|
|
659
659
|
}
|
|
660
|
-
/** A panel's effective chrome (SC02): the declared
|
|
661
|
-
*
|
|
662
|
-
*
|
|
660
|
+
/** A panel's effective chrome (SC02, wrunPanelChrome's rule): the declared
|
|
661
|
+
* word, else "hairlines" on a line, bars, histogram or scatter pane of every
|
|
662
|
+
* x kind, stacked or not (the plain look), else "box". */
|
|
663
663
|
function effectivePanelChrome(panel) {
|
|
664
664
|
if (panel.chrome !== undefined)
|
|
665
665
|
return panel.chrome;
|
|
666
|
-
const
|
|
667
|
-
return
|
|
666
|
+
const hairlines = panel.kind === 'line' || panel.kind === 'bars' || panel.kind === 'histogram' || panel.kind === 'scatter';
|
|
667
|
+
return hairlines ? 'hairlines' : 'box';
|
|
668
668
|
}
|
|
669
669
|
/** The cross rules of a frame's chrome against its declaration: x_min /
|
|
670
670
|
* x_max on a numeric line or a scatter, the box-line rule on markers,
|
|
@@ -340,8 +340,8 @@ export declare function wrunFrameRefusalMemory(text: string): 'window' | 'identi
|
|
|
340
340
|
* by name.
|
|
341
341
|
*/
|
|
342
342
|
export declare const WRUN_KIT_REFUSAL_STAGES: {
|
|
343
|
-
readonly validate: readonly ["wrun_abi_unsupported", "wrun_pin_venue_unknown", "wrun_sheet_over_cap", "wrun_abi_channel_missing", "wrun_intrabar_interval_required", "wrun_intrabar_primary", "wrun_candles_interval_required", "wrun_candles_primary", "wrun_options_chain_venue", "wrun_options_chain_expiries", "wrun_options_chain_market_pinned", "wrun_offset_needs_view", "wrun_offset_count_required", "wrun_bars_needs_leg", "wrun_chart_interval_below_needs_candles", "wrun_chart_interval_below_primary", "wrun_chart_interval_below_forming", "wrun_pin_venue_refused", "wrun_pin_symbol_literal", "wrun_tape_history_unavailable", "wrun_strategy_feed_not_ohlcv", "wrun_strategy_slippage_model_unsupported", "wrun_strategy_reserved_output", "wrun_tape_min_size_invalid", "wrun_option_knob_invalid", "wrun_option_market_pinned", "wrun_option_prints_min_premium_required", "wrun_options_flow_venue_field", "wrun_options_flow_venue_required", "wrun_options_flow_venue_scope", "wrun_oi_candles_interval_required", "wrun_oi_candles_primary", "wrun_volume_profile_candles_interval_required", "wrun_volume_profile_candles_primary"];
|
|
344
|
-
readonly plan: readonly ["wrun_options_coin_unknown", "wrun_source_unsupported", "wrun_not_in_10m_universe", "wrun_opra_lane_refused", "wrun_opra_official_only", "wrun_option_contract_flow_unsupported", "wrun_option_contract_state_unsupported", "wrun_option_daily_unsupported", "wrun_option_prints_one_acquisition", "wrun_option_prints_unsupported", "wrun_option_prints_v2_unsupported", "wrun_option_stats_10m_unsupported", "wrun_option_surface_unsupported", "wrun_options_flow_unsupported", "wrun_field_unsupported", "wrun_tenor_unsupported", "wrun_view_unsupported", "wrun_family_unsupported", "wrun_displacement_needs_cap", "wrun_options_chain_venue_unavailable", "wrun_options_chain_unavailable", "wrun_options_chain_one_venue", "wrun_lane_input_refused", "wrun_permission_denied", "wrun_coin_leg_unsupported", "wrun_coin_leg_unresolved", "wrun_pin_unsupported", "wrun_custom_interval_unsupported", "wrun_intrabar_leg_off_grid", "wrun_intrabar_ratio_over_cap", "wrun_intrabar_unsupported", "wrun_candles_bars_over_cap", "wrun_candles_ratio_over_cap", "wrun_oi_candles_unsupported", "wrun_volume_profile_candles_unsupported", "wrun_trade_volume_by_size_unsupported", "wrun_view_leg_off_grid", "wrun_view_leg_equal", "wrun_time_facts_unsupported", "wrun_etf_flow_unsupported", "wrun_volatility_index_unsupported", "wrun_long_short_ratio_unsupported", "wrun_options_oi_unsupported", "wrun_options_volume_unsupported", "wrun_ethena_positions_unsupported", "wrun_etf_holdings_unsupported", "wrun_etf_premium_unsupported", "wrun_economic_unsupported", "wrun_treasury_balance_unsupported", "wrun_bitfinex_funding_unsupported", "wrun_strategy_costs_in_sheet", "wrun_window_bars_invalid", "wrun_cells_unavailable", "wrun_tape_unavailable", "wrun_tape_interval_unsupported", "wrun_metric_source_missing_policy", "wrun_series_source_primary", "wrun_series_source_densification", "wrun_metric_pin_coarser_than_primary", "wrun_forming_primary_not_own_candles", "wrun_package_lock_invalid", "wrun_package_lock_missing", "wrun_package_not_installed", "wrun_package_lock_mismatch", "wrun_composition_cycle", "wrun_composition_depth", "wrun_options_chain_unsupported", "wrun_volume_profile_ticks_unsupported", "wrun_celled_metric_unsupported", "wrun_series_source_missing", "wrun_series_source_invalid", "wrun_params_invalid", "wrun_source_bindings_invalid", "wrun_output_displaced", "wrun_pin_unresolvable"];
|
|
343
|
+
readonly validate: readonly ["wrun_abi_unsupported", "wrun_pin_venue_unknown", "wrun_sheet_over_cap", "wrun_abi_channel_missing", "wrun_intrabar_interval_required", "wrun_intrabar_primary", "wrun_candles_interval_required", "wrun_candles_primary", "wrun_options_chain_venue", "wrun_options_chain_expiries", "wrun_options_chain_market_pinned", "wrun_offset_needs_view", "wrun_offset_count_required", "wrun_bars_needs_leg", "wrun_chart_interval_below_needs_candles", "wrun_chart_interval_below_primary", "wrun_chart_interval_below_forming", "wrun_pin_venue_refused", "wrun_pin_symbol_literal", "wrun_tape_history_unavailable", "wrun_strategy_feed_not_ohlcv", "wrun_strategy_slippage_model_unsupported", "wrun_strategy_reserved_output", "wrun_tape_min_size_invalid", "wrun_tape_min_value_invalid", "wrun_tape_floor_invalid", "wrun_option_knob_invalid", "wrun_option_market_pinned", "wrun_option_prints_min_premium_required", "wrun_option_prints_tail_largest", "wrun_cell_capacity_invalid", "wrun_options_flow_venue_field", "wrun_options_flow_venue_required", "wrun_options_flow_venue_scope", "wrun_oi_candles_interval_required", "wrun_oi_candles_primary", "wrun_volume_profile_candles_interval_required", "wrun_volume_profile_candles_primary"];
|
|
344
|
+
readonly plan: readonly ["wrun_options_coin_unknown", "wrun_source_unsupported", "wrun_not_in_10m_universe", "wrun_opra_lane_refused", "wrun_opra_official_only", "wrun_option_contract_flow_unsupported", "wrun_option_contract_state_unsupported", "wrun_option_daily_unsupported", "wrun_option_prints_one_acquisition", "wrun_option_prints_unsupported", "wrun_option_prints_v2_unsupported", "wrun_option_stats_10m_unsupported", "wrun_option_strike_flow_unsupported", "wrun_option_surface_unsupported", "wrun_option_views_unserved", "wrun_options_flow_unsupported", "wrun_field_unsupported", "wrun_tenor_unsupported", "wrun_view_unsupported", "wrun_family_unsupported", "wrun_displacement_needs_cap", "wrun_options_chain_venue_unavailable", "wrun_options_chain_unavailable", "wrun_options_chain_one_venue", "wrun_lane_input_refused", "wrun_permission_denied", "wrun_coin_leg_unsupported", "wrun_coin_leg_unresolved", "wrun_pin_unsupported", "wrun_custom_interval_unsupported", "wrun_intrabar_leg_off_grid", "wrun_intrabar_ratio_over_cap", "wrun_intrabar_unsupported", "wrun_candles_bars_over_cap", "wrun_candles_ratio_over_cap", "wrun_oi_candles_unsupported", "wrun_volume_profile_candles_unsupported", "wrun_trade_volume_by_size_unsupported", "wrun_view_leg_off_grid", "wrun_view_leg_equal", "wrun_time_facts_unsupported", "wrun_etf_flow_unsupported", "wrun_volatility_index_unsupported", "wrun_long_short_ratio_unsupported", "wrun_options_oi_unsupported", "wrun_options_volume_unsupported", "wrun_ethena_positions_unsupported", "wrun_etf_holdings_unsupported", "wrun_etf_premium_unsupported", "wrun_economic_unsupported", "wrun_treasury_balance_unsupported", "wrun_bitfinex_funding_unsupported", "wrun_strategy_costs_in_sheet", "wrun_window_bars_invalid", "wrun_cells_unavailable", "wrun_tape_unavailable", "wrun_tape_value_unproven", "wrun_tape_interval_unsupported", "wrun_metric_source_missing_policy", "wrun_series_source_primary", "wrun_series_source_densification", "wrun_metric_pin_coarser_than_primary", "wrun_forming_primary_not_own_candles", "wrun_package_lock_invalid", "wrun_package_lock_missing", "wrun_package_not_installed", "wrun_package_lock_mismatch", "wrun_composition_cycle", "wrun_composition_depth", "wrun_options_chain_unsupported", "wrun_volume_profile_ticks_unsupported", "wrun_celled_metric_unsupported", "wrun_series_source_missing", "wrun_series_source_invalid", "wrun_params_invalid", "wrun_source_bindings_invalid", "wrun_output_displaced", "wrun_pin_unresolvable"];
|
|
345
345
|
readonly shape: readonly ["wrun_draw_kind_limit", "wrun_draw_total_limit", "wrun_draw_polyline_too_large", "wrun_draw_calls_per_row", "wrun_render_result_too_large", "wrun_draw_kind_mismatch", "wrun_draw_handle_missing", "wrun_draw_label_slot_absent", "wrun_draw_non_finite", "wrun_draw_phase", "wrun_draw_id_negative", "wrun_draw_kind_undeclared", "wrun_draw_prop_unknown", "wrun_draw_prop_unsupported", "wrun_draw_style_out_of_range", "wrun_draw_polyline_empty", "wrun_draw_polyline_out_of_bounds", "wrun_draw_label_slot_undeclared", "wrun_draw_polyline_budget", "wrun_strategy_id_limit", "wrun_strategy_id_too_long", "wrun_strategy_id_invalid_utf8", "wrun_strategy_calls_per_row", "wrun_strategy_trade_limit", "wrun_strategy_non_finite", "wrun_strategy_bad_direction", "wrun_strategy_not_declared", "wrun_strategy_phase", "wrun_strategy_id_out_of_bounds", "wrun_text_param_phase", "wrun_text_param_memory", "wrun_bar_count_phase", "wrun_frame_invalid", "wrun_frame_phase", "wrun_frame_undeclared", "wrun_frame_length", "wrun_frame_too_large", "wrun_frame_run_too_large", "wrun_frame_memory", "wrun_frame_utf8"];
|
|
346
346
|
readonly pack: readonly ["wrun_cell_block_invalid", "wrun_run_cells_too_large", "wrun_cell_block_too_large"];
|
|
347
347
|
readonly align: readonly ["wrun_densify_empty_fetch", "wrun_densify_mixed_phase", "wrun_liquidation_side_unmatched", "wrun_bound_series_empty", "wrun_cell_data_malformed"];
|
|
@@ -508,10 +508,16 @@ export const WRUN_KIT_REFUSAL_STAGES = {
|
|
|
508
508
|
'wrun_strategy_slippage_model_unsupported',
|
|
509
509
|
'wrun_strategy_reserved_output',
|
|
510
510
|
'wrun_tape_min_size_invalid',
|
|
511
|
+
'wrun_tape_min_value_invalid',
|
|
512
|
+
'wrun_tape_floor_invalid',
|
|
511
513
|
// kit 0.81 to 0.85 (UW-PARITY): the US listed options classes' knobs, pins and venues.
|
|
512
514
|
'wrun_option_knob_invalid',
|
|
513
515
|
'wrun_option_market_pinned',
|
|
514
516
|
'wrun_option_prints_min_premium_required',
|
|
517
|
+
// kit 0.96.0 (OPTLOAD W3): a print class's union holds max_cells + newest, a bound a newest_tail_ms would lift.
|
|
518
|
+
'wrun_option_prints_tail_largest',
|
|
519
|
+
// kit 0.97.0 (OPTLOAD W3): a celled input's capacity no build writes (scaffold 97 writes it beside max_cells).
|
|
520
|
+
'wrun_cell_capacity_invalid',
|
|
515
521
|
'wrun_options_flow_venue_field',
|
|
516
522
|
'wrun_options_flow_venue_required',
|
|
517
523
|
'wrun_options_flow_venue_scope',
|
|
@@ -536,7 +542,11 @@ export const WRUN_KIT_REFUSAL_STAGES = {
|
|
|
536
542
|
// kit 0.88.0 (OPTIONS-PORT P7): the prints with their block and RFQ identity, a host that does not serve them.
|
|
537
543
|
'wrun_option_prints_v2_unsupported',
|
|
538
544
|
'wrun_option_stats_10m_unsupported',
|
|
545
|
+
// kit 0.89.0 (OPTLOAD G3): a host that does not serve the per-strike and per-expiry option flow.
|
|
546
|
+
'wrun_option_strike_flow_unsupported',
|
|
539
547
|
'wrun_option_surface_unsupported',
|
|
548
|
+
// kit 0.90.0 (OPTLOAD G5): a chain page view, surface pick or strike kit fold on a host that serves no view.
|
|
549
|
+
'wrun_option_views_unserved',
|
|
540
550
|
'wrun_options_flow_unsupported',
|
|
541
551
|
'wrun_field_unsupported',
|
|
542
552
|
'wrun_tenor_unsupported',
|
|
@@ -580,6 +590,7 @@ export const WRUN_KIT_REFUSAL_STAGES = {
|
|
|
580
590
|
'wrun_window_bars_invalid',
|
|
581
591
|
'wrun_cells_unavailable',
|
|
582
592
|
'wrun_tape_unavailable',
|
|
593
|
+
'wrun_tape_value_unproven',
|
|
583
594
|
'wrun_tape_interval_unsupported',
|
|
584
595
|
'wrun_metric_source_missing_policy',
|
|
585
596
|
'wrun_series_source_primary',
|
|
@@ -6,15 +6,16 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Resolution order (LK01, LK09): a word declared on the entry wins; then the
|
|
8
8
|
* viewer's pick on the Style page; then the row of the author's look; then
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* the `default` row (C4), whose surface and type are the stylesheet's
|
|
10
|
+
* (`data-look='default'`), read through the same variables.
|
|
11
11
|
*
|
|
12
12
|
* The look values travel as CSS custom properties on `.wrun-hud`
|
|
13
13
|
* (`--wrun-hud-bg`, `--wrun-hud-radius`, ...); the card's base rules in
|
|
14
|
-
* WrunHudLayer.vue read each one with
|
|
15
|
-
* `src/styles/wrun-hud-looks.scss` holds
|
|
16
|
-
* (frame parts, textures, letter case)
|
|
17
|
-
* palette a token resolves against is handed in by
|
|
14
|
+
* WrunHudLayer.vue read each one with a fallback, and
|
|
15
|
+
* `src/styles/wrun-hud-looks.scss` holds what a variable cannot carry
|
|
16
|
+
* (frame parts, textures, letter case) and the default look's values. Nothing
|
|
17
|
+
* here reads the DOM: the palette a token resolves against is handed in by
|
|
18
|
+
* the caller.
|
|
18
19
|
*
|
|
19
20
|
* Cost rules (LK10, D11 acceptance): no blur, no animation, no downloaded
|
|
20
21
|
* font. The serif and rounded stacks are the foundation's system stacks.
|
|
@@ -124,6 +125,12 @@ export interface WrunHudLookRow {
|
|
|
124
125
|
/** The split meter's rest: the theme's down colour, or the accent. */
|
|
125
126
|
splitRest?: 'down' | 'accent';
|
|
126
127
|
rowLeader?: WrunRowLeader;
|
|
128
|
+
/** The headline tile prints its label over the lead; false: on a titled card the title names the card
|
|
129
|
+
* and the headline prints none (the default look). */
|
|
130
|
+
headlineLabel?: boolean;
|
|
131
|
+
/** A rows tile leads a key with its output's colour swatch; false: the label alone, no dot that names
|
|
132
|
+
* no sign (the default look). */
|
|
133
|
+
rowSwatch?: boolean;
|
|
127
134
|
/** Frame. */
|
|
128
135
|
chrome: WrunHudChrome;
|
|
129
136
|
/** The title ink on a `title_bar` chrome. */
|
|
@@ -145,9 +152,10 @@ export interface WrunHudLookRow {
|
|
|
145
152
|
labelOpacity?: number;
|
|
146
153
|
};
|
|
147
154
|
}
|
|
148
|
-
/** The frozen look table (g3 addendum, "The look table"). `default` is
|
|
149
|
-
*
|
|
150
|
-
*
|
|
155
|
+
/** The frozen look table (g3 addendum, "The look table"). `default` is the
|
|
156
|
+
* house look (C4), worn by every card without a look word: sentence case,
|
|
157
|
+
* pills as words, no row swatch, no label over a titled card's headline; its
|
|
158
|
+
* surface and type are the stylesheet's. Where the table names no accent and the look's mock
|
|
151
159
|
* paints one colour throughout, the row carries that colour as its accent
|
|
152
160
|
* (broadsheet newsprint ink, classic's navy, phosphor's green): without it
|
|
153
161
|
* LK03 would hand the look the app's accent (glass keeps the app's: its
|
|
@@ -180,7 +188,7 @@ export interface WrunHudOffsetPx {
|
|
|
180
188
|
/** What one entry resolves to: the words a tile and the layer read, and the
|
|
181
189
|
* inline style of `.wrun-hud`. */
|
|
182
190
|
export interface WrunHudResolvedStyle {
|
|
183
|
-
/** The look in force
|
|
191
|
+
/** The look in force: the viewer's pick, else the author's, else `default` (the resolver always sets it). */
|
|
184
192
|
look?: WrunHudLook;
|
|
185
193
|
authorLook?: WrunHudLook;
|
|
186
194
|
viewerPick?: WrunHudLook;
|
|
@@ -198,6 +206,10 @@ export interface WrunHudResolvedStyle {
|
|
|
198
206
|
sparkHeight?: number;
|
|
199
207
|
sparkBaseline?: 'zero' | 'mark';
|
|
200
208
|
rowLeader?: WrunRowLeader;
|
|
209
|
+
/** Present (false) when the look prints no label over a titled card's headline. */
|
|
210
|
+
headlineLabel?: false;
|
|
211
|
+
/** Present (false) when the look draws no colour swatch beside a row's key. */
|
|
212
|
+
rowSwatch?: false;
|
|
201
213
|
/** DW22: the declared offset the `css` carries as `left`/`top`; the layer
|
|
202
214
|
* clamps it into the pane (item 29). Absent without a valid offset. */
|
|
203
215
|
offset?: WrunHudOffsetPx;
|
|
@@ -217,26 +229,30 @@ export declare function wrunHudOffsetCss(offset: WrunHudOffsetPx): Record<string
|
|
|
217
229
|
* (an invisible card must never trap a click meant for the chart). */
|
|
218
230
|
export declare function wrunHudPointerFree(style: Pick<WrunHudResolvedStyle, 'opacity'>): boolean;
|
|
219
231
|
/**
|
|
220
|
-
* The style of one HUD entry: declared word > viewer pick > look row
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
* entry without a look and without a word resolves to an
|
|
232
|
+
* The style of one HUD entry: declared word > viewer pick > look row, the
|
|
233
|
+
* `default` row when neither the viewer nor the author named a look (LK01,
|
|
234
|
+
* LK09, C4). Every value lands in `css` as a custom property the card's base
|
|
235
|
+
* rules read, so an entry without a look and without a word resolves to an
|
|
236
|
+
* empty `css`: the default look's surface and type are the stylesheet's.
|
|
224
237
|
*/
|
|
225
238
|
export declare function resolveWrunHudLook(entry: WrunHudStyleEntry, options?: WrunHudResolveOptions): WrunHudResolvedStyle;
|
|
226
239
|
/** The look defaults one tile takes when it declares none (LK04 draw, LK05
|
|
227
|
-
* height, the signal zero line, the broadsheet row leaders
|
|
240
|
+
* height, the signal zero line, the broadsheet row leaders, the default
|
|
241
|
+
* look's rows without swatches). */
|
|
228
242
|
export interface WrunHudTileLookDefaults {
|
|
229
243
|
draw?: string;
|
|
230
244
|
height?: number;
|
|
231
245
|
baseline?: number;
|
|
232
246
|
leader?: WrunRowLeader;
|
|
247
|
+
/** Rows: the look draws no swatch beside a key. */
|
|
248
|
+
swatch?: false;
|
|
233
249
|
}
|
|
234
250
|
/**
|
|
235
251
|
* The defaults the look in force gives a tile of `kind` (undefined fields
|
|
236
|
-
* keep
|
|
252
|
+
* keep the kit's own drawing). `cardMark` is the card's first meter mark, the
|
|
237
253
|
* baseline spark bars grow from on a look that says so.
|
|
238
254
|
*/
|
|
239
|
-
export declare function wrunHudTileLookDefaults(style: Pick<WrunHudResolvedStyle, 'draws' | 'sparkHeight' | 'sparkBaseline' | 'rowLeader'>, kind: WrunHoverBlock['kind'], cardMark?: number): WrunHudTileLookDefaults;
|
|
255
|
+
export declare function wrunHudTileLookDefaults(style: Pick<WrunHudResolvedStyle, 'draws' | 'sparkHeight' | 'sparkBaseline' | 'rowLeader' | 'rowSwatch'>, kind: WrunHoverBlock['kind'], cardMark?: number): WrunHudTileLookDefaults;
|
|
240
256
|
/** The luminance of a palette's background, read as a light theme above
|
|
241
257
|
* 0.5; an unreadable colour counts as dark (the chart's default). */
|
|
242
258
|
export declare function wrunHudThemeIsLight(theme: WrunColorTheme | undefined): boolean;
|