Skip to content

Commit 758e69e

Browse files
committed
fix(integrations): validate firecrawl, context.dev, apify, bright data, browser use, reducto, pulse and extend
1 parent db05a26 commit 758e69e

53 files changed

Lines changed: 582 additions & 152 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/docs/content/docs/integrations/browser_use.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ Runs a browser automation task using BrowserUse
3737
| `flashMode` | boolean | No | Enable flash mode \(faster, less careful navigation\) |
3838
| `thinking` | boolean | No | Enable extended reasoning mode |
3939
| `vision` | string | No | Vision capability: "true", "false", or "auto" |
40-
| `systemPromptExtension` | string | No | Optional text appended to the agent system prompt \(max 2000 chars\) |
40+
| `systemPromptExtension` | string | No | Optional text appended to the agent system prompt \(max 10000 chars\) |
4141
| `structuredOutput` | string | No | Stringified JSON schema for the structured output |
42-
| `highlightElements` | boolean | No | Highlight interactive elements on the page \(default true\) |
42+
| `highlightElements` | boolean | No | Highlight interactive elements on the page \(default false\) |
4343
| `metadata` | json | No | Custom key-value metadata \(up to 10 pairs\) for tracking |
4444
| `model` | string | No | LLM model identifier \(e.g. browser-use-2.0\) |
4545
| `profile_id` | string | No | Browser profile ID for persistent sessions \(cookies, login state\) |

‎apps/docs/content/docs/integrations/extend.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Parse and extract content from documents using Extend AI
4141
| `id` | string | Unique identifier for the parser run |
4242
| `status` | string | Processing status |
4343
| `chunks` | json | Parsed document content chunks |
44-
| `blocks` | json | Block-level document elements with type and content |
44+
| `blocks` | json | Top-level block elements; Extend returns blocks inside each chunk \(chunks\[\].blocks\), so this is usually empty |
4545
| `pageCount` | number | Number of pages processed |
4646
| `creditsUsed` | number | API credits consumed |
4747

‎apps/docs/content/docs/integrations/firecrawl.mdx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ Convert web pages to Markdown or HTML, including SEO metadata, Open Graph tags,
3939
| --------- | ---- | ----------- |
4040
| `markdown` | string | Page content in markdown format |
4141
| `html` | string | Raw HTML content of the page |
42+
| `rawHtml` | string | Unmodified HTML of the page, when the rawHtml format is requested |
43+
| `summary` | string | Summary of the page, when the summary format is requested |
44+
| `links` | array | Links found on the page, when the links format is requested |
45+
| `screenshot` | string | Screenshot URL of the page, when the screenshot format is requested \(expires after 24 hours\) |
4246
| `metadata` | object | Page metadata including SEO and Open Graph information |
4347
| ↳ `title` | string | Page title |
4448
| ↳ `description` | string | Page meta description |

‎apps/docs/content/docs/integrations/pulse.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Parse documents (PDF, images, Office docs) using Pulse OCR API
4343
| `markdown` | string | Extracted content in markdown format |
4444
| `page_count` | number | Number of pages in the document |
4545
| `job_id` | string | Unique job identifier |
46+
| `extraction_id` | string | Persisted extraction ID, for use with Pulse split and schema steps |
4647
| `bounding_boxes` | json | Bounding box layout information |
4748
| `extraction_url` | string | URL for extraction results \(for large documents\) |
4849
| `html` | string | HTML content; returned only when the hidden returnHtml input is enabled |

