@invinite-org/chartlang-core 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 (99) hide show
  1. package/CHANGELOG.md +232 -0
  2. package/README.md +2 -1
  3. package/dist/alert/alert.d.ts +1 -1
  4. package/dist/alert/alert.js +1 -1
  5. package/dist/alert/alert.js.map +1 -1
  6. package/dist/alert/index.js.map +1 -1
  7. package/dist/color/colorHelpers.js.map +1 -1
  8. package/dist/color/index.js.map +1 -1
  9. package/dist/color/parseColor.js.map +1 -1
  10. package/dist/define/defineAlert.js.map +1 -1
  11. package/dist/define/defineAlertCondition.js.map +1 -1
  12. package/dist/define/defineDrawing.d.ts +2 -2
  13. package/dist/define/defineDrawing.js +2 -2
  14. package/dist/define/defineDrawing.js.map +1 -1
  15. package/dist/define/defineIndicator.js.map +1 -1
  16. package/dist/define/depAccessorSentinel.js.map +1 -1
  17. package/dist/define/dependency.js.map +1 -1
  18. package/dist/define/index.js.map +1 -1
  19. package/dist/define/overrides.js.map +1 -1
  20. package/dist/draw/buckets.d.ts.map +1 -1
  21. package/dist/draw/buckets.js +1 -0
  22. package/dist/draw/buckets.js.map +1 -1
  23. package/dist/draw/draw.d.ts +10 -4
  24. package/dist/draw/draw.d.ts.map +1 -1
  25. package/dist/draw/draw.js +1 -2
  26. package/dist/draw/draw.js.map +1 -1
  27. package/dist/draw/drawingKind.d.ts +9 -9
  28. package/dist/draw/drawingKind.d.ts.map +1 -1
  29. package/dist/draw/drawingKind.js +5 -3
  30. package/dist/draw/drawingKind.js.map +1 -1
  31. package/dist/draw/drawingState.d.ts +32 -8
  32. package/dist/draw/drawingState.d.ts.map +1 -1
  33. package/dist/draw/drawingState.js.map +1 -1
  34. package/dist/draw/drawingStyle.d.ts +53 -10
  35. package/dist/draw/drawingStyle.d.ts.map +1 -1
  36. package/dist/draw/drawingStyle.js.map +1 -1
  37. package/dist/draw/handle.js.map +1 -1
  38. package/dist/draw/index.d.ts +2 -2
  39. package/dist/draw/index.d.ts.map +1 -1
  40. package/dist/draw/index.js.map +1 -1
  41. package/dist/draw/table.d.ts +1 -1
  42. package/dist/draw/table.js.map +1 -1
  43. package/dist/draw/worldPoint.js.map +1 -1
  44. package/dist/index.d.ts +4 -4
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js.map +1 -1
  47. package/dist/input/index.js.map +1 -1
  48. package/dist/input/input.js.map +1 -1
  49. package/dist/input/inputDescriptor.js.map +1 -1
  50. package/dist/interval/intervalToSeconds.js.map +1 -1
  51. package/dist/plot/index.js.map +1 -1
  52. package/dist/plot/plot.d.ts +16 -1
  53. package/dist/plot/plot.d.ts.map +1 -1
  54. package/dist/plot/plot.js +1 -1
  55. package/dist/plot/plot.js.map +1 -1
  56. package/dist/request/index.d.ts +1 -1
  57. package/dist/request/index.d.ts.map +1 -1
  58. package/dist/request/index.js.map +1 -1
  59. package/dist/request/request.d.ts +82 -20
  60. package/dist/request/request.d.ts.map +1 -1
  61. package/dist/request/request.js +27 -26
  62. package/dist/request/request.js.map +1 -1
  63. package/dist/runtime/index.js.map +1 -1
  64. package/dist/runtime/runtime.js.map +1 -1
  65. package/dist/state/index.js.map +1 -1
  66. package/dist/state/mutableSlot.js.map +1 -1
  67. package/dist/state/snapshot.d.ts +5 -5
  68. package/dist/state/snapshot.js.map +1 -1
  69. package/dist/state/state.d.ts +17 -0
  70. package/dist/state/state.d.ts.map +1 -1
  71. package/dist/state/state.js +18 -0
  72. package/dist/state/state.js.map +1 -1
  73. package/dist/statefulPrimitives.d.ts +10 -6
  74. package/dist/statefulPrimitives.d.ts.map +1 -1
  75. package/dist/statefulPrimitives.js +18 -6
  76. package/dist/statefulPrimitives.js.map +1 -1
  77. package/dist/ta/index.js.map +1 -1
  78. package/dist/ta/ta.d.ts +79 -48
  79. package/dist/ta/ta.d.ts.map +1 -1
  80. package/dist/ta/ta.js +6 -0
  81. package/dist/ta/ta.js.map +1 -1
  82. package/dist/time/_lib/dateTimeFormatCache.js.map +1 -1
  83. package/dist/time/index.js.map +1 -1
  84. package/dist/time/nyDayKey.js +2 -2
  85. package/dist/time/nyDayKey.js.map +1 -1
  86. package/dist/time/session.js.map +1 -1
  87. package/dist/time/sessionBoundaries.js +2 -2
  88. package/dist/time/sessionBoundaries.js.map +1 -1
  89. package/dist/time/types.js.map +1 -1
  90. package/dist/time/weekKey.js.map +1 -1
  91. package/dist/time/weekday.js.map +1 -1
  92. package/dist/types.d.ts +167 -2
  93. package/dist/types.d.ts.map +1 -1
  94. package/dist/types.js.map +1 -1
  95. package/dist/views/barstate.js.map +1 -1
  96. package/dist/views/index.js.map +1 -1
  97. package/dist/views/syminfo.js.map +1 -1
  98. package/dist/views/timeframe.js.map +1 -1
  99. package/package.json +1 -1
@@ -58,6 +58,85 @@ export type SecurityBar = Readonly<{
58
58
  readonly symbol: Series<string>;
59
59
  readonly interval: Series<string>;
60
60
  }>;
