hankweave 0.5.7 → 0.6.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.
Files changed (79) hide show
  1. package/README.md +12 -11
  2. package/dist/base-process-manager.d.ts +30 -0
  3. package/dist/budget.d.ts +315 -0
  4. package/dist/checkpoint-git.d.ts +98 -0
  5. package/dist/claude-agent-sdk-manager.d.ts +144 -0
  6. package/dist/claude-log-parser.d.ts +63 -0
  7. package/dist/claude-runtime-extractor.d.ts +73 -0
  8. package/dist/codex-runtime-extractor.d.ts +107 -0
  9. package/dist/codon-runner.d.ts +278 -0
  10. package/dist/config-validation/model-validator.d.ts +16 -0
  11. package/dist/config-validation/sentinel.schema.d.ts +6967 -0
  12. package/dist/config.d.ts +40815 -0
  13. package/dist/cost-tracker.d.ts +72 -0
  14. package/dist/execution-planner.d.ts +62 -0
  15. package/dist/execution-thread.d.ts +71 -0
  16. package/dist/exports/schemas.d.ts +9 -0
  17. package/dist/exports/schemas.js +1019 -0
  18. package/dist/exports/types.d.ts +15 -0
  19. package/dist/exports/types.js +60 -0
  20. package/dist/file-resolver.d.ts +33 -0
  21. package/dist/index.js +380 -293
  22. package/dist/index.js.map +33 -29
  23. package/dist/llm/llm-provider-registry.d.ts +207 -0
  24. package/dist/llm/models-dev-schema.d.ts +679 -0
  25. package/dist/llm/provider-config.d.ts +30 -0
  26. package/dist/prompt-builder.d.ts +75 -0
  27. package/dist/prompt-frontmatter.d.ts +61 -0
  28. package/dist/replay-process-manager.d.ts +82 -0
  29. package/dist/runtime-extractor-base.d.ts +120 -0
  30. package/dist/schemas/event-schemas.d.ts +8389 -0
  31. package/dist/schemas/websocket-log-schemas.d.ts +4502 -0
  32. package/dist/shim-process-manager.d.ts +98 -0
  33. package/dist/shim-runtime-extractor.d.ts +51 -0
  34. package/dist/shims/codex/README.md +129 -0
  35. package/dist/shims/codex/THIRDPARTY.md +18 -0
  36. package/dist/shims/codex/VERSION +1 -0
  37. package/dist/shims/codex/common/package.json +24 -0
  38. package/dist/shims/codex/index.js +1154 -970
  39. package/dist/shims/codex/package.json +46 -0
  40. package/dist/shims/codex/tsup.config.ts +16 -0
  41. package/dist/shims/gemini/README.md +59 -0
  42. package/dist/shims/gemini/THIRDPARTY.md +32 -0
  43. package/dist/shims/gemini/VERSION +1 -0
  44. package/dist/shims/gemini/common/package.json +24 -0
  45. package/dist/shims/gemini/index.js +1359 -30
  46. package/dist/shims/gemini/package.json +37 -0
  47. package/dist/shims/opencode/README.md +82 -0
  48. package/dist/shims/opencode/THIRDPARTY.md +32 -0
  49. package/dist/shims/opencode/VERSION +1 -0
  50. package/dist/shims/opencode/common/package.json +24 -0
  51. package/dist/shims/opencode/index.js +1476 -0
  52. package/dist/shims/opencode/package.json +38 -0
  53. package/dist/shims/pi/README.md +87 -0
  54. package/dist/shims/pi/THIRDPARTY.md +24 -0
  55. package/dist/shims/pi/VERSION +1 -0
  56. package/dist/shims/pi/common/package.json +24 -0
  57. package/dist/shims/pi/index.js +249832 -0
  58. package/dist/shims/pi/package.json +53 -0
  59. package/dist/state-manager.d.ts +161 -0
  60. package/dist/state-transition-guards.d.ts +37 -0
  61. package/dist/telemetry/telemetry-types.d.ts +206 -0
  62. package/dist/typed-event-emitter.d.ts +57 -0
  63. package/dist/types/branded-types.d.ts +15 -0
  64. package/dist/types/budget-types.d.ts +82 -0
  65. package/dist/types/claude-session-schema.d.ts +2430 -0
  66. package/dist/types/error-types.d.ts +44 -0
  67. package/dist/types/input-ai-types.d.ts +1070 -0
  68. package/dist/types/llm-call-types.d.ts +3829 -0
  69. package/dist/types/sentinel-types.d.ts +66 -0
  70. package/dist/types/state-types.d.ts +1099 -0
  71. package/dist/types/tool-types.d.ts +86 -0
  72. package/dist/types/types.d.ts +367 -0
  73. package/dist/types/websocket-log-types.d.ts +7 -0
  74. package/dist/utils.d.ts +452 -0
  75. package/package.json +15 -2
  76. package/schemas/hank.schema.json +158 -3
  77. package/schemas/hankweave.schema.json +17 -1
  78. package/shims/codex/index.js +0 -1583
  79. package/shims/gemini/index.js +0 -31
