@orangecharts/wrun-chart-host 0.11.0 → 0.14.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 (311) hide show
  1. package/README.md +1 -0
  2. package/dist/constants/feature-flags.constants.d.ts +3 -4
  3. package/dist/constants/feature-flags.constants.js +34 -52
  4. package/dist/constants/feature-limits.constants.d.ts +1 -1
  5. package/dist/constants/feature-limits.constants.js +5 -4
  6. package/dist/constants/interval.constants.d.ts +7 -0
  7. package/dist/constants/interval.constants.js +7 -0
  8. package/dist/constants/scriptEditor/cme-official-scripts.constants.d.ts +20 -149
  9. package/dist/constants/scriptEditor/cme-official-scripts.constants.js +20 -309
  10. package/dist/constants/stocks-compliance.constants.d.ts +15 -0
  11. package/dist/constants/stocks-compliance.constants.js +15 -0
  12. package/dist/host-env.d.ts +55 -3
  13. package/dist/host-env.js +6 -0
  14. package/dist/host-ports.types.d.ts +36 -3
  15. package/dist/index.d.ts +18 -0
  16. package/dist/index.js +19 -0
  17. package/dist/indicators/controls/tpo-session.util.d.ts +78 -15
  18. package/dist/indicators/controls/tpo-session.util.js +320 -242
  19. package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +6 -0
  20. package/dist/instances/script-engine-worker-ohlcv-transfer.js +16 -0
  21. package/dist/interfaces/cme-realtime.interface.d.ts +8 -0
  22. package/dist/interfaces/cme-realtime.interface.js +2 -1
  23. package/dist/interfaces/feed.interface.d.ts +15 -1
  24. package/dist/interfaces/replay.interface.d.ts +5 -0
  25. package/dist/interfaces/stocks-realtime.interface.d.ts +4 -3
  26. package/dist/interfaces/stocks-realtime.interface.js +5 -4
  27. package/dist/interfaces/wrun-runtime.interface.d.ts +97 -19
  28. package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +17 -0
  29. package/dist/kscript-data/controls/live-ohlcv-merge.util.js +22 -0
  30. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +46 -40
  31. package/dist/kscript-data/controls/live-trades-merge.util.js +80 -107
  32. package/dist/market-data/billing.interface.d.ts +9 -1
  33. package/dist/market-data/venue.d.ts +1 -1
  34. package/dist/market-data/venues/index.d.ts +4 -4
  35. package/dist/market-data/venues/stocks.contract.copy.json +4 -4
  36. package/dist/market-data/venues/stocks.d.ts +4 -4
  37. package/dist/market-data/venues/stocks.js +15 -13
  38. package/dist/settings-templates/frvp-fields.d.ts +12 -1
  39. package/dist/settings-templates/frvp-fields.js +15 -4
  40. package/dist/settings-templates/index.js +12 -5
  41. package/dist/settings-templates/indicator-fields.js +28 -2
  42. package/dist/settings-templates/tool-rules.d.ts +17 -8
  43. package/dist/settings-templates/tool-rules.js +15 -8
  44. package/dist/settings-templates/tool-tables.generated.js +4 -2
  45. package/dist/utility/auth/server-clock.util.d.ts +3 -1
  46. package/dist/utility/auth/server-clock.util.js +3 -1
  47. package/dist/utility/chart/book-live-bucket.util.js +2 -2
  48. package/dist/utility/chart/cache-alignment.util.d.ts +15 -7
  49. package/dist/utility/chart/cache-alignment.util.js +14 -7
  50. package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +2 -0
  51. package/dist/utility/chart/chart-data-fetch-generation.util.js +16 -0
  52. package/dist/utility/chart/cme-session-bucket.util.d.ts +18 -75
  53. package/dist/utility/chart/cme-session-bucket.util.js +25 -332
  54. package/dist/utility/chart/continuous-contracts.util.js +6 -5
  55. package/dist/utility/chart/display-offset.leaf.d.ts +24 -0
  56. package/dist/utility/chart/display-offset.leaf.js +41 -0
  57. package/dist/utility/chart/effective-chart-session.util.d.ts +2 -1
  58. package/dist/utility/chart/effective-chart-session.util.js +13 -5
  59. package/dist/utility/chart/feed-interval.util.d.ts +6 -20
  60. package/dist/utility/chart/feed-interval.util.js +13 -22
  61. package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +27 -7
  62. package/dist/utility/chart/fetch-dedupe-policy.util.js +86 -11
  63. package/dist/utility/chart/host-bar-placement.util.d.ts +7 -4
  64. package/dist/utility/chart/host-bar-placement.util.js +8 -2
  65. package/dist/utility/chart/indicator-inflight-registry.util.d.ts +32 -0
  66. package/dist/utility/chart/indicator-inflight-registry.util.js +52 -0
  67. package/dist/utility/chart/indicator-run-interval.util.d.ts +10 -4
  68. package/dist/utility/chart/indicator-run-interval.util.js +21 -12
  69. package/dist/utility/chart/interval-registry.util.d.ts +1 -1
  70. package/dist/utility/chart/interval-registry.util.js +1 -1
  71. package/dist/utility/chart/kscript-legend-entries.util.d.ts +12 -0
  72. package/dist/utility/chart/kscript-legend-entries.util.js +16 -0
  73. package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +1 -1
  74. package/dist/utility/chart/kscript-run-interval-projection.util.js +4 -2
  75. package/dist/utility/chart/kscript-venue-policy.util.d.ts +53 -62
  76. package/dist/utility/chart/kscript-venue-policy.util.js +85 -94
  77. package/dist/utility/chart/live-bucket.util.d.ts +39 -17
  78. package/dist/utility/chart/live-bucket.util.js +103 -57
  79. package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +58 -20
  80. package/dist/utility/chart/local-kscript-source-revalidation.util.js +98 -23
  81. package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +35 -11
  82. package/dist/utility/chart/local-kscript-warmup-depth.util.js +24 -3
  83. package/dist/utility/chart/market-session-schedule.util.d.ts +8 -0
  84. package/dist/utility/chart/market-session-schedule.util.js +39 -1
  85. package/dist/utility/chart/market-session.util.d.ts +136 -0
  86. package/dist/utility/chart/market-session.util.js +341 -0
  87. package/dist/utility/chart/market-sessions.util.d.ts +83 -0
  88. package/dist/utility/chart/market-sessions.util.js +220 -0
  89. package/dist/utility/chart/om-panel.util.d.ts +5 -3
  90. package/dist/utility/chart/om-panel.util.js +42 -7
  91. package/dist/utility/chart/om-target.util.d.ts +14 -1
  92. package/dist/utility/chart/om-target.util.js +22 -5
  93. package/dist/utility/chart/opra-read-access.leaf.d.ts +16 -1
  94. package/dist/utility/chart/opra-read-access.leaf.js +22 -0
  95. package/dist/utility/chart/profile-row-height.util.d.ts +49 -16
  96. package/dist/utility/chart/profile-row-height.util.js +74 -37
  97. package/dist/utility/chart/rth-session.util.d.ts +55 -20
  98. package/dist/utility/chart/rth-session.util.js +94 -46
  99. package/dist/utility/chart/session-interval.util.d.ts +2 -1
  100. package/dist/utility/chart/session-interval.util.js +1 -3
  101. package/dist/utility/chart/session-lattice.util.d.ts +150 -0
  102. package/dist/utility/chart/session-lattice.util.js +488 -0
  103. package/dist/utility/chart/trading-day.util.d.ts +40 -2
  104. package/dist/utility/chart/trading-day.util.js +84 -7
  105. package/dist/utility/chart/us-equities-session.util.d.ts +32 -11
  106. package/dist/utility/chart/us-equities-session.util.js +44 -15
  107. package/dist/utility/chart/window-geometry.leaf.d.ts +28 -7
  108. package/dist/utility/chart/window-geometry.leaf.js +57 -8
  109. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +21 -14
  110. package/dist/utility/chart/wrun-bar-session-facts.util.js +32 -38
  111. package/dist/utility/chart/wrun-run-result.util.d.ts +29 -12
  112. package/dist/utility/chart/wrun-run-result.util.js +89 -25
  113. package/dist/utility/common/time.util.js +5 -4
  114. package/dist/utility/market-events/earnings-scope.util.d.ts +10 -5
  115. package/dist/utility/market-events/earnings-scope.util.js +17 -9
  116. package/dist/utility/market-events/market-events.util.d.ts +14 -7
  117. package/dist/utility/market-events/market-events.util.js +30 -17
  118. package/dist/utility/number-format.util.d.ts +14 -21
  119. package/dist/utility/number-format.util.js +38 -24
  120. package/dist/utility/options/option-venue-disclosure.util.d.ts +40 -6
  121. package/dist/utility/options/option-venue-disclosure.util.js +71 -11
  122. package/dist/utility/options/option-venue.util.d.ts +1 -1
  123. package/dist/utility/options/option-venue.util.js +1 -1
  124. package/dist/utility/pool-symbol.leaf.d.ts +7 -0
  125. package/dist/utility/pool-symbol.leaf.js +50 -5
  126. package/dist/utility/stocks/stock-display.util.d.ts +15 -0
  127. package/dist/utility/stocks/stock-display.util.js +37 -0
  128. package/dist/utility/symbol-selection/contract-expiry.util.js +5 -4
  129. package/dist/utility/v2/gate-plane.util.d.ts +6 -0
  130. package/dist/utility/v2/gate-plane.util.js +11 -1
  131. package/dist/utility/v2/gate-session-latch.util.d.ts +1 -1
  132. package/dist/utility/v2/gate-session-latch.util.js +3 -3
  133. package/dist/utility/v2/governed-tier.leaf.d.ts +17 -16
  134. package/dist/utility/v2/governed-tier.leaf.js +17 -16
  135. package/dist/utility/v2/stocks-governed.util.d.ts +5 -0
  136. package/dist/utility/v2/stocks-governed.util.js +14 -0
  137. package/dist/utility/v2/v2-enums.leaf.d.ts +13 -0
  138. package/dist/utility/v2/v2-enums.leaf.js +458 -0
  139. package/dist/utility/wrun/derived-roots.leaf.d.ts +21 -1
  140. package/dist/utility/wrun/derived-roots.leaf.js +27 -1
  141. package/dist/utility/wrun/derived-roots.util.d.ts +44 -32
  142. package/dist/utility/wrun/derived-roots.util.js +97 -56
  143. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -3
  144. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -3
  145. package/dist/utility/wrun/sources/lanes/option_daily.d.ts +2 -1
  146. package/dist/utility/wrun/sources/lanes/option_daily.js +2 -1
  147. package/dist/utility/wrun/sources/lanes/options_flow.d.ts +3 -0
  148. package/dist/utility/wrun/sources/lanes/options_flow.js +23 -5
  149. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +3 -4
  150. package/dist/utility/wrun/sources/row-lane-registry.js +9 -4
  151. package/dist/utility/wrun/sources/row-lanes/dark_pool.d.ts +19 -0
  152. package/dist/utility/wrun/sources/row-lanes/dark_pool.js +104 -0
  153. package/dist/utility/wrun/sources/row-lanes/index.js +2 -0
  154. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.d.ts +20 -0
  155. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.js +103 -0
  156. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -2
  157. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +15 -13
  158. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +49 -23
  159. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +14 -9
  160. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +75 -27
  161. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +139 -82
  162. package/dist/utility/wrun/wrun-app-layer.leaf.d.ts +78 -0
  163. package/dist/utility/wrun/wrun-app-layer.leaf.js +89 -0
  164. package/dist/utility/wrun/wrun-bar-count.util.d.ts +11 -7
  165. package/dist/utility/wrun/wrun-bar-count.util.js +12 -8
  166. package/dist/utility/wrun/wrun-batched-kinds.leaf.d.ts +13 -0
  167. package/dist/utility/wrun/wrun-batched-kinds.leaf.js +18 -0
  168. package/dist/utility/wrun/wrun-batched-marks.util.d.ts +41 -22
  169. package/dist/utility/wrun/wrun-batched-marks.util.js +255 -59
  170. package/dist/utility/wrun/wrun-batched-readout.util.d.ts +26 -19
  171. package/dist/utility/wrun/wrun-batched-readout.util.js +81 -27
  172. package/dist/utility/wrun/wrun-book-bands.leaf.d.ts +8 -0
  173. package/dist/utility/wrun/wrun-book-bands.leaf.js +7 -0
  174. package/dist/utility/wrun/wrun-candle-equal.leaf.d.ts +19 -0
  175. package/dist/utility/wrun/wrun-candle-equal.leaf.js +40 -0
  176. package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -2
  177. package/dist/utility/wrun/wrun-canvases.util.js +7 -3
  178. package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +6 -3
  179. package/dist/utility/wrun/wrun-chart-context-names.util.js +8 -4
  180. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +47 -29
  181. package/dist/utility/wrun/wrun-chart-market-facts.util.js +201 -201
  182. package/dist/utility/wrun/wrun-child-overlay-id.util.js +2 -1
  183. package/dist/utility/wrun/wrun-cme-legs-note.util.d.ts +15 -0
  184. package/dist/utility/wrun/wrun-cme-legs-note.util.js +49 -0
  185. package/dist/utility/wrun/wrun-cme-root-specs.util.d.ts +38 -0
  186. package/dist/utility/wrun/wrun-cme-root-specs.util.js +81 -0
  187. package/dist/utility/wrun/wrun-coin-lane-live.util.js +3 -0
  188. package/dist/utility/wrun/wrun-color-settings.util.d.ts +6 -1
  189. package/dist/utility/wrun/wrun-color-settings.util.js +32 -7
  190. package/dist/utility/wrun/wrun-dark-pool.util.d.ts +50 -0
  191. package/dist/utility/wrun/wrun-dark-pool.util.js +127 -0
  192. package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +67 -12
  193. package/dist/utility/wrun/wrun-declared-warmup.util.js +165 -13
  194. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +18 -8
  195. package/dist/utility/wrun/wrun-draft-legend-note.util.js +57 -11
  196. package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +14 -10
  197. package/dist/utility/wrun/wrun-draft-overlay.util.js +26 -14
  198. package/dist/utility/wrun/wrun-earnings-facts.util.js +3 -2
  199. package/dist/utility/wrun/wrun-etf-funds.util.d.ts +2 -0
  200. package/dist/utility/wrun/wrun-etf-funds.util.js +4 -0
  201. package/dist/utility/wrun/wrun-held-lanes.util.js +8 -2
  202. package/dist/utility/wrun/wrun-history-as-of.util.d.ts +77 -0
  203. package/dist/utility/wrun/wrun-history-as-of.util.js +108 -0
  204. package/dist/utility/wrun/wrun-host.service.d.ts +64 -14
  205. package/dist/utility/wrun/wrun-host.service.js +137 -27
  206. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +3 -3
  207. package/dist/utility/wrun/wrun-hosted-wire-caps.js +12 -2
  208. package/dist/utility/wrun/wrun-inert-legend.util.d.ts +13 -0
  209. package/dist/utility/wrun/wrun-inert-legend.util.js +31 -3
  210. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +7 -5
  211. package/dist/utility/wrun/wrun-input-requirements.leaf.js +16 -6
  212. package/dist/utility/wrun/wrun-install-pacer.util.d.ts +26 -0
  213. package/dist/utility/wrun/wrun-install-pacer.util.js +145 -0
  214. package/dist/utility/wrun/wrun-kit-refusal-stages.types.d.ts +22 -0
  215. package/dist/utility/wrun/wrun-kit-refusal-stages.types.js +1 -0
  216. package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +12 -5
  217. package/dist/utility/wrun/wrun-lane-refusal.leaf.js +23 -5
  218. package/dist/utility/wrun/wrun-lane-warmup.util.js +22 -4
  219. package/dist/utility/wrun/wrun-leg-close.util.d.ts +6 -5
  220. package/dist/utility/wrun/wrun-leg-close.util.js +11 -9
  221. package/dist/utility/wrun/wrun-leg-fetch.util.d.ts +3 -1
  222. package/dist/utility/wrun/wrun-leg-fetch.util.js +9 -2
  223. package/dist/utility/wrun/wrun-levels-child.util.d.ts +2 -0
  224. package/dist/utility/wrun/wrun-levels-child.util.js +6 -0
  225. package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -0
  226. package/dist/utility/wrun/wrun-live-intake.util.d.ts +15 -6
  227. package/dist/utility/wrun/wrun-live-intake.util.js +167 -47
  228. package/dist/utility/wrun/wrun-live-tick.util.d.ts +52 -8
  229. package/dist/utility/wrun/wrun-live-tick.util.js +648 -97
  230. package/dist/utility/wrun/wrun-market-facts.util.d.ts +16 -2
  231. package/dist/utility/wrun/wrun-market-facts.util.js +32 -3
  232. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +27 -27
  233. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +28 -16
  234. package/dist/utility/wrun/wrun-market-size-defaults.util.js +34 -5
  235. package/dist/utility/wrun/wrun-oi-lane.util.d.ts +10 -7
  236. package/dist/utility/wrun/wrun-oi-lane.util.js +16 -10
  237. package/dist/utility/wrun/wrun-option-strike-flow.util.js +1 -1
  238. package/dist/utility/wrun/wrun-option-views.util.d.ts +2 -2
  239. package/dist/utility/wrun/wrun-option-views.util.js +5 -2
  240. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.d.ts +5 -0
  241. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.js +16 -0
  242. package/dist/utility/wrun/wrun-options-stop.util.d.ts +3 -2
  243. package/dist/utility/wrun/wrun-options-stop.util.js +6 -4
  244. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +75 -11
  245. package/dist/utility/wrun/wrun-overlay-drivers.util.js +176 -43
  246. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +20 -10
  247. package/dist/utility/wrun/wrun-overlay-park.util.d.ts +84 -0
  248. package/dist/utility/wrun/wrun-overlay-park.util.js +135 -0
  249. package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +37 -4
  250. package/dist/utility/wrun/wrun-overlay-recovery.util.js +26 -14
  251. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +239 -24
  252. package/dist/utility/wrun/wrun-overlay-run.util.js +2204 -405
  253. package/dist/utility/wrun/wrun-pack.util.d.ts +8 -5
  254. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +2 -1
  255. package/dist/utility/wrun/wrun-panel-mount.util.js +20 -14
  256. package/dist/utility/wrun/wrun-panel-style.util.d.ts +4 -2
  257. package/dist/utility/wrun/wrun-panel-style.util.js +3 -2
  258. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +7 -0
  259. package/dist/utility/wrun/wrun-pin-spelling.util.js +18 -4
  260. package/dist/utility/wrun/wrun-pin-venues.util.d.ts +26 -17
  261. package/dist/utility/wrun/wrun-pin-venues.util.js +43 -36
  262. package/dist/utility/wrun/wrun-pinned-lanes.util.d.ts +58 -0
  263. package/dist/utility/wrun/wrun-pinned-lanes.util.js +72 -0
  264. package/dist/utility/wrun/wrun-prefix-cohort.util.js +2 -1
  265. package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +22 -9
  266. package/dist/utility/wrun/wrun-prefix-lanes.util.js +145 -26
  267. package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +29 -0
  268. package/dist/utility/wrun/wrun-prefix-proof.util.js +23 -5
  269. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +9 -1
  270. package/dist/utility/wrun/wrun-refusal-surface.util.js +15 -1
  271. package/dist/utility/wrun/wrun-refusal.util.d.ts +19 -1
  272. package/dist/utility/wrun/wrun-refusal.util.js +103 -16
  273. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +20 -6
  274. package/dist/utility/wrun/wrun-registry-errors.util.js +20 -6
  275. package/dist/utility/wrun/wrun-replay-rows.util.js +6 -10
  276. package/dist/utility/wrun/wrun-run-health.util.d.ts +89 -2
  277. package/dist/utility/wrun/wrun-run-health.util.js +204 -1
  278. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +2 -2
  279. package/dist/utility/wrun/wrun-run-interval-session.util.js +2 -2
  280. package/dist/utility/wrun/wrun-run-interval.util.d.ts +9 -8
  281. package/dist/utility/wrun/wrun-run-interval.util.js +13 -11
  282. package/dist/utility/wrun/wrun-sandbox-row-source.js +5 -2
  283. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +13 -3
  284. package/dist/utility/wrun/wrun-script-inputs.util.js +51 -13
  285. package/dist/utility/wrun/wrun-session-composition.util.d.ts +81 -0
  286. package/dist/utility/wrun/wrun-session-composition.util.js +169 -0
  287. package/dist/utility/wrun/wrun-setting-words.util.d.ts +10 -7
  288. package/dist/utility/wrun/wrun-setting-words.util.js +25 -7
  289. package/dist/utility/wrun/wrun-source-rows.util.d.ts +94 -28
  290. package/dist/utility/wrun/wrun-source-rows.util.js +738 -93
  291. package/dist/utility/wrun/wrun-stream-clock.util.d.ts +45 -0
  292. package/dist/utility/wrun/wrun-stream-clock.util.js +108 -0
  293. package/dist/utility/wrun/wrun-tape-coins.util.d.ts +116 -0
  294. package/dist/utility/wrun/wrun-tape-coins.util.js +110 -0
  295. package/dist/utility/wrun/wrun-tape-source.util.d.ts +62 -32
  296. package/dist/utility/wrun/wrun-tape-source.util.js +72 -34
  297. package/dist/utility/wrun/wrun-tier-grid.util.d.ts +13 -5
  298. package/dist/utility/wrun/wrun-tier-grid.util.js +23 -13
  299. package/dist/utility/wrun/wrun-tpo-rows.util.js +2 -1
  300. package/dist/utility/wrun/wrun-trades-lane.util.d.ts +73 -0
  301. package/dist/utility/wrun/wrun-trades-lane.util.js +82 -0
  302. package/dist/utility/wrun/wrun-twin-compute-inputs.util.d.ts +5 -0
  303. package/dist/utility/wrun/wrun-twin-compute-inputs.util.js +9 -2
  304. package/dist/utility/wrun/wrun-visibility-table.d.ts +13 -0
  305. package/dist/utility/wrun/wrun-visibility-table.js +9 -0
  306. package/dist/utility/wrun/wrun-volume-profile.util.js +44 -32
  307. package/dist/utils/replay/replay-buffer-math.d.ts +16 -6
  308. package/dist/utils/replay/replay-buffer-math.js +60 -30
  309. package/dist/workers/constants/socket-slots.d.ts +11 -7
  310. package/dist/workers/constants/socket-slots.js +6 -5
  311. package/package.json +11 -11
