@orangecharts/wrun-chart-host 0.1.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 (198) hide show
  1. package/README.md +72 -0
  2. package/dist/constants/governed-exchanges.constants.d.ts +11 -0
  3. package/dist/constants/governed-exchanges.constants.js +11 -0
  4. package/dist/constants/indicator-sets.constants.d.ts +8 -0
  5. package/dist/constants/indicator-sets.constants.js +8 -0
  6. package/dist/constants/interval.constants.d.ts +34 -0
  7. package/dist/constants/interval.constants.js +121 -0
  8. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.d.ts +28 -0
  9. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.js +65 -0
  10. package/dist/constants/tpo-color-schemes.constants.d.ts +30 -0
  11. package/dist/constants/tpo-color-schemes.constants.js +32 -0
  12. package/dist/host-env.d.ts +102 -0
  13. package/dist/host-env.js +26 -0
  14. package/dist/index.d.ts +93 -0
  15. package/dist/index.js +96 -0
  16. package/dist/indicators/controls/tpo-letter.util.d.ts +2 -0
  17. package/dist/indicators/controls/tpo-letter.util.js +13 -0
  18. package/dist/indicators/controls/tpo-session.util.d.ts +99 -0
  19. package/dist/indicators/controls/tpo-session.util.js +389 -0
  20. package/dist/interfaces/kscript-diagnostics.interface.d.ts +64 -0
  21. package/dist/interfaces/kscript-diagnostics.interface.js +1 -0
  22. package/dist/interfaces/om-panel-data.interface.d.ts +103 -0
  23. package/dist/interfaces/om-panel-data.interface.js +7 -0
  24. package/dist/interfaces/wrun-runtime.interface.d.ts +2659 -0
  25. package/dist/interfaces/wrun-runtime.interface.js +55 -0
  26. package/dist/utility/chart/calendar-interval.util.d.ts +24 -0
  27. package/dist/utility/chart/calendar-interval.util.js +81 -0
  28. package/dist/utility/chart/candle-bar-end.util.d.ts +15 -0
  29. package/dist/utility/chart/candle-bar-end.util.js +23 -0
  30. package/dist/utility/chart/cme-realtime.util.d.ts +24 -0
  31. package/dist/utility/chart/cme-realtime.util.js +53 -0
  32. package/dist/utility/chart/interval-ladder.util.d.ts +27 -0
  33. package/dist/utility/chart/interval-ladder.util.js +92 -0
  34. package/dist/utility/chart/kscript-drawing-prep.util.d.ts +40 -0
  35. package/dist/utility/chart/kscript-drawing-prep.util.js +184 -0
  36. package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +95 -0
  37. package/dist/utility/chart/kscript-drawing-safe-area.util.js +805 -0
  38. package/dist/utility/chart/kscript-legend-entries.util.d.ts +166 -0
  39. package/dist/utility/chart/kscript-legend-entries.util.js +538 -0
  40. package/dist/utility/chart/kscript-output-role.util.d.ts +32 -0
  41. package/dist/utility/chart/kscript-output-role.util.js +215 -0
  42. package/dist/utility/chart/kscript-provenance-keys.util.d.ts +22 -0
  43. package/dist/utility/chart/kscript-provenance-keys.util.js +56 -0
  44. package/dist/utility/chart/kscript-run-result-normalize.util.d.ts +53 -0
  45. package/dist/utility/chart/kscript-run-result-normalize.util.js +476 -0
  46. package/dist/utility/chart/kscript-run-result-shape.util.d.ts +14 -0
  47. package/dist/utility/chart/kscript-run-result-shape.util.js +66 -0
  48. package/dist/utility/chart/kscript-titancharts-container.util.d.ts +29 -0
  49. package/dist/utility/chart/kscript-titancharts-container.util.js +151 -0
  50. package/dist/utility/chart/kscript-viewport-overlays.util.d.ts +83 -0
  51. package/dist/utility/chart/kscript-viewport-overlays.util.js +443 -0
  52. package/dist/utility/chart/om-panel-push-style.util.d.ts +78 -0
  53. package/dist/utility/chart/om-panel-push-style.util.js +301 -0
  54. package/dist/utility/chart/om-panel.util.d.ts +166 -0
  55. package/dist/utility/chart/om-panel.util.js +815 -0
  56. package/dist/utility/chart/om-series.util.d.ts +42 -0
  57. package/dist/utility/chart/om-series.util.js +330 -0
  58. package/dist/utility/chart/om-target.util.d.ts +11 -0
  59. package/dist/utility/chart/om-target.util.js +24 -0
  60. package/dist/utility/chart/om-widget.util.d.ts +148 -0
  61. package/dist/utility/chart/om-widget.util.js +413 -0
  62. package/dist/utility/chart/overlay-output-budget.util.d.ts +16 -0
  63. package/dist/utility/chart/overlay-output-budget.util.js +109 -0
  64. package/dist/utility/chart/overlay-paint-flags.util.d.ts +24 -0
  65. package/dist/utility/chart/overlay-paint-flags.util.js +55 -0
  66. package/dist/utility/chart/profile-row-height.util.d.ts +21 -0
  67. package/dist/utility/chart/profile-row-height.util.js +110 -0
  68. package/dist/utility/chart/session-interval.util.d.ts +1 -0
  69. package/dist/utility/chart/session-interval.util.js +35 -0
  70. package/dist/utility/chart/technical-script-legend-value.util.d.ts +18 -0
  71. package/dist/utility/chart/technical-script-legend-value.util.js +53 -0
  72. package/dist/utility/chart/trading-day.util.d.ts +70 -0
  73. package/dist/utility/chart/trading-day.util.js +238 -0
  74. package/dist/utility/chart/wrun-legend-name.util.d.ts +25 -0
  75. package/dist/utility/chart/wrun-legend-name.util.js +87 -0
  76. package/dist/utility/chart/wrun-run-result.util.d.ts +977 -0
  77. package/dist/utility/chart/wrun-run-result.util.js +5179 -0
  78. package/dist/utility/chart/wrun-visibility-chart.util.d.ts +25 -0
  79. package/dist/utility/chart/wrun-visibility-chart.util.js +22 -0
  80. package/dist/utility/indicators/heatmap-sensitivity.util.d.ts +62 -0
  81. package/dist/utility/indicators/heatmap-sensitivity.util.js +82 -0
  82. package/dist/utility/number-format.util.d.ts +68 -0
  83. package/dist/utility/number-format.util.js +188 -0
  84. package/dist/utility/v2/opra-governed.util.d.ts +1 -0
  85. package/dist/utility/v2/opra-governed.util.js +13 -0
  86. package/dist/utility/wrun/wrun-auto-row.util.d.ts +54 -0
  87. package/dist/utility/wrun/wrun-auto-row.util.js +96 -0
  88. package/dist/utility/wrun/wrun-batched-marks.util.d.ts +341 -0
  89. package/dist/utility/wrun/wrun-batched-marks.util.js +938 -0
  90. package/dist/utility/wrun/wrun-batched-readout.util.d.ts +75 -0
  91. package/dist/utility/wrun/wrun-batched-readout.util.js +171 -0
  92. package/dist/utility/wrun/wrun-box-segment.util.d.ts +185 -0
  93. package/dist/utility/wrun/wrun-box-segment.util.js +570 -0
  94. package/dist/utility/wrun/wrun-build-memo.util.d.ts +133 -0
  95. package/dist/utility/wrun/wrun-build-memo.util.js +301 -0
  96. package/dist/utility/wrun/wrun-builtin-twin-ports.util.d.ts +25 -0
  97. package/dist/utility/wrun/wrun-builtin-twin-ports.util.js +75 -0
  98. package/dist/utility/wrun/wrun-builtin-twin.util.d.ts +9 -0
  99. package/dist/utility/wrun/wrun-builtin-twin.util.js +40 -0
  100. package/dist/utility/wrun/wrun-canvas-cache.util.d.ts +28 -0
  101. package/dist/utility/wrun/wrun-canvas-cache.util.js +56 -0
  102. package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +69 -0
  103. package/dist/utility/wrun/wrun-canvas-readout.util.js +53 -0
  104. package/dist/utility/wrun/wrun-canvases.util.d.ts +295 -0
  105. package/dist/utility/wrun/wrun-canvases.util.js +1432 -0
  106. package/dist/utility/wrun/wrun-cap-notice.util.d.ts +77 -0
  107. package/dist/utility/wrun/wrun-cap-notice.util.js +296 -0
  108. package/dist/utility/wrun/wrun-card-style.util.d.ts +154 -0
  109. package/dist/utility/wrun/wrun-card-style.util.js +539 -0
  110. package/dist/utility/wrun/wrun-chart-context.util.d.ts +89 -0
  111. package/dist/utility/wrun/wrun-chart-context.util.js +213 -0
  112. package/dist/utility/wrun/wrun-chart-names.util.d.ts +23 -0
  113. package/dist/utility/wrun/wrun-chart-names.util.js +33 -0
  114. package/dist/utility/wrun/wrun-chart-time.util.d.ts +12 -0
  115. package/dist/utility/wrun/wrun-chart-time.util.js +23 -0
  116. package/dist/utility/wrun/wrun-child-overlay-id.util.d.ts +13 -0
  117. package/dist/utility/wrun/wrun-child-overlay-id.util.js +44 -0
  118. package/dist/utility/wrun/wrun-color-facts.util.d.ts +40 -0
  119. package/dist/utility/wrun/wrun-color-facts.util.js +88 -0
  120. package/dist/utility/wrun/wrun-color-settings.lazy.d.ts +26 -0
  121. package/dist/utility/wrun/wrun-color-settings.lazy.js +9 -0
  122. package/dist/utility/wrun/wrun-color-settings.util.d.ts +351 -0
  123. package/dist/utility/wrun/wrun-color-settings.util.js +1363 -0
  124. package/dist/utility/wrun/wrun-footprint-modes.util.d.ts +23 -0
  125. package/dist/utility/wrun/wrun-footprint-modes.util.js +24 -0
  126. package/dist/utility/wrun/wrun-frames.d.ts +217 -0
  127. package/dist/utility/wrun/wrun-frames.js +1021 -0
  128. package/dist/utility/wrun/wrun-handles.util.d.ts +792 -0
  129. package/dist/utility/wrun/wrun-handles.util.js +2050 -0
  130. package/dist/utility/wrun/wrun-heatmap-cell-budget.util.d.ts +156 -0
  131. package/dist/utility/wrun/wrun-heatmap-cell-budget.util.js +342 -0
  132. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +218 -0
  133. package/dist/utility/wrun/wrun-hosted-wire-caps.js +667 -0
  134. package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +40 -0
  135. package/dist/utility/wrun/wrun-hosted-wire.util.js +27 -0
  136. package/dist/utility/wrun/wrun-hover.util.d.ts +182 -0
  137. package/dist/utility/wrun/wrun-hover.util.js +534 -0
  138. package/dist/utility/wrun/wrun-hud-looks.util.d.ts +246 -0
  139. package/dist/utility/wrun/wrun-hud-looks.util.js +587 -0
  140. package/dist/utility/wrun/wrun-integration-budget.util.d.ts +47 -0
  141. package/dist/utility/wrun/wrun-integration-budget.util.js +122 -0
  142. package/dist/utility/wrun/wrun-latest-snapshot.d.ts +19 -0
  143. package/dist/utility/wrun/wrun-latest-snapshot.js +7 -0
  144. package/dist/utility/wrun/wrun-levels-child.util.d.ts +131 -0
  145. package/dist/utility/wrun/wrun-levels-child.util.js +514 -0
  146. package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +75 -0
  147. package/dist/utility/wrun/wrun-lifecycle.contract.js +9 -0
  148. package/dist/utility/wrun/wrun-market-facts.util.d.ts +116 -0
  149. package/dist/utility/wrun/wrun-market-facts.util.js +238 -0
  150. package/dist/utility/wrun/wrun-output-style.util.d.ts +344 -0
  151. package/dist/utility/wrun/wrun-output-style.util.js +1239 -0
  152. package/dist/utility/wrun/wrun-overlay-identity.util.d.ts +84 -0
  153. package/dist/utility/wrun/wrun-overlay-identity.util.js +142 -0
  154. package/dist/utility/wrun/wrun-overlay-result.util.d.ts +120 -0
  155. package/dist/utility/wrun/wrun-overlay-result.util.js +219 -0
  156. package/dist/utility/wrun/wrun-pack.util.d.ts +70 -0
  157. package/dist/utility/wrun/wrun-pack.util.js +301 -0
  158. package/dist/utility/wrun/wrun-pane-format.util.d.ts +180 -0
  159. package/dist/utility/wrun/wrun-pane-format.util.js +299 -0
  160. package/dist/utility/wrun/wrun-panel-style.lazy.d.ts +25 -0
  161. package/dist/utility/wrun/wrun-panel-style.lazy.js +15 -0
  162. package/dist/utility/wrun/wrun-panel-style.util.d.ts +174 -0
  163. package/dist/utility/wrun/wrun-panel-style.util.js +726 -0
  164. package/dist/utility/wrun/wrun-param-values.util.d.ts +69 -0
  165. package/dist/utility/wrun/wrun-param-values.util.js +230 -0
  166. package/dist/utility/wrun/wrun-refusal.util.d.ts +263 -0
  167. package/dist/utility/wrun/wrun-refusal.util.js +1259 -0
  168. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +199 -0
  169. package/dist/utility/wrun/wrun-registry-errors.util.js +257 -0
  170. package/dist/utility/wrun/wrun-render-select.util.d.ts +336 -0
  171. package/dist/utility/wrun/wrun-render-select.util.js +1157 -0
  172. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +434 -0
  173. package/dist/utility/wrun/wrun-script-inputs.util.js +1971 -0
  174. package/dist/utility/wrun/wrun-setting-words.lazy.d.ts +20 -0
  175. package/dist/utility/wrun/wrun-setting-words.lazy.js +9 -0
  176. package/dist/utility/wrun/wrun-setting-words.util.d.ts +79 -0
  177. package/dist/utility/wrun/wrun-setting-words.util.js +176 -0
  178. package/dist/utility/wrun/wrun-socket-row-store.d.ts +98 -0
  179. package/dist/utility/wrun/wrun-socket-row-store.js +417 -0
  180. package/dist/utility/wrun/wrun-style-flags.util.d.ts +18 -0
  181. package/dist/utility/wrun/wrun-style-flags.util.js +21 -0
  182. package/dist/utility/wrun/wrun-style-words.util.d.ts +148 -0
  183. package/dist/utility/wrun/wrun-style-words.util.js +439 -0
  184. package/dist/utility/wrun/wrun-table-look.util.d.ts +125 -0
  185. package/dist/utility/wrun/wrun-table-look.util.js +225 -0
  186. package/dist/utility/wrun/wrun-text-look.util.d.ts +51 -0
  187. package/dist/utility/wrun/wrun-text-look.util.js +227 -0
  188. package/dist/utility/wrun/wrun-text-params.util.d.ts +106 -0
  189. package/dist/utility/wrun/wrun-text-params.util.js +171 -0
  190. package/dist/utility/wrun/wrun-tpo-rows.util.d.ts +71 -0
  191. package/dist/utility/wrun/wrun-tpo-rows.util.js +438 -0
  192. package/dist/utility/wrun/wrun-twin-compute-inputs.util.d.ts +14 -0
  193. package/dist/utility/wrun/wrun-twin-compute-inputs.util.js +58 -0
  194. package/dist/utility/wrun/wrun-visibility-table.d.ts +437 -0
  195. package/dist/utility/wrun/wrun-visibility-table.js +237 -0
  196. package/dist/utility/wrun/wrun-volume-profile.util.d.ts +37 -0
  197. package/dist/utility/wrun/wrun-volume-profile.util.js +278 -0
  198. package/package.json +38 -0
