@invinite-org/chartlang-core 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/README.md +6 -1
  3. package/dist/define/defineAlert.d.ts.map +1 -1
  4. package/dist/define/defineAlert.js +3 -2
  5. package/dist/define/defineAlert.js.map +1 -1
  6. package/dist/define/defineAlertCondition.d.ts.map +1 -1
  7. package/dist/define/defineAlertCondition.js +2 -1
  8. package/dist/define/defineAlertCondition.js.map +1 -1
  9. package/dist/define/defineDrawing.d.ts.map +1 -1
  10. package/dist/define/defineDrawing.js +3 -2
  11. package/dist/define/defineDrawing.js.map +1 -1
  12. package/dist/define/defineIndicator.d.ts +11 -0
  13. package/dist/define/defineIndicator.d.ts.map +1 -1
  14. package/dist/define/defineIndicator.js +5 -2
  15. package/dist/define/defineIndicator.js.map +1 -1
  16. package/dist/define/depAccessorSentinel.d.ts +46 -0
  17. package/dist/define/depAccessorSentinel.d.ts.map +1 -0
  18. package/dist/define/depAccessorSentinel.js +51 -0
  19. package/dist/define/depAccessorSentinel.js.map +1 -0
  20. package/dist/define/dependency.d.ts +63 -0
  21. package/dist/define/dependency.d.ts.map +1 -0
  22. package/dist/define/dependency.js +4 -0
  23. package/dist/define/dependency.js.map +1 -0
  24. package/dist/define/index.d.ts +1 -0
  25. package/dist/define/index.d.ts.map +1 -1
  26. package/dist/index.d.ts +4 -3
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +1 -0
  29. package/dist/index.js.map +1 -1
  30. package/dist/plot/plot.d.ts +24 -6
  31. package/dist/plot/plot.d.ts.map +1 -1
  32. package/dist/plot/plot.js.map +1 -1
  33. package/dist/state/index.d.ts +1 -1
  34. package/dist/state/index.d.ts.map +1 -1
  35. package/dist/state/snapshot.d.ts +37 -10
  36. package/dist/state/snapshot.d.ts.map +1 -1
  37. package/dist/types.d.ts +245 -0
  38. package/dist/types.d.ts.map +1 -1
  39. package/dist/types.js +17 -1
  40. package/dist/types.js.map +1 -1
  41. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,97 @@
1
1
  # @invinite-org/chartlang-core
2
2
 
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f0c8eb8: Add `CompiledScriptObject.output` / `.withInputs` sentinels, `DependencyDeclaration` + `OutputDeclaration` types, optional `dependencies` / `outputs` / `exportName` / `siblings` / `isDrawn` fields on `ScriptManifest`, `CompiledScriptBundle` + `isCompiledScriptBundle` narrowing helper, and six new `dep-*` `DiagnosticCode` entries (`dep-error`, `dep-cycle`, `dep-unknown-output`, `dep-invalid-input-override`, `dep-dynamic`, `dep-output-not-titled`). The compiler ambient shim is widened in lockstep so script source resolves the new surface. Additive within `apiVersion: 1`.
8
+ - 2123181: Structured `StateSnapshot` carrying per-runner slot sections (primary +
9
+ siblings + dependencies) so a `CompiledScriptBundle`'s cold-replay
10
+ emissions match its warm-restart emissions byte-identically. Slot keys
11
+ now carry the active runner's `slotIdPrefix` everywhere they reach a
12
+ `StateStore` (`dep:<localId>/` for deps, `export:<exportName>/` for
13
+ siblings, empty for the primary). Flat-shape snapshots from before this
14
+ release continue to load back-compat as primary-only.
15
+ - 2123181: Indicator composition (Phase 7 closeout): one chartlang indicator can
16
+ read another indicator's titled plot output as a typed `Series<number>`.
17
+
18
+ - Compose via local `const` binding plus `<binding>.output("title")` —
19
+ no new public API beyond the chainable `.output` / `.withInputs`
20
+ accessors on `CompiledScriptObject`.
21
+ - A single `.chart.ts` MAY declare a default export plus any number of
22
+ named exports plus any number of private `const` deps. Export form
23
+ determines render policy: drawn exports render with the
24
+ `export:<exportName>/` slot-id prefix; private `const` deps are data
25
+ feeds only and their visuals are dropped.
26
+ - Cross-file `import baseTrend from "./base-trend.chart"` resolves
27
+ recursively; shared producers inline exactly once per consumer.
28
+ - Additive within `apiVersion: 1.x`. The 172-entry
29
+ `STATEFUL_PRIMITIVES` set is unchanged. `DiagnosticCode` widens to 32
30
+ with the new `dep-*` codes (`dep-error`, `dep-cycle`,
31
+ `dep-unknown-output`, `dep-invalid-input-override`, `dep-dynamic`,
32
+ `dep-output-not-titled`).
33
+ - Five conformance scenarios in `@invinite-org/chartlang-conformance`
34
+ pin the runtime contract end-to-end (`dep-private-single-file`,
35
+ `dep-multi-export`, `dep-cross-file`, `dep-diamond`,
36
+ `dep-error-halts-parent`). `Scenario.additionalSources` lets
37
+ cross-file scenarios ship producer + consumer side-by-side.
38
+ - Two new example scripts in `examples/scripts/`:
39
+ `base-trend.chart.ts` (producer) + `trend-confirmation.chart.ts`
40
+ (multi-export consumer). React-demo gains a fifth catalogue entry
41
+ exercising the feature end-to-end in the browser.
42
+ - Docs: `docs/language/indicator-composition.md` narrative guide,
43
+ `docs/spec/manifest.md` + `docs/spec/semantics.md` +
44
+ `docs/spec/versioning.md` updates, five new glossary entries.
45
+
46
+ - 2123181: Light up the end-to-end cross-file dep path for indicator composition. The
47
+ compiler's `rewriteDependencyAccessors` transformer now collapses
48
+ `const <alias> = <root>.withInputs({...})...` chains to the bare root
49
+ identifier so the runtime sentinel never fires at module load; the merged
50
+ effective inputs flow through the `__dependencies[i].inputOverrides` slot
51
+ into the runtime's `DepRunner`. Cross-file producers' `@invinite-org/chartlang-core`
52
+ imports are hoisted above the inlined IIFE so esbuild dedupes them against
53
+ the consumer's imports and pulls in every symbol the producer uses
54
+ (`input.int`, `ta.ema`, …). The `__dependencies` export is now prepended
55
+ pre-bundle so esbuild's tree-shaker keeps each alias binding alive. The
56
+ `dep-cross-file` conformance scenario joins `ALL_SCENARIOS` and the suite
57
+ runs 225 scenarios green.
58
+ - 4d77f4d: Add the additive plot-override contract: `PlotSlotDescriptor`,
59
+ `PlotOverride`, `ScriptManifest.plots?`, `PlotEmission.visible?`, and
60
+ `Adapter.resolvePlotOverrides?`. `validateEmission` now accepts an
61
+ optional `visible: boolean` arm on plot emissions and rejects any
62
+ other type via the existing `malformed-emission` path.
63
+
64
+ No behavior changes ship in this contract step — every new field is
65
+ optional and absence keeps emissions byte-identical to today. The
66
+ compiler's ambient core shim gains `PlotSlotDescriptor` and the
67
+ `ScriptManifest.plots?` field so script-side `__manifest` consumers
68
+ stay in lockstep; `PlotOverride` is intentionally not shimmed (it is
69
+ runtime-/host-side only).
70
+
71
+ - 0427459: Persist `defineIndicator({ overlay })` onto `ScriptManifest.overlay?:
72
+ boolean` so the runtime has a script-level default-pane signal. Add
73
+ `HLineOpts.pane?: "overlay" | "new" | string` mirroring `PlotOpts.pane`
74
+ so hlines opt into the same pane router. The compiler's `buildManifest`
75
+ extracts the literal-boolean `overlay` from the `defineIndicator`
76
+ object literal via `extractOverrides` and emits it on the bundled
77
+ `__manifest`; the ambient core shim now carries `ScriptManifest.overlay?`
78
+ and `HLineOpts.pane?` to keep downstream packages type-aligned.
79
+
80
+ Step 1 of the `subpane-rendering` feature. Pure additive contract
81
+ change — every new field is optional and absence keeps existing
82
+ manifests / emissions byte-identical. The runtime, adapter, and demos
83
+ land in tasks 2-5.
84
+
85
+ ### Patch Changes
86
+
87
+ - d6d1a1f: Fix Phase-7 indicator composition where a producer's titled `plot(...)` outputs were never wired to consumers. The compiler computed each binding's `outputs` statically but only wrote them into the manifest sidecar, never onto the producer object's own `manifest.outputs` — so the runtime allocated no dep-output ring buffer and every `<binding>.output("title")` read returned NaN past warmup.
88
+
89
+ `defineIndicator` now copies an optional `outputs` opts field into the manifest (omitted ⇒ manifest byte-identical to a script with no titled plots), and the compiler bakes each producer binding's titled `outputs` into its `defineIndicator({...})` opts literal so private deps, named-export siblings, and cross-file producer defaults are self-describing at runtime. Output-free scripts are untouched. Additive within `apiVersion: 1`.
90
+
91
+ - 3b4952d: Remove the redundant `bars` plot kind. It was never reachable from the script-author API (`PlotOptsStyle` had no `bars` arm and the runtime `buildStyle` had no `case`), no `ta.*` primitive or example emitted it, and the canvas2d reference adapter declared it as a capability but never rendered it. It carried the same `{ baseline: number }` shape as `histogram`, so it was a dead arm of the `PlotKind` / wire-level `PlotStyle` unions.
92
+
93
+ `PlotKind`, the adapter-kit `PlotStyle` union, `validateEmission`, the `capabilities.bars()` / `PHASE_5_PLOT_KINDS` surfaces, and the canvas2d adapter's dead `bars.ts` renderer are all dropped. chartlang has no users yet, so this is a hard reset with no deprecation path. Authors who want columns use `histogram`.
94
+
3
95
  ## 1.0.1
