@orangecharts/wrun-chart-host 0.15.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.
Files changed (175) hide show
  1. package/README.md +1 -0
  2. package/dist/constants/economic.constants.d.ts +2 -0
  3. package/dist/constants/economic.constants.js +2 -0
  4. package/dist/constants/feature-flags.constants.d.ts +10 -0
  5. package/dist/constants/feature-flags.constants.js +52 -4
  6. package/dist/constants/feature-limits.constants.d.ts +72 -4
  7. package/dist/constants/feature-limits.constants.js +98 -20
  8. package/dist/constants/interval.constants.js +5 -0
  9. package/dist/constants/kscript-data-interval-restrictions.constants.d.ts +12 -0
  10. package/dist/constants/kscript-data-interval-restrictions.constants.js +14 -0
  11. package/dist/constants/typed-width-fold.leaf.d.ts +50 -0
  12. package/dist/constants/typed-width-fold.leaf.js +99 -0
  13. package/dist/constants/typed-width-source.leaf.d.ts +24 -0
  14. package/dist/constants/typed-width-source.leaf.js +126 -0
  15. package/dist/constants/typed-width.leaf.d.ts +57 -0
  16. package/dist/constants/typed-width.leaf.js +78 -0
  17. package/dist/host-env.d.ts +10 -0
  18. package/dist/host-env.js +7 -0
  19. package/dist/host-ports.types.d.ts +11 -0
  20. package/dist/index.d.ts +3 -0
  21. package/dist/index.js +3 -0
  22. package/dist/interfaces/kscript-diagnostics.interface.d.ts +28 -0
  23. package/dist/interfaces/wrun-runtime.interface.d.ts +63 -3
  24. package/dist/interfaces/wrun-runtime.interface.js +11 -0
  25. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +13 -0
  26. package/dist/kscript-data/controls/live-trades-merge.util.js +16 -1
  27. package/dist/market-data/billing.interface.d.ts +12 -45
  28. package/dist/market-data/billing.interface.js +2 -2
  29. package/dist/replay/replayLadder.js +7 -4
  30. package/dist/settings-templates/footprint-rows.d.ts +6 -0
  31. package/dist/settings-templates/footprint-rows.js +6 -0
  32. package/dist/settings-templates/frvp-fields.js +14 -0
  33. package/dist/settings-templates/indicator-fields.js +31 -0
  34. package/dist/settings-templates/tool-tables.generated.js +19 -1
  35. package/dist/utility/chart/__fixtures__/live-bucket-regular-golden.json +1706 -0
  36. package/dist/utility/chart/cache-alignment.util.d.ts +42 -0
  37. package/dist/utility/chart/cache-alignment.util.js +88 -18
  38. package/dist/utility/chart/calendar-interval.util.d.ts +83 -1
  39. package/dist/utility/chart/calendar-interval.util.js +152 -4
  40. package/dist/utility/chart/candle-bar-end.util.d.ts +11 -4
  41. package/dist/utility/chart/candle-bar-end.util.js +17 -6
  42. package/dist/utility/chart/chart-time-domain.util.d.ts +3 -0
  43. package/dist/utility/chart/chart-time-domain.util.js +13 -4
  44. package/dist/utility/chart/feed-interval.util.d.ts +4 -2
  45. package/dist/utility/chart/feed-interval.util.js +5 -2
  46. package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +3 -1
  47. package/dist/utility/chart/fetch-dedupe-policy.util.js +19 -1
  48. package/dist/utility/chart/footprint-display-mode.util.d.ts +2 -0
  49. package/dist/utility/chart/footprint-display-mode.util.js +5 -0
  50. package/dist/utility/chart/governed-lanes-gate.util.d.ts +46 -0
  51. package/dist/utility/chart/governed-lanes-gate.util.js +71 -0
  52. package/dist/utility/chart/governed-lanes-reader-seat.d.ts +14 -0
  53. package/dist/utility/chart/governed-lanes-reader-seat.js +14 -0
  54. package/dist/utility/chart/history-wall.util.d.ts +13 -2
  55. package/dist/utility/chart/history-wall.util.js +11 -4
  56. package/dist/utility/chart/interval-ladder.util.d.ts +5 -2
  57. package/dist/utility/chart/interval-ladder.util.js +44 -4
  58. package/dist/utility/chart/interval-registry.util.d.ts +22 -1
  59. package/dist/utility/chart/interval-registry.util.js +50 -2
  60. package/dist/utility/chart/kscript-data-interval-restriction.leaf.d.ts +32 -4
  61. package/dist/utility/chart/kscript-data-interval-restriction.leaf.js +22 -5
  62. package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +10 -0
  63. package/dist/utility/chart/kscript-drawing-safe-area.util.js +30 -3
  64. package/dist/utility/chart/kscript-legend-entries.util.d.ts +21 -4
  65. package/dist/utility/chart/kscript-legend-entries.util.js +27 -5
  66. package/dist/utility/chart/kscript-main-grid-stages.util.js +74 -24
  67. package/dist/utility/chart/kscript-row-name.leaf.d.ts +13 -0
  68. package/dist/utility/chart/kscript-row-name.leaf.js +18 -0
  69. package/dist/utility/chart/kscript-venue-policy.util.d.ts +61 -26
  70. package/dist/utility/chart/kscript-venue-policy.util.js +138 -37
  71. package/dist/utility/chart/live-bucket.util.d.ts +29 -4
  72. package/dist/utility/chart/live-bucket.util.js +45 -12
  73. package/dist/utility/chart/market-session.util.d.ts +62 -10
  74. package/dist/utility/chart/market-session.util.js +93 -13
  75. package/dist/utility/chart/marketKind.util.d.ts +1 -7
  76. package/dist/utility/chart/marketKind.util.js +6 -8
  77. package/dist/utility/chart/mixed-mode.util.d.ts +17 -0
  78. package/dist/utility/chart/om-target.util.js +6 -4
  79. package/dist/utility/chart/price-precision.util.d.ts +20 -6
  80. package/dist/utility/chart/price-precision.util.js +34 -7
  81. package/dist/utility/chart/profile-frame-window.util.d.ts +15 -0
  82. package/dist/utility/chart/profile-frame-window.util.js +12 -0
  83. package/dist/utility/chart/rth-session.util.d.ts +3 -1
  84. package/dist/utility/chart/rth-session.util.js +3 -1
  85. package/dist/utility/chart/script-source-session.util.d.ts +43 -0
  86. package/dist/utility/chart/script-source-session.util.js +61 -0
  87. package/dist/utility/chart/typed-width-grid.util.d.ts +23 -0
  88. package/dist/utility/chart/typed-width-grid.util.js +203 -0
  89. package/dist/utility/common/transformations.util.d.ts +6 -0
  90. package/dist/utility/common/transformations.util.js +28 -4
  91. package/dist/utility/number-format.util.d.ts +14 -1
  92. package/dist/utility/number-format.util.js +22 -4
  93. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.d.ts +24 -1
  94. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +113 -0
  95. package/dist/utility/v2/v2-enums.leaf.js +3 -0
  96. package/dist/utility/wrun/wrun-batched-marks.util.d.ts +9 -3
  97. package/dist/utility/wrun/wrun-batched-marks.util.js +65 -17
  98. package/dist/utility/wrun/wrun-canvases.util.d.ts +4 -2
  99. package/dist/utility/wrun/wrun-canvases.util.js +7 -12
  100. package/dist/utility/wrun/wrun-cap-notice.util.d.ts +5 -0
  101. package/dist/utility/wrun/wrun-cap-notice.util.js +23 -0
  102. package/dist/utility/wrun/wrun-card-style.util.d.ts +1 -1
  103. package/dist/utility/wrun/wrun-card-style.util.js +2 -2
  104. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +8 -0
  105. package/dist/utility/wrun/wrun-chart-market-facts.util.js +13 -1
  106. package/dist/utility/wrun/wrun-child-overlay-id.util.d.ts +10 -0
  107. package/dist/utility/wrun/wrun-child-overlay-id.util.js +24 -0
  108. package/dist/utility/wrun/wrun-cloud-cme-stamp.util.d.ts +72 -0
  109. package/dist/utility/wrun/wrun-cloud-cme-stamp.util.js +151 -0
  110. package/dist/utility/wrun/wrun-color-facts.util.d.ts +3 -3
  111. package/dist/utility/wrun/wrun-color-facts.util.js +8 -5
  112. package/dist/utility/wrun/wrun-colour-tone.lazy.d.ts +20 -0
  113. package/dist/utility/wrun/wrun-colour-tone.lazy.js +23 -0
  114. package/dist/utility/wrun/wrun-colour-tone.util.d.ts +14 -0
  115. package/dist/utility/wrun/wrun-colour-tone.util.js +119 -0
  116. package/dist/utility/wrun/wrun-dark-pool.util.d.ts +3 -2
  117. package/dist/utility/wrun/wrun-dark-pool.util.js +5 -4
  118. package/dist/utility/wrun/wrun-frames.d.ts +1 -1
  119. package/dist/utility/wrun/wrun-frames.js +2 -2
  120. package/dist/utility/wrun/wrun-handles.util.d.ts +1 -1
  121. package/dist/utility/wrun/wrun-handles.util.js +1 -1
  122. package/dist/utility/wrun/wrun-host.service.d.ts +32 -2
  123. package/dist/utility/wrun/wrun-host.service.js +44 -2
  124. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +20 -0
  125. package/dist/utility/wrun/wrun-hosted-wire-caps.js +85 -2
  126. package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +37 -0
  127. package/dist/utility/wrun/wrun-hosted-wire.util.js +54 -0
  128. package/dist/utility/wrun/wrun-hud-looks.util.d.ts +1 -0
  129. package/dist/utility/wrun/wrun-hud-looks.util.js +6 -11
  130. package/dist/utility/wrun/wrun-integration-route.util.d.ts +24 -0
  131. package/dist/utility/wrun/wrun-integration-route.util.js +19 -0
  132. package/dist/utility/wrun/wrun-live-intake.util.js +17 -1
  133. package/dist/utility/wrun/wrun-live-patch.util.d.ts +6 -1
  134. package/dist/utility/wrun/wrun-live-patch.util.js +10 -4
  135. package/dist/utility/wrun/wrun-live-tick.util.js +59 -4
  136. package/dist/utility/wrun/wrun-overlay-drivers.util.js +3 -0
  137. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +15 -0
  138. package/dist/utility/wrun/wrun-overlay-run.util.js +274 -47
  139. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +1 -1
  140. package/dist/utility/wrun/wrun-panel-mount.util.js +42 -13
  141. package/dist/utility/wrun/wrun-pin-venues.util.js +5 -1
  142. package/dist/utility/wrun/wrun-refusal.util.d.ts +4 -0
  143. package/dist/utility/wrun/wrun-refusal.util.js +102 -13
  144. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +5 -3
  145. package/dist/utility/wrun/wrun-registry-errors.util.js +5 -3
  146. package/dist/utility/wrun/wrun-row-source-factory.js +17 -1
  147. package/dist/utility/wrun/wrun-row-source.d.ts +8 -1
  148. package/dist/utility/wrun/wrun-sandbox-row-source.d.ts +1 -1
  149. package/dist/utility/wrun/wrun-sandbox-row-source.js +9 -0
  150. package/dist/utility/wrun/wrun-setting-words.util.d.ts +12 -5
  151. package/dist/utility/wrun/wrun-setting-words.util.js +25 -8
  152. package/dist/utility/wrun/wrun-socket-row-source.d.ts +26 -1
  153. package/dist/utility/wrun/wrun-socket-row-source.js +125 -12
  154. package/dist/utility/wrun/wrun-source-rows.util.d.ts +3 -3
  155. package/dist/utility/wrun/wrun-source-rows.util.js +8 -7
  156. package/dist/utility/wrun/wrun-style-words.util.d.ts +31 -9
  157. package/dist/utility/wrun/wrun-style-words.util.js +46 -15
  158. package/dist/utility/wrun/wrun-trades-lane.util.js +2 -1
  159. package/dist/utility/wrun/wrun-trap-replay.util.d.ts +42 -0
  160. package/dist/utility/wrun/wrun-trap-replay.util.js +63 -0
  161. package/dist/utility/wrun/wrun-volume-profile.util.js +6 -5
  162. package/dist/utility/wrun-display-name.util.d.ts +10 -0
  163. package/dist/utility/wrun-display-name.util.js +21 -0
  164. package/dist/utils/replay/replay-buffer-math.d.ts +2 -0
  165. package/dist/utils/replay/replay-buffer-math.js +2 -0
  166. package/dist/workers/constants/socket-slots.d.ts +1 -1
  167. package/dist/workers/utils/time.worker.util.js +2 -2
  168. package/dist/workers/utils/volume-profile.worker.util.d.ts +9 -0
  169. package/dist/workers/utils/volume-profile.worker.util.js +20 -0
  170. package/dist/workers/wrun/wrun-abi-host.d.ts +3 -0
  171. package/dist/workers/wrun/wrun-abi-host.js +82 -5
  172. package/dist/workers/wrun/wrun-engine-handler.js +53 -4
  173. package/dist/workers/wrun/wrun-trap-frames.leaf.d.ts +28 -0
  174. package/dist/workers/wrun/wrun-trap-frames.leaf.js +108 -0
  175. package/package.json +11 -11
