@orangecharts/wrun-chart-host 0.9.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 (252) hide show
  1. package/README.md +2 -0
  2. package/dist/constants/feature-flags.constants.d.ts +15 -1
  3. package/dist/constants/feature-flags.constants.js +130 -24
  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/opra-compliance.constants.d.ts +3 -2
  7. package/dist/constants/opra-compliance.constants.js +3 -2
  8. package/dist/constants/option-venues.constants.d.ts +2 -2
  9. package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +26 -0
  10. package/dist/constants/scriptEditor/builtin-script-snippets.js +6 -0
  11. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.d.ts +15 -0
  12. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.js +17 -0
  13. package/dist/constants/venue-presets.constants.d.ts +20 -20
  14. package/dist/constants/venue-presets.constants.js +24 -26
  15. package/dist/host-env.d.ts +21 -5
  16. package/dist/host-env.js +6 -0
  17. package/dist/host-ports.types.d.ts +102 -19
  18. package/dist/index.d.ts +18 -0
  19. package/dist/index.js +18 -0
  20. package/dist/interfaces/cancel-reason.interface.d.ts +1 -1
  21. package/dist/interfaces/cme-realtime.interface.d.ts +16 -9
  22. package/dist/interfaces/cme-realtime.interface.js +6 -3
  23. package/dist/interfaces/kscript-diagnostics.interface.d.ts +12 -0
  24. package/dist/interfaces/opra-realtime.interface.d.ts +1 -5
  25. package/dist/interfaces/prediction-market.interface.d.ts +7 -0
  26. package/dist/interfaces/replay.interface.d.ts +8 -0
  27. package/dist/interfaces/stocks-realtime.interface.d.ts +57 -0
  28. package/dist/interfaces/stocks-realtime.interface.js +32 -0
  29. package/dist/interfaces/wrun-runtime.interface.d.ts +18 -2
  30. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +62 -94
  31. package/dist/kscript-data/controls/live-trades-merge.util.js +106 -171
  32. package/dist/market-data/billing.interface.d.ts +174 -36
  33. package/dist/market-data/billing.interface.js +58 -8
  34. package/dist/market-data/venue.d.ts +152 -7
  35. package/dist/market-data/venues/cme.contract.copy.json +66 -0
  36. package/dist/market-data/venues/cme.d.ts +126 -0
  37. package/dist/market-data/venues/cme.js +133 -0
  38. package/dist/market-data/venues/index.d.ts +294 -7
  39. package/dist/market-data/venues/index.js +49 -6
  40. package/dist/market-data/venues/opra.contract.copy.json +3 -2
  41. package/dist/market-data/venues/opra.d.ts +2 -2
  42. package/dist/market-data/venues/opra.js +5 -2
  43. package/dist/market-data/venues/stocks.contract.copy.json +64 -0
  44. package/dist/market-data/venues/stocks.d.ts +130 -0
  45. package/dist/market-data/venues/stocks.js +117 -0
  46. package/dist/settings-templates/footprint-rows.js +35 -2
  47. package/dist/settings-templates/form-rows.d.ts +2 -1
  48. package/dist/settings-templates/index.js +7 -3
  49. package/dist/settings-templates/indicator-fields.d.ts +5 -4
  50. package/dist/settings-templates/indicator-fields.js +79 -10
  51. package/dist/settings-templates/tool-rules.d.ts +32 -15
  52. package/dist/settings-templates/tool-rules.js +33 -11
  53. package/dist/settings-templates/tool-tables.generated.js +95 -31
  54. package/dist/utility/chart/book-live-bucket.util.d.ts +15 -0
  55. package/dist/utility/chart/book-live-bucket.util.js +47 -0
  56. package/dist/utility/chart/cme-cache-context.util.d.ts +5 -3
  57. package/dist/utility/chart/cme-cache-context.util.js +10 -6
  58. package/dist/utility/chart/cme-realtime.util.js +10 -0
  59. package/dist/utility/chart/cme-user-scripts-gate.util.d.ts +83 -0
  60. package/dist/utility/chart/cme-user-scripts-gate.util.js +142 -0
  61. package/dist/utility/chart/effective-chart-session.util.d.ts +14 -0
  62. package/dist/utility/chart/effective-chart-session.util.js +39 -0
  63. package/dist/utility/chart/host-bar-placement.util.d.ts +28 -0
  64. package/dist/utility/chart/host-bar-placement.util.js +170 -30
  65. package/dist/utility/chart/index-host-tier.util.d.ts +3 -1
  66. package/dist/utility/chart/index-host-tier.util.js +7 -2
  67. package/dist/utility/chart/index-mode-admission.util.js +30 -3
  68. package/dist/utility/chart/kscript-apply-fingerprint.util.js +1 -1
  69. package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +35 -11
  70. package/dist/utility/chart/kscript-drawing-safe-area.util.js +145 -35
  71. package/dist/utility/chart/kscript-live-coalesce.util.d.ts +9 -7
  72. package/dist/utility/chart/kscript-live-coalesce.util.js +13 -8
  73. package/dist/utility/chart/kscript-live-source-identity.util.d.ts +9 -0
  74. package/dist/utility/chart/kscript-live-source-identity.util.js +10 -1
  75. package/dist/utility/chart/kscript-provenance-keys.util.js +13 -0
  76. package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +5 -1
  77. package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +32 -2
  78. package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +45 -0
  79. package/dist/utility/chart/kscript-venue-policy.util.d.ts +156 -43
  80. package/dist/utility/chart/kscript-venue-policy.util.js +249 -59
  81. package/dist/utility/chart/live-bucket.util.d.ts +24 -8
  82. package/dist/utility/chart/live-bucket.util.js +85 -27
  83. package/dist/utility/chart/market-session-schedule.util.d.ts +10 -0
  84. package/dist/utility/chart/market-session-schedule.util.js +16 -0
  85. package/dist/utility/chart/marketKind.util.js +5 -0
  86. package/dist/utility/chart/mixed-mode.util.d.ts +7 -0
  87. package/dist/utility/chart/mixed-mode.util.js +14 -0
  88. package/dist/utility/chart/opra-read-access.leaf.d.ts +5 -3
  89. package/dist/utility/chart/opra-read-access.leaf.js +5 -3
  90. package/dist/utility/chart/opra-user-scripts-gate.util.d.ts +11 -16
  91. package/dist/utility/chart/opra-user-scripts-gate.util.js +12 -28
  92. package/dist/utility/chart/rth-session.util.d.ts +12 -10
  93. package/dist/utility/chart/rth-session.util.js +25 -21
  94. package/dist/utility/chart/trading-day.util.d.ts +17 -0
  95. package/dist/utility/chart/trading-day.util.js +59 -0
  96. package/dist/utility/chart/window-geometry.leaf.d.ts +8 -0
  97. package/dist/utility/chart/window-geometry.leaf.js +22 -6
  98. package/dist/utility/chart/window-owner.leaf.d.ts +23 -2
  99. package/dist/utility/chart/window-owner.leaf.js +45 -3
  100. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +33 -15
  101. package/dist/utility/chart/wrun-bar-session-facts.util.js +70 -20
  102. package/dist/utility/chart/wrun-run-result.util.d.ts +12 -0
  103. package/dist/utility/chart/wrun-run-result.util.js +141 -6
  104. package/dist/utility/intl-locale.util.js +5 -0
  105. package/dist/utility/options/option-bar-anchor.util.d.ts +145 -0
  106. package/dist/utility/options/option-bar-anchor.util.js +340 -0
  107. package/dist/utility/options/option-venue.util.d.ts +18 -0
  108. package/dist/utility/options/option-venue.util.js +27 -0
  109. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +4 -0
  110. package/dist/utility/v2/gate-plane.util.d.ts +12 -3
  111. package/dist/utility/v2/gate-plane.util.js +30 -4
  112. package/dist/utility/v2/gate-session-latch.util.js +1 -1
  113. package/dist/utility/v2/stocks-governed.util.d.ts +16 -0
  114. package/dist/utility/v2/stocks-governed.util.js +34 -0
  115. package/dist/utility/wrun/derived-roots.leaf.d.ts +13 -0
  116. package/dist/utility/wrun/derived-roots.leaf.js +27 -0
  117. package/dist/utility/wrun/derived-roots.util.d.ts +205 -0
  118. package/dist/utility/wrun/derived-roots.util.js +451 -0
  119. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +43 -7
  120. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.js +89 -19
  121. package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.d.ts +9 -4
  122. package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.js +47 -6
  123. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -2
  124. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -2
  125. package/dist/utility/wrun/run-schedule/wrun-own-candles.util.d.ts +24 -3
  126. package/dist/utility/wrun/run-schedule/wrun-own-candles.util.js +46 -10
  127. package/dist/utility/wrun/sources/lanes/option_daily.js +5 -2
  128. package/dist/utility/wrun/sources/lanes/options_flow.js +5 -2
  129. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +64 -19
  130. package/dist/utility/wrun/sources/opra-option-lanes.util.js +105 -35
  131. package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +2 -1
  132. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +2 -1
  133. package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +3 -0
  134. package/dist/utility/wrun/sources/row-lanes/option_prints.js +19 -4
  135. package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +17 -4
  136. package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +52 -13
  137. package/dist/utility/wrun/sources/row-lanes/option_strikes.js +88 -19
  138. package/dist/utility/wrun/sources/row-lanes/option_surface.js +2 -1
  139. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -0
  140. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +24 -9
  141. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +41 -10
  142. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.d.ts +111 -0
  143. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.js +133 -0
  144. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +15 -3
  145. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +22 -3
  146. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +31 -0
  147. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +197 -13
  148. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +761 -27
  149. package/dist/utility/wrun/wrun-browser-sources.leaf.js +1 -2
  150. package/dist/utility/wrun/wrun-builtin-twin.util.d.ts +12 -0
  151. package/dist/utility/wrun/wrun-builtin-twin.util.js +21 -0
  152. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +60 -16
  153. package/dist/utility/wrun/wrun-chart-market-facts.util.js +113 -61
  154. package/dist/utility/wrun/wrun-color-settings.util.d.ts +9 -0
  155. package/dist/utility/wrun/wrun-color-settings.util.js +33 -0
  156. package/dist/utility/wrun/wrun-download-meter.util.d.ts +15 -0
  157. package/dist/utility/wrun/wrun-download-meter.util.js +14 -2
  158. package/dist/utility/wrun/wrun-download-plan.util.d.ts +99 -0
  159. package/dist/utility/wrun/wrun-download-plan.util.js +118 -0
  160. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +11 -3
  161. package/dist/utility/wrun/wrun-draft-legend-note.util.js +26 -4
  162. package/dist/utility/wrun/wrun-frames.d.ts +27 -6
  163. package/dist/utility/wrun/wrun-frames.js +73 -10
  164. package/dist/utility/wrun/wrun-handles.util.d.ts +7 -3
  165. package/dist/utility/wrun/wrun-handles.util.js +9 -8
  166. package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +7 -1
  167. package/dist/utility/wrun/wrun-hosted-wire.util.js +12 -2
  168. package/dist/utility/wrun/wrun-hud-looks.util.d.ts +18 -4
  169. package/dist/utility/wrun/wrun-hud-looks.util.js +45 -13
  170. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +68 -0
  171. package/dist/utility/wrun/wrun-input-requirements.leaf.js +163 -7
  172. package/dist/utility/wrun/wrun-latest-snapshot.d.ts +11 -0
  173. package/dist/utility/wrun/wrun-leg-close.util.d.ts +59 -23
  174. package/dist/utility/wrun/wrun-leg-close.util.js +186 -28
  175. package/dist/utility/wrun/wrun-live-intake.util.d.ts +35 -15
  176. package/dist/utility/wrun/wrun-live-intake.util.js +243 -126
  177. package/dist/utility/wrun/wrun-live-tick.util.d.ts +13 -5
  178. package/dist/utility/wrun/wrun-live-tick.util.js +279 -99
  179. package/dist/utility/wrun/wrun-market-facts.util.d.ts +13 -3
  180. package/dist/utility/wrun/wrun-market-facts.util.js +13 -3
  181. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +60 -11
  182. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +70 -5
  183. package/dist/utility/wrun/wrun-market-size-defaults.util.js +31 -5
  184. package/dist/utility/wrun/wrun-opra-lane.util.d.ts +17 -4
  185. package/dist/utility/wrun/wrun-opra-lane.util.js +6 -4
  186. package/dist/utility/wrun/wrun-option-book-rows.util.d.ts +56 -0
  187. package/dist/utility/wrun/wrun-option-book-rows.util.js +96 -0
  188. package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.d.ts +31 -0
  189. package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.js +119 -0
  190. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +23 -6
  191. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +47 -11
  192. package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +86 -19
  193. package/dist/utility/wrun/wrun-option-strike-flow.util.js +168 -62
  194. package/dist/utility/wrun/wrun-option-views.util.d.ts +323 -28
  195. package/dist/utility/wrun/wrun-option-views.util.js +484 -71
  196. package/dist/utility/wrun/wrun-options-chain.util.d.ts +3 -3
  197. package/dist/utility/wrun/wrun-options-chain.util.js +2 -0
  198. package/dist/utility/wrun/wrun-output-style.util.d.ts +6 -2
  199. package/dist/utility/wrun/wrun-output-style.util.js +20 -2
  200. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +32 -2
  201. package/dist/utility/wrun/wrun-overlay-drivers.util.js +13 -3
  202. package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +10 -1
  203. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +52 -4
  204. package/dist/utility/wrun/wrun-overlay-recovery.util.js +3 -1
  205. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +160 -42
  206. package/dist/utility/wrun/wrun-overlay-run.util.js +1244 -209
  207. package/dist/utility/wrun/wrun-pane-format.util.d.ts +2 -1
  208. package/dist/utility/wrun/wrun-pane-format.util.js +7 -3
  209. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +9 -0
  210. package/dist/utility/wrun/wrun-panel-mount.util.js +114 -19
  211. package/dist/utility/wrun/wrun-panel-style.util.d.ts +10 -9
  212. package/dist/utility/wrun/wrun-panel-style.util.js +58 -9
  213. package/dist/utility/wrun/wrun-param-map.util.d.ts +14 -11
  214. package/dist/utility/wrun/wrun-param-map.util.js +10 -5
  215. package/dist/utility/wrun/wrun-param-values.util.d.ts +14 -4
  216. package/dist/utility/wrun/wrun-param-values.util.js +4 -0
  217. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +15 -2
  218. package/dist/utility/wrun/wrun-pin-spelling.util.js +39 -14
  219. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +50 -0
  220. package/dist/utility/wrun/wrun-refusal-surface.util.js +68 -0
  221. package/dist/utility/wrun/wrun-refusal.util.d.ts +3 -2
  222. package/dist/utility/wrun/wrun-refusal.util.js +22 -0
  223. package/dist/utility/wrun/wrun-refused-latest.util.d.ts +10 -0
  224. package/dist/utility/wrun/wrun-refused-latest.util.js +12 -0
  225. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +26 -0
  226. package/dist/utility/wrun/wrun-registry-errors.util.js +34 -0
  227. package/dist/utility/wrun/wrun-replay-lane.util.js +3 -2
  228. package/dist/utility/wrun/wrun-row-source.d.ts +11 -0
  229. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +20 -6
  230. package/dist/utility/wrun/wrun-run-interval-session.util.js +22 -7
  231. package/dist/utility/wrun/wrun-run-interval.util.d.ts +43 -9
  232. package/dist/utility/wrun/wrun-run-interval.util.js +58 -15
  233. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +45 -1
  234. package/dist/utility/wrun/wrun-script-inputs.util.js +112 -4
  235. package/dist/utility/wrun/wrun-setting-words.util.d.ts +7 -3
  236. package/dist/utility/wrun/wrun-setting-words.util.js +13 -5
  237. package/dist/utility/wrun/wrun-socket-row-source.d.ts +27 -2
  238. package/dist/utility/wrun/wrun-socket-row-source.js +118 -8
  239. package/dist/utility/wrun/wrun-source-rows.util.d.ts +29 -18
  240. package/dist/utility/wrun/wrun-source-rows.util.js +61 -27
  241. package/dist/utility/wrun/wrun-style-words.util.js +6 -4
  242. package/dist/utility/wrun/wrun-table-chrome.util.d.ts +3 -2
  243. package/dist/utility/wrun/wrun-table-chrome.util.js +19 -11
  244. package/dist/utility/wrun/wrun-tape-per-order.util.d.ts +2 -0
  245. package/dist/utility/wrun/wrun-tape-per-order.util.js +7 -0
  246. package/dist/utility/wrun/wrun-tape-source.util.d.ts +17 -9
  247. package/dist/utility/wrun/wrun-tape-source.util.js +20 -12
  248. package/dist/utils/replay/replay-buffer-math.d.ts +53 -2
  249. package/dist/utils/replay/replay-buffer-math.js +227 -20
  250. package/dist/workers/constants/socket-slots.d.ts +91 -6
  251. package/dist/workers/constants/socket-slots.js +85 -6
  252. package/package.json +5 -5
