linkshell-cli 0.2.64 → 0.2.66

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 +28 -1
  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 +9 -0
  17. package/dist/cli/src/runtime/bridge-session.js +163 -41
  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 +1108 -54
  27. package/dist/shared-protocol/src/index.js +112 -1
  28. package/dist/shared-protocol/src/index.js.map +1 -1
  29. package/package.json +4 -4
  30. package/src/index.ts +38 -1
  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 +189 -41
  36. package/src/utils/daemon.ts +28 -0
  37. package/src/utils/keep-awake.ts +61 -0
@@ -48,9 +48,9 @@ export declare const terminalOutputPayloadSchema: z.ZodObject<{
48
48
  isReplay: z.ZodDefault<z.ZodBoolean>;
49
49
  isFinal: z.ZodDefault<z.ZodBoolean>;
50
50
  }, "strip", z.ZodTypeAny, {
51
- encoding: "utf8";
52
51
  stream: "stdout" | "stderr";
53
52
  data: string;
53
+ encoding: "utf8";
54
54
  isReplay: boolean;
55
55
  isFinal: boolean;
56
56
  }, {
@@ -89,7 +89,7 @@ export declare const sessionConnectPayloadSchema: z.ZodObject<{
89
89
  }, "strip", z.ZodTypeAny, {
90
90
  role: "host" | "client";
91
91
  clientName: string;
92
- provider?: "custom" | "claude" | "codex" | undefined;
92
+ provider?: "claude" | "codex" | "custom" | undefined;
93
93
  protocolVersion?: number | undefined;
94
94
  hostname?: string | undefined;
95
95
  platform?: string | undefined;
@@ -98,7 +98,7 @@ export declare const sessionConnectPayloadSchema: z.ZodObject<{
98
98
  }, {
99
99
  role: "host" | "client";
100
100
  clientName: string;
101
- provider?: "custom" | "claude" | "codex" | undefined;
101
+ provider?: "claude" | "codex" | "custom" | undefined;
102
102
  protocolVersion?: number | undefined;
103
103
  hostname?: string | undefined;
104
104
  platform?: string | undefined;
@@ -123,11 +123,14 @@ export declare const sessionAckPayloadSchema: z.ZodObject<{
123
123
  seq: number;
124
124
  }>;
125
125
  export declare const sessionResumePayloadSchema: z.ZodObject<{
126
- lastAckedSeq: z.ZodNumber;
126
+ lastAckedSeq: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
127
+ lastAckedSeqByTerminal: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>>;
127
128
  }, "strip", z.ZodTypeAny, {
128
129
  lastAckedSeq: number;
130
+ lastAckedSeqByTerminal: Record<string, number>;
129
131
  }, {
130
- lastAckedSeq: number;
132
+ lastAckedSeq?: number | undefined;
133
+ lastAckedSeqByTerminal?: Record<string, number> | undefined;
131
134
  }>;
132
135
  export declare const sessionHeartbeatPayloadSchema: z.ZodObject<{
133
136
  ts: z.ZodNumber;
@@ -243,13 +246,13 @@ export declare const screenStatusPayloadSchema: z.ZodObject<{
243
246
  mode: z.ZodDefault<z.ZodEnum<["webrtc", "fallback", "off"]>>;
244
247
  error: z.ZodOptional<z.ZodString>;
245
248
  }, "strip", z.ZodTypeAny, {
246
- mode: "webrtc" | "fallback" | "off";
247
249
  active: boolean;
250
+ mode: "webrtc" | "fallback" | "off";
248
251
  error?: string | undefined;
249
252
  }, {
250
253
  active: boolean;
251
- mode?: "webrtc" | "fallback" | "off" | undefined;
252
254
  error?: string | undefined;
255
+ mode?: "webrtc" | "fallback" | "off" | undefined;
253
256
  }>;
254
257
  export declare const screenOfferPayloadSchema: z.ZodObject<{
255
258
  sdp: z.ZodString;
@@ -283,10 +286,10 @@ export declare const terminalSpawnPayloadSchema: z.ZodObject<{
283
286
  provider: z.ZodOptional<z.ZodEnum<["claude", "codex", "custom"]>>;
284
287
  }, "strip", z.ZodTypeAny, {
285
288
  cwd: string;
286
- provider?: "custom" | "claude" | "codex" | undefined;
289
+ provider?: "claude" | "codex" | "custom" | undefined;
287
290
  }, {
288
291
  cwd: string;
289
- provider?: "custom" | "claude" | "codex" | undefined;
292
+ provider?: "claude" | "codex" | "custom" | undefined;
290
293
  }>;
291
294
  export declare const terminalInfoSchema: z.ZodObject<{
292
295
  terminalId: z.ZodString;
@@ -295,14 +298,14 @@ export declare const terminalInfoSchema: z.ZodObject<{
295
298
  provider: z.ZodString;
296
299
  status: z.ZodEnum<["running", "exited"]>;
297
300
  }, "strip", z.ZodTypeAny, {
298
- terminalId: string;
299
301
  status: "running" | "exited";
302
+ terminalId: string;
300
303
  provider: string;
301
304
  cwd: string;
302
305
  projectName: string;
303
306
  }, {
304
- terminalId: string;
305
307
  status: "running" | "exited";
308
+ terminalId: string;
306
309
  provider: string;
307
310
  cwd: string;
308
311
  projectName: string;
@@ -315,30 +318,30 @@ export declare const terminalListPayloadSchema: z.ZodObject<{
315
318
  provider: z.ZodString;
316
319
  status: z.ZodEnum<["running", "exited"]>;
317
320
  }, "strip", z.ZodTypeAny, {
318
- terminalId: string;
319
321
  status: "running" | "exited";
322
+ terminalId: string;
320
323
  provider: string;
321
324
  cwd: string;
322
325
  projectName: string;
323
326
  }, {
324
- terminalId: string;
325
327
  status: "running" | "exited";
328
+ terminalId: string;
326
329
  provider: string;
327
330
  cwd: string;
328
331
  projectName: string;
329
332
  }>, "many">;
330
333
  }, "strip", z.ZodTypeAny, {
331
334
  terminals: {
332
- terminalId: string;
333
335
  status: "running" | "exited";
336
+ terminalId: string;
334
337
  provider: string;
335
338
  cwd: string;
336
339
  projectName: string;
337
340
  }[];
338
341
  }, {
339
342
  terminals: {
340
- terminalId: string;
341
343
  status: "running" | "exited";
344
+ terminalId: string;
342
345
  provider: string;
343
346
  cwd: string;
344
347
  projectName: string;
@@ -386,12 +389,12 @@ export declare const terminalBrowseEntrySchema: z.ZodObject<{
386
389
  path: z.ZodString;
387
390
  isDirectory: z.ZodBoolean;
388
391
  }, "strip", z.ZodTypeAny, {
389
- path: string;
390
392
  name: string;
393
+ path: string;
391
394
  isDirectory: boolean;
392
395
  }, {
393
- path: string;
394
396
  name: string;
397
+ path: string;
395
398
  isDirectory: boolean;
396
399
  }>;
397
400
  export declare const terminalBrowseResultPayloadSchema: z.ZodObject<{
@@ -401,28 +404,28 @@ export declare const terminalBrowseResultPayloadSchema: z.ZodObject<{
401
404
  path: z.ZodString;
402
405
  isDirectory: z.ZodBoolean;
403
406
  }, "strip", z.ZodTypeAny, {
404
- path: string;
405
407
  name: string;
408
+ path: string;
406
409
  isDirectory: boolean;
407
410
  }, {
408
- path: string;
409
411
  name: string;
412
+ path: string;
410
413
  isDirectory: boolean;
411
414
  }>, "many">;
412
415
  error: z.ZodOptional<z.ZodString>;
413
416
  }, "strip", z.ZodTypeAny, {
414
417
  path: string;
415
418
  entries: {
416
- path: string;
417
419
  name: string;
420
+ path: string;
418
421
  isDirectory: boolean;
419
422
  }[];
420
423
  error?: string | undefined;
421
424
  }, {
422
425
  path: string;
423
426
  entries: {
424
- path: string;
425
427
  name: string;
428
+ path: string;
426
429
  isDirectory: boolean;
427
430
  }[];
428
431
  error?: string | undefined;
@@ -455,7 +458,7 @@ export declare const terminalStatusPayloadSchema: z.ZodObject<{
455
458
  }>>;
456
459
  pendingPermissionCount: z.ZodOptional<z.ZodNumber>;
457
460
  }, "strip", z.ZodTypeAny, {
458
- phase: "idle" | "error" | "thinking" | "tool_use" | "outputting" | "waiting";
461
+ phase: "error" | "idle" | "thinking" | "tool_use" | "outputting" | "waiting";
459
462
  seq?: number | undefined;
460
463
  toolName?: string | undefined;
461
464
  toolInput?: string | undefined;
@@ -470,7 +473,7 @@ export declare const terminalStatusPayloadSchema: z.ZodObject<{
470
473
  } | undefined;
471
474
  pendingPermissionCount?: number | undefined;
472
475
  }, {
473
- phase: "idle" | "error" | "thinking" | "tool_use" | "outputting" | "waiting";
476
+ phase: "error" | "idle" | "thinking" | "tool_use" | "outputting" | "waiting";
474
477
  seq?: number | undefined;
475
478
  toolName?: string | undefined;
476
479
  toolInput?: string | undefined;
@@ -509,11 +512,11 @@ export declare const errorPayloadSchema: z.ZodObject<{
509
512
  code: z.ZodString;
510
513
  message: z.ZodString;
511
514
  }, "strip", z.ZodTypeAny, {
512
- code: string;
513
515
  message: string;
514
- }, {
515
516
  code: string;
517
+ }, {
516
518
  message: string;
519
+ code: string;
517
520
  }>;
518
521
  export declare const tunnelRequestPayloadSchema: z.ZodObject<{
519
522
  requestId: z.ZodString;
@@ -523,19 +526,19 @@ export declare const tunnelRequestPayloadSchema: z.ZodObject<{
523
526
  body: z.ZodNullable<z.ZodString>;
524
527
  port: z.ZodNumber;
525
528
  }, "strip", z.ZodTypeAny, {
526
- method: string;
529
+ port: number;
527
530
  requestId: string;
531
+ method: string;
528
532
  url: string;
529
533
  headers: Record<string, string>;
530
534
  body: string | null;
531
- port: number;
532
535
  }, {
533
- method: string;
536
+ port: number;
534
537
  requestId: string;
538
+ method: string;
535
539
  url: string;
536
540
  headers: Record<string, string>;
537
541
  body: string | null;
538
- port: number;
539
542
  }>;
540
543
  export declare const tunnelResponsePayloadSchema: z.ZodObject<{
541
544
  requestId: z.ZodString;
@@ -599,6 +602,577 @@ export declare const terminalHistoryResponsePayloadSchema: z.ZodObject<{
599
602
  entries: string[];
600
603
  shell?: string | undefined;
601
604
  }>;
605
+ export declare const agentProviderSchema: z.ZodEnum<["codex", "claude", "custom"]>;
606
+ export declare const agentContentBlockSchema: z.ZodObject<{
607
+ type: z.ZodEnum<["text", "image"]>;
608
+ text: z.ZodOptional<z.ZodString>;
609
+ data: z.ZodOptional<z.ZodString>;
610
+ mimeType: z.ZodOptional<z.ZodString>;
611
+ }, "strip", z.ZodTypeAny, {
612
+ type: "text" | "image";
613
+ data?: string | undefined;
614
+ text?: string | undefined;
615
+ mimeType?: string | undefined;
616
+ }, {
617
+ type: "text" | "image";
618
+ data?: string | undefined;
619
+ text?: string | undefined;
620
+ mimeType?: string | undefined;
621
+ }>;
622
+ export declare const agentMessageSchema: z.ZodObject<{
623
+ id: z.ZodString;
624
+ role: z.ZodEnum<["user", "assistant", "system"]>;
625
+ content: z.ZodString;
626
+ createdAt: z.ZodNumber;
627
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
628
+ }, "strip", z.ZodTypeAny, {
629
+ id: string;
630
+ role: "user" | "assistant" | "system";
631
+ content: string;
632
+ createdAt: number;
633
+ isStreaming?: boolean | undefined;
634
+ }, {
635
+ id: string;
636
+ role: "user" | "assistant" | "system";
637
+ content: string;
638
+ createdAt: number;
639
+ isStreaming?: boolean | undefined;
640
+ }>;
641
+ export declare const agentToolCallSchema: z.ZodObject<{
642
+ id: z.ZodString;
643
+ name: z.ZodString;
644
+ input: z.ZodOptional<z.ZodString>;
645
+ output: z.ZodOptional<z.ZodString>;
646
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
647
+ }, "strip", z.ZodTypeAny, {
648
+ status: "running" | "pending" | "completed" | "failed";
649
+ 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
+ }>;
602
1176
  export declare const protocolMessageSchemas: {
603
1177
  readonly "session.connect": z.ZodObject<{
604
1178
  role: z.ZodEnum<["host", "client"]>;
@@ -612,7 +1186,7 @@ export declare const protocolMessageSchemas: {
612
1186
  }, "strip", z.ZodTypeAny, {
613
1187
  role: "host" | "client";
614
1188
  clientName: string;
615
- provider?: "custom" | "claude" | "codex" | undefined;
1189
+ provider?: "claude" | "codex" | "custom" | undefined;
616
1190
  protocolVersion?: number | undefined;
617
1191
  hostname?: string | undefined;
618
1192
  platform?: string | undefined;
@@ -621,7 +1195,7 @@ export declare const protocolMessageSchemas: {
621
1195
  }, {
622
1196
  role: "host" | "client";
623
1197
  clientName: string;
624
- provider?: "custom" | "claude" | "codex" | undefined;
1198
+ provider?: "claude" | "codex" | "custom" | undefined;
625
1199
  protocolVersion?: number | undefined;
626
1200
  hostname?: string | undefined;
627
1201
  platform?: string | undefined;
@@ -636,11 +1210,14 @@ export declare const protocolMessageSchemas: {
636
1210
  seq: number;
637
1211
  }>;
638
1212
  readonly "session.resume": z.ZodObject<{
639
- lastAckedSeq: z.ZodNumber;
1213
+ lastAckedSeq: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
1214
+ lastAckedSeqByTerminal: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>>;
640
1215
  }, "strip", z.ZodTypeAny, {
641
1216
  lastAckedSeq: number;
1217
+ lastAckedSeqByTerminal: Record<string, number>;
642
1218
  }, {
643
- lastAckedSeq: number;
1219
+ lastAckedSeq?: number | undefined;
1220
+ lastAckedSeqByTerminal?: Record<string, number> | undefined;
644
1221
  }>;
645
1222
  readonly "session.heartbeat": z.ZodObject<{
646
1223
  ts: z.ZodNumber;
@@ -653,11 +1230,11 @@ export declare const protocolMessageSchemas: {
653
1230
  code: z.ZodString;
654
1231
  message: z.ZodString;
655
1232
  }, "strip", z.ZodTypeAny, {
656
- code: string;
657
1233
  message: string;
658
- }, {
659
1234
  code: string;
1235
+ }, {
660
1236
  message: string;
1237
+ code: string;
661
1238
  }>;
662
1239
  readonly "terminal.output": z.ZodObject<{
663
1240
  stream: z.ZodEnum<["stdout", "stderr"]>;
@@ -666,9 +1243,9 @@ export declare const protocolMessageSchemas: {
666
1243
  isReplay: z.ZodDefault<z.ZodBoolean>;
667
1244
  isFinal: z.ZodDefault<z.ZodBoolean>;
668
1245
  }, "strip", z.ZodTypeAny, {
669
- encoding: "utf8";
670
1246
  stream: "stdout" | "stderr";
671
1247
  data: string;
1248
+ encoding: "utf8";
672
1249
  isReplay: boolean;
673
1250
  isFinal: boolean;
674
1251
  }, {
@@ -812,13 +1389,13 @@ export declare const protocolMessageSchemas: {
812
1389
  mode: z.ZodDefault<z.ZodEnum<["webrtc", "fallback", "off"]>>;
813
1390
  error: z.ZodOptional<z.ZodString>;
814
1391
  }, "strip", z.ZodTypeAny, {
815
- mode: "webrtc" | "fallback" | "off";
816
1392
  active: boolean;
1393
+ mode: "webrtc" | "fallback" | "off";
817
1394
  error?: string | undefined;
818
1395
  }, {
819
1396
  active: boolean;
820
- mode?: "webrtc" | "fallback" | "off" | undefined;
821
1397
  error?: string | undefined;
1398
+ mode?: "webrtc" | "fallback" | "off" | undefined;
822
1399
  }>;
823
1400
  readonly "screen.offer": z.ZodObject<{
824
1401
  sdp: z.ZodString;
@@ -862,10 +1439,10 @@ export declare const protocolMessageSchemas: {
862
1439
  provider: z.ZodOptional<z.ZodEnum<["claude", "codex", "custom"]>>;
863
1440
  }, "strip", z.ZodTypeAny, {
864
1441
  cwd: string;
865
- provider?: "custom" | "claude" | "codex" | undefined;
1442
+ provider?: "claude" | "codex" | "custom" | undefined;
866
1443
  }, {
867
1444
  cwd: string;
868
- provider?: "custom" | "claude" | "codex" | undefined;
1445
+ provider?: "claude" | "codex" | "custom" | undefined;
869
1446
  }>;
870
1447
  readonly "terminal.spawned": z.ZodObject<{
871
1448
  terminalId: z.ZodString;
@@ -891,30 +1468,30 @@ export declare const protocolMessageSchemas: {
891
1468
  provider: z.ZodString;
892
1469
  status: z.ZodEnum<["running", "exited"]>;
893
1470
  }, "strip", z.ZodTypeAny, {
894
- terminalId: string;
895
1471
  status: "running" | "exited";
1472
+ terminalId: string;
896
1473
  provider: string;
897
1474
  cwd: string;
898
1475
  projectName: string;
899
1476
  }, {
900
- terminalId: string;
901
1477
  status: "running" | "exited";
1478
+ terminalId: string;
902
1479
  provider: string;
903
1480
  cwd: string;
904
1481
  projectName: string;
905
1482
  }>, "many">;
906
1483
  }, "strip", z.ZodTypeAny, {
907
1484
  terminals: {
908
- terminalId: string;
909
1485
  status: "running" | "exited";
1486
+ terminalId: string;
910
1487
  provider: string;
911
1488
  cwd: string;
912
1489
  projectName: string;
913
1490
  }[];
914
1491
  }, {
915
1492
  terminals: {
916
- terminalId: string;
917
1493
  status: "running" | "exited";
1494
+ terminalId: string;
918
1495
  provider: string;
919
1496
  cwd: string;
920
1497
  projectName: string;
@@ -934,28 +1511,28 @@ export declare const protocolMessageSchemas: {
934
1511
  path: z.ZodString;
935
1512
  isDirectory: z.ZodBoolean;
936
1513
  }, "strip", z.ZodTypeAny, {
937
- path: string;
938
1514
  name: string;
1515
+ path: string;
939
1516
  isDirectory: boolean;
940
1517
  }, {
941
- path: string;
942
1518
  name: string;
1519
+ path: string;
943
1520
  isDirectory: boolean;
944
1521
  }>, "many">;
945
1522
  error: z.ZodOptional<z.ZodString>;
946
1523
  }, "strip", z.ZodTypeAny, {
947
1524
  path: string;
948
1525
  entries: {
949
- path: string;
950
1526
  name: string;
1527
+ path: string;
951
1528
  isDirectory: boolean;
952
1529
  }[];
953
1530
  error?: string | undefined;
954
1531
  }, {
955
1532
  path: string;
956
1533
  entries: {
957
- path: string;
958
1534
  name: string;
1535
+ path: string;
959
1536
  isDirectory: boolean;
960
1537
  }[];
961
1538
  error?: string | undefined;
@@ -1002,7 +1579,7 @@ export declare const protocolMessageSchemas: {
1002
1579
  }>>;
1003
1580
  pendingPermissionCount: z.ZodOptional<z.ZodNumber>;
1004
1581
  }, "strip", z.ZodTypeAny, {
1005
- phase: "idle" | "error" | "thinking" | "tool_use" | "outputting" | "waiting";
1582
+ phase: "error" | "idle" | "thinking" | "tool_use" | "outputting" | "waiting";
1006
1583
  seq?: number | undefined;
1007
1584
  toolName?: string | undefined;
1008
1585
  toolInput?: string | undefined;
@@ -1017,7 +1594,7 @@ export declare const protocolMessageSchemas: {
1017
1594
  } | undefined;
1018
1595
  pendingPermissionCount?: number | undefined;
1019
1596
  }, {
1020
- phase: "idle" | "error" | "thinking" | "tool_use" | "outputting" | "waiting";
1597
+ phase: "error" | "idle" | "thinking" | "tool_use" | "outputting" | "waiting";
1021
1598
  seq?: number | undefined;
1022
1599
  toolName?: string | undefined;
1023
1600
  toolInput?: string | undefined;
@@ -1050,19 +1627,19 @@ export declare const protocolMessageSchemas: {
1050
1627
  body: z.ZodNullable<z.ZodString>;
1051
1628
  port: z.ZodNumber;
1052
1629
  }, "strip", z.ZodTypeAny, {
1053
- method: string;
1630
+ port: number;
1054
1631
  requestId: string;
1632
+ method: string;
1055
1633
  url: string;
1056
1634
  headers: Record<string, string>;
1057
1635
  body: string | null;
1058
- port: number;
1059
1636
  }, {
1060
- method: string;
1637
+ port: number;
1061
1638
  requestId: string;
1639
+ method: string;
1062
1640
  url: string;
1063
1641
  headers: Record<string, string>;
1064
1642
  body: string | null;
1065
- port: number;
1066
1643
  }>;
1067
1644
  readonly "tunnel.response": z.ZodObject<{
1068
1645
  requestId: z.ZodString;
@@ -1126,6 +1703,483 @@ export declare const protocolMessageSchemas: {
1126
1703
  entries: string[];
1127
1704
  shell?: string | undefined;
1128
1705
  }>;
1706
+ readonly "agent.initialize": z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
1707
+ readonly "agent.capabilities": z.ZodObject<{
1708
+ enabled: z.ZodBoolean;
1709
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
1710
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
1711
+ error: z.ZodOptional<z.ZodString>;
1712
+ supportsSessionList: z.ZodDefault<z.ZodBoolean>;
1713
+ supportsSessionLoad: z.ZodDefault<z.ZodBoolean>;
1714
+ supportsImages: z.ZodDefault<z.ZodBoolean>;
1715
+ supportsAudio: z.ZodDefault<z.ZodBoolean>;
1716
+ supportsPermission: z.ZodDefault<z.ZodBoolean>;
1717
+ supportsPlan: z.ZodDefault<z.ZodBoolean>;
1718
+ supportsCancel: z.ZodDefault<z.ZodBoolean>;
1719
+ }, "strip", z.ZodTypeAny, {
1720
+ enabled: boolean;
1721
+ supportsSessionList: boolean;
1722
+ supportsSessionLoad: boolean;
1723
+ supportsImages: boolean;
1724
+ supportsAudio: boolean;
1725
+ supportsPermission: boolean;
1726
+ supportsPlan: boolean;
1727
+ supportsCancel: boolean;
1728
+ error?: string | undefined;
1729
+ provider?: "claude" | "codex" | "custom" | undefined;
1730
+ protocolVersion?: number | undefined;
1731
+ }, {
1732
+ enabled: boolean;
1733
+ error?: string | undefined;
1734
+ provider?: "claude" | "codex" | "custom" | undefined;
1735
+ protocolVersion?: number | undefined;
1736
+ supportsSessionList?: boolean | undefined;
1737
+ supportsSessionLoad?: boolean | undefined;
1738
+ supportsImages?: boolean | undefined;
1739
+ supportsAudio?: boolean | undefined;
1740
+ supportsPermission?: boolean | undefined;
1741
+ supportsPlan?: boolean | undefined;
1742
+ supportsCancel?: boolean | undefined;
1743
+ }>;
1744
+ readonly "agent.session.new": z.ZodObject<{
1745
+ cwd: z.ZodOptional<z.ZodString>;
1746
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "custom"]>>;
1747
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1748
+ }, "strip", z.ZodTypeAny, {
1749
+ provider?: "claude" | "codex" | "custom" | undefined;
1750
+ cwd?: string | undefined;
1751
+ mcpServers?: Record<string, unknown> | undefined;
1752
+ }, {
1753
+ provider?: "claude" | "codex" | "custom" | undefined;
1754
+ cwd?: string | undefined;
1755
+ mcpServers?: Record<string, unknown> | undefined;
1756
+ }>;
1757
+ readonly "agent.session.load": z.ZodObject<{
1758
+ agentSessionId: z.ZodString;
1759
+ cwd: z.ZodOptional<z.ZodString>;
1760
+ }, "strip", z.ZodTypeAny, {
1761
+ agentSessionId: string;
1762
+ cwd?: string | undefined;
1763
+ }, {
1764
+ agentSessionId: string;
1765
+ cwd?: string | undefined;
1766
+ }>;
1767
+ readonly "agent.session.list": z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
1768
+ readonly "agent.prompt": z.ZodObject<{
1769
+ agentSessionId: z.ZodOptional<z.ZodString>;
1770
+ clientMessageId: z.ZodString;
1771
+ contentBlocks: z.ZodArray<z.ZodObject<{
1772
+ type: z.ZodEnum<["text", "image"]>;
1773
+ text: z.ZodOptional<z.ZodString>;
1774
+ data: z.ZodOptional<z.ZodString>;
1775
+ mimeType: z.ZodOptional<z.ZodString>;
1776
+ }, "strip", z.ZodTypeAny, {
1777
+ type: "text" | "image";
1778
+ data?: string | undefined;
1779
+ text?: string | undefined;
1780
+ mimeType?: string | undefined;
1781
+ }, {
1782
+ type: "text" | "image";
1783
+ data?: string | undefined;
1784
+ text?: string | undefined;
1785
+ mimeType?: string | undefined;
1786
+ }>, "many">;
1787
+ }, "strip", z.ZodTypeAny, {
1788
+ clientMessageId: string;
1789
+ contentBlocks: {
1790
+ type: "text" | "image";
1791
+ data?: string | undefined;
1792
+ text?: string | undefined;
1793
+ mimeType?: string | undefined;
1794
+ }[];
1795
+ agentSessionId?: string | undefined;
1796
+ }, {
1797
+ clientMessageId: string;
1798
+ contentBlocks: {
1799
+ type: "text" | "image";
1800
+ data?: string | undefined;
1801
+ text?: string | undefined;
1802
+ mimeType?: string | undefined;
1803
+ }[];
1804
+ agentSessionId?: string | undefined;
1805
+ }>;
1806
+ readonly "agent.cancel": z.ZodObject<{
1807
+ agentSessionId: z.ZodOptional<z.ZodString>;
1808
+ }, "strip", z.ZodTypeAny, {
1809
+ agentSessionId?: string | undefined;
1810
+ }, {
1811
+ agentSessionId?: string | undefined;
1812
+ }>;
1813
+ readonly "agent.update": z.ZodObject<{
1814
+ agentSessionId: z.ZodOptional<z.ZodString>;
1815
+ kind: z.ZodEnum<["message", "message_delta", "tool_call", "tool_result", "plan", "status", "error"]>;
1816
+ message: z.ZodOptional<z.ZodObject<{
1817
+ id: z.ZodString;
1818
+ role: z.ZodEnum<["user", "assistant", "system"]>;
1819
+ content: z.ZodString;
1820
+ createdAt: z.ZodNumber;
1821
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
1822
+ }, "strip", z.ZodTypeAny, {
1823
+ id: string;
1824
+ role: "user" | "assistant" | "system";
1825
+ content: string;
1826
+ createdAt: number;
1827
+ isStreaming?: boolean | undefined;
1828
+ }, {
1829
+ id: string;
1830
+ role: "user" | "assistant" | "system";
1831
+ content: string;
1832
+ createdAt: number;
1833
+ isStreaming?: boolean | undefined;
1834
+ }>>;
1835
+ delta: z.ZodOptional<z.ZodString>;
1836
+ toolCall: z.ZodOptional<z.ZodObject<{
1837
+ id: z.ZodString;
1838
+ name: z.ZodString;
1839
+ input: z.ZodOptional<z.ZodString>;
1840
+ output: z.ZodOptional<z.ZodString>;
1841
+ status: z.ZodDefault<z.ZodEnum<["pending", "running", "completed", "failed"]>>;
1842
+ }, "strip", z.ZodTypeAny, {
1843
+ status: "running" | "pending" | "completed" | "failed";
1844
+ 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
+ }>;
1129
2183
  };
1130
2184
  export type ProtocolMessageType = keyof typeof protocolMessageSchemas;
1131
2185
  export declare function createEnvelope<T>(input: {