‎apps/sim/blocks/blocks/browser_use.ts‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,30 @@ export const BrowserUseBlock: BlockConfig = {
5454
options: [
5555
{ label: 'Browser Use LLM', id: 'browser-use-llm' },
5656
{ label: 'Browser Use 2.0', id: 'browser-use-2.0' },
57-
{ label: 'GPT-4o', id: 'gpt-4o' },
58-
{ label: 'GPT-4o Mini', id: 'gpt-4o-mini' },
57+
{ label: 'GPT-4o', id: 'gpt-4o', hidden: true },
58+
{ label: 'GPT-4o Mini', id: 'gpt-4o-mini', hidden: true },
59+
{ label: 'GPT-5.5', id: 'gpt-5.5' },
5960
{ label: 'GPT-4.1', id: 'gpt-4.1' },
6061
{ label: 'GPT-4.1 Mini', id: 'gpt-4.1-mini' },
6162
{ label: 'O3', id: 'o3' },
6263
{ label: 'O4 Mini', id: 'o4-mini' },
6364
{ label: 'Gemini 2.5 Flash', id: 'gemini-2.5-flash' },
6465
{ label: 'Gemini 2.5 Pro', id: 'gemini-2.5-pro' },
6566
{ label: 'Gemini 3 Pro Preview', id: 'gemini-3-pro-preview' },
67+
{ label: 'Gemini 3.1 Pro Preview', id: 'gemini-3.1-pro-preview' },
6668
{ label: 'Gemini 3 Flash Preview', id: 'gemini-3-flash-preview' },
69+
{ label: 'Gemini 3.5 Flash', id: 'gemini-3.5-flash' },
6770
{ label: 'Gemini Flash Latest', id: 'gemini-flash-latest' },
6871
{ label: 'Gemini Flash Lite Latest', id: 'gemini-flash-lite-latest' },
6972
{ label: 'Claude 3.7 Sonnet', id: 'claude-3-7-sonnet-20250219' },
7073
{ label: 'Claude Sonnet 4', id: 'claude-sonnet-4-20250514' },
7174
{ label: 'Claude Sonnet 4.5', id: 'claude-sonnet-4-5-20250929' },
72-
{ label: 'Claude Sonnet 4.6', id: 'claude-sonnet-4-6' },
75+
{ label: 'Claude Sonnet 4.6', id: 'claude-sonnet-4-6', hidden: true },
76+
{ label: 'Claude Sonnet 5', id: 'claude-sonnet-5' },
7377
{ label: 'Claude Opus 4.5', id: 'claude-opus-4-5-20251101' },
78+
{ label: 'Claude Opus 4.7', id: 'claude-opus-4-7' },
79+
{ label: 'Claude Opus 4.8', id: 'claude-opus-4-8' },
80+
{ label: 'Claude Opus 5', id: 'claude-opus-5' },
7481
{ label: 'Llama 4 Maverick', id: 'llama-4-maverick-17b-128e-instruct' },
7582
],
7683
},
@@ -130,7 +137,7 @@ export const BrowserUseBlock: BlockConfig = {
130137
id: 'systemPromptExtension',
131138
title: 'System Prompt Extension',
132139
type: 'long-input',
133-
placeholder: 'Append custom instructions to the agent system prompt (max 2000 chars)',
140+
placeholder: 'Append custom instructions to the agent system prompt (max 10000 chars)',
134141
mode: 'advanced',
135142
},
136143
{

‎apps/sim/blocks/blocks/extend.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,11 @@ export const ExtendBlock: BlockConfig = {
146146
id: { type: 'string', description: 'Unique identifier for the parser run' },
147147
status: { type: 'string', description: 'Processing status' },
148148
chunks: { type: 'json', description: 'Parsed document content chunks' },
149-
blocks: { type: 'json', description: 'Block-level document elements' },
149+
blocks: {
150+
type: 'json',
151+
description:
152+
'Top-level block elements; Extend returns blocks inside each chunk (chunks[].blocks)',
153+
},
150154
pageCount: { type: 'number', description: 'Number of pages processed' },
151155
creditsUsed: { type: 'number', description: 'API credits consumed' },
152156
},
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { describe, expect, it } from 'vitest'
2+
import { PulseV3Block } from '@/blocks/blocks/pulse'
3+
4+
const file = { name: 'report.pdf', key: 'workspace/report.pdf', url: '/api/files/serve/report.pdf' }
5+
6+
describe('PulseV3Block tool calls', () => {
7+
it('accepts the numeric chunk size an Agent tool call sends', () => {
8+
const params = PulseV3Block.tools.config?.params?.(
9+
{ file, chunkSize: 800 },
10+
{
11+
operation: 'pulse_parser_v2',
12+
}
13+
)
14+
15+
expect(params?.chunkSize).toBe(800)
16+
})
17+
})

‎apps/sim/blocks/blocks/pulse.ts‎

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ const DOCUMENT_FIELD = ['fileUpload', 'filePath'] as const
1717
/* v2 swaps the advanced URL input for a file reference, so the pair differs. */
1818
const DOCUMENT_V2_FIELD = ['fileUpload', 'fileReference'] as const
1919

20+
/** A positive chunk size from the canvas's text field or the number an Agent tool call sends. */
21+
function parseChunkSize(value: unknown): number | undefined {
22+
const size = typeof value === 'number' ? value : Number.parseInt(String(value ?? '').trim(), 10)
23+
return Number.isInteger(size) && size > 0 ? size : undefined
24+
}
25+
2026
export const PulseBlock: BlockConfig = {
2127
type: 'pulse',
2228
name: 'Pulse',
@@ -112,11 +118,9 @@ export const PulseBlock: BlockConfig = {
112118
parameters.chunking = params.chunking.trim()
113119
}
114120

115-
if (params.chunkSize && params.chunkSize.trim() !== '') {
116-
const size = Number.parseInt(params.chunkSize.trim(), 10)
117-
if (!Number.isNaN(size) && size > 0) {
118-
parameters.chunkSize = size
119-
}
121+
const chunkSize = parseChunkSize(params.chunkSize)
122+
if (chunkSize !== undefined) {
123+
parameters.chunkSize = chunkSize
120124
}
121125

122126
return parameters
@@ -140,6 +144,10 @@ export const PulseBlock: BlockConfig = {
140144
markdown: { type: 'string', description: 'Extracted content in markdown format' },
141145
page_count: { type: 'number', description: 'Number of pages in the document' },
142146
job_id: { type: 'string', description: 'Unique job identifier' },
147+
extraction_id: {
148+
type: 'string',
149+
description: 'Persisted extraction ID, for use with Pulse split and schema steps',
150+
},
143151
'plan-info': { type: 'json', description: 'Plan usage information' },
144152
bounding_boxes: { type: 'json', description: 'Bounding box layout information' },
145153
extraction_url: { type: 'string', description: 'URL for extraction results (large documents)' },
@@ -203,11 +211,9 @@ function pulseV2ToolParams(params: BlockToolParams, credentials: { apiKey?: stri
203211
parameters.chunking = params.chunking.trim()
204212
}
205213

206-
if (params.chunkSize && params.chunkSize.trim() !== '') {
207-
const size = Number.parseInt(params.chunkSize.trim(), 10)
208-
if (!Number.isNaN(size) && size > 0) {
209-
parameters.chunkSize = size
210-
}
214+
const chunkSize = parseChunkSize(params.chunkSize)
215+
if (chunkSize !== undefined) {
216+
parameters.chunkSize = chunkSize
211217
}
212218

213219
return parameters
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { describe, expect, it } from 'vitest'
2+
import { ReductoV3Block } from '@/blocks/blocks/reducto'
3+
4+
const file = { name: 'report.pdf', key: 'workspace/report.pdf', url: '/api/files/serve/report.pdf' }
5+
6+
describe('ReductoV3Block tool calls', () => {
7+
it('accepts the page array an Agent tool call sends', () => {
8+
const params = ReductoV3Block.tools.config?.params?.(
9+
{ file, pages: [1, 3] },
10+
{
11+
operation: 'reducto_parser_v2',
12+
}
13+
)
14+
15+
expect(params?.pages).toEqual([1, 3])
16+
})
17+
})

‎apps/sim/blocks/blocks/reducto.ts‎

Lines changed: 30 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { toError } from '@sim/utils/errors'
21
import { ReductoIcon } from '@/components/icons'
32
import {
43
AuthMode,
@@ -18,6 +17,30 @@ const DOCUMENT_FIELD = ['fileUpload', 'filePath'] as const
1817
/* v2 swaps the advanced URL input for a file reference, so the pair differs. */
1918
const DOCUMENT_V2_FIELD = ['fileUpload', 'fileReference'] as const
2019

20+
/**
21+
* Page numbers from the canvas's comma-separated text, or the array an Agent tool call sends.
22+
* Returns `undefined` when no page is given.
23+
*/
24+
function parsePages(value: unknown): number[] | undefined {
25+
const entries = Array.isArray(value)
26+
? value.map((page) => String(page).trim())
27+
: typeof value === 'string' || typeof value === 'number'
28+
? String(value)
29+
.split(',')
30+
.map((page) => page.trim())
31+
: []
32+
const pages = entries
33+
.filter((page) => page.length > 0)
34+
.map((page) => {
35+
const num = Number.parseInt(page, 10)
36+
if (Number.isNaN(num) || num < 0) {
37+
throw new Error(`Page number format error: Invalid page number: ${page}`)
38+
}
39+
return num
40+
})
41+
return pages.length > 0 ? pages : undefined
42+
}
43+
2144
export const ReductoBlock: BlockConfig = {
2245
type: 'reducto',
2346
name: 'Reducto',
@@ -103,32 +126,9 @@ export const ReductoBlock: BlockConfig = {
103126
parameters.filePath = documentInput.trim()
104127
}
105128

106-
let pagesArray: number[] | undefined
107-
if (params.pages && params.pages.trim() !== '') {
108-
try {
109-
pagesArray = params.pages
110-
.split(',')
111-
.map((p: string) => p.trim())
112-
.filter((p: string) => p.length > 0)
113-
.map((p: string) => {
114-
const num = Number.parseInt(p, 10)
115-
if (Number.isNaN(num) || num < 0) {
116-
throw new Error(`Invalid page number: ${p}`)
117-
}
118-
return num
119-
})
120-
121-
if (pagesArray && pagesArray.length === 0) {
122-
pagesArray = undefined
123-
}
124-
} catch (error: unknown) {
125-
const errorMessage = toError(error).message
126-
throw new Error(`Page number format error: ${errorMessage}`)
127-
}
128-
}
129-
130-
if (pagesArray && pagesArray.length > 0) {
131-
parameters.pages = pagesArray
129+
const pages = parsePages(params.pages)
130+
if (pages) {
131+
parameters.pages = pages
132132
}
133133

134134
if (params.tableOutputFormat) {
@@ -198,32 +198,9 @@ function reductoV2ToolParams(params: BlockToolParams, credentials: { apiKey?: st
198198
}
199199
parameters.file = fileInput
200200

201-
let pagesArray: number[] | undefined
202-
if (params.pages && params.pages.trim() !== '') {
203-
try {
204-
pagesArray = params.pages
205-
.split(',')
206-
.map((p: string) => p.trim())
207-
.filter((p: string) => p.length > 0)
208-
.map((p: string) => {
209-
const num = Number.parseInt(p, 10)
210-
if (Number.isNaN(num) || num < 0) {
211-
throw new Error(`Invalid page number: ${p}`)
212-
}
213-
return num
214-
})
215-
216-
if (pagesArray && pagesArray.length === 0) {
217-
pagesArray = undefined
218-
}
219-
} catch (error: unknown) {
220-
const errorMessage = toError(error).message
221-
throw new Error(`Page number format error: ${errorMessage}`)
222-
}
223-
}
224-
225-
if (pagesArray && pagesArray.length > 0) {
226-
parameters.pages = pagesArray
201+
const pages = parsePages(params.pages)
202+
if (pages) {
203+
parameters.pages = pages
227204
}
228205

229206
if (params.tableOutputFormat) {

0 commit comments

Comments
 (0)