@bubblelab/shared-schemas 0.1.8 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-models.d.ts +4 -0
- package/dist/ai-models.d.ts.map +1 -0
- package/dist/ai-models.js +19 -0
- package/dist/ai-models.js.map +1 -0
- package/dist/api-schema.d.ts +2 -2
- package/dist/bubble-definition-schema.d.ts +133 -19
- package/dist/bubble-definition-schema.d.ts.map +1 -1
- package/dist/bubble-definition-schema.js +7 -0
- package/dist/bubble-definition-schema.js.map +1 -1
- package/dist/bubbleflow-execution-schema.d.ts +411 -141
- package/dist/bubbleflow-execution-schema.d.ts.map +1 -1
- package/dist/bubbleflow-execution-schema.js +118 -8
- package/dist/bubbleflow-execution-schema.js.map +1 -1
- package/dist/bubbleflow-generation-prompts.d.ts +19 -0
- package/dist/bubbleflow-generation-prompts.d.ts.map +1 -0
- package/dist/bubbleflow-generation-prompts.js +57 -0
- package/dist/bubbleflow-generation-prompts.js.map +1 -0
- package/dist/bubbleflow-schema.d.ts +418 -121
- package/dist/bubbleflow-schema.d.ts.map +1 -1
- package/dist/bubbleflow-schema.js +40 -0
- package/dist/bubbleflow-schema.js.map +1 -1
- package/dist/credential-schema.d.ts +46 -46
- package/dist/credential-schema.d.ts.map +1 -1
- package/dist/credential-schema.js +13 -15
- package/dist/credential-schema.js.map +1 -1
- package/dist/cron-utils.d.ts +47 -0
- package/dist/cron-utils.d.ts.map +1 -0
- package/dist/cron-utils.js +228 -0
- package/dist/cron-utils.js.map +1 -0
- package/dist/general-chat.d.ts +81 -0
- package/dist/general-chat.d.ts.map +1 -0
- package/dist/general-chat.js +58 -0
- package/dist/general-chat.js.map +1 -0
- package/dist/generate-bubbleflow-schema.d.ts +174 -52
- package/dist/generate-bubbleflow-schema.d.ts.map +1 -1
- package/dist/generate-bubbleflow-schema.js +41 -0
- package/dist/generate-bubbleflow-schema.js.map +1 -1
- package/dist/generation-result-schema.d.ts +73 -0
- package/dist/generation-result-schema.d.ts.map +1 -0
- package/dist/generation-result-schema.js +55 -0
- package/dist/generation-result-schema.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/milk-tea.d.ts +108 -0
- package/dist/milk-tea.d.ts.map +1 -0
- package/dist/milk-tea.js +74 -0
- package/dist/milk-tea.js.map +1 -0
- package/dist/pearl.d.ts +279 -0
- package/dist/pearl.d.ts.map +1 -0
- package/dist/pearl.js +79 -0
- package/dist/pearl.js.map +1 -0
- package/dist/streaming-events.d.ts +71 -0
- package/dist/streaming-events.d.ts.map +1 -1
- package/dist/trigger.d.ts +119 -0
- package/dist/trigger.d.ts.map +1 -0
- package/dist/trigger.js +14 -0
- package/dist/trigger.js.map +1 -0
- package/dist/types.d.ts +2 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bubbleflow-execution-schema.d.ts","sourceRoot":"","sources":["../src/bubbleflow-execution-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAGtC,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;EAmBL,CAAC;AAEzB,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"bubbleflow-execution-schema.d.ts","sourceRoot":"","sources":["../src/bubbleflow-execution-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAGtC,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;EAmBL,CAAC;AAEzB,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyE/C,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,oCAAoC,CAC5C,CAAC;AACF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -22,27 +22,91 @@ export const TokenUsageSchema = z
|
|
|
22
22
|
.openapi('TokenUsage');
|
|
23
23
|
export const ExecutionSummarySchema = z
|
|
24
24
|
.object({
|
|
25
|
+
result: z.any().optional().openapi({
|
|
26
|
+
description: 'Execution result',
|
|
27
|
+
example: 'Execution completed successfully',
|
|
28
|
+
}),
|
|
25
29
|
totalDuration: z.number().openapi({
|
|
26
30
|
description: 'Total execution duration in milliseconds',
|
|
27
31
|
example: 1500,
|
|
28
32
|
}),
|
|
29
|
-
lineExecutionCount: z.number().openapi({
|
|
33
|
+
lineExecutionCount: z.number().optional().openapi({
|
|
30
34
|
description: 'Number of lines executed',
|
|
31
35
|
example: 25,
|
|
32
36
|
}),
|
|
33
|
-
bubbleExecutionCount: z.number().openapi({
|
|
37
|
+
bubbleExecutionCount: z.number().optional().openapi({
|
|
34
38
|
description: 'Number of bubbles executed',
|
|
35
39
|
example: 5,
|
|
36
40
|
}),
|
|
37
|
-
errorCount: z.number().openapi({
|
|
41
|
+
errorCount: z.number().optional().openapi({
|
|
38
42
|
description: 'Number of errors encountered',
|
|
39
43
|
example: 0,
|
|
40
44
|
}),
|
|
41
|
-
warningCount: z.number().openapi({
|
|
45
|
+
warningCount: z.number().optional().openapi({
|
|
42
46
|
description: 'Number of warnings encountered',
|
|
43
47
|
example: 1,
|
|
44
48
|
}),
|
|
45
|
-
|
|
49
|
+
errors: z
|
|
50
|
+
.array(z.object({
|
|
51
|
+
message: z.string().openapi({
|
|
52
|
+
description: 'Error message',
|
|
53
|
+
example: 'Failed to execute bubble',
|
|
54
|
+
}),
|
|
55
|
+
timestamp: z.number().openapi({
|
|
56
|
+
description: 'Error timestamp (Unix timestamp)',
|
|
57
|
+
example: 1703123457000,
|
|
58
|
+
}),
|
|
59
|
+
bubbleName: z.string().optional().openapi({
|
|
60
|
+
description: 'Name of the bubble that caused the error',
|
|
61
|
+
example: 'AIAgentBubble',
|
|
62
|
+
}),
|
|
63
|
+
variableId: z.number().optional().openapi({
|
|
64
|
+
description: 'Variable ID associated with the error',
|
|
65
|
+
example: 1,
|
|
66
|
+
}),
|
|
67
|
+
lineNumber: z.number().optional().openapi({
|
|
68
|
+
description: 'Line number where the error occurred',
|
|
69
|
+
example: 15,
|
|
70
|
+
}),
|
|
71
|
+
additionalData: z.any().optional().openapi({
|
|
72
|
+
description: 'Additional error details',
|
|
73
|
+
}),
|
|
74
|
+
}))
|
|
75
|
+
.optional()
|
|
76
|
+
.openapi({
|
|
77
|
+
description: 'Array of errors encountered during execution',
|
|
78
|
+
}),
|
|
79
|
+
warnings: z
|
|
80
|
+
.array(z.object({
|
|
81
|
+
message: z.string().openapi({
|
|
82
|
+
description: 'Warning message',
|
|
83
|
+
example: 'Deprecated API usage detected',
|
|
84
|
+
}),
|
|
85
|
+
timestamp: z.number().openapi({
|
|
86
|
+
description: 'Warning timestamp (Unix timestamp)',
|
|
87
|
+
example: 1703123457000,
|
|
88
|
+
}),
|
|
89
|
+
bubbleName: z.string().optional().openapi({
|
|
90
|
+
description: 'Name of the bubble that caused the warning',
|
|
91
|
+
example: 'HttpBubble',
|
|
92
|
+
}),
|
|
93
|
+
variableId: z.number().optional().openapi({
|
|
94
|
+
description: 'Variable ID associated with the warning',
|
|
95
|
+
example: 2,
|
|
96
|
+
}),
|
|
97
|
+
lineNumber: z.number().optional().openapi({
|
|
98
|
+
description: 'Line number where the warning occurred',
|
|
99
|
+
example: 20,
|
|
100
|
+
}),
|
|
101
|
+
additionalData: z.any().optional().openapi({
|
|
102
|
+
description: 'Additional warning details',
|
|
103
|
+
}),
|
|
104
|
+
}))
|
|
105
|
+
.optional()
|
|
106
|
+
.openapi({
|
|
107
|
+
description: 'Array of warnings encountered during execution',
|
|
108
|
+
}),
|
|
109
|
+
averageLineExecutionTime: z.number().optional().openapi({
|
|
46
110
|
description: 'Average execution time per line in milliseconds',
|
|
47
111
|
example: 60,
|
|
48
112
|
}),
|
|
@@ -61,21 +125,24 @@ export const ExecutionSummarySchema = z
|
|
|
61
125
|
example: 'API call to external service',
|
|
62
126
|
}),
|
|
63
127
|
}))
|
|
128
|
+
.optional()
|
|
64
129
|
.openapi({
|
|
65
130
|
description: 'Array of the slowest executing lines',
|
|
66
131
|
}),
|
|
67
132
|
memoryPeakUsage: z.any().optional().openapi({
|
|
68
133
|
description: 'Peak memory usage during execution (NodeJS.MemoryUsage type)',
|
|
69
134
|
}), // NodeJS.MemoryUsage type
|
|
70
|
-
startTime: z.number().openapi({
|
|
135
|
+
startTime: z.number().optional().openapi({
|
|
71
136
|
description: 'Execution start timestamp (Unix timestamp)',
|
|
72
137
|
example: 1703123456789,
|
|
73
138
|
}),
|
|
74
|
-
endTime: z.number().openapi({
|
|
139
|
+
endTime: z.number().optional().openapi({
|
|
75
140
|
description: 'Execution end timestamp (Unix timestamp)',
|
|
76
141
|
example: 1703123458289,
|
|
77
142
|
}),
|
|
78
|
-
tokenUsage: TokenUsageSchema
|
|
143
|
+
tokenUsage: TokenUsageSchema.optional().openapi({
|
|
144
|
+
description: 'Token usage during execution',
|
|
145
|
+
}),
|
|
79
146
|
tokenUsageByModel: z
|
|
80
147
|
.record(z.string(), TokenUsageSchema.omit({ modelName: true }))
|
|
81
148
|
.optional()
|
|
@@ -156,6 +223,9 @@ export const validateBubbleFlowCodeSchema = z.object({
|
|
|
156
223
|
strictMode: z.boolean().default(true).openapi({
|
|
157
224
|
description: 'Enable strict TypeScript validation',
|
|
158
225
|
}),
|
|
226
|
+
syncInputsWithFlow: z.boolean().default(false).openapi({
|
|
227
|
+
description: 'Whether to sync input values with the flow',
|
|
228
|
+
}),
|
|
159
229
|
})
|
|
160
230
|
.optional()
|
|
161
231
|
.openapi({
|
|
@@ -179,8 +249,30 @@ export const validateBubbleFlowCodeSchema = z.object({
|
|
|
179
249
|
},
|
|
180
250
|
},
|
|
181
251
|
}),
|
|
252
|
+
defaultInputs: z
|
|
253
|
+
.record(z.unknown())
|
|
254
|
+
.optional()
|
|
255
|
+
.openapi({
|
|
256
|
+
description: 'User-filled input values for cron execution',
|
|
257
|
+
example: {
|
|
258
|
+
message: 'Hello World',
|
|
259
|
+
channel: '#general',
|
|
260
|
+
},
|
|
261
|
+
}),
|
|
262
|
+
activateCron: z.boolean().optional().openapi({
|
|
263
|
+
description: 'Whether to activate/deactivate cron scheduling',
|
|
264
|
+
example: true,
|
|
265
|
+
}),
|
|
182
266
|
});
|
|
183
267
|
export const validateBubbleFlowCodeResponseSchema = z.object({
|
|
268
|
+
eventType: z.string().min(1).openapi({
|
|
269
|
+
description: 'Event type this BubbleFlow responds to',
|
|
270
|
+
example: 'webhook/http',
|
|
271
|
+
}),
|
|
272
|
+
webhookPath: z.string().min(1).openapi({
|
|
273
|
+
description: 'Custom webhook path (auto-generated if not provided)',
|
|
274
|
+
example: 'my-webhook',
|
|
275
|
+
}),
|
|
184
276
|
valid: z.boolean().openapi({
|
|
185
277
|
description: 'Whether the code is valid',
|
|
186
278
|
}),
|
|
@@ -224,6 +316,24 @@ export const validateBubbleFlowCodeResponseSchema = z.object({
|
|
|
224
316
|
.openapi({
|
|
225
317
|
description: 'Validation metadata',
|
|
226
318
|
}),
|
|
319
|
+
cron: z.string().nullable().optional().openapi({
|
|
320
|
+
description: 'Cron expression extracted from code',
|
|
321
|
+
example: '0 0 * * *',
|
|
322
|
+
}),
|
|
323
|
+
cronActive: z.boolean().optional().openapi({
|
|
324
|
+
description: 'Whether cron scheduling is currently active',
|
|
325
|
+
example: false,
|
|
326
|
+
}),
|
|
327
|
+
defaultInputs: z
|
|
328
|
+
.record(z.unknown())
|
|
329
|
+
.optional()
|
|
330
|
+
.openapi({
|
|
331
|
+
description: 'User-filled input values for cron execution',
|
|
332
|
+
example: {
|
|
333
|
+
message: 'Hello World',
|
|
334
|
+
channel: '#general',
|
|
335
|
+
},
|
|
336
|
+
}),
|
|
227
337
|
success: z.boolean(),
|
|
228
338
|
error: z.string(),
|
|
229
339
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bubbleflow-execution-schema.js","sourceRoot":"","sources":["../src/bubbleflow-execution-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAExE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,MAAM,CAAC;IACN,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC;QAC9B,WAAW,EAAE,6BAA6B;QAC1C,OAAO,EAAE,GAAG;KACb,CAAC;IACF,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC;QAC/B,WAAW,EAAE,mCAAmC;QAChD,OAAO,EAAE,EAAE;KACZ,CAAC;IACF,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC;QAC9B,WAAW,EAAE,8CAA8C;QAC3D,OAAO,EAAE,GAAG;KACb,CAAC;IACF,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC;QACvC,WAAW,EAAE,8CAA8C;QAC3D,OAAO,EAAE,yBAAyB;KACnC,CAAC;CACH,CAAC;KACD,OAAO,CA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CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC;QACzC,WAAW,EAAE,6CAA6C;QAC1D,OAAO,EAAE,KAAK;KACf,CAAC;IACF,aAAa,EAAE,CAAC;SACb,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SACnB,QAAQ,EAAE;SACV,OAAO,CAAC;QACP,WAAW,EAAE,6CAA6C;QAC1D,OAAO,EAAE;YACP,OAAO,EAAE,aAAa;YACtB,OAAO,EAAE,UAAU;SACpB;KACF,CAAC;IACJ,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared system prompts and critical instructions for BubbleFlow code generation
|
|
3
|
+
* Used by both Pearl AI agent and BubbleFlow Generator Workflow
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Critical instructions for AI agents generating BubbleFlow code
|
|
7
|
+
* These instructions ensure consistent, correct code generation
|
|
8
|
+
*/
|
|
9
|
+
export declare const CRITICAL_INSTRUCTIONS = "CRITICAL INSTRUCTIONS:\n1. Start with the exact boilerplate template above (it has all the correct imports and class structure), come up with a name for the flow based on the user's request, export class [name] extends BubbleFlow\n2. Properly type the payload import and output interface based on the user's request, create typescript interfaces for them\n3. BEFORE writing any code, identify which bubbles you plan to use from the available list\n4. For EACH bubble you plan to use, ALWAYS call get-bubble-details-tool first to understand:\n - The correct input parameters and their types\n - The expected output structure in result.data\n - How to properly handle success/error cases\n5. Replace the handle method with logic that fulfills the user's request\n6. Use the exact parameter structures shown in the bubble details\n7. If deterministic tool calls and branch logic are possible, there is no need to use AI agent.\n8. Access bubble outputs safely using result.data with null checking (e.g., result.data?.someProperty or check if result.data exists first)\n9. Return meaningful data from the handle method\n10. DO NOT include credentials in bubble parameters - credentials are handled automatically\n11. CRITICAL: Always use the pattern: const result = await new SomeBubble({params}).action() - NEVER use runBubble, this.runBubble, or any other method\n12. When using AI Agent, ensure your prompt includes comprehensive context and explicitly pass in all relevant information needed for the task. Be thorough in providing complete data rather than expecting the AI to infer or assume missing details (unless the information must be retrieved from an online source)\n13. When generating and dealing with images, process them one at a time to ensure proper handling and avoid overwhelming the system\n14. When dealing with other async operations in for loops, batch the requests 5 at a time at most and use Promise.all to handle them efficiently. Always declare bubble instances separately outside of callbacks, loops, or maps before calling .action() - avoid instantiating bubbles directly within map(), forEach(), or other callback functions.\n15. If the location of the output is unknown or not specified by the user, use this.logger?.info(message:string) to print the output to the console.\n16. DO NOT repeat the user's request in your response or thinking process. Do not include \"The user says: <user's request>\" in your response.\n\nCRITICAL: You MUST use get-bubble-details-tool for every bubble before using it in your code!";
|
|
10
|
+
/**
|
|
11
|
+
* Validation process instructions for ensuring generated code is valid
|
|
12
|
+
*/
|
|
13
|
+
export declare const VALIDATION_PROCESS = "CRITICAL VALIDATION PROCESS:\n1. After generating the initial code, ALWAYS use the bubbleflow-validation to validate it\n2. If validation fails, you MUST analyze ALL errors carefully and fix EVERY single one\n3. Use the bubbleflow-validation again to validate the fixed code\n4. If there are still errors, fix them ALL and validate again\n5. Repeat this validation-fix cycle until the code passes validation with NO ERRORS (valid: true)\n6. Do NOT stop until you get a successful validation result with valid: true and no errors\n7. NEVER provide code that has validation errors - keep fixing until it's completely error-free\n8. IMPORTANT: Use .action() on the to call the bubble, (this is the only way to run a bubble) - NEVER use runBubble() or any other method\n\nOnly return the final TypeScript code that passes validation. No explanations or markdown formatting.";
|
|
14
|
+
/**
|
|
15
|
+
* Additional instructions for input schema handling
|
|
16
|
+
*/
|
|
17
|
+
export declare const INPUT_SCHEMA_INSTRUCTIONS = "For input schema, ie. the interface passed to the handle method. Decide based on how\nthe workflow should typically be ran (if it should be variable or fixed). If all\ninputs are fixed take out the interface and just use handle() without the payload.\n\nIf no particular trigger is specified, use the webhook/http trigger.";
|
|
18
|
+
export declare const BUBBLE_SPECIFIC_INSTRUCTIONS = "BUBBLE SPECIFIC INSTRUCTIONS:\n1. When using the storage bubble, always use the bubble-lab-bucket bucket name, unless the user has their own s3/cloudflare bucket setup.\n2. When using the resend bubble, do not set the from parameter, it will be set automatically and use bubble lab's default email, unless the user has their own resend setup and account domain verified.\n";
|
|
19
|
+
//# sourceMappingURL=bubbleflow-generation-prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bubbleflow-generation-prompts.d.ts","sourceRoot":"","sources":["../src/bubbleflow-generation-prompts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB,0/EAqB4D,CAAC;AAE/F;;GAEG;AACH,eAAO,MAAM,kBAAkB,02BAUuE,CAAC;AAEvG;;GAEG;AACH,eAAO,MAAM,yBAAyB,uUAI+B,CAAC;AAEtE,eAAO,MAAM,4BAA4B,yXAGxC,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared system prompts and critical instructions for BubbleFlow code generation
|
|
3
|
+
* Used by both Pearl AI agent and BubbleFlow Generator Workflow
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Critical instructions for AI agents generating BubbleFlow code
|
|
7
|
+
* These instructions ensure consistent, correct code generation
|
|
8
|
+
*/
|
|
9
|
+
export const CRITICAL_INSTRUCTIONS = `CRITICAL INSTRUCTIONS:
|
|
10
|
+
1. Start with the exact boilerplate template above (it has all the correct imports and class structure), come up with a name for the flow based on the user's request, export class [name] extends BubbleFlow
|
|
11
|
+
2. Properly type the payload import and output interface based on the user's request, create typescript interfaces for them
|
|
12
|
+
3. BEFORE writing any code, identify which bubbles you plan to use from the available list
|
|
13
|
+
4. For EACH bubble you plan to use, ALWAYS call get-bubble-details-tool first to understand:
|
|
14
|
+
- The correct input parameters and their types
|
|
15
|
+
- The expected output structure in result.data
|
|
16
|
+
- How to properly handle success/error cases
|
|
17
|
+
5. Replace the handle method with logic that fulfills the user's request
|
|
18
|
+
6. Use the exact parameter structures shown in the bubble details
|
|
19
|
+
7. If deterministic tool calls and branch logic are possible, there is no need to use AI agent.
|
|
20
|
+
8. Access bubble outputs safely using result.data with null checking (e.g., result.data?.someProperty or check if result.data exists first)
|
|
21
|
+
9. Return meaningful data from the handle method
|
|
22
|
+
10. DO NOT include credentials in bubble parameters - credentials are handled automatically
|
|
23
|
+
11. CRITICAL: Always use the pattern: const result = await new SomeBubble({params}).action() - NEVER use runBubble, this.runBubble, or any other method
|
|
24
|
+
12. When using AI Agent, ensure your prompt includes comprehensive context and explicitly pass in all relevant information needed for the task. Be thorough in providing complete data rather than expecting the AI to infer or assume missing details (unless the information must be retrieved from an online source)
|
|
25
|
+
13. When generating and dealing with images, process them one at a time to ensure proper handling and avoid overwhelming the system
|
|
26
|
+
14. When dealing with other async operations in for loops, batch the requests 5 at a time at most and use Promise.all to handle them efficiently. Always declare bubble instances separately outside of callbacks, loops, or maps before calling .action() - avoid instantiating bubbles directly within map(), forEach(), or other callback functions.
|
|
27
|
+
15. If the location of the output is unknown or not specified by the user, use this.logger?.info(message:string) to print the output to the console.
|
|
28
|
+
16. DO NOT repeat the user's request in your response or thinking process. Do not include "The user says: <user's request>" in your response.
|
|
29
|
+
|
|
30
|
+
CRITICAL: You MUST use get-bubble-details-tool for every bubble before using it in your code!`;
|
|
31
|
+
/**
|
|
32
|
+
* Validation process instructions for ensuring generated code is valid
|
|
33
|
+
*/
|
|
34
|
+
export const VALIDATION_PROCESS = `CRITICAL VALIDATION PROCESS:
|
|
35
|
+
1. After generating the initial code, ALWAYS use the bubbleflow-validation to validate it
|
|
36
|
+
2. If validation fails, you MUST analyze ALL errors carefully and fix EVERY single one
|
|
37
|
+
3. Use the bubbleflow-validation again to validate the fixed code
|
|
38
|
+
4. If there are still errors, fix them ALL and validate again
|
|
39
|
+
5. Repeat this validation-fix cycle until the code passes validation with NO ERRORS (valid: true)
|
|
40
|
+
6. Do NOT stop until you get a successful validation result with valid: true and no errors
|
|
41
|
+
7. NEVER provide code that has validation errors - keep fixing until it's completely error-free
|
|
42
|
+
8. IMPORTANT: Use .action() on the to call the bubble, (this is the only way to run a bubble) - NEVER use runBubble() or any other method
|
|
43
|
+
|
|
44
|
+
Only return the final TypeScript code that passes validation. No explanations or markdown formatting.`;
|
|
45
|
+
/**
|
|
46
|
+
* Additional instructions for input schema handling
|
|
47
|
+
*/
|
|
48
|
+
export const INPUT_SCHEMA_INSTRUCTIONS = `For input schema, ie. the interface passed to the handle method. Decide based on how
|
|
49
|
+
the workflow should typically be ran (if it should be variable or fixed). If all
|
|
50
|
+
inputs are fixed take out the interface and just use handle() without the payload.
|
|
51
|
+
|
|
52
|
+
If no particular trigger is specified, use the webhook/http trigger.`;
|
|
53
|
+
export const BUBBLE_SPECIFIC_INSTRUCTIONS = `BUBBLE SPECIFIC INSTRUCTIONS:
|
|
54
|
+
1. When using the storage bubble, always use the bubble-lab-bucket bucket name, unless the user has their own s3/cloudflare bucket setup.
|
|
55
|
+
2. When using the resend bubble, do not set the from parameter, it will be set automatically and use bubble lab's default email, unless the user has their own resend setup and account domain verified.
|
|
56
|
+
`;
|
|
57
|
+
//# sourceMappingURL=bubbleflow-generation-prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bubbleflow-generation-prompts.js","sourceRoot":"","sources":["../src/bubbleflow-generation-prompts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;8FAqByD,CAAC;AAE/F;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;sGAUoE,CAAC;AAEvG;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;qEAI4B,CAAC;AAEtE,MAAM,CAAC,MAAM,4BAA4B,GAAG;;;CAG3C,CAAC"}
|