@invinite-org/chartlang-core 1.0.1 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/README.md +6 -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.d.ts.map +1 -1
  11. package/dist/define/defineAlert.js +3 -2
  12. package/dist/define/defineAlert.js.map +1 -1
  13. package/dist/define/defineAlertCondition.d.ts.map +1 -1
  14. package/dist/define/defineAlertCondition.js +2 -1
  15. package/dist/define/defineAlertCondition.js.map +1 -1
  16. package/dist/define/defineDrawing.d.ts +2 -2
  17. package/dist/define/defineDrawing.d.ts.map +1 -1
  18. package/dist/define/defineDrawing.js +5 -4
  19. package/dist/define/defineDrawing.js.map +1 -1
  20. package/dist/define/defineIndicator.d.ts +11 -0
  21. package/dist/define/defineIndicator.d.ts.map +1 -1
  22. package/dist/define/defineIndicator.js +5 -2
  23. package/dist/define/defineIndicator.js.map +1 -1
  24. package/dist/define/depAccessorSentinel.d.ts +46 -0
  25. package/dist/define/depAccessorSentinel.d.ts.map +1 -0
  26. package/dist/define/depAccessorSentinel.js +51 -0
  27. package/dist/define/depAccessorSentinel.js.map +1 -0
  28. package/dist/define/dependency.d.ts +63 -0
  29. package/dist/define/dependency.d.ts.map +1 -0
  30. package/dist/define/dependency.js +4 -0
  31. package/dist/define/dependency.js.map +1 -0
  32. package/dist/define/index.d.ts +1 -0
  33. package/dist/define/index.d.ts.map +1 -1
  34. package/dist/define/index.js.map +1 -1
  35. package/dist/define/overrides.js.map +1 -1
  36. package/dist/draw/buckets.js.map +1 -1
  37. package/dist/draw/draw.d.ts +2 -3
  38. package/dist/draw/draw.d.ts.map +1 -1
  39. package/dist/draw/draw.js +1 -2
  40. package/dist/draw/draw.js.map +1 -1
  41. package/dist/draw/drawingKind.d.ts +1 -1
  42. package/dist/draw/drawingKind.js.map +1 -1
  43. package/dist/draw/drawingState.d.ts +5 -5
  44. package/dist/draw/drawingState.js.map +1 -1
  45. package/dist/draw/drawingStyle.d.ts +1 -1
  46. package/dist/draw/drawingStyle.js.map +1 -1
  47. package/dist/draw/handle.js.map +1 -1
  48. package/dist/draw/index.js.map +1 -1
  49. package/dist/draw/table.d.ts +1 -1
  50. package/dist/draw/table.js.map +1 -1
  51. package/dist/draw/worldPoint.js.map +1 -1
  52. package/dist/index.d.ts +4 -3
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +1 -0
  55. package/dist/index.js.map +1 -1
  56. package/dist/input/index.js.map +1 -1
  57. package/dist/input/input.js.map +1 -1
  58. package/dist/input/inputDescriptor.js.map +1 -1
  59. package/dist/interval/intervalToSeconds.js.map +1 -1
  60. package/dist/plot/index.js.map +1 -1
  61. package/dist/plot/plot.d.ts +25 -7
  62. package/dist/plot/plot.d.ts.map +1 -1
  63. package/dist/plot/plot.js +1 -1
  64. package/dist/plot/plot.js.map +1 -1
  65. package/dist/request/index.js.map +1 -1
  66. package/dist/request/request.js.map +1 -1
  67. package/dist/runtime/index.js.map +1 -1
  68. package/dist/runtime/runtime.js.map +1 -1
  69. package/dist/state/index.d.ts +1 -1
  70. package/dist/state/index.d.ts.map +1 -1
  71. package/dist/state/index.js.map +1 -1
  72. package/dist/state/mutableSlot.js.map +1 -1
  73. package/dist/state/snapshot.d.ts +39 -12
  74. package/dist/state/snapshot.d.ts.map +1 -1
  75. package/dist/state/snapshot.js.map +1 -1
  76. package/dist/state/state.js.map +1 -1
  77. package/dist/statefulPrimitives.d.ts +1 -1
  78. package/dist/statefulPrimitives.js +1 -1
  79. package/dist/statefulPrimitives.js.map +1 -1
  80. package/dist/ta/index.js.map +1 -1
  81. package/dist/ta/ta.d.ts +41 -41
  82. package/dist/ta/ta.js.map +1 -1
  83. package/dist/time/_lib/dateTimeFormatCache.js.map +1 -1
  84. package/dist/time/index.js.map +1 -1
  85. package/dist/time/nyDayKey.js +2 -2
  86. package/dist/time/nyDayKey.js.map +1 -1
  87. package/dist/time/session.js.map +1 -1
  88. package/dist/time/sessionBoundaries.js +2 -2
  89. package/dist/time/sessionBoundaries.js.map +1 -1
  90. package/dist/time/types.js.map +1 -1
  91. package/dist/time/weekKey.js.map +1 -1
  92. package/dist/time/weekday.js.map +1 -1
  93. package/dist/types.d.ts +246 -1
  94. package/dist/types.d.ts.map +1 -1
  95. package/dist/types.js +17 -1
  96. package/dist/types.js.map +1 -1
  97. package/dist/views/barstate.js.map +1 -1
  98. package/dist/views/index.js.map +1 -1
  99. package/dist/views/syminfo.js.map +1 -1
  100. package/dist/views/timeframe.js.map +1 -1
  101. package/package.json +1 -1
@@ -0,0 +1,63 @@
1
+ import type { JsonValue } from "../types.js";
2
+ /**
3
+ * One titled output a script exposes for consumption by other
4
+ * indicators. Derived from the producer's `plot(value, { title })`
5
+ * calls during compile. `title` is the key consumers reference via
6
+ * `<binding>.output("title")`.
7
+ *
8
+ * @since 0.7
9
+ * @stable
10
+ * @example
11
+ * const out: OutputDeclaration = {
12
+ * title: "line",
13
+ * kind: "series-number",
14
+ * };
15
+ * void out;
16
+ */
17
+ export type OutputDeclaration = Readonly<{
18
+ readonly title: string;
19
+ readonly kind: "series-number";
20
+ }>;
21
+ /**
22
+ * One node in a script's compiled dependency graph. Emitted by the
23
+ * compiler's `extractDependencyGraph` pass (Task 2) and consumed by
24
+ * the runtime's dep executor (Task 4).
25
+ *
26
+ * `localId` is the JavaScript binding name the consumer used —
27
+ * `const trend = baseTrend.withInputs(...)` produces
28
+ * `localId: "trend"`. Stable across script edits as long as the
29
+ * binding name is stable.
30
+ *
31
+ * `producerSourcePath` is the POSIX path the compiler resolved for
32
+ * the producer. Same-file deps use the consumer's `sourcePath`.
33
+ *
34
+ * `effectiveInputs` is the merge of producer defaults + every
35
+ * `.withInputs(...)` chained on the binding, JSON-serialised.
36
+ *
37
+ * `outputs` mirrors the producer's `ScriptManifest.outputs` so the
38
+ * runtime can validate consumer `.output("...")` calls at mount time.
39
+ *
40
+ * @since 0.7
41
+ * @stable
42
+ * @example
43
+ * const dep: DependencyDeclaration = {
44
+ * localId: "fastTrend",
45
+ * producerName: "Base Trend",
46
+ * producerSourcePath: "trend-confirmation.chart.ts",
47
+ * producerExportName: "default",
48
+ * effectiveInputs: { length: 20 },
49
+ * outputs: [{ title: "line", kind: "series-number" }],
50
+ * isDrawn: false,
51
+ * };
52
+ * void dep;
53
+ */
54
+ export type DependencyDeclaration = Readonly<{
55
+ readonly localId: string;
56
+ readonly producerName: string;
57
+ readonly producerSourcePath: string;
58
+ readonly producerExportName: string;
59
+ readonly effectiveInputs: Readonly<Record<string, JsonValue>>;
60
+ readonly outputs: ReadonlyArray<OutputDeclaration>;
61
+ readonly isDrawn: boolean;
62
+ }>;
63
+ //# sourceMappingURL=dependency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependency.d.ts","sourceRoot":"","sources":["../../src/define/dependency.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;CAClC,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;IAC9D,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IACnD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC7B,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) 2026 Invinite. Licensed under the MIT License.
2
+ // See the LICENSE file in the repo root for full license text.
3
+ export {};
4
+ //# sourceMappingURL=dependency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependency.js","sourceRoot":"","sources":["../../src/define/dependency.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 * One titled output a script exposes for consumption by other\n * indicators. Derived from the producer's `plot(value, { title })`\n * calls during compile. `title` is the key consumers reference via\n * `<binding>.output(\"title\")`.\n *\n * @since 0.7\n * @stable\n * @example\n * const out: OutputDeclaration = {\n * title: \"line\",\n * kind: \"series-number\",\n * };\n * void out;\n */\nexport type OutputDeclaration = Readonly<{\n readonly title: string;\n readonly kind: \"series-number\";\n}>;\n\n/**\n * One node in a script's compiled dependency graph. Emitted by the\n * compiler's `extractDependencyGraph` pass (Task 2) and consumed by\n * the runtime's dep executor (Task 4).\n *\n * `localId` is the JavaScript binding name the consumer used —\n * `const trend = baseTrend.withInputs(...)` produces\n * `localId: \"trend\"`. Stable across script edits as long as the\n * binding name is stable.\n *\n * `producerSourcePath` is the POSIX path the compiler resolved for\n * the producer. Same-file deps use the consumer's `sourcePath`.\n *\n * `effectiveInputs` is the merge of producer defaults + every\n * `.withInputs(...)` chained on the binding, JSON-serialised.\n *\n * `outputs` mirrors the producer's `ScriptManifest.outputs` so the\n * runtime can validate consumer `.output(\"...\")` calls at mount time.\n *\n * @since 0.7\n * @stable\n * @example\n * const dep: DependencyDeclaration = {\n * localId: \"fastTrend\",\n * producerName: \"Base Trend\",\n * producerSourcePath: \"trend-confirmation.chart.ts\",\n * producerExportName: \"default\",\n * effectiveInputs: { length: 20 },\n * outputs: [{ title: \"line\", kind: \"series-number\" }],\n * isDrawn: false,\n * };\n * void dep;\n */\nexport type DependencyDeclaration = Readonly<{\n readonly localId: string;\n readonly producerName: string;\n readonly producerSourcePath: string;\n readonly producerExportName: string;\n readonly effectiveInputs: Readonly<Record<string, JsonValue>>;\n readonly outputs: ReadonlyArray<OutputDeclaration>;\n readonly isDrawn: boolean;\n}>;\n"]}
@@ -2,5 +2,6 @@ export * from "./defineIndicator.js";
2
2
  export * from "./defineAlert.js";
3
3
  export * from "./defineAlertCondition.js";
4
4
  export * from "./defineDrawing.js";
