Skip to content

Commit 33f650f

Browse files
committed
fix(release): keep Firecrawl news/image search results, run pinned async versions on their own variables
1 parent 03bf275 commit 33f650f

9 files changed

Lines changed: 85 additions & 16 deletions

File tree

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,20 @@ Search for information on the web using Firecrawl
156156
| --------- | ---- | ----------- |
157157
| `data` | array | Search results data with scraped content and metadata |
158158
| ↳ `title` | string | Search result title from search engine |
159-
| ↳ `description` | string | Search result description/snippet from search engine |
159+
| ↳ `description` | string | Search result description/snippet from search engine; web results only |
160160
| ↳ `url` | string | URL of the search result |
161+
| ↳ `snippet` | string | News result snippet; news results only |
162+
| ↳ `date` | string | News publication date; news results only |
163+
| ↳ `imageUrl` | string | Image URL; image results, and news results that carry one |
164+
| ↳ `imageWidth` | number | Image width in pixels; image results only |
165+
| ↳ `imageHeight` | number | Image height in pixels; image results only |
166+
| ↳ `position` | number | Rank within its source; news and image results only |
161167
| ↳ `markdown` | string | Page content in markdown; returned only when scraping was requested via the hidden scrapeOptions input |
162168
| ↳ `html` | string | Processed HTML content; returned only when "html" is among the scrape formats requested via the hidden scrapeOptions input |
163169
| ↳ `rawHtml` | string | Unprocessed raw HTML; returned only when "rawHtml" is among the scrape formats requested via the hidden scrapeOptions input |
164170
| ↳ `links` | array | Links found on the page; returned only when "links" is among the scrape formats requested via the hidden scrapeOptions input |
165171
| ↳ `screenshot` | string | Screenshot URL \(expires after 24 hours\); returned only when "screenshot" is among the scrape formats requested via the hidden scrapeOptions input |
166-
| ↳ `metadata` | object | Metadata about the search result page |
172+
| ↳ `metadata` | object | Metadata about the search result page; web and news results only |
167173
| ↳ `title` | string | Page title |
168174
| ↳ `description` | string | Page meta description |
169175
| ↳ `sourceURL` | string | Original source URL |

