@sisense/sdk-ai-core 0.10.1 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/dist/engines/build-chart/build-chart-engine.d.ts +2 -12
  2. package/dist/engines/build-chart/build-chart-engine.d.ts.map +1 -1
  3. package/dist/engines/build-chart/create-chart/assemble-chart-widget.d.ts +31 -0
  4. package/dist/engines/build-chart/create-chart/assemble-chart-widget.d.ts.map +1 -0
  5. package/dist/engines/build-chart/create-chart/chart-json-axes-mapping.d.ts +27 -0
  6. package/dist/engines/build-chart/create-chart/chart-json-axes-mapping.d.ts.map +1 -0
  7. package/dist/engines/build-chart/create-chart/create-chart.d.ts +4 -21
  8. package/dist/engines/build-chart/create-chart/create-chart.d.ts.map +1 -1
  9. package/dist/engines/build-chart/create-chart/generate-chart-recommendations.d.ts +8 -4
  10. package/dist/engines/build-chart/create-chart/generate-chart-recommendations.d.ts.map +1 -1
  11. package/dist/engines/build-chart/create-chart/generate-chart.d.ts +18 -0
  12. package/dist/engines/build-chart/create-chart/generate-chart.d.ts.map +1 -0
  13. package/dist/engines/build-chart/create-chart/get-columns-json.d.ts +15 -0
  14. package/dist/engines/build-chart/create-chart/get-columns-json.d.ts.map +1 -0
  15. package/dist/engines/build-chart/create-chart/rebind-chart-to-query.d.ts +11 -0
  16. package/dist/engines/build-chart/create-chart/rebind-chart-to-query.d.ts.map +1 -0
  17. package/dist/engines/build-chart/create-chart/resolve-chart-query.d.ts +11 -0
  18. package/dist/engines/build-chart/create-chart/resolve-chart-query.d.ts.map +1 -0
  19. package/dist/engines/build-chart/shared/chart-column-utils.d.ts +7 -0
  20. package/dist/engines/build-chart/shared/chart-column-utils.d.ts.map +1 -0
  21. package/dist/engines/build-chart/shared/csdk-data-options-for-llm.d.ts +14 -0
  22. package/dist/engines/build-chart/shared/csdk-data-options-for-llm.d.ts.map +1 -0
  23. package/dist/engines/build-chart/shared/finalize-chart-widget-save.d.ts +8 -0
  24. package/dist/engines/build-chart/shared/finalize-chart-widget-save.d.ts.map +1 -0
  25. package/dist/engines/build-chart/shared/normalize-cartesian-axes-mapping.d.ts +8 -0
  26. package/dist/engines/build-chart/shared/normalize-cartesian-axes-mapping.d.ts.map +1 -0
  27. package/dist/engines/build-chart/shared/sync-chart-state-measure-flags.d.ts +22 -0
  28. package/dist/engines/build-chart/shared/sync-chart-state-measure-flags.d.ts.map +1 -0
  29. package/dist/engines/build-chart/types.d.ts +388 -511
  30. package/dist/engines/build-chart/types.d.ts.map +1 -1
  31. package/dist/engines/build-chart/update-chart/chart-options-schemas.d.ts +1608 -8812
  32. package/dist/engines/build-chart/update-chart/chart-options-schemas.d.ts.map +1 -1
  33. package/dist/engines/build-chart/update-chart/schemas.d.ts +68 -977
  34. package/dist/engines/build-chart/update-chart/schemas.d.ts.map +1 -1
  35. package/dist/engines/build-chart/update-chart/update-chart-data-options.d.ts +1 -1
  36. package/dist/engines/build-chart/update-chart/update-chart-data-options.d.ts.map +1 -1
  37. package/dist/engines/build-chart/update-chart/update-chart-query.d.ts +1 -1
  38. package/dist/engines/build-chart/update-chart/update-chart-query.d.ts.map +1 -1
  39. package/dist/engines/build-chart/update-chart/update-chart-style-options.d.ts +1 -1
  40. package/dist/engines/build-chart/update-chart/update-chart-style-options.d.ts.map +1 -1
  41. package/dist/engines/build-chart/update-chart/update-chart-title.d.ts +1 -1
  42. package/dist/engines/build-chart/update-chart/update-chart-title.d.ts.map +1 -1
  43. package/dist/engines/build-chart/update-chart/update-chart-type.d.ts +1 -1
  44. package/dist/engines/build-chart/update-chart/update-chart-type.d.ts.map +1 -1
  45. package/dist/engines/build-csv-model/build-csv-model-engine.d.ts +1 -1
  46. package/dist/engines/build-csv-model/build-csv-model-engine.d.ts.map +1 -1
  47. package/dist/engines/build-csv-model/rest-build.d.ts +26 -0
  48. package/dist/engines/build-csv-model/rest-build.d.ts.map +1 -1
  49. package/dist/engines/build-csv-model/types.d.ts +9 -71
  50. package/dist/engines/build-csv-model/types.d.ts.map +1 -1
  51. package/dist/engines/build-dashboard/build-dashboard-engine.d.ts +2 -10
  52. package/dist/engines/build-dashboard/build-dashboard-engine.d.ts.map +1 -1
  53. package/dist/engines/build-dashboard/build-dashboard-service.d.ts +3 -3
  54. package/dist/engines/build-dashboard/build-dashboard-service.d.ts.map +1 -1
  55. package/dist/engines/build-dashboard/dashboard-filters/manipulate-dashboard-filters.d.ts +2 -2
  56. package/dist/engines/build-dashboard/dashboard-filters/manipulate-dashboard-filters.d.ts.map +1 -1
  57. package/dist/engines/build-dashboard/index.d.ts +1 -1
  58. package/dist/engines/build-dashboard/index.d.ts.map +1 -1
  59. package/dist/engines/build-dashboard/types.d.ts +74 -123
  60. package/dist/engines/build-dashboard/types.d.ts.map +1 -1
  61. package/dist/engines/build-data-model/build-data-model-engine.d.ts +1 -1
  62. package/dist/engines/build-data-model/build-data-model-engine.d.ts.map +1 -1
  63. package/dist/engines/build-data-model/types.d.ts +59 -316
  64. package/dist/engines/build-data-model/types.d.ts.map +1 -1
  65. package/dist/engines/build-query/build-query-engine.d.ts +1 -1
  66. package/dist/engines/build-query/build-query-engine.d.ts.map +1 -1
  67. package/dist/engines/build-query/types.d.ts +2 -10
  68. package/dist/engines/build-query/types.d.ts.map +1 -1
  69. package/dist/engines/get-dashboards/get-dashboards-engine.d.ts +1 -1
  70. package/dist/engines/get-dashboards/get-dashboards-engine.d.ts.map +1 -1
  71. package/dist/engines/get-dashboards/types.d.ts +2 -2
  72. package/dist/engines/get-dashboards/types.d.ts.map +1 -1
  73. package/dist/engines/get-data-source-fields/get-data-source-fields-engine.d.ts +5 -4
  74. package/dist/engines/get-data-source-fields/get-data-source-fields-engine.d.ts.map +1 -1
  75. package/dist/engines/get-data-source-fields/types.d.ts +7 -9
  76. package/dist/engines/get-data-source-fields/types.d.ts.map +1 -1
  77. package/dist/engines/get-data-sources/get-data-sources-engine.d.ts +1 -1
  78. package/dist/engines/get-data-sources/get-data-sources-engine.d.ts.map +1 -1
  79. package/dist/engines/get-data-sources/types.d.ts +2 -2
  80. package/dist/engines/get-data-sources/types.d.ts.map +1 -1
  81. package/dist/engines/index.d.ts +1 -1
  82. package/dist/engines/index.d.ts.map +1 -1
  83. package/dist/engines/manage-perspectives/manage-perspectives-engine.d.ts +1 -1
  84. package/dist/engines/manage-perspectives/manage-perspectives-engine.d.ts.map +1 -1
  85. package/dist/engines/manage-perspectives/types.d.ts +77 -199
  86. package/dist/engines/manage-perspectives/types.d.ts.map +1 -1
  87. package/dist/engines/recommend-queries/recommend-queries-engine.d.ts +1 -1
  88. package/dist/engines/recommend-queries/recommend-queries-engine.d.ts.map +1 -1
  89. package/dist/engines/recommend-queries/types.d.ts +5 -17
  90. package/dist/engines/recommend-queries/types.d.ts.map +1 -1
  91. package/dist/index.d.ts +6 -3
  92. package/dist/index.d.ts.map +1 -1
  93. package/dist/index.js +27903 -8724
  94. package/dist/index.js.map +1 -1
  95. package/dist/services/dashboards/dashboards-service.d.ts.map +1 -1
  96. package/dist/services/dashboards/fusion-dashboards-service.d.ts.map +1 -1
  97. package/dist/services/data-models/ecm-service.d.ts +14 -0
  98. package/dist/services/data-models/ecm-service.d.ts.map +1 -1
  99. package/dist/services/data-sources/data-sources-service.d.ts.map +1 -1
  100. package/dist/services/llm/llm-models-service.d.ts +15 -0
  101. package/dist/services/llm/llm-models-service.d.ts.map +1 -0
  102. package/dist/services/nlq/nlq-service.d.ts +3 -14
  103. package/dist/services/nlq/nlq-service.d.ts.map +1 -1
  104. package/dist/singleton-clients.d.ts +4 -22
  105. package/dist/singleton-clients.d.ts.map +1 -1
  106. package/dist/utils/abort-signal.d.ts +3 -0
  107. package/dist/utils/abort-signal.d.ts.map +1 -0
  108. package/dist/utils/create-custom-fetch.d.ts +2 -3
  109. package/dist/utils/create-custom-fetch.d.ts.map +1 -1
  110. package/dist/utils/create-serialized-tool-group.d.ts +24 -0
  111. package/dist/utils/create-serialized-tool-group.d.ts.map +1 -0
  112. package/dist/utils/create-stream-completion.d.ts +69 -0
  113. package/dist/utils/create-stream-completion.d.ts.map +1 -0
  114. package/dist/utils/create-structured-completion.d.ts +18 -0
  115. package/dist/utils/create-structured-completion.d.ts.map +1 -0
  116. package/dist/utils/create-tools-completion.d.ts +28 -0
  117. package/dist/utils/create-tools-completion.d.ts.map +1 -0
  118. package/dist/utils/llm-client.d.ts +8 -0
  119. package/dist/utils/llm-client.d.ts.map +1 -0
  120. package/dist/utils/llm-provider-options.d.ts +14 -0
  121. package/dist/utils/llm-provider-options.d.ts.map +1 -0
  122. package/dist/utils/zod-utils.d.ts +23 -17
  123. package/dist/utils/zod-utils.d.ts.map +1 -1
  124. package/package.json +19 -18
  125. package/dist/engines/build-chart/create-chart/generate-chart-table.d.ts +0 -28
  126. package/dist/engines/build-chart/create-chart/generate-chart-table.d.ts.map +0 -1
  127. package/dist/engines/build-dashboard/create-chart-widget.d.ts +0 -5
  128. package/dist/engines/build-dashboard/create-chart-widget.d.ts.map +0 -1
  129. package/dist/engines/build-dashboard/update-chart-widget.d.ts +0 -5
  130. package/dist/engines/build-dashboard/update-chart-widget.d.ts.map +0 -1
  131. package/dist/services/globals/globals-service.d.ts +0 -2
  132. package/dist/services/globals/globals-service.d.ts.map +0 -1
  133. package/dist/utils/chat-completion-utils.d.ts +0 -55
  134. package/dist/utils/chat-completion-utils.d.ts.map +0 -1
  135. package/dist/utils/openai-client.d.ts +0 -11
  136. package/dist/utils/openai-client.d.ts.map +0 -1
