@lightdash/common 1.229.0 → 1.230.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.
- package/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/ee/AiAgent/schemas/tools/toolComposerQueryArgs.d.ts +63 -3
- package/dist/cjs/ee/AiAgent/schemas/tools/toolComposerQueryArgs.d.ts.map +1 -1
- package/dist/cjs/ee/AiAgent/schemas/tools/toolComposerQueryArgs.js +22 -1
- package/dist/cjs/ee/AiAgent/schemas/tools/toolComposerQueryArgs.js.map +1 -1
- package/dist/cjs/schemas/json/mcp-tools-1.0.json +48 -1
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/ee/AiAgent/schemas/tools/toolComposerQueryArgs.d.ts +63 -3
- package/dist/esm/ee/AiAgent/schemas/tools/toolComposerQueryArgs.d.ts.map +1 -1
- package/dist/esm/ee/AiAgent/schemas/tools/toolComposerQueryArgs.js +22 -1
- package/dist/esm/ee/AiAgent/schemas/tools/toolComposerQueryArgs.js.map +1 -1
- package/dist/esm/schemas/json/mcp-tools-1.0.json +48 -1
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/ee/AiAgent/schemas/tools/toolComposerQueryArgs.d.ts +63 -3
- package/dist/types/ee/AiAgent/schemas/tools/toolComposerQueryArgs.d.ts.map +1 -1
- package/dist/types/ee/AiAgent/schemas/tools/toolComposerQueryArgs.js +22 -1
- package/dist/types/ee/AiAgent/schemas/tools/toolComposerQueryArgs.js.map +1 -1
- package/dist/types/schemas/json/mcp-tools-1.0.json +48 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { QuerySourceType, type DuckdbSourceQuery, type SemanticLayerSourceQuery, type SqlSourceQuery } from '../../../../types/querySources';
|
|
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 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- \"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 = "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 Google Sheets. 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-table context. Result columns are the SELECT output names. A single external node can read multiple external tables.\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.";
|
|
6
6
|
type CreateToolComposerQueriesArgsSchemaOptions = {
|
|
7
7
|
maxLimit?: number;
|
|
8
8
|
defaultLimit?: number;
|
|
@@ -105,6 +105,24 @@ export declare const createToolComposerQueriesArgsSchema: ({ maxLimit, defaultLi
|
|
|
105
105
|
sql: string;
|
|
106
106
|
references: string[] | Record<string, string>;
|
|
107
107
|
limit?: number | undefined;
|
|
108
|
+
}>, z.ZodObject<{
|
|
109
|
+
sourceType: z.ZodLiteral<QuerySourceType.EXTERNAL>;
|
|
110
|
+
nodeId: z.ZodString;
|
|
111
|
+
sql: z.ZodString;
|
|
112
|
+
tables: z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
113
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
114
|
+
}, "strip", z.ZodTypeAny, {
|
|
115
|
+
sourceType: QuerySourceType.EXTERNAL;
|
|
116
|
+
nodeId: string;
|
|
117
|
+
sql: string;
|
|
118
|
+
tables: string[] | Record<string, string>;
|
|
119
|
+
limit: number;
|
|
120
|
+
}, {
|
|
121
|
+
sourceType: QuerySourceType.EXTERNAL;
|
|
122
|
+
nodeId: string;
|
|
123
|
+
sql: string;
|
|
124
|
+
tables: string[] | Record<string, string>;
|
|
125
|
+
limit?: number | undefined;
|
|
108
126
|
}>]>, "many">;
|
|
109
127
|
terminalNodeId: z.ZodNullable<z.ZodString>;
|
|
110
128
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
@@ -137,6 +155,12 @@ export declare const createToolComposerQueriesArgsSchema: ({ maxLimit, defaultLi
|
|
|
137
155
|
sql: string;
|
|
138
156
|
references: string[] | Record<string, string>;
|
|
139
157
|
limit: number;
|
|
158
|
+
} | {
|
|
159
|
+
sourceType: QuerySourceType.EXTERNAL;
|
|
160
|
+
nodeId: string;
|
|
161
|
+
sql: string;
|
|
162
|
+
tables: string[] | Record<string, string>;
|
|
163
|
+
limit: number;
|
|
140
164
|
})[];
|
|
141
165
|
terminalNodeId: string | null;
|
|
142
166
|
}, {
|
|
@@ -169,6 +193,12 @@ export declare const createToolComposerQueriesArgsSchema: ({ maxLimit, defaultLi
|
|
|
169
193
|
sql: string;
|
|
170
194
|
references: string[] | Record<string, string>;
|
|
171
195
|
limit?: number | undefined;
|
|
196
|
+
} | {
|
|
197
|
+
sourceType: QuerySourceType.EXTERNAL;
|
|
198
|
+
nodeId: string;
|
|
199
|
+
sql: string;
|
|
200
|
+
tables: string[] | Record<string, string>;
|
|
201
|
+
limit?: number | undefined;
|
|
172
202
|
})[];
|
|
173
203
|
terminalNodeId: string | null;
|
|
174
204
|
}>;
|
|
@@ -270,6 +300,24 @@ export declare const toolComposerQueriesArgsSchema: z.ZodObject<{
|
|
|
270
300
|
sql: string;
|
|
271
301
|
references: string[] | Record<string, string>;
|
|
272
302
|
limit?: number | undefined;
|
|
303
|
+
}>, z.ZodObject<{
|
|
304
|
+
sourceType: z.ZodLiteral<QuerySourceType.EXTERNAL>;
|
|
305
|
+
nodeId: z.ZodString;
|
|
306
|
+
sql: z.ZodString;
|
|
307
|
+
tables: z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
308
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
309
|
+
}, "strip", z.ZodTypeAny, {
|
|
310
|
+
sourceType: QuerySourceType.EXTERNAL;
|
|
311
|
+
nodeId: string;
|
|
312
|
+
sql: string;
|
|
313
|
+
tables: string[] | Record<string, string>;
|
|
314
|
+
limit: number;
|
|
315
|
+
}, {
|
|
316
|
+
sourceType: QuerySourceType.EXTERNAL;
|
|
317
|
+
nodeId: string;
|
|
318
|
+
sql: string;
|
|
319
|
+
tables: string[] | Record<string, string>;
|
|
320
|
+
limit?: number | undefined;
|
|
273
321
|
}>]>, "many">;
|
|
274
322
|
terminalNodeId: z.ZodNullable<z.ZodString>;
|
|
275
323
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
@@ -302,6 +350,12 @@ export declare const toolComposerQueriesArgsSchema: z.ZodObject<{
|
|
|
302
350
|
sql: string;
|
|
303
351
|
references: string[] | Record<string, string>;
|
|
304
352
|
limit: number;
|
|
353
|
+
} | {
|
|
354
|
+
sourceType: QuerySourceType.EXTERNAL;
|
|
355
|
+
nodeId: string;
|
|
356
|
+
sql: string;
|
|
357
|
+
tables: string[] | Record<string, string>;
|
|
358
|
+
limit: number;
|
|
305
359
|
})[];
|
|
306
360
|
terminalNodeId: string | null;
|
|
307
361
|
}, {
|
|
@@ -334,6 +388,12 @@ export declare const toolComposerQueriesArgsSchema: z.ZodObject<{
|
|
|
334
388
|
sql: string;
|
|
335
389
|
references: string[] | Record<string, string>;
|
|
336
390
|
limit?: number | undefined;
|
|
391
|
+
} | {
|
|
392
|
+
sourceType: QuerySourceType.EXTERNAL;
|
|
393
|
+
nodeId: string;
|
|
394
|
+
sql: string;
|
|
395
|
+
tables: string[] | Record<string, string>;
|
|
396
|
+
limit?: number | undefined;
|
|
337
397
|
})[];
|
|
338
398
|
terminalNodeId: string | null;
|
|
339
399
|
}>;
|
|
@@ -343,7 +403,7 @@ export type ToolComposerQueryNode = z.infer<typeof toolComposerQueriesArgsSchema
|
|
|
343
403
|
* query source service takes. The explicit return types pin drift at compile
|
|
344
404
|
* time: if types/querySources.ts changes incompatibly, this stops compiling.
|
|
345
405
|
*/
|
|
346
|
-
export declare const toolComposerQueryNodeToSourceQuery: (node: ToolComposerQueryNode) => SemanticLayerSourceQuery | SqlSourceQuery | DuckdbSourceQuery;
|
|
406
|
+
export declare const toolComposerQueryNodeToSourceQuery: (node: ToolComposerQueryNode) => SemanticLayerSourceQuery | SqlSourceQuery | DuckdbSourceQuery | ExternalSourceQuery;
|
|
347
407
|
export declare const toolComposerQueriesOutputSchema: z.ZodObject<{
|
|
348
408
|
result: z.ZodString;
|
|
349
409
|
metadata: z.ZodObject<{
|
|
@@ -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,wBAAwB,EAC7B,KAAK,cAAc,EACtB,MAAM,gCAAgC,CAAC;AAIxC,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAChD,eAAO,MAAM,gCAAgC,OAAO,CAAC;AAErD,eAAO,MAAM,iCAAiC,
|
|
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,qsGAkBsD,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiH5C,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EACD,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;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;EAK1C,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"}
|
|
@@ -6,12 +6,13 @@ export const DEFAULT_COMPOSER_QUERY_LIMIT = 500;
|
|
|
6
6
|
export const DEFAULT_COMPOSER_QUERY_MAX_LIMIT = 5000;
|
|
7
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.
|
|
8
8
|
|
|
9
|
-
Use this tool when a single source cannot answer the question — e.g. joining a semantic layer metric query 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
|
+
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.
|
|
10
10
|
|
|
11
11
|
How to build a pipeline:
|
|
12
12
|
- Every query is a node. Name each node with "nodeId" (letters, digits, underscores; starting with a letter or underscore).
|
|
13
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
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 Google Sheets. 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-table context. Result columns are the SELECT output names. A single external node can read multiple external tables.
|
|
15
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.
|
|
16
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.
|
|
17
18
|
|
|
@@ -85,10 +86,22 @@ export const createToolComposerQueriesArgsSchema = ({ maxLimit = DEFAULT_COMPOSE
|
|
|
85
86
|
.describe('Which query results the SQL reads. Shorthand array of node ids from this submission (each exposed as a table named by its node id), or a map of {tableName: nodeIdOrQueryUuid} for aliasing or reusing stored results from earlier calls without re-running them.'),
|
|
86
87
|
limit: limitSchema,
|
|
87
88
|
});
|
|
89
|
+
const externalNodeSchema = z.object({
|
|
90
|
+
sourceType: z.literal(QuerySourceType.EXTERNAL),
|
|
91
|
+
nodeId: nodeIdSchema,
|
|
92
|
+
sql: z
|
|
93
|
+
.string()
|
|
94
|
+
.describe('DuckDB SQL over the declared external source tables. Each table is exposed under its name or map alias.'),
|
|
95
|
+
tables: z
|
|
96
|
+
.union([z.array(z.string()), z.record(z.string(), z.string())])
|
|
97
|
+
.describe('External tables read by this query: an array of table names, or a map of {sqlAlias: tableNameOrTableUuid}. Prefer the table UUID from attached-table context so renames cannot break the query.'),
|
|
98
|
+
limit: limitSchema,
|
|
99
|
+
});
|
|
88
100
|
const sourceQueryNodeSchema = z.discriminatedUnion('sourceType', [
|
|
89
101
|
semanticLayerNodeSchema,
|
|
90
102
|
sqlNodeSchema,
|
|
91
103
|
duckdbNodeSchema,
|
|
104
|
+
externalNodeSchema,
|
|
92
105
|
]);
|
|
93
106
|
return createToolSchema()
|
|
94
107
|
.extend({
|
|
@@ -148,6 +161,14 @@ export const toolComposerQueryNodeToSourceQuery = (node) => {
|
|
|
148
161
|
references: node.references,
|
|
149
162
|
limit: node.limit,
|
|
150
163
|
};
|
|
164
|
+
case QuerySourceType.EXTERNAL:
|
|
165
|
+
return {
|
|
166
|
+
sourceType: node.sourceType,
|
|
167
|
+
nodeId: node.nodeId,
|
|
168
|
+
sql: node.sql,
|
|
169
|
+
tables: node.tables,
|
|
170
|
+
limit: node.limit,
|
|
171
|
+
};
|
|
151
172
|
default:
|
|
152
173
|
return assertUnreachable(node, 'Unknown composer query node');
|
|
153
174
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolComposerQueryArgs.js","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolComposerQueryArgs.ts"],"names":[],"mappings":"AAAA,OA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C,UAAU;gBAC3B,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,KAAK,EAAE,IAAI,CAAC,KAAK;aACpB,CAAC;QACN,KAAK,eAAe,CAAC,QAAQ;YACzB,OAAO;gBACH,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,KAAK,EAAE,IAAI,CAAC,KAAK;aACpB,CAAC;QACN;YACI,OAAO,iBAAiB,CAAC,IAAI,EAAE,6BAA6B,CAAC,CAAC;IACtE,CAAC;AACL,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"}
|
|
@@ -2498,7 +2498,7 @@
|
|
|
2498
2498
|
"openWorldHint": false,
|
|
2499
2499
|
"readOnlyHint": true
|
|
2500
2500
|
},
|
|
2501
|
-
"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 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- \"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.",
|
|
2501
|
+
"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 Google Sheets. 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-table context. Result columns are the SELECT output names. A single external node can read multiple external tables.\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.",
|
|
2502
2502
|
"inputSchema": {
|
|
2503
2503
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
2504
2504
|
"additionalProperties": false,
|
|
@@ -2661,6 +2661,53 @@
|
|
|
2661
2661
|
"references"
|
|
2662
2662
|
],
|
|
2663
2663
|
"type": "object"
|
|
2664
|
+
},
|
|
2665
|
+
{
|
|
2666
|
+
"additionalProperties": false,
|
|
2667
|
+
"properties": {
|
|
2668
|
+
"limit": {
|
|
2669
|
+
"$ref": "#/properties/queries/items/anyOf/0/properties/limit",
|
|
2670
|
+
"default": 500,
|
|
2671
|
+
"description": "Maximum number of rows this node returns. Defaults to 500, max 5000."
|
|
2672
|
+
},
|
|
2673
|
+
"nodeId": {
|
|
2674
|
+
"description": "Names this query so other queries in the same submission can reference its results. Also the DuckDB table name its results are exposed as.",
|
|
2675
|
+
"pattern": "^[a-zA-Z_][a-zA-Z0-9_]{0,62}$",
|
|
2676
|
+
"type": "string"
|
|
2677
|
+
},
|
|
2678
|
+
"sourceType": {
|
|
2679
|
+
"const": "external",
|
|
2680
|
+
"type": "string"
|
|
2681
|
+
},
|
|
2682
|
+
"sql": {
|
|
2683
|
+
"description": "DuckDB SQL over the declared external source tables. Each table is exposed under its name or map alias.",
|
|
2684
|
+
"type": "string"
|
|
2685
|
+
},
|
|
2686
|
+
"tables": {
|
|
2687
|
+
"anyOf": [
|
|
2688
|
+
{
|
|
2689
|
+
"items": {
|
|
2690
|
+
"type": "string"
|
|
2691
|
+
},
|
|
2692
|
+
"type": "array"
|
|
2693
|
+
},
|
|
2694
|
+
{
|
|
2695
|
+
"additionalProperties": {
|
|
2696
|
+
"type": "string"
|
|
2697
|
+
},
|
|
2698
|
+
"type": "object"
|
|
2699
|
+
}
|
|
2700
|
+
],
|
|
2701
|
+
"description": "External tables read by this query: an array of table names, or a map of {sqlAlias: tableNameOrTableUuid}. Prefer the table UUID from attached-table context so renames cannot break the query."
|
|
2702
|
+
}
|
|
2703
|
+
},
|
|
2704
|
+
"required": [
|
|
2705
|
+
"sourceType",
|
|
2706
|
+
"nodeId",
|
|
2707
|
+
"sql",
|
|
2708
|
+
"tables"
|
|
2709
|
+
],
|
|
2710
|
+
"type": "object"
|
|
2664
2711
|
}
|
|
2665
2712
|
]
|
|
2666
2713
|
},
|