@howells/fieldwork-sdk 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -3
- package/dist/{adapter-DGehHCMo.d.ts → adapter-CDY8qczv.d.ts} +16 -2
- package/dist/brave.d.ts +6 -4
- package/dist/brave.js +199 -116
- package/dist/browserbase.d.ts +8 -6
- package/dist/browserbase.js +87 -41
- package/dist/exa.d.ts +23 -19
- package/dist/exa.js +300 -160
- package/dist/{fieldwork-B3x3cxDJ.d.ts → fieldwork-DTNVIOzp.d.ts} +3 -3
- package/dist/firecrawl.d.ts +28 -25
- package/dist/firecrawl.js +595 -306
- package/dist/index.d.ts +4 -3
- package/dist/index.js +25 -11
- package/dist/parallel.d.ts +31 -26
- package/dist/parallel.js +407 -203
- package/dist/parse-CxOri73y.js +441 -0
- package/dist/perplexity.d.ts +13 -9
- package/dist/perplexity.js +145 -77
- package/dist/schema-EZlBkY5B.d.ts +90 -0
- package/dist/schema-teOy7Od-.js +45 -0
- package/dist/serpapi.d.ts +7 -4
- package/dist/serpapi.js +264 -162
- package/dist/tavily.d.ts +15 -12
- package/dist/tavily.js +191 -117
- package/dist/tools.d.ts +2 -2
- package/dist/util-DhYr1OS3.d.ts +1 -0
- package/package.json +4 -1
- package/dist/util-CYenIQQT.js +0 -265
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as AnyAdapter, p as Capability } from "./adapter-
|
|
1
|
+
import { n as AnyAdapter, p as Capability } from "./adapter-CDY8qczv.js";
|
|
2
2
|
type FieldworkErrorCode =
|
|
3
3
|
/** The adapter's provider does not offer this capability. */
|
|
4
4
|
"Unsupported" |
|
|
@@ -64,9 +64,9 @@ interface FieldworkBase<A extends AnyAdapter> {
|
|
|
64
64
|
readonly capabilities: Readonly<Record<Capability, boolean>>;
|
|
65
65
|
/** The provider's HTTP API, for anything Fieldwork does not wrap. */
|
|
66
66
|
readonly raw: A["raw"];
|
|
67
|
-
supports(capability: Capability)
|
|
67
|
+
supports: (capability: Capability) => boolean;
|
|
68
68
|
/** The provider that serves a capability, or undefined when none does. */
|
|
69
|
-
providerFor(capability: Capability)
|
|
69
|
+
providerFor: (capability: Capability) => string | undefined;
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
72
|
* A Fieldwork instance has exactly the methods its adapter's provider offers.
|
package/dist/firecrawl.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as MonitorSchedule, G as Research, I as Page, L as PageBatch, N as MonitorEvents, P as MonitorInfo, R as ParsedDocument, V as Product, W as Recency, X as SiteMap, a as RawClient, c as ActResult, f as CallOptions, g as Crawl, k as ImageSearch, q as SearchResponse, s as AccountUsage, t as Adapter, u as BrowserSession, w as Extraction, x as DocumentInput } from "./adapter-CDY8qczv.js";
|
|
2
|
+
import { t as OutputSchema } from "./schema-EZlBkY5B.js";
|
|
2
3
|
interface FirecrawlConfig {
|
|
3
4
|
/** Defaults to the FIRECRAWL_API_KEY environment variable. */
|
|
4
5
|
apiKey?: string;
|
|
5
6
|
baseUrl?: string;
|
|
6
7
|
fetch?: typeof fetch;
|
|
8
|
+
/** Repeats of a request that can succeed on repeat; 2 unless set. `0` turns retrying off. */
|
|
9
|
+
retries?: number;
|
|
7
10
|
}
|
|
8
11
|
/** A step Firecrawl runs in the browser before it reads the page. */
|
|
9
12
|
type FirecrawlAction = {
|
|
@@ -151,8 +154,8 @@ interface FirecrawlImagesOptions extends CallOptions {
|
|
|
151
154
|
location?: string;
|
|
152
155
|
safe?: boolean;
|
|
153
156
|
}
|
|
154
|
-
interface FirecrawlExtractOptions extends FirecrawlPageOptions {
|
|
155
|
-
schema:
|
|
157
|
+
interface FirecrawlExtractOptions<T = unknown> extends FirecrawlPageOptions {
|
|
158
|
+
schema: OutputSchema<T>;
|
|
156
159
|
prompt?: string;
|
|
157
160
|
}
|
|
158
161
|
interface FirecrawlMapOptions extends CallOptions {
|
|
@@ -199,8 +202,8 @@ interface FirecrawlCrawlOptions extends CallOptions {
|
|
|
199
202
|
*/
|
|
200
203
|
resume?: string;
|
|
201
204
|
}
|
|
202
|
-
interface FirecrawlResearchOptions extends CallOptions {
|
|
203
|
-
schema?:
|
|
205
|
+
interface FirecrawlResearchOptions<T = unknown> extends CallOptions {
|
|
206
|
+
schema?: OutputSchema<T>;
|
|
204
207
|
/** Pages to start from. */
|
|
205
208
|
urls?: string[];
|
|
206
209
|
/** Visit only `urls`. */
|
|
@@ -287,36 +290,36 @@ interface FirecrawlMonitorOptions extends CallOptions {
|
|
|
287
290
|
excludeDomains?: string[];
|
|
288
291
|
}
|
|
289
292
|
interface FirecrawlOperations {
|
|
290
|
-
search(query: string, options?: FirecrawlSearchOptions)
|
|
291
|
-
images(query: string, options?: FirecrawlImagesOptions)
|
|
292
|
-
read(url: string, options?: FirecrawlReadOptions)
|
|
293
|
+
search: (query: string, options?: FirecrawlSearchOptions) => Promise<SearchResponse>;
|
|
294
|
+
images: (query: string, options?: FirecrawlImagesOptions) => Promise<ImageSearch>;
|
|
295
|
+
read: (url: string, options?: FirecrawlReadOptions) => Promise<Page>;
|
|
293
296
|
/** Reads many pages in one background job. */
|
|
294
|
-
readMany(urls: string[], options?: FirecrawlReadManyOptions)
|
|
295
|
-
extract<T = unknown>(url: string, options: FirecrawlExtractOptions)
|
|
297
|
+
readMany: (urls: string[], options?: FirecrawlReadManyOptions) => Promise<PageBatch>;
|
|
298
|
+
extract: <T = unknown>(url: string, options: FirecrawlExtractOptions<T>) => Promise<Extraction<T>>;
|
|
296
299
|
/** Reads product and variant data from the page's structured data, without a model. */
|
|
297
|
-
product(url: string, options?: FirecrawlPageOptions)
|
|
298
|
-
map(url: string, options?: FirecrawlMapOptions)
|
|
299
|
-
crawl(url: string, options?: FirecrawlCrawlOptions)
|
|
300
|
-
research<T = unknown>(question: string, options?: FirecrawlResearchOptions)
|
|
300
|
+
product: (url: string, options?: FirecrawlPageOptions) => Promise<Product>;
|
|
301
|
+
map: (url: string, options?: FirecrawlMapOptions) => Promise<SiteMap>;
|
|
302
|
+
crawl: (url: string, options?: FirecrawlCrawlOptions) => Promise<Crawl>;
|
|
303
|
+
research: <T = unknown>(question: string, options?: FirecrawlResearchOptions<T>) => Promise<Research<T>>;
|
|
301
304
|
/** Runs a script in a browser session; closes the session unless `keepSession` is set. */
|
|
302
|
-
act(code: string, options?: FirecrawlActOptions)
|
|
305
|
+
act: (code: string, options?: FirecrawlActOptions) => Promise<ActResult>;
|
|
303
306
|
browser: {
|
|
304
307
|
/** Opens a remote browser you drive over CDP; it bills until it expires or you close it. */
|
|
305
|
-
open(options?: FirecrawlBrowserOptions)
|
|
306
|
-
close(id: string, options?: CallOptions)
|
|
308
|
+
open: (options?: FirecrawlBrowserOptions) => Promise<BrowserSession>;
|
|
309
|
+
close: (id: string, options?: CallOptions) => Promise<void>;
|
|
307
310
|
};
|
|
308
|
-
parse(document: DocumentInput, options?: FirecrawlParseOptions)
|
|
311
|
+
parse: (document: DocumentInput, options?: FirecrawlParseOptions) => Promise<ParsedDocument>;
|
|
309
312
|
monitor: {
|
|
310
|
-
create(options: FirecrawlMonitorOptions)
|
|
311
|
-
get(id: string, options?: CallOptions)
|
|
312
|
-
list(options?: CallOptions)
|
|
313
|
-
delete(id: string, options?: CallOptions)
|
|
313
|
+
create: (options: FirecrawlMonitorOptions) => Promise<MonitorInfo>;
|
|
314
|
+
get: (id: string, options?: CallOptions) => Promise<MonitorInfo>;
|
|
315
|
+
list: (options?: CallOptions) => Promise<MonitorInfo[]>;
|
|
316
|
+
delete: (id: string, options?: CallOptions) => Promise<void>;
|
|
314
317
|
/** One event per check the monitor ran, newest first. */
|
|
315
|
-
events(id: string, options?: CallOptions & {
|
|
318
|
+
events: (id: string, options?: CallOptions & {
|
|
316
319
|
cursor?: string;
|
|
317
|
-
})
|
|
320
|
+
}) => Promise<MonitorEvents>;
|
|
318
321
|
};
|
|
319
|
-
usage(options?: CallOptions)
|
|
322
|
+
usage: (options?: CallOptions) => Promise<AccountUsage>;
|
|
320
323
|
}
|
|
321
324
|
export declare const firecrawl: (config?: FirecrawlConfig) => Adapter<"firecrawl", FirecrawlOperations, RawClient>;
|
|
322
325
|
export type { FirecrawlActOptions, FirecrawlAction, FirecrawlBrowserOptions, FirecrawlConfig, FirecrawlCrawlOptions, FirecrawlExtractOptions, FirecrawlFormat, FirecrawlImagesOptions, FirecrawlMapOptions, FirecrawlMonitorOptions, FirecrawlOperations, FirecrawlPageOptions, FirecrawlPageSettings, FirecrawlParseOptions, FirecrawlParser, FirecrawlPdfParser, FirecrawlReadManyOptions, FirecrawlReadOptions, FirecrawlReadSettings, FirecrawlResearchOptions, FirecrawlSearchOptions, FirecrawlSessionSettings };
|