-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathtypes.gen.ts
More file actions
3450 lines (3308 loc) · 94.3 KB
/
types.gen.ts
File metadata and controls
3450 lines (3308 loc) · 94.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// This file is auto-generated by @hey-api/openapi-ts
// eslint-disable-next-line @typescript-eslint/no-unused-vars
type ClientOptions = {
baseUrl: `${string}://${string}` | (string & {});
};
/**
* Capabilities supported by the agent.
*
* Advertised during initialization to inform the client about
* available features and content types.
*
* See protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol/initialization#agent-capabilities)
*/
export type AgentCapabilities = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
/**
* Whether the agent supports `session/load`.
*/
loadSession?: boolean;
/**
* MCP capabilities supported by the agent.
*/
mcpCapabilities?: McpCapabilities;
/**
* Prompt capabilities supported by the agent.
*/
promptCapabilities?: PromptCapabilities;
sessionCapabilities?: SessionCapabilities;
};
export type AgentNotification = {
method: string;
params?: SessionNotification | ExtNotification | null;
};
export type AgentRequest = {
id: RequestId;
method: string;
params?:
| WriteTextFileRequest
| ReadTextFileRequest
| RequestPermissionRequest
| CreateTerminalRequest
| TerminalOutputRequest
| ReleaseTerminalRequest
| WaitForTerminalExitRequest
| KillTerminalRequest
| ExtRequest
| null;
};
export type AgentResponse =
| {
id: RequestId;
/**
* All possible responses that an agent can send to a client.
*
* This enum is used internally for routing RPC responses. You typically won't need
* to use this directly - the responses are handled automatically by the connection.
*
* These are responses to the corresponding `ClientRequest` variants.
*/
result:
| InitializeResponse
| AuthenticateResponse
| NewSessionResponse
| LoadSessionResponse
| ListSessionsResponse
| ForkSessionResponse
| ResumeSessionResponse
| CloseSessionResponse
| SetSessionModeResponse
| SetSessionConfigOptionResponse
| PromptResponse
| SetSessionModelResponse
| ExtResponse;
}
| {
error: Error;
id: RequestId;
};
/**
* Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
*/
export type Annotations = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
audience?: Array<Role> | null;
lastModified?: string | null;
priority?: number | null;
};
/**
* Audio provided to or from an LLM.
*/
export type AudioContent = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
annotations?: Annotations | null;
data: string;
mimeType: string;
};
/**
* **UNSTABLE**
*
* This capability is not part of the spec yet, and may be removed or changed at any point.
*
* Authentication capabilities supported by the client.
*
* Advertised during initialization to inform the agent which authentication
* method types the client can handle. This governs opt-in types that require
* additional client-side support.
*
* @experimental
*/
export type AuthCapabilities = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
/**
* Whether the client supports `terminal` authentication methods.
*
* When `true`, the agent may include `terminal` entries in its authentication methods.
*/
terminal?: boolean;
};
/**
* **UNSTABLE**
*
* This capability is not part of the spec yet, and may be removed or changed at any point.
*
* Describes a single environment variable for an [`AuthMethodEnvVar`] authentication method.
*
* @experimental
*/
export type AuthEnvVar = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
/**
* Human-readable label for this variable, displayed in client UI.
*/
label?: string | null;
/**
* The environment variable name (e.g. `"OPENAI_API_KEY"`).
*/
name: string;
/**
* Whether this variable is optional.
*
* Defaults to `false`.
*/
optional?: boolean;
/**
* Whether this value is a secret (e.g. API key, token).
* Clients should use a password-style input for secret vars.
*
* Defaults to `true`.
*/
secret?: boolean;
};
/**
* Describes an available authentication method.
*
* The `type` field acts as the discriminator in the serialized JSON form.
* When no `type` is present, the method is treated as `agent`.
*/
export type AuthMethod =
| (AuthMethodEnvVar & {
type: "env_var";
})
| (AuthMethodTerminal & {
type: "terminal";
})
| AuthMethodAgent;
/**
* Agent handles authentication itself.
*
* This is the default authentication method type.
*/
export type AuthMethodAgent = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
/**
* Optional description providing more details about this authentication method.
*/
description?: string | null;
/**
* Unique identifier for this authentication method.
*/
id: string;
/**
* Human-readable name of the authentication method.
*/
name: string;
};
/**
* **UNSTABLE**
*
* This capability is not part of the spec yet, and may be removed or changed at any point.
*
* Environment variable authentication method.
*
* The user provides credentials that the client passes to the agent as environment variables.
*
* @experimental
*/
export type AuthMethodEnvVar = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
/**
* Optional description providing more details about this authentication method.
*/
description?: string | null;
/**
* Unique identifier for this authentication method.
*/
id: string;
/**
* Optional link to a page where the user can obtain their credentials.
*/
link?: string | null;
/**
* Human-readable name of the authentication method.
*/
name: string;
/**
* The environment variables the client should set.
*/
vars: Array<AuthEnvVar>;
};
/**
* **UNSTABLE**
*
* This capability is not part of the spec yet, and may be removed or changed at any point.
*
* Terminal-based authentication method.
*
* The client runs an interactive terminal for the user to authenticate via a TUI.
*
* @experimental
*/
export type AuthMethodTerminal = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
/**
* Additional arguments to pass when running the agent binary for terminal auth.
*/
args?: Array<string>;
/**
* Optional description providing more details about this authentication method.
*/
description?: string | null;
/**
* Additional environment variables to set when running the agent binary for terminal auth.
*/
env?: {
[key: string]: string;
};
/**
* Unique identifier for this authentication method.
*/
id: string;
/**
* Human-readable name of the authentication method.
*/
name: string;
};
/**
* Request parameters for the authenticate method.
*
* Specifies which authentication method to use.
*/
export type AuthenticateRequest = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
/**
* The ID of the authentication method to use.
* Must be one of the methods advertised in the initialize response.
*/
methodId: string;
};
/**
* Response to the `authenticate` method.
*/
export type AuthenticateResponse = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
};
/**
* Information about a command.
*/
export type AvailableCommand = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
/**
* Human-readable description of what the command does.
*/
description: string;
/**
* Input for the command if required
*/
input?: AvailableCommandInput | null;
/**
* Command name (e.g., `create_plan`, `research_codebase`).
*/
name: string;
};
/**
* unstructured
*
* All text that was typed after the command name is provided as input.
*/
export type AvailableCommandInput = UnstructuredCommandInput;
/**
* Available commands are ready or have changed
*/
export type AvailableCommandsUpdate = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
/**
* Commands the agent can execute
*/
availableCommands: Array<AvailableCommand>;
};
/**
* Binary resource contents.
*/
export type BlobResourceContents = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
blob: string;
mimeType?: string | null;
uri: string;
};
/**
* Notification to cancel ongoing operations for a session.
*
* See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)
*/
export type CancelNotification = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
/**
* The ID of the session to cancel operations for.
*/
sessionId: SessionId;
};
/**
* **UNSTABLE**
*
* This capability is not part of the spec yet, and may be removed or changed at any point.
*
* Notification to cancel an ongoing request.
*
* See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/cancellation)
*
* @experimental
*/
export type CancelRequestNotification = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
/**
* The ID of the request to cancel.
*/
requestId: RequestId;
};
/**
* Capabilities supported by the client.
*
* Advertised during initialization to inform the agent about
* available features and methods.
*
* See protocol docs: [Client Capabilities](https://agentclientprotocol.com/protocol/initialization#client-capabilities)
*/
export type ClientCapabilities = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
/**
* **UNSTABLE**
*
* This capability is not part of the spec yet, and may be removed or changed at any point.
*
* Authentication capabilities supported by the client.
* Determines which authentication method types the agent may include
* in its `InitializeResponse`.
*
* @experimental
*/
auth?: AuthCapabilities;
/**
* File system capabilities supported by the client.
* Determines which file operations the agent can request.
*/
fs?: FileSystemCapabilities;
/**
* Whether the Client support all `terminal*` methods.
*/
terminal?: boolean;
};
export type ClientNotification = {
method: string;
params?: CancelNotification | ExtNotification | null;
};
export type ClientRequest = {
id: RequestId;
method: string;
params?:
| InitializeRequest
| AuthenticateRequest
| NewSessionRequest
| LoadSessionRequest
| ListSessionsRequest
| ForkSessionRequest
| ResumeSessionRequest
| CloseSessionRequest
| SetSessionModeRequest
| SetSessionConfigOptionRequest
| PromptRequest
| SetSessionModelRequest
| ExtRequest
| null;
};
export type ClientResponse =
| {
id: RequestId;
/**
* All possible responses that a client can send to an agent.
*
* This enum is used internally for routing RPC responses. You typically won't need
* to use this directly - the responses are handled automatically by the connection.
*
* These are responses to the corresponding `AgentRequest` variants.
*/
result:
| WriteTextFileResponse
| ReadTextFileResponse
| RequestPermissionResponse
| CreateTerminalResponse
| TerminalOutputResponse
| ReleaseTerminalResponse
| WaitForTerminalExitResponse
| KillTerminalResponse
| ExtResponse;
}
| {
error: Error;
id: RequestId;
};
/**
* **UNSTABLE**
*
* This capability is not part of the spec yet, and may be removed or changed at any point.
*
* Request parameters for closing an active session.
*
* If supported, the agent **must** cancel any ongoing work related to the session
* (treat it as if `session/cancel` was called) and then free up any resources
* associated with the session.
*
* Only available if the Agent supports the `session.close` capability.
*
* @experimental
*/
export type CloseSessionRequest = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
/**
* The ID of the session to close.
*/
sessionId: SessionId;
};
/**
* **UNSTABLE**
*
* This capability is not part of the spec yet, and may be removed or changed at any point.
*
* Response from closing a session.
*
* @experimental
*/
export type CloseSessionResponse = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
};
/**
* Session configuration options have been updated.
*/
export type ConfigOptionUpdate = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
/**
* The full set of configuration options and their current values.
*/
configOptions: Array<SessionConfigOption>;
};
/**
* Standard content block (text, images, resources).
*/
export type Content = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
/**
* The actual content block.
*/
content: ContentBlock;
};
/**
* Content blocks represent displayable information in the Agent Client Protocol.
*
* They provide a structured way to handle various types of user-facing content—whether
* it's text from language models, images for analysis, or embedded resources for context.
*
* Content blocks appear in:
* - User prompts sent via `session/prompt`
* - Language model output streamed through `session/update` notifications
* - Progress updates and results from tool calls
*
* This structure is compatible with the Model Context Protocol (MCP), enabling
* agents to seamlessly forward content from MCP tool outputs without transformation.
*
* See protocol docs: [Content](https://agentclientprotocol.com/protocol/content)
*/
export type ContentBlock =
| (TextContent & {
type: "text";
})
| (ImageContent & {
type: "image";
})
| (AudioContent & {
type: "audio";
})
| (ResourceLink & {
type: "resource_link";
})
| (EmbeddedResource & {
type: "resource";
});
/**
* A streamed item of content
*/
export type ContentChunk = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
/**
* A single item of content
*/
content: ContentBlock;
/**
* **UNSTABLE**
*
* This capability is not part of the spec yet, and may be removed or changed at any point.
*
* A unique identifier for the message this chunk belongs to.
*
* All chunks belonging to the same message share the same `messageId`.
* A change in `messageId` indicates a new message has started.
* Both clients and agents MUST use UUID format for message IDs.
*
* @experimental
*/
messageId?: string | null;
};
/**
* **UNSTABLE**
*
* This capability is not part of the spec yet, and may be removed or changed at any point.
*
* Cost information for a session.
*
* @experimental
*/
export type Cost = {
/**
* Total cumulative cost for session.
*/
amount: number;
/**
* ISO 4217 currency code (e.g., "USD", "EUR").
*/
currency: string;
};
/**
* Request to create a new terminal and execute a command.
*/
export type CreateTerminalRequest = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
/**
* Array of command arguments.
*/
args?: Array<string>;
/**
* The command to execute.
*/
command: string;
/**
* Working directory for the command (absolute path).
*/
cwd?: string | null;
/**
* Environment variables for the command.
*/
env?: Array<EnvVariable>;
/**
* Maximum number of output bytes to retain.
*
* When the limit is exceeded, the Client truncates from the beginning of the output
* to stay within the limit.
*
* The Client MUST ensure truncation happens at a character boundary to maintain valid
* string output, even if this means the retained output is slightly less than the
* specified limit.
*/
outputByteLimit?: number | null;
/**
* The session ID for this request.
*/
sessionId: SessionId;
};
/**
* Response containing the ID of the created terminal.
*/
export type CreateTerminalResponse = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
/**
* The unique identifier for the created terminal.
*/
terminalId: string;
};
/**
* The current mode of the session has changed
*
* See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
*/
export type CurrentModeUpdate = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
/**
* The ID of the current mode
*/
currentModeId: SessionModeId;
};
/**
* A diff representing file modifications.
*
* Shows changes to files in a format suitable for display in the client UI.
*
* See protocol docs: [Content](https://agentclientprotocol.com/protocol/tool-calls#content)
*/
export type Diff = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
/**
* The new content after modification.
*/
newText: string;
/**
* The original content (None for new files).
*/
oldText?: string | null;
/**
* The file path being modified.
*/
path: string;
};
/**
* The contents of a resource, embedded into a prompt or tool call result.
*/
export type EmbeddedResource = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
annotations?: Annotations | null;
resource: EmbeddedResourceResource;
};
/**
* Resource content that can be embedded in a message.
*/
export type EmbeddedResourceResource =
| TextResourceContents
| BlobResourceContents;
/**
* An environment variable to set when launching an MCP server.
*/
export type EnvVariable = {
/**
* The _meta property is reserved by ACP to allow clients and agents to attach additional
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
* these keys.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
_meta?: {
[key: string]: unknown;
} | null;
/**
* The name of the environment variable.
*/
name: string;
/**
* The value to set for the environment variable.
*/
value: string;
};
/**
* JSON-RPC error object.
*
* Represents an error that occurred during method execution, following the
* JSON-RPC 2.0 error object specification with optional additional data.
*
* See protocol docs: [JSON-RPC Error Object](https://www.jsonrpc.org/specification#error_object)
*/
export type Error = {
/**
* A number indicating the error type that occurred.
* This must be an integer as defined in the JSON-RPC specification.
*/
code: ErrorCode;
/**
* Optional primitive or structured value that contains additional information about the error.
* This may include debugging information or context-specific details.
*/
data?: unknown;
/**
* A string providing a short description of the error.
* The message should be limited to a concise single sentence.
*/
message: string;
};
/**
* Predefined error codes for common JSON-RPC and ACP-specific errors.
*
* These codes follow the JSON-RPC 2.0 specification for standard errors
* and use the reserved range (-32000 to -32099) for protocol-specific errors.
*/
export type ErrorCode =
| -32700
| -32600
| -32601
| -32602
| -32603
| -32800
| -32000
| -32002
| number;
/**
* Allows the Agent to send an arbitrary notification that is not part of the ACP spec.
* Extension notifications provide a way to send one-way messages for custom functionality
* while maintaining protocol compatibility.
*
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
*/
export type ExtNotification = unknown;