@invinite-org/chartlang-adapter-kit 1.2.1 → 1.4.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 (153) hide show
  1. package/CHANGELOG.md +157 -0
  2. package/README.md +7 -0
  3. package/dist/canvas/index.d.ts +5 -0
  4. package/dist/canvas/index.d.ts.map +1 -0
  5. package/dist/canvas/index.js +5 -0
  6. package/dist/canvas/index.js.map +1 -0
  7. package/dist/canvas/mockContext.d.ts +168 -0
  8. package/dist/canvas/mockContext.d.ts.map +1 -0
  9. package/dist/canvas/mockContext.js +198 -0
  10. package/dist/canvas/mockContext.js.map +1 -0
  11. package/dist/canvas/paintPrimitive.d.ts +35 -0
  12. package/dist/canvas/paintPrimitive.d.ts.map +1 -0
  13. package/dist/canvas/paintPrimitive.js +171 -0
  14. package/dist/canvas/paintPrimitive.js.map +1 -0
  15. package/dist/canvas/renderCtx.d.ts +40 -0
  16. package/dist/canvas/renderCtx.d.ts.map +1 -0
  17. package/dist/canvas/renderCtx.js +4 -0
  18. package/dist/canvas/renderCtx.js.map +1 -0
  19. package/dist/capabilities/capabilities.d.ts +9 -7
  20. package/dist/capabilities/capabilities.d.ts.map +1 -1
  21. package/dist/capabilities/capabilities.js +14 -8
  22. package/dist/capabilities/capabilities.js.map +1 -1
  23. package/dist/geometry/_lib/arrowhead.d.ts +18 -0
  24. package/dist/geometry/_lib/arrowhead.d.ts.map +1 -0
  25. package/dist/geometry/_lib/arrowhead.js +38 -0
  26. package/dist/geometry/_lib/arrowhead.js.map +1 -0
  27. package/dist/geometry/_lib/bezier.d.ts +57 -0
  28. package/dist/geometry/_lib/bezier.d.ts.map +1 -0
  29. package/dist/geometry/_lib/bezier.js +84 -0
  30. package/dist/geometry/_lib/bezier.js.map +1 -0
  31. package/dist/geometry/_lib/chevron.d.ts +29 -0
  32. package/dist/geometry/_lib/chevron.d.ts.map +1 -0
  33. package/dist/geometry/_lib/chevron.js +37 -0
  34. package/dist/geometry/_lib/chevron.js.map +1 -0
  35. package/dist/geometry/_lib/dash.d.ts +30 -0
  36. package/dist/geometry/_lib/dash.d.ts.map +1 -0
  37. package/dist/geometry/_lib/dash.js +40 -0
  38. package/dist/geometry/_lib/dash.js.map +1 -0
  39. package/dist/geometry/_lib/fibLevels.d.ts +36 -0
  40. package/dist/geometry/_lib/fibLevels.d.ts.map +1 -0
  41. package/dist/geometry/_lib/fibLevels.js +44 -0
  42. package/dist/geometry/_lib/fibLevels.js.map +1 -0
  43. package/dist/geometry/_lib/gannLevels.d.ts +54 -0
  44. package/dist/geometry/_lib/gannLevels.d.ts.map +1 -0
  45. package/dist/geometry/_lib/gannLevels.js +88 -0
  46. package/dist/geometry/_lib/gannLevels.js.map +1 -0
  47. package/dist/geometry/_lib/lineExtend.d.ts +31 -0
  48. package/dist/geometry/_lib/lineExtend.d.ts.map +1 -0
  49. package/dist/geometry/_lib/lineExtend.js +48 -0
  50. package/dist/geometry/_lib/lineExtend.js.map +1 -0
  51. package/dist/geometry/_lib/namedPolyline.d.ts +25 -0
  52. package/dist/geometry/_lib/namedPolyline.d.ts.map +1 -0
  53. package/dist/geometry/_lib/namedPolyline.js +64 -0
  54. package/dist/geometry/_lib/namedPolyline.js.map +1 -0
  55. package/dist/geometry/_lib/pitchforkGeom.d.ts +46 -0
  56. package/dist/geometry/_lib/pitchforkGeom.d.ts.map +1 -0
  57. package/dist/geometry/_lib/pitchforkGeom.js +70 -0
  58. package/dist/geometry/_lib/pitchforkGeom.js.map +1 -0
  59. package/dist/geometry/_lib/shapeStyle.d.ts +21 -0
  60. package/dist/geometry/_lib/shapeStyle.d.ts.map +1 -0
  61. package/dist/geometry/_lib/shapeStyle.js +41 -0
  62. package/dist/geometry/_lib/shapeStyle.js.map +1 -0
  63. package/dist/geometry/_lib/strokeStyle.d.ts +34 -0
  64. package/dist/geometry/_lib/strokeStyle.d.ts.map +1 -0
  65. package/dist/geometry/_lib/strokeStyle.js +26 -0
  66. package/dist/geometry/_lib/strokeStyle.js.map +1 -0
  67. package/dist/geometry/_lib/textStyle.d.ts +70 -0
  68. package/dist/geometry/_lib/textStyle.d.ts.map +1 -0
  69. package/dist/geometry/_lib/textStyle.js +78 -0
  70. package/dist/geometry/_lib/textStyle.js.map +1 -0
  71. package/dist/geometry/decompose.d.ts +28 -0
  72. package/dist/geometry/decompose.d.ts.map +1 -0
  73. package/dist/geometry/decompose.js +176 -0
  74. package/dist/geometry/decompose.js.map +1 -0
  75. package/dist/geometry/index.d.ts +4 -0
  76. package/dist/geometry/index.d.ts.map +1 -0
  77. package/dist/geometry/index.js +5 -0
  78. package/dist/geometry/index.js.map +1 -0
  79. package/dist/geometry/kinds/annotations.d.ts +77 -0
  80. package/dist/geometry/kinds/annotations.d.ts.map +1 -0
  81. package/dist/geometry/kinds/annotations.js +219 -0
  82. package/dist/geometry/kinds/annotations.js.map +1 -0
  83. package/dist/geometry/kinds/boxes.d.ts +116 -0
  84. package/dist/geometry/kinds/boxes.d.ts.map +1 -0
  85. package/dist/geometry/kinds/boxes.js +285 -0
  86. package/dist/geometry/kinds/boxes.js.map +1 -0
  87. package/dist/geometry/kinds/channels.d.ts +72 -0
  88. package/dist/geometry/kinds/channels.d.ts.map +1 -0
  89. package/dist/geometry/kinds/channels.js +148 -0
  90. package/dist/geometry/kinds/channels.js.map +1 -0
  91. package/dist/geometry/kinds/containers.d.ts +54 -0
  92. package/dist/geometry/kinds/containers.d.ts.map +1 -0
  93. package/dist/geometry/kinds/containers.js +268 -0
  94. package/dist/geometry/kinds/containers.js.map +1 -0
  95. package/dist/geometry/kinds/curves.d.ts +53 -0
  96. package/dist/geometry/kinds/curves.d.ts.map +1 -0
  97. package/dist/geometry/kinds/curves.js +110 -0
  98. package/dist/geometry/kinds/curves.js.map +1 -0
  99. package/dist/geometry/kinds/cycles.d.ts +52 -0
  100. package/dist/geometry/kinds/cycles.d.ts.map +1 -0
  101. package/dist/geometry/kinds/cycles.js +158 -0
  102. package/dist/geometry/kinds/cycles.js.map +1 -0
  103. package/dist/geometry/kinds/elliott.d.ts +73 -0
  104. package/dist/geometry/kinds/elliott.d.ts.map +1 -0
  105. package/dist/geometry/kinds/elliott.js +116 -0
  106. package/dist/geometry/kinds/elliott.js.map +1 -0
  107. package/dist/geometry/kinds/fibonacci.d.ts +166 -0
  108. package/dist/geometry/kinds/fibonacci.d.ts.map +1 -0
  109. package/dist/geometry/kinds/fibonacci.js +458 -0
  110. package/dist/geometry/kinds/fibonacci.js.map +1 -0
  111. package/dist/geometry/kinds/freehand.d.ts +53 -0
  112. package/dist/geometry/kinds/freehand.d.ts.map +1 -0
  113. package/dist/geometry/kinds/freehand.js +115 -0
  114. package/dist/geometry/kinds/freehand.js.map +1 -0
  115. package/dist/geometry/kinds/gann.d.ts +63 -0
  116. package/dist/geometry/kinds/gann.d.ts.map +1 -0
  117. package/dist/geometry/kinds/gann.js +153 -0
  118. package/dist/geometry/kinds/gann.js.map +1 -0
  119. package/dist/geometry/kinds/lines.d.ts +90 -0
  120. package/dist/geometry/kinds/lines.d.ts.map +1 -0
  121. package/dist/geometry/kinds/lines.js +201 -0
  122. package/dist/geometry/kinds/lines.js.map +1 -0
  123. package/dist/geometry/kinds/marker.d.ts +21 -0
  124. package/dist/geometry/kinds/marker.d.ts.map +1 -0
  125. package/dist/geometry/kinds/marker.js +47 -0
  126. package/dist/geometry/kinds/marker.js.map +1 -0
  127. package/dist/geometry/kinds/patterns.d.ts +85 -0
  128. package/dist/geometry/kinds/patterns.d.ts.map +1 -0
  129. package/dist/geometry/kinds/patterns.js +133 -0
  130. package/dist/geometry/kinds/patterns.js.map +1 -0
  131. package/dist/geometry/kinds/pitchforks.d.ts +36 -0
  132. package/dist/geometry/kinds/pitchforks.d.ts.map +1 -0
  133. package/dist/geometry/kinds/pitchforks.js +109 -0
  134. package/dist/geometry/kinds/pitchforks.js.map +1 -0
  135. package/dist/geometry/project.d.ts +50 -0
  136. package/dist/geometry/project.d.ts.map +1 -0
  137. package/dist/geometry/project.js +62 -0
  138. package/dist/geometry/project.js.map +1 -0
  139. package/dist/geometry/types.d.ts +146 -0
  140. package/dist/geometry/types.d.ts.map +1 -0
  141. package/dist/geometry/types.js +4 -0
  142. package/dist/geometry/types.js.map +1 -0
  143. package/dist/index.d.ts +2 -0
  144. package/dist/index.d.ts.map +1 -1
  145. package/dist/index.js +1 -0
  146. package/dist/index.js.map +1 -1
  147. package/dist/types.d.ts +54 -0
  148. package/dist/types.d.ts.map +1 -1
  149. package/dist/types.js.map +1 -1
  150. package/dist/validation/validateEmission.d.ts.map +1 -1
  151. package/dist/validation/validateEmission.js +47 -0
  152. package/dist/validation/validateEmission.js.map +1 -1
  153. package/package.json +9 -2
