@howells/fieldwork-sdk 0.11.0 → 0.13.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.
Files changed (47) hide show
  1. package/README.md +73 -15
  2. package/dist/{adapter-DWYJys20.js → adapter-CBSAfErv.js} +1 -1
  3. package/dist/adapter-J2yatZJ0.d.ts +73 -0
  4. package/dist/best-DiKYwLdC.js +1436 -0
  5. package/dist/brave.d.ts +7 -6
  6. package/dist/brave.js +175 -168
  7. package/dist/browserbase.d.ts +4 -3
  8. package/dist/browserbase.js +182 -167
  9. package/dist/{document-DMIUCoDA.js → document-x9fWsQ1W.js} +2 -2
  10. package/dist/{download-CP8noBdX.js → download-kuTqNnuZ.js} +1 -1
  11. package/dist/{adapter-B8kAAAgF.d.ts → errors-gMtejKHc.d.ts} +87 -69
  12. package/dist/exa.d.ts +18 -11
  13. package/dist/exa.js +301 -267
  14. package/dist/fieldwork-D7npPoUf.d.ts +35 -0
  15. package/dist/firecrawl.d.ts +4 -3
  16. package/dist/firecrawl.js +432 -399
  17. package/dist/{parse-Q7H4mrnO.js → http-Bg0h3D-t.js} +222 -224
  18. package/dist/image.d.ts +253 -0
  19. package/dist/image.js +1 -0
  20. package/dist/index.d.ts +6 -7
  21. package/dist/index.js +66 -82
  22. package/dist/{job-DnavRq_s.js → job-BsrOrrO1.js} +7 -7
  23. package/dist/kernel.d.ts +20 -2
  24. package/dist/kernel.js +58 -12
  25. package/dist/llamaparse.d.ts +3 -2
  26. package/dist/llamaparse.js +8 -8
  27. package/dist/parallel.d.ts +10 -10
  28. package/dist/parallel.js +432 -391
  29. package/dist/path-tDCyAKK9.js +10 -0
  30. package/dist/perplexity.d.ts +6 -5
  31. package/dist/perplexity.js +16 -16
  32. package/dist/reducto.d.ts +3 -2
  33. package/dist/reducto.js +8 -8
  34. package/dist/{schema--iU4AXSM.js → schema-Bfd2E8u2.js} +12 -3
  35. package/dist/{schema-CAPSX7yQ.d.ts → schema-C9xzRkKJ.d.ts} +17 -6
  36. package/dist/serpapi.d.ts +3 -3
  37. package/dist/serpapi.js +170 -165
  38. package/dist/tavily.d.ts +4 -3
  39. package/dist/tavily.js +242 -229
  40. package/dist/tools.d.ts +79 -15
  41. package/dist/tools.js +431 -77
  42. package/dist/{util-DFUXQX6v.js → util-BOqd71Om.js} +44 -12
  43. package/package.json +11 -6
  44. package/dist/fieldwork-BrfoehvG.d.ts +0 -113
  45. package/dist/path-DL5P8XH2.js +0 -17
  46. package/dist/util-DhYr1OS3.d.ts +0 -1
  47. package/dist/{errors-DkFJysIM.js → errors-gpxg6Tnh.js} +5 -5
package/dist/serpapi.js CHANGED
@@ -1,8 +1,8 @@
1
- import { t as defineAdapter } from "./adapter-DWYJys20.js";
2
- import { r as invalidRequest, t as FieldworkError } from "./errors-DkFJysIM.js";
3
- import { C as createRawClient, T as requireKey, a as looseObject, f as optionalNumber, h as optionalString, m as optionalScalar, o as nonEmptyString, r as arrayOf, x as warnings } from "./parse-Q7H4mrnO.js";
4
- import { a as compact, f as refuseTogether, s as meta, t as callSettings } from "./util-DFUXQX6v.js";
5
1
  import * as z from "zod/mini";
2
+ import { t as defineAdapter } from "./adapter-CBSAfErv.js";
3
+ import { r as invalidRequest, t as FieldworkError } from "./errors-gpxg6Tnh.js";
4
+ import { D as warnings, b as optionalScalar, d as looseObject, f as nonEmptyString, l as arrayOf, r as requireKey, t as createRawClient, v as optionalNumber, x as optionalString } from "./http-Bg0h3D-t.js";
5
+ import { a as compact, f as refuseTogether, s as meta, t as callSettings } from "./util-BOqd71Om.js";
6
6
  // src/adapters/serpapi/parse.ts