@@ -9,7 +9,7 @@
9
9
  * label, with no sentinel. An unmapped label falls back to MINUTE
10
10
  * (`grpcIntervalOf`), so a label missing here would paint 1m candles.
11
11
  */
12
- import { AggregationInterval } from '@orangecharts/orange-v2-pb-common';
12
+ import { AggregationInterval } from '../v2/v2-enums.leaf.js';
13
13
  export { CUSTOM_INTERVALS, EXTENDED_INTERVALS, intervalLabelForMs, intervalMs, isCustomInterval, isExtendedInterval, standardIntervalAtOrBelow, standardIntervalMsAtOrBelow, type CustomInterval, type ExtendedInterval, } from './interval-ladder.util.js';
14
14
  /** The wire interval for a standard or custom label, `undefined` for anything else. */
15
15
  export declare function lookupGrpcInterval(label: unknown): AggregationInterval | undefined;
@@ -9,7 +9,7 @@
9
9
  * label, with no sentinel. An unmapped label falls back to MINUTE
10
10
  * (`grpcIntervalOf`), so a label missing here would paint 1m candles.
11
11
  */
12
- import { AggregationInterval } from '@orangecharts/orange-v2-pb-common';
12
+ import { AggregationInterval } from '../v2/v2-enums.leaf.js';
13
13
  import { intervalMs } from './interval-ladder.util.js';