@@ -1,21 +1,16 @@
1
- import { CalculatedMeasureColumn, MeasureColumn } from '@sisense/sdk-data';
2
- import { ChartType, ChartWidgetProps, StyledColumn, StyledMeasureColumn, WithCommonWidgetProps } from '@sisense/sdk-ui';
1
+ import { ChartType, ChartWidgetProps, WithCommonWidgetProps } from '@sisense/sdk-ui';
3
2
  import { HttpClient } from '@sisense/sdk-rest-client';
4
- import { default as OpenAI } from 'openai';
5
- import { z } from 'zod';
3
+ import { z } from 'zod/v4';
6
4
  import { QueryResult } from '../build-query/types';
7
5
  import { ChartState, Dataset, QueryState } from '../../services/nlq/nlq-service';
6
+ import { LanguageModel } from 'ai';
8
7
  export type ArtifactReference = {
9
8
  artifactId?: string;
10
9
  };
11
10
  export type ExtendedChartWidgetProps = WithCommonWidgetProps<ChartWidgetProps, 'chart'> & ArtifactReference & {
12
- /**
13
- * data columns used to generate chart recommendations
14
- */
15
- dataColumns?: ColumnType[];
16
11
  /** Query state used to generate this chart — needed to revise query structure incrementally */
17
12
  queryState?: QueryState;
18
- /** Sample / tabular payload from NLQ when available (same source as standalone buildQuery). */
13
+ /** Sample / tabular payload from the query execution. */
19
14
  dataset?: Dataset;
20
15
  /** Optional CSDK chart JSON when a caller persists it alongside NLQ state (distinct from REST `chartState` / {@link QueryState}). */
21
16
  chartState?: ChartState;
@@ -40,8 +35,6 @@ export interface ChartSummary {
40
35
  dataSourceTitle: string;
41
36
  /** Compact CSDK chart configuration (chartType, dataOptions, filters, styleOptions) */
42
37
  chartState?: BaseChartSummary;
43
- /** NLQ state for incremental structural revisions via updateChartQuery */
44
- queryState?: QueryState;
45
38
  /** Whether this chart creation resulted in an error */
46
39
  isError?: boolean;
47
40
  /** Dataset rows/sample from NLQ when present on the saved chart widget; surfaced on {@link ChartSummary} when `naturalResponseEnabled` */
@@ -55,565 +48,448 @@ export type ChartContextPromptEntry = ChartSummary | {
55
48
  chartId: string;
56
49
  chartState: BaseChartSummary;
57
50
  };
58
- export type ColumnType = StyledColumn | StyledMeasureColumn | Column | MeasureColumn | CalculatedMeasureColumn;
59
- export interface Column {
51
+ /**
52
+ * Normalized styled-column shape used throughout the chart pipeline.
53
+ * `queryState` elements are normalized to this form before use (see `getColumnsJSON`).
54
+ * `dataOptions` items are already in this form after `translateChartFromJSON`.
55
+ * The `column` value is opaque — never inspected by chart manipulation code.
56
+ */
57
+ export type ColumnJSON = {
58
+ column: unknown;
59
+ [key: string]: unknown;
60
+ };
61
+ export interface ColumnSummary {
60
62
  id?: number;
61
63
  name: string;
62
64
  type?: string;
63
65
  }
64
- export declare const chartType: z.ZodEnum<["bar", "column", "area", "line", "polar", "pie", "funnel", "treemap", "sunburst", "scatter", "table", "indicator", "boxplot", "areamap", "scattermap", "arearange"]>;
65
- export declare const axesMapping: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
66
- type: z.ZodEnum<["bar", "column", "area", "line", "polar"]>;
67
- category: z.ZodArray<z.ZodNumber, "many">;
68
- value: z.ZodArray<z.ZodNumber, "many">;
69
- breakBy: z.ZodArray<z.ZodNumber, "many">;
70
- }, "strict", z.ZodTypeAny, {
71
- value: number[];
72
- type: "area" | "column" | "line" | "bar" | "polar";
73
- category: number[];
74
- breakBy: number[];
75
- }, {
76
- value: number[];
77
- type: "area" | "column" | "line" | "bar" | "polar";
78
- category: number[];
79
- breakBy: number[];
80
- }>, z.ZodObject<{
81
- type: z.ZodEnum<["pie", "funnel", "treemap", "sunburst"]>;
82
- category: z.ZodArray<z.ZodNumber, "many">;
83
- value: z.ZodArray<z.ZodNumber, "many">;
84
- }, "strict", z.ZodTypeAny, {
85
- value: number[];
86
- type: "pie" | "funnel" | "treemap" | "sunburst";
87
- category: number[];
88
- }, {
89
- value: number[];
90
- type: "pie" | "funnel" | "treemap" | "sunburst";
91
- category: number[];
92
- }>, z.ZodObject<{
66
+ export declare const chartType: z.ZodEnum<{
67
+ area: "area";
68
+ table: "table";
69
+ indicator: "indicator";
70
+ column: "column";
71
+ line: "line";
72
+ pie: "pie";
73
+ bar: "bar";
74
+ polar: "polar";
75
+ funnel: "funnel";
76
+ treemap: "treemap";
77
+ sunburst: "sunburst";
78
+ scatter: "scatter";
79
+ areamap: "areamap";
80
+ boxplot: "boxplot";
81
+ scattermap: "scattermap";
82
+ arearange: "arearange";
83
+ }>;
84
+ export declare const axesMappingSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
85
+ type: z.ZodEnum<{
86
+ area: "area";
87
+ column: "column";
88
+ line: "line";
89
+ bar: "bar";
90
+ polar: "polar";
91
+ }>;
92
+ category: z.ZodArray<z.ZodNumber>;
93
+ value: z.ZodArray<z.ZodNumber>;
94
+ breakBy: z.ZodArray<z.ZodNumber>;
95
+ }, z.core.$strict>, z.ZodObject<{
96
+ type: z.ZodEnum<{
97
+ pie: "pie";
98
+ funnel: "funnel";
99
+ treemap: "treemap";
100
+ sunburst: "sunburst";
101
+ }>;
102
+ category: z.ZodArray<z.ZodNumber>;
103
+ value: z.ZodArray<z.ZodNumber>;
104
+ }, z.core.$strict>, z.ZodObject<{
93
105
  type: z.ZodLiteral<"scatter">;
94
- x: z.ZodArray<z.ZodNumber, "many">;
95
- y: z.ZodArray<z.ZodNumber, "many">;
96
- breakByPoint: z.ZodArray<z.ZodNumber, "many">;
97
- breakByColor: z.ZodArray<z.ZodNumber, "many">;
98
- size: z.ZodArray<z.ZodNumber, "many">;
99
- }, "strict", z.ZodTypeAny, {
100
- type: "scatter";
101
- x: number[];
102
- y: number[];
103
- breakByPoint: number[];
104
- breakByColor: number[];
105
- size: number[];
106
- }, {
107
- type: "scatter";
108
- x: number[];
109
- y: number[];
110
- breakByPoint: number[];
111
- breakByColor: number[];
112
- size: number[];
113
- }>, z.ZodObject<{
106
+ x: z.ZodArray<z.ZodNumber>;
107
+ y: z.ZodArray<z.ZodNumber>;
108
+ breakByPoint: z.ZodArray<z.ZodNumber>;
109
+ breakByColor: z.ZodArray<z.ZodNumber>;
110
+ size: z.ZodArray<z.ZodNumber>;
111
+ }, z.core.$strict>, z.ZodObject<{
114
112
  type: z.ZodLiteral<"table">;
115
- columns: z.ZodArray<z.ZodNumber, "many">;
116
- pagination: z.ZodBoolean;
117
- rowsPerPage: z.ZodNumber;
118
- }, "strict", z.ZodTypeAny, {
119
- type: "table";
120
- columns: number[];
121
- pagination: boolean;
122
- rowsPerPage: number;
123
- }, {
124
- type: "table";
125
- columns: number[];
126
- pagination: boolean;
127
- rowsPerPage: number;
128
- }>, z.ZodObject<{
113
+ columns: z.ZodArray<z.ZodNumber>;
114
+ }, z.core.$strict>, z.ZodObject<{
129
115
  type: z.ZodLiteral<"range">;
130
- category: z.ZodArray<z.ZodNumber, "many">;
131
- value: z.ZodArray<z.ZodNumber, "many">;
132
- breakBy: z.ZodArray<z.ZodNumber, "many">;
133
- }, "strict", z.ZodTypeAny, {
134
- value: number[];
135
- type: "range";
136
- category: number[];
137
- breakBy: number[];
138
- }, {
139
- value: number[];
140
- type: "range";
141
- category: number[];
142
- breakBy: number[];
143
- }>, z.ZodObject<{
116
+ category: z.ZodArray<z.ZodNumber>;
117
+ value: z.ZodArray<z.ZodNumber>;
118
+ breakBy: z.ZodArray<z.ZodNumber>;
119
+ }, z.core.$strict>, z.ZodObject<{
144
120
  type: z.ZodLiteral<"indicator">;
145
- value: z.ZodArray<z.ZodNumber, "many">;
146
- secondary: z.ZodArray<z.ZodNumber, "many">;
147
- min: z.ZodArray<z.ZodNumber, "many">;
148
- max: z.ZodArray<z.ZodNumber, "many">;
149
- }, "strict", z.ZodTypeAny, {
150
- value: number[];
151
- type: "indicator";
152
- secondary: number[];
153
- min: number[];
154
- max: number[];
155
- }, {
156
- value: number[];
157
- type: "indicator";
158
- secondary: number[];
159
- min: number[];
160
- max: number[];
161
- }>, z.ZodObject<{
121
+ value: z.ZodArray<z.ZodNumber>;
122
+ secondary: z.ZodArray<z.ZodNumber>;
123
+ min: z.ZodArray<z.ZodNumber>;
124
+ max: z.ZodArray<z.ZodNumber>;
125
+ }, z.core.$strict>, z.ZodObject<{
162
126
  type: z.ZodLiteral<"boxplot">;
163
- category: z.ZodArray<z.ZodNumber, "many">;
164
- value: z.ZodArray<z.ZodNumber, "many">;
165
- boxType: z.ZodEnum<["iqr", "extremums", "standardDeviation"]>;
127
+ category: z.ZodArray<z.ZodNumber>;
128
+ value: z.ZodArray<z.ZodNumber>;
129
+ boxType: z.ZodEnum<{
130
+ iqr: "iqr";
131
+ extremums: "extremums";
132
+ standardDeviation: "standardDeviation";
133
+ }>;
166
134
  outliersEnabled: z.ZodBoolean;
167
- }, "strict", z.ZodTypeAny, {
168
- value: number[];
169
- type: "boxplot";
170
- category: number[];
171
- boxType: "iqr" | "extremums" | "standardDeviation";
172
- outliersEnabled: boolean;
173
- }, {
174
- value: number[];
175
- type: "boxplot";
176
- category: number[];
177
- boxType: "iqr" | "extremums" | "standardDeviation";
178
- outliersEnabled: boolean;
179
- }>, z.ZodObject<{
135
+ }, z.core.$strict>, z.ZodObject<{
180
136
  type: z.ZodLiteral<"areamap">;
181
- geo: z.ZodArray<z.ZodNumber, "many">;
182
- color: z.ZodArray<z.ZodNumber, "many">;
183
- }, "strict", z.ZodTypeAny, {
184
- type: "areamap";
185
- geo: number[];
186
- color: number[];
187
- }, {
188
- type: "areamap";
189
- geo: number[];
190
- color: number[];
191
- }>, z.ZodObject<{
137
+ geo: z.ZodArray<z.ZodNumber>;
138
+ color: z.ZodArray<z.ZodNumber>;
139
+ }, z.core.$strict>, z.ZodObject<{
192
140
  type: z.ZodLiteral<"scattermap">;
193
- geo: z.ZodArray<z.ZodNumber, "many">;
194
- size: z.ZodArray<z.ZodNumber, "many">;
195
- colorBy: z.ZodArray<z.ZodNumber, "many">;
196
- details: z.ZodArray<z.ZodNumber, "many">;
197
- locationLevel: z.ZodEnum<["auto", "country", "state", "city"]>;
198
- }, "strict", z.ZodTypeAny, {
199
- type: "scattermap";
200
- details: number[];
201
- size: number[];
202
- geo: number[];
203
- colorBy: number[];
204
- locationLevel: "auto" | "country" | "state" | "city";
205
- }, {
206
- type: "scattermap";
207
- details: number[];
208
- size: number[];
209
- geo: number[];
210
- colorBy: number[];
211
- locationLevel: "auto" | "country" | "state" | "city";
212
- }>]>;
213
- export declare const nullableChartType: z.ZodNullable<z.ZodEnum<["bar", "column", "area", "line", "polar", "pie", "funnel", "treemap", "sunburst", "scatter", "table", "indicator", "boxplot", "areamap", "scattermap", "arearange"]>>;
141
+ geo: z.ZodArray<z.ZodNumber>;
142
+ size: z.ZodArray<z.ZodNumber>;
143
+ colorBy: z.ZodArray<z.ZodNumber>;
144
+ details: z.ZodArray<z.ZodNumber>;
145
+ locationLevel: z.ZodEnum<{
146
+ auto: "auto";
147
+ country: "country";
148
+ state: "state";
149
+ city: "city";
150
+ }>;
151
+ }, z.core.$strict>]>;
152
+ export declare const nullableChartType: z.ZodNullable<z.ZodEnum<{
153
+ area: "area";
154
+ table: "table";
155
+ indicator: "indicator";
156
+ column: "column";
157
+ line: "line";
158
+ pie: "pie";
159
+ bar: "bar";
160
+ polar: "polar";
161
+ funnel: "funnel";
162
+ treemap: "treemap";
163
+ sunburst: "sunburst";
164
+ scatter: "scatter";
165
+ areamap: "areamap";
166
+ boxplot: "boxplot";
167
+ scattermap: "scattermap";
168
+ arearange: "arearange";
169
+ }>>;
214
170
  export declare const chartIdSchema: z.ZodDefault<z.ZodString>;
