@orangecharts/wrun-chart-host 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/README.md +2 -1
  2. package/dist/constants/feature-flags.constants.d.ts +4 -0
  3. package/dist/constants/feature-flags.constants.js +27 -0
  4. package/dist/constants/marketCapabilities.constants.d.ts +14 -9
  5. package/dist/constants/marketCapabilities.constants.js +36 -13
  6. package/dist/constants/opra-compliance.constants.d.ts +14 -0
  7. package/dist/constants/opra-compliance.constants.js +14 -0
  8. package/dist/constants/option-venues.constants.d.ts +11 -6
  9. package/dist/constants/option-venues.constants.js +5 -2
  10. package/dist/host-env.d.ts +10 -4
  11. package/dist/host-ports.types.d.ts +39 -3
  12. package/dist/index.d.ts +1 -0
  13. package/dist/index.js +1 -0
  14. package/dist/interfaces/opra-realtime.interface.d.ts +13 -11
  15. package/dist/interfaces/opra-realtime.interface.js +10 -10
  16. package/dist/interfaces/wrun-runtime.interface.d.ts +34 -13
  17. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +53 -10
  18. package/dist/kscript-data/controls/live-trades-merge.util.js +81 -16
  19. package/dist/market-data/billing.interface.d.ts +138 -17
  20. package/dist/market-data/billing.interface.js +25 -8
  21. package/dist/market-data/venues/index.d.ts +3 -3
  22. package/dist/market-data/venues/opra.contract.copy.json +5 -3
  23. package/dist/market-data/venues/opra.d.ts +3 -3
  24. package/dist/market-data/venues/opra.js +5 -4
  25. package/dist/replay/replayLadder.js +3 -1
  26. package/dist/utility/chart/crypto-index.leaf.d.ts +2 -2
  27. package/dist/utility/chart/crypto-index.leaf.js +2 -2
  28. package/dist/utility/chart/index-mode-admission.util.js +9 -1
  29. package/dist/utility/chart/index-mode.util.d.ts +5 -2
  30. package/dist/utility/chart/index-mode.util.js +23 -13
  31. package/dist/utility/chart/kscript-venue-policy.util.d.ts +28 -21
  32. package/dist/utility/chart/kscript-venue-policy.util.js +30 -24
  33. package/dist/utility/chart/marketKind.util.d.ts +12 -10
  34. package/dist/utility/chart/marketKind.util.js +17 -7
  35. package/dist/utility/chart/om-panel-push-style.util.d.ts +7 -7
  36. package/dist/utility/chart/om-panel-push-style.util.js +17 -15
  37. package/dist/utility/chart/om-panel.util.js +6 -6
  38. package/dist/utility/chart/profile-block-size.util.d.ts +16 -0
  39. package/dist/utility/chart/profile-block-size.util.js +7 -0
  40. package/dist/utility/chart/quote-perp.leaf.d.ts +17 -0
  41. package/dist/utility/chart/quote-perp.leaf.js +20 -0
  42. package/dist/utility/chart/wrun-run-result.util.d.ts +5 -0
  43. package/dist/utility/chart/wrun-run-result.util.js +4 -1
  44. package/dist/utility/common/transformations.util.d.ts +7 -0
  45. package/dist/utility/common/transformations.util.js +11 -0
  46. package/dist/utility/options/option-venue.util.d.ts +3 -3
  47. package/dist/utility/options/option-venue.util.js +3 -3
  48. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +1 -1
  49. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +2 -2
  50. package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.d.ts +2 -2
  51. package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.js +5 -1
  52. package/dist/utility/wrun/sources/row-lane-registry.js +3 -2
  53. package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +9 -3
  54. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +13 -5
  55. package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +11 -0
  56. package/dist/utility/wrun/sources/row-lanes/option_prints.js +63 -9
  57. package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +8 -0
  58. package/dist/utility/wrun/sources/row-lanes/option_strikes.js +12 -0
  59. package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +5 -2
  60. package/dist/utility/wrun/sources/row-lanes/option_surface.js +5 -2
  61. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +11 -5
  62. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +31 -10
  63. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +33 -1
  64. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +95 -6
  65. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +25 -5
  66. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +55 -18
  67. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +146 -40
  68. package/dist/utility/wrun/wrun-batched-marks.util.d.ts +16 -3
  69. package/dist/utility/wrun/wrun-batched-marks.util.js +30 -19
  70. package/dist/utility/wrun/wrun-batched-readout.util.d.ts +37 -9
  71. package/dist/utility/wrun/wrun-batched-readout.util.js +61 -15
  72. package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -0
  73. package/dist/utility/wrun/wrun-cell-capacity.leaf.d.ts +66 -0
  74. package/dist/utility/wrun/wrun-cell-capacity.leaf.js +86 -0
  75. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +147 -9
  76. package/dist/utility/wrun/wrun-chart-market-facts.util.js +345 -11
  77. package/dist/utility/wrun/wrun-color-facts.util.d.ts +19 -9
  78. package/dist/utility/wrun/wrun-color-facts.util.js +24 -14
  79. package/dist/utility/wrun/wrun-color-settings.util.d.ts +15 -4
  80. package/dist/utility/wrun/wrun-color-settings.util.js +31 -12
  81. package/dist/utility/wrun/wrun-dollar-unit-port.leaf.d.ts +17 -0
  82. package/dist/utility/wrun/wrun-dollar-unit-port.leaf.js +9 -0
  83. package/dist/utility/wrun/wrun-download-meter.util.d.ts +92 -0
  84. package/dist/utility/wrun/wrun-download-meter.util.js +122 -0
  85. package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +6 -1
  86. package/dist/utility/wrun/wrun-draft-overlay.util.js +23 -3
  87. package/dist/utility/wrun/wrun-frames.js +5 -5
  88. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +2 -2
  89. package/dist/utility/wrun/wrun-hosted-wire-caps.js +7 -0
  90. package/dist/utility/wrun/wrun-hud-looks.util.d.ts +33 -17
  91. package/dist/utility/wrun/wrun-hud-looks.util.js +30 -16
  92. package/dist/utility/wrun/wrun-lifecycle-runtime.util.d.ts +8 -6
  93. package/dist/utility/wrun/wrun-lifecycle-runtime.util.js +8 -6
  94. package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -2
  95. package/dist/utility/wrun/wrun-live-intake.util.d.ts +6 -2
  96. package/dist/utility/wrun/wrun-live-intake.util.js +136 -21
  97. package/dist/utility/wrun/wrun-live-tick.util.js +91 -38
  98. package/dist/utility/wrun/wrun-market-size-contract-carry.leaf.d.ts +53 -0
  99. package/dist/utility/wrun/wrun-market-size-contract-carry.leaf.js +162 -0
  100. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +166 -48
  101. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +216 -33
  102. package/dist/utility/wrun/wrun-market-size-defaults.util.d.ts +51 -7
  103. package/dist/utility/wrun/wrun-market-size-defaults.util.js +314 -56
  104. package/dist/utility/wrun/wrun-option-prints.util.d.ts +41 -2
  105. package/dist/utility/wrun/wrun-option-prints.util.js +80 -13
  106. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +3 -0
  107. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +3 -0
  108. package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +23 -0
  109. package/dist/utility/wrun/wrun-option-strike-flow.util.js +55 -0
  110. package/dist/utility/wrun/wrun-option-views.util.d.ts +51 -7
  111. package/dist/utility/wrun/wrun-option-views.util.js +151 -28
  112. package/dist/utility/wrun/wrun-options-stop.util.d.ts +2 -1
  113. package/dist/utility/wrun/wrun-options-stop.util.js +3 -2
  114. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +3 -0
  115. package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.d.ts +31 -14
  116. package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.js +22 -0
  117. package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +7 -0
  118. package/dist/utility/wrun/wrun-overlay-recovery.util.js +25 -1
  119. package/dist/utility/wrun/wrun-overlay-result.util.d.ts +7 -1
  120. package/dist/utility/wrun/wrun-overlay-result.util.js +2 -0
  121. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +34 -6
  122. package/dist/utility/wrun/wrun-overlay-run.util.js +416 -171
  123. package/dist/utility/wrun/wrun-pack-widths.leaf.d.ts +4 -4
  124. package/dist/utility/wrun/wrun-pack-widths.leaf.js +4 -4
  125. package/dist/utility/wrun/wrun-pack.util.d.ts +7 -3
  126. package/dist/utility/wrun/wrun-pack.util.js +20 -9
  127. package/dist/utility/wrun/wrun-panel-style.util.d.ts +27 -15
  128. package/dist/utility/wrun/wrun-panel-style.util.js +42 -20
  129. package/dist/utility/wrun/wrun-param-map.util.d.ts +7 -6
  130. package/dist/utility/wrun/wrun-param-map.util.js +8 -5
  131. package/dist/utility/wrun/wrun-param-values.util.d.ts +10 -2
  132. package/dist/utility/wrun/wrun-param-values.util.js +2 -0
  133. package/dist/utility/wrun/wrun-prefix-lanes.util.js +2 -2
  134. package/dist/utility/wrun/wrun-refusal.util.js +10 -1
  135. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +7 -0
  136. package/dist/utility/wrun/wrun-source-rows.util.d.ts +4 -0
  137. package/dist/utility/wrun/wrun-source-rows.util.js +92 -40
  138. package/dist/utility/wrun/wrun-tape-source.util.d.ts +126 -50
  139. package/dist/utility/wrun/wrun-tape-source.util.js +193 -68
  140. package/dist/utility/wrun/wrun-volume-profile-lane.util.d.ts +7 -5
  141. package/dist/utility/wrun/wrun-volume-profile-lane.util.js +8 -6
  142. package/dist/workers/utils/volume-profile.worker.util.d.ts +4 -1
  143. package/dist/workers/utils/volume-profile.worker.util.js +5 -2
  144. package/dist/workers/wrun/wrun-abi-host.js +3 -2
  145. package/package.json +11 -11
