happy-imou-cloud 2.1.25 → 2.1.26

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 (32) hide show
  1. package/bin/happy-cloud.mjs +1 -1
  2. package/compat/acp-sdk-schema/index.d.ts +31 -0
  3. package/compat/acp-sdk-schema/index.js +4 -0
  4. package/compat/acp-sdk-schema/types.gen.d.ts +3761 -0
  5. package/compat/acp-sdk-schema/types.gen.js +2 -2
  6. package/compat/acp-sdk-schema/zod.gen.d.ts +6350 -0
  7. package/compat/acp-sdk-schema/zod.gen.js +883 -383
  8. package/dist/{BaseReasoningProcessor-2bLE0sSp.cjs → BaseReasoningProcessor-0e-Wwv5i.cjs} +2 -2
  9. package/dist/{BaseReasoningProcessor-CwRWOT0S.mjs → BaseReasoningProcessor-KMtgV6ap.mjs} +2 -2
  10. package/dist/{ProviderSelectionHandler-gc5O4qz_.mjs → ProviderSelectionHandler-CG8ktb5b.mjs} +2 -2
  11. package/dist/{ProviderSelectionHandler-B9VPS_Rc.cjs → ProviderSelectionHandler-CzRyfT1v.cjs} +2 -2
  12. package/dist/{api-DIKoWlkZ.mjs → api-DugHuNd4.mjs} +2 -2
  13. package/dist/{api-D-eaNQRi.cjs → api-hgzFUi7o.cjs} +2 -2
  14. package/dist/{command-BJM31yLo.mjs → command-DU0KWNsf.mjs} +2 -2
  15. package/dist/{command-B2c92N5-.cjs → command-Dh8sawXu.cjs} +2 -2
  16. package/dist/{index-DAd1S2uU.mjs → index-hj-qbq8Y.mjs} +125 -43
  17. package/dist/{index-C9H8DkAi.cjs → index-ythl_OD6.cjs} +128 -46
  18. package/dist/index.cjs +2 -2
  19. package/dist/index.mjs +2 -2
  20. package/dist/lib.cjs +1 -1
  21. package/dist/lib.d.cts +192 -191
  22. package/dist/lib.d.mts +192 -191
  23. package/dist/lib.mjs +1 -1
  24. package/dist/{registerKillSessionHandler-Clhr0VyF.mjs → registerKillSessionHandler-BNzbdofF.mjs} +22 -4
  25. package/dist/{registerKillSessionHandler-DqGYmdQO.cjs → registerKillSessionHandler-Q_rOuCNA.cjs} +22 -4
  26. package/dist/{runClaude-ByM9SjF1.cjs → runClaude-BUi2fgRI.cjs} +4 -4
  27. package/dist/{runClaude-DCwdRRme.mjs → runClaude-Y84RT6V0.mjs} +4 -4
  28. package/dist/{runCodex-CVJLnCCQ.mjs → runCodex-D2xIzHke.mjs} +28 -11
  29. package/dist/{runCodex-C1J5kcWX.cjs → runCodex-vO3-iZ8E.cjs} +28 -11
  30. package/dist/{runGemini-CGCzDzMj.mjs → runGemini-CAotw19V.mjs} +4 -4
  31. package/dist/{runGemini-BbXO6nqw.cjs → runGemini-DIKiIVdN.cjs} +4 -4
  32. package/package.json +2 -2
