@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
@@ -2,7 +2,7 @@ import { HttpClient } from '@effect/platform';
2
2
  import { Effect, Schema as S } from 'effect';
3
3
  import * as Generated from './Generated.js';
4
4
  /** Search snippet with the extracted `json` value preserved (statejson snippets only). */
5
- export declare const FetchSearchSnippetWithJson: S.Struct<{
5
+ export declare const FetchHighlightsSnippetWithJson: S.Struct<{
6
6
  type: S.optionalWith<S.Literal<["text"]>, {
7
7
  nullable: true;
8
8
  default: () => "text";
@@ -10,16 +10,16 @@ export declare const FetchSearchSnippetWithJson: S.Struct<{
10
10
  source: S.Literal<["markdown", "appendix", "statejson"]>;
11
11
  text: typeof S.String;
12
12
  score: S.filter<S.filter<typeof S.Number>>;
13
- location: S.optionalWith<typeof Generated.FetchSearchSnippetLocation, {
13
+ location: S.optionalWith<typeof Generated.FetchHighlightsSnippetLocation, {
14
14
  nullable: true;
15
15
  }>;
16
16
  json: S.optionalWith<typeof S.Unknown, {
17
17
  nullable: true;
18
18
  }>;
19
19
  }>;
20
- export declare const FetchSearchResultWithJson: S.Struct<{
20
+ export declare const FetchHighlightsResultWithJson: S.Struct<{
21
21
  query: typeof S.String;
22
- meta: S.optionalWith<typeof Generated.FetchSearchMeta, {
22
+ meta: S.optionalWith<typeof Generated.FetchHighlightsMeta, {
23
23
  nullable: true;
24
24
  }>;
25
25
  snippets: S.Array$<S.Struct<{
@@ -30,7 +30,7 @@ export declare const FetchSearchResultWithJson: S.Struct<{
30
30
  source: S.Literal<["markdown", "appendix", "statejson"]>;
31
31
  text: typeof S.String;
32
32
  score: S.filter<S.filter<typeof S.Number>>;
33
- location: S.optionalWith<typeof Generated.FetchSearchSnippetLocation, {
33
+ location: S.optionalWith<typeof Generated.FetchHighlightsSnippetLocation, {
34
34
  nullable: true;
35
35
  }>;
36
36
  json: S.optionalWith<typeof S.Unknown, {
@@ -38,10 +38,64 @@ export declare const FetchSearchResultWithJson: S.Struct<{
38
38
  }>;
39
39
  }>>;
40
40
  }>;
41
+ /** Object-mode evidence with the inline JSON payload preserved. */
42
+ export declare const FetchObjectModeEvidenceWithJson: S.Struct<{
43
+ id: typeof S.Number;
44
+ kind: typeof Generated.FetchObjectModeEvidenceKind;
45
+ role: typeof Generated.FetchObjectModeEvidenceRole;
46
+ score: S.filter<typeof S.Number>;
47
+ url: S.optionalWith<typeof S.String, {
48
+ nullable: true;
49
+ }>;
50
+ method: S.optionalWith<typeof S.String, {
51
+ nullable: true;
52
+ }>;
53
+ moreTokens: S.optionalWith<typeof S.Number, {
54
+ nullable: true;
55
+ }>;
56
+ keys: S.optionalWith<S.Array$<typeof S.String>, {
57
+ nullable: true;
58
+ }>;
59
+ urlRedacted: S.optionalWith<typeof Generated.FetchObjectModeEvidenceUrlRedacted, {
60
+ nullable: true;
61
+ }>;
62
+ urlOmitted: S.optionalWith<typeof Generated.FetchObjectModeEvidenceUrlOmitted, {
63
+ nullable: true;
64
+ }>;
65
+ body: S.optionalWith<typeof S.Unknown, {
66
+ nullable: true;
67
+ }>;
68
+ }>;
41
69
  declare const FetchObjectModeResultWithJson_base: S.Class<FetchObjectModeResultWithJson, {
42
70
  meta: typeof Generated.FetchObjectModeMeta;
43
71
  markdown: typeof S.String;
44
- json: S.Array$<typeof Generated.FetchObjectModeEvidence>;
72
+ json: S.Array$<S.Struct<{
73
+ id: typeof S.Number;
74
+ kind: typeof Generated.FetchObjectModeEvidenceKind;
75
+ role: typeof Generated.FetchObjectModeEvidenceRole;
76
+ score: S.filter<typeof S.Number>;
77
+ url: S.optionalWith<typeof S.String, {
78
+ nullable: true;
79
+ }>;
80
+ method: S.optionalWith<typeof S.String, {
81
+ nullable: true;
82
+ }>;
83
+ moreTokens: S.optionalWith<typeof S.Number, {
84
+ nullable: true;
85
+ }>;
86
+ keys: S.optionalWith<S.Array$<typeof S.String>, {
87
+ nullable: true;
88
+ }>;
89
+ urlRedacted: S.optionalWith<typeof Generated.FetchObjectModeEvidenceUrlRedacted, {
90
+ nullable: true;
91
+ }>;
92
+ urlOmitted: S.optionalWith<typeof Generated.FetchObjectModeEvidenceUrlOmitted, {
93
+ nullable: true;
94
+ }>;
95
+ body: S.optionalWith<typeof S.Unknown, {
96
+ nullable: true;
97
+ }>;
98
+ }>>;
45
99
  data: S.optionalWith<S.Struct<{
46
100
  assets: S.optionalWith<S.Array$<typeof Generated.FetchAssetReference>, {
47
101
  nullable: true;
@@ -55,9 +109,84 @@ declare const FetchObjectModeResultWithJson_base: S.Class<FetchObjectModeResultW
55
109
  }>, {
56
110
  nullable: true;
57
111
  }>;
58
- search: S.optionalWith<S.Struct<{
112
+ document: S.optionalWith<S.Struct<{
113
+ url: typeof S.String;
114
+ contentType: typeof S.String;
115
+ sizeBytes: typeof S.Number;
116
+ }>, {
117
+ nullable: true;
118
+ }>;
119
+ usage: S.optionalWith<S.Struct<{
120
+ documentPages: typeof Generated.Int;
121
+ ocrPages: typeof Generated.Int;
122
+ audioSeconds: S.filter<typeof S.Number>;
123
+ videos: S.optionalWith<typeof Generated.Int, {
124
+ nullable: true;
125
+ }>;
126
+ }>, {
127
+ nullable: true;
128
+ }>;
129
+ video: S.optionalWith<S.Struct<{
130
+ provider: typeof Generated.FetchObjectModeResultDataVideoProvider;
131
+ videoId: typeof S.String;
132
+ title: typeof S.String;
133
+ channel: S.optionalWith<typeof S.String, {
134
+ nullable: true;
135
+ }>;
136
+ channelUrl: S.optionalWith<typeof S.String, {
137
+ nullable: true;
138
+ }>;
139
+ durationSeconds: S.optionalWith<typeof S.Number, {
140
+ nullable: true;
141
+ }>;
142
+ publishedAt: S.optionalWith<typeof S.String, {
143
+ nullable: true;
144
+ }>;
145
+ viewCount: S.optionalWith<typeof S.Number, {
146
+ nullable: true;
147
+ }>;
148
+ language: S.optionalWith<typeof S.String, {
149
+ nullable: true;
150
+ }>;
151
+ transcript: S.Struct<{
152
+ source: typeof Generated.FetchObjectModeResultDataVideoTranscriptSource;
153
+ kind: S.optionalWith<typeof Generated.FetchObjectModeResultDataVideoTranscriptKind, {
154
+ nullable: true;
155
+ }>;
156
+ language: S.optionalWith<typeof S.String, {
157
+ nullable: true;
158
+ }>;
159
+ }>;
160
+ segments: S.optionalWith<S.Array$<S.Struct<{
161
+ startSeconds: typeof S.Number;
162
+ text: typeof S.String;
163
+ }>>, {
164
+ nullable: true;
165
+ }>;
166
+ chapters: S.optionalWith<S.Array$<S.Struct<{
167
+ title: typeof S.String;
168
+ startSeconds: typeof S.Number;
169
+ }>>, {
170
+ nullable: true;
171
+ }>;
172
+ storyboard: S.optionalWith<S.Struct<{
173
+ frameWidth: typeof S.Int;
174
+ frameHeight: typeof S.Int;
175
+ rows: typeof S.Int;
176
+ columns: typeof S.Int;
177
+ sheets: S.Array$<S.Struct<{
178
+ url: typeof S.String;
179
+ durationSeconds: typeof S.Number;
180
+ }>>;
181
+ }>, {
182
+ nullable: true;
183
+ }>;
184
+ }>, {
185
+ nullable: true;
186
+ }>;
187
+ highlights: S.optionalWith<S.Struct<{
59
188
  query: typeof S.String;
60
- meta: S.optionalWith<typeof Generated.FetchSearchMeta, {
189
+ meta: S.optionalWith<typeof Generated.FetchHighlightsMeta, {
61
190
  nullable: true;
62
191
  }>;
63
192
  snippets: S.Array$<S.Struct<{
@@ -68,7 +197,7 @@ declare const FetchObjectModeResultWithJson_base: S.Class<FetchObjectModeResultW
68
197
  source: S.Literal<["markdown", "appendix", "statejson"]>;
69
198
  text: typeof S.String;
70
199
  score: S.filter<S.filter<typeof S.Number>>;
71
- location: S.optionalWith<typeof Generated.FetchSearchSnippetLocation, {
200
+ location: S.optionalWith<typeof Generated.FetchHighlightsSnippetLocation, {
72
201
  nullable: true;
73
202
  }>;
74
203
  json: S.optionalWith<typeof S.Unknown, {
@@ -81,10 +210,39 @@ declare const FetchObjectModeResultWithJson_base: S.Class<FetchObjectModeResultW
81
210
  }>, {
82
211
  nullable: true;
83
212
  }>;
213
+ originError: S.optionalWith<typeof Generated.FetchHttpOriginError, {
214
+ nullable: true;
215
+ }>;
84
216
  }, S.Struct.Encoded<{
85
217
  meta: typeof Generated.FetchObjectModeMeta;
86
218
  markdown: typeof S.String;
87
- json: S.Array$<typeof Generated.FetchObjectModeEvidence>;
219
+ json: S.Array$<S.Struct<{
220
+ id: typeof S.Number;
221
+ kind: typeof Generated.FetchObjectModeEvidenceKind;
222
+ role: typeof Generated.FetchObjectModeEvidenceRole;
223
+ score: S.filter<typeof S.Number>;
224
+ url: S.optionalWith<typeof S.String, {
225
+ nullable: true;
226
+ }>;
227
+ method: S.optionalWith<typeof S.String, {
228
+ nullable: true;
229
+ }>;
230
+ moreTokens: S.optionalWith<typeof S.Number, {
231
+ nullable: true;
232
+ }>;
233
+ keys: S.optionalWith<S.Array$<typeof S.String>, {
234
+ nullable: true;
235
+ }>;
236
+ urlRedacted: S.optionalWith<typeof Generated.FetchObjectModeEvidenceUrlRedacted, {
237
+ nullable: true;
238
+ }>;
239
+ urlOmitted: S.optionalWith<typeof Generated.FetchObjectModeEvidenceUrlOmitted, {
240
+ nullable: true;
241
+ }>;
242
+ body: S.optionalWith<typeof S.Unknown, {
243
+ nullable: true;
244
+ }>;
245
+ }>>;
88
246
  data: S.optionalWith<S.Struct<{
89
247
  assets: S.optionalWith<S.Array$<typeof Generated.FetchAssetReference>, {
90
248
  nullable: true;
@@ -98,9 +256,84 @@ declare const FetchObjectModeResultWithJson_base: S.Class<FetchObjectModeResultW
98
256
  }>, {
99
257
  nullable: true;
100
258
  }>;
101
- search: S.optionalWith<S.Struct<{
259
+ document: S.optionalWith<S.Struct<{
260
+ url: typeof S.String;
261
+ contentType: typeof S.String;
262
+ sizeBytes: typeof S.Number;
263
+ }>, {
264
+ nullable: true;
265
+ }>;
266
+ usage: S.optionalWith<S.Struct<{
267
+ documentPages: typeof Generated.Int;
268
+ ocrPages: typeof Generated.Int;
269
+ audioSeconds: S.filter<typeof S.Number>;
270
+ videos: S.optionalWith<typeof Generated.Int, {
271
+ nullable: true;
272
+ }>;
273
+ }>, {
274
+ nullable: true;
275
+ }>;
276
+ video: S.optionalWith<S.Struct<{
277
+ provider: typeof Generated.FetchObjectModeResultDataVideoProvider;
278
+ videoId: typeof S.String;
279
+ title: typeof S.String;
280
+ channel: S.optionalWith<typeof S.String, {
281
+ nullable: true;
282
+ }>;
283
+ channelUrl: S.optionalWith<typeof S.String, {
284
+ nullable: true;
285
+ }>;
286
+ durationSeconds: S.optionalWith<typeof S.Number, {
287
+ nullable: true;
288
+ }>;
289
+ publishedAt: S.optionalWith<typeof S.String, {
290
+ nullable: true;
291
+ }>;
292
+ viewCount: S.optionalWith<typeof S.Number, {
293
+ nullable: true;
294
+ }>;
295
+ language: S.optionalWith<typeof S.String, {
296
+ nullable: true;
297
+ }>;
298
+ transcript: S.Struct<{
299
+ source: typeof Generated.FetchObjectModeResultDataVideoTranscriptSource;
300
+ kind: S.optionalWith<typeof Generated.FetchObjectModeResultDataVideoTranscriptKind, {
301
+ nullable: true;
302
+ }>;
303
+ language: S.optionalWith<typeof S.String, {
304
+ nullable: true;
305
+ }>;
306
+ }>;
307
+ segments: S.optionalWith<S.Array$<S.Struct<{
308
+ startSeconds: typeof S.Number;
309
+ text: typeof S.String;
310
+ }>>, {
311
+ nullable: true;
312
+ }>;
313
+ chapters: S.optionalWith<S.Array$<S.Struct<{
314
+ title: typeof S.String;
315
+ startSeconds: typeof S.Number;
316
+ }>>, {
317
+ nullable: true;
318
+ }>;
319
+ storyboard: S.optionalWith<S.Struct<{
320
+ frameWidth: typeof S.Int;
321
+ frameHeight: typeof S.Int;
322
+ rows: typeof S.Int;
323
+ columns: typeof S.Int;
324
+ sheets: S.Array$<S.Struct<{
325
+ url: typeof S.String;
326
+ durationSeconds: typeof S.Number;
327
+ }>>;
328
+ }>, {
329
+ nullable: true;
330
+ }>;
331
+ }>, {
332
+ nullable: true;
333
+ }>;
334
+ highlights: S.optionalWith<S.Struct<{
102
335
  query: typeof S.String;
103
- meta: S.optionalWith<typeof Generated.FetchSearchMeta, {
336
+ meta: S.optionalWith<typeof Generated.FetchHighlightsMeta, {
104
337
  nullable: true;
105
338
  }>;
106
339
  snippets: S.Array$<S.Struct<{
@@ -111,7 +344,7 @@ declare const FetchObjectModeResultWithJson_base: S.Class<FetchObjectModeResultW
111
344
  source: S.Literal<["markdown", "appendix", "statejson"]>;
112
345
  text: typeof S.String;
113
346
  score: S.filter<S.filter<typeof S.Number>>;
114
- location: S.optionalWith<typeof Generated.FetchSearchSnippetLocation, {
347
+ location: S.optionalWith<typeof Generated.FetchHighlightsSnippetLocation, {
115
348
  nullable: true;
116
349
  }>;
117
350
  json: S.optionalWith<typeof S.Unknown, {
@@ -124,6 +357,9 @@ declare const FetchObjectModeResultWithJson_base: S.Class<FetchObjectModeResultW
124
357
  }>, {
125
358
  nullable: true;
126
359
  }>;
360
+ originError: S.optionalWith<typeof Generated.FetchHttpOriginError, {
361
+ nullable: true;
362
+ }>;
127
363
  }>, never, {
128
364
  readonly data?: {
129
365
  readonly assets?: readonly {
@@ -138,7 +374,7 @@ declare const FetchObjectModeResultWithJson_base: S.Class<FetchObjectModeResultW
138
374
  readonly degraded?: {
139
375
  readonly reason: "modelInputTooLarge" | "pageTooLarge";
140
376
  readonly skipped: readonly "hfc"[];
141
- readonly limitKind: "ast_bytes" | "domsnapshot_bytes" | "hfc_tokens";
377
+ readonly limitKind: "ast_bytes" | "document_frame_bytes" | "domsnapshot_bytes" | "hfc_tokens";
142
378
  readonly measuredBytes?: number | undefined;
143
379
  readonly thresholdBytes?: number | undefined;
144
380
  readonly measuredTokens?: number | undefined;
@@ -148,7 +384,52 @@ declare const FetchObjectModeResultWithJson_base: S.Class<FetchObjectModeResultW
148
384
  readonly url: string;
149
385
  readonly fullPage: boolean;
150
386
  } | undefined;
151
- readonly search?: {
387
+ readonly document?: {
388
+ readonly url: string;
389
+ readonly contentType: string;
390
+ readonly sizeBytes: number;
391
+ } | undefined;
392
+ readonly usage?: {
393
+ readonly documentPages: number;
394
+ readonly ocrPages: number;
395
+ readonly audioSeconds: number;
396
+ readonly videos?: number | undefined;
397
+ } | undefined;
398
+ readonly video?: {
399
+ readonly provider: "youtube";
400
+ readonly videoId: string;
401
+ readonly title: string;
402
+ readonly channel?: string | undefined;
403
+ readonly channelUrl?: string | undefined;
404
+ readonly durationSeconds?: number | undefined;
405
+ readonly publishedAt?: string | undefined;
406
+ readonly viewCount?: number | undefined;
407
+ readonly language?: string | undefined;
408
+ readonly transcript: {
409
+ readonly source: "captions" | "transcription";
410
+ readonly kind?: "auto" | "manual" | undefined;
411
+ readonly language?: string | undefined;
412
+ };
413
+ readonly segments?: readonly {
414
+ readonly startSeconds: number;
415
+ readonly text: string;
416
+ }[] | undefined;
417
+ readonly chapters?: readonly {
418
+ readonly title: string;
419
+ readonly startSeconds: number;
420
+ }[] | undefined;
421
+ readonly storyboard?: {
422
+ readonly frameWidth: number;
423
+ readonly frameHeight: number;
424
+ readonly rows: number;
425
+ readonly columns: number;
426
+ readonly sheets: readonly {
427
+ readonly url: string;
428
+ readonly durationSeconds: number;
429
+ }[];
430
+ } | undefined;
431
+ } | undefined;
432
+ readonly highlights?: {
152
433
  readonly query: string;
153
434
  readonly meta?: {
154
435
  readonly durationMs: number;
@@ -178,6 +459,17 @@ declare const FetchObjectModeResultWithJson_base: S.Class<FetchObjectModeResultW
178
459
  }[];
179
460
  } | undefined;
180
461
  } | undefined;
462
+ } & {
463
+ readonly originError?: {
464
+ readonly url: string;
465
+ readonly kind: "http";
466
+ readonly contentAvailable?: false | undefined;
467
+ readonly finalUrl?: string | undefined;
468
+ readonly redirectLimitReached?: true | undefined;
469
+ readonly originStatusCode: number;
470
+ readonly retryable: boolean;
471
+ readonly _tag: "FetchOriginError";
472
+ } | undefined;
181
473
  } & {
182
474
  readonly json: readonly {
183
475
  readonly id: number;
@@ -190,6 +482,7 @@ declare const FetchObjectModeResultWithJson_base: S.Class<FetchObjectModeResultW
190
482
  readonly keys?: readonly string[] | undefined;
191
483
  readonly urlRedacted?: true | undefined;
192
484
  readonly urlOmitted?: "invalid" | "too-long" | "unsafe" | undefined;
485
+ readonly body?: unknown;
193
486
  }[];
194
487
  } & {
195
488
  readonly markdown: string;
@@ -202,8 +495,10 @@ declare const FetchObjectModeResultWithJson_base: S.Class<FetchObjectModeResultW
202
495
  readonly lang: string;
203
496
  readonly pageType: string;
204
497
  readonly playground: string;
498
+ readonly citationEvidenceIds?: readonly number[] | undefined;
205
499
  readonly title?: string | undefined;
206
500
  readonly finalUrl?: string | undefined;
501
+ readonly contentType?: string | undefined;
207
502
  readonly canonical?: string | undefined;
208
503
  readonly description?: string | undefined;
209
504
  readonly author?: string | undefined;
@@ -217,6 +512,18 @@ declare const FetchObjectModeResultWithJson_base: S.Class<FetchObjectModeResultW
217
512
  readonly sameDomain: number;
218
513
  readonly external: number;
219
514
  };
515
+ readonly omitted?: {
516
+ readonly blocks: number;
517
+ readonly approxTokens: number;
518
+ } | undefined;
519
+ readonly markers?: readonly {
520
+ readonly evidenceId?: number | undefined;
521
+ readonly links: number;
522
+ readonly approxTokens: number;
523
+ readonly label?: string | undefined;
524
+ readonly preview?: string | undefined;
525
+ readonly moreBlocks?: number | undefined;
526
+ }[] | undefined;
220
527
  } | undefined;
221
528
  readonly stateJson?: {
222
529
  readonly moreTokens: number;
@@ -225,18 +532,40 @@ declare const FetchObjectModeResultWithJson_base: S.Class<FetchObjectModeResultW
225
532
  readonly url: string;
226
533
  readonly moreTokens?: number | undefined;
227
534
  } | undefined;
535
+ readonly resources?: {
536
+ readonly version: 1;
537
+ readonly snapshotId: string;
538
+ readonly url: string;
539
+ readonly markdownUrl: string;
540
+ } | undefined;
228
541
  readonly blocked?: string | undefined;
229
542
  readonly loadingStatus?: string | undefined;
230
543
  };
231
544
  }, {}, {}>;
232
545
  export declare class FetchObjectModeResultWithJson extends FetchObjectModeResultWithJson_base {
233
546
  }
234
- declare const FetchSnapshotSearchResultWithJson_base: S.Class<FetchSnapshotSearchResultWithJson, {
547
+ /**
548
+ * The 200 body of `/v1/fetch/json`. An origin that never answered has no
549
+ * content to return, so the endpoint reports its outcome as the whole body
550
+ * rather than as an HTTP error status — a non-2xx there would mean Expand
551
+ * failed, which it did not.
552
+ *
553
+ * Discriminate on `_tag`, which only `FetchOriginError` carries.
554
+ */
555
+ export declare const FetchObjectModeJsonResponse: S.Union<[typeof FetchObjectModeResultWithJson, typeof Generated.FetchNetworkOriginError, typeof Generated.FetchHttpOriginRefusal]>;
556
+ export type FetchObjectModeJsonResponse = typeof FetchObjectModeJsonResponse.Type;
557
+ /** The unreachable-origin member of `FetchObjectModeJsonResponse`, after narrowing with `isFetchOriginError`. */
558
+ export type FetchOriginErrorResponse = Extract<FetchObjectModeJsonResponse, {
559
+ readonly _tag: 'FetchOriginError';
560
+ }>;
561
+ /** Narrows a `FetchObjectModeJsonResponse` to the unreachable-origin case — the only variant with a `_tag`. */
562
+ export declare function isFetchOriginError(response: FetchObjectModeJsonResponse): response is FetchOriginErrorResponse;
563
+ declare const FetchSnapshotHighlightsResultWithJson_base: S.Class<FetchSnapshotHighlightsResultWithJson, {
235
564
  snapshotId: S.filter<typeof S.String>;
236
565
  response: typeof Generated.ResponseInfo;
237
- search: S.Struct<{
566
+ highlights: S.Struct<{
238
567
  query: typeof S.String;
239
- meta: S.optionalWith<typeof Generated.FetchSearchMeta, {
568
+ meta: S.optionalWith<typeof Generated.FetchHighlightsMeta, {
240
569
  nullable: true;
241
570
  }>;
242
571
  snippets: S.Array$<S.Struct<{
@@ -247,7 +576,7 @@ declare const FetchSnapshotSearchResultWithJson_base: S.Class<FetchSnapshotSearc
247
576
  source: S.Literal<["markdown", "appendix", "statejson"]>;
248
577
  text: typeof S.String;
249
578
  score: S.filter<S.filter<typeof S.Number>>;
250
- location: S.optionalWith<typeof Generated.FetchSearchSnippetLocation, {
579
+ location: S.optionalWith<typeof Generated.FetchHighlightsSnippetLocation, {
251
580
  nullable: true;
252
581
  }>;
253
582
  json: S.optionalWith<typeof S.Unknown, {
@@ -260,9 +589,9 @@ declare const FetchSnapshotSearchResultWithJson_base: S.Class<FetchSnapshotSearc
260
589
  }, S.Struct.Encoded<{
261
590
  snapshotId: S.filter<typeof S.String>;
262
591
  response: typeof Generated.ResponseInfo;
263
- search: S.Struct<{
592
+ highlights: S.Struct<{
264
593
  query: typeof S.String;
265
- meta: S.optionalWith<typeof Generated.FetchSearchMeta, {
594
+ meta: S.optionalWith<typeof Generated.FetchHighlightsMeta, {
266
595
  nullable: true;
267
596
  }>;
268
597
  snippets: S.Array$<S.Struct<{
@@ -273,7 +602,7 @@ declare const FetchSnapshotSearchResultWithJson_base: S.Class<FetchSnapshotSearc
273
602
  source: S.Literal<["markdown", "appendix", "statejson"]>;
274
603
  text: typeof S.String;
275
604
  score: S.filter<S.filter<typeof S.Number>>;
276
- location: S.optionalWith<typeof Generated.FetchSearchSnippetLocation, {
605
+ location: S.optionalWith<typeof Generated.FetchHighlightsSnippetLocation, {
277
606
  nullable: true;
278
607
  }>;
279
608
  json: S.optionalWith<typeof S.Unknown, {
@@ -286,17 +615,7 @@ declare const FetchSnapshotSearchResultWithJson_base: S.Class<FetchSnapshotSearc
286
615
  }>, never, {
287
616
  readonly durationMs: number;
288
617
  } & {
289
- readonly playground: string;
290
- } & {
291
- readonly response: {
292
- readonly url: string;
293
- readonly requestedUrl?: string | undefined;
294
- readonly originStatusCode?: number | undefined;
295
- readonly redirectStatusCode?: number | undefined;
296
- readonly headers?: {} | undefined;
297
- };
298
- } & {
299
- readonly search: {
618
+ readonly highlights: {
300
619
  readonly query: string;
301
620
  readonly meta?: {
302
621
  readonly durationMs: number;
@@ -325,16 +644,42 @@ declare const FetchSnapshotSearchResultWithJson_base: S.Class<FetchSnapshotSearc
325
644
  readonly json?: unknown;
326
645
  }[];
327
646
  };
647
+ } & {
648
+ readonly playground: string;
649
+ } & {
650
+ readonly response: {
651
+ readonly url: string;
652
+ readonly requestedUrl?: string | undefined;
653
+ readonly originStatusCode?: number | undefined;
654
+ readonly redirectStatusCode?: number | undefined;
655
+ readonly contentType?: string | undefined;
656
+ readonly headers?: {} | undefined;
657
+ };
328
658
  } & {
329
659
  readonly snapshotId: string;
330
660
  }, {}, {}>;
331
- export declare class FetchSnapshotSearchResultWithJson extends FetchSnapshotSearchResultWithJson_base {
661
+ export declare class FetchSnapshotHighlightsResultWithJson extends FetchSnapshotHighlightsResultWithJson_base {
332
662
  }
333
663
  /** Mirrors `Generated.Client['fetchFetchJson']` but decodes the 200 body with `json` preserved. */
334
664
  export declare const fetchObjectModeJson: (httpClient: HttpClient.HttpClient, options: {
335
665
  readonly params: typeof Generated.FetchFetchJsonParams.Encoded;
336
666
  readonly payload: typeof Generated.FetchFetchJsonRequest.Encoded;
337
- }) => Effect.Effect<FetchObjectModeResultWithJson, Generated.AuthFailed | Generated.FetchCapacityTimeout | Generated.FetchCaptureTimeout | Generated.FetchNavigationFailed | Generated.InternalError | import("effect/ParseResult").ParseError | Generated.ServiceUnavailable | Generated.TooManyRequests | {
667
+ }) => Effect.Effect<FetchObjectModeResultWithJson | {
668
+ readonly url: string;
669
+ readonly kind: "addressUnreachable" | "connectionClosed" | "connectionRefused" | "connectionReset" | "connectionTimeout" | "dns" | "emptyResponse" | "tls";
670
+ readonly upstreamError?: string | undefined;
671
+ readonly retryable: boolean;
672
+ readonly _tag: "FetchOriginError";
673
+ } | {
674
+ readonly _tag: "FetchOriginError";
675
+ readonly url: string;
676
+ readonly kind: "http";
677
+ readonly contentAvailable: false;
678
+ readonly finalUrl?: string | undefined;
679
+ readonly redirectLimitReached?: true | undefined;
680
+ readonly originStatusCode: number;
681
+ readonly retryable: boolean;
682
+ }, Generated.AuthFailed | import("./Error.js").ExpandSdkError | Generated.FetchCapacityTimeout | Generated.FetchCaptureTimeout | Generated.FetchUnsupportedContentType | Generated.FetchVideoUnavailable | Generated.InternalError | import("effect/ParseResult").ParseError | {
338
683
  readonly issues: readonly {
339
684
  readonly _tag: "Composite" | "Forbidden" | "Missing" | "Pointer" | "Refinement" | "Transformation" | "Type" | "Unexpected";
340
685
  readonly path: readonly (string | number | {
@@ -358,9 +703,54 @@ export declare const fetchObjectModeJson: (httpClient: HttpClient.HttpClient, op
358
703
  readonly _tag: "FetchBlocked";
359
704
  } | {
360
705
  readonly _tag: "PayloadTooLarge";
706
+ } | {
707
+ readonly url: string;
708
+ readonly limitKind?: "ast_bytes" | "audio_seconds" | "document_frame_bytes" | "document_pages" | "domsnapshot_bytes" | "transfer_bytes" | undefined;
709
+ readonly limitBytes?: number | undefined;
710
+ readonly measuredBytes?: number | undefined;
711
+ readonly limit?: number | undefined;
712
+ readonly measured?: number | undefined;
713
+ readonly _tag: "FetchPageTooLarge";
714
+ } | {
715
+ readonly retryable: true;
716
+ readonly retryAfterSeconds?: number | undefined;
717
+ readonly _tag: "TooManyRequests";
718
+ } | {
719
+ readonly retryable: true;
720
+ readonly retryAfterSeconds: number;
721
+ readonly maxConcurrency: number;
722
+ readonly message?: string | undefined;
723
+ readonly requestId?: string | undefined;
724
+ readonly _tag: "FetchConcurrencyLimitExceeded";
725
+ } | {
726
+ readonly url: string;
727
+ readonly failureType: "capabilityFailed" | "pageNeverSettled";
728
+ readonly retryable: false;
729
+ readonly _tag: "FetchCaptureFailed";
730
+ } | {
731
+ readonly url: string;
732
+ readonly failureType: "browserInternalDocument";
733
+ readonly retryable: false;
734
+ readonly _tag: "FetchNavigationFailed";
735
+ } | {
736
+ readonly url: string;
737
+ readonly statusCode: number;
738
+ readonly contentType?: string | undefined;
739
+ readonly _tag: "FetchOriginHttpError";
740
+ } | {
741
+ readonly message?: string | undefined;
742
+ readonly requestId?: string | undefined;
743
+ readonly dispatchOutcome?: "cancelled_after_start" | "cancelled_before_start" | "unknown" | undefined;
744
+ readonly retryable: true;
745
+ readonly _tag: "ServiceUnavailable";
746
+ } | {
747
+ readonly url: string;
748
+ readonly operation: "ocr" | "transcription" | "video";
749
+ readonly message: string;
750
+ readonly _tag: "FetchDocumentProcessingUnavailable";
361
751
  } | import("@effect/platform/HttpClientError").HttpClientError, never>;
362
- /** Mirrors `Generated.Client['fetchFetchSearch']` but decodes the 200 body with `json` preserved. */
363
- export declare const fetchSnapshotSearch: (httpClient: HttpClient.HttpClient, options: typeof Generated.FetchFetchSearchRequest.Encoded) => Effect.Effect<FetchSnapshotSearchResultWithJson, Generated.AuthFailed | Generated.FetchSnapshotSearchNotFound | Generated.InternalError | import("effect/ParseResult").ParseError | Generated.ServiceUnavailable | Generated.TooManyRequests | {
752
+ /** Mirrors `Generated.Client['snapshotsHighlights']` but decodes the 200 body with `json` preserved. */
753
+ export declare const fetchSnapshotHighlights: (httpClient: HttpClient.HttpClient, snapshotId: string, options: typeof Generated.SnapshotHighlightsInput.Encoded) => Effect.Effect<FetchSnapshotHighlightsResultWithJson, Generated.AuthFailed | import("./Error.js").ExpandSdkError | Generated.FetchSnapshotHighlightsNotFound | Generated.InternalError | import("effect/ParseResult").ParseError | {
364
754
  readonly issues: readonly {
365
755
  readonly _tag: "Composite" | "Forbidden" | "Missing" | "Pointer" | "Refinement" | "Transformation" | "Type" | "Unexpected";
366
756
  readonly path: readonly (string | number | {
@@ -376,6 +766,23 @@ export declare const fetchSnapshotSearch: (httpClient: HttpClient.HttpClient, op
376
766
  readonly _tag: "BadRequest";
377
767
  } | {
378
768
  readonly _tag: "PayloadTooLarge";
769
+ } | {
770
+ readonly retryable: true;
771
+ readonly retryAfterSeconds?: number | undefined;
772
+ readonly _tag: "TooManyRequests";
773
+ } | {
774
+ readonly retryable: true;
775
+ readonly retryAfterSeconds: number;
776
+ readonly maxConcurrency: number;
777
+ readonly message?: string | undefined;
778
+ readonly requestId?: string | undefined;
779
+ readonly _tag: "FetchConcurrencyLimitExceeded";
780
+ } | {
781
+ readonly message?: string | undefined;
782
+ readonly requestId?: string | undefined;
783
+ readonly dispatchOutcome?: "cancelled_after_start" | "cancelled_before_start" | "unknown" | undefined;
784
+ readonly retryable: true;
785
+ readonly _tag: "ServiceUnavailable";
379
786
  } | {
380
787
  readonly organizationId: string;
381
788
  readonly blockedUntil?: string | null | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"FetchJson.d.ts","sourceRoot":"","sources":["../../src/FetchJson.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAyC,MAAM,kBAAkB,CAAA;AACpF,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAC5C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAG3C,0FAA0F;AAC1F,eAAO,MAAM,0BAA0B;;;;;;;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