61
+ /**
62
+ * A higher-timeframe expression callback for {@link RequestNamespace.security}.
63
+ * Receives the HTF {@link SecurityBar} (OHLCV series on the secondary
64
+ * stream's own clock) and returns the value to evaluate per HTF bar.
65
+ * The body may reference only the `bar` parameter, the ambient `ta`
66
+ * namespace, `inputs`, safe `Math.*` globals, and literal constants —
67
+ * capturing any other outer binding is a compile error
68
+ * (`request-security-expr-captures-local`).
69
+ *
70
+ * Returning a `Series<number>` (e.g. `(bar) => ta.ema(bar.close, 20)`)
71
+ * lets `ta.*` accumulate over HTF bars; returning a bare `number`
72
+ * (e.g. `(bar) => bar.close.current * 2`) samples the scalar once per
73
+ * HTF bar. Either way the result aligns no-lookahead to the main timeline.
74
+ *
75
+ * @since 0.7
76
+ * @stable
77
+ * @example
78
+ * const trend: SecurityExpr = (bar) => bar.close;
79
+ * void trend;
80
+ */
81
+ export type SecurityExpr = (bar: SecurityBar) => Series<number> | number;
82
+ /**
83
+ * Read a secondary candle stream at a script-author-fixed **higher**
84
+ * interval. Two forms:
85
+ *
86
+ * - **Data**: `request.security({ interval })` → a `SecurityBar`.
87
+ * Every OHLCV field — plus the derived `hl2` / `hlc3` / `ohlc4` /
88
+ * `hlcc4` and `symbol` / `interval` — is a `Series<...>` aligned
89
+ * no-lookahead to the chart's bars, so a script can read prior secondary
90
+ * values such as `weekly.close[5]`.
91
+ * - **Expression**: `request.security({ interval }, (bar) => …)` →
92
+ * `Series<number>`. The callback runs **on the higher-timeframe clock**
93
+ * (once per HTF bar), so `ta.*` inside it accumulate over HTF bars; the
94
+ * result is aligned no-lookahead down to the main timeline. This is the
95
+ * only correct way to get a "weekly EMA(20)" — the data form's series is
96
+ * clocked to the main timeline, so `ta.ema(weekly.close, 20)` would
97
+ * average 20 *main* bars.
98
+ *
99
+ * The `interval` must be a compile-time literal (a string literal or an
100
+ * `input.enum` value); the compiler walks every call to populate
101
+ * `manifest.requestedIntervals`. When the adapter does not advertise
102
+ * `Capabilities.multiTimeframe`, the series degrades to all-NaN rather than
103
+ * erroring. See the multi-timeframe guide for alignment and interval-format
104
+ * details.
105
+ *
106
+ * @since 0.4
107
+ * @stable
108
+ * @example
109
+ * // weekly EMA(20) — computed over weekly bars, drawn on the chart
110
+ * const trend = request.security({ interval: "1W" }, (bar) => ta.ema(bar.close, 20));
111
+ * plot(trend, { title: "Weekly EMA(20)" });
112
+ * @example
113
+ * // data form — aligned weekly close
114
+ * const weekly = request.security({ interval: "1W" });
115
+ * plot(weekly.close, { title: "Weekly close" });
116
+ */
117
+ declare function security(opts: RequestSecurityOpts): SecurityBar;
118
+ declare function security(opts: RequestSecurityOpts, expr: SecurityExpr): Series<number>;
119
+ /**
120
+ * Read **lower**-timeframe bars contained by each main-stream bar. The
121
+ * result is a `Series<ReadonlyArray<Bar>>` — for every main bar, the array
122
+ * of finer-grained bars that fall inside it (an empty frozen array for
123
+ * out-of-range or unsupported reads). The requested `interval` must be a
124
+ * compile-time literal and **strictly lower** than the chart interval; an
125
+ * equal-or-higher ordering is rejected at compile time with
126
+ * `lower-tf-not-lower` when statically known. Like `request.security`, it
127
+ * degrades to empty arrays when the adapter lacks
128
+ * `Capabilities.multiTimeframe`. See the multi-timeframe guide for the
129
+ * contained-bar model and interval format.
130
+ *
131
+ * @since 0.6
132
+ * @stable
133
+ * @example
134
+ * // Each main bar carries the array of intrabar 30-second candles.
135
+ * const intrabar = request.lowerTf({ interval: "30s" });
136
+ * const count = intrabar.current.length;
137
+ * void count;
138
+ */
139
+ declare function lowerTf(_opts: RequestLowerTfOpts): Series<ReadonlyArray<Bar>>;
61
140
  /**
62
141
  * `request.*` namespace for secondary timeframe reads. The compiler walks
63
142
  * `request.security(...)` calls to populate `manifest.requestedIntervals`;
@@ -71,26 +150,8 @@ export type SecurityBar = Readonly<{
71
150
  * void ns;
72
151
  */
73
152
  export declare const request: Readonly<{
74
- /**
75
- * Read a secondary candle stream at a script-author-fixed interval.
76
- *
77
- * @since 0.4
78
- * @stable
79
- * @example
80
- * const fn: typeof request.security = request.security;
81
- * void fn;
82
- */
83
- security(_opts: RequestSecurityOpts): SecurityBar;
84
- /**
85
- * Read lower-timeframe bars contained by each main-stream bar.
86
- *
87
- * @since 0.6
88
- * @stable
89
- * @example
90
- * const fn: typeof request.lowerTf = request.lowerTf;
91
- * void fn;
92
- */
93
- lowerTf(_opts: RequestLowerTfOpts): Series<ReadonlyArray<Bar>>;
153
+ security: typeof security;
154
+ lowerTf: typeof lowerTf;
94
155
  }>;
95
156
  /**
96
157
  * Static type of the `request` namespace. Runtime implementations satisfy
@@ -103,4 +164,5 @@ export declare const request: Readonly<{
103
164
  * void ns;
104
165
  */
105
166
  export type RequestNamespace = typeof request;
167
+ export {};
106
168
  //# sourceMappingURL=request.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/request/request.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEpE;;;;;;;;;;GAU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K,CAAC,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;CACrC,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,WAAW,KAAK,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAMzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,iBAAS,QAAQ,CAAC,IAAI,EAAE,mBAAmB,GAAG,WAAW,CAAC;AAC1D,iBAAS,QAAQ,CAAC,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAKjF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,iBAAS,OAAO,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAEtE;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,OAAO;;;EAAuC,CAAC;AAE5D;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,OAAO,CAAC"}
@@ -3,6 +3,32 @@
3
3
  const sentinel = (name) => {
4
4
  throw new Error(`${name} called outside an active script step`);
5
5
  };
6
+ function security(_opts, _expr) {
7
+ return sentinel("request.security");
8
+ }
9
+ /**
10
+ * Read **lower**-timeframe bars contained by each main-stream bar. The
11
+ * result is a `Series<ReadonlyArray<Bar>>` — for every main bar, the array
12
+ * of finer-grained bars that fall inside it (an empty frozen array for
13
+ * out-of-range or unsupported reads). The requested `interval` must be a
14
+ * compile-time literal and **strictly lower** than the chart interval; an
15
+ * equal-or-higher ordering is rejected at compile time with
16
+ * `lower-tf-not-lower` when statically known. Like `request.security`, it
17
+ * degrades to empty arrays when the adapter lacks
18
+ * `Capabilities.multiTimeframe`. See the multi-timeframe guide for the
19
+ * contained-bar model and interval format.
20
+ *
21
+ * @since 0.6
22
+ * @stable
23
+ * @example
24
+ * // Each main bar carries the array of intrabar 30-second candles.
25
+ * const intrabar = request.lowerTf({ interval: "30s" });
26
+ * const count = intrabar.current.length;
27
+ * void count;
28
+ */
29
+ function lowerTf(_opts) {
30
+ return sentinel("request.lowerTf");
31
+ }
6
32
  /**
7
33
  * `request.*` namespace for secondary timeframe reads. The compiler walks
8
34
  * `request.security(...)` calls to populate `manifest.requestedIntervals`;
@@ -15,30 +41,5 @@ const sentinel = (name) => {
15
41
  * const ns: typeof request = request;
16
42
  * void ns;
17
43
  */