@@ -84,6 +84,19 @@ import type { RuntimeDiagnostic } from '../../interfaces/kscript-diagnostics.int
84
84
  import { buildWrunOverlayRunResult, type WrunCanvasHostFill, type WrunOverlayResultOptions } from './wrun-overlay-result.util.js';
85
85
  import { wrunIntegratedRowsView } from './wrun-integration-budget.util.js';
86
86
  export { buildWrunOverlayRunResult, type WrunCanvasHostFill, type WrunOverlayResultOptions };
87
+ /**
88
+ * The chart market's units a result build reads, together: its size unit (`wrunChartSizeUnit`: an output whose
89
+ * `visible_by` leaves it out mounts nothing) and its dollar unit when proven (`wrunMarketDollarUnit`: the CME registry's
90
+ * point value of the contract, NQ 20; 1 on crypto and US stocks), which the batched marks' `units` caption and hover
91
+ * divide a record's dollar value by. Synchronous over the facts the run head warmed. Every build spreads it (the full
92
+ * run, the row-source run, the reseed, the refine, the prefix landing and the live tick), so a tail or a reseed never
93
+ * hands the children a size unit without the dollar unit: a tail without it would re-register the hover in dollars.
94
+ * tests/utility/wrun/wrun-big-trades-size-shown-as.spec.ts fails on a build that names a size unit by hand.
95
+ */
96
+ export declare function wrunResultMarketUnits(market: WrunFactsMarket | undefined): {
97
+ sizeUnit: number;
98
+ valuePerUnit?: number;
99
+ };
87
100
  export { wrunIntegratedRowsView };