@@ -0,0 +1,3761 @@
1
+ /**
2
+ * **UNSTABLE**
3
+ *
4
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
5
+ *
6
+ * Authentication-related capabilities supported by the agent.
7
+ *
8
+ * @experimental
9
+ */
10
+ export type AgentAuthCapabilities = {
11
+ /**
12
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
13
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
14
+ * these keys.
15
+ *
16
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
17
+ */
18
+ _meta?: {
19
+ [key: string]: unknown;
20
+ } | null;
21
+ /**
22
+ * Whether the agent supports the logout method.
23
+ *
24
+ * By supplying `{}` it means that the agent supports the logout method.
25
+ */
26
+ logout?: LogoutCapabilities | null;
27
+ };
28
+ /**
29
+ * Capabilities supported by the agent.
30
+ *
31
+ * Advertised during initialization to inform the client about
32
+ * available features and content types.
33
+ *
34
+ * See protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol/initialization#agent-capabilities)
35
+ */
36
+ export type AgentCapabilities = {
37
+ /**
38
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
39
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
40
+ * these keys.
41
+ *
42
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
43
+ */
44
+ _meta?: {
45
+ [key: string]: unknown;
46
+ } | null;
47
+ /**
48
+ * **UNSTABLE**
49
+ *
50
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
51
+ *
52
+ * Authentication-related capabilities supported by the agent.
53
+ *
54
+ * @experimental
55
+ */
56
+ auth?: AgentAuthCapabilities;
57
+ /**
58
+ * Whether the agent supports `session/load`.
59
+ */
60
+ loadSession?: boolean;
61
+ /**
62
+ * MCP capabilities supported by the agent.
63
+ */
64
+ mcpCapabilities?: McpCapabilities;
65
+ /**
66
+ * Prompt capabilities supported by the agent.
67
+ */
68
+ promptCapabilities?: PromptCapabilities;
69
+ sessionCapabilities?: SessionCapabilities;
70
+ };
71
+ export type AgentNotification = {
72
+ method: string;
73
+ params?: SessionNotification | ElicitationCompleteNotification | ExtNotification | null;
74
+ };
75
+ export type AgentRequest = {
76
+ id: RequestId;
77
+ method: string;
78
+ params?: WriteTextFileRequest | ReadTextFileRequest | RequestPermissionRequest | CreateTerminalRequest | TerminalOutputRequest | ReleaseTerminalRequest | WaitForTerminalExitRequest | KillTerminalRequest | ElicitationRequest | ExtRequest | null;
79
+ };
80
+ export type AgentResponse = {
81
+ id: RequestId;
82
+ /**
83
+ * All possible responses that an agent can send to a client.
84
+ *
85
+ * This enum is used internally for routing RPC responses. You typically won't need
86
+ * to use this directly - the responses are handled automatically by the connection.
87
+ *
88
+ * These are responses to the corresponding `ClientRequest` variants.
89
+ */
90
+ result: InitializeResponse | AuthenticateResponse | LogoutResponse | NewSessionResponse | LoadSessionResponse | ListSessionsResponse | ForkSessionResponse | ResumeSessionResponse | CloseSessionResponse | SetSessionModeResponse | SetSessionConfigOptionResponse | PromptResponse | SetSessionModelResponse | ExtResponse;
91
+ } | {
92
+ error: Error;
93
+ id: RequestId;
94
+ };
95
+ /**
96
+ * Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
97
+ */
98
+ export type Annotations = {
99
+ /**
100
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
101
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
102
+ * these keys.
103
+ *
104
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
105
+ */
106
+ _meta?: {
107
+ [key: string]: unknown;
108
+ } | null;
109
+ audience?: Array<Role> | null;
110
+ lastModified?: string | null;
111
+ priority?: number | null;
112
+ };
113
+ /**
114
+ * Audio provided to or from an LLM.
115
+ */
116
+ export type AudioContent = {
117
+ /**
118
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
119
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
120
+ * these keys.
121
+ *
122
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
123
+ */
124
+ _meta?: {
125
+ [key: string]: unknown;
126
+ } | null;
127
+ annotations?: Annotations | null;
128
+ data: string;
129
+ mimeType: string;
130
+ };
131
+ /**
132
+ * **UNSTABLE**
133
+ *
134
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
135
+ *
136
+ * Authentication capabilities supported by the client.
137
+ *
138
+ * Advertised during initialization to inform the agent which authentication
139
+ * method types the client can handle. This governs opt-in types that require
140
+ * additional client-side support.
141
+ *
142
+ * @experimental
143
+ */
144
+ export type AuthCapabilities = {
145
+ /**
146
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
147
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
148
+ * these keys.
149
+ *
150
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
151
+ */
152
+ _meta?: {
153
+ [key: string]: unknown;
154
+ } | null;
155
+ /**
156
+ * Whether the client supports `terminal` authentication methods.
157
+ *
158
+ * When `true`, the agent may include `terminal` entries in its authentication methods.
159
+ */
160
+ terminal?: boolean;
161
+ };
162
+ /**
163
+ * **UNSTABLE**
164
+ *
165
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
166
+ *
167
+ * Describes a single environment variable for an [`AuthMethodEnvVar`] authentication method.
168
+ *
169
+ * @experimental
170
+ */
171
+ export type AuthEnvVar = {
172
+ /**
173
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
174
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
175
+ * these keys.
176
+ *
177
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
178
+ */
179
+ _meta?: {
180
+ [key: string]: unknown;
181
+ } | null;
182
+ /**
183
+ * Human-readable label for this variable, displayed in client UI.
184
+ */
185
+ label?: string | null;
186
+ /**
187
+ * The environment variable name (e.g. `"OPENAI_API_KEY"`).
188
+ */
189
+ name: string;
190
+ /**
191
+ * Whether this variable is optional.
192
+ *
193
+ * Defaults to `false`.
194
+ */
195
+ optional?: boolean;
196
+ /**
197
+ * Whether this value is a secret (e.g. API key, token).
198
+ * Clients should use a password-style input for secret vars.
199
+ *
200
+ * Defaults to `true`.
201
+ */
202
+ secret?: boolean;
203
+ };
204
+ /**
205
+ * Describes an available authentication method.
206
+ *
207
+ * The `type` field acts as the discriminator in the serialized JSON form.
208
+ * When no `type` is present, the method is treated as `agent`.
209
+ */
210
+ export type AuthMethod = (AuthMethodEnvVar & {
211
+ type: "env_var";
212
+ }) | (AuthMethodTerminal & {
213
+ type: "terminal";
214
+ }) | AuthMethodAgent;
215
+ /**
216
+ * Agent handles authentication itself.
217
+ *
218
+ * This is the default authentication method type.
219
+ */
220
+ export type AuthMethodAgent = {
221
+ /**
222
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
223
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
224
+ * these keys.
225
+ *
226
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
227
+ */
228
+ _meta?: {
229
+ [key: string]: unknown;
230
+ } | null;
231
+ /**
232
+ * Optional description providing more details about this authentication method.
233
+ */
234
+ description?: string | null;
235
+ /**
236
+ * Unique identifier for this authentication method.
237
+ */
238
+ id: string;
239
+ /**
240
+ * Human-readable name of the authentication method.
241
+ */
242
+ name: string;
243
+ };
244
+ /**
245
+ * **UNSTABLE**
246
+ *
247
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
248
+ *
249
+ * Environment variable authentication method.
250
+ *
251
+ * The user provides credentials that the client passes to the agent as environment variables.
252
+ *
253
+ * @experimental
254
+ */
255
+ export type AuthMethodEnvVar = {
256
+ /**
257
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
258
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
259
+ * these keys.
260
+ *
261
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
262
+ */
263
+ _meta?: {
264
+ [key: string]: unknown;
265
+ } | null;
266
+ /**
267
+ * Optional description providing more details about this authentication method.
268
+ */
269
+ description?: string | null;
270
+ /**
271
+ * Unique identifier for this authentication method.
272
+ */
273
+ id: string;
274
+ /**
275
+ * Optional link to a page where the user can obtain their credentials.
276
+ */
277
+ link?: string | null;
278
+ /**
279
+ * Human-readable name of the authentication method.
280
+ */
281
+ name: string;
282
+ /**
283
+ * The environment variables the client should set.
284
+ */
285
+ vars: Array<AuthEnvVar>;
286
+ };
287
+ /**
288
+ * **UNSTABLE**
289
+ *
290
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
291
+ *
292
+ * Terminal-based authentication method.
293
+ *
294
+ * The client runs an interactive terminal for the user to authenticate via a TUI.
295
+ *
296
+ * @experimental
297
+ */
298
+ export type AuthMethodTerminal = {
299
+ /**
300
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
301
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
302
+ * these keys.
303
+ *
304
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
305
+ */
306
+ _meta?: {
307
+ [key: string]: unknown;
308
+ } | null;
309
+ /**
310
+ * Additional arguments to pass when running the agent binary for terminal auth.
311
+ */
312
+ args?: Array<string>;
313
+ /**
314
+ * Optional description providing more details about this authentication method.
315
+ */
316
+ description?: string | null;
317
+ /**
318
+ * Additional environment variables to set when running the agent binary for terminal auth.
319
+ */
320
+ env?: {
321
+ [key: string]: string;
322
+ };
323
+ /**
324
+ * Unique identifier for this authentication method.
325
+ */
326
+ id: string;
327
+ /**
328
+ * Human-readable name of the authentication method.
329
+ */
330
+ name: string;
331
+ };
332
+ /**
333
+ * Request parameters for the authenticate method.
334
+ *
335
+ * Specifies which authentication method to use.
336
+ */
337
+ export type AuthenticateRequest = {
338
+ /**
339
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
340
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
341
+ * these keys.
342
+ *
343
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
344
+ */
345
+ _meta?: {
346
+ [key: string]: unknown;
347
+ } | null;
348
+ /**
349
+ * The ID of the authentication method to use.
350
+ * Must be one of the methods advertised in the initialize response.
351
+ */
352
+ methodId: string;
353
+ };
354
+ /**
355
+ * Response to the `authenticate` method.
356
+ */
357
+ export type AuthenticateResponse = {
358
+ /**
359
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
360
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
361
+ * these keys.
362
+ *
363
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
364
+ */
365
+ _meta?: {
366
+ [key: string]: unknown;
367
+ } | null;
368
+ };
369
+ /**
370
+ * Information about a command.
371
+ */
372
+ export type AvailableCommand = {
373
+ /**
374
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
375
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
376
+ * these keys.
377
+ *
378
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
379
+ */
380
+ _meta?: {
381
+ [key: string]: unknown;
382
+ } | null;
383
+ /**
384
+ * Human-readable description of what the command does.
385
+ */
386
+ description: string;
387
+ /**
388
+ * Input for the command if required
389
+ */
390
+ input?: AvailableCommandInput | null;
391
+ /**
392
+ * Command name (e.g., `create_plan`, `research_codebase`).
393
+ */
394
+ name: string;
395
+ };
396
+ /**
397
+ * unstructured
398
+ *
399
+ * All text that was typed after the command name is provided as input.
400
+ */
401
+ export type AvailableCommandInput = UnstructuredCommandInput;
402
+ /**
403
+ * Available commands are ready or have changed
404
+ */
405
+ export type AvailableCommandsUpdate = {
406
+ /**
407
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
408
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
409
+ * these keys.
410
+ *
411
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
412
+ */
413
+ _meta?: {
414
+ [key: string]: unknown;
415
+ } | null;
416
+ /**
417
+ * Commands the agent can execute
418
+ */
419
+ availableCommands: Array<AvailableCommand>;
420
+ };
421
+ /**
422
+ * Binary resource contents.
423
+ */
424
+ export type BlobResourceContents = {
425
+ /**
426
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
427
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
428
+ * these keys.
429
+ *
430
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
431
+ */
432
+ _meta?: {
433
+ [key: string]: unknown;
434
+ } | null;
435
+ blob: string;
436
+ mimeType?: string | null;
437
+ uri: string;
438
+ };
439
+ /**
440
+ * Schema for boolean properties in an elicitation form.
441
+ */
442
+ export type BooleanPropertySchema = {
443
+ /**
444
+ * Default value.
445
+ */
446
+ default?: boolean | null;
447
+ /**
448
+ * Human-readable description.
449
+ */
450
+ description?: string | null;
451
+ /**
452
+ * Optional title for the property.
453
+ */
454
+ title?: string | null;
455
+ };
456
+ /**
457
+ * Notification to cancel ongoing operations for a session.
458
+ *
459
+ * See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)
460
+ */
461
+ export type CancelNotification = {
462
+ /**
463
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
464
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
465
+ * these keys.
466
+ *
467
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
468
+ */
469
+ _meta?: {
470
+ [key: string]: unknown;
471
+ } | null;
472
+ /**
473
+ * The ID of the session to cancel operations for.
474
+ */
475
+ sessionId: SessionId;
476
+ };
477
+ /**
478
+ * **UNSTABLE**
479
+ *
480
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
481
+ *
482
+ * Notification to cancel an ongoing request.
483
+ *
484
+ * See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/cancellation)
485
+ *
486
+ * @experimental
487
+ */
488
+ export type CancelRequestNotification = {
489
+ /**
490
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
491
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
492
+ * these keys.
493
+ *
494
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
495
+ */
496
+ _meta?: {
497
+ [key: string]: unknown;
498
+ } | null;
499
+ /**
500
+ * The ID of the request to cancel.
501
+ */
502
+ requestId: RequestId;
503
+ };
504
+ /**
505
+ * Capabilities supported by the client.
506
+ *
507
+ * Advertised during initialization to inform the agent about
508
+ * available features and methods.
509
+ *
510
+ * See protocol docs: [Client Capabilities](https://agentclientprotocol.com/protocol/initialization#client-capabilities)
511
+ */
512
+ export type ClientCapabilities = {
513
+ /**
514
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
515
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
516
+ * these keys.
517
+ *
518
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
519
+ */
520
+ _meta?: {
521
+ [key: string]: unknown;
522
+ } | null;
523
+ /**
524
+ * **UNSTABLE**
525
+ *
526
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
527
+ *
528
+ * Authentication capabilities supported by the client.
529
+ * Determines which authentication method types the agent may include
530
+ * in its `InitializeResponse`.
531
+ *
532
+ * @experimental
533
+ */
534
+ auth?: AuthCapabilities;
535
+ /**
536
+ * **UNSTABLE**
537
+ *
538
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
539
+ *
540
+ * Elicitation capabilities supported by the client.
541
+ * Determines which elicitation modes the agent may use.
542
+ *
543
+ * @experimental
544
+ */
545
+ elicitation?: ElicitationCapabilities | null;
546
+ /**
547
+ * File system capabilities supported by the client.
548
+ * Determines which file operations the agent can request.
549
+ */
550
+ fs?: FileSystemCapabilities;
551
+ /**
552
+ * Whether the Client support all `terminal*` methods.
553
+ */
554
+ terminal?: boolean;
555
+ };
556
+ export type ClientNotification = {
557
+ method: string;
558
+ params?: CancelNotification | ExtNotification | null;
559
+ };
560
+ export type ClientRequest = {
561
+ id: RequestId;
562
+ method: string;
563
+ params?: InitializeRequest | AuthenticateRequest | LogoutRequest | NewSessionRequest | LoadSessionRequest | ListSessionsRequest | ForkSessionRequest | ResumeSessionRequest | CloseSessionRequest | SetSessionModeRequest | SetSessionConfigOptionRequest | PromptRequest | SetSessionModelRequest | ExtRequest | null;
564
+ };
565
+ export type ClientResponse = {
566
+ id: RequestId;
567
+ /**
568
+ * All possible responses that a client can send to an agent.
569
+ *
570
+ * This enum is used internally for routing RPC responses. You typically won't need
571
+ * to use this directly - the responses are handled automatically by the connection.
572
+ *
573
+ * These are responses to the corresponding `AgentRequest` variants.
574
+ */
575
+ result: WriteTextFileResponse | ReadTextFileResponse | RequestPermissionResponse | CreateTerminalResponse | TerminalOutputResponse | ReleaseTerminalResponse | WaitForTerminalExitResponse | KillTerminalResponse | ElicitationResponse | ExtResponse;
576
+ } | {
577
+ error: Error;
578
+ id: RequestId;
579
+ };
580
+ /**
581
+ * **UNSTABLE**
582
+ *
583
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
584
+ *
585
+ * Request parameters for closing an active session.
586
+ *
587
+ * If supported, the agent **must** cancel any ongoing work related to the session
588
+ * (treat it as if `session/cancel` was called) and then free up any resources
589
+ * associated with the session.
590
+ *
591
+ * Only available if the Agent supports the `session.close` capability.
592
+ *
593
+ * @experimental
594
+ */
595
+ export type CloseSessionRequest = {
596
+ /**
597
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
598
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
599
+ * these keys.
600
+ *
601
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
602
+ */
603
+ _meta?: {
604
+ [key: string]: unknown;
605
+ } | null;
606
+ /**
607
+ * The ID of the session to close.
608
+ */
609
+ sessionId: SessionId;
610
+ };
611
+ /**
612
+ * **UNSTABLE**
613
+ *
614
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
615
+ *
616
+ * Response from closing a session.
617
+ *
618
+ * @experimental
619
+ */
620
+ export type CloseSessionResponse = {
621
+ /**
622
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
623
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
624
+ * these keys.
625
+ *
626
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
627
+ */
628
+ _meta?: {
629
+ [key: string]: unknown;
630
+ } | null;
631
+ };
632
+ /**
633
+ * Session configuration options have been updated.
634
+ */
635
+ export type ConfigOptionUpdate = {
636
+ /**
637
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
638
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
639
+ * these keys.
640
+ *
641
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
642
+ */
643
+ _meta?: {
644
+ [key: string]: unknown;
645
+ } | null;
646
+ /**
647
+ * The full set of configuration options and their current values.
648
+ */
649
+ configOptions: Array<SessionConfigOption>;
650
+ };
651
+ /**
652
+ * Standard content block (text, images, resources).
653
+ */
654
+ export type Content = {
655
+ /**
656
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
657
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
658
+ * these keys.
659
+ *
660
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
661
+ */
662
+ _meta?: {
663
+ [key: string]: unknown;
664
+ } | null;
665
+ /**
666
+ * The actual content block.
667
+ */
668
+ content: ContentBlock;
669
+ };
670
+ /**
671
+ * Content blocks represent displayable information in the Agent Client Protocol.
672
+ *
673
+ * They provide a structured way to handle various types of user-facing content—whether
674
+ * it's text from language models, images for analysis, or embedded resources for context.
675
+ *
676
+ * Content blocks appear in:
677
+ * - User prompts sent via `session/prompt`
678
+ * - Language model output streamed through `session/update` notifications
679
+ * - Progress updates and results from tool calls
680
+ *
681
+ * This structure is compatible with the Model Context Protocol (MCP), enabling
682
+ * agents to seamlessly forward content from MCP tool outputs without transformation.
683
+ *
684
+ * See protocol docs: [Content](https://agentclientprotocol.com/protocol/content)
685
+ */
686
+ export type ContentBlock = (TextContent & {
687
+ type: "text";
688
+ }) | (ImageContent & {
689
+ type: "image";
690
+ }) | (AudioContent & {
691
+ type: "audio";
692
+ }) | (ResourceLink & {
693
+ type: "resource_link";
694
+ }) | (EmbeddedResource & {
695
+ type: "resource";
696
+ });
697
+ /**
698
+ * A streamed item of content
699
+ */
700
+ export type ContentChunk = {
701
+ /**
702
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
703
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
704
+ * these keys.
705
+ *
706
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
707
+ */
708
+ _meta?: {
709
+ [key: string]: unknown;
710
+ } | null;
711
+ /**
712
+ * A single item of content
713
+ */
714
+ content: ContentBlock;
715
+ /**
716
+ * **UNSTABLE**
717
+ *
718
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
719
+ *
720
+ * A unique identifier for the message this chunk belongs to.
721
+ *
722
+ * All chunks belonging to the same message share the same `messageId`.
723
+ * A change in `messageId` indicates a new message has started.
724
+ * Both clients and agents MUST use UUID format for message IDs.
725
+ *
726
+ * @experimental
727
+ */
728
+ messageId?: string | null;
729
+ };
730
+ /**
731
+ * **UNSTABLE**
732
+ *
733
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
734
+ *
735
+ * Cost information for a session.
736
+ *
737
+ * @experimental
738
+ */
739
+ export type Cost = {
740
+ /**
741
+ * Total cumulative cost for session.
742
+ */
743
+ amount: number;
744
+ /**
745
+ * ISO 4217 currency code (e.g., "USD", "EUR").
746
+ */
747
+ currency: string;
748
+ };
749
+ /**
750
+ * Request to create a new terminal and execute a command.
751
+ */
752
+ export type CreateTerminalRequest = {
753
+ /**
754
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
755
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
756
+ * these keys.
757
+ *
758
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
759
+ */
760
+ _meta?: {
761
+ [key: string]: unknown;
762
+ } | null;
763
+ /**
764
+ * Array of command arguments.
765
+ */
766
+ args?: Array<string>;
767
+ /**
768
+ * The command to execute.
769
+ */
770
+ command: string;
771
+ /**
772
+ * Working directory for the command (absolute path).
773
+ */
774
+ cwd?: string | null;
775
+ /**
776
+ * Environment variables for the command.
777
+ */
778
+ env?: Array<EnvVariable>;
779
+ /**
780
+ * Maximum number of output bytes to retain.
781
+ *
782
+ * When the limit is exceeded, the Client truncates from the beginning of the output
783
+ * to stay within the limit.
784
+ *
785
+ * The Client MUST ensure truncation happens at a character boundary to maintain valid
786
+ * string output, even if this means the retained output is slightly less than the
787
+ * specified limit.
788
+ */
789
+ outputByteLimit?: number | null;
790
+ /**
791
+ * The session ID for this request.
792
+ */
793
+ sessionId: SessionId;
794
+ };
795
+ /**
796
+ * Response containing the ID of the created terminal.
797
+ */
798
+ export type CreateTerminalResponse = {
799
+ /**
800
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
801
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
802
+ * these keys.
803
+ *
804
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
805
+ */
806
+ _meta?: {
807
+ [key: string]: unknown;
808
+ } | null;
809
+ /**
810
+ * The unique identifier for the created terminal.
811
+ */
812
+ terminalId: string;
813
+ };
814
+ /**
815
+ * The current mode of the session has changed
816
+ *
817
+ * See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
818
+ */
819
+ export type CurrentModeUpdate = {
820
+ /**
821
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
822
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
823
+ * these keys.
824
+ *
825
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
826
+ */
827
+ _meta?: {
828
+ [key: string]: unknown;
829
+ } | null;
830
+ /**
831
+ * The ID of the current mode
832
+ */
833
+ currentModeId: SessionModeId;
834
+ };
835
+ /**
836
+ * A diff representing file modifications.
837
+ *
838
+ * Shows changes to files in a format suitable for display in the client UI.
839
+ *
840
+ * See protocol docs: [Content](https://agentclientprotocol.com/protocol/tool-calls#content)
841
+ */
842
+ export type Diff = {
843
+ /**
844
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
845
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
846
+ * these keys.
847
+ *
848
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
849
+ */
850
+ _meta?: {
851
+ [key: string]: unknown;
852
+ } | null;
853
+ /**
854
+ * The new content after modification.
855
+ */
856
+ newText: string;
857
+ /**
858
+ * The original content (None for new files).
859
+ */
860
+ oldText?: string | null;
861
+ /**
862
+ * The file path being modified.
863
+ */
864
+ path: string;
865
+ };
866
+ /**
867
+ * **UNSTABLE**
868
+ *
869
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
870
+ *
871
+ * The user accepted the elicitation and provided content.
872
+ *
873
+ * @experimental
874
+ */
875
+ export type ElicitationAcceptAction = {
876
+ /**
877
+ * The user-provided content, if any, as an object matching the requested schema.
878
+ */
879
+ content?: {
880
+ [key: string]: ElicitationContentValue;
881
+ } | null;
882
+ };
883
+ /**
884
+ * **UNSTABLE**
885
+ *
886
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
887
+ *
888
+ * The user's action in response to an elicitation.
889
+ *
890
+ * @experimental
891
+ */
892
+ export type ElicitationAction = (ElicitationAcceptAction & {
893
+ action: "accept";
894
+ }) | {
895
+ action: "decline";
896
+ } | {
897
+ action: "cancel";
898
+ };
899
+ /**
900
+ * **UNSTABLE**
901
+ *
902
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
903
+ *
904
+ * Elicitation capabilities supported by the client.
905
+ *
906
+ * @experimental
907
+ */
908
+ export type ElicitationCapabilities = {
909
+ /**
910
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
911
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
912
+ * these keys.
913
+ *
914
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
915
+ */
916
+ _meta?: {
917
+ [key: string]: unknown;
918
+ } | null;
919
+ /**
920
+ * Whether the client supports form-based elicitation.
921
+ */
922
+ form?: ElicitationFormCapabilities | null;
923
+ /**
924
+ * Whether the client supports URL-based elicitation.
925
+ */
926
+ url?: ElicitationUrlCapabilities | null;
927
+ };
928
+ /**
929
+ * **UNSTABLE**
930
+ *
931
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
932
+ *
933
+ * Notification sent by the agent when a URL-based elicitation is complete.
934
+ *
935
+ * @experimental
936
+ */
937
+ export type ElicitationCompleteNotification = {
938
+ /**
939
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
940
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
941
+ * these keys.
942
+ *
943
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
944
+ */
945
+ _meta?: {
946
+ [key: string]: unknown;
947
+ } | null;
948
+ /**
949
+ * The ID of the elicitation that completed.
950
+ */
951
+ elicitationId: ElicitationId;
952
+ };
953
+ export type ElicitationContentValue = string | number | number | boolean | Array<string>;
954
+ /**
955
+ * **UNSTABLE**
956
+ *
957
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
958
+ *
959
+ * Form-based elicitation capabilities.
960
+ *
961
+ * @experimental
962
+ */
963
+ export type ElicitationFormCapabilities = {
964
+ /**
965
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
966
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
967
+ * these keys.
968
+ *
969
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
970
+ */
971
+ _meta?: {
972
+ [key: string]: unknown;
973
+ } | null;
974
+ };
975
+ /**
976
+ * **UNSTABLE**
977
+ *
978
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
979
+ *
980
+ * Form-based elicitation mode where the client renders a form from the provided schema.
981
+ *
982
+ * @experimental
983
+ */
984
+ export type ElicitationFormMode = {
985
+ /**
986
+ * A JSON Schema describing the form fields to present to the user.
987
+ */
988
+ requestedSchema: ElicitationSchema;
989
+ };
990
+ /**
991
+ * **UNSTABLE**
992
+ *
993
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
994
+ *
995
+ * Unique identifier for an elicitation.
996
+ *
997
+ * @experimental
998
+ */
999
+ export type ElicitationId = string;
1000
+ /**
1001
+ * Property schema for elicitation form fields.
1002
+ *
1003
+ * Each variant corresponds to a JSON Schema `"type"` value.
1004
+ * Single-select enums use the `String` variant with `enum` or `oneOf` set.
1005
+ * Multi-select enums use the `Array` variant.
1006
+ */
1007
+ export type ElicitationPropertySchema = (StringPropertySchema & {
1008
+ type: "string";
1009
+ }) | (NumberPropertySchema & {
1010
+ type: "number";
1011
+ }) | (IntegerPropertySchema & {
1012
+ type: "integer";
1013
+ }) | (BooleanPropertySchema & {
1014
+ type: "boolean";
1015
+ }) | (MultiSelectPropertySchema & {
1016
+ type: "array";
1017
+ });
1018
+ export type ElicitationRequest = ((ElicitationFormMode & {
1019
+ mode: "form";
1020
+ }) | (ElicitationUrlMode & {
1021
+ mode: "url";
1022
+ })) & {
1023
+ /**
1024
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1025
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1026
+ * these keys.
1027
+ *
1028
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1029
+ */
1030
+ _meta?: {
1031
+ [key: string]: unknown;
1032
+ } | null;
1033
+ /**
1034
+ * A human-readable message describing what input is needed.
1035
+ */
1036
+ message: string;
1037
+ /**
1038
+ * The session ID for this request.
1039
+ */
1040
+ sessionId: SessionId;
1041
+ };
1042
+ /**
1043
+ * **UNSTABLE**
1044
+ *
1045
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1046
+ *
1047
+ * Response from the client to an elicitation request.
1048
+ *
1049
+ * @experimental
1050
+ */
1051
+ export type ElicitationResponse = {
1052
+ /**
1053
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1054
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1055
+ * these keys.
1056
+ *
1057
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1058
+ */
1059
+ _meta?: {
1060
+ [key: string]: unknown;
1061
+ } | null;
1062
+ /**
1063
+ * The user's action in response to the elicitation.
1064
+ */
1065
+ action: ElicitationAction;
1066
+ };
1067
+ /**
1068
+ * Type-safe elicitation schema for requesting structured user input.
1069
+ *
1070
+ * This represents a JSON Schema object with primitive-typed properties,
1071
+ * as required by the elicitation specification.
1072
+ */
1073
+ export type ElicitationSchema = {
1074
+ /**
1075
+ * Optional description of what this schema represents.
1076
+ */
1077
+ description?: string | null;
1078
+ /**
1079
+ * Property definitions (must be primitive types).
1080
+ */
1081
+ properties?: {
1082
+ [key: string]: ElicitationPropertySchema;
1083
+ };
1084
+ /**
1085
+ * List of required property names.
1086
+ */
1087
+ required?: Array<string> | null;
1088
+ /**
1089
+ * Optional title for the schema.
1090
+ */
1091
+ title?: string | null;
1092
+ /**
1093
+ * Type discriminator. Always `"object"`.
1094
+ */
1095
+ type?: ElicitationSchemaType;
1096
+ };
1097
+ /**
1098
+ * Object schema type.
1099
+ */
1100
+ export type ElicitationSchemaType = "object";
1101
+ /**
1102
+ * String schema type.
1103
+ */
1104
+ export type ElicitationStringType = "string";
1105
+ /**
1106
+ * **UNSTABLE**
1107
+ *
1108
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1109
+ *
1110
+ * URL-based elicitation capabilities.
1111
+ *
1112
+ * @experimental
1113
+ */
1114
+ export type ElicitationUrlCapabilities = {
1115
+ /**
1116
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1117
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1118
+ * these keys.
1119
+ *
1120
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1121
+ */
1122
+ _meta?: {
1123
+ [key: string]: unknown;
1124
+ } | null;
1125
+ };
1126
+ /**
1127
+ * **UNSTABLE**
1128
+ *
1129
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1130
+ *
1131
+ * URL-based elicitation mode where the client directs the user to a URL.
1132
+ *
1133
+ * @experimental
1134
+ */
1135
+ export type ElicitationUrlMode = {
1136
+ /**
1137
+ * The unique identifier for this elicitation.
1138
+ */
1139
+ elicitationId: ElicitationId;
1140
+ /**
1141
+ * The URL to direct the user to.
1142
+ */
1143
+ url: string;
1144
+ };
1145
+ /**
1146
+ * The contents of a resource, embedded into a prompt or tool call result.
1147
+ */
1148
+ export type EmbeddedResource = {
1149
+ /**
1150
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1151
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1152
+ * these keys.
1153
+ *
1154
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1155
+ */
1156
+ _meta?: {
1157
+ [key: string]: unknown;
1158
+ } | null;
1159
+ annotations?: Annotations | null;
1160
+ resource: EmbeddedResourceResource;
1161
+ };
1162
+ /**
1163
+ * Resource content that can be embedded in a message.
1164
+ */
1165
+ export type EmbeddedResourceResource = TextResourceContents | BlobResourceContents;
1166
+ /**
1167
+ * A titled enum option with a const value and human-readable title.
1168
+ */
1169
+ export type EnumOption = {
1170
+ /**
1171
+ * The constant value for this option.
1172
+ */
1173
+ const: string;
1174
+ /**
1175
+ * Human-readable title for this option.
1176
+ */
1177
+ title: string;
1178
+ };
1179
+ /**
1180
+ * An environment variable to set when launching an MCP server.
1181
+ */
1182
+ export type EnvVariable = {
1183
+ /**
1184
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1185
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1186
+ * these keys.
1187
+ *
1188
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1189
+ */
1190
+ _meta?: {
1191
+ [key: string]: unknown;
1192
+ } | null;
1193
+ /**
1194
+ * The name of the environment variable.
1195
+ */
1196
+ name: string;
1197
+ /**
1198
+ * The value to set for the environment variable.
1199
+ */
1200
+ value: string;
1201
+ };
1202
+ /**
1203
+ * JSON-RPC error object.
1204
+ *
1205
+ * Represents an error that occurred during method execution, following the
1206
+ * JSON-RPC 2.0 error object specification with optional additional data.
1207
+ *
1208
+ * See protocol docs: [JSON-RPC Error Object](https://www.jsonrpc.org/specification#error_object)
1209
+ */
1210
+ export type Error = {
1211
+ /**
1212
+ * A number indicating the error type that occurred.
1213
+ * This must be an integer as defined in the JSON-RPC specification.
1214
+ */
1215
+ code: ErrorCode;
1216
+ /**
1217
+ * Optional primitive or structured value that contains additional information about the error.
1218
+ * This may include debugging information or context-specific details.
1219
+ */
1220
+ data?: unknown;
1221
+ /**
1222
+ * A string providing a short description of the error.
1223
+ * The message should be limited to a concise single sentence.
1224
+ */
1225
+ message: string;
1226
+ };
1227
+ /**
1228
+ * Predefined error codes for common JSON-RPC and ACP-specific errors.
1229
+ *
1230
+ * These codes follow the JSON-RPC 2.0 specification for standard errors
1231
+ * and use the reserved range (-32000 to -32099) for protocol-specific errors.
1232
+ */
1233
+ export type ErrorCode = -32700 | -32600 | -32601 | -32602 | -32603 | -32800 | -32000 | -32002 | -32042 | number;
1234
+ /**
1235
+ * Allows the Agent to send an arbitrary notification that is not part of the ACP spec.
1236
+ * Extension notifications provide a way to send one-way messages for custom functionality
1237
+ * while maintaining protocol compatibility.
1238
+ *
1239
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1240
+ */
1241
+ export type ExtNotification = unknown;
1242
+ /**
1243
+ * Allows for sending an arbitrary request that is not part of the ACP spec.
1244
+ * Extension methods provide a way to add custom functionality while maintaining
1245
+ * protocol compatibility.
1246
+ *
1247
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1248
+ */
1249
+ export type ExtRequest = unknown;
1250
+ /**
1251
+ * Allows for sending an arbitrary response to an [`ExtRequest`] that is not part of the ACP spec.
1252
+ * Extension methods provide a way to add custom functionality while maintaining
1253
+ * protocol compatibility.
1254
+ *
1255
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1256
+ */
1257
+ export type ExtResponse = unknown;
1258
+ /**
1259
+ * File system capabilities that a client may support.
1260
+ *
1261
+ * See protocol docs: [FileSystem](https://agentclientprotocol.com/protocol/initialization#filesystem)
1262
+ */
1263
+ export type FileSystemCapabilities = {
1264
+ /**
1265
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1266
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1267
+ * these keys.
1268
+ *
1269
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1270
+ */
1271
+ _meta?: {
1272
+ [key: string]: unknown;
1273
+ } | null;
1274
+ /**
1275
+ * Whether the Client supports `fs/read_text_file` requests.
1276
+ */
1277
+ readTextFile?: boolean;
1278
+ /**
1279
+ * Whether the Client supports `fs/write_text_file` requests.
1280
+ */
1281
+ writeTextFile?: boolean;
1282
+ };
1283
+ /**
1284
+ * **UNSTABLE**
1285
+ *
1286
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1287
+ *
1288
+ * Request parameters for forking an existing session.
1289
+ *
1290
+ * Creates a new session based on the context of an existing one, allowing
1291
+ * operations like generating summaries without affecting the original session's history.
1292
+ *
1293
+ * Only available if the Agent supports the `session.fork` capability.
1294
+ *
1295
+ * @experimental
1296
+ */
1297
+ export type ForkSessionRequest = {
1298
+ /**
1299
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1300
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1301
+ * these keys.
1302
+ *
1303
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1304
+ */
1305
+ _meta?: {
1306
+ [key: string]: unknown;
1307
+ } | null;
1308
+ /**
1309
+ * The working directory for this session.
1310
+ */
1311
+ cwd: string;
1312
+ /**
1313
+ * List of MCP servers to connect to for this session.
1314
+ */
1315
+ mcpServers?: Array<McpServer>;
1316
+ /**
1317
+ * The ID of the session to fork.
1318
+ */
1319
+ sessionId: SessionId;
1320
+ };
1321
+ /**
1322
+ * **UNSTABLE**
1323
+ *
1324
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1325
+ *
1326
+ * Response from forking an existing session.
1327
+ *
1328
+ * @experimental
1329
+ */
1330
+ export type ForkSessionResponse = {
1331
+ /**
1332
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1333
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1334
+ * these keys.
1335
+ *
1336
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1337
+ */
1338
+ _meta?: {
1339
+ [key: string]: unknown;
1340
+ } | null;
1341
+ /**
1342
+ * Initial session configuration options if supported by the Agent.
1343
+ */
1344
+ configOptions?: Array<SessionConfigOption> | null;
1345
+ /**
1346
+ * **UNSTABLE**
1347
+ *
1348
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1349
+ *
1350
+ * Initial model state if supported by the Agent
1351
+ *
1352
+ * @experimental
1353
+ */
1354
+ models?: SessionModelState | null;
1355
+ /**
1356
+ * Initial mode state if supported by the Agent
1357
+ *
1358
+ * See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
1359
+ */
1360
+ modes?: SessionModeState | null;
1361
+ /**
1362
+ * Unique identifier for the newly created forked session.
1363
+ */
1364
+ sessionId: SessionId;
1365
+ };
1366
+ /**
1367
+ * An HTTP header to set when making requests to the MCP server.
1368
+ */
1369
+ export type HttpHeader = {
1370
+ /**
1371
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1372
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1373
+ * these keys.
1374
+ *
1375
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1376
+ */
1377
+ _meta?: {
1378
+ [key: string]: unknown;
1379
+ } | null;
1380
+ /**
1381
+ * The name of the HTTP header.
1382
+ */
1383
+ name: string;
1384
+ /**
1385
+ * The value to set for the HTTP header.
1386
+ */
1387
+ value: string;
1388
+ };
1389
+ /**
1390
+ * An image provided to or from an LLM.
1391
+ */
1392
+ export type ImageContent = {
1393
+ /**
1394
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1395
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1396
+ * these keys.
1397
+ *
1398
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1399
+ */
1400
+ _meta?: {
1401
+ [key: string]: unknown;
1402
+ } | null;
1403
+ annotations?: Annotations | null;
1404
+ data: string;
1405
+ mimeType: string;
1406
+ uri?: string | null;
1407
+ };
1408
+ /**
1409
+ * Metadata about the implementation of the client or agent.
1410
+ * Describes the name and version of an MCP implementation, with an optional
1411
+ * title for UI representation.
1412
+ */
1413
+ export type Implementation = {
1414
+ /**
1415
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1416
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1417
+ * these keys.
1418
+ *
1419
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1420
+ */
1421
+ _meta?: {
1422
+ [key: string]: unknown;
1423
+ } | null;
1424
+ /**
1425
+ * Intended for programmatic or logical use, but can be used as a display
1426
+ * name fallback if title isn’t present.
1427
+ */
1428
+ name: string;
1429
+ /**
1430
+ * Intended for UI and end-user contexts — optimized to be human-readable
1431
+ * and easily understood.
1432
+ *
1433
+ * If not provided, the name should be used for display.
1434
+ */
1435
+ title?: string | null;
1436
+ /**
1437
+ * Version of the implementation. Can be displayed to the user or used
1438
+ * for debugging or metrics purposes. (e.g. "1.0.0").
1439
+ */
1440
+ version: string;
1441
+ };
1442
+ /**
1443
+ * Request parameters for the initialize method.
1444
+ *
1445
+ * Sent by the client to establish connection and negotiate capabilities.
1446
+ *
1447
+ * See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)
1448
+ */
1449
+ export type InitializeRequest = {
1450
+ /**
1451
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1452
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1453
+ * these keys.
1454
+ *
1455
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1456
+ */
1457
+ _meta?: {
1458
+ [key: string]: unknown;
1459
+ } | null;
1460
+ /**
1461
+ * Capabilities supported by the client.
1462
+ */
1463
+ clientCapabilities?: ClientCapabilities;
1464
+ /**
1465
+ * Information about the Client name and version sent to the Agent.
1466
+ *
1467
+ * Note: in future versions of the protocol, this will be required.
1468
+ */
1469
+ clientInfo?: Implementation | null;
1470
+ /**
1471
+ * The latest protocol version supported by the client.
1472
+ */
1473
+ protocolVersion: ProtocolVersion;
1474
+ };
1475
+ /**
1476
+ * Response to the `initialize` method.
1477
+ *
1478
+ * Contains the negotiated protocol version and agent capabilities.
1479
+ *
1480
+ * See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)
1481
+ */
1482
+ export type InitializeResponse = {
1483
+ /**
1484
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1485
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1486
+ * these keys.
1487
+ *
1488
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1489
+ */
1490
+ _meta?: {
1491
+ [key: string]: unknown;
1492
+ } | null;
1493
+ /**
1494
+ * Capabilities supported by the agent.
1495
+ */
1496
+ agentCapabilities?: AgentCapabilities;
1497
+ /**
1498
+ * Information about the Agent name and version sent to the Client.
1499
+ *
1500
+ * Note: in future versions of the protocol, this will be required.
1501
+ */
1502
+ agentInfo?: Implementation | null;
1503
+ /**
1504
+ * Authentication methods supported by the agent.
1505
+ */
1506
+ authMethods?: Array<AuthMethod>;
1507
+ /**
1508
+ * The protocol version the client specified if supported by the agent,
1509
+ * or the latest protocol version supported by the agent.
1510
+ *
1511
+ * The client should disconnect, if it doesn't support this version.
1512
+ */
1513
+ protocolVersion: ProtocolVersion;
1514
+ };
1515
+ /**
1516
+ * Schema for integer properties in an elicitation form.
1517
+ */
1518
+ export type IntegerPropertySchema = {
1519
+ /**
1520
+ * Default value.
1521
+ */
1522
+ default?: number | null;
1523
+ /**
1524
+ * Human-readable description.
1525
+ */
1526
+ description?: string | null;
1527
+ /**
1528
+ * Maximum value (inclusive).
1529
+ */
1530
+ maximum?: number | null;
1531
+ /**
1532
+ * Minimum value (inclusive).
1533
+ */
1534
+ minimum?: number | null;
1535
+ /**
1536
+ * Optional title for the property.
1537
+ */
1538
+ title?: string | null;
1539
+ };
1540
+ /**
1541
+ * Request to kill a terminal without releasing it.
1542
+ */
1543
+ export type KillTerminalRequest = {
1544
+ /**
1545
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1546
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1547
+ * these keys.
1548
+ *
1549
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1550
+ */
1551
+ _meta?: {
1552
+ [key: string]: unknown;
1553
+ } | null;
1554
+ /**
1555
+ * The session ID for this request.
1556
+ */
1557
+ sessionId: SessionId;
1558
+ /**
1559
+ * The ID of the terminal to kill.
1560
+ */
1561
+ terminalId: string;
1562
+ };
1563
+ /**
1564
+ * Response to `terminal/kill` method
1565
+ */
1566
+ export type KillTerminalResponse = {
1567
+ /**
1568
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1569
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1570
+ * these keys.
1571
+ *
1572
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1573
+ */
1574
+ _meta?: {
1575
+ [key: string]: unknown;
1576
+ } | null;
1577
+ };
1578
+ /**
1579
+ * Request parameters for listing existing sessions.
1580
+ *
1581
+ * Only available if the Agent supports the `sessionCapabilities.list` capability.
1582
+ */
1583
+ export type ListSessionsRequest = {
1584
+ /**
1585
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1586
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1587
+ * these keys.
1588
+ *
1589
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1590
+ */
1591
+ _meta?: {
1592
+ [key: string]: unknown;
1593
+ } | null;
1594
+ /**
1595
+ * Opaque cursor token from a previous response's nextCursor field for cursor-based pagination
1596
+ */
1597
+ cursor?: string | null;
1598
+ /**
1599
+ * Filter sessions by working directory. Must be an absolute path.
1600
+ */
1601
+ cwd?: string | null;
1602
+ };
1603
+ /**
1604
+ * Response from listing sessions.
1605
+ */
1606
+ export type ListSessionsResponse = {
1607
+ /**
1608
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1609
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1610
+ * these keys.
1611
+ *
1612
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1613
+ */
1614
+ _meta?: {
1615
+ [key: string]: unknown;
1616
+ } | null;
1617
+ /**
1618
+ * Opaque cursor token. If present, pass this in the next request's cursor parameter
1619
+ * to fetch the next page. If absent, there are no more results.
1620
+ */
1621
+ nextCursor?: string | null;
1622
+ /**
1623
+ * Array of session information objects
1624
+ */
1625
+ sessions: Array<SessionInfo>;
1626
+ };
1627
+ /**
1628
+ * Request parameters for loading an existing session.
1629
+ *
1630
+ * Only available if the Agent supports the `loadSession` capability.
1631
+ *
1632
+ * See protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/session-setup#loading-sessions)
1633
+ */
1634
+ export type LoadSessionRequest = {
1635
+ /**
1636
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1637
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1638
+ * these keys.
1639
+ *
1640
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1641
+ */
1642
+ _meta?: {
1643
+ [key: string]: unknown;
1644
+ } | null;
1645
+ /**
1646
+ * The working directory for this session.
1647
+ */
1648
+ cwd: string;
1649
+ /**
1650
+ * List of MCP servers to connect to for this session.
1651
+ */
1652
+ mcpServers: Array<McpServer>;
1653
+ /**
1654
+ * The ID of the session to load.
1655
+ */
1656
+ sessionId: SessionId;
1657
+ };
1658
+ /**
1659
+ * Response from loading an existing session.
1660
+ */
1661
+ export type LoadSessionResponse = {
1662
+ /**
1663
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1664
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1665
+ * these keys.
1666
+ *
1667
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1668
+ */
1669
+ _meta?: {
1670
+ [key: string]: unknown;
1671
+ } | null;
1672
+ /**
1673
+ * Initial session configuration options if supported by the Agent.
1674
+ */
1675
+ configOptions?: Array<SessionConfigOption> | null;
1676
+ /**
1677
+ * **UNSTABLE**
1678
+ *
1679
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1680
+ *
1681
+ * Initial model state if supported by the Agent
1682
+ *
1683
+ * @experimental
1684
+ */
1685
+ models?: SessionModelState | null;
1686
+ /**
1687
+ * Initial mode state if supported by the Agent
1688
+ *
1689
+ * See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
1690
+ */
1691
+ modes?: SessionModeState | null;
1692
+ };
1693
+ /**
1694
+ * **UNSTABLE**
1695
+ *
1696
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1697
+ *
1698
+ * Logout capabilities supported by the agent.
1699
+ *
1700
+ * By supplying `{}` it means that the agent supports the logout method.
1701
+ *
1702
+ * @experimental
1703
+ */
1704
+ export type LogoutCapabilities = {
1705
+ /**
1706
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1707
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1708
+ * these keys.
1709
+ *
1710
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1711
+ */
1712
+ _meta?: {
1713
+ [key: string]: unknown;
1714
+ } | null;
1715
+ };
1716
+ /**
1717
+ * **UNSTABLE**
1718
+ *
1719
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1720
+ *
1721
+ * Request parameters for the logout method.
1722
+ *
1723
+ * Terminates the current authenticated session.
1724
+ *
1725
+ * @experimental
1726
+ */
1727
+ export type LogoutRequest = {
1728
+ /**
1729
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1730
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1731
+ * these keys.
1732
+ *
1733
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1734
+ */
1735
+ _meta?: {
1736
+ [key: string]: unknown;
1737
+ } | null;
1738
+ };
1739
+ /**
1740
+ * **UNSTABLE**
1741
+ *
1742
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1743
+ *
1744
+ * Response to the `logout` method.
1745
+ *
1746
+ * @experimental
1747
+ */
1748
+ export type LogoutResponse = {
1749
+ /**
1750
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1751
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1752
+ * these keys.
1753
+ *
1754
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1755
+ */
1756
+ _meta?: {
1757
+ [key: string]: unknown;
1758
+ } | null;
1759
+ };
1760
+ /**
1761
+ * MCP capabilities supported by the agent
1762
+ */
1763
+ export type McpCapabilities = {
1764
+ /**
1765
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1766
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1767
+ * these keys.
1768
+ *
1769
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1770
+ */
1771
+ _meta?: {
1772
+ [key: string]: unknown;
1773
+ } | null;
1774
+ /**
1775
+ * Agent supports [`McpServer::Http`].
1776
+ */
1777
+ http?: boolean;
1778
+ /**
1779
+ * Agent supports [`McpServer::Sse`].
1780
+ */
1781
+ sse?: boolean;
1782
+ };
1783
+ /**
1784
+ * Configuration for connecting to an MCP (Model Context Protocol) server.
1785
+ *
1786
+ * MCP servers provide tools and context that the agent can use when
1787
+ * processing prompts.
1788
+ *
1789
+ * See protocol docs: [MCP Servers](https://agentclientprotocol.com/protocol/session-setup#mcp-servers)
1790
+ */
1791
+ export type McpServer = (McpServerHttp & {
1792
+ type: "http";
1793
+ }) | (McpServerSse & {
1794
+ type: "sse";
1795
+ }) | McpServerStdio;
1796
+ /**
1797
+ * HTTP transport configuration for MCP.
1798
+ */
1799
+ export type McpServerHttp = {
1800
+ /**
1801
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1802
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1803
+ * these keys.
1804
+ *
1805
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1806
+ */
1807
+ _meta?: {
1808
+ [key: string]: unknown;
1809
+ } | null;
1810
+ /**
1811
+ * HTTP headers to set when making requests to the MCP server.
1812
+ */
1813
+ headers: Array<HttpHeader>;
1814
+ /**
1815
+ * Human-readable name identifying this MCP server.
1816
+ */
1817
+ name: string;
1818
+ /**
1819
+ * URL to the MCP server.
1820
+ */
1821
+ url: string;
1822
+ };
1823
+ /**
1824
+ * SSE transport configuration for MCP.
1825
+ */
1826
+ export type McpServerSse = {
1827
+ /**
1828
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1829
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1830
+ * these keys.
1831
+ *
1832
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1833
+ */
1834
+ _meta?: {
1835
+ [key: string]: unknown;
1836
+ } | null;
1837
+ /**
1838
+ * HTTP headers to set when making requests to the MCP server.
1839
+ */
1840
+ headers: Array<HttpHeader>;
1841
+ /**
1842
+ * Human-readable name identifying this MCP server.
1843
+ */
1844
+ name: string;
1845
+ /**
1846
+ * URL to the MCP server.
1847
+ */
1848
+ url: string;
1849
+ };
1850
+ /**
1851
+ * Stdio transport configuration for MCP.
1852
+ */
1853
+ export type McpServerStdio = {
1854
+ /**
1855
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1856
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1857
+ * these keys.
1858
+ *
1859
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1860
+ */
1861
+ _meta?: {
1862
+ [key: string]: unknown;
1863
+ } | null;
1864
+ /**
1865
+ * Command-line arguments to pass to the MCP server.
1866
+ */
1867
+ args: Array<string>;
1868
+ /**
1869
+ * Path to the MCP server executable.
1870
+ */
1871
+ command: string;
1872
+ /**
1873
+ * Environment variables to set when launching the MCP server.
1874
+ */
1875
+ env: Array<EnvVariable>;
1876
+ /**
1877
+ * Human-readable name identifying this MCP server.
1878
+ */
1879
+ name: string;
1880
+ };
1881
+ /**
1882
+ * **UNSTABLE**
1883
+ *
1884
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1885
+ *
1886
+ * A unique identifier for a model.
1887
+ *
1888
+ * @experimental
1889
+ */
1890
+ export type ModelId = string;
1891
+ /**
1892
+ * **UNSTABLE**
1893
+ *
1894
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1895
+ *
1896
+ * Information about a selectable model.
1897
+ *
1898
+ * @experimental
1899
+ */
1900
+ export type ModelInfo = {
1901
+ /**
1902
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1903
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1904
+ * these keys.
1905
+ *
1906
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1907
+ */
1908
+ _meta?: {
1909
+ [key: string]: unknown;
1910
+ } | null;
1911
+ /**
1912
+ * Optional description of the model.
1913
+ */
1914
+ description?: string | null;
1915
+ /**
1916
+ * Unique identifier for the model.
1917
+ */
1918
+ modelId: ModelId;
1919
+ /**
1920
+ * Human-readable name of the model.
1921
+ */
1922
+ name: string;
1923
+ };
1924
+ /**
1925
+ * Items for a multi-select (array) property schema.
1926
+ */
1927
+ export type MultiSelectItems = UntitledMultiSelectItems | TitledMultiSelectItems;
1928
+ /**
1929
+ * Schema for multi-select (array) properties in an elicitation form.
1930
+ */
1931
+ export type MultiSelectPropertySchema = {
1932
+ /**
1933
+ * Default selected values.
1934
+ */
1935
+ default?: Array<string> | null;
1936
+ /**
1937
+ * Human-readable description.
1938
+ */
1939
+ description?: string | null;
1940
+ /**
1941
+ * The items definition describing allowed values.
1942
+ */
1943
+ items: MultiSelectItems;
1944
+ /**
1945
+ * Maximum number of items to select.
1946
+ */
1947
+ maxItems?: number | null;
1948
+ /**
1949
+ * Minimum number of items to select.
1950
+ */
1951
+ minItems?: number | null;
1952
+ /**
1953
+ * Optional title for the property.
1954
+ */
1955
+ title?: string | null;
1956
+ };
1957
+ /**
1958
+ * Request parameters for creating a new session.
1959
+ *
1960
+ * See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)
1961
+ */
1962
+ export type NewSessionRequest = {
1963
+ /**
1964
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1965
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1966
+ * these keys.
1967
+ *
1968
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1969
+ */
1970
+ _meta?: {
1971
+ [key: string]: unknown;
1972
+ } | null;
1973
+ /**
1974
+ * The working directory for this session. Must be an absolute path.
1975
+ */
1976
+ cwd: string;
1977
+ /**
1978
+ * List of MCP (Model Context Protocol) servers the agent should connect to.
1979
+ */
1980
+ mcpServers: Array<McpServer>;
1981
+ };
1982
+ /**
1983
+ * Response from creating a new session.
1984
+ *
1985
+ * See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)
1986
+ */
1987
+ export type NewSessionResponse = {
1988
+ /**
1989
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
1990
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
1991
+ * these keys.
1992
+ *
1993
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1994
+ */
1995
+ _meta?: {
1996
+ [key: string]: unknown;
1997
+ } | null;
1998
+ /**
1999
+ * Initial session configuration options if supported by the Agent.
2000
+ */
2001
+ configOptions?: Array<SessionConfigOption> | null;
2002
+ /**
2003
+ * **UNSTABLE**
2004
+ *
2005
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2006
+ *
2007
+ * Initial model state if supported by the Agent
2008
+ *
2009
+ * @experimental
2010
+ */
2011
+ models?: SessionModelState | null;
2012
+ /**
2013
+ * Initial mode state if supported by the Agent
2014
+ *
2015
+ * See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
2016
+ */
2017
+ modes?: SessionModeState | null;
2018
+ /**
2019
+ * Unique identifier for the created session.
2020
+ *
2021
+ * Used in all subsequent requests for this conversation.
2022
+ */
2023
+ sessionId: SessionId;
2024
+ };
2025
+ /**
2026
+ * Schema for number (floating-point) properties in an elicitation form.
2027
+ */
2028
+ export type NumberPropertySchema = {
2029
+ /**
2030
+ * Default value.
2031
+ */
2032
+ default?: number | null;
2033
+ /**
2034
+ * Human-readable description.
2035
+ */
2036
+ description?: string | null;
2037
+ /**
2038
+ * Maximum value (inclusive).
2039
+ */
2040
+ maximum?: number | null;
2041
+ /**
2042
+ * Minimum value (inclusive).
2043
+ */
2044
+ minimum?: number | null;
2045
+ /**
2046
+ * Optional title for the property.
2047
+ */
2048
+ title?: string | null;
2049
+ };
2050
+ /**
2051
+ * An option presented to the user when requesting permission.
2052
+ */
2053
+ export type PermissionOption = {
2054
+ /**
2055
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2056
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2057
+ * these keys.
2058
+ *
2059
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2060
+ */
2061
+ _meta?: {
2062
+ [key: string]: unknown;
2063
+ } | null;
2064
+ /**
2065
+ * Hint about the nature of this permission option.
2066
+ */
2067
+ kind: PermissionOptionKind;
2068
+ /**
2069
+ * Human-readable label to display to the user.
2070
+ */
2071
+ name: string;
2072
+ /**
2073
+ * Unique identifier for this permission option.
2074
+ */
2075
+ optionId: PermissionOptionId;
2076
+ };
2077
+ /**
2078
+ * Unique identifier for a permission option.
2079
+ */
2080
+ export type PermissionOptionId = string;
2081
+ /**
2082
+ * The type of permission option being presented to the user.
2083
+ *
2084
+ * Helps clients choose appropriate icons and UI treatment.
2085
+ */
2086
+ export type PermissionOptionKind = "allow_once" | "allow_always" | "reject_once" | "reject_always";
2087
+ /**
2088
+ * An execution plan for accomplishing complex tasks.
2089
+ *
2090
+ * Plans consist of multiple entries representing individual tasks or goals.
2091
+ * Agents report plans to clients to provide visibility into their execution strategy.
2092
+ * Plans can evolve during execution as the agent discovers new requirements or completes tasks.
2093
+ *
2094
+ * See protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan)
2095
+ */
2096
+ export type Plan = {
2097
+ /**
2098
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2099
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2100
+ * these keys.
2101
+ *
2102
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2103
+ */
2104
+ _meta?: {
2105
+ [key: string]: unknown;
2106
+ } | null;
2107
+ /**
2108
+ * The list of tasks to be accomplished.
2109
+ *
2110
+ * When updating a plan, the agent must send a complete list of all entries
2111
+ * with their current status. The client replaces the entire plan with each update.
2112
+ */
2113
+ entries: Array<PlanEntry>;
2114
+ };
2115
+ /**
2116
+ * A single entry in the execution plan.
2117
+ *
2118
+ * Represents a task or goal that the assistant intends to accomplish
2119
+ * as part of fulfilling the user's request.
2120
+ * See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)
2121
+ */
2122
+ export type PlanEntry = {
2123
+ /**
2124
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2125
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2126
+ * these keys.
2127
+ *
2128
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2129
+ */
2130
+ _meta?: {
2131
+ [key: string]: unknown;
2132
+ } | null;
2133
+ /**
2134
+ * Human-readable description of what this task aims to accomplish.
2135
+ */
2136
+ content: string;
2137
+ /**
2138
+ * The relative importance of this task.
2139
+ * Used to indicate which tasks are most critical to the overall goal.
2140
+ */
2141
+ priority: PlanEntryPriority;
2142
+ /**
2143
+ * Current execution status of this task.
2144
+ */
2145
+ status: PlanEntryStatus;
2146
+ };
2147
+ /**
2148
+ * Priority levels for plan entries.
2149
+ *
2150
+ * Used to indicate the relative importance or urgency of different
2151
+ * tasks in the execution plan.
2152
+ * See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)
2153
+ */
2154
+ export type PlanEntryPriority = "high" | "medium" | "low";
2155
+ /**
2156
+ * Status of a plan entry in the execution flow.
2157
+ *
2158
+ * Tracks the lifecycle of each task from planning through completion.
2159
+ * See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)
2160
+ */
2161
+ export type PlanEntryStatus = "pending" | "in_progress" | "completed";
2162
+ /**
2163
+ * Prompt capabilities supported by the agent in `session/prompt` requests.
2164
+ *
2165
+ * Baseline agent functionality requires support for [`ContentBlock::Text`]
2166
+ * and [`ContentBlock::ResourceLink`] in prompt requests.
2167
+ *
2168
+ * Other variants must be explicitly opted in to.
2169
+ * Capabilities for different types of content in prompt requests.
2170
+ *
2171
+ * Indicates which content types beyond the baseline (text and resource links)
2172
+ * the agent can process.
2173
+ *
2174
+ * See protocol docs: [Prompt Capabilities](https://agentclientprotocol.com/protocol/initialization#prompt-capabilities)
2175
+ */
2176
+ export type PromptCapabilities = {
2177
+ /**
2178
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2179
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2180
+ * these keys.
2181
+ *
2182
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2183
+ */
2184
+ _meta?: {
2185
+ [key: string]: unknown;
2186
+ } | null;
2187
+ /**
2188
+ * Agent supports [`ContentBlock::Audio`].
2189
+ */
2190
+ audio?: boolean;
2191
+ /**
2192
+ * Agent supports embedded context in `session/prompt` requests.
2193
+ *
2194
+ * When enabled, the Client is allowed to include [`ContentBlock::Resource`]
2195
+ * in prompt requests for pieces of context that are referenced in the message.
2196
+ */
2197
+ embeddedContext?: boolean;
2198
+ /**
2199
+ * Agent supports [`ContentBlock::Image`].
2200
+ */
2201
+ image?: boolean;
2202
+ };
2203
+ /**
2204
+ * Request parameters for sending a user prompt to the agent.
2205
+ *
2206
+ * Contains the user's message and any additional context.
2207
+ *
2208
+ * See protocol docs: [User Message](https://agentclientprotocol.com/protocol/prompt-turn#1-user-message)
2209
+ */
2210
+ export type PromptRequest = {
2211
+ /**
2212
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2213
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2214
+ * these keys.
2215
+ *
2216
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2217
+ */
2218
+ _meta?: {
2219
+ [key: string]: unknown;
2220
+ } | null;
2221
+ /**
2222
+ * **UNSTABLE**
2223
+ *
2224
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2225
+ *
2226
+ * A client-generated unique identifier for this user message.
2227
+ *
2228
+ * If provided, the Agent SHOULD echo this value as `userMessageId` in the
2229
+ * [`PromptResponse`] to confirm it was recorded.
2230
+ * Both clients and agents MUST use UUID format for message IDs.
2231
+ *
2232
+ * @experimental
2233
+ */
2234
+ messageId?: string | null;
2235
+ /**
2236
+ * The blocks of content that compose the user's message.
2237
+ *
2238
+ * As a baseline, the Agent MUST support [`ContentBlock::Text`] and [`ContentBlock::ResourceLink`],
2239
+ * while other variants are optionally enabled via [`PromptCapabilities`].
2240
+ *
2241
+ * The Client MUST adapt its interface according to [`PromptCapabilities`].
2242
+ *
2243
+ * The client MAY include referenced pieces of context as either
2244
+ * [`ContentBlock::Resource`] or [`ContentBlock::ResourceLink`].
2245
+ *
2246
+ * When available, [`ContentBlock::Resource`] is preferred
2247
+ * as it avoids extra round-trips and allows the message to include
2248
+ * pieces of context from sources the agent may not have access to.
2249
+ */
2250
+ prompt: Array<ContentBlock>;
2251
+ /**
2252
+ * The ID of the session to send this user message to
2253
+ */
2254
+ sessionId: SessionId;
2255
+ };
2256
+ /**
2257
+ * Response from processing a user prompt.
2258
+ *
2259
+ * See protocol docs: [Check for Completion](https://agentclientprotocol.com/protocol/prompt-turn#4-check-for-completion)
2260
+ */
2261
+ export type PromptResponse = {
2262
+ /**
2263
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2264
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2265
+ * these keys.
2266
+ *
2267
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2268
+ */
2269
+ _meta?: {
2270
+ [key: string]: unknown;
2271
+ } | null;
2272
+ /**
2273
+ * Indicates why the agent stopped processing the turn.
2274
+ */
2275
+ stopReason: StopReason;
2276
+ /**
2277
+ * **UNSTABLE**
2278
+ *
2279
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2280
+ *
2281
+ * Token usage for this turn (optional).
2282
+ *
2283
+ * @experimental
2284
+ */
2285
+ usage?: Usage | null;
2286
+ /**
2287
+ * **UNSTABLE**
2288
+ *
2289
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2290
+ *
2291
+ * The acknowledged user message ID.
2292
+ *
2293
+ * If the client provided a `messageId` in the [`PromptRequest`], the agent echoes it here
2294
+ * to confirm it was recorded. If the client did not provide one, the agent MAY assign one
2295
+ * and return it here. Absence of this field indicates the agent did not record a message ID.
2296
+ *
2297
+ * @experimental
2298
+ */
2299
+ userMessageId?: string | null;
2300
+ };
2301
+ /**
2302
+ * Protocol version identifier.
2303
+ *
2304
+ * This version is only bumped for breaking changes.
2305
+ * Non-breaking changes should be introduced via capabilities.
2306
+ */
2307
+ export type ProtocolVersion = number;
2308
+ /**
2309
+ * Request to read content from a text file.
2310
+ *
2311
+ * Only available if the client supports the `fs.readTextFile` capability.
2312
+ */
2313
+ export type ReadTextFileRequest = {
2314
+ /**
2315
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2316
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2317
+ * these keys.
2318
+ *
2319
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2320
+ */
2321
+ _meta?: {
2322
+ [key: string]: unknown;
2323
+ } | null;
2324
+ /**
2325
+ * Maximum number of lines to read.
2326
+ */
2327
+ limit?: number | null;
2328
+ /**
2329
+ * Line number to start reading from (1-based).
2330
+ */
2331
+ line?: number | null;
2332
+ /**
2333
+ * Absolute path to the file to read.
2334
+ */
2335
+ path: string;
2336
+ /**
2337
+ * The session ID for this request.
2338
+ */
2339
+ sessionId: SessionId;
2340
+ };
2341
+ /**
2342
+ * Response containing the contents of a text file.
2343
+ */
2344
+ export type ReadTextFileResponse = {
2345
+ /**
2346
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2347
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2348
+ * these keys.
2349
+ *
2350
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2351
+ */
2352
+ _meta?: {
2353
+ [key: string]: unknown;
2354
+ } | null;
2355
+ content: string;
2356
+ };
2357
+ /**
2358
+ * Request to release a terminal and free its resources.
2359
+ */
2360
+ export type ReleaseTerminalRequest = {
2361
+ /**
2362
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2363
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2364
+ * these keys.
2365
+ *
2366
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2367
+ */
2368
+ _meta?: {
2369
+ [key: string]: unknown;
2370
+ } | null;
2371
+ /**
2372
+ * The session ID for this request.
2373
+ */
2374
+ sessionId: SessionId;
2375
+ /**
2376
+ * The ID of the terminal to release.
2377
+ */
2378
+ terminalId: string;
2379
+ };
2380
+ /**
2381
+ * Response to terminal/release method
2382
+ */
2383
+ export type ReleaseTerminalResponse = {
2384
+ /**
2385
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2386
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2387
+ * these keys.
2388
+ *
2389
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2390
+ */
2391
+ _meta?: {
2392
+ [key: string]: unknown;
2393
+ } | null;
2394
+ };
2395
+ /**
2396
+ * JSON RPC Request Id
2397
+ *
2398
+ * An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]
2399
+ *
2400
+ * The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.
2401
+ *
2402
+ * [1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.
2403
+ *
2404
+ * [2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions.
2405
+ */
2406
+ export type RequestId = null | number | string;
2407
+ /**
2408
+ * The outcome of a permission request.
2409
+ */
2410
+ export type RequestPermissionOutcome = {
2411
+ outcome: "cancelled";
2412
+ } | (SelectedPermissionOutcome & {
2413
+ outcome: "selected";
2414
+ });
2415
+ /**
2416
+ * Request for user permission to execute a tool call.
2417
+ *
2418
+ * Sent when the agent needs authorization before performing a sensitive operation.
2419
+ *
2420
+ * See protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/tool-calls#requesting-permission)
2421
+ */
2422
+ export type RequestPermissionRequest = {
2423
+ /**
2424
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2425
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2426
+ * these keys.
2427
+ *
2428
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2429
+ */
2430
+ _meta?: {
2431
+ [key: string]: unknown;
2432
+ } | null;
2433
+ /**
2434
+ * Available permission options for the user to choose from.
2435
+ */
2436
+ options: Array<PermissionOption>;
2437
+ /**
2438
+ * The session ID for this request.
2439
+ */
2440
+ sessionId: SessionId;
2441
+ /**
2442
+ * Details about the tool call requiring permission.
2443
+ */
2444
+ toolCall: ToolCallUpdate;
2445
+ };
2446
+ /**
2447
+ * Response to a permission request.
2448
+ */
2449
+ export type RequestPermissionResponse = {
2450
+ /**
2451
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2452
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2453
+ * these keys.
2454
+ *
2455
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2456
+ */
2457
+ _meta?: {
2458
+ [key: string]: unknown;
2459
+ } | null;
2460
+ /**
2461
+ * The user's decision on the permission request.
2462
+ */
2463
+ outcome: RequestPermissionOutcome;
2464
+ };
2465
+ /**
2466
+ * A resource that the server is capable of reading, included in a prompt or tool call result.
2467
+ */
2468
+ export type ResourceLink = {
2469
+ /**
2470
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2471
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2472
+ * these keys.
2473
+ *
2474
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2475
+ */
2476
+ _meta?: {
2477
+ [key: string]: unknown;
2478
+ } | null;
2479
+ annotations?: Annotations | null;
2480
+ description?: string | null;
2481
+ mimeType?: string | null;
2482
+ name: string;
2483
+ size?: number | null;
2484
+ title?: string | null;
2485
+ uri: string;
2486
+ };
2487
+ /**
2488
+ * **UNSTABLE**
2489
+ *
2490
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2491
+ *
2492
+ * Request parameters for resuming an existing session.
2493
+ *
2494
+ * Resumes an existing session without returning previous messages (unlike `session/load`).
2495
+ * This is useful for agents that can resume sessions but don't implement full session loading.
2496
+ *
2497
+ * Only available if the Agent supports the `session.resume` capability.
2498
+ *
2499
+ * @experimental
2500
+ */
2501
+ export type ResumeSessionRequest = {
2502
+ /**
2503
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2504
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2505
+ * these keys.
2506
+ *
2507
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2508
+ */
2509
+ _meta?: {
2510
+ [key: string]: unknown;
2511
+ } | null;
2512
+ /**
2513
+ * The working directory for this session.
2514
+ */
2515
+ cwd: string;
2516
+ /**
2517
+ * List of MCP servers to connect to for this session.
2518
+ */
2519
+ mcpServers?: Array<McpServer>;
2520
+ /**
2521
+ * The ID of the session to resume.
2522
+ */
2523
+ sessionId: SessionId;
2524
+ };
2525
+ /**
2526
+ * **UNSTABLE**
2527
+ *
2528
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2529
+ *
2530
+ * Response from resuming an existing session.
2531
+ *
2532
+ * @experimental
2533
+ */
2534
+ export type ResumeSessionResponse = {
2535
+ /**
2536
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2537
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2538
+ * these keys.
2539
+ *
2540
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2541
+ */
2542
+ _meta?: {
2543
+ [key: string]: unknown;
2544
+ } | null;
2545
+ /**
2546
+ * Initial session configuration options if supported by the Agent.
2547
+ */
2548
+ configOptions?: Array<SessionConfigOption> | null;
2549
+ /**
2550
+ * **UNSTABLE**
2551
+ *
2552
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2553
+ *
2554
+ * Initial model state if supported by the Agent
2555
+ *
2556
+ * @experimental
2557
+ */
2558
+ models?: SessionModelState | null;
2559
+ /**
2560
+ * Initial mode state if supported by the Agent
2561
+ *
2562
+ * See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
2563
+ */
2564
+ modes?: SessionModeState | null;
2565
+ };
2566
+ /**
2567
+ * The sender or recipient of messages and data in a conversation.
2568
+ */
2569
+ export type Role = "assistant" | "user";
2570
+ /**
2571
+ * The user selected one of the provided options.
2572
+ */
2573
+ export type SelectedPermissionOutcome = {
2574
+ /**
2575
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2576
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2577
+ * these keys.
2578
+ *
2579
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2580
+ */
2581
+ _meta?: {
2582
+ [key: string]: unknown;
2583
+ } | null;
2584
+ /**
2585
+ * The ID of the option the user selected.
2586
+ */
2587
+ optionId: PermissionOptionId;
2588
+ };
2589
+ /**
2590
+ * Session capabilities supported by the agent.
2591
+ *
2592
+ * As a baseline, all Agents **MUST** support `session/new`, `session/prompt`, `session/cancel`, and `session/update`.
2593
+ *
2594
+ * Optionally, they **MAY** support other session methods and notifications by specifying additional capabilities.
2595
+ *
2596
+ * Note: `session/load` is still handled by the top-level `load_session` capability. This will be unified in future versions of the protocol.
2597
+ *
2598
+ * See protocol docs: [Session Capabilities](https://agentclientprotocol.com/protocol/initialization#session-capabilities)
2599
+ */
2600
+ export type SessionCapabilities = {
2601
+ /**
2602
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2603
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2604
+ * these keys.
2605
+ *
2606
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2607
+ */
2608
+ _meta?: {
2609
+ [key: string]: unknown;
2610
+ } | null;
2611
+ /**
2612
+ * **UNSTABLE**
2613
+ *
2614
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2615
+ *
2616
+ * Whether the agent supports `session/close`.
2617
+ *
2618
+ * @experimental
2619
+ */
2620
+ close?: SessionCloseCapabilities | null;
2621
+ /**
2622
+ * **UNSTABLE**
2623
+ *
2624
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2625
+ *
2626
+ * Whether the agent supports `session/fork`.
2627
+ *
2628
+ * @experimental
2629
+ */
2630
+ fork?: SessionForkCapabilities | null;
2631
+ /**
2632
+ * Whether the agent supports `session/list`.
2633
+ */
2634
+ list?: SessionListCapabilities | null;
2635
+ /**
2636
+ * **UNSTABLE**
2637
+ *
2638
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2639
+ *
2640
+ * Whether the agent supports `session/resume`.
2641
+ *
2642
+ * @experimental
2643
+ */
2644
+ resume?: SessionResumeCapabilities | null;
2645
+ };
2646
+ /**
2647
+ * **UNSTABLE**
2648
+ *
2649
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2650
+ *
2651
+ * Capabilities for the `session/close` method.
2652
+ *
2653
+ * By supplying `{}` it means that the agent supports closing of sessions.
2654
+ *
2655
+ * @experimental
2656
+ */
2657
+ export type SessionCloseCapabilities = {
2658
+ /**
2659
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2660
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2661
+ * these keys.
2662
+ *
2663
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2664
+ */
2665
+ _meta?: {
2666
+ [key: string]: unknown;
2667
+ } | null;
2668
+ };
2669
+ /**
2670
+ * **UNSTABLE**
2671
+ *
2672
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2673
+ *
2674
+ * A boolean on/off toggle session configuration option payload.
2675
+ *
2676
+ * @experimental
2677
+ */
2678
+ export type SessionConfigBoolean = {
2679
+ /**
2680
+ * The current value of the boolean option.
2681
+ */
2682
+ currentValue: boolean;
2683
+ };
2684
+ /**
2685
+ * Unique identifier for a session configuration option value group.
2686
+ */
2687
+ export type SessionConfigGroupId = string;
2688
+ /**
2689
+ * Unique identifier for a session configuration option.
2690
+ */
2691
+ export type SessionConfigId = string;
2692
+ export type SessionConfigOption = ((SessionConfigSelect & {
2693
+ type: "select";
2694
+ }) | (SessionConfigBoolean & {
2695
+ type: "boolean";
2696
+ })) & {
2697
+ /**
2698
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2699
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2700
+ * these keys.
2701
+ *
2702
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2703
+ */
2704
+ _meta?: {
2705
+ [key: string]: unknown;
2706
+ } | null;
2707
+ /**
2708
+ * Optional semantic category for this option (UX only).
2709
+ */
2710
+ category?: SessionConfigOptionCategory | null;
2711
+ /**
2712
+ * Optional description for the Client to display to the user.
2713
+ */
2714
+ description?: string | null;
2715
+ /**
2716
+ * Unique identifier for the configuration option.
2717
+ */
2718
+ id: SessionConfigId;
2719
+ /**
2720
+ * Human-readable label for the option.
2721
+ */
2722
+ name: string;
2723
+ };
2724
+ /**
2725
+ * Semantic category for a session configuration option.
2726
+ *
2727
+ * This is intended to help Clients distinguish broadly common selectors (e.g. model selector vs
2728
+ * session mode selector vs thought/reasoning level) for UX purposes (keyboard shortcuts, icons,
2729
+ * placement). It MUST NOT be required for correctness. Clients MUST handle missing or unknown
2730
+ * categories gracefully.
2731
+ *
2732
+ * Category names beginning with `_` are free for custom use, like other ACP extension methods.
2733
+ * Category names that do not begin with `_` are reserved for the ACP spec.
2734
+ */
2735
+ export type SessionConfigOptionCategory = "mode" | "model" | "thought_level" | string;
2736
+ /**
2737
+ * A single-value selector (dropdown) session configuration option payload.
2738
+ */
2739
+ export type SessionConfigSelect = {
2740
+ /**
2741
+ * The currently selected value.
2742
+ */
2743
+ currentValue: SessionConfigValueId;
2744
+ /**
2745
+ * The set of selectable options.
2746
+ */
2747
+ options: SessionConfigSelectOptions;
2748
+ };
2749
+ /**
2750
+ * A group of possible values for a session configuration option.
2751
+ */
2752
+ export type SessionConfigSelectGroup = {
2753
+ /**
2754
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2755
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2756
+ * these keys.
2757
+ *
2758
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2759
+ */
2760
+ _meta?: {
2761
+ [key: string]: unknown;
2762
+ } | null;
2763
+ /**
2764
+ * Unique identifier for this group.
2765
+ */
2766
+ group: SessionConfigGroupId;
2767
+ /**
2768
+ * Human-readable label for this group.
2769
+ */
2770
+ name: string;
2771
+ /**
2772
+ * The set of option values in this group.
2773
+ */
2774
+ options: Array<SessionConfigSelectOption>;
2775
+ };
2776
+ /**
2777
+ * A possible value for a session configuration option.
2778
+ */
2779
+ export type SessionConfigSelectOption = {
2780
+ /**
2781
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2782
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2783
+ * these keys.
2784
+ *
2785
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2786
+ */
2787
+ _meta?: {
2788
+ [key: string]: unknown;
2789
+ } | null;
2790
+ /**
2791
+ * Optional description for this option value.
2792
+ */
2793
+ description?: string | null;
2794
+ /**
2795
+ * Human-readable label for this option value.
2796
+ */
2797
+ name: string;
2798
+ /**
2799
+ * Unique identifier for this option value.
2800
+ */
2801
+ value: SessionConfigValueId;
2802
+ };
2803
+ /**
2804
+ * Possible values for a session configuration option.
2805
+ */
2806
+ export type SessionConfigSelectOptions = Array<SessionConfigSelectOption> | Array<SessionConfigSelectGroup>;
2807
+ /**
2808
+ * Unique identifier for a session configuration option value.
2809
+ */
2810
+ export type SessionConfigValueId = string;
2811
+ /**
2812
+ * **UNSTABLE**
2813
+ *
2814
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2815
+ *
2816
+ * Capabilities for the `session/fork` method.
2817
+ *
2818
+ * By supplying `{}` it means that the agent supports forking of sessions.
2819
+ *
2820
+ * @experimental
2821
+ */
2822
+ export type SessionForkCapabilities = {
2823
+ /**
2824
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2825
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2826
+ * these keys.
2827
+ *
2828
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2829
+ */
2830
+ _meta?: {
2831
+ [key: string]: unknown;
2832
+ } | null;
2833
+ };
2834
+ /**
2835
+ * A unique identifier for a conversation session between a client and agent.
2836
+ *
2837
+ * Sessions maintain their own context, conversation history, and state,
2838
+ * allowing multiple independent interactions with the same agent.
2839
+ *
2840
+ * See protocol docs: [Session ID](https://agentclientprotocol.com/protocol/session-setup#session-id)
2841
+ */
2842
+ export type SessionId = string;
2843
+ /**
2844
+ * Information about a session returned by session/list
2845
+ */
2846
+ export type SessionInfo = {
2847
+ /**
2848
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2849
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2850
+ * these keys.
2851
+ *
2852
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2853
+ */
2854
+ _meta?: {
2855
+ [key: string]: unknown;
2856
+ } | null;
2857
+ /**
2858
+ * The working directory for this session. Must be an absolute path.
2859
+ */
2860
+ cwd: string;
2861
+ /**
2862
+ * Unique identifier for the session
2863
+ */
2864
+ sessionId: SessionId;
2865
+ /**
2866
+ * Human-readable title for the session
2867
+ */
2868
+ title?: string | null;
2869
+ /**
2870
+ * ISO 8601 timestamp of last activity
2871
+ */
2872
+ updatedAt?: string | null;
2873
+ };
2874
+ /**
2875
+ * Update to session metadata. All fields are optional to support partial updates.
2876
+ *
2877
+ * Agents send this notification to update session information like title or custom metadata.
2878
+ * This allows clients to display dynamic session names and track session state changes.
2879
+ */
2880
+ export type SessionInfoUpdate = {
2881
+ /**
2882
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2883
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2884
+ * these keys.
2885
+ *
2886
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2887
+ */
2888
+ _meta?: {
2889
+ [key: string]: unknown;
2890
+ } | null;
2891
+ /**
2892
+ * Human-readable title for the session. Set to null to clear.
2893
+ */
2894
+ title?: string | null;
2895
+ /**
2896
+ * ISO 8601 timestamp of last activity. Set to null to clear.
2897
+ */
2898
+ updatedAt?: string | null;
2899
+ };
2900
+ /**
2901
+ * Capabilities for the `session/list` method.
2902
+ *
2903
+ * By supplying `{}` it means that the agent supports listing of sessions.
2904
+ */
2905
+ export type SessionListCapabilities = {
2906
+ /**
2907
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2908
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2909
+ * these keys.
2910
+ *
2911
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2912
+ */
2913
+ _meta?: {
2914
+ [key: string]: unknown;
2915
+ } | null;
2916
+ };
2917
+ /**
2918
+ * A mode the agent can operate in.
2919
+ *
2920
+ * See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
2921
+ */
2922
+ export type SessionMode = {
2923
+ /**
2924
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2925
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2926
+ * these keys.
2927
+ *
2928
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2929
+ */
2930
+ _meta?: {
2931
+ [key: string]: unknown;
2932
+ } | null;
2933
+ description?: string | null;
2934
+ id: SessionModeId;
2935
+ name: string;
2936
+ };
2937
+ /**
2938
+ * Unique identifier for a Session Mode.
2939
+ */
2940
+ export type SessionModeId = string;
2941
+ /**
2942
+ * The set of modes and the one currently active.
2943
+ */
2944
+ export type SessionModeState = {
2945
+ /**
2946
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2947
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2948
+ * these keys.
2949
+ *
2950
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2951
+ */
2952
+ _meta?: {
2953
+ [key: string]: unknown;
2954
+ } | null;
2955
+ /**
2956
+ * The set of modes that the Agent can operate in
2957
+ */
2958
+ availableModes: Array<SessionMode>;
2959
+ /**
2960
+ * The current mode the Agent is in.
2961
+ */
2962
+ currentModeId: SessionModeId;
2963
+ };
2964
+ /**
2965
+ * **UNSTABLE**
2966
+ *
2967
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2968
+ *
2969
+ * The set of models and the one currently active.
2970
+ *
2971
+ * @experimental
2972
+ */
2973
+ export type SessionModelState = {
2974
+ /**
2975
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
2976
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
2977
+ * these keys.
2978
+ *
2979
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2980
+ */
2981
+ _meta?: {
2982
+ [key: string]: unknown;
2983
+ } | null;
2984
+ /**
2985
+ * The set of models that the Agent can use
2986
+ */
2987
+ availableModels: Array<ModelInfo>;
2988
+ /**
2989
+ * The current model the Agent is in.
2990
+ */
2991
+ currentModelId: ModelId;
2992
+ };
2993
+ /**
2994
+ * Notification containing a session update from the agent.
2995
+ *
2996
+ * Used to stream real-time progress and results during prompt processing.
2997
+ *
2998
+ * See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)
2999
+ */
3000
+ export type SessionNotification = {
3001
+ /**
3002
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3003
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3004
+ * these keys.
3005
+ *
3006
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3007
+ */
3008
+ _meta?: {
3009
+ [key: string]: unknown;
3010
+ } | null;
3011
+ /**
3012
+ * The ID of the session this update pertains to.
3013
+ */
3014
+ sessionId: SessionId;
3015
+ /**
3016
+ * The actual update content.
3017
+ */
3018
+ update: SessionUpdate;
3019
+ };
3020
+ /**
3021
+ * **UNSTABLE**
3022
+ *
3023
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
3024
+ *
3025
+ * Capabilities for the `session/resume` method.
3026
+ *
3027
+ * By supplying `{}` it means that the agent supports resuming of sessions.
3028
+ *
3029
+ * @experimental
3030
+ */
3031
+ export type SessionResumeCapabilities = {
3032
+ /**
3033
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3034
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3035
+ * these keys.
3036
+ *
3037
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3038
+ */
3039
+ _meta?: {
3040
+ [key: string]: unknown;
3041
+ } | null;
3042
+ };
3043
+ /**
3044
+ * Different types of updates that can be sent during session processing.
3045
+ *
3046
+ * These updates provide real-time feedback about the agent's progress.
3047
+ *
3048
+ * See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)
3049
+ */
3050
+ export type SessionUpdate = (ContentChunk & {
3051
+ sessionUpdate: "user_message_chunk";
3052
+ }) | (ContentChunk & {
3053
+ sessionUpdate: "agent_message_chunk";
3054
+ }) | (ContentChunk & {
3055
+ sessionUpdate: "agent_thought_chunk";
3056
+ }) | (ToolCall & {
3057
+ sessionUpdate: "tool_call";
3058
+ }) | (ToolCallUpdate & {
3059
+ sessionUpdate: "tool_call_update";
3060
+ }) | (Plan & {
3061
+ sessionUpdate: "plan";
3062
+ }) | (AvailableCommandsUpdate & {
3063
+ sessionUpdate: "available_commands_update";
3064
+ }) | (CurrentModeUpdate & {
3065
+ sessionUpdate: "current_mode_update";
3066
+ }) | (ConfigOptionUpdate & {
3067
+ sessionUpdate: "config_option_update";
3068
+ }) | (SessionInfoUpdate & {
3069
+ sessionUpdate: "session_info_update";
3070
+ }) | (UsageUpdate & {
3071
+ sessionUpdate: "usage_update";
3072
+ });
3073
+ export type SetSessionConfigOptionRequest = ({
3074
+ type: "boolean";
3075
+ /**
3076
+ * The boolean value.
3077
+ */
3078
+ value: boolean;
3079
+ } | {
3080
+ /**
3081
+ * The value ID.
3082
+ */
3083
+ value: SessionConfigValueId;
3084
+ }) & {
3085
+ /**
3086
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3087
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3088
+ * these keys.
3089
+ *
3090
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3091
+ */
3092
+ _meta?: {
3093
+ [key: string]: unknown;
3094
+ } | null;
3095
+ /**
3096
+ * The ID of the configuration option to set.
3097
+ */
3098
+ configId: SessionConfigId;
3099
+ /**
3100
+ * The ID of the session to set the configuration option for.
3101
+ */
3102
+ sessionId: SessionId;
3103
+ };
3104
+ /**
3105
+ * Response to `session/set_config_option` method.
3106
+ */
3107
+ export type SetSessionConfigOptionResponse = {
3108
+ /**
3109
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3110
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3111
+ * these keys.
3112
+ *
3113
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3114
+ */
3115
+ _meta?: {
3116
+ [key: string]: unknown;
3117
+ } | null;
3118
+ /**
3119
+ * The full set of configuration options and their current values.
3120
+ */
3121
+ configOptions: Array<SessionConfigOption>;
3122
+ };
3123
+ /**
3124
+ * Request parameters for setting a session mode.
3125
+ */
3126
+ export type SetSessionModeRequest = {
3127
+ /**
3128
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3129
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3130
+ * these keys.
3131
+ *
3132
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3133
+ */
3134
+ _meta?: {
3135
+ [key: string]: unknown;
3136
+ } | null;
3137
+ /**
3138
+ * The ID of the mode to set.
3139
+ */
3140
+ modeId: SessionModeId;
3141
+ /**
3142
+ * The ID of the session to set the mode for.
3143
+ */
3144
+ sessionId: SessionId;
3145
+ };
3146
+ /**
3147
+ * Response to `session/set_mode` method.
3148
+ */
3149
+ export type SetSessionModeResponse = {
3150
+ /**
3151
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3152
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3153
+ * these keys.
3154
+ *
3155
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3156
+ */
3157
+ _meta?: {
3158
+ [key: string]: unknown;
3159
+ } | null;
3160
+ };
3161
+ /**
3162
+ * **UNSTABLE**
3163
+ *
3164
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
3165
+ *
3166
+ * Request parameters for setting a session model.
3167
+ *
3168
+ * @experimental
3169
+ */
3170
+ export type SetSessionModelRequest = {
3171
+ /**
3172
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3173
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3174
+ * these keys.
3175
+ *
3176
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3177
+ */
3178
+ _meta?: {
3179
+ [key: string]: unknown;
3180
+ } | null;
3181
+ /**
3182
+ * The ID of the model to set.
3183
+ */
3184
+ modelId: ModelId;
3185
+ /**
3186
+ * The ID of the session to set the model for.
3187
+ */
3188
+ sessionId: SessionId;
3189
+ };
3190
+ /**
3191
+ * **UNSTABLE**
3192
+ *
3193
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
3194
+ *
3195
+ * Response to `session/set_model` method.
3196
+ *
3197
+ * @experimental
3198
+ */
3199
+ export type SetSessionModelResponse = {
3200
+ /**
3201
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3202
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3203
+ * these keys.
3204
+ *
3205
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3206
+ */
3207
+ _meta?: {
3208
+ [key: string]: unknown;
3209
+ } | null;
3210
+ };
3211
+ /**
3212
+ * Reasons why an agent stops processing a prompt turn.
3213
+ *
3214
+ * See protocol docs: [Stop Reasons](https://agentclientprotocol.com/protocol/prompt-turn#stop-reasons)
3215
+ */
3216
+ export type StopReason = "end_turn" | "max_tokens" | "max_turn_requests" | "refusal" | "cancelled";
3217
+ /**
3218
+ * String format types for string properties in elicitation schemas.
3219
+ */
3220
+ export type StringFormat = "email" | "uri" | "date" | "date-time";
3221
+ /**
3222
+ * Schema for string properties in an elicitation form.
3223
+ *
3224
+ * When `enum` or `oneOf` is set, this represents a single-select enum
3225
+ * with `"type": "string"`.
3226
+ */
3227
+ export type StringPropertySchema = {
3228
+ /**
3229
+ * Default value.
3230
+ */
3231
+ default?: string | null;
3232
+ /**
3233
+ * Human-readable description.
3234
+ */
3235
+ description?: string | null;
3236
+ /**
3237
+ * Enum values for untitled single-select enums.
3238
+ */
3239
+ enum?: Array<string> | null;
3240
+ /**
3241
+ * String format.
3242
+ */
3243
+ format?: StringFormat | null;
3244
+ /**
3245
+ * Maximum string length.
3246
+ */
3247
+ maxLength?: number | null;
3248
+ /**
3249
+ * Minimum string length.
3250
+ */
3251
+ minLength?: number | null;
3252
+ /**
3253
+ * Titled enum options for titled single-select enums.
3254
+ */
3255
+ oneOf?: Array<EnumOption> | null;
3256
+ /**
3257
+ * Pattern the string must match.
3258
+ */
3259
+ pattern?: string | null;
3260
+ /**
3261
+ * Optional title for the property.
3262
+ */
3263
+ title?: string | null;
3264
+ };
3265
+ /**
3266
+ * Embed a terminal created with `terminal/create` by its id.
3267
+ *
3268
+ * The terminal must be added before calling `terminal/release`.
3269
+ *
3270
+ * See protocol docs: [Terminal](https://agentclientprotocol.com/protocol/terminals)
3271
+ */
3272
+ export type Terminal = {
3273
+ /**
3274
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3275
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3276
+ * these keys.
3277
+ *
3278
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3279
+ */
3280
+ _meta?: {
3281
+ [key: string]: unknown;
3282
+ } | null;
3283
+ terminalId: string;
3284
+ };
3285
+ /**
3286
+ * Exit status of a terminal command.
3287
+ */
3288
+ export type TerminalExitStatus = {
3289
+ /**
3290
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3291
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3292
+ * these keys.
3293
+ *
3294
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3295
+ */
3296
+ _meta?: {
3297
+ [key: string]: unknown;
3298
+ } | null;
3299
+ /**
3300
+ * The process exit code (may be null if terminated by signal).
3301
+ */
3302
+ exitCode?: number | null;
3303
+ /**
3304
+ * The signal that terminated the process (may be null if exited normally).
3305
+ */
3306
+ signal?: string | null;
3307
+ };
3308
+ /**
3309
+ * Request to get the current output and status of a terminal.
3310
+ */
3311
+ export type TerminalOutputRequest = {
3312
+ /**
3313
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3314
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3315
+ * these keys.
3316
+ *
3317
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3318
+ */
3319
+ _meta?: {
3320
+ [key: string]: unknown;
3321
+ } | null;
3322
+ /**
3323
+ * The session ID for this request.
3324
+ */
3325
+ sessionId: SessionId;
3326
+ /**
3327
+ * The ID of the terminal to get output from.
3328
+ */
3329
+ terminalId: string;
3330
+ };
3331
+ /**
3332
+ * Response containing the terminal output and exit status.
3333
+ */
3334
+ export type TerminalOutputResponse = {
3335
+ /**
3336
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3337
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3338
+ * these keys.
3339
+ *
3340
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3341
+ */
3342
+ _meta?: {
3343
+ [key: string]: unknown;
3344
+ } | null;
3345
+ /**
3346
+ * Exit status if the command has completed.
3347
+ */
3348
+ exitStatus?: TerminalExitStatus | null;
3349
+ /**
3350
+ * The terminal output captured so far.
3351
+ */
3352
+ output: string;
3353
+ /**
3354
+ * Whether the output was truncated due to byte limits.
3355
+ */
3356
+ truncated: boolean;
3357
+ };
3358
+ /**
3359
+ * Text provided to or from an LLM.
3360
+ */
3361
+ export type TextContent = {
3362
+ /**
3363
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3364
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3365
+ * these keys.
3366
+ *
3367
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3368
+ */
3369
+ _meta?: {
3370
+ [key: string]: unknown;
3371
+ } | null;
3372
+ annotations?: Annotations | null;
3373
+ text: string;
3374
+ };
3375
+ /**
3376
+ * Text-based resource contents.
3377
+ */
3378
+ export type TextResourceContents = {
3379
+ /**
3380
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3381
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3382
+ * these keys.
3383
+ *
3384
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3385
+ */
3386
+ _meta?: {
3387
+ [key: string]: unknown;
3388
+ } | null;
3389
+ mimeType?: string | null;
3390
+ text: string;
3391
+ uri: string;
3392
+ };
3393
+ /**
3394
+ * Items definition for titled multi-select enum properties.
3395
+ */
3396
+ export type TitledMultiSelectItems = {
3397
+ /**
3398
+ * Titled enum options.
3399
+ */
3400
+ anyOf: Array<EnumOption>;
3401
+ };
3402
+ /**
3403
+ * Represents a tool call that the language model has requested.
3404
+ *
3405
+ * Tool calls are actions that the agent executes on behalf of the language model,
3406
+ * such as reading files, executing code, or fetching data from external sources.
3407
+ *
3408
+ * See protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/tool-calls)
3409
+ */
3410
+ export type ToolCall = {
3411
+ /**
3412
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3413
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3414
+ * these keys.
3415
+ *
3416
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3417
+ */
3418
+ _meta?: {
3419
+ [key: string]: unknown;
3420
+ } | null;
3421
+ /**
3422
+ * Content produced by the tool call.
3423
+ */
3424
+ content?: Array<ToolCallContent>;
3425
+ /**
3426
+ * The category of tool being invoked.
3427
+ * Helps clients choose appropriate icons and UI treatment.
3428
+ */
3429
+ kind?: ToolKind;
3430
+ /**
3431
+ * File locations affected by this tool call.
3432
+ * Enables "follow-along" features in clients.
3433
+ */
3434
+ locations?: Array<ToolCallLocation>;
3435
+ /**
3436
+ * Raw input parameters sent to the tool.
3437
+ */
3438
+ rawInput?: unknown;
3439
+ /**
3440
+ * Raw output returned by the tool.
3441
+ */
3442
+ rawOutput?: unknown;
3443
+ /**
3444
+ * Current execution status of the tool call.
3445
+ */
3446
+ status?: ToolCallStatus;
3447
+ /**
3448
+ * Human-readable title describing what the tool is doing.
3449
+ */
3450
+ title: string;
3451
+ /**
3452
+ * Unique identifier for this tool call within the session.
3453
+ */
3454
+ toolCallId: ToolCallId;
3455
+ };
3456
+ /**
3457
+ * Content produced by a tool call.
3458
+ *
3459
+ * Tool calls can produce different types of content including
3460
+ * standard content blocks (text, images) or file diffs.
3461
+ *
3462
+ * See protocol docs: [Content](https://agentclientprotocol.com/protocol/tool-calls#content)
3463
+ */
3464
+ export type ToolCallContent = (Content & {
3465
+ type: "content";
3466
+ }) | (Diff & {
3467
+ type: "diff";
3468
+ }) | (Terminal & {
3469
+ type: "terminal";
3470
+ });
3471
+ /**
3472
+ * Unique identifier for a tool call within a session.
3473
+ */
3474
+ export type ToolCallId = string;
3475
+ /**
3476
+ * A file location being accessed or modified by a tool.
3477
+ *
3478
+ * Enables clients to implement "follow-along" features that track
3479
+ * which files the agent is working with in real-time.
3480
+ *
3481
+ * See protocol docs: [Following the Agent](https://agentclientprotocol.com/protocol/tool-calls#following-the-agent)
3482
+ */
3483
+ export type ToolCallLocation = {
3484
+ /**
3485
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3486
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3487
+ * these keys.
3488
+ *
3489
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3490
+ */
3491
+ _meta?: {
3492
+ [key: string]: unknown;
3493
+ } | null;
3494
+ /**
3495
+ * Optional line number within the file.
3496
+ */
3497
+ line?: number | null;
3498
+ /**
3499
+ * The file path being accessed or modified.
3500
+ */
3501
+ path: string;
3502
+ };
3503
+ /**
3504
+ * Execution status of a tool call.
3505
+ *
3506
+ * Tool calls progress through different statuses during their lifecycle.
3507
+ *
3508
+ * See protocol docs: [Status](https://agentclientprotocol.com/protocol/tool-calls#status)
3509
+ */
3510
+ export type ToolCallStatus = "pending" | "in_progress" | "completed" | "failed";
3511
+ /**
3512
+ * An update to an existing tool call.
3513
+ *
3514
+ * Used to report progress and results as tools execute. All fields except
3515
+ * the tool call ID are optional - only changed fields need to be included.
3516
+ *
3517
+ * See protocol docs: [Updating](https://agentclientprotocol.com/protocol/tool-calls#updating)
3518
+ */
3519
+ export type ToolCallUpdate = {
3520
+ /**
3521
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3522
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3523
+ * these keys.
3524
+ *
3525
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3526
+ */
3527
+ _meta?: {
3528
+ [key: string]: unknown;
3529
+ } | null;
3530
+ /**
3531
+ * Replace the content collection.
3532
+ */
3533
+ content?: Array<ToolCallContent> | null;
3534
+ /**
3535
+ * Update the tool kind.
3536
+ */
3537
+ kind?: ToolKind | null;
3538
+ /**
3539
+ * Replace the locations collection.
3540
+ */
3541
+ locations?: Array<ToolCallLocation> | null;
3542
+ /**
3543
+ * Update the raw input.
3544
+ */
3545
+ rawInput?: unknown;
3546
+ /**
3547
+ * Update the raw output.
3548
+ */
3549
+ rawOutput?: unknown;
3550
+ /**
3551
+ * Update the execution status.
3552
+ */
3553
+ status?: ToolCallStatus | null;
3554
+ /**
3555
+ * Update the human-readable title.
3556
+ */
3557
+ title?: string | null;
3558
+ /**
3559
+ * The ID of the tool call being updated.
3560
+ */
3561
+ toolCallId: ToolCallId;
3562
+ };
3563
+ /**
3564
+ * Categories of tools that can be invoked.
3565
+ *
3566
+ * Tool kinds help clients choose appropriate icons and optimize how they
3567
+ * display tool execution progress.
3568
+ *
3569
+ * See protocol docs: [Creating](https://agentclientprotocol.com/protocol/tool-calls#creating)
3570
+ */
3571
+ export type ToolKind = "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "switch_mode" | "other";
3572
+ /**
3573
+ * All text that was typed after the command name is provided as input.
3574
+ */
3575
+ export type UnstructuredCommandInput = {
3576
+ /**
3577
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3578
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3579
+ * these keys.
3580
+ *
3581
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3582
+ */
3583
+ _meta?: {
3584
+ [key: string]: unknown;
3585
+ } | null;
3586
+ /**
3587
+ * A hint to display when the input hasn't been provided yet
3588
+ */
3589
+ hint: string;
3590
+ };
3591
+ /**
3592
+ * Items definition for untitled multi-select enum properties.
3593
+ */
3594
+ export type UntitledMultiSelectItems = {
3595
+ /**
3596
+ * Allowed enum values.
3597
+ */
3598
+ enum: Array<string>;
3599
+ /**
3600
+ * Item type discriminator. Must be `"string"`.
3601
+ */
3602
+ type: ElicitationStringType;
3603
+ };
3604
+ /**
3605
+ * **UNSTABLE**
3606
+ *
3607
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
3608
+ *
3609
+ * Token usage information for a prompt turn.
3610
+ *
3611
+ * @experimental
3612
+ */
3613
+ export type Usage = {
3614
+ /**
3615
+ * Total cache read tokens.
3616
+ */
3617
+ cachedReadTokens?: number | null;
3618
+ /**
3619
+ * Total cache write tokens.
3620
+ */
3621
+ cachedWriteTokens?: number | null;
3622
+ /**
3623
+ * Total input tokens across all turns.
3624
+ */
3625
+ inputTokens: number;
3626
+ /**
3627
+ * Total output tokens across all turns.
3628
+ */
3629
+ outputTokens: number;
3630
+ /**
3631
+ * Total thought/reasoning tokens
3632
+ */
3633
+ thoughtTokens?: number | null;
3634
+ /**
3635
+ * Sum of all token types across session.
3636
+ */
3637
+ totalTokens: number;
3638
+ };
3639
+ /**
3640
+ * **UNSTABLE**
3641
+ *
3642
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
3643
+ *
3644
+ * Context window and cost update for a session.
3645
+ *
3646
+ * @experimental
3647
+ */
3648
+ export type UsageUpdate = {
3649
+ /**
3650
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3651
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3652
+ * these keys.
3653
+ *
3654
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3655
+ */
3656
+ _meta?: {
3657
+ [key: string]: unknown;
3658
+ } | null;
3659
+ /**
3660
+ * Cumulative session cost (optional).
3661
+ */
3662
+ cost?: Cost | null;
3663
+ /**
3664
+ * Total context window size in tokens.
3665
+ */
3666
+ size: number;
3667
+ /**
3668
+ * Tokens currently in context.
3669
+ */
3670
+ used: number;
3671
+ };
3672
+ /**
3673
+ * Request to wait for a terminal command to exit.
3674
+ */
3675
+ export type WaitForTerminalExitRequest = {
3676
+ /**
3677
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3678
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3679
+ * these keys.
3680
+ *
3681
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3682
+ */
3683
+ _meta?: {
3684
+ [key: string]: unknown;
3685
+ } | null;
3686
+ /**
3687
+ * The session ID for this request.
3688
+ */
3689
+ sessionId: SessionId;
3690
+ /**
3691
+ * The ID of the terminal to wait for.
3692
+ */
3693
+ terminalId: string;
3694
+ };
3695
+ /**
3696
+ * Response containing the exit status of a terminal command.
3697
+ */
3698
+ export type WaitForTerminalExitResponse = {
3699
+ /**
3700
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3701
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3702
+ * these keys.
3703
+ *
3704
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3705
+ */
3706
+ _meta?: {
3707
+ [key: string]: unknown;
3708
+ } | null;
3709
+ /**
3710
+ * The process exit code (may be null if terminated by signal).
3711
+ */
3712
+ exitCode?: number | null;
3713
+ /**
3714
+ * The signal that terminated the process (may be null if exited normally).
3715
+ */
3716
+ signal?: string | null;
3717
+ };
3718
+ /**
3719
+ * Request to write content to a text file.
3720
+ *
3721
+ * Only available if the client supports the `fs.writeTextFile` capability.
3722
+ */
3723
+ export type WriteTextFileRequest = {
3724
+ /**
3725
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3726
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3727
+ * these keys.
3728
+ *
3729
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3730
+ */
3731
+ _meta?: {
3732
+ [key: string]: unknown;
3733
+ } | null;
3734
+ /**
3735
+ * The text content to write to the file.
3736
+ */
3737
+ content: string;
3738
+ /**
3739
+ * Absolute path to the file to write.
3740
+ */
3741
+ path: string;
3742
+ /**
3743
+ * The session ID for this request.
3744
+ */
3745
+ sessionId: SessionId;
3746
+ };
3747
+ /**
3748
+ * Response to `fs/write_text_file`
3749
+ */
3750
+ export type WriteTextFileResponse = {
3751
+ /**
3752
+ * The _meta property is reserved by ACP to allow clients and agents to attach additional
3753
+ * metadata to their interactions. Implementations MUST NOT make assumptions about values at
3754
+ * these keys.
3755
+ *
3756
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
3757
+ */
3758
+ _meta?: {
3759
+ [key: string]: unknown;
3760
+ } | null;
3761
+ };