18
- export const request = Object.freeze({
19
- /**
20
- * Read a secondary candle stream at a script-author-fixed interval.
21
- *
22
- * @since 0.4
23
- * @stable
24
- * @example
25
- * const fn: typeof request.security = request.security;
26
- * void fn;
27
- */
28
- security(_opts) {
29
- return sentinel("request.security");
30
- },
31
- /**
32
- * Read lower-timeframe bars contained by each main-stream bar.
33
- *
34
- * @since 0.6
35
- * @stable
36
- * @example
37
- * const fn: typeof request.lowerTf = request.lowerTf;
38
- * void fn;
39
- */
40
- lowerTf(_opts) {
41
- return sentinel("request.lowerTf");
42
- },
43
- });
44
+ export const request = Object.freeze({ security, lowerTf });
44
45
  //# sourceMappingURL=request.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/request/request.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAkE/D,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAS,EAAE;IACrC,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,uCAAuC,CAAC,CAAC;AACpE,CAAC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;IACjC;;;;;;;;OAQG;IACH,QAAQ,CAAC,KAA0B;QAC/B,OAAO,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IACxC,CAAC;IACD;;;;;;;;OAQG;IACH,OAAO,CAAC,KAAyB;QAC7B,OAAO,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;CACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/request/request.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAwF/D,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAS,EAAE;IACrC,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,uCAAuC,CAAC,CAAC;AACpE,CAAC,CAAC;AAuCF,SAAS,QAAQ,CAAC,KAA0B,EAAE,KAAoB;IAC9D,OAAO,QAAQ,CAAC,kBAAkB,CAAC,CAAC;AACxC,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAS,OAAO,CAAC,KAAyB;IACtC,OAAO,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AACvC,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,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 { Bar, Price, Series, Time, Volume } from \"../types.js\";\n\n/**\n * Argument to {@link request.security}. The `interval` must be a string\n * literal or an `input.enum` value; the compiler's literal-only pass rejects\n * dynamic expressions with `request-security-interval-not-literal`.\n *\n * @since 0.4\n * @stable\n * @example\n * const opts: RequestSecurityOpts = { interval: \"1D\" };\n * void opts;\n */\nexport type RequestSecurityOpts = Readonly<{\n readonly interval: string;\n}>;\n\n/**\n * Argument to {@link request.lowerTf}. The `interval` must be strictly lower\n * than the script's main interval; invalid orderings are rejected by the\n * compiler's `lower-tf-not-lower` diagnostic when statically known.\n *\n * @since 0.6\n * @stable\n * @example\n * const opts: RequestLowerTfOpts = { interval: \"30s\" };\n * void opts;\n */\nexport type RequestLowerTfOpts = Readonly<{\n readonly interval: string;\n}>;\n\n/**\n * Secondary-stream bar returned by {@link request.security}. Each field is a\n * `Series<...>` aligned from the runtime's secondary-stream ring buffer to\n * the current main stream, or by the all-NaN fallback when\n * `Capabilities.multiTimeframe` is `false`, the interval is unsupported, or\n * the host fails to register the secondary stream.\n *\n * This is intentionally a series-shaped view rather than the scalar\n * {@link Bar} shape so scripts can read historical secondary values aligned\n * to main bars, such as `daily.close[5]`.\n *\n * @since 0.4\n * @stable\n * @example\n * const close: SecurityBar[\"close\"] = { current: 1, length: 1 };\n * void close;\n */\nexport type SecurityBar = Readonly<{\n readonly time: Series<Time>;\n readonly open: Series<Price>;\n readonly high: Series<Price>;\n readonly low: Series<Price>;\n readonly close: Series<Price>;\n readonly volume: Series<Volume>;\n readonly hl2: Series<Price>;\n readonly hlc3: Series<Price>;\n readonly ohlc4: Series<Price>;\n readonly hlcc4: Series<Price>;\n readonly symbol: Series<string>;\n readonly interval: Series<string>;\n}>;\n\n/**\n * A higher-timeframe expression callback for {@link RequestNamespace.security}.\n * Receives the HTF {@link SecurityBar} (OHLCV series on the secondary\n * stream's own clock) and returns the value to evaluate per HTF bar.\n * The body may reference only the `bar` parameter, the ambient `ta`\n * namespace, `inputs`, safe `Math.*` globals, and literal constants —\n * capturing any other outer binding is a compile error\n * (`request-security-expr-captures-local`).\n *\n * Returning a `Series<number>` (e.g. `(bar) => ta.ema(bar.close, 20)`)\n * lets `ta.*` accumulate over HTF bars; returning a bare `number`\n * (e.g. `(bar) => bar.close.current * 2`) samples the scalar once per\n * HTF bar. Either way the result aligns no-lookahead to the main timeline.\n *\n * @since 0.7\n * @stable\n * @example\n * const trend: SecurityExpr = (bar) => bar.close;\n * void trend;\n */\nexport type SecurityExpr = (bar: SecurityBar) => Series<number> | number;\n\nconst sentinel = (name: string): never => {\n throw new Error(`${name} called outside an active script step`);\n};\n\n/**\n * Read a secondary candle stream at a script-author-fixed **higher**\n * interval. Two forms:\n *\n * - **Data**: `request.security({ interval })` → a `SecurityBar`.\n * Every OHLCV field — plus the derived `hl2` / `hlc3` / `ohlc4` /\n * `hlcc4` and `symbol` / `interval` — is a `Series<...>` aligned\n * no-lookahead to the chart's bars, so a script can read prior secondary\n * values such as `weekly.close[5]`.\n * - **Expression**: `request.security({ interval }, (bar) => …)` →\n * `Series<number>`. The callback runs **on the higher-timeframe clock**\n * (once per HTF bar), so `ta.*` inside it accumulate over HTF bars; the\n * result is aligned no-lookahead down to the main timeline. This is the\n * only correct way to get a \"weekly EMA(20)\" — the data form's series is\n * clocked to the main timeline, so `ta.ema(weekly.close, 20)` would\n * average 20 *main* bars.\n *\n * The `interval` must be a compile-time literal (a string literal or an\n * `input.enum` value); the compiler walks every call to populate\n * `manifest.requestedIntervals`. When the adapter does not advertise\n * `Capabilities.multiTimeframe`, the series degrades to all-NaN rather than\n * erroring. See the multi-timeframe guide for alignment and interval-format\n * details.\n *\n * @since 0.4\n * @stable\n * @example\n * // weekly EMA(20) — computed over weekly bars, drawn on the chart\n * const trend = request.security({ interval: \"1W\" }, (bar) => ta.ema(bar.close, 20));\n * plot(trend, { title: \"Weekly EMA(20)\" });\n * @example\n * // data form — aligned weekly close\n * const weekly = request.security({ interval: \"1W\" });\n * plot(weekly.close, { title: \"Weekly close\" });\n */\nfunction security(opts: RequestSecurityOpts): SecurityBar;\nfunction security(opts: RequestSecurityOpts, expr: SecurityExpr): Series<number>;\nfunction security(_opts: RequestSecurityOpts, _expr?: SecurityExpr): SecurityBar | Series<number> {\n return sentinel(\"request.security\");\n}\n\n/**\n * Read **lower**-timeframe bars contained by each main-stream bar. The\n * result is a `Series<ReadonlyArray<Bar>>` — for every main bar, the array\n * of finer-grained bars that fall inside it (an empty frozen array for\n * out-of-range or unsupported reads). The requested `interval` must be a\n * compile-time literal and **strictly lower** than the chart interval; an\n * equal-or-higher ordering is rejected at compile time with\n * `lower-tf-not-lower` when statically known. Like `request.security`, it\n * degrades to empty arrays when the adapter lacks\n * `Capabilities.multiTimeframe`. See the multi-timeframe guide for the\n * contained-bar model and interval format.\n *\n * @since 0.6\n * @stable\n * @example\n * // Each main bar carries the array of intrabar 30-second candles.\n * const intrabar = request.lowerTf({ interval: \"30s\" });\n * const count = intrabar.current.length;\n * void count;\n */\nfunction lowerTf(_opts: RequestLowerTfOpts): Series<ReadonlyArray<Bar>> {\n return sentinel(\"request.lowerTf\");\n}\n\n/**\n * `request.*` namespace for secondary timeframe reads. The compiler walks\n * `request.security(...)` calls to populate `manifest.requestedIntervals`;\n * the runtime replaces this callable hole with a slot-aware implementation\n * through `ComputeContext.request`.\n *\n * @since 0.4\n * @stable\n * @example\n * const ns: typeof request = request;\n * void ns;\n */\nexport const request = Object.freeze({ security, lowerTf });\n\n/**\n * Static type of the `request` namespace. Runtime implementations satisfy\n * this shape structurally when installed on `ComputeContext.request`.\n *\n * @since 0.4\n * @stable\n * @example\n * const ns: RequestNamespace = request;\n * void ns;\n */\nexport type RequestNamespace = typeof request;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,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\nexport { runtime } from \"./runtime.js\";\nexport type { LogLevel, RuntimeNamespace } from \"./runtime.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/runtime/runtime.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAe/D;;;;;;;;;GASG;AACH,SAAS,QAAQ,CAAC,QAAgB,EAAE,KAA2C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M,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;AACrE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;IACjC,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,SAAS;KACnB,CAAC;IACF,KAAK,EAAE,MAAM;CAChB,CAAC,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 \"../types.js\";\n\n/**\n * Runtime log severity emitted by `runtime.log.*`.\n *\n * @since 0.5\n * @stable\n * @example\n * const level: LogLevel = \"info\";\n * void level;\n */\nexport type LogLevel = \"info\" | \"warn\" | \"error\";\n\n/**\n * Per-step log message. Pine's `runtime.log.*` analogue. Capability-\n * gated by `Capabilities.logs`; silent no-op when false.\n *\n * @since 0.5\n * @stable\n * @example\n * // Inside compute:\n * // runtime.log.info(`ema=${ema.current}`, { ema: ema.current });\n */\nfunction _logInfo(_message: string, _meta?: Readonly<Record<string, JsonValue>>): void {\n throw new Error(\"runtime.log.info called outside compiled runtime\");\n}\n\n/**\n * Per-step warning log message. Capability-gated by `Capabilities.logs`.\n *\n * @since 0.5\n * @stable\n * @example\n * // Inside compute:\n * // runtime.log.warn(\"warmup incomplete\");\n */\nfunction _logWarn(_message: string, _meta?: Readonly<Record<string, JsonValue>>): void {\n throw new Error(\"runtime.log.warn called outside compiled runtime\");\n}\n\n/**\n * Per-step error log message. Capability-gated by `Capabilities.logs`.\n *\n * @since 0.5\n * @stable\n * @example\n * // Inside compute:\n * // runtime.log.error(\"unexpected branch\", { branch: \"fallback\" });\n */\nfunction _logError(_message: string, _meta?: Readonly<Record<string, JsonValue>>): void {\n throw new Error(\"runtime.log.error called outside compiled runtime\");\n}\n\n/**\n * Halt the current bar's compute. Emits a fatal `RuntimeDiagnostic`\n * with code `runtime-error-thrown`. The script stays mounted; the\n * next bar runs normally. Use for invariant violations the script\n * cannot continue past.\n *\n * @since 0.5\n * @stable\n * @example\n * // Inside compute:\n * // if (inputs.length < 1) runtime.error(\"length must be >= 1\");\n */\nfunction _error(_message: string): never {\n throw new Error(\"runtime.error called outside compiled runtime\");\n}\n\n/**\n * Pine-style runtime utilities exposed to script `compute` callbacks.\n *\n * @since 0.5\n * @stable\n * @example\n * // Inside compute:\n * // runtime.log.info(\"close\", { value: bar.close });\n */\nexport const runtime = Object.freeze({\n log: Object.freeze({\n info: _logInfo,\n warn: _logWarn,\n error: _logError,\n }),\n error: _error,\n});\n\n/**\n * Script-facing runtime namespace type.\n *\n * @since 0.5\n * @stable\n * @example\n * const ns: RuntimeNamespace = runtime;\n * void ns;\n */\nexport type RuntimeNamespace = typeof runtime;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/state/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/state/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,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\nexport { state } from \"./state.js\";\nexport type { StateNamespace } from \"./state.js\";\nexport type { MutableSlot } from \"./mutableSlot.js\";\nexport type {\n RunnerSnapshot,\n StateSnapshot,\n StateStoreKey,\n StreamSnapshot,\n} from \"./snapshot.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"mutableSlot.js","sourceRoot":"","sources":["../../src/state/mutableSlot.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D"}
