@lightdash/common 2.315.0 → 2.316.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 (25) hide show
  1. package/dist/cjs/.tsbuildinfo +1 -1
  2. package/dist/cjs/ee/AiAgent/schemas/tools/toolComposerQueryArgs.d.ts +17 -1
  3. package/dist/cjs/ee/AiAgent/schemas/tools/toolComposerQueryArgs.d.ts.map +1 -1
  4. package/dist/cjs/ee/AiAgent/schemas/tools/toolComposerQueryArgs.js +41 -20
  5. package/dist/cjs/ee/AiAgent/schemas/tools/toolComposerQueryArgs.js.map +1 -1
  6. package/dist/cjs/schemas/json/mcp-tools-1.0.json +42 -2
  7. package/dist/cjs/types/querySources.d.ts +16 -0
  8. package/dist/cjs/types/querySources.d.ts.map +1 -1
  9. package/dist/esm/.tsbuildinfo +1 -1
  10. package/dist/esm/ee/AiAgent/schemas/tools/toolComposerQueryArgs.d.ts +17 -1
  11. package/dist/esm/ee/AiAgent/schemas/tools/toolComposerQueryArgs.d.ts.map +1 -1
  12. package/dist/esm/ee/AiAgent/schemas/tools/toolComposerQueryArgs.js +41 -20
  13. package/dist/esm/ee/AiAgent/schemas/tools/toolComposerQueryArgs.js.map +1 -1
  14. package/dist/esm/schemas/json/mcp-tools-1.0.json +42 -2
  15. package/dist/esm/types/querySources.d.ts +16 -0
  16. package/dist/esm/types/querySources.d.ts.map +1 -1
  17. package/dist/types/.tsbuildinfo +1 -1
  18. package/dist/types/ee/AiAgent/schemas/tools/toolComposerQueryArgs.d.ts +17 -1
  19. package/dist/types/ee/AiAgent/schemas/tools/toolComposerQueryArgs.d.ts.map +1 -1
  20. package/dist/types/ee/AiAgent/schemas/tools/toolComposerQueryArgs.js +41 -20
  21. package/dist/types/ee/AiAgent/schemas/tools/toolComposerQueryArgs.js.map +1 -1
  22. package/dist/types/schemas/json/mcp-tools-1.0.json +42 -2
  23. package/dist/types/types/querySources.d.ts +16 -0
  24. package/dist/types/types/querySources.d.ts.map +1 -1
  25. package/package.json +1 -1
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { QuerySourceType, type DuckdbSourceQuery, type ExternalSourceQuery, type SemanticLayerSourceQuery, type SqlSourceQuery } from '../../../../types/querySources';
3
3
  export declare const DEFAULT_COMPOSER_QUERY_LIMIT = 500;
4
4
  export declare const DEFAULT_COMPOSER_QUERY_MAX_LIMIT = 5000;