4
96
 
5
97
  ### Patch Changes
package/README.md CHANGED
@@ -22,9 +22,14 @@ pnpm add @invinite-org/chartlang-core
22
22
  - Secondary stream: `request.security({ interval })` typed surface.
23
23
  - Emissions: `plot`, `hline`, `alert`, and the 61-kind `draw.*` namespace.
24
24
  - Registry: `STATEFUL_PRIMITIVES` for compiler slot-id injection.
25
+ - Indicator composition (Phase 7): `CompiledScriptObject.output(title)` /
26
+ `.withInputs(overrides)` accessors for binding one indicator's output to
27
+ another. Both are compiler-rewritten sentinels — direct invocation throws.
28
+ `isCompiledScriptBundle(v)` narrows the multi-script bundle.
25
29
  - Types: `Series<T>`, `Bar`, `InputDescriptor`, `MutableSlot<T>`,
26
30
  `ScriptManifest`, `ComputeContext`, `DrawingState`, `DrawingHandle`,
27
- `DrawingCounts`, `SecurityBar`, view types, and option/result types.
31
+ `DrawingCounts`, `SecurityBar`, view types, option/result types, plus
32
+ `DependencyDeclaration`, `OutputDeclaration`, `CompiledScriptBundle`.
28
33
 
29
34
  ## Minimum-viable API call
30
35
 