14
14
  // The label half (the labels, their lengths and the tuning ladder) is the pure leaf's (interval-ladder.util); its
15
15
  // importers keep this path.
@@ -67,6 +67,18 @@ export declare function kScriptLegendSlotIds(): string[];
67
67
  export declare function kScriptLegendSlotCells(): Array<KScriptLegendEntry & {
68
68
  isStatic: false;
69
69
  }>;
70
+ /**
71
+ * A plot that answers no hover card (`hover_card: false` on its run output: a
72
+ * wrun output its sheet keeps off the card, or a mount the adapter knows paints
73
+ * no ink, such as a transparent fill side or an opacity-0 output). It is still
74
+ * drawn, listed and read: only the hover surfaces skip it (the series hover
75
+ * walks past it to the next nearest line, the legend value answers no card),
76
+ * never kScriptLegendLines, whose `includeUnlisted` set also feeds the readers
77
+ * of other outputs' values. The engine never emits the field. Titan does not
78
+ * copy it onto the nested meta, so the run output the meta was mounted from is
79
+ * read too, like optsOutOfLegend.
80
+ */
81
+ export declare function optsOutOfHover(meta: unknown, nested: Record<string, unknown>): boolean;
70
82
  /**
71
83
  * The nested outputs that earn a legend slot, in declaration order, capped at
72
84
  * the pool size. `includeUnlisted` also returns the drawn value plots a run
@@ -131,6 +131,22 @@ function isLegendValuePlot(nested) {
131
131
  function optsOutOfLegend(meta, nested) {
132
132
  return nested.legend === false || kScriptRunOutputFor(meta, nested)?.legend === false;
133
133
  }
134
+ /**
135
+ * A plot that answers no hover card (`hover_card: false` on its run output: a
136
+ * wrun output its sheet keeps off the card, or a mount the adapter knows paints
137
+ * no ink, such as a transparent fill side or an opacity-0 output). It is still
138
+ * drawn, listed and read: only the hover surfaces skip it (the series hover
139
+ * walks past it to the next nearest line, the legend value answers no card),
140
+ * never kScriptLegendLines, whose `includeUnlisted` set also feeds the readers
141
+ * of other outputs' values. The engine never emits the field. Titan does not
142
+ * copy it onto the nested meta, so the run output the meta was mounted from is
143
+ * read too, like optsOutOfLegend.
144
+ */
145
+ export function optsOutOfHover(meta, nested) {
146
+ if (nested.hover_card === false)
147
+ return true;
148
+ return isRecord(meta) && kScriptRunOutputFor(meta, nested)?.hover_card === false;
149
+ }
134
150
  /**
135
151
  * The nested outputs that earn a legend slot, in declaration order, capped at
136
152
  * the pool size. `includeUnlisted` also returns the drawn value plots a run
@@ -33,7 +33,7 @@
33
33
  */
