@invinite-org/chartlang-core 1.0.1

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 (208) hide show
  1. package/CHANGELOG.md +1694 -0
  2. package/LICENSE +21 -0
  3. package/README.md +53 -0
  4. package/dist/alert/alert.d.ts +32 -0
  5. package/dist/alert/alert.d.ts.map +1 -0
  6. package/dist/alert/alert.js +19 -0
  7. package/dist/alert/alert.js.map +1 -0
  8. package/dist/alert/index.d.ts +2 -0
  9. package/dist/alert/index.d.ts.map +1 -0
  10. package/dist/alert/index.js +4 -0
  11. package/dist/alert/index.js.map +1 -0
  12. package/dist/color/colorHelpers.d.ts +65 -0
  13. package/dist/color/colorHelpers.d.ts.map +1 -0
  14. package/dist/color/colorHelpers.js +137 -0
  15. package/dist/color/colorHelpers.js.map +1 -0
  16. package/dist/color/index.d.ts +37 -0
  17. package/dist/color/index.d.ts.map +1 -0
  18. package/dist/color/index.js +23 -0
  19. package/dist/color/index.js.map +1 -0
  20. package/dist/color/parseColor.d.ts +48 -0
  21. package/dist/color/parseColor.d.ts.map +1 -0
  22. package/dist/color/parseColor.js +141 -0
  23. package/dist/color/parseColor.js.map +1 -0
  24. package/dist/define/defineAlert.d.ts +43 -0
  25. package/dist/define/defineAlert.d.ts.map +1 -0
  26. package/dist/define/defineAlert.js +49 -0
  27. package/dist/define/defineAlert.js.map +1 -0
  28. package/dist/define/defineAlertCondition.d.ts +65 -0
  29. package/dist/define/defineAlertCondition.d.ts.map +1 -0
  30. package/dist/define/defineAlertCondition.js +64 -0
  31. package/dist/define/defineAlertCondition.js.map +1 -0
  32. package/dist/define/defineDrawing.d.ts +62 -0
  33. package/dist/define/defineDrawing.d.ts.map +1 -0
  34. package/dist/define/defineDrawing.js +67 -0
  35. package/dist/define/defineDrawing.js.map +1 -0
  36. package/dist/define/defineIndicator.d.ts +48 -0
  37. package/dist/define/defineIndicator.d.ts.map +1 -0
  38. package/dist/define/defineIndicator.js +54 -0
  39. package/dist/define/defineIndicator.js.map +1 -0
  40. package/dist/define/index.d.ts +6 -0
  41. package/dist/define/index.d.ts.map +1 -0
  42. package/dist/define/index.js +7 -0
  43. package/dist/define/index.js.map +1 -0
  44. package/dist/define/overrides.d.ts +102 -0
  45. package/dist/define/overrides.d.ts.map +1 -0
  46. package/dist/define/overrides.js +4 -0
  47. package/dist/define/overrides.js.map +1 -0
  48. package/dist/draw/buckets.d.ts +57 -0
  49. package/dist/draw/buckets.d.ts.map +1 -0
  50. package/dist/draw/buckets.js +110 -0
  51. package/dist/draw/buckets.js.map +1 -0
  52. package/dist/draw/draw.d.ts +128 -0
  53. package/dist/draw/draw.d.ts.map +1 -0
  54. package/dist/draw/draw.js +40 -0
  55. package/dist/draw/draw.js.map +1 -0
  56. package/dist/draw/drawingKind.d.ts +80 -0
  57. package/dist/draw/drawingKind.d.ts.map +1 -0
  58. package/dist/draw/drawingKind.js +177 -0
  59. package/dist/draw/drawingKind.js.map +1 -0
  60. package/dist/draw/drawingState.d.ts +1420 -0
  61. package/dist/draw/drawingState.d.ts.map +1 -0
  62. package/dist/draw/drawingState.js +4 -0
  63. package/dist/draw/drawingState.js.map +1 -0
  64. package/dist/draw/drawingStyle.d.ts +219 -0
  65. package/dist/draw/drawingStyle.d.ts.map +1 -0
  66. package/dist/draw/drawingStyle.js +4 -0
  67. package/dist/draw/drawingStyle.js.map +1 -0
  68. package/dist/draw/handle.d.ts +32 -0
  69. package/dist/draw/handle.d.ts.map +1 -0
  70. package/dist/draw/handle.js +4 -0
  71. package/dist/draw/handle.js.map +1 -0
  72. package/dist/draw/index.d.ts +13 -0
  73. package/dist/draw/index.d.ts.map +1 -0
  74. package/dist/draw/index.js +7 -0
  75. package/dist/draw/index.js.map +1 -0
  76. package/dist/draw/table.d.ts +84 -0
  77. package/dist/draw/table.d.ts.map +1 -0
  78. package/dist/draw/table.js +22 -0
  79. package/dist/draw/table.js.map +1 -0
  80. package/dist/draw/worldPoint.d.ts +114 -0
  81. package/dist/draw/worldPoint.d.ts.map +1 -0
  82. package/dist/draw/worldPoint.js +4 -0
  83. package/dist/draw/worldPoint.js.map +1 -0
  84. package/dist/index.d.ts +28 -0
  85. package/dist/index.d.ts.map +1 -0
  86. package/dist/index.js +16 -0
  87. package/dist/index.js.map +1 -0
  88. package/dist/input/index.d.ts +3 -0
  89. package/dist/input/index.d.ts.map +1 -0
  90. package/dist/input/index.js +4 -0
  91. package/dist/input/index.js.map +1 -0
  92. package/dist/input/input.d.ts +174 -0
  93. package/dist/input/input.d.ts.map +1 -0
  94. package/dist/input/input.js +174 -0
  95. package/dist/input/input.js.map +1 -0
  96. package/dist/input/inputDescriptor.d.ts +204 -0
  97. package/dist/input/inputDescriptor.d.ts.map +1 -0
  98. package/dist/input/inputDescriptor.js +4 -0
  99. package/dist/input/inputDescriptor.js.map +1 -0
  100. package/dist/interval/intervalToSeconds.d.ts +20 -0
  101. package/dist/interval/intervalToSeconds.d.ts.map +1 -0
  102. package/dist/interval/intervalToSeconds.js +50 -0
  103. package/dist/interval/intervalToSeconds.js.map +1 -0
  104. package/dist/plot/index.d.ts +2 -0
  105. package/dist/plot/index.d.ts.map +1 -0
  106. package/dist/plot/index.js +4 -0
  107. package/dist/plot/index.js.map +1 -0
  108. package/dist/plot/plot.d.ts +277 -0
  109. package/dist/plot/plot.d.ts.map +1 -0
  110. package/dist/plot/plot.js +37 -0
  111. package/dist/plot/plot.js.map +1 -0
  112. package/dist/request/index.d.ts +2 -0
  113. package/dist/request/index.d.ts.map +1 -0
  114. package/dist/request/index.js +4 -0
  115. package/dist/request/index.js.map +1 -0
  116. package/dist/request/request.d.ts +106 -0
  117. package/dist/request/request.d.ts.map +1 -0
  118. package/dist/request/request.js +44 -0
  119. package/dist/request/request.js.map +1 -0
  120. package/dist/runtime/index.d.ts +3 -0
  121. package/dist/runtime/index.d.ts.map +1 -0
  122. package/dist/runtime/index.js +4 -0
  123. package/dist/runtime/index.js.map +1 -0
  124. package/dist/runtime/runtime.d.ts +84 -0
  125. package/dist/runtime/runtime.d.ts.map +1 -0
  126. package/dist/runtime/runtime.js +72 -0
  127. package/dist/runtime/runtime.js.map +1 -0
  128. package/dist/state/index.d.ts +5 -0
  129. package/dist/state/index.d.ts.map +1 -0
  130. package/dist/state/index.js +4 -0
  131. package/dist/state/index.js.map +1 -0
  132. package/dist/state/mutableSlot.d.ts +25 -0
  133. package/dist/state/mutableSlot.d.ts.map +1 -0
  134. package/dist/state/mutableSlot.js +4 -0
  135. package/dist/state/mutableSlot.js.map +1 -0
  136. package/dist/state/snapshot.d.ts +108 -0
  137. package/dist/state/snapshot.d.ts.map +1 -0
  138. package/dist/state/snapshot.js +4 -0
  139. package/dist/state/snapshot.js.map +1 -0
  140. package/dist/state/state.d.ts +86 -0
  141. package/dist/state/state.d.ts.map +1 -0
  142. package/dist/state/state.js +95 -0
  143. package/dist/state/state.js.map +1 -0
  144. package/dist/statefulPrimitives.d.ts +71 -0
  145. package/dist/statefulPrimitives.d.ts.map +1 -0
  146. package/dist/statefulPrimitives.js +234 -0
  147. package/dist/statefulPrimitives.js.map +1 -0
  148. package/dist/ta/index.d.ts +2 -0
  149. package/dist/ta/index.d.ts.map +1 -0
  150. package/dist/ta/index.js +4 -0
  151. package/dist/ta/index.js.map +1 -0
  152. package/dist/ta/ta.d.ts +2476 -0
  153. package/dist/ta/ta.d.ts.map +1 -0
  154. package/dist/ta/ta.js +312 -0
  155. package/dist/ta/ta.js.map +1 -0
  156. package/dist/time/_lib/dateTimeFormatCache.d.ts +11 -0
  157. package/dist/time/_lib/dateTimeFormatCache.d.ts.map +1 -0
  158. package/dist/time/_lib/dateTimeFormatCache.js +22 -0
  159. package/dist/time/_lib/dateTimeFormatCache.js.map +1 -0
  160. package/dist/time/index.d.ts +7 -0
  161. package/dist/time/index.d.ts.map +1 -0
  162. package/dist/time/index.js +8 -0
  163. package/dist/time/index.js.map +1 -0
  164. package/dist/time/nyDayKey.d.ts +24 -0
  165. package/dist/time/nyDayKey.d.ts.map +1 -0
  166. package/dist/time/nyDayKey.js +49 -0
  167. package/dist/time/nyDayKey.js.map +1 -0
  168. package/dist/time/session.d.ts +16 -0
  169. package/dist/time/session.d.ts.map +1 -0
  170. package/dist/time/session.js +18 -0
  171. package/dist/time/session.js.map +1 -0
  172. package/dist/time/sessionBoundaries.d.ts +40 -0
  173. package/dist/time/sessionBoundaries.d.ts.map +1 -0
  174. package/dist/time/sessionBoundaries.js +102 -0
  175. package/dist/time/sessionBoundaries.js.map +1 -0
  176. package/dist/time/types.d.ts +34 -0
  177. package/dist/time/types.d.ts.map +1 -0
  178. package/dist/time/types.js +4 -0
  179. package/dist/time/types.js.map +1 -0
  180. package/dist/time/weekKey.d.ts +11 -0
  181. package/dist/time/weekKey.d.ts.map +1 -0
  182. package/dist/time/weekKey.js +25 -0
  183. package/dist/time/weekKey.js.map +1 -0
  184. package/dist/time/weekday.d.ts +12 -0
  185. package/dist/time/weekday.d.ts.map +1 -0
  186. package/dist/time/weekday.js +22 -0
  187. package/dist/time/weekday.js.map +1 -0
  188. package/dist/types.d.ts +464 -0
  189. package/dist/types.d.ts.map +1 -0
  190. package/dist/types.js +4 -0
  191. package/dist/types.js.map +1 -0
  192. package/dist/views/barstate.d.ts +40 -0
  193. package/dist/views/barstate.d.ts.map +1 -0
  194. package/dist/views/barstate.js +22 -0
  195. package/dist/views/barstate.js.map +1 -0
  196. package/dist/views/index.d.ts +4 -0
  197. package/dist/views/index.d.ts.map +1 -0
  198. package/dist/views/index.js +4 -0
  199. package/dist/views/index.js.map +1 -0
  200. package/dist/views/syminfo.d.ts +46 -0
  201. package/dist/views/syminfo.d.ts.map +1 -0
  202. package/dist/views/syminfo.js +25 -0
  203. package/dist/views/syminfo.js.map +1 -0
  204. package/dist/views/timeframe.d.ts +40 -0
  205. package/dist/views/timeframe.d.ts.map +1 -0
  206. package/dist/views/timeframe.js +21 -0
  207. package/dist/views/timeframe.js.map +1 -0
  208. package/package.json +45 -0