5
+ export type { DependencyDeclaration, OutputDeclaration } from "./dependency.js";
5
6
  export type { ScaleAxis, ScriptOverrides, ValueFormat } from "./overrides.js";
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/define/index.ts"],"names":[],"mappings":"AAGA,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/define/index.ts"],"names":[],"mappings":"AAGA,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,YAAY,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAChF,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/define/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/define/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,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 \"./defineIndicator.js\";\nexport * from \"./defineAlert.js\";\nexport * from \"./defineAlertCondition.js\";\nexport * from \"./defineDrawing.js\";\nexport type { DependencyDeclaration, OutputDeclaration } from \"./dependency.js\";\nexport type { ScaleAxis, ScriptOverrides, ValueFormat } from \"./overrides.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"overrides.js","sourceRoot":"","sources":["../../src/define/overrides.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D"}
1
+ {"version":3,"file":"overrides.js","sourceRoot":"","sources":["../../src/define/overrides.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 * Value-format hint the adapter uses for axis-label rendering. PLAN §4.1.\n * `\"price\"` formats with the symbol's quote-currency rules; `\"volume\"` uses\n * K/M/B compact notation; `\"percent\"` appends `%`; `\"compact\"` falls back to\n * K/M/B for generic non-volume values.\n *\n * @since 0.4\n * @stable\n * @example\n * const f: ValueFormat = \"percent\";\n * void f;\n */\nexport type ValueFormat = \"price\" | \"volume\" | \"percent\" | \"compact\";\n\n/**\n * Scale axis the indicator should bind to. PLAN §4.1.\n *\n * - `\"price\"` — overlay on the main price pane.\n * - `\"left\"` / `\"right\"` — sub-pane axis side.\n * - `\"new\"` — request a fresh sub-pane keyed by the script id.\n *\n * @since 0.4\n * @stable\n * @example\n * const s: ScaleAxis = \"right\";\n * void s;\n */\nexport type ScaleAxis = \"price\" | \"left\" | \"right\" | \"new\";\n\n/**\n * Author-supplied display + budget overrides. Every field is optional;\n * missing fields fall back to adapter defaults.\n *\n * @since 0.4\n * @stable\n * @example\n * const o: ScriptOverrides = {\n * shortName: \"EMA(20)\",\n * precision: 4,\n * format: \"price\",\n * };\n * void o;\n */\nexport type ScriptOverrides = Readonly<{\n /**\n * Max bars of historical lookback the script needs. `0` keeps the\n * runtime default. Pine `max_bars_back` parity.\n *\n * @since 0.4\n * @example\n * const v: ScriptOverrides[\"maxBarsBack\"] = 100;\n * void v;\n */\n maxBarsBack?: number;\n /**\n * Value-formatting hint for axis labels + cursor read-out.\n *\n * @since 0.4\n * @example\n * const v: ScriptOverrides[\"format\"] = \"price\";\n * void v;\n */\n format?: ValueFormat;\n /**\n * Decimal precision the adapter renders the indicator at. `0`-`10`;\n * `undefined` follows the symbol's default precision.\n *\n * @since 0.4\n * @example\n * const v: ScriptOverrides[\"precision\"] = 2;\n * void v;\n */\n precision?: number;\n /**\n * Scale-axis binding. Defaults to `\"price\"` for overlay indicators and\n * `\"right\"` for sub-pane indicators.\n *\n * @since 0.4\n * @example\n * const v: ScriptOverrides[\"scale\"] = \"right\";\n * void v;\n */\n scale?: ScaleAxis;\n /**\n * Intervals the script requires the adapter to ship in\n * `Capabilities.intervals`.\n *\n * @since 0.4\n * @example\n * const v: ScriptOverrides[\"requiresIntervals\"] = [\"1D\"];\n * void v;\n */\n requiresIntervals?: ReadonlyArray<string>;\n /**\n * Compact display label for legend chips. Defaults to truncated `name`.\n *\n * @since 0.4\n * @example\n * const v: ScriptOverrides[\"shortName\"] = \"EM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AW,CAAC;IACjC,CAAC,sBAAsB,EAAE,WAAW,CAAC;IACrC,CAAC,sBAAsB,EAAE,WAAW,CAAC;IACrC,CAAC,yBAAyB,EAAE,WAAW,CAAC;IACxC,CAAC,uBAAuB,EAAE,WAAW,CAAC;IACtC,CAAC,sBAAsB,EAAE,WAAW,CAAC;IACrC,CAAC,sBAAsB,EAAE,WAAW,CAAC;IACrC,CAAC,cAAc,EAAE,OAAO,CAAC;IACzB,CAAC,aAAa,EAAE,OAAO,CAAC;IACxB,CAAC,WAAW,EAAE,OAAO,CAAC;IACtB,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,OAAO,EAAE,OAAO,CAAC;CACrB,CAAC,CAAC;AAEH;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,SAAS,CAAC,IAAiB;IACvC,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,wCAAwC,IAAI,GAAG,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,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 { DrawingKind } from \"./drawingKind.js\";\n\n/**\n * Canonical bucket name a {@link DrawingKind} maps to under the\n * `DrawingCounts` 5-bag budget (`{ lines, labels, boxes, polylines,\n * other }`). The adapter-kit `Capabilities.maxDrawingsPerScript` and\n * the script-side `ScriptManifest.maxDrawings?` both pin the same five\n * bucket names. The runtime budget enforcer counts emissions per\n * bucket and drops the overflow with `drawing-budget-exceeded`.\n *\n * @formula bucket = KIND_BUCKET.get(kind)\n * @anchors kind: DrawingKind → bucket: \"lines\"|\"labels\"|\"boxes\"|\"polylines\"|\"other\"\n * @since 0.3\n * @stable\n * @example\n * const b: DrawingBucket = \"lines\";\n * void b;\n */\nexport type DrawingBucket = \"lines\" | \"labels\" | \"boxes\" | \"polylines\" | \"other\";\n\n/**\n * Per-kind bucket assignment. Pinned table; every entry of\n * {@link DrawingKind} appears exactly once (asserted by\n * `buckets.test.ts`).\n *\n * Mapping rationale (Phase-3 task README §\"Architecture Decisions\"):\n * lines/rays/horizontalLine/verticalLine/crossLine/trendAngle → `lines`;\n * rectangle/rotatedRectangle/triangle/circle/ellipse → `boxes`;\n * path/polyline/curves/freehand/channels/pitchforks/patterns/elliott →\n * `polylines`; text/arrow/arrowMarker/arrowMarkUp/arrowMarkDown +\n * marker → `labels`; fib / gann / cycles / containers / table → `other`.\n *\n * @formula bucket = KIND_BUCKET.get(kind)\n * @anchors kind: DrawingKind → bucket: \"lines\"|\"labels\"|\"boxes\"|\"polylines\"|\"other\"\n * @since 0.3\n * @stable\n * @example\n * import { KIND_BUCKET } from \"@invinite-org/chartlang-core\";\n * const b = KIND_BUCKET.get(\"fib-retracement\"); // \"other\"\n * void b;\n */\nexport const KIND_BUCKET: ReadonlyMap<DrawingKind, DrawingBucket> = new Map<\n DrawingKind,\n DrawingBucket\n>([\n [\"line\", \"lines\"],\n [\"horizontal-line\", \"lines\"],\n [\"horizontal-ray\", \"lines\"],\n [\"vertical-line\", \"lines\"],\n [\"cross-line\", \"lines\"],\n [\"trend-angle\", \"lines\"],\n [\"rectangle\", \"boxes\"],\n [\"rotated-rectangle\", \"boxes\"],\n [\"triangle\", \"boxes\"],\n [\"polyline\", \"polylines\"],\n [\"circle\", \"boxes\"],\n [\"ellipse\", \"boxes\"],\n [\"path\", \"polylines\"],\n [\"marker\", \"labels\"],\n [\"arc\", \"polylines\"],\n [\"curve\", \"polylines\"],\n [\"double-curve\", \"polylines\"],\n [\"pen\", \"polylines\"],\n [\"highlighter\", \"polylines\"],\n [\"brush\", \"polylines\"],\n [\"text\", \"labels\"],\n [\"arrow\", \"labels\"],\n [\"arrow-marker\", \"labels\"],\n [\"arrow-mark-up\", \"labels\"],\n [\"arrow-mark-down\", \"labels\"],\n [\"trend-channel\", \"polylines\"],\n [\"flat-top-bottom\", \"polylines\"],\n [\"disjoint-channel\", \"polylines\"],\n [\"regression-trend\", \"polylines\"],\n [\"fib-retracement\", \"other\"],\n [\"fib-trend-extension\", \"other\"],\n [\"fib-channel\", \"other\"],\n [\"fib-time-zone\", \"other\"],\n [\"fib-wedge\", \"other\"],\n [\"fib-speed-fan\", \"other\"],\n [\"fib-speed-arcs\", \"other\"],\n [\"fib-spiral\", \"other\"],\n [\"fib-circles\", \"other\"],\n [\"fib-trend-time\", \"other\"],\n [\"gann-box\", \"other\"],\n [\"gann-square-fixed\", \"other\"],\n [\"gann-square\", \"other\"],\n [\"gann-fan\", \"other\"],\n [\"pitchfork\", \"polylines\"],\n [\"pitchfan\", \"polylines\"],\n [\"xabcd-pattern\", \"polylines\"],\n [\"cypher-pattern\", \"polylines\"],\n [\"head-and-shoulders\", \"polylines\"],\n [\"abcd-pattern\", \"polylines\"],\n [\"triangle-pattern\", \"polylines\"],\n [\"three-drives-pattern\", \"polylines\"],\n [\"elliott-impulse-wave\", \"polylines\"],\n [\"elliott-correction-wave\", \"polylines\"],\n [\"elliott-triangle-wave\", \"polylines\"],\n [\"elliott-double-combo\", \"polylines\"],\n [\"elliott-triple-combo\", \"polylines\"],\n [\"cyclic-lines\", \"other\"],\n [\"time-cycles\", \"other\"],\n [\"sine-line\", \"other\"],\n [\"group\", \"other\"],\n [\"frame\", \"other\"],\n [\"table\", \"other\"],\n]);\n\n/**\n * Return the {@link DrawingBucket} for a given {@link DrawingKind}.\n * Throws if the kind is not in the map — covers the defensive branch\n * for callers that pass an unverified string (e.g. a future kind\n * round-tripped from the wire before its bucket entry lands).\n *\n * @formula bucket = KIND_BUCKET.get(kind)\n * @anchors kind: DrawingKind → bucket: \"lines\"|\"labels\"|\"boxes\"|\"polylines\"|\"other\"\n * @since 0.3\n * @stable\n * @example\n * import { bucketFor } from \"@invinite-org/chartlang-core\";\n * const bucket = bucketFor(\"rectangle\"); // \"boxes\"\n * void bucket;\n */\nexport function bucketFor(kind: DrawingKind): DrawingBucket {\n const bucket = KIND_BUCKET.get(kind);\n if (bucket === undefined) {\n throw new Error(`No bucket assigned for drawing kind '${kind}'`);\n }\n return bucket;\n}\n"]}
@@ -8,7 +8,7 @@ import type { AnchorHept, AnchorQuad, AnchorQuint, AnchorTriple, WorldPoint } fr
8
8
  * calls — the compiler injects a callsite slot id so the runtime can
9
9
  * track the per-handle `DrawingState` across bars — and returns a
10
10
  * {@link DrawingHandle}. Adapters that omit a kind degrade silently
11
- * with `unsupported-drawing-kind` (PLAN.md §7.4); excess emissions
11
+ * with `unsupported-drawing-kind`; excess emissions
12
12
  * drop with `drawing-budget-exceeded` once the per-script bucket is
13
13
  * full.
14
14
  *
