@invinite-org/chartlang-core 1.0.1 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/README.md +6 -1
  3. package/dist/alert/alert.d.ts +1 -1
  4. package/dist/alert/alert.js +1 -1
  5. package/dist/alert/alert.js.map +1 -1
  6. package/dist/alert/index.js.map +1 -1
  7. package/dist/color/colorHelpers.js.map +1 -1
  8. package/dist/color/index.js.map +1 -1
  9. package/dist/color/parseColor.js.map +1 -1
  10. package/dist/define/defineAlert.d.ts.map +1 -1
  11. package/dist/define/defineAlert.js +3 -2
  12. package/dist/define/defineAlert.js.map +1 -1
  13. package/dist/define/defineAlertCondition.d.ts.map +1 -1
  14. package/dist/define/defineAlertCondition.js +2 -1
  15. package/dist/define/defineAlertCondition.js.map +1 -1
  16. package/dist/define/defineDrawing.d.ts +2 -2
  17. package/dist/define/defineDrawing.d.ts.map +1 -1
  18. package/dist/define/defineDrawing.js +5 -4
  19. package/dist/define/defineDrawing.js.map +1 -1
  20. package/dist/define/defineIndicator.d.ts +11 -0
  21. package/dist/define/defineIndicator.d.ts.map +1 -1
  22. package/dist/define/defineIndicator.js +5 -2
  23. package/dist/define/defineIndicator.js.map +1 -1
  24. package/dist/define/depAccessorSentinel.d.ts +46 -0
  25. package/dist/define/depAccessorSentinel.d.ts.map +1 -0
  26. package/dist/define/depAccessorSentinel.js +51 -0
  27. package/dist/define/depAccessorSentinel.js.map +1 -0
  28. package/dist/define/dependency.d.ts +63 -0
  29. package/dist/define/dependency.d.ts.map +1 -0
  30. package/dist/define/dependency.js +4 -0
  31. package/dist/define/dependency.js.map +1 -0
  32. package/dist/define/index.d.ts +1 -0
  33. package/dist/define/index.d.ts.map +1 -1
  34. package/dist/define/index.js.map +1 -1
  35. package/dist/define/overrides.js.map +1 -1
  36. package/dist/draw/buckets.js.map +1 -1
  37. package/dist/draw/draw.d.ts +2 -3
  38. package/dist/draw/draw.d.ts.map +1 -1
  39. package/dist/draw/draw.js +1 -2
  40. package/dist/draw/draw.js.map +1 -1
  41. package/dist/draw/drawingKind.d.ts +1 -1
  42. package/dist/draw/drawingKind.js.map +1 -1
  43. package/dist/draw/drawingState.d.ts +5 -5
  44. package/dist/draw/drawingState.js.map +1 -1
  45. package/dist/draw/drawingStyle.d.ts +1 -1
  46. package/dist/draw/drawingStyle.js.map +1 -1
  47. package/dist/draw/handle.js.map +1 -1
  48. package/dist/draw/index.js.map +1 -1
  49. package/dist/draw/table.d.ts +1 -1
  50. package/dist/draw/table.js.map +1 -1
  51. package/dist/draw/worldPoint.js.map +1 -1
  52. package/dist/index.d.ts +4 -3
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +1 -0
  55. package/dist/index.js.map +1 -1
  56. package/dist/input/index.js.map +1 -1
  57. package/dist/input/input.js.map +1 -1
  58. package/dist/input/inputDescriptor.js.map +1 -1
  59. package/dist/interval/intervalToSeconds.js.map +1 -1
  60. package/dist/plot/index.js.map +1 -1
  61. package/dist/plot/plot.d.ts +25 -7
  62. package/dist/plot/plot.d.ts.map +1 -1
  63. package/dist/plot/plot.js +1 -1
  64. package/dist/plot/plot.js.map +1 -1
  65. package/dist/request/index.js.map +1 -1
  66. package/dist/request/request.js.map +1 -1
  67. package/dist/runtime/index.js.map +1 -1
  68. package/dist/runtime/runtime.js.map +1 -1
  69. package/dist/state/index.d.ts +1 -1
  70. package/dist/state/index.d.ts.map +1 -1
  71. package/dist/state/index.js.map +1 -1
  72. package/dist/state/mutableSlot.js.map +1 -1
  73. package/dist/state/snapshot.d.ts +39 -12
  74. package/dist/state/snapshot.d.ts.map +1 -1
  75. package/dist/state/snapshot.js.map +1 -1
  76. package/dist/state/state.js.map +1 -1
  77. package/dist/statefulPrimitives.d.ts +1 -1
  78. package/dist/statefulPrimitives.js +1 -1
  79. package/dist/statefulPrimitives.js.map +1 -1
  80. package/dist/ta/index.js.map +1 -1
  81. package/dist/ta/ta.d.ts +41 -41
  82. package/dist/ta/ta.js.map +1 -1
  83. package/dist/time/_lib/dateTimeFormatCache.js.map +1 -1
  84. package/dist/time/index.js.map +1 -1
  85. package/dist/time/nyDayKey.js +2 -2
  86. package/dist/time/nyDayKey.js.map +1 -1
  87. package/dist/time/session.js.map +1 -1
  88. package/dist/time/sessionBoundaries.js +2 -2
  89. package/dist/time/sessionBoundaries.js.map +1 -1
  90. package/dist/time/types.js.map +1 -1
  91. package/dist/time/weekKey.js.map +1 -1
  92. package/dist/time/weekday.js.map +1 -1
  93. package/dist/types.d.ts +246 -1
  94. package/dist/types.d.ts.map +1 -1
  95. package/dist/types.js +17 -1
  96. package/dist/types.js.map +1 -1
  97. package/dist/views/barstate.js.map +1 -1
  98. package/dist/views/index.js.map +1 -1
  99. package/dist/views/syminfo.js.map +1 -1
  100. package/dist/views/timeframe.js.map +1 -1
  101. package/package.json +1 -1
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAyB/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EACH,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,eAAe,GAClB,MAAM,mBAAmB,CAAC;AAU3B,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAuInC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAmBzC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAO7C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,EA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F,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 BarViewport,\n CapabilityId,\n Color,\n CompiledScriptBundle,\n CompiledScriptObject,\n ComputeContext,\n ComputeFn,\n DrawingCounts,\n InputSchema,\n IntervalDescriptor,\n JsonValue,\n LineStyle,\n PlotLineStyle,\n PlotOverride,\n PlotSlotDescriptor,\n Price,\n ScriptManifest,\n Series,\n Time,\n Volume,\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 HmaOpts,\n HvOpts,\n IchimokuOpts,\n IchimokuResult,\n KamaOpts,\n KeltnerOpts,\n KeltnerResult,\n KlingerOpts,\n KlingerResult,\n KstOpts,\n KstResult,\n LowestOpts,\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} 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 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} from \"./draw/index.js\";\n"]}
@@ -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"}
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 +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,YAAY,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CAC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AAC;IAC7E,CAAC;IAED;;;;;;;;OAQG;IACH,QAAQ,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 +1 @@
1
- {"version":3,"file":"inputDescriptor.js","sourceRoot":"","sources":["../../src/input/inputDescriptor.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D"}
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 +1 @@
1
- {"version":3,"file":"intervalToSeconds.js","sourceRoot":"","sources":["../../src/interval/intervalToSeconds.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAI/D,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9B,CAAC,EAAE,CAAC;IACJ,EAAE,EAAE,EAAE;IACN,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,MAAM;IAC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AAC,CAAC,KAAK,CAAC,EAAE,CACtG,CAAC;IACN,CAAC;IAED,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAA6B,CAAC;IACpD,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACvC,OAAO,CAAC,GAAG,UAAU,CAAC;AAC1B,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 { IntervalDescriptor } from \"../types.js\";\n\nconst MULTIPLIERS = Object.freeze({\n s: 1,\n \"\": 60,\n m: 60,\n H: 3_600,\n h: 3_600,\n D: 86_400,\n W: 604_800,\n M: 2_592_000,\n Y: 31_536_000,\n});\n\n/**\n * Convert an {@link IntervalDescriptor} to its effective second count.\n *\n * The helper prefers `intervalSeconds` when present. Otherwise it parses\n * `value` as `<positive-integer><suffix>`, where no suffix means Pine-style\n * minutes. Month and year suffixes use fixed 30-day and 365-day\n * approximations; adapters that need calendar-exact durations should provide\n * `intervalSeconds`.\n *\n * @throws Error when the override is non-positive / non-finite, or `value`\n * cannot be parsed.\n * @since 0.6\n * @stable\n * @example\n * intervalToSeconds({ value: \"1D\", label: \"1 day\", group: \"day\" });\n * intervalToSeconds({ value: \"custom\", label: \"custom\", group: \"x\", intervalSeconds: 7 });\n */\nexport function intervalToSeconds(d: IntervalDescriptor): number {\n if (d.intervalSeconds !== undefined) {\n if (!Number.isFinite(d.intervalSeconds) || d.intervalSeconds <= 0) {\n throw new Error(\n `intervalToSeconds: intervalSeconds must be a positive finite number; received ${d.intervalSeconds}`,\n );\n }\n return Math.round(d.intervalSeconds);\n }\n\n const match = /^(\\d+)([smHhDWMY]?)$/.exec(d.value);\n if (match === null) {\n throw new Error(\n `intervalToSeconds: cannot parse interval value ${JSON.stringify(d.value)}`,\n );\n }\n\n const n = Number.parseInt(match[1], 10);\n if (!Number.isFinite(n) || n <= 0) {\n throw new Error(\n `intervalToSeconds: numeric prefix must be a positive integer; received ${JSON.stringify(d.value)}`,\n );\n }\n\n const suffix = match[2] as keyof typeof MULTIPLIERS;\n const multiplier = MULTIPLIERS[suffix];\n return n * multiplier;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plot/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plot/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,cAAc,WAAW,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nexport * from \"./plot.js\";\n"]}
@@ -2,7 +2,7 @@ import type { Color, LineStyle, Series } from "../types.js";
2
2
  /**
3
3
  * Rendered-shape discriminator for `plot` emissions reaching the adapter.
4
4
  * The full 0.5 inventory is `line`, `step-line`, `horizontal-line`,
5
- * `histogram`, `bars`, `area`, `filled-band`, `label`, `marker`,
5
+ * `histogram`, `area`, `filled-band`, `label`, `marker`,
6
6
  * `shape`, `character`, `arrow`, `candle-override`, `bar-override`,
7
7
  * `bg-color`, `bar-color`, and `horizontal-histogram`. Every expansion is
8
8
  * additive — the `apiVersion: 1` script header stays unchanged.
@@ -10,7 +10,6 @@ import type { Color, LineStyle, Series } from "../types.js";
10
10
  * Typical Phase-2 consumers:
11
11
  *
12
12
  * - `histogram` → volume bars, MACD histogram, momentum-style oscillators.
13
- * - `bars` → narrow vertical bar plotted at integer x (signed momentum).
14
13
  * - `area` → filled region under a polyline (BB midline, regression).
15
14
  * - `filled-band` → Bollinger / Keltner / Donchian / Ichimoku envelopes.
16
15
  * - `label` → text annotations at a world-space anchor (fractal, pivot).
@@ -24,7 +23,7 @@ import type { Color, LineStyle, Series } from "../types.js";
24
23
  * const shape: PlotKind = "shape";
25
24
  * void k; void histogram; void shape;
26
25
  */
27
- export type PlotKind = "line" | "step-line" | "horizontal-line" | "histogram" | "bars" | "area" | "filled-band" | "label" | "marker" | "shape" | "character" | "arrow" | "candle-override" | "bar-override" | "bg-color" | "bar-color" | "horizontal-histogram";
26
+ export type PlotKind = "line" | "step-line" | "horizontal-line" | "histogram" | "area" | "filled-band" | "label" | "marker" | "shape" | "character" | "arrow" | "candle-override" | "bar-override" | "bg-color" | "bar-color" | "horizontal-histogram";
28
27
  /**
29
28
  * Marker glyphs shared by Phase 2 `marker` and Phase 5 `shape` plot styles.
30
29
  *
@@ -231,22 +230,41 @@ export type PlotOpts = Readonly<{
231
230
  style?: PlotOptsStyle;
232
231
  }>;
233
232
  /**
234
- * Styling options accepted by `hline(...)`. Unlike `plot`, `hline` is always
235
- * a single horizontal line at a fixed price; no pane override.
233
+ * Styling options accepted by `hline(...)`. `pane` follows the same shape as
234
+ * {@link PlotOpts.pane}: omit to fall back to the script's manifest-resolved
235
+ * default (overlay unless `defineIndicator({ overlay: false })` was declared);
236
+ * `"overlay"` pins the line to the price pane; `"new"` opens / joins the
237
+ * per-script subpane; named panes route to a shared subpane key.
236
238
  *
237
239
  * @since 0.1
240
+ * @stable
238
241
  * @example
239
- * const opts: HLineOpts = { color: "#ef4444", title: "Stop", lineStyle: "dashed" };
242
+ * const opts: HLineOpts = {
243
+ * color: "#ef4444",
244
+ * title: "RSI 70",
245
+ * lineStyle: "dashed",
246
+ * pane: "new",
247
+ * };
240
248
  */
241
249
  export type HLineOpts = Readonly<{
242
250
  color?: Color;
243
251
  title?: string;
244
252
  lineWidth?: number;
245
253
  lineStyle?: LineStyle;
254
+ /**
255
+ * Routes the horizontal line to a pane. Mirrors {@link PlotOpts.pane}:
256
+ * omit to fall back to the script's manifest-resolved default,
257
+ * `"overlay"` pins to the price pane, `"new"` joins the per-script
258
+ * subpane, and named keys route to a shared subpane (folded to overlay
259
+ * with `unsupported-pane` on `subPanes: 0` adapters).
260
+ *
261
+ * @since 0.2
262
+ */
263
+ pane?: "overlay" | "new" | string;
246
264
  }>;
247
265
  /**
248
266
  * Compile-time callable hole for `plot(value, opts?)`. The compiler rewrites
249
- * every callsite (Task 2) to dispatch to the runtime's `plot` implementation;
267
+ * every callsite to dispatch to the runtime's `plot` implementation;
250
268
  * calling this outside a compiled runtime throws the sentinel.
251
269
  *
252
270
  * Accepts `number | Series<number>` — scalars emit a single bar value;
@@ -1 +1 @@
1
- {"version":3,"file":"plot.d.ts","sourceRoot":"","sources":["../../src/plot/plot.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,QAAQ,GACd,MAAM,GACN,WAAW,GACX,iBAAiB,GACjB,WAAW,GACX,MAAM,GACN,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,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE1E;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,CAAC;AAE1D;;;;;;;;GAQG;AACH,MAAM,MAAM,yBAAyB,GAAG,QAAQ,CAAC;IAC7C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;CAC1B,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,aAAa,GACnB;IAAE,QAAQ,CAAC,I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AM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAE7D"}
package/dist/plot/plot.js CHANGED
@@ -2,7 +2,7 @@
2
2
  // See the LICENSE file in the repo root for full license text.
3
3
  /**
4
4
  * Compile-time callable hole for `plot(value, opts?)`. The compiler rewrites
5
- * every callsite (Task 2) to dispatch to the runtime's `plot` implementation;
5
+ * every callsite to dispatch to the runtime's `plot` implementation;
6
6
  * calling this outside a compiled runtime throws the sentinel.
7
7
  *
8
8
  * Accepts `number | Series<number>` — scalars emit a single bar value;
@@ -1 +1 @@
1
- {"version":3,"file":"plot.js","sourceRoot":"","sources":["../../src/plot/plot.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAgQ/D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,IAAI,CAAC,MAA+B,EAAE,KAAgB;IAClE,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;AAC5D,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,KAAK,CAAC,MAAc,EAAE,KAAiB;IACnD,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;AAC7D,CAAC"}
1
+ {"version":3,"file":"plot.js","sourceRoot":"","sources":["../../src/plot/plot.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAiR/D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,IAAI,CAAC,MAA+B,EAAE,KAAgB;IAClE,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;AAC5D,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,KAAK,CAAC,MAAc,EAAE,KAAiB;IACnD,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;AAC7D,CAAC","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\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 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/request/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EACH,OAAO,GAKV,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/request/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EACH,OAAO,GAKV,MAAM,cAAc,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nexport {\n request,\n type RequestNamespace,\n type RequestLowerTfOpts,\n type RequestSecurityOpts,\n type SecurityBar,\n} from \"./request.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/request/request.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAkE/D,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAS,EAAE;IACrC,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,uCAAuC,CAAC,CAAC;AACpE,CAAC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;IACjC;;;;;;;;OAQG;IACH,QAAQ,CAAC,KAA0B;QAC/B,OAAO,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IACxC,CAAC;IACD;;;;;;;;OAQG;IACH,OAAO,CAAC,KAAyB;QAC7B,OAAO,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;CACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/request/request.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAkE/D,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAS,EAAE;IACrC,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,uCAAuC,CAAC,CAAC;AACpE,CAAC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;IACjC;;;;;;;;OAQG;IACH,QAAQ,CAAC,KAA0B;QAC/B,OAAO,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IACxC,CAAC;IACD;;;;;;;;OAQG;IACH,OAAO,CAAC,KAAyB;QAC7B,OAAO,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;CACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nimport type { Bar, Price, Series, Time, Volume } from \"../types.js\";\n\n/**\n * Argument to {@link request.security}. The `interval` must be a string\n * literal or an `input.enum` value; the compiler's literal-only pass rejects\n * dynamic expressions with `request-security-interval-not-literal`.\n *\n * @since 0.4\n * @stable\n * @example\n * const opts: RequestSecurityOpts = { interval: \"1D\" };\n * void opts;\n */\nexport type RequestSecurityOpts = Readonly<{\n readonly interval: string;\n}>;\n\n/**\n * Argument to {@link request.lowerTf}. The `interval` must be strictly lower\n * than the script's main interval; invalid orderings are rejected by the\n * compiler's `lower-tf-not-lower` diagnostic when statically known.\n *\n * @since 0.6\n * @stable\n * @example\n * const opts: RequestLowerTfOpts = { interval: \"30s\" };\n * void opts;\n */\nexport type RequestLowerTfOpts = Readonly<{\n readonly interval: string;\n}>;\n\n/**\n * Secondary-stream bar returned by {@link request.security}. Each field is a\n * `Series<...>` aligned from the runtime's secondary-stream ring buffer to\n * the current main stream, or by the all-NaN fallback when\n * `Capabilities.multiTimeframe` is `false`, the interval is unsupported, or\n * the host fails to register the secondary stream.\n *\n * This is intentionally a series-shaped view rather than the scalar\n * {@link Bar} shape so scripts can read historical secondary values aligned\n * to main bars, such as `daily.close[5]`.\n *\n * @since 0.4\n * @stable\n * @example\n * const close: SecurityBar[\"close\"] = { current: 1, length: 1 };\n * void close;\n */\nexport type SecurityBar = Readonly<{\n readonly time: Series<Time>;\n readonly open: Series<Price>;\n readonly high: Series<Price>;\n readonly low: Series<Price>;\n readonly close: Series<Price>;\n readonly volume: Series<Volume>;\n readonly hl2: Series<Price>;\n readonly hlc3: Series<Price>;\n readonly ohlc4: Series<Price>;\n readonly hlcc4: Series<Price>;\n readonly symbol: Series<string>;\n readonly interval: Series<string>;\n}>;\n\nconst sentinel = (name: string): never => {\n throw new Error(`${name} called outside an active script step`);\n};\n\n/**\n * `request.*` namespace for secondary timeframe reads. The compiler walks\n * `request.security(...)` calls to populate `manifest.requestedIntervals`;\n * the runtime replaces this callable hole with a slot-aware implementation\n * through `ComputeContext.request`.\n *\n * @since 0.4\n * @stable\n * @example\n * const ns: typeof request = request;\n * void ns;\n */\nexport const request = Object.freeze({\n /**\n * Read a secondary candle stream at a script-author-fixed interval.\n *\n * @since 0.4\n * @stable\n * @example\n * const fn: typeof request.security = request.security;\n * void fn;\n */\n security(_opts: RequestSecurityOpts): SecurityBar {\n return sentinel(\"request.security\");\n },\n /**\n * Read lower-timeframe bars contained by each main-stream bar.\n *\n * @since 0.6\n * @stable\n * @example\n * const fn: typeof request.lowerTf = request.lowerTf;\n * void fn;\n */\n lowerTf(_opts: RequestLowerTfOpts): Series<ReadonlyArray<Bar>> {\n return sentinel(\"request.lowerTf\");\n },\n});\n\n/**\n * Static type of the `request` namespace. Runtime implementations satisfy\n * this shape structurally when installed on `ComputeContext.request`.\n *\n * @since 0.4\n * @stable\n * @example\n * const ns: RequestNamespace = request;\n * void ns;\n */\nexport type RequestNamespace = typeof request;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nexport { runtime } from \"./runtime.js\";\nexport type { LogLevel, RuntimeNamespace } from \"./runtime.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/runtime/runtime.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAe/D;;;;;;;;;GASG;AACH,SAAS,QAAQ,CAAC,QAAgB,EAAE,KAA2C;IAC3E,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;AACxE,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,QAAQ,CAAC,QAAgB,EAAE,KAA2C;IAC3E,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;AACxE,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,SAAS,CAAC,QAAgB,EAAE,KAA2C;IAC5E,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;AACzE,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,MAAM,CAAC,QAAgB;IAC5B,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;AACrE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;IACjC,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,SAAS;KACnB,CAAC;IACF,KAAK,EAAE,MAAM;CAChB,CAAC,CAAC"}
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/runtime/runtime.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAe/D;;;;;;;;;GASG;AACH,SAAS,QAAQ,CAAC,QAAgB,EAAE,KAA2C;IAC3E,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;AACxE,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,QAAQ,CAAC,QAAgB,EAAE,KAA2C;IAC3E,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;AACxE,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,SAAS,CAAC,QAAgB,EAAE,KAA2C;IAC5E,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;AACzE,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,MAAM,CAAC,QAAgB;IAC5B,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;AACrE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;IACjC,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,SAAS;KACnB,CAAC;IACF,KAAK,EAAE,MAAM;CAChB,CAAC,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nimport type { JsonValue } from \"../types.js\";\n\n/**\n * Runtime log severity emitted by `runtime.log.*`.\n *\n * @since 0.5\n * @stable\n * @example\n * const level: LogLevel = \"info\";\n * void level;\n */\nexport type LogLevel = \"info\" | \"warn\" | \"error\";\n\n/**\n * Per-step log message. Pine's `runtime.log.*` analogue. Capability-\n * gated by `Capabilities.logs`; silent no-op when false.\n *\n * @since 0.5\n * @stable\n * @example\n * // Inside compute:\n * // runtime.log.info(`ema=${ema.current}`, { ema: ema.current });\n */\nfunction _logInfo(_message: string, _meta?: Readonly<Record<string, JsonValue>>): void {\n throw new Error(\"runtime.log.info called outside compiled runtime\");\n}\n\n/**\n * Per-step warning log message. Capability-gated by `Capabilities.logs`.\n *\n * @since 0.5\n * @stable\n * @example\n * // Inside compute:\n * // runtime.log.warn(\"warmup incomplete\");\n */\nfunction _logWarn(_message: string, _meta?: Readonly<Record<string, JsonValue>>): void {\n throw new Error(\"runtime.log.warn called outside compiled runtime\");\n}\n\n/**\n * Per-step error log message. Capability-gated by `Capabilities.logs`.\n *\n * @since 0.5\n * @stable\n * @example\n * // Inside compute:\n * // runtime.log.error(\"unexpected branch\", { branch: \"fallback\" });\n */\nfunction _logError(_message: string, _meta?: Readonly<Record<string, JsonValue>>): void {\n throw new Error(\"runtime.log.error called outside compiled runtime\");\n}\n\n/**\n * Halt the current bar's compute. Emits a fatal `RuntimeDiagnostic`\n * with code `runtime-error-thrown`. The script stays mounted; the\n * next bar runs normally. Use for invariant violations the script\n * cannot continue past.\n *\n * @since 0.5\n * @stable\n * @example\n * // Inside compute:\n * // if (inputs.length < 1) runtime.error(\"length must be >= 1\");\n */\nfunction _error(_message: string): never {\n throw new Error(\"runtime.error called outside compiled runtime\");\n}\n\n/**\n * Pine-style runtime utilities exposed to script `compute` callbacks.\n *\n * @since 0.5\n * @stable\n * @example\n * // Inside compute:\n * // runtime.log.info(\"close\", { value: bar.close });\n */\nexport const runtime = Object.freeze({\n log: Object.freeze({\n info: _logInfo,\n warn: _logWarn,\n error: _logError,\n }),\n error: _error,\n});\n\n/**\n * Script-facing runtime namespace type.\n *\n * @since 0.5\n * @stable\n * @example\n * const ns: RuntimeNamespace = runtime;\n * void ns;\n */\nexport type RuntimeNamespace = typeof runtime;\n"]}
@@ -1,5 +1,5 @@
1
1
  export { state } from "./state.js";
2
2
  export type { StateNamespace } from "./state.js";
3
3
  export type { MutableSlot } from "./mutableSlot.js";
4
- export type { StateSnapshot, StateStoreKey, StreamSnapshot } from "./snapshot.js";
4
+ export type { RunnerSnapshot, StateSnapshot, StateStoreKey, StreamSnapshot, } from "./snapshot.js";
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/state/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/state/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EACR,cAAc,EACd,aAAa,EACb,aAAa,EACb,cAAc,GACjB,MAAM,eAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/state/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/state/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nexport { state } from \"./state.js\";\nexport type { StateNamespace } from \"./state.js\";\nexport type { MutableSlot } from \"./mutableSlot.js\";\nexport type {\n RunnerSnapshot,\n StateSnapshot,\n StateStoreKey,\n StreamSnapshot,\n} from \"./snapshot.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"mutableSlot.js","sourceRoot":"","sources":["../../src/state/mutableSlot.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D"}
1
+ {"version":3,"file":"mutableSlot.js","sourceRoot":"","sources":["../../src/state/mutableSlot.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\n/**\n * Script-facing handle on a persistent cross-bar slot, Pine's `var` /\n * `varip` equivalent. Reads return the active step value; writes follow\n * the runtime's committed/tentative slot semantics.\n *\n * Intentionally minimal: no `.history()`, no `.previous()`, no indexing.\n * Scripts that need the previous bar's value store it in a second slot or\n * use `ta.*` series-indexing primitives.\n *\n * @since 0.4\n * @stable\n * @example\n * const slot: MutableSlot<number> = {\n * get value() {\n * return 0;\n * },\n * set value(_next: number) {},\n * };\n * slot.value = 1;\n */\nexport type MutableSlot<T> = {\n get value(): T;\n set value(v: T);\n};\n"]}
@@ -4,7 +4,7 @@ import type { JsonValue } from "../types.js";
4
4
  *
5
5
  * Carries everything needed to rehydrate a ring buffer for one timeframe,
6
6
  * whether that stream is the main interval or a higher-timeframe secondary
7
- * stream (PLAN.md §6.1, §6.9).
7
+ * stream.
8
8
  *
9
9
  * `buffers` is keyed by the canonical OHLCV field names; each value is a
10
10
  * JSON-clean array of `number | null`, where `null` preserves NaN holes
@@ -35,43 +35,70 @@ export type StreamSnapshot = Readonly<{
35
35
  volume: ReadonlyArray<number | null>;
36
36
  }>;
37
37
  }>;
38
+ /**
39
+ * Per-runner persistence section. Carries one runner's `state.*`
40
+ * (and primary-only TA) slot map keyed by `${slotIdPrefix}${slotId}:state`
41
+ * (Task 5). `slots` is `JsonValue` so the snapshot
42
+ * round-trips through `JSON.stringify` and structured-clone.
43
+ *
44
+ * Used inside {@link StateSnapshot} for `primary`,
45
+ * `siblings[exportName]`, and `dependencies[localId]` sections —
46
+ * one section per runner mounted by a `CompiledScriptBundle`.
47
+ *
48
+ * @since 0.7
49
+ * @stable
50
+ * @example
51
+ * const r: RunnerSnapshot = {
52
+ * slots: { "x:state": { committed: 1, tentative: 1 } },
53
+ * };
54
+ * void r;
55
+ */
56
+ export type RunnerSnapshot = Readonly<{
57
+ slots: Readonly<Record<string, JsonValue>>;
58
+ }>;
38
59
  /**
39
60
  * Canonical persistent-store snapshot.
40
61
  *
41
62
  * Written on `dispose()` and on every `kind: "close"` event when stale for
42
- * at least 60 seconds (PLAN.md §6.9). `slots` carries every stateful
43
- * primitive's per-callsite payload keyed by the compiler-injected slot id
44
- * (PLAN.md §5.5). Each value is `JsonValue`; primitive authors with non-JSON
45
- * internal state register serialisation hooks in the runtime layer.
63
+ * at least 60 seconds. Each runner's `state.*` payload is
64
+ * keyed by the compiler-injected slot id with the runner's
65
+ * `slotIdPrefix` prepended (Task 5). Primary-runner TA
66
+ * slots live in `primary.slots` alongside `state.*` slots (the bundle's
67
+ * deps + siblings share the primary's mainStream, so TA slots have no
68
+ * per-runner section).
46
69
  *
47
- * `snapshotVersion: 1` is the only currently-supported wire version. A future
48
- * schema change must bump this literal so the runtime can drop snapshots with
49
- * mismatched versions on load.
70
+ * `snapshotVersion: 1` is the only currently-supported wire version.
71
+ * The 0.7 widening is additive the runtime validator accepts both the
72
+ * legacy flat `slots:` shape (loaded as primary-only) and the structured
73
+ * `primary` / `siblings?` / `dependencies?` shape (always written going
74
+ * forward).
50
75
  *
51
- * @since 0.5
76
+ * @since 0.5 — widened to per-runner sections in 0.7
52
77
  * @stable
53
78
  * @example
54
79
  * const s: StateSnapshot = {
55
80
  * lastBarTime: 1_700_000_000_000,
56
81
  * streams: {},
57
- * slots: {},
58
82
  * savedAt: 1_700_000_060_000,
59
83
  * snapshotVersion: 1,
84
+ * primary: { slots: {} },
60
85
  * };
61
86
  * void s;
62
87
  */
63
88
  export type StateSnapshot = Readonly<{
64
89
  lastBarTime: number;
65
90
  streams: Readonly<Record<string, StreamSnapshot>>;
66
- slots: Readonly<Record<string, JsonValue>>;
67
91
  savedAt: number;
68
92
  snapshotVersion: 1;
93
+ primary: RunnerSnapshot;
94
+ siblings?: Readonly<Record<string, RunnerSnapshot>>;
95
+ dependencies?: Readonly<Record<string, RunnerSnapshot>>;
69
96
  }>;
70
97
  /**
71
98
  * Canonical persistent-store identity tuple.
72
99
  *
73
100
  * Every field contributes to the cache key; any change invalidates the
74
- * snapshot (PLAN.md §6.9). Stores treat this tuple opaquely as a string key;
101
+ * snapshot. Stores treat this tuple opaquely as a string key;
75
102
  * the typical implementation is `JSON.stringify(key)` with sorted fields.
76
103
  *
77
104
  * - `scriptHash` is the SHA-256 digest of the compiled `moduleSource`.
@@ -1 +1 @@
1
- {"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../src/state/snapshot.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,QAAQ,CAAC;QACd,IAAI,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;QACnC,IAAI,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;QACnC,IAAI,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;QACnC,GAAG,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;QAClC,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;QACpC,MAAM,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;KACxC,CAAC,CAAC;CACN,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,M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;AAC/D,+DAA+D"}
1
+ {"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../src/state/snapshot.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nimport type { JsonValue } from \"../types.js\";\n\n/**\n * Per-stream snapshot captured during state persistence.\n *\n * Carries everything needed to rehydrate a ring buffer for one timeframe,\n * whether that stream is the main interval or a higher-timeframe secondary\n * stream.\n *\n * `buffers` is keyed by the canonical OHLCV field names; each value is a\n * JSON-clean array of `number | null`, where `null` preserves NaN holes\n * through `JSON.stringify`. `headIndex` and `filled` mirror the ring-buffer's\n * internal state at snapshot time.\n *\n * @since 0.5\n * @stable\n * @example\n * const s: StreamSnapshot = {\n * interval: \"1D\",\n * headIndex: 4999,\n * filled: 5000,\n * buffers: { time: [], open: [], high: [], low: [], close: [], volume: [] },\n * };\n * void s;\n */\nexport type StreamSnapshot = Readonly<{\n interval: string;\n headIndex: number;\n filled: number;\n buffers: Readonly<{\n time: ReadonlyArray<number | null>;\n open: ReadonlyArray<number | null>;\n high: ReadonlyArray<number | null>;\n low: ReadonlyArray<number | null>;\n close: ReadonlyArray<number | null>;\n volume: ReadonlyArray<number | null>;\n }>;\n}>;\n\n/**\n * Per-runner persistence section. Carries one runner's `state.*`\n * (and primary-only TA) slot map keyed by `${slotIdPrefix}${slotId}:state`\n * (Task 5). `slots` is `JsonValue` so the snapshot\n * round-trips through `JSON.stringify` and structured-clone.\n *\n * Used inside {@link StateSnapshot} for `primary`,\n * `siblings[exportName]`, and `dependencies[localId]` sections —\n * one section per runner mounted by a `CompiledScriptBundle`.\n *\n * @since 0.7\n * @stable\n * @example\n * const r: RunnerSnapshot = {\n * slots: { \"x:state\": { committed: 1, tentative: 1 } },\n * };\n * void r;\n */\nexport type RunnerSnapshot = Readonly<{\n slots: Readonly<Record<string, JsonValue>>;\n}>;\n\n/**\n * Canonical persistent-store snapshot.\n *\n * Written on `dispose()` and on every `kind: \"close\"` event when stale for\n * at least 60 seconds. Each runner's `state.*` payload is\n * keyed by the compiler-injected slot id with the runner's\n * `slotIdPrefix` prepended (Task 5). Primary-runner TA\n * slots live in `primary.slots` alongside `state.*` slots (the bundle's\n * deps + siblings share the primary's mainStream, so TA slots have no\n * per-runner section).\n *\n * `snapshotVersion: 1` is the only currently-supported wire version.\n * The 0.7 widening is additive — the runtime validator accepts both the\n * legacy flat `slots:` shape (loaded as primary-only) and the structured\n * `primary` / `siblings?` / `dependencies?` shape (always written going\n * forward).\n *\n * @since 0.5 — widened to per-runner sections in 0.7\n * @stable\n * @example\n * const s: StateSnapshot = {\n * lastBarTime: 1_700_000_000_000,\n * streams: {},\n * savedAt: 1_700_000_060_000,\n * snapshotVersion: 1,\n * primary: { slots: {} },\n * };\n * void s;\n */\nexport type StateSnapshot = Readonly<{\n lastBarTime: number;\n streams: Readonly<Record<string, StreamSnapshot>>;\n savedAt: number;\n snapshotVersion: 1;\n primary: RunnerSnapshot;\n siblings?: Readonly<Record<string, RunnerSnapshot>>;\n dependencies?: Readonly<Record<string, RunnerSnapshot>>;\n}>;\n\n/**\n * Canonical persistent-store identity tuple.\n *\n * Every field contributes to the cache key; any change invalidates the\n * snapshot. Stores treat this tuple opaquely as a string key;\n * the typical implementation is `JSON.stringify(key)` with sorted fields.\n *\n * - `scriptHash` is the SHA-256 digest of the compiled `moduleSource`.\n * - `compilerVersion` is the package version of `@invinite-org/chartlang-compiler`.\n * - `apiVersion` is the script header pin, currently `1`.\n * - `capabilitiesHash` is the SHA-256 digest of normalised adapter capabilities.\n * - `symbol` is the adapter's loaded ticker.\n * - `mainInterval` is the primary stream interval.\n * - `requestedIntervals` is the frozen array of secondary stream intervals.\n *\n * @since 0.5\n * @stable\n * @example\n * const k: StateStoreKey = {\n * scriptHash: \"abc\",\n * compilerVersion: \"0.5.0\",\n * apiVersion: 1,\n * capabilitiesHash: \"def\",\n * symbol: \"BTCUSD\",\n * mainInterval: \"1m\",\n * requestedIntervals: [],\n * };\n * void k;\n */\nexport type StateStoreKey = Readonly<{\n scriptHash: string;\n compilerVersion: string;\n apiVersion: 1;\n capabilitiesHash: string;\n symbol: string;\n mainInterval: string;\n requestedIntervals: ReadonlyArray<string>;\n}>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/state/state.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAI/D,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAS,EAAE;IACrC,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,uCAAuC,CAAC,CAAC;AACpE,CAAC,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/B;;;;;;;;OAQG;IACH,KAAK,CAAC,KAAa;QACf,OAAO,QAAQ,CAAC,aAAa,CAAC,CAAC;IACnC,CAAC;IAED;;;;;;;;OAQG;IACH,GAAG,CAAC,KAAa;QACb,OAAO,QAAQ,CAAC,WAAW,CAAC,CAAC;IACjC,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CAAC,KAAc;QACf,OAAO,QAAQ,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,KAAa;QAChB,OAAO,QAAQ,CAAC,cAAc,CAAC,CAAC;IACpC,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;QAChB,KAAK,CAAC,KAAa;YACf,OAAO,QAAQ,CAAC,kBAAkB,CAAC,CAAC;QACxC,CAAC;QACD,GAAG,CAAC,KAAa;YACb,OAAO,QAAQ,CAAC,gBAAgB,CAAC,CAAC;QACtC,CAAC;QACD,IAAI,CAAC,KAAc;YACf,OAAO,QAAQ,CAAC,iBAAiB,CAAC,CAAC;QACvC,CAAC;QACD,MAAM,CAAC,KAAa;YAChB,OAAO,QAAQ,CAAC,mBAAmB,CAAC,CAAC;QACzC,CAAC;KACJ,CAAC;CACL,CAAC,CAAC"}
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/state/state.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAI/D,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAS,EAAE;IACrC,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,uCAAuC,CAAC,CAAC;AACpE,CAAC,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/B;;;;;;;;OAQG;IACH,KAAK,CAAC,KAAa;QACf,OAAO,QAAQ,CAAC,aAAa,CAAC,CAAC;IACnC,CAAC;IAED;;;;;;;;OAQG;IACH,GAAG,CAAC,KAAa;QACb,OAAO,QAAQ,CAAC,WAAW,CAAC,CAAC;IACjC,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CAAC,KAAc;QACf,OAAO,QAAQ,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,KAAa;QAChB,OAAO,QAAQ,CAAC,cAAc,CAAC,CAAC;IACpC,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;QAChB,KAAK,CAAC,KAAa;YACf,OAAO,QAAQ,CAAC,kBAAkB,CAAC,CAAC;QACxC,CAAC;QACD,GAAG,CAAC,KAAa;YACb,OAAO,QAAQ,CAAC,gBAAgB,CAAC,CAAC;QACtC,CAAC;QACD,IAAI,CAAC,KAAc;YACf,OAAO,QAAQ,CAAC,iBAAiB,CAAC,CAAC;QACvC,CAAC;QACD,MAAM,CAAC,KAAa;YAChB,OAAO,QAAQ,CAAC,mBAAmB,CAAC,CAAC;QACzC,CAAC;KACJ,CAAC;CACL,CAAC,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nimport type { MutableSlot } from \"./mutableSlot.js\";\n\nconst sentinel = (name: string): never => {\n throw new Error(`${name} called outside an active script step`);\n};\n\n/**\n * Persistent state slots, Pine `var` semantics. Writes during a tick are\n * tentative and discarded if a later tick replaces the head bar; on bar\n * close the tentative value commits. Reads return the active tentative\n * value for the current step.\n *\n * The runtime replaces this compile-time callable hole with a slot-aware\n * namespace through `ComputeContext.state`.\n *\n * @since 0.4\n * @stable\n * @example\n * const ns: typeof state = state;\n * void ns;\n */\nexport const state = Object.freeze({\n /**\n * Allocate or read a persistent number slot.\n *\n * @since 0.4\n * @stable\n * @example\n * const fn: typeof state.float = state.float;\n * void fn;\n */\n float(_init: number): MutableSlot<number> {\n return sentinel(\"state.float\");\n },\n\n /**\n * Allocate or read a persistent integer slot.\n *\n * @since 0.4\n * @stable\n * @example\n * const fn: typeof state.int = state.int;\n * void fn;\n */\n int(_init: number): MutableSlot<number> {\n return sentinel(\"state.int\");\n },\n\n /**\n * Allocate or read a persistent boolean slot.\n *\n * @since 0.4\n * @stable\n * @example\n * const fn: typeof state.bool = state.bool;\n * void fn;\n */\n bool(_init: boolean): MutableSlot<boolean> {\n return sentinel(\"state.bool\");\n },\n\n /**\n * Allocate or read a persistent string slot.\n *\n * @since 0.4\n * @stable\n * @example\n * const fn: typeof state.string = state.string;\n * void fn;\n */\n string(_init: string): MutableSlot<string> {\n return sentinel(\"state.string\");\n },\n\n /**\n * Tick-persistent state slots, Pine `varip` semantics. Writes commit\n * immediately, even during a tick.\n *\n * @since 0.4\n * @stable\n * @example\n * const fn: typeof state.tick.float = state.tick.float;\n * void fn;\n */\n tick: Object.freeze({\n float(_init: number): MutableSlot<number> {\n return sentinel(\"state.tick.float\");\n },\n int(_init: number): MutableSlot<number> {\n return sentinel(\"state.tick.int\");\n },\n bool(_init: boolean): MutableSlot<boolean> {\n return sentinel(\"state.tick.bool\");\n },\n string(_init: string): MutableSlot<string> {\n return sentinel(\"state.tick.string\");\n },\n }),\n});\n\n/**\n * Static type of the `state` namespace. Runtime implementations satisfy\n * this shape structurally when they are installed on `ComputeContext.state`.\n *\n * @since 0.4\n * @stable\n * @example\n * const ns: StateNamespace = state;\n * void ns;\n */\nexport type StateNamespace = typeof state;\n"]}
@@ -17,7 +17,7 @@ export type StatefulPrimitiveEntry = Readonly<{
17
17
  /**
18
18
  * Frozen set of every fully-qualified call name the compiler tracks for
19
19
  * static-analysis (`stateful-call-inside-loop`) and slot-id injection
20
- * (PLAN.md §5.5). Each entry carries a `slot` flag: `slot: true`
20
+ *. Each entry carries a `slot` flag: `slot: true`
21
21
  * primitives allocate per-callsite hidden state and get a string-literal
22
22
  * slot id injected as their first argument; `slot: false` primitives are
23
23
  * pure helpers that ride along in the set because Pine still forbids
@@ -180,7 +180,7 @@ const STATEFUL_PRIMITIVE_ENTRIES = [
180
180
  /**
181
181
  * Frozen set of every fully-qualified call name the compiler tracks for
182
182
  * static-analysis (`stateful-call-inside-loop`) and slot-id injection
183
- * (PLAN.md §5.5). Each entry carries a `slot` flag: `slot: true`
183
+ *. Each entry carries a `slot` flag: `slot: true`
184
184
  * primitives allocate per-callsite hidden state and get a string-literal
185
185
  * slot id injected as their first argument; `slot: false` primitives are
186
186
  * pure helpers that ride along in the set because Pine still forbids
@@ -1 +1 @@
1
- {"version":3,"file":"statefulPrimitives.js","sourceRoot":"","sources":["../src/statefulPrimitives.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAgB/D,MAAM,0BAA0B,GAA0C;IACtE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE;IAC9B,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE;IAC9B,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE;IAChC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE;IAC7B,EAAE,IAAI,EAAE,QAAQ,E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AE;IAClC,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAE;IACpC,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,EAAE;IACxC,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE;IACtC,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,EAAE;IACvC,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAI,EAAE;IACzC,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,EAAE;IACxC,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,EAAE;IACvC,EAAE,IAAI,EAAE,6BAA6B,EAAE,IAAI,EAAE,KAAK,EAAE;IACpD,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE;IACpC,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE;CACzC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAwC,MAAM,CAAC,MAAM,CACjF,IAAI,GAAG,CAAyB,0BAA0B,CAAC,CAC9D,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAgD,IAAI,GAAG,CAG7F,0BAA0B,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\n/**\n * Per-entry shape of {@link STATEFUL_PRIMITIVES}. `name` is the\n * fully-qualified call (`ta.ema`, `plot`, `hline`, `alert`); `slot`\n * is `true` for every primitive whose call site needs a compiler-\n * injected slot id, `false` for the stateless helpers that ride along\n * in the set for in-loop diagnostics (currently only `ta.nz`).\n *\n * @since 0.1\n * @stable\n * @example\n * const entry: StatefulPrimitiveEntry = { name: \"ta.nz\", slot: false };\n */\nexport type StatefulPrimitiveEntry = Readonly<{ name: string; slot: boolean }>;\n\nconst STATEFUL_PRIMITIVE_ENTRIES: ReadonlyArray<StatefulPrimitiveEntry> = [\n { name: \"ta.sma\", slot: true },\n { name: \"ta.ema\", slot: true },\n { name: \"ta.stdev\", slot: true },\n { name: \"ta.bb\", slot: true },\n { name: \"ta.rsi\", slot: true },\n { name: \"ta.macd\", slot: true },\n { name: \"ta.atr\", slot: true },\n { name: \"ta.crossover\", slot: true },\n { name: \"ta.crossunder\", slot: true },\n { name: \"ta.highest\", slot: true },\n { name: \"ta.lowest\", slot: true },\n { name: \"ta.change\", slot: true },\n { name: \"ta.valuewhen\", slot: true },\n { name: \"ta.barssince\", slot: true },\n { name: \"ta.wma\", slot: true },\n { name: \"ta.vwma\", slot: true },\n { name: \"ta.hma\", slot: true },\n { name: \"ta.smma\", slot: true },\n { name: \"ta.dema\", slot: true },\n { name: \"ta.tema\", slot: true },\n { name: \"ta.kama\", slot: true },\n { name: \"ta.alma\", slot: true },\n { name: \"ta.lsma\", slot: true },\n { name: \"ta.mcginley\", slot: true },\n { name: \"ta.maRibbon\", slot: true },\n { name: \"ta.cci\", slot: true },\n { name: \"ta.stoch\", slot: true },\n { name: \"ta.williamsR\", slot: true },\n { name: \"ta.stochRsi\", slot: true },\n { name: \"ta.ultimateOsc\", slot: true },\n { name: \"ta.coppock\", slot: true },\n { name: \"ta.ppo\", slot: true },\n { name: \"ta.dpo\", slot: true },\n { name: \"ta.connorsRsi\", slot: true },\n { name: \"ta.kst\", slot: true },\n { name: \"ta.fisher\", slot: true },\n { name: \"ta.klinger\", slot: true },\n { name: \"ta.rvgi\", slot: true },\n { name: \"ta.ao\", slot: true },\n { name: \"ta.cmo\", slot: true },\n { name: \"ta.momentum\", slot: true },\n { name: \"ta.roc\", slot: true },\n { name: \"ta.pmo\", slot: true },\n { name: \"ta.smi\", slot: true },\n { name: \"ta.tsi\", slot: true },\n { name: \"ta.aroon\", slot: true },\n { name: \"ta.aroonOsc\", slot: true },\n { name: \"ta.adx\", slot: true },\n { name: \"ta.dmi\", slot: true },\n { name: \"ta.trix\", slot: true },\n { name: \"ta.vortex\", slot: true },\n { name: \"ta.trendStrengthIndex\", slot: true },\n { name: \"ta.ichimoku\", slot: true },\n { name: \"ta.vol\", slot: true },\n { name: \"ta.vwap\", slot: true },\n { name: \"ta.anchoredVwap\", slot: true },\n { name: \"ta.obv\", slot: true },\n { name: \"ta.adl\", slot: true },\n { name: \"ta.bop\", slot: true },\n { name: \"ta.cmf\", slot: true },\n { name: \"ta.chaikinOsc\", slot: true },\n { name: \"ta.mfi\", slot: true },\n { name: \"ta.netVolume\", slot: true },\n { name: \"ta.pvo\", slot: true },\n { name: \"ta.pvt\", slot: true },\n { name: \"ta.eom\", slot: true },\n { name: \"ta.nvi\", slot: true },\n { name: \"ta.pvi\", slot: true },\n { name: \"ta.visibleRangeVolumeProfile\", slot: true },\n { name: \"ta.anchoredVolumeProfile\", slot: true },\n { name: \"ta.sessionVolumeProfile\", slot: true },\n { name: \"ta.fixedRangeVolumeProfile\", slot: true },\n { name: \"ta.median\", slot: true },\n { name: \"ta.adr\", slot: true },\n { name: \"ta.ulcerIndex\", slot: true },\n { name: \"ta.bbPercentB\", slot: true },\n { name: \"ta.bbw\", slot: true },\n { name: \"ta.donchian\", slot: true },\n { name: \"ta.keltner\", slot: true },\n { name: \"ta.envelope\", slot: true },\n { name: \"ta.chop\", slot: true },\n { name: \"ta.historicalVolatility\", slot: true },\n { name: \"ta.rvi\", slot: true },\n { name: \"ta.massIndex\", slot: true },\n { name: \"ta.psar\", slot: true },\n { name: \"ta.supertrend\", slot: true },\n { name: \"ta.chandelier\", slot: true },\n { name: \"ta.chandeKrollStop\", slot: true },\n { name: \"ta.williamsFractal\", slot: true },\n { name: \"ta.zigZag\", slot: true },\n { name: \"ta.pivotsHighLow\", slot: true },\n { name: \"ta.pivotsStandard\", slot: true },\n { name: \"ta.volatilityStop\", slot: true },\n { name: \"ta.nz\", slot: false },\n { name: \"plot\", slot: true },\n { name: \"hline\", slot: true },\n { name: \"alert\", slot: true },\n // Phase 3 — draw.* namespace. One entry per kind in DRAWING_KINDS\n // order. Names are camelCase (`draw.<kindCamelCase>`); the wire\n // format keeps the kebab-case `DrawingKind`.\n { name: \"draw.line\", slot: true },\n { name: \"draw.horizontalLine\", slot: true },\n { name: \"draw.horizontalRay\", slot: true },\n { name: \"draw.verticalLine\", slot: true },\n { name: \"draw.crossLine\", slot: true },\n { name: \"draw.trendAngle\", slot: true },\n { name: \"draw.rectangle\", slot: true },\n { name: \"draw.rotatedRectangle\", slot: true },\n { name: \"draw.triangle\", slot: true },\n { name: \"draw.polyline\", slot: true },\n { name: \"draw.circle\", slot: true },\n { name: \"draw.ellipse\", slot: true },\n { name: \"draw.path\", slot: true },\n { name: \"draw.marker\", slot: true },\n { name: \"draw.arc\", slot: true },\n { name: \"draw.curve\", slot: true },\n { name: \"draw.doubleCurve\", slot: true },\n { name: \"draw.pen\", slot: true },\n { name: \"draw.highlighter\", slot: true },\n { name: \"draw.brush\", slot: true },\n { name: \"draw.text\", slot: true },\n { name: \"draw.arrow\", slot: true },\n { name: \"draw.arrowMarker\", slot: true },\n { name: \"draw.arrowMarkUp\", slot: true },\n { name: \"draw.arrowMarkDown\", slot: true },\n { name: \"draw.trendChannel\", slot: true },\n { name: \"draw.flatTopBottom\", slot: true },\n { name: \"draw.disjointChannel\", slot: true },\n { name: \"draw.regressionTrend\", slot: true },\n { name: \"draw.fibRetracement\", slot: true },\n { name: \"draw.fibTrendExtension\", slot: true },\n { name: \"draw.fibChannel\", slot: true },\n { name: \"draw.fibTimeZone\", slot: true },\n { name: \"draw.fibWedge\", slot: true },\n { name: \"draw.fibSpeedFan\", slot: true },\n { name: \"draw.fibSpeedArcs\", slot: true },\n { name: \"draw.fibSpiral\", slot: true },\n { name: \"draw.fibCircles\", slot: true },\n { name: \"draw.fibTrendTime\", slot: true },\n { name: \"draw.gannBox\", slot: true },\n { name: \"draw.gannSquareFixed\", slot: true },\n { name: \"draw.gannSquare\", slot: true },\n { name: \"draw.gannFan\", slot: true },\n { name: \"draw.pitchfork\", slot: true },\n { name: \"draw.pitchfan\", slot: true },\n { name: \"draw.xabcdPattern\", slot: true },\n { name: \"draw.cypherPattern\", slot: true },\n { name: \"draw.headAndShoulders\", slot: true },\n { name: \"draw.abcdPattern\", slot: true },\n { name: \"draw.trianglePattern\", slot: true },\n { name: \"draw.threeDrivesPattern\", slot: true },\n { name: \"draw.elliottImpulseWave\", slot: true },\n { name: \"draw.elliottCorrectionWave\", slot: true },\n { name: \"draw.elliottTriangleWave\", slot: true },\n { name: \"draw.elliottDoubleCombo\", slot: true },\n { name: \"draw.elliottTripleCombo\", slot: true },\n { name: \"draw.cyclicLines\", slot: true },\n { name: \"draw.timeCycles\", slot: true },\n { name: \"draw.sineLine\", slot: true },\n { name: \"draw.group\", slot: true },\n { name: \"draw.frame\", slot: true },\n { name: \"draw.table\", slot: true },\n { name: \"state.float\", slot: true },\n { name: \"state.int\", slot: true },\n { name: \"state.bool\", slot: true },\n { name: \"state.string\", slot: true },\n { name: \"state.tick.float\", slot: true },\n { name: \"state.tick.int\", slot: true },\n { name: \"state.tick.bool\", slot: true },\n { name: \"state.tick.string\", slot: true },\n { name: \"request.security\", slot: true },\n { name: \"request.lowerTf\", slot: true },\n { name: \"defineAlertCondition.signal\", slot: false },\n { name: \"runtime.log\", slot: false },\n { name: \"runtime.error\", slot: false },\n];\n\n/**\n * Frozen set of every fully-qualified call name the compiler tracks for\n * static-analysis (`stateful-call-inside-loop`) and slot-id injection\n *. Each entry carries a `slot` flag: `slot: true`\n * primitives allocate per-callsite hidden state and get a string-literal\n * slot id injected as their first argument; `slot: false` primitives are\n * pure helpers that ride along in the set because Pine still forbids\n * them inside loops (e.g. `ta.nz`).\n *\n * Phase 1 shipped 12 `slot: true` entries. Phase 2 widens the shape to\n * `{ name, slot }` so `ta.nz` (the only stateless Phase-2 cross-functional\n * primitive) can opt out of slot-id injection without losing the\n * in-loop diagnostic. Subsequent Phase-2 batch tasks (Tasks 6–28) each\n * append `slot: true` entries; Phase 3 appends 61 `draw.<camelKind>`\n * entries (all `slot: true`), and Phase 4 appends 8 `state.*` /\n * `state.tick.*` entries plus request primitives. Phase 5 appends alert-condition signalling plus runtime\n * logging/error as stateless loop-diagnostic entries plus `draw.table`\n * as a slot-backed viewport drawing.\n *\n * Locked at `apiVersion: 1` (172 entries). Adding, removing, or renaming\n * an entry is a language change and requires `apiVersion: 2` — see\n * `docs/spec/versioning.md`.\n *\n * @since 0.1\n * @stable\n * @example\n * import { STATEFUL_PRIMITIVES } from \"@invinite-org/chartlang-core\";\n * for (const entry of STATEFUL_PRIMITIVES) {\n * if (entry.name === \"ta.ema\" && entry.slot) {\n * // compiler injects an id here\n * }\n * }\n */\nexport const STATEFUL_PRIMITIVES: ReadonlySet<StatefulPrimitiveEntry> = Object.freeze(\n new Set<StatefulPrimitiveEntry>(STATEFUL_PRIMITIVE_ENTRIES),\n);\n\n/**\n * Name → entry index of {@link STATEFUL_PRIMITIVES}. The compiler's\n * `callsiteIdInjection` and `statefulCallInLoop` passes consult this map\n * by callee name once per call site — O(1) lookup instead of an O(n) scan\n * over the 172-entry set on every visited call. The map is derived from\n * the same canonical entry list as {@link STATEFUL_PRIMITIVES} so adding\n * a primitive to the set adds it here automatically.\n *\n * Locked at `apiVersion: 1` (172 entries). Adding, removing, or renaming\n * an entry is a language change and requires `apiVersion: 2` — see\n * `docs/spec/versioning.md`.\n *\n * @since 0.2\n * @stable\n * @example\n * import { STATEFUL_PRIMITIVES_BY_NAME } from \"@invinite-org/chartlang-core\";\n * const entry = STATEFUL_PRIMITIVES_BY_NAME.get(\"ta.ema\");\n * // entry is { name: \"ta.ema\", slot: true } | undefined\n */\nexport const STATEFUL_PRIMITIVES_BY_NAME: ReadonlyMap<string, StatefulPrimitiveEntry> = new Map<\n string,\n StatefulPrimitiveEntry\n>(STATEFUL_PRIMITIVE_ENTRIES.map((entry) => [entry.name, entry]));\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ta/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ta/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,cAAc,SAAS,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nexport * from \"./ta.js\";\n"]}