@orangecharts/wrun-chart-host 0.10.0 → 0.11.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 (145) hide show
  1. package/README.md +1 -0
  2. package/dist/constants/feature-flags.constants.d.ts +9 -0
  3. package/dist/constants/feature-flags.constants.js +67 -4
  4. package/dist/constants/governed-exchanges.constants.d.ts +12 -0
  5. package/dist/constants/governed-exchanges.constants.js +16 -0
  6. package/dist/constants/option-venues.constants.d.ts +2 -2
  7. package/dist/host-env.d.ts +1 -9
  8. package/dist/host-ports.types.d.ts +36 -7
  9. package/dist/index.d.ts +6 -1
  10. package/dist/index.js +6 -1
  11. package/dist/interfaces/cancel-reason.interface.d.ts +1 -1
  12. package/dist/interfaces/cme-realtime.interface.d.ts +16 -9
  13. package/dist/interfaces/cme-realtime.interface.js +6 -3
  14. package/dist/interfaces/kscript-diagnostics.interface.d.ts +6 -0
  15. package/dist/interfaces/opra-realtime.interface.d.ts +1 -5
  16. package/dist/interfaces/prediction-market.interface.d.ts +7 -0
  17. package/dist/interfaces/stocks-realtime.interface.d.ts +57 -0
  18. package/dist/interfaces/stocks-realtime.interface.js +32 -0
  19. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +48 -117
  20. package/dist/kscript-data/controls/live-trades-merge.util.js +97 -207
  21. package/dist/market-data/billing.interface.d.ts +86 -12
  22. package/dist/market-data/billing.interface.js +23 -4
  23. package/dist/market-data/venue.d.ts +65 -2
  24. package/dist/market-data/venues/index.d.ts +135 -5
  25. package/dist/market-data/venues/index.js +2 -1
  26. package/dist/market-data/venues/opra.contract.copy.json +3 -2
  27. package/dist/market-data/venues/opra.d.ts +2 -2
  28. package/dist/market-data/venues/opra.js +5 -2
  29. package/dist/market-data/venues/stocks.contract.copy.json +64 -0
  30. package/dist/market-data/venues/stocks.d.ts +130 -0
  31. package/dist/market-data/venues/stocks.js +117 -0
  32. package/dist/settings-templates/footprint-rows.js +35 -2
  33. package/dist/settings-templates/form-rows.d.ts +2 -1
  34. package/dist/settings-templates/indicator-fields.js +34 -4
  35. package/dist/settings-templates/tool-rules.d.ts +12 -5
  36. package/dist/settings-templates/tool-rules.js +11 -5
  37. package/dist/settings-templates/tool-tables.generated.js +4 -0
  38. package/dist/utility/chart/cme-cache-context.util.d.ts +5 -3
  39. package/dist/utility/chart/cme-cache-context.util.js +10 -6
  40. package/dist/utility/chart/cme-realtime.util.js +10 -0
  41. package/dist/utility/chart/cme-user-scripts-gate.util.d.ts +83 -0
  42. package/dist/utility/chart/cme-user-scripts-gate.util.js +142 -0
  43. package/dist/utility/chart/effective-chart-session.util.d.ts +14 -0
  44. package/dist/utility/chart/effective-chart-session.util.js +39 -0
  45. package/dist/utility/chart/host-bar-placement.util.d.ts +28 -0
  46. package/dist/utility/chart/host-bar-placement.util.js +170 -30
  47. package/dist/utility/chart/index-host-tier.util.d.ts +3 -1
  48. package/dist/utility/chart/index-host-tier.util.js +7 -2
  49. package/dist/utility/chart/index-mode-admission.util.js +25 -11
  50. package/dist/utility/chart/kscript-apply-fingerprint.util.js +1 -1
  51. package/dist/utility/chart/kscript-live-coalesce.util.d.ts +6 -9
  52. package/dist/utility/chart/kscript-live-coalesce.util.js +8 -9
  53. package/dist/utility/chart/kscript-live-source-identity.util.d.ts +9 -0
  54. package/dist/utility/chart/kscript-live-source-identity.util.js +10 -1
  55. package/dist/utility/chart/kscript-provenance-keys.util.js +7 -0
  56. package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +3 -1
  57. package/dist/utility/chart/kscript-venue-policy.util.d.ts +115 -21
  58. package/dist/utility/chart/kscript-venue-policy.util.js +194 -40
  59. package/dist/utility/chart/live-bucket.util.d.ts +24 -8
  60. package/dist/utility/chart/live-bucket.util.js +85 -27
  61. package/dist/utility/chart/marketKind.util.js +5 -0
  62. package/dist/utility/chart/mixed-mode.util.d.ts +7 -0
  63. package/dist/utility/chart/mixed-mode.util.js +14 -0
  64. package/dist/utility/chart/opra-user-scripts-gate.util.d.ts +11 -16
  65. package/dist/utility/chart/opra-user-scripts-gate.util.js +12 -28
  66. package/dist/utility/chart/rth-session.util.d.ts +9 -8
  67. package/dist/utility/chart/rth-session.util.js +23 -20
  68. package/dist/utility/chart/trading-day.util.d.ts +17 -0
  69. package/dist/utility/chart/trading-day.util.js +59 -0
  70. package/dist/utility/chart/window-owner.leaf.d.ts +23 -2
  71. package/dist/utility/chart/window-owner.leaf.js +45 -3
  72. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +33 -15
  73. package/dist/utility/chart/wrun-bar-session-facts.util.js +70 -20
  74. package/dist/utility/intl-locale.util.js +5 -0
  75. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +2 -0
  76. package/dist/utility/v2/gate-plane.util.d.ts +12 -3
  77. package/dist/utility/v2/gate-plane.util.js +30 -4
  78. package/dist/utility/v2/gate-session-latch.util.js +1 -1
  79. package/dist/utility/v2/stocks-governed.util.d.ts +16 -0
  80. package/dist/utility/v2/stocks-governed.util.js +34 -0
  81. package/dist/utility/wrun/derived-roots.leaf.d.ts +13 -0
  82. package/dist/utility/wrun/derived-roots.leaf.js +27 -0
  83. package/dist/utility/wrun/derived-roots.util.d.ts +1 -9
  84. package/dist/utility/wrun/derived-roots.util.js +3 -23
  85. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +4 -3
  86. package/dist/utility/wrun/run-schedule/wrun-own-candles.util.d.ts +24 -3
  87. package/dist/utility/wrun/run-schedule/wrun-own-candles.util.js +46 -10
  88. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +2 -0
  89. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.d.ts +63 -16
  90. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.js +58 -14
  91. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +34 -11
  92. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +106 -30
  93. package/dist/utility/wrun/wrun-browser-sources.leaf.js +1 -2
  94. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +7 -4
  95. package/dist/utility/wrun/wrun-chart-market-facts.util.js +12 -8
  96. package/dist/utility/wrun/wrun-color-settings.util.d.ts +9 -0
  97. package/dist/utility/wrun/wrun-color-settings.util.js +33 -0
  98. package/dist/utility/wrun/wrun-handles.util.d.ts +7 -3
  99. package/dist/utility/wrun/wrun-handles.util.js +9 -8
  100. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +68 -0
  101. package/dist/utility/wrun/wrun-input-requirements.leaf.js +163 -7
  102. package/dist/utility/wrun/wrun-leg-close.util.d.ts +59 -23
  103. package/dist/utility/wrun/wrun-leg-close.util.js +186 -28
  104. package/dist/utility/wrun/wrun-live-intake.util.d.ts +26 -12
  105. package/dist/utility/wrun/wrun-live-intake.util.js +219 -155
  106. package/dist/utility/wrun/wrun-live-tick.util.d.ts +9 -5
  107. package/dist/utility/wrun/wrun-live-tick.util.js +130 -94
  108. package/dist/utility/wrun/wrun-market-facts.util.d.ts +13 -3
  109. package/dist/utility/wrun/wrun-market-facts.util.js +13 -3
  110. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +20 -10
  111. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +10 -5
  112. package/dist/utility/wrun/wrun-option-book-rows.util.d.ts +56 -0
  113. package/dist/utility/wrun/wrun-option-book-rows.util.js +96 -0
  114. package/dist/utility/wrun/wrun-option-views.util.d.ts +281 -20
  115. package/dist/utility/wrun/wrun-option-views.util.js +391 -50
  116. package/dist/utility/wrun/wrun-options-chain.util.d.ts +3 -3
  117. package/dist/utility/wrun/wrun-options-chain.util.js +2 -0
  118. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +15 -2
  119. package/dist/utility/wrun/wrun-overlay-drivers.util.js +13 -3
  120. package/dist/utility/wrun/wrun-overlay-recovery.util.js +3 -1
  121. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +60 -11
  122. package/dist/utility/wrun/wrun-overlay-run.util.js +529 -113
  123. package/dist/utility/wrun/wrun-panel-mount.util.js +51 -6
  124. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +15 -2
  125. package/dist/utility/wrun/wrun-pin-spelling.util.js +27 -3
  126. package/dist/utility/wrun/wrun-refusal.util.d.ts +3 -2
  127. package/dist/utility/wrun/wrun-refusal.util.js +22 -0
  128. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +26 -0
  129. package/dist/utility/wrun/wrun-registry-errors.util.js +34 -0
  130. package/dist/utility/wrun/wrun-replay-lane.util.js +3 -2
  131. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +20 -6
  132. package/dist/utility/wrun/wrun-run-interval-session.util.js +22 -7
  133. package/dist/utility/wrun/wrun-run-interval.util.d.ts +39 -7
  134. package/dist/utility/wrun/wrun-run-interval.util.js +49 -9
  135. package/dist/utility/wrun/wrun-socket-row-source.js +7 -2
  136. package/dist/utility/wrun/wrun-source-rows.util.d.ts +29 -22
  137. package/dist/utility/wrun/wrun-source-rows.util.js +62 -41
  138. package/dist/utility/wrun/wrun-tape-per-order.util.js +1 -20
  139. package/dist/utility/wrun/wrun-tape-source.util.d.ts +17 -9
  140. package/dist/utility/wrun/wrun-tape-source.util.js +20 -12
  141. package/dist/workers/constants/socket-slots.d.ts +91 -6
  142. package/dist/workers/constants/socket-slots.js +85 -6
  143. package/package.json +11 -11
  144. package/dist/kscript-data/controls/live-trades-order-gate.util.d.ts +0 -56
  145. package/dist/kscript-data/controls/live-trades-order-gate.util.js +0 -107