@@ -0,0 +1,464 @@
1
+ import type { ScaleAxis, ValueFormat } from "./define/overrides.js";
2
+ import type { DrawNamespace } from "./draw/draw.js";
3
+ import type { InputDescriptor } from "./input/inputDescriptor.js";
4
+ import type { RequestNamespace } from "./request/index.js";
5
+ import type { RuntimeNamespace } from "./runtime/index.js";
6
+ import type { StateNamespace } from "./state/state.js";
7
+ import type { TaNamespace } from "./ta/ta.js";
8
+ import type { BarStateView, SymInfoView, TimeframeView } from "./views/index.js";
9
+ /**
10
+ * UTC milliseconds since epoch — the only time representation the runtime
11
+ * speaks. Display-side timezones are the adapter's responsibility.
12
+ *
13
+ * @since 0.1
14
+ * @example
15
+ * const t: Time = 1_700_000_000_000;
16
+ */
17
+ export type Time = number;
18
+ /**
19
+ * A price quote in the symbol's quote currency, finite or NaN. NaN marks an
20
+ * unwarmed series slot.
21
+ *
22
+ * @since 0.1
23
+ * @example
24
+ * const last: Price = 42.31;
25
+ */
26
+ export type Price = number;
27
+ /**
28
+ * Traded volume for the bar, in the symbol's native unit (shares, contracts,
29
+ * coins, …).
30
+ *
31
+ * @since 0.1
32
+ * @example
33
+ * const v: Volume = 1_250_000;
34
+ */
35
+ export type Volume = number;
36
+ /**
37
+ * Visible chart range in UTC milliseconds. Phase 5's OSS runtime
38
+ * supplies a fallback range spanning the latest 100 bars ending at the
39
+ * current head; adapters with a real viewport can replace this view in
40
+ * later phases.
41
+ *
42
+ * @since 0.5
43
+ * @stable
44
+ * @example
45
+ * const viewport: BarViewport = {
46
+ * fromTime: 1_700_000_000_000,
47
+ * toTime: 1_700_006_000_000,
48
+ * };
49
+ */
50
+ export type BarViewport = Readonly<{
51
+ readonly fromTime: Time;
52
+ readonly toTime: Time;
53
+ }>;
54
+ /**
55
+ * The OHLCV record the runtime hands to `compute` for the current bar. Every
56
+ * field is `readonly`; scripts must not mutate it.
57
+ *
58
+ * Phase 2 surfaces the four pre-computed derived sources (`hl2` / `hlc3` /
59
+ * `ohlc4` / `hlcc4`) the runtime's `BarView`
60
+ * (`packages/runtime/src/streamState.ts`) already populates on every close.
61
+ * Script authors can write `ta.cci(bar.hlc3, 20)` directly — matching Pine's
62
+ * canonical `bar.hlc3` / `bar.ohlc4` access pattern — without re-computing
63
+ * the derived source per lookup.
64
+ *
65
+ * @since 0.1
66
+ * @example
67
+ * function tick(bar: Bar): void {
68
+ * console.log(bar.close, bar.symbol, bar.interval);
69
+ * // Phase 2 — Pine-style derived sources:
70
+ * console.log(bar.hl2, bar.hlc3, bar.ohlc4, bar.hlcc4);
71
+ * // Phase 5 — visible-range fallback:
72
+ * console.log(bar.viewport.fromTime, bar.viewport.toTime);
73
+ * }
74
+ */
75
+ export type Bar = {
76
+ readonly time: Time;
77
+ readonly open: Price;
78
+ readonly high: Price;
79
+ readonly low: Price;
80
+ readonly close: Price;
81
+ readonly volume: Volume;
82
+ readonly symbol: string;
83
+ readonly interval: string;
84
+ /** `(high + low) / 2`. @since 0.2 */
85
+ readonly hl2: Price;
86
+ /** `(high + low + close) / 3`. @since 0.2 */
87
+ readonly hlc3: Price;
88
+ /** `(open + high + low + close) / 4`. @since 0.2 */
89
+ readonly ohlc4: Price;
90
+ /** `(high + low + close + close) / 4` (Pine's `hlcc4`). @since 0.2 */
91
+ readonly hlcc4: Price;
92
+ /** Visible-range fallback used by viewport-aware primitives. @since 0.5 */
93
+ readonly viewport?: BarViewport;
94
+ };
95
+ /**
96
+ * Read-only view over a ring-buffered history of values. `current` is bar 0,
97
+ * numeric indices look back N bars. The runtime owns the storage; scripts see
98
+ * only this shape.
99
+ *
100
+ * @since 0.1
101
+ * @example
102
+ * function delta(close: Series<number>): number {
103
+ * return close.current - close[1];
104
+ * }
105
+ */
106
+ export type Series<T> = {
107
+ readonly current: T;
108
+ readonly [n: number]: T;
109
+ readonly length: number;
110
+ };
111
+ /**
112
+ * CSS color string — `"#rrggbb"`, `"rgb(...)"`, `"hsl(...)"`, etc. Adapters
113
+ * round-trip the string verbatim.
114
+ *
115
+ * @since 0.1
116
+ * @example
117
+ * const blue: Color = "#3b82f6";
118
+ */
119
+ export type Color = string;
120
+ /**
121
+ * Stroke style for `plot` and `hline` lines. Adapters that cannot render a
122
+ * style fall back to `"solid"` and emit `"line-style-unsupported"`.
123
+ *
124
+ * @since 0.1
125
+ * @example
126
+ * const ls: LineStyle = "dashed";
127
+ */
128
+ export type LineStyle = "solid" | "dashed" | "dotted";
129
+ /**
130
+ * The rendered shape an adapter requests for a `plot` emission. Maps to
131
+ * `Capabilities.plotKinds`.
132
+ *
133
+ * @since 0.1
134
+ * @example
135
+ * const k: PlotLineStyle = "step";
136
+ */
137
+ export type PlotLineStyle = "line" | "step" | "dashed" | "circles" | "cross";
138
+ /**
139
+ * Alert severity used by `alert(...)` and downstream alert channels. Defaults
140
+ * to `"info"` when callers omit `opts.severity`.
141
+ *
142
+ * @since 0.1
143
+ * @example
144
+ * const sev: AlertSeverity = "warning";
145
+ */
146
+ export type AlertSeverity = "info" | "warning" | "critical";
147
+ /**
148
+ * Adapter-declared timeframe entry surfaced in the script-settings UI. The
149
+ * optional `intervalSeconds` override lets exotic intervals declare their
150
+ * effective duration without extending the standard parser grammar.
151
+ *
152
+ * @since 0.1
153
+ * @example
154
+ * const d: IntervalDescriptor = {
155
+ * value: "1D",
156
+ * label: "1 day",
157
+ * group: "Days",
158
+ * };
159
+ */
160
+ export type IntervalDescriptor = {
161
+ readonly value: string;
162
+ readonly label: string;
163
+ readonly group: string;
164
+ /**
165
+ * Optional positive finite second-count override used by interval
166
+ * ordering helpers before parsing `value`.
167
+ *
168
+ * @since 0.6
169
+ * @stable
170
+ */
171
+ readonly intervalSeconds?: number;
172
+ };
173
+ /**
174
+ * Script-author-declared input schema attached to `defineIndicator` /
175
+ * `defineAlert` / `defineDrawing`. Each key carries an `InputDescriptor<T>`
176
+ * returned by an `input.*` builder. The compiler serialises this schema into
177
+ * `manifest.inputs`; the runtime resolves user overrides against defaults.
178
+ *
179
+ * @since 0.1 — widened in 0.4 from opaque `Readonly<Record<string, unknown>>`
180
+ * to the typed `InputDescriptor<unknown>` shape returned by `input.*`
181
+ * builders. Existing scripts stay source-compatible because the previous
182
+ * opaque record subsumes the new typed shape.
183
+ * @example
184
+ * import { input } from "@invinite-org/chartlang-core";
185
+ * const inputs: InputSchema = { length: input.int(20) };
186
+ * void inputs;
187
+ */
188
+ export type InputSchema = Readonly<Record<string, InputDescriptor<unknown>>>;
189
+ /**
190
+ * Discriminator for the Phase-1 adapter capability subset the script-side
191
+ * surface references. The full `Capabilities` type lives in
192
+ * `@invinite-org/chartlang-adapter-kit` (Task 4); only the id strings appear
193
+ * here.
194
+ *
195
+ * @since 0.1
196
+ * @example
197
+ * const caps: ReadonlyArray<CapabilityId> = ["indicators", "alerts"];
198
+ */
199
+ export type CapabilityId = "indicators" | "drawings" | "alerts" | "alertConditions";
200
+ /**
201
+ * Per-script drawing-emission budget. Excess `draw.*` calls drop with
202
+ * `drawing-budget-exceeded` once a bucket is full. Mirrors Pine's
203
+ * `max_*_count` family. The runtime enforces
204
+ * `min(scriptManifest.maxDrawings, adapter.capabilities.maxDrawingsPerScript)`
205
+ * per bucket per PLAN.md §10 / §4.1.
206
+ *
207
+ * Canonical declaration lives here in core so both
208
+ * `ScriptManifest.maxDrawings?` and the adapter-kit re-export pin the
209
+ * same shape — preserving the adapter-kit → core dependency direction.
210
+ *
211
+ * @since 0.3
212
+ * @stable
213
+ * @example
214
+ * const c: DrawingCounts = {
215
+ * lines: 50, labels: 50, boxes: 50, polylines: 50, other: 50,
216
+ * };
217
+ * void c;
218
+ */
219
+ export type DrawingCounts = {
220
+ readonly lines: number;
221
+ readonly labels: number;
222
+ readonly boxes: number;
223
+ readonly polylines: number;
224
+ readonly other: number;
225
+ };
226
+ /**
227
+ * The metadata sidecar the compiler emits next to a compiled script. The
228
+ * runtime reads this to size ring buffers, gate against adapter capabilities,
229
+ * and pick secondary candle streams.
230
+ *
231
+ * @since 0.1
232
+ * @example
233
+ * const m: ScriptManifest = {
234
+ * apiVersion: 1,
235
+ * kind: "indicator",
236
+ * name: "demo",
237
+ * inputs: {},
238
+ * capabilities: ["indicators"],
239
+ * requestedIntervals: [],
240
+ * userPickableInterval: false,
241
+ * seriesCapacities: {},
242
+ * maxLookback: 0,
243
+ * shortName: "demo",
244
+ * format: "compact",
245
+ * };
246
+ */
247
+ export type ScriptManifest = {
248
+ readonly apiVersion: 1;
249
+ readonly kind: "indicator" | "drawing" | "alert" | "alertCondition";
250
+ readonly name: string;
251
+ readonly inputs: InputSchema;
252
+ readonly capabilities: ReadonlyArray<CapabilityId>;
253
+ readonly requestedIntervals: ReadonlyArray<string>;
254
+ readonly userPickableInterval: boolean;
255
+ readonly seriesCapacities: Readonly<Record<string, number>>;
256
+ readonly maxLookback: number;
257
+ /**
258
+ * Per-bucket cap on `draw.*` emissions the script intends to
259
+ * produce per bar. The runtime enforces
260
+ * `min(this, adapter.capabilities.maxDrawingsPerScript)` per
261
+ * bucket. Omit to default to the adapter's cap.
262
+ *
263
+ * @since 0.3
264
+ */
265
+ readonly maxDrawings?: DrawingCounts;
266
+ /**
267
+ * Max bars of historical lookback the script declares it needs.
268
+ *
269
+ * @since 0.4
270
+ * @example
271
+ * const v: ScriptManifest["maxBarsBack"] = 100;
272
+ * void v;
273
+ */
274
+ readonly maxBarsBack?: number;
275
+ /**
276
+ * Value-formatting hint for axis labels + cursor read-out.
277
+ *
278
+ * @since 0.4
279
+ * @example
280
+ * const v: ScriptManifest["format"] = "price";
281
+ * void v;
282
+ */
283
+ readonly format?: ValueFormat;
284
+ /**
285
+ * Decimal precision the adapter renders the script at.
286
+ *
287
+ * @since 0.4
288
+ * @example
289
+ * const v: ScriptManifest["precision"] = 2;
290
+ * void v;
291
+ */
292
+ readonly precision?: number;
293
+ /**
294
+ * Scale-axis binding requested by the script.
295
+ *
296
+ * @since 0.4
297
+ * @example
298
+ * const v: ScriptManifest["scale"] = "right";
299
+ * void v;
300
+ */
301
+ readonly scale?: ScaleAxis;
302
+ /**
303
+ * Compact display label for legend chips.
304
+ *
305
+ * @since 0.4
306
+ * @example
307
+ * const v: ScriptManifest["shortName"] = "EMA";
308
+ * void v;
309
+ */
310
+ readonly shortName?: string;
311
+ /**
312
+ * Static set of intervals the script requires the target adapter to ship
313
+ * in `Capabilities.intervals`. The compiler unions this with the static
314
+ * set extracted from `request.security` calls in Task 8. `input.interval`
315
+ * is user-pickable and does not contribute to this author-declared hard
316
+ * requirement set.
317
+ *
318
+ * @since 0.4
319
+ * @example
320
+ * const v: ScriptManifest["requiresIntervals"] = ["1D"];
321
+ * void v;
322
+ */
323
+ readonly requiresIntervals?: ReadonlyArray<string>;
324
+ /**
325
+ * Static list of user-wireable alert conditions declared by
326
+ * `defineAlertCondition({ conditions })`.
327
+ *
328
+ * @since 0.5
329
+ * @stable
330
+ * @example
331
+ * const defs: ScriptManifest["alertConditions"] = [
332
+ * { id: "up", title: "Up", description: "Close > EMA", defaultMessage: "{{ticker}} up" },
333
+ * ];
334
+ * void defs;
335
+ */
336
+ readonly alertConditions?: ReadonlyArray<AlertConditionDefinition>;
337
+ };
338
+ /**
339
+ * Per-condition descriptor authored under
340
+ * `DefineAlertConditionOpts.conditions`.
341
+ *
342
+ * @since 0.5
343
+ * @stable
344
+ * @example
345
+ * const d: AlertConditionDescriptor = {
346
+ * title: "Up",
347
+ * description: "Close crossed up",
348
+ * defaultMessage: "{{ticker}} crossed up",
349
+ * };
350
+ * void d;
351
+ */
352
+ export type AlertConditionDescriptor = Readonly<{
353
+ title: string;
354
+ description: string;
355
+ defaultMessage: string;
356
+ }>;
357
+ /**
358
+ * Manifest-ready alert-condition descriptor with the author map key
359
+ * normalised into `id`.
360
+ *
361
+ * @since 0.5
362
+ * @stable
363
+ * @example
364
+ * const d: AlertConditionDefinition = {
365
+ * id: "up",
366
+ * title: "Up",
367
+ * description: "Close crossed up",
368
+ * defaultMessage: "{{ticker}} crossed up",
369
+ * };
370
+ * void d;
371
+ */
372
+ export type AlertConditionDefinition = AlertConditionDescriptor & Readonly<{
373
+ id: string;
374
+ }>;
375
+ /**
376
+ * The argument the runtime hands a script's `compute` function each bar. The
377
+ * `ta` / `plot` / `hline` / `alert` slots are the runtime's implementations,
378
+ * not the compile-time callable holes from `@invinite-org/chartlang-core`.
379
+ *
380
+ * @since 0.1
381
+ * @example
382
+ * const fn: ComputeFn = ({ bar, plot }) => { plot(bar.close); };
383
+ */
384
+ export type ComputeContext = {
385
+ readonly bar: Bar;
386
+ readonly inputs: Readonly<Record<string, unknown>>;
387
+ readonly ta: TaNamespace;
388
+ readonly plot: typeof import("./plot/plot.js").plot;
389
+ readonly hline: typeof import("./plot/plot.js").hline;
390
+ readonly alert: typeof import("./alert/alert.js").alert;
391
+ /** Pine `var` / `varip` state slots. @since 0.4 */
392
+ readonly state: StateNamespace;
393
+ /** Bar-state view derived for the active step. @since 0.4 */
394
+ readonly barstate: BarStateView;
395
+ /** Symbol metadata view for the active script mount. @since 0.4 */
396
+ readonly syminfo: SymInfoView;
397
+ /** Timeframe helper view derived for the active step. @since 0.4 */
398
+ readonly timeframe: TimeframeView;
399
+ /** Secondary timeframe request namespace. @since 0.4 */
400
+ readonly request: RequestNamespace;
401
+ /** Runtime logging and fatal halt namespace. @since 0.5 */
402
+ readonly runtime: RuntimeNamespace;
403
+ /**
404
+ * Signal a named condition declared by `defineAlertCondition`. Present
405
+ * only for scripts whose manifest kind is `"alertCondition"`.
406
+ *
407
+ * @since 0.5
408
+ * @stable
409
+ * @example
410
+ * const fn: NonNullable<ComputeContext["signal"]> = (id, fired) => {
411
+ * void id;
412
+ * void fired;
413
+ * };
414
+ * void fn;
415
+ */
416
+ readonly signal?: (conditionId: string, fired: boolean) => void;
417
+ /**
418
+ * Imperative drawing namespace. Each method returns a
419
+ * {@link DrawingHandle} the script can `update(...)` or
420
+ * `remove()` within the same `compute` run, and across bars.
421
+ * The Phase-3 runtime impl lives in
422
+ * `@invinite-org/chartlang-runtime/emit/draw`. @since 0.3
423
+ */
424
+ readonly draw: DrawNamespace;
425
+ };
426
+ /**
427
+ * The per-bar compute function a script exports via `defineIndicator` /
428
+ * `defineAlert`. Pure with respect to its arguments — no `this`, no closures
429
+ * over host state.
430
+ *
431
+ * @since 0.1
432
+ * @example
433
+ * const fn: ComputeFn = (ctx) => { ctx.plot(ctx.bar.close); };
434
+ */
435
+ export type ComputeFn = (ctx: ComputeContext) => void;
436
+ /**
437
+ * The frozen object the `defineIndicator` / `defineAlert` constructors return.
438
+ * The compiler rewrites `manifest` fields at build time; the runtime invokes
439
+ * `compute` per bar.
440
+ *
441
+ * @since 0.1
442
+ * @example
443
+ * const cs: CompiledScriptObject = defineIndicator({
444
+ * name: "demo",
445
+ * apiVersion: 1,
446
+ * compute: () => {},
447
+ * });
448
+ */
449
+ export type CompiledScriptObject = {
450
+ readonly manifest: ScriptManifest;
451
+ readonly compute: ComputeFn;
452
+ };
453
+ /**
454
+ * JSON-compatible payload type for `alert(...).meta` and other places the
455
+ * runtime serialises script-supplied data across worker / host boundaries.
456
+ *
457
+ * @since 0.1
458
+ * @example
459
+ * const meta: JsonValue = { reason: "crossover", strength: 0.42 };
460
+ */
461
+ export type JsonValue = null | boolean | number | string | ReadonlyArray<JsonValue> | {
462
+ readonly [k: string]: JsonValue;
463
+ };
464
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,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AAO,KAAK,IAAI,CAAC;IAChE;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;CAChC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,cAAc,KAAK,IAAI,CAAC;AAEtD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC/B,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;CAC/B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GACf,IAAI,GACJ,OAAO,GACP,MAAM,GACN,MAAM,GACN,aAAa,CAAC,SAAS,CAAC,GACxB;IAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1,4 @@
1
+ // Copyright (c) 2026 Invinite. Licensed under the MIT License.
2
+ // See the LICENSE file in the repo root for full license text.
3
+ export {};
4
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Bar-state view. Mirrors Pine's `barstate.*`; all fields are derived per
3
+ * step from runtime event type and bar-index bookkeeping.
4
+ *
5
+ * The exported module-scope value is only the default fallback. Runtime
6
+ * implementations supply per-step snapshots through `ComputeContext`.
7
+ *
8
+ * @since 0.4
9
+ * @stable
10
+ * @example
11
+ * const view: BarStateView = barstate;
12
+ * void view;
13
+ */
14
+ export type BarStateView = {
15
+ /** True on the first historical bar of this script mount. */
16
+ readonly isfirst: boolean;
17
+ /** True on the most recent bar, live or replay. */
18
+ readonly islast: boolean;
19
+ /** True if a new bar opened on this step; false on ticks within a bar. */
20
+ readonly isnew: boolean;
21
+ /** True if the runtime is in the historical-replay phase. */
22
+ readonly ishistory: boolean;
23
+ /** True if the runtime is processing a realtime feed. */
24
+ readonly isrealtime: boolean;
25
+ /** True if this step is a `kind: "close"` event; false on ticks. */
26
+ readonly isconfirmed: boolean;
27
+ };
28
+ /**
29
+ * Module-scope `barstate` fallback. Outside a script step, every field is
30
+ * `false`; the runtime supplies the active per-step snapshot on
31
+ * `ComputeContext.barstate`.
32
+ *
33
+ * @since 0.4
34
+ * @stable
35
+ * @example
36
+ * import { barstate } from "@invinite-org/chartlang-core";
37
+ * void barstate;
38
+ */
39
+ export declare const barstate: BarStateView;
40
+ //# sourceMappingURL=barstate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"barstate.d.ts","sourceRoot":"","sources":["../../src/views/barstate.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,YAAY,GAAG;IACvB,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,mDAAmD;IACnD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,6DAA6D;IAC7D,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,yDAAyD;IACzD,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,oEAAoE;IACpE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CACjC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,EAAE,YAOrB,CAAC"}
@@ -0,0 +1,22 @@
1
+ // Copyright (c) 2026 Invinite. Licensed under the MIT License.
2
+ // See the LICENSE file in the repo root for full license text.
3
+ /**
4
+ * Module-scope `barstate` fallback. Outside a script step, every field is
5
+ * `false`; the runtime supplies the active per-step snapshot on
6
+ * `ComputeContext.barstate`.
7
+ *
8
+ * @since 0.4
9
+ * @stable
10
+ * @example
11
+ * import { barstate } from "@invinite-org/chartlang-core";
12
+ * void barstate;
13
+ */
14
+ export const barstate = Object.freeze({
15
+ isfirst: false,
16
+ islast: false,
17
+ isnew: false,
18
+ ishistory: false,
19
+ isrealtime: false,
20
+ isconfirmed: false,
21
+ });
22
+ //# sourceMappingURL=barstate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"barstate.js","sourceRoot":"","sources":["../../src/views/barstate.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AA8B/D;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAiB,MAAM,CAAC,MAAM,CAAC;IAChD,OAAO,EAAE,KAAK;IACd,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,KAAK;IACZ,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,KAAK;IACjB,WAAW,EAAE,KAAK;CACrB,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { barstate, type BarStateView } from "./barstate.js";
2
+ export { syminfo, type SymbolType, type SymInfoView } from "./syminfo.js";
3
+ export { timeframe, type TimeframeView } from "./timeframe.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/views/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { barstate } from "./barstate.js";
2
+ export { syminfo } from "./syminfo.js";
3
+ export { timeframe } from "./timeframe.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/views/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAqB,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAqC,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAsB,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,46 @@
1
+ import type { JsonValue } from "../types.js";
2
+ /**
3
+ * Symbol-type union. Adapters that cannot map a symbol to a canonical type
4
+ * return `"custom"`.
5
+ *
6
+ * @since 0.4
7
+ * @stable
8
+ * @example
9
+ * const t: SymbolType = "equity";
10
+ * void t;
11
+ */
12
+ export type SymbolType = "equity" | "futures" | "forex" | "crypto" | "index" | "fund" | "bond" | "commodity" | "custom";
13
+ /**
14
+ * Symbol-metadata view. Fields not populated by the adapter evaluate to
15
+ * their empty sentinel: `""`, `NaN`, or `{}`.
16
+ *
17
+ * @since 0.4
18
+ * @stable
19
+ * @example
20
+ * const view: SymInfoView = syminfo;
21
+ * void view;
22
+ */
23
+ export type SymInfoView = {
24
+ readonly ticker: string;
25
+ readonly type: SymbolType;
26
+ readonly mintick: number;
27
+ readonly currency: string;
28
+ readonly basecurrency: string;
29
+ readonly exchange: string;
30
+ readonly timezone: string;
31
+ readonly session: string;
32
+ readonly meta: Readonly<Record<string, JsonValue>>;
33
+ };
34
+ /**
35
+ * Module-scope `syminfo` fallback. Outside a script step, every field
36
+ * evaluates to its empty sentinel; the runtime supplies the active per-mount
37
+ * snapshot on `ComputeContext.syminfo`.
38
+ *
39
+ * @since 0.4
40
+ * @stable
41
+ * @example
42
+ * import { syminfo } from "@invinite-org/chartlang-core";
43
+ * void syminfo;
44
+ */
45
+ export declare const syminfo: SymInfoView;
46
+ //# sourceMappingURL=syminfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syminfo.d.ts","sourceRoot":"","sources":["../../src/views/syminfo.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAChB,QAAQ,GACR,SAAS,GACT,OAAO,GACP,QAAQ,GACR,OAAO,GACP,MAAM,GACN,MAAM,GACN,WAAW,GACX,QAAQ,CAAC;AAEf;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,GAAG;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;CACtD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,OAAO,EAAE,WAUpB,CAAC"}
@@ -0,0 +1,25 @@
1
+ // Copyright (c) 2026 Invinite. Licensed under the MIT License.
2
+ // See the LICENSE file in the repo root for full license text.
3
+ /**
4
+ * Module-scope `syminfo` fallback. Outside a script step, every field
5
+ * evaluates to its empty sentinel; the runtime supplies the active per-mount
6
+ * snapshot on `ComputeContext.syminfo`.
7
+ *
8
+ * @since 0.4
9
+ * @stable
10
+ * @example
11
+ * import { syminfo } from "@invinite-org/chartlang-core";
12
+ * void syminfo;
13
+ */
14
+ export const syminfo = Object.freeze({
15
+ ticker: "",
16
+ type: "custom",
17
+ mintick: Number.NaN,
18
+ currency: "",
19
+ basecurrency: "",
20
+ exchange: "",
21
+ timezone: "",
22
+ session: "",
23
+ meta: Object.freeze({}),
24
+ });
25
+ //# sourceMappingURL=syminfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syminfo.js","sourceRoot":"","sources":["../../src/views/syminfo.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AA+C/D;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,OAAO,GAAgB,MAAM,CAAC,MAAM,CAAC;IAC9C,MAAM,EAAE,EAAE;IACV,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,MAAM,CAAC,GAAG;IACnB,QAAQ,EAAE,EAAE;IACZ,YAAY,EAAE,EAAE;IAChB,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;IACZ,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;CAC1B,CAAC,CAAC"}