@lightdash/common 0.2083.0 → 0.2084.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 (109) hide show
  1. package/dist/cjs/ee/AiAgent/followUpTools.d.ts.map +1 -1
  2. package/dist/cjs/ee/AiAgent/followUpTools.js +1 -0
  3. package/dist/cjs/ee/AiAgent/followUpTools.js.map +1 -1
  4. package/dist/cjs/ee/AiAgent/index.d.ts +11 -6
  5. package/dist/cjs/ee/AiAgent/index.d.ts.map +1 -1
  6. package/dist/cjs/ee/AiAgent/index.js +3 -0
  7. package/dist/cjs/ee/AiAgent/index.js.map +1 -1
  8. package/dist/cjs/ee/AiAgent/schemas/index.d.ts +13631 -3
  9. package/dist/cjs/ee/AiAgent/schemas/index.d.ts.map +1 -1
  10. package/dist/cjs/ee/AiAgent/schemas/index.js +12 -1
  11. package/dist/cjs/ee/AiAgent/schemas/index.js.map +1 -1
  12. package/dist/cjs/ee/AiAgent/schemas/tools/index.d.ts +1 -0
  13. package/dist/cjs/ee/AiAgent/schemas/tools/index.d.ts.map +1 -1
  14. package/dist/cjs/ee/AiAgent/schemas/tools/index.js +1 -0
  15. package/dist/cjs/ee/AiAgent/schemas/tools/index.js.map +1 -1
  16. package/dist/cjs/ee/AiAgent/schemas/tools/toolRunQueryArgs.d.ts +4369 -0
  17. package/dist/cjs/ee/AiAgent/schemas/tools/toolRunQueryArgs.d.ts.map +1 -0
  18. package/dist/cjs/ee/AiAgent/schemas/tools/toolRunQueryArgs.js +137 -0
  19. package/dist/cjs/ee/AiAgent/schemas/tools/toolRunQueryArgs.js.map +1 -0
  20. package/dist/cjs/ee/AiAgent/schemas/visualizations/index.d.ts +4 -4
  21. package/dist/cjs/ee/AiAgent/schemas/visualizations/index.d.ts.map +1 -1
  22. package/dist/cjs/ee/AiAgent/schemas/visualizations/index.js +3 -0
  23. package/dist/cjs/ee/AiAgent/schemas/visualizations/index.js.map +1 -1
  24. package/dist/cjs/ee/AiAgent/types.d.ts +5 -1
  25. package/dist/cjs/ee/AiAgent/types.d.ts.map +1 -1
  26. package/dist/cjs/ee/AiAgent/types.js +1 -0
  27. package/dist/cjs/ee/AiAgent/types.js.map +1 -1
  28. package/dist/cjs/ee/AiAgent/utils/chartConfigUtils.d.ts +26 -0
  29. package/dist/cjs/ee/AiAgent/utils/chartConfigUtils.d.ts.map +1 -0
  30. package/dist/cjs/ee/AiAgent/utils/chartConfigUtils.js +425 -0
  31. package/dist/cjs/ee/AiAgent/utils/chartConfigUtils.js.map +1 -0
  32. package/dist/cjs/ee/AiAgent/utils.d.ts +115 -0
  33. package/dist/cjs/ee/AiAgent/utils.d.ts.map +1 -1
  34. package/dist/cjs/ee/AiAgent/utils.js +24 -0
  35. package/dist/cjs/ee/AiAgent/utils.js.map +1 -1
  36. package/dist/cjs/index.d.ts +1 -0
  37. package/dist/cjs/index.d.ts.map +1 -1
  38. package/dist/cjs/index.js +1 -0
  39. package/dist/cjs/index.js.map +1 -1
  40. package/dist/cjs/utils/pivotData.d.ts +13 -0
  41. package/dist/cjs/utils/pivotData.d.ts.map +1 -0
  42. package/dist/cjs/utils/pivotData.js +50 -0
  43. package/dist/cjs/utils/pivotData.js.map +1 -0
  44. package/dist/esm/ee/AiAgent/followUpTools.d.ts.map +1 -1
  45. package/dist/esm/ee/AiAgent/followUpTools.js +1 -0
  46. package/dist/esm/ee/AiAgent/followUpTools.js.map +1 -1
  47. package/dist/esm/ee/AiAgent/index.d.ts +11 -6
  48. package/dist/esm/ee/AiAgent/index.d.ts.map +1 -1
  49. package/dist/esm/ee/AiAgent/index.js +3 -0
  50. package/dist/esm/ee/AiAgent/index.js.map +1 -1
  51. package/dist/esm/ee/AiAgent/schemas/index.d.ts +13631 -3
  52. package/dist/esm/ee/AiAgent/schemas/index.d.ts.map +1 -1
  53. package/dist/esm/ee/AiAgent/schemas/index.js +12 -1
  54. package/dist/esm/ee/AiAgent/schemas/index.js.map +1 -1
  55. package/dist/esm/ee/AiAgent/schemas/tools/index.d.ts +1 -0
  56. package/dist/esm/ee/AiAgent/schemas/tools/index.d.ts.map +1 -1
  57. package/dist/esm/ee/AiAgent/schemas/tools/index.js +1 -0
  58. package/dist/esm/ee/AiAgent/schemas/tools/index.js.map +1 -1
  59. package/dist/esm/ee/AiAgent/schemas/tools/toolRunQueryArgs.d.ts +4369 -0
  60. package/dist/esm/ee/AiAgent/schemas/tools/toolRunQueryArgs.d.ts.map +1 -0
  61. package/dist/esm/ee/AiAgent/schemas/tools/toolRunQueryArgs.js +133 -0
  62. package/dist/esm/ee/AiAgent/schemas/tools/toolRunQueryArgs.js.map +1 -0
  63. package/dist/esm/ee/AiAgent/schemas/visualizations/index.d.ts +4 -4
  64. package/dist/esm/ee/AiAgent/schemas/visualizations/index.d.ts.map +1 -1
  65. package/dist/esm/ee/AiAgent/schemas/visualizations/index.js +3 -0
  66. package/dist/esm/ee/AiAgent/schemas/visualizations/index.js.map +1 -1
  67. package/dist/esm/ee/AiAgent/types.d.ts +5 -1
  68. package/dist/esm/ee/AiAgent/types.d.ts.map +1 -1
  69. package/dist/esm/ee/AiAgent/types.js +1 -0
  70. package/dist/esm/ee/AiAgent/types.js.map +1 -1
  71. package/dist/esm/ee/AiAgent/utils/chartConfigUtils.d.ts +26 -0
  72. package/dist/esm/ee/AiAgent/utils/chartConfigUtils.d.ts.map +1 -0
  73. package/dist/esm/ee/AiAgent/utils/chartConfigUtils.js +417 -0
  74. package/dist/esm/ee/AiAgent/utils/chartConfigUtils.js.map +1 -0
  75. package/dist/esm/ee/AiAgent/utils.d.ts +115 -0
  76. package/dist/esm/ee/AiAgent/utils.d.ts.map +1 -1
  77. package/dist/esm/ee/AiAgent/utils.js +25 -1
  78. package/dist/esm/ee/AiAgent/utils.js.map +1 -1
  79. package/dist/esm/index.d.ts +1 -0
  80. package/dist/esm/index.d.ts.map +1 -1
  81. package/dist/esm/index.js +1 -0
  82. package/dist/esm/index.js.map +1 -1
  83. package/dist/esm/utils/pivotData.d.ts +13 -0
  84. package/dist/esm/utils/pivotData.d.ts.map +1 -0
  85. package/dist/esm/utils/pivotData.js +46 -0
  86. package/dist/esm/utils/pivotData.js.map +1 -0
  87. package/dist/tsconfig.types.tsbuildinfo +1 -1
  88. package/dist/types/ee/AiAgent/followUpTools.d.ts.map +1 -1
  89. package/dist/types/ee/AiAgent/index.d.ts +11 -6
  90. package/dist/types/ee/AiAgent/index.d.ts.map +1 -1
  91. package/dist/types/ee/AiAgent/schemas/index.d.ts +13631 -3
  92. package/dist/types/ee/AiAgent/schemas/index.d.ts.map +1 -1
  93. package/dist/types/ee/AiAgent/schemas/tools/index.d.ts +1 -0
  94. package/dist/types/ee/AiAgent/schemas/tools/index.d.ts.map +1 -1
  95. package/dist/types/ee/AiAgent/schemas/tools/toolRunQueryArgs.d.ts +4369 -0
  96. package/dist/types/ee/AiAgent/schemas/tools/toolRunQueryArgs.d.ts.map +1 -0
  97. package/dist/types/ee/AiAgent/schemas/visualizations/index.d.ts +4 -4
  98. package/dist/types/ee/AiAgent/schemas/visualizations/index.d.ts.map +1 -1
  99. package/dist/types/ee/AiAgent/types.d.ts +5 -1
  100. package/dist/types/ee/AiAgent/types.d.ts.map +1 -1
  101. package/dist/types/ee/AiAgent/utils/chartConfigUtils.d.ts +26 -0
  102. package/dist/types/ee/AiAgent/utils/chartConfigUtils.d.ts.map +1 -0
  103. package/dist/types/ee/AiAgent/utils.d.ts +115 -0
  104. package/dist/types/ee/AiAgent/utils.d.ts.map +1 -1
  105. package/dist/types/index.d.ts +1 -0
  106. package/dist/types/index.d.ts.map +1 -1
  107. package/dist/types/utils/pivotData.d.ts +13 -0
  108. package/dist/types/utils/pivotData.d.ts.map +1 -0
  109. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolRunQueryArgs.d.ts","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolRunQueryArgs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASvC,CAAC;AAER,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,iCAAiC,CAC3C,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;EAGnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toolRunQueryOutputSchema = exports.toolRunQueryArgsSchemaTransformed = exports.toolRunQueryArgsSchema = exports.TOOL_RUN_QUERY_DESCRIPTION = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const zod_1 = require("zod");
