@tormentalabs/claude-code-wire-compat 0.1.0-rc.10

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 (85) hide show
  1. package/CHANGELOG.md +312 -0
  2. package/LICENSE +674 -0
  3. package/NOTICE +16 -0
  4. package/README.md +39 -0
  5. package/dist/anti-verbosity.d.ts +58 -0
  6. package/dist/anti-verbosity.d.ts.map +1 -0
  7. package/dist/anti-verbosity.js +174 -0
  8. package/dist/anti-verbosity.js.map +1 -0
  9. package/dist/beta-registry.d.ts +119 -0
  10. package/dist/beta-registry.d.ts.map +1 -0
  11. package/dist/beta-registry.js +125 -0
  12. package/dist/beta-registry.js.map +1 -0
  13. package/dist/betas.d.ts +11 -0
  14. package/dist/betas.d.ts.map +1 -0
  15. package/dist/betas.js +68 -0
  16. package/dist/betas.js.map +1 -0
  17. package/dist/build-request.d.ts +24 -0
  18. package/dist/build-request.d.ts.map +1 -0
  19. package/dist/build-request.js +1008 -0
  20. package/dist/build-request.js.map +1 -0
  21. package/dist/contracts.d.ts +717 -0
  22. package/dist/contracts.d.ts.map +1 -0
  23. package/dist/contracts.js +36 -0
  24. package/dist/contracts.js.map +1 -0
  25. package/dist/count-tokens.d.ts +42 -0
  26. package/dist/count-tokens.d.ts.map +1 -0
  27. package/dist/count-tokens.js +61 -0
  28. package/dist/count-tokens.js.map +1 -0
  29. package/dist/fingerprint.d.ts +4 -0
  30. package/dist/fingerprint.d.ts.map +1 -0
  31. package/dist/fingerprint.js +59 -0
  32. package/dist/fingerprint.js.map +1 -0
  33. package/dist/headers.d.ts +4 -0
  34. package/dist/headers.d.ts.map +1 -0
  35. package/dist/headers.js +255 -0
  36. package/dist/headers.js.map +1 -0
  37. package/dist/index.d.ts +17 -0
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.js +6 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/metadata.d.ts +4 -0
  42. package/dist/metadata.d.ts.map +1 -0
  43. package/dist/metadata.js +192 -0
  44. package/dist/metadata.js.map +1 -0
  45. package/dist/model-capabilities.d.ts +103 -0
  46. package/dist/model-capabilities.d.ts.map +1 -0
  47. package/dist/model-capabilities.js +263 -0
  48. package/dist/model-capabilities.js.map +1 -0
  49. package/dist/model-identity.d.ts +11 -0
  50. package/dist/model-identity.d.ts.map +1 -0
  51. package/dist/model-identity.js +64 -0
  52. package/dist/model-identity.js.map +1 -0
  53. package/dist/models.d.ts +9 -0
  54. package/dist/models.d.ts.map +1 -0
  55. package/dist/models.js +25 -0
  56. package/dist/models.js.map +1 -0
  57. package/dist/profiles/claude-code-2.1.195.d.ts +3 -0
  58. package/dist/profiles/claude-code-2.1.195.d.ts.map +1 -0
  59. package/dist/profiles/claude-code-2.1.195.js +150 -0
  60. package/dist/profiles/claude-code-2.1.195.js.map +1 -0
  61. package/dist/redaction.d.ts +16 -0
  62. package/dist/redaction.d.ts.map +1 -0
  63. package/dist/redaction.js +364 -0
  64. package/dist/redaction.js.map +1 -0
  65. package/dist/request-body.d.ts +19 -0
  66. package/dist/request-body.d.ts.map +1 -0
  67. package/dist/request-body.js +1658 -0
  68. package/dist/request-body.js.map +1 -0
  69. package/dist/sha256.d.ts +9 -0
  70. package/dist/sha256.d.ts.map +1 -0
  71. package/dist/sha256.js +104 -0
  72. package/dist/sha256.js.map +1 -0
  73. package/dist/system-prompt.d.ts +4 -0
  74. package/dist/system-prompt.d.ts.map +1 -0
  75. package/dist/system-prompt.js +157 -0
  76. package/dist/system-prompt.js.map +1 -0
  77. package/dist/thinking.d.ts +91 -0
  78. package/dist/thinking.d.ts.map +1 -0
  79. package/dist/thinking.js +132 -0
  80. package/dist/thinking.js.map +1 -0
  81. package/dist/unicode.d.ts +10 -0
  82. package/dist/unicode.d.ts.map +1 -0
  83. package/dist/unicode.js +19 -0
  84. package/dist/unicode.js.map +1 -0
  85. package/package.json +72 -0