@@ -1 +1 @@
1
- {"version":3,"file":"defineAlert.d.ts","sourceRoot":"","sources":["../../src/define/defineAlert.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,KAAK,cAAc,GAAG,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,QAAQ,GAAG,WAAW,CAAC,CAAC;AAE9E;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,CAAC,CAAC;IACd,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,EAAE,SAAS,CAAC;CACtB,CAAC,GACE,cAAc,CAAC;AAEnB;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,oBAAoB,CA2BvE"}
1
+ {"version":3,"file":"defineAlert.d.ts","sourceRoot":"","sources":["../../src/define/defineAlert.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEhF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,KAAK,cAAc,GAAG,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,QAAQ,GAAG,WAAW,CAAC,CAAC;AAE9E;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,CAAC,CAAC;IACd,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,EAAE,SAAS,CAAC;CACtB,CAAC,GACE,cAAc,CAAC;AAEnB;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,oBAAoB,CA6BvE"}
@@ -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
+ import { attachDepAccessorSentinels } from "./depAccessorSentinel.js";
3
4
  /**
4
5
  * Construct a Phase-1 alert script object. Returns a frozen
5
6
  * `CompiledScriptObject` whose `manifest.kind` is `"alert"` and whose
@@ -41,9 +42,9 @@ export function defineAlert(opts) {
41
42
  : { requiresIntervals: opts.requiresIntervals }),
42
43
  ...(opts.shortName === undefined ? {} : { shortName: opts.shortName }),
43
44
  };
44
- return Object.freeze({
45
+ return Object.freeze(attachDepAccessorSentinels({
45
46
  manifest: Object.freeze(manifest),
46
47
  compute: opts.compute,
47
- });
48
+ }));
48
49
  }
49
50
  //# sourceMappingURL=defineAlert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defineAlert.js","sourceRoot":"","sources":["../../src/define/defineAlert.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AA4B/D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,WAAW,CAAC,IAAqB;IAC7C,MAAM,YAAY,GAA4B,MAAM,CAAC,MAAM,CAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpF,MAAM,kBAAkB,GAA0B,MAAM,CAAC,MAAM,CAAW,EAAE,CAAC,CAAC;IAC9E,MAAM,gBAAgB,GAAqC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC7E,MAAM,IAAI,GAAG;QACT,UAAU,EAAE,CAAU;QACtB,IAAI,EAAE,OAAgB;QACtB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,EAAE;QACzB,YAAY;QACZ,kBAAkB;QAClB,oBAAoB,EAAE,KAAK;QAC3B,gBAAgB;QAChB,WAAW,EAAE,CAAC;KACjB,CAAC;IACF,MAAM,QAAQ,GAAG;QACb,GAAG,IAAI;QACP,GAAG,CAAC,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC;QAC5E,GAAG,CAAC,IAAI,CAAC,iBAAiB,KAAK,SAAS;YACpC,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,EAAE,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACpD,GAAG,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC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AC,EAAE,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACpD,GAAG,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;KACzE,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAChB,0BAA0B,CAAC;QACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;QACjC,OAAO,EAAE,IAAI,CAAC,OAAO;KACxB,CAAC,CACL,CAAC;AACN,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"defineAlertCondition.d.ts","sourceRoot":"","sources":["../../src/define/defineAlertCondition.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACR,wBAAwB,EAExB,oBAAoB,EACpB,SAAS,EACT,WAAW,EAEd,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,wBAAwB,GAAG,QAAQ,CAAC;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,CAAC,CAAC;IACd,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC,CAAC;IAC/D,OAAO,EAAE,SAAS,CAAC;CACtB,CAAC,CAAC;AAcH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,wBAAwB,GAAG,oBAAoB,CAoBzF"}
1
+ {"version":3,"file":"defineAlertCondition.d.ts","sourceRoot":"","sources":["../../src/define/defineAlertCondition.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACR,wBAAwB,EAExB,oBAAoB,EACpB,SAAS,EACT,WAAW,EAEd,MAAM,aAAa,CAAC;AAGrB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,wBAAwB,GAAG,QAAQ,CAAC;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,CAAC,CAAC;IACd,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC,CAAC;IAC/D,OAAO,EAAE,SAAS,CAAC;CACtB,CAAC,CAAC;AAcH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,wBAAwB,GAAG,oBAAoB,CAoBzF"}
@@ -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
+ import { attachDepAccessorSentinels } from "./depAccessorSentinel.js";
3
4
  function freezeCondition(id, descriptor) {
4
5
  return Object.freeze({
5
6
  id,
@@ -59,6 +60,6 @@ export function defineAlertCondition(opts) {
59
60
  maxLookback: 0,
60
61
  alertConditions,
61
62
  });
62
- return Object.freeze({ manifest, compute: opts.compute });
63
+ return Object.freeze(attachDepAccessorSentinels({ manifest, compute: opts.compute }));
63
64
  }
64
65
  //# sourceMappingURL=defineAlertCondition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defineAlertCondition.js","sourceRoot":"","sources":["../../src/define/defineAlertCondition.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAwC/D,SAAS,eAAe,CACpB,EAAU,EACV,UAAoC;IAEpC,OAAO,MAAM,CAAC,MAAM,CAAC;QACjB,EAAE;QACF,KAAK,EAAE,UAAU,CAAC,KAAK;QACvB,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,cAAc,EAAE,UAAU,CAAC,cAAc;KAC5C,CAAC,CAAC;AACP,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAA8B;IAC/D,MAA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@@
1
1
  // Copyright (c) 2026 Invinite. Licensed under the MIT License.
2
2
  // See the LICENSE file in the repo root for full license text.
3
+ import { attachDepAccessorSentinels } from "./depAccessorSentinel.js";
3
4
  /**
4
5
  * Construct a Phase-3 drawing script object. Mirrors `defineIndicator`
5
6
  * structurally; only `manifest.kind` (`"drawing"`) and the declared
@@ -59,9 +60,9 @@ export function defineDrawing(opts) {
59
60
  : { requiresIntervals: opts.requiresIntervals }),
60
61
  ...(opts.shortName === undefined ? {} : { shortName: opts.shortName }),
61
62
  };
62
- return Object.freeze({
63
+ return Object.freeze(attachDepAccessorSentinels({
63
64
  manifest: Object.freeze(manifest),
64
65
  compute: opts.compute,
65
- });
66
+ }));
66
67
  }
67
68
  //# sourceMappingURL=defineDrawing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defineDrawing.js","sourceRoot":"","sources":["../../src/define/defineDrawing.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AA+B/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,UAAU,aAAa,CAAC,IAAuB;IACjD,MAAM,YAAY,GAA8B,MAAM,CAAC,MAAM,CAAe,CAAC,UAAU,CAAC,CAAC,CAAC;IAC1F,MAAM,kBAAkB,GAA0B,MAAM,CAAC,MAAM,CAAW,EAAE,CAAC,CAAC;IAC9E,MAAM,gBAAgB,GAAqC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC7E,MAAM,IAAI,GAAG;QACT,UAAU,EAAE,CAAU;QACtB,IAAI,EAAE,SAAkB;QACxB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,EAAE;QACzB,YAAY;QACZ,kBAAkB;QAClB,oBAAoB,EAAE,KAAK;QAC3B,gBAAgB;QAChB,WAAW,EAAE,CAAC;KACjB,CAAC;IACF,MAAM,QAAQ,GAAG;QACb,GAAG,IAAI;QACP,GAAG,CAAC,IAAI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I,CAAC,OAAO;KACxB,CAAC,CACL,CAAC;AACN,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { CompiledScriptObject, ComputeFn, DrawingCounts, InputSchema } from "../types.js";
2
+ import type { OutputDeclaration } from "./dependency.js";
2
3
  import type { ScriptOverrides } from "./overrides.js";
3
4
  /**
4
5
  * Author-supplied options the script passes to `defineIndicator(...)`. The
@@ -24,6 +25,16 @@ export type DefineIndicatorOpts = Readonly<{
24
25
  compute: ComputeFn;
25
26
  /** Per-bucket cap on `draw.*` emissions per bar. @since 0.3 */
26
27
  maxDrawings?: DrawingCounts;
28
+ /**
29
+ * Titled outputs this producer exposes for `<binding>.output(...)`
30
+ * consumption. Injected by the compiler from the producer's
31
+ * `plot(value, { title })` calls so the runtime object is
32
+ * self-describing — hosts read `manifest.outputs` to allocate the
33
+ * dep-output ring buffer. Hand-authored scripts omit it; absent
34
+ * `outputs` keeps the emitted manifest byte-identical to a script
35
+ * with no titled plots. @since 0.7
36
+ */
37
+ outputs?: ReadonlyArray<OutputDeclaration>;
27
38
  }> & ScriptOverrides;
28
39
  /**
29
40
  * Construct a Phase-1 indicator script object. Returns a frozen
@@ -1 +1 @@
1
- {"version":3,"file":"defineIndicator.d.ts","sourceRoot":"","sources":["../../src/define/defineIndicator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,CAAC,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,EAAE,SAAS,CAAC;IACnB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,aAAa,CAAC;CAC/B,CAAC,GACE,eAAe,CAAC;AAEpB;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,oBAAoB,CA+B/E"}
1
+ {"version":3,"file":"defineIndicator.d.ts","sourceRoot":"","sources":["../../src/define/defineIndicator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,CAAC,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,EAAE,SAAS,CAAC;IACnB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;CAC9C,CAAC,GACE,eAAe,CAAC;AAEpB;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,oBAAoB,CAmC/E"}
@@ -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
+ import { attachDepAccessorSentinels } from "./depAccessorSentinel.js";
3
4
  /**
4
5
  * Construct a Phase-1 indicator script object. Returns a frozen
5
6
  * `CompiledScriptObject` with a default manifest the compiler later overrides
@@ -36,6 +37,7 @@ export function defineIndicator(opts) {
36
37
  };
37
38
  const manifest = {
38
39
  ...base,
40
+ ...(opts.overlay === undefined ? {} : { overlay: opts.overlay }),
39
41
  ...(opts.maxDrawings === undefined ? {} : { maxDrawings: opts.maxDrawings }),
40
42
  ...(opts.maxBarsBack === undefined ? {} : { maxBarsBack: opts.maxBarsBack }),
41
43
  ...(opts.format === undefined ? {} : { format: opts.format }),
@@ -45,10 +47,11 @@ export function defineIndicator(opts) {
45
47
  ? {}
46
48
  : { requiresIntervals: opts.requiresIntervals }),
47
49
  ...(opts.shortName === undefined ? {} : { shortName: opts.shortName }),
50
+ ...(opts.outputs === undefined ? {} : { outputs: opts.outputs }),
48
51
  };
49
- return Object.freeze({
52
+ return Object.freeze(attachDepAccessorSentinels({
50
53
  manifest: Object.freeze(manifest),
51
54
  compute: opts.compute,
52
- });
55
+ }));
53
56
  }
54
57
  //# sourceMappingURL=defineIndicator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defineIndicator.js","sourceRoot":"","sources":["../../src/define/defineIndicator.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAgC/D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,eAAe,CAAC,IAAyB;IACrD,MAAM,YAAY,GAAgC,MAAM,CAAC,MAAM,CAAiB,CAAC,YAAY,CAAC,CAAC,CAAC;IAChG,MAAM,kBAAkB,GAA0B,MAAM,CAAC,MAAM,CAAW,EAAE,CAAC,CAAC;IAC9E,MAAM,gBAAgB,GAAqC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC7E,MAAM,IAAI,GAAG;QACT,UAAU,EAAE,CAAU;QACtB,IAAI,EAAE,WAAoB;QAC1B,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,EAAE;QACzB,YAAY;QACZ,kBAAkB;QAClB,oBAAoB,EAAE,KAAK;QAC3B,gBAAgB;QAChB,WAAW,EAAE,CAAC;KACjB,CAAC;IACF,MAAM,QAAQ,GAAG;QACb,GAAG,IAAI;QAC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7D,GAAG,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;QACtE,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;QAC1D,GAAG,CAAC,IAAI,CAAC,iBAAiB,KAAK,SAAS;YACpC,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,EAAE,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACpD,GAAG,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;QACtE,GAAG,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;KACnE,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAChB,0BAA0B,CAAC;QACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;QACjC,OAAO,EAAE,IAAI,CAAC,OAAO;KACxB,CAAC,CACL,CAAC;AACN,CAAC"}
@@ -0,0 +1,46 @@
1
+ import type { CompiledScriptObject, ComputeFn, ScriptManifest } from "../types.js";
2
+ /**
3
+ * Sentinel thrown when `output` / `withInputs` are called outside the
4
+ * compiler-rewritten bundle path. The Phase-7 compiler statically
5
+ * replaces every consumer-side `.output("title")` call site with a
6
+ * synthesised `__chartlang_depOutput(...)` runtime call, and every
7
+ * `.withInputs({...})` chain with a folded dep manifest, so these
8
+ * bodies are unreachable when the bundle is loaded normally. Hand-
9
+ * running an un-compiled script in a unit test hits the sentinel,
10
+ * which is the desired failure.
11
+ *
12
+ * @since 0.7
13
+ * @stable
14
+ * @example
15
+ * try {
16
+ * depAccessorSentinel("output(\"line\")");
17
+ * } catch (err) {
18
+ * void (err as Error).message;
19
+ * }
20
+ */
21
+ export declare const depAccessorSentinel: (name: string) => never;
22
+ /**
23
+ * Attach the {@link depAccessorSentinel}-backed `output` /
24
+ * `withInputs` accessors to a `{ manifest, compute }` pair so the
25
+ * `defineIndicator` / `defineAlert` / `defineDrawing` /
26
+ * `defineAlertCondition` constructors return a complete
27
+ * {@link CompiledScriptObject}. The compiler rewrites both accessors
28
+ * to static dep lookups at bundle time — the throwing bodies only
29
+ * fire when an un-compiled module is invoked directly.
30
+ *
31
+ * @since 0.7
32
+ * @stable
33
+ * @example
34
+ * declare const manifest: ScriptManifest;
35
+ * declare const compute: ComputeFn;
36
+ * const cs: CompiledScriptObject = attachDepAccessorSentinels({
37
+ * manifest,
38
+ * compute,
39
+ * });
40
+ * void cs;
41
+ */
42
+ export declare const attachDepAccessorSentinels: (base: Readonly<{
43
+ manifest: ScriptManifest;
44
+ compute: ComputeFn;
45
+ }>) => CompiledScriptObject;
46
+ //# sourceMappingURL=depAccessorSentinel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"depAccessorSentinel.d.ts","sourceRoot":"","sources":["../../src/define/depAccessorSentinel.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,cAAc,EAAU,MAAM,aAAa,CAAC;AAE3F;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,MAAM,KAAG,KAIlD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,0BAA0B,GACnC,MAAM,QAAQ,CAAC;IAAE,QAAQ,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,SAAS,CAAA;CAAE,CAAC,KACjE,oBAKD,CAAC"}
@@ -0,0 +1,51 @@
1
+ // Copyright (c) 2026 Invinite. Licensed under the MIT License.
2
+ // See the LICENSE file in the repo root for full license text.
3
+ /**
4
+ * Sentinel thrown when `output` / `withInputs` are called outside the
5
+ * compiler-rewritten bundle path. The Phase-7 compiler statically
6
+ * replaces every consumer-side `.output("title")` call site with a
7
+ * synthesised `__chartlang_depOutput(...)` runtime call, and every
8
+ * `.withInputs({...})` chain with a folded dep manifest, so these
9
+ * bodies are unreachable when the bundle is loaded normally. Hand-
10
+ * running an un-compiled script in a unit test hits the sentinel,
11
+ * which is the desired failure.
12
+ *
13
+ * @since 0.7
14
+ * @stable
15
+ * @example
16
+ * try {
17
+ * depAccessorSentinel("output(\"line\")");
18
+ * } catch (err) {
19
+ * void (err as Error).message;
20
+ * }
21
+ */
22
+ export const depAccessorSentinel = (name) => {
23
+ throw new Error(`${name} can only be called on a compiled chartlang indicator binding inside another indicator's compute body`);
24
+ };
25
+ /**
26
+ * Attach the {@link depAccessorSentinel}-backed `output` /
27
+ * `withInputs` accessors to a `{ manifest, compute }` pair so the
28
+ * `defineIndicator` / `defineAlert` / `defineDrawing` /
29
+ * `defineAlertCondition` constructors return a complete
30
+ * {@link CompiledScriptObject}. The compiler rewrites both accessors
31
+ * to static dep lookups at bundle time — the throwing bodies only
32
+ * fire when an un-compiled module is invoked directly.
33
+ *
34
+ * @since 0.7
35
+ * @stable
36
+ * @example
37
+ * declare const manifest: ScriptManifest;
38
+ * declare const compute: ComputeFn;
39
+ * const cs: CompiledScriptObject = attachDepAccessorSentinels({
40
+ * manifest,
41
+ * compute,
42
+ * });
43
+ * void cs;
44
+ */
45
+ export const attachDepAccessorSentinels = (base) => ({
46
+ manifest: base.manifest,
47
+ compute: base.compute,
48
+ output: (name) => depAccessorSentinel(`output("${name}")`),
49
+ withInputs: () => depAccessorSentinel("withInputs"),
50
+ });
51
+ //# sourceMappingURL=depAccessorSentinel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"depAccessorSentinel.js","sourceRoot":"","sources":["../../src/define/depAccessorSentinel.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAI/D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAS,EAAE;IACvD,MAAM,IAAI,KAAK,CACX,GAAG,IAAI,uGAAuG,CACjH,CAAC;AACN,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACtC,IAAgE,EAC5C,EAAE,CAAC,CAAC;IACxB,QAAQ,EAAE,IAAI,CAAC,QAAQ;IACvB,OAAO,EAAE,IAAI,CAAC,OAAO;IACrB,MAAM,EAAE,CAAC,IAAY,EAAkB,EAAE,CAAC,mBAAmB,CAAC,WAAW,IAAI,IAAI,CAAC;IAClF,UAAU,EAAE,GAAyB,EAAE,CAAC,mBAAmB,CAAC,YAAY,CAAC;CAC5E,CAAC,CAAC"}
@@ -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"}
@@ -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"}
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,EAC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AAQ,EACR,aAAa,EACb,cAAc,EACd,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,UAAU,EACV,aAAa,EACb,SAAS,EACT,SAAS,EACT,aAAa,EACb,UAAU,EACV,QAAQ,EACR,SAAS,EACT,uBAAuB,EACvB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,UAAU,EACV,iBAAiB,GACpB,MAAM,iBAAiB,CAAC"}
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,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,YAA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mB,EACnB,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,WAAW,EACX,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,aAAa,EACb,cAAc,EACd,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,UAAU,EACV,aAAa,EACb,SAAS,EACT,SAAS,EACT,aAAa,EACb,UAAU,EACV,QAAQ,EACR,SAAS,EACT,uBAAuB,EACvB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,oBAAoB,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";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAyB/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EACH,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,eAAe,GAClB,MAAM,mBAAmB,CAAC;AAU3B,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAuInC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAmBzC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAO7C,OAAO,EAAE,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E,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EACH,aAAa,EACb,WAAW,EACX,cAAc,EACd,cAAc,EACd,SAAS,EACT,IAAI,GACP,MAAM,iBAAiB,CAAC"}
@@ -2,7 +2,7 @@ import type { Color, LineStyle, Series } from "../types.js";
2
2
  /**
3
3
  * Rendered-shape discriminator for `plot` emissions reaching the adapter.
4
4
  * The full 0.5 inventory is `line`, `step-line`, `horizontal-line`,
5
- * `histogram`, `bars`, `area`, `filled-band`, `label`, `marker`,
5
+ * `histogram`, `area`, `filled-band`, `label`, `marker`,
6
6
  * `shape`, `character`, `arrow`, `candle-override`, `bar-override`,
7
7
  * `bg-color`, `bar-color`, and `horizontal-histogram`. Every expansion is
8
8
  * additive — the `apiVersion: 1` script header stays unchanged.
@@ -10,7 +10,6 @@ import type { Color, LineStyle, Series } from "../types.js";
10
10
  * Typical Phase-2 consumers:
11
11
  *
12
12
  * - `histogram` → volume bars, MACD histogram, momentum-style oscillators.
13
- * - `bars` → narrow vertical bar plotted at integer x (signed momentum).
14
13
  * - `area` → filled region under a polyline (BB midline, regression).
15
14
  * - `filled-band` → Bollinger / Keltner / Donchian / Ichimoku envelopes.
16
15
  * - `label` → text annotations at a world-space anchor (fractal, pivot).
@@ -24,7 +23,7 @@ import type { Color, LineStyle, Series } from "../types.js";
24
23
  * const shape: PlotKind = "shape";
25
24
  * void k; void histogram; void shape;
26
25
  */
