@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 9,412 lines 427 KB
Raw
1 import * as Schema from "effect/Schema";
2
3 export type SessionId = string;
4 export const SessionId = Schema.String.annotate({
5 description:
6 "A unique identifier for a conversation session between a client and agent.\n\nSessions maintain their own context, conversation history, and state,\nallowing multiple independent interactions with the same agent.\n\nSee protocol docs: [Session ID](https://agentclientprotocol.com/protocol/session-setup#session-id)",
7 identifier: "SessionId",
8 });
9
10 export type NesSuggestionId = string;
11 export const NesSuggestionId = Schema.String.annotate({
12 description: "Unique identifier for a next edit suggestion.",
13 identifier: "NesSuggestionId",
14 });
15
16 export type LogoutCapabilities = { readonly _meta?: { readonly [x: string]: Schema.Json } | null };
17 export const LogoutCapabilities = Schema.Struct({
18 _meta: Schema.optionalKey(
19 Schema.Union([
20 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
21 description:
22 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
23 }),
24 Schema.Null,
25 ]),
26 ),
27 }).annotate({
28 description:
29 "Logout capabilities supported by the agent.\n\nSupplying `{}` means the agent supports the logout method.",
30 identifier: "LogoutCapabilities",
31 });
32
33 export type PromptCapabilities = {
34 readonly image?: boolean;
35 readonly audio?: boolean;
36 readonly embeddedContext?: boolean;
37 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
38 };
39 export const PromptCapabilities = Schema.Struct({
40 image: Schema.optionalKey(
41 Schema.Boolean.annotate({
42 description: "Agent supports [`ContentBlock::Image`].",
43 default: false,
44 }),
45 ),
46 audio: Schema.optionalKey(
47 Schema.Boolean.annotate({
48 description: "Agent supports [`ContentBlock::Audio`].",
49 default: false,
50 }),
51 ),
52 embeddedContext: Schema.optionalKey(
53 Schema.Boolean.annotate({
54 description:
55 "Agent supports embedded context in `session/prompt` requests.\n\nWhen enabled, the Client is allowed to include [`ContentBlock::Resource`]\nin prompt requests for pieces of context that are referenced in the message.",
56 default: false,
57 }),
58 ),
59 _meta: Schema.optionalKey(
60 Schema.Union([
61 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
62 description:
63 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
64 }),
65 Schema.Null,
66 ]),
67 ),
68 }).annotate({
69 description:
70 "Prompt capabilities supported by the agent in `session/prompt` requests.\n\nBaseline agent functionality requires support for [`ContentBlock::Text`]\nand [`ContentBlock::ResourceLink`] in prompt requests.\n\nOther variants must be explicitly opted in to.\nCapabilities for different types of content in prompt requests.\n\nIndicates which content types beyond the baseline (text and resource links)\nthe agent can process.\n\nSee protocol docs: [Prompt Capabilities](https://agentclientprotocol.com/protocol/initialization#prompt-capabilities)",
71 identifier: "PromptCapabilities",
72 });
73
74 export type McpCapabilities = {
75 readonly http?: boolean;
76 readonly sse?: boolean;
77 readonly acp?: boolean;
78 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
79 };
80 export const McpCapabilities = Schema.Struct({
81 http: Schema.optionalKey(
82 Schema.Boolean.annotate({ description: "Agent supports [`McpServer::Http`].", default: false }),
83 ),
84 sse: Schema.optionalKey(
85 Schema.Boolean.annotate({ description: "Agent supports [`McpServer::Sse`].", default: false }),
86 ),
87 acp: Schema.optionalKey(
88 Schema.Boolean.annotate({
89 description:
90 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAgent supports [`McpServer::Acp`].",
91 default: false,
92 }),
93 ),
94 _meta: Schema.optionalKey(
95 Schema.Union([
96 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
97 description:
98 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
99 }),
100 Schema.Null,
101 ]),
102 ),
103 }).annotate({
104 description: "MCP capabilities supported by the agent",
105 identifier: "McpCapabilities",
106 });
107
108 export type SessionListCapabilities = {
109 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
110 };
111 export const SessionListCapabilities = Schema.Struct({
112 _meta: Schema.optionalKey(
113 Schema.Union([
114 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
115 description:
116 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
117 }),
118 Schema.Null,
119 ]),
120 ),
121 }).annotate({
122 description:
123 "Capabilities for the `session/list` method.\n\nSupplying `{}` means the agent supports listing sessions.",
124 identifier: "SessionListCapabilities",
125 });
126
127 export type SessionDeleteCapabilities = {
128 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
129 };
130 export const SessionDeleteCapabilities = Schema.Struct({
131 _meta: Schema.optionalKey(
132 Schema.Union([
133 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
134 description:
135 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
136 }),
137 Schema.Null,
138 ]),
139 ),
140 }).annotate({
141 description:
142 "Capabilities for the `session/delete` method.\n\nSupplying `{}` means the agent supports deleting sessions from `session/list`.",
143 identifier: "SessionDeleteCapabilities",
144 });
145
146 export type SessionAdditionalDirectoriesCapabilities = {
147 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
148 };
149 export const SessionAdditionalDirectoriesCapabilities = Schema.Struct({
150 _meta: Schema.optionalKey(
151 Schema.Union([
152 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
153 description:
154 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
155 }),
156 Schema.Null,
157 ]),
158 ),
159 }).annotate({
160 description:
161 "Capabilities for additional session directories support.\n\nSupplying `{}` means the agent supports the `additionalDirectories` field on\nsupported session lifecycle requests. Agents that also support\n`session/list` may return `SessionInfo.additionalDirectories` to report the\ncomplete ordered additional-root list associated with a listed session.",
162 identifier: "SessionAdditionalDirectoriesCapabilities",
163 });
164
165 export type SessionForkCapabilities = {
166 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
167 };
168 export const SessionForkCapabilities = Schema.Struct({
169 _meta: Schema.optionalKey(
170 Schema.Union([
171 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
172 description:
173 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
174 }),
175 Schema.Null,
176 ]),
177 ),
178 }).annotate({
179 description:
180 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for the `session/fork` method.\n\nSupplying `{}` means the agent supports forking sessions.",
181 identifier: "SessionForkCapabilities",
182 });
183
184 export type SessionResumeCapabilities = {
185 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
186 };
187 export const SessionResumeCapabilities = Schema.Struct({
188 _meta: Schema.optionalKey(
189 Schema.Union([
190 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
191 description:
192 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
193 }),
194 Schema.Null,
195 ]),
196 ),
197 }).annotate({
198 description:
199 "Capabilities for the `session/resume` method.\n\nSupplying `{}` means the agent supports resuming sessions.",
200 identifier: "SessionResumeCapabilities",
201 });
202
203 export type SessionCloseCapabilities = {
204 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
205 };
206 export const SessionCloseCapabilities = Schema.Struct({
207 _meta: Schema.optionalKey(
208 Schema.Union([
209 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
210 description:
211 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
212 }),
213 Schema.Null,
214 ]),
215 ),
216 }).annotate({
217 description:
218 "Capabilities for the `session/close` method.\n\nSupplying `{}` means the agent supports closing sessions.",
219 identifier: "SessionCloseCapabilities",
220 });
221
222 export type ProvidersCapabilities = {
223 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
224 };
225 export const ProvidersCapabilities = Schema.Struct({
226 _meta: Schema.optionalKey(
227 Schema.Union([
228 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
229 description:
230 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
231 }),
232 Schema.Null,
233 ]),
234 ),
235 }).annotate({
236 description:
237 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nProvider configuration capabilities supported by the agent.\n\nSupplying `{}` means the agent supports provider configuration methods.",
238 identifier: "ProvidersCapabilities",
239 });
240
241 export type NesDocumentDidOpenCapabilities = {
242 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
243 };
244 export const NesDocumentDidOpenCapabilities = Schema.Struct({
245 _meta: Schema.optionalKey(
246 Schema.Union([
247 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
248 description:
249 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
250 }),
251 Schema.Null,
252 ]),
253 ),
254 }).annotate({
255 description: "Marker for `document/didOpen` capability support.",
256 identifier: "NesDocumentDidOpenCapabilities",
257 });
258
259 export type TextDocumentSyncKind = "full" | "incremental";
260 export const TextDocumentSyncKind = Schema.Union([
261 Schema.Literal("full").annotate({
262 description: "Client sends the entire file content on each change.",
263 }),
264 Schema.Literal("incremental").annotate({ description: "Client sends only the changed ranges." }),
265 ]).annotate({
266 description: "How the agent wants document changes delivered.",
267 identifier: "TextDocumentSyncKind",
268 });
269
270 export type NesDocumentDidCloseCapabilities = {
271 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
272 };
273 export const NesDocumentDidCloseCapabilities = Schema.Struct({
274 _meta: Schema.optionalKey(
275 Schema.Union([
276 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
277 description:
278 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
279 }),
280 Schema.Null,
281 ]),
282 ),
283 }).annotate({
284 description: "Marker for `document/didClose` capability support.",
285 identifier: "NesDocumentDidCloseCapabilities",
286 });
287
288 export type NesDocumentDidSaveCapabilities = {
289 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
290 };
291 export const NesDocumentDidSaveCapabilities = Schema.Struct({
292 _meta: Schema.optionalKey(
293 Schema.Union([
294 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
295 description:
296 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
297 }),
298 Schema.Null,
299 ]),
300 ),
301 }).annotate({
302 description: "Marker for `document/didSave` capability support.",
303 identifier: "NesDocumentDidSaveCapabilities",
304 });
305
306 export type NesDocumentDidFocusCapabilities = {
307 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
308 };
309 export const NesDocumentDidFocusCapabilities = Schema.Struct({
310 _meta: Schema.optionalKey(
311 Schema.Union([
312 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
313 description:
314 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
315 }),
316 Schema.Null,
317 ]),
318 ),
319 }).annotate({
320 description: "Marker for `document/didFocus` capability support.",
321 identifier: "NesDocumentDidFocusCapabilities",
322 });
323
324 export type NesRecentFilesCapabilities = {
325 readonly maxCount?: number | null;
326 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
327 };
328 export const NesRecentFilesCapabilities = Schema.Struct({
329 maxCount: Schema.optionalKey(
330 Schema.Union([
331 Schema.Number.annotate({
332 description: "Maximum number of recent files the agent can use.",
333 format: "uint32",
334 })
335 .check(Schema.isInt().annotate({ expected: "an integer" }))
336 .check(
337 Schema.isGreaterThanOrEqualTo(0).annotate({
338 expected: "a value greater than or equal to 0",
339 }),
340 ),
341 Schema.Null,
342 ]),
343 ),
344 _meta: Schema.optionalKey(
345 Schema.Union([
346 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
347 description:
348 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
349 }),
350 Schema.Null,
351 ]),
352 ),
353 }).annotate({
354 description: "Capabilities for recent files context.",
355 identifier: "NesRecentFilesCapabilities",
356 });
357
358 export type NesRelatedSnippetsCapabilities = {
359 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
360 };
361 export const NesRelatedSnippetsCapabilities = Schema.Struct({
362 _meta: Schema.optionalKey(
363 Schema.Union([
364 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
365 description:
366 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
367 }),
368 Schema.Null,
369 ]),
370 ),
371 }).annotate({
372 description: "Capabilities for related snippets context.",
373 identifier: "NesRelatedSnippetsCapabilities",
374 });
375
376 export type NesEditHistoryCapabilities = {
377 readonly maxCount?: number | null;
378 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
379 };
380 export const NesEditHistoryCapabilities = Schema.Struct({
381 maxCount: Schema.optionalKey(
382 Schema.Union([
383 Schema.Number.annotate({
384 description: "Maximum number of edit history entries the agent can use.",
385 format: "uint32",
386 })
387 .check(Schema.isInt().annotate({ expected: "an integer" }))
388 .check(
389 Schema.isGreaterThanOrEqualTo(0).annotate({
390 expected: "a value greater than or equal to 0",
391 }),
392 ),
393 Schema.Null,
394 ]),
395 ),
396 _meta: Schema.optionalKey(
397 Schema.Union([
398 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
399 description:
400 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
401 }),
402 Schema.Null,
403 ]),
404 ),
405 }).annotate({
406 description: "Capabilities for edit history context.",
407 identifier: "NesEditHistoryCapabilities",
408 });
409
410 export type NesUserActionsCapabilities = {
411 readonly maxCount?: number | null;
412 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
413 };
414 export const NesUserActionsCapabilities = Schema.Struct({
415 maxCount: Schema.optionalKey(
416 Schema.Union([
417 Schema.Number.annotate({
418 description: "Maximum number of user actions the agent can use.",
419 format: "uint32",
420 })
421 .check(Schema.isInt().annotate({ expected: "an integer" }))
422 .check(
423 Schema.isGreaterThanOrEqualTo(0).annotate({
424 expected: "a value greater than or equal to 0",
425 }),
426 ),
427 Schema.Null,
428 ]),
429 ),
430 _meta: Schema.optionalKey(
431 Schema.Union([
432 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
433 description:
434 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
435 }),
436 Schema.Null,
437 ]),
438 ),
439 }).annotate({
440 description: "Capabilities for user actions context.",
441 identifier: "NesUserActionsCapabilities",
442 });
443
444 export type NesOpenFilesCapabilities = {
445 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
446 };
447 export const NesOpenFilesCapabilities = Schema.Struct({
448 _meta: Schema.optionalKey(
449 Schema.Union([
450 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
451 description:
452 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
453 }),
454 Schema.Null,
455 ]),
456 ),
457 }).annotate({
458 description: "Capabilities for open files context.",
459 identifier: "NesOpenFilesCapabilities",
460 });
461
462 export type NesDiagnosticsCapabilities = {
463 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
464 };
465 export const NesDiagnosticsCapabilities = Schema.Struct({
466 _meta: Schema.optionalKey(
467 Schema.Union([
468 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
469 description:
470 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
471 }),
472 Schema.Null,
473 ]),
474 ),
475 }).annotate({
476 description: "Capabilities for diagnostics context.",
477 identifier: "NesDiagnosticsCapabilities",
478 });
479
480 export type PositionEncodingKind = "utf-16" | "utf-32" | "utf-8";
481 export const PositionEncodingKind = Schema.Union([
482 Schema.Literal("utf-16").annotate({
483 description: "Character offsets count UTF-16 code units. This is the default.",
484 }),
485 Schema.Literal("utf-32").annotate({
486 description: "Character offsets count Unicode code points.",
487 }),
488 Schema.Literal("utf-8").annotate({
489 description: "Character offsets count UTF-8 code units (bytes).",
490 }),
491 ]).annotate({
492 description:
493 "The encoding used for character offsets in positions.\n\nFollows the same conventions as LSP 3.17. The default is UTF-16.",
494 identifier: "PositionEncodingKind",
495 });
496
497 export type Role = "assistant" | "user";
498 export const Role = Schema.Union([
499 Schema.Literal("assistant").annotate({ description: "The assistant side of a conversation." }),
500 Schema.Literal("user").annotate({ description: "The user side of a conversation." }),
501 ]).annotate({
502 description: "The sender or recipient of messages and data in a conversation.",
503 identifier: "Role",
504 });
505
506 export type TextResourceContents = {
507 readonly mimeType?: string | null;
508 readonly text: string;
509 readonly uri: string;
510 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
511 };
512 export const TextResourceContents = Schema.Struct({
513 mimeType: Schema.optionalKey(
514 Schema.Union([
515 Schema.String.annotate({ description: "MIME type describing the encoded media payload." }),
516 Schema.Null,
517 ]),
518 ),
519 text: Schema.String.annotate({ description: "Text payload carried by this content block." }),
520 uri: Schema.String.annotate({
521 description: "URI associated with this resource or media payload.",
522 }),
523 _meta: Schema.optionalKey(
524 Schema.Union([
525 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
526 description:
527 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
528 }),
529 Schema.Null,
530 ]),
531 ),
532 }).annotate({ description: "Text-based resource contents.", identifier: "TextResourceContents" });
533
534 export type BlobResourceContents = {
535 readonly blob: string;
536 readonly mimeType?: string | null;
537 readonly uri: string;
538 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
539 };
540 export const BlobResourceContents = Schema.Struct({
541 blob: Schema.String.annotate({
542 description: "Base64-encoded bytes for a binary resource payload.",
543 }),
544 mimeType: Schema.optionalKey(
545 Schema.Union([
546 Schema.String.annotate({ description: "MIME type describing the encoded media payload." }),
547 Schema.Null,
548 ]),
549 ),
550 uri: Schema.String.annotate({
551 description: "URI associated with this resource or media payload.",
552 }),
553 _meta: Schema.optionalKey(
554 Schema.Union([
555 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
556 description:
557 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
558 }),
559 Schema.Null,
560 ]),
561 ),
562 }).annotate({ description: "Binary resource contents.", identifier: "BlobResourceContents" });
563
564 export type MessageId = string;
565 export const MessageId = Schema.String.annotate({
566 description: "Unique identifier for a message within a session.",
567 identifier: "MessageId",
568 });
569
570 export type ToolCallId = string;
571 export const ToolCallId = Schema.String.annotate({
572 description: "Unique identifier for a tool call within a session.",
573 identifier: "ToolCallId",
574 });
575
576 export type ToolKind =
577 | "read"
578 | "edit"
579 | "delete"
580 | "move"
581 | "search"
582 | "execute"
583 | "think"
584 | "fetch"
585 | "switch_mode"
586 | "other";
587 export const ToolKind = Schema.Union([
588 Schema.Literal("read").annotate({ description: "Reading files or data." }),
589 Schema.Literal("edit").annotate({ description: "Modifying files or content." }),
590 Schema.Literal("delete").annotate({ description: "Removing files or data." }),
591 Schema.Literal("move").annotate({ description: "Moving or renaming files." }),
592 Schema.Literal("search").annotate({ description: "Searching for information." }),
593 Schema.Literal("execute").annotate({ description: "Running commands or code." }),
594 Schema.Literal("think").annotate({ description: "Internal reasoning or planning." }),
595 Schema.Literal("fetch").annotate({ description: "Retrieving external data." }),
596 Schema.Literal("switch_mode").annotate({ description: "Switching the current session mode." }),
597 Schema.Literal("other").annotate({ description: "Other tool types (default)." }),
598 ]).annotate({
599 description:
600 "Categories of tools that can be invoked.\n\nTool kinds help clients choose appropriate icons and optimize how they\ndisplay tool execution progress.\n\nSee protocol docs: [Creating](https://agentclientprotocol.com/protocol/tool-calls#creating)",
601 identifier: "ToolKind",
602 });
603
604 export type ToolCallStatus = "pending" | "in_progress" | "completed" | "failed";
605 export const ToolCallStatus = Schema.Union([
606 Schema.Literal("pending").annotate({
607 description:
608 "The tool call hasn't started running yet because the input is either\nstreaming or we're awaiting approval.",
609 }),
610 Schema.Literal("in_progress").annotate({ description: "The tool call is currently running." }),
611 Schema.Literal("completed").annotate({ description: "The tool call completed successfully." }),
612 Schema.Literal("failed").annotate({ description: "The tool call failed with an error." }),
613 ]).annotate({
614 description:
615 "Execution status of a tool call.\n\nTool calls progress through different statuses during their lifecycle.\n\nSee protocol docs: [Status](https://agentclientprotocol.com/protocol/tool-calls#status)",
616 identifier: "ToolCallStatus",
617 });
618
619 export type TerminalId = string;
620 export const TerminalId = Schema.String.annotate({
621 description: "Typed identifier used for terminal values on the wire.",
622 identifier: "TerminalId",
623 });
624
625 export type ToolCallLocation = {
626 readonly path: string;
627 readonly line?: number | null;
628 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
629 };
630 export const ToolCallLocation = Schema.Struct({
631 path: Schema.String.annotate({
632 description: "The absolute file path being accessed or modified.",
633 }),
634 line: Schema.optionalKey(
635 Schema.Union([
636 Schema.Number.annotate({
637 description: "Optional line number within the file.",
638 format: "uint32",
639 })
640 .check(Schema.isInt().annotate({ expected: "an integer" }))
641 .check(
642 Schema.isGreaterThanOrEqualTo(0).annotate({
643 expected: "a value greater than or equal to 0",
644 }),
645 ),
646 Schema.Null,
647 ]),
648 ),
649 _meta: Schema.optionalKey(
650 Schema.Union([
651 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
652 description:
653 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
654 }),
655 Schema.Null,
656 ]),
657 ),
658 }).annotate({
659 description:
660 'A file location being accessed or modified by a tool.\n\nEnables clients to implement "follow-along" features that track\nwhich files the agent is working with in real-time.\n\nSee protocol docs: [Following the Agent](https://agentclientprotocol.com/protocol/tool-calls#following-the-agent)',
661 identifier: "ToolCallLocation",
662 });
663
664 export type PlanEntryPriority = "high" | "medium" | "low";
665 export const PlanEntryPriority = Schema.Union([
666 Schema.Literal("high").annotate({
667 description: "High priority task - critical to the overall goal.",
668 }),
669 Schema.Literal("medium").annotate({
670 description: "Medium priority task - important but not critical.",
671 }),
672 Schema.Literal("low").annotate({
673 description: "Low priority task - nice to have but not essential.",
674 }),
675 ]).annotate({
676 description:
677 "Priority levels for plan entries.\n\nUsed to indicate the relative importance or urgency of different\ntasks in the execution plan.\nSee protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)",
678 identifier: "PlanEntryPriority",
679 });
680
681 export type PlanEntryStatus = "pending" | "in_progress" | "completed";
682 export const PlanEntryStatus = Schema.Union([
683 Schema.Literal("pending").annotate({ description: "The task has not started yet." }),
684 Schema.Literal("in_progress").annotate({ description: "The task is currently being worked on." }),
685 Schema.Literal("completed").annotate({
686 description: "The task has been successfully completed.",
687 }),
688 ]).annotate({
689 description:
690 "Status of a plan entry in the execution flow.\n\nTracks the lifecycle of each task from planning through completion.\nSee protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)",
691 identifier: "PlanEntryStatus",
692 });
693
694 export type PlanId = string;
695 export const PlanId = Schema.String.annotate({
696 description:
697 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nUnique identifier for a plan within a session.",
698 identifier: "PlanId",
699 });
700
701 export type UnstructuredCommandInput = {
702 readonly hint: string;
703 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
704 };
705 export const UnstructuredCommandInput = Schema.Struct({
706 hint: Schema.String.annotate({
707 description: "A hint to display when the input hasn't been provided yet",
708 }),
709 _meta: Schema.optionalKey(
710 Schema.Union([
711 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
712 description:
713 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
714 }),
715 Schema.Null,
716 ]),
717 ),
718 }).annotate({
719 description: "All text that was typed after the command name is provided as input.",
720 identifier: "UnstructuredCommandInput",
721 });
722
723 export type SessionModeId = string;
724 export const SessionModeId = Schema.String.annotate({
725 description: "Unique identifier for a Session Mode.",
726 identifier: "SessionModeId",
727 });
728
729 export type SessionConfigId = string;
730 export const SessionConfigId = Schema.String.annotate({
731 description: "Unique identifier for a session configuration option.",
732 identifier: "SessionConfigId",
733 });
734
735 export type SessionConfigOptionCategory =
736 | "mode"
737 | "model"
738 | "model_config"
739 | "thought_level"
740 | string;
741 export const SessionConfigOptionCategory = Schema.Union([
742 Schema.Literal("mode").annotate({ description: "Session mode selector." }),
743 Schema.Literal("model").annotate({ description: "Model selector." }),
744 Schema.Literal("model_config").annotate({
745 description: "Model-related configuration parameter.",
746 }),
747 Schema.Literal("thought_level").annotate({ description: "Thought/reasoning level selector." }),
748 Schema.String.annotate({ title: "other", description: "Unknown / uncategorized selector." }),
749 ]).annotate({
750 description:
751 "Semantic category for a session configuration option.\n\nThis is intended to help Clients distinguish broadly common selectors (e.g. model selector vs\nsession mode selector vs thought/reasoning level) for UX purposes (keyboard shortcuts, icons,\nplacement). It MUST NOT be required for correctness. Clients MUST handle missing or unknown\ncategories gracefully.\n\nCategory names beginning with `_` are free for custom use, like other ACP extension methods.\nCategory names that do not begin with `_` are reserved for the ACP spec.",
752 identifier: "SessionConfigOptionCategory",
753 });
754
755 export type SessionConfigValueId = string;
756 export const SessionConfigValueId = Schema.String.annotate({
757 description: "Unique identifier for a session configuration option value.",
758 identifier: "SessionConfigValueId",
759 });
760
761 export type SessionConfigGroupId = string;
762 export const SessionConfigGroupId = Schema.String.annotate({
763 description: "Unique identifier for a session configuration option value group.",
764 identifier: "SessionConfigGroupId",
765 });
766
767 export type Cost = {
768 readonly amount: number;
769 readonly currency: string;
770 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
771 };
772 export const Cost = Schema.Struct({
773 amount: Schema.Number.annotate({
774 description: "Total cumulative cost for session.",
775 format: "double",
776 }).check(Schema.isFinite().annotate({ expected: "a finite number" })),
777 currency: Schema.String.annotate({ description: 'ISO 4217 currency code (e.g., "USD", "EUR").' }),
778 _meta: Schema.optionalKey(
779 Schema.Union([
780 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
781 description:
782 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
783 }),
784 Schema.Null,
785 ]),
786 ),
787 }).annotate({ description: "Cost information for a session.", identifier: "Cost" });
788
789 export type CompactionId = string;
790 export const CompactionId = Schema.String.annotate({
791 description:
792 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nUnique identifier for a context compaction within a session.",
793 identifier: "CompactionId",
794 });
795
796 export type CompactionStatus = "in_progress" | "completed" | "failed" | "cancelled" | string;
797 export const CompactionStatus = Schema.Union([
798 Schema.Literal("in_progress").annotate({
799 description: "Compaction has started and has not finished.",
800 }),
801 Schema.Literal("completed").annotate({ description: "Compaction finished successfully." }),
802 Schema.Literal("failed").annotate({ description: "Compaction finished unsuccessfully." }),
803 Schema.Literal("cancelled").annotate({
804 description: "Compaction was cancelled before it finished.",
805 }),
806 Schema.String.annotate({
807 title: "other",
808 description:
809 "Custom or future compaction status.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Other unknown values are reserved for future ACP statuses.",
810 }),
811 ]).annotate({
812 description:
813 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nLifecycle state of a context compaction.",
814 identifier: "CompactionStatus",
815 });
816
817 export type ElicitationId = string;
818 export const ElicitationId = Schema.String.annotate({
819 description: "Unique identifier for an elicitation.",
820 identifier: "ElicitationId",
821 });
822
823 export type McpConnectionId = string;
824 export const McpConnectionId = Schema.String.annotate({
825 description:
826 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA unique identifier for an active MCP-over-ACP connection.",
827 identifier: "McpConnectionId",
828 });
829
830 export type ExtNotification = Schema.Json;
831 export const ExtNotification = Schema.Json.annotate({
832 expected: "JSON value",
833 description:
834 "Allows the Agent to send an arbitrary notification that is not part of the ACP spec.\nExtension notifications provide a way to send one-way messages for custom functionality\nwhile maintaining protocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
835 identifier: "ExtNotification",
836 });
837
838 export type RequestId = null | number | string;
839 export const RequestId = Schema.Union([
840 Schema.Null.annotate({ title: "Null", description: "The JSON-RPC `null` request id." }),
841 Schema.Number.annotate({
842 title: "Number",
843 description: "A numeric JSON-RPC request id.",
844 format: "int64",
845 }).check(Schema.isInt().annotate({ expected: "an integer" })),
846 Schema.String.annotate({ title: "Str", description: "A string JSON-RPC request id." }),
847 ]).annotate({
848 description:
849 "JSON RPC Request Id\n\nAn 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\\]\n\nThe 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.\n\n\\[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.\n\n\\[2\\] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions.",
850 identifier: "RequestId",
851 });
852
853 export type PermissionOptionId = string;
854 export const PermissionOptionId = Schema.String.annotate({
855 description: "Unique identifier for a permission option.",
856 identifier: "PermissionOptionId",
857 });
858
859 export type PermissionOptionKind = "allow_once" | "allow_always" | "reject_once" | "reject_always";
860 export const PermissionOptionKind = Schema.Union([
861 Schema.Literal("allow_once").annotate({ description: "Allow this operation only this time." }),
862 Schema.Literal("allow_always").annotate({
863 description: "Allow this operation and remember the choice.",
864 }),
865 Schema.Literal("reject_once").annotate({ description: "Reject this operation only this time." }),
866 Schema.Literal("reject_always").annotate({
867 description: "Reject this operation and remember the choice.",
868 }),
869 ]).annotate({
870 description:
871 "The type of permission option being presented to the user.\n\nHelps clients choose appropriate icons and UI treatment.",
872 identifier: "PermissionOptionKind",
873 });
874
875 export type EnvVariable = {
876 readonly name: string;
877 readonly value: string;
878 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
879 };
880 export const EnvVariable = Schema.Struct({
881 name: Schema.String.annotate({ description: "The name of the environment variable." }),
882 value: Schema.String.annotate({ description: "The value to set for the environment variable." }),
883 _meta: Schema.optionalKey(
884 Schema.Union([
885 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
886 description:
887 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
888 }),
889 Schema.Null,
890 ]),
891 ),
892 }).annotate({
893 description: "An environment variable to set when launching an MCP server.",
894 identifier: "EnvVariable",
895 });
896
897 export type ElicitationSchemaType = "object";
898 export const ElicitationSchemaType = Schema.Union([
899 Schema.Literal("object").annotate({ description: "Object schema type." }),
900 ]).annotate({
901 description: "Type discriminator for elicitation schemas.",
902 identifier: "ElicitationSchemaType",
903 });
904
905 export type StringFormat = "email" | "uri" | "date" | "date-time";
906 export const StringFormat = Schema.Union([
907 Schema.Literal("email").annotate({ description: "Email address format." }),
908 Schema.Literal("uri").annotate({ description: "URI format." }),
909 Schema.Literal("date").annotate({ description: "Date format (YYYY-MM-DD)." }),
910 Schema.Literal("date-time").annotate({ description: "Date-time format (ISO 8601)." }),
911 ]).annotate({
912 description: "String format types for string properties in elicitation schemas.",
913 identifier: "StringFormat",
914 });
915
916 export type EnumOption = {
917 readonly const: string;
918 readonly title: string;
919 readonly description?: string | null;
920 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
921 };
922 export const EnumOption = Schema.Struct({
923 const: Schema.String.annotate({ description: "The constant value for this option." }),
924 title: Schema.String.annotate({ description: "Human-readable title for this option." }),
925 description: Schema.optionalKey(
926 Schema.Union([
927 Schema.String.annotate({
928 description:
929 "Human-readable description.\n\nOptional. Omitted and `null` are equivalent and mean no description is provided.",
930 }),
931 Schema.Null,
932 ]),
933 ),
934 _meta: Schema.optionalKey(
935 Schema.Union([
936 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
937 description:
938 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
939 }),
940 Schema.Null,
941 ]),
942 ),
943 }).annotate({
944 description:
945 "A titled enum option with a const value, human-readable title, and optional description.",
946 identifier: "EnumOption",
947 });
948
949 export type TitledMultiSelectItems = {
950 readonly anyOf: ReadonlyArray<EnumOption>;
951 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
952 };
953 export const TitledMultiSelectItems = Schema.Struct({
954 anyOf: Schema.Array(EnumOption).annotate({ description: "Titled enum options." }),
955 _meta: Schema.optionalKey(
956 Schema.Union([
957 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
958 description:
959 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
960 }),
961 Schema.Null,
962 ]),
963 ),
964 }).annotate({
965 description: "Items definition for titled multi-select enum properties.",
966 identifier: "TitledMultiSelectItems",
967 });
968
969 export type McpServerAcpId = string;
970 export const McpServerAcpId = Schema.String.annotate({
971 description:
972 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nUnique identifier for an MCP server using the ACP transport.\n\nThe value is opaque and generated by the ACP component providing the MCP server. It is\nused by `mcp/connect` to route connection requests back to the component that declared the\nserver.",
973 identifier: "McpServerAcpId",
974 });
975
976 export type ExtRequest = Schema.Json;
977 export const ExtRequest = Schema.Json.annotate({
978 expected: "JSON value",
979 description:
980 "Allows for sending an arbitrary request that is not part of the ACP spec.\nExtension methods provide a way to add custom functionality while maintaining\nprotocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
981 identifier: "ExtRequest",
982 });
983
984 export type ProtocolVersion = number;
985 export const ProtocolVersion = Schema.Number.annotate({
986 description:
987 "Protocol version identifier.\n\nThis version is only bumped for breaking changes.\nNon-breaking changes should be introduced via capabilities.",
988 format: "uint16",
989 })
990 .check(Schema.isInt().annotate({ expected: "an integer" }))
991 .check(
992 Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }),
993 )
994 .check(
995 Schema.isLessThanOrEqualTo(65535).annotate({
996 expected: "a value less than or equal to 65535",
997 identifier: "ProtocolVersion",
998 }),
999 );
1000
1001 export type AuthMethodId = string;
1002 export const AuthMethodId = Schema.String.annotate({
1003 description: "Typed identifier used for auth method values on the wire.",
1004 identifier: "AuthMethodId",
1005 });
1006
1007 export type Implementation = {
1008 readonly name: string;
1009 readonly title?: string | null;
1010 readonly version: string;
1011 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1012 };
1013 export const Implementation = Schema.Struct({
1014 name: Schema.String.annotate({
1015 description:
1016 "Intended for programmatic or logical use, but can be used as a display\nname fallback if title isn’t present.",
1017 }),
1018 title: Schema.optionalKey(
1019 Schema.Union([
1020 Schema.String.annotate({
1021 description:
1022 "Intended for UI and end-user contexts — optimized to be human-readable\nand easily understood.\n\nIf not provided, the name should be used for display.",
1023 }),
1024 Schema.Null,
1025 ]),
1026 ),
1027 version: Schema.String.annotate({
1028 description:
1029 'Version of the implementation. Can be displayed to the user or used\nfor debugging or metrics purposes. (e.g. "1.0.0").',
1030 }),
1031 _meta: Schema.optionalKey(
1032 Schema.Union([
1033 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1034 description:
1035 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1036 }),
1037 Schema.Null,
1038 ]),
1039 ),
1040 }).annotate({
1041 description:
1042 "Metadata about the implementation of the client or agent.\nDescribes the name and version of an ACP implementation, with an optional\ntitle for UI representation.",
1043 identifier: "Implementation",
1044 });
1045
1046 export type AuthenticateResponse = {
1047 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1048 };
1049 export const AuthenticateResponse = Schema.Struct({
1050 _meta: Schema.optionalKey(
1051 Schema.Union([
1052 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1053 description:
1054 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1055 }),
1056 Schema.Null,
1057 ]),
1058 ),
1059 }).annotate({
1060 description: "Response to the `authenticate` method.",
1061 identifier: "AuthenticateResponse",
1062 });
1063
1064 export type ProviderId = string;
1065 export const ProviderId = Schema.String.annotate({
1066 description:
1067 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nUnique identifier for a configurable LLM provider.",
1068 identifier: "ProviderId",
1069 });
1070
1071 export type LlmProtocol = "anthropic" | "openai" | "azure" | "vertex" | "bedrock" | string;
1072 export const LlmProtocol = Schema.Union([
1073 Schema.Literal("anthropic").annotate({ description: "Anthropic API protocol." }),
1074 Schema.Literal("openai").annotate({ description: "OpenAI API protocol." }),
1075 Schema.Literal("azure").annotate({ description: "Azure OpenAI API protocol." }),
1076 Schema.Literal("vertex").annotate({ description: "Google Vertex AI API protocol." }),
1077 Schema.Literal("bedrock").annotate({ description: "AWS Bedrock API protocol." }),
1078 Schema.String.annotate({ title: "other", description: "Unknown or custom protocol." }),
1079 ]).annotate({
1080 description:
1081 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nWell-known API protocol identifiers for LLM providers.\n\nAgents and clients MUST handle unknown protocol identifiers gracefully.\n\nProtocol names beginning with `_` are free for custom use, like other ACP extension methods.\nProtocol names that do not begin with `_` are reserved for the ACP spec.",
1082 identifier: "LlmProtocol",
1083 });
1084
1085 export type SetProviderResponse = { readonly _meta?: { readonly [x: string]: Schema.Json } | null };
1086 export const SetProviderResponse = Schema.Struct({
1087 _meta: Schema.optionalKey(
1088 Schema.Union([
1089 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1090 description:
1091 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1092 }),
1093 Schema.Null,
1094 ]),
1095 ),
1096 }).annotate({
1097 description:
1098 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse to `providers/set`.",
1099 identifier: "SetProviderResponse",
1100 });
1101
1102 export type DisableProviderResponse = {
1103 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1104 };
1105 export const DisableProviderResponse = Schema.Struct({
1106 _meta: Schema.optionalKey(
1107 Schema.Union([
1108 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1109 description:
1110 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1111 }),
1112 Schema.Null,
1113 ]),
1114 ),
1115 }).annotate({
1116 description:
1117 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse to `providers/disable`.",
1118 identifier: "DisableProviderResponse",
1119 });
1120
1121 export type LogoutResponse = { readonly _meta?: { readonly [x: string]: Schema.Json } | null };
1122 export const LogoutResponse = Schema.Struct({
1123 _meta: Schema.optionalKey(
1124 Schema.Union([
1125 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1126 description:
1127 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1128 }),
1129 Schema.Null,
1130 ]),
1131 ),
1132 }).annotate({ description: "Response to the `logout` method.", identifier: "LogoutResponse" });
1133
1134 export type DeleteSessionResponse = {
1135 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1136 };
1137 export const DeleteSessionResponse = Schema.Struct({
1138 _meta: Schema.optionalKey(
1139 Schema.Union([
1140 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1141 description:
1142 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1143 }),
1144 Schema.Null,
1145 ]),
1146 ),
1147 }).annotate({
1148 description: "Response from deleting a session.",
1149 identifier: "DeleteSessionResponse",
1150 });
1151
1152 export type CloseSessionResponse = {
1153 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1154 };
1155 export const CloseSessionResponse = Schema.Struct({
1156 _meta: Schema.optionalKey(
1157 Schema.Union([
1158 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1159 description:
1160 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1161 }),
1162 Schema.Null,
1163 ]),
1164 ),
1165 }).annotate({
1166 description: "Response from closing a session.",
1167 identifier: "CloseSessionResponse",
1168 });
1169
1170 export type SetSessionModeResponse = {
1171 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1172 };
1173 export const SetSessionModeResponse = Schema.Struct({
1174 _meta: Schema.optionalKey(
1175 Schema.Union([
1176 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1177 description:
1178 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1179 }),
1180 Schema.Null,
1181 ]),
1182 ),
1183 }).annotate({
1184 description: "Response to `session/set_mode` method.",
1185 identifier: "SetSessionModeResponse",
1186 });
1187
1188 export type StopReason = "end_turn" | "max_tokens" | "max_turn_requests" | "refusal" | "cancelled";
1189 export const StopReason = Schema.Union([
1190 Schema.Literal("end_turn").annotate({ description: "The turn ended successfully." }),
1191 Schema.Literal("max_tokens").annotate({
1192 description: "The turn ended because the agent reached the maximum number of tokens.",
1193 }),
1194 Schema.Literal("max_turn_requests").annotate({
1195 description:
1196 "The turn ended because the agent reached the maximum number of allowed\nagent requests between user turns.",
1197 }),
1198 Schema.Literal("refusal").annotate({
1199 description:
1200 "The turn ended because the agent refused to continue. The user prompt\nand everything that comes after it won't be included in the next\nprompt, so this should be reflected in the UI.",
1201 }),
1202 Schema.Literal("cancelled").annotate({
1203 description:
1204 "The turn was cancelled by the client via `session/cancel`.\n\nThis stop reason MUST be returned when the client sends a `session/cancel`\nnotification, even if the cancellation causes exceptions in underlying operations.\nAgents should catch these exceptions and return this semantically meaningful\nresponse to confirm successful cancellation.",
1205 }),
1206 ]).annotate({
1207 description:
1208 "Reasons why an agent stops processing a prompt turn.\n\nSee protocol docs: [Stop Reasons](https://agentclientprotocol.com/protocol/prompt-turn#stop-reasons)",
1209 identifier: "StopReason",
1210 });
1211
1212 export type Usage = {
1213 readonly totalTokens: number;
1214 readonly inputTokens: number;
1215 readonly outputTokens: number;
1216 readonly thoughtTokens?: number | null;
1217 readonly cachedReadTokens?: number | null;
1218 readonly cachedWriteTokens?: number | null;
1219 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1220 };
1221 export const Usage = Schema.Struct({
1222 totalTokens: Schema.Number.annotate({
1223 description: "Sum of all token types across session.",
1224 format: "uint64",
1225 })
1226 .check(Schema.isInt().annotate({ expected: "an integer" }))
1227 .check(
1228 Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }),
1229 ),
1230 inputTokens: Schema.Number.annotate({
1231 description: "Total input tokens across all turns.",
1232 format: "uint64",
1233 })
1234 .check(Schema.isInt().annotate({ expected: "an integer" }))
1235 .check(
1236 Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }),
1237 ),
1238 outputTokens: Schema.Number.annotate({
1239 description: "Total output tokens across all turns.",
1240 format: "uint64",
1241 })
1242 .check(Schema.isInt().annotate({ expected: "an integer" }))
1243 .check(
1244 Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }),
1245 ),
1246 thoughtTokens: Schema.optionalKey(
1247 Schema.Union([
1248 Schema.Number.annotate({ description: "Total thought/reasoning tokens", format: "uint64" })
1249 .check(Schema.isInt().annotate({ expected: "an integer" }))
1250 .check(
1251 Schema.isGreaterThanOrEqualTo(0).annotate({
1252 expected: "a value greater than or equal to 0",
1253 }),
1254 ),
1255 Schema.Null,
1256 ]),
1257 ),
1258 cachedReadTokens: Schema.optionalKey(
1259 Schema.Union([
1260 Schema.Number.annotate({ description: "Total cache read tokens.", format: "uint64" })
1261 .check(Schema.isInt().annotate({ expected: "an integer" }))
1262 .check(
1263 Schema.isGreaterThanOrEqualTo(0).annotate({
1264 expected: "a value greater than or equal to 0",
1265 }),
1266 ),
1267 Schema.Null,
1268 ]),
1269 ),
1270 cachedWriteTokens: Schema.optionalKey(
1271 Schema.Union([
1272 Schema.Number.annotate({ description: "Total cache write tokens.", format: "uint64" })
1273 .check(Schema.isInt().annotate({ expected: "an integer" }))
1274 .check(
1275 Schema.isGreaterThanOrEqualTo(0).annotate({
1276 expected: "a value greater than or equal to 0",
1277 }),
1278 ),
1279 Schema.Null,
1280 ]),
1281 ),
1282 _meta: Schema.optionalKey(
1283 Schema.Union([
1284 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1285 description:
1286 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1287 }),
1288 Schema.Null,
1289 ]),
1290 ),
1291 }).annotate({
1292 description:
1293 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nToken usage information for a prompt turn.",
1294 identifier: "Usage",
1295 });
1296
1297 export type Position = {
1298 readonly line: number;
1299 readonly character: number;
1300 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1301 };
1302 export const Position = Schema.Struct({
1303 line: Schema.Number.annotate({ description: "Zero-based line number.", format: "uint32" })
1304 .check(Schema.isInt().annotate({ expected: "an integer" }))
1305 .check(
1306 Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }),
1307 ),
1308 character: Schema.Number.annotate({
1309 description: "Zero-based character offset (encoding-dependent).",
1310 format: "uint32",
1311 })
1312 .check(Schema.isInt().annotate({ expected: "an integer" }))
1313 .check(
1314 Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }),
1315 ),
1316 _meta: Schema.optionalKey(
1317 Schema.Union([
1318 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1319 description:
1320 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1321 }),
1322 Schema.Null,
1323 ]),
1324 ),
1325 }).annotate({
1326 description:
1327 "A zero-based position in a text document.\n\nThe meaning of `character` depends on the negotiated position encoding.",
1328 identifier: "Position",
1329 });
1330
1331 export type CloseNesResponse = { readonly _meta?: { readonly [x: string]: Schema.Json } | null };
1332 export const CloseNesResponse = Schema.Struct({
1333 _meta: Schema.optionalKey(
1334 Schema.Union([
1335 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1336 description:
1337 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1338 }),
1339 Schema.Null,
1340 ]),
1341 ),
1342 }).annotate({
1343 description: "Response from closing an NES session.",
1344 identifier: "CloseNesResponse",
1345 });
1346
1347 export type ExtResponse = Schema.Json;
1348 export const ExtResponse = Schema.Json.annotate({
1349 expected: "JSON value",
1350 description:
1351 "Allows for sending an arbitrary response to an [`ExtRequest`] that is not part of the ACP spec.\nExtension methods provide a way to add custom functionality while maintaining\nprotocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1352 identifier: "ExtResponse",
1353 });
1354
1355 export type MessageMcpResponse = Schema.Json;
1356 export const MessageMcpResponse = Schema.Json.annotate({
1357 expected: "JSON value",
1358 description:
1359 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse to `mcp/message`.\n\nThis is the inner MCP response result payload. Any JSON value is valid.",
1360 identifier: "MessageMcpResponse",
1361 });
1362
1363 export type ErrorCode =
1364 | -32700
1365 | -32600
1366 | -32601
1367 | -32602
1368 | -32603
1369 | -32800
1370 | -32000
1371 | -32002
1372 | number;
1373 export const ErrorCode = Schema.Union([
1374 Schema.Literal(-32700).annotate({
1375 title: "Parse error",
1376 description:
1377 "**Parse error**: Invalid JSON was received by the server.\nAn error occurred on the server while parsing the JSON text.",
1378 format: "int32",
1379 }),
1380 Schema.Literal(-32600).annotate({
1381 title: "Invalid request",
1382 description: "**Invalid request**: The JSON sent is not a valid Request object.",
1383 format: "int32",
1384 }),
1385 Schema.Literal(-32601).annotate({
1386 title: "Method not found",
1387 description: "**Method not found**: The method does not exist or is not available.",
1388 format: "int32",
1389 }),
1390 Schema.Literal(-32602).annotate({
1391 title: "Invalid params",
1392 description: "**Invalid params**: Invalid method parameter(s).",
1393 format: "int32",
1394 }),
1395 Schema.Literal(-32603).annotate({
1396 title: "Internal error",
1397 description:
1398 "**Internal error**: Internal JSON-RPC error.\nReserved for implementation-defined server errors.",
1399 format: "int32",
1400 }),
1401 Schema.Literal(-32800).annotate({
1402 title: "Request cancelled",
1403 description:
1404 "**Request cancelled**: Execution of the method was aborted either due to a cancellation request from the caller or\nbecause of resource constraints or shutdown.",
1405 format: "int32",
1406 }),
1407 Schema.Literal(-32000).annotate({
1408 title: "Authentication required",
1409 description:
1410 "**Authentication required**: Authentication is required before this operation can be performed.",
1411 format: "int32",
1412 }),
1413 Schema.Literal(-32002).annotate({
1414 title: "Resource not found",
1415 description: "**Resource not found**: A given resource, such as a file, was not found.",
1416 format: "int32",
1417 }),
1418 Schema.Number.annotate({
1419 title: "Other",
1420 description: "Other undefined error code.",
1421 format: "int32",
1422 }).check(Schema.isInt().annotate({ expected: "an integer" })),
1423 ]).annotate({
1424 description:
1425 "Predefined error codes for common JSON-RPC and ACP-specific errors.\n\nThese codes follow the JSON-RPC 2.0 specification for standard errors\nand use the reserved range (-32000 to -32099) for protocol-specific errors.",
1426 identifier: "ErrorCode",
1427 });
1428
1429 export type FileSystemCapabilities = {
1430 readonly readTextFile?: boolean;
1431 readonly writeTextFile?: boolean;
1432 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1433 };
1434 export const FileSystemCapabilities = Schema.Struct({
1435 readTextFile: Schema.optionalKey(
1436 Schema.Boolean.annotate({
1437 description: "Whether the Client supports `fs/read_text_file` requests.",
1438 default: false,
1439 }),
1440 ),
1441 writeTextFile: Schema.optionalKey(
1442 Schema.Boolean.annotate({
1443 description: "Whether the Client supports `fs/write_text_file` requests.",
1444 default: false,
1445 }),
1446 ),
1447 _meta: Schema.optionalKey(
1448 Schema.Union([
1449 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1450 description:
1451 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1452 }),
1453 Schema.Null,
1454 ]),
1455 ),
1456 }).annotate({
1457 description:
1458 "File system capabilities that a client may support.\n\nSee protocol docs: [FileSystem](https://agentclientprotocol.com/protocol/initialization#filesystem)",
1459 identifier: "FileSystemCapabilities",
1460 });
1461
1462 export type CompactionCapabilities = { readonly [x: string]: never };
1463 export const CompactionCapabilities = Schema.Record(Schema.String, Schema.Never).annotate({
1464 description:
1465 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nClient support for ID-addressed context compaction updates.",
1466 identifier: "CompactionCapabilities",
1467 });
1468
1469 export type BooleanConfigOptionCapabilities = {
1470 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1471 };
1472 export const BooleanConfigOptionCapabilities = Schema.Struct({
1473 _meta: Schema.optionalKey(
1474 Schema.Union([
1475 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1476 description:
1477 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1478 }),
1479 Schema.Null,
1480 ]),
1481 ),
1482 }).annotate({
1483 description:
1484 "Capabilities for boolean session configuration options.\n\nSupplying `{}` means the client supports boolean session configuration options.",
1485 identifier: "BooleanConfigOptionCapabilities",
1486 });
1487
1488 export type PlanCapabilities = { readonly _meta?: { readonly [x: string]: Schema.Json } | null };
1489 export const PlanCapabilities = Schema.Struct({
1490 _meta: Schema.optionalKey(
1491 Schema.Union([
1492 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1493 description:
1494 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1495 }),
1496 Schema.Null,
1497 ]),
1498 ),
1499 }).annotate({
1500 description:
1501 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for receiving `plan_update` and `plan_removed` session updates.",
1502 identifier: "PlanCapabilities",
1503 });
1504
1505 export type AuthCapabilities = {
1506 readonly terminal?: boolean;
1507 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1508 };
1509 export const AuthCapabilities = Schema.Struct({
1510 terminal: Schema.optionalKey(
1511 Schema.Boolean.annotate({
1512 description:
1513 "Whether the client supports `terminal` authentication methods.\n\nThe client should set this to `true` only when it can reproduce the\nconfigured agent invocation in an interactive terminal. When `true`, the\nagent may include `terminal` entries in its authentication methods.",
1514 default: false,
1515 }),
1516 ),
1517 _meta: Schema.optionalKey(
1518 Schema.Union([
1519 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1520 description:
1521 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1522 }),
1523 Schema.Null,
1524 ]),
1525 ),
1526 }).annotate({
1527 description:
1528 "Authentication capabilities supported by the client.\n\nAdvertised during initialization to inform the agent which authentication\nmethod types the client can handle. This governs opt-in types that require\nadditional client-side support.",
1529 identifier: "AuthCapabilities",
1530 });
1531
1532 export type ElicitationFormCapabilities = {
1533 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1534 };
1535 export const ElicitationFormCapabilities = Schema.Struct({
1536 _meta: Schema.optionalKey(
1537 Schema.Union([
1538 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1539 description:
1540 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1541 }),
1542 Schema.Null,
1543 ]),
1544 ),
1545 }).annotate({
1546 description:
1547 "Form-based elicitation capabilities.\n\nSupplying `{}` means the client supports form-based elicitation.",
1548 identifier: "ElicitationFormCapabilities",
1549 });
1550
1551 export type ElicitationUrlCapabilities = {
1552 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1553 };
1554 export const ElicitationUrlCapabilities = Schema.Struct({
1555 _meta: Schema.optionalKey(
1556 Schema.Union([
1557 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1558 description:
1559 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1560 }),
1561 Schema.Null,
1562 ]),
1563 ),
1564 }).annotate({
1565 description:
1566 "URL-based elicitation capabilities.\n\nSupplying `{}` means the client supports URL-based elicitation.",
1567 identifier: "ElicitationUrlCapabilities",
1568 });
1569
1570 export type NesJumpCapabilities = { readonly _meta?: { readonly [x: string]: Schema.Json } | null };
1571 export const NesJumpCapabilities = Schema.Struct({
1572 _meta: Schema.optionalKey(
1573 Schema.Union([
1574 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1575 description:
1576 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1577 }),
1578 Schema.Null,
1579 ]),
1580 ),
1581 }).annotate({
1582 description: "Marker for jump suggestion support.",
1583 identifier: "NesJumpCapabilities",
1584 });
1585
1586 export type NesRenameCapabilities = {
1587 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1588 };
1589 export const NesRenameCapabilities = Schema.Struct({
1590 _meta: Schema.optionalKey(
1591 Schema.Union([
1592 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1593 description:
1594 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1595 }),
1596 Schema.Null,
1597 ]),
1598 ),
1599 }).annotate({
1600 description: "Marker for rename suggestion support.",
1601 identifier: "NesRenameCapabilities",
1602 });
1603
1604 export type NesSearchAndReplaceCapabilities = {
1605 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1606 };
1607 export const NesSearchAndReplaceCapabilities = Schema.Struct({
1608 _meta: Schema.optionalKey(
1609 Schema.Union([
1610 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1611 description:
1612 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1613 }),
1614 Schema.Null,
1615 ]),
1616 ),
1617 }).annotate({
1618 description: "Marker for search and replace suggestion support.",
1619 identifier: "NesSearchAndReplaceCapabilities",
1620 });
1621
1622 export type NesRejectReason = "rejected" | "ignored" | "replaced" | "cancelled";
1623 export const NesRejectReason = Schema.Union([
1624 Schema.Literal("rejected").annotate({
1625 description: "The user explicitly dismissed the suggestion.",
1626 }),
1627 Schema.Literal("ignored").annotate({
1628 description: "The suggestion was shown but the user continued editing without interacting.",
1629 }),
1630 Schema.Literal("replaced").annotate({
1631 description: "The suggestion was superseded by a newer suggestion.",
1632 }),
1633 Schema.Literal("cancelled").annotate({
1634 description: "The request was cancelled before the agent returned a response.",
1635 }),
1636 ]).annotate({
1637 description: "The reason a suggestion was rejected.",
1638 identifier: "NesRejectReason",
1639 });
1640
1641 export type ListProvidersRequest = {
1642 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1643 };
1644 export const ListProvidersRequest = Schema.Struct({
1645 _meta: Schema.optionalKey(
1646 Schema.Union([
1647 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1648 description:
1649 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1650 }),
1651 Schema.Null,
1652 ]),
1653 ),
1654 }).annotate({
1655 description:
1656 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for `providers/list`.",
1657 identifier: "ListProvidersRequest",
1658 });
1659
1660 export type LogoutRequest = { readonly _meta?: { readonly [x: string]: Schema.Json } | null };
1661 export const LogoutRequest = Schema.Struct({
1662 _meta: Schema.optionalKey(
1663 Schema.Union([
1664 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1665 description:
1666 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1667 }),
1668 Schema.Null,
1669 ]),
1670 ),
1671 }).annotate({
1672 description:
1673 "Request parameters for the logout method.\n\nTerminates the current authenticated session.",
1674 identifier: "LogoutRequest",
1675 });
1676
1677 export type HttpHeader = {
1678 readonly name: string;
1679 readonly value: string;
1680 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1681 };
1682 export const HttpHeader = Schema.Struct({
1683 name: Schema.String.annotate({ description: "The name of the HTTP header." }),
1684 value: Schema.String.annotate({ description: "The value to set for the HTTP header." }),
1685 _meta: Schema.optionalKey(
1686 Schema.Union([
1687 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1688 description:
1689 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1690 }),
1691 Schema.Null,
1692 ]),
1693 ),
1694 }).annotate({
1695 description: "An HTTP header to set when making requests to the MCP server.",
1696 identifier: "HttpHeader",
1697 });
1698
1699 export type ListSessionsRequest = {
1700 readonly cwd?: string | null;
1701 readonly cursor?: string | null;
1702 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1703 };
1704 export const ListSessionsRequest = Schema.Struct({
1705 cwd: Schema.optionalKey(
1706 Schema.Union([
1707 Schema.String.annotate({
1708 description: "Filter sessions by working directory. Must be an absolute path.",
1709 }),
1710 Schema.Null,
1711 ]),
1712 ),
1713 cursor: Schema.optionalKey(
1714 Schema.Union([
1715 Schema.String.annotate({
1716 description:
1717 "Opaque cursor token from a previous response's nextCursor field for cursor-based pagination",
1718 }),
1719 Schema.Null,
1720 ]),
1721 ),
1722 _meta: Schema.optionalKey(
1723 Schema.Union([
1724 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1725 description:
1726 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1727 }),
1728 Schema.Null,
1729 ]),
1730 ),
1731 }).annotate({
1732 description:
1733 "Request parameters for listing existing sessions.\n\nOnly available if the Agent supports the `sessionCapabilities.list` capability.",
1734 identifier: "ListSessionsRequest",
1735 });
1736
1737 export type WorkspaceFolder = {
1738 readonly uri: string;
1739 readonly name: string;
1740 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1741 };
1742 export const WorkspaceFolder = Schema.Struct({
1743 uri: Schema.String.annotate({ description: "The URI of the folder." }),
1744 name: Schema.String.annotate({ description: "The display name of the folder." }),
1745 _meta: Schema.optionalKey(
1746 Schema.Union([
1747 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1748 description:
1749 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1750 }),
1751 Schema.Null,
1752 ]),
1753 ),
1754 }).annotate({ description: "A workspace folder.", identifier: "WorkspaceFolder" });
1755
1756 export type NesRepository = {
1757 readonly name: string;
1758 readonly owner: string;
1759 readonly remoteUrl: string;
1760 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1761 };
1762 export const NesRepository = Schema.Struct({
1763 name: Schema.String.annotate({ description: "The repository name." }),
1764 owner: Schema.String.annotate({ description: "The repository owner." }),
1765 remoteUrl: Schema.String.annotate({ description: "The remote URL of the repository." }),
1766 _meta: Schema.optionalKey(
1767 Schema.Union([
1768 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1769 description:
1770 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1771 }),
1772 Schema.Null,
1773 ]),
1774 ),
1775 }).annotate({
1776 description: "Repository metadata for an NES session.",
1777 identifier: "NesRepository",
1778 });
1779
1780 export type NesTriggerKind = "automatic" | "diagnostic" | "manual";
1781 export const NesTriggerKind = Schema.Union([
1782 Schema.Literal("automatic").annotate({
1783 description: "Triggered by user typing or cursor movement.",
1784 }),
1785 Schema.Literal("diagnostic").annotate({
1786 description: "Triggered by a diagnostic appearing at or near the cursor.",
1787 }),
1788 Schema.Literal("manual").annotate({
1789 description: "Triggered by an explicit user action (keyboard shortcut).",
1790 }),
1791 ]).annotate({
1792 description: "What triggered the suggestion request.",
1793 identifier: "NesTriggerKind",
1794 });
1795
1796 export type NesRecentFile = {
1797 readonly uri: string;
1798 readonly languageId: string;
1799 readonly text: string;
1800 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1801 };
1802 export const NesRecentFile = Schema.Struct({
1803 uri: Schema.String.annotate({ description: "The URI of the file." }),
1804 languageId: Schema.String.annotate({ description: "The language identifier." }),
1805 text: Schema.String.annotate({ description: "The full text content of the file." }),
1806 _meta: Schema.optionalKey(
1807 Schema.Union([
1808 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1809 description:
1810 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1811 }),
1812 Schema.Null,
1813 ]),
1814 ),
1815 }).annotate({ description: "A recently accessed file.", identifier: "NesRecentFile" });
1816
1817 export type NesExcerpt = {
1818 readonly startLine: number;
1819 readonly endLine: number;
1820 readonly text: string;
1821 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1822 };
1823 export const NesExcerpt = Schema.Struct({
1824 startLine: Schema.Number.annotate({
1825 description: "The start line of the excerpt (zero-based).",
1826 format: "uint32",
1827 })
1828 .check(Schema.isInt().annotate({ expected: "an integer" }))
1829 .check(
1830 Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }),
1831 ),
1832 endLine: Schema.Number.annotate({
1833 description: "The end line of the excerpt (zero-based).",
1834 format: "uint32",
1835 })
1836 .check(Schema.isInt().annotate({ expected: "an integer" }))
1837 .check(
1838 Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }),
1839 ),
1840 text: Schema.String.annotate({ description: "The text content of the excerpt." }),
1841 _meta: Schema.optionalKey(
1842 Schema.Union([
1843 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1844 description:
1845 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1846 }),
1847 Schema.Null,
1848 ]),
1849 ),
1850 }).annotate({ description: "A code excerpt from a file.", identifier: "NesExcerpt" });
1851
1852 export type NesEditHistoryEntry = {
1853 readonly uri: string;
1854 readonly diff: string;
1855 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1856 };
1857 export const NesEditHistoryEntry = Schema.Struct({
1858 uri: Schema.String.annotate({ description: "The URI of the edited file." }),
1859 diff: Schema.String.annotate({ description: "A diff representing the edit." }),
1860 _meta: Schema.optionalKey(
1861 Schema.Union([
1862 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1863 description:
1864 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1865 }),
1866 Schema.Null,
1867 ]),
1868 ),
1869 }).annotate({ description: "An entry in the edit history.", identifier: "NesEditHistoryEntry" });
1870
1871 export type NesDiagnosticSeverity = "error" | "warning" | "information" | "hint";
1872 export const NesDiagnosticSeverity = Schema.Union([
1873 Schema.Literal("error").annotate({ description: "An error." }),
1874 Schema.Literal("warning").annotate({ description: "A warning." }),
1875 Schema.Literal("information").annotate({ description: "An informational message." }),
1876 Schema.Literal("hint").annotate({ description: "A hint." }),
1877 ]).annotate({ description: "Severity of a diagnostic.", identifier: "NesDiagnosticSeverity" });
1878
1879 export type WriteTextFileResponse = {
1880 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1881 };
1882 export const WriteTextFileResponse = Schema.Struct({
1883 _meta: Schema.optionalKey(
1884 Schema.Union([
1885 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1886 description:
1887 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1888 }),
1889 Schema.Null,
1890 ]),
1891 ),
1892 }).annotate({
1893 description: "Response to `fs/write_text_file`",
1894 identifier: "WriteTextFileResponse",
1895 });
1896
1897 export type ReadTextFileResponse = {
1898 readonly content: string;
1899 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1900 };
1901 export const ReadTextFileResponse = Schema.Struct({
1902 content: Schema.String.annotate({ description: "Content payload returned by this response." }),
1903 _meta: Schema.optionalKey(
1904 Schema.Union([
1905 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1906 description:
1907 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1908 }),
1909 Schema.Null,
1910 ]),
1911 ),
1912 }).annotate({
1913 description: "Response containing the contents of a text file.",
1914 identifier: "ReadTextFileResponse",
1915 });
1916
1917 export type TerminalExitStatus = {
1918 readonly exitCode?: number | null;
1919 readonly signal?: string | null;
1920 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1921 };
1922 export const TerminalExitStatus = Schema.Struct({
1923 exitCode: Schema.optionalKey(
1924 Schema.Union([
1925 Schema.Number.annotate({
1926 description: "The process exit code (may be null if terminated by signal).",
1927 format: "uint32",
1928 })
1929 .check(Schema.isInt().annotate({ expected: "an integer" }))
1930 .check(
1931 Schema.isGreaterThanOrEqualTo(0).annotate({
1932 expected: "a value greater than or equal to 0",
1933 }),
1934 ),
1935 Schema.Null,
1936 ]),
1937 ),
1938 signal: Schema.optionalKey(
1939 Schema.Union([
1940 Schema.String.annotate({
1941 description: "The signal that terminated the process (may be null if exited normally).",
1942 }),
1943 Schema.Null,
1944 ]),
1945 ),
1946 _meta: Schema.optionalKey(
1947 Schema.Union([
1948 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1949 description:
1950 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1951 }),
1952 Schema.Null,
1953 ]),
1954 ),
1955 }).annotate({
1956 description: "Exit status of a terminal command.",
1957 identifier: "TerminalExitStatus",
1958 });
1959
1960 export type ReleaseTerminalResponse = {
1961 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1962 };
1963 export const ReleaseTerminalResponse = Schema.Struct({
1964 _meta: Schema.optionalKey(
1965 Schema.Union([
1966 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
1967 description:
1968 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
1969 }),
1970 Schema.Null,
1971 ]),
1972 ),
1973 }).annotate({
1974 description: "Response to terminal/release method",
1975 identifier: "ReleaseTerminalResponse",
1976 });
1977
1978 export type WaitForTerminalExitResponse = {
1979 readonly exitCode?: number | null;
1980 readonly signal?: string | null;
1981 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
1982 };
1983 export const WaitForTerminalExitResponse = Schema.Struct({
1984 exitCode: Schema.optionalKey(
1985 Schema.Union([
1986 Schema.Number.annotate({
1987 description: "The process exit code (may be null if terminated by signal).",
1988 format: "uint32",
1989 })
1990 .check(Schema.isInt().annotate({ expected: "an integer" }))
1991 .check(
1992 Schema.isGreaterThanOrEqualTo(0).annotate({
1993 expected: "a value greater than or equal to 0",
1994 }),
1995 ),
1996 Schema.Null,
1997 ]),
1998 ),
1999 signal: Schema.optionalKey(
2000 Schema.Union([
2001 Schema.String.annotate({
2002 description: "The signal that terminated the process (may be null if exited normally).",
2003 }),
2004 Schema.Null,
2005 ]),
2006 ),
2007 _meta: Schema.optionalKey(
2008 Schema.Union([
2009 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2010 description:
2011 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2012 }),
2013 Schema.Null,
2014 ]),
2015 ),
2016 }).annotate({
2017 description: "Response containing the exit status of a terminal command.",
2018 identifier: "WaitForTerminalExitResponse",
2019 });
2020
2021 export type KillTerminalResponse = {
2022 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2023 };
2024 export const KillTerminalResponse = Schema.Struct({
2025 _meta: Schema.optionalKey(
2026 Schema.Union([
2027 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2028 description:
2029 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2030 }),
2031 Schema.Null,
2032 ]),
2033 ),
2034 }).annotate({
2035 description: "Response to `terminal/kill` method",
2036 identifier: "KillTerminalResponse",
2037 });
2038
2039 export type ElicitationContentValue = string | number | number | boolean | ReadonlyArray<string>;
2040 export const ElicitationContentValue = Schema.Union([
2041 Schema.String.annotate({
2042 title: "String",
2043 description: "String value accepted in elicitation response content.",
2044 }),
2045 Schema.Number.annotate({
2046 title: "Integer",
2047 description: "Integer value accepted in elicitation response content.",
2048 format: "int64",
2049 }).check(Schema.isInt().annotate({ expected: "an integer" })),
2050 Schema.Number.annotate({
2051 title: "Number",
2052 description: "Number value accepted in elicitation response content.",
2053 format: "double",
2054 }).check(Schema.isFinite().annotate({ expected: "a finite number" })),
2055 Schema.Boolean.annotate({
2056 title: "Boolean",
2057 description: "Boolean value accepted in elicitation response content.",
2058 }),
2059 Schema.Array(Schema.String).annotate({
2060 title: "StringArray",
2061 description: "String array value accepted in elicitation response content.",
2062 }),
2063 ]).annotate({
2064 description: "Allowed wire representations for [`ElicitationContentValue`].",
2065 identifier: "ElicitationContentValue",
2066 });
2067
2068 export type DisconnectMcpResponse = {
2069 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2070 };
2071 export const DisconnectMcpResponse = Schema.Struct({
2072 _meta: Schema.optionalKey(
2073 Schema.Union([
2074 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2075 description:
2076 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2077 }),
2078 Schema.Null,
2079 ]),
2080 ),
2081 }).annotate({
2082 description:
2083 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse to `mcp/disconnect`.",
2084 identifier: "DisconnectMcpResponse",
2085 });
2086
2087 export type WriteTextFileRequest = {
2088 readonly sessionId: SessionId;
2089 readonly path: string;
2090 readonly content: string;
2091 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2092 };
2093 export const WriteTextFileRequest = Schema.Struct({
2094 sessionId: Schema.suspend((): Schema.Codec<SessionId> => SessionId).annotate({
2095 description: "The session ID for this request.",
2096 }),
2097 path: Schema.String.annotate({ description: "Absolute path to the file to write." }),
2098 content: Schema.String.annotate({ description: "The text content to write to the file." }),
2099 _meta: Schema.optionalKey(
2100 Schema.Union([
2101 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2102 description:
2103 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2104 }),
2105 Schema.Null,
2106 ]),
2107 ),
2108 }).annotate({
2109 description:
2110 "Request to write content to a text file.\n\nOnly available if the client supports the `fs.writeTextFile` capability.",
2111 identifier: "WriteTextFileRequest",
2112 });
2113
2114 export type ReadTextFileRequest = {
2115 readonly sessionId: SessionId;
2116 readonly path: string;
2117 readonly line?: number | null;
2118 readonly limit?: number | null;
2119 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2120 };
2121 export const ReadTextFileRequest = Schema.Struct({
2122 sessionId: Schema.suspend((): Schema.Codec<SessionId> => SessionId).annotate({
2123 description: "The session ID for this request.",
2124 }),
2125 path: Schema.String.annotate({ description: "Absolute path to the file to read." }),
2126 line: Schema.optionalKey(
2127 Schema.Union([
2128 Schema.Number.annotate({
2129 description: "Line number to start reading from (1-based).",
2130 format: "uint32",
2131 })
2132 .check(Schema.isInt().annotate({ expected: "an integer" }))
2133 .check(
2134 Schema.isGreaterThanOrEqualTo(0).annotate({
2135 expected: "a value greater than or equal to 0",
2136 }),
2137 ),
2138 Schema.Null,
2139 ]),
2140 ),
2141 limit: Schema.optionalKey(
2142 Schema.Union([
2143 Schema.Number.annotate({ description: "Maximum number of lines to read.", format: "uint32" })
2144 .check(Schema.isInt().annotate({ expected: "an integer" }))
2145 .check(
2146 Schema.isGreaterThanOrEqualTo(0).annotate({
2147 expected: "a value greater than or equal to 0",
2148 }),
2149 ),
2150 Schema.Null,
2151 ]),
2152 ),
2153 _meta: Schema.optionalKey(
2154 Schema.Union([
2155 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2156 description:
2157 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2158 }),
2159 Schema.Null,
2160 ]),
2161 ),
2162 }).annotate({
2163 description:
2164 "Request to read content from a text file.\n\nOnly available if the client supports the `fs.readTextFile` capability.",
2165 identifier: "ReadTextFileRequest",
2166 });
2167
2168 export type SessionInfo = {
2169 readonly sessionId: SessionId;
2170 readonly cwd: string;
2171 readonly additionalDirectories?: ReadonlyArray<string>;
2172 readonly title?: string | null;
2173 readonly updatedAt?: string | null;
2174 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2175 };
2176 export const SessionInfo = Schema.Struct({
2177 sessionId: Schema.suspend((): Schema.Codec<SessionId> => SessionId).annotate({
2178 description: "Unique identifier for the session",
2179 }),
2180 cwd: Schema.String.annotate({
2181 description: "The working directory for this session. Must be an absolute path.",
2182 }),
2183 additionalDirectories: Schema.optionalKey(
2184 Schema.Array(Schema.String).annotate({
2185 description:
2186 "Additional workspace roots reported for this session. Each path must be absolute.\n\nWhen present, this is the complete ordered additional-root list reported\nby the Agent. Omitted and empty values are equivalent: the response\nreports no additional roots.",
2187 }),
2188 ),
2189 title: Schema.optionalKey(
2190 Schema.Union([
2191 Schema.String.annotate({ description: "Human-readable title for the session" }),
2192 Schema.Null,
2193 ]),
2194 ),
2195 updatedAt: Schema.optionalKey(
2196 Schema.Union([
2197 Schema.String.annotate({ description: "ISO 8601 timestamp of last activity" }),
2198 Schema.Null,
2199 ]),
2200 ),
2201 _meta: Schema.optionalKey(
2202 Schema.Union([
2203 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2204 description:
2205 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2206 }),
2207 Schema.Null,
2208 ]),
2209 ),
2210 }).annotate({
2211 description: "Information about a session returned by session/list",
2212 identifier: "SessionInfo",
2213 });
2214
2215 export type StartNesResponse = {
2216 readonly sessionId: SessionId;
2217 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2218 };
2219 export const StartNesResponse = Schema.Struct({
2220 sessionId: Schema.suspend((): Schema.Codec<SessionId> => SessionId).annotate({
2221 description: "The session ID for the newly started NES session.",
2222 }),
2223 _meta: Schema.optionalKey(
2224 Schema.Union([
2225 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2226 description:
2227 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2228 }),
2229 Schema.Null,
2230 ]),
2231 ),
2232 }).annotate({ description: "Response to `nes/start`.", identifier: "StartNesResponse" });
2233
2234 export type CancelNotification = {
2235 readonly sessionId: SessionId;
2236 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2237 };
2238 export const CancelNotification = Schema.Struct({
2239 sessionId: Schema.suspend((): Schema.Codec<SessionId> => SessionId).annotate({
2240 description: "The ID of the session to cancel operations for.",
2241 }),
2242 _meta: Schema.optionalKey(
2243 Schema.Union([
2244 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2245 description:
2246 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2247 }),
2248 Schema.Null,
2249 ]),
2250 ),
2251 }).annotate({
2252 description:
2253 "Notification to cancel ongoing operations for a session.\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)",
2254 identifier: "CancelNotification",
2255 });
2256
2257 export type DidOpenDocumentNotification = {
2258 readonly sessionId: SessionId;
2259 readonly uri: string;
2260 readonly languageId: string;
2261 readonly version: number;
2262 readonly text: string;
2263 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2264 };
2265 export const DidOpenDocumentNotification = Schema.Struct({
2266 sessionId: Schema.suspend((): Schema.Codec<SessionId> => SessionId).annotate({
2267 description: "The session ID for this notification.",
2268 }),
2269 uri: Schema.String.annotate({ description: "The URI of the opened document." }),
2270 languageId: Schema.String.annotate({
2271 description: 'The language identifier of the document (e.g., "rust", "python").',
2272 }),
2273 version: Schema.Number.annotate({
2274 description: "The version number of the document.",
2275 format: "int64",
2276 }).check(Schema.isInt().annotate({ expected: "an integer" })),
2277 text: Schema.String.annotate({ description: "The full text content of the document." }),
2278 _meta: Schema.optionalKey(
2279 Schema.Union([
2280 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2281 description:
2282 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2283 }),
2284 Schema.Null,
2285 ]),
2286 ),
2287 }).annotate({
2288 description: "Notification sent when a file is opened in the editor.",
2289 identifier: "DidOpenDocumentNotification",
2290 });
2291
2292 export type DidCloseDocumentNotification = {
2293 readonly sessionId: SessionId;
2294 readonly uri: string;
2295 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2296 };
2297 export const DidCloseDocumentNotification = Schema.Struct({
2298 sessionId: Schema.suspend((): Schema.Codec<SessionId> => SessionId).annotate({
2299 description: "The session ID for this notification.",
2300 }),
2301 uri: Schema.String.annotate({ description: "The URI of the closed document." }),
2302 _meta: Schema.optionalKey(
2303 Schema.Union([
2304 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2305 description:
2306 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2307 }),
2308 Schema.Null,
2309 ]),
2310 ),
2311 }).annotate({
2312 description: "Notification sent when a file is closed.",
2313 identifier: "DidCloseDocumentNotification",
2314 });
2315
2316 export type DidSaveDocumentNotification = {
2317 readonly sessionId: SessionId;
2318 readonly uri: string;
2319 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2320 };
2321 export const DidSaveDocumentNotification = Schema.Struct({
2322 sessionId: Schema.suspend((): Schema.Codec<SessionId> => SessionId).annotate({
2323 description: "The session ID for this notification.",
2324 }),
2325 uri: Schema.String.annotate({ description: "The URI of the saved document." }),
2326 _meta: Schema.optionalKey(
2327 Schema.Union([
2328 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2329 description:
2330 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2331 }),
2332 Schema.Null,
2333 ]),
2334 ),
2335 }).annotate({
2336 description: "Notification sent when a file is saved.",
2337 identifier: "DidSaveDocumentNotification",
2338 });
2339
2340 export type DeleteSessionRequest = {
2341 readonly sessionId: SessionId;
2342 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2343 };
2344 export const DeleteSessionRequest = Schema.Struct({
2345 sessionId: Schema.suspend((): Schema.Codec<SessionId> => SessionId).annotate({
2346 description: "The ID of the session to delete.",
2347 }),
2348 _meta: Schema.optionalKey(
2349 Schema.Union([
2350 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2351 description:
2352 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2353 }),
2354 Schema.Null,
2355 ]),
2356 ),
2357 }).annotate({
2358 description:
2359 "Request parameters for deleting an existing session from `session/list`.\n\nOnly available if the Agent supports the `sessionCapabilities.delete` capability.",
2360 identifier: "DeleteSessionRequest",
2361 });
2362
2363 export type CloseSessionRequest = {
2364 readonly sessionId: SessionId;
2365 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2366 };
2367 export const CloseSessionRequest = Schema.Struct({
2368 sessionId: Schema.suspend((): Schema.Codec<SessionId> => SessionId).annotate({
2369 description: "The ID of the session to close.",
2370 }),
2371 _meta: Schema.optionalKey(
2372 Schema.Union([
2373 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2374 description:
2375 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2376 }),
2377 Schema.Null,
2378 ]),
2379 ),
2380 }).annotate({
2381 description:
2382 "Request parameters for closing an active session.\n\nIf supported, the agent **must** cancel any ongoing work related to the session\n(treat it as if `session/cancel` was called) and then free up any resources\nassociated with the session.\n\nOnly available if the Agent supports the `sessionCapabilities.close` capability.",
2383 identifier: "CloseSessionRequest",
2384 });
2385
2386 export type CloseNesRequest = {
2387 readonly sessionId: SessionId;
2388 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2389 };
2390 export const CloseNesRequest = Schema.Struct({
2391 sessionId: Schema.suspend((): Schema.Codec<SessionId> => SessionId).annotate({
2392 description: "The ID of the NES session to close.",
2393 }),
2394 _meta: Schema.optionalKey(
2395 Schema.Union([
2396 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2397 description:
2398 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2399 }),
2400 Schema.Null,
2401 ]),
2402 ),
2403 }).annotate({
2404 description:
2405 "Request to close an NES session.\n\nThe agent **must** cancel any ongoing work related to the NES session\nand then free up any resources associated with the session.",
2406 identifier: "CloseNesRequest",
2407 });
2408
2409 export type AcceptNesNotification = {
2410 readonly sessionId: SessionId;
2411 readonly id: NesSuggestionId;
2412 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2413 };
2414 export const AcceptNesNotification = Schema.Struct({
2415 sessionId: Schema.suspend((): Schema.Codec<SessionId> => SessionId).annotate({
2416 description: "The session ID for this notification.",
2417 }),
2418 id: Schema.suspend((): Schema.Codec<NesSuggestionId> => NesSuggestionId).annotate({
2419 description: "The ID of the accepted suggestion.",
2420 }),
2421 _meta: Schema.optionalKey(
2422 Schema.Union([
2423 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2424 description:
2425 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2426 }),
2427 Schema.Null,
2428 ]),
2429 ),
2430 }).annotate({
2431 description: "Notification sent when a suggestion is accepted.",
2432 identifier: "AcceptNesNotification",
2433 });
2434
2435 export type AgentAuthCapabilities = {
2436 readonly logout?: LogoutCapabilities | null;
2437 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2438 };
2439 export const AgentAuthCapabilities = Schema.Struct({
2440 logout: Schema.optionalKey(
2441 Schema.Union([LogoutCapabilities, Schema.Null]).annotate({
2442 description:
2443 "Whether the agent supports the logout method.\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports the logout method.",
2444 }),
2445 ),
2446 _meta: Schema.optionalKey(
2447 Schema.Union([
2448 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2449 description:
2450 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2451 }),
2452 Schema.Null,
2453 ]),
2454 ),
2455 }).annotate({
2456 description: "Authentication-related capabilities supported by the agent.",
2457 identifier: "AgentAuthCapabilities",
2458 });
2459
2460 export type SessionCapabilities = {
2461 readonly list?: SessionListCapabilities | null;
2462 readonly delete?: SessionDeleteCapabilities | null;
2463 readonly additionalDirectories?: SessionAdditionalDirectoriesCapabilities | null;
2464 readonly fork?: SessionForkCapabilities | null;
2465 readonly resume?: SessionResumeCapabilities | null;
2466 readonly close?: SessionCloseCapabilities | null;
2467 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2468 };
2469 export const SessionCapabilities = Schema.Struct({
2470 list: Schema.optionalKey(
2471 Schema.Union([SessionListCapabilities, Schema.Null]).annotate({
2472 description:
2473 "Whether the agent supports `session/list`.\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports listing sessions.",
2474 }),
2475 ),
2476 delete: Schema.optionalKey(
2477 Schema.Union([SessionDeleteCapabilities, Schema.Null]).annotate({
2478 description:
2479 "Whether the agent supports `session/delete`.\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports deleting sessions from `session/list`.",
2480 }),
2481 ),
2482 additionalDirectories: Schema.optionalKey(
2483 Schema.Union([SessionAdditionalDirectoriesCapabilities, Schema.Null]).annotate({
2484 description:
2485 "Whether the agent supports `additionalDirectories` on supported session lifecycle requests.\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports `additionalDirectories` on\nsupported session lifecycle requests.\n\nAgents that also support `session/list` may return\n`SessionInfo.additionalDirectories` to report the complete ordered\nadditional-root list associated with a listed session.",
2486 }),
2487 ),
2488 fork: Schema.optionalKey(
2489 Schema.Union([SessionForkCapabilities, Schema.Null]).annotate({
2490 description:
2491 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nWhether the agent supports `session/fork`.\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports forking sessions.",
2492 }),
2493 ),
2494 resume: Schema.optionalKey(
2495 Schema.Union([SessionResumeCapabilities, Schema.Null]).annotate({
2496 description:
2497 "Whether the agent supports `session/resume`.\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports resuming sessions.",
2498 }),
2499 ),
2500 close: Schema.optionalKey(
2501 Schema.Union([SessionCloseCapabilities, Schema.Null]).annotate({
2502 description:
2503 "Whether the agent supports `session/close`.\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports closing sessions.",
2504 }),
2505 ),
2506 _meta: Schema.optionalKey(
2507 Schema.Union([
2508 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2509 description:
2510 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2511 }),
2512 Schema.Null,
2513 ]),
2514 ),
2515 }).annotate({
2516 description:
2517 "Session capabilities supported by the agent.\n\nAs a baseline, all Agents **MUST** support `session/new`, `session/prompt`, `session/cancel`, and `session/update`.\n\nOptionally, they **MAY** support other session methods and notifications by specifying additional capabilities.\n\nNote: `session/load` is still handled by the top-level `load_session` capability. This will be unified in future versions of the protocol.\n\nSee protocol docs: [Session Capabilities](https://agentclientprotocol.com/protocol/initialization#session-capabilities)",
2518 identifier: "SessionCapabilities",
2519 });
2520
2521 export type NesDocumentDidChangeCapabilities = {
2522 readonly syncKind: TextDocumentSyncKind;
2523 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2524 };
2525 export const NesDocumentDidChangeCapabilities = Schema.Struct({
2526 syncKind: Schema.suspend((): Schema.Codec<TextDocumentSyncKind> => TextDocumentSyncKind).annotate(
2527 { description: 'The sync kind the agent wants: `"full"` or `"incremental"`.' },
2528 ),
2529 _meta: Schema.optionalKey(
2530 Schema.Union([
2531 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2532 description:
2533 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2534 }),
2535 Schema.Null,
2536 ]),
2537 ),
2538 }).annotate({
2539 description: "Capabilities for `document/didChange` events.",
2540 identifier: "NesDocumentDidChangeCapabilities",
2541 });
2542
2543 export type NesContextCapabilities = {
2544 readonly recentFiles?: NesRecentFilesCapabilities | null;
2545 readonly relatedSnippets?: NesRelatedSnippetsCapabilities | null;
2546 readonly editHistory?: NesEditHistoryCapabilities | null;
2547 readonly userActions?: NesUserActionsCapabilities | null;
2548 readonly openFiles?: NesOpenFilesCapabilities | null;
2549 readonly diagnostics?: NesDiagnosticsCapabilities | null;
2550 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2551 };
2552 export const NesContextCapabilities = Schema.Struct({
2553 recentFiles: Schema.optionalKey(
2554 Schema.Union([NesRecentFilesCapabilities, Schema.Null]).annotate({
2555 description: "Whether the agent wants recent files context.",
2556 }),
2557 ),
2558 relatedSnippets: Schema.optionalKey(
2559 Schema.Union([NesRelatedSnippetsCapabilities, Schema.Null]).annotate({
2560 description: "Whether the agent wants related snippets context.",
2561 }),
2562 ),
2563 editHistory: Schema.optionalKey(
2564 Schema.Union([NesEditHistoryCapabilities, Schema.Null]).annotate({
2565 description: "Whether the agent wants edit history context.",
2566 }),
2567 ),
2568 userActions: Schema.optionalKey(
2569 Schema.Union([NesUserActionsCapabilities, Schema.Null]).annotate({
2570 description: "Whether the agent wants user actions context.",
2571 }),
2572 ),
2573 openFiles: Schema.optionalKey(
2574 Schema.Union([NesOpenFilesCapabilities, Schema.Null]).annotate({
2575 description: "Whether the agent wants open files context.",
2576 }),
2577 ),
2578 diagnostics: Schema.optionalKey(
2579 Schema.Union([NesDiagnosticsCapabilities, Schema.Null]).annotate({
2580 description: "Whether the agent wants diagnostics context.",
2581 }),
2582 ),
2583 _meta: Schema.optionalKey(
2584 Schema.Union([
2585 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2586 description:
2587 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2588 }),
2589 Schema.Null,
2590 ]),
2591 ),
2592 }).annotate({
2593 description: "Context capabilities the agent wants attached to each suggestion request.",
2594 identifier: "NesContextCapabilities",
2595 });
2596
2597 export type Annotations = {
2598 readonly audience?: ReadonlyArray<Role> | null;
2599 readonly lastModified?: string | null;
2600 readonly priority?: number | null;
2601 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2602 };
2603 export const Annotations = Schema.Struct({
2604 audience: Schema.optionalKey(
2605 Schema.Union([
2606 Schema.Array(Role).annotate({
2607 description: "Intended recipients for this content, such as the user or assistant.",
2608 }),
2609 Schema.Null,
2610 ]),
2611 ),
2612 lastModified: Schema.optionalKey(
2613 Schema.Union([
2614 Schema.String.annotate({
2615 description: "Timestamp indicating when the underlying resource was last modified.",
2616 }),
2617 Schema.Null,
2618 ]),
2619 ),
2620 priority: Schema.optionalKey(
2621 Schema.Union([
2622 Schema.Number.annotate({
2623 description: "Relative importance of this content when clients choose what to surface.",
2624 format: "double",
2625 }).check(Schema.isFinite().annotate({ expected: "a finite number" })),
2626 Schema.Null,
2627 ]),
2628 ),
2629 _meta: Schema.optionalKey(
2630 Schema.Union([
2631 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2632 description:
2633 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2634 }),
2635 Schema.Null,
2636 ]),
2637 ),
2638 }).annotate({
2639 description:
2640 "Optional annotations for the client. The client can use annotations to inform how objects are used or displayed",
2641 identifier: "Annotations",
2642 });
2643
2644 export type EmbeddedResourceResource = TextResourceContents | BlobResourceContents;
2645 export const EmbeddedResourceResource = Schema.Union([
2646 Schema.suspend((): Schema.Codec<TextResourceContents> => TextResourceContents).annotate({
2647 title: "TextResourceContents",
2648 description: "Text resource contents embedded directly in the message.",
2649 }),
2650 Schema.suspend((): Schema.Codec<BlobResourceContents> => BlobResourceContents).annotate({
2651 title: "BlobResourceContents",
2652 description: "Binary resource contents embedded directly in the message.",
2653 }),
2654 ]).annotate({
2655 description: "Resource content that can be embedded in a message.",
2656 identifier: "EmbeddedResourceResource",
2657 });
2658
2659 export type TerminalOutputRequest = {
2660 readonly sessionId: SessionId;
2661 readonly terminalId: TerminalId;
2662 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2663 };
2664 export const TerminalOutputRequest = Schema.Struct({
2665 sessionId: Schema.suspend((): Schema.Codec<SessionId> => SessionId).annotate({
2666 description: "The session ID for this request.",
2667 }),
2668 terminalId: Schema.suspend((): Schema.Codec<TerminalId> => TerminalId).annotate({
2669 description: "The ID of the terminal to get output from.",
2670 }),
2671 _meta: Schema.optionalKey(
2672 Schema.Union([
2673 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2674 description:
2675 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2676 }),
2677 Schema.Null,
2678 ]),
2679 ),
2680 }).annotate({
2681 description: "Request to get the current output and status of a terminal.",
2682 identifier: "TerminalOutputRequest",
2683 });
2684
2685 export type ReleaseTerminalRequest = {
2686 readonly sessionId: SessionId;
2687 readonly terminalId: TerminalId;
2688 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2689 };
2690 export const ReleaseTerminalRequest = Schema.Struct({
2691 sessionId: Schema.suspend((): Schema.Codec<SessionId> => SessionId).annotate({
2692 description: "The session ID for this request.",
2693 }),
2694 terminalId: Schema.suspend((): Schema.Codec<TerminalId> => TerminalId).annotate({
2695 description: "The ID of the terminal to release.",
2696 }),
2697 _meta: Schema.optionalKey(
2698 Schema.Union([
2699 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2700 description:
2701 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2702 }),
2703 Schema.Null,
2704 ]),
2705 ),
2706 }).annotate({
2707 description: "Request to release a terminal and free its resources.",
2708 identifier: "ReleaseTerminalRequest",
2709 });
2710
2711 export type WaitForTerminalExitRequest = {
2712 readonly sessionId: SessionId;
2713 readonly terminalId: TerminalId;
2714 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2715 };
2716 export const WaitForTerminalExitRequest = Schema.Struct({
2717 sessionId: Schema.suspend((): Schema.Codec<SessionId> => SessionId).annotate({
2718 description: "The session ID for this request.",
2719 }),
2720 terminalId: Schema.suspend((): Schema.Codec<TerminalId> => TerminalId).annotate({
2721 description: "The ID of the terminal to wait for.",
2722 }),
2723 _meta: Schema.optionalKey(
2724 Schema.Union([
2725 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2726 description:
2727 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2728 }),
2729 Schema.Null,
2730 ]),
2731 ),
2732 }).annotate({
2733 description: "Request to wait for a terminal command to exit.",
2734 identifier: "WaitForTerminalExitRequest",
2735 });
2736
2737 export type KillTerminalRequest = {
2738 readonly sessionId: SessionId;
2739 readonly terminalId: TerminalId;
2740 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2741 };
2742 export const KillTerminalRequest = Schema.Struct({
2743 sessionId: Schema.suspend((): Schema.Codec<SessionId> => SessionId).annotate({
2744 description: "The session ID for this request.",
2745 }),
2746 terminalId: Schema.suspend((): Schema.Codec<TerminalId> => TerminalId).annotate({
2747 description: "The ID of the terminal to kill.",
2748 }),
2749 _meta: Schema.optionalKey(
2750 Schema.Union([
2751 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2752 description:
2753 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2754 }),
2755 Schema.Null,
2756 ]),
2757 ),
2758 }).annotate({
2759 description: "Request to kill a terminal without releasing it.",
2760 identifier: "KillTerminalRequest",
2761 });
2762
2763 export type CreateTerminalResponse = {
2764 readonly terminalId: TerminalId;
2765 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2766 };
2767 export const CreateTerminalResponse = Schema.Struct({
2768 terminalId: Schema.suspend((): Schema.Codec<TerminalId> => TerminalId).annotate({
2769 description: "The unique identifier for the created terminal.",
2770 }),
2771 _meta: Schema.optionalKey(
2772 Schema.Union([
2773 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2774 description:
2775 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2776 }),
2777 Schema.Null,
2778 ]),
2779 ),
2780 }).annotate({
2781 description: "Response containing the ID of the created terminal.",
2782 identifier: "CreateTerminalResponse",
2783 });
2784
2785 export type PlanEntry = {
2786 readonly content: string;
2787 readonly priority: PlanEntryPriority;
2788 readonly status: PlanEntryStatus;
2789 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2790 };
2791 export const PlanEntry = Schema.Struct({
2792 content: Schema.String.annotate({
2793 description: "Human-readable description of what this task aims to accomplish.",
2794 }),
2795 priority: Schema.suspend((): Schema.Codec<PlanEntryPriority> => PlanEntryPriority).annotate({
2796 description:
2797 "The relative importance of this task.\nUsed to indicate which tasks are most critical to the overall goal.",
2798 }),
2799 status: Schema.suspend((): Schema.Codec<PlanEntryStatus> => PlanEntryStatus).annotate({
2800 description: "Current execution status of this task.",
2801 }),
2802 _meta: Schema.optionalKey(
2803 Schema.Union([
2804 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2805 description:
2806 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2807 }),
2808 Schema.Null,
2809 ]),
2810 ),
2811 }).annotate({
2812 description:
2813 "A single entry in the execution plan.\n\nRepresents a task or goal that the assistant intends to accomplish\nas part of fulfilling the user's request.\nSee protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)",
2814 identifier: "PlanEntry",
2815 });
2816
2817 export type AvailableCommandInput = UnstructuredCommandInput;
2818 export const AvailableCommandInput = Schema.Union([
2819 Schema.suspend((): Schema.Codec<UnstructuredCommandInput> => UnstructuredCommandInput).annotate({
2820 title: "unstructured",
2821 description: "All text that was typed after the command name is provided as input.",
2822 }),
2823 ]).annotate({
2824 description: "The input specification for a command.",
2825 identifier: "AvailableCommandInput",
2826 });
2827
2828 export type SessionMode = {
2829 readonly id: SessionModeId;
2830 readonly name: string;
2831 readonly description?: string | null;
2832 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2833 };
2834 export const SessionMode = Schema.Struct({
2835 id: Schema.suspend((): Schema.Codec<SessionModeId> => SessionModeId).annotate({
2836 description: "Stable identifier used to refer to this protocol object in later messages.",
2837 }),
2838 name: Schema.String.annotate({
2839 description: "Human-readable name shown for this protocol object.",
2840 }),
2841 description: Schema.optionalKey(
2842 Schema.Union([
2843 Schema.String.annotate({
2844 description: "Optional human-readable details shown with this protocol object.",
2845 }),
2846 Schema.Null,
2847 ]),
2848 ),
2849 _meta: Schema.optionalKey(
2850 Schema.Union([
2851 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2852 description:
2853 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2854 }),
2855 Schema.Null,
2856 ]),
2857 ),
2858 }).annotate({
2859 description:
2860 "A mode the agent can operate in.\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)",
2861 identifier: "SessionMode",
2862 });
2863
2864 export type SetSessionModeRequest = {
2865 readonly sessionId: SessionId;
2866 readonly modeId: SessionModeId;
2867 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2868 };
2869 export const SetSessionModeRequest = Schema.Struct({
2870 sessionId: Schema.suspend((): Schema.Codec<SessionId> => SessionId).annotate({
2871 description: "The ID of the session to set the mode for.",
2872 }),
2873 modeId: Schema.suspend((): Schema.Codec<SessionModeId> => SessionModeId).annotate({
2874 description: "The ID of the mode to set.",
2875 }),
2876 _meta: Schema.optionalKey(
2877 Schema.Union([
2878 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2879 description:
2880 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2881 }),
2882 Schema.Null,
2883 ]),
2884 ),
2885 }).annotate({
2886 description: "Request parameters for setting a session mode.",
2887 identifier: "SetSessionModeRequest",
2888 });
2889
2890 export type SessionConfigSelectOption = {
2891 readonly value: SessionConfigValueId;
2892 readonly name: string;
2893 readonly description?: string | null;
2894 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2895 };
2896 export const SessionConfigSelectOption = Schema.Struct({
2897 value: Schema.suspend((): Schema.Codec<SessionConfigValueId> => SessionConfigValueId).annotate({
2898 description: "Unique identifier for this option value.",
2899 }),
2900 name: Schema.String.annotate({ description: "Human-readable label for this option value." }),
2901 description: Schema.optionalKey(
2902 Schema.Union([
2903 Schema.String.annotate({ description: "Optional description for this option value." }),
2904 Schema.Null,
2905 ]),
2906 ),
2907 _meta: Schema.optionalKey(
2908 Schema.Union([
2909 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2910 description:
2911 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2912 }),
2913 Schema.Null,
2914 ]),
2915 ),
2916 }).annotate({
2917 description: "A possible value for a session configuration option.",
2918 identifier: "SessionConfigSelectOption",
2919 });
2920
2921 export type SetSessionConfigOptionRequest =
2922 | {
2923 readonly sessionId: SessionId;
2924 readonly configId: SessionConfigId;
2925 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2926 readonly value: boolean;
2927 readonly type: "boolean";
2928 }
2929 | {
2930 readonly sessionId: SessionId;
2931 readonly configId: SessionConfigId;
2932 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2933 readonly value: SessionConfigValueId;
2934 };
2935 export const SetSessionConfigOptionRequest = Schema.Union([
2936 Schema.Struct({
2937 sessionId: Schema.suspend((): Schema.Codec<SessionId> => SessionId).annotate({
2938 description: "The ID of the session to set the configuration option for.",
2939 }),
2940 configId: Schema.suspend((): Schema.Codec<SessionConfigId> => SessionConfigId).annotate({
2941 description: "The ID of the configuration option to set.",
2942 }),
2943 _meta: Schema.optionalKey(
2944 Schema.Union([
2945 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2946 description:
2947 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2948 }),
2949 Schema.Null,
2950 ]),
2951 ),
2952 value: Schema.Boolean.annotate({ description: "The boolean value." }),
2953 type: Schema.Literal("boolean"),
2954 }).annotate({ description: 'A boolean value (`type: "boolean"`).' }),
2955 Schema.Struct({
2956 sessionId: Schema.suspend((): Schema.Codec<SessionId> => SessionId).annotate({
2957 description: "The ID of the session to set the configuration option for.",
2958 }),
2959 configId: Schema.suspend((): Schema.Codec<SessionConfigId> => SessionConfigId).annotate({
2960 description: "The ID of the configuration option to set.",
2961 }),
2962 _meta: Schema.optionalKey(
2963 Schema.Union([
2964 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2965 description:
2966 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2967 }),
2968 Schema.Null,
2969 ]),
2970 ),
2971 value: Schema.suspend((): Schema.Codec<SessionConfigValueId> => SessionConfigValueId).annotate({
2972 description: "The value ID.",
2973 }),
2974 }).annotate({
2975 title: "value_id",
2976 description:
2977 "A [`SessionConfigValueId`] string value.\n\nThis is the default when `type` is absent on the wire. Unknown `type`\nvalues with string payloads also gracefully deserialize into this\nvariant.",
2978 }),
2979 ]).annotate({ identifier: "SetSessionConfigOptionRequest" });
2980
2981 export type CompleteElicitationNotification = {
2982 readonly elicitationId: ElicitationId;
2983 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
2984 };
2985 export const CompleteElicitationNotification = Schema.Struct({
2986 elicitationId: Schema.suspend((): Schema.Codec<ElicitationId> => ElicitationId).annotate({
2987 description: "The ID of the elicitation that completed.",
2988 }),
2989 _meta: Schema.optionalKey(
2990 Schema.Union([
2991 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
2992 description:
2993 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
2994 }),
2995 Schema.Null,
2996 ]),
2997 ),
2998 }).annotate({
2999 description: "Notification sent by the agent when a URL-based elicitation is complete.",
3000 identifier: "CompleteElicitationNotification",
3001 });
3002
3003 export type MessageMcpNotification = {
3004 readonly connectionId: McpConnectionId;
3005 readonly method: string;
3006 readonly params?: { readonly [x: string]: Schema.Json } | null;
3007 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3008 };
3009 export const MessageMcpNotification = Schema.Struct({
3010 connectionId: Schema.suspend((): Schema.Codec<McpConnectionId> => McpConnectionId).annotate({
3011 description: "The MCP-over-ACP connection this message is sent on.",
3012 }),
3013 method: Schema.String.annotate({ description: "The inner MCP method name." }),
3014 params: Schema.optionalKey(
3015 Schema.Union([
3016 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3017 description:
3018 "Optional inner MCP params.\n\nIf omitted or set to `null`, the inner MCP message has no params.",
3019 }),
3020 Schema.Null,
3021 ]),
3022 ),
3023 _meta: Schema.optionalKey(
3024 Schema.Union([
3025 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3026 description:
3027 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3028 }),
3029 Schema.Null,
3030 ]),
3031 ),
3032 }).annotate({
3033 description:
3034 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nNotification parameters for `mcp/message`.\n\nThis is used when the wrapped MCP message is a notification and the outer JSON-RPC\nenvelope has no `id`.",
3035 identifier: "MessageMcpNotification",
3036 });
3037
3038 export type MessageMcpRequest = {
3039 readonly connectionId: McpConnectionId;
3040 readonly method: string;
3041 readonly params?: { readonly [x: string]: Schema.Json } | null;
3042 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3043 };
3044 export const MessageMcpRequest = Schema.Struct({
3045 connectionId: Schema.suspend((): Schema.Codec<McpConnectionId> => McpConnectionId).annotate({
3046 description: "The MCP-over-ACP connection this message is sent on.",
3047 }),
3048 method: Schema.String.annotate({ description: "The inner MCP method name." }),
3049 params: Schema.optionalKey(
3050 Schema.Union([
3051 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3052 description:
3053 "Optional inner MCP params.\n\nIf omitted or set to `null`, the inner MCP message has no params.",
3054 }),
3055 Schema.Null,
3056 ]),
3057 ),
3058 _meta: Schema.optionalKey(
3059 Schema.Union([
3060 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3061 description:
3062 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3063 }),
3064 Schema.Null,
3065 ]),
3066 ),
3067 }).annotate({
3068 description:
3069 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for `mcp/message`.",
3070 identifier: "MessageMcpRequest",
3071 });
3072
3073 export type DisconnectMcpRequest = {
3074 readonly connectionId: McpConnectionId;
3075 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3076 };
3077 export const DisconnectMcpRequest = Schema.Struct({
3078 connectionId: Schema.suspend((): Schema.Codec<McpConnectionId> => McpConnectionId).annotate({
3079 description: "The MCP-over-ACP connection to close.",
3080 }),
3081 _meta: Schema.optionalKey(
3082 Schema.Union([
3083 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3084 description:
3085 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3086 }),
3087 Schema.Null,
3088 ]),
3089 ),
3090 }).annotate({
3091 description:
3092 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for `mcp/disconnect`.",
3093 identifier: "DisconnectMcpRequest",
3094 });
3095
3096 export type ConnectMcpResponse = {
3097 readonly connectionId: McpConnectionId;
3098 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3099 };
3100 export const ConnectMcpResponse = Schema.Struct({
3101 connectionId: Schema.suspend((): Schema.Codec<McpConnectionId> => McpConnectionId).annotate({
3102 description: "The unique identifier for this MCP-over-ACP connection.",
3103 }),
3104 _meta: Schema.optionalKey(
3105 Schema.Union([
3106 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3107 description:
3108 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3109 }),
3110 Schema.Null,
3111 ]),
3112 ),
3113 }).annotate({
3114 description:
3115 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse to `mcp/connect`.",
3116 identifier: "ConnectMcpResponse",
3117 });
3118
3119 export type RequestPermissionOutcome =
3120 | { readonly outcome: "cancelled" }
3121 | {
3122 readonly outcome: "selected";
3123 readonly optionId: PermissionOptionId;
3124 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3125 };
3126 export const RequestPermissionOutcome = Schema.Union([
3127 Schema.Struct({ outcome: Schema.Literal("cancelled") }).annotate({
3128 description:
3129 "The prompt turn was cancelled before the user responded.\n\nWhen a client sends a `session/cancel` notification to cancel an ongoing\nprompt turn, it MUST respond to all pending `session/request_permission`\nrequests with this `Cancelled` outcome.\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)",
3130 }),
3131 Schema.Struct({
3132 outcome: Schema.Literal("selected"),
3133 optionId: Schema.suspend((): Schema.Codec<PermissionOptionId> => PermissionOptionId).annotate({
3134 description: "The ID of the option the user selected.",
3135 }),
3136 _meta: Schema.optionalKey(
3137 Schema.Union([
3138 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3139 description:
3140 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3141 }),
3142 Schema.Null,
3143 ]),
3144 ),
3145 }).annotate({ description: "The user selected one of the provided options." }),
3146 ]).annotate({
3147 description: "The outcome of a permission request.",
3148 identifier: "RequestPermissionOutcome",
3149 });
3150
3151 export type PermissionOption = {
3152 readonly optionId: PermissionOptionId;
3153 readonly name: string;
3154 readonly kind: PermissionOptionKind;
3155 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3156 };
3157 export const PermissionOption = Schema.Struct({
3158 optionId: Schema.suspend((): Schema.Codec<PermissionOptionId> => PermissionOptionId).annotate({
3159 description: "Unique identifier for this permission option.",
3160 }),
3161 name: Schema.String.annotate({ description: "Human-readable label to display to the user." }),
3162 kind: Schema.suspend((): Schema.Codec<PermissionOptionKind> => PermissionOptionKind).annotate({
3163 description: "Hint about the nature of this permission option.",
3164 }),
3165 _meta: Schema.optionalKey(
3166 Schema.Union([
3167 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3168 description:
3169 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3170 }),
3171 Schema.Null,
3172 ]),
3173 ),
3174 }).annotate({
3175 description: "An option presented to the user when requesting permission.",
3176 identifier: "PermissionOption",
3177 });
3178
3179 export type CreateTerminalRequest = {
3180 readonly sessionId: SessionId;
3181 readonly command: string;
3182 readonly args?: ReadonlyArray<string>;
3183 readonly env?: ReadonlyArray<EnvVariable>;
3184 readonly cwd?: string | null;
3185 readonly outputByteLimit?: number | null;
3186 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3187 };
3188 export const CreateTerminalRequest = Schema.Struct({
3189 sessionId: Schema.suspend((): Schema.Codec<SessionId> => SessionId).annotate({
3190 description: "The session ID for this request.",
3191 }),
3192 command: Schema.String.annotate({ description: "The command to execute." }),
3193 args: Schema.optionalKey(
3194 Schema.Array(Schema.String).annotate({ description: "Array of command arguments." }),
3195 ),
3196 env: Schema.optionalKey(
3197 Schema.Array(EnvVariable).annotate({ description: "Environment variables for the command." }),
3198 ),
3199 cwd: Schema.optionalKey(
3200 Schema.Union([
3201 Schema.String.annotate({
3202 description: "Working directory for the command. Must be an absolute path.",
3203 }),
3204 Schema.Null,
3205 ]),
3206 ),
3207 outputByteLimit: Schema.optionalKey(
3208 Schema.Union([
3209 Schema.Number.annotate({
3210 description:
3211 "Maximum number of output bytes to retain.\n\nWhen the limit is exceeded, the Client truncates from the beginning of the output\nto stay within the limit.\n\nThe Client MUST ensure truncation happens at a character boundary to maintain valid\nstring output, even if this means the retained output is slightly less than the\nspecified limit.",
3212 format: "uint64",
3213 })
3214 .check(Schema.isInt().annotate({ expected: "an integer" }))
3215 .check(
3216 Schema.isGreaterThanOrEqualTo(0).annotate({
3217 expected: "a value greater than or equal to 0",
3218 }),
3219 ),
3220 Schema.Null,
3221 ]),
3222 ),
3223 _meta: Schema.optionalKey(
3224 Schema.Union([
3225 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3226 description:
3227 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3228 }),
3229 Schema.Null,
3230 ]),
3231 ),
3232 }).annotate({
3233 description: "Request to create a new terminal and execute a command.",
3234 identifier: "CreateTerminalRequest",
3235 });
3236
3237 export type McpServerStdio = {
3238 readonly name: string;
3239 readonly command: string;
3240 readonly args: ReadonlyArray<string>;
3241 readonly env: ReadonlyArray<EnvVariable>;
3242 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3243 };
3244 export const McpServerStdio = Schema.Struct({
3245 name: Schema.String.annotate({ description: "Human-readable name identifying this MCP server." }),
3246 command: Schema.String.annotate({ description: "Absolute path to the MCP server executable." }),
3247 args: Schema.Array(Schema.String).annotate({
3248 description: "Command-line arguments to pass to the MCP server.",
3249 }),
3250 env: Schema.Array(EnvVariable).annotate({
3251 description: "Environment variables to set when launching the MCP server.",
3252 }),
3253 _meta: Schema.optionalKey(
3254 Schema.Union([
3255 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3256 description:
3257 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3258 }),
3259 Schema.Null,
3260 ]),
3261 ),
3262 }).annotate({
3263 description: "Stdio transport configuration for MCP.",
3264 identifier: "McpServerStdio",
3265 });
3266
3267 export type MultiSelectItems =
3268 | {
3269 readonly type: "string";
3270 readonly enum: ReadonlyArray<string>;
3271 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3272 }
3273 | ({ readonly type: string } & { readonly [x: string]: Schema.Json })
3274 | TitledMultiSelectItems;
3275 export const MultiSelectItems = Schema.Union([
3276 Schema.Struct({
3277 type: Schema.Literal("string"),
3278 enum: Schema.Array(Schema.String).annotate({ description: "Allowed enum values." }),
3279 _meta: Schema.optionalKey(
3280 Schema.Union([
3281 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3282 description:
3283 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3284 }),
3285 Schema.Null,
3286 ]),
3287 ),
3288 }).annotate({ description: "String item schema for multi-select enum properties." }),
3289 Schema.StructWithRest(
3290 Schema.Struct({
3291 type: Schema.String.annotate({
3292 description:
3293 "Custom or future multi-select item type.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.",
3294 }).check(
3295 Schema.isPattern(new RegExp("^(?!(?:\\x73tring)$)[\\s\\S]*$")).annotate({
3296 expected: "a string matching the RegExp ^(?!(?:\\x73tring)$)[\\s\\S]*$",
3297 }),
3298 ),
3299 }),
3300 [Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))],
3301 ).annotate({ title: "other", description: "Custom or future typed multi-select items." }),
3302 Schema.suspend((): Schema.Codec<TitledMultiSelectItems> => TitledMultiSelectItems).annotate({
3303 title: "titled",
3304 description: "Titled multi-select items with human-readable labels.",
3305 }),
3306 ]).annotate({
3307 description: "Items for a multi-select (array) property schema.",
3308 identifier: "MultiSelectItems",
3309 });
3310
3311 export type ConnectMcpRequest = {
3312 readonly serverId: McpServerAcpId;
3313 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3314 };
3315 export const ConnectMcpRequest = Schema.Struct({
3316 serverId: Schema.suspend((): Schema.Codec<McpServerAcpId> => McpServerAcpId).annotate({
3317 description:
3318 "The ACP MCP server ID that was provided by the component declaring the MCP server.",
3319 }),
3320 _meta: Schema.optionalKey(
3321 Schema.Union([
3322 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3323 description:
3324 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3325 }),
3326 Schema.Null,
3327 ]),
3328 ),
3329 }).annotate({
3330 description:
3331 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for `mcp/connect`.",
3332 identifier: "ConnectMcpRequest",
3333 });
3334
3335 export type AuthMethodAgent = {
3336 readonly id: AuthMethodId;
3337 readonly name: string;
3338 readonly description?: string | null;
3339 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3340 };
3341 export const AuthMethodAgent = Schema.Struct({
3342 id: Schema.suspend((): Schema.Codec<AuthMethodId> => AuthMethodId).annotate({
3343 description: "Unique identifier for this authentication method.",
3344 }),
3345 name: Schema.String.annotate({
3346 description: "Human-readable name of the authentication method.",
3347 }),
3348 description: Schema.optionalKey(
3349 Schema.Union([
3350 Schema.String.annotate({
3351 description:
3352 "Optional description providing more details about this authentication method.",
3353 }),
3354 Schema.Null,
3355 ]),
3356 ),
3357 _meta: Schema.optionalKey(
3358 Schema.Union([
3359 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3360 description:
3361 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3362 }),
3363 Schema.Null,
3364 ]),
3365 ),
3366 }).annotate({
3367 description:
3368 "Agent handles authentication itself through `authenticate`.\n\nThis is the default authentication method type.",
3369 identifier: "AuthMethodAgent",
3370 });
3371
3372 export type AuthenticateRequest = {
3373 readonly methodId: AuthMethodId;
3374 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3375 };
3376 export const AuthenticateRequest = Schema.Struct({
3377 methodId: Schema.suspend((): Schema.Codec<AuthMethodId> => AuthMethodId).annotate({
3378 description:
3379 "The ID of the authentication method to use.\nMust be one of the methods advertised in the initialize response.",
3380 }),
3381 _meta: Schema.optionalKey(
3382 Schema.Union([
3383 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3384 description:
3385 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3386 }),
3387 Schema.Null,
3388 ]),
3389 ),
3390 }).annotate({
3391 description:
3392 "Request parameters for the authenticate method.\n\nSpecifies which authentication method to use.",
3393 identifier: "AuthenticateRequest",
3394 });
3395
3396 export type DisableProviderRequest = {
3397 readonly providerId: ProviderId;
3398 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3399 };
3400 export const DisableProviderRequest = Schema.Struct({
3401 providerId: Schema.suspend((): Schema.Codec<ProviderId> => ProviderId).annotate({
3402 description: "Provider ID to disable.",
3403 }),
3404 _meta: Schema.optionalKey(
3405 Schema.Union([
3406 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3407 description:
3408 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3409 }),
3410 Schema.Null,
3411 ]),
3412 ),
3413 }).annotate({
3414 description:
3415 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for `providers/disable`.",
3416 identifier: "DisableProviderRequest",
3417 });
3418
3419 export type ProviderCurrentConfig = {
3420 readonly apiType: LlmProtocol;
3421 readonly baseUrl: string;
3422 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3423 };
3424 export const ProviderCurrentConfig = Schema.Struct({
3425 apiType: Schema.suspend((): Schema.Codec<LlmProtocol> => LlmProtocol).annotate({
3426 description: "Protocol currently used by this provider.",
3427 }),
3428 baseUrl: Schema.String.annotate({ description: "Base URL currently used by this provider." }),
3429 _meta: Schema.optionalKey(
3430 Schema.Union([
3431 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3432 description:
3433 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3434 }),
3435 Schema.Null,
3436 ]),
3437 ),
3438 }).annotate({
3439 description:
3440 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCurrent effective non-secret routing configuration for a provider.",
3441 identifier: "ProviderCurrentConfig",
3442 });
3443
3444 export type SetProviderRequest = {
3445 readonly providerId: ProviderId;
3446 readonly apiType: LlmProtocol;
3447 readonly baseUrl: string;
3448 readonly headers?: { readonly [x: string]: string };
3449 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3450 };
3451 export const SetProviderRequest = Schema.Struct({
3452 providerId: Schema.suspend((): Schema.Codec<ProviderId> => ProviderId).annotate({
3453 description: "Provider ID to configure.",
3454 }),
3455 apiType: Schema.suspend((): Schema.Codec<LlmProtocol> => LlmProtocol).annotate({
3456 description: "Protocol type for this provider.",
3457 }),
3458 baseUrl: Schema.String.annotate({
3459 description: "Base URL for requests sent through this provider.",
3460 }),
3461 headers: Schema.optionalKey(
3462 Schema.Record(Schema.String, Schema.String).annotate({
3463 description:
3464 "Full headers map for this provider.\nMay include authorization, routing, or other integration-specific headers.",
3465 }),
3466 ),
3467 _meta: Schema.optionalKey(
3468 Schema.Union([
3469 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3470 description:
3471 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3472 }),
3473 Schema.Null,
3474 ]),
3475 ),
3476 }).annotate({
3477 description:
3478 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for `providers/set`.\n\nReplaces the full configuration for one provider ID.",
3479 identifier: "SetProviderRequest",
3480 });
3481
3482 export type PromptResponse = {
3483 readonly stopReason: StopReason;
3484 readonly usage?: Usage | null;
3485 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3486 };
3487 export const PromptResponse = Schema.Struct({
3488 stopReason: Schema.suspend((): Schema.Codec<StopReason> => StopReason).annotate({
3489 description: "Indicates why the agent stopped processing the turn.",
3490 }),
3491 usage: Schema.optionalKey(
3492 Schema.Union([Usage, Schema.Null]).annotate({
3493 description:
3494 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nToken usage for this turn (optional).",
3495 }),
3496 ),
3497 _meta: Schema.optionalKey(
3498 Schema.Union([
3499 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3500 description:
3501 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3502 }),
3503 Schema.Null,
3504 ]),
3505 ),
3506 }).annotate({
3507 description:
3508 "Response from processing a user prompt.\n\nSee protocol docs: [Check for Completion](https://agentclientprotocol.com/protocol/prompt-turn#4-check-for-completion)",
3509 identifier: "PromptResponse",
3510 });
3511
3512 export type Range = {
3513 readonly start: Position;
3514 readonly end: Position;
3515 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3516 };
3517 export const Range = Schema.Struct({
3518 start: Schema.suspend((): Schema.Codec<Position> => Position).annotate({
3519 description: "The start position (inclusive).",
3520 }),
3521 end: Schema.suspend((): Schema.Codec<Position> => Position).annotate({
3522 description: "The end position (exclusive).",
3523 }),
3524 _meta: Schema.optionalKey(
3525 Schema.Union([
3526 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3527 description:
3528 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3529 }),
3530 Schema.Null,
3531 ]),
3532 ),
3533 }).annotate({
3534 description: "A range in a text document, expressed as start and end positions.",
3535 identifier: "Range",
3536 });
3537
3538 export type NesUserAction = {
3539 readonly action: string;
3540 readonly uri: string;
3541 readonly position: Position;
3542 readonly timestampMs: number;
3543 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3544 };
3545 export const NesUserAction = Schema.Struct({
3546 action: Schema.String.annotate({
3547 description: 'The kind of action (e.g., "insertChar", "cursorMovement").',
3548 }),
3549 uri: Schema.String.annotate({ description: "The URI of the file where the action occurred." }),
3550 position: Schema.suspend((): Schema.Codec<Position> => Position).annotate({
3551 description: "The position where the action occurred.",
3552 }),
3553 timestampMs: Schema.Number.annotate({
3554 description: "Timestamp in milliseconds since epoch.",
3555 format: "uint64",
3556 })
3557 .check(Schema.isInt().annotate({ expected: "an integer" }))
3558 .check(
3559 Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }),
3560 ),
3561 _meta: Schema.optionalKey(
3562 Schema.Union([
3563 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3564 description:
3565 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3566 }),
3567 Schema.Null,
3568 ]),
3569 ),
3570 }).annotate({
3571 description: "A user action (typing, cursor movement, etc.).",
3572 identifier: "NesUserAction",
3573 });
3574
3575 export type Error = {
3576 readonly code: ErrorCode;
3577 readonly message: string;
3578 readonly data?: Schema.Json;
3579 };
3580 export const Error = Schema.Struct({
3581 code: Schema.suspend((): Schema.Codec<ErrorCode> => ErrorCode).annotate({
3582 description:
3583 "A number indicating the error type that occurred.\nThis must be an integer as defined in the JSON-RPC specification.",
3584 }),
3585 message: Schema.String.annotate({
3586 description:
3587 "A string providing a short description of the error.\nThe message should be limited to a concise single sentence.",
3588 }),
3589 data: Schema.optionalKey(
3590 Schema.Json.annotate({
3591 expected: "JSON value",
3592 description:
3593 "Optional primitive or structured value that contains additional information about the error.\nThis may include debugging information or context-specific details.",
3594 }),
3595 ),
3596 }).annotate({
3597 description:
3598 "JSON-RPC error object.\n\nRepresents an error that occurred during method execution, following the\nJSON-RPC 2.0 error object specification with optional additional data.\n\nSee protocol docs: [JSON-RPC Error Object](https://www.jsonrpc.org/specification#error_object)",
3599 identifier: "Error",
3600 });
3601
3602 export type SessionConfigOptionsCapabilities = {
3603 readonly boolean?: BooleanConfigOptionCapabilities | null;
3604 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3605 };
3606 export const SessionConfigOptionsCapabilities = Schema.Struct({
3607 boolean: Schema.optionalKey(
3608 Schema.Union([BooleanConfigOptionCapabilities, Schema.Null]).annotate({
3609 description:
3610 'Whether the client supports boolean session configuration options.\n\nOptional. Omitted or `null` both mean the client does not advertise support.\nSupplying `{}` means agents may include `type: "boolean"` entries in\n`configOptions`, and the client may send `session/set_config_option`\nrequests with `type: "boolean"` and a boolean `value`.',
3611 }),
3612 ),
3613 _meta: Schema.optionalKey(
3614 Schema.Union([
3615 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3616 description:
3617 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3618 }),
3619 Schema.Null,
3620 ]),
3621 ),
3622 }).annotate({
3623 description: "Session configuration option capabilities supported by the client.",
3624 identifier: "SessionConfigOptionsCapabilities",
3625 });
3626
3627 export type ElicitationCapabilities = {
3628 readonly form?: ElicitationFormCapabilities | null;
3629 readonly url?: ElicitationUrlCapabilities | null;
3630 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3631 };
3632 export const ElicitationCapabilities = Schema.Struct({
3633 form: Schema.optionalKey(
3634 Schema.Union([ElicitationFormCapabilities, Schema.Null]).annotate({
3635 description:
3636 "Whether the client supports form-based elicitation.\n\nOptional. Omitted and `null` are equivalent and mean form support is not advertised.\nSupplying `{}` explicitly advertises form support.",
3637 }),
3638 ),
3639 url: Schema.optionalKey(
3640 Schema.Union([ElicitationUrlCapabilities, Schema.Null]).annotate({
3641 description:
3642 "Whether the client supports URL-based elicitation.\n\nOptional. Omitted or `null` both mean the client does not advertise support.\nSupplying `{}` means the client supports URL-based elicitation.",
3643 }),
3644 ),
3645 _meta: Schema.optionalKey(
3646 Schema.Union([
3647 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3648 description:
3649 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3650 }),
3651 Schema.Null,
3652 ]),
3653 ),
3654 }).annotate({
3655 description: "Elicitation capabilities supported by the client.",
3656 identifier: "ElicitationCapabilities",
3657 });
3658
3659 export type ClientNesCapabilities = {
3660 readonly jump?: NesJumpCapabilities | null;
3661 readonly rename?: NesRenameCapabilities | null;
3662 readonly searchAndReplace?: NesSearchAndReplaceCapabilities | null;
3663 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3664 };
3665 export const ClientNesCapabilities = Schema.Struct({
3666 jump: Schema.optionalKey(
3667 Schema.Union([NesJumpCapabilities, Schema.Null]).annotate({
3668 description: "Whether the client supports the `jump` suggestion kind.",
3669 }),
3670 ),
3671 rename: Schema.optionalKey(
3672 Schema.Union([NesRenameCapabilities, Schema.Null]).annotate({
3673 description: "Whether the client supports the `rename` suggestion kind.",
3674 }),
3675 ),
3676 searchAndReplace: Schema.optionalKey(
3677 Schema.Union([NesSearchAndReplaceCapabilities, Schema.Null]).annotate({
3678 description: "Whether the client supports the `searchAndReplace` suggestion kind.",
3679 }),
3680 ),
3681 _meta: Schema.optionalKey(
3682 Schema.Union([
3683 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3684 description:
3685 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3686 }),
3687 Schema.Null,
3688 ]),
3689 ),
3690 }).annotate({
3691 description: "NES capabilities advertised by the client during initialization.",
3692 identifier: "ClientNesCapabilities",
3693 });
3694
3695 export type RejectNesNotification = {
3696 readonly sessionId: SessionId;
3697 readonly id: NesSuggestionId;
3698 readonly reason?: NesRejectReason | null;
3699 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3700 };
3701 export const RejectNesNotification = Schema.Struct({
3702 sessionId: Schema.suspend((): Schema.Codec<SessionId> => SessionId).annotate({
3703 description: "The session ID for this notification.",
3704 }),
3705 id: Schema.suspend((): Schema.Codec<NesSuggestionId> => NesSuggestionId).annotate({
3706 description: "The ID of the rejected suggestion.",
3707 }),
3708 reason: Schema.optionalKey(
3709 Schema.Union([NesRejectReason, Schema.Null]).annotate({
3710 description: "The reason for rejection.",
3711 }),
3712 ),
3713 _meta: Schema.optionalKey(
3714 Schema.Union([
3715 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3716 description:
3717 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3718 }),
3719 Schema.Null,
3720 ]),
3721 ),
3722 }).annotate({
3723 description: "Notification sent when a suggestion is rejected.",
3724 identifier: "RejectNesNotification",
3725 });
3726
3727 export type StartNesRequest = {
3728 readonly workspaceUri?: string | null;
3729 readonly workspaceFolders?: ReadonlyArray<WorkspaceFolder> | null;
3730 readonly repository?: NesRepository | null;
3731 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3732 };
3733 export const StartNesRequest = Schema.Struct({
3734 workspaceUri: Schema.optionalKey(
3735 Schema.Union([
3736 Schema.String.annotate({ description: "The root URI of the workspace." }),
3737 Schema.Null,
3738 ]),
3739 ),
3740 workspaceFolders: Schema.optionalKey(
3741 Schema.Union([
3742 Schema.Array(WorkspaceFolder).annotate({ description: "The workspace folders." }),
3743 Schema.Null,
3744 ]),
3745 ),
3746 repository: Schema.optionalKey(
3747 Schema.Union([NesRepository, Schema.Null]).annotate({
3748 description: "Repository metadata, if the workspace is a git repository.",
3749 }),
3750 ),
3751 _meta: Schema.optionalKey(
3752 Schema.Union([
3753 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3754 description:
3755 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3756 }),
3757 Schema.Null,
3758 ]),
3759 ),
3760 }).annotate({ description: "Request to start an NES session.", identifier: "StartNesRequest" });
3761
3762 export type NesRelatedSnippet = {
3763 readonly uri: string;
3764 readonly excerpts: ReadonlyArray<NesExcerpt>;
3765 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3766 };
3767 export const NesRelatedSnippet = Schema.Struct({
3768 uri: Schema.String.annotate({ description: "The URI of the file containing the snippets." }),
3769 excerpts: Schema.Array(NesExcerpt).annotate({ description: "The code excerpts." }),
3770 _meta: Schema.optionalKey(
3771 Schema.Union([
3772 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3773 description:
3774 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3775 }),
3776 Schema.Null,
3777 ]),
3778 ),
3779 }).annotate({
3780 description: "A related code snippet from a file.",
3781 identifier: "NesRelatedSnippet",
3782 });
3783
3784 export type TerminalOutputResponse = {
3785 readonly output: string;
3786 readonly truncated: boolean;
3787 readonly exitStatus?: TerminalExitStatus | null;
3788 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3789 };
3790 export const TerminalOutputResponse = Schema.Struct({
3791 output: Schema.String.annotate({ description: "The terminal output captured so far." }),
3792 truncated: Schema.Boolean.annotate({
3793 description: "Whether the output was truncated due to byte limits.",
3794 }),
3795 exitStatus: Schema.optionalKey(
3796 Schema.Union([TerminalExitStatus, Schema.Null]).annotate({
3797 description: "Exit status if the command has completed.",
3798 }),
3799 ),
3800 _meta: Schema.optionalKey(
3801 Schema.Union([
3802 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3803 description:
3804 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3805 }),
3806 Schema.Null,
3807 ]),
3808 ),
3809 }).annotate({
3810 description: "Response containing the terminal output and exit status.",
3811 identifier: "TerminalOutputResponse",
3812 });
3813
3814 export type CreateElicitationResponse =
3815 | {
3816 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3817 readonly action: "accept";
3818 readonly content?: { readonly [x: string]: ElicitationContentValue } | null;
3819 }
3820 | { readonly _meta?: { readonly [x: string]: Schema.Json } | null; readonly action: "decline" }
3821 | { readonly _meta?: { readonly [x: string]: Schema.Json } | null; readonly action: "cancel" }
3822 | ({ readonly _meta?: { readonly [x: string]: Schema.Json } | null; readonly action: string } & {
3823 readonly [x: string]: Schema.Json;
3824 });
3825 export const CreateElicitationResponse = Schema.Union([
3826 Schema.Struct({
3827 _meta: Schema.optionalKey(
3828 Schema.Union([
3829 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3830 description:
3831 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3832 }),
3833 Schema.Null,
3834 ]),
3835 ),
3836 action: Schema.Literal("accept"),
3837 content: Schema.optionalKey(
3838 Schema.Union([
3839 Schema.Record(Schema.String, ElicitationContentValue).annotate({
3840 description:
3841 "The user-provided content, if any, as an object matching the requested schema.",
3842 }),
3843 Schema.Null,
3844 ]),
3845 ),
3846 }).annotate({ description: "The user accepted the elicitation and provided content." }),
3847 Schema.Struct({
3848 _meta: Schema.optionalKey(
3849 Schema.Union([
3850 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3851 description:
3852 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3853 }),
3854 Schema.Null,
3855 ]),
3856 ),
3857 action: Schema.Literal("decline"),
3858 }).annotate({ description: "The user declined the elicitation." }),
3859 Schema.Struct({
3860 _meta: Schema.optionalKey(
3861 Schema.Union([
3862 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3863 description:
3864 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3865 }),
3866 Schema.Null,
3867 ]),
3868 ),
3869 action: Schema.Literal("cancel"),
3870 }).annotate({ description: "The elicitation was cancelled." }),
3871 Schema.StructWithRest(
3872 Schema.Struct({
3873 _meta: Schema.optionalKey(
3874 Schema.Union([
3875 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3876 description:
3877 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3878 }),
3879 Schema.Null,
3880 ]),
3881 ),
3882 action: Schema.String.annotate({
3883 description:
3884 "Custom or future elicitation action.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.",
3885 }).check(
3886 Schema.isPattern(
3887 new RegExp("^(?!(?:\\x61ccept|\\x64ecline|\\x63ancel)$)[\\s\\S]*$"),
3888 ).annotate({
3889 expected:
3890 "a string matching the RegExp ^(?!(?:\\x61ccept|\\x64ecline|\\x63ancel)$)[\\s\\S]*$",
3891 }),
3892 ),
3893 }),
3894 [Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))],
3895 ).annotate({
3896 title: "other",
3897 description:
3898 "Custom or future elicitation action.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nAgents that do not understand this action should preserve the raw\npayload when storing, replaying, proxying, or forwarding elicitation\nresponses. They MUST NOT treat it as a known elicitation action.",
3899 }),
3900 ]).annotate({ identifier: "CreateElicitationResponse" });
3901
3902 export type ListSessionsResponse = {
3903 readonly sessions: ReadonlyArray<SessionInfo>;
3904 readonly nextCursor?: string | null;
3905 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3906 };
3907 export const ListSessionsResponse = Schema.Struct({
3908 sessions: Schema.Array(SessionInfo).annotate({
3909 description: "Array of session information objects",
3910 }),
3911 nextCursor: Schema.optionalKey(
3912 Schema.Union([
3913 Schema.String.annotate({
3914 description:
3915 "Opaque cursor token. If present, pass this in the next request's cursor parameter\nto fetch the next page. If absent, there are no more results.",
3916 }),
3917 Schema.Null,
3918 ]),
3919 ),
3920 _meta: Schema.optionalKey(
3921 Schema.Union([
3922 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3923 description:
3924 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3925 }),
3926 Schema.Null,
3927 ]),
3928 ),
3929 }).annotate({ description: "Response from listing sessions.", identifier: "ListSessionsResponse" });
3930
3931 export type NesDocumentEventCapabilities = {
3932 readonly didOpen?: NesDocumentDidOpenCapabilities | null;
3933 readonly didChange?: NesDocumentDidChangeCapabilities | null;
3934 readonly didClose?: NesDocumentDidCloseCapabilities | null;
3935 readonly didSave?: NesDocumentDidSaveCapabilities | null;
3936 readonly didFocus?: NesDocumentDidFocusCapabilities | null;
3937 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3938 };
3939 export const NesDocumentEventCapabilities = Schema.Struct({
3940 didOpen: Schema.optionalKey(
3941 Schema.Union([NesDocumentDidOpenCapabilities, Schema.Null]).annotate({
3942 description: "Whether the agent wants `document/didOpen` events.",
3943 }),
3944 ),
3945 didChange: Schema.optionalKey(
3946 Schema.Union([NesDocumentDidChangeCapabilities, Schema.Null]).annotate({
3947 description: "Whether the agent wants `document/didChange` events, and the sync kind.",
3948 }),
3949 ),
3950 didClose: Schema.optionalKey(
3951 Schema.Union([NesDocumentDidCloseCapabilities, Schema.Null]).annotate({
3952 description: "Whether the agent wants `document/didClose` events.",
3953 }),
3954 ),
3955 didSave: Schema.optionalKey(
3956 Schema.Union([NesDocumentDidSaveCapabilities, Schema.Null]).annotate({
3957 description: "Whether the agent wants `document/didSave` events.",
3958 }),
3959 ),
3960 didFocus: Schema.optionalKey(
3961 Schema.Union([NesDocumentDidFocusCapabilities, Schema.Null]).annotate({
3962 description: "Whether the agent wants `document/didFocus` events.",
3963 }),
3964 ),
3965 _meta: Schema.optionalKey(
3966 Schema.Union([
3967 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
3968 description:
3969 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
3970 }),
3971 Schema.Null,
3972 ]),
3973 ),
3974 }).annotate({
3975 description: "Document event capabilities the agent wants to receive.",
3976 identifier: "NesDocumentEventCapabilities",
3977 });
3978
3979 export type ContentBlock =
3980 | {
3981 readonly type: "text";
3982 readonly annotations?: Annotations | null;
3983 readonly text: string;
3984 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3985 }
3986 | {
3987 readonly type: "image";
3988 readonly annotations?: Annotations | null;
3989 readonly data: string;
3990 readonly mimeType: string;
3991 readonly uri?: string | null;
3992 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
3993 }
3994 | {
3995 readonly type: "audio";
3996 readonly annotations?: Annotations | null;
3997 readonly data: string;
3998 readonly mimeType: string;
3999 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
4000 }
4001 | {
4002 readonly type: "resource_link";
4003 readonly annotations?: Annotations | null;
4004 readonly description?: string | null;
4005 readonly mimeType?: string | null;
4006 readonly name: string;
4007 readonly size?: number | null;
4008 readonly title?: string | null;
4009 readonly uri: string;
4010 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
4011 }
4012 | {
4013 readonly type: "resource";
4014 readonly annotations?: Annotations | null;
4015 readonly resource: EmbeddedResourceResource;
4016 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
4017 };
4018 export const ContentBlock = Schema.Union([
4019 Schema.Struct({
4020 type: Schema.Literal("text"),
4021 annotations: Schema.optionalKey(
4022 Schema.Union([Annotations, Schema.Null]).annotate({
4023 description:
4024 "Optional annotations that help clients decide how to display or route this content.",
4025 }),
4026 ),
4027 text: Schema.String.annotate({ description: "Text payload carried by this content block." }),
4028 _meta: Schema.optionalKey(
4029 Schema.Union([
4030 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4031 description:
4032 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4033 }),
4034 Schema.Null,
4035 ]),
4036 ),
4037 }).annotate({ description: "Text provided to or from an LLM." }),
4038 Schema.Struct({
4039 type: Schema.Literal("image"),
4040 annotations: Schema.optionalKey(
4041 Schema.Union([Annotations, Schema.Null]).annotate({
4042 description:
4043 "Optional annotations that help clients decide how to display or route this content.",
4044 }),
4045 ),
4046 data: Schema.String.annotate({ description: "Base64-encoded media payload." }),
4047 mimeType: Schema.String.annotate({
4048 description: "MIME type describing the encoded media payload.",
4049 }),
4050 uri: Schema.optionalKey(
4051 Schema.Union([
4052 Schema.String.annotate({
4053 description: "URI associated with this resource or media payload.",
4054 }),
4055 Schema.Null,
4056 ]),
4057 ),
4058 _meta: Schema.optionalKey(
4059 Schema.Union([
4060 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4061 description:
4062 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4063 }),
4064 Schema.Null,
4065 ]),
4066 ),
4067 }).annotate({ description: "An image provided to or from an LLM." }),
4068 Schema.Struct({
4069 type: Schema.Literal("audio"),
4070 annotations: Schema.optionalKey(
4071 Schema.Union([Annotations, Schema.Null]).annotate({
4072 description:
4073 "Optional annotations that help clients decide how to display or route this content.",
4074 }),
4075 ),
4076 data: Schema.String.annotate({ description: "Base64-encoded media payload." }),
4077 mimeType: Schema.String.annotate({
4078 description: "MIME type describing the encoded media payload.",
4079 }),
4080 _meta: Schema.optionalKey(
4081 Schema.Union([
4082 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4083 description:
4084 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4085 }),
4086 Schema.Null,
4087 ]),
4088 ),
4089 }).annotate({ description: "Audio provided to or from an LLM." }),
4090 Schema.Struct({
4091 type: Schema.Literal("resource_link"),
4092 annotations: Schema.optionalKey(
4093 Schema.Union([Annotations, Schema.Null]).annotate({
4094 description:
4095 "Optional annotations that help clients decide how to display or route this content.",
4096 }),
4097 ),
4098 description: Schema.optionalKey(
4099 Schema.Union([
4100 Schema.String.annotate({
4101 description: "Optional human-readable details shown with this protocol object.",
4102 }),
4103 Schema.Null,
4104 ]),
4105 ),
4106 mimeType: Schema.optionalKey(
4107 Schema.Union([
4108 Schema.String.annotate({ description: "MIME type describing the encoded media payload." }),
4109 Schema.Null,
4110 ]),
4111 ),
4112 name: Schema.String.annotate({
4113 description: "Human-readable name shown for this protocol object.",
4114 }),
4115 size: Schema.optionalKey(
4116 Schema.Union([
4117 Schema.Number.annotate({
4118 description: "Optional size of the linked resource in bytes, if known.",
4119 format: "int64",
4120 }).check(Schema.isInt().annotate({ expected: "an integer" })),
4121 Schema.Null,
4122 ]),
4123 ),
4124 title: Schema.optionalKey(
4125 Schema.Union([
4126 Schema.String.annotate({ description: "Optional display title for end-user UI." }),
4127 Schema.Null,
4128 ]),
4129 ),
4130 uri: Schema.String.annotate({
4131 description: "URI associated with this resource or media payload.",
4132 }),
4133 _meta: Schema.optionalKey(
4134 Schema.Union([
4135 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4136 description:
4137 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4138 }),
4139 Schema.Null,
4140 ]),
4141 ),
4142 }).annotate({
4143 description:
4144 "A resource that the server is capable of reading, included in a prompt or tool call result.",
4145 }),
4146 Schema.Struct({
4147 type: Schema.Literal("resource"),
4148 annotations: Schema.optionalKey(
4149 Schema.Union([Annotations, Schema.Null]).annotate({
4150 description:
4151 "Optional annotations that help clients decide how to display or route this content.",
4152 }),
4153 ),
4154 resource: Schema.suspend(
4155 (): Schema.Codec<EmbeddedResourceResource> => EmbeddedResourceResource,
4156 ).annotate({ description: "Embedded resource payload, either text or binary data." }),
4157 _meta: Schema.optionalKey(
4158 Schema.Union([
4159 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4160 description:
4161 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4162 }),
4163 Schema.Null,
4164 ]),
4165 ),
4166 }).annotate({
4167 description: "The contents of a resource, embedded into a prompt or tool call result.",
4168 }),
4169 ]).annotate({
4170 description:
4171 "Content blocks represent displayable information in the Agent Client Protocol.\n\nThey provide a structured way to handle various types of user-facing content—whether\nit's text from language models, images for analysis, or embedded resources for context.\n\nContent blocks appear in:\n- User prompts sent via `session/prompt`\n- Language model output streamed through `session/update` notifications\n- Progress updates and results from tool calls\n\nThis structure is compatible with the Model Context Protocol (MCP), enabling\nagents to seamlessly forward content from MCP tool outputs without transformation.\n\nSee protocol docs: [Content](https://agentclientprotocol.com/protocol/content)",
4172 identifier: "ContentBlock",
4173 });
4174
4175 export type PlanUpdateContent =
4176 | {
4177 readonly type: "items";
4178 readonly planId: PlanId;
4179 readonly entries: ReadonlyArray<PlanEntry>;
4180 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
4181 }
4182 | {
4183 readonly type: "file";
4184 readonly planId: PlanId;
4185 readonly uri: string;
4186 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
4187 }
4188 | {
4189 readonly type: "markdown";
4190 readonly planId: PlanId;
4191 readonly content: string;
4192 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
4193 };
4194 export const PlanUpdateContent = Schema.Union([
4195 Schema.Struct({
4196 type: Schema.Literal("items"),
4197 planId: Schema.suspend((): Schema.Codec<PlanId> => PlanId).annotate({
4198 description: "The plan ID to update.",
4199 }),
4200 entries: Schema.Array(PlanEntry).annotate({
4201 description:
4202 "The list of tasks to be accomplished.\n\nWhen updating an item-based plan, the agent must send a complete list of all entries\nwith their current status. The client replaces that plan with each update.",
4203 }),
4204 _meta: Schema.optionalKey(
4205 Schema.Union([
4206 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4207 description:
4208 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4209 }),
4210 Schema.Null,
4211 ]),
4212 ),
4213 }).annotate({
4214 description:
4215 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA plan represented as structured entries.",
4216 }),
4217 Schema.Struct({
4218 type: Schema.Literal("file"),
4219 planId: Schema.suspend((): Schema.Codec<PlanId> => PlanId).annotate({
4220 description: "The plan ID to update.",
4221 }),
4222 uri: Schema.String.annotate({ description: "The URI of the file containing the plan." }),
4223 _meta: Schema.optionalKey(
4224 Schema.Union([
4225 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4226 description:
4227 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4228 }),
4229 Schema.Null,
4230 ]),
4231 ),
4232 }).annotate({
4233 description:
4234 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA plan represented by a file URI.",
4235 }),
4236 Schema.Struct({
4237 type: Schema.Literal("markdown"),
4238 planId: Schema.suspend((): Schema.Codec<PlanId> => PlanId).annotate({
4239 description: "The plan ID to update.",
4240 }),
4241 content: Schema.String.annotate({ description: "Markdown content for the plan." }),
4242 _meta: Schema.optionalKey(
4243 Schema.Union([
4244 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4245 description:
4246 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4247 }),
4248 Schema.Null,
4249 ]),
4250 ),
4251 }).annotate({
4252 description:
4253 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA plan represented as raw markdown content.",
4254 }),
4255 ]).annotate({
4256 description:
4257 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nUpdated content for a plan.",
4258 identifier: "PlanUpdateContent",
4259 });
4260
4261 export type AvailableCommand = {
4262 readonly name: string;
4263 readonly description: string;
4264 readonly input?: AvailableCommandInput | null;
4265 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
4266 };
4267 export const AvailableCommand = Schema.Struct({
4268 name: Schema.String.annotate({
4269 description: "Command name (e.g., `create_plan`, `research_codebase`).",
4270 }),
4271 description: Schema.String.annotate({
4272 description: "Human-readable description of what the command does.",
4273 }),
4274 input: Schema.optionalKey(
4275 Schema.Union([AvailableCommandInput, Schema.Null]).annotate({
4276 description: "Input for the command if required",
4277 }),
4278 ),
4279 _meta: Schema.optionalKey(
4280 Schema.Union([
4281 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4282 description:
4283 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4284 }),
4285 Schema.Null,
4286 ]),
4287 ),
4288 }).annotate({ description: "Information about a command.", identifier: "AvailableCommand" });
4289
4290 export type SessionModeState = {
4291 readonly currentModeId: SessionModeId;
4292 readonly availableModes: ReadonlyArray<SessionMode>;
4293 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
4294 };
4295 export const SessionModeState = Schema.Struct({
4296 currentModeId: Schema.suspend((): Schema.Codec<SessionModeId> => SessionModeId).annotate({
4297 description: "The current mode the Agent is in.",
4298 }),
4299 availableModes: Schema.Array(SessionMode).annotate({
4300 description: "The set of modes that the Agent can operate in",
4301 }),
4302 _meta: Schema.optionalKey(
4303 Schema.Union([
4304 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4305 description:
4306 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4307 }),
4308 Schema.Null,
4309 ]),
4310 ),
4311 }).annotate({
4312 description: "The set of modes and the one currently active.",
4313 identifier: "SessionModeState",
4314 });
4315
4316 export type SessionConfigSelectGroup = {
4317 readonly group: SessionConfigGroupId;
4318 readonly name: string;
4319 readonly options: ReadonlyArray<SessionConfigSelectOption>;
4320 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
4321 };
4322 export const SessionConfigSelectGroup = Schema.Struct({
4323 group: Schema.suspend((): Schema.Codec<SessionConfigGroupId> => SessionConfigGroupId).annotate({
4324 description: "Unique identifier for this group.",
4325 }),
4326 name: Schema.String.annotate({ description: "Human-readable label for this group." }),
4327 options: Schema.Array(SessionConfigSelectOption).annotate({
4328 description: "The set of option values in this group.",
4329 }),
4330 _meta: Schema.optionalKey(
4331 Schema.Union([
4332 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4333 description:
4334 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4335 }),
4336 Schema.Null,
4337 ]),
4338 ),
4339 }).annotate({
4340 description: "A group of possible values for a session configuration option.",
4341 identifier: "SessionConfigSelectGroup",
4342 });
4343
4344 export type RequestPermissionResponse = {
4345 readonly outcome: RequestPermissionOutcome;
4346 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
4347 };
4348 export const RequestPermissionResponse = Schema.Struct({
4349 outcome: Schema.suspend(
4350 (): Schema.Codec<RequestPermissionOutcome> => RequestPermissionOutcome,
4351 ).annotate({ description: "The user's decision on the permission request." }),
4352 _meta: Schema.optionalKey(
4353 Schema.Union([
4354 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4355 description:
4356 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4357 }),
4358 Schema.Null,
4359 ]),
4360 ),
4361 }).annotate({
4362 description: "Response to a permission request.",
4363 identifier: "RequestPermissionResponse",
4364 });
4365
4366 export type McpServer =
4367 | {
4368 readonly type: "http";
4369 readonly name: string;
4370 readonly url: string;
4371 readonly headers: ReadonlyArray<HttpHeader>;
4372 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
4373 }
4374 | {
4375 readonly type: "sse";
4376 readonly name: string;
4377 readonly url: string;
4378 readonly headers: ReadonlyArray<HttpHeader>;
4379 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
4380 }
4381 | {
4382 readonly type: "acp";
4383 readonly name: string;
4384 readonly serverId: McpServerAcpId;
4385 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
4386 }
4387 | McpServerStdio;
4388 export const McpServer = Schema.Union([
4389 Schema.Struct({
4390 type: Schema.Literal("http"),
4391 name: Schema.String.annotate({
4392 description: "Human-readable name identifying this MCP server.",
4393 }),
4394 url: Schema.String.annotate({ description: "URL to the MCP server." }),
4395 headers: Schema.Array(HttpHeader).annotate({
4396 description: "HTTP headers to set when making requests to the MCP server.",
4397 }),
4398 _meta: Schema.optionalKey(
4399 Schema.Union([
4400 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4401 description:
4402 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4403 }),
4404 Schema.Null,
4405 ]),
4406 ),
4407 }).annotate({ description: "HTTP transport configuration for MCP." }),
4408 Schema.Struct({
4409 type: Schema.Literal("sse"),
4410 name: Schema.String.annotate({
4411 description: "Human-readable name identifying this MCP server.",
4412 }),
4413 url: Schema.String.annotate({ description: "URL to the MCP server." }),
4414 headers: Schema.Array(HttpHeader).annotate({
4415 description: "HTTP headers to set when making requests to the MCP server.",
4416 }),
4417 _meta: Schema.optionalKey(
4418 Schema.Union([
4419 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4420 description:
4421 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4422 }),
4423 Schema.Null,
4424 ]),
4425 ),
4426 }).annotate({ description: "SSE transport configuration for MCP." }),
4427 Schema.Struct({
4428 type: Schema.Literal("acp"),
4429 name: Schema.String.annotate({
4430 description: "Human-readable name identifying this MCP server.",
4431 }),
4432 serverId: Schema.suspend((): Schema.Codec<McpServerAcpId> => McpServerAcpId).annotate({
4433 description:
4434 "Unique identifier for this MCP server, generated by the component providing it.\n\nProviders MUST NOT reuse an ID for multiple ACP-transport MCP servers that are visible\non the same ACP connection.",
4435 }),
4436 _meta: Schema.optionalKey(
4437 Schema.Union([
4438 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4439 description:
4440 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4441 }),
4442 Schema.Null,
4443 ]),
4444 ),
4445 }).annotate({
4446 description:
4447 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nACP transport configuration for MCP.\n\nThe MCP server is provided by an ACP component and communicates over the ACP channel\nusing `mcp/connect`, `mcp/message`, and `mcp/disconnect`.",
4448 }),
4449 Schema.suspend((): Schema.Codec<McpServerStdio> => McpServerStdio).annotate({
4450 title: "stdio",
4451 description: "Stdio transport configuration\n\nAll Agents MUST support this transport.",
4452 }),
4453 ]).annotate({
4454 description:
4455 "Configuration for connecting to an MCP (Model Context Protocol) server.\n\nMCP servers provide tools and context that the agent can use when\nprocessing prompts.\n\nSee protocol docs: [MCP Servers](https://agentclientprotocol.com/protocol/session-setup#mcp-servers)",
4456 identifier: "McpServer",
4457 });
4458
4459 export type ElicitationPropertySchema =
4460 | {
4461 readonly type: "string";
4462 readonly title?: string | null;
4463 readonly description?: string | null;
4464 readonly minLength?: number | null;
4465 readonly maxLength?: number | null;
4466 readonly pattern?: string | null;
4467 readonly format?: StringFormat | null;
4468 readonly default?: string | null;
4469 readonly enum?: ReadonlyArray<string> | null;
4470 readonly oneOf?: ReadonlyArray<EnumOption> | null;
4471 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
4472 }
4473 | {
4474 readonly type: "number";
4475 readonly title?: string | null;
4476 readonly description?: string | null;
4477 readonly minimum?: number | null;
4478 readonly maximum?: number | null;
4479 readonly default?: number | null;
4480 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
4481 }
4482 | {
4483 readonly type: "integer";
4484 readonly title?: string | null;
4485 readonly description?: string | null;
4486 readonly minimum?: number | null;
4487 readonly maximum?: number | null;
4488 readonly default?: number | null;
4489 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
4490 }
4491 | {
4492 readonly type: "boolean";
4493 readonly title?: string | null;
4494 readonly description?: string | null;
4495 readonly default?: boolean | null;
4496 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
4497 }
4498 | {
4499 readonly type: "array";
4500 readonly title?: string | null;
4501 readonly description?: string | null;
4502 readonly minItems?: number | null;
4503 readonly maxItems?: number | null;
4504 readonly items: MultiSelectItems;
4505 readonly default?: ReadonlyArray<string> | null;
4506 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
4507 }
4508 | ({ readonly type: string } & { readonly [x: string]: Schema.Json });
4509 export const ElicitationPropertySchema = Schema.Union([
4510 Schema.Struct({
4511 type: Schema.Literal("string"),
4512 title: Schema.optionalKey(
4513 Schema.Union([
4514 Schema.String.annotate({
4515 description:
4516 "Optional title for the property.\n\nOptional. Omitted and `null` are equivalent and mean no title is provided.",
4517 }),
4518 Schema.Null,
4519 ]),
4520 ),
4521 description: Schema.optionalKey(
4522 Schema.Union([
4523 Schema.String.annotate({
4524 description:
4525 "Human-readable description.\n\nOptional. Omitted and `null` are equivalent and mean no description is provided.",
4526 }),
4527 Schema.Null,
4528 ]),
4529 ),
4530 minLength: Schema.optionalKey(
4531 Schema.Union([
4532 Schema.Number.annotate({
4533 description:
4534 "Minimum string length.\n\nOptional. Omitted and `null` are equivalent and mean there is no minimum length constraint.",
4535 format: "uint32",
4536 })
4537 .check(Schema.isInt().annotate({ expected: "an integer" }))
4538 .check(
4539 Schema.isGreaterThanOrEqualTo(0).annotate({
4540 expected: "a value greater than or equal to 0",
4541 }),
4542 ),
4543 Schema.Null,
4544 ]),
4545 ),
4546 maxLength: Schema.optionalKey(
4547 Schema.Union([
4548 Schema.Number.annotate({
4549 description:
4550 "Maximum string length.\n\nOptional. Omitted and `null` are equivalent and mean there is no maximum length constraint.",
4551 format: "uint32",
4552 })
4553 .check(Schema.isInt().annotate({ expected: "an integer" }))
4554 .check(
4555 Schema.isGreaterThanOrEqualTo(0).annotate({
4556 expected: "a value greater than or equal to 0",
4557 }),
4558 ),
4559 Schema.Null,
4560 ]),
4561 ),
4562 pattern: Schema.optionalKey(
4563 Schema.Union([
4564 Schema.String.annotate({
4565 description:
4566 "Pattern the string must match.\n\nOptional. Omitted and `null` are equivalent and mean there is no pattern constraint.",
4567 }),
4568 Schema.Null,
4569 ]),
4570 ),
4571 format: Schema.optionalKey(
4572 Schema.Union([StringFormat, Schema.Null]).annotate({
4573 description:
4574 "String format.\n\nOptional. Omitted and `null` are equivalent and mean there is no format constraint.",
4575 }),
4576 ),
4577 default: Schema.optionalKey(
4578 Schema.Union([
4579 Schema.String.annotate({
4580 description:
4581 "Default value.\n\nOptional. Omitted and `null` are equivalent and mean no default value is provided.",
4582 }),
4583 Schema.Null,
4584 ]),
4585 ),
4586 enum: Schema.optionalKey(
4587 Schema.Union([
4588 Schema.Array(Schema.String).annotate({
4589 description:
4590 "Enum values for untitled single-select enums.\nOptional. Omitted and `null` are equivalent and mean no untitled single-select choices are\ndeclared by `enum`.",
4591 }),
4592 Schema.Null,
4593 ]),
4594 ),
4595 oneOf: Schema.optionalKey(
4596 Schema.Union([
4597 Schema.Array(EnumOption).annotate({
4598 description:
4599 "Titled enum options for titled single-select enums.\nOptional. Omitted and `null` are equivalent and mean no titled single-select choices are\ndeclared by `oneOf`.",
4600 }),
4601 Schema.Null,
4602 ]),
4603 ),
4604 _meta: Schema.optionalKey(
4605 Schema.Union([
4606 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4607 description:
4608 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4609 }),
4610 Schema.Null,
4611 ]),
4612 ),
4613 }).annotate({
4614 description:
4615 'Schema for string properties in an elicitation form.\n\nWhen `enum` or `oneOf` is set, this represents a single-select enum\nwith `"type": "string"`.',
4616 }),
4617 Schema.Struct({
4618 type: Schema.Literal("number"),
4619 title: Schema.optionalKey(
4620 Schema.Union([
4621 Schema.String.annotate({
4622 description:
4623 "Optional title for the property.\n\nOptional. Omitted and `null` are equivalent and mean no title is provided.",
4624 }),
4625 Schema.Null,
4626 ]),
4627 ),
4628 description: Schema.optionalKey(
4629 Schema.Union([
4630 Schema.String.annotate({
4631 description:
4632 "Human-readable description.\n\nOptional. Omitted and `null` are equivalent and mean no description is provided.",
4633 }),
4634 Schema.Null,
4635 ]),
4636 ),
4637 minimum: Schema.optionalKey(
4638 Schema.Union([
4639 Schema.Number.annotate({
4640 description:
4641 "Minimum value (inclusive).\n\nOptional. Omitted and `null` are equivalent and mean there is no inclusive lower bound.",
4642 format: "double",
4643 }).check(Schema.isFinite().annotate({ expected: "a finite number" })),
4644 Schema.Null,
4645 ]),
4646 ),
4647 maximum: Schema.optionalKey(
4648 Schema.Union([
4649 Schema.Number.annotate({
4650 description:
4651 "Maximum value (inclusive).\n\nOptional. Omitted and `null` are equivalent and mean there is no inclusive upper bound.",
4652 format: "double",
4653 }).check(Schema.isFinite().annotate({ expected: "a finite number" })),
4654 Schema.Null,
4655 ]),
4656 ),
4657 default: Schema.optionalKey(
4658 Schema.Union([
4659 Schema.Number.annotate({
4660 description:
4661 "Default value.\n\nOptional. Omitted and `null` are equivalent and mean no default value is provided.",
4662 format: "double",
4663 }).check(Schema.isFinite().annotate({ expected: "a finite number" })),
4664 Schema.Null,
4665 ]),
4666 ),
4667 _meta: Schema.optionalKey(
4668 Schema.Union([
4669 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4670 description:
4671 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4672 }),
4673 Schema.Null,
4674 ]),
4675 ),
4676 }).annotate({
4677 description: "Schema for number (floating-point) properties in an elicitation form.",
4678 }),
4679 Schema.Struct({
4680 type: Schema.Literal("integer"),
4681 title: Schema.optionalKey(
4682 Schema.Union([
4683 Schema.String.annotate({
4684 description:
4685 "Optional title for the property.\n\nOptional. Omitted and `null` are equivalent and mean no title is provided.",
4686 }),
4687 Schema.Null,
4688 ]),
4689 ),
4690 description: Schema.optionalKey(
4691 Schema.Union([
4692 Schema.String.annotate({
4693 description:
4694 "Human-readable description.\n\nOptional. Omitted and `null` are equivalent and mean no description is provided.",
4695 }),
4696 Schema.Null,
4697 ]),
4698 ),
4699 minimum: Schema.optionalKey(
4700 Schema.Union([
4701 Schema.Number.annotate({
4702 description:
4703 "Minimum value (inclusive).\n\nOptional. Omitted and `null` are equivalent and mean there is no inclusive lower bound.",
4704 format: "int64",
4705 }).check(Schema.isInt().annotate({ expected: "an integer" })),
4706 Schema.Null,
4707 ]),
4708 ),
4709 maximum: Schema.optionalKey(
4710 Schema.Union([
4711 Schema.Number.annotate({
4712 description:
4713 "Maximum value (inclusive).\n\nOptional. Omitted and `null` are equivalent and mean there is no inclusive upper bound.",
4714 format: "int64",
4715 }).check(Schema.isInt().annotate({ expected: "an integer" })),
4716 Schema.Null,
4717 ]),
4718 ),
4719 default: Schema.optionalKey(
4720 Schema.Union([
4721 Schema.Number.annotate({
4722 description:
4723 "Default value.\n\nOptional. Omitted and `null` are equivalent and mean no default value is provided.",
4724 format: "int64",
4725 }).check(Schema.isInt().annotate({ expected: "an integer" })),
4726 Schema.Null,
4727 ]),
4728 ),
4729 _meta: Schema.optionalKey(
4730 Schema.Union([
4731 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4732 description:
4733 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4734 }),
4735 Schema.Null,
4736 ]),
4737 ),
4738 }).annotate({ description: "Schema for integer properties in an elicitation form." }),
4739 Schema.Struct({
4740 type: Schema.Literal("boolean"),
4741 title: Schema.optionalKey(
4742 Schema.Union([
4743 Schema.String.annotate({
4744 description:
4745 "Optional title for the property.\n\nOptional. Omitted and `null` are equivalent and mean no title is provided.",
4746 }),
4747 Schema.Null,
4748 ]),
4749 ),
4750 description: Schema.optionalKey(
4751 Schema.Union([
4752 Schema.String.annotate({
4753 description:
4754 "Human-readable description.\n\nOptional. Omitted and `null` are equivalent and mean no description is provided.",
4755 }),
4756 Schema.Null,
4757 ]),
4758 ),
4759 default: Schema.optionalKey(
4760 Schema.Union([
4761 Schema.Boolean.annotate({
4762 description:
4763 "Default value.\n\nOptional. Omitted and `null` are equivalent and mean no default value is provided.",
4764 }),
4765 Schema.Null,
4766 ]),
4767 ),
4768 _meta: Schema.optionalKey(
4769 Schema.Union([
4770 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4771 description:
4772 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4773 }),
4774 Schema.Null,
4775 ]),
4776 ),
4777 }).annotate({ description: "Schema for boolean properties in an elicitation form." }),
4778 Schema.Struct({
4779 type: Schema.Literal("array"),
4780 title: Schema.optionalKey(
4781 Schema.Union([
4782 Schema.String.annotate({
4783 description:
4784 "Optional title for the property.\n\nOptional. Omitted and `null` are equivalent and mean no title is provided.",
4785 }),
4786 Schema.Null,
4787 ]),
4788 ),
4789 description: Schema.optionalKey(
4790 Schema.Union([
4791 Schema.String.annotate({
4792 description:
4793 "Human-readable description.\n\nOptional. Omitted and `null` are equivalent and mean no description is provided.",
4794 }),
4795 Schema.Null,
4796 ]),
4797 ),
4798 minItems: Schema.optionalKey(
4799 Schema.Union([
4800 Schema.Number.annotate({
4801 description:
4802 "Minimum number of items to select.\n\nOptional. Omitted and `null` are equivalent and mean there is no minimum selection count.",
4803 format: "uint64",
4804 })
4805 .check(Schema.isInt().annotate({ expected: "an integer" }))
4806 .check(
4807 Schema.isGreaterThanOrEqualTo(0).annotate({
4808 expected: "a value greater than or equal to 0",
4809 }),
4810 ),
4811 Schema.Null,
4812 ]),
4813 ),
4814 maxItems: Schema.optionalKey(
4815 Schema.Union([
4816 Schema.Number.annotate({
4817 description:
4818 "Maximum number of items to select.\n\nOptional. Omitted and `null` are equivalent and mean there is no maximum selection count.",
4819 format: "uint64",
4820 })
4821 .check(Schema.isInt().annotate({ expected: "an integer" }))
4822 .check(
4823 Schema.isGreaterThanOrEqualTo(0).annotate({
4824 expected: "a value greater than or equal to 0",
4825 }),
4826 ),
4827 Schema.Null,
4828 ]),
4829 ),
4830 items: Schema.suspend((): Schema.Codec<MultiSelectItems> => MultiSelectItems).annotate({
4831 description: "The items definition describing allowed values.",
4832 }),
4833 default: Schema.optionalKey(
4834 Schema.Union([
4835 Schema.Array(Schema.String).annotate({
4836 description:
4837 "Default selected values.\n\nOptional. Omitted and `null` are equivalent and mean no default selections are provided.",
4838 }),
4839 Schema.Null,
4840 ]),
4841 ),
4842 _meta: Schema.optionalKey(
4843 Schema.Union([
4844 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4845 description:
4846 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4847 }),
4848 Schema.Null,
4849 ]),
4850 ),
4851 }).annotate({
4852 description: "Schema for multi-select (array) properties in an elicitation form.",
4853 }),
4854 Schema.StructWithRest(
4855 Schema.Struct({
4856 type: Schema.String.annotate({
4857 description:
4858 "Custom or future elicitation property schema type.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.",
4859 }).check(
4860 Schema.isPattern(
4861 new RegExp("^(?!(?:\\x73tring|\\x6eumber|\\x69nteger|\\x62oolean|\\x61rray)$)[\\s\\S]*$"),
4862 ).annotate({
4863 expected:
4864 "a string matching the RegExp ^(?!(?:\\x73tring|\\x6eumber|\\x69nteger|\\x62oolean|\\x61rray)$)[\\s\\S]*$",
4865 }),
4866 ),
4867 }),
4868 [Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))],
4869 ).annotate({
4870 title: "other",
4871 description:
4872 "Custom or future elicitation property schema.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nClients that do not understand this property schema type should preserve\nthe raw schema when storing, replaying, proxying, or forwarding\nelicitation requests. They MUST NOT render it as a known input control.",
4873 }),
4874 ]).annotate({
4875 description:
4876 'Property schema for elicitation form fields.\n\nEach variant corresponds to a JSON Schema `"type"` value.\nSingle-select enums use the `String` variant with `enum` or `oneOf` set.\nMulti-select enums use the `Array` variant.',
4877 identifier: "ElicitationPropertySchema",
4878 });
4879
4880 export type AuthMethod =
4881 | {
4882 readonly type: "terminal";
4883 readonly id: AuthMethodId;
4884 readonly name: string;
4885 readonly description?: string | null;
4886 readonly args?: ReadonlyArray<string>;
4887 readonly env?: { readonly [x: string]: string };
4888 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
4889 }
4890 | AuthMethodAgent;
4891 export const AuthMethod = Schema.Union([
4892 Schema.Struct({
4893 type: Schema.Literal("terminal"),
4894 id: Schema.suspend((): Schema.Codec<AuthMethodId> => AuthMethodId).annotate({
4895 description: "Unique identifier for this authentication method.",
4896 }),
4897 name: Schema.String.annotate({
4898 description: "Human-readable name of the authentication method.",
4899 }),
4900 description: Schema.optionalKey(
4901 Schema.Union([
4902 Schema.String.annotate({
4903 description:
4904 "Optional description providing more details about this authentication method.",
4905 }),
4906 Schema.Null,
4907 ]),
4908 ),
4909 args: Schema.optionalKey(
4910 Schema.Array(Schema.String).annotate({
4911 description:
4912 "Additional arguments to append to the configured agent invocation for terminal auth.",
4913 }),
4914 ),
4915 env: Schema.optionalKey(
4916 Schema.Record(Schema.String, Schema.String).annotate({
4917 description:
4918 "Additional environment variables to set on the configured agent invocation for terminal auth.\nThese values override same-named variables in the base launch configuration.",
4919 }),
4920 ),
4921 _meta: Schema.optionalKey(
4922 Schema.Union([
4923 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4924 description:
4925 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4926 }),
4927 Schema.Null,
4928 ]),
4929 ),
4930 }).annotate({
4931 description:
4932 "Terminal-based authentication method.\n\nThe client runs the configured agent program as a separate interactive\nprocess for the user to authenticate via a TUI. Agents MUST advertise this\nmethod only when the client enabled its terminal authentication capability.\nA zero exit status signals success; any other termination signals failure.\nThe client MUST NOT pass this method to `authenticate`.",
4933 }),
4934 Schema.suspend((): Schema.Codec<AuthMethodAgent> => AuthMethodAgent).annotate({
4935 title: "agent",
4936 description:
4937 "Agent handles authentication itself through `authenticate`.\n\nThis is the default when no `type` is specified.",
4938 }),
4939 ]).annotate({
4940 description:
4941 "Describes an available authentication method.\n\nThe `type` field acts as the discriminator in the serialized JSON form.\nWhen no `type` is present, the method is treated as `agent`.",
4942 identifier: "AuthMethod",
4943 });
4944
4945 export type ProviderInfo = {
4946 readonly providerId: ProviderId;
4947 readonly supported: ReadonlyArray<LlmProtocol>;
4948 readonly required: boolean;
4949 readonly current?: ProviderCurrentConfig | null;
4950 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
4951 };
4952 export const ProviderInfo = Schema.Struct({
4953 providerId: Schema.suspend((): Schema.Codec<ProviderId> => ProviderId).annotate({
4954 description: 'Provider identifier, for example "main" or "openai".',
4955 }),
4956 supported: Schema.Array(LlmProtocol).annotate({
4957 description: "Supported protocol types for this provider.",
4958 }),
4959 required: Schema.Boolean.annotate({
4960 description:
4961 "Whether this provider is mandatory and cannot be disabled via `providers/disable`.\nIf true, clients must not call `providers/disable` for this provider ID.",
4962 }),
4963 current: Schema.optionalKey(
4964 Schema.Union([ProviderCurrentConfig, Schema.Null]).annotate({
4965 description:
4966 "Current effective non-secret routing config.\nNull or omitted means provider is disabled.",
4967 }),
4968 ),
4969 _meta: Schema.optionalKey(
4970 Schema.Union([
4971 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4972 description:
4973 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4974 }),
4975 Schema.Null,
4976 ]),
4977 ),
4978 }).annotate({
4979 description:
4980 "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nInformation about a configurable LLM provider.",
4981 identifier: "ProviderInfo",
4982 });
4983
4984 export type NesTextEdit = {
4985 readonly range: Range;
4986 readonly newText: string;
4987 readonly _meta?: { readonly [x: string]: Schema.Json } | null;
4988 };
4989 export const NesTextEdit = Schema.Struct({
4990 range: Schema.suspend((): Schema.Codec<Range> => Range).annotate({
4991 description: "The range to replace.",
4992 }),
4993 newText: Schema.String.annotate({ description: "The replacement text." }),
4994 _meta: Schema.optionalKey(
4995 Schema.Union([
4996 Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
4997 description:
4998 "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
4999 }),
5000 Schema.Null,
Showing first 5,000 of 9,412 lines. View raw