@@ -0,0 +1,146 @@
1
+ /**
2
+ * A 2D point in renderer pixel space — the structural type every
3
+ * projection helper returns and every {@link DrawPrimitive} consumes.
4
+ * Read-only so decomposers can't mutate vertices they don't own.
5
+ *
6
+ * @since 1.3
7
+ * @stable
8
+ * @example
9
+ * const p: Point2 = { x: 100, y: 50 };
10
+ * void p;
11
+ */
12
+ export type Point2 = {
13
+ readonly x: number;
14
+ readonly y: number;
15
+ };
16
+ /**
17
+ * Visible window into world coordinates. `xMin`/`xMax` are bar times in
18
+ * UTC milliseconds; `yMin`/`yMax` are prices in the quote currency.
19
+ * `pxWidth`/`pxHeight` are the renderer's drawable size in CSS pixels.
20
+ * Ported verbatim from the canvas2d adapter's `render/coords.ts` so all
21
+ * adapters share one projection contract.
22
+ *
23
+ * @since 1.3
24
+ * @stable
25
+ * @example
26
+ * const vp: Viewport = {
27
+ * xMin: 0, xMax: 9, yMin: 100, yMax: 110,
28
+ * pxWidth: 800, pxHeight: 400,
29
+ * };
30
+ * void vp;
31
+ */
32
+ export type Viewport = {
33
+ readonly xMin: number;
34
+ readonly xMax: number;
35
+ readonly yMin: number;
36
+ readonly yMax: number;
37
+ readonly pxWidth: number;
38
+ readonly pxHeight: number;
39
+ };
40
+ /**
41
+ * Resolved stroke styling for a {@link DrawPrimitive}. `dash` is the
42
+ * `setLineDash` segment array — `[]` is a solid stroke. Decomposers map
43
+ * a `LineStyle` to `dash` via the `_lib/dash` helper.
44
+ *
45
+ * `alpha ∈ [0, 1]` is the optional stroke opacity the painter brackets
46
+ * around the `stroke()` call (the `highlighter` freehand kind sets it).
47
+ * When omitted the stroke is fully opaque and the painter emits no
48
+ * `globalAlpha` mutation — so a stroke without `alpha` is byte-identical
49
+ * to a Task-1 stroke.
50
+ *
51
+ * @since 1.3
52
+ * @stable
53
+ * @example
54
+ * const s: StrokeStyle = { color: "#000000", width: 1, dash: [] };
55
+ * void s;
56
+ */
57
+ export type StrokeStyle = {
58
+ readonly color: string;
59
+ readonly width: number;
60
+ readonly dash: ReadonlyArray<number>;
61
+ readonly alpha?: number;
62
+ };
63
+ /**
64
+ * Resolved fill styling for a {@link DrawPrimitive}. `alpha ∈ [0, 1]`
65
+ * is applied around the fill so a subsequent stroke draws at full
66
+ * opacity.
67
+ *
68
+ * @since 1.3
69
+ * @stable
70
+ * @example
71
+ * const f: FillStyle = { color: "#dbeafe", alpha: 0.4 };
72
+ * void f;
73
+ */
74
+ export type FillStyle = {
75
+ readonly color: string;
76
+ readonly alpha: number;
77
+ };
78
+ /**
79
+ * Renderer-agnostic intermediate representation every drawing reduces
80
+ * to. {@link decomposeDrawing} returns a flat `DrawPrimitive[]`; each
81
+ * adapter paints the list with its own sink (canvas `paintPrimitive`,
82
+ * Konva nodes, ECharts `graphic`, …). The four shapes — `polyline`,
83
+ * `arc`, `text`, `marker` — are the smallest set all the target chart
84
+ * libraries can consume.
85
+ *
86
+ * - `polyline` — an open or `closed` path with optional `stroke` / `fill`.
87
+ * - `arc` — a circular arc centred on `(cx, cy)` from `start` to `end`
88
+ * radians, with optional `stroke` / `fill`.
89
+ * - `text` — a single label at `(x, y)` with explicit `align` / `baseline`.
90
+ * - `marker` — a sized glyph at `(x, y)` (reserved for adapter / future
91
+ * kinds; no basic kind emits it).
92
+ *
93
+ * @since 1.3
94
+ * @stable
95
+ * @example
96
+ * const seg: DrawPrimitive = {
97
+ * kind: "polyline",
98
+ * points: [{ x: 0, y: 0 }, { x: 10, y: 10 }],
99
+ * closed: false,
100
+ * stroke: { color: "#000000", width: 1, dash: [] },
101
+ * };
102
+ * void seg;
103
+ */
104
+ export type DrawPrimitive = {
105
+ readonly kind: "polyline";
106
+ readonly points: ReadonlyArray<Point2>;
107
+ readonly closed: boolean;
108
+ readonly stroke?: StrokeStyle;
109
+ readonly fill?: FillStyle;
110
+ } | {
111
+ readonly kind: "arc";
112
+ readonly cx: number;
113
+ readonly cy: number;
114
+ readonly r: number;
115
+ readonly start: number;
116
+ readonly end: number;
117
+ /**
118
+ * Whether the painter issues `closePath()` after the arc —
119
+ * drawing the chord back to the arc's start. `true` only for a
120
+ * full-circle shape (e.g. `circle`); partial arcs (the
121
+ * `trend-angle` indicator, `time-cycles`) MUST be `false`, else
122
+ * the chord renders as a spurious diameter line.
123
+ */
124
+ readonly closed: boolean;
125
+ readonly stroke?: StrokeStyle;
126
+ readonly fill?: FillStyle;
127
+ } | {
128
+ readonly kind: "text";
129
+ readonly x: number;
130
+ readonly y: number;
131
+ readonly text: string;
132
+ readonly color: string;
133
+ readonly font: string;
134
+ readonly align: "left" | "center" | "right";
135
+ readonly baseline: "top" | "middle" | "bottom";
136
+ readonly bgColor?: string;
137
+ } | {
138
+ readonly kind: "marker";
139
+ readonly shape: "circle" | "square" | "diamond" | "triangle-up" | "triangle-down";
140
+ readonly x: number;
141
+ readonly y: number;
142
+ readonly size: number;
143
+ readonly stroke?: StrokeStyle;
144
+ readonly fill?: FillStyle;
145
+ };
146
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/geometry/types.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,CAAC,EAAE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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/geometry/types.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 * A 2D point in renderer pixel space — the structural type every\n * projection helper returns and every {@link DrawPrimitive} consumes.\n * Read-only so decomposers can't mutate vertices they don't own.\n *\n * @since 1.3\n * @stable\n * @example\n * const p: Point2 = { x: 100, y: 50 };\n * void p;\n */\nexport type Point2 = { readonly x: number; readonly y: number };\n\n/**\n * Visible window into world coordinates. `xMin`/`xMax` are bar times in\n * UTC milliseconds; `yMin`/`yMax` are prices in the quote currency.\n * `pxWidth`/`pxHeight` are the renderer's drawable size in CSS pixels.\n * Ported verbatim from the canvas2d adapter's `render/coords.ts` so all\n * adapters share one projection contract.\n *\n * @since 1.3\n * @stable\n * @example\n * const vp: Viewport = {\n * xMin: 0, xMax: 9, yMin: 100, yMax: 110,\n * pxWidth: 800, pxHeight: 400,\n * };\n * void vp;\n */\nexport type Viewport = {\n readonly xMin: number;\n readonly xMax: number;\n readonly yMin: number;\n readonly yMax: number;\n readonly pxWidth: number;\n readonly pxHeight: number;\n};\n\n/**\n * Resolved stroke styling for a {@link DrawPrimitive}. `dash` is the\n * `setLineDash` segment array — `[]` is a solid stroke. Decomposers map\n * a `LineStyle` to `dash` via the `_lib/dash` helper.\n *\n * `alpha ∈ [0, 1]` is the optional stroke opacity the painter brackets\n * around the `stroke()` call (the `highlighter` freehand kind sets it).\n * When omitted the stroke is fully opaque and the painter emits no\n * `globalAlpha` mutation — so a stroke without `alpha` is byte-identical\n * to a Task-1 stroke.\n *\n * @since 1.3\n * @stable\n * @example\n * const s: StrokeStyle = { color: \"#000000\", width: 1, dash: [] };\n * void s;\n */\nexport type StrokeStyle = {\n readonly color: string;\n readonly width: number;\n readonly dash: ReadonlyArray<number>;\n readonly alpha?: number;\n};\n\n/**\n * Resolved fill styling for a {@link DrawPrimitive}. `alpha ∈ [0, 1]`\n * is applied around the fill so a subsequent stroke draws at full\n * opacity.\n *\n * @since 1.3\n * @stable\n * @example\n * const f: FillStyle = { color: \"#dbeafe\", alpha: 0.4 };\n * void f;\n */\nexport type FillStyle = { readonly color: string; readonly alpha: number };\n\n/**\n * Renderer-agnostic intermediate representation every drawing reduces\n * to. {@link decomposeDrawing} returns a flat `DrawPrimitive[]`; each\n * adapter paints the list with its own sink (canvas `paintPrimitive`,\n * Konva nodes, ECharts `graphic`, …). The four shapes — `polyline`,\n * `arc`, `text`, `marker` — are the smallest set all the target chart\n * libraries can consume.\n *\n * - `polyline` — an open or `closed` path with optional `stroke` / `fill`.\n * - `arc` — a circular arc centred on `(cx, cy)` from `start` to `end`\n * radians, with optional `stroke` / `fill`.\n * - `text` — a single label at `(x, y)` with explicit `align` / `baseline`.\n * - `marker` — a sized glyph at `(x, y)` (reserved for adapter / future\n * kinds; no basic kind emits it).\n *\n * @since 1.3\n * @stable\n * @example\n * const seg: DrawPrimitive = {\n * kind: \"polyline\",\n * points: [{ x: 0, y: 0 }, { x: 10, y: 10 }],\n * closed: false,\n * stroke: { color: \"#000000\", width: 1, dash: [] },\n * };\n * void seg;\n */\nexport type DrawPrimitive =\n | {\n readonly kind: \"polyline\";\n readonly points: ReadonlyArray<Point2>;\n readonly closed: boolean;\n readonly stroke?: StrokeStyle;\n readonly fill?: FillStyle;\n }\n | {\n readonly kind: \"arc\";\n readonly cx: number;\n readonly cy: number;\n readonly r: number;\n readonly start: number;\n readonly end: number;\n /**\n * Whether the painter issues `closePath()` after the arc —\n * drawing the chord back to the arc's start. `true` only for a\n * full-circle shape (e.g. `circle`); partial arcs (the\n * `trend-angle` indicator, `time-cycles`) MUST be `false`, else\n * the chord renders as a spurious diameter line.\n */\n readonly closed: boolean;\n readonly stroke?: StrokeStyle;\n readonly fill?: FillStyle;\n }\n | {\n readonly kind: \"text\";\n readonly x: number;\n readonly y: number;\n readonly text: string;\n readonly color: string;\n readonly font: string;\n readonly align: \"left\" | \"center\" | \"right\";\n readonly baseline: \"top\" | \"middle\" | \"bottom\";\n readonly bgColor?: string;\n }\n | {\n readonly kind: \"marker\";\n readonly shape: \"circle\" | \"square\" | \"diamond\" | \"triangle-up\" | \"triangle-down\";\n readonly x: number;\n readonly y: number;\n readonly size: number;\n readonly stroke?: StrokeStyle;\n readonly fill?: FillStyle;\n };\n"]}
package/dist/index.d.ts CHANGED
@@ -8,5 +8,7 @@ export type { ValidationFail, ValidationOk, ValidationResult } from "./validatio
8
8
  export { mockCandleSource } from "./mocks/index.js";
9
9
  export type { MockCandleSourceMode, MockCandleSourceOpts } from "./mocks/index.js";
10
10
  export { BufferingAdapter, PassThroughAdapter } from "./base/index.js";
11
+ export { decomposeDrawing, priceToY, timeToX, worldPointToPixel } from "./geometry/index.js";
12
+ export type { DrawPrimitive, FillStyle, Point2, StrokeStyle, Viewport, } from "./geometry/index.js";
11
13
  export type { Adapter, AdapterSymInfo, AlertChannel, AlertConditionEmission, AlertEmission, Capabilities, CandleEvent, DiagnosticCode, DrawingCounts, DrawingEmission, DrawingKind, InputKind, LogEmission, PlotEmission, PlotKind, PlotOverride, PlotSlotDescriptor, PlotStyle, RunnerEmissions, RuntimeDiagnostic, SymInfoField, } from "./types.js";