@@ -0,0 +1,218 @@
1
+ /**
2
+ * The hosted wire's names, import-free: the wire capabilities every hosted wrun createScript
3
+ * advertises (one constant list, lane parity C4), the settings key that carries them from the main
4
+ * thread to the kScript socket worker, the run-level key a hosted-wire reply carries, the server
5
+ * capabilities the socket's `hello` frame advertises the other way, and the refusal an error frame
6
+ * names (its `details.wrunRefusal`, relayed across the worker boundary: "Refusals off an error
7
+ * frame" below). The socket worker and the boot graph read these and must never
8
+ * load the shared host (the kit's host entry, which only the seam `wrun-shared-host.ts` imports),
9
+ * so this file keeps its own literal copies of the package's names and imports nothing.
10
+ * `wrun-hosted-wire-caps.spec.ts` pins each literal, and the verdicts of `hasWrunHostedWire`,
11
+ * equal to the package's; `wrun-shared-host.boundary.spec.ts` keeps this file free of imports. See
12
+ * docs/features/kscript/wrun/wrun-browser-editor.md ("The host entry").
13
+ */
14
+ /** The client capability for the hosted wire: every result and live frame of the instance carries
15
+ * one `wrunHost` key (the package's `WRUN_HOST_WIRE_CAP`). */
16
+ export declare const WRUN_HOST_WIRE_CAP = "wrun-host-v1";
17
+ /** The client capability for displaced outputs (the package's `WRUN_DISPLACEMENT_WIRE_CAP`). The
18
+ * chart advertises it only beside `WRUN_HOST_WIRE_CAP`. */
19
+ export declare const WRUN_DISPLACEMENT_WIRE_CAP = "wrun-displacement-v1";
20
+ /** The client capability for the batched sections (marks, spans, rays; the package's
21
+ * `WRUN_BATCHED_WIRE_CAP`, lane parity row 55): the cloud keeps the sections in the hosted wire's
22
+ * sheet and their data-only outputs in its rows, which the pass draws by index as it draws a
23
+ * browser run's. A server that does not deliver them (its hello lists no `wrun-batched-v1`)
24
+ * ignores the name and keeps refusing the family on the wire (`wrunHost.refusals`), which the pass
25
+ * already reads as a left-out row. The chart advertises it only beside `WRUN_HOST_WIRE_CAP`. */
26
+ export declare const WRUN_BATCHED_WIRE_CAP = "wrun-batched-v1";
27
+ /** The client capability for the timed spans and rays (stride 5; the package's
28
+ * `WRUN_BATCHED_V2_WIRE_CAP`): a delivery gate like `WRUN_BATCHED_WIRE_CAP`. A server that
29
+ * delivers them lists `wrun-batched-v2` in its hello; without the cap the cloud refuses the timed
30
+ * family by name on the wire, and an older server refuses it at plan. The chart advertises it only
31
+ * beside `WRUN_HOST_WIRE_CAP`. */
32
+ export declare const WRUN_BATCHED_V2_WIRE_CAP = "wrun-batched-v2";
33
+ /** The wire caps every hosted wrun run advertises beside `canonical-live-v1` (lane parity C4: the
34
+ * hosted wire is the one reply shape, no flag reads it), in the one fixed order: the hosted wire,
35
+ * then the displacement and the two batched sections caps beside it. The hosted createScript (the
36
+ * technical-script payload), Run once in Cloud and the Protected publish preflight's profile table
37
+ * all send or judge this list. */
38
+ export declare const WRUN_HOSTED_WIRE_CAPS: readonly string[];
39
+ /** The settings key that carries the advertised caps from the main thread's request payload to
40
+ * the socket worker, which lifts it into `wireCaps` and strips it: it never rides the wire. */
41
+ export declare const WRUN_WIRE_CAPS_KEY = "wrunWireCaps";
42
+ /** The run-level key a hosted-wire reply carries (the package's `WRUN_HOSTED_WIRE_KEY`). */
43
+ export declare const WRUN_HOSTED_WIRE_KEY = "wrunHost";
44
+ /** The server capability (kscript-backend's `hello`, the first frame on every kScript socket, lists
45
+ * its caps under `serverCaps`) that admits a market picker's `EXCHANGE:SYMBOL` text in a hosted
46
+ * createScript's param map: the shared view resolves the pick from the text like the browser
47
+ * sheet does. A server that did not advertise it reads the param through Number() and refuses the
48
+ * text, so the map sends 0 to it (wrunHostedParamsOf). The server lists any later cap beside it. */
49
+ export declare const WRUN_SYMBOL_TEXT_SERVER_CAP = "wrun-symbol-text-v1";
50
+ /** The server capability that admits the settings record (lane parity C4, its 10-12 rollout
51
+ * amendment): a hosted createScript sends the overlay's flat setting values over the sheet's params
52
+ * (`settings`, wrunHostedSettingsRecord) and the packed host fills (`hostFill`) instead of the
53
+ * numeric param map, the cloud resolves them through the SDK as the browser does, and a compute
54
+ * edit or a theme change rides `changeSettings` (C5) instead of a recreate. A socket whose hello did
55
+ * not name it gets the numeric map and today's recreate, so the chart and kscript-backend deploy in
56
+ * either order. */
57
+ export declare const WRUN_SETTINGS_SERVER_CAP = "wrun-settings-v1";
58
+ /** The caps a hello's `serverCaps` holds: its non-empty strings, once each, in order; none for a
59
+ * value that is not an array. An unknown name is kept: a reader asks for the one cap it knows. */
60
+ export declare function readWrunServerCaps(value: unknown): string[];
61
+ /** True when a socket's server caps admit a market picker's text in the hosted param map; none
62
+ * (a server that sent no hello, or a socket whose hello has not landed) admit nothing. */
63
+ export declare function wrunServerAdmitsSymbolText(serverCaps: readonly string[] | undefined): boolean;
64
+ /** True when a socket's server caps admit the settings record and `changeSettings` for a hosted
65
+ * session (WRUN_SETTINGS_SERVER_CAP); none admit nothing. */
66
+ export declare function wrunServerAdmitsSettings(serverCaps: readonly string[] | undefined): boolean;
67
+ /** The known caps a carrier value holds, in the fixed order (WRUN_HOSTED_WIRE_CAPS). A value that is
68
+ * not an array reads as none; an unknown name or a repeat is dropped; the displacement and batched
69
+ * caps without the hosted wire cap are dropped too: they never ride alone. */
70
+ export declare function readWrunWireCaps(value: unknown): string[];
71
+ /** A carrier value as session identity: its known caps joined by a comma ('' for none). Two
72
+ * settings whose identities differ ask for different hosted sessions. */
73
+ export declare function wrunWireCapsIdentity(value: unknown): string;
74
+ /** True for a record whose own `wrunHost` is a record with `v === 1`: the package's
75
+ * `hasWrunHostedWire`, verdict for verdict, without loading the package. */
76
+ export declare function hasWrunHostedWire(output: unknown): boolean;
77
+ /** What an error frame's `details.wrunRefusal` names: the refusal's code, the stage that raised it and
78
+ * the facts its words need, never its sentence. */
79
+ export interface WrunFrameRefusal {
80
+ /** The kit's code, or the chart's name of the one uncoded answer (WRUN_NO_CANDLES_CODE). */
81
+ code: string;
82
+ /** The host stage that raised it (`validate`, `plan`, `shape`, `pack`, `align`, the lane's own). */
83
+ where?: string;
84
+ /** The input the refusal names. */
85
+ input?: string;
86
+ /** The presentation family it names. */
87
+ family?: string;
88
+ /** The count the lane refused (cells, secondary series, instances). */
89
+ count?: number;
90
+ /** The cap it was refused against. */
91
+ limit?: number;
92
+ /** The word it names: a pinned leg's interval, a venue, a market. */
93
+ value?: string;
94
+ }
95
+ /** The chart's name for the one answer kscript-backend still words without a code: its own fetch of
96
+ * the chart's market returned no candles in the asked window (wrun-lane.ts `transientDataFailure`,
97
+ * answered INTERNAL, so it keeps its retry). Read as a code here, the one sentence this leaf knows, so
98
+ * every reader past it reads codes only (row 37: the same `waiting` record as the browser lane's no
99
+ * bars). Retired once the backend codes the answer. */
100
+ export declare const WRUN_NO_CANDLES_CODE = "wrun_no_candles";
101
+ /**
102
+ * The trailer the kScript socket worker appends to an error frame's rethrown message when the frame's
103
+ * `details.wrunRefusal` names a coded refusal: ` (wrun-refusal: {"code":...})`, the details' known keys
104
+ * as JSON (wrunFrameRefusalOf reads it back); '' for any other frame.
105
+ */
106
+ export declare function wrunRefusalTrailer(details: unknown): string;
107
+ /** The own code of a wrun error frame (`[BAD_REQUEST]`, `[SOURCE_UNSUPPORTED]`, `[INTERNAL]`), or
108
+ * undefined for a text that is no wrun frame (a frame that names no package, the connection's
109
+ * instance cap among them, is none). */
110
+ export declare function wrunErrorFrameCodeOf(text: string): string | undefined;
111
+ /**
112
+ * The refusal an error text names: the details the socket worker relayed (wrunRefusalTrailer); else,
113
+ * on a wrun frame of an older server, the kit's code its sentence leads with; else the no-candles
114
+ * answer by its name (WRUN_NO_CANDLES_CODE). Undefined for anything else: a frame without a code
115
+ * keeps its frame code alone (wrunErrorFrameCodeOf).
116
+ */
117
+ export declare function wrunFrameRefusalOf(text: string): WrunFrameRefusal | undefined;
118
+ export type WrunServerAnswerVerdict = 'fatal' | 'retry' | 'stale' | 'show';
119
+ /** An error frame as the table reads it (the socket worker hands the frame itself; a reader past the worker hands
120
+ * what wrunServerAnswerOfText reads back from the rethrown text). */
121
+ export interface WrunServerAnswerFrame {
122
+ /** The frame's own code (`BAD_REQUEST`, `INTERNAL`, an eligibility code such as `SOURCE_UNSUPPORTED`). */
123
+ code?: unknown;
124
+ /** Its sentence as the server wrote it (a wrun frame's `WRUN <package>@<version>: ...`). */
125
+ message?: unknown;
126
+ /** Its details: `reason` and the coded refusal (`wrunRefusal`). */
127
+ details?: unknown;
128
+ /** A top-level reason (the interval refusal's tag rides there). */
129
+ reason?: unknown;
130
+ }
131
+ /** One frame's verdict and what decided it. */
132
+ export interface WrunServerAnswer {
133
+ verdict: WrunServerAnswerVerdict;
134
+ /** The table row that decided (the catalog spec and the debug ring name it). */
135
+ row: string;
136
+ /** The frame's own code, when it carried one. */
137
+ frameCode?: string;
138
+ /** The refusal the frame names: its relayed details, an older server's leading code, the no-candles answer. */
139
+ refusal?: WrunFrameRefusal;
140
+ /** The reason the frame gave (`details.reason`, the interval tag), or `superseded` read off its sentence. */
141
+ reason?: string;
142
+ /** How the answer is remembered (wrunFrameRefusalMemory): the protected control and the socket worker replay it. */
143
+ memory?: 'window' | 'identity';
144
+ /** The same ask buys the same answer: a remembered refusal, or one the kit raises at a stage that reads no data. */
145
+ repeats?: true;
146
+ /** No row knows the frame's code (or the refusal's): shown as a refusal that names it. */
147
+ unknownCode?: true;
148
+ }
149
+ /**
150
+ * The verdict of one error frame (see the table above): undefined for a value that names neither a frame code
151
+ * nor a coded refusal (no server answer at all). A frame code no row knows answers `show` with `unknownCode`.
152
+ */
153
+ export declare function wrunServerAnswerVerdict(frame: WrunServerAnswerFrame): WrunServerAnswer | undefined;
154
+ /**
155
+ * The verdict of an error text past the socket worker (only text crosses the worker boundary): the frame code at
156
+ * its head (or a wrun frame's anywhere in it), its sentence less the trailers the worker appended, the refusal
157
+ * the wrun trailer relays and the interval refusal's reason. Undefined for a text that is no server answer.
158
+ */
159
+ export declare function wrunServerAnswerOfText(text: string): WrunServerAnswer | undefined;
160
+ /**
161
+ * How a refused wrun ask is remembered (the protected worker control's create memory, the socket
162
+ * worker's settings memory, the socket row source's whole-run refusal): the answer table's `memory`
163
+ * (wrunServerAnswerVerdict) of a wrun frame: `window` for a refusal sized by the asked window, `identity`
164
+ * for one of a fixed property of the request or any eligibility frame (`[SOURCE_UNSUPPORTED]` and its
165
+ * siblings), null for everything else (a transient frame code, `[INTERNAL]` or `[FORBIDDEN]`, a retried
166
+ * refusal, a text that is no wrun frame).
167
+ */
168
+ export declare function wrunFrameRefusalMemory(text: string): 'window' | 'identity' | null;
169
+ /**
170
+ * The stage the kit's shared host raises each refusal it names at (`WRUN_HOST_REFUSALS[code].where`,
171
+ * packages/sdk/src/wrun-host/refusals.ts, shipped in `@orangecharts/indicator-kit/host`), in the kit's
172
+ * own order: validate reads the sheet, plan the sheet against the chart and the host, shape the
173
+ * module's own output; pack reads the fetched rows' cell blocks and align the fetched series, so their
174
+ * refusals turn on the window's data. Mirrored because host.js stays out of the boot graph
175
+ * (wrun-shared-host.ts) and the answer table above answers synchronously, in the socket worker too (this
176
+ * leaf imports nothing; wrun-refusal.util re-exports it); tests/utility/wrun/wrun-refusal.cloud.spec.ts
177
+ * holds it to the installed kit's table code by code, so a kit bump that adds or moves a code fails there
178
+ * by name.
179
+ */
180
+ export declare const WRUN_KIT_REFUSAL_STAGES: {
181
+ readonly validate: readonly ["wrun_abi_unsupported", "wrun_pin_venue_unknown", "wrun_sheet_over_cap", "wrun_abi_channel_missing", "wrun_intrabar_interval_required", "wrun_intrabar_primary", "wrun_candles_interval_required", "wrun_candles_primary", "wrun_options_chain_venue", "wrun_options_chain_expiries", "wrun_options_chain_market_pinned", "wrun_offset_needs_view", "wrun_offset_count_required", "wrun_bars_needs_leg", "wrun_chart_interval_below_needs_candles", "wrun_chart_interval_below_primary", "wrun_chart_interval_below_forming", "wrun_pin_venue_refused", "wrun_pin_symbol_literal", "wrun_tape_history_unavailable", "wrun_strategy_feed_not_ohlcv", "wrun_strategy_slippage_model_unsupported", "wrun_strategy_reserved_output", "wrun_tape_min_size_invalid"];
182
+ readonly plan: readonly ["wrun_options_coin_unknown", "wrun_source_unsupported", "wrun_field_unsupported", "wrun_tenor_unsupported", "wrun_view_unsupported", "wrun_family_unsupported", "wrun_displacement_needs_cap", "wrun_options_chain_venue_unavailable", "wrun_options_chain_unavailable", "wrun_options_chain_one_venue", "wrun_lane_input_refused", "wrun_permission_denied", "wrun_coin_leg_unsupported", "wrun_coin_leg_unresolved", "wrun_pin_unsupported", "wrun_custom_interval_unsupported", "wrun_intrabar_leg_off_grid", "wrun_intrabar_ratio_over_cap", "wrun_intrabar_unsupported", "wrun_candles_bars_over_cap", "wrun_candles_ratio_over_cap", "wrun_trade_volume_by_size_unsupported", "wrun_view_leg_off_grid", "wrun_view_leg_equal", "wrun_time_facts_unsupported", "wrun_etf_flow_unsupported", "wrun_volatility_index_unsupported", "wrun_long_short_ratio_unsupported", "wrun_options_oi_unsupported", "wrun_options_volume_unsupported", "wrun_ethena_positions_unsupported", "wrun_etf_holdings_unsupported", "wrun_etf_premium_unsupported", "wrun_economic_unsupported", "wrun_treasury_balance_unsupported", "wrun_bitfinex_funding_unsupported", "wrun_strategy_costs_in_sheet", "wrun_window_bars_invalid", "wrun_cells_unavailable", "wrun_tape_unavailable", "wrun_tape_interval_unsupported", "wrun_metric_source_missing_policy", "wrun_series_source_primary", "wrun_series_source_densification", "wrun_metric_pin_coarser_than_primary", "wrun_forming_primary_not_own_candles", "wrun_package_lock_invalid", "wrun_package_lock_missing", "wrun_package_not_installed", "wrun_package_lock_mismatch", "wrun_composition_cycle", "wrun_composition_depth", "wrun_options_chain_unsupported", "wrun_volume_profile_ticks_unsupported", "wrun_celled_metric_unsupported", "wrun_series_source_missing", "wrun_series_source_invalid", "wrun_params_invalid", "wrun_source_bindings_invalid", "wrun_output_displaced", "wrun_pin_unresolvable"];
183
+ readonly shape: readonly ["wrun_draw_kind_limit", "wrun_draw_total_limit", "wrun_draw_polyline_too_large", "wrun_draw_calls_per_row", "wrun_render_result_too_large", "wrun_draw_kind_mismatch", "wrun_draw_handle_missing", "wrun_draw_label_slot_absent", "wrun_draw_non_finite", "wrun_draw_phase", "wrun_draw_id_negative", "wrun_draw_kind_undeclared", "wrun_draw_prop_unknown", "wrun_draw_prop_unsupported", "wrun_draw_style_out_of_range", "wrun_draw_polyline_empty", "wrun_draw_polyline_out_of_bounds", "wrun_draw_label_slot_undeclared", "wrun_draw_polyline_budget", "wrun_strategy_id_limit", "wrun_strategy_id_too_long", "wrun_strategy_id_invalid_utf8", "wrun_strategy_calls_per_row", "wrun_strategy_trade_limit", "wrun_strategy_non_finite", "wrun_strategy_bad_direction", "wrun_strategy_not_declared", "wrun_strategy_phase", "wrun_strategy_id_out_of_bounds", "wrun_text_param_phase", "wrun_text_param_memory", "wrun_bar_count_phase", "wrun_frame_invalid", "wrun_frame_phase", "wrun_frame_undeclared", "wrun_frame_length", "wrun_frame_too_large", "wrun_frame_run_too_large", "wrun_frame_memory", "wrun_frame_utf8"];
184
+ readonly pack: readonly ["wrun_cell_block_invalid", "wrun_run_cells_too_large", "wrun_cell_block_too_large"];
185
+ readonly align: readonly ["wrun_densify_empty_fetch", "wrun_densify_mixed_phase", "wrun_liquidation_side_unmatched", "wrun_bound_series_empty", "wrun_cell_data_malformed"];
186
+ };
187
+ export type WrunKitRefusalStage = keyof typeof WRUN_KIT_REFUSAL_STAGES;
188
+ /** The kit stage a refusal code is raised at, or undefined for a code the kit's table does not hold
189
+ * (the lane's own caps, a code a newer kit added). */
190
+ export declare function wrunKitRefusalStageOf(code: string): WrunKitRefusalStage | undefined;
191
+ /** What a superseded marker says about the answer it settled. */
192
+ export interface WrunStaleAnswerNote {
193
+ /** The ask's socket stamp (`wrun-socket-<chart>-<overlay>-<n>`): the server's refusal line carries it too. */
194
+ clientRequestId?: string;
195
+ /** The answer frame's code; none for an attempt retired before its answer came. */
196
+ code?: string;
197
+ /** Why it was stale: `superseded` (the server said so), `replaced` (a newer attempt owns the overlay), `retired`
198
+ * (the chart ended the attempt at its delete, before the answer came). */
199
+ reason?: string;
200
+ /** The frame's sentence (a foreign supersede's Copy details). */
201
+ message?: string;
202
+ }
203
+ /** The marker field of a stale answer (the attempt was replaced or retired). */
204
+ export declare const WRUN_STALE_ANSWER_KEY = "wrunStaleAnswer";
205
+ /** The marker field of a foreign supersede (the server superseded the overlay's live attempt from elsewhere). */
206
+ export declare const WRUN_FOREIGN_SUPERSEDE_KEY = "wrunForeignSupersede";
207
+ /** The stale answer a worker reply's output carries, when the worker settled one (WRUN_STALE_ANSWER_KEY). */
208
+ export declare function wrunStaleAnswerOf(output: unknown): WrunStaleAnswerNote | undefined;
209
+ /** The foreign supersede a worker reply's output carries, when the worker settled one (WRUN_FOREIGN_SUPERSEDE_KEY). */
210
+ export declare function wrunForeignSupersedeOf(output: unknown): WrunStaleAnswerNote | undefined;
211
+ /**
212
+ * The stale-settle hook: the cloud lane's transport calls it for every answer the socket worker settled as stale
213
+ * (WRUN_STALE_ANSWER_KEY), so the monitoring joins the chart's settles to the server's refusal lines by
214
+ * `clientRequestId`. A listener that throws never reaches the caller.
215
+ */
216
+ export declare function onWrunAnswerStale(note: WrunStaleAnswerNote): void;
217
+ /** Subscribe to the stale-settle hook (onWrunAnswerStale); returns the unsubscribe. */
218
+ export declare function subscribeWrunAnswerStale(listener: (note: WrunStaleAnswerNote) => void): () => void;