mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-09 15:07:55 -05:00
* feat(triggers): added new trigger mode for blocks, added socket event, ran migrations * Rename old trigger/ directory to background/ * cleaned up, ensured that we display active webhook at the block-level * fix submenu in tag dropdown * keyboard nav on tag dropdown submenu * feat(triggers): add outlook to new triggers system * cleanup * add types to tag dropdown, type all outputs for tools and use that over block outputs * update doc generator to truly reflect outputs * fix docs * add trigger handler * fix active webhook tag * tag dropdown fix for triggers * remove trigger mode schema change * feat(execution-filesystem): system to pass files between blocks (#866) * feat(files): pass files between blocks * presigned URL for downloads * Remove latest migration before merge * starter block file upload wasn't getting logged * checkpoint in human readable form * checkpoint files / file type outputs * file downloads working for block outputs * checkpoint file download * fix type issues * remove filereference interface with simpler user file interface * show files in the tag dropdown for start block * more migration to simple url object, reduce presigned time to 5 min * Remove migration 0065_parallel_nightmare and related files - Deleted apps/sim/db/migrations/0065_parallel_nightmare.sql - Deleted apps/sim/db/migrations/meta/0065_snapshot.json - Removed 0065 entry from apps/sim/db/migrations/meta/_journal.json Preparing for merge with origin/staging and migration regeneration * add migration files * fix tests * Update apps/sim/lib/uploads/setup.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update apps/sim/lib/workflows/execution-file-storage.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update apps/sim/lib/workflows/execution-file-storage.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * cleanup types * fix lint * fix logs typing for file refs * open download in new tab * fixed * Update apps/sim/tools/index.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix file block * cleanup unused code * fix bugs * remove hacky file id logic * fix drag and drop * fix tests --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * feat(trigger-mode): added trigger-mode to workflow_blocks table (#902) * fix(schedules-perms): use regular perm system to view/edit schedule info (#901) * fix(schedules-perms): use regular perm system to view schedule info * fix perms * improve logging * cleanup * prevent tooltip showing up on modal open * updated trigger config * fix type issues --------- Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Vikhyath Mondreti <vikhyath@simstudio.ai>
135 lines
3.8 KiB
TypeScript
135 lines
3.8 KiB
TypeScript
import { FirecrawlIcon } from '@/components/icons'
|
|
import type { BlockConfig } from '@/blocks/types'
|
|
import type { FirecrawlResponse } from '@/tools/firecrawl/types'
|
|
|
|
export const FirecrawlBlock: BlockConfig<FirecrawlResponse> = {
|
|
type: 'firecrawl',
|
|
name: 'Firecrawl',
|
|
description: 'Scrape or search the web',
|
|
longDescription:
|
|
'Extract content from any website with advanced web scraping or search the web for information. Retrieve clean, structured data from web pages with options to focus on main content, or intelligently search for information across the web.',
|
|
docsLink: 'https://docs.sim.ai/tools/firecrawl',
|
|
category: 'tools',
|
|
bgColor: '#181C1E',
|
|
icon: FirecrawlIcon,
|
|
subBlocks: [
|
|
{
|
|
id: 'operation',
|
|
title: 'Operation',
|
|
type: 'dropdown',
|
|
layout: 'full',
|
|
options: [
|
|
{ label: 'Scrape', id: 'scrape' },
|
|
{ label: 'Search', id: 'search' },
|
|
{ label: 'Crawl', id: 'crawl' },
|
|
],
|
|
value: () => 'scrape',
|
|
},
|
|
{
|
|
id: 'url',
|
|
title: 'Website URL',
|
|
type: 'short-input',
|
|
layout: 'full',
|
|
placeholder: 'Enter the website URL',
|
|
condition: {
|
|
field: 'operation',
|
|
value: ['scrape', 'crawl'],
|
|
},
|
|
required: true,
|
|
},
|
|
{
|
|
id: 'onlyMainContent',
|
|
title: 'Only Main Content',
|
|
type: 'switch',
|
|
layout: 'half',
|
|
condition: {
|
|
field: 'operation',
|
|
value: 'scrape',
|
|
},
|
|
},
|
|
{
|
|
id: 'limit',
|
|
title: 'Page Limit',
|
|
type: 'short-input',
|
|
layout: 'half',
|
|
placeholder: '100',
|
|
condition: {
|
|
field: 'operation',
|
|
value: 'crawl',
|
|
},
|
|
},
|
|
{
|
|
id: 'query',
|
|
title: 'Search Query',
|
|
type: 'short-input',
|
|
layout: 'full',
|
|
placeholder: 'Enter the search query',
|
|
condition: {
|
|
field: 'operation',
|
|
value: 'search',
|
|
},
|
|
required: true,
|
|
},
|
|
{
|
|
id: 'apiKey',
|
|
title: 'API Key',
|
|
type: 'short-input',
|
|
layout: 'full',
|
|
placeholder: 'Enter your Firecrawl API key',
|
|
password: true,
|
|
required: true,
|
|
},
|
|
],
|
|
tools: {
|
|
access: ['firecrawl_scrape', 'firecrawl_search', 'firecrawl_crawl'],
|
|
config: {
|
|
tool: (params) => {
|
|
switch (params.operation) {
|
|
case 'scrape':
|
|
return 'firecrawl_scrape'
|
|
case 'search':
|
|
return 'firecrawl_search'
|
|
case 'crawl':
|
|
return 'firecrawl_crawl'
|
|
default:
|
|
return 'firecrawl_scrape'
|
|
}
|
|
},
|
|
params: (params) => {
|
|
const { operation, limit, ...rest } = params
|
|
|
|
switch (operation) {
|
|
case 'crawl':
|
|
return {
|
|
...rest,
|
|
limit: limit ? Number.parseInt(limit) : undefined,
|
|
}
|
|
default:
|
|
return rest
|
|
}
|
|
},
|
|
},
|
|
},
|
|
inputs: {
|
|
apiKey: { type: 'string', description: 'Firecrawl API key' },
|
|
operation: { type: 'string', description: 'Operation to perform' },
|
|
url: { type: 'string', description: 'Target website URL' },
|
|
limit: { type: 'string', description: 'Page crawl limit' },
|
|
query: { type: 'string', description: 'Search query terms' },
|
|
scrapeOptions: { type: 'json', description: 'Scraping options' },
|
|
},
|
|
outputs: {
|
|
// Scrape output
|
|
markdown: { type: 'string', description: 'Page content markdown' },
|
|
html: { type: 'string', description: 'Raw HTML content' },
|
|
metadata: { type: 'json', description: 'Page metadata' },
|
|
// Search output
|
|
data: { type: 'json', description: 'Search results data' },
|
|
warning: { type: 'string', description: 'Warning messages' },
|
|
// Crawl output
|
|
pages: { type: 'json', description: 'Crawled pages data' },
|
|
total: { type: 'number', description: 'Total pages found' },
|
|
creditsUsed: { type: 'number', description: 'Credits consumed' },
|
|
},
|
|
}
|