6
+ const types_1 = require("../../types");
7
+ const customMetrics_1 = require("../customMetrics");
8
+ const fieldId_1 = require("../fieldId");
9
+ const filters_1 = require("../filters");
10
+ const outputMetadata_1 = require("../outputMetadata");
11
+ const sortField_1 = tslib_1.__importDefault(require("../sortField"));
12
+ const tableCalcs_1 = require("../tableCalcs/tableCalcs");
13
+ const toolSchemaBuilder_1 = require("../toolSchemaBuilder");
14
+ const visualizationMetadata_1 = tslib_1.__importDefault(require("../visualizationMetadata"));
15
+ // Query configuration schema - what data to fetch
16
+ const queryConfigSchema = zod_1.z.object({
17
+ exploreName: zod_1.z
18
+ .string()
19
+ .describe('The name of the explore containing the metrics and dimensions used for the chart.'),
20
+ dimensions: zod_1.z
21
+ .array((0, fieldId_1.getFieldIdSchema)({ additionalDescription: null }))
22
+ .describe('The field ids for the dimensions to group the metrics by. dimensions[0] is the primary grouping (x-axis for charts). dimensions[1+] create additional grouping levels.'),
23
+ metrics: zod_1.z
24
+ .array((0, fieldId_1.getFieldIdSchema)({ additionalDescription: null }))
25
+ .describe('The field ids of the metrics to be calculated. They will be grouped by the dimensions.'),
26
+ sorts: zod_1.z
27
+ .array(sortField_1.default)
28
+ .describe('Sort configuration for the query, it can use a combination of metrics and dimensions.'),
29
+ limit: zod_1.z
30
+ .number()
31
+ .nullable()
32
+ .describe('The total number of data points / rows allowed on the chart.'),
33
+ });
34
+ // Chart-specific configuration for rendering hints
35
+ const chartConfigSchema = zod_1.z
36
+ .object({
37
+ defaultVizType: zod_1.z
38
+ .enum([
39
+ 'table',
40
+ 'bar',
41
+ 'horizontal',
42
+ 'line',
43
+ 'scatter',
44
+ 'pie',
45
+ 'funnel',
46
+ ])
47
+ .describe('The default visualization type to render'),
48
+ // Series creation control
49
+ groupBy: zod_1.z
50
+ .array((0, fieldId_1.getFieldIdSchema)({ additionalDescription: null }))
51
+ .nullable()
52
+ .describe('Dimensions to split metrics into separate series (e.g., one line per region, one bar per status). IMPORTANT: Do NOT include the x-axis dimension in groupBy - only include dimensions you want to use for breaking down the data into multiple series. Example: dimensions=["order_date", "status"], groupBy=["status"] creates separate series for each status value. Leave null for simple single-series charts.'),
53
+ // Bar and horizontal bar chart specific
54
+ xAxisType: zod_1.z
55
+ .enum(['category', 'time'])
56
+ .nullable()
57
+ .describe('The x-axis type can be categorical for string value or time if the dimension is a date or timestamp. Applies to bar, horizontal, and scatter charts.'),
58
+ stackBars: zod_1.z
59
+ .boolean()
60
+ .nullable()
61
+ .describe('If groupBy is provided then this will stack the bars on top of each other instead of side by side. Applies to bar and horizontal charts.'),
62
+ // Line chart specific
63
+ lineType: zod_1.z
64
+ .enum(['line', 'area'])
65
+ .nullable()
66
+ .describe('default line. The type of line to display. If area then the area under the line will be filled in.'),
67
+ // Funnel chart specific
68
+ funnelDataInput: zod_1.z
69
+ .enum(['row', 'column'])
70
+ .nullable()
71
+ .describe('How to interpret funnel data. Use "row" when each row represents a funnel stage (most common). Use "column" when comparing multiple funnels side-by-side.'),
72
+ // Common display properties
73
+ xAxisLabel: zod_1.z
74
+ .string()
75
+ .nullable()
76
+ .describe('A helpful label to explain the x-axis'),
77
+ yAxisLabel: zod_1.z
78
+ .string()
79
+ .nullable()
80
+ .describe('A helpful label to explain the y-axis'),
81
+ })
82
+ .nullable();
83
+ exports.TOOL_RUN_QUERY_DESCRIPTION = `Tool: runQuery
84
+
85
+ Purpose:
86
+ Execute a metric query and create a chart artifact. The results can be viewed as a table, bar, horizontal bar, line, scatter, pie, or funnel chart.
87
+
88
+ Chart Type Selection Guide:
89
+ - 'bar': Vertical bars for categorical comparisons (e.g., sales by product)
90
+ - 'horizontal': Horizontal bars for long category names or ranking (e.g., top 10 customers)
91
+ - 'line': Time series trends (e.g., revenue over months)
92
+ - 'scatter': Correlation between two metrics (e.g., ad spend vs revenue)
93
+ - 'pie': Part-to-whole proportions (e.g., market share by segment)
94
+ - 'funnel': Sequential conversion flows (e.g., sales funnel stages)
95
+ - 'table': Raw data display with all fields
96
+
97
+ Configuration Tips:
98
+ - Specify exploreName, dimensions (for grouping/x-axis), and metrics (for y-axis values)
99
+ - First dimension is the x-axis; additional dimensions can be used for series breakdown via groupBy
100
+ - At least one metric is required for all chart types except table
101
+ - chartConfig.groupBy: Use to split data into multiple series (e.g., one line per region). Do NOT include the x-axis dimension. Only include dimensions for series breakdown. Leave null for simple single-series charts.
102
+ - For bar/horizontal charts: use xAxisType 'category' for strings or 'time' for dates/timestamps
103
+ - For bar/horizontal charts: stackBars (when groupBy is provided) stacks bars instead of placing them side by side
104
+ - For line charts: use lineType 'area' to fill the area under the line
105
+ - For scatter charts: each point represents one row of data
106
+ - For funnel charts: set funnelDataInput to 'row' (each row = stage) or 'column' (multiple funnels)
107
+ - Users can switch between visualization types in the UI after creation
108
+ - xAxisLabel and yAxisLabel provide helpful context for chart axes
109
+ `;
110
+ exports.toolRunQueryArgsSchema = (0, toolSchemaBuilder_1.createToolSchema)({
111
+ type: types_1.AiResultType.QUERY_RESULT,
112
+ description: exports.TOOL_RUN_QUERY_DESCRIPTION,
113
+ })
114
+ .extend({
115
+ ...visualizationMetadata_1.default.shape,
116
+ queryConfig: queryConfigSchema,
117
+ chartConfig: chartConfigSchema,
118
+ customMetrics: customMetrics_1.customMetricsSchema,
119
+ tableCalculations: tableCalcs_1.tableCalcsSchema,
120
+ filters: filters_1.filtersSchemaV2.nullable(),
121
+ })
122
+ .build();
123
+ exports.toolRunQueryArgsSchemaTransformed = exports.toolRunQueryArgsSchema
124
+ .extend({
125
+ customMetrics: customMetrics_1.customMetricsSchema.default(null),
126
+ tableCalculations: tableCalcs_1.tableCalcsSchema.default(null),
127
+ chartConfig: chartConfigSchema.default(null),
128
+ })
129
+ .transform((data) => ({
130
+ ...data,
131
+ filters: filters_1.filtersSchemaTransformed.parse(data.filters),
132
+ }));
133
+ exports.toolRunQueryOutputSchema = zod_1.z.object({
134
+ result: zod_1.z.string(),
135
+ metadata: outputMetadata_1.baseOutputMetadataSchema,
136
+ });
137
+ //# sourceMappingURL=toolRunQueryArgs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolRunQueryArgs.js","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolRunQueryArgs.ts"],"names":[],"mappings":";;;;AAAA,6BAAwB;AACxB,uCAA2C;AAC3C,oDAAuD;AACvD,wCAA8C;AAC9C,wCAAuE;AACvE,sDAA6D;AAC7D,q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O,CAAC,IAAI,CAAC;CAC/C,CAAC;KACD,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAClB,GAAG,IAAI;IACP,OAAO,EAAE,kCAAwB,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;CACxD,CAAC,CAAC,CAAC;AAMK,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,yCAAwB;CACrC,CAAC,CAAC"}
@@ -2,11 +2,11 @@ import { z } from 'zod';
2
2
  export * from './tableViz';