@@ -138,18 +138,32 @@ export interface WrunHudLookRow {
138
138
  /** The `window` chrome's two-colour title bar. */
139
139
  windowBar?: [string, string];
140
140
  texture: WrunHudTexture;
141
- /** A home look keeps its paper in both themes; an adaptive one resolves
142
- * tokens per theme and may name a light variant. A home look may name one
143
- * too, to keep its paper legible over a light chart (cockpit: the same
144
- * slate, opaque, with stronger labels). */
141
+ /** A home look keeps its own paper (its colours are the look's, never the
142
+ * app theme's); an adaptive one resolves tokens per theme and may name a
143
+ * light variant. A home look whose paper is dark names one too: over a
144
+ * light chart it wears that light paper, ink, rules and accent instead of
145
+ * sitting black on the chart (OPRA QA 2026-10-22: the inline paper beats
146
+ * the light rule of the stylesheet, which covers the default look alone;
147
+ * wrun-hud-looks.util.spec.ts fails a dark home row without one). A light
148
+ * paper needs none: it reads on both charts. Cockpit's variant keeps its
149
+ * slate on purpose (opaque, with stronger labels: template QA C17). */
145
150
  home: boolean;
151
+ /** What the look wears over a light chart, each word in place of the row's own. */
146
152
  light?: {
147
153
  background?: string;
154
+ /** A vertical gradient's stops (stage's wash). */
155
+ backgroundGradient?: string[];
148
156
  borderColor?: string;
149
157
  textColor?: string;
158
+ /** The label ink (terminal's amber labels go a dark amber on white). */
159
+ labelTextColor?: string;
160
+ /** The accent: a bright accent made for a dark paper reads too faint on a light one. */
161
+ accentColor?: string;
150
162
  /** The tiles' label opacity (`--wrun-hud-label-opacity`, 0.55 when absent);
151
163
  * at least WRUN_HUD_LIGHT_LABEL_OPACITY_MIN. */
152
164
  labelOpacity?: number;
165
+ /** The text halo: a glow is a dark paper's effect and smudges the glyphs on a light one. */
166
+ textGlow?: number;
153
167
  };
154
168
  }
