@bubblelab/shared-schemas 0.1.10 → 0.1.12
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/agent-memory.d.ts +21 -0
- package/dist/agent-memory.d.ts.map +1 -0
- package/dist/agent-memory.js +11 -0
- package/dist/agent-memory.js.map +1 -0
- package/dist/ai-models.d.ts +1 -1
- package/dist/ai-models.d.ts.map +1 -1
- package/dist/ai-models.js +12 -0
- package/dist/ai-models.js.map +1 -1
- package/dist/api-schema.d.ts +2 -2
- package/dist/bubble-definition-schema.d.ts +559 -75
- package/dist/bubble-definition-schema.d.ts.map +1 -1
- package/dist/bubble-definition-schema.js +186 -0
- package/dist/bubble-definition-schema.js.map +1 -1
- package/dist/bubbleflow-execution-schema.d.ts +594 -147
- package/dist/bubbleflow-execution-schema.d.ts.map +1 -1
- package/dist/bubbleflow-execution-schema.js +46 -26
- package/dist/bubbleflow-execution-schema.js.map +1 -1
- package/dist/bubbleflow-generation-prompts.d.ts +5 -16
- package/dist/bubbleflow-generation-prompts.d.ts.map +1 -1
- package/dist/bubbleflow-generation-prompts.js +14 -54
- package/dist/bubbleflow-generation-prompts.js.map +1 -1
- package/dist/bubbleflow-schema.d.ts +1081 -92
- package/dist/bubbleflow-schema.d.ts.map +1 -1
- package/dist/bubbleflow-schema.js +94 -4
- package/dist/bubbleflow-schema.js.map +1 -1
- package/dist/coffee.d.ts +2201 -0
- package/dist/coffee.d.ts.map +1 -0
- package/dist/coffee.js +257 -0
- package/dist/coffee.js.map +1 -0
- package/dist/credential-schema.d.ts +172 -3
- package/dist/credential-schema.d.ts.map +1 -1
- package/dist/credential-schema.js +509 -5
- package/dist/credential-schema.js.map +1 -1
- package/dist/database-definition-schema.d.ts +8 -8
- package/dist/error-enhancer.d.ts +6 -0
- package/dist/error-enhancer.d.ts.map +1 -0
- package/dist/error-enhancer.js +88 -0
- package/dist/error-enhancer.js.map +1 -0
- package/dist/generate-bubbleflow-schema.d.ts +974 -52
- package/dist/generate-bubbleflow-schema.d.ts.map +1 -1
- package/dist/generate-bubbleflow-schema.js +23 -7
- package/dist/generate-bubbleflow-schema.js.map +1 -1
- package/dist/hash-utils.d.ts +26 -0
- package/dist/hash-utils.d.ts.map +1 -0
- package/dist/hash-utils.js +37 -0
- package/dist/hash-utils.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/milk-tea.d.ts +22 -24
- package/dist/milk-tea.d.ts.map +1 -1
- package/dist/milk-tea.js +1 -4
- package/dist/milk-tea.js.map +1 -1
- package/dist/oauth-schema.d.ts +2 -2
- package/dist/param-utils.d.ts +10 -0
- package/dist/param-utils.d.ts.map +1 -0
- package/dist/param-utils.js +13 -0
- package/dist/param-utils.js.map +1 -0
- package/dist/pearl.d.ts +96 -29
- package/dist/pearl.d.ts.map +1 -1
- package/dist/pearl.js +20 -9
- package/dist/pearl.js.map +1 -1
- package/dist/rice.d.ts +100 -0
- package/dist/rice.d.ts.map +1 -0
- package/dist/rice.js +65 -0
- package/dist/rice.js.map +1 -0
- package/dist/storage-utils.d.ts +19 -0
- package/dist/storage-utils.d.ts.map +1 -0
- package/dist/storage-utils.js +54 -0
- package/dist/storage-utils.js.map +1 -0
- package/dist/streaming-events.d.ts +36 -2
- package/dist/streaming-events.d.ts.map +1 -1
- package/dist/subscription-status-schema.d.ts +192 -32
- package/dist/subscription-status-schema.d.ts.map +1 -1
- package/dist/subscription-status-schema.js +85 -7
- package/dist/subscription-status-schema.js.map +1 -1
- package/dist/trigger.d.ts +45 -51
- package/dist/trigger.d.ts.map +1 -1
- package/dist/trigger.js +0 -2
- package/dist/trigger.js.map +1 -1
- package/dist/types.d.ts +13 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +18 -0
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/dist/general-chat.d.ts +0 -81
- package/dist/general-chat.d.ts.map +0 -1
- package/dist/general-chat.js +0 -58
- package/dist/general-chat.js.map +0 -1
- package/dist/generation-result-schema.d.ts +0 -73
- package/dist/generation-result-schema.d.ts.map +0 -1
- package/dist/generation-result-schema.js +0 -55
- package/dist/generation-result-schema.js.map +0 -1
- package/dist/mock-data-generator.test.d.ts +0 -2
- package/dist/mock-data-generator.test.d.ts.map +0 -1
- package/dist/mock-data-generator.test.js +0 -176
- package/dist/mock-data-generator.test.js.map +0 -1
package/dist/pearl.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { type AvailableModel } from './ai-models.js';
|
|
2
3
|
import { CredentialType } from './types.js';
|
|
4
|
+
export declare const PEARL_DEFAULT_MODEL: AvailableModel;
|
|
3
5
|
/**
|
|
4
6
|
* Request schema for Pearl agent
|
|
5
7
|
* Pearl helps users build complete workflows without requiring specific bubbles
|
|
@@ -10,50 +12,83 @@ export declare const PearlRequestSchema: z.ZodObject<{
|
|
|
10
12
|
userName: z.ZodString;
|
|
11
13
|
availableVariables: z.ZodArray<z.ZodAny, "many">;
|
|
12
14
|
conversationHistory: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
13
|
-
role: z.ZodEnum<["user", "assistant"]>;
|
|
15
|
+
role: z.ZodEnum<["user", "assistant", "tool"]>;
|
|
14
16
|
content: z.ZodString;
|
|
17
|
+
toolCallId: z.ZodOptional<z.ZodString>;
|
|
18
|
+
name: z.ZodOptional<z.ZodString>;
|
|
15
19
|
}, "strip", z.ZodTypeAny, {
|
|
16
20
|
content: string;
|
|
17
|
-
role: "user" | "assistant";
|
|
21
|
+
role: "user" | "assistant" | "tool";
|
|
22
|
+
name?: string | undefined;
|
|
23
|
+
toolCallId?: string | undefined;
|
|
18
24
|
}, {
|
|
19
25
|
content: string;
|
|
20
|
-
role: "user" | "assistant";
|
|
26
|
+
role: "user" | "assistant" | "tool";
|
|
27
|
+
name?: string | undefined;
|
|
28
|
+
toolCallId?: string | undefined;
|
|
21
29
|
}>, "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"]>>;
|
|
30
|
+
model: z.ZodDefault<z.ZodEnum<["openai/gpt-5", "openai/gpt-5-mini", "openai/gpt-5.1", "openai/gpt-5.2", "google/gemini-2.5-pro", "google/gemini-2.5-flash", "google/gemini-2.5-flash-lite", "google/gemini-2.5-flash-image-preview", "google/gemini-3-pro-preview", "google/gemini-3-pro-image-preview", "google/gemini-3-flash-preview", "anthropic/claude-sonnet-4-5", "anthropic/claude-opus-4-5", "anthropic/claude-haiku-4-5", "openrouter/x-ai/grok-code-fast-1", "openrouter/z-ai/glm-4.6", "openrouter/anthropic/claude-sonnet-4.5", "openrouter/google/gemini-3-pro-preview", "openrouter/morph/morph-v3-large", "openrouter/x-ai/grok-4.1-fast", "openrouter/openai/gpt-oss-120b", "openrouter/deepseek/deepseek-chat-v3.1"]>>;
|
|
23
31
|
additionalContext: z.ZodOptional<z.ZodString>;
|
|
32
|
+
uploadedFiles: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
33
|
+
name: z.ZodString;
|
|
34
|
+
content: z.ZodString;
|
|
35
|
+
fileType: z.ZodEnum<["image", "text"]>;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
name: string;
|
|
38
|
+
content: string;
|
|
39
|
+
fileType: "text" | "image";
|
|
40
|
+
}, {
|
|
41
|
+
name: string;
|
|
42
|
+
content: string;
|
|
43
|
+
fileType: "text" | "image";
|
|
44
|
+
}>, "many">>>;
|
|
24
45
|
}, "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";
|
|
46
|
+
model: "openai/gpt-5" | "openai/gpt-5-mini" | "openai/gpt-5.1" | "openai/gpt-5.2" | "google/gemini-2.5-pro" | "google/gemini-2.5-flash" | "google/gemini-2.5-flash-lite" | "google/gemini-2.5-flash-image-preview" | "google/gemini-3-pro-preview" | "google/gemini-3-pro-image-preview" | "google/gemini-3-flash-preview" | "anthropic/claude-sonnet-4-5" | "anthropic/claude-opus-4-5" | "anthropic/claude-haiku-4-5" | "openrouter/x-ai/grok-code-fast-1" | "openrouter/z-ai/glm-4.6" | "openrouter/anthropic/claude-sonnet-4.5" | "openrouter/google/gemini-3-pro-preview" | "openrouter/morph/morph-v3-large" | "openrouter/x-ai/grok-4.1-fast" | "openrouter/openai/gpt-oss-120b" | "openrouter/deepseek/deepseek-chat-v3.1";
|
|
26
47
|
userRequest: string;
|
|
27
48
|
userName: string;
|
|
28
49
|
conversationHistory: {
|
|
29
50
|
content: string;
|
|
30
|
-
role: "user" | "assistant";
|
|
51
|
+
role: "user" | "assistant" | "tool";
|
|
52
|
+
name?: string | undefined;
|
|
53
|
+
toolCallId?: string | undefined;
|
|
31
54
|
}[];
|
|
32
55
|
availableVariables: any[];
|
|
56
|
+
uploadedFiles: {
|
|
57
|
+
name: string;
|
|
58
|
+
content: string;
|
|
59
|
+
fileType: "text" | "image";
|
|
60
|
+
}[];
|
|
33
61
|
currentCode?: string | undefined;
|
|
34
62
|
additionalContext?: string | undefined;
|
|
35
63
|
}, {
|
|
36
64
|
userRequest: string;
|
|
37
65
|
userName: string;
|
|
38
66
|
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;
|
|
67
|
+
model?: "openai/gpt-5" | "openai/gpt-5-mini" | "openai/gpt-5.1" | "openai/gpt-5.2" | "google/gemini-2.5-pro" | "google/gemini-2.5-flash" | "google/gemini-2.5-flash-lite" | "google/gemini-2.5-flash-image-preview" | "google/gemini-3-pro-preview" | "google/gemini-3-pro-image-preview" | "google/gemini-3-flash-preview" | "anthropic/claude-sonnet-4-5" | "anthropic/claude-opus-4-5" | "anthropic/claude-haiku-4-5" | "openrouter/x-ai/grok-code-fast-1" | "openrouter/z-ai/glm-4.6" | "openrouter/anthropic/claude-sonnet-4.5" | "openrouter/google/gemini-3-pro-preview" | "openrouter/morph/morph-v3-large" | "openrouter/x-ai/grok-4.1-fast" | "openrouter/openai/gpt-oss-120b" | "openrouter/deepseek/deepseek-chat-v3.1" | undefined;
|
|
40
68
|
currentCode?: string | undefined;
|
|
41
69
|
conversationHistory?: {
|
|
42
70
|
content: string;
|
|
43
|
-
role: "user" | "assistant";
|
|
71
|
+
role: "user" | "assistant" | "tool";
|
|
72
|
+
name?: string | undefined;
|
|
73
|
+
toolCallId?: string | undefined;
|
|
44
74
|
}[] | undefined;
|
|
45
75
|
additionalContext?: string | undefined;
|
|
76
|
+
uploadedFiles?: {
|
|
77
|
+
name: string;
|
|
78
|
+
content: string;
|
|
79
|
+
fileType: "text" | "image";
|
|
80
|
+
}[] | undefined;
|
|
46
81
|
}>;
|
|
47
82
|
/**
|
|
48
83
|
* Response schema for Pearl agent
|
|
49
84
|
*/
|
|
50
85
|
export declare const PearlResponseSchema: z.ZodObject<{
|
|
51
|
-
type: z.ZodEnum<["code", "question", "reject"]>;
|
|
86
|
+
type: z.ZodEnum<["code", "question", "answer", "reject"]>;
|
|
52
87
|
message: z.ZodString;
|
|
53
88
|
snippet: z.ZodOptional<z.ZodString>;
|
|
54
89
|
bubbleParameters: z.ZodOptional<z.ZodRecord<z.ZodNumber, z.ZodObject<{
|
|
55
90
|
variableName: z.ZodString;
|
|
56
|
-
bubbleName: z.
|
|
91
|
+
bubbleName: z.ZodType<import("./types.js").BubbleName>;
|
|
57
92
|
className: z.ZodString;
|
|
58
93
|
parameters: z.ZodArray<z.ZodObject<{
|
|
59
94
|
location: z.ZodOptional<z.ZodObject<{
|
|
@@ -76,9 +111,10 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
76
111
|
name: z.ZodString;
|
|
77
112
|
value: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodUnknown, "many">]>;
|
|
78
113
|
type: z.ZodNativeEnum<typeof import("./bubble-definition-schema.js").BubbleParameterType>;
|
|
114
|
+
source: z.ZodOptional<z.ZodEnum<["object-property", "first-arg", "spread"]>>;
|
|
79
115
|
}, "strip", z.ZodTypeAny, {
|
|
80
|
-
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
81
116
|
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
117
|
+
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
82
118
|
name: string;
|
|
83
119
|
location?: {
|
|
84
120
|
startLine: number;
|
|
@@ -87,9 +123,10 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
87
123
|
endCol: number;
|
|
88
124
|
} | undefined;
|
|
89
125
|
variableId?: number | undefined;
|
|
126
|
+
source?: "object-property" | "first-arg" | "spread" | undefined;
|
|
90
127
|
}, {
|
|
91
|
-
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
92
128
|
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
129
|
+
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
93
130
|
name: string;
|
|
94
131
|
location?: {
|
|
95
132
|
startLine: number;
|
|
@@ -98,6 +135,7 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
98
135
|
endCol: number;
|
|
99
136
|
} | undefined;
|
|
100
137
|
variableId?: number | undefined;
|
|
138
|
+
source?: "object-property" | "first-arg" | "spread" | undefined;
|
|
101
139
|
}>, "many">;
|
|
102
140
|
hasAwait: z.ZodBoolean;
|
|
103
141
|
hasActionCall: z.ZodBoolean;
|
|
@@ -121,6 +159,11 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
121
159
|
endLine: number;
|
|
122
160
|
endCol: number;
|
|
123
161
|
}>;
|
|
162
|
+
description: z.ZodOptional<z.ZodString>;
|
|
163
|
+
invocationCallSiteKey: z.ZodOptional<z.ZodString>;
|
|
164
|
+
clonedFromVariableId: z.ZodOptional<z.ZodNumber>;
|
|
165
|
+
isInsideCustomTool: z.ZodOptional<z.ZodBoolean>;
|
|
166
|
+
containingCustomToolId: z.ZodOptional<z.ZodString>;
|
|
124
167
|
}, "strip", z.ZodTypeAny, {
|
|
125
168
|
location: {
|
|
126
169
|
startLine: number;
|
|
@@ -130,11 +173,11 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
130
173
|
};
|
|
131
174
|
variableId: number;
|
|
132
175
|
variableName: string;
|
|
133
|
-
|
|
176
|
+
nodeType: "unknown" | "tool" | "service" | "workflow";
|
|
134
177
|
className: string;
|
|
135
178
|
parameters: {
|
|
136
|
-
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
137
179
|
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
180
|
+
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
138
181
|
name: string;
|
|
139
182
|
location?: {
|
|
140
183
|
startLine: number;
|
|
@@ -143,12 +186,18 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
143
186
|
endCol: number;
|
|
144
187
|
} | undefined;
|
|
145
188
|
variableId?: number | undefined;
|
|
189
|
+
source?: "object-property" | "first-arg" | "spread" | undefined;
|
|
146
190
|
}[];
|
|
147
191
|
hasAwait: boolean;
|
|
148
192
|
hasActionCall: boolean;
|
|
149
|
-
|
|
193
|
+
bubbleName: import("./types.js").BubbleName;
|
|
194
|
+
description?: string | undefined;
|
|
150
195
|
dependencies?: import("./types.js").BubbleName[] | undefined;
|
|
151
196
|
dependencyGraph?: import("./bubble-definition-schema.js").DependencyGraphNode | undefined;
|
|
197
|
+
invocationCallSiteKey?: string | undefined;
|
|
198
|
+
clonedFromVariableId?: number | undefined;
|
|
199
|
+
isInsideCustomTool?: boolean | undefined;
|
|
200
|
+
containingCustomToolId?: string | undefined;
|
|
152
201
|
}, {
|
|
153
202
|
location: {
|
|
154
203
|
startLine: number;
|
|
@@ -158,11 +207,11 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
158
207
|
};
|
|
159
208
|
variableId: number;
|
|
160
209
|
variableName: string;
|
|
161
|
-
|
|
210
|
+
nodeType: "unknown" | "tool" | "service" | "workflow";
|
|
162
211
|
className: string;
|
|
163
212
|
parameters: {
|
|
164
|
-
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
165
213
|
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
214
|
+
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
166
215
|
name: string;
|
|
167
216
|
location?: {
|
|
168
217
|
startLine: number;
|
|
@@ -171,20 +220,26 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
171
220
|
endCol: number;
|
|
172
221
|
} | undefined;
|
|
173
222
|
variableId?: number | undefined;
|
|
223
|
+
source?: "object-property" | "first-arg" | "spread" | undefined;
|
|
174
224
|
}[];
|
|
175
225
|
hasAwait: boolean;
|
|
176
226
|
hasActionCall: boolean;
|
|
177
|
-
|
|
227
|
+
bubbleName: import("./types.js").BubbleName;
|
|
228
|
+
description?: string | undefined;
|
|
178
229
|
dependencies?: import("./types.js").BubbleName[] | undefined;
|
|
179
230
|
dependencyGraph?: import("./bubble-definition-schema.js").DependencyGraphNode | undefined;
|
|
231
|
+
invocationCallSiteKey?: string | undefined;
|
|
232
|
+
clonedFromVariableId?: number | undefined;
|
|
233
|
+
isInsideCustomTool?: boolean | undefined;
|
|
234
|
+
containingCustomToolId?: string | undefined;
|
|
180
235
|
}>>>;
|
|
181
236
|
inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
182
237
|
requiredCredentials: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodNativeEnum<typeof CredentialType>, "many">>>;
|
|
183
238
|
success: z.ZodBoolean;
|
|
184
239
|
error: z.ZodOptional<z.ZodString>;
|
|
185
240
|
}, "strip", z.ZodTypeAny, {
|
|
241
|
+
type: "code" | "question" | "answer" | "reject";
|
|
186
242
|
message: string;
|
|
187
|
-
type: "code" | "question" | "reject";
|
|
188
243
|
success: boolean;
|
|
189
244
|
error?: string | undefined;
|
|
190
245
|
inputSchema?: Record<string, unknown> | undefined;
|
|
@@ -198,11 +253,11 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
198
253
|
};
|
|
199
254
|
variableId: number;
|
|
200
255
|
variableName: string;
|
|
201
|
-
|
|
256
|
+
nodeType: "unknown" | "tool" | "service" | "workflow";
|
|
202
257
|
className: string;
|
|
203
258
|
parameters: {
|
|
204
|
-
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
205
259
|
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
260
|
+
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
206
261
|
name: string;
|
|
207
262
|
location?: {
|
|
208
263
|
startLine: number;
|
|
@@ -211,17 +266,23 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
211
266
|
endCol: number;
|
|
212
267
|
} | undefined;
|
|
213
268
|
variableId?: number | undefined;
|
|
269
|
+
source?: "object-property" | "first-arg" | "spread" | undefined;
|
|
214
270
|
}[];
|
|
215
271
|
hasAwait: boolean;
|
|
216
272
|
hasActionCall: boolean;
|
|
217
|
-
|
|
273
|
+
bubbleName: import("./types.js").BubbleName;
|
|
274
|
+
description?: string | undefined;
|
|
218
275
|
dependencies?: import("./types.js").BubbleName[] | undefined;
|
|
219
276
|
dependencyGraph?: import("./bubble-definition-schema.js").DependencyGraphNode | undefined;
|
|
277
|
+
invocationCallSiteKey?: string | undefined;
|
|
278
|
+
clonedFromVariableId?: number | undefined;
|
|
279
|
+
isInsideCustomTool?: boolean | undefined;
|
|
280
|
+
containingCustomToolId?: string | undefined;
|
|
220
281
|
}> | undefined;
|
|
221
282
|
snippet?: string | undefined;
|
|
222
283
|
}, {
|
|
284
|
+
type: "code" | "question" | "answer" | "reject";
|
|
223
285
|
message: string;
|
|
224
|
-
type: "code" | "question" | "reject";
|
|
225
286
|
success: boolean;
|
|
226
287
|
error?: string | undefined;
|
|
227
288
|
inputSchema?: Record<string, unknown> | undefined;
|
|
@@ -235,11 +296,11 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
235
296
|
};
|
|
236
297
|
variableId: number;
|
|
237
298
|
variableName: string;
|
|
238
|
-
|
|
299
|
+
nodeType: "unknown" | "tool" | "service" | "workflow";
|
|
239
300
|
className: string;
|
|
240
301
|
parameters: {
|
|
241
|
-
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
242
302
|
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
303
|
+
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
243
304
|
name: string;
|
|
244
305
|
location?: {
|
|
245
306
|
startLine: number;
|
|
@@ -248,12 +309,18 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
248
309
|
endCol: number;
|
|
249
310
|
} | undefined;
|
|
250
311
|
variableId?: number | undefined;
|
|
312
|
+
source?: "object-property" | "first-arg" | "spread" | undefined;
|
|
251
313
|
}[];
|
|
252
314
|
hasAwait: boolean;
|
|
253
315
|
hasActionCall: boolean;
|
|
254
|
-
|
|
316
|
+
bubbleName: import("./types.js").BubbleName;
|
|
317
|
+
description?: string | undefined;
|
|
255
318
|
dependencies?: import("./types.js").BubbleName[] | undefined;
|
|
256
319
|
dependencyGraph?: import("./bubble-definition-schema.js").DependencyGraphNode | undefined;
|
|
320
|
+
invocationCallSiteKey?: string | undefined;
|
|
321
|
+
clonedFromVariableId?: number | undefined;
|
|
322
|
+
isInsideCustomTool?: boolean | undefined;
|
|
323
|
+
containingCustomToolId?: string | undefined;
|
|
257
324
|
}> | undefined;
|
|
258
325
|
snippet?: string | undefined;
|
|
259
326
|
}>;
|
|
@@ -261,16 +328,16 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
261
328
|
* Internal agent response format (JSON mode output from AI)
|
|
262
329
|
*/
|
|
263
330
|
export declare const PearlAgentOutputSchema: z.ZodObject<{
|
|
264
|
-
type: z.ZodEnum<["code", "question", "reject"]>;
|
|
331
|
+
type: z.ZodEnum<["code", "question", "answer", "reject", "text"]>;
|
|
265
332
|
message: z.ZodString;
|
|
266
333
|
snippet: z.ZodOptional<z.ZodString>;
|
|
267
334
|
}, "strip", z.ZodTypeAny, {
|
|
335
|
+
type: "code" | "text" | "question" | "answer" | "reject";
|
|
268
336
|
message: string;
|
|
269
|
-
type: "code" | "question" | "reject";
|
|
270
337
|
snippet?: string | undefined;
|
|
271
338
|
}, {
|
|
339
|
+
type: "code" | "text" | "question" | "answer" | "reject";
|
|
272
340
|
message: string;
|
|
273
|
-
type: "code" | "question" | "reject";
|
|
274
341
|
snippet?: string | undefined;
|
|
275
342
|
}>;
|
|
276
343
|
export type PearlRequest = z.infer<typeof PearlRequestSchema>;
|
package/dist/pearl.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pearl.d.ts","sourceRoot":"","sources":["../src/pearl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"pearl.d.ts","sourceRoot":"","sources":["../src/pearl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEtE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAG5C,eAAO,MAAM,mBAAmB,EAAE,cACQ,CAAC;AAC3C;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqD7B,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
CHANGED
|
@@ -2,11 +2,9 @@ import { z } from 'zod';
|
|
|
2
2
|
import { AvailableModels } from './ai-models.js';
|
|
3
3
|
import { ParsedBubbleWithInfoSchema } from './bubble-definition-schema.js';
|
|
4
4
|
import { CredentialType } from './types.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
content: z.string(),
|
|
9
|
-
});
|
|
5
|
+
import { ConversationMessageSchema } from './agent-memory.js';
|
|
6
|
+
// Default model for Pearl AI agent
|
|
7
|
+
export const PEARL_DEFAULT_MODEL = 'openrouter/anthropic/claude-sonnet-4.5';
|
|
10
8
|
/**
|
|
11
9
|
* Request schema for Pearl agent
|
|
12
10
|
* Pearl helps users build complete workflows without requiring specific bubbles
|
|
@@ -29,19 +27,32 @@ export const PearlRequestSchema = z.object({
|
|
|
29
27
|
.optional()
|
|
30
28
|
.default([])
|
|
31
29
|
.describe('Previous conversation messages for multi-turn interactions (frontend manages state)'),
|
|
32
|
-
model: AvailableModels.default(
|
|
30
|
+
model: AvailableModels.default(PEARL_DEFAULT_MODEL).describe('AI model to use for Pearl agent'),
|
|
33
31
|
additionalContext: z
|
|
34
32
|
.string()
|
|
35
33
|
.optional()
|
|
36
34
|
.describe('Additional context information like timezone, user preferences, etc.'),
|
|
35
|
+
uploadedFiles: z
|
|
36
|
+
.array(z.object({
|
|
37
|
+
name: z.string().describe('File name'),
|
|
38
|
+
content: z
|
|
39
|
+
.string()
|
|
40
|
+
.describe('File content: base64 for images, plain text for text files'),
|
|
41
|
+
fileType: z
|
|
42
|
+
.enum(['image', 'text'])
|
|
43
|
+
.describe('Type of file: image (base64) or text (plain text)'),
|
|
44
|
+
}))
|
|
45
|
+
.optional()
|
|
46
|
+
.default([])
|
|
47
|
+
.describe('Files uploaded by the user: images as base64, text files as plain text'),
|
|
37
48
|
});
|
|
38
49
|
/**
|
|
39
50
|
* Response schema for Pearl agent
|
|
40
51
|
*/
|
|
41
52
|
export const PearlResponseSchema = z.object({
|
|
42
53
|
type: z
|
|
43
|
-
.enum(['code', 'question', 'reject'])
|
|
44
|
-
.describe('Type of response: code (generated workflow), question (needs clarification), reject (infeasible request)'),
|
|
54
|
+
.enum(['code', 'question', 'answer', 'reject'])
|
|
55
|
+
.describe('Type of response: code (generated workflow), question (needs clarification), answer (provides information/guidance), reject (infeasible request)'),
|
|
45
56
|
message: z
|
|
46
57
|
.string()
|
|
47
58
|
.describe('Human-readable message: explanation for code, question text, or rejection reason'),
|
|
@@ -71,7 +82,7 @@ export const PearlResponseSchema = z.object({
|
|
|
71
82
|
* Internal agent response format (JSON mode output from AI)
|
|
72
83
|
*/
|
|
73
84
|
export const PearlAgentOutputSchema = z.object({
|
|
74
|
-
type: z.enum(['code', 'question', 'reject']),
|
|
85
|
+
type: z.enum(['code', 'question', 'answer', 'reject', 'text']),
|
|
75
86
|
message: z.string(),
|
|
76
87
|
snippet: z.string().optional(),
|
|
77
88
|
});
|
package/dist/pearl.js.map
CHANGED
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"pearl.js","sourceRoot":"","sources":["../src/pearl.ts"],"names":[],"mappings":"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"}
|
package/dist/rice.d.ts
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type AvailableModel } from './ai-models.js';
|
|
3
|
+
export declare const RICE_DEFAULT_MODEL: AvailableModel;
|
|
4
|
+
/**
|
|
5
|
+
* Issue type categories for Rice evaluation
|
|
6
|
+
* - setup: Configuration/credential issues (user can fix in settings, not workflow code)
|
|
7
|
+
* - workflow: Logic/code issues in the workflow itself (fixable with Pearl)
|
|
8
|
+
* - input: Issues with input data (user needs to provide different input)
|
|
9
|
+
* - null: No issues (working=true)
|
|
10
|
+
*/
|
|
11
|
+
export declare const RiceIssueTypeSchema: z.ZodNullable<z.ZodEnum<["setup", "workflow", "input"]>>;
|
|
12
|
+
export type RiceIssueType = z.infer<typeof RiceIssueTypeSchema>;
|
|
13
|
+
/**
|
|
14
|
+
* Evaluation result schema from Rice agent
|
|
15
|
+
* This represents the AI's assessment of workflow execution quality
|
|
16
|
+
*/
|
|
17
|
+
export declare const RiceEvaluationResultSchema: z.ZodObject<{
|
|
18
|
+
working: z.ZodBoolean;
|
|
19
|
+
issueType: z.ZodNullable<z.ZodEnum<["setup", "workflow", "input"]>>;
|
|
20
|
+
summary: z.ZodString;
|
|
21
|
+
rating: z.ZodNumber;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
working: boolean;
|
|
24
|
+
issueType: "setup" | "workflow" | "input" | null;
|
|
25
|
+
summary: string;
|
|
26
|
+
rating: number;
|
|
27
|
+
}, {
|
|
28
|
+
working: boolean;
|
|
29
|
+
issueType: "setup" | "workflow" | "input" | null;
|
|
30
|
+
summary: string;
|
|
31
|
+
rating: number;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Request schema for Rice evaluation agent
|
|
35
|
+
* Rice evaluates workflow execution quality based on logs and code
|
|
36
|
+
*/
|
|
37
|
+
export declare const RiceRequestSchema: z.ZodObject<{
|
|
38
|
+
executionLogs: z.ZodArray<z.ZodUnknown, "many">;
|
|
39
|
+
workflowCode: z.ZodString;
|
|
40
|
+
executionId: z.ZodNumber;
|
|
41
|
+
bubbleFlowId: z.ZodNumber;
|
|
42
|
+
model: z.ZodDefault<z.ZodOptional<z.ZodEnum<["openai/gpt-5", "openai/gpt-5-mini", "openai/gpt-5.1", "openai/gpt-5.2", "google/gemini-2.5-pro", "google/gemini-2.5-flash", "google/gemini-2.5-flash-lite", "google/gemini-2.5-flash-image-preview", "google/gemini-3-pro-preview", "google/gemini-3-pro-image-preview", "google/gemini-3-flash-preview", "anthropic/claude-sonnet-4-5", "anthropic/claude-opus-4-5", "anthropic/claude-haiku-4-5", "openrouter/x-ai/grok-code-fast-1", "openrouter/z-ai/glm-4.6", "openrouter/anthropic/claude-sonnet-4.5", "openrouter/google/gemini-3-pro-preview", "openrouter/morph/morph-v3-large", "openrouter/x-ai/grok-4.1-fast", "openrouter/openai/gpt-oss-120b", "openrouter/deepseek/deepseek-chat-v3.1"]>>>;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
executionLogs: unknown[];
|
|
45
|
+
workflowCode: string;
|
|
46
|
+
executionId: number;
|
|
47
|
+
bubbleFlowId: number;
|
|
48
|
+
model: "openai/gpt-5" | "openai/gpt-5-mini" | "openai/gpt-5.1" | "openai/gpt-5.2" | "google/gemini-2.5-pro" | "google/gemini-2.5-flash" | "google/gemini-2.5-flash-lite" | "google/gemini-2.5-flash-image-preview" | "google/gemini-3-pro-preview" | "google/gemini-3-pro-image-preview" | "google/gemini-3-flash-preview" | "anthropic/claude-sonnet-4-5" | "anthropic/claude-opus-4-5" | "anthropic/claude-haiku-4-5" | "openrouter/x-ai/grok-code-fast-1" | "openrouter/z-ai/glm-4.6" | "openrouter/anthropic/claude-sonnet-4.5" | "openrouter/google/gemini-3-pro-preview" | "openrouter/morph/morph-v3-large" | "openrouter/x-ai/grok-4.1-fast" | "openrouter/openai/gpt-oss-120b" | "openrouter/deepseek/deepseek-chat-v3.1";
|
|
49
|
+
}, {
|
|
50
|
+
executionLogs: unknown[];
|
|
51
|
+
workflowCode: string;
|
|
52
|
+
executionId: number;
|
|
53
|
+
bubbleFlowId: number;
|
|
54
|
+
model?: "openai/gpt-5" | "openai/gpt-5-mini" | "openai/gpt-5.1" | "openai/gpt-5.2" | "google/gemini-2.5-pro" | "google/gemini-2.5-flash" | "google/gemini-2.5-flash-lite" | "google/gemini-2.5-flash-image-preview" | "google/gemini-3-pro-preview" | "google/gemini-3-pro-image-preview" | "google/gemini-3-flash-preview" | "anthropic/claude-sonnet-4-5" | "anthropic/claude-opus-4-5" | "anthropic/claude-haiku-4-5" | "openrouter/x-ai/grok-code-fast-1" | "openrouter/z-ai/glm-4.6" | "openrouter/anthropic/claude-sonnet-4.5" | "openrouter/google/gemini-3-pro-preview" | "openrouter/morph/morph-v3-large" | "openrouter/x-ai/grok-4.1-fast" | "openrouter/openai/gpt-oss-120b" | "openrouter/deepseek/deepseek-chat-v3.1" | undefined;
|
|
55
|
+
}>;
|
|
56
|
+
/**
|
|
57
|
+
* Response schema for Rice evaluation agent
|
|
58
|
+
*/
|
|
59
|
+
export declare const RiceResponseSchema: z.ZodObject<{
|
|
60
|
+
success: z.ZodBoolean;
|
|
61
|
+
evaluation: z.ZodOptional<z.ZodObject<{
|
|
62
|
+
working: z.ZodBoolean;
|
|
63
|
+
issueType: z.ZodNullable<z.ZodEnum<["setup", "workflow", "input"]>>;
|
|
64
|
+
summary: z.ZodString;
|
|
65
|
+
rating: z.ZodNumber;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
working: boolean;
|
|
68
|
+
issueType: "setup" | "workflow" | "input" | null;
|
|
69
|
+
summary: string;
|
|
70
|
+
rating: number;
|
|
71
|
+
}, {
|
|
72
|
+
working: boolean;
|
|
73
|
+
issueType: "setup" | "workflow" | "input" | null;
|
|
74
|
+
summary: string;
|
|
75
|
+
rating: number;
|
|
76
|
+
}>>;
|
|
77
|
+
error: z.ZodOptional<z.ZodString>;
|
|
78
|
+
}, "strip", z.ZodTypeAny, {
|
|
79
|
+
success: boolean;
|
|
80
|
+
evaluation?: {
|
|
81
|
+
working: boolean;
|
|
82
|
+
issueType: "setup" | "workflow" | "input" | null;
|
|
83
|
+
summary: string;
|
|
84
|
+
rating: number;
|
|
85
|
+
} | undefined;
|
|
86
|
+
error?: string | undefined;
|
|
87
|
+
}, {
|
|
88
|
+
success: boolean;
|
|
89
|
+
evaluation?: {
|
|
90
|
+
working: boolean;
|
|
91
|
+
issueType: "setup" | "workflow" | "input" | null;
|
|
92
|
+
summary: string;
|
|
93
|
+
rating: number;
|
|
94
|
+
} | undefined;
|
|
95
|
+
error?: string | undefined;
|
|
96
|
+
}>;
|
|
97
|
+
export type RiceEvaluationResult = z.infer<typeof RiceEvaluationResultSchema>;
|
|
98
|
+
export type RiceRequest = z.input<typeof RiceRequestSchema>;
|
|
99
|
+
export type RiceResponse = z.infer<typeof RiceResponseSchema>;
|
|
100
|
+
//# sourceMappingURL=rice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rice.d.ts","sourceRoot":"","sources":["../src/rice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAItE,eAAO,MAAM,kBAAkB,EAAE,cAAwC,CAAC;AAE1E;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,0DAEnB,CAAC;AAEd,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;EAyBrC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;EAgB5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa7B,CAAC;AAGH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAK9E,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
package/dist/rice.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AvailableModels } from './ai-models.js';
|
|
3
|
+
import { RECOMMENDED_MODELS } from './bubbleflow-generation-prompts.js';
|
|
4
|
+
// Default model for Rice evaluation agent
|
|
5
|
+
export const RICE_DEFAULT_MODEL = RECOMMENDED_MODELS.FAST;
|
|
6
|
+
/**
|
|
7
|
+
* Issue type categories for Rice evaluation
|
|
8
|
+
* - setup: Configuration/credential issues (user can fix in settings, not workflow code)
|
|
9
|
+
* - workflow: Logic/code issues in the workflow itself (fixable with Pearl)
|
|
10
|
+
* - input: Issues with input data (user needs to provide different input)
|
|
11
|
+
* - null: No issues (working=true)
|
|
12
|
+
*/
|
|
13
|
+
export const RiceIssueTypeSchema = z
|
|
14
|
+
.enum(['setup', 'workflow', 'input'])
|
|
15
|
+
.nullable();
|
|
16
|
+
/**
|
|
17
|
+
* Evaluation result schema from Rice agent
|
|
18
|
+
* This represents the AI's assessment of workflow execution quality
|
|
19
|
+
*/
|
|
20
|
+
export const RiceEvaluationResultSchema = z.object({
|
|
21
|
+
working: z
|
|
22
|
+
.boolean()
|
|
23
|
+
.describe('Whether the workflow is functioning correctly (true if no errors and expected behavior)'),
|
|
24
|
+
issueType: RiceIssueTypeSchema.describe('Category of issue: "setup" (config/credentials), "workflow" (code logic), "input" (bad input data), or null if working'),
|
|
25
|
+
summary: z
|
|
26
|
+
.string()
|
|
27
|
+
.describe('Brief summary of the execution. If working: what happened and any external changes made. If not working: description of the issue.'),
|
|
28
|
+
rating: z
|
|
29
|
+
.number()
|
|
30
|
+
.int()
|
|
31
|
+
.min(1)
|
|
32
|
+
.max(10)
|
|
33
|
+
.describe('Quality rating 1-10: 1-3=severe issues, 4-6=partial functionality, 7-8=working with minor issues, 9-10=excellent'),
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* Request schema for Rice evaluation agent
|
|
37
|
+
* Rice evaluates workflow execution quality based on logs and code
|
|
38
|
+
*/
|
|
39
|
+
export const RiceRequestSchema = z.object({
|
|
40
|
+
executionLogs: z
|
|
41
|
+
.array(z.unknown())
|
|
42
|
+
.describe('StreamingLogEvent[] from execution'),
|
|
43
|
+
workflowCode: z
|
|
44
|
+
.string()
|
|
45
|
+
.describe('The original workflow code that was executed'),
|
|
46
|
+
executionId: z.number().describe('ID of the execution being evaluated'),
|
|
47
|
+
bubbleFlowId: z.number().describe('ID of the BubbleFlow being evaluated'),
|
|
48
|
+
model: AvailableModels.optional()
|
|
49
|
+
.default(RICE_DEFAULT_MODEL)
|
|
50
|
+
.describe('AI model to use for Rice evaluation'),
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* Response schema for Rice evaluation agent
|
|
54
|
+
*/
|
|
55
|
+
export const RiceResponseSchema = z.object({
|
|
56
|
+
success: z
|
|
57
|
+
.boolean()
|
|
58
|
+
.describe('Whether the evaluation completed successfully'),
|
|
59
|
+
evaluation: RiceEvaluationResultSchema.optional().describe('Evaluation result (only present if success=true)'),
|
|
60
|
+
error: z
|
|
61
|
+
.string()
|
|
62
|
+
.optional()
|
|
63
|
+
.describe('Error message if the evaluation failed'),
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=rice.js.map
|
package/dist/rice.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rice.js","sourceRoot":"","sources":["../src/rice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAuB,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE,0CAA0C;AAC1C,MAAM,CAAC,MAAM,kBAAkB,GAAmB,kBAAkB,CAAC,IAAI,CAAC;AAE1E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC;KACjC,IAAI,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;KACpC,QAAQ,EAAE,CAAC;AAId;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,OAAO,EAAE,CAAC;SACP,OAAO,EAAE;SACT,QAAQ,CACP,yFAAyF,CAC1F;IAEH,SAAS,EAAE,mBAAmB,CAAC,QAAQ,CACrC,wHAAwH,CACzH;IAED,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,CACP,oIAAoI,CACrI;IAEH,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,QAAQ,CACP,kHAAkH,CACnH;CACJ,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,aAAa,EAAE,CAAC;SACb,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SAClB,QAAQ,CAAC,oCAAoC,CAAC;IAEjD,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,QAAQ,CAAC,8CAA8C,CAAC;IAE3D,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IAEvE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;IAEzE,KAAK,EAAE,eAAe,CAAC,QAAQ,EAAE;SAC9B,OAAO,CAAC,kBAAkB,CAAC;SAC3B,QAAQ,CAAC,qCAAqC,CAAC;CACnD,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,OAAO,EAAE,CAAC;SACP,OAAO,EAAE;SACT,QAAQ,CAAC,+CAA+C,CAAC;IAE5D,UAAU,EAAE,0BAA0B,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACxD,kDAAkD,CACnD;IAED,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,wCAAwC,CAAC;CACtD,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type StorableValue = {
|
|
2
|
+
truncated: boolean;
|
|
3
|
+
preview: string | unknown;
|
|
4
|
+
sizeBytes: number;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Prepare an object for storage with a size cap. If the JSON stringified
|
|
8
|
+
* representation exceeds maxBytes, return a preview marker with metadata.
|
|
9
|
+
* Also logs a warning when truncation happens.
|
|
10
|
+
*
|
|
11
|
+
* Returns a consistent object structure when truncated to ensure compatibility
|
|
12
|
+
* with database schemas expecting JSON objects (jsonb/text with mode: 'json').
|
|
13
|
+
*/
|
|
14
|
+
export declare function prepareForStorage(value: unknown, options?: {
|
|
15
|
+
maxBytes?: number;
|
|
16
|
+
previewBytes?: number;
|
|
17
|
+
}): StorableValue;
|
|
18
|
+
export declare function cleanUpObjectForDisplayAndStorage(obj: unknown, maxBytes?: number): unknown;
|
|
19
|
+
//# sourceMappingURL=storage-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-utils.d.ts","sourceRoot":"","sources":["../src/storage-utils.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GACrD,aAAa,CA2Cf;AAED,wBAAgB,iCAAiC,CAC/C,GAAG,EAAE,OAAO,EACZ,QAAQ,GAAE,MAAoB,GAC7B,OAAO,CAMT"}
|