34
34
  import { type OverlayRunInterval } from './indicator-run-interval.util.js';
35
35
  /** What the projection reads of a run's stamp. */
36
- type ProjectionRunInterval = Pick<OverlayRunInterval, 'intervalMs' | 'waitForClose' | 'sessionLattice'>;
36
+ type ProjectionRunInterval = Pick<OverlayRunInterval, 'intervalMs' | 'waitForClose' | 'sessionLattice' | 'sessionLatticeId'>;
37
37
  /**
38
38
  * The run result of an overlay whose engine ran at `runInterval`, projected onto the chart bars at
39
39
  * `chartTimes` (ascending open times). Returns `runResult` itself when it carries nothing on a time
@@ -183,7 +183,7 @@ function buildProjection(timeline, chartTimes, run, aheadFrom) {
183
183
  // last bar. Behind the chart (a windowed replay, a run that has not seen the new bucket yet) it is
184
184
  // a closed bar like every other.
185
185
  const showsForming = !waitForClose && lastChartTime >= newestSpan.open && lastChartTime < newestSpan.close;
186
- const shownRows = projectRunRowsOntoChart(timeline.map((time, index) => [time, index]), chartTimes, runMs, !showsForming, lattice);
186
+ const shownRows = projectRunRowsOntoChart(timeline.map((time, index) => [time, index]), chartTimes, runMs, !showsForming, lattice, run.sessionLatticeId);
187
187
  // From here on a chart bar shows the run bar after the newest one, which this result does not carry
188
188
  // (on the session lattice the first one past a gap: a weekend or a holiday holds none).
189
189
  const coverageEnd = nextRunBarCloseMs(newest, chartTimes, run);
@@ -208,7 +208,9 @@ function buildProjection(timeline, chartTimes, run, aheadFrom) {
208
208
  // leaves those times as they are.
209
209
  const shiftsAhead = waitForClose && lastChartTime >= newestSpan.close;
210
210
  const aheadAt = (time) => (shiftsAhead ? runBarSpan(time, run).close : time);
211
- const anchor = (time) => time > newest ? aheadAt(time) : projectRunTimeOntoChart(time, chartTimes, runMs, waitsForClose(time), lattice);
211
+ const anchor = (time) => time > newest
212
+ ? aheadAt(time)
213
+ : projectRunTimeOntoChart(time, chartTimes, runMs, waitsForClose(time), lattice, run.sessionLatticeId);
212
214
  // projectRunTimeOntoChart's target: the run bar's close (its open while it forms, wait for close off).
213
215
  const shownAt = (time) => {
214
216
  if (time > newest)
@@ -16,9 +16,9 @@
16
16
  * first-party one (`isOpraUserScriptRun`, the same three doors). The US stocks
17
17
  * tape is open to user-authored indicators too, in the browser and on the
18
18
  * cloud lane (Kyle 2026-10-29), on the tapes STOCKS_TAPE_SCRIPTING_VENUES
19
- * lists, the one compliance switch (`isStocksTapeReadableKScriptRun`); a tape
20
- * it leaves out (NASDAQ_TAPE until the UTP derived-data answer) stays
21
- * first-party only. Each plane reads its own gate alone: no plane's decision
19
+ * lists, the one compliance switch (`isStocksTapeReadableKScriptRun`): every
20
+ * tape since Kyle 2026-11-06; a tape it leaves out would stay first-party
21
+ * only. Each plane reads its own gate alone: no plane's decision
22
22
  * opens another. The data tier belongs to the viewer, never to the script: the
23
23
  * browser lane reads through the viewer's own gate sockets. This module is the
24
24
  * single decider for every plane.
@@ -91,6 +91,13 @@ export interface KScriptProvenanceSettingsLike {
91
91
  * and stays walled on governed venues until its scope joins
92
92
  * WRUN_OFFICIAL_SCOPES (fail closed).
93
93
  *
94
+ * An app layer (wrun-app-layer.leaf: `wrunDraftRef.appLayer`) is the one
95
+ * draft-lane run that qualifies: the app mounts it for one of its own panels
96
+ * from the kit template its pinned kit ships under the official package the
97
+ * table names, so the code that runs is the app's own; no user run can name
98
+ * one (the draft mount builds its ref from fixed fields, and no persisted
99
+ * record ever carries a draft in).
100
+ *
94
101
  * Fail closed on every other shape: an editor draft (`wrunDraftRef`, or a
95
102
  * `wrun-draft-*` id) and a temp editor run are never packages, whatever rides
96
103
  * beside them; EVERY package identity the record carries (the browser lane's
@@ -175,8 +182,10 @@ export declare function isCmeUserScriptCandidate(settings: KScriptProvenanceSett
175
182
  */
176
183
  export declare function isCmeUserScriptRun(settings: KScriptProvenanceSettingsLike | null | undefined): boolean;
177
184
  /** Whether a run may consume the CME plane's data: every first-party run, and a user run the `cme-user-scripts` gate
178
- * opened it to (`isCmeUserScriptRun`). */
185
+ * opened it to (`isCmeUserScriptRun`; `mayReadCmePin`, the one decision a wrun run's CME pins read too). */
179
186
  export declare function isCmeReadableKScriptRun(settings: KScriptProvenanceSettingsLike | null | undefined): boolean;
187
+ /** A CME chart study: a user run the gate opened the CME plane to, on a CME chart (the run head's `cmeStudyChain`). */
188
+ export declare function isCmeChartStudyRun(settings: KScriptProvenanceSettingsLike | null | undefined, chartExchange: unknown): boolean;
180
189
  /** The words a door shows a user run the CME wall refuses (web locale keys, `cmeUserScriptWallKey`), and the
181
190
  * lifecycle's words for a study a closing gate stopped in place, its source kept (`CME_STUDY_STOPPED_KEY`: the
182
191
  * viewer's access moved; `CME_STUDIES_OFF_KEY`: the flag went dark). */
@@ -192,12 +201,27 @@ export type CmeUserScriptWallKey = typeof CME_USER_SCRIPT_WALL_KEY | typeof CME_
192
201
  * (`CME_USER_SCRIPT_WALL_KEY`): the feature does not exist for that viewer, so no door names a browser lane it cannot
193
202
  * offer. Under a lit flag a hosted (Cloud) record or a protected script has no CME path (`CME_CLOUD_WALL_KEY`: CME chart
194
203
  * studies run in the browser), and a run the browser executes is refused only for the viewer's
195
- * entitlement (`CME_ENTITLEMENT_REQUIRED_KEY`: the CME data terms). A first-party run is never this wall's (the doors
196
- * word the curation themselves) and reads today's words. Words only: whether the door opens is the walls' decision
204
+ * entitlement (`CME_ENTITLEMENT_REQUIRED_KEY`: the CME data terms). A first-party run is never refused on CME and reads
205
+ * today's words. Words only: whether the door opens is the walls' decision
197
206
  * (`isKScriptDisplayBlockedOnExchange`, `isCmeReadableKScriptRun`).
