@osstack/hermes-adapter 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1695 @@
1
+ import { z } from "zod";
2
+ export declare const EventEnvelopeBase: z.ZodObject<{
3
+ event_id: z.ZodString;
4
+ seq: z.ZodNumber;
5
+ run_id: z.ZodString;
6
+ session_id: z.ZodString;
7
+ created_at: z.ZodNumber;
8
+ terminal: z.ZodDefault<z.ZodBoolean>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ event_id: string;
11
+ seq: number;
12
+ run_id: string;
13
+ session_id: string;
14
+ created_at: number;
15
+ terminal: boolean;
16
+ }, {
17
+ event_id: string;
18
+ seq: number;
19
+ run_id: string;
20
+ session_id: string;
21
+ created_at: number;
22
+ terminal?: boolean | undefined;
23
+ }>;
24
+ export declare const ControlSetSchema: z.ZodObject<{
25
+ cancel: z.ZodBoolean;
26
+ approval_pending: z.ZodBoolean;
27
+ clarify_pending: z.ZodBoolean;
28
+ queue: z.ZodBoolean;
29
+ goal: z.ZodBoolean;
30
+ }, "strip", z.ZodTypeAny, {
31
+ cancel: boolean;
32
+ approval_pending: boolean;
33
+ clarify_pending: boolean;
34
+ queue: boolean;
35
+ goal: boolean;
36
+ }, {
37
+ cancel: boolean;
38
+ approval_pending: boolean;
39
+ clarify_pending: boolean;
40
+ queue: boolean;
41
+ goal: boolean;
42
+ }>;
43
+ export declare const RunStartedPayload: z.ZodObject<{
44
+ status: z.ZodLiteral<"running">;
45
+ controls: z.ZodObject<{
46
+ cancel: z.ZodBoolean;
47
+ approval_pending: z.ZodBoolean;
48
+ clarify_pending: z.ZodBoolean;
49
+ queue: z.ZodBoolean;
50
+ goal: z.ZodBoolean;
51
+ }, "strip", z.ZodTypeAny, {
52
+ cancel: boolean;
53
+ approval_pending: boolean;
54
+ clarify_pending: boolean;
55
+ queue: boolean;
56
+ goal: boolean;
57
+ }, {
58
+ cancel: boolean;
59
+ approval_pending: boolean;
60
+ clarify_pending: boolean;
61
+ queue: boolean;
62
+ goal: boolean;
63
+ }>;
64
+ workspace: z.ZodOptional<z.ZodString>;
65
+ profile: z.ZodOptional<z.ZodString>;
66
+ model: z.ZodOptional<z.ZodString>;
67
+ toolset: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
68
+ }, "strip", z.ZodTypeAny, {
69
+ status: "running";
70
+ controls: {
71
+ cancel: boolean;
72
+ approval_pending: boolean;
73
+ clarify_pending: boolean;
74
+ queue: boolean;
75
+ goal: boolean;
76
+ };
77
+ workspace?: string | undefined;
78
+ profile?: string | undefined;
79
+ model?: string | undefined;
80
+ toolset?: string[] | undefined;
81
+ }, {
82
+ status: "running";
83
+ controls: {
84
+ cancel: boolean;
85
+ approval_pending: boolean;
86
+ clarify_pending: boolean;
87
+ queue: boolean;
88
+ goal: boolean;
89
+ };
90
+ workspace?: string | undefined;
91
+ profile?: string | undefined;
92
+ model?: string | undefined;
93
+ toolset?: string[] | undefined;
94
+ }>;
95
+ export declare const StatusPayload: z.ZodObject<{
96
+ status: z.ZodEnum<["queued", "running", "awaiting_approval", "awaiting_clarify", "paused", "cancelling", "cancelled", "failed", "completed", "expired"]>;
97
+ controls: z.ZodObject<{
98
+ cancel: z.ZodBoolean;
99
+ approval_pending: z.ZodBoolean;
100
+ clarify_pending: z.ZodBoolean;
101
+ queue: z.ZodBoolean;
102
+ goal: z.ZodBoolean;
103
+ }, "strip", z.ZodTypeAny, {
104
+ cancel: boolean;
105
+ approval_pending: boolean;
106
+ clarify_pending: boolean;
107
+ queue: boolean;
108
+ goal: boolean;
109
+ }, {
110
+ cancel: boolean;
111
+ approval_pending: boolean;
112
+ clarify_pending: boolean;
113
+ queue: boolean;
114
+ goal: boolean;
115
+ }>;
116
+ detail: z.ZodOptional<z.ZodString>;
117
+ }, "strip", z.ZodTypeAny, {
118
+ status: "running" | "queued" | "awaiting_approval" | "awaiting_clarify" | "paused" | "cancelling" | "cancelled" | "failed" | "completed" | "expired";
119
+ controls: {
120
+ cancel: boolean;
121
+ approval_pending: boolean;
122
+ clarify_pending: boolean;
123
+ queue: boolean;
124
+ goal: boolean;
125
+ };
126
+ detail?: string | undefined;
127
+ }, {
128
+ status: "running" | "queued" | "awaiting_approval" | "awaiting_clarify" | "paused" | "cancelling" | "cancelled" | "failed" | "completed" | "expired";
129
+ controls: {
130
+ cancel: boolean;
131
+ approval_pending: boolean;
132
+ clarify_pending: boolean;
133
+ queue: boolean;
134
+ goal: boolean;
135
+ };
136
+ detail?: string | undefined;
137
+ }>;
138
+ export declare const TokenDeltaPayload: z.ZodObject<{
139
+ message_id: z.ZodString;
140
+ segment_id: z.ZodOptional<z.ZodString>;
141
+ delta: z.ZodString;
142
+ content_type: z.ZodDefault<z.ZodEnum<["text", "code", "thinking"]>>;
143
+ }, "strip", z.ZodTypeAny, {
144
+ message_id: string;
145
+ delta: string;
146
+ content_type: "code" | "text" | "thinking";
147
+ segment_id?: string | undefined;
148
+ }, {
149
+ message_id: string;
150
+ delta: string;
151
+ segment_id?: string | undefined;
152
+ content_type?: "code" | "text" | "thinking" | undefined;
153
+ }>;
154
+ export declare const ReasoningDeltaPayload: z.ZodObject<{
155
+ block_id: z.ZodString;
156
+ delta: z.ZodString;
157
+ visibility: z.ZodDefault<z.ZodEnum<["visible", "collapsed", "hidden"]>>;
158
+ }, "strip", z.ZodTypeAny, {
159
+ delta: string;
160
+ block_id: string;
161
+ visibility: "visible" | "collapsed" | "hidden";
162
+ }, {
163
+ delta: string;
164
+ block_id: string;
165
+ visibility?: "visible" | "collapsed" | "hidden" | undefined;
166
+ }>;
167
+ export declare const ReasoningDonePayload: z.ZodObject<{
168
+ block_id: z.ZodString;
169
+ final: z.ZodString;
170
+ }, "strip", z.ZodTypeAny, {
171
+ block_id: string;
172
+ final: string;
173
+ }, {
174
+ block_id: string;
175
+ final: string;
176
+ }>;
177
+ export declare const ProgressPayload: z.ZodObject<{
178
+ phase: z.ZodString;
179
+ detail: z.ZodOptional<z.ZodString>;
180
+ tool_id: z.ZodOptional<z.ZodString>;
181
+ }, "strip", z.ZodTypeAny, {
182
+ phase: string;
183
+ detail?: string | undefined;
184
+ tool_id?: string | undefined;
185
+ }, {
186
+ phase: string;
187
+ detail?: string | undefined;
188
+ tool_id?: string | undefined;
189
+ }>;
190
+ export declare const ToolStartedPayload: z.ZodObject<{
191
+ tool_call_id: z.ZodString;
192
+ name: z.ZodString;
193
+ args: z.ZodUnknown;
194
+ started_at: z.ZodNumber;
195
+ }, "strip", z.ZodTypeAny, {
196
+ tool_call_id: string;
197
+ name: string;
198
+ started_at: number;
199
+ args?: unknown;
200
+ }, {
201
+ tool_call_id: string;
202
+ name: string;
203
+ started_at: number;
204
+ args?: unknown;
205
+ }>;
206
+ export declare const ToolUpdatedPayload: z.ZodObject<{
207
+ tool_call_id: z.ZodString;
208
+ stdout: z.ZodOptional<z.ZodString>;
209
+ stderr: z.ZodOptional<z.ZodString>;
210
+ partial: z.ZodOptional<z.ZodUnknown>;
211
+ progress_pct: z.ZodOptional<z.ZodNumber>;
212
+ }, "strip", z.ZodTypeAny, {
213
+ tool_call_id: string;
214
+ stdout?: string | undefined;
215
+ stderr?: string | undefined;
216
+ partial?: unknown;
217
+ progress_pct?: number | undefined;
218
+ }, {
219
+ tool_call_id: string;
220
+ stdout?: string | undefined;
221
+ stderr?: string | undefined;
222
+ partial?: unknown;
223
+ progress_pct?: number | undefined;
224
+ }>;
225
+ export declare const ToolDonePayload: z.ZodObject<{
226
+ tool_call_id: z.ZodString;
227
+ result: z.ZodUnknown;
228
+ exit_code: z.ZodOptional<z.ZodNumber>;
229
+ duration_ms: z.ZodNumber;
230
+ error: z.ZodDefault<z.ZodBoolean>;
231
+ }, "strip", z.ZodTypeAny, {
232
+ tool_call_id: string;
233
+ duration_ms: number;
234
+ error: boolean;
235
+ result?: unknown;
236
+ exit_code?: number | undefined;
237
+ }, {
238
+ tool_call_id: string;
239
+ duration_ms: number;
240
+ result?: unknown;
241
+ exit_code?: number | undefined;
242
+ error?: boolean | undefined;
243
+ }>;
244
+ export declare const ApprovalRequestedPayload: z.ZodObject<{
245
+ approval_id: z.ZodString;
246
+ action_summary: z.ZodString;
247
+ risk: z.ZodDefault<z.ZodEnum<["low", "medium", "high"]>>;
248
+ choices: z.ZodArray<z.ZodString, "many">;
249
+ }, "strip", z.ZodTypeAny, {
250
+ approval_id: string;
251
+ action_summary: string;
252
+ risk: "low" | "medium" | "high";
253
+ choices: string[];
254
+ }, {
255
+ approval_id: string;
256
+ action_summary: string;
257
+ choices: string[];
258
+ risk?: "low" | "medium" | "high" | undefined;
259
+ }>;
260
+ export declare const ApprovalResolvedPayload: z.ZodObject<{
261
+ approval_id: z.ZodString;
262
+ choice: z.ZodString;
263
+ status: z.ZodEnum<["accepted", "rejected", "timed_out"]>;
264
+ }, "strip", z.ZodTypeAny, {
265
+ status: "accepted" | "rejected" | "timed_out";
266
+ approval_id: string;
267
+ choice: string;
268
+ }, {
269
+ status: "accepted" | "rejected" | "timed_out";
270
+ approval_id: string;
271
+ choice: string;
272
+ }>;
273
+ export declare const ClarifyRequestedPayload: z.ZodObject<{
274
+ clarify_id: z.ZodString;
275
+ question: z.ZodString;
276
+ choices: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
277
+ input_mode: z.ZodDefault<z.ZodEnum<["choice", "free_text"]>>;
278
+ }, "strip", z.ZodTypeAny, {
279
+ clarify_id: string;
280
+ question: string;
281
+ input_mode: "choice" | "free_text";
282
+ choices?: string[] | undefined;
283
+ }, {
284
+ clarify_id: string;
285
+ question: string;
286
+ choices?: string[] | undefined;
287
+ input_mode?: "choice" | "free_text" | undefined;
288
+ }>;
289
+ export declare const ClarifyResolvedPayload: z.ZodObject<{
290
+ clarify_id: z.ZodString;
291
+ answer: z.ZodString;
292
+ status: z.ZodEnum<["answered", "timed_out", "abandoned"]>;
293
+ }, "strip", z.ZodTypeAny, {
294
+ status: "timed_out" | "answered" | "abandoned";
295
+ clarify_id: string;
296
+ answer: string;
297
+ }, {
298
+ status: "timed_out" | "answered" | "abandoned";
299
+ clarify_id: string;
300
+ answer: string;
301
+ }>;
302
+ export declare const TitleUpdatedPayload: z.ZodObject<{
303
+ title: z.ZodString;
304
+ source: z.ZodDefault<z.ZodEnum<["model", "user", "system"]>>;
305
+ confidence: z.ZodOptional<z.ZodNumber>;
306
+ }, "strip", z.ZodTypeAny, {
307
+ title: string;
308
+ source: "model" | "user" | "system";
309
+ confidence?: number | undefined;
310
+ }, {
311
+ title: string;
312
+ source?: "model" | "user" | "system" | undefined;
313
+ confidence?: number | undefined;
314
+ }>;
315
+ export declare const UsageUpdatedPayload: z.ZodObject<{
316
+ tokens_in: z.ZodNumber;
317
+ tokens_out: z.ZodNumber;
318
+ cost_usd: z.ZodOptional<z.ZodNumber>;
319
+ model: z.ZodOptional<z.ZodString>;
320
+ provider: z.ZodOptional<z.ZodString>;
321
+ }, "strip", z.ZodTypeAny, {
322
+ tokens_in: number;
323
+ tokens_out: number;
324
+ model?: string | undefined;
325
+ cost_usd?: number | undefined;
326
+ provider?: string | undefined;
327
+ }, {
328
+ tokens_in: number;
329
+ tokens_out: number;
330
+ model?: string | undefined;
331
+ cost_usd?: number | undefined;
332
+ provider?: string | undefined;
333
+ }>;
334
+ export declare const UsageFinalPayload: z.ZodObject<{
335
+ tokens_in: z.ZodNumber;
336
+ tokens_out: z.ZodNumber;
337
+ cost_usd: z.ZodOptional<z.ZodNumber>;
338
+ model: z.ZodOptional<z.ZodString>;
339
+ provider: z.ZodOptional<z.ZodString>;
340
+ } & {
341
+ duration_ms: z.ZodNumber;
342
+ }, "strip", z.ZodTypeAny, {
343
+ duration_ms: number;
344
+ tokens_in: number;
345
+ tokens_out: number;
346
+ model?: string | undefined;
347
+ cost_usd?: number | undefined;
348
+ provider?: string | undefined;
349
+ }, {
350
+ duration_ms: number;
351
+ tokens_in: number;
352
+ tokens_out: number;
353
+ model?: string | undefined;
354
+ cost_usd?: number | undefined;
355
+ provider?: string | undefined;
356
+ }>;
357
+ export declare const ErrorPayload: z.ZodObject<{
358
+ code: z.ZodString;
359
+ message: z.ZodString;
360
+ detail: z.ZodOptional<z.ZodString>;
361
+ terminal: z.ZodBoolean;
362
+ }, "strip", z.ZodTypeAny, {
363
+ terminal: boolean;
364
+ code: string;
365
+ message: string;
366
+ detail?: string | undefined;
367
+ }, {
368
+ terminal: boolean;
369
+ code: string;
370
+ message: string;
371
+ detail?: string | undefined;
372
+ }>;
373
+ export declare const DonePayload: z.ZodObject<{
374
+ status: z.ZodEnum<["completed", "failed", "cancelled", "expired"]>;
375
+ last_seq: z.ZodNumber;
376
+ usage: z.ZodOptional<z.ZodObject<{
377
+ tokens_in: z.ZodNumber;
378
+ tokens_out: z.ZodNumber;
379
+ cost_usd: z.ZodOptional<z.ZodNumber>;
380
+ model: z.ZodOptional<z.ZodString>;
381
+ provider: z.ZodOptional<z.ZodString>;
382
+ } & {
383
+ duration_ms: z.ZodNumber;
384
+ }, "strip", z.ZodTypeAny, {
385
+ duration_ms: number;
386
+ tokens_in: number;
387
+ tokens_out: number;
388
+ model?: string | undefined;
389
+ cost_usd?: number | undefined;
390
+ provider?: string | undefined;
391
+ }, {
392
+ duration_ms: number;
393
+ tokens_in: number;
394
+ tokens_out: number;
395
+ model?: string | undefined;
396
+ cost_usd?: number | undefined;
397
+ provider?: string | undefined;
398
+ }>>;
399
+ result_summary: z.ZodOptional<z.ZodString>;
400
+ }, "strip", z.ZodTypeAny, {
401
+ status: "cancelled" | "failed" | "completed" | "expired";
402
+ last_seq: number;
403
+ usage?: {
404
+ duration_ms: number;
405
+ tokens_in: number;
406
+ tokens_out: number;
407
+ model?: string | undefined;
408
+ cost_usd?: number | undefined;
409
+ provider?: string | undefined;
410
+ } | undefined;
411
+ result_summary?: string | undefined;
412
+ }, {
413
+ status: "cancelled" | "failed" | "completed" | "expired";
414
+ last_seq: number;
415
+ usage?: {
416
+ duration_ms: number;
417
+ tokens_in: number;
418
+ tokens_out: number;
419
+ model?: string | undefined;
420
+ cost_usd?: number | undefined;
421
+ provider?: string | undefined;
422
+ } | undefined;
423
+ result_summary?: string | undefined;
424
+ }>;
425
+ export declare const HermesEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
426
+ event_id: z.ZodString;
427
+ seq: z.ZodNumber;
428
+ run_id: z.ZodString;
429
+ session_id: z.ZodString;
430
+ created_at: z.ZodNumber;
431
+ terminal: z.ZodDefault<z.ZodBoolean>;
432
+ } & {
433
+ type: z.ZodLiteral<string>;
434
+ payload: z.ZodObject<{
435
+ status: z.ZodLiteral<"running">;
436
+ controls: z.ZodObject<{
437
+ cancel: z.ZodBoolean;
438
+ approval_pending: z.ZodBoolean;
439
+ clarify_pending: z.ZodBoolean;
440
+ queue: z.ZodBoolean;
441
+ goal: z.ZodBoolean;
442
+ }, "strip", z.ZodTypeAny, {
443
+ cancel: boolean;
444
+ approval_pending: boolean;
445
+ clarify_pending: boolean;
446
+ queue: boolean;
447
+ goal: boolean;
448
+ }, {
449
+ cancel: boolean;
450
+ approval_pending: boolean;
451
+ clarify_pending: boolean;
452
+ queue: boolean;
453
+ goal: boolean;
454
+ }>;
455
+ workspace: z.ZodOptional<z.ZodString>;
456
+ profile: z.ZodOptional<z.ZodString>;
457
+ model: z.ZodOptional<z.ZodString>;
458
+ toolset: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
459
+ }, "strip", z.ZodTypeAny, {
460
+ status: "running";
461
+ controls: {
462
+ cancel: boolean;
463
+ approval_pending: boolean;
464
+ clarify_pending: boolean;
465
+ queue: boolean;
466
+ goal: boolean;
467
+ };
468
+ workspace?: string | undefined;
469
+ profile?: string | undefined;
470
+ model?: string | undefined;
471
+ toolset?: string[] | undefined;
472
+ }, {
473
+ status: "running";
474
+ controls: {
475
+ cancel: boolean;
476
+ approval_pending: boolean;
477
+ clarify_pending: boolean;
478
+ queue: boolean;
479
+ goal: boolean;
480
+ };
481
+ workspace?: string | undefined;
482
+ profile?: string | undefined;
483
+ model?: string | undefined;
484
+ toolset?: string[] | undefined;
485
+ }>;
486
+ }, "strip", z.ZodTypeAny, {
487
+ event_id: string;
488
+ seq: number;
489
+ run_id: string;
490
+ session_id: string;
491
+ created_at: number;
492
+ terminal: boolean;
493
+ type: string;
494
+ payload: {
495
+ status: "running";
496
+ controls: {
497
+ cancel: boolean;
498
+ approval_pending: boolean;
499
+ clarify_pending: boolean;
500
+ queue: boolean;
501
+ goal: boolean;
502
+ };
503
+ workspace?: string | undefined;
504
+ profile?: string | undefined;
505
+ model?: string | undefined;
506
+ toolset?: string[] | undefined;
507
+ };
508
+ }, {
509
+ event_id: string;
510
+ seq: number;
511
+ run_id: string;
512
+ session_id: string;
513
+ created_at: number;
514
+ type: string;
515
+ payload: {
516
+ status: "running";
517
+ controls: {
518
+ cancel: boolean;
519
+ approval_pending: boolean;
520
+ clarify_pending: boolean;
521
+ queue: boolean;
522
+ goal: boolean;
523
+ };
524
+ workspace?: string | undefined;
525
+ profile?: string | undefined;
526
+ model?: string | undefined;
527
+ toolset?: string[] | undefined;
528
+ };
529
+ terminal?: boolean | undefined;
530
+ }>, z.ZodObject<{
531
+ event_id: z.ZodString;
532
+ seq: z.ZodNumber;
533
+ run_id: z.ZodString;
534
+ session_id: z.ZodString;
535
+ created_at: z.ZodNumber;
536
+ terminal: z.ZodDefault<z.ZodBoolean>;
537
+ } & {
538
+ type: z.ZodLiteral<string>;
539
+ payload: z.ZodObject<{
540
+ status: z.ZodEnum<["queued", "running", "awaiting_approval", "awaiting_clarify", "paused", "cancelling", "cancelled", "failed", "completed", "expired"]>;
541
+ controls: z.ZodObject<{
542
+ cancel: z.ZodBoolean;
543
+ approval_pending: z.ZodBoolean;
544
+ clarify_pending: z.ZodBoolean;
545
+ queue: z.ZodBoolean;
546
+ goal: z.ZodBoolean;
547
+ }, "strip", z.ZodTypeAny, {
548
+ cancel: boolean;
549
+ approval_pending: boolean;
550
+ clarify_pending: boolean;
551
+ queue: boolean;
552
+ goal: boolean;
553
+ }, {
554
+ cancel: boolean;
555
+ approval_pending: boolean;
556
+ clarify_pending: boolean;
557
+ queue: boolean;
558
+ goal: boolean;
559
+ }>;
560
+ detail: z.ZodOptional<z.ZodString>;
561
+ }, "strip", z.ZodTypeAny, {
562
+ status: "running" | "queued" | "awaiting_approval" | "awaiting_clarify" | "paused" | "cancelling" | "cancelled" | "failed" | "completed" | "expired";
563
+ controls: {
564
+ cancel: boolean;
565
+ approval_pending: boolean;
566
+ clarify_pending: boolean;
567
+ queue: boolean;
568
+ goal: boolean;
569
+ };
570
+ detail?: string | undefined;
571
+ }, {
572
+ status: "running" | "queued" | "awaiting_approval" | "awaiting_clarify" | "paused" | "cancelling" | "cancelled" | "failed" | "completed" | "expired";
573
+ controls: {
574
+ cancel: boolean;
575
+ approval_pending: boolean;
576
+ clarify_pending: boolean;
577
+ queue: boolean;
578
+ goal: boolean;
579
+ };
580
+ detail?: string | undefined;
581
+ }>;
582
+ }, "strip", z.ZodTypeAny, {
583
+ event_id: string;
584
+ seq: number;
585
+ run_id: string;
586
+ session_id: string;
587
+ created_at: number;
588
+ terminal: boolean;
589
+ type: string;
590
+ payload: {
591
+ status: "running" | "queued" | "awaiting_approval" | "awaiting_clarify" | "paused" | "cancelling" | "cancelled" | "failed" | "completed" | "expired";
592
+ controls: {
593
+ cancel: boolean;
594
+ approval_pending: boolean;
595
+ clarify_pending: boolean;
596
+ queue: boolean;
597
+ goal: boolean;
598
+ };
599
+ detail?: string | undefined;
600
+ };
601
+ }, {
602
+ event_id: string;
603
+ seq: number;
604
+ run_id: string;
605
+ session_id: string;
606
+ created_at: number;
607
+ type: string;
608
+ payload: {
609
+ status: "running" | "queued" | "awaiting_approval" | "awaiting_clarify" | "paused" | "cancelling" | "cancelled" | "failed" | "completed" | "expired";
610
+ controls: {
611
+ cancel: boolean;
612
+ approval_pending: boolean;
613
+ clarify_pending: boolean;
614
+ queue: boolean;
615
+ goal: boolean;
616
+ };
617
+ detail?: string | undefined;
618
+ };
619
+ terminal?: boolean | undefined;
620
+ }>, z.ZodObject<{
621
+ event_id: z.ZodString;
622
+ seq: z.ZodNumber;
623
+ run_id: z.ZodString;
624
+ session_id: z.ZodString;
625
+ created_at: z.ZodNumber;
626
+ terminal: z.ZodDefault<z.ZodBoolean>;
627
+ } & {
628
+ type: z.ZodLiteral<string>;
629
+ payload: z.ZodObject<{
630
+ message_id: z.ZodString;
631
+ segment_id: z.ZodOptional<z.ZodString>;
632
+ delta: z.ZodString;
633
+ content_type: z.ZodDefault<z.ZodEnum<["text", "code", "thinking"]>>;
634
+ }, "strip", z.ZodTypeAny, {
635
+ message_id: string;
636
+ delta: string;
637
+ content_type: "code" | "text" | "thinking";
638
+ segment_id?: string | undefined;
639
+ }, {
640
+ message_id: string;
641
+ delta: string;
642
+ segment_id?: string | undefined;
643
+ content_type?: "code" | "text" | "thinking" | undefined;
644
+ }>;
645
+ }, "strip", z.ZodTypeAny, {
646
+ event_id: string;
647
+ seq: number;
648
+ run_id: string;
649
+ session_id: string;
650
+ created_at: number;
651
+ terminal: boolean;
652
+ type: string;
653
+ payload: {
654
+ message_id: string;
655
+ delta: string;
656
+ content_type: "code" | "text" | "thinking";
657
+ segment_id?: string | undefined;
658
+ };
659
+ }, {
660
+ event_id: string;
661
+ seq: number;
662
+ run_id: string;
663
+ session_id: string;
664
+ created_at: number;
665
+ type: string;
666
+ payload: {
667
+ message_id: string;
668
+ delta: string;
669
+ segment_id?: string | undefined;
670
+ content_type?: "code" | "text" | "thinking" | undefined;
671
+ };
672
+ terminal?: boolean | undefined;
673
+ }>, z.ZodObject<{
674
+ event_id: z.ZodString;
675
+ seq: z.ZodNumber;
676
+ run_id: z.ZodString;
677
+ session_id: z.ZodString;
678
+ created_at: z.ZodNumber;
679
+ terminal: z.ZodDefault<z.ZodBoolean>;
680
+ } & {
681
+ type: z.ZodLiteral<string>;
682
+ payload: z.ZodObject<{
683
+ block_id: z.ZodString;
684
+ delta: z.ZodString;
685
+ visibility: z.ZodDefault<z.ZodEnum<["visible", "collapsed", "hidden"]>>;
686
+ }, "strip", z.ZodTypeAny, {
687
+ delta: string;
688
+ block_id: string;
689
+ visibility: "visible" | "collapsed" | "hidden";
690
+ }, {
691
+ delta: string;
692
+ block_id: string;
693
+ visibility?: "visible" | "collapsed" | "hidden" | undefined;
694
+ }>;
695
+ }, "strip", z.ZodTypeAny, {
696
+ event_id: string;
697
+ seq: number;
698
+ run_id: string;
699
+ session_id: string;
700
+ created_at: number;
701
+ terminal: boolean;
702
+ type: string;
703
+ payload: {
704
+ delta: string;
705
+ block_id: string;
706
+ visibility: "visible" | "collapsed" | "hidden";
707
+ };
708
+ }, {
709
+ event_id: string;
710
+ seq: number;
711
+ run_id: string;
712
+ session_id: string;
713
+ created_at: number;
714
+ type: string;
715
+ payload: {
716
+ delta: string;
717
+ block_id: string;
718
+ visibility?: "visible" | "collapsed" | "hidden" | undefined;
719
+ };
720
+ terminal?: boolean | undefined;
721
+ }>, z.ZodObject<{
722
+ event_id: z.ZodString;
723
+ seq: z.ZodNumber;
724
+ run_id: z.ZodString;
725
+ session_id: z.ZodString;
726
+ created_at: z.ZodNumber;
727
+ terminal: z.ZodDefault<z.ZodBoolean>;
728
+ } & {
729
+ type: z.ZodLiteral<string>;
730
+ payload: z.ZodObject<{
731
+ block_id: z.ZodString;
732
+ final: z.ZodString;
733
+ }, "strip", z.ZodTypeAny, {
734
+ block_id: string;
735
+ final: string;
736
+ }, {
737
+ block_id: string;
738
+ final: string;
739
+ }>;
740
+ }, "strip", z.ZodTypeAny, {
741
+ event_id: string;
742
+ seq: number;
743
+ run_id: string;
744
+ session_id: string;
745
+ created_at: number;
746
+ terminal: boolean;
747
+ type: string;
748
+ payload: {
749
+ block_id: string;
750
+ final: string;
751
+ };
752
+ }, {
753
+ event_id: string;
754
+ seq: number;
755
+ run_id: string;
756
+ session_id: string;
757
+ created_at: number;
758
+ type: string;
759
+ payload: {
760
+ block_id: string;
761
+ final: string;
762
+ };
763
+ terminal?: boolean | undefined;
764
+ }>, z.ZodObject<{
765
+ event_id: z.ZodString;
766
+ seq: z.ZodNumber;
767
+ run_id: z.ZodString;
768
+ session_id: z.ZodString;
769
+ created_at: z.ZodNumber;
770
+ terminal: z.ZodDefault<z.ZodBoolean>;
771
+ } & {
772
+ type: z.ZodLiteral<string>;
773
+ payload: z.ZodObject<{
774
+ phase: z.ZodString;
775
+ detail: z.ZodOptional<z.ZodString>;
776
+ tool_id: z.ZodOptional<z.ZodString>;
777
+ }, "strip", z.ZodTypeAny, {
778
+ phase: string;
779
+ detail?: string | undefined;
780
+ tool_id?: string | undefined;
781
+ }, {
782
+ phase: string;
783
+ detail?: string | undefined;
784
+ tool_id?: string | undefined;
785
+ }>;
786
+ }, "strip", z.ZodTypeAny, {
787
+ event_id: string;
788
+ seq: number;
789
+ run_id: string;
790
+ session_id: string;
791
+ created_at: number;
792
+ terminal: boolean;
793
+ type: string;
794
+ payload: {
795
+ phase: string;
796
+ detail?: string | undefined;
797
+ tool_id?: string | undefined;
798
+ };
799
+ }, {
800
+ event_id: string;
801
+ seq: number;
802
+ run_id: string;
803
+ session_id: string;
804
+ created_at: number;
805
+ type: string;
806
+ payload: {
807
+ phase: string;
808
+ detail?: string | undefined;
809
+ tool_id?: string | undefined;
810
+ };
811
+ terminal?: boolean | undefined;
812
+ }>, z.ZodObject<{
813
+ event_id: z.ZodString;
814
+ seq: z.ZodNumber;
815
+ run_id: z.ZodString;
816
+ session_id: z.ZodString;
817
+ created_at: z.ZodNumber;
818
+ terminal: z.ZodDefault<z.ZodBoolean>;
819
+ } & {
820
+ type: z.ZodLiteral<string>;
821
+ payload: z.ZodObject<{
822
+ tool_call_id: z.ZodString;
823
+ name: z.ZodString;
824
+ args: z.ZodUnknown;
825
+ started_at: z.ZodNumber;
826
+ }, "strip", z.ZodTypeAny, {
827
+ tool_call_id: string;
828
+ name: string;
829
+ started_at: number;
830
+ args?: unknown;
831
+ }, {
832
+ tool_call_id: string;
833
+ name: string;
834
+ started_at: number;
835
+ args?: unknown;
836
+ }>;
837
+ }, "strip", z.ZodTypeAny, {
838
+ event_id: string;
839
+ seq: number;
840
+ run_id: string;
841
+ session_id: string;
842
+ created_at: number;
843
+ terminal: boolean;
844
+ type: string;
845
+ payload: {
846
+ tool_call_id: string;
847
+ name: string;
848
+ started_at: number;
849
+ args?: unknown;
850
+ };
851
+ }, {
852
+ event_id: string;
853
+ seq: number;
854
+ run_id: string;
855
+ session_id: string;
856
+ created_at: number;
857
+ type: string;
858
+ payload: {
859
+ tool_call_id: string;
860
+ name: string;
861
+ started_at: number;
862
+ args?: unknown;
863
+ };
864
+ terminal?: boolean | undefined;
865
+ }>, z.ZodObject<{
866
+ event_id: z.ZodString;
867
+ seq: z.ZodNumber;
868
+ run_id: z.ZodString;
869
+ session_id: z.ZodString;
870
+ created_at: z.ZodNumber;
871
+ terminal: z.ZodDefault<z.ZodBoolean>;
872
+ } & {
873
+ type: z.ZodLiteral<string>;
874
+ payload: z.ZodObject<{
875
+ tool_call_id: z.ZodString;
876
+ stdout: z.ZodOptional<z.ZodString>;
877
+ stderr: z.ZodOptional<z.ZodString>;
878
+ partial: z.ZodOptional<z.ZodUnknown>;
879
+ progress_pct: z.ZodOptional<z.ZodNumber>;
880
+ }, "strip", z.ZodTypeAny, {
881
+ tool_call_id: string;
882
+ stdout?: string | undefined;
883
+ stderr?: string | undefined;
884
+ partial?: unknown;
885
+ progress_pct?: number | undefined;
886
+ }, {
887
+ tool_call_id: string;
888
+ stdout?: string | undefined;
889
+ stderr?: string | undefined;
890
+ partial?: unknown;
891
+ progress_pct?: number | undefined;
892
+ }>;
893
+ }, "strip", z.ZodTypeAny, {
894
+ event_id: string;
895
+ seq: number;
896
+ run_id: string;
897
+ session_id: string;
898
+ created_at: number;
899
+ terminal: boolean;
900
+ type: string;
901
+ payload: {
902
+ tool_call_id: string;
903
+ stdout?: string | undefined;
904
+ stderr?: string | undefined;
905
+ partial?: unknown;
906
+ progress_pct?: number | undefined;
907
+ };
908
+ }, {
909
+ event_id: string;
910
+ seq: number;
911
+ run_id: string;
912
+ session_id: string;
913
+ created_at: number;
914
+ type: string;
915
+ payload: {
916
+ tool_call_id: string;
917
+ stdout?: string | undefined;
918
+ stderr?: string | undefined;
919
+ partial?: unknown;
920
+ progress_pct?: number | undefined;
921
+ };
922
+ terminal?: boolean | undefined;
923
+ }>, z.ZodObject<{
924
+ event_id: z.ZodString;
925
+ seq: z.ZodNumber;
926
+ run_id: z.ZodString;
927
+ session_id: z.ZodString;
928
+ created_at: z.ZodNumber;
929
+ terminal: z.ZodDefault<z.ZodBoolean>;
930
+ } & {
931
+ type: z.ZodLiteral<string>;
932
+ payload: z.ZodObject<{
933
+ tool_call_id: z.ZodString;
934
+ result: z.ZodUnknown;
935
+ exit_code: z.ZodOptional<z.ZodNumber>;
936
+ duration_ms: z.ZodNumber;
937
+ error: z.ZodDefault<z.ZodBoolean>;
938
+ }, "strip", z.ZodTypeAny, {
939
+ tool_call_id: string;
940
+ duration_ms: number;
941
+ error: boolean;
942
+ result?: unknown;
943
+ exit_code?: number | undefined;
944
+ }, {
945
+ tool_call_id: string;
946
+ duration_ms: number;
947
+ result?: unknown;
948
+ exit_code?: number | undefined;
949
+ error?: boolean | undefined;
950
+ }>;
951
+ }, "strip", z.ZodTypeAny, {
952
+ event_id: string;
953
+ seq: number;
954
+ run_id: string;
955
+ session_id: string;
956
+ created_at: number;
957
+ terminal: boolean;
958
+ type: string;
959
+ payload: {
960
+ tool_call_id: string;
961
+ duration_ms: number;
962
+ error: boolean;
963
+ result?: unknown;
964
+ exit_code?: number | undefined;
965
+ };
966
+ }, {
967
+ event_id: string;
968
+ seq: number;
969
+ run_id: string;
970
+ session_id: string;
971
+ created_at: number;
972
+ type: string;
973
+ payload: {
974
+ tool_call_id: string;
975
+ duration_ms: number;
976
+ result?: unknown;
977
+ exit_code?: number | undefined;
978
+ error?: boolean | undefined;
979
+ };
980
+ terminal?: boolean | undefined;
981
+ }>, z.ZodObject<{
982
+ event_id: z.ZodString;
983
+ seq: z.ZodNumber;
984
+ run_id: z.ZodString;
985
+ session_id: z.ZodString;
986
+ created_at: z.ZodNumber;
987
+ terminal: z.ZodDefault<z.ZodBoolean>;
988
+ } & {
989
+ type: z.ZodLiteral<string>;
990
+ payload: z.ZodObject<{
991
+ approval_id: z.ZodString;
992
+ action_summary: z.ZodString;
993
+ risk: z.ZodDefault<z.ZodEnum<["low", "medium", "high"]>>;
994
+ choices: z.ZodArray<z.ZodString, "many">;
995
+ }, "strip", z.ZodTypeAny, {
996
+ approval_id: string;
997
+ action_summary: string;
998
+ risk: "low" | "medium" | "high";
999
+ choices: string[];
1000
+ }, {
1001
+ approval_id: string;
1002
+ action_summary: string;
1003
+ choices: string[];
1004
+ risk?: "low" | "medium" | "high" | undefined;
1005
+ }>;
1006
+ }, "strip", z.ZodTypeAny, {
1007
+ event_id: string;
1008
+ seq: number;
1009
+ run_id: string;
1010
+ session_id: string;
1011
+ created_at: number;
1012
+ terminal: boolean;
1013
+ type: string;
1014
+ payload: {
1015
+ approval_id: string;
1016
+ action_summary: string;
1017
+ risk: "low" | "medium" | "high";
1018
+ choices: string[];
1019
+ };
1020
+ }, {
1021
+ event_id: string;
1022
+ seq: number;
1023
+ run_id: string;
1024
+ session_id: string;
1025
+ created_at: number;
1026
+ type: string;
1027
+ payload: {
1028
+ approval_id: string;
1029
+ action_summary: string;
1030
+ choices: string[];
1031
+ risk?: "low" | "medium" | "high" | undefined;
1032
+ };
1033
+ terminal?: boolean | undefined;
1034
+ }>, z.ZodObject<{
1035
+ event_id: z.ZodString;
1036
+ seq: z.ZodNumber;
1037
+ run_id: z.ZodString;
1038
+ session_id: z.ZodString;
1039
+ created_at: z.ZodNumber;
1040
+ terminal: z.ZodDefault<z.ZodBoolean>;
1041
+ } & {
1042
+ type: z.ZodLiteral<string>;
1043
+ payload: z.ZodObject<{
1044
+ approval_id: z.ZodString;
1045
+ choice: z.ZodString;
1046
+ status: z.ZodEnum<["accepted", "rejected", "timed_out"]>;
1047
+ }, "strip", z.ZodTypeAny, {
1048
+ status: "accepted" | "rejected" | "timed_out";
1049
+ approval_id: string;
1050
+ choice: string;
1051
+ }, {
1052
+ status: "accepted" | "rejected" | "timed_out";
1053
+ approval_id: string;
1054
+ choice: string;
1055
+ }>;
1056
+ }, "strip", z.ZodTypeAny, {
1057
+ event_id: string;
1058
+ seq: number;
1059
+ run_id: string;
1060
+ session_id: string;
1061
+ created_at: number;
1062
+ terminal: boolean;
1063
+ type: string;
1064
+ payload: {
1065
+ status: "accepted" | "rejected" | "timed_out";
1066
+ approval_id: string;
1067
+ choice: string;
1068
+ };
1069
+ }, {
1070
+ event_id: string;
1071
+ seq: number;
1072
+ run_id: string;
1073
+ session_id: string;
1074
+ created_at: number;
1075
+ type: string;
1076
+ payload: {
1077
+ status: "accepted" | "rejected" | "timed_out";
1078
+ approval_id: string;
1079
+ choice: string;
1080
+ };
1081
+ terminal?: boolean | undefined;
1082
+ }>, z.ZodObject<{
1083
+ event_id: z.ZodString;
1084
+ seq: z.ZodNumber;
1085
+ run_id: z.ZodString;
1086
+ session_id: z.ZodString;
1087
+ created_at: z.ZodNumber;
1088
+ terminal: z.ZodDefault<z.ZodBoolean>;
1089
+ } & {
1090
+ type: z.ZodLiteral<string>;
1091
+ payload: z.ZodObject<{
1092
+ clarify_id: z.ZodString;
1093
+ question: z.ZodString;
1094
+ choices: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1095
+ input_mode: z.ZodDefault<z.ZodEnum<["choice", "free_text"]>>;
1096
+ }, "strip", z.ZodTypeAny, {
1097
+ clarify_id: string;
1098
+ question: string;
1099
+ input_mode: "choice" | "free_text";
1100
+ choices?: string[] | undefined;
1101
+ }, {
1102
+ clarify_id: string;
1103
+ question: string;
1104
+ choices?: string[] | undefined;
1105
+ input_mode?: "choice" | "free_text" | undefined;
1106
+ }>;
1107
+ }, "strip", z.ZodTypeAny, {
1108
+ event_id: string;
1109
+ seq: number;
1110
+ run_id: string;
1111
+ session_id: string;
1112
+ created_at: number;
1113
+ terminal: boolean;
1114
+ type: string;
1115
+ payload: {
1116
+ clarify_id: string;
1117
+ question: string;
1118
+ input_mode: "choice" | "free_text";
1119
+ choices?: string[] | undefined;
1120
+ };
1121
+ }, {
1122
+ event_id: string;
1123
+ seq: number;
1124
+ run_id: string;
1125
+ session_id: string;
1126
+ created_at: number;
1127
+ type: string;
1128
+ payload: {
1129
+ clarify_id: string;
1130
+ question: string;
1131
+ choices?: string[] | undefined;
1132
+ input_mode?: "choice" | "free_text" | undefined;
1133
+ };
1134
+ terminal?: boolean | undefined;
1135
+ }>, z.ZodObject<{
1136
+ event_id: z.ZodString;
1137
+ seq: z.ZodNumber;
1138
+ run_id: z.ZodString;
1139
+ session_id: z.ZodString;
1140
+ created_at: z.ZodNumber;
1141
+ terminal: z.ZodDefault<z.ZodBoolean>;
1142
+ } & {
1143
+ type: z.ZodLiteral<string>;
1144
+ payload: z.ZodObject<{
1145
+ clarify_id: z.ZodString;
1146
+ answer: z.ZodString;
1147
+ status: z.ZodEnum<["answered", "timed_out", "abandoned"]>;
1148
+ }, "strip", z.ZodTypeAny, {
1149
+ status: "timed_out" | "answered" | "abandoned";
1150
+ clarify_id: string;
1151
+ answer: string;
1152
+ }, {
1153
+ status: "timed_out" | "answered" | "abandoned";
1154
+ clarify_id: string;
1155
+ answer: string;
1156
+ }>;
1157
+ }, "strip", z.ZodTypeAny, {
1158
+ event_id: string;
1159
+ seq: number;
1160
+ run_id: string;
1161
+ session_id: string;
1162
+ created_at: number;
1163
+ terminal: boolean;
1164
+ type: string;
1165
+ payload: {
1166
+ status: "timed_out" | "answered" | "abandoned";
1167
+ clarify_id: string;
1168
+ answer: string;
1169
+ };
1170
+ }, {
1171
+ event_id: string;
1172
+ seq: number;
1173
+ run_id: string;
1174
+ session_id: string;
1175
+ created_at: number;
1176
+ type: string;
1177
+ payload: {
1178
+ status: "timed_out" | "answered" | "abandoned";
1179
+ clarify_id: string;
1180
+ answer: string;
1181
+ };
1182
+ terminal?: boolean | undefined;
1183
+ }>, z.ZodObject<{
1184
+ event_id: z.ZodString;
1185
+ seq: z.ZodNumber;
1186
+ run_id: z.ZodString;
1187
+ session_id: z.ZodString;
1188
+ created_at: z.ZodNumber;
1189
+ terminal: z.ZodDefault<z.ZodBoolean>;
1190
+ } & {
1191
+ type: z.ZodLiteral<string>;
1192
+ payload: z.ZodObject<{
1193
+ title: z.ZodString;
1194
+ source: z.ZodDefault<z.ZodEnum<["model", "user", "system"]>>;
1195
+ confidence: z.ZodOptional<z.ZodNumber>;
1196
+ }, "strip", z.ZodTypeAny, {
1197
+ title: string;
1198
+ source: "model" | "user" | "system";
1199
+ confidence?: number | undefined;
1200
+ }, {
1201
+ title: string;
1202
+ source?: "model" | "user" | "system" | undefined;
1203
+ confidence?: number | undefined;
1204
+ }>;
1205
+ }, "strip", z.ZodTypeAny, {
1206
+ event_id: string;
1207
+ seq: number;
1208
+ run_id: string;
1209
+ session_id: string;
1210
+ created_at: number;
1211
+ terminal: boolean;
1212
+ type: string;
1213
+ payload: {
1214
+ title: string;
1215
+ source: "model" | "user" | "system";
1216
+ confidence?: number | undefined;
1217
+ };
1218
+ }, {
1219
+ event_id: string;
1220
+ seq: number;
1221
+ run_id: string;
1222
+ session_id: string;
1223
+ created_at: number;
1224
+ type: string;
1225
+ payload: {
1226
+ title: string;
1227
+ source?: "model" | "user" | "system" | undefined;
1228
+ confidence?: number | undefined;
1229
+ };
1230
+ terminal?: boolean | undefined;
1231
+ }>, z.ZodObject<{
1232
+ event_id: z.ZodString;
1233
+ seq: z.ZodNumber;
1234
+ run_id: z.ZodString;
1235
+ session_id: z.ZodString;
1236
+ created_at: z.ZodNumber;
1237
+ terminal: z.ZodDefault<z.ZodBoolean>;
1238
+ } & {
1239
+ type: z.ZodLiteral<string>;
1240
+ payload: z.ZodObject<{
1241
+ tokens_in: z.ZodNumber;
1242
+ tokens_out: z.ZodNumber;
1243
+ cost_usd: z.ZodOptional<z.ZodNumber>;
1244
+ model: z.ZodOptional<z.ZodString>;
1245
+ provider: z.ZodOptional<z.ZodString>;
1246
+ }, "strip", z.ZodTypeAny, {
1247
+ tokens_in: number;
1248
+ tokens_out: number;
1249
+ model?: string | undefined;
1250
+ cost_usd?: number | undefined;
1251
+ provider?: string | undefined;
1252
+ }, {
1253
+ tokens_in: number;
1254
+ tokens_out: number;
1255
+ model?: string | undefined;
1256
+ cost_usd?: number | undefined;
1257
+ provider?: string | undefined;
1258
+ }>;
1259
+ }, "strip", z.ZodTypeAny, {
1260
+ event_id: string;
1261
+ seq: number;
1262
+ run_id: string;
1263
+ session_id: string;
1264
+ created_at: number;
1265
+ terminal: boolean;
1266
+ type: string;
1267
+ payload: {
1268
+ tokens_in: number;
1269
+ tokens_out: number;
1270
+ model?: string | undefined;
1271
+ cost_usd?: number | undefined;
1272
+ provider?: string | undefined;
1273
+ };
1274
+ }, {
1275
+ event_id: string;
1276
+ seq: number;
1277
+ run_id: string;
1278
+ session_id: string;
1279
+ created_at: number;
1280
+ type: string;
1281
+ payload: {
1282
+ tokens_in: number;
1283
+ tokens_out: number;
1284
+ model?: string | undefined;
1285
+ cost_usd?: number | undefined;
1286
+ provider?: string | undefined;
1287
+ };
1288
+ terminal?: boolean | undefined;
1289
+ }>, z.ZodObject<{
1290
+ event_id: z.ZodString;
1291
+ seq: z.ZodNumber;
1292
+ run_id: z.ZodString;
1293
+ session_id: z.ZodString;
1294
+ created_at: z.ZodNumber;
1295
+ terminal: z.ZodDefault<z.ZodBoolean>;
1296
+ } & {
1297
+ type: z.ZodLiteral<string>;
1298
+ payload: z.ZodObject<{
1299
+ tokens_in: z.ZodNumber;
1300
+ tokens_out: z.ZodNumber;
1301
+ cost_usd: z.ZodOptional<z.ZodNumber>;
1302
+ model: z.ZodOptional<z.ZodString>;
1303
+ provider: z.ZodOptional<z.ZodString>;
1304
+ } & {
1305
+ duration_ms: z.ZodNumber;
1306
+ }, "strip", z.ZodTypeAny, {
1307
+ duration_ms: number;
1308
+ tokens_in: number;
1309
+ tokens_out: number;
1310
+ model?: string | undefined;
1311
+ cost_usd?: number | undefined;
1312
+ provider?: string | undefined;
1313
+ }, {
1314
+ duration_ms: number;
1315
+ tokens_in: number;
1316
+ tokens_out: number;
1317
+ model?: string | undefined;
1318
+ cost_usd?: number | undefined;
1319
+ provider?: string | undefined;
1320
+ }>;
1321
+ }, "strip", z.ZodTypeAny, {
1322
+ event_id: string;
1323
+ seq: number;
1324
+ run_id: string;
1325
+ session_id: string;
1326
+ created_at: number;
1327
+ terminal: boolean;
1328
+ type: string;
1329
+ payload: {
1330
+ duration_ms: number;
1331
+ tokens_in: number;
1332
+ tokens_out: number;
1333
+ model?: string | undefined;
1334
+ cost_usd?: number | undefined;
1335
+ provider?: string | undefined;
1336
+ };
1337
+ }, {
1338
+ event_id: string;
1339
+ seq: number;
1340
+ run_id: string;
1341
+ session_id: string;
1342
+ created_at: number;
1343
+ type: string;
1344
+ payload: {
1345
+ duration_ms: number;
1346
+ tokens_in: number;
1347
+ tokens_out: number;
1348
+ model?: string | undefined;
1349
+ cost_usd?: number | undefined;
1350
+ provider?: string | undefined;
1351
+ };
1352
+ terminal?: boolean | undefined;
1353
+ }>, z.ZodObject<{
1354
+ event_id: z.ZodString;
1355
+ seq: z.ZodNumber;
1356
+ run_id: z.ZodString;
1357
+ session_id: z.ZodString;
1358
+ created_at: z.ZodNumber;
1359
+ terminal: z.ZodDefault<z.ZodBoolean>;
1360
+ } & {
1361
+ type: z.ZodLiteral<string>;
1362
+ payload: z.ZodObject<{
1363
+ code: z.ZodString;
1364
+ message: z.ZodString;
1365
+ detail: z.ZodOptional<z.ZodString>;
1366
+ terminal: z.ZodBoolean;
1367
+ }, "strip", z.ZodTypeAny, {
1368
+ terminal: boolean;
1369
+ code: string;
1370
+ message: string;
1371
+ detail?: string | undefined;
1372
+ }, {
1373
+ terminal: boolean;
1374
+ code: string;
1375
+ message: string;
1376
+ detail?: string | undefined;
1377
+ }>;
1378
+ }, "strip", z.ZodTypeAny, {
1379
+ event_id: string;
1380
+ seq: number;
1381
+ run_id: string;
1382
+ session_id: string;
1383
+ created_at: number;
1384
+ terminal: boolean;
1385
+ type: string;
1386
+ payload: {
1387
+ terminal: boolean;
1388
+ code: string;
1389
+ message: string;
1390
+ detail?: string | undefined;
1391
+ };
1392
+ }, {
1393
+ event_id: string;
1394
+ seq: number;
1395
+ run_id: string;
1396
+ session_id: string;
1397
+ created_at: number;
1398
+ type: string;
1399
+ payload: {
1400
+ terminal: boolean;
1401
+ code: string;
1402
+ message: string;
1403
+ detail?: string | undefined;
1404
+ };
1405
+ terminal?: boolean | undefined;
1406
+ }>, z.ZodObject<{
1407
+ event_id: z.ZodString;
1408
+ seq: z.ZodNumber;
1409
+ run_id: z.ZodString;
1410
+ session_id: z.ZodString;
1411
+ created_at: z.ZodNumber;
1412
+ terminal: z.ZodDefault<z.ZodBoolean>;
1413
+ } & {
1414
+ type: z.ZodLiteral<string>;
1415
+ payload: z.ZodObject<{
1416
+ status: z.ZodEnum<["completed", "failed", "cancelled", "expired"]>;
1417
+ last_seq: z.ZodNumber;
1418
+ usage: z.ZodOptional<z.ZodObject<{
1419
+ tokens_in: z.ZodNumber;
1420
+ tokens_out: z.ZodNumber;
1421
+ cost_usd: z.ZodOptional<z.ZodNumber>;
1422
+ model: z.ZodOptional<z.ZodString>;
1423
+ provider: z.ZodOptional<z.ZodString>;
1424
+ } & {
1425
+ duration_ms: z.ZodNumber;
1426
+ }, "strip", z.ZodTypeAny, {
1427
+ duration_ms: number;
1428
+ tokens_in: number;
1429
+ tokens_out: number;
1430
+ model?: string | undefined;
1431
+ cost_usd?: number | undefined;
1432
+ provider?: string | undefined;
1433
+ }, {
1434
+ duration_ms: number;
1435
+ tokens_in: number;
1436
+ tokens_out: number;
1437
+ model?: string | undefined;
1438
+ cost_usd?: number | undefined;
1439
+ provider?: string | undefined;
1440
+ }>>;
1441
+ result_summary: z.ZodOptional<z.ZodString>;
1442
+ }, "strip", z.ZodTypeAny, {
1443
+ status: "cancelled" | "failed" | "completed" | "expired";
1444
+ last_seq: number;
1445
+ usage?: {
1446
+ duration_ms: number;
1447
+ tokens_in: number;
1448
+ tokens_out: number;
1449
+ model?: string | undefined;
1450
+ cost_usd?: number | undefined;
1451
+ provider?: string | undefined;
1452
+ } | undefined;
1453
+ result_summary?: string | undefined;
1454
+ }, {
1455
+ status: "cancelled" | "failed" | "completed" | "expired";
1456
+ last_seq: number;
1457
+ usage?: {
1458
+ duration_ms: number;
1459
+ tokens_in: number;
1460
+ tokens_out: number;
1461
+ model?: string | undefined;
1462
+ cost_usd?: number | undefined;
1463
+ provider?: string | undefined;
1464
+ } | undefined;
1465
+ result_summary?: string | undefined;
1466
+ }>;
1467
+ }, "strip", z.ZodTypeAny, {
1468
+ event_id: string;
1469
+ seq: number;
1470
+ run_id: string;
1471
+ session_id: string;
1472
+ created_at: number;
1473
+ terminal: boolean;
1474
+ type: string;
1475
+ payload: {
1476
+ status: "cancelled" | "failed" | "completed" | "expired";
1477
+ last_seq: number;
1478
+ usage?: {
1479
+ duration_ms: number;
1480
+ tokens_in: number;
1481
+ tokens_out: number;
1482
+ model?: string | undefined;
1483
+ cost_usd?: number | undefined;
1484
+ provider?: string | undefined;
1485
+ } | undefined;
1486
+ result_summary?: string | undefined;
1487
+ };
1488
+ }, {
1489
+ event_id: string;
1490
+ seq: number;
1491
+ run_id: string;
1492
+ session_id: string;
1493
+ created_at: number;
1494
+ type: string;
1495
+ payload: {
1496
+ status: "cancelled" | "failed" | "completed" | "expired";
1497
+ last_seq: number;
1498
+ usage?: {
1499
+ duration_ms: number;
1500
+ tokens_in: number;
1501
+ tokens_out: number;
1502
+ model?: string | undefined;
1503
+ cost_usd?: number | undefined;
1504
+ provider?: string | undefined;
1505
+ } | undefined;
1506
+ result_summary?: string | undefined;
1507
+ };
1508
+ terminal?: boolean | undefined;
1509
+ }>]>;
1510
+ export type HermesEvent = z.infer<typeof HermesEventSchema>;
1511
+ export type HermesEventType = HermesEvent["type"];
1512
+ export declare const ObserveControl: z.ZodObject<{
1513
+ type: z.ZodLiteral<"observe">;
1514
+ run_id: z.ZodString;
1515
+ after_seq: z.ZodOptional<z.ZodNumber>;
1516
+ last_event_id: z.ZodOptional<z.ZodString>;
1517
+ }, "strip", z.ZodTypeAny, {
1518
+ run_id: string;
1519
+ type: "observe";
1520
+ after_seq?: number | undefined;
1521
+ last_event_id?: string | undefined;
1522
+ }, {
1523
+ run_id: string;
1524
+ type: "observe";
1525
+ after_seq?: number | undefined;
1526
+ last_event_id?: string | undefined;
1527
+ }>;
1528
+ export declare const StatusControl: z.ZodObject<{
1529
+ type: z.ZodLiteral<"status">;
1530
+ run_id: z.ZodString;
1531
+ }, "strip", z.ZodTypeAny, {
1532
+ run_id: string;
1533
+ type: "status";
1534
+ }, {
1535
+ run_id: string;
1536
+ type: "status";
1537
+ }>;
1538
+ export declare const CancelControl: z.ZodObject<{
1539
+ type: z.ZodLiteral<"cancel">;
1540
+ run_id: z.ZodString;
1541
+ reason: z.ZodOptional<z.ZodString>;
1542
+ }, "strip", z.ZodTypeAny, {
1543
+ run_id: string;
1544
+ type: "cancel";
1545
+ reason?: string | undefined;
1546
+ }, {
1547
+ run_id: string;
1548
+ type: "cancel";
1549
+ reason?: string | undefined;
1550
+ }>;
1551
+ export declare const QueueControl: z.ZodObject<{
1552
+ type: z.ZodLiteral<"queue">;
1553
+ run_id: z.ZodString;
1554
+ prompt: z.ZodString;
1555
+ }, "strip", z.ZodTypeAny, {
1556
+ run_id: string;
1557
+ type: "queue";
1558
+ prompt: string;
1559
+ }, {
1560
+ run_id: string;
1561
+ type: "queue";
1562
+ prompt: string;
1563
+ }>;
1564
+ export declare const ApprovalControl: z.ZodObject<{
1565
+ type: z.ZodLiteral<"approval">;
1566
+ approval_id: z.ZodString;
1567
+ choice: z.ZodString;
1568
+ }, "strip", z.ZodTypeAny, {
1569
+ type: "approval";
1570
+ approval_id: string;
1571
+ choice: string;
1572
+ }, {
1573
+ type: "approval";
1574
+ approval_id: string;
1575
+ choice: string;
1576
+ }>;
1577
+ export declare const ClarifyControl: z.ZodObject<{
1578
+ type: z.ZodLiteral<"clarify">;
1579
+ clarify_id: z.ZodString;
1580
+ answer: z.ZodString;
1581
+ }, "strip", z.ZodTypeAny, {
1582
+ type: "clarify";
1583
+ clarify_id: string;
1584
+ answer: string;
1585
+ }, {
1586
+ type: "clarify";
1587
+ clarify_id: string;
1588
+ answer: string;
1589
+ }>;
1590
+ export declare const GoalControl: z.ZodObject<{
1591
+ type: z.ZodLiteral<"goal">;
1592
+ run_id: z.ZodString;
1593
+ op: z.ZodEnum<["set", "status", "pause", "resume", "clear"]>;
1594
+ goal: z.ZodOptional<z.ZodString>;
1595
+ }, "strip", z.ZodTypeAny, {
1596
+ run_id: string;
1597
+ type: "goal";
1598
+ op: "status" | "set" | "pause" | "resume" | "clear";
1599
+ goal?: string | undefined;
1600
+ }, {
1601
+ run_id: string;
1602
+ type: "goal";
1603
+ op: "status" | "set" | "pause" | "resume" | "clear";
1604
+ goal?: string | undefined;
1605
+ }>;
1606
+ export declare const HermesControlSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1607
+ type: z.ZodLiteral<"observe">;
1608
+ run_id: z.ZodString;
1609
+ after_seq: z.ZodOptional<z.ZodNumber>;
1610
+ last_event_id: z.ZodOptional<z.ZodString>;
1611
+ }, "strip", z.ZodTypeAny, {
1612
+ run_id: string;
1613
+ type: "observe";
1614
+ after_seq?: number | undefined;
1615
+ last_event_id?: string | undefined;
1616
+ }, {
1617
+ run_id: string;
1618
+ type: "observe";
1619
+ after_seq?: number | undefined;
1620
+ last_event_id?: string | undefined;
1621
+ }>, z.ZodObject<{
1622
+ type: z.ZodLiteral<"status">;
1623
+ run_id: z.ZodString;
1624
+ }, "strip", z.ZodTypeAny, {
1625
+ run_id: string;
1626
+ type: "status";
1627
+ }, {
1628
+ run_id: string;
1629
+ type: "status";
1630
+ }>, z.ZodObject<{
1631
+ type: z.ZodLiteral<"cancel">;
1632
+ run_id: z.ZodString;
1633
+ reason: z.ZodOptional<z.ZodString>;
1634
+ }, "strip", z.ZodTypeAny, {
1635
+ run_id: string;
1636
+ type: "cancel";
1637
+ reason?: string | undefined;
1638
+ }, {
1639
+ run_id: string;
1640
+ type: "cancel";
1641
+ reason?: string | undefined;
1642
+ }>, z.ZodObject<{
1643
+ type: z.ZodLiteral<"queue">;
1644
+ run_id: z.ZodString;
1645
+ prompt: z.ZodString;
1646
+ }, "strip", z.ZodTypeAny, {
1647
+ run_id: string;
1648
+ type: "queue";
1649
+ prompt: string;
1650
+ }, {
1651
+ run_id: string;
1652
+ type: "queue";
1653
+ prompt: string;
1654
+ }>, z.ZodObject<{
1655
+ type: z.ZodLiteral<"approval">;
1656
+ approval_id: z.ZodString;
1657
+ choice: z.ZodString;
1658
+ }, "strip", z.ZodTypeAny, {
1659
+ type: "approval";
1660
+ approval_id: string;
1661
+ choice: string;
1662
+ }, {
1663
+ type: "approval";
1664
+ approval_id: string;
1665
+ choice: string;
1666
+ }>, z.ZodObject<{
1667
+ type: z.ZodLiteral<"clarify">;
1668
+ clarify_id: z.ZodString;
1669
+ answer: z.ZodString;
1670
+ }, "strip", z.ZodTypeAny, {
1671
+ type: "clarify";
1672
+ clarify_id: string;
1673
+ answer: string;
1674
+ }, {
1675
+ type: "clarify";
1676
+ clarify_id: string;
1677
+ answer: string;
1678
+ }>, z.ZodObject<{
1679
+ type: z.ZodLiteral<"goal">;
1680
+ run_id: z.ZodString;
1681
+ op: z.ZodEnum<["set", "status", "pause", "resume", "clear"]>;
1682
+ goal: z.ZodOptional<z.ZodString>;
1683
+ }, "strip", z.ZodTypeAny, {
1684
+ run_id: string;
1685
+ type: "goal";
1686
+ op: "status" | "set" | "pause" | "resume" | "clear";
1687
+ goal?: string | undefined;
1688
+ }, {
1689
+ run_id: string;
1690
+ type: "goal";
1691
+ op: "status" | "set" | "pause" | "resume" | "clear";
1692
+ goal?: string | undefined;
1693
+ }>]>;
1694
+ export type HermesControl = z.infer<typeof HermesControlSchema>;
1695
+ export type HermesControlType = HermesControl["type"];