7
7
  /** The name this adapter reports in errors and results. */
8
8
  const provider = "serpapi";
@@ -262,16 +262,12 @@ const RECENCY_CODE = {
262
262
  week: "w",
263
263
  year: "y"
264
264
  };
265
- /** The value if it is a string, else undefined. Engine specs read options as `Json`. */
266
- const str = (value) => typeof value === "string" ? value : void 0;
267
- /** The value if it is a number, else undefined. */
268
- const count = (value) => typeof value === "number" ? value : void 0;
269
265
  /**
270
266
  * Google's `gl` code for a country: lower case, and "uk" for "gb", as SerpApi
271
267
  * documents.
272
268
  */
273
269
  const googleCountry = (value) => {
274
- const code = str(value)?.toLowerCase();
270
+ const code = value?.toLowerCase();
275
271
  return code === "gb" ? "uk" : code;
276
272
  };
277
273
  /**
@@ -280,7 +276,7 @@ const googleCountry = (value) => {
280
276
  */
281
277
  const isoDate = (name, value) => {
282
278
  if (value === void 0) return;
283
- if (typeof value !== "string" || !/^\d{4}-\d{2}-\d{2}$/u.test(value)) throw invalidRequest(provider, `${name} must be YYYY-MM-DD`);
279
+ if (!/^\d{4}-\d{2}-\d{2}$/u.test(value)) throw invalidRequest(provider, `${name} must be YYYY-MM-DD`);
284
280
  return value;
285
281
  };
286
282
  /** A YYYY-MM-DD date as YYYYMMDD. */
@@ -296,7 +292,7 @@ const usDate = (name, value) => {
296
292
  /** A result count that is a whole number from `min` to `max`; refuses any other. */
297
293
  const bounded = (engine, value, min, max) => {
298
294
  if (value === void 0) return;
299
- if (typeof value !== "number" || !Number.isInteger(value) || value < min || value > max) throw invalidRequest(provider, `${engine} limit must be a whole number from ${min} to ${max}`);
295
+ if (!Number.isInteger(value) || value < min || value > max) throw invalidRequest(provider, `${engine} limit must be a whole number from ${min} to ${max}`);
300
296
  return value;
301
297
  };
302
298
  /** The code for the recency window the caller set; undefined when it names none. */
@@ -351,10 +347,10 @@ const mapsOrigin = (o) => {
351
347
  if (origin && o.zoom === void 0) throw invalidRequest(provider, "google_maps needs zoom with location or latitude and longitude");
352
348
  if (!origin && o.zoom !== void 0) throw invalidRequest(provider, "google_maps zoom needs location or latitude and longitude");
353
349
  return {
354
- lat: count(o.latitude),
355
- location: str(o.location),
356
- lon: count(o.longitude),
357
- z: count(o.zoom)
350
+ lat: o.latitude,
351
+ location: o.location,
352
+ lon: o.longitude,
353
+ z: o.zoom
358
354
  };
359
355
  };
360
356
  // src/adapters/serpapi/engines.ts
@@ -379,12 +375,12 @@ const ENGINES = {
379
375
  params: (o) => {
380
376
  refuseTogether(provider, o, "country", "market");
381
377
  return {
382
- cc: str(o.country)?.toLowerCase(),
383
- device: str(o.device),
384
- first: count(o.first),
385
- location: str(o.location),
386
- mkt: str(o.market),
387
- safeSearch: str(o.safeSearch)
378
+ cc: o.country?.toLowerCase(),
379
+ device: o.device,
380
+ first: o.first,
381
+ location: o.location,
382
+ mkt: o.market,
383
+ safeSearch: o.safeSearch
388
384
  };
389
385
  },
390
386
  results: webResults
@@ -403,10 +399,10 @@ const ENGINES = {
403
399
  ],
404
400
  params: (o) => ({
405
401
  df: duckDuckGoFilter(o),
406
- kl: str(o.region),
402
+ kl: o.region,
407
403
  m: bounded("duckduckgo", o.limit, 1, 50),
408
- safe: count(o.safe),
409
- start: count(o.start)
404
+ safe: o.safe,
405
+ start: o.start
410
406
  }),
411
407
  results: webResults
412
408
  },
@@ -428,12 +424,12 @@ const ENGINES = {
428
424
  "noCache"
429
425
  ],
430
426
  params: (o) => ({
431
- device: str(o.device),
427
+ device: o.device,
432
428
  gl: googleCountry(o.country),
433
- hl: str(o.language),
434
- location: str(o.location),
435
- safe: str(o.safe),
436
- start: count(o.start),
429
+ hl: o.language,
430
+ location: o.location,
431
+ safe: o.safe,
432
+ start: o.start,
437
433
  tbs: googleTbs(o)
438
434
  }),
439
435
  results: webResults
@@ -453,10 +449,10 @@ const ENGINES = {
453
449
  "noCache"
454
450
  ],
455
451
  params: (o) => ({
452
+ hl: o.language,
456
453
  type: "search",
457
- hl: str(o.language),
458
454
  ...mapsOrigin(o),
459
- start: count(o.start)
455
+ start: o.start
460
456
  }),
461
457
  results: placeResults
462
458
  },
