@invinite-org/chartlang-runtime 1.1.0 → 1.2.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 (616) hide show
  1. package/CHANGELOG.md +245 -0
  2. package/README.md +1 -2
  3. package/dist/barPoint.d.ts +20 -0
  4. package/dist/barPoint.d.ts.map +1 -0
  5. package/dist/barPoint.js +72 -0
  6. package/dist/barPoint.js.map +1 -0
  7. package/dist/bufferSnapshot.d.ts +102 -0
  8. package/dist/bufferSnapshot.d.ts.map +1 -0
  9. package/dist/bufferSnapshot.js +119 -0
  10. package/dist/bufferSnapshot.js.map +1 -0
  11. package/dist/buildComputeContext.js.map +1 -1
  12. package/dist/createScriptRunner.d.ts +6 -3
  13. package/dist/createScriptRunner.d.ts.map +1 -1
  14. package/dist/createScriptRunner.js +29 -5
  15. package/dist/createScriptRunner.js.map +1 -1
  16. package/dist/dep/DepOutputStore.js.map +1 -1
  17. package/dist/dep/DepRunner.d.ts.map +1 -1
  18. package/dist/dep/DepRunner.js +1 -0
  19. package/dist/dep/DepRunner.js.map +1 -1
  20. package/dist/dep/depOutput.js.map +1 -1
  21. package/dist/dep/emissionFilter.js.map +1 -1
  22. package/dist/dep/index.js.map +1 -1
  23. package/dist/emit/alert.js.map +1 -1
  24. package/dist/emit/alertConditionEmission.js.map +1 -1
  25. package/dist/emit/applyPlotOverride.js.map +1 -1
  26. package/dist/emit/draw/annotations/arrow.js +1 -1
  27. package/dist/emit/draw/annotations/arrow.js.map +1 -1
  28. package/dist/emit/draw/annotations/arrowMarkDown.js +1 -1
  29. package/dist/emit/draw/annotations/arrowMarkDown.js.map +1 -1
  30. package/dist/emit/draw/annotations/arrowMarkUp.js +1 -1
  31. package/dist/emit/draw/annotations/arrowMarkUp.js.map +1 -1
  32. package/dist/emit/draw/annotations/arrowMarker.js +1 -1
  33. package/dist/emit/draw/annotations/arrowMarker.js.map +1 -1
  34. package/dist/emit/draw/annotations/text.js +1 -1
  35. package/dist/emit/draw/annotations/text.js.map +1 -1
  36. package/dist/emit/draw/boxes/circle.js +1 -1
  37. package/dist/emit/draw/boxes/circle.js.map +1 -1
  38. package/dist/emit/draw/boxes/ellipse.d.ts +1 -1
  39. package/dist/emit/draw/boxes/ellipse.js +1 -1
  40. package/dist/emit/draw/boxes/ellipse.js.map +1 -1
  41. package/dist/emit/draw/boxes/fillBetween.d.ts +45 -0
  42. package/dist/emit/draw/boxes/fillBetween.d.ts.map +1 -0
  43. package/dist/emit/draw/boxes/fillBetween.js +36 -0
  44. package/dist/emit/draw/boxes/fillBetween.js.map +1 -0
  45. package/dist/emit/draw/boxes/marker.js +1 -1
  46. package/dist/emit/draw/boxes/marker.js.map +1 -1
  47. package/dist/emit/draw/boxes/path.d.ts +1 -1
  48. package/dist/emit/draw/boxes/path.js +1 -1
  49. package/dist/emit/draw/boxes/path.js.map +1 -1
  50. package/dist/emit/draw/boxes/polyline.d.ts +1 -1
  51. package/dist/emit/draw/boxes/polyline.js +1 -1
  52. package/dist/emit/draw/boxes/polyline.js.map +1 -1
  53. package/dist/emit/draw/boxes/rectangle.js +1 -1
  54. package/dist/emit/draw/boxes/rectangle.js.map +1 -1
  55. package/dist/emit/draw/boxes/rotatedRectangle.js +1 -1
  56. package/dist/emit/draw/boxes/rotatedRectangle.js.map +1 -1
  57. package/dist/emit/draw/boxes/triangle.d.ts +1 -1
  58. package/dist/emit/draw/boxes/triangle.js +1 -1
  59. package/dist/emit/draw/boxes/triangle.js.map +1 -1
  60. package/dist/emit/draw/channels/disjointChannel.js +1 -1
  61. package/dist/emit/draw/channels/disjointChannel.js.map +1 -1
  62. package/dist/emit/draw/channels/flatTopBottom.d.ts +1 -2
  63. package/dist/emit/draw/channels/flatTopBottom.d.ts.map +1 -1
  64. package/dist/emit/draw/channels/flatTopBottom.js +1 -1
  65. package/dist/emit/draw/channels/flatTopBottom.js.map +1 -1
  66. package/dist/emit/draw/channels/regressionTrend.d.ts +3 -4
  67. package/dist/emit/draw/channels/regressionTrend.d.ts.map +1 -1
  68. package/dist/emit/draw/channels/regressionTrend.js +1 -1
  69. package/dist/emit/draw/channels/regressionTrend.js.map +1 -1
  70. package/dist/emit/draw/channels/trendChannel.js +1 -1
  71. package/dist/emit/draw/channels/trendChannel.js.map +1 -1
  72. package/dist/emit/draw/containers/frame.d.ts +1 -1
  73. package/dist/emit/draw/containers/frame.js +2 -2
  74. package/dist/emit/draw/containers/frame.js.map +1 -1
  75. package/dist/emit/draw/containers/group.d.ts +1 -2
  76. package/dist/emit/draw/containers/group.d.ts.map +1 -1
  77. package/dist/emit/draw/containers/group.js +2 -2
  78. package/dist/emit/draw/containers/group.js.map +1 -1
  79. package/dist/emit/draw/curves/arc.js +1 -1
  80. package/dist/emit/draw/curves/arc.js.map +1 -1
  81. package/dist/emit/draw/curves/brush.js +1 -1
  82. package/dist/emit/draw/curves/brush.js.map +1 -1
  83. package/dist/emit/draw/curves/curve.js +1 -1
  84. package/dist/emit/draw/curves/curve.js.map +1 -1
  85. package/dist/emit/draw/curves/doubleCurve.js +1 -1
  86. package/dist/emit/draw/curves/doubleCurve.js.map +1 -1
  87. package/dist/emit/draw/curves/highlighter.js +1 -1
  88. package/dist/emit/draw/curves/highlighter.js.map +1 -1
  89. package/dist/emit/draw/curves/pen.js +1 -1
  90. package/dist/emit/draw/curves/pen.js.map +1 -1
  91. package/dist/emit/draw/cycles/cyclicLines.js +1 -1
  92. package/dist/emit/draw/cycles/cyclicLines.js.map +1 -1
  93. package/dist/emit/draw/cycles/sineLine.js +1 -1
  94. package/dist/emit/draw/cycles/sineLine.js.map +1 -1
  95. package/dist/emit/draw/cycles/timeCycles.js +1 -1
  96. package/dist/emit/draw/cycles/timeCycles.js.map +1 -1
  97. package/dist/emit/draw/elliott/elliottCorrectionWave.js +1 -1
  98. package/dist/emit/draw/elliott/elliottCorrectionWave.js.map +1 -1
  99. package/dist/emit/draw/elliott/elliottDoubleCombo.js +1 -1
  100. package/dist/emit/draw/elliott/elliottDoubleCombo.js.map +1 -1
  101. package/dist/emit/draw/elliott/elliottImpulseWave.js +1 -1
  102. package/dist/emit/draw/elliott/elliottImpulseWave.js.map +1 -1
  103. package/dist/emit/draw/elliott/elliottTriangleWave.js +1 -1
  104. package/dist/emit/draw/elliott/elliottTriangleWave.js.map +1 -1
  105. package/dist/emit/draw/elliott/elliottTripleCombo.js +1 -1
  106. package/dist/emit/draw/elliott/elliottTripleCombo.js.map +1 -1
  107. package/dist/emit/draw/fibA/fibChannel.js +1 -1
  108. package/dist/emit/draw/fibA/fibChannel.js.map +1 -1
  109. package/dist/emit/draw/fibA/fibRetracement.js +1 -1
  110. package/dist/emit/draw/fibA/fibRetracement.js.map +1 -1
  111. package/dist/emit/draw/fibA/fibTimeZone.d.ts +1 -2
  112. package/dist/emit/draw/fibA/fibTimeZone.d.ts.map +1 -1
  113. package/dist/emit/draw/fibA/fibTimeZone.js +1 -1
  114. package/dist/emit/draw/fibA/fibTimeZone.js.map +1 -1
  115. package/dist/emit/draw/fibA/fibTrendExtension.js +1 -1
  116. package/dist/emit/draw/fibA/fibTrendExtension.js.map +1 -1
  117. package/dist/emit/draw/fibA/fibWedge.js +1 -1
  118. package/dist/emit/draw/fibA/fibWedge.js.map +1 -1
  119. package/dist/emit/draw/fibB/fibCircles.d.ts +1 -2
  120. package/dist/emit/draw/fibB/fibCircles.d.ts.map +1 -1
  121. package/dist/emit/draw/fibB/fibCircles.js +1 -1
  122. package/dist/emit/draw/fibB/fibCircles.js.map +1 -1
  123. package/dist/emit/draw/fibB/fibSpeedArcs.js +1 -1
  124. package/dist/emit/draw/fibB/fibSpeedArcs.js.map +1 -1
  125. package/dist/emit/draw/fibB/fibSpeedFan.js +1 -1
  126. package/dist/emit/draw/fibB/fibSpeedFan.js.map +1 -1
  127. package/dist/emit/draw/fibB/fibSpiral.d.ts +1 -2
  128. package/dist/emit/draw/fibB/fibSpiral.d.ts.map +1 -1
  129. package/dist/emit/draw/fibB/fibSpiral.js +1 -1
  130. package/dist/emit/draw/fibB/fibSpiral.js.map +1 -1
  131. package/dist/emit/draw/fibB/fibTrendTime.d.ts +1 -2
  132. package/dist/emit/draw/fibB/fibTrendTime.d.ts.map +1 -1
  133. package/dist/emit/draw/fibB/fibTrendTime.js +1 -1
  134. package/dist/emit/draw/fibB/fibTrendTime.js.map +1 -1
  135. package/dist/emit/draw/gann/gannBox.js +1 -1
  136. package/dist/emit/draw/gann/gannBox.js.map +1 -1
  137. package/dist/emit/draw/gann/gannFan.js +1 -1
  138. package/dist/emit/draw/gann/gannFan.js.map +1 -1
  139. package/dist/emit/draw/gann/gannSquare.js +1 -1
  140. package/dist/emit/draw/gann/gannSquare.js.map +1 -1
  141. package/dist/emit/draw/gann/gannSquareFixed.js +1 -1
  142. package/dist/emit/draw/gann/gannSquareFixed.js.map +1 -1
  143. package/dist/emit/draw/handle.d.ts +11 -2
  144. package/dist/emit/draw/handle.d.ts.map +1 -1
  145. package/dist/emit/draw/handle.js +67 -12
  146. package/dist/emit/draw/handle.js.map +1 -1
  147. package/dist/emit/draw/index.js.map +1 -1
  148. package/dist/emit/draw/lines/crossLine.js +1 -1
  149. package/dist/emit/draw/lines/crossLine.js.map +1 -1
  150. package/dist/emit/draw/lines/horizontalLine.d.ts +1 -1
  151. package/dist/emit/draw/lines/horizontalLine.js +1 -1
  152. package/dist/emit/draw/lines/horizontalLine.js.map +1 -1
  153. package/dist/emit/draw/lines/horizontalRay.js +1 -1
  154. package/dist/emit/draw/lines/horizontalRay.js.map +1 -1
  155. package/dist/emit/draw/lines/line.d.ts +1 -1
  156. package/dist/emit/draw/lines/line.d.ts.map +1 -1
  157. package/dist/emit/draw/lines/line.js +2 -3
  158. package/dist/emit/draw/lines/line.js.map +1 -1
  159. package/dist/emit/draw/lines/trendAngle.js +1 -1
  160. package/dist/emit/draw/lines/trendAngle.js.map +1 -1
  161. package/dist/emit/draw/lines/verticalLine.js +1 -1
  162. package/dist/emit/draw/lines/verticalLine.js.map +1 -1
  163. package/dist/emit/draw/namespace.d.ts +5 -4
  164. package/dist/emit/draw/namespace.d.ts.map +1 -1
  165. package/dist/emit/draw/namespace.js +7 -4
  166. package/dist/emit/draw/namespace.js.map +1 -1
  167. package/dist/emit/draw/patterns/abcdPattern.js +1 -1
  168. package/dist/emit/draw/patterns/abcdPattern.js.map +1 -1
  169. package/dist/emit/draw/patterns/cypherPattern.d.ts +1 -2
  170. package/dist/emit/draw/patterns/cypherPattern.d.ts.map +1 -1
  171. package/dist/emit/draw/patterns/cypherPattern.js +1 -1
  172. package/dist/emit/draw/patterns/cypherPattern.js.map +1 -1
  173. package/dist/emit/draw/patterns/headAndShoulders.js +1 -1
  174. package/dist/emit/draw/patterns/headAndShoulders.js.map +1 -1
  175. package/dist/emit/draw/patterns/threeDrivesPattern.js +1 -1
  176. package/dist/emit/draw/patterns/threeDrivesPattern.js.map +1 -1
  177. package/dist/emit/draw/patterns/trianglePattern.d.ts +1 -1
  178. package/dist/emit/draw/patterns/trianglePattern.js +1 -1
  179. package/dist/emit/draw/patterns/trianglePattern.js.map +1 -1
  180. package/dist/emit/draw/patterns/xabcdPattern.js +1 -1
  181. package/dist/emit/draw/patterns/xabcdPattern.js.map +1 -1
  182. package/dist/emit/draw/pitchforks/pitchfan.js +1 -1
  183. package/dist/emit/draw/pitchforks/pitchfan.js.map +1 -1
  184. package/dist/emit/draw/pitchforks/pitchfork.d.ts +1 -1
  185. package/dist/emit/draw/pitchforks/pitchfork.js +2 -2
  186. package/dist/emit/draw/pitchforks/pitchfork.js.map +1 -1
  187. package/dist/emit/draw/pushDrawing.js.map +1 -1
  188. package/dist/emit/draw/subIdAllocator.d.ts +1 -1
  189. package/dist/emit/draw/subIdAllocator.js +1 -1
  190. package/dist/emit/draw/subIdAllocator.js.map +1 -1
  191. package/dist/emit/draw/table/table.d.ts +1 -1
  192. package/dist/emit/draw/table/table.js.map +1 -1
  193. package/dist/emit/emissionsQueue.js.map +1 -1
  194. package/dist/emit/hash.js.map +1 -1
  195. package/dist/emit/hline.js.map +1 -1
  196. package/dist/emit/index.js.map +1 -1
  197. package/dist/emit/logEmission.js.map +1 -1
  198. package/dist/emit/paneResolver.js.map +1 -1
  199. package/dist/emit/plot.d.ts +7 -0
  200. package/dist/emit/plot.d.ts.map +1 -1
  201. package/dist/emit/plot.js +13 -0
  202. package/dist/emit/plot.js.map +1 -1
  203. package/dist/emit/runtimeError.js.map +1 -1
  204. package/dist/execution/dispose.d.ts.map +1 -1
  205. package/dist/execution/dispose.js +16 -0
  206. package/dist/execution/dispose.js.map +1 -1
  207. package/dist/execution/drain.js.map +1 -1
  208. package/dist/execution/index.js.map +1 -1
  209. package/dist/execution/onBarClose.js.map +1 -1
  210. package/dist/execution/onBarTick.js.map +1 -1
  211. package/dist/execution/onHistory.js.map +1 -1
  212. package/dist/execution/runComputeStep.d.ts.map +1 -1
  213. package/dist/execution/runComputeStep.js +10 -1
  214. package/dist/execution/runComputeStep.js.map +1 -1
  215. package/dist/execution/secondaryStream.js.map +1 -1
  216. package/dist/index.d.ts +1 -1
  217. package/dist/index.d.ts.map +1 -1
  218. package/dist/index.js +1 -1
  219. package/dist/index.js.map +1 -1
  220. package/dist/inputs/index.js.map +1 -1
  221. package/dist/inputs/resolveInputs.js.map +1 -1
  222. package/dist/internal.js.map +1 -1
  223. package/dist/persistentStateStore.js.map +1 -1
  224. package/dist/persistentStateStore.runtime.d.ts.map +1 -1
  225. package/dist/persistentStateStore.runtime.js +21 -7
  226. package/dist/persistentStateStore.runtime.js.map +1 -1
  227. package/dist/persistentStateStore.validate.js.map +1 -1
  228. package/dist/primitives.js.map +1 -1
  229. package/dist/request/alignHtfSeriesCache.js.map +1 -1
  230. package/dist/request/alignHtfSeriesToLtf.d.ts +2 -2
  231. package/dist/request/alignHtfSeriesToLtf.js +2 -2
  232. package/dist/request/alignHtfSeriesToLtf.js.map +1 -1
  233. package/dist/request/bucketLtfBarsByMainContainment.js.map +1 -1
  234. package/dist/request/bucketLtfBarsCache.js.map +1 -1
  235. package/dist/request/index.d.ts +2 -1
  236. package/dist/request/index.d.ts.map +1 -1
  237. package/dist/request/index.js +2 -1
  238. package/dist/request/index.js.map +1 -1
  239. package/dist/request/lowerTf.js.map +1 -1
  240. package/dist/request/pushOnce.js.map +1 -1
  241. package/dist/request/requestNamespace.d.ts.map +1 -1
  242. package/dist/request/requestNamespace.js +16 -3
  243. package/dist/request/requestNamespace.js.map +1 -1
  244. package/dist/request/security.d.ts +20 -1
  245. package/dist/request/security.d.ts.map +1 -1
  246. package/dist/request/security.js +62 -23
  247. package/dist/request/security.js.map +1 -1
  248. package/dist/request/securityExprRunner.d.ts +133 -0
  249. package/dist/request/securityExprRunner.d.ts.map +1 -0
  250. package/dist/request/securityExprRunner.js +235 -0
  251. package/dist/request/securityExprRunner.js.map +1 -0
  252. package/dist/request/streamBars.d.ts +14 -1
  253. package/dist/request/streamBars.d.ts.map +1 -1
  254. package/dist/request/streamBars.js +39 -1
  255. package/dist/request/streamBars.js.map +1 -1
  256. package/dist/ringBuffer.d.ts +2 -2
  257. package/dist/ringBuffer.js +1 -1
  258. package/dist/ringBuffer.js.map +1 -1
  259. package/dist/runtimeContext.d.ts +51 -3
  260. package/dist/runtimeContext.d.ts.map +1 -1
  261. package/dist/runtimeContext.js.map +1 -1
  262. package/dist/seriesView.d.ts +43 -18
  263. package/dist/seriesView.d.ts.map +1 -1
  264. package/dist/seriesView.js +66 -43
  265. package/dist/seriesView.js.map +1 -1
  266. package/dist/state/index.d.ts +2 -1
  267. package/dist/state/index.d.ts.map +1 -1
  268. package/dist/state/index.js +2 -1
  269. package/dist/state/index.js.map +1 -1
  270. package/dist/state/lifecycle.d.ts +40 -0
  271. package/dist/state/lifecycle.d.ts.map +1 -1
  272. package/dist/state/lifecycle.js +53 -0
  273. package/dist/state/lifecycle.js.map +1 -1
  274. package/dist/state/seriesPersistence.d.ts +48 -0
  275. package/dist/state/seriesPersistence.d.ts.map +1 -0
  276. package/dist/state/seriesPersistence.js +87 -0
  277. package/dist/state/seriesPersistence.js.map +1 -0
  278. package/dist/state/seriesSlot.d.ts +105 -0
  279. package/dist/state/seriesSlot.d.ts.map +1 -0
  280. package/dist/state/seriesSlot.js +123 -0
  281. package/dist/state/seriesSlot.js.map +1 -0
  282. package/dist/state/stateNamespace.d.ts.map +1 -1
  283. package/dist/state/stateNamespace.js +28 -0
  284. package/dist/state/stateNamespace.js.map +1 -1
  285. package/dist/state/stateSlot.js.map +1 -1
  286. package/dist/stateStore.d.ts +2 -2
  287. package/dist/stateStore.js.map +1 -1
  288. package/dist/streamState.d.ts +26 -20
  289. package/dist/streamState.d.ts.map +1 -1
  290. package/dist/streamState.js +41 -67
  291. package/dist/streamState.js.map +1 -1
  292. package/dist/ta/adl.js +2 -2
  293. package/dist/ta/adl.js.map +1 -1
  294. package/dist/ta/adr.d.ts +3 -3
  295. package/dist/ta/adr.js +5 -5
  296. package/dist/ta/adr.js.map +1 -1
  297. package/dist/ta/adx.d.ts +3 -2
  298. package/dist/ta/adx.d.ts.map +1 -1
  299. package/dist/ta/adx.js +5 -4
  300. package/dist/ta/adx.js.map +1 -1
  301. package/dist/ta/alma.d.ts +6 -4
  302. package/dist/ta/alma.d.ts.map +1 -1
  303. package/dist/ta/alma.js +21 -8
  304. package/dist/ta/alma.js.map +1 -1
  305. package/dist/ta/anchoredVolumeProfile.js.map +1 -1
  306. package/dist/ta/anchoredVwap.d.ts +1 -1
  307. package/dist/ta/anchoredVwap.js +3 -3
  308. package/dist/ta/anchoredVwap.js.map +1 -1
  309. package/dist/ta/ao.js +2 -2
  310. package/dist/ta/ao.js.map +1 -1
  311. package/dist/ta/aroon.js +2 -2
  312. package/dist/ta/aroon.js.map +1 -1
  313. package/dist/ta/aroonOsc.js +2 -2
  314. package/dist/ta/aroonOsc.js.map +1 -1
  315. package/dist/ta/atr.d.ts +3 -2
  316. package/dist/ta/atr.d.ts.map +1 -1
  317. package/dist/ta/atr.js +5 -4
  318. package/dist/ta/atr.js.map +1 -1
  319. package/dist/ta/barssince.js +1 -1
  320. package/dist/ta/barssince.js.map +1 -1
  321. package/dist/ta/bb.d.ts +3 -2
  322. package/dist/ta/bb.d.ts.map +1 -1
  323. package/dist/ta/bb.js +5 -4
  324. package/dist/ta/bb.js.map +1 -1
  325. package/dist/ta/bbPercentB.js +2 -2
  326. package/dist/ta/bbPercentB.js.map +1 -1
  327. package/dist/ta/bbw.js +2 -2
  328. package/dist/ta/bbw.js.map +1 -1
  329. package/dist/ta/bop.js +2 -2
  330. package/dist/ta/bop.js.map +1 -1
  331. package/dist/ta/cci.js +2 -2
  332. package/dist/ta/cci.js.map +1 -1
  333. package/dist/ta/chaikinOsc.d.ts +3 -2
  334. package/dist/ta/chaikinOsc.d.ts.map +1 -1
  335. package/dist/ta/chaikinOsc.js +5 -4
  336. package/dist/ta/chaikinOsc.js.map +1 -1
  337. package/dist/ta/chandeKrollStop.d.ts +1 -1
  338. package/dist/ta/chandeKrollStop.js +3 -3
  339. package/dist/ta/chandeKrollStop.js.map +1 -1
  340. package/dist/ta/chandelier.d.ts +1 -1
  341. package/dist/ta/chandelier.js +3 -3
  342. package/dist/ta/chandelier.js.map +1 -1
  343. package/dist/ta/change.js +1 -1
  344. package/dist/ta/change.js.map +1 -1
  345. package/dist/ta/chop.js +2 -2
  346. package/dist/ta/chop.js.map +1 -1
  347. package/dist/ta/cmf.js +2 -2
  348. package/dist/ta/cmf.js.map +1 -1
  349. package/dist/ta/cmo.js +2 -2
  350. package/dist/ta/cmo.js.map +1 -1
  351. package/dist/ta/connorsRsi.d.ts +1 -1
  352. package/dist/ta/connorsRsi.js +3 -3
  353. package/dist/ta/connorsRsi.js.map +1 -1
  354. package/dist/ta/coppock.js +2 -2
  355. package/dist/ta/coppock.js.map +1 -1
  356. package/dist/ta/crossover.d.ts +3 -2
  357. package/dist/ta/crossover.d.ts.map +1 -1
  358. package/dist/ta/crossover.js +4 -3
  359. package/dist/ta/crossover.js.map +1 -1
  360. package/dist/ta/crossunder.d.ts +3 -2
  361. package/dist/ta/crossunder.d.ts.map +1 -1
  362. package/dist/ta/crossunder.js +4 -3
  363. package/dist/ta/crossunder.js.map +1 -1
  364. package/dist/ta/dema.js +2 -2
  365. package/dist/ta/dema.js.map +1 -1
  366. package/dist/ta/dmi.d.ts +4 -3
  367. package/dist/ta/dmi.d.ts.map +1 -1
  368. package/dist/ta/dmi.js +6 -5
  369. package/dist/ta/dmi.js.map +1 -1
  370. package/dist/ta/donchian.js +2 -2
  371. package/dist/ta/donchian.js.map +1 -1
  372. package/dist/ta/dpo.js +2 -2
  373. package/dist/ta/dpo.js.map +1 -1
  374. package/dist/ta/ema.d.ts +3 -2
  375. package/dist/ta/ema.d.ts.map +1 -1
  376. package/dist/ta/ema.js +5 -4
  377. package/dist/ta/ema.js.map +1 -1
  378. package/dist/ta/envelope.js +2 -2
  379. package/dist/ta/envelope.js.map +1 -1
  380. package/dist/ta/eom.d.ts +3 -1
  381. package/dist/ta/eom.d.ts.map +1 -1
  382. package/dist/ta/eom.js +5 -3
  383. package/dist/ta/eom.js.map +1 -1
  384. package/dist/ta/fisher.js +2 -2
  385. package/dist/ta/fisher.js.map +1 -1
  386. package/dist/ta/fixedRangeVolumeProfile.js.map +1 -1
  387. package/dist/ta/highest.js +1 -1
  388. package/dist/ta/highest.js.map +1 -1
  389. package/dist/ta/highestbars.d.ts +25 -0
  390. package/dist/ta/highestbars.d.ts.map +1 -0
  391. package/dist/ta/highestbars.js +106 -0
  392. package/dist/ta/highestbars.js.map +1 -0
  393. package/dist/ta/historicalVolatility.d.ts +3 -2
  394. package/dist/ta/historicalVolatility.d.ts.map +1 -1
  395. package/dist/ta/historicalVolatility.js +5 -4
  396. package/dist/ta/historicalVolatility.js.map +1 -1
  397. package/dist/ta/hma.js +2 -2
  398. package/dist/ta/hma.js.map +1 -1
  399. package/dist/ta/ichimoku.d.ts +3 -1
  400. package/dist/ta/ichimoku.d.ts.map +1 -1
  401. package/dist/ta/ichimoku.js +5 -3
  402. package/dist/ta/ichimoku.js.map +1 -1
  403. package/dist/ta/index.js.map +1 -1
  404. package/dist/ta/kama.js +2 -2
  405. package/dist/ta/kama.js.map +1 -1
  406. package/dist/ta/keltner.js +2 -2
  407. package/dist/ta/keltner.js.map +1 -1
  408. package/dist/ta/klinger.js +2 -2
  409. package/dist/ta/klinger.js.map +1 -1
  410. package/dist/ta/kst.js +2 -2
  411. package/dist/ta/kst.js.map +1 -1
  412. package/dist/ta/lib/adxFromDi.js +2 -2
  413. package/dist/ta/lib/adxFromDi.js.map +1 -1
  414. package/dist/ta/lib/computeMa.js +2 -2
  415. package/dist/ta/lib/computeMa.js.map +1 -1
  416. package/dist/ta/lib/computeMaOfFloat64.js +2 -2
  417. package/dist/ta/lib/computeMaOfFloat64.js.map +1 -1
  418. package/dist/ta/lib/directionalState.js +2 -2
  419. package/dist/ta/lib/directionalState.js.map +1 -1
  420. package/dist/ta/lib/donchianMid.js +2 -2
  421. package/dist/ta/lib/donchianMid.js.map +1 -1
  422. package/dist/ta/lib/emaFloat64.js +2 -2
  423. package/dist/ta/lib/emaFloat64.js.map +1 -1
  424. package/dist/ta/lib/linearRegression.js +2 -2
  425. package/dist/ta/lib/linearRegression.js.map +1 -1
  426. package/dist/ta/lib/maTypes.js.map +1 -1
  427. package/dist/ta/lib/pearson.js +2 -2
  428. package/dist/ta/lib/pearson.js.map +1 -1
  429. package/dist/ta/lib/pickCandleSource.js +2 -2
  430. package/dist/ta/lib/pickCandleSource.js.map +1 -1
  431. package/dist/ta/lib/readSourceField.js +2 -2
  432. package/dist/ta/lib/readSourceField.js.map +1 -1
  433. package/dist/ta/lib/rollingStddev.js +2 -2
  434. package/dist/ta/lib/rollingStddev.js.map +1 -1
  435. package/dist/ta/lib/smaFloat64.js +2 -2
  436. package/dist/ta/lib/smaFloat64.js.map +1 -1
  437. package/dist/ta/lib/smmaFloat64.js +2 -2
  438. package/dist/ta/lib/smmaFloat64.js.map +1 -1
  439. package/dist/ta/lib/sourceValue.js.map +1 -1
  440. package/dist/ta/lib/trSeries.js +2 -2
  441. package/dist/ta/lib/trSeries.js.map +1 -1
  442. package/dist/ta/lib/volume-profile/bucketEdges.js.map +1 -1
  443. package/dist/ta/lib/volume-profile/bucketizeVolume.js.map +1 -1
  444. package/dist/ta/lib/volume-profile/developingSeries.js.map +1 -1
  445. package/dist/ta/lib/volume-profile/index.js.map +1 -1
  446. package/dist/ta/lib/volume-profile/intercept.js.map +1 -1
  447. package/dist/ta/lib/volume-profile/scaffold.js.map +1 -1
  448. package/dist/ta/lib/volume-profile/tooHeavy.js.map +1 -1
  449. package/dist/ta/lib/volume-profile/types.js.map +1 -1
  450. package/dist/ta/lib/volume-profile/valueArea.js.map +1 -1
  451. package/dist/ta/lib/volume-profile/volumeProfileShared.js.map +1 -1
  452. package/dist/ta/lib/vwmaFloat64.js +2 -2
  453. package/dist/ta/lib/vwmaFloat64.js.map +1 -1
  454. package/dist/ta/lib/wilderDirectional.js +2 -2
  455. package/dist/ta/lib/wilderDirectional.js.map +1 -1
  456. package/dist/ta/lib/wilderSmoothing.js +2 -2
  457. package/dist/ta/lib/wilderSmoothing.js.map +1 -1
  458. package/dist/ta/lib/wmaFloat64.js +2 -2
  459. package/dist/ta/lib/wmaFloat64.js.map +1 -1
  460. package/dist/ta/lowest.js +1 -1
  461. package/dist/ta/lowest.js.map +1 -1
  462. package/dist/ta/lowestbars.d.ts +25 -0
  463. package/dist/ta/lowestbars.d.ts.map +1 -0
  464. package/dist/ta/lowestbars.js +102 -0
  465. package/dist/ta/lowestbars.js.map +1 -0
  466. package/dist/ta/lsma.js +2 -2
  467. package/dist/ta/lsma.js.map +1 -1
  468. package/dist/ta/maRibbon.js +2 -2
  469. package/dist/ta/maRibbon.js.map +1 -1
  470. package/dist/ta/macd.d.ts +3 -2
  471. package/dist/ta/macd.d.ts.map +1 -1
  472. package/dist/ta/macd.js +6 -5
  473. package/dist/ta/macd.js.map +1 -1
  474. package/dist/ta/massIndex.d.ts +3 -2
  475. package/dist/ta/massIndex.d.ts.map +1 -1
  476. package/dist/ta/massIndex.js +5 -4
  477. package/dist/ta/massIndex.js.map +1 -1
  478. package/dist/ta/mcginley.js +2 -2
  479. package/dist/ta/mcginley.js.map +1 -1
  480. package/dist/ta/median.js +2 -2
  481. package/dist/ta/median.js.map +1 -1
  482. package/dist/ta/mfi.d.ts +3 -1
  483. package/dist/ta/mfi.d.ts.map +1 -1
  484. package/dist/ta/mfi.js +5 -3
  485. package/dist/ta/mfi.js.map +1 -1
  486. package/dist/ta/momentum.js +2 -2
  487. package/dist/ta/momentum.js.map +1 -1
  488. package/dist/ta/netVolume.d.ts +3 -1
  489. package/dist/ta/netVolume.d.ts.map +1 -1
  490. package/dist/ta/netVolume.js +5 -3
  491. package/dist/ta/netVolume.js.map +1 -1
  492. package/dist/ta/nvi.d.ts +3 -1
  493. package/dist/ta/nvi.d.ts.map +1 -1
  494. package/dist/ta/nvi.js +5 -3
  495. package/dist/ta/nvi.js.map +1 -1
  496. package/dist/ta/nz.js +1 -1
  497. package/dist/ta/nz.js.map +1 -1
  498. package/dist/ta/obv.js +2 -2
  499. package/dist/ta/obv.js.map +1 -1
  500. package/dist/ta/persistence.d.ts.map +1 -1
  501. package/dist/ta/persistence.js +1 -40
  502. package/dist/ta/persistence.js.map +1 -1
  503. package/dist/ta/pivotsHighLow.js +2 -2
  504. package/dist/ta/pivotsHighLow.js.map +1 -1
  505. package/dist/ta/pivotsStandard.d.ts +1 -1
  506. package/dist/ta/pivotsStandard.js +3 -3
  507. package/dist/ta/pivotsStandard.js.map +1 -1
  508. package/dist/ta/pmo.js +2 -2
  509. package/dist/ta/pmo.js.map +1 -1
  510. package/dist/ta/ppo.d.ts +3 -2
  511. package/dist/ta/ppo.d.ts.map +1 -1
  512. package/dist/ta/ppo.js +5 -4
  513. package/dist/ta/ppo.js.map +1 -1
  514. package/dist/ta/psar.js +2 -2
  515. package/dist/ta/psar.js.map +1 -1
  516. package/dist/ta/pvi.d.ts +3 -1
  517. package/dist/ta/pvi.d.ts.map +1 -1
  518. package/dist/ta/pvi.js +5 -3
  519. package/dist/ta/pvi.js.map +1 -1
  520. package/dist/ta/pvo.d.ts +3 -1
  521. package/dist/ta/pvo.d.ts.map +1 -1
  522. package/dist/ta/pvo.js +5 -3
  523. package/dist/ta/pvo.js.map +1 -1
  524. package/dist/ta/pvt.d.ts +3 -1
  525. package/dist/ta/pvt.d.ts.map +1 -1
  526. package/dist/ta/pvt.js +5 -3
  527. package/dist/ta/pvt.js.map +1 -1
  528. package/dist/ta/registry.d.ts +7 -1
  529. package/dist/ta/registry.d.ts.map +1 -1
  530. package/dist/ta/registry.js +4 -0
  531. package/dist/ta/registry.js.map +1 -1
  532. package/dist/ta/roc.js +2 -2
  533. package/dist/ta/roc.js.map +1 -1
  534. package/dist/ta/rsi.d.ts +3 -2
  535. package/dist/ta/rsi.d.ts.map +1 -1
  536. package/dist/ta/rsi.js +5 -4
  537. package/dist/ta/rsi.js.map +1 -1
  538. package/dist/ta/rvgi.js +2 -2
  539. package/dist/ta/rvgi.js.map +1 -1
  540. package/dist/ta/rvi.d.ts +3 -2
  541. package/dist/ta/rvi.d.ts.map +1 -1
  542. package/dist/ta/rvi.js +5 -4
  543. package/dist/ta/rvi.js.map +1 -1
  544. package/dist/ta/sessionVolumeProfile.js.map +1 -1
  545. package/dist/ta/sma.d.ts +6 -3
  546. package/dist/ta/sma.d.ts.map +1 -1
  547. package/dist/ta/sma.js +8 -5
  548. package/dist/ta/sma.js.map +1 -1
  549. package/dist/ta/smi.js +2 -2
  550. package/dist/ta/smi.js.map +1 -1
  551. package/dist/ta/smma.js +2 -2
  552. package/dist/ta/smma.js.map +1 -1
  553. package/dist/ta/stdev.d.ts +3 -2
  554. package/dist/ta/stdev.d.ts.map +1 -1
  555. package/dist/ta/stdev.js +5 -4
  556. package/dist/ta/stdev.js.map +1 -1
  557. package/dist/ta/stoch.js +2 -2
  558. package/dist/ta/stoch.js.map +1 -1
  559. package/dist/ta/stochRsi.js +2 -2
  560. package/dist/ta/stochRsi.js.map +1 -1
  561. package/dist/ta/supertrend.d.ts +1 -1
  562. package/dist/ta/supertrend.js +3 -3
  563. package/dist/ta/supertrend.js.map +1 -1
  564. package/dist/ta/tema.js +2 -2
  565. package/dist/ta/tema.js.map +1 -1
  566. package/dist/ta/trendStrengthIndex.d.ts +4 -3
  567. package/dist/ta/trendStrengthIndex.d.ts.map +1 -1
  568. package/dist/ta/trendStrengthIndex.js +6 -5
  569. package/dist/ta/trendStrengthIndex.js.map +1 -1
  570. package/dist/ta/trix.d.ts +4 -3
  571. package/dist/ta/trix.d.ts.map +1 -1
  572. package/dist/ta/trix.js +6 -5
  573. package/dist/ta/trix.js.map +1 -1
  574. package/dist/ta/tsi.js +2 -2
  575. package/dist/ta/tsi.js.map +1 -1
  576. package/dist/ta/ulcerIndex.js +2 -2
  577. package/dist/ta/ulcerIndex.js.map +1 -1
  578. package/dist/ta/ultimateOsc.js +2 -2
  579. package/dist/ta/ultimateOsc.js.map +1 -1
  580. package/dist/ta/valuewhen.js +1 -1
  581. package/dist/ta/valuewhen.js.map +1 -1
  582. package/dist/ta/visibleRangeVolumeProfile.d.ts +2 -2
  583. package/dist/ta/visibleRangeVolumeProfile.js +2 -2
  584. package/dist/ta/visibleRangeVolumeProfile.js.map +1 -1
  585. package/dist/ta/vol.js +2 -2
  586. package/dist/ta/vol.js.map +1 -1
  587. package/dist/ta/volatilityStop.d.ts +1 -1
  588. package/dist/ta/volatilityStop.js +3 -3
  589. package/dist/ta/volatilityStop.js.map +1 -1
  590. package/dist/ta/vortex.d.ts +3 -2
  591. package/dist/ta/vortex.d.ts.map +1 -1
  592. package/dist/ta/vortex.js +5 -4
  593. package/dist/ta/vortex.js.map +1 -1
  594. package/dist/ta/vwap.d.ts +3 -3
  595. package/dist/ta/vwap.js +5 -5
  596. package/dist/ta/vwap.js.map +1 -1
  597. package/dist/ta/vwma.js +2 -2
  598. package/dist/ta/vwma.js.map +1 -1
  599. package/dist/ta/williamsFractal.js +2 -2
  600. package/dist/ta/williamsFractal.js.map +1 -1
  601. package/dist/ta/williamsR.js +2 -2
  602. package/dist/ta/williamsR.js.map +1 -1
  603. package/dist/ta/wma.js +2 -2
  604. package/dist/ta/wma.js.map +1 -1
  605. package/dist/ta/zigZag.js +2 -2
  606. package/dist/ta/zigZag.js.map +1 -1
  607. package/dist/views/barstateView.js.map +1 -1
  608. package/dist/views/index.js.map +1 -1
  609. package/dist/views/refreshRuntimeViews.js.map +1 -1
  610. package/dist/views/symInfoView.js.map +1 -1
  611. package/dist/views/timeframeView.js.map +1 -1
  612. package/package.json +3 -3
  613. package/dist/ta/lib/applyOffset.d.ts +0 -19
  614. package/dist/ta/lib/applyOffset.d.ts.map +0 -1
  615. package/dist/ta/lib/applyOffset.js +0 -38
  616. package/dist/ta/lib/applyOffset.js.map +0 -1