@@ -0,0 +1,117 @@
1
+ /**
2
+ * The US stocks venue card (the consolidated tape: CTA for Tapes A and B, UTP for Tape C): the frontend descriptor of
3
+ * the $19 "Real-time US stocks" add-on on the venue-generic market-data plane (docs/features/market-data/plane.md, "US
4
+ * stocks on the plane"). Carried DARK: the registry lists it only while `us-equities-full` reads on
5
+ * (`FLAG_GATED_MARKET_DATA_VENUES`, `marketDataVenueIsServed`), so with the flag off nothing in the app reads it.
6
+ *
7
+ * OPRA's policy set (pay first, one product, a professional refused), with what the tape adds: two agreements, one per
8
+ * set of product groups (`agreements`: CTA's Exhibit B covers Tapes A and B, `NYSE_TAPE` and `NYSE_ARCA_TAPE`, the UTP
9
+ * Subscriber Agreement covers Tape C, `NASDAQ_TAPE`; the gate release's `agreements:` names and versions, `*-pending`
10
+ * until the texts ship), staff refused
11
+ * (ENTITLEMENT.md §7: no staff real time, the release's `internal_realtime: false`), and a declaration that records the
12
+ * Exhibit B Section 2 answers (a) to (k), the Paragraph 12 data and the UTP subscriber fields (`recordFields`,
13
+ * `legalNameFrom`). The question wording is NOT approved yet: the content module is marked so and the checkout stays
14
+ * shut while it is (src/components/dialogs/market-data/questionnaires/stocks.ts).
15
+ *
16
+ * Pinned against the contract copy beside this file (`stocks.contract.copy.json`, written from this card until orange's
17
+ * export replaces it) and the gate's release mirror (`gate-mirror.copy.yaml` beside the spec) by
18
+ * tests/packages/wrun-chart-host/market-data/venues/stocks.contract.spec.ts.
19
+ */
20
+ import { FeatureFlag } from '../../constants/feature-flags.constants.js';
21
+ import { STOCKS_GOVERNED_EXCHANGES, STOCKS_TAPE_OF_EXCHANGE } from '../../interfaces/stocks-realtime.interface.js';
22
+ // The product groups are the frontend's tape codes (the gate's wire names are the listing venues: the service and the
23
+ // gate mirror's copy name those, STOCKS_TAPE_WIRE_EXCHANGE maps them). CTA licenses Tapes A and B, UTP Tape C.
24
+ const CTA_TAPES = STOCKS_GOVERNED_EXCHANGES.filter((code) => STOCKS_TAPE_OF_EXCHANGE[code] !== 'C');
25
+ const UTP_TAPES = STOCKS_GOVERNED_EXCHANGES.filter((code) => STOCKS_TAPE_OF_EXCHANGE[code] === 'C');
26
+ export const STOCKS_VENUE = {
27
+ key: 'stocks',
28
+ displayName: 'US stocks',
29
+ // The three tapes, by their frontend codes (the gate release's `stocks.product_groups` name their listing venues).
30
+ productGroups: STOCKS_GOVERNED_EXCHANGES,
31
+ basePath: '/market-data/stocks',
32
+ // The one plan: every US stock trade in real time, all three tapes, billed monthly, non-professional subscribers
33
+ // only (Kyle 2026-10-29: $19 a month, raised from $15 the same day). Display price: the server's subscription price is authoritative once one exists.
34
+ products: [{ name: 'stocks_rt_1m', plan: 'p1', classifications: ['non_professional'], interval: '1m', priceUsd: 19 }],
35
+ planCard: { name: 'Real-time US stocks', level: 'ALL US VENUES', market: 'US stocks', region: '🇺🇸 USA' },
36
+ paymentItemPrefix: 'stocks_',
37
+ professionalPolicy: 'refuse',
38
+ // Staff get no real time on the tape (ENTITLEMENT.md §7; the release refuses internal rows): the server's refusal
39
+ // stands. No role is consulted here either way.
40
+ internalRolePolicy: 'refuse',
41
+ payFirst: true,
42
+ questionnaire: {
43
+ // `-pending` like the gate's agreement versions: the question wording is the public reference text until the
44
+ // exchange approves our subscriber screen. Bump on any change to the questions, their order or their wording.
45
+ formVersion: 'stocks-pending',
46
+ // CTA Exhibit B, Section 2, Paragraph 10 (a) to (k), in order: (a) personal, non-business use qualifies with Yes,
47
+ // every other question with No.
48
+ questions: [
49
+ { id: 'personal_non_business_use', qualifying: true },
50
+ { id: 'receives_for_business_or_entity', qualifying: false },
51
+ { id: 'registered_sec_cftc', qualifying: false },
52
+ { id: 'registered_other_regulator', qualifying: false },
53
+ { id: 'performs_registrable_functions', qualifying: false },
54
+ { id: 'provides_investment_advice', qualifying: false },
55
+ { id: 'asset_manager', qualifying: false },
56
+ { id: 'uses_others_capital', qualifying: false },
57
+ { id: 'trades_for_entity', qualifying: false },
58
+ { id: 'shares_trading_profits', qualifying: false },
59
+ { id: 'trading_benefits_received', qualifying: false },
60
+ ],
61
+ groups: [],
62
+ identityFields: ['legalName', 'employer', 'occupation', 'country', 'address'],
63
+ identityLimits: { legalName: 200, employer: 200, occupation: 200, country: 2, address: 300 },
64
+ // Exhibit B Paragraph 12 and the UTP subscriber fields the identity does not carry, under the names the gate's
65
+ // agreements require them by (the UTP fields `firstName`, `lastName`, `postalCode`, `employerPostalCode`; CTA's
66
+ // `paragraph12Titles` and `paragraph12Functions`). The middle name is optional (UTP); a field that does not apply
67
+ // reads None, as the employer field always has. Each name part stays within a third of the legal name's bound.
68
+ recordFields: [
69
+ { id: 'firstName', required: true, maxLength: 64 },
70
+ { id: 'middleName', required: false, maxLength: 64 },
71
+ { id: 'lastName', required: true, maxLength: 64 },
72
+ { id: 'postalCode', required: true, maxLength: 16 },
73
+ { id: 'employerAddress', required: true, maxLength: 300 },
74
+ { id: 'employerPostalCode', required: true, maxLength: 16 },
75
+ { id: 'paragraph12Titles', required: true, maxLength: 200 },
76
+ { id: 'paragraph12Functions', required: true, maxLength: 500 },
77
+ ],
78
+ legalNameFrom: ['firstName', 'middleName', 'lastName'],
79
+ // The gate's default attestation bound for this release (8784 h: a year and a day); neither plan asks a yearly
80
+ // re-attestation of its own.
81
+ validityDays: 366,
82
+ renewalWindowDays: 30,
83
+ },
84
+ // One agreement per plan (the gate release's `agreements:`): real time on a tape needs the assent to the agreement
85
+ // covering it, on the current declaration, at the version the server presents (K1's shape on each text route).
86
+ agreements: [
87
+ {
88
+ id: 'cta-exhibit-b',
89
+ productGroups: CTA_TAPES,
90
+ version: 'cta-exhibit-b-pending',
91
+ url: '/api/v1/market-data/stocks/agreements/cta-exhibit-b',
92
+ recordedAs: 'assent',
93
+ delayedRequiresAcceptance: false,
94
+ // Exhibit B's screen accepts Section 1, then Section 2 (split at the text's offset), and the gate records both.
95
+ sections: 2,
96
+ },
97
+ {
98
+ id: 'utp-subscriber',
99
+ productGroups: UTP_TAPES,
100
+ version: 'utp-subscriber-pending',
101
+ url: '/api/v1/market-data/stocks/agreements/utp-subscriber',
102
+ recordedAs: 'assent',
103
+ delayedRequiresAcceptance: false,
104
+ },
105
+ ],
106
+ // CTA and UTP define delayed data as 15 minutes after publication; the gate's window adds a 5 s margin (905 s).
107
+ delayMinutes: 15,
108
+ // The CTA Delayed Market Data Policy's exact statement: STOCKS_DELAY_STATEMENT in
109
+ // src/constants/stocks-compliance.constants.ts ("Delayed 15 minutes").
110
+ disclosure: { kind: 'verbatim' },
111
+ flagKey: FeatureFlag.UsEquitiesFull,
112
+ i18nNamespace: 'stocksRealtimeData',
113
+ storeId: 'stocksRealtime',
114
+ // For now the delay statement shows on a tape chart's delay chip and its source line only.
115
+ surfaces: ['contract-chart-delay-chip', 'chart-source-line'],
116
+ contractRevision: '2026-10-29.1',
117
+ };
@@ -28,6 +28,16 @@ const DISPLAY_MODE_WORDS = {
28
28
  ladder: 'dialogs.overlayStylesSettings.displayModeLadder',
29
29
  columns: 'indicators.settings.footprintLook.columns.mode',
30
30
  };
