@lightdash/common 0.2044.0 → 0.2046.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/ee/AiAgent/schemas/tools/toolProposeChange.d.ts +1 -1
- package/dist/cjs/ee/AiAgent/schemas/tools/toolProposeChange.d.ts.map +1 -1
- package/dist/cjs/ee/AiAgent/schemas/tools/toolProposeChange.js +3 -3
- package/dist/cjs/types/changeset.d.ts +221 -12
- package/dist/cjs/types/changeset.d.ts.map +1 -1
- package/dist/cjs/types/changeset.js +17 -2
- package/dist/cjs/types/changeset.js.map +1 -1
- package/dist/esm/ee/AiAgent/schemas/tools/toolProposeChange.d.ts +1 -1
- package/dist/esm/ee/AiAgent/schemas/tools/toolProposeChange.d.ts.map +1 -1
- package/dist/esm/ee/AiAgent/schemas/tools/toolProposeChange.js +3 -3
- package/dist/esm/types/changeset.d.ts +221 -12
- package/dist/esm/types/changeset.d.ts.map +1 -1
- package/dist/esm/types/changeset.js +17 -2
- package/dist/esm/types/changeset.js.map +1 -1
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/ee/AiAgent/schemas/tools/toolProposeChange.d.ts +1 -1
- package/dist/types/ee/AiAgent/schemas/tools/toolProposeChange.d.ts.map +1 -1
- package/dist/types/types/changeset.d.ts +221 -12
- package/dist/types/types/changeset.d.ts.map +1 -1
- package/package.json +1 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
import { z } from 'zod';
|
2
2
|
import { type Dimension, type Metric, type Table } from '../../../..';
|
3
3
|
import { AiResultType } from '../../types';
|
4
|
-
export declare const TOOL_PROPOSE_CHANGE_DESCRIPTION = "\nUse this tool to propose changes to a table's metadata in the semantic layer. This tool creates a change proposal that can be reviewed and approved before being applied.\n\n- When updating descriptions, ensure to preserve as much original content as possible. Remember that descriptions are enclosed in \"description\" tags and you should take the whole value into account as well as its format.\n- If modifying tables, _always_ use the findExplores tool to check existing descriptions before proposing changes to ensure no important content is removed.\n- If modifying metrics or dimensions, _always_ use the findFields tool to check existing descriptions before proposing changes to ensure no important content is removed.\n- If creating a new metric, _always_ use the findFields tool to check existing metrics before proposing changes to ensure no content is duplicated.\n\n- **When to use the Propose Change Tool:**\n - User requests to update a table description: \"Update the description of the customers table\"\n - User wants to improve a dimension description: \"Add a better description for the customer_name field\"\n - User asks to clarify a metric description: \"Update the total_revenue metric description to explain it's net revenue\"\n - User wants to document business logic in descriptions: \"Add a note that active_users excludes test accounts\"\n\n- **What this tool does:**\n - Creates a change proposal
|
4
|
+
export declare const TOOL_PROPOSE_CHANGE_DESCRIPTION = "\nUse this tool to propose changes to a table's metadata in the semantic layer. This tool creates a change proposal that can be reviewed and approved before being applied.\n\n- When updating descriptions, ensure to preserve as much original content as possible. Remember that descriptions are enclosed in \"description\" tags and you should take the whole value into account as well as its format.\n- If modifying tables, _always_ use the findExplores tool to check existing descriptions before proposing changes to ensure no important content is removed.\n- If modifying metrics or dimensions, _always_ use the findFields tool to check existing descriptions before proposing changes to ensure no important content is removed.\n- If creating a new metric, _always_ use the findFields tool to check existing metrics before proposing changes to ensure no content is duplicated.\n\n- **When to use the Propose Change Tool:**\n - User requests to update a table description: \"Update the description of the customers table\"\n - User wants to improve a dimension description: \"Add a better description for the customer_name field\"\n - User asks to clarify a metric description: \"Update the total_revenue metric description to explain it's net revenue\"\n - User wants to document business logic in descriptions: \"Add a note that active_users excludes test accounts\"\n\n- **What this tool does:**\n - Creates a change proposal and applies it to a changeset (batch of changes)\n - Changes are applied immediately but can be reviewed and rejected afterward\n - Supports updating descriptions for tables, dimensions, and metrics\n - Supports creating new metrics\n - Tracks who proposed the change and when\n - Applied changes can be reviewed and rejected by authorized users\n\n- **Examples:**\n\n User: \"Update the customers table description to mention it includes both B2B and B2C customers\"\n User: \"The revenue_net field should explain it's after taxes and discounts\"\n User: \"Create a new metric called 'Median Order Amount' that calculates the median order amount\"\n";
|
5
5
|
type ChangePatch<T> = Partial<Record<keyof T, z.ZodType>>;
|
6
6
|
declare const stringOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
|
7
7
|
op: z.ZodLiteral<"replace">;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"toolProposeChange.d.ts","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolProposeChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,MAAM,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAS3C,eAAO,MAAM,+BAA+B,
|
1
|
+
{"version":3,"file":"toolProposeChange.d.ts","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolProposeChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,MAAM,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAS3C,eAAO,MAAM,+BAA+B,+iEA2B3C,CAAC;AAMF,KAAK,WAAW,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AAoC1D,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;IAA0B,CAAC;AAqF/C,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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riptions: "Add a note that active_users excludes test accounts"
|
25
25
|
|
26
26
|
- **What this tool does:**
|
27
|
-
- Creates a change proposal
|
28
|
-
-
|
27
|
+
- Creates a change proposal and applies it to a changeset (batch of changes)
|
28
|
+
- Changes are applied immediately but can be reviewed and rejected afterward
|
29
29
|
- Supports updating descriptions for tables, dimensions, and metrics
|
30
30
|
- Supports creating new metrics
|
31
31
|
- Tracks who proposed the change and when
|
32
|
-
-
|
32
|
+
- Applied changes can be reviewed and rejected by authorized users
|
33
33
|
|
34
34
|
- **Examples:**
|
35
35
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { z } from 'zod';
|
2
|
+
import { FieldType, MetricType } from './field';
|
2
3
|
export declare const ChangesetSchema: z.ZodObject<{
|
3
4
|
changesetUuid: z.ZodString;
|
4
5
|
createdAt: z.ZodDate;
|
@@ -58,25 +59,116 @@ export declare const ChangeSchema: z.ZodIntersection<z.ZodObject<{
|
|
58
59
|
type: z.ZodLiteral<"create">;
|
59
60
|
payload: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
60
61
|
type: z.ZodLiteral<"metric">;
|
61
|
-
value: z.
|
62
|
+
value: z.ZodObject<{
|
63
|
+
fieldType: z.ZodLiteral<FieldType.METRIC>;
|
64
|
+
type: z.ZodNativeEnum<typeof MetricType>;
|
65
|
+
name: z.ZodString;
|
66
|
+
label: z.ZodString;
|
67
|
+
table: z.ZodString;
|
68
|
+
tableLabel: z.ZodString;
|
69
|
+
sql: z.ZodString;
|
70
|
+
description: z.ZodOptional<z.ZodString>;
|
71
|
+
hidden: z.ZodBoolean;
|
72
|
+
compiledSql: z.ZodString;
|
73
|
+
tablesReferences: z.ZodArray<z.ZodString, "many">;
|
74
|
+
tablesRequiredAttributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
76
|
+
name: string;
|
77
|
+
label: string;
|
78
|
+
sql: string;
|
79
|
+
table: string;
|
80
|
+
fieldType: FieldType.METRIC;
|
81
|
+
type: MetricType;
|
82
|
+
tableLabel: string;
|
83
|
+
hidden: boolean;
|
84
|
+
compiledSql: string;
|
85
|
+
tablesReferences: string[];
|
86
|
+
description?: string | undefined;
|
87
|
+
tablesRequiredAttributes?: Record<string, Record<string, string>> | undefined;
|
88
|
+
}, {
|
89
|
+
name: string;
|
90
|
+
label: string;
|
91
|
+
sql: string;
|
92
|
+
table: string;
|
93
|
+
fieldType: FieldType.METRIC;
|
94
|
+
type: MetricType;
|
95
|
+
tableLabel: string;
|
96
|
+
hidden: boolean;
|
97
|
+
compiledSql: string;
|
98
|
+
tablesReferences: string[];
|
99
|
+
description?: string | undefined;
|
100
|
+
tablesRequiredAttributes?: Record<string, Record<string, string>> | undefined;
|
101
|
+
}>;
|
62
102
|
}, "strip", z.ZodTypeAny, {
|
103
|
+
value: {
|
104
|
+
name: string;
|
105
|
+
label: string;
|
106
|
+
sql: string;
|
107
|
+
table: string;
|
108
|
+
fieldType: FieldType.METRIC;
|
109
|
+
type: MetricType;
|
110
|
+
tableLabel: string;
|
111
|
+
hidden: boolean;
|
112
|
+
compiledSql: string;
|
113
|
+
tablesReferences: string[];
|
114
|
+
description?: string | undefined;
|
115
|
+
tablesRequiredAttributes?: Record<string, Record<string, string>> | undefined;
|
116
|
+
};
|
63
117
|
type: "metric";
|
64
|
-
value?: unknown;
|
65
118
|
}, {
|
119
|
+
value: {
|
120
|
+
name: string;
|
121
|
+
label: string;
|
122
|
+
sql: string;
|
123
|
+
table: string;
|
124
|
+
fieldType: FieldType.METRIC;
|
125
|
+
type: MetricType;
|
126
|
+
tableLabel: string;
|
127
|
+
hidden: boolean;
|
128
|
+
compiledSql: string;
|
129
|
+
tablesReferences: string[];
|
130
|
+
description?: string | undefined;
|
131
|
+
tablesRequiredAttributes?: Record<string, Record<string, string>> | undefined;
|
132
|
+
};
|
66
133
|
type: "metric";
|
67
|
-
value?: unknown;
|
68
134
|
}>]>;
|
69
135
|
}, "strip", z.ZodTypeAny, {
|
70
136
|
type: "create";
|
71
137
|
payload: {
|
138
|
+
value: {
|
139
|
+
name: string;
|
140
|
+
label: string;
|
141
|
+
sql: string;
|
142
|
+
table: string;
|
143
|
+
fieldType: FieldType.METRIC;
|
144
|
+
type: MetricType;
|
145
|
+
tableLabel: string;
|
146
|
+
hidden: boolean;
|
147
|
+
compiledSql: string;
|
148
|
+
tablesReferences: string[];
|
149
|
+
description?: string | undefined;
|
150
|
+
tablesRequiredAttributes?: Record<string, Record<string, string>> | undefined;
|
151
|
+
};
|
72
152
|
type: "metric";
|
73
|
-
value?: unknown;
|
74
153
|
};
|
75
154
|
}, {
|
76
155
|
type: "create";
|
77
156
|
payload: {
|
157
|
+
value: {
|
158
|
+
name: string;
|
159
|
+
label: string;
|
160
|
+
sql: string;
|
161
|
+
table: string;
|
162
|
+
fieldType: FieldType.METRIC;
|
163
|
+
type: MetricType;
|
164
|
+
tableLabel: string;
|
165
|
+
hidden: boolean;
|
166
|
+
compiledSql: string;
|
167
|
+
tablesReferences: string[];
|
168
|
+
description?: string | undefined;
|
169
|
+
tablesRequiredAttributes?: Record<string, Record<string, string>> | undefined;
|
170
|
+
};
|
78
171
|
type: "metric";
|
79
|
-
value?: unknown;
|
80
172
|
};
|
81
173
|
}>, z.ZodObject<{
|
82
174
|
type: z.ZodLiteral<"update">;
|
@@ -176,25 +268,116 @@ export declare const ChangesetWithChangesSchema: z.ZodObject<{
|
|
176
268
|
type: z.ZodLiteral<"create">;
|
177
269
|
payload: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
178
270
|
type: z.ZodLiteral<"metric">;
|
179
|
-
value: z.
|
271
|
+
value: z.ZodObject<{
|
272
|
+
fieldType: z.ZodLiteral<FieldType.METRIC>;
|
273
|
+
type: z.ZodNativeEnum<typeof MetricType>;
|
274
|
+
name: z.ZodString;
|
275
|
+
label: z.ZodString;
|
276
|
+
table: z.ZodString;
|
277
|
+
tableLabel: z.ZodString;
|
278
|
+
sql: z.ZodString;
|
279
|
+
description: z.ZodOptional<z.ZodString>;
|
280
|
+
hidden: z.ZodBoolean;
|
281
|
+
compiledSql: z.ZodString;
|
282
|
+
tablesReferences: z.ZodArray<z.ZodString, "many">;
|
283
|
+
tablesRequiredAttributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
|
284
|
+
}, "strip", z.ZodTypeAny, {
|
285
|
+
name: string;
|
286
|
+
label: string;
|
287
|
+
sql: string;
|
288
|
+
table: string;
|
289
|
+
fieldType: FieldType.METRIC;
|
290
|
+
type: MetricType;
|
291
|
+
tableLabel: string;
|
292
|
+
hidden: boolean;
|
293
|
+
compiledSql: string;
|
294
|
+
tablesReferences: string[];
|
295
|
+
description?: string | undefined;
|
296
|
+
tablesRequiredAttributes?: Record<string, Record<string, string>> | undefined;
|
297
|
+
}, {
|
298
|
+
name: string;
|
299
|
+
label: string;
|
300
|
+
sql: string;
|
301
|
+
table: string;
|
302
|
+
fieldType: FieldType.METRIC;
|
303
|
+
type: MetricType;
|
304
|
+
tableLabel: string;
|
305
|
+
hidden: boolean;
|
306
|
+
compiledSql: string;
|
307
|
+
tablesReferences: string[];
|
308
|
+
description?: string | undefined;
|
309
|
+
tablesRequiredAttributes?: Record<string, Record<string, string>> | undefined;
|
310
|
+
}>;
|
180
311
|
}, "strip", z.ZodTypeAny, {
|
312
|
+
value: {
|
313
|
+
name: string;
|
314
|
+
label: string;
|
315
|
+
sql: string;
|
316
|
+
table: string;
|
317
|
+
fieldType: FieldType.METRIC;
|
318
|
+
type: MetricType;
|
319
|
+
tableLabel: string;
|
320
|
+
hidden: boolean;
|
321
|
+
compiledSql: string;
|
322
|
+
tablesReferences: string[];
|
323
|
+
description?: string | undefined;
|
324
|
+
tablesRequiredAttributes?: Record<string, Record<string, string>> | undefined;
|
325
|
+
};
|
181
326
|
type: "metric";
|
182
|
-
value?: unknown;
|
183
327
|
}, {
|
328
|
+
value: {
|
329
|
+
name: string;
|
330
|
+
label: string;
|
331
|
+
sql: string;
|
332
|
+
table: string;
|
333
|
+
fieldType: FieldType.METRIC;
|
334
|
+
type: MetricType;
|
335
|
+
tableLabel: string;
|
336
|
+
hidden: boolean;
|
337
|
+
compiledSql: string;
|
338
|
+
tablesReferences: string[];
|
339
|
+
description?: string | undefined;
|
340
|
+
tablesRequiredAttributes?: Record<string, Record<string, string>> | undefined;
|
341
|
+
};
|
184
342
|
type: "metric";
|
185
|
-
value?: unknown;
|
186
343
|
}>]>;
|
187
344
|
}, "strip", z.ZodTypeAny, {
|
188
345
|
type: "create";
|
189
346
|
payload: {
|
347
|
+
value: {
|
348
|
+
name: string;
|
349
|
+
label: string;
|
350
|
+
sql: string;
|
351
|
+
table: string;
|
352
|
+
fieldType: FieldType.METRIC;
|
353
|
+
type: MetricType;
|
354
|
+
tableLabel: string;
|
355
|
+
hidden: boolean;
|
356
|
+
compiledSql: string;
|
357
|
+
tablesReferences: string[];
|
358
|
+
description?: string | undefined;
|
359
|
+
tablesRequiredAttributes?: Record<string, Record<string, string>> | undefined;
|
360
|
+
};
|
190
361
|
type: "metric";
|
191
|
-
value?: unknown;
|
192
362
|
};
|
193
363
|
}, {
|
194
364
|
type: "create";
|
195
365
|
payload: {
|
366
|
+
value: {
|
367
|
+
name: string;
|
368
|
+
label: string;
|
369
|
+
sql: string;
|
370
|
+
table: string;
|
371
|
+
fieldType: FieldType.METRIC;
|
372
|
+
type: MetricType;
|
373
|
+
tableLabel: string;
|
374
|
+
hidden: boolean;
|
375
|
+
compiledSql: string;
|
376
|
+
tablesReferences: string[];
|
377
|
+
description?: string | undefined;
|
378
|
+
tablesRequiredAttributes?: Record<string, Record<string, string>> | undefined;
|
379
|
+
};
|
196
380
|
type: "metric";
|
197
|
-
value?: unknown;
|
198
381
|
};
|
199
382
|
}>, z.ZodObject<{
|
200
383
|
type: z.ZodLiteral<"update">;
|
@@ -274,8 +457,21 @@ export declare const ChangesetWithChangesSchema: z.ZodObject<{
|
|
274
457
|
} & ({
|
275
458
|
type: "create";
|
276
459
|
payload: {
|
460
|
+
value: {
|
461
|
+
name: string;
|
462
|
+
label: string;
|
463
|
+
sql: string;
|
464
|
+
table: string;
|
465
|
+
fieldType: FieldType.METRIC;
|
466
|
+
type: MetricType;
|
467
|
+
tableLabel: string;
|
468
|
+
hidden: boolean;
|
469
|
+
compiledSql: string;
|
470
|
+
tablesReferences: string[];
|
471
|
+
description?: string | undefined;
|
472
|
+
tablesRequiredAttributes?: Record<string, Record<string, string>> | undefined;
|
473
|
+
};
|
277
474
|
type: "metric";
|
278
|
-
value?: unknown;
|
279
475
|
};
|
280
476
|
} | {
|
281
477
|
type: "update";
|
@@ -311,8 +507,21 @@ export declare const ChangesetWithChangesSchema: z.ZodObject<{
|
|
311
507
|
} & ({
|
312
508
|
type: "create";
|
313
509
|
payload: {
|
510
|
+
value: {
|
511
|
+
name: string;
|
512
|
+
label: string;
|
513
|
+
sql: string;
|
514
|
+
table: string;
|
515
|
+
fieldType: FieldType.METRIC;
|
516
|
+
type: MetricType;
|
517
|
+
tableLabel: string;
|
518
|
+
hidden: boolean;
|
519
|
+
compiledSql: string;
|
520
|
+
tablesReferences: string[];
|
521
|
+
description?: string | undefined;
|
522
|
+
tablesRequiredAttributes?: Record<string, Record<string, string>> | undefined;
|
523
|
+
};
|
314
524
|
type: "metric";
|
315
|
-
value?: unknown;
|
316
525
|
};
|
317
526
|
} | {
|
318
527
|
type: "update";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"changeset.d.ts","sourceRoot":"","sources":["../../../src/types/changeset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
1
|
+
{"version":3,"file":"changeset.d.ts","sourceRoot":"","sources":["../../../src/types/changeset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIhD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AS,CACd,CAAC;AAGF,KAAK,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnD,MAAM,MAAM,+BAA+B,GAAG;IAC1C,MAAM,EAAE,IAAI,CAAC;IACb,OAAO,EAAE,mBAAmB,EAAE,CAAC;CAClC,CAAC"}
|
@@ -2,6 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.ChangesetWithChangesSchema = exports.ChangeSchema = exports.ChangesetSchema = void 0;
|
4
4
|
const zod_1 = require("zod");
|
5
|
+
const field_1 = require("./field");
|
5
6
|
const ChangesetStatusSchema = zod_1.z.enum(['draft', 'applied']);
|
6
7
|
exports.ChangesetSchema = zod_1.z.object({
|
7
8
|
changesetUuid: zod_1.z.string().uuid(),
|
@@ -30,8 +31,22 @@ exports.ChangeSchema = zod_1.z
|
|
30
31
|
payload: zod_1.z.discriminatedUnion('type', [
|
31
32
|
zod_1.z.object({
|
32
33
|
type: zod_1.z.literal('metric'),
|
33
|
-
|
34
|
-
|
34
|
+
value: zod_1.z.object({
|
35
|
+
fieldType: zod_1.z.literal(field_1.FieldType.METRIC),
|
36
|
+
type: zod_1.z.nativeEnum(field_1.MetricType),
|
37
|
+
name: zod_1.z.string(),
|
38
|
+
label: zod_1.z.string(),
|
39
|
+
table: zod_1.z.string(),
|
40
|
+
tableLabel: zod_1.z.string(), // Table friendly name
|
41
|
+
sql: zod_1.z.string(), // Templated sql
|
42
|
+
description: zod_1.z.string().optional(),
|
43
|
+
hidden: zod_1.z.boolean(),
|
44
|
+
compiledSql: zod_1.z.string(),
|
45
|
+
tablesReferences: zod_1.z.array(zod_1.z.string()),
|
46
|
+
tablesRequiredAttributes: zod_1.z
|
47
|
+
.record(zod_1.z.string(), zod_1.z.record(zod_1.z.string(), zod_1.z.string()))
|
48
|
+
.optional(),
|
49
|
+
}),
|
35
50
|
}),
|
36
51
|
]),
|
37
52
|
}),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"changeset.js","sourceRoot":"","sources":["../../../src/types/changeset.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;
|
1
|
+
{"version":3,"file":"changeset.js","sourceRoot":"","sources":["../../../src/types/changeset.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,mCAAgD;AAEhD,MAAM,qBAAqB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;AAE9C,QAAA,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IACpC,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAChC,SAAS,EAAE,OAAC,CAAC,IAAI,EAAE;IACnB,SAAS,EAAE,OAAC,CAAC,IAAI,EAAE;IACnB,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACpC,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACpC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC9B,MAAM,EAAE,qBAAqB;IAC7B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC1B,CAAC,CAAC;AAEU,QAAA,YAAY,GAAG,OAAC;KACxB,MAAM,CAAC;IACJ,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC7B,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAChC,SAAS,EAAE,OAAC,CAAC,IAAI,EAAE;IACnB,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACpC,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAC9C,UAAU,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,CA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E,CAAC,CACnC;yBACA,QAAQ,EAAE;iBAClB,CAAC;aACL,CAAC;SACL,CAAC;KACL,CAAC;IACF,OAAC,CAAC,MAAM,CAAC;QACL,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;QACzB,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC;YACd,OAAO,EAAE,OAAC,CAAC,KAAK,CACZ,OAAC,CAAC,MAAM,CAAC;gBACL,EAAE,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;gBAC9B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;gBAChB,KAAK,EAAE,OAAC;qBACH,OAAO,EAAE;qBACT,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC;aAC9C,CAAC,CACL;SACJ,CAAC;KACL,CAAC;IACF,OAAC,CAAC,MAAM,CAAC;QACL,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;QACzB,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC;KACxB,CAAC;CACL,CAAC,CACL,CAAC;AAEO,QAAA,0BAA0B,GAAG,uBAAe,CAAC,MAAM,CAAC;IAC7D,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,oBAAY,CAAC;CACjC,CAAC,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { z } from 'zod';
|
2
2
|
import { type Dimension, type Metric, type Table } from '../../../..';
|
3
3
|
import { AiResultType } from '../../types';
|
4
|
-
export declare const TOOL_PROPOSE_CHANGE_DESCRIPTION = "\nUse this tool to propose changes to a table's metadata in the semantic layer. This tool creates a change proposal that can be reviewed and approved before being applied.\n\n- When updating descriptions, ensure to preserve as much original content as possible. Remember that descriptions are enclosed in \"description\" tags and you should take the whole value into account as well as its format.\n- If modifying tables, _always_ use the findExplores tool to check existing descriptions before proposing changes to ensure no important content is removed.\n- If modifying metrics or dimensions, _always_ use the findFields tool to check existing descriptions before proposing changes to ensure no important content is removed.\n- If creating a new metric, _always_ use the findFields tool to check existing metrics before proposing changes to ensure no content is duplicated.\n\n- **When to use the Propose Change Tool:**\n - User requests to update a table description: \"Update the description of the customers table\"\n - User wants to improve a dimension description: \"Add a better description for the customer_name field\"\n - User asks to clarify a metric description: \"Update the total_revenue metric description to explain it's net revenue\"\n - User wants to document business logic in descriptions: \"Add a note that active_users excludes test accounts\"\n\n- **What this tool does:**\n - Creates a change proposal
|
4
|
+
export declare const TOOL_PROPOSE_CHANGE_DESCRIPTION = "\nUse this tool to propose changes to a table's metadata in the semantic layer. This tool creates a change proposal that can be reviewed and approved before being applied.\n\n- When updating descriptions, ensure to preserve as much original content as possible. Remember that descriptions are enclosed in \"description\" tags and you should take the whole value into account as well as its format.\n- If modifying tables, _always_ use the findExplores tool to check existing descriptions before proposing changes to ensure no important content is removed.\n- If modifying metrics or dimensions, _always_ use the findFields tool to check existing descriptions before proposing changes to ensure no important content is removed.\n- If creating a new metric, _always_ use the findFields tool to check existing metrics before proposing changes to ensure no content is duplicated.\n\n- **When to use the Propose Change Tool:**\n - User requests to update a table description: \"Update the description of the customers table\"\n - User wants to improve a dimension description: \"Add a better description for the customer_name field\"\n - User asks to clarify a metric description: \"Update the total_revenue metric description to explain it's net revenue\"\n - User wants to document business logic in descriptions: \"Add a note that active_users excludes test accounts\"\n\n- **What this tool does:**\n - Creates a change proposal and applies it to a changeset (batch of changes)\n - Changes are applied immediately but can be reviewed and rejected afterward\n - Supports updating descriptions for tables, dimensions, and metrics\n - Supports creating new metrics\n - Tracks who proposed the change and when\n - Applied changes can be reviewed and rejected by authorized users\n\n- **Examples:**\n\n User: \"Update the customers table description to mention it includes both B2B and B2C customers\"\n User: \"The revenue_net field should explain it's after taxes and discounts\"\n User: \"Create a new metric called 'Median Order Amount' that calculates the median order amount\"\n";
|
5
5
|
type ChangePatch<T> = Partial<Record<keyof T, z.ZodType>>;
|
6
6
|
declare const stringOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
|
7
7
|
op: z.ZodLiteral<"replace">;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"toolProposeChange.d.ts","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolProposeChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,MAAM,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAS3C,eAAO,MAAM,+BAA+B,
|
1
|
+
{"version":3,"file":"toolProposeChange.d.ts","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolProposeChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,MAAM,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAS3C,eAAO,MAAM,+BAA+B,+iEA2B3C,CAAC;AAMF,KAAK,WAAW,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AAoC1D,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;IAA0B,CAAC;AAqF/C,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAe5B,CAAC;AAEb,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9E,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AAC1D,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;AACpD,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;AAElD,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAexC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CACzC,OAAO,6BAA6B,CACvC,CAAC"}
|
@@ -21,12 +21,12 @@ Use this tool to propose changes to a table's metadata in the semantic layer. Th
|
|
21
21
|
- User wants to document business logic in descriptions: "Add a note that active_users excludes test accounts"
|
22
22
|
|
23
23
|
- **What this tool does:**
|
24
|
-
- Creates a change proposal
|
25
|
-
-
|
24
|
+
- Creates a change proposal and applies it to a changeset (batch of changes)
|
25
|
+
- Changes are applied immediately but can be reviewed and rejected afterward
|
26
26
|
- Supports updating descriptions for tables, dimensions, and metrics
|
27
27
|
- Supports creating new metrics
|
28
28
|
- Tracks who proposed the change and when
|
29
|
-
-
|
29
|
+
- Applied changes can be reviewed and rejected by authorized users
|
30
30
|
|
31
31
|
- **Examples:**
|
32
32
|
|