smoltalk 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/models.d.ts CHANGED
@@ -42,6 +42,16 @@ export type TextModel = BaseModel & {
42
42
  levels?: readonly string[];
43
43
  /** Default reasoning level */
44
44
  defaultLevel?: string;
45
+ /**
46
+ * Anthropic thinking API shape:
47
+ * "adaptive" → `thinking: {type: "adaptive"}` + `output_config: {effort}`
48
+ * (Opus 4.6/4.7/4.8, Sonnet 4.6). Required on 4.7+, where the
49
+ * legacy `enabled` form returns a 400.
50
+ * "budget" → `thinking: {type: "enabled", budget_tokens: N}`
51
+ * (Haiku 4.5 and older models).
52
+ * Omit for non-Anthropic models.
53
+ */
54
+ thinkingStyle?: "adaptive" | "budget";
45
55
  /** Whether reasoning/thinking can be fully disabled */
46
56
  canDisable?: boolean;
47
57
  /** Whether the response includes visible thinking content (thinking blocks/parts) */
@@ -251,7 +261,7 @@ export declare const textModels: readonly [{
251
261
  readonly outputsThinking: false;
252
262
  readonly outputsSignatures: false;
253
263
  };
254
- readonly provider: "openai";
264
+ readonly provider: "openai-responses";
255
265
  }, {
256
266
  readonly type: "text";
257
267
  readonly modelName: "gpt-5-mini";
@@ -269,7 +279,7 @@ export declare const textModels: readonly [{
269
279
  readonly outputsThinking: false;
270
280
  readonly outputsSignatures: false;
271
281
  };
272
- readonly provider: "openai";
282
+ readonly provider: "openai-responses";
273
283
  }, {
274
284
  readonly type: "text";
275
285
  readonly modelName: "gpt-5-nano";
@@ -287,7 +297,7 @@ export declare const textModels: readonly [{
287
297
  readonly outputsThinking: false;
288
298
  readonly outputsSignatures: false;
289
299
  };
290
- readonly provider: "openai";
300
+ readonly provider: "openai-responses";
291
301
  }, {
292
302
  readonly type: "text";
293
303
  readonly modelName: "gpt-5.1";
@@ -304,7 +314,7 @@ export declare const textModels: readonly [{
304
314
  readonly outputsThinking: false;
305
315
  readonly outputsSignatures: false;
306
316
  };
307
- readonly provider: "openai";
317
+ readonly provider: "openai-responses";
308
318
  }, {
309
319
  readonly type: "text";
310
320
  readonly modelName: "gpt-5.2";
@@ -322,7 +332,7 @@ export declare const textModels: readonly [{
322
332
  readonly outputsThinking: false;
323
333
  readonly outputsSignatures: false;
324
334
  };
325
- readonly provider: "openai";
335
+ readonly provider: "openai-responses";
326
336
  }, {
327
337
  readonly type: "text";
328
338
  readonly modelName: "gpt-5.2-pro";
@@ -336,7 +346,7 @@ export declare const textModels: readonly [{
336
346
  readonly outputsThinking: false;
337
347
  readonly outputsSignatures: false;
338
348
  };
339
- readonly provider: "openai";
349
+ readonly provider: "openai-responses";
340
350
  }, {
341
351
  readonly type: "text";
342
352
  readonly modelName: "gpt-5.4";
@@ -353,7 +363,7 @@ export declare const textModels: readonly [{
353
363
  readonly outputsThinking: false;
354
364
  readonly outputsSignatures: false;
355
365
  };
356
- readonly provider: "openai";
366
+ readonly provider: "openai-responses";
357
367
  }, {
358
368
  readonly type: "text";
359
369
  readonly modelName: "gpt-5.4-mini";
@@ -371,7 +381,7 @@ export declare const textModels: readonly [{
371
381
  readonly outputsThinking: false;
372
382
  readonly outputsSignatures: false;
373
383
  };
374
- readonly provider: "openai";
384
+ readonly provider: "openai-responses";
375
385
  }, {
376
386
  readonly type: "text";
377
387
  readonly modelName: "gpt-5.4-nano";
@@ -389,7 +399,7 @@ export declare const textModels: readonly [{
389
399
  readonly outputsThinking: false;
390
400
  readonly outputsSignatures: false;
391
401
  };
392
- readonly provider: "openai";
402
+ readonly provider: "openai-responses";
393
403
  }, {
394
404
  readonly type: "text";
395
405
  readonly modelName: "gpt-5.4-pro";
@@ -405,7 +415,7 @@ export declare const textModels: readonly [{
405
415
  readonly outputsThinking: false;
406
416
  readonly outputsSignatures: false;
407
417
  };
408
- readonly provider: "openai";
418
+ readonly provider: "openai-responses";
409
419
  }, {
410
420
  readonly type: "text";
411
421
  readonly modelName: "gpt-5.5";
@@ -423,7 +433,7 @@ export declare const textModels: readonly [{
423
433
  readonly outputsThinking: false;
424
434
  readonly outputsSignatures: false;
425
435
  };
426
- readonly provider: "openai";
436
+ readonly provider: "openai-responses";
427
437
  }, {
428
438
  readonly type: "text";
429
439
  readonly modelName: "gpt-5.5-pro";
@@ -439,7 +449,7 @@ export declare const textModels: readonly [{
439
449
  readonly outputsThinking: false;
440
450
  readonly outputsSignatures: false;
441
451
  };
442
- readonly provider: "openai";
452
+ readonly provider: "openai-responses";
443
453
  }, {
444
454
  readonly type: "text";
445
455
  readonly modelName: "gemini-3.1-pro-preview";
@@ -652,6 +662,7 @@ export declare const textModels: readonly [{
652
662
  readonly cachedInputTokenCost: 0.5;
653
663
  readonly outputTokenCost: 25;
654
664
  readonly reasoning: {
665
+ readonly thinkingStyle: "adaptive";
655
666
  readonly canDisable: false;
656
667
  readonly outputsThinking: true;
657
668
  readonly outputsSignatures: true;
@@ -669,6 +680,7 @@ export declare const textModels: readonly [{
669
680
  readonly outputTokenCost: 25;
670
681
  readonly outputTokensPerSecond: 72;
671
682
  readonly reasoning: {
683
+ readonly thinkingStyle: "adaptive";
672
684
  readonly canDisable: false;
673
685
  readonly outputsThinking: true;
674
686
  readonly outputsSignatures: true;
@@ -686,6 +698,7 @@ export declare const textModels: readonly [{
686
698
  readonly outputTokenCost: 25;
687
699
  readonly outputTokensPerSecond: 53;
688
700
  readonly reasoning: {
701
+ readonly thinkingStyle: "adaptive";
689
702
  readonly canDisable: true;
690
703
  readonly outputsThinking: true;
691
704
  readonly outputsSignatures: true;
@@ -703,6 +716,7 @@ export declare const textModels: readonly [{
703
716
  readonly outputTokenCost: 15;
704
717
  readonly outputTokensPerSecond: 52;
705
718
  readonly reasoning: {
719
+ readonly thinkingStyle: "adaptive";
706
720
  readonly canDisable: true;
707
721
  readonly outputsThinking: true;
708
722
  readonly outputsSignatures: true;
@@ -720,6 +734,7 @@ export declare const textModels: readonly [{
720
734
  readonly outputTokenCost: 5;
721
735
  readonly outputTokensPerSecond: 97;
722
736
  readonly reasoning: {
737
+ readonly thinkingStyle: "budget";
723
738
  readonly canDisable: true;
724
739
  readonly outputsThinking: true;
725
740
  readonly outputsSignatures: true;
@@ -735,6 +750,7 @@ export declare const textModels: readonly [{
735
750
  readonly outputTokenCost: 15;
736
751
  readonly outputTokensPerSecond: 78;
737
752
  readonly reasoning: {
753
+ readonly thinkingStyle: "budget";
738
754
  readonly canDisable: true;
739
755
  readonly outputsThinking: true;
740
756
  readonly outputsSignatures: true;
@@ -997,7 +1013,7 @@ export declare function getModel(modelName: ModelName): TextModel | EmbeddingsMo
997
1013
  readonly outputsThinking: false;
998
1014
  readonly outputsSignatures: false;
999
1015
  };
1000
- readonly provider: "openai";
1016
+ readonly provider: "openai-responses";
1001
1017
  } | {
1002
1018
  readonly type: "text";
1003
1019
  readonly modelName: "gpt-5-mini";
@@ -1015,7 +1031,7 @@ export declare function getModel(modelName: ModelName): TextModel | EmbeddingsMo
1015
1031
  readonly outputsThinking: false;
1016
1032
  readonly outputsSignatures: false;
1017
1033
  };
1018
- readonly provider: "openai";
1034
+ readonly provider: "openai-responses";
1019
1035
  } | {
1020
1036
  readonly type: "text";
1021
1037
  readonly modelName: "gpt-5-nano";
@@ -1033,7 +1049,7 @@ export declare function getModel(modelName: ModelName): TextModel | EmbeddingsMo
1033
1049
  readonly outputsThinking: false;
1034
1050
  readonly outputsSignatures: false;
1035
1051
  };
1036
- readonly provider: "openai";
1052
+ readonly provider: "openai-responses";
1037
1053
  } | {
1038
1054
  readonly type: "text";
1039
1055
  readonly modelName: "gpt-5.1";
@@ -1050,7 +1066,7 @@ export declare function getModel(modelName: ModelName): TextModel | EmbeddingsMo
1050
1066
  readonly outputsThinking: false;
1051
1067
  readonly outputsSignatures: false;
1052
1068
  };
1053
- readonly provider: "openai";
1069
+ readonly provider: "openai-responses";
1054
1070
  } | {
1055
1071
  readonly type: "text";
1056
1072
  readonly modelName: "gpt-5.2";
@@ -1068,7 +1084,7 @@ export declare function getModel(modelName: ModelName): TextModel | EmbeddingsMo
1068
1084
  readonly outputsThinking: false;
1069
1085
  readonly outputsSignatures: false;
1070
1086
  };
1071
- readonly provider: "openai";
1087
+ readonly provider: "openai-responses";
1072
1088
  } | {
1073
1089
  readonly type: "text";
1074
1090
  readonly modelName: "gpt-5.2-pro";
@@ -1082,7 +1098,7 @@ export declare function getModel(modelName: ModelName): TextModel | EmbeddingsMo
1082
1098
  readonly outputsThinking: false;
1083
1099
  readonly outputsSignatures: false;
1084
1100
  };
1085
- readonly provider: "openai";
1101
+ readonly provider: "openai-responses";
1086
1102
  } | {
1087
1103
  readonly type: "text";
1088
1104
  readonly modelName: "gpt-5.4";
@@ -1099,7 +1115,7 @@ export declare function getModel(modelName: ModelName): TextModel | EmbeddingsMo
1099
1115
  readonly outputsThinking: false;
1100
1116
  readonly outputsSignatures: false;
1101
1117
  };
1102
- readonly provider: "openai";
1118
+ readonly provider: "openai-responses";
1103
1119
  } | {
1104
1120
  readonly type: "text";
1105
1121
  readonly modelName: "gpt-5.4-mini";
@@ -1117,7 +1133,7 @@ export declare function getModel(modelName: ModelName): TextModel | EmbeddingsMo
1117
1133
  readonly outputsThinking: false;
1118
1134
  readonly outputsSignatures: false;
1119
1135
  };
1120
- readonly provider: "openai";
1136
+ readonly provider: "openai-responses";
1121
1137
  } | {
1122
1138
  readonly type: "text";
1123
1139
  readonly modelName: "gpt-5.4-nano";
@@ -1135,7 +1151,7 @@ export declare function getModel(modelName: ModelName): TextModel | EmbeddingsMo
1135
1151
  readonly outputsThinking: false;
1136
1152
  readonly outputsSignatures: false;
1137
1153
  };
1138
- readonly provider: "openai";
1154
+ readonly provider: "openai-responses";
1139
1155
  } | {
1140
1156
  readonly type: "text";
1141
1157
  readonly modelName: "gpt-5.4-pro";
@@ -1151,7 +1167,7 @@ export declare function getModel(modelName: ModelName): TextModel | EmbeddingsMo
1151
1167
  readonly outputsThinking: false;
1152
1168
  readonly outputsSignatures: false;
1153
1169
  };
1154
- readonly provider: "openai";
1170
+ readonly provider: "openai-responses";
1155
1171
  } | {
1156
1172
  readonly type: "text";
1157
1173
  readonly modelName: "gpt-5.5";
@@ -1169,7 +1185,7 @@ export declare function getModel(modelName: ModelName): TextModel | EmbeddingsMo
1169
1185
  readonly outputsThinking: false;
1170
1186
  readonly outputsSignatures: false;
1171
1187
  };
1172
- readonly provider: "openai";
1188
+ readonly provider: "openai-responses";
1173
1189
  } | {
1174
1190
  readonly type: "text";
1175
1191
  readonly modelName: "gpt-5.5-pro";
@@ -1185,7 +1201,7 @@ export declare function getModel(modelName: ModelName): TextModel | EmbeddingsMo
1185
1201
  readonly outputsThinking: false;
1186
1202
  readonly outputsSignatures: false;
1187
1203
  };
1188
- readonly provider: "openai";
1204
+ readonly provider: "openai-responses";
1189
1205
  } | {
1190
1206
  readonly type: "text";
1191
1207
  readonly modelName: "gemini-3.1-pro-preview";
@@ -1398,6 +1414,7 @@ export declare function getModel(modelName: ModelName): TextModel | EmbeddingsMo
1398
1414
  readonly cachedInputTokenCost: 0.5;
1399
1415
  readonly outputTokenCost: 25;
1400
1416
  readonly reasoning: {
1417
+ readonly thinkingStyle: "adaptive";
1401
1418
  readonly canDisable: false;
1402
1419
  readonly outputsThinking: true;
1403
1420
  readonly outputsSignatures: true;
@@ -1415,6 +1432,7 @@ export declare function getModel(modelName: ModelName): TextModel | EmbeddingsMo
1415
1432
  readonly outputTokenCost: 25;
1416
1433
  readonly outputTokensPerSecond: 72;
1417
1434
  readonly reasoning: {
1435
+ readonly thinkingStyle: "adaptive";
1418
1436
  readonly canDisable: false;
1419
1437
  readonly outputsThinking: true;
1420
1438
  readonly outputsSignatures: true;
@@ -1432,6 +1450,7 @@ export declare function getModel(modelName: ModelName): TextModel | EmbeddingsMo
1432
1450
  readonly outputTokenCost: 25;
1433
1451
  readonly outputTokensPerSecond: 53;
1434
1452
  readonly reasoning: {
1453
+ readonly thinkingStyle: "adaptive";
1435
1454
  readonly canDisable: true;
1436
1455
  readonly outputsThinking: true;
1437
1456
  readonly outputsSignatures: true;
@@ -1449,6 +1468,7 @@ export declare function getModel(modelName: ModelName): TextModel | EmbeddingsMo
1449
1468
  readonly outputTokenCost: 15;
1450
1469
  readonly outputTokensPerSecond: 52;
1451
1470
  readonly reasoning: {
1471
+ readonly thinkingStyle: "adaptive";
1452
1472
  readonly canDisable: true;
1453
1473
  readonly outputsThinking: true;
1454
1474
  readonly outputsSignatures: true;
@@ -1466,6 +1486,7 @@ export declare function getModel(modelName: ModelName): TextModel | EmbeddingsMo
1466
1486
  readonly outputTokenCost: 5;
1467
1487
  readonly outputTokensPerSecond: 97;
1468
1488
  readonly reasoning: {
1489
+ readonly thinkingStyle: "budget";
1469
1490
  readonly canDisable: true;
1470
1491
  readonly outputsThinking: true;
1471
1492
  readonly outputsSignatures: true;
@@ -1481,6 +1502,7 @@ export declare function getModel(modelName: ModelName): TextModel | EmbeddingsMo
1481
1502
  readonly outputTokenCost: 15;
1482
1503
  readonly outputTokensPerSecond: 78;
1483
1504
  readonly reasoning: {
1505
+ readonly thinkingStyle: "budget";
1484
1506
  readonly canDisable: true;
1485
1507
  readonly outputsThinking: true;
1486
1508
  readonly outputsSignatures: true;
package/dist/models.js CHANGED
@@ -229,7 +229,7 @@ export const textModels = [
229
229
  outputsThinking: false,
230
230
  outputsSignatures: false,
231
231
  },
232
- provider: "openai",
232
+ provider: "openai-responses",
233
233
  },
234
234
  {
235
235
  type: "text",
@@ -248,7 +248,7 @@ export const textModels = [
248
248
  outputsThinking: false,
249
249
  outputsSignatures: false,
250
250
  },
251
- provider: "openai",
251
+ provider: "openai-responses",
252
252
  },
253
253
  {
254
254
  type: "text",
@@ -267,7 +267,7 @@ export const textModels = [
267
267
  outputsThinking: false,
268
268
  outputsSignatures: false,
269
269
  },
270
- provider: "openai",
270
+ provider: "openai-responses",
271
271
  },
272
272
  {
273
273
  type: "text",
@@ -285,7 +285,7 @@ export const textModels = [
285
285
  outputsThinking: false,
286
286
  outputsSignatures: false,
287
287
  },
288
- provider: "openai",
288
+ provider: "openai-responses",
289
289
  },
290
290
  {
291
291
  type: "text",
@@ -304,7 +304,7 @@ export const textModels = [
304
304
  outputsThinking: false,
305
305
  outputsSignatures: false,
306
306
  },
307
- provider: "openai",
307
+ provider: "openai-responses",
308
308
  },
309
309
  {
310
310
  type: "text",
@@ -319,7 +319,7 @@ export const textModels = [
319
319
  outputsThinking: false,
320
320
  outputsSignatures: false,
321
321
  },
322
- provider: "openai",
322
+ provider: "openai-responses",
323
323
  },
324
324
  {
325
325
  type: "text",
@@ -337,7 +337,7 @@ export const textModels = [
337
337
  outputsThinking: false,
338
338
  outputsSignatures: false,
339
339
  },
340
- provider: "openai",
340
+ provider: "openai-responses",
341
341
  },
342
342
  {
343
343
  type: "text",
@@ -356,7 +356,7 @@ export const textModels = [
356
356
  outputsThinking: false,
357
357
  outputsSignatures: false,
358
358
  },
359
- provider: "openai",
359
+ provider: "openai-responses",
360
360
  },
361
361
  {
362
362
  type: "text",
@@ -375,7 +375,7 @@ export const textModels = [
375
375
  outputsThinking: false,
376
376
  outputsSignatures: false,
377
377
  },
378
- provider: "openai",
378
+ provider: "openai-responses",
379
379
  },
380
380
  {
381
381
  type: "text",
@@ -392,7 +392,7 @@ export const textModels = [
392
392
  outputsThinking: false,
393
393
  outputsSignatures: false,
394
394
  },
395
- provider: "openai",
395
+ provider: "openai-responses",
396
396
  },
397
397
  {
398
398
  type: "text",
@@ -411,7 +411,7 @@ export const textModels = [
411
411
  outputsThinking: false,
412
412
  outputsSignatures: false,
413
413
  },
414
- provider: "openai",
414
+ provider: "openai-responses",
415
415
  },
416
416
  {
417
417
  type: "text",
@@ -428,7 +428,7 @@ export const textModels = [
428
428
  outputsThinking: false,
429
429
  outputsSignatures: false,
430
430
  },
431
- provider: "openai",
431
+ provider: "openai-responses",
432
432
  },
433
433
  {
434
434
  type: "text",
@@ -657,6 +657,7 @@ export const textModels = [
657
657
  cachedInputTokenCost: 0.5,
658
658
  outputTokenCost: 25,
659
659
  reasoning: {
660
+ thinkingStyle: "adaptive",
660
661
  canDisable: false,
661
662
  outputsThinking: true,
662
663
  outputsSignatures: true,
@@ -675,6 +676,7 @@ export const textModels = [
675
676
  outputTokenCost: 25,
676
677
  outputTokensPerSecond: 72,
677
678
  reasoning: {
679
+ thinkingStyle: "adaptive",
678
680
  canDisable: false,
679
681
  outputsThinking: true,
680
682
  outputsSignatures: true,
@@ -693,6 +695,7 @@ export const textModels = [
693
695
  outputTokenCost: 25,
694
696
  outputTokensPerSecond: 53,
695
697
  reasoning: {
698
+ thinkingStyle: "adaptive",
696
699
  canDisable: true,
697
700
  outputsThinking: true,
698
701
  outputsSignatures: true,
@@ -711,6 +714,7 @@ export const textModels = [
711
714
  outputTokenCost: 15,
712
715
  outputTokensPerSecond: 52,
713
716
  reasoning: {
717
+ thinkingStyle: "adaptive",
714
718
  canDisable: true,
715
719
  outputsThinking: true,
716
720
  outputsSignatures: true,
@@ -729,6 +733,7 @@ export const textModels = [
729
733
  outputTokenCost: 5,
730
734
  outputTokensPerSecond: 97,
731
735
  reasoning: {
736
+ thinkingStyle: "budget",
732
737
  canDisable: true,
733
738
  outputsThinking: true,
734
739
  outputsSignatures: true,
@@ -745,6 +750,7 @@ export const textModels = [
745
750
  outputTokenCost: 15,
746
751
  outputTokensPerSecond: 78,
747
752
  reasoning: {
753
+ thinkingStyle: "budget",
748
754
  canDisable: true,
749
755
  outputsThinking: true,
750
756
  outputsSignatures: true,
@@ -1,15 +1,88 @@
1
+ export interface SmolErrorOptions {
2
+ /** HTTP status code from the provider response, when the error came from an HTTP call. */
3
+ status?: number;
4
+ /**
5
+ * Curated, safe-to-log subset of the provider response headers (see
6
+ * `extractHttpErrorFields` for the allowlist). The full, unredacted headers
7
+ * live on the raw provider error at `cause`.
8
+ */
9
+ headers?: Record<string, string>;
10
+ /**
11
+ * Suggested wait before retrying, in milliseconds, parsed from the
12
+ * `retry-after-ms` / `retry-after` response headers (when available).
13
+ */
14
+ retryAfterMs?: number;
15
+ /** Provider request id (`x-request-id` / `request-id`), useful for support tickets. */
16
+ requestId?: string;
17
+ /** The underlying provider error this was derived from, if any. */
18
+ cause?: unknown;
19
+ }
20
+ /**
21
+ * Base error type for all smoltalk failures. Carries a curated, safe-to-log
22
+ * snapshot of the HTTP response on `status` / `headers` / `retryAfterMs` /
23
+ * `requestId`.
24
+ *
25
+ * **Security note on `cause`:** the raw provider error is attached at `cause`
26
+ * as a non-enumerable property (using the ES2022 `Error` `{ cause }` option),
27
+ * so `JSON.stringify(err)` and most error serializers (Sentry, pino, Bunyan)
28
+ * will NOT walk it. The custom `toJSON()` below similarly omits both `cause`
29
+ * and `stack`. The provider error can still contain `authorization` headers,
30
+ * cookies, and echoed prompt bodies — direct access (`err.cause`) and Node's
31
+ * native `console.error` chain still work, so handle deliberately.
32
+ */
1
33
  export declare class SmolError extends Error {
2
- constructor(message: string);
34
+ /** HTTP status code from the provider response, when available. */
35
+ readonly status?: number;
36
+ /**
37
+ * Curated, safe-to-log subset of the provider response headers. For the full,
38
+ * unredacted set (including any session cookies the provider sent), reach for
39
+ * the raw provider error on `cause` — but note that `cause` is non-enumerable
40
+ * specifically to keep it out of casual logging.
41
+ */
42
+ readonly headers?: Record<string, string>;
43
+ /**
44
+ * Suggested wait before retrying, in milliseconds, parsed from the
45
+ * `retry-after-ms` / `retry-after` response headers (when available).
46
+ * Always non-negative and capped at a sane ceiling (see `httpError.ts`).
47
+ */
48
+ readonly retryAfterMs?: number;
49
+ /** Provider request id (`x-request-id` / `request-id`), useful for support tickets. */
50
+ readonly requestId?: string;
51
+ constructor(message: string, options?: SmolErrorOptions);
52
+ /**
53
+ * Custom JSON serializer. Returns only the curated/safe fields — never
54
+ * `cause` or `stack`, both of which can leak secrets (auth headers in
55
+ * `cause`, file system paths and source snippets in `stack`).
56
+ */
57
+ toJSON(): Record<string, unknown>;
3
58
  }
4
59
  export declare class SmolStructuredOutputError extends SmolError {
5
- constructor(message: string);
60
+ constructor(message: string, options?: SmolErrorOptions);
6
61
  }
7
62
  export declare class SmolTimeoutError extends SmolError {
8
- constructor(message: string);
63
+ constructor(message: string, options?: SmolErrorOptions);
9
64
  }
10
65
  export declare class SmolContentPolicyError extends SmolError {
11
- constructor(message: string);
66
+ constructor(message: string, options?: SmolErrorOptions);
12
67
  }
13
68
  export declare class SmolContextWindowExceededError extends SmolError {
14
- constructor(message: string);
69
+ constructor(message: string, options?: SmolErrorOptions);
70
+ }
71
+ /** Rate limited (HTTP 429). Inspect `retryAfterMs` to back off. */
72
+ export declare class SmolRateLimitError extends SmolError {
73
+ constructor(message: string, options?: SmolErrorOptions);
74
+ }
75
+ /** Provider temporarily overloaded/unavailable (HTTP 503, or Anthropic's 529). */
76
+ export declare class SmolOverloadedError extends SmolError {
77
+ constructor(message: string, options?: SmolErrorOptions);
78
+ }
79
+ /** Authentication or permission failure (HTTP 401/403). */
80
+ export declare class SmolAuthError extends SmolError {
81
+ constructor(message: string, options?: SmolErrorOptions);
15
82
  }
83
+ /**
84
+ * Pick the most specific SmolError subclass for an HTTP status code, so retry
85
+ * code can `instanceof`-dispatch instead of sniffing magic status numbers.
86
+ * Falls back to the base `SmolError` for unclassified statuses.
87
+ */
88
+ export declare function smolErrorForStatus(message: string, options?: SmolErrorOptions): SmolError;