linkshell-cli 0.2.65 → 0.2.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +3 -0
  2. package/dist/cli/src/index.js +42 -2
  3. package/dist/cli/src/index.js.map +1 -1
  4. package/dist/cli/src/runtime/acp/acp-client.d.ts +41 -0
  5. package/dist/cli/src/runtime/acp/acp-client.js +102 -0
  6. package/dist/cli/src/runtime/acp/acp-client.js.map +1 -0
  7. package/dist/cli/src/runtime/acp/agent-session.d.ts +42 -0
  8. package/dist/cli/src/runtime/acp/agent-session.js +492 -0
  9. package/dist/cli/src/runtime/acp/agent-session.js.map +1 -0
  10. package/dist/cli/src/runtime/acp/json-rpc.d.ts +21 -0
  11. package/dist/cli/src/runtime/acp/json-rpc.js +150 -0
  12. package/dist/cli/src/runtime/acp/json-rpc.js.map +1 -0
  13. package/dist/cli/src/runtime/acp/provider-resolver.d.ts +13 -0
  14. package/dist/cli/src/runtime/acp/provider-resolver.js +22 -0
  15. package/dist/cli/src/runtime/acp/provider-resolver.js.map +1 -0
  16. package/dist/cli/src/runtime/bridge-session.d.ts +7 -0
  17. package/dist/cli/src/runtime/bridge-session.js +61 -0
  18. package/dist/cli/src/runtime/bridge-session.js.map +1 -1
  19. package/dist/cli/src/utils/daemon.d.ts +6 -0
  20. package/dist/cli/src/utils/daemon.js +22 -0
  21. package/dist/cli/src/utils/daemon.js.map +1 -1
  22. package/dist/cli/src/utils/keep-awake.d.ts +6 -0
  23. package/dist/cli/src/utils/keep-awake.js +48 -0
  24. package/dist/cli/src/utils/keep-awake.js.map +1 -0
  25. package/dist/cli/tsconfig.tsbuildinfo +1 -1
  26. package/dist/shared-protocol/src/index.d.ts +1076 -28
  27. package/dist/shared-protocol/src/index.js +108 -0
  28. package/dist/shared-protocol/src/index.js.map +1 -1
  29. package/package.json +4 -4
  30. package/src/index.ts +49 -2
  31. package/src/runtime/acp/acp-client.ts +133 -0
  32. package/src/runtime/acp/agent-session.ts +589 -0
  33. package/src/runtime/acp/json-rpc.ts +177 -0
  34. package/src/runtime/acp/provider-resolver.ts +37 -0
  35. package/src/runtime/bridge-session.ts +72 -0
  36. package/src/utils/daemon.ts +28 -0
  37. package/src/utils/keep-awake.ts +61 -0
