@bubblelab/bubble-core 0.1.165 → 0.1.167

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 (106) hide show
  1. package/dist/bubble-bundle.d.ts +141 -141
  2. package/dist/bubbles/service-bubble/agi-inc.d.ts +60 -60
  3. package/dist/bubbles/service-bubble/ai-agent.d.ts +9 -10
  4. package/dist/bubbles/service-bubble/ai-agent.d.ts.map +1 -1
  5. package/dist/bubbles/service-bubble/ai-agent.js +40 -76
  6. package/dist/bubbles/service-bubble/ai-agent.js.map +1 -1
  7. package/dist/bubbles/service-bubble/airtable.d.ts +50 -50
  8. package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.d.ts +2 -2
  9. package/dist/bubbles/service-bubble/apify/actors/instagram-hashtag-scraper.d.ts +4 -4
  10. package/dist/bubbles/service-bubble/apify/actors/instagram-scraper.d.ts +12 -12
  11. package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.d.ts +2 -2
  12. package/dist/bubbles/service-bubble/apify/actors/linkedin-posts-search.d.ts +10 -10
  13. package/dist/bubbles/service-bubble/apify/actors/linkedin-profile-detail.d.ts +54 -54
  14. package/dist/bubbles/service-bubble/apify/actors/linkedin-profile-posts.d.ts +22 -22
  15. package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.d.ts +12 -12
  16. package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.d.ts +28 -28
  17. package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.d.ts +12 -12
  18. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.d.ts +144 -144
  19. package/dist/bubbles/service-bubble/apify/apify.d.ts +12 -12
  20. package/dist/bubbles/service-bubble/ashby/ashby.d.ts +62 -62
  21. package/dist/bubbles/service-bubble/ashby/ashby.schema.d.ts +84 -84
  22. package/dist/bubbles/service-bubble/browserbase/browserbase.d.ts +28 -28
  23. package/dist/bubbles/service-bubble/browserbase/browserbase.schema.d.ts +30 -30
  24. package/dist/bubbles/service-bubble/confluence/confluence.d.ts +24 -24
  25. package/dist/bubbles/service-bubble/confluence/confluence.schema.d.ts +24 -24
  26. package/dist/bubbles/service-bubble/crustdata/crustdata.d.ts +126 -126
  27. package/dist/bubbles/service-bubble/crustdata/crustdata.schema.d.ts +158 -158
  28. package/dist/bubbles/service-bubble/eleven-labs.d.ts +28 -28
  29. package/dist/bubbles/service-bubble/firecrawl.d.ts +628 -628
  30. package/dist/bubbles/service-bubble/followupboss.d.ts +140 -140
  31. package/dist/bubbles/service-bubble/fullenrich/fullenrich.d.ts +68 -68
  32. package/dist/bubbles/service-bubble/fullenrich/fullenrich.schema.d.ts +108 -108
  33. package/dist/bubbles/service-bubble/github.d.ts +104 -104
  34. package/dist/bubbles/service-bubble/gmail.d.ts +92 -92
  35. package/dist/bubbles/service-bubble/google-calendar.d.ts +138 -138
  36. package/dist/bubbles/service-bubble/google-drive.d.ts +60 -60
  37. package/dist/bubbles/service-bubble/google-sheets/google-sheets.d.ts +44 -44
  38. package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.d.ts +48 -48
  39. package/dist/bubbles/service-bubble/hello-world.d.ts +8 -8
  40. package/dist/bubbles/service-bubble/http.d.ts +16 -16
  41. package/dist/bubbles/service-bubble/insforge-db.d.ts +8 -8
  42. package/dist/bubbles/service-bubble/jira/jira.d.ts +86 -86
  43. package/dist/bubbles/service-bubble/jira/jira.schema.d.ts +94 -94
  44. package/dist/bubbles/service-bubble/notion/notion.d.ts +534 -534
  45. package/dist/bubbles/service-bubble/notion/property-schemas.d.ts +8 -8
  46. package/dist/bubbles/service-bubble/postgresql.d.ts +10 -10
  47. package/dist/bubbles/service-bubble/posthog/posthog.d.ts +22 -22
  48. package/dist/bubbles/service-bubble/posthog/posthog.schema.d.ts +26 -26
  49. package/dist/bubbles/service-bubble/resend.d.ts +32 -32
  50. package/dist/bubbles/service-bubble/sendsafely/sendsafely.d.ts +10 -10
  51. package/dist/bubbles/service-bubble/sendsafely/sendsafely.schema.d.ts +12 -12
  52. package/dist/bubbles/service-bubble/slack/slack.d.ts +316 -316
  53. package/dist/bubbles/service-bubble/storage.d.ts +20 -20
  54. package/dist/bubbles/service-bubble/stripe/stripe.d.ts +125 -125
  55. package/dist/bubbles/service-bubble/stripe/stripe.schema.d.ts +143 -143
  56. package/dist/bubbles/service-bubble/telegram.d.ts +1562 -1562
  57. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.d.ts +13 -13
  58. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.schema.d.ts +13 -13
  59. package/dist/bubbles/tool-bubble/browser-tools/_shared/schema.d.ts +2 -2
  60. package/dist/bubbles/tool-bubble/browser-tools/linkedin-accept-invitations/schema.d.ts +2 -2
  61. package/dist/bubbles/tool-bubble/browser-tools/linkedin-accept-invitations/tool.d.ts +2 -2
  62. package/dist/bubbles/tool-bubble/browser-tools/linkedin-connection/schema.d.ts +2 -2
  63. package/dist/bubbles/tool-bubble/browser-tools/linkedin-connection/tool.d.ts +2 -2
  64. package/dist/bubbles/tool-bubble/browser-tools/linkedin-received-invitations/schema.d.ts +2 -2
  65. package/dist/bubbles/tool-bubble/browser-tools/linkedin-received-invitations/tool.d.ts +2 -2
  66. package/dist/bubbles/tool-bubble/browser-tools/linkedin-sent-invitations/schema.d.ts +2 -2
  67. package/dist/bubbles/tool-bubble/browser-tools/linkedin-sent-invitations/tool.d.ts +2 -2
  68. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts +16 -16
  69. package/dist/bubbles/tool-bubble/chart-js-tool.d.ts +26 -26
  70. package/dist/bubbles/tool-bubble/code-edit-tool.d.ts +36 -97
  71. package/dist/bubbles/tool-bubble/code-edit-tool.d.ts.map +1 -1
  72. package/dist/bubbles/tool-bubble/code-edit-tool.js +79 -202
  73. package/dist/bubbles/tool-bubble/code-edit-tool.js.map +1 -1
  74. package/dist/bubbles/tool-bubble/company-enrichment-tool.d.ts +22 -22
  75. package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts +4 -4
  76. package/dist/bubbles/tool-bubble/get-trigger-detail-tool.d.ts +4 -4
  77. package/dist/bubbles/tool-bubble/google-maps-tool.d.ts +4 -4
  78. package/dist/bubbles/tool-bubble/instagram-tool.d.ts +14 -14
  79. package/dist/bubbles/tool-bubble/linkedin-tool.d.ts +212 -212
  80. package/dist/bubbles/tool-bubble/list-airtable-bases-tool.d.ts +4 -4
  81. package/dist/bubbles/tool-bubble/list-airtable-tables-tool.d.ts +4 -4
  82. package/dist/bubbles/tool-bubble/list-bubbles-tool.d.ts +4 -4
  83. package/dist/bubbles/tool-bubble/list-capabilities-tool.d.ts +4 -4
  84. package/dist/bubbles/tool-bubble/people-search-tool.d.ts +14 -14
  85. package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts +28 -28
  86. package/dist/bubbles/tool-bubble/research-agent-tool.d.ts +8 -8
  87. package/dist/bubbles/tool-bubble/sql-query-tool.d.ts +8 -8
  88. package/dist/bubbles/tool-bubble/tiktok-tool.d.ts +36 -36
  89. package/dist/bubbles/tool-bubble/tool-template.d.ts +4 -4
  90. package/dist/bubbles/tool-bubble/twitter-tool.d.ts +64 -64
  91. package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts +22 -22
  92. package/dist/bubbles/tool-bubble/web-extract-tool.d.ts +8 -8
  93. package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts +8 -8
  94. package/dist/bubbles/tool-bubble/web-search-tool.d.ts +8 -8
  95. package/dist/bubbles/tool-bubble/yc-scraper-tool.d.ts +22 -22
  96. package/dist/bubbles/tool-bubble/youtube-tool.d.ts +28 -28
  97. package/dist/bubbles/workflow-bubble/database-analyzer.workflow.d.ts +4 -4
  98. package/dist/bubbles/workflow-bubble/generate-document.workflow.d.ts +28 -28
  99. package/dist/bubbles/workflow-bubble/parse-document.workflow.d.ts +8 -8
  100. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts +72 -72
  101. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts +32 -32
  102. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts +30 -30
  103. package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts +90 -90
  104. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts +8 -8
  105. package/dist/bubbles.json +16 -51
  106. package/package.json +2 -2
