// This file is generated by the effect-acp package. Do not edit manually.
import * as Schema from "effect/Schema";
export type SessionId = string;
export const SessionId = Schema.String.annotate({
description:
"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)",
identifier: "SessionId",
});
export type NesSuggestionId = string;
export const NesSuggestionId = Schema.String.annotate({
description:
"**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.",
identifier: "NesSuggestionId",
});
export type PromptImageCapabilities = {
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const PromptImageCapabilities = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description:
"Capabilities for image content in prompt requests.\n\nSupplying `{}` means the agent supports image content in prompts.",
identifier: "PromptImageCapabilities",
});
export type PromptAudioCapabilities = {
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const PromptAudioCapabilities = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description:
"Capabilities for audio content in prompt requests.\n\nSupplying `{}` means the agent supports audio content in prompts.",
identifier: "PromptAudioCapabilities",
});
export type PromptEmbeddedContextCapabilities = {
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const PromptEmbeddedContextCapabilities = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description:
"Capabilities for embedded context in prompt requests.\n\nSupplying `{}` means the agent supports embedded context in prompts.",
identifier: "PromptEmbeddedContextCapabilities",
});
export type McpStdioCapabilities = {
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const McpStdioCapabilities = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description:
"Capabilities for stdio MCP server transports.\n\nSupplying `{}` means the agent supports stdio MCP server transports.",
identifier: "McpStdioCapabilities",
});
export type McpHttpCapabilities = { readonly _meta?: { readonly [x: string]: Schema.Json } | null };
export const McpHttpCapabilities = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description:
"Capabilities for HTTP MCP server transports.\n\nSupplying `{}` means the agent supports HTTP MCP server transports.",
identifier: "McpHttpCapabilities",
});
export type McpAcpCapabilities = { readonly _meta?: { readonly [x: string]: Schema.Json } | null };
export const McpAcpCapabilities = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description:
"**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.",
identifier: "McpAcpCapabilities",
});
export type SessionDeleteCapabilities = {
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const SessionDeleteCapabilities = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description:
"Capabilities for the `session/delete` method.\n\nSupplying `{}` means the agent supports deleting sessions from `session/list`.",
identifier: "SessionDeleteCapabilities",
});
export type SessionAdditionalDirectoriesCapabilities = {
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const SessionAdditionalDirectoriesCapabilities = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description:
"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.",
identifier: "SessionAdditionalDirectoriesCapabilities",
});
export type SessionForkCapabilities = {
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const SessionForkCapabilities = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description:
"**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.",
identifier: "SessionForkCapabilities",
});
export type AgentAuthCapabilities = {
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const AgentAuthCapabilities = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description:
"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.",
identifier: "AgentAuthCapabilities",
});
export type ProvidersCapabilities = {
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const ProvidersCapabilities = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description:
"**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.",
identifier: "ProvidersCapabilities",
});
export type NesDocumentDidOpenCapabilities = {
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const NesDocumentDidOpenCapabilities = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description: "Marker for `document/didOpen` capability support.",
identifier: "NesDocumentDidOpenCapabilities",
});
export type TextDocumentSyncKind = "full" | "incremental";
export const TextDocumentSyncKind = Schema.Union([
Schema.Literal("full").annotate({
description: "Client sends the entire file content on each change.",
}),
Schema.Literal("incremental").annotate({ description: "Client sends only the changed ranges." }),
]).annotate({
description: "How the agent wants document changes delivered.",
identifier: "TextDocumentSyncKind",
});
export type NesDocumentDidCloseCapabilities = {
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const NesDocumentDidCloseCapabilities = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description: "Marker for `document/didClose` capability support.",
identifier: "NesDocumentDidCloseCapabilities",
});
export type NesDocumentDidSaveCapabilities = {
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const NesDocumentDidSaveCapabilities = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description: "Marker for `document/didSave` capability support.",
identifier: "NesDocumentDidSaveCapabilities",
});
export type NesDocumentDidFocusCapabilities = {
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const NesDocumentDidFocusCapabilities = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description: "Marker for `document/didFocus` capability support.",
identifier: "NesDocumentDidFocusCapabilities",
});
export type NesRecentFilesCapabilities = {
readonly maxCount?: number | null;
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const NesRecentFilesCapabilities = Schema.Struct({
maxCount: Schema.optionalKey(
Schema.Union([
Schema.Number.annotate({
description: "Maximum number of recent files the agent can use.",
format: "uint32",
})
.check(Schema.isInt().annotate({ expected: "an integer" }))
.check(
Schema.isGreaterThanOrEqualTo(0).annotate({
expected: "a value greater than or equal to 0",
}),
),
Schema.Null,
]),
),
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description: "Capabilities for recent files context.",
identifier: "NesRecentFilesCapabilities",
});
export type NesRelatedSnippetsCapabilities = {
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const NesRelatedSnippetsCapabilities = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description: "Capabilities for related snippets context.",
identifier: "NesRelatedSnippetsCapabilities",
});
export type NesEditHistoryCapabilities = {
readonly maxCount?: number | null;
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const NesEditHistoryCapabilities = Schema.Struct({
maxCount: Schema.optionalKey(
Schema.Union([
Schema.Number.annotate({
description: "Maximum number of edit history entries the agent can use.",
format: "uint32",
})
.check(Schema.isInt().annotate({ expected: "an integer" }))
.check(
Schema.isGreaterThanOrEqualTo(0).annotate({
expected: "a value greater than or equal to 0",
}),
),
Schema.Null,
]),
),
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description: "Capabilities for edit history context.",
identifier: "NesEditHistoryCapabilities",
});
export type NesUserActionsCapabilities = {
readonly maxCount?: number | null;
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const NesUserActionsCapabilities = Schema.Struct({
maxCount: Schema.optionalKey(
Schema.Union([
Schema.Number.annotate({
description: "Maximum number of user actions the agent can use.",
format: "uint32",
})
.check(Schema.isInt().annotate({ expected: "an integer" }))
.check(
Schema.isGreaterThanOrEqualTo(0).annotate({
expected: "a value greater than or equal to 0",
}),
),
Schema.Null,
]),
),
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description: "Capabilities for user actions context.",
identifier: "NesUserActionsCapabilities",
});
export type NesOpenFilesCapabilities = {
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const NesOpenFilesCapabilities = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description: "Capabilities for open files context.",
identifier: "NesOpenFilesCapabilities",
});
export type NesDiagnosticsCapabilities = {
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const NesDiagnosticsCapabilities = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description: "Capabilities for diagnostics context.",
identifier: "NesDiagnosticsCapabilities",
});
export type PositionEncodingKind = "utf-16" | "utf-32" | "utf-8";
export const PositionEncodingKind = Schema.Union([
Schema.Literal("utf-16").annotate({
description: "Character offsets count UTF-16 code units. This is the default.",
}),
Schema.Literal("utf-32").annotate({
description: "Character offsets count Unicode code points.",
}),
Schema.Literal("utf-8").annotate({
description: "Character offsets count UTF-8 code units (bytes).",
}),
]).annotate({
description:
"The encoding used for character offsets in positions.\n\nFollows the same conventions as LSP 3.17. The default is UTF-16.",
identifier: "PositionEncodingKind",
});
export type MessageId = string;
export const MessageId = Schema.String.annotate({
description: "Unique identifier for a message within a session.",
identifier: "MessageId",
});
export type Role = "assistant" | "user" | string;
export const Role = Schema.Union([
Schema.Literal("assistant").annotate({ description: "The assistant side of a conversation." }),
Schema.Literal("user").annotate({ description: "The user side of a conversation." }),
Schema.String.annotate({
title: "other",
description:
"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.",
}),
]).annotate({
description: "The sender or recipient of messages and data in a conversation.",
identifier: "Role",
});
export type MediaType = string;
export const MediaType = Schema.String.annotate({
description: "An Internet media type identifying the format of protocol content.",
identifier: "MediaType",
});
export type IconTheme = "light" | "dark" | string;
export const IconTheme = Schema.Union([
Schema.Literal("light").annotate({ description: "Icon designed for light backgrounds." }),
Schema.Literal("dark").annotate({ description: "Icon designed for dark backgrounds." }),
Schema.String.annotate({
title: "other",
description:
"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.",
}),
]).annotate({ description: "Theme an icon is designed for.", identifier: "IconTheme" });
export type StopReason =
| "end_turn"
| "max_tokens"
| "max_turn_requests"
| "refusal"
| "cancelled"
| string;
export const StopReason = Schema.Union([
Schema.Literal("end_turn").annotate({ description: "The active work ended successfully." }),
Schema.Literal("max_tokens").annotate({
description: "The active work ended because the agent reached the maximum number of tokens.",
}),
Schema.Literal("max_turn_requests").annotate({
description:
"The active work ended because the agent reached the maximum number of\nallowed agent requests before returning idle.",
}),
Schema.Literal("refusal").annotate({
description:
"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.",
}),
Schema.Literal("cancelled").annotate({
description:
"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.",
}),
Schema.String.annotate({
title: "other",
description:
"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.",
}),
]).annotate({
description:
"Reasons why an agent stops active session work.\n\nSee protocol docs: [Stop Reasons](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#stop-reasons)",
identifier: "StopReason",
});
export type Usage = {
readonly totalTokens: number;
readonly inputTokens: number;
readonly outputTokens: number;
readonly thoughtTokens?: number | null;
readonly cachedReadTokens?: number | null;
readonly cachedWriteTokens?: number | null;
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const Usage = Schema.Struct({
totalTokens: Schema.Number.annotate({
description: "Sum of all token types across session.",
format: "uint64",
})
.check(Schema.isInt().annotate({ expected: "an integer" }))
.check(
Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }),
),
inputTokens: Schema.Number.annotate({ description: "Total input tokens.", format: "uint64" })
.check(Schema.isInt().annotate({ expected: "an integer" }))
.check(
Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }),
),
outputTokens: Schema.Number.annotate({ description: "Total output tokens.", format: "uint64" })
.check(Schema.isInt().annotate({ expected: "an integer" }))
.check(
Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }),
),
thoughtTokens: Schema.optionalKey(
Schema.Union([
Schema.Number.annotate({ description: "Total thought/reasoning tokens", format: "uint64" })
.check(Schema.isInt().annotate({ expected: "an integer" }))
.check(
Schema.isGreaterThanOrEqualTo(0).annotate({
expected: "a value greater than or equal to 0",
}),
),
Schema.Null,
]),
),
cachedReadTokens: Schema.optionalKey(
Schema.Union([
Schema.Number.annotate({ description: "Total cache read tokens.", format: "uint64" })
.check(Schema.isInt().annotate({ expected: "an integer" }))
.check(
Schema.isGreaterThanOrEqualTo(0).annotate({
expected: "a value greater than or equal to 0",
}),
),
Schema.Null,
]),
),
cachedWriteTokens: Schema.optionalKey(
Schema.Union([
Schema.Number.annotate({ description: "Total cache write tokens.", format: "uint64" })
.check(Schema.isInt().annotate({ expected: "an integer" }))
.check(
Schema.isGreaterThanOrEqualTo(0).annotate({
expected: "a value greater than or equal to 0",
}),
),
Schema.Null,
]),
),
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description:
"**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.",
identifier: "Usage",
});
export type ToolCallId = string;
export const ToolCallId = Schema.String.annotate({
description: "Unique identifier for a tool call within a session.",
identifier: "ToolCallId",
});
export type DiffFileType = "text" | "binary" | "directory" | "symlink" | string;
export const DiffFileType = Schema.Union([
Schema.Literal("text").annotate({ description: "Text content." }),
Schema.Literal("binary").annotate({ description: "Binary or otherwise non-text content." }),
Schema.Literal("directory").annotate({ description: "Directory entry." }),
Schema.Literal("symlink").annotate({ description: "Symbolic link." }),
Schema.String.annotate({
title: "other",
description:
"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.",
}),
]).annotate({
description: "Kind of file content represented by a diff change.",
identifier: "DiffFileType",
});
export type AbsolutePath = string;
export const AbsolutePath = Schema.String.annotate({
description: "An absolute filesystem path used by the protocol.",
identifier: "AbsolutePath",
});
export type DiffPatchFormat = "git_patch" | string;
export const DiffPatchFormat = Schema.Union([
Schema.Literal("git_patch").annotate({
description:
"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.",
}),
Schema.String.annotate({
title: "other",
description:
"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.",
}),
]).annotate({
description: "Text patch format used by [`DiffPatch`].",
identifier: "DiffPatchFormat",
});
export type TerminalId = string;
export const TerminalId = Schema.String.annotate({
description: "Unique identifier for an agent-owned terminal within a session.",
identifier: "TerminalId",
});
export type ToolKind =
| "read"
| "edit"
| "delete"
| "move"
| "search"
| "execute"
| "think"
| "fetch"
| "switch_mode"
| "other"
| string;
export const ToolKind = Schema.Union([
Schema.Literal("read").annotate({ description: "Reading files or data." }),
Schema.Literal("edit").annotate({ description: "Modifying files or content." }),
Schema.Literal("delete").annotate({ description: "Removing files or data." }),
Schema.Literal("move").annotate({ description: "Moving or renaming files." }),
Schema.Literal("search").annotate({ description: "Searching for information." }),
Schema.Literal("execute").annotate({ description: "Running commands or code." }),
Schema.Literal("think").annotate({ description: "Internal reasoning or planning." }),
Schema.Literal("fetch").annotate({ description: "Retrieving external data." }),
Schema.Literal("switch_mode").annotate({ description: "Switching the current session mode." }),
Schema.Literal("other").annotate({ description: "Other tool types (default)." }),
Schema.String.annotate({
title: "unknown",
description:
"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.",
}),
]).annotate({
description:
"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)",
identifier: "ToolKind",
});
export type ToolCallStatus =
| "pending"
| "in_progress"
| "completed"
| "failed"
| "cancelled"
| string;
export const ToolCallStatus = Schema.Union([
Schema.Literal("pending").annotate({
description:
"The tool call hasn't started running yet because the input is either\nstreaming or we're awaiting approval.",
}),
Schema.Literal("in_progress").annotate({ description: "The tool call is currently running." }),
Schema.Literal("completed").annotate({ description: "The tool call completed successfully." }),
Schema.Literal("failed").annotate({ description: "The tool call failed with an error." }),
Schema.Literal("cancelled").annotate({
description: "The tool call was cancelled before it completed.",
}),
Schema.String.annotate({
title: "other",
description:
"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.",
}),
]).annotate({
description:
"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)",
identifier: "ToolCallStatus",
});
export type TerminalOutput = {
readonly data: string;
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const TerminalOutput = Schema.Struct({
data: Schema.String.annotate({
description: "Base64-encoded replacement terminal output bytes.",
contentEncoding: "base64",
}),
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved 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)",
}),
Schema.Null,
]),
),
}).annotate({
description: "An authoritative replacement snapshot of terminal output bytes.",
identifier: "TerminalOutput",
});
export type TerminalExitStatus = {
readonly exitCode?: number | null;
readonly signal?: string | null;
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const TerminalExitStatus = Schema.Struct({
exitCode: Schema.optionalKey(
Schema.Union([
Schema.Number.annotate({
description: "Process exit code, when known. Omitted and `null` are equivalent.",
format: "uint32",
})
.check(Schema.isInt().annotate({ expected: "an integer" }))
.check(
Schema.isGreaterThanOrEqualTo(0).annotate({
expected: "a value greater than or equal to 0",
}),
),
Schema.Null,
]),
),
signal: Schema.optionalKey(
Schema.Union([
Schema.String.annotate({
description:
"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.",
}),
Schema.Null,
]),
),
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved 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)",
}),
Schema.Null,
]),
),
}).annotate({
description:
"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.",
identifier: "TerminalExitStatus",
});
export type PlanId = string;
export const PlanId = Schema.String.annotate({
description: "Unique identifier for a plan within a session.",
identifier: "PlanId",
});
export type PlanEntryPriority = "high" | "medium" | "low" | string;
export const PlanEntryPriority = Schema.Union([
Schema.Literal("high").annotate({
description: "High priority task - critical to the overall goal.",
}),
Schema.Literal("medium").annotate({
description: "Medium priority task - important but not critical.",
}),
Schema.Literal("low").annotate({
description: "Low priority task - nice to have but not essential.",
}),
Schema.String.annotate({
title: "other",
description:
"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.",
}),
]).annotate({
description:
"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)",
identifier: "PlanEntryPriority",
});
export type PlanEntryStatus = "pending" | "in_progress" | "completed" | "cancelled" | string;
export const PlanEntryStatus = Schema.Union([
Schema.Literal("pending").annotate({ description: "The task has not started yet." }),
Schema.Literal("in_progress").annotate({ description: "The task is currently being worked on." }),
Schema.Literal("completed").annotate({
description: "The task has been successfully completed.",
}),
Schema.Literal("cancelled").annotate({
description: "The task was cancelled before it completed.",
}),
Schema.String.annotate({
title: "other",
description:
"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.",
}),
]).annotate({
description:
"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)",
identifier: "PlanEntryStatus",
});
export type AvailableCommandInput =
| {
readonly type: "text";
readonly hint: string;
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
}
| ({ readonly type: string } & { readonly [x: string]: Schema.Json });
export const AvailableCommandInput = Schema.Union([
Schema.Struct({
type: Schema.Literal("text"),
hint: Schema.String.annotate({
description: "A hint to display when the input hasn't been provided yet",
}),
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description: "All text that was typed after the command name is provided as input.",
}),
Schema.StructWithRest(
Schema.Struct({
type: Schema.String.annotate({
description:
"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.",
}).check(
Schema.isPattern(new RegExp("^(?!(?:\\x74ext)$)[\\s\\S]*$")).annotate({
expected: "a string matching the RegExp ^(?!(?:\\x74ext)$)[\\s\\S]*$",
}),
),
}),
[Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))],
).annotate({
title: "other",
description:
"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.",
}),
]).annotate({
description: "The input specification for a command.",
identifier: "AvailableCommandInput",
});
export type SessionConfigId = string;
export const SessionConfigId = Schema.String.annotate({
description: "Unique identifier for a session configuration option.",
identifier: "SessionConfigId",
});
export type SessionConfigOptionCategory =
| "mode"
| "model"
| "model_config"
| "thought_level"
| string;
export const SessionConfigOptionCategory = Schema.Union([
Schema.Literal("mode").annotate({ description: "Session mode selector." }),
Schema.Literal("model").annotate({ description: "Model selector." }),
Schema.Literal("model_config").annotate({
description: "Model-related configuration parameter.",
}),
Schema.Literal("thought_level").annotate({ description: "Thought/reasoning level selector." }),
Schema.String.annotate({
title: "other",
description:
"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.",
}),
]).annotate({
description:
"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.",
identifier: "SessionConfigOptionCategory",
});
export type SessionConfigValueId = string;
export const SessionConfigValueId = Schema.String.annotate({
description: "Unique identifier for a session configuration option value.",
identifier: "SessionConfigValueId",
});
export type SessionConfigGroupId = string;
export const SessionConfigGroupId = Schema.String.annotate({
description: "Unique identifier for a session configuration option value group.",
identifier: "SessionConfigGroupId",
});
export type Cost = {
readonly amount: number;
readonly currency: string;
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const Cost = Schema.Struct({
amount: Schema.Number.annotate({
description: "Total cumulative cost for session.",
format: "double",
}).check(Schema.isFinite().annotate({ expected: "a finite number" })),
currency: Schema.String.annotate({
description: 'ISO 4217 currency code (e.g., "USD", "EUR").',
}).check(
Schema.isPattern(new RegExp("^[A-Z]{3}$")).annotate({
expected: "a string matching the RegExp ^[A-Z]{3}$",
}),
),
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({ description: "Cost information for a session.", identifier: "Cost" });
export type CompactionId = string;
export const CompactionId = Schema.String.annotate({
description:
"**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.",
identifier: "CompactionId",
});
export type CompactionStatus = "in_progress" | "completed" | "failed" | "cancelled" | string;
export const CompactionStatus = Schema.Union([
Schema.Literal("in_progress").annotate({
description: "Compaction has started and has not finished.",
}),
Schema.Literal("completed").annotate({ description: "Compaction finished successfully." }),
Schema.Literal("failed").annotate({ description: "Compaction finished unsuccessfully." }),
Schema.Literal("cancelled").annotate({
description: "Compaction was cancelled before it finished.",
}),
Schema.String.annotate({
title: "other",
description:
"Custom or future compaction status.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Other unknown values are reserved for future ACP statuses.",
}),
]).annotate({
description:
"**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.",
identifier: "CompactionStatus",
});
export type ElicitationId = string;
export const ElicitationId = Schema.String.annotate({
description: "Unique identifier for an elicitation.",
identifier: "ElicitationId",
});
export type McpConnectionId = string;
export const McpConnectionId = Schema.String.annotate({
description:
"**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.",
identifier: "McpConnectionId",
});
export type ExtNotification = Schema.Json;
export const ExtNotification = Schema.Json.annotate({
expected: "JSON value",
description:
"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)",
identifier: "ExtNotification",
});
export type RequestId = null | number | string;
export const RequestId = Schema.Union([
Schema.Null.annotate({ title: "Null", description: "The JSON-RPC `null` request id." }),
Schema.Number.annotate({
title: "Number",
description: "A numeric JSON-RPC request id.",
format: "int64",
}).check(Schema.isInt().annotate({ expected: "an integer" })),
Schema.String.annotate({ title: "Str", description: "A string JSON-RPC request id." }),
]).annotate({
description:
"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.",
identifier: "RequestId",
});
export type PermissionOptionId = string;
export const PermissionOptionId = Schema.String.annotate({
description: "Unique identifier for a permission option.",
identifier: "PermissionOptionId",
});
export type PermissionOptionKind =
| "allow_once"
| "allow_always"
| "reject_once"
| "reject_always"
| string;
export const PermissionOptionKind = Schema.Union([
Schema.Literal("allow_once").annotate({ description: "Allow this operation only this time." }),
Schema.Literal("allow_always").annotate({
description: "Allow this operation and remember the choice.",
}),
Schema.Literal("reject_once").annotate({ description: "Reject this operation only this time." }),
Schema.Literal("reject_always").annotate({
description: "Reject this operation and remember the choice.",
}),
Schema.String.annotate({
title: "other",
description:
"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.",
}),
]).annotate({
description:
"The type of permission option being presented to the user.\n\nHelps clients choose appropriate icons and UI treatment.",
identifier: "PermissionOptionKind",
});
export type ElicitationSchemaType = "object";
export const ElicitationSchemaType = Schema.Union([
Schema.Literal("object").annotate({ description: "Object schema type." }),
]).annotate({
description: "Type discriminator for elicitation schemas.",
identifier: "ElicitationSchemaType",
});
export type StringFormat = "email" | "uri" | "date" | "date-time" | string;
export const StringFormat = Schema.Union([
Schema.Literal("email").annotate({ description: "Email address format." }),
Schema.Literal("uri").annotate({ description: "URI format." }),
Schema.Literal("date").annotate({ description: "Date format (YYYY-MM-DD)." }),
Schema.Literal("date-time").annotate({ description: "Date-time format (RFC 3339)." }),
Schema.String.annotate({
title: "other",
description:
"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.",
}),
]).annotate({
description: "String format types for string properties in elicitation schemas.",
identifier: "StringFormat",
});
export type EnumOption = {
readonly const: string;
readonly title: string;
readonly description?: string | null;
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const EnumOption = Schema.Struct({
const: Schema.String.annotate({ description: "The constant value for this option." }),
title: Schema.String.annotate({ description: "Human-readable title for this option." }),
description: Schema.optionalKey(
Schema.Union([
Schema.String.annotate({
description:
"Human-readable description.\n\nOptional. Omitted and `null` are equivalent and mean no description is provided.",
}),
Schema.Null,
]),
),
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description:
"A titled enum option with a const value, human-readable title, and optional description.",
identifier: "EnumOption",
});
export type TitledMultiSelectItems = never;
export const TitledMultiSelectItems = Schema.Never.annotate({
description: "Items definition for titled multi-select enum properties.",
identifier: "TitledMultiSelectItems",
});
export type McpServerAcpId = string;
export const McpServerAcpId = Schema.String.annotate({
description:
"**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.",
identifier: "McpServerAcpId",
});
export type ExtRequest = Schema.Json;
export const ExtRequest = Schema.Json.annotate({
expected: "JSON value",
description:
"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)",
identifier: "ExtRequest",
});
export type ProtocolVersion = number;
export const ProtocolVersion = Schema.Number.annotate({
description:
"Protocol version identifier.\n\nThis version is only bumped for breaking changes.\nNon-breaking changes should be introduced via capabilities.",
format: "uint16",
})
.check(Schema.isInt().annotate({ expected: "an integer" }))
.check(
Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }),
)
.check(
Schema.isLessThanOrEqualTo(65535).annotate({
expected: "a value less than or equal to 65535",
identifier: "ProtocolVersion",
}),
);
export type Implementation = {
readonly name: string;
readonly title?: string | null;
readonly version: string;
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const Implementation = Schema.Struct({
name: Schema.String.annotate({
description:
"Intended for programmatic or logical use, but can be used as a display\nname fallback if title isn’t present.",
}),
title: Schema.optionalKey(
Schema.Union([
Schema.String.annotate({
description:
"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.",
}),
Schema.Null,
]),
),
version: Schema.String.annotate({
description:
'Version of the implementation. Can be displayed to the user or used\nfor debugging or metrics purposes. (e.g. "1.0.0").',
}),
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description:
"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.",
identifier: "Implementation",
});
export type AuthMethodId = string;
export const AuthMethodId = Schema.String.annotate({
description: "Typed identifier used for auth method values on the wire.",
identifier: "AuthMethodId",
});
export type EnvVariable = {
readonly name: string;
readonly value: string;
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const EnvVariable = Schema.Struct({
name: Schema.String.annotate({ description: "The name of the environment variable." }),
value: Schema.String.annotate({ description: "The value to set for the environment variable." }),
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description: "An environment variable to set when launching a process.",
identifier: "EnvVariable",
});
export type LoginAuthResponse = { readonly _meta?: { readonly [x: string]: Schema.Json } | null };
export const LoginAuthResponse = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description: "Response to the `auth/login` method.",
identifier: "LoginAuthResponse",
});
export type ProviderId = string;
export const ProviderId = Schema.String.annotate({
description:
"**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.",
identifier: "ProviderId",
});
export type LlmProtocol = "anthropic" | "openai" | "azure" | "vertex" | "bedrock" | string;
export const LlmProtocol = Schema.Union([
Schema.Literal("anthropic").annotate({ description: "Anthropic API protocol." }),
Schema.Literal("openai").annotate({ description: "OpenAI API protocol." }),
Schema.Literal("azure").annotate({ description: "Azure OpenAI API protocol." }),
Schema.Literal("vertex").annotate({ description: "Google Vertex AI API protocol." }),
Schema.Literal("bedrock").annotate({ description: "AWS Bedrock API protocol." }),
Schema.String.annotate({
title: "other",
description:
"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.",
}),
]).annotate({
description:
"**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.",
identifier: "LlmProtocol",
});
export type SetProviderResponse = { readonly _meta?: { readonly [x: string]: Schema.Json } | null };
export const SetProviderResponse = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description:
"**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`.",
identifier: "SetProviderResponse",
});
export type DisableProviderResponse = {
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const DisableProviderResponse = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description:
"**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`.",
identifier: "DisableProviderResponse",
});
export type LogoutAuthResponse = { readonly _meta?: { readonly [x: string]: Schema.Json } | null };
export const LogoutAuthResponse = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description: "Response to the `auth/logout` method.",
identifier: "LogoutAuthResponse",
});
export type SessionListCursor = string;
export const SessionListCursor = Schema.String.annotate({
description: "An opaque cursor used to paginate `session/list` results.",
identifier: "SessionListCursor",
});
export type DeleteSessionResponse = {
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const DeleteSessionResponse = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description: "Response from deleting a session.",
identifier: "DeleteSessionResponse",
});
export type CloseSessionResponse = {
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const CloseSessionResponse = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description: "Response from closing a session.",
identifier: "CloseSessionResponse",
});
export type PromptResponse = { readonly _meta?: { readonly [x: string]: Schema.Json } | null };
export const PromptResponse = Schema.Struct({
_meta: Schema.optionalKey(
Schema.Union([
Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({
description:
"The _meta property is reserved by 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)",
}),
Schema.Null,
]),
),
}).annotate({
description:
"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)",
identifier: "PromptResponse",
});
export type Position = {
readonly line: number;
readonly character: number;
readonly _meta?: { readonly [x: string]: Schema.Json } | null;
};
export const Position = Schema.Struct({
line: Schema.Number.annotate({ description: "Zero-based line number.", format: "uint32" })
.check(Schema.isInt().annotate({ expected: "an integer" }))
.check(
Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }),
),
character: Schema.Number.annotate({
description: "Zero-based character offset (encoding-dependent).",
format: "uint32",
})
.check(Schema.isInt().annotate({ expected: "an integer" }))
.check(
Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }),
),
_meta: Schema.optionalKey(
Schema.Union([