@oh-my-pi/pi-ai 17.2.6 → 17.2.7

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 (31) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/types/auth-broker/client.d.ts +7 -0
  3. package/dist/types/auth-broker/server.d.ts +11 -0
  4. package/dist/types/auth-broker/wire-schema-resource.d.ts +1 -1
  5. package/dist/types/auth-broker/wire-schemas.d.ts +4 -2
  6. package/dist/types/index.d.ts +1 -1
  7. package/dist/types/providers/anthropic-messages-server-schema.d.ts +695 -255
  8. package/dist/types/providers/openai-chat-server-schema.d.ts +909 -293
  9. package/dist/types/providers/openai-responses-server-schema.d.ts +980 -353
  10. package/dist/types/types.d.ts +8 -5
  11. package/dist/types/usage.d.ts +152 -46
  12. package/dist/types/utils/schema/wire.d.ts +1 -1
  13. package/dist/types/utils/validation.d.ts +24 -0
  14. package/package.json +5 -5
  15. package/src/auth-broker/client.ts +2 -1
  16. package/src/auth-broker/server.ts +2 -1
  17. package/src/auth-broker/wire-schema-resource.ts +1 -6
  18. package/src/index.ts +1 -1
  19. package/src/providers/anthropic-messages-server-schema.ts +1 -1
  20. package/src/providers/anthropic-messages-server.ts +1 -1
  21. package/src/providers/cursor.ts +31 -3
  22. package/src/providers/google-gemini-cli.ts +1 -1
  23. package/src/providers/openai-chat-server-schema.ts +1 -1
  24. package/src/providers/openai-chat-server.ts +1 -1
  25. package/src/providers/openai-codex-responses.ts +1 -1
  26. package/src/providers/openai-responses-server-schema.ts +1 -1
  27. package/src/providers/openai-responses-server.ts +1 -1
  28. package/src/types.ts +9 -6
  29. package/src/usage.ts +1 -1
  30. package/src/utils/schema/wire.ts +1 -1
  31. package/src/utils/validation.ts +2 -1
@@ -4,484 +4,924 @@
4
4
  * and options.
5
5
  */
6
6
  import type { ContentBlockParam, ImageBlockParam, MessageCreateParams, MessageParam, TextBlockParam, Tool, ToolChoice } from "./anthropic-wire.js";