88
101
  /** The leg bars an odds seed fetch reaches back before the window's open
89
102
  * (the hosted lane's seed span): the last observation before a thin
@@ -537,7 +550,13 @@ type WrunBuiltinLaneThunks = {
537
550
  };
538
551
  /** One lane keyed by its id to dispatch (a registry poll lane instance, a trades leg lane): its id and its fetch,
539
552
  * handed the signal its run raises when the lane's budget runs out (`runWrunSourceLanes`). */
540
- type WrunPollLaneThunk = readonly [key: string, run: (abandoned: AbortSignal) => Promise<WrunLaneRows>];
553
+ /** A lane's first rows before its whole answer (a row lane's first-paint slice: wrun-row-lanes.util
554
+ * `fetchWrunRowLaneRows` `onFirstSlice`), handed to its thunk by `runWrunSourceLanes`. */
555
+ type WrunLaneEarly = (rows: WrunLaneRows) => void;
556
+ type WrunPollLaneThunk = readonly [
557
+ key: string,
558
+ run: (abandoned: AbortSignal, early?: WrunLaneEarly) => Promise<WrunLaneRows>
559
+ ];
541
560
  type WrunSourceLaneThunks = WrunBuiltinLaneThunks & {
542
561
  /** The trades leg lanes (kit 0.77.0), one thunk per (quote, market) by its lane id. */
543
562
  tradeLegs?: ReadonlyArray<WrunPollLaneThunk>;
@@ -567,10 +586,12 @@ export declare function mergeWrunSourceLaneRuns(runs: ReadonlyArray<WrunSourceLa
567
586
  * rows with the cause (a budget expiry, an empty or declined answer, any
568
587
  * other rejection). Every cause here is retryable, except an answer the
569
588
  * data plane refused by name (wrun-lane-refusal.leaf): the same ask is
570
- * refused again, so no ladder re-asks it. */
589
+ * refused again, so no ladder re-asks it. A lane that answered its first rows alone (`filling`: a row lane's
590
+ * first-paint slice) is rows: its whole answer went on as a late read. */
571
591
  export type WrunLaneOutcome = {
572
592
  kind: 'rows';
573
593
  rows: WrunLaneRows;
594
+ filling?: true;
574
595
  } | {
575
596
  kind: 'degraded';
576
597
  rows: [];
@@ -609,10 +630,11 @@ export interface WrunSourceLanePolicy {
609
630
  /** Called with each lane id right before its thunk runs, and the lane's send anchor, which the fetch that asks the
610
631
  * lane hands its transport. */
611
632
  onDispatch?: (lane: string, anchor: WrunLaneSendAnchor) => void;
612
- /** Called with a lane's own answer when its budget ran out first (never when the answer itself failed): the read is
613
- * abandoned, never aborted, so it is still out, and a later run's dispatch may join or adopt it
614
- * (run-schedule/wrun-late-reads.util). */
615
- onLate?: (lane: string, answer: Promise<WrunLaneRows>) => void;
633
+ /** Called with a lane's own answer when the run stopped waiting for it while it was still out (never when the answer
634
+ * itself failed): its budget ran out first (`budget`), or the lane handed its first rows over first (`first-slice`:
635
+ * a row lane's first-paint slice, its older bars still out). The read is abandoned, never aborted, and a later run's
636
+ * dispatch may join or adopt it (run-schedule/wrun-late-reads.util). */
637
+ onLate?: (lane: string, answer: Promise<WrunLaneRows>, why: 'budget' | 'first-slice') => void;
616
638
  }
617
639
  /**
618
640
  * A lane's send anchor (`WrunSourceLanePolicy.onDispatch`): the fetch that asks the lane calls `request()` right before
@@ -645,6 +667,12 @@ export interface WrunLaneSendAnchor {
645
667
  * poll lanes (`thunks.pollLanes`, one thunk per planned instance) dispatch with
646
668
  * them, after the row builder's own lanes; their rows come back under
647
669
  * `tradeLegRows` and `pollLaneRows`, keyed by lane id and instance id.
670
+ *
671
+ * A lane may hand its first rows over before its whole answer (`early`, a row lane's first-paint slice on a full run's
672
+ * first paint): when they come before the whole answer and before the budget, the lane settles on them (outcome
673
+ * rows, `filling`) and its whole answer goes on as a late read (`onLate`, `first-slice`), exactly as a read its budget
674
+ * abandoned does, so the source ladder adopts it and nothing asks it twice. Early rows after the budget change
675
+ * nothing: the budget's late read is the whole answer already.
648
676
  */
649
677
  export declare function runWrunSourceLanes(thunks: WrunSourceLaneThunks, policy?: WrunSourceLanePolicy): Promise<WrunSourceLaneRun>;
650
678
  /**