215
171
  export declare const queryIdSchema: z.ZodDefault<z.ZodNullable<z.ZodString>>;
216
172
  export declare const chartRecommendationsSchema: z.ZodObject<{
217
- chartType: z.ZodEnum<["bar", "column", "area", "line", "polar", "pie", "funnel", "treemap", "sunburst", "scatter", "table", "indicator", "boxplot", "areamap", "scattermap", "arearange"]>;
218
- axesMapping: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
219
- type: z.ZodEnum<["bar", "column", "area", "line", "polar"]>;
220
- category: z.ZodArray<z.ZodNumber, "many">;
221
- value: z.ZodArray<z.ZodNumber, "many">;
222
- breakBy: z.ZodArray<z.ZodNumber, "many">;
223
- }, "strict", z.ZodTypeAny, {
224
- value: number[];
225
- type: "area" | "column" | "line" | "bar" | "polar";
226
- category: number[];
227
- breakBy: number[];
228
- }, {
229
- value: number[];
230
- type: "area" | "column" | "line" | "bar" | "polar";
231
- category: number[];
232
- breakBy: number[];
233
- }>, z.ZodObject<{
234
- type: z.ZodEnum<["pie", "funnel", "treemap", "sunburst"]>;
235
- category: z.ZodArray<z.ZodNumber, "many">;
236
- value: z.ZodArray<z.ZodNumber, "many">;
237
- }, "strict", z.ZodTypeAny, {
238
- value: number[];
239
- type: "pie" | "funnel" | "treemap" | "sunburst";
240
- category: number[];
241
- }, {
242
- value: number[];
243
- type: "pie" | "funnel" | "treemap" | "sunburst";
244
- category: number[];
245
- }>, z.ZodObject<{
173
+ chartType: z.ZodEnum<{
174
+ area: "area";
175
+ table: "table";
176
+ indicator: "indicator";
177
+ column: "column";
178
+ line: "line";
179
+ pie: "pie";
180
+ bar: "bar";
181
+ polar: "polar";
182
+ funnel: "funnel";
183
+ treemap: "treemap";
184
+ sunburst: "sunburst";
185
+ scatter: "scatter";
186
+ areamap: "areamap";
187
+ boxplot: "boxplot";
188
+ scattermap: "scattermap";
189
+ arearange: "arearange";
190
+ }>;
191
+ axesMapping: z.ZodDiscriminatedUnion<[z.ZodObject<{
192
+ type: z.ZodEnum<{
193
+ area: "area";
194
+ column: "column";
195
+ line: "line";
196
+ bar: "bar";
197
+ polar: "polar";
198
+ }>;
199
+ category: z.ZodArray<z.ZodNumber>;
200
+ value: z.ZodArray<z.ZodNumber>;
201
+ breakBy: z.ZodArray<z.ZodNumber>;
202
+ }, z.core.$strict>, z.ZodObject<{
203
+ type: z.ZodEnum<{
204
+ pie: "pie";
205
+ funnel: "funnel";
206
+ treemap: "treemap";
207
+ sunburst: "sunburst";
208
+ }>;
209
+ category: z.ZodArray<z.ZodNumber>;
210
+ value: z.ZodArray<z.ZodNumber>;
211
+ }, z.core.$strict>, z.ZodObject<{
246
212
  type: z.ZodLiteral<"scatter">;
247
- x: z.ZodArray<z.ZodNumber, "many">;
248
- y: z.ZodArray<z.ZodNumber, "many">;
249
- breakByPoint: z.ZodArray<z.ZodNumber, "many">;
250
- breakByColor: z.ZodArray<z.ZodNumber, "many">;
251
- size: z.ZodArray<z.ZodNumber, "many">;
252
- }, "strict", z.ZodTypeAny, {
253
- type: "scatter";
254
- x: number[];
255
- y: number[];
256
- breakByPoint: number[];
257
- breakByColor: number[];
258
- size: number[];
259
- }, {
260
- type: "scatter";
261
- x: number[];
262
- y: number[];
263
- breakByPoint: number[];
264
- breakByColor: number[];
265
- size: number[];
266
- }>, z.ZodObject<{
213
+ x: z.ZodArray<z.ZodNumber>;
214
+ y: z.ZodArray<z.ZodNumber>;
215
+ breakByPoint: z.ZodArray<z.ZodNumber>;
216
+ breakByColor: z.ZodArray<z.ZodNumber>;
217
+ size: z.ZodArray<z.ZodNumber>;
218
+ }, z.core.$strict>, z.ZodObject<{
267
219
  type: z.ZodLiteral<"table">;
268
- columns: z.ZodArray<z.ZodNumber, "many">;
269
- pagination: z.ZodBoolean;
270
- rowsPerPage: z.ZodNumber;
271
- }, "strict", z.ZodTypeAny, {
272
- type: "table";
273
- columns: number[];
274
- pagination: boolean;
275
- rowsPerPage: number;
276
- }, {
277
- type: "table";
278
- columns: number[];
279
- pagination: boolean;
280
- rowsPerPage: number;
281
- }>, z.ZodObject<{
220
+ columns: z.ZodArray<z.ZodNumber>;
221
+ }, z.core.$strict>, z.ZodObject<{
282
222
  type: z.ZodLiteral<"range">;
283
- category: z.ZodArray<z.ZodNumber, "many">;
284
- value: z.ZodArray<z.ZodNumber, "many">;
285
- breakBy: z.ZodArray<z.ZodNumber, "many">;
286
- }, "strict", z.ZodTypeAny, {
287
- value: number[];
288
- type: "range";
289
- category: number[];
290
- breakBy: number[];
291
- }, {
292
- value: number[];
293
- type: "range";
294
- category: number[];
295
- breakBy: number[];
296
- }>, z.ZodObject<{
223
+ category: z.ZodArray<z.ZodNumber>;
224
+ value: z.ZodArray<z.ZodNumber>;
225
+ breakBy: z.ZodArray<z.ZodNumber>;
226
+ }, z.core.$strict>, z.ZodObject<{
297
227
  type: z.ZodLiteral<"indicator">;
298
- value: z.ZodArray<z.ZodNumber, "many">;
299
- secondary: z.ZodArray<z.ZodNumber, "many">;
300
- min: z.ZodArray<z.ZodNumber, "many">;
301
- max: z.ZodArray<z.ZodNumber, "many">;
302
- }, "strict", z.ZodTypeAny, {
303
- value: number[];
304
- type: "indicator";
305
- secondary: number[];
306
- min: number[];
307
- max: number[];
308
- }, {
309
- value: number[];
310
- type: "indicator";
311
- secondary: number[];
312
- min: number[];
313
- max: number[];
314
- }>, z.ZodObject<{
228
+ value: z.ZodArray<z.ZodNumber>;
229
+ secondary: z.ZodArray<z.ZodNumber>;
230
+ min: z.ZodArray<z.ZodNumber>;
231
+ max: z.ZodArray<z.ZodNumber>;
232
+ }, z.core.$strict>, z.ZodObject<{
315
233
  type: z.ZodLiteral<"boxplot">;
316
- category: z.ZodArray<z.ZodNumber, "many">;
317
- value: z.ZodArray<z.ZodNumber, "many">;
318
- boxType: z.ZodEnum<["iqr", "extremums", "standardDeviation"]>;
234
+ category: z.ZodArray<z.ZodNumber>;
235
+ value: z.ZodArray<z.ZodNumber>;
236
+ boxType: z.ZodEnum<{
237
+ iqr: "iqr";
238
+ extremums: "extremums";
239
+ standardDeviation: "standardDeviation";
240
+ }>;
319
241
  outliersEnabled: z.ZodBoolean;
320
- }, "strict", z.ZodTypeAny, {
321
- value: number[];
322
- type: "boxplot";
323
- category: number[];
324
- boxType: "iqr" | "extremums" | "standardDeviation";
325
- outliersEnabled: boolean;
326
- }, {
327
- value: number[];
328
- type: "boxplot";
329
- category: number[];
330
- boxType: "iqr" | "extremums" | "standardDeviation";
331
- outliersEnabled: boolean;
332
- }>, z.ZodObject<{
242
+ }, z.core.$strict>, z.ZodObject<{
333
243
  type: z.ZodLiteral<"areamap">;
334
- geo: z.ZodArray<z.ZodNumber, "many">;
335
- color: z.ZodArray<z.ZodNumber, "many">;
336
- }, "strict", z.ZodTypeAny, {
337
- type: "areamap";
338
- geo: number[];
339
- color: number[];
340
- }, {
341
- type: "areamap";
342
- geo: number[];
343
- color: number[];
344
- }>, z.ZodObject<{
244
+ geo: z.ZodArray<z.ZodNumber>;
245
+ color: z.ZodArray<z.ZodNumber>;
246
+ }, z.core.$strict>, z.ZodObject<{
345
247
  type: z.ZodLiteral<"scattermap">;
346
- geo: z.ZodArray<z.ZodNumber, "many">;
347
- size: z.ZodArray<z.ZodNumber, "many">;
348
- colorBy: z.ZodArray<z.ZodNumber, "many">;
349
- details: z.ZodArray<z.ZodNumber, "many">;
350
- locationLevel: z.ZodEnum<["auto", "country", "state", "city"]>;
351
- }, "strict", z.ZodTypeAny, {
352
- type: "scattermap";
353
- details: number[];
354
- size: number[];
355
- geo: number[];
356
- colorBy: number[];
357
- locationLevel: "auto" | "country" | "state" | "city";
358
- }, {
359
- type: "scattermap";
360
- details: number[];
361
- size: number[];
362
- geo: number[];
363
- colorBy: number[];
364
- locationLevel: "auto" | "country" | "state" | "city";
365
- }>]>;
366
- }, "strip", z.ZodTypeAny, {
367
- chartType: "area" | "table" | "indicator" | "column" | "line" | "pie" | "bar" | "polar" | "funnel" | "treemap" | "sunburst" | "scatter" | "areamap" | "boxplot" | "scattermap" | "arearange";
368
- axesMapping: {
369
- value: number[];
370
- type: "area" | "column" | "line" | "bar" | "polar";
371
- category: number[];
372
- breakBy: number[];
373
- } | {
374
- value: number[];
375
- type: "pie" | "funnel" | "treemap" | "sunburst";
376
- category: number[];
377
- } | {
378
- type: "scatter";
379
- x: number[];
380
- y: number[];
381
- breakByPoint: number[];
382
- breakByColor: number[];
383
- size: number[];
384
- } | {
385
- type: "table";
386
- columns: number[];
387
- pagination: boolean;
388
- rowsPerPage: number;
389
- } | {
390
- value: number[];
391
- type: "range";
392
- category: number[];
393
- breakBy: number[];
394
- } | {
395
- value: number[];
396
- type: "indicator";
397
- secondary: number[];
398
- min: number[];
399
- max: number[];
400
- } | {
401
- value: number[];
402
- type: "boxplot";
403
- category: number[];
404
- boxType: "iqr" | "extremums" | "standardDeviation";
405
- outliersEnabled: boolean;
406
- } | {
407
- type: "areamap";
408
- geo: number[];
409
- color: number[];
410
- } | {
411
- type: "scattermap";
412
- details: number[];
413
- size: number[];
414
- geo: number[];
415
- colorBy: number[];
416
- locationLevel: "auto" | "country" | "state" | "city";
417
- };
418
- }, {
419
- chartType: "area" | "table" | "indicator" | "column" | "line" | "pie" | "bar" | "polar" | "funnel" | "treemap" | "sunburst" | "scatter" | "areamap" | "boxplot" | "scattermap" | "arearange";
420
- axesMapping: {
421
- value: number[];
422
- type: "area" | "column" | "line" | "bar" | "polar";
423
- category: number[];
424
- breakBy: number[];
425
- } | {
426
- value: number[];
427
- type: "pie" | "funnel" | "treemap" | "sunburst";
428
- category: number[];
429
- } | {
430
- type: "scatter";
431
- x: number[];
432
- y: number[];
433
- breakByPoint: number[];
434
- breakByColor: number[];
435
- size: number[];
436
- } | {
437
- type: "table";
438
- columns: number[];
439
- pagination: boolean;
440
- rowsPerPage: number;
441
- } | {
442
- value: number[];
443
- type: "range";
444
- category: number[];
445
- breakBy: number[];
446
- } | {
447
- value: number[];
448
- type: "indicator";
449
- secondary: number[];
450
- min: number[];
451
- max: number[];
452
- } | {
453
- value: number[];
454
- type: "boxplot";
455
- category: number[];
456
- boxType: "iqr" | "extremums" | "standardDeviation";
457
- outliersEnabled: boolean;
458
- } | {
459
- type: "areamap";
460
- geo: number[];
461
- color: number[];
462
- } | {
463
- type: "scattermap";
464
- details: number[];
465
- size: number[];
466
- geo: number[];
467
- colorBy: number[];
468
- locationLevel: "auto" | "country" | "state" | "city";
469
- };
470
- }>;
248
+ geo: z.ZodArray<z.ZodNumber>;
249
+ size: z.ZodArray<z.ZodNumber>;
250
+ colorBy: z.ZodArray<z.ZodNumber>;
251
+ details: z.ZodArray<z.ZodNumber>;
252
+ locationLevel: z.ZodEnum<{
253
+ auto: "auto";
254
+ country: "country";
255
+ state: "state";
256
+ city: "city";
257
+ }>;
258
+ }, z.core.$strict>]>;
259
+ }, z.core.$strip>;
471
260
  /**
472
261
  * Canonical tool description for buildChart — reusable by any host (sdk-assistant, MCP server, custom integrations).
473
262
  * Hosts may append host-specific notes but should not duplicate or contradict this text.
474
263
  */
