@bubblelab/shared-schemas 0.1.10 → 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 +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 +184 -0
- package/dist/bubble-definition-schema.js.map +1 -1
- package/dist/bubbleflow-execution-schema.d.ts +586 -175
- package/dist/bubbleflow-execution-schema.d.ts.map +1 -1
- package/dist/bubbleflow-execution-schema.js +40 -26
- package/dist/bubbleflow-execution-schema.js.map +1 -1
- package/dist/bubbleflow-generation-prompts.d.ts +13 -7
- package/dist/bubbleflow-generation-prompts.d.ts.map +1 -1
- package/dist/bubbleflow-generation-prompts.js +384 -15
- package/dist/bubbleflow-generation-prompts.js.map +1 -1
- package/dist/bubbleflow-schema.d.ts +1112 -123
- 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 +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 +137 -4
- 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 +1001 -79
- 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 +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 +18 -20
- 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/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 +28 -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 +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/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, {
|
|
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;
|
|
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
|
+
content: string;
|
|
38
|
+
name: string;
|
|
39
|
+
fileType: "text" | "image";
|
|
40
|
+
}, {
|
|
41
|
+
content: string;
|
|
42
|
+
name: 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: {
|
|
50
|
+
role: "user" | "assistant" | "tool";
|
|
29
51
|
content: string;
|
|
30
|
-
|
|
52
|
+
toolCallId?: string | undefined;
|
|
53
|
+
name?: string | undefined;
|
|
31
54
|
}[];
|
|
32
55
|
availableVariables: any[];
|
|
56
|
+
uploadedFiles: {
|
|
57
|
+
content: string;
|
|
58
|
+
name: 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?: {
|
|
70
|
+
role: "user" | "assistant" | "tool";
|
|
42
71
|
content: string;
|
|
43
|
-
|
|
72
|
+
toolCallId?: string | undefined;
|
|
73
|
+
name?: string | undefined;
|
|
44
74
|
}[] | undefined;
|
|
45
75
|
additionalContext?: string | undefined;
|
|
76
|
+
uploadedFiles?: {
|
|
77
|
+
content: string;
|
|
78
|
+
name: 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,10 +111,11 @@ 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, {
|
|
116
|
+
name: string;
|
|
80
117
|
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
81
118
|
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
82
|
-
name: string;
|
|
83
119
|
location?: {
|
|
84
120
|
startLine: number;
|
|
85
121
|
startCol: number;
|
|
@@ -87,10 +123,11 @@ 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
|
}, {
|
|
128
|
+
name: string;
|
|
91
129
|
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
92
130
|
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
93
|
-
name: string;
|
|
94
131
|
location?: {
|
|
95
132
|
startLine: number;
|
|
96
133
|
startCol: 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,12 +173,12 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
130
173
|
};
|
|
131
174
|
variableId: number;
|
|
132
175
|
variableName: string;
|
|
133
|
-
|
|
176
|
+
nodeType: "tool" | "unknown" | "service" | "workflow";
|
|
134
177
|
className: string;
|
|
135
178
|
parameters: {
|
|
179
|
+
name: string;
|
|
136
180
|
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
137
181
|
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
138
|
-
name: string;
|
|
139
182
|
location?: {
|
|
140
183
|
startLine: number;
|
|
141
184
|
startCol: 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,12 +207,12 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
158
207
|
};
|
|
159
208
|
variableId: number;
|
|
160
209
|
variableName: string;
|
|
161
|
-
|
|
210
|
+
nodeType: "tool" | "unknown" | "service" | "workflow";
|
|
162
211
|
className: string;
|
|
163
212
|
parameters: {
|
|
213
|
+
name: string;
|
|
164
214
|
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
165
215
|
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
166
|
-
name: string;
|
|
167
216
|
location?: {
|
|
168
217
|
startLine: number;
|
|
169
218
|
startCol: number;
|
|
@@ -171,12 +220,18 @@ 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">>>;
|
|
@@ -184,7 +239,7 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
184
239
|
error: z.ZodOptional<z.ZodString>;
|
|
185
240
|
}, "strip", z.ZodTypeAny, {
|
|
186
241
|
message: string;
|
|
187
|
-
type: "code" | "question" | "reject";
|
|
242
|
+
type: "code" | "question" | "answer" | "reject";
|
|
188
243
|
success: boolean;
|
|
189
244
|
error?: string | undefined;
|
|
190
245
|
inputSchema?: Record<string, unknown> | undefined;
|
|
@@ -198,12 +253,12 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
198
253
|
};
|
|
199
254
|
variableId: number;
|
|
200
255
|
variableName: string;
|
|
201
|
-
|
|
256
|
+
nodeType: "tool" | "unknown" | "service" | "workflow";
|
|
202
257
|
className: string;
|
|
203
258
|
parameters: {
|
|
259
|
+
name: string;
|
|
204
260
|
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
205
261
|
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
206
|
-
name: string;
|
|
207
262
|
location?: {
|
|
208
263
|
startLine: number;
|
|
209
264
|
startCol: 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
|
}, {
|
|
223
284
|
message: string;
|
|
224
|
-
type: "code" | "question" | "reject";
|
|
285
|
+
type: "code" | "question" | "answer" | "reject";
|
|
225
286
|
success: boolean;
|
|
226
287
|
error?: string | undefined;
|
|
227
288
|
inputSchema?: Record<string, unknown> | undefined;
|
|
@@ -235,12 +296,12 @@ export declare const PearlResponseSchema: z.ZodObject<{
|
|
|
235
296
|
};
|
|
236
297
|
variableId: number;
|
|
237
298
|
variableName: string;
|
|
238
|
-
|
|
299
|
+
nodeType: "tool" | "unknown" | "service" | "workflow";
|
|
239
300
|
className: string;
|
|
240
301
|
parameters: {
|
|
302
|
+
name: string;
|
|
241
303
|
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
242
304
|
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
243
|
-
name: string;
|
|
244
305
|
location?: {
|
|
245
306
|
startLine: number;
|
|
246
307
|
startCol: 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, {
|
|
268
335
|
message: string;
|
|
269
|
-
type: "code" | "question" | "reject";
|
|
336
|
+
type: "code" | "text" | "question" | "answer" | "reject";
|
|
270
337
|
snippet?: string | undefined;
|
|
271
338
|
}, {
|
|
272
339
|
message: string;
|
|
273
|
-
type: "code" | "question" | "reject";
|
|
340
|
+
type: "code" | "text" | "question" | "answer" | "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":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAuB,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,mCAAmC;AACnC,MAAM,CAAC,MAAM,mBAAmB,GAC9B,wCAAwC,CAAC;AAC3C;;;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,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,wDAAwD,CAAC;IAErE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IACpE,kBAAkB,EAAE,CAAC;SAClB,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;SACd,QAAQ,CAAC,iDAAiD,CAAC;IAC9D,mBAAmB,EAAE,CAAC;SACnB,KAAK,CAAC,yBA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EH,WAAW,EAAE,CAAC;SACX,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SACnB,QAAQ,EAAE;SACV,QAAQ,CACP,4EAA4E,CAC7E;IAEH,mBAAmB,EAAE,CAAC;SACnB,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC;SACzD,QAAQ,EAAE;SACV,QAAQ,CACP,yFAAyF,CAC1F;IAEH,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;IAE7E,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,uCAAuC,CAAC;CACrD,CAAC,CAAC;AAEH;;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,M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AU,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';
|
|
@@ -73,7 +79,9 @@ export type StreamingEvent = {
|
|
|
73
79
|
type: 'tool_complete';
|
|
74
80
|
data: {
|
|
75
81
|
tool: string;
|
|
76
|
-
input:
|
|
82
|
+
input: {
|
|
83
|
+
input: string;
|
|
84
|
+
};
|
|
77
85
|
output: unknown;
|
|
78
86
|
duration: number;
|
|
79
87
|
callId: string;
|
|
@@ -101,6 +109,24 @@ export type StreamingEvent = {
|
|
|
101
109
|
result: unknown;
|
|
102
110
|
totalDuration: number;
|
|
103
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
|
+
};
|
|
104
130
|
};
|
|
105
131
|
export type StreamCallback = (event: StreamingLogEvent) => void | Promise<void>;
|
|
106
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,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,GACpB,qBAAqB,GACrB,wBAAwB,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,gBAAgB,CAAC,EAAE,MAAM,CACvB,MAAM,EACN,OAAO,4BAA4B,EAAE,oBAAoB,CAC1D,CAAC;IAEF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,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