@orangecharts/wrun-chart-host 0.7.1 → 0.8.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 +25 -3
- package/dist/constants/feature-flags.constants.d.ts +1 -0
- package/dist/constants/feature-flags.constants.js +5 -0
- package/dist/constants/option-venues.constants.d.ts +18 -0
- package/dist/constants/option-venues.constants.js +14 -0
- 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 +24 -0
- package/dist/host-env.js +21 -0
- package/dist/host-ports.types.d.ts +12 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +16 -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/option-instrument.interface.d.ts +6 -0
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +4 -0
- package/dist/kscript-data/controls/live-trades-merge.util.js +4 -0
- 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/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/kscript-venue-policy.util.js +4 -2
- package/dist/utility/chart/om-panel.util.d.ts +11 -0
- package/dist/utility/chart/om-panel.util.js +59 -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/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/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 +9 -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_prints.d.ts +14 -1
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +100 -23
- 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 +47 -1
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +71 -2
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +14 -1
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +30 -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 +45 -5
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +115 -3
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +10 -0
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +57 -0
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +60 -6
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +160 -23
- 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-settings.util.d.ts +7 -5
- package/dist/utility/wrun/wrun-color-settings.util.js +26 -11
- package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +4 -2
- package/dist/utility/wrun/wrun-draft-overlay.util.js +40 -3
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +1 -1
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +4 -0
- 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-live-tick.util.d.ts +4 -1
- package/dist/utility/wrun/wrun-live-tick.util.js +39 -6
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +106 -0
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +159 -0
- package/dist/utility/wrun/wrun-market-size-defaults.util.d.ts +44 -0
- package/dist/utility/wrun/wrun-market-size-defaults.util.js +213 -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 +133 -3
- package/dist/utility/wrun/wrun-option-prints.util.js +318 -8
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +96 -0
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +215 -0
- package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +342 -0
- package/dist/utility/wrun/wrun-option-strike-flow.util.js +742 -0
- package/dist/utility/wrun/wrun-option-views.util.d.ts +183 -3
- package/dist/utility/wrun/wrun-option-views.util.js +504 -7
- 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-overlay-recovery.util.d.ts +2 -1
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +7 -2
- package/dist/utility/wrun/wrun-overlay-run.util.js +120 -18
- 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 +9 -8
- package/dist/utility/wrun/wrun-pack.util.js +21 -15
- 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 +17 -2
- package/dist/utility/wrun/wrun-panel-style.util.js +47 -9
- package/dist/utility/wrun/wrun-pin-spelling.util.js +19 -10
- package/dist/utility/wrun/wrun-refusal.util.js +7 -1
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +13 -0
- package/dist/utility/wrun/wrun-script-inputs.util.js +43 -0
- package/dist/utility/wrun/wrun-tape-source.util.d.ts +9 -0
- package/dist/utility/wrun/wrun-tape-source.util.js +18 -0
- package/package.json +3 -3
|
@@ -111,7 +111,8 @@ import { wrunRowLaneByKey, wrunRowLaneOfClass } from './sources/row-lane-registr
|
|
|
111
111
|
import { isWrunRowLaneId } from './sources/wrun-row-lane.types.js';
|
|
112
112
|
import { fetchWrunRowLaneRows, planWrunRowLanes, wrunRowLaneChainAsk, wrunRowLaneFetchOptions, wrunRowLaneInstanceReadsOpra, wrunRowLaneRequired, wrunRunSourceReachFromMs, } from './sources/wrun-row-lanes.util.js';
|
|
113
113
|
import { wrunOpraLanePayloadFields } from './wrun-opra-lane.util.js';
|
|
114
|
-
import { wrunLaneRefusedCodeOf } from './wrun-lane-refusal.leaf.js';
|
|
114
|
+
import { WRUN_LANE_REFUSED_SETTLE_REASON, wrunLaneRefusedCodeOf } from './wrun-lane-refusal.leaf.js';
|
|
115
|
+
import { TRADES_HISTORY_MAX_CELLS } from '../../kscript-data/controls/live-trades-merge.util.js';
|
|
115
116
|
import { warmWrunEarningsFacts, wrunEarningsFactsFor, wrunReadsEarningsFacts, } from './wrun-earnings-facts.util.js';
|
|
116
117
|
import { liveBucketStartsInRange, liveBucketVenueOf } from '../chart/live-bucket.util.js';
|
|
117
118
|
import { hostBucketResolverFor } from '../chart/host-bar-placement.util.js';
|
|
@@ -139,6 +140,8 @@ import { isWrunTradesLegLane, WRUN_TRADES_LANES, wrunTradesLegExtras, wrunTrades
|
|
|
139
140
|
import { substituteWrunChartNames, wrunChartContextHostFill, wrunChartIntervalMsOf, } from './wrun-chart-context.util.js';
|
|
140
141
|
import { warmWrunMarketFacts, wrunChartSizeUnit, wrunLaneDemandNeedsDirectory, wrunMarketFactsFor, wrunMarketFactsNeedDirectory, wrunReadsMarketFacts, wrunCoinLegsOf, wrunCoinLegVenues, wrunSheetWithCoinLegs, wrunSheetWithLaneCurrencies, wrunSheetWithLaneDemand, wrunSheetWithLaneGate, } from './wrun-chart-market-facts.util.js';
|
|
141
142
|
import { wrunFollowsCoin, wrunInputGateOn, wrunRowVisibleHere } from './wrun-market-facts.util.js';
|
|
143
|
+
import { wrunRowsKeepingMarketDefaults } from './wrun-market-size-defaults.leaf.js';
|
|
144
|
+
import { reconcileWrunMarketSizeDefaults } from './wrun-market-size-defaults.util.js';
|
|
142
145
|
import { rememberWrunSessionChartNames, resolveWrunChartNames, wrunSessionChartNamesOf, } from './wrun-chart-context-names.util.js';
|
|
143
146
|
import { assertWrunBrowserSources, getWrunBrowserHost, } from './wrun-host.service.js';
|
|
144
147
|
import { applyWrunInertLegendState } from './wrun-inert-legend.util.js';
|
|
@@ -176,7 +179,7 @@ import { governedMarketDataTier, governedOptionSummaryTier } from '../v2/governe
|
|
|
176
179
|
import { awaitWrunChildOverlays, mountWrunChildOverlays, prepareWrunHeatmapWindowLanding, WrunStaleLandingError, } from './wrun-panel-mount.util.js';
|
|
177
180
|
import { planWrunFormingPreRoll, planWrunIntrabarLegFetch, planWrunLegFetch, wrunClampedLegDiagnostics, wrunIntrabarServedNotes, wrunLegFetchReads, } from './wrun-leg-fetch.util.js';
|
|
178
181
|
import { barEndMs, isCalendarIntervalLabel, isCalendarIntervalMs } from '../chart/calendar-interval.util.js';
|
|
179
|
-
import { resolveWrunTapeAcquisition, WRUN_TAPE_INTERVAL_UNSUPPORTED_CODE, wrunTapeFloorSettings, } from './wrun-tape-source.util.js';
|
|
182
|
+
import { resolveWrunTapeAcquisition, WRUN_TAPE_INTERVAL_UNSUPPORTED_CODE, WRUN_TAPE_TOO_MANY_TRADES_CODE, wrunTapeFloorSettingWords, wrunTapeFloorSettings, } from './wrun-tape-source.util.js';
|
|
180
183
|
import { wrunChartSession, wrunLegCandleClose, wrunPrimaryRowBounds } from './wrun-leg-close.util.js';
|
|
181
184
|
import { isWrunRowSourceTransientError, wrunRowBatchDeliveredSheet, wrunRowSourceSettingsLeftBy, } from './wrun-row-source.js';
|
|
182
185
|
import { wrunOverlayOpraStamped } from './wrun-cloud-opra-stamp.util.js';
|
|
@@ -203,6 +206,7 @@ import { attachWrunLive, wrunLiveOf, } from '../../interfaces/wrun-runtime.inter
|
|
|
203
206
|
import { normalizeRuntimeDiagnostics, shouldNoticeWrunRefusal, WRUN_RUN_FAILURE_ROW_CODES, WRUN_RUN_TIMEOUT_CODE, wrunAbortRuntimeDiagnostic, wrunRunFailureRuntimeDiagnostic, } from '../scriptEditor/wrun-runtime-diagnostics.leaf.js';
|
|
204
207
|
import { buildWrunOverlayRunResult, withCanvasHostFill, } from './wrun-overlay-result.util.js';
|
|
205
208
|
import { applyWrunIntegrationBudgetPolicy, wrunIntegratedRowsView } from './wrun-integration-budget.util.js';
|
|
209
|
+
import { cmeOptionsContract } from '../options/cme-options-root.util.js';
|
|
206
210
|
// The result build lives in wrun-overlay-result.util (the result reader core); its importers keep this path.
|
|
207
211
|
export { buildWrunOverlayRunResult };
|
|
208
212
|
// The integration budget's pure policy lives in wrun-integration-budget.util; its view keeps this path too.
|
|
@@ -478,6 +482,25 @@ export async function runWrunOverlayOnChart(target) {
|
|
|
478
482
|
const hostLoading = ensureWrunChartHostSharedHost();
|
|
479
483
|
if (hostLoading)
|
|
480
484
|
await hostLoading;
|
|
485
|
+
// A size threshold the package scales with the market (Big Trades' Min size and Whale size,
|
|
486
|
+
// wrun-market-size-defaults.leaf) moves to this market's default before anything reads the settings: once per
|
|
487
|
+
// mount and market, a value the user changed kept, the engine copy and the workspace row one record. Its tape
|
|
488
|
+
// then asks a floor the market's volume sized (10 ETH kept 487,132 prints over seven days, past the worker's
|
|
489
|
+
// cap), and the panel's reset goes to the same default. It reads its facts for the market this run computes for
|
|
490
|
+
// (C4's identity and reader), proven after each of its awaits. Full runs only: a pan page computes beside the rows
|
|
491
|
+
// and the live session the full run drew at its floor, and a move here would draw the page at another one (no
|
|
492
|
+
// save follows `updateSettings`, so nothing would rerun the rest).
|
|
493
|
+
if (prefixWindow === undefined) {
|
|
494
|
+
await reconcileWrunMarketSizeDefaults({
|
|
495
|
+
chartIndex: target.chartIndex,
|
|
496
|
+
indicatorId: target.indicatorId,
|
|
497
|
+
tc,
|
|
498
|
+
meta,
|
|
499
|
+
sheet: target.metadata,
|
|
500
|
+
market,
|
|
501
|
+
isCurrent,
|
|
502
|
+
});
|
|
503
|
+
}
|
|
481
504
|
// The coin legs (kit 0.77.0, `follow: "coin"`) this run reads, resolved on the chart's coin by
|
|
482
505
|
// the native venue resolver before anything reads the sheet, so each is a literal pin or an
|
|
483
506
|
// undemanded input past this point; a switch re-runs the overlay through here, so the legs
|
|
@@ -702,8 +725,14 @@ function wrunRunSettleOf(error) {
|
|
|
702
725
|
return { outcome: 'held', reason: error.hold };
|
|
703
726
|
if (error instanceof WrunVenueBlockedError)
|
|
704
727
|
return { outcome: 'held', reason: 'venue-blocked' };
|
|
705
|
-
|
|
706
|
-
|
|
728
|
+
// A hold on a lane refused by name says so: the store's settings reconcile reads "Not applied" at once (the
|
|
729
|
+
// same settings ask the same read), where a hold on a slow or failed lane gets its reruns.
|
|
730
|
+
if (isWrunSourceHold(error)) {
|
|
731
|
+
return {
|
|
732
|
+
outcome: 'held',
|
|
733
|
+
reason: wrunRefusedSourceHolds.has(error) ? WRUN_LANE_REFUSED_SETTLE_REASON : 'source-hold',
|
|
734
|
+
};
|
|
735
|
+
}
|
|
707
736
|
return { outcome: 'failed', reason: error instanceof Error ? error.message : String(error) };
|
|
708
737
|
}
|
|
709
738
|
/** Whether a failed run's rejection carries a refusal record: every one but the quiet rejections
|
|
@@ -878,6 +907,9 @@ catch {
|
|
|
878
907
|
/** The source holds this pass threw (a degraded lane an input reads under a
|
|
879
908
|
* carry or zero policy): retryable, with no toast and no chip of their own. */
|
|
880
909
|
const wrunSourceHolds = new WeakSet();
|
|
910
|
+
/** The source holds on a lane the data plane refused by name (wrun-lane-refusal.leaf): the same settings meet
|
|
911
|
+
* the same refusal, so they settle as `WRUN_LANE_REFUSED_SETTLE_REASON` (wrunRunSettleOf). */
|
|
912
|
+
const wrunRefusedSourceHolds = new WeakSet();
|
|
881
913
|
function isWrunSourceHold(error) {
|
|
882
914
|
return typeof error === 'object' && error !== null && wrunSourceHolds.has(error);
|
|
883
915
|
}
|
|
@@ -1346,6 +1378,37 @@ function wrunSourceGivenUpOf(outcome) {
|
|
|
1346
1378
|
}
|
|
1347
1379
|
return outcome.cause === 'budget' ? WRUN_SOURCE_GIVEN_UP.budget : WRUN_SOURCE_GIVEN_UP.failed;
|
|
1348
1380
|
}
|
|
1381
|
+
/**
|
|
1382
|
+
* The record each refusal BY NAME a row-builder lane's worker twin may answer (wrun-lane-refusal.leaf), by lane and
|
|
1383
|
+
* code, built from the run's facts: the row-builder lanes' counterpart of a poll lane's `refusedAnswers`. A code
|
|
1384
|
+
* without a record reads as the lane's source declining the market (`source-declined`, Remove), so a lane whose worker
|
|
1385
|
+
* refuses by name names its record here.
|
|
1386
|
+
*/
|
|
1387
|
+
const WRUN_BUILTIN_LANE_REFUSED_ANSWERS = {
|
|
1388
|
+
// The tape's history held more prints at its floor than the trades worker reads (k-trades.worker, the large lane):
|
|
1389
|
+
// too much data, with the cap, the floor and the history's days (seven for Big Trades), and the way out raises the
|
|
1390
|
+
// floor in the settings. Never Remove: the market serves the tape, the floor was too low for it.
|
|
1391
|
+
tape: {
|
|
1392
|
+
[WRUN_TAPE_TOO_MANY_TRADES_CODE]: ({ metadata, tape }) => ({
|
|
1393
|
+
cls: 'too-big',
|
|
1394
|
+
variant: 'tape',
|
|
1395
|
+
params: {
|
|
1396
|
+
max: TRADES_HISTORY_MAX_CELLS,
|
|
1397
|
+
setting: wrunTapeFloorSettingWords(metadata),
|
|
1398
|
+
min: tape?.minSize ?? 0,
|
|
1399
|
+
n: tape === undefined ? 0 : Math.round((tape.historySeconds / 86_400) * 10) / 10,
|
|
1400
|
+
},
|
|
1401
|
+
out: { kind: 'open-settings' },
|
|
1402
|
+
}),
|
|
1403
|
+
},
|
|
1404
|
+
};
|
|
1405
|
+
/** The seed a row-builder lane declares for a refusal by name, or undefined (a poll lane, an undeclared code). */
|
|
1406
|
+
function wrunBuiltinLaneRefusedSeed(lane, code, facts) {
|
|
1407
|
+
if (!Object.hasOwn(WRUN_BUILTIN_LANE_REFUSED_ANSWERS, lane))
|
|
1408
|
+
return undefined;
|
|
1409
|
+
const answers = WRUN_BUILTIN_LANE_REFUSED_ANSWERS[lane];
|
|
1410
|
+
return answers !== undefined && Object.hasOwn(answers, code) ? answers[code](facts) : undefined;
|
|
1411
|
+
}
|
|
1349
1412
|
/**
|
|
1350
1413
|
* The record a degraded lane shows once the source ladder gives up on it: the code of what it was
|
|
1351
1414
|
* (`wrunSourceGivenUpOf`: `wrun_source_budget`, `wrun_source_failed`, `wrun_source_declined`) in the
|
|
@@ -1353,7 +1416,9 @@ function wrunSourceGivenUpOf(outcome) {
|
|
|
1353
1416
|
* and the matching cause stamped (`telemetry.cause`: `source-budget`, `source-failed`,
|
|
1354
1417
|
* `source-declined`), so the record and `wrun_failure_shown` tell a slow source from a broken or an
|
|
1355
1418
|
* absent one; a note when the run drew around the lane, paused when it held on it; its details
|
|
1356
|
-
* today's words for the lane (the hold's sentence).
|
|
1419
|
+
* today's words for the lane (the hold's sentence). An answer the data plane refused by name reads in
|
|
1420
|
+
* the record its lane declares for the code (a poll lane's `refusedAnswers`, a row-builder lane's
|
|
1421
|
+
* WRUN_BUILTIN_LANE_REFUSED_ANSWERS).
|
|
1357
1422
|
*/
|
|
1358
1423
|
function wrunTerminalDegradeRefusalFor(args) {
|
|
1359
1424
|
const instance = args.pollLanes.find((candidate) => candidate.key === args.lane);
|
|
@@ -1369,7 +1434,9 @@ function wrunTerminalDegradeRefusalFor(args) {
|
|
|
1369
1434
|
}
|
|
1370
1435
|
// An answer the data plane refused by name reads in the record its lane declares for that refusal.
|
|
1371
1436
|
const refused = wrunLaneRefusedCodeOf(args.outcome.error);
|
|
1372
|
-
const declared = refused === undefined
|
|
1437
|
+
const declared = refused === undefined
|
|
1438
|
+
? undefined
|
|
1439
|
+
: (pollLane?.refusedAnswers?.[refused] ?? wrunBuiltinLaneRefusedSeed(args.lane, refused, args.facts));
|
|
1373
1440
|
if (declared !== undefined) {
|
|
1374
1441
|
return wrunSeededRefusal({ ...declared, params: { feed, ...declared.params }, severity }, wrunLaneDegradeMessage(args.title, wrunLaneSourceOf(args.lane, args.pollLanes), args.outcome), args.ctx);
|
|
1375
1442
|
}
|
|
@@ -2176,6 +2243,10 @@ async function prepareWrunSandboxRun(passTarget, tc, meta, refusal, computed, ow
|
|
|
2176
2243
|
// The OPRA-plane predicate an OPRA lane is admitted by (loaded only when the sheet reads one).
|
|
2177
2244
|
const opraPlaneFacts = wrunOpraPlaneFacts(target.metadata);
|
|
2178
2245
|
const opraFacts = { official: head.official, opraUserScripts: head.opraUserScripts };
|
|
2246
|
+
// The overlay's current setting values, read once for both planners: an option knob naming a setting
|
|
2247
|
+
// (`min_premium: "@floor"`) asks with the setting's value, and a settings change re-plans with the new one
|
|
2248
|
+
// (wrun-poll-lanes.util `resolveWrunOptionSettingKnobs`, before a poll lane's plan and a row lane's facets).
|
|
2249
|
+
const laneParamValues = wrunParamValuesFromSettings(target.metadata, view.settings);
|
|
2179
2250
|
// The chart's category rides along: a chain poll lane resolves the chart's chain with it, as the row lanes do.
|
|
2180
2251
|
const planPollLanes = (readsChain) => {
|
|
2181
2252
|
const sheet = wrunSheetForLaneGroup(target.metadata, (sourceClass) => wrunPollLanesOfClass(sourceClass).length > 0, (sourceClass) => wrunPollClassReadsChain(sourceClass) === readsChain);
|
|
@@ -2187,7 +2258,7 @@ async function prepareWrunSandboxRun(passTarget, tc, meta, refusal, computed, ow
|
|
|
2187
2258
|
symbol: pickText(chartMetadata?.symbol),
|
|
2188
2259
|
category: chartMetadata?.category,
|
|
2189
2260
|
intervalMs: clock.intervalMs,
|
|
2190
|
-
}, checkIsIndexMode, isWrunCryptoVenueExchange, { ...opraFacts, ...(opraPlane !== undefined ? opraPlane : {}) }));
|
|
2261
|
+
}, checkIsIndexMode, isWrunCryptoVenueExchange, { ...opraFacts, ...(opraPlane !== undefined ? opraPlane : {}), paramValues: laneParamValues }));
|
|
2191
2262
|
};
|
|
2192
2263
|
// The row lanes' plan (sources/row-lane-registry.ts: one celled descriptor per class), before any of its fetches,
|
|
2193
2264
|
// beside the poll lanes': the OPRA wall, the chart's admission (a governed OPRA lane where the chart's
|
|
@@ -2195,6 +2266,8 @@ async function prepareWrunSandboxRun(passTarget, tc, meta, refusal, computed, ow
|
|
|
2195
2266
|
// index-mode charts), the lane's identity and each input's facets, grouped into instances; an input of a
|
|
2196
2267
|
// lane the chart never serves that declared `missing: "empty"` is dropped and named in `missingFeeds`.
|
|
2197
2268
|
// The chart's category rides along: a chain lane resolves the chart's chain with it, as the options chain lane does.
|
|
2269
|
+
// The setting values ride as they do for the poll lanes: a row lane's knob naming a setting (`strike_rows`,
|
|
2270
|
+
// `min_premium`, a print filter) asks with its value instead of being refused by name.
|
|
2198
2271
|
const chartCategory = chartMetadata?.category;
|
|
2199
2272
|
const planRowLanes = (readsChain) => {
|
|
2200
2273
|
const sheet = wrunSheetForLaneGroup(target.metadata, (sourceClass) => wrunRowLaneOfClass(sourceClass) !== undefined, (sourceClass) => wrunRowClassReadsChain(sourceClass) === readsChain);
|
|
@@ -2210,7 +2283,7 @@ async function prepareWrunSandboxRun(passTarget, tc, meta, refusal, computed, ow
|
|
|
2210
2283
|
isCryptoVenueExchange: isWrunCryptoVenueExchange,
|
|
2211
2284
|
isOpraPlaneExchange: opraPlane?.isOpraPlaneExchange,
|
|
2212
2285
|
opraPlaneStop: opraPlane?.opraPlaneStop,
|
|
2213
|
-
}, opraFacts));
|
|
2286
|
+
}, { ...opraFacts, paramValues: laneParamValues }));
|
|
2214
2287
|
};
|
|
2215
2288
|
const pollPlannedLocal = planPollLanes(false);
|
|
2216
2289
|
const rowPlannedLocal = planRowLanes(false);
|
|
@@ -3534,6 +3607,7 @@ async function prepareWrunSandboxRun(passTarget, tc, meta, refusal, computed, ow
|
|
|
3534
3607
|
title: target.title,
|
|
3535
3608
|
ctx: refusal.ctx,
|
|
3536
3609
|
gateStop: gateStops.get(lane),
|
|
3610
|
+
facts: { metadata: target.metadata, ...(tape !== undefined ? { tape } : {}) },
|
|
3537
3611
|
}),
|
|
3538
3612
|
}));
|
|
3539
3613
|
for (const { lane, outcome } of laneRun.outcomes) {
|
|
@@ -3645,10 +3719,19 @@ async function prepareWrunSandboxRun(passTarget, tc, meta, refusal, computed, ow
|
|
|
3645
3719
|
// caller reading it (the editor console, the run's own catch) offers the take-back, never a Retry that cannot
|
|
3646
3720
|
// serve it.
|
|
3647
3721
|
const stopped = holding.find(({ lane }) => gateStops.has(lane));
|
|
3648
|
-
|
|
3722
|
+
// A lane the data plane refused by name names the hold the same way (its record: the tape over the trades
|
|
3723
|
+
// worker's cap reads too much data with Open the settings, never a Retry), and the hold settles as a refusal
|
|
3724
|
+
// the same settings meet again (`wrunRefusedSourceHolds`): the settings reconcile spends no rerun on it.
|
|
3725
|
+
const refused = stopped === undefined
|
|
3726
|
+
? holding.find(({ outcome }) => wrunLaneRefusedCodeOf(outcome.error) !== undefined)
|
|
3727
|
+
: undefined;
|
|
3728
|
+
const shown = stopped ?? refused ?? holding[0];
|
|
3649
3729
|
const hold = wrunSourceHoldError(target.title, wrunLaneSourceOf(shown.lane, laneInstances), shown.outcome);
|
|
3650
|
-
|
|
3651
|
-
|
|
3730
|
+
if (refused !== undefined)
|
|
3731
|
+
wrunRefusedSourceHolds.add(hold);
|
|
3732
|
+
const named = stopped ?? refused;
|
|
3733
|
+
const namedRecord = named !== undefined ? refusal.degraded?.find(({ lane }) => lane === named.lane)?.refusal : undefined;
|
|
3734
|
+
throw namedRecord !== undefined ? annotateWrunErrorRefusal(hold, namedRecord) : hold;
|
|
3652
3735
|
}
|
|
3653
3736
|
// The exact warm-up session's head, asked beside the lanes above: a head that cannot be had runs the existing
|
|
3654
3737
|
// cold path unchanged and records no warmth. A deferred head (draw first) is not awaited: the run is cold now
|
|
@@ -5342,7 +5425,10 @@ async function reconcileWrunSourceRecord(chartIndex, tc, indicatorId, meta, shee
|
|
|
5342
5425
|
await wrunChartHostEnv().chart.raiseSlotCharge(chartIndex, tc, indicatorId, meta, sheet);
|
|
5343
5426
|
let declarationsMoved = false;
|
|
5344
5427
|
try {
|
|
5345
|
-
|
|
5428
|
+
// A market-scaled param's row keeps the default the run head moved it to (wrun-market-size-defaults.util): the
|
|
5429
|
+
// sheet's own (Big Trades' 10) is no record's default off its market, and a value at the market's would read as
|
|
5430
|
+
// changed.
|
|
5431
|
+
const scriptInputs = wrunRowsKeepingMarketDefaults(buildWrunScriptInputs(sheet), settingsObjectOf(meta).scriptInputs, wrunRegistryRefOf(meta.settings)?.package);
|
|
5346
5432
|
const enginePatch = wrunSourceRecordPatchOf(meta.settings, scriptInputs);
|
|
5347
5433
|
if (enginePatch !== undefined) {
|
|
5348
5434
|
const chart = tc;
|
|
@@ -7514,10 +7600,10 @@ function wrunOptionsChainExtrasGoverned(extras) {
|
|
|
7514
7600
|
* the gateway's scope inputs in place of a scope (`chainNearestExpiries`,
|
|
7515
7601
|
* `chainMaxContracts`, O2: the gateway sizes B on its page, so no expiry
|
|
7516
7602
|
* directory is read here or in the worker); the chain's inputs read views all,
|
|
7517
|
-
* or none.
|
|
7603
|
+
* or none, and its view inputs one expiries word (one block B for the lane).
|
|
7518
7604
|
*/
|
|
7519
7605
|
async function wrunOptionsChainLaneExtrasFor(metadata, chartMetadata, official, opraUserScripts) {
|
|
7520
|
-
const [{ decideWrunLaneChainIdentity, resolveWrunChartChain }, { hasDeribitOptions }, { resolveWrunOptionsChainCryptoVenues }, { WRUN_OPTION_VIEWS_ONE_ASK_CODE, wrunHeldOpraPlaneChain, wrunOptionViewLaneFields, wrunOptionViewsOfSource, wrunOptionViewsUnion, },] = await Promise.all([
|
|
7606
|
+
const [{ decideWrunLaneChainIdentity, resolveWrunChartChain }, { hasDeribitOptions }, { resolveWrunOptionsChainCryptoVenues }, { WRUN_OPTION_VIEWS_ONE_ASK_CODE, WRUN_OPTION_VIEWS_ONE_EXPIRIES_CODE, wrunHeldOpraPlaneChain, wrunOptionViewLaneFields, wrunOptionViewsOfSource, wrunOptionViewsUnion, },] = await Promise.all([
|
|
7521
7607
|
import('./sources/opra-option-lanes.util.js'),
|
|
7522
7608
|
wrunChartHostEnv().market.loadDeribitOptions(),
|
|
7523
7609
|
wrunChartHostEnv().market.loadOptionsChainVenues(),
|
|
@@ -7588,8 +7674,23 @@ async function wrunOptionsChainLaneExtrasFor(metadata, chartMetadata, official,
|
|
|
7588
7674
|
'views on both, or on neither'), wrunAuthorRuleSeed(WRUN_OPTION_VIEWS_ONE_ASK_CODE));
|
|
7589
7675
|
}
|
|
7590
7676
|
if (firstWithViews >= 0) {
|
|
7591
|
-
//
|
|
7592
|
-
//
|
|
7677
|
+
// One block B for the lane, built for one expiries word: view inputs of two words would read views of one B, so
|
|
7678
|
+
// the lane refuses by name (the SDK asks each word apart; one acquisition per word would serve them).
|
|
7679
|
+
const wordOf = (at) => {
|
|
7680
|
+
const expiries = laneInputs[at].expiries;
|
|
7681
|
+
if (expiries === undefined)
|
|
7682
|
+
return String(metadata.inputSources[chainInputs[at].name]?.expiries);
|
|
7683
|
+
return expiries.kind === 'nearest' ? `nearest:${expiries.count}` : 'all';
|
|
7684
|
+
};
|
|
7685
|
+
const otherWord = chainInputs.findIndex((_, at) => wordOf(at) !== wordOf(0));
|
|
7686
|
+
if (otherWord > 0) {
|
|
7687
|
+
throw attachWrunRefusal(new Error(`WRUN ${metadata.id}: inputs '${chainInputs[0].name}' and '${chainInputs[otherWord].name}' read one ` +
|
|
7688
|
+
`options_chain lane through views with expiries '${wordOf(0)}' and '${wordOf(otherWord)}' ` +
|
|
7689
|
+
`(${WRUN_OPTION_VIEWS_ONE_EXPIRIES_CODE}): declare the same expiries on every view input of one ` +
|
|
7690
|
+
'options_chain lane (this host builds one block for the lane)'), wrunAuthorRuleSeed(WRUN_OPTION_VIEWS_ONE_EXPIRIES_CODE));
|
|
7691
|
+
}
|
|
7692
|
+
// A view ask on any chain: the gateway sizes B on its page from the inputs' one expiries word (its `nearest:N`,
|
|
7693
|
+
// none when they read every expiry) and budget (the smallest max_cells) (O2).
|
|
7593
7694
|
const nearest = laneInputs.flatMap((input) => (input.expiries?.kind === 'nearest' ? [input.expiries.count] : []));
|
|
7594
7695
|
const budgets = laneInputs
|
|
7595
7696
|
.map((input) => Number(input.maxCells))
|
|
@@ -7676,7 +7777,8 @@ async function wrunGovernedLiveExpiryCount(identity) {
|
|
|
7676
7777
|
* The underlying a governed chain's expiry directory is listed for: the chain's own, or, for a
|
|
7677
7778
|
* continuous alias (`ES1!`), the outright leading it now through the continuous lead resolver
|
|
7678
7779
|
* (`getResolvedLead`, the roll rule the gateway's summary path resolves the alias with, fixture-pinned
|
|
7679
|
-
* to it, and the one the terminal identity admitted the alias by)
|
|
7780
|
+
* to it, and the one the terminal identity admitted the alias by), as the contract its options list on
|
|
7781
|
+
* (`cmeOptionsContract`: MES1! leading on MESZ6 lists MESFZ6's). The directory never resolves an
|
|
7680
7782
|
* alias: it lists nothing for one. Null when the lead cannot be resolved.
|
|
7681
7783
|
*/
|
|
7682
7784
|
async function wrunChainDirectoryUnderlying(identity) {
|
|
@@ -7685,7 +7787,7 @@ async function wrunChainDirectoryUnderlying(identity) {
|
|
|
7685
7787
|
return identity.underlying;
|
|
7686
7788
|
const { default: continuousContracts } = await wrunChartHostEnv().market.loadContinuousContracts();
|
|
7687
7789
|
const lead = await continuousContracts.getResolvedLead(identity.exchange, identity.underlying);
|
|
7688
|
-
return lead?.symbol ? lead.symbol : null;
|
|
7790
|
+
return lead?.symbol ? cmeOptionsContract(lead.symbol) : null;
|
|
7689
7791
|
}
|
|
7690
7792
|
/** A run target whose sheet is the sheet on the chart's market (wrunChartSizeUnit): a lane's
|
|
7691
7793
|
* `currency: "Auto"` reads the unit it resolves to there (wrunSheetWithLaneCurrencies), an input
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The tuple widths a host's own row lanes serve, the table the packer counts `max_cells` in (wrun-pack.util
|
|
3
|
+
* `wrunCellTupleWidths`). The row-lane registry registers it at its own evaluation and in its spec hook
|
|
4
|
+
* (sources/row-lane-registry.ts); the packer reads it at pack time and re-exports the register function.
|
|
5
|
+
*
|
|
6
|
+
* A LEAF on purpose (no imports): the registry rides the code parsed before the first candle (the live intake reads
|
|
7
|
+
* row lanes), the packer does not (tests/utility/wrun/wrun-door.closure.spec.ts), so the registration seam lives here
|
|
8
|
+
* and the registry never loads the packer. One table: a run that loads the packer later reads the widths the
|
|
9
|
+
* registry registered at boot.
|
|
10
|
+
*/
|
|
11
|
+
/** Replace the registered row-lane tuple widths (web: src/utility/wrun/sources/row-lane-registry.ts, at load and in
|
|
12
|
+
* its spec hook). */
|
|
13
|
+
export declare function registerWrunRowLaneTupleWidths(widths: Readonly<Record<string, number>>): void;
|
|
14
|
+
/** The row-lane tuple widths registered now, read at call time (the packer reads them per pack). */
|
|
15
|
+
export declare function wrunRegisteredRowLaneTupleWidths(): Readonly<Record<string, number>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The tuple widths a host's own row lanes serve, the table the packer counts `max_cells` in (wrun-pack.util
|
|
3
|
+
* `wrunCellTupleWidths`). The row-lane registry registers it at its own evaluation and in its spec hook
|
|
4
|
+
* (sources/row-lane-registry.ts); the packer reads it at pack time and re-exports the register function.
|
|
5
|
+
*
|
|
6
|
+
* A LEAF on purpose (no imports): the registry rides the code parsed before the first candle (the live intake reads
|
|
7
|
+
* row lanes), the packer does not (tests/utility/wrun/wrun-door.closure.spec.ts), so the registration seam lives here
|
|
8
|
+
* and the registry never loads the packer. One table: a run that loads the packer later reads the widths the
|
|
9
|
+
* registry registered at boot.
|
|
10
|
+
*/
|
|
11
|
+
/** The registered tuple widths by source class (web: each row-lane descriptor's `width`); empty until a registry
|
|
12
|
+
* registers, so a host without row lanes packs with the shared host's table alone. */
|
|
13
|
+
let laneTupleWidths = Object.freeze({});
|
|
14
|
+
/** Replace the registered row-lane tuple widths (web: src/utility/wrun/sources/row-lane-registry.ts, at load and in
|
|
15
|
+
* its spec hook). */
|
|
16
|
+
export function registerWrunRowLaneTupleWidths(widths) {
|
|
17
|
+
laneTupleWidths = Object.freeze({ ...widths });
|
|
18
|
+
}
|
|
19
|
+
/** The row-lane tuple widths registered now, read at call time (the packer reads them per pack). */
|
|
20
|
+
export function wrunRegisteredRowLaneTupleWidths() {
|
|
21
|
+
return laneTupleWidths;
|
|
22
|
+
}
|
|
@@ -11,14 +11,16 @@
|
|
|
11
11
|
*
|
|
12
12
|
* Cell enforcement runs HERE, during packing and before any worker is
|
|
13
13
|
* involved: a block on an input not declared `cellType: "array"` and a block
|
|
14
|
-
* over the input's `max_cells` (counted in TUPLES
|
|
15
|
-
*
|
|
14
|
+
* over the input's `max_cells` (counted in TUPLES, at the input's own width:
|
|
15
|
+
* its class's, or the width its words make, `wrunOptionInputTupleWidth`) both
|
|
16
|
+
* refuse the whole evaluation by name, never truncate. One exception (frozen authoring
|
|
16
17
|
* contract C1.2b): an input declaring `missing: "empty"` reads an oversize
|
|
17
18
|
* block as a PRESENT EMPTY block (0 cells) on that bar alone and the run
|
|
18
19
|
* goes on, the way the same input reads a lane that answered nothing; the
|
|
19
20
|
* block is still never truncated.
|
|
20
21
|
*/
|
|
21
22
|
import type { WrunAbiVersion, WrunIndicatorMetadata, WrunOutputRow, WrunPackedRunRequest, WrunWorkerResponse } from '../../interfaces/wrun-runtime.interface.js';
|
|
23
|
+
export { registerWrunRowLaneTupleWidths } from './wrun-pack-widths.leaf.js';
|
|
22
24
|
/** One runtime input row: `values` is the positional scalar block (celled
|
|
23
25
|
* slots carry NaN placeholders); `cellBlocks` maps a celled input index to
|
|
24
26
|
* that bar's flat f64 cell array. An index with no entry is a missing block
|
|
@@ -31,17 +33,16 @@ export interface WrunInputRow {
|
|
|
31
33
|
values: number[];
|
|
32
34
|
cellBlocks?: Map<number, number[]>;
|
|
33
35
|
}
|
|
34
|
-
/** Replace the registered row-lane tuple widths (web: src/utility/wrun/sources/row-lane-registry.ts, at load and in
|
|
35
|
-
* its spec hook). */
|
|
36
|
-
export declare function registerWrunRowLaneTupleWidths(widths: Readonly<Record<string, number>>): void;
|
|
37
36
|
/** Cell tuple widths per celled source class (f64 cells per source tuple), the shared host's table
|
|
38
37
|
* (`WRUN_HOST_CELL_TUPLE_WIDTHS`): `volume_profile` = [low, high, buy, sell]; `book` = [price,
|
|
39
38
|
* abs(size), side]; `tape` = [offset_ms, price, size, side]; `trade_volume_by_size` = [bucket,
|
|
40
39
|
* buy_usd, sell_usd, buy_count, sell_count]; `intrabar` and `candles` = [offset_ms, open, high,
|
|
41
40
|
* low, close, volume]; `options_chain` = [strike, expiry_ms, side, oi, gamma, delta, mark_iv,
|
|
42
|
-
* underlying, multiplier, vega]; and each registered row lane's own (`registerWrunRowLaneTupleWidths
|
|
43
|
-
* the class a host serves through a descriptor, before or after the kit names
|
|
44
|
-
*
|
|
41
|
+
* underlying, multiplier, vega]; and each registered row lane's own (`registerWrunRowLaneTupleWidths`,
|
|
42
|
+
* wrun-pack-widths.leaf: the class a host serves through a descriptor, before or after the kit names
|
|
43
|
+
* it, so a new lane needs no row in the kit's table). Read at pack time: a run loaded the host first,
|
|
44
|
+
* and the registry registered its lanes at its own evaluation, however late this module loads.
|
|
45
|
+
* `max_cells` counts tuples; the packed byte math counts f64s. */
|
|
45
46
|
export declare function wrunCellTupleWidths(): Readonly<Record<string, number>>;
|
|
46
47
|
/** The frozen refusal for a block over its input's `max_cells` (the om contract's code, every
|
|
47
48
|
* host): the evaluation is refused, the block never truncated. An input declaring
|
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
*
|
|
12
12
|
* Cell enforcement runs HERE, during packing and before any worker is
|
|
13
13
|
* involved: a block on an input not declared `cellType: "array"` and a block
|
|
14
|
-
* over the input's `max_cells` (counted in TUPLES
|
|
15
|
-
*
|
|
14
|
+
* over the input's `max_cells` (counted in TUPLES, at the input's own width:
|
|
15
|
+
* its class's, or the width its words make, `wrunOptionInputTupleWidth`) both
|
|
16
|
+
* refuse the whole evaluation by name, never truncate. One exception (frozen authoring
|
|
16
17
|
* contract C1.2b): an input declaring `missing: "empty"` reads an oversize
|
|
17
18
|
* block as a PRESENT EMPTY block (0 cells) on that bar alone and the run
|
|
18
19
|
* goes on, the way the same input reads a lane that answered nothing; the
|
|
@@ -21,26 +22,26 @@
|
|
|
21
22
|
import { abiAtLeast } from '../../interfaces/wrun-runtime.interface.js';
|
|
22
23
|
import { WRUN_FRAME_DEFAULT_MAX_BYTES, WRUN_FRAME_MAX_SLOTS } from './wrun-frames.js';
|
|
23
24
|
import { wrunChartHostEnv } from '../../host-env.js';
|
|
25
|
+
import { wrunOptionInputTupleWidth } from './wrun-option-views.util.js';
|
|
24
26
|
import { wrunPlainText } from './wrun-text-params.util.js';
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
* its spec hook). */
|
|
30
|
-
export function registerWrunRowLaneTupleWidths(widths) {
|
|
31
|
-
laneTupleWidths = Object.freeze({ ...widths });
|
|
32
|
-
}
|
|
27
|
+
// The row-lane widths table and its register function live in the widths leaf: the row-lane registry (boot path)
|
|
28
|
+
// registers through it at its own evaluation and never loads this module; the packer reads the same table.
|
|
29
|
+
import { wrunRegisteredRowLaneTupleWidths } from './wrun-pack-widths.leaf.js';
|
|
30
|
+
export { registerWrunRowLaneTupleWidths } from './wrun-pack-widths.leaf.js';
|
|
33
31
|
/** Cell tuple widths per celled source class (f64 cells per source tuple), the shared host's table
|
|
34
32
|
* (`WRUN_HOST_CELL_TUPLE_WIDTHS`): `volume_profile` = [low, high, buy, sell]; `book` = [price,
|
|
35
33
|
* abs(size), side]; `tape` = [offset_ms, price, size, side]; `trade_volume_by_size` = [bucket,
|
|
36
34
|
* buy_usd, sell_usd, buy_count, sell_count]; `intrabar` and `candles` = [offset_ms, open, high,
|
|
37
35
|
* low, close, volume]; `options_chain` = [strike, expiry_ms, side, oi, gamma, delta, mark_iv,
|
|
38
|
-
* underlying, multiplier, vega]; and each registered row lane's own (`registerWrunRowLaneTupleWidths
|
|
39
|
-
* the class a host serves through a descriptor, before or after the kit names
|
|
40
|
-
*
|
|
36
|
+
* underlying, multiplier, vega]; and each registered row lane's own (`registerWrunRowLaneTupleWidths`,
|
|
37
|
+
* wrun-pack-widths.leaf: the class a host serves through a descriptor, before or after the kit names
|
|
38
|
+
* it, so a new lane needs no row in the kit's table). Read at pack time: a run loaded the host first,
|
|
39
|
+
* and the registry registered its lanes at its own evaluation, however late this module loads.
|
|
40
|
+
* `max_cells` counts tuples; the packed byte math counts f64s. */
|
|
41
41
|
export function wrunCellTupleWidths() {
|
|
42
42
|
const host = wrunChartHostEnv().sharedHost().WRUN_HOST_CELL_TUPLE_WIDTHS;
|
|
43
|
-
|
|
43
|
+
const lanes = wrunRegisteredRowLaneTupleWidths();
|
|
44
|
+
return Object.keys(lanes).length === 0 ? host : { ...host, ...lanes };
|
|
44
45
|
}
|
|
45
46
|
/** The frozen refusal for a block over its input's `max_cells` (the om contract's code, every
|
|
46
47
|
* host): the evaluation is refused, the block never truncated. An input declaring
|
|
@@ -91,7 +92,12 @@ export function packWrunRows(metadata, rows, initArgs, textParams) {
|
|
|
91
92
|
for (const input of celledInputs) {
|
|
92
93
|
const source = metadata.inputSources[input.name];
|
|
93
94
|
const sourceClass = source?.source ?? '';
|
|
94
|
-
|
|
95
|
+
const classWidth = Object.hasOwn(tupleWidths, sourceClass) ? (tupleWidths[sourceClass] ?? 1) : 1;
|
|
96
|
+
// `max_cells` counts the input's OWN tuples: its words may resize them (a view fold, the strike kit fold's 14-value
|
|
97
|
+
// rows; the SDK's one rule, `wrunOptionInputTupleWidth`), so a block is never counted at its class's width.
|
|
98
|
+
tupleWidthByIndex.set(input.index, source === undefined
|
|
99
|
+
? classWidth
|
|
100
|
+
: wrunOptionInputTupleWidth(source, classWidth));
|
|
95
101
|
maxCellsByIndex.set(input.index, input.max_cells ?? Number.POSITIVE_INFINITY);
|
|
96
102
|
if (source?.missing === 'empty')
|
|
97
103
|
emptyWhenOversize.add(input.index);
|
|
@@ -71,6 +71,10 @@ export interface WrunChildOverlayChart extends WrunPaneFormatChart {
|
|
|
71
71
|
settings?: Record<string, unknown>;
|
|
72
72
|
rawData?: unknown;
|
|
73
73
|
data?: unknown;
|
|
74
|
+
/** The owner's own plots and its last applied run: whether its pane draws anything in a window
|
|
75
|
+
* (window-geometry.leaf ownerPaneDrawsNothing). */
|
|
76
|
+
nestedMeta?: unknown;
|
|
77
|
+
runResult?: unknown;
|
|
74
78
|
}>;
|
|
75
79
|
isDestroyed?: boolean;
|
|
76
80
|
/** The chart canvas in CSS px sizes a table pane to its rows; the focus mode names the expanded pane. */
|
|
@@ -17,7 +17,13 @@
|
|
|
17
17
|
* height share are set here (SC08 SC09 SC10 SC17 SC37); `place: "side"`
|
|
18
18
|
* mounts below the chart like every panel (the window is a side panel's
|
|
19
19
|
* opened form, Kyle 2026-10-04; the engine's side strip stays for `dock:
|
|
20
|
-
* "side"` canvases).
|
|
20
|
+
* "side"` canvases). A table never sits under the candles while its
|
|
21
|
+
* Indicator's window shows it, and never mounts nowhere (Kyle 2026-10-21): a
|
|
22
|
+
* window cell mounts it; a normal cell leaves it to the window only when the
|
|
23
|
+
* host shows windows (the env's `windows`) and its `tablesShownInWindow`
|
|
24
|
+
* answers true for this chart and Indicator, and mounts it below like every
|
|
25
|
+
* panel otherwise (`mountsOnCell`). A table loses its all-empty columns
|
|
26
|
+
* before it translates (withoutEmptyTableColumns). Docked levels (g2) take
|
|
21
27
|
* their settings and rows from wrun-levels-child.util's mount helpers and
|
|
22
28
|
* keep their hover rows under the child id (DL-hover). Price canvases (g6)
|
|
23
29
|
* take their config from wrun-canvases.util: heatmap and profile children
|
|
@@ -38,12 +44,12 @@
|
|
|
38
44
|
* OT32). Every child's eye follows the parent's, except where the reader
|
|
39
45
|
* moved a child's own eye (an inset's): that flip stands (syncChildVisibility).
|
|
40
46
|
*/
|
|
41
|
-
import { wrunChartHostEnv } from '../../host-env.js';
|
|
47
|
+
import { wrunChartHostEnv, wrunHostLeavesTablesToWindow } from '../../host-env.js';
|
|
42
48
|
import { isDateLabelledBarInterval } from '../chart/date-labelled-interval.leaf.js';
|
|
43
49
|
import { KSCRIPT_LEGEND_VALUE_INK, kScriptLegendEntries, kScriptLegendLineFormat, kScriptLegendLineFormatOptions, kScriptLegendLines, kScriptLegendLineSwatchAt, kScriptLegendLineValueAt, kScriptLegendSlotCells, padKScriptLegendSlots, } from '../chart/kscript-legend-entries.util.js';
|
|
44
|
-
import { panelGridHeight, refreshPanelOverlayInPlace, samePanelPane, translatePanelToEngine, } from '../chart/om-panel.util.js';
|
|
50
|
+
import { panelGridHeight, refreshPanelOverlayInPlace, samePanelPane, translatePanelToEngine, withoutEmptyTableColumns, } from '../chart/om-panel.util.js';
|
|
45
51
|
import { isWrunWindowOwner } from '../chart/window-owner.leaf.js';
|
|
46
|
-
import { planWindowWeights, reconcileWindowOwnerGeometry, savedWindowSplit, tableRowCountOf, } from '../chart/window-geometry.leaf.js';
|
|
52
|
+
import { ownerPaneDrawsNothing, planWindowWeights, reconcileWindowOwnerGeometry, savedWindowSplit, tableRowCountOf, } from '../chart/window-geometry.leaf.js';
|
|
47
53
|
import { wrunLegendName } from '../chart/wrun-legend-name.util.js';
|
|
48
54
|
import { wrunResultLegendColors, wrunSeriesChildId, } from '../chart/wrun-run-result.util.js';
|
|
49
55
|
import { budgetWrunBatchedRetained, budgetWrunBatchedRows, commitWrunBatchedPlan, currentWrunBatchedPlan, forgetWrunBatchedCells, isWrunBatchedMarksKind, noteWrunBatchedRowsCut, planWrunBatchedMerged, restoreWrunBatchedLedger, snapshotWrunBatchedLedger, wrunBatchedChargeOf, wrunBatchedChildConfig, wrunBatchedChildrenOverShare, wrunBatchedSiblingsToRebalance, } from './wrun-batched-marks.util.js';
|
|
@@ -286,24 +292,30 @@ function userThemeMode() {
|
|
|
286
292
|
* theme, price digits and display timezone (SC08 SC16 SC37); the run's
|
|
287
293
|
* title and caption on the legend as text (SC17: titan renders both as text); the maximize
|
|
288
294
|
* button and stats row (SC10); the declared height share (SC09); every
|
|
289
|
-
* panel
|
|
290
|
-
* side panel's right-side home is the window, never a strip that narrows
|
|
291
|
-
* the candles; `width_px` / `height_px` therefore size nothing here).
|
|
295
|
+
* panel in a pane of its own at its carved height, `place: "side"` included
|
|
296
|
+
* (a side panel's right-side home is the window, never a strip that narrows
|
|
297
|
+
* the candles; `width_px` / `height_px` therefore size nothing here). A
|
|
298
|
+
* table reaches this door on a window cell, and on a normal cell while no
|
|
299
|
+
* window of the layout shows it (the children filter, mountsOnCell), so it
|
|
300
|
+
* never sits under the candles while its window shows it and never mounts
|
|
301
|
+
* nowhere; its all-empty columns leave before the translation builds the
|
|
302
|
+
* payload and the formatter (withoutEmptyTableColumns, C4). */
|
|
292
303
|
function panelChildConfig(child, ctx) {
|
|
293
304
|
const translateContext = {
|
|
294
305
|
theme: ctx.theme,
|
|
295
306
|
...(ctx.priceDigits !== undefined ? { priceDigits: ctx.priceDigits() } : {}),
|
|
296
307
|
timezoneOffsetMs: ctx.timezoneOffsetMs,
|
|
297
308
|
};
|
|
298
|
-
const
|
|
299
|
-
const
|
|
309
|
+
const frame = withoutEmptyTableColumns(child.frame);
|
|
310
|
+
const translated = translatePanelToEngine(frame, translateContext);
|
|
311
|
+
const { panel, rows, chrome } = frame;
|
|
300
312
|
const caption = chrome?.caption;
|
|
301
313
|
const id = `${ctx.overlayId}::panel:${child.name}`;
|
|
302
314
|
// A table owns no value axis and a rich line (every chrome but box: the
|
|
303
315
|
// numeric curve, or grid / none on a time, category or stacked line) draws
|
|
304
316
|
// its own left axis (C4): neither pane echoes the chart's prices in its
|
|
305
|
-
// scale cell. A box line and every other kind keep it
|
|
306
|
-
// below, `place: "side"` included).
|
|
317
|
+
// scale cell. A box line and every other kind keep it, in whichever pane it
|
|
318
|
+
// mounts (below the chart, `place: "side"` included, or in a window).
|
|
307
319
|
const ownAxis = panel.kind === 'table' || (panel.kind === 'line' && wrunPanelChrome(panel) !== 'box');
|
|
308
320
|
return {
|
|
309
321
|
id,
|
|
@@ -717,13 +729,14 @@ function samePane(mounted, next, heightHeld = false) {
|
|
|
717
729
|
}
|
|
718
730
|
/** The panes a window mount lays out, for the planner: the owner's own pane
|
|
719
731
|
* when it is mounted offchart (a lower-only package), the run's panel
|
|
720
|
-
* children (side panels included: they stack in the window) and
|
|
721
|
-
* children that mount below the chart (a pane pinned over the candles
|
|
722
|
-
* carves nothing), and the mounted children a frameless tick keeps.
|
|
732
|
+
* children (side panels and tables included: they stack in the window) and
|
|
733
|
+
* series children that mount below the chart (a pane pinned over the candles
|
|
734
|
+
* carves nothing), and the mounted children a frameless tick keeps. An owner
|
|
735
|
+
* pane that draws nothing beside child panes is left out (the geometry's
|
|
736
|
+
* rule, ownerPaneDrawsNothing: the reconcile hides it and the children take
|
|
737
|
+
* its height, C5); alone, it stays (never a blank window). */
|
|
723
738
|
function windowPanesOfMount(parent, overlayId, children, kept) {
|
|
724
739
|
const panes = [];
|
|
725
|
-
if (parent.type === 'offchart' && parent.isPaneHidden !== true)
|
|
726
|
-
panes.push({ id: overlayId, kind: 'time' });
|
|
727
740
|
const seen = new Set();
|
|
728
741
|
for (const child of children) {
|
|
729
742
|
if (child.kind === 'panel') {
|
|
@@ -751,6 +764,10 @@ function windowPanesOfMount(parent, overlayId, children, kept) {
|
|
|
751
764
|
else
|
|
752
765
|
panes.push({ id: config.id, kind: 'chart' });
|
|
753
766
|
}
|
|
767
|
+
const ownerPane = parent.type === 'offchart' && parent.isPaneHidden !== true;
|
|
768
|
+
if (ownerPane && (panes.length === 0 || !ownerPaneDrawsNothing(parent))) {
|
|
769
|
+
panes.unshift({ id: overlayId, kind: 'time' });
|
|
770
|
+
}
|
|
754
771
|
return panes;
|
|
755
772
|
}
|
|
756
773
|
/** A row-backed canvas keeps its overlay across runs while it stays the
|
|
@@ -1592,6 +1609,21 @@ function ownerTimePaneId(parent, overlayId, children) {
|
|
|
1592
1609
|
const lower = children.find((child) => child.kind === 'series' && child.result.pane?.place !== 'price');
|
|
1593
1610
|
return lower === undefined ? undefined : wrunSeriesChildId(overlayId, lower.name);
|
|
1594
1611
|
}
|
|
1612
|
+
/**
|
|
1613
|
+
* Whether a run's child mounts on this cell. The class it closes: a table that mounts nowhere, or under the candles
|
|
1614
|
+
* while its window shows it (Kyle 2026-10-21: a table never sits under the candles WHILE its window shows it, which
|
|
1615
|
+
* never lets a table vanish). A window cell mounts every child. A normal cell mounts every child but the `panel.table`
|
|
1616
|
+
* children (any `place`) of an Indicator whose tables a window cell of the layout shows: the host shows windows (the
|
|
1617
|
+
* env's `windows`, C1) and its `tablesShownInWindow` answers true for this chart and Indicator (R1;
|
|
1618
|
+
* `leavesTablesToWindow`, asked here only, and only for a table). An Indicator with no window, or one that cannot get
|
|
1619
|
+
* one (replay, a full layout, a slot budget that refuses the window copy, an editor draft, a layout saved before
|
|
1620
|
+
* windows), keeps its tables on the cell, as does every Indicator on a host without windows (the phone). A table an
|
|
1621
|
+
* earlier pass mounted that the rule now leaves out goes with the children a run no longer declares; one it left out
|
|
1622
|
+
* mounts again on the next run that carries frames once no window shows it.
|
|
1623
|
+
*/
|
|
1624
|
+
function mountsOnCell(child, windowCell, leavesTablesToWindow) {
|
|
1625
|
+
return windowCell || child.kind !== 'panel' || child.frame.panel.kind !== 'table' || !leavesTablesToWindow();
|
|
1626
|
+
}
|
|
1595
1627
|
/** The run's children in mount order (C6): the panels first, then today's
|
|
1596
1628
|
* order (series, levels, canvases, insets), each group as the run listed
|
|
1597
1629
|
* it. Decided here, never in the run result, so the run golden's
|
|
@@ -1665,7 +1697,20 @@ export function mountWrunChildOverlays({ tc, overlayId, runResult, replaceFrames
|
|
|
1665
1697
|
unmountWrunChildOverlays(tc, overlayId);
|
|
1666
1698
|
state = undefined;
|
|
1667
1699
|
}
|
|
1668
|
-
|
|
1700
|
+
// A window (the parent carries the owner flag in its engine settings, or the
|
|
1701
|
+
// caller says so): the children mount at the plan's weights and the plan is
|
|
1702
|
+
// reconciled onto the mounted panes when the mount settles. A cell without
|
|
1703
|
+
// a flagged owner never enters that path: its configs are today's. The cell
|
|
1704
|
+
// also decides whether a table mounts (mountsOnCell): a normal cell leaves
|
|
1705
|
+
// its tables to the window that shows them (the host asked at most once per
|
|
1706
|
+
// pass, and only when a table reaches the rule) and mounts them otherwise.
|
|
1707
|
+
// A table the rule leaves out here that an earlier pass mounted leaves like
|
|
1708
|
+
// a child the run dropped; one left out before mounts again on the first
|
|
1709
|
+
// pass that carries frames and finds no window showing it.
|
|
1710
|
+
const windowCell = cell?.window ?? isWrunWindowOwner(parent);
|
|
1711
|
+
let leavesTables;
|
|
1712
|
+
const leavesTablesToWindow = () => (leavesTables ??= wrunHostLeavesTablesToWindow(chartIndex, overlayId));
|
|
1713
|
+
const children = (runResult.childOverlays ?? []).filter((child) => (replaceFrames || ROW_BACKED_KINDS.has(child.kind)) && mountsOnCell(child, windowCell, leavesTablesToWindow));
|
|
1669
1714
|
if (!state && children.length === 0)
|
|
1670
1715
|
return Promise.resolve(true);
|
|
1671
1716
|
if (!replaceFrames &&
|
|
@@ -1702,11 +1747,6 @@ export function mountWrunChildOverlays({ tc, overlayId, runResult, replaceFrames
|
|
|
1702
1747
|
const token = Symbol(overlayId);
|
|
1703
1748
|
current.token = token;
|
|
1704
1749
|
current.priceDigits = priceDigits;
|
|
1705
|
-
// A window (the parent carries the owner flag in its engine settings, or the
|
|
1706
|
-
// caller says so): the children mount at the plan's weights and the plan is
|
|
1707
|
-
// reconciled onto the mounted panes when the mount settles. A cell without
|
|
1708
|
-
// a flagged owner never enters that path: its configs are today's.
|
|
1709
|
-
const windowCell = cell?.window ?? isWrunWindowOwner(parent);
|
|
1710
1750
|
current.chartHeightPx = cell?.canvasHeightPx ?? tc.canvasChartController?.canvasElement?.clientHeight;
|
|
1711
1751
|
// The host's plan sizes the children on any cell (a normal cell's remembered heights included); a window without
|
|
1712
1752
|
// one plans its own.
|