3
3
  export * from './timeSeriesViz';
4
4
  export * from './verticalBarViz';
5
- export declare const ToolNameSchema: z.ZodEnum<["generateBarVizConfig", "generateTableVizConfig", "generateTimeSeriesVizConfig", "generateDashboard", "findExplores", "findFields", "searchFieldValues", "findDashboards", "findCharts", "improveContext", "proposeChange"]>;
5
+ export declare const ToolNameSchema: z.ZodEnum<["generateBarVizConfig", "generateTableVizConfig", "generateTimeSeriesVizConfig", "generateDashboard", "findExplores", "findFields", "searchFieldValues", "findDashboards", "findCharts", "improveContext", "proposeChange", "runQuery"]>;
6
6
  export type ToolName = z.infer<typeof ToolNameSchema>;
7
7
  export declare const isToolName: (toolName: string) => toolName is ToolName;
8
- export declare const ToolDisplayMessagesSchema: z.ZodRecord<z.ZodEnum<["generateBarVizConfig", "generateTableVizConfig", "generateTimeSeriesVizConfig", "generateDashboard", "findExplores", "findFields", "searchFieldValues", "findDashboards", "findCharts", "improveContext", "proposeChange"]>, z.ZodString>;
9
- export declare const TOOL_DISPLAY_MESSAGES: Partial<Record<"generateBarVizConfig" | "generateTableVizConfig" | "generateTimeSeriesVizConfig" | "generateDashboard" | "findExplores" | "findFields" | "searchFieldValues" | "findDashboards" | "findCharts" | "improveContext" | "proposeChange", string>>;
10
- export declare const TOOL_DISPLAY_MESSAGES_AFTER_TOOL_CALL: Partial<Record<"generateBarVizConfig" | "generateTableVizConfig" | "generateTimeSeriesVizConfig" | "generateDashboard" | "findExplores" | "findFields" | "searchFieldValues" | "findDashboards" | "findCharts" | "improveContext" | "proposeChange", string>>;
8
+ export declare const ToolDisplayMessagesSchema: z.ZodRecord<z.ZodEnum<["generateBarVizConfig", "generateTableVizConfig", "generateTimeSeriesVizConfig", "generateDashboard", "findExplores", "findFields", "searchFieldValues", "findDashboards", "findCharts", "improveContext", "proposeChange", "runQuery"]>, z.ZodString>;
9
+ export declare const TOOL_DISPLAY_MESSAGES: Partial<Record<"generateBarVizConfig" | "generateTableVizConfig" | "generateTimeSeriesVizConfig" | "generateDashboard" | "findExplores" | "findFields" | "searchFieldValues" | "findDashboards" | "findCharts" | "improveContext" | "proposeChange" | "runQuery", string>>;
10
+ export declare const TOOL_DISPLAY_MESSAGES_AFTER_TOOL_CALL: Partial<Record<"generateBarVizConfig" | "generateTableVizConfig" | "generateTimeSeriesVizConfig" | "generateDashboard" | "findExplores" | "findFields" | "searchFieldValues" | "findDashboards" | "findCharts" | "improveContext" | "proposeChange" | "runQuery", string>>;
11
11
  export declare const AVAILABLE_VISUALIZATION_TYPES: readonly ["generateBarVizConfig", "generateTableVizConfig", "generateTimeSeriesVizConfig"];
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/visualizations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AASjC,eAAO,MAAM,cAAc,yOAUzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,UAAU,aAAc,MAAM,KAAG,QAAQ,IAAI,QACZ,CAAC;AAG/C,eAAO,MAAM,yBAAyB,mQAAuC,CAAC;AAE9E,eAAO,MAAM,qBAAqB,+PAWhC,CAAC;AAGH,eAAO,MAAM,qCAAqC,+PAY5C,CAAC;AAEP,eAAO,MAAM,6BAA6B,4FAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/visualizations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AASjC,eAAO,MAAM,cAAc,qPAWzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,UAAU,aAAc,MAAM,KAAG,QAAQ,IAAI,QACZ,CAAC;AAG/C,eAAO,MAAM,yBAAyB,+QAAuC,CAAC;AAE9E,eAAO,MAAM,qBAAqB,4QAYhC,CAAC;AAGH,eAAO,MAAM,qCAAqC,4QAa5C,CAAC;AAEP,eAAO,MAAM,6BAA6B,4FAAqB,CAAC"}
@@ -22,6 +22,7 @@ exports.ToolNameSchema = zod_1.z.enum([
22
22
  'findCharts',
23
23
  'improveContext',
24
24
  'proposeChange',
25
+ 'runQuery',
25
26
  ]);