@@ -1,6 +1,34 @@
1
+ /** An indicator type's verdict at a typed width: `legs` is allowed only when every leg is servable. */
2
+ export type TypedWidthIndicatorVerdict = 'allowed' | 'legs' | 'restricted';
3
+ /** Who builds a typed width's candles on the chart (the app's rolled-interval.util `typedWidthBuilder`). */
4
+ export type TypedWidthBuilder = 'server' | 'app' | null;
1
5
  /**
2
- * @param kscriptType
3
- * @param interval
4
- * @returns
6
+ * The chart a verdict is asked for, when the caller has one: who builds its typed candles, and its metadata (the
7
+ * rule reads it for the chart's bar grid).
5
8
  */
6
- export declare function isKScriptDataRestrictedForInterval(kscriptType: string, interval: string): boolean;
9
+ export type TypedWidthIndicatorChart = {
10
+ readonly builder: TypedWidthBuilder;
11
+ readonly meta: unknown;
12
+ };
13
+ /**
14
+ * The per-width class rule (the app's utility/chart/typed-width-indicator-rules.util, loaded with the indicator fetch
15
+ * pipeline so its lists stay off the boot path): the verdict of a type it decides at `interval` on `chart`, undefined
16
+ * for a type it does not name.
17
+ */
18
+ export type TypedWidthIndicatorRule = (type: string, interval: string, chart?: TypedWidthIndicatorChart) => TypedWidthIndicatorVerdict | undefined;
19
+ /**
20
+ * THE verdict of an indicator type at the typed width `interval`, read by the fetch gate and the live gate. `rule`
21
+ * decides every type it names; a type it does not name takes the boot list (TYPED_WIDTH_BOOT_INDICATORS), and a type
22
+ * no one names is restricted. Each type is named in exactly one place, so the rule never overrides the boot list.
23
+ * Without the rule (not loaded yet) only the boot list answers: every other type reads as restricted, which a caller
24
+ * on the boot path may only use to skip a cached preview. On a chart whose candles the app builds the boot list does
25
+ * not answer: the rule decides every type there, and without it every type reads as restricted.
26
+ */
27
+ export declare function typedWidthIndicatorVerdict(indicatorType: string, interval: string, rule?: TypedWidthIndicatorRule, chart?: TypedWidthIndicatorChart): TypedWidthIndicatorVerdict;
28
+ /**
29
+ * Whether the chart's fetch gate refuses the kScript data source `kscriptType` at `interval`. `builder` is who builds
30
+ * the chart's typed candles, when the caller has the chart: on a chart the app builds, every source is refused at a
31
+ * typed width, because a source read carries the chart's width to the wire as CUSTOM, which the worker refuses off
32
+ * the crypto domain and the gateway refuses off its venue list (the K_OHLCV read does not fold).
33
+ */
34
+ export declare function isKScriptDataRestrictedForInterval(kscriptType: string, interval: string, builder?: TypedWidthBuilder): boolean;
@@ -4,14 +4,31 @@
4
4
  * it reads the restrictions constants module and the interval registry (a chart-host package module), so it moves into
