@bubblelab/bubble-core 0.1.4 → 0.1.5

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.
Files changed (66) hide show
  1. package/dist/bubble-bundle.d.ts +28 -28
  2. package/dist/bubbles/service-bubble/ai-agent.d.ts +24 -24
  3. package/dist/bubbles/service-bubble/ai-agent.d.ts.map +1 -1
  4. package/dist/bubbles/service-bubble/ai-agent.js +16 -2
  5. package/dist/bubbles/service-bubble/ai-agent.js.map +1 -1
  6. package/dist/bubbles/service-bubble/gmail.d.ts +4 -4
  7. package/dist/bubbles/service-bubble/google-calendar.d.ts +6 -6
  8. package/dist/bubbles/service-bubble/google-drive.d.ts +4 -4
  9. package/dist/bubbles/service-bubble/google-sheets.d.ts +20 -20
  10. package/dist/bubbles/service-bubble/http.d.ts +2 -2
  11. package/dist/bubbles/service-bubble/postgresql.d.ts +4 -4
  12. package/dist/bubbles/service-bubble/slack.d.ts +58 -58
  13. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts +4 -4
  14. package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts +4 -4
  15. package/dist/bubbles/tool-bubble/list-bubbles-tool.d.ts +4 -4
  16. package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts +10 -10
  17. package/dist/bubbles/tool-bubble/research-agent-tool.d.ts +14 -14
  18. package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts +8 -8
  19. package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts +10 -10
  20. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts +8 -8
  21. package/dist/bubbles/workflow-bubble/generate-document.workflow.d.ts +66 -66
  22. package/dist/bubbles/workflow-bubble/parse-document.workflow.d.ts +50 -50
  23. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts +92 -92
  24. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts +36 -36
  25. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts +46 -46
  26. package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts +60 -60
  27. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts +14 -14
  28. package/dist/logging/BubbleLogger.d.ts.map +1 -1
  29. package/dist/logging/BubbleLogger.js +16 -4
  30. package/dist/logging/BubbleLogger.js.map +1 -1
  31. package/dist/types/ai-models.d.ts +1 -1
  32. package/dist/types/ai-models.d.ts.map +1 -1
  33. package/dist/types/ai-models.js +2 -0
  34. package/dist/types/ai-models.js.map +1 -1
  35. package/dist/types/base-bubble-class.d.ts.map +1 -1
  36. package/dist/types/base-bubble-class.js +7 -1
  37. package/dist/types/base-bubble-class.js.map +1 -1
  38. package/package.json +4 -3
  39. package/dist/bubbles/tool-bubble/virtual-file-editor-example.d.ts +0 -8
  40. package/dist/bubbles/tool-bubble/virtual-file-editor-example.d.ts.map +0 -1
  41. package/dist/bubbles/tool-bubble/virtual-file-editor-example.js +0 -65
  42. package/dist/bubbles/tool-bubble/virtual-file-editor-example.js.map +0 -1
  43. package/dist/bubbles/tool-bubble/virtual-file-editor.tool.d.ts +0 -125
  44. package/dist/bubbles/tool-bubble/virtual-file-editor.tool.d.ts.map +0 -1
  45. package/dist/bubbles/tool-bubble/virtual-file-editor.tool.js +0 -169
  46. package/dist/bubbles/tool-bubble/virtual-file-editor.tool.js.map +0 -1
  47. package/dist/bubbles/workflow-bubble/bubblscript-generateor.workflow.d.ts +0 -97
  48. package/dist/bubbles/workflow-bubble/bubblscript-generateor.workflow.d.ts.map +0 -1
  49. package/dist/bubbles/workflow-bubble/bubblscript-generateor.workflow.js +0 -327
  50. package/dist/bubbles/workflow-bubble/bubblscript-generateor.workflow.js.map +0 -1
  51. package/dist/bubbles/workflow-bubble/file-editor-agent.workflow.d.ts +0 -157
  52. package/dist/bubbles/workflow-bubble/file-editor-agent.workflow.d.ts.map +0 -1
  53. package/dist/bubbles/workflow-bubble/file-editor-agent.workflow.js +0 -310
  54. package/dist/bubbles/workflow-bubble/file-editor-agent.workflow.js.map +0 -1
  55. package/dist/bubbles/workflow-bubble/workflow-template.d.ts +0 -144
  56. package/dist/bubbles/workflow-bubble/workflow-template.d.ts.map +0 -1
  57. package/dist/bubbles/workflow-bubble/workflow-template.js +0 -124
  58. package/dist/bubbles/workflow-bubble/workflow-template.js.map +0 -1
  59. package/dist/types/streaming-events.d.ts +0 -18
  60. package/dist/types/streaming-events.d.ts.map +0 -1
  61. package/dist/types/streaming-events.js +0 -5
  62. package/dist/types/streaming-events.js.map +0 -1
  63. package/dist/utils/mock-data-generator.d.ts +0 -43
  64. package/dist/utils/mock-data-generator.d.ts.map +0 -1
  65. package/dist/utils/mock-data-generator.js +0 -312
  66. package/dist/utils/mock-data-generator.js.map +0 -1