198
207
  */
199
208
  export declare function cmeUserScriptWallKey(settings: KScriptProvenanceSettingsLike | null | undefined): CmeUserScriptWallKey;
200
- /** Whether a source exchange touches a CME-governed venue (the CME-only curation and copy). */
209
+ /** The words of a CME pin a closed gate refuses (wrun-refusal.util `pin-refused`): the flag dark (`default`), the
210
+ * viewer's CME data terms (`terms`), a server lane (`cloud`). */
211
+ export type CmePinRefusalVariant = 'default' | 'terms' | 'cloud';
212
+ /** `cmeUserScriptWallKey`'s lane rule in the pin row's words: derived from it, so the two never drift. */
213
+ export declare function cmePinRefusalVariant(settings: KScriptProvenanceSettingsLike | null | undefined): CmePinRefusalVariant;
214
+ /** The words a door shows a user run a US stocks tape refuses (web locale key; `{venue}` names the tape's venue). */
215
+ export declare const STOCKS_USER_SCRIPT_WALL_KEY = "indicators.stocks.userScriptNotSupported";
216
+ /** A door's words for a venue wall: a web locale key and the params it reads. */
217
+ export interface VenueWallWords {
218
+ key: string;
219
+ params: Readonly<Record<string, string>>;
220
+ }
221
+ /** The ONE choice of a door's words for a user run a wall refused, by the walled market's plane (words only, never
222
+ * whether): a venue no plane governs, which no wall refuses, keeps the CME words every door showed before. */
223
+ export declare function venueWallWords(exchange: unknown, settings: KScriptProvenanceSettingsLike | null | undefined): VenueWallWords;
224
+ /** Whether a source exchange touches a CME-governed venue (the CME plane's gate and its words). */
201
225
  export declare function payloadTouchesCmeVenue(exchange: unknown): boolean;
202
226
  /** Whether a source exchange touches the OPRA options plane (an explicit OPRA leg on any chart included). */
203
227
  export declare function payloadTouchesOpraVenue(exchange: unknown): boolean;
@@ -205,9 +229,9 @@ export declare function payloadTouchesOpraVenue(exchange: unknown): boolean;
205
229
  * a listing venue's plain code, NASDAQ, is the free lane and never one). */
206
230
  export declare function payloadTouchesStocksTapeVenue(exchange: unknown): boolean;
207
231
  /**
208
- * Whether a payload names a US stocks tape still closed to user scripting: NASDAQ_TAPE (Tape C) until the UTP
209
- * derived-data answer adds it to STOCKS_TAPE_SCRIPTING_VENUES. Every user run is refused there, as on CME; the provenance-blind
210
- * doors (the editor's paused Run) read it beside the CME predicate.
232
+ * Whether a payload names a US stocks tape closed to user scripting: a governed tape STOCKS_TAPE_SCRIPTING_VENUES
233
+ * leaves out (none since Kyle 2026-11-06 opened every tape). Every user run is refused there, as on CME; the
234
+ * provenance-blind doors (the editor's paused Run) read it beside the CME predicate.
211
235
  */
212
236
  export declare function payloadTouchesClosedStocksTapeVenue(exchange: unknown): boolean;
213
237
  /**
@@ -234,64 +258,29 @@ export declare function payloadTouchesGovernedVenue(exchange: unknown): boolean;
234
258
  * `opra-user-scripts` flag opened the plane to it (`isOpraReadableKScriptRun`);
235
259
  * a US stocks tape leg blocks a protected user script on a tape open to user
236
260
  * scripting (`isStocksTapeReadableKScriptRun`) and every user run on a tape
237
- * still closed to it (NASDAQ_TAPE). A mixed payload is served only when every
261
+ * left out of STOCKS_TAPE_SCRIPTING_VENUES (none today). A mixed payload is served only when every
238
262
  * plane it touches is open to the run.
239
263
  */
240
264
  export declare function isUserKScriptBlockedOnExchange(exchange: unknown, settings: KScriptProvenanceSettingsLike | null | undefined): boolean;
241
265
  /**
242
- * DISPLAY wall: whether a kScript run may mount and render on a governed
243
- * venue at all. Distinct from the DATA wall (isFirstPartyKScriptRun /
244
- * shouldBlockKScriptSourcePayload / buildKScriptDataAccessPolicy): the data
245
- * wall answers "may this code consume governed market data" (a licensing
246
- * boundary keyed on run provenance), while this predicate answers "is this
247
- * indicator approved to appear on a governed chart" (product curation keyed
248
- * on exact identity). A first-party official doc that is missing from the
249
- * CME allow-list legitimately HOLDS governed data access yet must still be
250
- * disabled on governed venues, exactly like a user script: hidden plot,
251
- * standing venue message, no engine, no fetch, no live feed. This predicate
252
- * therefore must never be used to grant or revoke governed DATA access; the
253
- * data-plane guards keep consulting the data wall unchanged.
254
- *
255
- * Verdict: on a governed venue a run is venue-approved only when it is
256
- * first-party AND classifyOfficialScriptForCme recognizes its exact identity
257
- * (registry subType or catalog script id) as 'allowed'. Official Indicator
258
- * packages (isOfficialWrunOverlay) are venue-approved as a CLASS, with no
259
- * per-package list: the 2026-09-30 exemption covers every package of the
260
- * official library, and a package that reads a source the venue does not
261
- * serve answers through the wrun lane's own missing-data states. A PROVEN
262
- * twin of a built-in (builtin-identity.util) draws there only when its
263
- * built-in is proven on CME (CME_PROVEN_TWIN_BUILTIN_KEYS), the only twins
264
- * the add route mounts on a governed venue; a twin of any other built-in
265
- * carried there (an in-place symbol switch, a restore, a paste or copy) is
266
- * blocked. User-provenance
267
- * runs are never venue-approved by the curation, so this is a strict superset
268
- * of isUserKScriptBlockedOnExchange. Fail-closed both ways: an unrecognized
269
- * official blocks, and provenance spoofing via script-input names is already
270
- * neutralized upstream by KSCRIPT_RESERVED_PROVENANCE_KEYS (a spoofed run
271
- * classifies 'user' and is never approved regardless of claimed keys).
272
- *
273
- * CME user studies: a user run the `cme-user-scripts` gate opened the CME
274
- * plane to (`isCmeUserScriptRun`, the data wall's own per-plane verdict, so
275
- * the two walls read one decision) draws on a CME chart, and the curation
276
- * never applies to it: the official allow-list is CME evidence for
277
- * first-party docs alone, never a list a user run must join. A hosted (Cloud)
278
- * record and a protected script stay blocked on CME whatever the gate says.
266
+ * DISPLAY wall: whether a run may mount and render on a governed venue at all. Every plane judges it by the run's
267
+ * data access alone (the data wall, isUserKScriptBlockedOnExchange): a run that may read a venue's data draws there.
268
+ * Every first-party run is venue-approved on every plane, the built-ins (their wrun twins), the official packages
269
+ * and every other OpenMarket Indicator alike, and a user run draws where its plane's own gate opened that plane to it
270
+ * (CME: `isCmeUserScriptRun`; OPRA: `isOpraUserScriptRun`; the US stocks tape: `isStocksTapeReadableKScriptRun`). A
271
+ * hosted (Cloud) record and a protected script stay blocked on CME and OPRA whatever the gates say.
279
272
  *
280
- * OPRA (no CME leg): every first-party run is explicitly venue-approved, the
281
- * built-ins, the converted corpus, the official docs and the official
282
- * packages alike, and every user run is blocked unless the
283
- * `opra-user-scripts` flag opened the plane to it (the data wall's own
284
- * per-plane verdict, so the two walls read one decision,
285
- * `isOpraUserScriptRun`): a hosted (Cloud) record and a protected script stay
286
- * blocked on an OPRA contract chart either way. The CME per-script curation
287
- * is CME evidence and does not apply there; a book-reading official is
288
- * refused by the options mode (OPRA has no book), not by this wall.
273
+ * CME had a per-indicator list of its own until 2026-11-07 (classifyOfficialScriptForCme and the CME twin lists):
274
+ * our own indicators were curated one by one, from the kScript days when the engine broke across CME's session gaps.
275
+ * Since community wrun Indicators draw on CME with no list (the `cme-user-scripts` gate), the list only held back
276
+ * OpenMarket's own (Zig Zag, a proven twin that was never curated), so Kyle retired it (2026-11-07, "fix both"): an
277
+ * indicator that reads a source CME does not serve answers through the wrun lane's own missing-data states, as an
278
+ * official package always has there. The crypto-only NATIVE families stay off CME by their own rule
279
+ * (CME_FUTURES_BLOCKED_INDICATORS, cme-indicator-availability.util): their data does not exist there.
289
280
  *
290
- * The US stocks tape (no CME leg) follows the data wall the same way: every
291
- * first-party run is venue-approved, a user run in the browser or on the cloud
292
- * lane draws on a tape open to user scripting (STOCKS_TAPE_SCRIPTING_VENUES),
293
- * and a protected user script, or any user run on a tape still closed to user
294
- * scripting (NASDAQ_TAPE), is blocked. The CME curation does not apply there either.
281
+ * Kept as its own name for the operational doors (add, mount, teardown, resubscribe, self-heal, suite, layout and
282
+ * copy apply, the boot skips): they ask "may this run draw here", the data-plane guards ask "may this run read here",
283
+ * and today both answer the same. Never grant data access from it.
295
284
  */
