@linkshell/gateway 0.2.26 → 0.2.28

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.
@@ -18,9 +18,9 @@ export declare const envelopeSchema: z.ZodObject<{
18
18
  ack: z.ZodOptional<z.ZodNumber>;
19
19
  payload: z.ZodUnknown;
20
20
  }, "strip", z.ZodTypeAny, {
21
- id: string;
22
- type: string;
23
21
  sessionId: string;
22
+ type: string;
23
+ id: string;
24
24
  timestamp: string;
25
25
  terminalId?: string | undefined;
26
26
  deviceId?: string | undefined;
@@ -29,9 +29,9 @@ export declare const envelopeSchema: z.ZodObject<{
29
29
  ack?: number | undefined;
30
30
  payload?: unknown;
31
31
  }, {
32
- id: string;
33
- type: string;
34
32
  sessionId: string;
33
+ type: string;
34
+ id: string;
35
35
  timestamp: string;
36
36
  terminalId?: string | undefined;
37
37
  deviceId?: string | undefined;
@@ -89,7 +89,7 @@ export declare const sessionConnectPayloadSchema: z.ZodObject<{
89
89
  }, "strip", z.ZodTypeAny, {
90
90
  role: "host" | "client";
91
91
  clientName: string;
92
- provider?: "custom" | "claude" | "codex" | undefined;
92
+ provider?: "claude" | "codex" | "custom" | undefined;
93
93
  protocolVersion?: number | undefined;
94
94
  hostname?: string | undefined;
95
95
  platform?: string | undefined;
@@ -98,7 +98,7 @@ export declare const sessionConnectPayloadSchema: z.ZodObject<{
98
98
  }, {
99
99
  role: "host" | "client";
100
100
  clientName: string;
101
- provider?: "custom" | "claude" | "codex" | undefined;
101
+ provider?: "claude" | "codex" | "custom" | undefined;
102
102
  protocolVersion?: number | undefined;
103
103
  hostname?: string | undefined;
104
104
  platform?: string | undefined;
@@ -123,11 +123,14 @@ export declare const sessionAckPayloadSchema: z.ZodObject<{
123
123
  seq: number;
124
124
  }>;
125
125
  export declare const sessionResumePayloadSchema: z.ZodObject<{
126
- lastAckedSeq: z.ZodNumber;
126
+ lastAckedSeq: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
127
+ lastAckedSeqByTerminal: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>>;
127
128
  }, "strip", z.ZodTypeAny, {
128
129
  lastAckedSeq: number;
130
+ lastAckedSeqByTerminal: Record<string, number>;
129
131
  }, {
130
- lastAckedSeq: number;
132
+ lastAckedSeq?: number | undefined;
133
+ lastAckedSeqByTerminal?: Record<string, number> | undefined;
131
134
  }>;
132
135
  export declare const sessionHeartbeatPayloadSchema: z.ZodObject<{
133
136
  ts: z.ZodNumber;
@@ -248,8 +251,8 @@ export declare const screenStatusPayloadSchema: z.ZodObject<{
248
251
  error?: string | undefined;
249
252
  }, {
250
253
  active: boolean;
251
- mode?: "webrtc" | "fallback" | "off" | undefined;
252
254
  error?: string | undefined;
255
+ mode?: "webrtc" | "fallback" | "off" | undefined;
253
256
  }>;
254
257
  export declare const screenOfferPayloadSchema: z.ZodObject<{
255
258
  sdp: z.ZodString;
@@ -283,10 +286,10 @@ export declare const terminalSpawnPayloadSchema: z.ZodObject<{
283
286
  provider: z.ZodOptional<z.ZodEnum<["claude", "codex", "custom"]>>;
284
287
  }, "strip", z.ZodTypeAny, {
285
288
  cwd: string;
286
- provider?: "custom" | "claude" | "codex" | undefined;
289
+ provider?: "claude" | "codex" | "custom" | undefined;
287
290
  }, {
288
291
  cwd: string;
289
- provider?: "custom" | "claude" | "codex" | undefined;
292
+ provider?: "claude" | "codex" | "custom" | undefined;
290
293
  }>;
291
294
  export declare const terminalInfoSchema: z.ZodObject<{
292
295
  terminalId: z.ZodString;
@@ -295,14 +298,14 @@ export declare const terminalInfoSchema: z.ZodObject<{
295
298
  provider: z.ZodString;
296
299
  status: z.ZodEnum<["running", "exited"]>;
297
300
  }, "strip", z.ZodTypeAny, {
298
- terminalId: string;
299
301
  status: "running" | "exited";
302
+ terminalId: string;
300
303
  provider: string;
301
304
  cwd: string;
302
305
  projectName: string;
303
306
  }, {
304
- terminalId: string;
305
307
  status: "running" | "exited";
308
+ terminalId: string;
306
309
  provider: string;
307
310
  cwd: string;
308
311
  projectName: string;
@@ -315,30 +318,30 @@ export declare const terminalListPayloadSchema: z.ZodObject<{
315
318
  provider: z.ZodString;
316
319
  status: z.ZodEnum<["running", "exited"]>;
317
320
  }, "strip", z.ZodTypeAny, {
318
- terminalId: string;
319
321
  status: "running" | "exited";
322
+ terminalId: string;
320
323
  provider: string;
321
324
  cwd: string;
322
325
  projectName: string;
323
326
  }, {
324
- terminalId: string;
325
327
  status: "running" | "exited";
328
+ terminalId: string;
326
329
  provider: string;
327
330
  cwd: string;
328
331
  projectName: string;
329
332
  }>, "many">;
330
333
  }, "strip", z.ZodTypeAny, {
331
334
  terminals: {
332
- terminalId: string;
333
335
  status: "running" | "exited";
336
+ terminalId: string;
334
337
  provider: string;
335
338
  cwd: string;
336
339
  projectName: string;
337
340
  }[];
338
341
  }, {
339
342
  terminals: {
340
- terminalId: string;
341
343
  status: "running" | "exited";
344
+ terminalId: string;
342
345
  provider: string;
343
346
  cwd: string;
344
347
  projectName: string;
@@ -455,7 +458,7 @@ export declare const terminalStatusPayloadSchema: z.ZodObject<{
455
458
  }>>;
456
459
  pendingPermissionCount: z.ZodOptional<z.ZodNumber>;
457
460
  }, "strip", z.ZodTypeAny, {
458
- phase: "idle" | "error" | "thinking" | "tool_use" | "outputting" | "waiting";
461
+ phase: "error" | "thinking" | "tool_use" | "outputting" | "waiting" | "idle";
459
462
  seq?: number | undefined;
460
463
  toolName?: string | undefined;
461
464
  toolInput?: string | undefined;
@@ -470,7 +473,7 @@ export declare const terminalStatusPayloadSchema: z.ZodObject<{
470
473
  } | undefined;
471
474
  pendingPermissionCount?: number | undefined;
472
475
  }, {
473
- phase: "idle" | "error" | "thinking" | "tool_use" | "outputting" | "waiting";
476
+ phase: "error" | "thinking" | "tool_use" | "outputting" | "waiting" | "idle";
474
477
  seq?: number | undefined;
475
478
  toolName?: string | undefined;
476
479
  toolInput?: string | undefined;
@@ -523,17 +526,17 @@ export declare const tunnelRequestPayloadSchema: z.ZodObject<{
523
526
  body: z.ZodNullable<z.ZodString>;
524
527
  port: z.ZodNumber;
525
528
  }, "strip", z.ZodTypeAny, {
529
+ headers: Record<string, string>;
526
530
  requestId: string;
527
531
  method: string;
528
532
  url: string;
529
- headers: Record<string, string>;
530
533
  body: string | null;
531
534
  port: number;
532
535
  }, {
536
+ headers: Record<string, string>;
533
537
  requestId: string;
534
538
  method: string;
535
539
  url: string;
536
- headers: Record<string, string>;
537
540
  body: string | null;
538
541
  port: number;
539
542
  }>;
@@ -544,15 +547,15 @@ export declare const tunnelResponsePayloadSchema: z.ZodObject<{
544
547
  body: z.ZodString;
545
548
  isFinal: z.ZodBoolean;
546
549
  }, "strip", z.ZodTypeAny, {
550
+ headers: Record<string, string>;
547
551
  isFinal: boolean;
548
552
  requestId: string;
549
- headers: Record<string, string>;
550
553
  body: string;
551
554
  statusCode: number;
552
555
  }, {
556
+ headers: Record<string, string>;
553
557
  isFinal: boolean;
554
558
  requestId: string;
555
- headers: Record<string, string>;
556
559
  body: string;
557
560
  statusCode: number;
558
561
  }>;
@@ -599,6 +602,577 @@ export declare const terminalHistoryResponsePayloadSchema: z.ZodObject<{
599
602
  entries: string[];
600
603
  shell?: string | undefined;
601
604
  }>;
605
+ export declare const agentProviderSchema: z.ZodEnum<["codex", "claude", "custom"]>;
606
+ export declare const agentContentBlockSchema: z.ZodObject<{
607
+ type: z.ZodEnum<["text", "image"]>;
608
+ text: z.ZodOptional<z.ZodString>;
609
+ data: z.ZodOptional<z.ZodString>;
610
+ mimeType: z.ZodOptional<z.ZodString>;
611
+ }, "strip", z.ZodTypeAny, {
612
+ type: "text" | "image";
613
+ data?: string | undefined;
614
+ text?: string | undefined;
615
+ mimeType?: string | undefined;
616
+ }, {
617
+ type: "text" | "image";
618
+ data?: string | undefined;
619
+ text?: string | undefined;
620
+ mimeType?: string | undefined;
621
+ }>;
622
+ export declare const agentMessageSchema: z.ZodObject<{
623
+ id: z.ZodString;
624
+ role: z.ZodEnum<["user", "assistant", "system"]>;
625
+ content: z.ZodString;
626
+ createdAt: z.ZodNumber;
627
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
628
+ }, "strip", z.ZodTypeAny, {
629
+ id: string;
630
+ role: "user" | "assistant" | "system";
631
+ content: string;
632
+ createdAt: number;
633
+ isStreaming?: boolean | undefined;
634
+ }, {
635
+ id: string;
636
+ role: "user" | "assistant" | "system";
637
+ content: string;
638
+ createdAt: number;
639
+ isStreaming?: boolean | undefined;
640
+ }>;
641
+ export declare const agentToolCallSchema: z.ZodObject<{
642
+ id: z.ZodString;
643
+ name: z.ZodString;
644
+ input: z.ZodOptional<z.ZodString>;
645
+ output: z.ZodOptional<z.ZodString>;
646
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
647
+ }, "strip", z.ZodTypeAny, {
648
+ status: "running" | "pending" | "completed" | "failed";
649
+ id: string;
650
+ name: string;
651
+ input?: string | undefined;
652
+ output?: string | undefined;
653
+ }, {
654
+ id: string;
655
+ name: string;
656
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
657
+ input?: string | undefined;
658
+ output?: string | undefined;
659
+ }>;
660
+ export declare const agentPermissionSchema: z.ZodObject<{
661
+ requestId: z.ZodString;
662
+ toolName: z.ZodOptional<z.ZodString>;
663
+ toolInput: z.ZodOptional<z.ZodString>;
664
+ context: z.ZodOptional<z.ZodString>;
665
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
666
+ id: z.ZodString;
667
+ label: z.ZodString;
668
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
669
+ }, "strip", z.ZodTypeAny, {
670
+ id: string;
671
+ kind: "allow" | "deny" | "other";
672
+ label: string;
673
+ }, {
674
+ id: string;
675
+ label: string;
676
+ kind?: "allow" | "deny" | "other" | undefined;
677
+ }>, "many">>;
678
+ }, "strip", z.ZodTypeAny, {
679
+ options: {
680
+ id: string;
681
+ kind: "allow" | "deny" | "other";
682
+ label: string;
683
+ }[];
684
+ requestId: string;
685
+ toolName?: string | undefined;
686
+ toolInput?: string | undefined;
687
+ context?: string | undefined;
688
+ }, {
689
+ requestId: string;
690
+ options?: {
691
+ id: string;
692
+ label: string;
693
+ kind?: "allow" | "deny" | "other" | undefined;
694
+ }[] | undefined;
695
+ toolName?: string | undefined;
696
+ toolInput?: string | undefined;
697
+ context?: string | undefined;
698
+ }>;
699
+ export declare const agentCapabilitiesPayloadSchema: z.ZodObject<{
700
+ enabled: z.ZodBoolean;
701
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
702
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
703
+ error: z.ZodOptional<z.ZodString>;
704
+ supportsSessionList: z.ZodDefault<z.ZodBoolean>;
705
+ supportsSessionLoad: z.ZodDefault<z.ZodBoolean>;
706
+ supportsImages: z.ZodDefault<z.ZodBoolean>;
707
+ supportsAudio: z.ZodDefault<z.ZodBoolean>;
708
+ supportsPermission: z.ZodDefault<z.ZodBoolean>;
709
+ supportsPlan: z.ZodDefault<z.ZodBoolean>;
710
+ supportsCancel: z.ZodDefault<z.ZodBoolean>;
711
+ }, "strip", z.ZodTypeAny, {
712
+ enabled: boolean;
713
+ supportsSessionList: boolean;
714
+ supportsSessionLoad: boolean;
715
+ supportsImages: boolean;
716
+ supportsAudio: boolean;
717
+ supportsPermission: boolean;
718
+ supportsPlan: boolean;
719
+ supportsCancel: boolean;
720
+ error?: string | undefined;
721
+ provider?: "claude" | "codex" | "custom" | undefined;
722
+ protocolVersion?: number | undefined;
723
+ }, {
724
+ enabled: boolean;
725
+ error?: string | undefined;
726
+ provider?: "claude" | "codex" | "custom" | undefined;
727
+ protocolVersion?: number | undefined;
728
+ supportsSessionList?: boolean | undefined;
729
+ supportsSessionLoad?: boolean | undefined;
730
+ supportsImages?: boolean | undefined;
731
+ supportsAudio?: boolean | undefined;
732
+ supportsPermission?: boolean | undefined;
733
+ supportsPlan?: boolean | undefined;
734
+ supportsCancel?: boolean | undefined;
735
+ }>;
736
+ export declare const agentInitializePayloadSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
737
+ export declare const agentSessionNewPayloadSchema: z.ZodObject<{
738
+ cwd: z.ZodOptional<z.ZodString>;
739
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
740
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
741
+ }, "strip", z.ZodTypeAny, {
742
+ provider?: "claude" | "codex" | "custom" | undefined;
743
+ cwd?: string | undefined;
744
+ mcpServers?: Record<string, unknown> | undefined;
745
+ }, {
746
+ provider?: "claude" | "codex" | "custom" | undefined;
747
+ cwd?: string | undefined;
748
+ mcpServers?: Record<string, unknown> | undefined;
749
+ }>;
750
+ export declare const agentSessionLoadPayloadSchema: z.ZodObject<{
751
+ agentSessionId: z.ZodString;
752
+ cwd: z.ZodOptional<z.ZodString>;
753
+ }, "strip", z.ZodTypeAny, {
754
+ agentSessionId: string;
755
+ cwd?: string | undefined;
756
+ }, {
757
+ agentSessionId: string;
758
+ cwd?: string | undefined;
759
+ }>;
760
+ export declare const agentSessionListPayloadSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
761
+ export declare const agentPromptPayloadSchema: z.ZodObject<{
762
+ agentSessionId: z.ZodOptional<z.ZodString>;
763
+ clientMessageId: z.ZodString;
764
+ contentBlocks: z.ZodArray<z.ZodObject<{
765
+ type: z.ZodEnum<["text", "image"]>;
766
+ text: z.ZodOptional<z.ZodString>;
767
+ data: z.ZodOptional<z.ZodString>;
768
+ mimeType: z.ZodOptional<z.ZodString>;
769
+ }, "strip", z.ZodTypeAny, {
770
+ type: "text" | "image";
771
+ data?: string | undefined;
772
+ text?: string | undefined;
773
+ mimeType?: string | undefined;
774
+ }, {
775
+ type: "text" | "image";
776
+ data?: string | undefined;
777
+ text?: string | undefined;
778
+ mimeType?: string | undefined;
779
+ }>, "many">;
780
+ }, "strip", z.ZodTypeAny, {
781
+ clientMessageId: string;
782
+ contentBlocks: {
783
+ type: "text" | "image";
784
+ data?: string | undefined;
785
+ text?: string | undefined;
786
+ mimeType?: string | undefined;
787
+ }[];
788
+ agentSessionId?: string | undefined;
789
+ }, {
790
+ clientMessageId: string;
791
+ contentBlocks: {
792
+ type: "text" | "image";
793
+ data?: string | undefined;
794
+ text?: string | undefined;
795
+ mimeType?: string | undefined;
796
+ }[];
797
+ agentSessionId?: string | undefined;
798
+ }>;
799
+ export declare const agentCancelPayloadSchema: z.ZodObject<{
800
+ agentSessionId: z.ZodOptional<z.ZodString>;
801
+ }, "strip", z.ZodTypeAny, {
802
+ agentSessionId?: string | undefined;
803
+ }, {
804
+ agentSessionId?: string | undefined;
805
+ }>;
806
+ export declare const agentUpdatePayloadSchema: z.ZodObject<{
807
+ agentSessionId: z.ZodOptional<z.ZodString>;
808
+ kind: z.ZodEnum<["message", "message_delta", "tool_call", "tool_result", "plan", "status", "error"]>;
809
+ message: z.ZodOptional<z.ZodObject<{
810
+ id: z.ZodString;
811
+ role: z.ZodEnum<["user", "assistant", "system"]>;
812
+ content: z.ZodString;
813
+ createdAt: z.ZodNumber;
814
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
815
+ }, "strip", z.ZodTypeAny, {
816
+ id: string;
817
+ role: "user" | "assistant" | "system";
818
+ content: string;
819
+ createdAt: number;
820
+ isStreaming?: boolean | undefined;
821
+ }, {
822
+ id: string;
823
+ role: "user" | "assistant" | "system";
824
+ content: string;
825
+ createdAt: number;
826
+ isStreaming?: boolean | undefined;
827
+ }>>;
828
+ delta: z.ZodOptional<z.ZodString>;
829
+ toolCall: z.ZodOptional<z.ZodObject<{
830
+ id: z.ZodString;
831
+ name: z.ZodString;
832
+ input: z.ZodOptional<z.ZodString>;
833
+ output: z.ZodOptional<z.ZodString>;
834
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
835
+ }, "strip", z.ZodTypeAny, {
836
+ status: "running" | "pending" | "completed" | "failed";
837
+ id: string;
838
+ name: string;
839
+ input?: string | undefined;
840
+ output?: string | undefined;
841
+ }, {
842
+ id: string;
843
+ name: string;
844
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
845
+ input?: string | undefined;
846
+ output?: string | undefined;
847
+ }>>;
848
+ plan: z.ZodOptional<z.ZodArray<z.ZodObject<{
849
+ id: z.ZodString;
850
+ text: z.ZodString;
851
+ status: z.ZodEnum<["pending", "in_progress", "completed"]>;
852
+ }, "strip", z.ZodTypeAny, {
853
+ status: "pending" | "completed" | "in_progress";
854
+ id: string;
855
+ text: string;
856
+ }, {
857
+ status: "pending" | "completed" | "in_progress";
858
+ id: string;
859
+ text: string;
860
+ }>, "many">>;
861
+ status: z.ZodOptional<z.ZodEnum<["idle", "running", "waiting_permission", "error"]>>;
862
+ error: z.ZodOptional<z.ZodString>;
863
+ }, "strip", z.ZodTypeAny, {
864
+ kind: "error" | "message" | "status" | "message_delta" | "tool_call" | "tool_result" | "plan";
865
+ error?: string | undefined;
866
+ message?: {
867
+ id: string;
868
+ role: "user" | "assistant" | "system";
869
+ content: string;
870
+ createdAt: number;
871
+ isStreaming?: boolean | undefined;
872
+ } | undefined;
873
+ status?: "error" | "running" | "idle" | "waiting_permission" | undefined;
874
+ agentSessionId?: string | undefined;
875
+ plan?: {
876
+ status: "pending" | "completed" | "in_progress";
877
+ id: string;
878
+ text: string;
879
+ }[] | undefined;
880
+ delta?: string | undefined;
881
+ toolCall?: {
882
+ status: "running" | "pending" | "completed" | "failed";
883
+ id: string;
884
+ name: string;
885
+ input?: string | undefined;
886
+ output?: string | undefined;
887
+ } | undefined;
888
+ }, {
889
+ kind: "error" | "message" | "status" | "message_delta" | "tool_call" | "tool_result" | "plan";
890
+ error?: string | undefined;
891
+ message?: {
892
+ id: string;
893
+ role: "user" | "assistant" | "system";
894
+ content: string;
895
+ createdAt: number;
896
+ isStreaming?: boolean | undefined;
897
+ } | undefined;
898
+ status?: "error" | "running" | "idle" | "waiting_permission" | undefined;
899
+ agentSessionId?: string | undefined;
900
+ plan?: {
901
+ status: "pending" | "completed" | "in_progress";
902
+ id: string;
903
+ text: string;
904
+ }[] | undefined;
905
+ delta?: string | undefined;
906
+ toolCall?: {
907
+ id: string;
908
+ name: string;
909
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
910
+ input?: string | undefined;
911
+ output?: string | undefined;
912
+ } | undefined;
913
+ }>;
914
+ export declare const agentPermissionRequestPayloadSchema: z.ZodObject<{
915
+ requestId: z.ZodString;
916
+ toolName: z.ZodOptional<z.ZodString>;
917
+ toolInput: z.ZodOptional<z.ZodString>;
918
+ context: z.ZodOptional<z.ZodString>;
919
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
920
+ id: z.ZodString;
921
+ label: z.ZodString;
922
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
923
+ }, "strip", z.ZodTypeAny, {
924
+ id: string;
925
+ kind: "allow" | "deny" | "other";
926
+ label: string;
927
+ }, {
928
+ id: string;
929
+ label: string;
930
+ kind?: "allow" | "deny" | "other" | undefined;
931
+ }>, "many">>;
932
+ } & {
933
+ agentSessionId: z.ZodOptional<z.ZodString>;
934
+ }, "strip", z.ZodTypeAny, {
935
+ options: {
936
+ id: string;
937
+ kind: "allow" | "deny" | "other";
938
+ label: string;
939
+ }[];
940
+ requestId: string;
941
+ toolName?: string | undefined;
942
+ toolInput?: string | undefined;
943
+ agentSessionId?: string | undefined;
944
+ context?: string | undefined;
945
+ }, {
946
+ requestId: string;
947
+ options?: {
948
+ id: string;
949
+ label: string;
950
+ kind?: "allow" | "deny" | "other" | undefined;
951
+ }[] | undefined;
952
+ toolName?: string | undefined;
953
+ toolInput?: string | undefined;
954
+ agentSessionId?: string | undefined;
955
+ context?: string | undefined;
956
+ }>;
957
+ export declare const agentPermissionResponsePayloadSchema: z.ZodObject<{
958
+ agentSessionId: z.ZodOptional<z.ZodString>;
959
+ requestId: z.ZodString;
960
+ outcome: z.ZodEnum<["allow", "deny", "cancelled"]>;
961
+ optionId: z.ZodOptional<z.ZodString>;
962
+ }, "strip", z.ZodTypeAny, {
963
+ requestId: string;
964
+ outcome: "allow" | "deny" | "cancelled";
965
+ agentSessionId?: string | undefined;
966
+ optionId?: string | undefined;
967
+ }, {
968
+ requestId: string;
969
+ outcome: "allow" | "deny" | "cancelled";
970
+ agentSessionId?: string | undefined;
971
+ optionId?: string | undefined;
972
+ }>;
973
+ export declare const agentSnapshotPayloadSchema: z.ZodObject<{
974
+ agentSessionId: z.ZodOptional<z.ZodString>;
975
+ capabilities: z.ZodOptional<z.ZodObject<{
976
+ enabled: z.ZodBoolean;
977
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
978
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
979
+ error: z.ZodOptional<z.ZodString>;
980
+ supportsSessionList: z.ZodDefault<z.ZodBoolean>;
981
+ supportsSessionLoad: z.ZodDefault<z.ZodBoolean>;
982
+ supportsImages: z.ZodDefault<z.ZodBoolean>;
983
+ supportsAudio: z.ZodDefault<z.ZodBoolean>;
984
+ supportsPermission: z.ZodDefault<z.ZodBoolean>;
985
+ supportsPlan: z.ZodDefault<z.ZodBoolean>;
986
+ supportsCancel: z.ZodDefault<z.ZodBoolean>;
987
+ }, "strip", z.ZodTypeAny, {
988
+ enabled: boolean;
989
+ supportsSessionList: boolean;
990
+ supportsSessionLoad: boolean;
991
+ supportsImages: boolean;
992
+ supportsAudio: boolean;
993
+ supportsPermission: boolean;
994
+ supportsPlan: boolean;
995
+ supportsCancel: boolean;
996
+ error?: string | undefined;
997
+ provider?: "claude" | "codex" | "custom" | undefined;
998
+ protocolVersion?: number | undefined;
999
+ }, {
1000
+ enabled: boolean;
1001
+ error?: string | undefined;
1002
+ provider?: "claude" | "codex" | "custom" | undefined;
1003
+ protocolVersion?: number | undefined;
1004
+ supportsSessionList?: boolean | undefined;
1005
+ supportsSessionLoad?: boolean | undefined;
1006
+ supportsImages?: boolean | undefined;
1007
+ supportsAudio?: boolean | undefined;
1008
+ supportsPermission?: boolean | undefined;
1009
+ supportsPlan?: boolean | undefined;
1010
+ supportsCancel?: boolean | undefined;
1011
+ }>>;
1012
+ messages: z.ZodDefault<z.ZodArray<z.ZodObject<{
1013
+ id: z.ZodString;
1014
+ role: z.ZodEnum<["user", "assistant", "system"]>;
1015
+ content: z.ZodString;
1016
+ createdAt: z.ZodNumber;
1017
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
1018
+ }, "strip", z.ZodTypeAny, {
1019
+ id: string;
1020
+ role: "user" | "assistant" | "system";
1021
+ content: string;
1022
+ createdAt: number;
1023
+ isStreaming?: boolean | undefined;
1024
+ }, {
1025
+ id: string;
1026
+ role: "user" | "assistant" | "system";
1027
+ content: string;
1028
+ createdAt: number;
1029
+ isStreaming?: boolean | undefined;
1030
+ }>, "many">>;
1031
+ toolCalls: z.ZodDefault<z.ZodArray<z.ZodObject<{
1032
+ id: z.ZodString;
1033
+ name: z.ZodString;
1034
+ input: z.ZodOptional<z.ZodString>;
1035
+ output: z.ZodOptional<z.ZodString>;
1036
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
1037
+ }, "strip", z.ZodTypeAny, {
1038
+ status: "running" | "pending" | "completed" | "failed";
1039
+ id: string;
1040
+ name: string;
1041
+ input?: string | undefined;
1042
+ output?: string | undefined;
1043
+ }, {
1044
+ id: string;
1045
+ name: string;
1046
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
1047
+ input?: string | undefined;
1048
+ output?: string | undefined;
1049
+ }>, "many">>;
1050
+ pendingPermissions: z.ZodDefault<z.ZodArray<z.ZodObject<{
1051
+ requestId: z.ZodString;
1052
+ toolName: z.ZodOptional<z.ZodString>;
1053
+ toolInput: z.ZodOptional<z.ZodString>;
1054
+ context: z.ZodOptional<z.ZodString>;
1055
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
1056
+ id: z.ZodString;
1057
+ label: z.ZodString;
1058
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
1059
+ }, "strip", z.ZodTypeAny, {
1060
+ id: string;
1061
+ kind: "allow" | "deny" | "other";
1062
+ label: string;
1063
+ }, {
1064
+ id: string;
1065
+ label: string;
1066
+ kind?: "allow" | "deny" | "other" | undefined;
1067
+ }>, "many">>;
1068
+ }, "strip", z.ZodTypeAny, {
1069
+ options: {
1070
+ id: string;
1071
+ kind: "allow" | "deny" | "other";
1072
+ label: string;
1073
+ }[];
1074
+ requestId: string;
1075
+ toolName?: string | undefined;
1076
+ toolInput?: string | undefined;
1077
+ context?: string | undefined;
1078
+ }, {
1079
+ requestId: string;
1080
+ options?: {
1081
+ id: string;
1082
+ label: string;
1083
+ kind?: "allow" | "deny" | "other" | undefined;
1084
+ }[] | undefined;
1085
+ toolName?: string | undefined;
1086
+ toolInput?: string | undefined;
1087
+ context?: string | undefined;
1088
+ }>, "many">>;
1089
+ status: z.ZodDefault<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
1090
+ error: z.ZodOptional<z.ZodString>;
1091
+ }, "strip", z.ZodTypeAny, {
1092
+ status: "error" | "running" | "idle" | "waiting_permission" | "unavailable";
1093
+ messages: {
1094
+ id: string;
1095
+ role: "user" | "assistant" | "system";
1096
+ content: string;
1097
+ createdAt: number;
1098
+ isStreaming?: boolean | undefined;
1099
+ }[];
1100
+ toolCalls: {
1101
+ status: "running" | "pending" | "completed" | "failed";
1102
+ id: string;
1103
+ name: string;
1104
+ input?: string | undefined;
1105
+ output?: string | undefined;
1106
+ }[];
1107
+ pendingPermissions: {
1108
+ options: {
1109
+ id: string;
1110
+ kind: "allow" | "deny" | "other";
1111
+ label: string;
1112
+ }[];
1113
+ requestId: string;
1114
+ toolName?: string | undefined;
1115
+ toolInput?: string | undefined;
1116
+ context?: string | undefined;
1117
+ }[];
1118
+ error?: string | undefined;
1119
+ agentSessionId?: string | undefined;
1120
+ capabilities?: {
1121
+ enabled: boolean;
1122
+ supportsSessionList: boolean;
1123
+ supportsSessionLoad: boolean;
1124
+ supportsImages: boolean;
1125
+ supportsAudio: boolean;
1126
+ supportsPermission: boolean;
1127
+ supportsPlan: boolean;
1128
+ supportsCancel: boolean;
1129
+ error?: string | undefined;
1130
+ provider?: "claude" | "codex" | "custom" | undefined;
1131
+ protocolVersion?: number | undefined;
1132
+ } | undefined;
1133
+ }, {
1134
+ error?: string | undefined;
1135
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
1136
+ agentSessionId?: string | undefined;
1137
+ capabilities?: {
1138
+ enabled: boolean;
1139
+ error?: string | undefined;
1140
+ provider?: "claude" | "codex" | "custom" | undefined;
1141
+ protocolVersion?: number | undefined;
1142
+ supportsSessionList?: boolean | undefined;
1143
+ supportsSessionLoad?: boolean | undefined;
1144
+ supportsImages?: boolean | undefined;
1145
+ supportsAudio?: boolean | undefined;
1146
+ supportsPermission?: boolean | undefined;
1147
+ supportsPlan?: boolean | undefined;
1148
+ supportsCancel?: boolean | undefined;
1149
+ } | undefined;
1150
+ messages?: {
1151
+ id: string;
1152
+ role: "user" | "assistant" | "system";
1153
+ content: string;
1154
+ createdAt: number;
1155
+ isStreaming?: boolean | undefined;
1156
+ }[] | undefined;
1157
+ toolCalls?: {
1158
+ id: string;
1159
+ name: string;
1160
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
1161
+ input?: string | undefined;
1162
+ output?: string | undefined;
1163
+ }[] | undefined;
1164
+ pendingPermissions?: {
1165
+ requestId: string;
1166
+ options?: {
1167
+ id: string;
1168
+ label: string;
1169
+ kind?: "allow" | "deny" | "other" | undefined;
1170
+ }[] | undefined;
1171
+ toolName?: string | undefined;
1172
+ toolInput?: string | undefined;
1173
+ context?: string | undefined;
1174
+ }[] | undefined;
1175
+ }>;
602
1176
  export declare const protocolMessageSchemas: {
603
1177
  readonly "session.connect": z.ZodObject<{
604
1178
  role: z.ZodEnum<["host", "client"]>;
@@ -612,7 +1186,7 @@ export declare const protocolMessageSchemas: {
612
1186
  }, "strip", z.ZodTypeAny, {
613
1187
  role: "host" | "client";
614
1188
  clientName: string;
615
- provider?: "custom" | "claude" | "codex" | undefined;
1189
+ provider?: "claude" | "codex" | "custom" | undefined;
616
1190
  protocolVersion?: number | undefined;
617
1191
  hostname?: string | undefined;
618
1192
  platform?: string | undefined;
@@ -621,7 +1195,7 @@ export declare const protocolMessageSchemas: {
621
1195
  }, {
622
1196
  role: "host" | "client";
623
1197
  clientName: string;
624
- provider?: "custom" | "claude" | "codex" | undefined;
1198
+ provider?: "claude" | "codex" | "custom" | undefined;
625
1199
  protocolVersion?: number | undefined;
626
1200
  hostname?: string | undefined;
627
1201
  platform?: string | undefined;
@@ -636,11 +1210,14 @@ export declare const protocolMessageSchemas: {
636
1210
  seq: number;
637
1211
  }>;
638
1212
  readonly "session.resume": z.ZodObject<{
639
- lastAckedSeq: z.ZodNumber;
1213
+ lastAckedSeq: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
1214
+ lastAckedSeqByTerminal: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>>;
640
1215
  }, "strip", z.ZodTypeAny, {
641
1216
  lastAckedSeq: number;
1217
+ lastAckedSeqByTerminal: Record<string, number>;
642
1218
  }, {
643
- lastAckedSeq: number;
1219
+ lastAckedSeq?: number | undefined;
1220
+ lastAckedSeqByTerminal?: Record<string, number> | undefined;
644
1221
  }>;
645
1222
  readonly "session.heartbeat": z.ZodObject<{
646
1223
  ts: z.ZodNumber;
@@ -817,8 +1394,8 @@ export declare const protocolMessageSchemas: {
817
1394
  error?: string | undefined;
818
1395
  }, {
819
1396
  active: boolean;
820
- mode?: "webrtc" | "fallback" | "off" | undefined;
821
1397
  error?: string | undefined;
1398
+ mode?: "webrtc" | "fallback" | "off" | undefined;
822
1399
  }>;
823
1400
  readonly "screen.offer": z.ZodObject<{
824
1401
  sdp: z.ZodString;
@@ -862,10 +1439,10 @@ export declare const protocolMessageSchemas: {
862
1439
  provider: z.ZodOptional<z.ZodEnum<["claude", "codex", "custom"]>>;
863
1440
  }, "strip", z.ZodTypeAny, {
864
1441
  cwd: string;
865
- provider?: "custom" | "claude" | "codex" | undefined;
1442
+ provider?: "claude" | "codex" | "custom" | undefined;
866
1443
  }, {
867
1444
  cwd: string;
868
- provider?: "custom" | "claude" | "codex" | undefined;
1445
+ provider?: "claude" | "codex" | "custom" | undefined;
869
1446
  }>;
870
1447
  readonly "terminal.spawned": z.ZodObject<{
871
1448
  terminalId: z.ZodString;
@@ -891,30 +1468,30 @@ export declare const protocolMessageSchemas: {
891
1468
  provider: z.ZodString;
892
1469
  status: z.ZodEnum<["running", "exited"]>;
893
1470
  }, "strip", z.ZodTypeAny, {
894
- terminalId: string;
895
1471
  status: "running" | "exited";
1472
+ terminalId: string;
896
1473
  provider: string;
897
1474
  cwd: string;
898
1475
  projectName: string;
899
1476
  }, {
900
- terminalId: string;
901
1477
  status: "running" | "exited";
1478
+ terminalId: string;
902
1479
  provider: string;
903
1480
  cwd: string;
904
1481
  projectName: string;
905
1482
  }>, "many">;
906
1483
  }, "strip", z.ZodTypeAny, {
907
1484
  terminals: {
908
- terminalId: string;
909
1485
  status: "running" | "exited";
1486
+ terminalId: string;
910
1487
  provider: string;
911
1488
  cwd: string;
912
1489
  projectName: string;
913
1490
  }[];
914
1491
  }, {
915
1492
  terminals: {
916
- terminalId: string;
917
1493
  status: "running" | "exited";
1494
+ terminalId: string;
918
1495
  provider: string;
919
1496
  cwd: string;
920
1497
  projectName: string;
@@ -1002,7 +1579,7 @@ export declare const protocolMessageSchemas: {
1002
1579
  }>>;
1003
1580
  pendingPermissionCount: z.ZodOptional<z.ZodNumber>;
1004
1581
  }, "strip", z.ZodTypeAny, {
1005
- phase: "idle" | "error" | "thinking" | "tool_use" | "outputting" | "waiting";
1582
+ phase: "error" | "thinking" | "tool_use" | "outputting" | "waiting" | "idle";
1006
1583
  seq?: number | undefined;
1007
1584
  toolName?: string | undefined;
1008
1585
  toolInput?: string | undefined;
@@ -1017,7 +1594,7 @@ export declare const protocolMessageSchemas: {
1017
1594
  } | undefined;
1018
1595
  pendingPermissionCount?: number | undefined;
1019
1596
  }, {
1020
- phase: "idle" | "error" | "thinking" | "tool_use" | "outputting" | "waiting";
1597
+ phase: "error" | "thinking" | "tool_use" | "outputting" | "waiting" | "idle";
1021
1598
  seq?: number | undefined;
1022
1599
  toolName?: string | undefined;
1023
1600
  toolInput?: string | undefined;
@@ -1050,17 +1627,17 @@ export declare const protocolMessageSchemas: {
1050
1627
  body: z.ZodNullable<z.ZodString>;
1051
1628
  port: z.ZodNumber;
1052
1629
  }, "strip", z.ZodTypeAny, {
1630
+ headers: Record<string, string>;
1053
1631
  requestId: string;
1054
1632
  method: string;
1055
1633
  url: string;
1056
- headers: Record<string, string>;
1057
1634
  body: string | null;
1058
1635
  port: number;
1059
1636
  }, {
1637
+ headers: Record<string, string>;
1060
1638
  requestId: string;
1061
1639
  method: string;
1062
1640
  url: string;
1063
- headers: Record<string, string>;
1064
1641
  body: string | null;
1065
1642
  port: number;
1066
1643
  }>;
@@ -1071,15 +1648,15 @@ export declare const protocolMessageSchemas: {
1071
1648
  body: z.ZodString;
1072
1649
  isFinal: z.ZodBoolean;
1073
1650
  }, "strip", z.ZodTypeAny, {
1651
+ headers: Record<string, string>;
1074
1652
  isFinal: boolean;
1075
1653
  requestId: string;
1076
- headers: Record<string, string>;
1077
1654
  body: string;
1078
1655
  statusCode: number;
1079
1656
  }, {
1657
+ headers: Record<string, string>;
1080
1658
  isFinal: boolean;
1081
1659
  requestId: string;
1082
- headers: Record<string, string>;
1083
1660
  body: string;
1084
1661
  statusCode: number;
1085
1662
  }>;
@@ -1126,6 +1703,483 @@ export declare const protocolMessageSchemas: {
1126
1703
  entries: string[];
1127
1704
  shell?: string | undefined;
1128
1705
  }>;
1706
+ readonly "agent.initialize": z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
1707
+ readonly "agent.capabilities": z.ZodObject<{
1708
+ enabled: z.ZodBoolean;
1709
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
1710
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
1711
+ error: z.ZodOptional<z.ZodString>;
1712
+ supportsSessionList: z.ZodDefault<z.ZodBoolean>;
1713
+ supportsSessionLoad: z.ZodDefault<z.ZodBoolean>;
1714
+ supportsImages: z.ZodDefault<z.ZodBoolean>;
1715
+ supportsAudio: z.ZodDefault<z.ZodBoolean>;
1716
+ supportsPermission: z.ZodDefault<z.ZodBoolean>;
1717
+ supportsPlan: z.ZodDefault<z.ZodBoolean>;
1718
+ supportsCancel: z.ZodDefault<z.ZodBoolean>;
1719
+ }, "strip", z.ZodTypeAny, {
1720
+ enabled: boolean;
1721
+ supportsSessionList: boolean;
1722
+ supportsSessionLoad: boolean;
1723
+ supportsImages: boolean;
1724
+ supportsAudio: boolean;
1725
+ supportsPermission: boolean;
1726
+ supportsPlan: boolean;
1727
+ supportsCancel: boolean;
1728
+ error?: string | undefined;
1729
+ provider?: "claude" | "codex" | "custom" | undefined;
1730
+ protocolVersion?: number | undefined;
1731
+ }, {
1732
+ enabled: boolean;
1733
+ error?: string | undefined;
1734
+ provider?: "claude" | "codex" | "custom" | undefined;
1735
+ protocolVersion?: number | undefined;
1736
+ supportsSessionList?: boolean | undefined;
1737
+ supportsSessionLoad?: boolean | undefined;
1738
+ supportsImages?: boolean | undefined;
1739
+ supportsAudio?: boolean | undefined;
1740
+ supportsPermission?: boolean | undefined;
1741
+ supportsPlan?: boolean | undefined;
1742
+ supportsCancel?: boolean | undefined;
1743
+ }>;
1744
+ readonly "agent.session.new": z.ZodObject<{
1745
+ cwd: z.ZodOptional<z.ZodString>;
1746
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
1747
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1748
+ }, "strip", z.ZodTypeAny, {
1749
+ provider?: "claude" | "codex" | "custom" | undefined;
1750
+ cwd?: string | undefined;
1751
+ mcpServers?: Record<string, unknown> | undefined;
1752
+ }, {
1753
+ provider?: "claude" | "codex" | "custom" | undefined;
1754
+ cwd?: string | undefined;
1755
+ mcpServers?: Record<string, unknown> | undefined;
1756
+ }>;
1757
+ readonly "agent.session.load": z.ZodObject<{
1758
+ agentSessionId: z.ZodString;
1759
+ cwd: z.ZodOptional<z.ZodString>;
1760
+ }, "strip", z.ZodTypeAny, {
1761
+ agentSessionId: string;
1762
+ cwd?: string | undefined;
1763
+ }, {
1764
+ agentSessionId: string;
1765
+ cwd?: string | undefined;
1766
+ }>;
1767
+ readonly "agent.session.list": z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
1768
+ readonly "agent.prompt": z.ZodObject<{
1769
+ agentSessionId: z.ZodOptional<z.ZodString>;
1770
+ clientMessageId: z.ZodString;
1771
+ contentBlocks: z.ZodArray<z.ZodObject<{
1772
+ type: z.ZodEnum<["text", "image"]>;
1773
+ text: z.ZodOptional<z.ZodString>;
1774
+ data: z.ZodOptional<z.ZodString>;
1775
+ mimeType: z.ZodOptional<z.ZodString>;
1776
+ }, "strip", z.ZodTypeAny, {
1777
+ type: "text" | "image";
1778
+ data?: string | undefined;
1779
+ text?: string | undefined;
1780
+ mimeType?: string | undefined;
1781
+ }, {
1782
+ type: "text" | "image";
1783
+ data?: string | undefined;
1784
+ text?: string | undefined;
1785
+ mimeType?: string | undefined;
1786
+ }>, "many">;
1787
+ }, "strip", z.ZodTypeAny, {
1788
+ clientMessageId: string;
1789
+ contentBlocks: {
1790
+ type: "text" | "image";
1791
+ data?: string | undefined;
1792
+ text?: string | undefined;
1793
+ mimeType?: string | undefined;
1794
+ }[];
1795
+ agentSessionId?: string | undefined;
1796
+ }, {
1797
+ clientMessageId: string;
1798
+ contentBlocks: {
1799
+ type: "text" | "image";
1800
+ data?: string | undefined;
1801
+ text?: string | undefined;
1802
+ mimeType?: string | undefined;
1803
+ }[];
1804
+ agentSessionId?: string | undefined;
1805
+ }>;
1806
+ readonly "agent.cancel": z.ZodObject<{
1807
+ agentSessionId: z.ZodOptional<z.ZodString>;
1808
+ }, "strip", z.ZodTypeAny, {
1809
+ agentSessionId?: string | undefined;
1810
+ }, {
1811
+ agentSessionId?: string | undefined;
1812
+ }>;
1813
+ readonly "agent.update": z.ZodObject<{
1814
+ agentSessionId: z.ZodOptional<z.ZodString>;
1815
+ kind: z.ZodEnum<["message", "message_delta", "tool_call", "tool_result", "plan", "status", "error"]>;
1816
+ message: z.ZodOptional<z.ZodObject<{
1817
+ id: z.ZodString;
1818
+ role: z.ZodEnum<["user", "assistant", "system"]>;
1819
+ content: z.ZodString;
1820
+ createdAt: z.ZodNumber;
1821
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
1822
+ }, "strip", z.ZodTypeAny, {
1823
+ id: string;
1824
+ role: "user" | "assistant" | "system";
1825
+ content: string;
1826
+ createdAt: number;
1827
+ isStreaming?: boolean | undefined;
1828
+ }, {
1829
+ id: string;
1830
+ role: "user" | "assistant" | "system";
1831
+ content: string;
1832
+ createdAt: number;
1833
+ isStreaming?: boolean | undefined;
1834
+ }>>;
1835
+ delta: z.ZodOptional<z.ZodString>;
1836
+ toolCall: z.ZodOptional<z.ZodObject<{
1837
+ id: z.ZodString;
1838
+ name: z.ZodString;
1839
+ input: z.ZodOptional<z.ZodString>;
1840
+ output: z.ZodOptional<z.ZodString>;
1841
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
1842
+ }, "strip", z.ZodTypeAny, {
1843
+ status: "running" | "pending" | "completed" | "failed";
1844
+ id: string;
1845
+ name: string;
1846
+ input?: string | undefined;
1847
+ output?: string | undefined;
1848
+ }, {
1849
+ id: string;
1850
+ name: string;
1851
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
1852
+ input?: string | undefined;
1853
+ output?: string | undefined;
1854
+ }>>;
1855
+ plan: z.ZodOptional<z.ZodArray<z.ZodObject<{
1856
+ id: z.ZodString;
1857
+ text: z.ZodString;
1858
+ status: z.ZodEnum<["pending", "in_progress", "completed"]>;
1859
+ }, "strip", z.ZodTypeAny, {
1860
+ status: "pending" | "completed" | "in_progress";
1861
+ id: string;
1862
+ text: string;
1863
+ }, {
1864
+ status: "pending" | "completed" | "in_progress";
1865
+ id: string;
1866
+ text: string;
1867
+ }>, "many">>;
1868
+ status: z.ZodOptional<z.ZodEnum<["idle", "running", "waiting_permission", "error"]>>;
1869
+ error: z.ZodOptional<z.ZodString>;
1870
+ }, "strip", z.ZodTypeAny, {
1871
+ kind: "error" | "message" | "status" | "message_delta" | "tool_call" | "tool_result" | "plan";
1872
+ error?: string | undefined;
1873
+ message?: {
1874
+ id: string;
1875
+ role: "user" | "assistant" | "system";
1876
+ content: string;
1877
+ createdAt: number;
1878
+ isStreaming?: boolean | undefined;
1879
+ } | undefined;
1880
+ status?: "error" | "running" | "idle" | "waiting_permission" | undefined;
1881
+ agentSessionId?: string | undefined;
1882
+ plan?: {
1883
+ status: "pending" | "completed" | "in_progress";
1884
+ id: string;
1885
+ text: string;
1886
+ }[] | undefined;
1887
+ delta?: string | undefined;
1888
+ toolCall?: {
1889
+ status: "running" | "pending" | "completed" | "failed";
1890
+ id: string;
1891
+ name: string;
1892
+ input?: string | undefined;
1893
+ output?: string | undefined;
1894
+ } | undefined;
1895
+ }, {
1896
+ kind: "error" | "message" | "status" | "message_delta" | "tool_call" | "tool_result" | "plan";
1897
+ error?: string | undefined;
1898
+ message?: {
1899
+ id: string;
1900
+ role: "user" | "assistant" | "system";
1901
+ content: string;
1902
+ createdAt: number;
1903
+ isStreaming?: boolean | undefined;
1904
+ } | undefined;
1905
+ status?: "error" | "running" | "idle" | "waiting_permission" | undefined;
1906
+ agentSessionId?: string | undefined;
1907
+ plan?: {
1908
+ status: "pending" | "completed" | "in_progress";
1909
+ id: string;
1910
+ text: string;
1911
+ }[] | undefined;
1912
+ delta?: string | undefined;
1913
+ toolCall?: {
1914
+ id: string;
1915
+ name: string;
1916
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
1917
+ input?: string | undefined;
1918
+ output?: string | undefined;
1919
+ } | undefined;
1920
+ }>;
1921
+ readonly "agent.permission.request": z.ZodObject<{
1922
+ requestId: z.ZodString;
1923
+ toolName: z.ZodOptional<z.ZodString>;
1924
+ toolInput: z.ZodOptional<z.ZodString>;
1925
+ context: z.ZodOptional<z.ZodString>;
1926
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
1927
+ id: z.ZodString;
1928
+ label: z.ZodString;
1929
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
1930
+ }, "strip", z.ZodTypeAny, {
1931
+ id: string;
1932
+ kind: "allow" | "deny" | "other";
1933
+ label: string;
1934
+ }, {
1935
+ id: string;
1936
+ label: string;
1937
+ kind?: "allow" | "deny" | "other" | undefined;
1938
+ }>, "many">>;
1939
+ } & {
1940
+ agentSessionId: z.ZodOptional<z.ZodString>;
1941
+ }, "strip", z.ZodTypeAny, {
1942
+ options: {
1943
+ id: string;
1944
+ kind: "allow" | "deny" | "other";
1945
+ label: string;
1946
+ }[];
1947
+ requestId: string;
1948
+ toolName?: string | undefined;
1949
+ toolInput?: string | undefined;
1950
+ agentSessionId?: string | undefined;
1951
+ context?: string | undefined;
1952
+ }, {
1953
+ requestId: string;
1954
+ options?: {
1955
+ id: string;
1956
+ label: string;
1957
+ kind?: "allow" | "deny" | "other" | undefined;
1958
+ }[] | undefined;
1959
+ toolName?: string | undefined;
1960
+ toolInput?: string | undefined;
1961
+ agentSessionId?: string | undefined;
1962
+ context?: string | undefined;
1963
+ }>;
1964
+ readonly "agent.permission.response": z.ZodObject<{
1965
+ agentSessionId: z.ZodOptional<z.ZodString>;
1966
+ requestId: z.ZodString;
1967
+ outcome: z.ZodEnum<["allow", "deny", "cancelled"]>;
1968
+ optionId: z.ZodOptional<z.ZodString>;
1969
+ }, "strip", z.ZodTypeAny, {
1970
+ requestId: string;
1971
+ outcome: "allow" | "deny" | "cancelled";
1972
+ agentSessionId?: string | undefined;
1973
+ optionId?: string | undefined;
1974
+ }, {
1975
+ requestId: string;
1976
+ outcome: "allow" | "deny" | "cancelled";
1977
+ agentSessionId?: string | undefined;
1978
+ optionId?: string | undefined;
1979
+ }>;
1980
+ readonly "agent.snapshot": z.ZodObject<{
1981
+ agentSessionId: z.ZodOptional<z.ZodString>;
1982
+ capabilities: z.ZodOptional<z.ZodObject<{
1983
+ enabled: z.ZodBoolean;
1984
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
1985
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
1986
+ error: z.ZodOptional<z.ZodString>;
1987
+ supportsSessionList: z.ZodDefault<z.ZodBoolean>;
1988
+ supportsSessionLoad: z.ZodDefault<z.ZodBoolean>;
1989
+ supportsImages: z.ZodDefault<z.ZodBoolean>;
1990
+ supportsAudio: z.ZodDefault<z.ZodBoolean>;
1991
+ supportsPermission: z.ZodDefault<z.ZodBoolean>;
1992
+ supportsPlan: z.ZodDefault<z.ZodBoolean>;
1993
+ supportsCancel: z.ZodDefault<z.ZodBoolean>;
1994
+ }, "strip", z.ZodTypeAny, {
1995
+ enabled: boolean;
1996
+ supportsSessionList: boolean;
1997
+ supportsSessionLoad: boolean;
1998
+ supportsImages: boolean;
1999
+ supportsAudio: boolean;
2000
+ supportsPermission: boolean;
2001
+ supportsPlan: boolean;
2002
+ supportsCancel: boolean;
2003
+ error?: string | undefined;
2004
+ provider?: "claude" | "codex" | "custom" | undefined;
2005
+ protocolVersion?: number | undefined;
2006
+ }, {
2007
+ enabled: boolean;
2008
+ error?: string | undefined;
2009
+ provider?: "claude" | "codex" | "custom" | undefined;
2010
+ protocolVersion?: number | undefined;
2011
+ supportsSessionList?: boolean | undefined;
2012
+ supportsSessionLoad?: boolean | undefined;
2013
+ supportsImages?: boolean | undefined;
2014
+ supportsAudio?: boolean | undefined;
2015
+ supportsPermission?: boolean | undefined;
2016
+ supportsPlan?: boolean | undefined;
2017
+ supportsCancel?: boolean | undefined;
2018
+ }>>;
2019
+ messages: z.ZodDefault<z.ZodArray<z.ZodObject<{
2020
+ id: z.ZodString;
2021
+ role: z.ZodEnum<["user", "assistant", "system"]>;
2022
+ content: z.ZodString;
2023
+ createdAt: z.ZodNumber;
2024
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
2025
+ }, "strip", z.ZodTypeAny, {
2026
+ id: string;
2027
+ role: "user" | "assistant" | "system";
2028
+ content: string;
2029
+ createdAt: number;
2030
+ isStreaming?: boolean | undefined;
2031
+ }, {
2032
+ id: string;
2033
+ role: "user" | "assistant" | "system";
2034
+ content: string;
2035
+ createdAt: number;
2036
+ isStreaming?: boolean | undefined;
2037
+ }>, "many">>;
2038
+ toolCalls: z.ZodDefault<z.ZodArray<z.ZodObject<{
2039
+ id: z.ZodString;
2040
+ name: z.ZodString;
2041
+ input: z.ZodOptional<z.ZodString>;
2042
+ output: z.ZodOptional<z.ZodString>;
2043
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
2044
+ }, "strip", z.ZodTypeAny, {
2045
+ status: "running" | "pending" | "completed" | "failed";
2046
+ id: string;
2047
+ name: string;
2048
+ input?: string | undefined;
2049
+ output?: string | undefined;
2050
+ }, {
2051
+ id: string;
2052
+ name: string;
2053
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
2054
+ input?: string | undefined;
2055
+ output?: string | undefined;
2056
+ }>, "many">>;
2057
+ pendingPermissions: z.ZodDefault<z.ZodArray<z.ZodObject<{
2058
+ requestId: z.ZodString;
2059
+ toolName: z.ZodOptional<z.ZodString>;
2060
+ toolInput: z.ZodOptional<z.ZodString>;
2061
+ context: z.ZodOptional<z.ZodString>;
2062
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
2063
+ id: z.ZodString;
2064
+ label: z.ZodString;
2065
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
2066
+ }, "strip", z.ZodTypeAny, {
2067
+ id: string;
2068
+ kind: "allow" | "deny" | "other";
2069
+ label: string;
2070
+ }, {
2071
+ id: string;
2072
+ label: string;
2073
+ kind?: "allow" | "deny" | "other" | undefined;
2074
+ }>, "many">>;
2075
+ }, "strip", z.ZodTypeAny, {
2076
+ options: {
2077
+ id: string;
2078
+ kind: "allow" | "deny" | "other";
2079
+ label: string;
2080
+ }[];
2081
+ requestId: string;
2082
+ toolName?: string | undefined;
2083
+ toolInput?: string | undefined;
2084
+ context?: string | undefined;
2085
+ }, {
2086
+ requestId: string;
2087
+ options?: {
2088
+ id: string;
2089
+ label: string;
2090
+ kind?: "allow" | "deny" | "other" | undefined;
2091
+ }[] | undefined;
2092
+ toolName?: string | undefined;
2093
+ toolInput?: string | undefined;
2094
+ context?: string | undefined;
2095
+ }>, "many">>;
2096
+ status: z.ZodDefault<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
2097
+ error: z.ZodOptional<z.ZodString>;
2098
+ }, "strip", z.ZodTypeAny, {
2099
+ status: "error" | "running" | "idle" | "waiting_permission" | "unavailable";
2100
+ messages: {
2101
+ id: string;
2102
+ role: "user" | "assistant" | "system";
2103
+ content: string;
2104
+ createdAt: number;
2105
+ isStreaming?: boolean | undefined;
2106
+ }[];
2107
+ toolCalls: {
2108
+ status: "running" | "pending" | "completed" | "failed";
2109
+ id: string;
2110
+ name: string;
2111
+ input?: string | undefined;
2112
+ output?: string | undefined;
2113
+ }[];
2114
+ pendingPermissions: {
2115
+ options: {
2116
+ id: string;
2117
+ kind: "allow" | "deny" | "other";
2118
+ label: string;
2119
+ }[];
2120
+ requestId: string;
2121
+ toolName?: string | undefined;
2122
+ toolInput?: string | undefined;
2123
+ context?: string | undefined;
2124
+ }[];
2125
+ error?: string | undefined;
2126
+ agentSessionId?: string | undefined;
2127
+ capabilities?: {
2128
+ enabled: boolean;
2129
+ supportsSessionList: boolean;
2130
+ supportsSessionLoad: boolean;
2131
+ supportsImages: boolean;
2132
+ supportsAudio: boolean;
2133
+ supportsPermission: boolean;
2134
+ supportsPlan: boolean;
2135
+ supportsCancel: boolean;
2136
+ error?: string | undefined;
2137
+ provider?: "claude" | "codex" | "custom" | undefined;
2138
+ protocolVersion?: number | undefined;
2139
+ } | undefined;
2140
+ }, {
2141
+ error?: string | undefined;
2142
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
2143
+ agentSessionId?: string | undefined;
2144
+ capabilities?: {
2145
+ enabled: boolean;
2146
+ error?: string | undefined;
2147
+ provider?: "claude" | "codex" | "custom" | undefined;
2148
+ protocolVersion?: number | undefined;
2149
+ supportsSessionList?: boolean | undefined;
2150
+ supportsSessionLoad?: boolean | undefined;
2151
+ supportsImages?: boolean | undefined;
2152
+ supportsAudio?: boolean | undefined;
2153
+ supportsPermission?: boolean | undefined;
2154
+ supportsPlan?: boolean | undefined;
2155
+ supportsCancel?: boolean | undefined;
2156
+ } | undefined;
2157
+ messages?: {
2158
+ id: string;
2159
+ role: "user" | "assistant" | "system";
2160
+ content: string;
2161
+ createdAt: number;
2162
+ isStreaming?: boolean | undefined;
2163
+ }[] | undefined;
2164
+ toolCalls?: {
2165
+ id: string;
2166
+ name: string;
2167
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
2168
+ input?: string | undefined;
2169
+ output?: string | undefined;
2170
+ }[] | undefined;
2171
+ pendingPermissions?: {
2172
+ requestId: string;
2173
+ options?: {
2174
+ id: string;
2175
+ label: string;
2176
+ kind?: "allow" | "deny" | "other" | undefined;
2177
+ }[] | undefined;
2178
+ toolName?: string | undefined;
2179
+ toolInput?: string | undefined;
2180
+ context?: string | undefined;
2181
+ }[] | undefined;
2182
+ }>;
1129
2183
  };
1130
2184
  export type ProtocolMessageType = keyof typeof protocolMessageSchemas;
1131
2185
  export declare function createEnvelope<T>(input: {