@@ -109,8 +109,7 @@ export type DrawNamespace = {
109
109
  * convention as the `plot` / `hline` / `alert` stubs in
110
110
  * `plot/plot.ts:plot` / `alert/alert.ts:alert`. The runtime swaps this
111
111
  * stub for the real namespace at boot per the
112
- * `@invinite-org/chartlang-runtime` `primitives.ts` seam (PLAN.md
113
- * §5.5).
112
+ * `@invinite-org/chartlang-runtime` `primitives.ts` seam.
114
113
  *
115
114
  * @formula N/A — namespace surface; per-method runtime impl in Tasks 5–18
116
115
  * @anchors per-method — see the per-kind state shapes in `drawingState.ts`
@@ -1 +1 @@
1
- {"version":3,"file":"draw.d.ts","sourceRoot":"","sources":["../../src/draw/draw.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EACR,eAAe,EACf,SAAS,EACT,UAAU,EACV,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,mBAAmB,EACnB,UAAU,EACV,QAAQ,EACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,S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aAAa,CAAC;IAC7E,kBAAkB,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,aAAa,CAAC;IAE7E,WAAW,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,aAAa,CAAC;IAC/E,UAAU,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,aAAa,CAAC;IAC9E,QAAQ,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,aAAa,CAAC;IAE5E,KAAK,CAAC,cAAc,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,aAAa,CAAC;IAC5D,KAAK,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;IAErE,KAAK,CAAC,IAAI,EAAE,SAAS,GAAG,aAAa,CAAC;CACzC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,IAAI,EAAE,aAAgC,CAAC"}
package/dist/draw/draw.js CHANGED
@@ -7,8 +7,7 @@
7
7
  * convention as the `plot` / `hline` / `alert` stubs in
8
8
  * `plot/plot.ts:plot` / `alert/alert.ts:alert`. The runtime swaps this
9
9
  * stub for the real namespace at boot per the
10
- * `@invinite-org/chartlang-runtime` `primitives.ts` seam (PLAN.md
11
- * §5.5).
10
+ * `@invinite-org/chartlang-runtime` `primitives.ts` seam.
12
11
  *
13
12
  * @formula N/A — namespace surface; per-method runtime impl in Tasks 5–18
14
13
  * @anchors per-method — see the per-kind state shapes in `drawingState.ts`
@@ -1 +1 @@
1
- {"version":3,"file":"draw.js","sourceRoot":"","sources":["../../src/draw/draw.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAiJ/D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,IAAI,GAAkB,cAAc,EAAE,CAAC;AAEpD,SAAS,cAAc;IACnB,MAAM,OAAO,GAAgC;QACzC,GAAG,CAAC,OAAO,EAAE,QAAQ;YACjB,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC9B,OAAO,cAAc,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;QAC1C,CAAC;KACJ,CAAC;IACF,OAAO,IAAI,KAAK,CAAC,EAAmB,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC;AAED,SAAS,cAAc,CAAC,SAAiB;IACrC,OAAO,GAAU,EAAE;QACf,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,kCAAkC,CAAC,CAAC;IACpE,CAAC,CAAC;AACN,CAAC"}
1
+ {"version":3,"file":"draw.js","sourceRoot":"","sources":["../../src/draw/draw.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAiJ/D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,IAAI,GAAkB,cAAc,EAAE,CAAC;AAEpD,SAAS,cAAc;IACnB,MAAM,OAAO,GAAgC;QACzC,GAAG,CAAC,OAAO,EAAE,QAAQ;YACjB,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC9B,OAAO,cAAc,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;QAC1C,CAAC;KACJ,CAAC;IACF,OAAO,IAAI,KAAK,CAAC,EAAmB,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC;AAED,SAAS,cAAc,CAAC,SAAiB;IACrC,OAAO,GAAU,EAAE;QACf,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,kCAAkC,CAAC,CAAC;IACpE,CAAC,CAAC;AACN,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nimport type { Price, Time } from \"../types.js\";\nimport type {\n ArrowMarkerOpts,\n ArrowOpts,\n BrushStyle,\n FibOpts,\n FrameOpts,\n HighlighterStyle,\n LineDrawStyle,\n PathOpts,\n RegressionTrendOpts,\n ShapeStyle,\n TextOpts,\n} from \"./drawingStyle.js\";\nimport type { DrawingHandle } from \"./handle.js\";\nimport type { TableOpts } from \"./table.js\";\nimport type {\n AnchorHept,\n AnchorQuad,\n AnchorQuint,\n AnchorTriple,\n WorldPoint,\n} from \"./worldPoint.js\";\n\n/**\n * The script-facing `draw.*` namespace. Each method is stateful across\n * calls — the compiler injects a callsite slot id so the runtime can\n * track the per-handle `DrawingState` across bars — and returns a\n * {@link DrawingHandle}. Adapters that omit a kind degrade silently\n * with `unsupported-drawing-kind`; excess emissions\n * drop with `drawing-budget-exceeded` once the per-script bucket is\n * full.\n *\n * Every kind lives as a FLAT method directly on `DrawNamespace` —\n * script authors call `draw.fibRetracement(a, b)` /\n * `draw.gannBox(a, b)` / `draw.elliottImpulseWave(anchors)` /\n * `draw.xabcdPattern(anchors)`, matching the flat camelCase names in\n * `STATEFUL_PRIMITIVES` and Pine + invinite parity. The wire format\n * keeps the kebab-case `DrawingKind`.\n *\n * Phase-3 implementations live in `@invinite-org/chartlang-runtime`;\n * this file ships the script-author type plus a throwing-stub `draw`\n * value (mirrors `plot/plot.ts:plot`). Tasks 5–18 land the runtime\n * impl per category.\n *\n * @formula N/A — namespace surface; per-method runtime impl in Tasks 5–18\n * @anchors per-method — see the per-kind state shapes in `drawingState.ts`\n * @since 0.3\n * @stable\n * @example\n * import type { DrawNamespace } from \"@invinite-org/chartlang-core\";\n * const _ns: DrawNamespace | null = null;\n * void _ns;\n */\nexport type DrawNamespace = {\n // Lines / Rays (Task 5)\n line(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n horizontalLine(price: Price, opts?: LineDrawStyle): DrawingHandle;\n horizontalRay(anchor: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n verticalLine(time: Time, opts?: LineDrawStyle): DrawingHandle;\n crossLine(anchor: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n trendAngle(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n // Boxes A (Task 6)\n rectangle(a: WorldPoint, b: WorldPoint, opts?: ShapeStyle): DrawingHandle;\n rotatedRectangle(anchors: AnchorQuad, opts?: ShapeStyle): DrawingHandle;\n triangle(anchors: AnchorTriple, opts?: ShapeStyle): DrawingHandle;\n polyline(anchors: ReadonlyArray<WorldPoint>, opts?: LineDrawStyle): DrawingHandle;\n // Boxes B (Task 7)\n circle(centre: WorldPoint, radiusAnchor: WorldPoint, opts?: ShapeStyle): DrawingHandle;\n ellipse(a: WorldPoint, b: WorldPoint, opts?: ShapeStyle): DrawingHandle;\n path(anchors: ReadonlyArray<WorldPoint>, opts?: PathOpts): DrawingHandle;\n marker(\n anchor: WorldPoint,\n opts?: TextOpts & { readonly text?: string; readonly value?: number },\n ): DrawingHandle;\n // Curves (Task 8)\n arc(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n curve(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n doubleCurve(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n // Freehand (Task 8)\n pen(anchors: ReadonlyArray<WorldPoint>, opts?: LineDrawStyle): DrawingHandle;\n highlighter(anchors: ReadonlyArray<WorldPoint>, opts: HighlighterStyle): DrawingHandle;\n brush(anchors: ReadonlyArray<WorldPoint>, opts: BrushStyle): DrawingHandle;\n // Annotations (Task 9)\n text(anchor: WorldPoint, body: string, opts?: TextOpts): DrawingHandle;\n arrow(a: WorldPoint, b: WorldPoint, opts?: ArrowOpts): DrawingHandle;\n arrowMarker(anchor: WorldPoint, opts?: ArrowMarkerOpts): DrawingHandle;\n arrowMarkUp(anchor: WorldPoint, opts?: ArrowMarkerOpts): DrawingHandle;\n arrowMarkDown(anchor: WorldPoint, opts?: ArrowMarkerOpts): DrawingHandle;\n // Channels (Task 10)\n trendChannel(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n flatTopBottom(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n disjointChannel(anchors: AnchorQuad, opts?: LineDrawStyle): DrawingHandle;\n regressionTrend(a: WorldPoint, b: WorldPoint, opts?: RegressionTrendOpts): DrawingHandle;\n // Fibonacci A (Task 11)\n fibRetracement(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibTrendExtension(anchors: AnchorTriple, opts?: FibOpts): DrawingHandle;\n fibChannel(anchors: AnchorTriple, opts?: FibOpts): DrawingHandle;\n fibTimeZone(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibWedge(anchors: AnchorTriple, opts?: FibOpts): DrawingHandle;\n // Fibonacci B (Task 12)\n fibSpeedFan(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibSpeedArcs(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibSpiral(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibCircles(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibTrendTime(anchors: AnchorTriple, opts?: FibOpts): DrawingHandle;\n // Gann (Task 13)\n gannBox(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n gannSquareFixed(anchor: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n gannSquare(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n gannFan(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n // Pitchforks (Task 14)\n pitchfork(\n anchors: AnchorTriple,\n opts?: LineDrawStyle & {\n readonly variant?: \"standard\" | \"schiff\" | \"modifiedSchiff\" | \"inside\";\n },\n ): DrawingHandle;\n pitchfan(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n // Harmonic Patterns (Task 15)\n xabcdPattern(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n cypherPattern(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n headAndShoulders(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n abcdPattern(anchors: AnchorQuad, opts?: LineDrawStyle): DrawingHandle;\n trianglePattern(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n threeDrivesPattern(anchors: AnchorHept, opts?: LineDrawStyle): DrawingHandle;\n // Elliott Waves (Task 16)\n elliottImpulseWave(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n elliottCorrectionWave(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n elliottTriangleWave(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n elliottDoubleCombo(anchors: AnchorHept, opts?: LineDrawStyle): DrawingHandle;\n elliottTripleCombo(anchors: AnchorHept, opts?: LineDrawStyle): DrawingHandle;\n // Cycles (Task 17)\n cyclicLines(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n timeCycles(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n sineLine(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n // Containers (Task 18)\n group(childHandleIds: ReadonlyArray<string>): DrawingHandle;\n frame(a: WorldPoint, b: WorldPoint, opts?: FrameOpts): DrawingHandle;\n // Viewport overlays (Phase 5)\n table(opts: TableOpts): DrawingHandle;\n};\n\n/**\n * Compile-time callable hole for the `draw.*` namespace. Every `get`\n * on the proxy returns a function that throws the\n * `\"draw.<method> called outside compiled runtime\"` sentinel — same\n * convention as the `plot` / `hline` / `alert` stubs in\n * `plot/plot.ts:plot` / `alert/alert.ts:alert`. The runtime swaps this\n * stub for the real namespace at boot per the\n * `@invinite-org/chartlang-runtime` `primitives.ts` seam.\n *\n * @formula N/A — namespace surface; per-method runtime impl in Tasks 5–18\n * @anchors per-method — see the per-kind state shapes in `drawingState.ts`\n * @since 0.3\n * @stable\n * @example\n * import { draw } from \"@invinite-org/chartlang-core\";\n * try {\n * draw.horizontalLine(0);\n * } catch {\n * // expected: \"draw.horizontalLine called outside compiled runtime\"\n * }\n */\nexport const draw: DrawNamespace = createDrawStub();\n\nfunction createDrawStub(): DrawNamespace {\n const handler: ProxyHandler<DrawNamespace> = {\n get(_target, property): unknown {\n const name = String(property);\n return throwingMethod(`draw.${name}`);\n },\n };\n return new Proxy({} as DrawNamespace, handler);\n}\n\nfunction throwingMethod(qualified: string): () => never {\n return (): never => {\n throw new Error(`${qualified} called outside compiled runtime`);\n };\n}\n"]}
@@ -4,7 +4,7 @@
4
4
  * camelCase (`draw.horizontalLine(...)`). See {@link KIND_CAMELCASE} for
5
5
  * the canonical bijection.
6
6
  *
7
- * Variant collapses pinned in PLAN.md §3.1:
7
+ * Variant collapses:
8
8
  *
9
9
  * - `ray` / `extended-line` collapse into `line` with `extendLeft` /
10
10
  * `extendRight` flags on the state.
@@ -1 +1 @@
1
- {"version":3,"file":"drawingKind.js","sourceRoot":"","sources":["../../src/draw/drawingKind.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AA8G/D;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,aAAa,GAA+B,MAAM,CAAC,MAAM,CAAC;IACnE,MAAM;IACN,iBAAiB;IACjB,gBAAgB;IAChB,eAAe;IACf,YAAY;IACZ,aAAa;IACb,WAAW;IACX,mBAAmB;IACnB,UAAU;IACV,UAAU;IACV,QAAQ;IACR,SAAS;IACT,MAAM;IACN,QAAQ;IACR,KAAK;IACL,OAAO;IACP,cAAc;IACd,KAAK;IACL,aAAa;IACb,OAAO;IACP,MAAM;IACN,OAAO;IACP,cAAc;IACd,eAAe;IACf,iBAAiB;IACjB,eAAe;IACf,iBAAiB;IACjB,kBAAkB;IAClB,kBAAkB;IAClB,iBAAiB;IACjB,qBAAqB;IACrB,aAAa;IACb,eAAe;IACf,WAAW;IACX,eAAe;IACf,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AAE,qBAAqB,CAAC;IAChD,CAAC,sBAAsB,EAAE,oBAAoB,CAAC;IAC9C,CAAC,sBAAsB,EAAE,oBAAoB,CAAC;IAC9C,CAAC,cAAc,EAAE,aAAa,CAAC;IAC/B,CAAC,aAAa,EAAE,YAAY,CAAC;IAC7B,CAAC,WAAW,EAAE,UAAU,CAAC;IACzB,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,OAAO,EAAE,OAAO,CAAC;CACrB,CAAC,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,cAAc,GAAqC,IAAI,GAAG,CACnE,KAAK,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CACjE,CAAC"}
1
+ {"version":3,"file":"drawingKind.js","sourceRoot":"","sources":["../../src/draw/drawingKind.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AA8G/D;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,aAAa,GAA+B,MAAM,CAAC,MAAM,CAAC;IACnE,MAAM;IACN,iBAAiB;IACjB,gBAAgB;IAChB,eAAe;IACf,YAAY;IACZ,aAAa;IACb,WAAW;IACX,mBAAmB;IACnB,UAAU;IACV,UAAU;IACV,QAAQ;IACR,SAAS;IACT,MAAM;IACN,QAAQ;IACR,KAAK;IACL,OAAO;IACP,cAAc;IACd,KAAK;IACL,aAAa;IACb,OAAO;IACP,MAAM;IACN,OAAO;IACP,cAAc;IACd,eAAe;IACf,iBAAiB;IACjB,eAAe;IACf,iBAAiB;IACjB,kBAAkB;IAClB,kBAAkB;IAClB,iBAAiB;IACjB,qBAAqB;IACrB,aAAa;IACb,eAAe;IACf,WAAW;IACX,eAAe;IACf,gBAAgB;IAChB,YAAY;IACZ,aAAa;IACb,gBAAgB;IAChB,U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,CAAC;IAC9C,CAAC,sBAAsB,EAAE,oBAAoB,CAAC;IAC9C,CAAC,cAAc,EAAE,aAAa,CAAC;IAC/B,CAAC,aAAa,EAAE,YAAY,CAAC;IAC7B,CAAC,WAAW,EAAE,UAAU,CAAC;IACzB,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,OAAO,EAAE,OAAO,CAAC;CACrB,CAAC,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,cAAc,GAAqC,IAAI,GAAG,CACnE,KAAK,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CACjE,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 * The full set of 62 drawing kinds chartlang supports through `draw.*`.\n * The wire format is kebab-case; the TypeScript script surface is\n * camelCase (`draw.horizontalLine(...)`). See {@link KIND_CAMELCASE} for\n * the canonical bijection.\n *\n * Variant collapses:\n *\n * - `ray` / `extended-line` collapse into `line` with `extendLeft` /\n * `extendRight` flags on the state.\n * - The 4 invinite pitchfork tools (`standard` / `schiff` /\n * `modifiedSchiff` / `inside`) collapse into `pitchfork` with a\n * `variant` discriminator on the state.\n * - `cypher-pattern` has no standalone tool — emittable only through\n * `defineDrawing` (Task 20).\n *\n * Order pinned: lines (6) → boxes (8) → curves (3) → freehand (3) →\n * annotations (5) → channels (4) → fib (10) → gann (4) → pitchforks (2)\n * → patterns (6) → elliott (5) → cycles (3) → containers (2) → viewport\n * overlays (1) = 62. The order is wire-stable — downstream consumers iterate\n * {@link DRAWING_KINDS} in this order for diagnostic readability.\n *\n * @formula N/A — discriminator constant set\n * @anchors 62 kebab-case kind names; see {@link DRAWING_KINDS}\n * @since 0.3\n * @stable\n * @example\n * const k: DrawingKind = \"fib-retracement\";\n * void k;\n */\nexport type DrawingKind =\n // Lines / Rays (6)\n | \"line\"\n | \"horizontal-line\"\n | \"horizontal-ray\"\n | \"vertical-line\"\n | \"cross-line\"\n | \"trend-angle\"\n // Boxes / Shapes (8)\n | \"rectangle\"\n | \"rotated-rectangle\"\n | \"triangle\"\n | \"polyline\"\n | \"circle\"\n | \"ellipse\"\n | \"path\"\n | \"marker\"\n // Curves (3)\n | \"arc\"\n | \"curve\"\n | \"double-curve\"\n // Freehand (3)\n | \"pen\"\n | \"highlighter\"\n | \"brush\"\n // Annotations (5)\n | \"text\"\n | \"arrow\"\n | \"arrow-marker\"\n | \"arrow-mark-up\"\n | \"arrow-mark-down\"\n // Channels (4)\n | \"trend-channel\"\n | \"flat-top-bottom\"\n | \"disjoint-channel\"\n | \"regression-trend\"\n // Fibonacci (10)\n | \"fib-retracement\"\n | \"fib-trend-extension\"\n | \"fib-channel\"\n | \"fib-time-zone\"\n | \"fib-wedge\"\n | \"fib-speed-fan\"\n | \"fib-speed-arcs\"\n | \"fib-spiral\"\n | \"fib-circles\"\n | \"fib-trend-time\"\n // Gann (4)\n | \"gann-box\"\n | \"gann-square-fixed\"\n | \"gann-square\"\n | \"gann-fan\"\n // Pitchforks (2)\n | \"pitchfork\"\n | \"pitchfan\"\n // Harmonic Patterns (6)\n | \"xabcd-pattern\"\n | \"cypher-pattern\"\n | \"head-and-shoulders\"\n | \"abcd-pattern\"\n | \"triangle-pattern\"\n | \"three-drives-pattern\"\n // Elliott Waves (5)\n | \"elliott-impulse-wave\"\n | \"elliott-correction-wave\"\n | \"elliott-triangle-wave\"\n | \"elliott-double-combo\"\n | \"elliott-triple-combo\"\n // Cycles (3)\n | \"cyclic-lines\"\n | \"time-cycles\"\n | \"sine-line\"\n // Containers (2)\n | \"group\"\n | \"frame\"\n // Viewport overlays (1)\n | \"table\";\n\n/**\n * Iterable form of {@link DrawingKind}. Order matches the type\n * declaration so docs / validators / dispatchers can walk the set in a\n * single canonical order. Frozen.\n *\n * @formula N/A — discriminator constant set\n * @anchors 62 kebab-case kind names; see {@link DRAWING_KINDS}\n * @since 0.3\n * @stable\n * @example\n * import { DRAWING_KINDS } from \"@invinite-org/chartlang-core\";\n * for (const k of DRAWING_KINDS) {\n * void k;\n * }\n */\nexport const DRAWING_KINDS: ReadonlyArray<DrawingKind> = Object.freeze([\n \"line\",\n \"horizontal-line\",\n \"horizontal-ray\",\n \"vertical-line\",\n \"cross-line\",\n \"trend-angle\",\n \"rectangle\",\n \"rotated-rectangle\",\n \"triangle\",\n \"polyline\",\n \"circle\",\n \"ellipse\",\n \"path\",\n \"marker\",\n \"arc\",\n \"curve\",\n \"double-curve\",\n \"pen\",\n \"highlighter\",\n \"brush\",\n \"text\",\n \"arrow\",\n \"arrow-marker\",\n \"arrow-mark-up\",\n \"arrow-mark-down\",\n \"trend-channel\",\n \"flat-top-bottom\",\n \"disjoint-channel\",\n \"regression-trend\",\n \"fib-retracement\",\n \"fib-trend-extension\",\n \"fib-channel\",\n \"fib-time-zone\",\n \"fib-wedge\",\n \"fib-speed-fan\",\n \"fib-speed-arcs\",\n \"fib-spiral\",\n \"fib-circles\",\n \"fib-trend-time\",\n \"gann-box\",\n \"gann-square-fixed\",\n \"gann-square\",\n \"gann-fan\",\n \"pitchfork\",\n \"pitchfan\",\n \"xabcd-pattern\",\n \"cypher-pattern\",\n \"head-and-shoulders\",\n \"abcd-pattern\",\n \"triangle-pattern\",\n \"three-drives-pattern\",\n \"elliott-impulse-wave\",\n \"elliott-correction-wave\",\n \"elliott-triangle-wave\",\n \"elliott-double-combo\",\n \"elliott-triple-combo\",\n \"cyclic-lines\",\n \"time-cycles\",\n \"sine-line\",\n \"group\",\n \"frame\",\n \"table\",\n] as const satisfies ReadonlyArray<DrawingKind>);\n\n/**\n * camelCase TypeScript-surface name for every kind. Used by the editor\n * + gen-docs + the compiler's `STATEFUL_PRIMITIVES` lookup so a script\n * author writes `draw.horizontalLine(...)` while the wire format stays\n * kebab-case (`horizontal-line`). The bijection round-trips through\n * {@link KIND_KEBABCASE}.\n *\n * @formula N/A — discriminator constant set\n * @anchors 62 kebab-case kind names; see {@link DRAWING_KINDS}\n * @since 0.3\n * @stable\n * @example\n * import { KIND_CAMELCASE } from \"@invinite-org/chartlang-core\";\n * const camel = KIND_CAMELCASE.get(\"horizontal-line\"); // \"horizontalLine\"\n * void camel;\n */\nexport const KIND_CAMELCASE: ReadonlyMap<DrawingKind, string> = new Map<DrawingKind, string>([\n [\"line\", \"line\"],\n [\"horizontal-line\", \"horizontalLine\"],\n [\"horizontal-ray\", \"horizontalRay\"],\n [\"vertical-line\", \"verticalLine\"],\n [\"cross-line\", \"crossLine\"],\n [\"trend-angle\", \"trendAngle\"],\n [\"rectangle\", \"rectangle\"],\n [\"rotated-rectangle\", \"rotatedRectangle\"],\n [\"triangle\", \"triangle\"],\n [\"polyline\", \"polyline\"],\n [\"circle\", \"circle\"],\n [\"ellipse\", \"ellipse\"],\n [\"path\", \"path\"],\n [\"marker\", \"marker\"],\n [\"arc\", \"arc\"],\n [\"curve\", \"curve\"],\n [\"double-curve\", \"doubleCurve\"],\n [\"pen\", \"pen\"],\n [\"highlighter\", \"highlighter\"],\n [\"brush\", \"brush\"],\n [\"text\", \"text\"],\n [\"arrow\", \"arrow\"],\n [\"arrow-marker\", \"arrowMarker\"],\n [\"arrow-mark-up\", \"arrowMarkUp\"],\n [\"arrow-mark-down\", \"arrowMarkDown\"],\n [\"trend-channel\", \"trendChannel\"],\n [\"flat-top-bottom\", \"flatTopBottom\"],\n [\"disjoint-channel\", \"disjointChannel\"],\n [\"regression-trend\", \"regressionTrend\"],\n [\"fib-retracement\", \"fibRetracement\"],\n [\"fib-trend-extension\", \"fibTrendExtension\"],\n [\"fib-channel\", \"fibChannel\"],\n [\"fib-time-zone\", \"fibTimeZone\"],\n [\"fib-wedge\", \"fibWedge\"],\n [\"fib-speed-fan\", \"fibSpeedFan\"],\n [\"fib-speed-arcs\", \"fibSpeedArcs\"],\n [\"fib-spiral\", \"fibSpiral\"],\n [\"fib-circles\", \"fibCircles\"],\n [\"fib-trend-time\", \"fibTrendTime\"],\n [\"gann-box\", \"gannBox\"],\n [\"gann-square-fixed\", \"gannSquareFixed\"],\n [\"gann-square\", \"gannSquare\"],\n [\"gann-fan\", \"gannFan\"],\n [\"pitchfork\", \"pitchfork\"],\n [\"pitchfan\", \"pitchfan\"],\n [\"xabcd-pattern\", \"xabcdPattern\"],\n [\"cypher-pattern\", \"cypherPattern\"],\n [\"head-and-shoulders\", \"headAndShoulders\"],\n [\"abcd-pattern\", \"abcdPattern\"],\n [\"triangle-pattern\", \"trianglePattern\"],\n [\"three-drives-pattern\", \"threeDrivesPattern\"],\n [\"elliott-impulse-wave\", \"elliottImpulseWave\"],\n [\"elliott-correction-wave\", \"elliottCorrectionWave\"],\n [\"elliott-triangle-wave\", \"elliottTriangleWave\"],\n [\"elliott-double-combo\", \"elliottDoubleCombo\"],\n [\"elliott-triple-combo\", \"elliottTripleCombo\"],\n [\"cyclic-lines\", \"cyclicLines\"],\n [\"time-cycles\", \"timeCycles\"],\n [\"sine-line\", \"sineLine\"],\n [\"group\", \"group\"],\n [\"frame\", \"frame\"],\n [\"table\", \"table\"],\n]);\n\n/**\n * Inverse of {@link KIND_CAMELCASE} — camelCase TypeScript surface\n * name → kebab-case wire kind. Derived from `KIND_CAMELCASE` so the\n * two maps cannot drift.\n *\n * @formula N/A — discriminator constant set\n * @anchors 62 kebab-case kind names; see {@link DRAWING_KINDS}\n * @since 0.3\n * @stable\n * @example\n * import { KIND_KEBABCASE } from \"@invinite-org/chartlang-core\";\n * const kebab = KIND_KEBABCASE.get(\"horizontalLine\"); // \"horizontal-line\"\n * void kebab;\n */\nexport const KIND_KEBABCASE: ReadonlyMap<string, DrawingKind> = new Map<string, DrawingKind>(\n Array.from(KIND_CAMELCASE, ([kebab, camel]) => [camel, kebab]),\n);\n"]}
@@ -5,7 +5,7 @@ import type { AnchorHept, AnchorPair, AnchorQuad, AnchorQuint, AnchorTriple, Wor
5
5
  /**
6
6
  * Script-mutable metadata fields every {@link DrawingState} variant
7
7
  * carries. `name` surfaces in the editor layer; `visible: false` hides
8
- * the drawing without removing it. See PLAN.md §10.0 for the contract.
8
+ * the drawing without removing it.
9
9
  *
10
10
  * @formula N/A — metadata only, no geometry
11
11
  * @anchors N/A — script-author metadata
@@ -22,7 +22,7 @@ export type DrawingMeta = {
22
22
  /**
23
23
  * `line` — two-anchor straight line. Carries `extendLeft` /
24
24
  * `extendRight` flags so the invinite `ray` / `extended-line` tools
25
- * collapse into this single kind per PLAN.md §3.1.
25
+ * collapse into this single kind.
26
26
  *
27
27
  * @formula identity — segment between `anchors[0]` and `anchors[1]`
28
28
  * @anchors anchors: [from, to]
@@ -936,7 +936,7 @@ export type GannFanState = DrawingMeta & {
936
936
  /**
937
937
  * `pitchfork` — Andrews pitchfork. The `variant` discriminator collapses
938
938
  * the four invinite tools (`standard` / `schiff` / `modifiedSchiff` /
939
- * `inside`) into one kind per PLAN.md §3.1.
939
+ * `inside`) into one kind.
940
940
  *
941
941
  * @formula median + two parallels through `anchors[1]` / `anchors[2]`
942
942
  * @anchors anchors: [pivot, high, low]; variant: "standard"|"schiff"|"modifiedSchiff"|"inside"
@@ -1368,7 +1368,7 @@ export type FrameState = DrawingMeta & {
1368
1368
  /**
1369
1369
  * `table` — CSS-pixel viewport-anchored dashboard/status panel. It
1370
1370
  * deliberately carries no world-space anchors; adapters resolve
1371
- * `position` against the current viewport per PLAN.md §10.2.
1371
+ * `position` against the current viewport.
1372
1372
  *
1373
1373
  * @formula N/A — table layout resolved in CSS pixels by adapter
1374
1374
  * @anchors position: CSS viewport anchor
@@ -1397,7 +1397,7 @@ export type TableState = DrawingMeta & {
1397
1397
  * Per-kind state union — every {@link DrawingKind} maps to exactly one
1398
1398
  * variant. Collab-only fields (Yjs `id`, `layerId`, `createdAt`,
1399
1399
  * `authorId`, `parentGroupId`, `parentFrameId`, `visibleIntervals`)
1400
- * from the invinite source are stripped per PLAN.md §10.4.
1400
+ * from the invinite source are stripped.
1401
1401
  *
1402
1402
  * The 62 variants here are intentionally minimal shells. Tasks 5–18
1403
1403
  * (per-category ports) refine each variant's geometry + style payload
@@ -1 +1 @@
1
- {"version":3,"file":"drawingState.js","sourceRoot":"","sources":["../../src/draw/drawingState.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D"}
1
+ {"version":3,"file":"drawingState.js","sourceRoot":"","sources":["../../src/draw/drawingState.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 { Color, JsonValue, Price, Time } from \"../types.js\";\nimport type {\n ArrowMarkerOpts,\n ArrowOpts,\n BrushStyle,\n FibOpts,\n FrameOpts,\n HighlighterStyle,\n LineDrawStyle,\n PathOpts,\n RegressionTrendOpts,\n ShapeStyle,\n TextOpts,\n} from \"./drawingStyle.js\";\nimport type { TableCell, TablePosition } from \"./table.js\";\nimport type {\n AnchorHept,\n AnchorPair,\n AnchorQuad,\n AnchorQuint,\n AnchorTriple,\n WorldPoint,\n} from \"./worldPoint.js\";\n\n/**\n * Script-mutable metadata fields every {@link DrawingState} variant\n * carries. `name` surfaces in the editor layer; `visible: false` hides\n * the drawing without removing it.\n *\n * @formula N/A — metadata only, no geometry\n * @anchors N/A — script-author metadata\n * @since 0.3\n * @stable\n * @example\n * const m: DrawingMeta = { name: \"Support\", visible: true };\n * void m;\n */\nexport type DrawingMeta = {\n readonly name?: string;\n readonly visible?: boolean;\n};\n\n/**\n * `line` — two-anchor straight line. Carries `extendLeft` /\n * `extendRight` flags so the invinite `ray` / `extended-line` tools\n * collapse into this single kind.\n *\n * @formula identity — segment between `anchors[0]` and `anchors[1]`\n * @anchors anchors: [from, to]\n * @since 0.3\n * @stable\n * @example\n * const s: LineState = {\n * kind: \"line\",\n * anchors: [{ time: 1, price: 1 }, { time: 2, price: 2 }],\n * style: {},\n * };\n * void s;\n */\nexport type LineState = DrawingMeta & {\n readonly kind: \"line\";\n readonly anchors: AnchorPair;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `horizontal-line` — single-price line extending across the chart.\n *\n * @formula identity — horizontal line at `price`\n * @anchors price\n * @since 0.3\n * @stable\n * @example\n * const s: HorizontalLineState = {\n * kind: \"horizontal-line\",\n * price: 100,\n * style: { color: \"#3b82f6\" },\n * };\n * void s;\n */\nexport type HorizontalLineState = DrawingMeta & {\n readonly kind: \"horizontal-line\";\n readonly price: Price;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `horizontal-ray` — single-price ray anchored at a starting time.\n *\n * @formula identity — ray from `anchor` extending right at constant price\n * @anchors anchor\n * @since 0.3\n * @stable\n * @example\n * const s: HorizontalRayState = {\n * kind: \"horizontal-ray\",\n * anchor: { time: 1, price: 100 },\n * style: {},\n * };\n * void s;\n */\nexport type HorizontalRayState = DrawingMeta & {\n readonly kind: \"horizontal-ray\";\n readonly anchor: WorldPoint;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `vertical-line` — single-time line extending across the price axis.\n *\n * @formula identity — vertical line at `time`\n * @anchors time\n * @since 0.3\n * @stable\n * @example\n * const s: VerticalLineState = {\n * kind: \"vertical-line\",\n * time: 1_700_000_000_000,\n * style: {},\n * };\n * void s;\n */\nexport type VerticalLineState = DrawingMeta & {\n readonly kind: \"vertical-line\";\n readonly time: Time;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `cross-line` — orthogonal horizontal + vertical pair through one anchor.\n *\n * @formula identity — crosshair through `anchor`\n * @anchors anchor\n * @since 0.3\n * @stable\n * @example\n * const s: CrossLineState = {\n * kind: \"cross-line\",\n * anchor: { time: 1, price: 1 },\n * style: {},\n * };\n * void s;\n */\nexport type CrossLineState = DrawingMeta & {\n readonly kind: \"cross-line\";\n readonly anchor: WorldPoint;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `trend-angle` — line with an angle annotation read off the two anchors.\n *\n * @formula angle = atan2(Δprice, Δtime)\n * @anchors anchors: [from, to]\n * @since 0.3\n * @stable\n * @example\n * const s: TrendAngleState = {\n * kind: \"trend-angle\",\n * anchors: [{ time: 0, price: 0 }, { time: 1, price: 1 }],\n * style: {},\n * };\n * void s;\n */\nexport type TrendAngleState = DrawingMeta & {\n readonly kind: \"trend-angle\";\n readonly anchors: AnchorPair;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `rectangle` — axis-aligned filled rectangle defined by two corners.\n *\n * @formula identity — axis-aligned bounding box of `anchors`\n * @anchors anchors: [topLeft, bottomRight] (or any opposite-corner pair)\n * @since 0.3\n * @stable\n * @example\n * const s: RectangleState = {\n * kind: \"rectangle\",\n * anchors: [{ time: 0, price: 0 }, { time: 1, price: 1 }],\n * style: {},\n * };\n * void s;\n */\nexport type RectangleState = DrawingMeta & {\n readonly kind: \"rectangle\";\n readonly anchors: AnchorPair;\n readonly style: ShapeStyle;\n};\n\n/**\n * `rotated-rectangle` — four-corner rectangle, supports arbitrary rotation.\n *\n * @formula identity — polygon through the four anchor corners\n * @anchors anchors: [c1, c2, c3, c4] (CW or CCW)\n * @since 0.3\n * @stable\n * @example\n * const s: RotatedRectangleState = {\n * kind: \"rotated-rectangle\",\n * anchors: [\n * { time: 0, price: 0 }, { time: 1, price: 1 },\n * { time: 2, price: 0 }, { time: 1, price: -1 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type RotatedRectangleState = DrawingMeta & {\n readonly kind: \"rotated-rectangle\";\n readonly anchors: AnchorQuad;\n readonly style: ShapeStyle;\n};\n\n/**\n * `triangle` — three-vertex polygon.\n *\n * @formula identity — closed polygon through the three anchors\n * @anchors anchors: [v1, v2, v3]\n * @since 0.3\n * @stable\n * @example\n * const s: TriangleState = {\n * kind: \"triangle\",\n * anchors: [\n * { time: 0, price: 0 },\n * { time: 1, price: 1 },\n * { time: 2, price: 0 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type TriangleState = DrawingMeta & {\n readonly kind: \"triangle\";\n readonly anchors: AnchorTriple;\n readonly style: ShapeStyle;\n};\n\n/**\n * `polyline` — open polyline of N anchors.\n *\n * @formula identity — N-anchor open polyline\n * @anchors anchors: ReadonlyArray<WorldPoint>\n * @since 0.3\n * @stable\n * @example\n * const s: PolylineState = {\n * kind: \"polyline\",\n * anchors: [{ time: 0, price: 0 }, { time: 1, price: 1 }],\n * style: {},\n * };\n * void s;\n */\nexport type PolylineState = DrawingMeta & {\n readonly kind: \"polyline\";\n readonly anchors: ReadonlyArray<WorldPoint>;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `circle` — defined by centre + a radius anchor.\n *\n * @formula r = distance(anchors[0], anchors[1])\n * @anchors anchors: [centre, radiusPoint]\n * @since 0.3\n * @stable\n * @example\n * const s: CircleState = {\n * kind: \"circle\",\n * anchors: [{ time: 0, price: 0 }, { time: 1, price: 0 }],\n * style: {},\n * };\n * void s;\n */\nexport type CircleState = DrawingMeta & {\n readonly kind: \"circle\";\n readonly anchors: AnchorPair;\n readonly style: ShapeStyle;\n};\n\n/**\n * `ellipse` — bounding-box anchor pair.\n *\n * @formula ellipse inscribed in the bounding box of `anchors`\n * @anchors anchors: [bboxA, bboxB]\n * @since 0.3\n * @stable\n * @example\n * const s: EllipseState = {\n * kind: \"ellipse\",\n * anchors: [{ time: 0, price: 0 }, { time: 2, price: 1 }],\n * style: {},\n * };\n * void s;\n */\nexport type EllipseState = DrawingMeta & {\n readonly kind: \"ellipse\";\n readonly anchors: AnchorPair;\n readonly style: ShapeStyle;\n};\n\n/**\n * `path` — open or closed polyline with arbitrary anchor count.\n *\n * @formula identity — N-anchor path (closed = `style.closed`)\n * @anchors anchors: ReadonlyArray<WorldPoint>\n * @since 0.3\n * @stable\n * @example\n * const s: PathState = {\n * kind: \"path\",\n * anchors: [{ time: 0, price: 0 }, { time: 1, price: 1 }],\n * style: { closed: true },\n * };\n * void s;\n */\nexport type PathState = DrawingMeta & {\n readonly kind: \"path\";\n readonly anchors: ReadonlyArray<WorldPoint>;\n readonly style: PathOpts;\n};\n\n/**\n * `marker` — single-anchor glyph with optional value label.\n *\n * @formula identity — marker placed at `anchor`\n * @anchors anchor\n * @since 0.3\n * @stable\n * @example\n * const s: MarkerState = {\n * kind: \"marker\",\n * anchor: { time: 1, price: 1 },\n * text: \"B\",\n * style: {},\n * };\n * void s;\n */\nexport type MarkerState = DrawingMeta & {\n readonly kind: \"marker\";\n readonly anchor: WorldPoint;\n readonly text?: string;\n readonly value?: number;\n readonly style: TextOpts;\n};\n\n/**\n * `arc` — three-anchor arc (start / control / end).\n *\n * @formula quadratic Bezier through `anchors`\n * @anchors anchors: [start, control, end]\n * @since 0.3\n * @stable\n * @example\n * const s: ArcState = {\n * kind: \"arc\",\n * anchors: [\n * { time: 0, price: 0 },\n * { time: 1, price: 2 },\n * { time: 2, price: 0 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type ArcState = DrawingMeta & {\n readonly kind: \"arc\";\n readonly anchors: AnchorTriple;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `curve` — three-anchor quadratic Bezier.\n *\n * @formula B(t) = (1−t)²·P0 + 2(1−t)t·P1 + t²·P2\n * @anchors anchors: [P0, P1, P2]\n * @since 0.3\n * @stable\n * @example\n * const s: CurveState = {\n * kind: \"curve\",\n * anchors: [\n * { time: 0, price: 0 },\n * { time: 1, price: 2 },\n * { time: 2, price: 0 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type CurveState = DrawingMeta & {\n readonly kind: \"curve\";\n readonly anchors: AnchorTriple;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `double-curve` — five-anchor cubic Bezier pair (two stitched curves).\n *\n * @formula two cubic Beziers stitched at `anchors[2]`\n * @anchors anchors: [P0, P1, mid, P3, P4]\n * @since 0.3\n * @stable\n * @example\n * const s: DoubleCurveState = {\n * kind: \"double-curve\",\n * anchors: [\n * { time: 0, price: 0 }, { time: 1, price: 1 },\n * { time: 2, price: 0 }, { time: 3, price: -1 },\n * { time: 4, price: 0 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type DoubleCurveState = DrawingMeta & {\n readonly kind: \"double-curve\";\n readonly anchors: AnchorQuint;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `pen` — freehand polyline.\n *\n * @formula identity — sampled freehand polyline\n * @anchors anchors: ReadonlyArray<WorldPoint>\n * @since 0.3\n * @stable\n * @example\n * const s: PenState = {\n * kind: \"pen\",\n * anchors: [{ time: 0, price: 0 }, { time: 1, price: 1 }],\n * style: {},\n * };\n * void s;\n */\nexport type PenState = DrawingMeta & {\n readonly kind: \"pen\";\n readonly anchors: ReadonlyArray<WorldPoint>;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `highlighter` — freehand thick translucent stroke.\n *\n * @formula identity — sampled freehand polyline rendered translucent\n * @anchors anchors: ReadonlyArray<WorldPoint>\n * @since 0.3\n * @stable\n * @example\n * const s: HighlighterState = {\n * kind: \"highlighter\",\n * anchors: [{ time: 0, price: 0 }, { time: 1, price: 1 }],\n * style: { color: \"#facc15\", alpha: 0.3 },\n * };\n * void s;\n */\nexport type HighlighterState = DrawingMeta & {\n readonly kind: \"highlighter\";\n readonly anchors: ReadonlyArray<WorldPoint>;\n readonly style: HighlighterStyle;\n};\n\n/**\n * `brush` — freehand stroked-and-filled stroke.\n *\n * @formula identity — sampled freehand polyline rendered stroked + filled\n * @anchors anchors: ReadonlyArray<WorldPoint>\n * @since 0.3\n * @stable\n * @example\n * const s: BrushState = {\n * kind: \"brush\",\n * anchors: [{ time: 0, price: 0 }, { time: 1, price: 1 }],\n * style: { stroke: \"#000\", fill: \"#fff\" },\n * };\n * void s;\n */\nexport type BrushState = DrawingMeta & {\n readonly kind: \"brush\";\n readonly anchors: ReadonlyArray<WorldPoint>;\n readonly style: BrushStyle;\n};\n\n/**\n * `text` — single-anchor text label.\n *\n * @formula identity — `body` rendered at `anchor`\n * @anchors anchor\n * @since 0.3\n * @stable\n * @example\n * const s: TextState = {\n * kind: \"text\",\n * anchor: { time: 1, price: 1 },\n * body: \"Note\",\n * style: {},\n * };\n * void s;\n */\nexport type TextState = DrawingMeta & {\n readonly kind: \"text\";\n readonly anchor: WorldPoint;\n readonly body: string;\n readonly style: TextOpts;\n};\n\n/**\n * `arrow` — two-anchor arrow with optional label.\n *\n * @formula identity — directional arrow from `anchors[0]` → `anchors[1]`\n * @anchors anchors: [tail, head]\n * @since 0.3\n * @stable\n * @example\n * const s: ArrowState = {\n * kind: \"arrow\",\n * anchors: [{ time: 0, price: 0 }, { time: 1, price: 1 }],\n * style: {},\n * };\n * void s;\n */\nexport type ArrowState = DrawingMeta & {\n readonly kind: \"arrow\";\n readonly anchors: AnchorPair;\n readonly style: ArrowOpts;\n};\n\n/**\n * `arrow-marker` — single-anchor compact arrow + label glyph.\n *\n * @formula identity — arrow glyph at `anchor` with optional text\n * @anchors anchor\n * @since 0.3\n * @stable\n * @example\n * const s: ArrowMarkerState = {\n * kind: \"arrow-marker\",\n * anchor: { time: 1, price: 1 },\n * style: { text: \"B\" },\n * };\n * void s;\n */\nexport type ArrowMarkerState = DrawingMeta & {\n readonly kind: \"arrow-marker\";\n readonly anchor: WorldPoint;\n readonly style: ArrowMarkerOpts;\n};\n\n/**\n * `arrow-mark-up` — bullish marker (typically below the bar).\n *\n * @formula identity — upward marker glyph at `anchor`\n * @anchors anchor\n * @since 0.3\n * @stable\n * @example\n * const s: ArrowMarkUpState = {\n * kind: \"arrow-mark-up\",\n * anchor: { time: 1, price: 1 },\n * style: {},\n * };\n * void s;\n */\nexport type ArrowMarkUpState = DrawingMeta & {\n readonly kind: \"arrow-mark-up\";\n readonly anchor: WorldPoint;\n readonly style: ArrowMarkerOpts;\n};\n\n/**\n * `arrow-mark-down` — bearish marker (typically above the bar).\n *\n * @formula identity — downward marker glyph at `anchor`\n * @anchors anchor\n * @since 0.3\n * @stable\n * @example\n * const s: ArrowMarkDownState = {\n * kind: \"arrow-mark-down\",\n * anchor: { time: 1, price: 1 },\n * style: {},\n * };\n * void s;\n */\nexport type ArrowMarkDownState = DrawingMeta & {\n readonly kind: \"arrow-mark-down\";\n readonly anchor: WorldPoint;\n readonly style: ArrowMarkerOpts;\n};\n\n/**\n * `trend-channel` — two parallel lines defined by three anchors.\n *\n * @formula parallel pair: line(`anchors[0]`, `anchors[1]`) and its\n * translate through `anchors[2]`\n * @anchors anchors: [primaryA, primaryB, parallelHook]\n * @since 0.3\n * @stable\n * @example\n * const s: TrendChannelState = {\n * kind: \"trend-channel\",\n * anchors: [\n * { time: 0, price: 0 },\n * { time: 1, price: 1 },\n * { time: 0, price: 1 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type TrendChannelState = DrawingMeta & {\n readonly kind: \"trend-channel\";\n readonly anchors: AnchorTriple;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `flat-top-bottom` — horizontal channel of two parallel flat edges.\n *\n * @formula two horizontal lines at min/max prices from anchors\n * @anchors anchors: [leftEdge, rightEdge, oppositeHook]\n * @since 0.3\n * @stable\n * @example\n * const s: FlatTopBottomState = {\n * kind: \"flat-top-bottom\",\n * anchors: [\n * { time: 0, price: 1 },\n * { time: 1, price: 1 },\n * { time: 0, price: 0 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type FlatTopBottomState = DrawingMeta & {\n readonly kind: \"flat-top-bottom\";\n readonly anchors: AnchorTriple;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `disjoint-channel` — two non-parallel channel edges.\n *\n * @formula two independent line segments — line(A,B) + line(C,D)\n * @anchors anchors: [A, B, C, D]\n * @since 0.3\n * @stable\n * @example\n * const s: DisjointChannelState = {\n * kind: \"disjoint-channel\",\n * anchors: [\n * { time: 0, price: 0 }, { time: 1, price: 1 },\n * { time: 0, price: 2 }, { time: 1, price: 3 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type DisjointChannelState = DrawingMeta & {\n readonly kind: \"disjoint-channel\";\n readonly anchors: AnchorQuad;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `regression-trend` — least-squares fit ± bands across an anchor range.\n *\n * @formula fit = OLS(close[start..end]); bands = fit ± σ·stdevMultiplier\n * @anchors anchors: [start, end]\n * @since 0.3\n * @stable\n * @example\n * const s: RegressionTrendState = {\n * kind: \"regression-trend\",\n * anchors: [{ time: 0, price: 0 }, { time: 100, price: 1 }],\n * style: { source: \"close\", stdevMultiplier: 2 },\n * };\n * void s;\n */\nexport type RegressionTrendState = DrawingMeta & {\n readonly kind: \"regression-trend\";\n readonly anchors: AnchorPair;\n readonly style: RegressionTrendOpts;\n};\n\n/**\n * `fib-retracement` — fib level lines between two pivot anchors.\n *\n * @formula for each level r in `style.levels`: y(r) = A.price + r·(B.price − A.price)\n * @anchors anchors: [swingA, swingB]\n * @since 0.3\n * @stable\n * @example\n * const s: FibRetracementState = {\n * kind: \"fib-retracement\",\n * anchors: [{ time: 0, price: 0 }, { time: 1, price: 1 }],\n * style: { levels: [0.382, 0.5, 0.618] },\n * };\n * void s;\n */\nexport type FibRetracementState = DrawingMeta & {\n readonly kind: \"fib-retracement\";\n readonly anchors: AnchorPair;\n readonly style: FibOpts;\n};\n\n/**\n * `fib-trend-extension` — three-anchor fib extension projection.\n *\n * @formula range r = B−A; projection = C + r·level for level in style.levels\n * @anchors anchors: [A, B, C]\n * @since 0.3\n * @stable\n * @example\n * const s: FibTrendExtensionState = {\n * kind: \"fib-trend-extension\",\n * anchors: [\n * { time: 0, price: 0 },\n * { time: 1, price: 1 },\n * { time: 2, price: 0.5 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type FibTrendExtensionState = DrawingMeta & {\n readonly kind: \"fib-trend-extension\";\n readonly anchors: AnchorTriple;\n readonly style: FibOpts;\n};\n\n/**\n * `fib-channel` — fib levels projected as parallel channel lines.\n *\n * @formula parallel translates of line(A,B) at fib-ratio offsets through C\n * @anchors anchors: [A, B, C]\n * @since 0.3\n * @stable\n * @example\n * const s: FibChannelState = {\n * kind: \"fib-channel\",\n * anchors: [\n * { time: 0, price: 0 },\n * { time: 1, price: 1 },\n * { time: 0, price: 1 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type FibChannelState = DrawingMeta & {\n readonly kind: \"fib-channel\";\n readonly anchors: AnchorTriple;\n readonly style: FibOpts;\n};\n\n/**\n * `fib-time-zone` — vertical fib zones along the time axis.\n *\n * @formula vertical lines at t = A.time + ratio·(B.time − A.time)\n * @anchors anchors: [A, B]\n * @since 0.3\n * @stable\n * @example\n * const s: FibTimeZoneState = {\n * kind: \"fib-time-zone\",\n * anchors: [{ time: 0, price: 0 }, { time: 100, price: 0 }],\n * style: {},\n * };\n * void s;\n */\nexport type FibTimeZoneState = DrawingMeta & {\n readonly kind: \"fib-time-zone\";\n readonly anchors: AnchorPair;\n readonly style: FibOpts;\n};\n\n/**\n * `fib-wedge` — fib-spaced lines fanned from a single anchor.\n *\n * @formula rays from `anchors[0]` at angles derived from fib ratios\n * @anchors anchors: [pivot, range1, range2]\n * @since 0.3\n * @stable\n * @example\n * const s: FibWedgeState = {\n * kind: \"fib-wedge\",\n * anchors: [\n * { time: 0, price: 0 },\n * { time: 1, price: 1 },\n * { time: 1, price: -1 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type FibWedgeState = DrawingMeta & {\n readonly kind: \"fib-wedge\";\n readonly anchors: AnchorTriple;\n readonly style: FibOpts;\n};\n\n/**\n * `fib-speed-fan` — fan of fib-ratio speed lines from a pivot.\n *\n * @formula rays from A with slopes = fib-ratio · slope(line(A,B))\n * @anchors anchors: [A, B]\n * @since 0.3\n * @stable\n * @example\n * const s: FibSpeedFanState = {\n * kind: \"fib-speed-fan\",\n * anchors: [{ time: 0, price: 0 }, { time: 1, price: 1 }],\n * style: {},\n * };\n * void s;\n */\nexport type FibSpeedFanState = DrawingMeta & {\n readonly kind: \"fib-speed-fan\";\n readonly anchors: AnchorPair;\n readonly style: FibOpts;\n};\n\n/**\n * `fib-speed-arcs` — concentric arcs at fib radii.\n *\n * @formula for each level r in `style.levels`: arc of radius r·|AB| centred at A\n * @anchors anchors: [centre, edge]\n * @since 0.3\n * @stable\n * @example\n * const s: FibSpeedArcsState = {\n * kind: \"fib-speed-arcs\",\n * anchors: [{ time: 0, price: 0 }, { time: 1, price: 0 }],\n * style: {},\n * };\n * void s;\n */\nexport type FibSpeedArcsState = DrawingMeta & {\n readonly kind: \"fib-speed-arcs\";\n readonly anchors: AnchorPair;\n readonly style: FibOpts;\n};\n\n/**\n * `fib-spiral` — fib-ratio logarithmic spiral.\n *\n * @formula r(θ) = a · φ^(θ/π/2) where φ = (1+√5)/2\n * @anchors anchors: [centre, edge]\n * @since 0.3\n * @stable\n * @example\n * const s: FibSpiralState = {\n * kind: \"fib-spiral\",\n * anchors: [{ time: 0, price: 0 }, { time: 1, price: 0 }],\n * style: {},\n * };\n * void s;\n */\nexport type FibSpiralState = DrawingMeta & {\n readonly kind: \"fib-spiral\";\n readonly anchors: AnchorPair;\n readonly style: FibOpts;\n};\n\n/**\n * `fib-circles` — concentric circles at fib radii.\n *\n * @formula for each level r in `style.levels`: circle of radius r·|AB| centred at A\n * @anchors anchors: [centre, edge]\n * @since 0.3\n * @stable\n * @example\n * const s: FibCirclesState = {\n * kind: \"fib-circles\",\n * anchors: [{ time: 0, price: 0 }, { time: 1, price: 0 }],\n * style: {},\n * };\n * void s;\n */\nexport type FibCirclesState = DrawingMeta & {\n readonly kind: \"fib-circles\";\n readonly anchors: AnchorPair;\n readonly style: FibOpts;\n};\n\n/**\n * `fib-trend-time` — fib-spaced vertical time projections from a swing.\n *\n * @formula vertical lines at t = C.time + ratio·(B.time − A.time)\n * @anchors anchors: [A, B, C]\n * @since 0.3\n * @stable\n * @example\n * const s: FibTrendTimeState = {\n * kind: \"fib-trend-time\",\n * anchors: [\n * { time: 0, price: 0 },\n * { time: 1, price: 1 },\n * { time: 2, price: 0.5 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type FibTrendTimeState = DrawingMeta & {\n readonly kind: \"fib-trend-time\";\n readonly anchors: AnchorTriple;\n readonly style: FibOpts;\n};\n\n/**\n * `gann-box` — gann ratio grid inside an anchor pair.\n *\n * @formula grid of horizontal + vertical lines at 1/8, 2/8, …, 7/8 of |AB|\n * @anchors anchors: [A, B]\n * @since 0.3\n * @stable\n * @example\n * const s: GannBoxState = {\n * kind: \"gann-box\",\n * anchors: [{ time: 0, price: 0 }, { time: 1, price: 1 }],\n * style: {},\n * };\n * void s;\n */\nexport type GannBoxState = DrawingMeta & {\n readonly kind: \"gann-box\";\n readonly anchors: AnchorPair;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `gann-square-fixed` — square-of-nine fixed-size grid at an anchor.\n *\n * @formula 9×9 grid centred at `anchor` with fixed step\n * @anchors anchor\n * @since 0.3\n * @stable\n * @example\n * const s: GannSquareFixedState = {\n * kind: \"gann-square-fixed\",\n * anchor: { time: 0, price: 0 },\n * style: {},\n * };\n * void s;\n */\nexport type GannSquareFixedState = DrawingMeta & {\n readonly kind: \"gann-square-fixed\";\n readonly anchor: WorldPoint;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `gann-square` — square-of-nine sized by two anchors.\n *\n * @formula 9×9 grid spanning bbox of `anchors`\n * @anchors anchors: [A, B]\n * @since 0.3\n * @stable\n * @example\n * const s: GannSquareState = {\n * kind: \"gann-square\",\n * anchors: [{ time: 0, price: 0 }, { time: 1, price: 1 }],\n * style: {},\n * };\n * void s;\n */\nexport type GannSquareState = DrawingMeta & {\n readonly kind: \"gann-square\";\n readonly anchors: AnchorPair;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `gann-fan` — fan of gann-angle lines from a pivot.\n *\n * @formula rays from A at slopes 1×1, 1×2, 2×1, 1×3, 3×1, 1×4, 4×1, 1×8, 8×1\n * @anchors anchors: [pivot, reference]\n * @since 0.3\n * @stable\n * @example\n * const s: GannFanState = {\n * kind: \"gann-fan\",\n * anchors: [{ time: 0, price: 0 }, { time: 1, price: 1 }],\n * style: {},\n * };\n * void s;\n */\nexport type GannFanState = DrawingMeta & {\n readonly kind: \"gann-fan\";\n readonly anchors: AnchorPair;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `pitchfork` — Andrews pitchfork. The `variant` discriminator collapses\n * the four invinite tools (`standard` / `schiff` / `modifiedSchiff` /\n * `inside`) into one kind.\n *\n * @formula median + two parallels through `anchors[1]` / `anchors[2]`\n * @anchors anchors: [pivot, high, low]; variant: \"standard\"|\"schiff\"|\"modifiedSchiff\"|\"inside\"\n * @since 0.3\n * @stable\n * @example\n * const s: PitchforkState = {\n * kind: \"pitchfork\",\n * variant: \"modifiedSchiff\",\n * anchors: [\n * { time: 0, price: 0 },\n * { time: 1, price: 1 },\n * { time: 2, price: 0.5 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type PitchforkState = DrawingMeta & {\n readonly kind: \"pitchfork\";\n readonly anchors: AnchorTriple;\n readonly variant: \"standard\" | \"schiff\" | \"modifiedSchiff\" | \"inside\";\n readonly style: LineDrawStyle;\n};\n\n/**\n * `pitchfan` — fan-variant pitchfork (no median line).\n *\n * @formula rays from `anchors[0]` through `anchors[1]` / `anchors[2]`\n * @anchors anchors: [pivot, high, low]\n * @since 0.3\n * @stable\n * @example\n * const s: PitchfanState = {\n * kind: \"pitchfan\",\n * anchors: [\n * { time: 0, price: 0 },\n * { time: 1, price: 1 },\n * { time: 2, price: 0.5 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type PitchfanState = DrawingMeta & {\n readonly kind: \"pitchfan\";\n readonly anchors: AnchorTriple;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `xabcd-pattern` — harmonic pattern over five anchor pivots.\n *\n * @formula five-leg pattern with fib-ratio retracements between adjacent legs\n * @anchors anchors: [X, A, B, C, D]\n * @since 0.3\n * @stable\n * @example\n * const s: XabcdPatternState = {\n * kind: \"xabcd-pattern\",\n * anchors: [\n * { time: 0, price: 0 }, { time: 1, price: 1 },\n * { time: 2, price: 0.5 }, { time: 3, price: 1.5 },\n * { time: 4, price: 1 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type XabcdPatternState = DrawingMeta & {\n readonly kind: \"xabcd-pattern\";\n readonly anchors: AnchorQuint;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `cypher-pattern` — five-anchor harmonic pattern. Has no standalone\n * invinite tool (Task 20's `defineDrawing` is the only emit path).\n *\n * @formula Cypher: XB at 0.382-0.618 of XA, XC at 1.272-1.414 of XA, XD at 0.786 of XC\n * @anchors anchors: [X, A, B, C, D]\n * @since 0.3\n * @stable\n * @example\n * const s: CypherPatternState = {\n * kind: \"cypher-pattern\",\n * anchors: [\n * { time: 0, price: 0 }, { time: 1, price: 1 },\n * { time: 2, price: 0.4 }, { time: 3, price: 1.3 },\n * { time: 4, price: 0.6 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type CypherPatternState = DrawingMeta & {\n readonly kind: \"cypher-pattern\";\n readonly anchors: AnchorQuint;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `head-and-shoulders` — five-pivot reversal pattern.\n *\n * @formula identity — pivot polyline with neckline at min(anchors[0].price, anchors[4].price)\n * @anchors anchors: [leftShoulderHigh, leftLow, headHigh, rightLow, rightShoulderHigh]\n * @since 0.3\n * @stable\n * @example\n * const s: HeadAndShouldersState = {\n * kind: \"head-and-shoulders\",\n * anchors: [\n * { time: 0, price: 1 }, { time: 1, price: 0 },\n * { time: 2, price: 2 }, { time: 3, price: 0 },\n * { time: 4, price: 1 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type HeadAndShouldersState = DrawingMeta & {\n readonly kind: \"head-and-shoulders\";\n readonly anchors: AnchorQuint;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `abcd-pattern` — four-anchor measured-move pattern.\n *\n * @formula CD = AB projected from C (fib ratio 1.0 default)\n * @anchors anchors: [A, B, C, D]\n * @since 0.3\n * @stable\n * @example\n * const s: AbcdPatternState = {\n * kind: \"abcd-pattern\",\n * anchors: [\n * { time: 0, price: 0 }, { time: 1, price: 1 },\n * { time: 2, price: 0.5 }, { time: 3, price: 1.5 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type AbcdPatternState = DrawingMeta & {\n readonly kind: \"abcd-pattern\";\n readonly anchors: AnchorQuad;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `triangle-pattern` — three-anchor triangle pattern (ascending /\n * descending / symmetrical).\n *\n * @formula identity — three-vertex pattern outline\n * @anchors anchors: [apex, baseHigh, baseLow]\n * @since 0.3\n * @stable\n * @example\n * const s: TrianglePatternState = {\n * kind: \"triangle-pattern\",\n * anchors: [\n * { time: 2, price: 0.5 },\n * { time: 0, price: 1 },\n * { time: 0, price: 0 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type TrianglePatternState = DrawingMeta & {\n readonly kind: \"triangle-pattern\";\n readonly anchors: AnchorTriple;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `three-drives-pattern` — six-leg three-drives reversal pattern.\n *\n * @formula three fib-ratio drives + two corrective retracements\n * @anchors anchors: [start, drive1, retr1, drive2, retr2, drive3, end]\n * @since 0.3\n * @stable\n * @example\n * const s: ThreeDrivesPatternState = {\n * kind: \"three-drives-pattern\",\n * anchors: [\n * { time: 0, price: 0 }, { time: 1, price: 1 },\n * { time: 2, price: 0.5 }, { time: 3, price: 1.5 },\n * { time: 4, price: 1 }, { time: 5, price: 2 },\n * { time: 6, price: 1.5 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type ThreeDrivesPatternState = DrawingMeta & {\n readonly kind: \"three-drives-pattern\";\n readonly anchors: AnchorHept;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `elliott-impulse-wave` — five-wave impulse (1-2-3-4-5).\n *\n * @formula identity — five-pivot polyline; per-leg fib invariants validated\n * in the per-category port (Task 16)\n * @anchors anchors: [wave1End, wave2End, wave3End, wave4End, wave5End]; labels?\n * @since 0.3\n * @stable\n * @example\n * const s: ElliottImpulseWaveState = {\n * kind: \"elliott-impulse-wave\",\n * anchors: [\n * { time: 0, price: 0 }, { time: 1, price: 1 },\n * { time: 2, price: 0.5 }, { time: 3, price: 1.5 },\n * { time: 4, price: 1 },\n * ],\n * labels: [\"1\", \"2\", \"3\", \"4\", \"5\"],\n * style: {},\n * };\n * void s;\n */\nexport type ElliottImpulseWaveState = DrawingMeta & {\n readonly kind: \"elliott-impulse-wave\";\n readonly anchors: AnchorQuint;\n readonly labels?: ReadonlyArray<string>;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `elliott-correction-wave` — three-wave A-B-C correction.\n *\n * @formula identity — three-pivot polyline\n * @anchors anchors: [A, B, C]; labels?\n * @since 0.3\n * @stable\n * @example\n * const s: ElliottCorrectionWaveState = {\n * kind: \"elliott-correction-wave\",\n * anchors: [\n * { time: 0, price: 1 },\n * { time: 1, price: 0 },\n * { time: 2, price: 0.5 },\n * ],\n * labels: [\"A\", \"B\", \"C\"],\n * style: {},\n * };\n * void s;\n */\nexport type ElliottCorrectionWaveState = DrawingMeta & {\n readonly kind: \"elliott-correction-wave\";\n readonly anchors: AnchorTriple;\n readonly labels?: ReadonlyArray<string>;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `elliott-triangle-wave` — five-wave triangle correction.\n *\n * @formula identity — five-pivot polyline matching triangle invariants\n * @anchors anchors: [a, b, c, d, e]; labels?\n * @since 0.3\n * @stable\n * @example\n * const s: ElliottTriangleWaveState = {\n * kind: \"elliott-triangle-wave\",\n * anchors: [\n * { time: 0, price: 1 }, { time: 1, price: 0 },\n * { time: 2, price: 0.8 }, { time: 3, price: 0.2 },\n * { time: 4, price: 0.5 },\n * ],\n * labels: [\"a\", \"b\", \"c\", \"d\", \"e\"],\n * style: {},\n * };\n * void s;\n */\nexport type ElliottTriangleWaveState = DrawingMeta & {\n readonly kind: \"elliott-triangle-wave\";\n readonly anchors: AnchorQuint;\n readonly labels?: ReadonlyArray<string>;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `elliott-double-combo` — seven-anchor W-X-Y double-three.\n *\n * @formula identity — seven-pivot polyline: W three-wave + X + Y three-wave\n * @anchors anchors: [start, W-end, x1, X-end, x2, Y-mid, Y-end]; labels?\n * @since 0.3\n * @stable\n * @example\n * const s: ElliottDoubleComboState = {\n * kind: \"elliott-double-combo\",\n * anchors: [\n * { time: 0, price: 0 }, { time: 1, price: 1 },\n * { time: 2, price: 0.5 }, { time: 3, price: 1.5 },\n * { time: 4, price: 1 }, { time: 5, price: 2 },\n * { time: 6, price: 1.5 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type ElliottDoubleComboState = DrawingMeta & {\n readonly kind: \"elliott-double-combo\";\n readonly anchors: AnchorHept;\n readonly labels?: ReadonlyArray<string>;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `elliott-triple-combo` — seven-anchor W-X-Y-X-Z triple-three.\n *\n * @formula identity — seven-pivot polyline: three corrective patterns joined by X waves\n * @anchors anchors: [start, W-end, X1-end, Y-end, X2-end, Z-mid, Z-end]; labels?\n * @since 0.3\n * @stable\n * @example\n * const s: ElliottTripleComboState = {\n * kind: \"elliott-triple-combo\",\n * anchors: [\n * { time: 0, price: 0 }, { time: 1, price: 1 },\n * { time: 2, price: 0.5 }, { time: 3, price: 1.5 },\n * { time: 4, price: 1 }, { time: 5, price: 2 },\n * { time: 6, price: 1.5 },\n * ],\n * style: {},\n * };\n * void s;\n */\nexport type ElliottTripleComboState = DrawingMeta & {\n readonly kind: \"elliott-triple-combo\";\n readonly anchors: AnchorHept;\n readonly labels?: ReadonlyArray<string>;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `cyclic-lines` — equally spaced vertical lines marking cycle periods.\n *\n * @formula vertical lines at t = A.time + n·(B.time − A.time) for n ∈ ℕ\n * @anchors anchors: [cycleStart, cycleEnd]\n * @since 0.3\n * @stable\n * @example\n * const s: CyclicLinesState = {\n * kind: \"cyclic-lines\",\n * anchors: [{ time: 0, price: 0 }, { time: 100, price: 0 }],\n * style: {},\n * };\n * void s;\n */\nexport type CyclicLinesState = DrawingMeta & {\n readonly kind: \"cyclic-lines\";\n readonly anchors: AnchorPair;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `time-cycles` — concentric semicircles measuring time cycles.\n *\n * @formula semicircles of radius n·|AB| centred at A for n ∈ ℕ\n * @anchors anchors: [centre, edge]\n * @since 0.3\n * @stable\n * @example\n * const s: TimeCyclesState = {\n * kind: \"time-cycles\",\n * anchors: [{ time: 0, price: 0 }, { time: 100, price: 0 }],\n * style: {},\n * };\n * void s;\n */\nexport type TimeCyclesState = DrawingMeta & {\n readonly kind: \"time-cycles\";\n readonly anchors: AnchorPair;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `sine-line` — sinusoidal projection fitted between two anchors.\n *\n * @formula y(t) = (A.price + B.price)/2 + ((B.price − A.price)/2)·sin(2π·(t − A.time)/(B.time − A.time))\n * @anchors anchors: [periodStart, periodEnd]\n * @since 0.3\n * @stable\n * @example\n * const s: SineLineState = {\n * kind: \"sine-line\",\n * anchors: [{ time: 0, price: 0 }, { time: 100, price: 1 }],\n * style: {},\n * };\n * void s;\n */\nexport type SineLineState = DrawingMeta & {\n readonly kind: \"sine-line\";\n readonly anchors: AnchorPair;\n readonly style: LineDrawStyle;\n};\n\n/**\n * `group` — logical container for child drawings. Children are\n * referenced by handle id; rendering is delegated to the children.\n *\n * @formula N/A — pure container; rendering passes through to children\n * @anchors N/A — group carries no geometry, only child references\n * @since 0.3\n * @stable\n * @example\n * const s: GroupState = {\n * kind: \"group\",\n * childHandleIds: [\"h1\", \"h2\"],\n * };\n * void s;\n */\nexport type GroupState = DrawingMeta & {\n readonly kind: \"group\";\n readonly childHandleIds: ReadonlyArray<string>;\n readonly meta?: Readonly<Record<string, JsonValue>>;\n};\n\n/**\n * `frame` — labelled rectangle container around child drawings. Carries\n * a background colour + label per {@link FrameOpts}.\n *\n * @formula identity — labelled bounding rectangle around `childHandleIds`\n * @anchors anchors: [topLeft, bottomRight]\n * @since 0.3\n * @stable\n * @example\n * const s: FrameState = {\n * kind: \"frame\",\n * anchors: [{ time: 0, price: 0 }, { time: 1, price: 1 }],\n * childHandleIds: [],\n * style: { label: \"Idea\" },\n * };\n * void s;\n */\nexport type FrameState = DrawingMeta & {\n readonly kind: \"frame\";\n readonly anchors: AnchorPair;\n readonly childHandleIds: ReadonlyArray<string>;\n readonly style: FrameOpts;\n};\n\n/**\n * `table` — CSS-pixel viewport-anchored dashboard/status panel. It\n * deliberately carries no world-space anchors; adapters resolve\n * `position` against the current viewport.\n *\n * @formula N/A — table layout resolved in CSS pixels by adapter\n * @anchors position: CSS viewport anchor\n * @since 0.5\n * @stable\n * @example\n * const s: TableState = {\n * kind: \"table\",\n * position: \"top-right\",\n * cells: [[{ text: \"P&L\" }, { text: \"+12.5%\", textColor: \"#16a34a\" }]],\n * };\n * void s;\n */\nexport type TableState = DrawingMeta & {\n readonly kind: \"table\";\n readonly position: TablePosition;\n readonly cells: ReadonlyArray<ReadonlyArray<TableCell>>;\n readonly borderColor?: Color;\n readonly borderWidth?: number;\n readonly frame?: Readonly<{ color: Color; width: number }>;\n};\n\n/**\n * Per-kind state union — every {@link DrawingKind} maps to exactly one\n * variant. Collab-only fields (Yjs `id`, `layerId`, `createdAt`,\n * `authorId`, `parentGroupId`, `parentFrameId`, `visibleIntervals`)\n * from the invinite source are stripped.\n *\n * The 62 variants here are intentionally minimal shells. Tasks 5–18\n * (per-category ports) refine each variant's geometry + style payload\n * against the invinite source-of-truth. Exhaustiveness is asserted via\n * the `(k satisfies never)` switch in `drawingState.types.test.ts`.\n *\n * @formula discriminated union — switch on `state.kind` to read variant\n * @anchors per-variant — see the individual `*State` declarations above\n * @since 0.3\n * @stable\n * @example\n * const s: DrawingState = {\n * kind: \"horizontal-line\",\n * price: 100,\n * style: { color: \"#3b82f6\" },\n * };\n * void s;\n */\nexport type DrawingState =\n | LineState\n | HorizontalLineState\n | HorizontalRayState\n | VerticalLineState\n | CrossLineState\n | TrendAngleState\n | RectangleState\n | RotatedRectangleState\n | TriangleState\n | PolylineState\n | CircleState\n | EllipseState\n | PathState\n | MarkerState\n | ArcState\n | CurveState\n | DoubleCurveState\n | PenState\n | HighlighterState\n | BrushState\n | TextState\n | ArrowState\n | ArrowMarkerState\n | ArrowMarkUpState\n | ArrowMarkDownState\n | TrendChannelState\n | FlatTopBottomState\n | DisjointChannelState\n | RegressionTrendState\n | FibRetracementState\n | FibTrendExtensionState\n | FibChannelState\n | FibTimeZoneState\n | FibWedgeState\n | FibSpeedFanState\n | FibSpeedArcsState\n | FibSpiralState\n | FibCirclesState\n | FibTrendTimeState\n | GannBoxState\n | GannSquareFixedState\n | GannSquareState\n | GannFanState\n | PitchforkState\n | PitchfanState\n | XabcdPatternState\n | CypherPatternState\n | HeadAndShouldersState\n | AbcdPatternState\n | TrianglePatternState\n | ThreeDrivesPatternState\n | ElliottImpulseWaveState\n | ElliottCorrectionWaveState\n | ElliottTriangleWaveState\n | ElliottDoubleComboState\n | ElliottTripleComboState\n | CyclicLinesState\n | TimeCyclesState\n | SineLineState\n | GroupState\n | FrameState\n | TableState;\n"]}
@@ -2,7 +2,7 @@ import type { Color, LineStyle } from "../types.js";
2
2
  /**
3
3
  * Line / ray / horizontal-line / vertical-line / channel-edge stroke
4
4
  * style. `extendLeft` / `extendRight` collapse the invinite `ray` and
5
- * `extended-line` tools into a single `line` kind (PLAN.md §3.1).
5
+ * `extended-line` tools into a single `line` kind.
6
6
  *
7
7
  * @formula N/A — style bag, no math
8
8
  * @anchors N/A — style fields only
@@ -1 +1 @@
1
- {"version":3,"file":"drawingStyle.js","sourceRoot":"","sources":["../../src/draw/drawingStyle.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D"}
1
+ {"version":3,"file":"drawingStyle.js","sourceRoot":"","sources":["../../src/draw/drawingStyle.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 { Color, LineStyle } from \"../types.js\";\n\n/**\n * Line / ray / horizontal-line / vertical-line / channel-edge stroke\n * style. `extendLeft` / `extendRight` collapse the invinite `ray` and\n * `extended-line` tools into a single `line` kind.\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const s: LineDrawStyle = { color: \"#3b82f6\", lineWidth: 2, lineStyle: \"solid\" };\n * void s;\n */\nexport type LineDrawStyle = {\n readonly color?: Color;\n readonly lineWidth?: number;\n readonly lineStyle?: LineStyle;\n readonly extendLeft?: boolean;\n readonly extendRight?: boolean;\n};\n\n/**\n * Filled-shape style — rectangles, triangles, ellipses, circles. `fill`\n * is paired with `fillAlpha` for the transparent overlay; `stroke` +\n * `lineStyle` paint the outline.\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const s: ShapeStyle = {\n * stroke: \"#3b82f6\",\n * fill: \"#dbeafe\",\n * fillAlpha: 0.4,\n * lineWidth: 1,\n * lineStyle: \"solid\",\n * };\n * void s;\n */\nexport type ShapeStyle = {\n readonly stroke?: Color;\n readonly fill?: Color;\n readonly lineWidth?: number;\n readonly lineStyle?: LineStyle;\n readonly fillAlpha?: number;\n};\n\n/**\n * Highlighter style — single colour with a fixed alpha. Used by the\n * `highlighter` freehand kind.\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const s: HighlighterStyle = { color: \"#facc15\", alpha: 0.3 };\n * void s;\n */\nexport type HighlighterStyle = {\n readonly color: Color;\n readonly alpha: number;\n};\n\n/**\n * Brush stroke style — stroke + fill pair. Used by the `brush`\n * freehand kind.\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const s: BrushStyle = { stroke: \"#000000\", fill: \"#ffffff\" };\n * void s;\n */\nexport type BrushStyle = {\n readonly stroke: Color;\n readonly fill: Color;\n};\n\n/**\n * Text annotation style. Used by the `text` annotation kind and as\n * the base for `marker` / `arrow-mark-up` / `arrow-mark-down` labels.\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const t: TextOpts = {\n * color: \"#1e293b\",\n * size: \"normal\",\n * halign: \"center\",\n * valign: \"middle\",\n * bgColor: \"#fef3c7\",\n * };\n * void t;\n */\nexport type TextOpts = {\n readonly color?: Color;\n readonly size?: \"tiny\" | \"small\" | \"normal\" | \"large\" | \"huge\";\n readonly halign?: \"left\" | \"center\" | \"right\";\n readonly valign?: \"top\" | \"middle\" | \"bottom\";\n readonly bgColor?: Color;\n};\n\n/**\n * Arrow annotation style — a `LineDrawStyle` plus an optional label.\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const a: ArrowOpts = { color: \"#dc2626\", lineWidth: 2, label: \"Sell\" };\n * void a;\n */\nexport type ArrowOpts = LineDrawStyle & {\n readonly label?: string;\n};\n\n/**\n * Arrow-marker style — used by `arrow-marker` / `arrow-mark-up` /\n * `arrow-mark-down` annotations. Compact glyph + optional one-line\n * text.\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const m: ArrowMarkerOpts = { color: \"#10b981\", text: \"Long\" };\n * void m;\n */\nexport type ArrowMarkerOpts = {\n readonly color?: Color;\n readonly text?: string;\n};\n\n/**\n * Path style — open or closed polyline of arbitrary anchor count.\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const p: PathOpts = { color: \"#3b82f6\", lineWidth: 1, closed: true };\n * void p;\n */\nexport type PathOpts = LineDrawStyle & {\n readonly closed?: boolean;\n};\n\n/**\n * Fibonacci-family style. `levels` defaults to the canonical\n * 0.236 / 0.382 / 0.5 / 0.618 / 0.786 / 1.0 / 1.272 / 1.618 / 2.618 /\n * 4.236 array when omitted; `showLabels` toggles per-level text.\n * `extendLeft` / `extendRight` apply to the level lines (mirrors the\n * `LineDrawStyle` collapse for parity).\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const f: FibOpts = {\n * levels: [0.382, 0.5, 0.618],\n * showLabels: true,\n * color: \"#facc15\",\n * extendRight: true,\n * };\n * void f;\n */\nexport type FibOpts = {\n readonly levels?: ReadonlyArray<number>;\n readonly showLabels?: boolean;\n readonly color?: Color;\n readonly extendLeft?: boolean;\n readonly extendRight?: boolean;\n};\n\n/**\n * Regression-trend style — a least-squares fit through a price series\n * with optional ±N·σ bands. `source` picks the OHLC derived series.\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const r: RegressionTrendOpts = {\n * source: \"close\",\n * stdevMultiplier: 2,\n * showUpperBand: true,\n * showLowerBand: true,\n * color: \"#3b82f6\",\n * };\n * void r;\n */\nexport type RegressionTrendOpts = {\n readonly source?: \"close\" | \"open\" | \"high\" | \"low\" | \"hl2\" | \"hlc3\" | \"ohlc4\" | \"hlcc4\";\n readonly stdevMultiplier?: number;\n readonly showUpperBand?: boolean;\n readonly showLowerBand?: boolean;\n readonly color?: Color;\n};\n\n/**\n * Frame container style — the labelled rectangle that groups child\n * drawings visually. The label appears in the top-left of the frame\n * unless the adapter chooses otherwise.\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const f: FrameOpts = { label: \"Trade idea\", bgColor: \"#f1f5f9\" };\n * void f;\n */\nexport type FrameOpts = {\n readonly label?: string;\n readonly bgColor?: Color;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"handle.js","sourceRoot":"","sources":["../../src/draw/handle.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D"}
1
+ {"version":3,"file":"handle.js","sourceRoot":"","sources":["../../src/draw/handle.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 { DrawingState } from \"./drawingState.js\";\n\n/**\n * Script-facing handle returned by every `draw.<kind>(...)` call. The\n * runtime keys handles by `slotId#subId` so a script's `for` loop\n * emitting N drawings gets N stable cross-bar handles — same loop\n * iteration across bars yields the same handle.\n *\n * `update(patch)` re-emits the FULL merged state under `op: \"update\"`\n * (the patch is merged with the handle's current `DrawingState` in the\n * runtime); `remove()` emits one final `op: \"remove\"` with the last\n * known state. The impl lives in\n * `@invinite-org/chartlang-runtime/emit/draw/handle.ts` (Task 3).\n *\n * @formula N/A — handle is an opaque script-facing object\n * @anchors id (slotId#subId), update(patch), remove()\n * @since 0.3\n * @stable\n * @example\n * // Inside a compiled `compute`:\n * // const h = draw.horizontalLine(supportLevel);\n * // h.update({ price: nextLevel });\n * // h.remove();\n * import type { DrawingHandle } from \"@invinite-org/chartlang-core\";\n * const _shape: DrawingHandle | null = null;\n * void _shape;\n */\nexport type DrawingHandle = {\n readonly id: string;\n update(patch: Partial<DrawingState>): void;\n remove(): void;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/draw/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEjF,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AA0FtD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/draw/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEjF,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AA0FtD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,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 { DRAWING_KINDS, KIND_CAMELCASE, KIND_KEBABCASE } from \"./drawingKind.js\";\nexport type { DrawingKind } from \"./drawingKind.js\";\nexport { bucketFor, KIND_BUCKET } from \"./buckets.js\";\nexport type { DrawingBucket } from \"./buckets.js\";\nexport type {\n AnchorHept,\n AnchorPair,\n AnchorQuad,\n AnchorQuint,\n AnchorTriple,\n WorldPoint,\n} from \"./worldPoint.js\";\nexport type {\n ArrowMarkerOpts,\n ArrowOpts,\n BrushStyle,\n FibOpts,\n FrameOpts,\n HighlighterStyle,\n LineDrawStyle,\n PathOpts,\n RegressionTrendOpts,\n ShapeStyle,\n TextOpts,\n} from \"./drawingStyle.js\";\nexport type {\n AbcdPatternState,\n ArcState,\n ArrowMarkDownState,\n ArrowMarkUpState,\n ArrowMarkerState,\n ArrowState,\n BrushState,\n CircleState,\n CrossLineState,\n CurveState,\n CyclicLinesState,\n CypherPatternState,\n DisjointChannelState,\n DoubleCurveState,\n DrawingMeta,\n DrawingState,\n ElliottCorrectionWaveState,\n ElliottDoubleComboState,\n ElliottImpulseWaveState,\n ElliottTripleComboState,\n ElliottTriangleWaveState,\n EllipseState,\n FibChannelState,\n FibCirclesState,\n FibRetracementState,\n FibSpeedArcsState,\n FibSpeedFanState,\n FibSpiralState,\n FibTimeZoneState,\n FibTrendExtensionState,\n FibTrendTimeState,\n FibWedgeState,\n FlatTopBottomState,\n FrameState,\n GannBoxState,\n GannFanState,\n GannSquareFixedState,\n GannSquareState,\n GroupState,\n HeadAndShouldersState,\n HighlighterState,\n HorizontalLineState,\n HorizontalRayState,\n LineState,\n MarkerState,\n PathState,\n PenState,\n PitchfanState,\n PitchforkState,\n PolylineState,\n RectangleState,\n RegressionTrendState,\n RotatedRectangleState,\n SineLineState,\n TableState,\n TextState,\n ThreeDrivesPatternState,\n TimeCyclesState,\n TrendAngleState,\n TrendChannelState,\n TriangleState,\n TrianglePatternState,\n VerticalLineState,\n XabcdPatternState,\n} from \"./drawingState.js\";\nexport type { DrawingHandle } from \"./handle.js\";\nexport { table } from \"./table.js\";\nexport type { TableCell, TableOpts, TablePosition } from \"./table.js\";\nexport { draw } from \"./draw.js\";\nexport type { DrawNamespace } from \"./draw.js\";\n"]}
@@ -3,7 +3,7 @@ import type { DrawingHandle } from "./handle.js";
3
3
  /**
4
4
  * CSS-pixel viewport anchor used by `draw.table`. Tables are status
5
5
  * panels, not world-space drawings, so the position resolves against
6
- * the adapter viewport per PLAN.md §10.2.
6
+ * the adapter viewport.
7
7
  *
8
8
  * @formula N/A — viewport anchor enum
9
9
  * @anchors CSS viewport edge/corner/center
@@ -1 +1 @@
1
- {"version":3,"file":"table.js","sourceRoot":"","sources":["../../src/draw/table.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AA8E/D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,KAAK,CAAC,KAAgB;IAClC,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;AAClE,CAAC"}
1
+ {"version":3,"file":"table.js","sourceRoot":"","sources":["../../src/draw/table.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AA8E/D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,KAAK,CAAC,KAAgB;IAClC,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;AAClE,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 { Color } from \"../types.js\";\nimport type { DrawingHandle } from \"./handle.js\";\n\n/**\n * CSS-pixel viewport anchor used by `draw.table`. Tables are status\n * panels, not world-space drawings, so the position resolves against\n * the adapter viewport.\n *\n * @formula N/A — viewport anchor enum\n * @anchors CSS viewport edge/corner/center\n * @since 0.5\n * @stable\n * @example\n * const position: TablePosition = \"top-right\";\n * void position;\n */\nexport type TablePosition =\n | \"top-left\"\n | \"top-center\"\n | \"top-right\"\n | \"middle-left\"\n | \"middle-center\"\n | \"middle-right\"\n | \"bottom-left\"\n | \"bottom-center\"\n | \"bottom-right\";\n\n/**\n * One cell in a `draw.table` dashboard. Text is required; styling\n * fields are optional and interpreted by the target adapter.\n *\n * @formula N/A — viewport table cell payload\n * @anchors table grid cell\n * @since 0.5\n * @stable\n * @example\n * const cell: TableCell = {\n * text: \"P&L\",\n * textColor: \"#16a34a\",\n * textHalign: \"right\",\n * };\n * void cell;\n */\nexport type TableCell = Readonly<{\n text: string;\n bgColor?: Color;\n textColor?: Color;\n textHalign?: \"left\" | \"center\" | \"right\";\n textValign?: \"top\" | \"middle\" | \"bottom\";\n textSize?: \"tiny\" | \"small\" | \"normal\" | \"large\" | \"huge\";\n}>;\n\n/**\n * Options accepted by `draw.table`.\n *\n * @formula N/A — viewport table payload\n * @anchors position: CSS viewport anchor; cells: 2D table grid\n * @since 0.5\n * @stable\n * @example\n * const opts: TableOpts = {\n * position: \"top-right\",\n * cells: [[{ text: \"P&L\" }, { text: \"+12.5%\", textColor: \"#16a34a\" }]],\n * borderColor: \"#94a3b8\",\n * borderWidth: 1,\n * };\n * void opts;\n */\nexport type TableOpts = Readonly<{\n position: TablePosition;\n cells: ReadonlyArray<ReadonlyArray<TableCell>>;\n borderColor?: Color;\n borderWidth?: number;\n frame?: Readonly<{ color: Color; width: number }>;\n}>;\n\n/**\n * Compile-time callable hole. The runtime swaps this for the slot-id\n * aware implementation, and the compiler injects the callsite id into\n * every script-side `draw.table(opts)` call.\n *\n * @formula N/A — compiler/runtime primitive seam\n * @anchors position + cells, viewport anchored\n * @since 0.5\n * @stable\n * @example\n * // Inside compute:\n * // const h = draw.table({\n * // position: \"top-right\",\n * // cells: [[{ text: \"P&L\" }, { text: \"+12.5%\", textColor: \"#16a34a\" }]],\n * // });\n */\nexport function table(_opts: TableOpts): DrawingHandle {\n throw new Error(\"draw.table called outside compiled runtime\");\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"worldPoint.js","sourceRoot":"","sources":["../../src/draw/worldPoint.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D"}
1
+ {"version":3,"file":"worldPoint.js","sourceRoot":"","sources":["../../src/draw/worldPoint.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 { Price, Time } from \"../types.js\";\n\n/**\n * World coordinate — `(time, price)` is the only persisted frame for\n * drawings. The adapter projects to its own pixel space when rendering.\n *\n * @formula identity — no transform; world-space (time, price) tuple\n * @anchors time, price\n * @since 0.3\n * @stable\n * @example\n * const anchor: WorldPoint = { time: 1_700_000_000_000, price: 42.31 };\n * void anchor;\n */\nexport type WorldPoint = {\n readonly time: Time;\n readonly price: Price;\n};\n\n/**\n * Two anchor points — e.g. the two endpoints of a line, the two corners\n * of an axis-aligned rectangle.\n *\n * @formula identity — readonly tuple of two `WorldPoint`s\n * @anchors [WorldPoint, WorldPoint]\n * @since 0.3\n * @stable\n * @example\n * const segment: AnchorPair = [\n * { time: 1_700_000_000_000, price: 100 },\n * { time: 1_700_086_400_000, price: 110 },\n * ];\n * void segment;\n */\nexport type AnchorPair = readonly [WorldPoint, WorldPoint];\n\n/**\n * Three anchor points — e.g. triangle vertices, pitchfork pivot + two\n * extreme highs/lows.\n *\n * @formula identity — readonly tuple of three `WorldPoint`s\n * @anchors [WorldPoint, WorldPoint, WorldPoint]\n * @since 0.3\n * @stable\n * @example\n * const tri: AnchorTriple = [\n * { time: 1, price: 1 },\n * { time: 2, price: 2 },\n * { time: 3, price: 1 },\n * ];\n * void tri;\n */\nexport type AnchorTriple = readonly [WorldPoint, WorldPoint, WorldPoint];\n\n/**\n * Four anchor points — e.g. ABCD harmonic pattern legs, rotated\n * rectangle corners.\n *\n * @formula identity — readonly tuple of four `WorldPoint`s\n * @anchors [WorldPoint × 4]\n * @since 0.3\n * @stable\n * @example\n * const abcd: AnchorQuad = [\n * { time: 1, price: 1 },\n * { time: 2, price: 2 },\n * { time: 3, price: 1.5 },\n * { time: 4, price: 3 },\n * ];\n * void abcd;\n */\nexport type AnchorQuad = readonly [WorldPoint, WorldPoint, WorldPoint, WorldPoint];\n\n/**\n * Five anchor points — e.g. XABCD harmonic pattern legs,\n * head-and-shoulders pivots, Elliott impulse waves.\n *\n * @formula identity — readonly tuple of five `WorldPoint`s\n * @anchors [WorldPoint × 5]\n * @since 0.3\n * @stable\n * @example\n * const xabcd: AnchorQuint = [\n * { time: 1, price: 1 },\n * { time: 2, price: 2 },\n * { time: 3, price: 1.5 },\n * { time: 4, price: 3 },\n * { time: 5, price: 2 },\n * ];\n * void xabcd;\n */\nexport type AnchorQuint = readonly [WorldPoint, WorldPoint, WorldPoint, WorldPoint, WorldPoint];\n\n/**\n * Seven anchor points — e.g. Elliott triple-combo legs, double-curve\n * control points.\n *\n * @formula identity — readonly tuple of seven `WorldPoint`s\n * @anchors [WorldPoint × 7]\n * @since 0.3\n * @stable\n * @example\n * const triple: AnchorHept = [\n * { time: 1, price: 1 }, { time: 2, price: 2 },\n * { time: 3, price: 1.5 }, { time: 4, price: 3 },\n * { time: 5, price: 2 }, { time: 6, price: 4 },\n * { time: 7, price: 3 },\n * ];\n * void triple;\n */\nexport type AnchorHept = readonly [\n WorldPoint,\n WorldPoint,\n WorldPoint,\n WorldPoint,\n WorldPoint,\n WorldPoint,\n WorldPoint,\n];\n"]}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- export type { AlertSeverity, AlertConditionDefinition, AlertConditionDescriptor, Bar, BarViewport, CapabilityId, Color, CompiledScriptObject, ComputeContext, ComputeFn, DrawingCounts, InputSchema, IntervalDescriptor, JsonValue, LineStyle, PlotLineStyle, Price, ScriptManifest, Series, Time, Volume, } from "./types.js";
1
+ export type { AlertSeverity, AlertConditionDefinition, AlertConditionDescriptor, Bar, BarViewport, CapabilityId, Color, CompiledScriptBundle, CompiledScriptObject, ComputeContext, ComputeFn, DrawingCounts, InputSchema, IntervalDescriptor, JsonValue, LineStyle, PlotLineStyle, PlotOverride, PlotSlotDescriptor, Price, ScriptManifest, Series, Time, Volume, } from "./types.js";
2
+ export { isCompiledScriptBundle } from "./types.js";
2
3
  export { intervalToSeconds } from "./interval/intervalToSeconds.js";
3
4
  export { defineAlert, defineAlertCondition, defineDrawing, defineIndicator, } from "./define/index.js";
4
- export type { DefineAlertConditionOpts, DefineAlertOpts, DefineDrawingOpts, DefineIndicatorOpts, ScaleAxis, ScriptOverrides, ValueFormat, } from "./define/index.js";
5
+ export type { DefineAlertConditionOpts, DefineAlertOpts, DefineDrawingOpts, DefineIndicatorOpts, DependencyDeclaration, OutputDeclaration, ScaleAxis, ScriptOverrides, ValueFormat, } from "./define/index.js";
5
6
  export { ta } from "./ta/index.js";
6
7
  export type { AdlOpts, AdrOpts, AdxOpts, AlmaOpts, AnchoredVolumeProfileOpts, AnchoredVolumeProfileResult, AnchoredVwapOpts, AoOpts, AroonOpts, AroonOscOpts, AroonResult, AtrOpts, BarssinceOpts, BbOpts, BbPercentBOpts, BbResult, BbwOpts, BopOpts, CciOpts, ChandeKrollStopOpts, ChandeKrollStopResult, ChandelierOpts, ChaikinOscOpts, ChandelierResult, ChangeOpts, ChopOpts, CmfOpts, CmoOpts, ConnorsRsiOpts, CoppockOpts, CrossoverOpts, CrossunderOpts, DemaOpts, DmiOpts, DmiResult, DonchianOpts, DonchianResult, DpoOpts, EmaOpts, EomOpts, EnvelopeOpts, EnvelopeResult, FisherOpts, FisherResult, FixedRangeVolumeProfileOpts, FixedRangeVolumeProfileResult, HighestOpts, HmaOpts, HvOpts, IchimokuOpts, IchimokuResult, KamaOpts, KeltnerOpts, KeltnerResult, KlingerOpts, KlingerResult, KstOpts, KstResult, LowestOpts, LsmaOpts, MacdOpts, MacdResult, MaRibbonOpts, MaRibbonResult, MassIndexOpts, MaTypeNoVolume, McginleyOpts, MedianOpts, MfiOpts, MomentumOpts, NetVolumeOpts, NviOpts, ObvOpts, PivotsHighLowOpts, PivotsHighLowResult, PivotsStandardOpts, PivotsStandardResult, PivotsStandardSystem, PmoOpts, PmoResult, PpoOpts, PpoResult, PsarOpts, PsarResult, PviOpts, PvoOpts, PvoResult, PvtOpts, RocOpts, RsiOpts, RvgiOpts, RvgiResult, RviOpts, SessionVolumeProfileOpts, SessionVolumeProfileResult, SmaOpts, SmiOpts, SmiResult, SmmaOpts, StdevOpts, StochOpts, StochResult, StochRsiOpts, StochRsiResult, SupertrendOpts, SupertrendResult, TaNamespace, TemaOpts, TrendStrengthIndexOpts, TrixOpts, TrixResult, TsiOpts, TsiResult, UlcerIndexOpts, UltimateOscOpts, ValuewhenOpts, VolOpts, VolatilityStopOpts, VolatilityStopResult, VortexOpts, VortexResult, VisibleRangeVolumeProfileOpts, VisibleRangeVolumeProfileResult, VwapOpts, VwmaOpts, WilliamsFractalOpts, WilliamsFractalResult, WilliamsROpts, WmaOpts, ZigZagOpts, ZigZagResult, } from "./ta/ta.js";
7
8
  export type { StatefulPrimitiveEntry } from "./statefulPrimitives.js";
@@ -9,7 +10,7 @@ export { input } from "./input/index.js";
9
10
  export type { BoolDescriptor, ColorDescriptor, EnumDescriptor, ExternalSeriesDescriptor, FloatDescriptor, InputDescriptor, InputKind, IntDescriptor, IntervalDescriptorInput, PriceDescriptor, Schema, SourceDescriptor, SourceField, StringDescriptor, SymbolDescriptor, TimeDescriptor, } from "./input/index.js";
10
11
  export { state } from "./state/index.js";
11
12
  export type { MutableSlot, StateNamespace } from "./state/index.js";
12
- export type { StateSnapshot, StateStoreKey, StreamSnapshot } from "./state/index.js";
13
+ export type { RunnerSnapshot, StateSnapshot, StateStoreKey, StreamSnapshot, } from "./state/index.js";
13
14
  export { barstate, syminfo, timeframe } from "./views/index.js";
14
15
  export type { BarStateView, SymbolType, SymInfoView, TimeframeView } from "./views/index.js";
15
16
  export { request } from "./request/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,YAAY,EACR,aAAa,EACb,wBAAwB,EACxB,wBAAwB,EACxB,GAAG,EACH,WAAW,EACX,YAAY,EACZ,KAAK,EACL,oBAAoB,EACpB,cAAc,EACd,SAAS,EACT,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,aAAa,EACb,KAAK,EACL,cAAc,EACd,MAAM,EACN,IAAI,EACJ,MAAM,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EACH,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,eAAe,GAClB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACR,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,SAAS,EACT,eAAe,EACf,WAAW,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AACnC,YAAY,EACR,OAAO,EACP,OAAO,EACP,OAAO,EACP,QAAQ,EACR,yBAAyB,EACzB,2BAA2B,EAC3B,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,YAAY,EACZ,WAAW,EACX,OAAO,EACP,aAAa,EACb,MAAM,EACN,cAAc,EACd,QAAQ,EACR,OAAO,EACP,OAAO,EACP,OAAO,EACP,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,OAAO,EACP,OAAO,EACP,cAAc,EACd,WAAW,EACX,aAAa,EACb,cAAc,EACd,QAAQ,EACR,OAAO,EACP,SAAS,EACT,YAAY,EACZ,cAAc,EACd,OAAO,EACP,OAAO,EACP,OAAO,EACP,YAAY,EACZ,cAAc,EACd,UAAU,EACV,YAAY,EACZ,2BAA2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{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,YAAY,EACR,aAAa,EACb,wBAAwB,EACxB,wBAAwB,EACxB,GAAG,EACH,WAAW,EACX,YAAY,EACZ,KAAK,EACL,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,SAAS,EACT,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,KAAK,EACL,cAAc,EACd,MAAM,EACN,IAAI,EACJ,MAAM,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EACH,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,eAAe,GAClB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACR,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,WAAW,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AACnC,YAAY,EACR,OAAO,EACP,OAAO,EACP,OAAO,EACP,QAAQ,EACR,yBAAyB,EACzB,2BAA2B,EAC3B,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,YAAY,EACZ,WAAW,EACX,OAAO,EACP,aAAa,EACb,MAAM,EACN,cAAc,EACd,QAAQ,EACR,OAAO,EACP,OAAO,EACP,OAAO,EACP,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,OAAO,EACP,OAAO,EACP,cAAc,EACd,WAAW,EACX,aAAa,EACb,cAAc,EACd,QAAQ,EACR,OAAO,EACP,SAAS,EACT,YAAY,EACZ,cAAc,EACd,OAAO,EACP,O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BAAoB,EACpB,iBAAiB,EACjB,UAAU,EACV,iBAAiB,GACpB,MAAM,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  // Copyright (c) 2026 Invinite. Licensed under the MIT License.
2
2
  // See the LICENSE file in the repo root for full license text.
3
+ export { isCompiledScriptBundle } from "./types.js";
3
4
  export { intervalToSeconds } from "./interval/intervalToSeconds.js";
4
5
  export { defineAlert, defineAlertCondition, defineDrawing, defineIndicator, } from "./define/index.js";
5
6
  export { ta } from "./ta/index.js";