12
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACtE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,YAAY,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AAoB,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7F,YAAY,EACR,aAAa,EACb,SAAS,EACT,MAAM,EACN,WAAW,EACX,QAAQ,GACX,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACR,OAAO,EACP,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,aAAa,EACb,YAAY,EACZ,WAAW,EACX,cAAc,EACd,aAAa,EACb,eAAe,EACf,WAAW,EACX,SAAS,EACT,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,YAAY,GACf,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -6,4 +6,5 @@ export { PHASE_5_PLOT_KINDS, capabilities } from "./capabilities/index.js";
6
6
  export { decodeDrawing, validateEmission } from "./validation/index.js";
7
7
  export { mockCandleSource } from "./mocks/index.js";
8
8
  export { BufferingAdapter, PassThroughAdapter } from "./base/index.js";
9
+ export { decomposeDrawing, priceToY, timeToX, worldPointToPixel } from "./geometry/index.js";
9
10
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAExE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,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 { KIND_BUCKET, bucketFor } from \"@invinite-org/chartlang-core\";\nexport type { DrawingBucket, DrawingState } from \"@invinite-org/chartlang-core\";\nexport { defineAdapter } from \"./defineAdapter.js\";\nexport type { DefineAdapterOpts } from \"./defineAdapter.js\";\nexport { PHASE_5_PLOT_KINDS, capabilities } from \"./capabilities/index.js\";\nexport { decodeDrawing, validateEmission } from \"./validation/index.js\";\nexport type { ValidationFail, ValidationOk, ValidationResult } from \"./validation/index.js\";\nexport { mockCandleSource } from \"./mocks/index.js\";\nexport type { MockCandleSourceMode, MockCandleSourceOpts } from \"./mocks/index.js\";\nexport { BufferingAdapter, PassThroughAdapter } from \"./base/index.js\";\nexport type {\n Adapter,\n AdapterSymInfo,\n AlertChannel,\n AlertConditionEmission,\n AlertEmission,\n Capabilities,\n CandleEvent,\n DiagnosticCode,\n DrawingCounts,\n DrawingEmission,\n DrawingKind,\n InputKind,\n LogEmission,\n PlotEmission,\n PlotKind,\n PlotOverride,\n PlotSlotDescriptor,\n PlotStyle,\n RunnerEmissions,\n RuntimeDiagnostic,\n SymInfoField,\n} from \"./types.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAExE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,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 { KIND_BUCKET, bucketFor } from \"@invinite-org/chartlang-core\";\nexport type { DrawingBucket, DrawingState } from \"@invinite-org/chartlang-core\";\nexport { defineAdapter } from \"./defineAdapter.js\";\nexport type { DefineAdapterOpts } from \"./defineAdapter.js\";\nexport { PHASE_5_PLOT_KINDS, capabilities } from \"./capabilities/index.js\";\nexport { decodeDrawing, validateEmission } from \"./validation/index.js\";\nexport type { ValidationFail, ValidationOk, ValidationResult } from \"./validation/index.js\";\nexport { mockCandleSource } from \"./mocks/index.js\";\nexport type { MockCandleSourceMode, MockCandleSourceOpts } from \"./mocks/index.js\";\nexport { BufferingAdapter, PassThroughAdapter } from \"./base/index.js\";\nexport { decomposeDrawing, priceToY, timeToX, worldPointToPixel } from \"./geometry/index.js\";\nexport type {\n DrawPrimitive,\n FillStyle,\n Point2,\n StrokeStyle,\n Viewport,\n} from \"./geometry/index.js\";\nexport type {\n Adapter,\n AdapterSymInfo,\n AlertChannel,\n AlertConditionEmission,\n AlertEmission,\n Capabilities,\n CandleEvent,\n DiagnosticCode,\n DrawingCounts,\n DrawingEmission,\n DrawingKind,\n InputKind,\n LogEmission,\n PlotEmission,\n PlotKind,\n PlotOverride,\n PlotSlotDescriptor,\n PlotStyle,\n RunnerEmissions,\n RuntimeDiagnostic,\n SymInfoField,\n} from \"./types.js\";\n"]}
package/dist/types.d.ts CHANGED
@@ -458,6 +458,40 @@ export type PlotEmission = {
458
458
  * void hidden;
459
459
  */
460
460
  readonly visible?: boolean;
461
+ /**
462
+ * Presentation-only horizontal display shift in **bars**. Omitted (or
463
+ * `0`) ⇒ no shift, so a no-shift emission is byte-identical to a plot
464
+ * that never carried the field. `+n` shifts the plotted series `n`
465
+ * bars **right** (into the future); `−n` shifts it `n` bars **left**
466
+ * (into the past). It moves only where the series renders — `value`
467
+ * is the unshifted number and alert bars are unaffected. Must be a
468
+ * signed integer; `validateEmission` rejects a non-integer.
469
+ *
470
+ * @since 1.3
471
+ * @stable
472
+ * @example
473
+ * const shifted: PlotEmission["xShift"] = -5;
474
+ * void shifted;
475
+ */
476
+ readonly xShift?: number;
477
+ /**
478
+ * Presentation-only render-order key (z-index). Omitted (or `0`) ⇒ no
479
+ * explicit order, so the emission is byte-identical to a plot that
480
+ * never carried the field. Higher `z` renders on top; lower (incl.
481
+ * negative) renders behind. Adapters MUST compute a stable global
482
+ * order keyed on `(z ?? 0, groupBand, declarationSeq)` — a plot with
483
+ * `z` below a drawing's `z` renders beneath that drawing, crossing the
484
+ * default plots-under-drawings band. Any finite number (fractional
485
+ * allowed); `validateEmission` rejects NaN / ±Infinity. Affects only
486
+ * stacking — `value`, `xShift`, alerts, and `state.*` are unaffected.
487
+ *
488
+ * @since 1.4
489
+ * @stable
490
+ * @example
491
+ * const behind: PlotEmission["z"] = -1;
492
+ * void behind;
493
+ */
494
+ readonly z?: number;
461
495
  };
462
496
  /**
463
497
  * An `alert()` emission. `dedupeKey` is computed by the runtime
@@ -579,6 +613,26 @@ export type DrawingEmission = {
579
613
  readonly state: DrawingState;
580
614
  readonly bar: number;
581
615
  readonly time: number;
616
+ /**
617
+ * Presentation-only render-order key (z-index). Omitted (or `0`) ⇒ no
618
+ * explicit order, so the emission is byte-identical to a drawing that
619
+ * never carried the field. Higher `z` renders on top; a **negative**
620
+ * `z` lets a drawing render **below** `z=0` plots, crossing the
621
+ * default plots-under-drawings band. Adapters MUST compute a stable
622
+ * global order keyed on `(z ?? 0, groupBand, declarationSeq)`. Any
623
+ * finite number (fractional allowed); `validateEmission` rejects
624
+ * NaN / ±Infinity. Affects only stacking — `state.*` geometry is
625
+ * unaffected. `z` is part of the latest state under the per-`(handleId,
626
+ * bar)` last-write-wins dedup: a `create` then `update` that changes
627
+ * `z` takes the updated value.
628
+ *
629
+ * @since 1.4
630
+ * @stable
631
+ * @example
632
+ * const beneathPlots: DrawingEmission["z"] = -1;
633
+ * void beneathPlots;
634
+ */
635
+ readonly z?: number;
582
636
  };