@@ -469,7 +465,7 @@ const ENGINES = {
469
465
  ],
470
466
  params: (o) => ({
471
467
  gl: googleCountry(o.country),
472
- hl: str(o.language)
468
+ hl: o.language
473
469
  }),
474
470
  results: newsResults
475
471
  },
@@ -488,13 +484,13 @@ const ENGINES = {
488
484
  ],
489
485
  params: (o) => ({
490
486
  after: patentDate("publishedAfter", o.publishedAfter),
491
- assignee: str(o.assignee),
487
+ assignee: o.assignee,
492
488
  before: patentDate("publishedBefore", o.publishedBefore),
493
- inventor: str(o.inventor),
489
+ inventor: o.inventor,
494
490
  num: bounded("google_patents", o.limit, 10, 100),
495
- page: count(o.page),
496
- sort: str(o.sort),
497
- status: str(o.status)
491
+ page: o.page,
492
+ sort: o.sort,
493
+ status: o.status
498
494
  }),
499
495
  results: patentResults
500
496
  },
@@ -510,12 +506,12 @@ const ENGINES = {
510
506
  "noCache"
511
507
  ],
512
508
  params: (o) => ({
513
- as_yhi: count(o.yearTo),
514
- as_ylo: count(o.yearFrom),
515
- hl: str(o.language),
509
+ as_yhi: o.yearTo,
510
+ as_ylo: o.yearFrom,
511
+ hl: o.language,
516
512
  num: bounded("google_scholar", o.limit, 1, 20),
517
- safe: str(o.safe),
518
- start: count(o.start)
513
+ safe: o.safe,
514
+ start: o.start
519
515
  }),
520
516
  results: scholarResults
521
517
  },
@@ -536,17 +532,17 @@ const ENGINES = {
536
532
  "noCache"
537
533
  ],
538
534
  params: (o) => ({
539
- device: str(o.device),
535
+ device: o.device,
540
536
  free_shipping: o.freeShipping === true ? true : void 0,
541
537
  gl: googleCountry(o.country),
542
- hl: str(o.language),
543
- location: str(o.location),
544
- max_price: count(o.maxPrice),
545
- min_price: count(o.minPrice),
538
+ hl: o.language,
539
+ location: o.location,
540
+ max_price: o.maxPrice,
541
+ min_price: o.minPrice,
546
542
  on_sale: o.onSale === true ? true : void 0,
547
- safe: str(o.safe),
543
+ safe: o.safe,
548
544
  small_business: o.smallBusiness === true ? true : void 0,
549
- sort_by: count(o.sortBy)
545
+ sort_by: o.sortBy
550
546
  }),
551
547
  results: shoppingResults
552
548
  }
@@ -575,7 +571,7 @@ const REVERSE_ENGINES = {
575
571
  imageParam: "image_url",
576
572
  params: (o) => ({
577
573
  count: bounded("bing_reverse_image", o.limit, 1, 150),
578
- mkt: str(o.market)
574
+ mkt: o.market
579
575
  }),
580
576
  results: bingMatches
581
577
  },
@@ -589,9 +585,9 @@ const REVERSE_ENGINES = {
589
585
  ],
590
586
  imageParam: "url",
591
587
  params: (o) => ({
592
- country: str(o.country)?.toLowerCase(),
593
- hl: str(o.language),
594
- q: str(o.query),
588
+ country: o.country?.toLowerCase(),
589
+ hl: o.language,
590
+ q: o.query,
595
591
  type: lensType(o)
596
592
  }),
597
593
  results: lensMatches
@@ -606,8 +602,8 @@ const REVERSE_ENGINES = {
606
602
  imageParam: "image_url",
607
603
  params: (o) => ({
608
604
  gl: googleCountry(o.country),
609
- hl: str(o.language),
610
- q: str(o.query)
605
+ hl: o.language,
606
+ q: o.query
611
607
  }),
612
608
  results: googleReverseMatches
613
609
  },