5
5
  * the package with the phase 2 closure; the indicator util re-exports it.
6
6
  */
7
- import { ALLOWED_1S_INDICATORS, KSCRIPT_DATA_INTERVAL_RESTRICTIONS, ROLLED_INTERVAL_RESTRICTED_KSCRIPT_DATA, } from '../../constants/kscript-data-interval-restrictions.constants.js';
7
+ import { ALLOWED_1S_INDICATORS, KSCRIPT_DATA_INTERVAL_RESTRICTIONS, ROLLED_INTERVAL_RESTRICTED_KSCRIPT_DATA, TYPED_WIDTH_ALLOWED_KSCRIPT_DATA, TYPED_WIDTH_BOOT_INDICATORS, } from '../../constants/kscript-data-interval-restrictions.constants.js';
8
+ import { isTypedWidth } from '../../constants/typed-width.leaf.js';
8
9
  import { isCustomInterval, isSubMinuteInterval, standardIntervalAtOrBelow } from './interval-registry.util.js';
9
10
  /**
10
- * @param kscriptType
11
- * @param interval
12
- * @returns
11
+ * THE verdict of an indicator type at the typed width `interval`, read by the fetch gate and the live gate. `rule`
12
+ * decides every type it names; a type it does not name takes the boot list (TYPED_WIDTH_BOOT_INDICATORS), and a type
13
+ * no one names is restricted. Each type is named in exactly one place, so the rule never overrides the boot list.
14
+ * Without the rule (not loaded yet) only the boot list answers: every other type reads as restricted, which a caller
15
+ * on the boot path may only use to skip a cached preview. On a chart whose candles the app builds the boot list does
16
+ * not answer: the rule decides every type there, and without it every type reads as restricted.
13
17
  */