26
27
  const isToolName = (toolName) => exports.ToolNameSchema.safeParse(toolName).success;
27
28
  exports.isToolName = isToolName;
@@ -38,6 +39,7 @@ exports.TOOL_DISPLAY_MESSAGES = exports.ToolDisplayMessagesSchema.parse({
38
39
  generateDashboard: 'Generating a dashboard',
39
40
  findCharts: 'Finding relevant charts',
40
41
  improveContext: 'Improving context',
42
+ runQuery: 'Running query',
41
43
  });
42
44
  // after-tool-call messages
43
45
  exports.TOOL_DISPLAY_MESSAGES_AFTER_TOOL_CALL = exports.ToolDisplayMessagesSchema.parse({
@@ -51,6 +53,7 @@ exports.TOOL_DISPLAY_MESSAGES_AFTER_TOOL_CALL = exports.ToolDisplayMessagesSchem
51
53
  generateDashboard: 'Generated a dashboard',
52
54
  findCharts: 'Found relevant charts',
53
55
  improveContext: 'Improved context',
56
+ runQuery: 'Ran query',
54
57
  });
55
58
  exports.AVAILABLE_VISUALIZATION_TYPES = VisualizationTools;
56
59
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/visualizations/index.ts"],"names":[],"mappings":";;;;AAAA,6BAAwB;AAExB,qDAA2B;AAC3B,0DAAgC;AAChC,2DAAiC;AAEjC,MAAM,kBAAkB,GAAG;IACvB,sBAAsB;IACtB,wBAAwB;IACxB,6BAA6B;CACvB,CAAC;AAEX,oBAAoB;AACP,QAAA,cAAc,GAAG,OAAC,CAAC,IAAI,CAAC;IACjC,GAAG,kBAAkB;IACrB,mBAAmB;IACnB,cAAc;IACd,YAAY;IACZ,mBAAmB;IACnB,gBAAgB;IAChB,YAAY;IACZ,gBAAgB;IAChB,eAAe;CAClB,CAAC,CAAC;AAII,MAAM,UAAU,GAAG,CAAC,QAAgB,EAAwB,EAAE,CACjE,sBAAc,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC;AADlC,QAAA,UAAU,cACwB;AAE/C,0BAA0B;AACb,QAAA,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC,sBAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AAEjE,QAAA,qBAAqB,GAAG,iCAAyB,CAAC,KAAK,CAAC;IACjE,YAAY,EAAE,2BAA2B;IACzC,cAAc,EAAE,6BAA6B;IAC7C,UAAU,EAAE,yBAAyB;IACrC,iBAAiB,EAAE,wBAAwB;IAC3C,oBAAoB,EAAE,wBAAwB;IAC9C,sBAAsB,EAAE,oBAAoB;IAC5C,2BAA2B,EAAE,yBAAyB;IACtD,iBAAiB,EAAE,wBAAwB;IAC3C,UAAU,EAAE,yBAAyB;IACrC,cAAc,EAAE,mBAAmB;CACtC,CAAC,CAAC;AAEH,2BAA2B;AACd,QAAA,qCAAqC,GAC9C,iCAAyB,CAAC,KAAK,CAAC;IAC5B,YAAY,EAAE,yBAAyB;IACvC,cAAc,EAAE,2BAA2B;IAC3C,UAAU,EAAE,uBAAuB;IACnC,iBAAiB,EAAE,oBAAoB;IACvC,oBAAoB,EAAE,uBAAuB;IAC7C,sBAAsB,EAAE,mBAAmB;IAC3C,2BAA2B,EAAE,wBAAwB;IACrD,iBAAiB,EAAE,uBAAuB;IAC1C,UAAU,EAAE,uBAAuB;IACnC,cAAc,EAAE,kBAAkB;CACrC,CAAC,CAAC;AAEM,QAAA,6BAA6B,GAAG,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/visualizations/index.ts"],"names":[],"mappings":";;;;AAAA,6BAAwB;AAExB,qDAA2B;AAC3B,0DAAgC;AAChC,2DAAiC;AAEjC,MAAM,kBAAkB,GAAG;IACvB,sBAAsB;IACtB,wBAAwB;IACxB,6BAA6B;CACvB,CAAC;AAEX,oBAAoB;AACP,QAAA,cAAc,GAAG,OAAC,CAAC,IAAI,CAAC;IACjC,GAAG,kBAAkB;IACrB,mBAAmB;IACnB,cAAc;IACd,YAAY;IACZ,mBAAmB;IACnB,gBAAgB;IAChB,YAAY;IACZ,gBAAgB;IAChB,eAAe;IACf,UAAU;CACb,CAAC,CAAC;AAII,MAAM,UAAU,GAAG,CAAC,QAAgB,EAAwB,EAAE,CACjE,sBAAc,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC;AADlC,QAAA,UAAU,cACwB;AAE/C,0BAA0B;AACb,QAAA,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC,sBAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AAEjE,QAAA,qBAAqB,GAAG,iCAAyB,CAAC,KAAK,CAAC;IACjE,YAAY,EAAE,2BAA2B;IACzC,cAAc,EAAE,6BAA6B;IAC7C,UAAU,EAAE,yBAAyB;IACrC,iBAAiB,EAAE,wBAAwB;IAC3C,oBAAoB,EAAE,wBAAwB;IAC9C,sBAAsB,EAAE,oBAAoB;IAC5C,2BAA2B,EAAE,yBAAyB;IACtD,iBAAiB,EAAE,wBAAwB;IAC3C,UAAU,EAAE,yBAAyB;IACrC,cAAc,EAAE,mBAAmB;IACnC,QAAQ,EAAE,eAAe;CAC5B,CAAC,CAAC;AAEH,2BAA2B;AACd,QAAA,qCAAqC,GAC9C,iCAAyB,CAAC,KAAK,CAAC;IAC5B,YAAY,EAAE,yBAAyB;IACvC,cAAc,EAAE,2BAA2B;IAC3C,UAAU,EAAE,uBAAuB;IACnC,iBAAiB,EAAE,oBAAoB;IACvC,oBAAoB,EAAE,uBAAuB;IAC7C,sBAAsB,EAAE,mBAAmB;IAC3C,2BAA2B,EAAE,wBAAwB;IACrD,iBAAiB,EAAE,uBAAuB;IAC1C,UAAU,EAAE,uBAAuB;IACnC,cAAc,EAAE,kBAAkB;IAClC,QAAQ,EAAE,WAAW;CACxB,CAAC,CAAC;AAEM,QAAA,6BAA6B,GAAG,kBAAkB,CAAC"}
@@ -1,10 +1,11 @@
1
1
  import type { Filters } from '../../types/filter';
