@invinite-org/chartlang-core 1.2.0 → 1.3.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 (61) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/index.d.ts +8 -6
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +3 -2
  5. package/dist/index.js.map +1 -1
  6. package/dist/input/index.d.ts +1 -1
  7. package/dist/input/index.d.ts.map +1 -1
  8. package/dist/input/index.js.map +1 -1
  9. package/dist/input/input.d.ts +15 -1
  10. package/dist/input/input.d.ts.map +1 -1
  11. package/dist/input/input.js +14 -0
  12. package/dist/input/input.js.map +1 -1
  13. package/dist/input/inputDescriptor.d.ts +15 -2
  14. package/dist/input/inputDescriptor.d.ts.map +1 -1
  15. package/dist/input/inputDescriptor.js.map +1 -1
  16. package/dist/plot/plot.d.ts +60 -0
  17. package/dist/plot/plot.d.ts.map +1 -1
  18. package/dist/plot/plot.js +34 -0
  19. package/dist/plot/plot.js.map +1 -1
  20. package/dist/request/feedKey.d.ts +20 -0
  21. package/dist/request/feedKey.d.ts.map +1 -0
  22. package/dist/request/feedKey.js +29 -0
  23. package/dist/request/feedKey.js.map +1 -0
  24. package/dist/request/index.d.ts +2 -0
  25. package/dist/request/index.d.ts.map +1 -1
  26. package/dist/request/index.js +1 -0
  27. package/dist/request/index.js.map +1 -1
  28. package/dist/request/request.d.ts +30 -5
  29. package/dist/request/request.d.ts.map +1 -1
  30. package/dist/request/request.js.map +1 -1
  31. package/dist/state/arraySlot.d.ts +38 -0
  32. package/dist/state/arraySlot.d.ts.map +1 -0
  33. package/dist/state/arraySlot.js +4 -0
  34. package/dist/state/arraySlot.js.map +1 -0
  35. package/dist/state/index.d.ts +1 -0
  36. package/dist/state/index.d.ts.map +1 -1
  37. package/dist/state/index.js.map +1 -1
  38. package/dist/state/state.d.ts +19 -0
  39. package/dist/state/state.d.ts.map +1 -1
  40. package/dist/state/state.js +20 -0
  41. package/dist/state/state.js.map +1 -1
  42. package/dist/statefulPrimitives.d.ts +3 -3
  43. package/dist/statefulPrimitives.d.ts.map +1 -1
  44. package/dist/statefulPrimitives.js +23 -3
  45. package/dist/statefulPrimitives.js.map +1 -1
  46. package/dist/time-accessors/index.d.ts +5 -0
  47. package/dist/time-accessors/index.d.ts.map +1 -0
  48. package/dist/time-accessors/index.js +5 -0
  49. package/dist/time-accessors/index.js.map +1 -0
  50. package/dist/time-accessors/sessionAccessors.d.ts +43 -0
  51. package/dist/time-accessors/sessionAccessors.d.ts.map +1 -0
  52. package/dist/time-accessors/sessionAccessors.js +38 -0
  53. package/dist/time-accessors/sessionAccessors.js.map +1 -0
  54. package/dist/time-accessors/timeAccessors.d.ts +132 -0
  55. package/dist/time-accessors/timeAccessors.d.ts.map +1 -0
  56. package/dist/time-accessors/timeAccessors.js +143 -0
  57. package/dist/time-accessors/timeAccessors.js.map +1 -0
  58. package/dist/types.d.ts +53 -0
  59. package/dist/types.d.ts.map +1 -1
  60. package/dist/types.js.map +1 -1
  61. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,61 @@
1
1
  # @invinite-org/chartlang-core
2
2
 
