6bf8bebf51
CI / Test and Build (push) Failing after 1s
CI / Migrate Dev DB (push) Has been skipped
CI / Migrate DB (push) Has been skipped
CodeQL / Analyze actions (push) Has been cancelled
CodeQL / Analyze javascript-typescript (push) Has been cancelled
CI / Detect Version (push) Has been cancelled
CI / Detect Desktop Changes (push) Has been cancelled
CI / Build AMD64 (blacksmith-2vcpu-ubuntu-2404, ./docker/cron.Dockerfile, ubuntu-latest, ghcr.io/simstudioai/cron) (push) Has been cancelled
CI / Build AMD64 (blacksmith-2vcpu-ubuntu-2404, ./docker/db.Dockerfile, ECR_MIGRATIONS, ubuntu-latest, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (blacksmith-4vcpu-ubuntu-2404, ./docker/pii.Dockerfile, ECR_PII, ubuntu-latest, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (blacksmith-4vcpu-ubuntu-2404, ./docker/realtime.Dockerfile, ECR_REALTIME, ubuntu-latest, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build AMD64 (blacksmith-8vcpu-ubuntu-2404, ./docker/app.Dockerfile, ECR_APP, linux-x64-8-core, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-4vcpu-ubuntu-2404-arm, ./docker/cron.Dockerfile, ubuntu-24.04-arm, ghcr.io/simstudioai/cron) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-4vcpu-ubuntu-2404-arm, ./docker/db.Dockerfile, ubuntu-24.04-arm, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-4vcpu-ubuntu-2404-arm, ./docker/pii.Dockerfile, ubuntu-24.04-arm, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-4vcpu-ubuntu-2404-arm, ./docker/realtime.Dockerfile, ubuntu-24.04-arm, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-8vcpu-ubuntu-2404-arm, ./docker/app.Dockerfile, linux-arm64-8-core, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
Helm Chart / Lint, test, and validate chart (push) Has been cancelled
Helm Chart / Chart version bumped (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
CI / Build Dev ECR (blacksmith-8vcpu-ubuntu-2404, ./docker/app.Dockerfile, ECR_APP, linux-x64-8-core) (push) Has been cancelled
CI / Promote Images (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/cron) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build Dev ECR (blacksmith-2vcpu-ubuntu-2404, ./docker/db.Dockerfile, ECR_MIGRATIONS, ubuntu-latest) (push) Has been cancelled
CI / Build Dev ECR (blacksmith-4vcpu-ubuntu-2404, ./docker/pii.Dockerfile, ECR_PII, ubuntu-latest) (push) Has been cancelled
CI / Build Dev ECR (blacksmith-4vcpu-ubuntu-2404, ./docker/realtime.Dockerfile, ECR_REALTIME, ubuntu-latest) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Check Desktop Signing Secrets (push) Has been cancelled
CI / Desktop Release (push) Has been cancelled
CI / Create Desktop Prerelease (push) Has been cancelled
CI / Desktop Prerelease Build (push) Has been cancelled
CI / Publish Desktop Prerelease (push) Has been cancelled
CI / Prune Desktop Prereleases (push) Has been cancelled
Helm Chart / Install on kind and run helm test (push) Has been cancelled
125 lines
3.4 KiB
TypeScript
125 lines
3.4 KiB
TypeScript
import { firecrawlHosting } from '@/tools/firecrawl/hosting'
|
|
import type { MapParams, MapResponse } from '@/tools/firecrawl/types'
|
|
import type { ToolConfig } from '@/tools/types'
|
|
|
|
export const mapTool: ToolConfig<MapParams, MapResponse> = {
|
|
id: 'firecrawl_map',
|
|
name: 'Firecrawl Map',
|
|
description:
|
|
'Get a complete list of URLs from any website quickly and reliably. Useful for discovering all pages on a site without crawling them.',
|
|
version: '1.0.0',
|
|
|
|
params: {
|
|
url: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-or-llm',
|
|
description: 'The base URL to map and discover links from (e.g., "https://example.com")',
|
|
},
|
|
search: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Filter results by relevance to a search term (e.g., "blog")',
|
|
},
|
|
sitemap: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-only',
|
|
description: 'Controls sitemap usage: "skip", "include" (default), or "only"',
|
|
},
|
|
includeSubdomains: {
|
|
type: 'boolean',
|
|
required: false,
|
|
visibility: 'user-only',
|
|
description: 'Whether to include URLs from subdomains (default: true)',
|
|
},
|
|
ignoreQueryParameters: {
|
|
type: 'boolean',
|
|
required: false,
|
|
visibility: 'user-only',
|
|
description: 'Exclude URLs containing query strings (default: true)',
|
|
},
|
|
limit: {
|
|
type: 'number',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description:
|
|
'Maximum number of links to return (e.g., 100, 1000, 5000). Max: 100,000, default: 5,000',
|
|
},
|
|
timeout: {
|
|
type: 'number',
|
|
required: false,
|
|
visibility: 'user-only',
|
|
description: 'Request timeout in milliseconds',
|
|
},
|
|
location: {
|
|
type: 'json',
|
|
required: false,
|
|
visibility: 'hidden',
|
|
description: 'Geographic context for proxying (country, languages)',
|
|
},
|
|
apiKey: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-only',
|
|
description: 'Firecrawl API key',
|
|
},
|
|
},
|
|
|
|
hosting: firecrawlHosting(),
|
|
|
|
request: {
|
|
method: 'POST',
|
|
url: 'https://api.firecrawl.dev/v2/map',
|
|
headers: (params) => ({
|
|
'Content-Type': 'application/json',
|
|
Authorization: `Bearer ${params.apiKey}`,
|
|
}),
|
|
body: (params) => {
|
|
const body: Record<string, any> = {
|
|
url: params.url,
|
|
}
|
|
|
|
if (params.search) body.search = params.search
|
|
if (params.sitemap) body.sitemap = params.sitemap
|
|
if (typeof params.includeSubdomains === 'boolean')
|
|
body.includeSubdomains = params.includeSubdomains
|
|
if (typeof params.ignoreQueryParameters === 'boolean')
|
|
body.ignoreQueryParameters = params.ignoreQueryParameters
|
|
if (params.limit) body.limit = Number(params.limit)
|
|
if (params.timeout) body.timeout = Number(params.timeout)
|
|
if (params.location) body.location = params.location
|
|
|
|
return body
|
|
},
|
|
},
|
|
|
|
transformResponse: async (response: Response) => {
|
|
const data = await response.json()
|
|
|
|
return {
|
|
success: data.success,
|
|
output: {
|
|
success: data.success,
|
|
links: data.links || [],
|
|
creditsUsed: 1,
|
|
},
|
|
}
|
|
},
|
|
|
|
outputs: {
|
|
success: {
|
|
type: 'boolean',
|
|
description: 'Whether the mapping operation was successful',
|
|
},
|
|
links: {
|
|
type: 'array',
|
|
description: 'Array of discovered URLs from the website',
|
|
items: {
|
|
type: 'string',
|
|
},
|
|
},
|
|
},
|
|
}
|