@@ -641,7 +637,7 @@ const IMAGE_OPTIONS = [
641
637
  * undefined passes.
642
638
  */
643
639
  const onlyAllowed = (engine, options, allowed) => {
644
- const refused = Object.keys(options).filter((name) => options[name] !== void 0 && !allowed.includes(name));
640
+ const refused = Object.entries(options).filter(([name, value]) => value !== void 0 && !allowed.includes(name)).map(([name]) => name);
645
641
  if (refused.length > 0) throw invalidRequest(provider, `${engine} does not accept ${refused.join(", ")}`);
646
642
  };
647
643
  // src/adapters/serpapi/response.ts
@@ -810,8 +806,120 @@ const AccountResponse = looseObject({
810
806
  this_month_usage: optionalNumber
811
807
  });
812
808
  // src/adapters/serpapi.ts
809
+ /** One `/search` call: the response as received, and its parsed body. A failed search throws. */
810
+ const searchCall = async (raw, call, query) => {
811
+ const response = await raw.request("GET", "/search", {
812
+ ...call,
813
+ query
814
+ });
815
+ const body = z.parse(SearchResponse, response);
816
+ const failure = searchFailure(body);
817
+ if (failure !== void 0) throw new FieldworkError("ProviderError", failure, {
818
+ cause: response,
819
+ provider,
820
+ retryable: true
821
+ });
822
+ return {
823
+ body,
824
+ response
825
+ };
826
+ };
827
+ /** `search` and `images`: one engine query each. */
828
+ const searching = (raw) => ({
829
+ async images(query, options = {}) {
830
+ const { call, rest: o } = callSettings(options);
831
+ onlyAllowed("google_images", o, IMAGE_OPTIONS);
832
+ refuseTogether(provider, o, "recency", "publishedAfter");
833
+ refuseTogether(provider, o, "recency", "publishedBefore");
834
+ const { body, response } = await searchCall(raw, call, compact({
835
+ device: o.device,
836
+ end_date: compactDate("publishedBefore", o.publishedBefore),
837
+ engine: "google_images",
838
+ gl: googleCountry(o.country),
839
+ hl: o.language,
840
+ ijn: o.page,
841
+ image_color: o.color,
842
+ image_type: o.imageType,
843
+ imgar: o.aspectRatio,
844
+ imgsz: o.size,
845
+ licenses: o.license,
846
+ location: o.location,
847
+ no_cache: o.noCache === true ? true : void 0,
848
+ period_unit: o.recency === void 0 ? void 0 : RECENCY_CODE[o.recency],
849
+ q: query,
850
+ safe: o.safe,
851
+ start_date: compactDate("publishedAfter", o.publishedAfter)
852
+ }));
853
+ return compact({
854
+ meta: searchMeta(body),
855
+ raw: response,
856
+ results: imageResults(body)
857
+ });
858
+ },
859
+ async search(query, options = {}) {
860
+ const { call, rest } = callSettings(options);
861
+ const { engine = "google", ...chosen } = rest;
862
+ const o = chosen;
863
+ if (!Object.hasOwn(ENGINES, engine)) throw invalidRequest(provider, `does not offer the engine "${engine}"`);
864
+ const spec = ENGINES[engine];
865
+ onlyAllowed(engine, o, spec.allowed);
866
+ const { body, response } = await searchCall(raw, call, compact({
867
+ engine,
868
+ q: query,
869
+ ...spec.params(o),
870
+ no_cache: o.noCache === true ? true : void 0
871
+ }));
872
+ return compact({
873
+ answer: engine === "google" ? answerText(body) : void 0,
874
+ meta: searchMeta(body),
875
+ raw: response,
876
+ results: spec.results(body)
877
+ });
878
+ }
879
+ });
880
+ /** `reverseImage`: the pages an image appears on, through Google Lens. */
881
+ const matching = (raw) => ({ async reverseImage(imageUrl, options = {}) {
882
+ const { call, rest } = callSettings(options);
883
+ const { engine = "google_lens", ...chosen } = rest;
884
+ const o = chosen;
885
+ if (!Object.hasOwn(REVERSE_ENGINES, engine)) throw invalidRequest(provider, `does not offer the reverse image engine "${engine}"`);
886
+ if (!URL.canParse(imageUrl) || !/^https?:$/u.test(new URL(imageUrl).protocol)) throw invalidRequest(provider, "imageUrl must be an http or https URL");
887
+ const spec = REVERSE_ENGINES[engine];
888
+ onlyAllowed(engine, o, spec.allowed);
889
+ const { body, response } = await searchCall(raw, call, compact({
890
+ engine,
891
+ [spec.imageParam]: imageUrl,
892
+ ...spec.params(o),
893
+ no_cache: o.noCache === true ? true : void 0
894
+ }));
895
+ const results = spec.results(body);
896
+ return compact({
897
+ meta: reverseImageMeta(body, results),
898
+ raw: response,
899
+ results
900
+ });
901
+ } });
902
+ /** `usage`: the account's searches this month. */
903
+ const accounting = (raw) => ({ async usage(options = {}) {
904
+ const { call } = callSettings(options);
905
+ const response = await raw.request("GET", "/account", call);
906
+ const body = z.parse(AccountResponse, response);
907
+ const fields = z.safeParse(z.record(z.string(), z.unknown()), response);
908
+ const safe = fields.success ? Object.fromEntries(Object.entries(fields.data).filter(([name]) => name !== "api_key")) : response;
909
+ const breakdown = {};
910
+ if (body.this_hour_searches !== void 0) breakdown.this_hour_searches = body.this_hour_searches;
911
+ if (body.last_hour_searches !== void 0) breakdown.last_hour_searches = body.last_hour_searches;
912
+ return compact({
913
+ breakdown: Object.keys(breakdown).length > 0 ? breakdown : void 0,
914
+ limit: body.searches_per_month,
915
+ periodEnd: body.plan_renewal_date,
916
+ raw: safe,
917
+ remaining: body.plan_searches_left,
918
+ used: body.this_month_usage
919
+ });
920
+ } });
813
921
  /**
814
- * An adapter for SerpApi: search, images, reverse image and usage. Pass it to `new Fieldwork({ adapter })`.
922
+ * An adapter for SerpApi: search, images, reverse image and usage. Pass it to `fieldwork({ adapter })`.
815
923
  *
816
924
  * Throws `Unauthorized` when neither `apiKey` nor `SERPAPI_API_KEY` is set.
817
925
  */
@@ -829,117 +937,14 @@ const serpapi = (config = {}) => {
829
937
  provider,
830
938
  retries: config.retries
831
939
  });