27
- export type PlotKind = "line" | "step-line" | "horizontal-line" | "histogram" | "bars" | "area" | "filled-band" | "label" | "marker" | "shape" | "character" | "arrow" | "candle-override" | "bar-override" | "bg-color" | "bar-color" | "horizontal-histogram";
26
+ export type PlotKind = "line" | "step-line" | "horizontal-line" | "histogram" | "area" | "filled-band" | "label" | "marker" | "shape" | "character" | "arrow" | "candle-override" | "bar-override" | "bg-color" | "bar-color" | "horizontal-histogram";
28
27
  /**
29
28
  * Marker glyphs shared by Phase 2 `marker` and Phase 5 `shape` plot styles.
30
29
  *
@@ -231,18 +230,37 @@ export type PlotOpts = Readonly<{
231
230
  style?: PlotOptsStyle;
232
231
  }>;
233
232
  /**
234
- * Styling options accepted by `hline(...)`. Unlike `plot`, `hline` is always
235
- * a single horizontal line at a fixed price; no pane override.
233
+ * Styling options accepted by `hline(...)`. `pane` follows the same shape as
234
+ * {@link PlotOpts.pane}: omit to fall back to the script's manifest-resolved
235
+ * default (overlay unless `defineIndicator({ overlay: false })` was declared);
236
+ * `"overlay"` pins the line to the price pane; `"new"` opens / joins the
237
+ * per-script subpane; named panes route to a shared subpane key.
236
238
  *
237
239
  * @since 0.1
240
+ * @stable
238
241
  * @example
239
- * const opts: HLineOpts = { color: "#ef4444", title: "Stop", lineStyle: "dashed" };
242
+ * const opts: HLineOpts = {
243
+ * color: "#ef4444",
244
+ * title: "RSI 70",
245
+ * lineStyle: "dashed",
246
+ * pane: "new",
247
+ * };
240
248
  */
