@orangecharts/wrun-chart-host 0.14.0 → 0.16.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 +1 -0
- package/dist/constants/economic.constants.d.ts +2 -0
- package/dist/constants/economic.constants.js +2 -0
- package/dist/constants/feature-flags.constants.d.ts +11 -0
- package/dist/constants/feature-flags.constants.js +56 -4
- package/dist/constants/feature-limits.constants.d.ts +72 -4
- package/dist/constants/feature-limits.constants.js +98 -20
- package/dist/constants/interval.constants.js +5 -0
- package/dist/constants/kscript-data-interval-restrictions.constants.d.ts +12 -0
- package/dist/constants/kscript-data-interval-restrictions.constants.js +14 -0
- package/dist/constants/typed-width-fold.leaf.d.ts +50 -0
- package/dist/constants/typed-width-fold.leaf.js +99 -0
- package/dist/constants/typed-width-source.leaf.d.ts +24 -0
- package/dist/constants/typed-width-source.leaf.js +126 -0
- package/dist/constants/typed-width.leaf.d.ts +57 -0
- package/dist/constants/typed-width.leaf.js +78 -0
- package/dist/host-env.d.ts +24 -0
- package/dist/host-env.js +22 -0
- package/dist/host-ports.types.d.ts +11 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/interfaces/kscript-diagnostics.interface.d.ts +28 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +107 -4
- package/dist/interfaces/wrun-runtime.interface.js +11 -0
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +13 -0
- package/dist/kscript-data/controls/live-trades-merge.util.js +16 -1
- package/dist/market-data/billing.interface.d.ts +12 -45
- package/dist/market-data/billing.interface.js +2 -2
- package/dist/market-data/venues/index.d.ts +2 -2
- package/dist/market-data/venues/opra.js +3 -3
- package/dist/market-data/venues/stocks.contract.copy.json +3 -2
- package/dist/market-data/venues/stocks.d.ts +2 -2
- package/dist/market-data/venues/stocks.js +10 -9
- package/dist/replay/replayLadder.js +7 -4
- package/dist/settings-templates/footprint-rows.d.ts +6 -0
- package/dist/settings-templates/footprint-rows.js +6 -0
- package/dist/settings-templates/frvp-fields.js +14 -0
- package/dist/settings-templates/indicator-fields.js +46 -0
- package/dist/settings-templates/tool-tables.generated.js +19 -1
- package/dist/utility/chart/__fixtures__/live-bucket-regular-golden.json +1706 -0
- package/dist/utility/chart/cache-alignment.util.d.ts +65 -0
- package/dist/utility/chart/cache-alignment.util.js +124 -24
- package/dist/utility/chart/calendar-interval.util.d.ts +83 -1
- package/dist/utility/chart/calendar-interval.util.js +152 -4
- package/dist/utility/chart/candle-bar-end.util.d.ts +11 -4
- package/dist/utility/chart/candle-bar-end.util.js +17 -6
- package/dist/utility/chart/chart-time-domain.util.d.ts +3 -0
- package/dist/utility/chart/chart-time-domain.util.js +13 -4
- package/dist/utility/chart/feed-interval.util.d.ts +4 -2
- package/dist/utility/chart/feed-interval.util.js +5 -2
- package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +3 -1
- package/dist/utility/chart/fetch-dedupe-policy.util.js +19 -1
- package/dist/utility/chart/footprint-band.util.d.ts +21 -5
- package/dist/utility/chart/footprint-band.util.js +53 -14
- package/dist/utility/chart/footprint-display-mode.util.d.ts +2 -0
- package/dist/utility/chart/footprint-display-mode.util.js +5 -0
- package/dist/utility/chart/governed-lanes-gate.util.d.ts +46 -0
- package/dist/utility/chart/governed-lanes-gate.util.js +71 -0
- package/dist/utility/chart/governed-lanes-reader-seat.d.ts +14 -0
- package/dist/utility/chart/governed-lanes-reader-seat.js +14 -0
- package/dist/utility/chart/history-wall.util.d.ts +13 -2
- package/dist/utility/chart/history-wall.util.js +11 -4
- package/dist/utility/chart/interval-ladder.util.d.ts +5 -2
- package/dist/utility/chart/interval-ladder.util.js +44 -4
- package/dist/utility/chart/interval-registry.util.d.ts +22 -1
- package/dist/utility/chart/interval-registry.util.js +50 -2
- package/dist/utility/chart/kscript-data-interval-restriction.leaf.d.ts +32 -4
- package/dist/utility/chart/kscript-data-interval-restriction.leaf.js +22 -5
- package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +10 -0
- package/dist/utility/chart/kscript-drawing-safe-area.util.js +30 -3
- package/dist/utility/chart/kscript-legend-entries.util.d.ts +21 -4
- package/dist/utility/chart/kscript-legend-entries.util.js +27 -5
- package/dist/utility/chart/kscript-main-grid-stages.util.js +74 -24
- package/dist/utility/chart/kscript-row-name.leaf.d.ts +13 -0
- package/dist/utility/chart/kscript-row-name.leaf.js +18 -0
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +61 -26
- package/dist/utility/chart/kscript-venue-policy.util.js +138 -37
- package/dist/utility/chart/live-bucket.util.d.ts +29 -4
- package/dist/utility/chart/live-bucket.util.js +45 -12
- package/dist/utility/chart/market-session.util.d.ts +62 -10
- package/dist/utility/chart/market-session.util.js +93 -13
- package/dist/utility/chart/marketKind.util.d.ts +1 -7
- package/dist/utility/chart/marketKind.util.js +6 -8
- package/dist/utility/chart/mixed-mode.util.d.ts +17 -0
- package/dist/utility/chart/om-target.util.js +6 -4
- package/dist/utility/chart/price-precision.util.d.ts +20 -6
- package/dist/utility/chart/price-precision.util.js +34 -7
- package/dist/utility/chart/profile-frame-window.util.d.ts +15 -0
- package/dist/utility/chart/profile-frame-window.util.js +12 -0
- package/dist/utility/chart/rth-session.util.d.ts +3 -1
- package/dist/utility/chart/rth-session.util.js +3 -1
- package/dist/utility/chart/script-source-session.util.d.ts +43 -0
- package/dist/utility/chart/script-source-session.util.js +61 -0
- package/dist/utility/chart/typed-width-grid.util.d.ts +23 -0
- package/dist/utility/chart/typed-width-grid.util.js +203 -0
- package/dist/utility/chart/wrun-run-result.util.d.ts +9 -1
- package/dist/utility/chart/wrun-run-result.util.js +8 -2
- package/dist/utility/common/transformations.util.d.ts +6 -0
- package/dist/utility/common/transformations.util.js +28 -4
- package/dist/utility/number-format.util.d.ts +14 -1
- package/dist/utility/number-format.util.js +22 -4
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.d.ts +24 -1
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +113 -0
- package/dist/utility/v2/v2-enums.leaf.js +3 -0
- package/dist/utility/wrun/wrun-batched-marks.util.d.ts +15 -5
- package/dist/utility/wrun/wrun-batched-marks.util.js +70 -20
- package/dist/utility/wrun/wrun-canvases.util.d.ts +28 -9
- package/dist/utility/wrun/wrun-canvases.util.js +99 -39
- package/dist/utility/wrun/wrun-cap-notice.util.d.ts +5 -0
- package/dist/utility/wrun/wrun-cap-notice.util.js +23 -0
- package/dist/utility/wrun/wrun-card-style.util.d.ts +1 -1
- package/dist/utility/wrun/wrun-card-style.util.js +2 -2
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +8 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +13 -1
- package/dist/utility/wrun/wrun-child-overlay-id.util.d.ts +10 -0
- package/dist/utility/wrun/wrun-child-overlay-id.util.js +24 -0
- package/dist/utility/wrun/wrun-cloud-cme-stamp.util.d.ts +72 -0
- package/dist/utility/wrun/wrun-cloud-cme-stamp.util.js +151 -0
- package/dist/utility/wrun/wrun-color-facts.util.d.ts +3 -3
- package/dist/utility/wrun/wrun-color-facts.util.js +8 -5
- package/dist/utility/wrun/wrun-colour-tone.lazy.d.ts +20 -0
- package/dist/utility/wrun/wrun-colour-tone.lazy.js +23 -0
- package/dist/utility/wrun/wrun-colour-tone.util.d.ts +14 -0
- package/dist/utility/wrun/wrun-colour-tone.util.js +119 -0
- package/dist/utility/wrun/wrun-dark-pool.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-dark-pool.util.js +5 -4
- package/dist/utility/wrun/wrun-frames.d.ts +1 -1
- package/dist/utility/wrun/wrun-frames.js +2 -2
- package/dist/utility/wrun/wrun-handles.util.d.ts +1 -1
- package/dist/utility/wrun/wrun-handles.util.js +1 -1
- package/dist/utility/wrun/wrun-host.service.d.ts +32 -2
- package/dist/utility/wrun/wrun-host.service.js +44 -2
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +20 -0
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +85 -2
- package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +37 -0
- package/dist/utility/wrun/wrun-hosted-wire.util.js +54 -0
- package/dist/utility/wrun/wrun-hover.util.d.ts +8 -2
- package/dist/utility/wrun/wrun-hover.util.js +24 -13
- package/dist/utility/wrun/wrun-hud-looks.util.d.ts +1 -0
- package/dist/utility/wrun/wrun-hud-looks.util.js +6 -11
- package/dist/utility/wrun/wrun-integration-route.util.d.ts +24 -0
- package/dist/utility/wrun/wrun-integration-route.util.js +19 -0
- package/dist/utility/wrun/wrun-live-intake.util.js +17 -1
- package/dist/utility/wrun/wrun-live-patch.util.d.ts +6 -1
- package/dist/utility/wrun/wrun-live-patch.util.js +10 -4
- package/dist/utility/wrun/wrun-live-tick.util.js +81 -19
- package/dist/utility/wrun/wrun-output-words.util.d.ts +14 -0
- package/dist/utility/wrun/wrun-output-words.util.js +51 -0
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +41 -0
- package/dist/utility/wrun/wrun-overlay-drivers.util.js +35 -0
- package/dist/utility/wrun/wrun-overlay-result.util.d.ts +6 -1
- package/dist/utility/wrun/wrun-overlay-result.util.js +2 -0
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +23 -2
- package/dist/utility/wrun/wrun-overlay-run.util.js +305 -51
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +10 -2
- package/dist/utility/wrun/wrun-panel-mount.util.js +144 -18
- package/dist/utility/wrun/wrun-pin-venues.util.js +5 -1
- package/dist/utility/wrun/wrun-refusal.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-refusal.util.js +102 -13
- package/dist/utility/wrun/wrun-registry-errors.util.d.ts +5 -3
- package/dist/utility/wrun/wrun-registry-errors.util.js +5 -3
- package/dist/utility/wrun/wrun-row-source-factory.js +17 -1
- package/dist/utility/wrun/wrun-row-source.d.ts +8 -1
- package/dist/utility/wrun/wrun-run-health.util.d.ts +6 -3
- package/dist/utility/wrun/wrun-run-health.util.js +5 -2
- package/dist/utility/wrun/wrun-sandbox-row-source.d.ts +1 -1
- package/dist/utility/wrun/wrun-sandbox-row-source.js +9 -0
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +25 -8
- package/dist/utility/wrun/wrun-script-inputs.util.js +145 -45
- package/dist/utility/wrun/wrun-setting-words.util.d.ts +12 -5
- package/dist/utility/wrun/wrun-setting-words.util.js +25 -8
- package/dist/utility/wrun/wrun-socket-row-source.d.ts +26 -1
- package/dist/utility/wrun/wrun-socket-row-source.js +125 -12
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +3 -3
- package/dist/utility/wrun/wrun-source-rows.util.js +8 -7
- package/dist/utility/wrun/wrun-style-names.util.d.ts +23 -0
- package/dist/utility/wrun/wrun-style-names.util.js +74 -0
- package/dist/utility/wrun/wrun-style-words.util.d.ts +31 -9
- package/dist/utility/wrun/wrun-style-words.util.js +46 -15
- package/dist/utility/wrun/wrun-trades-lane.util.js +2 -1
- package/dist/utility/wrun/wrun-trap-replay.util.d.ts +42 -0
- package/dist/utility/wrun/wrun-trap-replay.util.js +63 -0
- package/dist/utility/wrun/wrun-volume-profile.util.js +6 -5
- package/dist/utility/wrun-display-name.util.d.ts +10 -0
- package/dist/utility/wrun-display-name.util.js +21 -0
- package/dist/utils/replay/replay-buffer-math.d.ts +2 -0
- package/dist/utils/replay/replay-buffer-math.js +2 -0
- package/dist/workers/constants/socket-slots.d.ts +1 -1
- package/dist/workers/utils/time.worker.util.js +2 -2
- package/dist/workers/utils/volume-profile.worker.util.d.ts +9 -0
- package/dist/workers/utils/volume-profile.worker.util.js +20 -0
- package/dist/workers/wrun/wrun-abi-host.d.ts +3 -0
- package/dist/workers/wrun/wrun-abi-host.js +82 -5
- package/dist/workers/wrun/wrun-engine-handler.js +53 -4
- package/dist/workers/wrun/wrun-trap-frames.leaf.d.ts +28 -0
- package/dist/workers/wrun/wrun-trap-frames.leaf.js +108 -0
- package/package.json +11 -11
|
@@ -2,6 +2,7 @@ import { type KScriptLegendEntry } from '../chart/kscript-legend-entries.util.js
|
|
|
2
2
|
import { type EnginePanelHooks } from '../chart/om-panel.util.js';
|
|
3
3
|
import { WRUN_WINDOW_TABLES_ONLY_SETTING } from '../chart/window-geometry.leaf.js';
|
|
4
4
|
import { wrunSeriesChildId, type WrunRunResult } from '../chart/wrun-run-result.util.js';
|
|
5
|
+
import type { WrunPictureIdentity } from './wrun-overlay-drivers.util.js';
|
|
5
6
|
import { type WrunBuiltinTwin, type WrunPaneFormatChart } from './wrun-pane-format.util.js';
|
|
6
7
|
import type { WrunRunIntervalProjection } from './wrun-run-interval-projection.types.js';
|
|
7
8
|
interface WrunOverlayConfig {
|
|
@@ -143,7 +144,7 @@ export interface WrunMountCell {
|
|
|
143
144
|
* window's weights, or a normal cell's remembered pane heights (the heights its reader dragged, so a remounted
|
|
144
145
|
* pane comes back at them). The mount keeps it for the retranslate, and a child it names keeps its pane when only
|
|
145
146
|
* its height moved (the host owns that height). Absent: a window plans from the run's children, a normal cell
|
|
146
|
-
*
|
|
147
|
+
* takes the heights remembered on the owner's row (rememberedChildPaneHeights), else the shared heights. */
|
|
147
148
|
planned?: ReadonlyMap<string, number>;
|
|
148
149
|
}
|
|
149
150
|
/**
|
|
@@ -314,7 +315,7 @@ export { WRUN_WINDOW_TABLES_ONLY_SETTING };
|
|
|
314
315
|
* precision (OT29, X7): the panels' formatters and the lower pane's legend
|
|
315
316
|
* print "price" values with it. A tick's heatmap tail (`tailOnly`) only
|
|
316
317
|
* ever merges its rows into a mounted canvas. */
|
|
317
|
-
export declare function mountWrunChildOverlays({ tc, overlayId, runResult, replaceFrames, swapCanvasRows, canvasRowsFromTs, historyWindow, projection, cell, priceDigits, onMainThreadMs, chartIndex, }: {
|
|
318
|
+
export declare function mountWrunChildOverlays({ tc, overlayId, runResult, replaceFrames, swapCanvasRows, canvasRowsFromTs, historyWindow, projection, pictureIdentity, cell, priceDigits, onMainThreadMs, chartIndex, }: {
|
|
318
319
|
tc: WrunChildOverlayChart;
|
|
319
320
|
overlayId: string;
|
|
320
321
|
runResult: WrunRunResult;
|
|
@@ -346,6 +347,13 @@ export declare function mountWrunChildOverlays({ tc, overlayId, runResult, repla
|
|
|
346
347
|
historyWindow?: WrunChildHistoryWindow;
|
|
347
348
|
/** The parent ran at another interval: its series child projects the same way. */
|
|
348
349
|
projection?: WrunRunIntervalProjection;
|
|
350
|
+
/** What the pass's rows were computed for (`wrunPictureIdentityOf`: the run's or the session's compute settings
|
|
351
|
+
* revision and market identity). A mounted heatmap decides its colour scale at its install and at the first
|
|
352
|
+
* whole-window pass (a run's, a swap, a window that rolled past its rows) of another picture; a whole-window pass
|
|
353
|
+
* of the picture that decided it keeps the bounds on screen and the sample a Sensitivity re-pick reads, while
|
|
354
|
+
* its rows swap as before (`holdsHeatmapScale`). A merge never moves the scale. Absent, every whole-window pass
|
|
355
|
+
* decides again, the rule before the hold. */
|
|
356
|
+
pictureIdentity?: WrunPictureIdentity;
|
|
349
357
|
/** The cell the mount lands on (WrunMountCell); the parent's owner flag decides when absent. */
|
|
350
358
|
cell?: WrunMountCell;
|
|
351
359
|
/** The chart's price digits, read per call (the symbol may change). */
|
|
@@ -37,7 +37,12 @@
|
|
|
37
37
|
* await: prepareWrunHeatmapWindowLanding),
|
|
38
38
|
* matrices frame-backed like levels; a heatmap takes the viewer's
|
|
39
39
|
* Sensitivity at this door (`rescaleWrunHeatmapChildren` re-picks the mounted
|
|
40
|
-
* bounds with no run).
|
|
40
|
+
* bounds with no run). A heatmap's colour scale is decided once per picture
|
|
41
|
+
* (the picture identity a pass hands, `wrunPictureIdentityOf`): at its install
|
|
42
|
+
* or at the first whole-window pass of another picture; every other pass keeps
|
|
43
|
+
* the decided bounds and the sample a Sensitivity re-pick reads, while its rows
|
|
44
|
+
* swap or merge as before (`carryHeatmapScale`). Batched marks
|
|
45
|
+
* (WRUN-BATCHED-MARKS: marks, spans and
|
|
41
46
|
* rays children) are row-backed like heatmaps: a tick merges every row it
|
|
42
47
|
* re-evaluated, row by row; a windowed run lands inside its window; the engine
|
|
43
48
|
* gate refuses a kind the chart cannot draw by name; their own cell budget
|
|
@@ -47,17 +52,17 @@
|
|
|
47
52
|
* OT32). Every child's eye follows the parent's, except where the reader
|
|
48
53
|
* moved a child's own eye (an inset's): that flip stands (syncChildVisibility).
|
|
49
54
|
*/
|
|
50
|
-
import { wrunChartHostEnv, wrunHostLeavesTablesToWindow } from '../../host-env.js';
|
|
55
|
+
import { wrunChartHostEnv, wrunHostLeavesTablesToWindow, wrunHostWithoutUndoSteps } from '../../host-env.js';
|
|
51
56
|
import { isDateLabelledBarInterval } from '../chart/date-labelled-interval.leaf.js';
|
|
52
|
-
import { KSCRIPT_LEGEND_VALUE_INK, kScriptLegendEntries, kScriptLegendLineFormat, kScriptLegendLineFormatOptions, kScriptLegendLines, kScriptLegendLineSwatchAt, kScriptLegendLineValueAt, kScriptLegendSlotCells, padKScriptLegendSlots, } from '../chart/kscript-legend-entries.util.js';
|
|
57
|
+
import { KSCRIPT_LEGEND_VALUE_INK, kScriptLegendEntries, kScriptLegendLineFormat, kScriptLegendLineFormatOptions, kScriptLegendLines, kScriptLegendLineSwatchAt, kScriptLegendLineValueAt, kScriptLegendSlotCells, padKScriptLegendSlots, createKScriptLegendSlotsUsed, } from '../chart/kscript-legend-entries.util.js';
|
|
53
58
|
import { panelGridHeight, refreshPanelOverlayInPlace, samePanelPane, translatePanelToEngine, withoutEmptyTableColumns, } from '../chart/om-panel.util.js';
|
|
54
59
|
import { isWrunWindowOwner } from '../chart/window-owner.leaf.js';
|
|
55
60
|
import { ownerPaneDrawsNothing, planWindowWeights, reconcileWindowOwnerGeometry, savedWindowSplit, tableRowCountOf, WRUN_WINDOW_TABLES_ONLY_SETTING, } from '../chart/window-geometry.leaf.js';
|
|
56
61
|
import { wrunLegendName } from '../chart/wrun-legend-name.util.js';
|
|
57
62
|
import { wrunResultLegendColors, wrunSeriesChildId, } from '../chart/wrun-run-result.util.js';
|
|
58
|
-
import { budgetWrunBatchedRetained, budgetWrunBatchedRows, commitWrunBatchedPlan, currentWrunBatchedPlan, forgetWrunBatchedCells, isWrunBatchedMarksKind, noteWrunBatchedRowsCut, planWrunBatchedMerged, restoreWrunBatchedLedger, snapshotWrunBatchedLedger, WRUN_BATCHED_MARKS_KINDS, wrunBatchedChargeOf, wrunBatchedChildConfig, wrunBatchedChildrenOverShare, wrunBatchedEngineVerdict, wrunBatchedSiblingsToRebalance, } from './wrun-batched-marks.util.js';
|
|
59
|
-
import { forgetWrunCanvasReadout, keepWrunHeatmapScaleSample, rememberWrunCanvasReadout, wrunCanvasChildConfig, wrunHeatmapSensitivityBounds, wrunPlainCanvasRow, } from './wrun-canvases.util.js';
|
|
60
|
-
import { wrunChildHiddenRowKey } from './wrun-child-overlay-id.util.js';
|
|
63
|
+
import { budgetWrunBatchedRetained, budgetWrunBatchedRows, commitWrunBatchedPlan, currentWrunBatchedPlan, forgetWrunBatchedCells, isWrunBatchedMarksKind, noteWrunBatchedRowsCut, planWrunBatchedMerged, restoreWrunBatchedLedger, snapshotWrunBatchedLedger, WRUN_BATCHED_MARKS_KINDS, wrunBatchedChargeOf, wrunBatchedChildConfig, wrunBatchedChildrenOverShare, wrunBatchedEngineVerdict, wrunBatchedMarksLevelOf, wrunBatchedSiblingsToRebalance, } from './wrun-batched-marks.util.js';
|
|
64
|
+
import { forgetWrunCanvasReadout, keepWrunHeatmapScaleSample, rememberWrunCanvasReadout, wrunCanvasChildConfig, wrunHeatmapScaleDecided, wrunHeatmapScaleKept, wrunHeatmapSensitivityBounds, wrunPlainCanvasRow, } from './wrun-canvases.util.js';
|
|
65
|
+
import { wrunChildHiddenRowKey, wrunChildPaneHeightRowChildId } from './wrun-child-overlay-id.util.js';
|
|
61
66
|
import { wrunHeatmapSensitivitySetting, wrunHeatmapSensitivityValue } from './wrun-color-settings.util.js';
|
|
62
67
|
import { budgetWrunHeatmapRetained, budgetWrunHeatmapRows, commitWrunHeatmapPlan, currentWrunHeatmapPlan, planWrunHeatmapMerged, restoreWrunHeatmapLedger, snapshotWrunHeatmapLedger, wrunHeatmapCellLayoutOf, wrunHeatmapChildrenOverShare, wrunHeatmapSiblingsToRebalance, } from './wrun-heatmap-cell-budget.util.js';
|
|
63
68
|
import { wrunChildOverlayParentId } from './wrun-child-overlay-id.util.js';
|
|
@@ -198,8 +203,9 @@ function installChild(tc, child, theme) {
|
|
|
198
203
|
forgetWrunLevelsHoverRows(child.config.id);
|
|
199
204
|
}
|
|
200
205
|
function removeChild(tc, id) {
|
|
206
|
+
// The engine deletes the drawings on the child's pane with it, one event each: never steps of the person's history.
|
|
201
207
|
if (overlayPresent(tc, id))
|
|
202
|
-
tc.removeOverlay(id);
|
|
208
|
+
wrunHostWithoutUndoSteps(() => tc.removeOverlay(id));
|
|
203
209
|
}
|
|
204
210
|
/** Drop what a child registered for the hover surfaces (the symmetric
|
|
205
211
|
* retract of installChild and the canvas config builder). */
|
|
@@ -430,9 +436,11 @@ function seriesChildConfig(child, ctx) {
|
|
|
430
436
|
getLegendText: wrunSeriesChildLegendText(builtinTwin, ctx.priceDigits),
|
|
431
437
|
settings: {
|
|
432
438
|
...childLegendControls(ctx.parentName),
|
|
433
|
-
// Below the chart: the shared weight,
|
|
434
|
-
|
|
439
|
+
// Below the chart: the shared weight, the pane's declared share over it, and the plan's over both (a window's
|
|
440
|
+
// weight, or the height the reader dragged it to), the order a panel takes (panelConfig).
|
|
441
|
+
...(onPrice ? {} : { gridHeight: CHILD_PANE_GRID_HEIGHT }),
|
|
435
442
|
...settingWords,
|
|
443
|
+
...(!onPrice && ctx.planned?.has(id) === true ? { gridHeight: ctx.planned.get(id) } : {}),
|
|
436
444
|
...(palette.length > 0 ? { colors: palette } : {}),
|
|
437
445
|
...seriesChildChartSettings(parentSettings),
|
|
438
446
|
},
|
|
@@ -644,6 +652,9 @@ function legendOhlcLabels() {
|
|
|
644
652
|
* `legend: false` is never a line (kScriptLegendLines). A proven twin's pane
|
|
645
653
|
* (`builtinTwin`) prints by its built-in's legend rule instead. */
|
|
646
654
|
export function wrunSeriesChildLegendText(builtinTwin, priceDigits) {
|
|
655
|
+
// The slots this pane's legend hook has addressed: its answers pad only
|
|
656
|
+
// those, never the whole 16-slot pool (padKScriptLegendSlots).
|
|
657
|
+
const slots = createKScriptLegendSlotsUsed();
|
|
647
658
|
return (point, meta) => {
|
|
648
659
|
const placement = {
|
|
649
660
|
onPrice: false,
|
|
@@ -653,10 +664,10 @@ export function wrunSeriesChildLegendText(builtinTwin, priceDigits) {
|
|
|
653
664
|
const format = (value, line) => formatWrunLegendValue(value, placement, kScriptLegendLineFormat(meta, line), kScriptLegendLineFormatOptions(meta, line));
|
|
654
665
|
const entries = kScriptLegendEntries(point, meta, format, { ohlcLabels: legendOhlcLabels() });
|
|
655
666
|
if (entries.length > 1)
|
|
656
|
-
return padKScriptLegendSlots(entries);
|
|
667
|
+
return padKScriptLegendSlots(entries, slots);
|
|
657
668
|
const [line] = kScriptLegendLines(meta);
|
|
658
669
|
if (line === undefined)
|
|
659
|
-
return padKScriptLegendSlots([]);
|
|
670
|
+
return padKScriptLegendSlots([], slots);
|
|
660
671
|
const ts = Array.isArray(point) && typeof point[0] === 'number' ? point[0] : undefined;
|
|
661
672
|
const value = kScriptLegendLineValueAt(line, ts, { meta });
|
|
662
673
|
return padKScriptLegendSlots([
|
|
@@ -667,7 +678,7 @@ export function wrunSeriesChildLegendText(builtinTwin, priceDigits) {
|
|
|
667
678
|
color: KSCRIPT_LEGEND_VALUE_INK,
|
|
668
679
|
swatch: kScriptLegendLineSwatchAt(meta, line, ts),
|
|
669
680
|
},
|
|
670
|
-
]);
|
|
681
|
+
], slots);
|
|
671
682
|
};
|
|
672
683
|
}
|
|
673
684
|
/** The lower pane's static legend: the slot pool the dynamic readout
|
|
@@ -681,6 +692,22 @@ export function wrunSeriesChildLegendSlots(_palette) {
|
|
|
681
692
|
/** The series child's overlay id (`<parent>::series:<name>`), defined by the
|
|
682
693
|
* adapter (the visibility apply reads it there) and re-exported here. */
|
|
683
694
|
export { wrunSeriesChildId };
|
|
695
|
+
/** The heights a reader dragged an owner's child panes to (`<kind>:<name>:gridHeight` on the owner's settings, the
|
|
696
|
+
* viewer rows the store's saveGridHeights writes, wrunChildPaneHeightRowKey), by child id, each held between the
|
|
697
|
+
* drag floor and the rowless ceiling. Undefined when the owner remembers none
|
|
698
|
+
* (an older document, a pane never dragged): the mount then sizes as it always did. */
|
|
699
|
+
function rememberedChildPaneHeights(settings, overlayId) {
|
|
700
|
+
let heights;
|
|
701
|
+
for (const [key, value] of Object.entries(settings ?? {})) {
|
|
702
|
+
const id = wrunChildPaneHeightRowChildId(overlayId, key);
|
|
703
|
+
if (id === null || typeof value !== 'number' || !Number.isFinite(value) || value <= 0 || value >= 1)
|
|
704
|
+
continue;
|
|
705
|
+
// Held to what a drag can produce (titan layoutManager MIN_HEIGHT 0.1) and to the rowless ceiling (0.5): the
|
|
706
|
+
// restore reserves child panes unscaled (docs/features/chart/rowless-pane-heights.md).
|
|
707
|
+
(heights ??= new Map()).set(id, Math.min(Math.max(value, 0.1), 0.5));
|
|
708
|
+
}
|
|
709
|
+
return heights;
|
|
710
|
+
}
|
|
684
711
|
function isSeriesChildId(id) {
|
|
685
712
|
return id.includes('::series:');
|
|
686
713
|
}
|
|
@@ -1232,6 +1259,74 @@ function isHeatmapRecord(record) {
|
|
|
1232
1259
|
function isWindowRecord(record) {
|
|
1233
1260
|
return isHeatmapRecord(record) || isBatchedRecord(record);
|
|
1234
1261
|
}
|
|
1262
|
+
// ── A heatmap's colour scale: decided once per picture ──────────────────────────────────────────────────
|
|
1263
|
+
//
|
|
1264
|
+
// Every pass hands the picture its rows were computed for (`pictureIdentity`, the one derivation
|
|
1265
|
+
// `wrunPictureIdentityOf` in wrun-overlay-drivers.util: the compute settings revision and the market identity of the
|
|
1266
|
+
// run or live session that computed them, with the reasons those two facts are the identity).
|
|
1267
|
+
/**
|
|
1268
|
+
* The picture each mounted heatmap's colour scale was decided under, keyed (like its scale sample,
|
|
1269
|
+
* wrun-canvases.util `heatmapSamples`) by its input's `settings` object: every seam that keeps a record (a live
|
|
1270
|
+
* merge, a trim, a windowed landing, a retranslate, a rescale, a blank, a landing's roll-back) copies the input as
|
|
1271
|
+
* `{ ...input, data }` or keeps it whole, so the stamp travels with the bounds it names and no seam has to copy it.
|
|
1272
|
+
*/
|
|
1273
|
+
const decidedPictures = new WeakMap();
|
|
1274
|
+
/** A heatmap pass decides its own colour scale (its install, or a whole-window pass of another picture): the
|
|
1275
|
+
* record it becomes is stamped with the pass's picture (none when the pass named none). */
|
|
1276
|
+
function decideHeatmapScale(entry, picture) {
|
|
1277
|
+
if (entry.input.kind !== 'heatmap')
|
|
1278
|
+
return;
|
|
1279
|
+
if (picture !== undefined)
|
|
1280
|
+
decidedPictures.set(entry.input.settings, picture);
|
|
1281
|
+
else
|
|
1282
|
+
decidedPictures.delete(entry.input.settings);
|
|
1283
|
+
}
|
|
1284
|
+
/**
|
|
1285
|
+
* Whether a whole-window pass of `picture` keeps the colour scale `stayed` shows: the same picture decided it, its
|
|
1286
|
+
* sample gave the bounds on screen at the quantile they are read at (`sensitivity`, the viewer's position now;
|
|
1287
|
+
* `wrunHeatmapScaleDecided`: an empty sample, one whose cells all sit at the floor or the centre, or one where the
|
|
1288
|
+
* quantile's share of them does, decided nothing, and its stand-in bounds would saturate every cell the next rows
|
|
1289
|
+
* bring), on a record no blank emptied (a symbol, interval or session switch blanks the children, and the rows that
|
|
1290
|
+
* come after it are a new load), under the same scale declaration. Anything else decides again from the pass's own
|
|
1291
|
+
* rows.
|
|
1292
|
+
*/
|
|
1293
|
+
function holdsHeatmapScale(stayed, entry, picture, sensitivity) {
|
|
1294
|
+
return (picture !== undefined &&
|
|
1295
|
+
stayed.blanked !== true &&
|
|
1296
|
+
isHeatmapRecord(stayed) &&
|
|
1297
|
+
entry.input.kind === 'heatmap' &&
|
|
1298
|
+
decidedPictures.get(stayed.input.settings) === picture &&
|
|
1299
|
+
wrunHeatmapScaleDecided(stayed.input, sensitivity) &&
|
|
1300
|
+
heatmapScaleDeclaration(stayed.input) === heatmapScaleDeclaration(entry.input));
|
|
1301
|
+
}
|
|
1302
|
+
/** The words a heatmap's colour scale is built under: its Sensitivity inputs when it has a row (the author's scale
|
|
1303
|
+
* words, the layout and value word the sample reads) and the words its settings carry (the cell layout, the value
|
|
1304
|
+
* word, the curve, the centre). Equal under one picture by construction (they move only with a compute save or
|
|
1305
|
+
* the script); compared all the same, so a scale is never carried onto another declaration. */
|
|
1306
|
+
function heatmapScaleDeclaration(child) {
|
|
1307
|
+
const { cellLayout, valueField, scale, center } = child.settings;
|
|
1308
|
+
return JSON.stringify([child.scale ?? null, cellLayout, valueField, scale, center]);
|
|
1309
|
+
}
|
|
1310
|
+
/**
|
|
1311
|
+
* Carry the colour scale `stayed` shows onto `entry`, the record a pass stores while it keeps that scale: the pass's
|
|
1312
|
+
* own child (its rows, every other setting it built) with the decided own bounds, the decided sample beside them
|
|
1313
|
+
* (`keepWrunHeatmapScaleSample`) and the decided picture, and the config at those bounds (the viewer's Sensitivity
|
|
1314
|
+
* re-picks them from the decided sample right after, `repickHeatmapBounds`). The pass's rows still swap or merge as
|
|
1315
|
+
* it asks; only the scale is held. The run result's own child is never written: the record takes a copy.
|
|
1316
|
+
*/
|
|
1317
|
+
function carryHeatmapScale(stayed, entry) {
|
|
1318
|
+
if (entry.input.kind !== 'heatmap')
|
|
1319
|
+
return;
|
|
1320
|
+
const { min, max } = stayed.input.settings;
|
|
1321
|
+
const held = { ...entry.input, settings: { ...entry.input.settings, min, max } };
|
|
1322
|
+
keepWrunHeatmapScaleSample(stayed.input, held);
|
|
1323
|
+
const picture = decidedPictures.get(stayed.input.settings);
|
|
1324
|
+
if (picture !== undefined)
|
|
1325
|
+
decidedPictures.set(held.settings, picture);
|
|
1326
|
+
entry.input = held;
|
|
1327
|
+
entry.config.settings.min = min;
|
|
1328
|
+
entry.config.settings.max = max;
|
|
1329
|
+
}
|
|
1235
1330
|
/** The merge of a pass into a mounted heatmap's or batched child's window and its budget, planned from the
|
|
1236
1331
|
* record's rows (the rows the mount means the engine to hold, a trim titan still queues included), writing
|
|
1237
1332
|
* nothing. */
|
|
@@ -1302,8 +1397,9 @@ function landHeatmapWindow(tc, overlayId, state, record, plan, deferred = NO_DEF
|
|
|
1302
1397
|
}
|
|
1303
1398
|
return landed;
|
|
1304
1399
|
}
|
|
1400
|
+
// The landed input shares the record's settings, so the decided scale (its sample and its picture, both kept
|
|
1401
|
+
// beside the settings) stays the one a Sensitivity re-pick and the next pass read.
|
|
1305
1402
|
commitWrunHeatmapPlan(tc, plan.budget.plan, held);
|
|
1306
|
-
keepWrunHeatmapScaleSample(record.input.data, rows);
|
|
1307
1403
|
for (const sibling of wrunHeatmapChildrenOverShare(tc, overlayId, plan.childId, held)) {
|
|
1308
1404
|
if (!deferred.has(sibling))
|
|
1309
1405
|
budgetMountedHeatmap(tc, overlayId, sibling);
|
|
@@ -1764,7 +1860,7 @@ function mountContext(tc, overlayId, parent, children, priceDigits, chartHeightP
|
|
|
1764
1860
|
* precision (OT29, X7): the panels' formatters and the lower pane's legend
|
|
1765
1861
|
* print "price" values with it. A tick's heatmap tail (`tailOnly`) only
|
|
1766
1862
|
* ever merges its rows into a mounted canvas. */
|
|
1767
|
-
export function mountWrunChildOverlays({ tc, overlayId, runResult, replaceFrames = true, swapCanvasRows, canvasRowsFromTs, historyWindow, projection, cell, priceDigits, onMainThreadMs, chartIndex, }) {
|
|
1863
|
+
export function mountWrunChildOverlays({ tc, overlayId, runResult, replaceFrames = true, swapCanvasRows, canvasRowsFromTs, historyWindow, projection, pictureIdentity, cell, priceDigits, onMainThreadMs, chartIndex, }) {
|
|
1768
1864
|
if (runResult.failureReason !== undefined)
|
|
1769
1865
|
return Promise.reject(new Error(runResult.failureReason));
|
|
1770
1866
|
if (tc.isDestroyed)
|
|
@@ -1846,6 +1942,10 @@ export function mountWrunChildOverlays({ tc, overlayId, runResult, replaceFrames
|
|
|
1846
1942
|
planned = new Map(weights.map(({ id, gridHeight }) => [id, gridHeight]));
|
|
1847
1943
|
}
|
|
1848
1944
|
}
|
|
1945
|
+
// A normal cell the host hands no plan: the heights the reader dragged the child panes to, kept on the owner's
|
|
1946
|
+
// row (rememberedChildPaneHeights), so a layout or tab switch and a reload remount each pane at its height.
|
|
1947
|
+
if (!windowCell && !planned)
|
|
1948
|
+
planned = rememberedChildPaneHeights(parent.settings, overlayId);
|
|
1849
1949
|
current.windowCell = windowCell;
|
|
1850
1950
|
current.planned = planned;
|
|
1851
1951
|
// The words an empty panel pane shows: re-read on every pass that carries frames (a tick carries no drawings and
|
|
@@ -1918,9 +2018,12 @@ export function mountWrunChildOverlays({ tc, overlayId, runResult, replaceFrames
|
|
|
1918
2018
|
}
|
|
1919
2019
|
const gated = entry.input.newer !== undefined ? 'old-engine' : batchedGateCause(tc, entry.config.plot, packs[at]);
|
|
1920
2020
|
// The engine draws the kind: a look its kind renderer would draw as another (the diamond, the log size law
|
|
1921
|
-
// and its px bounds before the engine release that draws flags,
|
|
1922
|
-
//
|
|
1923
|
-
|
|
2021
|
+
// and its px bounds before the engine release that draws flags; Glass, Solid and the size beside the mark
|
|
2022
|
+
// before the marks pack that reads level 2, wrunBatchedEngineVerdict) is refused by name and reason like a
|
|
2023
|
+
// layout newer than this chart, never drawn as another look.
|
|
2024
|
+
const engineShort = gated === null
|
|
2025
|
+
? wrunBatchedEngineVerdict(entry.input, (type) => tc.hasPlotRenderer?.(type) === true, wrunBatchedMarksLevelOf(tc))
|
|
2026
|
+
: null;
|
|
1924
2027
|
const newer = entry.input.newer ?? engineShort ?? undefined;
|
|
1925
2028
|
const cause = newer !== undefined ? 'old-engine' : gated;
|
|
1926
2029
|
if (cause === null)
|
|
@@ -2005,7 +2108,8 @@ export function mountWrunChildOverlays({ tc, overlayId, runResult, replaceFrames
|
|
|
2005
2108
|
current.children = new Map(preserved);
|
|
2006
2109
|
// The configs were built before the pack await: a heatmap about to be
|
|
2007
2110
|
// installed or refreshed re-picks its bounds from the Sensitivity it holds
|
|
2008
|
-
// NOW (a drag or a save during the await), never the one it was built with
|
|
2111
|
+
// NOW (a drag or a save during the await), never the one it was built with,
|
|
2112
|
+
// over the scale its record keeps (its own, or the one carried onto it).
|
|
2009
2113
|
const repickHeatmapBounds = ({ input, config }) => {
|
|
2010
2114
|
if (input.kind !== 'heatmap' || input.scale === undefined)
|
|
2011
2115
|
return;
|
|
@@ -2046,6 +2150,8 @@ export function mountWrunChildOverlays({ tc, overlayId, runResult, replaceFrames
|
|
|
2046
2150
|
forgetWrunCanvasReadout(id);
|
|
2047
2151
|
}
|
|
2048
2152
|
else if (!mounted) {
|
|
2153
|
+
// An install decides a heatmap's colour scale from its own rows, exactly as before the hold.
|
|
2154
|
+
decideHeatmapScale(entry, pictureIdentity);
|
|
2049
2155
|
repickHeatmapBounds(entry);
|
|
2050
2156
|
current.children.set(id, entry);
|
|
2051
2157
|
budgetHeatmapChild(tc, overlayId, entry);
|
|
@@ -2104,6 +2210,18 @@ export function mountWrunChildOverlays({ tc, overlayId, runResult, replaceFrames
|
|
|
2104
2210
|
swapCanvasRows === true ||
|
|
2105
2211
|
!sameDataWindow(mountedConfig, config) ||
|
|
2106
2212
|
canvasGridMoved(mountedConfig, config)) {
|
|
2213
|
+
// A whole-window pass swaps the rows. A heatmap keeps the colour scale on screen while the pass is
|
|
2214
|
+
// of the picture that decided it (a reseed, a refine, an eviction's or a gap's swap, a window that
|
|
2215
|
+
// rolled past the mounted rows, a rerun with nothing changed): its rows repaint at the decided
|
|
2216
|
+
// bounds. A pass of another picture (an input, the symbol or the interval moved), one that named no
|
|
2217
|
+
// picture, and a record whose scale an empty sample or a blank left undecided decide it again from
|
|
2218
|
+
// the pass's own rows (2026-11-07: every rebuild re-picked from the rows held then, so cells on
|
|
2219
|
+
// screen changed brightness while nothing they showed had changed).
|
|
2220
|
+
const sensitivity = heatmapSensitivityOf(current.previews, parent, input.name);
|
|
2221
|
+
if (holdsHeatmapScale(stayed, entry, pictureIdentity, sensitivity))
|
|
2222
|
+
carryHeatmapScale(stayed, entry);
|
|
2223
|
+
else
|
|
2224
|
+
decideHeatmapScale(entry, pictureIdentity);
|
|
2107
2225
|
repickHeatmapBounds(entry);
|
|
2108
2226
|
budgetHeatmapChild(tc, overlayId, entry);
|
|
2109
2227
|
refreshChildInPlace(tc, mountedConfig, config);
|
|
@@ -2116,6 +2234,14 @@ export function mountWrunChildOverlays({ tc, overlayId, runResult, replaceFrames
|
|
|
2116
2234
|
const held = mountedHeatmapRecord(tc, id);
|
|
2117
2235
|
if (held !== undefined)
|
|
2118
2236
|
keepHeatmapRows(entry, held.config.data);
|
|
2237
|
+
// A merge hands the engine rows only, so the screen keeps the scale it shows; the record keeps it too
|
|
2238
|
+
// (the pass's own bounds and sample, picked from its rows, would reach the screen at the next
|
|
2239
|
+
// retranslate, Sensitivity re-pick or windowed landing), a stand-in included: the next whole-window
|
|
2240
|
+
// pass decides that one again (holdsHeatmapScale).
|
|
2241
|
+
if (isHeatmapRecord(held) && wrunHeatmapScaleKept(held.input)) {
|
|
2242
|
+
carryHeatmapScale(held, entry);
|
|
2243
|
+
repickHeatmapBounds(entry);
|
|
2244
|
+
}
|
|
2119
2245
|
current.children.set(id, entry);
|
|
2120
2246
|
}
|
|
2121
2247
|
}
|
|
@@ -54,6 +54,7 @@ import { Exchange } from '@orangecharts/orange-v2-pb-common';
|
|
|
54
54
|
import { delimiter } from '../../constants/data-source.constants.js';
|
|
55
55
|
import { Intervals } from '../../constants/interval.constants.js';
|
|
56
56
|
import { checkIsIndexMode } from '../chart/index-mode.util.js';
|
|
57
|
+
import { PUBLISHER_ONLY_EXCHANGES } from '../../constants/economic.constants.js';
|
|
57
58
|
import { normalizeLegacyExchange } from '../chart/legacy-exchange.leaf.js';
|
|
58
59
|
import { extractTokensFromTransformations, parsedTransformations } from '../common/transformations.util.js';
|
|
59
60
|
import { wrunChartHostEnv } from '../../host-env.js';
|
|
@@ -117,7 +118,10 @@ function wrunPinVenueIsSessionGrid(exchange) {
|
|
|
117
118
|
* rewritten: wrun-pin-spelling.util respells the run's copy). Exact, as the wire reads the word. */
|
|
118
119
|
export function wrunPinVenueOnWire(exchange) {
|
|
119
120
|
const code = Exchange[exchange];
|
|
120
|
-
return (typeof code === 'number' &&
|
|
121
|
+
return (typeof code === 'number' &&
|
|
122
|
+
code !== Exchange.UNKNOWN_EXCHANGE &&
|
|
123
|
+
!PUBLISHER_ONLY_EXCHANGES.has(exchange) &&
|
|
124
|
+
normalizeLegacyExchange(exchange) === exchange);
|
|
121
125
|
}
|
|
122
126
|
/** What the chart does with a pin on `exchange`: `refused` (a CME Group venue the run's facts do not
|
|
123
127
|
* open, by name, the run does not start), `unserved` (an index venue the gateway does not serve to
|
|
@@ -302,6 +302,10 @@ export declare function wrunAuthorRuleSeed(code: string, out?: WrunRefusalOut):
|
|
|
302
302
|
/** The code of an engine trap no runtime row explains (`RuntimeError: memory access out of bounds`): the record and
|
|
303
303
|
* the events name it, and its cause reads `other`, never `none` (nothing explains which line of the code broke). */
|
|
304
304
|
export declare const WRUN_ENGINE_TRAP_CODE = "engine_trap";
|
|
305
|
+
/** The ONE record of a refused tape interval, the browser lane's (wrun-overlay-run.util
|
|
306
|
+
* `assertWrunTapeServedOnInterval`) and the cloud's: a calendar chart is coarser than the tape serves, a typed
|
|
307
|
+
* candle size (20m, 2d) sits on no rung the tape could name, any other (one second) is finer. */
|
|
308
|
+
export declare function wrunTapeIntervalSeed(chartInterval: string): WrunRefusalSeed;
|
|
305
309
|
/**
|
|
306
310
|
* The record seed of a refusal the cloud answered, by its code and the facts its frame carried
|
|
307
311
|
* (wrun-hosted-wire-caps `WrunFrameRefusal`), never its sentence: the no-candles answer is the browser
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
* name the cause the record names.
|
|
47
47
|
*/
|
|
48
48
|
import { Intervals } from '../../constants/interval.constants.js';
|
|
49
|
+
import { isTypedWidth } from '../../constants/typed-width.leaf.js';
|
|
49
50
|
import { isGateProvider } from '../../workers/constants/socket-slots.js';
|
|
50
51
|
import { isCalendarIntervalLabel } from '../chart/calendar-interval.util.js';
|
|
51
52
|
import { walledVenueOf } from '../v2/gate-plane.util.js';
|
|
@@ -239,6 +240,10 @@ const VARIANTS = {
|
|
|
239
240
|
'interval-unserved': {
|
|
240
241
|
fine: row('wrun.refusal.sentence.intervalUnserved', 'wrun.refusal.chip.intervalUnserved', ['feed', 'interval', 'chartInterval'], { severity: 'paused' }),
|
|
241
242
|
coarse: row('wrun.refusal.sentence.intervalTooCoarse', 'wrun.refusal.chip.intervalTooCoarse', ['feed', 'interval', 'chartInterval'], { severity: 'paused' }),
|
|
243
|
+
// A typed candle size (20m, 2d): no finer or coarser rung to name, so the way out is the interval list.
|
|
244
|
+
typed: row('wrun.refusal.sentence.intervalTyped', 'wrun.refusal.chip.intervalTyped', ['feed', 'chartInterval'], {
|
|
245
|
+
severity: 'paused',
|
|
246
|
+
}),
|
|
242
247
|
// The Indicator itself needs a chart this fine (TPO letters a coarser bar cannot place): it
|
|
243
248
|
// names no feed, the Indicator's name is the subject.
|
|
244
249
|
'at-most': row('wrun.refusal.sentence.intervalAtMost', 'wrun.refusal.chip.intervalAtMost', ['interval', 'chartInterval'], { severity: 'paused' }),
|
|
@@ -282,13 +287,18 @@ const VARIANTS = {
|
|
|
282
287
|
// The same wall on a US stocks tape the run may not read (kscript-venue-policy `isUserKScriptBlockedOnExchange`):
|
|
283
288
|
// `venue` names the tape's listing venue (NASDAQ), never CME.
|
|
284
289
|
stocks: row('wrun.refusal.sentence.stocksWall', 'wrun.refusal.chip.stocksWall', ['venue'], { severity: 'paused' }),
|
|
290
|
+
// The US stocks plane's server lane refusing a viewer with no US stock data (`stocks_entitlement_required`): the
|
|
291
|
+
// account's registration words, the tape's chip.
|
|
292
|
+
'stocks-access': row('indicators.stocks.registrationRequired', 'wrun.refusal.chip.stocksWall', ['venue'], {
|
|
293
|
+
severity: 'paused',
|
|
294
|
+
}),
|
|
285
295
|
// The CME chain wall: works-on (CME markets), never the switch OUT, a Binance perp where the chain is walled again.
|
|
286
296
|
chain: row('wrun.refusal.sentence.cmeChain', 'wrun.refusal.chip.cmeChain', [], {
|
|
287
297
|
severity: 'paused',
|
|
288
298
|
out: { kind: 'works-on' },
|
|
289
299
|
}),
|
|
290
300
|
// CME user studies (the `cme-user-scripts` gate, kscript-venue-policy.util `isCmeUserScriptRun`): a hosted (Cloud)
|
|
291
|
-
// run on CME
|
|
301
|
+
// run on CME while `cme-lanes` is dark (reversed 2026-11-11), or a server `cme_lane_unavailable`.
|
|
292
302
|
cloud: row('wrun.refusal.sentence.cmeCloud', 'wrun.refusal.chip.cmeCloud', [], { severity: 'paused' }),
|
|
293
303
|
// A running study the gate stopped in place when the viewer's access moved (the account, the CME data terms, the
|
|
294
304
|
// served access, the session): its source and settings stay.
|
|
@@ -300,8 +310,9 @@ const VARIANTS = {
|
|
|
300
310
|
'studies-off': row('wrun.refusal.sentence.cmeStudiesOff', 'wrun.refusal.chip.cmeStudiesOff', [], {
|
|
301
311
|
severity: 'paused',
|
|
302
312
|
}),
|
|
303
|
-
// A strategy sheet on a CME chart, whoever wrote it (Kyle 2026-10-29
|
|
304
|
-
//
|
|
313
|
+
// A strategy sheet on a CME chart, whoever wrote it, while the `cme-lanes` flag is dark (Kyle 2026-10-29,
|
|
314
|
+
// kscript-venue-policy `isCmeStrategyClosed`): strategy testing is no CME chart study, so the run head refuses it
|
|
315
|
+
// before any fetch (wrun-overlay-run.util, `WrunStrategyVenueBlockedError`).
|
|
305
316
|
strategy: row('wrun.refusal.sentence.cmeStrategy', 'wrun.refusal.chip.cmeStrategy', [], { severity: 'paused' }),
|
|
306
317
|
// A sheet with an input read by the chart's coin on a prediction market (Kyle 2026-10-29): the run head refuses it
|
|
307
318
|
// before any fetch (wrun-overlay-run.util, `WrunPredictionMarketBlockedError`; the rule is
|
|
@@ -842,6 +853,66 @@ function numberMatch(message, re) {
|
|
|
842
853
|
const n = Number(match[1]);
|
|
843
854
|
return Number.isFinite(n) ? n : undefined;
|
|
844
855
|
}
|
|
856
|
+
/**
|
|
857
|
+
* The governed planes' server-lane codes (the governed-lanes cutover: `cme-lanes`, `stocks-lanes`), `<plane>_<reason>`
|
|
858
|
+
* as kscript-backend answers them for a hosted run or a protected script, read like the OPRA lane's codes
|
|
859
|
+
* (opra-alert-refusal.util: the code itself, or the code named in the words). Every one maps onto a row that already
|
|
860
|
+
* has words, so a lit flag over a server lane that is still off shows copy, never an empty pane.
|
|
861
|
+
*/
|
|
862
|
+
const WRUN_GOVERNED_LANE_CODE = '(cme|stocks)_(entitlement_required|realtime_required|entitlement_changed|tier_changed|lane_unavailable|' +
|
|
863
|
+
'upstream_unavailable|actor_required|grant_refused)';
|
|
864
|
+
const WRUN_GOVERNED_LANE_CODE_RE = new RegExp(`\\b${WRUN_GOVERNED_LANE_CODE}\\b`);
|
|
865
|
+
const WRUN_GOVERNED_LANE_CODE_EXACT_RE = new RegExp(`^${WRUN_GOVERNED_LANE_CODE}$`);
|
|
866
|
+
/** The governed plane and reason of a server-lane code, or undefined for any other code. */
|
|
867
|
+
function wrunGovernedLaneCodeOf(code) {
|
|
868
|
+
const match = WRUN_GOVERNED_LANE_CODE_EXACT_RE.exec(code);
|
|
869
|
+
return match === null
|
|
870
|
+
? undefined
|
|
871
|
+
: { plane: match[1], reason: match[2] };
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* The record seed of a governed plane's server-lane code (`wrunGovernedLaneCodeOf`), onto the rows that already hold
|
|
875
|
+
* its words: the viewer holds no access (`entitlement_required`: CME's terms row, its pin the market the frame names,
|
|
876
|
+
* else the chart's, else CME; the stocks plane's registration row, its venue the tape's), the access or
|
|
877
|
+
* the served tier moved under a running study (`entitlement_changed`, the `tier_changed` event: "Access changed; the
|
|
878
|
+
* study stopped"), the plane's server lane is off (`lane_unavailable`: CME's browser-only row, the stocks tape's wall
|
|
879
|
+
* by its venue), the plane's upstream did not answer (`upstream_unavailable`: the envelope's market-data row, Retry).
|
|
880
|
+
* The viewer's access does not cover real time there (`realtime_required`) reads as `entitlement_required` does; a
|
|
881
|
+
* server-side fault the viewer cannot fix (`actor_required`: the run was not sent as an owner; `grant_refused`: its
|
|
882
|
+
* grant was refused) reads as the market-data row, Retry. Undefined for any other code.
|
|
883
|
+
*/
|
|
884
|
+
function wrunGovernedLaneSeed(code, value, ctx) {
|
|
885
|
+
const governed = wrunGovernedLaneCodeOf(code);
|
|
886
|
+
if (governed === undefined)
|
|
887
|
+
return undefined;
|
|
888
|
+
const { plane, reason } = governed;
|
|
889
|
+
switch (reason) {
|
|
890
|
+
case 'entitlement_required':
|
|
891
|
+
case 'realtime_required':
|
|
892
|
+
return plane === 'cme'
|
|
893
|
+
? { cls: 'pin-refused', variant: 'terms', params: { pin: value || ctx?.chart?.symbol || 'CME' } }
|
|
894
|
+
: {
|
|
895
|
+
cls: 'cme-wall',
|
|
896
|
+
variant: 'stocks-access',
|
|
897
|
+
params: { venue: stocksTapeVenueLabel(value || ctx?.chart?.exchange || '') || 'US' },
|
|
898
|
+
};
|
|
899
|
+
case 'entitlement_changed':
|
|
900
|
+
case 'tier_changed':
|
|
901
|
+
return { cls: 'cme-wall', variant: 'stopped' };
|
|
902
|
+
case 'lane_unavailable':
|
|
903
|
+
if (plane === 'cme')
|
|
904
|
+
return { cls: 'cme-wall', variant: 'cloud' };
|
|
905
|
+
return {
|
|
906
|
+
cls: 'cme-wall',
|
|
907
|
+
variant: 'stocks',
|
|
908
|
+
params: { venue: stocksTapeVenueLabel(value || ctx?.chart?.exchange || '') || 'US' },
|
|
909
|
+
};
|
|
910
|
+
case 'upstream_unavailable':
|
|
911
|
+
case 'actor_required':
|
|
912
|
+
case 'grant_refused':
|
|
913
|
+
return { cls: 'service-no-answer', variant: 'market-data' };
|
|
914
|
+
}
|
|
915
|
+
}
|
|
845
916
|
/** The seed a stable code in the message names, or undefined. */
|
|
846
917
|
function seedFromCodes(message, ctx) {
|
|
847
918
|
if (message.includes('wrun_cell_block_too_large')) {
|
|
@@ -886,6 +957,10 @@ function seedFromCodes(message, ctx) {
|
|
|
886
957
|
return wrunAuthorRuleSeed(optionsCode);
|
|
887
958
|
}
|
|
888
959
|
}
|
|
960
|
+
// A governed plane's server-lane code (the governed-lanes cutover, `<plane>_<reason>`) named in the words.
|
|
961
|
+
const governed = WRUN_GOVERNED_LANE_CODE_RE.exec(message)?.[0];
|
|
962
|
+
if (governed !== undefined)
|
|
963
|
+
return wrunGovernedLaneSeed(governed, undefined, ctx);
|
|
889
964
|
// Unseeded, the words are a server host's (the browser lane always attaches its seed): the server lanes read no CME.
|
|
890
965
|
if (message.includes('wrun_pin_venue_refused')) {
|
|
891
966
|
const pin = /\bwrun_pin_venue_refused: (\S+) is CME\b/.exec(message)?.[1] ??
|
|
@@ -961,13 +1036,17 @@ const TAB_FULL_REFUSAL_CODES = new Set([
|
|
|
961
1036
|
'wrun_foreign_sources_over_cap',
|
|
962
1037
|
'wrun_instances_over_cap',
|
|
963
1038
|
]);
|
|
964
|
-
/** The
|
|
965
|
-
* `assertWrunTapeServedOnInterval`): a calendar chart is coarser than the tape serves,
|
|
966
|
-
* (one second) finer. */
|
|
967
|
-
function
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
1039
|
+
/** The ONE record of a refused tape interval, the browser lane's (wrun-overlay-run.util
|
|
1040
|
+
* `assertWrunTapeServedOnInterval`) and the cloud's: a calendar chart is coarser than the tape serves, a typed
|
|
1041
|
+
* candle size (20m, 2d) sits on no rung the tape could name, any other (one second) is finer. */
|
|
1042
|
+
export function wrunTapeIntervalSeed(chartInterval) {
|
|
1043
|
+
if (isCalendarIntervalLabel(chartInterval)) {
|
|
1044
|
+
return { cls: 'interval-unserved', variant: 'coarse', params: { feed: 'tape', interval: '1M', chartInterval } };
|
|
1045
|
+
}
|
|
1046
|
+
if (isTypedWidth(chartInterval)) {
|
|
1047
|
+
return { cls: 'interval-unserved', variant: 'typed', params: { feed: 'tape', chartInterval } };
|
|
1048
|
+
}
|
|
1049
|
+
return { cls: 'interval-unserved', variant: 'fine', params: { feed: 'tape', interval: '1m', chartInterval } };
|
|
971
1050
|
}
|
|
972
1051
|
/**
|
|
973
1052
|
* The record seed of a refusal the cloud answered, by its code and the facts its frame carried
|
|
@@ -998,7 +1077,7 @@ export function wrunCloudRefusalSeed(code, facts = {}, ctx) {
|
|
|
998
1077
|
const value = chart ? undefined : facts.value;
|
|
999
1078
|
const chartInterval = chart?.interval ?? value;
|
|
1000
1079
|
if (code === 'wrun_tape_interval_unsupported' && chartInterval)
|
|
1001
|
-
return
|
|
1080
|
+
return wrunTapeIntervalSeed(chartInterval);
|
|
1002
1081
|
if (TAB_FULL_REFUSAL_CODES.has(code)) {
|
|
1003
1082
|
const params = { code };
|
|
1004
1083
|
if (facts.limit !== undefined && Number.isFinite(facts.limit))
|
|
@@ -1019,13 +1098,16 @@ export function wrunCloudRefusalSeed(code, facts = {}, ctx) {
|
|
|
1019
1098
|
if (code === 'wrun_options_chain_venue_unavailable' && coin !== '' && venue !== undefined) {
|
|
1020
1099
|
return { cls: 'no-options', variant: 'venue', params: { venue, coin } };
|
|
1021
1100
|
}
|
|
1022
|
-
// A pin on CME data names the venue the frame names, else CME; a server host
|
|
1101
|
+
// A pin on CME data names the venue the frame names, else CME; a server host's pin refusal reads `cloud`.
|
|
1023
1102
|
if (code === 'wrun_pin_venue_refused') {
|
|
1024
1103
|
return { cls: 'pin-refused', variant: 'cloud', params: { pin: facts.value ?? 'CME' } };
|
|
1025
1104
|
}
|
|
1026
1105
|
if (code === 'wrun_pin_venue_unknown' && facts.value) {
|
|
1027
1106
|
return { cls: 'run-failed', variant: 'pin-venue-unknown', params: { venue: facts.value } };
|
|
1028
1107
|
}
|
|
1108
|
+
const governed = wrunGovernedLaneSeed(code, facts.value, ctx);
|
|
1109
|
+
if (governed !== undefined)
|
|
1110
|
+
return governed;
|
|
1029
1111
|
return { cls: 'run-failed', variant: 'refused', params: { code } };
|
|
1030
1112
|
}
|
|
1031
1113
|
/** The record seed of a presentation family a source left out of a batch that drew (a note: the rest
|
|
@@ -1051,6 +1133,11 @@ function cloudRefusalOfError(error, message, answer) {
|
|
|
1051
1133
|
const coded = socketRefusalOf(error) ?? wrunFrameRefusalOf(message);
|
|
1052
1134
|
if (coded !== undefined)
|
|
1053
1135
|
return coded;
|
|
1136
|
+
// A governed plane's server-lane code rides the frame's words (`[VENUE_NOT_ALLOWED] ... cme_lane_unavailable`, the
|
|
1137
|
+
// OPRA lane's shape): it names the refusal before the frame's own code does.
|
|
1138
|
+
const governed = WRUN_GOVERNED_LANE_CODE_RE.exec(message)?.[0];
|
|
1139
|
+
if (governed !== undefined)
|
|
1140
|
+
return { code: governed };
|
|
1054
1141
|
if (answer?.frameCode !== undefined && (answer.memory !== undefined || answer.unknownCode === true)) {
|
|
1055
1142
|
return { code: answer.frameCode };
|
|
1056
1143
|
}
|
|
@@ -1281,7 +1368,9 @@ function variantFor(seed, ctx) {
|
|
|
1281
1368
|
return ctx.chart?.cme ? 'unresolved' : 'chain';
|
|
1282
1369
|
}
|
|
1283
1370
|
case 'interval-unserved':
|
|
1284
|
-
return declared === 'coarse' || declared === '
|
|
1371
|
+
return declared === 'coarse' || declared === 'typed' || declared === 'at-most' || declared === 'exact'
|
|
1372
|
+
? declared
|
|
1373
|
+
: 'fine';
|
|
1285
1374
|
case 'service-no-answer':
|
|
1286
1375
|
if (declared !== undefined && variantSpec('service-no-answer', declared))
|
|
1287
1376
|
return declared;
|
|
@@ -76,9 +76,11 @@ export declare class WrunVenueBlockedError extends WrunRegistryAddRefusedError {
|
|
|
76
76
|
}
|
|
77
77
|
export declare function isWrunVenueBlockedError(error: unknown): error is WrunVenueBlockedError;
|
|
78
78
|
/** Thrown at the head of the WRUN run pass for a strategy sheet on a CME
|
|
79
|
-
* chart
|
|
80
|
-
*
|
|
81
|
-
*
|
|
79
|
+
* chart while the `cme-lanes` cutover flag is dark (kscript-venue-policy
|
|
80
|
+
* `isCmeStrategyClosed`): strategy testing is no CME chart study, so every
|
|
81
|
+
* strategy is refused there, an OpenMarket package's included (Kyle
|
|
82
|
+
* 2026-10-29), before anything is fetched or computed. Under a lit flag a
|
|
83
|
+
* strategy sheet on a CME chart runs through the ordinary CME study rule. A venue refusal like the wall's
|
|
82
84
|
* (the venue policy's own message, so the kScript error envelope reads
|
|
83
85
|
* VENUE_BLOCKED, and the same held settle: the run after the chart leaves
|
|
84
86
|
* CME computes), with one difference: no wall painter stands behind it (the
|
|
@@ -95,9 +95,11 @@ export function isWrunVenueBlockedError(error) {
|
|
|
95
95
|
return error instanceof WrunVenueBlockedError;
|
|
96
96
|
}
|
|
97
97
|
/** Thrown at the head of the WRUN run pass for a strategy sheet on a CME
|
|
98
|
-
* chart
|
|
99
|
-
*
|
|
100
|
-
*
|
|
98
|
+
* chart while the `cme-lanes` cutover flag is dark (kscript-venue-policy
|
|
99
|
+
* `isCmeStrategyClosed`): strategy testing is no CME chart study, so every
|
|
100
|
+
* strategy is refused there, an OpenMarket package's included (Kyle
|
|
101
|
+
* 2026-10-29), before anything is fetched or computed. Under a lit flag a
|
|
102
|
+
* strategy sheet on a CME chart runs through the ordinary CME study rule. A venue refusal like the wall's
|
|
101
103
|
* (the venue policy's own message, so the kScript error envelope reads
|
|
102
104
|
* VENUE_BLOCKED, and the same held settle: the run after the chart leaves
|
|
103
105
|
* CME computes), with one difference: no wall painter stands behind it (the
|