7
- export declare const cacheControlSchema: import("arktype/internal/variants/object.ts").ObjectType<{
7
+ export declare const cacheControlSchema: import("@oh-my-pi/omptype").FluentType<{
8
+ ttl?: "1h" | "5m" | undefined;
8
9
  type: "ephemeral";
10
+ }, {
9
11
  ttl?: "1h" | "5m" | undefined;
10
- }, {}>;
11
- export declare const base64ImageSourceSchema: import("arktype/internal/variants/object.ts").ObjectType<{
12
+ type: "ephemeral";
13
+ }>;
14
+ export declare const base64ImageSourceSchema: import("@oh-my-pi/omptype").FluentType<{
15
+ data: string;
16
+ media_type: string;
12
17
  type: "base64";
18
+ }, {
13
19
  data: string;
14
20
  media_type: string;
15
- }, {}>;
16
- export declare const urlImageSourceSchema: import("arktype/internal/variants/object.ts").ObjectType<{
21
+ type: "base64";
22
+ }>;
23
+ export declare const urlImageSourceSchema: import("@oh-my-pi/omptype").FluentType<{
24
+ type: "url";
25
+ url: string;
26
+ }, {
17
27
  type: "url";
18
28
  url: string;
19
- }, {}>;
20
- export declare const fileImageSourceSchema: import("arktype/internal/variants/object.ts").ObjectType<{
29
+ }>;
30
+ export declare const fileImageSourceSchema: import("@oh-my-pi/omptype").FluentType<{
31
+ file_id: string;
21
32
  type: "file";
33
+ }, {
22
34
  file_id: string;
23
- }, {}>;
24
- export declare const imageSourceSchema: import("arktype/internal/variants/object.ts").ObjectType<{
25
- type: "base64";
35
+ type: "file";
36
+ }>;
37
+ export declare const imageSourceSchema: import("@oh-my-pi/omptype").FluentType<{
26
38
  data: string;
27
39
  media_type: string;
40
+ type: "base64";
28
41
  } | {
29
42
  type: "url";
30
43
  url: string;
31
44
  } | {
45
+ file_id: string;
32
46
  type: "file";
47
+ }, {
48
+ data: string;
49
+ media_type: string;
50
+ type: "base64";
51
+ } | {
52
+ type: "url";
53
+ url: string;
54
+ } | {
33
55
  file_id: string;
34
- }, {}>;
35
- export declare const systemSchema: import("arktype").BaseType<string | {
36
- type: "text";
37
- text: string;
56
+ type: "file";
57
+ }>;
58
+ export declare const systemSchema: import("@oh-my-pi/omptype").FluentType<string | {
38
59
  cache_control?: {
60
+ ttl?: "1h" | "5m" | undefined;
39
61
  type: "ephemeral";
62
+ } | undefined;
63
+ text: string;
64
+ type: "text";
65
+ }[] | undefined, string | {
66
+ cache_control?: {
40
67
  ttl?: "1h" | "5m" | undefined;
68
+ type: "ephemeral";
41
69
  } | undefined;
42
- }[] | undefined, {}>;
43
- export declare const userMessageSchema: import("arktype/internal/variants/object.ts").ObjectType<{
44
- role: "user";
70
+ text: string;
71
+ type: "text";
72
+ }[] | undefined>;
73
+ export declare const userMessageSchema: import("@oh-my-pi/omptype").FluentType<{
45
74
  content: string | ({
46
- type: "text";
47
- text: string;
48
75
  cache_control?: {
49
- type: "ephemeral";
50
76
  ttl?: "1h" | "5m" | undefined;
77
+ type: "ephemeral";
51
78
  } | undefined;
79
+ text: string;
80
+ type: "text";
52
81
  } | {
53
- type: "image";
82
+ cache_control?: {
83
+ ttl?: "1h" | "5m" | undefined;
84
+ type: "ephemeral";
85
+ } | undefined;
54
86
  source: {
55
- type: "base64";
56
87
  data: string;
57
88
  media_type: string;
89
+ type: "base64";
58
90
  } | {
59
91
  type: "url";
60
92
  url: string;
61
93
  } | {
62
- type: "file";
63
94
  file_id: string;
95
+ type: "file";
64
96
  };
97
+ type: "image";
98
+ } | {
65
99
  cache_control?: {
66
- type: "ephemeral";
67
100
  ttl?: "1h" | "5m" | undefined;
101
+ type: "ephemeral";
68
102
  } | undefined;
69
- } | {
70
- type: "tool_result";
71
- tool_use_id: string;
72
103
  content?: string | ({
73
- type: "text";
74
- text: string;
75
104
  cache_control?: {
76
- type: "ephemeral";
77
105
  ttl?: "1h" | "5m" | undefined;
106
+ type: "ephemeral";
78
107
  } | undefined;
108
+ text: string;
109
+ type: "text";
79
110
  } | {
80
- type: "image";
111
+ cache_control?: {
112
+ ttl?: "1h" | "5m" | undefined;
113
+ type: "ephemeral";
114
+ } | undefined;
81
115
  source: {
82
- type: "base64";
83
116
  data: string;
84
117
  media_type: string;
118
+ type: "base64";
85
119
  } | {
86
120
  type: "url";
87
121
  url: string;
88
122
  } | {
89
- type: "file";
90
123
  file_id: string;
124
+ type: "file";
91
125
  };
92
- cache_control?: {
93
- type: "ephemeral";
94
- ttl?: "1h" | "5m" | undefined;
95
- } | undefined;
126
+ type: "image";
96
127
  })[] | undefined;
97
128
  is_error?: boolean | undefined;
98
- cache_control?: {
99
- type: "ephemeral";
100
- ttl?: "1h" | "5m" | undefined;
101
- } | undefined;
129
+ tool_use_id: string;
130
+ type: "tool_result";
102
131
  } | {
103
132
  type: string;
104
133
  })[];
105
- }, {}>;
106
- export declare const systemMessageSchema: import("arktype/internal/variants/object.ts").ObjectType<{
107
- role: "system";
108
- content: string | {
109
- type: "text";
110
- text: string;
111
- cache_control?: {
112
- type: "ephemeral";
113
- ttl?: "1h" | "5m" | undefined;
114
- } | undefined;
115
- }[];
116
- }, {}>;
117
- export declare const assistantMessageSchema: import("arktype/internal/variants/object.ts").ObjectType<{
118
- role: "assistant";
134
+ role: "user";
135
+ }, {
119
136
  content: string | ({
120
- type: "text";
121
- text: string;
122
- cache_control?: {
123
- type: "ephemeral";
124
- ttl?: "1h" | "5m" | undefined;
125
- } | undefined;
126
- } | {
127
- type: string;
128
- } | {
129
- type: "thinking";
130
- thinking: string;
131
- signature?: string | undefined;
132
137
  cache_control?: {
133
- type: "ephemeral";
134
138
  ttl?: "1h" | "5m" | undefined;
135
- } | undefined;
136
- } | {
137
- type: "redacted_thinking";
138
- data: string;
139
- cache_control?: {
140
139
  type: "ephemeral";
141
- ttl?: "1h" | "5m" | undefined;
142
140
  } | undefined;
141
+ text: string;
142
+ type: "text";
143
143
  } | {
144
- type: "tool_use";
145
- id: string;
146
- name: string;
147
- input?: {
148
- [x: string]: unknown;
149
- } | undefined;
150
144
  cache_control?: {
151
- type: "ephemeral";
152
145
  ttl?: "1h" | "5m" | undefined;
153
- } | undefined;
154
- })[];
155
- }, {}>;
156
- export declare const messageSchema: import("arktype/internal/variants/object.ts").ObjectType<{
157
- role: "user";
158
- content: string | ({
159
- type: "text";
160
- text: string;
161
- cache_control?: {
162
146
  type: "ephemeral";
163
- ttl?: "1h" | "5m" | undefined;
164
147
  } | undefined;
165
- } | {
166
- type: "image";
167
148
  source: {
168
- type: "base64";
169
149
  data: string;
170
150
  media_type: string;
151
+ type: "base64";
171
152
  } | {
172
153
  type: "url";
173
154
  url: string;
174
155
  } | {
175
- type: "file";
176
156
  file_id: string;
157
+ type: "file";
177
158
  };
159
+ type: "image";
160
+ } | {
178
161
  cache_control?: {
179
- type: "ephemeral";
180
162
  ttl?: "1h" | "5m" | undefined;
163
+ type: "ephemeral";
181
164
  } | undefined;
182
- } | {
183
- type: "tool_result";
184
- tool_use_id: string;
185
165
  content?: string | ({
186
- type: "text";
187
- text: string;
188
166
  cache_control?: {
189
- type: "ephemeral";
190
167
  ttl?: "1h" | "5m" | undefined;
168
+ type: "ephemeral";
191
169
  } | undefined;
170
+ text: string;
171
+ type: "text";
192
172
  } | {
193
- type: "image";
173
+ cache_control?: {
174
+ ttl?: "1h" | "5m" | undefined;
175
+ type: "ephemeral";
176
+ } | undefined;
194
177
  source: {
195
- type: "base64";
196
178
  data: string;
197
179
  media_type: string;
180
+ type: "base64";
198
181
  } | {
199
182
  type: "url";
200
183
  url: string;
201
184
  } | {
202
- type: "file";
203
185
  file_id: string;
186
+ type: "file";
204
187
  };
205
- cache_control?: {
206
- type: "ephemeral";
207
- ttl?: "1h" | "5m" | undefined;
208
- } | undefined;
188
+ type: "image";
209
189
  })[] | undefined;
210
190
  is_error?: boolean | undefined;
211
- cache_control?: {
212
- type: "ephemeral";
213
- ttl?: "1h" | "5m" | undefined;
214
- } | undefined;
191
+ tool_use_id: string;
192
+ type: "tool_result";
215
193
  } | {
216
194
  type: string;
217
195
  })[];
218
- } | {
219
- role: "system";
196
+ role: "user";
197
+ }>;
198
+ export declare const systemMessageSchema: import("@oh-my-pi/omptype").FluentType<{
220
199
  content: string | {
221
- type: "text";
222
- text: string;
223
200
  cache_control?: {
201
+ ttl?: "1h" | "5m" | undefined;
224
202
  type: "ephemeral";
203
+ } | undefined;
204
+ text: string;
205
+ type: "text";
206
+ }[];
207
+ role: "system";
208
+ }, {
209
+ content: string | {
210
+ cache_control?: {
225
211
  ttl?: "1h" | "5m" | undefined;
212
+ type: "ephemeral";
226
213
  } | undefined;
214
+ text: string;
215
+ type: "text";
227
216
  }[];
228
- } | {
229
- role: "assistant";
217
+ role: "system";
218
+ }>;
219
+ export declare const assistantMessageSchema: import("@oh-my-pi/omptype").FluentType<{
230
220
  content: string | ({
231
- type: "text";
232
- text: string;
233
221
  cache_control?: {
222
+ ttl?: "1h" | "5m" | undefined;
234
223
  type: "ephemeral";
224
+ } | undefined;
225
+ text: string;
226
+ type: "text";
227
+ } | {
228
+ cache_control?: {
235
229
  ttl?: "1h" | "5m" | undefined;
230
+ type: "ephemeral";
236
231
  } | undefined;
232
+ signature?: string | undefined;
233
+ thinking: string;
234
+ type: "thinking";
237
235
  } | {
238
- type: string;
236
+ cache_control?: {
237
+ ttl?: "1h" | "5m" | undefined;
238
+ type: "ephemeral";
239
+ } | undefined;
240
+ data: string;
241
+ type: "redacted_thinking";
239
242
  } | {
240
- type: "thinking";
241
- thinking: string;
242
- signature?: string | undefined;
243
243
  cache_control?: {
244
+ ttl?: "1h" | "5m" | undefined;
244
245
  type: "ephemeral";
246
+ } | undefined;
247
+ id: string;
248
+ input?: Record<string, unknown> | undefined;
249
+ name: string;
250
+ type: "tool_use";
251
+ } | {
252
+ type: string;
253
+ })[];
254
+ role: "assistant";
255
+ }, {
256
+ content: string | ({
257
+ cache_control?: {
245
258
  ttl?: "1h" | "5m" | undefined;
259
+ type: "ephemeral";
246
260
  } | undefined;
261
+ text: string;
262
+ type: "text";
247
263
  } | {
248
- type: "redacted_thinking";
249
- data: string;
250
264
  cache_control?: {
265
+ ttl?: "1h" | "5m" | undefined;
251
266
  type: "ephemeral";
267
+ } | undefined;
268
+ signature?: string | undefined;
269
+ thinking: string;
270
+ type: "thinking";
271
+ } | {
272
+ cache_control?: {
252
273
  ttl?: "1h" | "5m" | undefined;
274
+ type: "ephemeral";
253
275
  } | undefined;
276
+ data: string;
277
+ type: "redacted_thinking";
254
278
  } | {
255
- type: "tool_use";
279
+ cache_control?: {
280
+ ttl?: "1h" | "5m" | undefined;
281
+ type: "ephemeral";
282
+ } | undefined;
256
283
  id: string;
284
+ input?: Record<string, unknown> | undefined;
257
285
  name: string;
258
- input?: {
259
- [x: string]: unknown;
260
- } | undefined;
286
+ type: "tool_use";
287
+ } | {
288
+ type: string;
289
+ })[];
290
+ role: "assistant";
291
+ }>;
292
+ export declare const messageSchema: import("@oh-my-pi/omptype").FluentType<{
293
+ content: string | ({
261
294
  cache_control?: {
295
+ ttl?: "1h" | "5m" | undefined;
262
296
  type: "ephemeral";
297
+ } | undefined;
298
+ text: string;
299
+ type: "text";
300
+ } | {
301
+ cache_control?: {
263
302
  ttl?: "1h" | "5m" | undefined;
303
+ type: "ephemeral";
264
304
  } | undefined;
265
- })[];
266
- }, {}>;
267
- export declare const toolSchema: import("arktype/internal/variants/object.ts").ObjectType<{
268
- name: string;
269
- description?: string | undefined;
270
- input_schema: {
271
- [x: string]: unknown;
272
- };
273
- cache_control?: {
274
- type: "ephemeral";
275
- ttl?: "1h" | "5m" | undefined;
276
- } | undefined;
277
- }, {}>;
278
- export declare const toolChoiceSchema: import("arktype/internal/variants/object.ts").ObjectType<{
305
+ source: {
306
+ data: string;
307
+ media_type: string;
308
+ type: "base64";
309
+ } | {
310
+ type: "url";
311
+ url: string;
312
+ } | {
313
+ file_id: string;
314
+ type: "file";
315
+ };
316
+ type: "image";
317
+ } | {
318
+ cache_control?: {
319
+ ttl?: "1h" | "5m" | undefined;
320
+ type: "ephemeral";
321
+ } | undefined;
322
+ content?: string | ({
323
+ cache_control?: {
324
+ ttl?: "1h" | "5m" | undefined;
325
+ type: "ephemeral";
326
+ } | undefined;
327
+ text: string;
328
+ type: "text";
329
+ } | {
330
+ cache_control?: {
331
+ ttl?: "1h" | "5m" | undefined;
332
+ type: "ephemeral";
333
+ } | undefined;
334
+ source: {
335
+ data: string;
336
+ media_type: string;
337
+ type: "base64";
338
+ } | {
339
+ type: "url";
340
+ url: string;
341
+ } | {
342
+ file_id: string;
343
+ type: "file";
344
+ };
345
+ type: "image";
346
+ })[] | undefined;
347
+ is_error?: boolean | undefined;
348
+ tool_use_id: string;
349
+ type: "tool_result";
350
+ } | {
351
+ type: string;
352
+ })[];
353
+ role: "user";
354
+ } | {
355
+ content: string | {
356
+ cache_control?: {
357
+ ttl?: "1h" | "5m" | undefined;
358
+ type: "ephemeral";
359
+ } | undefined;
360
+ text: string;
361
+ type: "text";
362
+ }[];
363
+ role: "system";
364
+ } | {
365
+ content: string | ({
366
+ cache_control?: {
367
+ ttl?: "1h" | "5m" | undefined;
368
+ type: "ephemeral";
369
+ } | undefined;
370
+ text: string;
371
+ type: "text";
372
+ } | {
373
+ cache_control?: {
374
+ ttl?: "1h" | "5m" | undefined;
375
+ type: "ephemeral";
376
+ } | undefined;
377
+ signature?: string | undefined;
378
+ thinking: string;
379
+ type: "thinking";
380
+ } | {
381
+ cache_control?: {
382
+ ttl?: "1h" | "5m" | undefined;
383
+ type: "ephemeral";
384
+ } | undefined;
385
+ data: string;
386
+ type: "redacted_thinking";
387
+ } | {
388
+ cache_control?: {
389
+ ttl?: "1h" | "5m" | undefined;
390
+ type: "ephemeral";
391
+ } | undefined;
392
+ id: string;
393
+ input?: Record<string, unknown> | undefined;
394
+ name: string;
395
+ type: "tool_use";
396
+ } | {
397
+ type: string;
398
+ })[];
399
+ role: "assistant";
400
+ }, {
401
+ content: string | ({
402
+ cache_control?: {
403
+ ttl?: "1h" | "5m" | undefined;
404
+ type: "ephemeral";
405
+ } | undefined;
406
+ text: string;
407
+ type: "text";
408
+ } | {
409
+ cache_control?: {
410
+ ttl?: "1h" | "5m" | undefined;
411
+ type: "ephemeral";
412
+ } | undefined;
413
+ source: {
414
+ data: string;
415
+ media_type: string;
416
+ type: "base64";
417
+ } | {
418
+ type: "url";
419
+ url: string;
420
+ } | {
421
+ file_id: string;
422
+ type: "file";
423
+ };
424
+ type: "image";
425
+ } | {
426
+ cache_control?: {
427
+ ttl?: "1h" | "5m" | undefined;
428
+ type: "ephemeral";
429
+ } | undefined;
430
+ content?: string | ({
431
+ cache_control?: {
432
+ ttl?: "1h" | "5m" | undefined;
433
+ type: "ephemeral";
434
+ } | undefined;
435
+ text: string;
436
+ type: "text";
437
+ } | {
438
+ cache_control?: {
439
+ ttl?: "1h" | "5m" | undefined;
440
+ type: "ephemeral";
441
+ } | undefined;
442
+ source: {
443
+ data: string;
444
+ media_type: string;
445
+ type: "base64";
446
+ } | {
447
+ type: "url";
448
+ url: string;
449
+ } | {
450
+ file_id: string;
451
+ type: "file";
452
+ };
453
+ type: "image";
454
+ })[] | undefined;
455
+ is_error?: boolean | undefined;
456
+ tool_use_id: string;
457
+ type: "tool_result";
458
+ } | {
459
+ type: string;
460
+ })[];
461
+ role: "user";
462
+ } | {
463
+ content: string | {
464
+ cache_control?: {
465
+ ttl?: "1h" | "5m" | undefined;
466
+ type: "ephemeral";
467
+ } | undefined;
468
+ text: string;
469
+ type: "text";
470
+ }[];
471
+ role: "system";
472
+ } | {
473
+ content: string | ({
474
+ cache_control?: {
475
+ ttl?: "1h" | "5m" | undefined;
476
+ type: "ephemeral";
477
+ } | undefined;
478
+ text: string;
479
+ type: "text";
480
+ } | {
481
+ cache_control?: {
482
+ ttl?: "1h" | "5m" | undefined;
483
+ type: "ephemeral";
484
+ } | undefined;
485
+ signature?: string | undefined;
486
+ thinking: string;
487
+ type: "thinking";
488
+ } | {
489
+ cache_control?: {
490
+ ttl?: "1h" | "5m" | undefined;
491
+ type: "ephemeral";
492
+ } | undefined;
493
+ data: string;
494
+ type: "redacted_thinking";
495
+ } | {
496
+ cache_control?: {
497
+ ttl?: "1h" | "5m" | undefined;
498
+ type: "ephemeral";
499
+ } | undefined;
500
+ id: string;
501
+ input?: Record<string, unknown> | undefined;
502
+ name: string;
503
+ type: "tool_use";
504
+ } | {
505
+ type: string;
506
+ })[];
507
+ role: "assistant";
508
+ }>;
509
+ export declare const toolSchema: import("@oh-my-pi/omptype").FluentType<{
510
+ cache_control?: {
511
+ ttl?: "1h" | "5m" | undefined;
512
+ type: "ephemeral";
513
+ } | undefined;
514
+ description?: string | undefined;
515
+ input_schema: Record<string, unknown>;
516
+ name: string;
517
+ }, {
518
+ cache_control?: {
519
+ ttl?: "1h" | "5m" | undefined;
520
+ type: "ephemeral";
521
+ } | undefined;
522
+ description?: string | undefined;
523
+ input_schema: Record<string, unknown>;
524
+ name: string;
525
+ }>;
526
+ export declare const toolChoiceSchema: import("@oh-my-pi/omptype").FluentType<{
527
+ disable_parallel_tool_use?: boolean | undefined;
528
+ type: "any";
529
+ } | {
530
+ disable_parallel_tool_use?: boolean | undefined;
531
+ type: "none";
532
+ } | {
533
+ disable_parallel_tool_use?: boolean | undefined;
534
+ name: string;
535
+ type: "tool";
536
+ } | {
537
+ disable_parallel_tool_use?: boolean | undefined;
279
538
  type: "auto";
539
+ }, {
280
540
  disable_parallel_tool_use?: boolean | undefined;
541
+ type: "auto";
281
542
  } | {
282
- type: "any";
283
543
  disable_parallel_tool_use?: boolean | undefined;
544
+ type: "any";
284
545
  } | {
285
- type: "none";
286
546
  disable_parallel_tool_use?: boolean | undefined;
547
+ type: "none";
287
548
  } | {
288
- type: "tool";
289
- name: string;
290
549
  disable_parallel_tool_use?: boolean | undefined;
291
- }, {}>;
292
- export declare const thinkingConfigSchema: import("arktype/internal/variants/object.ts").ObjectType<{
550
+ name: string;
551
+ type: "tool";
552
+ }>;
553
+ export declare const thinkingConfigSchema: import("@oh-my-pi/omptype").FluentType<{
554
+ display?: unknown;
555
+ type: "disabled";
556
+ } | {
557
+ budget_tokens?: number | undefined;
558
+ display?: unknown;
559
+ type: "adaptive";
560
+ } | {
561
+ budget_tokens: number;
562
+ display?: unknown;
293
563
  type: "enabled";
564
+ }, {
294
565
  budget_tokens: number;
295
566
  display?: unknown;
567
+ type: "enabled";
296
568
  } | {
297
- type: "disabled";
298
569
  display?: unknown;
570
+ type: "disabled";
299
571
  } | {
300
- type: "adaptive";
301
572
  budget_tokens?: number | undefined;
302
573
  display?: unknown;
303
- }, {}>;
304
- export declare const anthropicMessagesRequestSchema: import("arktype/internal/variants/object.ts").ObjectType<{
574
+ type: "adaptive";
575
+ }>;
576
+ export declare const anthropicMessagesRequestSchema: import("@oh-my-pi/omptype").FluentType<{
577
+ container?: unknown;
578
+ context_management?: unknown;
579
+ max_tokens: number;
580
+ mcp_servers?: unknown;
581
+ messages: ({
582
+ content: string | ({
583
+ cache_control?: {
584
+ ttl?: "1h" | "5m" | undefined;
585
+ type: "ephemeral";
586
+ } | undefined;
587
+ text: string;
588
+ type: "text";
589
+ } | {
590
+ cache_control?: {
591
+ ttl?: "1h" | "5m" | undefined;
592
+ type: "ephemeral";
593
+ } | undefined;
594
+ source: {
595
+ data: string;
596
+ media_type: string;
597
+ type: "base64";
598
+ } | {
599
+ type: "url";
600
+ url: string;
601
+ } | {
602
+ file_id: string;
603
+ type: "file";
604
+ };
605
+ type: "image";
606
+ } | {
607
+ cache_control?: {
608
+ ttl?: "1h" | "5m" | undefined;
609
+ type: "ephemeral";
610
+ } | undefined;
611
+ content?: string | ({
612
+ cache_control?: {
613
+ ttl?: "1h" | "5m" | undefined;
614
+ type: "ephemeral";
615
+ } | undefined;
616
+ text: string;
617
+ type: "text";
618
+ } | {
619
+ cache_control?: {
620
+ ttl?: "1h" | "5m" | undefined;
621
+ type: "ephemeral";
622
+ } | undefined;
623
+ source: {
624
+ data: string;
625
+ media_type: string;
626
+ type: "base64";
627
+ } | {
628
+ type: "url";
629
+ url: string;
630
+ } | {
631
+ file_id: string;
632
+ type: "file";
633
+ };
634
+ type: "image";
635
+ })[] | undefined;
636
+ is_error?: boolean | undefined;
637
+ tool_use_id: string;
638
+ type: "tool_result";
639
+ } | {
640
+ type: string;
641
+ })[];
642
+ role: "user";
643
+ } | {
644
+ content: string | {
645
+ cache_control?: {
646
+ ttl?: "1h" | "5m" | undefined;
647
+ type: "ephemeral";
648
+ } | undefined;
649
+ text: string;
650
+ type: "text";
651
+ }[];
652
+ role: "system";
653
+ } | {
654
+ content: string | ({
655
+ cache_control?: {
656
+ ttl?: "1h" | "5m" | undefined;
657
+ type: "ephemeral";
658
+ } | undefined;
659
+ text: string;
660
+ type: "text";
661
+ } | {
662
+ cache_control?: {
663
+ ttl?: "1h" | "5m" | undefined;
664
+ type: "ephemeral";
665
+ } | undefined;
666
+ signature?: string | undefined;
667
+ thinking: string;
668
+ type: "thinking";
669
+ } | {
670
+ cache_control?: {
671
+ ttl?: "1h" | "5m" | undefined;
672
+ type: "ephemeral";
673
+ } | undefined;
674
+ data: string;
675
+ type: "redacted_thinking";
676
+ } | {
677
+ cache_control?: {
678
+ ttl?: "1h" | "5m" | undefined;
679
+ type: "ephemeral";
680
+ } | undefined;
681
+ id: string;
682
+ input?: Record<string, unknown> | undefined;
683
+ name: string;
684
+ type: "tool_use";
685
+ } | {
686
+ type: string;
687
+ })[];
688
+ role: "assistant";
689
+ })[];
690
+ metadata?: Record<string, unknown> | undefined;
305
691
  model: string;
692
+ output_config?: {
693
+ effort?: "high" | "low" | "max" | "medium" | "xhigh" | undefined;
694
+ format?: unknown;
695
+ task_budget?: {
696
+ remaining?: number | undefined;
697
+ total: number;
698
+ type: "tokens";
699
+ } | undefined;
700
+ } | undefined;
701
+ service_tier?: unknown;
702
+ stop_sequences?: string[] | undefined;
703
+ stream?: boolean | undefined;
704
+ system?: string | {
705
+ cache_control?: {
706
+ ttl?: "1h" | "5m" | undefined;
707
+ type: "ephemeral";
708
+ } | undefined;
709
+ text: string;
710
+ type: "text";
711
+ }[] | undefined;
712
+ temperature?: number | undefined;
713
+ thinking?: {
714
+ display?: unknown;
715
+ type: "disabled";
716
+ } | {
717
+ budget_tokens?: number | undefined;
718
+ display?: unknown;
719
+ type: "adaptive";
720
+ } | {
721
+ budget_tokens: number;
722
+ display?: unknown;
723
+ type: "enabled";
724
+ } | undefined;
725
+ tool_choice?: {
726
+ disable_parallel_tool_use?: boolean | undefined;
727
+ type: "any";
728
+ } | {
729
+ disable_parallel_tool_use?: boolean | undefined;
730
+ type: "none";
731
+ } | {
732
+ disable_parallel_tool_use?: boolean | undefined;
733
+ name: string;
734
+ type: "tool";
735
+ } | {
736
+ disable_parallel_tool_use?: boolean | undefined;
737
+ type: "auto";
738
+ } | undefined;
739
+ tools?: {
740
+ cache_control?: {
741
+ ttl?: "1h" | "5m" | undefined;
742
+ type: "ephemeral";
743
+ } | undefined;
744
+ description?: string | undefined;
745
+ input_schema: Record<string, unknown>;
746
+ name: string;
747
+ }[] | undefined;
748
+ top_k?: number | undefined;
749
+ top_p?: number | undefined;
750
+ }, {
751
+ container?: unknown;
752
+ context_management?: unknown;
753
+ max_tokens: number;
754
+ mcp_servers?: unknown;
306
755
  messages: ({
307
- role: "user";
308
756
  content: string | ({
309
- type: "text";
310
- text: string;
311
757
  cache_control?: {
312
- type: "ephemeral";
313
758
  ttl?: "1h" | "5m" | undefined;
759
+ type: "ephemeral";
314
760
  } | undefined;
761
+ text: string;
762
+ type: "text";
315
763
  } | {
316
- type: "image";
764
+ cache_control?: {
765
+ ttl?: "1h" | "5m" | undefined;
766
+ type: "ephemeral";
767
+ } | undefined;
317
768
  source: {
318
- type: "base64";
319
769
  data: string;
320
770
  media_type: string;
771
+ type: "base64";
321
772
  } | {
322
773
  type: "url";
323
774
  url: string;
324
775
  } | {
325
- type: "file";
326
776
  file_id: string;
777
+ type: "file";
327
778
  };
779
+ type: "image";
780
+ } | {
328
781
  cache_control?: {
329
- type: "ephemeral";
330
782
  ttl?: "1h" | "5m" | undefined;
783
+ type: "ephemeral";
331
784
  } | undefined;
332
- } | {
333
- type: "tool_result";
334
- tool_use_id: string;
335
785
  content?: string | ({
336
- type: "text";
337
- text: string;
338
786
  cache_control?: {
339
- type: "ephemeral";
340
787
  ttl?: "1h" | "5m" | undefined;
788
+ type: "ephemeral";
341
789
  } | undefined;
790
+ text: string;
791
+ type: "text";
342
792
  } | {
343
- type: "image";
793
+ cache_control?: {
794
+ ttl?: "1h" | "5m" | undefined;
795
+ type: "ephemeral";
796
+ } | undefined;
344
797
  source: {
345
- type: "base64";
346
798
  data: string;
347
799
  media_type: string;
800
+ type: "base64";
348
801
  } | {
349
802
  type: "url";
350
803
  url: string;
351
804
  } | {
352
- type: "file";
353
805
  file_id: string;
806
+ type: "file";
354
807
  };
355
- cache_control?: {
356
- type: "ephemeral";
357
- ttl?: "1h" | "5m" | undefined;
358
- } | undefined;
808
+ type: "image";
359
809
  })[] | undefined;
360
810
  is_error?: boolean | undefined;
361
- cache_control?: {
362
- type: "ephemeral";
363
- ttl?: "1h" | "5m" | undefined;
364
- } | undefined;
811
+ tool_use_id: string;
812
+ type: "tool_result";
365
813
  } | {
366
814
  type: string;
367
815
  })[];
816
+ role: "user";
368
817
  } | {
369
- role: "system";
370
818
  content: string | {
371
- type: "text";
372
- text: string;
373
819
  cache_control?: {
374
- type: "ephemeral";
375
820
  ttl?: "1h" | "5m" | undefined;
821
+ type: "ephemeral";
376
822
  } | undefined;
823
+ text: string;
824
+ type: "text";
377
825
  }[];
826
+ role: "system";
378
827
  } | {
379
- role: "assistant";
380
828
  content: string | ({
381
- type: "text";
382
- text: string;
383
829
  cache_control?: {
384
- type: "ephemeral";
385
830
  ttl?: "1h" | "5m" | undefined;
831
+ type: "ephemeral";
386
832
  } | undefined;
833
+ text: string;
834
+ type: "text";
387
835
  } | {
388
- type: string;
389
- } | {
390
- type: "thinking";
391
- thinking: string;
392
- signature?: string | undefined;
393
836
  cache_control?: {
394
- type: "ephemeral";
395
837
  ttl?: "1h" | "5m" | undefined;
838
+ type: "ephemeral";
396
839
  } | undefined;
840
+ signature?: string | undefined;
841
+ thinking: string;
842
+ type: "thinking";
397
843
  } | {
398
- type: "redacted_thinking";
399
- data: string;
400
844
  cache_control?: {
401
- type: "ephemeral";
402
845
  ttl?: "1h" | "5m" | undefined;
846
+ type: "ephemeral";
403
847
  } | undefined;
848
+ data: string;
849
+ type: "redacted_thinking";
404
850
  } | {
405
- type: "tool_use";
406
- id: string;
407
- name: string;
408
- input?: {
409
- [x: string]: unknown;
410
- } | undefined;
411
851
  cache_control?: {
412
- type: "ephemeral";
413
852
  ttl?: "1h" | "5m" | undefined;
853
+ type: "ephemeral";
414
854
  } | undefined;
855
+ id: string;
856
+ input?: Record<string, unknown> | undefined;
857
+ name: string;
858
+ type: "tool_use";
859
+ } | {
860
+ type: string;
415
861
  })[];
862
+ role: "assistant";
416
863
  })[];
417
- max_tokens: number;
864
+ metadata?: Record<string, unknown> | undefined;
865
+ model: string;
866
+ output_config?: {
867
+ effort?: "high" | "low" | "max" | "medium" | "xhigh" | undefined;
868
+ format?: unknown;
869
+ task_budget?: {
870
+ remaining?: number | undefined;
871
+ total: number;
872
+ type: "tokens";
873
+ } | undefined;
874
+ } | undefined;
875
+ service_tier?: unknown;
876
+ stop_sequences?: string[] | undefined;
877
+ stream?: boolean | undefined;
418
878
  system?: string | {
419
- type: "text";
420
- text: string;
421
879
  cache_control?: {
422
- type: "ephemeral";
423
880
  ttl?: "1h" | "5m" | undefined;
424
- } | undefined;
425
- }[] | undefined;
426
- tools?: {
427
- name: string;
428
- description?: string | undefined;
429
- input_schema: {
430
- [x: string]: unknown;
431
- };
432
- cache_control?: {
433
881
  type: "ephemeral";
434
- ttl?: "1h" | "5m" | undefined;
435
882
  } | undefined;
883
+ text: string;
884
+ type: "text";
436
885
  }[] | undefined;
437
- tool_choice?: {
438
- type: "auto";
439
- disable_parallel_tool_use?: boolean | undefined;
440
- } | {
441
- type: "any";
442
- disable_parallel_tool_use?: boolean | undefined;
443
- } | {
444
- type: "none";
445
- disable_parallel_tool_use?: boolean | undefined;
446
- } | {
447
- type: "tool";
448
- name: string;
449
- disable_parallel_tool_use?: boolean | undefined;
450
- } | undefined;
451
886
  temperature?: number | undefined;
452
- top_p?: number | undefined;
453
- top_k?: number | undefined;
454
- stop_sequences?: string[] | undefined;
455
- stream?: boolean | undefined;
456
887
  thinking?: {
457
- type: "enabled";
458
888
  budget_tokens: number;
459
889
  display?: unknown;
890
+ type: "enabled";
460
891
  } | {
461
- type: "disabled";
462
892
  display?: unknown;
893
+ type: "disabled";
463
894
  } | {
464
- type: "adaptive";
465
895
  budget_tokens?: number | undefined;
466
896
  display?: unknown;
897
+ type: "adaptive";
467
898
  } | undefined;
468
- output_config?: {
469
- effort?: "high" | "low" | "max" | "medium" | "xhigh" | undefined;
470
- task_budget?: {
471
- type: "tokens";
472
- total: number;
473
- remaining?: number | undefined;
474
- } | undefined;
475
- format?: unknown;
476
- } | undefined;
477
- metadata?: {
478
- [x: string]: unknown;
899
+ tool_choice?: {
900
+ disable_parallel_tool_use?: boolean | undefined;
901
+ type: "auto";
902
+ } | {
903
+ disable_parallel_tool_use?: boolean | undefined;
904
+ type: "any";
905
+ } | {
906
+ disable_parallel_tool_use?: boolean | undefined;
907
+ type: "none";
908
+ } | {
909
+ disable_parallel_tool_use?: boolean | undefined;
910
+ name: string;
911
+ type: "tool";
479
912
  } | undefined;
480
- container?: unknown;
481
- context_management?: unknown;
482
- mcp_servers?: unknown;
483
- service_tier?: unknown;
484
- }, {}>;
913
+ tools?: {
914
+ cache_control?: {
915
+ ttl?: "1h" | "5m" | undefined;
916
+ type: "ephemeral";
917
+ } | undefined;
918
+ description?: string | undefined;
919
+ input_schema: Record<string, unknown>;
920
+ name: string;
921
+ }[] | undefined;
922
+ top_k?: number | undefined;
923
+ top_p?: number | undefined;
924
+ }>;
485
925
  /**
486
926
  * Public types are sourced from the upstream Anthropic SDK so the gateway
487
927
  * stays in lock-step with the canonical API surface; the schemas above are