@@ -1,43 +1,38 @@
1
1
  /**
2
2
  * EDIT BUBBLEFLOW TOOL
3
3
  *
4
- * A tool bubble that applies code edits to BubbleFlow files using Morph Fast Apply.
5
- * This tool uses the Morph API via OpenRouter to intelligently merge code changes
6
- * specified by an AI agent into existing BubbleFlow code, following the Fast Apply
7
- * pattern used in Cursor.
4
+ * A tool bubble that applies code edits to BubbleFlow files using find-and-replace.
5
+ * This tool performs simple string replacement matching Claude Code's Edit tool behavior.
8
6
  *
9
7
  * Features:
10
- * - Intelligent code merging using Morph Fast Apply model
11
- * - Support for lazy edits with "// ... existing code ..." markers
12
- * - Minimal context repetition for efficient edits
13
- * - Automatic validation after edits
14
- * - Detailed diff reporting
8
+ * - Exact string find-and-replace
9
+ * - Uniqueness validation (prevents ambiguous edits)
10
+ * - Replace-all mode for renaming variables/strings
11
+ * - No external API calls required
15
12
  */
16
13
  import { z } from 'zod';
17
14
  import { ToolBubble } from '../../types/tool-bubble-class.js';
18
- import { CredentialType } from '@bubblelab/shared-schemas';
19
- import { HttpBubble } from '../service-bubble/http.js';
20
15
  /**
21
16
  * Define the parameters schema using Zod
22
17
  * This schema validates and types the input parameters for the edit tool
23
18
  */
