@expandai/sdk 0.19.0 → 0.20.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 (72) hide show
  1. package/README.md +130 -4
  2. package/build/dts/AppendixMarkers.d.ts +30 -0
  3. package/build/dts/AppendixMarkers.d.ts.map +1 -0
  4. package/build/dts/Client.d.ts +41 -6
  5. package/build/dts/Client.d.ts.map +1 -1
  6. package/build/dts/Crawls.d.ts +568 -0
  7. package/build/dts/Crawls.d.ts.map +1 -0
  8. package/build/dts/EnvProxyHttpClient.d.ts +28 -0
  9. package/build/dts/EnvProxyHttpClient.d.ts.map +1 -0
  10. package/build/dts/FetchJson.d.ts +444 -37
  11. package/build/dts/FetchJson.d.ts.map +1 -1
  12. package/build/dts/Generated.d.ts +1545 -788
  13. package/build/dts/Generated.d.ts.map +1 -1
  14. package/build/dts/HttpClientHelpers.d.ts +13 -0
  15. package/build/dts/HttpClientHelpers.d.ts.map +1 -1
  16. package/build/dts/Internal.d.ts +6 -4
  17. package/build/dts/Internal.d.ts.map +1 -1
  18. package/build/dts/ParseErrorBody.d.ts +26 -0
  19. package/build/dts/ParseErrorBody.d.ts.map +1 -0
  20. package/build/dts/Playground.d.ts +20 -0
  21. package/build/dts/Playground.d.ts.map +1 -1
  22. package/build/dts/RetryAfter.d.ts +40 -0
  23. package/build/dts/RetryAfter.d.ts.map +1 -0
  24. package/build/dts/Service.d.ts +94 -45
  25. package/build/dts/Service.d.ts.map +1 -1
  26. package/build/dts/StreamPage.d.ts +10 -0
  27. package/build/dts/StreamPage.d.ts.map +1 -0
  28. package/build/dts/index.d.ts +9 -2
  29. package/build/dts/index.d.ts.map +1 -1
  30. package/build/esm/AppendixMarkers.js +307 -0
  31. package/build/esm/AppendixMarkers.js.map +1 -0
  32. package/build/esm/Client.js +96 -15
  33. package/build/esm/Client.js.map +1 -1
  34. package/build/esm/Crawls.js +786 -0
  35. package/build/esm/Crawls.js.map +1 -0
  36. package/build/esm/EnvProxyHttpClient.js +55 -0
  37. package/build/esm/EnvProxyHttpClient.js.map +1 -0
  38. package/build/esm/FetchJson.js +48 -22
  39. package/build/esm/FetchJson.js.map +1 -1
  40. package/build/esm/Generated.js +540 -112
  41. package/build/esm/Generated.js.map +1 -1
  42. package/build/esm/HttpClientHelpers.js +36 -1
  43. package/build/esm/HttpClientHelpers.js.map +1 -1
  44. package/build/esm/Internal.js +140 -33
  45. package/build/esm/Internal.js.map +1 -1
  46. package/build/esm/ParseErrorBody.js +41 -0
  47. package/build/esm/ParseErrorBody.js.map +1 -0
  48. package/build/esm/Playground.js +38 -0
  49. package/build/esm/Playground.js.map +1 -1
  50. package/build/esm/RetryAfter.js +104 -0
  51. package/build/esm/RetryAfter.js.map +1 -0
  52. package/build/esm/Service.js +96 -17
  53. package/build/esm/Service.js.map +1 -1
  54. package/build/esm/StreamPage.js +46 -0
  55. package/build/esm/StreamPage.js.map +1 -0
  56. package/build/esm/index.js +5 -1
  57. package/build/esm/index.js.map +1 -1
  58. package/package.json +8 -2
  59. package/src/AppendixMarkers.ts +370 -0
  60. package/src/Client.ts +131 -16
  61. package/src/Crawls.ts +1387 -0
  62. package/src/EnvProxyHttpClient.ts +71 -0
  63. package/src/FetchJson.ts +63 -25
  64. package/src/Generated.ts +738 -162
  65. package/src/HttpClientHelpers.ts +48 -1
  66. package/src/Internal.ts +163 -105
  67. package/src/ParseErrorBody.ts +42 -0
  68. package/src/Playground.ts +48 -0
  69. package/src/RetryAfter.ts +138 -0
  70. package/src/Service.ts +208 -25
  71. package/src/StreamPage.ts +47 -0
  72. package/src/index.ts +29 -3
package/src/Generated.ts CHANGED
@@ -8,10 +8,17 @@ import * as Effect from 'effect/Effect'
8
8
  import type { ParseError } from 'effect/ParseResult'
9
9
  import * as S from 'effect/Schema'
10
10
 
11
+ export class FetchFetchParamsAppendixMarkers extends S.Literal('off', 'compact', 'detailed') {}
12
+
11
13
  export class FetchFetchParams extends S.Struct({
12
14
  include: S.optionalWith(S.String, { nullable: true }),
15
+ appendixMarkers: S.optionalWith(FetchFetchParamsAppendixMarkers, { nullable: true }),
13
16
  }) {}
14
17
 
18
+ export class FetchFetchRequestIncludeAppendixMarkers extends S.Literal('off', 'compact', 'detailed') {}
19
+
20
+ export class FetchFetchRequestDocumentConfigOcr extends S.Literal('auto', 'never', 'always') {}
21
+
15
22
  export class FetchFetchRequest extends S.Class<FetchFetchRequest>('FetchFetchRequest')({
16
23
  url: S.String,
17
24
  include: S.optionalWith(
@@ -47,10 +54,14 @@ export class FetchFetchRequest extends S.Class<FetchFetchRequest>('FetchFetchReq
47
54
  ),
48
55
  json: S.optionalWith(S.Boolean, { nullable: true, default: () => false as const }),
49
56
  appendix: S.optionalWith(S.Boolean, { nullable: true }),
57
+ appendixMarkers: S.optionalWith(FetchFetchRequestIncludeAppendixMarkers, {
58
+ nullable: true,
59
+ default: () => 'compact' as const,
60
+ }),
50
61
  }),
51
62
  { nullable: true },
52
63
  ),
