runtape 0.3.0 → 0.5.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.
package/dist/types.d.ts CHANGED
@@ -14,22 +14,22 @@ declare const SessionStartEvent: z.ZodObject<{
14
14
  type: z.ZodLiteral<"session_start">;
15
15
  source: z.ZodString;
16
16
  }, "strip", z.ZodTypeAny, {
17
+ type: "session_start";
17
18
  session_id: string;
18
19
  transcript_path: string;
19
20
  cwd: string;
20
21
  hook_event_name: string;
21
- type: "session_start";
22
22
  wall_ts: string;
23
23
  sequence: number;
24
24
  source: string;
25
25
  permission_mode?: string | undefined;
26
26
  agent_tool_use_id?: string | undefined;
27
27
  }, {
28
+ type: "session_start";
28
29
  session_id: string;
29
30
  transcript_path: string;
30
31
  cwd: string;
31
32
  hook_event_name: string;
32
- type: "session_start";
33
33
  wall_ts: string;
34
34
  sequence: number;
35
35
  source: string;
@@ -50,22 +50,22 @@ declare const UserPromptEvent: z.ZodObject<{
50
50
  type: z.ZodLiteral<"user_prompt">;
51
51
  prompt: z.ZodString;
52
52
  }, "strip", z.ZodTypeAny, {
53
+ type: "user_prompt";
53
54
  session_id: string;
54
55
  transcript_path: string;
55
56
  cwd: string;
56
57
  hook_event_name: string;
57
- type: "user_prompt";
58
58
  wall_ts: string;
59
59
  sequence: number;
60
60
  prompt: string;
61
61
  permission_mode?: string | undefined;
62
62
  agent_tool_use_id?: string | undefined;
63
63
  }, {
64
+ type: "user_prompt";
64
65
  session_id: string;
65
66
  transcript_path: string;
66
67
  cwd: string;
67
68
  hook_event_name: string;
68
- type: "user_prompt";
69
69
  wall_ts: string;
70
70
  sequence: number;
71
71
  prompt: string;
@@ -88,11 +88,11 @@ declare const ToolAttemptEvent: z.ZodObject<{
88
88
  tool_input: z.ZodUnknown;
89
89
  tool_use_id: z.ZodString;
90
90
  }, "strip", z.ZodTypeAny, {
91
+ type: "tool_attempt";
91
92
  session_id: string;
92
93
  transcript_path: string;
93
94
  cwd: string;
94
95
  hook_event_name: string;
95
- type: "tool_attempt";
96
96
  wall_ts: string;
97
97
  sequence: number;
98
98
  tool_name: string;
@@ -101,11 +101,11 @@ declare const ToolAttemptEvent: z.ZodObject<{
101
101
  agent_tool_use_id?: string | undefined;
102
102
  tool_input?: unknown;
103
103
  }, {
104
+ type: "tool_attempt";
104
105
  session_id: string;
105
106
  transcript_path: string;
106
107
  cwd: string;
107
108
  hook_event_name: string;
108
- type: "tool_attempt";
109
109
  wall_ts: string;
110
110
  sequence: number;
111
111
  tool_name: string;
@@ -134,11 +134,11 @@ declare const ToolCallEvent: z.ZodObject<{
134
134
  is_error: z.ZodOptional<z.ZodBoolean>;
135
135
  error_message: z.ZodOptional<z.ZodString>;
136
136
  }, "strip", z.ZodTypeAny, {
137
+ type: "tool_call";
137
138
  session_id: string;
138
139
  transcript_path: string;
139
140
  cwd: string;
140
141
  hook_event_name: string;
141
- type: "tool_call";
142
142
  wall_ts: string;
143
143
  sequence: number;
144
144
  tool_name: string;
@@ -151,11 +151,11 @@ declare const ToolCallEvent: z.ZodObject<{
151
151
  is_error?: boolean | undefined;
152
152
  error_message?: string | undefined;
153
153
  }, {
154
+ type: "tool_call";
154
155
  session_id: string;
155
156
  transcript_path: string;
156
157
  cwd: string;
157
158
  hook_event_name: string;
158
- type: "tool_call";
159
159
  wall_ts: string;
160
160
  sequence: number;
161
161
  tool_name: string;
@@ -188,11 +188,11 @@ declare const AssistantTurnEvent: z.ZodObject<{
188
188
  cache_creation_tokens: z.ZodDefault<z.ZodNumber>;
189
189
  text: z.ZodOptional<z.ZodString>;
190
190
  }, "strip", z.ZodTypeAny, {
191
+ type: "assistant_turn";
191
192
  session_id: string;
192
193
  transcript_path: string;
193
194
  cwd: string;
194
195
  hook_event_name: string;
195
- type: "assistant_turn";
196
196
  wall_ts: string;
197
197
  sequence: number;
198
198
  message_uuid: string;
@@ -205,11 +205,11 @@ declare const AssistantTurnEvent: z.ZodObject<{
205
205
  agent_tool_use_id?: string | undefined;
206
206
  text?: string | undefined;
207
207
  }, {
208
+ type: "assistant_turn";
208
209
  session_id: string;
209
210
  transcript_path: string;
210
211
  cwd: string;
211
212
  hook_event_name: string;
212
- type: "assistant_turn";
213
213
  wall_ts: string;
214
214
  sequence: number;
215
215
  message_uuid: string;
@@ -240,11 +240,11 @@ declare const SubagentEndEvent: z.ZodObject<{
240
240
  last_assistant_message: z.ZodString;
241
241
  stop_hook_active: z.ZodOptional<z.ZodBoolean>;
242
242
  }, "strip", z.ZodTypeAny, {
243
+ type: "subagent_end";
243
244
  session_id: string;
244
245
  transcript_path: string;
245
246
  cwd: string;
246
247
  hook_event_name: string;
247
- type: "subagent_end";
248
248
  wall_ts: string;
249
249
  sequence: number;
250
250
  agent_id: string;
@@ -255,11 +255,11 @@ declare const SubagentEndEvent: z.ZodObject<{
255
255
  agent_tool_use_id?: string | undefined;
256
256
  stop_hook_active?: boolean | undefined;
257
257
  }, {
258
+ type: "subagent_end";
258
259
  session_id: string;
259
260
  transcript_path: string;
260
261
  cwd: string;
261
262
  hook_event_name: string;
262
- type: "subagent_end";
263
263
  wall_ts: string;
264
264
  sequence: number;
265
265
  agent_id: string;
@@ -285,11 +285,11 @@ declare const SessionEndEvent: z.ZodObject<{
285
285
  last_assistant_message: z.ZodOptional<z.ZodString>;
286
286
  stop_hook_active: z.ZodOptional<z.ZodBoolean>;
287
287
  }, "strip", z.ZodTypeAny, {
288
+ type: "session_end";
288
289
  session_id: string;
289
290
  transcript_path: string;
290
291
  cwd: string;
291
292
  hook_event_name: string;
292
- type: "session_end";
293
293
  wall_ts: string;
294
294
  sequence: number;
295
295
  permission_mode?: string | undefined;
@@ -297,11 +297,11 @@ declare const SessionEndEvent: z.ZodObject<{
297
297
  last_assistant_message?: string | undefined;
298
298
  stop_hook_active?: boolean | undefined;
299
299
  }, {
300
+ type: "session_end";
300
301
  session_id: string;
301
302
  transcript_path: string;
302
303
  cwd: string;
303
304
  hook_event_name: string;
304
- type: "session_end";
305
305
  wall_ts: string;
306
306
  sequence: number;
307
307
  permission_mode?: string | undefined;
@@ -309,6 +309,42 @@ declare const SessionEndEvent: z.ZodObject<{
309
309
  last_assistant_message?: string | undefined;
310
310
  stop_hook_active?: boolean | undefined;
311
311
  }>;
312
+ declare const SessionCloseEvent: z.ZodObject<{
313
+ session_id: z.ZodString;
314
+ transcript_path: z.ZodString;
315
+ cwd: z.ZodString;
316
+ hook_event_name: z.ZodString;
317
+ permission_mode: z.ZodOptional<z.ZodString>;
318
+ } & {
319
+ wall_ts: z.ZodString;
320
+ sequence: z.ZodNumber;
321
+ agent_tool_use_id: z.ZodOptional<z.ZodString>;
322
+ } & {
323
+ type: z.ZodLiteral<"session_close">;
324
+ reason: z.ZodOptional<z.ZodString>;
325
+ }, "strip", z.ZodTypeAny, {
326
+ type: "session_close";
327
+ session_id: string;
328
+ transcript_path: string;
329
+ cwd: string;
330
+ hook_event_name: string;
331
+ wall_ts: string;
332
+ sequence: number;
333
+ permission_mode?: string | undefined;
334
+ agent_tool_use_id?: string | undefined;
335
+ reason?: string | undefined;
336
+ }, {
337
+ type: "session_close";
338
+ session_id: string;
339
+ transcript_path: string;
340
+ cwd: string;
341
+ hook_event_name: string;
342
+ wall_ts: string;
343
+ sequence: number;
344
+ permission_mode?: string | undefined;
345
+ agent_tool_use_id?: string | undefined;
346
+ reason?: string | undefined;
347
+ }>;
312
348
  declare const RuntapeEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
313
349
  session_id: z.ZodString;
314
350
  transcript_path: z.ZodString;
@@ -323,22 +359,22 @@ declare const RuntapeEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
323
359
  type: z.ZodLiteral<"session_start">;
324
360
  source: z.ZodString;
325
361
  }, "strip", z.ZodTypeAny, {
362
+ type: "session_start";
326
363
  session_id: string;
327
364
  transcript_path: string;
328
365
  cwd: string;
329
366
  hook_event_name: string;
330
- type: "session_start";
331
367
  wall_ts: string;
332
368
  sequence: number;
333
369
  source: string;
334
370
  permission_mode?: string | undefined;
335
371
  agent_tool_use_id?: string | undefined;
336
372
  }, {
373
+ type: "session_start";
337
374
  session_id: string;
338
375
  transcript_path: string;
339
376
  cwd: string;
340
377
  hook_event_name: string;
341
- type: "session_start";
342
378
  wall_ts: string;
343
379
  sequence: number;
344
380
  source: string;
@@ -358,22 +394,22 @@ declare const RuntapeEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
358
394
  type: z.ZodLiteral<"user_prompt">;
359
395
  prompt: z.ZodString;
360
396
  }, "strip", z.ZodTypeAny, {
397
+ type: "user_prompt";
361
398
  session_id: string;
362
399
  transcript_path: string;
363
400
  cwd: string;
364
401
  hook_event_name: string;
365
- type: "user_prompt";
366
402
  wall_ts: string;
367
403
  sequence: number;
368
404
  prompt: string;
369
405
  permission_mode?: string | undefined;
370
406
  agent_tool_use_id?: string | undefined;
371
407
  }, {
408
+ type: "user_prompt";
372
409
  session_id: string;
373
410
  transcript_path: string;
374
411
  cwd: string;
375
412
  hook_event_name: string;
376
- type: "user_prompt";
377
413
  wall_ts: string;
378
414
  sequence: number;
379
415
  prompt: string;
@@ -395,11 +431,11 @@ declare const RuntapeEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
395
431
  tool_input: z.ZodUnknown;
396
432
  tool_use_id: z.ZodString;
397
433
  }, "strip", z.ZodTypeAny, {
434
+ type: "tool_attempt";
398
435
  session_id: string;
399
436
  transcript_path: string;
400
437
  cwd: string;
401
438
  hook_event_name: string;
402
- type: "tool_attempt";
403
439
  wall_ts: string;
404
440
  sequence: number;
405
441
  tool_name: string;
@@ -408,11 +444,11 @@ declare const RuntapeEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
408
444
  agent_tool_use_id?: string | undefined;
409
445
  tool_input?: unknown;
410
446
  }, {
447
+ type: "tool_attempt";
411
448
  session_id: string;
412
449
  transcript_path: string;
413
450
  cwd: string;
414
451
  hook_event_name: string;
415
- type: "tool_attempt";
416
452
  wall_ts: string;
417
453
  sequence: number;
418
454
  tool_name: string;
@@ -440,11 +476,11 @@ declare const RuntapeEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
440
476
  is_error: z.ZodOptional<z.ZodBoolean>;
441
477
  error_message: z.ZodOptional<z.ZodString>;
442
478
  }, "strip", z.ZodTypeAny, {
479
+ type: "tool_call";
443
480
  session_id: string;
444
481
  transcript_path: string;
445
482
  cwd: string;
446
483
  hook_event_name: string;
447
- type: "tool_call";
448
484
  wall_ts: string;
449
485
  sequence: number;
450
486
  tool_name: string;
@@ -457,11 +493,11 @@ declare const RuntapeEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
457
493
  is_error?: boolean | undefined;
458
494
  error_message?: string | undefined;
459
495
  }, {
496
+ type: "tool_call";
460
497
  session_id: string;
461
498
  transcript_path: string;
462
499
  cwd: string;
463
500
  hook_event_name: string;
464
- type: "tool_call";
465
501
  wall_ts: string;
466
502
  sequence: number;
467
503
  tool_name: string;
@@ -493,11 +529,11 @@ declare const RuntapeEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
493
529
  cache_creation_tokens: z.ZodDefault<z.ZodNumber>;
494
530
  text: z.ZodOptional<z.ZodString>;
495
531
  }, "strip", z.ZodTypeAny, {
532
+ type: "assistant_turn";
496
533
  session_id: string;
497
534
  transcript_path: string;
498
535
  cwd: string;
499
536
  hook_event_name: string;
500
- type: "assistant_turn";
501
537
  wall_ts: string;
502
538
  sequence: number;
503
539
  message_uuid: string;
@@ -510,11 +546,11 @@ declare const RuntapeEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
510
546
  agent_tool_use_id?: string | undefined;
511
547
  text?: string | undefined;
512
548
  }, {
549
+ type: "assistant_turn";
513
550
  session_id: string;
514
551
  transcript_path: string;
515
552
  cwd: string;
516
553
  hook_event_name: string;
517
- type: "assistant_turn";
518
554
  wall_ts: string;
519
555
  sequence: number;
520
556
  message_uuid: string;
@@ -544,11 +580,11 @@ declare const RuntapeEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
544
580
  last_assistant_message: z.ZodString;
545
581
  stop_hook_active: z.ZodOptional<z.ZodBoolean>;
546
582
  }, "strip", z.ZodTypeAny, {
583
+ type: "subagent_end";
547
584
  session_id: string;
548
585
  transcript_path: string;
549
586
  cwd: string;
550
587
  hook_event_name: string;
551
- type: "subagent_end";
552
588
  wall_ts: string;
553
589
  sequence: number;
554
590
  agent_id: string;
@@ -559,11 +595,11 @@ declare const RuntapeEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
559
595
  agent_tool_use_id?: string | undefined;
560
596
  stop_hook_active?: boolean | undefined;
561
597
  }, {
598
+ type: "subagent_end";
562
599
  session_id: string;
563
600
  transcript_path: string;
564
601
  cwd: string;
565
602
  hook_event_name: string;
566
- type: "subagent_end";
567
603
  wall_ts: string;
568
604
  sequence: number;
569
605
  agent_id: string;
@@ -588,11 +624,11 @@ declare const RuntapeEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
588
624
  last_assistant_message: z.ZodOptional<z.ZodString>;
589
625
  stop_hook_active: z.ZodOptional<z.ZodBoolean>;
590
626
  }, "strip", z.ZodTypeAny, {
627
+ type: "session_end";
591
628
  session_id: string;
592
629
  transcript_path: string;
593
630
  cwd: string;
594
631
  hook_event_name: string;
595
- type: "session_end";
596
632
  wall_ts: string;
597
633
  sequence: number;
598
634
  permission_mode?: string | undefined;
@@ -600,17 +636,52 @@ declare const RuntapeEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
600
636
  last_assistant_message?: string | undefined;
601
637
  stop_hook_active?: boolean | undefined;
602
638
  }, {
639
+ type: "session_end";
603
640
  session_id: string;
604
641
  transcript_path: string;
605
642
  cwd: string;
606
643
  hook_event_name: string;
607
- type: "session_end";
608
644
  wall_ts: string;
609
645
  sequence: number;
610
646
  permission_mode?: string | undefined;
611
647
  agent_tool_use_id?: string | undefined;
612
648
  last_assistant_message?: string | undefined;
613
649
  stop_hook_active?: boolean | undefined;
650
+ }>, z.ZodObject<{
651
+ session_id: z.ZodString;
652
+ transcript_path: z.ZodString;
653
+ cwd: z.ZodString;
654
+ hook_event_name: z.ZodString;
655
+ permission_mode: z.ZodOptional<z.ZodString>;
656
+ } & {
657
+ wall_ts: z.ZodString;
658
+ sequence: z.ZodNumber;
659
+ agent_tool_use_id: z.ZodOptional<z.ZodString>;
660
+ } & {
661
+ type: z.ZodLiteral<"session_close">;
662
+ reason: z.ZodOptional<z.ZodString>;
663
+ }, "strip", z.ZodTypeAny, {
664
+ type: "session_close";
665
+ session_id: string;
666
+ transcript_path: string;
667
+ cwd: string;
668
+ hook_event_name: string;
669
+ wall_ts: string;
670
+ sequence: number;
671
+ permission_mode?: string | undefined;
672
+ agent_tool_use_id?: string | undefined;
673
+ reason?: string | undefined;
674
+ }, {
675
+ type: "session_close";
676
+ session_id: string;
677
+ transcript_path: string;
678
+ cwd: string;
679
+ hook_event_name: string;
680
+ wall_ts: string;
681
+ sequence: number;
682
+ permission_mode?: string | undefined;
683
+ agent_tool_use_id?: string | undefined;
684
+ reason?: string | undefined;
614
685
  }>]>;
615
686
  type RuntapeEvent = z.infer<typeof RuntapeEvent>;
616
687
  declare const IngestionRequest: z.ZodObject<{
@@ -628,22 +699,22 @@ declare const IngestionRequest: z.ZodObject<{
628
699
  type: z.ZodLiteral<"session_start">;
629
700
  source: z.ZodString;
630
701
  }, "strip", z.ZodTypeAny, {
702
+ type: "session_start";
631
703
  session_id: string;
632
704
  transcript_path: string;
633
705
  cwd: string;
634
706
  hook_event_name: string;
635
- type: "session_start";
636
707
  wall_ts: string;
637
708
  sequence: number;
638
709
  source: string;
639
710
  permission_mode?: string | undefined;
640
711
  agent_tool_use_id?: string | undefined;
641
712
  }, {
713
+ type: "session_start";
642
714
  session_id: string;
643
715
  transcript_path: string;
644
716
  cwd: string;
645
717
  hook_event_name: string;
646
- type: "session_start";
647
718
  wall_ts: string;
648
719
  sequence: number;
649
720
  source: string;
@@ -663,22 +734,22 @@ declare const IngestionRequest: z.ZodObject<{
663
734
  type: z.ZodLiteral<"user_prompt">;
664
735
  prompt: z.ZodString;
665
736
  }, "strip", z.ZodTypeAny, {
737
+ type: "user_prompt";
666
738
  session_id: string;
667
739
  transcript_path: string;
668
740
  cwd: string;
669
741
  hook_event_name: string;
670
- type: "user_prompt";
671
742
  wall_ts: string;
672
743
  sequence: number;
673
744
  prompt: string;
674
745
  permission_mode?: string | undefined;
675
746
  agent_tool_use_id?: string | undefined;
676
747
  }, {
748
+ type: "user_prompt";
677
749
  session_id: string;
678
750
  transcript_path: string;
679
751
  cwd: string;
680
752
  hook_event_name: string;
681
- type: "user_prompt";
682
753
  wall_ts: string;
683
754
  sequence: number;
684
755
  prompt: string;
@@ -700,11 +771,11 @@ declare const IngestionRequest: z.ZodObject<{
700
771
  tool_input: z.ZodUnknown;
701
772
  tool_use_id: z.ZodString;
702
773
  }, "strip", z.ZodTypeAny, {
774
+ type: "tool_attempt";
703
775
  session_id: string;
704
776
  transcript_path: string;
705
777
  cwd: string;
706
778
  hook_event_name: string;
707
- type: "tool_attempt";
708
779
  wall_ts: string;
709
780
  sequence: number;
710
781
  tool_name: string;
@@ -713,11 +784,11 @@ declare const IngestionRequest: z.ZodObject<{
713
784
  agent_tool_use_id?: string | undefined;
714
785
  tool_input?: unknown;
715
786
  }, {
787
+ type: "tool_attempt";
716
788
  session_id: string;
717
789
  transcript_path: string;
718
790
  cwd: string;
719
791
  hook_event_name: string;
720
- type: "tool_attempt";
721
792
  wall_ts: string;
722
793
  sequence: number;
723
794
  tool_name: string;
@@ -745,11 +816,11 @@ declare const IngestionRequest: z.ZodObject<{
745
816
  is_error: z.ZodOptional<z.ZodBoolean>;
746
817
  error_message: z.ZodOptional<z.ZodString>;
747
818
  }, "strip", z.ZodTypeAny, {
819
+ type: "tool_call";
748
820
  session_id: string;
749
821
  transcript_path: string;
750
822
  cwd: string;
751
823
  hook_event_name: string;
752
- type: "tool_call";
753
824
  wall_ts: string;
754
825
  sequence: number;
755
826
  tool_name: string;
@@ -762,11 +833,11 @@ declare const IngestionRequest: z.ZodObject<{
762
833
  is_error?: boolean | undefined;
763
834
  error_message?: string | undefined;
764
835
  }, {
836
+ type: "tool_call";
765
837
  session_id: string;
766
838
  transcript_path: string;
767
839
  cwd: string;
768
840
  hook_event_name: string;
769
- type: "tool_call";
770
841
  wall_ts: string;
771
842
  sequence: number;
772
843
  tool_name: string;
@@ -798,11 +869,11 @@ declare const IngestionRequest: z.ZodObject<{
798
869
  cache_creation_tokens: z.ZodDefault<z.ZodNumber>;
799
870
  text: z.ZodOptional<z.ZodString>;
800
871
  }, "strip", z.ZodTypeAny, {
872
+ type: "assistant_turn";
801
873
  session_id: string;
802
874
  transcript_path: string;
803
875
  cwd: string;
804
876
  hook_event_name: string;
805
- type: "assistant_turn";
806
877
  wall_ts: string;
807
878
  sequence: number;
808
879
  message_uuid: string;
@@ -815,11 +886,11 @@ declare const IngestionRequest: z.ZodObject<{
815
886
  agent_tool_use_id?: string | undefined;
816
887
  text?: string | undefined;
817
888
  }, {
889
+ type: "assistant_turn";
818
890
  session_id: string;
819
891
  transcript_path: string;
820
892
  cwd: string;
821
893
  hook_event_name: string;
822
- type: "assistant_turn";
823
894
  wall_ts: string;
824
895
  sequence: number;
825
896
  message_uuid: string;
@@ -849,11 +920,11 @@ declare const IngestionRequest: z.ZodObject<{
849
920
  last_assistant_message: z.ZodString;
850
921
  stop_hook_active: z.ZodOptional<z.ZodBoolean>;
851
922
  }, "strip", z.ZodTypeAny, {
923
+ type: "subagent_end";
852
924
  session_id: string;
853
925
  transcript_path: string;
854
926
  cwd: string;
855
927
  hook_event_name: string;
856
- type: "subagent_end";
857
928
  wall_ts: string;
858
929
  sequence: number;
859
930
  agent_id: string;
@@ -864,11 +935,11 @@ declare const IngestionRequest: z.ZodObject<{
864
935
  agent_tool_use_id?: string | undefined;
865
936
  stop_hook_active?: boolean | undefined;
866
937
  }, {
938
+ type: "subagent_end";
867
939
  session_id: string;
868
940
  transcript_path: string;
869
941
  cwd: string;
870
942
  hook_event_name: string;
871
- type: "subagent_end";
872
943
  wall_ts: string;
873
944
  sequence: number;
874
945
  agent_id: string;
@@ -893,11 +964,11 @@ declare const IngestionRequest: z.ZodObject<{
893
964
  last_assistant_message: z.ZodOptional<z.ZodString>;
894
965
  stop_hook_active: z.ZodOptional<z.ZodBoolean>;
895
966
  }, "strip", z.ZodTypeAny, {
967
+ type: "session_end";
896
968
  session_id: string;
897
969
  transcript_path: string;
898
970
  cwd: string;
899
971
  hook_event_name: string;
900
- type: "session_end";
901
972
  wall_ts: string;
902
973
  sequence: number;
903
974
  permission_mode?: string | undefined;
@@ -905,47 +976,82 @@ declare const IngestionRequest: z.ZodObject<{
905
976
  last_assistant_message?: string | undefined;
906
977
  stop_hook_active?: boolean | undefined;
907
978
  }, {
979
+ type: "session_end";
908
980
  session_id: string;
909
981
  transcript_path: string;
910
982
  cwd: string;
911
983
  hook_event_name: string;
912
- type: "session_end";
913
984
  wall_ts: string;
914
985
  sequence: number;
915
986
  permission_mode?: string | undefined;
916
987
  agent_tool_use_id?: string | undefined;
917
988
  last_assistant_message?: string | undefined;
918
989
  stop_hook_active?: boolean | undefined;
990
+ }>, z.ZodObject<{
991
+ session_id: z.ZodString;
992
+ transcript_path: z.ZodString;
993
+ cwd: z.ZodString;
994
+ hook_event_name: z.ZodString;
995
+ permission_mode: z.ZodOptional<z.ZodString>;
996
+ } & {
997
+ wall_ts: z.ZodString;
998
+ sequence: z.ZodNumber;
999
+ agent_tool_use_id: z.ZodOptional<z.ZodString>;
1000
+ } & {
1001
+ type: z.ZodLiteral<"session_close">;
1002
+ reason: z.ZodOptional<z.ZodString>;
1003
+ }, "strip", z.ZodTypeAny, {
1004
+ type: "session_close";
1005
+ session_id: string;
1006
+ transcript_path: string;
1007
+ cwd: string;
1008
+ hook_event_name: string;
1009
+ wall_ts: string;
1010
+ sequence: number;
1011
+ permission_mode?: string | undefined;
1012
+ agent_tool_use_id?: string | undefined;
1013
+ reason?: string | undefined;
1014
+ }, {
1015
+ type: "session_close";
1016
+ session_id: string;
1017
+ transcript_path: string;
1018
+ cwd: string;
1019
+ hook_event_name: string;
1020
+ wall_ts: string;
1021
+ sequence: number;
1022
+ permission_mode?: string | undefined;
1023
+ agent_tool_use_id?: string | undefined;
1024
+ reason?: string | undefined;
919
1025
  }>]>, "many">;
920
1026
  }, "strip", z.ZodTypeAny, {
921
1027
  events: ({
1028
+ type: "session_start";
922
1029
  session_id: string;
923
1030
  transcript_path: string;
924
1031
  cwd: string;
925
1032
  hook_event_name: string;
926
- type: "session_start";
927
1033
  wall_ts: string;
928
1034
  sequence: number;
929
1035
  source: string;
930
1036
  permission_mode?: string | undefined;
931
1037
  agent_tool_use_id?: string | undefined;
932
1038
  } | {
1039
+ type: "user_prompt";
933
1040
  session_id: string;
934
1041
  transcript_path: string;
935
1042
  cwd: string;
936
1043
  hook_event_name: string;
937
- type: "user_prompt";
938
1044
  wall_ts: string;
939
1045
  sequence: number;
940
1046
  prompt: string;
941
1047
  permission_mode?: string | undefined;
942
1048
  agent_tool_use_id?: string | undefined;
943
1049
  } | {
1050
+ type: "tool_attempt";
944
1051
  session_id: string;
945
1052
  transcript_path: string;
946
1053
  cwd: string;
947
1054
  hook_event_name: string;
948
- type: "tool_attempt";
949
1055
  wall_ts: string;
950
1056
  sequence: number;
951
1057
  tool_name: string;
@@ -954,11 +1060,11 @@ declare const IngestionRequest: z.ZodObject<{
954
1060
  agent_tool_use_id?: string | undefined;
955
1061
  tool_input?: unknown;
956
1062
  } | {
1063
+ type: "tool_call";
957
1064
  session_id: string;
958
1065
  transcript_path: string;
959
1066
  cwd: string;
960
1067
  hook_event_name: string;
961
- type: "tool_call";
962
1068
  wall_ts: string;
963
1069
  sequence: number;
964
1070
  tool_name: string;
@@ -971,11 +1077,11 @@ declare const IngestionRequest: z.ZodObject<{
971
1077
  is_error?: boolean | undefined;
972
1078
  error_message?: string | undefined;
973
1079
  } | {
1080
+ type: "assistant_turn";
974
1081
  session_id: string;
975
1082
  transcript_path: string;
976
1083
  cwd: string;
977
1084
  hook_event_name: string;
978
- type: "assistant_turn";
979
1085
  wall_ts: string;
980
1086
  sequence: number;
981
1087
  message_uuid: string;
@@ -988,11 +1094,11 @@ declare const IngestionRequest: z.ZodObject<{
988
1094
  agent_tool_use_id?: string | undefined;
989
1095
  text?: string | undefined;
990
1096
  } | {
1097
+ type: "subagent_end";
991
1098
  session_id: string;
992
1099
  transcript_path: string;
993
1100
  cwd: string;
994
1101
  hook_event_name: string;
995
- type: "subagent_end";
996
1102
  wall_ts: string;
997
1103
  sequence: number;
998
1104
  agent_id: string;
@@ -1003,47 +1109,58 @@ declare const IngestionRequest: z.ZodObject<{
1003
1109
  agent_tool_use_id?: string | undefined;
1004
1110
  stop_hook_active?: boolean | undefined;
1005
1111
  } | {
1112
+ type: "session_end";
1006
1113
  session_id: string;
1007
1114
  transcript_path: string;
1008
1115
  cwd: string;
1009
1116
  hook_event_name: string;
1010
- type: "session_end";
1011
1117
  wall_ts: string;
1012
1118
  sequence: number;
1013
1119
  permission_mode?: string | undefined;
1014
1120
  agent_tool_use_id?: string | undefined;
1015
1121
  last_assistant_message?: string | undefined;
1016
1122
  stop_hook_active?: boolean | undefined;
1123
+ } | {
1124
+ type: "session_close";
1125
+ session_id: string;
1126
+ transcript_path: string;
1127
+ cwd: string;
1128
+ hook_event_name: string;
1129
+ wall_ts: string;
1130
+ sequence: number;
1131
+ permission_mode?: string | undefined;
1132
+ agent_tool_use_id?: string | undefined;
1133
+ reason?: string | undefined;
1017
1134
  })[];
1018
1135
  }, {
1019
1136
  events: ({
1137
+ type: "session_start";
1020
1138
  session_id: string;
1021
1139
  transcript_path: string;
1022
1140
  cwd: string;
1023
1141
  hook_event_name: string;
1024
- type: "session_start";
1025
1142
  wall_ts: string;
1026
1143
  sequence: number;
1027
1144
  source: string;
1028
1145
  permission_mode?: string | undefined;
1029
1146
  agent_tool_use_id?: string | undefined;
1030
1147
  } | {
1148
+ type: "user_prompt";
1031
1149
  session_id: string;
1032
1150
  transcript_path: string;
1033
1151
  cwd: string;
1034
1152
  hook_event_name: string;
1035
- type: "user_prompt";
1036
1153
  wall_ts: string;
1037
1154
  sequence: number;
1038
1155
  prompt: string;
1039
1156
  permission_mode?: string | undefined;
1040
1157
  agent_tool_use_id?: string | undefined;
1041
1158
  } | {
1159
+ type: "tool_attempt";
1042
1160
  session_id: string;
1043
1161
  transcript_path: string;
1044
1162
  cwd: string;
1045
1163
  hook_event_name: string;
1046
- type: "tool_attempt";
1047
1164
  wall_ts: string;
1048
1165
  sequence: number;
1049
1166
  tool_name: string;
@@ -1052,11 +1169,11 @@ declare const IngestionRequest: z.ZodObject<{
1052
1169
  agent_tool_use_id?: string | undefined;
1053
1170
  tool_input?: unknown;
1054
1171
  } | {
1172
+ type: "tool_call";
1055
1173
  session_id: string;
1056
1174
  transcript_path: string;
1057
1175
  cwd: string;
1058
1176
  hook_event_name: string;
1059
- type: "tool_call";
1060
1177
  wall_ts: string;
1061
1178
  sequence: number;
1062
1179
  tool_name: string;
@@ -1069,11 +1186,11 @@ declare const IngestionRequest: z.ZodObject<{
1069
1186
  is_error?: boolean | undefined;
1070
1187
  error_message?: string | undefined;
1071
1188
  } | {
1189
+ type: "assistant_turn";
1072
1190
  session_id: string;
1073
1191
  transcript_path: string;
1074
1192
  cwd: string;
1075
1193
  hook_event_name: string;
1076
- type: "assistant_turn";
1077
1194
  wall_ts: string;
1078
1195
  sequence: number;
1079
1196
  message_uuid: string;
@@ -1086,11 +1203,11 @@ declare const IngestionRequest: z.ZodObject<{
1086
1203
  cache_creation_tokens?: number | undefined;
1087
1204
  text?: string | undefined;
1088
1205
  } | {
1206
+ type: "subagent_end";
1089
1207
  session_id: string;
1090
1208
  transcript_path: string;
1091
1209
  cwd: string;
1092
1210
  hook_event_name: string;
1093
- type: "subagent_end";
1094
1211
  wall_ts: string;
1095
1212
  sequence: number;
1096
1213
  agent_id: string;
@@ -1101,17 +1218,28 @@ declare const IngestionRequest: z.ZodObject<{
1101
1218
  agent_tool_use_id?: string | undefined;
1102
1219
  stop_hook_active?: boolean | undefined;
1103
1220
  } | {
1221
+ type: "session_end";
1104
1222
  session_id: string;
1105
1223
  transcript_path: string;
1106
1224
  cwd: string;
1107
1225
  hook_event_name: string;
1108
- type: "session_end";
1109
1226
  wall_ts: string;
1110
1227
  sequence: number;
1111
1228
  permission_mode?: string | undefined;
1112
1229
  agent_tool_use_id?: string | undefined;
1113
1230
  last_assistant_message?: string | undefined;
1114
1231
  stop_hook_active?: boolean | undefined;
1232
+ } | {
1233
+ type: "session_close";
1234
+ session_id: string;
1235
+ transcript_path: string;
1236
+ cwd: string;
1237
+ hook_event_name: string;
1238
+ wall_ts: string;
1239
+ sequence: number;
1240
+ permission_mode?: string | undefined;
1241
+ agent_tool_use_id?: string | undefined;
1242
+ reason?: string | undefined;
1115
1243
  })[];
1116
1244
  }>;
1117
1245
  type IngestionRequest = z.infer<typeof IngestionRequest>;
@@ -1121,25 +1249,25 @@ declare const IngestionResponse: z.ZodObject<{
1121
1249
  index: z.ZodNumber;
1122
1250
  reason: z.ZodString;
1123
1251
  }, "strip", z.ZodTypeAny, {
1124
- index: number;
1125
1252
  reason: string;
1126
- }, {
1127
1253
  index: number;
1254
+ }, {
1128
1255
  reason: string;
1256
+ index: number;
1129
1257
  }>, "many">>;
1130
1258
  }, "strip", z.ZodTypeAny, {
1131
1259
  accepted: number;
1132
1260
  errors: {
1133
- index: number;
1134
1261
  reason: string;
1262
+ index: number;
1135
1263
  }[];
1136
1264
  }, {
1137
1265
  accepted: number;
1138
1266
  errors?: {
1139
- index: number;
1140
1267
  reason: string;
1268
+ index: number;
1141
1269
  }[] | undefined;
1142
1270
  }>;
1143
1271
  type IngestionResponse = z.infer<typeof IngestionResponse>;
1144
1272
 
1145
- export { AssistantTurnEvent, IngestionRequest, IngestionResponse, RuntapeEvent, SessionEndEvent, SessionStartEvent, SubagentEndEvent, ToolAttemptEvent, ToolCallEvent, UserPromptEvent };
1273
+ export { AssistantTurnEvent, IngestionRequest, IngestionResponse, RuntapeEvent, SessionCloseEvent, SessionEndEvent, SessionStartEvent, SubagentEndEvent, ToolAttemptEvent, ToolCallEvent, UserPromptEvent };