24
19
  const EditBubbleFlowToolParamsSchema = z.object({
25
- // The original BubbleFlow code
26
- initialCode: z.string().describe('The original code to be edited'),
27
- // The edit instructions
28
- instructions: z
20
+ // The current code to apply the edit to
21
+ initialCode: z.string().describe('The current code to apply the edit to'),
22
+ // The exact text to replace
23
+ old_string: z
29
24
  .string()
30
- .describe('A single sentence instruction in first person describing what changes are being made (e.g., "I am adding error handling to the user auth and removing the old auth functions"). Used to help disambiguate uncertainty in the edit.'),
31
- // The code edit with markers
32
- codeEdit: z
25
+ .describe('The exact text to replace. Must be unique in the code if not unique, provide more surrounding context to disambiguate.'),
26
+ // The replacement text
27
+ new_string: z
33
28
  .string()
34
- .describe('The code changes to apply. Specify ONLY the precise lines of code that you wish to edit. Use "// ... existing code ..." to represent unchanged sections. DO NOT omit spans of pre-existing code without using the marker, as this may cause inadvertent deletion.'),
35
- // Optional Morph model configuration
36
- morphModel: z
37
- .string()
38
- .default('morph/morph-v3-large')
29
+ .describe('The replacement text. Must be different from old_string.'),
30
+ // Whether to replace all occurrences
31
+ replace_all: z
32
+ .boolean()
33
+ .default(false)
39
34
  .optional()
40
- .describe('Morph model to use for applying edits via OpenRouter'),
35
+ .describe('Replace all occurrences of old_string (default false). Use for renaming variables/strings across the file.'),
41
36
  // Credentials (injected at runtime)
42
37
  credentials: z
43
38
  .record(z.string(), z.string())
@@ -58,27 +53,13 @@ const EditBubbleFlowToolResultSchema = z.object({
58
53
  mergedCode: z.string().describe('The final code after applying edits'),
59
54
  // Success indicator
60
55
  applied: z.boolean().describe('Whether the edit was successfully applied'),
61
- // Optional diff information
62
- diff: z
63
- .string()
64
- .optional()
65
- .describe('Unified diff showing the changes made (if available)'),
66
- // Metadata
67
- metadata: z.object({
68
- editedAt: z.string().describe('Timestamp when edit was performed'),
69
- originalLength: z
70
- .number()
71
- .describe('Length of original code in characters'),
72
- finalLength: z.number().describe('Length of final code in characters'),
73
- morphModel: z.string().describe('Morph model used for the edit'),
74
- }),
75
56
  // Standard result fields
76
57
  success: z.boolean().describe('Whether the edit operation was successful'),
77
58
  error: z.string().describe('Error message if edit failed'),
78
59
  });
79
60
  /**
80
61
  * Edit BubbleFlow Tool
81
- * Applies code edits using Morph Fast Apply API via AIAgent
62
+ * Applies code edits using find-and-replace
82
63
  */
83
64
  export class EditBubbleFlowTool extends ToolBubble {
84
65
  /**
@@ -92,226 +73,122 @@ export class EditBubbleFlowTool extends ToolBubble {
92
73
  static schema = EditBubbleFlowToolParamsSchema;
93
74
  static resultSchema = EditBubbleFlowToolResultSchema;
94
75
  // Short description
95
- static shortDescription = 'Applies code edits to BubbleFlow files using Morph Fast Apply';
76
+ static shortDescription = 'Applies code edits to BubbleFlow files using find-and-replace';
96
77
  // Long description with detailed information
97
78
  static longDescription = `
98
- A tool for intelligently applying code edits to BubbleFlow TypeScript files.
99
- Uses the Morph Fast Apply API via OpenRouter to merge lazy code edits into existing code.
79
+ A tool for applying code edits to BubbleFlow TypeScript files using find-and-replace.
100
80
 
101
81
  What it does:
102
- - Merges code edits specified with "// ... existing code ..." markers
103
- - Uses Morph's apply model for intelligent code merging
104
- - Minimizes context repetition for efficient edits
105
- - Returns the final merged code
82
+ - Finds exact text matches in code and replaces them
83
+ - Validates uniqueness to prevent ambiguous edits
84
+ - Supports replace-all mode for renaming variables/strings
85
+ - No external API calls required
106
86
 
107
87
  How it works:
108
- - Takes original code, edit instructions, and code edit as input
109
- - Sends to Morph API via OpenRouter using HttpBubble
110
- - Receives merged code from Morph's apply model
111
- - Returns the final code ready to be written to file
88
+ - Takes the current code, old_string (text to find), and new_string (replacement)
89
+ - Validates that old_string exists and is unique (unless replace_all is true)
90
+ - Performs the replacement and returns the updated code
112
91
 
113
92
  Use cases:
114
93
  - When an AI agent needs to make edits to BubbleFlow code
115
- - When applying multiple distinct edits to a file at once
116
94
  - When making targeted changes without rewriting entire files
117
- - When following the Cursor Fast Apply pattern for code edits
95
+ - When renaming variables or strings across a file
118
96
 
119
97
  Important:
120
- - The codeEdit parameter should use "// ... existing code ..." to mark unchanged sections
121
- - The instructions parameter should be generated by the model in first person
122
- - Requires OPENROUTER_CRED credential for Morph API access via OpenRouter
98
+ - old_string must be an exact match of text in the code
99
+ - If old_string appears multiple times, provide more context or use replace_all
100
+ - new_string must be different from old_string
123
101
  `;
124
102
  // Short alias for the tool
125
103
  static alias = 'code-edit';
126
104
  /**
127
- * Main action method - performs code edit merging
105
+ * Count occurrences of a substring in a string
106
+ */
107
+ countOccurrences(str, substr) {
108
+ let count = 0;
109
+ let pos = 0;
110
+ while ((pos = str.indexOf(substr, pos)) !== -1) {
111
+ count++;
112
+ pos += substr.length;
113
+ }
114
+ return count;
115
+ }
116
+ /**
117
+ * Main action method - performs find-and-replace code editing
128
118
  */
129
119
  async performAction() {
130
120
  try {
131
- // Extract parameters
132
- const { initialCode, instructions, codeEdit, morphModel } = this.params;
133
- // Validate inputs
121
+ const { initialCode, old_string, new_string, replace_all } = this.params;
122
+ // Validate initialCode is not empty
134
123
  if (!initialCode || initialCode.trim().length === 0) {
135
124
  return {
136
125
  mergedCode: '',
137
126
  applied: false,
138
- metadata: {
139
- editedAt: new Date().toISOString(),
140
- originalLength: 0,
141
- finalLength: 0,
142
- morphModel: morphModel ?? 'morph/morph-v3-large',
143
- },
144
127
  success: false,
145
128
  error: 'Initial code cannot be empty',
146
129
  };
147
130
  }
148
- if (!instructions || instructions.trim().length === 0) {
131
+ // Validate old_string is not empty
132
+ if (!old_string || old_string.length === 0) {
149
133
  return {
150
134
  mergedCode: initialCode,
151
135
  applied: false,
152
- metadata: {
153
- editedAt: new Date().toISOString(),
154
- originalLength: initialCode.length,
155
- finalLength: initialCode.length,
156
- morphModel: morphModel ?? 'morph/morph-v3-large',
157
- },
158
136
  success: false,
159
- error: 'Instructions cannot be empty',
137
+ error: 'old_string cannot be empty',
160
138
  };
161
139
  }
162
- if (!codeEdit || codeEdit.trim().length === 0) {
140
+ // Validate old_string !== new_string
141
+ if (old_string === new_string) {
163
142
  return {
164
143
  mergedCode: initialCode,
165
144
  applied: false,
166
- metadata: {
167
- editedAt: new Date().toISOString(),
168
- originalLength: initialCode.length,
169
- finalLength: initialCode.length,
170
- morphModel: morphModel ?? 'morph/morph-v3-large',
171
- },
172
145
  success: false,
173
- error: 'Code edit cannot be empty',
146
+ error: 'new_string must be different from old_string',
174
147
  };
175
148
  }
176
- // Get OpenRouter API key from credentials
177
- const apiKey = this.params.credentials?.[CredentialType.OPENROUTER_CRED];
178
- if (!apiKey) {
149
+ // Check old_string exists in initialCode
150
+ if (!initialCode.includes(old_string)) {
179
151
  return {
180
152
  mergedCode: initialCode,
181
153
  applied: false,
182
- metadata: {
183
- editedAt: new Date().toISOString(),
184
- originalLength: initialCode.length,
185
- finalLength: initialCode.length,
186
- morphModel: morphModel ?? 'morph/morph-v3-large',
187
- },
188
154
  success: false,
189
- error: 'OpenRouter API key not found. Please provide OPENROUTER_CRED credential.',
155
+ error: 'old_string not found in code',
190
156
  };
191
157
  }
192
- // Construct the message for Morph API following the recommended format
193
- const morphPrompt = `<instruction>${instructions}</instruction>\n<code>${initialCode}</code>\n<update>${codeEdit}</update>`;
194
- // Use HttpBubble to call OpenRouter API
195
- const httpBubble = new HttpBubble({
196
- url: 'https://openrouter.ai/api/v1/chat/completions',
197
- method: 'POST',
198
- headers: {
199
- Authorization: `Bearer ${apiKey}`,
200
- 'Content-Type': 'application/json',
201
- },
202
- body: {
203
- model: 'morph/morph-v3-large',
204
- messages: [
205
- {
206
- role: 'user',
207
- content: morphPrompt,
208
- },
209
- ],
210
- },
211
- timeout: 60000, // 60 second timeout for code generation
212
- }, this.context);
213
- // Execute the HTTP request
214
- const result = await httpBubble.action();
215
- if (!result.success || !result.data?.json) {
216
- return {
217
- mergedCode: initialCode,
218
- applied: false,
219
- metadata: {
220
- editedAt: new Date().toISOString(),
221
- originalLength: initialCode.length,
222
- finalLength: initialCode.length,
223
- morphModel: morphModel ?? 'morph/morph-v3-large',
224
- },
225
- success: false,
226
- error: result.error || 'Morph API returned empty response',
227
- };
228
- }
229
- const responseData = result.data.json;
230
- // Extract token usage - OpenRouter uses 'usage' field (OpenAI format)
231
- // Fallback to usage_metadata if present (some providers use this)
232
- let inputTokens = 0;
233
- let outputTokens = 0;
234
- let totalTokens = 0;
235
- if (responseData.usage) {
236
- // OpenAI format: usage.prompt_tokens, usage.completion_tokens
237
- inputTokens = responseData.usage.prompt_tokens ?? 0;
238
- outputTokens = responseData.usage.completion_tokens ?? 0;
239
- totalTokens = responseData.usage.total_tokens ?? 0;
240
- }
241
- else if (responseData.usage_metadata) {
242
- // Alternative format: usage_metadata.input_tokens, usage_metadata.output_tokens
243
- inputTokens = responseData.usage_metadata.input_tokens ?? 0;
244
- outputTokens = responseData.usage_metadata.output_tokens ?? 0;
245
- totalTokens = responseData.usage_metadata.total_tokens ?? 0;
246
- }
247
- const tokenUsage = {
248
- inputTokens,
249
- outputTokens,
250
- totalTokens,
251
- modelName: morphModel ?? 'morph/morph-v3-large',
252
- };
253
- if (this.context?.logger) {
254
- this.context.logger.logTokenUsage({
255
- usage: tokenUsage.inputTokens,
256
- service: CredentialType.OPENROUTER_CRED,
257
- unit: 'input_tokens',
258
- subService: morphModel ?? 'morph/morph-v3-large',
259
- }, `LLM completion: ${tokenUsage.inputTokens} input`, {
260
- bubbleName: 'code-edit-tool',
261
- variableId: this.context?.variableId,
262
- operationType: 'bubble_execution',
263
- });
264
- this.context.logger.logTokenUsage({
265
- usage: tokenUsage.outputTokens,
266
- service: CredentialType.OPENROUTER_CRED,
267
- unit: 'output_tokens',
268
- subService: morphModel ?? 'morph/morph-v3-large',
269
- }, `LLM completion: ${tokenUsage.outputTokens} output`, {
270
- bubbleName: 'code-edit-tool',
271
- variableId: this.context?.variableId,
272
- operationType: 'bubble_execution',
273
- });
158
+ let result;
159
+ if (replace_all) {
160
+ // Replace ALL occurrences
161
+ result = initialCode.replaceAll(old_string, new_string);
274
162
  }
275
- const mergedCode = responseData.choices?.[0]?.message?.content;
276
- if (!mergedCode) {
277
- return {
278
- mergedCode: initialCode,
279
- applied: false,
280
- metadata: {
281
- editedAt: new Date().toISOString(),
282
- originalLength: initialCode.length,
283
- finalLength: initialCode.length,
284
- morphModel: morphModel ?? 'morph/morph-v3-large',
285
- },
286
- success: false,
287
- error: 'Morph API returned empty content',
288
- };
163
+ else {
164
+ // Check uniqueness
165
+ const count = this.countOccurrences(initialCode, old_string);
166
+ if (count > 1) {
167
+ return {
168
+ mergedCode: initialCode,
169
+ applied: false,
170
+ success: false,
171
+ error: 'old_string is not unique in the code. Provide a larger string with more surrounding context to make it unique, or use replace_all to change every instance.',
172
+ };
173
+ }
174
+ // Replace the single occurrence
175
+ const index = initialCode.indexOf(old_string);
176
+ result =
177
+ initialCode.slice(0, index) +
178
+ new_string +
179
+ initialCode.slice(index + old_string.length);
289
180
  }
290
- // Return successful result
291
181
  return {
292
- mergedCode,
182
+ mergedCode: result,
293
183
  applied: true,
294
- metadata: {
295
- editedAt: new Date().toISOString(),
296
- originalLength: initialCode.length,
297
- finalLength: mergedCode.length,
298
- morphModel: morphModel ?? 'openrouter/morph/morph-v3-large',
299
- },
300
184
  success: true,
301
185
  error: '',
302
186
  };
303
187
  }
304
188
  catch (error) {
305
- // Handle unexpected errors gracefully
306
189
  return {
307
190
  mergedCode: this.params.initialCode || '',
308
191
  applied: false,
309
- metadata: {
310
- editedAt: new Date().toISOString(),
311
- originalLength: this.params.initialCode?.length || 0,
312
- finalLength: this.params.initialCode?.length || 0,
313
- morphModel: this.params.morphModel ?? 'openrouter/morph/morph-v3-large',
314
- },
315
192
  success: false,
316
193
  error: error instanceof Error ? error.message : 'Unknown error occurred',
317
194
  };
@@ -1 +1 @@
1
- {"version":3,"file":"code-edit-tool.js","sourceRoot":"","sources":["../../../src/bubbles/tool-bubble/code-edit-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD;;;GAGG;AACH,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,+BAA+B;IAC/B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;IAElE,wB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;gBACL,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE;gBACzC,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,KAAK;gBACd,KAAK,EACH,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB;aACpE,CAAC;QACJ,CAAC;IACH,CAAC"}
@@ -66,8 +66,8 @@ declare const ContactSchema: z.ZodObject<{
66
66
  }, "strip", z.ZodTypeAny, {
67
67
  title: string | null;
68
68
  name: string | null;
69
- summary: string | null;
70
69
  role: "cxo" | "decision_maker" | "founder";
70
+ summary: string | null;
71
71
  location: string | null;
72
72
  headline: string | null;
73
73
  linkedinUrl: string | null;
@@ -97,8 +97,8 @@ declare const ContactSchema: z.ZodObject<{
97
97
  }, {
98
98
  title: string | null;
99
99
  name: string | null;
100
- summary: string | null;
101
100
  role: "cxo" | "decision_maker" | "founder";
101
+ summary: string | null;
102
102
  location: string | null;
103
103
  headline: string | null;
104
104
  linkedinUrl: string | null;
@@ -204,8 +204,8 @@ declare const CompanyEnrichmentToolResultSchema: z.ZodObject<{
204
204
  }, "strip", z.ZodTypeAny, {
205
205
  title: string | null;
206
206
  name: string | null;
207
- summary: string | null;
208
207
  role: "cxo" | "decision_maker" | "founder";
208
+ summary: string | null;
209
209
  location: string | null;
210
210
  headline: string | null;
211
211
  linkedinUrl: string | null;
@@ -235,8 +235,8 @@ declare const CompanyEnrichmentToolResultSchema: z.ZodObject<{
235
235
  }, {
236
236
  title: string | null;
237
237
  name: string | null;
238
- summary: string | null;
239
238
  role: "cxo" | "decision_maker" | "founder";
239
+ summary: string | null;
240
240
  location: string | null;
241
241
  headline: string | null;
242
242
  linkedinUrl: string | null;
@@ -281,8 +281,8 @@ declare const CompanyEnrichmentToolResultSchema: z.ZodObject<{
281
281
  name: string | null;
282
282
  linkedinUrl: string | null;
283
283
  website: string | null;
284
- industry: string | null;
285
284
  headcount: number | null;
285
+ industry: string | null;
286
286
  hqCity: string | null;
287
287
  hqCountry: string | null;
288
288
  yearFounded: number | null;
@@ -293,8 +293,8 @@ declare const CompanyEnrichmentToolResultSchema: z.ZodObject<{
293
293
  name: string | null;
294
294
  linkedinUrl: string | null;
295
295
  website: string | null;
296
- industry: string | null;
297
296
  headcount: number | null;
297
+ industry: string | null;
298
298
  hqCity: string | null;
299
299
  hqCountry: string | null;
300
300
  yearFounded: number | null;
@@ -305,15 +305,15 @@ declare const CompanyEnrichmentToolResultSchema: z.ZodObject<{
305
305
  success: z.ZodBoolean;
306
306
  error: z.ZodString;
307
307
  }, "strip", z.ZodTypeAny, {
308
- error: string;
309
308
  success: boolean;
309
+ error: string;
310
310
  company: {
311
311
  description: string | null;
312
312
  name: string | null;
313
313
  linkedinUrl: string | null;
314
314
  website: string | null;
315
- industry: string | null;
316
315
  headcount: number | null;
316
+ industry: string | null;
317
317
  hqCity: string | null;
318
318
  hqCountry: string | null;
319
319
  yearFounded: number | null;
@@ -323,8 +323,8 @@ declare const CompanyEnrichmentToolResultSchema: z.ZodObject<{
323
323
  contacts: {
324
324
  title: string | null;
325
325
  name: string | null;
326
- summary: string | null;
327
326
  role: "cxo" | "decision_maker" | "founder";
327
+ summary: string | null;
328
328
  location: string | null;
329
329
  headline: string | null;
330
330
  linkedinUrl: string | null;
@@ -354,15 +354,15 @@ declare const CompanyEnrichmentToolResultSchema: z.ZodObject<{
354
354
  }[];
355
355
  totalContacts: number;
356
356
  }, {
357
- error: string;
358
357
  success: boolean;
358
+ error: string;
359
359
  company: {
360
360
  description: string | null;
361
361
  name: string | null;
362
362
  linkedinUrl: string | null;
363
363
  website: string | null;
364
- industry: string | null;
365
364
  headcount: number | null;
365
+ industry: string | null;
366
366
  hqCity: string | null;
367
367
  hqCountry: string | null;
368
368
  yearFounded: number | null;
@@ -372,8 +372,8 @@ declare const CompanyEnrichmentToolResultSchema: z.ZodObject<{
372
372
  contacts: {
373
373
  title: string | null;
374
374
  name: string | null;
375
- summary: string | null;
376
375
  role: "cxo" | "decision_maker" | "founder";
376
+ summary: string | null;
377
377
  location: string | null;
378
378
  headline: string | null;
379
379
  linkedinUrl: string | null;
@@ -505,8 +505,8 @@ export declare class CompanyEnrichmentTool extends ToolBubble<CompanyEnrichmentT
505
505
  }, "strip", z.ZodTypeAny, {
506
506
  title: string | null;
507
507
  name: string | null;
508
- summary: string | null;
509
508
  role: "cxo" | "decision_maker" | "founder";
509
+ summary: string | null;
510
510
  location: string | null;
511
511
  headline: string | null;
512
512
  linkedinUrl: string | null;
@@ -536,8 +536,8 @@ export declare class CompanyEnrichmentTool extends ToolBubble<CompanyEnrichmentT
536
536
  }, {
537
537
  title: string | null;
538
538
  name: string | null;
539
- summary: string | null;
540
539
  role: "cxo" | "decision_maker" | "founder";
540
+ summary: string | null;
541
541
  location: string | null;
542
542
  headline: string | null;
543
543
  linkedinUrl: string | null;
@@ -582,8 +582,8 @@ export declare class CompanyEnrichmentTool extends ToolBubble<CompanyEnrichmentT
582
582
  name: string | null;
583
583
  linkedinUrl: string | null;
584
584
  website: string | null;
585
- industry: string | null;
586
585
  headcount: number | null;
586
+ industry: string | null;
587
587
  hqCity: string | null;
588
588
  hqCountry: string | null;
589
589
  yearFounded: number | null;
@@ -594,8 +594,8 @@ export declare class CompanyEnrichmentTool extends ToolBubble<CompanyEnrichmentT
594
594
  name: string | null;
595
595
  linkedinUrl: string | null;
596
596
  website: string | null;
597
- industry: string | null;
598
597
  headcount: number | null;
598
+ industry: string | null;
599
599
  hqCity: string | null;
600
600
  hqCountry: string | null;
601
601
  yearFounded: number | null;
@@ -606,15 +606,15 @@ export declare class CompanyEnrichmentTool extends ToolBubble<CompanyEnrichmentT
606
606
  success: z.ZodBoolean;
607
607
  error: z.ZodString;
608
608
  }, "strip", z.ZodTypeAny, {
609
- error: string;
610
609
  success: boolean;
610
+ error: string;
611
611
  company: {
612
612
  description: string | null;
613
613
  name: string | null;
614
614
  linkedinUrl: string | null;
615
615
  website: string | null;
616
- industry: string | null;
617
616
  headcount: number | null;
617
+ industry: string | null;
618
618
  hqCity: string | null;
619
619
  hqCountry: string | null;
620
620
  yearFounded: number | null;
@@ -624,8 +624,8 @@ export declare class CompanyEnrichmentTool extends ToolBubble<CompanyEnrichmentT
624
624
  contacts: {
625
625
  title: string | null;
626
626
  name: string | null;
627
- summary: string | null;
628
627
  role: "cxo" | "decision_maker" | "founder";
628
+ summary: string | null;
629
629
  location: string | null;
630
630
  headline: string | null;
631
631
  linkedinUrl: string | null;
@@ -655,15 +655,15 @@ export declare class CompanyEnrichmentTool extends ToolBubble<CompanyEnrichmentT
655
655
  }[];
656
656
  totalContacts: number;
657
657
  }, {
658
- error: string;
659
658
  success: boolean;
659
+ error: string;
660
660
  company: {
661
661
  description: string | null;
662
662
  name: string | null;
663
663
  linkedinUrl: string | null;
664
664
  website: string | null;
665
- industry: string | null;
666
665
  headcount: number | null;
666
+ industry: string | null;
667
667
  hqCity: string | null;
668
668
  hqCountry: string | null;
669
669
  yearFounded: number | null;
@@ -673,8 +673,8 @@ export declare class CompanyEnrichmentTool extends ToolBubble<CompanyEnrichmentT
673
673
  contacts: {
674
674
  title: string | null;
675
675
  name: string | null;
676
- summary: string | null;
677
676
  role: "cxo" | "decision_maker" | "founder";
677
+ summary: string | null;
678
678
  location: string | null;
679
679
  headline: string | null;
680
680
  linkedinUrl: string | null;