@@ -18,9 +18,9 @@ export declare const envelopeSchema: z.ZodObject<{
18
18
  ack: z.ZodOptional<z.ZodNumber>;
19
19
  payload: z.ZodUnknown;
20
20
  }, "strip", z.ZodTypeAny, {
21
- sessionId: string;
22
21
  id: string;
23
22
  type: string;
23
+ sessionId: string;
24
24
  timestamp: string;
25
25
  terminalId?: string | undefined;
26
26
  deviceId?: string | undefined;
@@ -29,9 +29,9 @@ export declare const envelopeSchema: z.ZodObject<{
29
29
  ack?: number | undefined;
30
30
  payload?: unknown;
31
31
  }, {
32
- sessionId: string;
33
32
  id: string;
34
33
  type: string;
34
+ sessionId: string;
35
35
  timestamp: string;
36
36
  terminalId?: string | undefined;
37
37
  deviceId?: string | undefined;
@@ -389,12 +389,12 @@ export declare const terminalBrowseEntrySchema: z.ZodObject<{
389
389
  path: z.ZodString;
390
390
  isDirectory: z.ZodBoolean;
391
391
  }, "strip", z.ZodTypeAny, {
392
- path: string;
393
392
  name: string;
393
+ path: string;
394
394
  isDirectory: boolean;
395
395
  }, {
396
- path: string;
397
396
  name: string;
397
+ path: string;
398
398
  isDirectory: boolean;
399
399
  }>;
400
400
  export declare const terminalBrowseResultPayloadSchema: z.ZodObject<{
@@ -404,28 +404,28 @@ export declare const terminalBrowseResultPayloadSchema: z.ZodObject<{
404
404
  path: z.ZodString;
405
405
  isDirectory: z.ZodBoolean;
406
406
  }, "strip", z.ZodTypeAny, {
407
- path: string;
408
407
  name: string;
408
+ path: string;
409
409
  isDirectory: boolean;
410
410
  }, {
411
- path: string;
412
411
  name: string;
412
+ path: string;
413
413
  isDirectory: boolean;
414
414
  }>, "many">;
415
415
  error: z.ZodOptional<z.ZodString>;
416
416
  }, "strip", z.ZodTypeAny, {
417
417
  path: string;
418
418
  entries: {
419
- path: string;
420
419
  name: string;
420
+ path: string;
421
421
  isDirectory: boolean;
422
422
  }[];
423
423
  error?: string | undefined;
424
424
  }, {
425
425
  path: string;
426
426
  entries: {
427
- path: string;
428
427
  name: string;
428
+ path: string;
429
429
  isDirectory: boolean;
430
430
  }[];
431
431
  error?: string | undefined;
@@ -458,7 +458,7 @@ export declare const terminalStatusPayloadSchema: z.ZodObject<{
458
458
  }>>;
459
459
  pendingPermissionCount: z.ZodOptional<z.ZodNumber>;
460
460
  }, "strip", z.ZodTypeAny, {
461
- phase: "error" | "thinking" | "tool_use" | "outputting" | "waiting" | "idle";
461
+ phase: "error" | "idle" | "thinking" | "tool_use" | "outputting" | "waiting";
462
462
  seq?: number | undefined;
463
463
  toolName?: string | undefined;
464
464
  toolInput?: string | undefined;
@@ -473,7 +473,7 @@ export declare const terminalStatusPayloadSchema: z.ZodObject<{
473
473
  } | undefined;
474
474
  pendingPermissionCount?: number | undefined;
475
475
  }, {
476
- phase: "error" | "thinking" | "tool_use" | "outputting" | "waiting" | "idle";
476
+ phase: "error" | "idle" | "thinking" | "tool_use" | "outputting" | "waiting";
477
477
  seq?: number | undefined;
478
478
  toolName?: string | undefined;
479
479
  toolInput?: string | undefined;
@@ -527,17 +527,17 @@ export declare const tunnelRequestPayloadSchema: z.ZodObject<{
527
527
  port: z.ZodNumber;
528
528
  }, "strip", z.ZodTypeAny, {
529
529
  port: number;
530
- method: string;
531
- headers: Record<string, string>;
532
530
  requestId: string;
531
+ method: string;
533
532
  url: string;
533
+ headers: Record<string, string>;
534
534
  body: string | null;
535
535
  }, {
536
536
  port: number;
537
- method: string;
538
- headers: Record<string, string>;
539
537
  requestId: string;
538
+ method: string;
540
539
  url: string;
540
+ headers: Record<string, string>;
541
541
  body: string | null;
542
542
  }>;
543
543
  export declare const tunnelResponsePayloadSchema: z.ZodObject<{
@@ -547,15 +547,15 @@ export declare const tunnelResponsePayloadSchema: z.ZodObject<{
547
547
  body: z.ZodString;
548
548
  isFinal: z.ZodBoolean;
549
549
  }, "strip", z.ZodTypeAny, {
550
- headers: Record<string, string>;
551
550
  isFinal: boolean;
552
551
  requestId: string;
552
+ headers: Record<string, string>;
553
553
  body: string;
554
554
  statusCode: number;
555
555
  }, {
556
- headers: Record<string, string>;
557
556
  isFinal: boolean;
558
557
  requestId: string;
558
+ headers: Record<string, string>;
559
559
  body: string;
560
560
  statusCode: number;
561
561
  }>;
@@ -602,6 +602,577 @@ 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 agentContentBlockSchema: z.ZodObject<{
607
+ type: z.ZodEnum<["text", "image"]>;
608
+ text: z.ZodOptional<z.ZodString>;
609
+ data: z.ZodOptional<z.ZodString>;
610
+ mimeType: z.ZodOptional<z.ZodString>;
611
+ }, "strip", z.ZodTypeAny, {
612
+ type: "text" | "image";
613
+ data?: string | undefined;
614
+ text?: string | undefined;
615
+ mimeType?: string | undefined;
616
+ }, {
617
+ type: "text" | "image";
618
+ data?: string | undefined;
619
+ text?: string | undefined;
620
+ mimeType?: string | undefined;
621
+ }>;
622
+ export declare const agentMessageSchema: z.ZodObject<{
623
+ id: z.ZodString;
624
+ role: z.ZodEnum<["user", "assistant", "system"]>;
625
+ content: z.ZodString;
626
+ createdAt: z.ZodNumber;
627
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
628
+ }, "strip", z.ZodTypeAny, {
629
+ id: string;
630
+ role: "user" | "assistant" | "system";
631
+ content: string;
632
+ createdAt: number;
633
+ isStreaming?: boolean | undefined;
634
+ }, {
635
+ id: string;
636
+ role: "user" | "assistant" | "system";
637
+ content: string;
638
+ createdAt: number;
639
+ isStreaming?: boolean | undefined;
640
+ }>;
641
+ export declare const agentToolCallSchema: z.ZodObject<{
642
+ id: z.ZodString;
643
+ name: z.ZodString;
644
+ input: z.ZodOptional<z.ZodString>;
645
+ output: z.ZodOptional<z.ZodString>;
646
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
647
+ }, "strip", z.ZodTypeAny, {
648
+ status: "running" | "pending" | "completed" | "failed";
649
+ name: string;
650
+ id: string;
651
+ input?: string | undefined;
652
+ output?: string | undefined;
653
+ }, {
654
+ name: string;
655
+ id: string;
656
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
657
+ input?: string | undefined;
658
+ output?: string | undefined;
659
+ }>;
660
+ export declare const agentPermissionSchema: z.ZodObject<{
661
+ requestId: z.ZodString;
662
+ toolName: z.ZodOptional<z.ZodString>;
663
+ toolInput: z.ZodOptional<z.ZodString>;
664
+ context: z.ZodOptional<z.ZodString>;
665
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
666
+ id: z.ZodString;
667
+ label: z.ZodString;
668
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
669
+ }, "strip", z.ZodTypeAny, {
670
+ id: string;
671
+ kind: "allow" | "deny" | "other";
672
+ label: string;
673
+ }, {
674
+ id: string;
675
+ label: string;
676
+ kind?: "allow" | "deny" | "other" | undefined;
677
+ }>, "many">>;
678
+ }, "strip", z.ZodTypeAny, {
679
+ options: {
680
+ id: string;
681
+ kind: "allow" | "deny" | "other";
682
+ label: string;
683
+ }[];
684
+ requestId: string;
685
+ toolName?: string | undefined;
686
+ toolInput?: string | undefined;
687
+ context?: string | undefined;
688
+ }, {
689
+ requestId: string;
690
+ options?: {
691
+ id: string;
692
+ label: string;
693
+ kind?: "allow" | "deny" | "other" | undefined;
694
+ }[] | undefined;
695
+ toolName?: string | undefined;
696
+ toolInput?: string | undefined;
697
+ context?: string | undefined;
698
+ }>;
699
+ export declare const agentCapabilitiesPayloadSchema: z.ZodObject<{
700
+ enabled: z.ZodBoolean;
701
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
702
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
703
+ error: z.ZodOptional<z.ZodString>;
704
+ supportsSessionList: z.ZodDefault<z.ZodBoolean>;
705
+ supportsSessionLoad: z.ZodDefault<z.ZodBoolean>;
706
+ supportsImages: z.ZodDefault<z.ZodBoolean>;
707
+ supportsAudio: z.ZodDefault<z.ZodBoolean>;
708
+ supportsPermission: z.ZodDefault<z.ZodBoolean>;
709
+ supportsPlan: z.ZodDefault<z.ZodBoolean>;
710
+ supportsCancel: z.ZodDefault<z.ZodBoolean>;
711
+ }, "strip", z.ZodTypeAny, {
712
+ enabled: boolean;
713
+ supportsSessionList: boolean;
714
+ supportsSessionLoad: boolean;
715
+ supportsImages: boolean;
716
+ supportsAudio: boolean;
717
+ supportsPermission: boolean;
718
+ supportsPlan: boolean;
719
+ supportsCancel: boolean;
720
+ error?: string | undefined;
721
+ provider?: "claude" | "codex" | "custom" | undefined;
722
+ protocolVersion?: number | undefined;
723
+ }, {
724
+ enabled: boolean;
725
+ error?: string | undefined;
726
+ provider?: "claude" | "codex" | "custom" | undefined;
727
+ protocolVersion?: number | undefined;
728
+ supportsSessionList?: boolean | undefined;
729
+ supportsSessionLoad?: boolean | undefined;
730
+ supportsImages?: boolean | undefined;
731
+ supportsAudio?: boolean | undefined;
732
+ supportsPermission?: boolean | undefined;
733
+ supportsPlan?: boolean | undefined;
734
+ supportsCancel?: boolean | undefined;
735
+ }>;
736
+ export declare const agentInitializePayloadSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
737
+ export declare const agentSessionNewPayloadSchema: z.ZodObject<{
738
+ cwd: z.ZodOptional<z.ZodString>;
739
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
740
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
741
+ }, "strip", z.ZodTypeAny, {
742
+ provider?: "claude" | "codex" | "custom" | undefined;
743
+ cwd?: string | undefined;
744
+ mcpServers?: Record<string, unknown> | undefined;
745
+ }, {
746
+ provider?: "claude" | "codex" | "custom" | undefined;
747
+ cwd?: string | undefined;
748
+ mcpServers?: Record<string, unknown> | undefined;
749
+ }>;
750
+ export declare const agentSessionLoadPayloadSchema: z.ZodObject<{
751
+ agentSessionId: z.ZodString;
752
+ cwd: z.ZodOptional<z.ZodString>;
753
+ }, "strip", z.ZodTypeAny, {
754
+ agentSessionId: string;
755
+ cwd?: string | undefined;
756
+ }, {
757
+ agentSessionId: string;
758
+ cwd?: string | undefined;
759
+ }>;
760
+ export declare const agentSessionListPayloadSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
761
+ export declare const agentPromptPayloadSchema: z.ZodObject<{
762
+ agentSessionId: z.ZodOptional<z.ZodString>;
763
+ clientMessageId: z.ZodString;
764
+ contentBlocks: z.ZodArray<z.ZodObject<{
765
+ type: z.ZodEnum<["text", "image"]>;
766
+ text: z.ZodOptional<z.ZodString>;
767
+ data: z.ZodOptional<z.ZodString>;
768
+ mimeType: z.ZodOptional<z.ZodString>;
769
+ }, "strip", z.ZodTypeAny, {
770
+ type: "text" | "image";
771
+ data?: string | undefined;
772
+ text?: string | undefined;
773
+ mimeType?: string | undefined;
774
+ }, {
775
+ type: "text" | "image";
776
+ data?: string | undefined;
777
+ text?: string | undefined;
778
+ mimeType?: string | undefined;
779
+ }>, "many">;
780
+ }, "strip", z.ZodTypeAny, {
781
+ clientMessageId: string;
782
+ contentBlocks: {
783
+ type: "text" | "image";
784
+ data?: string | undefined;
785
+ text?: string | undefined;
786
+ mimeType?: string | undefined;
787
+ }[];
788
+ agentSessionId?: string | undefined;
789
+ }, {
790
+ clientMessageId: string;
791
+ contentBlocks: {
792
+ type: "text" | "image";
793
+ data?: string | undefined;
794
+ text?: string | undefined;
795
+ mimeType?: string | undefined;
796
+ }[];
797
+ agentSessionId?: string | undefined;
798
+ }>;
799
+ export declare const agentCancelPayloadSchema: z.ZodObject<{
800
+ agentSessionId: z.ZodOptional<z.ZodString>;
801
+ }, "strip", z.ZodTypeAny, {
802
+ agentSessionId?: string | undefined;
803
+ }, {
804
+ agentSessionId?: string | undefined;
805
+ }>;
806
+ export declare const agentUpdatePayloadSchema: z.ZodObject<{
807
+ agentSessionId: z.ZodOptional<z.ZodString>;
808
+ kind: z.ZodEnum<["message", "message_delta", "tool_call", "tool_result", "plan", "status", "error"]>;
809
+ message: z.ZodOptional<z.ZodObject<{
810
+ id: z.ZodString;
811
+ role: z.ZodEnum<["user", "assistant", "system"]>;
812
+ content: z.ZodString;
813
+ createdAt: z.ZodNumber;
814
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
815
+ }, "strip", z.ZodTypeAny, {
816
+ id: string;
817
+ role: "user" | "assistant" | "system";
818
+ content: string;
819
+ createdAt: number;
820
+ isStreaming?: boolean | undefined;
821
+ }, {
822
+ id: string;
823
+ role: "user" | "assistant" | "system";
824
+ content: string;
825
+ createdAt: number;
826
+ isStreaming?: boolean | undefined;
827
+ }>>;
828
+ delta: z.ZodOptional<z.ZodString>;
829
+ toolCall: z.ZodOptional<z.ZodObject<{
830
+ id: z.ZodString;
831
+ name: z.ZodString;
832
+ input: z.ZodOptional<z.ZodString>;
833
+ output: z.ZodOptional<z.ZodString>;
834
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
835
+ }, "strip", z.ZodTypeAny, {
836
+ status: "running" | "pending" | "completed" | "failed";
837
+ name: string;
838
+ id: string;
839
+ input?: string | undefined;
840
+ output?: string | undefined;
841
+ }, {
842
+ name: string;
843
+ id: string;
844
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
845
+ input?: string | undefined;
846
+ output?: string | undefined;
847
+ }>>;
848
+ plan: z.ZodOptional<z.ZodArray<z.ZodObject<{
849
+ id: z.ZodString;
850
+ text: z.ZodString;
851
+ status: z.ZodEnum<["pending", "in_progress", "completed"]>;
852
+ }, "strip", z.ZodTypeAny, {
853
+ status: "pending" | "completed" | "in_progress";
854
+ id: string;
855
+ text: string;
856
+ }, {
857
+ status: "pending" | "completed" | "in_progress";
858
+ id: string;
859
+ text: string;
860
+ }>, "many">>;
861
+ status: z.ZodOptional<z.ZodEnum<["idle", "running", "waiting_permission", "error"]>>;
862
+ error: z.ZodOptional<z.ZodString>;
863
+ }, "strip", z.ZodTypeAny, {
864
+ kind: "status" | "error" | "message" | "plan" | "message_delta" | "tool_call" | "tool_result";
865
+ status?: "error" | "idle" | "running" | "waiting_permission" | undefined;
866
+ error?: string | undefined;
867
+ message?: {
868
+ id: string;
869
+ role: "user" | "assistant" | "system";
870
+ content: string;
871
+ createdAt: number;
872
+ isStreaming?: boolean | undefined;
873
+ } | undefined;
874
+ plan?: {
875
+ status: "pending" | "completed" | "in_progress";
876
+ id: string;
877
+ text: string;
878
+ }[] | undefined;
879
+ agentSessionId?: string | undefined;
880
+ delta?: string | undefined;
881
+ toolCall?: {
882
+ status: "running" | "pending" | "completed" | "failed";
883
+ name: string;
884
+ id: string;
885
+ input?: string | undefined;
886
+ output?: string | undefined;
887
+ } | undefined;
888
+ }, {
889
+ kind: "status" | "error" | "message" | "plan" | "message_delta" | "tool_call" | "tool_result";
890
+ status?: "error" | "idle" | "running" | "waiting_permission" | undefined;
891
+ error?: string | undefined;
892
+ message?: {
893
+ id: string;
894
+ role: "user" | "assistant" | "system";
895
+ content: string;
896
+ createdAt: number;
897
+ isStreaming?: boolean | undefined;
898
+ } | undefined;
899
+ plan?: {
900
+ status: "pending" | "completed" | "in_progress";
901
+ id: string;
902
+ text: string;
903
+ }[] | undefined;
904
+ agentSessionId?: string | undefined;
905
+ delta?: string | undefined;
906
+ toolCall?: {
907
+ name: string;
908
+ id: string;
909
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
910
+ input?: string | undefined;
911
+ output?: string | undefined;
912
+ } | undefined;
913
+ }>;
914
+ export declare const agentPermissionRequestPayloadSchema: z.ZodObject<{
915
+ requestId: z.ZodString;
916
+ toolName: z.ZodOptional<z.ZodString>;
917
+ toolInput: z.ZodOptional<z.ZodString>;
918
+ context: z.ZodOptional<z.ZodString>;
919
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
920
+ id: z.ZodString;
921
+ label: z.ZodString;
922
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
923
+ }, "strip", z.ZodTypeAny, {
924
+ id: string;
925
+ kind: "allow" | "deny" | "other";
926
+ label: string;
927
+ }, {
928
+ id: string;
929
+ label: string;
930
+ kind?: "allow" | "deny" | "other" | undefined;
931
+ }>, "many">>;
932
+ } & {
933
+ agentSessionId: z.ZodOptional<z.ZodString>;
934
+ }, "strip", z.ZodTypeAny, {
935
+ options: {
936
+ id: string;
937
+ kind: "allow" | "deny" | "other";
938
+ label: string;
939
+ }[];
940
+ requestId: string;
941
+ toolName?: string | undefined;
942
+ toolInput?: string | undefined;
943
+ agentSessionId?: string | undefined;
944
+ context?: string | undefined;
945
+ }, {
946
+ requestId: string;
947
+ options?: {
948
+ id: string;
949
+ label: string;
950
+ kind?: "allow" | "deny" | "other" | undefined;
951
+ }[] | undefined;
952
+ toolName?: string | undefined;
953
+ toolInput?: string | undefined;
954
+ agentSessionId?: string | undefined;
955
+ context?: string | undefined;
956
+ }>;
957
+ export declare const agentPermissionResponsePayloadSchema: z.ZodObject<{
958
+ agentSessionId: z.ZodOptional<z.ZodString>;
959
+ requestId: z.ZodString;
960
+ outcome: z.ZodEnum<["allow", "deny", "cancelled"]>;
961
+ optionId: z.ZodOptional<z.ZodString>;
962
+ }, "strip", z.ZodTypeAny, {
963
+ requestId: string;
964
+ outcome: "allow" | "deny" | "cancelled";
965
+ agentSessionId?: string | undefined;
966
+ optionId?: string | undefined;
967
+ }, {
968
+ requestId: string;
969
+ outcome: "allow" | "deny" | "cancelled";
970
+ agentSessionId?: string | undefined;
971
+ optionId?: string | undefined;
972
+ }>;
973
+ export declare const agentSnapshotPayloadSchema: z.ZodObject<{
974
+ agentSessionId: z.ZodOptional<z.ZodString>;
975
+ capabilities: z.ZodOptional<z.ZodObject<{
976
+ enabled: z.ZodBoolean;
977
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
978
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
979
+ error: z.ZodOptional<z.ZodString>;
980
+ supportsSessionList: z.ZodDefault<z.ZodBoolean>;
981
+ supportsSessionLoad: z.ZodDefault<z.ZodBoolean>;
982
+ supportsImages: z.ZodDefault<z.ZodBoolean>;
983
+ supportsAudio: z.ZodDefault<z.ZodBoolean>;
984
+ supportsPermission: z.ZodDefault<z.ZodBoolean>;
985
+ supportsPlan: z.ZodDefault<z.ZodBoolean>;
986
+ supportsCancel: z.ZodDefault<z.ZodBoolean>;
987
+ }, "strip", z.ZodTypeAny, {
988
+ enabled: boolean;
989
+ supportsSessionList: boolean;
990
+ supportsSessionLoad: boolean;
991
+ supportsImages: boolean;
992
+ supportsAudio: boolean;
993
+ supportsPermission: boolean;
994
+ supportsPlan: boolean;
995
+ supportsCancel: boolean;
996
+ error?: string | undefined;
997
+ provider?: "claude" | "codex" | "custom" | undefined;
998
+ protocolVersion?: number | undefined;
999
+ }, {
1000
+ enabled: boolean;
1001
+ error?: string | undefined;
1002
+ provider?: "claude" | "codex" | "custom" | undefined;
1003
+ protocolVersion?: number | undefined;
1004
+ supportsSessionList?: boolean | undefined;
1005
+ supportsSessionLoad?: boolean | undefined;
1006
+ supportsImages?: boolean | undefined;
1007
+ supportsAudio?: boolean | undefined;
1008
+ supportsPermission?: boolean | undefined;
1009
+ supportsPlan?: boolean | undefined;
1010
+ supportsCancel?: boolean | undefined;
1011
+ }>>;
1012
+ messages: z.ZodDefault<z.ZodArray<z.ZodObject<{
1013
+ id: z.ZodString;
1014
+ role: z.ZodEnum<["user", "assistant", "system"]>;
1015
+ content: z.ZodString;
1016
+ createdAt: z.ZodNumber;
1017
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
1018
+ }, "strip", z.ZodTypeAny, {
1019
+ id: string;
1020
+ role: "user" | "assistant" | "system";
1021
+ content: string;
1022
+ createdAt: number;
1023
+ isStreaming?: boolean | undefined;
1024
+ }, {
1025
+ id: string;
1026
+ role: "user" | "assistant" | "system";
1027
+ content: string;
1028
+ createdAt: number;
1029
+ isStreaming?: boolean | undefined;
1030
+ }>, "many">>;
1031
+ toolCalls: z.ZodDefault<z.ZodArray<z.ZodObject<{
1032
+ id: z.ZodString;
1033
+ name: z.ZodString;
1034
+ input: z.ZodOptional<z.ZodString>;
1035
+ output: z.ZodOptional<z.ZodString>;
1036
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
1037
+ }, "strip", z.ZodTypeAny, {
1038
+ status: "running" | "pending" | "completed" | "failed";
1039
+ name: string;
1040
+ id: string;
1041
+ input?: string | undefined;
1042
+ output?: string | undefined;
1043
+ }, {
1044
+ name: string;
1045
+ id: string;
1046
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
1047
+ input?: string | undefined;
1048
+ output?: string | undefined;
1049
+ }>, "many">>;
1050
+ pendingPermissions: z.ZodDefault<z.ZodArray<z.ZodObject<{
1051
+ requestId: z.ZodString;
1052
+ toolName: z.ZodOptional<z.ZodString>;
1053
+ toolInput: z.ZodOptional<z.ZodString>;
1054
+ context: z.ZodOptional<z.ZodString>;
1055
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
1056
+ id: z.ZodString;
1057
+ label: z.ZodString;
1058
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
1059
+ }, "strip", z.ZodTypeAny, {
1060
+ id: string;
1061
+ kind: "allow" | "deny" | "other";
1062
+ label: string;
1063
+ }, {
1064
+ id: string;
1065
+ label: string;
1066
+ kind?: "allow" | "deny" | "other" | undefined;
1067
+ }>, "many">>;
1068
+ }, "strip", z.ZodTypeAny, {
1069
+ options: {
1070
+ id: string;
1071
+ kind: "allow" | "deny" | "other";
1072
+ label: string;
1073
+ }[];
1074
+ requestId: string;
1075
+ toolName?: string | undefined;
1076
+ toolInput?: string | undefined;
1077
+ context?: string | undefined;
1078
+ }, {
1079
+ requestId: string;
1080
+ options?: {
1081
+ id: string;
1082
+ label: string;
1083
+ kind?: "allow" | "deny" | "other" | undefined;
1084
+ }[] | undefined;
1085
+ toolName?: string | undefined;
1086
+ toolInput?: string | undefined;
1087
+ context?: string | undefined;
1088
+ }>, "many">>;
1089
+ status: z.ZodDefault<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
1090
+ error: z.ZodOptional<z.ZodString>;
1091
+ }, "strip", z.ZodTypeAny, {
1092
+ status: "error" | "unavailable" | "idle" | "running" | "waiting_permission";
1093
+ messages: {
1094
+ id: string;
1095
+ role: "user" | "assistant" | "system";
1096
+ content: string;
1097
+ createdAt: number;
1098
+ isStreaming?: boolean | undefined;
1099
+ }[];
1100
+ toolCalls: {
1101
+ status: "running" | "pending" | "completed" | "failed";
1102
+ name: string;
1103
+ id: string;
1104
+ input?: string | undefined;
1105
+ output?: string | undefined;
1106
+ }[];
1107
+ pendingPermissions: {
1108
+ options: {
1109
+ id: string;
1110
+ kind: "allow" | "deny" | "other";
1111
+ label: string;
1112
+ }[];
1113
+ requestId: string;
1114
+ toolName?: string | undefined;
1115
+ toolInput?: string | undefined;
1116
+ context?: string | undefined;
1117
+ }[];
1118
+ error?: string | undefined;
1119
+ agentSessionId?: string | undefined;
1120
+ capabilities?: {
1121
+ enabled: boolean;
1122
+ supportsSessionList: boolean;
1123
+ supportsSessionLoad: boolean;
1124
+ supportsImages: boolean;
1125
+ supportsAudio: boolean;
1126
+ supportsPermission: boolean;
1127
+ supportsPlan: boolean;
1128
+ supportsCancel: boolean;
1129
+ error?: string | undefined;
1130
+ provider?: "claude" | "codex" | "custom" | undefined;
1131
+ protocolVersion?: number | undefined;
1132
+ } | undefined;
1133
+ }, {
1134
+ status?: "error" | "unavailable" | "idle" | "running" | "waiting_permission" | undefined;
1135
+ error?: string | undefined;
1136
+ agentSessionId?: string | undefined;
1137
+ capabilities?: {
1138
+ enabled: boolean;
1139
+ error?: string | undefined;
1140
+ provider?: "claude" | "codex" | "custom" | undefined;
1141
+ protocolVersion?: number | undefined;
1142
+ supportsSessionList?: boolean | undefined;
1143
+ supportsSessionLoad?: boolean | undefined;
1144
+ supportsImages?: boolean | undefined;
1145
+ supportsAudio?: boolean | undefined;
1146
+ supportsPermission?: boolean | undefined;
1147
+ supportsPlan?: boolean | undefined;
1148
+ supportsCancel?: boolean | undefined;
1149
+ } | undefined;
1150
+ messages?: {
1151
+ id: string;
1152
+ role: "user" | "assistant" | "system";
1153
+ content: string;
1154
+ createdAt: number;
1155
+ isStreaming?: boolean | undefined;
1156
+ }[] | undefined;
1157
+ toolCalls?: {
1158
+ name: string;
1159
+ id: string;
1160
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
1161
+ input?: string | undefined;
1162
+ output?: string | undefined;
1163
+ }[] | undefined;
1164
+ pendingPermissions?: {
1165
+ requestId: string;
1166
+ options?: {
1167
+ id: string;
1168
+ label: string;
1169
+ kind?: "allow" | "deny" | "other" | undefined;
1170
+ }[] | undefined;
1171
+ toolName?: string | undefined;
1172
+ toolInput?: string | undefined;
1173
+ context?: string | undefined;
1174
+ }[] | undefined;
1175
+ }>;
605
1176
  export declare const protocolMessageSchemas: {
606
1177
  readonly "session.connect": z.ZodObject<{
607
1178
  role: z.ZodEnum<["host", "client"]>;
@@ -940,28 +1511,28 @@ export declare const protocolMessageSchemas: {
940
1511
  path: z.ZodString;
941
1512
  isDirectory: z.ZodBoolean;
942
1513
  }, "strip", z.ZodTypeAny, {
943
- path: string;
944
1514
  name: string;
1515
+ path: string;
945
1516
  isDirectory: boolean;
946
1517
  }, {
947
- path: string;
948
1518
  name: string;
1519
+ path: string;
949
1520
  isDirectory: boolean;
950
1521
  }>, "many">;
951
1522
  error: z.ZodOptional<z.ZodString>;
952
1523
  }, "strip", z.ZodTypeAny, {
953
1524
  path: string;
954
1525
  entries: {
955
- path: string;
956
1526
  name: string;
1527
+ path: string;
957
1528
  isDirectory: boolean;
958
1529
  }[];
959
1530
  error?: string | undefined;
960
1531
  }, {
961
1532
  path: string;
962
1533
  entries: {
963
- path: string;
964
1534
  name: string;
1535
+ path: string;
965
1536
  isDirectory: boolean;
966
1537
  }[];
967
1538
  error?: string | undefined;
@@ -1008,7 +1579,7 @@ export declare const protocolMessageSchemas: {
1008
1579
  }>>;
1009
1580
  pendingPermissionCount: z.ZodOptional<z.ZodNumber>;
1010
1581
  }, "strip", z.ZodTypeAny, {
1011
- phase: "error" | "thinking" | "tool_use" | "outputting" | "waiting" | "idle";
1582
+ phase: "error" | "idle" | "thinking" | "tool_use" | "outputting" | "waiting";
1012
1583
  seq?: number | undefined;
1013
1584
  toolName?: string | undefined;
1014
1585
  toolInput?: string | undefined;
@@ -1023,7 +1594,7 @@ export declare const protocolMessageSchemas: {
1023
1594
  } | undefined;
1024
1595
  pendingPermissionCount?: number | undefined;
1025
1596
  }, {
1026
- phase: "error" | "thinking" | "tool_use" | "outputting" | "waiting" | "idle";
1597
+ phase: "error" | "idle" | "thinking" | "tool_use" | "outputting" | "waiting";
1027
1598
  seq?: number | undefined;
1028
1599
  toolName?: string | undefined;
1029
1600
  toolInput?: string | undefined;
@@ -1057,17 +1628,17 @@ export declare const protocolMessageSchemas: {
1057
1628
  port: z.ZodNumber;
1058
1629
  }, "strip", z.ZodTypeAny, {
1059
1630
  port: number;
1060
- method: string;
1061
- headers: Record<string, string>;
1062
1631
  requestId: string;
1632
+ method: string;
1063
1633
  url: string;
1634
+ headers: Record<string, string>;
1064
1635
  body: string | null;
1065
1636
  }, {
1066
1637
  port: number;
1067
- method: string;
1068
- headers: Record<string, string>;
1069
1638
  requestId: string;
1639
+ method: string;
1070
1640
  url: string;
1641
+ headers: Record<string, string>;
1071
1642
  body: string | null;
1072
1643
  }>;
1073
1644
  readonly "tunnel.response": z.ZodObject<{
@@ -1077,15 +1648,15 @@ export declare const protocolMessageSchemas: {
1077
1648
  body: z.ZodString;
1078
1649
  isFinal: z.ZodBoolean;
1079
1650
  }, "strip", z.ZodTypeAny, {
1080
- headers: Record<string, string>;
1081
1651
  isFinal: boolean;
1082
1652
  requestId: string;
1653
+ headers: Record<string, string>;
1083
1654
  body: string;
1084
1655
  statusCode: number;
1085
1656
  }, {
1086
- headers: Record<string, string>;
1087
1657
  isFinal: boolean;
1088
1658
  requestId: string;
1659
+ headers: Record<string, string>;
1089
1660
  body: string;
1090
1661
  statusCode: number;
1091
1662
  }>;
@@ -1132,6 +1703,483 @@ export declare const protocolMessageSchemas: {
1132
1703
  entries: string[];
1133
1704
  shell?: string | undefined;
1134
1705
  }>;
1706
+ readonly "agent.initialize": z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
1707
+ readonly "agent.capabilities": z.ZodObject<{
1708
+ enabled: z.ZodBoolean;
1709
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
1710
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
1711
+ error: z.ZodOptional<z.ZodString>;
1712
+ supportsSessionList: z.ZodDefault<z.ZodBoolean>;
1713
+ supportsSessionLoad: z.ZodDefault<z.ZodBoolean>;
1714
+ supportsImages: z.ZodDefault<z.ZodBoolean>;
1715
+ supportsAudio: z.ZodDefault<z.ZodBoolean>;
1716
+ supportsPermission: z.ZodDefault<z.ZodBoolean>;
1717
+ supportsPlan: z.ZodDefault<z.ZodBoolean>;
1718
+ supportsCancel: z.ZodDefault<z.ZodBoolean>;
1719
+ }, "strip", z.ZodTypeAny, {
1720
+ enabled: boolean;
1721
+ supportsSessionList: boolean;
1722
+ supportsSessionLoad: boolean;
1723
+ supportsImages: boolean;
1724
+ supportsAudio: boolean;
1725
+ supportsPermission: boolean;
1726
+ supportsPlan: boolean;
1727
+ supportsCancel: boolean;
1728
+ error?: string | undefined;
1729
+ provider?: "claude" | "codex" | "custom" | undefined;
1730
+ protocolVersion?: number | undefined;
1731
+ }, {
1732
+ enabled: boolean;
1733
+ error?: string | undefined;
1734
+ provider?: "claude" | "codex" | "custom" | undefined;
1735
+ protocolVersion?: number | undefined;
1736
+ supportsSessionList?: boolean | undefined;
1737
+ supportsSessionLoad?: boolean | undefined;
1738
+ supportsImages?: boolean | undefined;
1739
+ supportsAudio?: boolean | undefined;
1740
+ supportsPermission?: boolean | undefined;
1741
+ supportsPlan?: boolean | undefined;
1742
+ supportsCancel?: boolean | undefined;
1743
+ }>;
1744
+ readonly "agent.session.new": z.ZodObject<{
1745
+ cwd: z.ZodOptional<z.ZodString>;
1746
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
1747
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1748
+ }, "strip", z.ZodTypeAny, {
1749
+ provider?: "claude" | "codex" | "custom" | undefined;
1750
+ cwd?: string | undefined;
1751
+ mcpServers?: Record<string, unknown> | undefined;
1752
+ }, {
1753
+ provider?: "claude" | "codex" | "custom" | undefined;
1754
+ cwd?: string | undefined;
1755
+ mcpServers?: Record<string, unknown> | undefined;
1756
+ }>;
1757
+ readonly "agent.session.load": z.ZodObject<{
1758
+ agentSessionId: z.ZodString;
1759
+ cwd: z.ZodOptional<z.ZodString>;
1760
+ }, "strip", z.ZodTypeAny, {
1761
+ agentSessionId: string;
1762
+ cwd?: string | undefined;
1763
+ }, {
1764
+ agentSessionId: string;
1765
+ cwd?: string | undefined;
1766
+ }>;
1767
+ readonly "agent.session.list": z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
1768
+ readonly "agent.prompt": z.ZodObject<{
1769
+ agentSessionId: z.ZodOptional<z.ZodString>;
1770
+ clientMessageId: z.ZodString;
1771
+ contentBlocks: z.ZodArray<z.ZodObject<{
1772
+ type: z.ZodEnum<["text", "image"]>;
1773
+ text: z.ZodOptional<z.ZodString>;
1774
+ data: z.ZodOptional<z.ZodString>;
1775
+ mimeType: z.ZodOptional<z.ZodString>;
1776
+ }, "strip", z.ZodTypeAny, {
1777
+ type: "text" | "image";
1778
+ data?: string | undefined;
1779
+ text?: string | undefined;
1780
+ mimeType?: string | undefined;
1781
+ }, {
1782
+ type: "text" | "image";
1783
+ data?: string | undefined;
1784
+ text?: string | undefined;
1785
+ mimeType?: string | undefined;
1786
+ }>, "many">;
1787
+ }, "strip", z.ZodTypeAny, {
1788
+ clientMessageId: string;
1789
+ contentBlocks: {
1790
+ type: "text" | "image";
1791
+ data?: string | undefined;
1792
+ text?: string | undefined;
1793
+ mimeType?: string | undefined;
1794
+ }[];
1795
+ agentSessionId?: string | undefined;
1796
+ }, {
1797
+ clientMessageId: string;
1798
+ contentBlocks: {
1799
+ type: "text" | "image";
1800
+ data?: string | undefined;
1801
+ text?: string | undefined;
1802
+ mimeType?: string | undefined;
1803
+ }[];
1804
+ agentSessionId?: string | undefined;
1805
+ }>;
1806
+ readonly "agent.cancel": z.ZodObject<{
1807
+ agentSessionId: z.ZodOptional<z.ZodString>;
1808
+ }, "strip", z.ZodTypeAny, {
1809
+ agentSessionId?: string | undefined;
1810
+ }, {
1811
+ agentSessionId?: string | undefined;
1812
+ }>;
1813
+ readonly "agent.update": z.ZodObject<{
1814
+ agentSessionId: z.ZodOptional<z.ZodString>;
1815
+ kind: z.ZodEnum<["message", "message_delta", "tool_call", "tool_result", "plan", "status", "error"]>;
1816
+ message: z.ZodOptional<z.ZodObject<{
1817
+ id: z.ZodString;
1818
+ role: z.ZodEnum<["user", "assistant", "system"]>;
1819
+ content: z.ZodString;
1820
+ createdAt: z.ZodNumber;
1821
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
1822
+ }, "strip", z.ZodTypeAny, {
1823
+ id: string;
1824
+ role: "user" | "assistant" | "system";
1825
+ content: string;
1826
+ createdAt: number;
1827
+ isStreaming?: boolean | undefined;
1828
+ }, {
1829
+ id: string;
1830
+ role: "user" | "assistant" | "system";
1831
+ content: string;
1832
+ createdAt: number;
1833
+ isStreaming?: boolean | undefined;
1834
+ }>>;
1835
+ delta: z.ZodOptional<z.ZodString>;
1836
+ toolCall: z.ZodOptional<z.ZodObject<{
1837
+ id: z.ZodString;
1838
+ name: z.ZodString;
1839
+ input: z.ZodOptional<z.ZodString>;
1840
+ output: z.ZodOptional<z.ZodString>;
1841
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
1842
+ }, "strip", z.ZodTypeAny, {
1843
+ status: "running" | "pending" | "completed" | "failed";
1844
+ name: string;
1845
+ id: string;
1846
+ input?: string | undefined;
1847
+ output?: string | undefined;
1848
+ }, {
1849
+ name: string;
1850
+ id: string;
1851
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
1852
+ input?: string | undefined;
1853
+ output?: string | undefined;
1854
+ }>>;
1855
+ plan: z.ZodOptional<z.ZodArray<z.ZodObject<{
1856
+ id: z.ZodString;
1857
+ text: z.ZodString;
1858
+ status: z.ZodEnum<["pending", "in_progress", "completed"]>;
1859
+ }, "strip", z.ZodTypeAny, {
1860
+ status: "pending" | "completed" | "in_progress";
1861
+ id: string;
1862
+ text: string;
1863
+ }, {
1864
+ status: "pending" | "completed" | "in_progress";
1865
+ id: string;
1866
+ text: string;
1867
+ }>, "many">>;
1868
+ status: z.ZodOptional<z.ZodEnum<["idle", "running", "waiting_permission", "error"]>>;
1869
+ error: z.ZodOptional<z.ZodString>;
1870
+ }, "strip", z.ZodTypeAny, {
1871
+ kind: "status" | "error" | "message" | "plan" | "message_delta" | "tool_call" | "tool_result";
1872
+ status?: "error" | "idle" | "running" | "waiting_permission" | undefined;
1873
+ error?: string | undefined;
1874
+ message?: {
1875
+ id: string;
1876
+ role: "user" | "assistant" | "system";
1877
+ content: string;
1878
+ createdAt: number;
1879
+ isStreaming?: boolean | undefined;
1880
+ } | undefined;
1881
+ plan?: {
1882
+ status: "pending" | "completed" | "in_progress";
1883
+ id: string;
1884
+ text: string;
1885
+ }[] | undefined;
1886
+ agentSessionId?: string | undefined;
1887
+ delta?: string | undefined;
1888
+ toolCall?: {
1889
+ status: "running" | "pending" | "completed" | "failed";
1890
+ name: string;
1891
+ id: string;
1892
+ input?: string | undefined;
1893
+ output?: string | undefined;
1894
+ } | undefined;
1895
+ }, {
1896
+ kind: "status" | "error" | "message" | "plan" | "message_delta" | "tool_call" | "tool_result";
1897
+ status?: "error" | "idle" | "running" | "waiting_permission" | undefined;
1898
+ error?: string | undefined;
1899
+ message?: {
1900
+ id: string;
1901
+ role: "user" | "assistant" | "system";
1902
+ content: string;
1903
+ createdAt: number;
1904
+ isStreaming?: boolean | undefined;
1905
+ } | undefined;
1906
+ plan?: {
1907
+ status: "pending" | "completed" | "in_progress";
1908
+ id: string;
1909
+ text: string;
1910
+ }[] | undefined;
1911
+ agentSessionId?: string | undefined;
1912
+ delta?: string | undefined;
1913
+ toolCall?: {
1914
+ name: string;
1915
+ id: string;
1916
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
1917
+ input?: string | undefined;
1918
+ output?: string | undefined;
1919
+ } | undefined;
1920
+ }>;
1921
+ readonly "agent.permission.request": z.ZodObject<{
1922
+ requestId: z.ZodString;
1923
+ toolName: z.ZodOptional<z.ZodString>;
1924
+ toolInput: z.ZodOptional<z.ZodString>;
1925
+ context: z.ZodOptional<z.ZodString>;
1926
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
1927
+ id: z.ZodString;
1928
+ label: z.ZodString;
1929
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
1930
+ }, "strip", z.ZodTypeAny, {
1931
+ id: string;
1932
+ kind: "allow" | "deny" | "other";
1933
+ label: string;
1934
+ }, {
1935
+ id: string;
1936
+ label: string;
1937
+ kind?: "allow" | "deny" | "other" | undefined;
1938
+ }>, "many">>;
1939
+ } & {
1940
+ agentSessionId: z.ZodOptional<z.ZodString>;
1941
+ }, "strip", z.ZodTypeAny, {
1942
+ options: {
1943
+ id: string;
1944
+ kind: "allow" | "deny" | "other";
1945
+ label: string;
1946
+ }[];
1947
+ requestId: string;
1948
+ toolName?: string | undefined;
1949
+ toolInput?: string | undefined;
1950
+ agentSessionId?: string | undefined;
1951
+ context?: string | undefined;
1952
+ }, {
1953
+ requestId: string;
1954
+ options?: {
1955
+ id: string;
1956
+ label: string;
1957
+ kind?: "allow" | "deny" | "other" | undefined;
1958
+ }[] | undefined;
1959
+ toolName?: string | undefined;
1960
+ toolInput?: string | undefined;
1961
+ agentSessionId?: string | undefined;
1962
+ context?: string | undefined;
1963
+ }>;
1964
+ readonly "agent.permission.response": z.ZodObject<{
1965
+ agentSessionId: z.ZodOptional<z.ZodString>;
1966
+ requestId: z.ZodString;
1967
+ outcome: z.ZodEnum<["allow", "deny", "cancelled"]>;
1968
+ optionId: z.ZodOptional<z.ZodString>;
1969
+ }, "strip", z.ZodTypeAny, {
1970
+ requestId: string;
1971
+ outcome: "allow" | "deny" | "cancelled";
1972
+ agentSessionId?: string | undefined;
1973
+ optionId?: string | undefined;
1974
+ }, {
1975
+ requestId: string;
1976
+ outcome: "allow" | "deny" | "cancelled";
1977
+ agentSessionId?: string | undefined;
1978
+ optionId?: string | undefined;
1979
+ }>;
1980
+ readonly "agent.snapshot": z.ZodObject<{
1981
+ agentSessionId: z.ZodOptional<z.ZodString>;
1982
+ capabilities: z.ZodOptional<z.ZodObject<{
1983
+ enabled: z.ZodBoolean;
1984
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
1985
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
1986
+ error: z.ZodOptional<z.ZodString>;
1987
+ supportsSessionList: z.ZodDefault<z.ZodBoolean>;
1988
+ supportsSessionLoad: z.ZodDefault<z.ZodBoolean>;
1989
+ supportsImages: z.ZodDefault<z.ZodBoolean>;
1990
+ supportsAudio: z.ZodDefault<z.ZodBoolean>;
1991
+ supportsPermission: z.ZodDefault<z.ZodBoolean>;
1992
+ supportsPlan: z.ZodDefault<z.ZodBoolean>;
1993
+ supportsCancel: z.ZodDefault<z.ZodBoolean>;
1994
+ }, "strip", z.ZodTypeAny, {
1995
+ enabled: boolean;
1996
+ supportsSessionList: boolean;
1997
+ supportsSessionLoad: boolean;
1998
+ supportsImages: boolean;
1999
+ supportsAudio: boolean;
2000
+ supportsPermission: boolean;
2001
+ supportsPlan: boolean;
2002
+ supportsCancel: boolean;
2003
+ error?: string | undefined;
2004
+ provider?: "claude" | "codex" | "custom" | undefined;
2005
+ protocolVersion?: number | undefined;
2006
+ }, {
2007
+ enabled: boolean;
2008
+ error?: string | undefined;
2009
+ provider?: "claude" | "codex" | "custom" | undefined;
2010
+ protocolVersion?: number | undefined;
2011
+ supportsSessionList?: boolean | undefined;
2012
+ supportsSessionLoad?: boolean | undefined;
2013
+ supportsImages?: boolean | undefined;
2014
+ supportsAudio?: boolean | undefined;
2015
+ supportsPermission?: boolean | undefined;
2016
+ supportsPlan?: boolean | undefined;
2017
+ supportsCancel?: boolean | undefined;
2018
+ }>>;
2019
+ messages: z.ZodDefault<z.ZodArray<z.ZodObject<{
2020
+ id: z.ZodString;
2021
+ role: z.ZodEnum<["user", "assistant", "system"]>;
2022
+ content: z.ZodString;
2023
+ createdAt: z.ZodNumber;
2024
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
2025
+ }, "strip", z.ZodTypeAny, {
2026
+ id: string;
2027
+ role: "user" | "assistant" | "system";
2028
+ content: string;
2029
+ createdAt: number;
2030
+ isStreaming?: boolean | undefined;
2031
+ }, {
2032
+ id: string;
2033
+ role: "user" | "assistant" | "system";
2034
+ content: string;
2035
+ createdAt: number;
2036
+ isStreaming?: boolean | undefined;
2037
+ }>, "many">>;
2038
+ toolCalls: z.ZodDefault<z.ZodArray<z.ZodObject<{
2039
+ id: z.ZodString;
2040
+ name: z.ZodString;
2041
+ input: z.ZodOptional<z.ZodString>;
2042
+ output: z.ZodOptional<z.ZodString>;
2043
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
2044
+ }, "strip", z.ZodTypeAny, {
2045
+ status: "running" | "pending" | "completed" | "failed";
2046
+ name: string;
2047
+ id: string;
2048
+ input?: string | undefined;
2049
+ output?: string | undefined;
2050
+ }, {
2051
+ name: string;
2052
+ id: string;
2053
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
2054
+ input?: string | undefined;
2055
+ output?: string | undefined;
2056
+ }>, "many">>;
2057
+ pendingPermissions: z.ZodDefault<z.ZodArray<z.ZodObject<{
2058
+ requestId: z.ZodString;
2059
+ toolName: z.ZodOptional<z.ZodString>;
2060
+ toolInput: z.ZodOptional<z.ZodString>;
2061
+ context: z.ZodOptional<z.ZodString>;
2062
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
2063
+ id: z.ZodString;
2064
+ label: z.ZodString;
2065
+ kind: z.ZodDefault<z.ZodEnum<["allow", "deny", "other"]>>;
2066
+ }, "strip", z.ZodTypeAny, {
2067
+ id: string;
2068
+ kind: "allow" | "deny" | "other";
2069
+ label: string;
2070
+ }, {
2071
+ id: string;
2072
+ label: string;
2073
+ kind?: "allow" | "deny" | "other" | undefined;
2074
+ }>, "many">>;
2075
+ }, "strip", z.ZodTypeAny, {
2076
+ options: {
2077
+ id: string;
2078
+ kind: "allow" | "deny" | "other";
2079
+ label: string;
2080
+ }[];
2081
+ requestId: string;
2082
+ toolName?: string | undefined;
2083
+ toolInput?: string | undefined;
2084
+ context?: string | undefined;
2085
+ }, {
2086
+ requestId: string;
2087
+ options?: {
2088
+ id: string;
2089
+ label: string;
2090
+ kind?: "allow" | "deny" | "other" | undefined;
2091
+ }[] | undefined;
2092
+ toolName?: string | undefined;
2093
+ toolInput?: string | undefined;
2094
+ context?: string | undefined;
2095
+ }>, "many">>;
2096
+ status: z.ZodDefault<z.ZodEnum<["unavailable", "idle", "running", "waiting_permission", "error"]>>;
2097
+ error: z.ZodOptional<z.ZodString>;
2098
+ }, "strip", z.ZodTypeAny, {
2099
+ status: "error" | "unavailable" | "idle" | "running" | "waiting_permission";
2100
+ messages: {
2101
+ id: string;
2102
+ role: "user" | "assistant" | "system";
2103
+ content: string;
2104
+ createdAt: number;
2105
+ isStreaming?: boolean | undefined;
2106
+ }[];
2107
+ toolCalls: {
2108
+ status: "running" | "pending" | "completed" | "failed";
2109
+ name: string;
2110
+ id: string;
2111
+ input?: string | undefined;
2112
+ output?: string | undefined;
2113
+ }[];
2114
+ pendingPermissions: {
2115
+ options: {
2116
+ id: string;
2117
+ kind: "allow" | "deny" | "other";
2118
+ label: string;
2119
+ }[];
2120
+ requestId: string;
2121
+ toolName?: string | undefined;
2122
+ toolInput?: string | undefined;
2123
+ context?: string | undefined;
2124
+ }[];
2125
+ error?: string | undefined;
2126
+ agentSessionId?: string | undefined;
2127
+ capabilities?: {
2128
+ enabled: boolean;
2129
+ supportsSessionList: boolean;
2130
+ supportsSessionLoad: boolean;
2131
+ supportsImages: boolean;
2132
+ supportsAudio: boolean;
2133
+ supportsPermission: boolean;
2134
+ supportsPlan: boolean;
2135
+ supportsCancel: boolean;
2136
+ error?: string | undefined;
2137
+ provider?: "claude" | "codex" | "custom" | undefined;
2138
+ protocolVersion?: number | undefined;
2139
+ } | undefined;
2140
+ }, {
2141
+ status?: "error" | "unavailable" | "idle" | "running" | "waiting_permission" | undefined;
2142
+ error?: string | undefined;
2143
+ agentSessionId?: string | undefined;
2144
+ capabilities?: {
2145
+ enabled: boolean;
2146
+ error?: string | undefined;
2147
+ provider?: "claude" | "codex" | "custom" | undefined;
2148
+ protocolVersion?: number | undefined;
2149
+ supportsSessionList?: boolean | undefined;
2150
+ supportsSessionLoad?: boolean | undefined;
2151
+ supportsImages?: boolean | undefined;
2152
+ supportsAudio?: boolean | undefined;
2153
+ supportsPermission?: boolean | undefined;
2154
+ supportsPlan?: boolean | undefined;
2155
+ supportsCancel?: boolean | undefined;
2156
+ } | undefined;
2157
+ messages?: {
2158
+ id: string;
2159
+ role: "user" | "assistant" | "system";
2160
+ content: string;
2161
+ createdAt: number;
2162
+ isStreaming?: boolean | undefined;
2163
+ }[] | undefined;
2164
+ toolCalls?: {
2165
+ name: string;
2166
+ id: string;
2167
+ status?: "running" | "pending" | "completed" | "failed" | undefined;
2168
+ input?: string | undefined;
2169
+ output?: string | undefined;
2170
+ }[] | undefined;
2171
+ pendingPermissions?: {
2172
+ requestId: string;
2173
+ options?: {
2174
+ id: string;
2175
+ label: string;
2176
+ kind?: "allow" | "deny" | "other" | undefined;
2177
+ }[] | undefined;
2178
+ toolName?: string | undefined;
2179
+ toolInput?: string | undefined;
2180
+ context?: string | undefined;
2181
+ }[] | undefined;
2182
+ }>;
1135
2183
  };
1136
2184
  export type ProtocolMessageType = keyof typeof protocolMessageSchemas;
1137
2185
  export declare function createEnvelope<T>(input: {