3
+ ## 1.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e620ba8: Add `bgcolor(color, opts?)` and `barcolor(color, opts?)` — Pine-ergonomic
8
+ top-level aliases for the `bg-color` / `bar-color` plot styles. One call
9
+ (`bgcolor(close > open ? "#16a34a" : "#dc2626", { transp: 80 })`) replaces
10
+ the verbose `plot(NaN, { style: { kind: "bg-color", … } })`. Surfaced in the
11
+ generated primitive reference and taught in the chartlang-coding skill.
12
+
13
+ Deliverable 2 (per-bar dynamic color): `PlotEmission` gains an optional
14
+ `colorValue: Color | null` channel; the runtime resolves the `bgcolor` /
15
+ `barcolor` per-bar color into it (omitted on the static `plot` path → wire
16
+ byte-identical, every pinned `plot-hash` untouched), validates it
17
+ (non-empty color string or `null`), and dedups it last-write-wins per
18
+ `(slotId, bar)` like `value`. Adapters prefer `colorValue` over the static
19
+ `style.color` at render time — this precedence is now the normative
20
+ adapter-kit contract (`PlotEmission.colorValue` JSDoc) and is implemented in
21
+ the canvas2d reference renderer (`null` ⇒ paint-nothing gap; omitted ⇒ static
22
+ fallback). The Pine converter emits the real per-bar dynamic color
23
+ (`bgcolor(close > open ? "#16a34a" : "#dc2626")`) instead of a static
24
+ `plot(NaN, …)`, so `bgcolor`/`barcolor` round-trip with per-bar semantics
25
+ intact.
26
+
27
+ - 08cba38: Add `time.*` calendar accessors (`time.year/month/dayofmonth/dayofweek/hour/
28
+ minute/second/timestamp`), a `time.timeClose(t, tz?)` bar-close accessor
29
+ (Pine's `time_close()` = bar start + interval), a `session.isOpen(t, spec, tz?)`
30
+ helper, and an `input.session` kind. Calendar fields are derived from a `Time`
31
+ epoch via the host (authors stay sandboxed — `Date`/`Intl` remain banned). v1
32
+ is UTC + fixed-offset only; exchange-tz/DST is a scoped follow-up. The Pine
33
+ converter lowers `dayofweek` / `time()` / `time_close()` / `input.session`.
34
+ - 1efb49c: Add multi-symbol support to `request.security`. `request.security({ symbol,
35
+ interval })` now reads a **different instrument** (not just a higher
36
+ timeframe), e.g. `request.security({ symbol: "AMEX:SPY", interval: "1D" })`.
37
+ `symbol` is optional (defaults to the chart symbol) and must be a compile-time
38
+ literal (`input.symbol` / `input.enum` resolved). A new `multiSymbol` adapter
39
+ capability gates non-chart-symbol requests: a different-symbol request against
40
+ an adapter declaring `multiSymbol: false` degrades to an all-NaN
41
+ bar/series with a single deduped `multi-symbol-not-supported` diagnostic,
42
+ mirroring `multi-timeframe-not-supported` (the symbol gate precedes the
43
+ timeframe gate, so a both-different request emits only the symbol diagnostic).
44
+ The Pine converter now lowers `request.security("OTHER", tf, expr)`, and the
45
+ `chartlang scaffold-adapter` template advertises `multiSymbol`.
46
+ - 1efb49c: Add `state.array<T>(capacity)` — a persistent, bounded FIFO collection. Push
47
+ many values across bars (`a.push(v)`) into a fixed-capacity ring and read
48
+ them back by element (`a.get(0)` = newest, `a.last()`, `a.size`,
49
+ `a.capacity`, `a.clear()`). Bounded literal capacity keeps it
50
+ serialization-clean. The Pine converter lowers a bounded numeric
51
+ `var array<…>` Camp B ring to it.
52
+
53
+ The compiler guards the capacity: it must be a compile-time numeric literal
54
+ (a `const` numeric binding is accepted) that is a positive integer within
55
+ `MAX_STATE_ARRAY_CAPACITY` (100_000). A non-literal capacity errors
56
+ `state-array-capacity-not-literal`; an out-of-range / non-integer literal
57
+ errors `state-array-capacity-exceeds-max`.
58
+
3
59
  ## 1.2.0
4
60
 
5
61
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type { AlertSeverity, AlertConditionDefinition, AlertConditionDescriptor, Bar, BarSeries, BarViewport, CapabilityId, Color, CompiledScriptBundle, CompiledScriptObject, ComputeContext, ComputeFn, DrawingCounts, InputSchema, IntervalDescriptor, JsonValue, LineStyle, NumberSeriesSlot, PlotLineStyle, PlotOverride, PlotSlotDescriptor, Price, PriceSeries, ScriptManifest, SecurityExpressionDescriptor, Series, Time, Volume, VolumeSeries, } from "./types.js";
1
+ export type { AlertSeverity, AlertConditionDefinition, AlertConditionDescriptor, Bar, BarSeries, BarViewport, CapabilityId, Color, CompiledScriptBundle, CompiledScriptObject, ComputeContext, ComputeFn, DrawingCounts, InputSchema, IntervalDescriptor, JsonValue, LineStyle, NumberSeriesSlot, PlotLineStyle, PlotOverride, PlotSlotDescriptor, Price, PriceSeries, RequestedFeed, ScriptManifest, SecurityExpressionDescriptor, Series, Time, Volume, VolumeSeries, } from "./types.js";
2
2
  export { isCompiledScriptBundle } from "./types.js";
3
3
  export { intervalToSeconds } from "./interval/intervalToSeconds.js";
4
4
  export { defineAlert, defineAlertCondition, defineDrawing, defineIndicator, } from "./define/index.js";
@@ -7,20 +7,22 @@ export { ta } from "./ta/index.js";
7
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, HighestbarsOpts, HmaOpts, HvOpts, IchimokuOpts, IchimokuResult, KamaOpts, KeltnerOpts, KeltnerResult, KlingerOpts, KlingerResult, KstOpts, KstResult, LowestOpts, LowestbarsOpts, 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";
8
8
  export type { StatefulPrimitiveEntry } from "./statefulPrimitives.js";
9
9
  export { input } from "./input/index.js";
10
- export type { BoolDescriptor, ColorDescriptor, EnumDescriptor, ExternalSeriesDescriptor, FloatDescriptor, InputDescriptor, InputKind, IntDescriptor, IntervalDescriptorInput, PriceDescriptor, Schema, SourceDescriptor, SourceField, StringDescriptor, SymbolDescriptor, TimeDescriptor, } from "./input/index.js";
10
+ export type { BoolDescriptor, ColorDescriptor, EnumDescriptor, ExternalSeriesDescriptor, FloatDescriptor, InputDescriptor, InputKind, IntDescriptor, IntervalDescriptorInput, PriceDescriptor, Schema, SessionDescriptor, SourceDescriptor, SourceField, StringDescriptor, SymbolDescriptor, TimeDescriptor, } from "./input/index.js";
11
11
  export { state } from "./state/index.js";
12
- export type { MutableSlot, StateNamespace } from "./state/index.js";
12
+ export type { MutableArraySlot, MutableSlot, StateNamespace } from "./state/index.js";
13
13
  export type { RunnerSnapshot, StateSnapshot, StateStoreKey, StreamSnapshot, } from "./state/index.js";
14
+ export { session, time } from "./time-accessors/index.js";
15
+ export type { SessionNamespace, TimeNamespace } from "./time-accessors/index.js";
14
16
  export { barstate, syminfo, timeframe } from "./views/index.js";
15
17
  export type { BarStateView, SymbolType, SymInfoView, TimeframeView } from "./views/index.js";
16
- export { request } from "./request/index.js";
18
+ export { feedKey, request } from "./request/index.js";
17
19
  export type { RequestLowerTfOpts, RequestNamespace, RequestSecurityOpts, SecurityBar, SecurityExpr, } from "./request/index.js";
18
20
  export { runtime } from "./runtime/index.js";
19
21
  export type { LogLevel, RuntimeNamespace } from "./runtime/index.js";
20
22
  export { color, fromGradient, hsl, rgb, withAlpha } from "./color/index.js";
21
23
  export type { GradientStop } from "./color/index.js";
22
- export { hline, plot } from "./plot/index.js";
23
- export type { HLineOpts, PlotKind, PlotOpts, PlotOptsStyle } from "./plot/plot.js";
24
+ export { barcolor, bgcolor, hline, plot } from "./plot/index.js";
25
+ export type { BarColorOpts, BgColorOpts, HLineOpts, PlotKind, PlotOpts, PlotOptsStyle, } from "./plot/plot.js";
24
26
  export { alert } from "./alert/index.js";
25
27
  export type { AlertOpts } from "./alert/alert.js";
26
28
  export { STATEFUL_PRIMITIVES, STATEFUL_PRIMITIVES_BY_NAME } from "./statefulPrimitives.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,SAAS,EACT,WAAW,EACX,YAAY,EACZ,KAAK,EACL,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,SAAS,EACT,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,KAAK,EACL,WAAW,EACX,cAAc,EACd,4BAA4B,EAC5B,MAAM,EACN,IAAI,EACJ,MAAM,EACN,YAAY,GACf,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,aAA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B,EAChB,gBAAgB,EAChB,mBAAmB,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,EACjB,QAAQ,GACX,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,SAAS,EACT,WAAW,EACX,YAAY,EACZ,KAAK,EACL,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,SAAS,EACT,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,KAAK,EACL,WAAW,EACX,aAAa,EACb,cAAc,EACd,4BAA4B,EAC5B,MAAM,EACN,IAAI,EACJ,MAAM,EACN,YAAY,GACf,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,m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aAAa,EACb,aAAa,EACb,aAAa,EACb,WAAW,EACX,WAAW,EACX,YAAY,EACZ,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,YAAY,EACZ,eAAe,EACf,eAAe,EACf,OAAO,EACP,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,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,EACjB,QAAQ,GACX,MAAM,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -6,11 +6,12 @@ export { defineAlert, defineAlertCondition, defineDrawing, defineIndicator, } fr
6
6
  export { ta } from "./ta/index.js";
7
7
  export { input } from "./input/index.js";
8
8
  export { state } from "./state/index.js";
9
+ export { session, time } from "./time-accessors/index.js";
9
10
  export { barstate, syminfo, timeframe } from "./views/index.js";
10
- export { request } from "./request/index.js";
11
+ export { feedKey, request } from "./request/index.js";
11
12
  export { runtime } from "./runtime/index.js";
12
13
  export { color, fromGradient, hsl, rgb, withAlpha } from "./color/index.js";
13
- export { hline, plot } from "./plot/index.js";
14
+ export { barcolor, bgcolor, hline, plot } from "./plot/index.js";
14
15
  export { alert } from "./alert/index.js";
15
16
  export { STATEFUL_PRIMITIVES, STATEFUL_PRIMITIVES_BY_NAME } from "./statefulPrimitives.js";
16
17
  export { DRAWING_KINDS, KIND_BUCKET, KIND_CAMELCASE, KIND_KEBABCASE, bucketFor, draw, } from "./draw/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;AAiC/D,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;AAY3B,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAyInC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAmBzC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAQzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAQ7C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE5E,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,KAAK,EAAE,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","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 type {\n AlertSeverity,\n AlertConditionDefinition,\n AlertConditionDescriptor,\n Bar,\n BarSeries,\n BarViewport,\n CapabilityId,\n Color,\n CompiledScriptBundle,\n CompiledScriptObject,\n ComputeContext,\n ComputeFn,\n DrawingCounts,\n InputSchema,\n IntervalDescriptor,\n JsonValue,\n LineStyle,\n NumberSeriesSlot,\n PlotLineStyle,\n PlotOverride,\n PlotSlotDescriptor,\n Price,\n PriceSeries,\n ScriptManifest,\n SecurityExpressionDescriptor,\n Series,\n Time,\n Volume,\n VolumeSeries,\n} from \"./types.js\";\nexport { isCompiledScriptBundle } from \"./types.js\";\nexport { intervalToSeconds } from \"./interval/intervalToSeconds.js\";\nexport {\n defineAlert,\n defineAlertCondition,\n defineDrawing,\n defineIndicator,\n} from \"./define/index.js\";\nexport type {\n DefineAlertConditionOpts,\n DefineAlertOpts,\n DefineDrawingOpts,\n DefineIndicatorOpts,\n DependencyDeclaration,\n OutputDeclaration,\n ScaleAxis,\n ScriptOverrides,\n ValueFormat,\n} from \"./define/index.js\";\nexport { ta } from \"./ta/index.js\";\nexport type {\n AdlOpts,\n AdrOpts,\n AdxOpts,\n AlmaOpts,\n AnchoredVolumeProfileOpts,\n AnchoredVolumeProfileResult,\n AnchoredVwapOpts,\n AoOpts,\n AroonOpts,\n AroonOscOpts,\n AroonResult,\n AtrOpts,\n BarssinceOpts,\n BbOpts,\n BbPercentBOpts,\n BbResult,\n BbwOpts,\n BopOpts,\n CciOpts,\n ChandeKrollStopOpts,\n ChandeKrollStopResult,\n ChandelierOpts,\n ChaikinOscOpts,\n ChandelierResult,\n ChangeOpts,\n ChopOpts,\n CmfOpts,\n CmoOpts,\n ConnorsRsiOpts,\n CoppockOpts,\n CrossoverOpts,\n CrossunderOpts,\n DemaOpts,\n DmiOpts,\n DmiResult,\n DonchianOpts,\n DonchianResult,\n DpoOpts,\n EmaOpts,\n EomOpts,\n EnvelopeOpts,\n EnvelopeResult,\n FisherOpts,\n FisherResult,\n FixedRangeVolumeProfileOpts,\n FixedRangeVolumeProfileResult,\n HighestOpts,\n HighestbarsOpts,\n HmaOpts,\n HvOpts,\n IchimokuOpts,\n IchimokuResult,\n KamaOpts,\n KeltnerOpts,\n KeltnerResult,\n KlingerOpts,\n KlingerResult,\n KstOpts,\n KstResult,\n LowestOpts,\n LowestbarsOpts,\n LsmaOpts,\n MacdOpts,\n MacdResult,\n MaRibbonOpts,\n MaRibbonResult,\n MassIndexOpts,\n MaTypeNoVolume,\n McginleyOpts,\n MedianOpts,\n MfiOpts,\n MomentumOpts,\n NetVolumeOpts,\n NviOpts,\n ObvOpts,\n PivotsHighLowOpts,\n PivotsHighLowResult,\n PivotsStandardOpts,\n PivotsStandardResult,\n PivotsStandardSystem,\n PmoOpts,\n PmoResult,\n PpoOpts,\n PpoResult,\n PsarOpts,\n PsarResult,\n PviOpts,\n PvoOpts,\n PvoResult,\n PvtOpts,\n RocOpts,\n RsiOpts,\n RvgiOpts,\n RvgiResult,\n RviOpts,\n SessionVolumeProfileOpts,\n SessionVolumeProfileResult,\n SmaOpts,\n SmiOpts,\n SmiResult,\n SmmaOpts,\n StdevOpts,\n StochOpts,\n StochResult,\n StochRsiOpts,\n StochRsiResult,\n SupertrendOpts,\n SupertrendResult,\n TaNamespace,\n TemaOpts,\n TrendStrengthIndexOpts,\n TrixOpts,\n TrixResult,\n TsiOpts,\n TsiResult,\n UlcerIndexOpts,\n UltimateOscOpts,\n ValuewhenOpts,\n VolOpts,\n VolatilityStopOpts,\n VolatilityStopResult,\n VortexOpts,\n VortexResult,\n VisibleRangeVolumeProfileOpts,\n VisibleRangeVolumeProfileResult,\n VwapOpts,\n VwmaOpts,\n WilliamsFractalOpts,\n WilliamsFractalResult,\n WilliamsROpts,\n WmaOpts,\n ZigZagOpts,\n ZigZagResult,\n} from \"./ta/ta.js\";\nexport type { StatefulPrimitiveEntry } from \"./statefulPrimitives.js\";\nexport { input } from \"./input/index.js\";\nexport type {\n BoolDescriptor,\n ColorDescriptor,\n EnumDescriptor,\n ExternalSeriesDescriptor,\n FloatDescriptor,\n InputDescriptor,\n InputKind,\n IntDescriptor,\n IntervalDescriptorInput,\n PriceDescriptor,\n Schema,\n SourceDescriptor,\n SourceField,\n StringDescriptor,\n SymbolDescriptor,\n TimeDescriptor,\n} from \"./input/index.js\";\nexport { state } from \"./state/index.js\";\nexport type { MutableSlot, StateNamespace } from \"./state/index.js\";\nexport type {\n RunnerSnapshot,\n StateSnapshot,\n StateStoreKey,\n StreamSnapshot,\n} from \"./state/index.js\";\nexport { barstate, syminfo, timeframe } from \"./views/index.js\";\nexport type { BarStateView, SymbolType, SymInfoView, TimeframeView } from \"./views/index.js\";\nexport { request } from \"./request/index.js\";\nexport type {\n RequestLowerTfOpts,\n RequestNamespace,\n RequestSecurityOpts,\n SecurityBar,\n SecurityExpr,\n} from \"./request/index.js\";\nexport { runtime } from \"./runtime/index.js\";\nexport type { LogLevel, RuntimeNamespace } from \"./runtime/index.js\";\nexport { color, fromGradient, hsl, rgb, withAlpha } from \"./color/index.js\";\nexport type { GradientStop } from \"./color/index.js\";\nexport { hline, plot } from \"./plot/index.js\";\nexport type { HLineOpts, PlotKind, PlotOpts, PlotOptsStyle } from \"./plot/plot.js\";\nexport { alert } from \"./alert/index.js\";\nexport type { AlertOpts } from \"./alert/alert.js\";\nexport { STATEFUL_PRIMITIVES, STATEFUL_PRIMITIVES_BY_NAME } from \"./statefulPrimitives.js\";\nexport {\n DRAWING_KINDS,\n KIND_BUCKET,\n KIND_CAMELCASE,\n KIND_KEBABCASE,\n bucketFor,\n draw,\n} from \"./draw/index.js\";\nexport type {\n AbcdPatternState,\n AnchorHept,\n AnchorPair,\n AnchorQuad,\n AnchorQuint,\n AnchorTriple,\n ArcState,\n ArrowMarkDownState,\n ArrowMarkUpState,\n ArrowMarkerOpts,\n ArrowMarkerState,\n ArrowOpts,\n ArrowState,\n BrushState,\n BrushStyle,\n CircleState,\n CrossLineState,\n CurveState,\n CyclicLinesState,\n CypherPatternState,\n DisjointChannelState,\n DoubleCurveState,\n DrawNamespace,\n DrawingBucket,\n DrawingHandle,\n DrawingKind,\n DrawingMeta,\n DrawingState,\n ElliottCorrectionWaveState,\n ElliottDoubleComboState,\n ElliottImpulseWaveState,\n ElliottTriangleWaveState,\n ElliottTripleComboState,\n EllipseState,\n FibChannelState,\n FibCirclesState,\n FibOpts,\n FibRetracementState,\n FibSpeedArcsState,\n FibSpeedFanState,\n FibSpiralState,\n FibTimeZoneState,\n FibTrendExtensionState,\n FibTrendTimeState,\n FibWedgeState,\n FillBetweenState,\n FillBetweenStyle,\n FlatTopBottomState,\n FrameOpts,\n FrameState,\n GannBoxState,\n GannFanState,\n GannSquareFixedState,\n GannSquareState,\n GroupState,\n HeadAndShouldersState,\n HighlighterState,\n HighlighterStyle,\n HorizontalLineState,\n HorizontalRayState,\n LineDrawStyle,\n LineState,\n MarkerState,\n PathOpts,\n PathState,\n PenState,\n PitchfanState,\n PitchforkState,\n PolylineState,\n RectangleState,\n RegressionTrendOpts,\n RegressionTrendState,\n RotatedRectangleState,\n ShapeStyle,\n SineLineState,\n TableCell,\n TableOpts,\n TablePosition,\n TableState,\n TextOpts,\n TextState,\n ThreeDrivesPatternState,\n TimeCyclesState,\n TrendAngleState,\n TrendChannelState,\n TriangleState,\n TrianglePatternState,\n VerticalLineState,\n WorldPoint,\n XabcdPatternState,\n ZOrdered,\n} from \"./draw/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAkC/D,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;AAY3B,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAyInC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAoBzC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAQzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAQtD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AASjE,OAAO,EAAE,KAAK,EAAE,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","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 type {\n AlertSeverity,\n AlertConditionDefinition,\n AlertConditionDescriptor,\n Bar,\n BarSeries,\n BarViewport,\n CapabilityId,\n Color,\n CompiledScriptBundle,\n CompiledScriptObject,\n ComputeContext,\n ComputeFn,\n DrawingCounts,\n InputSchema,\n IntervalDescriptor,\n JsonValue,\n LineStyle,\n NumberSeriesSlot,\n PlotLineStyle,\n PlotOverride,\n PlotSlotDescriptor,\n Price,\n PriceSeries,\n RequestedFeed,\n ScriptManifest,\n SecurityExpressionDescriptor,\n Series,\n Time,\n Volume,\n VolumeSeries,\n} from \"./types.js\";\nexport { isCompiledScriptBundle } from \"./types.js\";\nexport { intervalToSeconds } from \"./interval/intervalToSeconds.js\";\nexport {\n defineAlert,\n defineAlertCondition,\n defineDrawing,\n defineIndicator,\n} from \"./define/index.js\";\nexport type {\n DefineAlertConditionOpts,\n DefineAlertOpts,\n DefineDrawingOpts,\n DefineIndicatorOpts,\n DependencyDeclaration,\n OutputDeclaration,\n ScaleAxis,\n ScriptOverrides,\n ValueFormat,\n} from \"./define/index.js\";\nexport { ta } from \"./ta/index.js\";\nexport type {\n AdlOpts,\n AdrOpts,\n AdxOpts,\n AlmaOpts,\n AnchoredVolumeProfileOpts,\n AnchoredVolumeProfileResult,\n AnchoredVwapOpts,\n AoOpts,\n AroonOpts,\n AroonOscOpts,\n AroonResult,\n AtrOpts,\n BarssinceOpts,\n BbOpts,\n BbPercentBOpts,\n BbResult,\n BbwOpts,\n BopOpts,\n CciOpts,\n ChandeKrollStopOpts,\n ChandeKrollStopResult,\n ChandelierOpts,\n ChaikinOscOpts,\n ChandelierResult,\n ChangeOpts,\n ChopOpts,\n CmfOpts,\n CmoOpts,\n ConnorsRsiOpts,\n CoppockOpts,\n CrossoverOpts,\n CrossunderOpts,\n DemaOpts,\n DmiOpts,\n DmiResult,\n DonchianOpts,\n DonchianResult,\n DpoOpts,\n EmaOpts,\n EomOpts,\n EnvelopeOpts,\n EnvelopeResult,\n FisherOpts,\n FisherResult,\n FixedRangeVolumeProfileOpts,\n FixedRangeVolumeProfileResult,\n HighestOpts,\n HighestbarsOpts,\n HmaOpts,\n HvOpts,\n IchimokuOpts,\n IchimokuResult,\n KamaOpts,\n KeltnerOpts,\n KeltnerResult,\n KlingerOpts,\n KlingerResult,\n KstOpts,\n KstResult,\n LowestOpts,\n LowestbarsOpts,\n LsmaOpts,\n MacdOpts,\n MacdResult,\n MaRibbonOpts,\n MaRibbonResult,\n MassIndexOpts,\n MaTypeNoVolume,\n McginleyOpts,\n MedianOpts,\n MfiOpts,\n MomentumOpts,\n NetVolumeOpts,\n NviOpts,\n ObvOpts,\n PivotsHighLowOpts,\n PivotsHighLowResult,\n PivotsStandardOpts,\n PivotsStandardResult,\n PivotsStandardSystem,\n PmoOpts,\n PmoResult,\n PpoOpts,\n PpoResult,\n PsarOpts,\n PsarResult,\n PviOpts,\n PvoOpts,\n PvoResult,\n PvtOpts,\n RocOpts,\n RsiOpts,\n RvgiOpts,\n RvgiResult,\n RviOpts,\n SessionVolumeProfileOpts,\n SessionVolumeProfileResult,\n SmaOpts,\n SmiOpts,\n SmiResult,\n SmmaOpts,\n StdevOpts,\n StochOpts,\n StochResult,\n StochRsiOpts,\n StochRsiResult,\n SupertrendOpts,\n SupertrendResult,\n TaNamespace,\n TemaOpts,\n TrendStrengthIndexOpts,\n TrixOpts,\n TrixResult,\n TsiOpts,\n TsiResult,\n UlcerIndexOpts,\n UltimateOscOpts,\n ValuewhenOpts,\n VolOpts,\n VolatilityStopOpts,\n VolatilityStopResult,\n VortexOpts,\n VortexResult,\n VisibleRangeVolumeProfileOpts,\n VisibleRangeVolumeProfileResult,\n VwapOpts,\n VwmaOpts,\n WilliamsFractalOpts,\n WilliamsFractalResult,\n WilliamsROpts,\n WmaOpts,\n ZigZagOpts,\n ZigZagResult,\n} from \"./ta/ta.js\";\nexport type { StatefulPrimitiveEntry } from \"./statefulPrimitives.js\";\nexport { input } from \"./input/index.js\";\nexport type {\n BoolDescriptor,\n ColorDescriptor,\n EnumDescriptor,\n ExternalSeriesDescriptor,\n FloatDescriptor,\n InputDescriptor,\n InputKind,\n IntDescriptor,\n IntervalDescriptorInput,\n PriceDescriptor,\n Schema,\n SessionDescriptor,\n SourceDescriptor,\n SourceField,\n StringDescriptor,\n SymbolDescriptor,\n TimeDescriptor,\n} from \"./input/index.js\";\nexport { state } from \"./state/index.js\";\nexport type { MutableArraySlot, MutableSlot, StateNamespace } from \"./state/index.js\";\nexport type {\n RunnerSnapshot,\n StateSnapshot,\n StateStoreKey,\n StreamSnapshot,\n} from \"./state/index.js\";\nexport { session, time } from \"./time-accessors/index.js\";\nexport type { SessionNamespace, TimeNamespace } from \"./time-accessors/index.js\";\nexport { barstate, syminfo, timeframe } from \"./views/index.js\";\nexport type { BarStateView, SymbolType, SymInfoView, TimeframeView } from \"./views/index.js\";\nexport { feedKey, request } from \"./request/index.js\";\nexport type {\n RequestLowerTfOpts,\n RequestNamespace,\n RequestSecurityOpts,\n SecurityBar,\n SecurityExpr,\n} from \"./request/index.js\";\nexport { runtime } from \"./runtime/index.js\";\nexport type { LogLevel, RuntimeNamespace } from \"./runtime/index.js\";\nexport { color, fromGradient, hsl, rgb, withAlpha } from \"./color/index.js\";\nexport type { GradientStop } from \"./color/index.js\";\nexport { barcolor, bgcolor, hline, plot } from \"./plot/index.js\";\nexport type {\n BarColorOpts,\n BgColorOpts,\n HLineOpts,\n PlotKind,\n PlotOpts,\n PlotOptsStyle,\n} from \"./plot/plot.js\";\nexport { alert } from \"./alert/index.js\";\nexport type { AlertOpts } from \"./alert/alert.js\";\nexport { STATEFUL_PRIMITIVES, STATEFUL_PRIMITIVES_BY_NAME } from \"./statefulPrimitives.js\";\nexport {\n DRAWING_KINDS,\n KIND_BUCKET,\n KIND_CAMELCASE,\n KIND_KEBABCASE,\n bucketFor,\n draw,\n} from \"./draw/index.js\";\nexport type {\n AbcdPatternState,\n AnchorHept,\n AnchorPair,\n AnchorQuad,\n AnchorQuint,\n AnchorTriple,\n ArcState,\n ArrowMarkDownState,\n ArrowMarkUpState,\n ArrowMarkerOpts,\n ArrowMarkerState,\n ArrowOpts,\n ArrowState,\n BrushState,\n BrushStyle,\n CircleState,\n CrossLineState,\n CurveState,\n CyclicLinesState,\n CypherPatternState,\n DisjointChannelState,\n DoubleCurveState,\n DrawNamespace,\n DrawingBucket,\n DrawingHandle,\n DrawingKind,\n DrawingMeta,\n DrawingState,\n ElliottCorrectionWaveState,\n ElliottDoubleComboState,\n ElliottImpulseWaveState,\n ElliottTriangleWaveState,\n ElliottTripleComboState,\n EllipseState,\n FibChannelState,\n FibCirclesState,\n FibOpts,\n FibRetracementState,\n FibSpeedArcsState,\n FibSpeedFanState,\n FibSpiralState,\n FibTimeZoneState,\n FibTrendExtensionState,\n FibTrendTimeState,\n FibWedgeState,\n FillBetweenState,\n FillBetweenStyle,\n FlatTopBottomState,\n FrameOpts,\n FrameState,\n GannBoxState,\n GannFanState,\n GannSquareFixedState,\n GannSquareState,\n GroupState,\n HeadAndShouldersState,\n HighlighterState,\n HighlighterStyle,\n HorizontalLineState,\n HorizontalRayState,\n LineDrawStyle,\n LineState,\n MarkerState,\n PathOpts,\n PathState,\n PenState,\n PitchfanState,\n PitchforkState,\n PolylineState,\n RectangleState,\n RegressionTrendOpts,\n RegressionTrendState,\n RotatedRectangleState,\n ShapeStyle,\n SineLineState,\n TableCell,\n TableOpts,\n TablePosition,\n TableState,\n TextOpts,\n TextState,\n ThreeDrivesPatternState,\n TimeCyclesState,\n TrendAngleState,\n TrendChannelState,\n TriangleState,\n TrianglePatternState,\n VerticalLineState,\n WorldPoint,\n XabcdPatternState,\n ZOrdered,\n} from \"./draw/index.js\";\n"]}