832
- /** One `/search` call: the response as received, and its parsed body. A failed search throws. */
833
- const searchCall = async (call, query) => {
834
- const response = await raw.request("GET", "/search", {
835
- ...call,
836
- query
837
- });
838
- const body = z.parse(SearchResponse, response);
839
- const failure = searchFailure(body);
840
- if (failure !== void 0) throw new FieldworkError("ProviderError", failure, {
841
- cause: response,
842
- provider,
843
- retryable: true
844
- });
845
- return {
846
- body,
847
- response
848
- };
940
+ const operations = {
941
+ ...accounting(raw),
942
+ ...matching(raw),
943
+ ...searching(raw)
849
944
  };
850
945
  return defineAdapter({
851
946
  name: provider,
852
- operations: {
853
- async images(query, options) {
854
- const { call, rest: o } = callSettings(options);
855
- onlyAllowed("google_images", o, IMAGE_OPTIONS);
856
- refuseTogether(provider, o, "recency", "publishedAfter");
857
- refuseTogether(provider, o, "recency", "publishedBefore");
858
- const { body, response } = await searchCall(call, compact({
859
- device: o.device,
860
- end_date: compactDate("publishedBefore", o.publishedBefore),
861
- engine: "google_images",
862
- gl: googleCountry(o.country),
863
- hl: o.language,
864
- ijn: o.page,
865
- image_color: o.color,
866
- image_type: o.imageType,
867
- imgar: o.aspectRatio,
868
- imgsz: o.size,
869
- licenses: o.license,
870
- location: o.location,
871
- no_cache: o.noCache === true ? true : void 0,
872
- period_unit: o.recency === void 0 ? void 0 : RECENCY_CODE[o.recency],
873
- q: query,
874
- safe: o.safe,
875
- start_date: compactDate("publishedAfter", o.publishedAfter)
876
- }));
877
- return compact({
878
- meta: searchMeta(body),
879
- raw: response,
880
- results: imageResults(body)
881
- });
882
- },
883
- async reverseImage(imageUrl, options) {
884
- const { call, rest } = callSettings(options);
885
- const { engine = "google_lens", ...chosen } = rest;
886
- const o = { ...chosen };
887
- if (!Object.hasOwn(REVERSE_ENGINES, engine)) throw invalidRequest(provider, `does not offer the reverse image engine "${engine}"`);
888
- if (!URL.canParse(imageUrl) || !/^https?:$/u.test(new URL(imageUrl).protocol)) throw invalidRequest(provider, "imageUrl must be an http or https URL");
889
- const spec = REVERSE_ENGINES[engine];
890
- onlyAllowed(engine, o, spec.allowed);
891
- const { body, response } = await searchCall(call, compact({
892
- engine,
893
- [spec.imageParam]: imageUrl,
894
- ...spec.params(o),
895
- no_cache: o.noCache === true ? true : void 0
896
- }));
897
- const results = spec.results(body);
898
- return compact({
899
- meta: reverseImageMeta(body, results),
900
- raw: response,
901
- results
902
- });
903
- },
904
- async search(query, options) {
905
- const { call, rest } = callSettings(options);
906
- const { engine = "google", ...chosen } = rest;
907
- const o = { ...chosen };
908
- if (!Object.hasOwn(ENGINES, engine)) throw invalidRequest(provider, `does not offer the engine "${engine}"`);
909
- const spec = ENGINES[engine];
910
- onlyAllowed(engine, o, spec.allowed);
911
- const { body, response } = await searchCall(call, compact({
912
- engine,
913
- q: query,
914
- ...spec.params(o),
915
- no_cache: o.noCache === true ? true : void 0
916
- }));
917
- return compact({
918
- answer: engine === "google" ? answerText(body) : void 0,
919
- meta: searchMeta(body),
920
- raw: response,
921
- results: spec.results(body)
922
- });
923
- },
924
- async usage(options) {
925
- const { call } = callSettings(options);
926
- const response = await raw.request("GET", "/account", call);
927
- const body = z.parse(AccountResponse, response);
928
- const fields = z.safeParse(z.record(z.string(), z.unknown()), response);
929
- const safe = fields.success ? Object.fromEntries(Object.entries(fields.data).filter(([name]) => name !== "api_key")) : response;
930
- const breakdown = {};
931
- if (body.this_hour_searches !== void 0) breakdown.this_hour_searches = body.this_hour_searches;
932
- if (body.last_hour_searches !== void 0) breakdown.last_hour_searches = body.last_hour_searches;
933
- return compact({
934
- breakdown: Object.keys(breakdown).length > 0 ? breakdown : void 0,
935
- limit: body.searches_per_month,
936
- periodEnd: body.plan_renewal_date,
937
- raw: safe,
938
- remaining: body.plan_searches_left,
939
- used: body.this_month_usage
940
- });
941
- }
942
- },
947
+ operations,
943
948
  raw
944
949
  });
945
950
  };
