@bubblelab/shared-schemas 0.1.11 → 0.1.13
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/index.d.ts +10076 -28
- package/dist/index.js +3328 -29
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/dist/agent-memory.d.ts +0 -21
- package/dist/agent-memory.d.ts.map +0 -1
- package/dist/agent-memory.js +0 -11
- package/dist/agent-memory.js.map +0 -1
- package/dist/ai-models.d.ts +0 -4
- package/dist/ai-models.d.ts.map +0 -1
- package/dist/ai-models.js +0 -31
- package/dist/ai-models.js.map +0 -1
- package/dist/api-schema.d.ts +0 -38
- package/dist/api-schema.d.ts.map +0 -1
- package/dist/api-schema.js +0 -26
- package/dist/api-schema.js.map +0 -1
- package/dist/bubble-definition-schema.d.ts +0 -840
- package/dist/bubble-definition-schema.d.ts.map +0 -1
- package/dist/bubble-definition-schema.js +0 -297
- package/dist/bubble-definition-schema.js.map +0 -1
- package/dist/bubbleflow-execution-schema.d.ts +0 -1261
- package/dist/bubbleflow-execution-schema.d.ts.map +0 -1
- package/dist/bubbleflow-execution-schema.js +0 -354
- package/dist/bubbleflow-execution-schema.js.map +0 -1
- package/dist/bubbleflow-generation-prompts.d.ts +0 -25
- package/dist/bubbleflow-generation-prompts.d.ts.map +0 -1
- package/dist/bubbleflow-generation-prompts.js +0 -426
- package/dist/bubbleflow-generation-prompts.js.map +0 -1
- package/dist/bubbleflow-schema.d.ts +0 -2071
- package/dist/bubbleflow-schema.d.ts.map +0 -1
- package/dist/bubbleflow-schema.js +0 -336
- package/dist/bubbleflow-schema.js.map +0 -1
- package/dist/coffee.d.ts +0 -2201
- package/dist/coffee.d.ts.map +0 -1
- package/dist/coffee.js +0 -258
- package/dist/coffee.js.map +0 -1
- package/dist/credential-schema.d.ts +0 -419
- package/dist/credential-schema.d.ts.map +0 -1
- package/dist/credential-schema.js +0 -458
- package/dist/credential-schema.js.map +0 -1
- package/dist/cron-utils.d.ts +0 -47
- package/dist/cron-utils.d.ts.map +0 -1
- package/dist/cron-utils.js +0 -228
- package/dist/cron-utils.js.map +0 -1
- package/dist/database-definition-schema.d.ts +0 -97
- package/dist/database-definition-schema.d.ts.map +0 -1
- package/dist/database-definition-schema.js +0 -36
- package/dist/database-definition-schema.js.map +0 -1
- package/dist/error-enhancer.d.ts +0 -6
- package/dist/error-enhancer.d.ts.map +0 -1
- package/dist/error-enhancer.js +0 -88
- package/dist/error-enhancer.js.map +0 -1
- package/dist/generate-bubbleflow-schema.d.ts +0 -1525
- package/dist/generate-bubbleflow-schema.d.ts.map +0 -1
- package/dist/generate-bubbleflow-schema.js +0 -304
- package/dist/generate-bubbleflow-schema.js.map +0 -1
- package/dist/hash-utils.d.ts +0 -26
- package/dist/hash-utils.d.ts.map +0 -1
- package/dist/hash-utils.js +0 -37
- package/dist/hash-utils.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/milk-tea.d.ts +0 -106
- package/dist/milk-tea.d.ts.map +0 -1
- package/dist/milk-tea.js +0 -71
- package/dist/milk-tea.js.map +0 -1
- package/dist/mock-data-generator.d.ts +0 -51
- package/dist/mock-data-generator.d.ts.map +0 -1
- package/dist/mock-data-generator.js +0 -335
- package/dist/mock-data-generator.js.map +0 -1
- package/dist/oauth-schema.d.ts +0 -61
- package/dist/oauth-schema.d.ts.map +0 -1
- package/dist/oauth-schema.js +0 -75
- package/dist/oauth-schema.js.map +0 -1
- package/dist/param-utils.d.ts +0 -10
- package/dist/param-utils.d.ts.map +0 -1
- package/dist/param-utils.js +0 -13
- package/dist/param-utils.js.map +0 -1
- package/dist/pearl.d.ts +0 -346
- package/dist/pearl.d.ts.map +0 -1
- package/dist/pearl.js +0 -90
- package/dist/pearl.js.map +0 -1
- package/dist/storage-utils.d.ts +0 -19
- package/dist/storage-utils.d.ts.map +0 -1
- package/dist/storage-utils.js +0 -54
- package/dist/storage-utils.js.map +0 -1
- package/dist/streaming-events.d.ts +0 -132
- package/dist/streaming-events.d.ts.map +0 -1
- package/dist/streaming-events.js +0 -5
- package/dist/streaming-events.js.map +0 -1
- package/dist/subscription-status-schema.d.ts +0 -250
- package/dist/subscription-status-schema.d.ts.map +0 -1
- package/dist/subscription-status-schema.js +0 -144
- package/dist/subscription-status-schema.js.map +0 -1
- package/dist/trigger.d.ts +0 -113
- package/dist/trigger.d.ts.map +0 -1
- package/dist/trigger.js +0 -12
- package/dist/trigger.js.map +0 -1
- package/dist/types.d.ts +0 -29
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -43
- package/dist/types.js.map +0 -1
- package/dist/waitlist-schema.d.ts +0 -30
- package/dist/waitlist-schema.d.ts.map +0 -1
- package/dist/waitlist-schema.js +0 -39
- package/dist/waitlist-schema.js.map +0 -1
- package/dist/webhook-schema.d.ts +0 -95
- package/dist/webhook-schema.d.ts.map +0 -1
- package/dist/webhook-schema.js +0 -50
- package/dist/webhook-schema.js.map +0 -1
package/dist/pearl.d.ts
DELETED
|
@@ -1,346 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { type AvailableModel } from './ai-models.js';
|
|
3
|
-
import { CredentialType } from './types.js';
|
|
4
|
-
export declare const PEARL_DEFAULT_MODEL: AvailableModel;
|
|
5
|
-
/**
|
|
6
|
-
* Request schema for Pearl agent
|
|
7
|
-
* Pearl helps users build complete workflows without requiring specific bubbles
|
|
8
|
-
*/
|
|
9
|
-
export declare const PearlRequestSchema: z.ZodObject<{
|
|
10
|
-
userRequest: z.ZodString;
|
|
11
|
-
currentCode: z.ZodOptional<z.ZodString>;
|
|
12
|
-
userName: z.ZodString;
|
|
13
|
-
availableVariables: z.ZodArray<z.ZodAny, "many">;
|
|
14
|
-
conversationHistory: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
15
|
-
role: z.ZodEnum<["user", "assistant", "tool"]>;
|
|
16
|
-
content: z.ZodString;
|
|
17
|
-
toolCallId: z.ZodOptional<z.ZodString>;
|
|
18
|
-
name: z.ZodOptional<z.ZodString>;
|
|
19
|
-
}, "strip", z.ZodTypeAny, {
|
|
20
|
-
role: "user" | "assistant" | "tool";
|
|
21
|
-
content: string;
|
|
22
|
-
toolCallId?: string | undefined;
|
|
23
|
-
name?: string | undefined;
|
|
24
|
-
}, {
|
|
25
|
-
role: "user" | "assistant" | "tool";
|
|
26
|
-
content: string;
|
|
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";
|
|
44
|
-
}>, "many">>>;
|
|
45
|
-
}, "strip", z.ZodTypeAny, {
|
|
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";
|
|
47
|
-
userRequest: string;
|
|
48
|
-
userName: string;
|
|
49
|
-
conversationHistory: {
|
|
50
|
-
role: "user" | "assistant" | "tool";
|
|
51
|
-
content: string;
|
|
52
|
-
toolCallId?: string | undefined;
|
|
53
|
-
name?: string | undefined;
|
|
54
|
-
}[];
|
|
55
|
-
availableVariables: any[];
|
|
56
|
-
uploadedFiles: {
|
|
57
|
-
content: string;
|
|
58
|
-
name: string;
|
|
59
|
-
fileType: "text" | "image";
|
|
60
|
-
}[];
|
|
61
|
-
currentCode?: string | undefined;
|
|
62
|
-
additionalContext?: string | undefined;
|
|
63
|
-
}, {
|
|
64
|
-
userRequest: string;
|
|
65
|
-
userName: string;
|
|
66
|
-
availableVariables: any[];
|
|
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;
|
|
68
|
-
currentCode?: string | undefined;
|
|
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?: {
|
|
77
|
-
content: string;
|
|
78
|
-
name: string;
|
|
79
|
-
fileType: "text" | "image";
|
|
80
|
-
}[] | undefined;
|
|
81
|
-
}>;
|
|
82
|
-
/**
|
|
83
|
-
* Response schema for Pearl agent
|
|
84
|
-
*/
|
|
85
|
-
export declare const PearlResponseSchema: z.ZodObject<{
|
|
86
|
-
type: z.ZodEnum<["code", "question", "answer", "reject"]>;
|
|
87
|
-
message: z.ZodString;
|
|
88
|
-
snippet: z.ZodOptional<z.ZodString>;
|
|
89
|
-
bubbleParameters: z.ZodOptional<z.ZodRecord<z.ZodNumber, z.ZodObject<{
|
|
90
|
-
variableName: z.ZodString;
|
|
91
|
-
bubbleName: z.ZodType<import("./types.js").BubbleName>;
|
|
92
|
-
className: z.ZodString;
|
|
93
|
-
parameters: z.ZodArray<z.ZodObject<{
|
|
94
|
-
location: z.ZodOptional<z.ZodObject<{
|
|
95
|
-
startLine: z.ZodNumber;
|
|
96
|
-
startCol: z.ZodNumber;
|
|
97
|
-
endLine: z.ZodNumber;
|
|
98
|
-
endCol: z.ZodNumber;
|
|
99
|
-
}, "strip", z.ZodTypeAny, {
|
|
100
|
-
startLine: number;
|
|
101
|
-
startCol: number;
|
|
102
|
-
endLine: number;
|
|
103
|
-
endCol: number;
|
|
104
|
-
}, {
|
|
105
|
-
startLine: number;
|
|
106
|
-
startCol: number;
|
|
107
|
-
endLine: number;
|
|
108
|
-
endCol: number;
|
|
109
|
-
}>>;
|
|
110
|
-
variableId: z.ZodOptional<z.ZodNumber>;
|
|
111
|
-
name: z.ZodString;
|
|
112
|
-
value: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodUnknown, "many">]>;
|
|
113
|
-
type: z.ZodNativeEnum<typeof import("./bubble-definition-schema.js").BubbleParameterType>;
|
|
114
|
-
source: z.ZodOptional<z.ZodEnum<["object-property", "first-arg", "spread"]>>;
|
|
115
|
-
}, "strip", z.ZodTypeAny, {
|
|
116
|
-
name: string;
|
|
117
|
-
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
118
|
-
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
119
|
-
location?: {
|
|
120
|
-
startLine: number;
|
|
121
|
-
startCol: number;
|
|
122
|
-
endLine: number;
|
|
123
|
-
endCol: number;
|
|
124
|
-
} | undefined;
|
|
125
|
-
variableId?: number | undefined;
|
|
126
|
-
source?: "object-property" | "first-arg" | "spread" | undefined;
|
|
127
|
-
}, {
|
|
128
|
-
name: string;
|
|
129
|
-
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
130
|
-
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
131
|
-
location?: {
|
|
132
|
-
startLine: number;
|
|
133
|
-
startCol: number;
|
|
134
|
-
endLine: number;
|
|
135
|
-
endCol: number;
|
|
136
|
-
} | undefined;
|
|
137
|
-
variableId?: number | undefined;
|
|
138
|
-
source?: "object-property" | "first-arg" | "spread" | undefined;
|
|
139
|
-
}>, "many">;
|
|
140
|
-
hasAwait: z.ZodBoolean;
|
|
141
|
-
hasActionCall: z.ZodBoolean;
|
|
142
|
-
dependencies: z.ZodOptional<z.ZodArray<z.ZodType<import("./types.js").BubbleName, z.ZodTypeDef, import("./types.js").BubbleName>, "many">>;
|
|
143
|
-
dependencyGraph: z.ZodOptional<z.ZodType<import("./bubble-definition-schema.js").DependencyGraphNode, z.ZodTypeDef, import("./bubble-definition-schema.js").DependencyGraphNode>>;
|
|
144
|
-
variableId: z.ZodNumber;
|
|
145
|
-
nodeType: z.ZodEnum<["service", "tool", "workflow", "unknown"]>;
|
|
146
|
-
location: z.ZodObject<{
|
|
147
|
-
startLine: z.ZodNumber;
|
|
148
|
-
startCol: z.ZodNumber;
|
|
149
|
-
endLine: z.ZodNumber;
|
|
150
|
-
endCol: z.ZodNumber;
|
|
151
|
-
}, "strip", z.ZodTypeAny, {
|
|
152
|
-
startLine: number;
|
|
153
|
-
startCol: number;
|
|
154
|
-
endLine: number;
|
|
155
|
-
endCol: number;
|
|
156
|
-
}, {
|
|
157
|
-
startLine: number;
|
|
158
|
-
startCol: number;
|
|
159
|
-
endLine: number;
|
|
160
|
-
endCol: number;
|
|
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>;
|
|
167
|
-
}, "strip", z.ZodTypeAny, {
|
|
168
|
-
location: {
|
|
169
|
-
startLine: number;
|
|
170
|
-
startCol: number;
|
|
171
|
-
endLine: number;
|
|
172
|
-
endCol: number;
|
|
173
|
-
};
|
|
174
|
-
variableId: number;
|
|
175
|
-
variableName: string;
|
|
176
|
-
nodeType: "tool" | "unknown" | "service" | "workflow";
|
|
177
|
-
className: string;
|
|
178
|
-
parameters: {
|
|
179
|
-
name: string;
|
|
180
|
-
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
181
|
-
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
182
|
-
location?: {
|
|
183
|
-
startLine: number;
|
|
184
|
-
startCol: number;
|
|
185
|
-
endLine: number;
|
|
186
|
-
endCol: number;
|
|
187
|
-
} | undefined;
|
|
188
|
-
variableId?: number | undefined;
|
|
189
|
-
source?: "object-property" | "first-arg" | "spread" | undefined;
|
|
190
|
-
}[];
|
|
191
|
-
hasAwait: boolean;
|
|
192
|
-
hasActionCall: boolean;
|
|
193
|
-
bubbleName: import("./types.js").BubbleName;
|
|
194
|
-
description?: string | undefined;
|
|
195
|
-
dependencies?: import("./types.js").BubbleName[] | undefined;
|
|
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;
|
|
201
|
-
}, {
|
|
202
|
-
location: {
|
|
203
|
-
startLine: number;
|
|
204
|
-
startCol: number;
|
|
205
|
-
endLine: number;
|
|
206
|
-
endCol: number;
|
|
207
|
-
};
|
|
208
|
-
variableId: number;
|
|
209
|
-
variableName: string;
|
|
210
|
-
nodeType: "tool" | "unknown" | "service" | "workflow";
|
|
211
|
-
className: string;
|
|
212
|
-
parameters: {
|
|
213
|
-
name: string;
|
|
214
|
-
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
215
|
-
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
216
|
-
location?: {
|
|
217
|
-
startLine: number;
|
|
218
|
-
startCol: number;
|
|
219
|
-
endLine: number;
|
|
220
|
-
endCol: number;
|
|
221
|
-
} | undefined;
|
|
222
|
-
variableId?: number | undefined;
|
|
223
|
-
source?: "object-property" | "first-arg" | "spread" | undefined;
|
|
224
|
-
}[];
|
|
225
|
-
hasAwait: boolean;
|
|
226
|
-
hasActionCall: boolean;
|
|
227
|
-
bubbleName: import("./types.js").BubbleName;
|
|
228
|
-
description?: string | undefined;
|
|
229
|
-
dependencies?: import("./types.js").BubbleName[] | undefined;
|
|
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;
|
|
235
|
-
}>>>;
|
|
236
|
-
inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
237
|
-
requiredCredentials: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodNativeEnum<typeof CredentialType>, "many">>>;
|
|
238
|
-
success: z.ZodBoolean;
|
|
239
|
-
error: z.ZodOptional<z.ZodString>;
|
|
240
|
-
}, "strip", z.ZodTypeAny, {
|
|
241
|
-
message: string;
|
|
242
|
-
type: "code" | "question" | "answer" | "reject";
|
|
243
|
-
success: boolean;
|
|
244
|
-
error?: string | undefined;
|
|
245
|
-
inputSchema?: Record<string, unknown> | undefined;
|
|
246
|
-
requiredCredentials?: Record<string, CredentialType[]> | undefined;
|
|
247
|
-
bubbleParameters?: Record<number, {
|
|
248
|
-
location: {
|
|
249
|
-
startLine: number;
|
|
250
|
-
startCol: number;
|
|
251
|
-
endLine: number;
|
|
252
|
-
endCol: number;
|
|
253
|
-
};
|
|
254
|
-
variableId: number;
|
|
255
|
-
variableName: string;
|
|
256
|
-
nodeType: "tool" | "unknown" | "service" | "workflow";
|
|
257
|
-
className: string;
|
|
258
|
-
parameters: {
|
|
259
|
-
name: string;
|
|
260
|
-
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
261
|
-
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
262
|
-
location?: {
|
|
263
|
-
startLine: number;
|
|
264
|
-
startCol: number;
|
|
265
|
-
endLine: number;
|
|
266
|
-
endCol: number;
|
|
267
|
-
} | undefined;
|
|
268
|
-
variableId?: number | undefined;
|
|
269
|
-
source?: "object-property" | "first-arg" | "spread" | undefined;
|
|
270
|
-
}[];
|
|
271
|
-
hasAwait: boolean;
|
|
272
|
-
hasActionCall: boolean;
|
|
273
|
-
bubbleName: import("./types.js").BubbleName;
|
|
274
|
-
description?: string | undefined;
|
|
275
|
-
dependencies?: import("./types.js").BubbleName[] | undefined;
|
|
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;
|
|
281
|
-
}> | undefined;
|
|
282
|
-
snippet?: string | undefined;
|
|
283
|
-
}, {
|
|
284
|
-
message: string;
|
|
285
|
-
type: "code" | "question" | "answer" | "reject";
|
|
286
|
-
success: boolean;
|
|
287
|
-
error?: string | undefined;
|
|
288
|
-
inputSchema?: Record<string, unknown> | undefined;
|
|
289
|
-
requiredCredentials?: Record<string, CredentialType[]> | undefined;
|
|
290
|
-
bubbleParameters?: Record<number, {
|
|
291
|
-
location: {
|
|
292
|
-
startLine: number;
|
|
293
|
-
startCol: number;
|
|
294
|
-
endLine: number;
|
|
295
|
-
endCol: number;
|
|
296
|
-
};
|
|
297
|
-
variableId: number;
|
|
298
|
-
variableName: string;
|
|
299
|
-
nodeType: "tool" | "unknown" | "service" | "workflow";
|
|
300
|
-
className: string;
|
|
301
|
-
parameters: {
|
|
302
|
-
name: string;
|
|
303
|
-
value: string | number | boolean | unknown[] | Record<string, unknown>;
|
|
304
|
-
type: import("./bubble-definition-schema.js").BubbleParameterType;
|
|
305
|
-
location?: {
|
|
306
|
-
startLine: number;
|
|
307
|
-
startCol: number;
|
|
308
|
-
endLine: number;
|
|
309
|
-
endCol: number;
|
|
310
|
-
} | undefined;
|
|
311
|
-
variableId?: number | undefined;
|
|
312
|
-
source?: "object-property" | "first-arg" | "spread" | undefined;
|
|
313
|
-
}[];
|
|
314
|
-
hasAwait: boolean;
|
|
315
|
-
hasActionCall: boolean;
|
|
316
|
-
bubbleName: import("./types.js").BubbleName;
|
|
317
|
-
description?: string | undefined;
|
|
318
|
-
dependencies?: import("./types.js").BubbleName[] | undefined;
|
|
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;
|
|
324
|
-
}> | undefined;
|
|
325
|
-
snippet?: string | undefined;
|
|
326
|
-
}>;
|
|
327
|
-
/**
|
|
328
|
-
* Internal agent response format (JSON mode output from AI)
|
|
329
|
-
*/
|
|
330
|
-
export declare const PearlAgentOutputSchema: z.ZodObject<{
|
|
331
|
-
type: z.ZodEnum<["code", "question", "answer", "reject", "text"]>;
|
|
332
|
-
message: z.ZodString;
|
|
333
|
-
snippet: z.ZodOptional<z.ZodString>;
|
|
334
|
-
}, "strip", z.ZodTypeAny, {
|
|
335
|
-
message: string;
|
|
336
|
-
type: "code" | "text" | "question" | "answer" | "reject";
|
|
337
|
-
snippet?: string | undefined;
|
|
338
|
-
}, {
|
|
339
|
-
message: string;
|
|
340
|
-
type: "code" | "text" | "question" | "answer" | "reject";
|
|
341
|
-
snippet?: string | undefined;
|
|
342
|
-
}>;
|
|
343
|
-
export type PearlRequest = z.infer<typeof PearlRequestSchema>;
|
|
344
|
-
export type PearlResponse = z.infer<typeof PearlResponseSchema>;
|
|
345
|
-
export type PearlAgentOutput = z.infer<typeof PearlAgentOutputSchema>;
|
|
346
|
-
//# sourceMappingURL=pearl.d.ts.map
|
package/dist/pearl.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { AvailableModels } from './ai-models.js';
|
|
3
|
-
import { ParsedBubbleWithInfoSchema } from './bubble-definition-schema.js';
|
|
4
|
-
import { CredentialType } from './types.js';
|
|
5
|
-
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';
|
|
8
|
-
/**
|
|
9
|
-
* Request schema for Pearl agent
|
|
10
|
-
* Pearl helps users build complete workflows without requiring specific bubbles
|
|
11
|
-
*/
|
|
12
|
-
export const PearlRequestSchema = z.object({
|
|
13
|
-
userRequest: z
|
|
14
|
-
.string()
|
|
15
|
-
.min(1, 'User request is required')
|
|
16
|
-
.describe('The user request or question about building a workflow'),
|
|
17
|
-
currentCode: z
|
|
18
|
-
.string()
|
|
19
|
-
.optional()
|
|
20
|
-
.describe('The current workflow code for context and modification'),
|
|
21
|
-
userName: z.string().describe('Name of the user making the request'),
|
|
22
|
-
availableVariables: z
|
|
23
|
-
.array(z.any())
|
|
24
|
-
.describe('List of available variables in the current code'),
|
|
25
|
-
conversationHistory: z
|
|
26
|
-
.array(ConversationMessageSchema)
|
|
27
|
-
.optional()
|
|
28
|
-
.default([])
|
|
29
|
-
.describe('Previous conversation messages for multi-turn interactions (frontend manages state)'),
|
|
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'),
|
|
48
|
-
});
|
|
49
|
-
/**
|
|
50
|
-
* Response schema for Pearl agent
|
|
51
|
-
*/
|
|
52
|
-
export const PearlResponseSchema = z.object({
|
|
53
|
-
type: z
|
|
54
|
-
.enum(['code', 'question', 'answer', 'reject'])
|
|
55
|
-
.describe('Type of response: code (generated workflow), question (needs clarification), answer (provides information/guidance), reject (infeasible request)'),
|
|
56
|
-
message: z
|
|
57
|
-
.string()
|
|
58
|
-
.describe('Human-readable message: explanation for code, question text, or rejection reason'),
|
|
59
|
-
snippet: z
|
|
60
|
-
.string()
|
|
61
|
-
.optional()
|
|
62
|
-
.describe('Generated TypeScript code for complete workflow (only present when type is "code")'),
|
|
63
|
-
bubbleParameters: z
|
|
64
|
-
.record(z.number(), ParsedBubbleWithInfoSchema)
|
|
65
|
-
.optional()
|
|
66
|
-
.describe('Parsed bubble parameters from the generated workflow (only present when type is "code")'),
|
|
67
|
-
inputSchema: z
|
|
68
|
-
.record(z.unknown())
|
|
69
|
-
.optional()
|
|
70
|
-
.describe('Input schema for the generated workflow (only present when type is "code")'),
|
|
71
|
-
requiredCredentials: z
|
|
72
|
-
.record(z.string(), z.array(z.nativeEnum(CredentialType)))
|
|
73
|
-
.optional()
|
|
74
|
-
.describe('Required credentials for the bubbles in the workflow (only present when type is "code")'),
|
|
75
|
-
success: z.boolean().describe('Whether the operation completed successfully'),
|
|
76
|
-
error: z
|
|
77
|
-
.string()
|
|
78
|
-
.optional()
|
|
79
|
-
.describe('Error message if the operation failed'),
|
|
80
|
-
});
|
|
81
|
-
/**
|
|
82
|
-
* Internal agent response format (JSON mode output from AI)
|
|
83
|
-
*/
|
|
84
|
-
export const PearlAgentOutputSchema = z.object({
|
|
85
|
-
type: z.enum(['code', 'question', 'answer', 'reject', 'text']),
|
|
86
|
-
message: z.string(),
|
|
87
|
-
snippet: z.string().optional(),
|
|
88
|
-
});
|
|
89
|
-
// Note: ConversationMessage type is exported from milk-tea.ts to avoid duplication
|
|
90
|
-
//# sourceMappingURL=pearl.js.map
|
package/dist/pearl.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pearl.js","sourceRoot":"","sources":["../src/pearl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EA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,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"}
|
package/dist/storage-utils.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/storage-utils.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,CAA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
4
|
-
import type { CoffeeClarificationEvent, CoffeeContextEvent, CoffeePlanEvent, CoffeeRequestExternalContextEvent } from './coffee.js';
|
|
5
|
-
export interface StreamingLogEvent {
|
|
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';
|
|
7
|
-
timestamp: string;
|
|
8
|
-
lineNumber?: number;
|
|
9
|
-
variableId?: number;
|
|
10
|
-
message: string;
|
|
11
|
-
bubbleId?: string;
|
|
12
|
-
bubbleName?: string;
|
|
13
|
-
variableName?: string;
|
|
14
|
-
additionalData?: Record<string, unknown>;
|
|
15
|
-
executionTime?: number;
|
|
16
|
-
memoryUsage?: number;
|
|
17
|
-
logLevel?: string;
|
|
18
|
-
bubbleParameters?: Record<number, import('./bubble-definition-schema').ParsedBubbleWithInfo>;
|
|
19
|
-
toolCallId?: string;
|
|
20
|
-
toolName?: string;
|
|
21
|
-
toolInput?: unknown;
|
|
22
|
-
toolOutput?: unknown;
|
|
23
|
-
toolDuration?: number;
|
|
24
|
-
functionName?: string;
|
|
25
|
-
functionInput?: unknown;
|
|
26
|
-
functionOutput?: unknown;
|
|
27
|
-
functionDuration?: number;
|
|
28
|
-
tokenUsage?: {
|
|
29
|
-
inputTokens: number;
|
|
30
|
-
outputTokens: number;
|
|
31
|
-
totalTokens: number;
|
|
32
|
-
};
|
|
33
|
-
cumulativeTokenUsage?: {
|
|
34
|
-
inputTokens: number;
|
|
35
|
-
outputTokens: number;
|
|
36
|
-
totalTokens: number;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
export type StreamingEvent = {
|
|
40
|
-
type: 'start';
|
|
41
|
-
data: {
|
|
42
|
-
message: string;
|
|
43
|
-
maxIterations: number;
|
|
44
|
-
timestamp: string;
|
|
45
|
-
};
|
|
46
|
-
} | {
|
|
47
|
-
type: 'llm_start';
|
|
48
|
-
data: {
|
|
49
|
-
model: string;
|
|
50
|
-
temperature: number;
|
|
51
|
-
};
|
|
52
|
-
} | {
|
|
53
|
-
type: 'token';
|
|
54
|
-
data: {
|
|
55
|
-
content: string;
|
|
56
|
-
messageId: string;
|
|
57
|
-
};
|
|
58
|
-
} | {
|
|
59
|
-
type: 'think';
|
|
60
|
-
data: {
|
|
61
|
-
content: string;
|
|
62
|
-
messageId: string;
|
|
63
|
-
};
|
|
64
|
-
} | {
|
|
65
|
-
type: 'llm_complete';
|
|
66
|
-
data: {
|
|
67
|
-
messageId: string;
|
|
68
|
-
totalTokens?: number;
|
|
69
|
-
content?: string;
|
|
70
|
-
};
|
|
71
|
-
} | {
|
|
72
|
-
type: 'tool_start';
|
|
73
|
-
data: {
|
|
74
|
-
tool: string;
|
|
75
|
-
input: unknown;
|
|
76
|
-
callId: string;
|
|
77
|
-
};
|
|
78
|
-
} | {
|
|
79
|
-
type: 'tool_complete';
|
|
80
|
-
data: {
|
|
81
|
-
tool: string;
|
|
82
|
-
input: {
|
|
83
|
-
input: string;
|
|
84
|
-
};
|
|
85
|
-
output: unknown;
|
|
86
|
-
duration: number;
|
|
87
|
-
callId: string;
|
|
88
|
-
};
|
|
89
|
-
} | {
|
|
90
|
-
type: 'iteration_start';
|
|
91
|
-
data: {
|
|
92
|
-
iteration: number;
|
|
93
|
-
};
|
|
94
|
-
} | {
|
|
95
|
-
type: 'iteration_complete';
|
|
96
|
-
data: {
|
|
97
|
-
iteration: number;
|
|
98
|
-
hasToolCalls: boolean;
|
|
99
|
-
};
|
|
100
|
-
} | {
|
|
101
|
-
type: 'error';
|
|
102
|
-
data: {
|
|
103
|
-
error: string;
|
|
104
|
-
recoverable: boolean;
|
|
105
|
-
};
|
|
106
|
-
} | {
|
|
107
|
-
type: 'complete';
|
|
108
|
-
data: {
|
|
109
|
-
result: unknown;
|
|
110
|
-
totalDuration: number;
|
|
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
|
-
};
|
|
130
|
-
};
|
|
131
|
-
export type StreamCallback = (event: StreamingLogEvent) => void | Promise<void>;
|
|
132
|
-
//# sourceMappingURL=streaming-events.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,C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