‎apps/sim/app/api/cli/auth/poll/route.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { type NextRequest, NextResponse } from 'next/server'
33
import { pollCliAuthContract } from '@/lib/api/contracts'
44
import { parseRequest } from '@/lib/api/server'
55
import {
6+
apiKeyCreationErrorStatus,
67
performCreatePersonalApiKey,
78
performCreateWorkspaceApiKey,
89
} from '@/lib/api-key/orchestration'
@@ -83,7 +84,7 @@ async function mintForGrant(
8384
if (!result.success || !result.key) {
8485
return {
8586
ok: false,
86-
status: result.errorCode === 'conflict' ? 409 : 500,
87+
status: apiKeyCreationErrorStatus(result.errorCode),
8788
message: result.error ?? 'Failed to generate API key',
8889
}
8990
}

‎apps/sim/background/workflow-execution.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ export async function executeWorkflowJob(
286286
/**
287287
* The version this run executes, loaded once: the core runs this same version's
288288
* blocks, so a deploy landing mid-setup cannot pair one version's variables with
289-
* another's graph.
289+
* another's graph. A pinned version runs with only its own snapshot, as a sync run
290+
* of it does, never the editor's current variables.
290291
*/
291292
const pinnedDeploymentVersionId = payload.pinnedDeploymentVersionId
292293
const deployedState = await withDatabaseReadRetry(
@@ -328,7 +329,9 @@ export async function executeWorkflowJob(
328329
metadata,
329330
workflow,
330331
payload.input,
331-
resolveDeployedRunVariables(deployedState, workflow.variables),
332+
pinnedDeploymentVersionId
333+
? (deployedState.variables ?? {})
334+
: resolveDeployedRunVariables(deployedState, workflow.variables),
332335
[]
333336
)
334337

‎apps/sim/lib/integrations/credential-display.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { CANONICAL_SERVICE_ACCOUNT_SLUGS } from '@/lib/integrations/oauth-servic
2222
import { OAUTH_PROVIDERS } from '@/lib/oauth/oauth'
2323
import type { OAuthProvider, OAuthServiceConfig } from '@/lib/oauth/types'
2424
import { getServiceConfigByProviderId, parseProvider } from '@/lib/oauth/utils'
25+
import { resolveAccessControlBlockType } from '@/lib/permission-groups/integration-allowlist'
2526

2627
/**
2728
* Above this many covered integrations the subtitle states a count instead of
@@ -226,7 +227,7 @@ export function resolveCredentialDisplay(credential: DisplayableCredential): Cre
226227
return {
227228
service: null,
228229
integration,
229-
blockType: 'gitlab',
230+
blockType: resolveAccessControlBlockType('gitlab'),
230231
icon: GitlabIcon,
231232
familyName: null,
232233
coveredIntegrations: integration ? [integration] : [],

‎apps/sim/tools/firecrawl/search.test.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,25 @@ describe('Firecrawl v2 search results', () => {
2121
expect(result.output.creditsUsed).toBe(2)
2222
})
2323

24+
it('keeps news and image results when those sources were requested', async () => {
25+
if (!searchTool.transformResponse) throw new Error('Missing response transform')
26+
const result = await searchTool.transformResponse(
27+
jsonResponse({
28+
success: true,
29+
data: {
30+
news: [{ url: 'https://news.example.com', title: 'Story', snippet: 'A news result' }],
31+
images: [{ url: 'https://example.com/page', imageUrl: 'https://example.com/a.png' }],
32+
},
33+
creditsUsed: 2,
34+
})
35+
)
36+
37+
expect(result.output.data).toEqual([
38+
{ url: 'https://news.example.com', title: 'Story', snippet: 'A news result' },
39+
{ url: 'https://example.com/page', imageUrl: 'https://example.com/a.png' },
40+
])
41+
})
42+
2443
it('returns an empty result array when the provider finds no web results', async () => {
2544
if (!searchTool.transformResponse) throw new Error('Missing response transform')
2645
const result = await searchTool.transformResponse(

‎apps/sim/tools/firecrawl/search.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,18 @@ export const searchTool: ToolConfig<SearchParams, SearchResponse> = {
7676
},
7777

7878
transformResponse: async (response: Response) => {
79+
type SearchResults = SearchResponse['output']['data']
7980
const data: {
80-
data?: { web?: SearchResponse['output']['data'] }
81+
data?: { web?: SearchResults; news?: SearchResults; images?: SearchResults }
8182
creditsUsed?: number
8283
} = await response.json()
84+
const results = data.data ?? {}
8385

8486
return {
8587
success: true,
8688
output: {
87-
data: data.data?.web ?? [],
89+
// v2 groups results by the requested `sources`; one list keeps every source's results.
90+
data: [...(results.web ?? []), ...(results.news ?? []), ...(results.images ?? [])],
8891
creditsUsed: data.creditsUsed,
8992
},
9093
}

‎apps/sim/tools/firecrawl/types.ts‎

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ export const SEARCH_METADATA_OUTPUT_PROPERTIES = {
120120
*/
121121
export const SEARCH_METADATA_OUTPUT: OutputProperty = {
122122
type: 'object',
123-
description: 'Metadata about the search result page',
123+
description: 'Metadata about the search result page; web and news results only',
124+
optional: true,
124125
properties: SEARCH_METADATA_OUTPUT_PROPERTIES,
125126
}
126127

@@ -154,9 +155,36 @@ export const SEARCH_RESULT_OUTPUT_PROPERTIES = {
154155
title: { type: 'string', description: 'Search result title from search engine' },
155156
description: {
156157
type: 'string',
157-
description: 'Search result description/snippet from search engine',
158+
description: 'Search result description/snippet from search engine; web results only',
159+
optional: true,
158160
},
159161
url: { type: 'string', description: 'URL of the search result' },
162+
snippet: {
163+
type: 'string',
164+
description: 'News result snippet; news results only',
165+
optional: true,
166+
},
167+
date: { type: 'string', description: 'News publication date; news results only', optional: true },
168+
imageUrl: {
169+
type: 'string',
170+
description: 'Image URL; image results, and news results that carry one',
171+
optional: true,
172+
},
173+
imageWidth: {
174+
type: 'number',
175+
description: 'Image width in pixels; image results only',
176+
optional: true,
177+
},
178+
imageHeight: {
179+
type: 'number',
180+
description: 'Image height in pixels; image results only',
181+
optional: true,
182+
},
183+
position: {
184+
type: 'number',
185+
description: 'Rank within its source; news and image results only',
186+
optional: true,
187+
},
160188
markdown: {
161189
type: 'string',
162190
description:
@@ -372,16 +400,23 @@ export interface ScrapeResponse extends ToolResponse {
372400

373401
export interface SearchResponse extends ToolResponse {
374402
output: {
403+
/** Web, then news, then image results; each source fills only its own fields. */
375404
data: Array<{
376-
title: string
377-
description: string
405+
title?: string
406+
description?: string
378407
url: string
408+
snippet?: string
409+
date?: string
410+
imageUrl?: string
411+
imageWidth?: number
412+
imageHeight?: number
413+
position?: number
379414
markdown?: string
380415
html?: string
381416
rawHtml?: string
382417
links?: string[]
383418
screenshot?: string
384-
metadata: {
419+
metadata?: {
385420
title?: string
386421
description?: string
387422
sourceURL: string

‎apps/sim/tools/generated/tool-outputs.ts‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎docker/pii.Dockerfile‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ COPY --chown=pii:pii --chmod=755 docker/pii-entrypoint.sh ./
4747
# copies the image's /tmp into a bind volume mounted at a VOLUME path. The
4848
# VOLUME line stays below the model download, which stages wheels in /tmp.
4949
# tldextract (pulled in by Presidio) caches the Public Suffix List under
50-
# $HOME/.cache by default; point it at /tmp so it caches instead of
51-
# refetching the list on every start.
50+
# $HOME/.cache by default, which the read-only root cannot write; point it at
51+
# the writable /tmp volume. That volume is per task, so each task fetches the
52+
# list once.
5253
ENV PYTHONDONTWRITEBYTECODE=1 \
5354
TLDEXTRACT_CACHE=/tmp/tldextract
5455
RUN chmod 1777 /tmp

0 commit comments

Comments
 (0)