@bubblelab/shared-schemas 0.1.9 → 0.1.11
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 +14 -3
- package/dist/ai-models.js.map +1 -1
- package/dist/bubble-definition-schema.d.ts +559 -69
- package/dist/bubble-definition-schema.d.ts.map +1 -1
- package/dist/bubble-definition-schema.js +184 -0
- package/dist/bubble-definition-schema.js.map +1 -1
- package/dist/bubbleflow-execution-schema.d.ts +862 -233
- package/dist/bubbleflow-execution-schema.d.ts.map +1 -1
- package/dist/bubbleflow-execution-schema.js +157 -33
- package/dist/bubbleflow-execution-schema.js.map +1 -1
- package/dist/bubbleflow-generation-prompts.d.ts +25 -0
- package/dist/bubbleflow-generation-prompts.d.ts.map +1 -0
- package/dist/bubbleflow-generation-prompts.js +426 -0
- package/dist/bubbleflow-generation-prompts.js.map +1 -0
- package/dist/bubbleflow-schema.d.ts +1136 -119
- package/dist/bubbleflow-schema.d.ts.map +1 -1
- package/dist/bubbleflow-schema.js +115 -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 +258 -0
- package/dist/coffee.js.map +1 -0
- package/dist/credential-schema.d.ts +27 -13
- package/dist/credential-schema.d.ts.map +1 -1
- package/dist/credential-schema.js +138 -14
- 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 +1038 -46
- package/dist/generate-bubbleflow-schema.d.ts.map +1 -1
- package/dist/generate-bubbleflow-schema.js +57 -0
- 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 +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -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 +100 -30
- package/dist/pearl.d.ts.map +1 -1
- package/dist/pearl.js +24 -9
- package/dist/pearl.js.map +1 -1
- 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 +29 -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 +113 -0
- package/dist/trigger.d.ts.map +1 -0
- package/dist/trigger.js +12 -0
- package/dist/trigger.js.map +1 -0
- package/dist/types.d.ts +11 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +14 -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/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,47 +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, {
|
|
20
|
+
role: "user" | "assistant" | "tool";
|
|
16
21
|
content: string;
|
|
17
|
-
|
|
22
|
+
toolCallId?: string | undefined;
|
|
23
|
+
name?: string | undefined;
|
|
18
24
|
}, {
|
|
25
|
+
role: "user" | "assistant" | "tool";
|
|
19
26
|
content: string;
|
|
20
|
-
|
|
27
|
+
toolCallId?: string | undefined;
|
|
28
|
+
name?: string | undefined;
|
|
29
|
+
}>, "many">>>;
|
|
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"]>>;
|
|
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
|
+
content: string;
|
|
38
|
+
name: string;
|
|
39
|
+
fileType: "text" | "image";
|
|
40
|
+
}, {
|
|
41
|
+
content: string;
|
|
42
|
+
name: string;
|
|
43
|
+
fileType: "text" | "image";
|
|
21
44
|
}>, "many">>>;
|
|
22
|
-
model: z.ZodDefault<z.ZodEnum<["openai/gpt-5", "openai/gpt-5-mini", "openai/gpt-o4-mini", "openai/gpt-4o", "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-20250929", "openrouter/x-ai/grok-code-fast-1", "openrouter/z-ai/glm-4.6"]>>;
|
|
23
45
|
}, "strip", z.ZodTypeAny, {
|
|
24
|
-
model: "
|
|
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";
|
|
25
47
|
userRequest: string;
|
|
26
48
|
userName: string;
|
|
27
|
-
availableVariables: any[];
|
|
28
49
|
conversationHistory: {
|
|
50
|
+
role: "user" | "assistant" | "tool";
|
|
51
|
+
content: string;
|
|
52
|
+
toolCallId?: string | undefined;
|
|
53
|
+
name?: string | undefined;
|
|
54
|
+
}[];
|
|
55
|
+
availableVariables: any[];
|
|
56
|
+
uploadedFiles: {
|
|
29
57
|
content: string;
|
|
30
|
-
|
|
58
|
+
name: string;
|
|
59
|
+
fileType: "text" | "image";
|
|
31
60
|
}[];
|
|
32
61
|
currentCode?: string | undefined;
|
|
62
|
+
additionalContext?: string | undefined;
|
|
33
63
|
}, {
|
|
34
64
|
userRequest: string;
|
|
35
65
|
userName: string;
|
|
36
66
|
availableVariables: any[];
|
|
37
|
-
model?: "
|
|
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;
|
|
38
68
|
currentCode?: string | undefined;
|
|
39
69
|
conversationHistory?: {
|
|
70
|
+
role: "user" | "assistant" | "tool";
|
|
71
|
+
content: string;
|
|
72
|
+
toolCallId?: string | undefined;
|
|
73
|
+
name?: string | undefined;
|
|
74
|
+
}[] | undefined;
|
|
75
|
+
additionalContext?: string | undefined;
|
|
76
|
+
uploadedFiles?: {
|
|
40
77
|
content: string;
|
|
41
|
-
|
|
78
|
+
name: string;
|
|
79
|
+
fileType: "text" | "image";
|
|
42
80
|
}[] | undefined;
|
|
43
81
|
}>;
|
|
44
82
|
/**
|
|
45
83
|
* Response schema for Pearl agent
|
|
46
84
|
*/
|
|
47
85
|
export declare const PearlResponseSchema: z.ZodObject<{
|
|
48
|
-
type: z.ZodEnum<["code", "question", "reject"]>;
|
|
86
|
+
type: z.ZodEnum<["code", "question", "answer", "reject"]>;
|
|
49
87
|
message: z.ZodString;
|
|
50
88
|
snippet: z.ZodOptional<z.ZodString>;
|
|
51
89
|
bubbleParameters: z.ZodOptional<z.ZodRecord<z.ZodNumber, z.ZodObject<{
|
|
52
90
|
variableName: z.ZodString;
|
|
53
|
-
bubbleName: z.
|
|
91
|
+
bubbleName: z.ZodType<import("./types.js").BubbleName>;
|
|
54
92
|
className: z.ZodString;
|
|
55
93
|
parameters: z.ZodArray<z.ZodObject<{
|
|
56
94
|
location: z.ZodOptional<z.ZodObject<{
|
|
@@ -73,10 +111,11 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
73
111
|
name: z.ZodString;
|
|
74
112
|
value: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodUnknown, "many">]>;
|
|
75
113
|
type: z.ZodNativeEnum<typeof import("./bubble-definition-schema.js").BubbleParameterType>;
|
|
114
|
+
source: z.ZodOptional<z.ZodEnum<["object-property", "first-arg", "spread"]>>;
|
|
76
115
|
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
name: string;
|
|
77
117
|
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
78
118
|
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
79
|
-
name: string;
|
|
80
119
|
location?: {
|
|
81
120
|
startLine: number;
|
|
82
121
|
startCol: number;
|
|
@@ -84,10 +123,11 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
84
123
|
endCol: number;
|
|
85
124
|
} | undefined;
|
|
86
125
|
variableId?: number | undefined;
|
|
126
|
+
source?: "object-property" | "first-arg" | "spread" | undefined;
|
|
87
127
|
}, {
|
|
128
|
+
name: string;
|
|
88
129
|
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
89
130
|
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
90
|
-
name: string;
|
|
91
131
|
location?: {
|
|
92
132
|
startLine: number;
|
|
93
133
|
startCol: number;
|
|
@@ -95,6 +135,7 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
95
135
|
endCol: number;
|
|
96
136
|
} | undefined;
|
|
97
137
|
variableId?: number | undefined;
|
|
138
|
+
source?: "object-property" | "first-arg" | "spread" | undefined;
|
|
98
139
|
}>, "many">;
|
|
99
140
|
hasAwait: z.ZodBoolean;
|
|
100
141
|
hasActionCall: z.ZodBoolean;
|
|
@@ -118,6 +159,11 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
118
159
|
endLine: number;
|
|
119
160
|
endCol: number;
|
|
120
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>;
|
|
121
167
|
}, "strip", z.ZodTypeAny, {
|
|
122
168
|
location: {
|
|
123
169
|
startLine: number;
|
|
@@ -127,12 +173,12 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
127
173
|
};
|
|
128
174
|
variableId: number;
|
|
129
175
|
variableName: string;
|
|
130
|
-
|
|
176
|
+
nodeType: "tool" | "unknown" | "service" | "workflow";
|
|
131
177
|
className: string;
|
|
132
178
|
parameters: {
|
|
179
|
+
name: string;
|
|
133
180
|
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
134
181
|
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
135
|
-
name: string;
|
|
136
182
|
location?: {
|
|
137
183
|
startLine: number;
|
|
138
184
|
startCol: number;
|
|
@@ -140,12 +186,18 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
140
186
|
endCol: number;
|
|
141
187
|
} | undefined;
|
|
142
188
|
variableId?: number | undefined;
|
|
189
|
+
source?: "object-property" | "first-arg" | "spread" | undefined;
|
|
143
190
|
}[];
|
|
144
191
|
hasAwait: boolean;
|
|
145
192
|
hasActionCall: boolean;
|
|
146
|
-
|
|
193
|
+
bubbleName: import("./types.js").BubbleName;
|
|
194
|
+
description?: string | undefined;
|
|
147
195
|
dependencies?: import("./types.js").BubbleName[] | undefined;
|
|
148
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;
|
|
149
201
|
}, {
|
|
150
202
|
location: {
|
|
151
203
|
startLine: number;
|
|
@@ -155,12 +207,12 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
155
207
|
};
|
|
156
208
|
variableId: number;
|
|
157
209
|
variableName: string;
|
|
158
|
-
|
|
210
|
+
nodeType: "tool" | "unknown" | "service" | "workflow";
|
|
159
211
|
className: string;
|
|
160
212
|
parameters: {
|
|
213
|
+
name: string;
|
|
161
214
|
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
162
215
|
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
163
|
-
name: string;
|
|
164
216
|
location?: {
|
|
165
217
|
startLine: number;
|
|
166
218
|
startCol: number;
|
|
@@ -168,12 +220,18 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
168
220
|
endCol: number;
|
|
169
221
|
} | undefined;
|
|
170
222
|
variableId?: number | undefined;
|
|
223
|
+
source?: "object-property" | "first-arg" | "spread" | undefined;
|
|
171
224
|
}[];
|
|
172
225
|
hasAwait: boolean;
|
|
173
226
|
hasActionCall: boolean;
|
|
174
|
-
|
|
227
|
+
bubbleName: import("./types.js").BubbleName;
|
|
228
|
+
description?: string | undefined;
|
|
175
229
|
dependencies?: import("./types.js").BubbleName[] | undefined;
|
|
176
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;
|
|
177
235
|
}>>>;
|
|
178
236
|
inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
179
237
|
requiredCredentials: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodNativeEnum<typeof CredentialType>, "many">>>;
|
|
@@ -181,7 +239,7 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
181
239
|
error: z.ZodOptional<z.ZodString>;
|
|
182
240
|
}, "strip", z.ZodTypeAny, {
|
|
183
241
|
message: string;
|
|
184
|
-
type: "code" | "question" | "reject";
|
|
242
|
+
type: "code" | "question" | "answer" | "reject";
|
|
185
243
|
success: boolean;
|
|
186
244
|
error?: string | undefined;
|
|
187
245
|
inputSchema?: Record<string, unknown> | undefined;
|
|
@@ -195,12 +253,12 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
195
253
|
};
|
|
196
254
|
variableId: number;
|
|
197
255
|
variableName: string;
|
|
198
|
-
|
|
256
|
+
nodeType: "tool" | "unknown" | "service" | "workflow";
|
|
199
257
|
className: string;
|
|
200
258
|
parameters: {
|
|
259
|
+
name: string;
|
|
201
260
|
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
202
261
|
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
203
|
-
name: string;
|
|
204
262
|
location?: {
|
|
205
263
|
startLine: number;
|
|
206
264
|
startCol: number;
|
|
@@ -208,17 +266,23 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
208
266
|
endCol: number;
|
|
209
267
|
} | undefined;
|
|
210
268
|
variableId?: number | undefined;
|
|
269
|
+
source?: "object-property" | "first-arg" | "spread" | undefined;
|
|
211
270
|
}[];
|
|
212
271
|
hasAwait: boolean;
|
|
213
272
|
hasActionCall: boolean;
|
|
214
|
-
|
|
273
|
+
bubbleName: import("./types.js").BubbleName;
|
|
274
|
+
description?: string | undefined;
|
|
215
275
|
dependencies?: import("./types.js").BubbleName[] | undefined;
|
|
216
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;
|
|
217
281
|
}> | undefined;
|
|
218
282
|
snippet?: string | undefined;
|
|
219
283
|
}, {
|
|
220
284
|
message: string;
|
|
221
|
-
type: "code" | "question" | "reject";
|
|
285
|
+
type: "code" | "question" | "answer" | "reject";
|
|
222
286
|
success: boolean;
|
|
223
287
|
error?: string | undefined;
|
|
224
288
|
inputSchema?: Record<string, unknown> | undefined;
|
|
@@ -232,12 +296,12 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
232
296
|
};
|
|
233
297
|
variableId: number;
|
|
234
298
|
variableName: string;
|
|
235
|
-
|
|
299
|
+
nodeType: "tool" | "unknown" | "service" | "workflow";
|
|
236
300
|
className: string;
|
|
237
301
|
parameters: {
|
|
302
|
+
name: string;
|
|
238
303
|
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
239
304
|
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
240
|
-
name: string;
|
|
241
305
|
location?: {
|
|
242
306
|
startLine: number;
|
|
243
307
|
startCol: number;
|
|
@@ -245,12 +309,18 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
245
309
|
endCol: number;
|
|
246
310
|
} | undefined;
|
|
247
311
|
variableId?: number | undefined;
|
|
312
|
+
source?: "object-property" | "first-arg" | "spread" | undefined;
|
|
248
313
|
}[];
|
|
249
314
|
hasAwait: boolean;
|
|
250
315
|
hasActionCall: boolean;
|
|
251
|
-
|
|
316
|
+
bubbleName: import("./types.js").BubbleName;
|
|
317
|
+
description?: string | undefined;
|
|
252
318
|
dependencies?: import("./types.js").BubbleName[] | undefined;
|
|
253
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;
|
|
254
324
|
}> | undefined;
|
|
255
325
|
snippet?: string | undefined;
|
|
256
326
|
}>;
|
|
@@ -258,16 +328,16 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
258
328
|
* Internal agent response format (JSON mode output from AI)
|
|
259
329
|
*/
|
|
260
330
|
export declare const PearlAgentOutputSchema: z.ZodObject<{
|
|
261
|
-
type: z.ZodEnum<["code", "question", "reject"]>;
|
|
331
|
+
type: z.ZodEnum<["code", "question", "answer", "reject", "text"]>;
|
|
262
332
|
message: z.ZodString;
|
|
263
333
|
snippet: z.ZodOptional<z.ZodString>;
|
|
264
334
|
}, "strip", z.ZodTypeAny, {
|
|
265
335
|
message: string;
|
|
266
|
-
type: "code" | "question" | "reject";
|
|
336
|
+
type: "code" | "text" | "question" | "answer" | "reject";
|
|
267
337
|
snippet?: string | undefined;
|
|
268
338
|
}, {
|
|
269
339
|
message: string;
|
|
270
|
-
type: "code" | "question" | "reject";
|
|
340
|
+
type: "code" | "text" | "question" | "answer" | "reject";
|
|
271
341
|
snippet?: string | undefined;
|
|
272
342
|
}>;
|
|
273
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,15 +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'),
|
|
31
|
+
additionalContext: z
|
|
32
|
+
.string()
|
|
33
|
+
.optional()
|
|
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'),
|
|
33
48
|
});
|
|
34
49
|
/**
|
|
35
50
|
* Response schema for Pearl agent
|
|
36
51
|
*/
|
|
37
52
|
export const PearlResponseSchema = z.object({
|
|
38
53
|
type: z
|
|
39
|
-
.enum(['code', 'question', 'reject'])
|
|
40
|
-
.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)'),
|
|
41
56
|
message: z
|
|
42
57
|
.string()
|
|
43
58
|
.describe('Human-readable message: explanation for code, question text, or rejection reason'),
|
|
@@ -67,7 +82,7 @@ export const PearlResponseSchema = z.object({
|
|
|
67
82
|
* Internal agent response format (JSON mode output from AI)
|
|
68
83
|
*/
|
|
69
84
|
export const PearlAgentOutputSchema = z.object({
|
|
70
|
-
type: z.enum(['code', 'question', 'reject']),
|
|
85
|
+
type: z.enum(['code', 'question', 'answer', 'reject', 'text']),
|
|
71
86
|
message: z.string(),
|
|
72
87
|
snippet: z.string().optional(),
|
|
73
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":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAuB,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,0BAA0B,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GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC9D,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAMH,mFAAmF"}
|
|
@@ -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"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prepare an object for storage with a size cap. If the JSON stringified
|
|
3
|
+
* representation exceeds maxBytes, return a preview marker with metadata.
|
|
4
|
+
* Also logs a warning when truncation happens.
|
|
5
|
+
*
|
|
6
|
+
* Returns a consistent object structure when truncated to ensure compatibility
|
|
7
|
+
* with database schemas expecting JSON objects (jsonb/text with mode: 'json').
|
|
8
|
+
*/
|
|
9
|
+
export function prepareForStorage(value, options) {
|
|
10
|
+
const maxBytes = options?.maxBytes ?? 1024 * 1024; // 1MB
|
|
11
|
+
const previewBytes = options?.previewBytes ?? 4096; // 4KB
|
|
12
|
+
try {
|
|
13
|
+
const json = JSON.stringify(value);
|
|
14
|
+
// Compute byte length in a way that works in both browser and Node
|
|
15
|
+
const sizeBytes = typeof TextEncoder !== 'undefined'
|
|
16
|
+
? new TextEncoder().encode(json).length
|
|
17
|
+
: (globalThis.Buffer?.byteLength?.(json, 'utf8') ??
|
|
18
|
+
json.length);
|
|
19
|
+
if (sizeBytes > maxBytes) {
|
|
20
|
+
// eslint-disable-next-line no-console
|
|
21
|
+
console.warn(`[prepareForStorage] Size ${sizeBytes} > ${maxBytes}. Storing preview only.`);
|
|
22
|
+
// Use Buffer.slice to ensure we slice at byte boundaries, not character boundaries
|
|
23
|
+
// This prevents splitting multi-byte UTF-8 characters
|
|
24
|
+
const previewBuffer = json.slice(0, previewBytes) + '....truncated due to size limit';
|
|
25
|
+
return {
|
|
26
|
+
truncated: true,
|
|
27
|
+
preview: previewBuffer,
|
|
28
|
+
sizeBytes,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
truncated: false,
|
|
33
|
+
preview: value,
|
|
34
|
+
sizeBytes: 0,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
catch (_err) {
|
|
38
|
+
// eslint-disable-next-line no-console
|
|
39
|
+
console.warn('[prepareForStorage] Failed to serialize value for size check. Storing preview only.');
|
|
40
|
+
return {
|
|
41
|
+
truncated: true,
|
|
42
|
+
preview: '',
|
|
43
|
+
sizeBytes: 0,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export function cleanUpObjectForDisplayAndStorage(obj, maxBytes = 1024 * 1024) {
|
|
48
|
+
const storageResult = prepareForStorage(obj, { maxBytes });
|
|
49
|
+
if (storageResult.truncated) {
|
|
50
|
+
return storageResult.preview;
|
|
51
|
+
}
|
|
52
|
+
return obj;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=storage-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-utils.js","sourceRoot":"","sources":["../src/storage-utils.ts"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAc,EACd,OAAsD;IAEtD,MAAM,QAAQ,GAAG,OAAO,EAAE,QAAQ,IAAI,IAAI,GAAG,IAAI,CAAC,CAAC,MAAM;IACzD,MAAM,YAAY,GAAG,OAAO,EAAE,YAAY,IAAI,IAAI,CAAC,CAAC,MAAM;IAE1D,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACnC,mEAAmE;QACnE,MAAM,SAAS,GACb,OAAO,WAAW,KAAK,WAAW;YAChC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM;YACvC,CAAC,CAAC,CAAE,UAAkB,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;gBACvD,IAAI,CAAC,MAAM,CAAC,CAAC;QACnB,IAAI,SAAS,GAAG,QAAQ,EAAE,CAAC;YACzB,sCAAsC;YACtC,OAAO,CAAC,IAAI,CACV,4BAA4B,SAAS,MAAM,QAAQ,yBAAyB,CAC7E,CAAC;YACF,mFAAmF;YACnF,sDAAsD;YACtD,MAAM,aAAa,GACjB,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,GAAG,iCAAiC,CAAC;YAClE,OAAO;gBACL,SAAS,EAAE,IAAI;gBACf,OAAO,EAAE,aAAa;gBACtB,SAAS;aACV,CAAC;QACJ,CAAC;QACD,OAAO;YACL,SAAS,EAAE,KAAK;YAChB,OAAO,EAAE,KAAK;YACd,SAAS,EAAE,CAAC;SACb,CAAC;IACJ,CAAC;IAAC,OAAO,IAAI,EAAE,CAAC;QACd,sCAAsC;QACtC,OAAO,CAAC,IAAI,CACV,qFAAqF,CACtF,CAAC;QACF,OAAO;YACL,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,EAAE;YACX,SAAS,EAAE,CAAC;SACb,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,GAAY,EACZ,WAAmB,IAAI,GAAG,IAAI;IAE9B,MAAM,aAAa,GAAG,iBAAiB,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC3D,IAAI,aAAa,CAAC,SAAS,EAAE,CAAC;QAC5B,OAAO,aAAa,CAAC,OAAO,CAAC;IAC/B,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared types for streaming log events between backend and frontend
|
|
3
3
|
*/
|
|
4
|
+
import type { CoffeeClarificationEvent, CoffeeContextEvent, CoffeePlanEvent, CoffeeRequestExternalContextEvent } from './coffee.js';
|
|
4
5
|
export interface StreamingLogEvent {
|
|
5
|
-
type: 'log_line' | 'bubble_instantiation' | 'bubble_execution' | 'bubble_start' | 'bubble_complete' | 'execution_complete' | 'error' | 'stream_complete' | 'info' | 'warn' | 'debug' | 'bubble_execution_complete' | 'trace' | 'fatal' | 'bubble_parameters_update' | 'tool_call_start' | 'tool_call_complete';
|
|
6
|
+
type: 'log_line' | 'bubble_instantiation' | 'bubble_execution' | 'bubble_start' | 'bubble_complete' | 'execution_complete' | 'error' | 'stream_complete' | 'info' | 'warn' | 'debug' | 'bubble_execution_complete' | 'trace' | 'fatal' | 'bubble_parameters_update' | 'tool_call_start' | 'tool_call_complete' | 'function_call_start' | 'function_call_complete';
|
|
6
7
|
timestamp: string;
|
|
7
8
|
lineNumber?: number;
|
|
8
9
|
variableId?: number;
|
|
@@ -20,6 +21,10 @@ export interface StreamingLogEvent {
|
|
|
20
21
|
toolInput?: unknown;
|
|
21
22
|
toolOutput?: unknown;
|
|
22
23
|
toolDuration?: number;
|
|
24
|
+
functionName?: string;
|
|
25
|
+
functionInput?: unknown;
|
|
26
|
+
functionOutput?: unknown;
|
|
27
|
+
functionDuration?: number;
|
|
23
28
|
tokenUsage?: {
|
|
24
29
|
inputTokens: number;
|
|
25
30
|
outputTokens: number;
|
|
@@ -61,6 +66,7 @@ export type StreamingEvent = {
|
|
|
61
66
|
data: {
|
|
62
67
|
messageId: string;
|
|
63
68
|
totalTokens?: number;
|
|
69
|
+
content?: string;
|
|
64
70
|
};
|
|
65
71
|
} | {
|
|
66
72
|
type: 'tool_start';
|
|
@@ -72,10 +78,13 @@ export type StreamingEvent = {
|
|
|
72
78
|
} | {
|
|
73
79
|
type: 'tool_complete';
|
|
74
80
|
data: {
|
|
75
|
-
callId: string;
|
|
76
81
|
tool: string;
|
|
82
|
+
input: {
|
|
83
|
+
input: string;
|
|
84
|
+
};
|
|
77
85
|
output: unknown;
|
|
78
86
|
duration: number;
|
|
87
|
+
callId: string;
|
|
79
88
|
};
|
|
80
89
|
} | {
|
|
81
90
|
type: 'iteration_start';
|
|
@@ -100,6 +109,24 @@ export type StreamingEvent = {
|
|
|
100
109
|
result: unknown;
|
|
101
110
|
totalDuration: number;
|
|
102
111
|
};
|
|
112
|
+
} | {
|
|
113
|
+
type: 'coffee_clarification';
|
|
114
|
+
data: CoffeeClarificationEvent;
|
|
115
|
+
} | {
|
|
116
|
+
type: 'coffee_context_gathering';
|
|
117
|
+
data: CoffeeContextEvent;
|
|
118
|
+
} | {
|
|
119
|
+
type: 'coffee_request_context';
|
|
120
|
+
data: CoffeeRequestExternalContextEvent;
|
|
121
|
+
} | {
|
|
122
|
+
type: 'coffee_plan';
|
|
123
|
+
data: CoffeePlanEvent;
|
|
124
|
+
} | {
|
|
125
|
+
type: 'coffee_complete';
|
|
126
|
+
data: {
|
|
127
|
+
success: boolean;
|
|
128
|
+
message?: string;
|
|
129
|
+
};
|
|
103
130
|
};
|
|
104
131
|
export type StreamCallback = (event: StreamingLogEvent) => void | Promise<void>;
|
|
105
132
|
//# sourceMappingURL=streaming-events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming-events.d.ts","sourceRoot":"","sources":["../src/streaming-events.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EACA,UAAU,GACV,sBAAsB,GACtB,kBAAkB,GAClB,cAAc,GACd,iBAAiB,GACjB,oBAAoB,GACpB,OAAO,GACP,iBAAiB,GACjB,MAAM,GACN,MAAM,GACN,OAAO,GACP,2BAA2B,GAC3B,OAAO,GACP,OAAO,GACP,0BAA0B,GAC1B,iBAAiB,GACjB,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"streaming-events.d.ts","sourceRoot":"","sources":["../src/streaming-events.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,wBAAwB,EACxB,kBAAkB,EAClB,eAAe,EACf,iCAAiC,EAClC,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,iBAAiB;IAChC,IAAI,EACA,UAAU,GACV,sBAAs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