@@ -0,0 +1,717 @@
1
+ import type { ThinkingDisplay } from "./thinking.js";
2
+ export type { ThinkingDisplay } from "./thinking.js";
3
+ /** Model families used only in redacted evidence, never on the wire. */
4
+ export type ClaudeCodeModelFamily = "haiku" | "sonnet" | "opus" | "fable" | "mythos" | "unknown";
5
+ export type ClaudeCodeEffort = "low" | "medium" | "high" | "xhigh" | "max";
6
+ /** Identifies which branch of the client's anti-verbosity selector applies. */
7
+ export type AntiVerbositySection = "communicating-with-the-user" | "lean" | "text-output";
8
+ /**
9
+ * Host state the package cannot observe, mirrored from the upstream gates so a
10
+ * caller that does know it can reproduce the client exactly.
11
+ */
12
+ export interface AntiVerbosityPolicy {
13
+ /** Upstream `oqo.isBriefEnabled()`. */
14
+ readonly briefModeEnabled: boolean;
15
+ /** Upstream `Jxe()`, the pewter-owl tool flag. */
16
+ readonly pewterOwlToolEnabled: boolean;
17
+ }
18
+ export interface ClaudeCodeCatalogueEntry {
19
+ readonly family: ClaudeCodeModelFamily;
20
+ readonly context?: Readonly<{
21
+ readonly window: number;
22
+ readonly native1m?: boolean;
23
+ readonly supports1mBeta?: boolean;
24
+ }>;
25
+ /** Verbatim upstream capability keys; compared by the ported predicates. */
26
+ readonly capabilities: readonly string[];
27
+ readonly defaultEffort?: ClaudeCodeEffort;
28
+ }
29
+ export type HeaderPair = readonly [name: string, value: string];
30
+ export type JsonPrimitive = string | number | boolean | null;
31
+ export type JsonValue = JsonPrimitive | readonly JsonValue[] | {
32
+ readonly [key: string]: JsonValue;
33
+ };
34
+ export interface CacheControlEphemeral {
35
+ readonly type: "ephemeral";
36
+ readonly ttl?: "5m" | "1h";
37
+ }
38
+ /** Pre-RC3 package compatibility extension; SDK-derived block types do not use it. */
39
+ export interface TextBlockCacheControl extends CacheControlEphemeral {
40
+ readonly scope?: "global";
41
+ }
42
+ export interface CitationsConfigParam {
43
+ readonly enabled?: boolean;
44
+ }
45
+ export interface CitationCharLocationParam {
46
+ readonly cited_text: string;
47
+ readonly document_index: number;
48
+ readonly document_title: string | null;
49
+ readonly end_char_index: number;
50
+ readonly start_char_index: number;
51
+ readonly type: "char_location";
52
+ }
53
+ export interface CitationContentBlockLocationParam {
54
+ readonly cited_text: string;
55
+ readonly document_index: number;
56
+ readonly document_title: string | null;
57
+ readonly end_block_index: number;
58
+ readonly start_block_index: number;
59
+ readonly type: "content_block_location";
60
+ }
61
+ export interface CitationPageLocationParam {
62
+ readonly cited_text: string;
63
+ readonly document_index: number;
64
+ readonly document_title: string | null;
65
+ readonly end_page_number: number;
66
+ readonly start_page_number: number;
67
+ readonly type: "page_location";
68
+ }
69
+ export interface CitationSearchResultLocationParam {
70
+ readonly cited_text: string;
71
+ readonly end_block_index: number;
72
+ readonly search_result_index: number;
73
+ readonly source: string;
74
+ readonly start_block_index: number;
75
+ readonly title: string | null;
76
+ readonly type: "search_result_location";
77
+ }
78
+ export interface CitationWebSearchResultLocationParam {
79
+ readonly cited_text: string;
80
+ readonly encrypted_index: string;
81
+ readonly title: string | null;
82
+ readonly type: "web_search_result_location";
83
+ readonly url: string;
84
+ }
85
+ export type TextCitationParam = CitationCharLocationParam | CitationPageLocationParam | CitationContentBlockLocationParam | CitationWebSearchResultLocationParam | CitationSearchResultLocationParam;
86
+ export interface TextBlock {
87
+ readonly text: string;
88
+ readonly type: "text";
89
+ readonly cache_control?: TextBlockCacheControl | null;
90
+ readonly citations?: readonly TextCitationParam[] | null;
91
+ }
92
+ export interface Base64ImageSource {
93
+ readonly data: string;
94
+ readonly media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
95
+ readonly type: "base64";
96
+ }
97
+ export interface FileImageSource {
98
+ readonly file_id: string;
99
+ readonly type: "file";
100
+ }
101
+ export interface URLImageSource {
102
+ readonly type: "url";
103
+ readonly url: string;
104
+ }
105
+ export interface ImageBlock {
106
+ readonly source: Base64ImageSource | URLImageSource | FileImageSource;
107
+ readonly type: "image";
108
+ readonly cache_control?: CacheControlEphemeral | null;
109
+ }
110
+ export interface Base64PDFSource {
111
+ readonly data: string;
112
+ readonly media_type: "application/pdf";
113
+ readonly type: "base64";
114
+ }
115
+ export interface ContentBlockSource {
116
+ readonly content: string | readonly (TextBlock | ImageBlock)[];
117
+ readonly type: "content";
118
+ }
119
+ export interface FileDocumentSource {
120
+ readonly file_id: string;
121
+ readonly type: "file";
122
+ }
123
+ export interface PlainTextSource {
124
+ readonly data: string;
125
+ readonly media_type: "text/plain";
126
+ readonly type: "text";
127
+ }
128
+ export interface URLPDFSource {
129
+ readonly type: "url";
130
+ readonly url: string;
131
+ }
132
+ export interface DocumentBlock {
133
+ readonly source: Base64PDFSource | PlainTextSource | ContentBlockSource | URLPDFSource | FileDocumentSource;
134
+ readonly type: "document";
135
+ readonly cache_control?: CacheControlEphemeral | null;
136
+ readonly citations?: CitationsConfigParam | null;
137
+ readonly context?: string | null;
138
+ readonly title?: string | null;
139
+ }
140
+ export interface ThinkingBlock {
141
+ readonly signature: string;
142
+ readonly thinking: string;
143
+ readonly type: "thinking";
144
+ }
145
+ export interface RedactedThinkingBlock {
146
+ readonly data: string;
147
+ readonly type: "redacted_thinking";
148
+ }
149
+ export interface SearchResultBlock {
150
+ readonly content: readonly TextBlock[];
151
+ readonly source: string;
152
+ readonly title: string;
153
+ readonly type: "search_result";
154
+ readonly cache_control?: CacheControlEphemeral | null;
155
+ readonly citations?: CitationsConfigParam;
156
+ }
157
+ export interface ToolReferenceBlock {
158
+ readonly tool_name: string;
159
+ readonly type: "tool_reference";
160
+ readonly cache_control?: CacheControlEphemeral | null;
161
+ }
162
+ export interface DirectCaller {
163
+ readonly type: "direct";
164
+ }
165
+ export interface ServerToolCaller {
166
+ readonly tool_id: string;
167
+ readonly type: "code_execution_20250825";
168
+ }
169
+ export interface ServerToolCaller20260120 {
170
+ readonly tool_id: string;
171
+ readonly type: "code_execution_20260120";
172
+ }
173
+ export interface ToolUseBlock {
174
+ readonly id: string;
175
+ readonly input: JsonValue;
176
+ readonly name: string;
177
+ readonly type: "tool_use";
178
+ readonly cache_control?: CacheControlEphemeral | null;
179
+ readonly caller?: DirectCaller | ServerToolCaller | ServerToolCaller20260120;
180
+ }
181
+ export type ToolResultContentBlock = TextBlock | ImageBlock | SearchResultBlock | DocumentBlock | ToolReferenceBlock;
182
+ export interface ToolResultBlock {
183
+ readonly tool_use_id: string;
184
+ readonly type: "tool_result";
185
+ readonly cache_control?: CacheControlEphemeral | null;
186
+ readonly content?: string | readonly ToolResultContentBlock[];
187
+ readonly is_error?: boolean;
188
+ }
189
+ export type MessageContentBlock = TextBlock | ImageBlock | DocumentBlock | SearchResultBlock | ThinkingBlock | RedactedThinkingBlock | ToolUseBlock | ToolResultBlock;
190
+ export type MessageContent = string | readonly MessageContentBlock[];
191
+ export interface Message {
192
+ readonly role: "user" | "assistant";
193
+ readonly content: MessageContent;
194
+ }
195
+ export type SystemInput = string | TextBlock;
196
+ export interface ToolInputSchema {
197
+ readonly type: "object";
198
+ readonly properties?: JsonValue | null;
199
+ readonly required?: readonly string[] | null;
200
+ readonly [key: string]: JsonValue | undefined;
201
+ }
202
+ export type ToolAllowedCaller = "direct" | "code_execution_20250825" | "code_execution_20260120";
203
+ export type ToolInputExample = Readonly<Record<string, JsonValue>>;
204
+ export interface CustomToolDefinition {
205
+ readonly input_schema: ToolInputSchema;
206
+ readonly name: string;
207
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
208
+ readonly cache_control?: CacheControlEphemeral | null;
209
+ readonly defer_loading?: boolean;
210
+ readonly description?: string;
211
+ readonly eager_input_streaming?: boolean | null;
212
+ readonly input_examples?: readonly ToolInputExample[];
213
+ readonly strict?: boolean;
214
+ readonly type?: never;
215
+ }
216
+ export interface ToolBash20241022 {
217
+ readonly name: "bash";
218
+ readonly type: "bash_20241022";
219
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
220
+ readonly cache_control?: CacheControlEphemeral | null;
221
+ readonly defer_loading?: boolean;
222
+ readonly input_examples?: readonly ToolInputExample[];
223
+ readonly strict?: boolean;
224
+ }
225
+ export interface ToolBash20250124 {
226
+ readonly name: "bash";
227
+ readonly type: "bash_20250124";
228
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
229
+ readonly cache_control?: CacheControlEphemeral | null;
230
+ readonly defer_loading?: boolean;
231
+ readonly input_examples?: readonly ToolInputExample[];
232
+ readonly strict?: boolean;
233
+ }
234
+ export interface CodeExecutionTool20250522 {
235
+ readonly name: "code_execution";
236
+ readonly type: "code_execution_20250522";
237
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
238
+ readonly cache_control?: CacheControlEphemeral | null;
239
+ readonly defer_loading?: boolean;
240
+ readonly strict?: boolean;
241
+ }
242
+ export interface CodeExecutionTool20250825 {
243
+ readonly name: "code_execution";
244
+ readonly type: "code_execution_20250825";
245
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
246
+ readonly cache_control?: CacheControlEphemeral | null;
247
+ readonly defer_loading?: boolean;
248
+ readonly strict?: boolean;
249
+ }
250
+ export interface CodeExecutionTool20260120 {
251
+ readonly name: "code_execution";
252
+ readonly type: "code_execution_20260120";
253
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
254
+ readonly cache_control?: CacheControlEphemeral | null;
255
+ readonly defer_loading?: boolean;
256
+ readonly strict?: boolean;
257
+ }
258
+ export interface ToolComputerUse20241022 {
259
+ readonly display_height_px: number;
260
+ readonly display_width_px: number;
261
+ readonly name: "computer";
262
+ readonly type: "computer_20241022";
263
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
264
+ readonly cache_control?: CacheControlEphemeral | null;
265
+ readonly defer_loading?: boolean;
266
+ readonly display_number?: number | null;
267
+ readonly input_examples?: readonly ToolInputExample[];
268
+ readonly strict?: boolean;
269
+ }
270
+ export interface ToolComputerUse20250124 {
271
+ readonly display_height_px: number;
272
+ readonly display_width_px: number;
273
+ readonly name: "computer";
274
+ readonly type: "computer_20250124";
275
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
276
+ readonly cache_control?: CacheControlEphemeral | null;
277
+ readonly defer_loading?: boolean;
278
+ readonly display_number?: number | null;
279
+ readonly input_examples?: readonly ToolInputExample[];
280
+ readonly strict?: boolean;
281
+ }
282
+ export interface ToolComputerUse20251124 {
283
+ readonly display_height_px: number;
284
+ readonly display_width_px: number;
285
+ readonly name: "computer";
286
+ readonly type: "computer_20251124";
287
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
288
+ readonly cache_control?: CacheControlEphemeral | null;
289
+ readonly defer_loading?: boolean;
290
+ readonly display_number?: number | null;
291
+ readonly enable_zoom?: boolean;
292
+ readonly input_examples?: readonly ToolInputExample[];
293
+ readonly strict?: boolean;
294
+ }
295
+ export interface MemoryTool20250818 {
296
+ readonly name: "memory";
297
+ readonly type: "memory_20250818";
298
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
299
+ readonly cache_control?: CacheControlEphemeral | null;
300
+ readonly defer_loading?: boolean;
301
+ readonly input_examples?: readonly ToolInputExample[];
302
+ readonly strict?: boolean;
303
+ }
304
+ export interface ToolTextEditor20241022 {
305
+ readonly name: "str_replace_editor";
306
+ readonly type: "text_editor_20241022";
307
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
308
+ readonly cache_control?: CacheControlEphemeral | null;
309
+ readonly defer_loading?: boolean;
310
+ readonly input_examples?: readonly ToolInputExample[];
311
+ readonly strict?: boolean;
312
+ }
313
+ export interface ToolTextEditor20250124 {
314
+ readonly name: "str_replace_editor";
315
+ readonly type: "text_editor_20250124";
316
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
317
+ readonly cache_control?: CacheControlEphemeral | null;
318
+ readonly defer_loading?: boolean;
319
+ readonly input_examples?: readonly ToolInputExample[];
320
+ readonly strict?: boolean;
321
+ }
322
+ export interface ToolTextEditor20250429 {
323
+ readonly name: "str_replace_based_edit_tool";
324
+ readonly type: "text_editor_20250429";
325
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
326
+ readonly cache_control?: CacheControlEphemeral | null;
327
+ readonly defer_loading?: boolean;
328
+ readonly input_examples?: readonly ToolInputExample[];
329
+ readonly strict?: boolean;
330
+ }
331
+ export interface ToolTextEditor20250728 {
332
+ readonly name: "str_replace_based_edit_tool";
333
+ readonly type: "text_editor_20250728";
334
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
335
+ readonly cache_control?: CacheControlEphemeral | null;
336
+ readonly defer_loading?: boolean;
337
+ readonly input_examples?: readonly ToolInputExample[];
338
+ readonly max_characters?: number | null;
339
+ readonly strict?: boolean;
340
+ }
341
+ export interface UserLocation {
342
+ readonly type: "approximate";
343
+ readonly city?: string | null;
344
+ readonly country?: string | null;
345
+ readonly region?: string | null;
346
+ readonly timezone?: string | null;
347
+ }
348
+ export interface WebSearchTool20250305 {
349
+ readonly name: "web_search";
350
+ readonly type: "web_search_20250305";
351
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
352
+ readonly allowed_domains?: readonly string[] | null;
353
+ readonly blocked_domains?: readonly string[] | null;
354
+ readonly cache_control?: CacheControlEphemeral | null;
355
+ readonly defer_loading?: boolean;
356
+ readonly max_uses?: number | null;
357
+ readonly strict?: boolean;
358
+ readonly user_location?: UserLocation | null;
359
+ }
360
+ export interface WebSearchTool20260209 {
361
+ readonly name: "web_search";
362
+ readonly type: "web_search_20260209";
363
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
364
+ readonly allowed_domains?: readonly string[] | null;
365
+ readonly blocked_domains?: readonly string[] | null;
366
+ readonly cache_control?: CacheControlEphemeral | null;
367
+ readonly defer_loading?: boolean;
368
+ readonly max_uses?: number | null;
369
+ readonly strict?: boolean;
370
+ readonly user_location?: UserLocation | null;
371
+ }
372
+ export interface WebFetchTool20250910 {
373
+ readonly name: "web_fetch";
374
+ readonly type: "web_fetch_20250910";
375
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
376
+ readonly allowed_domains?: readonly string[] | null;
377
+ readonly blocked_domains?: readonly string[] | null;
378
+ readonly cache_control?: CacheControlEphemeral | null;
379
+ readonly citations?: CitationsConfigParam | null;
380
+ readonly defer_loading?: boolean;
381
+ readonly max_content_tokens?: number | null;
382
+ readonly max_uses?: number | null;
383
+ readonly strict?: boolean;
384
+ }
385
+ export interface WebFetchTool20260209 {
386
+ readonly name: "web_fetch";
387
+ readonly type: "web_fetch_20260209";
388
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
389
+ readonly allowed_domains?: readonly string[] | null;
390
+ readonly blocked_domains?: readonly string[] | null;
391
+ readonly cache_control?: CacheControlEphemeral | null;
392
+ readonly citations?: CitationsConfigParam | null;
393
+ readonly defer_loading?: boolean;
394
+ readonly max_content_tokens?: number | null;
395
+ readonly max_uses?: number | null;
396
+ readonly strict?: boolean;
397
+ }
398
+ export interface WebFetchTool20260309 {
399
+ readonly name: "web_fetch";
400
+ readonly type: "web_fetch_20260309";
401
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
402
+ readonly allowed_domains?: readonly string[] | null;
403
+ readonly blocked_domains?: readonly string[] | null;
404
+ readonly cache_control?: CacheControlEphemeral | null;
405
+ readonly citations?: CitationsConfigParam | null;
406
+ readonly defer_loading?: boolean;
407
+ readonly max_content_tokens?: number | null;
408
+ readonly max_uses?: number | null;
409
+ readonly strict?: boolean;
410
+ readonly use_cache?: boolean;
411
+ }
412
+ export interface AdvisorTool20260301 {
413
+ readonly model: string;
414
+ readonly name: "advisor";
415
+ readonly type: "advisor_20260301";
416
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
417
+ readonly cache_control?: CacheControlEphemeral | null;
418
+ readonly caching?: CacheControlEphemeral | null;
419
+ readonly defer_loading?: boolean;
420
+ readonly max_uses?: number | null;
421
+ readonly strict?: boolean;
422
+ }
423
+ export interface ToolSearchToolBm25_20251119 {
424
+ readonly name: "tool_search_tool_bm25";
425
+ readonly type: "tool_search_tool_bm25_20251119" | "tool_search_tool_bm25";
426
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
427
+ readonly cache_control?: CacheControlEphemeral | null;
428
+ readonly defer_loading?: boolean;
429
+ readonly strict?: boolean;
430
+ }
431
+ export interface ToolSearchToolRegex20251119 {
432
+ readonly name: "tool_search_tool_regex";
433
+ readonly type: "tool_search_tool_regex_20251119" | "tool_search_tool_regex";
434
+ readonly allowed_callers?: readonly ToolAllowedCaller[];
435
+ readonly cache_control?: CacheControlEphemeral | null;
436
+ readonly defer_loading?: boolean;
437
+ readonly strict?: boolean;
438
+ }
439
+ export interface MCPToolConfig {
440
+ readonly defer_loading?: boolean;
441
+ readonly enabled?: boolean;
442
+ }
443
+ export interface MCPToolDefaultConfig {
444
+ readonly defer_loading?: boolean;
445
+ readonly enabled?: boolean;
446
+ }
447
+ export interface MCPToolset {
448
+ readonly mcp_server_name: string;
449
+ readonly type: "mcp_toolset";
450
+ readonly cache_control?: CacheControlEphemeral | null;
451
+ readonly configs?: Readonly<Record<string, MCPToolConfig>> | null;
452
+ readonly default_config?: MCPToolDefaultConfig;
453
+ }
454
+ export type ToolDefinition = CustomToolDefinition | ToolBash20241022 | ToolBash20250124 | CodeExecutionTool20250522 | CodeExecutionTool20250825 | CodeExecutionTool20260120 | ToolComputerUse20241022 | ToolComputerUse20250124 | ToolComputerUse20251124 | MemoryTool20250818 | ToolTextEditor20241022 | ToolTextEditor20250124 | ToolTextEditor20250429 | ToolTextEditor20250728 | WebSearchTool20250305 | WebSearchTool20260209 | WebFetchTool20250910 | WebFetchTool20260209 | WebFetchTool20260309 | AdvisorTool20260301 | ToolSearchToolBm25_20251119 | ToolSearchToolRegex20251119 | MCPToolset;
455
+ export interface AllThinkingTurns {
456
+ readonly type: "all";
457
+ }
458
+ export interface ThinkingTurns {
459
+ readonly type: "thinking_turns";
460
+ readonly value: number;
461
+ }
462
+ export interface ClearThinking20251015Edit {
463
+ readonly type: "clear_thinking_20251015";
464
+ readonly keep?: ThinkingTurns | AllThinkingTurns | "all";
465
+ }
466
+ export interface InputTokensClearAtLeast {
467
+ readonly type: "input_tokens";
468
+ readonly value: number;
469
+ }
470
+ export interface InputTokensTrigger {
471
+ readonly type: "input_tokens";
472
+ readonly value: number;
473
+ }
474
+ export interface ToolUsesKeep {
475
+ readonly type: "tool_uses";
476
+ readonly value: number;
477
+ }
478
+ export interface ToolUsesTrigger {
479
+ readonly type: "tool_uses";
480
+ readonly value: number;
481
+ }
482
+ export interface ClearToolUses20250919Edit {
483
+ readonly type: "clear_tool_uses_20250919";
484
+ readonly clear_at_least?: InputTokensClearAtLeast | null;
485
+ readonly clear_tool_inputs?: boolean | readonly string[] | null;
486
+ readonly exclude_tools?: readonly string[] | null;
487
+ readonly keep?: ToolUsesKeep;
488
+ readonly trigger?: InputTokensTrigger | ToolUsesTrigger;
489
+ }
490
+ export interface Compact20260112Edit {
491
+ readonly type: "compact_20260112";
492
+ readonly instructions?: string | null;
493
+ readonly pause_after_compaction?: boolean;
494
+ readonly trigger?: InputTokensTrigger | null;
495
+ }
496
+ export interface ContextManagementConfig {
497
+ readonly edits?: readonly (ClearToolUses20250919Edit | ClearThinking20251015Edit | Compact20260112Edit)[];
498
+ }
499
+ export interface JSONOutputFormat {
500
+ readonly schema: Readonly<Record<string, JsonValue>>;
501
+ readonly type: "json_schema";
502
+ }
503
+ export interface OutputConfigInput {
504
+ readonly effort?: ClaudeCodeEffort | null;
505
+ /** Beta-only: requires `task-budgets-2026-03-13`; absent from SDK 0.94.0. */
506
+ readonly maxOutputTokens?: number | null;
507
+ }
508
+ export interface ToolChoiceAny {
509
+ readonly type: "any";
510
+ readonly disable_parallel_tool_use?: boolean;
511
+ }
512
+ export interface ToolChoiceAuto {
513
+ readonly type: "auto";
514
+ readonly disable_parallel_tool_use?: boolean;
515
+ }
516
+ export interface ToolChoiceNone {
517
+ readonly type: "none";
518
+ }
519
+ export interface ToolChoiceTool {
520
+ readonly name: string;
521
+ readonly type: "tool";
522
+ readonly disable_parallel_tool_use?: boolean;
523
+ }
524
+ export type ToolChoice = ToolChoiceAuto | ToolChoiceAny | ToolChoiceTool | ToolChoiceNone;
525
+ export interface ClaudeCodeCapabilities {
526
+ readonly thinking: boolean;
527
+ readonly adaptiveThinking: boolean;
528
+ readonly interleavedThinking: boolean;
529
+ readonly effort: boolean;
530
+ readonly maxEffort: boolean;
531
+ readonly xhighEffort: boolean;
532
+ readonly contextManagement: boolean;
533
+ readonly temperature: boolean;
534
+ readonly rejectsDisabledThinking: boolean;
535
+ }
536
+ /** Host-state beta gates pinned for a default first-party environment. */
537
+ export interface ClaudeCodeBetaPolicy {
538
+ readonly oauthAuthenticated: boolean;
539
+ readonly experimentalBetasEnabled: boolean;
540
+ readonly oneMillionContextEnabled: boolean;
541
+ readonly interleavedThinkingEnabled: boolean;
542
+ readonly interactive: boolean;
543
+ readonly thinkingSummariesShown: boolean;
544
+ readonly thinkingTokenCountEnabled: boolean;
545
+ readonly narrationSummariesEnabled: boolean;
546
+ readonly structuredOutputsEnabled: boolean;
547
+ readonly afkModeEnabled: boolean;
548
+ readonly cacheDiagnosisEnabled: boolean;
549
+ }
550
+ /**
551
+ * Substitutes protocol-identity fields of the pinned profile.
552
+ *
553
+ * The destination (`endpoint`), `provider` and `anthropicVersion` are the
554
+ * immutable security core and cannot be expressed here. Supplying any key
555
+ * outside this contract fails with `INVALID_INPUT` rather than being ignored.
556
+ *
557
+ * Each supplied field REPLACES the pinned field wholesale. There is no deep
558
+ * merge, because a merged model table or beta list would describe no real
559
+ * client version.
560
+ */
561
+ export interface ClaudeCodeProfileOverride {
562
+ readonly id?: string;
563
+ readonly cliVersion?: string;
564
+ readonly sdkVersion?: string;
565
+ readonly entrypoint?: string;
566
+ readonly userAgent?: string;
567
+ readonly buildTime?: string;
568
+ readonly gitSha?: string;
569
+ readonly attributionHeaderEnabled?: boolean;
570
+ readonly contextHintEnabled?: boolean;
571
+ readonly betaPolicy?: ClaudeCodeBetaPolicy;
572
+ readonly supportedModels?: ClaudeCodeProtocolProfile["supportedModels"];
573
+ }
574
+ export interface ClaudeCodeRuntimeIdentity {
575
+ readonly sessionId: string;
576
+ readonly deviceId: string;
577
+ readonly accountUuid: string;
578
+ readonly runtime: "node" | "bun" | "workerd";
579
+ readonly runtimeVersion: string;
580
+ readonly os: "Windows" | "Linux" | "macOS";
581
+ readonly arch: string;
582
+ }
583
+ /** Directs where the package places cache breakpoints. */
584
+ export interface ClaudeCodeCacheControlInput {
585
+ readonly enabled?: boolean | null;
586
+ readonly ttl?: "5m" | "1h" | null;
587
+ readonly systemBreakpoint?: boolean | null;
588
+ readonly toolBreakpoint?: boolean | null;
589
+ readonly messageBreakpoint?: boolean | null;
590
+ }
591
+ export interface ClaudeCodeRequestInput {
592
+ readonly accessToken: string;
593
+ readonly model: string;
594
+ readonly maxTokens: number;
595
+ readonly messages: readonly Message[];
596
+ readonly system?: readonly SystemInput[];
597
+ readonly tools?: readonly ToolDefinition[];
598
+ readonly cacheControl?: ClaudeCodeCacheControlInput | null;
599
+ readonly runtime: ClaudeCodeRuntimeIdentity;
600
+ readonly capabilities?: Partial<ClaudeCodeCapabilities>;
601
+ /** Substitutes protocol-identity fields of the pinned profile. */
602
+ readonly profileOverride?: ClaudeCodeProfileOverride;
603
+ readonly thinking?: {
604
+ readonly type: "enabled" | "adaptive" | "disabled";
605
+ readonly budgetTokens?: number;
606
+ readonly display?: ThinkingDisplay;
607
+ };
608
+ readonly effort?: ClaudeCodeEffort;
609
+ /** Supplies validated JSON metadata values in caller insertion order. */
610
+ readonly metadata?: Readonly<Record<string, JsonValue>>;
611
+ /** Appends validated, collision-safe beta fields to the request body. */
612
+ readonly experimentalBodyFields?: Readonly<Record<string, JsonValue>>;
613
+ readonly contextManagement?: ContextManagementConfig | null;
614
+ readonly outputConfig?: OutputConfigInput;
615
+ readonly speed?: "standard" | "fast" | null;
616
+ readonly serviceTier?: "auto" | "standard_only";
617
+ readonly outputFormat?: JSONOutputFormat | null;
618
+ readonly toolChoice?: ToolChoice;
619
+ readonly topP?: number;
620
+ readonly topK?: number;
621
+ readonly stopSequences?: readonly string[];
622
+ readonly stream?: boolean;
623
+ readonly temperature?: number;
624
+ /** Supplies the `x-client-request-id` header. */
625
+ readonly clientRequestId: string;
626
+ /** Selects the foreground or background Claude Code entrypoint header. */
627
+ readonly app?: "cli" | "cli-bg";
628
+ /** Supplies the Stainless retry-count header. */
629
+ readonly stainlessRetryCount?: number;
630
+ /** Supplies the Stainless helper header. */
631
+ readonly stainlessHelper?: string;
632
+ /** Supplies the Claude remote-container identifier header. */
633
+ readonly claudeRemoteContainerId?: string;
634
+ /** Supplies the Claude remote-session identifier header. */
635
+ readonly claudeRemoteSessionId?: string;
636
+ /** Supplies the client-application header. */
637
+ readonly clientApp?: string;
638
+ /** Supplies the Anthropic additional-protection header. */
639
+ readonly anthropicAdditionalProtection?: string;
640
+ /** Appends validated non-canonical headers in caller order. */
641
+ readonly extraHeaders?: readonly HeaderPair[];
642
+ /** Injects the Web Crypto provider used to hash the request body. */
643
+ readonly crypto?: Pick<Crypto, "subtle">;
644
+ }
645
+ /**
646
+ * Narrower than `ClaudeCodeRequestInput` by design. Upstream `P5e` derives the
647
+ * beta set from the model alone, so there is deliberately no `capabilities`
648
+ * field, and the count-tokens body carries no `system`, `metadata`, or
649
+ * `maxTokens`.
650
+ */
651
+ export type ClaudeCodeCountTokensInput = Pick<ClaudeCodeRequestInput, "accessToken" | "model" | "messages" | "tools" | "runtime" | "clientRequestId" | "profileOverride" | "crypto" | "app" | "stainlessRetryCount" | "stainlessHelper" | "claudeRemoteContainerId" | "claudeRemoteSessionId" | "clientApp" | "anthropicAdditionalProtection" | "extraHeaders">;
652
+ export interface BuiltClaudeCodeCountTokensRequest extends Omit<BuiltClaudeCodeRequest, "url"> {
653
+ readonly url: "https://api.anthropic.com/v1/messages/count_tokens?beta=true";
654
+ }
655
+ export interface ClaudeCodeProtocolProfile {
656
+ readonly countTokensEndpoint: "https://api.anthropic.com/v1/messages/count_tokens?beta=true";
657
+ readonly id: string;
658
+ readonly cliVersion: string;
659
+ readonly sdkVersion: string;
660
+ readonly endpoint: "https://api.anthropic.com/v1/messages?beta=true";
661
+ /** Replaces upstream `CLAUDE_CODE_ENTRYPOINT`. */
662
+ readonly entrypoint: string;
663
+ /** Replaces upstream `buildExtendedUserAgent` (`lib/request-headers.mjs:288-295`). */
664
+ readonly userAgent: string;
665
+ /** Replaces upstream `CLAUDE_CODE_BUILD_TIME`. */
666
+ readonly buildTime: string;
667
+ /** Replaces upstream `CLAUDE_CODE_GIT_SHA`. */
668
+ readonly gitSha: string;
669
+ /** Replaces upstream `CLAUDE_CODE_ATTRIBUTION_HEADER`. */
670
+ readonly attributionHeaderEnabled: boolean;
671
+ /**
672
+ * Replaces the upstream `provider` parameter of
673
+ * `buildAnthropicBillingHeader` (`lib/mimicry/system-prompt.mjs:134-159`),
674
+ * where `bedrock`, `anthropicAws`, and `mantle` suppress the `cch` and
675
+ * workload parts.
676
+ */
677
+ readonly provider: "anthropic";
678
+ /** Pins the upstream `anthropic-version` request header. */
679
+ readonly anthropicVersion: "2023-06-01";
680
+ readonly contextHintEnabled: boolean;
681
+ readonly betaPolicy: ClaudeCodeBetaPolicy;
682
+ readonly supportedModels: Readonly<Record<string, ClaudeCodeCatalogueEntry>>;
683
+ }
684
+ export type ClaudeCodeWireErrorCode = "INVALID_INPUT" | "INVALID_IDENTITY" | "UNSUPPORTED_CAPABILITY" | "INVALID_THINKING" | "INVALID_EFFORT" | "FORBIDDEN_HEADER" | "DUPLICATE_HEADER" | "HEADER_INJECTION" | "INVALID_UNICODE" | "INPUT_TOO_DEEP" | "INPUT_TOO_LARGE" | "CYCLIC_INPUT" | "CRYPTO_UNAVAILABLE" | "REDACTION_FAILURE";
685
+ export interface RedactedRequestEvidence {
686
+ /** Reports the effective profile id, which differs when overridden. */
687
+ readonly profileId: string;
688
+ readonly url: ClaudeCodeProtocolProfile["endpoint"];
689
+ readonly method: "POST";
690
+ readonly modelFamily: ClaudeCodeModelFamily;
691
+ readonly logicalHeaderNames: readonly string[];
692
+ readonly betaFeatures: readonly string[];
693
+ readonly bodySha256: string;
694
+ readonly bodyByteLength: number;
695
+ readonly messageCount: number;
696
+ readonly systemBlockCount: number;
697
+ readonly capabilityDecisions: Readonly<Record<keyof ClaudeCodeCapabilities, boolean>>;
698
+ }
699
+ export interface BuiltClaudeCodeRequest {
700
+ readonly url: "https://api.anthropic.com/v1/messages?beta=true";
701
+ readonly method: "POST";
702
+ readonly headers: readonly HeaderPair[];
703
+ readonly body: string;
704
+ readonly evidence: RedactedRequestEvidence;
705
+ }
706
+ export declare class ClaudeCodeWireError extends Error {
707
+ readonly name = "ClaudeCodeWireError";
708
+ readonly code: ClaudeCodeWireErrorCode;
709
+ readonly safeDetails: Readonly<Record<string, string | number | boolean>>;
710
+ constructor(code: ClaudeCodeWireErrorCode, safeDetails?: Readonly<Record<string, string | number | boolean>>);
711
+ toJSON(): {
712
+ readonly name: "ClaudeCodeWireError";
713
+ readonly code: ClaudeCodeWireErrorCode;
714
+ readonly safeDetails: Readonly<Record<string, string | number | boolean>>;
715
+ };
716
+ }
717
+ //# sourceMappingURL=contracts.d.ts.map