241
249
  export type HLineOpts = Readonly<{
242
250
  color?: Color;
243
251
  title?: string;
244
252
  lineWidth?: number;
245
253
  lineStyle?: LineStyle;
254
+ /**
255
+ * Routes the horizontal line to a pane. Mirrors {@link PlotOpts.pane}:
256
+ * omit to fall back to the script's manifest-resolved default,
257
+ * `"overlay"` pins to the price pane, `"new"` joins the per-script
258
+ * subpane, and named keys route to a shared subpane (folded to overlay
259
+ * with `unsupported-pane` on `subPanes: 0` adapters).
260
+ *
261
+ * @since 0.2
262
+ */
263
+ pane?: "overlay" | "new" | string;
246
264
  }>;
247
265
  /**
248
266
  * Compile-time callable hole for `plot(value, opts?)`. The compiler rewrites
@@ -1 +1 @@
1
- {"version":3,"file":"plot.d.ts","sourceRoot":"","sources":["../../src/plot/plot.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,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K,CAAC,uCAAuC,CAAC,CAAC;AAC7D,CAAC"}
1
+ {"version":3,"file":"plot.js","sourceRoot":"","sources":["../../src/plot/plot.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAiR/D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,IAAI,CAAC,MAA+B,EAAE,KAAgB;IAClE,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;AAC5D,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,KAAK,CAAC,MAAc,EAAE,KAAiB;IACnD,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;AAC7D,CAAC"}
@@ -1,5 +1,5 @@
1
1
  export { state } from "./state.js";
2
2
  export type { StateNamespace } from "./state.js";
3
3
  export type { MutableSlot } from "./mutableSlot.js";
4
- export type { StateSnapshot, StateStoreKey, StreamSnapshot } from "./snapshot.js";
4
+ export type { RunnerSnapshot, StateSnapshot, StateStoreKey, StreamSnapshot, } from "./snapshot.js";
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/state/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/state/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EACR,cAAc,EACd,aAAa,EACb,aAAa,EACb,cAAc,GACjB,MAAM,eAAe,CAAC"}
@@ -35,37 +35,64 @@ export type StreamSnapshot = Readonly<{
35
35
  volume: ReadonlyArray<number | null>;
36
36
  }>;
37
37
  }>;
38
+ /**
39
+ * Per-runner persistence section. Carries one runner's `state.*`
40
+ * (and primary-only TA) slot map keyed by `${slotIdPrefix}${slotId}:state`
41
+ * (PLAN.md §5.5 + Task 5). `slots` is `JsonValue` so the snapshot
42
+ * round-trips through `JSON.stringify` and structured-clone.
43
+ *
44
+ * Used inside {@link StateSnapshot} for `primary`,
45
+ * `siblings[exportName]`, and `dependencies[localId]` sections —
46
+ * one section per runner mounted by a `CompiledScriptBundle`.
47
+ *
48
+ * @since 0.7
49
+ * @stable
50
+ * @example
51
+ * const r: RunnerSnapshot = {
52
+ * slots: { "x:state": { committed: 1, tentative: 1 } },
53
+ * };
54
+ * void r;
55
+ */
56
+ export type RunnerSnapshot = Readonly<{
57
+ slots: Readonly<Record<string, JsonValue>>;
58
+ }>;
38
59
  /**
39
60
  * Canonical persistent-store snapshot.
40
61
  *
41
62
  * Written on `dispose()` and on every `kind: "close"` event when stale for
42
- * at least 60 seconds (PLAN.md §6.9). `slots` carries every stateful
43
- * primitive's per-callsite payload keyed by the compiler-injected slot id
44
- * (PLAN.md §5.5). Each value is `JsonValue`; primitive authors with non-JSON
45
- * internal state register serialisation hooks in the runtime layer.
63
+ * at least 60 seconds (PLAN.md §6.9). Each runner's `state.*` payload is
64
+ * keyed by the compiler-injected slot id with the runner's
65
+ * `slotIdPrefix` prepended (PLAN.md §5.5 + Task 5). Primary-runner TA
66
+ * slots live in `primary.slots` alongside `state.*` slots (the bundle's
67
+ * deps + siblings share the primary's mainStream, so TA slots have no
68
+ * per-runner section).
46
69
  *
47
- * `snapshotVersion: 1` is the only currently-supported wire version. A future
48
- * schema change must bump this literal so the runtime can drop snapshots with
49
- * mismatched versions on load.
70
+ * `snapshotVersion: 1` is the only currently-supported wire version.
71
+ * The 0.7 widening is additive the runtime validator accepts both the
72
+ * legacy flat `slots:` shape (loaded as primary-only) and the structured
73
+ * `primary` / `siblings?` / `dependencies?` shape (always written going
74
+ * forward).
50
75
  *
51
- * @since 0.5
76
+ * @since 0.5 — widened to per-runner sections in 0.7
52
77
  * @stable
53
78
  * @example
54
79
  * const s: StateSnapshot = {
55
80
  * lastBarTime: 1_700_000_000_000,
56
81
  * streams: {},
57
- * slots: {},
58
82
  * savedAt: 1_700_000_060_000,
59
83
  * snapshotVersion: 1,
84
+ * primary: { slots: {} },
60
85
  * };
61
86
  * void s;
62
87
  */