1
+ {"version":3,"file":"mutableSlot.js","sourceRoot":"","sources":["../../src/state/mutableSlot.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D","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 * Script-facing handle on a persistent cross-bar slot, Pine's `var` /\n * `varip` equivalent. Reads return the active step value; writes follow\n * the runtime's committed/tentative slot semantics.\n *\n * Intentionally minimal: no `.history()`, no `.previous()`, no indexing.\n * Scripts that need the previous bar's value store it in a second slot or\n * use `ta.*` series-indexing primitives.\n *\n * @since 0.4\n * @stable\n * @example\n * const slot: MutableSlot<number> = {\n * get value() {\n * return 0;\n * },\n * set value(_next: number) {},\n * };\n * slot.value = 1;\n */\nexport type MutableSlot<T> = {\n get value(): T;\n set value(v: T);\n};\n"]}
@@ -4,7 +4,7 @@ import type { JsonValue } from "../types.js";
4
4
  *
5
5
  * Carries everything needed to rehydrate a ring buffer for one timeframe,
6
6
  * whether that stream is the main interval or a higher-timeframe secondary
7
- * stream (PLAN.md §6.1, §6.9).
7
+ * stream.
8
8
  *
9
9
  * `buffers` is keyed by the canonical OHLCV field names; each value is a
10
10
  * JSON-clean array of `number | null`, where `null` preserves NaN holes
