@bubblelab/bubble-core 0.1.172 → 0.1.173

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 (108) hide show
  1. package/dist/bubble-bundle.d.ts +146 -146
  2. package/dist/bubbles/service-bubble/agi-inc.d.ts +80 -80
  3. package/dist/bubbles/service-bubble/ai-agent.d.ts +76 -74
  4. package/dist/bubbles/service-bubble/ai-agent.d.ts.map +1 -1
  5. package/dist/bubbles/service-bubble/ai-agent.js +18 -1
  6. package/dist/bubbles/service-bubble/ai-agent.js.map +1 -1
  7. package/dist/bubbles/service-bubble/airtable.d.ts +102 -102
  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 +6 -6
  10. package/dist/bubbles/service-bubble/apify/actors/instagram-scraper.d.ts +20 -20
  11. package/dist/bubbles/service-bubble/apify/actors/linkedin-posts-search.d.ts +26 -26
  12. package/dist/bubbles/service-bubble/apify/actors/linkedin-profile-detail.d.ts +90 -90
  13. package/dist/bubbles/service-bubble/apify/actors/linkedin-profile-posts.d.ts +70 -70
  14. package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.d.ts +16 -16
  15. package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.d.ts +37 -37
  16. package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.d.ts +16 -16
  17. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.d.ts +243 -243
  18. package/dist/bubbles/service-bubble/apify/apify.d.ts +30 -30
  19. package/dist/bubbles/service-bubble/ashby/ashby.d.ts +64 -64
  20. package/dist/bubbles/service-bubble/ashby/ashby.schema.d.ts +86 -86
  21. package/dist/bubbles/service-bubble/browserbase/browserbase.d.ts +29 -29
  22. package/dist/bubbles/service-bubble/browserbase/browserbase.schema.d.ts +31 -31
  23. package/dist/bubbles/service-bubble/confluence/confluence.d.ts +24 -24
  24. package/dist/bubbles/service-bubble/confluence/confluence.schema.d.ts +24 -24
  25. package/dist/bubbles/service-bubble/crustdata/crustdata.d.ts +126 -126
  26. package/dist/bubbles/service-bubble/crustdata/crustdata.schema.d.ts +158 -158
  27. package/dist/bubbles/service-bubble/eleven-labs.d.ts +28 -28
  28. package/dist/bubbles/service-bubble/firecrawl.d.ts +1003 -1003
  29. package/dist/bubbles/service-bubble/followupboss.d.ts +144 -144
  30. package/dist/bubbles/service-bubble/fullenrich/fullenrich.d.ts +68 -68
  31. package/dist/bubbles/service-bubble/fullenrich/fullenrich.schema.d.ts +108 -108
  32. package/dist/bubbles/service-bubble/github.d.ts +136 -136
  33. package/dist/bubbles/service-bubble/gmail.d.ts +240 -240
  34. package/dist/bubbles/service-bubble/google-calendar.d.ts +138 -138
  35. package/dist/bubbles/service-bubble/google-drive.d.ts +52 -52
  36. package/dist/bubbles/service-bubble/google-sheets/google-sheets.d.ts +44 -44
  37. package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.d.ts +48 -48
  38. package/dist/bubbles/service-bubble/hello-world.d.ts +8 -8
  39. package/dist/bubbles/service-bubble/http.d.ts +18 -18
  40. package/dist/bubbles/service-bubble/insforge-db.d.ts +16 -16
  41. package/dist/bubbles/service-bubble/jira/jira.d.ts +60 -60
  42. package/dist/bubbles/service-bubble/jira/jira.schema.d.ts +62 -62
  43. package/dist/bubbles/service-bubble/linear/linear.d.ts +32 -32
  44. package/dist/bubbles/service-bubble/linear/linear.schema.d.ts +32 -32
  45. package/dist/bubbles/service-bubble/notion/notion.d.ts +682 -682
  46. package/dist/bubbles/service-bubble/notion/property-schemas.d.ts +16 -16
  47. package/dist/bubbles/service-bubble/postgresql.d.ts +16 -16
  48. package/dist/bubbles/service-bubble/posthog/posthog.d.ts +24 -24
  49. package/dist/bubbles/service-bubble/posthog/posthog.schema.d.ts +30 -30
  50. package/dist/bubbles/service-bubble/resend.d.ts +28 -28
  51. package/dist/bubbles/service-bubble/sendsafely/sendsafely.d.ts +10 -10
  52. package/dist/bubbles/service-bubble/sendsafely/sendsafely.schema.d.ts +12 -12
  53. package/dist/bubbles/service-bubble/slack/slack.d.ts +558 -558
  54. package/dist/bubbles/service-bubble/storage.d.ts +20 -20
  55. package/dist/bubbles/service-bubble/stripe/stripe.d.ts +149 -149
  56. package/dist/bubbles/service-bubble/stripe/stripe.schema.d.ts +171 -171
  57. package/dist/bubbles/service-bubble/telegram.d.ts +1562 -1562
  58. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.d.ts +19 -19
  59. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.schema.d.ts +21 -21
  60. package/dist/bubbles/tool-bubble/browser-tools/_shared/schema.d.ts +2 -2
  61. package/dist/bubbles/tool-bubble/browser-tools/linkedin-accept-invitations/schema.d.ts +2 -2
  62. package/dist/bubbles/tool-bubble/browser-tools/linkedin-accept-invitations/tool.d.ts +2 -2
  63. package/dist/bubbles/tool-bubble/browser-tools/linkedin-connection/schema.d.ts +2 -2
  64. package/dist/bubbles/tool-bubble/browser-tools/linkedin-connection/tool.d.ts +2 -2
  65. package/dist/bubbles/tool-bubble/browser-tools/linkedin-received-invitations/schema.d.ts +2 -2
  66. package/dist/bubbles/tool-bubble/browser-tools/linkedin-received-invitations/tool.d.ts +2 -2
  67. package/dist/bubbles/tool-bubble/browser-tools/linkedin-sent-invitations/schema.d.ts +2 -2
  68. package/dist/bubbles/tool-bubble/browser-tools/linkedin-sent-invitations/tool.d.ts +2 -2
  69. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts +20 -20
  70. package/dist/bubbles/tool-bubble/chart-js-tool.d.ts +26 -26
  71. package/dist/bubbles/tool-bubble/code-edit-tool.d.ts +4 -4
  72. package/dist/bubbles/tool-bubble/company-enrichment-tool.d.ts +32 -32
  73. package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts +4 -4
  74. package/dist/bubbles/tool-bubble/get-trigger-detail-tool.d.ts +4 -4
  75. package/dist/bubbles/tool-bubble/google-maps-tool.d.ts +4 -4
  76. package/dist/bubbles/tool-bubble/instagram-tool.d.ts +14 -14
  77. package/dist/bubbles/tool-bubble/linkedin-tool.d.ts +567 -567
  78. package/dist/bubbles/tool-bubble/list-airtable-bases-tool.d.ts +4 -4
  79. package/dist/bubbles/tool-bubble/list-airtable-tables-tool.d.ts +4 -4
  80. package/dist/bubbles/tool-bubble/list-bubbles-tool.d.ts +4 -4
  81. package/dist/bubbles/tool-bubble/list-capabilities-tool.d.ts +4 -4
  82. package/dist/bubbles/tool-bubble/people-search-tool.d.ts +58 -58
  83. package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts +28 -28
  84. package/dist/bubbles/tool-bubble/research-agent-tool.d.ts +4 -4
  85. package/dist/bubbles/tool-bubble/sql-query-tool.d.ts +8 -8
  86. package/dist/bubbles/tool-bubble/tiktok-tool.d.ts +88 -88
  87. package/dist/bubbles/tool-bubble/tool-template.d.ts +4 -4
  88. package/dist/bubbles/tool-bubble/twitter-tool.d.ts +188 -188
  89. package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts +22 -22
  90. package/dist/bubbles/tool-bubble/web-extract-tool.d.ts +8 -8
  91. package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts +8 -8
  92. package/dist/bubbles/tool-bubble/web-search-tool.d.ts +8 -8
  93. package/dist/bubbles/tool-bubble/yc-scraper-tool.d.ts +26 -26
  94. package/dist/bubbles/tool-bubble/youtube-tool.d.ts +38 -38
  95. package/dist/bubbles/workflow-bubble/database-analyzer.workflow.d.ts +4 -4
  96. package/dist/bubbles/workflow-bubble/generate-document.workflow.d.ts +40 -40
  97. package/dist/bubbles/workflow-bubble/parse-document.workflow.d.ts +8 -8
  98. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts +72 -72
  99. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts +32 -32
  100. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts +32 -32
  101. package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts +104 -104
  102. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts +8 -8
  103. package/dist/bubbles.json +1 -1
  104. package/dist/utils/agent-formatter.d.ts +6 -0
  105. package/dist/utils/agent-formatter.d.ts.map +1 -1
  106. package/dist/utils/agent-formatter.js +15 -0
  107. package/dist/utils/agent-formatter.js.map +1 -1
  108. package/package.json +2 -2
