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