fix: firecrawl updates from last pr

pull/697/head
Travis Fischer 2025-03-18 21:02:16 +08:00
rodzic 5efa64bb4f
commit 0ec220446d
4 zmienionych plików z 489 dodań i 457 usunięć

Wyświetl plik

@ -11,15 +11,23 @@
"type": "git", "type": "git",
"url": "git+https://github.com/transitive-bullshit/agentic.git" "url": "git+https://github.com/transitive-bullshit/agentic.git"
}, },
"sideEffects": false, "type": "module",
"main": "./dist/index.js", "source": "./src/index.ts",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
"sideEffects": false,
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"default": "./dist/index.js"
}
},
"files": [ "files": [
"dist/**" "dist"
], ],
"scripts": { "scripts": {
"build": "tsup", "build": "tsup --config ../../tsup.config.ts",
"dev": "tsup --config ../../tsup.config.ts --watch",
"clean": "del dist", "clean": "del dist",
"test": "run-s test:*", "test": "run-s test:*",
"test:lint": "eslint .", "test:lint": "eslint .",
@ -34,10 +42,7 @@
"zod": "catalog:" "zod": "catalog:"
}, },
"devDependencies": { "devDependencies": {
"@agentic/tsconfig": "workspace:*", "@agentic/tsconfig": "workspace:*"
"@types/node": "^20.11.16",
"tsup": "^8.0.1",
"typescript": "^5.3.3"
}, },
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"

Wyświetl plik

@ -1,6 +1,6 @@
import { z } from 'zod' import { z } from 'zod'
import { FirecrawlClient } from './dist/index.mjs' import { FirecrawlClient } from './firecrawl-client'
// Initialize the client with the API key // Initialize the client with the API key
const apiKey = 'FIRECRAWL-API-KEY' const apiKey = 'FIRECRAWL-API-KEY'
@ -26,7 +26,8 @@ async function testUrlScraping() {
async function testSearch() { async function testSearch() {
console.log('\n🔍 Testing search...') console.log('\n🔍 Testing search...')
try { try {
const result = await firecrawl.search('artificial intelligence news', { const result = await firecrawl.search({
query: 'artificial intelligence news',
limit: 5, limit: 5,
lang: 'en', lang: 'en',
country: 'us' country: 'us'
@ -45,7 +46,8 @@ async function testSearch() {
async function testCrawlUrl() { async function testCrawlUrl() {
console.log('\n🔍 Testing URL crawling...') console.log('\n🔍 Testing URL crawling...')
try { try {
const result = await firecrawl.crawlUrl('https://example.com', { const result = await firecrawl.crawlUrl({
url: 'https://example.com',
maxDepth: 2, maxDepth: 2,
limit: 5 limit: 5
}) })

Wyświetl plik

@ -1,13 +1 @@
export type { export * from './firecrawl-client'
ErrorResponse,
ExtractParams,
ExtractResponse,
ExtractStatusResponse,
FirecrawlClientConfig,
GenerateLLMsTextParams,
GenerateLLMsTextResponse,
GenerateLLMsTextStatusResponse,
ScrapeParams,
ScrapeResponse
} from './firecrawl-client.js'
export { FirecrawlClient } from './firecrawl-client.js'