53
- search: S.optionalWith(
64
+ highlights: S.optionalWith(
54
65
  S.Struct({
55
66
  query: S.String,
56
67
  maxResults: S.optionalWith(S.Int.pipe(S.greaterThanOrEqualTo(1), S.lessThanOrEqualTo(50)), {
@@ -70,6 +81,17 @@ export class FetchFetchRequest extends S.Class<FetchFetchRequest>('FetchFetchReq
70
81
  }),
71
82
  { nullable: true },
72
83
  ),
84
+ documentConfig: S.optionalWith(
85
+ S.Struct({
86
+ maxPages: S.optionalWith(S.Int.pipe(S.greaterThanOrEqualTo(1)), { nullable: true }),
87
+ maxAudioSeconds: S.optionalWith(S.Int.pipe(S.greaterThanOrEqualTo(1), S.lessThanOrEqualTo(14400)), {
88
+ nullable: true,
89
+ default: () => 3600 as const,
90
+ }),
91
+ ocr: S.optionalWith(FetchFetchRequestDocumentConfigOcr, { nullable: true, default: () => 'auto' as const }),
92
+ }),
93
+ { nullable: true },
94
+ ),
73
95
  }) {}
74
96
 
75
97
  export class IssueTag extends S.Literal(
@@ -154,13 +176,42 @@ export class FetchFetch403 extends S.Union(
154
176
  FetchBlocked,
155
177
  ) {}
156
178
 
179
+ export class FetchOriginNotFoundTag extends S.Literal('FetchOriginHttpError') {}
180
+
181
+ export class FetchOriginNotFoundStatusCode extends S.Literal(404) {}
182
+
183
+ export class FetchOriginNotFound extends S.Class<FetchOriginNotFound>('FetchOriginNotFound')({
184
+ _tag: FetchOriginNotFoundTag,
185
+ url: S.String,
186
+ statusCode: FetchOriginNotFoundStatusCode,
187
+ contentType: S.optionalWith(S.String, { nullable: true }),
188
+ }) {}
189
+
190
+ export class FetchOriginGoneTag extends S.Literal('FetchOriginHttpError') {}
191
+
192
+ export class FetchOriginGoneStatusCode extends S.Literal(410) {}
193
+
194
+ export class FetchOriginGone extends S.Class<FetchOriginGone>('FetchOriginGone')({
195
+ _tag: FetchOriginGoneTag,
196
+ url: S.String,
197
+ statusCode: FetchOriginGoneStatusCode,
198
+ contentType: S.optionalWith(S.String, { nullable: true }),
199
+ }) {}
200
+
157
201
  export class PayloadTooLargeTag extends S.Literal('PayloadTooLarge') {}
158
202
 
159
203
  export class PayloadTooLarge extends S.Struct({
160
204
  _tag: PayloadTooLargeTag,
161
205
  }) {}
162
206
 
163
- export class FetchPageTooLargeLimitKind extends S.Literal('transfer_bytes', 'domsnapshot_bytes', 'ast_bytes') {}
207
+ export class FetchPageTooLargeLimitKind extends S.Literal(
208
+ 'transfer_bytes',
209
+ 'domsnapshot_bytes',
210
+ 'ast_bytes',
211
+ 'document_frame_bytes',
212
+ 'document_pages',
213
+ 'audio_seconds',
214
+ ) {}
164
215
 
165
216
  export class FetchPageTooLargeTag extends S.Literal('FetchPageTooLarge') {}
166
217
 
@@ -169,61 +220,176 @@ export class FetchPageTooLarge extends S.Struct({
169
220
  limitKind: S.optionalWith(FetchPageTooLargeLimitKind, { nullable: true }),
170
221
  limitBytes: S.optionalWith(S.Number, { nullable: true }),
171
222
  measuredBytes: S.optionalWith(S.Number, { nullable: true }),
223
+ limit: S.optionalWith(S.Number, { nullable: true }),
224
+ measured: S.optionalWith(S.Number, { nullable: true }),
172
225
  _tag: FetchPageTooLargeTag,
173
226
  }) {}
174
227
 
175
228
  export class FetchFetch413 extends S.Union(PayloadTooLarge, FetchPageTooLarge) {}
176
229
 
230
+ export class FetchUnsupportedContentTypeTag extends S.Literal('FetchUnsupportedContentType') {}
231
+
232
+ export class FetchUnsupportedContentType extends S.Class<FetchUnsupportedContentType>('FetchUnsupportedContentType')({
233
+ url: S.String,
234
+ contentType: S.optionalWith(S.String, { nullable: true }),
235
+ _tag: FetchUnsupportedContentTypeTag,
236
+ }) {}
237
+
238
+ export class FetchVideoUnavailableAvailability extends S.Literal(
239
+ 'private',
240
+ 'removed',
241
+ 'geoRestricted',
242
+ 'ageRestricted',
243
+ 'membersOnly',
244
+ 'live',
245
+ 'upcoming',
246
+ 'unknown',
247
+ ) {}
248
+
249
+ export class FetchVideoUnavailableTag extends S.Literal('FetchVideoUnavailable') {}
250
+
251
+ export class FetchVideoUnavailable extends S.Class<FetchVideoUnavailable>('FetchVideoUnavailable')({
252
+ url: S.String,
253
+ availability: FetchVideoUnavailableAvailability,
254
+ message: S.optionalWith(S.String, { nullable: true }),
255
+ _tag: FetchVideoUnavailableTag,
256
+ }) {}
257
+
258
+ export class TooManyRequestsRetryable extends S.Literal(true) {}
259
+
177
260
  export class TooManyRequestsTag extends S.Literal('TooManyRequests') {}
178
261
 
179
- export class TooManyRequests extends S.Class<TooManyRequests>('TooManyRequests')({
262
+ export class TooManyRequests extends S.Struct({
263
+ retryable: S.optionalWith(TooManyRequestsRetryable, { default: () => true }),
264
+ retryAfterSeconds: S.optionalWith(S.Number, { nullable: true }),
180
265
  _tag: TooManyRequestsTag,
181
266
  }) {}
182
267
 
268
+ export class FetchConcurrencyLimitExceededRetryable extends S.Literal(true) {}
269
+
270
+ export class FetchConcurrencyLimitExceededTag extends S.Literal('FetchConcurrencyLimitExceeded') {}
271
+
272
+ export class FetchConcurrencyLimitExceeded extends S.Struct({
273
+ retryable: S.optionalWith(FetchConcurrencyLimitExceededRetryable, { default: () => true }),
274
+ retryAfterSeconds: S.Number,
275
+ maxConcurrency: S.Number,
276
+ message: S.optionalWith(S.String, { nullable: true }),
277
+ requestId: S.optionalWith(S.String, { nullable: true }),
278
+ _tag: FetchConcurrencyLimitExceededTag,
279
+ }) {}
280
+
281
+ export class FetchFetch429 extends S.Union(TooManyRequests, FetchConcurrencyLimitExceeded) {}
282
+
283
+ export class InternalErrorRetryable extends S.Literal(true) {}
284
+
183
285
  export class InternalErrorTag extends S.Literal('InternalError') {}
184
286
 
185
287
  export class InternalError extends S.Class<InternalError>('InternalError')({
288
+ retryable: S.optionalWith(InternalErrorRetryable, { default: () => true }),
186
289
  _tag: InternalErrorTag,
187
290
  }) {}
188
291
 
292
+ export class FetchCaptureFailedFailureType extends S.Literal('pageNeverSettled', 'capabilityFailed') {}
293
+
294
+ export class FetchCaptureFailedRetryable extends S.Literal(false) {}
295
+
296
+ export class FetchCaptureFailedTag extends S.Literal('FetchCaptureFailed') {}
297
+
298
+ export class FetchCaptureFailed extends S.Struct({
299
+ url: S.String,
300
+ failureType: FetchCaptureFailedFailureType,
301
+ retryable: S.optionalWith(FetchCaptureFailedRetryable, { default: () => false }),
302
+ _tag: FetchCaptureFailedTag,
303
+ }) {}
304
+
189
305
  export class FetchNavigationFailedFailureType extends S.Literal('browserInternalDocument') {}
190
306
 
307
+ export class FetchNavigationFailedRetryable extends S.Literal(false) {}
308
+
191
309
  export class FetchNavigationFailedTag extends S.Literal('FetchNavigationFailed') {}
192
310
 
193
- export class FetchNavigationFailed extends S.Class<FetchNavigationFailed>('FetchNavigationFailed')({
311
+ export class FetchNavigationFailed extends S.Struct({
194
312
  url: S.String,
195
313
  failureType: FetchNavigationFailedFailureType,
314
+ retryable: S.optionalWith(FetchNavigationFailedRetryable, { default: () => false }),
196
315
  _tag: FetchNavigationFailedTag,
197
316
  }) {}
198
317
 
318
+ export class FetchOriginHttpErrorTag extends S.Literal('FetchOriginHttpError') {}
319
+
320
+ export class FetchOriginHttpError extends S.Struct({
321
+ url: S.String,
322
+ statusCode: S.Number,
323
+ contentType: S.optionalWith(S.String, { nullable: true }),
324
+ _tag: FetchOriginHttpErrorTag,
325
+ }) {}
326
+
327
+ export class FetchFetch502 extends S.Union(FetchCaptureFailed, FetchNavigationFailed, FetchOriginHttpError) {}
328
+
329
+ export class ServiceUnavailableDispatchOutcome extends S.Literal(
330
+ 'cancelled_before_start',
331
+ 'cancelled_after_start',
332
+ 'unknown',
333
+ ) {}
334
+
335
+ export class ServiceUnavailableRetryable extends S.Literal(true) {}
336
+
199
337
  export class ServiceUnavailableTag extends S.Literal('ServiceUnavailable') {}
200
338
 
201
- export class ServiceUnavailable extends S.Class<ServiceUnavailable>('ServiceUnavailable')({
339
+ export class ServiceUnavailable extends S.Struct({
202
340
  message: S.optionalWith(S.String, { nullable: true }),
203
341
  requestId: S.optionalWith(S.String, { nullable: true }),
342
+ dispatchOutcome: S.optionalWith(ServiceUnavailableDispatchOutcome, { nullable: true }),
343
+ retryable: S.optionalWith(ServiceUnavailableRetryable, { default: () => true }),
204
344
  _tag: ServiceUnavailableTag,
205
345
  }) {}
206
346
 
347
+ export class FetchDocumentProcessingUnavailableOperation extends S.Literal('ocr', 'transcription', 'video') {}
348
+
349
+ export class FetchDocumentProcessingUnavailableTag extends S.Literal('FetchDocumentProcessingUnavailable') {}
350
+
351
+ export class FetchDocumentProcessingUnavailable extends S.Struct({
352
+ url: S.String,
353
+ operation: FetchDocumentProcessingUnavailableOperation,
354
+ message: S.String,
355
+ _tag: FetchDocumentProcessingUnavailableTag,
356
+ }) {}
357
+
358
+ export class FetchFetch503 extends S.Union(ServiceUnavailable, FetchDocumentProcessingUnavailable) {}
359
+
360
+ export class FetchCaptureTimeoutRetryable extends S.Literal(false) {}
361
+
207
362
  export class FetchCaptureTimeoutTag extends S.Literal('FetchCaptureTimeout') {}
208
363
 
209
364
  export class FetchCaptureTimeout extends S.Class<FetchCaptureTimeout>('FetchCaptureTimeout')({
210
365
  url: S.String,
211
366
  timeoutMs: S.optionalWith(S.Number, { nullable: true }),
367
+ retryable: S.optionalWith(FetchCaptureTimeoutRetryable, { default: () => false }),
212
368
  _tag: FetchCaptureTimeoutTag,
213
369
  }) {}
214
370
 
371
+ export class FetchCapacityTimeoutRetryable extends S.Literal(true) {}
372
+
215
373
  export class FetchCapacityTimeoutTag extends S.Literal('FetchCapacityTimeout') {}
216
374
 
217
375
  export class FetchCapacityTimeout extends S.Class<FetchCapacityTimeout>('FetchCapacityTimeout')({
218
376
  url: S.String,
219
377
  timeoutMs: S.optionalWith(S.Number, { nullable: true }),
378
+ retryable: S.optionalWith(FetchCapacityTimeoutRetryable, { default: () => true }),
220
379
  _tag: FetchCapacityTimeoutTag,
221
380
  }) {}
222
381
 
382
+ export class FetchFetchJsonParamsAppendixMarkers extends S.Literal('off', 'compact', 'detailed') {}
383
+
223
384
  export class FetchFetchJsonParams extends S.Struct({
224
385
  include: S.optionalWith(S.String, { nullable: true }),
386
+ appendixMarkers: S.optionalWith(FetchFetchJsonParamsAppendixMarkers, { nullable: true }),
225
387
  }) {}
226
388
 
389
+ export class FetchFetchJsonRequestIncludeAppendixMarkers extends S.Literal('off', 'compact', 'detailed') {}
390
+
391
+ export class FetchFetchJsonRequestDocumentConfigOcr extends S.Literal('auto', 'never', 'always') {}
392
+
227
393
  export class FetchFetchJsonRequest extends S.Class<FetchFetchJsonRequest>('FetchFetchJsonRequest')({
228
394
  url: S.String,
229
395
  include: S.optionalWith(
@@ -259,10 +425,14 @@ export class FetchFetchJsonRequest extends S.Class<FetchFetchJsonRequest>('Fetch
259
425
  ),
260
426
  json: S.optionalWith(S.Boolean, { nullable: true, default: () => false as const }),
261
427
  appendix: S.optionalWith(S.Boolean, { nullable: true }),
428
+ appendixMarkers: S.optionalWith(FetchFetchJsonRequestIncludeAppendixMarkers, {
429
+ nullable: true,
430
+ default: () => 'compact' as const,
431
+ }),
262
432
  }),
263
433
  { nullable: true },
264
434
  ),
265
- search: S.optionalWith(
435
+ highlights: S.optionalWith(
266
436
  S.Struct({
267
437
  query: S.String,
268
438
  maxResults: S.optionalWith(S.Int.pipe(S.greaterThanOrEqualTo(1), S.lessThanOrEqualTo(50)), {
@@ -282,18 +452,47 @@ export class FetchFetchJsonRequest extends S.Class<FetchFetchJsonRequest>('Fetch
282
452
  }),
283
453
  { nullable: true },
284
454
  ),
455
+ documentConfig: S.optionalWith(
456
+ S.Struct({
457
+ maxPages: S.optionalWith(S.Int.pipe(S.greaterThanOrEqualTo(1)), { nullable: true }),
458
+ maxAudioSeconds: S.optionalWith(S.Int.pipe(S.greaterThanOrEqualTo(1), S.lessThanOrEqualTo(14400)), {
459
+ nullable: true,
460
+ default: () => 3600 as const,
461
+ }),
462
+ ocr: S.optionalWith(FetchFetchJsonRequestDocumentConfigOcr, { nullable: true, default: () => 'auto' as const }),
463
+ }),
464
+ { nullable: true },
465
+ ),
285
466
  }) {}
286
467
 
287
468
  export class FetchObjectModeMetaVersion extends S.Literal(1) {}
288
469
 
470
+ export class Int extends S.Int {}
471
+
289
472
  export class FetchObjectModeAppendixLinks extends S.Struct({
290
473
  sameDomain: S.Number,
291
474
  external: S.Number,
292
475
  }) {}
293
476
 
477
+ export class FetchObjectModeAppendixOmitted extends S.Struct({
478
+ blocks: S.Number,
479
+ approxTokens: S.Number,
480
+ }) {}
481
+
482
+ export class FetchObjectModeAppendixMarker extends S.Struct({
483
+ evidenceId: S.optionalWith(S.Number, { nullable: true }),
484
+ links: S.Number,
485
+ approxTokens: S.Number,
486
+ label: S.optionalWith(S.String, { nullable: true }),
487
+ preview: S.optionalWith(S.String, { nullable: true }),
488
+ moreBlocks: S.optionalWith(S.Number, { nullable: true }),
489
+ }) {}
490
+
294
491
  export class FetchObjectModeAppendixHint extends S.Struct({
295
492
  url: S.String,
296
493
  links: FetchObjectModeAppendixLinks,
494
+ omitted: S.optionalWith(FetchObjectModeAppendixOmitted, { nullable: true }),
495
+ markers: S.optionalWith(S.Array(FetchObjectModeAppendixMarker), { nullable: true }),
297
496
  }) {}
298
497
 
299
498
  export class FetchObjectModeStateJsonHint extends S.Struct({
@@ -305,6 +504,15 @@ export class FetchObjectModeMarkdownHint extends S.Struct({
305
504
  moreTokens: S.optionalWith(S.Number, { nullable: true }),
306
505
  }) {}
307
506
 
507
+ export class FetchObjectModeResourcesVersion extends S.Literal(1) {}
508
+
509
+ export class FetchObjectModeResources extends S.Struct({
510
+ version: FetchObjectModeResourcesVersion,
511
+ snapshotId: S.String,
512
+ url: S.String,
513
+ markdownUrl: S.String,
514
+ }) {}
515
+
308
516
  export class FetchObjectModeMeta extends S.Struct({
309
517
  version: FetchObjectModeMetaVersion,
310
518
  url: S.String,
@@ -313,8 +521,10 @@ export class FetchObjectModeMeta extends S.Struct({
313
521
  lang: S.String,
314
522
  pageType: S.String,
315
523
  playground: S.String,
524
+ citationEvidenceIds: S.optionalWith(S.Array(Int).pipe(S.maxItems(3)), { nullable: true }),
316
525
  title: S.optionalWith(S.String, { nullable: true }),
317
526
  finalUrl: S.optionalWith(S.String, { nullable: true }),
527
+ contentType: S.optionalWith(S.String, { nullable: true }),
318
528
  canonical: S.optionalWith(S.String, { nullable: true }),
319
529
  description: S.optionalWith(S.String, { nullable: true }),
320
530
  author: S.optionalWith(S.String, { nullable: true }),
@@ -325,6 +535,7 @@ export class FetchObjectModeMeta extends S.Struct({
325
535
  appendix: S.optionalWith(FetchObjectModeAppendixHint, { nullable: true }),
326
536
  stateJson: S.optionalWith(FetchObjectModeStateJsonHint, { nullable: true }),
327
537
  markdown: S.optionalWith(FetchObjectModeMarkdownHint, { nullable: true }),
538
+ resources: S.optionalWith(FetchObjectModeResources, { nullable: true }),
328
539
  blocked: S.optionalWith(S.String, { nullable: true }),
329
540
  loadingStatus: S.optionalWith(S.String, { nullable: true }),
330
541
  }) {}
@@ -353,7 +564,7 @@ export class FetchObjectModeEvidence extends S.Struct({
353
564
  id: S.Number,
354
565
  kind: FetchObjectModeEvidenceKind,
355
566
  role: FetchObjectModeEvidenceRole,
356
- score: S.Number,
567
+ score: S.Number.pipe(S.greaterThanOrEqualTo(0)),
357
568
  url: S.optionalWith(S.String, { nullable: true }),
358
569
  method: S.optionalWith(S.String, { nullable: true }),
359
570
  moreTokens: S.optionalWith(S.Number, { nullable: true }),
@@ -376,7 +587,12 @@ export class FetchAssetReference extends S.Struct({
376
587
 
377
588
  export class FetchDegradedInfoReason extends S.Literal('pageTooLarge', 'modelInputTooLarge') {}
378
589
 
379
- export class FetchDegradedInfoLimitKind extends S.Literal('domsnapshot_bytes', 'ast_bytes', 'hfc_tokens') {}
590
+ export class FetchDegradedInfoLimitKind extends S.Literal(
591
+ 'domsnapshot_bytes',
592
+ 'ast_bytes',
593
+ 'document_frame_bytes',
594
+ 'hfc_tokens',
595
+ ) {}
380
596
 
381
597
  export class FetchDegradedInfo extends S.Struct({
382
598
  reason: FetchDegradedInfoReason,
@@ -388,9 +604,7 @@ export class FetchDegradedInfo extends S.Struct({
388
604
  thresholdTokens: S.optionalWith(S.Int.pipe(S.greaterThanOrEqualTo(0)), { nullable: true }),
389
605
  }) {}
390
606
 
391
- export class Int extends S.Int {}
392
-
393
- export class FetchSearchSnippetLocation extends S.Struct({
607
+ export class FetchHighlightsSnippetLocation extends S.Struct({
394
608
  evidenceId: S.optionalWith(Int, { nullable: true }),
395
609
  markdownBlockId: S.optionalWith(S.String, { nullable: true }),
396
610
  nodeIds: S.optionalWith(S.Array(S.Number), { nullable: true }),
@@ -398,28 +612,28 @@ export class FetchSearchSnippetLocation extends S.Struct({
398
612
  jsonPath: S.optionalWith(S.String, { nullable: true }),
399
613
  }) {}
400
614
 
401
- export class FetchSearchSourceMetaSource extends S.Literal('markdown', 'appendix', 'statejson') {}
615
+ export class FetchHighlightsSourceMetaSource extends S.Literal('markdown', 'appendix', 'statejson') {}
402
616
 
403
- export class FetchSearchSourceMetaRanker extends S.Literal('zeroentropy', 'mixedbread', 'local_lexical') {}
617
+ export class FetchHighlightsSourceMetaRanker extends S.Literal('zeroentropy', 'mixedbread', 'local_lexical') {}
404
618
 
405
- export class FetchSearchSourceMetaFallbackReason extends S.Literal('timeout', 'error') {}
619
+ export class FetchHighlightsSourceMetaFallbackReason extends S.Literal('timeout', 'error') {}
406
620
 
407
- export class FetchSearchSourceMeta extends S.Struct({
408
- source: FetchSearchSourceMetaSource,
621
+ export class FetchHighlightsSourceMeta extends S.Struct({
622
+ source: FetchHighlightsSourceMetaSource,
409
623
  chunkCount: S.Int.pipe(S.greaterThanOrEqualTo(0)),
410
624
  batchCount: S.Int.pipe(S.greaterThanOrEqualTo(0)),
411
- ranker: FetchSearchSourceMetaRanker,
625
+ ranker: FetchHighlightsSourceMetaRanker,
412
626
  fallback: S.Boolean,
413
- fallbackReason: S.optionalWith(FetchSearchSourceMetaFallbackReason, { nullable: true }),
627
+ fallbackReason: S.optionalWith(FetchHighlightsSourceMetaFallbackReason, { nullable: true }),
414
628
  durationMs: S.Number.pipe(S.greaterThanOrEqualTo(0)),
415
629
  }) {}
416
630
 
417
- export class FetchSearchMeta extends S.Struct({
631
+ export class FetchHighlightsMeta extends S.Struct({
418
632
  durationMs: S.Number.pipe(S.greaterThanOrEqualTo(0)),
419
- sources: S.Array(FetchSearchSourceMeta),
633
+ sources: S.Array(FetchHighlightsSourceMeta),
420
634
  }) {}
421
635
 
422
- export class FetchSearchResult extends S.Struct({
636
+ export class FetchHighlightsResult extends S.Struct({
423
637
  query: S.String,
424
638
  snippets: S.Array(
425
639
  S.Struct({
@@ -427,13 +641,38 @@ export class FetchSearchResult extends S.Struct({
427
641
  source: S.Literal('markdown', 'appendix', 'statejson'),
428
642
  text: S.String,
429
643
  score: S.Number.pipe(S.greaterThanOrEqualTo(0), S.lessThanOrEqualTo(1)),
430
- location: S.optionalWith(FetchSearchSnippetLocation, { nullable: true }),
644
+ location: S.optionalWith(FetchHighlightsSnippetLocation, { nullable: true }),
431
645
  }),
432
646
  ),
433
- meta: S.optionalWith(FetchSearchMeta, { nullable: true }),
647
+ meta: S.optionalWith(FetchHighlightsMeta, { nullable: true }),
648
+ }) {}
649
+
650
+ export class FetchObjectModeResultDataVideoProvider extends S.Literal('youtube') {}
651
+
652
+ export class FetchObjectModeResultDataVideoTranscriptSource extends S.Literal('captions', 'transcription') {}
653
+
654
+ export class FetchObjectModeResultDataVideoTranscriptKind extends S.Literal('manual', 'auto') {}
655
+
656
+ export class FetchHttpOriginErrorKind extends S.Literal('http') {}
657
+
658
+ export class FetchHttpOriginErrorContentAvailable extends S.Literal(false) {}
659
+
660
+ export class FetchHttpOriginErrorRedirectLimitReached extends S.Literal(true) {}
661
+
662
+ export class FetchHttpOriginErrorTag extends S.Literal('FetchOriginError') {}
663
+
664
+ export class FetchHttpOriginError extends S.Struct({
665
+ url: S.String,
666
+ kind: FetchHttpOriginErrorKind,
667
+ contentAvailable: S.optionalWith(FetchHttpOriginErrorContentAvailable, { nullable: true }),
668
+ finalUrl: S.optionalWith(S.String, { nullable: true }),
669
+ redirectLimitReached: S.optionalWith(FetchHttpOriginErrorRedirectLimitReached, { nullable: true }),
670
+ originStatusCode: S.Number,
671
+ retryable: S.Boolean,
672
+ _tag: FetchHttpOriginErrorTag,
434
673
  }) {}
435
674
 
436
- export class FetchObjectModeResult extends S.Class<FetchObjectModeResult>('FetchObjectModeResult')({
675
+ export class FetchObjectModeResult extends S.Struct({
437
676
  meta: FetchObjectModeMeta,
438
677
  markdown: S.String,
439
678
  json: S.Array(FetchObjectModeEvidence),
@@ -441,7 +680,7 @@ export class FetchObjectModeResult extends S.Class<FetchObjectModeResult>('Fetch
441
680
  S.Struct({
442
681
  assets: S.optionalWith(S.Array(FetchAssetReference), { nullable: true }),
443
682
  degraded: S.optionalWith(FetchDegradedInfo, { nullable: true }),
444
- search: S.optionalWith(FetchSearchResult, { nullable: true }),
683
+ highlights: S.optionalWith(FetchHighlightsResult, { nullable: true }),
445
684
  screenshot: S.optionalWith(
446
685
  S.Struct({
447
686
  url: S.String,
@@ -449,116 +688,154 @@ export class FetchObjectModeResult extends S.Class<FetchObjectModeResult>('Fetch
449
688
  }),
450
689
  { nullable: true },
451
690
  ),
452
- }),
453
- { nullable: true },
454
- ),
455
- }) {}
456
-
457
- export class FetchFetchJson400 extends S.Union(HttpApiDecodeError, BadRequest) {}
458
-
459
- export class FetchFetchJson403 extends S.Union(
460
- S.Struct({
461
- organizationId: S.String.pipe(S.minLength(1)),
462
- blockedUntil: S.optionalWith(S.Union(DateTimeUtc, S.Null), { nullable: true }),
463
- _tag: S.Literal('AccessBlocked'),
464
- }),
465
- FetchBlocked,
466
- ) {}
467
-
468
- export class FetchFetchJson413 extends S.Union(PayloadTooLarge, FetchPageTooLarge) {}
469
-
470
- export class FetchFetchSearchRequest extends S.Class<FetchFetchSearchRequest>('FetchFetchSearchRequest')({
471
- snapshotId: S.String.pipe(S.minLength(1)),
472
- search: S.Struct({
473
- query: S.String,
474
- maxResults: S.optionalWith(S.Int.pipe(S.greaterThanOrEqualTo(1), S.lessThanOrEqualTo(50)), {
475
- nullable: true,
476
- default: () => 5 as const,
477
- }),
478
- minScore: S.optionalWith(S.Number.pipe(S.greaterThanOrEqualTo(0), S.lessThanOrEqualTo(1)), {
479
- nullable: true,
480
- default: () => 0.6 as const,
481
- }),
482
- }),
483
- include: S.optionalWith(
484
- S.Struct({
485
- html: S.optionalWith(S.Union(S.Boolean, S.Record({ key: S.String, value: S.Unknown })), { nullable: true }),
486
- markdown: S.optionalWith(S.Union(S.Boolean, S.Record({ key: S.String, value: S.Unknown })), { nullable: true }),
487
- screenshot: S.optionalWith(
488
- S.Union(
489
- S.Boolean,
490
- S.Struct({
491
- fullPage: S.optionalWith(S.Boolean, { nullable: true }),
492
- }),
493
- ),
691
+ document: S.optionalWith(
692
+ S.Struct({
693
+ url: S.String,
694
+ contentType: S.String,
695
+ sizeBytes: S.Number,
696
+ }),
494
697
  { nullable: true },
495
698
  ),
496
- links: S.optionalWith(
497
- S.Union(
498
- S.Boolean,
499
- S.Struct({
500
- sameDomainOnly: S.optionalWith(S.Boolean, { nullable: true, default: () => true as const }),
501
- includePatterns: S.optionalWith(S.Array(S.String), { nullable: true }),
502
- excludePatterns: S.optionalWith(S.Array(S.String), { nullable: true }),
503
- }),
504
- ),
699
+ usage: S.optionalWith(
700
+ S.Struct({
701
+ documentPages: Int,
702
+ ocrPages: Int,
703
+ audioSeconds: S.Number.pipe(S.greaterThanOrEqualTo(0)),
704
+ videos: S.optionalWith(Int, { nullable: true }),
705
+ }),
505
706
  { nullable: true },
506
707
  ),
507
- meta: S.optionalWith(S.Boolean, { nullable: true, default: () => true as const }),
508
- response: S.optionalWith(
708
+ video: S.optionalWith(
509
709
  S.Struct({
510
- includeHeaders: S.optionalWith(S.Boolean, { nullable: true, default: () => false as const }),
710
+ provider: FetchObjectModeResultDataVideoProvider,
711
+ videoId: S.String,
712
+ title: S.String,
713
+ channel: S.optionalWith(S.String, { nullable: true }),
714
+ channelUrl: S.optionalWith(S.String, { nullable: true }),
715
+ durationSeconds: S.optionalWith(S.Number, { nullable: true }),
716
+ publishedAt: S.optionalWith(S.String, { nullable: true }),
717
+ viewCount: S.optionalWith(S.Number, { nullable: true }),
718
+ language: S.optionalWith(S.String, { nullable: true }),
719
+ transcript: S.Struct({
720
+ source: FetchObjectModeResultDataVideoTranscriptSource,
721
+ kind: S.optionalWith(FetchObjectModeResultDataVideoTranscriptKind, { nullable: true }),
722
+ language: S.optionalWith(S.String, { nullable: true }),
723
+ }),
724
+ segments: S.optionalWith(
725
+ S.Array(
726
+ S.Struct({
727
+ startSeconds: S.Number,
728
+ text: S.String,
729
+ }),
730
+ ),
731
+ { nullable: true },
732
+ ),
733
+ chapters: S.optionalWith(
734
+ S.Array(
735
+ S.Struct({
736
+ title: S.String,
737
+ startSeconds: S.Number,
738
+ }),
739
+ ),
740
+ { nullable: true },
741
+ ),
742
+ storyboard: S.optionalWith(
743
+ S.Struct({
744
+ frameWidth: S.Int,
745
+ frameHeight: S.Int,
746
+ rows: S.Int,
747
+ columns: S.Int,
748
+ sheets: S.Array(
749
+ S.Struct({
750
+ url: S.String,
751
+ durationSeconds: S.Number,
752
+ }),
753
+ ),
754
+ }),
755
+ { nullable: true },
756
+ ),
511
757
  }),
512
758
  { nullable: true },
513
759
  ),
514
- json: S.optionalWith(S.Boolean, { nullable: true, default: () => false as const }),
515
- appendix: S.optionalWith(S.Boolean, { nullable: true }),
516
760
  }),
517
761
  { nullable: true },
518
762
  ),
763
+ originError: S.optionalWith(FetchHttpOriginError, { nullable: true }),
519
764
  }) {}
520
765
 
521
- export class URL extends S.String {}
766
+ export class FetchNetworkOriginErrorKind extends S.Literal(
767
+ 'dns',
768
+ 'tls',
769
+ 'connectionRefused',
770
+ 'connectionReset',
771
+ 'connectionClosed',
772
+ 'addressUnreachable',
773
+ 'emptyResponse',
774
+ 'connectionTimeout',
775
+ ) {}
522
776
 
523
- export class ResponseInfo extends S.Struct({
777
+ export class FetchNetworkOriginErrorTag extends S.Literal('FetchOriginError') {}
778
+
779
+ export class FetchNetworkOriginError extends S.Struct({
524
780
  url: S.String,
525
- requestedUrl: S.optionalWith(URL, { nullable: true }),
526
- originStatusCode: S.optionalWith(S.Number, { nullable: true }),
527
- redirectStatusCode: S.optionalWith(S.Number, { nullable: true }),
528
- headers: S.optionalWith(S.Struct({}), { nullable: true }),
781
+ kind: FetchNetworkOriginErrorKind,
782
+ upstreamError: S.optionalWith(S.String, { nullable: true }),
783
+ retryable: S.Boolean,
784
+ _tag: FetchNetworkOriginErrorTag,
529
785
  }) {}
530
786
 
531
- export class FetchSnapshotSearchResult extends S.Class<FetchSnapshotSearchResult>('FetchSnapshotSearchResult')({
532
- snapshotId: S.String.pipe(S.minLength(1)),
533
- response: ResponseInfo,
534
- search: FetchSearchResult,
535
- durationMs: S.Number.pipe(S.greaterThanOrEqualTo(0)),
536
- playground: S.String,
537
- }) {}
787
+ export class FetchHttpOriginRefusalTag extends S.Literal('FetchOriginError') {}
538
788
 
539
- export class FetchFetchSearch400 extends S.Union(HttpApiDecodeError, BadRequest) {}
789
+ export class FetchHttpOriginRefusalKind extends S.Literal('http') {}
540
790
 
541
- export class FetchFetchSearch403Tag extends S.Literal('AccessBlocked') {}
791
+ export class FetchHttpOriginRefusalContentAvailable extends S.Literal(false) {}
542
792
 
543
- export class FetchFetchSearch403 extends S.Struct({
544
- organizationId: S.String.pipe(S.minLength(1)),
545
- blockedUntil: S.optionalWith(S.Union(DateTimeUtc, S.Null), { nullable: true }),
546
- _tag: FetchFetchSearch403Tag,
793
+ export class FetchHttpOriginRefusalRedirectLimitReached extends S.Literal(true) {}
794
+
795
+ export class FetchHttpOriginRefusal extends S.Struct({
796
+ _tag: FetchHttpOriginRefusalTag,
797
+ url: S.String,
798
+ kind: FetchHttpOriginRefusalKind,
799
+ contentAvailable: FetchHttpOriginRefusalContentAvailable,
800
+ finalUrl: S.optionalWith(S.String, { nullable: true }),
801
+ redirectLimitReached: S.optionalWith(FetchHttpOriginRefusalRedirectLimitReached, { nullable: true }),
802
+ originStatusCode: S.Number,
803
+ retryable: S.Boolean,
547
804
  }) {}
548
805
 
549
- export class NonEmptyString extends S.String.pipe(S.minLength(1)) {}
806
+ export class FetchFetchJson200 extends S.Union(
807
+ FetchObjectModeResult,
808
+ FetchNetworkOriginError,
809
+ FetchHttpOriginRefusal,
810
+ ) {}
550
811
 
551
- export class FetchSnapshotSearchNotFoundTag extends S.Literal('FetchSnapshotSearchNotFound') {}
812
+ export class FetchFetchJson400 extends S.Union(HttpApiDecodeError, BadRequest) {}
552
813
 
553
- export class FetchSnapshotSearchNotFound extends S.Class<FetchSnapshotSearchNotFound>('FetchSnapshotSearchNotFound')({
554
- snapshotId: NonEmptyString,
555
- _tag: FetchSnapshotSearchNotFoundTag,
556
- }) {}
814
+ export class FetchFetchJson403 extends S.Union(
815
+ S.Struct({
816
+ organizationId: S.String.pipe(S.minLength(1)),
817
+ blockedUntil: S.optionalWith(S.Union(DateTimeUtc, S.Null), { nullable: true }),
818
+ _tag: S.Literal('AccessBlocked'),
819
+ }),
820
+ FetchBlocked,
821
+ ) {}
822
+
823
+ export class FetchFetchJson413 extends S.Union(PayloadTooLarge, FetchPageTooLarge) {}
824
+
825
+ export class FetchFetchJson429 extends S.Union(TooManyRequests, FetchConcurrencyLimitExceeded) {}
826
+
827
+ export class FetchFetchJson502 extends S.Union(FetchCaptureFailed, FetchNavigationFailed, FetchOriginHttpError) {}
828
+
829
+ export class FetchFetchJson503 extends S.Union(ServiceUnavailable, FetchDocumentProcessingUnavailable) {}
557
830
 
558
831
  export class FetchBatchedParams extends S.Struct({
559
832
  'x-idempotency-key': S.optionalWith(S.String.pipe(S.minLength(1), S.maxLength(255)), { nullable: true }),
560
833
  }) {}
561
834
 
835
+ export class FetchBatchedRequestIncludeAppendixMarkers extends S.Literal('off', 'compact', 'detailed') {}
836
+
837
+ export class FetchBatchedRequestDocumentConfigOcr extends S.Literal('auto', 'never', 'always') {}
838
+
562
839
  export class FetchBatchedRequest extends S.Class<FetchBatchedRequest>('FetchBatchedRequest')({
563
840
  urls: S.NonEmptyArray(S.String),
564
841
  include: S.optionalWith(
@@ -594,6 +871,10 @@ export class FetchBatchedRequest extends S.Class<FetchBatchedRequest>('FetchBatc
594
871
  ),
595
872
  json: S.optionalWith(S.Boolean, { nullable: true, default: () => false as const }),
596
873
  appendix: S.optionalWith(S.Boolean, { nullable: true }),
874
+ appendixMarkers: S.optionalWith(FetchBatchedRequestIncludeAppendixMarkers, {
875
+ nullable: true,
876
+ default: () => 'compact' as const,
877
+ }),
597
878
  }),
598
879
  { nullable: true },
599
880
  ),
@@ -603,6 +884,17 @@ export class FetchBatchedRequest extends S.Class<FetchBatchedRequest>('FetchBatc
603
884
  }),
604
885
  { nullable: true },
605
886
  ),
887
+ documentConfig: S.optionalWith(
888
+ S.Struct({
889
+ maxPages: S.optionalWith(S.Int.pipe(S.greaterThanOrEqualTo(1)), { nullable: true }),
890
+ maxAudioSeconds: S.optionalWith(S.Int.pipe(S.greaterThanOrEqualTo(1), S.lessThanOrEqualTo(14400)), {
891
+ nullable: true,
892
+ default: () => 3600 as const,
893
+ }),
894
+ ocr: S.optionalWith(FetchBatchedRequestDocumentConfigOcr, { nullable: true, default: () => 'auto' as const }),
895
+ }),
896
+ { nullable: true },
897
+ ),
606
898
  }) {}
607
899
 
608
900
  export class BatchedRun extends S.Class<BatchedRun>('BatchedRun')({
@@ -655,6 +947,17 @@ export class BatchedStatusBatchedStatus extends S.Literal(
655
947
 
656
948
  export class BatchedFetchItemStatus extends S.Literal('QUEUED', 'RUNNING', 'SUCCEEDED', 'FAILED', 'CANCELLED') {}
657
949
 
950
+ export class URL extends S.String {}
951
+
952
+ export class ResponseInfo extends S.Struct({
953
+ url: S.String,
954
+ requestedUrl: S.optionalWith(URL, { nullable: true }),
955
+ originStatusCode: S.optionalWith(S.Number, { nullable: true }),
956
+ redirectStatusCode: S.optionalWith(S.Number, { nullable: true }),
957
+ contentType: S.optionalWith(S.String, { nullable: true }),
958
+ headers: S.optionalWith(S.Struct({}), { nullable: true }),
959
+ }) {}
960
+
658
961
  export class IconMeta extends S.Struct({
659
962
  href: S.String.pipe(S.minLength(1)),
660
963
  rel: S.String.pipe(S.minLength(1)),
@@ -700,6 +1003,14 @@ export class PageMeta extends S.Struct({
700
1003
  twitter: S.optionalWith(TwitterCardMeta, { nullable: true }),
701
1004
  }) {}
702
1005
 
1006
+ export class NonEmptyString extends S.String.pipe(S.minLength(1)) {}
1007
+
1008
+ export class BatchedFetchItemDataVideoProvider extends S.Literal('youtube') {}
1009
+
1010
+ export class BatchedFetchItemDataVideoTranscriptSource extends S.Literal('captions', 'transcription') {}
1011
+
1012
+ export class BatchedFetchItemDataVideoTranscriptKind extends S.Literal('manual', 'auto') {}
1013
+
703
1014
  export class FetchLink extends S.Struct({
704
1015
  url: S.String,
705
1016
  text: S.optionalWith(S.String, { nullable: true }),
@@ -734,7 +1045,75 @@ export class BatchedFetchItem extends S.Struct({
734
1045
  }),
735
1046
  { nullable: true },
736
1047
  ),
737
- search: S.optionalWith(FetchSearchResult, { nullable: true }),
1048
+ document: S.optionalWith(
1049
+ S.Struct({
1050
+ url: S.String,
1051
+ contentType: S.String,
1052
+ sizeBytes: S.Number,
1053
+ }),
1054
+ { nullable: true },
1055
+ ),
1056
+ usage: S.optionalWith(
1057
+ S.Struct({
1058
+ documentPages: Int,
1059
+ ocrPages: Int,
1060
+ audioSeconds: S.Number.pipe(S.greaterThanOrEqualTo(0)),
1061
+ videos: S.optionalWith(Int, { nullable: true }),
1062
+ }),
1063
+ { nullable: true },
1064
+ ),
1065
+ video: S.optionalWith(
1066
+ S.Struct({
1067
+ provider: BatchedFetchItemDataVideoProvider,
1068
+ videoId: S.String,
1069
+ title: S.String,
1070
+ channel: S.optionalWith(S.String, { nullable: true }),
1071
+ channelUrl: S.optionalWith(S.String, { nullable: true }),
1072
+ durationSeconds: S.optionalWith(S.Number, { nullable: true }),
1073
+ publishedAt: S.optionalWith(S.String, { nullable: true }),
1074
+ viewCount: S.optionalWith(S.Number, { nullable: true }),
1075
+ language: S.optionalWith(S.String, { nullable: true }),
1076
+ transcript: S.Struct({
1077
+ source: BatchedFetchItemDataVideoTranscriptSource,
1078
+ kind: S.optionalWith(BatchedFetchItemDataVideoTranscriptKind, { nullable: true }),
1079
+ language: S.optionalWith(S.String, { nullable: true }),
1080
+ }),
1081
+ segments: S.optionalWith(
1082
+ S.Array(
1083
+ S.Struct({
1084
+ startSeconds: S.Number,
1085
+ text: S.String,
1086
+ }),
1087
+ ),
1088
+ { nullable: true },
1089
+ ),
1090
+ chapters: S.optionalWith(
1091
+ S.Array(
1092
+ S.Struct({
1093
+ title: S.String,
1094
+ startSeconds: S.Number,
1095
+ }),
1096
+ ),
1097
+ { nullable: true },
1098
+ ),
1099
+ storyboard: S.optionalWith(
1100
+ S.Struct({
1101
+ frameWidth: S.Int,
1102
+ frameHeight: S.Int,
1103
+ rows: S.Int,
1104
+ columns: S.Int,
1105
+ sheets: S.Array(
1106
+ S.Struct({
1107
+ url: S.String,
1108
+ durationSeconds: S.Number,
1109
+ }),
1110
+ ),
1111
+ }),
1112
+ { nullable: true },
1113
+ ),
1114
+ }),
1115
+ { nullable: true },
1116
+ ),
738
1117
  links: S.optionalWith(S.Array(FetchLink), { nullable: true }),
739
1118
  appendix: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
740
1119
  renderEngines: S.optionalWith(RenderEnginesInfo, { nullable: true }),
@@ -744,9 +1123,22 @@ export class BatchedFetchItem extends S.Struct({
744
1123
  { nullable: true },
745
1124
  ),
746
1125
  error: S.optionalWith(
747
- S.Union(FetchBlocked, FetchPageTooLarge, FetchNavigationFailed, FetchCaptureTimeout, FetchCapacityTimeout),
1126
+ S.Union(
1127
+ FetchBlocked,
1128
+ FetchPageTooLarge,
1129
+ FetchNavigationFailed,
1130
+ FetchUnsupportedContentType,
1131
+ FetchOriginHttpError,
1132
+ S.Union(FetchNetworkOriginError, FetchHttpOriginRefusal),
1133
+ FetchDocumentProcessingUnavailable,
1134
+ FetchVideoUnavailable,
1135
+ FetchCaptureFailed,
1136
+ FetchCaptureTimeout,
1137
+ FetchCapacityTimeout,
1138
+ ),
748
1139
  { nullable: true },
749
1140
  ),
1141
+ originError: S.optionalWith(FetchHttpOriginError, { nullable: true }),
750
1142
  }) {}
751
1143
 
752
1144
  export class PaginationMeta extends S.Struct({
@@ -791,6 +1183,131 @@ export class BatchedCancellationConflict extends S.Class<BatchedCancellationConf
791
1183
  _tag: BatchedCancellationConflictTag,
792
1184
  }) {}
793
1185
 
1186
+ export class SnapshotHighlightsInputIncludeAppendixMarkers extends S.Literal('off', 'compact', 'detailed') {}
1187
+
1188
+ export class SnapshotHighlightsInput extends S.Class<SnapshotHighlightsInput>('SnapshotHighlightsInput')({
1189
+ highlights: S.Struct({
1190
+ query: S.String,
1191
+ maxResults: S.optionalWith(S.Int.pipe(S.greaterThanOrEqualTo(1), S.lessThanOrEqualTo(50)), {
1192
+ nullable: true,
1193
+ default: () => 5 as const,
1194
+ }),
1195
+ minScore: S.optionalWith(S.Number.pipe(S.greaterThanOrEqualTo(0), S.lessThanOrEqualTo(1)), {
1196
+ nullable: true,
1197
+ default: () => 0.6 as const,
1198
+ }),
1199
+ }),
1200
+ include: S.optionalWith(
1201
+ S.Struct({
1202
+ html: S.optionalWith(S.Union(S.Boolean, S.Record({ key: S.String, value: S.Unknown })), { nullable: true }),
1203
+ markdown: S.optionalWith(S.Union(S.Boolean, S.Record({ key: S.String, value: S.Unknown })), { nullable: true }),
1204
+ screenshot: S.optionalWith(
1205
+ S.Union(
1206
+ S.Boolean,
1207
+ S.Struct({
1208
+ fullPage: S.optionalWith(S.Boolean, { nullable: true }),
1209
+ }),
1210
+ ),
1211
+ { nullable: true },
1212
+ ),
1213
+ links: S.optionalWith(
1214
+ S.Union(
1215
+ S.Boolean,
1216
+ S.Struct({
1217
+ sameDomainOnly: S.optionalWith(S.Boolean, { nullable: true, default: () => true as const }),
1218
+ includePatterns: S.optionalWith(S.Array(S.String), { nullable: true }),
1219
+ excludePatterns: S.optionalWith(S.Array(S.String), { nullable: true }),
1220
+ }),
1221
+ ),
1222
+ { nullable: true },
1223
+ ),
1224
+ meta: S.optionalWith(S.Boolean, { nullable: true, default: () => true as const }),
1225
+ response: S.optionalWith(
1226
+ S.Struct({
1227
+ includeHeaders: S.optionalWith(S.Boolean, { nullable: true, default: () => false as const }),
1228
+ }),
1229
+ { nullable: true },
1230
+ ),
1231
+ json: S.optionalWith(S.Boolean, { nullable: true, default: () => false as const }),
1232
+ appendix: S.optionalWith(S.Boolean, { nullable: true }),
1233
+ appendixMarkers: S.optionalWith(SnapshotHighlightsInputIncludeAppendixMarkers, {
1234
+ nullable: true,
1235
+ default: () => 'compact' as const,
1236
+ }),
1237
+ }),
1238
+ { nullable: true },
1239
+ ),
1240
+ }) {}
1241
+
1242
+ export class FetchSnapshotHighlightsResult extends S.Class<FetchSnapshotHighlightsResult>(
1243
+ 'FetchSnapshotHighlightsResult',
1244
+ )({
1245
+ snapshotId: S.String.pipe(S.minLength(1)),
1246
+ response: ResponseInfo,
1247
+ highlights: FetchHighlightsResult,
1248
+ durationMs: S.Number.pipe(S.greaterThanOrEqualTo(0)),
1249
+ playground: S.String,
1250
+ }) {}
1251
+
1252
+ export class SnapshotsHighlights400 extends S.Union(HttpApiDecodeError, BadRequest) {}
1253
+
1254
+ export class SnapshotsHighlights403Tag extends S.Literal('AccessBlocked') {}
1255
+
1256
+ export class SnapshotsHighlights403 extends S.Struct({
1257
+ organizationId: S.String.pipe(S.minLength(1)),
1258
+ blockedUntil: S.optionalWith(S.Union(DateTimeUtc, S.Null), { nullable: true }),
1259
+ _tag: SnapshotsHighlights403Tag,
1260
+ }) {}
1261
+
1262
+ export class FetchSnapshotHighlightsNotFoundTag extends S.Literal('FetchSnapshotHighlightsNotFound') {}
1263
+
1264
+ export class FetchSnapshotHighlightsNotFound extends S.Class<FetchSnapshotHighlightsNotFound>(
1265
+ 'FetchSnapshotHighlightsNotFound',
1266
+ )({
1267
+ snapshotId: NonEmptyString,
1268
+ _tag: FetchSnapshotHighlightsNotFoundTag,
1269
+ }) {}
1270
+
1271
+ export class SnapshotsHighlights429 extends S.Union(TooManyRequests, FetchConcurrencyLimitExceeded) {}
1272
+
1273
+ export class PublicSnapshotsGetCatalogParamsFormat extends S.Literal('json', 'markdown') {}
1274
+
1275
+ export class PublicSnapshotsGetCatalogParams extends S.Struct({
1276
+ format: S.optionalWith(PublicSnapshotsGetCatalogParamsFormat, { nullable: true }),
1277
+ }) {}
1278
+
1279
+ export class SnapshotCatalogVersion extends S.Literal(1) {}
1280
+
1281
+ export class SnapshotCatalog extends S.Class<SnapshotCatalog>('SnapshotCatalog')({
1282
+ version: SnapshotCatalogVersion,
1283
+ snapshotId: S.String,
1284
+ collections: S.Struct({
1285
+ evidence: S.String,
1286
+ network: S.String,
1287
+ assets: S.String,
1288
+ artifacts: S.String,
1289
+ }),
1290
+ artifacts: S.Array(
1291
+ S.Struct({
1292
+ id: S.String,
1293
+ kind: S.String,
1294
+ url: S.String,
1295
+ preview: S.optionalWith(S.String, { nullable: true }),
1296
+ }),
1297
+ ),
1298
+ links: S.Struct({
1299
+ markdown: S.String,
1300
+ json: S.String,
1301
+ }),
1302
+ }) {}
1303
+
1304
+ export class SnapshotNotFoundTag extends S.Literal('SnapshotNotFound') {}
1305
+
1306
+ export class SnapshotNotFound extends S.Class<SnapshotNotFound>('SnapshotNotFound')({
1307
+ snapshotId: S.String,
1308
+ _tag: SnapshotNotFoundTag,
1309
+ }) {}
1310
+
794
1311
  export const make = (
795
1312
  httpClient: HttpClient.HttpClient,
796
1313
  options: {
@@ -820,7 +1337,10 @@ export const make = (
820
1337
  return {
821
1338
  fetchFetch: (options) =>
822
1339
  HttpClientRequest.make('POST')(`/v1/fetch`).pipe(
823
- HttpClientRequest.setUrlParams({ include: options.params['include'] as UrlParams.Coercible }),
1340
+ HttpClientRequest.setUrlParams({
1341
+ include: options.params['include'] as UrlParams.Coercible,
1342
+ appendixMarkers: options.params['appendixMarkers'] as UrlParams.Coercible,
1343
+ }),
824
1344
  (req) => Effect.orDie(HttpClientRequest.bodyJson(req, options.payload)),
825
1345
  Effect.flatMap((request) =>
826
1346
  Effect.flatMap(applyClientTransform(httpClient), (httpClient) =>
@@ -830,11 +1350,15 @@ export const make = (
830
1350
  '400': (r) => decodeError(r, FetchFetch400),
831
1351
  '401': (r) => decodeError(r, AuthFailed),
832
1352
  '403': (r) => decodeError(r, FetchFetch403),
1353
+ '404': (r) => decodeError(r, FetchOriginNotFound),
1354
+ '410': (r) => decodeError(r, FetchOriginGone),
833
1355
  '413': (r) => decodeError(r, FetchFetch413),
834
- '429': (r) => decodeError(r, TooManyRequests),
1356
+ '415': (r) => decodeError(r, FetchUnsupportedContentType),
1357
+ '422': (r) => decodeError(r, FetchVideoUnavailable),
1358
+ '429': (r) => decodeError(r, FetchFetch429),
835
1359
  '500': (r) => decodeError(r, InternalError),
836
- '502': (r) => decodeError(r, FetchNavigationFailed),
837
- '503': (r) => decodeError(r, ServiceUnavailable),
1360
+ '502': (r) => decodeError(r, FetchFetch502),
1361
+ '503': (r) => decodeError(r, FetchFetch503),
838
1362
  '504': (r) => decodeError(r, FetchCaptureTimeout),
839
1363
  '529': (r) => decodeError(r, FetchCapacityTimeout),
840
1364
  orElse: (response) => unexpectedStatus(request, response),
@@ -845,22 +1369,29 @@ export const make = (
845
1369
  ),
846
1370
  fetchFetchJson: (options) =>
847
1371
  HttpClientRequest.make('POST')(`/v1/fetch/json`).pipe(
848
- HttpClientRequest.setUrlParams({ include: options.params['include'] as UrlParams.Coercible }),
1372
+ HttpClientRequest.setUrlParams({
1373
+ include: options.params['include'] as UrlParams.Coercible,
1374
+ appendixMarkers: options.params['appendixMarkers'] as UrlParams.Coercible,
1375
+ }),
849
1376
  (req) => Effect.orDie(HttpClientRequest.bodyJson(req, options.payload)),
850
1377
  Effect.flatMap((request) =>
851
1378
  Effect.flatMap(applyClientTransform(httpClient), (httpClient) =>
852
1379
  Effect.flatMap(
853
1380
  httpClient.execute(request),
854
1381
  HttpClientResponse.matchStatus({
855
- '200': (r) => HttpClientResponse.schemaBodyJson(FetchObjectModeResult)(r),
1382
+ '200': (r) => HttpClientResponse.schemaBodyJson(FetchFetchJson200)(r),
856
1383
  '400': (r) => decodeError(r, FetchFetchJson400),
857
1384
  '401': (r) => decodeError(r, AuthFailed),
858
1385
  '403': (r) => decodeError(r, FetchFetchJson403),
1386
+ '404': (r) => decodeError(r, FetchOriginNotFound),
1387
+ '410': (r) => decodeError(r, FetchOriginGone),
859
1388
  '413': (r) => decodeError(r, FetchFetchJson413),
860
- '429': (r) => decodeError(r, TooManyRequests),
1389
+ '415': (r) => decodeError(r, FetchUnsupportedContentType),
1390
+ '422': (r) => decodeError(r, FetchVideoUnavailable),
1391
+ '429': (r) => decodeError(r, FetchFetchJson429),
861
1392
  '500': (r) => decodeError(r, InternalError),
862
- '502': (r) => decodeError(r, FetchNavigationFailed),
863
- '503': (r) => decodeError(r, ServiceUnavailable),
1393
+ '502': (r) => decodeError(r, FetchFetchJson502),
1394
+ '503': (r) => decodeError(r, FetchFetchJson503),
864
1395
  '504': (r) => decodeError(r, FetchCaptureTimeout),
865
1396
  '529': (r) => decodeError(r, FetchCapacityTimeout),
866
1397
  orElse: (response) => unexpectedStatus(request, response),
@@ -869,29 +1400,6 @@ export const make = (
869
1400
  ),
870
1401
  ),
871
1402
  ),
872
- fetchFetchSearch: (options) =>
873
- HttpClientRequest.make('POST')(`/v1/fetch/search`).pipe(
874
- (req) => Effect.orDie(HttpClientRequest.bodyJson(req, options)),
875
- Effect.flatMap((request) =>
876
- Effect.flatMap(applyClientTransform(httpClient), (httpClient) =>
877
- Effect.flatMap(
878
- httpClient.execute(request),
879
- HttpClientResponse.matchStatus({
880
- '200': (r) => HttpClientResponse.schemaBodyJson(FetchSnapshotSearchResult)(r),
881
- '400': (r) => decodeError(r, FetchFetchSearch400),
882
- '401': (r) => decodeError(r, AuthFailed),
883
- '403': (r) => decodeError(r, FetchFetchSearch403),
884
- '404': (r) => decodeError(r, FetchSnapshotSearchNotFound),
885
- '413': (r) => decodeError(r, PayloadTooLarge),
886
- '429': (r) => decodeError(r, TooManyRequests),
887
- '500': (r) => decodeError(r, InternalError),
888
- '503': (r) => decodeError(r, ServiceUnavailable),
889
- orElse: (response) => unexpectedStatus(request, response),
890
- }),
891
- ),
892
- ),
893
- ),
894
- ),
895
1403
  fetchBatched: (options) =>
896
1404
  HttpClientRequest.make('POST')(`/v1/fetch/batched`).pipe(
897
1405
  HttpClientRequest.setHeaders({ 'x-idempotency-key': options.params['x-idempotency-key'] ?? undefined }),
@@ -964,6 +1472,51 @@ export const make = (
964
1472
  ),
965
1473
  ),
966
1474
  ),
1475
+ snapshotsHighlights: (snapshotId, options) =>
1476
+ HttpClientRequest.make('POST')(`/v1/snapshots/${snapshotId}/highlights`).pipe(
1477
+ (req) => Effect.orDie(HttpClientRequest.bodyJson(req, options)),
1478
+ Effect.flatMap((request) =>
1479
+ Effect.flatMap(applyClientTransform(httpClient), (httpClient) =>
1480
+ Effect.flatMap(
1481
+ httpClient.execute(request),
1482
+ HttpClientResponse.matchStatus({
1483
+ '200': (r) => HttpClientResponse.schemaBodyJson(FetchSnapshotHighlightsResult)(r),
1484
+ '400': (r) => decodeError(r, SnapshotsHighlights400),
1485
+ '401': (r) => decodeError(r, AuthFailed),
1486
+ '403': (r) => decodeError(r, SnapshotsHighlights403),
1487
+ '404': (r) => decodeError(r, FetchSnapshotHighlightsNotFound),
1488
+ '413': (r) => decodeError(r, PayloadTooLarge),
1489
+ '429': (r) => decodeError(r, SnapshotsHighlights429),
1490
+ '500': (r) => decodeError(r, InternalError),
1491
+ '503': (r) => decodeError(r, ServiceUnavailable),
1492
+ orElse: (response) => unexpectedStatus(request, response),
1493
+ }),
1494
+ ),
1495
+ ),
1496
+ ),
1497
+ ),
1498
+ publicSnapshotsGetCatalog: (snapshotId, options) =>
1499
+ HttpClientRequest.make('GET')(`/v1/public/snapshots/${snapshotId}`).pipe(
1500
+ HttpClientRequest.setUrlParams({ format: options['format'] as UrlParams.Coercible }),
1501
+ Effect.succeed,
1502
+ Effect.flatMap((request) =>
1503
+ Effect.flatMap(applyClientTransform(httpClient), (httpClient) =>
1504
+ Effect.flatMap(
1505
+ httpClient.execute(request),
1506
+ HttpClientResponse.matchStatus({
1507
+ '200': (r) => HttpClientResponse.schemaBodyJson(SnapshotCatalog)(r),
1508
+ '400': (r) => decodeError(r, HttpApiDecodeError),
1509
+ '404': (r) => decodeError(r, SnapshotNotFound),
1510
+ '413': (r) => decodeError(r, PayloadTooLarge),
1511
+ '429': (r) => decodeError(r, TooManyRequests),
1512
+ '500': (r) => decodeError(r, InternalError),
1513
+ '503': (r) => decodeError(r, ServiceUnavailable),
1514
+ orElse: (response) => unexpectedStatus(request, response),
1515
+ }),
1516
+ ),
1517
+ ),
1518
+ ),
1519
+ ),
967
1520
  }
968
1521
  }
969
1522
 
@@ -978,11 +1531,15 @@ export interface Client {
978
1531
  | typeof FetchFetch400.Type
979
1532
  | typeof AuthFailed.Type
980
1533
  | typeof FetchFetch403.Type
1534
+ | typeof FetchOriginNotFound.Type
1535
+ | typeof FetchOriginGone.Type
981
1536
  | typeof FetchFetch413.Type
982
- | typeof TooManyRequests.Type
1537
+ | typeof FetchUnsupportedContentType.Type
1538
+ | typeof FetchVideoUnavailable.Type
1539
+ | typeof FetchFetch429.Type
983
1540
  | typeof InternalError.Type
984
- | typeof FetchNavigationFailed.Type
985
- | typeof ServiceUnavailable.Type
1541
+ | typeof FetchFetch502.Type
1542
+ | typeof FetchFetch503.Type
986
1543
  | typeof FetchCaptureTimeout.Type
987
1544
  | typeof FetchCapacityTimeout.Type
988
1545
  >
@@ -990,35 +1547,24 @@ export interface Client {
990
1547
  readonly params: typeof FetchFetchJsonParams.Encoded
991
1548
  readonly payload: typeof FetchFetchJsonRequest.Encoded
992
1549
  }) => Effect.Effect<
993
- typeof FetchObjectModeResult.Type,
1550
+ typeof FetchFetchJson200.Type,
994
1551
  | HttpClientError.HttpClientError
995
1552
  | ParseError
996
1553
  | typeof FetchFetchJson400.Type
997
1554
  | typeof AuthFailed.Type
998
1555
  | typeof FetchFetchJson403.Type
1556
+ | typeof FetchOriginNotFound.Type
1557
+ | typeof FetchOriginGone.Type
999
1558
  | typeof FetchFetchJson413.Type
1000
- | typeof TooManyRequests.Type
1559
+ | typeof FetchUnsupportedContentType.Type
1560
+ | typeof FetchVideoUnavailable.Type
1561
+ | typeof FetchFetchJson429.Type
1001
1562
  | typeof InternalError.Type
1002
- | typeof FetchNavigationFailed.Type
1003
- | typeof ServiceUnavailable.Type
1563
+ | typeof FetchFetchJson502.Type
1564
+ | typeof FetchFetchJson503.Type
1004
1565
  | typeof FetchCaptureTimeout.Type
1005
1566
  | typeof FetchCapacityTimeout.Type
1006
1567
  >
1007
- readonly fetchFetchSearch: (
1008
- options: typeof FetchFetchSearchRequest.Encoded,
1009
- ) => Effect.Effect<
1010
- typeof FetchSnapshotSearchResult.Type,
1011
- | HttpClientError.HttpClientError
1012
- | ParseError
1013
- | typeof FetchFetchSearch400.Type
1014
- | typeof AuthFailed.Type
1015
- | typeof FetchFetchSearch403.Type
1016
- | typeof FetchSnapshotSearchNotFound.Type
1017
- | typeof PayloadTooLarge.Type
1018
- | typeof TooManyRequests.Type
1019
- | typeof InternalError.Type
1020
- | typeof ServiceUnavailable.Type
1021
- >
1022
1568
  readonly fetchBatched: (options: {
1023
1569
  readonly params: typeof FetchBatchedParams.Encoded
1024
1570
  readonly payload: typeof FetchBatchedRequest.Encoded
@@ -1063,4 +1609,34 @@ export interface Client {
1063
1609
  | typeof InternalError.Type
1064
1610
  | typeof ServiceUnavailable.Type
1065
1611
  >
1612
+ readonly snapshotsHighlights: (
1613
+ snapshotId: string,
1614
+ options: typeof SnapshotHighlightsInput.Encoded,
1615
+ ) => Effect.Effect<
1616
+ typeof FetchSnapshotHighlightsResult.Type,
1617
+ | HttpClientError.HttpClientError
1618
+ | ParseError
1619
+ | typeof SnapshotsHighlights400.Type
1620
+ | typeof AuthFailed.Type
1621
+ | typeof SnapshotsHighlights403.Type
1622
+ | typeof FetchSnapshotHighlightsNotFound.Type
1623
+ | typeof PayloadTooLarge.Type
1624
+ | typeof SnapshotsHighlights429.Type
1625
+ | typeof InternalError.Type
1626
+ | typeof ServiceUnavailable.Type
1627
+ >
1628
+ readonly publicSnapshotsGetCatalog: (
1629
+ snapshotId: string,
1630
+ options: typeof PublicSnapshotsGetCatalogParams.Encoded,
1631
+ ) => Effect.Effect<
1632
+ typeof SnapshotCatalog.Type,
1633
+ | HttpClientError.HttpClientError
1634
+ | ParseError
1635
+ | typeof HttpApiDecodeError.Type
1636
+ | typeof SnapshotNotFound.Type
1637
+ | typeof PayloadTooLarge.Type
1638
+ | typeof TooManyRequests.Type
1639
+ | typeof InternalError.Type
1640
+ | typeof ServiceUnavailable.Type
1641
+ >
1066
1642
  }