@@ -1,327 +0,0 @@
1
- /**
2
- * BUBBLSCRIPT GENERATOR WORKFLOW (no streaming)
3
- *
4
- * Builds BubbleFlow code via an iterative loop:
5
- * 1) Requirement Agent gates the request
6
- * 2) Coding Agent proposes file edits (insert/delete/replace) using tools:
7
- * - list-bubbles-tool (discover)
8
- * - get-bubble-details-tool (inspect)
9
- * 3) Validation runs as a separate tool outside the agent each iteration
10
- * 4) Summarize Agent outputs a short usage summary on success
11
- *
12
- * The coding state is maintained as an array of lines (codeLines: string[]).
13
- * Each iteration re-creates the agent with an updated system prompt containing
14
- * the virtual file view (with line numbers) and any validation errors.
15
- */
16
- import { z } from 'zod';
17
- import { WorkflowBubble } from '../../types/workflow-bubble-class.js';
18
- import { CredentialType } from '@nodex/shared-schemas';
19
- import { AIAgentBubble } from '../service-bubble/ai-agent.js';
20
- import { BubbleFactory } from '../../bubble-factory.js';
21
- // Local tool bubbles used explicitly by this workflow
22
- import { BubbleFlowValidationTool } from '../tool-bubble/bubbleflow-validation-tool.js';
23
- // Parameters Schema
24
- const BubblscriptGeneratorParamsSchema = z.object({
25
- prompt: z.string().min(1, 'Prompt is required'),
26
- credentials: z.record(z.nativeEnum(CredentialType), z.string()).optional(),
27
- });
28
- // Result Schema
29
- const BubblscriptGeneratorResultSchema = z.object({
30
- generatedCode: z
31
- .string()
32
- .describe('Final generated BubbleFlow TypeScript code'),
33
- isValid: z.boolean(),
34
- success: z.boolean(),
35
- error: z.string(),
36
- toolCalls: z.array(z.any()).default([]),
37
- summary: z.string().default(''),
38
- });
39
- // Config
40
- const AI_MODEL_CONFIG = {
41
- model: 'google/gemini-2.5-pro',
42
- temperature: 0.2,
43
- };
44
- const MAX_ITERATIONS = 20;
45
- // Tools (names only for agent wiring)
46
- const TOOL_NAMES = {
47
- LIST_BUBBLES: 'list-bubbles-tool',
48
- BUBBLE_DETAILS: 'get-bubble-details-tool',
49
- };
50
- // Helpers
51
- function splitLines(source) {
52
- // Normalize to \n then split; keep empty last line if present
53
- console.log('[BubblscriptGen] splitLines: input length', source.length);
54
- return source.replace(/\r\n?/g, '\n').split('\n');
55
- }
56
- function joinLines(lines) {
57
- console.log('[BubblscriptGen] joinLines: lines', lines.length);
58
- return lines.join('\n');
59
- }
60
- function formatVirtualFileContext(codeLines) {
61
- // Render with 1-based line numbers
62
- const body = codeLines
63
- .map((ln, i) => `${(i + 1).toString().padStart(3, ' ')} ${ln}`)
64
- .join('\n');
65
- console.log('[BubblscriptGen] formatVirtualFileContext: lines', codeLines.length);
66
- return `bubblescript\npreconfigured {\n\ntemplate code beg\n\n${body}\n\ntemplate code end\n\n}`;
67
- }
68
- function buildCodingAgentSystemPrompt(_boilerplate, availableBubbles) {
69
- const bubbleList = availableBubbles.join('\n- ');
70
- return [
71
- 'You are codingAgent. Your job is to edit a virtual file to satisfy a user request.',
72
- 'Only respond with strict JSON: { "edits": FileEdit[] } where FileEdit is one of:',
73
- '{ op: "insert" | "delete" | "replace", startLine: number, endLine?: number, text?: string }',
74
- 'Rules:',
75
- '- The file content is modeled as an array of lines; line numbers are 1-based.',
76
- '- For insert: add text lines before startLine. For delete/replace: endLine is inclusive.',
77
- '- Do not include markdown code fences. Do not include commentary.',
78
- '- You may call tools to discover bubbles: list-bubbles-tool and get-bubble-details-tool.',
79
- '- Use get-bubble-details-tool before using a bubble to copy exact parameter and .action() usage.',
80
- '- Never include credentials in bubble params; they are injected by the system.',
81
- '',
82
- 'Start from the provided template. Implement the flow inside the class using the proper BubbleFlow pattern.',
83
- '',
84
- 'Available bubbles (names):',
85
- `- ${bubbleList}`,
86
- '',
87
- 'When validation errors are provided, fix ALL issues precisely at the referenced line numbers.',
88
- ].join('\n');
89
- }
90
- function buildRequirementAgentPrompt(userPrompt) {
91
- return [
92
- 'You are requirementAgent. Decide if the following request should be accepted.',
93
- 'Only respond with strict JSON: { "accept": boolean, "reason"?: string }.',
94
- 'Reject if illegal, unsafe, irrelevant to generating a BubbleFlow workflow, or missing critical details.',
95
- `Request: ${userPrompt}`,
96
- ].join('\n');
97
- }
98
- function buildSummarizeAgentPrompt(validatedCode) {
99
- return [
100
- 'You are summarizeAgent. Read the validated BubbleFlow TypeScript code and produce a short summary for the user.',
101
- 'Only respond with strict JSON: { "summary": string }.',
102
- 'Cover: credentials needed, setup, trigger, and expected outputs at a high level.',
103
- 'Code follows:',
104
- validatedCode,
105
- ].join('\n');
106
- }
107
- export class BubblscriptGenerateorWorkflow extends WorkflowBubble {
108
- static type = 'workflow';
109
- static bubbleName = 'bubblscript-generateor';
110
- static schema = BubblscriptGeneratorParamsSchema;
111
- static resultSchema = BubblscriptGeneratorResultSchema;
112
- static shortDescription = 'Generate BubbleFlow code using a virtual-file edit loop with validation.';
113
- static longDescription = `
114
- A highly efficient BubbleFlow generator that follows a strict agent graph:
115
- Requirement → Coding (edits) ↺ Validation → Summarize.
116
- The Coding Agent operates on a virtual file via line-based edits and can only use
117
- discovery/inspection tools (list-bubbles-tool, get-bubble-details-tool). Validation is separate.
118
- `;
119
- static alias = 'bubblscript-gen';
120
- factory;
121
- constructor(params, context) {
122
- super(params, context);
123
- this.factory = new BubbleFactory();
124
- console.log('[BubblscriptGen] constructed with prompt:', params.prompt);
125
- }
126
- async performAction(context) {
127
- void context;
128
- try {
129
- // Ensure registry is ready
130
- await this.factory.registerDefaults();
131
- console.log('[BubblscriptGen] factory defaults registered');
132
- // 1) Requirement gate
133
- const reqAgent = new AIAgentBubble({
134
- name: 'Requirement Agent',
135
- message: buildRequirementAgentPrompt(this.params.prompt),
136
- systemPrompt: 'Return strict JSON only. No markdown. No commentary.',
137
- model: { jsonMode: true },
138
- tools: [],
139
- maxIterations: 1,
140
- credentials: this.params.credentials,
141
- }, this.context);
142
- console.log('[BubblscriptGen] requirement agent starting');
143
- const reqResult = await reqAgent.action();
144
- console.log('[BubblscriptGen] requirement agent result success:', reqResult.success, 'len:', reqResult.data?.response?.length || 0);
145
- const reqRaw = reqResult.data?.response?.trim() || '';
146
- let decision = { accept: true };
147
- try {
148
- decision = JSON.parse(reqRaw);
149
- console.log('[BubblscriptGen] requirement decision:', decision.accept, decision.reason || '');
150
- }
151
- catch {
152
- // default accept if parse fails to avoid blocking legitimate requests
153
- console.log('[BubblscriptGen] requirement decision parse failed, default accept');
154
- }
155
- if (!decision.accept) {
156
- console.log('[BubblscriptGen] requirement rejected:', decision.reason);
157
- return {
158
- toolCalls: reqResult.data?.toolCalls || [],
159
- generatedCode: '',
160
- isValid: false,
161
- success: false,
162
- error: decision.reason || 'Rejected by requirement agent',
163
- summary: '',
164
- };
165
- }
166
- // 2) Initialize virtual file from boilerplate
167
- const boilerplate = this.factory.generateBubbleFlowBoilerplate();
168
- let codeLines = splitLines(boilerplate);
169
- console.log('[BubblscriptGen] initial boilerplate lines:', codeLines.length);
170
- // Available bubbles list for context (names only)
171
- const availableBubbles = this.factory.listBubblesForCodeGenerator();
172
- console.log('[BubblscriptGen] available bubbles:', availableBubbles.length);
173
- let toolCalls = [];
174
- let lastValidationErrors = [];
175
- let finalValid = false;
176
- let finalError = '';
177
- // Iterative edit → validate loop
178
- for (let iter = 1; iter <= MAX_ITERATIONS; iter++) {
179
- console.log('[BubblscriptGen] iteration', iter, 'start');
180
- // Use the VirtualFileEditor tool to render the current file context (no edits)
181
- const { VirtualFileEditorTool } = await import('../tool-bubble/virtual-file-editor.tool.js');
182
- const vfe = new VirtualFileEditorTool({
183
- config: { codeLines },
184
- edits: [],
185
- });
186
- const vfeView = await vfe.action();
187
- const virtualFileView = vfeView.data?.rendered || formatVirtualFileContext(codeLines);
188
- const codingAgent = new AIAgentBubble({
189
- name: `Coding Agent (iteration ${iter})`,
190
- message: `User request: ${this.params.prompt}`,
191
- systemPrompt: [
192
- buildCodingAgentSystemPrompt(boilerplate, availableBubbles),
193
- '',
194
- 'Virtual file view (read-only, edit via JSON edits):',
195
- virtualFileView,
196
- '',
197
- lastValidationErrors.length > 0
198
- ? `Validation errors (fix all):\n- ${lastValidationErrors.join('\n- ')}`
199
- : 'No validation errors yet — implement the request.',
200
- ].join('\n'),
201
- model: AI_MODEL_CONFIG,
202
- tools: [
203
- {
204
- name: TOOL_NAMES.LIST_BUBBLES,
205
- credentials: this.params.credentials || {},
206
- },
207
- {
208
- name: TOOL_NAMES.BUBBLE_DETAILS,
209
- credentials: this.params.credentials || {},
210
- },
211
- ],
212
- maxIterations: 3,
213
- credentials: this.params.credentials,
214
- }, this.context);
215
- const codeResult = await codingAgent.action();
216
- console.log('[BubblscriptGen] coding agent result success:', codeResult.success, 'responseLen:', codeResult.data?.response?.length || 0);
217
- if (codeResult.data?.toolCalls) {
218
- toolCalls = toolCalls.concat(codeResult.data.toolCalls);
219
- console.log('[BubblscriptGen] coding agent toolCalls count total:', toolCalls.length);
220
- }
221
- // Parse edits JSON
222
- let edits = [];
223
- try {
224
- const raw = codeResult.data?.response?.trim() || '';
225
- const parsed = JSON.parse(raw);
226
- if (Array.isArray(parsed.edits)) {
227
- edits = parsed.edits;
228
- console.log('[BubblscriptGen] parsed edits:', edits.length);
229
- }
230
- }
231
- catch (e) {
232
- // If the agent failed to return valid JSON, continue to next iteration without edits
233
- lastValidationErrors = [
234
- 'Agent did not return valid JSON edits. Please return { "edits": FileEdit[] } only.',
235
- ];
236
- console.log('[BubblscriptGen] edit parse error, continuing');
237
- continue;
238
- }
239
- // Apply edits via VirtualFileEditor tool
240
- if (edits.length > 0) {
241
- const vfeApply = new VirtualFileEditorTool({
242
- config: { codeLines },
243
- edits,
244
- });
245
- const vfeResult = await vfeApply.action();
246
- if (vfeResult.success && Array.isArray(vfeResult.data?.codeLines)) {
247
- codeLines = vfeResult.data.codeLines;
248
- }
249
- else {
250
- console.log('[BubblscriptGen] VFE apply failed, keeping previous codeLines');
251
- }
252
- }
253
- // Validate
254
- const codeString = joinLines(codeLines);
255
- const validator = new BubbleFlowValidationTool({
256
- code: codeString,
257
- options: { includeDetails: true, strictMode: true },
258
- });
259
- const validation = await validator.action();
260
- console.log('[BubblscriptGen] validation success:', validation.success, 'valid:', validation.data?.valid === true, 'errors:', Array.isArray(validation.data?.errors)
261
- ? validation.data?.errors.length
262
- : 0);
263
- if (validation.data?.valid) {
264
- finalValid = true;
265
- finalError = '';
266
- console.log('[BubblscriptGen] validation passed');
267
- // Stop loop on success
268
- break;
269
- }
270
- finalValid = false;
271
- finalError = validation.error || 'Validation failed';
272
- lastValidationErrors = Array.isArray(validation.data?.errors)
273
- ? validation.data?.errors
274
- : [finalError];
275
- console.log('[BubblscriptGen] validation failed, errors:', lastValidationErrors.length);
276
- }
277
- const finalCode = joinLines(codeLines);
278
- // Summarize only if valid
279
- let summary = '';
280
- if (finalValid) {
281
- const summarizeAgent = new AIAgentBubble({
282
- name: 'Summarize Agent',
283
- message: buildSummarizeAgentPrompt(finalCode),
284
- systemPrompt: 'Return strict JSON only.',
285
- model: { jsonMode: true },
286
- tools: [],
287
- maxIterations: 1,
288
- credentials: this.params.credentials,
289
- }, this.context);
290
- console.log('[BubblscriptGen] summarize agent starting');
291
- const sumResult = await summarizeAgent.action();
292
- try {
293
- const raw = sumResult.data?.response?.trim() || '';
294
- const parsed = JSON.parse(raw);
295
- summary = typeof parsed.summary === 'string' ? parsed.summary : '';
296
- console.log('[BubblscriptGen] summary length:', summary.length);
297
- }
298
- catch {
299
- summary = '';
300
- console.log('[BubblscriptGen] summary parse failed');
301
- }
302
- }
303
- return {
304
- toolCalls,
305
- generatedCode: finalCode,
306
- isValid: finalValid,
307
- success: true,
308
- error: finalValid
309
- ? ''
310
- : 'Code did not fully validate within max iterations',
311
- summary,
312
- };
313
- }
314
- catch (error) {
315
- console.error('[BubblscriptGen] fatal error:', error);
316
- return {
317
- toolCalls: [],
318
- generatedCode: '',
319
- isValid: false,
320
- success: false,
321
- error: error instanceof Error ? error.message : 'Unknown error',
322
- summary: '',
323
- };
324
- }
325
- }
326
- }
327
- //# sourceMappingURL=bubblscript-generateor.workflow.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bubblscript-generateor.workflow.js","sourceRoot":"","sources":["../../../src/bubbles/workflow-bubble/bubblscript-generateor.workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,sDAAsD;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AAExF,oBAAoB;AACpB,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,oBAAoB,CAAC;IAC/C,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC3E,CAAC,CAAC;AAEH,gBAAgB;AAChB,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,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AAC,KAAK,CAAC,GAAG,CAAyB,CAAC;oBACvD,OAAO,GAAG,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;oBACnE,OAAO,CAAC,GAAG,CAAC,kCAAkC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;gBAClE,CAAC;gBAAC,MAAM,CAAC;oBACP,OAAO,GAAG,EAAE,CAAC;oBACb,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;gBACvD,CAAC;YACH,CAAC;YAED,OAAO;gBACL,SAAS;gBACT,aAAa,EAAE,SAAS;gBACxB,OAAO,EAAE,UAAU;gBACnB,OAAO,EAAE,IAAI;gBACb,KAAK,EAAE,UAAU;oBACf,CAAC,CAAC,EAAE;oBACJ,CAAC,CAAC,mDAAmD;gBACvD,OAAO;aACR,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC;YACtD,OAAO;gBACL,SAAS,EAAE,EAAE;gBACb,aAAa,EAAE,EAAE;gBACjB,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;gBAC/D,OAAO,EAAE,EAAE;aACZ,CAAC;QACJ,CAAC;IACH,CAAC"}
@@ -1,157 +0,0 @@
1
- /**
2
- * FILE EDITOR AGENT WORKFLOW
3
- *
4
- * A minimalistic agentic file editor that uses AI with the virtual-file-editor-tool
5
- * to iteratively edit code files through natural language instructions.
6
- *
7
- * The workflow maintains file state across tool calls using the config mechanism,
8
- * allowing the AI agent to build up complex edits incrementally.
9
- */
10
- import { z } from 'zod';
11
- import { WorkflowBubble } from '../../types/workflow-bubble-class.js';
12
- import type { BubbleContext } from '../../types/bubble.js';
13
- import { CredentialType } from '@bubblelab/shared-schemas';
14
- /**
15
- * Schema for file content representation
16
- * Each file is represented as a JavaScript object where keys are class/function names
17
- * and values are arrays of lines (indexed by line number)
18
- */
19
- /**
20
- * Parameters schema for file editor agent
21
- */
22
- declare const FileEditorAgentParamsSchema: z.ZodObject<{
23
- files: z.ZodArray<z.ZodString, "many">;
24
- validationFunction: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodArray<z.ZodString, "many">, z.ZodNumber], z.ZodUnknown>, z.ZodPromise<z.ZodObject<{
25
- validated: z.ZodBoolean;
26
- message: z.ZodString;
27
- }, "strip", z.ZodTypeAny, {
28
- message: string;
29
- validated: boolean;
30
- }, {
31
- message: string;
32
- validated: boolean;
33
- }>>>>;
34
- tools: z.ZodDefault<z.ZodArray<z.ZodEnum<["web-search-tool", "web-scrape-tool", "web-crawl-tool", "web-extract-tool", "research-agent-tool", "reddit-scrape-tool", "list-bubbles-tool", "get-bubble-details-tool", "bubbleflow-validation-tool", "virtual-file-editor-tool", "chart-js-tool", "sql-query-tool"]>, "many">>;
35
- instruction: z.ZodString;
36
- maxIterations: z.ZodDefault<z.ZodNumber>;
37
- model: z.ZodDefault<z.ZodEnum<["openai/gpt-5", "openai/gpt-5-mini", "openai/gpt-o4-mini", "google/gemini-2.5-pro", "google/gemini-2.5-flash", "google/gemini-2.5-flash-lite", "google/gemini-2.5-flash-image-preview"]>>;
38
- credentials: z.ZodOptional<z.ZodRecord<z.ZodNativeEnum<typeof CredentialType>, z.ZodString>>;
39
- }, "strip", z.ZodTypeAny, {
40
- model: "openai/gpt-5" | "openai/gpt-5-mini" | "openai/gpt-o4-mini" | "google/gemini-2.5-pro" | "google/gemini-2.5-flash" | "google/gemini-2.5-flash-lite" | "google/gemini-2.5-flash-image-preview";
41
- tools: ("virtual-file-editor-tool" | "get-bubble-details-tool" | "list-bubbles-tool" | "sql-query-tool" | "chart-js-tool" | "web-search-tool" | "web-scrape-tool" | "web-crawl-tool" | "web-extract-tool" | "research-agent-tool" | "reddit-scrape-tool" | "bubbleflow-validation-tool")[];
42
- maxIterations: number;
43
- files: string[];
44
- instruction: string;
45
- credentials?: Partial<Record<CredentialType, string>> | undefined;
46
- validationFunction?: ((args_0: string[], args_1: number, ...args: unknown[]) => Promise<{
47
- message: string;
48
- validated: boolean;
49
- }>) | undefined;
50
- }, {
51
- files: string[];
52
- instruction: string;
53
- credentials?: Partial<Record<CredentialType, string>> | undefined;
54
- model?: "openai/gpt-5" | "openai/gpt-5-mini" | "openai/gpt-o4-mini" | "google/gemini-2.5-pro" | "google/gemini-2.5-flash" | "google/gemini-2.5-flash-lite" | "google/gemini-2.5-flash-image-preview" | undefined;
55
- tools?: ("virtual-file-editor-tool" | "get-bubble-details-tool" | "list-bubbles-tool" | "sql-query-tool" | "chart-js-tool" | "web-search-tool" | "web-scrape-tool" | "web-crawl-tool" | "web-extract-tool" | "research-agent-tool" | "reddit-scrape-tool" | "bubbleflow-validation-tool")[] | undefined;
56
- maxIterations?: number | undefined;
57
- validationFunction?: ((args_0: string[], args_1: number, ...args: unknown[]) => Promise<{
58
- message: string;
59
- validated: boolean;
60
- }>) | undefined;
61
- }>;
62
- /**
63
- * Result schema for file editor agent
64
- */
65
- declare const FileEditorAgentResultSchema: z.ZodObject<{
66
- iterationsUsed: z.ZodNumber;
67
- success: z.ZodBoolean;
68
- fileContent: z.ZodArray<z.ZodString, "many">;
69
- message: z.ZodString;
70
- error: z.ZodString;
71
- }, "strip", z.ZodTypeAny, {
72
- message: string;
73
- success: boolean;
74
- error: string;
75
- fileContent: string[];
76
- iterationsUsed: number;
77
- }, {
78
- message: string;
79
- success: boolean;
80
- error: string;
81
- fileContent: string[];
82
- iterationsUsed: number;
83
- }>;
84
- type FileEditorAgentParams = z.output<typeof FileEditorAgentParamsSchema>;
85
- type FileEditorAgentResult = z.output<typeof FileEditorAgentResultSchema>;
86
- export declare class FileEditorAgentWorkflow extends WorkflowBubble<FileEditorAgentParams, FileEditorAgentResult> {
87
- static readonly type: "workflow";
88
- static readonly bubbleName = "file-editor-agent";
89
- static readonly schema: z.ZodObject<{
90
- files: z.ZodArray<z.ZodString, "many">;
91
- validationFunction: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodArray<z.ZodString, "many">, z.ZodNumber], z.ZodUnknown>, z.ZodPromise<z.ZodObject<{
92
- validated: z.ZodBoolean;
93
- message: z.ZodString;
94
- }, "strip", z.ZodTypeAny, {
95
- message: string;
96
- validated: boolean;
97
- }, {
98
- message: string;
99
- validated: boolean;
100
- }>>>>;
101
- tools: z.ZodDefault<z.ZodArray<z.ZodEnum<["web-search-tool", "web-scrape-tool", "web-crawl-tool", "web-extract-tool", "research-agent-tool", "reddit-scrape-tool", "list-bubbles-tool", "get-bubble-details-tool", "bubbleflow-validation-tool", "virtual-file-editor-tool", "chart-js-tool", "sql-query-tool"]>, "many">>;
102
- instruction: z.ZodString;
103
- maxIterations: z.ZodDefault<z.ZodNumber>;
104
- model: z.ZodDefault<z.ZodEnum<["openai/gpt-5", "openai/gpt-5-mini", "openai/gpt-o4-mini", "google/gemini-2.5-pro", "google/gemini-2.5-flash", "google/gemini-2.5-flash-lite", "google/gemini-2.5-flash-image-preview"]>>;
105
- credentials: z.ZodOptional<z.ZodRecord<z.ZodNativeEnum<typeof CredentialType>, z.ZodString>>;
106
- }, "strip", z.ZodTypeAny, {
107
- model: "openai/gpt-5" | "openai/gpt-5-mini" | "openai/gpt-o4-mini" | "google/gemini-2.5-pro" | "google/gemini-2.5-flash" | "google/gemini-2.5-flash-lite" | "google/gemini-2.5-flash-image-preview";
108
- tools: ("virtual-file-editor-tool" | "get-bubble-details-tool" | "list-bubbles-tool" | "sql-query-tool" | "chart-js-tool" | "web-search-tool" | "web-scrape-tool" | "web-crawl-tool" | "web-extract-tool" | "research-agent-tool" | "reddit-scrape-tool" | "bubbleflow-validation-tool")[];
109
- maxIterations: number;
110
- files: string[];
111
- instruction: string;
112
- credentials?: Partial<Record<CredentialType, string>> | undefined;
113
- validationFunction?: ((args_0: string[], args_1: number, ...args: unknown[]) => Promise<{
114
- message: string;
115
- validated: boolean;
116
- }>) | undefined;
117
- }, {
118
- files: string[];
119
- instruction: string;
120
- credentials?: Partial<Record<CredentialType, string>> | undefined;
121
- model?: "openai/gpt-5" | "openai/gpt-5-mini" | "openai/gpt-o4-mini" | "google/gemini-2.5-pro" | "google/gemini-2.5-flash" | "google/gemini-2.5-flash-lite" | "google/gemini-2.5-flash-image-preview" | undefined;
122
- tools?: ("virtual-file-editor-tool" | "get-bubble-details-tool" | "list-bubbles-tool" | "sql-query-tool" | "chart-js-tool" | "web-search-tool" | "web-scrape-tool" | "web-crawl-tool" | "web-extract-tool" | "research-agent-tool" | "reddit-scrape-tool" | "bubbleflow-validation-tool")[] | undefined;
123
- maxIterations?: number | undefined;
124
- validationFunction?: ((args_0: string[], args_1: number, ...args: unknown[]) => Promise<{
125
- message: string;
126
- validated: boolean;
127
- }>) | undefined;
128
- }>;
129
- static readonly resultSchema: z.ZodObject<{
130
- iterationsUsed: z.ZodNumber;
131
- success: z.ZodBoolean;
132
- fileContent: z.ZodArray<z.ZodString, "many">;
133
- message: z.ZodString;
134
- error: z.ZodString;
135
- }, "strip", z.ZodTypeAny, {
136
- message: string;
137
- success: boolean;
138
- error: string;
139
- fileContent: string[];
140
- iterationsUsed: number;
141
- }, {
142
- message: string;
143
- success: boolean;
144
- error: string;
145
- fileContent: string[];
146
- iterationsUsed: number;
147
- }>;
148
- static readonly shortDescription = "Agentic file editor using AI with virtual-file-editor-tool";
149
- static readonly longDescription = "\n A minimalistic workflow that uses an AI agent with the virtual-file-editor-tool\n to iteratively edit code files based on natural language instructions.\n \n How it works:\n 1. Takes file content as a JS object (class/function names \u2192 line arrays)\n 2. AI agent uses virtual-file-editor-tool to make edits\n 3. File state persists across tool calls via config\n 4. Returns edited files in the same object format\n \n Use cases:\n - Refactoring code based on natural language instructions\n - Making systematic changes across multiple classes/functions\n - Applying code transformations iteratively\n ";
150
- static readonly alias = "file-editor";
151
- constructor(params: z.input<typeof FileEditorAgentParamsSchema>, context?: BubbleContext);
152
- private formatFileContent;
153
- private testValidationFunction;
154
- protected performAction(_context?: BubbleContext): Promise<FileEditorAgentResult>;
155
- }
156
- export {};
157
- //# sourceMappingURL=file-editor-agent.workflow.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-editor-agent.workflow.d.ts","sourceRoot":"","sources":["../../../src/bubbles/workflow-bubble/file-editor-agent.workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAK3D;;;;GAIG;AAEH;;GAEG;AACH,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyC/B,CAAC;AAEH;;GAEG;AACH,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;EAM/B,CAAC;AAEH,KAAK,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAC1E,KAAK,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAE1E,qBAAa,uBAAwB,SAAQ,cAAc,CACzD,qBAAqB,EACrB,qBAAqB,CACtB;IACC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAG,UAAU,CAAU;IAC3C,MAAM,CAAC,QAAQ,CAAC,UAAU,uBAAuB;IACjD,MAAM,CAAC,QAAQ,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAA+B;IACrD,MAAM,CAAC,QAAQ,CAAC,YAAY;;;;;;;;;;;;;;;;;;OAA+B;IAC3D,MAAM,CAAC,QAA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