583
637
  /**
584
638
  * Stable machine-readable diagnostic code emitted by the runtime / host
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACR,aAAa,EACb,GAAG,EACH,KAAK,EACL,aAAa,IAAI,iBAAiB,EAClC,WAAW,IAAI,eAAe,EAC9B,SAAS,IAAI,aAAa,EAC1B,QAAQ,IAAI,YAAY,EACxB,YAAY,IAAI,gBAAgB,EAChC,kBAAkB,IAAI,sBAAsB,EAC5C,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,QAAQ,EACR,UAAU,EACb,MAAM,8BAA8B,CAAC;AAEtC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,WAAW,GACjB;IACI,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAClC;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC/B,GACD;IACI,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;IAClB;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC/B,GACD;IACI,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;IAClB;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAER;;;;;;;;;;;GAW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,CAAC,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IAC1C,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IACvD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,OAAO,GAAG;IAClB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACjF;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;IAC7F;;;;;;;;;OASG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC;IAClC,OAAO,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;IAC1E,WAAW,CAAC,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;IAC9C,OAAO,IAAI,IAAI,CAAC;CACnB,CAAC"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.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 {\n AlertSeverity,\n Bar,\n Color,\n DrawingCounts as CoreDrawingCounts,\n DrawingKind as CoreDrawingKind,\n InputKind as CoreInputKind,\n PlotKind as CorePlotKind,\n PlotOverride as CorePlotOverride,\n PlotSlotDescriptor as CorePlotSlotDescriptor,\n DrawingState,\n IntervalDescriptor,\n JsonValue,\n LineStyle,\n LogLevel,\n SymbolType,\n} from \"@invinite-org/chartlang-core\";\n\n/**\n * Adapter-supplied candle event the runtime consumes through\n * `Adapter.candles(...)`. `history` is a batched warm-up payload; `close`\n * carries a finalised bar; `tick` carries an intra-bar update that the\n * runtime applies to the current bar's head slot.\n *\n * @since 0.1\n * @stable\n * @example\n * const evt: CandleEvent = { kind: \"history\", bars: [] };\n */\nexport type CandleEvent =\n | {\n readonly kind: \"history\";\n readonly bars: ReadonlyArray<Bar>;\n /**\n * Secondary-stream key. Omit for the main stream; set to a\n * requested interval value such as `\"1D\"` for MTF candles.\n *\n * @since 0.5\n */\n readonly streamKey?: string;\n }\n | {\n readonly kind: \"close\";\n readonly bar: Bar;\n /**\n * Secondary-stream key. Omit for the main stream; set to a\n * requested interval value such as `\"1D\"` for MTF candles.\n *\n * @since 0.5\n */\n readonly streamKey?: string;\n }\n | {\n readonly kind: \"tick\";\n readonly bar: Bar;\n /**\n * Secondary-stream key. Omit for the main stream; set to a\n * requested interval value such as `\"1D\"` for MTF candles.\n *\n * @since 0.5\n */\n readonly streamKey?: string;\n };\n\n/**\n * Indicator plot styles Phase 1 ships. Re-exported from\n * `@invinite-org/chartlang-core` so the script-facing and adapter-facing\n * surfaces stay in lock-step — the full PLAN §7.2 set lands in Phase 2+,\n * additively, in the core declaration. Pinned set — additive only across\n * `apiVersion: 1.x`.\n *\n * @since 0.1\n * @stable\n * @example\n * const k: PlotKind = \"line\";\n */\nexport type PlotKind = CorePlotKind;\n\n/**\n * One plotted-slot descriptor in `ScriptManifest.plots`. Re-exported\n * from `@invinite-org/chartlang-core` so the script-facing and\n * adapter-facing surfaces stay in lockstep — adapter authors key\n * style/visibility UI rows by the stable `slotId`.\n *\n * @since 0.8\n * @stable\n * @example\n * const slot: PlotSlotDescriptor = {\n * slotId: \"ema.ts:12:5#0\",\n * kind: \"line\",\n * title: \"EMA\",\n * };\n * void slot;\n */\nexport type PlotSlotDescriptor = CorePlotSlotDescriptor;\n\n/**\n * Host-supplied presentation override for a single plot slot, keyed by\n * `PlotEmission.slotId`. Re-exported from `@invinite-org/chartlang-core`\n * so adapter authors and hosts share the same shape. Applied by the\n * runtime at emit time; never affects `compute`.\n *\n * @since 0.8\n * @stable\n * @example\n * const override: PlotOverride = { visible: false, color: \"#ff0000\" };\n * void override;\n */\nexport type PlotOverride = CorePlotOverride;\n\n/**\n * Drawing kind discriminator. Phase 3 widens the Phase-1 `\"line\"`\n * placeholder to the full 61-entry kebab-case union — re-exported from\n * `@invinite-org/chartlang-core`. The wire format is kebab-case; the\n * camelCase TypeScript surface (`draw.horizontalLine`,\n * `draw.fibRetracement`, …) is pinned via core's\n * `KIND_CAMELCASE` / `KIND_KEBABCASE` bijection. Phase-1 / Phase-2\n * adapter code that wrote `drawingKind: \"line\"` keeps compiling — the\n * widening is purely additive. Pinned set — additive only across\n * `apiVersion: 1.x`.\n *\n * @since 0.1\n * @stable\n * @example\n * const k: DrawingKind = \"fib-retracement\";\n * void k;\n */\nexport type DrawingKind = CoreDrawingKind;\n\n/**\n * Channels an alert emission can be dispatched on. Adapters declare the\n * subset they support via `Capabilities.alerts`; emissions to unsupported\n * channels drop with `unsupported-alert-channel`.\n *\n * @since 0.1\n * @stable\n * @example\n * const c: AlertChannel = \"toast\";\n */\nexport type AlertChannel = \"log\" | \"toast\" | \"webhook\" | \"email\" | \"sms\" | \"push\";\n\n/**\n * Input families an adapter is willing to surface in the script-settings\n * UI. Phase-1 example scripts use defaults only; `input.*` runtime\n * resolution lands in Phase 4.\n *\n * @since 0.1\n * @stable\n * @example\n * const k: InputKind = \"int\";\n */\nexport type InputKind = CoreInputKind;\n\n/**\n * `syminfo.*` fields the adapter populates. Phase-1 scripts don't read\n * symbol metadata; the type is here so consumer-repo adapters can pin\n * against a stable shape now.\n *\n * @since 0.1\n * @stable\n * @example\n * const f: SymInfoField = \"ticker\";\n */\nexport type SymInfoField =\n | \"ticker\"\n | \"type\"\n | \"mintick\"\n | \"currency\"\n | \"basecurrency\"\n | \"exchange\"\n | \"timezone\"\n | \"session\"\n | \"meta\";\n\n/**\n * Adapter-supplied per-mount symbol metadata payload consumed by the\n * runtime's `syminfo.*` view builder.\n *\n * @since 0.4\n * @stable\n * @example\n * const info: AdapterSymInfo = {\n * ticker: \"DEMO\",\n * type: \"equity\",\n * mintick: 0.01,\n * };\n * void info;\n */\nexport type AdapterSymInfo = Readonly<{\n ticker?: string;\n type?: SymbolType;\n mintick?: number;\n currency?: string;\n basecurrency?: string;\n exchange?: string;\n timezone?: string;\n session?: string;\n meta?: Readonly<Record<string, JsonValue>>;\n}>;\n\n/**\n * Per-script drawing-emission budget. Excess `draw.*` calls fall back to\n * no-op + `drawing-budget-exceeded`. Mirrors Pine's `max_*_count` family.\n *\n * Canonical declaration lives in `@invinite-org/chartlang-core/types`\n * (Phase 3) so `ScriptManifest.maxDrawings?` and\n * `Capabilities.maxDrawingsPerScript` pin the same shape — the public\n * surface here is preserved via a type re-export. The re-export\n * preserves the `adapter-kit → core` dependency direction.\n *\n * @since 0.1\n * @stable\n * @example\n * const c: DrawingCounts = {\n * lines: 50, labels: 50, boxes: 50, polylines: 50, other: 50,\n * };\n * void c;\n */\nexport type DrawingCounts = CoreDrawingCounts;\n\n/**\n * Capability bag an adapter declares. The runtime, host-worker, and\n * editor all gate emissions through this shape. Primitives outside the\n * declared set become silent no-ops + diagnostic (PLAN §7.4).\n * Capability keys are pinned — additive only across `apiVersion: 1.x`.\n *\n * Phase 1 omits `feedExternalSeries`-related `inputs` entries from any\n * declared subset; Phase 4 wires the surface.\n *\n * @since 0.1\n * @stable\n * @example\n * const c: Capabilities = {\n * plots: new Set([\"line\"]),\n * drawings: new Set(),\n * alerts: new Set([\"toast\"]),\n * alertConditions: false,\n * logs: false,\n * inputs: new Set(),\n * intervals: [],\n * multiTimeframe: false,\n * subPanes: 0,\n * symInfoFields: new Set(),\n * maxDrawingsPerScript: {\n * lines: 0, labels: 0, boxes: 0, polylines: 0, other: 0,\n * },\n * maxLookback: 5000,\n * maxTickHz: 10,\n * };\n */\nexport type Capabilities = {\n readonly plots: ReadonlySet<PlotKind>;\n readonly drawings: ReadonlySet<DrawingKind>;\n readonly alerts: ReadonlySet<AlertChannel>;\n /**\n * Whether the adapter can route `defineAlertCondition` user-wired\n * alerts per PLAN §11.2.\n *\n * @since 0.4\n * @stable\n * @example\n * const enabled: Capabilities[\"alertConditions\"] = false;\n * void enabled;\n */\n readonly alertConditions: boolean;\n /**\n * Whether the adapter renders `runtime.log.*` messages per PLAN §11.3.\n *\n * @since 0.4\n * @stable\n * @example\n * const enabled: Capabilities[\"logs\"] = false;\n * void enabled;\n */\n readonly logs: boolean;\n readonly inputs: ReadonlySet<InputKind>;\n /**\n * Timeframes this adapter can deliver candles for. Order is meaningful\n * for editor pickers and `request.security` validation (PLAN §4.5).\n *\n * @since 0.4\n * @stable\n * @example\n * const intervals: Capabilities[\"intervals\"] = [\n * { value: \"1D\", label: \"1 day\", group: \"daily\" },\n * ];\n * void intervals;\n */\n readonly intervals: ReadonlyArray<IntervalDescriptor>;\n /**\n * Whether the adapter can deliver more than one candle stream per script\n * load. `false` triggers the Phase 4 all-NaN fallback for\n * `request.security` (PLAN §4.5).\n *\n * @since 0.4\n * @stable\n * @example\n * const enabled: Capabilities[\"multiTimeframe\"] = false;\n * void enabled;\n */\n readonly multiTimeframe: boolean;\n /**\n * Max number of sub-panes the adapter can render for one script. Use\n * `Number.MAX_SAFE_INTEGER` as the unlimited sentinel per PLAN §7.2.\n *\n * @since 0.4\n * @stable\n * @example\n * const max: Capabilities[\"subPanes\"] = Number.MAX_SAFE_INTEGER;\n * void max;\n */\n readonly subPanes: number;\n /**\n * `syminfo.*` fields this adapter populates. Missing fields evaluate to\n * empty sentinels per PLAN §4.8.\n *\n * @since 0.4\n * @stable\n * @example\n * const fields: Capabilities[\"symInfoFields\"] = new Set([\"ticker\"]);\n * void fields;\n */\n readonly symInfoFields: ReadonlySet<SymInfoField>;\n /**\n * Per-script drawing-emission budget consumed by runtime drawing gates\n * and bucketed by PLAN §10 drawing categories.\n *\n * @since 0.4\n * @stable\n * @example\n * const counts: Capabilities[\"maxDrawingsPerScript\"] = {\n * lines: 50, labels: 50, boxes: 50, polylines: 50, other: 50,\n * };\n * void counts;\n */\n readonly maxDrawingsPerScript: DrawingCounts;\n readonly maxLookback: number;\n readonly maxTickHz: number;\n};\n\n/**\n * Plot style discriminated union. Phase 1 shipped `line` / `step-line` /\n * `horizontal-line`; Phase 2 adds `histogram` / `area` /\n * `filled-band` / `label` / `marker` per PLAN §7.3. Phase 5 will extend\n * further (`shape`, `character`, `arrow`, `vertical-line`,\n * `bar-override`, …). Every expansion is additive — `apiVersion: 1`\n * scripts stay valid.\n *\n * @since 0.1\n * @stable\n * @example\n * const line: PlotStyle = { kind: \"line\", lineWidth: 1, lineStyle: \"solid\" };\n * const hist: PlotStyle = { kind: \"histogram\", baseline: 0 };\n * const band: PlotStyle = { kind: \"filled-band\", upper: 1, lower: -1, alpha: 0.2 };\n * void line; void hist; void band;\n */\nexport type PlotStyle =\n | {\n readonly kind: \"line\";\n readonly lineWidth: number;\n readonly lineStyle: LineStyle;\n }\n | {\n readonly kind: \"step-line\";\n readonly lineWidth: number;\n readonly lineStyle: LineStyle;\n }\n | {\n readonly kind: \"horizontal-line\";\n readonly lineWidth: number;\n readonly lineStyle: LineStyle;\n }\n /** Phase 2 — column rising from `baseline` to `value`. @since 0.2 */\n | {\n readonly kind: \"histogram\";\n readonly baseline: number;\n }\n /** Phase 2 — filled polygon under a polyline. @since 0.2 */\n | {\n readonly kind: \"area\";\n readonly lineWidth: number;\n readonly lineStyle: LineStyle;\n readonly fillAlpha: number;\n }\n /** Phase 2 — region between two polylines. `upper` / `lower` may be\n * `null` to mark a per-bar gap; both `null` is rejected by\n * {@link validateEmission}. @since 0.2 */\n | {\n readonly kind: \"filled-band\";\n readonly upper: number | null;\n readonly lower: number | null;\n readonly alpha: number;\n }\n /** Phase 2 — text annotation anchored above / below / at the value.\n * @since 0.2 */\n | {\n readonly kind: \"label\";\n readonly text: string;\n readonly position: \"above\" | \"below\" | \"anchor\";\n }\n /** Phase 2 — discrete glyph at the value. @since 0.2 */\n | {\n readonly kind: \"marker\";\n readonly shape: \"circle\" | \"triangle-up\" | \"triangle-down\" | \"square\" | \"diamond\";\n readonly size: number;\n }\n /** Phase 5 — Pine `plotshape` glyph at the plot anchor. @since 0.5 */\n | {\n readonly kind: \"shape\";\n readonly shape:\n | \"circle\"\n | \"triangle-up\"\n | \"triangle-down\"\n | \"square\"\n | \"diamond\"\n | \"cross\"\n | \"xcross\"\n | \"flag\";\n readonly size: number;\n readonly location?: \"above\" | \"below\" | \"absolute\";\n }\n /** Phase 5 — Pine `plotchar` text glyph at the plot anchor. @since 0.5 */\n | {\n readonly kind: \"character\";\n readonly char: string;\n readonly size: number;\n readonly location?: \"above\" | \"below\" | \"absolute\";\n }\n /** Phase 5 — Pine `plotarrow` directional marker. @since 0.5 */\n | {\n readonly kind: \"arrow\";\n readonly direction: \"up\" | \"down\";\n readonly size: number;\n }\n /** Phase 5 — Pine `plotcandle` body-color override. @since 0.5 */\n | {\n readonly kind: \"candle-override\";\n readonly bull: Color;\n readonly bear: Color;\n readonly doji?: Color;\n }\n /** Phase 5 — Pine `plotbar` outline-color override. @since 0.5 */\n | {\n readonly kind: \"bar-override\";\n readonly color: Color;\n }\n /** Phase 5 — Pine `bgcolor` background band. @since 0.5 */\n | {\n readonly kind: \"bg-color\";\n readonly color: Color;\n readonly transp?: number;\n }\n /** Phase 5 — Pine `barcolor` candle/bar tint. @since 0.5 */\n | {\n readonly kind: \"bar-color\";\n readonly color: Color;\n }\n /** Phase 5 — volume-profile horizontal histogram buckets. @since 0.5 */\n | {\n readonly kind: \"horizontal-histogram\";\n readonly buckets: ReadonlyArray<\n Readonly<{ readonly price: number; readonly volume: number; readonly color?: Color }>\n >;\n };\n\n/**\n * A `plot()` / `hline()` emission the runtime sends to the adapter.\n * Numeric `value: null` is the wire-level \"skip this bar\" — NaN/Infinity\n * are forbidden in `value` and anywhere in `meta` (PLAN §7.3 universal\n * payload rules).\n *\n * @since 0.1\n * @stable\n * @example\n * const e: PlotEmission = {\n * kind: \"plot\",\n * slotId: \"ema-cross.ts:12:5#0\",\n * title: \"EMA\",\n * style: { kind: \"line\", lineWidth: 1, lineStyle: \"solid\" },\n * bar: 100,\n * time: 1_700_000_000_000,\n * value: 42.31,\n * color: \"#3b82f6\",\n * meta: {},\n * pane: \"overlay\",\n * };\n */\nexport type PlotEmission = {\n readonly kind: \"plot\";\n readonly slotId: string;\n readonly title: string;\n readonly style: PlotStyle;\n readonly bar: number;\n readonly time: number;\n readonly value: number | null;\n readonly color: string | null;\n readonly meta: Readonly<Record<string, JsonValue>>;\n readonly pane: \"overlay\" | \"new\" | string;\n /**\n * Omitted ⇒ visible. Set to `false` by the runtime when a host\n * override hides this slot; the adapter SHOULD skip rendering and\n * y-scale inclusion but keep the slot listed.\n *\n * @since 0.8\n * @stable\n * @example\n * const hidden: PlotEmission[\"visible\"] = false;\n * void hidden;\n */\n readonly visible?: boolean;\n};\n\n/**\n * An `alert()` emission. `dedupeKey` is computed by the runtime\n * (`slotId + bar + hash(message + meta)`) and adapters that dispatch\n * via async channels MUST use it for idempotency.\n *\n * @since 0.1\n * @stable\n * @example\n * const e: AlertEmission = {\n * kind: \"alert\",\n * slotId: \"rsi.ts:42:1#0\",\n * severity: \"warning\",\n * message: \"RSI divergence\",\n * bar: 200,\n * time: 1_700_000_000_000,\n * meta: {},\n * channels: [\"toast\"],\n * dedupeKey: \"rsi.ts:42:1#0|200|deadbeef\",\n * };\n */\nexport type AlertEmission = {\n readonly kind: \"alert\";\n readonly slotId: string;\n readonly severity: AlertSeverity;\n readonly message: string;\n readonly bar: number;\n readonly time: number;\n readonly meta: Readonly<Record<string, JsonValue>>;\n readonly channels: ReadonlyArray<AlertChannel>;\n readonly dedupeKey: string;\n};\n\n/**\n * Per-bar emission produced by `ComputeContext.signal(conditionId, fired)`.\n * Adapters route these named, user-wired conditions to delivery channels\n * configured in their own UI.\n *\n * @since 0.5\n * @stable\n * @example\n * const e: AlertConditionEmission = {\n * kind: \"alert-condition\",\n * conditionId: \"bullishCross\",\n * title: \"Bullish cross\",\n * description: \"Fast EMA crossed above slow EMA\",\n * defaultMessage: \"{{ticker}} crossed up\",\n * fired: true,\n * bar: 42,\n * time: 1_700_000_000_000,\n * };\n * void e;\n */\nexport type AlertConditionEmission = {\n readonly kind: \"alert-condition\";\n readonly conditionId: string;\n readonly title: string;\n readonly description: string;\n readonly defaultMessage: string;\n readonly fired: boolean;\n readonly bar: number;\n readonly time: number;\n};\n\n/**\n * Per-bar debug log produced by `runtime.log.info/warn/error(...)`.\n * Logs are capability-gated by `Capabilities.logs`; disabled logs are\n * silent no-ops because they are debugging output rather than signal.\n *\n * @since 0.5\n * @stable\n * @example\n * const e: LogEmission = {\n * kind: \"log\",\n * level: \"info\",\n * message: \"ema warmed\",\n * meta: { ema: 42 },\n * bar: 10,\n * time: 1_700_000_000_000,\n * };\n * void e;\n */\nexport type LogEmission = {\n readonly kind: \"log\";\n readonly level: LogLevel;\n readonly message: string;\n readonly meta?: Readonly<Record<string, JsonValue>>;\n readonly bar: number;\n readonly time: number;\n};\n\n/**\n * A `draw.*` emission. Phase 3 narrows `state` from `unknown` to the\n * typed {@link DrawingState} discriminated union. `op: \"create\"`\n * carries the initial state; `op: \"update\"` carries the FULL merged\n * state per the §10.3 full-state semantic (not a patch); `op:\n * \"remove\"` carries the last-known state.\n *\n * @since 0.1\n * @stable\n * @example\n * const e: DrawingEmission = {\n * kind: \"drawing\",\n * handleId: \"ph3.ts:1:1#0\",\n * drawingKind: \"line\",\n * op: \"create\",\n * state: {\n * kind: \"line\",\n * anchors: [{ time: 0, price: 0 }, { time: 1, price: 1 }],\n * style: {},\n * },\n * bar: 0,\n * time: 0,\n * };\n * void e;\n */\nexport type DrawingEmission = {\n readonly kind: \"drawing\";\n readonly handleId: string;\n readonly drawingKind: DrawingKind;\n readonly op: \"create\" | \"update\" | \"remove\";\n readonly state: DrawingState;\n readonly bar: number;\n readonly time: number;\n};\n\n/**\n * Stable machine-readable diagnostic code emitted by the runtime / host\n * when an emission is dropped, an input fails coercion, or a budget is\n * exceeded. Pinned set — additive only across `apiVersion: 1.x`.\n *\n * Phase 7 adds the `dep-*` family covering compile-time and runtime\n * failures of the indicator-composition surface introduced by\n * `CompiledScriptObject.output` / `.withInputs`:\n *\n * - `dep-error` — dependency `compute` threw; parent's bar dropped.\n * - `dep-cycle` — compile-time dependency cycle detected.\n * - `dep-unknown-output` — `<binding>.output(\"x\")` references a title\n * the producer doesn't emit via `plot(value, { title })`.\n * - `dep-invalid-input-override` — `.withInputs({...})` carries a key\n * not in the producer's `inputs` schema, or fails coercion.\n * - `dep-dynamic` — dep binding cannot be statically resolved\n * (non-`const`, conditional initialiser, computed access).\n * - `dep-output-not-titled` — producer's `plot(...)` has no `title`,\n * so consumers cannot reference it by name.\n *\n * @since 0.1\n * @stable\n * @example\n * const code: DiagnosticCode = \"unsupported-plot-kind\";\n * const dep: DiagnosticCode = \"dep-cycle\";\n * void code;\n * void dep;\n */\nexport type DiagnosticCode =\n | \"unsupported-plot-kind\"\n | \"unsupported-drawing-kind\"\n | \"unsupported-alert-channel\"\n | \"unsupported-pane\"\n | \"unsupported-interval\"\n | \"multi-timeframe-not-supported\"\n | \"unknown-secondary-stream\"\n | \"lookback-exceeded\"\n | \"drawing-budget-exceeded\"\n | \"dropped-by-policy\"\n | \"input-coercion-failed\"\n | \"alert-conditions-not-supported\"\n | \"unknown-alert-condition\"\n | \"alert-rate-limited\"\n | \"runtime-cpu-budget-exceeded\"\n | \"runtime-memory-budget-exceeded\"\n | \"runtime-log-budget-exceeded\"\n | \"malformed-log-meta\"\n | \"runtime-error-thrown\"\n | \"session-info-missing\"\n | \"fixed-range-inverted\"\n | \"state-snapshot-restored\"\n | \"state-snapshot-future-dated\"\n | \"state-snapshot-malformed\"\n | \"state-snapshot-save-failed\"\n | \"malformed-emission\"\n | \"dep-error\"\n | \"dep-cycle\"\n | \"dep-unknown-output\"\n | \"dep-invalid-input-override\"\n | \"dep-dynamic\"\n | \"dep-output-not-titled\";\n\n/**\n * A non-rendered diagnostic the runtime / host surfaces to the editor +\n * error reporters. Never user-visible on its own.\n *\n * @since 0.1\n * @stable\n * @example\n * const d: RuntimeDiagnostic = {\n * kind: \"diagnostic\",\n * severity: \"warning\",\n * code: \"unsupported-plot-kind\",\n * message: \"plot kind 'area' not in adapter capabilities\",\n * slotId: \"ema.ts:1:1#0\",\n * bar: 10,\n * };\n */\nexport type RuntimeDiagnostic = {\n readonly kind: \"diagnostic\";\n readonly severity: \"info\" | \"warning\" | \"error\";\n readonly code: DiagnosticCode;\n readonly message: string;\n readonly slotId: string | null;\n readonly bar: number | null;\n};\n\n/**\n * Top-level drain payload the runtime hands `Adapter.onEmissions(...)`.\n * Phase 1 ships `plots` / `drawings` / `alerts` / `diagnostics`; Phase 5\n * additively adds `alertConditions` + `logs` (per PLAN §7.3).\n *\n * @since 0.1\n * @stable\n * @example\n * const e: RunnerEmissions = {\n * plots: [],\n * drawings: [],\n * alerts: [],\n * alertConditions: [],\n * logs: [],\n * diagnostics: [],\n * fromBar: 0,\n * toBar: 0,\n * };\n */\nexport type RunnerEmissions = {\n readonly plots: ReadonlyArray<PlotEmission>;\n readonly drawings: ReadonlyArray<DrawingEmission>;\n readonly alerts: ReadonlyArray<AlertEmission>;\n readonly alertConditions: ReadonlyArray<AlertConditionEmission>;\n readonly logs: ReadonlyArray<LogEmission>;\n readonly diagnostics: ReadonlyArray<RuntimeDiagnostic>;\n readonly fromBar: number;\n readonly toBar: number;\n};\n\n/**\n * The host-side contract every chartlang adapter implements. Phase 1\n * omits PLAN §7.1's optional `feedExternalSeries?` — that surface\n * arrives in Phase 4 alongside `input.external-series`. The shape is\n * additive, so consumer-repo adapters won't need a breaking change to\n * opt in later.\n *\n * @since 0.1\n * @stable\n * @example\n * declare const a: Adapter;\n * for await (const e of a.candles({ interval: \"chart\" })) {\n * void e;\n * }\n */\nexport type Adapter = {\n readonly id: string;\n readonly name: string;\n readonly capabilities: Capabilities;\n /**\n * Optional per-script input override resolver. Called by hosts at script\n * mount with the script id/name and merged over manifest defaults by the\n * runtime.\n *\n * @since 0.4\n * @stable\n * @example\n * const resolveInputs: Adapter[\"resolveInputs\"] = (scriptId) => ({\n * length: scriptId === \"demo\" ? 20 : 14,\n * });\n * void resolveInputs;\n */\n readonly resolveInputs?: (scriptId: string) => Readonly<Record<string, unknown>>;\n /**\n * Optional per-script plot-override resolver. Called by hosts at\n * mount with the script id/name; returns a `slotId → PlotOverride`\n * map the runtime applies to emissions. Presentation-only — never\n * affects `compute`. Hosts may also push live updates after mount\n * (see `ScriptHost.setPlotOverrides`).\n *\n * @since 0.8\n * @stable\n * @example\n * const resolvePlotOverrides: Adapter[\"resolvePlotOverrides\"] =\n * () => ({ \"ema.ts:12:5#0\": { visible: false } });\n * void resolvePlotOverrides;\n */\n readonly resolvePlotOverrides?: (scriptId: string) => Readonly<Record<string, PlotOverride>>;\n /**\n * Optional per-mount symbol metadata payload used to populate\n * `syminfo.*`. Fields are still gated by `capabilities.symInfoFields`.\n *\n * @since 0.4\n * @stable\n * @example\n * const info: Adapter[\"symInfo\"] = { ticker: \"DEMO\" };\n * void info;\n */\n readonly symInfo?: AdapterSymInfo;\n candles(opts: { interval: string | \"chart\" }): AsyncIterable<CandleEvent>;\n onEmissions(emissions: RunnerEmissions): void;\n dispose(): void;\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.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 {\n AlertSeverity,\n Bar,\n Color,\n DrawingCounts as CoreDrawingCounts,\n DrawingKind as CoreDrawingKind,\n InputKind as CoreInputKind,\n PlotKind as CorePlotKind,\n PlotOverride as CorePlotOverride,\n PlotSlotDescriptor as CorePlotSlotDescriptor,\n DrawingState,\n IntervalDescriptor,\n JsonValue,\n LineStyle,\n LogLevel,\n SymbolType,\n} from \"@invinite-org/chartlang-core\";\n\n/**\n * Adapter-supplied candle event the runtime consumes through\n * `Adapter.candles(...)`. `history` is a batched warm-up payload; `close`\n * carries a finalised bar; `tick` carries an intra-bar update that the\n * runtime applies to the current bar's head slot.\n *\n * @since 0.1\n * @stable\n * @example\n * const evt: CandleEvent = { kind: \"history\", bars: [] };\n */\nexport type CandleEvent =\n | {\n readonly kind: \"history\";\n readonly bars: ReadonlyArray<Bar>;\n /**\n * Secondary-stream key. Omit for the main stream; set to a\n * requested interval value such as `\"1D\"` for MTF candles.\n *\n * @since 0.5\n */\n readonly streamKey?: string;\n }\n | {\n readonly kind: \"close\";\n readonly bar: Bar;\n /**\n * Secondary-stream key. Omit for the main stream; set to a\n * requested interval value such as `\"1D\"` for MTF candles.\n *\n * @since 0.5\n */\n readonly streamKey?: string;\n }\n | {\n readonly kind: \"tick\";\n readonly bar: Bar;\n /**\n * Secondary-stream key. Omit for the main stream; set to a\n * requested interval value such as `\"1D\"` for MTF candles.\n *\n * @since 0.5\n */\n readonly streamKey?: string;\n };\n\n/**\n * Indicator plot styles Phase 1 ships. Re-exported from\n * `@invinite-org/chartlang-core` so the script-facing and adapter-facing\n * surfaces stay in lock-step — the full PLAN §7.2 set lands in Phase 2+,\n * additively, in the core declaration. Pinned set — additive only across\n * `apiVersion: 1.x`.\n *\n * @since 0.1\n * @stable\n * @example\n * const k: PlotKind = \"line\";\n */\nexport type PlotKind = CorePlotKind;\n\n/**\n * One plotted-slot descriptor in `ScriptManifest.plots`. Re-exported\n * from `@invinite-org/chartlang-core` so the script-facing and\n * adapter-facing surfaces stay in lockstep — adapter authors key\n * style/visibility UI rows by the stable `slotId`.\n *\n * @since 0.8\n * @stable\n * @example\n * const slot: PlotSlotDescriptor = {\n * slotId: \"ema.ts:12:5#0\",\n * kind: \"line\",\n * title: \"EMA\",\n * };\n * void slot;\n */\nexport type PlotSlotDescriptor = CorePlotSlotDescriptor;\n\n/**\n * Host-supplied presentation override for a single plot slot, keyed by\n * `PlotEmission.slotId`. Re-exported from `@invinite-org/chartlang-core`\n * so adapter authors and hosts share the same shape. Applied by the\n * runtime at emit time; never affects `compute`.\n *\n * @since 0.8\n * @stable\n * @example\n * const override: PlotOverride = { visible: false, color: \"#ff0000\" };\n * void override;\n */\nexport type PlotOverride = CorePlotOverride;\n\n/**\n * Drawing kind discriminator. Phase 3 widens the Phase-1 `\"line\"`\n * placeholder to the full 61-entry kebab-case union — re-exported from\n * `@invinite-org/chartlang-core`. The wire format is kebab-case; the\n * camelCase TypeScript surface (`draw.horizontalLine`,\n * `draw.fibRetracement`, …) is pinned via core's\n * `KIND_CAMELCASE` / `KIND_KEBABCASE` bijection. Phase-1 / Phase-2\n * adapter code that wrote `drawingKind: \"line\"` keeps compiling — the\n * widening is purely additive. Pinned set — additive only across\n * `apiVersion: 1.x`.\n *\n * @since 0.1\n * @stable\n * @example\n * const k: DrawingKind = \"fib-retracement\";\n * void k;\n */\nexport type DrawingKind = CoreDrawingKind;\n\n/**\n * Channels an alert emission can be dispatched on. Adapters declare the\n * subset they support via `Capabilities.alerts`; emissions to unsupported\n * channels drop with `unsupported-alert-channel`.\n *\n * @since 0.1\n * @stable\n * @example\n * const c: AlertChannel = \"toast\";\n */\nexport type AlertChannel = \"log\" | \"toast\" | \"webhook\" | \"email\" | \"sms\" | \"push\";\n\n/**\n * Input families an adapter is willing to surface in the script-settings\n * UI. Phase-1 example scripts use defaults only; `input.*` runtime\n * resolution lands in Phase 4.\n *\n * @since 0.1\n * @stable\n * @example\n * const k: InputKind = \"int\";\n */\nexport type InputKind = CoreInputKind;\n\n/**\n * `syminfo.*` fields the adapter populates. Phase-1 scripts don't read\n * symbol metadata; the type is here so consumer-repo adapters can pin\n * against a stable shape now.\n *\n * @since 0.1\n * @stable\n * @example\n * const f: SymInfoField = \"ticker\";\n */\nexport type SymInfoField =\n | \"ticker\"\n | \"type\"\n | \"mintick\"\n | \"currency\"\n | \"basecurrency\"\n | \"exchange\"\n | \"timezone\"\n | \"session\"\n | \"meta\";\n\n/**\n * Adapter-supplied per-mount symbol metadata payload consumed by the\n * runtime's `syminfo.*` view builder.\n *\n * @since 0.4\n * @stable\n * @example\n * const info: AdapterSymInfo = {\n * ticker: \"DEMO\",\n * type: \"equity\",\n * mintick: 0.01,\n * };\n * void info;\n */\nexport type AdapterSymInfo = Readonly<{\n ticker?: string;\n type?: SymbolType;\n mintick?: number;\n currency?: string;\n basecurrency?: string;\n exchange?: string;\n timezone?: string;\n session?: string;\n meta?: Readonly<Record<string, JsonValue>>;\n}>;\n\n/**\n * Per-script drawing-emission budget. Excess `draw.*` calls fall back to\n * no-op + `drawing-budget-exceeded`. Mirrors Pine's `max_*_count` family.\n *\n * Canonical declaration lives in `@invinite-org/chartlang-core/types`\n * (Phase 3) so `ScriptManifest.maxDrawings?` and\n * `Capabilities.maxDrawingsPerScript` pin the same shape — the public\n * surface here is preserved via a type re-export. The re-export\n * preserves the `adapter-kit → core` dependency direction.\n *\n * @since 0.1\n * @stable\n * @example\n * const c: DrawingCounts = {\n * lines: 50, labels: 50, boxes: 50, polylines: 50, other: 50,\n * };\n * void c;\n */\nexport type DrawingCounts = CoreDrawingCounts;\n\n/**\n * Capability bag an adapter declares. The runtime, host-worker, and\n * editor all gate emissions through this shape. Primitives outside the\n * declared set become silent no-ops + diagnostic (PLAN §7.4).\n * Capability keys are pinned — additive only across `apiVersion: 1.x`.\n *\n * Phase 1 omits `feedExternalSeries`-related `inputs` entries from any\n * declared subset; Phase 4 wires the surface.\n *\n * @since 0.1\n * @stable\n * @example\n * const c: Capabilities = {\n * plots: new Set([\"line\"]),\n * drawings: new Set(),\n * alerts: new Set([\"toast\"]),\n * alertConditions: false,\n * logs: false,\n * inputs: new Set(),\n * intervals: [],\n * multiTimeframe: false,\n * subPanes: 0,\n * symInfoFields: new Set(),\n * maxDrawingsPerScript: {\n * lines: 0, labels: 0, boxes: 0, polylines: 0, other: 0,\n * },\n * maxLookback: 5000,\n * maxTickHz: 10,\n * };\n */\nexport type Capabilities = {\n readonly plots: ReadonlySet<PlotKind>;\n readonly drawings: ReadonlySet<DrawingKind>;\n readonly alerts: ReadonlySet<AlertChannel>;\n /**\n * Whether the adapter can route `defineAlertCondition` user-wired\n * alerts per PLAN §11.2.\n *\n * @since 0.4\n * @stable\n * @example\n * const enabled: Capabilities[\"alertConditions\"] = false;\n * void enabled;\n */\n readonly alertConditions: boolean;\n /**\n * Whether the adapter renders `runtime.log.*` messages per PLAN §11.3.\n *\n * @since 0.4\n * @stable\n * @example\n * const enabled: Capabilities[\"logs\"] = false;\n * void enabled;\n */\n readonly logs: boolean;\n readonly inputs: ReadonlySet<InputKind>;\n /**\n * Timeframes this adapter can deliver candles for. Order is meaningful\n * for editor pickers and `request.security` validation (PLAN §4.5).\n *\n * @since 0.4\n * @stable\n * @example\n * const intervals: Capabilities[\"intervals\"] = [\n * { value: \"1D\", label: \"1 day\", group: \"daily\" },\n * ];\n * void intervals;\n */\n readonly intervals: ReadonlyArray<IntervalDescriptor>;\n /**\n * Whether the adapter can deliver more than one candle stream per script\n * load. `false` triggers the Phase 4 all-NaN fallback for\n * `request.security` (PLAN §4.5).\n *\n * @since 0.4\n * @stable\n * @example\n * const enabled: Capabilities[\"multiTimeframe\"] = false;\n * void enabled;\n */\n readonly multiTimeframe: boolean;\n /**\n * Max number of sub-panes the adapter can render for one script. Use\n * `Number.MAX_SAFE_INTEGER` as the unlimited sentinel per PLAN §7.2.\n *\n * @since 0.4\n * @stable\n * @example\n * const max: Capabilities[\"subPanes\"] = Number.MAX_SAFE_INTEGER;\n * void max;\n */\n readonly subPanes: number;\n /**\n * `syminfo.*` fields this adapter populates. Missing fields evaluate to\n * empty sentinels per PLAN §4.8.\n *\n * @since 0.4\n * @stable\n * @example\n * const fields: Capabilities[\"symInfoFields\"] = new Set([\"ticker\"]);\n * void fields;\n */\n readonly symInfoFields: ReadonlySet<SymInfoField>;\n /**\n * Per-script drawing-emission budget consumed by runtime drawing gates\n * and bucketed by PLAN §10 drawing categories.\n *\n * @since 0.4\n * @stable\n * @example\n * const counts: Capabilities[\"maxDrawingsPerScript\"] = {\n * lines: 50, labels: 50, boxes: 50, polylines: 50, other: 50,\n * };\n * void counts;\n */\n readonly maxDrawingsPerScript: DrawingCounts;\n readonly maxLookback: number;\n readonly maxTickHz: number;\n};\n\n/**\n * Plot style discriminated union. Phase 1 shipped `line` / `step-line` /\n * `horizontal-line`; Phase 2 adds `histogram` / `area` /\n * `filled-band` / `label` / `marker` per PLAN §7.3. Phase 5 will extend\n * further (`shape`, `character`, `arrow`, `vertical-line`,\n * `bar-override`, …). Every expansion is additive — `apiVersion: 1`\n * scripts stay valid.\n *\n * @since 0.1\n * @stable\n * @example\n * const line: PlotStyle = { kind: \"line\", lineWidth: 1, lineStyle: \"solid\" };\n * const hist: PlotStyle = { kind: \"histogram\", baseline: 0 };\n * const band: PlotStyle = { kind: \"filled-band\", upper: 1, lower: -1, alpha: 0.2 };\n * void line; void hist; void band;\n */\nexport type PlotStyle =\n | {\n readonly kind: \"line\";\n readonly lineWidth: number;\n readonly lineStyle: LineStyle;\n }\n | {\n readonly kind: \"step-line\";\n readonly lineWidth: number;\n readonly lineStyle: LineStyle;\n }\n | {\n readonly kind: \"horizontal-line\";\n readonly lineWidth: number;\n readonly lineStyle: LineStyle;\n }\n /** Phase 2 — column rising from `baseline` to `value`. @since 0.2 */\n | {\n readonly kind: \"histogram\";\n readonly baseline: number;\n }\n /** Phase 2 — filled polygon under a polyline. @since 0.2 */\n | {\n readonly kind: \"area\";\n readonly lineWidth: number;\n readonly lineStyle: LineStyle;\n readonly fillAlpha: number;\n }\n /** Phase 2 — region between two polylines. `upper` / `lower` may be\n * `null` to mark a per-bar gap; both `null` is rejected by\n * {@link validateEmission}. @since 0.2 */\n | {\n readonly kind: \"filled-band\";\n readonly upper: number | null;\n readonly lower: number | null;\n readonly alpha: number;\n }\n /** Phase 2 — text annotation anchored above / below / at the value.\n * @since 0.2 */\n | {\n readonly kind: \"label\";\n readonly text: string;\n readonly position: \"above\" | \"below\" | \"anchor\";\n }\n /** Phase 2 — discrete glyph at the value. @since 0.2 */\n | {\n readonly kind: \"marker\";\n readonly shape: \"circle\" | \"triangle-up\" | \"triangle-down\" | \"square\" | \"diamond\";\n readonly size: number;\n }\n /** Phase 5 — Pine `plotshape` glyph at the plot anchor. @since 0.5 */\n | {\n readonly kind: \"shape\";\n readonly shape:\n | \"circle\"\n | \"triangle-up\"\n | \"triangle-down\"\n | \"square\"\n | \"diamond\"\n | \"cross\"\n | \"xcross\"\n | \"flag\";\n readonly size: number;\n readonly location?: \"above\" | \"below\" | \"absolute\";\n }\n /** Phase 5 — Pine `plotchar` text glyph at the plot anchor. @since 0.5 */\n | {\n readonly kind: \"character\";\n readonly char: string;\n readonly size: number;\n readonly location?: \"above\" | \"below\" | \"absolute\";\n }\n /** Phase 5 — Pine `plotarrow` directional marker. @since 0.5 */\n | {\n readonly kind: \"arrow\";\n readonly direction: \"up\" | \"down\";\n readonly size: number;\n }\n /** Phase 5 — Pine `plotcandle` body-color override. @since 0.5 */\n | {\n readonly kind: \"candle-override\";\n readonly bull: Color;\n readonly bear: Color;\n readonly doji?: Color;\n }\n /** Phase 5 — Pine `plotbar` outline-color override. @since 0.5 */\n | {\n readonly kind: \"bar-override\";\n readonly color: Color;\n }\n /** Phase 5 — Pine `bgcolor` background band. @since 0.5 */\n | {\n readonly kind: \"bg-color\";\n readonly color: Color;\n readonly transp?: number;\n }\n /** Phase 5 — Pine `barcolor` candle/bar tint. @since 0.5 */\n | {\n readonly kind: \"bar-color\";\n readonly color: Color;\n }\n /** Phase 5 — volume-profile horizontal histogram buckets. @since 0.5 */\n | {\n readonly kind: \"horizontal-histogram\";\n readonly buckets: ReadonlyArray<\n Readonly<{ readonly price: number; readonly volume: number; readonly color?: Color }>\n >;\n };\n\n/**\n * A `plot()` / `hline()` emission the runtime sends to the adapter.\n * Numeric `value: null` is the wire-level \"skip this bar\" — NaN/Infinity\n * are forbidden in `value` and anywhere in `meta` (PLAN §7.3 universal\n * payload rules).\n *\n * @since 0.1\n * @stable\n * @example\n * const e: PlotEmission = {\n * kind: \"plot\",\n * slotId: \"ema-cross.ts:12:5#0\",\n * title: \"EMA\",\n * style: { kind: \"line\", lineWidth: 1, lineStyle: \"solid\" },\n * bar: 100,\n * time: 1_700_000_000_000,\n * value: 42.31,\n * color: \"#3b82f6\",\n * meta: {},\n * pane: \"overlay\",\n * };\n */\nexport type PlotEmission = {\n readonly kind: \"plot\";\n readonly slotId: string;\n readonly title: string;\n readonly style: PlotStyle;\n readonly bar: number;\n readonly time: number;\n readonly value: number | null;\n readonly color: string | null;\n readonly meta: Readonly<Record<string, JsonValue>>;\n readonly pane: \"overlay\" | \"new\" | string;\n /**\n * Omitted ⇒ visible. Set to `false` by the runtime when a host\n * override hides this slot; the adapter SHOULD skip rendering and\n * y-scale inclusion but keep the slot listed.\n *\n * @since 0.8\n * @stable\n * @example\n * const hidden: PlotEmission[\"visible\"] = false;\n * void hidden;\n */\n readonly visible?: boolean;\n /**\n * Presentation-only horizontal display shift in **bars**. Omitted (or\n * `0`) ⇒ no shift, so a no-shift emission is byte-identical to a plot\n * that never carried the field. `+n` shifts the plotted series `n`\n * bars **right** (into the future); `−n` shifts it `n` bars **left**\n * (into the past). It moves only where the series renders — `value`\n * is the unshifted number and alert bars are unaffected. Must be a\n * signed integer; `validateEmission` rejects a non-integer.\n *\n * @since 1.3\n * @stable\n * @example\n * const shifted: PlotEmission[\"xShift\"] = -5;\n * void shifted;\n */\n readonly xShift?: number;\n /**\n * Presentation-only render-order key (z-index). Omitted (or `0`) ⇒ no\n * explicit order, so the emission is byte-identical to a plot that\n * never carried the field. Higher `z` renders on top; lower (incl.\n * negative) renders behind. Adapters MUST compute a stable global\n * order keyed on `(z ?? 0, groupBand, declarationSeq)` — a plot with\n * `z` below a drawing's `z` renders beneath that drawing, crossing the\n * default plots-under-drawings band. Any finite number (fractional\n * allowed); `validateEmission` rejects NaN / ±Infinity. Affects only\n * stacking — `value`, `xShift`, alerts, and `state.*` are unaffected.\n *\n * @since 1.4\n * @stable\n * @example\n * const behind: PlotEmission[\"z\"] = -1;\n * void behind;\n */\n readonly z?: number;\n};\n\n/**\n * An `alert()` emission. `dedupeKey` is computed by the runtime\n * (`slotId + bar + hash(message + meta)`) and adapters that dispatch\n * via async channels MUST use it for idempotency.\n *\n * @since 0.1\n * @stable\n * @example\n * const e: AlertEmission = {\n * kind: \"alert\",\n * slotId: \"rsi.ts:42:1#0\",\n * severity: \"warning\",\n * message: \"RSI divergence\",\n * bar: 200,\n * time: 1_700_000_000_000,\n * meta: {},\n * channels: [\"toast\"],\n * dedupeKey: \"rsi.ts:42:1#0|200|deadbeef\",\n * };\n */\nexport type AlertEmission = {\n readonly kind: \"alert\";\n readonly slotId: string;\n readonly severity: AlertSeverity;\n readonly message: string;\n readonly bar: number;\n readonly time: number;\n readonly meta: Readonly<Record<string, JsonValue>>;\n readonly channels: ReadonlyArray<AlertChannel>;\n readonly dedupeKey: string;\n};\n\n/**\n * Per-bar emission produced by `ComputeContext.signal(conditionId, fired)`.\n * Adapters route these named, user-wired conditions to delivery channels\n * configured in their own UI.\n *\n * @since 0.5\n * @stable\n * @example\n * const e: AlertConditionEmission = {\n * kind: \"alert-condition\",\n * conditionId: \"bullishCross\",\n * title: \"Bullish cross\",\n * description: \"Fast EMA crossed above slow EMA\",\n * defaultMessage: \"{{ticker}} crossed up\",\n * fired: true,\n * bar: 42,\n * time: 1_700_000_000_000,\n * };\n * void e;\n */\nexport type AlertConditionEmission = {\n readonly kind: \"alert-condition\";\n readonly conditionId: string;\n readonly title: string;\n readonly description: string;\n readonly defaultMessage: string;\n readonly fired: boolean;\n readonly bar: number;\n readonly time: number;\n};\n\n/**\n * Per-bar debug log produced by `runtime.log.info/warn/error(...)`.\n * Logs are capability-gated by `Capabilities.logs`; disabled logs are\n * silent no-ops because they are debugging output rather than signal.\n *\n * @since 0.5\n * @stable\n * @example\n * const e: LogEmission = {\n * kind: \"log\",\n * level: \"info\",\n * message: \"ema warmed\",\n * meta: { ema: 42 },\n * bar: 10,\n * time: 1_700_000_000_000,\n * };\n * void e;\n */\nexport type LogEmission = {\n readonly kind: \"log\";\n readonly level: LogLevel;\n readonly message: string;\n readonly meta?: Readonly<Record<string, JsonValue>>;\n readonly bar: number;\n readonly time: number;\n};\n\n/**\n * A `draw.*` emission. Phase 3 narrows `state` from `unknown` to the\n * typed {@link DrawingState} discriminated union. `op: \"create\"`\n * carries the initial state; `op: \"update\"` carries the FULL merged\n * state per the §10.3 full-state semantic (not a patch); `op:\n * \"remove\"` carries the last-known state.\n *\n * @since 0.1\n * @stable\n * @example\n * const e: DrawingEmission = {\n * kind: \"drawing\",\n * handleId: \"ph3.ts:1:1#0\",\n * drawingKind: \"line\",\n * op: \"create\",\n * state: {\n * kind: \"line\",\n * anchors: [{ time: 0, price: 0 }, { time: 1, price: 1 }],\n * style: {},\n * },\n * bar: 0,\n * time: 0,\n * };\n * void e;\n */\nexport type DrawingEmission = {\n readonly kind: \"drawing\";\n readonly handleId: string;\n readonly drawingKind: DrawingKind;\n readonly op: \"create\" | \"update\" | \"remove\";\n readonly state: DrawingState;\n readonly bar: number;\n readonly time: number;\n /**\n * Presentation-only render-order key (z-index). Omitted (or `0`) ⇒ no\n * explicit order, so the emission is byte-identical to a drawing that\n * never carried the field. Higher `z` renders on top; a **negative**\n * `z` lets a drawing render **below** `z=0` plots, crossing the\n * default plots-under-drawings band. Adapters MUST compute a stable\n * global order keyed on `(z ?? 0, groupBand, declarationSeq)`. Any\n * finite number (fractional allowed); `validateEmission` rejects\n * NaN / ±Infinity. Affects only stacking — `state.*` geometry is\n * unaffected. `z` is part of the latest state under the per-`(handleId,\n * bar)` last-write-wins dedup: a `create` then `update` that changes\n * `z` takes the updated value.\n *\n * @since 1.4\n * @stable\n * @example\n * const beneathPlots: DrawingEmission[\"z\"] = -1;\n * void beneathPlots;\n */\n readonly z?: number;\n};\n\n/**\n * Stable machine-readable diagnostic code emitted by the runtime / host\n * when an emission is dropped, an input fails coercion, or a budget is\n * exceeded. Pinned set — additive only across `apiVersion: 1.x`.\n *\n * Phase 7 adds the `dep-*` family covering compile-time and runtime\n * failures of the indicator-composition surface introduced by\n * `CompiledScriptObject.output` / `.withInputs`:\n *\n * - `dep-error` — dependency `compute` threw; parent's bar dropped.\n * - `dep-cycle` — compile-time dependency cycle detected.\n * - `dep-unknown-output` — `<binding>.output(\"x\")` references a title\n * the producer doesn't emit via `plot(value, { title })`.\n * - `dep-invalid-input-override` — `.withInputs({...})` carries a key\n * not in the producer's `inputs` schema, or fails coercion.\n * - `dep-dynamic` — dep binding cannot be statically resolved\n * (non-`const`, conditional initialiser, computed access).\n * - `dep-output-not-titled` — producer's `plot(...)` has no `title`,\n * so consumers cannot reference it by name.\n *\n * @since 0.1\n * @stable\n * @example\n * const code: DiagnosticCode = \"unsupported-plot-kind\";\n * const dep: DiagnosticCode = \"dep-cycle\";\n * void code;\n * void dep;\n */\nexport type DiagnosticCode =\n | \"unsupported-plot-kind\"\n | \"unsupported-drawing-kind\"\n | \"unsupported-alert-channel\"\n | \"unsupported-pane\"\n | \"unsupported-interval\"\n | \"multi-timeframe-not-supported\"\n | \"unknown-secondary-stream\"\n | \"lookback-exceeded\"\n | \"drawing-budget-exceeded\"\n | \"dropped-by-policy\"\n | \"input-coercion-failed\"\n | \"alert-conditions-not-supported\"\n | \"unknown-alert-condition\"\n | \"alert-rate-limited\"\n | \"runtime-cpu-budget-exceeded\"\n | \"runtime-memory-budget-exceeded\"\n | \"runtime-log-budget-exceeded\"\n | \"malformed-log-meta\"\n | \"runtime-error-thrown\"\n | \"session-info-missing\"\n | \"fixed-range-inverted\"\n | \"state-snapshot-restored\"\n | \"state-snapshot-future-dated\"\n | \"state-snapshot-malformed\"\n | \"state-snapshot-save-failed\"\n | \"malformed-emission\"\n | \"dep-error\"\n | \"dep-cycle\"\n | \"dep-unknown-output\"\n | \"dep-invalid-input-override\"\n | \"dep-dynamic\"\n | \"dep-output-not-titled\";\n\n/**\n * A non-rendered diagnostic the runtime / host surfaces to the editor +\n * error reporters. Never user-visible on its own.\n *\n * @since 0.1\n * @stable\n * @example\n * const d: RuntimeDiagnostic = {\n * kind: \"diagnostic\",\n * severity: \"warning\",\n * code: \"unsupported-plot-kind\",\n * message: \"plot kind 'area' not in adapter capabilities\",\n * slotId: \"ema.ts:1:1#0\",\n * bar: 10,\n * };\n */\nexport type RuntimeDiagnostic = {\n readonly kind: \"diagnostic\";\n readonly severity: \"info\" | \"warning\" | \"error\";\n readonly code: DiagnosticCode;\n readonly message: string;\n readonly slotId: string | null;\n readonly bar: number | null;\n};\n\n/**\n * Top-level drain payload the runtime hands `Adapter.onEmissions(...)`.\n * Phase 1 ships `plots` / `drawings` / `alerts` / `diagnostics`; Phase 5\n * additively adds `alertConditions` + `logs` (per PLAN §7.3).\n *\n * @since 0.1\n * @stable\n * @example\n * const e: RunnerEmissions = {\n * plots: [],\n * drawings: [],\n * alerts: [],\n * alertConditions: [],\n * logs: [],\n * diagnostics: [],\n * fromBar: 0,\n * toBar: 0,\n * };\n */\nexport type RunnerEmissions = {\n readonly plots: ReadonlyArray<PlotEmission>;\n readonly drawings: ReadonlyArray<DrawingEmission>;\n readonly alerts: ReadonlyArray<AlertEmission>;\n readonly alertConditions: ReadonlyArray<AlertConditionEmission>;\n readonly logs: ReadonlyArray<LogEmission>;\n readonly diagnostics: ReadonlyArray<RuntimeDiagnostic>;\n readonly fromBar: number;\n readonly toBar: number;\n};\n\n/**\n * The host-side contract every chartlang adapter implements. Phase 1\n * omits PLAN §7.1's optional `feedExternalSeries?` — that surface\n * arrives in Phase 4 alongside `input.external-series`. The shape is\n * additive, so consumer-repo adapters won't need a breaking change to\n * opt in later.\n *\n * @since 0.1\n * @stable\n * @example\n * declare const a: Adapter;\n * for await (const e of a.candles({ interval: \"chart\" })) {\n * void e;\n * }\n */\nexport type Adapter = {\n readonly id: string;\n readonly name: string;\n readonly capabilities: Capabilities;\n /**\n * Optional per-script input override resolver. Called by hosts at script\n * mount with the script id/name and merged over manifest defaults by the\n * runtime.\n *\n * @since 0.4\n * @stable\n * @example\n * const resolveInputs: Adapter[\"resolveInputs\"] = (scriptId) => ({\n * length: scriptId === \"demo\" ? 20 : 14,\n * });\n * void resolveInputs;\n */\n readonly resolveInputs?: (scriptId: string) => Readonly<Record<string, unknown>>;\n /**\n * Optional per-script plot-override resolver. Called by hosts at\n * mount with the script id/name; returns a `slotId → PlotOverride`\n * map the runtime applies to emissions. Presentation-only — never\n * affects `compute`. Hosts may also push live updates after mount\n * (see `ScriptHost.setPlotOverrides`).\n *\n * @since 0.8\n * @stable\n * @example\n * const resolvePlotOverrides: Adapter[\"resolvePlotOverrides\"] =\n * () => ({ \"ema.ts:12:5#0\": { visible: false } });\n * void resolvePlotOverrides;\n */\n readonly resolvePlotOverrides?: (scriptId: string) => Readonly<Record<string, PlotOverride>>;\n /**\n * Optional per-mount symbol metadata payload used to populate\n * `syminfo.*`. Fields are still gated by `capabilities.symInfoFields`.\n *\n * @since 0.4\n * @stable\n * @example\n * const info: Adapter[\"symInfo\"] = { ticker: \"DEMO\" };\n * void info;\n */\n readonly symInfo?: AdapterSymInfo;\n candles(opts: { interval: string | \"chart\" }): AsyncIterable<CandleEvent>;\n onEmissions(emissions: RunnerEmissions): void;\n dispose(): void;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"validateEmission.d.ts","sourceRoot":"","sources":["../../src/validation/validateEmission.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAA;CAAE,CAAC;AAEjD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,cAAc,GAAG;IACzB,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,cAAc,CAAC;AA09C7D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAwB7D"}
1
+ {"version":3,"file":"validateEmission.d.ts","sourceRoot":"","sources":["../../src/validation/validateEmission.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAA;CAAE,CAAC;AAEjD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,cAAc,GAAG;IACzB,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,cAAc,CAAC;AAqhD7D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAwB7D"}
@@ -403,6 +403,12 @@ function validatePlotEmission(e) {
403
403
  if (e.visible !== undefined && typeof e.visible !== "boolean") {
404
404
  return bad("plot.visible: must be a boolean");
405
405
  }
406
+ if (e.xShift !== undefined && !Number.isInteger(e.xShift)) {
407
+ return bad("plot.xShift: must be an integer");
408
+ }
409
+ if (e.z !== undefined && !isFiniteNumber(e.z)) {
410
+ return bad("plot.z: must be a finite number");
411
+ }
406
412
  return { ok: true };
407
413
  }
408
414
  function validateAlertEmission(e) {
@@ -681,6 +687,42 @@ function validatePathState(state) {
681
687
  return anchorsCheck;
682
688
  return validatePathOpts(state.style, "drawing.state.style");
683
689
  }
690
+ function validateFillBetweenStyle(s, path) {
691
+ // `color` / `lineWidth` / `lineStyle` share the LineDrawStyle contract;
692
+ // delegate so the shared checks cannot drift (same pattern as
693
+ // `validatePathOpts`). FillBetweenStyle has no `extendLeft` / `extendRight`
694
+ // fields, so those LineDrawStyle checks pass vacuously.
695
+ const lineCheck = validateLineDrawStyle(s, path);
696
+ if (!lineCheck.ok)
697
+ return lineCheck;
698
+ // validateLineDrawStyle proved `s` is a plain object.
699
+ const obj = s;
700
+ if (obj.fill !== undefined && typeof obj.fill !== "string") {
701
+ return bad(`${path}.fill: must be a string`);
702
+ }
703
+ if (obj.fillAlpha !== undefined &&
704
+ (!isFiniteNumber(obj.fillAlpha) || obj.fillAlpha < 0 || obj.fillAlpha > 1)) {
705
+ return bad(`${path}.fillAlpha: must be a finite number in [0, 1]`);
706
+ }
707
+ return { ok: true };
708
+ }
709
+ // A fill-between band is a series-growth primitive: the canonical idiom
710
+ // accumulates one `WorldPoint` per bar into each edge and re-emits the whole
711
+ // ribbon every step (see `examples/scripts/fill-between-band.chart.ts`), unlike
712
+ // the discrete `path` / `polyline` tools that cap at 20. The upper bound here
713
+ // must therefore cover a full chart history — sized to the 10 000-bar bundled
714
+ // golden fixture so a band spanning the entire dataset is not silently dropped.
715
+ const FILL_BETWEEN_MIN_ANCHORS = 2;
716
+ const FILL_BETWEEN_MAX_ANCHORS = 10_000;
717
+ function validateFillBetweenState(state) {
718
+ const edgeACheck = validateAnchorVariable(state.edgeA, "drawing.state.edgeA", FILL_BETWEEN_MIN_ANCHORS, FILL_BETWEEN_MAX_ANCHORS);
719
+ if (!edgeACheck.ok)
720
+ return edgeACheck;
721
+ const edgeBCheck = validateAnchorVariable(state.edgeB, "drawing.state.edgeB", FILL_BETWEEN_MIN_ANCHORS, FILL_BETWEEN_MAX_ANCHORS);
722
+ if (!edgeBCheck.ok)
723
+ return edgeBCheck;
724
+ return validateFillBetweenStyle(state.style, "drawing.state.style");
725
+ }
684
726
  const VALID_TEXT_SIZES = new Set(["tiny", "small", "normal", "large", "huge"]);
685
727
  const VALID_TEXT_HALIGN = new Set(["left", "center", "right"]);
686
728
  const VALID_TEXT_VALIGN = new Set(["top", "middle", "bottom"]);
@@ -1283,6 +1325,8 @@ function validateStateByKind(kind, state) {
1283
1325
  return validateEllipseState(state);
1284
1326
  case "path":
1285
1327
  return validatePathState(state);
1328
+ case "fill-between":
1329
+ return validateFillBetweenState(state);
1286
1330
  case "marker":
1287
1331
  return validateMarkerState(state);
1288
1332
  case "arc":
@@ -1411,6 +1455,9 @@ function validateDrawingEmission(e) {
1411
1455
  if (state.kind !== drawingKind) {
1412
1456
  return bad(`drawing.state.kind: '${String(state.kind)}' must equal drawing.drawingKind '${drawingKind}'`);
1413
1457
  }
1458
+ if (e.z !== undefined && !isFiniteNumber(e.z)) {
1459
+ return bad("drawing.z: must be a finite number");
1460
+ }
1414
1461
  const metaCheck = validateDrawingMeta(state);
1415
1462
  if (!metaCheck.ok)
1416
1463
  return metaCheck;