@@ -0,0 +1,2430 @@
1
+ import { z } from "zod";
2
+ export declare const toolNameSchema: z.ZodString;
3
+ /**
4
+ * System Message Schema
5
+ *
6
+ * Appears at the beginning of each session to initialize the Claude Code environment.
7
+ * Contains session metadata, tool configuration, and working directory information.
8
+ */
9
+ export declare const systemMessageSchema: z.ZodObject<{
10
+ type: z.ZodLiteral<"system">;
11
+ subtype: z.ZodLiteral<"init">;
12
+ cwd: z.ZodString;
13
+ session_id: z.ZodString;
14
+ tools: z.ZodArray<z.ZodString, "many">;
15
+ mcp_servers: z.ZodDefault<z.ZodArray<z.ZodUnknown, "many">>;
16
+ model: z.ZodString;
17
+ permissionMode: z.ZodEnum<["bypassPermissions", "requestPermissions"]>;
18
+ apiKeySource: z.ZodString;
19
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
20
+ type: z.ZodLiteral<"system">;
21
+ subtype: z.ZodLiteral<"init">;
22
+ cwd: z.ZodString;
23
+ session_id: z.ZodString;
24
+ tools: z.ZodArray<z.ZodString, "many">;
25
+ mcp_servers: z.ZodDefault<z.ZodArray<z.ZodUnknown, "many">>;
26
+ model: z.ZodString;
27
+ permissionMode: z.ZodEnum<["bypassPermissions", "requestPermissions"]>;
28
+ apiKeySource: z.ZodString;
29
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
30
+ type: z.ZodLiteral<"system">;
31
+ subtype: z.ZodLiteral<"init">;
32
+ cwd: z.ZodString;
33
+ session_id: z.ZodString;
34
+ tools: z.ZodArray<z.ZodString, "many">;
35
+ mcp_servers: z.ZodDefault<z.ZodArray<z.ZodUnknown, "many">>;
36
+ model: z.ZodString;
37
+ permissionMode: z.ZodEnum<["bypassPermissions", "requestPermissions"]>;
38
+ apiKeySource: z.ZodString;
39
+ }, z.ZodTypeAny, "passthrough">>;
40
+ /**
41
+ * Tool Use Content Schema
42
+ *
43
+ * Represents a tool invocation within an assistant message.
44
+ * Contains the tool name, unique ID, and input parameters.
45
+ */
46
+ export declare const toolUseContentSchema: z.ZodObject<{
47
+ type: z.ZodLiteral<"tool_use">;
48
+ id: z.ZodString;
49
+ name: z.ZodString;
50
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
51
+ }, "strip", z.ZodTypeAny, {
52
+ type: "tool_use";
53
+ id: string;
54
+ name: string;
55
+ input?: Record<string, unknown> | undefined;
56
+ }, {
57
+ type: "tool_use";
58
+ id: string;
59
+ name: string;
60
+ input?: Record<string, unknown> | undefined;
61
+ }>;
62
+ /**
63
+ * Text Content Schema
64
+ *
65
+ * Represents plain text content within a message.
66
+ */
67
+ export declare const textContentSchema: z.ZodObject<{
68
+ type: z.ZodLiteral<"text">;
69
+ text: z.ZodString;
70
+ }, "strip", z.ZodTypeAny, {
71
+ type: "text";
72
+ text: string;
73
+ }, {
74
+ type: "text";
75
+ text: string;
76
+ }>;
77
+ /**
78
+ * Thinking Content Schema
79
+ *
80
+ * Represents Claude's internal thinking process (when enabled).
81
+ */
82
+ export declare const thinkingContentSchema: z.ZodObject<{
83
+ type: z.ZodLiteral<"thinking">;
84
+ thinking: z.ZodString;
85
+ }, "strip", z.ZodTypeAny, {
86
+ type: "thinking";
87
+ thinking: string;
88
+ }, {
89
+ type: "thinking";
90
+ thinking: string;
91
+ }>;
92
+ /**
93
+ * Tool Result Content Schema
94
+ *
95
+ * Represents the result of a tool execution within a user message.
96
+ */
97
+ export declare const toolResultContentSchema: z.ZodObject<{
98
+ type: z.ZodLiteral<"tool_result">;
99
+ tool_use_id: z.ZodString;
100
+ content: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodObject<{
101
+ type: z.ZodLiteral<"text">;
102
+ text: z.ZodString;
103
+ }, "strip", z.ZodTypeAny, {
104
+ type: "text";
105
+ text: string;
106
+ }, {
107
+ type: "text";
108
+ text: string;
109
+ }>, "many">]>;
110
+ }, "strip", z.ZodTypeAny, {
111
+ type: "tool_result";
112
+ tool_use_id: string;
113
+ content: string | Record<string, unknown> | {
114
+ type: "text";
115
+ text: string;
116
+ }[];
117
+ }, {
118
+ type: "tool_result";
119
+ tool_use_id: string;
120
+ content: string | Record<string, unknown> | {
121
+ type: "text";
122
+ text: string;
123
+ }[];
124
+ }>;
125
+ /**
126
+ * Message Content Schema
127
+ *
128
+ * Union of all possible content types within a message.
129
+ */
130
+ export declare const messageContentSchema: z.ZodUnion<[z.ZodObject<{
131
+ type: z.ZodLiteral<"tool_use">;
132
+ id: z.ZodString;
133
+ name: z.ZodString;
134
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
135
+ }, "strip", z.ZodTypeAny, {
136
+ type: "tool_use";
137
+ id: string;
138
+ name: string;
139
+ input?: Record<string, unknown> | undefined;
140
+ }, {
141
+ type: "tool_use";
142
+ id: string;
143
+ name: string;
144
+ input?: Record<string, unknown> | undefined;
145
+ }>, z.ZodObject<{
146
+ type: z.ZodLiteral<"text">;
147
+ text: z.ZodString;
148
+ }, "strip", z.ZodTypeAny, {
149
+ type: "text";
150
+ text: string;
151
+ }, {
152
+ type: "text";
153
+ text: string;
154
+ }>, z.ZodObject<{
155
+ type: z.ZodLiteral<"thinking">;
156
+ thinking: z.ZodString;
157
+ }, "strip", z.ZodTypeAny, {
158
+ type: "thinking";
159
+ thinking: string;
160
+ }, {
161
+ type: "thinking";
162
+ thinking: string;
163
+ }>, z.ZodObject<{
164
+ type: z.ZodLiteral<"tool_result">;
165
+ tool_use_id: z.ZodString;
166
+ content: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodObject<{
167
+ type: z.ZodLiteral<"text">;
168
+ text: z.ZodString;
169
+ }, "strip", z.ZodTypeAny, {
170
+ type: "text";
171
+ text: string;
172
+ }, {
173
+ type: "text";
174
+ text: string;
175
+ }>, "many">]>;
176
+ }, "strip", z.ZodTypeAny, {
177
+ type: "tool_result";
178
+ tool_use_id: string;
179
+ content: string | Record<string, unknown> | {
180
+ type: "text";
181
+ text: string;
182
+ }[];
183
+ }, {
184
+ type: "tool_result";
185
+ tool_use_id: string;
186
+ content: string | Record<string, unknown> | {
187
+ type: "text";
188
+ text: string;
189
+ }[];
190
+ }>]>;
191
+ /**
192
+ * Assistant Message Schema
193
+ *
194
+ * Represents Claude's responses, including text and tool use requests.
195
+ */
196
+ export declare const assistantMessageSchema: z.ZodObject<{
197
+ type: z.ZodLiteral<"assistant">;
198
+ message: z.ZodObject<{
199
+ id: z.ZodString;
200
+ type: z.ZodLiteral<"message">;
201
+ role: z.ZodLiteral<"assistant">;
202
+ model: z.ZodString;
203
+ content: z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
204
+ type: z.ZodLiteral<"tool_use">;
205
+ id: z.ZodString;
206
+ name: z.ZodString;
207
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
208
+ }, "strip", z.ZodTypeAny, {
209
+ type: "tool_use";
210
+ id: string;
211
+ name: string;
212
+ input?: Record<string, unknown> | undefined;
213
+ }, {
214
+ type: "tool_use";
215
+ id: string;
216
+ name: string;
217
+ input?: Record<string, unknown> | undefined;
218
+ }>, z.ZodObject<{
219
+ type: z.ZodLiteral<"text">;
220
+ text: z.ZodString;
221
+ }, "strip", z.ZodTypeAny, {
222
+ type: "text";
223
+ text: string;
224
+ }, {
225
+ type: "text";
226
+ text: string;
227
+ }>, z.ZodObject<{
228
+ type: z.ZodLiteral<"thinking">;
229
+ thinking: z.ZodString;
230
+ }, "strip", z.ZodTypeAny, {
231
+ type: "thinking";
232
+ thinking: string;
233
+ }, {
234
+ type: "thinking";
235
+ thinking: string;
236
+ }>, z.ZodObject<{
237
+ type: z.ZodLiteral<"tool_result">;
238
+ tool_use_id: z.ZodString;
239
+ content: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodObject<{
240
+ type: z.ZodLiteral<"text">;
241
+ text: z.ZodString;
242
+ }, "strip", z.ZodTypeAny, {
243
+ type: "text";
244
+ text: string;
245
+ }, {
246
+ type: "text";
247
+ text: string;
248
+ }>, "many">]>;
249
+ }, "strip", z.ZodTypeAny, {
250
+ type: "tool_result";
251
+ tool_use_id: string;
252
+ content: string | Record<string, unknown> | {
253
+ type: "text";
254
+ text: string;
255
+ }[];
256
+ }, {
257
+ type: "tool_result";
258
+ tool_use_id: string;
259
+ content: string | Record<string, unknown> | {
260
+ type: "text";
261
+ text: string;
262
+ }[];
263
+ }>]>, "many">, z.ZodString]>;
264
+ usage: z.ZodOptional<z.ZodObject<{
265
+ input_tokens: z.ZodNumber;
266
+ output_tokens: z.ZodNumber;
267
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
268
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
269
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
270
+ input_tokens: z.ZodNumber;
271
+ output_tokens: z.ZodNumber;
272
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
273
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
274
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
275
+ input_tokens: z.ZodNumber;
276
+ output_tokens: z.ZodNumber;
277
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
278
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
279
+ }, z.ZodTypeAny, "passthrough">>>;
280
+ stop_reason: z.ZodOptional<z.ZodNullable<z.ZodEnum<["end_turn", "max_tokens", "stop_sequence", "tool_use"]>>>;
281
+ stop_sequence: z.ZodOptional<z.ZodNullable<z.ZodString>>;
282
+ }, "strip", z.ZodTypeAny, {
283
+ type: "message";
284
+ model: string;
285
+ id: string;
286
+ content: string | ({
287
+ type: "tool_use";
288
+ id: string;
289
+ name: string;
290
+ input?: Record<string, unknown> | undefined;
291
+ } | {
292
+ type: "text";
293
+ text: string;
294
+ } | {
295
+ type: "thinking";
296
+ thinking: string;
297
+ } | {
298
+ type: "tool_result";
299
+ tool_use_id: string;
300
+ content: string | Record<string, unknown> | {
301
+ type: "text";
302
+ text: string;
303
+ }[];
304
+ })[];
305
+ role: "assistant";
306
+ usage?: z.objectOutputType<{
307
+ input_tokens: z.ZodNumber;
308
+ output_tokens: z.ZodNumber;
309
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
310
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
311
+ }, z.ZodTypeAny, "passthrough"> | undefined;
312
+ stop_sequence?: string | null | undefined;
313
+ stop_reason?: "tool_use" | "end_turn" | "max_tokens" | "stop_sequence" | null | undefined;
314
+ }, {
315
+ type: "message";
316
+ model: string;
317
+ id: string;
318
+ content: string | ({
319
+ type: "tool_use";
320
+ id: string;
321
+ name: string;
322
+ input?: Record<string, unknown> | undefined;
323
+ } | {
324
+ type: "text";
325
+ text: string;
326
+ } | {
327
+ type: "thinking";
328
+ thinking: string;
329
+ } | {
330
+ type: "tool_result";
331
+ tool_use_id: string;
332
+ content: string | Record<string, unknown> | {
333
+ type: "text";
334
+ text: string;
335
+ }[];
336
+ })[];
337
+ role: "assistant";
338
+ usage?: z.objectInputType<{
339
+ input_tokens: z.ZodNumber;
340
+ output_tokens: z.ZodNumber;
341
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
342
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
343
+ }, z.ZodTypeAny, "passthrough"> | undefined;
344
+ stop_sequence?: string | null | undefined;
345
+ stop_reason?: "tool_use" | "end_turn" | "max_tokens" | "stop_sequence" | null | undefined;
346
+ }>;
347
+ }, "strip", z.ZodTypeAny, {
348
+ type: "assistant";
349
+ message: {
350
+ type: "message";
351
+ model: string;
352
+ id: string;
353
+ content: string | ({
354
+ type: "tool_use";
355
+ id: string;
356
+ name: string;
357
+ input?: Record<string, unknown> | undefined;
358
+ } | {
359
+ type: "text";
360
+ text: string;
361
+ } | {
362
+ type: "thinking";
363
+ thinking: string;
364
+ } | {
365
+ type: "tool_result";
366
+ tool_use_id: string;
367
+ content: string | Record<string, unknown> | {
368
+ type: "text";
369
+ text: string;
370
+ }[];
371
+ })[];
372
+ role: "assistant";
373
+ usage?: z.objectOutputType<{
374
+ input_tokens: z.ZodNumber;
375
+ output_tokens: z.ZodNumber;
376
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
377
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
378
+ }, z.ZodTypeAny, "passthrough"> | undefined;
379
+ stop_sequence?: string | null | undefined;
380
+ stop_reason?: "tool_use" | "end_turn" | "max_tokens" | "stop_sequence" | null | undefined;
381
+ };
382
+ }, {
383
+ type: "assistant";
384
+ message: {
385
+ type: "message";
386
+ model: string;
387
+ id: string;
388
+ content: string | ({
389
+ type: "tool_use";
390
+ id: string;
391
+ name: string;
392
+ input?: Record<string, unknown> | undefined;
393
+ } | {
394
+ type: "text";
395
+ text: string;
396
+ } | {
397
+ type: "thinking";
398
+ thinking: string;
399
+ } | {
400
+ type: "tool_result";
401
+ tool_use_id: string;
402
+ content: string | Record<string, unknown> | {
403
+ type: "text";
404
+ text: string;
405
+ }[];
406
+ })[];
407
+ role: "assistant";
408
+ usage?: z.objectInputType<{
409
+ input_tokens: z.ZodNumber;
410
+ output_tokens: z.ZodNumber;
411
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
412
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
413
+ }, z.ZodTypeAny, "passthrough"> | undefined;
414
+ stop_sequence?: string | null | undefined;
415
+ stop_reason?: "tool_use" | "end_turn" | "max_tokens" | "stop_sequence" | null | undefined;
416
+ };
417
+ }>;
418
+ /**
419
+ * User Message Schema
420
+ *
421
+ * Represents user input or tool results being provided to Claude.
422
+ */
423
+ export declare const userMessageSchema: z.ZodObject<{
424
+ type: z.ZodLiteral<"user">;
425
+ message: z.ZodObject<{
426
+ role: z.ZodLiteral<"user">;
427
+ content: z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
428
+ type: z.ZodLiteral<"tool_use">;
429
+ id: z.ZodString;
430
+ name: z.ZodString;
431
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
432
+ }, "strip", z.ZodTypeAny, {
433
+ type: "tool_use";
434
+ id: string;
435
+ name: string;
436
+ input?: Record<string, unknown> | undefined;
437
+ }, {
438
+ type: "tool_use";
439
+ id: string;
440
+ name: string;
441
+ input?: Record<string, unknown> | undefined;
442
+ }>, z.ZodObject<{
443
+ type: z.ZodLiteral<"text">;
444
+ text: z.ZodString;
445
+ }, "strip", z.ZodTypeAny, {
446
+ type: "text";
447
+ text: string;
448
+ }, {
449
+ type: "text";
450
+ text: string;
451
+ }>, z.ZodObject<{
452
+ type: z.ZodLiteral<"thinking">;
453
+ thinking: z.ZodString;
454
+ }, "strip", z.ZodTypeAny, {
455
+ type: "thinking";
456
+ thinking: string;
457
+ }, {
458
+ type: "thinking";
459
+ thinking: string;
460
+ }>, z.ZodObject<{
461
+ type: z.ZodLiteral<"tool_result">;
462
+ tool_use_id: z.ZodString;
463
+ content: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodObject<{
464
+ type: z.ZodLiteral<"text">;
465
+ text: z.ZodString;
466
+ }, "strip", z.ZodTypeAny, {
467
+ type: "text";
468
+ text: string;
469
+ }, {
470
+ type: "text";
471
+ text: string;
472
+ }>, "many">]>;
473
+ }, "strip", z.ZodTypeAny, {
474
+ type: "tool_result";
475
+ tool_use_id: string;
476
+ content: string | Record<string, unknown> | {
477
+ type: "text";
478
+ text: string;
479
+ }[];
480
+ }, {
481
+ type: "tool_result";
482
+ tool_use_id: string;
483
+ content: string | Record<string, unknown> | {
484
+ type: "text";
485
+ text: string;
486
+ }[];
487
+ }>]>, "many">, z.ZodString]>;
488
+ }, "strip", z.ZodTypeAny, {
489
+ content: string | ({
490
+ type: "tool_use";
491
+ id: string;
492
+ name: string;
493
+ input?: Record<string, unknown> | undefined;
494
+ } | {
495
+ type: "text";
496
+ text: string;
497
+ } | {
498
+ type: "thinking";
499
+ thinking: string;
500
+ } | {
501
+ type: "tool_result";
502
+ tool_use_id: string;
503
+ content: string | Record<string, unknown> | {
504
+ type: "text";
505
+ text: string;
506
+ }[];
507
+ })[];
508
+ role: "user";
509
+ }, {
510
+ content: string | ({
511
+ type: "tool_use";
512
+ id: string;
513
+ name: string;
514
+ input?: Record<string, unknown> | undefined;
515
+ } | {
516
+ type: "text";
517
+ text: string;
518
+ } | {
519
+ type: "thinking";
520
+ thinking: string;
521
+ } | {
522
+ type: "tool_result";
523
+ tool_use_id: string;
524
+ content: string | Record<string, unknown> | {
525
+ type: "text";
526
+ text: string;
527
+ }[];
528
+ })[];
529
+ role: "user";
530
+ }>;
531
+ }, "strip", z.ZodTypeAny, {
532
+ type: "user";
533
+ message: {
534
+ content: string | ({
535
+ type: "tool_use";
536
+ id: string;
537
+ name: string;
538
+ input?: Record<string, unknown> | undefined;
539
+ } | {
540
+ type: "text";
541
+ text: string;
542
+ } | {
543
+ type: "thinking";
544
+ thinking: string;
545
+ } | {
546
+ type: "tool_result";
547
+ tool_use_id: string;
548
+ content: string | Record<string, unknown> | {
549
+ type: "text";
550
+ text: string;
551
+ }[];
552
+ })[];
553
+ role: "user";
554
+ };
555
+ }, {
556
+ type: "user";
557
+ message: {
558
+ content: string | ({
559
+ type: "tool_use";
560
+ id: string;
561
+ name: string;
562
+ input?: Record<string, unknown> | undefined;
563
+ } | {
564
+ type: "text";
565
+ text: string;
566
+ } | {
567
+ type: "thinking";
568
+ thinking: string;
569
+ } | {
570
+ type: "tool_result";
571
+ tool_use_id: string;
572
+ content: string | Record<string, unknown> | {
573
+ type: "text";
574
+ text: string;
575
+ }[];
576
+ })[];
577
+ role: "user";
578
+ };
579
+ }>;
580
+ /**
581
+ * Result Message Schema
582
+ *
583
+ * Appears at the end of each session to summarize the conversation outcome.
584
+ */
585
+ export declare const resultMessageSchema: z.ZodObject<{
586
+ type: z.ZodLiteral<"result">;
587
+ subtype: z.ZodEnum<["success", "error", "error_during_execution"]>;
588
+ is_error: z.ZodBoolean;
589
+ duration_ms: z.ZodNumber;
590
+ duration_api_ms: z.ZodNumber;
591
+ num_turns: z.ZodNumber;
592
+ result: z.ZodString;
593
+ session_id: z.ZodOptional<z.ZodString>;
594
+ total_cost_usd: z.ZodOptional<z.ZodNumber>;
595
+ usage: z.ZodOptional<z.ZodObject<{
596
+ input_tokens: z.ZodOptional<z.ZodNumber>;
597
+ output_tokens: z.ZodOptional<z.ZodNumber>;
598
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
599
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
600
+ server_tool_use: z.ZodOptional<z.ZodObject<{
601
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
602
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
603
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
604
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
605
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
606
+ }, z.ZodTypeAny, "passthrough">>>;
607
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
608
+ input_tokens: z.ZodOptional<z.ZodNumber>;
609
+ output_tokens: z.ZodOptional<z.ZodNumber>;
610
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
611
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
612
+ server_tool_use: z.ZodOptional<z.ZodObject<{
613
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
614
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
615
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
616
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
617
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
618
+ }, z.ZodTypeAny, "passthrough">>>;
619
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
620
+ input_tokens: z.ZodOptional<z.ZodNumber>;
621
+ output_tokens: z.ZodOptional<z.ZodNumber>;
622
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
623
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
624
+ server_tool_use: z.ZodOptional<z.ZodObject<{
625
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
626
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
627
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
628
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
629
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
630
+ }, z.ZodTypeAny, "passthrough">>>;
631
+ }, z.ZodTypeAny, "passthrough">>>;
632
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
633
+ type: z.ZodLiteral<"result">;
634
+ subtype: z.ZodEnum<["success", "error", "error_during_execution"]>;
635
+ is_error: z.ZodBoolean;
636
+ duration_ms: z.ZodNumber;
637
+ duration_api_ms: z.ZodNumber;
638
+ num_turns: z.ZodNumber;
639
+ result: z.ZodString;
640
+ session_id: z.ZodOptional<z.ZodString>;
641
+ total_cost_usd: z.ZodOptional<z.ZodNumber>;
642
+ usage: z.ZodOptional<z.ZodObject<{
643
+ input_tokens: z.ZodOptional<z.ZodNumber>;
644
+ output_tokens: z.ZodOptional<z.ZodNumber>;
645
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
646
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
647
+ server_tool_use: z.ZodOptional<z.ZodObject<{
648
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
649
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
650
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
651
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
652
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
653
+ }, z.ZodTypeAny, "passthrough">>>;
654
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
655
+ input_tokens: z.ZodOptional<z.ZodNumber>;
656
+ output_tokens: z.ZodOptional<z.ZodNumber>;
657
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
658
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
659
+ server_tool_use: z.ZodOptional<z.ZodObject<{
660
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
661
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
662
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
663
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
664
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
665
+ }, z.ZodTypeAny, "passthrough">>>;
666
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
667
+ input_tokens: z.ZodOptional<z.ZodNumber>;
668
+ output_tokens: z.ZodOptional<z.ZodNumber>;
669
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
670
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
671
+ server_tool_use: z.ZodOptional<z.ZodObject<{
672
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
673
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
674
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
675
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
676
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
677
+ }, z.ZodTypeAny, "passthrough">>>;
678
+ }, z.ZodTypeAny, "passthrough">>>;
679
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
680
+ type: z.ZodLiteral<"result">;
681
+ subtype: z.ZodEnum<["success", "error", "error_during_execution"]>;
682
+ is_error: z.ZodBoolean;
683
+ duration_ms: z.ZodNumber;
684
+ duration_api_ms: z.ZodNumber;
685
+ num_turns: z.ZodNumber;
686
+ result: z.ZodString;
687
+ session_id: z.ZodOptional<z.ZodString>;
688
+ total_cost_usd: z.ZodOptional<z.ZodNumber>;
689
+ usage: z.ZodOptional<z.ZodObject<{
690
+ input_tokens: z.ZodOptional<z.ZodNumber>;
691
+ output_tokens: z.ZodOptional<z.ZodNumber>;
692
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
693
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
694
+ server_tool_use: z.ZodOptional<z.ZodObject<{
695
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
696
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
697
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
698
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
699
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
700
+ }, z.ZodTypeAny, "passthrough">>>;
701
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
702
+ input_tokens: z.ZodOptional<z.ZodNumber>;
703
+ output_tokens: z.ZodOptional<z.ZodNumber>;
704
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
705
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
706
+ server_tool_use: z.ZodOptional<z.ZodObject<{
707
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
708
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
709
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
710
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
711
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
712
+ }, z.ZodTypeAny, "passthrough">>>;
713
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
714
+ input_tokens: z.ZodOptional<z.ZodNumber>;
715
+ output_tokens: z.ZodOptional<z.ZodNumber>;
716
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
717
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
718
+ server_tool_use: z.ZodOptional<z.ZodObject<{
719
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
720
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
721
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
722
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
723
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
724
+ }, z.ZodTypeAny, "passthrough">>>;
725
+ }, z.ZodTypeAny, "passthrough">>>;
726
+ }, z.ZodTypeAny, "passthrough">>;
727
+ /**
728
+ * Log Message Schema
729
+ *
730
+ * Union of all possible message types in a Claude Code session log.
731
+ */
732
+ export declare const logMessageSchema: z.ZodUnion<[z.ZodObject<{
733
+ type: z.ZodLiteral<"system">;
734
+ subtype: z.ZodLiteral<"init">;
735
+ cwd: z.ZodString;
736
+ session_id: z.ZodString;
737
+ tools: z.ZodArray<z.ZodString, "many">;
738
+ mcp_servers: z.ZodDefault<z.ZodArray<z.ZodUnknown, "many">>;
739
+ model: z.ZodString;
740
+ permissionMode: z.ZodEnum<["bypassPermissions", "requestPermissions"]>;
741
+ apiKeySource: z.ZodString;
742
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
743
+ type: z.ZodLiteral<"system">;
744
+ subtype: z.ZodLiteral<"init">;
745
+ cwd: z.ZodString;
746
+ session_id: z.ZodString;
747
+ tools: z.ZodArray<z.ZodString, "many">;
748
+ mcp_servers: z.ZodDefault<z.ZodArray<z.ZodUnknown, "many">>;
749
+ model: z.ZodString;
750
+ permissionMode: z.ZodEnum<["bypassPermissions", "requestPermissions"]>;
751
+ apiKeySource: z.ZodString;
752
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
753
+ type: z.ZodLiteral<"system">;
754
+ subtype: z.ZodLiteral<"init">;
755
+ cwd: z.ZodString;
756
+ session_id: z.ZodString;
757
+ tools: z.ZodArray<z.ZodString, "many">;
758
+ mcp_servers: z.ZodDefault<z.ZodArray<z.ZodUnknown, "many">>;
759
+ model: z.ZodString;
760
+ permissionMode: z.ZodEnum<["bypassPermissions", "requestPermissions"]>;
761
+ apiKeySource: z.ZodString;
762
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
763
+ type: z.ZodLiteral<"assistant">;
764
+ message: z.ZodObject<{
765
+ id: z.ZodString;
766
+ type: z.ZodLiteral<"message">;
767
+ role: z.ZodLiteral<"assistant">;
768
+ model: z.ZodString;
769
+ content: z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
770
+ type: z.ZodLiteral<"tool_use">;
771
+ id: z.ZodString;
772
+ name: z.ZodString;
773
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
774
+ }, "strip", z.ZodTypeAny, {
775
+ type: "tool_use";
776
+ id: string;
777
+ name: string;
778
+ input?: Record<string, unknown> | undefined;
779
+ }, {
780
+ type: "tool_use";
781
+ id: string;
782
+ name: string;
783
+ input?: Record<string, unknown> | undefined;
784
+ }>, z.ZodObject<{
785
+ type: z.ZodLiteral<"text">;
786
+ text: z.ZodString;
787
+ }, "strip", z.ZodTypeAny, {
788
+ type: "text";
789
+ text: string;
790
+ }, {
791
+ type: "text";
792
+ text: string;
793
+ }>, z.ZodObject<{
794
+ type: z.ZodLiteral<"thinking">;
795
+ thinking: z.ZodString;
796
+ }, "strip", z.ZodTypeAny, {
797
+ type: "thinking";
798
+ thinking: string;
799
+ }, {
800
+ type: "thinking";
801
+ thinking: string;
802
+ }>, z.ZodObject<{
803
+ type: z.ZodLiteral<"tool_result">;
804
+ tool_use_id: z.ZodString;
805
+ content: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodObject<{
806
+ type: z.ZodLiteral<"text">;
807
+ text: z.ZodString;
808
+ }, "strip", z.ZodTypeAny, {
809
+ type: "text";
810
+ text: string;
811
+ }, {
812
+ type: "text";
813
+ text: string;
814
+ }>, "many">]>;
815
+ }, "strip", z.ZodTypeAny, {
816
+ type: "tool_result";
817
+ tool_use_id: string;
818
+ content: string | Record<string, unknown> | {
819
+ type: "text";
820
+ text: string;
821
+ }[];
822
+ }, {
823
+ type: "tool_result";
824
+ tool_use_id: string;
825
+ content: string | Record<string, unknown> | {
826
+ type: "text";
827
+ text: string;
828
+ }[];
829
+ }>]>, "many">, z.ZodString]>;
830
+ usage: z.ZodOptional<z.ZodObject<{
831
+ input_tokens: z.ZodNumber;
832
+ output_tokens: z.ZodNumber;
833
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
834
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
835
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
836
+ input_tokens: z.ZodNumber;
837
+ output_tokens: z.ZodNumber;
838
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
839
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
840
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
841
+ input_tokens: z.ZodNumber;
842
+ output_tokens: z.ZodNumber;
843
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
844
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
845
+ }, z.ZodTypeAny, "passthrough">>>;
846
+ stop_reason: z.ZodOptional<z.ZodNullable<z.ZodEnum<["end_turn", "max_tokens", "stop_sequence", "tool_use"]>>>;
847
+ stop_sequence: z.ZodOptional<z.ZodNullable<z.ZodString>>;
848
+ }, "strip", z.ZodTypeAny, {
849
+ type: "message";
850
+ model: string;
851
+ id: string;
852
+ content: string | ({
853
+ type: "tool_use";
854
+ id: string;
855
+ name: string;
856
+ input?: Record<string, unknown> | undefined;
857
+ } | {
858
+ type: "text";
859
+ text: string;
860
+ } | {
861
+ type: "thinking";
862
+ thinking: string;
863
+ } | {
864
+ type: "tool_result";
865
+ tool_use_id: string;
866
+ content: string | Record<string, unknown> | {
867
+ type: "text";
868
+ text: string;
869
+ }[];
870
+ })[];
871
+ role: "assistant";
872
+ usage?: z.objectOutputType<{
873
+ input_tokens: z.ZodNumber;
874
+ output_tokens: z.ZodNumber;
875
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
876
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
877
+ }, z.ZodTypeAny, "passthrough"> | undefined;
878
+ stop_sequence?: string | null | undefined;
879
+ stop_reason?: "tool_use" | "end_turn" | "max_tokens" | "stop_sequence" | null | undefined;
880
+ }, {
881
+ type: "message";
882
+ model: string;
883
+ id: string;
884
+ content: string | ({
885
+ type: "tool_use";
886
+ id: string;
887
+ name: string;
888
+ input?: Record<string, unknown> | undefined;
889
+ } | {
890
+ type: "text";
891
+ text: string;
892
+ } | {
893
+ type: "thinking";
894
+ thinking: string;
895
+ } | {
896
+ type: "tool_result";
897
+ tool_use_id: string;
898
+ content: string | Record<string, unknown> | {
899
+ type: "text";
900
+ text: string;
901
+ }[];
902
+ })[];
903
+ role: "assistant";
904
+ usage?: z.objectInputType<{
905
+ input_tokens: z.ZodNumber;
906
+ output_tokens: z.ZodNumber;
907
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
908
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
909
+ }, z.ZodTypeAny, "passthrough"> | undefined;
910
+ stop_sequence?: string | null | undefined;
911
+ stop_reason?: "tool_use" | "end_turn" | "max_tokens" | "stop_sequence" | null | undefined;
912
+ }>;
913
+ }, "strip", z.ZodTypeAny, {
914
+ type: "assistant";
915
+ message: {
916
+ type: "message";
917
+ model: string;
918
+ id: string;
919
+ content: string | ({
920
+ type: "tool_use";
921
+ id: string;
922
+ name: string;
923
+ input?: Record<string, unknown> | undefined;
924
+ } | {
925
+ type: "text";
926
+ text: string;
927
+ } | {
928
+ type: "thinking";
929
+ thinking: string;
930
+ } | {
931
+ type: "tool_result";
932
+ tool_use_id: string;
933
+ content: string | Record<string, unknown> | {
934
+ type: "text";
935
+ text: string;
936
+ }[];
937
+ })[];
938
+ role: "assistant";
939
+ usage?: z.objectOutputType<{
940
+ input_tokens: z.ZodNumber;
941
+ output_tokens: z.ZodNumber;
942
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
943
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
944
+ }, z.ZodTypeAny, "passthrough"> | undefined;
945
+ stop_sequence?: string | null | undefined;
946
+ stop_reason?: "tool_use" | "end_turn" | "max_tokens" | "stop_sequence" | null | undefined;
947
+ };
948
+ }, {
949
+ type: "assistant";
950
+ message: {
951
+ type: "message";
952
+ model: string;
953
+ id: string;
954
+ content: string | ({
955
+ type: "tool_use";
956
+ id: string;
957
+ name: string;
958
+ input?: Record<string, unknown> | undefined;
959
+ } | {
960
+ type: "text";
961
+ text: string;
962
+ } | {
963
+ type: "thinking";
964
+ thinking: string;
965
+ } | {
966
+ type: "tool_result";
967
+ tool_use_id: string;
968
+ content: string | Record<string, unknown> | {
969
+ type: "text";
970
+ text: string;
971
+ }[];
972
+ })[];
973
+ role: "assistant";
974
+ usage?: z.objectInputType<{
975
+ input_tokens: z.ZodNumber;
976
+ output_tokens: z.ZodNumber;
977
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
978
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
979
+ }, z.ZodTypeAny, "passthrough"> | undefined;
980
+ stop_sequence?: string | null | undefined;
981
+ stop_reason?: "tool_use" | "end_turn" | "max_tokens" | "stop_sequence" | null | undefined;
982
+ };
983
+ }>, z.ZodObject<{
984
+ type: z.ZodLiteral<"user">;
985
+ message: z.ZodObject<{
986
+ role: z.ZodLiteral<"user">;
987
+ content: z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
988
+ type: z.ZodLiteral<"tool_use">;
989
+ id: z.ZodString;
990
+ name: z.ZodString;
991
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
992
+ }, "strip", z.ZodTypeAny, {
993
+ type: "tool_use";
994
+ id: string;
995
+ name: string;
996
+ input?: Record<string, unknown> | undefined;
997
+ }, {
998
+ type: "tool_use";
999
+ id: string;
1000
+ name: string;
1001
+ input?: Record<string, unknown> | undefined;
1002
+ }>, z.ZodObject<{
1003
+ type: z.ZodLiteral<"text">;
1004
+ text: z.ZodString;
1005
+ }, "strip", z.ZodTypeAny, {
1006
+ type: "text";
1007
+ text: string;
1008
+ }, {
1009
+ type: "text";
1010
+ text: string;
1011
+ }>, z.ZodObject<{
1012
+ type: z.ZodLiteral<"thinking">;
1013
+ thinking: z.ZodString;
1014
+ }, "strip", z.ZodTypeAny, {
1015
+ type: "thinking";
1016
+ thinking: string;
1017
+ }, {
1018
+ type: "thinking";
1019
+ thinking: string;
1020
+ }>, z.ZodObject<{
1021
+ type: z.ZodLiteral<"tool_result">;
1022
+ tool_use_id: z.ZodString;
1023
+ content: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodObject<{
1024
+ type: z.ZodLiteral<"text">;
1025
+ text: z.ZodString;
1026
+ }, "strip", z.ZodTypeAny, {
1027
+ type: "text";
1028
+ text: string;
1029
+ }, {
1030
+ type: "text";
1031
+ text: string;
1032
+ }>, "many">]>;
1033
+ }, "strip", z.ZodTypeAny, {
1034
+ type: "tool_result";
1035
+ tool_use_id: string;
1036
+ content: string | Record<string, unknown> | {
1037
+ type: "text";
1038
+ text: string;
1039
+ }[];
1040
+ }, {
1041
+ type: "tool_result";
1042
+ tool_use_id: string;
1043
+ content: string | Record<string, unknown> | {
1044
+ type: "text";
1045
+ text: string;
1046
+ }[];
1047
+ }>]>, "many">, z.ZodString]>;
1048
+ }, "strip", z.ZodTypeAny, {
1049
+ content: string | ({
1050
+ type: "tool_use";
1051
+ id: string;
1052
+ name: string;
1053
+ input?: Record<string, unknown> | undefined;
1054
+ } | {
1055
+ type: "text";
1056
+ text: string;
1057
+ } | {
1058
+ type: "thinking";
1059
+ thinking: string;
1060
+ } | {
1061
+ type: "tool_result";
1062
+ tool_use_id: string;
1063
+ content: string | Record<string, unknown> | {
1064
+ type: "text";
1065
+ text: string;
1066
+ }[];
1067
+ })[];
1068
+ role: "user";
1069
+ }, {
1070
+ content: string | ({
1071
+ type: "tool_use";
1072
+ id: string;
1073
+ name: string;
1074
+ input?: Record<string, unknown> | undefined;
1075
+ } | {
1076
+ type: "text";
1077
+ text: string;
1078
+ } | {
1079
+ type: "thinking";
1080
+ thinking: string;
1081
+ } | {
1082
+ type: "tool_result";
1083
+ tool_use_id: string;
1084
+ content: string | Record<string, unknown> | {
1085
+ type: "text";
1086
+ text: string;
1087
+ }[];
1088
+ })[];
1089
+ role: "user";
1090
+ }>;
1091
+ }, "strip", z.ZodTypeAny, {
1092
+ type: "user";
1093
+ message: {
1094
+ content: string | ({
1095
+ type: "tool_use";
1096
+ id: string;
1097
+ name: string;
1098
+ input?: Record<string, unknown> | undefined;
1099
+ } | {
1100
+ type: "text";
1101
+ text: string;
1102
+ } | {
1103
+ type: "thinking";
1104
+ thinking: string;
1105
+ } | {
1106
+ type: "tool_result";
1107
+ tool_use_id: string;
1108
+ content: string | Record<string, unknown> | {
1109
+ type: "text";
1110
+ text: string;
1111
+ }[];
1112
+ })[];
1113
+ role: "user";
1114
+ };
1115
+ }, {
1116
+ type: "user";
1117
+ message: {
1118
+ content: string | ({
1119
+ type: "tool_use";
1120
+ id: string;
1121
+ name: string;
1122
+ input?: Record<string, unknown> | undefined;
1123
+ } | {
1124
+ type: "text";
1125
+ text: string;
1126
+ } | {
1127
+ type: "thinking";
1128
+ thinking: string;
1129
+ } | {
1130
+ type: "tool_result";
1131
+ tool_use_id: string;
1132
+ content: string | Record<string, unknown> | {
1133
+ type: "text";
1134
+ text: string;
1135
+ }[];
1136
+ })[];
1137
+ role: "user";
1138
+ };
1139
+ }>, z.ZodObject<{
1140
+ type: z.ZodLiteral<"result">;
1141
+ subtype: z.ZodEnum<["success", "error", "error_during_execution"]>;
1142
+ is_error: z.ZodBoolean;
1143
+ duration_ms: z.ZodNumber;
1144
+ duration_api_ms: z.ZodNumber;
1145
+ num_turns: z.ZodNumber;
1146
+ result: z.ZodString;
1147
+ session_id: z.ZodOptional<z.ZodString>;
1148
+ total_cost_usd: z.ZodOptional<z.ZodNumber>;
1149
+ usage: z.ZodOptional<z.ZodObject<{
1150
+ input_tokens: z.ZodOptional<z.ZodNumber>;
1151
+ output_tokens: z.ZodOptional<z.ZodNumber>;
1152
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1153
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1154
+ server_tool_use: z.ZodOptional<z.ZodObject<{
1155
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1156
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1157
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1158
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1159
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1160
+ }, z.ZodTypeAny, "passthrough">>>;
1161
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1162
+ input_tokens: z.ZodOptional<z.ZodNumber>;
1163
+ output_tokens: z.ZodOptional<z.ZodNumber>;
1164
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1165
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1166
+ server_tool_use: z.ZodOptional<z.ZodObject<{
1167
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1168
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1169
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1170
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1171
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1172
+ }, z.ZodTypeAny, "passthrough">>>;
1173
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1174
+ input_tokens: z.ZodOptional<z.ZodNumber>;
1175
+ output_tokens: z.ZodOptional<z.ZodNumber>;
1176
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1177
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1178
+ server_tool_use: z.ZodOptional<z.ZodObject<{
1179
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1180
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1181
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1182
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1183
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1184
+ }, z.ZodTypeAny, "passthrough">>>;
1185
+ }, z.ZodTypeAny, "passthrough">>>;
1186
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1187
+ type: z.ZodLiteral<"result">;
1188
+ subtype: z.ZodEnum<["success", "error", "error_during_execution"]>;
1189
+ is_error: z.ZodBoolean;
1190
+ duration_ms: z.ZodNumber;
1191
+ duration_api_ms: z.ZodNumber;
1192
+ num_turns: z.ZodNumber;
1193
+ result: z.ZodString;
1194
+ session_id: z.ZodOptional<z.ZodString>;
1195
+ total_cost_usd: z.ZodOptional<z.ZodNumber>;
1196
+ usage: z.ZodOptional<z.ZodObject<{
1197
+ input_tokens: z.ZodOptional<z.ZodNumber>;
1198
+ output_tokens: z.ZodOptional<z.ZodNumber>;
1199
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1200
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1201
+ server_tool_use: z.ZodOptional<z.ZodObject<{
1202
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1203
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1204
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1205
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1206
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1207
+ }, z.ZodTypeAny, "passthrough">>>;
1208
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1209
+ input_tokens: z.ZodOptional<z.ZodNumber>;
1210
+ output_tokens: z.ZodOptional<z.ZodNumber>;
1211
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1212
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1213
+ server_tool_use: z.ZodOptional<z.ZodObject<{
1214
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1215
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1216
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1217
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1218
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1219
+ }, z.ZodTypeAny, "passthrough">>>;
1220
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1221
+ input_tokens: z.ZodOptional<z.ZodNumber>;
1222
+ output_tokens: z.ZodOptional<z.ZodNumber>;
1223
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1224
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1225
+ server_tool_use: z.ZodOptional<z.ZodObject<{
1226
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1227
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1228
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1229
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1230
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1231
+ }, z.ZodTypeAny, "passthrough">>>;
1232
+ }, z.ZodTypeAny, "passthrough">>>;
1233
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1234
+ type: z.ZodLiteral<"result">;
1235
+ subtype: z.ZodEnum<["success", "error", "error_during_execution"]>;
1236
+ is_error: z.ZodBoolean;
1237
+ duration_ms: z.ZodNumber;
1238
+ duration_api_ms: z.ZodNumber;
1239
+ num_turns: z.ZodNumber;
1240
+ result: z.ZodString;
1241
+ session_id: z.ZodOptional<z.ZodString>;
1242
+ total_cost_usd: z.ZodOptional<z.ZodNumber>;
1243
+ usage: z.ZodOptional<z.ZodObject<{
1244
+ input_tokens: z.ZodOptional<z.ZodNumber>;
1245
+ output_tokens: z.ZodOptional<z.ZodNumber>;
1246
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1247
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1248
+ server_tool_use: z.ZodOptional<z.ZodObject<{
1249
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1250
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1251
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1252
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1253
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1254
+ }, z.ZodTypeAny, "passthrough">>>;
1255
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1256
+ input_tokens: z.ZodOptional<z.ZodNumber>;
1257
+ output_tokens: z.ZodOptional<z.ZodNumber>;
1258
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1259
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1260
+ server_tool_use: z.ZodOptional<z.ZodObject<{
1261
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1262
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1263
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1264
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1265
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1266
+ }, z.ZodTypeAny, "passthrough">>>;
1267
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1268
+ input_tokens: z.ZodOptional<z.ZodNumber>;
1269
+ output_tokens: z.ZodOptional<z.ZodNumber>;
1270
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1271
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1272
+ server_tool_use: z.ZodOptional<z.ZodObject<{
1273
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1274
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1275
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1276
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1277
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1278
+ }, z.ZodTypeAny, "passthrough">>>;
1279
+ }, z.ZodTypeAny, "passthrough">>>;
1280
+ }, z.ZodTypeAny, "passthrough">>]>;
1281
+ /**
1282
+ * Session Log Schema
1283
+ *
1284
+ * Represents a complete Claude Code session log file.
1285
+ * Each file contains an array of messages representing the full conversation.
1286
+ */
1287
+ export declare const sessionLogSchema: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1288
+ type: z.ZodLiteral<"system">;
1289
+ subtype: z.ZodLiteral<"init">;
1290
+ cwd: z.ZodString;
1291
+ session_id: z.ZodString;
1292
+ tools: z.ZodArray<z.ZodString, "many">;
1293
+ mcp_servers: z.ZodDefault<z.ZodArray<z.ZodUnknown, "many">>;
1294
+ model: z.ZodString;
1295
+ permissionMode: z.ZodEnum<["bypassPermissions", "requestPermissions"]>;
1296
+ apiKeySource: z.ZodString;
1297
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1298
+ type: z.ZodLiteral<"system">;
1299
+ subtype: z.ZodLiteral<"init">;
1300
+ cwd: z.ZodString;
1301
+ session_id: z.ZodString;
1302
+ tools: z.ZodArray<z.ZodString, "many">;
1303
+ mcp_servers: z.ZodDefault<z.ZodArray<z.ZodUnknown, "many">>;
1304
+ model: z.ZodString;
1305
+ permissionMode: z.ZodEnum<["bypassPermissions", "requestPermissions"]>;
1306
+ apiKeySource: z.ZodString;
1307
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1308
+ type: z.ZodLiteral<"system">;
1309
+ subtype: z.ZodLiteral<"init">;
1310
+ cwd: z.ZodString;
1311
+ session_id: z.ZodString;
1312
+ tools: z.ZodArray<z.ZodString, "many">;
1313
+ mcp_servers: z.ZodDefault<z.ZodArray<z.ZodUnknown, "many">>;
1314
+ model: z.ZodString;
1315
+ permissionMode: z.ZodEnum<["bypassPermissions", "requestPermissions"]>;
1316
+ apiKeySource: z.ZodString;
1317
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
1318
+ type: z.ZodLiteral<"assistant">;
1319
+ message: z.ZodObject<{
1320
+ id: z.ZodString;
1321
+ type: z.ZodLiteral<"message">;
1322
+ role: z.ZodLiteral<"assistant">;
1323
+ model: z.ZodString;
1324
+ content: z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
1325
+ type: z.ZodLiteral<"tool_use">;
1326
+ id: z.ZodString;
1327
+ name: z.ZodString;
1328
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1329
+ }, "strip", z.ZodTypeAny, {
1330
+ type: "tool_use";
1331
+ id: string;
1332
+ name: string;
1333
+ input?: Record<string, unknown> | undefined;
1334
+ }, {
1335
+ type: "tool_use";
1336
+ id: string;
1337
+ name: string;
1338
+ input?: Record<string, unknown> | undefined;
1339
+ }>, z.ZodObject<{
1340
+ type: z.ZodLiteral<"text">;
1341
+ text: z.ZodString;
1342
+ }, "strip", z.ZodTypeAny, {
1343
+ type: "text";
1344
+ text: string;
1345
+ }, {
1346
+ type: "text";
1347
+ text: string;
1348
+ }>, z.ZodObject<{
1349
+ type: z.ZodLiteral<"thinking">;
1350
+ thinking: z.ZodString;
1351
+ }, "strip", z.ZodTypeAny, {
1352
+ type: "thinking";
1353
+ thinking: string;
1354
+ }, {
1355
+ type: "thinking";
1356
+ thinking: string;
1357
+ }>, z.ZodObject<{
1358
+ type: z.ZodLiteral<"tool_result">;
1359
+ tool_use_id: z.ZodString;
1360
+ content: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodObject<{
1361
+ type: z.ZodLiteral<"text">;
1362
+ text: z.ZodString;
1363
+ }, "strip", z.ZodTypeAny, {
1364
+ type: "text";
1365
+ text: string;
1366
+ }, {
1367
+ type: "text";
1368
+ text: string;
1369
+ }>, "many">]>;
1370
+ }, "strip", z.ZodTypeAny, {
1371
+ type: "tool_result";
1372
+ tool_use_id: string;
1373
+ content: string | Record<string, unknown> | {
1374
+ type: "text";
1375
+ text: string;
1376
+ }[];
1377
+ }, {
1378
+ type: "tool_result";
1379
+ tool_use_id: string;
1380
+ content: string | Record<string, unknown> | {
1381
+ type: "text";
1382
+ text: string;
1383
+ }[];
1384
+ }>]>, "many">, z.ZodString]>;
1385
+ usage: z.ZodOptional<z.ZodObject<{
1386
+ input_tokens: z.ZodNumber;
1387
+ output_tokens: z.ZodNumber;
1388
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1389
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1390
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1391
+ input_tokens: z.ZodNumber;
1392
+ output_tokens: z.ZodNumber;
1393
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1394
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1395
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1396
+ input_tokens: z.ZodNumber;
1397
+ output_tokens: z.ZodNumber;
1398
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1399
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1400
+ }, z.ZodTypeAny, "passthrough">>>;
1401
+ stop_reason: z.ZodOptional<z.ZodNullable<z.ZodEnum<["end_turn", "max_tokens", "stop_sequence", "tool_use"]>>>;
1402
+ stop_sequence: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1403
+ }, "strip", z.ZodTypeAny, {
1404
+ type: "message";
1405
+ model: string;
1406
+ id: string;
1407
+ content: string | ({
1408
+ type: "tool_use";
1409
+ id: string;
1410
+ name: string;
1411
+ input?: Record<string, unknown> | undefined;
1412
+ } | {
1413
+ type: "text";
1414
+ text: string;
1415
+ } | {
1416
+ type: "thinking";
1417
+ thinking: string;
1418
+ } | {
1419
+ type: "tool_result";
1420
+ tool_use_id: string;
1421
+ content: string | Record<string, unknown> | {
1422
+ type: "text";
1423
+ text: string;
1424
+ }[];
1425
+ })[];
1426
+ role: "assistant";
1427
+ usage?: z.objectOutputType<{
1428
+ input_tokens: z.ZodNumber;
1429
+ output_tokens: z.ZodNumber;
1430
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1431
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1432
+ }, z.ZodTypeAny, "passthrough"> | undefined;
1433
+ stop_sequence?: string | null | undefined;
1434
+ stop_reason?: "tool_use" | "end_turn" | "max_tokens" | "stop_sequence" | null | undefined;
1435
+ }, {
1436
+ type: "message";
1437
+ model: string;
1438
+ id: string;
1439
+ content: string | ({
1440
+ type: "tool_use";
1441
+ id: string;
1442
+ name: string;
1443
+ input?: Record<string, unknown> | undefined;
1444
+ } | {
1445
+ type: "text";
1446
+ text: string;
1447
+ } | {
1448
+ type: "thinking";
1449
+ thinking: string;
1450
+ } | {
1451
+ type: "tool_result";
1452
+ tool_use_id: string;
1453
+ content: string | Record<string, unknown> | {
1454
+ type: "text";
1455
+ text: string;
1456
+ }[];
1457
+ })[];
1458
+ role: "assistant";
1459
+ usage?: z.objectInputType<{
1460
+ input_tokens: z.ZodNumber;
1461
+ output_tokens: z.ZodNumber;
1462
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1463
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1464
+ }, z.ZodTypeAny, "passthrough"> | undefined;
1465
+ stop_sequence?: string | null | undefined;
1466
+ stop_reason?: "tool_use" | "end_turn" | "max_tokens" | "stop_sequence" | null | undefined;
1467
+ }>;
1468
+ }, "strip", z.ZodTypeAny, {
1469
+ type: "assistant";
1470
+ message: {
1471
+ type: "message";
1472
+ model: string;
1473
+ id: string;
1474
+ content: string | ({
1475
+ type: "tool_use";
1476
+ id: string;
1477
+ name: string;
1478
+ input?: Record<string, unknown> | undefined;
1479
+ } | {
1480
+ type: "text";
1481
+ text: string;
1482
+ } | {
1483
+ type: "thinking";
1484
+ thinking: string;
1485
+ } | {
1486
+ type: "tool_result";
1487
+ tool_use_id: string;
1488
+ content: string | Record<string, unknown> | {
1489
+ type: "text";
1490
+ text: string;
1491
+ }[];
1492
+ })[];
1493
+ role: "assistant";
1494
+ usage?: z.objectOutputType<{
1495
+ input_tokens: z.ZodNumber;
1496
+ output_tokens: z.ZodNumber;
1497
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1498
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1499
+ }, z.ZodTypeAny, "passthrough"> | undefined;
1500
+ stop_sequence?: string | null | undefined;
1501
+ stop_reason?: "tool_use" | "end_turn" | "max_tokens" | "stop_sequence" | null | undefined;
1502
+ };
1503
+ }, {
1504
+ type: "assistant";
1505
+ message: {
1506
+ type: "message";
1507
+ model: string;
1508
+ id: string;
1509
+ content: string | ({
1510
+ type: "tool_use";
1511
+ id: string;
1512
+ name: string;
1513
+ input?: Record<string, unknown> | undefined;
1514
+ } | {
1515
+ type: "text";
1516
+ text: string;
1517
+ } | {
1518
+ type: "thinking";
1519
+ thinking: string;
1520
+ } | {
1521
+ type: "tool_result";
1522
+ tool_use_id: string;
1523
+ content: string | Record<string, unknown> | {
1524
+ type: "text";
1525
+ text: string;
1526
+ }[];
1527
+ })[];
1528
+ role: "assistant";
1529
+ usage?: z.objectInputType<{
1530
+ input_tokens: z.ZodNumber;
1531
+ output_tokens: z.ZodNumber;
1532
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1533
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1534
+ }, z.ZodTypeAny, "passthrough"> | undefined;
1535
+ stop_sequence?: string | null | undefined;
1536
+ stop_reason?: "tool_use" | "end_turn" | "max_tokens" | "stop_sequence" | null | undefined;
1537
+ };
1538
+ }>, z.ZodObject<{
1539
+ type: z.ZodLiteral<"user">;
1540
+ message: z.ZodObject<{
1541
+ role: z.ZodLiteral<"user">;
1542
+ content: z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
1543
+ type: z.ZodLiteral<"tool_use">;
1544
+ id: z.ZodString;
1545
+ name: z.ZodString;
1546
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1547
+ }, "strip", z.ZodTypeAny, {
1548
+ type: "tool_use";
1549
+ id: string;
1550
+ name: string;
1551
+ input?: Record<string, unknown> | undefined;
1552
+ }, {
1553
+ type: "tool_use";
1554
+ id: string;
1555
+ name: string;
1556
+ input?: Record<string, unknown> | undefined;
1557
+ }>, z.ZodObject<{
1558
+ type: z.ZodLiteral<"text">;
1559
+ text: z.ZodString;
1560
+ }, "strip", z.ZodTypeAny, {
1561
+ type: "text";
1562
+ text: string;
1563
+ }, {
1564
+ type: "text";
1565
+ text: string;
1566
+ }>, z.ZodObject<{
1567
+ type: z.ZodLiteral<"thinking">;
1568
+ thinking: z.ZodString;
1569
+ }, "strip", z.ZodTypeAny, {
1570
+ type: "thinking";
1571
+ thinking: string;
1572
+ }, {
1573
+ type: "thinking";
1574
+ thinking: string;
1575
+ }>, z.ZodObject<{
1576
+ type: z.ZodLiteral<"tool_result">;
1577
+ tool_use_id: z.ZodString;
1578
+ content: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodObject<{
1579
+ type: z.ZodLiteral<"text">;
1580
+ text: z.ZodString;
1581
+ }, "strip", z.ZodTypeAny, {
1582
+ type: "text";
1583
+ text: string;
1584
+ }, {
1585
+ type: "text";
1586
+ text: string;
1587
+ }>, "many">]>;
1588
+ }, "strip", z.ZodTypeAny, {
1589
+ type: "tool_result";
1590
+ tool_use_id: string;
1591
+ content: string | Record<string, unknown> | {
1592
+ type: "text";
1593
+ text: string;
1594
+ }[];
1595
+ }, {
1596
+ type: "tool_result";
1597
+ tool_use_id: string;
1598
+ content: string | Record<string, unknown> | {
1599
+ type: "text";
1600
+ text: string;
1601
+ }[];
1602
+ }>]>, "many">, z.ZodString]>;
1603
+ }, "strip", z.ZodTypeAny, {
1604
+ content: string | ({
1605
+ type: "tool_use";
1606
+ id: string;
1607
+ name: string;
1608
+ input?: Record<string, unknown> | undefined;
1609
+ } | {
1610
+ type: "text";
1611
+ text: string;
1612
+ } | {
1613
+ type: "thinking";
1614
+ thinking: string;
1615
+ } | {
1616
+ type: "tool_result";
1617
+ tool_use_id: string;
1618
+ content: string | Record<string, unknown> | {
1619
+ type: "text";
1620
+ text: string;
1621
+ }[];
1622
+ })[];
1623
+ role: "user";
1624
+ }, {
1625
+ content: string | ({
1626
+ type: "tool_use";
1627
+ id: string;
1628
+ name: string;
1629
+ input?: Record<string, unknown> | undefined;
1630
+ } | {
1631
+ type: "text";
1632
+ text: string;
1633
+ } | {
1634
+ type: "thinking";
1635
+ thinking: string;
1636
+ } | {
1637
+ type: "tool_result";
1638
+ tool_use_id: string;
1639
+ content: string | Record<string, unknown> | {
1640
+ type: "text";
1641
+ text: string;
1642
+ }[];
1643
+ })[];
1644
+ role: "user";
1645
+ }>;
1646
+ }, "strip", z.ZodTypeAny, {
1647
+ type: "user";
1648
+ message: {
1649
+ content: string | ({
1650
+ type: "tool_use";
1651
+ id: string;
1652
+ name: string;
1653
+ input?: Record<string, unknown> | undefined;
1654
+ } | {
1655
+ type: "text";
1656
+ text: string;
1657
+ } | {
1658
+ type: "thinking";
1659
+ thinking: string;
1660
+ } | {
1661
+ type: "tool_result";
1662
+ tool_use_id: string;
1663
+ content: string | Record<string, unknown> | {
1664
+ type: "text";
1665
+ text: string;
1666
+ }[];
1667
+ })[];
1668
+ role: "user";
1669
+ };
1670
+ }, {
1671
+ type: "user";
1672
+ message: {
1673
+ content: string | ({
1674
+ type: "tool_use";
1675
+ id: string;
1676
+ name: string;
1677
+ input?: Record<string, unknown> | undefined;
1678
+ } | {
1679
+ type: "text";
1680
+ text: string;
1681
+ } | {
1682
+ type: "thinking";
1683
+ thinking: string;
1684
+ } | {
1685
+ type: "tool_result";
1686
+ tool_use_id: string;
1687
+ content: string | Record<string, unknown> | {
1688
+ type: "text";
1689
+ text: string;
1690
+ }[];
1691
+ })[];
1692
+ role: "user";
1693
+ };
1694
+ }>, z.ZodObject<{
1695
+ type: z.ZodLiteral<"result">;
1696
+ subtype: z.ZodEnum<["success", "error", "error_during_execution"]>;
1697
+ is_error: z.ZodBoolean;
1698
+ duration_ms: z.ZodNumber;
1699
+ duration_api_ms: z.ZodNumber;
1700
+ num_turns: z.ZodNumber;
1701
+ result: z.ZodString;
1702
+ session_id: z.ZodOptional<z.ZodString>;
1703
+ total_cost_usd: z.ZodOptional<z.ZodNumber>;
1704
+ usage: z.ZodOptional<z.ZodObject<{
1705
+ input_tokens: z.ZodOptional<z.ZodNumber>;
1706
+ output_tokens: z.ZodOptional<z.ZodNumber>;
1707
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1708
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1709
+ server_tool_use: z.ZodOptional<z.ZodObject<{
1710
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1711
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1712
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1713
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1714
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1715
+ }, z.ZodTypeAny, "passthrough">>>;
1716
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1717
+ input_tokens: z.ZodOptional<z.ZodNumber>;
1718
+ output_tokens: z.ZodOptional<z.ZodNumber>;
1719
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1720
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1721
+ server_tool_use: z.ZodOptional<z.ZodObject<{
1722
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1723
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1724
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1725
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1726
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1727
+ }, z.ZodTypeAny, "passthrough">>>;
1728
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1729
+ input_tokens: z.ZodOptional<z.ZodNumber>;
1730
+ output_tokens: z.ZodOptional<z.ZodNumber>;
1731
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1732
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1733
+ server_tool_use: z.ZodOptional<z.ZodObject<{
1734
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1735
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1736
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1737
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1738
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1739
+ }, z.ZodTypeAny, "passthrough">>>;
1740
+ }, z.ZodTypeAny, "passthrough">>>;
1741
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1742
+ type: z.ZodLiteral<"result">;
1743
+ subtype: z.ZodEnum<["success", "error", "error_during_execution"]>;
1744
+ is_error: z.ZodBoolean;
1745
+ duration_ms: z.ZodNumber;
1746
+ duration_api_ms: z.ZodNumber;
1747
+ num_turns: z.ZodNumber;
1748
+ result: z.ZodString;
1749
+ session_id: z.ZodOptional<z.ZodString>;
1750
+ total_cost_usd: z.ZodOptional<z.ZodNumber>;
1751
+ usage: z.ZodOptional<z.ZodObject<{
1752
+ input_tokens: z.ZodOptional<z.ZodNumber>;
1753
+ output_tokens: z.ZodOptional<z.ZodNumber>;
1754
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1755
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1756
+ server_tool_use: z.ZodOptional<z.ZodObject<{
1757
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1758
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1759
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1760
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1761
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1762
+ }, z.ZodTypeAny, "passthrough">>>;
1763
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1764
+ input_tokens: z.ZodOptional<z.ZodNumber>;
1765
+ output_tokens: z.ZodOptional<z.ZodNumber>;
1766
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1767
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1768
+ server_tool_use: z.ZodOptional<z.ZodObject<{
1769
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1770
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1771
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1772
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1773
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1774
+ }, z.ZodTypeAny, "passthrough">>>;
1775
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1776
+ input_tokens: z.ZodOptional<z.ZodNumber>;
1777
+ output_tokens: z.ZodOptional<z.ZodNumber>;
1778
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1779
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1780
+ server_tool_use: z.ZodOptional<z.ZodObject<{
1781
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1782
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1783
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1784
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1785
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1786
+ }, z.ZodTypeAny, "passthrough">>>;
1787
+ }, z.ZodTypeAny, "passthrough">>>;
1788
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1789
+ type: z.ZodLiteral<"result">;
1790
+ subtype: z.ZodEnum<["success", "error", "error_during_execution"]>;
1791
+ is_error: z.ZodBoolean;
1792
+ duration_ms: z.ZodNumber;
1793
+ duration_api_ms: z.ZodNumber;
1794
+ num_turns: z.ZodNumber;
1795
+ result: z.ZodString;
1796
+ session_id: z.ZodOptional<z.ZodString>;
1797
+ total_cost_usd: z.ZodOptional<z.ZodNumber>;
1798
+ usage: z.ZodOptional<z.ZodObject<{
1799
+ input_tokens: z.ZodOptional<z.ZodNumber>;
1800
+ output_tokens: z.ZodOptional<z.ZodNumber>;
1801
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1802
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1803
+ server_tool_use: z.ZodOptional<z.ZodObject<{
1804
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1805
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1806
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1807
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1808
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1809
+ }, z.ZodTypeAny, "passthrough">>>;
1810
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1811
+ input_tokens: z.ZodOptional<z.ZodNumber>;
1812
+ output_tokens: z.ZodOptional<z.ZodNumber>;
1813
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1814
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1815
+ server_tool_use: z.ZodOptional<z.ZodObject<{
1816
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1817
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1818
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1819
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1820
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1821
+ }, z.ZodTypeAny, "passthrough">>>;
1822
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1823
+ input_tokens: z.ZodOptional<z.ZodNumber>;
1824
+ output_tokens: z.ZodOptional<z.ZodNumber>;
1825
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
1826
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
1827
+ server_tool_use: z.ZodOptional<z.ZodObject<{
1828
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1829
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1830
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1831
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1832
+ web_search_requests: z.ZodOptional<z.ZodNumber>;
1833
+ }, z.ZodTypeAny, "passthrough">>>;
1834
+ }, z.ZodTypeAny, "passthrough">>>;
1835
+ }, z.ZodTypeAny, "passthrough">>]>, "many">;
1836
+ /**
1837
+ * Session Metadata Schema
1838
+ *
1839
+ * Extracted metadata from a session log for analysis purposes.
1840
+ */
1841
+ export declare const sessionMetadataSchema: z.ZodObject<{
1842
+ filename: z.ZodString;
1843
+ session_id: z.ZodString;
1844
+ total_messages: z.ZodNumber;
1845
+ message_type_counts: z.ZodRecord<z.ZodString, z.ZodNumber>;
1846
+ tools_used: z.ZodArray<z.ZodString, "many">;
1847
+ tool_use_count: z.ZodNumber;
1848
+ duration_ms: z.ZodOptional<z.ZodNumber>;
1849
+ duration_api_ms: z.ZodOptional<z.ZodNumber>;
1850
+ num_turns: z.ZodOptional<z.ZodNumber>;
1851
+ success: z.ZodOptional<z.ZodBoolean>;
1852
+ cwd: z.ZodString;
1853
+ model: z.ZodString;
1854
+ }, "strip", z.ZodTypeAny, {
1855
+ cwd: string;
1856
+ session_id: string;
1857
+ model: string;
1858
+ filename: string;
1859
+ total_messages: number;
1860
+ message_type_counts: Record<string, number>;
1861
+ tools_used: string[];
1862
+ tool_use_count: number;
1863
+ success?: boolean | undefined;
1864
+ duration_ms?: number | undefined;
1865
+ duration_api_ms?: number | undefined;
1866
+ num_turns?: number | undefined;
1867
+ }, {
1868
+ cwd: string;
1869
+ session_id: string;
1870
+ model: string;
1871
+ filename: string;
1872
+ total_messages: number;
1873
+ message_type_counts: Record<string, number>;
1874
+ tools_used: string[];
1875
+ tool_use_count: number;
1876
+ success?: boolean | undefined;
1877
+ duration_ms?: number | undefined;
1878
+ duration_api_ms?: number | undefined;
1879
+ num_turns?: number | undefined;
1880
+ }>;
1881
+ /**
1882
+ * Cache control configuration for message content
1883
+ */
1884
+ declare const cacheControlSchema: z.ZodObject<{
1885
+ type: z.ZodLiteral<"ephemeral">;
1886
+ }, "strip", z.ZodTypeAny, {
1887
+ type: "ephemeral";
1888
+ }, {
1889
+ type: "ephemeral";
1890
+ }>;
1891
+ /**
1892
+ * API request message content with cache control
1893
+ */
1894
+ declare const apiMessageContentSchema: z.ZodUnion<[z.ZodObject<{
1895
+ type: z.ZodLiteral<"text">;
1896
+ text: z.ZodString;
1897
+ cache_control: z.ZodOptional<z.ZodObject<{
1898
+ type: z.ZodLiteral<"ephemeral">;
1899
+ }, "strip", z.ZodTypeAny, {
1900
+ type: "ephemeral";
1901
+ }, {
1902
+ type: "ephemeral";
1903
+ }>>;
1904
+ }, "strip", z.ZodTypeAny, {
1905
+ type: "text";
1906
+ text: string;
1907
+ cache_control?: {
1908
+ type: "ephemeral";
1909
+ } | undefined;
1910
+ }, {
1911
+ type: "text";
1912
+ text: string;
1913
+ cache_control?: {
1914
+ type: "ephemeral";
1915
+ } | undefined;
1916
+ }>, z.ZodObject<{
1917
+ type: z.ZodLiteral<"tool_use">;
1918
+ id: z.ZodString;
1919
+ name: z.ZodString;
1920
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1921
+ cache_control: z.ZodOptional<z.ZodObject<{
1922
+ type: z.ZodLiteral<"ephemeral">;
1923
+ }, "strip", z.ZodTypeAny, {
1924
+ type: "ephemeral";
1925
+ }, {
1926
+ type: "ephemeral";
1927
+ }>>;
1928
+ }, "strip", z.ZodTypeAny, {
1929
+ type: "tool_use";
1930
+ id: string;
1931
+ name: string;
1932
+ input?: Record<string, unknown> | undefined;
1933
+ cache_control?: {
1934
+ type: "ephemeral";
1935
+ } | undefined;
1936
+ }, {
1937
+ type: "tool_use";
1938
+ id: string;
1939
+ name: string;
1940
+ input?: Record<string, unknown> | undefined;
1941
+ cache_control?: {
1942
+ type: "ephemeral";
1943
+ } | undefined;
1944
+ }>, z.ZodObject<{
1945
+ type: z.ZodLiteral<"tool_result">;
1946
+ tool_use_id: z.ZodString;
1947
+ content: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
1948
+ cache_control: z.ZodOptional<z.ZodObject<{
1949
+ type: z.ZodLiteral<"ephemeral">;
1950
+ }, "strip", z.ZodTypeAny, {
1951
+ type: "ephemeral";
1952
+ }, {
1953
+ type: "ephemeral";
1954
+ }>>;
1955
+ }, "strip", z.ZodTypeAny, {
1956
+ type: "tool_result";
1957
+ tool_use_id: string;
1958
+ content: string | Record<string, unknown>;
1959
+ cache_control?: {
1960
+ type: "ephemeral";
1961
+ } | undefined;
1962
+ }, {
1963
+ type: "tool_result";
1964
+ tool_use_id: string;
1965
+ content: string | Record<string, unknown>;
1966
+ cache_control?: {
1967
+ type: "ephemeral";
1968
+ } | undefined;
1969
+ }>]>;
1970
+ /**
1971
+ * API request message schema
1972
+ */
1973
+ declare const apiMessageSchema: z.ZodObject<{
1974
+ role: z.ZodEnum<["user", "assistant", "system"]>;
1975
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
1976
+ type: z.ZodLiteral<"text">;
1977
+ text: z.ZodString;
1978
+ cache_control: z.ZodOptional<z.ZodObject<{
1979
+ type: z.ZodLiteral<"ephemeral">;
1980
+ }, "strip", z.ZodTypeAny, {
1981
+ type: "ephemeral";
1982
+ }, {
1983
+ type: "ephemeral";
1984
+ }>>;
1985
+ }, "strip", z.ZodTypeAny, {
1986
+ type: "text";
1987
+ text: string;
1988
+ cache_control?: {
1989
+ type: "ephemeral";
1990
+ } | undefined;
1991
+ }, {
1992
+ type: "text";
1993
+ text: string;
1994
+ cache_control?: {
1995
+ type: "ephemeral";
1996
+ } | undefined;
1997
+ }>, z.ZodObject<{
1998
+ type: z.ZodLiteral<"tool_use">;
1999
+ id: z.ZodString;
2000
+ name: z.ZodString;
2001
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2002
+ cache_control: z.ZodOptional<z.ZodObject<{
2003
+ type: z.ZodLiteral<"ephemeral">;
2004
+ }, "strip", z.ZodTypeAny, {
2005
+ type: "ephemeral";
2006
+ }, {
2007
+ type: "ephemeral";
2008
+ }>>;
2009
+ }, "strip", z.ZodTypeAny, {
2010
+ type: "tool_use";
2011
+ id: string;
2012
+ name: string;
2013
+ input?: Record<string, unknown> | undefined;
2014
+ cache_control?: {
2015
+ type: "ephemeral";
2016
+ } | undefined;
2017
+ }, {
2018
+ type: "tool_use";
2019
+ id: string;
2020
+ name: string;
2021
+ input?: Record<string, unknown> | undefined;
2022
+ cache_control?: {
2023
+ type: "ephemeral";
2024
+ } | undefined;
2025
+ }>, z.ZodObject<{
2026
+ type: z.ZodLiteral<"tool_result">;
2027
+ tool_use_id: z.ZodString;
2028
+ content: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
2029
+ cache_control: z.ZodOptional<z.ZodObject<{
2030
+ type: z.ZodLiteral<"ephemeral">;
2031
+ }, "strip", z.ZodTypeAny, {
2032
+ type: "ephemeral";
2033
+ }, {
2034
+ type: "ephemeral";
2035
+ }>>;
2036
+ }, "strip", z.ZodTypeAny, {
2037
+ type: "tool_result";
2038
+ tool_use_id: string;
2039
+ content: string | Record<string, unknown>;
2040
+ cache_control?: {
2041
+ type: "ephemeral";
2042
+ } | undefined;
2043
+ }, {
2044
+ type: "tool_result";
2045
+ tool_use_id: string;
2046
+ content: string | Record<string, unknown>;
2047
+ cache_control?: {
2048
+ type: "ephemeral";
2049
+ } | undefined;
2050
+ }>]>, "many">]>;
2051
+ }, "strip", z.ZodTypeAny, {
2052
+ content: string | ({
2053
+ type: "text";
2054
+ text: string;
2055
+ cache_control?: {
2056
+ type: "ephemeral";
2057
+ } | undefined;
2058
+ } | {
2059
+ type: "tool_use";
2060
+ id: string;
2061
+ name: string;
2062
+ input?: Record<string, unknown> | undefined;
2063
+ cache_control?: {
2064
+ type: "ephemeral";
2065
+ } | undefined;
2066
+ } | {
2067
+ type: "tool_result";
2068
+ tool_use_id: string;
2069
+ content: string | Record<string, unknown>;
2070
+ cache_control?: {
2071
+ type: "ephemeral";
2072
+ } | undefined;
2073
+ })[];
2074
+ role: "system" | "assistant" | "user";
2075
+ }, {
2076
+ content: string | ({
2077
+ type: "text";
2078
+ text: string;
2079
+ cache_control?: {
2080
+ type: "ephemeral";
2081
+ } | undefined;
2082
+ } | {
2083
+ type: "tool_use";
2084
+ id: string;
2085
+ name: string;
2086
+ input?: Record<string, unknown> | undefined;
2087
+ cache_control?: {
2088
+ type: "ephemeral";
2089
+ } | undefined;
2090
+ } | {
2091
+ type: "tool_result";
2092
+ tool_use_id: string;
2093
+ content: string | Record<string, unknown>;
2094
+ cache_control?: {
2095
+ type: "ephemeral";
2096
+ } | undefined;
2097
+ })[];
2098
+ role: "system" | "assistant" | "user";
2099
+ }>;
2100
+ /**
2101
+ * API request system message schema
2102
+ */
2103
+ declare const apiSystemMessageSchema: z.ZodObject<{
2104
+ type: z.ZodLiteral<"text">;
2105
+ text: z.ZodString;
2106
+ cache_control: z.ZodOptional<z.ZodObject<{
2107
+ type: z.ZodLiteral<"ephemeral">;
2108
+ }, "strip", z.ZodTypeAny, {
2109
+ type: "ephemeral";
2110
+ }, {
2111
+ type: "ephemeral";
2112
+ }>>;
2113
+ }, "strip", z.ZodTypeAny, {
2114
+ type: "text";
2115
+ text: string;
2116
+ cache_control?: {
2117
+ type: "ephemeral";
2118
+ } | undefined;
2119
+ }, {
2120
+ type: "text";
2121
+ text: string;
2122
+ cache_control?: {
2123
+ type: "ephemeral";
2124
+ } | undefined;
2125
+ }>;
2126
+ /**
2127
+ * Tool definition schema for API requests
2128
+ */
2129
+ declare const apiToolSchema: z.ZodObject<{
2130
+ name: z.ZodString;
2131
+ description: z.ZodString;
2132
+ input_schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2133
+ }, "strip", z.ZodTypeAny, {
2134
+ name: string;
2135
+ description: string;
2136
+ input_schema: Record<string, unknown>;
2137
+ }, {
2138
+ name: string;
2139
+ description: string;
2140
+ input_schema: Record<string, unknown>;
2141
+ }>;
2142
+ /**
2143
+ * Claude API request payload schema
2144
+ */
2145
+ export declare const claudeApiRequestSchema: z.ZodObject<{
2146
+ model: z.ZodString;
2147
+ messages: z.ZodArray<z.ZodObject<{
2148
+ role: z.ZodEnum<["user", "assistant", "system"]>;
2149
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
2150
+ type: z.ZodLiteral<"text">;
2151
+ text: z.ZodString;
2152
+ cache_control: z.ZodOptional<z.ZodObject<{
2153
+ type: z.ZodLiteral<"ephemeral">;
2154
+ }, "strip", z.ZodTypeAny, {
2155
+ type: "ephemeral";
2156
+ }, {
2157
+ type: "ephemeral";
2158
+ }>>;
2159
+ }, "strip", z.ZodTypeAny, {
2160
+ type: "text";
2161
+ text: string;
2162
+ cache_control?: {
2163
+ type: "ephemeral";
2164
+ } | undefined;
2165
+ }, {
2166
+ type: "text";
2167
+ text: string;
2168
+ cache_control?: {
2169
+ type: "ephemeral";
2170
+ } | undefined;
2171
+ }>, z.ZodObject<{
2172
+ type: z.ZodLiteral<"tool_use">;
2173
+ id: z.ZodString;
2174
+ name: z.ZodString;
2175
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2176
+ cache_control: z.ZodOptional<z.ZodObject<{
2177
+ type: z.ZodLiteral<"ephemeral">;
2178
+ }, "strip", z.ZodTypeAny, {
2179
+ type: "ephemeral";
2180
+ }, {
2181
+ type: "ephemeral";
2182
+ }>>;
2183
+ }, "strip", z.ZodTypeAny, {
2184
+ type: "tool_use";
2185
+ id: string;
2186
+ name: string;
2187
+ input?: Record<string, unknown> | undefined;
2188
+ cache_control?: {
2189
+ type: "ephemeral";
2190
+ } | undefined;
2191
+ }, {
2192
+ type: "tool_use";
2193
+ id: string;
2194
+ name: string;
2195
+ input?: Record<string, unknown> | undefined;
2196
+ cache_control?: {
2197
+ type: "ephemeral";
2198
+ } | undefined;
2199
+ }>, z.ZodObject<{
2200
+ type: z.ZodLiteral<"tool_result">;
2201
+ tool_use_id: z.ZodString;
2202
+ content: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
2203
+ cache_control: z.ZodOptional<z.ZodObject<{
2204
+ type: z.ZodLiteral<"ephemeral">;
2205
+ }, "strip", z.ZodTypeAny, {
2206
+ type: "ephemeral";
2207
+ }, {
2208
+ type: "ephemeral";
2209
+ }>>;
2210
+ }, "strip", z.ZodTypeAny, {
2211
+ type: "tool_result";
2212
+ tool_use_id: string;
2213
+ content: string | Record<string, unknown>;
2214
+ cache_control?: {
2215
+ type: "ephemeral";
2216
+ } | undefined;
2217
+ }, {
2218
+ type: "tool_result";
2219
+ tool_use_id: string;
2220
+ content: string | Record<string, unknown>;
2221
+ cache_control?: {
2222
+ type: "ephemeral";
2223
+ } | undefined;
2224
+ }>]>, "many">]>;
2225
+ }, "strip", z.ZodTypeAny, {
2226
+ content: string | ({
2227
+ type: "text";
2228
+ text: string;
2229
+ cache_control?: {
2230
+ type: "ephemeral";
2231
+ } | undefined;
2232
+ } | {
2233
+ type: "tool_use";
2234
+ id: string;
2235
+ name: string;
2236
+ input?: Record<string, unknown> | undefined;
2237
+ cache_control?: {
2238
+ type: "ephemeral";
2239
+ } | undefined;
2240
+ } | {
2241
+ type: "tool_result";
2242
+ tool_use_id: string;
2243
+ content: string | Record<string, unknown>;
2244
+ cache_control?: {
2245
+ type: "ephemeral";
2246
+ } | undefined;
2247
+ })[];
2248
+ role: "system" | "assistant" | "user";
2249
+ }, {
2250
+ content: string | ({
2251
+ type: "text";
2252
+ text: string;
2253
+ cache_control?: {
2254
+ type: "ephemeral";
2255
+ } | undefined;
2256
+ } | {
2257
+ type: "tool_use";
2258
+ id: string;
2259
+ name: string;
2260
+ input?: Record<string, unknown> | undefined;
2261
+ cache_control?: {
2262
+ type: "ephemeral";
2263
+ } | undefined;
2264
+ } | {
2265
+ type: "tool_result";
2266
+ tool_use_id: string;
2267
+ content: string | Record<string, unknown>;
2268
+ cache_control?: {
2269
+ type: "ephemeral";
2270
+ } | undefined;
2271
+ })[];
2272
+ role: "system" | "assistant" | "user";
2273
+ }>, "many">;
2274
+ temperature: z.ZodOptional<z.ZodNumber>;
2275
+ system: z.ZodOptional<z.ZodArray<z.ZodObject<{
2276
+ type: z.ZodLiteral<"text">;
2277
+ text: z.ZodString;
2278
+ cache_control: z.ZodOptional<z.ZodObject<{
2279
+ type: z.ZodLiteral<"ephemeral">;
2280
+ }, "strip", z.ZodTypeAny, {
2281
+ type: "ephemeral";
2282
+ }, {
2283
+ type: "ephemeral";
2284
+ }>>;
2285
+ }, "strip", z.ZodTypeAny, {
2286
+ type: "text";
2287
+ text: string;
2288
+ cache_control?: {
2289
+ type: "ephemeral";
2290
+ } | undefined;
2291
+ }, {
2292
+ type: "text";
2293
+ text: string;
2294
+ cache_control?: {
2295
+ type: "ephemeral";
2296
+ } | undefined;
2297
+ }>, "many">>;
2298
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
2299
+ name: z.ZodString;
2300
+ description: z.ZodString;
2301
+ input_schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2302
+ }, "strip", z.ZodTypeAny, {
2303
+ name: string;
2304
+ description: string;
2305
+ input_schema: Record<string, unknown>;
2306
+ }, {
2307
+ name: string;
2308
+ description: string;
2309
+ input_schema: Record<string, unknown>;
2310
+ }>, "many">>;
2311
+ metadata: z.ZodOptional<z.ZodObject<{
2312
+ user_id: z.ZodString;
2313
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2314
+ user_id: z.ZodString;
2315
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2316
+ user_id: z.ZodString;
2317
+ }, z.ZodTypeAny, "passthrough">>>;
2318
+ max_tokens: z.ZodOptional<z.ZodNumber>;
2319
+ stream: z.ZodOptional<z.ZodBoolean>;
2320
+ }, "strip", z.ZodTypeAny, {
2321
+ model: string;
2322
+ messages: {
2323
+ content: string | ({
2324
+ type: "text";
2325
+ text: string;
2326
+ cache_control?: {
2327
+ type: "ephemeral";
2328
+ } | undefined;
2329
+ } | {
2330
+ type: "tool_use";
2331
+ id: string;
2332
+ name: string;
2333
+ input?: Record<string, unknown> | undefined;
2334
+ cache_control?: {
2335
+ type: "ephemeral";
2336
+ } | undefined;
2337
+ } | {
2338
+ type: "tool_result";
2339
+ tool_use_id: string;
2340
+ content: string | Record<string, unknown>;
2341
+ cache_control?: {
2342
+ type: "ephemeral";
2343
+ } | undefined;
2344
+ })[];
2345
+ role: "system" | "assistant" | "user";
2346
+ }[];
2347
+ system?: {
2348
+ type: "text";
2349
+ text: string;
2350
+ cache_control?: {
2351
+ type: "ephemeral";
2352
+ } | undefined;
2353
+ }[] | undefined;
2354
+ tools?: {
2355
+ name: string;
2356
+ description: string;
2357
+ input_schema: Record<string, unknown>;
2358
+ }[] | undefined;
2359
+ max_tokens?: number | undefined;
2360
+ temperature?: number | undefined;
2361
+ metadata?: z.objectOutputType<{
2362
+ user_id: z.ZodString;
2363
+ }, z.ZodTypeAny, "passthrough"> | undefined;
2364
+ stream?: boolean | undefined;
2365
+ }, {
2366
+ model: string;
2367
+ messages: {
2368
+ content: string | ({
2369
+ type: "text";
2370
+ text: string;
2371
+ cache_control?: {
2372
+ type: "ephemeral";
2373
+ } | undefined;
2374
+ } | {
2375
+ type: "tool_use";
2376
+ id: string;
2377
+ name: string;
2378
+ input?: Record<string, unknown> | undefined;
2379
+ cache_control?: {
2380
+ type: "ephemeral";
2381
+ } | undefined;
2382
+ } | {
2383
+ type: "tool_result";
2384
+ tool_use_id: string;
2385
+ content: string | Record<string, unknown>;
2386
+ cache_control?: {
2387
+ type: "ephemeral";
2388
+ } | undefined;
2389
+ })[];
2390
+ role: "system" | "assistant" | "user";
2391
+ }[];
2392
+ system?: {
2393
+ type: "text";
2394
+ text: string;
2395
+ cache_control?: {
2396
+ type: "ephemeral";
2397
+ } | undefined;
2398
+ }[] | undefined;
2399
+ tools?: {
2400
+ name: string;
2401
+ description: string;
2402
+ input_schema: Record<string, unknown>;
2403
+ }[] | undefined;
2404
+ max_tokens?: number | undefined;
2405
+ temperature?: number | undefined;
2406
+ metadata?: z.objectInputType<{
2407
+ user_id: z.ZodString;
2408
+ }, z.ZodTypeAny, "passthrough"> | undefined;
2409
+ stream?: boolean | undefined;
2410
+ }>;
2411
+ export type SystemMessage = z.infer<typeof systemMessageSchema>;
2412
+ export type AssistantMessage = z.infer<typeof assistantMessageSchema>;
2413
+ export type UserMessage = z.infer<typeof userMessageSchema>;
2414
+ export type ResultMessage = z.infer<typeof resultMessageSchema>;
2415
+ export type LogMessage = z.infer<typeof logMessageSchema>;
2416
+ export type SessionLog = z.infer<typeof sessionLogSchema>;
2417
+ export type SessionMetadata = z.infer<typeof sessionMetadataSchema>;
2418
+ export type ToolName = z.infer<typeof toolNameSchema>;
2419
+ export type MessageContent = z.infer<typeof messageContentSchema>;
2420
+ export type ToolUseContent = z.infer<typeof toolUseContentSchema>;
2421
+ export type TextContent = z.infer<typeof textContentSchema>;
2422
+ export type ThinkingContent = z.infer<typeof thinkingContentSchema>;
2423
+ export type ToolResultContent = z.infer<typeof toolResultContentSchema>;
2424
+ export type ClaudeApiRequest = z.infer<typeof claudeApiRequestSchema>;
2425
+ export type ApiMessage = z.infer<typeof apiMessageSchema>;
2426
+ export type ApiMessageContent = z.infer<typeof apiMessageContentSchema>;
2427
+ export type ApiSystemMessage = z.infer<typeof apiSystemMessageSchema>;
2428
+ export type ApiTool = z.infer<typeof apiToolSchema>;
2429
+ export type CacheControl = z.infer<typeof cacheControlSchema>;
2430
+ export {};