@lightdash/common 2.59.0 → 2.60.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/toolGenerateDataAppArgs.d.ts +10 -7
- package/dist/cjs/ee/AiAgent/schemas/tools/toolGenerateDataAppArgs.d.ts.map +1 -1
- package/dist/cjs/ee/AiAgent/schemas/tools/toolGenerateDataAppArgs.js +17 -11
- package/dist/cjs/ee/AiAgent/schemas/tools/toolGenerateDataAppArgs.js.map +1 -1
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/ee/AiAgent/schemas/tools/toolGenerateDataAppArgs.d.ts +10 -7
- package/dist/esm/ee/AiAgent/schemas/tools/toolGenerateDataAppArgs.d.ts.map +1 -1
- package/dist/esm/ee/AiAgent/schemas/tools/toolGenerateDataAppArgs.js +16 -10
- package/dist/esm/ee/AiAgent/schemas/tools/toolGenerateDataAppArgs.js.map +1 -1
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/ee/AiAgent/schemas/tools/toolGenerateDataAppArgs.d.ts +10 -7
- package/dist/types/ee/AiAgent/schemas/tools/toolGenerateDataAppArgs.d.ts.map +1 -1
- package/dist/types/ee/AiAgent/schemas/tools/toolGenerateDataAppArgs.js +16 -10
- package/dist/types/ee/AiAgent/schemas/tools/toolGenerateDataAppArgs.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,14 +2,17 @@ import { z } from 'zod';
|
|
|
2
2
|
import { type AppVersionStatus } from '../../../apps/types';
|
|
3
3
|
/** Builds run minutes, not seconds: a pending result older than this is stale. */
|
|
4
4
|
export declare const AI_DATA_APP_BUILD_PENDING_GRACE_MS: number;
|
|
5
|
-
|
|
5
|
+
/** Builder starter templates the AI agent may pick; the viz renderer template is internal. */
|
|
6
|
+
export declare const DATA_APP_BUILD_TEMPLATES: readonly ["dashboard", "slideshow", "pdf", "custom"];
|
|
6
7
|
export type DataAppBuildTemplate = (typeof DATA_APP_BUILD_TEMPLATES)[number];
|
|
8
|
+
/** How a prior visualization's query travels in the brief; shared with the system prompt. */
|
|
9
|
+
export declare const DATA_APP_VIZ_LINE_FORMAT = "[viz title][explore; metrics; dimensions; filters; sort]";
|
|
7
10
|
export declare const TOOL_GENERATE_DATA_APP_DESCRIPTION: string;
|
|
8
11
|
export declare const toolGenerateDataAppArgsSchema: z.ZodObject<{
|
|
9
12
|
prompt: z.ZodString;
|
|
10
|
-
template: z.ZodNullable<z.ZodEnum<["dashboard", "slideshow", "pdf", "custom"]
|
|
11
|
-
dashboardSlug: z.ZodNullable<z.ZodString
|
|
12
|
-
chartSlugs: z.ZodNullable<z.ZodArray<z.ZodString, "many"
|
|
13
|
+
template: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<["dashboard", "slideshow", "pdf", "custom"]>>>>;
|
|
14
|
+
dashboardSlug: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
15
|
+
chartSlugs: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>>;
|
|
13
16
|
}, "strip", z.ZodTypeAny, {
|
|
14
17
|
prompt: string;
|
|
15
18
|
template: "custom" | "dashboard" | "pdf" | "slideshow" | null;
|
|
@@ -17,9 +20,9 @@ export declare const toolGenerateDataAppArgsSchema: z.ZodObject<{
|
|
|
17
20
|
chartSlugs: string[] | null;
|
|
18
21
|
}, {
|
|
19
22
|
prompt: string;
|
|
20
|
-
template
|
|
21
|
-
dashboardSlug
|
|
22
|
-
chartSlugs
|
|
23
|
+
template?: "custom" | "dashboard" | "pdf" | "slideshow" | null | undefined;
|
|
24
|
+
dashboardSlug?: string | null | undefined;
|
|
25
|
+
chartSlugs?: string[] | null | undefined;
|
|
23
26
|
}>;
|
|
24
27
|
export declare const toolGenerateDataAppOutputSchema: z.ZodObject<{
|
|
25
28
|
result: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolGenerateDataAppArgs.d.ts","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolGenerateDataAppArgs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGH,KAAK,gBAAgB,
|
|
1
|
+
{"version":3,"file":"toolGenerateDataAppArgs.d.ts","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolGenerateDataAppArgs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGH,KAAK,gBAAgB,EAExB,MAAM,qBAAqB,CAAC;AAE7B,kFAAkF;AAClF,eAAO,MAAM,kCAAkC,QAAiB,CAAC;AAEjE,8FAA8F;AAC9F,eAAO,MAAM,wBAAwB,sDAKU,CAAC;AAChD,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7E,6FAA6F;AAC7F,eAAO,MAAM,wBAAwB,6DACyB,CAAC;AAE/D,eAAO,MAAM,kCAAkC,QAKpC,CAAC;AAEZ,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;EA2BxC,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuB1C,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CACzC,OAAO,6BAA6B,CACvC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,+BAA+B,CACzC,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CACb,yBAAyB,CAAC,UAAU,CAAC,EACrC;QAAE,MAAM,EAAE,SAAS,CAAA;KAAE,CACxB,CAAC;CACL,CAAC;AAEF,KAAK,6BAA6B,GAAG;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EACF,yBAAyB,CAAC,UAAU,CAAC,GACrC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACvB,IAAI,CAAC;CACd,CAAC;AAEF,KAAK,yBAAyB,GAAG,6BAA6B,GAAG;IAC7D,QAAQ,EAAE,UAAU,CAAC;IACrB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,QAAQ,EAAE,yBAAyB,CAAC,UAAU,CAAC,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,2BAA2B,GACpC,CAAC,SAAS,6BAA6B,UAE/B,CAAC,KACV,MAAM,IAAI,CAAC,GAAG,yBAID,CAAC;AAEjB,eAAO,MAAM,qBAAqB,gBAAiB,MAAM,WAAW,MAAM,WAC5B,CAAC;AAI/C,eAAO,MAAM,8BAA8B,oFASxC;IACC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,gBAAgB,CAAC;IACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,KAAG,iCAAiC,GAAG,IAyBvC,CAAC;AAEF,eAAO,MAAM,qCAAqC,YACrC,MAAM,KAChB,iCAQF,CAAC"}
|
|
@@ -1,38 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getExpiredGenerateDataAppBuildOutcome = exports.getGenerateDataAppBuildOutcome = exports.getDataAppBuilderPath = exports.isToolGenerateDataAppResult = exports.toolGenerateDataAppOutputSchema = exports.toolGenerateDataAppArgsSchema = exports.TOOL_GENERATE_DATA_APP_DESCRIPTION = exports.DATA_APP_BUILD_TEMPLATES = exports.AI_DATA_APP_BUILD_PENDING_GRACE_MS = void 0;
|
|
3
|
+
exports.getExpiredGenerateDataAppBuildOutcome = exports.getGenerateDataAppBuildOutcome = exports.getDataAppBuilderPath = exports.isToolGenerateDataAppResult = exports.toolGenerateDataAppOutputSchema = exports.toolGenerateDataAppArgsSchema = exports.TOOL_GENERATE_DATA_APP_DESCRIPTION = exports.DATA_APP_VIZ_LINE_FORMAT = exports.DATA_APP_BUILD_TEMPLATES = exports.AI_DATA_APP_BUILD_PENDING_GRACE_MS = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const types_1 = require("../../../apps/types");
|
|
6
6
|
/** Builds run minutes, not seconds: a pending result older than this is stale. */
|
|
7
7
|
exports.AI_DATA_APP_BUILD_PENDING_GRACE_MS = 30 * 60 * 1000;
|
|
8
|
+
/** Builder starter templates the AI agent may pick; the viz renderer template is internal. */
|
|
8
9
|
exports.DATA_APP_BUILD_TEMPLATES = [
|
|
9
10
|
'dashboard',
|
|
10
11
|
'slideshow',
|
|
11
12
|
'pdf',
|
|
12
13
|
'custom',
|
|
13
14
|
];
|
|
15
|
+
/** How a prior visualization's query travels in the brief; shared with the system prompt. */
|
|
16
|
+
exports.DATA_APP_VIZ_LINE_FORMAT = '[viz title][explore; metrics; dimensions; filters; sort]';
|
|
14
17
|
exports.TOOL_GENERATE_DATA_APP_DESCRIPTION = [
|
|
15
|
-
"Start building a data app — an interactive application generated from a
|
|
16
|
-
'Use it
|
|
17
|
-
'The build runs in the background for several minutes, so the call returns as soon as it has started (status: "pending").
|
|
18
|
+
"Start building a data app — an interactive application generated from a brief on top of this project's semantic layer.",
|
|
19
|
+
'Use it when the user asks to build, make, or generate a data app (or an app, slide show, or PDF report); questions, charts, dashboards, and other saved content have their own tools.',
|
|
20
|
+
'The build runs in the background for several minutes, so the call returns as soon as it has started (status: "pending"). One request, one call: tell the user the build has started and that you will link them to the app afterwards, then end your turn — never wait, poll, or call this tool again for the same request.',
|
|
18
21
|
'A later turn sees the outcome on this call\'s result: "success" carries the app name and the builder link (href) to share; "error" carries the failure message.',
|
|
19
22
|
].join(' ');
|
|
20
23
|
exports.toolGenerateDataAppArgsSchema = zod_1.z.object({
|
|
21
24
|
prompt: zod_1.z
|
|
22
25
|
.string()
|
|
23
|
-
.describe(
|
|
26
|
+
.describe(`A self-contained brief for the coding agent that builds the app: what the app shows, for whom, and how it behaves. Carry this thread's analysis in as a collection of visualizations — for each one, its title, a one-line description, and a metric query line \`${exports.DATA_APP_VIZ_LINE_FORMAT}\`. The coding agent sees the semantic layer but not this conversation, so include every detail it needs.`),
|
|
24
27
|
template: zod_1.z
|
|
25
28
|
.enum(exports.DATA_APP_BUILD_TEMPLATES)
|
|
26
|
-
.
|
|
27
|
-
.
|
|
29
|
+
.nullish()
|
|
30
|
+
.default(null)
|
|
31
|
+
.describe('Starter template the builder would use: "dashboard" for a dashboard-style app, "slideshow" for a slide show, "pdf" for a PDF report, "custom" for anything else. Omit when the user did not ask for one.'),
|
|
28
32
|
dashboardSlug: zod_1.z
|
|
29
33
|
.string()
|
|
30
|
-
.
|
|
31
|
-
.
|
|
34
|
+
.nullish()
|
|
35
|
+
.default(null)
|
|
36
|
+
.describe("Generate from an existing dashboard: its slug (from findContent). The app starts from the dashboard's layout and charts; the dashboard itself stays unchanged. Omit when not generating from a dashboard."),
|
|
32
37
|
chartSlugs: zod_1.z
|
|
33
38
|
.array(zod_1.z.string())
|
|
34
|
-
.
|
|
35
|
-
.
|
|
39
|
+
.nullish()
|
|
40
|
+
.default(null)
|
|
41
|
+
.describe('Saved charts (slugs from findContent) whose queries the app is built on; the charts themselves stay unchanged. Omit when not building on saved charts.'),
|
|
36
42
|
});
|
|
37
43
|
exports.toolGenerateDataAppOutputSchema = zod_1.z.object({
|
|
38
44
|
result: zod_1.z.string(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolGenerateDataAppArgs.js","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolGenerateDataAppArgs.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,+
|
|
1
|
+
{"version":3,"file":"toolGenerateDataAppArgs.js","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolGenerateDataAppArgs.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,+CAK6B;AAE7B,kFAAkF;AACrE,QAAA,kCAAkC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEjE,8FAA8F;AACjF,QAAA,wBAAwB,GAAG;IACpC,WAAW;IACX,WAAW;IACX,KAAK;IACL,QAAQ;CACmC,CAAC;AAGhD,6FAA6F;AAChF,QAAA,wBAAwB,GACjC,0DAA0D,CAAC;AAElD,QAAA,kCAAkC,GAAG;IAC9C,wHAAwH;IACxH,uLAAuL;IACvL,6TAA6T;IAC7T,iKAAiK;CACpK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEC,QAAA,6BAA6B,GAAG,OAAC,CAAC,MAAM,CAAC;IAClD,MAAM,EAAE,OAAC;SACJ,MAAM,EAAE;SACR,QAAQ,CACL,qQAAqQ,QAAA,wBAAwB,2GAA2G,CAC3Y;IACL,QAAQ,EAAE,OAAC;SACN,IAAI,CAAC,QAAA,wBAAwB,CAAC;SAC9B,OAAO,EAAE;SACT,OAAO,CAAC,IAAI,CAAC;SACb,QAAQ,CACL,0MAA0M,CAC7M;IACL,aAAa,EAAE,OAAC;SACX,MAAM,EAAE;SACR,OAAO,EAAE;SACT,OAAO,CAAC,IAAI,CAAC;SACb,QAAQ,CACL,2MAA2M,CAC9M;IACL,UAAU,EAAE,OAAC;SACR,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;SACjB,OAAO,EAAE;SACT,OAAO,CAAC,IAAI,CAAC;SACb,QAAQ,CACL,wJAAwJ,CAC3J;CACR,CAAC,CAAC;AAEU,QAAA,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