475
- export declare const buildChartToolDescription = "Creates or revises a chart from a natural language prompt.\n\nThree ways to scope the run (pass `userPrompt` unchanged in all cases):\n\n1. **New chart from scratch:** omit both `priorChartId` and `queryId` and describe the desired chart in `userPrompt`.\n2. **Revise an existing chart:** pass `priorChartId` (the chartId from a prior buildChart result, or the widget id when inside a dashboard). The chart's existing data context and style are preserved across revisions. Do not run other tools (e.g. query tool) when revising an existing chart.\n3. **Verbatim prior query:** pass `queryId` (an id from a prior data query result) to chart to reuse that query result if needed to not waste the prior query work.\n\nDo not pass both `priorChartId` and `queryId` \u2014 if both are set, `priorChartId` takes precedence.\n\nPass the user prompt exactly as received \u2014 do not transform or modify it.";
264
+ export declare const buildChartToolDescription = "Creates or revises a chart via a required structured `action` param. For new data, call buildQuery first. Load the buildChart skill via loadSkill before calling this tool \u2014 the skill documents all action types and when to use each. Hosts may append UI notes (e.g. showCanvas).";
265
+ /** JSON-Schema-safe union; run {@link parseActionWithGuards} at execution time. */
266
+ export declare const buildChartActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
267
+ type: z.ZodLiteral<"create">;
268
+ queryId: z.ZodString;
269
+ chartType: z.ZodEnum<{
270
+ area: "area";
271
+ table: "table";
272
+ indicator: "indicator";
273
+ column: "column";
274
+ line: "line";
275
+ pie: "pie";
276
+ bar: "bar";
277
+ polar: "polar";
278
+ funnel: "funnel";
279
+ treemap: "treemap";
280
+ sunburst: "sunburst";
281
+ scatter: "scatter";
282
+ areamap: "areamap";
283
+ boxplot: "boxplot";
284
+ scattermap: "scattermap";
285
+ arearange: "arearange";
286
+ }>;
287
+ title: z.ZodString;
288
+ }, z.core.$strip>, z.ZodObject<{
289
+ type: z.ZodLiteral<"update-title">;
290
+ priorChartId: z.ZodString;
291
+ title: z.ZodString;
292
+ }, z.core.$strip>, z.ZodObject<{
293
+ type: z.ZodLiteral<"update-type">;
294
+ priorChartId: z.ZodString;
295
+ chartType: z.ZodEnum<{
296
+ area: "area";
297
+ table: "table";
298
+ indicator: "indicator";
299
+ column: "column";
300
+ line: "line";
301
+ pie: "pie";
302
+ bar: "bar";
303
+ polar: "polar";
304
+ funnel: "funnel";
305
+ treemap: "treemap";
306
+ sunburst: "sunburst";
307
+ scatter: "scatter";
308
+ areamap: "areamap";
309
+ boxplot: "boxplot";
310
+ scattermap: "scattermap";
311
+ arearange: "arearange";
312
+ }>;
313
+ }, z.core.$strip>, z.ZodObject<{
314
+ type: z.ZodLiteral<"rebind-query">;
315
+ priorChartId: z.ZodString;
316
+ queryId: z.ZodString;
317
+ }, z.core.$strip>, z.ZodObject<{
318
+ type: z.ZodLiteral<"update-sorting">;
319
+ priorChartId: z.ZodString;
320
+ userPrompt: z.ZodString;
321
+ }, z.core.$strip>, z.ZodObject<{
322
+ type: z.ZodLiteral<"update-trend-forecast">;
323
+ priorChartId: z.ZodString;
324
+ userPrompt: z.ZodString;
325
+ }, z.core.$strip>, z.ZodObject<{
326
+ type: z.ZodLiteral<"update-style">;
327
+ priorChartId: z.ZodString;
328
+ userPrompt: z.ZodString;
329
+ }, z.core.$strip>, z.ZodObject<{
330
+ type: z.ZodLiteral<"update-data-options">;
331
+ priorChartId: z.ZodString;
332
+ userPrompt: z.ZodString;
333
+ }, z.core.$strip>, z.ZodObject<{
334
+ type: z.ZodLiteral<"update-measure-chart-types">;
335
+ priorChartId: z.ZodString;
336
+ userPrompt: z.ZodString;
337
+ }, z.core.$strip>]>;
338
+ export type BuildChartAction = z.infer<typeof buildChartActionSchema>;
476
339
  export declare const buildChartSchema: z.ZodObject<{
477
340
  dataSourceTitle: z.ZodString;
478
- userPrompt: z.ZodString;
479
- priorChartId: z.ZodOptional<z.ZodString>;
480
- queryId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
481
- }, "strip", z.ZodTypeAny, {
482
- dataSourceTitle: string;
483
- userPrompt: string;
484
- priorChartId?: string | undefined;
485
- queryId?: string | null | undefined;
486
- }, {
487
- dataSourceTitle: string;
488
- userPrompt: string;
489
- priorChartId?: string | undefined;
490
- queryId?: string | null | undefined;
491
- }>;
341
+ action: z.ZodDiscriminatedUnion<[z.ZodObject<{
342
+ type: z.ZodLiteral<"create">;
343
+ queryId: z.ZodString;
344
+ chartType: z.ZodEnum<{
345
+ area: "area";
346
+ table: "table";
347
+ indicator: "indicator";
348
+ column: "column";
349
+ line: "line";
350
+ pie: "pie";
351
+ bar: "bar";
352
+ polar: "polar";
353
+ funnel: "funnel";
354
+ treemap: "treemap";
355
+ sunburst: "sunburst";
356
+ scatter: "scatter";
357
+ areamap: "areamap";
358
+ boxplot: "boxplot";
359
+ scattermap: "scattermap";
360
+ arearange: "arearange";
361
+ }>;
362
+ title: z.ZodString;
363
+ }, z.core.$strip>, z.ZodObject<{
364
+ type: z.ZodLiteral<"update-title">;
365
+ priorChartId: z.ZodString;
366
+ title: z.ZodString;
367
+ }, z.core.$strip>, z.ZodObject<{
368
+ type: z.ZodLiteral<"update-type">;
369
+ priorChartId: z.ZodString;
370
+ chartType: z.ZodEnum<{
371
+ area: "area";
372
+ table: "table";
373
+ indicator: "indicator";
374
+ column: "column";
375
+ line: "line";
376
+ pie: "pie";
377
+ bar: "bar";
378
+ polar: "polar";
379
+ funnel: "funnel";
380
+ treemap: "treemap";
381
+ sunburst: "sunburst";
382
+ scatter: "scatter";
383
+ areamap: "areamap";
384
+ boxplot: "boxplot";
385
+ scattermap: "scattermap";
386
+ arearange: "arearange";
387
+ }>;
388
+ }, z.core.$strip>, z.ZodObject<{
389
+ type: z.ZodLiteral<"rebind-query">;
390
+ priorChartId: z.ZodString;
391
+ queryId: z.ZodString;
392
+ }, z.core.$strip>, z.ZodObject<{
393
+ type: z.ZodLiteral<"update-sorting">;
394
+ priorChartId: z.ZodString;
395
+ userPrompt: z.ZodString;
396
+ }, z.core.$strip>, z.ZodObject<{
397
+ type: z.ZodLiteral<"update-trend-forecast">;
398
+ priorChartId: z.ZodString;
399
+ userPrompt: z.ZodString;
400
+ }, z.core.$strip>, z.ZodObject<{
401
+ type: z.ZodLiteral<"update-style">;
402
+ priorChartId: z.ZodString;
403
+ userPrompt: z.ZodString;
404
+ }, z.core.$strip>, z.ZodObject<{
405
+ type: z.ZodLiteral<"update-data-options">;
406
+ priorChartId: z.ZodString;
407
+ userPrompt: z.ZodString;
408
+ }, z.core.$strip>, z.ZodObject<{
409
+ type: z.ZodLiteral<"update-measure-chart-types">;
410
+ priorChartId: z.ZodString;
411
+ userPrompt: z.ZodString;
412
+ }, z.core.$strip>]>;
413
+ }, z.core.$strip>;
492
414
  export declare const createChartSchema: z.ZodObject<{
493
415
  queryPrompt: z.ZodString;
494
416
  chartPrompt: z.ZodString;
495
- chartType: z.ZodNullable<z.ZodEnum<["bar", "column", "area", "line", "polar", "pie", "funnel", "treemap", "sunburst", "scatter", "table", "indicator", "boxplot", "areamap", "scattermap", "arearange"]>>;
417
+ chartType: z.ZodNullable<z.ZodEnum<{
418
+ area: "area";
419
+ table: "table";
420
+ indicator: "indicator";
421
+ column: "column";
422
+ line: "line";
423
+ pie: "pie";
424
+ bar: "bar";
425
+ polar: "polar";
426
+ funnel: "funnel";
427
+ treemap: "treemap";
428
+ sunburst: "sunburst";
429
+ scatter: "scatter";
430
+ areamap: "areamap";
431
+ boxplot: "boxplot";
432
+ scattermap: "scattermap";
433
+ arearange: "arearange";
434
+ }>>;
496
435
  chartTitle: z.ZodString;
497
436
  queryId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
498
- }, "strip", z.ZodTypeAny, {
499
- queryPrompt: string;
500
- chartType: "area" | "table" | "indicator" | "column" | "line" | "pie" | "bar" | "polar" | "funnel" | "treemap" | "sunburst" | "scatter" | "areamap" | "boxplot" | "scattermap" | "arearange" | null;
501
- queryId: string | null;
502
- chartPrompt: string;
503
- chartTitle: string;
504
- }, {
505
- queryPrompt: string;
506
- chartType: "area" | "table" | "indicator" | "column" | "line" | "pie" | "bar" | "polar" | "funnel" | "treemap" | "sunburst" | "scatter" | "areamap" | "boxplot" | "scattermap" | "arearange" | null;
507
- chartPrompt: string;
508
- chartTitle: string;
509
- queryId?: string | null | undefined;
510
- }>;
437
+ }, z.core.$strip>;
511
438
  export declare const updateChartSchema: z.ZodObject<{
512
439
  userPrompt: z.ZodString;
513
- } & {
514
440
  chartId: z.ZodDefault<z.ZodString>;
515
- }, "strip", z.ZodTypeAny, {
516
- userPrompt: string;
517
- chartId: string;
518
- }, {
519
- userPrompt: string;
520
- chartId?: string | undefined;
521
- }>;
441
+ }, z.core.$strip>;
522
442
  export declare const updateChartTitleSchema: z.ZodObject<{
523
443
  userPrompt: z.ZodString;
524
- } & {
525
444
  chartId: z.ZodDefault<z.ZodString>;
526
- } & {
527
445
  chartTitle: z.ZodString;
528
- }, "strip", z.ZodTypeAny, {
529
- userPrompt: string;
530
- chartTitle: string;
531
- chartId: string;
532
- }, {
533
- userPrompt: string;
534
- chartTitle: string;
535
- chartId?: string | undefined;
536
- }>;
446
+ }, z.core.$strip>;
537
447
  export declare const updateChartTypeSchema: z.ZodObject<{
538
448
  userPrompt: z.ZodString;
539
- } & {
540
449
  chartId: z.ZodDefault<z.ZodString>;
541
- } & {
542
- chartType: z.ZodEnum<["bar", "column", "area", "line", "polar", "pie", "funnel", "treemap", "sunburst", "scatter", "table", "indicator", "boxplot", "areamap", "scattermap", "arearange"]>;
543
- }, "strip", z.ZodTypeAny, {
544
- chartType: "area" | "table" | "indicator" | "column" | "line" | "pie" | "bar" | "polar" | "funnel" | "treemap" | "sunburst" | "scatter" | "areamap" | "boxplot" | "scattermap" | "arearange";
545
- userPrompt: string;
546
- chartId: string;
547
- }, {
548
- chartType: "area" | "table" | "indicator" | "column" | "line" | "pie" | "bar" | "polar" | "funnel" | "treemap" | "sunburst" | "scatter" | "areamap" | "boxplot" | "scattermap" | "arearange";
549
- userPrompt: string;
550
- chartId?: string | undefined;
551
- }>;
450
+ chartType: z.ZodEnum<{
451
+ area: "area";
452
+ table: "table";
453
+ indicator: "indicator";
454
+ column: "column";
455
+ line: "line";
456
+ pie: "pie";
457
+ bar: "bar";
458
+ polar: "polar";
459
+ funnel: "funnel";
460
+ treemap: "treemap";
461
+ sunburst: "sunburst";
462
+ scatter: "scatter";
463
+ areamap: "areamap";
464
+ boxplot: "boxplot";
465
+ scattermap: "scattermap";
466
+ arearange: "arearange";
467
+ }>;
468
+ }, z.core.$strip>;
552
469
  export declare const updateChartTypeOfMeasuresSchema: z.ZodObject<{
553
470
  userPrompt: z.ZodString;
554
- } & {
555
471
  chartId: z.ZodDefault<z.ZodString>;
556
- }, "strip", z.ZodTypeAny, {
557
- userPrompt: string;
558
- chartId: string;
559
- }, {
560
- userPrompt: string;
561
- chartId?: string | undefined;
562
- }>;
472
+ }, z.core.$strip>;
563
473
  export declare const updateChartSortingSchema: z.ZodObject<{
564
474
  userPrompt: z.ZodString;
565
- } & {
566
475
  chartId: z.ZodDefault<z.ZodString>;
567
- }, "strip", z.ZodTypeAny, {
568
- userPrompt: string;
569
- chartId: string;
570
- }, {
571
- userPrompt: string;
572
- chartId?: string | undefined;
573
- }>;
476
+ }, z.core.$strip>;
574
477
  export declare const updateTrendAndForecastSchema: z.ZodObject<{
575
478
  userPrompt: z.ZodString;
576
- } & {
577
479
  chartId: z.ZodDefault<z.ZodString>;
578
- }, "strip", z.ZodTypeAny, {
579
- userPrompt: string;
580
- chartId: string;
581
- }, {
582
- userPrompt: string;
583
- chartId?: string | undefined;
584
- }>;
480
+ }, z.core.$strip>;
585
481
  export declare const updateOtherChartDataOptionsSchema: z.ZodObject<{
586
482
  userPrompt: z.ZodString;
587
- } & {
588
483
  chartId: z.ZodDefault<z.ZodString>;
589
- }, "strip", z.ZodTypeAny, {
590
- userPrompt: string;
591
- chartId: string;
592
- }, {
593
- userPrompt: string;
594
- chartId?: string | undefined;
595
- }>;
484
+ }, z.core.$strip>;
596
485
  export declare const updateChartStyleOptionsSchema: z.ZodObject<{
597
486
  userPrompt: z.ZodString;
598
- } & {
599
487
  chartId: z.ZodDefault<z.ZodString>;
600
- }, "strip", z.ZodTypeAny, {
601
- userPrompt: string;
602
- chartId: string;
603
- }, {
604
- userPrompt: string;
605
- chartId?: string | undefined;
606
- }>;
488
+ }, z.core.$strip>;
607
489
  export declare const updateChartQuerySchema: z.ZodObject<{
608
490
  revisionPrompt: z.ZodString;
609
491
  chartId: z.ZodString;
610
- }, "strip", z.ZodTypeAny, {
611
- chartId: string;
612
- revisionPrompt: string;
613
- }, {
614
- chartId: string;
615
- revisionPrompt: string;
616
- }>;
492
+ }, z.core.$strip>;
617
493
  /**
618
494
  * Build chart context interface
619
495
  */
