@luxalgo/vela 0.6.5 → 0.6.7

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 (48) hide show
  1. package/README.md +16 -16
  2. package/dist/{DataProvider-BmHkcwvJ.d.ts → DataProvider-BSLlBpB9.d.ts} +11 -1
  3. package/dist/{DataProvider-DrN7ZIou.d.cts → DataProvider-BsQM2WNH.d.cts} +11 -1
  4. package/dist/{history-BmyjaVir.d.cts → bottombar-Br4rzx_R.d.ts} +158 -129
  5. package/dist/{history-CvOtsjT5.d.ts → bottombar-Div5zibZ.d.cts} +158 -129
  6. package/dist/{chunk-FQBT4NFM.js → chunk-6WFKTAT4.js} +2797 -2527
  7. package/dist/{chunk-BEJ57HP4.js → chunk-L3I2CCYO.js} +62 -1
  8. package/dist/chunk-W4EJWLEO.js +12 -0
  9. package/dist/{chunk-N6MBJHMV.js → chunk-WVP4XV5A.js} +6050 -3402
  10. package/dist/{contributions-DatoAzMx.d.ts → contributions-Hv4_cOJo.d.cts} +152 -5
  11. package/dist/{contributions-2bEmCF9S.d.cts → contributions-Z12BrWCy.d.ts} +152 -5
  12. package/dist/index.cjs +2798 -2484
  13. package/dist/index.d.cts +44 -16
  14. package/dist/index.d.ts +44 -16
  15. package/dist/index.js +2 -2
  16. package/dist/{options-YdiaaVjt.d.cts → options-BaVTMXaO.d.cts} +48 -2
  17. package/dist/{options-YdiaaVjt.d.ts → options-BaVTMXaO.d.ts} +48 -2
  18. package/dist/{plugin-Bcone6Vh.d.ts → plugin-9koBjc5H.d.ts} +6 -4
  19. package/dist/{plugin-DO_DX0gp.d.cts → plugin-BXhDHTYn.d.cts} +6 -4
  20. package/dist/plugin.cjs +44 -0
  21. package/dist/plugin.d.cts +4 -4
  22. package/dist/plugin.d.ts +4 -4
  23. package/dist/plugin.js +1 -1
  24. package/dist/providers/binance.cjs +16 -0
  25. package/dist/providers/binance.d.cts +5 -2
  26. package/dist/providers/binance.d.ts +5 -2
  27. package/dist/providers/binance.js +7 -0
  28. package/dist/providers/coinbase.cjs +16 -0
  29. package/dist/providers/coinbase.d.cts +5 -2
  30. package/dist/providers/coinbase.d.ts +5 -2
  31. package/dist/providers/coinbase.js +7 -0
  32. package/dist/providers/hyperliquid.cjs +16 -0
  33. package/dist/providers/hyperliquid.d.cts +5 -2
  34. package/dist/providers/hyperliquid.d.ts +5 -2
  35. package/dist/providers/hyperliquid.js +7 -0
  36. package/dist/ui.d.cts +1 -1
  37. package/dist/ui.d.ts +1 -1
  38. package/dist/vela.global.js +2824 -2484
  39. package/dist/vela.global.min.js +48 -48
  40. package/dist/widget.cjs +35791 -34070
  41. package/dist/widget.d.cts +80 -275
  42. package/dist/widget.d.ts +80 -275
  43. package/dist/widget.js +61 -1313
  44. package/dist/workspace.cjs +1700 -995
  45. package/dist/workspace.d.cts +120 -15
  46. package/dist/workspace.d.ts +120 -15
  47. package/dist/workspace.js +7 -2281
  48. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { t as Millis, ae as InputSchema, ac as IndicatorMeta, P as PriceStyle, O as OHLCV, m as InputValue, k as IndicatorModel, j as MoveTarget, aB as SeriesSpec, aa as Fill, B as Background, at as PriceLine, a0 as DrawingLine, Y as DrawingBox, $ as DrawingLabel, a4 as DrawingPolyline, a1 as DrawingLinefill, a6 as DrawingTable, g as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, v as DrawingTypeKey, u as SnapMode, a2 as DrawingMode, I as IChartRenderer, R as RendererCapabilities, o as LegendActionView, U as Unsubscribe, C as CrosshairEvent, A as AxisLongPressEvent, r as DataWindowReadout, n as SymbolPickerFn, aO as PaneInfo, a9 as DrawingsOption, D as Drawing, b as VelaOptions, x as AddIndicatorOptions, ap as MarketSwitch, ao as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-YdiaaVjt.js';
2
- import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-BmHkcwvJ.js';
1
+ import { t as Millis, ae as InputSchema, ac as IndicatorMeta, P as PriceStyle, O as OHLCV, m as InputValue, k as IndicatorModel, j as MoveTarget, aq as PaneAxis, aD as SeriesSpec, aa as Fill, B as Background, av as PriceLine, a0 as DrawingLine, Y as DrawingBox, $ as DrawingLabel, a4 as DrawingPolyline, a1 as DrawingLinefill, a6 as DrawingTable, g as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, v as DrawingTypeKey, u as SnapMode, a2 as DrawingMode, I as IChartRenderer, R as RendererCapabilities, o as LegendActionView, U as Unsubscribe, C as CrosshairEvent, A as AxisLongPressEvent, r as DataWindowReadout, n as SymbolPickerFn, aR as PaneInfo, a9 as DrawingsOption, D as Drawing, b as VelaOptions, x as AddIndicatorOptions, ap as MarketSwitch, ao as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-BaVTMXaO.cjs';
2
+ import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-BsQM2WNH.cjs';
3
3
 
4
4
  /**
5
5
  * A strategy's broker state at ONE bar — the flat summary a host reads while a script
@@ -361,6 +361,10 @@ declare class DataControl {
361
361
  providerInstance(name: string): DataProvider | undefined;
362
362
  /** Indexed symbols for one provider (or all) — for autocomplete. */
363
363
  symbols(provider?: string): SymbolDescriptor[];
364
+ /** The icon URL for `symbol` — its owning provider's `resolveSymbolIcon`, routed
365
+ * through resolution. Undefined while unresolvable, when the provider declares no
366
+ * resolver, or on a custom `deps.dataFeed` — the shells then show initials. */
367
+ symbolIcon(symbol: string): string | undefined;
364
368
  /** Per-symbol metadata (Pine `syminfo.*`), resolved through the owning provider. */
365
369
  symbolInfo(symbol: string): Promise<SymbolInfo | undefined>;
366
370
  /**
@@ -382,6 +386,13 @@ declare class DataControl {
382
386
  * columns — instead pushes its payload through the dedicated renderer seam, `pushData`.)
383
387
  */
384
388
  interface NativeIndicatorOutput {
389
+ /**
390
+ * Value-axis override for the pane this native OWNS (see `IndicatorModel.paneAxis`):
391
+ * `'none'` for content that is not value-mapped, or band labels for a categorical
392
+ * axis. Emitted per compute, so it can follow the inputs (e.g. row toggles relabel
393
+ * the axis). Absent ⇒ the pane derives a scale from its content as usual.
394
+ */
395
+ paneAxis?: PaneAxis;
385
396
  series?: SeriesSpec[];
386
397
  fills?: Fill[];
387
398
  backgrounds?: Background[];
@@ -753,7 +764,11 @@ interface VelaEventMap extends Record<string, unknown> {
753
764
  oldestTime: number;
754
765
  barsLoaded: number;
755
766
  };
756
- alert: EngineAlert;
767
+ /** An indicator's script raised an alert. `indicator` names the source — the
768
+ * indicator's display title (what its legend row shows). */
769
+ alert: EngineAlert & {
770
+ indicator?: string;
771
+ };
757
772
  warning: EngineWarning;
758
773
  }
759
774
 
@@ -928,7 +943,23 @@ declare class RendererControl {
928
943
  setSettingsSections(sections: ReadonlyArray<{
929
944
  title: string;
930
945
  rows: readonly unknown[];
946
+ id?: string;
931
947
  }>): this;
948
+ /**
949
+ * Set the settings-dialog visibility policy: `hidden` lists setting ids to hide —
950
+ * a tab (`'canvas'`), a group (`'canvas.grid'`), or a single row
951
+ * (`'canvas.grid.vertical'`); an id hides its whole subtree, and a tab with nothing
952
+ * left disappears from the rail. Presentation-only: hidden values keep being stored
953
+ * and applied (e.g. hide `'advanced'` while forcing the widget's `bars` option).
954
+ * Seeded from `VelaOptions.settings`; silent no-op without a settings dialog.
955
+ */
956
+ setSettingsVisibility(policy: {
957
+ hidden?: readonly string[];
958
+ }): this;
959
+ /** Every addressable setting id of this chart (built-in tabs/groups/rows, chart-type
960
+ * sections, host sections) — enumerate these to build a `hidden` list instead of
961
+ * reading contributor source. Empty on a renderer without a settings dialog. */
962
+ listSettingsIds(): string[];
932
963
  /** Tell the renderer's own chrome which size class the host shell is in —
933
964
  * `'mobile'` switches its dialogs/toolbars to the touch-first presentation.
934
965
  * Silent no-op on a renderer without adaptive chrome. */
@@ -1425,6 +1456,28 @@ interface WidgetContext {
1425
1456
  host: HTMLElement;
1426
1457
  /** The widget's feedback pill (bottom-center, auto-hides). */
1427
1458
  toast(message: string, kind?: 'info' | 'success' | 'error'): void;
1459
+ /** Add a SCRIPT indicator to the active chart THROUGH THE SHELL — unlike the raw
1460
+ * `chart.addIndicator`, the addition enters the unified undo/redo timeline, the
1461
+ * topbar indicator count, and the shell's bookkeeping. The entry's source rides the
1462
+ * recorded action, so redo re-adds it even after the original handle died. The
1463
+ * shell does NOT persist these across reloads (they are not manifest entries) —
1464
+ * a plugin that wants them back owns that via {@link registerStatePersistence}. */
1465
+ addIndicator(entry: ExternalIndicatorEntry): void;
1466
+ /** Add a native (core-computed) indicator to the active chart through the shell —
1467
+ * recorded in the undo/redo timeline, unlike the raw `chart.addNativeIndicator`. */
1468
+ addNativeIndicator(type: string): void;
1469
+ /** Tell the shell some PERSISTABLE third-party state changed (a debounced
1470
+ * `state:changed` + storage write follows). Only needed for state with no shell
1471
+ * event of its own — indicator adds/removals already trigger the save cycle. */
1472
+ stateChanged(): void;
1473
+ }
1474
+ /** What {@link WidgetContext.addIndicator} takes: a named script, ready to run. */
1475
+ interface ExternalIndicatorEntry {
1476
+ name: string;
1477
+ /** The script source (the recorded undo/redo action re-adds from it). */
1478
+ script: string;
1479
+ /** Engine language (default: the chart's default engine). */
1480
+ language?: string;
1428
1481
  }
1429
1482
  /** Where an action is projected. */
1430
1483
  type WidgetActionTarget = 'topbar' | 'context:body' | 'context:price-axis' | 'context:time-axis';
@@ -1528,7 +1581,24 @@ declare function registerSidePanel(desc: SidePanelDescriptor): () => void;
1528
1581
  declare function unregisterSidePanel(id: string): void;
1529
1582
  /** Every registered side panel, `order`-sorted (registration order breaks ties). */
1530
1583
  declare function sidePanels(): SidePanelDescriptor[];
1531
- /** Register (or replace) a widget action. Widgets read the registry live. */
1584
+ /** The built-in topbar slots a contributed action may TAKE OVER by registering under
1585
+ * their id — the "simple button" slots. The composites (symbol, timeframes, style,
1586
+ * layout, undo-redo, alerts, panels) are stateful controls the shell pushes state
1587
+ * into; a plain `{label, icon, run}` descriptor cannot stand in for them. */
1588
+ declare const OVERRIDABLE_TOPBAR_IDS: readonly ["indicators", "screenshot"];
1589
+ /**
1590
+ * The action OVERRIDING a built-in topbar slot, if one is registered — an action whose
1591
+ * `id` IS the built-in id. An override takes the slot's WHOLE surface: the desktop
1592
+ * button (at the slot's position), the mobile counterpart, and the keyboard chord all
1593
+ * route to `run`, and the native machinery behind the slot (the built-in indicator
1594
+ * picker) is not constructed. Shells resolve this at construction — register at import
1595
+ * time, like every contribution.
1596
+ */
1597
+ declare function topbarActionOverride(id: string): WidgetActionDescriptor | undefined;
1598
+ /** Register (or replace) a widget action. Widgets read the registry live.
1599
+ * Registering under a RESERVED built-in topbar id (`'indicators'`, `'screenshot'`)
1600
+ * OVERRIDES that slot — see {@link topbarActionOverride}. Built-in ids that are
1601
+ * stateful composites cannot be overridden and the registration is refused. */
1532
1602
  declare function registerWidgetAction(desc: WidgetActionDescriptor): () => void;
1533
1603
  declare function unregisterWidgetAction(id: string): void;
1534
1604
  /** Actions for one target, `order`-sorted, `when`-filtered when a context is given. */
@@ -1565,6 +1635,83 @@ declare function registerLegendAction(desc: LegendActionDescriptor): () => void;
1565
1635
  declare function unregisterLegendAction(id: string): void;
1566
1636
  /** Every registered legend action, `order`-sorted (registration order breaks ties). */
1567
1637
  declare function legendActions(): LegendActionDescriptor[];
1638
+ /**
1639
+ * The surface a `scope: 'cell'` persistence handler works against — bound to ONE cell
1640
+ * (never the active one by proxy), because serialize/restore run per cell, including
1641
+ * cells that are not active. `addIndicator`/`addNativeIndicator` target THIS cell and
1642
+ * are ALWAYS muted — unlike their {@link WidgetContext} namesakes they never enter the
1643
+ * undo timeline, even from an async `restore` continuation (fetch, then add): applying
1644
+ * a document is state application, not a user edit.
1645
+ */
1646
+ interface CellStateContext {
1647
+ /** The cell's durable identity (`'c1'`, a declared name). */
1648
+ cellId: string;
1649
+ /** The cell's LIVE chart. */
1650
+ chart: Vela;
1651
+ /** Add a script indicator to THIS cell through the shell (see {@link WidgetContext.addIndicator}). */
1652
+ addIndicator(entry: ExternalIndicatorEntry): void;
1653
+ /** Add a native indicator to THIS cell through the shell. */
1654
+ addNativeIndicator(type: string): void;
1655
+ }
1656
+ /**
1657
+ * A third-party STATE PERSISTENCE handler — how a plugin puts its own state into the
1658
+ * shell's persisted document (the `ext` bag of `WorkspaceState` / per-chart state)
1659
+ * instead of running a parallel store. `key` is namespaced (`'vendor.feature'`) and
1660
+ * flat — one entry per handler. `serialize` runs on every shell snapshot (`getState`,
1661
+ * the persist write) and returns a JSON-serializable payload, or `undefined` for "no
1662
+ * entry". `restore` runs when a document carrying the key is applied (boot restore,
1663
+ * `applyState`) — AFTER the core state (chart alive, engines registered, indicator
1664
+ * ledger converged) and, for cell scope, inside the cell's history-mute, so nothing it
1665
+ * does enters undo/redo. The payload is UNTRUSTED (the codec passes `ext` through
1666
+ * opaquely): validate it. `restore` is only called for keys present in the document.
1667
+ *
1668
+ * Register at import time, before shells are constructed — the rule every contribution
1669
+ * registry shares. A key with no registered handler still round-trips verbatim, so a
1670
+ * session without the plugin never loses its state.
1671
+ */
1672
+ type StatePersistenceHandler = {
1673
+ /** Namespaced entry key (`'velapro.indicators'`) — re-registering a key replaces it. */
1674
+ key: string;
1675
+ /** Where the entry lives: per chart (`charts[i].ext`) — follows the cell through pool/layout moves. */
1676
+ scope: 'cell';
1677
+ serialize(ctx: CellStateContext): unknown;
1678
+ restore(payload: unknown, ctx: CellStateContext): void;
1679
+ } | {
1680
+ key: string;
1681
+ /** Document root (`state.ext`) — one entry per document, whatever the grid. */
1682
+ scope: 'global';
1683
+ serialize(ctx: WidgetContext): unknown;
1684
+ restore(payload: unknown, ctx: WidgetContext): void;
1685
+ };
1686
+ /** Register (or replace) a state-persistence handler. Returns an unregister disposer. */
1687
+ declare function registerStatePersistence(handler: StatePersistenceHandler): () => void;
1688
+ declare function unregisterStatePersistence(key: string): void;
1689
+ /** The registered handlers of one scope (registration order). */
1690
+ declare function statePersistenceHandlers<S extends StatePersistenceHandler['scope']>(scope: S): Array<Extract<StatePersistenceHandler, {
1691
+ scope: S;
1692
+ }>>;
1693
+ /**
1694
+ * Reorder the symbol picker's AGGREGATED pool — every source combined, exactly what
1695
+ * the search dialog displays. Called when the pool changes (a provider's index lands
1696
+ * or refreshes), NOT per keystroke: the picker caches the result. May be async (a
1697
+ * server-fetched top list) — the picker shows the current order and refreshes when
1698
+ * the promise resolves.
1699
+ *
1700
+ * The returned list may INJECT descriptors absent from the pool (they must carry
1701
+ * their `provider` and be genuinely servable, or selecting them parks the load) and
1702
+ * may OMIT entries (hiding them). The picker dedupes by venue+ticker, FIRST
1703
+ * occurrence winning — injecting at the head fixes both position and display data.
1704
+ *
1705
+ * While a ranking is registered, the picker's built-in empty-query pin (the hardcoded
1706
+ * majors) stands down: the head of YOUR list is the dialog's opening screen. Under a
1707
+ * typed query the relevance tiers still lead — the ranking orders within each tier.
1708
+ */
1709
+ type SymbolRankingHook = (pool: SymbolDescriptor[]) => SymbolDescriptor[] | Promise<SymbolDescriptor[]>;
1710
+ /** Register (or replace — ONE ranking at a time, last wins) the symbol ranking.
1711
+ * Returns an unregister disposer. Register at import time, like every contribution. */
1712
+ declare function registerSymbolRanking(hook: SymbolRankingHook): () => void;
1713
+ /** The registered ranking, if any — what the shells' symbol picker consults. */
1714
+ declare function symbolRanking(): SymbolRankingHook | undefined;
1568
1715
  /** Makes ONE engine instance for ONE chart — engines hold per-chart sessions (and
1569
1716
  * possibly a worker), so the shell calls the factory per chart build, never shares. */
1570
1717
  type EngineFactory = () => ScriptingEngine;
@@ -1582,4 +1729,4 @@ declare function unregisterDefaultEngine(language: string): void;
1582
1729
  * language. The shell layers (widget, workspace cell) register exactly this result. */
1583
1730
  declare function resolveEngines(overrides?: Record<string, EngineFactory>): Record<string, EngineFactory>;
1584
1731
 
1585
- export { nativeIndicatorDescriptors as $, type SidePanelHandle as A, type BarsChangeReason as B, type ContextSelect as C, type DrawingsDocument as D, type EngineAlert as E, type FetchSeries as F, type SidePanelHeader as G, type StrategyFill as H, type IndicatorHandle as I, type StrategyState as J, type StrategyTrade as K, type LegendActionDescriptor as L, type VelaDeps as M, type NativeIndicator as N, type VelaEventMap as O, type ParsedSymbol as P, type VisibleBarRange as Q, type Resolved as R, type ScriptingEngine as S, TypedEventBus as T, type WidgetActionDescriptor as U, Vela as V, type WidgetContext as W, type WidgetActionTarget as X, type WidgetAttachment as Y, getNativeIndicator as Z, legendActions as _, type ScriptRun as a, nativeIndicatorTypes as a0, registerDefaultEngine as a1, registerLegendAction as a2, registerNativeIndicator as a3, registerSidePanel as a4, registerWidgetAction as a5, registerWidgetAttachment as a6, resolveEngines as a7, sidePanels as a8, unregisterDefaultEngine as a9, unregisterLegendAction as aa, unregisterNativeIndicator as ab, unregisterSidePanel as ac, unregisterWidgetAction as ad, unregisterWidgetAttachment as ae, widgetActions as af, widgetAttachments as ag, DEFAULT_PANEL_ORDER as ah, DataControl as b, DrawingsControl as c, type EngineCapabilities as d, type EngineContextSnapshot as e, type EngineFactory as f, type EngineWarning as g, type ExecutionHandlers as h, type ExecutionMarket as i, type ExecutionRequest as j, type ExecutionSession as k, type IndicatorEventMap as l, type IndicatorSummary as m, type LegendIndicatorInfo as n, type NativeIndicatorContext as o, type NativeIndicatorDescriptor as p, type NativeIndicatorInfo as q, type NativeIndicatorOutput as r, type PreparedScript as s, RendererControl as t, type RunIndicatorResult as u, type SceneInspection as v, type ScriptRunCause as w, type ScriptRunResult as x, type SidePanelButton as y, type SidePanelDescriptor as z };
1732
+ export { type WidgetActionDescriptor as $, type SidePanelButton as A, type BarsChangeReason as B, type CellStateContext as C, type DrawingsDocument as D, type ExternalIndicatorEntry as E, type FetchSeries as F, type SidePanelDescriptor as G, type SidePanelHandle as H, type IndicatorHandle as I, type SidePanelHeader as J, type StatePersistenceHandler as K, type LegendActionDescriptor as L, type StrategyFill as M, type NativeIndicator as N, OVERRIDABLE_TOPBAR_IDS as O, type ParsedSymbol as P, type StrategyState as Q, type Resolved as R, type ScriptingEngine as S, type StrategyTrade as T, type SymbolRankingHook as U, Vela as V, type WidgetContext as W, TypedEventBus as X, type VelaDeps as Y, type VelaEventMap as Z, type VisibleBarRange as _, type ScriptRun as a, type WidgetActionTarget as a0, type WidgetAttachment as a1, getNativeIndicator as a2, legendActions as a3, nativeIndicatorDescriptors as a4, nativeIndicatorTypes as a5, registerDefaultEngine as a6, registerLegendAction as a7, registerNativeIndicator as a8, registerSidePanel as a9, registerStatePersistence as aa, registerSymbolRanking as ab, registerWidgetAction as ac, registerWidgetAttachment as ad, resolveEngines as ae, sidePanels as af, statePersistenceHandlers as ag, symbolRanking as ah, topbarActionOverride as ai, unregisterDefaultEngine as aj, unregisterLegendAction as ak, unregisterNativeIndicator as al, unregisterSidePanel as am, unregisterStatePersistence as an, unregisterWidgetAction as ao, unregisterWidgetAttachment as ap, widgetActions as aq, widgetAttachments as ar, DEFAULT_PANEL_ORDER as as, type ContextSelect as b, DataControl as c, DrawingsControl as d, type EngineAlert as e, type EngineCapabilities as f, type EngineContextSnapshot as g, type EngineFactory as h, type EngineWarning as i, type ExecutionHandlers as j, type ExecutionMarket as k, type ExecutionRequest as l, type ExecutionSession as m, type IndicatorEventMap as n, type IndicatorSummary as o, type LegendIndicatorInfo as p, type NativeIndicatorContext as q, type NativeIndicatorDescriptor as r, type NativeIndicatorInfo as s, type NativeIndicatorOutput as t, type PreparedScript as u, RendererControl as v, type RunIndicatorResult as w, type SceneInspection as x, type ScriptRunCause as y, type ScriptRunResult as z };
@@ -1,5 +1,5 @@
1
- import { t as Millis, ae as InputSchema, ac as IndicatorMeta, P as PriceStyle, O as OHLCV, m as InputValue, k as IndicatorModel, j as MoveTarget, aB as SeriesSpec, aa as Fill, B as Background, at as PriceLine, a0 as DrawingLine, Y as DrawingBox, $ as DrawingLabel, a4 as DrawingPolyline, a1 as DrawingLinefill, a6 as DrawingTable, g as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, v as DrawingTypeKey, u as SnapMode, a2 as DrawingMode, I as IChartRenderer, R as RendererCapabilities, o as LegendActionView, U as Unsubscribe, C as CrosshairEvent, A as AxisLongPressEvent, r as DataWindowReadout, n as SymbolPickerFn, aO as PaneInfo, a9 as DrawingsOption, D as Drawing, b as VelaOptions, x as AddIndicatorOptions, ap as MarketSwitch, ao as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-YdiaaVjt.cjs';
2
- import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-DrN7ZIou.cjs';
1
+ import { t as Millis, ae as InputSchema, ac as IndicatorMeta, P as PriceStyle, O as OHLCV, m as InputValue, k as IndicatorModel, j as MoveTarget, aq as PaneAxis, aD as SeriesSpec, aa as Fill, B as Background, av as PriceLine, a0 as DrawingLine, Y as DrawingBox, $ as DrawingLabel, a4 as DrawingPolyline, a1 as DrawingLinefill, a6 as DrawingTable, g as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, v as DrawingTypeKey, u as SnapMode, a2 as DrawingMode, I as IChartRenderer, R as RendererCapabilities, o as LegendActionView, U as Unsubscribe, C as CrosshairEvent, A as AxisLongPressEvent, r as DataWindowReadout, n as SymbolPickerFn, aR as PaneInfo, a9 as DrawingsOption, D as Drawing, b as VelaOptions, x as AddIndicatorOptions, ap as MarketSwitch, ao as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-BaVTMXaO.js';
2
+ import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-BSLlBpB9.js';
3
3
 
4
4
  /**
5
5
  * A strategy's broker state at ONE bar — the flat summary a host reads while a script
@@ -361,6 +361,10 @@ declare class DataControl {
361
361
  providerInstance(name: string): DataProvider | undefined;
362
362
  /** Indexed symbols for one provider (or all) — for autocomplete. */
363
363
  symbols(provider?: string): SymbolDescriptor[];
364
+ /** The icon URL for `symbol` — its owning provider's `resolveSymbolIcon`, routed
365
+ * through resolution. Undefined while unresolvable, when the provider declares no
366
+ * resolver, or on a custom `deps.dataFeed` — the shells then show initials. */
367
+ symbolIcon(symbol: string): string | undefined;
364
368
  /** Per-symbol metadata (Pine `syminfo.*`), resolved through the owning provider. */
365
369
  symbolInfo(symbol: string): Promise<SymbolInfo | undefined>;
366
370
  /**
@@ -382,6 +386,13 @@ declare class DataControl {
382
386
  * columns — instead pushes its payload through the dedicated renderer seam, `pushData`.)
383
387
  */
384
388
  interface NativeIndicatorOutput {
389
+ /**
390
+ * Value-axis override for the pane this native OWNS (see `IndicatorModel.paneAxis`):
391
+ * `'none'` for content that is not value-mapped, or band labels for a categorical
392
+ * axis. Emitted per compute, so it can follow the inputs (e.g. row toggles relabel
393
+ * the axis). Absent ⇒ the pane derives a scale from its content as usual.
394
+ */
395
+ paneAxis?: PaneAxis;
385
396
  series?: SeriesSpec[];
386
397
  fills?: Fill[];
387
398
  backgrounds?: Background[];
@@ -753,7 +764,11 @@ interface VelaEventMap extends Record<string, unknown> {
753
764
  oldestTime: number;
754
765
  barsLoaded: number;
755
766
  };
756
- alert: EngineAlert;
767
+ /** An indicator's script raised an alert. `indicator` names the source — the
768
+ * indicator's display title (what its legend row shows). */
769
+ alert: EngineAlert & {
770
+ indicator?: string;
771
+ };
757
772
  warning: EngineWarning;
758
773
  }
759
774
 
@@ -928,7 +943,23 @@ declare class RendererControl {
928
943
  setSettingsSections(sections: ReadonlyArray<{
929
944
  title: string;
930
945
  rows: readonly unknown[];
946
+ id?: string;
931
947
  }>): this;
948
+ /**
949
+ * Set the settings-dialog visibility policy: `hidden` lists setting ids to hide —
950
+ * a tab (`'canvas'`), a group (`'canvas.grid'`), or a single row
951
+ * (`'canvas.grid.vertical'`); an id hides its whole subtree, and a tab with nothing
952
+ * left disappears from the rail. Presentation-only: hidden values keep being stored
953
+ * and applied (e.g. hide `'advanced'` while forcing the widget's `bars` option).
954
+ * Seeded from `VelaOptions.settings`; silent no-op without a settings dialog.
955
+ */
956
+ setSettingsVisibility(policy: {
957
+ hidden?: readonly string[];
958
+ }): this;
959
+ /** Every addressable setting id of this chart (built-in tabs/groups/rows, chart-type
960
+ * sections, host sections) — enumerate these to build a `hidden` list instead of
961
+ * reading contributor source. Empty on a renderer without a settings dialog. */
962
+ listSettingsIds(): string[];
932
963
  /** Tell the renderer's own chrome which size class the host shell is in —
933
964
  * `'mobile'` switches its dialogs/toolbars to the touch-first presentation.
934
965
  * Silent no-op on a renderer without adaptive chrome. */
@@ -1425,6 +1456,28 @@ interface WidgetContext {
1425
1456
  host: HTMLElement;
1426
1457
  /** The widget's feedback pill (bottom-center, auto-hides). */
1427
1458
  toast(message: string, kind?: 'info' | 'success' | 'error'): void;
1459
+ /** Add a SCRIPT indicator to the active chart THROUGH THE SHELL — unlike the raw
1460
+ * `chart.addIndicator`, the addition enters the unified undo/redo timeline, the
1461
+ * topbar indicator count, and the shell's bookkeeping. The entry's source rides the
1462
+ * recorded action, so redo re-adds it even after the original handle died. The
1463
+ * shell does NOT persist these across reloads (they are not manifest entries) —
1464
+ * a plugin that wants them back owns that via {@link registerStatePersistence}. */
1465
+ addIndicator(entry: ExternalIndicatorEntry): void;
1466
+ /** Add a native (core-computed) indicator to the active chart through the shell —
1467
+ * recorded in the undo/redo timeline, unlike the raw `chart.addNativeIndicator`. */
1468
+ addNativeIndicator(type: string): void;
1469
+ /** Tell the shell some PERSISTABLE third-party state changed (a debounced
1470
+ * `state:changed` + storage write follows). Only needed for state with no shell
1471
+ * event of its own — indicator adds/removals already trigger the save cycle. */
1472
+ stateChanged(): void;
1473
+ }
1474
+ /** What {@link WidgetContext.addIndicator} takes: a named script, ready to run. */
1475
+ interface ExternalIndicatorEntry {
1476
+ name: string;
1477
+ /** The script source (the recorded undo/redo action re-adds from it). */
1478
+ script: string;
1479
+ /** Engine language (default: the chart's default engine). */
1480
+ language?: string;
1428
1481
  }
1429
1482
  /** Where an action is projected. */
1430
1483
  type WidgetActionTarget = 'topbar' | 'context:body' | 'context:price-axis' | 'context:time-axis';
@@ -1528,7 +1581,24 @@ declare function registerSidePanel(desc: SidePanelDescriptor): () => void;
1528
1581
  declare function unregisterSidePanel(id: string): void;
1529
1582
  /** Every registered side panel, `order`-sorted (registration order breaks ties). */
1530
1583
  declare function sidePanels(): SidePanelDescriptor[];
1531
- /** Register (or replace) a widget action. Widgets read the registry live. */
1584
+ /** The built-in topbar slots a contributed action may TAKE OVER by registering under
1585
+ * their id — the "simple button" slots. The composites (symbol, timeframes, style,
1586
+ * layout, undo-redo, alerts, panels) are stateful controls the shell pushes state
1587
+ * into; a plain `{label, icon, run}` descriptor cannot stand in for them. */
1588
+ declare const OVERRIDABLE_TOPBAR_IDS: readonly ["indicators", "screenshot"];
1589
+ /**
1590
+ * The action OVERRIDING a built-in topbar slot, if one is registered — an action whose
1591
+ * `id` IS the built-in id. An override takes the slot's WHOLE surface: the desktop
1592
+ * button (at the slot's position), the mobile counterpart, and the keyboard chord all
1593
+ * route to `run`, and the native machinery behind the slot (the built-in indicator
1594
+ * picker) is not constructed. Shells resolve this at construction — register at import
1595
+ * time, like every contribution.
1596
+ */
1597
+ declare function topbarActionOverride(id: string): WidgetActionDescriptor | undefined;
1598
+ /** Register (or replace) a widget action. Widgets read the registry live.
1599
+ * Registering under a RESERVED built-in topbar id (`'indicators'`, `'screenshot'`)
1600
+ * OVERRIDES that slot — see {@link topbarActionOverride}. Built-in ids that are
1601
+ * stateful composites cannot be overridden and the registration is refused. */
1532
1602
  declare function registerWidgetAction(desc: WidgetActionDescriptor): () => void;
1533
1603
  declare function unregisterWidgetAction(id: string): void;
1534
1604
  /** Actions for one target, `order`-sorted, `when`-filtered when a context is given. */
@@ -1565,6 +1635,83 @@ declare function registerLegendAction(desc: LegendActionDescriptor): () => void;
1565
1635
  declare function unregisterLegendAction(id: string): void;
1566
1636
  /** Every registered legend action, `order`-sorted (registration order breaks ties). */
1567
1637
  declare function legendActions(): LegendActionDescriptor[];
1638
+ /**
1639
+ * The surface a `scope: 'cell'` persistence handler works against — bound to ONE cell
1640
+ * (never the active one by proxy), because serialize/restore run per cell, including
1641
+ * cells that are not active. `addIndicator`/`addNativeIndicator` target THIS cell and
1642
+ * are ALWAYS muted — unlike their {@link WidgetContext} namesakes they never enter the
1643
+ * undo timeline, even from an async `restore` continuation (fetch, then add): applying
1644
+ * a document is state application, not a user edit.
1645
+ */
1646
+ interface CellStateContext {
1647
+ /** The cell's durable identity (`'c1'`, a declared name). */
1648
+ cellId: string;
1649
+ /** The cell's LIVE chart. */
1650
+ chart: Vela;
1651
+ /** Add a script indicator to THIS cell through the shell (see {@link WidgetContext.addIndicator}). */
1652
+ addIndicator(entry: ExternalIndicatorEntry): void;
1653
+ /** Add a native indicator to THIS cell through the shell. */
1654
+ addNativeIndicator(type: string): void;
1655
+ }
1656
+ /**
1657
+ * A third-party STATE PERSISTENCE handler — how a plugin puts its own state into the
1658
+ * shell's persisted document (the `ext` bag of `WorkspaceState` / per-chart state)
1659
+ * instead of running a parallel store. `key` is namespaced (`'vendor.feature'`) and
1660
+ * flat — one entry per handler. `serialize` runs on every shell snapshot (`getState`,
1661
+ * the persist write) and returns a JSON-serializable payload, or `undefined` for "no
1662
+ * entry". `restore` runs when a document carrying the key is applied (boot restore,
1663
+ * `applyState`) — AFTER the core state (chart alive, engines registered, indicator
1664
+ * ledger converged) and, for cell scope, inside the cell's history-mute, so nothing it
1665
+ * does enters undo/redo. The payload is UNTRUSTED (the codec passes `ext` through
1666
+ * opaquely): validate it. `restore` is only called for keys present in the document.
1667
+ *
1668
+ * Register at import time, before shells are constructed — the rule every contribution
1669
+ * registry shares. A key with no registered handler still round-trips verbatim, so a
1670
+ * session without the plugin never loses its state.
1671
+ */
1672
+ type StatePersistenceHandler = {
1673
+ /** Namespaced entry key (`'velapro.indicators'`) — re-registering a key replaces it. */
1674
+ key: string;
1675
+ /** Where the entry lives: per chart (`charts[i].ext`) — follows the cell through pool/layout moves. */
1676
+ scope: 'cell';
1677
+ serialize(ctx: CellStateContext): unknown;
1678
+ restore(payload: unknown, ctx: CellStateContext): void;
1679
+ } | {
1680
+ key: string;
1681
+ /** Document root (`state.ext`) — one entry per document, whatever the grid. */
1682
+ scope: 'global';
1683
+ serialize(ctx: WidgetContext): unknown;
1684
+ restore(payload: unknown, ctx: WidgetContext): void;
1685
+ };
1686
+ /** Register (or replace) a state-persistence handler. Returns an unregister disposer. */
1687
+ declare function registerStatePersistence(handler: StatePersistenceHandler): () => void;
1688
+ declare function unregisterStatePersistence(key: string): void;
1689
+ /** The registered handlers of one scope (registration order). */
1690
+ declare function statePersistenceHandlers<S extends StatePersistenceHandler['scope']>(scope: S): Array<Extract<StatePersistenceHandler, {
1691
+ scope: S;
1692
+ }>>;
1693
+ /**
1694
+ * Reorder the symbol picker's AGGREGATED pool — every source combined, exactly what
1695
+ * the search dialog displays. Called when the pool changes (a provider's index lands
1696
+ * or refreshes), NOT per keystroke: the picker caches the result. May be async (a
1697
+ * server-fetched top list) — the picker shows the current order and refreshes when
1698
+ * the promise resolves.
1699
+ *
1700
+ * The returned list may INJECT descriptors absent from the pool (they must carry
1701
+ * their `provider` and be genuinely servable, or selecting them parks the load) and
1702
+ * may OMIT entries (hiding them). The picker dedupes by venue+ticker, FIRST
1703
+ * occurrence winning — injecting at the head fixes both position and display data.
1704
+ *
1705
+ * While a ranking is registered, the picker's built-in empty-query pin (the hardcoded
1706
+ * majors) stands down: the head of YOUR list is the dialog's opening screen. Under a
1707
+ * typed query the relevance tiers still lead — the ranking orders within each tier.
1708
+ */
1709
+ type SymbolRankingHook = (pool: SymbolDescriptor[]) => SymbolDescriptor[] | Promise<SymbolDescriptor[]>;
1710
+ /** Register (or replace — ONE ranking at a time, last wins) the symbol ranking.
1711
+ * Returns an unregister disposer. Register at import time, like every contribution. */
1712
+ declare function registerSymbolRanking(hook: SymbolRankingHook): () => void;
1713
+ /** The registered ranking, if any — what the shells' symbol picker consults. */
1714
+ declare function symbolRanking(): SymbolRankingHook | undefined;
1568
1715
  /** Makes ONE engine instance for ONE chart — engines hold per-chart sessions (and
1569
1716
  * possibly a worker), so the shell calls the factory per chart build, never shares. */
1570
1717
  type EngineFactory = () => ScriptingEngine;
@@ -1582,4 +1729,4 @@ declare function unregisterDefaultEngine(language: string): void;
1582
1729
  * language. The shell layers (widget, workspace cell) register exactly this result. */
1583
1730
  declare function resolveEngines(overrides?: Record<string, EngineFactory>): Record<string, EngineFactory>;
1584
1731
 
1585
- export { nativeIndicatorDescriptors as $, type SidePanelHandle as A, type BarsChangeReason as B, type ContextSelect as C, type DrawingsDocument as D, type EngineAlert as E, type FetchSeries as F, type SidePanelHeader as G, type StrategyFill as H, type IndicatorHandle as I, type StrategyState as J, type StrategyTrade as K, type LegendActionDescriptor as L, type VelaDeps as M, type NativeIndicator as N, type VelaEventMap as O, type ParsedSymbol as P, type VisibleBarRange as Q, type Resolved as R, type ScriptingEngine as S, TypedEventBus as T, type WidgetActionDescriptor as U, Vela as V, type WidgetContext as W, type WidgetActionTarget as X, type WidgetAttachment as Y, getNativeIndicator as Z, legendActions as _, type ScriptRun as a, nativeIndicatorTypes as a0, registerDefaultEngine as a1, registerLegendAction as a2, registerNativeIndicator as a3, registerSidePanel as a4, registerWidgetAction as a5, registerWidgetAttachment as a6, resolveEngines as a7, sidePanels as a8, unregisterDefaultEngine as a9, unregisterLegendAction as aa, unregisterNativeIndicator as ab, unregisterSidePanel as ac, unregisterWidgetAction as ad, unregisterWidgetAttachment as ae, widgetActions as af, widgetAttachments as ag, DEFAULT_PANEL_ORDER as ah, DataControl as b, DrawingsControl as c, type EngineCapabilities as d, type EngineContextSnapshot as e, type EngineFactory as f, type EngineWarning as g, type ExecutionHandlers as h, type ExecutionMarket as i, type ExecutionRequest as j, type ExecutionSession as k, type IndicatorEventMap as l, type IndicatorSummary as m, type LegendIndicatorInfo as n, type NativeIndicatorContext as o, type NativeIndicatorDescriptor as p, type NativeIndicatorInfo as q, type NativeIndicatorOutput as r, type PreparedScript as s, RendererControl as t, type RunIndicatorResult as u, type SceneInspection as v, type ScriptRunCause as w, type ScriptRunResult as x, type SidePanelButton as y, type SidePanelDescriptor as z };
1732
+ export { type WidgetActionDescriptor as $, type SidePanelButton as A, type BarsChangeReason as B, type CellStateContext as C, type DrawingsDocument as D, type ExternalIndicatorEntry as E, type FetchSeries as F, type SidePanelDescriptor as G, type SidePanelHandle as H, type IndicatorHandle as I, type SidePanelHeader as J, type StatePersistenceHandler as K, type LegendActionDescriptor as L, type StrategyFill as M, type NativeIndicator as N, OVERRIDABLE_TOPBAR_IDS as O, type ParsedSymbol as P, type StrategyState as Q, type Resolved as R, type ScriptingEngine as S, type StrategyTrade as T, type SymbolRankingHook as U, Vela as V, type WidgetContext as W, TypedEventBus as X, type VelaDeps as Y, type VelaEventMap as Z, type VisibleBarRange as _, type ScriptRun as a, type WidgetActionTarget as a0, type WidgetAttachment as a1, getNativeIndicator as a2, legendActions as a3, nativeIndicatorDescriptors as a4, nativeIndicatorTypes as a5, registerDefaultEngine as a6, registerLegendAction as a7, registerNativeIndicator as a8, registerSidePanel as a9, registerStatePersistence as aa, registerSymbolRanking as ab, registerWidgetAction as ac, registerWidgetAttachment as ad, resolveEngines as ae, sidePanels as af, statePersistenceHandlers as ag, symbolRanking as ah, topbarActionOverride as ai, unregisterDefaultEngine as aj, unregisterLegendAction as ak, unregisterNativeIndicator as al, unregisterSidePanel as am, unregisterStatePersistence as an, unregisterWidgetAction as ao, unregisterWidgetAttachment as ap, widgetActions as aq, widgetAttachments as ar, DEFAULT_PANEL_ORDER as as, type ContextSelect as b, DataControl as c, DrawingsControl as d, type EngineAlert as e, type EngineCapabilities as f, type EngineContextSnapshot as g, type EngineFactory as h, type EngineWarning as i, type ExecutionHandlers as j, type ExecutionMarket as k, type ExecutionRequest as l, type ExecutionSession as m, type IndicatorEventMap as n, type IndicatorSummary as o, type LegendIndicatorInfo as p, type NativeIndicatorContext as q, type NativeIndicatorDescriptor as r, type NativeIndicatorInfo as s, type NativeIndicatorOutput as t, type PreparedScript as u, RendererControl as v, type RunIndicatorResult as w, type SceneInspection as x, type ScriptRunCause as y, type ScriptRunResult as z };