63
88
  export type StateSnapshot = Readonly<{
64
89
  lastBarTime: number;
65
90
  streams: Readonly<Record<string, StreamSnapshot>>;
66
- slots: Readonly<Record<string, JsonValue>>;
67
91
  savedAt: number;
68
92
  snapshotVersion: 1;
93
+ primary: RunnerSnapshot;
94
+ siblings?: Readonly<Record<string, RunnerSnapshot>>;
95
+ dependencies?: Readonly<Record<string, RunnerSnapshot>>;
69
96
  }>;
70
97
  /**
71
98
  * Canonical persistent-store identity tuple.
@@ -1 +1 @@
1
- {"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../src/state/snapshot.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,QAAQ,CAAC;QACd,IAAI,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;QACnC,IAAI,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;QACnC,IAAI,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;QACnC,GAAG,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;QAClC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f,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC7C,CAAC,CAAC"}
package/dist/types.d.ts CHANGED
@@ -1,6 +1,8 @@
1
+ import type { DependencyDeclaration, OutputDeclaration } from "./define/dependency.js";
1
2
  import type { ScaleAxis, ValueFormat } from "./define/overrides.js";
2
3
  import type { DrawNamespace } from "./draw/draw.js";
3
4
  import type { InputDescriptor } from "./input/inputDescriptor.js";
5
+ import type { PlotKind } from "./plot/plot.js";
4
6
  import type { RequestNamespace } from "./request/index.js";
5
7
  import type { RuntimeNamespace } from "./runtime/index.js";
6
8
  import type { StateNamespace } from "./state/state.js";
@@ -223,6 +225,52 @@ export type DrawingCounts = {
223
225
  readonly polylines: number;
224
226
  readonly other: number;
225
227
  };
228
+ /**
229
+ * One plotted-slot descriptor in `ScriptManifest.plots`. The compiler
230
+ * emits one entry per `plot()` / `plot.*()` / `hline()` callsite so an
231
+ * embedder can build a style/visibility UI keyed by the stable `slotId`
232
+ * before the first emission. `title` is present only when the call's
233
+ * opts carries a string-literal `title`.
234
+ *
235
+ * @since 0.8
236
+ * @stable
237
+ * @example
238
+ * const slot: PlotSlotDescriptor = {
239
+ * slotId: "ema.ts:12:5#0",
240
+ * kind: "line",
241
+ * title: "EMA",
242
+ * };
243
+ * void slot;
244
+ */
245
+ export type PlotSlotDescriptor = {
246
+ readonly slotId: string;
247
+ readonly kind: PlotKind;
248
+ readonly title?: string;
249
+ };
250
+ /**
251
+ * Host-supplied presentation override for a single plot slot, keyed by
252
+ * `PlotEmission.slotId`. Applied by the runtime at emit time; never
253
+ * affects `compute`. `lineWidth` / `lineStyle` apply only to the
254
+ * line-family plot kinds (`line`, `step-line`, `horizontal-line`,
255
+ * `area`); ignored as a silent no-op on other kinds.
256
+ *
257
+ * @since 0.8
258
+ * @stable
259
+ * @example
260
+ * const override: PlotOverride = {
261
+ * visible: false,
262
+ * color: "#ff0000",
263
+ * lineWidth: 2,
264
+ * lineStyle: "dashed",
265
+ * };
266
+ * void override;
267
+ */
268
+ export type PlotOverride = {
269
+ readonly visible?: boolean;
270
+ readonly color?: string;
271
+ readonly lineWidth?: number;
272
+ readonly lineStyle?: LineStyle;
273
+ };
226
274
  /**
227
275
  * The metadata sidecar the compiler emits next to a compiled script. The
228
276
  * runtime reads this to size ring buffers, gate against adapter capabilities,
@@ -254,6 +302,20 @@ export type ScriptManifest = {
254
302
  readonly userPickableInterval: boolean;
255
303
  readonly seriesCapacities: Readonly<Record<string, number>>;
256
304
  readonly maxLookback: number;
305
+ /**
306
+ * `overlay: false` on `defineIndicator(...)` is persisted here as the
307
+ * script-level default pane signal. Absent / `true` means the script
308
+ * defaults to the price overlay pane; `false` means the runtime
309
+ * routes every `plot()` / `hline()` call without an explicit `pane`
310
+ * opt into a per-script subpane key.
311
+ *
312
+ * @since 0.2
313
+ * @stable
314
+ * @example
315
+ * const m: Pick<ScriptManifest, "overlay"> = { overlay: false };
316
+ * void m;
317
+ */
318
+ readonly overlay?: boolean;
257
319
  /**
258
320
  * Per-bucket cap on `draw.*` emissions the script intends to
259
321
  * produce per bar. The runtime enforces
@@ -334,6 +396,91 @@ export type ScriptManifest = {
334
396
  * void defs;
335
397
  */