@@ -43,8 +43,8 @@ declare const AIAgentParamsSchema: z.ZodObject<{
43
43
  description: z.ZodOptional<z.ZodString>;
44
44
  }, "strip", z.ZodTypeAny, {
45
45
  type: "base64";
46
- mimeType: string;
47
46
  data: string;
47
+ mimeType: string;
48
48
  description?: string | undefined;
49
49
  }, {
50
50
  data: string;
@@ -161,12 +161,12 @@ declare const AIAgentParamsSchema: z.ZodObject<{
161
161
  }, "strip", z.ZodTypeAny, {
162
162
  description: string;
163
163
  name: string;
164
- schema: Record<string, unknown> | z.ZodTypeAny;
164
+ schema: z.ZodTypeAny | Record<string, unknown>;
165
165
  func: (args_0: Record<string, unknown>, ...args: unknown[]) => Promise<unknown>;
166
166
  }, {
167
167
  description: string;
168
168
  name: string;
169
- schema: Record<string, unknown> | z.ZodTypeAny;
169
+ schema: z.ZodTypeAny | Record<string, unknown>;
170
170
  func: (args_0: Record<string, unknown>, ...args: unknown[]) => Promise<unknown>;
171
171
  }>, "many">>>;
172
172
  maxIterations: z.ZodDefault<z.ZodNumber>;
@@ -189,6 +189,17 @@ declare const AIAgentParamsSchema: z.ZodObject<{
189
189
  memoryEnabled: z.ZodDefault<z.ZodBoolean>;
190
190
  }, "strip", z.ZodTypeAny, {
191
191
  message: string;
192
+ images: ({
193
+ type: "base64";
194
+ data: string;
195
+ mimeType: string;
196
+ description?: string | undefined;
197
+ } | {
198
+ type: "url";
199
+ url: string;
200
+ description?: string | undefined;
201
+ })[];
202
+ systemPrompt: string;
192
203
  model: {
193
204
  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-sonnet-4-6" | "anthropic/claude-opus-4-5" | "anthropic/claude-opus-4-6" | "anthropic/claude-haiku-4-5" | "openrouter/x-ai/grok-code-fast-1" | "openrouter/z-ai/glm-4.6" | "openrouter/z-ai/glm-4.7" | "openrouter/anthropic/claude-sonnet-4.5" | "openrouter/anthropic/claude-opus-4.5" | "openrouter/anthropic/claude-opus-4.6" | "openrouter/google/gemini-3-pro-preview" | "openrouter/morph/morph-v3-large" | "openrouter/openai/gpt-oss-120b" | "openrouter/openai/o3-deep-research" | "openrouter/openai/o4-mini-deep-research";
194
205
  temperature: number;
@@ -205,24 +216,13 @@ declare const AIAgentParamsSchema: z.ZodObject<{
205
216
  maxRetries?: number | undefined;
206
217
  } | undefined;
207
218
  };
208
- streaming: boolean;
209
219
  tools: {
210
220
  name: "get-bubble-details-tool" | "get-trigger-detail-tool" | "list-bubbles-tool" | "list-capabilities-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" | "code-edit-tool" | "instagram-tool" | "linkedin-tool" | "tiktok-tool" | "twitter-tool" | "google-maps-tool" | "youtube-tool" | "amazon-shopping-tool" | "people-search-tool";
211
221
  credentials?: Partial<Record<CredentialType, string>> | undefined;
212
222
  config?: Record<string, unknown> | undefined;
213
223
  }[];
214
- images: ({
215
- type: "base64";
216
- mimeType: string;
217
- data: string;
218
- description?: string | undefined;
219
- } | {
220
- type: "url";
221
- url: string;
222
- description?: string | undefined;
223
- })[];
224
- systemPrompt: string;
225
224
  maxIterations: number;
225
+ streaming: boolean;
226
226
  memoryEnabled: boolean;
227
227
  name?: string | undefined;
228
228
  credentials?: Partial<Record<CredentialType, string>> | undefined;
@@ -235,7 +235,7 @@ declare const AIAgentParamsSchema: z.ZodObject<{
235
235
  customTools?: {
236
236
  description: string;
237
237
  name: string;
238
- schema: Record<string, unknown> | z.ZodTypeAny;
238
+ schema: z.ZodTypeAny | Record<string, unknown>;
239
239
  func: (args_0: Record<string, unknown>, ...args: unknown[]) => Promise<unknown>;
240
240
  }[] | undefined;
241
241
  capabilities?: {
@@ -248,6 +248,23 @@ declare const AIAgentParamsSchema: z.ZodObject<{
248
248
  message: string;
249
249
  name?: string | undefined;
250
250
  credentials?: Partial<Record<CredentialType, string>> | undefined;
251
+ images?: ({
252
+ data: string;
253
+ type?: "base64" | undefined;
254
+ description?: string | undefined;
255
+ mimeType?: string | undefined;
256
+ } | {
257
+ type: "url";
258
+ url: string;
259
+ description?: string | undefined;
260
+ })[] | undefined;
261
+ conversationHistory?: {
262
+ role: "user" | "assistant" | "tool";
263
+ content: string;
264
+ toolCallId?: string | undefined;
265
+ name?: string | undefined;
266
+ }[] | undefined;
267
+ systemPrompt?: string | undefined;
251
268
  model?: {
252
269
  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-sonnet-4-6" | "anthropic/claude-opus-4-5" | "anthropic/claude-opus-4-6" | "anthropic/claude-haiku-4-5" | "openrouter/x-ai/grok-code-fast-1" | "openrouter/z-ai/glm-4.6" | "openrouter/z-ai/glm-4.7" | "openrouter/anthropic/claude-sonnet-4.5" | "openrouter/anthropic/claude-opus-4.5" | "openrouter/anthropic/claude-opus-4.6" | "openrouter/google/gemini-3-pro-preview" | "openrouter/morph/morph-v3-large" | "openrouter/openai/gpt-oss-120b" | "openrouter/openai/o3-deep-research" | "openrouter/openai/o4-mini-deep-research";
253
270
  temperature?: number | undefined;
@@ -264,36 +281,19 @@ declare const AIAgentParamsSchema: z.ZodObject<{
264
281
  maxRetries?: number | undefined;
265
282
  } | undefined;
266
283
  } | undefined;
267
- streaming?: boolean | undefined;
268
284
  tools?: {
269
285
  name: "get-bubble-details-tool" | "get-trigger-detail-tool" | "list-bubbles-tool" | "list-capabilities-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" | "code-edit-tool" | "instagram-tool" | "linkedin-tool" | "tiktok-tool" | "twitter-tool" | "google-maps-tool" | "youtube-tool" | "amazon-shopping-tool" | "people-search-tool";
270
286
  credentials?: Partial<Record<CredentialType, string>> | undefined;
271
287
  config?: Record<string, unknown> | undefined;
272
288
  }[] | undefined;
273
- images?: ({
274
- data: string;
275
- type?: "base64" | undefined;
276
- description?: string | undefined;
277
- mimeType?: string | undefined;
278
- } | {
279
- type: "url";
280
- url: string;
281
- description?: string | undefined;
282
- })[] | undefined;
283
- conversationHistory?: {
284
- role: "user" | "assistant" | "tool";
285
- content: string;
286
- toolCallId?: string | undefined;
287
- name?: string | undefined;
288
- }[] | undefined;
289
- systemPrompt?: string | undefined;
290
289
  customTools?: {
291
290
  description: string;
292
291
  name: string;
293
- schema: Record<string, unknown> | z.ZodTypeAny;
292
+ schema: z.ZodTypeAny | Record<string, unknown>;
294
293
  func: (args_0: Record<string, unknown>, ...args: unknown[]) => Promise<unknown>;
295
294
  }[] | undefined;
296
295
  maxIterations?: number | undefined;
296
+ streaming?: boolean | undefined;
297
297
  capabilities?: {
298
298
  id: string;
299
299
  credentials?: Partial<Record<CredentialType, string>> | undefined;
@@ -323,8 +323,8 @@ declare const AIAgentResultSchema: z.ZodObject<{
323
323
  error: z.ZodString;
324
324
  success: z.ZodBoolean;
325
325
  }, "strip", z.ZodTypeAny, {
326
- error: string;
327
326
  success: boolean;
327
+ error: string;
328
328
  response: string;
329
329
  toolCalls: {
330
330
  tool: string;
@@ -335,8 +335,8 @@ declare const AIAgentResultSchema: z.ZodObject<{
335
335
  reasoning?: string | null | undefined;
336
336
  totalCost?: number | undefined;
337
337
  }, {
338
- error: string;
339
338
  success: boolean;
339
+ error: string;
340
340
  response: string;
341
341
  toolCalls: {
342
342
  tool: string;
@@ -374,8 +374,8 @@ export declare class AIAgentBubble extends ServiceBubble<AIAgentParamsParsed, AI
374
374
  description: z.ZodOptional<z.ZodString>;
375
375
  }, "strip", z.ZodTypeAny, {
376
376
  type: "base64";
377
- mimeType: string;
378
377
  data: string;
378
+ mimeType: string;
379
379
  description?: string | undefined;
380
380
  }, {
381
381
  data: string;
@@ -492,12 +492,12 @@ export declare class AIAgentBubble extends ServiceBubble<AIAgentParamsParsed, AI
492
492
  }, "strip", z.ZodTypeAny, {
493
493
  description: string;
494
494
  name: string;
495
- schema: Record<string, unknown> | z.ZodTypeAny;
495
+ schema: z.ZodTypeAny | Record<string, unknown>;
496
496
  func: (args_0: Record<string, unknown>, ...args: unknown[]) => Promise<unknown>;
497
497
  }, {
498
498
  description: string;
499
499
  name: string;
500
- schema: Record<string, unknown> | z.ZodTypeAny;
500
+ schema: z.ZodTypeAny | Record<string, unknown>;
501
501
  func: (args_0: Record<string, unknown>, ...args: unknown[]) => Promise<unknown>;
502
502
  }>, "many">>>;
503
503
  maxIterations: z.ZodDefault<z.ZodNumber>;
@@ -520,6 +520,17 @@ export declare class AIAgentBubble extends ServiceBubble<AIAgentParamsParsed, AI
520
520
  memoryEnabled: z.ZodDefault<z.ZodBoolean>;
521
521
  }, "strip", z.ZodTypeAny, {
522
522
  message: string;
523
+ images: ({
524
+ type: "base64";
525
+ data: string;
526
+ mimeType: string;
527
+ description?: string | undefined;
528
+ } | {
529
+ type: "url";
530
+ url: string;
531
+ description?: string | undefined;
532
+ })[];
533
+ systemPrompt: string;
523
534
  model: {
524
535
  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-sonnet-4-6" | "anthropic/claude-opus-4-5" | "anthropic/claude-opus-4-6" | "anthropic/claude-haiku-4-5" | "openrouter/x-ai/grok-code-fast-1" | "openrouter/z-ai/glm-4.6" | "openrouter/z-ai/glm-4.7" | "openrouter/anthropic/claude-sonnet-4.5" | "openrouter/anthropic/claude-opus-4.5" | "openrouter/anthropic/claude-opus-4.6" | "openrouter/google/gemini-3-pro-preview" | "openrouter/morph/morph-v3-large" | "openrouter/openai/gpt-oss-120b" | "openrouter/openai/o3-deep-research" | "openrouter/openai/o4-mini-deep-research";
525
536
  temperature: number;
@@ -536,24 +547,13 @@ export declare class AIAgentBubble extends ServiceBubble<AIAgentParamsParsed, AI
536
547
  maxRetries?: number | undefined;
537
548
  } | undefined;
538
549
  };
539
- streaming: boolean;
540
550
  tools: {
541
551
  name: "get-bubble-details-tool" | "get-trigger-detail-tool" | "list-bubbles-tool" | "list-capabilities-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" | "code-edit-tool" | "instagram-tool" | "linkedin-tool" | "tiktok-tool" | "twitter-tool" | "google-maps-tool" | "youtube-tool" | "amazon-shopping-tool" | "people-search-tool";
542
552
  credentials?: Partial<Record<CredentialType, string>> | undefined;
543
553
  config?: Record<string, unknown> | undefined;
544
554
  }[];
545
- images: ({
546
- type: "base64";
547
- mimeType: string;
548
- data: string;
549
- description?: string | undefined;
550
- } | {
551
- type: "url";
552
- url: string;
553
- description?: string | undefined;
554
- })[];
555
- systemPrompt: string;
556
555
  maxIterations: number;
556
+ streaming: boolean;
557
557
  memoryEnabled: boolean;
558
558
  name?: string | undefined;
559
559
  credentials?: Partial<Record<CredentialType, string>> | undefined;
@@ -566,7 +566,7 @@ export declare class AIAgentBubble extends ServiceBubble<AIAgentParamsParsed, AI
566
566
  customTools?: {
567
567
  description: string;
568
568
  name: string;
569
- schema: Record<string, unknown> | z.ZodTypeAny;
569
+ schema: z.ZodTypeAny | Record<string, unknown>;
570
570
  func: (args_0: Record<string, unknown>, ...args: unknown[]) => Promise<unknown>;
571
571
  }[] | undefined;
572
572
  capabilities?: {
@@ -579,6 +579,23 @@ export declare class AIAgentBubble extends ServiceBubble<AIAgentParamsParsed, AI
579
579
  message: string;
580
580
  name?: string | undefined;
581
581
  credentials?: Partial<Record<CredentialType, string>> | undefined;
582
+ images?: ({
583
+ data: string;
584
+ type?: "base64" | undefined;
585
+ description?: string | undefined;
586
+ mimeType?: string | undefined;
587
+ } | {
588
+ type: "url";
589
+ url: string;
590
+ description?: string | undefined;
591
+ })[] | undefined;
592
+ conversationHistory?: {
593
+ role: "user" | "assistant" | "tool";
594
+ content: string;
595
+ toolCallId?: string | undefined;
596
+ name?: string | undefined;
597
+ }[] | undefined;
598
+ systemPrompt?: string | undefined;
582
599
  model?: {
583
600
  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-sonnet-4-6" | "anthropic/claude-opus-4-5" | "anthropic/claude-opus-4-6" | "anthropic/claude-haiku-4-5" | "openrouter/x-ai/grok-code-fast-1" | "openrouter/z-ai/glm-4.6" | "openrouter/z-ai/glm-4.7" | "openrouter/anthropic/claude-sonnet-4.5" | "openrouter/anthropic/claude-opus-4.5" | "openrouter/anthropic/claude-opus-4.6" | "openrouter/google/gemini-3-pro-preview" | "openrouter/morph/morph-v3-large" | "openrouter/openai/gpt-oss-120b" | "openrouter/openai/o3-deep-research" | "openrouter/openai/o4-mini-deep-research";
584
601
  temperature?: number | undefined;
@@ -595,36 +612,19 @@ export declare class AIAgentBubble extends ServiceBubble<AIAgentParamsParsed, AI
595
612
  maxRetries?: number | undefined;
596
613
  } | undefined;
597
614
  } | undefined;
598
- streaming?: boolean | undefined;
599
615
  tools?: {
600
616
  name: "get-bubble-details-tool" | "get-trigger-detail-tool" | "list-bubbles-tool" | "list-capabilities-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" | "code-edit-tool" | "instagram-tool" | "linkedin-tool" | "tiktok-tool" | "twitter-tool" | "google-maps-tool" | "youtube-tool" | "amazon-shopping-tool" | "people-search-tool";
601
617
  credentials?: Partial<Record<CredentialType, string>> | undefined;
602
618
  config?: Record<string, unknown> | undefined;
603
619
  }[] | undefined;
604
- images?: ({
605
- data: string;
606
- type?: "base64" | undefined;
607
- description?: string | undefined;
608
- mimeType?: string | undefined;
609
- } | {
610
- type: "url";
611
- url: string;
612
- description?: string | undefined;
613
- })[] | undefined;
614
- conversationHistory?: {
615
- role: "user" | "assistant" | "tool";
616
- content: string;
617
- toolCallId?: string | undefined;
618
- name?: string | undefined;
619
- }[] | undefined;
620
- systemPrompt?: string | undefined;
621
620
  customTools?: {
622
621
  description: string;
623
622
  name: string;
624
- schema: Record<string, unknown> | z.ZodTypeAny;
623
+ schema: z.ZodTypeAny | Record<string, unknown>;
625
624
  func: (args_0: Record<string, unknown>, ...args: unknown[]) => Promise<unknown>;
626
625
  }[] | undefined;
627
626
  maxIterations?: number | undefined;
627
+ streaming?: boolean | undefined;
628
628
  capabilities?: {
629
629
  id: string;
630
630
  credentials?: Partial<Record<CredentialType, string>> | undefined;
@@ -654,8 +654,8 @@ export declare class AIAgentBubble extends ServiceBubble<AIAgentParamsParsed, AI
654
654
  error: z.ZodString;
655
655
  success: z.ZodBoolean;
656
656
  }, "strip", z.ZodTypeAny, {
657
- error: string;
658
657
  success: boolean;
658
+ error: string;
659
659
  response: string;
660
660
  toolCalls: {
661
661
  tool: string;
@@ -666,8 +666,8 @@ export declare class AIAgentBubble extends ServiceBubble<AIAgentParamsParsed, AI
666
666
  reasoning?: string | null | undefined;
667
667
  totalCost?: number | undefined;
668
668
  }, {
669
- error: string;
670
669
  success: boolean;
670
+ error: string;
671
671
  response: string;
672
672
  toolCalls: {
673
673
  tool: string;
@@ -688,6 +688,8 @@ export declare class AIAgentBubble extends ServiceBubble<AIAgentParamsParsed, AI
688
688
  private streamingCallback;
689
689
  private shouldStopAfterTools;
690
690
  private shouldContinueToAgent;
691
+ private rescueAttempts;
692
+ private static readonly MAX_RESCUE_ATTEMPTS;
691
693
  constructor(params?: AIAgentParams, context?: BubbleContext, instanceId?: string);
692
694
  testCredential(): Promise<boolean>;
693
695
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ai-agent.d.ts","sourceRoot":"","sources":["../../../src/bubbles/service-bubble/ai-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAmB,MAAM,KAAK,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,cAAc,EAGf,MAAM,2BAA2B,CAAC;AAInC,OAAO,EAEL,SAAS,EAET,cAAc,EACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,2BAA2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CAAgC;IA6J9C,OAAO,CAAC,eAAe;YAyKT,eAAe;IAsR7B;;;;OAIG;IACH,OAAO,CAAC,4BAA4B;IAgCpC;;;;OAIG;IACH,OAAO,CAAC,yBAAyB;IAgDjC;;;OAGG;IACH,OAAO,CAAC,eAAe;IAuDvB;;OAEG;YACW,qBAAqB;YAoKrB,gBAAgB;YA6ThB,YAAY;CA0V3B"}
@@ -10,7 +10,7 @@ import { AvailableModels } from '@bubblelab/shared-schemas';
10
10
  import { AvailableTools, } from '../../types/available-tools.js';
11
11
  import { BubbleFactory } from '../../bubble-factory.js';
12
12
  import { ConversationMessageSchema } from '@bubblelab/shared-schemas';
13
- import { extractAndStreamThinkingTokens, formatFinalResponse, generationsToMessageContent, } from '../../utils/agent-formatter.js';
13
+ import { extractAndStreamThinkingTokens, formatFinalResponse, generationsToMessageContent, isGarbageResponse, } from '../../utils/agent-formatter.js';
14
14
  import { isAIMessage, isAIMessageChunk } from '@langchain/core/messages';
15
15
  import { HarmBlockThreshold, HarmCategory } from '@google/generative-ai';
16
16
  import { SafeGeminiChat } from '../../utils/safe-gemini-chat.js';
@@ -286,6 +286,8 @@ export class AIAgentBubble extends ServiceBubble {
286
286
  streamingCallback;
287
287
  shouldStopAfterTools = false;
288
288
  shouldContinueToAgent = false;
289
+ rescueAttempts = 0;
290
+ static MAX_RESCUE_ATTEMPTS = 1;
289
291
  constructor(params = {
290
292
  message: 'Hello, how are you?',
291
293
  systemPrompt: 'You are a helpful AI assistant',
@@ -1413,6 +1415,21 @@ export class AIAgentBubble extends ServiceBubble {
1413
1415
  // Get the last AI message
1414
1416
  const lastMessage = messages[messages.length - 1];
1415
1417
  const hasToolCalls = !!(lastMessage.tool_calls && lastMessage.tool_calls.length > 0);
1418
+ // Built-in rescue: detect garbage response after tool use
1419
+ if (!hasToolCalls && isGarbageResponse(lastMessage.content)) {
1420
+ const hadToolUse = messages.some((m) => m instanceof ToolMessage);
1421
+ if (hadToolUse &&
1422
+ this.rescueAttempts < AIAgentBubble.MAX_RESCUE_ATTEMPTS) {
1423
+ this.rescueAttempts++;
1424
+ console.warn(`[AIAgent] Garbage response detected ("${String(lastMessage.content).substring(0, 50)}"), attempting rescue (${this.rescueAttempts}/${AIAgentBubble.MAX_RESCUE_ATTEMPTS})`);
1425
+ this.shouldContinueToAgent = true;
1426
+ return {
1427
+ messages: [
1428
+ new HumanMessage('Your last response was empty or invalid. Please provide a clear, helpful response summarizing what you did and the results.'),
1429
+ ],
1430
+ };
1431
+ }
1432
+ }
1416
1433
  // Only call hook if we're about to end (no tool calls) and hook is provided
1417
1434
  if (!hasToolCalls && this.afterLLMCallHook) {
1418
1435
  console.log('[AIAgent] No tool calls detected, calling afterLLMCall hook');