package/dist/tavily.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { $ as Research, F as ImageSearch, G as PageBatch, Q as Recency, W as Page, _ as Crawl, a as RawClient, at as SiteMap, l as Answer, nt as SearchResponse, p as CallOptions, s as AccountUsage, t as Adapter } from "./adapter-B8kAAAgF.js";
2
- import { t as OutputSchema } from "./schema-CAPSX7yQ.js";
1
+ import { a as RawClient, t as Adapter } from "./adapter-J2yatZJ0.js";
2
+ import { t as OutputSchema } from "./schema-C9xzRkKJ.js";
3
+ import { B as Page, J as Recency, Q as SearchResponse, V as PageBatch, Y as Research, a as Answer, j as ImageSearch, l as CallOptions, p as Crawl, r as AccountUsage, tt as SiteMap } from "./errors-gMtejKHc.js";
3
4
  /** Settings for the Tavily adapter. */
4
5
  interface TavilyConfig {
5
6
  /** Defaults to the TAVILY_API_KEY environment variable. */
@@ -197,7 +198,7 @@ interface TavilyOperations {
197
198
  usage: (options?: CallOptions) => Promise<AccountUsage>;
198
199
  }
199
200
  /**
200
- * An adapter for Tavily: search, images, read, readMany, map, crawl, answer, research and usage. Pass it to `new Fieldwork({ adapter })`.
201
+ * An adapter for Tavily: search, images, read, readMany, map, crawl, answer, research and usage. Pass it to `fieldwork({ adapter })`.
201
202
  *
202
203
  * Throws `Unauthorized` when neither `apiKey` nor `TAVILY_API_KEY` is set.
203
204
  */