336
398
  readonly alertConditions?: ReadonlyArray<AlertConditionDefinition>;
399
+ /**
400
+ * Statically-resolved dependency graph nodes consumed by this
401
+ * script. Empty / omitted for scripts with no
402
+ * `<binding>.output(...)` calls. Each entry is one consumer-side
403
+ * `const` binding pointing at another `defineIndicator(...)`
404
+ * result.
405
+ *
406
+ * @since 0.7
407
+ * @stable
408
+ * @example
409
+ * const v: ScriptManifest["dependencies"] = [];
410
+ * void v;
411
+ */
412
+ readonly dependencies?: ReadonlyArray<DependencyDeclaration>;
413
+ /**
414
+ * Titled outputs this script exposes for consumption by other
415
+ * indicators. Derived from `plot(value, { title })` calls in
416
+ * this script's compute body. Empty / omitted when the script
417
+ * has no titled plots.
418
+ *
419
+ * @since 0.7
420
+ * @stable
421
+ * @example
422
+ * const v: ScriptManifest["outputs"] = [
423
+ * { title: "line", kind: "series-number" },
424
+ * ];
425
+ * void v;
426
+ */
427
+ readonly outputs?: ReadonlyArray<OutputDeclaration>;
428
+ /**
429
+ * Static plot-slot descriptors — one per `plot()` / `hline()` callsite,
430
+ * in callsite order. Lets an embedder enumerate plottable slots (and
431
+ * key per-slot style/visibility overrides) without waiting for the
432
+ * first emission. Absent on scripts that issue no plot/hline calls.
433
+ *
434
+ * @since 0.8
435
+ * @stable
436
+ * @example
437
+ * const v: ScriptManifest["plots"] = [
438
+ * { slotId: "ema.ts:12:5#0", kind: "line", title: "EMA" },
439
+ * ];
440
+ * void v;
441
+ */
442
+ readonly plots?: ReadonlyArray<PlotSlotDescriptor>;
443
+ /**
444
+ * The ES-module binding name this manifest was reached through.
445
+ * `"default"` for `export default defineIndicator(...)`; the
446
+ * named-binding identifier otherwise. Always present when the
447
+ * source file has more than one drawn indicator; omitted on
448
+ * single-script files for back-compat.
449
+ *
450
+ * @since 0.7
451
+ * @stable
452
+ * @example
453
+ * const v: ScriptManifest["exportName"] = "default";
454
+ * void v;
455
+ */
456
+ readonly exportName?: string;
457
+ /**
458
+ * Other drawn manifests in the same compiled file. Present
459
+ * only when this manifest is the file's default export and the
460
+ * file has additional named-exported drawn indicators. Omitted
461
+ * for single-script files and for non-default-export entries
462
+ * in the array-form manifest sidecar.
463
+ *
464
+ * @since 0.7
465
+ * @stable
466
+ * @example
467
+ * const v: ScriptManifest["siblings"] = [];
468
+ * void v;
469
+ */
470
+ readonly siblings?: ReadonlyArray<ScriptManifest>;
471
+ /**
472
+ * `true` when this manifest belongs to a drawn (exported)
473
+ * indicator — the host should mount it. `false` when this
474
+ * manifest belongs to a private dep — emissions are dropped.
475
+ * Defaults to `true` for back-compat.
476
+ *
477
+ * @since 0.7
478
+ * @stable
479
+ * @example
480
+ * const v: ScriptManifest["isDrawn"] = true;
481
+ * void v;
482
+ */
483
+ readonly isDrawn?: boolean;
337
484
  };