296
285
  export declare function isKScriptDisplayBlockedOnExchange(exchange: unknown, settings: KScriptProvenanceSettingsLike | null | undefined): boolean;
297
286
  /**
@@ -334,4 +323,6 @@ export declare function buildKScriptDataAccessPolicy(settings: KScriptProvenance
334
323
  */
335
324
  export declare const KSCRIPT_VENUE_BLOCKED_MARKER = "kscript_venue_blocked";
336
325
  export declare function createKScriptVenueBlockedError(exchange: string): Error;
326
+ /** The market a venue-policy denial walled, read off its text (the error envelope has nothing else), else undefined. */
327
+ export declare function kscriptVenueBlockedExchangeOf(error: unknown): string | undefined;
337
328
  export declare function isKScriptVenueBlockedError(error: unknown): boolean;
@@ -16,9 +16,9 @@
16
16
  * first-party one (`isOpraUserScriptRun`, the same three doors). The US stocks
17
17
  * tape is open to user-authored indicators too, in the browser and on the
18
18
  * cloud lane (Kyle 2026-10-29), on the tapes STOCKS_TAPE_SCRIPTING_VENUES
19
- * lists, the one compliance switch (`isStocksTapeReadableKScriptRun`); a tape
20
- * it leaves out (NASDAQ_TAPE until the UTP derived-data answer) stays
21
- * first-party only. Each plane reads its own gate alone: no plane's decision
19
+ * lists, the one compliance switch (`isStocksTapeReadableKScriptRun`): every
20
+ * tape since Kyle 2026-11-06; a tape it leaves out would stay first-party
21
+ * only. Each plane reads its own gate alone: no plane's decision
22
22
  * opens another. The data tier belongs to the viewer, never to the script: the
23
23
  * browser lane reads through the viewer's own gate sockets. This module is the
24
24
  * single decider for every plane.
@@ -34,16 +34,17 @@ import { CME_GOVERNED_EXCHANGES } from '../../interfaces/cme-realtime.interface.
34
34
  import { OPRA_GOVERNED_EXCHANGES } from '../../interfaces/opra-realtime.interface.js';
35
35
  import { STOCKS_GOVERNED_EXCHANGES, STOCKS_TAPE_SCRIPTING_VENUES } from '../../interfaces/stocks-realtime.interface.js';
36
36
  import { isCmeFuturesPolicyActive } from './marketKind.util.js';
37
- import { isOpraGoverned, isStocksTapeGoverned } from '../v2/gate-plane.util.js';
37
+ import { isOpraGoverned, isStocksTapeGoverned, walledVenueOf } from '../v2/gate-plane.util.js';
38
+ import { stocksTapeVenueLabel } from '../v2/stocks-governed.util.js';
38
39
  import { isConvertedScriptId } from '../../constants/scriptEditor/converted-script-id.leaf.js';
39
40
  import { isTempScriptId } from '../scriptEditor/temp-script-id.util.js';
40
41
  import { TECHNICAL_INDICATOR_SCRIPT_KEY_SET } from '../../constants/scriptEditor/technicalIndicatorScriptKeys.constants.js';
41
- import { classifyOfficialScriptForCme, isCmeFirstPartyOfficialDocId, isCmeProvenTwinBuiltIn, } from '../../constants/scriptEditor/cme-official-scripts.constants.js';
42
+ import { isCmeFirstPartyOfficialDocId } from '../../constants/scriptEditor/cme-official-scripts.constants.js';
42
43
  // Leaf modules (no imports of their own), so this file stays worker-safe.
43
44
  import { isWrunDraftScriptId } from '../wrun/wrun-draft-overlay.util.js';
44
45
  import { isWrunOfficialPackage } from '../wrun/wrun-official-scope.leaf.js';
46
+ import { wrunAppLayerOf } from '../wrun/wrun-app-layer.leaf.js';
45
47
  // Worker-safe too: it reads the twin stamp, the registry ref and the built-in keys alone.
46
- import { builtinIdentityOf } from './builtin-identity.util.js';
47
48
  // Dependency-free: the flag store hands the flag's live readers to it (no store import here).
48
49
  import { isOpraUserScriptsFlagOn } from './opra-user-scripts-gate.util.js';
49
50
  // Dependency-free too: the flag store and the web's CME entitlement hand their live readers to it.
@@ -54,8 +55,8 @@ import { wrunRowSourceKindOf } from '../wrun/wrun-overlay-identity.util.js';
54
55
  // leaf, never wrun-cloud-record.util: this module rides the boot path (titan-charts' dataFetch guard) and the util
55
56
  // does not (tests/utility/wrun/wrun-door.closure.spec.ts).
56
57
  import { wrunCloudRecordOf } from '../wrun/wrun-cloud-record.leaf.js';
57
- // Import-free: the one OPRA read decision every door reads (the wrun lane planners too).
58
- import { mayReadOpra, payloadReadsOpraPlane } from './opra-read-access.leaf.js';
58
+ // Import-free: the one OPRA read decision every door reads (the wrun lane planners too), and the CME pin's.
59
+ import { mayReadCmePin, mayReadOpra, payloadReadsOpraPlane } from './opra-read-access.leaf.js';
59
60
  // The provenance keys are the pure leaf's (kscript-provenance-keys.util); their importers keep this path.
60
61
  export { isReservedKScriptProvenanceKey, KSCRIPT_RESERVED_PROVENANCE_KEYS } from './kscript-provenance-keys.util.js';
61
62
  /** The registry coordinate (`@scope/name`) a wrun identity ref names, or undefined. */
