@orangecharts/wrun-chart-host 0.9.0 → 0.10.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 (170) hide show
  1. package/README.md +1 -0
  2. package/dist/constants/feature-flags.constants.d.ts +6 -1
  3. package/dist/constants/feature-flags.constants.js +67 -24
  4. package/dist/constants/opra-compliance.constants.d.ts +3 -2
  5. package/dist/constants/opra-compliance.constants.js +3 -2
  6. package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +26 -0
  7. package/dist/constants/scriptEditor/builtin-script-snippets.js +6 -0
  8. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.d.ts +15 -0
  9. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.js +17 -0
  10. package/dist/constants/venue-presets.constants.d.ts +20 -20
  11. package/dist/constants/venue-presets.constants.js +24 -26
  12. package/dist/host-env.d.ts +29 -5
  13. package/dist/host-env.js +6 -0
  14. package/dist/host-ports.types.d.ts +69 -15
  15. package/dist/index.d.ts +13 -0
  16. package/dist/index.js +13 -0
  17. package/dist/interfaces/kscript-diagnostics.interface.d.ts +6 -0
  18. package/dist/interfaces/replay.interface.d.ts +8 -0
  19. package/dist/interfaces/wrun-runtime.interface.d.ts +18 -2
  20. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +41 -4
  21. package/dist/kscript-data/controls/live-trades-merge.util.js +52 -7
  22. package/dist/kscript-data/controls/live-trades-order-gate.util.d.ts +56 -0
  23. package/dist/kscript-data/controls/live-trades-order-gate.util.js +107 -0
  24. package/dist/market-data/billing.interface.d.ts +95 -31
  25. package/dist/market-data/billing.interface.js +36 -5
  26. package/dist/market-data/venue.d.ts +88 -6
  27. package/dist/market-data/venues/cme.contract.copy.json +66 -0
  28. package/dist/market-data/venues/cme.d.ts +126 -0
  29. package/dist/market-data/venues/cme.js +133 -0
  30. package/dist/market-data/venues/index.d.ts +162 -5
  31. package/dist/market-data/venues/index.js +48 -6
  32. package/dist/settings-templates/index.js +7 -3
  33. package/dist/settings-templates/indicator-fields.d.ts +5 -4
  34. package/dist/settings-templates/indicator-fields.js +45 -6
  35. package/dist/settings-templates/tool-rules.d.ts +27 -17
  36. package/dist/settings-templates/tool-rules.js +27 -11
  37. package/dist/settings-templates/tool-tables.generated.js +91 -31
  38. package/dist/utility/chart/book-live-bucket.util.d.ts +15 -0
  39. package/dist/utility/chart/book-live-bucket.util.js +47 -0
  40. package/dist/utility/chart/index-mode-admission.util.js +15 -2
  41. package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +35 -11
  42. package/dist/utility/chart/kscript-drawing-safe-area.util.js +145 -35
  43. package/dist/utility/chart/kscript-live-coalesce.util.d.ts +7 -2
  44. package/dist/utility/chart/kscript-live-coalesce.util.js +9 -3
  45. package/dist/utility/chart/kscript-provenance-keys.util.js +6 -0
  46. package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +3 -1
  47. package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +32 -2
  48. package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +45 -0
  49. package/dist/utility/chart/kscript-venue-policy.util.d.ts +54 -35
  50. package/dist/utility/chart/kscript-venue-policy.util.js +78 -42
  51. package/dist/utility/chart/market-session-schedule.util.d.ts +10 -0
  52. package/dist/utility/chart/market-session-schedule.util.js +16 -0
  53. package/dist/utility/chart/opra-read-access.leaf.d.ts +5 -3
  54. package/dist/utility/chart/opra-read-access.leaf.js +5 -3
  55. package/dist/utility/chart/rth-session.util.d.ts +3 -2
  56. package/dist/utility/chart/rth-session.util.js +2 -1
  57. package/dist/utility/chart/window-geometry.leaf.d.ts +8 -0
  58. package/dist/utility/chart/window-geometry.leaf.js +22 -6
  59. package/dist/utility/chart/wrun-run-result.util.d.ts +12 -0
  60. package/dist/utility/chart/wrun-run-result.util.js +141 -6
  61. package/dist/utility/options/option-bar-anchor.util.d.ts +145 -0
  62. package/dist/utility/options/option-bar-anchor.util.js +340 -0
  63. package/dist/utility/options/option-venue.util.d.ts +18 -0
  64. package/dist/utility/options/option-venue.util.js +27 -0
  65. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +2 -0
  66. package/dist/utility/wrun/derived-roots.util.d.ts +213 -0
  67. package/dist/utility/wrun/derived-roots.util.js +471 -0
  68. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +41 -6
  69. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.js +89 -19
  70. package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.d.ts +9 -4
  71. package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.js +47 -6
  72. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -2
  73. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -2
  74. package/dist/utility/wrun/sources/lanes/option_daily.js +5 -2
  75. package/dist/utility/wrun/sources/lanes/options_flow.js +5 -2
  76. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +64 -19
  77. package/dist/utility/wrun/sources/opra-option-lanes.util.js +105 -35
  78. package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +2 -1
  79. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +2 -1
  80. package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +3 -0
  81. package/dist/utility/wrun/sources/row-lanes/option_prints.js +19 -4
  82. package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +17 -4
  83. package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +52 -13
  84. package/dist/utility/wrun/sources/row-lanes/option_strikes.js +88 -19
  85. package/dist/utility/wrun/sources/row-lanes/option_surface.js +2 -1
  86. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -0
  87. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +24 -9
  88. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +39 -10
  89. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.d.ts +64 -0
  90. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.js +89 -0
  91. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +15 -3
  92. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +22 -3
  93. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +31 -0
  94. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +174 -13
  95. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +685 -27
  96. package/dist/utility/wrun/wrun-builtin-twin.util.d.ts +12 -0
  97. package/dist/utility/wrun/wrun-builtin-twin.util.js +21 -0
  98. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +53 -12
  99. package/dist/utility/wrun/wrun-chart-market-facts.util.js +101 -53
  100. package/dist/utility/wrun/wrun-download-meter.util.d.ts +15 -0
  101. package/dist/utility/wrun/wrun-download-meter.util.js +14 -2
  102. package/dist/utility/wrun/wrun-download-plan.util.d.ts +99 -0
  103. package/dist/utility/wrun/wrun-download-plan.util.js +118 -0
  104. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +11 -3
  105. package/dist/utility/wrun/wrun-draft-legend-note.util.js +26 -4
  106. package/dist/utility/wrun/wrun-frames.d.ts +27 -6
  107. package/dist/utility/wrun/wrun-frames.js +73 -10
  108. package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +7 -1
  109. package/dist/utility/wrun/wrun-hosted-wire.util.js +12 -2
  110. package/dist/utility/wrun/wrun-hud-looks.util.d.ts +18 -4
  111. package/dist/utility/wrun/wrun-hud-looks.util.js +45 -13
  112. package/dist/utility/wrun/wrun-latest-snapshot.d.ts +11 -0
  113. package/dist/utility/wrun/wrun-live-intake.util.d.ts +13 -7
  114. package/dist/utility/wrun/wrun-live-intake.util.js +82 -29
  115. package/dist/utility/wrun/wrun-live-tick.util.d.ts +4 -0
  116. package/dist/utility/wrun/wrun-live-tick.util.js +158 -14
  117. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +49 -10
  118. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +65 -5
  119. package/dist/utility/wrun/wrun-market-size-defaults.util.js +31 -5
  120. package/dist/utility/wrun/wrun-opra-lane.util.d.ts +17 -4
  121. package/dist/utility/wrun/wrun-opra-lane.util.js +6 -4
  122. package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.d.ts +31 -0
  123. package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.js +119 -0
  124. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +23 -6
  125. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +47 -11
  126. package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +86 -19
  127. package/dist/utility/wrun/wrun-option-strike-flow.util.js +168 -62
  128. package/dist/utility/wrun/wrun-option-views.util.d.ts +47 -13
  129. package/dist/utility/wrun/wrun-option-views.util.js +98 -26
  130. package/dist/utility/wrun/wrun-output-style.util.d.ts +6 -2
  131. package/dist/utility/wrun/wrun-output-style.util.js +20 -2
  132. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +17 -0
  133. package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +10 -1
  134. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +52 -4
  135. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +100 -31
  136. package/dist/utility/wrun/wrun-overlay-run.util.js +733 -114
  137. package/dist/utility/wrun/wrun-pane-format.util.d.ts +2 -1
  138. package/dist/utility/wrun/wrun-pane-format.util.js +7 -3
  139. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +9 -0
  140. package/dist/utility/wrun/wrun-panel-mount.util.js +63 -13
  141. package/dist/utility/wrun/wrun-panel-style.util.d.ts +10 -9
  142. package/dist/utility/wrun/wrun-panel-style.util.js +58 -9
  143. package/dist/utility/wrun/wrun-param-map.util.d.ts +14 -11
  144. package/dist/utility/wrun/wrun-param-map.util.js +10 -5
  145. package/dist/utility/wrun/wrun-param-values.util.d.ts +14 -4
  146. package/dist/utility/wrun/wrun-param-values.util.js +4 -0
  147. package/dist/utility/wrun/wrun-pin-spelling.util.js +12 -11
  148. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +50 -0
  149. package/dist/utility/wrun/wrun-refusal-surface.util.js +68 -0
  150. package/dist/utility/wrun/wrun-refused-latest.util.d.ts +10 -0
  151. package/dist/utility/wrun/wrun-refused-latest.util.js +12 -0
  152. package/dist/utility/wrun/wrun-row-source.d.ts +11 -0
  153. package/dist/utility/wrun/wrun-run-interval.util.d.ts +4 -2
  154. package/dist/utility/wrun/wrun-run-interval.util.js +9 -6
  155. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +45 -1
  156. package/dist/utility/wrun/wrun-script-inputs.util.js +112 -4
  157. package/dist/utility/wrun/wrun-setting-words.util.d.ts +7 -3
  158. package/dist/utility/wrun/wrun-setting-words.util.js +13 -5
  159. package/dist/utility/wrun/wrun-socket-row-source.d.ts +27 -2
  160. package/dist/utility/wrun/wrun-socket-row-source.js +113 -8
  161. package/dist/utility/wrun/wrun-source-rows.util.d.ts +5 -1
  162. package/dist/utility/wrun/wrun-source-rows.util.js +16 -3
  163. package/dist/utility/wrun/wrun-style-words.util.js +6 -4
  164. package/dist/utility/wrun/wrun-table-chrome.util.d.ts +3 -2
  165. package/dist/utility/wrun/wrun-table-chrome.util.js +19 -11
  166. package/dist/utility/wrun/wrun-tape-per-order.util.d.ts +2 -0
  167. package/dist/utility/wrun/wrun-tape-per-order.util.js +26 -0
  168. package/dist/utils/replay/replay-buffer-math.d.ts +53 -2
  169. package/dist/utils/replay/replay-buffer-math.js +227 -20
  170. package/package.json +11 -11
