@bubblelab/bubble-core 0.1.0
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/LICENSE.txt +202 -0
- package/dist/bubble-bundle.d.ts +2021 -0
- package/dist/bubble-factory.d.ts +161 -0
- package/dist/bubble-factory.d.ts.map +1 -0
- package/dist/bubble-factory.js +426 -0
- package/dist/bubble-factory.js.map +1 -0
- package/dist/bubble-flow/bubble-flow-class.d.ts +19 -0
- package/dist/bubble-flow/bubble-flow-class.d.ts.map +1 -0
- package/dist/bubble-flow/bubble-flow-class.js +23 -0
- package/dist/bubble-flow/bubble-flow-class.js.map +1 -0
- package/dist/bubble-flow/sample/data-analyst-flow.d.ts +15 -0
- package/dist/bubble-flow/sample/data-analyst-flow.d.ts.map +1 -0
- package/dist/bubble-flow/sample/data-analyst-flow.js +63 -0
- package/dist/bubble-flow/sample/data-analyst-flow.js.map +1 -0
- package/dist/bubble-flow/sample/error-ts.d.ts +23 -0
- package/dist/bubble-flow/sample/error-ts.d.ts.map +1 -0
- package/dist/bubble-flow/sample/error-ts.js +31 -0
- package/dist/bubble-flow/sample/error-ts.js.map +1 -0
- package/dist/bubble-flow/sample/sanitytest.d.ts +10 -0
- package/dist/bubble-flow/sample/sanitytest.d.ts.map +1 -0
- package/dist/bubble-flow/sample/sanitytest.js +13 -0
- package/dist/bubble-flow/sample/sanitytest.js.map +1 -0
- package/dist/bubble-flow/sample/simple-webhook-2.d.ts +19 -0
- package/dist/bubble-flow/sample/simple-webhook-2.d.ts.map +1 -0
- package/dist/bubble-flow/sample/simple-webhook-2.js +23 -0
- package/dist/bubble-flow/sample/simple-webhook-2.js.map +1 -0
- package/dist/bubble-flow/sample/simple-webhook.d.ts +10 -0
- package/dist/bubble-flow/sample/simple-webhook.d.ts.map +1 -0
- package/dist/bubble-flow/sample/simple-webhook.js +18 -0
- package/dist/bubble-flow/sample/simple-webhook.js.map +1 -0
- package/dist/bubble-flow/sample/simplified-data-analysis.flow.d.ts +29 -0
- package/dist/bubble-flow/sample/simplified-data-analysis.flow.d.ts.map +1 -0
- package/dist/bubble-flow/sample/simplified-data-analysis.flow.js +150 -0
- package/dist/bubble-flow/sample/simplified-data-analysis.flow.js.map +1 -0
- package/dist/bubble-flow/sample/slack-v0.1.d.ts +10 -0
- package/dist/bubble-flow/sample/slack-v0.1.d.ts.map +1 -0
- package/dist/bubble-flow/sample/slack-v0.1.js +59 -0
- package/dist/bubble-flow/sample/slack-v0.1.js.map +1 -0
- package/dist/bubble-flow/sample/slackagenttest.d.ts +10 -0
- package/dist/bubble-flow/sample/slackagenttest.d.ts.map +1 -0
- package/dist/bubble-flow/sample/slackagenttest.js +59 -0
- package/dist/bubble-flow/sample/slackagenttest.js.map +1 -0
- package/dist/bubble-trigger/index.d.ts +2 -0
- package/dist/bubble-trigger/index.d.ts.map +1 -0
- package/dist/bubble-trigger/index.js +2 -0
- package/dist/bubble-trigger/index.js.map +1 -0
- package/dist/bubble-trigger/types.d.ts +87 -0
- package/dist/bubble-trigger/types.d.ts.map +1 -0
- package/dist/bubble-trigger/types.js +14 -0
- package/dist/bubble-trigger/types.js.map +1 -0
- package/dist/bubbles/service-bubble/ai-agent.d.ts +428 -0
- package/dist/bubbles/service-bubble/ai-agent.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/ai-agent.js +881 -0
- package/dist/bubbles/service-bubble/ai-agent.js.map +1 -0
- package/dist/bubbles/service-bubble/gmail.d.ts +3073 -0
- package/dist/bubbles/service-bubble/gmail.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/gmail.js +908 -0
- package/dist/bubbles/service-bubble/gmail.js.map +1 -0
- package/dist/bubbles/service-bubble/google-calendar.d.ts +3377 -0
- package/dist/bubbles/service-bubble/google-calendar.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/google-calendar.js +527 -0
- package/dist/bubbles/service-bubble/google-calendar.js.map +1 -0
- package/dist/bubbles/service-bubble/google-drive.d.ts +1152 -0
- package/dist/bubbles/service-bubble/google-drive.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/google-drive.js +943 -0
- package/dist/bubbles/service-bubble/google-drive.js.map +1 -0
- package/dist/bubbles/service-bubble/google-sheets.d.ts +1811 -0
- package/dist/bubbles/service-bubble/google-sheets.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/google-sheets.js +904 -0
- package/dist/bubbles/service-bubble/google-sheets.js.map +1 -0
- package/dist/bubbles/service-bubble/hello-world.d.ts +74 -0
- package/dist/bubbles/service-bubble/hello-world.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/hello-world.js +67 -0
- package/dist/bubbles/service-bubble/hello-world.js.map +1 -0
- package/dist/bubbles/service-bubble/http.d.ts +134 -0
- package/dist/bubbles/service-bubble/http.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/http.js +184 -0
- package/dist/bubbles/service-bubble/http.js.map +1 -0
- package/dist/bubbles/service-bubble/postgresql.d.ts +180 -0
- package/dist/bubbles/service-bubble/postgresql.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/postgresql.js +448 -0
- package/dist/bubbles/service-bubble/postgresql.js.map +1 -0
- package/dist/bubbles/service-bubble/resend.d.ts +301 -0
- package/dist/bubbles/service-bubble/resend.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/resend.js +253 -0
- package/dist/bubbles/service-bubble/resend.js.map +1 -0
- package/dist/bubbles/service-bubble/slack.d.ts +5869 -0
- package/dist/bubbles/service-bubble/slack.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/slack.js +1536 -0
- package/dist/bubbles/service-bubble/slack.js.map +1 -0
- package/dist/bubbles/service-bubble/storage.d.ts +571 -0
- package/dist/bubbles/service-bubble/storage.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/storage.js +504 -0
- package/dist/bubbles/service-bubble/storage.js.map +1 -0
- package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts +308 -0
- package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.js +285 -0
- package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/chart-js-tool.d.ts +416 -0
- package/dist/bubbles/tool-bubble/chart-js-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/chart-js-tool.js +570 -0
- package/dist/bubbles/tool-bubble/chart-js-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts +99 -0
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.js +645 -0
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/list-bubbles-tool.d.ts +112 -0
- package/dist/bubbles/tool-bubble/list-bubbles-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/list-bubbles-tool.js +82 -0
- package/dist/bubbles/tool-bubble/list-bubbles-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts +413 -0
- package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/reddit-scrape-tool.js +327 -0
- package/dist/bubbles/tool-bubble/reddit-scrape-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/research-agent-tool.d.ts +122 -0
- package/dist/bubbles/tool-bubble/research-agent-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/research-agent-tool.js +343 -0
- package/dist/bubbles/tool-bubble/research-agent-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/sql-query-tool.d.ts +131 -0
- package/dist/bubbles/tool-bubble/sql-query-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/sql-query-tool.js +147 -0
- package/dist/bubbles/tool-bubble/sql-query-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/tool-template.d.ts +257 -0
- package/dist/bubbles/tool-bubble/tool-template.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/tool-template.js +238 -0
- package/dist/bubbles/tool-bubble/tool-template.js.map +1 -0
- package/dist/bubbles/tool-bubble/virtual-file-editor-example.d.ts +8 -0
- package/dist/bubbles/tool-bubble/virtual-file-editor-example.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/virtual-file-editor-example.js +65 -0
- package/dist/bubbles/tool-bubble/virtual-file-editor-example.js.map +1 -0
- package/dist/bubbles/tool-bubble/virtual-file-editor.tool.d.ts +125 -0
- package/dist/bubbles/tool-bubble/virtual-file-editor.tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/virtual-file-editor.tool.js +169 -0
- package/dist/bubbles/tool-bubble/virtual-file-editor.tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts +218 -0
- package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/web-crawl-tool.js +255 -0
- package/dist/bubbles/tool-bubble/web-crawl-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/web-extract-tool.d.ts +134 -0
- package/dist/bubbles/tool-bubble/web-extract-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/web-extract-tool.js +175 -0
- package/dist/bubbles/tool-bubble/web-extract-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts +228 -0
- package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/web-scrape-tool.js +214 -0
- package/dist/bubbles/tool-bubble/web-scrape-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/web-search-tool.d.ts +134 -0
- package/dist/bubbles/tool-bubble/web-search-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/web-search-tool.js +155 -0
- package/dist/bubbles/tool-bubble/web-search-tool.js.map +1 -0
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts +114 -0
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js +777 -0
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js.map +1 -0
- package/dist/bubbles/workflow-bubble/bubblscript-generateor.workflow.d.ts +97 -0
- package/dist/bubbles/workflow-bubble/bubblscript-generateor.workflow.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/bubblscript-generateor.workflow.js +327 -0
- package/dist/bubbles/workflow-bubble/bubblscript-generateor.workflow.js.map +1 -0
- package/dist/bubbles/workflow-bubble/database-analyzer.workflow.d.ts +303 -0
- package/dist/bubbles/workflow-bubble/database-analyzer.workflow.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/database-analyzer.workflow.js +297 -0
- package/dist/bubbles/workflow-bubble/database-analyzer.workflow.js.map +1 -0
- package/dist/bubbles/workflow-bubble/file-editor-agent.workflow.d.ts +157 -0
- package/dist/bubbles/workflow-bubble/file-editor-agent.workflow.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/file-editor-agent.workflow.js +310 -0
- package/dist/bubbles/workflow-bubble/file-editor-agent.workflow.js.map +1 -0
- package/dist/bubbles/workflow-bubble/generate-document.workflow.d.ts +543 -0
- package/dist/bubbles/workflow-bubble/generate-document.workflow.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/generate-document.workflow.js +628 -0
- package/dist/bubbles/workflow-bubble/generate-document.workflow.js.map +1 -0
- package/dist/bubbles/workflow-bubble/parse-document.workflow.d.ts +679 -0
- package/dist/bubbles/workflow-bubble/parse-document.workflow.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/parse-document.workflow.js +604 -0
- package/dist/bubbles/workflow-bubble/parse-document.workflow.js.map +1 -0
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts +1011 -0
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js +841 -0
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js.map +1 -0
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts +883 -0
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.js +781 -0
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.js.map +1 -0
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts +300 -0
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js +508 -0
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js.map +1 -0
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts +731 -0
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.js +690 -0
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.js.map +1 -0
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts +401 -0
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js +382 -0
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js.map +1 -0
- package/dist/bubbles/workflow-bubble/workflow-template.d.ts +144 -0
- package/dist/bubbles/workflow-bubble/workflow-template.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/workflow-template.js +124 -0
- package/dist/bubbles/workflow-bubble/workflow-template.js.map +1 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +53 -0
- package/dist/index.js.map +1 -0
- package/dist/logging/BubbleLogger.d.ts +146 -0
- package/dist/logging/BubbleLogger.d.ts.map +1 -0
- package/dist/logging/BubbleLogger.js +472 -0
- package/dist/logging/BubbleLogger.js.map +1 -0
- package/dist/logging/StreamingBubbleLogger.d.ts +85 -0
- package/dist/logging/StreamingBubbleLogger.d.ts.map +1 -0
- package/dist/logging/StreamingBubbleLogger.js +340 -0
- package/dist/logging/StreamingBubbleLogger.js.map +1 -0
- package/dist/types/ai-models.d.ts +4 -0
- package/dist/types/ai-models.d.ts.map +1 -0
- package/dist/types/ai-models.js +14 -0
- package/dist/types/ai-models.js.map +1 -0
- package/dist/types/available-tools.d.ts +4 -0
- package/dist/types/available-tools.d.ts.map +1 -0
- package/dist/types/available-tools.js +19 -0
- package/dist/types/available-tools.js.map +1 -0
- package/dist/types/base-bubble-class.d.ts +47 -0
- package/dist/types/base-bubble-class.d.ts.map +1 -0
- package/dist/types/base-bubble-class.js +212 -0
- package/dist/types/base-bubble-class.js.map +1 -0
- package/dist/types/bubble-errors.d.ts +44 -0
- package/dist/types/bubble-errors.d.ts.map +1 -0
- package/dist/types/bubble-errors.js +51 -0
- package/dist/types/bubble-errors.js.map +1 -0
- package/dist/types/bubble.d.ts +73 -0
- package/dist/types/bubble.d.ts.map +1 -0
- package/dist/types/bubble.js +2 -0
- package/dist/types/bubble.js.map +1 -0
- package/dist/types/credentials.d.ts +6 -0
- package/dist/types/credentials.d.ts.map +1 -0
- package/dist/types/credentials.js +6 -0
- package/dist/types/credentials.js.map +1 -0
- package/dist/types/service-bubble-class.d.ts +31 -0
- package/dist/types/service-bubble-class.d.ts.map +1 -0
- package/dist/types/service-bubble-class.js +36 -0
- package/dist/types/service-bubble-class.js.map +1 -0
- package/dist/types/streaming-events.d.ts +18 -0
- package/dist/types/streaming-events.d.ts.map +1 -0
- package/dist/types/streaming-events.js +5 -0
- package/dist/types/streaming-events.js.map +1 -0
- package/dist/types/tool-bubble-class.d.ts +19 -0
- package/dist/types/tool-bubble-class.d.ts.map +1 -0
- package/dist/types/tool-bubble-class.js +48 -0
- package/dist/types/tool-bubble-class.js.map +1 -0
- package/dist/types/workflow-bubble-class.d.ts +25 -0
- package/dist/types/workflow-bubble-class.d.ts.map +1 -0
- package/dist/types/workflow-bubble-class.js +30 -0
- package/dist/types/workflow-bubble-class.js.map +1 -0
- package/dist/utils/bubbleflow-parser.d.ts +32 -0
- package/dist/utils/bubbleflow-parser.d.ts.map +1 -0
- package/dist/utils/bubbleflow-parser.js +332 -0
- package/dist/utils/bubbleflow-parser.js.map +1 -0
- package/dist/utils/bubbleflow-validation.d.ts +9 -0
- package/dist/utils/bubbleflow-validation.d.ts.map +1 -0
- package/dist/utils/bubbleflow-validation.js +116 -0
- package/dist/utils/bubbleflow-validation.js.map +1 -0
- package/dist/utils/json-parsing.d.ts +20 -0
- package/dist/utils/json-parsing.d.ts.map +1 -0
- package/dist/utils/json-parsing.js +394 -0
- package/dist/utils/json-parsing.js.map +1 -0
- package/dist/utils/mock-data-generator.d.ts +43 -0
- package/dist/utils/mock-data-generator.d.ts.map +1 -0
- package/dist/utils/mock-data-generator.js +312 -0
- package/dist/utils/mock-data-generator.js.map +1 -0
- package/dist/utils/param-helper.d.ts +2 -0
- package/dist/utils/param-helper.d.ts.map +1 -0
- package/dist/utils/param-helper.js +5 -0
- package/dist/utils/param-helper.js.map +1 -0
- package/dist/utils/source-bubble-parser.d.ts +31 -0
- package/dist/utils/source-bubble-parser.d.ts.map +1 -0
- package/dist/utils/source-bubble-parser.js +231 -0
- package/dist/utils/source-bubble-parser.js.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ToolBubble } from '../../types/tool-bubble-class.js';
|
|
3
|
+
import FirecrawlApp from '@mendable/firecrawl-js';
|
|
4
|
+
import { CredentialType } from '@bubblelab/shared-schemas';
|
|
5
|
+
import { AIAgentBubble } from '../service-bubble/ai-agent.js';
|
|
6
|
+
// Enhanced parameters schema for web crawling
|
|
7
|
+
const WebCrawlToolParamsSchema = z.object({
|
|
8
|
+
url: z
|
|
9
|
+
.string()
|
|
10
|
+
.url('Must be a valid URL')
|
|
11
|
+
.describe('The root URL to crawl and extract content from'),
|
|
12
|
+
format: z
|
|
13
|
+
.enum(['markdown'])
|
|
14
|
+
.default('markdown')
|
|
15
|
+
.describe('Output format for crawled content'),
|
|
16
|
+
onlyMainContent: z
|
|
17
|
+
.boolean()
|
|
18
|
+
.default(true)
|
|
19
|
+
.describe('Extract only main content, filtering out navigation/footers'),
|
|
20
|
+
// Crawl-specific parameters
|
|
21
|
+
maxPages: z
|
|
22
|
+
.number()
|
|
23
|
+
.min(1)
|
|
24
|
+
.max(100)
|
|
25
|
+
.default(10)
|
|
26
|
+
.optional()
|
|
27
|
+
.describe('Maximum number of pages to crawl'),
|
|
28
|
+
crawlDepth: z
|
|
29
|
+
.number()
|
|
30
|
+
.min(1)
|
|
31
|
+
.max(5)
|
|
32
|
+
.default(2)
|
|
33
|
+
.optional()
|
|
34
|
+
.describe('Maximum depth to crawl'),
|
|
35
|
+
includePaths: z
|
|
36
|
+
.array(z.string())
|
|
37
|
+
.optional()
|
|
38
|
+
.describe('URL patterns to include in crawl (regex patterns), Example: ["^/blog/.*$", "^/docs/.*$"]'),
|
|
39
|
+
excludePaths: z
|
|
40
|
+
.array(z.string())
|
|
41
|
+
.optional()
|
|
42
|
+
.describe('URL patterns to exclude from crawl (regex patterns), ["^/admin/.*$", "^/private/.*$"]'),
|
|
43
|
+
// General parameters
|
|
44
|
+
waitFor: z
|
|
45
|
+
.number()
|
|
46
|
+
.min(0)
|
|
47
|
+
.max(30000)
|
|
48
|
+
.default(3000)
|
|
49
|
+
.describe('Time to wait for dynamic content in milliseconds'),
|
|
50
|
+
credentials: z
|
|
51
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
52
|
+
.optional()
|
|
53
|
+
.describe('Required credentials including FIRECRAWL_API_KEY'),
|
|
54
|
+
});
|
|
55
|
+
// Result schema for crawl operations
|
|
56
|
+
const WebCrawlToolResultSchema = z.object({
|
|
57
|
+
url: z.string().url().describe('The original URL that was crawled'),
|
|
58
|
+
success: z.boolean().describe('Whether the crawl operation was successful'),
|
|
59
|
+
error: z.string().describe('Error message if crawl failed'),
|
|
60
|
+
// Crawl results
|
|
61
|
+
pages: z
|
|
62
|
+
.array(z.object({
|
|
63
|
+
url: z.string().url(),
|
|
64
|
+
title: z.string().optional(),
|
|
65
|
+
content: z.string(),
|
|
66
|
+
depth: z.number().optional(),
|
|
67
|
+
}))
|
|
68
|
+
.describe('Array of crawled pages with content'),
|
|
69
|
+
totalPages: z.number().describe('Total number of pages crawled'),
|
|
70
|
+
// Metadata
|
|
71
|
+
metadata: z
|
|
72
|
+
.object({
|
|
73
|
+
loadTime: z.number().optional(),
|
|
74
|
+
crawlDepth: z.number().optional(),
|
|
75
|
+
maxPagesReached: z.boolean().optional(),
|
|
76
|
+
})
|
|
77
|
+
.optional()
|
|
78
|
+
.describe('Additional metadata about the crawl operation'),
|
|
79
|
+
});
|
|
80
|
+
export class WebCrawlTool extends ToolBubble {
|
|
81
|
+
// Required static metadata
|
|
82
|
+
static bubbleName = 'web-crawl-tool';
|
|
83
|
+
static schema = WebCrawlToolParamsSchema;
|
|
84
|
+
static resultSchema = WebCrawlToolResultSchema;
|
|
85
|
+
static shortDescription = 'Multi-page web crawling tool for exploring entire websites and subdomains.';
|
|
86
|
+
static longDescription = `
|
|
87
|
+
A powerful web crawling tool that can systematically explore websites and extract content from multiple pages.
|
|
88
|
+
|
|
89
|
+
🕷️ CRAWL Features:
|
|
90
|
+
- Recursively crawl websites and subdomains
|
|
91
|
+
- Configurable crawl depth and page limits (up to 100 pages)
|
|
92
|
+
- URL pattern filtering (include/exclude paths)
|
|
93
|
+
- Multiple format support (markdown, html, links, rawHtml)
|
|
94
|
+
- Main content focus filtering
|
|
95
|
+
- Discover and extract content from entire sites
|
|
96
|
+
|
|
97
|
+
Technical Features:
|
|
98
|
+
- Handles JavaScript-rendered pages and dynamic content
|
|
99
|
+
- Robust error handling and retry mechanisms
|
|
100
|
+
- Configurable wait times for dynamic content
|
|
101
|
+
- Requires FIRECRAWL_API_KEY credential
|
|
102
|
+
|
|
103
|
+
Use Cases:
|
|
104
|
+
- Site mapping and competitive analysis
|
|
105
|
+
- Documentation aggregation across multiple pages
|
|
106
|
+
- Content analysis and research across domains
|
|
107
|
+
- SEO analysis and site structure discovery
|
|
108
|
+
- Building comprehensive datasets from websites
|
|
109
|
+
`;
|
|
110
|
+
static alias = 'crawl';
|
|
111
|
+
static type = 'tool';
|
|
112
|
+
constructor(params = { url: '' }, context) {
|
|
113
|
+
super(params, context);
|
|
114
|
+
}
|
|
115
|
+
async performAction(context) {
|
|
116
|
+
void context; // Context available but not currently used
|
|
117
|
+
const { url } = this.params;
|
|
118
|
+
const startTime = Date.now();
|
|
119
|
+
try {
|
|
120
|
+
// Get Firecrawl API key from credentials
|
|
121
|
+
const apiKey = this.params.credentials?.FIRECRAWL_API_KEY;
|
|
122
|
+
if (!apiKey) {
|
|
123
|
+
throw new Error('FIRECRAWL_API_KEY is required but not provided in credentials');
|
|
124
|
+
}
|
|
125
|
+
// Initialize Firecrawl client
|
|
126
|
+
const firecrawl = new FirecrawlApp({ apiKey });
|
|
127
|
+
console.log(`[WebCrawlTool] Starting crawl for URL:`, url);
|
|
128
|
+
const crawlResult = await this.executeCrawl(firecrawl, startTime);
|
|
129
|
+
// Process pages in batches of 5 for parallel summarization
|
|
130
|
+
const batchSize = 5;
|
|
131
|
+
const pageCount = crawlResult.pages.length;
|
|
132
|
+
for (let batchStart = 0; batchStart < pageCount; batchStart += batchSize) {
|
|
133
|
+
const batchEnd = Math.min(batchStart + batchSize, pageCount);
|
|
134
|
+
const batch = crawlResult.pages.slice(batchStart, batchEnd);
|
|
135
|
+
// Create promises for parallel processing
|
|
136
|
+
const summarizePromises = batch.map(async (page, batchIndex) => {
|
|
137
|
+
const summarizeAgent = new AIAgentBubble({
|
|
138
|
+
message: `Summarize the crawled page to condense all information and remove any non-essential information, include all links, contact information, companies, don't omit any information. Content: ${page.content}`,
|
|
139
|
+
model: {
|
|
140
|
+
model: 'google/gemini-2.5-flash-lite',
|
|
141
|
+
},
|
|
142
|
+
name: 'Crawl Page Summarizer Agent',
|
|
143
|
+
credentials: this.params.credentials,
|
|
144
|
+
}, this.context);
|
|
145
|
+
try {
|
|
146
|
+
const result = await summarizeAgent.action();
|
|
147
|
+
console.log('[WebCrawlTool] Summarized page content for:', page.url, result.data?.response);
|
|
148
|
+
return {
|
|
149
|
+
index: batchStart + batchIndex,
|
|
150
|
+
url: page.url,
|
|
151
|
+
title: page.title,
|
|
152
|
+
content: result.data?.response,
|
|
153
|
+
depth: page.depth,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
catch (error) {
|
|
157
|
+
console.error('[WebCrawlTool] Error summarizing page:', page.url, error);
|
|
158
|
+
return {
|
|
159
|
+
index: batchStart + batchIndex,
|
|
160
|
+
url: page.url,
|
|
161
|
+
title: page.title,
|
|
162
|
+
content: page.content, // Keep original content if summarization fails
|
|
163
|
+
depth: page.depth,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
// Wait for all promises in this batch to complete
|
|
168
|
+
const batchResults = await Promise.all(summarizePromises);
|
|
169
|
+
// Update the original pages array with summarized content
|
|
170
|
+
batchResults.forEach((result) => {
|
|
171
|
+
crawlResult.pages[result.index] = {
|
|
172
|
+
url: result.url,
|
|
173
|
+
title: result.title,
|
|
174
|
+
content: result.content,
|
|
175
|
+
depth: result.depth,
|
|
176
|
+
};
|
|
177
|
+
});
|
|
178
|
+
console.log(`[WebCrawlTool] Completed batch ${Math.floor(batchStart / batchSize) + 1} of ${Math.ceil(pageCount / batchSize)}`);
|
|
179
|
+
}
|
|
180
|
+
return crawlResult;
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
console.error(`[WebCrawlTool] Crawl error:`, error);
|
|
184
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
185
|
+
return {
|
|
186
|
+
url,
|
|
187
|
+
success: false,
|
|
188
|
+
error: errorMessage,
|
|
189
|
+
pages: [],
|
|
190
|
+
totalPages: 0,
|
|
191
|
+
metadata: {
|
|
192
|
+
loadTime: Date.now() - startTime,
|
|
193
|
+
},
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Execute crawl operation - multi-page site exploration
|
|
199
|
+
*/
|
|
200
|
+
async executeCrawl(firecrawl, startTime) {
|
|
201
|
+
const { url, format, onlyMainContent, maxPages, crawlDepth, includePaths, excludePaths, } = this.params;
|
|
202
|
+
// Configure crawling options
|
|
203
|
+
const crawlOptions = {
|
|
204
|
+
limit: maxPages || 10,
|
|
205
|
+
maxDepth: crawlDepth || 2,
|
|
206
|
+
};
|
|
207
|
+
// Add URL filtering if specified
|
|
208
|
+
if (includePaths && includePaths.length > 0) {
|
|
209
|
+
crawlOptions.includePaths = includePaths;
|
|
210
|
+
}
|
|
211
|
+
if (excludePaths && excludePaths.length > 0) {
|
|
212
|
+
crawlOptions.excludePaths = excludePaths;
|
|
213
|
+
}
|
|
214
|
+
console.log('[WebCrawlTool] Crawling with options:', crawlOptions);
|
|
215
|
+
// Execute crawl
|
|
216
|
+
const response = await firecrawl.crawl(url, {
|
|
217
|
+
...crawlOptions,
|
|
218
|
+
scrapeOptions: {
|
|
219
|
+
formats: [format],
|
|
220
|
+
onlyMainContent,
|
|
221
|
+
removeBase64Images: true,
|
|
222
|
+
},
|
|
223
|
+
});
|
|
224
|
+
// Process crawled pages
|
|
225
|
+
const pages = [];
|
|
226
|
+
// Handle different response structures
|
|
227
|
+
const crawlData = response.completed ? response.data : [];
|
|
228
|
+
for (const page of crawlData) {
|
|
229
|
+
let content = '';
|
|
230
|
+
// Extract content based on format
|
|
231
|
+
if (format === 'markdown' && page.markdown) {
|
|
232
|
+
content = page.markdown;
|
|
233
|
+
}
|
|
234
|
+
pages.push({
|
|
235
|
+
url: page.metadata?.sourceURL || '',
|
|
236
|
+
title: page.metadata?.title || '',
|
|
237
|
+
content: content.trim(),
|
|
238
|
+
depth: page.metadata?.depth,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
return {
|
|
242
|
+
url,
|
|
243
|
+
pages,
|
|
244
|
+
totalPages: pages.length,
|
|
245
|
+
success: true,
|
|
246
|
+
error: '',
|
|
247
|
+
metadata: {
|
|
248
|
+
loadTime: Date.now() - startTime,
|
|
249
|
+
crawlDepth: crawlDepth || 2,
|
|
250
|
+
maxPagesReached: pages.length >= (maxPages || 10),
|
|
251
|
+
},
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
//# sourceMappingURL=web-crawl-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-crawl-tool.js","sourceRoot":"","sources":["../../../src/bubbles/tool-bubble/web-crawl-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAmB,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,8CAA8C;AAC9C,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,GAAG,EAAE,CAAC;SACH,MAAM,EAAE;SACR,GAAG,CAAC,qBAAqB,CAAC;SAC1B,QAAQ,CAAC,gDAAgD,CAAC;IAC7D,MAAM,EAAE,CAAC;SACN,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC;SAClB,OAAO,CAAC,UAAU,CAAC;SACnB,QAAQ,CAAC,mCAAmC,CAAC;IAChD,eAAe,EAAE,CAAC;SACf,OAAO,EAAE;SACT,OAAO,CAAC,IAAI,CAAC;SACb,QAAQ,CAAC,6DAA6D,CAAC;IAE1E,4BAA4B;IAC5B,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,OAAO,CAAC,EAAE,CA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AI,CAAC,GAAG,EAAE,GAAG,SAAS;gBAChC,UAAU,EAAE,UAAU,IAAI,CAAC;gBAC3B,eAAe,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;aAClD;SACF,CAAC;IACJ,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ToolBubble } from '../../types/tool-bubble-class.js';
|
|
3
|
+
import type { BubbleContext } from '../../types/bubble.js';
|
|
4
|
+
import { CredentialType, type BubbleName } from '@bubblelab/shared-schemas';
|
|
5
|
+
declare const WebExtractToolParamsSchema: z.ZodObject<{
|
|
6
|
+
url: z.ZodString;
|
|
7
|
+
prompt: z.ZodString;
|
|
8
|
+
schema: z.ZodString;
|
|
9
|
+
timeout: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
10
|
+
credentials: z.ZodOptional<z.ZodRecord<z.ZodNativeEnum<typeof CredentialType>, z.ZodString>>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
schema: string;
|
|
13
|
+
url: string;
|
|
14
|
+
prompt: string;
|
|
15
|
+
credentials?: Partial<Record<CredentialType, string>> | undefined;
|
|
16
|
+
timeout?: number | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
schema: string;
|
|
19
|
+
url: string;
|
|
20
|
+
prompt: string;
|
|
21
|
+
credentials?: Partial<Record<CredentialType, string>> | undefined;
|
|
22
|
+
timeout?: number | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
declare const WebExtractToolResultSchema: z.ZodObject<{
|
|
25
|
+
url: z.ZodString;
|
|
26
|
+
success: z.ZodBoolean;
|
|
27
|
+
error: z.ZodString;
|
|
28
|
+
extractedData: z.ZodAny;
|
|
29
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
30
|
+
extractionTime: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
pageTitle: z.ZodOptional<z.ZodString>;
|
|
32
|
+
statusCode: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
statusCode?: number | undefined;
|
|
35
|
+
extractionTime?: number | undefined;
|
|
36
|
+
pageTitle?: string | undefined;
|
|
37
|
+
}, {
|
|
38
|
+
statusCode?: number | undefined;
|
|
39
|
+
extractionTime?: number | undefined;
|
|
40
|
+
pageTitle?: string | undefined;
|
|
41
|
+
}>>;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
success: boolean;
|
|
44
|
+
error: string;
|
|
45
|
+
url: string;
|
|
46
|
+
metadata?: {
|
|
47
|
+
statusCode?: number | undefined;
|
|
48
|
+
extractionTime?: number | undefined;
|
|
49
|
+
pageTitle?: string | undefined;
|
|
50
|
+
} | undefined;
|
|
51
|
+
extractedData?: any;
|
|
52
|
+
}, {
|
|
53
|
+
success: boolean;
|
|
54
|
+
error: string;
|
|
55
|
+
url: string;
|
|
56
|
+
metadata?: {
|
|
57
|
+
statusCode?: number | undefined;
|
|
58
|
+
extractionTime?: number | undefined;
|
|
59
|
+
pageTitle?: string | undefined;
|
|
60
|
+
} | undefined;
|
|
61
|
+
extractedData?: any;
|
|
62
|
+
}>;
|
|
63
|
+
type WebExtractToolParams = z.output<typeof WebExtractToolParamsSchema>;
|
|
64
|
+
type WebExtractToolResult = z.output<typeof WebExtractToolResultSchema>;
|
|
65
|
+
type WebExtractToolParamsInput = z.input<typeof WebExtractToolParamsSchema>;
|
|
66
|
+
export declare class WebExtractTool extends ToolBubble<WebExtractToolParams, WebExtractToolResult> {
|
|
67
|
+
static readonly bubbleName: BubbleName;
|
|
68
|
+
static readonly schema: z.ZodObject<{
|
|
69
|
+
url: z.ZodString;
|
|
70
|
+
prompt: z.ZodString;
|
|
71
|
+
schema: z.ZodString;
|
|
72
|
+
timeout: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
73
|
+
credentials: z.ZodOptional<z.ZodRecord<z.ZodNativeEnum<typeof CredentialType>, z.ZodString>>;
|
|
74
|
+
}, "strip", z.ZodTypeAny, {
|
|
75
|
+
schema: string;
|
|
76
|
+
url: string;
|
|
77
|
+
prompt: string;
|
|
78
|
+
credentials?: Partial<Record<CredentialType, string>> | undefined;
|
|
79
|
+
timeout?: number | undefined;
|
|
80
|
+
}, {
|
|
81
|
+
schema: string;
|
|
82
|
+
url: string;
|
|
83
|
+
prompt: string;
|
|
84
|
+
credentials?: Partial<Record<CredentialType, string>> | undefined;
|
|
85
|
+
timeout?: number | undefined;
|
|
86
|
+
}>;
|
|
87
|
+
static readonly resultSchema: z.ZodObject<{
|
|
88
|
+
url: z.ZodString;
|
|
89
|
+
success: z.ZodBoolean;
|
|
90
|
+
error: z.ZodString;
|
|
91
|
+
extractedData: z.ZodAny;
|
|
92
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
93
|
+
extractionTime: z.ZodOptional<z.ZodNumber>;
|
|
94
|
+
pageTitle: z.ZodOptional<z.ZodString>;
|
|
95
|
+
statusCode: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
statusCode?: number | undefined;
|
|
98
|
+
extractionTime?: number | undefined;
|
|
99
|
+
pageTitle?: string | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
statusCode?: number | undefined;
|
|
102
|
+
extractionTime?: number | undefined;
|
|
103
|
+
pageTitle?: string | undefined;
|
|
104
|
+
}>>;
|
|
105
|
+
}, "strip", z.ZodTypeAny, {
|
|
106
|
+
success: boolean;
|
|
107
|
+
error: string;
|
|
108
|
+
url: string;
|
|
109
|
+
metadata?: {
|
|
110
|
+
statusCode?: number | undefined;
|
|
111
|
+
extractionTime?: number | undefined;
|
|
112
|
+
pageTitle?: string | undefined;
|
|
113
|
+
} | undefined;
|
|
114
|
+
extractedData?: any;
|
|
115
|
+
}, {
|
|
116
|
+
success: boolean;
|
|
117
|
+
error: string;
|
|
118
|
+
url: string;
|
|
119
|
+
metadata?: {
|
|
120
|
+
statusCode?: number | undefined;
|
|
121
|
+
extractionTime?: number | undefined;
|
|
122
|
+
pageTitle?: string | undefined;
|
|
123
|
+
} | undefined;
|
|
124
|
+
extractedData?: any;
|
|
125
|
+
}>;
|
|
126
|
+
static readonly shortDescription = "Extracts structured data from web pages using Firecrawl AI-powered extraction with custom prompts and schemas";
|
|
127
|
+
static readonly longDescription = "\n A powerful web data extraction tool that uses Firecrawl's AI-powered extraction API to extract structured data from web pages.\n \n \uD83C\uDFAF EXTRACT Features:\n - AI-powered structured data extraction using natural language prompts\n - Custom JSON schema validation for extracted data\n - Handles dynamic content and JavaScript-rendered pages\n - Precise extraction of specific elements like images, prices, descriptions\n - Works with complex e-commerce sites and product pages\n - Requires FIRECRAWL_API_KEY credential\n \n Use Cases:\n - Extract product information (names, prices, images) from e-commerce sites\n - Gather structured data from listings and catalogs\n - Extract contact information and business details\n - Parse article metadata and content structure\n - Collect specific data points from forms and tables\n - Extract image URLs, especially for product galleries\n \n How it works:\n 1. Provide a URL and a natural language prompt describing what to extract\n 2. Define a JSON schema for the expected data structure\n 3. Firecrawl's AI analyzes the page and extracts matching data\n 4. Returns structured data validated against your schema\n \n Example use case:\n - URL: Uniqlo product page\n - Prompt: \"Extract the product name, price, and all available product image URLs\"\n - Schema: {\"name\": \"string\", \"price\": \"number\", \"images\": [\"string\"]}\n - Result: Structured JSON with the exact data you need\n ";
|
|
128
|
+
static readonly alias = "extract";
|
|
129
|
+
static readonly type = "tool";
|
|
130
|
+
constructor(params?: WebExtractToolParamsInput, context?: BubbleContext);
|
|
131
|
+
performAction(context?: BubbleContext): Promise<WebExtractToolResult>;
|
|
132
|
+
}
|
|
133
|
+
export {};
|
|
134
|
+
//# sourceMappingURL=web-extract-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-extract-tool.d.ts","sourceRoot":"","sources":["../../../src/bubbles/tool-bubble/web-extract-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAA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
2
|
+
import { ToolBubble } from '../../types/tool-bubble-class.js';
|
|
3
|
+
import Firecrawl from '@mendable/firecrawl-js';
|
|
4
|
+
import { CredentialType } from '@bubblelab/shared-schemas';
|
|
5
|
+
// Parameters schema for web extraction
|
|
6
|
+
const WebExtractToolParamsSchema = z.object({
|
|
7
|
+
url: z
|
|
8
|
+
.string()
|
|
9
|
+
.url('Must be a valid URL')
|
|
10
|
+
.describe('The URL to extract structured data from'),
|
|
11
|
+
prompt: z
|
|
12
|
+
.string()
|
|
13
|
+
.min(1, 'Extraction prompt is required')
|
|
14
|
+
.describe('Detailed prompt describing what data to extract from the web page'),
|
|
15
|
+
schema: z
|
|
16
|
+
.string()
|
|
17
|
+
.min(1, 'JSON schema is required')
|
|
18
|
+
.describe('JSON schema string defining the structure of the data to extract'),
|
|
19
|
+
timeout: z
|
|
20
|
+
.number()
|
|
21
|
+
.min(1000)
|
|
22
|
+
.max(60000)
|
|
23
|
+
.default(30000)
|
|
24
|
+
.optional()
|
|
25
|
+
.describe('Timeout in milliseconds for the extraction (default: 30000)'),
|
|
26
|
+
credentials: z
|
|
27
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
28
|
+
.optional()
|
|
29
|
+
.describe('Required credentials including FIRECRAWL_API_KEY'),
|
|
30
|
+
});
|
|
31
|
+
// Result schema for extraction operations
|
|
32
|
+
const WebExtractToolResultSchema = z.object({
|
|
33
|
+
url: z.string().url().describe('The original URL that was processed'),
|
|
34
|
+
success: z.boolean().describe('Whether the extraction was successful'),
|
|
35
|
+
error: z.string().describe('Error message if extraction failed'),
|
|
36
|
+
extractedData: z
|
|
37
|
+
.any()
|
|
38
|
+
.describe('The extracted structured data matching the provided schema'),
|
|
39
|
+
metadata: z
|
|
40
|
+
.object({
|
|
41
|
+
extractionTime: z.number().optional(),
|
|
42
|
+
pageTitle: z.string().optional(),
|
|
43
|
+
statusCode: z.number().optional(),
|
|
44
|
+
})
|
|
45
|
+
.optional()
|
|
46
|
+
.describe('Additional metadata about the extraction'),
|
|
47
|
+
});
|
|
48
|
+
export class WebExtractTool extends ToolBubble {
|
|
49
|
+
// Required static metadata
|
|
50
|
+
static bubbleName = 'web-extract-tool';
|
|
51
|
+
static schema = WebExtractToolParamsSchema;
|
|
52
|
+
static resultSchema = WebExtractToolResultSchema;
|
|
53
|
+
static shortDescription = 'Extracts structured data from web pages using Firecrawl AI-powered extraction with custom prompts and schemas';
|
|
54
|
+
static longDescription = `
|
|
55
|
+
A powerful web data extraction tool that uses Firecrawl's AI-powered extraction API to extract structured data from web pages.
|
|
56
|
+
|
|
57
|
+
🎯 EXTRACT Features:
|
|
58
|
+
- AI-powered structured data extraction using natural language prompts
|
|
59
|
+
- Custom JSON schema validation for extracted data
|
|
60
|
+
- Handles dynamic content and JavaScript-rendered pages
|
|
61
|
+
- Precise extraction of specific elements like images, prices, descriptions
|
|
62
|
+
- Works with complex e-commerce sites and product pages
|
|
63
|
+
- Requires FIRECRAWL_API_KEY credential
|
|
64
|
+
|
|
65
|
+
Use Cases:
|
|
66
|
+
- Extract product information (names, prices, images) from e-commerce sites
|
|
67
|
+
- Gather structured data from listings and catalogs
|
|
68
|
+
- Extract contact information and business details
|
|
69
|
+
- Parse article metadata and content structure
|
|
70
|
+
- Collect specific data points from forms and tables
|
|
71
|
+
- Extract image URLs, especially for product galleries
|
|
72
|
+
|
|
73
|
+
How it works:
|
|
74
|
+
1. Provide a URL and a natural language prompt describing what to extract
|
|
75
|
+
2. Define a JSON schema for the expected data structure
|
|
76
|
+
3. Firecrawl's AI analyzes the page and extracts matching data
|
|
77
|
+
4. Returns structured data validated against your schema
|
|
78
|
+
|
|
79
|
+
Example use case:
|
|
80
|
+
- URL: Uniqlo product page
|
|
81
|
+
- Prompt: "Extract the product name, price, and all available product image URLs"
|
|
82
|
+
- Schema: {"name": "string", "price": "number", "images": ["string"]}
|
|
83
|
+
- Result: Structured JSON with the exact data you need
|
|
84
|
+
`;
|
|
85
|
+
static alias = 'extract';
|
|
86
|
+
static type = 'tool';
|
|
87
|
+
constructor(params = {
|
|
88
|
+
url: '',
|
|
89
|
+
prompt: '',
|
|
90
|
+
schema: '{}',
|
|
91
|
+
}, context) {
|
|
92
|
+
super(params, context);
|
|
93
|
+
}
|
|
94
|
+
async performAction(context) {
|
|
95
|
+
void context; // Context available but not currently used
|
|
96
|
+
const { url, prompt, schema, timeout } = this.params;
|
|
97
|
+
const startTime = Date.now();
|
|
98
|
+
try {
|
|
99
|
+
// Get Firecrawl API key from credentials
|
|
100
|
+
const apiKey = this.params.credentials?.FIRECRAWL_API_KEY;
|
|
101
|
+
if (!apiKey) {
|
|
102
|
+
throw new Error('FIRECRAWL_API_KEY is required but not provided in credentials');
|
|
103
|
+
}
|
|
104
|
+
// Initialize Firecrawl client
|
|
105
|
+
const firecrawl = new Firecrawl({ apiKey });
|
|
106
|
+
console.log('[WebExtractTool] Extracting data from URL:', url);
|
|
107
|
+
console.log('[WebExtractTool] Using prompt:', prompt.substring(0, 100) + '...');
|
|
108
|
+
console.log('[WebExtractTool] Expected schema:', schema.substring(0, 200) + '...');
|
|
109
|
+
// Validate and parse the JSON schema
|
|
110
|
+
let parsedSchema;
|
|
111
|
+
try {
|
|
112
|
+
parsedSchema = JSON.parse(schema);
|
|
113
|
+
}
|
|
114
|
+
catch (parseError) {
|
|
115
|
+
throw new Error(`Invalid JSON schema provided: ${parseError instanceof Error ? parseError.message : 'Unknown parsing error'}`);
|
|
116
|
+
}
|
|
117
|
+
// Configure extraction options
|
|
118
|
+
const extractOptions = {
|
|
119
|
+
urls: [url],
|
|
120
|
+
prompt,
|
|
121
|
+
schema: parsedSchema,
|
|
122
|
+
timeout: timeout ? timeout / 1000 : 30, // Convert to seconds
|
|
123
|
+
};
|
|
124
|
+
// Execute extraction
|
|
125
|
+
const response = await firecrawl.extract(extractOptions);
|
|
126
|
+
// Handle the response
|
|
127
|
+
if (!response || typeof response !== 'object') {
|
|
128
|
+
throw new Error('Invalid response from Firecrawl extract API');
|
|
129
|
+
}
|
|
130
|
+
// Check if extraction was successful
|
|
131
|
+
if (response.success === false || response.status === 'failed') {
|
|
132
|
+
throw new Error(response.error || 'Extraction failed');
|
|
133
|
+
}
|
|
134
|
+
// Extract the data from the response
|
|
135
|
+
let extractedData = {};
|
|
136
|
+
if (response.data) {
|
|
137
|
+
extractedData = response.data;
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
throw new Error('No data returned from extraction');
|
|
141
|
+
}
|
|
142
|
+
const extractionTime = Date.now() - startTime;
|
|
143
|
+
// Extract metadata if available
|
|
144
|
+
const metadata = {
|
|
145
|
+
extractionTime,
|
|
146
|
+
};
|
|
147
|
+
if (response.sources) {
|
|
148
|
+
metadata.sources = response.sources;
|
|
149
|
+
}
|
|
150
|
+
console.log('[WebExtractTool] Successfully extracted data from:', url);
|
|
151
|
+
console.log('[WebExtractTool] Extraction time:', extractionTime, 'ms');
|
|
152
|
+
return {
|
|
153
|
+
url,
|
|
154
|
+
success: true,
|
|
155
|
+
error: '',
|
|
156
|
+
extractedData,
|
|
157
|
+
metadata,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
catch (error) {
|
|
161
|
+
console.error('[WebExtractTool] Extraction error:', error);
|
|
162
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
163
|
+
return {
|
|
164
|
+
url,
|
|
165
|
+
success: false,
|
|
166
|
+
error: errorMessage,
|
|
167
|
+
extractedData: {},
|
|
168
|
+
metadata: {
|
|
169
|
+
extractionTime: Date.now() - startTime,
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=web-extract-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-extract-tool.js","sourceRoot":"","sources":["../../../src/bubbles/tool-bubble/web-extract-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAA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