@@ -0,0 +1,48 @@
1
+ import type { JsonValue } from "@invinite-org/chartlang-core";
2
+ import type { RuntimeContext } from "../runtimeContext.js";
3
+ /**
4
+ * Return whether a snapshot slot key belongs to the `state.series`
5
+ * namespace (a `${slotIdPrefix}${slotId}:series` key). Lets the restore
6
+ * router separate series slots from scalar `state.*` (`:state`) and `ta.*`
7
+ * (`ta:`) slots, all of which share one `slots` record.
8
+ *
9
+ * @since 0.9
10
+ * @internal
11
+ * @stable
12
+ * @example
13
+ * isSeriesSlotSnapshotKey("x.chart.ts:1:1:series"); // true
14
+ */
15
+ export declare function isSeriesSlotSnapshotKey(key: string): boolean;
16
+ /**
17
+ * Serialise the runner's `state.series` slots into JSON-clean snapshot
18
+ * entries keyed by the same `${prefix}${slotId}:series` key the slot store
19
+ * uses. `committedHead` is nulled when `NaN` (the validator rejects `NaN`);
20
+ * the buffer rides {@link Float64RingBuffer.serialiseSnapshotBuffer}.
21
+ *
22
+ * @since 0.9
23
+ * @internal
24
+ * @stable
25
+ * @example
26
+ * // const entries = serialiseSeriesSlots(ctx);
27
+ * const entries = {};
28
+ * void entries;
29
+ */
30
+ export declare function serialiseSeriesSlots(ctx: RuntimeContext): Readonly<Record<string, JsonValue>>;
31
+ /**
32
+ * Restore `state.series` slots from namespaced snapshot entries into
33
+ * `ctx.seriesSlots`, rebuilding each ring via
34
+ * {@link Float64RingBuffer.restoreFromSnapshotBuffer} sized to the runner's
35
+ * current `capacity`. Non-series keys are ignored; malformed series
36
+ * snapshots are skipped. The view identity is recreated on restore
37
+ * (acceptable — same as `ta.*`).
38
+ *
39
+ * @since 0.9
40
+ * @internal
41
+ * @stable
42
+ * @example
43
+ * // restoreSeriesSlots(ctx, snapshot.slots, capacity);
44
+ * const restored = true;
45
+ * void restored;
46
+ */
47
+ export declare function restoreSeriesSlots(ctx: RuntimeContext, slots: Readonly<Record<string, unknown>>, capacity: number): void;
48
+ //# sourceMappingURL=seriesPersistence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seriesPersistence.d.ts","sourceRoot":"","sources":["../../src/state/seriesPersistence.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAU9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAK3D;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAU7F;AAaD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAC9B,GAAG,EAAE,cAAc,EACnB,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACxC,QAAQ,EAAE,MAAM,GACjB,IAAI,CASN"}
@@ -0,0 +1,87 @@
1
+ // Copyright (c) 2026 Invinite. Licensed under the MIT License.
2
+ // See the LICENSE file in the repo root for full license text.
3
+ import { finiteOrNull, isBufferSnapshot, isRecord, restoreBuffer, restoreNumber, serialiseBuffer, } from "../bufferSnapshot.js";
4
+ import { restoreSeriesSlot } from "./seriesSlot.js";
5
+ const SERIES_SLOT_SUFFIX = ":series";
6
+ /**
7
+ * Return whether a snapshot slot key belongs to the `state.series`
8
+ * namespace (a `${slotIdPrefix}${slotId}:series` key). Lets the restore
9
+ * router separate series slots from scalar `state.*` (`:state`) and `ta.*`
10
+ * (`ta:`) slots, all of which share one `slots` record.
11
+ *
12
+ * @since 0.9
13
+ * @internal
14
+ * @stable
15
+ * @example
16
+ * isSeriesSlotSnapshotKey("x.chart.ts:1:1:series"); // true
17
+ */
18
+ export function isSeriesSlotSnapshotKey(key) {
19
+ return key.endsWith(SERIES_SLOT_SUFFIX);
20
+ }
21
+ /**
22
+ * Serialise the runner's `state.series` slots into JSON-clean snapshot
23
+ * entries keyed by the same `${prefix}${slotId}:series` key the slot store
24
+ * uses. `committedHead` is nulled when `NaN` (the validator rejects `NaN`);
25
+ * the buffer rides {@link Float64RingBuffer.serialiseSnapshotBuffer}.
26
+ *
27
+ * @since 0.9
28
+ * @internal
29
+ * @stable
30
+ * @example
31
+ * // const entries = serialiseSeriesSlots(ctx);
32
+ * const entries = {};
33
+ * void entries;
34
+ */
35
+ export function serialiseSeriesSlots(ctx) {
36
+ const out = {};
37
+ for (const [key, slot] of ctx.seriesSlots.entries()) {
38
+ out[key] = {
39
+ kind: "state.series",
40
+ buffer: serialiseBuffer(slot.buffer),
41
+ committedHead: finiteOrNull(slot.committedHead),
42
+ };
43
+ }
44
+ return Object.freeze(out);
45
+ }
46
+ function restoreSeriesSlotSnapshot(snapshot, capacity) {
47
+ if (!isRecord(snapshot) || snapshot.kind !== "state.series")
48
+ return null;
49
+ const bufferSnapshot = snapshot.buffer;
50
+ if (!isBufferSnapshot(bufferSnapshot))
51
+ return null;
52
+ const committedHead = restoreNumber(snapshot.committedHead);
53
+ if (committedHead === null)
54
+ return null;
55
+ const buffer = restoreBuffer(bufferSnapshot, capacity);
56
+ if (buffer === null)
57
+ return null;
58
+ return restoreSeriesSlot(buffer, committedHead);
59
+ }
60
+ /**
61
+ * Restore `state.series` slots from namespaced snapshot entries into
62
+ * `ctx.seriesSlots`, rebuilding each ring via
63
+ * {@link Float64RingBuffer.restoreFromSnapshotBuffer} sized to the runner's
64
+ * current `capacity`. Non-series keys are ignored; malformed series
65
+ * snapshots are skipped. The view identity is recreated on restore
66
+ * (acceptable — same as `ta.*`).
67
+ *
68
+ * @since 0.9
69
+ * @internal
70
+ * @stable
71
+ * @example
72
+ * // restoreSeriesSlots(ctx, snapshot.slots, capacity);
73
+ * const restored = true;
74
+ * void restored;
75
+ */
76
+ export function restoreSeriesSlots(ctx, slots, capacity) {
77
+ ctx.seriesSlots.clear();
78
+ for (const [key, value] of Object.entries(slots)) {
79
+ if (!isSeriesSlotSnapshotKey(key))
80
+ continue;
81
+ const slot = restoreSeriesSlotSnapshot(value, capacity);
82
+ if (slot !== null) {
83
+ ctx.seriesSlots.set(key, slot);
84
+ }
85
+ }
86
+ }
87
+ //# sourceMappingURL=seriesPersistence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seriesPersistence.js","sourceRoot":"","sources":["../../src/state/seriesPersistence.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAI/D,OAAO,EACH,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACb,aAAa,EACb,eAAe,GAClB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,iBAAiB,EAAmB,MAAM,iBAAiB,CAAC;AAErE,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAErC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,uBAAuB,CAAC,GAAW;IAC/C,OAAO,GAAG,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAmB;IACpD,MAAM,GAAG,GAA8B,EAAE,CAAC;IAC1C,KAAK,MAAM,CAAC,GA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AAI,GAAG,yBAAyB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACxD,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAChB,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACnC,CAAC;IACL,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nimport type { JsonValue } from \"@invinite-org/chartlang-core\";\n\nimport {\n finiteOrNull,\n isBufferSnapshot,\n isRecord,\n restoreBuffer,\n restoreNumber,\n serialiseBuffer,\n} from \"../bufferSnapshot.js\";\nimport type { RuntimeContext } from \"../runtimeContext.js\";\nimport { restoreSeriesSlot, type SeriesSlot } from \"./seriesSlot.js\";\n\nconst SERIES_SLOT_SUFFIX = \":series\";\n\n/**\n * Return whether a snapshot slot key belongs to the `state.series`\n * namespace (a `${slotIdPrefix}${slotId}:series` key). Lets the restore\n * router separate series slots from scalar `state.*` (`:state`) and `ta.*`\n * (`ta:`) slots, all of which share one `slots` record.\n *\n * @since 0.9\n * @internal\n * @stable\n * @example\n * isSeriesSlotSnapshotKey(\"x.chart.ts:1:1:series\"); // true\n */\nexport function isSeriesSlotSnapshotKey(key: string): boolean {\n return key.endsWith(SERIES_SLOT_SUFFIX);\n}\n\n/**\n * Serialise the runner's `state.series` slots into JSON-clean snapshot\n * entries keyed by the same `${prefix}${slotId}:series` key the slot store\n * uses. `committedHead` is nulled when `NaN` (the validator rejects `NaN`);\n * the buffer rides {@link Float64RingBuffer.serialiseSnapshotBuffer}.\n *\n * @since 0.9\n * @internal\n * @stable\n * @example\n * // const entries = serialiseSeriesSlots(ctx);\n * const entries = {};\n * void entries;\n */\nexport function serialiseSeriesSlots(ctx: RuntimeContext): Readonly<Record<string, JsonValue>> {\n const out: Record<string, JsonValue> = {};\n for (const [key, slot] of ctx.seriesSlots.entries()) {\n out[key] = {\n kind: \"state.series\",\n buffer: serialiseBuffer(slot.buffer),\n committedHead: finiteOrNull(slot.committedHead),\n };\n }\n return Object.freeze(out);\n}\n\nfunction restoreSeriesSlotSnapshot(snapshot: unknown, capacity: number): SeriesSlot | null {\n if (!isRecord(snapshot) || snapshot.kind !== \"state.series\") return null;\n const bufferSnapshot = snapshot.buffer;\n if (!isBufferSnapshot(bufferSnapshot)) return null;\n const committedHead = restoreNumber(snapshot.committedHead);\n if (committedHead === null) return null;\n const buffer = restoreBuffer(bufferSnapshot, capacity);\n if (buffer === null) return null;\n return restoreSeriesSlot(buffer, committedHead);\n}\n\n/**\n * Restore `state.series` slots from namespaced snapshot entries into\n * `ctx.seriesSlots`, rebuilding each ring via\n * {@link Float64RingBuffer.restoreFromSnapshotBuffer} sized to the runner's\n * current `capacity`. Non-series keys are ignored; malformed series\n * snapshots are skipped. The view identity is recreated on restore\n * (acceptable — same as `ta.*`).\n *\n * @since 0.9\n * @internal\n * @stable\n * @example\n * // restoreSeriesSlots(ctx, snapshot.slots, capacity);\n * const restored = true;\n * void restored;\n */\nexport function restoreSeriesSlots(\n ctx: RuntimeContext,\n slots: Readonly<Record<string, unknown>>,\n capacity: number,\n): void {\n ctx.seriesSlots.clear();\n for (const [key, value] of Object.entries(slots)) {\n if (!isSeriesSlotSnapshotKey(key)) continue;\n const slot = restoreSeriesSlotSnapshot(value, capacity);\n if (slot !== null) {\n ctx.seriesSlots.set(key, slot);\n }\n }\n}\n"]}
@@ -0,0 +1,105 @@
1
+ import type { NumberSeriesSlot } from "@invinite-org/chartlang-core";
2
+ import type { Float64RingBuffer } from "../ringBuffer.js";
3
+ /**
4
+ * Runtime slot behind a script-facing `state.series(init)` handle. The
5
+ * `buffer` is the history ring (index 0 = live head); the `view` is the
6
+ * identity-stable {@link NumberSeriesSlot} the script reads and writes;
7
+ * `committedHead` snapshots the head as of the last bar close so a tick
8
+ * can reset the live head before the script refines it.
9
+ *
10
+ * Unlike the scalar `StateSlot`, there is no tentative/committed value
11
+ * split — the head IS the tentative value and history IS committed (a bar
12
+ * advances the ring on close). `committedHead` exists only so a tick's
13
+ * `resetSeriesSlotHead` can undo a prior tick's `replaceHead`.
14
+ *
15
+ * @since 0.9
16
+ * @stable
17
+ * @example
18
+ * // const slot = createSeriesSlot(new Float64RingBuffer(8), 0);
19
+ * // slot.view.value = 42;
20
+ * // slot.view[0]; // 42
21
+ */
22
+ export type SeriesSlot = {
23
+ readonly kind: "state.series";
24
+ readonly buffer: Float64RingBuffer;
25
+ readonly view: NumberSeriesSlot;
26
+ committedHead: number;
27
+ };
28
+ /**
29
+ * Build the identity-stable {@link NumberSeriesSlot} view over a ring
30
+ * buffer. Series reads (`[n]`, `current`, `length`, `valueOf`,
31
+ * `Symbol.toPrimitive`) delegate to a reused {@link makeSeriesView}; the
32
+ * `value` property is added on top — `get` → `buffer.at(0)` (live head),
33
+ * `set` → `buffer.replaceHead(v)` (write-through to the live head). The
34
+ * object's identity is stable across bars, so a script can keep
35
+ * `const s = state.series(0)` at the top of `compute`.
36
+ *
37
+ * @since 0.9
38
+ * @stable
39
+ * @example
40
+ * // const view = makeSeriesSlotView(buffer);
41
+ * // view.value = 7; // replaceHead
42
+ * // +view; // 7 (valueOf → buffer.at(0))
43
+ * // view[1]; // one committed bar back
44
+ */
45
+ export declare function makeSeriesSlotView(buffer: Float64RingBuffer): NumberSeriesSlot;
46
+ /**
47
+ * Allocate a fresh {@link SeriesSlot}: seed the live head with `init`
48
+ * (matching `state.float(init)` — a never-written series reads `init` on
49
+ * its allocation bar), set `committedHead = init`, and build the
50
+ * identity-stable view. Later bars the script does not write become `NaN`
51
+ * gaps because the close hook advances the ring with `append(NaN)`.
52
+ *
53
+ * @since 0.9
54
+ * @stable
55
+ * @example
56
+ * // const slot = createSeriesSlot(new Float64RingBuffer(8), 0);
57
+ * // slot.view[0]; // 0 (the seeded init on the allocation bar)
58
+ */
59
+ export declare function createSeriesSlot(buffer: Float64RingBuffer, init: number): SeriesSlot;
60
+ /**
61
+ * Rebuild a {@link SeriesSlot} over an already-restored ring buffer
62
+ * (snapshot path). The view identity is recreated — acceptable, same as
63
+ * `ta.*` restore.
64
+ *
65
+ * @since 0.9
66
+ * @stable
67
+ * @example
68
+ * // const slot = restoreSeriesSlot(restoredBuffer, committedHead);
69
+ * // slot.view[1];
70
+ */
71
+ export declare function restoreSeriesSlot(buffer: Float64RingBuffer, committedHead: number): SeriesSlot;
72
+ /**
73
+ * Advance the ring for a new close bar: append a fresh `NaN` head so the
74
+ * prior committed head slides to index 1. Runs once per close, before the
75
+ * script's compute, for every already-allocated slot.
76
+ *
77
+ * @since 0.9
78
+ * @stable
79
+ * @example
80
+ * // advanceSeriesSlot(slot); // slot.view[0] is now NaN until written
81
+ */
82
+ export declare function advanceSeriesSlot(slot: SeriesSlot): void;
83
+ /**
84
+ * Commit the live head as the bar-close value, so the next close's
85
+ * `advanceSeriesSlot` retains it and a subsequent tick's
86
+ * `resetSeriesSlotHead` restores it. Runs once per close, after compute.
87
+ *
88
+ * @since 0.9
89
+ * @stable
90
+ * @example
91
+ * // commitSeriesSlot(slot); // slot.committedHead = slot.view[0]
92
+ */
93
+ export declare function commitSeriesSlot(slot: SeriesSlot): void;
94
+ /**
95
+ * Reset the live head to the last committed value at the start of a tick,
96
+ * so a tick that re-writes refines from the committed baseline and a tick
97
+ * that does not write reads the committed head. Does NOT advance length.
98
+ *
99
+ * @since 0.9
100
+ * @stable
101
+ * @example
102
+ * // resetSeriesSlotHead(slot); // slot.view[0] = slot.committedHead
103
+ */
104
+ export declare function resetSeriesSlotHead(slot: SeriesSlot): void;
105
+ //# sourceMappingURL=seriesSlot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seriesSlot.d.ts","sourceRoot":"","sources":["../../src/state/seriesSlot.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG1D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,UAAU,GAAG;IACrB,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,iBAAiB,GAAG,gBAAgB,CAmB9E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAQpF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,GAAG,UAAU,CAO9F;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAExD;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAEvD;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAE1D"}
@@ -0,0 +1,123 @@
1
+ // Copyright (c) 2026 Invinite. Licensed under the MIT License.
2
+ // See the LICENSE file in the repo root for full license text.
3
+ import { makeSeriesView } from "../seriesView.js";
4
+ /**
5
+ * Build the identity-stable {@link NumberSeriesSlot} view over a ring
6
+ * buffer. Series reads (`[n]`, `current`, `length`, `valueOf`,
7
+ * `Symbol.toPrimitive`) delegate to a reused {@link makeSeriesView}; the
8
+ * `value` property is added on top — `get` → `buffer.at(0)` (live head),
9
+ * `set` → `buffer.replaceHead(v)` (write-through to the live head). The
10
+ * object's identity is stable across bars, so a script can keep
11
+ * `const s = state.series(0)` at the top of `compute`.
12
+ *
13
+ * @since 0.9
14
+ * @stable
15
+ * @example
16
+ * // const view = makeSeriesSlotView(buffer);
17
+ * // view.value = 7; // replaceHead
18
+ * // +view; // 7 (valueOf → buffer.at(0))
19
+ * // view[1]; // one committed bar back
20
+ */
21
+ export function makeSeriesSlotView(buffer) {
22
+ const reads = makeSeriesView(buffer);
23
+ return new Proxy(reads, {
24
+ get(target, prop, receiver) {
25
+ if (prop === "value")
26
+ return buffer.at(0);
27
+ return Reflect.get(target, prop, receiver);
28
+ },
29
+ set(_target, prop, value) {
30
+ if (prop === "value") {
31
+ buffer.replaceHead(value);
32
+ return true;
33
+ }
34
+ return false;
35
+ },
36
+ has(target, prop) {
37
+ if (prop === "value")
38
+ return true;
39
+ return Reflect.has(target, prop);
40
+ },
41
+ });
42
+ }
43
+ /**
44
+ * Allocate a fresh {@link SeriesSlot}: seed the live head with `init`
45
+ * (matching `state.float(init)` — a never-written series reads `init` on
46
+ * its allocation bar), set `committedHead = init`, and build the
47
+ * identity-stable view. Later bars the script does not write become `NaN`
48
+ * gaps because the close hook advances the ring with `append(NaN)`.
49
+ *
50
+ * @since 0.9
51
+ * @stable
52
+ * @example
53
+ * // const slot = createSeriesSlot(new Float64RingBuffer(8), 0);
54
+ * // slot.view[0]; // 0 (the seeded init on the allocation bar)
55
+ */
56
+ export function createSeriesSlot(buffer, init) {
57
+ buffer.append(init);
58
+ return {
59
+ kind: "state.series",
60
+ buffer,
61
+ view: makeSeriesSlotView(buffer),
62
+ committedHead: init,
63
+ };
64
+ }
65
+ /**
66
+ * Rebuild a {@link SeriesSlot} over an already-restored ring buffer
67
+ * (snapshot path). The view identity is recreated — acceptable, same as
68
+ * `ta.*` restore.
69
+ *
70
+ * @since 0.9
71
+ * @stable
72
+ * @example
73
+ * // const slot = restoreSeriesSlot(restoredBuffer, committedHead);
74
+ * // slot.view[1];
75
+ */
76
+ export function restoreSeriesSlot(buffer, committedHead) {
77
+ return {
78
+ kind: "state.series",
79
+ buffer,
80
+ view: makeSeriesSlotView(buffer),
81
+ committedHead,
82
+ };
83
+ }
84
+ /**
85
+ * Advance the ring for a new close bar: append a fresh `NaN` head so the
86
+ * prior committed head slides to index 1. Runs once per close, before the
87
+ * script's compute, for every already-allocated slot.
88
+ *
89
+ * @since 0.9
90
+ * @stable
91
+ * @example
92
+ * // advanceSeriesSlot(slot); // slot.view[0] is now NaN until written
93
+ */
94
+ export function advanceSeriesSlot(slot) {
95
+ slot.buffer.append(Number.NaN);
96
+ }
97
+ /**
98
+ * Commit the live head as the bar-close value, so the next close's
99
+ * `advanceSeriesSlot` retains it and a subsequent tick's
100
+ * `resetSeriesSlotHead` restores it. Runs once per close, after compute.
101
+ *
102
+ * @since 0.9
103
+ * @stable
104
+ * @example
105
+ * // commitSeriesSlot(slot); // slot.committedHead = slot.view[0]
106
+ */
107
+ export function commitSeriesSlot(slot) {
108
+ slot.committedHead = slot.buffer.at(0);
109
+ }
110
+ /**
111
+ * Reset the live head to the last committed value at the start of a tick,
112
+ * so a tick that re-writes refines from the committed baseline and a tick
113
+ * that does not write reads the committed head. Does NOT advance length.
114
+ *
115
+ * @since 0.9
116
+ * @stable
117
+ * @example
118
+ * // resetSeriesSlotHead(slot); // slot.view[0] = slot.committedHead
119
+ */
120
+ export function resetSeriesSlotHead(slot) {
121
+ slot.buffer.replaceHead(slot.committedHead);
122
+ }
123
+ //# sourceMappingURL=seriesSlot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seriesSlot.js","sourceRoot":"","sources":["../../src/state/seriesSlot.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAK/D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA4BlD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAyB;IACxD,MAAM,KAAK,GAAG,cAAc,CAAS,MAAM,CAAC,CAAC;IAC7C,OAAO,IAAI,KAAK,CAAC,KAAyB,EAAE;QACxC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ;Y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,CAAC,IAAgB;IAC7C,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAgB;IAChD,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAChD,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nimport type { NumberSeriesSlot } from \"@invinite-org/chartlang-core\";\n\nimport type { Float64RingBuffer } from \"../ringBuffer.js\";\nimport { makeSeriesView } from \"../seriesView.js\";\n\n/**\n * Runtime slot behind a script-facing `state.series(init)` handle. The\n * `buffer` is the history ring (index 0 = live head); the `view` is the\n * identity-stable {@link NumberSeriesSlot} the script reads and writes;\n * `committedHead` snapshots the head as of the last bar close so a tick\n * can reset the live head before the script refines it.\n *\n * Unlike the scalar `StateSlot`, there is no tentative/committed value\n * split — the head IS the tentative value and history IS committed (a bar\n * advances the ring on close). `committedHead` exists only so a tick's\n * `resetSeriesSlotHead` can undo a prior tick's `replaceHead`.\n *\n * @since 0.9\n * @stable\n * @example\n * // const slot = createSeriesSlot(new Float64RingBuffer(8), 0);\n * // slot.view.value = 42;\n * // slot.view[0]; // 42\n */\nexport type SeriesSlot = {\n readonly kind: \"state.series\";\n readonly buffer: Float64RingBuffer;\n readonly view: NumberSeriesSlot;\n committedHead: number;\n};\n\n/**\n * Build the identity-stable {@link NumberSeriesSlot} view over a ring\n * buffer. Series reads (`[n]`, `current`, `length`, `valueOf`,\n * `Symbol.toPrimitive`) delegate to a reused {@link makeSeriesView}; the\n * `value` property is added on top — `get` → `buffer.at(0)` (live head),\n * `set` → `buffer.replaceHead(v)` (write-through to the live head). The\n * object's identity is stable across bars, so a script can keep\n * `const s = state.series(0)` at the top of `compute`.\n *\n * @since 0.9\n * @stable\n * @example\n * // const view = makeSeriesSlotView(buffer);\n * // view.value = 7; // replaceHead\n * // +view; // 7 (valueOf → buffer.at(0))\n * // view[1]; // one committed bar back\n */\nexport function makeSeriesSlotView(buffer: Float64RingBuffer): NumberSeriesSlot {\n const reads = makeSeriesView<number>(buffer);\n return new Proxy(reads as NumberSeriesSlot, {\n get(target, prop, receiver) {\n if (prop === \"value\") return buffer.at(0);\n return Reflect.get(target, prop, receiver);\n },\n set(_target, prop, value) {\n if (prop === \"value\") {\n buffer.replaceHead(value as number);\n return true;\n }\n return false;\n },\n has(target, prop) {\n if (prop === \"value\") return true;\n return Reflect.has(target, prop);\n },\n });\n}\n\n/**\n * Allocate a fresh {@link SeriesSlot}: seed the live head with `init`\n * (matching `state.float(init)` — a never-written series reads `init` on\n * its allocation bar), set `committedHead = init`, and build the\n * identity-stable view. Later bars the script does not write become `NaN`\n * gaps because the close hook advances the ring with `append(NaN)`.\n *\n * @since 0.9\n * @stable\n * @example\n * // const slot = createSeriesSlot(new Float64RingBuffer(8), 0);\n * // slot.view[0]; // 0 (the seeded init on the allocation bar)\n */\nexport function createSeriesSlot(buffer: Float64RingBuffer, init: number): SeriesSlot {\n buffer.append(init);\n return {\n kind: \"state.series\",\n buffer,\n view: makeSeriesSlotView(buffer),\n committedHead: init,\n };\n}\n\n/**\n * Rebuild a {@link SeriesSlot} over an already-restored ring buffer\n * (snapshot path). The view identity is recreated — acceptable, same as\n * `ta.*` restore.\n *\n * @since 0.9\n * @stable\n * @example\n * // const slot = restoreSeriesSlot(restoredBuffer, committedHead);\n * // slot.view[1];\n */\nexport function restoreSeriesSlot(buffer: Float64RingBuffer, committedHead: number): SeriesSlot {\n return {\n kind: \"state.series\",\n buffer,\n view: makeSeriesSlotView(buffer),\n committedHead,\n };\n}\n\n/**\n * Advance the ring for a new close bar: append a fresh `NaN` head so the\n * prior committed head slides to index 1. Runs once per close, before the\n * script's compute, for every already-allocated slot.\n *\n * @since 0.9\n * @stable\n * @example\n * // advanceSeriesSlot(slot); // slot.view[0] is now NaN until written\n */\nexport function advanceSeriesSlot(slot: SeriesSlot): void {\n slot.buffer.append(Number.NaN);\n}\n\n/**\n * Commit the live head as the bar-close value, so the next close's\n * `advanceSeriesSlot` retains it and a subsequent tick's\n * `resetSeriesSlotHead` restores it. Runs once per close, after compute.\n *\n * @since 0.9\n * @stable\n * @example\n * // commitSeriesSlot(slot); // slot.committedHead = slot.view[0]\n */\nexport function commitSeriesSlot(slot: SeriesSlot): void {\n slot.committedHead = slot.buffer.at(0);\n}\n\n/**\n * Reset the live head to the last committed value at the start of a tick,\n * so a tick that re-writes refines from the committed baseline and a tick\n * that does not write reads the committed head. Does NOT advance length.\n *\n * @since 0.9\n * @stable\n * @example\n * // resetSeriesSlotHead(slot); // slot.view[0] = slot.committedHead\n */\nexport function resetSeriesSlotHead(slot: SeriesSlot): void {\n slot.buffer.replaceHead(slot.committedHead);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"stateNamespace.d.ts","sourceRoot":"","sources":["../../src/state/stateNamespace.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAsDhF;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,IAAI,cAAc,CAwBpD"}
1
+ {"version":3,"file":"stateNamespace.d.ts","sourceRoot":"","sources":["../../src/state/stateNamespace.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAiC,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAoFlG;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,IAAI,cAAc,CA0BpD"}
@@ -1,6 +1,8 @@
1
1
  // Copyright (c) 2026 Invinite. Licensed under the MIT License.
2
2
  // See the LICENSE file in the repo root for full license text.
3
+ import { Float64RingBuffer } from "../ringBuffer.js";
3
4
  import { ACTIVE_RUNTIME_CONTEXT } from "../runtimeContext.js";
5
+ import { createSeriesSlot } from "./seriesSlot.js";
4
6
  import { asMutableSlot, StateSlot } from "./stateSlot.js";
5
7
  /**
6
8
  * Compose the runtime's `state.*` slot key from the compiler-injected
@@ -14,6 +16,16 @@ import { asMutableSlot, StateSlot } from "./stateSlot.js";
14
16
  * @internal
15
17
  */
16
18
  const stateKey = (ctx, slotId) => `${ctx.slotIdPrefix ?? ""}${slotId}:state`;
19
+ /**
20
+ * Compose the runtime's `state.series` slot key — the `:series` suffix
21
+ * (vs `:state`) lets the snapshot restore router tell a series slot from a
22
+ * scalar `state.*` slot. The `slotIdPrefix` isolation rule is identical to
23
+ * {@link stateKey}.
24
+ *
25
+ * @since 0.9
26
+ * @internal
27
+ */
28
+ const seriesKey = (ctx, slotId) => `${ctx.slotIdPrefix ?? ""}${slotId}:series`;
17
29
  function getCtx(name) {
18
30
  const ctx = ACTIVE_RUNTIME_CONTEXT.current;
19
31
  if (ctx === null) {
@@ -36,6 +48,21 @@ function getOrAllocate(name, slotId, init, tickPersistent) {
36
48
  ctx.stateSlots.set(key, slot);
37
49
  return asMutableSlot(slot);
38
50
  }
51
+ function getOrAllocateSeries(slotId, init) {
52
+ const ctx = getCtx("state.series");
53
+ const key = seriesKey(ctx, slotId);
54
+ const existing = ctx.seriesSlots.get(key);
55
+ if (existing !== undefined) {
56
+ return existing.view;
57
+ }
58
+ // Size the ring to the runner's global capacity (`maxLookback + 1`, or
59
+ // the 5000-slot dynamic fallback). Warm restart rehydrates `seriesSlots`
60
+ // up front via `restoreSeriesSlots`, so a restored slot is found above
61
+ // and this seed path only runs for a genuinely first-seen callsite.
62
+ const slot = createSeriesSlot(new Float64RingBuffer(ctx.stream.ohlcv.close.capacity), init);
63
+ ctx.seriesSlots.set(key, slot);
64
+ return slot.view;
65
+ }
39
66
  /**
40
67
  * Build the runtime `state` namespace installed on `ComputeContext`.
41
68
  * Each function accepts the compiler-injected `slotId` as its first
@@ -53,6 +80,7 @@ export function buildStateNamespace() {
53
80
  int: (slotId, init) => getOrAllocate("state.int", slotId, init, false),
54
81
  bool: (slotId, init) => getOrAllocate("state.bool", slotId, init, false),
55
82
  string: (slotId, init) => getOrAllocate("state.string", slotId, init, false),
83
+ series: (slotId, init) => getOrAllocateSeries(slotId, init),
56
84
  tick: {
57
85
  float: (slotId, init) => getOrAllocate("state.tick.float", slotId, init, true),
58
86
  int: (slotId, init) => getOrAllocate("state.tick.int", slotId, init, true),
@@ -1 +1 @@
1
- {"version":3,"file":"stateNamespace.js","sourceRoot":"","sources":["../../src/state/stateNamespace.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAI/D,OAAO,EAAE,sBAAsB,EAAuB,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAO1D;;;;;;;;;;GAUG;AACH,MAAM,QAAQ,GAAG,CAAC,GAAmB,EAAE,MAAc,EAAU,EAAE,CAC7D,GAAG,GAAG,CAAC,YAAY,IAAI,EAAE,GAAG,MAAM,QAAQ,CAAC;AAE/C,SAAS,MAAM,CAAC,IAAY;IACxB,MAAM,GAAG,GAAG,sBAAsB,CAAC,OAAO,CAAC;IAC3C,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,uCAAuC,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,GAAG,CAAC;AACf,CAAC;AAED,SAAS,aAAa,CAClB,IAAY,EACZ,MAAc,EACd,IAAO,EACP,cAAuB;IAEvB,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IACzB,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAClC,MAAM,QAAQ,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,aAAa,CAAC,QAAwB,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAqB,GAAG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IAAI,CAAC;YACxD,MAAM,EAAE,CAAC,MAAc,EAAE,IAAY,EAAuB,EAAE,CAC1D,aAAa,CAAC,mBAAmB,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC;SAC7D;KACJ,CAAC;IACF,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACvB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAClB,OAAO,EAA+B,CAAC;AAC3C,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nimport type { MutableSlot, NumberSeriesSlot, StateNamespace } from \"@invinite-org/chartlang-core\";\n\nimport { Float64RingBuffer } from \"../ringBuffer.js\";\nimport { ACTIVE_RUNTIME_CONTEXT, type RuntimeContext } from \"../runtimeContext.js\";\nimport { createSeriesSlot } from \"./seriesSlot.js\";\nimport { asMutableSlot, StateSlot } from \"./stateSlot.js\";\n\ntype StoredStateSlot<T> = {\n readonly committed: T;\n readonly tentative: T;\n};\n\n/**\n * Compose the runtime's `state.*` slot key from the compiler-injected\n * `slotId` plus the active context's `slotIdPrefix`. The primary runner\n * has an absent / empty prefix — its keys stay byte-identical to the\n * Phase-1 `${slotId}:state` shape so single-script snapshots load\n * unchanged. `DepRunner` contexts carry `dep:<localId>/`,\n * `SiblingRunner` contexts carry `export:<exportName>/`.\n *\n * @since 0.7\n * @internal\n */\nconst stateKey = (ctx: RuntimeContext, slotId: string): string =>\n `${ctx.slotIdPrefix ?? \"\"}${slotId}:state`;\n\n/**\n * Compose the runtime's `state.series` slot key — the `:series` suffix\n * (vs `:state`) lets the snapshot restore router tell a series slot from a\n * scalar `state.*` slot. The `slotIdPrefix` isolation rule is identical to\n * {@link stateKey}.\n *\n * @since 0.9\n * @internal\n */\nconst seriesKey = (ctx: RuntimeContext, slotId: string): string =>\n `${ctx.slotIdPrefix ?? \"\"}${slotId}:series`;\n\nfunction getCtx(name: string): RuntimeContext {\n const ctx = ACTIVE_RUNTIME_CONTEXT.current;\n if (ctx === null) {\n throw new Error(`${name} called outside an active script step`);\n }\n return ctx;\n}\n\nfunction getOrAllocate<T>(\n name: string,\n slotId: string,\n init: T,\n tickPersistent: boolean,\n): MutableSlot<T> {\n const ctx = getCtx(name);\n const key = stateKey(ctx, slotId);\n const existing = ctx.stateSlots.get(key);\n if (existing !== undefined) {\n return asMutableSlot(existing as StateSlot<T>);\n }\n\n const stored = ctx.stateStore.get<StoredStateSlot<T>>(key);\n const slot = new StateSlot<T>(stored?.committed ?? init, tickPersistent);\n if (stored !== undefined) {\n slot.tentative = stored.tentative;\n }\n ctx.stateSlots.set(key, slot as StateSlot<unknown>);\n return asMutableSlot(slot);\n}\n\nfunction getOrAllocateSeries(slotId: string, init: number): NumberSeriesSlot {\n const ctx = getCtx(\"state.series\");\n const key = seriesKey(ctx, slotId);\n const existing = ctx.seriesSlots.get(key);\n if (existing !== undefined) {\n return existing.view;\n }\n // Size the ring to the runner's global capacity (`maxLookback + 1`, or\n // the 5000-slot dynamic fallback). Warm restart rehydrates `seriesSlots`\n // up front via `restoreSeriesSlots`, so a restored slot is found above\n // and this seed path only runs for a genuinely first-seen callsite.\n const slot = createSeriesSlot(new Float64RingBuffer(ctx.stream.ohlcv.close.capacity), init);\n ctx.seriesSlots.set(key, slot);\n return slot.view;\n}\n\n/**\n * Build the runtime `state` namespace installed on `ComputeContext`.\n * Each function accepts the compiler-injected `slotId` as its first\n * parameter, then the script-facing init value.\n *\n * @since 0.4\n * @stable\n * @example\n * const ns = buildStateNamespace();\n * void ns.float;\n */\nexport function buildStateNamespace(): StateNamespace {\n const ns = {\n float: (slotId: string, init: number): MutableSlot<number> =>\n getOrAllocate(\"state.float\", slotId, init, false),\n int: (slotId: string, init: number): MutableSlot<number> =>\n getOrAllocate(\"state.int\", slotId, init, false),\n bool: (slotId: string, init: boolean): MutableSlot<boolean> =>\n getOrAllocate(\"state.bool\", slotId, init, false),\n string: (slotId: string, init: string): MutableSlot<string> =>\n getOrAllocate(\"state.string\", slotId, init, false),\n series: (slotId: string, init: number): NumberSeriesSlot =>\n getOrAllocateSeries(slotId, init),\n tick: {\n float: (slotId: string, init: number): MutableSlot<number> =>\n getOrAllocate(\"state.tick.float\", slotId, init, true),\n int: (slotId: string, init: number): MutableSlot<number> =>\n getOrAllocate(\"state.tick.int\", slotId, init, true),\n bool: (slotId: string, init: boolean): MutableSlot<boolean> =>\n getOrAllocate(\"state.tick.bool\", slotId, init, true),\n string: (slotId: string, init: string): MutableSlot<string> =>\n getOrAllocate(\"state.tick.string\", slotId, init, true),\n },\n };\n Object.freeze(ns.tick);\n Object.freeze(ns);\n return ns as unknown as StateNamespace;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"stateSlot.js","sourceRoot":"","sources":["../../src/state/stateSlot.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAwB/D;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,SAAS;IAME;IACC;IANrB,SAAS,CAAI;IACb,SAAS,CAAI;IAEb,YACI,IAAO,EACS,cAAuB,EACtB,cAAuC,EAAE;QAD1C,mBAAc,GAAd,cAAc,CAAS;QACtB,gBAAW,GAAX,WAAW,CAA8B;QAE1D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,GAAG;QACC,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;IACjE,CAAC;IAED,GAAG,CAAC,KAAQ;QACR,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACtB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QAC3B,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QAC3B,CAAC;IACL,CAAC;IAED,UAAU;QACN,IAAI,CAAC,IAAI,C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I,CAAC,SAAS,GAAG,KAAK,CAAC;QAC3B,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QAC3B,CAAC;IACL,CAAC;IAED,UAAU;QACN,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;YACvB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QACpC,CAAC;IACL,CAAC;IAED,SAAS;QACL,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;YACvB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QACpC,CAAC;IACL,CAAC;IAED,SAAS,CAAC,KAAQ;QACd,OAAO,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;IAC7D,CAAC;CACJ;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAI,IAAkB;IAC/C,OAAO;QACH,IAAI,KAAK;YACL,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC;QACtB,CAAC;QACD,IAAI,KAAK,CAAC,KAAQ;YACd,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nimport type { MutableSlot } from \"@invinite-org/chartlang-core\";\n\n/**\n * Optional PLAN §6.9 state-slot marshal hooks. Phase-4 `state.*`\n * primitives use the identity default because their values are already\n * JSON-clean; future primitives with typed-array internals can provide\n * explicit hooks.\n *\n * @since 0.5\n * @stable\n * @example\n * const hooks: StateSlotSerialisers<number> = {\n * serialiseState: (value) => value,\n * deserialiseState: (value) => Number(value),\n * };\n * void hooks;\n */\nexport type StateSlotSerialisers<T> = {\n readonly serialiseState?: (value: T) => unknown;\n readonly deserialiseState?: (value: unknown) => T;\n};\n\n/**\n * Internal runtime slot behind script-facing {@link MutableSlot}\n * proxies. `tickPersistent: true` models `state.tick.*`, whose writes\n * commit immediately; `false` models `state.*`, whose writes remain\n * tentative until bar close.\n *\n * @since 0.4\n * @stable\n * @example\n * const slot = new StateSlot(0, false);\n * slot.set(5);\n * slot.onBarClose();\n * const pair = { committed: slot.committed, tentative: slot.tentative };\n * void pair;\n */\nexport class StateSlot<T> {\n committed: T;\n tentative: T;\n\n constructor(\n init: T,\n public readonly tickPersistent: boolean,\n private readonly serialisers: StateSlotSerialisers<T> = {},\n ) {\n this.committed = init;\n this.tentative = init;\n }\n\n get(): T {\n return this.tickPersistent ? this.committed : this.tentative;\n }\n\n set(value: T): void {\n if (this.tickPersistent) {\n this.committed = value;\n } else {\n this.tentative = value;\n }\n }\n\n onBarClose(): void {\n if (!this.tickPersistent) {\n this.committed = this.tentative;\n }\n }\n\n onBarTick(): void {\n if (!this.tickPersistent) {\n this.tentative = this.committed;\n }\n }\n\n serialise(value: T): unknown {\n return this.serialisers.serialiseState?.(value) ?? value;\n }\n}\n\n/**\n * Build the script-facing mutable proxy for a runtime state slot.\n *\n * @since 0.4\n * @stable\n * @example\n * const slot = asMutableSlot(new StateSlot(1, false));\n * slot.value = 2;\n * void slot.value;\n */\nexport function asMutableSlot<T>(slot: StateSlot<T>): MutableSlot<T> {\n return {\n get value(): T {\n return slot.get();\n },\n set value(value: T) {\n slot.set(value);\n },\n };\n}\n"]}
@@ -2,11 +2,11 @@
2
2
  * Per-runner slot store the runtime hands stateful primitives. Phase 1
3
3
  * ships only the in-memory default — `inMemoryStateStore()` — keyed
4
4
  * by `${slotIdPrefix ?? ""}${slotId}:state` where the slot id is the
5
- * compiler-assigned id from PLAN.md §5.5 and the prefix is the active
5
+ * compiler-assigned id and the prefix is the active
6
6
  * `RuntimeContext.slotIdPrefix` (`""` for primary, `dep:<localId>/`
7
7
  * for deps, `export:<exportName>/` for siblings — see Task 5). Phase 5
8
8
  * layers a `PersistentStateStore` sub-interface on top with snapshot
9
- * `load` / `save` / `clear` methods (see PLAN.md §6.9). Implementations
9
+ * `load` / `save` / `clear` methods. Implementations
10
10
  * (IDB-backed for browsers, caller-supplied for servers) satisfy the
11
11
  * Phase-5 sub-interface; the Phase-1 surface stays stable and
12
12
  * additive.
@@ -1 +1 @@
1
- {"version":3,"file":"stateStore.js","sourceRoot":"","sources":["../src/stateStore.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AA8B/D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,kBAAkB;IAC9B,MAAM,KAAK,GAAG,IAAI,GAAG,EAAmB,CAAC;IACzC,OAAO;QACH,GAAG,CAAI,EAAU;YACb,OAAO,KAAK,CAAC,GAAG,CAAC,EAAE,CAAkB,CAAC;QAC1C,CAAC;QACD,GAAG,CAAI,EAAU,EAAE,KAAQ;YACvB,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACzB,CAAC;QACD,GAAG,CAAC,EAAU;YACV,OAAO,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACzB,CAAC;QACD,KAAK;YACD,KAAK,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC;KACJ,CAAC;AACN,CAAC"}
1
+ {"version":3,"file":"stateStore.js","sourceRoot":"","sources":["../src/stateStore.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AA8B/D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,kBAAkB;IAC9B,MAAM,KAAK,GAAG,IAAI,GAAG,EAAmB,CAAC;IACzC,OAAO;QACH,GAAG,CAAI,EAAU;YACb,OAAO,KAAK,CAAC,GAAG,CAAC,EAAE,CAAkB,CAAC;QAC1C,CAAC;QACD,GAAG,CAAI,EAAU,EAAE,KAAQ;YACvB,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACzB,CAAC;QACD,GAAG,CAAC,EAAU;YACV,OAAO,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACzB,CAAC;QACD,KAAK;YACD,KAAK,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\n/**\n * Per-runner slot store the runtime hands stateful primitives. Phase 1\n * ships only the in-memory default — `inMemoryStateStore()` — keyed\n * by `${slotIdPrefix ?? \"\"}${slotId}:state` where the slot id is the\n * compiler-assigned id and the prefix is the active\n * `RuntimeContext.slotIdPrefix` (`\"\"` for primary, `dep:<localId>/`\n * for deps, `export:<exportName>/` for siblings — see Task 5). Phase 5\n * layers a `PersistentStateStore` sub-interface on top with snapshot\n * `load` / `save` / `clear` methods. Implementations\n * (IDB-backed for browsers, caller-supplied for servers) satisfy the\n * Phase-5 sub-interface; the Phase-1 surface stays stable and\n * additive.\n *\n * @since 0.1\n * @example\n * // import { inMemoryStateStore } from \"@invinite-org/chartlang-runtime\";\n * // const store = inMemoryStateStore();\n * // store.set<{ count: number }>(\"ta:ema:slot#0\", { count: 1 });\n * // store.has(\"ta:ema:slot#0\"); // true\n * // store.get<{ count: number }>(\"ta:ema:slot#0\"); // { count: 1 }\n */\nexport type StateStore = {\n get<T>(slotId: string): T | undefined;\n set<T>(slotId: string, value: T): void;\n has(slotId: string): boolean;\n clear(): void;\n};\n\n/**\n * Default Phase-1 `StateStore` — a process-local `Map<string, unknown>`\n * with last-write-wins semantics. Used by the CLI, the conformance\n * suite, and the host-worker until Phase 5 wires the IDB backing.\n *\n * @since 0.1\n * @example\n * // import { inMemoryStateStore } from \"@invinite-org/chartlang-runtime\";\n * // const store = inMemoryStateStore();\n * // store.set(\"slot#0\", 42);\n * // store.get<number>(\"slot#0\"); // 42\n * // store.clear();\n * // store.has(\"slot#0\"); // false\n */\nexport function inMemoryStateStore(): StateStore {\n const store = new Map<string, unknown>();\n return {\n get<T>(id: string): T | undefined {\n return store.get(id) as T | undefined;\n },\n set<T>(id: string, value: T): void {\n store.set(id, value);\n },\n has(id: string): boolean {\n return store.has(id);\n },\n clear(): void {\n store.clear();\n },\n };\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { Bar, BarViewport, Series, StreamSnapshot } from "@invinite-org/chartlang-core";
1
+ import type { Bar, BarViewport, Price, PriceSeries, Series, StreamSnapshot, VolumeSeries, WorldPoint } from "@invinite-org/chartlang-core";
2
2
  import { Float64RingBuffer } from "./ringBuffer.js";
3
3
  /**
4
4
  * The per-stream OHLCV ring-buffer set. Each field is a
@@ -31,13 +31,17 @@ export type OhlcvBuffers = {
31
31
  readonly hlcc4: Float64RingBuffer;
32
32
  };
33
33
  /**
34
- * Mutable scalar view of the current bar. Identity stays stable across
35
- * the run Task 6's execution loop mutates the fields in place per
36
- * bar so scripts that destructure `bar` in `compute` keep seeing fresh
37
- * values without rebinding.
34
+ * View of the current bar handed to `compute`. Identity stays stable across
35
+ * the run. The OHLCV + derived price/volume fields are the stream's cached
36
+ * number-coercible `Series` views (one identity per ring buffer) they read
37
+ * the live buffer head, so a script can both use `bar.close` as a scalar
38
+ * (`bar.close * 2`) and index it (`bar.close[1]`) without the runtime copying
39
+ * scalars per bar. `time` stays a mutable scalar (the timestamp axis the
40
+ * emit/draw pipeline consumes as a raw number); `symbol` / `interval` are
41
+ * constant strings for a given `StreamState`.
38
42
  *
39
- * `symbol` and `interval` are constant for a given `StreamState`
40
- * instance; the rest are NaN / 0 before the first bar lands.
43
+ * Before the first bar the buffers are empty, so `bar.close[0]` / `+bar.close`
44
+ * read `NaN` and `bar.close.length` is `0`.
41
45
  *
42
46
  * @since 0.1
43
47
  * @example
@@ -47,24 +51,26 @@ export type OhlcvBuffers = {
47
51
  * // capacity: 5,
48
52
  * // symbol: "AAPL",
49
53
  * // });
50
- * // bar.symbol; // "AAPL"
51
- * // bar.interval; // "1D"
52
- * // bar.close; // NaN until the first bar
54
+ * // bar.symbol; // "AAPL"
55
+ * // bar.interval; // "1D"
56
+ * // +bar.close; // NaN until the first bar
57
+ * // bar.close.length; // 0 until the first bar
53
58
  */
54
59
  export type BarView = {
55
60
  time: number;
56
- open: number;
57
- high: number;
58
- low: number;
59
- close: number;
60
- volume: number;
61
- hl2: number;
62
- hlc3: number;
63
- ohlc4: number;
64
- hlcc4: number;
61
+ open: PriceSeries;
62
+ high: PriceSeries;
63
+ low: PriceSeries;
64
+ close: PriceSeries;
65
+ volume: VolumeSeries;
66
+ hl2: PriceSeries;
67
+ hlc3: PriceSeries;
68
+ ohlc4: PriceSeries;
69
+ hlcc4: PriceSeries;
65
70
  symbol: string;
66
71
  interval: string;
67
72
  viewport: BarViewport;
73
+ point(offset: number, price: Price): WorldPoint;
68
74
  };
69
75
  /**
70
76
  * Everything the runtime owns for a single interval stream — the OHLCV
@@ -110,7 +116,7 @@ export type StreamState = {
110
116
  };
111
117
  /**
112
118
  * Construct a fresh `StreamState`. The ring-buffer capacity is the
113
- * compiler-emitted `manifest.maxLookback + 1` per PLAN.md §6.6
119
+ * compiler-emitted `manifest.maxLookback + 1`
114
120
  * (caller must enforce `capacity >= 1`). All buffers start empty;
115
121
  * the `BarView` starts with `NaN` prices, `0` time and volume, and the
116
122
  * supplied `symbol` / `interval` constants. `taSlots` is an empty map.
@@ -1 +1 @@
1
- {"version":3,"file":"streamState.d.ts","sourceRoot":"","sources":["../src/streamState.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAmBpD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,YAAY,GAAG;IACvB,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,GAAG,EAAE,iBAAiB,CAAC;IAChC,QAAQ,CAAC,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