@bubblelab/bubble-core 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bubble-bundle.d.ts +625 -296
- package/dist/bubble-factory.d.ts.map +1 -1
- package/dist/bubble-factory.js +13 -9
- package/dist/bubble-factory.js.map +1 -1
- package/dist/bubbles/service-bubble/ai-agent.d.ts +135 -117
- package/dist/bubbles/service-bubble/ai-agent.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/ai-agent.js +273 -95
- package/dist/bubbles/service-bubble/ai-agent.js.map +1 -1
- package/dist/bubbles/service-bubble/apify/actors/instagram-hashtag-scraper.d.ts +805 -0
- package/dist/bubbles/service-bubble/apify/actors/instagram-hashtag-scraper.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/instagram-hashtag-scraper.js +131 -0
- package/dist/bubbles/service-bubble/apify/actors/instagram-hashtag-scraper.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/instagram-scraper.d.ts +485 -0
- package/dist/bubbles/service-bubble/apify/actors/instagram-scraper.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/instagram-scraper.js +176 -0
- package/dist/bubbles/service-bubble/apify/actors/instagram-scraper.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/linkedin-posts-search.d.ts +302 -0
- package/dist/bubbles/service-bubble/apify/actors/linkedin-posts-search.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/linkedin-posts-search.js +138 -0
- package/dist/bubbles/service-bubble/apify/actors/linkedin-posts-search.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/linkedin-profile-posts.d.ts +642 -0
- package/dist/bubbles/service-bubble/apify/actors/linkedin-profile-posts.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/linkedin-profile-posts.js +123 -0
- package/dist/bubbles/service-bubble/apify/actors/linkedin-profile-posts.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/api-scraper.schema.d.ts +370 -0
- package/dist/bubbles/service-bubble/apify/api-scraper.schema.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify/api-scraper.schema.js +14 -0
- package/dist/bubbles/service-bubble/apify/api-scraper.schema.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/apify-scraper.schema.d.ts +1770 -0
- package/dist/bubbles/service-bubble/apify/apify-scraper.schema.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify/apify-scraper.schema.js +38 -0
- package/dist/bubbles/service-bubble/apify/apify-scraper.schema.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/apify.d.ts +143 -0
- package/dist/bubbles/service-bubble/apify/apify.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify/apify.js +276 -0
- package/dist/bubbles/service-bubble/apify/apify.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/index.d.ts +4 -0
- package/dist/bubbles/service-bubble/apify/index.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify/index.js +3 -0
- package/dist/bubbles/service-bubble/apify/index.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/types.d.ts +7 -0
- package/dist/bubbles/service-bubble/apify/types.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify/types.js +6 -0
- package/dist/bubbles/service-bubble/apify/types.js.map +1 -0
- package/dist/bubbles/service-bubble/apify.d.ts +136 -0
- package/dist/bubbles/service-bubble/apify.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify.js +282 -0
- package/dist/bubbles/service-bubble/apify.js.map +1 -0
- package/dist/bubbles/service-bubble/gmail.d.ts +52 -52
- package/dist/bubbles/service-bubble/google-calendar.d.ts +24 -24
- package/dist/bubbles/service-bubble/google-drive.d.ts +68 -68
- package/dist/bubbles/service-bubble/google-sheets.d.ts +64 -64
- package/dist/bubbles/service-bubble/hello-world.d.ts +4 -4
- package/dist/bubbles/service-bubble/http.d.ts +4 -4
- package/dist/bubbles/service-bubble/postgresql.d.ts +12 -12
- package/dist/bubbles/service-bubble/resend.d.ts +13 -13
- package/dist/bubbles/service-bubble/resend.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/resend.js +16 -5
- package/dist/bubbles/service-bubble/resend.js.map +1 -1
- package/dist/bubbles/service-bubble/slack.d.ts +462 -462
- package/dist/bubbles/service-bubble/storage.d.ts +32 -32
- package/dist/bubbles/tool-bubble/chart-js-tool.d.ts +12 -12
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts +14 -1
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.js +85 -39
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/instagram-tool.d.ts +435 -0
- package/dist/bubbles/tool-bubble/instagram-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/instagram-tool.js +474 -0
- package/dist/bubbles/tool-bubble/instagram-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/linkedin-tool.d.ts +2136 -0
- package/dist/bubbles/tool-bubble/linkedin-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/linkedin-tool.js +608 -0
- package/dist/bubbles/tool-bubble/linkedin-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts +14 -14
- package/dist/bubbles/tool-bubble/research-agent-tool.d.ts +6 -6
- package/dist/bubbles/tool-bubble/research-agent-tool.js +1 -1
- package/dist/bubbles/tool-bubble/research-agent-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/sql-query-tool.d.ts +8 -8
- package/dist/bubbles/tool-bubble/tool-template.d.ts +4 -4
- package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts +4 -4
- package/dist/bubbles/tool-bubble/web-extract-tool.d.ts +8 -8
- package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts +16 -16
- package/dist/bubbles/tool-bubble/web-scrape-tool.js +1 -1
- package/dist/bubbles/tool-bubble/web-scrape-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/web-search-tool.d.ts +10 -10
- package/dist/bubbles/tool-bubble/web-search-tool.js +1 -1
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts.map +1 -1
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js +5 -0
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js.map +1 -1
- package/dist/bubbles/workflow-bubble/database-analyzer.workflow.d.ts +4 -4
- package/dist/bubbles/workflow-bubble/generate-document.workflow.d.ts +78 -78
- package/dist/bubbles/workflow-bubble/generate-document.workflow.js +1 -1
- package/dist/bubbles/workflow-bubble/generate-document.workflow.js.map +1 -1
- package/dist/bubbles/workflow-bubble/parse-document.workflow.d.ts +50 -50
- package/dist/bubbles/workflow-bubble/parse-document.workflow.js +1 -1
- package/dist/bubbles/workflow-bubble/parse-document.workflow.js.map +1 -1
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts +42 -42
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts.map +1 -1
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js +1 -4
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js.map +1 -1
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts +36 -36
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.js +1 -1
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.js.map +1 -1
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts +40 -40
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js +1 -1
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js.map +1 -1
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts +34 -34
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.js +1 -1
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.js.map +1 -1
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts +10 -10
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts.map +1 -1
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js +1 -2
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js.map +1 -1
- package/dist/bubbles.json +474 -0
- package/dist/index.d.ts +12 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/logging/BubbleLogger.d.ts +11 -0
- package/dist/logging/BubbleLogger.d.ts.map +1 -1
- package/dist/logging/BubbleLogger.js +69 -22
- package/dist/logging/BubbleLogger.js.map +1 -1
- package/dist/logging/StreamingBubbleLogger.d.ts.map +1 -1
- package/dist/logging/StreamingBubbleLogger.js +18 -11
- package/dist/logging/StreamingBubbleLogger.js.map +1 -1
- package/dist/types/ai-models.d.ts +1 -1
- package/dist/types/ai-models.d.ts.map +1 -1
- package/dist/types/ai-models.js +4 -0
- package/dist/types/ai-models.js.map +1 -1
- package/dist/types/api-scraper.schema.d.ts +453 -0
- package/dist/types/api-scraper.schema.d.ts.map +1 -0
- package/dist/types/api-scraper.schema.js +160 -0
- package/dist/types/api-scraper.schema.js.map +1 -0
- package/dist/types/available-tools.d.ts +1 -1
- package/dist/types/available-tools.d.ts.map +1 -1
- package/dist/types/available-tools.js +2 -0
- package/dist/types/available-tools.js.map +1 -1
- package/dist/types/base-bubble-class.d.ts +5 -0
- package/dist/types/base-bubble-class.d.ts.map +1 -1
- package/dist/types/base-bubble-class.js +18 -3
- package/dist/types/base-bubble-class.js.map +1 -1
- package/dist/types/bubble.d.ts +2 -3
- package/dist/types/bubble.d.ts.map +1 -1
- package/dist/types/service-bubble-class.d.ts +4 -4
- package/dist/types/service-bubble-class.d.ts.map +1 -1
- package/dist/types/service-bubble-class.js +6 -7
- package/dist/types/service-bubble-class.js.map +1 -1
- package/dist/types/tool-bubble-class.d.ts.map +1 -1
- package/dist/types/tool-bubble-class.js +9 -1
- package/dist/types/tool-bubble-class.js.map +1 -1
- package/dist/utils/agent-formatter.d.ts +17 -0
- package/dist/utils/agent-formatter.d.ts.map +1 -0
- package/dist/utils/agent-formatter.js +139 -0
- package/dist/utils/agent-formatter.js.map +1 -0
- package/dist/utils/json-parsing.d.ts +1 -0
- package/dist/utils/json-parsing.d.ts.map +1 -1
- package/dist/utils/json-parsing.js +205 -32
- package/dist/utils/json-parsing.js.map +1 -1
- package/package.json +4 -3
|
@@ -119,19 +119,19 @@ declare const StorageParamsSchema: z.ZodDiscriminatedUnion<"operation", [z.ZodOb
|
|
|
119
119
|
credentials: z.ZodOptional<z.ZodRecord<z.ZodNativeEnum<typeof CredentialType>, z.ZodString>>;
|
|
120
120
|
}, "strip", z.ZodTypeAny, {
|
|
121
121
|
operation: "getMultipleUploadUrls";
|
|
122
|
+
pageCount: number;
|
|
122
123
|
bucketName: string;
|
|
123
124
|
region: string;
|
|
124
125
|
expirationMinutes: number;
|
|
125
126
|
pdfFileName: string;
|
|
126
|
-
pageCount: number;
|
|
127
127
|
credentials?: Partial<Record<CredentialType, string>> | undefined;
|
|
128
128
|
accountId?: string | undefined;
|
|
129
129
|
userId?: string | undefined;
|
|
130
130
|
}, {
|
|
131
131
|
operation: "getMultipleUploadUrls";
|
|
132
|
+
pageCount: number;
|
|
132
133
|
bucketName: string;
|
|
133
134
|
pdfFileName: string;
|
|
134
|
-
pageCount: number;
|
|
135
135
|
credentials?: Partial<Record<CredentialType, string>> | undefined;
|
|
136
136
|
accountId?: string | undefined;
|
|
137
137
|
region?: string | undefined;
|
|
@@ -146,15 +146,15 @@ declare const StorageResultSchema: z.ZodDiscriminatedUnion<"operation", [z.ZodOb
|
|
|
146
146
|
contentType: z.ZodOptional<z.ZodString>;
|
|
147
147
|
error: z.ZodString;
|
|
148
148
|
}, "strip", z.ZodTypeAny, {
|
|
149
|
-
success: boolean;
|
|
150
149
|
error: string;
|
|
150
|
+
success: boolean;
|
|
151
151
|
operation: "getUploadUrl";
|
|
152
152
|
fileName?: string | undefined;
|
|
153
153
|
contentType?: string | undefined;
|
|
154
154
|
uploadUrl?: string | undefined;
|
|
155
155
|
}, {
|
|
156
|
-
success: boolean;
|
|
157
156
|
error: string;
|
|
157
|
+
success: boolean;
|
|
158
158
|
operation: "getUploadUrl";
|
|
159
159
|
fileName?: string | undefined;
|
|
160
160
|
contentType?: string | undefined;
|
|
@@ -170,8 +170,8 @@ declare const StorageResultSchema: z.ZodDiscriminatedUnion<"operation", [z.ZodOb
|
|
|
170
170
|
lastModified: z.ZodOptional<z.ZodString>;
|
|
171
171
|
error: z.ZodString;
|
|
172
172
|
}, "strip", z.ZodTypeAny, {
|
|
173
|
-
success: boolean;
|
|
174
173
|
error: string;
|
|
174
|
+
success: boolean;
|
|
175
175
|
operation: "getFile";
|
|
176
176
|
fileName?: string | undefined;
|
|
177
177
|
contentType?: string | undefined;
|
|
@@ -180,8 +180,8 @@ declare const StorageResultSchema: z.ZodDiscriminatedUnion<"operation", [z.ZodOb
|
|
|
180
180
|
fileSize?: number | undefined;
|
|
181
181
|
lastModified?: string | undefined;
|
|
182
182
|
}, {
|
|
183
|
-
success: boolean;
|
|
184
183
|
error: string;
|
|
184
|
+
success: boolean;
|
|
185
185
|
operation: "getFile";
|
|
186
186
|
fileName?: string | undefined;
|
|
187
187
|
contentType?: string | undefined;
|
|
@@ -196,14 +196,14 @@ declare const StorageResultSchema: z.ZodDiscriminatedUnion<"operation", [z.ZodOb
|
|
|
196
196
|
deleted: z.ZodOptional<z.ZodBoolean>;
|
|
197
197
|
error: z.ZodString;
|
|
198
198
|
}, "strip", z.ZodTypeAny, {
|
|
199
|
-
success: boolean;
|
|
200
199
|
error: string;
|
|
200
|
+
success: boolean;
|
|
201
201
|
operation: "deleteFile";
|
|
202
202
|
deleted?: boolean | undefined;
|
|
203
203
|
fileName?: string | undefined;
|
|
204
204
|
}, {
|
|
205
|
-
success: boolean;
|
|
206
205
|
error: string;
|
|
206
|
+
success: boolean;
|
|
207
207
|
operation: "deleteFile";
|
|
208
208
|
deleted?: boolean | undefined;
|
|
209
209
|
fileName?: string | undefined;
|
|
@@ -215,15 +215,15 @@ declare const StorageResultSchema: z.ZodDiscriminatedUnion<"operation", [z.ZodOb
|
|
|
215
215
|
contentType: z.ZodOptional<z.ZodString>;
|
|
216
216
|
error: z.ZodString;
|
|
217
217
|
}, "strip", z.ZodTypeAny, {
|
|
218
|
-
success: boolean;
|
|
219
218
|
error: string;
|
|
219
|
+
success: boolean;
|
|
220
220
|
operation: "updateFile";
|
|
221
221
|
updated?: boolean | undefined;
|
|
222
222
|
fileName?: string | undefined;
|
|
223
223
|
contentType?: string | undefined;
|
|
224
224
|
}, {
|
|
225
|
-
success: boolean;
|
|
226
225
|
error: string;
|
|
226
|
+
success: boolean;
|
|
227
227
|
operation: "updateFile";
|
|
228
228
|
updated?: boolean | undefined;
|
|
229
229
|
fileName?: string | undefined;
|
|
@@ -238,36 +238,36 @@ declare const StorageResultSchema: z.ZodDiscriminatedUnion<"operation", [z.ZodOb
|
|
|
238
238
|
uploadUrl: z.ZodString;
|
|
239
239
|
fileName: z.ZodString;
|
|
240
240
|
}, "strip", z.ZodTypeAny, {
|
|
241
|
+
pageNumber: number;
|
|
241
242
|
fileName: string;
|
|
242
243
|
uploadUrl: string;
|
|
243
|
-
pageNumber: number;
|
|
244
244
|
}, {
|
|
245
|
+
pageNumber: number;
|
|
245
246
|
fileName: string;
|
|
246
247
|
uploadUrl: string;
|
|
247
|
-
pageNumber: number;
|
|
248
248
|
}>, "many">>;
|
|
249
249
|
error: z.ZodString;
|
|
250
250
|
}, "strip", z.ZodTypeAny, {
|
|
251
|
-
success: boolean;
|
|
252
251
|
error: string;
|
|
252
|
+
success: boolean;
|
|
253
253
|
operation: "getMultipleUploadUrls";
|
|
254
254
|
pdfFileName?: string | undefined;
|
|
255
255
|
pdfUploadUrl?: string | undefined;
|
|
256
256
|
pageUploadUrls?: {
|
|
257
|
+
pageNumber: number;
|
|
257
258
|
fileName: string;
|
|
258
259
|
uploadUrl: string;
|
|
259
|
-
pageNumber: number;
|
|
260
260
|
}[] | undefined;
|
|
261
261
|
}, {
|
|
262
|
-
success: boolean;
|
|
263
262
|
error: string;
|
|
263
|
+
success: boolean;
|
|
264
264
|
operation: "getMultipleUploadUrls";
|
|
265
265
|
pdfFileName?: string | undefined;
|
|
266
266
|
pdfUploadUrl?: string | undefined;
|
|
267
267
|
pageUploadUrls?: {
|
|
268
|
+
pageNumber: number;
|
|
268
269
|
fileName: string;
|
|
269
270
|
uploadUrl: string;
|
|
270
|
-
pageNumber: number;
|
|
271
271
|
}[] | undefined;
|
|
272
272
|
}>]>;
|
|
273
273
|
type StorageResult = z.output<typeof StorageResultSchema>;
|
|
@@ -399,19 +399,19 @@ export declare class StorageBubble<T extends StorageParams = StorageParams> exte
|
|
|
399
399
|
credentials: z.ZodOptional<z.ZodRecord<z.ZodNativeEnum<typeof CredentialType>, z.ZodString>>;
|
|
400
400
|
}, "strip", z.ZodTypeAny, {
|
|
401
401
|
operation: "getMultipleUploadUrls";
|
|
402
|
+
pageCount: number;
|
|
402
403
|
bucketName: string;
|
|
403
404
|
region: string;
|
|
404
405
|
expirationMinutes: number;
|
|
405
406
|
pdfFileName: string;
|
|
406
|
-
pageCount: number;
|
|
407
407
|
credentials?: Partial<Record<CredentialType, string>> | undefined;
|
|
408
408
|
accountId?: string | undefined;
|
|
409
409
|
userId?: string | undefined;
|
|
410
410
|
}, {
|
|
411
411
|
operation: "getMultipleUploadUrls";
|
|
412
|
+
pageCount: number;
|
|
412
413
|
bucketName: string;
|
|
413
414
|
pdfFileName: string;
|
|
414
|
-
pageCount: number;
|
|
415
415
|
credentials?: Partial<Record<CredentialType, string>> | undefined;
|
|
416
416
|
accountId?: string | undefined;
|
|
417
417
|
region?: string | undefined;
|
|
@@ -426,15 +426,15 @@ export declare class StorageBubble<T extends StorageParams = StorageParams> exte
|
|
|
426
426
|
contentType: z.ZodOptional<z.ZodString>;
|
|
427
427
|
error: z.ZodString;
|
|
428
428
|
}, "strip", z.ZodTypeAny, {
|
|
429
|
-
success: boolean;
|
|
430
429
|
error: string;
|
|
430
|
+
success: boolean;
|
|
431
431
|
operation: "getUploadUrl";
|
|
432
432
|
fileName?: string | undefined;
|
|
433
433
|
contentType?: string | undefined;
|
|
434
434
|
uploadUrl?: string | undefined;
|
|
435
435
|
}, {
|
|
436
|
-
success: boolean;
|
|
437
436
|
error: string;
|
|
437
|
+
success: boolean;
|
|
438
438
|
operation: "getUploadUrl";
|
|
439
439
|
fileName?: string | undefined;
|
|
440
440
|
contentType?: string | undefined;
|
|
@@ -450,8 +450,8 @@ export declare class StorageBubble<T extends StorageParams = StorageParams> exte
|
|
|
450
450
|
lastModified: z.ZodOptional<z.ZodString>;
|
|
451
451
|
error: z.ZodString;
|
|
452
452
|
}, "strip", z.ZodTypeAny, {
|
|
453
|
-
success: boolean;
|
|
454
453
|
error: string;
|
|
454
|
+
success: boolean;
|
|
455
455
|
operation: "getFile";
|
|
456
456
|
fileName?: string | undefined;
|
|
457
457
|
contentType?: string | undefined;
|
|
@@ -460,8 +460,8 @@ export declare class StorageBubble<T extends StorageParams = StorageParams> exte
|
|
|
460
460
|
fileSize?: number | undefined;
|
|
461
461
|
lastModified?: string | undefined;
|
|
462
462
|
}, {
|
|
463
|
-
success: boolean;
|
|
464
463
|
error: string;
|
|
464
|
+
success: boolean;
|
|
465
465
|
operation: "getFile";
|
|
466
466
|
fileName?: string | undefined;
|
|
467
467
|
contentType?: string | undefined;
|
|
@@ -476,14 +476,14 @@ export declare class StorageBubble<T extends StorageParams = StorageParams> exte
|
|
|
476
476
|
deleted: z.ZodOptional<z.ZodBoolean>;
|
|
477
477
|
error: z.ZodString;
|
|
478
478
|
}, "strip", z.ZodTypeAny, {
|
|
479
|
-
success: boolean;
|
|
480
479
|
error: string;
|
|
480
|
+
success: boolean;
|
|
481
481
|
operation: "deleteFile";
|
|
482
482
|
deleted?: boolean | undefined;
|
|
483
483
|
fileName?: string | undefined;
|
|
484
484
|
}, {
|
|
485
|
-
success: boolean;
|
|
486
485
|
error: string;
|
|
486
|
+
success: boolean;
|
|
487
487
|
operation: "deleteFile";
|
|
488
488
|
deleted?: boolean | undefined;
|
|
489
489
|
fileName?: string | undefined;
|
|
@@ -495,15 +495,15 @@ export declare class StorageBubble<T extends StorageParams = StorageParams> exte
|
|
|
495
495
|
contentType: z.ZodOptional<z.ZodString>;
|
|
496
496
|
error: z.ZodString;
|
|
497
497
|
}, "strip", z.ZodTypeAny, {
|
|
498
|
-
success: boolean;
|
|
499
498
|
error: string;
|
|
499
|
+
success: boolean;
|
|
500
500
|
operation: "updateFile";
|
|
501
501
|
updated?: boolean | undefined;
|
|
502
502
|
fileName?: string | undefined;
|
|
503
503
|
contentType?: string | undefined;
|
|
504
504
|
}, {
|
|
505
|
-
success: boolean;
|
|
506
505
|
error: string;
|
|
506
|
+
success: boolean;
|
|
507
507
|
operation: "updateFile";
|
|
508
508
|
updated?: boolean | undefined;
|
|
509
509
|
fileName?: string | undefined;
|
|
@@ -518,36 +518,36 @@ export declare class StorageBubble<T extends StorageParams = StorageParams> exte
|
|
|
518
518
|
uploadUrl: z.ZodString;
|
|
519
519
|
fileName: z.ZodString;
|
|
520
520
|
}, "strip", z.ZodTypeAny, {
|
|
521
|
+
pageNumber: number;
|
|
521
522
|
fileName: string;
|
|
522
523
|
uploadUrl: string;
|
|
523
|
-
pageNumber: number;
|
|
524
524
|
}, {
|
|
525
|
+
pageNumber: number;
|
|
525
526
|
fileName: string;
|
|
526
527
|
uploadUrl: string;
|
|
527
|
-
pageNumber: number;
|
|
528
528
|
}>, "many">>;
|
|
529
529
|
error: z.ZodString;
|
|
530
530
|
}, "strip", z.ZodTypeAny, {
|
|
531
|
-
success: boolean;
|
|
532
531
|
error: string;
|
|
532
|
+
success: boolean;
|
|
533
533
|
operation: "getMultipleUploadUrls";
|
|
534
534
|
pdfFileName?: string | undefined;
|
|
535
535
|
pdfUploadUrl?: string | undefined;
|
|
536
536
|
pageUploadUrls?: {
|
|
537
|
+
pageNumber: number;
|
|
537
538
|
fileName: string;
|
|
538
539
|
uploadUrl: string;
|
|
539
|
-
pageNumber: number;
|
|
540
540
|
}[] | undefined;
|
|
541
541
|
}, {
|
|
542
|
-
success: boolean;
|
|
543
542
|
error: string;
|
|
543
|
+
success: boolean;
|
|
544
544
|
operation: "getMultipleUploadUrls";
|
|
545
545
|
pdfFileName?: string | undefined;
|
|
546
546
|
pdfUploadUrl?: string | undefined;
|
|
547
547
|
pageUploadUrls?: {
|
|
548
|
+
pageNumber: number;
|
|
548
549
|
fileName: string;
|
|
549
550
|
uploadUrl: string;
|
|
550
|
-
pageNumber: number;
|
|
551
551
|
}[] | undefined;
|
|
552
552
|
}>]>;
|
|
553
553
|
static readonly shortDescription = "Cloudflare R2 storage operations for file management";
|
|
@@ -48,10 +48,10 @@ declare const ChartJSToolParamsSchema: z.ZodObject<{
|
|
|
48
48
|
}, "strip", z.ZodTypeAny, {
|
|
49
49
|
data: Record<string, unknown>[];
|
|
50
50
|
reasoning: string;
|
|
51
|
-
chartType: "line" | "bar" | "pie" | "doughnut" | "radar" | "scatter" | "bubble" | "polarArea";
|
|
52
|
-
generateFile: boolean;
|
|
53
51
|
width: number;
|
|
54
52
|
height: number;
|
|
53
|
+
chartType: "line" | "bar" | "pie" | "doughnut" | "radar" | "scatter" | "bubble" | "polarArea";
|
|
54
|
+
generateFile: boolean;
|
|
55
55
|
options?: {
|
|
56
56
|
colorScheme: "default" | "viridis" | "plasma" | "inferno" | "magma" | "blues" | "greens" | "reds" | "oranges" | "categorical";
|
|
57
57
|
responsive: boolean;
|
|
@@ -86,6 +86,8 @@ declare const ChartJSToolParamsSchema: z.ZodObject<{
|
|
|
86
86
|
} | undefined;
|
|
87
87
|
credentials?: Partial<Record<CredentialType, string>> | undefined;
|
|
88
88
|
config?: Record<string, unknown> | undefined;
|
|
89
|
+
width?: number | undefined;
|
|
90
|
+
height?: number | undefined;
|
|
89
91
|
fileName?: string | undefined;
|
|
90
92
|
xColumn?: string | undefined;
|
|
91
93
|
yColumn?: string | undefined;
|
|
@@ -93,8 +95,6 @@ declare const ChartJSToolParamsSchema: z.ZodObject<{
|
|
|
93
95
|
advancedConfig?: Record<string, unknown> | undefined;
|
|
94
96
|
generateFile?: boolean | undefined;
|
|
95
97
|
filePath?: string | undefined;
|
|
96
|
-
width?: number | undefined;
|
|
97
|
-
height?: number | undefined;
|
|
98
98
|
}>;
|
|
99
99
|
type ChartJSToolParamsInput = z.input<typeof ChartJSToolParamsSchema>;
|
|
100
100
|
type ChartJSToolParams = z.output<typeof ChartJSToolParamsSchema>;
|
|
@@ -139,8 +139,8 @@ declare const ChartJSToolResultSchema: z.ZodObject<{
|
|
|
139
139
|
success: z.ZodBoolean;
|
|
140
140
|
error: z.ZodString;
|
|
141
141
|
}, "strip", z.ZodTypeAny, {
|
|
142
|
-
success: boolean;
|
|
143
142
|
error: string;
|
|
143
|
+
success: boolean;
|
|
144
144
|
metadata: {
|
|
145
145
|
colorScheme: string;
|
|
146
146
|
generatedAt: string;
|
|
@@ -160,8 +160,8 @@ declare const ChartJSToolResultSchema: z.ZodObject<{
|
|
|
160
160
|
filePath?: string | undefined;
|
|
161
161
|
fileExists?: boolean | undefined;
|
|
162
162
|
}, {
|
|
163
|
-
success: boolean;
|
|
164
163
|
error: string;
|
|
164
|
+
success: boolean;
|
|
165
165
|
metadata: {
|
|
166
166
|
colorScheme: string;
|
|
167
167
|
generatedAt: string;
|
|
@@ -236,10 +236,10 @@ export declare class ChartJSTool extends ToolBubble<ChartJSToolParams, ChartJSTo
|
|
|
236
236
|
}, "strip", z.ZodTypeAny, {
|
|
237
237
|
data: Record<string, unknown>[];
|
|
238
238
|
reasoning: string;
|
|
239
|
-
chartType: "line" | "bar" | "pie" | "doughnut" | "radar" | "scatter" | "bubble" | "polarArea";
|
|
240
|
-
generateFile: boolean;
|
|
241
239
|
width: number;
|
|
242
240
|
height: number;
|
|
241
|
+
chartType: "line" | "bar" | "pie" | "doughnut" | "radar" | "scatter" | "bubble" | "polarArea";
|
|
242
|
+
generateFile: boolean;
|
|
243
243
|
options?: {
|
|
244
244
|
colorScheme: "default" | "viridis" | "plasma" | "inferno" | "magma" | "blues" | "greens" | "reds" | "oranges" | "categorical";
|
|
245
245
|
responsive: boolean;
|
|
@@ -274,6 +274,8 @@ export declare class ChartJSTool extends ToolBubble<ChartJSToolParams, ChartJSTo
|
|
|
274
274
|
} | undefined;
|
|
275
275
|
credentials?: Partial<Record<CredentialType, string>> | undefined;
|
|
276
276
|
config?: Record<string, unknown> | undefined;
|
|
277
|
+
width?: number | undefined;
|
|
278
|
+
height?: number | undefined;
|
|
277
279
|
fileName?: string | undefined;
|
|
278
280
|
xColumn?: string | undefined;
|
|
279
281
|
yColumn?: string | undefined;
|
|
@@ -281,8 +283,6 @@ export declare class ChartJSTool extends ToolBubble<ChartJSToolParams, ChartJSTo
|
|
|
281
283
|
advancedConfig?: Record<string, unknown> | undefined;
|
|
282
284
|
generateFile?: boolean | undefined;
|
|
283
285
|
filePath?: string | undefined;
|
|
284
|
-
width?: number | undefined;
|
|
285
|
-
height?: number | undefined;
|
|
286
286
|
}>;
|
|
287
287
|
static readonly resultSchema: z.ZodObject<{
|
|
288
288
|
chartConfig: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -324,8 +324,8 @@ export declare class ChartJSTool extends ToolBubble<ChartJSToolParams, ChartJSTo
|
|
|
324
324
|
success: z.ZodBoolean;
|
|
325
325
|
error: z.ZodString;
|
|
326
326
|
}, "strip", z.ZodTypeAny, {
|
|
327
|
-
success: boolean;
|
|
328
327
|
error: string;
|
|
328
|
+
success: boolean;
|
|
329
329
|
metadata: {
|
|
330
330
|
colorScheme: string;
|
|
331
331
|
generatedAt: string;
|
|
@@ -345,8 +345,8 @@ export declare class ChartJSTool extends ToolBubble<ChartJSToolParams, ChartJSTo
|
|
|
345
345
|
filePath?: string | undefined;
|
|
346
346
|
fileExists?: boolean | undefined;
|
|
347
347
|
}, {
|
|
348
|
-
success: boolean;
|
|
349
348
|
error: string;
|
|
349
|
+
success: boolean;
|
|
350
350
|
metadata: {
|
|
351
351
|
colorScheme: string;
|
|
352
352
|
generatedAt: string;
|
|
@@ -4,13 +4,16 @@ import type { BubbleContext } from '../../types/bubble.js';
|
|
|
4
4
|
import { CredentialType } from '@bubblelab/shared-schemas';
|
|
5
5
|
declare const GetBubbleDetailsToolParamsSchema: z.ZodObject<{
|
|
6
6
|
bubbleName: z.ZodString;
|
|
7
|
+
includeInputSchema: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
7
8
|
credentials: z.ZodOptional<z.ZodRecord<z.ZodNativeEnum<typeof CredentialType>, z.ZodString>>;
|
|
8
9
|
}, "strip", z.ZodTypeAny, {
|
|
9
10
|
bubbleName: string;
|
|
11
|
+
includeInputSchema: boolean;
|
|
10
12
|
credentials?: Partial<Record<CredentialType, string>> | undefined;
|
|
11
13
|
}, {
|
|
12
14
|
bubbleName: string;
|
|
13
15
|
credentials?: Partial<Record<CredentialType, string>> | undefined;
|
|
16
|
+
includeInputSchema?: boolean | undefined;
|
|
14
17
|
}>;
|
|
15
18
|
type GetBubbleDetailsToolParamsInput = z.input<typeof GetBubbleDetailsToolParamsSchema>;
|
|
16
19
|
type GetBubbleDetailsToolParams = z.output<typeof GetBubbleDetailsToolParamsSchema>;
|
|
@@ -18,6 +21,7 @@ type GetBubbleDetailsToolResult = z.output<typeof GetBubbleDetailsToolResultSche
|
|
|
18
21
|
declare const GetBubbleDetailsToolResultSchema: z.ZodObject<{
|
|
19
22
|
name: z.ZodString;
|
|
20
23
|
alias: z.ZodOptional<z.ZodString>;
|
|
24
|
+
inputSchema: z.ZodOptional<z.ZodString>;
|
|
21
25
|
outputSchema: z.ZodString;
|
|
22
26
|
usageExample: z.ZodString;
|
|
23
27
|
success: z.ZodBoolean;
|
|
@@ -29,6 +33,7 @@ declare const GetBubbleDetailsToolResultSchema: z.ZodObject<{
|
|
|
29
33
|
outputSchema: string;
|
|
30
34
|
usageExample: string;
|
|
31
35
|
alias?: string | undefined;
|
|
36
|
+
inputSchema?: string | undefined;
|
|
32
37
|
}, {
|
|
33
38
|
name: string;
|
|
34
39
|
success: boolean;
|
|
@@ -36,23 +41,28 @@ declare const GetBubbleDetailsToolResultSchema: z.ZodObject<{
|
|
|
36
41
|
outputSchema: string;
|
|
37
42
|
usageExample: string;
|
|
38
43
|
alias?: string | undefined;
|
|
44
|
+
inputSchema?: string | undefined;
|
|
39
45
|
}>;
|
|
40
46
|
export declare class GetBubbleDetailsTool extends ToolBubble<GetBubbleDetailsToolParams, GetBubbleDetailsToolResult> {
|
|
41
47
|
static readonly type: "tool";
|
|
42
48
|
static readonly bubbleName = "get-bubble-details-tool";
|
|
43
49
|
static readonly schema: z.ZodObject<{
|
|
44
50
|
bubbleName: z.ZodString;
|
|
51
|
+
includeInputSchema: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
45
52
|
credentials: z.ZodOptional<z.ZodRecord<z.ZodNativeEnum<typeof CredentialType>, z.ZodString>>;
|
|
46
53
|
}, "strip", z.ZodTypeAny, {
|
|
47
54
|
bubbleName: string;
|
|
55
|
+
includeInputSchema: boolean;
|
|
48
56
|
credentials?: Partial<Record<CredentialType, string>> | undefined;
|
|
49
57
|
}, {
|
|
50
58
|
bubbleName: string;
|
|
51
59
|
credentials?: Partial<Record<CredentialType, string>> | undefined;
|
|
60
|
+
includeInputSchema?: boolean | undefined;
|
|
52
61
|
}>;
|
|
53
62
|
static readonly resultSchema: z.ZodObject<{
|
|
54
63
|
name: z.ZodString;
|
|
55
64
|
alias: z.ZodOptional<z.ZodString>;
|
|
65
|
+
inputSchema: z.ZodOptional<z.ZodString>;
|
|
56
66
|
outputSchema: z.ZodString;
|
|
57
67
|
usageExample: z.ZodString;
|
|
58
68
|
success: z.ZodBoolean;
|
|
@@ -64,6 +74,7 @@ export declare class GetBubbleDetailsTool extends ToolBubble<GetBubbleDetailsToo
|
|
|
64
74
|
outputSchema: string;
|
|
65
75
|
usageExample: string;
|
|
66
76
|
alias?: string | undefined;
|
|
77
|
+
inputSchema?: string | undefined;
|
|
67
78
|
}, {
|
|
68
79
|
name: string;
|
|
69
80
|
success: boolean;
|
|
@@ -71,6 +82,7 @@ export declare class GetBubbleDetailsTool extends ToolBubble<GetBubbleDetailsToo
|
|
|
71
82
|
outputSchema: string;
|
|
72
83
|
usageExample: string;
|
|
73
84
|
alias?: string | undefined;
|
|
85
|
+
inputSchema?: string | undefined;
|
|
74
86
|
}>;
|
|
75
87
|
static readonly shortDescription = "Provides detailed information about a specific bubble, including schema, parameters, and documentation";
|
|
76
88
|
static readonly longDescription = "\n A tool bubble that retrieves comprehensive information about any registered bubble in the system.\n \n Returns detailed information including:\n - Complete schema with parameter types and descriptions\n - Result schema for expected outputs\n - Credential requirements\n - AI-formatted documentation\n - Usage examples\n \n Use cases:\n - AI agent understanding of specific bubble capabilities\n - Parameter validation before bubble instantiation\n - Documentation generation and help systems\n - Dynamic form generation for bubble configuration\n ";
|
|
@@ -85,7 +97,8 @@ export declare class GetBubbleDetailsTool extends ToolBubble<GetBubbleDetailsToo
|
|
|
85
97
|
private generateOperationExamples;
|
|
86
98
|
private generateSingleExample;
|
|
87
99
|
private formatOperationComment;
|
|
88
|
-
private
|
|
100
|
+
private getResultSchemaOption;
|
|
101
|
+
private getFirstResultSchemaOption;
|
|
89
102
|
/**
|
|
90
103
|
* Extracts the description from a Zod schema type
|
|
91
104
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-bubble-details-tool.d.ts","sourceRoot":"","sources":["../../../src/bubbles/tool-bubble/get-bubble-details-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAK3D,QAAA,MAAM,gCAAgC
|
|
1
|
+
{"version":3,"file":"get-bubble-details-tool.d.ts","sourceRoot":"","sources":["../../../src/bubbles/tool-bubble/get-bubble-details-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAK3D,QAAA,MAAM,gCAAgC;;;;;;;;;;;;EAgBpC,CAAC;AAGH,KAAK,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,gCAAgC,CACxC,CAAC;AACF,KAAK,0BAA0B,GAAG,CAAC,CAAC,MAAM,CACxC,OAAO,gCAAgC,CACxC,CAAC;AAEF,KAAK,0BAA0B,GAAG,CAAC,CAAC,MAAM,CACxC,OAAO,gCAAgC,CACxC,CAAC;AAGF,QAAA,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;EAepC,CAAC;AAEH,qBAAa,oBAAqB,SAAQ,UAAU,CAClD,0BAA0B,EAC1B,0BAA0B,CAC3B;IACC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAU;IACvC,MAAM,CAAC,QAAQ,CAAC,UAAU,6BAA6B;IACvD,MAAM,CAAC,QAAQ,CAAC,MAAM;;;;;;;;;;;;OAAoC;IAC1D,MAAM,CAAC,QAAQ,CAAC,YAAY;;;;;;;;;;;;;;;;;;;;;;;;OAAoC;IAChE,MAAM,CAAC,QAAQ,CAAC,gBAAgB,4GAC2E;IAC3G,MAAM,CAAC,QAAQ,CAAC,eAAe,ulBAe7B;IACF,MAAM,CAAC,QAAQ,CAAC,KAAK,aAAa;IAClC,OAAO,CAAC,OAAO,CAAgB;gBAG7B,MAAM,EAAE,+BAA+B,EACvC,OAAO,CAAC,EAAE,aAAa;IAMnB,aAAa,CACjB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,0BAA0B,CAAC;IA+CtC,OAAO,CAAC,0BAA0B;IAyClC,OAAO,CAAC,gBAAgB;IAqExB,OAAO,CAAC,oBAAoB;IA2B5B,OAAO,CAAC,oBAAoB;IAQ5B,OAAO,CAAC,yBAAyB;IAiIjC,OAAO,CAAC,qBAAqB;IAyD7B,OAAO,CAAC,sBAAsB;IAY9B,OAAO,CAAC,qBAAqB;IAuC7B,OAAO,CAAC,0BAA0B;IAwBlC;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAyB/B,OAAO,CAAC,qBAAqB;IAmF7B,OAAO,CAAC,oBAAoB;IAqK5B,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,YAAY;CAIrB"}
|
|
@@ -8,6 +8,11 @@ const GetBubbleDetailsToolParamsSchema = z.object({
|
|
|
8
8
|
.string()
|
|
9
9
|
.min(1, 'Bubble name is required')
|
|
10
10
|
.describe('The name of the bubble to get details about'),
|
|
11
|
+
includeInputSchema: z
|
|
12
|
+
.boolean()
|
|
13
|
+
.optional()
|
|
14
|
+
.default(false)
|
|
15
|
+
.describe('Include input parameter schema in the response'),
|
|
11
16
|
credentials: z
|
|
12
17
|
.record(z.nativeEnum(CredentialType), z.string())
|
|
13
18
|
.optional()
|
|
@@ -17,6 +22,10 @@ const GetBubbleDetailsToolParamsSchema = z.object({
|
|
|
17
22
|
const GetBubbleDetailsToolResultSchema = z.object({
|
|
18
23
|
name: z.string().describe('Name of the bubble'),
|
|
19
24
|
alias: z.string().optional().describe('Short alias for the bubble'),
|
|
25
|
+
inputSchema: z
|
|
26
|
+
.string()
|
|
27
|
+
.optional()
|
|
28
|
+
.describe('String representation of the input parameter schema types'),
|
|
20
29
|
outputSchema: z
|
|
21
30
|
.string()
|
|
22
31
|
.describe('String representation of the output schema types'),
|
|
@@ -74,9 +83,14 @@ export class GetBubbleDetailsTool extends ToolBubble {
|
|
|
74
83
|
});
|
|
75
84
|
// Generate string representation of output schema
|
|
76
85
|
const outputSchemaString = this.generateOutputSchemaString(metadata.resultSchema);
|
|
86
|
+
// Generate string representation of input schema if requested
|
|
87
|
+
const inputSchemaString = this.params.includeInputSchema
|
|
88
|
+
? this.generateOutputSchemaString(metadata.schema)
|
|
89
|
+
: undefined;
|
|
77
90
|
return {
|
|
78
91
|
name: metadata.name,
|
|
79
92
|
alias: metadata.alias,
|
|
93
|
+
inputSchema: inputSchemaString,
|
|
80
94
|
outputSchema: outputSchemaString,
|
|
81
95
|
usageExample,
|
|
82
96
|
success: true,
|
|
@@ -161,6 +175,10 @@ export class GetBubbleDetailsTool extends ToolBubble {
|
|
|
161
175
|
const innerType = this.generateTypeInfo(def.innerType);
|
|
162
176
|
return innerType ? `${innerType} | undefined` : 'unknown | undefined';
|
|
163
177
|
}
|
|
178
|
+
else if (def.typeName === 'ZodNullable') {
|
|
179
|
+
const innerType = this.generateTypeInfo(def.innerType);
|
|
180
|
+
return innerType ? `${innerType} | null` : 'unknown | null';
|
|
181
|
+
}
|
|
164
182
|
else if (def.typeName === 'ZodDefault') {
|
|
165
183
|
return this.generateTypeInfo(def.innerType);
|
|
166
184
|
}
|
|
@@ -227,9 +245,7 @@ export class GetBubbleDetailsTool extends ToolBubble {
|
|
|
227
245
|
const options = def.options;
|
|
228
246
|
const discriminatorKey = def.discriminator;
|
|
229
247
|
// Limit to first 4 operations to avoid overwhelming output
|
|
230
|
-
|
|
231
|
-
const operationsToShow = options.slice(0, maxOperations);
|
|
232
|
-
operationsToShow.forEach((option, index) => {
|
|
248
|
+
options.forEach((option, index) => {
|
|
233
249
|
if (option && typeof option === 'object' && 'shape' in option) {
|
|
234
250
|
const shape = option.shape;
|
|
235
251
|
// Get the operation name from discriminator
|
|
@@ -279,35 +295,36 @@ export class GetBubbleDetailsTool extends ToolBubble {
|
|
|
279
295
|
lines.push('});');
|
|
280
296
|
lines.push('');
|
|
281
297
|
lines.push(`const result = await ${variableName}.action();`);
|
|
298
|
+
// Inline output schema for this specific operation
|
|
299
|
+
if (metadata.resultSchema) {
|
|
300
|
+
const optionSchema = this.getResultSchemaOption(metadata.resultSchema, String(operationName));
|
|
301
|
+
if (optionSchema) {
|
|
302
|
+
const outputSchemaStr = this.generateOutputSchemaString(optionSchema);
|
|
303
|
+
if (outputSchemaStr) {
|
|
304
|
+
lines.push(`// outputSchema for result.data when operation === '${String(operationName)}':`);
|
|
305
|
+
outputSchemaStr
|
|
306
|
+
.split('\n')
|
|
307
|
+
.forEach((l) => lines.push(`// ${l}`));
|
|
308
|
+
lines.push('');
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
282
312
|
}
|
|
283
313
|
}
|
|
284
314
|
}
|
|
285
315
|
});
|
|
286
316
|
// Add common result handling code once at the end
|
|
287
|
-
if (
|
|
317
|
+
if (lines.length > 0) {
|
|
288
318
|
lines.push('');
|
|
289
319
|
lines.push('// Always check success status before using data');
|
|
290
320
|
lines.push('if (!result.success) {');
|
|
291
321
|
lines.push(` throw new Error(\`${metadata.name} failed: \${result.error}\`);`);
|
|
292
322
|
lines.push('}');
|
|
293
323
|
lines.push('');
|
|
294
|
-
//
|
|
295
|
-
if (metadata.resultSchema) {
|
|
296
|
-
const outputExample = this.generateOutputExample(metadata.resultSchema);
|
|
297
|
-
if (outputExample) {
|
|
298
|
-
lines.push('// Expected output structure in result.data:');
|
|
299
|
-
lines.push(`// ${outputExample}`);
|
|
300
|
-
lines.push('');
|
|
301
|
-
}
|
|
302
|
-
}
|
|
324
|
+
// Output schema per operation is shown inline above.
|
|
303
325
|
lines.push('// Access the actual data');
|
|
304
326
|
lines.push('const actualData = result.data;');
|
|
305
327
|
lines.push('console.log(actualData);');
|
|
306
|
-
// Add note if there are more operations
|
|
307
|
-
if (options.length > maxOperations) {
|
|
308
|
-
lines.push('');
|
|
309
|
-
lines.push(`// ... and ${options.length - maxOperations} more operations available`);
|
|
310
|
-
}
|
|
311
328
|
}
|
|
312
329
|
}
|
|
313
330
|
}
|
|
@@ -336,10 +353,13 @@ export class GetBubbleDetailsTool extends ToolBubble {
|
|
|
336
353
|
lines.push('');
|
|
337
354
|
// Add output schema information
|
|
338
355
|
if (metadata.resultSchema) {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
356
|
+
// If the result is a discriminated union, show the first option
|
|
357
|
+
const optionSchema = this.getFirstResultSchemaOption(metadata.resultSchema);
|
|
358
|
+
const schemaToRender = optionSchema ?? metadata.resultSchema;
|
|
359
|
+
const outputSchemaStr = this.generateOutputSchemaString(schemaToRender);
|
|
360
|
+
if (outputSchemaStr && outputSchemaStr !== 'No output schema defined') {
|
|
361
|
+
lines.push('// outputSchema for result.data:');
|
|
362
|
+
outputSchemaStr.split('\n').forEach((l) => lines.push(`// ${l}`));
|
|
343
363
|
lines.push('');
|
|
344
364
|
}
|
|
345
365
|
}
|
|
@@ -355,30 +375,53 @@ export class GetBubbleDetailsTool extends ToolBubble {
|
|
|
355
375
|
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
356
376
|
.join(' ') + ' example');
|
|
357
377
|
}
|
|
358
|
-
generateOutputExample
|
|
378
|
+
// generateOutputExample was removed in favor of generateOutputSchemaString with per-operation rendering
|
|
379
|
+
getResultSchemaOption(resultSchema, operationName) {
|
|
359
380
|
try {
|
|
360
|
-
// Try to generate a meaningful example of the output structure
|
|
361
381
|
if (resultSchema &&
|
|
362
382
|
typeof resultSchema === 'object' &&
|
|
363
|
-
'
|
|
364
|
-
const
|
|
365
|
-
const
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
383
|
+
'_def' in resultSchema) {
|
|
384
|
+
const zodSchema = resultSchema;
|
|
385
|
+
const def = zodSchema._def;
|
|
386
|
+
if (def.typeName === 'ZodDiscriminatedUnion') {
|
|
387
|
+
const options = def.options;
|
|
388
|
+
for (const option of options) {
|
|
389
|
+
if (option && typeof option === 'object' && 'shape' in option) {
|
|
390
|
+
const shape = option.shape;
|
|
391
|
+
const discriminatorValue = shape[def.discriminator];
|
|
392
|
+
if (discriminatorValue &&
|
|
393
|
+
typeof discriminatorValue === 'object' &&
|
|
394
|
+
'_def' in discriminatorValue &&
|
|
395
|
+
discriminatorValue._def.typeName === 'ZodLiteral' &&
|
|
396
|
+
String(discriminatorValue._def.value) === operationName) {
|
|
397
|
+
return option;
|
|
375
398
|
}
|
|
376
|
-
outputFields.push(fieldLine);
|
|
377
399
|
}
|
|
378
400
|
}
|
|
379
401
|
}
|
|
380
|
-
if (
|
|
381
|
-
return
|
|
402
|
+
else if ('shape' in zodSchema) {
|
|
403
|
+
return zodSchema;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
return null;
|
|
407
|
+
}
|
|
408
|
+
catch {
|
|
409
|
+
return null;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
getFirstResultSchemaOption(resultSchema) {
|
|
413
|
+
try {
|
|
414
|
+
if (resultSchema &&
|
|
415
|
+
typeof resultSchema === 'object' &&
|
|
416
|
+
'_def' in resultSchema) {
|
|
417
|
+
const zodSchema = resultSchema;
|
|
418
|
+
const def = zodSchema._def;
|
|
419
|
+
if (def.typeName === 'ZodDiscriminatedUnion') {
|
|
420
|
+
const options = def.options;
|
|
421
|
+
return options?.[0] ?? null;
|
|
422
|
+
}
|
|
423
|
+
else if ('shape' in zodSchema) {
|
|
424
|
+
return zodSchema;
|
|
382
425
|
}
|
|
383
426
|
}
|
|
384
427
|
return null;
|
|
@@ -539,6 +582,9 @@ export class GetBubbleDetailsTool extends ToolBubble {
|
|
|
539
582
|
else if (def.typeName === 'ZodOptional') {
|
|
540
583
|
return this.generateExampleValue(def.innerType);
|
|
541
584
|
}
|
|
585
|
+
else if (def.typeName === 'ZodNullable') {
|
|
586
|
+
return this.generateExampleValue(def.innerType);
|
|
587
|
+
}
|
|
542
588
|
else if (def.typeName === 'ZodDefault') {
|
|
543
589
|
// For defaults, show the example structure of the inner type if it's complex, otherwise show default
|
|
544
590
|
const innerExample = this.generateExampleValue(def.innerType);
|