@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
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The words a chart surface names a wrun output by (TWIN-LEGEND, Kyle 2026-11-08): the one rule the legend's line
|
|
3
|
+
* names (the run result's `labels`, wrun-run-result.util, which the legend, the data window and a lower pane's legend
|
|
4
|
+
* read), the hover cards (wrun-hover.util) and the silent-output chip (wrun-run-health.util) read.
|
|
5
|
+
*
|
|
6
|
+
* A proven twin's sheet keeps each line's kScript label as the output's `label` (MACD's `macdLine` and `signalLine`,
|
|
7
|
+
* Bollinger Bands' `UpperBand` and `Lower Band`, ADX's `DiPlus`): that label is the built-in's contract output, the
|
|
8
|
+
* anchor its alerts and stored settings match the line by, so the sheet cannot reword it. The legend's rule prints a
|
|
9
|
+
* declared label as written (wrunLegendName), so every chart surface printed those ids. For an overlay that ports a
|
|
10
|
+
* built-in (`builtIn`: builtinPortOf over its settings, the `builtinTwinOf` stamp, else the package's own port), a line
|
|
11
|
+
* its built-in names reads the built-in's own words in the viewer's language, the words its alert pickers, its card and
|
|
12
|
+
* its settings page already show. The host answers them (the env's `builtinLineWords`; web: `builtinOutputI18nKey`
|
|
13
|
+
* through the i18n plugin), so this package holds no built-in's vocabulary. Any other package, any line the built-in
|
|
14
|
+
* does not name (a guide level, a data-only helper) and a host without the member keep the legend's rule. The sheet,
|
|
15
|
+
* the output keys, the plot ids and every binding keep the label as published: only the words a user reads change.
|
|
16
|
+
*/
|
|
17
|
+
import { wrunHostBuiltinLineWords } from '../../host-env.js';
|
|
18
|
+
import { wrunLegendName } from '../chart/wrun-legend-name.util.js';
|
|
19
|
+
/** The built-in's words for `output`, or undefined: no built-in, no sheet label, or a line the built-in does not
|
|
20
|
+
* name (the host answers nothing). */
|
|
21
|
+
function builtinWordsFor(output, builtIn) {
|
|
22
|
+
if (builtIn === undefined || typeof output.label !== 'string')
|
|
23
|
+
return undefined;
|
|
24
|
+
return wrunHostBuiltinLineWords(builtIn, output.label);
|
|
25
|
+
}
|
|
26
|
+
/** The words `output` reads on a chart surface of an overlay that ports built-in `builtIn` (undefined for any other
|
|
27
|
+
* package): a line its built-in names reads the built-in's words, every other line the legend's rule (wrunLegendName:
|
|
28
|
+
* the declared label, else the name read as words). */
|
|
29
|
+
export function wrunOutputWords(output, builtIn) {
|
|
30
|
+
return builtinWordsFor(output, builtIn) ?? wrunLegendName(output.name, output.label);
|
|
31
|
+
}
|
|
32
|
+
/** A name's letters, case, spaces, `_` and `-` aside ("Upper band", `UpperBand` and `upper_band` alike). */
|
|
33
|
+
function letters(words) {
|
|
34
|
+
return words.toLowerCase().replace(/[\s_-]+/g, '');
|
|
35
|
+
}
|
|
36
|
+
/** Whether declared `words` name `output` by its own sheet label or name: an author restating the line in a card. */
|
|
37
|
+
export function wrunWordsRestateOutput(words, output) {
|
|
38
|
+
const said = letters(words);
|
|
39
|
+
if (said === '')
|
|
40
|
+
return false;
|
|
41
|
+
return said === letters(output.name) || (typeof output.label === 'string' && said === letters(output.label));
|
|
42
|
+
}
|
|
43
|
+
/** The words a declaration that names `output` prints (a hover block's or a ring's `label`, a rows block's row label),
|
|
44
|
+
* declared as `words`: words that restate the line (wrunWordsRestateOutput) read the built-in's words for it when the
|
|
45
|
+
* overlay's built-in names it, like the line itself; any other words are the author's and stay as written ("Overbought
|
|
46
|
+
* / oversold" over MFI's meter). */
|
|
47
|
+
export function wrunDeclaredOutputWords(words, output, builtIn) {
|
|
48
|
+
if (output === undefined || !wrunWordsRestateOutput(words, output))
|
|
49
|
+
return words;
|
|
50
|
+
return builtinWordsFor(output, builtIn) ?? words;
|
|
51
|
+
}
|
|
@@ -449,6 +449,11 @@ export interface WrunOverlayLiveContext {
|
|
|
449
449
|
* it): they carry no `coveredThroughTs`, so the reconcile keeps asking
|
|
450
450
|
* their tail while the source ladder owns the window. */
|
|
451
451
|
degradedLanes?: ReadonlySet<string>;
|
|
452
|
+
/** The full run that installed the session drew a partial picture: over a row lane's first-paint slice (its older
|
|
453
|
+
* bars still loading) or a lane degraded to empty. The fill's or the recovery's run (a whole run of the same
|
|
454
|
+
* settings and market) installs the session that completes it, so this session's passes name no picture
|
|
455
|
+
* (`wrunPictureIdentityOf`): none of its ticks, reseeds or refines stamps a partial heatmap scale as final. */
|
|
456
|
+
picturePartial?: true;
|
|
452
457
|
/** The row-builder lanes the capability rule (`wrunUnservedLanes`) kept from
|
|
453
458
|
* dispatch on the session's market (the run pass writes it): never fetched,
|
|
454
459
|
* their buffers empty, every reader reading its fill on every row. The
|
|
@@ -612,6 +617,42 @@ export declare function wrunChartMarketIdentity(metadata: {
|
|
|
612
617
|
transformations?: unknown;
|
|
613
618
|
sessionType?: unknown;
|
|
614
619
|
} | null | undefined): string;
|
|
620
|
+
/** What a pass's rows were computed for (`wrunPictureIdentityOf`), the only spelling a pass hands the child mount. */
|
|
621
|
+
export type WrunPictureIdentity = string & {
|
|
622
|
+
readonly __wrunPictureIdentity: true;
|
|
623
|
+
};
|
|
624
|
+
/**
|
|
625
|
+
* The picture a pass's rows show, as the run or the live session that computed them knew it: the compute settings
|
|
626
|
+
* revision (`kScriptSettingsRevision`, C1) and the market identity (`wrunChartMarketIdentity`). The one derivation
|
|
627
|
+
* every caller of the child mount hands it (wrun-panel-mount.util `pictureIdentity`: a mounted heatmap keeps its
|
|
628
|
+
* colour scale through a pass of the picture that decided it): a full run from what it computed with
|
|
629
|
+
* (`computed.generation` and its own market identity), a live session's passes (a tick, a reseed, a refine, a style
|
|
630
|
+
* repaint, an adoption) from the session's `settingsRevision` and `marketIdentity`, which its full run stamped at
|
|
631
|
+
* install.
|
|
632
|
+
*
|
|
633
|
+
* Why these two facts and nothing else (2026-11-07, Kyle's "decide the scale once per load, then never move it on its
|
|
634
|
+
* own"): every save that changes what the module computes or reads bumps the revision (a param, a symbol or text
|
|
635
|
+
* param, a Timeframe, a pin, a `style_targets` param such as one bound to a heatmap's quantile), while a paint-only
|
|
636
|
+
* save never does (a Style row, an om style knob, the Sensitivity row itself, a window split, an eye), so presentation
|
|
637
|
+
* keys are never identity and no list of keys can drift. The market identity covers the symbol, the interval, the
|
|
638
|
+
* exchange, the transformations, the session and the candle source. The script itself: an editor draft's Run replaces
|
|
639
|
+
* the parent overlay (its children unmount and install afresh) and a version change is a compute save. The facts are
|
|
640
|
+
* the rows' own, never the settings' current ones: a save leaves the session ticking on the previous computation until
|
|
641
|
+
* its rerun installs, and those ticks hand the session's identity, so no scale is ever decided from them under the new
|
|
642
|
+
* picture.
|
|
643
|
+
*
|
|
644
|
+
* Undefined when the market is unknown (a context stored before the field existed), and for a partial picture
|
|
645
|
+
* (`picturePartial`: a run, or the session it installed, that drew over a row lane's first-paint slice or a lane
|
|
646
|
+
* degraded to empty): the fill's or the recovery's run is a whole run of the same revision and market, so a scale
|
|
647
|
+
* decided from the slice under the final identity would be carried onto the whole history (the seed freeze the
|
|
648
|
+
* options heatmap's `seed` stage avoids). Every heatmap a pass without a picture rebuilds decides its scale again and
|
|
649
|
+
* stamps none, the rule before the hold, so the completing run decides and holds.
|
|
650
|
+
*/
|
|
651
|
+
export declare function wrunPictureIdentityOf(source: {
|
|
652
|
+
settingsRevision?: number;
|
|
653
|
+
marketIdentity?: string;
|
|
654
|
+
picturePartial?: boolean;
|
|
655
|
+
}): WrunPictureIdentity | undefined;
|
|
615
656
|
export declare function registerWrunOverlayDriver(indicatorId: string, driver: WrunOverlayDriver): void;
|
|
616
657
|
export declare function hasWrunOverlayDriver(indicatorId: string): boolean;
|
|
617
658
|
/** Marked by the shared run pass after a successful integrate, whatever
|
|
@@ -84,6 +84,7 @@ import { closeWrunRefusalAttempts, concludeWrunRefusalAttempt, liveWrunRefusalAt
|
|
|
84
84
|
import { attachWrunRefusal, stampWrunRefusalTelemetry } from './wrun-refusal.util.js';
|
|
85
85
|
import { wrunRunFailedIdentityOf } from './wrun-cap-notice.util.js';
|
|
86
86
|
import { __resetWrunHistoryAsOfForTests, forgetWrunHistoryAsOf } from './wrun-history-as-of.util.js';
|
|
87
|
+
import { releaseWrunTrapSeedsFor } from './wrun-trap-replay.util.js';
|
|
87
88
|
import { effectiveChartSessionType } from '../chart/effective-chart-session.util.js';
|
|
88
89
|
import { wrunMainCandleSourceOf } from './run-schedule/wrun-own-candles.util.js';
|
|
89
90
|
import { hasWrunChartHostEnv, wrunChartHostEnv } from '../../host-env.js';
|
|
@@ -445,6 +446,38 @@ export function wrunChartMarketIdentity(metadata) {
|
|
|
445
446
|
terms.push(`${rows.exchange}:${rows.symbol}`);
|
|
446
447
|
return terms.map((part) => (part === undefined || part === null ? '' : String(part))).join('|');
|
|
447
448
|
}
|
|
449
|
+
/**
|
|
450
|
+
* The picture a pass's rows show, as the run or the live session that computed them knew it: the compute settings
|
|
451
|
+
* revision (`kScriptSettingsRevision`, C1) and the market identity (`wrunChartMarketIdentity`). The one derivation
|
|
452
|
+
* every caller of the child mount hands it (wrun-panel-mount.util `pictureIdentity`: a mounted heatmap keeps its
|
|
453
|
+
* colour scale through a pass of the picture that decided it): a full run from what it computed with
|
|
454
|
+
* (`computed.generation` and its own market identity), a live session's passes (a tick, a reseed, a refine, a style
|
|
455
|
+
* repaint, an adoption) from the session's `settingsRevision` and `marketIdentity`, which its full run stamped at
|
|
456
|
+
* install.
|
|
457
|
+
*
|
|
458
|
+
* Why these two facts and nothing else (2026-11-07, Kyle's "decide the scale once per load, then never move it on its
|
|
459
|
+
* own"): every save that changes what the module computes or reads bumps the revision (a param, a symbol or text
|
|
460
|
+
* param, a Timeframe, a pin, a `style_targets` param such as one bound to a heatmap's quantile), while a paint-only
|
|
461
|
+
* save never does (a Style row, an om style knob, the Sensitivity row itself, a window split, an eye), so presentation
|
|
462
|
+
* keys are never identity and no list of keys can drift. The market identity covers the symbol, the interval, the
|
|
463
|
+
* exchange, the transformations, the session and the candle source. The script itself: an editor draft's Run replaces
|
|
464
|
+
* the parent overlay (its children unmount and install afresh) and a version change is a compute save. The facts are
|
|
465
|
+
* the rows' own, never the settings' current ones: a save leaves the session ticking on the previous computation until
|
|
466
|
+
* its rerun installs, and those ticks hand the session's identity, so no scale is ever decided from them under the new
|
|
467
|
+
* picture.
|
|
468
|
+
*
|
|
469
|
+
* Undefined when the market is unknown (a context stored before the field existed), and for a partial picture
|
|
470
|
+
* (`picturePartial`: a run, or the session it installed, that drew over a row lane's first-paint slice or a lane
|
|
471
|
+
* degraded to empty): the fill's or the recovery's run is a whole run of the same revision and market, so a scale
|
|
472
|
+
* decided from the slice under the final identity would be carried onto the whole history (the seed freeze the
|
|
473
|
+
* options heatmap's `seed` stage avoids). Every heatmap a pass without a picture rebuilds decides its scale again and
|
|
474
|
+
* stamps none, the rule before the hold, so the completing run decides and holds.
|
|
475
|
+
*/
|
|
476
|
+
export function wrunPictureIdentityOf(source) {
|
|
477
|
+
if (source.marketIdentity === undefined || source.picturePartial === true)
|
|
478
|
+
return undefined;
|
|
479
|
+
return `${source.settingsRevision ?? 0}|${source.marketIdentity}`;
|
|
480
|
+
}
|
|
448
481
|
export function registerWrunOverlayDriver(indicatorId, driver) {
|
|
449
482
|
const existing = drivers.get(indicatorId);
|
|
450
483
|
if (existing) {
|
|
@@ -585,6 +618,8 @@ function releaseWrunOverlayLiveSession(indicatorId, mode) {
|
|
|
585
618
|
drivers.delete(indicatorId);
|
|
586
619
|
// The overlay's history session goes with it: an overlay mounted again pins its lanes afresh.
|
|
587
620
|
forgetWrunHistoryAsOf(indicatorId);
|
|
621
|
+
// A trap replay seed the overlay parked goes with it: nothing replays an overlay that left its chart.
|
|
622
|
+
releaseWrunTrapSeedsFor(indicatorId);
|
|
588
623
|
// The overlay's refusal attempts and verdicts go with it: a settlement
|
|
589
624
|
// landing after this claims nothing, and a later tenant starts clean.
|
|
590
625
|
if (chartIndex !== undefined)
|
|
@@ -73,6 +73,11 @@ export interface WrunOverlayResultOptions {
|
|
|
73
73
|
legendNote?: string;
|
|
74
74
|
/** A live tick's build memo (wrun-build-memo.util); full runs, reseeds and pans leave it absent. */
|
|
75
75
|
buildMemo?: WrunBuildMemo;
|
|
76
|
+
/** The built-in the overlay ports (builtinPortOf over its settings), whose words name the lines it names in the
|
|
77
|
+
* result's `labels` (wrun-run-result.util `builtIn`); undefined for any other package. Required, so every build of
|
|
78
|
+
* the overlay (a full run's integrate, a prefix landing, a live tick, and any build added later) states it and a
|
|
79
|
+
* tick never flips a line's words back to the sheet's ids (TWIN-LEGEND). */
|
|
80
|
+
builtIn: string | undefined;
|
|
76
81
|
}
|
|
77
82
|
/**
|
|
78
83
|
* The price canvases' host fill (WRUN guardrails G1, read by the auto row
|
|
@@ -113,7 +118,7 @@ export declare const WRUN_RESULT_CAPTURE_LIMIT = 8;
|
|
|
113
118
|
* of trades behind it, more than a rig's process holds (2026-10-17: the TIP corpus run died at 4 GB on the eighth
|
|
114
119
|
* package). A key added to the options must be added here, or the type below fails to compile.
|
|
115
120
|
*/
|
|
116
|
-
export declare const WRUN_OVERLAY_RESULT_OPTION_KEYS: readonly ["metadata", "outputRows", "title", "params", "texts", "position", "axis", "colors", "fills", "candles", "chartNames", "runTimeline", "priceDigits", "sizeUnit", "valuePerUnit", "cellRows", "canvasTailRows", "batchedTailFromTs", "intervalMs", "exchange", "priceTick", "overlayId", "tpoBlockSize", "legendNote"];
|
|
121
|
+
export declare const WRUN_OVERLAY_RESULT_OPTION_KEYS: readonly ["metadata", "outputRows", "title", "params", "texts", "position", "axis", "colors", "fills", "candles", "chartNames", "runTimeline", "priceDigits", "sizeUnit", "valuePerUnit", "cellRows", "canvasTailRows", "batchedTailFromTs", "intervalMs", "exchange", "priceTick", "overlayId", "tpoBlockSize", "legendNote", "builtIn"];
|
|
117
122
|
/**
|
|
118
123
|
* Record one build on a corpus lane's page (`globalThis.__omRig === true` and the store `__wrunResultCapture` the lane
|
|
119
124
|
* created before the app loaded) under `__wrunResultCapture[<overlay id, else the title>]`, newest last, the last
|
|
@@ -72,6 +72,7 @@ export function buildWrunOverlayRunResult(options) {
|
|
|
72
72
|
// G1: the served TPO block, only when known.
|
|
73
73
|
...withCanvasHostFill(options),
|
|
74
74
|
...(options.buildMemo !== undefined ? { buildMemo: options.buildMemo } : {}),
|
|
75
|
+
...(options.builtIn !== undefined ? { builtIn: options.builtIn } : {}),
|
|
75
76
|
});
|
|
76
77
|
if (wrunResultCaptureStore() !== undefined)
|
|
77
78
|
captureWrunOverlayResult(options, result);
|
|
@@ -177,6 +178,7 @@ export const WRUN_OVERLAY_RESULT_OPTION_KEYS = [
|
|
|
177
178
|
'overlayId',
|
|
178
179
|
'tpoBlockSize',
|
|
179
180
|
'legendNote',
|
|
181
|
+
'builtIn',
|
|
180
182
|
];
|
|
181
183
|
const WRUN_OPTION_KEYS_COMPLETE = true;
|
|
182
184
|
/**
|
|
@@ -78,7 +78,7 @@ import { type WrunRefusalAttemptToken, type WrunRefusalContext, type WrunRefusal
|
|
|
78
78
|
import { type WrunHostFillContext } from './wrun-script-inputs.util.js';
|
|
79
79
|
import { type WrunDownloadMeterPort, type WrunDownloadSummary } from './wrun-download-meter.util.js';
|
|
80
80
|
import type { WrunLatestSnapshot } from './wrun-latest-snapshot.js';
|
|
81
|
-
import { wrunChartMarketIdentity, type WrunOverlayLiveContext, type WrunWarmupMiss } from './wrun-overlay-drivers.util.js';
|
|
81
|
+
import { wrunChartMarketIdentity, type WrunOverlayLiveContext, type WrunPictureIdentity, type WrunWarmupMiss } from './wrun-overlay-drivers.util.js';
|
|
82
82
|
import { type KScriptProvenanceSettingsLike } from '../chart/kscript-venue-policy.util.js';
|
|
83
83
|
import type { WrunLegCandleClose } from '@orangecharts/indicator-kit/host';
|
|
84
84
|
import { type WrunPassRowSource } from './wrun-row-source-factory.js';
|
|
@@ -235,6 +235,14 @@ export interface WrunRunComputedFor {
|
|
|
235
235
|
* type. Synchronous over what it reads, so the caller judges in the same task as the act the verdict guards.
|
|
236
236
|
*/
|
|
237
237
|
export declare function wrunRunSupersededReason(run: WrunRunComputedFor): WrunRunSupersededReason | undefined;
|
|
238
|
+
/** The trap row of an editor draft run that carried a replay seed (wrun-trap-replay.util: a full run or a live start
|
|
239
|
+
* that trapped in the sandbox): the seed parks under a token the row carries in `details.trap.token`, which the
|
|
240
|
+
* editor's replay controller takes it by. Any other row (a published Indicator, an app layer, no seed) as it is, and
|
|
241
|
+
* nothing parks for it. */
|
|
242
|
+
export declare function wrunTrapRowWithReplayToken(trap: RuntimeDiagnostic, error: unknown, overlay: {
|
|
243
|
+
indicatorId: string;
|
|
244
|
+
settings: unknown;
|
|
245
|
+
}): RuntimeDiagnostic;
|
|
238
246
|
/**
|
|
239
247
|
* Where a run stands when it fails (the `stage` of `wrun-run-failed`): its head (the holds, the walls, the market
|
|
240
248
|
* reads), its lanes (the plans and the fetches of the browser lanes), the compute (the sandbox worker, or the row
|
|
@@ -1149,7 +1157,7 @@ export interface WrunIntegrationFacts {
|
|
|
1149
1157
|
* design 5): a mount that reaches before it is replaced, never merged onto. */
|
|
1150
1158
|
retainedFromTs?: number;
|
|
1151
1159
|
}
|
|
1152
|
-
export type WrunIntegrateOptions = WrunOverlayResultOptions & {
|
|
1160
|
+
export type WrunIntegrateOptions = Omit<WrunOverlayResultOptions, 'builtIn'> & {
|
|
1153
1161
|
tc: unknown;
|
|
1154
1162
|
meta: Record<string, unknown>;
|
|
1155
1163
|
indicatorId: string;
|
|
@@ -1161,8 +1169,21 @@ export type WrunIntegrateOptions = WrunOverlayResultOptions & {
|
|
|
1161
1169
|
/** The clamped window the rows were computed over: a partial one keeps the mounted rows outside
|
|
1162
1170
|
* it on a remount. */
|
|
1163
1171
|
window?: WrunRunWindow;
|
|
1172
|
+
/** What the rows were computed for (`wrunPictureIdentityOf`: a full run's `computed.generation` and market
|
|
1173
|
+
* identity, a live session's `settingsRevision` and `marketIdentity`), handed to the child mount: a mounted
|
|
1174
|
+
* heatmap keeps the colour scale on screen through a pass of the picture that decided it and decides it again
|
|
1175
|
+
* on another. Required, so no integrate leaves it out by accident; undefined (an unknown market) decides every
|
|
1176
|
+
* heatmap scale again, the rule before the hold. */
|
|
1177
|
+
pictureIdentity: WrunPictureIdentity | undefined;
|
|
1164
1178
|
/** The full run's route facts; absent, the result remounts (a reseed, a direct caller). */
|
|
1165
1179
|
integration?: WrunIntegrationFacts;
|
|
1180
|
+
/** The drawings rule's facts for a caller without route facts that integrates a run's own rows again (the TPO block
|
|
1181
|
+
* refine of a run no live session owns): that run's reason and good-result fact, so the refine keeps or replaces
|
|
1182
|
+
* the mounted drawings exactly as its run did (wrunRunDrawingsPlan). */
|
|
1183
|
+
drawingsRun?: Pick<WrunIntegrationFacts, 'reason' | 'hasGoodResult'>;
|
|
1184
|
+
/** The result redraws the live session's own computation (its reseed, its style repaint, its TPO block refine:
|
|
1185
|
+
* the set every live tick mounts): its drawings replace the mounted set whatever its window (wrunRunDrawingsPlan). */
|
|
1186
|
+
sessionRedraw?: boolean;
|
|
1166
1187
|
/** A settings gesture's preview (the style patch's session repaint, wrun-style-preview.util): the overlay's
|
|
1167
1188
|
* settings are never written (no legend palette, no stats strip stamp), so nothing a preview paints reaches its
|
|
1168
1189
|
* engine copy; the gesture's commit or the cancel's repaint stamps them. */
|