5
- export declare const TOOL_COMPOSER_QUERIES_DESCRIPTION = "Execute a composer query: a pipeline of one or more queries submitted together, where DuckDB queries can join and transform the results of the other queries. Results are stored as a chart artifact that renders the terminal node's results table in the thread.\n\nUse this tool when a single source cannot answer the question \u2014 e.g. joining a semantic layer metric query with an uploaded CSV, joining with raw warehouse SQL, or post-processing prior results with SQL. A pipeline may also be a single node: a lone \"sql\" node is how raw warehouse SQL runs when no standalone runSql tool is available.\n\nHow to build a pipeline:\n- Every query is a node. Name each node with \"nodeId\" (letters, digits, underscores; starting with a letter or underscore).\n- \"semanticLayer\" nodes run a metric query against an explore. Result columns are named by field id \u2014 exactly the dimensions and metrics requested (e.g. metric \"payments_total_revenue\" yields column \"payments_total_revenue\").\n- \"sql\" nodes run raw SQL against the project's data warehouse, in the warehouse's SQL dialect. Result columns are the SELECT output names. SQL execution may require the user to approve the SQL first.\n- \"external\" nodes run DuckDB SQL over durable external tables such as uploaded CSVs and connected data sources. Declare the tables via \"tables\": an array of table names, or a map of {sqlAlias: tableNameOrTableUuid}. Use the exact table name or UUID supplied in the user's attached-source context. One source may expose many tables, and one external node can read any subset of them. Result columns are the SELECT output names.\n- \"duckdb\" nodes run DuckDB SQL over other queries' results. Declare which results the SQL reads via \"references\": the shorthand array form lists node ids from this submission, each exposed as a table named by its node id ([\"orders\", \"revenue\"] lets the SQL run SELECT * FROM orders JOIN revenue ...); the map form aliases tables or references stored results by queryUuid ({\"o\": \"orders\", \"prev\": \"<queryUuid>\"}). A referenced table's columns are the upstream result's columns.\n- The \"terminal\" node is the one whose results the artifact shows and whose rows are returned to you. By default it is the unique sink (the one node no other node references); pass \"terminalNodeId\" explicitly when the pipeline has multiple sinks.\n\nResults are reusable across calls:\n- Every call returns a queryUuid per node. Any of them \u2014 not just the terminal one \u2014 can be referenced by a later call via the map form of \"references\".\n- Referencing a queryUuid reads the stored result; the query behind it is NOT re-run. A duckdb-only submission over stored results touches no source and needs no SQL approval, however many times you iterate.\n- This supports step-by-step work: run a source query once, then explore its result with as many follow-up duckdb submissions over the same queryUuid as you need.\n- The artifact shown in the thread always renders your LATEST call's terminal result, so finish with the submission that produces the table the user should see \u2014 referencing earlier queryUuids keeps that final pipeline small.\n\nReturns the terminal node's result columns and a CSV preview of its rows, plus per-node queryUuids.";
5
+ export declare const TOOL_COMPOSER_QUERIES_DESCRIPTION = "Run a pipeline: one or more queries submitted together, where duckdb queries join or transform the others' results. The terminal node's table is shown in the thread as a chart artifact and its rows are returned to you.\n\nNode kinds:\n- \"semanticLayer\": a metric query against an explore. Result columns are the requested field ids.\n- \"sql\": raw SQL against the project warehouse; may need user approval. A lone sql node is how raw SQL runs when there is no runSql tool.\n- \"external\": DuckDB SQL over uploaded or connected tables declared in \"tables\".\n- \"duckdb\": DuckDB SQL over other results declared in \"references\".\n\nEvery node has a \"nodeId\" (for references) and a \"title\" (what users see). The terminal node is the unique sink by default, or \"terminalNodeId\".\n\nReuse across calls: every call returns a queryUuid per node. Referencing a queryUuid in the map form of \"references\" reads the stored result without re-running it or asking for approval. The artifact always shows your latest call's terminal result, so end with the pipeline that produces the table the user should see.";
6
6
  type CreateToolComposerQueriesArgsSchemaOptions = {
7
7
  maxLimit?: number;
8
8
  defaultLimit?: number;
@@ -11,6 +11,8 @@ export declare const createToolComposerQueriesArgsSchema: ({ maxLimit, defaultLi
11
11
  title: z.ZodNullable<z.ZodString>;
12
12
  description: z.ZodNullable<z.ZodString>;
13
13
  queries: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
14
+ title: z.ZodString;
15
+ description: z.ZodNullable<z.ZodString>;
14
16
  sourceType: z.ZodLiteral<QuerySourceType.SEMANTIC_LAYER>;
15
17
  nodeId: z.ZodString;
16
18
  exploreName: z.ZodString;
@@ -27,17 +29,23 @@ export declare const createToolComposerQueriesArgsSchema: ({ maxLimit, defaultLi
27
29
  }, z.core.$strip>>>;
28
30
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
29
31
  }, z.core.$strip>, z.ZodObject<{
32
+ title: z.ZodString;
33
+ description: z.ZodNullable<z.ZodString>;
30
34
  sourceType: z.ZodLiteral<QuerySourceType.SQL>;
31
35
  nodeId: z.ZodString;
32
36
  sql: z.ZodString;
33
37
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
34
38
  }, z.core.$strip>, z.ZodObject<{
39
+ title: z.ZodString;
40
+ description: z.ZodNullable<z.ZodString>;
35
41
  sourceType: z.ZodLiteral<QuerySourceType.DUCKDB>;
36
42
  nodeId: z.ZodString;
37
43
  sql: z.ZodString;
38
44
  references: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodString>]>;
39
45
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
40
46
  }, z.core.$strip>, z.ZodObject<{
47
+ title: z.ZodString;
48
+ description: z.ZodNullable<z.ZodString>;
41
49
  sourceType: z.ZodLiteral<QuerySourceType.EXTERNAL>;
42
50
  nodeId: z.ZodString;
43
51
  sql: z.ZodString;
@@ -50,6 +58,8 @@ export declare const toolComposerQueriesArgsSchema: z.ZodObject<{
50
58
  title: z.ZodNullable<z.ZodString>;
51
59
  description: z.ZodNullable<z.ZodString>;
52
60
  queries: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
61
+ title: z.ZodString;
62
+ description: z.ZodNullable<z.ZodString>;
53
63
  sourceType: z.ZodLiteral<QuerySourceType.SEMANTIC_LAYER>;
54
64
  nodeId: z.ZodString;
55
65
  exploreName: z.ZodString;
@@ -66,17 +76,23 @@ export declare const toolComposerQueriesArgsSchema: z.ZodObject<{
66
76
  }, z.core.$strip>>>;
67
77
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
68
78
  }, z.core.$strip>, z.ZodObject<{
79
+ title: z.ZodString;
80
+ description: z.ZodNullable<z.ZodString>;
69
81
  sourceType: z.ZodLiteral<QuerySourceType.SQL>;
70
82
  nodeId: z.ZodString;
71
83
  sql: z.ZodString;
72
84
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
73
85
  }, z.core.$strip>, z.ZodObject<{
86
+ title: z.ZodString;
87
+ description: z.ZodNullable<z.ZodString>;
74
88
  sourceType: z.ZodLiteral<QuerySourceType.DUCKDB>;
75
89
  nodeId: z.ZodString;
76
90
  sql: z.ZodString;
77
91
  references: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodString>]>;
78
92
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
79
93
  }, z.core.$strip>, z.ZodObject<{
94
+ title: z.ZodString;
95
+ description: z.ZodNullable<z.ZodString>;
80
96
  sourceType: z.ZodLiteral<QuerySourceType.EXTERNAL>;
81
97
  nodeId: z.ZodString;
82
98
  sql: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"toolComposerQueryArgs.d.ts","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolComposerQueryArgs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EACH,eAAe,EACf,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACtB,MAAM,gCAAgC,CAAC;AAIxC,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAChD,eAAO,MAAM,gCAAgC,OAAO,CAAC;AAErD,eAAO,MAAM,iCAAiC,iuGAkBsD,CAAC;AA6BrG,KAAK,0CAA0C,GAAG;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,mCAAmC,iCAG7C,0CAA0C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiH5C,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBACD,CAAC;AAE1C,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CACvC,OAAO,6BAA6B,CACvC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAErB;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,SACrC,qBAAqB,KAEzB,wBAAwB,GACxB,cAAc,GACd,iBAAiB,GACjB,mBA2CL,CAAC;AAsBF;;;;;;;GAOG;AACH,eAAO,MAAM,mCAAmC,UACrC,OAAO,KACf,uBAAuB,GAAG,IAyE5B,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;iBAK1C,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CACzC,OAAO,6BAA6B,CACvC,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,+BAA+B,CACzC,CAAC"}
1
+ {"version":3,"file":"toolComposerQueryArgs.d.ts","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolComposerQueryArgs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EACH,eAAe,EACf,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACtB,MAAM,gCAAgC,CAAC;AAIxC,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAChD,eAAO,MAAM,gCAAgC,OAAO,CAAC;AAErD,eAAO,MAAM,iCAAiC,6lCAUiR,CAAC;AA+ChU,KAAK,0CAA0C,GAAG;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,mCAAmC,iCAG7C,0CAA0C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqH5C,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBACD,CAAC;AAE1C,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CACvC,OAAO,6BAA6B,CACvC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AASrB;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,SACrC,qBAAqB,KAEzB,wBAAwB,GACxB,cAAc,GACd,iBAAiB,GACjB,mBA+CL,CAAC;AAsBF;;;;;;;GAOG;AACH,eAAO,MAAM,mCAAmC,UACrC,OAAO,KACf,uBAAuB,GAAG,IAgF5B,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;iBAK1C,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CACzC,OAAO,6BAA6B,CACvC,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,+BAA+B,CACzC,CAAC"}
@@ -4,29 +4,32 @@ import assertUnreachable from '../../../../utils/assertUnreachable';
4
4
  import { createToolSchema } from '../toolSchemaBuilder';
5
5
  export const DEFAULT_COMPOSER_QUERY_LIMIT = 500;
6
6
  export const DEFAULT_COMPOSER_QUERY_MAX_LIMIT = 5000;
7
- export const TOOL_COMPOSER_QUERIES_DESCRIPTION = `Execute a composer query: a pipeline of one or more queries submitted together, where DuckDB queries can join and transform the results of the other queries. Results are stored as a chart artifact that renders the terminal node's results table in the thread.
7
+ export const TOOL_COMPOSER_QUERIES_DESCRIPTION = `Run a pipeline: one or more queries submitted together, where duckdb queries join or transform the others' results. The terminal node's table is shown in the thread as a chart artifact and its rows are returned to you.
8
8
 
9
- Use this tool when a single source cannot answer the question — e.g. joining a semantic layer metric query with an uploaded CSV, joining with raw warehouse SQL, or post-processing prior results with SQL. A pipeline may also be a single node: a lone "sql" node is how raw warehouse SQL runs when no standalone runSql tool is available.
9
+ Node kinds:
10
+ - "semanticLayer": a metric query against an explore. Result columns are the requested field ids.
11
+ - "sql": raw SQL against the project warehouse; may need user approval. A lone sql node is how raw SQL runs when there is no runSql tool.
12
+ - "external": DuckDB SQL over uploaded or connected tables declared in "tables".
13
+ - "duckdb": DuckDB SQL over other results declared in "references".
10
14
 
11
- How to build a pipeline:
12
- - Every query is a node. Name each node with "nodeId" (letters, digits, underscores; starting with a letter or underscore).
13
- - "semanticLayer" nodes run a metric query against an explore. Result columns are named by field id — exactly the dimensions and metrics requested (e.g. metric "payments_total_revenue" yields column "payments_total_revenue").
14
- - "sql" nodes run raw SQL against the project's data warehouse, in the warehouse's SQL dialect. Result columns are the SELECT output names. SQL execution may require the user to approve the SQL first.
15
- - "external" nodes run DuckDB SQL over durable external tables such as uploaded CSVs and connected data sources. Declare the tables via "tables": an array of table names, or a map of {sqlAlias: tableNameOrTableUuid}. Use the exact table name or UUID supplied in the user's attached-source context. One source may expose many tables, and one external node can read any subset of them. Result columns are the SELECT output names.
16
- - "duckdb" nodes run DuckDB SQL over other queries' results. Declare which results the SQL reads via "references": the shorthand array form lists node ids from this submission, each exposed as a table named by its node id (["orders", "revenue"] lets the SQL run SELECT * FROM orders JOIN revenue ...); the map form aliases tables or references stored results by queryUuid ({"o": "orders", "prev": "<queryUuid>"}). A referenced table's columns are the upstream result's columns.
17
- - The "terminal" node is the one whose results the artifact shows and whose rows are returned to you. By default it is the unique sink (the one node no other node references); pass "terminalNodeId" explicitly when the pipeline has multiple sinks.
15
+ Every node has a "nodeId" (for references) and a "title" (what users see). The terminal node is the unique sink by default, or "terminalNodeId".
18
16
 
19
- Results are reusable across calls:
20
- - Every call returns a queryUuid per node. Any of them — not just the terminal one — can be referenced by a later call via the map form of "references".
21
- - Referencing a queryUuid reads the stored result; the query behind it is NOT re-run. A duckdb-only submission over stored results touches no source and needs no SQL approval, however many times you iterate.
22
- - This supports step-by-step work: run a source query once, then explore its result with as many follow-up duckdb submissions over the same queryUuid as you need.
23
- - The artifact shown in the thread always renders your LATEST call's terminal result, so finish with the submission that produces the table the user should see — referencing earlier queryUuids keeps that final pipeline small.
24
-
25
- Returns the terminal node's result columns and a CSV preview of its rows, plus per-node queryUuids.`;
17
+ Reuse across calls: every call returns a queryUuid per node. Referencing a queryUuid in the map form of "references" reads the stored result without re-running it or asking for approval. The artifact always shows your latest call's terminal result, so end with the pipeline that produces the table the user should see.`;
26
18
  const nodeIdSchema = z
27
19
  .string()
28
20
  .regex(/^[a-zA-Z_][a-zA-Z0-9_]{0,62}$/, 'Node ids use letters, digits and underscores, starting with a letter or underscore')
29
21
  .describe('Names this query so other queries in the same submission can reference its results. Also the DuckDB table name its results are exposed as.');
22
+ const nodeTitleSchema = z
23
+ .string()
24
+ .describe('Short label a reader understands without seeing the query, two to five words, e.g. "Revenue by month". Shown to users instead of the node id.');
25
+ const nodeDescriptionSchema = z
26
+ .string()
27
+ .nullable()
28
+ .describe('One sentence on what this query does, only when the title is not enough. Null otherwise.');
29
+ const nodeMetaSchema = {
30
+ title: nodeTitleSchema,
31
+ description: nodeDescriptionSchema,
32
+ };
30
33
  const semanticLayerFiltersSchema = z
31
34
  .object({
32
35
  dimensions: z.unknown().optional(),
@@ -51,6 +54,7 @@ export const createToolComposerQueriesArgsSchema = ({ maxLimit = DEFAULT_COMPOSE
51
54
  const semanticLayerNodeSchema = z.object({
52
55
  sourceType: z.literal(QuerySourceType.SEMANTIC_LAYER),
53
56
  nodeId: nodeIdSchema,
57
+ ...nodeMetaSchema,
54
58
  exploreName: z
55
59
  .string()
56
60
  .describe('The explore to run the metric query against.'),
@@ -70,6 +74,7 @@ export const createToolComposerQueriesArgsSchema = ({ maxLimit = DEFAULT_COMPOSE
70
74
  const sqlNodeSchema = z.object({
71
75
  sourceType: z.literal(QuerySourceType.SQL),
72
76
  nodeId: nodeIdSchema,
77
+ ...nodeMetaSchema,
73
78
  sql: z
74
79
  .string()
75
80
  .describe("The SQL to execute against the project's data warehouse, in the warehouse's SQL dialect. Must be a SELECT (or WITH) statement."),
@@ -78,6 +83,7 @@ export const createToolComposerQueriesArgsSchema = ({ maxLimit = DEFAULT_COMPOSE
78
83
  const duckdbNodeSchema = z.object({
79
84
  sourceType: z.literal(QuerySourceType.DUCKDB),
80
85
  nodeId: nodeIdSchema,
86
+ ...nodeMetaSchema,
81
87
  sql: z
82
88
  .string()
83
89
  .describe('DuckDB SQL over the referenced results. Each reference is exposed as a table; its columns are the upstream result columns.'),
@@ -89,6 +95,7 @@ export const createToolComposerQueriesArgsSchema = ({ maxLimit = DEFAULT_COMPOSE
89
95
  const externalNodeSchema = z.object({
90
96
  sourceType: z.literal(QuerySourceType.EXTERNAL),
91
97
  nodeId: nodeIdSchema,
98
+ ...nodeMetaSchema,
92
99
  sql: z
93
100
  .string()
94
101
  .describe('DuckDB SQL over the declared external source tables. Each table is exposed under its name or map alias.'),
@@ -125,6 +132,10 @@ export const createToolComposerQueriesArgsSchema = ({ maxLimit = DEFAULT_COMPOSE
125
132
  .build();
126
133
  };
127
134
  export const toolComposerQueriesArgsSchema = createToolComposerQueriesArgsSchema();
135
+ const toSourceQueryNodeMeta = (node) => ({
136
+ title: node.title,
137
+ description: node.description ?? undefined,
138
+ });
128
139
  /**
129
140
  * Converts a validated tool node into the canonical SourceQuery shape the
130
141
  * query source service takes. The explicit return types pin drift at compile
@@ -138,6 +149,7 @@ export const toolComposerQueryNodeToSourceQuery = (node) => {
138
149
  return {
139
150
  sourceType: node.sourceType,
140
151
  nodeId: node.nodeId,
152
+ ...toSourceQueryNodeMeta(node),
141
153
  exploreName: node.exploreName,
142
154
  dimensions: node.dimensions,
143
155
  metrics: node.metrics,
@@ -150,6 +162,7 @@ export const toolComposerQueryNodeToSourceQuery = (node) => {
150
162
  return {
151
163
  sourceType: node.sourceType,
152
164
  nodeId: node.nodeId,
165
+ ...toSourceQueryNodeMeta(node),
153
166
  sql: node.sql,
154
167
  limit: node.limit,
155
168
  };
@@ -157,6 +170,7 @@ export const toolComposerQueryNodeToSourceQuery = (node) => {
157
170
  return {
158
171
  sourceType: node.sourceType,
159
172
  nodeId: node.nodeId,
173
+ ...toSourceQueryNodeMeta(node),
160
174
  sql: node.sql,
161
175
  references: node.references,
162
176
  limit: node.limit,
@@ -165,6 +179,7 @@ export const toolComposerQueryNodeToSourceQuery = (node) => {
165
179
  return {
166
180
  sourceType: node.sourceType,
167
181
  nodeId: node.nodeId,
182
+ ...toSourceQueryNodeMeta(node),
168
183
  sql: node.sql,
169
184
  tables: node.tables,
170
185
  limit: node.limit,
@@ -207,12 +222,18 @@ export const parsePartialToolComposerQueriesArgs = (input) => {
207
222
  if (typeof nodeId !== 'string' || nodeId.length === 0)
208
223
  return [];
209
224
  const sql = typeof node.sql === 'string' ? node.sql : '';
225
+ const meta = {
226
+ nodeId,
227
+ // Title falls back to the node id until it streams in
228
+ title: typeof node.title === 'string' ? node.title : nodeId,
229
+ description: typeof node.description === 'string' ? node.description : null,
230
+ };
210
231
  switch (node.sourceType) {
211
232
  case QuerySourceType.SEMANTIC_LAYER:
212
233
  return [
213
234
  {
214
235
  sourceType: QuerySourceType.SEMANTIC_LAYER,
215
- nodeId,
236
+ ...meta,
216
237
  exploreName: typeof node.exploreName === 'string'
217
238
  ? node.exploreName
218
239
  : '',
@@ -227,7 +248,7 @@ export const parsePartialToolComposerQueriesArgs = (input) => {
227
248
  return [
228
249
  {
229
250
  sourceType: QuerySourceType.SQL,
230
- nodeId,
251
+ ...meta,
231
252
  sql,
232
253
  limit: DEFAULT_COMPOSER_QUERY_LIMIT,
233
254
  },
@@ -236,7 +257,7 @@ export const parsePartialToolComposerQueriesArgs = (input) => {
236
257
  return [
237
258
  {
238
259
  sourceType: QuerySourceType.DUCKDB,
239
- nodeId,
260
+ ...meta,
240
261
  sql,
241
262
  references: asReferenceMapOrArray(node.references),
242
263
  limit: DEFAULT_COMPOSER_QUERY_LIMIT,
@@ -246,7 +267,7 @@ export const parsePartialToolComposerQueriesArgs = (input) => {
246
267
  return [
247
268
  {
248
269
  sourceType: QuerySourceType.EXTERNAL,
249
- nodeId,
270
+ ...meta,
250
271
  sql,
251
272
  tables: asReferenceMapOrArray(node.tables),
252
273
  limit: DEFAULT_COMPOSER_QUERY_LIMIT,
@@ -1 +1 @@
1
- {"version":3,"file":"toolComposerQueryArgs.js","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolComposerQueryArgs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EACH,eAAe,GAKlB,MAAM,gCAAgC,CAAC;AACxC,OAAO,iBAAiB,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAChD,MAAM,CAAC,MAAM,gCAAgC,GAAG,IAAI,CAAC;AAErD,MAAM,CAAC,MAAM,iCAAiC,GAAG;;;;;;;;;;;;;;;;;;oGAkBmD,CAAC;AAErG,MAAM,YAAY,GAAG,CAAC;KACjB,MAAM,EAAE;KACR,KAAK,CACF,+BAA+B,EAC/B,oFAAoF,CACvF;KACA,QAAQ,CACL,4IAA4I,CAC/I,CAAC;AAEN,MAAM,0BAA0B,GAAG,CAAC;KAC/B,MAAM,CAAC;IACJ,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC/B,iBAAiB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC5C,CAAC;KACD,QAAQ,CACL,8OAA8O,CACjP,CAAC;AAEN,MAAM,eAAe,GA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AC,CAAC,IAAI;QAChE,OAAO;QACP,cAAc,EACV,OAAO,GAAG,CAAC,cAAc,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI;KACzE,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;KAC9D,CAAC;CACL,CAAC,CAAC"}
@@ -3098,7 +3098,7 @@
3098
3098
  "openWorldHint": false,
3099
3099
  "readOnlyHint": true
3100
3100
  },
3101
- "description": "Execute a composer query: a pipeline of one or more queries submitted together, where DuckDB queries can join and transform the results of the other queries. Results are stored as a chart artifact that renders the terminal node's results table in the thread.\n\nUse this tool when a single source cannot answer the question — e.g. joining a semantic layer metric query with an uploaded CSV, joining with raw warehouse SQL, or post-processing prior results with SQL. A pipeline may also be a single node: a lone \"sql\" node is how raw warehouse SQL runs when no standalone runSql tool is available.\n\nHow to build a pipeline:\n- Every query is a node. Name each node with \"nodeId\" (letters, digits, underscores; starting with a letter or underscore).\n- \"semanticLayer\" nodes run a metric query against an explore. Result columns are named by field id — exactly the dimensions and metrics requested (e.g. metric \"payments_total_revenue\" yields column \"payments_total_revenue\").\n- \"sql\" nodes run raw SQL against the project's data warehouse, in the warehouse's SQL dialect. Result columns are the SELECT output names. SQL execution may require the user to approve the SQL first.\n- \"external\" nodes run DuckDB SQL over durable external tables such as uploaded CSVs and connected data sources. Declare the tables via \"tables\": an array of table names, or a map of {sqlAlias: tableNameOrTableUuid}. Use the exact table name or UUID supplied in the user's attached-source context. One source may expose many tables, and one external node can read any subset of them. Result columns are the SELECT output names.\n- \"duckdb\" nodes run DuckDB SQL over other queries' results. Declare which results the SQL reads via \"references\": the shorthand array form lists node ids from this submission, each exposed as a table named by its node id ([\"orders\", \"revenue\"] lets the SQL run SELECT * FROM orders JOIN revenue ...); the map form aliases tables or references stored results by queryUuid ({\"o\": \"orders\", \"prev\": \"<queryUuid>\"}). A referenced table's columns are the upstream result's columns.\n- The \"terminal\" node is the one whose results the artifact shows and whose rows are returned to you. By default it is the unique sink (the one node no other node references); pass \"terminalNodeId\" explicitly when the pipeline has multiple sinks.\n\nResults are reusable across calls:\n- Every call returns a queryUuid per node. Any of them — not just the terminal one — can be referenced by a later call via the map form of \"references\".\n- Referencing a queryUuid reads the stored result; the query behind it is NOT re-run. A duckdb-only submission over stored results touches no source and needs no SQL approval, however many times you iterate.\n- This supports step-by-step work: run a source query once, then explore its result with as many follow-up duckdb submissions over the same queryUuid as you need.\n- The artifact shown in the thread always renders your LATEST call's terminal result, so finish with the submission that produces the table the user should see — referencing earlier queryUuids keeps that final pipeline small.\n\nReturns the terminal node's result columns and a CSV preview of its rows, plus per-node queryUuids.",
3101
+ "description": "Run a pipeline: one or more queries submitted together, where duckdb queries join or transform the others' results. The terminal node's table is shown in the thread as a chart artifact and its rows are returned to you.\n\nNode kinds:\n- \"semanticLayer\": a metric query against an explore. Result columns are the requested field ids.\n- \"sql\": raw SQL against the project warehouse; may need user approval. A lone sql node is how raw SQL runs when there is no runSql tool.\n- \"external\": DuckDB SQL over uploaded or connected tables declared in \"tables\".\n- \"duckdb\": DuckDB SQL over other results declared in \"references\".\n\nEvery node has a \"nodeId\" (for references) and a \"title\" (what users see). The terminal node is the unique sink by default, or \"terminalNodeId\".\n\nReuse across calls: every call returns a queryUuid per node. Referencing a queryUuid in the map form of \"references\" reads the stored result without re-running it or asking for approval. The artifact always shows your latest call's terminal result, so end with the pipeline that produces the table the user should see.",
3102
3102
  "inputSchema": {
3103
3103
  "$schema": "http://json-schema.org/draft-07/schema#",
3104
3104
  "properties": {
@@ -3112,6 +3112,10 @@
3112
3112
  "anyOf": [
3113
3113
  {
3114
3114
  "properties": {
3115
+ "description": {
3116
+ "description": "One sentence on what this query does, only when the title is not enough. Null otherwise.",
3117
+ "type": "string"
3118
+ },
3115
3119
  "dimensions": {
3116
3120
  "description": "Dimension field ids to group by, from the explore's schema.",
3117
3121
  "items": {
@@ -3175,11 +3179,16 @@
3175
3179
  "sourceType": {
3176
3180
  "const": "semanticLayer",
3177
3181
  "type": "string"
3182
+ },
3183
+ "title": {
3184
+ "description": "Short label a reader understands without seeing the query, two to five words, e.g. \"Revenue by month\". Shown to users instead of the node id.",
3185
+ "type": "string"
3178
3186
  }
3179
3187
  },
3180
3188
  "required": [
3181
3189
  "sourceType",
3182
3190
  "nodeId",
3191
+ "title",
3183
3192
  "exploreName",
3184
3193
  "dimensions",
3185
3194
  "metrics"
@@ -3188,6 +3197,10 @@
3188
3197
  },
3189
3198
  {
3190
3199
  "properties": {
3200
+ "description": {
3201
+ "description": "One sentence on what this query does, only when the title is not enough. Null otherwise.",
3202
+ "type": "string"
3203
+ },
3191
3204
  "limit": {
3192
3205
  "default": 500,
3193
3206
  "description": "Maximum number of rows this node returns. Defaults to 500, max 5000.",
@@ -3207,13 +3220,26 @@
3207
3220
  "sql": {
3208
3221
  "description": "The SQL to execute against the project's data warehouse, in the warehouse's SQL dialect. Must be a SELECT (or WITH) statement.",
3209
3222
  "type": "string"
3223
+ },
3224
+ "title": {
3225
+ "description": "Short label a reader understands without seeing the query, two to five words, e.g. \"Revenue by month\". Shown to users instead of the node id.",
3226
+ "type": "string"
3210
3227
  }
3211
3228
  },
3212
- "required": ["sourceType", "nodeId", "sql"],
3229
+ "required": [
3230
+ "sourceType",
3231
+ "nodeId",
3232
+ "title",
3233
+ "sql"
3234
+ ],
3213
3235
  "type": "object"
3214
3236
  },
3215
3237
  {
3216
3238
  "properties": {
3239
+ "description": {
3240
+ "description": "One sentence on what this query does, only when the title is not enough. Null otherwise.",
3241
+ "type": "string"
3242
+ },
3217
3243
  "limit": {
3218
3244
  "default": 500,
3219
3245
  "description": "Maximum number of rows this node returns. Defaults to 500, max 5000.",
@@ -3253,11 +3279,16 @@
3253
3279
  "sql": {
3254
3280
  "description": "DuckDB SQL over the referenced results. Each reference is exposed as a table; its columns are the upstream result columns.",
3255
3281
  "type": "string"
3282
+ },
3283
+ "title": {
3284
+ "description": "Short label a reader understands without seeing the query, two to five words, e.g. \"Revenue by month\". Shown to users instead of the node id.",
3285
+ "type": "string"
3256
3286
  }
3257
3287
  },
3258
3288
  "required": [
3259
3289
  "sourceType",
3260
3290
  "nodeId",
3291
+ "title",
3261
3292
  "sql",
3262
3293
  "references"
3263
3294
  ],
@@ -3265,6 +3296,10 @@
3265
3296
  },
3266
3297
  {
3267
3298
  "properties": {
3299
+ "description": {
3300
+ "description": "One sentence on what this query does, only when the title is not enough. Null otherwise.",
3301
+ "type": "string"
3302
+ },
3268
3303
  "limit": {
3269
3304
  "default": 500,
3270
3305
  "description": "Maximum number of rows this node returns. Defaults to 500, max 5000.",
@@ -3304,11 +3339,16 @@
3304
3339
  }
3305
3340
  ],
3306
3341
  "description": "External tables read by this query: an array of table names, or a map of {sqlAlias: tableNameOrTableUuid}. Prefer table UUIDs from attached-source context so renames cannot break the query."
3342
+ },
3343
+ "title": {
3344
+ "description": "Short label a reader understands without seeing the query, two to five words, e.g. \"Revenue by month\". Shown to users instead of the node id.",
3345
+ "type": "string"
3307
3346
  }
3308
3347
  },
3309
3348
  "required": [
3310
3349
  "sourceType",
3311
3350
  "nodeId",
3351
+ "title",
3312
3352
  "sql",
3313
3353
  "tables"
3314
3354
  ],
@@ -64,6 +64,10 @@ export type SemanticLayerSourceQuery = {
64
64
  sourceType: QuerySourceType.SEMANTIC_LAYER;
65
65
  /** Names this query so other queries in the same submission can reference its results. */
66
66
  nodeId?: QueryNodeId;
67
+ /** Plain-language label shown to users instead of the node id. Optional: the public query-sources API accepts and ignores it. */
68
+ title?: string;
69
+ /** One-line note on what this query does, shown under the title. */
70
+ description?: string;
67
71
  exploreName: string;
68
72
  /** Dimension field ids to group by, from the explore's schema. */
69
73
  dimensions: FieldId[];
@@ -104,6 +108,10 @@ export type SqlSourceQuery = {
104
108
  sourceType: QuerySourceType.SQL;
105
109
  /** Names this query so other queries in the same submission can reference its results. */
106
110
  nodeId?: QueryNodeId;
111
+ /** Plain-language label shown to users instead of the node id. Optional: the public query-sources API accepts and ignores it. */
112
+ title?: string;
113
+ /** One-line note on what this query does, shown under the title. */
114
+ description?: string;
107
115
  sql: string;
108
116
  limit?: number;
109
117
  /**
@@ -127,6 +135,10 @@ export type DuckdbSourceQuery = {
127
135
  sourceType: QuerySourceType.DUCKDB;
128
136
  /** Names this query so other queries in the same submission can reference its results. */
129
137
  nodeId?: QueryNodeId;
138
+ /** Plain-language label shown to users instead of the node id. Optional: the public query-sources API accepts and ignores it. */
139
+ title?: string;
140
+ /** One-line note on what this query does, shown under the title. */
141
+ description?: string;
130
142
  sql: string;
131
143
  limit?: number;
132
144
  /**
@@ -158,6 +170,10 @@ export type ExternalSourceQuery = {
158
170
  sourceType: QuerySourceType.EXTERNAL;
159
171
  /** Names this query so other queries in the same submission can reference its results. */
160
172
  nodeId?: QueryNodeId;
173
+ /** Plain-language label shown to users instead of the node id. Optional: the public query-sources API accepts and ignores it. */
174
+ title?: string;
175
+ /** One-line note on what this query does, shown under the title. */
176
+ description?: string;
161
177
  sql: string;
162
178
  limit?: number;
163
179
  tables: ExternalSourceTableReference[] | Record<QuerySourceTableName, ExternalSourceTableReference>;
@@ -1 +1 @@
1
- {"version":3,"file":"querySources.d.ts","sourceRoot":"","sources":["../../../src/types/querySources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EACH,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,OAAO,EACZ,KAAK,gBAAgB,EACxB,MAAM,SAAS,CAAC;AACjB,OAAO,EAC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MAAM,qBAAqB,GAAG;IAChC,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,EAAE,eAAe,CAAC;IAC5B,SAAS,EAAE,IAAI,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IACzC,OAAO,EAAE,qBAAqB,EAAE,CAAC;CACpC,CAAC;AAEF,8EAA8E;AAC9E,MAAM,MAAM,iBAAiB,GAAG;IAC5B,SAAS,EAAE,IAAI,CAAC;IAChB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IACzC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACrC,OAAO,EAAE,qBAAqB,EAAE,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,iBAAiB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash/common",
3
- "version": "2.315.0",
3
+ "version": "2.316.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",