@orangecharts/wrun-chart-host 0.8.0 → 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 +2 -1
- package/dist/constants/feature-flags.constants.d.ts +4 -0
- package/dist/constants/feature-flags.constants.js +27 -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 +11 -6
- package/dist/constants/option-venues.constants.js +5 -2
- package/dist/host-env.d.ts +10 -4
- package/dist/host-ports.types.d.ts +39 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/interfaces/opra-realtime.interface.d.ts +13 -11
- package/dist/interfaces/opra-realtime.interface.js +10 -10
- package/dist/interfaces/wrun-runtime.interface.d.ts +34 -13
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +53 -10
- package/dist/kscript-data/controls/live-trades-merge.util.js +81 -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/utility/chart/crypto-index.leaf.d.ts +2 -2
- package/dist/utility/chart/crypto-index.leaf.js +2 -2
- 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 +30 -24
- 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.js +6 -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/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/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/row-lane-registry.js +3 -2
- 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 +11 -0
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +63 -9
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +8 -0
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +12 -0
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +5 -2
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +5 -2
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +11 -5
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +31 -10
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +33 -1
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +95 -6
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +25 -5
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +55 -18
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +146 -40
- 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-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 +15 -4
- package/dist/utility/wrun/wrun-color-settings.util.js +31 -12
- 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 +6 -1
- package/dist/utility/wrun/wrun-draft-overlay.util.js +23 -3
- 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 +7 -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-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.js +91 -38
- 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 +166 -48
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +216 -33
- package/dist/utility/wrun/wrun-market-size-defaults.util.d.ts +51 -7
- package/dist/utility/wrun/wrun-market-size-defaults.util.js +314 -56
- package/dist/utility/wrun/wrun-option-prints.util.d.ts +41 -2
- package/dist/utility/wrun/wrun-option-prints.util.js +80 -13
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +3 -0
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +3 -0
- package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +23 -0
- package/dist/utility/wrun/wrun-option-strike-flow.util.js +55 -0
- package/dist/utility/wrun/wrun-option-views.util.d.ts +51 -7
- package/dist/utility/wrun/wrun-option-views.util.js +151 -28
- 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 +7 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +25 -1
- 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 +416 -171
- package/dist/utility/wrun/wrun-pack-widths.leaf.d.ts +4 -4
- package/dist/utility/wrun/wrun-pack-widths.leaf.js +4 -4
- package/dist/utility/wrun/wrun-pack.util.d.ts +7 -3
- package/dist/utility/wrun/wrun-pack.util.js +20 -9
- package/dist/utility/wrun/wrun-panel-style.util.d.ts +27 -15
- package/dist/utility/wrun/wrun-panel-style.util.js +42 -20
- 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-prefix-lanes.util.js +2 -2
- package/dist/utility/wrun/wrun-refusal.util.js +10 -1
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +7 -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 +126 -50
- package/dist/utility/wrun/wrun-tape-source.util.js +193 -68
- 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
|
@@ -95,10 +95,10 @@ import { bindWrunColorSettings } from './wrun-color-settings.lazy.js';
|
|
|
95
95
|
import { WRUN_LEVELS_COLOR_PICKED_KEY } from './wrun-style-flags.util.js';
|
|
96
96
|
import { WRUN_OPTION_LANE_WORDS, WRUN_OPTION_VIEWS, wrunOptionViewParamKnobs } from './wrun-option-views.util.js';
|
|
97
97
|
import { findWrunVisibilityTarget, wrunVisibilitySectionOfPrefix, wrunVisibilityTargetAt, } from './wrun-visibility-table.js';
|
|
98
|
-
import { isWrunHudViewerRowKey, packWrunColor, parseWrunColor,
|
|
98
|
+
import { isWrunHudViewerRowKey, packWrunColor, parseWrunColor, parseWrunHudViewerRowKey, WRUN_HEATMAP_SENSITIVITY_ROW_RE, wrunHudViewerRowKey, } from './wrun-color-facts.util.js';
|
|
99
99
|
// The key predicates and the colour parse are thin facts boot-path readers take without this
|
|
100
100
|
// module (wrun-color-facts.util); every name stays exported here for this module's readers.
|
|
101
|
-
export { isWrunHeatmapSensitivityRowKey, isWrunHudLookRowKey, isWrunHudPlaceRowKey, isWrunHudViewerRowKey, isWrunStyleRowKey, isWrunViewerRowKey, packWrunColor, parseWrunColor, WRUN_HUD_LOOK_ROW_PREFIX, WRUN_STYLE_ROW_PREFIX, } from './wrun-color-facts.util.js';
|
|
101
|
+
export { isWrunHeatmapSensitivityRowKey, isWrunHudLookRowKey, isWrunHudPlaceRowKey, isWrunHudViewerRowKey, isWrunStyleRowKey, isWrunViewerRowKey, packWrunColor, parseWrunColor, parseWrunHudViewerRowKey, WRUN_HUD_LOOK_ROW_PREFIX, WRUN_HUD_VIEWER_ROWS, WRUN_STYLE_ROW_PREFIX, wrunHudViewerRowKey, } from './wrun-color-facts.util.js';
|
|
102
102
|
/** The largest packed colour (rgb 0xffffff, alpha 1000 thousandths), below
|
|
103
103
|
* 2^34 and so exact in f64. */
|
|
104
104
|
const WRUN_PACKED_COLOR_MAX = 0xffffff * 1024 + 1000;
|
|
@@ -227,15 +227,14 @@ export function parseWrunStyleTarget(target) {
|
|
|
227
227
|
export function isWrunStyleTargetHidden(declaration) {
|
|
228
228
|
return isRecord(declaration) && declaration.visible === false;
|
|
229
229
|
}
|
|
230
|
-
/** A HUD's Look row (`hud:<name>:look
|
|
231
|
-
const WRUN_HUD_LOOK_ROW_SUFFIX = ':look';
|
|
230
|
+
/** A HUD's Look row (`hud:<name>:look`; every HUD viewer row's key and reader in wrun-color-facts.util). */
|
|
232
231
|
export function wrunHudLookRowKey(name) {
|
|
233
|
-
return
|
|
232
|
+
return wrunHudViewerRowKey(name, 'look');
|
|
234
233
|
}
|
|
235
234
|
/** A HUD Look row key read back: the HUD it belongs to. */
|
|
236
235
|
export function parseWrunHudLookRowKey(key) {
|
|
237
|
-
const
|
|
238
|
-
return
|
|
236
|
+
const parsed = parseWrunHudViewerRowKey(key);
|
|
237
|
+
return parsed?.row === 'look' ? { name: parsed.name } : undefined;
|
|
239
238
|
}
|
|
240
239
|
/** The viewer's Look pick for one HUD under the overlay's settings: the
|
|
241
240
|
* stored word, or undefined for "As made" (absent, empty, not a string).
|
|
@@ -252,7 +251,6 @@ export function wrunHudLookSetting(settings, name) {
|
|
|
252
251
|
* offset convention). `at` is when the move was made, so in a place shared
|
|
253
252
|
* with other cards the latest move sits outermost. Absent = where the script
|
|
254
253
|
* puts it. */
|
|
255
|
-
const WRUN_HUD_PLACE_ROW_SUFFIX = ':place';
|
|
256
254
|
const WRUN_HUD_PLACE_VALUE_RE = /^([a-z_]+)@(\d{1,16})(?::(-?\d{1,6}),(-?\d{1,6}))?$/;
|
|
257
255
|
const WRUN_HUD_PLACE_ANCHORS = [
|
|
258
256
|
'top_left',
|
|
@@ -266,7 +264,7 @@ const WRUN_HUD_PLACE_ANCHORS = [
|
|
|
266
264
|
'bottom_right',
|
|
267
265
|
];
|
|
268
266
|
export function wrunHudPlaceRowKey(name) {
|
|
269
|
-
return
|
|
267
|
+
return wrunHudViewerRowKey(name, 'place');
|
|
270
268
|
}
|
|
271
269
|
/** The viewer's Sensitivity for one heatmap (`heatmap:<name>:sensitivity`):
|
|
272
270
|
* a 0..100 slider position on the options heatmap's Subtle..Vivid map
|
|
@@ -304,9 +302,9 @@ export function wrunHeatmapSensitivityChanged(prev, next) {
|
|
|
304
302
|
}
|
|
305
303
|
return false;
|
|
306
304
|
}
|
|
307
|
-
/** A save whose every change is a HUD's viewer row (its Look pick, its place
|
|
308
|
-
* card reads, so no run, canvas paint or legend row depends on them.
|
|
309
|
-
* sends; its keys are compared with the overlay's current settings (`current`). */
|
|
305
|
+
/** A save whose every change is a HUD's viewer row (its Look pick, its place, its collapsed or shown
|
|
306
|
+
* flag): rows only the FE-drawn card reads, so no run, canvas paint or legend row depends on them.
|
|
307
|
+
* `patch` is what the save sends; its keys are compared with the overlay's current settings (`current`). */
|
|
310
308
|
export function onlyWrunHudViewerRowsChanged(current, patch) {
|
|
311
309
|
const before = flatSettings(current) ?? {};
|
|
312
310
|
const sent = flatSettings(patch) ?? {};
|
|
@@ -343,6 +341,27 @@ export function formatWrunHudPlace(place) {
|
|
|
343
341
|
export function wrunHudPlaceSetting(settings, name) {
|
|
344
342
|
return parseWrunHudPlace(flatSettings(settings)?.[wrunHudPlaceRowKey(name)]);
|
|
345
343
|
}
|
|
344
|
+
/** The dismissable HUD (C3): the viewer folds one card to its chip (`hud:<name>:collapsed`, true) or hides
|
|
345
|
+
* it (`hud:<name>:shown`, false; the Style page's Show row brings it back), viewer rows of the one list
|
|
346
|
+
* (WRUN_HUD_VIEWER_ROWS). Each holds a boolean; absent, null or anything else reads as unset: an expanded
|
|
347
|
+
* card that is shown. */
|
|
348
|
+
export function wrunHudCollapsedRowKey(name) {
|
|
349
|
+
return wrunHudViewerRowKey(name, 'collapsed');
|
|
350
|
+
}
|
|
351
|
+
export function wrunHudShownRowKey(name) {
|
|
352
|
+
return wrunHudViewerRowKey(name, 'shown');
|
|
353
|
+
}
|
|
354
|
+
function storedBoolean(raw) {
|
|
355
|
+
return typeof raw === 'boolean' ? raw : undefined;
|
|
356
|
+
}
|
|
357
|
+
/** The viewer's collapsed flag for one HUD under the overlay's settings: the stored boolean, or undefined (expanded). */
|
|
358
|
+
export function wrunHudCollapsedSetting(settings, name) {
|
|
359
|
+
return storedBoolean(flatSettings(settings)?.[wrunHudCollapsedRowKey(name)]);
|
|
360
|
+
}
|
|
361
|
+
/** The viewer's shown flag for one HUD under the overlay's settings: the stored boolean, or undefined (shown). */
|
|
362
|
+
export function wrunHudShownSetting(settings, name) {
|
|
363
|
+
return storedBoolean(flatSettings(settings)?.[wrunHudShownRowKey(name)]);
|
|
364
|
+
}
|
|
346
365
|
function isRecord(value) {
|
|
347
366
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
348
367
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The market facts' dollar unit reader as a port (C-DOLLAR). wrun-chart-market-facts.util binds it when it loads, so
|
|
3
|
+
* the live intake, which live-feed loads before the first candle, reads a market's dollar unit without the facts module
|
|
4
|
+
* in that closure (tests/perf/pre-candle-budget.spec.ts weighs it). A dollar tape's live session always follows its
|
|
5
|
+
* full run, which loads the facts module, so the reader is bound by then; unbound reads as not known yet.
|
|
6
|
+
*/
|
|
7
|
+
import type { WrunFactsMarket, WrunMarketDollarUnit } from './wrun-chart-market-facts.util.js';
|
|
8
|
+
export interface WrunDollarUnitReader {
|
|
9
|
+
/** The market's dollar unit (`wrunMarketDollarUnit`), synchronous over the reads `warm` settles. */
|
|
10
|
+
unit(market: WrunFactsMarket): WrunMarketDollarUnit;
|
|
11
|
+
/** Ask the reads the unit needs again (`warmWrunMarketDollarFacts`); never rejects. */
|
|
12
|
+
warm(market: WrunFactsMarket): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
/** Bind the reader: the facts module, once, when it loads. */
|
|
15
|
+
export declare function bindWrunDollarUnitReader(reader: WrunDollarUnitReader): void;
|
|
16
|
+
/** The bound reader, or undefined before the facts module loaded. */
|
|
17
|
+
export declare function wrunDollarUnitReader(): WrunDollarUnitReader | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
let bound;
|
|
2
|
+
/** Bind the reader: the facts module, once, when it loads. */
|
|
3
|
+
export function bindWrunDollarUnitReader(reader) {
|
|
4
|
+
bound = reader;
|
|
5
|
+
}
|
|
6
|
+
/** The bound reader, or undefined before the facts module loaded. */
|
|
7
|
+
export function wrunDollarUnitReader() {
|
|
8
|
+
return bound;
|
|
9
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -179,5 +179,10 @@ export declare function wrunKScriptSourceWeight(type: string | null): number;
|
|
|
179
179
|
export declare function wrunKScriptSourceOf(value: unknown): WrunKScriptSource | null;
|
|
180
180
|
/** The slot charge of a sheet in kScript's unit (the rule above): the
|
|
181
181
|
* weighted count of the distinct kScript sources its entries read, never
|
|
182
|
-
* 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. */
|
|
183
188
|
export declare function wrunMetadataSourceCount(metadata: WrunSourceCountMetadataLike): number;
|
|
@@ -383,13 +383,33 @@ export function wrunKScriptSourceOf(value) {
|
|
|
383
383
|
payload.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));
|
|
384
384
|
return { type, key: JSON.stringify([type ?? `wrun:${sourceClass}`, payload]), weight: wrunKScriptSourceWeight(type) };
|
|
385
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
|
+
}
|
|
386
399
|
/** The slot charge of a sheet in kScript's unit (the rule above): the
|
|
387
400
|
* weighted count of the distinct kScript sources its entries read, never
|
|
388
|
-
* 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. */
|
|
389
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);
|
|
390
410
|
const weights = new Map();
|
|
391
|
-
for (const value of
|
|
392
|
-
const source = wrunKScriptSourceOf(value);
|
|
411
|
+
for (const value of entries) {
|
|
412
|
+
const source = wrunKScriptSourceOf(printRead !== undefined && sumsChartChainPrints(value) ? printRead : value);
|
|
393
413
|
if (source !== null && !weights.has(source.key))
|
|
394
414
|
weights.set(source.key, source.weight);
|
|
395
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_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_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',
|
|
@@ -584,6 +590,7 @@ export const WRUN_KIT_REFUSAL_STAGES = {
|
|
|
584
590
|
'wrun_window_bars_invalid',
|
|
585
591
|
'wrun_cells_unavailable',
|
|
586
592
|
'wrun_tape_unavailable',
|
|
593
|
+
'wrun_tape_value_unproven',
|
|
587
594
|
'wrun_tape_interval_unsupported',
|
|
588
595
|
'wrun_metric_source_missing_policy',
|
|
589
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;
|