@@ -1,3 +1,3 @@
1
1
  export { input } from "./input.js";
2
- export type { BoolDescriptor, ColorDescriptor, EnumDescriptor, ExternalSeriesDescriptor, FloatDescriptor, InputDescriptor, InputKind, IntDescriptor, IntervalDescriptorInput, PriceDescriptor, Schema, SourceDescriptor, SourceField, StringDescriptor, SymbolDescriptor, TimeDescriptor, } from "./inputDescriptor.js";
2
+ export type { BoolDescriptor, ColorDescriptor, EnumDescriptor, ExternalSeriesDescriptor, FloatDescriptor, InputDescriptor, InputKind, IntDescriptor, IntervalDescriptorInput, PriceDescriptor, Schema, SessionDescriptor, SourceDescriptor, SourceField, StringDescriptor, SymbolDescriptor, TimeDescriptor, } from "./inputDescriptor.js";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/input/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EACR,cAAc,EACd,eAAe,EACf,cAAc,EACd,wBAAwB,EACxB,eAAe,EACf,eAAe,EACf,SAAS,EACT,aAAa,EACb,uBAAuB,EACvB,eAAe,EACf,MAAM,EACN,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACjB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/input/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EACR,cAAc,EACd,eAAe,EACf,cAAc,EACd,wBAAwB,EACxB,eAAe,EACf,eAAe,EACf,SAAS,EACT,aAAa,EACb,uBAAuB,EACvB,eAAe,EACf,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACjB,MAAM,sBAAsB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/input/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nexport { input } from \"./input.js\";\nexport type {\n BoolDescriptor,\n ColorDescriptor,\n EnumDescriptor,\n ExternalSeriesDescriptor,\n FloatDescriptor,\n InputDescriptor,\n InputKind,\n IntDescriptor,\n IntervalDescriptorInput,\n PriceDescriptor,\n Schema,\n SourceDescriptor,\n SourceField,\n StringDescriptor,\n SymbolDescriptor,\n TimeDescriptor,\n} from \"./inputDescriptor.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/input/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nexport { input } from \"./input.js\";\nexport type {\n BoolDescriptor,\n ColorDescriptor,\n EnumDescriptor,\n ExternalSeriesDescriptor,\n FloatDescriptor,\n InputDescriptor,\n InputKind,\n IntDescriptor,\n IntervalDescriptorInput,\n PriceDescriptor,\n Schema,\n SessionDescriptor,\n SourceDescriptor,\n SourceField,\n StringDescriptor,\n SymbolDescriptor,\n TimeDescriptor,\n} from \"./inputDescriptor.js\";\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { Color, Price, Time } from "../types.js";
2
- import type { BoolDescriptor, ColorDescriptor, EnumDescriptor, ExternalSeriesDescriptor, FloatDescriptor, IntDescriptor, IntervalDescriptorInput, PriceDescriptor, Schema, SourceDescriptor, SourceField, StringDescriptor, SymbolDescriptor, TimeDescriptor } from "./inputDescriptor.js";
2
+ import type { BoolDescriptor, ColorDescriptor, EnumDescriptor, ExternalSeriesDescriptor, FloatDescriptor, IntDescriptor, IntervalDescriptorInput, PriceDescriptor, Schema, SessionDescriptor, SourceDescriptor, SourceField, StringDescriptor, SymbolDescriptor, TimeDescriptor } from "./inputDescriptor.js";
3
3
  /**
4
4
  * The `input.*` namespace. Every builder is a compile-time literal: the
5
5
  * compiler reads the call expression and serialises the descriptor into
@@ -153,6 +153,20 @@ export declare const input: Readonly<{
153
153
  interval(defaultValue: string, opts?: {
154
154
  readonly title?: string;
155
155
  }): IntervalDescriptorInput;
156
+ /**
157
+ * Build a session-window input descriptor (`"HH:MM-HH:MM"`). The value is
158
+ * a free string in v1 (the grammar is parsed at runtime by
159
+ * `session.isOpen`), mirroring `input.string`.
160
+ *
161
+ * @since 1.5
162
+ * @stable
163
+ * @example
164
+ * const sess = input.session("0930-1600", { title: "Session" });
165
+ * void sess;
166
+ */
167
+ session(defaultValue: string, opts?: {
168
+ readonly title?: string;
169
+ }): SessionDescriptor;
156
170
  /**
157
171
  * Build an adapter-supplied external series input descriptor.
158
172
  *
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/input/input.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EACR,cAAc,EACd,eAAe,EACf,cAAc,EACd,wBAAwB,EACxB,eAAe,EACf,aAAa,EACb,uBAAuB,EACvB,eAAe,EACf,MAAM,EACN,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACjB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,KAAK;IACd;;;;;;;;OAQG;sBAEe,MAAM,SACb;QACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;KAC3B,GACF,aAAa;IAIhB;;;;;;;;OAQG;wBAEe,MAAM,SACb;QACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;KAC3B,GACF,eAAe;IAIlB;;;;;;;;OAQG;uBACgB,OAAO,SAAS;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,cAAc;IAI/E;;;;;;;;OAQG;yBAEe,MAAM,SACb;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;Q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, opts) {
151
151
  return Object.freeze({ kind: "interval", defaultValue, ...opts });
152
152
  },
153
+ /**
154
+ * Build a session-window input descriptor (`"HH:MM-HH:MM"`). The value is
155
+ * a free string in v1 (the grammar is parsed at runtime by
156
+ * `session.isOpen`), mirroring `input.string`.
157
+ *
158
+ * @since 1.5
159
+ * @stable
160
+ * @example
161
+ * const sess = input.session("0930-1600", { title: "Session" });
162
+ * void sess;
163
+ */
164
+ session(defaultValue, opts) {
165
+ return Object.freeze({ kind: "session", defaultValue, ...opts });
166
+ },
153
167
  /**
154
168
  * Build an adapter-supplied external series input descriptor.
155
169
  *
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/input/input.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAoB/D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/B;;;;;;;;OAQG;IACH,GAAG,CACC,YAAoB,EACpB,IAKC;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,KAAc,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CACD,YAAoB,EACpB,IAKC;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAgB,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CAAC,YAAqB,EAAE,IAAkC;QAC1D,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CACF,YAAoB,EACpB,IAAgE;QAEhE,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,QAAiB,EAAE,YAA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Q,CAAC,YAAoB,EAAE,IAAkC;QAC7D,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,UAAmB,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;;;;OAWG;IACH,cAAc,CAAI,IAIjB;QACG,OAAO,MAAM,CAAC,MAAM,CAAC;YACjB,IAAI,EAAE,iBAA0B;YAChC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;SAC7D,CAAC,CAAC;IACP,CAAC;CACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nimport type { Color, Price, Time } from \"../types.js\";\nimport type {\n BoolDescriptor,\n ColorDescriptor,\n EnumDescriptor,\n ExternalSeriesDescriptor,\n FloatDescriptor,\n IntDescriptor,\n IntervalDescriptorInput,\n PriceDescriptor,\n Schema,\n SourceDescriptor,\n SourceField,\n StringDescriptor,\n SymbolDescriptor,\n TimeDescriptor,\n} from \"./inputDescriptor.js\";\n\n/**\n * The `input.*` namespace. Every builder is a compile-time literal: the\n * compiler reads the call expression and serialises the descriptor into\n * `manifest.inputs`.\n *\n * @since 0.4\n * @stable\n * @example\n * import { input } from \"@invinite-org/chartlang-core\";\n * const length = input.int(20, { min: 1, max: 200, title: \"Length\" });\n * void length;\n */\nexport const input = Object.freeze({\n /**\n * Build an integer input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const length = input.int(20, { min: 1, max: 200 });\n * void length;\n */\n int(\n defaultValue: number,\n opts?: {\n readonly min?: number;\n readonly max?: number;\n readonly step?: number;\n readonly title?: string;\n },\n ): IntDescriptor {\n return Object.freeze({ kind: \"int\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a floating-point input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const multiplier = input.float(2.5, { step: 0.5 });\n * void multiplier;\n */\n float(\n defaultValue: number,\n opts?: {\n readonly min?: number;\n readonly max?: number;\n readonly step?: number;\n readonly title?: string;\n },\n ): FloatDescriptor {\n return Object.freeze({ kind: \"float\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a boolean input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const enabled = input.bool(true);\n * void enabled;\n */\n bool(defaultValue: boolean, opts?: { readonly title?: string }): BoolDescriptor {\n return Object.freeze({ kind: \"bool\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a string input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const symbol = input.string(\"AAPL\");\n * void symbol;\n */\n string(\n defaultValue: string,\n opts?: { readonly title?: string; readonly multiline?: boolean },\n ): StringDescriptor {\n return Object.freeze({ kind: \"string\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a string enum input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const mode = input.enum(\"fast\", [\"fast\", \"slow\"]);\n * void mode;\n */\n enum<T extends string>(\n defaultValue: T,\n options: ReadonlyArray<T>,\n opts?: { readonly title?: string },\n ): EnumDescriptor<T> {\n return Object.freeze({\n kind: \"enum\" as const,\n defaultValue,\n options: Object.freeze(options.slice()),\n ...opts,\n });\n },\n\n /**\n * Build a color input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const c = input.color(\"#26a69a\");\n * void c;\n */\n color(defaultValue: Color, opts?: { readonly title?: string }): ColorDescriptor {\n return Object.freeze({ kind: \"color\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a source-field input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const source = input.source(\"close\");\n * void source;\n */\n source(defaultValue: SourceField, opts?: { readonly title?: string }): SourceDescriptor {\n return Object.freeze({ kind: \"source\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a time input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const anchor = input.time(1_700_000_000_000, { pickFromChart: true });\n * void anchor;\n */\n time(\n defaultValue: Time,\n opts?: { readonly title?: string; readonly pickFromChart?: boolean },\n ): TimeDescriptor {\n return Object.freeze({ kind: \"time\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a price input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const level = input.price(101.25);\n * void level;\n */\n price(defaultValue: Price, opts?: { readonly title?: string }): PriceDescriptor {\n return Object.freeze({ kind: \"price\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a symbol input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const ticker = input.symbol(\"AAPL\");\n * void ticker;\n */\n symbol(defaultValue: string, opts?: { readonly title?: string }): SymbolDescriptor {\n return Object.freeze({ kind: \"symbol\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a main-interval input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const interval = input.interval(\"1D\");\n * void interval;\n */\n interval(defaultValue: string, opts?: { readonly title?: string }): IntervalDescriptorInput {\n return Object.freeze({ kind: \"interval\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build an adapter-supplied external series input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const earnings = input.externalSeries({\n * name: \"earnings\",\n * schema: { kind: \"external-series-schema\" },\n * });\n * void earnings;\n */\n externalSeries<T>(args: {\n readonly name: string;\n readonly schema: Schema<T>;\n readonly title?: string;\n }): ExternalSeriesDescriptor<T> {\n return Object.freeze({\n kind: \"external-series\" as const,\n name: args.name,\n schema: args.schema,\n ...(args.title === undefined ? {} : { title: args.title }),\n });\n },\n});\n"]}
1
+ {"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/input/input.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAqB/D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,C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K,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;SAC7D,CAAC,CAAC;IACP,CAAC;CACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nimport type { Color, Price, Time } from \"../types.js\";\nimport type {\n BoolDescriptor,\n ColorDescriptor,\n EnumDescriptor,\n ExternalSeriesDescriptor,\n FloatDescriptor,\n IntDescriptor,\n IntervalDescriptorInput,\n PriceDescriptor,\n Schema,\n SessionDescriptor,\n SourceDescriptor,\n SourceField,\n StringDescriptor,\n SymbolDescriptor,\n TimeDescriptor,\n} from \"./inputDescriptor.js\";\n\n/**\n * The `input.*` namespace. Every builder is a compile-time literal: the\n * compiler reads the call expression and serialises the descriptor into\n * `manifest.inputs`.\n *\n * @since 0.4\n * @stable\n * @example\n * import { input } from \"@invinite-org/chartlang-core\";\n * const length = input.int(20, { min: 1, max: 200, title: \"Length\" });\n * void length;\n */\nexport const input = Object.freeze({\n /**\n * Build an integer input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const length = input.int(20, { min: 1, max: 200 });\n * void length;\n */\n int(\n defaultValue: number,\n opts?: {\n readonly min?: number;\n readonly max?: number;\n readonly step?: number;\n readonly title?: string;\n },\n ): IntDescriptor {\n return Object.freeze({ kind: \"int\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a floating-point input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const multiplier = input.float(2.5, { step: 0.5 });\n * void multiplier;\n */\n float(\n defaultValue: number,\n opts?: {\n readonly min?: number;\n readonly max?: number;\n readonly step?: number;\n readonly title?: string;\n },\n ): FloatDescriptor {\n return Object.freeze({ kind: \"float\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a boolean input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const enabled = input.bool(true);\n * void enabled;\n */\n bool(defaultValue: boolean, opts?: { readonly title?: string }): BoolDescriptor {\n return Object.freeze({ kind: \"bool\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a string input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const symbol = input.string(\"AAPL\");\n * void symbol;\n */\n string(\n defaultValue: string,\n opts?: { readonly title?: string; readonly multiline?: boolean },\n ): StringDescriptor {\n return Object.freeze({ kind: \"string\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a string enum input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const mode = input.enum(\"fast\", [\"fast\", \"slow\"]);\n * void mode;\n */\n enum<T extends string>(\n defaultValue: T,\n options: ReadonlyArray<T>,\n opts?: { readonly title?: string },\n ): EnumDescriptor<T> {\n return Object.freeze({\n kind: \"enum\" as const,\n defaultValue,\n options: Object.freeze(options.slice()),\n ...opts,\n });\n },\n\n /**\n * Build a color input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const c = input.color(\"#26a69a\");\n * void c;\n */\n color(defaultValue: Color, opts?: { readonly title?: string }): ColorDescriptor {\n return Object.freeze({ kind: \"color\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a source-field input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const source = input.source(\"close\");\n * void source;\n */\n source(defaultValue: SourceField, opts?: { readonly title?: string }): SourceDescriptor {\n return Object.freeze({ kind: \"source\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a time input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const anchor = input.time(1_700_000_000_000, { pickFromChart: true });\n * void anchor;\n */\n time(\n defaultValue: Time,\n opts?: { readonly title?: string; readonly pickFromChart?: boolean },\n ): TimeDescriptor {\n return Object.freeze({ kind: \"time\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a price input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const level = input.price(101.25);\n * void level;\n */\n price(defaultValue: Price, opts?: { readonly title?: string }): PriceDescriptor {\n return Object.freeze({ kind: \"price\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a symbol input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const ticker = input.symbol(\"AAPL\");\n * void ticker;\n */\n symbol(defaultValue: string, opts?: { readonly title?: string }): SymbolDescriptor {\n return Object.freeze({ kind: \"symbol\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a main-interval input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const interval = input.interval(\"1D\");\n * void interval;\n */\n interval(defaultValue: string, opts?: { readonly title?: string }): IntervalDescriptorInput {\n return Object.freeze({ kind: \"interval\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a session-window input descriptor (`\"HH:MM-HH:MM\"`). The value is\n * a free string in v1 (the grammar is parsed at runtime by\n * `session.isOpen`), mirroring `input.string`.\n *\n * @since 1.5\n * @stable\n * @example\n * const sess = input.session(\"0930-1600\", { title: \"Session\" });\n * void sess;\n */\n session(defaultValue: string, opts?: { readonly title?: string }): SessionDescriptor {\n return Object.freeze({ kind: \"session\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build an adapter-supplied external series input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const earnings = input.externalSeries({\n * name: \"earnings\",\n * schema: { kind: \"external-series-schema\" },\n * });\n * void earnings;\n */\n externalSeries<T>(args: {\n readonly name: string;\n readonly schema: Schema<T>;\n readonly title?: string;\n }): ExternalSeriesDescriptor<T> {\n return Object.freeze({\n kind: \"external-series\" as const,\n name: args.name,\n schema: args.schema,\n ...(args.title === undefined ? {} : { title: args.title }),\n });\n },\n});\n"]}
@@ -9,7 +9,7 @@ import type { Color } from "../types.js";
9
9
  * const k: InputKind = "int";
10
10
  * void k;
11
11
  */
12
- export type InputKind = "int" | "float" | "bool" | "string" | "enum" | "color" | "source" | "time" | "price" | "symbol" | "interval" | "external-series";
12
+ export type InputKind = "int" | "float" | "bool" | "string" | "enum" | "color" | "source" | "time" | "price" | "symbol" | "interval" | "session" | "external-series";
13
13
  /**
14
14
  * Source-field literal for the pre-computed bar sources the runtime
15
15
  * populates per close.
@@ -55,7 +55,7 @@ type NumericInputOpts = Readonly<{
55
55
  * };
56
56
  * void d;
57
57
  */
58
- export type InputDescriptor<T> = IntDescriptor | FloatDescriptor | BoolDescriptor | StringDescriptor | EnumDescriptor<string> | ColorDescriptor | SourceDescriptor | TimeDescriptor | PriceDescriptor | SymbolDescriptor | IntervalDescriptorInput | ExternalSeriesDescriptor<T>;
58
+ export type InputDescriptor<T> = IntDescriptor | FloatDescriptor | BoolDescriptor | StringDescriptor | EnumDescriptor<string> | ColorDescriptor | SourceDescriptor | TimeDescriptor | PriceDescriptor | SymbolDescriptor | IntervalDescriptorInput | SessionDescriptor | ExternalSeriesDescriptor<T>;
59
59
  type Common<K extends InputKind, T> = Readonly<{
60
60
  kind: K;
61
61
  defaultValue: T;
@@ -181,6 +181,19 @@ export type SymbolDescriptor = Common<"symbol", string>;
181
181
  * void d;
182
182
  */
183
183
  export type IntervalDescriptorInput = Common<"interval", string>;
184
+ /**
185
+ * Descriptor for `input.session(...)`. The value is an `"HH:MM-HH:MM"`
186
+ * (or `"HHMM-HHMM"`) session-window spec consumed by `session.isOpen`.
187
+ * Structurally a constrained string; v1 does not validate the grammar at
188
+ * compile time.
189
+ *
190
+ * @since 1.5
191
+ * @stable
192
+ * @example
193
+ * const d: SessionDescriptor = { kind: "session", defaultValue: "0930-1600" };
194
+ * void d;
195
+ */
196
+ export type SessionDescriptor = Common<"session", string>;
184
197
  /**
185
198
  * Descriptor for `input.externalSeries(...)`.
186
199
  *
@@ -1 +1 @@
1
- {"version":3,"file":"inputDescriptor.d.ts","sourceRoot":"","sources":["../../src/input/inputDescriptor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC;;;;;;;;;GASG;AACH,MAAM,MAAM,SAAS,GACf,KAAK,GACL,OAAO,GACP,MAAM,GACN,QAAQ,GACR,MAAM,GACN,OAAO,GACP,QAAQ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AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAExD;;;;;;;;GAQG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AAEjE;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AAE1D;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,wBAAwB,CAAC,CAAC,IAAI,QAAQ,CAAC;IAC/C,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"inputDescriptor.js","sourceRoot":"","sources":["../../src/input/inputDescriptor.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 } from \"../types.js\";\n\n/**\n * Wire-tagged discriminator for every `input.*` descriptor. Mirrors the\n * adapter-kit `InputKind` alias; the two live in lockstep.\n *\n * @since 0.4\n * @stable\n * @example\n * const k: InputKind = \"int\";\n * void k;\n */\nexport type InputKind =\n | \"int\"\n | \"float\"\n | \"bool\"\n | \"string\"\n | \"enum\"\n | \"color\"\n | \"source\"\n | \"time\"\n | \"price\"\n | \"symbol\"\n | \"interval\"\n | \"external-series\";\n\n/**\n * Source-field literal for the pre-computed bar sources the runtime\n * populates per close.\n *\n * @since 0.4\n * @stable\n * @example\n * const f: SourceField = \"hlc3\";\n * void f;\n */\nexport type SourceField = \"open\" | \"high\" | \"low\" | \"close\" | \"hl2\" | \"hlc3\" | \"ohlc4\" | \"hlcc4\";\n\n/**\n * Opaque schema wrapper for `input.externalSeries`. Phase 4 ships the type\n * only; runtime validation lands in Phase 5.\n *\n * @since 0.4\n * @stable\n * @example\n * const s: Schema<number> = { kind: \"external-series-schema\" };\n * void s;\n */\nexport type Schema<T> = Readonly<{ kind: \"external-series-schema\"; __brand?: T }>;\n\ntype NumericInputOpts = Readonly<{ min?: number; max?: number; step?: number }>;\n\n/**\n * Typed input descriptor returned by every `input.*` builder. The `kind`\n * discriminator matches {@link InputKind}; remaining fields carry defaults\n * and UI hints.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: InputDescriptor<number> = {\n * kind: \"int\",\n * defaultValue: 14,\n * title: \"Length\",\n * };\n * void d;\n */\nexport type InputDescriptor<T> =\n | IntDescriptor\n | FloatDescriptor\n | BoolDescriptor\n | StringDescriptor\n | EnumDescriptor<string>\n | ColorDescriptor\n | SourceDescriptor\n | TimeDescriptor\n | PriceDescriptor\n | SymbolDescriptor\n | IntervalDescriptorInput\n | ExternalSeriesDescriptor<T>;\n\ntype Common<K extends InputKind, T> = Readonly<{\n kind: K;\n defaultValue: T;\n title?: string;\n}>;\n\n/**\n * Descriptor for `input.int(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: IntDescriptor = { kind: \"int\", defaultValue: 20, min: 1 };\n * void d;\n */\nexport type IntDescriptor = Common<\"int\", number> & NumericInputOpts;\n\n/**\n * Descriptor for `input.float(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: FloatDescriptor = { kind: \"float\", defaultValue: 2.5, step: 0.5 };\n * void d;\n */\nexport type FloatDescriptor = Common<\"float\", number> & NumericInputOpts;\n\n/**\n * Descriptor for `input.bool(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: BoolDescriptor = { kind: \"bool\", defaultValue: true };\n * void d;\n */\nexport type BoolDescriptor = Common<\"bool\", boolean>;\n\n/**\n * Descriptor for `input.string(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: StringDescriptor = { kind: \"string\", defaultValue: \"AAPL\" };\n * void d;\n */\nexport type StringDescriptor = Common<\"string\", string> & Readonly<{ multiline?: boolean }>;\n\n/**\n * Descriptor for `input.enum(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: EnumDescriptor<\"a\" | \"b\"> = {\n * kind: \"enum\",\n * defaultValue: \"a\",\n * options: [\"a\", \"b\"],\n * };\n * void d;\n */\nexport type EnumDescriptor<T extends string> = Common<\"enum\", T> &\n Readonly<{ options: ReadonlyArray<T> }>;\n\n/**\n * Descriptor for `input.color(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: ColorDescriptor = { kind: \"color\", defaultValue: \"#26a69a\" };\n * void d;\n */\nexport type ColorDescriptor = Common<\"color\", Color>;\n\n/**\n * Descriptor for `input.source(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: SourceDescriptor = { kind: \"source\", defaultValue: \"close\" };\n * void d;\n */\nexport type SourceDescriptor = Common<\"source\", SourceField>;\n\n/**\n * Descriptor for `input.time(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: TimeDescriptor = { kind: \"time\", defaultValue: 1_700_000_000_000 };\n * void d;\n */\nexport type TimeDescriptor = Common<\"time\", number> & Readonly<{ pickFromChart?: boolean }>;\n\n/**\n * Descriptor for `input.price(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: PriceDescriptor = { kind: \"price\", defaultValue: 101.25 };\n * void d;\n */\nexport type PriceDescriptor = Common<\"price\", number>;\n\n/**\n * Descriptor for `input.symbol(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: SymbolDescriptor = { kind: \"symbol\", defaultValue: \"AAPL\" };\n * void d;\n */\nexport type SymbolDescriptor = Common<\"symbol\", string>;\n\n/**\n * Descriptor for `input.interval(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: IntervalDescriptorInput = { kind: \"interval\", defaultValue: \"1D\" };\n * void d;\n */\nexport type IntervalDescriptorInput = Common<\"interval\", string>;\n\n/**\n * Descriptor for `input.externalSeries(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: ExternalSeriesDescriptor<number> = {\n * kind: \"external-series\",\n * name: \"earnings\",\n * schema: { kind: \"external-series-schema\" },\n * };\n * void d;\n */\nexport type ExternalSeriesDescriptor<T> = Readonly<{\n kind: \"external-series\";\n name: string;\n schema: Schema<T>;\n title?: string;\n}>;\n"]}
1
+ {"version":3,"file":"inputDescriptor.js","sourceRoot":"","sources":["../../src/input/inputDescriptor.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 } from \"../types.js\";\n\n/**\n * Wire-tagged discriminator for every `input.*` descriptor. Mirrors the\n * adapter-kit `InputKind` alias; the two live in lockstep.\n *\n * @since 0.4\n * @stable\n * @example\n * const k: InputKind = \"int\";\n * void k;\n */\nexport type InputKind =\n | \"int\"\n | \"float\"\n | \"bool\"\n | \"string\"\n | \"enum\"\n | \"color\"\n | \"source\"\n | \"time\"\n | \"price\"\n | \"symbol\"\n | \"interval\"\n | \"session\"\n | \"external-series\";\n\n/**\n * Source-field literal for the pre-computed bar sources the runtime\n * populates per close.\n *\n * @since 0.4\n * @stable\n * @example\n * const f: SourceField = \"hlc3\";\n * void f;\n */\nexport type SourceField = \"open\" | \"high\" | \"low\" | \"close\" | \"hl2\" | \"hlc3\" | \"ohlc4\" | \"hlcc4\";\n\n/**\n * Opaque schema wrapper for `input.externalSeries`. Phase 4 ships the type\n * only; runtime validation lands in Phase 5.\n *\n * @since 0.4\n * @stable\n * @example\n * const s: Schema<number> = { kind: \"external-series-schema\" };\n * void s;\n */\nexport type Schema<T> = Readonly<{ kind: \"external-series-schema\"; __brand?: T }>;\n\ntype NumericInputOpts = Readonly<{ min?: number; max?: number; step?: number }>;\n\n/**\n * Typed input descriptor returned by every `input.*` builder. The `kind`\n * discriminator matches {@link InputKind}; remaining fields carry defaults\n * and UI hints.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: InputDescriptor<number> = {\n * kind: \"int\",\n * defaultValue: 14,\n * title: \"Length\",\n * };\n * void d;\n */\nexport type InputDescriptor<T> =\n | IntDescriptor\n | FloatDescriptor\n | BoolDescriptor\n | StringDescriptor\n | EnumDescriptor<string>\n | ColorDescriptor\n | SourceDescriptor\n | TimeDescriptor\n | PriceDescriptor\n | SymbolDescriptor\n | IntervalDescriptorInput\n | SessionDescriptor\n | ExternalSeriesDescriptor<T>;\n\ntype Common<K extends InputKind, T> = Readonly<{\n kind: K;\n defaultValue: T;\n title?: string;\n}>;\n\n/**\n * Descriptor for `input.int(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: IntDescriptor = { kind: \"int\", defaultValue: 20, min: 1 };\n * void d;\n */\nexport type IntDescriptor = Common<\"int\", number> & NumericInputOpts;\n\n/**\n * Descriptor for `input.float(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: FloatDescriptor = { kind: \"float\", defaultValue: 2.5, step: 0.5 };\n * void d;\n */\nexport type FloatDescriptor = Common<\"float\", number> & NumericInputOpts;\n\n/**\n * Descriptor for `input.bool(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: BoolDescriptor = { kind: \"bool\", defaultValue: true };\n * void d;\n */\nexport type BoolDescriptor = Common<\"bool\", boolean>;\n\n/**\n * Descriptor for `input.string(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: StringDescriptor = { kind: \"string\", defaultValue: \"AAPL\" };\n * void d;\n */\nexport type StringDescriptor = Common<\"string\", string> & Readonly<{ multiline?: boolean }>;\n\n/**\n * Descriptor for `input.enum(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: EnumDescriptor<\"a\" | \"b\"> = {\n * kind: \"enum\",\n * defaultValue: \"a\",\n * options: [\"a\", \"b\"],\n * };\n * void d;\n */\nexport type EnumDescriptor<T extends string> = Common<\"enum\", T> &\n Readonly<{ options: ReadonlyArray<T> }>;\n\n/**\n * Descriptor for `input.color(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: ColorDescriptor = { kind: \"color\", defaultValue: \"#26a69a\" };\n * void d;\n */\nexport type ColorDescriptor = Common<\"color\", Color>;\n\n/**\n * Descriptor for `input.source(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: SourceDescriptor = { kind: \"source\", defaultValue: \"close\" };\n * void d;\n */\nexport type SourceDescriptor = Common<\"source\", SourceField>;\n\n/**\n * Descriptor for `input.time(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: TimeDescriptor = { kind: \"time\", defaultValue: 1_700_000_000_000 };\n * void d;\n */\nexport type TimeDescriptor = Common<\"time\", number> & Readonly<{ pickFromChart?: boolean }>;\n\n/**\n * Descriptor for `input.price(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: PriceDescriptor = { kind: \"price\", defaultValue: 101.25 };\n * void d;\n */\nexport type PriceDescriptor = Common<\"price\", number>;\n\n/**\n * Descriptor for `input.symbol(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: SymbolDescriptor = { kind: \"symbol\", defaultValue: \"AAPL\" };\n * void d;\n */\nexport type SymbolDescriptor = Common<\"symbol\", string>;\n\n/**\n * Descriptor for `input.interval(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: IntervalDescriptorInput = { kind: \"interval\", defaultValue: \"1D\" };\n * void d;\n */\nexport type IntervalDescriptorInput = Common<\"interval\", string>;\n\n/**\n * Descriptor for `input.session(...)`. The value is an `\"HH:MM-HH:MM\"`\n * (or `\"HHMM-HHMM\"`) session-window spec consumed by `session.isOpen`.\n * Structurally a constrained string; v1 does not validate the grammar at\n * compile time.\n *\n * @since 1.5\n * @stable\n * @example\n * const d: SessionDescriptor = { kind: \"session\", defaultValue: \"0930-1600\" };\n * void d;\n */\nexport type SessionDescriptor = Common<\"session\", string>;\n\n/**\n * Descriptor for `input.externalSeries(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: ExternalSeriesDescriptor<number> = {\n * kind: \"external-series\",\n * name: \"earnings\",\n * schema: { kind: \"external-series-schema\" },\n * };\n * void d;\n */\nexport type ExternalSeriesDescriptor<T> = Readonly<{\n kind: \"external-series\";\n name: string;\n schema: Schema<T>;\n title?: string;\n}>;\n"]}
@@ -277,6 +277,36 @@ export type HLineOpts = Readonly<{
277
277
  */
278
278
  pane?: "overlay" | "new" | string;
279
279
  }>;
280
+ /**
281
+ * Styling options accepted by `bgcolor(...)` — the Pine-ergonomic alias for
282
+ * a `bg-color` pane-background band. `transp` is the 0–100 transparency
283
+ * (0 opaque … 100 fully transparent), mirroring {@link PlotOptsStyle}'s
284
+ * `bg-color` arm. `title` labels the slot for host overrides.
285
+ *
286
+ * @since 1.4
287
+ * @stable
288
+ * @example
289
+ * const opts: BgColorOpts = { transp: 80, title: "RSI heat" };
290
+ * void opts;
291
+ */
292
+ export type BgColorOpts = Readonly<{
293
+ transp?: number;
294
+ title?: string;
295
+ }>;
296
+ /**
297
+ * Styling options accepted by `barcolor(...)` — the Pine-ergonomic alias for
298
+ * a `bar-color` candle/bar tint. The `bar-color` style carries no
299
+ * transparency, so this bag only labels the slot.
300
+ *
301
+ * @since 1.4
302
+ * @stable
303
+ * @example
304
+ * const opts: BarColorOpts = { title: "trend tint" };
305
+ * void opts;
306
+ */
307
+ export type BarColorOpts = Readonly<{
308
+ title?: string;
309
+ }>;
280
310
  /**
281
311
  * Compile-time callable hole for `plot(value, opts?)`. The compiler rewrites
282
312
  * every callsite to dispatch to the runtime's `plot` implementation;
@@ -307,4 +337,34 @@ export declare function plot(_value: number | Series<number>, _opts?: PlotOpts):
307
337
  * try { hline(70); } catch {}
308
338
  */
309
339
  export declare function hline(_price: number, _opts?: HLineOpts): void;
340
+ /**
341
+ * Paint the pane background for the current bar — the Pine-ergonomic alias
342
+ * for `plot(NaN, { style: { kind: "bg-color", color, transp } })`. Pass a
343
+ * `Color` (a CSS / hex string, or a per-bar color expression like
344
+ * `close > open ? "#16a34a" : "#dc2626"`). Sugar over the existing
345
+ * `bg-color` plot style — same wire emission, same capability gate.
346
+ *
347
+ * @since 1.4
348
+ * @stable
349
+ * @example
350
+ * // Inside a compiled `compute`:
351
+ * // bgcolor(bar.close > bar.open ? "#16a34a" : "#dc2626", { transp: 80 });
352
+ * import { bgcolor } from "@invinite-org/chartlang-core";
353
+ * try { bgcolor("#1d4ed8"); } catch {}
354
+ */
355
+ export declare function bgcolor(_color: Color, _opts?: BgColorOpts): void;
356
+ /**
357
+ * Tint the candle / bar for the current bar — the Pine-ergonomic alias for
358
+ * `plot(NaN, { style: { kind: "bar-color", color } })`. Sugar over the
359
+ * existing `bar-color` plot style.
360
+ *
361
+ * @since 1.4
362
+ * @stable
363
+ * @example
364
+ * // Inside a compiled `compute`:
365
+ * // barcolor(bar.close > bar.open ? "#16a34a" : "#dc2626");
366
+ * import { barcolor } from "@invinite-org/chartlang-core";
367
+ * try { barcolor("#a855f7"); } catch {}
368
+ */
369
+ export declare function barcolor(_color: Color, _opts?: BarColorOpts): void;
310
370
  //# sourceMappingURL=plot.d.ts.map
@@ -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;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,QAAQ,GACd,MAAM,GACN,WAAW,GACX,iBAAiB,GACjB,WAAW,GACX,MAAM,GACN,aAAa,GACb,OAAO,GACP,QAAQ,GACR,OAAO,GACP,WAAW,GACX,OAAO,GACP,iBAAiB,GACjB,cAAc,GACd,UAAU,GACV,WAAW,GACX,sBAAsB,CAAC;AAE7B;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,aAAa,GAAG,eAAe,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE/F;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GAAG,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ist/plot/plot.js CHANGED
@@ -34,4 +34,38 @@ export function plot(_value, _opts) {
34
34
  export function hline(_price, _opts) {
35
35
  throw new Error("hline called outside compiled runtime");
36
36
  }
37
+ /**
38
+ * Paint the pane background for the current bar — the Pine-ergonomic alias
39
+ * for `plot(NaN, { style: { kind: "bg-color", color, transp } })`. Pass a
40
+ * `Color` (a CSS / hex string, or a per-bar color expression like
41
+ * `close > open ? "#16a34a" : "#dc2626"`). Sugar over the existing
42
+ * `bg-color` plot style — same wire emission, same capability gate.
43
+ *
44
+ * @since 1.4
45
+ * @stable
46
+ * @example
47
+ * // Inside a compiled `compute`:
48
+ * // bgcolor(bar.close > bar.open ? "#16a34a" : "#dc2626", { transp: 80 });
49
+ * import { bgcolor } from "@invinite-org/chartlang-core";
50
+ * try { bgcolor("#1d4ed8"); } catch {}
51
+ */
52
+ export function bgcolor(_color, _opts) {
53
+ throw new Error("bgcolor called outside compiled runtime");
54
+ }
55
+ /**
56
+ * Tint the candle / bar for the current bar — the Pine-ergonomic alias for
57
+ * `plot(NaN, { style: { kind: "bar-color", color } })`. Sugar over the
58
+ * existing `bar-color` plot style.
59
+ *
60
+ * @since 1.4
61
+ * @stable
62
+ * @example
63
+ * // Inside a compiled `compute`:
64
+ * // barcolor(bar.close > bar.open ? "#16a34a" : "#dc2626");
65
+ * import { barcolor } from "@invinite-org/chartlang-core";
66
+ * try { barcolor("#a855f7"); } catch {}
67
+ */
68
+ export function barcolor(_color, _opts) {
69
+ throw new Error("barcolor called outside compiled runtime");
70
+ }
37
71
  //# sourceMappingURL=plot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plot.js","sourceRoot":"","sources":["../../src/plot/plot.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAgS/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","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, Series } from \"../types.js\";\n\n/**\n * Rendered-shape discriminator for `plot` emissions reaching the adapter.\n * The full 0.5 inventory is `line`, `step-line`, `horizontal-line`,\n * `histogram`, `area`, `filled-band`, `label`, `marker`,\n * `shape`, `character`, `arrow`, `candle-override`, `bar-override`,\n * `bg-color`, `bar-color`, and `horizontal-histogram`. Every expansion is\n * additive — the `apiVersion: 1` script header stays unchanged.\n *\n * Typical Phase-2 consumers:\n *\n * - `histogram` → volume bars, MACD histogram, momentum-style oscillators.\n * - `area` → filled region under a polyline (BB midline, regression).\n * - `filled-band` → Bollinger / Keltner / Donchian / Ichimoku envelopes.\n * - `label` → text annotations at a world-space anchor (fractal, pivot).\n * - `marker` → discrete glyph (circle / triangle / square / diamond) for\n * fractals / divergence / supertrend flips.\n *\n * @since 0.1\n * @example\n * const k: PlotKind = \"line\";\n * const histogram: PlotKind = \"histogram\";\n * const shape: PlotKind = \"shape\";\n * void k; void histogram; void shape;\n */\nexport type PlotKind =\n | \"line\"\n | \"step-line\"\n | \"horizontal-line\"\n | \"histogram\"\n | \"area\"\n | \"filled-band\"\n | \"label\"\n | \"marker\"\n | \"shape\"\n | \"character\"\n | \"arrow\"\n | \"candle-override\"\n | \"bar-override\"\n | \"bg-color\"\n | \"bar-color\"\n | \"horizontal-histogram\";\n\n/**\n * Marker glyphs shared by Phase 2 `marker` and Phase 5 `shape` plot styles.\n *\n * @since 0.5\n * @stable\n * @example\n * const shape: PlotGlyphShape = \"circle\";\n * void shape;\n */\nexport type PlotGlyphShape = \"circle\" | \"triangle-up\" | \"triangle-down\" | \"square\" | \"diamond\";\n\n/**\n * Full glyph inventory for Phase 5 `shape` plot styles.\n *\n * @since 0.5\n * @stable\n * @example\n * const shape: PlotShapeGlyph = \"flag\";\n * void shape;\n */\nexport type PlotShapeGlyph = PlotGlyphShape | \"cross\" | \"xcross\" | \"flag\";\n\n/**\n * Vertical anchoring mode for glyph-like Phase 5 plot styles.\n *\n * @since 0.5\n * @stable\n * @example\n * const location: PlotLocation = \"above\";\n * void location;\n */\nexport type PlotLocation = \"above\" | \"below\" | \"absolute\";\n\n/**\n * Single row in a Phase 5 horizontal-histogram plot emission.\n *\n * @since 0.5\n * @stable\n * @example\n * const bucket: HorizontalHistogramBucket = { price: 100, volume: 25 };\n * void bucket;\n */\nexport type HorizontalHistogramBucket = Readonly<{\n readonly price: number;\n readonly volume: number;\n readonly color?: Color;\n}>;\n\n/**\n * Script-author selectable plot style. The runtime maps this to the\n * adapter-kit's wire `PlotStyle` discriminated union and fills in defaults\n * from sibling {@link PlotOpts} fields (`lineWidth` / `lineStyle`) for\n * line-like styles.\n *\n * `histogram.baseline` defaults to `0` when omitted.\n *\n * @formula N/A — script-facing style input\n * @since 0.2\n * @stable\n * @example\n * const lineStyle: PlotOptsStyle = { kind: \"line\" };\n * const histStyle: PlotOptsStyle = { kind: \"histogram\", baseline: 0 };\n * void lineStyle; void histStyle;\n */\nexport type PlotOptsStyle =\n | { readonly kind: \"line\" }\n | { readonly kind: \"step-line\" }\n | { readonly kind: \"horizontal-line\" }\n | { readonly kind: \"histogram\"; readonly baseline?: number }\n | {\n readonly kind: \"marker\";\n readonly shape: PlotGlyphShape;\n readonly size: number;\n }\n /**\n * Glyph at world-anchor — Pine's `plotshape`. Location selects vertical\n * anchoring; `size` is in CSS pixels.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.close, { style: { kind: \"shape\", shape: \"triangle-up\", size: 8, location: \"below\" } });\n */\n | {\n readonly kind: \"shape\";\n readonly shape: PlotShapeGlyph;\n readonly size: number;\n readonly location?: PlotLocation;\n }\n /**\n * Text glyph at world-anchor — Pine's `plotchar`. `char` may be any\n * non-empty UTF-8 string; `size` is in CSS pixels.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.close, { style: { kind: \"character\", char: \"▲\", size: 12, location: \"above\" } });\n */\n | {\n readonly kind: \"character\";\n readonly char: string;\n readonly size: number;\n readonly location?: PlotLocation;\n }\n /**\n * Directional marker at world-anchor — Pine's `plotarrow`.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.low, { style: { kind: \"arrow\", direction: \"up\", size: 10 } });\n */\n | { readonly kind: \"arrow\"; readonly direction: \"up\" | \"down\"; readonly size: number }\n /**\n * Candle body color override — Pine's `plotcandle`.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.close, { style: { kind: \"candle-override\", bull: \"#26a69a\", bear: \"#ef5350\" } });\n */\n | {\n readonly kind: \"candle-override\";\n readonly bull: Color;\n readonly bear: Color;\n readonly doji?: Color;\n }\n /**\n * OHLC bar outline override — Pine's `plotbar`.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.close, { style: { kind: \"bar-override\", color: \"#f59e0b\" } });\n */\n | { readonly kind: \"bar-override\"; readonly color: Color }\n /**\n * Pane background color band — Pine's `bgcolor`.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.close, { style: { kind: \"bg-color\", color: \"#1d4ed8\", transp: 80 } });\n */\n | { readonly kind: \"bg-color\"; readonly color: Color; readonly transp?: number }\n /**\n * Main candle/bar tint — Pine's `barcolor`.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.close, { style: { kind: \"bar-color\", color: \"#a855f7\" } });\n */\n | { readonly kind: \"bar-color\"; readonly color: Color }\n /**\n * Right-edge volume-profile bars keyed by price bucket.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.close, { style: { kind: \"horizontal-histogram\", buckets: [{ price: bar.close, volume: bar.volume }] } });\n */\n | {\n readonly kind: \"horizontal-histogram\";\n readonly buckets: ReadonlyArray<HorizontalHistogramBucket>;\n };\n\n/**\n * Styling options accepted by `plot(...)`. `pane: \"overlay\"` (the default) is\n * the only pane the Phase-1 canvas2d adapter renders — `\"new\"` and named\n * panes are reserved for Phase 2+. `style` (Phase 2) lets the script pick\n * a non-line {@link PlotOptsStyle} — defaults to `{ kind: \"line\" }`.\n *\n * @since 0.1\n * @example\n * const opts: PlotOpts = {\n * color: \"#3b82f6\",\n * title: \"EMA(20)\",\n * lineWidth: 2,\n * lineStyle: \"solid\",\n * pane: \"overlay\",\n * style: { kind: \"line\" },\n * };\n */\nexport type PlotOpts = Readonly<{\n color?: Color;\n title?: string;\n lineWidth?: number;\n lineStyle?: LineStyle;\n pane?: \"overlay\" | \"new\" | string;\n style?: PlotOptsStyle;\n /**\n * Presentation-only render-order key (z-index). Default `0`.\n * Higher `z` renders on top; lower `z` renders behind. Marks with\n * equal `z` keep the default group order (plots below drawings) and,\n * within a group, declaration order. `z` may be any finite number —\n * fractional values (e.g. `1.5`) slot a mark between two layers\n * without renumbering. It affects **only** stacking: `value`,\n * alerts, and `state.*` are unaffected.\n *\n * @since 1.4\n * @stable\n * @example\n * plot(ta.sma(bar.close, 50), { z: -1 }); // behind other plots\n */\n z?: number;\n}>;\n\n/**\n * Styling options accepted by `hline(...)`. `pane` follows the same shape as\n * {@link PlotOpts.pane}: omit to fall back to the script's manifest-resolved\n * default (overlay unless `defineIndicator({ overlay: false })` was declared);\n * `\"overlay\"` pins the line to the price pane; `\"new\"` opens / joins the\n * per-script subpane; named panes route to a shared subpane key.\n *\n * @since 0.1\n * @stable\n * @example\n * const opts: HLineOpts = {\n * color: \"#ef4444\",\n * title: \"RSI 70\",\n * lineStyle: \"dashed\",\n * pane: \"new\",\n * };\n */\nexport type HLineOpts = Readonly<{\n color?: Color;\n title?: string;\n lineWidth?: number;\n lineStyle?: LineStyle;\n /**\n * Routes the horizontal line to a pane. Mirrors {@link PlotOpts.pane}:\n * omit to fall back to the script's manifest-resolved default,\n * `\"overlay\"` pins to the price pane, `\"new\"` joins the per-script\n * subpane, and named keys route to a shared subpane (folded to overlay\n * with `unsupported-pane` on `subPanes: 0` adapters).\n *\n * @since 0.2\n */\n pane?: \"overlay\" | \"new\" | string;\n}>;\n\n/**\n * Compile-time callable hole for `plot(value, opts?)`. The compiler rewrites\n * every callsite to dispatch to the runtime's `plot` implementation;\n * calling this outside a compiled runtime throws the sentinel.\n *\n * Accepts `number | Series<number>` — scalars emit a single bar value;\n * series emissions pull from `series.current`.\n *\n * @since 0.1\n * @stable\n * @example\n * // Inside a compiled `compute`:\n * // plot(bar.close, { color: \"#3b82f6\" });\n * import { plot } from \"@invinite-org/chartlang-core\";\n * try { plot(0); } catch {}\n */\nexport function plot(_value: number | Series<number>, _opts?: PlotOpts): void {\n throw new Error(\"plot called outside compiled runtime\");\n}\n\n/**\n * Compile-time callable hole for `hline(price, opts?)`. Same semantics as\n * `plot` but pinned to a fixed price across all bars.\n *\n * @since 0.1\n * @stable\n * @example\n * // Inside a compiled `compute`:\n * // hline(70, { color: \"#ef4444\" });\n * import { hline } from \"@invinite-org/chartlang-core\";\n * try { hline(70); } catch {}\n */\nexport function hline(_price: number, _opts?: HLineOpts): void {\n throw new Error(\"hline called outside compiled runtime\");\n}\n"]}
1
+ {"version":3,"file":"plot.js","sourceRoot":"","sources":["../../src/plot/plot.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAgU/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;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,OAAO,CAAC,MAAa,EAAE,KAAmB;IACtD,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAa,EAAE,KAAoB;IACxD,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;AAChE,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, LineStyle, Series } from \"../types.js\";\n\n/**\n * Rendered-shape discriminator for `plot` emissions reaching the adapter.\n * The full 0.5 inventory is `line`, `step-line`, `horizontal-line`,\n * `histogram`, `area`, `filled-band`, `label`, `marker`,\n * `shape`, `character`, `arrow`, `candle-override`, `bar-override`,\n * `bg-color`, `bar-color`, and `horizontal-histogram`. Every expansion is\n * additive — the `apiVersion: 1` script header stays unchanged.\n *\n * Typical Phase-2 consumers:\n *\n * - `histogram` → volume bars, MACD histogram, momentum-style oscillators.\n * - `area` → filled region under a polyline (BB midline, regression).\n * - `filled-band` → Bollinger / Keltner / Donchian / Ichimoku envelopes.\n * - `label` → text annotations at a world-space anchor (fractal, pivot).\n * - `marker` → discrete glyph (circle / triangle / square / diamond) for\n * fractals / divergence / supertrend flips.\n *\n * @since 0.1\n * @example\n * const k: PlotKind = \"line\";\n * const histogram: PlotKind = \"histogram\";\n * const shape: PlotKind = \"shape\";\n * void k; void histogram; void shape;\n */\nexport type PlotKind =\n | \"line\"\n | \"step-line\"\n | \"horizontal-line\"\n | \"histogram\"\n | \"area\"\n | \"filled-band\"\n | \"label\"\n | \"marker\"\n | \"shape\"\n | \"character\"\n | \"arrow\"\n | \"candle-override\"\n | \"bar-override\"\n | \"bg-color\"\n | \"bar-color\"\n | \"horizontal-histogram\";\n\n/**\n * Marker glyphs shared by Phase 2 `marker` and Phase 5 `shape` plot styles.\n *\n * @since 0.5\n * @stable\n * @example\n * const shape: PlotGlyphShape = \"circle\";\n * void shape;\n */\nexport type PlotGlyphShape = \"circle\" | \"triangle-up\" | \"triangle-down\" | \"square\" | \"diamond\";\n\n/**\n * Full glyph inventory for Phase 5 `shape` plot styles.\n *\n * @since 0.5\n * @stable\n * @example\n * const shape: PlotShapeGlyph = \"flag\";\n * void shape;\n */\nexport type PlotShapeGlyph = PlotGlyphShape | \"cross\" | \"xcross\" | \"flag\";\n\n/**\n * Vertical anchoring mode for glyph-like Phase 5 plot styles.\n *\n * @since 0.5\n * @stable\n * @example\n * const location: PlotLocation = \"above\";\n * void location;\n */\nexport type PlotLocation = \"above\" | \"below\" | \"absolute\";\n\n/**\n * Single row in a Phase 5 horizontal-histogram plot emission.\n *\n * @since 0.5\n * @stable\n * @example\n * const bucket: HorizontalHistogramBucket = { price: 100, volume: 25 };\n * void bucket;\n */\nexport type HorizontalHistogramBucket = Readonly<{\n readonly price: number;\n readonly volume: number;\n readonly color?: Color;\n}>;\n\n/**\n * Script-author selectable plot style. The runtime maps this to the\n * adapter-kit's wire `PlotStyle` discriminated union and fills in defaults\n * from sibling {@link PlotOpts} fields (`lineWidth` / `lineStyle`) for\n * line-like styles.\n *\n * `histogram.baseline` defaults to `0` when omitted.\n *\n * @formula N/A — script-facing style input\n * @since 0.2\n * @stable\n * @example\n * const lineStyle: PlotOptsStyle = { kind: \"line\" };\n * const histStyle: PlotOptsStyle = { kind: \"histogram\", baseline: 0 };\n * void lineStyle; void histStyle;\n */\nexport type PlotOptsStyle =\n | { readonly kind: \"line\" }\n | { readonly kind: \"step-line\" }\n | { readonly kind: \"horizontal-line\" }\n | { readonly kind: \"histogram\"; readonly baseline?: number }\n | {\n readonly kind: \"marker\";\n readonly shape: PlotGlyphShape;\n readonly size: number;\n }\n /**\n * Glyph at world-anchor — Pine's `plotshape`. Location selects vertical\n * anchoring; `size` is in CSS pixels.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.close, { style: { kind: \"shape\", shape: \"triangle-up\", size: 8, location: \"below\" } });\n */\n | {\n readonly kind: \"shape\";\n readonly shape: PlotShapeGlyph;\n readonly size: number;\n readonly location?: PlotLocation;\n }\n /**\n * Text glyph at world-anchor — Pine's `plotchar`. `char` may be any\n * non-empty UTF-8 string; `size` is in CSS pixels.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.close, { style: { kind: \"character\", char: \"▲\", size: 12, location: \"above\" } });\n */\n | {\n readonly kind: \"character\";\n readonly char: string;\n readonly size: number;\n readonly location?: PlotLocation;\n }\n /**\n * Directional marker at world-anchor — Pine's `plotarrow`.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.low, { style: { kind: \"arrow\", direction: \"up\", size: 10 } });\n */\n | { readonly kind: \"arrow\"; readonly direction: \"up\" | \"down\"; readonly size: number }\n /**\n * Candle body color override — Pine's `plotcandle`.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.close, { style: { kind: \"candle-override\", bull: \"#26a69a\", bear: \"#ef5350\" } });\n */\n | {\n readonly kind: \"candle-override\";\n readonly bull: Color;\n readonly bear: Color;\n readonly doji?: Color;\n }\n /**\n * OHLC bar outline override — Pine's `plotbar`.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.close, { style: { kind: \"bar-override\", color: \"#f59e0b\" } });\n */\n | { readonly kind: \"bar-override\"; readonly color: Color }\n /**\n * Pane background color band — Pine's `bgcolor`.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.close, { style: { kind: \"bg-color\", color: \"#1d4ed8\", transp: 80 } });\n */\n | { readonly kind: \"bg-color\"; readonly color: Color; readonly transp?: number }\n /**\n * Main candle/bar tint — Pine's `barcolor`.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.close, { style: { kind: \"bar-color\", color: \"#a855f7\" } });\n */\n | { readonly kind: \"bar-color\"; readonly color: Color }\n /**\n * Right-edge volume-profile bars keyed by price bucket.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.close, { style: { kind: \"horizontal-histogram\", buckets: [{ price: bar.close, volume: bar.volume }] } });\n */\n | {\n readonly kind: \"horizontal-histogram\";\n readonly buckets: ReadonlyArray<HorizontalHistogramBucket>;\n };\n\n/**\n * Styling options accepted by `plot(...)`. `pane: \"overlay\"` (the default) is\n * the only pane the Phase-1 canvas2d adapter renders — `\"new\"` and named\n * panes are reserved for Phase 2+. `style` (Phase 2) lets the script pick\n * a non-line {@link PlotOptsStyle} — defaults to `{ kind: \"line\" }`.\n *\n * @since 0.1\n * @example\n * const opts: PlotOpts = {\n * color: \"#3b82f6\",\n * title: \"EMA(20)\",\n * lineWidth: 2,\n * lineStyle: \"solid\",\n * pane: \"overlay\",\n * style: { kind: \"line\" },\n * };\n */\nexport type PlotOpts = Readonly<{\n color?: Color;\n title?: string;\n lineWidth?: number;\n lineStyle?: LineStyle;\n pane?: \"overlay\" | \"new\" | string;\n style?: PlotOptsStyle;\n /**\n * Presentation-only render-order key (z-index). Default `0`.\n * Higher `z` renders on top; lower `z` renders behind. Marks with\n * equal `z` keep the default group order (plots below drawings) and,\n * within a group, declaration order. `z` may be any finite number —\n * fractional values (e.g. `1.5`) slot a mark between two layers\n * without renumbering. It affects **only** stacking: `value`,\n * alerts, and `state.*` are unaffected.\n *\n * @since 1.4\n * @stable\n * @example\n * plot(ta.sma(bar.close, 50), { z: -1 }); // behind other plots\n */\n z?: number;\n}>;\n\n/**\n * Styling options accepted by `hline(...)`. `pane` follows the same shape as\n * {@link PlotOpts.pane}: omit to fall back to the script's manifest-resolved\n * default (overlay unless `defineIndicator({ overlay: false })` was declared);\n * `\"overlay\"` pins the line to the price pane; `\"new\"` opens / joins the\n * per-script subpane; named panes route to a shared subpane key.\n *\n * @since 0.1\n * @stable\n * @example\n * const opts: HLineOpts = {\n * color: \"#ef4444\",\n * title: \"RSI 70\",\n * lineStyle: \"dashed\",\n * pane: \"new\",\n * };\n */\nexport type HLineOpts = Readonly<{\n color?: Color;\n title?: string;\n lineWidth?: number;\n lineStyle?: LineStyle;\n /**\n * Routes the horizontal line to a pane. Mirrors {@link PlotOpts.pane}:\n * omit to fall back to the script's manifest-resolved default,\n * `\"overlay\"` pins to the price pane, `\"new\"` joins the per-script\n * subpane, and named keys route to a shared subpane (folded to overlay\n * with `unsupported-pane` on `subPanes: 0` adapters).\n *\n * @since 0.2\n */\n pane?: \"overlay\" | \"new\" | string;\n}>;\n\n/**\n * Styling options accepted by `bgcolor(...)` — the Pine-ergonomic alias for\n * a `bg-color` pane-background band. `transp` is the 0–100 transparency\n * (0 opaque … 100 fully transparent), mirroring {@link PlotOptsStyle}'s\n * `bg-color` arm. `title` labels the slot for host overrides.\n *\n * @since 1.4\n * @stable\n * @example\n * const opts: BgColorOpts = { transp: 80, title: \"RSI heat\" };\n * void opts;\n */\nexport type BgColorOpts = Readonly<{\n transp?: number;\n title?: string;\n}>;\n\n/**\n * Styling options accepted by `barcolor(...)` — the Pine-ergonomic alias for\n * a `bar-color` candle/bar tint. The `bar-color` style carries no\n * transparency, so this bag only labels the slot.\n *\n * @since 1.4\n * @stable\n * @example\n * const opts: BarColorOpts = { title: \"trend tint\" };\n * void opts;\n */\nexport type BarColorOpts = Readonly<{\n title?: string;\n}>;\n\n/**\n * Compile-time callable hole for `plot(value, opts?)`. The compiler rewrites\n * every callsite to dispatch to the runtime's `plot` implementation;\n * calling this outside a compiled runtime throws the sentinel.\n *\n * Accepts `number | Series<number>` — scalars emit a single bar value;\n * series emissions pull from `series.current`.\n *\n * @since 0.1\n * @stable\n * @example\n * // Inside a compiled `compute`:\n * // plot(bar.close, { color: \"#3b82f6\" });\n * import { plot } from \"@invinite-org/chartlang-core\";\n * try { plot(0); } catch {}\n */\nexport function plot(_value: number | Series<number>, _opts?: PlotOpts): void {\n throw new Error(\"plot called outside compiled runtime\");\n}\n\n/**\n * Compile-time callable hole for `hline(price, opts?)`. Same semantics as\n * `plot` but pinned to a fixed price across all bars.\n *\n * @since 0.1\n * @stable\n * @example\n * // Inside a compiled `compute`:\n * // hline(70, { color: \"#ef4444\" });\n * import { hline } from \"@invinite-org/chartlang-core\";\n * try { hline(70); } catch {}\n */\nexport function hline(_price: number, _opts?: HLineOpts): void {\n throw new Error(\"hline called outside compiled runtime\");\n}\n\n/**\n * Paint the pane background for the current bar — the Pine-ergonomic alias\n * for `plot(NaN, { style: { kind: \"bg-color\", color, transp } })`. Pass a\n * `Color` (a CSS / hex string, or a per-bar color expression like\n * `close > open ? \"#16a34a\" : \"#dc2626\"`). Sugar over the existing\n * `bg-color` plot style — same wire emission, same capability gate.\n *\n * @since 1.4\n * @stable\n * @example\n * // Inside a compiled `compute`:\n * // bgcolor(bar.close > bar.open ? \"#16a34a\" : \"#dc2626\", { transp: 80 });\n * import { bgcolor } from \"@invinite-org/chartlang-core\";\n * try { bgcolor(\"#1d4ed8\"); } catch {}\n */\nexport function bgcolor(_color: Color, _opts?: BgColorOpts): void {\n throw new Error(\"bgcolor called outside compiled runtime\");\n}\n\n/**\n * Tint the candle / bar for the current bar — the Pine-ergonomic alias for\n * `plot(NaN, { style: { kind: \"bar-color\", color } })`. Sugar over the\n * existing `bar-color` plot style.\n *\n * @since 1.4\n * @stable\n * @example\n * // Inside a compiled `compute`:\n * // barcolor(bar.close > bar.open ? \"#16a34a\" : \"#dc2626\");\n * import { barcolor } from \"@invinite-org/chartlang-core\";\n * try { barcolor(\"#a855f7\"); } catch {}\n */\nexport function barcolor(_color: Color, _opts?: BarColorOpts): void {\n throw new Error(\"barcolor called outside compiled runtime\");\n}\n"]}