@@ -622,6 +498,7 @@ export interface BuildChartContext {
622
498
  * Tool call ID
623
499
  */
624
500
  toolCallId: string;
501
+ abortSignal?: AbortSignal;
625
502
  /**
626
503
  * Data source title (required)
627
504
  */
@@ -646,15 +523,13 @@ export interface BuildChartContext {
646
523
  * @returns The query result, or null if not found
647
524
  */
648
525
  retrieveQuery?: (queryId: string) => QueryResult | null;
649
- /** Whether NLQ V3 is enabled */
650
- isNlqV3Enabled?: boolean;
651
526
  /**
652
527
  * When false, incremental NLQ uses Layer-2 text augmentation instead of REST `chartState`.
653
528
  * Typically threaded from host config when available.
654
529
  */
655
530
  isNlqDeltaEnabled?: boolean;
656
531
  httpClient?: HttpClient;
657
- openAIClient?: OpenAI;
532
+ llmClient?: LanguageModel;
658
533
  /**
659
534
  * When true, include `dataset` on the returned {@link ChartSummary} when the saved chart
660
535
  * widget carries `dataset`.
@@ -662,5 +537,7 @@ export interface BuildChartContext {
662
537
  naturalResponseEnabled?: boolean;
663
538
  /** Common filters (e.g., from dashboard filters) to be applied to the query of the chart. */
664
539
  commonFilters?: unknown;
540
+ /** ID of a prior query result when this chart uses that query; otherwise null/undefined */
541
+ queryId?: string | null;
665
542
  }
666
543
  //# sourceMappingURL=types.d.ts.map