338
485
  /**
339
486
  * Per-condition descriptor authored under
@@ -438,6 +585,13 @@ export type ComputeFn = (ctx: ComputeContext) => void;
438
585
  * The compiler rewrites `manifest` fields at build time; the runtime invokes
439
586
  * `compute` per bar.
440
587
  *
588
+ * The `output` / `withInputs` accessors (Phase 7) are compiler-rewritten
589
+ * sentinels — the indicator-composition compiler pass statically replaces
590
+ * every consumer-side call site before bundling, so the runtime never
591
+ * executes the throwing bodies. Direct invocation from an un-compiled
592
+ * script (e.g. a unit test that imports the module directly) hits the
593
+ * sentinel and throws, which is the desired failure.
594
+ *
441
595
  * @since 0.1
442
596
  * @example
443
597
  * const cs: CompiledScriptObject = defineIndicator({
@@ -449,7 +603,98 @@ export type ComputeFn = (ctx: ComputeContext) => void;
449
603
  export type CompiledScriptObject = {
450
604
  readonly manifest: ScriptManifest;
451
605
  readonly compute: ComputeFn;
606
+ /**
607
+ * Read the named output of this indicator inside another
608
+ * indicator's compute body. Output names come from the
609
+ * producer's `plot(value, { title })` calls. The compiler
610
+ * rewrites every consumer-side call site before bundling;
611
+ * direct invocation throws the dep-accessor sentinel.
612
+ *
613
+ * @since 0.7
614
+ * @stable
615
+ * @example
616
+ * declare const baseTrend: CompiledScriptObject;
617
+ * const line: Series<number> = baseTrend.output("line");
618
+ * void line;
619
+ */
620
+ readonly output: (name: string) => Series<number>;
621
+ /**
622
+ * Return a new `CompiledScriptObject` whose dependency-binding
623
+ * effective inputs are the merge of the producer's defaults with
624
+ * the supplied overrides. Static — the compiler folds the
625
+ * override into the inlined dep manifest at bundle time.
626
+ *
627
+ * @since 0.7
628
+ * @stable
629
+ * @example
630
+ * declare const baseTrend: CompiledScriptObject;
631
+ * const trend = baseTrend.withInputs({ length: 50 });
632
+ * void trend;
633
+ */
634
+ readonly withInputs: (overrides: Readonly<Record<string, unknown>>) => CompiledScriptObject;
452
635
  };
636
+ /**
637
+ * The compiled artefact for a `.chart.ts` file when it contains
638
+ * multiple drawn indicators or any dependency graph. The Phase-7
639
+ * runtime accepts either this shape or the legacy
640
+ * `CompiledScriptObject` (single-script files).
641
+ *
642
+ * `primary` is the default-exported drawn script. `siblings` are
643
+ * every other drawn export (named consts). `dependencies` is every
644
+ * private-dep compiled object — keyed by `localId` so the runtime
645
+ * can look them up by the `DependencyDeclaration.localId` it sees
646
+ * on each consumer's manifest.
647
+ *
648
+ * @since 0.7
649
+ * @stable
650
+ * @example
651
+ * declare const primary: CompiledScriptObject;
652
+ * const bundle: CompiledScriptBundle = {
653
+ * primary,
654
+ * siblings: [],
655
+ * dependencies: [],
656
+ * };
657
+ * void bundle;
658
+ */
659
+ export type CompiledScriptBundle = Readonly<{
660
+ readonly primary: CompiledScriptObject;
661
+ readonly siblings: ReadonlyArray<{
662
+ readonly exportName: string;
663
+ readonly compiled: CompiledScriptObject;
664
+ }>;
665
+ readonly dependencies: ReadonlyArray<{
666
+ readonly localId: string;
667
+ readonly compiled: CompiledScriptObject;
668
+ /**
669
+ * Merged `.withInputs({...})` overrides the consumer applied
670
+ * to its alias binding. Forwarded into the `DepRunner` as the
671
+ * dep's input overrides so the producer's `compute` reads the
672
+ * consumer-supplied values instead of the producer's manifest
673
+ * defaults. Omitted for direct private deps that don't apply
674
+ * overrides.
675
+ *
676
+ * @since 0.7
677
+ */
678
+ readonly inputOverrides?: Readonly<Record<string, unknown>>;
679
+ }>;
680
+ }>;
681
+ /**
682
+ * Narrowing helper that distinguishes the new
683
+ * {@link CompiledScriptBundle} envelope from the legacy single-script
684
+ * {@link CompiledScriptObject}. The runner uses it to pick the
685
+ * multi-script execution path without re-parsing manifests.
686
+ *
687
+ * @since 0.7
688
+ * @stable
689
+ * @example
690
+ * declare const v: CompiledScriptObject | CompiledScriptBundle;
691
+ * if (isCompiledScriptBundle(v)) {
692
+ * void v.primary;
693
+ * } else {
694
+ * void v.manifest;
695
+ * }
696
+ */
697
+ export declare const isCompiledScriptBundle: (v: CompiledScriptObject | CompiledScriptBundle) => v is CompiledScriptBundle;
453
698
  /**
454
699
  * JSON-compatible payload type for `alert(...).meta` and other places the
455
700
  * runtime serialises script-supplied data across worker / host boundaries.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjF;;;;;;;GAOG;AACH,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC;AAE1B;;;;;;;GAOG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC;AAE3B;;;;;;;GAOG;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAE5B;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;CACzB,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,GAAG,GAAG;IACd,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC;IACpB,QAAQ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,EAAE,aAAa,CAAC;QACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAC;QACxC;;;;;;;;;WASG;QACH,QAAQ,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KAC/D,CAAC,CAAC;CACN,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,sBAAsB,GAC/B,GAAG,oBAAoB,GAAG,oBAAoB,KAC/C,CAAC,IAAI,oBAA0E,CAAC;AAEnF;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GACf,IAAI,GACJ,OAAO,GACP,MAAM,GACN,MAAM,GACN,aAAa,CAAC,SAAS,CAAC,GACxB;IAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC"}
package/dist/types.js CHANGED
@@ -1,4 +1,20 @@
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 {};
3
+ /**
4
+ * Narrowing helper that distinguishes the new
5
+ * {@link CompiledScriptBundle} envelope from the legacy single-script
6
+ * {@link CompiledScriptObject}. The runner uses it to pick the
7
+ * multi-script execution path without re-parsing manifests.
8
+ *
9
+ * @since 0.7
10
+ * @stable
11
+ * @example
12
+ * declare const v: CompiledScriptObject | CompiledScriptBundle;
13
+ * if (isCompiledScriptBundle(v)) {
14
+ * void v.primary;
15
+ * } else {
16
+ * void v.manifest;
17
+ * }
18
+ */
19
+ export const isCompiledScriptBundle = (v) => Object.prototype.hasOwnProperty.call(v, "primary");
4
20
  //# sourceMappingURL=types.js.map
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAmsB/D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAClC,CAA8C,EACrB,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invinite-org/chartlang-core",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Types and primitives for chartlang scripts",