@linkshell/gateway 0.2.27 → 0.2.29

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.
@@ -602,6 +602,2522 @@ export declare const terminalHistoryResponsePayloadSchema: z.ZodObject<{
602
602
  entries: string[];
603
603
  shell?: string | undefined;
604
604
  }>;
605
+ export declare const agentProviderSchema: z.ZodEnum<["codex", "claude", "custom"]>;
606
+ export declare const agentReasoningEffortSchema: z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>;
607
+ export declare const agentPermissionModeSchema: z.ZodEnum<["read_only", "workspace_write", "full_access"]>;
608
+ export declare const agentContentBlockSchema: z.ZodObject<{
609
+ type: z.ZodEnum<["text", "image"]>;
610
+ text: z.ZodOptional<z.ZodString>;
611
+ data: z.ZodOptional<z.ZodString>;
612
+ mimeType: z.ZodOptional<z.ZodString>;
613
+ }, "strip", z.ZodTypeAny, {
614
+ type: "text" | "image";
615
+ data?: string | undefined;
616
+ text?: string | undefined;
617
+ mimeType?: string | undefined;
618
+ }, {
619
+ type: "text" | "image";
620
+ data?: string | undefined;
621
+ text?: string | undefined;
622
+ mimeType?: string | undefined;
623
+ }>;
624
+ export declare const agentMessageSchema: z.ZodObject<{
625
+ id: z.ZodString;
626
+ role: z.ZodEnum<["user", "assistant", "system"]>;
627
+ content: z.ZodString;
628
+ createdAt: z.ZodNumber;
629
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
630
+ }, "strip", z.ZodTypeAny, {
631
+ id: string;
632
+ role: "user" | "assistant" | "system";
633
+ content: string;
634
+ createdAt: number;
635
+ isStreaming?: boolean | undefined;
636
+ }, {
637
+ id: string;
638
+ role: "user" | "assistant" | "system";
639
+ content: string;
640
+ createdAt: number;
641
+ isStreaming?: boolean | undefined;
642
+ }>;
643
+ export declare const agentToolCallSchema: z.ZodObject<{
644
+ id: z.ZodString;
645
+ name: z.ZodString;
646
+ input: z.ZodOptional<z.ZodString>;
647
+ output: z.ZodOptional<z.ZodString>;
648
+ createdAt: z.ZodOptional<z.ZodNumber>;
649
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
650
+ }, "strip", z.ZodTypeAny, {
651
+ status: "running" | "pending" | "completed" | "failed";
652
+ id: string;
653
+ name: string;
654
+ createdAt?: number | undefined;
655
+ input?: string | undefined;
656
+ output?: string | undefined;
657
+ }, {
658
+ id: string;
659
+ name: string;
660
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
661
+ createdAt?: number | undefined;
662
+ input?: string | undefined;
663
+ output?: string | undefined;
664
+ }>;
665
+ export declare const agentPermissionSchema: z.ZodObject<{
666
+ requestId: z.ZodString;
667
+ toolName: z.ZodOptional<z.ZodString>;
668
+ toolInput: z.ZodOptional<z.ZodString>;
669
+ context: z.ZodOptional<z.ZodString>;
670
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
671
+ id: z.ZodString;
672
+ label: z.ZodString;
673
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
674
+ }, "strip", z.ZodTypeAny, {
675
+ id: string;
676
+ kind: "allow" | "deny" | "other";
677
+ label: string;
678
+ }, {
679
+ id: string;
680
+ label: string;
681
+ kind?: "allow" | "deny" | "other" | undefined;
682
+ }>, "many">>;
683
+ }, "strip", z.ZodTypeAny, {
684
+ options: {
685
+ id: string;
686
+ kind: "allow" | "deny" | "other";
687
+ label: string;
688
+ }[];
689
+ requestId: string;
690
+ toolName?: string | undefined;
691
+ toolInput?: string | undefined;
692
+ context?: string | undefined;
693
+ }, {
694
+ requestId: string;
695
+ options?: {
696
+ id: string;
697
+ label: string;
698
+ kind?: "allow" | "deny" | "other" | undefined;
699
+ }[] | undefined;
700
+ toolName?: string | undefined;
701
+ toolInput?: string | undefined;
702
+ context?: string | undefined;
703
+ }>;
704
+ export declare const agentCapabilitiesPayloadSchema: z.ZodObject<{
705
+ enabled: z.ZodBoolean;
706
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
707
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
708
+ error: z.ZodOptional<z.ZodString>;
709
+ supportsSessionList: z.ZodDefault<z.ZodBoolean>;
710
+ supportsSessionLoad: z.ZodDefault<z.ZodBoolean>;
711
+ supportsImages: z.ZodDefault<z.ZodBoolean>;
712
+ supportsAudio: z.ZodDefault<z.ZodBoolean>;
713
+ supportsPermission: z.ZodDefault<z.ZodBoolean>;
714
+ supportsPlan: z.ZodDefault<z.ZodBoolean>;
715
+ supportsCancel: z.ZodDefault<z.ZodBoolean>;
716
+ }, "strip", z.ZodTypeAny, {
717
+ enabled: boolean;
718
+ supportsSessionList: boolean;
719
+ supportsSessionLoad: boolean;
720
+ supportsImages: boolean;
721
+ supportsAudio: boolean;
722
+ supportsPermission: boolean;
723
+ supportsPlan: boolean;
724
+ supportsCancel: boolean;
725
+ error?: string | undefined;
726
+ provider?: "claude" | "codex" | "custom" | undefined;
727
+ protocolVersion?: number | undefined;
728
+ }, {
729
+ enabled: boolean;
730
+ error?: string | undefined;
731
+ provider?: "claude" | "codex" | "custom" | undefined;
732
+ protocolVersion?: number | undefined;
733
+ supportsSessionList?: boolean | undefined;
734
+ supportsSessionLoad?: boolean | undefined;
735
+ supportsImages?: boolean | undefined;
736
+ supportsAudio?: boolean | undefined;
737
+ supportsPermission?: boolean | undefined;
738
+ supportsPlan?: boolean | undefined;
739
+ supportsCancel?: boolean | undefined;
740
+ }>;
741
+ export declare const agentInitializePayloadSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
742
+ export declare const agentSessionNewPayloadSchema: z.ZodObject<{
743
+ cwd: z.ZodOptional<z.ZodString>;
744
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
745
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
746
+ }, "strip", z.ZodTypeAny, {
747
+ provider?: "claude" | "codex" | "custom" | undefined;
748
+ cwd?: string | undefined;
749
+ mcpServers?: Record<string, unknown> | undefined;
750
+ }, {
751
+ provider?: "claude" | "codex" | "custom" | undefined;
752
+ cwd?: string | undefined;
753
+ mcpServers?: Record<string, unknown> | undefined;
754
+ }>;
755
+ export declare const agentSessionLoadPayloadSchema: z.ZodObject<{
756
+ agentSessionId: z.ZodString;
757
+ cwd: z.ZodOptional<z.ZodString>;
758
+ }, "strip", z.ZodTypeAny, {
759
+ agentSessionId: string;
760
+ cwd?: string | undefined;
761
+ }, {
762
+ agentSessionId: string;
763
+ cwd?: string | undefined;
764
+ }>;
765
+ export declare const agentSessionListPayloadSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
766
+ export declare const agentPromptPayloadSchema: z.ZodObject<{
767
+ agentSessionId: z.ZodOptional<z.ZodString>;
768
+ clientMessageId: z.ZodString;
769
+ contentBlocks: z.ZodArray<z.ZodObject<{
770
+ type: z.ZodEnum<["text", "image"]>;
771
+ text: z.ZodOptional<z.ZodString>;
772
+ data: z.ZodOptional<z.ZodString>;
773
+ mimeType: z.ZodOptional<z.ZodString>;
774
+ }, "strip", z.ZodTypeAny, {
775
+ type: "text" | "image";
776
+ data?: string | undefined;
777
+ text?: string | undefined;
778
+ mimeType?: string | undefined;
779
+ }, {
780
+ type: "text" | "image";
781
+ data?: string | undefined;
782
+ text?: string | undefined;
783
+ mimeType?: string | undefined;
784
+ }>, "many">;
785
+ model: z.ZodOptional<z.ZodString>;
786
+ reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
787
+ permissionMode: z.ZodOptional<z.ZodEnum<["read_only", "workspace_write", "full_access"]>>;
788
+ }, "strip", z.ZodTypeAny, {
789
+ clientMessageId: string;
790
+ contentBlocks: {
791
+ type: "text" | "image";
792
+ data?: string | undefined;
793
+ text?: string | undefined;
794
+ mimeType?: string | undefined;
795
+ }[];
796
+ agentSessionId?: string | undefined;
797
+ model?: string | undefined;
798
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
799
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
800
+ }, {
801
+ clientMessageId: string;
802
+ contentBlocks: {
803
+ type: "text" | "image";
804
+ data?: string | undefined;
805
+ text?: string | undefined;
806
+ mimeType?: string | undefined;
807
+ }[];
808
+ agentSessionId?: string | undefined;
809
+ model?: string | undefined;
810
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
811
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
812
+ }>;
813
+ export declare const agentCancelPayloadSchema: z.ZodObject<{
814
+ agentSessionId: z.ZodOptional<z.ZodString>;
815
+ }, "strip", z.ZodTypeAny, {
816
+ agentSessionId?: string | undefined;
817
+ }, {
818
+ agentSessionId?: string | undefined;
819
+ }>;
820
+ export declare const agentUpdatePayloadSchema: z.ZodObject<{
821
+ agentSessionId: z.ZodOptional<z.ZodString>;
822
+ kind: z.ZodEnum<["message", "message_delta", "tool_call", "tool_result", "plan", "status", "error"]>;
823
+ message: z.ZodOptional<z.ZodObject<{
824
+ id: z.ZodString;
825
+ role: z.ZodEnum<["user", "assistant", "system"]>;
826
+ content: z.ZodString;
827
+ createdAt: z.ZodNumber;
828
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
829
+ }, "strip", z.ZodTypeAny, {
830
+ id: string;
831
+ role: "user" | "assistant" | "system";
832
+ content: string;
833
+ createdAt: number;
834
+ isStreaming?: boolean | undefined;
835
+ }, {
836
+ id: string;
837
+ role: "user" | "assistant" | "system";
838
+ content: string;
839
+ createdAt: number;
840
+ isStreaming?: boolean | undefined;
841
+ }>>;
842
+ delta: z.ZodOptional<z.ZodString>;
843
+ toolCall: z.ZodOptional<z.ZodObject<{
844
+ id: z.ZodString;
845
+ name: z.ZodString;
846
+ input: z.ZodOptional<z.ZodString>;
847
+ output: z.ZodOptional<z.ZodString>;
848
+ createdAt: z.ZodOptional<z.ZodNumber>;
849
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
850
+ }, "strip", z.ZodTypeAny, {
851
+ status: "running" | "pending" | "completed" | "failed";
852
+ id: string;
853
+ name: string;
854
+ createdAt?: number | undefined;
855
+ input?: string | undefined;
856
+ output?: string | undefined;
857
+ }, {
858
+ id: string;
859
+ name: string;
860
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
861
+ createdAt?: number | undefined;
862
+ input?: string | undefined;
863
+ output?: string | undefined;
864
+ }>>;
865
+ plan: z.ZodOptional<z.ZodArray<z.ZodObject<{
866
+ id: z.ZodString;
867
+ text: z.ZodString;
868
+ status: z.ZodEnum<["pending", "in_progress", "completed"]>;
869
+ }, "strip", z.ZodTypeAny, {
870
+ status: "pending" | "completed" | "in_progress";
871
+ id: string;
872
+ text: string;
873
+ }, {
874
+ status: "pending" | "completed" | "in_progress";
875
+ id: string;
876
+ text: string;
877
+ }>, "many">>;
878
+ status: z.ZodOptional<z.ZodEnum<["idle", "running", "waiting_permission", "error"]>>;
879
+ error: z.ZodOptional<z.ZodString>;
880
+ }, "strip", z.ZodTypeAny, {
881
+ kind: "error" | "message" | "status" | "message_delta" | "tool_call" | "tool_result" | "plan";
882
+ error?: string | undefined;
883
+ message?: {
884
+ id: string;
885
+ role: "user" | "assistant" | "system";
886
+ content: string;
887
+ createdAt: number;
888
+ isStreaming?: boolean | undefined;
889
+ } | undefined;
890
+ status?: "error" | "running" | "idle" | "waiting_permission" | undefined;
891
+ agentSessionId?: string | undefined;
892
+ plan?: {
893
+ status: "pending" | "completed" | "in_progress";
894
+ id: string;
895
+ text: string;
896
+ }[] | undefined;
897
+ delta?: string | undefined;
898
+ toolCall?: {
899
+ status: "running" | "pending" | "completed" | "failed";
900
+ id: string;
901
+ name: string;
902
+ createdAt?: number | undefined;
903
+ input?: string | undefined;
904
+ output?: string | undefined;
905
+ } | undefined;
906
+ }, {
907
+ kind: "error" | "message" | "status" | "message_delta" | "tool_call" | "tool_result" | "plan";
908
+ error?: string | undefined;
909
+ message?: {
910
+ id: string;
911
+ role: "user" | "assistant" | "system";
912
+ content: string;
913
+ createdAt: number;
914
+ isStreaming?: boolean | undefined;
915
+ } | undefined;
916
+ status?: "error" | "running" | "idle" | "waiting_permission" | undefined;
917
+ agentSessionId?: string | undefined;
918
+ plan?: {
919
+ status: "pending" | "completed" | "in_progress";
920
+ id: string;
921
+ text: string;
922
+ }[] | undefined;
923
+ delta?: string | undefined;
924
+ toolCall?: {
925
+ id: string;
926
+ name: string;
927
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
928
+ createdAt?: number | undefined;
929
+ input?: string | undefined;
930
+ output?: string | undefined;
931
+ } | undefined;
932
+ }>;
933
+ export declare const agentPermissionRequestPayloadSchema: z.ZodObject<{
934
+ requestId: z.ZodString;
935
+ toolName: z.ZodOptional<z.ZodString>;
936
+ toolInput: z.ZodOptional<z.ZodString>;
937
+ context: z.ZodOptional<z.ZodString>;
938
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
939
+ id: z.ZodString;
940
+ label: z.ZodString;
941
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
942
+ }, "strip", z.ZodTypeAny, {
943
+ id: string;
944
+ kind: "allow" | "deny" | "other";
945
+ label: string;
946
+ }, {
947
+ id: string;
948
+ label: string;
949
+ kind?: "allow" | "deny" | "other" | undefined;
950
+ }>, "many">>;
951
+ } & {
952
+ agentSessionId: z.ZodOptional<z.ZodString>;
953
+ }, "strip", z.ZodTypeAny, {
954
+ options: {
955
+ id: string;
956
+ kind: "allow" | "deny" | "other";
957
+ label: string;
958
+ }[];
959
+ requestId: string;
960
+ toolName?: string | undefined;
961
+ toolInput?: string | undefined;
962
+ agentSessionId?: string | undefined;
963
+ context?: string | undefined;
964
+ }, {
965
+ requestId: string;
966
+ options?: {
967
+ id: string;
968
+ label: string;
969
+ kind?: "allow" | "deny" | "other" | undefined;
970
+ }[] | undefined;
971
+ toolName?: string | undefined;
972
+ toolInput?: string | undefined;
973
+ agentSessionId?: string | undefined;
974
+ context?: string | undefined;
975
+ }>;
976
+ export declare const agentPermissionResponsePayloadSchema: z.ZodObject<{
977
+ agentSessionId: z.ZodOptional<z.ZodString>;
978
+ requestId: z.ZodString;
979
+ outcome: z.ZodEnum<["allow", "deny", "cancelled"]>;
980
+ optionId: z.ZodOptional<z.ZodString>;
981
+ }, "strip", z.ZodTypeAny, {
982
+ requestId: string;
983
+ outcome: "allow" | "deny" | "cancelled";
984
+ agentSessionId?: string | undefined;
985
+ optionId?: string | undefined;
986
+ }, {
987
+ requestId: string;
988
+ outcome: "allow" | "deny" | "cancelled";
989
+ agentSessionId?: string | undefined;
990
+ optionId?: string | undefined;
991
+ }>;
992
+ export declare const agentSnapshotPayloadSchema: z.ZodObject<{
993
+ agentSessionId: z.ZodOptional<z.ZodString>;
994
+ capabilities: z.ZodOptional<z.ZodObject<{
995
+ enabled: z.ZodBoolean;
996
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
997
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
998
+ error: z.ZodOptional<z.ZodString>;
999
+ supportsSessionList: z.ZodDefault<z.ZodBoolean>;
1000
+ supportsSessionLoad: z.ZodDefault<z.ZodBoolean>;
1001
+ supportsImages: z.ZodDefault<z.ZodBoolean>;
1002
+ supportsAudio: z.ZodDefault<z.ZodBoolean>;
1003
+ supportsPermission: z.ZodDefault<z.ZodBoolean>;
1004
+ supportsPlan: z.ZodDefault<z.ZodBoolean>;
1005
+ supportsCancel: z.ZodDefault<z.ZodBoolean>;
1006
+ }, "strip", z.ZodTypeAny, {
1007
+ enabled: boolean;
1008
+ supportsSessionList: boolean;
1009
+ supportsSessionLoad: boolean;
1010
+ supportsImages: boolean;
1011
+ supportsAudio: boolean;
1012
+ supportsPermission: boolean;
1013
+ supportsPlan: boolean;
1014
+ supportsCancel: boolean;
1015
+ error?: string | undefined;
1016
+ provider?: "claude" | "codex" | "custom" | undefined;
1017
+ protocolVersion?: number | undefined;
1018
+ }, {
1019
+ enabled: boolean;
1020
+ error?: string | undefined;
1021
+ provider?: "claude" | "codex" | "custom" | undefined;
1022
+ protocolVersion?: number | undefined;
1023
+ supportsSessionList?: boolean | undefined;
1024
+ supportsSessionLoad?: boolean | undefined;
1025
+ supportsImages?: boolean | undefined;
1026
+ supportsAudio?: boolean | undefined;
1027
+ supportsPermission?: boolean | undefined;
1028
+ supportsPlan?: boolean | undefined;
1029
+ supportsCancel?: boolean | undefined;
1030
+ }>>;
1031
+ messages: z.ZodDefault<z.ZodArray<z.ZodObject<{
1032
+ id: z.ZodString;
1033
+ role: z.ZodEnum<["user", "assistant", "system"]>;
1034
+ content: z.ZodString;
1035
+ createdAt: z.ZodNumber;
1036
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
1037
+ }, "strip", z.ZodTypeAny, {
1038
+ id: string;
1039
+ role: "user" | "assistant" | "system";
1040
+ content: string;
1041
+ createdAt: number;
1042
+ isStreaming?: boolean | undefined;
1043
+ }, {
1044
+ id: string;
1045
+ role: "user" | "assistant" | "system";
1046
+ content: string;
1047
+ createdAt: number;
1048
+ isStreaming?: boolean | undefined;
1049
+ }>, "many">>;
1050
+ toolCalls: z.ZodDefault<z.ZodArray<z.ZodObject<{
1051
+ id: z.ZodString;
1052
+ name: z.ZodString;
1053
+ input: z.ZodOptional<z.ZodString>;
1054
+ output: z.ZodOptional<z.ZodString>;
1055
+ createdAt: z.ZodOptional<z.ZodNumber>;
1056
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
1057
+ }, "strip", z.ZodTypeAny, {
1058
+ status: "running" | "pending" | "completed" | "failed";
1059
+ id: string;
1060
+ name: string;
1061
+ createdAt?: number | undefined;
1062
+ input?: string | undefined;
1063
+ output?: string | undefined;
1064
+ }, {
1065
+ id: string;
1066
+ name: string;
1067
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
1068
+ createdAt?: number | undefined;
1069
+ input?: string | undefined;
1070
+ output?: string | undefined;
1071
+ }>, "many">>;
1072
+ pendingPermissions: z.ZodDefault<z.ZodArray<z.ZodObject<{
1073
+ requestId: z.ZodString;
1074
+ toolName: z.ZodOptional<z.ZodString>;
1075
+ toolInput: z.ZodOptional<z.ZodString>;
1076
+ context: z.ZodOptional<z.ZodString>;
1077
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
1078
+ id: z.ZodString;
1079
+ label: z.ZodString;
1080
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
1081
+ }, "strip", z.ZodTypeAny, {
1082
+ id: string;
1083
+ kind: "allow" | "deny" | "other";
1084
+ label: string;
1085
+ }, {
1086
+ id: string;
1087
+ label: string;
1088
+ kind?: "allow" | "deny" | "other" | undefined;
1089
+ }>, "many">>;
1090
+ }, "strip", z.ZodTypeAny, {
1091
+ options: {
1092
+ id: string;
1093
+ kind: "allow" | "deny" | "other";
1094
+ label: string;
1095
+ }[];
1096
+ requestId: string;
1097
+ toolName?: string | undefined;
1098
+ toolInput?: string | undefined;
1099
+ context?: string | undefined;
1100
+ }, {
1101
+ requestId: string;
1102
+ options?: {
1103
+ id: string;
1104
+ label: string;
1105
+ kind?: "allow" | "deny" | "other" | undefined;
1106
+ }[] | undefined;
1107
+ toolName?: string | undefined;
1108
+ toolInput?: string | undefined;
1109
+ context?: string | undefined;
1110
+ }>, "many">>;
1111
+ status: z.ZodDefault<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
1112
+ error: z.ZodOptional<z.ZodString>;
1113
+ }, "strip", z.ZodTypeAny, {
1114
+ status: "error" | "running" | "idle" | "waiting_permission" | "unavailable";
1115
+ messages: {
1116
+ id: string;
1117
+ role: "user" | "assistant" | "system";
1118
+ content: string;
1119
+ createdAt: number;
1120
+ isStreaming?: boolean | undefined;
1121
+ }[];
1122
+ toolCalls: {
1123
+ status: "running" | "pending" | "completed" | "failed";
1124
+ id: string;
1125
+ name: string;
1126
+ createdAt?: number | undefined;
1127
+ input?: string | undefined;
1128
+ output?: string | undefined;
1129
+ }[];
1130
+ pendingPermissions: {
1131
+ options: {
1132
+ id: string;
1133
+ kind: "allow" | "deny" | "other";
1134
+ label: string;
1135
+ }[];
1136
+ requestId: string;
1137
+ toolName?: string | undefined;
1138
+ toolInput?: string | undefined;
1139
+ context?: string | undefined;
1140
+ }[];
1141
+ error?: string | undefined;
1142
+ agentSessionId?: string | undefined;
1143
+ capabilities?: {
1144
+ enabled: boolean;
1145
+ supportsSessionList: boolean;
1146
+ supportsSessionLoad: boolean;
1147
+ supportsImages: boolean;
1148
+ supportsAudio: boolean;
1149
+ supportsPermission: boolean;
1150
+ supportsPlan: boolean;
1151
+ supportsCancel: boolean;
1152
+ error?: string | undefined;
1153
+ provider?: "claude" | "codex" | "custom" | undefined;
1154
+ protocolVersion?: number | undefined;
1155
+ } | undefined;
1156
+ }, {
1157
+ error?: string | undefined;
1158
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
1159
+ agentSessionId?: string | undefined;
1160
+ capabilities?: {
1161
+ enabled: boolean;
1162
+ error?: string | undefined;
1163
+ provider?: "claude" | "codex" | "custom" | undefined;
1164
+ protocolVersion?: number | undefined;
1165
+ supportsSessionList?: boolean | undefined;
1166
+ supportsSessionLoad?: boolean | undefined;
1167
+ supportsImages?: boolean | undefined;
1168
+ supportsAudio?: boolean | undefined;
1169
+ supportsPermission?: boolean | undefined;
1170
+ supportsPlan?: boolean | undefined;
1171
+ supportsCancel?: boolean | undefined;
1172
+ } | undefined;
1173
+ messages?: {
1174
+ id: string;
1175
+ role: "user" | "assistant" | "system";
1176
+ content: string;
1177
+ createdAt: number;
1178
+ isStreaming?: boolean | undefined;
1179
+ }[] | undefined;
1180
+ toolCalls?: {
1181
+ id: string;
1182
+ name: string;
1183
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
1184
+ createdAt?: number | undefined;
1185
+ input?: string | undefined;
1186
+ output?: string | undefined;
1187
+ }[] | undefined;
1188
+ pendingPermissions?: {
1189
+ requestId: string;
1190
+ options?: {
1191
+ id: string;
1192
+ label: string;
1193
+ kind?: "allow" | "deny" | "other" | undefined;
1194
+ }[] | undefined;
1195
+ toolName?: string | undefined;
1196
+ toolInput?: string | undefined;
1197
+ context?: string | undefined;
1198
+ }[] | undefined;
1199
+ }>;
1200
+ export declare const agentV2StatusSchema: z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>;
1201
+ export declare const agentV2TimelineItemSchema: z.ZodObject<{
1202
+ id: z.ZodString;
1203
+ conversationId: z.ZodString;
1204
+ type: z.ZodEnum<["message", "tool_call", "plan", "permission", "status", "error"]>;
1205
+ role: z.ZodOptional<z.ZodEnum<["user", "assistant", "system"]>>;
1206
+ content: z.ZodOptional<z.ZodArray<z.ZodObject<{
1207
+ type: z.ZodEnum<["text", "image"]>;
1208
+ text: z.ZodOptional<z.ZodString>;
1209
+ data: z.ZodOptional<z.ZodString>;
1210
+ mimeType: z.ZodOptional<z.ZodString>;
1211
+ }, "strip", z.ZodTypeAny, {
1212
+ type: "text" | "image";
1213
+ data?: string | undefined;
1214
+ text?: string | undefined;
1215
+ mimeType?: string | undefined;
1216
+ }, {
1217
+ type: "text" | "image";
1218
+ data?: string | undefined;
1219
+ text?: string | undefined;
1220
+ mimeType?: string | undefined;
1221
+ }>, "many">>;
1222
+ text: z.ZodOptional<z.ZodString>;
1223
+ toolCall: z.ZodOptional<z.ZodObject<{
1224
+ id: z.ZodString;
1225
+ name: z.ZodString;
1226
+ input: z.ZodOptional<z.ZodString>;
1227
+ output: z.ZodOptional<z.ZodString>;
1228
+ createdAt: z.ZodOptional<z.ZodNumber>;
1229
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
1230
+ }, "strip", z.ZodTypeAny, {
1231
+ status: "running" | "pending" | "completed" | "failed";
1232
+ id: string;
1233
+ name: string;
1234
+ createdAt?: number | undefined;
1235
+ input?: string | undefined;
1236
+ output?: string | undefined;
1237
+ }, {
1238
+ id: string;
1239
+ name: string;
1240
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
1241
+ createdAt?: number | undefined;
1242
+ input?: string | undefined;
1243
+ output?: string | undefined;
1244
+ }>>;
1245
+ plan: z.ZodOptional<z.ZodArray<z.ZodObject<{
1246
+ id: z.ZodString;
1247
+ text: z.ZodString;
1248
+ status: z.ZodEnum<["pending", "in_progress", "completed"]>;
1249
+ }, "strip", z.ZodTypeAny, {
1250
+ status: "pending" | "completed" | "in_progress";
1251
+ id: string;
1252
+ text: string;
1253
+ }, {
1254
+ status: "pending" | "completed" | "in_progress";
1255
+ id: string;
1256
+ text: string;
1257
+ }>, "many">>;
1258
+ permission: z.ZodOptional<z.ZodObject<{
1259
+ requestId: z.ZodString;
1260
+ toolName: z.ZodOptional<z.ZodString>;
1261
+ toolInput: z.ZodOptional<z.ZodString>;
1262
+ context: z.ZodOptional<z.ZodString>;
1263
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
1264
+ id: z.ZodString;
1265
+ label: z.ZodString;
1266
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
1267
+ }, "strip", z.ZodTypeAny, {
1268
+ id: string;
1269
+ kind: "allow" | "deny" | "other";
1270
+ label: string;
1271
+ }, {
1272
+ id: string;
1273
+ label: string;
1274
+ kind?: "allow" | "deny" | "other" | undefined;
1275
+ }>, "many">>;
1276
+ }, "strip", z.ZodTypeAny, {
1277
+ options: {
1278
+ id: string;
1279
+ kind: "allow" | "deny" | "other";
1280
+ label: string;
1281
+ }[];
1282
+ requestId: string;
1283
+ toolName?: string | undefined;
1284
+ toolInput?: string | undefined;
1285
+ context?: string | undefined;
1286
+ }, {
1287
+ requestId: string;
1288
+ options?: {
1289
+ id: string;
1290
+ label: string;
1291
+ kind?: "allow" | "deny" | "other" | undefined;
1292
+ }[] | undefined;
1293
+ toolName?: string | undefined;
1294
+ toolInput?: string | undefined;
1295
+ context?: string | undefined;
1296
+ }>>;
1297
+ status: z.ZodOptional<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
1298
+ error: z.ZodOptional<z.ZodString>;
1299
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1300
+ createdAt: z.ZodNumber;
1301
+ updatedAt: z.ZodOptional<z.ZodNumber>;
1302
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
1303
+ }, "strip", z.ZodTypeAny, {
1304
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
1305
+ id: string;
1306
+ createdAt: number;
1307
+ conversationId: string;
1308
+ error?: string | undefined;
1309
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
1310
+ role?: "user" | "assistant" | "system" | undefined;
1311
+ text?: string | undefined;
1312
+ plan?: {
1313
+ status: "pending" | "completed" | "in_progress";
1314
+ id: string;
1315
+ text: string;
1316
+ }[] | undefined;
1317
+ content?: {
1318
+ type: "text" | "image";
1319
+ data?: string | undefined;
1320
+ text?: string | undefined;
1321
+ mimeType?: string | undefined;
1322
+ }[] | undefined;
1323
+ isStreaming?: boolean | undefined;
1324
+ toolCall?: {
1325
+ status: "running" | "pending" | "completed" | "failed";
1326
+ id: string;
1327
+ name: string;
1328
+ createdAt?: number | undefined;
1329
+ input?: string | undefined;
1330
+ output?: string | undefined;
1331
+ } | undefined;
1332
+ permission?: {
1333
+ options: {
1334
+ id: string;
1335
+ kind: "allow" | "deny" | "other";
1336
+ label: string;
1337
+ }[];
1338
+ requestId: string;
1339
+ toolName?: string | undefined;
1340
+ toolInput?: string | undefined;
1341
+ context?: string | undefined;
1342
+ } | undefined;
1343
+ metadata?: Record<string, unknown> | undefined;
1344
+ updatedAt?: number | undefined;
1345
+ }, {
1346
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
1347
+ id: string;
1348
+ createdAt: number;
1349
+ conversationId: string;
1350
+ error?: string | undefined;
1351
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
1352
+ role?: "user" | "assistant" | "system" | undefined;
1353
+ text?: string | undefined;
1354
+ plan?: {
1355
+ status: "pending" | "completed" | "in_progress";
1356
+ id: string;
1357
+ text: string;
1358
+ }[] | undefined;
1359
+ content?: {
1360
+ type: "text" | "image";
1361
+ data?: string | undefined;
1362
+ text?: string | undefined;
1363
+ mimeType?: string | undefined;
1364
+ }[] | undefined;
1365
+ isStreaming?: boolean | undefined;
1366
+ toolCall?: {
1367
+ id: string;
1368
+ name: string;
1369
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
1370
+ createdAt?: number | undefined;
1371
+ input?: string | undefined;
1372
+ output?: string | undefined;
1373
+ } | undefined;
1374
+ permission?: {
1375
+ requestId: string;
1376
+ options?: {
1377
+ id: string;
1378
+ label: string;
1379
+ kind?: "allow" | "deny" | "other" | undefined;
1380
+ }[] | undefined;
1381
+ toolName?: string | undefined;
1382
+ toolInput?: string | undefined;
1383
+ context?: string | undefined;
1384
+ } | undefined;
1385
+ metadata?: Record<string, unknown> | undefined;
1386
+ updatedAt?: number | undefined;
1387
+ }>;
1388
+ export declare const agentV2ConversationSchema: z.ZodObject<{
1389
+ id: z.ZodString;
1390
+ agentSessionId: z.ZodOptional<z.ZodString>;
1391
+ provider: z.ZodDefault<z.ZodEnum<["codex", "claude", "custom"]>>;
1392
+ cwd: z.ZodString;
1393
+ title: z.ZodOptional<z.ZodString>;
1394
+ model: z.ZodOptional<z.ZodString>;
1395
+ reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
1396
+ permissionMode: z.ZodOptional<z.ZodEnum<["read_only", "workspace_write", "full_access"]>>;
1397
+ status: z.ZodDefault<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
1398
+ archived: z.ZodDefault<z.ZodBoolean>;
1399
+ lastMessagePreview: z.ZodOptional<z.ZodString>;
1400
+ lastActivityAt: z.ZodNumber;
1401
+ createdAt: z.ZodNumber;
1402
+ }, "strip", z.ZodTypeAny, {
1403
+ status: "error" | "running" | "idle" | "waiting_permission" | "unavailable";
1404
+ id: string;
1405
+ provider: "claude" | "codex" | "custom";
1406
+ cwd: string;
1407
+ createdAt: number;
1408
+ archived: boolean;
1409
+ lastActivityAt: number;
1410
+ agentSessionId?: string | undefined;
1411
+ model?: string | undefined;
1412
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
1413
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
1414
+ title?: string | undefined;
1415
+ lastMessagePreview?: string | undefined;
1416
+ }, {
1417
+ id: string;
1418
+ cwd: string;
1419
+ createdAt: number;
1420
+ lastActivityAt: number;
1421
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
1422
+ provider?: "claude" | "codex" | "custom" | undefined;
1423
+ agentSessionId?: string | undefined;
1424
+ model?: string | undefined;
1425
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
1426
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
1427
+ title?: string | undefined;
1428
+ archived?: boolean | undefined;
1429
+ lastMessagePreview?: string | undefined;
1430
+ }>;
1431
+ export declare const agentV2CapabilitiesRequestPayloadSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
1432
+ export declare const agentV2CapabilitiesPayloadSchema: z.ZodObject<{
1433
+ enabled: z.ZodBoolean;
1434
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
1435
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
1436
+ error: z.ZodOptional<z.ZodString>;
1437
+ supportsSessionList: z.ZodDefault<z.ZodBoolean>;
1438
+ supportsSessionLoad: z.ZodDefault<z.ZodBoolean>;
1439
+ supportsImages: z.ZodDefault<z.ZodBoolean>;
1440
+ supportsAudio: z.ZodDefault<z.ZodBoolean>;
1441
+ supportsPermission: z.ZodDefault<z.ZodBoolean>;
1442
+ supportsPlan: z.ZodDefault<z.ZodBoolean>;
1443
+ supportsCancel: z.ZodDefault<z.ZodBoolean>;
1444
+ } & {
1445
+ workspaceProtocolVersion: z.ZodDefault<z.ZodNumber>;
1446
+ }, "strip", z.ZodTypeAny, {
1447
+ enabled: boolean;
1448
+ supportsSessionList: boolean;
1449
+ supportsSessionLoad: boolean;
1450
+ supportsImages: boolean;
1451
+ supportsAudio: boolean;
1452
+ supportsPermission: boolean;
1453
+ supportsPlan: boolean;
1454
+ supportsCancel: boolean;
1455
+ workspaceProtocolVersion: number;
1456
+ error?: string | undefined;
1457
+ provider?: "claude" | "codex" | "custom" | undefined;
1458
+ protocolVersion?: number | undefined;
1459
+ }, {
1460
+ enabled: boolean;
1461
+ error?: string | undefined;
1462
+ provider?: "claude" | "codex" | "custom" | undefined;
1463
+ protocolVersion?: number | undefined;
1464
+ supportsSessionList?: boolean | undefined;
1465
+ supportsSessionLoad?: boolean | undefined;
1466
+ supportsImages?: boolean | undefined;
1467
+ supportsAudio?: boolean | undefined;
1468
+ supportsPermission?: boolean | undefined;
1469
+ supportsPlan?: boolean | undefined;
1470
+ supportsCancel?: boolean | undefined;
1471
+ workspaceProtocolVersion?: number | undefined;
1472
+ }>;
1473
+ export declare const agentV2ConversationOpenPayloadSchema: z.ZodObject<{
1474
+ conversationId: z.ZodOptional<z.ZodString>;
1475
+ agentSessionId: z.ZodOptional<z.ZodString>;
1476
+ cwd: z.ZodOptional<z.ZodString>;
1477
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
1478
+ model: z.ZodOptional<z.ZodString>;
1479
+ reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
1480
+ permissionMode: z.ZodOptional<z.ZodEnum<["read_only", "workspace_write", "full_access"]>>;
1481
+ title: z.ZodOptional<z.ZodString>;
1482
+ }, "strip", z.ZodTypeAny, {
1483
+ provider?: "claude" | "codex" | "custom" | undefined;
1484
+ cwd?: string | undefined;
1485
+ agentSessionId?: string | undefined;
1486
+ model?: string | undefined;
1487
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
1488
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
1489
+ conversationId?: string | undefined;
1490
+ title?: string | undefined;
1491
+ }, {
1492
+ provider?: "claude" | "codex" | "custom" | undefined;
1493
+ cwd?: string | undefined;
1494
+ agentSessionId?: string | undefined;
1495
+ model?: string | undefined;
1496
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
1497
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
1498
+ conversationId?: string | undefined;
1499
+ title?: string | undefined;
1500
+ }>;
1501
+ export declare const agentV2ConversationOpenedPayloadSchema: z.ZodObject<{
1502
+ conversation: z.ZodObject<{
1503
+ id: z.ZodString;
1504
+ agentSessionId: z.ZodOptional<z.ZodString>;
1505
+ provider: z.ZodDefault<z.ZodEnum<["codex", "claude", "custom"]>>;
1506
+ cwd: z.ZodString;
1507
+ title: z.ZodOptional<z.ZodString>;
1508
+ model: z.ZodOptional<z.ZodString>;
1509
+ reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
1510
+ permissionMode: z.ZodOptional<z.ZodEnum<["read_only", "workspace_write", "full_access"]>>;
1511
+ status: z.ZodDefault<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
1512
+ archived: z.ZodDefault<z.ZodBoolean>;
1513
+ lastMessagePreview: z.ZodOptional<z.ZodString>;
1514
+ lastActivityAt: z.ZodNumber;
1515
+ createdAt: z.ZodNumber;
1516
+ }, "strip", z.ZodTypeAny, {
1517
+ status: "error" | "running" | "idle" | "waiting_permission" | "unavailable";
1518
+ id: string;
1519
+ provider: "claude" | "codex" | "custom";
1520
+ cwd: string;
1521
+ createdAt: number;
1522
+ archived: boolean;
1523
+ lastActivityAt: number;
1524
+ agentSessionId?: string | undefined;
1525
+ model?: string | undefined;
1526
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
1527
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
1528
+ title?: string | undefined;
1529
+ lastMessagePreview?: string | undefined;
1530
+ }, {
1531
+ id: string;
1532
+ cwd: string;
1533
+ createdAt: number;
1534
+ lastActivityAt: number;
1535
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
1536
+ provider?: "claude" | "codex" | "custom" | undefined;
1537
+ agentSessionId?: string | undefined;
1538
+ model?: string | undefined;
1539
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
1540
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
1541
+ title?: string | undefined;
1542
+ archived?: boolean | undefined;
1543
+ lastMessagePreview?: string | undefined;
1544
+ }>;
1545
+ snapshot: z.ZodDefault<z.ZodArray<z.ZodObject<{
1546
+ id: z.ZodString;
1547
+ conversationId: z.ZodString;
1548
+ type: z.ZodEnum<["message", "tool_call", "plan", "permission", "status", "error"]>;
1549
+ role: z.ZodOptional<z.ZodEnum<["user", "assistant", "system"]>>;
1550
+ content: z.ZodOptional<z.ZodArray<z.ZodObject<{
1551
+ type: z.ZodEnum<["text", "image"]>;
1552
+ text: z.ZodOptional<z.ZodString>;
1553
+ data: z.ZodOptional<z.ZodString>;
1554
+ mimeType: z.ZodOptional<z.ZodString>;
1555
+ }, "strip", z.ZodTypeAny, {
1556
+ type: "text" | "image";
1557
+ data?: string | undefined;
1558
+ text?: string | undefined;
1559
+ mimeType?: string | undefined;
1560
+ }, {
1561
+ type: "text" | "image";
1562
+ data?: string | undefined;
1563
+ text?: string | undefined;
1564
+ mimeType?: string | undefined;
1565
+ }>, "many">>;
1566
+ text: z.ZodOptional<z.ZodString>;
1567
+ toolCall: z.ZodOptional<z.ZodObject<{
1568
+ id: z.ZodString;
1569
+ name: z.ZodString;
1570
+ input: z.ZodOptional<z.ZodString>;
1571
+ output: z.ZodOptional<z.ZodString>;
1572
+ createdAt: z.ZodOptional<z.ZodNumber>;
1573
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
1574
+ }, "strip", z.ZodTypeAny, {
1575
+ status: "running" | "pending" | "completed" | "failed";
1576
+ id: string;
1577
+ name: string;
1578
+ createdAt?: number | undefined;
1579
+ input?: string | undefined;
1580
+ output?: string | undefined;
1581
+ }, {
1582
+ id: string;
1583
+ name: string;
1584
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
1585
+ createdAt?: number | undefined;
1586
+ input?: string | undefined;
1587
+ output?: string | undefined;
1588
+ }>>;
1589
+ plan: z.ZodOptional<z.ZodArray<z.ZodObject<{
1590
+ id: z.ZodString;
1591
+ text: z.ZodString;
1592
+ status: z.ZodEnum<["pending", "in_progress", "completed"]>;
1593
+ }, "strip", z.ZodTypeAny, {
1594
+ status: "pending" | "completed" | "in_progress";
1595
+ id: string;
1596
+ text: string;
1597
+ }, {
1598
+ status: "pending" | "completed" | "in_progress";
1599
+ id: string;
1600
+ text: string;
1601
+ }>, "many">>;
1602
+ permission: z.ZodOptional<z.ZodObject<{
1603
+ requestId: z.ZodString;
1604
+ toolName: z.ZodOptional<z.ZodString>;
1605
+ toolInput: z.ZodOptional<z.ZodString>;
1606
+ context: z.ZodOptional<z.ZodString>;
1607
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
1608
+ id: z.ZodString;
1609
+ label: z.ZodString;
1610
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
1611
+ }, "strip", z.ZodTypeAny, {
1612
+ id: string;
1613
+ kind: "allow" | "deny" | "other";
1614
+ label: string;
1615
+ }, {
1616
+ id: string;
1617
+ label: string;
1618
+ kind?: "allow" | "deny" | "other" | undefined;
1619
+ }>, "many">>;
1620
+ }, "strip", z.ZodTypeAny, {
1621
+ options: {
1622
+ id: string;
1623
+ kind: "allow" | "deny" | "other";
1624
+ label: string;
1625
+ }[];
1626
+ requestId: string;
1627
+ toolName?: string | undefined;
1628
+ toolInput?: string | undefined;
1629
+ context?: string | undefined;
1630
+ }, {
1631
+ requestId: string;
1632
+ options?: {
1633
+ id: string;
1634
+ label: string;
1635
+ kind?: "allow" | "deny" | "other" | undefined;
1636
+ }[] | undefined;
1637
+ toolName?: string | undefined;
1638
+ toolInput?: string | undefined;
1639
+ context?: string | undefined;
1640
+ }>>;
1641
+ status: z.ZodOptional<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
1642
+ error: z.ZodOptional<z.ZodString>;
1643
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1644
+ createdAt: z.ZodNumber;
1645
+ updatedAt: z.ZodOptional<z.ZodNumber>;
1646
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
1647
+ }, "strip", z.ZodTypeAny, {
1648
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
1649
+ id: string;
1650
+ createdAt: number;
1651
+ conversationId: string;
1652
+ error?: string | undefined;
1653
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
1654
+ role?: "user" | "assistant" | "system" | undefined;
1655
+ text?: string | undefined;
1656
+ plan?: {
1657
+ status: "pending" | "completed" | "in_progress";
1658
+ id: string;
1659
+ text: string;
1660
+ }[] | undefined;
1661
+ content?: {
1662
+ type: "text" | "image";
1663
+ data?: string | undefined;
1664
+ text?: string | undefined;
1665
+ mimeType?: string | undefined;
1666
+ }[] | undefined;
1667
+ isStreaming?: boolean | undefined;
1668
+ toolCall?: {
1669
+ status: "running" | "pending" | "completed" | "failed";
1670
+ id: string;
1671
+ name: string;
1672
+ createdAt?: number | undefined;
1673
+ input?: string | undefined;
1674
+ output?: string | undefined;
1675
+ } | undefined;
1676
+ permission?: {
1677
+ options: {
1678
+ id: string;
1679
+ kind: "allow" | "deny" | "other";
1680
+ label: string;
1681
+ }[];
1682
+ requestId: string;
1683
+ toolName?: string | undefined;
1684
+ toolInput?: string | undefined;
1685
+ context?: string | undefined;
1686
+ } | undefined;
1687
+ metadata?: Record<string, unknown> | undefined;
1688
+ updatedAt?: number | undefined;
1689
+ }, {
1690
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
1691
+ id: string;
1692
+ createdAt: number;
1693
+ conversationId: string;
1694
+ error?: string | undefined;
1695
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
1696
+ role?: "user" | "assistant" | "system" | undefined;
1697
+ text?: string | undefined;
1698
+ plan?: {
1699
+ status: "pending" | "completed" | "in_progress";
1700
+ id: string;
1701
+ text: string;
1702
+ }[] | undefined;
1703
+ content?: {
1704
+ type: "text" | "image";
1705
+ data?: string | undefined;
1706
+ text?: string | undefined;
1707
+ mimeType?: string | undefined;
1708
+ }[] | undefined;
1709
+ isStreaming?: boolean | undefined;
1710
+ toolCall?: {
1711
+ id: string;
1712
+ name: string;
1713
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
1714
+ createdAt?: number | undefined;
1715
+ input?: string | undefined;
1716
+ output?: string | undefined;
1717
+ } | undefined;
1718
+ permission?: {
1719
+ requestId: string;
1720
+ options?: {
1721
+ id: string;
1722
+ label: string;
1723
+ kind?: "allow" | "deny" | "other" | undefined;
1724
+ }[] | undefined;
1725
+ toolName?: string | undefined;
1726
+ toolInput?: string | undefined;
1727
+ context?: string | undefined;
1728
+ } | undefined;
1729
+ metadata?: Record<string, unknown> | undefined;
1730
+ updatedAt?: number | undefined;
1731
+ }>, "many">>;
1732
+ }, "strip", z.ZodTypeAny, {
1733
+ conversation: {
1734
+ status: "error" | "running" | "idle" | "waiting_permission" | "unavailable";
1735
+ id: string;
1736
+ provider: "claude" | "codex" | "custom";
1737
+ cwd: string;
1738
+ createdAt: number;
1739
+ archived: boolean;
1740
+ lastActivityAt: number;
1741
+ agentSessionId?: string | undefined;
1742
+ model?: string | undefined;
1743
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
1744
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
1745
+ title?: string | undefined;
1746
+ lastMessagePreview?: string | undefined;
1747
+ };
1748
+ snapshot: {
1749
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
1750
+ id: string;
1751
+ createdAt: number;
1752
+ conversationId: string;
1753
+ error?: string | undefined;
1754
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
1755
+ role?: "user" | "assistant" | "system" | undefined;
1756
+ text?: string | undefined;
1757
+ plan?: {
1758
+ status: "pending" | "completed" | "in_progress";
1759
+ id: string;
1760
+ text: string;
1761
+ }[] | undefined;
1762
+ content?: {
1763
+ type: "text" | "image";
1764
+ data?: string | undefined;
1765
+ text?: string | undefined;
1766
+ mimeType?: string | undefined;
1767
+ }[] | undefined;
1768
+ isStreaming?: boolean | undefined;
1769
+ toolCall?: {
1770
+ status: "running" | "pending" | "completed" | "failed";
1771
+ id: string;
1772
+ name: string;
1773
+ createdAt?: number | undefined;
1774
+ input?: string | undefined;
1775
+ output?: string | undefined;
1776
+ } | undefined;
1777
+ permission?: {
1778
+ options: {
1779
+ id: string;
1780
+ kind: "allow" | "deny" | "other";
1781
+ label: string;
1782
+ }[];
1783
+ requestId: string;
1784
+ toolName?: string | undefined;
1785
+ toolInput?: string | undefined;
1786
+ context?: string | undefined;
1787
+ } | undefined;
1788
+ metadata?: Record<string, unknown> | undefined;
1789
+ updatedAt?: number | undefined;
1790
+ }[];
1791
+ }, {
1792
+ conversation: {
1793
+ id: string;
1794
+ cwd: string;
1795
+ createdAt: number;
1796
+ lastActivityAt: number;
1797
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
1798
+ provider?: "claude" | "codex" | "custom" | undefined;
1799
+ agentSessionId?: string | undefined;
1800
+ model?: string | undefined;
1801
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
1802
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
1803
+ title?: string | undefined;
1804
+ archived?: boolean | undefined;
1805
+ lastMessagePreview?: string | undefined;
1806
+ };
1807
+ snapshot?: {
1808
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
1809
+ id: string;
1810
+ createdAt: number;
1811
+ conversationId: string;
1812
+ error?: string | undefined;
1813
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
1814
+ role?: "user" | "assistant" | "system" | undefined;
1815
+ text?: string | undefined;
1816
+ plan?: {
1817
+ status: "pending" | "completed" | "in_progress";
1818
+ id: string;
1819
+ text: string;
1820
+ }[] | undefined;
1821
+ content?: {
1822
+ type: "text" | "image";
1823
+ data?: string | undefined;
1824
+ text?: string | undefined;
1825
+ mimeType?: string | undefined;
1826
+ }[] | undefined;
1827
+ isStreaming?: boolean | undefined;
1828
+ toolCall?: {
1829
+ id: string;
1830
+ name: string;
1831
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
1832
+ createdAt?: number | undefined;
1833
+ input?: string | undefined;
1834
+ output?: string | undefined;
1835
+ } | undefined;
1836
+ permission?: {
1837
+ requestId: string;
1838
+ options?: {
1839
+ id: string;
1840
+ label: string;
1841
+ kind?: "allow" | "deny" | "other" | undefined;
1842
+ }[] | undefined;
1843
+ toolName?: string | undefined;
1844
+ toolInput?: string | undefined;
1845
+ context?: string | undefined;
1846
+ } | undefined;
1847
+ metadata?: Record<string, unknown> | undefined;
1848
+ updatedAt?: number | undefined;
1849
+ }[] | undefined;
1850
+ }>;
1851
+ export declare const agentV2ConversationListPayloadSchema: z.ZodObject<{
1852
+ includeArchived: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1853
+ }, "strip", z.ZodTypeAny, {
1854
+ includeArchived: boolean;
1855
+ }, {
1856
+ includeArchived?: boolean | undefined;
1857
+ }>;
1858
+ export declare const agentV2ConversationListResultPayloadSchema: z.ZodObject<{
1859
+ conversations: z.ZodArray<z.ZodObject<{
1860
+ id: z.ZodString;
1861
+ agentSessionId: z.ZodOptional<z.ZodString>;
1862
+ provider: z.ZodDefault<z.ZodEnum<["codex", "claude", "custom"]>>;
1863
+ cwd: z.ZodString;
1864
+ title: z.ZodOptional<z.ZodString>;
1865
+ model: z.ZodOptional<z.ZodString>;
1866
+ reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
1867
+ permissionMode: z.ZodOptional<z.ZodEnum<["read_only", "workspace_write", "full_access"]>>;
1868
+ status: z.ZodDefault<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
1869
+ archived: z.ZodDefault<z.ZodBoolean>;
1870
+ lastMessagePreview: z.ZodOptional<z.ZodString>;
1871
+ lastActivityAt: z.ZodNumber;
1872
+ createdAt: z.ZodNumber;
1873
+ }, "strip", z.ZodTypeAny, {
1874
+ status: "error" | "running" | "idle" | "waiting_permission" | "unavailable";
1875
+ id: string;
1876
+ provider: "claude" | "codex" | "custom";
1877
+ cwd: string;
1878
+ createdAt: number;
1879
+ archived: boolean;
1880
+ lastActivityAt: number;
1881
+ agentSessionId?: string | undefined;
1882
+ model?: string | undefined;
1883
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
1884
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
1885
+ title?: string | undefined;
1886
+ lastMessagePreview?: string | undefined;
1887
+ }, {
1888
+ id: string;
1889
+ cwd: string;
1890
+ createdAt: number;
1891
+ lastActivityAt: number;
1892
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
1893
+ provider?: "claude" | "codex" | "custom" | undefined;
1894
+ agentSessionId?: string | undefined;
1895
+ model?: string | undefined;
1896
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
1897
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
1898
+ title?: string | undefined;
1899
+ archived?: boolean | undefined;
1900
+ lastMessagePreview?: string | undefined;
1901
+ }>, "many">;
1902
+ }, "strip", z.ZodTypeAny, {
1903
+ conversations: {
1904
+ status: "error" | "running" | "idle" | "waiting_permission" | "unavailable";
1905
+ id: string;
1906
+ provider: "claude" | "codex" | "custom";
1907
+ cwd: string;
1908
+ createdAt: number;
1909
+ archived: boolean;
1910
+ lastActivityAt: number;
1911
+ agentSessionId?: string | undefined;
1912
+ model?: string | undefined;
1913
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
1914
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
1915
+ title?: string | undefined;
1916
+ lastMessagePreview?: string | undefined;
1917
+ }[];
1918
+ }, {
1919
+ conversations: {
1920
+ id: string;
1921
+ cwd: string;
1922
+ createdAt: number;
1923
+ lastActivityAt: number;
1924
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
1925
+ provider?: "claude" | "codex" | "custom" | undefined;
1926
+ agentSessionId?: string | undefined;
1927
+ model?: string | undefined;
1928
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
1929
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
1930
+ title?: string | undefined;
1931
+ archived?: boolean | undefined;
1932
+ lastMessagePreview?: string | undefined;
1933
+ }[];
1934
+ }>;
1935
+ export declare const agentV2PromptPayloadSchema: z.ZodObject<{
1936
+ conversationId: z.ZodString;
1937
+ clientMessageId: z.ZodString;
1938
+ contentBlocks: z.ZodArray<z.ZodObject<{
1939
+ type: z.ZodEnum<["text", "image"]>;
1940
+ text: z.ZodOptional<z.ZodString>;
1941
+ data: z.ZodOptional<z.ZodString>;
1942
+ mimeType: z.ZodOptional<z.ZodString>;
1943
+ }, "strip", z.ZodTypeAny, {
1944
+ type: "text" | "image";
1945
+ data?: string | undefined;
1946
+ text?: string | undefined;
1947
+ mimeType?: string | undefined;
1948
+ }, {
1949
+ type: "text" | "image";
1950
+ data?: string | undefined;
1951
+ text?: string | undefined;
1952
+ mimeType?: string | undefined;
1953
+ }>, "many">;
1954
+ model: z.ZodOptional<z.ZodString>;
1955
+ reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
1956
+ permissionMode: z.ZodOptional<z.ZodEnum<["read_only", "workspace_write", "full_access"]>>;
1957
+ }, "strip", z.ZodTypeAny, {
1958
+ clientMessageId: string;
1959
+ contentBlocks: {
1960
+ type: "text" | "image";
1961
+ data?: string | undefined;
1962
+ text?: string | undefined;
1963
+ mimeType?: string | undefined;
1964
+ }[];
1965
+ conversationId: string;
1966
+ model?: string | undefined;
1967
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
1968
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
1969
+ }, {
1970
+ clientMessageId: string;
1971
+ contentBlocks: {
1972
+ type: "text" | "image";
1973
+ data?: string | undefined;
1974
+ text?: string | undefined;
1975
+ mimeType?: string | undefined;
1976
+ }[];
1977
+ conversationId: string;
1978
+ model?: string | undefined;
1979
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
1980
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
1981
+ }>;
1982
+ export declare const agentV2CancelPayloadSchema: z.ZodObject<{
1983
+ conversationId: z.ZodString;
1984
+ }, "strip", z.ZodTypeAny, {
1985
+ conversationId: string;
1986
+ }, {
1987
+ conversationId: string;
1988
+ }>;
1989
+ export declare const agentV2PermissionRespondPayloadSchema: z.ZodObject<{
1990
+ conversationId: z.ZodString;
1991
+ requestId: z.ZodString;
1992
+ outcome: z.ZodEnum<["allow", "deny", "cancelled"]>;
1993
+ optionId: z.ZodOptional<z.ZodString>;
1994
+ }, "strip", z.ZodTypeAny, {
1995
+ requestId: string;
1996
+ outcome: "allow" | "deny" | "cancelled";
1997
+ conversationId: string;
1998
+ optionId?: string | undefined;
1999
+ }, {
2000
+ requestId: string;
2001
+ outcome: "allow" | "deny" | "cancelled";
2002
+ conversationId: string;
2003
+ optionId?: string | undefined;
2004
+ }>;
2005
+ export declare const agentV2SnapshotRequestPayloadSchema: z.ZodObject<{
2006
+ conversationId: z.ZodOptional<z.ZodString>;
2007
+ }, "strip", z.ZodTypeAny, {
2008
+ conversationId?: string | undefined;
2009
+ }, {
2010
+ conversationId?: string | undefined;
2011
+ }>;
2012
+ export declare const agentV2SnapshotPayloadSchema: z.ZodObject<{
2013
+ conversations: z.ZodDefault<z.ZodArray<z.ZodObject<{
2014
+ id: z.ZodString;
2015
+ agentSessionId: z.ZodOptional<z.ZodString>;
2016
+ provider: z.ZodDefault<z.ZodEnum<["codex", "claude", "custom"]>>;
2017
+ cwd: z.ZodString;
2018
+ title: z.ZodOptional<z.ZodString>;
2019
+ model: z.ZodOptional<z.ZodString>;
2020
+ reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
2021
+ permissionMode: z.ZodOptional<z.ZodEnum<["read_only", "workspace_write", "full_access"]>>;
2022
+ status: z.ZodDefault<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
2023
+ archived: z.ZodDefault<z.ZodBoolean>;
2024
+ lastMessagePreview: z.ZodOptional<z.ZodString>;
2025
+ lastActivityAt: z.ZodNumber;
2026
+ createdAt: z.ZodNumber;
2027
+ }, "strip", z.ZodTypeAny, {
2028
+ status: "error" | "running" | "idle" | "waiting_permission" | "unavailable";
2029
+ id: string;
2030
+ provider: "claude" | "codex" | "custom";
2031
+ cwd: string;
2032
+ createdAt: number;
2033
+ archived: boolean;
2034
+ lastActivityAt: number;
2035
+ agentSessionId?: string | undefined;
2036
+ model?: string | undefined;
2037
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
2038
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
2039
+ title?: string | undefined;
2040
+ lastMessagePreview?: string | undefined;
2041
+ }, {
2042
+ id: string;
2043
+ cwd: string;
2044
+ createdAt: number;
2045
+ lastActivityAt: number;
2046
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
2047
+ provider?: "claude" | "codex" | "custom" | undefined;
2048
+ agentSessionId?: string | undefined;
2049
+ model?: string | undefined;
2050
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
2051
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
2052
+ title?: string | undefined;
2053
+ archived?: boolean | undefined;
2054
+ lastMessagePreview?: string | undefined;
2055
+ }>, "many">>;
2056
+ activeConversationId: z.ZodOptional<z.ZodString>;
2057
+ items: z.ZodDefault<z.ZodArray<z.ZodObject<{
2058
+ id: z.ZodString;
2059
+ conversationId: z.ZodString;
2060
+ type: z.ZodEnum<["message", "tool_call", "plan", "permission", "status", "error"]>;
2061
+ role: z.ZodOptional<z.ZodEnum<["user", "assistant", "system"]>>;
2062
+ content: z.ZodOptional<z.ZodArray<z.ZodObject<{
2063
+ type: z.ZodEnum<["text", "image"]>;
2064
+ text: z.ZodOptional<z.ZodString>;
2065
+ data: z.ZodOptional<z.ZodString>;
2066
+ mimeType: z.ZodOptional<z.ZodString>;
2067
+ }, "strip", z.ZodTypeAny, {
2068
+ type: "text" | "image";
2069
+ data?: string | undefined;
2070
+ text?: string | undefined;
2071
+ mimeType?: string | undefined;
2072
+ }, {
2073
+ type: "text" | "image";
2074
+ data?: string | undefined;
2075
+ text?: string | undefined;
2076
+ mimeType?: string | undefined;
2077
+ }>, "many">>;
2078
+ text: z.ZodOptional<z.ZodString>;
2079
+ toolCall: z.ZodOptional<z.ZodObject<{
2080
+ id: z.ZodString;
2081
+ name: z.ZodString;
2082
+ input: z.ZodOptional<z.ZodString>;
2083
+ output: z.ZodOptional<z.ZodString>;
2084
+ createdAt: z.ZodOptional<z.ZodNumber>;
2085
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
2086
+ }, "strip", z.ZodTypeAny, {
2087
+ status: "running" | "pending" | "completed" | "failed";
2088
+ id: string;
2089
+ name: string;
2090
+ createdAt?: number | undefined;
2091
+ input?: string | undefined;
2092
+ output?: string | undefined;
2093
+ }, {
2094
+ id: string;
2095
+ name: string;
2096
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
2097
+ createdAt?: number | undefined;
2098
+ input?: string | undefined;
2099
+ output?: string | undefined;
2100
+ }>>;
2101
+ plan: z.ZodOptional<z.ZodArray<z.ZodObject<{
2102
+ id: z.ZodString;
2103
+ text: z.ZodString;
2104
+ status: z.ZodEnum<["pending", "in_progress", "completed"]>;
2105
+ }, "strip", z.ZodTypeAny, {
2106
+ status: "pending" | "completed" | "in_progress";
2107
+ id: string;
2108
+ text: string;
2109
+ }, {
2110
+ status: "pending" | "completed" | "in_progress";
2111
+ id: string;
2112
+ text: string;
2113
+ }>, "many">>;
2114
+ permission: z.ZodOptional<z.ZodObject<{
2115
+ requestId: z.ZodString;
2116
+ toolName: z.ZodOptional<z.ZodString>;
2117
+ toolInput: z.ZodOptional<z.ZodString>;
2118
+ context: z.ZodOptional<z.ZodString>;
2119
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
2120
+ id: z.ZodString;
2121
+ label: z.ZodString;
2122
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
2123
+ }, "strip", z.ZodTypeAny, {
2124
+ id: string;
2125
+ kind: "allow" | "deny" | "other";
2126
+ label: string;
2127
+ }, {
2128
+ id: string;
2129
+ label: string;
2130
+ kind?: "allow" | "deny" | "other" | undefined;
2131
+ }>, "many">>;
2132
+ }, "strip", z.ZodTypeAny, {
2133
+ options: {
2134
+ id: string;
2135
+ kind: "allow" | "deny" | "other";
2136
+ label: string;
2137
+ }[];
2138
+ requestId: string;
2139
+ toolName?: string | undefined;
2140
+ toolInput?: string | undefined;
2141
+ context?: string | undefined;
2142
+ }, {
2143
+ requestId: string;
2144
+ options?: {
2145
+ id: string;
2146
+ label: string;
2147
+ kind?: "allow" | "deny" | "other" | undefined;
2148
+ }[] | undefined;
2149
+ toolName?: string | undefined;
2150
+ toolInput?: string | undefined;
2151
+ context?: string | undefined;
2152
+ }>>;
2153
+ status: z.ZodOptional<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
2154
+ error: z.ZodOptional<z.ZodString>;
2155
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2156
+ createdAt: z.ZodNumber;
2157
+ updatedAt: z.ZodOptional<z.ZodNumber>;
2158
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
2159
+ }, "strip", z.ZodTypeAny, {
2160
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
2161
+ id: string;
2162
+ createdAt: number;
2163
+ conversationId: string;
2164
+ error?: string | undefined;
2165
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
2166
+ role?: "user" | "assistant" | "system" | undefined;
2167
+ text?: string | undefined;
2168
+ plan?: {
2169
+ status: "pending" | "completed" | "in_progress";
2170
+ id: string;
2171
+ text: string;
2172
+ }[] | undefined;
2173
+ content?: {
2174
+ type: "text" | "image";
2175
+ data?: string | undefined;
2176
+ text?: string | undefined;
2177
+ mimeType?: string | undefined;
2178
+ }[] | undefined;
2179
+ isStreaming?: boolean | undefined;
2180
+ toolCall?: {
2181
+ status: "running" | "pending" | "completed" | "failed";
2182
+ id: string;
2183
+ name: string;
2184
+ createdAt?: number | undefined;
2185
+ input?: string | undefined;
2186
+ output?: string | undefined;
2187
+ } | undefined;
2188
+ permission?: {
2189
+ options: {
2190
+ id: string;
2191
+ kind: "allow" | "deny" | "other";
2192
+ label: string;
2193
+ }[];
2194
+ requestId: string;
2195
+ toolName?: string | undefined;
2196
+ toolInput?: string | undefined;
2197
+ context?: string | undefined;
2198
+ } | undefined;
2199
+ metadata?: Record<string, unknown> | undefined;
2200
+ updatedAt?: number | undefined;
2201
+ }, {
2202
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
2203
+ id: string;
2204
+ createdAt: number;
2205
+ conversationId: string;
2206
+ error?: string | undefined;
2207
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
2208
+ role?: "user" | "assistant" | "system" | undefined;
2209
+ text?: string | undefined;
2210
+ plan?: {
2211
+ status: "pending" | "completed" | "in_progress";
2212
+ id: string;
2213
+ text: string;
2214
+ }[] | undefined;
2215
+ content?: {
2216
+ type: "text" | "image";
2217
+ data?: string | undefined;
2218
+ text?: string | undefined;
2219
+ mimeType?: string | undefined;
2220
+ }[] | undefined;
2221
+ isStreaming?: boolean | undefined;
2222
+ toolCall?: {
2223
+ id: string;
2224
+ name: string;
2225
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
2226
+ createdAt?: number | undefined;
2227
+ input?: string | undefined;
2228
+ output?: string | undefined;
2229
+ } | undefined;
2230
+ permission?: {
2231
+ requestId: string;
2232
+ options?: {
2233
+ id: string;
2234
+ label: string;
2235
+ kind?: "allow" | "deny" | "other" | undefined;
2236
+ }[] | undefined;
2237
+ toolName?: string | undefined;
2238
+ toolInput?: string | undefined;
2239
+ context?: string | undefined;
2240
+ } | undefined;
2241
+ metadata?: Record<string, unknown> | undefined;
2242
+ updatedAt?: number | undefined;
2243
+ }>, "many">>;
2244
+ }, "strip", z.ZodTypeAny, {
2245
+ conversations: {
2246
+ status: "error" | "running" | "idle" | "waiting_permission" | "unavailable";
2247
+ id: string;
2248
+ provider: "claude" | "codex" | "custom";
2249
+ cwd: string;
2250
+ createdAt: number;
2251
+ archived: boolean;
2252
+ lastActivityAt: number;
2253
+ agentSessionId?: string | undefined;
2254
+ model?: string | undefined;
2255
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
2256
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
2257
+ title?: string | undefined;
2258
+ lastMessagePreview?: string | undefined;
2259
+ }[];
2260
+ items: {
2261
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
2262
+ id: string;
2263
+ createdAt: number;
2264
+ conversationId: string;
2265
+ error?: string | undefined;
2266
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
2267
+ role?: "user" | "assistant" | "system" | undefined;
2268
+ text?: string | undefined;
2269
+ plan?: {
2270
+ status: "pending" | "completed" | "in_progress";
2271
+ id: string;
2272
+ text: string;
2273
+ }[] | undefined;
2274
+ content?: {
2275
+ type: "text" | "image";
2276
+ data?: string | undefined;
2277
+ text?: string | undefined;
2278
+ mimeType?: string | undefined;
2279
+ }[] | undefined;
2280
+ isStreaming?: boolean | undefined;
2281
+ toolCall?: {
2282
+ status: "running" | "pending" | "completed" | "failed";
2283
+ id: string;
2284
+ name: string;
2285
+ createdAt?: number | undefined;
2286
+ input?: string | undefined;
2287
+ output?: string | undefined;
2288
+ } | undefined;
2289
+ permission?: {
2290
+ options: {
2291
+ id: string;
2292
+ kind: "allow" | "deny" | "other";
2293
+ label: string;
2294
+ }[];
2295
+ requestId: string;
2296
+ toolName?: string | undefined;
2297
+ toolInput?: string | undefined;
2298
+ context?: string | undefined;
2299
+ } | undefined;
2300
+ metadata?: Record<string, unknown> | undefined;
2301
+ updatedAt?: number | undefined;
2302
+ }[];
2303
+ activeConversationId?: string | undefined;
2304
+ }, {
2305
+ conversations?: {
2306
+ id: string;
2307
+ cwd: string;
2308
+ createdAt: number;
2309
+ lastActivityAt: number;
2310
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
2311
+ provider?: "claude" | "codex" | "custom" | undefined;
2312
+ agentSessionId?: string | undefined;
2313
+ model?: string | undefined;
2314
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
2315
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
2316
+ title?: string | undefined;
2317
+ archived?: boolean | undefined;
2318
+ lastMessagePreview?: string | undefined;
2319
+ }[] | undefined;
2320
+ activeConversationId?: string | undefined;
2321
+ items?: {
2322
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
2323
+ id: string;
2324
+ createdAt: number;
2325
+ conversationId: string;
2326
+ error?: string | undefined;
2327
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
2328
+ role?: "user" | "assistant" | "system" | undefined;
2329
+ text?: string | undefined;
2330
+ plan?: {
2331
+ status: "pending" | "completed" | "in_progress";
2332
+ id: string;
2333
+ text: string;
2334
+ }[] | undefined;
2335
+ content?: {
2336
+ type: "text" | "image";
2337
+ data?: string | undefined;
2338
+ text?: string | undefined;
2339
+ mimeType?: string | undefined;
2340
+ }[] | undefined;
2341
+ isStreaming?: boolean | undefined;
2342
+ toolCall?: {
2343
+ id: string;
2344
+ name: string;
2345
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
2346
+ createdAt?: number | undefined;
2347
+ input?: string | undefined;
2348
+ output?: string | undefined;
2349
+ } | undefined;
2350
+ permission?: {
2351
+ requestId: string;
2352
+ options?: {
2353
+ id: string;
2354
+ label: string;
2355
+ kind?: "allow" | "deny" | "other" | undefined;
2356
+ }[] | undefined;
2357
+ toolName?: string | undefined;
2358
+ toolInput?: string | undefined;
2359
+ context?: string | undefined;
2360
+ } | undefined;
2361
+ metadata?: Record<string, unknown> | undefined;
2362
+ updatedAt?: number | undefined;
2363
+ }[] | undefined;
2364
+ }>;
2365
+ export declare const agentV2EventPayloadSchema: z.ZodObject<{
2366
+ conversationId: z.ZodString;
2367
+ conversation: z.ZodOptional<z.ZodObject<{
2368
+ id: z.ZodString;
2369
+ agentSessionId: z.ZodOptional<z.ZodString>;
2370
+ provider: z.ZodDefault<z.ZodEnum<["codex", "claude", "custom"]>>;
2371
+ cwd: z.ZodString;
2372
+ title: z.ZodOptional<z.ZodString>;
2373
+ model: z.ZodOptional<z.ZodString>;
2374
+ reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
2375
+ permissionMode: z.ZodOptional<z.ZodEnum<["read_only", "workspace_write", "full_access"]>>;
2376
+ status: z.ZodDefault<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
2377
+ archived: z.ZodDefault<z.ZodBoolean>;
2378
+ lastMessagePreview: z.ZodOptional<z.ZodString>;
2379
+ lastActivityAt: z.ZodNumber;
2380
+ createdAt: z.ZodNumber;
2381
+ }, "strip", z.ZodTypeAny, {
2382
+ status: "error" | "running" | "idle" | "waiting_permission" | "unavailable";
2383
+ id: string;
2384
+ provider: "claude" | "codex" | "custom";
2385
+ cwd: string;
2386
+ createdAt: number;
2387
+ archived: boolean;
2388
+ lastActivityAt: number;
2389
+ agentSessionId?: string | undefined;
2390
+ model?: string | undefined;
2391
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
2392
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
2393
+ title?: string | undefined;
2394
+ lastMessagePreview?: string | undefined;
2395
+ }, {
2396
+ id: string;
2397
+ cwd: string;
2398
+ createdAt: number;
2399
+ lastActivityAt: number;
2400
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
2401
+ provider?: "claude" | "codex" | "custom" | undefined;
2402
+ agentSessionId?: string | undefined;
2403
+ model?: string | undefined;
2404
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
2405
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
2406
+ title?: string | undefined;
2407
+ archived?: boolean | undefined;
2408
+ lastMessagePreview?: string | undefined;
2409
+ }>>;
2410
+ item: z.ZodOptional<z.ZodObject<{
2411
+ id: z.ZodString;
2412
+ conversationId: z.ZodString;
2413
+ type: z.ZodEnum<["message", "tool_call", "plan", "permission", "status", "error"]>;
2414
+ role: z.ZodOptional<z.ZodEnum<["user", "assistant", "system"]>>;
2415
+ content: z.ZodOptional<z.ZodArray<z.ZodObject<{
2416
+ type: z.ZodEnum<["text", "image"]>;
2417
+ text: z.ZodOptional<z.ZodString>;
2418
+ data: z.ZodOptional<z.ZodString>;
2419
+ mimeType: z.ZodOptional<z.ZodString>;
2420
+ }, "strip", z.ZodTypeAny, {
2421
+ type: "text" | "image";
2422
+ data?: string | undefined;
2423
+ text?: string | undefined;
2424
+ mimeType?: string | undefined;
2425
+ }, {
2426
+ type: "text" | "image";
2427
+ data?: string | undefined;
2428
+ text?: string | undefined;
2429
+ mimeType?: string | undefined;
2430
+ }>, "many">>;
2431
+ text: z.ZodOptional<z.ZodString>;
2432
+ toolCall: z.ZodOptional<z.ZodObject<{
2433
+ id: z.ZodString;
2434
+ name: z.ZodString;
2435
+ input: z.ZodOptional<z.ZodString>;
2436
+ output: z.ZodOptional<z.ZodString>;
2437
+ createdAt: z.ZodOptional<z.ZodNumber>;
2438
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
2439
+ }, "strip", z.ZodTypeAny, {
2440
+ status: "running" | "pending" | "completed" | "failed";
2441
+ id: string;
2442
+ name: string;
2443
+ createdAt?: number | undefined;
2444
+ input?: string | undefined;
2445
+ output?: string | undefined;
2446
+ }, {
2447
+ id: string;
2448
+ name: string;
2449
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
2450
+ createdAt?: number | undefined;
2451
+ input?: string | undefined;
2452
+ output?: string | undefined;
2453
+ }>>;
2454
+ plan: z.ZodOptional<z.ZodArray<z.ZodObject<{
2455
+ id: z.ZodString;
2456
+ text: z.ZodString;
2457
+ status: z.ZodEnum<["pending", "in_progress", "completed"]>;
2458
+ }, "strip", z.ZodTypeAny, {
2459
+ status: "pending" | "completed" | "in_progress";
2460
+ id: string;
2461
+ text: string;
2462
+ }, {
2463
+ status: "pending" | "completed" | "in_progress";
2464
+ id: string;
2465
+ text: string;
2466
+ }>, "many">>;
2467
+ permission: z.ZodOptional<z.ZodObject<{
2468
+ requestId: z.ZodString;
2469
+ toolName: z.ZodOptional<z.ZodString>;
2470
+ toolInput: z.ZodOptional<z.ZodString>;
2471
+ context: z.ZodOptional<z.ZodString>;
2472
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
2473
+ id: z.ZodString;
2474
+ label: z.ZodString;
2475
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
2476
+ }, "strip", z.ZodTypeAny, {
2477
+ id: string;
2478
+ kind: "allow" | "deny" | "other";
2479
+ label: string;
2480
+ }, {
2481
+ id: string;
2482
+ label: string;
2483
+ kind?: "allow" | "deny" | "other" | undefined;
2484
+ }>, "many">>;
2485
+ }, "strip", z.ZodTypeAny, {
2486
+ options: {
2487
+ id: string;
2488
+ kind: "allow" | "deny" | "other";
2489
+ label: string;
2490
+ }[];
2491
+ requestId: string;
2492
+ toolName?: string | undefined;
2493
+ toolInput?: string | undefined;
2494
+ context?: string | undefined;
2495
+ }, {
2496
+ requestId: string;
2497
+ options?: {
2498
+ id: string;
2499
+ label: string;
2500
+ kind?: "allow" | "deny" | "other" | undefined;
2501
+ }[] | undefined;
2502
+ toolName?: string | undefined;
2503
+ toolInput?: string | undefined;
2504
+ context?: string | undefined;
2505
+ }>>;
2506
+ status: z.ZodOptional<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
2507
+ error: z.ZodOptional<z.ZodString>;
2508
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2509
+ createdAt: z.ZodNumber;
2510
+ updatedAt: z.ZodOptional<z.ZodNumber>;
2511
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
2512
+ }, "strip", z.ZodTypeAny, {
2513
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
2514
+ id: string;
2515
+ createdAt: number;
2516
+ conversationId: string;
2517
+ error?: string | undefined;
2518
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
2519
+ role?: "user" | "assistant" | "system" | undefined;
2520
+ text?: string | undefined;
2521
+ plan?: {
2522
+ status: "pending" | "completed" | "in_progress";
2523
+ id: string;
2524
+ text: string;
2525
+ }[] | undefined;
2526
+ content?: {
2527
+ type: "text" | "image";
2528
+ data?: string | undefined;
2529
+ text?: string | undefined;
2530
+ mimeType?: string | undefined;
2531
+ }[] | undefined;
2532
+ isStreaming?: boolean | undefined;
2533
+ toolCall?: {
2534
+ status: "running" | "pending" | "completed" | "failed";
2535
+ id: string;
2536
+ name: string;
2537
+ createdAt?: number | undefined;
2538
+ input?: string | undefined;
2539
+ output?: string | undefined;
2540
+ } | undefined;
2541
+ permission?: {
2542
+ options: {
2543
+ id: string;
2544
+ kind: "allow" | "deny" | "other";
2545
+ label: string;
2546
+ }[];
2547
+ requestId: string;
2548
+ toolName?: string | undefined;
2549
+ toolInput?: string | undefined;
2550
+ context?: string | undefined;
2551
+ } | undefined;
2552
+ metadata?: Record<string, unknown> | undefined;
2553
+ updatedAt?: number | undefined;
2554
+ }, {
2555
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
2556
+ id: string;
2557
+ createdAt: number;
2558
+ conversationId: string;
2559
+ error?: string | undefined;
2560
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
2561
+ role?: "user" | "assistant" | "system" | undefined;
2562
+ text?: string | undefined;
2563
+ plan?: {
2564
+ status: "pending" | "completed" | "in_progress";
2565
+ id: string;
2566
+ text: string;
2567
+ }[] | undefined;
2568
+ content?: {
2569
+ type: "text" | "image";
2570
+ data?: string | undefined;
2571
+ text?: string | undefined;
2572
+ mimeType?: string | undefined;
2573
+ }[] | undefined;
2574
+ isStreaming?: boolean | undefined;
2575
+ toolCall?: {
2576
+ id: string;
2577
+ name: string;
2578
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
2579
+ createdAt?: number | undefined;
2580
+ input?: string | undefined;
2581
+ output?: string | undefined;
2582
+ } | undefined;
2583
+ permission?: {
2584
+ requestId: string;
2585
+ options?: {
2586
+ id: string;
2587
+ label: string;
2588
+ kind?: "allow" | "deny" | "other" | undefined;
2589
+ }[] | undefined;
2590
+ toolName?: string | undefined;
2591
+ toolInput?: string | undefined;
2592
+ context?: string | undefined;
2593
+ } | undefined;
2594
+ metadata?: Record<string, unknown> | undefined;
2595
+ updatedAt?: number | undefined;
2596
+ }>>;
2597
+ patch: z.ZodOptional<z.ZodObject<{
2598
+ itemId: z.ZodString;
2599
+ textDelta: z.ZodOptional<z.ZodString>;
2600
+ status: z.ZodOptional<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
2601
+ toolCall: z.ZodOptional<z.ZodObject<{
2602
+ id: z.ZodString;
2603
+ name: z.ZodString;
2604
+ input: z.ZodOptional<z.ZodString>;
2605
+ output: z.ZodOptional<z.ZodString>;
2606
+ createdAt: z.ZodOptional<z.ZodNumber>;
2607
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
2608
+ }, "strip", z.ZodTypeAny, {
2609
+ status: "running" | "pending" | "completed" | "failed";
2610
+ id: string;
2611
+ name: string;
2612
+ createdAt?: number | undefined;
2613
+ input?: string | undefined;
2614
+ output?: string | undefined;
2615
+ }, {
2616
+ id: string;
2617
+ name: string;
2618
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
2619
+ createdAt?: number | undefined;
2620
+ input?: string | undefined;
2621
+ output?: string | undefined;
2622
+ }>>;
2623
+ updatedAt: z.ZodOptional<z.ZodNumber>;
2624
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
2625
+ }, "strip", z.ZodTypeAny, {
2626
+ itemId: string;
2627
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
2628
+ isStreaming?: boolean | undefined;
2629
+ toolCall?: {
2630
+ status: "running" | "pending" | "completed" | "failed";
2631
+ id: string;
2632
+ name: string;
2633
+ createdAt?: number | undefined;
2634
+ input?: string | undefined;
2635
+ output?: string | undefined;
2636
+ } | undefined;
2637
+ updatedAt?: number | undefined;
2638
+ textDelta?: string | undefined;
2639
+ }, {
2640
+ itemId: string;
2641
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
2642
+ isStreaming?: boolean | undefined;
2643
+ toolCall?: {
2644
+ id: string;
2645
+ name: string;
2646
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
2647
+ createdAt?: number | undefined;
2648
+ input?: string | undefined;
2649
+ output?: string | undefined;
2650
+ } | undefined;
2651
+ updatedAt?: number | undefined;
2652
+ textDelta?: string | undefined;
2653
+ }>>;
2654
+ }, "strip", z.ZodTypeAny, {
2655
+ conversationId: string;
2656
+ conversation?: {
2657
+ status: "error" | "running" | "idle" | "waiting_permission" | "unavailable";
2658
+ id: string;
2659
+ provider: "claude" | "codex" | "custom";
2660
+ cwd: string;
2661
+ createdAt: number;
2662
+ archived: boolean;
2663
+ lastActivityAt: number;
2664
+ agentSessionId?: string | undefined;
2665
+ model?: string | undefined;
2666
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
2667
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
2668
+ title?: string | undefined;
2669
+ lastMessagePreview?: string | undefined;
2670
+ } | undefined;
2671
+ item?: {
2672
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
2673
+ id: string;
2674
+ createdAt: number;
2675
+ conversationId: string;
2676
+ error?: string | undefined;
2677
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
2678
+ role?: "user" | "assistant" | "system" | undefined;
2679
+ text?: string | undefined;
2680
+ plan?: {
2681
+ status: "pending" | "completed" | "in_progress";
2682
+ id: string;
2683
+ text: string;
2684
+ }[] | undefined;
2685
+ content?: {
2686
+ type: "text" | "image";
2687
+ data?: string | undefined;
2688
+ text?: string | undefined;
2689
+ mimeType?: string | undefined;
2690
+ }[] | undefined;
2691
+ isStreaming?: boolean | undefined;
2692
+ toolCall?: {
2693
+ status: "running" | "pending" | "completed" | "failed";
2694
+ id: string;
2695
+ name: string;
2696
+ createdAt?: number | undefined;
2697
+ input?: string | undefined;
2698
+ output?: string | undefined;
2699
+ } | undefined;
2700
+ permission?: {
2701
+ options: {
2702
+ id: string;
2703
+ kind: "allow" | "deny" | "other";
2704
+ label: string;
2705
+ }[];
2706
+ requestId: string;
2707
+ toolName?: string | undefined;
2708
+ toolInput?: string | undefined;
2709
+ context?: string | undefined;
2710
+ } | undefined;
2711
+ metadata?: Record<string, unknown> | undefined;
2712
+ updatedAt?: number | undefined;
2713
+ } | undefined;
2714
+ patch?: {
2715
+ itemId: string;
2716
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
2717
+ isStreaming?: boolean | undefined;
2718
+ toolCall?: {
2719
+ status: "running" | "pending" | "completed" | "failed";
2720
+ id: string;
2721
+ name: string;
2722
+ createdAt?: number | undefined;
2723
+ input?: string | undefined;
2724
+ output?: string | undefined;
2725
+ } | undefined;
2726
+ updatedAt?: number | undefined;
2727
+ textDelta?: string | undefined;
2728
+ } | undefined;
2729
+ }, {
2730
+ conversationId: string;
2731
+ conversation?: {
2732
+ id: string;
2733
+ cwd: string;
2734
+ createdAt: number;
2735
+ lastActivityAt: number;
2736
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
2737
+ provider?: "claude" | "codex" | "custom" | undefined;
2738
+ agentSessionId?: string | undefined;
2739
+ model?: string | undefined;
2740
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
2741
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
2742
+ title?: string | undefined;
2743
+ archived?: boolean | undefined;
2744
+ lastMessagePreview?: string | undefined;
2745
+ } | undefined;
2746
+ item?: {
2747
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
2748
+ id: string;
2749
+ createdAt: number;
2750
+ conversationId: string;
2751
+ error?: string | undefined;
2752
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
2753
+ role?: "user" | "assistant" | "system" | undefined;
2754
+ text?: string | undefined;
2755
+ plan?: {
2756
+ status: "pending" | "completed" | "in_progress";
2757
+ id: string;
2758
+ text: string;
2759
+ }[] | undefined;
2760
+ content?: {
2761
+ type: "text" | "image";
2762
+ data?: string | undefined;
2763
+ text?: string | undefined;
2764
+ mimeType?: string | undefined;
2765
+ }[] | undefined;
2766
+ isStreaming?: boolean | undefined;
2767
+ toolCall?: {
2768
+ id: string;
2769
+ name: string;
2770
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
2771
+ createdAt?: number | undefined;
2772
+ input?: string | undefined;
2773
+ output?: string | undefined;
2774
+ } | undefined;
2775
+ permission?: {
2776
+ requestId: string;
2777
+ options?: {
2778
+ id: string;
2779
+ label: string;
2780
+ kind?: "allow" | "deny" | "other" | undefined;
2781
+ }[] | undefined;
2782
+ toolName?: string | undefined;
2783
+ toolInput?: string | undefined;
2784
+ context?: string | undefined;
2785
+ } | undefined;
2786
+ metadata?: Record<string, unknown> | undefined;
2787
+ updatedAt?: number | undefined;
2788
+ } | undefined;
2789
+ patch?: {
2790
+ itemId: string;
2791
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
2792
+ isStreaming?: boolean | undefined;
2793
+ toolCall?: {
2794
+ id: string;
2795
+ name: string;
2796
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
2797
+ createdAt?: number | undefined;
2798
+ input?: string | undefined;
2799
+ output?: string | undefined;
2800
+ } | undefined;
2801
+ updatedAt?: number | undefined;
2802
+ textDelta?: string | undefined;
2803
+ } | undefined;
2804
+ }>;
2805
+ export declare const agentV2PermissionRequestPayloadSchema: z.ZodObject<{
2806
+ requestId: z.ZodString;
2807
+ toolName: z.ZodOptional<z.ZodString>;
2808
+ toolInput: z.ZodOptional<z.ZodString>;
2809
+ context: z.ZodOptional<z.ZodString>;
2810
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
2811
+ id: z.ZodString;
2812
+ label: z.ZodString;
2813
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
2814
+ }, "strip", z.ZodTypeAny, {
2815
+ id: string;
2816
+ kind: "allow" | "deny" | "other";
2817
+ label: string;
2818
+ }, {
2819
+ id: string;
2820
+ label: string;
2821
+ kind?: "allow" | "deny" | "other" | undefined;
2822
+ }>, "many">>;
2823
+ } & {
2824
+ conversationId: z.ZodString;
2825
+ item: z.ZodOptional<z.ZodObject<{
2826
+ id: z.ZodString;
2827
+ conversationId: z.ZodString;
2828
+ type: z.ZodEnum<["message", "tool_call", "plan", "permission", "status", "error"]>;
2829
+ role: z.ZodOptional<z.ZodEnum<["user", "assistant", "system"]>>;
2830
+ content: z.ZodOptional<z.ZodArray<z.ZodObject<{
2831
+ type: z.ZodEnum<["text", "image"]>;
2832
+ text: z.ZodOptional<z.ZodString>;
2833
+ data: z.ZodOptional<z.ZodString>;
2834
+ mimeType: z.ZodOptional<z.ZodString>;
2835
+ }, "strip", z.ZodTypeAny, {
2836
+ type: "text" | "image";
2837
+ data?: string | undefined;
2838
+ text?: string | undefined;
2839
+ mimeType?: string | undefined;
2840
+ }, {
2841
+ type: "text" | "image";
2842
+ data?: string | undefined;
2843
+ text?: string | undefined;
2844
+ mimeType?: string | undefined;
2845
+ }>, "many">>;
2846
+ text: z.ZodOptional<z.ZodString>;
2847
+ toolCall: z.ZodOptional<z.ZodObject<{
2848
+ id: z.ZodString;
2849
+ name: z.ZodString;
2850
+ input: z.ZodOptional<z.ZodString>;
2851
+ output: z.ZodOptional<z.ZodString>;
2852
+ createdAt: z.ZodOptional<z.ZodNumber>;
2853
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
2854
+ }, "strip", z.ZodTypeAny, {
2855
+ status: "running" | "pending" | "completed" | "failed";
2856
+ id: string;
2857
+ name: string;
2858
+ createdAt?: number | undefined;
2859
+ input?: string | undefined;
2860
+ output?: string | undefined;
2861
+ }, {
2862
+ id: string;
2863
+ name: string;
2864
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
2865
+ createdAt?: number | undefined;
2866
+ input?: string | undefined;
2867
+ output?: string | undefined;
2868
+ }>>;
2869
+ plan: z.ZodOptional<z.ZodArray<z.ZodObject<{
2870
+ id: z.ZodString;
2871
+ text: z.ZodString;
2872
+ status: z.ZodEnum<["pending", "in_progress", "completed"]>;
2873
+ }, "strip", z.ZodTypeAny, {
2874
+ status: "pending" | "completed" | "in_progress";
2875
+ id: string;
2876
+ text: string;
2877
+ }, {
2878
+ status: "pending" | "completed" | "in_progress";
2879
+ id: string;
2880
+ text: string;
2881
+ }>, "many">>;
2882
+ permission: z.ZodOptional<z.ZodObject<{
2883
+ requestId: z.ZodString;
2884
+ toolName: z.ZodOptional<z.ZodString>;
2885
+ toolInput: z.ZodOptional<z.ZodString>;
2886
+ context: z.ZodOptional<z.ZodString>;
2887
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
2888
+ id: z.ZodString;
2889
+ label: z.ZodString;
2890
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
2891
+ }, "strip", z.ZodTypeAny, {
2892
+ id: string;
2893
+ kind: "allow" | "deny" | "other";
2894
+ label: string;
2895
+ }, {
2896
+ id: string;
2897
+ label: string;
2898
+ kind?: "allow" | "deny" | "other" | undefined;
2899
+ }>, "many">>;
2900
+ }, "strip", z.ZodTypeAny, {
2901
+ options: {
2902
+ id: string;
2903
+ kind: "allow" | "deny" | "other";
2904
+ label: string;
2905
+ }[];
2906
+ requestId: string;
2907
+ toolName?: string | undefined;
2908
+ toolInput?: string | undefined;
2909
+ context?: string | undefined;
2910
+ }, {
2911
+ requestId: string;
2912
+ options?: {
2913
+ id: string;
2914
+ label: string;
2915
+ kind?: "allow" | "deny" | "other" | undefined;
2916
+ }[] | undefined;
2917
+ toolName?: string | undefined;
2918
+ toolInput?: string | undefined;
2919
+ context?: string | undefined;
2920
+ }>>;
2921
+ status: z.ZodOptional<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
2922
+ error: z.ZodOptional<z.ZodString>;
2923
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2924
+ createdAt: z.ZodNumber;
2925
+ updatedAt: z.ZodOptional<z.ZodNumber>;
2926
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
2927
+ }, "strip", z.ZodTypeAny, {
2928
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
2929
+ id: string;
2930
+ createdAt: number;
2931
+ conversationId: string;
2932
+ error?: string | undefined;
2933
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
2934
+ role?: "user" | "assistant" | "system" | undefined;
2935
+ text?: string | undefined;
2936
+ plan?: {
2937
+ status: "pending" | "completed" | "in_progress";
2938
+ id: string;
2939
+ text: string;
2940
+ }[] | undefined;
2941
+ content?: {
2942
+ type: "text" | "image";
2943
+ data?: string | undefined;
2944
+ text?: string | undefined;
2945
+ mimeType?: string | undefined;
2946
+ }[] | undefined;
2947
+ isStreaming?: boolean | undefined;
2948
+ toolCall?: {
2949
+ status: "running" | "pending" | "completed" | "failed";
2950
+ id: string;
2951
+ name: string;
2952
+ createdAt?: number | undefined;
2953
+ input?: string | undefined;
2954
+ output?: string | undefined;
2955
+ } | undefined;
2956
+ permission?: {
2957
+ options: {
2958
+ id: string;
2959
+ kind: "allow" | "deny" | "other";
2960
+ label: string;
2961
+ }[];
2962
+ requestId: string;
2963
+ toolName?: string | undefined;
2964
+ toolInput?: string | undefined;
2965
+ context?: string | undefined;
2966
+ } | undefined;
2967
+ metadata?: Record<string, unknown> | undefined;
2968
+ updatedAt?: number | undefined;
2969
+ }, {
2970
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
2971
+ id: string;
2972
+ createdAt: number;
2973
+ conversationId: string;
2974
+ error?: string | undefined;
2975
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
2976
+ role?: "user" | "assistant" | "system" | undefined;
2977
+ text?: string | undefined;
2978
+ plan?: {
2979
+ status: "pending" | "completed" | "in_progress";
2980
+ id: string;
2981
+ text: string;
2982
+ }[] | undefined;
2983
+ content?: {
2984
+ type: "text" | "image";
2985
+ data?: string | undefined;
2986
+ text?: string | undefined;
2987
+ mimeType?: string | undefined;
2988
+ }[] | undefined;
2989
+ isStreaming?: boolean | undefined;
2990
+ toolCall?: {
2991
+ id: string;
2992
+ name: string;
2993
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
2994
+ createdAt?: number | undefined;
2995
+ input?: string | undefined;
2996
+ output?: string | undefined;
2997
+ } | undefined;
2998
+ permission?: {
2999
+ requestId: string;
3000
+ options?: {
3001
+ id: string;
3002
+ label: string;
3003
+ kind?: "allow" | "deny" | "other" | undefined;
3004
+ }[] | undefined;
3005
+ toolName?: string | undefined;
3006
+ toolInput?: string | undefined;
3007
+ context?: string | undefined;
3008
+ } | undefined;
3009
+ metadata?: Record<string, unknown> | undefined;
3010
+ updatedAt?: number | undefined;
3011
+ }>>;
3012
+ }, "strip", z.ZodTypeAny, {
3013
+ options: {
3014
+ id: string;
3015
+ kind: "allow" | "deny" | "other";
3016
+ label: string;
3017
+ }[];
3018
+ requestId: string;
3019
+ conversationId: string;
3020
+ toolName?: string | undefined;
3021
+ toolInput?: string | undefined;
3022
+ context?: string | undefined;
3023
+ item?: {
3024
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
3025
+ id: string;
3026
+ createdAt: number;
3027
+ conversationId: string;
3028
+ error?: string | undefined;
3029
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
3030
+ role?: "user" | "assistant" | "system" | undefined;
3031
+ text?: string | undefined;
3032
+ plan?: {
3033
+ status: "pending" | "completed" | "in_progress";
3034
+ id: string;
3035
+ text: string;
3036
+ }[] | undefined;
3037
+ content?: {
3038
+ type: "text" | "image";
3039
+ data?: string | undefined;
3040
+ text?: string | undefined;
3041
+ mimeType?: string | undefined;
3042
+ }[] | undefined;
3043
+ isStreaming?: boolean | undefined;
3044
+ toolCall?: {
3045
+ status: "running" | "pending" | "completed" | "failed";
3046
+ id: string;
3047
+ name: string;
3048
+ createdAt?: number | undefined;
3049
+ input?: string | undefined;
3050
+ output?: string | undefined;
3051
+ } | undefined;
3052
+ permission?: {
3053
+ options: {
3054
+ id: string;
3055
+ kind: "allow" | "deny" | "other";
3056
+ label: string;
3057
+ }[];
3058
+ requestId: string;
3059
+ toolName?: string | undefined;
3060
+ toolInput?: string | undefined;
3061
+ context?: string | undefined;
3062
+ } | undefined;
3063
+ metadata?: Record<string, unknown> | undefined;
3064
+ updatedAt?: number | undefined;
3065
+ } | undefined;
3066
+ }, {
3067
+ requestId: string;
3068
+ conversationId: string;
3069
+ options?: {
3070
+ id: string;
3071
+ label: string;
3072
+ kind?: "allow" | "deny" | "other" | undefined;
3073
+ }[] | undefined;
3074
+ toolName?: string | undefined;
3075
+ toolInput?: string | undefined;
3076
+ context?: string | undefined;
3077
+ item?: {
3078
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
3079
+ id: string;
3080
+ createdAt: number;
3081
+ conversationId: string;
3082
+ error?: string | undefined;
3083
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
3084
+ role?: "user" | "assistant" | "system" | undefined;
3085
+ text?: string | undefined;
3086
+ plan?: {
3087
+ status: "pending" | "completed" | "in_progress";
3088
+ id: string;
3089
+ text: string;
3090
+ }[] | undefined;
3091
+ content?: {
3092
+ type: "text" | "image";
3093
+ data?: string | undefined;
3094
+ text?: string | undefined;
3095
+ mimeType?: string | undefined;
3096
+ }[] | undefined;
3097
+ isStreaming?: boolean | undefined;
3098
+ toolCall?: {
3099
+ id: string;
3100
+ name: string;
3101
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
3102
+ createdAt?: number | undefined;
3103
+ input?: string | undefined;
3104
+ output?: string | undefined;
3105
+ } | undefined;
3106
+ permission?: {
3107
+ requestId: string;
3108
+ options?: {
3109
+ id: string;
3110
+ label: string;
3111
+ kind?: "allow" | "deny" | "other" | undefined;
3112
+ }[] | undefined;
3113
+ toolName?: string | undefined;
3114
+ toolInput?: string | undefined;
3115
+ context?: string | undefined;
3116
+ } | undefined;
3117
+ metadata?: Record<string, unknown> | undefined;
3118
+ updatedAt?: number | undefined;
3119
+ } | undefined;
3120
+ }>;
605
3121
  export declare const protocolMessageSchemas: {
606
3122
  readonly "session.connect": z.ZodObject<{
607
3123
  role: z.ZodEnum<["host", "client"]>;
@@ -1132,6 +3648,2192 @@ export declare const protocolMessageSchemas: {
1132
3648
  entries: string[];
1133
3649
  shell?: string | undefined;
1134
3650
  }>;
3651
+ readonly "agent.initialize": z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
3652
+ readonly "agent.capabilities": z.ZodObject<{
3653
+ enabled: z.ZodBoolean;
3654
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
3655
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
3656
+ error: z.ZodOptional<z.ZodString>;
3657
+ supportsSessionList: z.ZodDefault<z.ZodBoolean>;
3658
+ supportsSessionLoad: z.ZodDefault<z.ZodBoolean>;
3659
+ supportsImages: z.ZodDefault<z.ZodBoolean>;
3660
+ supportsAudio: z.ZodDefault<z.ZodBoolean>;
3661
+ supportsPermission: z.ZodDefault<z.ZodBoolean>;
3662
+ supportsPlan: z.ZodDefault<z.ZodBoolean>;
3663
+ supportsCancel: z.ZodDefault<z.ZodBoolean>;
3664
+ }, "strip", z.ZodTypeAny, {
3665
+ enabled: boolean;
3666
+ supportsSessionList: boolean;
3667
+ supportsSessionLoad: boolean;
3668
+ supportsImages: boolean;
3669
+ supportsAudio: boolean;
3670
+ supportsPermission: boolean;
3671
+ supportsPlan: boolean;
3672
+ supportsCancel: boolean;
3673
+ error?: string | undefined;
3674
+ provider?: "claude" | "codex" | "custom" | undefined;
3675
+ protocolVersion?: number | undefined;
3676
+ }, {
3677
+ enabled: boolean;
3678
+ error?: string | undefined;
3679
+ provider?: "claude" | "codex" | "custom" | undefined;
3680
+ protocolVersion?: number | undefined;
3681
+ supportsSessionList?: boolean | undefined;
3682
+ supportsSessionLoad?: boolean | undefined;
3683
+ supportsImages?: boolean | undefined;
3684
+ supportsAudio?: boolean | undefined;
3685
+ supportsPermission?: boolean | undefined;
3686
+ supportsPlan?: boolean | undefined;
3687
+ supportsCancel?: boolean | undefined;
3688
+ }>;
3689
+ readonly "agent.session.new": z.ZodObject<{
3690
+ cwd: z.ZodOptional<z.ZodString>;
3691
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
3692
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3693
+ }, "strip", z.ZodTypeAny, {
3694
+ provider?: "claude" | "codex" | "custom" | undefined;
3695
+ cwd?: string | undefined;
3696
+ mcpServers?: Record<string, unknown> | undefined;
3697
+ }, {
3698
+ provider?: "claude" | "codex" | "custom" | undefined;
3699
+ cwd?: string | undefined;
3700
+ mcpServers?: Record<string, unknown> | undefined;
3701
+ }>;
3702
+ readonly "agent.session.load": z.ZodObject<{
3703
+ agentSessionId: z.ZodString;
3704
+ cwd: z.ZodOptional<z.ZodString>;
3705
+ }, "strip", z.ZodTypeAny, {
3706
+ agentSessionId: string;
3707
+ cwd?: string | undefined;
3708
+ }, {
3709
+ agentSessionId: string;
3710
+ cwd?: string | undefined;
3711
+ }>;
3712
+ readonly "agent.session.list": z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
3713
+ readonly "agent.prompt": z.ZodObject<{
3714
+ agentSessionId: z.ZodOptional<z.ZodString>;
3715
+ clientMessageId: z.ZodString;
3716
+ contentBlocks: z.ZodArray<z.ZodObject<{
3717
+ type: z.ZodEnum<["text", "image"]>;
3718
+ text: z.ZodOptional<z.ZodString>;
3719
+ data: z.ZodOptional<z.ZodString>;
3720
+ mimeType: z.ZodOptional<z.ZodString>;
3721
+ }, "strip", z.ZodTypeAny, {
3722
+ type: "text" | "image";
3723
+ data?: string | undefined;
3724
+ text?: string | undefined;
3725
+ mimeType?: string | undefined;
3726
+ }, {
3727
+ type: "text" | "image";
3728
+ data?: string | undefined;
3729
+ text?: string | undefined;
3730
+ mimeType?: string | undefined;
3731
+ }>, "many">;
3732
+ model: z.ZodOptional<z.ZodString>;
3733
+ reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
3734
+ permissionMode: z.ZodOptional<z.ZodEnum<["read_only", "workspace_write", "full_access"]>>;
3735
+ }, "strip", z.ZodTypeAny, {
3736
+ clientMessageId: string;
3737
+ contentBlocks: {
3738
+ type: "text" | "image";
3739
+ data?: string | undefined;
3740
+ text?: string | undefined;
3741
+ mimeType?: string | undefined;
3742
+ }[];
3743
+ agentSessionId?: string | undefined;
3744
+ model?: string | undefined;
3745
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
3746
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
3747
+ }, {
3748
+ clientMessageId: string;
3749
+ contentBlocks: {
3750
+ type: "text" | "image";
3751
+ data?: string | undefined;
3752
+ text?: string | undefined;
3753
+ mimeType?: string | undefined;
3754
+ }[];
3755
+ agentSessionId?: string | undefined;
3756
+ model?: string | undefined;
3757
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
3758
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
3759
+ }>;
3760
+ readonly "agent.cancel": z.ZodObject<{
3761
+ agentSessionId: z.ZodOptional<z.ZodString>;
3762
+ }, "strip", z.ZodTypeAny, {
3763
+ agentSessionId?: string | undefined;
3764
+ }, {
3765
+ agentSessionId?: string | undefined;
3766
+ }>;
3767
+ readonly "agent.update": z.ZodObject<{
3768
+ agentSessionId: z.ZodOptional<z.ZodString>;
3769
+ kind: z.ZodEnum<["message", "message_delta", "tool_call", "tool_result", "plan", "status", "error"]>;
3770
+ message: z.ZodOptional<z.ZodObject<{
3771
+ id: z.ZodString;
3772
+ role: z.ZodEnum<["user", "assistant", "system"]>;
3773
+ content: z.ZodString;
3774
+ createdAt: z.ZodNumber;
3775
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
3776
+ }, "strip", z.ZodTypeAny, {
3777
+ id: string;
3778
+ role: "user" | "assistant" | "system";
3779
+ content: string;
3780
+ createdAt: number;
3781
+ isStreaming?: boolean | undefined;
3782
+ }, {
3783
+ id: string;
3784
+ role: "user" | "assistant" | "system";
3785
+ content: string;
3786
+ createdAt: number;
3787
+ isStreaming?: boolean | undefined;
3788
+ }>>;
3789
+ delta: z.ZodOptional<z.ZodString>;
3790
+ toolCall: z.ZodOptional<z.ZodObject<{
3791
+ id: z.ZodString;
3792
+ name: z.ZodString;
3793
+ input: z.ZodOptional<z.ZodString>;
3794
+ output: z.ZodOptional<z.ZodString>;
3795
+ createdAt: z.ZodOptional<z.ZodNumber>;
3796
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
3797
+ }, "strip", z.ZodTypeAny, {
3798
+ status: "running" | "pending" | "completed" | "failed";
3799
+ id: string;
3800
+ name: string;
3801
+ createdAt?: number | undefined;
3802
+ input?: string | undefined;
3803
+ output?: string | undefined;
3804
+ }, {
3805
+ id: string;
3806
+ name: string;
3807
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
3808
+ createdAt?: number | undefined;
3809
+ input?: string | undefined;
3810
+ output?: string | undefined;
3811
+ }>>;
3812
+ plan: z.ZodOptional<z.ZodArray<z.ZodObject<{
3813
+ id: z.ZodString;
3814
+ text: z.ZodString;
3815
+ status: z.ZodEnum<["pending", "in_progress", "completed"]>;
3816
+ }, "strip", z.ZodTypeAny, {
3817
+ status: "pending" | "completed" | "in_progress";
3818
+ id: string;
3819
+ text: string;
3820
+ }, {
3821
+ status: "pending" | "completed" | "in_progress";
3822
+ id: string;
3823
+ text: string;
3824
+ }>, "many">>;
3825
+ status: z.ZodOptional<z.ZodEnum<["idle", "running", "waiting_permission", "error"]>>;
3826
+ error: z.ZodOptional<z.ZodString>;
3827
+ }, "strip", z.ZodTypeAny, {
3828
+ kind: "error" | "message" | "status" | "message_delta" | "tool_call" | "tool_result" | "plan";
3829
+ error?: string | undefined;
3830
+ message?: {
3831
+ id: string;
3832
+ role: "user" | "assistant" | "system";
3833
+ content: string;
3834
+ createdAt: number;
3835
+ isStreaming?: boolean | undefined;
3836
+ } | undefined;
3837
+ status?: "error" | "running" | "idle" | "waiting_permission" | undefined;
3838
+ agentSessionId?: string | undefined;
3839
+ plan?: {
3840
+ status: "pending" | "completed" | "in_progress";
3841
+ id: string;
3842
+ text: string;
3843
+ }[] | undefined;
3844
+ delta?: string | undefined;
3845
+ toolCall?: {
3846
+ status: "running" | "pending" | "completed" | "failed";
3847
+ id: string;
3848
+ name: string;
3849
+ createdAt?: number | undefined;
3850
+ input?: string | undefined;
3851
+ output?: string | undefined;
3852
+ } | undefined;
3853
+ }, {
3854
+ kind: "error" | "message" | "status" | "message_delta" | "tool_call" | "tool_result" | "plan";
3855
+ error?: string | undefined;
3856
+ message?: {
3857
+ id: string;
3858
+ role: "user" | "assistant" | "system";
3859
+ content: string;
3860
+ createdAt: number;
3861
+ isStreaming?: boolean | undefined;
3862
+ } | undefined;
3863
+ status?: "error" | "running" | "idle" | "waiting_permission" | undefined;
3864
+ agentSessionId?: string | undefined;
3865
+ plan?: {
3866
+ status: "pending" | "completed" | "in_progress";
3867
+ id: string;
3868
+ text: string;
3869
+ }[] | undefined;
3870
+ delta?: string | undefined;
3871
+ toolCall?: {
3872
+ id: string;
3873
+ name: string;
3874
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
3875
+ createdAt?: number | undefined;
3876
+ input?: string | undefined;
3877
+ output?: string | undefined;
3878
+ } | undefined;
3879
+ }>;
3880
+ readonly "agent.permission.request": z.ZodObject<{
3881
+ requestId: z.ZodString;
3882
+ toolName: z.ZodOptional<z.ZodString>;
3883
+ toolInput: z.ZodOptional<z.ZodString>;
3884
+ context: z.ZodOptional<z.ZodString>;
3885
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
3886
+ id: z.ZodString;
3887
+ label: z.ZodString;
3888
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
3889
+ }, "strip", z.ZodTypeAny, {
3890
+ id: string;
3891
+ kind: "allow" | "deny" | "other";
3892
+ label: string;
3893
+ }, {
3894
+ id: string;
3895
+ label: string;
3896
+ kind?: "allow" | "deny" | "other" | undefined;
3897
+ }>, "many">>;
3898
+ } & {
3899
+ agentSessionId: z.ZodOptional<z.ZodString>;
3900
+ }, "strip", z.ZodTypeAny, {
3901
+ options: {
3902
+ id: string;
3903
+ kind: "allow" | "deny" | "other";
3904
+ label: string;
3905
+ }[];
3906
+ requestId: string;
3907
+ toolName?: string | undefined;
3908
+ toolInput?: string | undefined;
3909
+ agentSessionId?: string | undefined;
3910
+ context?: string | undefined;
3911
+ }, {
3912
+ requestId: string;
3913
+ options?: {
3914
+ id: string;
3915
+ label: string;
3916
+ kind?: "allow" | "deny" | "other" | undefined;
3917
+ }[] | undefined;
3918
+ toolName?: string | undefined;
3919
+ toolInput?: string | undefined;
3920
+ agentSessionId?: string | undefined;
3921
+ context?: string | undefined;
3922
+ }>;
3923
+ readonly "agent.permission.response": z.ZodObject<{
3924
+ agentSessionId: z.ZodOptional<z.ZodString>;
3925
+ requestId: z.ZodString;
3926
+ outcome: z.ZodEnum<["allow", "deny", "cancelled"]>;
3927
+ optionId: z.ZodOptional<z.ZodString>;
3928
+ }, "strip", z.ZodTypeAny, {
3929
+ requestId: string;
3930
+ outcome: "allow" | "deny" | "cancelled";
3931
+ agentSessionId?: string | undefined;
3932
+ optionId?: string | undefined;
3933
+ }, {
3934
+ requestId: string;
3935
+ outcome: "allow" | "deny" | "cancelled";
3936
+ agentSessionId?: string | undefined;
3937
+ optionId?: string | undefined;
3938
+ }>;
3939
+ readonly "agent.snapshot": z.ZodObject<{
3940
+ agentSessionId: z.ZodOptional<z.ZodString>;
3941
+ capabilities: z.ZodOptional<z.ZodObject<{
3942
+ enabled: z.ZodBoolean;
3943
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
3944
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
3945
+ error: z.ZodOptional<z.ZodString>;
3946
+ supportsSessionList: z.ZodDefault<z.ZodBoolean>;
3947
+ supportsSessionLoad: z.ZodDefault<z.ZodBoolean>;
3948
+ supportsImages: z.ZodDefault<z.ZodBoolean>;
3949
+ supportsAudio: z.ZodDefault<z.ZodBoolean>;
3950
+ supportsPermission: z.ZodDefault<z.ZodBoolean>;
3951
+ supportsPlan: z.ZodDefault<z.ZodBoolean>;
3952
+ supportsCancel: z.ZodDefault<z.ZodBoolean>;
3953
+ }, "strip", z.ZodTypeAny, {
3954
+ enabled: boolean;
3955
+ supportsSessionList: boolean;
3956
+ supportsSessionLoad: boolean;
3957
+ supportsImages: boolean;
3958
+ supportsAudio: boolean;
3959
+ supportsPermission: boolean;
3960
+ supportsPlan: boolean;
3961
+ supportsCancel: boolean;
3962
+ error?: string | undefined;
3963
+ provider?: "claude" | "codex" | "custom" | undefined;
3964
+ protocolVersion?: number | undefined;
3965
+ }, {
3966
+ enabled: boolean;
3967
+ error?: string | undefined;
3968
+ provider?: "claude" | "codex" | "custom" | undefined;
3969
+ protocolVersion?: number | undefined;
3970
+ supportsSessionList?: boolean | undefined;
3971
+ supportsSessionLoad?: boolean | undefined;
3972
+ supportsImages?: boolean | undefined;
3973
+ supportsAudio?: boolean | undefined;
3974
+ supportsPermission?: boolean | undefined;
3975
+ supportsPlan?: boolean | undefined;
3976
+ supportsCancel?: boolean | undefined;
3977
+ }>>;
3978
+ messages: z.ZodDefault<z.ZodArray<z.ZodObject<{
3979
+ id: z.ZodString;
3980
+ role: z.ZodEnum<["user", "assistant", "system"]>;
3981
+ content: z.ZodString;
3982
+ createdAt: z.ZodNumber;
3983
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
3984
+ }, "strip", z.ZodTypeAny, {
3985
+ id: string;
3986
+ role: "user" | "assistant" | "system";
3987
+ content: string;
3988
+ createdAt: number;
3989
+ isStreaming?: boolean | undefined;
3990
+ }, {
3991
+ id: string;
3992
+ role: "user" | "assistant" | "system";
3993
+ content: string;
3994
+ createdAt: number;
3995
+ isStreaming?: boolean | undefined;
3996
+ }>, "many">>;
3997
+ toolCalls: z.ZodDefault<z.ZodArray<z.ZodObject<{
3998
+ id: z.ZodString;
3999
+ name: z.ZodString;
4000
+ input: z.ZodOptional<z.ZodString>;
4001
+ output: z.ZodOptional<z.ZodString>;
4002
+ createdAt: z.ZodOptional<z.ZodNumber>;
4003
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
4004
+ }, "strip", z.ZodTypeAny, {
4005
+ status: "running" | "pending" | "completed" | "failed";
4006
+ id: string;
4007
+ name: string;
4008
+ createdAt?: number | undefined;
4009
+ input?: string | undefined;
4010
+ output?: string | undefined;
4011
+ }, {
4012
+ id: string;
4013
+ name: string;
4014
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
4015
+ createdAt?: number | undefined;
4016
+ input?: string | undefined;
4017
+ output?: string | undefined;
4018
+ }>, "many">>;
4019
+ pendingPermissions: z.ZodDefault<z.ZodArray<z.ZodObject<{
4020
+ requestId: z.ZodString;
4021
+ toolName: z.ZodOptional<z.ZodString>;
4022
+ toolInput: z.ZodOptional<z.ZodString>;
4023
+ context: z.ZodOptional<z.ZodString>;
4024
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
4025
+ id: z.ZodString;
4026
+ label: z.ZodString;
4027
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
4028
+ }, "strip", z.ZodTypeAny, {
4029
+ id: string;
4030
+ kind: "allow" | "deny" | "other";
4031
+ label: string;
4032
+ }, {
4033
+ id: string;
4034
+ label: string;
4035
+ kind?: "allow" | "deny" | "other" | undefined;
4036
+ }>, "many">>;
4037
+ }, "strip", z.ZodTypeAny, {
4038
+ options: {
4039
+ id: string;
4040
+ kind: "allow" | "deny" | "other";
4041
+ label: string;
4042
+ }[];
4043
+ requestId: string;
4044
+ toolName?: string | undefined;
4045
+ toolInput?: string | undefined;
4046
+ context?: string | undefined;
4047
+ }, {
4048
+ requestId: string;
4049
+ options?: {
4050
+ id: string;
4051
+ label: string;
4052
+ kind?: "allow" | "deny" | "other" | undefined;
4053
+ }[] | undefined;
4054
+ toolName?: string | undefined;
4055
+ toolInput?: string | undefined;
4056
+ context?: string | undefined;
4057
+ }>, "many">>;
4058
+ status: z.ZodDefault<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
4059
+ error: z.ZodOptional<z.ZodString>;
4060
+ }, "strip", z.ZodTypeAny, {
4061
+ status: "error" | "running" | "idle" | "waiting_permission" | "unavailable";
4062
+ messages: {
4063
+ id: string;
4064
+ role: "user" | "assistant" | "system";
4065
+ content: string;
4066
+ createdAt: number;
4067
+ isStreaming?: boolean | undefined;
4068
+ }[];
4069
+ toolCalls: {
4070
+ status: "running" | "pending" | "completed" | "failed";
4071
+ id: string;
4072
+ name: string;
4073
+ createdAt?: number | undefined;
4074
+ input?: string | undefined;
4075
+ output?: string | undefined;
4076
+ }[];
4077
+ pendingPermissions: {
4078
+ options: {
4079
+ id: string;
4080
+ kind: "allow" | "deny" | "other";
4081
+ label: string;
4082
+ }[];
4083
+ requestId: string;
4084
+ toolName?: string | undefined;
4085
+ toolInput?: string | undefined;
4086
+ context?: string | undefined;
4087
+ }[];
4088
+ error?: string | undefined;
4089
+ agentSessionId?: string | undefined;
4090
+ capabilities?: {
4091
+ enabled: boolean;
4092
+ supportsSessionList: boolean;
4093
+ supportsSessionLoad: boolean;
4094
+ supportsImages: boolean;
4095
+ supportsAudio: boolean;
4096
+ supportsPermission: boolean;
4097
+ supportsPlan: boolean;
4098
+ supportsCancel: boolean;
4099
+ error?: string | undefined;
4100
+ provider?: "claude" | "codex" | "custom" | undefined;
4101
+ protocolVersion?: number | undefined;
4102
+ } | undefined;
4103
+ }, {
4104
+ error?: string | undefined;
4105
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
4106
+ agentSessionId?: string | undefined;
4107
+ capabilities?: {
4108
+ enabled: boolean;
4109
+ error?: string | undefined;
4110
+ provider?: "claude" | "codex" | "custom" | undefined;
4111
+ protocolVersion?: number | undefined;
4112
+ supportsSessionList?: boolean | undefined;
4113
+ supportsSessionLoad?: boolean | undefined;
4114
+ supportsImages?: boolean | undefined;
4115
+ supportsAudio?: boolean | undefined;
4116
+ supportsPermission?: boolean | undefined;
4117
+ supportsPlan?: boolean | undefined;
4118
+ supportsCancel?: boolean | undefined;
4119
+ } | undefined;
4120
+ messages?: {
4121
+ id: string;
4122
+ role: "user" | "assistant" | "system";
4123
+ content: string;
4124
+ createdAt: number;
4125
+ isStreaming?: boolean | undefined;
4126
+ }[] | undefined;
4127
+ toolCalls?: {
4128
+ id: string;
4129
+ name: string;
4130
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
4131
+ createdAt?: number | undefined;
4132
+ input?: string | undefined;
4133
+ output?: string | undefined;
4134
+ }[] | undefined;
4135
+ pendingPermissions?: {
4136
+ requestId: string;
4137
+ options?: {
4138
+ id: string;
4139
+ label: string;
4140
+ kind?: "allow" | "deny" | "other" | undefined;
4141
+ }[] | undefined;
4142
+ toolName?: string | undefined;
4143
+ toolInput?: string | undefined;
4144
+ context?: string | undefined;
4145
+ }[] | undefined;
4146
+ }>;
4147
+ readonly "agent.v2.capabilities.request": z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
4148
+ readonly "agent.v2.capabilities": z.ZodObject<{
4149
+ enabled: z.ZodBoolean;
4150
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
4151
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
4152
+ error: z.ZodOptional<z.ZodString>;
4153
+ supportsSessionList: z.ZodDefault<z.ZodBoolean>;
4154
+ supportsSessionLoad: z.ZodDefault<z.ZodBoolean>;
4155
+ supportsImages: z.ZodDefault<z.ZodBoolean>;
4156
+ supportsAudio: z.ZodDefault<z.ZodBoolean>;
4157
+ supportsPermission: z.ZodDefault<z.ZodBoolean>;
4158
+ supportsPlan: z.ZodDefault<z.ZodBoolean>;
4159
+ supportsCancel: z.ZodDefault<z.ZodBoolean>;
4160
+ } & {
4161
+ workspaceProtocolVersion: z.ZodDefault<z.ZodNumber>;
4162
+ }, "strip", z.ZodTypeAny, {
4163
+ enabled: boolean;
4164
+ supportsSessionList: boolean;
4165
+ supportsSessionLoad: boolean;
4166
+ supportsImages: boolean;
4167
+ supportsAudio: boolean;
4168
+ supportsPermission: boolean;
4169
+ supportsPlan: boolean;
4170
+ supportsCancel: boolean;
4171
+ workspaceProtocolVersion: number;
4172
+ error?: string | undefined;
4173
+ provider?: "claude" | "codex" | "custom" | undefined;
4174
+ protocolVersion?: number | undefined;
4175
+ }, {
4176
+ enabled: boolean;
4177
+ error?: string | undefined;
4178
+ provider?: "claude" | "codex" | "custom" | undefined;
4179
+ protocolVersion?: number | undefined;
4180
+ supportsSessionList?: boolean | undefined;
4181
+ supportsSessionLoad?: boolean | undefined;
4182
+ supportsImages?: boolean | undefined;
4183
+ supportsAudio?: boolean | undefined;
4184
+ supportsPermission?: boolean | undefined;
4185
+ supportsPlan?: boolean | undefined;
4186
+ supportsCancel?: boolean | undefined;
4187
+ workspaceProtocolVersion?: number | undefined;
4188
+ }>;
4189
+ readonly "agent.v2.conversation.open": z.ZodObject<{
4190
+ conversationId: z.ZodOptional<z.ZodString>;
4191
+ agentSessionId: z.ZodOptional<z.ZodString>;
4192
+ cwd: z.ZodOptional<z.ZodString>;
4193
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
4194
+ model: z.ZodOptional<z.ZodString>;
4195
+ reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
4196
+ permissionMode: z.ZodOptional<z.ZodEnum<["read_only", "workspace_write", "full_access"]>>;
4197
+ title: z.ZodOptional<z.ZodString>;
4198
+ }, "strip", z.ZodTypeAny, {
4199
+ provider?: "claude" | "codex" | "custom" | undefined;
4200
+ cwd?: string | undefined;
4201
+ agentSessionId?: string | undefined;
4202
+ model?: string | undefined;
4203
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
4204
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
4205
+ conversationId?: string | undefined;
4206
+ title?: string | undefined;
4207
+ }, {
4208
+ provider?: "claude" | "codex" | "custom" | undefined;
4209
+ cwd?: string | undefined;
4210
+ agentSessionId?: string | undefined;
4211
+ model?: string | undefined;
4212
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
4213
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
4214
+ conversationId?: string | undefined;
4215
+ title?: string | undefined;
4216
+ }>;
4217
+ readonly "agent.v2.conversation.opened": z.ZodObject<{
4218
+ conversation: z.ZodObject<{
4219
+ id: z.ZodString;
4220
+ agentSessionId: z.ZodOptional<z.ZodString>;
4221
+ provider: z.ZodDefault<z.ZodEnum<["codex", "claude", "custom"]>>;
4222
+ cwd: z.ZodString;
4223
+ title: z.ZodOptional<z.ZodString>;
4224
+ model: z.ZodOptional<z.ZodString>;
4225
+ reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
4226
+ permissionMode: z.ZodOptional<z.ZodEnum<["read_only", "workspace_write", "full_access"]>>;
4227
+ status: z.ZodDefault<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
4228
+ archived: z.ZodDefault<z.ZodBoolean>;
4229
+ lastMessagePreview: z.ZodOptional<z.ZodString>;
4230
+ lastActivityAt: z.ZodNumber;
4231
+ createdAt: z.ZodNumber;
4232
+ }, "strip", z.ZodTypeAny, {
4233
+ status: "error" | "running" | "idle" | "waiting_permission" | "unavailable";
4234
+ id: string;
4235
+ provider: "claude" | "codex" | "custom";
4236
+ cwd: string;
4237
+ createdAt: number;
4238
+ archived: boolean;
4239
+ lastActivityAt: number;
4240
+ agentSessionId?: string | undefined;
4241
+ model?: string | undefined;
4242
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
4243
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
4244
+ title?: string | undefined;
4245
+ lastMessagePreview?: string | undefined;
4246
+ }, {
4247
+ id: string;
4248
+ cwd: string;
4249
+ createdAt: number;
4250
+ lastActivityAt: number;
4251
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
4252
+ provider?: "claude" | "codex" | "custom" | undefined;
4253
+ agentSessionId?: string | undefined;
4254
+ model?: string | undefined;
4255
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
4256
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
4257
+ title?: string | undefined;
4258
+ archived?: boolean | undefined;
4259
+ lastMessagePreview?: string | undefined;
4260
+ }>;
4261
+ snapshot: z.ZodDefault<z.ZodArray<z.ZodObject<{
4262
+ id: z.ZodString;
4263
+ conversationId: z.ZodString;
4264
+ type: z.ZodEnum<["message", "tool_call", "plan", "permission", "status", "error"]>;
4265
+ role: z.ZodOptional<z.ZodEnum<["user", "assistant", "system"]>>;
4266
+ content: z.ZodOptional<z.ZodArray<z.ZodObject<{
4267
+ type: z.ZodEnum<["text", "image"]>;
4268
+ text: z.ZodOptional<z.ZodString>;
4269
+ data: z.ZodOptional<z.ZodString>;
4270
+ mimeType: z.ZodOptional<z.ZodString>;
4271
+ }, "strip", z.ZodTypeAny, {
4272
+ type: "text" | "image";
4273
+ data?: string | undefined;
4274
+ text?: string | undefined;
4275
+ mimeType?: string | undefined;
4276
+ }, {
4277
+ type: "text" | "image";
4278
+ data?: string | undefined;
4279
+ text?: string | undefined;
4280
+ mimeType?: string | undefined;
4281
+ }>, "many">>;
4282
+ text: z.ZodOptional<z.ZodString>;
4283
+ toolCall: z.ZodOptional<z.ZodObject<{
4284
+ id: z.ZodString;
4285
+ name: z.ZodString;
4286
+ input: z.ZodOptional<z.ZodString>;
4287
+ output: z.ZodOptional<z.ZodString>;
4288
+ createdAt: z.ZodOptional<z.ZodNumber>;
4289
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
4290
+ }, "strip", z.ZodTypeAny, {
4291
+ status: "running" | "pending" | "completed" | "failed";
4292
+ id: string;
4293
+ name: string;
4294
+ createdAt?: number | undefined;
4295
+ input?: string | undefined;
4296
+ output?: string | undefined;
4297
+ }, {
4298
+ id: string;
4299
+ name: string;
4300
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
4301
+ createdAt?: number | undefined;
4302
+ input?: string | undefined;
4303
+ output?: string | undefined;
4304
+ }>>;
4305
+ plan: z.ZodOptional<z.ZodArray<z.ZodObject<{
4306
+ id: z.ZodString;
4307
+ text: z.ZodString;
4308
+ status: z.ZodEnum<["pending", "in_progress", "completed"]>;
4309
+ }, "strip", z.ZodTypeAny, {
4310
+ status: "pending" | "completed" | "in_progress";
4311
+ id: string;
4312
+ text: string;
4313
+ }, {
4314
+ status: "pending" | "completed" | "in_progress";
4315
+ id: string;
4316
+ text: string;
4317
+ }>, "many">>;
4318
+ permission: z.ZodOptional<z.ZodObject<{
4319
+ requestId: z.ZodString;
4320
+ toolName: z.ZodOptional<z.ZodString>;
4321
+ toolInput: z.ZodOptional<z.ZodString>;
4322
+ context: z.ZodOptional<z.ZodString>;
4323
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
4324
+ id: z.ZodString;
4325
+ label: z.ZodString;
4326
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
4327
+ }, "strip", z.ZodTypeAny, {
4328
+ id: string;
4329
+ kind: "allow" | "deny" | "other";
4330
+ label: string;
4331
+ }, {
4332
+ id: string;
4333
+ label: string;
4334
+ kind?: "allow" | "deny" | "other" | undefined;
4335
+ }>, "many">>;
4336
+ }, "strip", z.ZodTypeAny, {
4337
+ options: {
4338
+ id: string;
4339
+ kind: "allow" | "deny" | "other";
4340
+ label: string;
4341
+ }[];
4342
+ requestId: string;
4343
+ toolName?: string | undefined;
4344
+ toolInput?: string | undefined;
4345
+ context?: string | undefined;
4346
+ }, {
4347
+ requestId: string;
4348
+ options?: {
4349
+ id: string;
4350
+ label: string;
4351
+ kind?: "allow" | "deny" | "other" | undefined;
4352
+ }[] | undefined;
4353
+ toolName?: string | undefined;
4354
+ toolInput?: string | undefined;
4355
+ context?: string | undefined;
4356
+ }>>;
4357
+ status: z.ZodOptional<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
4358
+ error: z.ZodOptional<z.ZodString>;
4359
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4360
+ createdAt: z.ZodNumber;
4361
+ updatedAt: z.ZodOptional<z.ZodNumber>;
4362
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
4363
+ }, "strip", z.ZodTypeAny, {
4364
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
4365
+ id: string;
4366
+ createdAt: number;
4367
+ conversationId: string;
4368
+ error?: string | undefined;
4369
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
4370
+ role?: "user" | "assistant" | "system" | undefined;
4371
+ text?: string | undefined;
4372
+ plan?: {
4373
+ status: "pending" | "completed" | "in_progress";
4374
+ id: string;
4375
+ text: string;
4376
+ }[] | undefined;
4377
+ content?: {
4378
+ type: "text" | "image";
4379
+ data?: string | undefined;
4380
+ text?: string | undefined;
4381
+ mimeType?: string | undefined;
4382
+ }[] | undefined;
4383
+ isStreaming?: boolean | undefined;
4384
+ toolCall?: {
4385
+ status: "running" | "pending" | "completed" | "failed";
4386
+ id: string;
4387
+ name: string;
4388
+ createdAt?: number | undefined;
4389
+ input?: string | undefined;
4390
+ output?: string | undefined;
4391
+ } | undefined;
4392
+ permission?: {
4393
+ options: {
4394
+ id: string;
4395
+ kind: "allow" | "deny" | "other";
4396
+ label: string;
4397
+ }[];
4398
+ requestId: string;
4399
+ toolName?: string | undefined;
4400
+ toolInput?: string | undefined;
4401
+ context?: string | undefined;
4402
+ } | undefined;
4403
+ metadata?: Record<string, unknown> | undefined;
4404
+ updatedAt?: number | undefined;
4405
+ }, {
4406
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
4407
+ id: string;
4408
+ createdAt: number;
4409
+ conversationId: string;
4410
+ error?: string | undefined;
4411
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
4412
+ role?: "user" | "assistant" | "system" | undefined;
4413
+ text?: string | undefined;
4414
+ plan?: {
4415
+ status: "pending" | "completed" | "in_progress";
4416
+ id: string;
4417
+ text: string;
4418
+ }[] | undefined;
4419
+ content?: {
4420
+ type: "text" | "image";
4421
+ data?: string | undefined;
4422
+ text?: string | undefined;
4423
+ mimeType?: string | undefined;
4424
+ }[] | undefined;
4425
+ isStreaming?: boolean | undefined;
4426
+ toolCall?: {
4427
+ id: string;
4428
+ name: string;
4429
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
4430
+ createdAt?: number | undefined;
4431
+ input?: string | undefined;
4432
+ output?: string | undefined;
4433
+ } | undefined;
4434
+ permission?: {
4435
+ requestId: string;
4436
+ options?: {
4437
+ id: string;
4438
+ label: string;
4439
+ kind?: "allow" | "deny" | "other" | undefined;
4440
+ }[] | undefined;
4441
+ toolName?: string | undefined;
4442
+ toolInput?: string | undefined;
4443
+ context?: string | undefined;
4444
+ } | undefined;
4445
+ metadata?: Record<string, unknown> | undefined;
4446
+ updatedAt?: number | undefined;
4447
+ }>, "many">>;
4448
+ }, "strip", z.ZodTypeAny, {
4449
+ conversation: {
4450
+ status: "error" | "running" | "idle" | "waiting_permission" | "unavailable";
4451
+ id: string;
4452
+ provider: "claude" | "codex" | "custom";
4453
+ cwd: string;
4454
+ createdAt: number;
4455
+ archived: boolean;
4456
+ lastActivityAt: number;
4457
+ agentSessionId?: string | undefined;
4458
+ model?: string | undefined;
4459
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
4460
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
4461
+ title?: string | undefined;
4462
+ lastMessagePreview?: string | undefined;
4463
+ };
4464
+ snapshot: {
4465
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
4466
+ id: string;
4467
+ createdAt: number;
4468
+ conversationId: string;
4469
+ error?: string | undefined;
4470
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
4471
+ role?: "user" | "assistant" | "system" | undefined;
4472
+ text?: string | undefined;
4473
+ plan?: {
4474
+ status: "pending" | "completed" | "in_progress";
4475
+ id: string;
4476
+ text: string;
4477
+ }[] | undefined;
4478
+ content?: {
4479
+ type: "text" | "image";
4480
+ data?: string | undefined;
4481
+ text?: string | undefined;
4482
+ mimeType?: string | undefined;
4483
+ }[] | undefined;
4484
+ isStreaming?: boolean | undefined;
4485
+ toolCall?: {
4486
+ status: "running" | "pending" | "completed" | "failed";
4487
+ id: string;
4488
+ name: string;
4489
+ createdAt?: number | undefined;
4490
+ input?: string | undefined;
4491
+ output?: string | undefined;
4492
+ } | undefined;
4493
+ permission?: {
4494
+ options: {
4495
+ id: string;
4496
+ kind: "allow" | "deny" | "other";
4497
+ label: string;
4498
+ }[];
4499
+ requestId: string;
4500
+ toolName?: string | undefined;
4501
+ toolInput?: string | undefined;
4502
+ context?: string | undefined;
4503
+ } | undefined;
4504
+ metadata?: Record<string, unknown> | undefined;
4505
+ updatedAt?: number | undefined;
4506
+ }[];
4507
+ }, {
4508
+ conversation: {
4509
+ id: string;
4510
+ cwd: string;
4511
+ createdAt: number;
4512
+ lastActivityAt: number;
4513
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
4514
+ provider?: "claude" | "codex" | "custom" | undefined;
4515
+ agentSessionId?: string | undefined;
4516
+ model?: string | undefined;
4517
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
4518
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
4519
+ title?: string | undefined;
4520
+ archived?: boolean | undefined;
4521
+ lastMessagePreview?: string | undefined;
4522
+ };
4523
+ snapshot?: {
4524
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
4525
+ id: string;
4526
+ createdAt: number;
4527
+ conversationId: string;
4528
+ error?: string | undefined;
4529
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
4530
+ role?: "user" | "assistant" | "system" | undefined;
4531
+ text?: string | undefined;
4532
+ plan?: {
4533
+ status: "pending" | "completed" | "in_progress";
4534
+ id: string;
4535
+ text: string;
4536
+ }[] | undefined;
4537
+ content?: {
4538
+ type: "text" | "image";
4539
+ data?: string | undefined;
4540
+ text?: string | undefined;
4541
+ mimeType?: string | undefined;
4542
+ }[] | undefined;
4543
+ isStreaming?: boolean | undefined;
4544
+ toolCall?: {
4545
+ id: string;
4546
+ name: string;
4547
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
4548
+ createdAt?: number | undefined;
4549
+ input?: string | undefined;
4550
+ output?: string | undefined;
4551
+ } | undefined;
4552
+ permission?: {
4553
+ requestId: string;
4554
+ options?: {
4555
+ id: string;
4556
+ label: string;
4557
+ kind?: "allow" | "deny" | "other" | undefined;
4558
+ }[] | undefined;
4559
+ toolName?: string | undefined;
4560
+ toolInput?: string | undefined;
4561
+ context?: string | undefined;
4562
+ } | undefined;
4563
+ metadata?: Record<string, unknown> | undefined;
4564
+ updatedAt?: number | undefined;
4565
+ }[] | undefined;
4566
+ }>;
4567
+ readonly "agent.v2.conversation.list": z.ZodObject<{
4568
+ includeArchived: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
4569
+ }, "strip", z.ZodTypeAny, {
4570
+ includeArchived: boolean;
4571
+ }, {
4572
+ includeArchived?: boolean | undefined;
4573
+ }>;
4574
+ readonly "agent.v2.conversation.list.result": z.ZodObject<{
4575
+ conversations: z.ZodArray<z.ZodObject<{
4576
+ id: z.ZodString;
4577
+ agentSessionId: z.ZodOptional<z.ZodString>;
4578
+ provider: z.ZodDefault<z.ZodEnum<["codex", "claude", "custom"]>>;
4579
+ cwd: z.ZodString;
4580
+ title: z.ZodOptional<z.ZodString>;
4581
+ model: z.ZodOptional<z.ZodString>;
4582
+ reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
4583
+ permissionMode: z.ZodOptional<z.ZodEnum<["read_only", "workspace_write", "full_access"]>>;
4584
+ status: z.ZodDefault<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
4585
+ archived: z.ZodDefault<z.ZodBoolean>;
4586
+ lastMessagePreview: z.ZodOptional<z.ZodString>;
4587
+ lastActivityAt: z.ZodNumber;
4588
+ createdAt: z.ZodNumber;
4589
+ }, "strip", z.ZodTypeAny, {
4590
+ status: "error" | "running" | "idle" | "waiting_permission" | "unavailable";
4591
+ id: string;
4592
+ provider: "claude" | "codex" | "custom";
4593
+ cwd: string;
4594
+ createdAt: number;
4595
+ archived: boolean;
4596
+ lastActivityAt: number;
4597
+ agentSessionId?: string | undefined;
4598
+ model?: string | undefined;
4599
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
4600
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
4601
+ title?: string | undefined;
4602
+ lastMessagePreview?: string | undefined;
4603
+ }, {
4604
+ id: string;
4605
+ cwd: string;
4606
+ createdAt: number;
4607
+ lastActivityAt: number;
4608
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
4609
+ provider?: "claude" | "codex" | "custom" | undefined;
4610
+ agentSessionId?: string | undefined;
4611
+ model?: string | undefined;
4612
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
4613
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
4614
+ title?: string | undefined;
4615
+ archived?: boolean | undefined;
4616
+ lastMessagePreview?: string | undefined;
4617
+ }>, "many">;
4618
+ }, "strip", z.ZodTypeAny, {
4619
+ conversations: {
4620
+ status: "error" | "running" | "idle" | "waiting_permission" | "unavailable";
4621
+ id: string;
4622
+ provider: "claude" | "codex" | "custom";
4623
+ cwd: string;
4624
+ createdAt: number;
4625
+ archived: boolean;
4626
+ lastActivityAt: number;
4627
+ agentSessionId?: string | undefined;
4628
+ model?: string | undefined;
4629
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
4630
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
4631
+ title?: string | undefined;
4632
+ lastMessagePreview?: string | undefined;
4633
+ }[];
4634
+ }, {
4635
+ conversations: {
4636
+ id: string;
4637
+ cwd: string;
4638
+ createdAt: number;
4639
+ lastActivityAt: number;
4640
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
4641
+ provider?: "claude" | "codex" | "custom" | undefined;
4642
+ agentSessionId?: string | undefined;
4643
+ model?: string | undefined;
4644
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
4645
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
4646
+ title?: string | undefined;
4647
+ archived?: boolean | undefined;
4648
+ lastMessagePreview?: string | undefined;
4649
+ }[];
4650
+ }>;
4651
+ readonly "agent.v2.prompt": z.ZodObject<{
4652
+ conversationId: z.ZodString;
4653
+ clientMessageId: z.ZodString;
4654
+ contentBlocks: z.ZodArray<z.ZodObject<{
4655
+ type: z.ZodEnum<["text", "image"]>;
4656
+ text: z.ZodOptional<z.ZodString>;
4657
+ data: z.ZodOptional<z.ZodString>;
4658
+ mimeType: z.ZodOptional<z.ZodString>;
4659
+ }, "strip", z.ZodTypeAny, {
4660
+ type: "text" | "image";
4661
+ data?: string | undefined;
4662
+ text?: string | undefined;
4663
+ mimeType?: string | undefined;
4664
+ }, {
4665
+ type: "text" | "image";
4666
+ data?: string | undefined;
4667
+ text?: string | undefined;
4668
+ mimeType?: string | undefined;
4669
+ }>, "many">;
4670
+ model: z.ZodOptional<z.ZodString>;
4671
+ reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
4672
+ permissionMode: z.ZodOptional<z.ZodEnum<["read_only", "workspace_write", "full_access"]>>;
4673
+ }, "strip", z.ZodTypeAny, {
4674
+ clientMessageId: string;
4675
+ contentBlocks: {
4676
+ type: "text" | "image";
4677
+ data?: string | undefined;
4678
+ text?: string | undefined;
4679
+ mimeType?: string | undefined;
4680
+ }[];
4681
+ conversationId: string;
4682
+ model?: string | undefined;
4683
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
4684
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
4685
+ }, {
4686
+ clientMessageId: string;
4687
+ contentBlocks: {
4688
+ type: "text" | "image";
4689
+ data?: string | undefined;
4690
+ text?: string | undefined;
4691
+ mimeType?: string | undefined;
4692
+ }[];
4693
+ conversationId: string;
4694
+ model?: string | undefined;
4695
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
4696
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
4697
+ }>;
4698
+ readonly "agent.v2.cancel": z.ZodObject<{
4699
+ conversationId: z.ZodString;
4700
+ }, "strip", z.ZodTypeAny, {
4701
+ conversationId: string;
4702
+ }, {
4703
+ conversationId: string;
4704
+ }>;
4705
+ readonly "agent.v2.permission.respond": z.ZodObject<{
4706
+ conversationId: z.ZodString;
4707
+ requestId: z.ZodString;
4708
+ outcome: z.ZodEnum<["allow", "deny", "cancelled"]>;
4709
+ optionId: z.ZodOptional<z.ZodString>;
4710
+ }, "strip", z.ZodTypeAny, {
4711
+ requestId: string;
4712
+ outcome: "allow" | "deny" | "cancelled";
4713
+ conversationId: string;
4714
+ optionId?: string | undefined;
4715
+ }, {
4716
+ requestId: string;
4717
+ outcome: "allow" | "deny" | "cancelled";
4718
+ conversationId: string;
4719
+ optionId?: string | undefined;
4720
+ }>;
4721
+ readonly "agent.v2.permission.request": z.ZodObject<{
4722
+ requestId: z.ZodString;
4723
+ toolName: z.ZodOptional<z.ZodString>;
4724
+ toolInput: z.ZodOptional<z.ZodString>;
4725
+ context: z.ZodOptional<z.ZodString>;
4726
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
4727
+ id: z.ZodString;
4728
+ label: z.ZodString;
4729
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
4730
+ }, "strip", z.ZodTypeAny, {
4731
+ id: string;
4732
+ kind: "allow" | "deny" | "other";
4733
+ label: string;
4734
+ }, {
4735
+ id: string;
4736
+ label: string;
4737
+ kind?: "allow" | "deny" | "other" | undefined;
4738
+ }>, "many">>;
4739
+ } & {
4740
+ conversationId: z.ZodString;
4741
+ item: z.ZodOptional<z.ZodObject<{
4742
+ id: z.ZodString;
4743
+ conversationId: z.ZodString;
4744
+ type: z.ZodEnum<["message", "tool_call", "plan", "permission", "status", "error"]>;
4745
+ role: z.ZodOptional<z.ZodEnum<["user", "assistant", "system"]>>;
4746
+ content: z.ZodOptional<z.ZodArray<z.ZodObject<{
4747
+ type: z.ZodEnum<["text", "image"]>;
4748
+ text: z.ZodOptional<z.ZodString>;
4749
+ data: z.ZodOptional<z.ZodString>;
4750
+ mimeType: z.ZodOptional<z.ZodString>;
4751
+ }, "strip", z.ZodTypeAny, {
4752
+ type: "text" | "image";
4753
+ data?: string | undefined;
4754
+ text?: string | undefined;
4755
+ mimeType?: string | undefined;
4756
+ }, {
4757
+ type: "text" | "image";
4758
+ data?: string | undefined;
4759
+ text?: string | undefined;
4760
+ mimeType?: string | undefined;
4761
+ }>, "many">>;
4762
+ text: z.ZodOptional<z.ZodString>;
4763
+ toolCall: z.ZodOptional<z.ZodObject<{
4764
+ id: z.ZodString;
4765
+ name: z.ZodString;
4766
+ input: z.ZodOptional<z.ZodString>;
4767
+ output: z.ZodOptional<z.ZodString>;
4768
+ createdAt: z.ZodOptional<z.ZodNumber>;
4769
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
4770
+ }, "strip", z.ZodTypeAny, {
4771
+ status: "running" | "pending" | "completed" | "failed";
4772
+ id: string;
4773
+ name: string;
4774
+ createdAt?: number | undefined;
4775
+ input?: string | undefined;
4776
+ output?: string | undefined;
4777
+ }, {
4778
+ id: string;
4779
+ name: string;
4780
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
4781
+ createdAt?: number | undefined;
4782
+ input?: string | undefined;
4783
+ output?: string | undefined;
4784
+ }>>;
4785
+ plan: z.ZodOptional<z.ZodArray<z.ZodObject<{
4786
+ id: z.ZodString;
4787
+ text: z.ZodString;
4788
+ status: z.ZodEnum<["pending", "in_progress", "completed"]>;
4789
+ }, "strip", z.ZodTypeAny, {
4790
+ status: "pending" | "completed" | "in_progress";
4791
+ id: string;
4792
+ text: string;
4793
+ }, {
4794
+ status: "pending" | "completed" | "in_progress";
4795
+ id: string;
4796
+ text: string;
4797
+ }>, "many">>;
4798
+ permission: z.ZodOptional<z.ZodObject<{
4799
+ requestId: z.ZodString;
4800
+ toolName: z.ZodOptional<z.ZodString>;
4801
+ toolInput: z.ZodOptional<z.ZodString>;
4802
+ context: z.ZodOptional<z.ZodString>;
4803
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
4804
+ id: z.ZodString;
4805
+ label: z.ZodString;
4806
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
4807
+ }, "strip", z.ZodTypeAny, {
4808
+ id: string;
4809
+ kind: "allow" | "deny" | "other";
4810
+ label: string;
4811
+ }, {
4812
+ id: string;
4813
+ label: string;
4814
+ kind?: "allow" | "deny" | "other" | undefined;
4815
+ }>, "many">>;
4816
+ }, "strip", z.ZodTypeAny, {
4817
+ options: {
4818
+ id: string;
4819
+ kind: "allow" | "deny" | "other";
4820
+ label: string;
4821
+ }[];
4822
+ requestId: string;
4823
+ toolName?: string | undefined;
4824
+ toolInput?: string | undefined;
4825
+ context?: string | undefined;
4826
+ }, {
4827
+ requestId: string;
4828
+ options?: {
4829
+ id: string;
4830
+ label: string;
4831
+ kind?: "allow" | "deny" | "other" | undefined;
4832
+ }[] | undefined;
4833
+ toolName?: string | undefined;
4834
+ toolInput?: string | undefined;
4835
+ context?: string | undefined;
4836
+ }>>;
4837
+ status: z.ZodOptional<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
4838
+ error: z.ZodOptional<z.ZodString>;
4839
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4840
+ createdAt: z.ZodNumber;
4841
+ updatedAt: z.ZodOptional<z.ZodNumber>;
4842
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
4843
+ }, "strip", z.ZodTypeAny, {
4844
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
4845
+ id: string;
4846
+ createdAt: number;
4847
+ conversationId: string;
4848
+ error?: string | undefined;
4849
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
4850
+ role?: "user" | "assistant" | "system" | undefined;
4851
+ text?: string | undefined;
4852
+ plan?: {
4853
+ status: "pending" | "completed" | "in_progress";
4854
+ id: string;
4855
+ text: string;
4856
+ }[] | undefined;
4857
+ content?: {
4858
+ type: "text" | "image";
4859
+ data?: string | undefined;
4860
+ text?: string | undefined;
4861
+ mimeType?: string | undefined;
4862
+ }[] | undefined;
4863
+ isStreaming?: boolean | undefined;
4864
+ toolCall?: {
4865
+ status: "running" | "pending" | "completed" | "failed";
4866
+ id: string;
4867
+ name: string;
4868
+ createdAt?: number | undefined;
4869
+ input?: string | undefined;
4870
+ output?: string | undefined;
4871
+ } | undefined;
4872
+ permission?: {
4873
+ options: {
4874
+ id: string;
4875
+ kind: "allow" | "deny" | "other";
4876
+ label: string;
4877
+ }[];
4878
+ requestId: string;
4879
+ toolName?: string | undefined;
4880
+ toolInput?: string | undefined;
4881
+ context?: string | undefined;
4882
+ } | undefined;
4883
+ metadata?: Record<string, unknown> | undefined;
4884
+ updatedAt?: number | undefined;
4885
+ }, {
4886
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
4887
+ id: string;
4888
+ createdAt: number;
4889
+ conversationId: string;
4890
+ error?: string | undefined;
4891
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
4892
+ role?: "user" | "assistant" | "system" | undefined;
4893
+ text?: string | undefined;
4894
+ plan?: {
4895
+ status: "pending" | "completed" | "in_progress";
4896
+ id: string;
4897
+ text: string;
4898
+ }[] | undefined;
4899
+ content?: {
4900
+ type: "text" | "image";
4901
+ data?: string | undefined;
4902
+ text?: string | undefined;
4903
+ mimeType?: string | undefined;
4904
+ }[] | undefined;
4905
+ isStreaming?: boolean | undefined;
4906
+ toolCall?: {
4907
+ id: string;
4908
+ name: string;
4909
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
4910
+ createdAt?: number | undefined;
4911
+ input?: string | undefined;
4912
+ output?: string | undefined;
4913
+ } | undefined;
4914
+ permission?: {
4915
+ requestId: string;
4916
+ options?: {
4917
+ id: string;
4918
+ label: string;
4919
+ kind?: "allow" | "deny" | "other" | undefined;
4920
+ }[] | undefined;
4921
+ toolName?: string | undefined;
4922
+ toolInput?: string | undefined;
4923
+ context?: string | undefined;
4924
+ } | undefined;
4925
+ metadata?: Record<string, unknown> | undefined;
4926
+ updatedAt?: number | undefined;
4927
+ }>>;
4928
+ }, "strip", z.ZodTypeAny, {
4929
+ options: {
4930
+ id: string;
4931
+ kind: "allow" | "deny" | "other";
4932
+ label: string;
4933
+ }[];
4934
+ requestId: string;
4935
+ conversationId: string;
4936
+ toolName?: string | undefined;
4937
+ toolInput?: string | undefined;
4938
+ context?: string | undefined;
4939
+ item?: {
4940
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
4941
+ id: string;
4942
+ createdAt: number;
4943
+ conversationId: string;
4944
+ error?: string | undefined;
4945
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
4946
+ role?: "user" | "assistant" | "system" | undefined;
4947
+ text?: string | undefined;
4948
+ plan?: {
4949
+ status: "pending" | "completed" | "in_progress";
4950
+ id: string;
4951
+ text: string;
4952
+ }[] | undefined;
4953
+ content?: {
4954
+ type: "text" | "image";
4955
+ data?: string | undefined;
4956
+ text?: string | undefined;
4957
+ mimeType?: string | undefined;
4958
+ }[] | undefined;
4959
+ isStreaming?: boolean | undefined;
4960
+ toolCall?: {
4961
+ status: "running" | "pending" | "completed" | "failed";
4962
+ id: string;
4963
+ name: string;
4964
+ createdAt?: number | undefined;
4965
+ input?: string | undefined;
4966
+ output?: string | undefined;
4967
+ } | undefined;
4968
+ permission?: {
4969
+ options: {
4970
+ id: string;
4971
+ kind: "allow" | "deny" | "other";
4972
+ label: string;
4973
+ }[];
4974
+ requestId: string;
4975
+ toolName?: string | undefined;
4976
+ toolInput?: string | undefined;
4977
+ context?: string | undefined;
4978
+ } | undefined;
4979
+ metadata?: Record<string, unknown> | undefined;
4980
+ updatedAt?: number | undefined;
4981
+ } | undefined;
4982
+ }, {
4983
+ requestId: string;
4984
+ conversationId: string;
4985
+ options?: {
4986
+ id: string;
4987
+ label: string;
4988
+ kind?: "allow" | "deny" | "other" | undefined;
4989
+ }[] | undefined;
4990
+ toolName?: string | undefined;
4991
+ toolInput?: string | undefined;
4992
+ context?: string | undefined;
4993
+ item?: {
4994
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
4995
+ id: string;
4996
+ createdAt: number;
4997
+ conversationId: string;
4998
+ error?: string | undefined;
4999
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
5000
+ role?: "user" | "assistant" | "system" | undefined;
5001
+ text?: string | undefined;
5002
+ plan?: {
5003
+ status: "pending" | "completed" | "in_progress";
5004
+ id: string;
5005
+ text: string;
5006
+ }[] | undefined;
5007
+ content?: {
5008
+ type: "text" | "image";
5009
+ data?: string | undefined;
5010
+ text?: string | undefined;
5011
+ mimeType?: string | undefined;
5012
+ }[] | undefined;
5013
+ isStreaming?: boolean | undefined;
5014
+ toolCall?: {
5015
+ id: string;
5016
+ name: string;
5017
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
5018
+ createdAt?: number | undefined;
5019
+ input?: string | undefined;
5020
+ output?: string | undefined;
5021
+ } | undefined;
5022
+ permission?: {
5023
+ requestId: string;
5024
+ options?: {
5025
+ id: string;
5026
+ label: string;
5027
+ kind?: "allow" | "deny" | "other" | undefined;
5028
+ }[] | undefined;
5029
+ toolName?: string | undefined;
5030
+ toolInput?: string | undefined;
5031
+ context?: string | undefined;
5032
+ } | undefined;
5033
+ metadata?: Record<string, unknown> | undefined;
5034
+ updatedAt?: number | undefined;
5035
+ } | undefined;
5036
+ }>;
5037
+ readonly "agent.v2.snapshot.request": z.ZodObject<{
5038
+ conversationId: z.ZodOptional<z.ZodString>;
5039
+ }, "strip", z.ZodTypeAny, {
5040
+ conversationId?: string | undefined;
5041
+ }, {
5042
+ conversationId?: string | undefined;
5043
+ }>;
5044
+ readonly "agent.v2.snapshot": z.ZodObject<{
5045
+ conversations: z.ZodDefault<z.ZodArray<z.ZodObject<{
5046
+ id: z.ZodString;
5047
+ agentSessionId: z.ZodOptional<z.ZodString>;
5048
+ provider: z.ZodDefault<z.ZodEnum<["codex", "claude", "custom"]>>;
5049
+ cwd: z.ZodString;
5050
+ title: z.ZodOptional<z.ZodString>;
5051
+ model: z.ZodOptional<z.ZodString>;
5052
+ reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
5053
+ permissionMode: z.ZodOptional<z.ZodEnum<["read_only", "workspace_write", "full_access"]>>;
5054
+ status: z.ZodDefault<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
5055
+ archived: z.ZodDefault<z.ZodBoolean>;
5056
+ lastMessagePreview: z.ZodOptional<z.ZodString>;
5057
+ lastActivityAt: z.ZodNumber;
5058
+ createdAt: z.ZodNumber;
5059
+ }, "strip", z.ZodTypeAny, {
5060
+ status: "error" | "running" | "idle" | "waiting_permission" | "unavailable";
5061
+ id: string;
5062
+ provider: "claude" | "codex" | "custom";
5063
+ cwd: string;
5064
+ createdAt: number;
5065
+ archived: boolean;
5066
+ lastActivityAt: number;
5067
+ agentSessionId?: string | undefined;
5068
+ model?: string | undefined;
5069
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
5070
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
5071
+ title?: string | undefined;
5072
+ lastMessagePreview?: string | undefined;
5073
+ }, {
5074
+ id: string;
5075
+ cwd: string;
5076
+ createdAt: number;
5077
+ lastActivityAt: number;
5078
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
5079
+ provider?: "claude" | "codex" | "custom" | undefined;
5080
+ agentSessionId?: string | undefined;
5081
+ model?: string | undefined;
5082
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
5083
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
5084
+ title?: string | undefined;
5085
+ archived?: boolean | undefined;
5086
+ lastMessagePreview?: string | undefined;
5087
+ }>, "many">>;
5088
+ activeConversationId: z.ZodOptional<z.ZodString>;
5089
+ items: z.ZodDefault<z.ZodArray<z.ZodObject<{
5090
+ id: z.ZodString;
5091
+ conversationId: z.ZodString;
5092
+ type: z.ZodEnum<["message", "tool_call", "plan", "permission", "status", "error"]>;
5093
+ role: z.ZodOptional<z.ZodEnum<["user", "assistant", "system"]>>;
5094
+ content: z.ZodOptional<z.ZodArray<z.ZodObject<{
5095
+ type: z.ZodEnum<["text", "image"]>;
5096
+ text: z.ZodOptional<z.ZodString>;
5097
+ data: z.ZodOptional<z.ZodString>;
5098
+ mimeType: z.ZodOptional<z.ZodString>;
5099
+ }, "strip", z.ZodTypeAny, {
5100
+ type: "text" | "image";
5101
+ data?: string | undefined;
5102
+ text?: string | undefined;
5103
+ mimeType?: string | undefined;
5104
+ }, {
5105
+ type: "text" | "image";
5106
+ data?: string | undefined;
5107
+ text?: string | undefined;
5108
+ mimeType?: string | undefined;
5109
+ }>, "many">>;
5110
+ text: z.ZodOptional<z.ZodString>;
5111
+ toolCall: z.ZodOptional<z.ZodObject<{
5112
+ id: z.ZodString;
5113
+ name: z.ZodString;
5114
+ input: z.ZodOptional<z.ZodString>;
5115
+ output: z.ZodOptional<z.ZodString>;
5116
+ createdAt: z.ZodOptional<z.ZodNumber>;
5117
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
5118
+ }, "strip", z.ZodTypeAny, {
5119
+ status: "running" | "pending" | "completed" | "failed";
5120
+ id: string;
5121
+ name: string;
5122
+ createdAt?: number | undefined;
5123
+ input?: string | undefined;
5124
+ output?: string | undefined;
5125
+ }, {
5126
+ id: string;
5127
+ name: string;
5128
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
5129
+ createdAt?: number | undefined;
5130
+ input?: string | undefined;
5131
+ output?: string | undefined;
5132
+ }>>;
5133
+ plan: z.ZodOptional<z.ZodArray<z.ZodObject<{
5134
+ id: z.ZodString;
5135
+ text: z.ZodString;
5136
+ status: z.ZodEnum<["pending", "in_progress", "completed"]>;
5137
+ }, "strip", z.ZodTypeAny, {
5138
+ status: "pending" | "completed" | "in_progress";
5139
+ id: string;
5140
+ text: string;
5141
+ }, {
5142
+ status: "pending" | "completed" | "in_progress";
5143
+ id: string;
5144
+ text: string;
5145
+ }>, "many">>;
5146
+ permission: z.ZodOptional<z.ZodObject<{
5147
+ requestId: z.ZodString;
5148
+ toolName: z.ZodOptional<z.ZodString>;
5149
+ toolInput: z.ZodOptional<z.ZodString>;
5150
+ context: z.ZodOptional<z.ZodString>;
5151
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
5152
+ id: z.ZodString;
5153
+ label: z.ZodString;
5154
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
5155
+ }, "strip", z.ZodTypeAny, {
5156
+ id: string;
5157
+ kind: "allow" | "deny" | "other";
5158
+ label: string;
5159
+ }, {
5160
+ id: string;
5161
+ label: string;
5162
+ kind?: "allow" | "deny" | "other" | undefined;
5163
+ }>, "many">>;
5164
+ }, "strip", z.ZodTypeAny, {
5165
+ options: {
5166
+ id: string;
5167
+ kind: "allow" | "deny" | "other";
5168
+ label: string;
5169
+ }[];
5170
+ requestId: string;
5171
+ toolName?: string | undefined;
5172
+ toolInput?: string | undefined;
5173
+ context?: string | undefined;
5174
+ }, {
5175
+ requestId: string;
5176
+ options?: {
5177
+ id: string;
5178
+ label: string;
5179
+ kind?: "allow" | "deny" | "other" | undefined;
5180
+ }[] | undefined;
5181
+ toolName?: string | undefined;
5182
+ toolInput?: string | undefined;
5183
+ context?: string | undefined;
5184
+ }>>;
5185
+ status: z.ZodOptional<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
5186
+ error: z.ZodOptional<z.ZodString>;
5187
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5188
+ createdAt: z.ZodNumber;
5189
+ updatedAt: z.ZodOptional<z.ZodNumber>;
5190
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
5191
+ }, "strip", z.ZodTypeAny, {
5192
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
5193
+ id: string;
5194
+ createdAt: number;
5195
+ conversationId: string;
5196
+ error?: string | undefined;
5197
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
5198
+ role?: "user" | "assistant" | "system" | undefined;
5199
+ text?: string | undefined;
5200
+ plan?: {
5201
+ status: "pending" | "completed" | "in_progress";
5202
+ id: string;
5203
+ text: string;
5204
+ }[] | undefined;
5205
+ content?: {
5206
+ type: "text" | "image";
5207
+ data?: string | undefined;
5208
+ text?: string | undefined;
5209
+ mimeType?: string | undefined;
5210
+ }[] | undefined;
5211
+ isStreaming?: boolean | undefined;
5212
+ toolCall?: {
5213
+ status: "running" | "pending" | "completed" | "failed";
5214
+ id: string;
5215
+ name: string;
5216
+ createdAt?: number | undefined;
5217
+ input?: string | undefined;
5218
+ output?: string | undefined;
5219
+ } | undefined;
5220
+ permission?: {
5221
+ options: {
5222
+ id: string;
5223
+ kind: "allow" | "deny" | "other";
5224
+ label: string;
5225
+ }[];
5226
+ requestId: string;
5227
+ toolName?: string | undefined;
5228
+ toolInput?: string | undefined;
5229
+ context?: string | undefined;
5230
+ } | undefined;
5231
+ metadata?: Record<string, unknown> | undefined;
5232
+ updatedAt?: number | undefined;
5233
+ }, {
5234
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
5235
+ id: string;
5236
+ createdAt: number;
5237
+ conversationId: string;
5238
+ error?: string | undefined;
5239
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
5240
+ role?: "user" | "assistant" | "system" | undefined;
5241
+ text?: string | undefined;
5242
+ plan?: {
5243
+ status: "pending" | "completed" | "in_progress";
5244
+ id: string;
5245
+ text: string;
5246
+ }[] | undefined;
5247
+ content?: {
5248
+ type: "text" | "image";
5249
+ data?: string | undefined;
5250
+ text?: string | undefined;
5251
+ mimeType?: string | undefined;
5252
+ }[] | undefined;
5253
+ isStreaming?: boolean | undefined;
5254
+ toolCall?: {
5255
+ id: string;
5256
+ name: string;
5257
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
5258
+ createdAt?: number | undefined;
5259
+ input?: string | undefined;
5260
+ output?: string | undefined;
5261
+ } | undefined;
5262
+ permission?: {
5263
+ requestId: string;
5264
+ options?: {
5265
+ id: string;
5266
+ label: string;
5267
+ kind?: "allow" | "deny" | "other" | undefined;
5268
+ }[] | undefined;
5269
+ toolName?: string | undefined;
5270
+ toolInput?: string | undefined;
5271
+ context?: string | undefined;
5272
+ } | undefined;
5273
+ metadata?: Record<string, unknown> | undefined;
5274
+ updatedAt?: number | undefined;
5275
+ }>, "many">>;
5276
+ }, "strip", z.ZodTypeAny, {
5277
+ conversations: {
5278
+ status: "error" | "running" | "idle" | "waiting_permission" | "unavailable";
5279
+ id: string;
5280
+ provider: "claude" | "codex" | "custom";
5281
+ cwd: string;
5282
+ createdAt: number;
5283
+ archived: boolean;
5284
+ lastActivityAt: number;
5285
+ agentSessionId?: string | undefined;
5286
+ model?: string | undefined;
5287
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
5288
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
5289
+ title?: string | undefined;
5290
+ lastMessagePreview?: string | undefined;
5291
+ }[];
5292
+ items: {
5293
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
5294
+ id: string;
5295
+ createdAt: number;
5296
+ conversationId: string;
5297
+ error?: string | undefined;
5298
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
5299
+ role?: "user" | "assistant" | "system" | undefined;
5300
+ text?: string | undefined;
5301
+ plan?: {
5302
+ status: "pending" | "completed" | "in_progress";
5303
+ id: string;
5304
+ text: string;
5305
+ }[] | undefined;
5306
+ content?: {
5307
+ type: "text" | "image";
5308
+ data?: string | undefined;
5309
+ text?: string | undefined;
5310
+ mimeType?: string | undefined;
5311
+ }[] | undefined;
5312
+ isStreaming?: boolean | undefined;
5313
+ toolCall?: {
5314
+ status: "running" | "pending" | "completed" | "failed";
5315
+ id: string;
5316
+ name: string;
5317
+ createdAt?: number | undefined;
5318
+ input?: string | undefined;
5319
+ output?: string | undefined;
5320
+ } | undefined;
5321
+ permission?: {
5322
+ options: {
5323
+ id: string;
5324
+ kind: "allow" | "deny" | "other";
5325
+ label: string;
5326
+ }[];
5327
+ requestId: string;
5328
+ toolName?: string | undefined;
5329
+ toolInput?: string | undefined;
5330
+ context?: string | undefined;
5331
+ } | undefined;
5332
+ metadata?: Record<string, unknown> | undefined;
5333
+ updatedAt?: number | undefined;
5334
+ }[];
5335
+ activeConversationId?: string | undefined;
5336
+ }, {
5337
+ conversations?: {
5338
+ id: string;
5339
+ cwd: string;
5340
+ createdAt: number;
5341
+ lastActivityAt: number;
5342
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
5343
+ provider?: "claude" | "codex" | "custom" | undefined;
5344
+ agentSessionId?: string | undefined;
5345
+ model?: string | undefined;
5346
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
5347
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
5348
+ title?: string | undefined;
5349
+ archived?: boolean | undefined;
5350
+ lastMessagePreview?: string | undefined;
5351
+ }[] | undefined;
5352
+ activeConversationId?: string | undefined;
5353
+ items?: {
5354
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
5355
+ id: string;
5356
+ createdAt: number;
5357
+ conversationId: string;
5358
+ error?: string | undefined;
5359
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
5360
+ role?: "user" | "assistant" | "system" | undefined;
5361
+ text?: string | undefined;
5362
+ plan?: {
5363
+ status: "pending" | "completed" | "in_progress";
5364
+ id: string;
5365
+ text: string;
5366
+ }[] | undefined;
5367
+ content?: {
5368
+ type: "text" | "image";
5369
+ data?: string | undefined;
5370
+ text?: string | undefined;
5371
+ mimeType?: string | undefined;
5372
+ }[] | undefined;
5373
+ isStreaming?: boolean | undefined;
5374
+ toolCall?: {
5375
+ id: string;
5376
+ name: string;
5377
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
5378
+ createdAt?: number | undefined;
5379
+ input?: string | undefined;
5380
+ output?: string | undefined;
5381
+ } | undefined;
5382
+ permission?: {
5383
+ requestId: string;
5384
+ options?: {
5385
+ id: string;
5386
+ label: string;
5387
+ kind?: "allow" | "deny" | "other" | undefined;
5388
+ }[] | undefined;
5389
+ toolName?: string | undefined;
5390
+ toolInput?: string | undefined;
5391
+ context?: string | undefined;
5392
+ } | undefined;
5393
+ metadata?: Record<string, unknown> | undefined;
5394
+ updatedAt?: number | undefined;
5395
+ }[] | undefined;
5396
+ }>;
5397
+ readonly "agent.v2.event": z.ZodObject<{
5398
+ conversationId: z.ZodString;
5399
+ conversation: z.ZodOptional<z.ZodObject<{
5400
+ id: z.ZodString;
5401
+ agentSessionId: z.ZodOptional<z.ZodString>;
5402
+ provider: z.ZodDefault<z.ZodEnum<["codex", "claude", "custom"]>>;
5403
+ cwd: z.ZodString;
5404
+ title: z.ZodOptional<z.ZodString>;
5405
+ model: z.ZodOptional<z.ZodString>;
5406
+ reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
5407
+ permissionMode: z.ZodOptional<z.ZodEnum<["read_only", "workspace_write", "full_access"]>>;
5408
+ status: z.ZodDefault<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
5409
+ archived: z.ZodDefault<z.ZodBoolean>;
5410
+ lastMessagePreview: z.ZodOptional<z.ZodString>;
5411
+ lastActivityAt: z.ZodNumber;
5412
+ createdAt: z.ZodNumber;
5413
+ }, "strip", z.ZodTypeAny, {
5414
+ status: "error" | "running" | "idle" | "waiting_permission" | "unavailable";
5415
+ id: string;
5416
+ provider: "claude" | "codex" | "custom";
5417
+ cwd: string;
5418
+ createdAt: number;
5419
+ archived: boolean;
5420
+ lastActivityAt: number;
5421
+ agentSessionId?: string | undefined;
5422
+ model?: string | undefined;
5423
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
5424
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
5425
+ title?: string | undefined;
5426
+ lastMessagePreview?: string | undefined;
5427
+ }, {
5428
+ id: string;
5429
+ cwd: string;
5430
+ createdAt: number;
5431
+ lastActivityAt: number;
5432
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
5433
+ provider?: "claude" | "codex" | "custom" | undefined;
5434
+ agentSessionId?: string | undefined;
5435
+ model?: string | undefined;
5436
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
5437
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
5438
+ title?: string | undefined;
5439
+ archived?: boolean | undefined;
5440
+ lastMessagePreview?: string | undefined;
5441
+ }>>;
5442
+ item: z.ZodOptional<z.ZodObject<{
5443
+ id: z.ZodString;
5444
+ conversationId: z.ZodString;
5445
+ type: z.ZodEnum<["message", "tool_call", "plan", "permission", "status", "error"]>;
5446
+ role: z.ZodOptional<z.ZodEnum<["user", "assistant", "system"]>>;
5447
+ content: z.ZodOptional<z.ZodArray<z.ZodObject<{
5448
+ type: z.ZodEnum<["text", "image"]>;
5449
+ text: z.ZodOptional<z.ZodString>;
5450
+ data: z.ZodOptional<z.ZodString>;
5451
+ mimeType: z.ZodOptional<z.ZodString>;
5452
+ }, "strip", z.ZodTypeAny, {
5453
+ type: "text" | "image";
5454
+ data?: string | undefined;
5455
+ text?: string | undefined;
5456
+ mimeType?: string | undefined;
5457
+ }, {
5458
+ type: "text" | "image";
5459
+ data?: string | undefined;
5460
+ text?: string | undefined;
5461
+ mimeType?: string | undefined;
5462
+ }>, "many">>;
5463
+ text: z.ZodOptional<z.ZodString>;
5464
+ toolCall: z.ZodOptional<z.ZodObject<{
5465
+ id: z.ZodString;
5466
+ name: z.ZodString;
5467
+ input: z.ZodOptional<z.ZodString>;
5468
+ output: z.ZodOptional<z.ZodString>;
5469
+ createdAt: z.ZodOptional<z.ZodNumber>;
5470
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
5471
+ }, "strip", z.ZodTypeAny, {
5472
+ status: "running" | "pending" | "completed" | "failed";
5473
+ id: string;
5474
+ name: string;
5475
+ createdAt?: number | undefined;
5476
+ input?: string | undefined;
5477
+ output?: string | undefined;
5478
+ }, {
5479
+ id: string;
5480
+ name: string;
5481
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
5482
+ createdAt?: number | undefined;
5483
+ input?: string | undefined;
5484
+ output?: string | undefined;
5485
+ }>>;
5486
+ plan: z.ZodOptional<z.ZodArray<z.ZodObject<{
5487
+ id: z.ZodString;
5488
+ text: z.ZodString;
5489
+ status: z.ZodEnum<["pending", "in_progress", "completed"]>;
5490
+ }, "strip", z.ZodTypeAny, {
5491
+ status: "pending" | "completed" | "in_progress";
5492
+ id: string;
5493
+ text: string;
5494
+ }, {
5495
+ status: "pending" | "completed" | "in_progress";
5496
+ id: string;
5497
+ text: string;
5498
+ }>, "many">>;
5499
+ permission: z.ZodOptional<z.ZodObject<{
5500
+ requestId: z.ZodString;
5501
+ toolName: z.ZodOptional<z.ZodString>;
5502
+ toolInput: z.ZodOptional<z.ZodString>;
5503
+ context: z.ZodOptional<z.ZodString>;
5504
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
5505
+ id: z.ZodString;
5506
+ label: z.ZodString;
5507
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
5508
+ }, "strip", z.ZodTypeAny, {
5509
+ id: string;
5510
+ kind: "allow" | "deny" | "other";
5511
+ label: string;
5512
+ }, {
5513
+ id: string;
5514
+ label: string;
5515
+ kind?: "allow" | "deny" | "other" | undefined;
5516
+ }>, "many">>;
5517
+ }, "strip", z.ZodTypeAny, {
5518
+ options: {
5519
+ id: string;
5520
+ kind: "allow" | "deny" | "other";
5521
+ label: string;
5522
+ }[];
5523
+ requestId: string;
5524
+ toolName?: string | undefined;
5525
+ toolInput?: string | undefined;
5526
+ context?: string | undefined;
5527
+ }, {
5528
+ requestId: string;
5529
+ options?: {
5530
+ id: string;
5531
+ label: string;
5532
+ kind?: "allow" | "deny" | "other" | undefined;
5533
+ }[] | undefined;
5534
+ toolName?: string | undefined;
5535
+ toolInput?: string | undefined;
5536
+ context?: string | undefined;
5537
+ }>>;
5538
+ status: z.ZodOptional<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
5539
+ error: z.ZodOptional<z.ZodString>;
5540
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5541
+ createdAt: z.ZodNumber;
5542
+ updatedAt: z.ZodOptional<z.ZodNumber>;
5543
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
5544
+ }, "strip", z.ZodTypeAny, {
5545
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
5546
+ id: string;
5547
+ createdAt: number;
5548
+ conversationId: string;
5549
+ error?: string | undefined;
5550
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
5551
+ role?: "user" | "assistant" | "system" | undefined;
5552
+ text?: string | undefined;
5553
+ plan?: {
5554
+ status: "pending" | "completed" | "in_progress";
5555
+ id: string;
5556
+ text: string;
5557
+ }[] | undefined;
5558
+ content?: {
5559
+ type: "text" | "image";
5560
+ data?: string | undefined;
5561
+ text?: string | undefined;
5562
+ mimeType?: string | undefined;
5563
+ }[] | undefined;
5564
+ isStreaming?: boolean | undefined;
5565
+ toolCall?: {
5566
+ status: "running" | "pending" | "completed" | "failed";
5567
+ id: string;
5568
+ name: string;
5569
+ createdAt?: number | undefined;
5570
+ input?: string | undefined;
5571
+ output?: string | undefined;
5572
+ } | undefined;
5573
+ permission?: {
5574
+ options: {
5575
+ id: string;
5576
+ kind: "allow" | "deny" | "other";
5577
+ label: string;
5578
+ }[];
5579
+ requestId: string;
5580
+ toolName?: string | undefined;
5581
+ toolInput?: string | undefined;
5582
+ context?: string | undefined;
5583
+ } | undefined;
5584
+ metadata?: Record<string, unknown> | undefined;
5585
+ updatedAt?: number | undefined;
5586
+ }, {
5587
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
5588
+ id: string;
5589
+ createdAt: number;
5590
+ conversationId: string;
5591
+ error?: string | undefined;
5592
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
5593
+ role?: "user" | "assistant" | "system" | undefined;
5594
+ text?: string | undefined;
5595
+ plan?: {
5596
+ status: "pending" | "completed" | "in_progress";
5597
+ id: string;
5598
+ text: string;
5599
+ }[] | undefined;
5600
+ content?: {
5601
+ type: "text" | "image";
5602
+ data?: string | undefined;
5603
+ text?: string | undefined;
5604
+ mimeType?: string | undefined;
5605
+ }[] | undefined;
5606
+ isStreaming?: boolean | undefined;
5607
+ toolCall?: {
5608
+ id: string;
5609
+ name: string;
5610
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
5611
+ createdAt?: number | undefined;
5612
+ input?: string | undefined;
5613
+ output?: string | undefined;
5614
+ } | undefined;
5615
+ permission?: {
5616
+ requestId: string;
5617
+ options?: {
5618
+ id: string;
5619
+ label: string;
5620
+ kind?: "allow" | "deny" | "other" | undefined;
5621
+ }[] | undefined;
5622
+ toolName?: string | undefined;
5623
+ toolInput?: string | undefined;
5624
+ context?: string | undefined;
5625
+ } | undefined;
5626
+ metadata?: Record<string, unknown> | undefined;
5627
+ updatedAt?: number | undefined;
5628
+ }>>;
5629
+ patch: z.ZodOptional<z.ZodObject<{
5630
+ itemId: z.ZodString;
5631
+ textDelta: z.ZodOptional<z.ZodString>;
5632
+ status: z.ZodOptional<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
5633
+ toolCall: z.ZodOptional<z.ZodObject<{
5634
+ id: z.ZodString;
5635
+ name: z.ZodString;
5636
+ input: z.ZodOptional<z.ZodString>;
5637
+ output: z.ZodOptional<z.ZodString>;
5638
+ createdAt: z.ZodOptional<z.ZodNumber>;
5639
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
5640
+ }, "strip", z.ZodTypeAny, {
5641
+ status: "running" | "pending" | "completed" | "failed";
5642
+ id: string;
5643
+ name: string;
5644
+ createdAt?: number | undefined;
5645
+ input?: string | undefined;
5646
+ output?: string | undefined;
5647
+ }, {
5648
+ id: string;
5649
+ name: string;
5650
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
5651
+ createdAt?: number | undefined;
5652
+ input?: string | undefined;
5653
+ output?: string | undefined;
5654
+ }>>;
5655
+ updatedAt: z.ZodOptional<z.ZodNumber>;
5656
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
5657
+ }, "strip", z.ZodTypeAny, {
5658
+ itemId: string;
5659
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
5660
+ isStreaming?: boolean | undefined;
5661
+ toolCall?: {
5662
+ status: "running" | "pending" | "completed" | "failed";
5663
+ id: string;
5664
+ name: string;
5665
+ createdAt?: number | undefined;
5666
+ input?: string | undefined;
5667
+ output?: string | undefined;
5668
+ } | undefined;
5669
+ updatedAt?: number | undefined;
5670
+ textDelta?: string | undefined;
5671
+ }, {
5672
+ itemId: string;
5673
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
5674
+ isStreaming?: boolean | undefined;
5675
+ toolCall?: {
5676
+ id: string;
5677
+ name: string;
5678
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
5679
+ createdAt?: number | undefined;
5680
+ input?: string | undefined;
5681
+ output?: string | undefined;
5682
+ } | undefined;
5683
+ updatedAt?: number | undefined;
5684
+ textDelta?: string | undefined;
5685
+ }>>;
5686
+ }, "strip", z.ZodTypeAny, {
5687
+ conversationId: string;
5688
+ conversation?: {
5689
+ status: "error" | "running" | "idle" | "waiting_permission" | "unavailable";
5690
+ id: string;
5691
+ provider: "claude" | "codex" | "custom";
5692
+ cwd: string;
5693
+ createdAt: number;
5694
+ archived: boolean;
5695
+ lastActivityAt: number;
5696
+ agentSessionId?: string | undefined;
5697
+ model?: string | undefined;
5698
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
5699
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
5700
+ title?: string | undefined;
5701
+ lastMessagePreview?: string | undefined;
5702
+ } | undefined;
5703
+ item?: {
5704
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
5705
+ id: string;
5706
+ createdAt: number;
5707
+ conversationId: string;
5708
+ error?: string | undefined;
5709
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
5710
+ role?: "user" | "assistant" | "system" | undefined;
5711
+ text?: string | undefined;
5712
+ plan?: {
5713
+ status: "pending" | "completed" | "in_progress";
5714
+ id: string;
5715
+ text: string;
5716
+ }[] | undefined;
5717
+ content?: {
5718
+ type: "text" | "image";
5719
+ data?: string | undefined;
5720
+ text?: string | undefined;
5721
+ mimeType?: string | undefined;
5722
+ }[] | undefined;
5723
+ isStreaming?: boolean | undefined;
5724
+ toolCall?: {
5725
+ status: "running" | "pending" | "completed" | "failed";
5726
+ id: string;
5727
+ name: string;
5728
+ createdAt?: number | undefined;
5729
+ input?: string | undefined;
5730
+ output?: string | undefined;
5731
+ } | undefined;
5732
+ permission?: {
5733
+ options: {
5734
+ id: string;
5735
+ kind: "allow" | "deny" | "other";
5736
+ label: string;
5737
+ }[];
5738
+ requestId: string;
5739
+ toolName?: string | undefined;
5740
+ toolInput?: string | undefined;
5741
+ context?: string | undefined;
5742
+ } | undefined;
5743
+ metadata?: Record<string, unknown> | undefined;
5744
+ updatedAt?: number | undefined;
5745
+ } | undefined;
5746
+ patch?: {
5747
+ itemId: string;
5748
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
5749
+ isStreaming?: boolean | undefined;
5750
+ toolCall?: {
5751
+ status: "running" | "pending" | "completed" | "failed";
5752
+ id: string;
5753
+ name: string;
5754
+ createdAt?: number | undefined;
5755
+ input?: string | undefined;
5756
+ output?: string | undefined;
5757
+ } | undefined;
5758
+ updatedAt?: number | undefined;
5759
+ textDelta?: string | undefined;
5760
+ } | undefined;
5761
+ }, {
5762
+ conversationId: string;
5763
+ conversation?: {
5764
+ id: string;
5765
+ cwd: string;
5766
+ createdAt: number;
5767
+ lastActivityAt: number;
5768
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
5769
+ provider?: "claude" | "codex" | "custom" | undefined;
5770
+ agentSessionId?: string | undefined;
5771
+ model?: string | undefined;
5772
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
5773
+ permissionMode?: "read_only" | "workspace_write" | "full_access" | undefined;
5774
+ title?: string | undefined;
5775
+ archived?: boolean | undefined;
5776
+ lastMessagePreview?: string | undefined;
5777
+ } | undefined;
5778
+ item?: {
5779
+ type: "error" | "message" | "status" | "tool_call" | "plan" | "permission";
5780
+ id: string;
5781
+ createdAt: number;
5782
+ conversationId: string;
5783
+ error?: string | undefined;
5784
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
5785
+ role?: "user" | "assistant" | "system" | undefined;
5786
+ text?: string | undefined;
5787
+ plan?: {
5788
+ status: "pending" | "completed" | "in_progress";
5789
+ id: string;
5790
+ text: string;
5791
+ }[] | undefined;
5792
+ content?: {
5793
+ type: "text" | "image";
5794
+ data?: string | undefined;
5795
+ text?: string | undefined;
5796
+ mimeType?: string | undefined;
5797
+ }[] | undefined;
5798
+ isStreaming?: boolean | undefined;
5799
+ toolCall?: {
5800
+ id: string;
5801
+ name: string;
5802
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
5803
+ createdAt?: number | undefined;
5804
+ input?: string | undefined;
5805
+ output?: string | undefined;
5806
+ } | undefined;
5807
+ permission?: {
5808
+ requestId: string;
5809
+ options?: {
5810
+ id: string;
5811
+ label: string;
5812
+ kind?: "allow" | "deny" | "other" | undefined;
5813
+ }[] | undefined;
5814
+ toolName?: string | undefined;
5815
+ toolInput?: string | undefined;
5816
+ context?: string | undefined;
5817
+ } | undefined;
5818
+ metadata?: Record<string, unknown> | undefined;
5819
+ updatedAt?: number | undefined;
5820
+ } | undefined;
5821
+ patch?: {
5822
+ itemId: string;
5823
+ status?: "error" | "running" | "idle" | "waiting_permission" | "unavailable" | undefined;
5824
+ isStreaming?: boolean | undefined;
5825
+ toolCall?: {
5826
+ id: string;
5827
+ name: string;
5828
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
5829
+ createdAt?: number | undefined;
5830
+ input?: string | undefined;
5831
+ output?: string | undefined;
5832
+ } | undefined;
5833
+ updatedAt?: number | undefined;
5834
+ textDelta?: string | undefined;
5835
+ } | undefined;
5836
+ }>;
1135
5837
  };
1136
5838
  export type ProtocolMessageType = keyof typeof protocolMessageSchemas;
1137
5839
  export declare function createEnvelope<T>(input: {