@bubblelab/shared-schemas 0.1.8 → 0.1.10
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/ai-models.d.ts +4 -0
- package/dist/ai-models.d.ts.map +1 -0
- package/dist/ai-models.js +19 -0
- package/dist/ai-models.js.map +1 -0
- package/dist/api-schema.d.ts +2 -2
- package/dist/bubble-definition-schema.d.ts +133 -19
- package/dist/bubble-definition-schema.d.ts.map +1 -1
- package/dist/bubble-definition-schema.js +7 -0
- package/dist/bubble-definition-schema.js.map +1 -1
- package/dist/bubbleflow-execution-schema.d.ts +411 -141
- package/dist/bubbleflow-execution-schema.d.ts.map +1 -1
- package/dist/bubbleflow-execution-schema.js +118 -8
- package/dist/bubbleflow-execution-schema.js.map +1 -1
- package/dist/bubbleflow-generation-prompts.d.ts +19 -0
- package/dist/bubbleflow-generation-prompts.d.ts.map +1 -0
- package/dist/bubbleflow-generation-prompts.js +57 -0
- package/dist/bubbleflow-generation-prompts.js.map +1 -0
- package/dist/bubbleflow-schema.d.ts +418 -121
- package/dist/bubbleflow-schema.d.ts.map +1 -1
- package/dist/bubbleflow-schema.js +40 -0
- package/dist/bubbleflow-schema.js.map +1 -1
- package/dist/credential-schema.d.ts +46 -46
- package/dist/credential-schema.d.ts.map +1 -1
- package/dist/credential-schema.js +13 -15
- package/dist/credential-schema.js.map +1 -1
- package/dist/cron-utils.d.ts +47 -0
- package/dist/cron-utils.d.ts.map +1 -0
- package/dist/cron-utils.js +228 -0
- package/dist/cron-utils.js.map +1 -0
- package/dist/general-chat.d.ts +81 -0
- package/dist/general-chat.d.ts.map +1 -0
- package/dist/general-chat.js +58 -0
- package/dist/general-chat.js.map +1 -0
- package/dist/generate-bubbleflow-schema.d.ts +174 -52
- package/dist/generate-bubbleflow-schema.d.ts.map +1 -1
- package/dist/generate-bubbleflow-schema.js +41 -0
- package/dist/generate-bubbleflow-schema.js.map +1 -1
- package/dist/generation-result-schema.d.ts +73 -0
- package/dist/generation-result-schema.d.ts.map +1 -0
- package/dist/generation-result-schema.js +55 -0
- package/dist/generation-result-schema.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/milk-tea.d.ts +108 -0
- package/dist/milk-tea.d.ts.map +1 -0
- package/dist/milk-tea.js +74 -0
- package/dist/milk-tea.js.map +1 -0
- package/dist/pearl.d.ts +279 -0
- package/dist/pearl.d.ts.map +1 -0
- package/dist/pearl.js +79 -0
- package/dist/pearl.js.map +1 -0
- package/dist/streaming-events.d.ts +71 -0
- package/dist/streaming-events.d.ts.map +1 -1
- package/dist/trigger.d.ts +119 -0
- package/dist/trigger.d.ts.map +1 -0
- package/dist/trigger.js +14 -0
- package/dist/trigger.js.map +1 -0
- package/dist/types.d.ts +2 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from '@hono/zod-openapi';
|
|
2
|
+
import { CredentialType } from './types.js';
|
|
3
|
+
import { TokenUsageSchema } from './bubbleflow-execution-schema.js';
|
|
4
|
+
/**
|
|
5
|
+
* Generation result schema that matches the BubbleFlow generator workflow result
|
|
6
|
+
* but includes additional fields for the frontend generation store
|
|
7
|
+
*/
|
|
8
|
+
export const GenerationResultSchema = z.object({
|
|
9
|
+
// Core generation fields (matching BubbleFlowGeneratorResultSchema)
|
|
10
|
+
generatedCode: z.string().openapi({
|
|
11
|
+
description: 'The generated BubbleFlow TypeScript code',
|
|
12
|
+
}),
|
|
13
|
+
isValid: z.boolean().openapi({
|
|
14
|
+
description: 'Whether the generated code is valid',
|
|
15
|
+
}),
|
|
16
|
+
success: z.boolean().openapi({
|
|
17
|
+
description: 'Whether the generation was successful',
|
|
18
|
+
}),
|
|
19
|
+
error: z.string().openapi({
|
|
20
|
+
description: 'Error message if generation failed',
|
|
21
|
+
}),
|
|
22
|
+
toolCalls: z.array(z.any()).openapi({
|
|
23
|
+
description: 'The tool calls made by the AI agent',
|
|
24
|
+
}),
|
|
25
|
+
summary: z.string().openapi({
|
|
26
|
+
description: 'High-level instructions for using the validated flow',
|
|
27
|
+
}),
|
|
28
|
+
inputsSchema: z.string().openapi({
|
|
29
|
+
description: 'JSON Schema (string) representing the inputs of the flow',
|
|
30
|
+
}),
|
|
31
|
+
// Additional fields for frontend generation store
|
|
32
|
+
tokenUsage: TokenUsageSchema.openapi({
|
|
33
|
+
description: 'Token usage information for the generation',
|
|
34
|
+
}),
|
|
35
|
+
codeLength: z.number().openapi({
|
|
36
|
+
description: 'Length of the generated code in characters',
|
|
37
|
+
example: 2500,
|
|
38
|
+
}),
|
|
39
|
+
bubbleCount: z.number().openapi({
|
|
40
|
+
description: 'Number of bubbles used in the generated flow',
|
|
41
|
+
example: 3,
|
|
42
|
+
}),
|
|
43
|
+
flowId: z.number().openapi({
|
|
44
|
+
description: 'ID of the created flow in the database',
|
|
45
|
+
example: 123,
|
|
46
|
+
}),
|
|
47
|
+
requiredCredentials: z.record(z.string(), z.array(z.nativeEnum(CredentialType))).openapi({
|
|
48
|
+
description: 'Required credentials for the bubbles in the generated code',
|
|
49
|
+
example: {
|
|
50
|
+
'database-connection': [CredentialType.DATABASE_CRED],
|
|
51
|
+
'slack-notification': [CredentialType.SLACK_CRED],
|
|
52
|
+
},
|
|
53
|
+
}),
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=generation-result-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generation-result-schema.js","sourceRoot":"","sources":["../src/generation-result-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE;;;GAGG;AACH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EAAE,GAAG;KACb,CAAC;IACF,mBAAmB,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QACvF,WAAW,EAAE,4DAA4D;QACzE,OAAO,EAAE;YACP,qBAAqB,EAAE,CAAC,cAAc,CAAC,aAAa,CAAC;YACrD,oBAAoB,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC;SAClD;KACF,CAAC;CACH,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,4 +13,10 @@ export * from './generate-bubbleflow-schema.js';
|
|
|
13
13
|
export * from './webhook-schema.js';
|
|
14
14
|
export * from './subscription-status-schema.js';
|
|
15
15
|
export * from './api-schema.js';
|
|
16
|
+
export * from './milk-tea.js';
|
|
17
|
+
export * from './pearl.js';
|
|
18
|
+
export * from './ai-models.js';
|
|
19
|
+
export * from './cron-utils.js';
|
|
20
|
+
export * from './trigger.js';
|
|
21
|
+
export * from './bubbleflow-generation-prompts.js';
|
|
16
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oCAAoC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,4 +15,10 @@ export * from './generate-bubbleflow-schema.js';
|
|
|
15
15
|
export * from './webhook-schema.js';
|
|
16
16
|
export * from './subscription-status-schema.js';
|
|
17
17
|
export * from './api-schema.js';
|
|
18
|
+
export * from './milk-tea.js';
|
|
19
|
+
export * from './pearl.js';
|
|
20
|
+
export * from './ai-models.js';
|
|
21
|
+
export * from './cron-utils.js';
|
|
22
|
+
export * from './trigger.js';
|
|
23
|
+
export * from './bubbleflow-generation-prompts.js';
|
|
18
24
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,6CAA6C;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,6CAA6C;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Conversation message schema for milk tea multi-turn conversations
|
|
4
|
+
*/
|
|
5
|
+
declare const ConversationMessageSchema: z.ZodObject<{
|
|
6
|
+
role: z.ZodEnum<["user", "assistant"]>;
|
|
7
|
+
content: z.ZodString;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
content: string;
|
|
10
|
+
role: "user" | "assistant";
|
|
11
|
+
}, {
|
|
12
|
+
content: string;
|
|
13
|
+
role: "user" | "assistant";
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* Request schema for Milk Tea agent
|
|
17
|
+
* Milk Tea helps users configure bubble parameters through conversation
|
|
18
|
+
*/
|
|
19
|
+
export declare const MilkTeaRequestSchema: z.ZodObject<{
|
|
20
|
+
userRequest: z.ZodString;
|
|
21
|
+
bubbleName: z.ZodString;
|
|
22
|
+
bubbleSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
23
|
+
currentCode: z.ZodOptional<z.ZodString>;
|
|
24
|
+
availableCredentials: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
25
|
+
userName: z.ZodString;
|
|
26
|
+
insertLocation: z.ZodOptional<z.ZodString>;
|
|
27
|
+
conversationHistory: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
28
|
+
role: z.ZodEnum<["user", "assistant"]>;
|
|
29
|
+
content: z.ZodString;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
content: string;
|
|
32
|
+
role: "user" | "assistant";
|
|
33
|
+
}, {
|
|
34
|
+
content: string;
|
|
35
|
+
role: "user" | "assistant";
|
|
36
|
+
}>, "many">>>;
|
|
37
|
+
model: z.ZodDefault<z.ZodEnum<["openai/gpt-5", "openai/gpt-5-mini", "google/gemini-2.5-pro", "google/gemini-2.5-flash", "google/gemini-2.5-flash-lite", "google/gemini-2.5-flash-image-preview", "anthropic/claude-sonnet-4-5", "anthropic/claude-haiku-4-5", "openrouter/x-ai/grok-code-fast-1", "openrouter/z-ai/glm-4.6"]>>;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
bubbleName: string;
|
|
40
|
+
model: "openai/gpt-5" | "openai/gpt-5-mini" | "google/gemini-2.5-pro" | "google/gemini-2.5-flash" | "google/gemini-2.5-flash-lite" | "google/gemini-2.5-flash-image-preview" | "anthropic/claude-sonnet-4-5" | "anthropic/claude-haiku-4-5" | "openrouter/x-ai/grok-code-fast-1" | "openrouter/z-ai/glm-4.6";
|
|
41
|
+
userRequest: string;
|
|
42
|
+
bubbleSchema: Record<string, unknown>;
|
|
43
|
+
availableCredentials: string[];
|
|
44
|
+
userName: string;
|
|
45
|
+
conversationHistory: {
|
|
46
|
+
content: string;
|
|
47
|
+
role: "user" | "assistant";
|
|
48
|
+
}[];
|
|
49
|
+
currentCode?: string | undefined;
|
|
50
|
+
insertLocation?: string | undefined;
|
|
51
|
+
}, {
|
|
52
|
+
bubbleName: string;
|
|
53
|
+
userRequest: string;
|
|
54
|
+
bubbleSchema: Record<string, unknown>;
|
|
55
|
+
userName: string;
|
|
56
|
+
model?: "openai/gpt-5" | "openai/gpt-5-mini" | "google/gemini-2.5-pro" | "google/gemini-2.5-flash" | "google/gemini-2.5-flash-lite" | "google/gemini-2.5-flash-image-preview" | "anthropic/claude-sonnet-4-5" | "anthropic/claude-haiku-4-5" | "openrouter/x-ai/grok-code-fast-1" | "openrouter/z-ai/glm-4.6" | undefined;
|
|
57
|
+
currentCode?: string | undefined;
|
|
58
|
+
availableCredentials?: string[] | undefined;
|
|
59
|
+
insertLocation?: string | undefined;
|
|
60
|
+
conversationHistory?: {
|
|
61
|
+
content: string;
|
|
62
|
+
role: "user" | "assistant";
|
|
63
|
+
}[] | undefined;
|
|
64
|
+
}>;
|
|
65
|
+
/**
|
|
66
|
+
* Response schema for Milk Tea agent
|
|
67
|
+
*/
|
|
68
|
+
export declare const MilkTeaResponseSchema: z.ZodObject<{
|
|
69
|
+
type: z.ZodEnum<["code", "question", "reject"]>;
|
|
70
|
+
message: z.ZodString;
|
|
71
|
+
snippet: z.ZodOptional<z.ZodString>;
|
|
72
|
+
success: z.ZodBoolean;
|
|
73
|
+
error: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, "strip", z.ZodTypeAny, {
|
|
75
|
+
message: string;
|
|
76
|
+
type: "code" | "question" | "reject";
|
|
77
|
+
success: boolean;
|
|
78
|
+
error?: string | undefined;
|
|
79
|
+
snippet?: string | undefined;
|
|
80
|
+
}, {
|
|
81
|
+
message: string;
|
|
82
|
+
type: "code" | "question" | "reject";
|
|
83
|
+
success: boolean;
|
|
84
|
+
error?: string | undefined;
|
|
85
|
+
snippet?: string | undefined;
|
|
86
|
+
}>;
|
|
87
|
+
/**
|
|
88
|
+
* Internal agent response format (JSON mode output from AI)
|
|
89
|
+
*/
|
|
90
|
+
export declare const MilkTeaAgentOutputSchema: z.ZodObject<{
|
|
91
|
+
type: z.ZodEnum<["code", "question", "reject"]>;
|
|
92
|
+
message: z.ZodString;
|
|
93
|
+
snippet: z.ZodOptional<z.ZodString>;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
message: string;
|
|
96
|
+
type: "code" | "question" | "reject";
|
|
97
|
+
snippet?: string | undefined;
|
|
98
|
+
}, {
|
|
99
|
+
message: string;
|
|
100
|
+
type: "code" | "question" | "reject";
|
|
101
|
+
snippet?: string | undefined;
|
|
102
|
+
}>;
|
|
103
|
+
export type MilkTeaRequest = z.infer<typeof MilkTeaRequestSchema>;
|
|
104
|
+
export type MilkTeaResponse = z.infer<typeof MilkTeaResponseSchema>;
|
|
105
|
+
export type MilkTeaAgentOutput = z.infer<typeof MilkTeaAgentOutputSchema>;
|
|
106
|
+
export type ConversationMessage = z.infer<typeof ConversationMessageSchema>;
|
|
107
|
+
export {};
|
|
108
|
+
//# sourceMappingURL=milk-tea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"milk-tea.d.ts","sourceRoot":"","sources":["../src/milk-tea.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;GAEG;AACH,QAAA,MAAM,yBAAyB;;;;;;;;;EAG7B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6C/B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;EA0BhC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;EAInC,CAAC;AAGH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
package/dist/milk-tea.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AvailableModels } from './ai-models.js';
|
|
3
|
+
/**
|
|
4
|
+
* Conversation message schema for milk tea multi-turn conversations
|
|
5
|
+
*/
|
|
6
|
+
const ConversationMessageSchema = z.object({
|
|
7
|
+
role: z.enum(['user', 'assistant']),
|
|
8
|
+
content: z.string(),
|
|
9
|
+
});
|
|
10
|
+
/**
|
|
11
|
+
* Request schema for Milk Tea agent
|
|
12
|
+
* Milk Tea helps users configure bubble parameters through conversation
|
|
13
|
+
*/
|
|
14
|
+
export const MilkTeaRequestSchema = z.object({
|
|
15
|
+
userRequest: z
|
|
16
|
+
.string()
|
|
17
|
+
.min(1, 'User request is required')
|
|
18
|
+
.describe('The user request or question about configuring the bubble'),
|
|
19
|
+
bubbleName: z
|
|
20
|
+
.string()
|
|
21
|
+
.min(1, 'Bubble name is required')
|
|
22
|
+
.describe('The name of the bubble to configure (e.g., "email-tool")'),
|
|
23
|
+
bubbleSchema: z
|
|
24
|
+
.record(z.unknown())
|
|
25
|
+
.describe('The full schema/interface definition of the bubble including parameters and types'),
|
|
26
|
+
currentCode: z
|
|
27
|
+
.string()
|
|
28
|
+
.optional()
|
|
29
|
+
.describe('The current workflow code context for validation'),
|
|
30
|
+
availableCredentials: z
|
|
31
|
+
.array(z.string())
|
|
32
|
+
.default([])
|
|
33
|
+
.describe('List of credential types available to the user'),
|
|
34
|
+
userName: z.string().describe('Name of the user making the request'),
|
|
35
|
+
insertLocation: z
|
|
36
|
+
.string()
|
|
37
|
+
.optional()
|
|
38
|
+
.describe('Location in code where the snippet should be inserted'),
|
|
39
|
+
conversationHistory: z
|
|
40
|
+
.array(ConversationMessageSchema)
|
|
41
|
+
.optional()
|
|
42
|
+
.default([])
|
|
43
|
+
.describe('Previous conversation messages for multi-turn interactions (frontend manages state)'),
|
|
44
|
+
model: AvailableModels.default('google/gemini-2.5-pro').describe('AI model to use for Milk Tea agent'),
|
|
45
|
+
});
|
|
46
|
+
/**
|
|
47
|
+
* Response schema for Milk Tea agent
|
|
48
|
+
*/
|
|
49
|
+
export const MilkTeaResponseSchema = z.object({
|
|
50
|
+
type: z
|
|
51
|
+
.enum(['code', 'question', 'reject'])
|
|
52
|
+
.describe('Type of response: code (generated snippet), question (needs clarification), reject (infeasible request)'),
|
|
53
|
+
message: z
|
|
54
|
+
.string()
|
|
55
|
+
.describe('Human-readable message: explanation for code, question text, or rejection reason'),
|
|
56
|
+
snippet: z
|
|
57
|
+
.string()
|
|
58
|
+
.optional()
|
|
59
|
+
.describe('Generated TypeScript code snippet (only present when type is "code")'),
|
|
60
|
+
success: z.boolean().describe('Whether the operation completed successfully'),
|
|
61
|
+
error: z
|
|
62
|
+
.string()
|
|
63
|
+
.optional()
|
|
64
|
+
.describe('Error message if the operation failed'),
|
|
65
|
+
});
|
|
66
|
+
/**
|
|
67
|
+
* Internal agent response format (JSON mode output from AI)
|
|
68
|
+
*/
|
|
69
|
+
export const MilkTeaAgentOutputSchema = z.object({
|
|
70
|
+
type: z.enum(['code', 'question', 'reject']),
|
|
71
|
+
message: z.string(),
|
|
72
|
+
snippet: z.string().optional(),
|
|
73
|
+
});
|
|
74
|
+
//# sourceMappingURL=milk-tea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"milk-tea.js","sourceRoot":"","sources":["../src/milk-tea.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;GAEG;AACH,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,EAAE,0BAA0B,CAAC;SAClC,QAAQ,CAAC,2DAA2D,CAAC;IAExE,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,EAAE,yBAAyB,CAAC;SACjC,QAAQ,CAAC,0DAA0D,CAAC;IAEvE,YAAY,EAAE,CAAC;SACZ,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SACnB,QAAQ,CACP,mFAAmF,CACpF;IAEH,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,kDAAkD,CAAC;IAE/D,oBAAoB,EAAE,CAAC;SACpB,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,OAAO,CAAC,EAAE,CAAC;SACX,QAAQ,CAAC,gDAAgD,CAAC;IAE7D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IAEpE,cAAc,EAAE,CA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zod';
|
|
2
|
+
import { CredentialType } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Request schema for Pearl agent
|
|
5
|
+
* Pearl helps users build complete workflows without requiring specific bubbles
|
|
6
|
+
*/
|
|
7
|
+
export declare const PearlRequestSchema: z.ZodObject<{
|
|
8
|
+
userRequest: z.ZodString;
|
|
9
|
+
currentCode: z.ZodOptional<z.ZodString>;
|
|
10
|
+
userName: z.ZodString;
|
|
11
|
+
availableVariables: z.ZodArray<z.ZodAny, "many">;
|
|
12
|
+
conversationHistory: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
13
|
+
role: z.ZodEnum<["user", "assistant"]>;
|
|
14
|
+
content: z.ZodString;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
content: string;
|
|
17
|
+
role: "user" | "assistant";
|
|
18
|
+
}, {
|
|
19
|
+
content: string;
|
|
20
|
+
role: "user" | "assistant";
|
|
21
|
+
}>, "many">>>;
|
|
22
|
+
model: z.ZodDefault<z.ZodEnum<["openai/gpt-5", "openai/gpt-5-mini", "google/gemini-2.5-pro", "google/gemini-2.5-flash", "google/gemini-2.5-flash-lite", "google/gemini-2.5-flash-image-preview", "anthropic/claude-sonnet-4-5", "anthropic/claude-haiku-4-5", "openrouter/x-ai/grok-code-fast-1", "openrouter/z-ai/glm-4.6"]>>;
|
|
23
|
+
additionalContext: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
model: "openai/gpt-5" | "openai/gpt-5-mini" | "google/gemini-2.5-pro" | "google/gemini-2.5-flash" | "google/gemini-2.5-flash-lite" | "google/gemini-2.5-flash-image-preview" | "anthropic/claude-sonnet-4-5" | "anthropic/claude-haiku-4-5" | "openrouter/x-ai/grok-code-fast-1" | "openrouter/z-ai/glm-4.6";
|
|
26
|
+
userRequest: string;
|
|
27
|
+
userName: string;
|
|
28
|
+
conversationHistory: {
|
|
29
|
+
content: string;
|
|
30
|
+
role: "user" | "assistant";
|
|
31
|
+
}[];
|
|
32
|
+
availableVariables: any[];
|
|
33
|
+
currentCode?: string | undefined;
|
|
34
|
+
additionalContext?: string | undefined;
|
|
35
|
+
}, {
|
|
36
|
+
userRequest: string;
|
|
37
|
+
userName: string;
|
|
38
|
+
availableVariables: any[];
|
|
39
|
+
model?: "openai/gpt-5" | "openai/gpt-5-mini" | "google/gemini-2.5-pro" | "google/gemini-2.5-flash" | "google/gemini-2.5-flash-lite" | "google/gemini-2.5-flash-image-preview" | "anthropic/claude-sonnet-4-5" | "anthropic/claude-haiku-4-5" | "openrouter/x-ai/grok-code-fast-1" | "openrouter/z-ai/glm-4.6" | undefined;
|
|
40
|
+
currentCode?: string | undefined;
|
|
41
|
+
conversationHistory?: {
|
|
42
|
+
content: string;
|
|
43
|
+
role: "user" | "assistant";
|
|
44
|
+
}[] | undefined;
|
|
45
|
+
additionalContext?: string | undefined;
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* Response schema for Pearl agent
|
|
49
|
+
*/
|
|
50
|
+
export declare const PearlResponseSchema: z.ZodObject<{
|
|
51
|
+
type: z.ZodEnum<["code", "question", "reject"]>;
|
|
52
|
+
message: z.ZodString;
|
|
53
|
+
snippet: z.ZodOptional<z.ZodString>;
|
|
54
|
+
bubbleParameters: z.ZodOptional<z.ZodRecord<z.ZodNumber, z.ZodObject<{
|
|
55
|
+
variableName: z.ZodString;
|
|
56
|
+
bubbleName: z.ZodString;
|
|
57
|
+
className: z.ZodString;
|
|
58
|
+
parameters: z.ZodArray<z.ZodObject<{
|
|
59
|
+
location: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
startLine: z.ZodNumber;
|
|
61
|
+
startCol: z.ZodNumber;
|
|
62
|
+
endLine: z.ZodNumber;
|
|
63
|
+
endCol: z.ZodNumber;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
startLine: number;
|
|
66
|
+
startCol: number;
|
|
67
|
+
endLine: number;
|
|
68
|
+
endCol: number;
|
|
69
|
+
}, {
|
|
70
|
+
startLine: number;
|
|
71
|
+
startCol: number;
|
|
72
|
+
endLine: number;
|
|
73
|
+
endCol: number;
|
|
74
|
+
}>>;
|
|
75
|
+
variableId: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
name: z.ZodString;
|
|
77
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodUnknown, "many">]>;
|
|
78
|
+
type: z.ZodNativeEnum<typeof import("./bubble-definition-schema.js").BubbleParameterType>;
|
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
81
|
+
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
82
|
+
name: string;
|
|
83
|
+
location?: {
|
|
84
|
+
startLine: number;
|
|
85
|
+
startCol: number;
|
|
86
|
+
endLine: number;
|
|
87
|
+
endCol: number;
|
|
88
|
+
} | undefined;
|
|
89
|
+
variableId?: number | undefined;
|
|
90
|
+
}, {
|
|
91
|
+
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
92
|
+
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
93
|
+
name: string;
|
|
94
|
+
location?: {
|
|
95
|
+
startLine: number;
|
|
96
|
+
startCol: number;
|
|
97
|
+
endLine: number;
|
|
98
|
+
endCol: number;
|
|
99
|
+
} | undefined;
|
|
100
|
+
variableId?: number | undefined;
|
|
101
|
+
}>, "many">;
|
|
102
|
+
hasAwait: z.ZodBoolean;
|
|
103
|
+
hasActionCall: z.ZodBoolean;
|
|
104
|
+
dependencies: z.ZodOptional<z.ZodArray<z.ZodType<import("./types.js").BubbleName, z.ZodTypeDef, import("./types.js").BubbleName>, "many">>;
|
|
105
|
+
dependencyGraph: z.ZodOptional<z.ZodType<import("./bubble-definition-schema.js").DependencyGraphNode, z.ZodTypeDef, import("./bubble-definition-schema.js").DependencyGraphNode>>;
|
|
106
|
+
variableId: z.ZodNumber;
|
|
107
|
+
nodeType: z.ZodEnum<["service", "tool", "workflow", "unknown"]>;
|
|
108
|
+
location: z.ZodObject<{
|
|
109
|
+
startLine: z.ZodNumber;
|
|
110
|
+
startCol: z.ZodNumber;
|
|
111
|
+
endLine: z.ZodNumber;
|
|
112
|
+
endCol: z.ZodNumber;
|
|
113
|
+
}, "strip", z.ZodTypeAny, {
|
|
114
|
+
startLine: number;
|
|
115
|
+
startCol: number;
|
|
116
|
+
endLine: number;
|
|
117
|
+
endCol: number;
|
|
118
|
+
}, {
|
|
119
|
+
startLine: number;
|
|
120
|
+
startCol: number;
|
|
121
|
+
endLine: number;
|
|
122
|
+
endCol: number;
|
|
123
|
+
}>;
|
|
124
|
+
}, "strip", z.ZodTypeAny, {
|
|
125
|
+
location: {
|
|
126
|
+
startLine: number;
|
|
127
|
+
startCol: number;
|
|
128
|
+
endLine: number;
|
|
129
|
+
endCol: number;
|
|
130
|
+
};
|
|
131
|
+
variableId: number;
|
|
132
|
+
variableName: string;
|
|
133
|
+
bubbleName: string;
|
|
134
|
+
className: string;
|
|
135
|
+
parameters: {
|
|
136
|
+
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
137
|
+
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
138
|
+
name: string;
|
|
139
|
+
location?: {
|
|
140
|
+
startLine: number;
|
|
141
|
+
startCol: number;
|
|
142
|
+
endLine: number;
|
|
143
|
+
endCol: number;
|
|
144
|
+
} | undefined;
|
|
145
|
+
variableId?: number | undefined;
|
|
146
|
+
}[];
|
|
147
|
+
hasAwait: boolean;
|
|
148
|
+
hasActionCall: boolean;
|
|
149
|
+
nodeType: "unknown" | "service" | "tool" | "workflow";
|
|
150
|
+
dependencies?: import("./types.js").BubbleName[] | undefined;
|
|
151
|
+
dependencyGraph?: import("./bubble-definition-schema.js").DependencyGraphNode | undefined;
|
|
152
|
+
}, {
|
|
153
|
+
location: {
|
|
154
|
+
startLine: number;
|
|
155
|
+
startCol: number;
|
|
156
|
+
endLine: number;
|
|
157
|
+
endCol: number;
|
|
158
|
+
};
|
|
159
|
+
variableId: number;
|
|
160
|
+
variableName: string;
|
|
161
|
+
bubbleName: string;
|
|
162
|
+
className: string;
|
|
163
|
+
parameters: {
|
|
164
|
+
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
165
|
+
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
166
|
+
name: string;
|
|
167
|
+
location?: {
|
|
168
|
+
startLine: number;
|
|
169
|
+
startCol: number;
|
|
170
|
+
endLine: number;
|
|
171
|
+
endCol: number;
|
|
172
|
+
} | undefined;
|
|
173
|
+
variableId?: number | undefined;
|
|
174
|
+
}[];
|
|
175
|
+
hasAwait: boolean;
|
|
176
|
+
hasActionCall: boolean;
|
|
177
|
+
nodeType: "unknown" | "service" | "tool" | "workflow";
|
|
178
|
+
dependencies?: import("./types.js").BubbleName[] | undefined;
|
|
179
|
+
dependencyGraph?: import("./bubble-definition-schema.js").DependencyGraphNode | undefined;
|
|
180
|
+
}>>>;
|
|
181
|
+
inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
182
|
+
requiredCredentials: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodNativeEnum<typeof CredentialType>, "many">>>;
|
|
183
|
+
success: z.ZodBoolean;
|
|
184
|
+
error: z.ZodOptional<z.ZodString>;
|
|
185
|
+
}, "strip", z.ZodTypeAny, {
|
|
186
|
+
message: string;
|
|
187
|
+
type: "code" | "question" | "reject";
|
|
188
|
+
success: boolean;
|
|
189
|
+
error?: string | undefined;
|
|
190
|
+
inputSchema?: Record<string, unknown> | undefined;
|
|
191
|
+
requiredCredentials?: Record<string, CredentialType[]> | undefined;
|
|
192
|
+
bubbleParameters?: Record<number, {
|
|
193
|
+
location: {
|
|
194
|
+
startLine: number;
|
|
195
|
+
startCol: number;
|
|
196
|
+
endLine: number;
|
|
197
|
+
endCol: number;
|
|
198
|
+
};
|
|
199
|
+
variableId: number;
|
|
200
|
+
variableName: string;
|
|
201
|
+
bubbleName: string;
|
|
202
|
+
className: string;
|
|
203
|
+
parameters: {
|
|
204
|
+
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
205
|
+
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
206
|
+
name: string;
|
|
207
|
+
location?: {
|
|
208
|
+
startLine: number;
|
|
209
|
+
startCol: number;
|
|
210
|
+
endLine: number;
|
|
211
|
+
endCol: number;
|
|
212
|
+
} | undefined;
|
|
213
|
+
variableId?: number | undefined;
|
|
214
|
+
}[];
|
|
215
|
+
hasAwait: boolean;
|
|
216
|
+
hasActionCall: boolean;
|
|
217
|
+
nodeType: "unknown" | "service" | "tool" | "workflow";
|
|
218
|
+
dependencies?: import("./types.js").BubbleName[] | undefined;
|
|
219
|
+
dependencyGraph?: import("./bubble-definition-schema.js").DependencyGraphNode | undefined;
|
|
220
|
+
}> | undefined;
|
|
221
|
+
snippet?: string | undefined;
|
|
222
|
+
}, {
|
|
223
|
+
message: string;
|
|
224
|
+
type: "code" | "question" | "reject";
|
|
225
|
+
success: boolean;
|
|
226
|
+
error?: string | undefined;
|
|
227
|
+
inputSchema?: Record<string, unknown> | undefined;
|
|
228
|
+
requiredCredentials?: Record<string, CredentialType[]> | undefined;
|
|
229
|
+
bubbleParameters?: Record<number, {
|
|
230
|
+
location: {
|
|
231
|
+
startLine: number;
|
|
232
|
+
startCol: number;
|
|
233
|
+
endLine: number;
|
|
234
|
+
endCol: number;
|
|
235
|
+
};
|
|
236
|
+
variableId: number;
|
|
237
|
+
variableName: string;
|
|
238
|
+
bubbleName: string;
|
|
239
|
+
className: string;
|
|
240
|
+
parameters: {
|
|
241
|
+
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
242
|
+
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
243
|
+
name: string;
|
|
244
|
+
location?: {
|
|
245
|
+
startLine: number;
|
|
246
|
+
startCol: number;
|
|
247
|
+
endLine: number;
|
|
248
|
+
endCol: number;
|
|
249
|
+
} | undefined;
|
|
250
|
+
variableId?: number | undefined;
|
|
251
|
+
}[];
|
|
252
|
+
hasAwait: boolean;
|
|
253
|
+
hasActionCall: boolean;
|
|
254
|
+
nodeType: "unknown" | "service" | "tool" | "workflow";
|
|
255
|
+
dependencies?: import("./types.js").BubbleName[] | undefined;
|
|
256
|
+
dependencyGraph?: import("./bubble-definition-schema.js").DependencyGraphNode | undefined;
|
|
257
|
+
}> | undefined;
|
|
258
|
+
snippet?: string | undefined;
|
|
259
|
+
}>;
|
|
260
|
+
/**
|
|
261
|
+
* Internal agent response format (JSON mode output from AI)
|
|
262
|
+
*/
|
|
263
|
+
export declare const PearlAgentOutputSchema: z.ZodObject<{
|
|
264
|
+
type: z.ZodEnum<["code", "question", "reject"]>;
|
|
265
|
+
message: z.ZodString;
|
|
266
|
+
snippet: z.ZodOptional<z.ZodString>;
|
|
267
|
+
}, "strip", z.ZodTypeAny, {
|
|
268
|
+
message: string;
|
|
269
|
+
type: "code" | "question" | "reject";
|
|
270
|
+
snippet?: string | undefined;
|
|
271
|
+
}, {
|
|
272
|
+
message: string;
|
|
273
|
+
type: "code" | "question" | "reject";
|
|
274
|
+
snippet?: string | undefined;
|
|
275
|
+
}>;
|
|
276
|
+
export type PearlRequest = z.infer<typeof PearlRequestSchema>;
|
|
277
|
+
export type PearlResponse = z.infer<typeof PearlResponseSchema>;
|
|
278
|
+
export type PearlAgentOutput = z.infer<typeof PearlAgentOutputSchema>;
|
|
279
|
+
//# sourceMappingURL=pearl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pearl.d.ts","sourceRoot":"","sources":["../src/pearl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAQ5C;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiC7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+C9B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;EAIjC,CAAC;AAGH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
package/dist/pearl.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AvailableModels } from './ai-models.js';
|
|
3
|
+
import { ParsedBubbleWithInfoSchema } from './bubble-definition-schema.js';
|
|
4
|
+
import { CredentialType } from './types.js';
|
|
5
|
+
// Reuse the ConversationMessageSchema from milk-tea to avoid duplication
|
|
6
|
+
const ConversationMessageSchema = z.object({
|
|
7
|
+
role: z.enum(['user', 'assistant']),
|
|
8
|
+
content: z.string(),
|
|
9
|
+
});
|
|
10
|
+
/**
|
|
11
|
+
* Request schema for Pearl agent
|
|
12
|
+
* Pearl helps users build complete workflows without requiring specific bubbles
|
|
13
|
+
*/
|
|
14
|
+
export const PearlRequestSchema = z.object({
|
|
15
|
+
userRequest: z
|
|
16
|
+
.string()
|
|
17
|
+
.min(1, 'User request is required')
|
|
18
|
+
.describe('The user request or question about building a workflow'),
|
|
19
|
+
currentCode: z
|
|
20
|
+
.string()
|
|
21
|
+
.optional()
|
|
22
|
+
.describe('The current workflow code for context and modification'),
|
|
23
|
+
userName: z.string().describe('Name of the user making the request'),
|
|
24
|
+
availableVariables: z
|
|
25
|
+
.array(z.any())
|
|
26
|
+
.describe('List of available variables in the current code'),
|
|
27
|
+
conversationHistory: z
|
|
28
|
+
.array(ConversationMessageSchema)
|
|
29
|
+
.optional()
|
|
30
|
+
.default([])
|
|
31
|
+
.describe('Previous conversation messages for multi-turn interactions (frontend manages state)'),
|
|
32
|
+
model: AvailableModels.default('google/gemini-2.5-pro').describe('AI model to use for Pearl agent'),
|
|
33
|
+
additionalContext: z
|
|
34
|
+
.string()
|
|
35
|
+
.optional()
|
|
36
|
+
.describe('Additional context information like timezone, user preferences, etc.'),
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* Response schema for Pearl agent
|
|
40
|
+
*/
|
|
41
|
+
export const PearlResponseSchema = z.object({
|
|
42
|
+
type: z
|
|
43
|
+
.enum(['code', 'question', 'reject'])
|
|
44
|
+
.describe('Type of response: code (generated workflow), question (needs clarification), reject (infeasible request)'),
|
|
45
|
+
message: z
|
|
46
|
+
.string()
|
|
47
|
+
.describe('Human-readable message: explanation for code, question text, or rejection reason'),
|
|
48
|
+
snippet: z
|
|
49
|
+
.string()
|
|
50
|
+
.optional()
|
|
51
|
+
.describe('Generated TypeScript code for complete workflow (only present when type is "code")'),
|
|
52
|
+
bubbleParameters: z
|
|
53
|
+
.record(z.number(), ParsedBubbleWithInfoSchema)
|
|
54
|
+
.optional()
|
|
55
|
+
.describe('Parsed bubble parameters from the generated workflow (only present when type is "code")'),
|
|
56
|
+
inputSchema: z
|
|
57
|
+
.record(z.unknown())
|
|
58
|
+
.optional()
|
|
59
|
+
.describe('Input schema for the generated workflow (only present when type is "code")'),
|
|
60
|
+
requiredCredentials: z
|
|
61
|
+
.record(z.string(), z.array(z.nativeEnum(CredentialType)))
|
|
62
|
+
.optional()
|
|
63
|
+
.describe('Required credentials for the bubbles in the workflow (only present when type is "code")'),
|
|
64
|
+
success: z.boolean().describe('Whether the operation completed successfully'),
|
|
65
|
+
error: z
|
|
66
|
+
.string()
|
|
67
|
+
.optional()
|
|
68
|
+
.describe('Error message if the operation failed'),
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* Internal agent response format (JSON mode output from AI)
|
|
72
|
+
*/
|
|
73
|
+
export const PearlAgentOutputSchema = z.object({
|
|
74
|
+
type: z.enum(['code', 'question', 'reject']),
|
|
75
|
+
message: z.string(),
|
|
76
|
+
snippet: z.string().optional(),
|
|
77
|
+
});
|
|
78
|
+
// Note: ConversationMessage type is exported from milk-tea.ts to avoid duplication
|
|
79
|
+
//# sourceMappingURL=pearl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pearl.js","sourceRoot":"","sources":["../src/pearl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,yEAAyE;AACzE,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,EAAE,0BAA0B,CAAC;SAClC,QAAQ,CAAC,wDAAwD,CAAC;IAErE,WAAW,EAAE,CAAC;SACX,MA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