@@ -91,6 +92,13 @@ function carriesWrunIdentity(settings) {
91
92
  * and stays walled on governed venues until its scope joins
92
93
  * WRUN_OFFICIAL_SCOPES (fail closed).
93
94
  *
95
+ * An app layer (wrun-app-layer.leaf: `wrunDraftRef.appLayer`) is the one
96
+ * draft-lane run that qualifies: the app mounts it for one of its own panels
97
+ * from the kit template its pinned kit ships under the official package the
98
+ * table names, so the code that runs is the app's own; no user run can name
99
+ * one (the draft mount builds its ref from fixed fields, and no persisted
100
+ * record ever carries a draft in).
101
+ *
94
102
  * Fail closed on every other shape: an editor draft (`wrunDraftRef`, or a
95
103
  * `wrun-draft-*` id) and a temp editor run are never packages, whatever rides
96
104
  * beside them; EVERY package identity the record carries (the browser lane's
@@ -99,12 +107,18 @@ function carriesWrunIdentity(settings) {
99
107
  * coordinate names no code and never qualifies.
100
108
  */
101
109
  export function isOfficialWrunOverlay(settings) {
102
- if (!settings || settings.wrunDraftRef)
110
+ if (!settings)
111
+ return false;
112
+ const refs = [settings.wrunRegistryRef, settings.wrunRef].filter(Boolean);
113
+ // An app layer names its code by its table, so any package identity beside it names other code: not official.
114
+ const appLayer = wrunAppLayerOf(settings);
115
+ if (appLayer)
116
+ return refs.length === 0 && isWrunOfficialPackage(appLayer.package, null);
117
+ if (settings.wrunDraftRef)
103
118
  return false;
104
119
  const customScriptId = typeof settings.customScriptId === 'string' ? settings.customScriptId : undefined;
105
120
  if (isWrunDraftScriptId(customScriptId) || isTempScriptId(customScriptId))
106
121
  return false;
107
- const refs = [settings.wrunRegistryRef, settings.wrunRef].filter(Boolean);
108
122
  if (refs.length === 0)
109
123
  return false;
110
124
  return refs.every((ref) => {
@@ -274,9 +288,13 @@ export function isCmeUserScriptRun(settings) {
274
288
  return isCmeUserScriptsGateOpen() && isCmeUserScriptCandidate(settings);
275
289
  }
276
290
  /** Whether a run may consume the CME plane's data: every first-party run, and a user run the `cme-user-scripts` gate
277
- * opened it to (`isCmeUserScriptRun`). */
291
+ * opened it to (`isCmeUserScriptRun`; `mayReadCmePin`, the one decision a wrun run's CME pins read too). */
278
292
  export function isCmeReadableKScriptRun(settings) {
279
- return isFirstPartyKScriptRun(settings) || isCmeUserScriptRun(settings);
293
+ return mayReadCmePin({ official: isFirstPartyKScriptRun(settings), cmeUserScripts: isCmeUserScriptRun(settings) });
294
+ }
295
+ /** A CME chart study: a user run the gate opened the CME plane to, on a CME chart (the run head's `cmeStudyChain`). */
296
+ export function isCmeChartStudyRun(settings, chartExchange) {
297
+ return payloadTouchesCmeVenue(chartExchange) && isCmeUserScriptRun(settings);
280
298
  }
281
299
  /** The words a door shows a user run the CME wall refuses (web locale keys, `cmeUserScriptWallKey`), and the
282
300
  * lifecycle's words for a study a closing gate stopped in place, its source kept (`CME_STUDY_STOPPED_KEY`: the
@@ -292,8 +310,8 @@ export const CME_STUDIES_OFF_KEY = 'indicators.cme.studiesOff';
292
310
  * (`CME_USER_SCRIPT_WALL_KEY`): the feature does not exist for that viewer, so no door names a browser lane it cannot
293
311
  * offer. Under a lit flag a hosted (Cloud) record or a protected script has no CME path (`CME_CLOUD_WALL_KEY`: CME chart
294
312
  * studies run in the browser), and a run the browser executes is refused only for the viewer's
295
- * entitlement (`CME_ENTITLEMENT_REQUIRED_KEY`: the CME data terms). A first-party run is never this wall's (the doors
296
- * word the curation themselves) and reads today's words. Words only: whether the door opens is the walls' decision
313
+ * entitlement (`CME_ENTITLEMENT_REQUIRED_KEY`: the CME data terms). A first-party run is never refused on CME and reads
314
+ * today's words. Words only: whether the door opens is the walls' decision
297
315
  * (`isKScriptDisplayBlockedOnExchange`, `isCmeReadableKScriptRun`).
298
316
  */
299
317
  export function cmeUserScriptWallKey(settings) {
@@ -304,13 +322,34 @@ export function cmeUserScriptWallKey(settings) {
304
322
  return CME_ENTITLEMENT_REQUIRED_KEY;
305
323
  return lane === 'cloud' || !isFirstPartyKScriptRun(settings) ? CME_CLOUD_WALL_KEY : CME_USER_SCRIPT_WALL_KEY;
306
324
  }
325
+ /** `cmeUserScriptWallKey`'s lane rule in the pin row's words: derived from it, so the two never drift. */
326
+ export function cmePinRefusalVariant(settings) {
327
+ const key = cmeUserScriptWallKey(settings);
328
+ if (key === CME_ENTITLEMENT_REQUIRED_KEY)
329
+ return 'terms';
330
+ return key === CME_CLOUD_WALL_KEY ? 'cloud' : 'default';
331
+ }
332
+ /** The words a door shows a user run a US stocks tape refuses (web locale key; `{venue}` names the tape's venue). */
333
+ export const STOCKS_USER_SCRIPT_WALL_KEY = 'indicators.stocks.userScriptNotSupported';
334
+ /** The wall's words per plane (a `Record`: a plane without its own words is a type error); CME's lane rule stays CME's. */
335
+ const VENUE_WALL_WORDS = {
336
+ cme: (_exchange, settings) => ({ key: cmeUserScriptWallKey(settings), params: {} }),
337
+ opra: (_exchange, settings) => ({ key: opraContractChartWallKey(settings), params: {} }),
338
+ stocks: (exchange) => ({ key: STOCKS_USER_SCRIPT_WALL_KEY, params: { venue: stocksTapeVenueLabel(exchange) } }),
339
+ };
340
+ /** The ONE choice of a door's words for a user run a wall refused, by the walled market's plane (words only, never
341
+ * whether): a venue no plane governs, which no wall refuses, keeps the CME words every door showed before. */
342
+ export function venueWallWords(exchange, settings) {
343
+ const walled = walledVenueOf(exchange);
344
+ return VENUE_WALL_WORDS[walled?.plane ?? 'cme'](walled?.exchange ?? '', settings);
345
+ }
307
346
  /** BLOCKING semantics over a source exchange (string, or the array form with .some()). */
308
347
  function payloadTouches(exchange, governed) {
309
348
  if (Array.isArray(exchange))
310
349
  return exchange.some((entry) => typeof entry === 'string' && governed(entry));
311
350
  return typeof exchange === 'string' && governed(exchange);
312
351
  }
313
- /** Whether a source exchange touches a CME-governed venue (the CME-only curation and copy). */
352
+ /** Whether a source exchange touches a CME-governed venue (the CME plane's gate and its words). */
314
353
  export function payloadTouchesCmeVenue(exchange) {
315
354
  return payloadTouches(exchange, isCmeFuturesPolicyActive);
316
355
  }
@@ -330,9 +369,9 @@ function isClosedStocksTape(code) {
330
369
  return isStocksTapeGoverned(code) && !STOCKS_TAPE_SCRIPTING_SET.has(code.toUpperCase());
331
370
  }
332
371
  /**
333
- * Whether a payload names a US stocks tape still closed to user scripting: NASDAQ_TAPE (Tape C) until the UTP
334
- * derived-data answer adds it to STOCKS_TAPE_SCRIPTING_VENUES. Every user run is refused there, as on CME; the provenance-blind
335
- * doors (the editor's paused Run) read it beside the CME predicate.
372
+ * Whether a payload names a US stocks tape closed to user scripting: a governed tape STOCKS_TAPE_SCRIPTING_VENUES
373
+ * leaves out (none since Kyle 2026-11-06 opened every tape). Every user run is refused there, as on CME; the
374
+ * provenance-blind doors (the editor's paused Run) read it beside the CME predicate.
336
375
  */
337
376
  export function payloadTouchesClosedStocksTapeVenue(exchange) {
338
377
  return payloadTouches(exchange, isClosedStocksTape);
@@ -363,15 +402,15 @@ export function payloadTouchesGovernedVenue(exchange) {
363
402
  * `opra-user-scripts` flag opened the plane to it (`isOpraReadableKScriptRun`);
364
403
  * a US stocks tape leg blocks a protected user script on a tape open to user
365
404
  * scripting (`isStocksTapeReadableKScriptRun`) and every user run on a tape
366
- * still closed to it (NASDAQ_TAPE). A mixed payload is served only when every
405
+ * left out of STOCKS_TAPE_SCRIPTING_VENUES (none today). A mixed payload is served only when every
367
406
  * plane it touches is open to the run.
368
407
  */
369
408
  export function isUserKScriptBlockedOnExchange(exchange, settings) {
370
409
  if (payloadTouchesCmeVenue(exchange) && !isCmeReadableKScriptRun(settings))
371
410
  return true;
372
411
  // The US stocks tape (Kyle 2026-10-29): user-authored indicators read the tapes STOCKS_TAPE_SCRIPTING_VENUES lists,
373
- // in the browser and on the cloud lane; a tape it leaves out (NASDAQ_TAPE, the UTP derived-data answer pending)
374
- // stays first-party only. A mixed payload is judged per leg (.some): one closed tape refuses it.
412
+ // in the browser and on the cloud lane (every tape since Kyle 2026-11-06); a tape it leaves out would stay
413
+ // first-party only. A mixed payload is judged per leg (.some): one closed tape refuses it.
375
414
  if (payloadTouchesClosedStocksTapeVenue(exchange) && !isFirstPartyKScriptRun(settings))
376
415
  return true;
377
416
  if (payloadTouchesStocksTapeVenue(exchange) && !isStocksTapeReadableKScriptRun(settings))
@@ -379,83 +418,27 @@ export function isUserKScriptBlockedOnExchange(exchange, settings) {
379
418
  return payloadTouchesOpraVenue(exchange) && !isOpraReadableKScriptRun(settings);
380
419
  }
381
420
  /**
382
- * DISPLAY wall: whether a kScript run may mount and render on a governed
383
- * venue at all. Distinct from the DATA wall (isFirstPartyKScriptRun /
384
- * shouldBlockKScriptSourcePayload / buildKScriptDataAccessPolicy): the data
385
- * wall answers "may this code consume governed market data" (a licensing
386
- * boundary keyed on run provenance), while this predicate answers "is this
387
- * indicator approved to appear on a governed chart" (product curation keyed
388
- * on exact identity). A first-party official doc that is missing from the
389
- * CME allow-list legitimately HOLDS governed data access yet must still be
390
- * disabled on governed venues, exactly like a user script: hidden plot,
391
- * standing venue message, no engine, no fetch, no live feed. This predicate
392
- * therefore must never be used to grant or revoke governed DATA access; the
393
- * data-plane guards keep consulting the data wall unchanged.
394
- *
395
- * Verdict: on a governed venue a run is venue-approved only when it is
396
- * first-party AND classifyOfficialScriptForCme recognizes its exact identity
397
- * (registry subType or catalog script id) as 'allowed'. Official Indicator
398
- * packages (isOfficialWrunOverlay) are venue-approved as a CLASS, with no
399
- * per-package list: the 2026-09-30 exemption covers every package of the
400
- * official library, and a package that reads a source the venue does not
401
- * serve answers through the wrun lane's own missing-data states. A PROVEN
402
- * twin of a built-in (builtin-identity.util) draws there only when its
403
- * built-in is proven on CME (CME_PROVEN_TWIN_BUILTIN_KEYS), the only twins
404
- * the add route mounts on a governed venue; a twin of any other built-in
405
- * carried there (an in-place symbol switch, a restore, a paste or copy) is
406
- * blocked. User-provenance
407
- * runs are never venue-approved by the curation, so this is a strict superset
408
- * of isUserKScriptBlockedOnExchange. Fail-closed both ways: an unrecognized
409
- * official blocks, and provenance spoofing via script-input names is already
410
- * neutralized upstream by KSCRIPT_RESERVED_PROVENANCE_KEYS (a spoofed run
411
- * classifies 'user' and is never approved regardless of claimed keys).
421
+ * DISPLAY wall: whether a run may mount and render on a governed venue at all. Every plane judges it by the run's
422
+ * data access alone (the data wall, isUserKScriptBlockedOnExchange): a run that may read a venue's data draws there.
423
+ * Every first-party run is venue-approved on every plane, the built-ins (their wrun twins), the official packages
424
+ * and every other OpenMarket Indicator alike, and a user run draws where its plane's own gate opened that plane to it
425
+ * (CME: `isCmeUserScriptRun`; OPRA: `isOpraUserScriptRun`; the US stocks tape: `isStocksTapeReadableKScriptRun`). A
426
+ * hosted (Cloud) record and a protected script stay blocked on CME and OPRA whatever the gates say.
412
427
  *
413
- * CME user studies: a user run the `cme-user-scripts` gate opened the CME
414
- * plane to (`isCmeUserScriptRun`, the data wall's own per-plane verdict, so
415
- * the two walls read one decision) draws on a CME chart, and the curation
416
- * never applies to it: the official allow-list is CME evidence for
417
- * first-party docs alone, never a list a user run must join. A hosted (Cloud)
418
- * record and a protected script stay blocked on CME whatever the gate says.
428
+ * CME had a per-indicator list of its own until 2026-11-07 (classifyOfficialScriptForCme and the CME twin lists):
429
+ * our own indicators were curated one by one, from the kScript days when the engine broke across CME's session gaps.
430
+ * Since community wrun Indicators draw on CME with no list (the `cme-user-scripts` gate), the list only held back
431
+ * OpenMarket's own (Zig Zag, a proven twin that was never curated), so Kyle retired it (2026-11-07, "fix both"): an
432
+ * indicator that reads a source CME does not serve answers through the wrun lane's own missing-data states, as an
433
+ * official package always has there. The crypto-only NATIVE families stay off CME by their own rule
434
+ * (CME_FUTURES_BLOCKED_INDICATORS, cme-indicator-availability.util): their data does not exist there.
419
435
  *
420
- * OPRA (no CME leg): every first-party run is explicitly venue-approved, the
421
- * built-ins, the converted corpus, the official docs and the official
422
- * packages alike, and every user run is blocked unless the
423
- * `opra-user-scripts` flag opened the plane to it (the data wall's own
424
- * per-plane verdict, so the two walls read one decision,
425
- * `isOpraUserScriptRun`): a hosted (Cloud) record and a protected script stay
426
- * blocked on an OPRA contract chart either way. The CME per-script curation
427
- * is CME evidence and does not apply there; a book-reading official is
428
- * refused by the options mode (OPRA has no book), not by this wall.
429
- *
430
- * The US stocks tape (no CME leg) follows the data wall the same way: every
431
- * first-party run is venue-approved, a user run in the browser or on the cloud
432
- * lane draws on a tape open to user scripting (STOCKS_TAPE_SCRIPTING_VENUES),
433
- * and a protected user script, or any user run on a tape still closed to user
434
- * scripting (NASDAQ_TAPE), is blocked. The CME curation does not apply there either.
436
+ * Kept as its own name for the operational doors (add, mount, teardown, resubscribe, self-heal, suite, layout and
437
+ * copy apply, the boot skips): they ask "may this run draw here", the data-plane guards ask "may this run read here",
438
+ * and today both answer the same. Never grant data access from it.
435
439
  */
436
440
  export function isKScriptDisplayBlockedOnExchange(exchange, settings) {
437
- if (!payloadTouchesGovernedVenue(exchange))
438
- return false;
439
- if (isUserKScriptBlockedOnExchange(exchange, settings))
440
- return true;
441
- if (!payloadTouchesCmeVenue(exchange))
442
- return false;
443
- // Past the data wall a CME leg means a first-party run or a user run the `cme-user-scripts` gate opened the plane
444
- // to. A user run is never curated (the allow-list below is first-party evidence alone): it draws.
445
- if (isCmeUserScriptRun(settings))
446
- return false;
447
- // A first-party run: its curation decides.
448
- const builtin = builtinIdentityOf(settings);
449
- if (builtin?.kind === 'twin')
450
- return !isCmeProvenTwinBuiltIn(builtin.key);
451
- if (isOfficialWrunOverlay(settings))
452
- return false;
453
- return (classifyOfficialScriptForCme({
454
- keys: [
455
- typeof settings?.subType === 'string' ? settings.subType : undefined,
456
- typeof settings?.customScriptId === 'string' ? settings.customScriptId : undefined,
457
- ],
458
- }) !== 'allowed');
441
+ return isUserKScriptBlockedOnExchange(exchange, settings);
459
442
  }
460
443
  /**
461
444
  * Per-payload decision for the titan-charts dataFetch door, evaluated AFTER
@@ -516,6 +499,14 @@ export const KSCRIPT_VENUE_BLOCKED_MARKER = 'kscript_venue_blocked';
516
499
  export function createKScriptVenueBlockedError(exchange) {
517
500
  return new Error(`[kScript] ${KSCRIPT_VENUE_BLOCKED_MARKER}: user scripts cannot access ${exchange} market data`);
518
501
  }
502
+ /** The market a denial's text names: the maker's own sentence above (keep the two in step), or the backend's form. */
503
+ const KSCRIPT_VENUE_BLOCKED_EXCHANGE_RE = /kscript_venue_blocked(?:: user scripts cannot access (\S+) market data| \(exchange=([^,)\s]+))/i;
504
+ /** The market a venue-policy denial walled, read off its text (the error envelope has nothing else), else undefined. */
505
+ export function kscriptVenueBlockedExchangeOf(error) {
506
+ const message = error instanceof Error ? error.message : typeof error === 'string' ? error : '';
507
+ const match = KSCRIPT_VENUE_BLOCKED_EXCHANGE_RE.exec(message);
508
+ return match?.[1] ?? match?.[2];
509
+ }
519
510
  export function isKScriptVenueBlockedError(error) {
520
511
  const message = error instanceof Error ? error.message : typeof error === 'string' ? error : '';
521
512
  return message.toLowerCase().includes(KSCRIPT_VENUE_BLOCKED_MARKER);