2
2
  import type { AdditionalMetric, MetricQuery } from '../../types/metricQuery';
3
- import type { ToolTableVizArgs, ToolTimeSeriesArgs, ToolVerticalBarArgs } from './schemas/tools';
3
+ import type { ToolRunQueryArgs, ToolTableVizArgs, ToolTimeSeriesArgs, ToolVerticalBarArgs } from './schemas/tools';
4
4
  export declare enum AiResultType {
5
5
  TIME_SERIES_RESULT = "time_series_chart",
6
6
  VERTICAL_BAR_RESULT = "vertical_bar_chart",
7
7
  TABLE_RESULT = "table",
8
+ QUERY_RESULT = "query_result",
8
9
  DASHBOARD_RESULT = "dashboard",
9
10
  IMPROVE_CONTEXT = "improve_context",
10
11
  PROPOSE_CHANGE = "propose_change"
@@ -24,5 +25,8 @@ export type AiAgentVizConfig = {
24
25
  } | {
25
26
  type: 'table';
26
27
  config: ToolTableVizArgs;
28
+ } | {
29
+ type: 'query_result';
30
+ config: ToolRunQueryArgs;
27
31
  };
28
32
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ee/AiAgent/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,KAAK,EACR,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,oBAAY,YAAY;IACpB,kBAAkB,sBAAsB;IACxC,mBAAmB,uBAAuB;IAC1C,YAAY,UAAU;IACtB,gBAAgB,cAAc;IAC9B,eAAe,oBAAoB;IACnC,cAAc,mBAAmB;CACpC;AAED,MAAM,MAAM,aAAa,GAAG,IAAI,CAC5B,WAAW,EACT,SAAS,GACT,YAAY,GACZ,OAAO,GACP,OAAO,GACP,aAAa,GACb,mBAAmB,CACxB,GAAG;IACA,iBAAiB,EAAE,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC;CACtD,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,aAAa,GAAG;IACnD,OAAO,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GACtB;IACI,IAAI,EAAE,oBAAoB,CAAC;IAC3B,MAAM,EAAE,mBAAmB,CAAC;CAC/B,GACD;IACI,IAAI,EAAE,mBAAmB,CAAC;IAC1B,MAAM,EAAE,kBAAkB,CAAC;CAC9B,GACD;IACI,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,gBAAgB,CAAC;CAC5B,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ee/AiAgent/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,KAAK,EACR,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,oBAAY,YAAY;IACpB,kBAAkB,sBAAsB;IACxC,mBAAmB,uBAAuB;IAC1C,YAAY,UAAU;IACtB,YAAY,iBAAiB;IAC7B,gBAAgB,cAAc;IAC9B,eAAe,oBAAoB;IACnC,cAAc,mBAAmB;CACpC;AAED,MAAM,MAAM,aAAa,GAAG,IAAI,CAC5B,WAAW,EACT,SAAS,GACT,YAAY,GACZ,OAAO,GACP,OAAO,GACP,aAAa,GACb,mBAAmB,CACxB,GAAG;IACA,iBAAiB,EAAE,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC;CACtD,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,aAAa,GAAG;IACnD,OAAO,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GACtB;IACI,IAAI,EAAE,oBAAoB,CAAC;IAC3B,MAAM,EAAE,mBAAmB,CAAC;CAC/B,GACD;IACI,IAAI,EAAE,mBAAmB,CAAC;IAC1B,MAAM,EAAE,kBAAkB,CAAC;CAC9B,GACD;IACI,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,gBAAgB,CAAC;CAC5B,GACD;IACI,IAAI,EAAE,cAAc,CAAC;IACrB,MAAM,EAAE,gBAAgB,CAAC;CAC5B,CAAC"}
@@ -6,6 +6,7 @@ var AiResultType;
6
6
  AiResultType["TIME_SERIES_RESULT"] = "time_series_chart";
7
7
  AiResultType["VERTICAL_BAR_RESULT"] = "vertical_bar_chart";
8
8
  AiResultType["TABLE_RESULT"] = "table";
9
+ AiResultType["QUERY_RESULT"] = "query_result";
9
10
  AiResultType["DASHBOARD_RESULT"] = "dashboard";
10
11
  AiResultType["IMPROVE_CONTEXT"] = "improve_context";
11
12
  AiResultType["PROPOSE_CHANGE"] = "propose_change";
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ee/AiAgent/types.ts"],"names":[],"mappings":";;;AAQA,IAAY,YAOX;AAPD,WAAY,YAAY;IACpB,wDAAwC,CAAA;IACxC,0DAA0C,CAAA;IAC1C,sCAAsB,CAAA;IACtB,8CAA8B,CAAA;IAC9B,mDAAmC,CAAA;IACnC,iDAAiC,CAAA;AACrC,CAAC,EAPW,YAAY,4BAAZ,YAAY,QAOvB"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ee/AiAgent/types.ts"],"names":[],"mappings":";;;AASA,IAAY,YAQX;AARD,WAAY,YAAY;IACpB,wDAAwC,CAAA;IACxC,0DAA0C,CAAA;IAC1C,sCAAsB,CAAA;IACtB,6CAA6B,CAAA;IAC7B,8CAA8B,CAAA;IAC9B,mDAAmC,CAAA;IACnC,iDAAiC,CAAA;AACrC,CAAC,EARW,YAAY,4BAAZ,YAAY,QAQvB"}
@@ -0,0 +1,26 @@
1
+ import type { ItemsMap } from '../../../types/field';
2
+ import type { MetricQuery } from '../../../types/metricQuery';
3
+ import type { ChartConfig, PivotReference } from '../../../types/savedCharts';
4
+ import type { ToolRunQueryArgsTransformed } from '../schemas/tools/toolRunQueryArgs';
5
+ export type ChartTypeOption = 'table' | 'bar' | 'horizontal' | 'line' | 'scatter' | 'pie' | 'funnel';
6
+ /**
7
+ * Determines if a query can be rendered as a specific chart type
8
+ */
9
+ export declare const canRenderAsChart: (chartType: ChartTypeOption, metricQuery: MetricQuery) => boolean;
10
+ /**
11
+ * Gets all available chart types for a query
12
+ */
13
+ export declare const getAvailableChartTypes: (metricQuery: MetricQuery) => ChartTypeOption[];
14
+ export declare const formatFieldLabel: (fieldId: string, fieldsMap: ItemsMap) => string;
15
+ export declare const formatPivotValueLabel: (pivotReference: PivotReference, fieldsMap: ItemsMap) => string;
16
+ /**
17
+ * Converts runQuery tool result to echarts config
18
+ * This is the main function used for chart type switching
19
+ */
20
+ export declare const getChartConfigFromRunQuery: ({ queryTool, metricQuery, fieldsMap, overrideChartType, }: {
21
+ queryTool: ToolRunQueryArgsTransformed;
22
+ metricQuery: MetricQuery;
23
+ fieldsMap: ItemsMap;
24
+ overrideChartType?: ChartTypeOption;
25
+ }) => ChartConfig;
26
+ //# sourceMappingURL=chartConfigUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chartConfigUtils.d.ts","sourceRoot":"","sources":["../../../../../src/ee/AiAgent/utils/chartConfigUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAER,WAAW,EAGX,cAAc,EACjB,MAAM,4BAA4B,CAAC;AAQpC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AASrF,MAAM,MAAM,eAAe,GACrB,OAAO,GACP,KAAK,GACL,YAAY,GACZ,MAAM,GACN,SAAS,GACT,KAAK,GACL,QAAQ,CAAC;AAEf;;GAEG;AACH,eAAO,MAAM,gBAAgB,cACd,eAAe,eACb,WAAW,KACzB,OAuBF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,gBAClB,WAAW,KACzB,eAAe,EAQjB,CAAC;AAEF,eAAO,MAAM,gBAAgB,YAChB,MAAM,aACJ,QAAQ,KACpB,MAMF,CAAC;AAEF,eAAO,MAAM,qBAAqB,mBACd,cAAc,aACnB,QAAQ,KACpB,MAcF,CAAC;AA4XF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,8DAKpC;IACC,SAAS,EAAE,2BAA2B,CAAC;IACvC,WAAW,EAAE,WAAW,CAAC;IACzB,SAAS,EAAE,QAAQ,CAAC;IACpB,iBAAiB,CAAC,EAAE,eAAe,CAAC;CACvC,KAAG,WAsEH,CAAC"}