@@ -132,7 +132,8 @@ export declare function hasWrunValueFormatOptions(options: WrunValueFormatOption
132
132
  /** One value through one declared format word: `price` at the chart's price
133
133
  * precision (`priceDigits`, the default decimals when the caller has no
134
134
  * chart), `%` as a percent with two decimals (the value already IS a
135
- * percent), `si` as K/M/B from 1K (the lower-pane axis rule), `int` and
135
+ * percent), `si` as K/M/B from 1K (the lower-pane axis rule) and below it
136
+ * at most two decimals, trailing zeros dropped ("4", "4.5"), `int` and
136
137
  * the fixed-point words at their decimals. No word: the app's own
137
138
  * partial formatter (two decimals, K/M/B from 1M). A hole reads '-'.
138
139
  * `usd`, `auto` and any word beside a companion (`decimals`, `signed`,
@@ -172,7 +172,8 @@ export function hasWrunValueFormatOptions(options) {
172
172
  /** One value through one declared format word: `price` at the chart's price
173
173
  * precision (`priceDigits`, the default decimals when the caller has no
174
174
  * chart), `%` as a percent with two decimals (the value already IS a
175
- * percent), `si` as K/M/B from 1K (the lower-pane axis rule), `int` and
175
+ * percent), `si` as K/M/B from 1K (the lower-pane axis rule) and below it
176
+ * at most two decimals, trailing zeros dropped ("4", "4.5"), `int` and
176
177
  * the fixed-point words at their decimals. No word: the app's own
177
178
  * partial formatter (two decimals, K/M/B from 1M). A hole reads '-'.
178
179
  * `usd`, `auto` and any word beside a companion (`decimals`, `signed`,
@@ -202,8 +203,11 @@ function wrunValueText(value, format, placement, options) {
202
203
  }
203
204
  case '%':
204
205
  return `${value.toFixed(2)}%`;
205
- case 'si':
206
- return formatWrunPaneNumber(value, WRUN_DEFAULT_VALUE_DIGITS);
206
+ case 'si': {
207
+ // The trim is si's own: the pane axis prints through formatWrunPaneNumber at its step digits.
208
+ const text = formatWrunPaneNumber(value, WRUN_DEFAULT_VALUE_DIGITS);
209
+ return Math.abs(value) < WRUN_PANE_COMPACT_FROM ? text.replace(/\.?0+$/, '') : text;
210
+ }
207
211
  default: {
208
212
  const digits = format === undefined ? undefined : WRUN_FIXED_DIGITS[format];
209
213
  if (digits !== undefined)
@@ -1,5 +1,6 @@
1
1
  import { type KScriptLegendEntry } from '../chart/kscript-legend-entries.util.js';
2
2
  import { type EnginePanelHooks } from '../chart/om-panel.util.js';
3
+ import { WRUN_WINDOW_TABLES_ONLY_SETTING } from '../chart/window-geometry.leaf.js';
3
4
  import { wrunSeriesChildId, type WrunRunResult } from '../chart/wrun-run-result.util.js';
4
5
  import { type WrunBuiltinTwin, type WrunPaneFormatChart } from './wrun-pane-format.util.js';
5
6
  import type { WrunRunIntervalProjection } from './wrun-run-interval-projection.types.js';
@@ -283,6 +284,14 @@ export declare function prepareWrunHeatmapWindowLanding(input: {
283
284
  }): Promise<PreparedWrunWindowLanding>;
284
285
  /** The window landing of any row-backed canvas child (a heatmap or a batched child), the generalized name. */
285
286
  export declare const prepareWrunChildWindowLanding: typeof prepareWrunHeatmapWindowLanding;
287
+ /**
288
+ * The owner setting of a window that shows its tables ALONE (window-geometry.leaf defines it; web's window-cell.util
289
+ * writes the same key: the window an add opens beside its chart Indicator, which keeps every other child under the
290
+ * candles of its own cell). Its mount mounts the `panel.table` children and no other child (mountsOnCell), so the
291
+ * window never shows a lower pane, another panel or a canvas the chart cell beside it already shows. Read off the
292
+ * parent's engine settings, like the owner flag; it means nothing on a cell that is no window.
293
+ */
294
+ export { WRUN_WINDOW_TABLES_ONLY_SETTING };
286
295
  /** Mount a run snapshot after every required pack has settled.
287
296
  * The parent remains the canonical numeric-output container. A panel child
288
297
  * the run still declares in the same pane takes the new rows in place; one
@@ -49,7 +49,7 @@ import { isDateLabelledBarInterval } from '../chart/date-labelled-interval.leaf.
49
49
  import { KSCRIPT_LEGEND_VALUE_INK, kScriptLegendEntries, kScriptLegendLineFormat, kScriptLegendLineFormatOptions, kScriptLegendLines, kScriptLegendLineSwatchAt, kScriptLegendLineValueAt, kScriptLegendSlotCells, padKScriptLegendSlots, } from '../chart/kscript-legend-entries.util.js';
50
50
  import { panelGridHeight, refreshPanelOverlayInPlace, samePanelPane, translatePanelToEngine, withoutEmptyTableColumns, } from '../chart/om-panel.util.js';
51
51
  import { isWrunWindowOwner } from '../chart/window-owner.leaf.js';
52
- import { ownerPaneDrawsNothing, planWindowWeights, reconcileWindowOwnerGeometry, savedWindowSplit, tableRowCountOf, } from '../chart/window-geometry.leaf.js';
52
+ import { ownerPaneDrawsNothing, planWindowWeights, reconcileWindowOwnerGeometry, savedWindowSplit, tableRowCountOf, WRUN_WINDOW_TABLES_ONLY_SETTING, } from '../chart/window-geometry.leaf.js';
53
53
  import { wrunLegendName } from '../chart/wrun-legend-name.util.js';
54
54
  import { wrunResultLegendColors, wrunSeriesChildId, } from '../chart/wrun-run-result.util.js';
55
55
  import { budgetWrunBatchedRetained, budgetWrunBatchedRows, commitWrunBatchedPlan, currentWrunBatchedPlan, forgetWrunBatchedCells, isWrunBatchedMarksKind, noteWrunBatchedRowsCut, planWrunBatchedMerged, restoreWrunBatchedLedger, snapshotWrunBatchedLedger, wrunBatchedChargeOf, wrunBatchedChildConfig, wrunBatchedChildrenOverShare, wrunBatchedSiblingsToRebalance, } from './wrun-batched-marks.util.js';
@@ -299,7 +299,10 @@ function userThemeMode() {
299
299
  * window of the layout shows it (the children filter, mountsOnCell), so it
300
300
  * never sits under the candles while its window shows it and never mounts
301
301
  * nowhere; its all-empty columns leave before the translation builds the
302
- * payload and the formatter (withoutEmptyTableColumns, C4). */
302
+ * payload and the formatter (withoutEmptyTableColumns, C4). A pane whose
303
+ * frame carries no rows says why in its caption: the owner's headline (the
304
+ * card headline the run selected, ctx.headline) stands in for the frame's
305
+ * caption, so an empty pane is never a blank box under a title. */
303
306
  function panelChildConfig(child, ctx) {
304
307
  const translateContext = {
305
308
  theme: ctx.theme,
@@ -309,7 +312,8 @@ function panelChildConfig(child, ctx) {
309
312
  const frame = withoutEmptyTableColumns(child.frame);
310
313
  const translated = translatePanelToEngine(frame, translateContext);
311
314
  const { panel, rows, chrome } = frame;
312
- const caption = chrome?.caption;
315
+ // An empty frame's words: the owner's headline (why there is nothing yet), else the frame's own caption.
316
+ const caption = (rows.length === 0 ? ctx.headline : undefined) ?? chrome?.caption;
313
317
  const id = `${ctx.overlayId}::panel:${child.name}`;
314
318
  // A table owns no value axis and a rich line (every chrome but box: the
315
319
  // numeric curve, or grid / none on a time, category or stacked line) draws
@@ -765,7 +769,10 @@ function windowPanesOfMount(parent, overlayId, children, kept) {
765
769
  panes.push({ id: config.id, kind: 'chart' });
766
770
  }
767
771
  const ownerPane = parent.type === 'offchart' && parent.isPaneHidden !== true;
768
- if (ownerPane && (panes.length === 0 || !ownerPaneDrawsNothing(parent))) {
772
+ // A window that shows its tables alone leaves the owner's own pane to the chart beside it (the geometry hides it
773
+ // there too, window-geometry.leaf settleOwnerPane), unless it would be the window's only pane.
774
+ const tablesOnly = parent.settings?.[WRUN_WINDOW_TABLES_ONLY_SETTING] === true;
775
+ if (ownerPane && (panes.length === 0 || (!tablesOnly && !ownerPaneDrawsNothing(parent)))) {
769
776
  panes.unshift({ id: overlayId, kind: 'time' });
770
777
  }
771
778
  return panes;
@@ -1612,17 +1619,52 @@ function ownerTimePaneId(parent, overlayId, children) {
1612
1619
  /**
1613
1620
  * Whether a run's child mounts on this cell. The class it closes: a table that mounts nowhere, or under the candles
1614
1621
  * while its window shows it (Kyle 2026-10-21: a table never sits under the candles WHILE its window shows it, which
1615
- * never lets a table vanish). A window cell mounts every child. A normal cell mounts every child but the `panel.table`
1616
- * children (any `place`) of an Indicator whose tables a window cell of the layout shows: the host shows windows (the
1617
- * env's `windows`, C1) and its `tablesShownInWindow` answers true for this chart and Indicator (R1;
1622
+ * never lets a table vanish). A window cell mounts every child, except a window that shows its tables alone
1623
+ * (`tablesOnly`, WRUN_WINDOW_TABLES_ONLY_SETTING: the window an add opened beside its chart Indicator), which mounts
1624
+ * the `panel.table` children and nothing else: every other child is on the chart cell beside it, and a second copy
1625
+ * showed the same pane twice (QA 2026-10-22, Volatility Character). A normal cell mounts every child but the
1626
+ * `panel.table` children (any `place`) of an Indicator whose tables a window cell of the layout shows: the host shows
1627
+ * windows (the env's `windows`, C1) and its `tablesShownInWindow` answers true for this chart and Indicator (R1;
1618
1628
  * `leavesTablesToWindow`, asked here only, and only for a table). An Indicator with no window, or one that cannot get
1619
1629
  * one (replay, a full layout, a slot budget that refuses the window copy, an editor draft, a layout saved before
1620
1630
  * windows), keeps its tables on the cell, as does every Indicator on a host without windows (the phone). A table an
1621
1631
  * earlier pass mounted that the rule now leaves out goes with the children a run no longer declares; one it left out
1622
1632
  * mounts again on the next run that carries frames once no window shows it.
1623
1633
  */
1624
- function mountsOnCell(child, windowCell, leavesTablesToWindow) {
1625
- return windowCell || child.kind !== 'panel' || child.frame.panel.kind !== 'table' || !leavesTablesToWindow();
1634
+ function mountsOnCell(child, windowCell, tablesOnly, leavesTablesToWindow) {
1635
+ const table = child.kind === 'panel' && child.frame.panel.kind === 'table';
1636
+ if (windowCell)
1637
+ return !tablesOnly || table;
1638
+ return !table || !leavesTablesToWindow();
1639
+ }
1640
+ /**
1641
+ * The owner setting of a window that shows its tables ALONE (window-geometry.leaf defines it; web's window-cell.util
1642
+ * writes the same key: the window an add opens beside its chart Indicator, which keeps every other child under the
1643
+ * candles of its own cell). Its mount mounts the `panel.table` children and no other child (mountsOnCell), so the
1644
+ * window never shows a lower pane, another panel or a canvas the chart cell beside it already shows. Read off the
1645
+ * parent's engine settings, like the owner flag; it means nothing on a cell that is no window.
1646
+ */
1647
+ export { WRUN_WINDOW_TABLES_ONLY_SETTING };
1648
+ /**
1649
+ * The owner's headline, the words an empty panel pane shows as its caption (panelChildConfig), so the pane says why
1650
+ * it is empty: the run's HUD headline first (WrunRunResult.headline, the card tile declared `headline: true` read on
1651
+ * the run's last ready row: Volatility Character's character word), else the text the run selected for a card
1652
+ * drawing's headline band (DW01: a declared output's formatted value or a string slot the recipe writes), the first
1653
+ * card that has one, trimmed. The HUD headline rides the result because the latest-values snapshot that feeds the
1654
+ * card is published after this mount. Undefined when the run carries neither.
1655
+ */
1656
+ function ownerHeadlineOf(runResult) {
1657
+ const hud = runResult.headline?.trim();
1658
+ if (hud)
1659
+ return hud;
1660
+ for (const drawing of runResult.drawings ?? []) {
1661
+ if (drawing?.kind !== 'card')
1662
+ continue;
1663
+ const text = drawing.props?.headline?.text;
1664
+ if (typeof text === 'string' && text.trim() !== '')
1665
+ return text.trim();
1666
+ }
1667
+ return undefined;
1626
1668
  }
1627
1669
  /** The run's children in mount order (C6): the panels first, then today's
1628
1670
  * order (series, levels, canvases, insets), each group as the run listed
@@ -1643,7 +1685,7 @@ function heatmapSensitivityOf(previews, parent, name) {
1643
1685
  * pane from the run's (or the mounted) children; each heatmap's Sensitivity
1644
1686
  * (a held drag value, else the parent's saved row) read when its config is
1645
1687
  * built; the Indicator's kept label formatters. */
1646
- function mountContext(tc, overlayId, parent, children, priceDigits, chartHeightPx, windowCell, planned, previews, formatters) {
1688
+ function mountContext(tc, overlayId, parent, children, priceDigits, chartHeightPx, windowCell, planned, previews, formatters, headline) {
1647
1689
  return {
1648
1690
  tc,
1649
1691
  overlayId,
@@ -1660,6 +1702,7 @@ function mountContext(tc, overlayId, parent, children, priceDigits, chartHeightP
1660
1702
  anchorPaneId: ownerTimePaneId(parent, overlayId, children),
1661
1703
  heatmapSensitivity: (name) => heatmapSensitivityOf(previews(), parent, name),
1662
1704
  formatters,
1705
+ headline,
1663
1706
  };
1664
1707
  }
1665
1708
  /** Mount a run snapshot after every required pack has settled.
@@ -1708,9 +1751,12 @@ export function mountWrunChildOverlays({ tc, overlayId, runResult, replaceFrames
1708
1751
  // a child the run dropped; one left out before mounts again on the first
1709
1752
  // pass that carries frames and finds no window showing it.
1710
1753
  const windowCell = cell?.window ?? isWrunWindowOwner(parent);
1754
+ // A window an add opened beside its chart Indicator shows the tables alone (the chart cell keeps the rest).
1755
+ const tablesOnly = windowCell && parent.settings?.[WRUN_WINDOW_TABLES_ONLY_SETTING] === true;
1711
1756
  let leavesTables;
1712
1757
  const leavesTablesToWindow = () => (leavesTables ??= wrunHostLeavesTablesToWindow(chartIndex, overlayId));
1713
- const children = (runResult.childOverlays ?? []).filter((child) => (replaceFrames || ROW_BACKED_KINDS.has(child.kind)) && mountsOnCell(child, windowCell, leavesTablesToWindow));
1758
+ const children = (runResult.childOverlays ?? []).filter((child) => (replaceFrames || ROW_BACKED_KINDS.has(child.kind)) &&
1759
+ mountsOnCell(child, windowCell, tablesOnly, leavesTablesToWindow));
1714
1760
  if (!state && children.length === 0)
1715
1761
  return Promise.resolve(true);
1716
1762
  if (!replaceFrames &&
@@ -1764,7 +1810,11 @@ export function mountWrunChildOverlays({ tc, overlayId, runResult, replaceFrames
1764
1810
  }
1765
1811
  current.windowCell = windowCell;
1766
1812
  current.planned = planned;
1767
- const ctx = mountContext(tc, overlayId, parent, children, priceDigits, current.chartHeightPx, windowCell, planned, () => current.previews, current.formatters);
1813
+ // The words an empty panel pane shows: re-read on every pass that carries frames (a tick carries no drawings and
1814
+ // keeps the last run's).
1815
+ if (replaceFrames)
1816
+ current.headline = ownerHeadlineOf(runResult);
1817
+ const ctx = mountContext(tc, overlayId, parent, children, priceDigits, current.chartHeightPx, windowCell, planned, () => current.previews, current.formatters, current.headline);
1768
1818
  // Panels mount ahead of the Indicator's time panes (C6), so a first mount
1769
1819
  // stacks them above the lower pane by order alone; the anchor keeps a
1770
1820
  // later or re-carved panel there.
@@ -2220,7 +2270,7 @@ export function retranslateWrunChildOverlays(tc) {
2220
2270
  continue;
2221
2271
  const owner = {
2222
2272
  state,
2223
- ctx: mountContext(tc, overlayId, parent, [...state.children.values()].map((mounted) => mounted.input), state.priceDigits, state.chartHeightPx, state.windowCell ?? false, state.planned, () => state.previews, state.formatters),
2273
+ ctx: mountContext(tc, overlayId, parent, [...state.children.values()].map((mounted) => mounted.input), state.priceDigits, state.chartHeightPx, state.windowCell ?? false, state.planned, () => state.previews, state.formatters, state.headline),
2224
2274
  };
2225
2275
  for (const [id, mounted] of state.children) {
2226
2276
  if (mounted.input.kind !== 'series')
@@ -118,18 +118,19 @@ export declare function wrunPanelBadgeInk(fill: string): string;
118
118
  * each series once beside the title (titleLegendStyle). */
119
119
  export declare function wrunPanelCommonStyle(panel: WrunStyledPanel, ctx: WrunPanelTranslateContext): WrunPanelSettingsPatch;
120
120
  /** The line words (SC03 SC04 SC24 SC25 SC29 SC30 SC39): smoothing, the
121
- * signed two-tone fill, fill fade, stroke fade, markers, dots, end labels,
122
- * glow, motion, latest-value chips and the axis words on the pane; fill,
123
- * fill ink, style, width, dash, dots, end label and legend membership per
124
- * series. `y_title` is the rich curve's caption and a box line's axis title
125
- * (the effective chrome decides, SC02). */
121
+ * signed two-tone fill, fill fade, stroke fade, markers, the frame's row
122
+ * labels (C3), dots, end labels, glow, motion, latest-value chips and the
123
+ * axis words on the pane; fill, fill ink, style, width, dash, dots, end
124
+ * label and legend membership per series. `y_title` is the rich curve's
125
+ * caption and a box line's axis title (the effective chrome decides, SC02). */
126
126
  export declare function wrunLineStyle(panel: WrunStyledPanel, chrome: WrunPanelFrameChrome | undefined, rows: WrunStyledPanelRows, ctx: WrunPanelTranslateContext): WrunLineStylePatch;
127
127
  /** The bars words (SC19 SC23 SC24 SC39, C2): sign colouring (the tones
128
128
  * come from the common words), the axis words, the bar shape, the badge
129
- * chip and legend membership per series (`series[j].legend: false` keeps
130
- * that series out of the legend chips, a `series` patch merged per index);
131
- * per-bar colours are row data the caller maps. */
132
- export declare function wrunBarsStyle(panel: WrunStyledPanel, chrome: WrunPanelFrameChrome | undefined, _rows: WrunStyledPanelRows, ctx: WrunPanelTranslateContext): WrunPanelSettingsPatch;
129
+ * chip, the frame's row labels (C3, as `xLabels`) and legend membership
130
+ * per series (`series[j].legend: false` keeps that series out of the legend
131
+ * chips, a `series` patch merged per index); per-bar colours are row data
132
+ * the caller maps. */
133
+ export declare function wrunBarsStyle(panel: WrunStyledPanel, chrome: WrunPanelFrameChrome | undefined, rows: WrunStyledPanelRows, ctx: WrunPanelTranslateContext): WrunPanelSettingsPatch;
133
134
  /** The histogram words beyond its colour, labels and bins (the caller's,
134
135
  * SC38): the chrome, the axis words of its curve bars sub-plan (SC23 SC39),
135
136
  * the bar shape and the badge chip (C2). */
@@ -276,6 +276,52 @@ function keyOrdinals(rows) {
276
276
  }
277
277
  return ordinals;
278
278
  }
279
+ /** C3: the labels a numeric-x frame carries for its rows (`x_labels`, ""
280
+ * for a row without one); undefined off a numeric x, without the word, or
281
+ * when no entry holds a label, so such a frame sends no key. */
282
+ function frameXLabels(panel, chrome) {
283
+ const labels = panel.x === 'number' ? chrome?.x_labels : undefined;
284
+ return labels?.some((label) => label !== '') === true ? labels : undefined;
285
+ }
286
+ /** A numeric line's row labels as the curve's `xValueLabels` (C3): each
287
+ * labelled row's exact x as `String(x)` (the key the engine reads back as
288
+ * `x + ""`) to its label, in row order, the first labelled row of a repeated
289
+ * x winning. The curve titles its hover card and a marker's show_value text
290
+ * with it; its axis ticks fall between the rows and print through the x
291
+ * words only. */
292
+ function lineXValueLabels(panel, chrome, rows) {
293
+ const labels = frameXLabels(panel, chrome);
294
+ if (labels === undefined)
295
+ return undefined;
296
+ const byX = new Map();
297
+ rows.forEach((row, index) => {
298
+ const label = labels[index];
299
+ const key = String(row[0]);
300
+ if (label && !byX.has(key))
301
+ byX.set(key, label);
302
+ });
303
+ return byX.size > 0 ? Object.fromEntries(byX) : undefined;
304
+ }
305
+ /** A numeric bars pane's row labels (C3). The bars engine reads no
306
+ * `xValueLabels`: it ticks each bar and titles its hover card from `xLabels`
307
+ * (one per bar in row order; `hoverLabels` falls back to it), so a labelled
308
+ * row's label replaces its key there and every other bar keeps the text
309
+ * translatePanelToEngine gives a numeric key (the x words when `x_format`
310
+ * is declared, else `String(key)`; the spec pins the two against each
311
+ * other). */
312
+ function barsXLabels(panel, chrome, rows, ctx) {
313
+ const labels = frameXLabels(panel, chrome);
314
+ if (labels === undefined)
315
+ return undefined;
316
+ const format = panel.x_format !== undefined ? wrunPanelFormatter(panel, rows, ctx) : undefined;
317
+ return rows.map((row, index) => {
318
+ const label = labels[index];
319
+ if (label)
320
+ return label;
321
+ const key = row[0];
322
+ return format !== undefined ? format(key, 'x', -1) : String(key);
323
+ });
324
+ }
279
325
  /** The axis words shared by line, bars, histogram and scatter (SC39, SC20):
280
326
  * titles, pinned ranges (frame first) and the zero rule. `y_title` is the
281
327
  * rich curve's `yCaption` and every other pane's `yTitle`; `xLabel` (the
@@ -418,11 +464,11 @@ function lineMarkers(panel, chrome, rows, ctx) {
418
464
  return markers;
419
465
  }
420
466
  /** The line words (SC03 SC04 SC24 SC25 SC29 SC30 SC39): smoothing, the
421
- * signed two-tone fill, fill fade, stroke fade, markers, dots, end labels,
422
- * glow, motion, latest-value chips and the axis words on the pane; fill,
423
- * fill ink, style, width, dash, dots, end label and legend membership per
424
- * series. `y_title` is the rich curve's caption and a box line's axis title
425
- * (the effective chrome decides, SC02). */
467
+ * signed two-tone fill, fill fade, stroke fade, markers, the frame's row
468
+ * labels (C3), dots, end labels, glow, motion, latest-value chips and the
469
+ * axis words on the pane; fill, fill ink, style, width, dash, dots, end
470
+ * label and legend membership per series. `y_title` is the rich curve's
471
+ * caption and a box line's axis title (the effective chrome decides, SC02). */
426
472
  export function wrunLineStyle(panel, chrome, rows, ctx) {
427
473
  const color = (word) => wrunPaneColor(word, ctx.theme);
428
474
  const rich = wrunPanelChrome(panel) !== 'box';
@@ -450,6 +496,7 @@ export function wrunLineStyle(panel, chrome, rows, ctx) {
450
496
  settings.strokeGradient = strokeGradient;
451
497
  }
452
498
  put(settings, 'markers', lineMarkers(panel, chrome, rows, ctx));
499
+ put(settings, 'xValueLabels', lineXValueLabels(panel, chrome, rows));
453
500
  put(settings, 'badge', panelBadge(panel, chrome, ctx));
454
501
  put(settings, 'points', panel.points);
455
502
  put(settings, 'endLabels', panel.labels);
@@ -484,10 +531,11 @@ function barShapeStyle(panel) {
484
531
  }
485
532
  /** The bars words (SC19 SC23 SC24 SC39, C2): sign colouring (the tones
486
533
  * come from the common words), the axis words, the bar shape, the badge
487
- * chip and legend membership per series (`series[j].legend: false` keeps
488
- * that series out of the legend chips, a `series` patch merged per index);
489
- * per-bar colours are row data the caller maps. */
490
- export function wrunBarsStyle(panel, chrome, _rows, ctx) {
534
+ * chip, the frame's row labels (C3, as `xLabels`) and legend membership
535
+ * per series (`series[j].legend: false` keeps that series out of the legend
536
+ * chips, a `series` patch merged per index); per-bar colours are row data
537
+ * the caller maps. */
538
+ export function wrunBarsStyle(panel, chrome, rows, ctx) {
491
539
  const patch = {
492
540
  ...chromeStylePatch(panel),
493
541
  ...axisStyle(panel, chrome, { rich: false, curve: false, xBounds: false }),
@@ -496,6 +544,7 @@ export function wrunBarsStyle(panel, chrome, _rows, ctx) {
496
544
  if (panel.color_mode === 'sign')
497
545
  patch.signedBars = true;
498
546
  put(patch, 'badge', panelBadge(panel, chrome, ctx));
547
+ put(patch, 'xLabels', barsXLabels(panel, chrome, rows, ctx));
499
548
  const series = panel.series ?? [];
500
549
  if (series.some((entry) => entry.legend === false)) {
501
550
  patch.series = series.map((entry) => (entry.legend === false ? { hideFromLegend: true } : {}));
@@ -56,8 +56,9 @@
56
56
  * (tests/workers/worker-runtime-boundary.spec.ts), which the alert identity
57
57
  * module does.
58
58
  */
59
- import type { WrunIndicatorMetadata, WrunMetadataParam, WrunParamHostFill } from '../../interfaces/wrun-runtime.interface.js';
59
+ import type { WrunIndicatorMetadata, WrunMetadataParam } from '../../interfaces/wrun-runtime.interface.js';
60
60
  import { type WrunHostFillContext } from './wrun-script-inputs.util.js';
61
+ import type { WrunHostFillWord } from './wrun-param-values.util.js';
61
62
  /** The hosted lane's param map: packed finite numbers; for a `type: "text"`
62
63
  * param (wrun-5) the chart's own run value for the setting (each host
63
64
  * applies the plain-text rule and the byte cap again on its side and
@@ -80,17 +81,18 @@ export declare function wrunHostedTextValue(param: Pick<WrunMetadataParam, 'text
80
81
  * `chart_<word>`; the extractor refuses any other param under those names), in the kit's order: the market's tick
81
82
  * size and decimals, the chart's interval seconds and five colours (the candle and grid colours since WRUN-STYLE
82
83
  * TH-candle-colors), the market's five facts (WRUN-GAPS-1005, WRUN-SESSION), the issuer's three earnings facts, the
83
- * option multiplier of the chart's options chain and the dollar multiplier of its own trades (kit 0.95.0). Every hosted
84
- * path reads it: the settings record's `hostFill` (wrunHostedHostFill), the declaration rebuild
85
- * (WRUN_HOST_FILL_BY_GENERATED_NAME) and the kScript socket worker's read of the main thread's context
86
- * (WRUN_HOST_FILL_CONTEXT_KEYS), so no hosted path drops a word another carries; wrun-param-values.util.spec holds the
87
- * table to every word the kit's browser lane fills.
84
+ * option multiplier of the chart's options chain, the dollar multiplier of its own trades (kit 0.95.0) and whether the
85
+ * chart is one option contract (om C5, a word read ahead of the kit pin: WrunHostFillWord). Every hosted path reads it:
86
+ * the settings record's `hostFill` (wrunHostedHostFill), the declaration rebuild (WRUN_HOST_FILL_BY_GENERATED_NAME)
87
+ * and the kScript socket worker's read of the main thread's context (WRUN_HOST_FILL_CONTEXT_KEYS), so no hosted path
88
+ * drops a word another carries; wrun-param-values.util.spec holds the table to every word the browser run fills, the
89
+ * kit's and those read ahead of its pin.
88
90
  */
89
- export declare const WRUN_HOST_FILL_WORDS: readonly [readonly ["tick_size", "tickSize", "market_tick_size"], readonly ["price_precision", "pricePrecision", "market_price_precision"], readonly ["interval_sec", "intervalSec", "chart_interval_sec"], readonly ["bg_color", "bgColor", "chart_bg_color"], readonly ["fg_color", "fgColor", "chart_fg_color"], readonly ["up_color", "upColor", "chart_up_color"], readonly ["down_color", "downColor", "chart_down_color"], readonly ["grid_color", "gridColor", "chart_grid_color"], readonly ["kind", "kind", "market_kind"], readonly ["point_value", "pointValue", "market_point_value"], readonly ["zone", "zone", "market_zone"], readonly ["quote_is_usd", "quoteIsUsd", "market_quote_is_usd"], readonly ["session_open", "sessionOpen", "market_session_open"], readonly ["earnings_next_ms", "earningsNextMs", "market_earnings_next_ms"], readonly ["earnings_prev_ms", "earningsPrevMs", "market_earnings_prev_ms"], readonly ["earnings_session", "earningsSession", "market_earnings_session"], readonly ["option_multiplier", "optionMultiplier", "market_option_multiplier"], readonly ["dollar_multiplier", "dollarMultiplier", "market_dollar_multiplier"]];
91
+ export declare const WRUN_HOST_FILL_WORDS: readonly [readonly ["tick_size", "tickSize", "market_tick_size"], readonly ["price_precision", "pricePrecision", "market_price_precision"], readonly ["interval_sec", "intervalSec", "chart_interval_sec"], readonly ["bg_color", "bgColor", "chart_bg_color"], readonly ["fg_color", "fgColor", "chart_fg_color"], readonly ["up_color", "upColor", "chart_up_color"], readonly ["down_color", "downColor", "chart_down_color"], readonly ["grid_color", "gridColor", "chart_grid_color"], readonly ["kind", "kind", "market_kind"], readonly ["point_value", "pointValue", "market_point_value"], readonly ["zone", "zone", "market_zone"], readonly ["quote_is_usd", "quoteIsUsd", "market_quote_is_usd"], readonly ["session_open", "sessionOpen", "market_session_open"], readonly ["earnings_next_ms", "earningsNextMs", "market_earnings_next_ms"], readonly ["earnings_prev_ms", "earningsPrevMs", "market_earnings_prev_ms"], readonly ["earnings_session", "earningsSession", "market_earnings_session"], readonly ["option_multiplier", "optionMultiplier", "market_option_multiplier"], readonly ["dollar_multiplier", "dollarMultiplier", "market_dollar_multiplier"], readonly ["option_contract", "optionContract", "market_option_contract"]];
90
92
  /** The host-filled params by the names the kit generates for them (WRUN_HOST_FILL_WORDS). A declaration row carries
91
93
  * no `host_fill` word, so the rebuild recovers it here: without it the host context could not fill the param and a
92
94
  * hosted lane would evaluate the declared 0 (unavailable). */
93
- export declare const WRUN_HOST_FILL_BY_GENERATED_NAME: ReadonlyMap<string, WrunParamHostFill>;
95
+ export declare const WRUN_HOST_FILL_BY_GENERATED_NAME: ReadonlyMap<string, WrunHostFillWord>;
94
96
  /** The chart context keys the kScript socket worker reads off the `wrunHostFill` the main thread puts beside a hosted
95
97
  * overlay's settings (finite numbers only), one per host-fill word (WRUN_HOST_FILL_WORDS). */
96
98
  export declare const WRUN_HOST_FILL_CONTEXT_KEYS: ReadonlyArray<keyof WrunHostFillContext>;
@@ -178,9 +180,10 @@ export declare function wrunHostedSettingsRecord(settings: unknown): WrunHostedS
178
180
  * members to theirs). The cloud merges the patch over its record, so the two end equal. */
179
181
  export declare function wrunHostedSettingsPatch(held: unknown, asked: unknown): WrunHostedSettingsRecord;
180
182
  /** The host fills a hosted run sends beside its settings record (C4 `hostFill`): the packed chart
181
- * context by the kit's host-fill word, the record the SDK's resolver fills `host_fill` params from
182
- * (its `hostFills`). */
183
- export type WrunHostedHostFill = Partial<Record<WrunParamHostFill, number>>;
183
+ * context by host-fill word (the kit's, and a word read ahead of its pin: WrunHostFillWord), the
184
+ * record the SDK's resolver fills `host_fill` params from (its `hostFills`, by each param's own
185
+ * word, so a word it does not know fills nothing). */
186
+ export type WrunHostedHostFill = Partial<Record<WrunHostFillWord, number>>;
184
187
  /** The host fills of a chart context (`wrunHostFill`, the pane's market and chart words, packed the
185
188
  * way the browser run fills them) by host-fill word: finite numbers only, in the kit's order; none
186
189
  * (undefined) for no context or a context holding none. */
@@ -103,11 +103,12 @@ function wrunHostedSymbolValue(param, settings) {
103
103
  * `chart_<word>`; the extractor refuses any other param under those names), in the kit's order: the market's tick
104
104
  * size and decimals, the chart's interval seconds and five colours (the candle and grid colours since WRUN-STYLE
105
105
  * TH-candle-colors), the market's five facts (WRUN-GAPS-1005, WRUN-SESSION), the issuer's three earnings facts, the
106
- * option multiplier of the chart's options chain and the dollar multiplier of its own trades (kit 0.95.0). Every hosted
107
- * path reads it: the settings record's `hostFill` (wrunHostedHostFill), the declaration rebuild
108
- * (WRUN_HOST_FILL_BY_GENERATED_NAME) and the kScript socket worker's read of the main thread's context
109
- * (WRUN_HOST_FILL_CONTEXT_KEYS), so no hosted path drops a word another carries; wrun-param-values.util.spec holds the
110
- * table to every word the kit's browser lane fills.
106
+ * option multiplier of the chart's options chain, the dollar multiplier of its own trades (kit 0.95.0) and whether the
107
+ * chart is one option contract (om C5, a word read ahead of the kit pin: WrunHostFillWord). Every hosted path reads it:
108
+ * the settings record's `hostFill` (wrunHostedHostFill), the declaration rebuild (WRUN_HOST_FILL_BY_GENERATED_NAME)
109
+ * and the kScript socket worker's read of the main thread's context (WRUN_HOST_FILL_CONTEXT_KEYS), so no hosted path
110
+ * drops a word another carries; wrun-param-values.util.spec holds the table to every word the browser run fills, the
111
+ * kit's and those read ahead of its pin.
111
112
  */
112
113
  export const WRUN_HOST_FILL_WORDS = [
113
114
  ['tick_size', 'tickSize', 'market_tick_size'],
@@ -131,6 +132,8 @@ export const WRUN_HOST_FILL_WORDS = [
131
132
  ['option_multiplier', 'optionMultiplier', 'market_option_multiplier'],
132
133
  // The dollar multiplier of the market's own trades (kit 0.95.0, wrun-chart-market-facts.util).
133
134
  ['dollar_multiplier', 'dollarMultiplier', 'market_dollar_multiplier'],
135
+ // Whether the chart is one option contract (om C5, read ahead of the kit pin, wrun-chart-market-facts.util).
136
+ ['option_contract', 'optionContract', 'market_option_contract'],
134
137
  ];
135
138
  /** The host-filled params by the names the kit generates for them (WRUN_HOST_FILL_WORDS). A declaration row carries
136
139
  * no `host_fill` word, so the rebuild recovers it here: without it the host context could not fill the param and a
@@ -240,6 +243,8 @@ export function wrunSheetParamsFromDeclarations(declarations) {
240
243
  multiline: row.multiline === true,
241
244
  }
242
245
  : {}),
246
+ // A word read ahead of the kit pin (WrunHostFillWord) rides under the param's pinned type, as it does on the
247
+ // sheet a newer SDK compiled.
243
248
  ...(hostFill !== undefined ? { host_fill: hostFill, hidden: true } : {}),
244
249
  });
245
250
  }
@@ -4,14 +4,21 @@
4
4
  * (wrun-script-inputs.util re-exports it) and keeps them off the pre-candle closure. Its imports are settings readers
5
5
  * the boot path already holds.
6
6
  */
7
- import type { WrunIndicatorMetadata, WrunMetadataParam } from '../../interfaces/wrun-runtime.interface.js';
7
+ import type { WrunIndicatorMetadata, WrunMetadataParam, WrunParamHostFill } from '../../interfaces/wrun-runtime.interface.js';
8
+ /** The host_fill words the chart fills: the pinned kit's (WrunParamHostFill) and each word read ahead of the pin
9
+ * while the kit that declares it is built. A sheet a newer SDK compiled carries such a word at run time though the
10
+ * pinned type lacks it; once a pin carries it the union adds nothing and the word leaves
11
+ * wrun-param-values.util.spec's AHEAD_OF_KIT. None is read ahead today: `option_contract` (om C5) was, until the
12
+ * chart pinned kit 0.102.0, which declares it. */
13
+ export type WrunHostFillWord = WrunParamHostFill;
8
14
  /** What the host fills into `host_fill` params at run time: the chart
9
15
  * market's tick size and price precision, the chart's bar interval in
10
16
  * seconds, its background / text / candle up / candle down / grid colour as
11
17
  * the kit's packed signed i32 (wrun-chart-context.util), the market's
12
- * five facts as their codes, the option multiplier of its options chain and
13
- * the dollar multiplier of its own trades (wrun-chart-market-facts.util);
14
- * absent = the declared default (0, unknown). */
18
+ * five facts as their codes, the option multiplier of its options chain,
19
+ * the dollar multiplier of its own trades and whether it is one option
20
+ * contract (wrun-chart-market-facts.util); absent = the declared default
21
+ * (0, unknown). */
15
22
  export interface WrunHostFillContext {
16
23
  tickSize?: number;
17
24
  pricePrecision?: number;
@@ -56,6 +63,9 @@ export interface WrunHostFillContext {
56
63
  * a market quoted in dollars); 0 where it is not proven (a full run never
57
64
  * computes a sheet declaring it over 0: it refuses first). */
58
65
  dollarMultiplier?: number;
66
+ /** `market.option_contract()` (om C5, a kit host-fill word by 0.102.0): 1 when the chart's
67
+ * market is one option contract (an OPRA contract, a CME or crypto option), else 0 (wrunChartOptionContract). */
68
+ optionContract?: number;
59
69
  }
60
70
  export declare function nonEmptyString(value: unknown): string | undefined;
61
71
  export declare function finiteNumber(value: unknown): number | undefined;
@@ -139,6 +139,10 @@ function paramRunValue(param, flat, host) {
139
139
  return finiteOr(finiteNumber(host?.optionMultiplier), fallback);
140
140
  if (param.host_fill === 'dollar_multiplier')
141
141
  return finiteOr(finiteNumber(host?.dollarMultiplier), fallback);
142
+ // Asserted wider (WrunHostFillWord): the pinned kit's type lacks this word, which a newer SDK's sheet carries.
143
+ if (param.host_fill === 'option_contract') {
144
+ return finiteOr(finiteNumber(host?.optionContract), fallback);
145
+ }
142
146
  const raw = flat?.[param.name];
143
147
  switch (param.type) {
144
148
  case 'symbol':
@@ -13,10 +13,10 @@
13
13
  * wire (a TradingView prefix, a display alias such as `BINANCE.F`, a stock listing), TradingView's perpetual suffix
14
14
  * (`BTCUSDT.P`), our key typed into the symbol half (`COINBASE|BTC-USD`), a stock or forex symbol without its
15
15
  * `/` (`POLYGON:AAPL`, `FX_OTC:EURUSD`), or a crypto pair whose form the venue's catalog spelling does not vouch for
16
- * (`venue-presets.constants`: Coinbase and OKX write `BTC-USD`, OKX's perpetuals `BTC-USDT-SWAP`, Binance and Bybit
17
- * `BTCUSDT`; a pair on a venue the presets do not describe is confirmed by the catalog), or a CRYPTOCAP symbol
18
- * TradingView spells unlike us (`CRYPTOCAP:HYPEH.D`, the coin cap `CRYPTOCAP:BTC`). Everything else is ours and skips
19
- * the catalog.
16
+ * (`venue-presets.constants` VENUE_PAIR_QUOTES: Coinbase and OKX write `BTC-USD`, OKX's perpetuals `BTC-USDT-SWAP`,
17
+ * Binance and Bybit `BTCUSDT`; a pair on a venue the table does not spell is confirmed by the catalog), or a
18
+ * CRYPTOCAP symbol TradingView spells unlike us (`CRYPTOCAP:HYPEH.D`, the coin cap `CRYPTOCAP:BTC`). Everything else
19
+ * is ours and skips the catalog.
20
20
  * - `resolveWrunPinMarket` (sync over an already-loaded catalog): the written spelling first (our own spelling always
21
21
  * wins), then the same instrument through the TradingView prefix tables (tradingview-symbols.leaf, the watchlist
22
22
  * import's own: the venue map, the quote split, the perpetual ids, the metals, the CRYPTOCAP ticker renames, where
@@ -36,7 +36,7 @@
36
36
  * in an empty fetch. Pure: no store, no service, no I/O (the one async helper awaits a catalog ask its caller injects).
37
37
  */
38
38
  import { Category, Exchange } from '@orangecharts/orange-v2-pb-common';
39
- import { PERP_PRESET_VENUE_QUOTES, SPOT_PRESET_VENUE_QUOTES } from '../../constants/venue-presets.constants.js';
39
+ import { VENUE_PAIR_QUOTES } from '../../constants/venue-presets.constants.js';
40
40
  import { normalizeLegacyExchange } from '../chart/legacy-exchange.leaf.js';
41
41
  import { EXCHANGE_DISPLAY_SUFFIXES, formatDisplayToExchange } from '../exchange-normalization.util.js';
42
42
  import { BASE_ALIASES, CME_PREFIXES, CRYPTO_VENUES, CRYPTOCAP_PREFIX, FX_PREFIXES, NATIVE_PREFIX, PERP_SUFFIX_RE, TVC_SPOT_METALS, US_STOCK_PREFIXES, VENUE_TO_TRADINGVIEW, cmeContinuousKeyOf, cryptoCandidate, cryptoCapSeriesOf, fxPair, splitCryptoSymbol, } from '../watchlist/import/tradingview-symbols.leaf.js';
@@ -109,15 +109,16 @@ function readingsOf(input, chartExchange) {
109
109
  const meant = unwrapNative(named ?? written);
110
110
  return meant === written ? [written] : [written, meant];
111
111
  }
112
- /** A crypto venue of ours the TradingView tables or the venue presets describe. */
112
+ /** A crypto venue of ours the TradingView tables describe or the venue spelling table spells. */
113
113
  function isOurCryptoVenue(venue) {
114
- return venue in VENUE_TO_TRADINGVIEW || venue in SPOT_PRESET_VENUE_QUOTES || venue in PERP_PRESET_VENUE_QUOTES;
114
+ return venue in VENUE_TO_TRADINGVIEW || Object.hasOwn(VENUE_PAIR_QUOTES, venue);
115
115
  }
116
- /** How a preset venue spells a pair in its catalog, read off the whole quote (`venue-presets.constants`: `BINANCE:
117
- * 'USDT'` is `BTCUSDT`, `COINBASE: '-USD'` is `BTC-USD`, `OKEX_SWAP: '-USDT-SWAP'` is `BTC-USDT-SWAP`); undefined
118
- * for a venue the presets do not describe, and for the bare coin (Hyperliquid's quote ''), which no shape tells. */
116
+ /** How a venue spells a pair in its catalog, read off the whole quote (`venue-presets.constants` VENUE_PAIR_QUOTES:
117
+ * `BINANCE: 'USDT'` is `BTCUSDT`, `COINBASE: '-USD'` is `BTC-USD`, `OKEX_SWAP: '-USDT-SWAP'` is `BTC-USDT-SWAP`);
118
+ * undefined for a venue the table does not spell, and for the bare coin (Hyperliquid's quote ''), which no shape
119
+ * tells. */
119
120
  function presetPairForm(venue) {
120
- const quote = SPOT_PRESET_VENUE_QUOTES[venue] ?? PERP_PRESET_VENUE_QUOTES[venue];
121
+ const quote = Object.hasOwn(VENUE_PAIR_QUOTES, venue) ? VENUE_PAIR_QUOTES[venue] : undefined;
121
122
  if (!quote)
122
123
  return undefined;
123
124
  if (/^[A-Z0-9]/.test(quote))
@@ -1,4 +1,45 @@
1
+ /**
2
+ * Where a refusal record lands (contract C3): the overlay's legend chip and card, a change event
3
+ * for the folded legend summary and the works-on list, and, once per failed user attempt, a toast.
4
+ *
5
+ * - Per-owner verdicts: a full run (`run`) and a live tick (`tick`) each hold at most one record
6
+ * per overlay; the legend shows the higher one by precedence (`compareWrunRefusals`), written
7
+ * through the inert-legend writer, so the legend observer and the change-only comparator keep
8
+ * working and an equal record writes once. A full run or reseed success retracts `all` (it
9
+ * supersedes every earlier tick verdict); a healthy tick retracts `tick`, which shows the run's
10
+ * verdict again when one stands.
11
+ * - Currentness: `projectWrunRefusal` re-checks `isCurrent()` and re-resolves the overlay after
12
+ * EVERY await, so a stale settlement never writes onto an overlay a newer run owns, and a target
13
+ * that moved cells is followed to its new cell.
14
+ * - Attempt tokens: one per overlay key (`chartIndex:indicatorId`), each open a new generation with
15
+ * its origin. A notice is claimable once per live user-origin token, never for `system`, never
16
+ * after close or after the request that carried it ended (`concludeWrunRefusalAttempt`: answered,
17
+ * or superseded by a later request); re-opening a key supersedes the earlier token (the
18
+ * attempt-envelope discipline, kept apart from it: that one settles analytics).
19
+ * - The transient grace (CLOUD-RUN-ROBUST C5, wrun-transient-rerun.util): a record whose cause is
20
+ * transient (`telemetry.cause` in WRUN_TRANSIENT_FAILURE_CAUSES) on an overlay a rerun driver runs
21
+ * waits instead of showing: the overlay shows loading, the events that end the condition rerun it,
22
+ * and the owner's latest record waits. A retraction of its owner (a paint) drops it and nothing
23
+ * shows; a record that shows at once replaces it; a teardown drops it; the grace's deadline shows
24
+ * it exactly as it would have shown at once, while the run or tick that raised it still owns the
25
+ * overlay. A record with no cause, any other cause, or on an overlay no driver runs (a revive or
26
+ * an add whose load failed: nothing could rerun it) shows at once as before, with its Retry.
27
+ * - The HUD (OPRA QA class 5): a `run` record that drew nothing (`paused`) replaces the overlay's
28
+ * latest-values snapshot with the refused one (`wrunRefusedLatestSnapshotOf`) the moment it
29
+ * shows, whoever raised it (the run pass, the loader's own phases, the grace's deadline), so the
30
+ * card says the chip's sentence instead of the numbers of a run before it. A note keeps the
31
+ * snapshot (its picture stands), a record waiting out its grace has not shown yet, and the next
32
+ * accepted run replaces the refused snapshot.
33
+ *
34
+ * Import graph: the chart instances load through the host's loader (`chart.loadTitanCharts`, the
35
+ * wrun lifecycle's rule), and the toast rides the actions util through its loader too
36
+ * (`ui.loadWrunRefusalActions`). The HUD snapshot rides the host's `chart.publishLatestValues`;
37
+ * its words, its bar and its clock come from leaves the boot closure already holds (the legend
38
+ * writer's text util, the gap detector, the server clock).
39
+ */
40
+ import type { WrunChartHandle } from '../../host-ports.types.js';
1
41
  import type { WrunRunReason } from './wrun-lifecycle.contract.js';
42
+ import type { WrunLatestSnapshot } from './wrun-latest-snapshot.js';
2
43
  import { type WrunRefusal, type WrunRefusalAttemptToken, type WrunRefusalOverlayTarget } from './wrun-refusal.util.js';
3
44
  /** Load the chart instances once (shared by every caller; a failed load is retried). Every async
4
45
  * entry point awaits it before `resolveWrunRefusalTarget`, which reads them synchronously. */
@@ -26,6 +67,15 @@ export declare function projectWrunRefusal(target: WrunRefusalOverlayTarget, r:
26
67
  notify: boolean;
27
68
  isCurrent: () => boolean;
28
69
  }): Promise<boolean>;
70
+ /**
71
+ * The latest-values snapshot of a full run refused by name (contract C2, `WrunLatestSnapshot.refused`): no values,
72
+ * strings or history, so no reader (the HUD card, the legend's entries, the hover) shows the numbers of a run before
73
+ * it, which computed for another market or other settings. `refused` carries the record's C2 row key
74
+ * (`<class>/<variant>`, the row its words come from) and the one sentence its legend chip shows
75
+ * (`wrunRefusalSentence`: the chip's tooltip and its card's words, buildWrunRefusalErrorMessage), in the locale
76
+ * active at the publish. Stamped at the chart's newest bar, else now on the server's clock.
77
+ */
78
+ export declare function wrunRefusedLatestSnapshotOf(r: WrunRefusal, tc?: WrunChartHandle | null): WrunLatestSnapshot;
29
79
  export declare function wrunRefusalRetractionCount(target: WrunRefusalOverlayTarget): number;
30
80
  export declare function retractWrunRefusal(target: WrunRefusalOverlayTarget, owner: 'run' | 'tick' | 'all'): Promise<void>;
31
81
  /**