31
+ /** The line under each display mode in the picker (web: createFootprintDisplayModeOptions). */
32
+ const DISPLAY_MODE_HINT_WORDS = {
33
+ 'split-bar': 'indicators.settings.footprintLook.modeSplitHint',
34
+ 'stacked-bar-delta': 'indicators.settings.footprintLook.modeDeltaHint',
35
+ 'stacked-bar': 'indicators.settings.footprintLook.modeTotalHint',
36
+ cluster: 'indicators.settings.footprintLook.modeClusterHint',
37
+ 'imbalance-only': 'indicators.settings.footprintLook.modeImbalanceOnlyHint',
38
+ ladder: 'indicators.settings.footprintLook.modeLadderHint',
39
+ columns: 'indicators.settings.footprintLook.modeColumnsHint',
40
+ };
31
41
  const PRESET_WORDS = {
32
42
  bidAskDelta: 'indicators.settings.footprintLook.columns.presetBidAskDelta',
33
43
  deltaVolumeBar: 'indicators.settings.footprintLook.columns.presetDeltaVolumeBar',
@@ -48,6 +58,21 @@ const KIND_WORDS = {
48
58
  volumeBarLeading: 'indicators.settings.footprintLook.columns.kinds.volumeBarLeading',
49
59
  splitBar: 'indicators.settings.footprintLook.columns.kinds.splitBar',
50
60
  };
61
+ /** The line under each column kind in the picker (web: FootprintColumnsPicker.vue). */
62
+ const KIND_HINT_WORDS = {
63
+ bidAsk: 'indicators.settings.footprintLook.columns.kinds.bidAskHint',
64
+ delta: 'indicators.settings.footprintLook.columns.kinds.deltaHint',
65
+ deltaColored: 'indicators.settings.footprintLook.columns.kinds.deltaColoredHint',
66
+ diagonalDelta: 'indicators.settings.footprintLook.columns.kinds.diagonalDeltaHint',
67
+ deltaPct: 'indicators.settings.footprintLook.columns.kinds.deltaPctHint',
68
+ volume: 'indicators.settings.footprintLook.columns.kinds.volumeHint',
69
+ buy: 'indicators.settings.footprintLook.columns.kinds.buyHint',
70
+ sell: 'indicators.settings.footprintLook.columns.kinds.sellHint',
71
+ volumeBar: 'indicators.settings.footprintLook.columns.kinds.volumeBarHint',
72
+ deltaBar: 'indicators.settings.footprintLook.columns.kinds.deltaBarHint',
73
+ volumeBarLeading: 'indicators.settings.footprintLook.columns.kinds.volumeBarLeadingHint',
74
+ splitBar: 'indicators.settings.footprintLook.columns.kinds.splitBarHint',
75
+ };
51
76
  const OFF_WORDS = 'indicators.settings.options.off';
52
77
  const words = (key, params) => params ? { key, params } : { key };
53
78
  /**
@@ -79,7 +104,11 @@ function displayModeRow(model) {
79
104
  label: words('indicators.settings.displayMode'),
80
105
  tooltip: words('dialogs.overlayStylesSettings.displayModeTooltip'),
81
106
  look: 'select',
82
- options: FOOTPRINT_DISPLAY_MODES.map((value) => ({ value, label: words(DISPLAY_MODE_WORDS[value]) })),
107
+ options: FOOTPRINT_DISPLAY_MODES.map((value) => ({
108
+ value,
109
+ label: words(DISPLAY_MODE_WORDS[value]),
110
+ hint: words(DISPLAY_MODE_HINT_WORDS[value]),
111
+ })),
83
112
  value: footprintDisplayModeShown(model),
84
113
  }, (current, value) => withFootprintDisplayMode(current, value));
85
114
  }
@@ -101,7 +130,11 @@ function columnsPresetsRow(model) {
101
130
  /** One select per drawn column, and one more reading Off while there is room. */
102
131
  function columnRows(model) {
103
132
  const columns = footprintColumnsShown(model);
104
- const kindOptions = () => FOOTPRINT_COLUMN_KINDS.map((kind) => ({ value: kind, label: words(KIND_WORDS[kind]) }));
133
+ const kindOptions = () => FOOTPRINT_COLUMN_KINDS.map((kind) => ({
134
+ value: kind,
135
+ label: words(KIND_WORDS[kind]),
136
+ hint: words(KIND_HINT_WORDS[kind]),
137
+ }));
105
138
  return Array.from({ length: Math.min(FOOTPRINT_COLUMNS_MAX, columns.length + 1) }, (_, index) => choiceRow({
106
139
  id: `column-${index + 1}`,
107
140
  label: words('indicators.settings.footprintLook.columns.column', { n: index + 1 }),
@@ -21,10 +21,11 @@ export interface SettingsFormWords {
21
21
  readonly key: string;
22
22
  readonly params?: Readonly<Record<string, string | number>>;
23
23
  }
24
- /** One option of a choice row: the value a pick writes, and its words. */
24
+ /** One option of a choice row: the value a pick writes, its words, and the short line a picker draws under it. */
25
25
  export interface SettingsFormOption {
26
26
  readonly value: string;
27
27
  readonly label: SettingsFormWords;
28
+ readonly hint?: SettingsFormWords;
28
29
  }
29
30
  /** The settings bag a row reads and writes (an overlay's settings). */
30
31
  export type SettingsFormModel = Record<string, unknown>;
@@ -775,6 +775,11 @@ export const INDICATOR_COMMON_FIELDS = [
775
775
  // (the restore reads `settings.isAutoScale ?? true`). Without the row every save dropped it, so Manual read Auto
776
776
  // after a reload.
777
777
  ['isAutoScale', PREFERENCE],
778
+ // The TPO open and close block markers (2026-10-30), declared after the fixture in their own change.
779
+ ['highlightOpen', PREFERENCE],
780
+ ['openBlockColor', PREFERENCE],
781
+ ['highlightClose', PREFERENCE],
782
+ ['closeBlockColor', PREFERENCE],
778
783
  ];
779
784
  /**
780
785
  * FEED (live series, docs/features/indicators/feeds.md): the rest of the C4 record beside `address`, `scope` and
@@ -792,19 +797,21 @@ const FEED_FIELDS = [
792
797
  ['pane', PREFERENCE],
793
798
  ];
794
799
  /**
795
- * The metric profiles (metric-profile.util): the render keys the save door derives from `scope` and the member's look
800
+ * The metric profiles (metric-profile.util): the render keys the save door derives from `scope` and the row's display
796
801
  * (stampMetricProfileScopeDerived) beyond the shared ones: the Current period fold (`profileWindow: 'all'`,
797
802
  * `periodMarkers`) and the look every scope draws (the Open Interest Profile's `deltaLayout`, every member's
798
803
  * `levelBasis`). The door writes them into the row, so the restore pick must keep them or every boot spends a
799
- * reconcile save. Scoped to the family for the Delta Profile's reason: the Developing Session Profile stamps
800
- * `profileWindow: 'data'` on every mount. The engine-only keys (`periodStartMs`, `headerTemplate`, `pocLabel`) stay
801
- * out: two of them are translated text.
804
+ * reconcile save. The display itself (`rowDisplay`, the Display field: Net or Split on the Open Interest Profile, absent
805
+ * for the default) is the user's preference the look follows. Scoped to the family for the Delta Profile's reason: the
806
+ * Developing Session Profile stamps `profileWindow: 'data'` on every mount. The engine-only keys (`periodStartMs`,
807
+ * `headerTemplate`, `pocLabel`) stay out: two of them are translated text.
802
808
  */
803
809
  const METRIC_PROFILE_FIELDS = [
804
810
  ['profileWindow', PREFERENCE],
805
811
  ['periodMarkers', PREFERENCE],
806
812
  ['deltaLayout', PREFERENCE],
807
813
  ['levelBasis', PREFERENCE],
814
+ ['rowDisplay', PREFERENCE],
808
815
  ];
809
816
  /**
810
817
  * The Symbol Comparison overlays (new price scale, same % scale, new pane): the name the user gave the series (`label`,
@@ -821,19 +828,34 @@ const SYMBOL_COMPARISON_FIELDS = [['label', INSTANCE]];
821
828
  * (`dataSource`, the internal Server strike rows switch, OPTIONS-HEATMAP-STRIKE-SURFACE plan 2.4) is kept the same
822
829
  * way: an explicit choice survives a reload, and an overlay that never chose keeps no value, so it reads the default.
823
830
  */
831
+ /**
832
+ * The Chain pick of Options GEX and Options Heatmap (a derived root: QQQ on an NQ chart), replacing the shared `chain`
833
+ * (a DEX pool's, instance state): a preference a reset clears, kept for the market it was picked on, since another
834
+ * market's chart offers other roots.
835
+ */
836
+ const DERIVED_CHAIN_PICK = { lanes: ['row', 'template', 'default'], marketBound: true };
824
837
  const OPTIONS_HEATMAP_FIELDS = [
838
+ ['chain', DERIVED_CHAIN_PICK],
825
839
  ['showNodes', PREFERENCE],
826
840
  ['nodePct', PREFERENCE],
827
841
  ['velocityWindow', PREFERENCE],
828
842
  ['cellShape', PREFERENCE],
829
843
  ['lowNodes', PREFERENCE],
830
844
  ['dataSource', PREFERENCE],
845
+ // The node look knobs (NODE-KNOBS 2026-10-28): the smallest, the biggest and the faintest node, percent sliders.
846
+ ['nodeMinSize', PREFERENCE],
847
+ ['nodeMaxSize', PREFERENCE],
848
+ ['nodeMinOpacity', PREFERENCE],
849
+ // 'user' once the user picked the basis in the settings dialog: a governed host's market switch and restore reset
850
+ // only a naive basis the old switch forced (the control's `governedBasisReset`), so the mark travels with `basis`.
851
+ ['basisSource', PREFERENCE],
831
852
  ];
832
853
  /**
833
854
  * The Options GEX profile's Top node pill (its settings dialog's Key levels rows), scoped like the heatmap's above, and
834
855
  * the look of a level's axis tag (`axisTagLook`, 'quiet' | 'words', EM-LOOK 2026-10-26), unset until the user picks one.
835
856
  */
836
857
  const OPTIONS_GEX_FIELDS = [
858
+ ['chain', DERIVED_CHAIN_PICK],
837
859
  ['showTopNode', PREFERENCE],
838
860
  ['topNodeColor', PREFERENCE],
839
861
  ['axisTagLook', PREFERENCE],
@@ -917,4 +939,12 @@ export const INDICATOR_TYPE_FIELDS = {
917
939
  * (EtfDistributionYieldSettings.vue `meta.showPayouts`), is a preference.
918
940
  */
919
941
  ETF_DISTRIBUTION_YIELD: [['showPayouts', META_PREFERENCE]],
942
+ /**
943
+ * Moving Average Ribbon: its line slots (MaRibbonSettings.vue `meta.lines`: each slot's average, length and switch)
944
+ * are a preference; the Style page's names (`meta.plots`) are derived from them at every mount.
945
+ */
946
+ MA_RIBBON: [
947
+ ['lines', META_PREFERENCE],
948
+ ['plots', META_DERIVED],
949
+ ],
920
950
  };
@@ -68,11 +68,12 @@ export declare const TOOL_TEMPLATE_RULES: {
68
68
  readonly intervalBoundTypes: readonly ["GhostFeed", "BarPattern", "GannSquareFixed"];
69
69
  /**
70
70
  * Keys the engine reads but the registry defaultStyle does not list (web src/components/objects/tool-prop-sections.ts
71
- * HELD_EXTRA_FIELDS: the price label flag of a horizontal line or ray), each with the default the engine seeds
72
- * (titan's tool classes), so a template, a seed and Save as default see every key. A key belongs in the registry:
73
- * an extra stays here only while the registry cannot carry it as the editors show it (the price label flag is the
74
- * `highlight` field under a per-type label). A position's line width and style moved into the registry with
75
- * chart-schema 0.5.1, and the generator refuses an extra the registry lists.
71
+ * HELD_EXTRA_FIELDS: the price label flag of a horizontal line or ray, the fib pair's log-scale levels), each with
72
+ * the default the engine seeds (titan's tool classes), so a template, a seed and Save as default see every key. A
73
+ * key belongs in the registry: an extra stays here only while the registry cannot carry it as the editors show it
74
+ * (the price label flag is the `highlight` field under a per-type label), or until the registry lists it (the fib
75
+ * pair's). A position's line width and style moved into the registry with chart-schema 0.5.1, and the generator
76
+ * refuses an extra the registry lists.
76
77
  */
77
78
  readonly heldExtras: {
78
79
  readonly HorizontalLine: {
@@ -81,6 +82,12 @@ export declare const TOOL_TEMPLATE_RULES: {
81
82
  readonly HorizontalRay: {
82
83
  readonly highlight: true;
83
84
  };
85
+ readonly FibonacciRetracement: {
86
+ readonly levelsOnLogScale: false;
87
+ };
88
+ readonly FibonacciTrend: {
89
+ readonly levelsOnLogScale: false;
90
+ };
84
91
  };
85
92
  /**
86
93
  * Style keys Save as default never keeps, and so neither does web's style memory (src/store/tool-style-memory.ts
@@ -68,15 +68,21 @@ export const TOOL_TEMPLATE_RULES = {
68
68
  intervalBoundTypes: ['GhostFeed', 'BarPattern', 'GannSquareFixed'],
69
69
  /**
70
70
  * Keys the engine reads but the registry defaultStyle does not list (web src/components/objects/tool-prop-sections.ts
71
- * HELD_EXTRA_FIELDS: the price label flag of a horizontal line or ray), each with the default the engine seeds
72
- * (titan's tool classes), so a template, a seed and Save as default see every key. A key belongs in the registry:
73
- * an extra stays here only while the registry cannot carry it as the editors show it (the price label flag is the
74
- * `highlight` field under a per-type label). A position's line width and style moved into the registry with
75
- * chart-schema 0.5.1, and the generator refuses an extra the registry lists.
71
+ * HELD_EXTRA_FIELDS: the price label flag of a horizontal line or ray, the fib pair's log-scale levels), each with
72
+ * the default the engine seeds (titan's tool classes), so a template, a seed and Save as default see every key. A
73
+ * key belongs in the registry: an extra stays here only while the registry cannot carry it as the editors show it
74
+ * (the price label flag is the `highlight` field under a per-type label), or until the registry lists it (the fib
75
+ * pair's). A position's line width and style moved into the registry with chart-schema 0.5.1, and the generator
76
+ * refuses an extra the registry lists.
76
77
  */
77
78
  heldExtras: {
78
79
  HorizontalLine: { highlight: true },
79
80
  HorizontalRay: { highlight: true },
81
+ // "Fib levels based on log scale" (feedback 1815): titan from 3dcd6689 (the release after 0.0.4-alpha.1211) spaces
82
+ // the levels in log10 of the price while it is on; chart-schema 0.8.0's FIB_STYLE does not list it yet, and the
83
+ // generator refuses these two once it does.
84
+ FibonacciRetracement: { levelsOnLogScale: false },
85
+ FibonacciTrend: { levelsOnLogScale: false },
80
86
  },
81
87
  /**
82
88
  * Style keys Save as default never keeps, and so neither does web's style memory (src/store/tool-style-memory.ts
@@ -398,6 +398,7 @@ export const TOOL_DEFAULT_STYLE = {
398
398
  { value: 4.618, color: '#9E7548', enabled: false },
399
399
  { value: 4.764, color: '#00BCD4', enabled: false },
400
400
  ],
401
+ levelsOnLogScale: false,
401
402
  },
402
403
  FibonacciTrend: {
403
404
  lineWidth: 2,
@@ -438,6 +439,7 @@ export const TOOL_DEFAULT_STYLE = {
438
439
  { value: 4.618, color: '#9E7548', enabled: false },
439
440
  { value: 4.764, color: '#00BCD4', enabled: false },
440
441
  ],
442
+ levelsOnLogScale: false,
441
443
  },
442
444
  FixedRangeVolumeProfile: {},
443
445
  FlagMark: { color: '#4DA3FF' },
@@ -1259,6 +1261,7 @@ export const TOOL_TEMPLATE_KEYS = {
1259
1261
  'levelFormat',
1260
1262
  'textPosition',
1261
1263
  'fibLevels',
1264
+ 'levelsOnLogScale',
1262
1265
  'visibleIntervalsMs',
1263
1266
  ],
1264
1267
  FibonacciTrend: [
@@ -1275,6 +1278,7 @@ export const TOOL_TEMPLATE_KEYS = {
1275
1278
  'levelFormat',
1276
1279
  'textPosition',
1277
1280
  'fibLevels',
1281
+ 'levelsOnLogScale',
1278
1282
  'visibleIntervalsMs',
1279
1283
  ],
1280
1284
  FixedRangeVolumeProfile: [
@@ -24,10 +24,10 @@
24
24
  import type { CmeServedAccess, CmeServedAccessByExchange } from '../../interfaces/cme-realtime.interface.js';
25
25
  import type { GateProvider } from '../../workers/constants/socket-slots.js';
26
26
  /** Bars + indicator history: timing only, provider-prefixed off CME. */
27
- export type CmeBarCacheContext = 'delayed' | 'realtime' | 'opra-delayed' | 'opra-realtime';
27
+ export type CmeBarCacheContext = 'delayed' | 'realtime' | 'opra-delayed' | 'opra-realtime' | 'stocks-delayed' | 'stocks-realtime';
28
28
  /** The served timing a bar context names, whatever its plane. */
29
29
  export declare function barCacheTiming(context: CmeBarCacheContext): 'delayed' | 'realtime';
30
- /** The bar context of one plane at one timing (CME unprefixed: its keys predate a second plane). */
30
+ /** The bar context of one plane at one timing (CME unprefixed: its keys predate a second plane; the others carry their provider). */
31
31
  export declare function barCacheContextFor(provider: GateProvider, timing: 'delayed' | 'realtime'): CmeBarCacheContext;
32
32
  /**
33
33
  * Order book + heatmap: timing plus served depth, prefixed with the units era.
@@ -62,6 +62,8 @@ export declare function cmeBarCacheContext(exchange: string | undefined | null):
62
62
  export declare const CME_BAR_CACHE_SHAPE_VERSION = 4;
63
63
  /** The OPRA twin of {@link CME_BAR_CACHE_SHAPE_VERSION} (`opra{N}-<timing>`); same bump rule. */
64
64
  export declare const OPRA_BAR_CACHE_SHAPE_VERSION = 1;
65
+ /** The stocks tape's bars shape era (`stocks{N}-<timing>`): its keys never met a Polygon chart's (the tape codes differ). */
66
+ export declare const STOCKS_BAR_CACHE_SHAPE_VERSION = 1;
65
67
  /** The chart-session component of a bars cache key. Only the RTH-filtered
66
68
  * data set is ever tagged: ETH is the default full-session set, and leaving
67
69
  * it untagged keeps every non-RTH key byte-identical within a version era. */
@@ -71,7 +73,7 @@ export type CmeBarCacheSession = 'rth' | null;
71
73
  * served-access transition purge predicate must agree byte-for-byte, across
72
74
  * BOTH session variants of a timing (see `cmeDelayedBarShapeSuffixes`).
73
75
  * The plane rides the prefix: `cme{N}-<timing>` for CME, `opra{N}-<timing>`
74
- * for OPRA. */
76
+ * for OPRA, `stocks{N}-<timing>` for the US stocks tape. */
75
77
  export declare function cmeBarCacheShape(context: CmeBarCacheContext, session?: CmeBarCacheSession): string;
76
78
  /** Every shape suffix a delayed-timing bars entry of one plane (CME unless
77
79
  * named) can carry in the current version era: the session x back-adjustment
@@ -24,11 +24,11 @@
24
24
  import { governedPlaneOf } from '../v2/gate-plane.util.js';
25
25
  /** The served timing a bar context names, whatever its plane. */
26
26
  export function barCacheTiming(context) {
27
- return context === 'realtime' || context === 'opra-realtime' ? 'realtime' : 'delayed';
27
+ return context === 'realtime' || context.endsWith('-realtime') ? 'realtime' : 'delayed';
28
28
  }
29
- /** The bar context of one plane at one timing (CME unprefixed: its keys predate a second plane). */
29
+ /** The bar context of one plane at one timing (CME unprefixed: its keys predate a second plane; the others carry their provider). */
30
30
  export function barCacheContextFor(provider, timing) {
31
- return provider === 'cme' ? timing : `opra-${timing}`;
31
+ return provider === 'cme' ? timing : `${provider}-${timing}`;
32
32
  }
33
33
  /** The two book context values, exported so consumers (transition detection,
34
34
  * purge substrings) never hand-spell the era prefix. */
@@ -95,16 +95,20 @@ export function cmeBarCacheContext(exchange) {
95
95
  export const CME_BAR_CACHE_SHAPE_VERSION = 4;
96
96
  /** The OPRA twin of {@link CME_BAR_CACHE_SHAPE_VERSION} (`opra{N}-<timing>`); same bump rule. */
97
97
  export const OPRA_BAR_CACHE_SHAPE_VERSION = 1;
98
+ /** The stocks tape's bars shape era (`stocks{N}-<timing>`): its keys never met a Polygon chart's (the tape codes differ). */
99
+ export const STOCKS_BAR_CACHE_SHAPE_VERSION = 1;
98
100
  /** The bars cache-key shape suffix for a governed bar context. Single
99
101
  * authority for the format: the key builder (`cacheKeyForMetadata`) and the
100
102
  * served-access transition purge predicate must agree byte-for-byte, across
101
103
  * BOTH session variants of a timing (see `cmeDelayedBarShapeSuffixes`).
102
104
  * The plane rides the prefix: `cme{N}-<timing>` for CME, `opra{N}-<timing>`
103
- * for OPRA. */
105
+ * for OPRA, `stocks{N}-<timing>` for the US stocks tape. */
104
106
  export function cmeBarCacheShape(context, session = null) {
105
- const prefix = context === 'opra-delayed' || context === 'opra-realtime'
107
+ const prefix = context.startsWith('opra-')
106
108
  ? `opra${OPRA_BAR_CACHE_SHAPE_VERSION}`
107
- : `cme${CME_BAR_CACHE_SHAPE_VERSION}`;
109
+ : context.startsWith('stocks-')
110
+ ? `stocks${STOCKS_BAR_CACHE_SHAPE_VERSION}`
111
+ : `cme${CME_BAR_CACHE_SHAPE_VERSION}`;
108
112
  return `${prefix}-${barCacheTiming(context)}${session ? `-${session}` : ''}`;
109
113
  }
110
114
  /** Every shape suffix a delayed-timing bars entry of one plane (CME unless
@@ -47,6 +47,16 @@ export function getExchangeFullName(exchange, t) {
47
47
  return t('cmeRealtimeData.exchanges.globex');
48
48
  case 'OPRA':
49
49
  return t('cmeRealtimeData.exchanges.opra');
50
+ // A listing venue and its tape read the same name: the tape code is the same venue through the stocks gate.
51
+ case 'NYSE':
52
+ case 'NYSE_TAPE':
53
+ return t('cmeRealtimeData.exchanges.nyse');
54
+ case 'NYSE_ARCA':
55
+ case 'NYSE_ARCA_TAPE':
56
+ return t('cmeRealtimeData.exchanges.nyseArca');
57
+ case 'NASDAQ':
58
+ case 'NASDAQ_TAPE':
59
+ return t('cmeRealtimeData.exchanges.nasdaq');
50
60
  default:
51
61
  return exchange;
52
62
  }
@@ -0,0 +1,83 @@
1
+ /**
2
+ * The `cme-user-scripts` gate as the venue policy reads it (kscript-venue-policy.util, the one decider of the governed
3
+ * walls: `isCmeUserScriptRun`), and the authorisation epoch every door that lands a CME user study's answer compares.
4
+ * Dependency-free on purpose (zero imports), the shape of the pre-retirement opra-user-scripts gate: the venue policy
5
+ * stays worker-safe and store-free, so the main thread hands it readers instead.
6
+ *
7
+ * The gate is open only while BOTH of its facts answer `true`, each read live on every call:
8
+ * - The flag. The flags store registers its override-aware `isOn` as the fallback when it is created, and publishes
9
+ * its reader again after every successful fetch. Until a fetch publishes, the fallback answers, so the dev and
10
+ * internal `kiyo.flag-overrides` lens reaches the walls before the map lands and through a failed fetch, exactly as
11
+ * it reaches every surface that reads `isOn`: the walls and the surfaces never disagree.
12
+ * - The viewer's CME entitlement. The web hands its `viewerMayReadCme()` reader: signed in, not a guest, the CME data
13
+ * terms not blocked. Delayed and real-time access both count: the tier a read rides is the gate plane's, decided per
14
+ * socket, never this answer's.
15
+ *
16
+ * Fail closed everywhere: in any context neither reader reached (a worker, a guest, a spec without a store), a reader
17
+ * that throws and a reader that answers anything but `true` read the gate closed, today's CME wall. The flag is never
18
+ * read server-side: kscript-backend denies CME to every user run whatever it says.
19
+ *
20
+ * The authorisation epoch (`cmeStudyAuthEpoch`, `bumpCmeStudyAuthEpoch`, `captureCmeStudyAuth`,
21
+ * `isCmeStudyAuthCurrent`): the generation model of the options chain's governed access
22
+ * (src/workers/indicators/options-chain-state.worker.util.ts `syncGovernedChainAccess`), moved to the main thread. The
23
+ * main-thread lifecycle watcher (web: `installCmeUserStudyLifecycle`, cme-user-scripts-lifecycle.util) bumps it
24
+ * whenever an input of a CME user study's authorisation moves: the account id, the CME data-terms state, the CME served
25
+ * access, the flag, a session expiry or a session swap. A run captures a token before it asks; every door that lands
26
+ * its answer (titan-charts' dataFetch result, the script engine's result, the wrun run's `isCurrent`) compares the
27
+ * token and drops an answer from a previous authorisation context, so a late answer never lands after access changed.
28
+ * A missing token is never current. The epoch is main-thread state: a worker's copy of this module never sees a bump,
29
+ * so a worker carries the captured token back and never judges it. Publishing a reader never moves the epoch (a flag
30
+ * fetch publishes after every fetch, moved or not): only the watcher bumps it, on a move it saw.
31
+ *
32
+ * The stopped-study register (`markCmeStudyStopped`, `clearCmeStudyStopped`, `cmeStudyStopReason`,
33
+ * `isCmeStudyStopped`): the studies the lifecycle watcher stopped in place when the gate closed (the viewer's access
34
+ * changed, or the flag went dark), keyed by chart index and overlay id. Main-thread state, never persisted: the
35
+ * workspace row and the editor tab keep their source and settings, the register only tells Door H which words to paint
36
+ * ("Access changed; the study stopped" or "CME chart studies are turned off") and the local-engine self-heal which rows
37
+ * to leave alone. The re-judgment that mounts a study again clears its row; a chart teardown clears the chart's rows.
38
+ *
39
+ * The remount stash (`stashCmeStudyRemount`, `cmeStudyRemountStash`): what a stopped study's remount needs that its
40
+ * workspace row does not carry, kept beside its register row and dropped with it by `clearCmeStudyStopped` (one clear,
41
+ * so a stash never outlives the stop it belongs to). An editor draft's source is the case: the add strips
42
+ * `settings.script` from the mounted config once the worker engine holds it, and a draft's row is session-only, so
43
+ * once its engine is destroyed nothing else on the page holds its code. Typed `unknown` here: the web lifecycle writes
44
+ * it, the web re-judgment reads it. Main-thread state, never persisted.
45
+ */
46
+ /** Why the lifecycle stopped a study: the viewer's access moved, or the flag went dark. */
47
+ export type CmeStudyStopReason = 'access-changed' | 'studies-off';
48
+ /** Record a study the lifecycle stopped in place (Door H paints the reason's words until it is cleared). */
49
+ export declare function markCmeStudyStopped(chartIndex: number, overlayId: string, reason: CmeStudyStopReason): void;
50
+ /** Forget one stopped study, or every stopped study of a chart when no overlay id is given, with its remount stash. */
51
+ export declare function clearCmeStudyStopped(chartIndex: number, overlayId?: string): void;
52
+ /** Keep what a stopped study's remount needs and its row does not carry (the header); `clearCmeStudyStopped` drops it. */
53
+ export declare function stashCmeStudyRemount(chartIndex: number, overlayId: string, remount: unknown): void;
54
+ /** What the lifecycle kept for a stopped study's remount, or undefined when its row carries all it needs. */
55
+ export declare function cmeStudyRemountStash(chartIndex: number, overlayId: string): unknown;
56
+ /** The reason a study was stopped, or undefined for a study the lifecycle never stopped. */
57
+ export declare function cmeStudyStopReason(chartIndex: number, overlayId: string): CmeStudyStopReason | undefined;
58
+ /** Whether the lifecycle stopped this study and nothing has mounted it again since. */
59
+ export declare function isCmeStudyStopped(chartIndex: number, overlayId: string): boolean;
60
+ /** Called by the flags store after a successful fetch (and by specs); null unpublishes. */
61
+ export declare function publishCmeUserScriptsFlag(next: (() => boolean) | null): void;
62
+ /** Called by the flags store when it is created: its override-aware `isOn`, read until a fetch publishes. */
63
+ export declare function setCmeUserScriptsFlagFallback(next: (() => boolean) | null): void;
64
+ /** Called by the web with its `viewerMayReadCme()` reader (signed in, not a guest, CME data terms not blocked); null
65
+ * unregisters, and no reader reads closed. */
66
+ export declare function setCmeUserScriptsEntitlementReader(next: (() => boolean) | null): void;
67
+ /** Whether the `cme-user-scripts` flag is on for this session: the published answer, else the store's own; closed
68
+ * when neither can tell. The flag alone: the walls read `isCmeUserScriptsGateOpen`. */
69
+ export declare function isCmeUserScriptsFlagOn(): boolean;
70
+ /** Whether the CME plane may open to a user run the browser executes: the flag lit AND the viewer entitled. */
71
+ export declare function isCmeUserScriptsGateOpen(): boolean;
72
+ /** The authorisation epoch now (see the header). */
73
+ export declare function cmeStudyAuthEpoch(): number;
74
+ /** Move the epoch on: every token captured before is no longer current. Returns the new epoch. */
75
+ export declare function bumpCmeStudyAuthEpoch(): number;
76
+ /** The token a run captures before it asks (frozen: a holder cannot move it forward). */
77
+ export declare function captureCmeStudyAuth(): {
78
+ epoch: number;
79
+ };
80
+ /** Whether a captured token is from the current authorisation context; a missing or malformed token is not. */
81
+ export declare function isCmeStudyAuthCurrent(token: {
82
+ epoch: number;
83
+ } | null | undefined): boolean;