@howells/fieldwork-sdk 0.7.0 → 0.8.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 +1 -1
- package/dist/{adapter-C1mzXyKH.d.ts → adapter-Dqy-6BiH.d.ts} +11 -1
- package/dist/brave.d.ts +1 -1
- package/dist/browserbase.d.ts +1 -1
- package/dist/exa.d.ts +2 -2
- package/dist/{fieldwork-Dtlhkzf2.d.ts → fieldwork-CAGMQ2Cu.d.ts} +1 -1
- package/dist/firecrawl.d.ts +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/kernel.d.ts +1 -1
- package/dist/llamaparse.d.ts +3 -3
- package/dist/llamaparse.js +34 -16
- package/dist/parallel.d.ts +2 -2
- package/dist/perplexity.d.ts +2 -2
- package/dist/reducto.d.ts +1 -1
- package/dist/{schema-DNYyDTlM.d.ts → schema-B23Z08Ds.d.ts} +1 -1
- package/dist/serpapi.d.ts +1 -1
- package/dist/tavily.d.ts +2 -2
- package/dist/tools.d.ts +2 -2
- package/dist/tools.js +8 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -104,7 +104,7 @@ Every result is normalized and keeps the provider's response in `raw`. Most also
|
|
|
104
104
|
- `answer` returns `{ answer, output, citations, continuationId }`.
|
|
105
105
|
- `research` returns `{ id, status, output, sources, fields, continuationId }`. `output` follows your schema when you pass one, otherwise it is the report text.
|
|
106
106
|
- `crawl` returns `{ pages, failed, robotsBlocked, total }`.
|
|
107
|
-
- `parse` returns `{ id, markdown, pages, blocks, pageCount }`. With `blocks: true`, `blocks` lists the layout in reading order: each block's `page`, `type` (the provider's own word), `text` and `box`. With `wordBoxes: true` (LlamaParse and Reducto), blocks also carry `words` and table `cells`, each with its own box. With `pageImages: true` (LlamaParse), each page carries `image`, an address for a picture of the page that expires after about an hour; `parse({ resume: id, pageImages: true })` collects fresh addresses without the file. Every box is `{ left, top, width, height }` in fractions of the page from its top-left corner, whatever units the provider used, so boxes from different providers line up.
|
|
107
|
+
- `parse` returns `{ id, markdown, pages, blocks, pageCount }`. With `blocks: true`, `blocks` lists the layout in reading order: each block's `page`, `type` (the provider's own word), `text` and `box`. With `wordBoxes: true` (LlamaParse and Reducto), blocks also carry `words` and table `cells`, each with its own box. LlamaParse also places each line: a block's `lines` and a cell's `lines` are `{ text, box }`, the text being the line's part of the block's or cell's text, Markdown included. A table's `words` and `lines` are its cells', in reading order. Reducto places no lines. With `pageImages: true` (LlamaParse), each page carries `image`, an address for a picture of the page that expires after about an hour; `parse({ resume: id, pageImages: true })` collects fresh addresses without the file. Every box is `{ left, top, width, height }` in fractions of the page from its top-left corner, whatever units the provider used, so boxes from different providers line up.
|
|
108
108
|
|
|
109
109
|
A job that stopped early but produced output, for example on a credit or step limit, returns `status: "partial"` with `stopReason`. A job with no usable output throws `JobFailed`.
|
|
110
110
|
|
|
@@ -408,6 +408,12 @@ interface WordBox {
|
|
|
408
408
|
text: string;
|
|
409
409
|
box: Box;
|
|
410
410
|
}
|
|
411
|
+
/** A line of text as the page lays it out, and where it sits. */
|
|
412
|
+
interface LineBox {
|
|
413
|
+
/** The line's part of its block's or cell's text, as the provider wrote it: Markdown, so it can carry `**` or an escape. */
|
|
414
|
+
text: string;
|
|
415
|
+
box: Box;
|
|
416
|
+
}
|
|
411
417
|
/** A table cell and where it sits. Rows and columns count from 0. */
|
|
412
418
|
interface TableCell {
|
|
413
419
|
row: number;
|
|
@@ -418,6 +424,8 @@ interface TableCell {
|
|
|
418
424
|
columnSpan?: number;
|
|
419
425
|
text: string;
|
|
420
426
|
box?: Box;
|
|
427
|
+
/** Where each line of the cell sits, when the provider places lines. */
|
|
428
|
+
lines?: LineBox[];
|
|
421
429
|
}
|
|
422
430
|
/** One piece of a page's layout: a heading, a paragraph, a table, a figure. */
|
|
423
431
|
interface DocumentBlock {
|
|
@@ -430,6 +438,8 @@ interface DocumentBlock {
|
|
|
430
438
|
box?: Box;
|
|
431
439
|
/** Where each word sits, when the parse asked for word boxes. */
|
|
432
440
|
words?: WordBox[];
|
|
441
|
+
/** Where each line sits, a table's cell lines included, when the parse asked for word boxes and the provider places lines. */
|
|
442
|
+
lines?: LineBox[];
|
|
433
443
|
/** A table's cells, when the parse asked for word boxes. */
|
|
434
444
|
cells?: TableCell[];
|
|
435
445
|
}
|
|
@@ -584,4 +594,4 @@ type AnyAdapter = Adapter<string, any, unknown>;
|
|
|
584
594
|
* It returns its argument unchanged; write a custom adapter with it.
|
|
585
595
|
*/
|
|
586
596
|
declare const defineAdapter: <Name extends string, Ops extends Operations, Raw = RawClient>(adapter: Adapter<Name, Ops, Raw>) => Adapter<Name, Ops, Raw>;
|
|
587
|
-
export {
|
|
597
|
+
export { SiteLink as $, GROUP_CAPABILITIES as A, Page as B, DocumentInput as C, Extraction as D, Entity as E, Meta as F, Product as G, ParsedDocument as H, MonitorEvent as I, Recency as J, ProductImage as K, MonitorEvents as L, ImageSearch as M, JsonSchema as N, FailedUrl as O, LineBox as P, SearchResult as Q, MonitorInfo as R, DocumentBlock as S, DocumentUrl as T, Place as U, PageBatch as V, Price as W, RunStatus as X, Research as Y, SearchResponse as Z, Crawl as _, RawClient as a, Decisions as b, ActResult as c, BrowserSession as d, SiteMap as et, CAPABILITIES as f, Condition as g, Citation as h, defineAdapter as i, ImageResult as j, FieldSource as k, Answer as l, Capability as m, AnyAdapter as n, Usage as nt, RequestOptions as o, CallOptions as p, ProductVariant as q, Operations as r, WordBox as rt, AccountUsage as s, Adapter as t, TableCell as tt, Box as u, DecisionAnswer as v, DocumentPage as w, Discovery as x, DecisionQuestion as y, MonitorSchedule as z };
|
package/dist/brave.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as ImageSearch,
|
|
1
|
+
import { J as Recency, M as ImageSearch, Z as SearchResponse, a as RawClient, l as Answer, p as CallOptions, t as Adapter } from "./adapter-Dqy-6BiH.js";
|
|
2
2
|
/** Settings for `brave()`. */
|
|
3
3
|
interface BraveConfig {
|
|
4
4
|
/** Defaults to the BRAVE_API_KEY environment variable. */
|
package/dist/browserbase.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as Page, Z as SearchResponse, a as RawClient, d as BrowserSession, p as CallOptions, s as AccountUsage, t as Adapter } from "./adapter-Dqy-6BiH.js";
|
|
2
2
|
/** Settings for `browserbase()`. */
|
|
3
3
|
export interface BrowserbaseConfig {
|
|
4
4
|
/** Defaults to the BROWSERBASE_API_KEY environment variable. */
|
package/dist/exa.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as
|
|
2
|
-
import { t as OutputSchema } from "./schema-
|
|
1
|
+
import { B as Page, D as Extraction, L as MonitorEvents, R as MonitorInfo, V as PageBatch, Y as Research, Z as SearchResponse, a as RawClient, l as Answer, p as CallOptions, t as Adapter, z as MonitorSchedule } from "./adapter-Dqy-6BiH.js";
|
|
2
|
+
import { t as OutputSchema } from "./schema-B23Z08Ds.js";
|
|
3
3
|
/** Settings for the Exa adapter. */
|
|
4
4
|
interface ExaConfig {
|
|
5
5
|
/** Defaults to the EXA_API_KEY environment variable. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as Capability, n as AnyAdapter } from "./adapter-
|
|
1
|
+
import { m as Capability, n as AnyAdapter } from "./adapter-Dqy-6BiH.js";
|
|
2
2
|
/** Why a call failed. Branch on this, not on the message, which can change. */
|
|
3
3
|
type FieldworkErrorCode =
|
|
4
4
|
/** The adapter's provider does not offer this capability. */
|
package/dist/firecrawl.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as OutputSchema } from "./schema-
|
|
1
|
+
import { B as Page, C as DocumentInput, D as Extraction, G as Product, H as ParsedDocument, J as Recency, L as MonitorEvents, M as ImageSearch, R as MonitorInfo, V as PageBatch, Y as Research, Z as SearchResponse, _ as Crawl, a as RawClient, c as ActResult, d as BrowserSession, et as SiteMap, p as CallOptions, s as AccountUsage, t as Adapter, z as MonitorSchedule } from "./adapter-Dqy-6BiH.js";
|
|
2
|
+
import { t as OutputSchema } from "./schema-B23Z08Ds.js";
|
|
3
3
|
/** Settings for the Firecrawl adapter. */
|
|
4
4
|
interface FirecrawlConfig {
|
|
5
5
|
/** Defaults to the FIRECRAWL_API_KEY environment variable. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { i as FieldworkErrorCode, n as FieldworkOptions, r as FieldworkError, t as Fieldwork } from "./fieldwork-
|
|
3
|
-
import { n as StandardSchemaWithJSON, t as OutputSchema } from "./schema-
|
|
1
|
+
import { $ as SiteLink, A as GROUP_CAPABILITIES, B as Page, C as DocumentInput, D as Extraction, E as Entity, F as Meta, G as Product, H as ParsedDocument, I as MonitorEvent, J as Recency, K as ProductImage, L as MonitorEvents, M as ImageSearch, N as JsonSchema, O as FailedUrl, P as LineBox, Q as SearchResult, R as MonitorInfo, S as DocumentBlock, T as DocumentUrl, U as Place, V as PageBatch, W as Price, X as RunStatus, Y as Research, Z as SearchResponse, _ as Crawl, a as RawClient, b as Decisions, c as ActResult, d as BrowserSession, et as SiteMap, f as CAPABILITIES, g as Condition, h as Citation, i as defineAdapter, j as ImageResult, k as FieldSource, l as Answer, m as Capability, n as AnyAdapter, nt as Usage, o as RequestOptions, p as CallOptions, q as ProductVariant, r as Operations, rt as WordBox, s as AccountUsage, t as Adapter, tt as TableCell, u as Box, v as DecisionAnswer, w as DocumentPage, x as Discovery, y as DecisionQuestion, z as MonitorSchedule } from "./adapter-Dqy-6BiH.js";
|
|
2
|
+
import { i as FieldworkErrorCode, n as FieldworkOptions, r as FieldworkError, t as Fieldwork } from "./fieldwork-CAGMQ2Cu.js";
|
|
3
|
+
import { n as StandardSchemaWithJSON, t as OutputSchema } from "./schema-B23Z08Ds.js";
|
|
4
4
|
/** Which adapter serves each capability, for `router`. */
|
|
5
5
|
type Routes = Partial<Record<Capability, AnyAdapter>>;
|
|
6
6
|
/** Each route must name an adapter whose provider offers that capability. */
|
|
@@ -23,4 +23,4 @@ export declare const router: <const R extends Routes>(routes: R & ValidRoutes<R>
|
|
|
23
23
|
* `Unsupported` here instead of failing to compile.
|
|
24
24
|
*/
|
|
25
25
|
export declare const runtimeRouter: (routes: Routes) => AnyAdapter;
|
|
26
|
-
export { AccountUsage, ActResult, type Adapter, Answer, type AnyAdapter, Box, BrowserSession, CAPABILITIES, CallOptions, Capability, Citation, Condition, Crawl, DecisionAnswer, DecisionQuestion, Decisions, Discovery, DocumentBlock, DocumentInput, DocumentPage, DocumentUrl, Entity, Extraction, FailedUrl, FieldSource, Fieldwork, FieldworkError, type FieldworkErrorCode, type FieldworkOptions, GROUP_CAPABILITIES, ImageResult, ImageSearch, JsonSchema, Meta, MonitorEvent, MonitorEvents, MonitorInfo, MonitorSchedule, type Operations, type OutputSchema, Page, PageBatch, ParsedDocument, Place, Price, Product, ProductImage, ProductVariant, type RawClient, Recency, type RequestOptions, Research, type Routes, RunStatus, SearchResponse, SearchResult, SiteLink, SiteMap, type StandardSchemaWithJSON, TableCell, Usage, WordBox, defineAdapter };
|
|
26
|
+
export { AccountUsage, ActResult, type Adapter, Answer, type AnyAdapter, Box, BrowserSession, CAPABILITIES, CallOptions, Capability, Citation, Condition, Crawl, DecisionAnswer, DecisionQuestion, Decisions, Discovery, DocumentBlock, DocumentInput, DocumentPage, DocumentUrl, Entity, Extraction, FailedUrl, FieldSource, Fieldwork, FieldworkError, type FieldworkErrorCode, type FieldworkOptions, GROUP_CAPABILITIES, ImageResult, ImageSearch, JsonSchema, LineBox, Meta, MonitorEvent, MonitorEvents, MonitorInfo, MonitorSchedule, type Operations, type OutputSchema, Page, PageBatch, ParsedDocument, Place, Price, Product, ProductImage, ProductVariant, type RawClient, Recency, type RequestOptions, Research, type Routes, RunStatus, SearchResponse, SearchResult, SiteLink, SiteMap, type StandardSchemaWithJSON, TableCell, Usage, WordBox, defineAdapter };
|
package/dist/kernel.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as RawClient, d as BrowserSession, p as CallOptions, t as Adapter
|
|
1
|
+
import { B as Page, a as RawClient, d as BrowserSession, p as CallOptions, t as Adapter } from "./adapter-Dqy-6BiH.js";
|
|
2
2
|
/** Settings for `kernel()`. */
|
|
3
3
|
export interface KernelConfig {
|
|
4
4
|
/** Defaults to the KERNEL_API_KEY environment variable. */
|
package/dist/llamaparse.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as DocumentInput,
|
|
1
|
+
import { C as DocumentInput, H as ParsedDocument, T as DocumentUrl, a as RawClient, p as CallOptions, t as Adapter } from "./adapter-Dqy-6BiH.js";
|
|
2
2
|
/** Settings for `llamaparse()`. */
|
|
3
3
|
export interface LlamaParseConfig {
|
|
4
4
|
/** Defaults to the LLAMA_CLOUD_API_KEY environment variable. */
|
|
@@ -24,8 +24,8 @@ export interface LlamaParseParseOptions extends CallOptions {
|
|
|
24
24
|
/** Return layout blocks with positions. */
|
|
25
25
|
blocks?: boolean;
|
|
26
26
|
/**
|
|
27
|
-
* Also return where each word and table cell sits in each block,
|
|
28
|
-
* second download. Returns blocks too.
|
|
27
|
+
* Also return where each word, line and table cell sits in each block, and
|
|
28
|
+
* each line of a cell, from a second download. Returns blocks too.
|
|
29
29
|
*/
|
|
30
30
|
wordBoxes?: boolean;
|
|
31
31
|
/** Leave out text a reader cannot see, such as white text on white. */
|
package/dist/llamaparse.js
CHANGED
|
@@ -13,12 +13,16 @@ const PointBox = looseObject({
|
|
|
13
13
|
x: optionalNumber,
|
|
14
14
|
y: optionalNumber
|
|
15
15
|
});
|
|
16
|
-
/** A word: `span` is `[start, end)` in UTF-8 bytes of its item's text. */
|
|
16
|
+
/** A word or a line: `span` is `[start, end)` in UTF-8 bytes of its item's `md`, or of its cell's text in a table. */
|
|
17
17
|
const Word = looseObject({
|
|
18
18
|
bbox: PointBox,
|
|
19
19
|
span: arrayOf(z.number())
|
|
20
20
|
});
|
|
21
|
-
const Line = looseObject({
|
|
21
|
+
const Line = looseObject({
|
|
22
|
+
bbox: PointBox,
|
|
23
|
+
span: arrayOf(z.number()),
|
|
24
|
+
words: arrayOf(Word)
|
|
25
|
+
});
|
|
22
26
|
const Cell = looseObject({
|
|
23
27
|
bbox: arrayOf(PointBox),
|
|
24
28
|
lines: arrayOf(Line)
|
|
@@ -77,35 +81,46 @@ const fraction = (box, size) => {
|
|
|
77
81
|
};
|
|
78
82
|
};
|
|
79
83
|
const around = (boxes, size) => enclosing(boxes.map((box) => fraction(box, size)).filter((box) => box !== void 0));
|
|
80
|
-
|
|
84
|
+
/** Each word or line that has a box and a span, with the text its span covers. */
|
|
85
|
+
const placed = (spans, bytes, size) => spans.flatMap((each) => {
|
|
86
|
+
const box = fraction(each.bbox, size);
|
|
87
|
+
const [start, end] = each.span;
|
|
88
|
+
if (box === void 0 || start === void 0 || end === void 0) return [];
|
|
89
|
+
return [{
|
|
90
|
+
box,
|
|
91
|
+
text: decoder.decode(bytes.slice(start, end))
|
|
92
|
+
}];
|
|
93
|
+
});
|
|
94
|
+
/** The words and the lines of `lines`, whose spans count bytes of `text`. */
|
|
95
|
+
const grounded = (lines, text, size) => {
|
|
81
96
|
const bytes = encoder.encode(text);
|
|
82
|
-
return
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return [{
|
|
87
|
-
box,
|
|
88
|
-
text: decoder.decode(bytes.slice(start, end))
|
|
89
|
-
}];
|
|
90
|
-
}));
|
|
97
|
+
return {
|
|
98
|
+
lines: placed(lines, bytes, size),
|
|
99
|
+
words: lines.flatMap((line) => placed(line.words, bytes, size))
|
|
100
|
+
};
|
|
91
101
|
};
|
|
92
102
|
const tableOf = (item, size) => {
|
|
93
103
|
const cells = [];
|
|
104
|
+
const lines = [];
|
|
94
105
|
const words = [];
|
|
95
|
-
for (const [row,
|
|
106
|
+
for (const [row, groundedRow] of item.grounding.rows.entries()) for (const [column, cell] of groundedRow.entries()) {
|
|
96
107
|
const text = item.rows[row]?.[column];
|
|
97
108
|
if (text !== void 0) {
|
|
109
|
+
const inCell = grounded(cell.lines, text, size);
|
|
98
110
|
cells.push(compact({
|
|
99
111
|
box: around(cell.bbox, size),
|
|
100
112
|
column,
|
|
113
|
+
lines: inCell.lines.length > 0 ? inCell.lines : void 0,
|
|
101
114
|
row,
|
|
102
115
|
text
|
|
103
116
|
}));
|
|
104
|
-
|
|
117
|
+
lines.push(...inCell.lines);
|
|
118
|
+
words.push(...inCell.words);
|
|
105
119
|
}
|
|
106
120
|
}
|
|
107
121
|
return {
|
|
108
122
|
cells,
|
|
123
|
+
lines,
|
|
109
124
|
words
|
|
110
125
|
};
|
|
111
126
|
};
|
|
@@ -118,10 +133,13 @@ const blocksOfItem = (item, page, size) => {
|
|
|
118
133
|
type: item.type ?? "unknown"
|
|
119
134
|
}];
|
|
120
135
|
const table = tableOf(item, size);
|
|
121
|
-
const
|
|
136
|
+
const own = grounded(item.grounding.lines, text, size);
|
|
137
|
+
const lines = [...own.lines, ...table.lines];
|
|
138
|
+
const words = [...own.words, ...table.words];
|
|
122
139
|
return [compact({
|
|
123
140
|
box: around(item.bbox, size),
|
|
124
141
|
cells: table.cells.length > 0 ? table.cells : void 0,
|
|
142
|
+
lines: lines.length > 0 ? lines : void 0,
|
|
125
143
|
page,
|
|
126
144
|
text,
|
|
127
145
|
type: item.type ?? "unknown",
|
|
@@ -195,7 +213,7 @@ const finished = (id, found) => {
|
|
|
195
213
|
});
|
|
196
214
|
return state === "done" ? found : void 0;
|
|
197
215
|
};
|
|
198
|
-
/** The grounded items: one JSON line per page, each page's items with word and cell boxes. */
|
|
216
|
+
/** The grounded items: one JSON line per page, each page's items with word, line and cell boxes. */
|
|
199
217
|
const groundedPages = async (found, options) => {
|
|
200
218
|
const url = found.value.result_content_metadata.grounded_items.presigned_url;
|
|
201
219
|
if (url === void 0) throw new FieldworkError("ProviderError", "llamaparse finished without the word boxes it was asked for", {
|
package/dist/parallel.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as
|
|
2
|
-
import { t as OutputSchema } from "./schema-
|
|
1
|
+
import { B as Page, D as Extraction, L as MonitorEvents, M as ImageSearch, R as MonitorInfo, V as PageBatch, Y as Research, Z as SearchResponse, a as RawClient, b as Decisions, g as Condition, l as Answer, p as CallOptions, t as Adapter, x as Discovery, y as DecisionQuestion, z as MonitorSchedule } from "./adapter-Dqy-6BiH.js";
|
|
2
|
+
import { t as OutputSchema } from "./schema-B23Z08Ds.js";
|
|
3
3
|
import "./util-DhYr1OS3.js";
|
|
4
4
|
/** Settings for `parallel()`. */
|
|
5
5
|
interface ParallelConfig {
|
package/dist/perplexity.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { J as Research,
|
|
2
|
-
import { t as OutputSchema } from "./schema-
|
|
1
|
+
import { J as Recency, Y as Research, Z as SearchResponse, a as RawClient, b as Decisions, l as Answer, p as CallOptions, t as Adapter, y as DecisionQuestion } from "./adapter-Dqy-6BiH.js";
|
|
2
|
+
import { t as OutputSchema } from "./schema-B23Z08Ds.js";
|
|
3
3
|
/** Settings for `perplexity()`. */
|
|
4
4
|
interface PerplexityConfig {
|
|
5
5
|
/** Defaults to the PERPLEXITY_API_KEY environment variable. */
|
package/dist/reducto.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as DocumentInput,
|
|
1
|
+
import { C as DocumentInput, H as ParsedDocument, T as DocumentUrl, a as RawClient, p as CallOptions, t as Adapter } from "./adapter-Dqy-6BiH.js";
|
|
2
2
|
/** Settings for `reducto()`. */
|
|
3
3
|
export interface ReductoConfig {
|
|
4
4
|
/** Defaults to the REDUCTO_API_KEY environment variable. */
|
package/dist/serpapi.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as ImageSearch,
|
|
1
|
+
import { J as Recency, M as ImageSearch, Z as SearchResponse, a as RawClient, p as CallOptions, s as AccountUsage, t as Adapter } from "./adapter-Dqy-6BiH.js";
|
|
2
2
|
import "./util-DhYr1OS3.js";
|
|
3
3
|
/** Settings for `serpapi()`. */
|
|
4
4
|
interface SerpApiConfig {
|
package/dist/tavily.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as OutputSchema } from "./schema-
|
|
1
|
+
import { B as Page, J as Recency, M as ImageSearch, V as PageBatch, Y as Research, Z as SearchResponse, _ as Crawl, a as RawClient, et as SiteMap, l as Answer, p as CallOptions, s as AccountUsage, t as Adapter } from "./adapter-Dqy-6BiH.js";
|
|
2
|
+
import { t as OutputSchema } from "./schema-B23Z08Ds.js";
|
|
3
3
|
/** Settings for the Tavily adapter. */
|
|
4
4
|
interface TavilyConfig {
|
|
5
5
|
/** Defaults to the TAVILY_API_KEY environment variable. */
|
package/dist/tools.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as FieldworkErrorCode, t as Fieldwork } from "./fieldwork-
|
|
2
|
-
import { N as JsonSchema, m as Capability, n as AnyAdapter, p as CallOptions } from "./adapter-
|
|
1
|
+
import { i as FieldworkErrorCode, t as Fieldwork } from "./fieldwork-CAGMQ2Cu.js";
|
|
2
|
+
import { N as JsonSchema, m as Capability, n as AnyAdapter, p as CallOptions } from "./adapter-Dqy-6BiH.js";
|
|
3
3
|
/** Any JSON value. */
|
|
4
4
|
type JsonValue = string | number | boolean | null | JsonValue[] | JsonObject;
|
|
5
5
|
/** A JSON object. A key may be undefined, which reads as absent and is not serialized. */
|
package/dist/tools.js
CHANGED
|
@@ -461,6 +461,11 @@ const box = object({
|
|
|
461
461
|
"width",
|
|
462
462
|
"height"
|
|
463
463
|
], "Where it sits on the page, as fractions of the page's width and height from its top-left corner.");
|
|
464
|
+
/** A word or a line: its text and where it sits. */
|
|
465
|
+
const placedText = object({
|
|
466
|
+
box,
|
|
467
|
+
text: str
|
|
468
|
+
}, ["text", "box"]);
|
|
464
469
|
/** The result of `parse_document`, a `ParsedDocument`. */
|
|
465
470
|
const PARSE_OUTPUT = object({
|
|
466
471
|
blocks: list(object({
|
|
@@ -469,6 +474,7 @@ const PARSE_OUTPUT = object({
|
|
|
469
474
|
box,
|
|
470
475
|
column: whole("The column, from 0.", 0),
|
|
471
476
|
columnSpan: whole("Columns the cell spans.", 1),
|
|
477
|
+
lines: list(placedText),
|
|
472
478
|
row: whole("The row, from 0.", 0),
|
|
473
479
|
rowSpan: whole("Rows the cell spans.", 1),
|
|
474
480
|
text: str
|
|
@@ -477,13 +483,11 @@ const PARSE_OUTPUT = object({
|
|
|
477
483
|
"column",
|
|
478
484
|
"text"
|
|
479
485
|
])),
|
|
486
|
+
lines: list(placedText),
|
|
480
487
|
page: whole("The physical page number, starting at 1.", 1),
|
|
481
488
|
text: str,
|
|
482
489
|
type: str,
|
|
483
|
-
words: list(
|
|
484
|
-
box,
|
|
485
|
-
text: str
|
|
486
|
-
}, ["text", "box"]))
|
|
490
|
+
words: list(placedText)
|
|
487
491
|
}, [
|
|
488
492
|
"page",
|
|
489
493
|
"type",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@howells/fieldwork-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "One API for web search, page reading, extraction, crawling, answers, research, browser sessions, monitoring and document parsing across Exa, Firecrawl, Tavily, Parallel, Perplexity, Brave, SerpApi, Browserbase, Kernel, LlamaParse and Reducto.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agents",
|