@@ -38,7 +38,7 @@ export type StreamSnapshot = Readonly<{
38
38
  /**
39
39
  * Per-runner persistence section. Carries one runner's `state.*`
40
40
  * (and primary-only TA) slot map keyed by `${slotIdPrefix}${slotId}:state`
41
- * (PLAN.md §5.5 + Task 5). `slots` is `JsonValue` so the snapshot
41
+ * (Task 5). `slots` is `JsonValue` so the snapshot
42
42
  * round-trips through `JSON.stringify` and structured-clone.
43
43
  *
44
44
  * Used inside {@link StateSnapshot} for `primary`,
@@ -60,9 +60,9 @@ export type RunnerSnapshot = Readonly<{
60
60
  * Canonical persistent-store snapshot.
61
61
  *
62
62
  * Written on `dispose()` and on every `kind: "close"` event when stale for
63
- * at least 60 seconds (PLAN.md §6.9). Each runner's `state.*` payload is
63
+ * at least 60 seconds. Each runner's `state.*` payload is
64
64
  * keyed by the compiler-injected slot id with the runner's
65
- * `slotIdPrefix` prepended (PLAN.md §5.5 + Task 5). Primary-runner TA
65
+ * `slotIdPrefix` prepended (Task 5). Primary-runner TA
66
66
  * slots live in `primary.slots` alongside `state.*` slots (the bundle's
67
67
  * deps + siblings share the primary's mainStream, so TA slots have no
68
68
  * per-runner section).
@@ -98,7 +98,7 @@ export type StateSnapshot = Readonly<{
98
98
  * Canonical persistent-store identity tuple.
99
99
  *
100
100
  * Every field contributes to the cache key; any change invalidates the
101
- * snapshot (PLAN.md §6.9). Stores treat this tuple opaquely as a string key;
101
+ * snapshot. Stores treat this tuple opaquely as a string key;
102
102
  * the typical implementation is `JSON.stringify(key)` with sorted fields.
103
103
  *
104
104
  * - `scriptHash` is the SHA-256 digest of the compiled `moduleSource`.
@@ -1 +1 @@
1
- {"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../src/state/snapshot.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D"}
1
+ {"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../src/state/snapshot.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D","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 \"../types.js\";\n\n/**\n * Per-stream snapshot captured during state persistence.\n *\n * Carries everything needed to rehydrate a ring buffer for one timeframe,\n * whether that stream is the main interval or a higher-timeframe secondary\n * stream.\n *\n * `buffers` is keyed by the canonical OHLCV field names; each value is a\n * JSON-clean array of `number | null`, where `null` preserves NaN holes\n * through `JSON.stringify`. `headIndex` and `filled` mirror the ring-buffer's\n * internal state at snapshot time.\n *\n * @since 0.5\n * @stable\n * @example\n * const s: StreamSnapshot = {\n * interval: \"1D\",\n * headIndex: 4999,\n * filled: 5000,\n * buffers: { time: [], open: [], high: [], low: [], close: [], volume: [] },\n * };\n * void s;\n */\nexport type StreamSnapshot = Readonly<{\n interval: string;\n headIndex: number;\n filled: number;\n buffers: Readonly<{\n time: ReadonlyArray<number | null>;\n open: ReadonlyArray<number | null>;\n high: ReadonlyArray<number | null>;\n low: ReadonlyArray<number | null>;\n close: ReadonlyArray<number | null>;\n volume: ReadonlyArray<number | null>;\n }>;\n}>;\n\n/**\n * Per-runner persistence section. Carries one runner's `state.*`\n * (and primary-only TA) slot map keyed by `${slotIdPrefix}${slotId}:state`\n * (Task 5). `slots` is `JsonValue` so the snapshot\n * round-trips through `JSON.stringify` and structured-clone.\n *\n * Used inside {@link StateSnapshot} for `primary`,\n * `siblings[exportName]`, and `dependencies[localId]` sections —\n * one section per runner mounted by a `CompiledScriptBundle`.\n *\n * @since 0.7\n * @stable\n * @example\n * const r: RunnerSnapshot = {\n * slots: { \"x:state\": { committed: 1, tentative: 1 } },\n * };\n * void r;\n */\nexport type RunnerSnapshot = Readonly<{\n slots: Readonly<Record<string, JsonValue>>;\n}>;\n\n/**\n * Canonical persistent-store snapshot.\n *\n * Written on `dispose()` and on every `kind: \"close\"` event when stale for\n * at least 60 seconds. Each runner's `state.*` payload is\n * keyed by the compiler-injected slot id with the runner's\n * `slotIdPrefix` prepended (Task 5). Primary-runner TA\n * slots live in `primary.slots` alongside `state.*` slots (the bundle's\n * deps + siblings share the primary's mainStream, so TA slots have no\n * per-runner section).\n *\n * `snapshotVersion: 1` is the only currently-supported wire version.\n * The 0.7 widening is additive — the runtime validator accepts both the\n * legacy flat `slots:` shape (loaded as primary-only) and the structured\n * `primary` / `siblings?` / `dependencies?` shape (always written going\n * forward).\n *\n * @since 0.5 — widened to per-runner sections in 0.7\n * @stable\n * @example\n * const s: StateSnapshot = {\n * lastBarTime: 1_700_000_000_000,\n * streams: {},\n * savedAt: 1_700_000_060_000,\n * snapshotVersion: 1,\n * primary: { slots: {} },\n * };\n * void s;\n */\nexport type StateSnapshot = Readonly<{\n lastBarTime: number;\n streams: Readonly<Record<string, StreamSnapshot>>;\n savedAt: number;\n snapshotVersion: 1;\n primary: RunnerSnapshot;\n siblings?: Readonly<Record<string, RunnerSnapshot>>;\n dependencies?: Readonly<Record<string, RunnerSnapshot>>;\n}>;\n\n/**\n * Canonical persistent-store identity tuple.\n *\n * Every field contributes to the cache key; any change invalidates the\n * snapshot. Stores treat this tuple opaquely as a string key;\n * the typical implementation is `JSON.stringify(key)` with sorted fields.\n *\n * - `scriptHash` is the SHA-256 digest of the compiled `moduleSource`.\n * - `compilerVersion` is the package version of `@invinite-org/chartlang-compiler`.\n * - `apiVersion` is the script header pin, currently `1`.\n * - `capabilitiesHash` is the SHA-256 digest of normalised adapter capabilities.\n * - `symbol` is the adapter's loaded ticker.\n * - `mainInterval` is the primary stream interval.\n * - `requestedIntervals` is the frozen array of secondary stream intervals.\n *\n * @since 0.5\n * @stable\n * @example\n * const k: StateStoreKey = {\n * scriptHash: \"abc\",\n * compilerVersion: \"0.5.0\",\n * apiVersion: 1,\n * capabilitiesHash: \"def\",\n * symbol: \"BTCUSD\",\n * mainInterval: \"1m\",\n * requestedIntervals: [],\n * };\n * void k;\n */\nexport type StateStoreKey = Readonly<{\n scriptHash: string;\n compilerVersion: string;\n apiVersion: 1;\n capabilitiesHash: string;\n symbol: string;\n mainInterval: string;\n requestedIntervals: ReadonlyArray<string>;\n}>;\n"]}
@@ -1,3 +1,4 @@
1
+ import type { NumberSeriesSlot } from "../types.js";
1
2
  import type { MutableSlot } from "./mutableSlot.js";
2
3
  /**
3
4
  * Persistent state slots, Pine `var` semantics. Writes during a tick are
@@ -55,6 +56,22 @@ export declare const state: Readonly<{
55
56
  * void fn;
56
57
  */
57
58
  string(_init: string): MutableSlot<string>;
59
+ /**
60
+ * Allocate or read a persistent **series** slot — a writable, indexable
61
+ * number history. `s.value = expr` writes the current bar's value;
62
+ * `s[0]` / `s.current` / `+s` read it back, `s[1]` reads one bar ago.
63
+ * The allocation bar's pre-write head is seeded with `init`; unwritten later
64
+ * bars and out-of-range history reads are `NaN`. Unlike `state.float`, the
65
+ * slot retains a bounded window of prior committed values (sized to the
66
+ * script's deepest literal `s[n]` lookback).
67
+ *
68
+ * @since 1.3
69
+ * @stable
70
+ * @example
71
+ * const fn: typeof state.series = state.series;
72
+ * void fn;
73
+ */
74
+ series(_init: number): NumberSeriesSlot;
58
75
  /**
59
76
  * Tick-persistent state slots, Pine `varip` semantics. Writes commit
60
77
  * immediately, even during a tick.
@@ -1 +1 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/state/state.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAMpD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,KAAK;IACd;;;;;;;;OAQG;iBACU,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;IAIzC;;;;;;;;OAQG;eACQ,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;IAIvC;;;;;;;;OAQG;gBACS,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC;IAI1C;;;;;;;;OAQG;kBACW,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;IAI1C;;;;;;;;;OASG;;qBAEc,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;mBAG9B,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;oBAG3B,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC;sBAG5B,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;;EAIhD,CAAC;AAEH;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,KAAK,CAAC"}
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/state/state.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAMpD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,KAAK;IACd;;;;;;;;OAQG;iBACU,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;IAIzC;;;;;;;;OAQG;eACQ,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;IAIvC;;;;;;;;OAQG;gBACS,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC;IAI1C;;;;;;;;OAQG;kBACW,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;IAI1C;;;;;;;;;;;;;;OAcG;kBACW,MAAM,GAAG,gBAAgB;IAIvC;;;;;;;;;OASG;;qBAEc,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;mBAG9B,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;oBAG3B,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC;sBAG5B,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;;EAIhD,CAAC;AAEH;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,KAAK,CAAC"}
@@ -67,6 +67,24 @@ export const state = Object.freeze({
67
67
  string(_init) {
68
68
  return sentinel("state.string");
69
69
  },
70
+ /**
71
+ * Allocate or read a persistent **series** slot — a writable, indexable
72
+ * number history. `s.value = expr` writes the current bar's value;
73
+ * `s[0]` / `s.current` / `+s` read it back, `s[1]` reads one bar ago.
74
+ * The allocation bar's pre-write head is seeded with `init`; unwritten later
75
+ * bars and out-of-range history reads are `NaN`. Unlike `state.float`, the
76
+ * slot retains a bounded window of prior committed values (sized to the
77
+ * script's deepest literal `s[n]` lookback).
78
+ *
79
+ * @since 1.3
80
+ * @stable
81
+ * @example
82
+ * const fn: typeof state.series = state.series;
83
+ * void fn;
84
+ */
85
+ series(_init) {
86
+ return sentinel("state.series");
87
+ },
70
88
  /**
71
89
  * Tick-persistent state slots, Pine `varip` semantics. Writes commit
72
90
  * immediately, even during a tick.
@@ -1 +1 @@
1
- {"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/state/state.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAI/D,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAS,EAAE;IACrC,MAA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M,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/B;;;;;;;;OAQG;IACH,KAAK,CAAC,KAAa;QACf,OAAO,QAAQ,CAAC,aAAa,CAAC,CAAC;IACnC,CAAC;IAED;;;;;;;;OAQG;IACH,GAAG,CAAC,KAAa;QACb,OAAO,QAAQ,CAAC,WAAW,CAAC,CAAC;IACjC,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CAAC,KAAc;QACf,OAAO,QAAQ,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,KAAa;QAChB,OAAO,QAAQ,CAAC,cAAc,CAAC,CAAC;IACpC,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,KAAa;QAChB,OAAO,QAAQ,CAAC,cAAc,CAAC,CAAC;IACpC,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;QAChB,KAAK,CAAC,KAAa;YACf,OAAO,QAAQ,CAAC,kBAAkB,CAAC,CAAC;QACxC,CAAC;QACD,GAAG,CAAC,KAAa;YACb,OAAO,QAAQ,CAAC,gBAAgB,CAAC,CAAC;QACtC,CAAC;QACD,IAAI,CAAC,KAAc;YACf,OAAO,QAAQ,CAAC,iBAAiB,CAAC,CAAC;QACvC,CAAC;QACD,MAAM,CAAC,KAAa;YAChB,OAAO,QAAQ,CAAC,mBAAmB,CAAC,CAAC;QACzC,CAAC;KACJ,CAAC;CACL,CAAC,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 \"../types.js\";\nimport type { MutableSlot } from \"./mutableSlot.js\";\n\nconst sentinel = (name: string): never => {\n throw new Error(`${name} called outside an active script step`);\n};\n\n/**\n * Persistent state slots, Pine `var` semantics. Writes during a tick are\n * tentative and discarded if a later tick replaces the head bar; on bar\n * close the tentative value commits. Reads return the active tentative\n * value for the current step.\n *\n * The runtime replaces this compile-time callable hole with a slot-aware\n * namespace through `ComputeContext.state`.\n *\n * @since 0.4\n * @stable\n * @example\n * const ns: typeof state = state;\n * void ns;\n */\nexport const state = Object.freeze({\n /**\n * Allocate or read a persistent number slot.\n *\n * @since 0.4\n * @stable\n * @example\n * const fn: typeof state.float = state.float;\n * void fn;\n */\n float(_init: number): MutableSlot<number> {\n return sentinel(\"state.float\");\n },\n\n /**\n * Allocate or read a persistent integer slot.\n *\n * @since 0.4\n * @stable\n * @example\n * const fn: typeof state.int = state.int;\n * void fn;\n */\n int(_init: number): MutableSlot<number> {\n return sentinel(\"state.int\");\n },\n\n /**\n * Allocate or read a persistent boolean slot.\n *\n * @since 0.4\n * @stable\n * @example\n * const fn: typeof state.bool = state.bool;\n * void fn;\n */\n bool(_init: boolean): MutableSlot<boolean> {\n return sentinel(\"state.bool\");\n },\n\n /**\n * Allocate or read a persistent string slot.\n *\n * @since 0.4\n * @stable\n * @example\n * const fn: typeof state.string = state.string;\n * void fn;\n */\n string(_init: string): MutableSlot<string> {\n return sentinel(\"state.string\");\n },\n\n /**\n * Allocate or read a persistent **series** slot — a writable, indexable\n * number history. `s.value = expr` writes the current bar's value;\n * `s[0]` / `s.current` / `+s` read it back, `s[1]` reads one bar ago.\n * The allocation bar's pre-write head is seeded with `init`; unwritten later\n * bars and out-of-range history reads are `NaN`. Unlike `state.float`, the\n * slot retains a bounded window of prior committed values (sized to the\n * script's deepest literal `s[n]` lookback).\n *\n * @since 1.3\n * @stable\n * @example\n * const fn: typeof state.series = state.series;\n * void fn;\n */\n series(_init: number): NumberSeriesSlot {\n return sentinel(\"state.series\");\n },\n\n /**\n * Tick-persistent state slots, Pine `varip` semantics. Writes commit\n * immediately, even during a tick.\n *\n * @since 0.4\n * @stable\n * @example\n * const fn: typeof state.tick.float = state.tick.float;\n * void fn;\n */\n tick: Object.freeze({\n float(_init: number): MutableSlot<number> {\n return sentinel(\"state.tick.float\");\n },\n int(_init: number): MutableSlot<number> {\n return sentinel(\"state.tick.int\");\n },\n bool(_init: boolean): MutableSlot<boolean> {\n return sentinel(\"state.tick.bool\");\n },\n string(_init: string): MutableSlot<string> {\n return sentinel(\"state.tick.string\");\n },\n }),\n});\n\n/**\n * Static type of the `state` namespace. Runtime implementations satisfy\n * this shape structurally when they are installed on `ComputeContext.state`.\n *\n * @since 0.4\n * @stable\n * @example\n * const ns: StateNamespace = state;\n * void ns;\n */\nexport type StateNamespace = typeof state;\n"]}
@@ -17,7 +17,7 @@ export type StatefulPrimitiveEntry = Readonly<{
17
17
  /**
18
18
  * Frozen set of every fully-qualified call name the compiler tracks for
19
19
  * static-analysis (`stateful-call-inside-loop`) and slot-id injection
20
- * (PLAN.md §5.5). Each entry carries a `slot` flag: `slot: true`
20
+ *. Each entry carries a `slot` flag: `slot: true`
21
21
  * primitives allocate per-callsite hidden state and get a string-literal
22
22
  * slot id injected as their first argument; `slot: false` primitives are
23
23
  * pure helpers that ride along in the set because Pine still forbids
@@ -33,8 +33,10 @@ export type StatefulPrimitiveEntry = Readonly<{
33
33
  * logging/error as stateless loop-diagnostic entries plus `draw.table`
34
34
  * as a slot-backed viewport drawing.
35
35
  *
36
- * Locked at `apiVersion: 1` (172 entries). Adding, removing, or renaming
37
- * an entry is a language change and requires `apiVersion: 2`see
36
+ * Additive within `apiVersion: 1` (currently 176 entries): new entries MAY
37
+ * be appended in a `1.x` release (a new call name is additive new callsites
38
+ * only, no change to any existing script). Removing or renaming an entry, or
39
+ * flipping its `slot`, is a language change and requires `apiVersion: 2` — see
38
40
  * `docs/spec/versioning.md`.
39
41
  *
40
42
  * @since 0.1
@@ -52,12 +54,14 @@ export declare const STATEFUL_PRIMITIVES: ReadonlySet<StatefulPrimitiveEntry>;
52
54
  * Name → entry index of {@link STATEFUL_PRIMITIVES}. The compiler's
53
55
  * `callsiteIdInjection` and `statefulCallInLoop` passes consult this map
54
56
  * by callee name once per call site — O(1) lookup instead of an O(n) scan
55
- * over the 172-entry set on every visited call. The map is derived from
57
+ * over the 176-entry set on every visited call. The map is derived from
56
58
  * the same canonical entry list as {@link STATEFUL_PRIMITIVES} so adding
57
59
  * a primitive to the set adds it here automatically.
58
60
  *
59
- * Locked at `apiVersion: 1` (172 entries). Adding, removing, or renaming
60
- * an entry is a language change and requires `apiVersion: 2`see
61
+ * Additive within `apiVersion: 1` (currently 176 entries): new entries MAY
62
+ * be appended in a `1.x` release (a new call name is additive new callsites
63
+ * only, no change to any existing script). Removing or renaming an entry, or
64
+ * flipping its `slot`, is a language change and requires `apiVersion: 2` — see
61
65
  * `docs/spec/versioning.md`.
62
66
  *
63
67
  * @since 0.2
@@ -1 +1 @@
1
- {"version":3,"file":"statefulPrimitives.d.ts","sourceRoot":"","sources":["../src/statefulPrimitives.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAoL/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,sBAAsB,CAEnE,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,2BAA2B,EAAE,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAGnB,CAAC"}
1
+ {"version":3,"file":"statefulPrimitives.d.ts","sourceRoot":"","sources":["../src/statefulPrimitives.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AA4L/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,sBAAsB,CAEnE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,2BAA2B,EAAE,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAGnB,CAAC"}
@@ -12,6 +12,8 @@ const STATEFUL_PRIMITIVE_ENTRIES = [
12
12
  { name: "ta.crossunder", slot: true },
13
13
  { name: "ta.highest", slot: true },
14
14
  { name: "ta.lowest", slot: true },
15
+ { name: "ta.highestbars", slot: true },
16
+ { name: "ta.lowestbars", slot: true },
15
17
  { name: "ta.change", slot: true },
16
18
  { name: "ta.valuewhen", slot: true },
17
19
  { name: "ta.barssince", slot: true },
@@ -114,6 +116,7 @@ const STATEFUL_PRIMITIVE_ENTRIES = [
114
116
  { name: "draw.circle", slot: true },
115
117
  { name: "draw.ellipse", slot: true },
116
118
  { name: "draw.path", slot: true },
119
+ { name: "draw.fillBetween", slot: true },
117
120
  { name: "draw.marker", slot: true },
118
121
  { name: "draw.arc", slot: true },
119
122
  { name: "draw.curve", slot: true },
@@ -167,10 +170,15 @@ const STATEFUL_PRIMITIVE_ENTRIES = [
167
170
  { name: "state.int", slot: true },
168
171
  { name: "state.bool", slot: true },
169
172
  { name: "state.string", slot: true },
173
+ { name: "state.series", slot: true },
170
174
  { name: "state.tick.float", slot: true },
171
175
  { name: "state.tick.int", slot: true },
172
176
  { name: "state.tick.bool", slot: true },
173
177
  { name: "state.tick.string", slot: true },
178
+ // Both the data form `request.security({ interval })` and the expression
179
+ // form `request.security({ interval }, (bar) => …)` route through this one
180
+ // entry: `slot: true` injects the slot id as the first argument regardless
181
+ // of the optional second (callback) argument.
174
182
  { name: "request.security", slot: true },
175
183
  { name: "request.lowerTf", slot: true },
176
184
  { name: "defineAlertCondition.signal", slot: false },
@@ -180,7 +188,7 @@ const STATEFUL_PRIMITIVE_ENTRIES = [
180
188
  /**
181
189
  * Frozen set of every fully-qualified call name the compiler tracks for
182
190
  * static-analysis (`stateful-call-inside-loop`) and slot-id injection
183
- * (PLAN.md §5.5). Each entry carries a `slot` flag: `slot: true`
191
+ *. Each entry carries a `slot` flag: `slot: true`
184
192
  * primitives allocate per-callsite hidden state and get a string-literal
185
193
  * slot id injected as their first argument; `slot: false` primitives are
186
194
  * pure helpers that ride along in the set because Pine still forbids
@@ -196,8 +204,10 @@ const STATEFUL_PRIMITIVE_ENTRIES = [
196
204
  * logging/error as stateless loop-diagnostic entries plus `draw.table`
197
205
  * as a slot-backed viewport drawing.
198
206
  *
199
- * Locked at `apiVersion: 1` (172 entries). Adding, removing, or renaming
200
- * an entry is a language change and requires `apiVersion: 2`see
207
+ * Additive within `apiVersion: 1` (currently 176 entries): new entries MAY
208
+ * be appended in a `1.x` release (a new call name is additive new callsites
209
+ * only, no change to any existing script). Removing or renaming an entry, or
210
+ * flipping its `slot`, is a language change and requires `apiVersion: 2` — see
201
211
  * `docs/spec/versioning.md`.
202
212
  *
203
213
  * @since 0.1
@@ -215,12 +225,14 @@ export const STATEFUL_PRIMITIVES = Object.freeze(new Set(STATEFUL_PRIMITIVE_ENTR
215
225
  * Name → entry index of {@link STATEFUL_PRIMITIVES}. The compiler's
216
226
  * `callsiteIdInjection` and `statefulCallInLoop` passes consult this map
217
227
  * by callee name once per call site — O(1) lookup instead of an O(n) scan
218
- * over the 172-entry set on every visited call. The map is derived from
228
+ * over the 176-entry set on every visited call. The map is derived from
219
229
  * the same canonical entry list as {@link STATEFUL_PRIMITIVES} so adding
220
230
  * a primitive to the set adds it here automatically.
221
231
  *
222
- * Locked at `apiVersion: 1` (172 entries). Adding, removing, or renaming
223
- * an entry is a language change and requires `apiVersion: 2`see
232
+ * Additive within `apiVersion: 1` (currently 176 entries): new entries MAY
233
+ * be appended in a `1.x` release (a new call name is additive new callsites
234
+ * only, no change to any existing script). Removing or renaming an entry, or
235
+ * flipping its `slot`, is a language change and requires `apiVersion: 2` — see
224
236
  * `docs/spec/versioning.md`.
225
237
  *
226
238
  * @since 0.2
@@ -1 +1 @@
1
- {"version":3,"file":"statefulPrimitives.js","sourceRoot":"","sources":["../src/statefulPrimitives.ts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AE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE;CACzC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAwC,MAAM,CAAC,MAAM,CACjF,IAAI,GAAG,CAAyB,0BAA0B,CAAC,CAC9D,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAgD,IAAI,GAAG,CAG7F,0BAA0B,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,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-entry shape of {@link STATEFUL_PRIMITIVES}. `name` is the\n * fully-qualified call (`ta.ema`, `plot`, `hline`, `alert`); `slot`\n * is `true` for every primitive whose call site needs a compiler-\n * injected slot id, `false` for the stateless helpers that ride along\n * in the set for in-loop diagnostics (currently only `ta.nz`).\n *\n * @since 0.1\n * @stable\n * @example\n * const entry: StatefulPrimitiveEntry = { name: \"ta.nz\", slot: false };\n */\nexport type StatefulPrimitiveEntry = Readonly<{ name: string; slot: boolean }>;\n\nconst STATEFUL_PRIMITIVE_ENTRIES: ReadonlyArray<StatefulPrimitiveEntry> = [\n { name: \"ta.sma\", slot: true },\n { name: \"ta.ema\", slot: true },\n { name: \"ta.stdev\", slot: true },\n { name: \"ta.bb\", slot: true },\n { name: \"ta.rsi\", slot: true },\n { name: \"ta.macd\", slot: true },\n { name: \"ta.atr\", slot: true },\n { name: \"ta.crossover\", slot: true },\n { name: \"ta.crossunder\", slot: true },\n { name: \"ta.highest\", slot: true },\n { name: \"ta.lowest\", slot: true },\n { name: \"ta.highestbars\", slot: true },\n { name: \"ta.lowestbars\", slot: true },\n { name: \"ta.change\", slot: true },\n { name: \"ta.valuewhen\", slot: true },\n { name: \"ta.barssince\", slot: true },\n { name: \"ta.wma\", slot: true },\n { name: \"ta.vwma\", slot: true },\n { name: \"ta.hma\", slot: true },\n { name: \"ta.smma\", slot: true },\n { name: \"ta.dema\", slot: true },\n { name: \"ta.tema\", slot: true },\n { name: \"ta.kama\", slot: true },\n { name: \"ta.alma\", slot: true },\n { name: \"ta.lsma\", slot: true },\n { name: \"ta.mcginley\", slot: true },\n { name: \"ta.maRibbon\", slot: true },\n { name: \"ta.cci\", slot: true },\n { name: \"ta.stoch\", slot: true },\n { name: \"ta.williamsR\", slot: true },\n { name: \"ta.stochRsi\", slot: true },\n { name: \"ta.ultimateOsc\", slot: true },\n { name: \"ta.coppock\", slot: true },\n { name: \"ta.ppo\", slot: true },\n { name: \"ta.dpo\", slot: true },\n { name: \"ta.connorsRsi\", slot: true },\n { name: \"ta.kst\", slot: true },\n { name: \"ta.fisher\", slot: true },\n { name: \"ta.klinger\", slot: true },\n { name: \"ta.rvgi\", slot: true },\n { name: \"ta.ao\", slot: true },\n { name: \"ta.cmo\", slot: true },\n { name: \"ta.momentum\", slot: true },\n { name: \"ta.roc\", slot: true },\n { name: \"ta.pmo\", slot: true },\n { name: \"ta.smi\", slot: true },\n { name: \"ta.tsi\", slot: true },\n { name: \"ta.aroon\", slot: true },\n { name: \"ta.aroonOsc\", slot: true },\n { name: \"ta.adx\", slot: true },\n { name: \"ta.dmi\", slot: true },\n { name: \"ta.trix\", slot: true },\n { name: \"ta.vortex\", slot: true },\n { name: \"ta.trendStrengthIndex\", slot: true },\n { name: \"ta.ichimoku\", slot: true },\n { name: \"ta.vol\", slot: true },\n { name: \"ta.vwap\", slot: true },\n { name: \"ta.anchoredVwap\", slot: true },\n { name: \"ta.obv\", slot: true },\n { name: \"ta.adl\", slot: true },\n { name: \"ta.bop\", slot: true },\n { name: \"ta.cmf\", slot: true },\n { name: \"ta.chaikinOsc\", slot: true },\n { name: \"ta.mfi\", slot: true },\n { name: \"ta.netVolume\", slot: true },\n { name: \"ta.pvo\", slot: true },\n { name: \"ta.pvt\", slot: true },\n { name: \"ta.eom\", slot: true },\n { name: \"ta.nvi\", slot: true },\n { name: \"ta.pvi\", slot: true },\n { name: \"ta.visibleRangeVolumeProfile\", slot: true },\n { name: \"ta.anchoredVolumeProfile\", slot: true },\n { name: \"ta.sessionVolumeProfile\", slot: true },\n { name: \"ta.fixedRangeVolumeProfile\", slot: true },\n { name: \"ta.median\", slot: true },\n { name: \"ta.adr\", slot: true },\n { name: \"ta.ulcerIndex\", slot: true },\n { name: \"ta.bbPercentB\", slot: true },\n { name: \"ta.bbw\", slot: true },\n { name: \"ta.donchian\", slot: true },\n { name: \"ta.keltner\", slot: true },\n { name: \"ta.envelope\", slot: true },\n { name: \"ta.chop\", slot: true },\n { name: \"ta.historicalVolatility\", slot: true },\n { name: \"ta.rvi\", slot: true },\n { name: \"ta.massIndex\", slot: true },\n { name: \"ta.psar\", slot: true },\n { name: \"ta.supertrend\", slot: true },\n { name: \"ta.chandelier\", slot: true },\n { name: \"ta.chandeKrollStop\", slot: true },\n { name: \"ta.williamsFractal\", slot: true },\n { name: \"ta.zigZag\", slot: true },\n { name: \"ta.pivotsHighLow\", slot: true },\n { name: \"ta.pivotsStandard\", slot: true },\n { name: \"ta.volatilityStop\", slot: true },\n { name: \"ta.nz\", slot: false },\n { name: \"plot\", slot: true },\n { name: \"hline\", slot: true },\n { name: \"alert\", slot: true },\n // Phase 3 — draw.* namespace. One entry per kind in DRAWING_KINDS\n // order. Names are camelCase (`draw.<kindCamelCase>`); the wire\n // format keeps the kebab-case `DrawingKind`.\n { name: \"draw.line\", slot: true },\n { name: \"draw.horizontalLine\", slot: true },\n { name: \"draw.horizontalRay\", slot: true },\n { name: \"draw.verticalLine\", slot: true },\n { name: \"draw.crossLine\", slot: true },\n { name: \"draw.trendAngle\", slot: true },\n { name: \"draw.rectangle\", slot: true },\n { name: \"draw.rotatedRectangle\", slot: true },\n { name: \"draw.triangle\", slot: true },\n { name: \"draw.polyline\", slot: true },\n { name: \"draw.circle\", slot: true },\n { name: \"draw.ellipse\", slot: true },\n { name: \"draw.path\", slot: true },\n { name: \"draw.fillBetween\", slot: true },\n { name: \"draw.marker\", slot: true },\n { name: \"draw.arc\", slot: true },\n { name: \"draw.curve\", slot: true },\n { name: \"draw.doubleCurve\", slot: true },\n { name: \"draw.pen\", slot: true },\n { name: \"draw.highlighter\", slot: true },\n { name: \"draw.brush\", slot: true },\n { name: \"draw.text\", slot: true },\n { name: \"draw.arrow\", slot: true },\n { name: \"draw.arrowMarker\", slot: true },\n { name: \"draw.arrowMarkUp\", slot: true },\n { name: \"draw.arrowMarkDown\", slot: true },\n { name: \"draw.trendChannel\", slot: true },\n { name: \"draw.flatTopBottom\", slot: true },\n { name: \"draw.disjointChannel\", slot: true },\n { name: \"draw.regressionTrend\", slot: true },\n { name: \"draw.fibRetracement\", slot: true },\n { name: \"draw.fibTrendExtension\", slot: true },\n { name: \"draw.fibChannel\", slot: true },\n { name: \"draw.fibTimeZone\", slot: true },\n { name: \"draw.fibWedge\", slot: true },\n { name: \"draw.fibSpeedFan\", slot: true },\n { name: \"draw.fibSpeedArcs\", slot: true },\n { name: \"draw.fibSpiral\", slot: true },\n { name: \"draw.fibCircles\", slot: true },\n { name: \"draw.fibTrendTime\", slot: true },\n { name: \"draw.gannBox\", slot: true },\n { name: \"draw.gannSquareFixed\", slot: true },\n { name: \"draw.gannSquare\", slot: true },\n { name: \"draw.gannFan\", slot: true },\n { name: \"draw.pitchfork\", slot: true },\n { name: \"draw.pitchfan\", slot: true },\n { name: \"draw.xabcdPattern\", slot: true },\n { name: \"draw.cypherPattern\", slot: true },\n { name: \"draw.headAndShoulders\", slot: true },\n { name: \"draw.abcdPattern\", slot: true },\n { name: \"draw.trianglePattern\", slot: true },\n { name: \"draw.threeDrivesPattern\", slot: true },\n { name: \"draw.elliottImpulseWave\", slot: true },\n { name: \"draw.elliottCorrectionWave\", slot: true },\n { name: \"draw.elliottTriangleWave\", slot: true },\n { name: \"draw.elliottDoubleCombo\", slot: true },\n { name: \"draw.elliottTripleCombo\", slot: true },\n { name: \"draw.cyclicLines\", slot: true },\n { name: \"draw.timeCycles\", slot: true },\n { name: \"draw.sineLine\", slot: true },\n { name: \"draw.group\", slot: true },\n { name: \"draw.frame\", slot: true },\n { name: \"draw.table\", slot: true },\n { name: \"state.float\", slot: true },\n { name: \"state.int\", slot: true },\n { name: \"state.bool\", slot: true },\n { name: \"state.string\", slot: true },\n { name: \"state.series\", slot: true },\n { name: \"state.tick.float\", slot: true },\n { name: \"state.tick.int\", slot: true },\n { name: \"state.tick.bool\", slot: true },\n { name: \"state.tick.string\", slot: true },\n // Both the data form `request.security({ interval })` and the expression\n // form `request.security({ interval }, (bar) => …)` route through this one\n // entry: `slot: true` injects the slot id as the first argument regardless\n // of the optional second (callback) argument.\n { name: \"request.security\", slot: true },\n { name: \"request.lowerTf\", slot: true },\n { name: \"defineAlertCondition.signal\", slot: false },\n { name: \"runtime.log\", slot: false },\n { name: \"runtime.error\", slot: false },\n];\n\n/**\n * Frozen set of every fully-qualified call name the compiler tracks for\n * static-analysis (`stateful-call-inside-loop`) and slot-id injection\n *. Each entry carries a `slot` flag: `slot: true`\n * primitives allocate per-callsite hidden state and get a string-literal\n * slot id injected as their first argument; `slot: false` primitives are\n * pure helpers that ride along in the set because Pine still forbids\n * them inside loops (e.g. `ta.nz`).\n *\n * Phase 1 shipped 12 `slot: true` entries. Phase 2 widens the shape to\n * `{ name, slot }` so `ta.nz` (the only stateless Phase-2 cross-functional\n * primitive) can opt out of slot-id injection without losing the\n * in-loop diagnostic. Subsequent Phase-2 batch tasks (Tasks 6–28) each\n * append `slot: true` entries; Phase 3 appends 61 `draw.<camelKind>`\n * entries (all `slot: true`), and Phase 4 appends 8 `state.*` /\n * `state.tick.*` entries plus request primitives. Phase 5 appends alert-condition signalling plus runtime\n * logging/error as stateless loop-diagnostic entries plus `draw.table`\n * as a slot-backed viewport drawing.\n *\n * Additive within `apiVersion: 1` (currently 176 entries): new entries MAY\n * be appended in a `1.x` release (a new call name is additive — new callsites\n * only, no change to any existing script). Removing or renaming an entry, or\n * flipping its `slot`, is a language change and requires `apiVersion: 2` — see\n * `docs/spec/versioning.md`.\n *\n * @since 0.1\n * @stable\n * @example\n * import { STATEFUL_PRIMITIVES } from \"@invinite-org/chartlang-core\";\n * for (const entry of STATEFUL_PRIMITIVES) {\n * if (entry.name === \"ta.ema\" && entry.slot) {\n * // compiler injects an id here\n * }\n * }\n */\nexport const STATEFUL_PRIMITIVES: ReadonlySet<StatefulPrimitiveEntry> = Object.freeze(\n new Set<StatefulPrimitiveEntry>(STATEFUL_PRIMITIVE_ENTRIES),\n);\n\n/**\n * Name → entry index of {@link STATEFUL_PRIMITIVES}. The compiler's\n * `callsiteIdInjection` and `statefulCallInLoop` passes consult this map\n * by callee name once per call site — O(1) lookup instead of an O(n) scan\n * over the 176-entry set on every visited call. The map is derived from\n * the same canonical entry list as {@link STATEFUL_PRIMITIVES} so adding\n * a primitive to the set adds it here automatically.\n *\n * Additive within `apiVersion: 1` (currently 176 entries): new entries MAY\n * be appended in a `1.x` release (a new call name is additive — new callsites\n * only, no change to any existing script). Removing or renaming an entry, or\n * flipping its `slot`, is a language change and requires `apiVersion: 2` — see\n * `docs/spec/versioning.md`.\n *\n * @since 0.2\n * @stable\n * @example\n * import { STATEFUL_PRIMITIVES_BY_NAME } from \"@invinite-org/chartlang-core\";\n * const entry = STATEFUL_PRIMITIVES_BY_NAME.get(\"ta.ema\");\n * // entry is { name: \"ta.ema\", slot: true } | undefined\n */\nexport const STATEFUL_PRIMITIVES_BY_NAME: ReadonlyMap<string, StatefulPrimitiveEntry> = new Map<\n string,\n StatefulPrimitiveEntry\n>(STATEFUL_PRIMITIVE_ENTRIES.map((entry) => [entry.name, entry]));\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ta/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ta/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,cAAc,SAAS,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\nexport * from \"./ta.js\";\n"]}