14
- export function isKScriptDataRestrictedForInterval(kscriptType, interval) {
18
+ export function typedWidthIndicatorVerdict(indicatorType, interval, rule, chart) {
19
+ return (rule?.(indicatorType, interval, chart) ??
20
+ (chart?.builder !== 'app' && TYPED_WIDTH_BOOT_INDICATORS.includes(indicatorType) ? 'allowed' : 'restricted'));
21
+ }
22
+ /**
23
+ * Whether the chart's fetch gate refuses the kScript data source `kscriptType` at `interval`. `builder` is who builds
24
+ * the chart's typed candles, when the caller has the chart: on a chart the app builds, every source is refused at a
25
+ * typed width, because a source read carries the chart's width to the wire as CUSTOM, which the worker refuses off
26
+ * the crypto domain and the gateway refuses off its venue list (the K_OHLCV read does not fold).
27
+ */
28
+ export function isKScriptDataRestrictedForInterval(kscriptType, interval, builder) {
29
+ // The gateway serves a typed width for plain trade candles only.
30
+ if (isTypedWidth(interval))
31
+ return builder === 'app' || !TYPED_WIDTH_ALLOWED_KSCRIPT_DATA.includes(kscriptType);
15
32
  if (isSubMinuteInterval(interval)) {
16
33
  return !ALLOWED_1S_INDICATORS.includes(kscriptType);
17
34
  }
@@ -101,6 +101,16 @@ export declare function holdChartChromeSafeArea(tc: LegendSafeAreaChart, holderI
101
101
  * back to null.
102
102
  */
103
103
  export declare function releaseChartChromeSafeArea(tc: LegendSafeAreaChart, holderId: string): void;
104
+ /** The hold every engine keeps for its whole life (`attachChartChromeSafeArea`); no record id takes this shape. */
105
+ export declare const CHART_LIFETIME_CHROME_HOLD = "chart-chrome:lifetime";
106
+ /**
107
+ * Keeps the engine told where its pane chrome is for the chart's whole life
108
+ * (the module doc): the insets reach the engine now, follow the legend as it
109
+ * grows, shrinks, folds and as panes resize, come and go, and go back to null
110
+ * when the returned function runs (the chart's teardown, before the engine's
111
+ * destroy). The one door for every engine the app builds.
112
+ */
113
+ export declare function attachChartChromeSafeArea(tc: LegendSafeAreaChart): () => void;
104
114
  /**
105
115
  * The set to hand `updateDrawings`: each top group (`top_left`,
106
116
  * `top_center`, `top_right`) moved under the chart's legend when they meet, a
@@ -39,6 +39,15 @@
39
39
  * chart serves the mounted sets, the listeners and the holds, and the insets
40
40
  * go back to null once the last of them lets go.
41
41
  *
42
+ * The engine's own surfaces read them on every chart, wrun or not: the
43
+ * volume profiles' stats block (Fixed Range, session, visible range; titan
44
+ * `profileStatsBlock.ts` places it in the pane band under `topLeft`) and the
45
+ * Ruler's touch readout. So every engine holds the tracker for its whole life
46
+ * (`attachChartChromeSafeArea`, from initializeChart right after the engine
47
+ * is built, released with the chart's other listeners on teardown): a plain
48
+ * chart once told the engine nothing, and the stats block drew under the
49
+ * legend (QA 2026-11-13).
50
+ *
42
51
  * A notice or label that did not opt in clears the buttons too (template QA
43
52
  * A17, B10): on a pane with a measured button strip (the price pane's action
44
53
  * bar, a lower pane's move buttons), a plain `top_right` or `top_center` group
@@ -106,11 +115,12 @@ const DEFAULT_LABEL_SIZE = 12;
106
115
  // row on a Hyperliquid pane with a wallet: measured without it, a top-left seat
107
116
  // landed on the pill's chips, OPRA QA 2026-10-22); titan's rows live in the main
108
117
  // section's legend section (`.titan-charts-legend-area` per plotted overlay,
109
- // the "N indicators" summary's indicator). All are content-sized, and hover
118
+ // the "N indicators" summary's indicator and the engine's pause mark beside it,
119
+ // which shows even when the app hides that indicator). All are content-sized, and hover
110
120
  // fades them by opacity, so the measured box holds still under the pointer.
111
121
  const HOST_ROW_SELECTOR = '.symbol-interval-row, .polymarket-row-1, .polymarket-row-2, .polymarket-row-3, .hlqt-anchor';
112
122
  const PLOT_SELECTOR = '.titan-charts-main-section .titan-charts-legend-section';
113
- const TITAN_ROW_SELECTOR = '.titan-charts-legend-area, .titan-charts-legend-collapse-indicator';
123
+ const TITAN_ROW_SELECTOR = '.titan-charts-legend-area, .titan-charts-legend-collapse-indicator, .titan-charts-legend-summary-note';
114
124
  const SECTION_PREFIX = '.titan-charts-';
115
125
  const SECTION_SUFFIX = '-section';
116
126
  const LEGEND_SECTION_SELECTOR = '.titan-charts-legend-section';
@@ -572,7 +582,11 @@ function cssEscape(value) {
572
582
  function offchartLegendSection(pane, paneId) {
573
583
  return pane.main.querySelector(`${SECTION_PREFIX}${cssEscape(paneId)}${SECTION_SUFFIX} ${LEGEND_SECTION_SELECTOR}`);
574
584
  }
575
- /** The chart cell's compare strip height (`--compare-strip-h`, set inline by ChartArea), 0 without one. */
585
+ /**
586
+ * The chart cell's compare strip height, 0 without one: `--compare-strip-h`, which ChartArea binds inline from the
587
+ * strip seat's MEASURED height (compare-strip-height.util), every wrapped row counted, so a wrapped strip moves the
588
+ * action bar's clearance with it. Read off the cell, never assumed: the cell's style change re-measures (watch).
589
+ */
576
590
  function compareStripPx(root) {
577
591
  const style = root.style;
578
592
  let value = typeof style?.getPropertyValue === 'function' ? style.getPropertyValue(COMPARE_STRIP_PROPERTY) : '';
@@ -878,6 +892,19 @@ export function releaseChartChromeSafeArea(tc, holderId) {
878
892
  if (idle(tracker))
879
893
  dropTracker(tc, tracker);
880
894
  }
895
+ /** The hold every engine keeps for its whole life (`attachChartChromeSafeArea`); no record id takes this shape. */
896
+ export const CHART_LIFETIME_CHROME_HOLD = 'chart-chrome:lifetime';
897
+ /**
898
+ * Keeps the engine told where its pane chrome is for the chart's whole life
899
+ * (the module doc): the insets reach the engine now, follow the legend as it
900
+ * grows, shrinks, folds and as panes resize, come and go, and go back to null
901
+ * when the returned function runs (the chart's teardown, before the engine's
902
+ * destroy). The one door for every engine the app builds.
903
+ */
904
+ export function attachChartChromeSafeArea(tc) {
905
+ holdChartChromeSafeArea(tc, CHART_LIFETIME_CHROME_HOLD);
906
+ return () => releaseChartChromeSafeArea(tc, CHART_LIFETIME_CHROME_HOLD);
907
+ }
881
908
  /** A pane-pixel handle at an anchor the pane's buttons sit over (top_right, top_center), in any pane. */
882
909
  function meetsButtonStrip(drawing) {
883
910
  const member = memberOf(drawing);
@@ -171,8 +171,25 @@ export declare function kScriptLegendSlotIdAt(index: number): string;
171
171
  /** The colour a legend line paints with (lineColor: its own, never a palette slot). */
172
172
  export declare function kScriptLegendLineColor(meta: unknown, line: KScriptLegendLine): string;
173
173
  /**
174
- * Pad a legend result to the full slot pool with empty text, name and dot so
175
- * slots a previous run addressed (a line hidden by a settings toggle) never
176
- * keep a stale reading. Slots already present are left untouched.
174
+ * How many pool slots a legend hook has addressed so far. One holder per hook
175
+ * closure (one per overlay): the engine writes only the ids a hook answers, so
176
+ * only slots some earlier answer filled can hold a stale reading.
177
177
  */
178
- export declare function padKScriptLegendSlots(entries: KScriptLegendEntry[]): KScriptLegendEntry[];
178
+ export interface KScriptLegendSlotsUsed {
179
+ used: number;
180
+ }
181
+ /** A fresh holder for one legend hook closure. */
182
+ export declare function createKScriptLegendSlotsUsed(): KScriptLegendSlotsUsed;
183
+ /**
184
+ * Pad a legend result with empty text, name and dot so slots a previous run
185
+ * addressed (a line hidden by a settings toggle) never keep a stale reading.
186
+ * Slots already present are left untouched.
187
+ *
188
+ * With a holder, only the slots this hook has ever addressed are padded, so a
189
+ * two-line script answers two entries instead of the whole pool (every padded
190
+ * id costs the engine one cell pass per frame). `used` only rises: other
191
+ * callers (the data window) run the same hook at other bars, and a slot a
192
+ * wider answer filled must still be cleared later. Without a holder the whole
193
+ * pool is padded, as before.
194
+ */
195
+ export declare function padKScriptLegendSlots(entries: KScriptLegendEntry[], slots?: KScriptLegendSlotsUsed): KScriptLegendEntry[];
@@ -537,15 +537,37 @@ export function kScriptLegendSlotIdAt(index) {
537
537
  export function kScriptLegendLineColor(meta, line) {
538
538
  return lineColor(meta, line);
539
539
  }
540
+ /** A fresh holder for one legend hook closure. */
541
+ export function createKScriptLegendSlotsUsed() {
542
+ return { used: 0 };
543
+ }
544
+ const KSCRIPT_LEGEND_SLOT_INDEX = new Map(kScriptLegendSlotIds().map((id, index) => [id, index]));
540
545
  /**
541
- * Pad a legend result to the full slot pool with empty text, name and dot so
542
- * slots a previous run addressed (a line hidden by a settings toggle) never
543
- * keep a stale reading. Slots already present are left untouched.
546
+ * Pad a legend result with empty text, name and dot so slots a previous run
547
+ * addressed (a line hidden by a settings toggle) never keep a stale reading.
548
+ * Slots already present are left untouched.
549
+ *
550
+ * With a holder, only the slots this hook has ever addressed are padded, so a
551
+ * two-line script answers two entries instead of the whole pool (every padded
552
+ * id costs the engine one cell pass per frame). `used` only rises: other
553
+ * callers (the data window) run the same hook at other bars, and a slot a
554
+ * wider answer filled must still be cleared later. Without a holder the whole
555
+ * pool is padded, as before.
544
556
  */
545
- export function padKScriptLegendSlots(entries) {
557
+ export function padKScriptLegendSlots(entries, slots) {
546
558
  const present = new Set(entries.map((entry) => entry.id));
559
+ let limit = KSCRIPT_LEGEND_MAX_ENTRIES;
560
+ if (slots) {
561
+ for (const id of present) {
562
+ const index = KSCRIPT_LEGEND_SLOT_INDEX.get(id);
563
+ if (index !== undefined && index + 1 > slots.used)
564
+ slots.used = index + 1;
565
+ }
566
+ limit = slots.used;
567
+ }
547
568
  const padded = [...entries];
548
- for (const id of kScriptLegendSlotIds()) {
569
+ for (let index = 0; index < limit; index += 1) {
570
+ const id = kScriptLegendSlotId(index);
549
571
  if (present.has(id))
550
572
  continue;
551
573
  padded.push({ id, text: '', label: '', color: KSCRIPT_LEGEND_VALUE_INK, swatch: '' });
@@ -3,7 +3,8 @@
3
3
  * kscript-titancharts-integration.util.ts with no change (the adapter imports them back):
4
4
  * `alignKScriptIndexDecoratorsToMainChart` lays every plot of a tree that holds an index decorator (a `bgcolor` or
5
5
  * `barcolor`) on the chart's bars, and `padContinuousKScriptOutputGapsOnMainGrid` gives a continuous plot a NaN row
6
- * on every chart bar its own covered span skips. Both read the chart's main bars and nothing else of the chart. A leaf
6
+ * on every chart bar its own covered span skips (a bar, never a hole slot: a time the chart holds a slot for with no
7
+ * bar in it). Both read the chart's main bars and nothing else of the chart. A leaf
7
8
  * with no app edge, so the wrun chart-host package runs the stages web runs
8
9
  * (docs/features/kscript/wrun/wrun-chart-host.md, "Leaves").
9
10
  */
@@ -20,6 +21,9 @@ const KSCRIPT_MAIN_INDEX_ALIGNMENT_EXCLUDED_PLOT_TYPES = new Set([
20
21
  // Continuous plot families draw a segment between consecutive rows, so a
21
22
  // sparse row set (orderbook buckets with holes, partially covered history)
22
23
  // renders as lines connecting across bars the script never computed. Gap
24
+ // padding names BARS only (mainChartBarTimesForKScriptGapPad): a hole slot is
25
+ // a time with no bar, which no script can compute, so a NaN row there cut
26
+ // every line at every second without a trade. Gap
23
27
  // padding is bounded to each output's own [first, last] covered span: rows
24
28
  // outside the span must stay ABSENT (not explicit NaN) so windowed replays
25
29
  // and live batches keep merging as no-ops beyond their window instead of
@@ -83,6 +87,36 @@ function mainChartTimesForKScriptIndexAlignment(tc) {
83
87
  const times = rows.map(finiteRowTime);
84
88
  return times.every((time) => time !== null) ? times : [];
85
89
  }
90
+ /**
91
+ * A hole slot of the main rows: a time the chart keeps a slot for with no bar in it. The gap policy pads one in for
92
+ * every interval a 'detect' market did not trade (titan-charts insertSyntheticGaps: NaN OHLC), and it is told by its
93
+ * shape, as the engine tells it (syntheticFlags hasGapShapedOhlc: no feed sends a NaN open).
94
+ */
95
+ function isMainChartHoleRow(row) {
96
+ if (!Array.isArray(row))
97
+ return false;
98
+ const open = row[1];
99
+ return typeof open === 'number' && Number.isNaN(open);
100
+ }
101
+ /**
102
+ * The times of the chart's BARS: its main rows without the hole slots. What the continuous-plot pad reads, since a
103
+ * plot can only have skipped a bar that exists: on a seconds chart most hole slots are seconds without a trade, and a
104
+ * NaN row on each of them broke every line into dashes (2026-11-11, an EMA on DOGEUSDT 1s). The index alignment keeps
105
+ * `mainChartTimesForKScriptIndexAlignment`: a `bgcolor` or `barcolor` is read by the main row's index, hole slots
106
+ * included.
107
+ */
108
+ function mainChartBarTimesForKScriptGapPad(tc) {
109
+ const times = [];
110
+ for (const row of mainChartRowsForKScriptIndexAlignment(tc)) {
111
+ const time = finiteRowTime(row);
112
+ // The same rule as the slot times: one row that cannot be placed and the grid is not read at all.
113
+ if (time === null)
114
+ return [];
115
+ if (!isMainChartHoleRow(row))
116
+ times.push(time);
117
+ }
118
+ return times;
119
+ }
86
120
  /** Whether the main times strictly increase (no repeated bar): read once per times array. */
87
121
  const strictlyIncreasingMainTimes = new WeakMap();
88
122
  function mainTimesStrictlyIncrease(mainTimes) {
@@ -99,41 +133,57 @@ function mainTimesStrictlyIncrease(mainTimes) {
99
133
  }
100
134
  return verdict;
101
135
  }
136
+ /** The main times as a set, built once per times array: one realign call shares one array across every row set. */
137
+ const mainTimeSets = new WeakMap();
102
138
  /**
103
- * The aligned rows of a row set that already sits on a prefix of the main
104
- * grid (row i stamped mainTimes[i], every row an array, the grid strictly
105
- * increasing): the rows themselves when they cover the grid, else the rows
106
- * followed by a NaN filler per newer bar. Exactly what the general walk below
107
- * returns for such rows, without its per-call set, map and copy (a mounted
108
- * overlay's rows sit on the grid after every apply, so the live realigns of
109
- * an index-decorated overlay take this branch). Null when the rows are off
110
- * the grid prefix: the general walk decides.
139
+ * The aligned rows of a row set that already sits on the main grid in order
140
+ * (every row an array with a finite time on a grid slot, each row on a later
141
+ * slot than the one before, the grid strictly increasing): a dense window and
142
+ * a sparse decorator, marker or label set alike. One merge over the grid puts
143
+ * the very row object on its slot and a NaN filler of the widest payload on
144
+ * every other slot; the rows themselves when they cover the grid. Exactly what
145
+ * the general walk below returns for such rows, without its per-call set and
146
+ * map. Null on any other shape (a time off the grid, an unsorted or repeated
147
+ * time, a non-array row, an unplaceable time, a grid that does not strictly
148
+ * increase): the general walk decides.
111
149
  */
112
- function alignRowsOnMainGridPrefix(rows, mainTimes) {
150
+ function alignRowsOnMainGrid(rows, mainTimes) {
113
151
  if (rows.length > mainTimes.length || !mainTimesStrictlyIncrease(mainTimes))
114
152
  return null;
115
153
  let payloadWidth = 1;
116
- for (let index = 0; index < rows.length; index += 1) {
117
- const row = rows[index];
118
- if (!Array.isArray(row) || row[0] !== mainTimes[index])
154
+ // A first pass without allocation: the widest payload, and no filler is built for a set that falls back here.
155
+ for (const row of rows) {
156
+ if (!Array.isArray(row) || !Number.isFinite(row[0]))
119
157
  return null;
120
158
  payloadWidth = Math.max(payloadWidth, row.length - 1);
121
159
  }
122
- if (rows.length === mainTimes.length)
123
- return rows;
124
- const aligned = rows.slice();
125
- for (let index = rows.length; index < mainTimes.length; index += 1) {
126
- aligned.push([mainTimes[index], ...Array.from({ length: payloadWidth }, () => Number.NaN)]);
160
+ const placed = rows;
161
+ const aligned = [];
162
+ let next = 0;
163
+ for (let slot = 0; slot < mainTimes.length; slot += 1) {
164
+ const time = mainTimes[slot];
165
+ const rowTime = placed[next]?.[0];
166
+ if (rowTime === time)
167
+ aligned.push(placed[next++]);
168
+ // A row before this slot was on no slot at all, or out of order: the grid only grows from here.
169
+ else if (rowTime < time)
170
+ return null;
171
+ else
172
+ aligned.push([time, ...Array.from({ length: payloadWidth }, () => Number.NaN)]);
127
173
  }
128
- return aligned;
174
+ if (next < rows.length)
175
+ return null;
176
+ return rows.length === mainTimes.length ? rows : aligned;
129
177
  }
130
178
  function alignRowsToMainChartIndex(rows, mainTimes, options = {}) {
131
179
  if (!Array.isArray(rows) || rows.length === 0 || mainTimes.length === 0)
132
180
  return rows;
133
- const onGrid = alignRowsOnMainGridPrefix(rows, mainTimes);
181
+ const onGrid = alignRowsOnMainGrid(rows, mainTimes);
134
182
  if (onGrid !== null)
135
183
  return onGrid;
136
- const mainTimeSet = new Set(mainTimes);
184
+ let mainTimeSet = mainTimeSets.get(mainTimes);
185
+ if (!mainTimeSet)
186
+ mainTimeSets.set(mainTimes, (mainTimeSet = new Set(mainTimes)));
137
187
  const rowsByTime = new Map();
138
188
  let finiteRows = 0;
139
189
  let matchedRows = 0;
@@ -322,10 +372,10 @@ function padContinuousKScriptOutputTreeGaps(output, mainTimes) {
322
372
  function padContinuousKScriptOutputGapsOnMainGrid(runResult, tc) {
323
373
  if (!outputTreeHasContinuousGapPadPlot(runResult))
324
374
  return runResult;
325
- const mainTimes = mainChartTimesForKScriptIndexAlignment(tc);
326
- if (mainTimes.length === 0)
375
+ const barTimes = mainChartBarTimesForKScriptGapPad(tc);
376
+ if (barTimes.length === 0)
327
377
  return runResult;
328
- return padContinuousKScriptOutputTreeGaps(runResult, mainTimes);
378
+ return padContinuousKScriptOutputTreeGaps(runResult, barTimes);
329
379
  }
330
380
  export { alignKScriptIndexDecoratorsToMainChart, padContinuousKScriptOutputGapsOnMainGrid,
331
381
  // The adapter's own steps read these too (the mounted realign, the run-interval projection, the live tail view).
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The name a mounted script row goes by on the chart, decided at every apply before the result reaches the engine.
3
+ *
4
+ * The engine names an overlay from the result it applies (`meta.name = define.title`) and paints the legend title
5
+ * from that in the same apply. The row's own name is `settings.customName`: a user's rename, or the name its mount
6
+ * stamped. The adapter's engine doors (kscript-titancharts-integration.util `withKScriptRowTitle`) are the ONE place
7
+ * that reads it, from the row as it is at that apply: a run and its live session carry the package's own title, never
8
+ * a row's name, so a rename or a clear (a save that schedules no run) shows at the next apply, a live tick included.
9
+ * The legend then equals what the Objects panel lists (`meta.name`). The name is display only: no record, saved
10
+ * package name or identity key is written from it.
11
+ */
12
+ /** The row's own name: `settings.customName` when it is a non-blank string, else undefined (a cleared rename). */
13
+ export declare function kScriptRowOwnName(settings: unknown): string | undefined;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The name a mounted script row goes by on the chart, decided at every apply before the result reaches the engine.
3
+ *
4
+ * The engine names an overlay from the result it applies (`meta.name = define.title`) and paints the legend title
5
+ * from that in the same apply. The row's own name is `settings.customName`: a user's rename, or the name its mount
6
+ * stamped. The adapter's engine doors (kscript-titancharts-integration.util `withKScriptRowTitle`) are the ONE place
7
+ * that reads it, from the row as it is at that apply: a run and its live session carry the package's own title, never
8
+ * a row's name, so a rename or a clear (a save that schedules no run) shows at the next apply, a live tick included.
9
+ * The legend then equals what the Objects panel lists (`meta.name`). The name is display only: no record, saved
10
+ * package name or identity key is written from it.
11
+ */
12
+ /** The row's own name: `settings.customName` when it is a non-blank string, else undefined (a cleared rename). */
13
+ export function kScriptRowOwnName(settings) {
14
+ if (settings === null || typeof settings !== 'object')
15
+ return undefined;
16
+ const customName = settings.customName;
17
+ return typeof customName === 'string' && customName.trim() !== '' ? customName : undefined;
18
+ }
@@ -6,22 +6,30 @@
6
6
  * gate, `cme-user-scripts` (cme-user-scripts-gate.util): while it is open (the
7
7
  * flag lit AND the viewer entitled to CME data), a user run the browser
8
8
  * executes reads CME like a first-party one (`isCmeUserScriptRun`, ONE
9
- * decision for the display wall, the data wall and the engine policy), the
10
- * browser lane only: never a hosted (Cloud) run or a protected script, and
11
- * never read server-side (kscript-backend denies CME to every user run
12
- * whatever the gate says). The OPRA licence (US equity and index options) covers
9
+ * decision for the display wall, the data wall and the engine policy). While
10
+ * the `cme-lanes` flag is dark that is the browser lane only (never a hosted
11
+ * (Cloud) run or a protected script) and kscript-backend denies CME to every
12
+ * user run; the owner reversed that on 2026-11-11: lit, the server lanes are
13
+ * admitted too and judge a user run's CME reads on their own. The OPRA licence (US equity and index options) covers
13
14
  * user-authored scripting too, in the browser and on OpenMarket's servers
14
15
  * (Kyle 2026-10-27, the signed set), behind the `opra-user-scripts` flag:
15
16
  * while it is lit, a user run the browser executes reads OPRA like a
16
17
  * first-party one (`isOpraUserScriptRun`, the same three doors). The US stocks
17
18
  * tape is open to user-authored indicators too, in the browser and on the
18
- * cloud lane (Kyle 2026-10-29), on the tapes STOCKS_TAPE_SCRIPTING_VENUES
19
+ * cloud lane (Kyle 2026-10-29), and to protected scripts while `stocks-lanes`
20
+ * is lit (reversed 2026-11-11), on the tapes STOCKS_TAPE_SCRIPTING_VENUES
19
21
  * lists, the one compliance switch (`isStocksTapeReadableKScriptRun`): every
20
22
  * tape since Kyle 2026-11-06; a tape it leaves out would stay first-party
21
23
  * only. Each plane reads its own gate alone: no plane's decision
22
24
  * opens another. The data tier belongs to the viewer, never to the script: the
23
25
  * browser lane reads through the viewer's own gate sockets. This module is the
24
26
  * single decider for every plane.
27
+ * The governed-lanes cutover (governed-lanes-gate.util `governedLanesOpen`, one flag per plane: `cme-lanes`,
28
+ * `opra-lanes`, `stocks-lanes`) widens each plane's own decision to the server lanes: while a plane's flag is lit, a
29
+ * hosted (Cloud) run and a protected script qualify there like a browser run (CME still behind its whole gate, the
30
+ * flag, sign-in and the CME data terms); while it is dark (the default) every answer is the one above. One lane stays
31
+ * out whatever its flag says: OPRA's cloud lane, which reads the chain of a US stock or ETF chart alone
32
+ * (`isOpraCloudChainRun`) and has no path on an OPRA contract chart (Kyle 2026-11-14).
25
33
  * Every run door (add, mount, protected fetch, cache paint, alerts arm,
26
34
  * editor Run), the per-payload data guard in titan-charts dataFetch, and the
27
35
  * engine policy descriptor consult it; nothing else may re-derive provenance
@@ -30,6 +38,7 @@
30
38
  * Browser-safe AND worker-safe: zero Vue / store / i18n imports. The
31
39
  * store-reading overlay form lives in kscript-venue-policy.store.util.ts.
32
40
  */
41
+ import { gateProviderForExchange } from '../v2/gate-plane.util.js';
33
42
  export { isReservedKScriptProvenanceKey, KSCRIPT_RESERVED_PROVENANCE_KEYS } from './kscript-provenance-keys.util.js';
34
43
  /**
35
44
  * Where a technical-script run's source came from. Everything except 'user'
@@ -109,9 +118,17 @@ export declare function isOfficialWrunOverlay(settings: KScriptProvenanceSetting
109
118
  export declare function resolveKScriptRunProvenance(settings: KScriptProvenanceSettingsLike | null | undefined): KScriptRunProvenance;
110
119
  export declare function isFirstPartyKScriptRun(settings: KScriptProvenanceSettingsLike | null | undefined): boolean;
111
120
  /**
112
- * A user run the browser executes (`userRunLane` `browser`): neither a hosted Cloud run nor a protected script,
113
- * which run on a server lane that reads governed data through its own gate identity (UW-PARITY H3), so a browser flag
114
- * never opens a plane to them. The runs the `opra-user-scripts` flag opens the OPRA plane to (`isOpraUserScriptRun`);
121
+ * The server lane a user run reads a governed plane on: `cloud` (the hosted record) or `protected` (a protected
122
+ * script kscript-backend runs), else undefined (a browser user run, a first-party run, no settings). The lanes the
123
+ * governed-lanes cutover flags open and close; the lifecycle and the re-judgments read it to stop or wall exactly the
124
+ * studies a darkened lanes flag no longer admits, never a browser study.
125
+ */
126
+ export declare function userRunServerLaneOf(settings: KScriptProvenanceSettingsLike | null | undefined): 'cloud' | 'protected' | undefined;
127
+ /**
128
+ * A user run the browser executes (`userRunLane` `browser`): while the `opra-lanes` flag is dark, neither a hosted
129
+ * Cloud run nor a protected script, which run on a server lane that reads governed data through its own gate identity
130
+ * (UW-PARITY H3), so a browser flag never opens a plane to them; while it is lit, a protected script too, and never a
131
+ * hosted Cloud run, which has no path on an OPRA contract chart (`userRunLaneAdmitted`). The runs the `opra-user-scripts` flag opens the OPRA plane to (`isOpraUserScriptRun`);
115
132
  * read without the flag where a door must know a decision waits on it (the flag's hydration).
116
133
  */
117
134
  export declare function isOpraUserScriptCandidate(settings: KScriptProvenanceSettingsLike | null | undefined): boolean;
@@ -130,9 +147,10 @@ export type OpraContractChartWallKey = typeof OPRA_USER_SCRIPT_WALL_KEY | typeof
130
147
  /**
131
148
  * The words every door that refuses a user run on an OPRA contract chart shows (the add toast, Door A; the chip, Door
132
149
  * H), picked by the run's lane and never by the flag: a hosted (Cloud) record has no path on a contract chart whatever
133
- * the `opra-user-scripts` flag says (its own sentence); a run the browser executes is refused there only while the
134
- * flag is dark, and a protected script always (the user-script sentence). It names words only: whether the door opens
135
- * is the walls' decision (`isKScriptDisplayBlockedOnExchange`, `isOpraReadableKScriptRun`).
150
+ * the `opra-user-scripts` and `opra-lanes` flags say (its own sentence, lit or dark); a run the browser executes is
151
+ * refused there only while the flag is dark, and a protected script while `opra-lanes` is dark (the user-script
152
+ * sentence). It names words only: whether the door opens is the walls' decision (`isKScriptDisplayBlockedOnExchange`,
153
+ * `isOpraReadableKScriptRun`).
136
154
  */
137
155
  export declare function opraContractChartWallKey(settings: KScriptProvenanceSettingsLike | null | undefined): OpraContractChartWallKey;
138
156
  /**
@@ -144,9 +162,9 @@ export declare function opraContractChartWallKey(settings: KScriptProvenanceSett
144
162
  * licence covers user-authored scripting (Kyle 2026-10-27). The tier follows the viewer, never the run: the browser
145
163
  * lane reads through the viewer's own gate sockets (the gate's tier frame for the session picks the real-time or the
146
164
  * delayed socket), so the same script reads real-time rows for a paying viewer and delayed rows for every other one.
147
- * A hosted (Cloud) record and a protected script stay out of this decision: a Cloud run on an OPRA contract chart has
148
- * no server path yet (the cloud lane reads the chain of a US stock or ETF chart only), and a protected script has no
149
- * actor path on the engine lane. The flag is read first: while it is dark (the default) no record is read at all.
165
+ * A hosted (Cloud) record stays out of this decision whatever the `opra-lanes` flag says: a Cloud run on an OPRA
166
+ * contract chart has no server path (the cloud lane reads the chain of a US stock or ETF chart only). A protected
167
+ * script stays out while `opra-lanes` is dark. The flag is read first: while it is dark (the default) no record is read at all.
150
168
  */
151
169
  export declare function isOpraUserScriptRun(settings: KScriptProvenanceSettingsLike | null | undefined): boolean;
152
170
  /** Whether a run may consume the OPRA plane's data: every first-party run, and a user run the flag opened it to
@@ -155,19 +173,20 @@ export declare function isOpraReadableKScriptRun(settings: KScriptProvenanceSett
155
173
  /**
156
174
  * Whether a run may read a US stocks tape open to user scripting (`STOCKS_TAPE_SCRIPTING_VENUES`): every first-party
157
175
  * run, a user run the browser executes and a hosted (Cloud) user run (`userRunLane`), the lanes Kyle opened on
158
- * 2026-10-29, like OPRA since its launch and on the cloud lane too. A protected script keeps its lane's rule: the
159
- * engine lane has no actor path, so a user's protected script stays refused as on every gate plane. The tier is the
160
- * gate's per socket (delayed 905 s for everyone today), never the script's, and no alert reads the tape whatever this
161
- * answers (opra-alert-door.util `stocks-closed`). A tape the list leaves out never reads this: it stays first-party
162
- * only.
176
+ * 2026-10-29, like OPRA since its launch and on the cloud lane too. While the `stocks-lanes` flag is dark a user's
177
+ * protected script stays refused, and no alert reads the tape whatever this answers (opra-alert-door.util
178
+ * `stocks-closed`); the owner reversed both on 2026-11-11: lit, a protected script reads the tape too. The tier is the
179
+ * gate's per socket (delayed 905 s for everyone today), never the script's. A tape the list leaves out never reads
180
+ * this: it stays first-party only.
163
181
  */
164
182
  export declare function isStocksTapeReadableKScriptRun(settings: KScriptProvenanceSettingsLike | null | undefined): boolean;
165
183
  /**
166
184
  * A user run the browser executes (`userRunLane` `browser`, the OPRA plane's candidate too): the runs the
167
- * `cme-user-scripts` gate opens the CME plane to (`isCmeUserScriptRun`). A hosted (Cloud) record and a protected script
168
- * never qualify, whatever the gate says: CME chart studies run in the browser alone, and the server
169
- * lanes deny CME to every user run. Read without the gate where a door must know a decision waits on it (the flag's
170
- * hydration, the lifecycle that stops a running study).
185
+ * `cme-user-scripts` gate opens the CME plane to (`isCmeUserScriptRun`). While the `cme-lanes` cutover flag is dark, a
186
+ * hosted (Cloud) record and a protected script never qualify, whatever the gate says: CME chart studies run in the
187
+ * browser alone, and the server lanes deny CME to every user run. While it is lit, they qualify too
188
+ * (`userRunLaneAdmitted`), still behind the whole gate. Read without the gate where a door must know a decision waits
189
+ * on it (the flag's hydration, the lifecycle that stops a running study).
171
190
  */
172
191
  export declare function isCmeUserScriptCandidate(settings: KScriptProvenanceSettingsLike | null | undefined): boolean;
173
192
  /**
@@ -199,9 +218,9 @@ export type CmeUserScriptWallKey = typeof CME_USER_SCRIPT_WALL_KEY | typeof CME_
199
218
  * The words every door that refuses a user run on CME shows (the add toast, Door A; the chip, Door H; the editor's
200
219
  * Run), picked by the run's lane like `opraContractChartWallKey`. While the flag is dark every lane reads today's words
201
220
  * (`CME_USER_SCRIPT_WALL_KEY`): the feature does not exist for that viewer, so no door names a browser lane it cannot
202
- * offer. Under a lit flag a hosted (Cloud) record or a protected script has no CME path (`CME_CLOUD_WALL_KEY`: CME chart
203
- * studies run in the browser), and a run the browser executes is refused only for the viewer's
204
- * entitlement (`CME_ENTITLEMENT_REQUIRED_KEY`: the CME data terms). A first-party run is never refused on CME and reads
221
+ * offer. Under a lit flag, while `cme-lanes` is dark, a hosted (Cloud) record or a protected script has no CME path
222
+ * (`CME_CLOUD_WALL_KEY`; reversed 2026-11-11: with `cme-lanes` lit it reads the terms words like a browser run), and a
223
+ * run the browser executes is refused only for the viewer's entitlement (`CME_ENTITLEMENT_REQUIRED_KEY`: the CME data terms). A first-party run is never refused on CME and reads
205
224
  * today's words. Words only: whether the door opens is the walls' decision
206
225
  * (`isKScriptDisplayBlockedOnExchange`, `isCmeReadableKScriptRun`).
207
226
  */
@@ -245,6 +264,22 @@ export declare function payloadTouchesClosedStocksTapeVenue(exchange: unknown):
245
264
  * governed leg must block, so the array form is .some().
246
265
  */
247
266
  export declare function payloadTouchesGovernedVenue(exchange: unknown): boolean;
267
+ export { gateProviderForExchange };
268
+ /**
269
+ * True iff the payload touches at least one governed plane whose lanes flag is dark (`governedLanesOpen`), or a CME
270
+ * venue the cutover never opens (GLOBEX, `isCmeLanesExcludedVenue`). The same argument shape and BLOCKING semantics as
271
+ * the payloadTouches* helpers (a string, or the array form with .some()): any closed plane blocks. Ungoverned exchanges
272
+ * read false.
273
+ */
274
+ export declare function governedLanesClosedOn(exchange: unknown): boolean;
275
+ /**
276
+ * Whether the CME plane's server lanes are open (`cme-lanes` lit, on the venues it opens): the decider's answer for a
277
+ * door that asks about a CME read off a CME chart (a sheet's CME pin), never the raw switch.
278
+ */
279
+ export declare function cmeServerLanesOpen(): boolean;
280
+ /** True iff the exchange is CME-governed and the 'cme' lanes flag is dark (or the venue is one the cutover never
281
+ * opens, GLOBEX). This is the whole strategy rule on CME after this program. */
282
+ export declare function isCmeStrategyClosed(exchange: string | null | undefined): boolean;
248
283
  /**
249
284
  * DATA-wall door predicate: user-authored run targeting a governed venue.
250
285
  * Still the right check for the data-plane guards (the data-fetching funnel,