155
169
  /** The frozen look table (g3 addendum, "The look table"). `default` is the
@@ -148,6 +148,14 @@ export const WRUN_HUD_LOOK_TABLE = {
148
148
  chrome: 'cover',
149
149
  texture: 'none',
150
150
  home: true,
151
+ /** Over a light chart the green wash fades into a light paper, the type goes ink (15:1) and the green
152
+ * deepens so the 30 px headline still reads (3.8:1 on the wash, 4.4:1 on the paper). */
153
+ light: {
154
+ backgroundGradient: ['#d3eedd', '#eaf6ee', '#f6f6f6', '#f6f6f6'],
155
+ textColor: '#121212',
156
+ accentColor: '#13853d',
157
+ labelOpacity: 0.75,
158
+ },
151
159
  },
152
160
  signal: {
153
161
  background: '#000000',
@@ -164,6 +172,8 @@ export const WRUN_HUD_LOOK_TABLE = {
164
172
  chrome: 'card',
165
173
  texture: 'none',
166
174
  home: true,
175
+ /** Over a light chart the same slab in white: black type, a hairline edge (labels at 0.55 read 4.8:1). */
176
+ light: { background: '#ffffff', borderColor: '#e3e3e3', textColor: '#000000' },
167
177
  },
168
178
  terminal: {
169
179
  background: '#000000',
@@ -182,6 +192,17 @@ export const WRUN_HUD_LOOK_TABLE = {
182
192
  titleBarInk: '#000000',
183
193
  texture: 'none',
184
194
  home: true,
195
+ /** Over a light chart (the OPRA cards, QA 2026-10-22): white paper, black type, a grey frame, the labels a
196
+ * dark amber at 0.8 (4.7:1), and the title bar a deeper amber that still takes its black ink (6.1:1) and
197
+ * inks the headline at 3.4:1 (bold 22 px). */
198
+ light: {
199
+ background: '#ffffff',
200
+ borderColor: '#b8b8b8',
201
+ textColor: '#000000',
202
+ labelTextColor: '#7a4700',
203
+ accentColor: '#c77800',
204
+ labelOpacity: 0.8,
205
+ },
185
206
  },
186
207
  broadsheet: {
187
208
  background: '#F6F1E7',
@@ -275,6 +296,9 @@ export const WRUN_HUD_LOOK_TABLE = {
275
296
  chrome: 'none',
276
297
  texture: 'scanlines',
277
298
  home: true,
299
+ /** Over a light chart a pale green paper with the phosphor printed in a deep green (7.4:1), labels at 0.8
300
+ * (4.6:1), no glow; the scanlines stay. */
301
+ light: { background: '#eef7f0', textColor: '#0b5d27', accentColor: '#0b5d27', labelOpacity: 0.8, textGlow: 0 },
278
302
  },
279
303
  classic: {
280
304
  background: '#C0C0C0',
@@ -353,8 +377,9 @@ export function wrunHudPointerFree(style) {
353
377
  return style.opacity !== undefined && style.opacity < WRUN_HUD_POINTER_FREE_OPACITY;
354
378
  }
355
379
  /** The card's background: a declared colour (at its declared opacity), a
356
- * declared gradient, else the look's; a declared opacity alone dims today's
357
- * surface. Undefined keeps today's rule. */
380
+ * declared gradient, else the look's (its light variant's paper over a light
381
+ * chart); a declared opacity alone dims today's surface. Undefined keeps
382
+ * today's rule. */
358
383
  function backgroundCss(entry, row, light, theme) {
359
384
  const direction = entry.gradient_direction === 'horizontal' ? 'to right' : 'to bottom';
360
385
  const gradient = Array.isArray(entry.background_gradient)
@@ -364,14 +389,16 @@ function backgroundCss(entry, row, light, theme) {
364
389
  return `linear-gradient(${direction}, ${gradient.map((stop) => paint(stop, theme)).join(', ')})`;
365
390
  }
366
391
  const opacity = numberIn(entry.background_opacity, 0, 1);
367
- const lookBackground = light && row.light?.background !== undefined ? row.light.background : row.background;
392
+ const variant = light ? row.light : undefined;
393
+ const lookBackground = variant?.background ?? row.background;
368
394
  const color = colorWord(entry.background_color) ?? lookBackground;
369
395
  if (color !== undefined) {
370
396
  const painted = paint(color, theme);
371
397
  return opacity === undefined ? painted : withShare(painted, opacity);
372
398
  }
373
- if (row.backgroundGradient !== undefined && row.backgroundGradient.length >= 2) {
374
- return `linear-gradient(to bottom, ${row.backgroundGradient.map((stop) => paint(stop, theme)).join(', ')})`;
399
+ const lookGradient = variant?.backgroundGradient ?? row.backgroundGradient;
400
+ if (lookGradient !== undefined && lookGradient.length >= 2) {
401
+ return `linear-gradient(to bottom, ${lookGradient.map((stop) => paint(stop, theme)).join(', ')})`;
375
402
  }
376
403
  if (opacity !== undefined)
377
404
  return `color-mix(in srgb, var(--tooltip-bg, #17171c) ${Math.round(opacity * 100)}%, transparent)`;
@@ -391,13 +418,15 @@ export function resolveWrunHudLook(entry, options = {}) {
391
418
  const look = viewerPick ?? authorLook ?? 'default';
392
419
  const row = WRUN_HUD_LOOK_TABLE[look];
393
420
  const light = options.light === true;
421
+ // Over a light chart the look's light variant stands in for its paper, ink, rules and accent word by word; on a
422
+ // dark chart there is none, so every word below reads the row as it always did.
423
+ const variant = light ? row.light : undefined;
394
424
  const css = {};
395
425
  // Surface
396
426
  const background = backgroundCss(entry, row, light, theme);
397
427
  if (background !== undefined)
398
428
  css['--wrun-hud-bg'] = background;
399
- const borderColor = colorWord(entry.border_color) ??
400
- (light && row.light?.borderColor !== undefined ? row.light.borderColor : row.borderColor);
429
+ const borderColor = colorWord(entry.border_color) ?? variant?.borderColor ?? row.borderColor;
401
430
  if (borderColor !== undefined)
402
431
  css['--wrun-hud-border-color'] = paint(borderColor, theme);
403
432
  const borderWidth = numberIn(entry.border_width, 0, WRUN_MAX_HUD_BORDER_WIDTH_PX) ?? row.borderWidth;
@@ -435,14 +464,15 @@ export function resolveWrunHudLook(entry, options = {}) {
435
464
  // A look with its own ink prints its title, labels and tracks in it (the
436
465
  // app's muted and secondary inks belong to the app theme, not the paper);
437
466
  // a declared text_color recolours the text alone (DW22).
438
- const lookTextColor = light && row.light?.textColor !== undefined ? row.light.textColor : row.textColor;
467
+ const lookTextColor = variant?.textColor ?? row.textColor;
439
468
  const lookInk = lookTextColor === undefined ? undefined : paint(lookTextColor, theme);
440
469
  if (lookInk !== undefined) {
441
470
  css['--wrun-hud-title-ink'] = lookInk;
442
- css['--wrun-hud-label-ink'] = row.labelTextColor === undefined ? lookInk : paint(row.labelTextColor, theme);
471
+ const labelTextColor = variant?.labelTextColor ?? row.labelTextColor;
472
+ css['--wrun-hud-label-ink'] = labelTextColor === undefined ? lookInk : paint(labelTextColor, theme);
443
473
  css['--wrun-hud-track'] = withShare(lookInk, 0.15);
444
474
  }
445
- const labelOpacity = light ? row.light?.labelOpacity : undefined;
475
+ const labelOpacity = variant?.labelOpacity;
446
476
  if (labelOpacity !== undefined)
447
477
  css['--wrun-hud-label-opacity'] = String(labelOpacity);
448
478
  const declaredInk = colorWord(entry.text_color);
@@ -457,13 +487,15 @@ export function resolveWrunHudLook(entry, options = {}) {
457
487
  const headlineWeight = wrunFontWeightCss(row.headlineFontWeight);
458
488
  if (headlineWeight !== undefined)
459
489
  css['--wrun-hud-headline-weight'] = String(headlineWeight);
460
- const textGlow = numberIn(entry.text_glow, 0, WRUN_MAX_HUD_TEXT_GLOW_PX) ?? row.textGlow ?? 0;
490
+ const textGlow = numberIn(entry.text_glow, 0, WRUN_MAX_HUD_TEXT_GLOW_PX) ?? variant?.textGlow ?? row.textGlow ?? 0;
461
491
  if (textGlow > 0)
462
492
  css['--wrun-hud-glow'] = `0 0 ${textGlow}px currentColor`;
463
- // Accent (LK03): a declared colour, the ladder's rung, the look's, else the
464
- // theme's for any look but `default` (whose marks ink in the text colour).
493
+ // Accent (LK03): a declared colour, the ladder's rung, the look's (its light
494
+ // variant's over a light chart), else the theme's for any look but `default`
495
+ // (whose marks ink in the text colour).
465
496
  const accentWord = colorWord(entry.accent_color) ??
466
497
  accentRung(entry, options.snapshot) ??
498
+ variant?.accentColor ??
467
499
  row.accentColor ??
468
500
  (look !== 'default' || entry.accent_color_by !== undefined ? 'theme.accent' : undefined);
469
501
  const accent = accentWord === undefined ? undefined : paint(accentWord, theme);
@@ -61,6 +61,9 @@ export type WrunInputRequirement = ({
61
61
  * Recorded only on a lane whose absence can hold the run: a quiet lane's readers (book, trades,
62
62
  * oi, liquidations, tape) draw without it whatever they declare. Absent: none is optional. */
63
63
  optional?: readonly string[];
64
+ /** The inputs follow the chart's coin to another venue's market (`follow: "coin"`, kit 0.77.0 coin legs): read by
65
+ * the chart's coin whatever their kind (`wrunRequirementReadsChartCoin`). Absent: they read no coin's market. */
66
+ followsCoin?: true;
64
67
  };
65
68
  /** The gateway type each chart-market class's lane fetches (its K control's data type). */
66
69
  export declare const CHART_MARKET_GATEWAY_TYPES: Readonly<Record<string, string>>;
@@ -81,6 +84,36 @@ export declare function wrunRequirementClasses(): string[];
81
84
  * chart-market requirement with an empty gateway type: unknown, never "needs nothing".
82
85
  */
83
86
  export declare function wrunInputRequirements(effectiveSheet: WrunIndicatorMetadata): WrunInputRequirement[];
87
+ /**
88
+ * Whether a requirement reads by the chart's coin: the options chain and every chain lane (`options`: the chain
89
+ * decision reads the coin's chain on a market that is no options venue), every provider lane (`provider`: its coin
90
+ * list, the Deribit coin set or the chart's coin itself) and every coin leg (`followsCoin`: the coin's market on
91
+ * another venue). Every other input reads the chart market's own series, a pinned market, a governed plane or
92
+ * nothing of the market.
93
+ */
94
+ export declare function wrunRequirementReadsChartCoin(req: Pick<WrunInputRequirement, 'kind' | 'followsCoin'>): boolean;
95
+ /**
96
+ * The prediction-market wall (Kyle 2026-10-29: options indicators on a Polymarket chart make no sense). A prediction
97
+ * market's price is the odds of an outcome, and the coin its chart carries is no asset that price follows: the symbol
98
+ * pipeline's coin match places no series key and answers BTC (symbol-resolve.util `getCoin`), and an event about a coin
99
+ * names that coin. An input read by the chart's coin (`wrunRequirementReadsChartCoin`) would draw another market's
100
+ * options, volatility or flows under the odds, so every prediction venue (`isPredictionExchangeName`: Polymarket,
101
+ * HIP4) refuses it whatever fill it declares: a wall like the CME and OPRA ones, since the fill would stand in for a
102
+ * series the market can never have. Whether the market reads the input at all (`needed_by`, a `when` setting) is the
103
+ * caller's to settle first. The picker's verdict and the works-on list (wrun-input-requirements.util) and the run's
104
+ * head (`wrunPredictionMarketWalledInput`) read this one rule.
105
+ */
106
+ export declare function wrunPredictionMarketWalls(req: Pick<WrunInputRequirement, 'kind' | 'followsCoin'>, exchange: string | undefined | null): boolean;
107
+ /**
108
+ * The first input of a sheet the prediction-market wall refuses on `exchange` (`wrunPredictionMarketWalls`), with its
109
+ * source class, in input order. Undefined off a prediction venue, or when no input the market demands reads by the
110
+ * chart's coin: the sheet is the one the run reads there (its settings applied and its lane demand at the market's size
111
+ * unit, so a `when` setting that is off or a `needed_by` leaving the unit out marks the input `undemanded`).
112
+ */
113
+ export declare function wrunPredictionMarketWalledInput(sheet: WrunIndicatorMetadata, exchange: string | undefined | null): {
114
+ name: string;
115
+ sourceClass: string;
116
+ } | undefined;
84
117
  /**
85
118
  * Whether an input reads its declared fill over an empty lane instead of holding the run (the
86
119
  * honest-picture rule's quiet reader): a scalar input's `missing: "nan"` blanks the outputs it
@@ -120,6 +153,8 @@ export interface WrunUnservedLane {
120
153
  exchange: string;
121
154
  symbol: string;
122
155
  };
156
+ /** The run market a lane on the chart's own market was judged on (a Trades chart's tape); absent: the chart's. */
157
+ judgedExchange?: string;
123
158
  /** The first reader the market demands (by input index) that cannot draw without the lane
124
159
  * (`wrunInputDrawsWithoutLane`): the run refuses by its name. Absent: the lane stays undispatched
125
160
  * and every reader reads its fill. */
@@ -151,5 +186,38 @@ export declare function wrunUnservedLanes(sheet: Pick<WrunIndicatorMetadata, 'in
151
186
  coin: string;
152
187
  }, opts?: {
153
188
  nativeLanes?: readonly string[];
189
+ runMarket?: {
190
+ exchange: string;
191
+ } | null;
154
192
  }): WrunUnservedLane[];
193
+ /** How a lane class reads the run market: where its trades print, where its rows came from, the chart's own, none. */
194
+ export type WrunRunMarketRead = 'run-market' | 'candle-source' | 'chart-market' | 'none';
195
+ /** Every lane class declares its read here: a class left out reads the stored market by accident (the guard spec). */
196
+ export declare const WRUN_RUN_MARKET_READS: Readonly<Record<string, WrunRunMarketRead>>;
197
+ /** A lane class's read, undefined for a class the table does not name. */
198
+ export declare function wrunRunMarketReadOfClass(sourceClass: unknown): WrunRunMarketRead | undefined;
199
+ /** The chart fetch type a class asks its chart-market rows through, undefined when it asks none of its own. */
200
+ export declare function wrunRunMarketFetchTypeOf(sourceClass: string): string | undefined;
201
+ /** How an ask of a fetch type reads the run market (`fetchLane` decides by its type); an unlisted type stays put. */
202
+ export declare function wrunRunMarketReadOfFetchType(type: string): WrunRunMarketRead;
203
+ /** The market a class reading the chart's own market is judged on: the run market, which then names its facts. */
204
+ export declare function wrunRunMarketOn(sourceClass: string, market: {
205
+ exchange: string | undefined;
206
+ coin: string;
207
+ }, runMarket: {
208
+ exchange: string;
209
+ } | null | undefined): {
210
+ exchange: string | undefined;
211
+ coin: string;
212
+ };
213
+ /** Whether a sheet reads the run market: a demanded input of a run-market class on the chart's own market. */
214
+ export declare function wrunSheetReadsRunMarket(sheet: Pick<WrunIndicatorMetadata, 'inputs' | 'inputSources'>): boolean;
215
+ /** Whether a source reads the run market: a run-market type on the chart's own market (history pin and live map). */
216
+ export declare function wrunSourceReadsRunMarket(type: string, payload: {
217
+ exchange?: unknown;
218
+ symbol?: unknown;
219
+ }, chart: {
220
+ exchange?: unknown;
221
+ symbol?: unknown;
222
+ } | null | undefined): boolean;
155
223
  export {};
@@ -11,6 +11,7 @@
11
11
  */
12
12
  import { Intervals } from '../../constants/interval.constants.js';
13
13
  import { wrunLaneServiceOnMarket } from '../chart/index-mode-admission.util.js';
14
+ import { isPredictionExchangeName } from '../chart/prediction-identity.util.js';
14
15
  import { wrunFollowsCoin } from './wrun-market-facts.util.js';
15
16
  import { WRUN_OPTION_SUMMARY_LANES } from './wrun-option-summary-lane.util.js';
16
17
  import { wrunRowLaneClasses, wrunRowLaneOfClass } from './sources/row-lane-registry.js';
@@ -29,8 +30,7 @@ export const CHART_MARKET_GATEWAY_TYPES = Object.freeze({
29
30
  oi: 'OPEN_INTEREST_AGG',
30
31
  volume_profile: 'VOLUME_PROFILE_AGG',
31
32
  trade_volume_by_size: 'TRADE_VOLUME_BY_SIZE_AGG',
32
- // The tape's live prints ride the raw TRADE channel (its history reads TRADE_LARGE, a copy of the
33
- // same prints): the markets that list raw trades.
33
+ // Listed by TRADE: the registrar lists no TRADE_LARGE twin, though the tape reads TRADE_LARGE rows.
34
34
  tape: 'TRADE',
35
35
  liquidations: 'LIQUIDATION_AGG',
36
36
  funding: 'FUNDING_RATE_AGG',
@@ -255,7 +255,8 @@ export function wrunInputRequirements(effectiveSheet) {
255
255
  // undemanded input nowhere, so it keeps `needed_by`).
256
256
  const neededBy = source?.needed_by?.size_unit;
257
257
  const keepsNeededBy = row.kind !== 'pinned' && (row.kind !== 'options' || row.sourceClass !== undefined);
258
- const shape = Array.isArray(neededBy) && keepsNeededBy ? { ...row, neededBy } : row;
258
+ const demanded = Array.isArray(neededBy) && keepsNeededBy ? { ...row, neededBy } : row;
259
+ const shape = source !== undefined && wrunFollowsCoin(source) ? { ...demanded, followsCoin: true } : demanded;
259
260
  const key = JSON.stringify(shape);
260
261
  // Whether the input is optional rides beside the shape, never in it: inputs that need the same
261
262
  // thing share one requirement whatever fills they declare.
@@ -277,6 +278,55 @@ export function wrunInputRequirements(effectiveSheet) {
277
278
  return [...byKey.values()];
278
279
  }
279
280
  // ---------------------------------------------------------------------------
281
+ // The prediction-market wall
282
+ // ---------------------------------------------------------------------------
283
+ /**
284
+ * Whether a requirement reads by the chart's coin: the options chain and every chain lane (`options`: the chain
285
+ * decision reads the coin's chain on a market that is no options venue), every provider lane (`provider`: its coin
286
+ * list, the Deribit coin set or the chart's coin itself) and every coin leg (`followsCoin`: the coin's market on
287
+ * another venue). Every other input reads the chart market's own series, a pinned market, a governed plane or
288
+ * nothing of the market.
289
+ */
290
+ export function wrunRequirementReadsChartCoin(req) {
291
+ return req.kind === 'options' || req.kind === 'provider' || req.followsCoin === true;
292
+ }
293
+ /**
294
+ * The prediction-market wall (Kyle 2026-10-29: options indicators on a Polymarket chart make no sense). A prediction
295
+ * market's price is the odds of an outcome, and the coin its chart carries is no asset that price follows: the symbol
296
+ * pipeline's coin match places no series key and answers BTC (symbol-resolve.util `getCoin`), and an event about a coin
297
+ * names that coin. An input read by the chart's coin (`wrunRequirementReadsChartCoin`) would draw another market's
298
+ * options, volatility or flows under the odds, so every prediction venue (`isPredictionExchangeName`: Polymarket,
299
+ * HIP4) refuses it whatever fill it declares: a wall like the CME and OPRA ones, since the fill would stand in for a
300
+ * series the market can never have. Whether the market reads the input at all (`needed_by`, a `when` setting) is the
301
+ * caller's to settle first. The picker's verdict and the works-on list (wrun-input-requirements.util) and the run's
302
+ * head (`wrunPredictionMarketWalledInput`) read this one rule.
303
+ */
304
+ export function wrunPredictionMarketWalls(req, exchange) {
305
+ return wrunRequirementReadsChartCoin(req) && isPredictionExchangeName(exchange);
306
+ }
307
+ /**
308
+ * The first input of a sheet the prediction-market wall refuses on `exchange` (`wrunPredictionMarketWalls`), with its
309
+ * source class, in input order. Undefined off a prediction venue, or when no input the market demands reads by the
310
+ * chart's coin: the sheet is the one the run reads there (its settings applied and its lane demand at the market's size
311
+ * unit, so a `when` setting that is off or a `needed_by` leaving the unit out marks the input `undemanded`).
312
+ */
313
+ export function wrunPredictionMarketWalledInput(sheet, exchange) {
314
+ if (!isPredictionExchangeName(exchange))
315
+ return undefined;
316
+ for (const req of wrunInputRequirements(sheet)) {
317
+ if (!wrunPredictionMarketWalls(req, exchange))
318
+ continue;
319
+ for (const name of req.inputs) {
320
+ const source = sheet.inputSources?.[name];
321
+ if (source?.undemanded === true)
322
+ continue;
323
+ const sourceClass = source?.source ?? sheet.inputs.find((input) => input.name === name)?.source;
324
+ return { name, sourceClass: typeof sourceClass === 'string' ? sourceClass : '' };
325
+ }
326
+ }
327
+ return undefined;
328
+ }
329
+ // ---------------------------------------------------------------------------
280
330
  // The run's admission (the capability rule, WRUN-REFUSALS U3a step 5)
281
331
  // ---------------------------------------------------------------------------
282
332
  /**
@@ -418,6 +468,10 @@ export function wrunUnservedLanes(sheet, market, opts = {}) {
418
468
  ...verdict,
419
469
  inputNames: readers.map((input) => input.name),
420
470
  ...(legMarket !== undefined ? { market: legMarket } : {}),
471
+ // The refusal's words name the market the lane was judged on, never the stored one it never read.
472
+ ...(legMarket === undefined && on.exchange !== market.exchange && on.exchange !== undefined
473
+ ? { judgedExchange: on.exchange }
474
+ : {}),
421
475
  ...(holding !== undefined ? { holding: { name: holding.name, celled: holding.cellType === 'array' } } : {}),
422
476
  });
423
477
  };
@@ -426,18 +480,20 @@ export function wrunUnservedLanes(sheet, market, opts = {}) {
426
480
  const source = sheet.inputSources[input.name];
427
481
  return source?.source === lane && source.undemanded !== true;
428
482
  });
483
+ // A class on the chart's own market is judged on the run market (a Trades chart's tape), never the stored one.
484
+ const own = wrunRunMarketOn(lane, market, opts.runMarket);
429
485
  if (lane !== 'trades' && !isWrunLaneStreamClass(lane)) {
430
- judge(lane, readers, market);
486
+ judge(lane, readers, own);
431
487
  continue;
432
488
  }
433
489
  // A pinned trades input (and a lane stream pinned to another market) is judged on its leg's market; an
434
490
  // unresolved coin leg or a half pin nowhere (the row builder refuses it by name).
435
- const own = [];
491
+ const ownReaders = [];
436
492
  const legs = new Map();
437
493
  for (const input of readers) {
438
494
  const { exchange, symbol, ...source } = sheet.inputSources[input.name];
439
495
  if (exchange === undefined && symbol === undefined && !wrunFollowsCoin(source))
440
- own.push(input);
496
+ ownReaders.push(input);
441
497
  else if (typeof exchange === 'string' && typeof symbol === 'string') {
442
498
  const key = `${exchange}|${symbol}`;
443
499
  const leg = legs.get(key) ?? { market: { exchange, symbol }, readers: [] };
@@ -445,9 +501,109 @@ export function wrunUnservedLanes(sheet, market, opts = {}) {
445
501
  legs.set(key, leg);
446
502
  }
447
503
  }
448
- judge(lane, own, market);
504
+ judge(lane, ownReaders, own);
449
505
  for (const leg of legs.values())
450
506
  judge(lane, leg.readers, { exchange: leg.market.exchange, coin: market.coin }, leg.market);
451
507
  }
452
508
  return unserved;
453
509
  }
510
+ /** Every lane class declares its read here: a class left out reads the stored market by accident (the guard spec). */
511
+ export const WRUN_RUN_MARKET_READS = Object.freeze({
512
+ // Built from the chart's trades, so asked where they print (the decider awaited once, before the capability rule).
513
+ trades: 'run-market',
514
+ volume_profile: 'run-market',
515
+ trade_volume_by_size: 'run-market',
516
+ tape: 'run-market',
517
+ volume_profile_candles: 'run-market',
518
+ // The chart's candles: the rows' own market in the series ref alone, synchronous, so the shape stays the chart's.
519
+ ohlcv: 'candle-source',
520
+ candles: 'candle-source',
521
+ intrabar: 'candle-source',
522
+ // The chart's own market, judged on the run market (no tape serves them, so a Trades chart drops them by its facts).
523
+ book: 'chart-market',
524
+ oi: 'chart-market',
525
+ oi_candles: 'chart-market',
526
+ liquidations: 'chart-market',
527
+ funding: 'chart-market',
528
+ long_short_ratio: 'chart-market',
529
+ // A pinned market, a provider or coin series, an options chain or the bar clock: no chart market to move.
530
+ odds: 'none',
531
+ time: 'none',
532
+ implied_volatility: 'none',
533
+ skew: 'none',
534
+ etf_flow: 'none',
535
+ options_chain: 'none',
536
+ bitfinex_funding: 'none',
537
+ economic: 'none',
538
+ etf_holdings: 'none',
539
+ etf_premium: 'none',
540
+ ethena_positions: 'none',
541
+ option_daily: 'none',
542
+ option_stats_10m: 'none',
543
+ options_flow: 'none',
544
+ options_oi: 'none',
545
+ options_volume: 'none',
546
+ series: 'none',
547
+ token_supply: 'none',
548
+ treasury_balance: 'none',
549
+ volatility_index: 'none',
550
+ option_contract_flow: 'none',
551
+ option_contract_state: 'none',
552
+ option_prints: 'none',
553
+ option_strike_flow: 'none',
554
+ option_strikes: 'none',
555
+ option_surface: 'none',
556
+ });
557
+ /** A lane class's read, undefined for a class the table does not name. */
558
+ export function wrunRunMarketReadOfClass(sourceClass) {
559
+ return typeof sourceClass === 'string' && Object.hasOwn(WRUN_RUN_MARKET_READS, sourceClass)
560
+ ? WRUN_RUN_MARKET_READS[sourceClass]
561
+ : undefined;
562
+ }
563
+ /** The chart fetch type a class asks its chart-market rows through, undefined when it asks none of its own. */
564
+ export function wrunRunMarketFetchTypeOf(sourceClass) {
565
+ if (isWrunLegStreamClass(sourceClass))
566
+ return WRUN_LEG_STREAM_CLASSES[sourceClass].fetchType;
567
+ if (sourceClass === 'ohlcv' || sourceClass === 'intrabar')
568
+ return 'ohlcv';
569
+ return WRUN_ADMISSION_LANES.get(sourceClass);
570
+ }
571
+ /** The read of each fetch type, built once from the class table (the guard spec holds its classes to one read). */
572
+ const WRUN_RUN_MARKET_READ_BY_FETCH_TYPE = new Map(Object.entries(WRUN_RUN_MARKET_READS).flatMap(([sourceClass, read]) => {
573
+ const fetchType = wrunRunMarketFetchTypeOf(sourceClass);
574
+ return fetchType === undefined ? [] : [[fetchType, read]];
575
+ }));
576
+ /** How an ask of a fetch type reads the run market (`fetchLane` decides by its type); an unlisted type stays put. */
577
+ export function wrunRunMarketReadOfFetchType(type) {
578
+ return WRUN_RUN_MARKET_READ_BY_FETCH_TYPE.get(type) ?? 'chart-market';
579
+ }
580
+ /** The market a class reading the chart's own market is judged on: the run market, which then names its facts. */
581
+ export function wrunRunMarketOn(sourceClass, market, runMarket) {
582
+ const read = WRUN_RUN_MARKET_READS[sourceClass];
583
+ return runMarket && (read === 'run-market' || read === 'chart-market')
584
+ ? { exchange: runMarket.exchange, coin: market.coin }
585
+ : market;
586
+ }
587
+ /** Whether a sheet reads the run market: a demanded input of a run-market class on the chart's own market. */
588
+ export function wrunSheetReadsRunMarket(sheet) {
589
+ return sheet.inputs.some((input) => {
590
+ const source = sheet.inputSources[input.name];
591
+ if (source === undefined || source.undemanded === true)
592
+ return false;
593
+ if (wrunRunMarketReadOfClass(source.source) !== 'run-market')
594
+ return false;
595
+ return source.exchange === undefined && source.symbol === undefined && !wrunFollowsCoin(source);
596
+ });
597
+ }
598
+ /** Whether a source reads the run market: a run-market type on the chart's own market (history pin and live map). */
599
+ export function wrunSourceReadsRunMarket(type, payload, chart) {
600
+ if (wrunRunMarketReadOfFetchType(type.toLowerCase()) !== 'run-market')
601
+ return false;
602
+ // The engine's current-market placeholders name the chart's own market.
603
+ const exchange = payload.exchange === 'currentExchange' || payload.exchange === undefined ? chart?.exchange : payload.exchange;
604
+ const symbol = payload.symbol === 'currentSymbol' ? chart?.symbol : payload.symbol;
605
+ return (typeof exchange === 'string' &&
606
+ exchange === chart?.exchange &&
607
+ typeof symbol === 'string' &&
608
+ symbol === chart?.symbol);
609
+ }
@@ -16,4 +16,15 @@ export interface WrunLatestSnapshot {
16
16
  /** The init() arguments the run computed with, one per sheet param in sheet order (the
17
17
  * rig's proof that a dialog edit reached the module). Absent on a tick republish. */
18
18
  initArgs?: number[];
19
+ /** A full run the host refused by name (a lane unserved on this market, a budget, a plan): the card shows this
20
+ * sentence instead of its tiles. Absent on a served run. `reason` is the refusal row's key, `sentence` the
21
+ * user-facing chip text. */
22
+ refused?: {
23
+ reason: string;
24
+ sentence: string;
25
+ };
26
+ /** The Style targets the applied run drew nothing for (the run result's `emptyTargets`): the Style page draws
27
+ * their lines dimmed with the reason (WrunLayoutPanel). A republish that built no result (a landed pan page)
28
+ * carries the last one's forward. Absent when every judged target drew. */
29
+ emptyTargets?: string[];
19
30
  }
@@ -11,47 +11,83 @@ export interface WrunLegCloseLeg {
11
11
  legMs: number;
12
12
  market?: {
13
13
  exchange?: string;
14
+ symbol?: string;
14
15
  } | undefined;
15
16
  }
17
+ /** The chart a row or a session read takes: its symbol and its raw `sessionType` (the chart metadata's, never the
18
+ * stated `wrunChartSessionType`: an unset session is the full session on a future). */
19
+ export interface WrunChartRthSession {
20
+ symbol?: unknown;
21
+ sessionType?: unknown;
22
+ }
16
23
  /** The session the chart fetches a US listing's candles on, as the shared host's session calendar
17
24
  * reads it: 'extended' only while the chart runs its extended session (`isEquityExtendedSession`,
18
25
  * the fetch's own decider), else 'regular', an unset session included (the browser never leaves it
19
26
  * unstated; the package reads an unstated session as open plus the span). */
20
27
  export declare function wrunChartSessionType(sessionType: unknown): 'regular' | 'extended';
21
- /** The chart's session as the row builder reads it (`WrunChartSourceRows.session`): the chart's
22
- * exchange and the session word of its `sessionType`. */
23
- export declare function wrunChartSession(exchange: string | undefined, sessionType: unknown): WrunChartSession;
28
+ /** The chart a session read takes beside its persisted `sessionType`: its symbol and its interval (the chart's
29
+ * interval label or milliseconds), with which the session the chart rides is read (`wrunChartSession`). */
30
+ export interface WrunSessionChart {
31
+ symbol?: unknown;
32
+ interval?: unknown;
33
+ }
34
+ /** The chart's session as the row builder reads it (`WrunChartSourceRows.session`): the chart's exchange, its
35
+ * symbol (`chart`, when the caller has it) and the session the chart rides. On a market with an RTH window (a
36
+ * future, found by the symbol) that is the effective word at the chart's interval (`effectiveChartSessionType`):
37
+ * 'regular' only while the chart rides RTH there, an unset word the full session, so the shared host's session
38
+ * calendar reads RTH rows and RTH legs only on a chart that rides RTH. Such a chart still fetches a pinned US
39
+ * listing on its persisted word (`kOhlcvSessionPayloadFields` reads it for a Polygon source: unset or 'regular'
40
+ * is the listing's regular hours), so where the two words differ the session carries that one too
41
+ * (`listingSessionType`, `wrunChartSessionType`). Every other market, and a call without a symbol, keeps
42
+ * `wrunChartSessionType`: on a stock the word is the extended-hours flag. */
43
+ export declare function wrunChartSession(exchange: string | undefined, sessionType: unknown, chart?: WrunSessionChart): WrunChartSession;
24
44
  /** Whether the gateway builds this leg's bars on the CME session lattice. */
25
45
  export declare function wrunLegRidesCmeSession(leg: WrunLegCloseLeg, chartExchange: string | undefined): boolean;
46
+ /** Whether a leg's bars ride the chart's RTH grid (the module doc), read on the session the chart rides at
47
+ * `chartInterval` (the chart's interval label or milliseconds; absent, the leg's own interval stands for it): its
48
+ * pinned-close timer reads the RTH bars, never the lattice's or the plain grid's. */
49
+ export declare function wrunLegRidesRth(leg: WrunLegCloseLeg, chartExchange: string | undefined, sessionType?: unknown, chartSymbol?: unknown, chartInterval?: unknown): boolean;
26
50
  /** How long after a close the leg's venue holds the whole candle (the module doc): a US listing's
27
51
  * `WRUN_US_EQUITIES_CLOSE_SETTLE_MS` where its candles close with the session, 0 for every other
28
52
  * leg (its live feed seals a candle at its close). */
29
53
  export declare function wrunLegCloseSettleMs(leg: WrunLegCloseLeg, chartExchange: string | undefined, sessionType?: unknown): number;
30
- /** The leg's candle closes for the leg core (`closeMs`): the CME session lattice's, else a US
31
- * listing's session closes on a regular-session chart (the chart's `sessionType`); undefined where
32
- * they are open plus the span. */
33
- export declare function wrunLegCandleClose(leg: WrunLegCloseLeg, chartExchange: string | undefined, sessionType?: unknown): WrunLegCandleClose | undefined;
54
+ /** The leg's candle closes for the leg core (`closeMs`): on a leg riding the chart's RTH grid (`chart`, its symbol
55
+ * and interval: the session the chart rides, `wrunChartSession`, the module doc) a candle stamped at an RTH bar's
56
+ * open closes at that bar's end, the session's stub at the session close (a 4h candle opening 17:30Z closes 20:15Z,
57
+ * an hourly one opening 19:30Z at 20:15Z); every other stamp, and every other leg, the CME session lattice's,
58
+ * else a US listing's session closes on a regular-session chart (the chart's `sessionType`); undefined where they
59
+ * are open plus the span. */
60
+ export declare function wrunLegCandleClose(leg: WrunLegCloseLeg, chartExchange: string | undefined, sessionType?: unknown, chart?: WrunSessionChart): WrunLegCandleClose | undefined;
34
61
  /** The leg's candle opens for the leg core (`candleOpenMs`), undefined where a candle trades from
35
62
  * its stamp: a CME daily, 3d or weekly candle stamped at its trade date trades from the session
36
- * open before it. */
63
+ * open before it. Every intraday candle, an RTH leg's among them, trades from its stamp. */
37
64
  export declare function wrunLegCandleOpen(leg: WrunLegCloseLeg, chartExchange: string | undefined): WrunLegCandleOpen | undefined;
38
65
  /** The chart's primary row bounds for the leg core (`rowBounds`), undefined where a row spans
39
66
  * [label, label + P): a calendar row (1M 3M 6M 1Y, any market) runs from its label to its calendar
40
- * end (`wrunCalendarRowBounds`); a row of a market the gateway builds on the CME session lattice,
41
- * at a lattice interval, runs from its session open to its bar end (a daily row labelled Sep 30
42
- * runs from Sep 29 22:00Z to Sep 30 22:00Z under daylight time; the Tuesday after Labor Day from
43
- * the Sunday open). A label the lattice does not book keeps [label, label + P). The row builder
44
- * reads the same answer through `wrunSessionClock`. */
45
- export declare function wrunPrimaryRowBounds(chartExchange: string | undefined, intervalMs: number): WrunLegRowBounds | undefined;
67
+ * end (`wrunCalendarRowBounds`); a row of a chart riding RTH (`chart`: its symbol and raw session)
68
+ * runs from its RTH bar's open to that bar's end, the session's stub to the session close (a 6h row
69
+ * opening 19:30Z ends 20:15Z, not 01:30Z; a 15m row opening 13:30Z ends 13:45Z); a row of a market
70
+ * the gateway builds on the CME session lattice, at a lattice interval, runs from its session open
71
+ * to its bar end (a daily row labelled Sep 30 runs from Sep 29 22:00Z to Sep 30 22:00Z under
72
+ * daylight time; the Tuesday after Labor Day from the Sunday open). A label neither grid books keeps
73
+ * [label, label + P). The row builder reads the same answer through `wrunSessionClock`. */
74
+ export declare function wrunPrimaryRowBounds(chartExchange: string | undefined, intervalMs: number, chart?: WrunChartRthSession): WrunLegRowBounds | undefined;
46
75
  /** The label of the primary row holding `instantMs` where a calendar labels the rows: its calendar
47
- * bar on a calendar chart (March 10 is the March 1 row), the row whose session holds it on the CME
48
- * session lattice; undefined elsewhere, where the caller keeps its own grid. */
49
- export declare function wrunPrimaryRowHoldingMs(chartExchange: string | undefined, intervalMs: number, instantMs: number): number | undefined;
76
+ * bar on a calendar chart (March 10 is the March 1 row), the RTH bar holding it on a chart riding
77
+ * RTH (`chart`; 14:10Z is the 13:30Z hourly row, never the 14:00Z UTC hour), the row whose session
78
+ * holds it on the CME session lattice; undefined elsewhere and off an RTH session, where the caller
79
+ * keeps its own grid. */
80
+ export declare function wrunPrimaryRowHoldingMs(chartExchange: string | undefined, intervalMs: number, instantMs: number, chart?: WrunChartRthSession): number | undefined;
50
81
  /** The close of the leg's bar holding `nowMs` where its venue closes bars off the plain grid,
51
82
  * undefined elsewhere or once that bar has closed (the caller keeps its own grid, a wake no later
52
- * than the next close): on the CME session lattice the lattice bar's end; on a US listing on a
53
- * regular-session chart (the chart's `sessionType`) the stock's close (`wrunLegCandleClose`) of
54
- * the candle the chart's live boundary rule keys now to (`liveBucketStartMs`: the trade date for a
55
- * day, the Monday for a week, the 09:30 New York lattice from 45m to 12h), and off the session on
56
- * that lattice the first candle of the next session. */
57
- export declare function wrunLegBarCloseAt(leg: WrunLegCloseLeg, chartExchange: string | undefined, nowMs: number, sessionType?: unknown): number | undefined;
83
+ * than the next close): on a leg riding the chart's RTH grid (the session the chart rides, read on
84
+ * its `sessionType`, `chartSymbol` and `chartInterval` as `wrunLegRidesRth` reads them: a daily
85
+ * chart that keeps 'regular' rides the full session, so its intraday legs keep their own closes;
86
+ * the module doc) the RTH bar's end (a 4h leg at 15:00Z closes 17:30Z, at 18:00Z
87
+ * the stub's 20:15Z; an hourly leg at 14:10Z closes 14:30Z), and off the session the end of the
88
+ * next session's first bar; on the CME session lattice the lattice bar's end; on a US listing on a
89
+ * regular-session chart the stock's close (`wrunLegCandleClose`) of the candle the chart's live
90
+ * boundary rule keys now to (`liveBucketStartMs`: the trade date for a day, the Monday for a week,
91
+ * the 09:30 New York lattice from 45m to 12h), and off the session on that lattice the first candle
92
+ * of the next session. */
93
+ export declare function wrunLegBarCloseAt(leg: WrunLegCloseLeg, chartExchange: string | undefined, nowMs: number, sessionType?: unknown, chartSymbol?: unknown, chartInterval?: unknown): number | undefined;